aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.gitignore1
-rw-r--r--Documentation/DocBook/tracepoint.tmpl5
-rw-r--r--Documentation/RCU/trace.txt254
-rw-r--r--Documentation/RCU/whatisRCU.txt2
-rw-r--r--Documentation/dontdiff3
-rw-r--r--Documentation/fb/framebuffer.txt6
-rw-r--r--Documentation/feature-removal-schedule.txt15
-rw-r--r--Documentation/filesystems/caching/fscache.txt110
-rw-r--r--Documentation/filesystems/caching/netfs-api.txt21
-rw-r--r--Documentation/filesystems/ocfs2.txt6
-rw-r--r--Documentation/filesystems/proc.txt3
-rw-r--r--Documentation/i2c/busses/i2c-piix42
-rw-r--r--Documentation/kernel-parameters.txt39
-rw-r--r--Documentation/pcmcia/driver-changes.txt12
-rw-r--r--Documentation/slow-work.txt160
-rw-r--r--Documentation/thermal/sysfs-api.txt389
-rw-r--r--Documentation/trace/ftrace-design.txt13
-rw-r--r--Documentation/trace/kprobetrace.txt149
-rw-r--r--Documentation/vm/page-types.c2
-rw-r--r--MAINTAINERS117
-rw-r--r--Makefile5
-rw-r--r--arch/Kconfig7
-rw-r--r--arch/alpha/boot/tools/objstrip.c2
-rw-r--r--arch/alpha/include/asm/fcntl.h2
-rw-r--r--arch/alpha/include/asm/thread_info.h31
-rw-r--r--arch/alpha/kernel/core_marvel.c2
-rw-r--r--arch/alpha/kernel/core_titan.c2
-rw-r--r--arch/alpha/kernel/irq.c2
-rw-r--r--arch/alpha/kernel/irq_alpha.c2
-rw-r--r--arch/alpha/kernel/irq_i8259.c2
-rw-r--r--arch/alpha/kernel/irq_pyxis.c2
-rw-r--r--arch/alpha/kernel/irq_srm.c2
-rw-r--r--arch/alpha/kernel/sys_alcor.c2
-rw-r--r--arch/alpha/kernel/sys_cabriolet.c2
-rw-r--r--arch/alpha/kernel/sys_dp264.c4
-rw-r--r--arch/alpha/kernel/sys_eb64p.c2
-rw-r--r--arch/alpha/kernel/sys_eiger.c2
-rw-r--r--arch/alpha/kernel/sys_jensen.c2
-rw-r--r--arch/alpha/kernel/sys_marvel.c6
-rw-r--r--arch/alpha/kernel/sys_mikasa.c2
-rw-r--r--arch/alpha/kernel/sys_noritake.c2
-rw-r--r--arch/alpha/kernel/sys_rawhide.c2
-rw-r--r--arch/alpha/kernel/sys_ruffian.c2
-rw-r--r--arch/alpha/kernel/sys_rx164.c2
-rw-r--r--arch/alpha/kernel/sys_sable.c2
-rw-r--r--arch/alpha/kernel/sys_takara.c2
-rw-r--r--arch/alpha/kernel/sys_titan.c2
-rw-r--r--arch/alpha/kernel/sys_wildfire.c2
-rw-r--r--arch/arm/configs/ams_delta_defconfig24
-rw-r--r--arch/arm/configs/kirkwood_defconfig260
-rw-r--r--arch/arm/configs/omap3_pandora_defconfig49
-rw-r--r--arch/arm/configs/omap_3430sdp_defconfig9
-rw-r--r--arch/arm/configs/orion5x_defconfig278
-rw-r--r--arch/arm/include/asm/kmap_types.h6
-rw-r--r--arch/arm/include/asm/unistd.h9
-rw-r--r--arch/arm/kernel/entry-armv.S7
-rw-r--r--arch/arm/kernel/head-common.S2
-rw-r--r--arch/arm/kernel/signal.c8
-rw-r--r--arch/arm/kernel/smp_scu.c4
-rw-r--r--arch/arm/kernel/traps.c4
-rw-r--r--arch/arm/mach-at91/Kconfig20
-rw-r--r--arch/arm/mach-at91/board-sam9g20ek-2slot-mmc.c23
-rw-r--r--arch/arm/mach-at91/include/mach/cpu.h9
-rw-r--r--arch/arm/mach-ep93xx/micro9.c1
-rw-r--r--arch/arm/mach-kirkwood/addr-map.c2
-rw-r--r--arch/arm/mach-kirkwood/common.c10
-rw-r--r--arch/arm/mach-kirkwood/include/mach/bridge-regs.h3
-rw-r--r--arch/arm/mach-kirkwood/include/mach/io.h2
-rw-r--r--arch/arm/mach-kirkwood/include/mach/kirkwood.h1
-rw-r--r--arch/arm/mach-kirkwood/openrd_base-setup.c12
-rw-r--r--arch/arm/mach-kirkwood/pcie.c6
-rw-r--r--arch/arm/mach-ks8695/include/mach/regs-switch.h2
-rw-r--r--arch/arm/mach-mmp/include/mach/mfp-pxa910.h2
-rw-r--r--arch/arm/mach-mv78xx0/common.c2
-rw-r--r--arch/arm/mach-mv78xx0/include/mach/mv78xx0.h1
-rw-r--r--arch/arm/mach-omap2/board-omap3beagle.c2
-rw-r--r--arch/arm/mach-omap2/board-omap3pandora.c78
-rw-r--r--arch/arm/mach-omap2/board-zoom2.c87
-rw-r--r--arch/arm/mach-omap2/clock34xx.c2
-rw-r--r--arch/arm/mach-omap2/clock34xx.h4
-rw-r--r--arch/arm/mach-omap2/gpmc.c4
-rw-r--r--arch/arm/mach-omap2/mailbox.c2
-rw-r--r--arch/arm/mach-pxa/colibri-pxa320.c4
-rw-r--r--arch/arm/mach-pxa/cpufreq-pxa2xx.c1
-rw-r--r--arch/arm/mach-pxa/cpufreq-pxa3xx.c2
-rw-r--r--arch/arm/mach-pxa/hx4700.c2
-rw-r--r--arch/arm/mach-pxa/include/mach/entry-macro.S1
-rw-r--r--arch/arm/mach-pxa/irq.c11
-rw-r--r--arch/arm/mach-pxa/palmtc.c8
-rw-r--r--arch/arm/mach-pxa/spitz.c41
-rw-r--r--arch/arm/mach-realview/Kconfig5
-rw-r--r--arch/arm/mach-realview/core.c42
-rw-r--r--arch/arm/mach-realview/core.h6
-rw-r--r--arch/arm/mach-realview/include/mach/memory.h49
-rw-r--r--arch/arm/mach-realview/platsmp.c5
-rw-r--r--arch/arm/mach-realview/realview_eb.c1
-rw-r--r--arch/arm/mach-realview/realview_pb1176.c13
-rw-r--r--arch/arm/mach-realview/realview_pb11mp.c1
-rw-r--r--arch/arm/mach-realview/realview_pba8.c1
-rw-r--r--arch/arm/mach-realview/realview_pbx.c21
-rw-r--r--arch/arm/mach-s3c2410/gpio.c1
-rw-r--r--arch/arm/mach-s3c2410/include/mach/dma.h7
-rw-r--r--arch/arm/mach-s3c2440/Kconfig1
-rw-r--r--arch/arm/mach-s3c2440/mach-mini2440.c4
-rw-r--r--arch/arm/mach-s3c6400/include/mach/dma.h7
-rw-r--r--arch/arm/mach-s3c6410/Kconfig1
-rw-r--r--arch/arm/mach-s3c6410/mach-smdk6410.c3
-rw-r--r--arch/arm/mach-u300/core.c2
-rw-r--r--arch/arm/mm/proc-v7.S7
-rw-r--r--arch/arm/plat-omap/cpu-omap.c2
-rw-r--r--arch/arm/plat-omap/dma.c14
-rw-r--r--arch/arm/plat-omap/gpio.c2
-rw-r--r--arch/arm/plat-pxa/include/plat/mfp.h2
-rw-r--r--arch/arm/plat-pxa/mfp.c4
-rw-r--r--arch/arm/plat-s3c24xx/adc.c2
-rw-r--r--arch/arm/plat-s3c24xx/cpu.c10
-rw-r--r--arch/arm/plat-s3c24xx/dma.c6
-rw-r--r--arch/arm/plat-s3c24xx/gpio.c1
-rw-r--r--arch/arm/plat-s3c24xx/include/plat/cpu-freq-core.h9
-rw-r--r--arch/arm/plat-s3c24xx/include/plat/s3c2410.h1
-rw-r--r--arch/arm/plat-s3c64xx/dma.c76
-rw-r--r--arch/arm/plat-s3c64xx/include/plat/regs-clock.h4
-rw-r--r--arch/arm/plat-s3c64xx/s3c6400-clock.c3
-rw-r--r--arch/arm/tools/mach-types119
-rw-r--r--arch/avr32/include/asm/bug.h2
-rw-r--r--arch/avr32/mach-at32ap/include/mach/cpu.h3
-rw-r--r--arch/blackfin/kernel/bfin_dma_5xx.c9
-rw-r--r--arch/blackfin/kernel/cplb-mpu/cplbinit.c2
-rw-r--r--arch/blackfin/kernel/process.c2
-rw-r--r--arch/blackfin/kernel/ptrace.c2
-rw-r--r--arch/blackfin/mach-bf518/include/mach/anomaly.h18
-rw-r--r--arch/blackfin/mach-bf527/include/mach/anomaly.h20
-rw-r--r--arch/blackfin/mach-bf533/include/mach/anomaly.h18
-rw-r--r--arch/blackfin/mach-bf537/include/mach/anomaly.h18
-rw-r--r--arch/blackfin/mach-bf538/include/mach/anomaly.h18
-rw-r--r--arch/blackfin/mach-bf548/include/mach/anomaly.h23
-rw-r--r--arch/blackfin/mach-bf561/atomic.S14
-rw-r--r--arch/blackfin/mach-bf561/include/mach/anomaly.h25
-rw-r--r--arch/blackfin/mach-common/arch_checks.c5
-rw-r--r--arch/blackfin/mach-common/smp.c6
-rw-r--r--arch/ia64/include/asm/swiotlb.h2
-rw-r--r--arch/ia64/kernel/pci-swiotlb.c4
-rw-r--r--arch/m32r/Kconfig3
-rw-r--r--arch/m32r/boot/compressed/Makefile18
-rw-r--r--arch/m32r/boot/compressed/misc.c143
-rw-r--r--arch/m32r/kernel/smp.c2
-rw-r--r--arch/m32r/kernel/time.c6
-rw-r--r--arch/m32r/kernel/vmlinux.lds.S2
-rw-r--r--arch/mips/Kconfig26
-rw-r--r--arch/mips/alchemy/common/irq.c34
-rw-r--r--arch/mips/alchemy/mtx-1/board_setup.c3
-rw-r--r--arch/mips/ar7/platform.c9
-rw-r--r--arch/mips/bcm47xx/prom.c2
-rw-r--r--arch/mips/bcm63xx/Makefile2
-rw-r--r--arch/mips/bcm63xx/boards/board_bcm963xx.c3
-rw-r--r--arch/mips/bcm63xx/cpu.c3
-rw-r--r--arch/mips/bcm63xx/dev-uart.c2
-rw-r--r--arch/mips/bcm63xx/dev-wdt.c37
-rw-r--r--arch/mips/bcm63xx/setup.c4
-rw-r--r--arch/mips/cavium-octeon/octeon-irq.c224
-rw-r--r--arch/mips/cavium-octeon/smp.c5
-rw-r--r--arch/mips/configs/rbtx49xx_defconfig252
-rw-r--r--arch/mips/include/asm/bug.h4
-rw-r--r--arch/mips/include/asm/dma-mapping.h11
-rw-r--r--arch/mips/include/asm/fixmap.h4
-rw-r--r--arch/mips/include/asm/gcmpregs.h18
-rw-r--r--arch/mips/include/asm/gic.h188
-rw-r--r--arch/mips/include/asm/mach-ar7/ar7.h3
-rw-r--r--arch/mips/include/asm/mach-au1x00/gpio-au1000.h2
-rw-r--r--arch/mips/include/asm/mach-bcm63xx/bcm63xx_dev_uart.h6
-rw-r--r--arch/mips/include/asm/mach-ip27/topology.h4
-rw-r--r--arch/mips/include/asm/mach-loongson/cpu-feature-overrides.h3
-rw-r--r--arch/mips/include/asm/mman.h1
-rw-r--r--arch/mips/include/asm/mmu_context.h13
-rw-r--r--arch/mips/include/asm/setup.h2
-rw-r--r--arch/mips/include/asm/smtc_ipi.h1
-rw-r--r--arch/mips/include/asm/spram.h10
-rw-r--r--arch/mips/include/asm/system.h15
-rw-r--r--arch/mips/include/asm/thread_info.h9
-rw-r--r--arch/mips/jazz/irq.c2
-rw-r--r--arch/mips/kernel/cevt-bcm1480.c2
-rw-r--r--arch/mips/kernel/cevt-ds1287.c2
-rw-r--r--arch/mips/kernel/cevt-gt641xx.c2
-rw-r--r--arch/mips/kernel/cevt-r4k.c2
-rw-r--r--arch/mips/kernel/cevt-sb1250.c2
-rw-r--r--arch/mips/kernel/cevt-smtc.c3
-rw-r--r--arch/mips/kernel/cevt-txx9.c2
-rw-r--r--arch/mips/kernel/cpu-probe.c8
-rw-r--r--arch/mips/kernel/head.S1
-rw-r--r--arch/mips/kernel/i8253.c2
-rw-r--r--arch/mips/kernel/irq-gic.c114
-rw-r--r--arch/mips/kernel/linux32.c6
-rw-r--r--arch/mips/kernel/scall64-o32.S4
-rw-r--r--arch/mips/kernel/smtc.c34
-rw-r--r--arch/mips/kernel/spram.c5
-rw-r--r--arch/mips/kernel/syscall.c4
-rw-r--r--arch/mips/kernel/vpe.c2
-rw-r--r--arch/mips/loongson/common/irq.c1
-rw-r--r--arch/mips/math-emu/cp1emu.c41
-rw-r--r--arch/mips/math-emu/dp_simple.c13
-rw-r--r--arch/mips/math-emu/sp_simple.c11
-rw-r--r--arch/mips/mm/dma-default.c7
-rw-r--r--arch/mips/mm/init.c6
-rw-r--r--arch/mips/mti-malta/malta-amon.c7
-rw-r--r--arch/mips/mti-malta/malta-int.c119
-rw-r--r--arch/mips/mti-malta/malta-memory.c3
-rw-r--r--arch/mips/mti-malta/malta-pci.c27
-rw-r--r--arch/mips/nxp/pnx8550/common/int.c2
-rw-r--r--arch/mips/nxp/pnx8550/common/time.c4
-rw-r--r--arch/mips/oprofile/op_model_loongson2.c2
-rw-r--r--arch/mips/rb532/devices.c3
-rw-r--r--arch/mips/rb532/prom.c2
-rw-r--r--arch/mips/sgi-ip27/ip27-timer.c2
-rw-r--r--arch/mips/sni/time.c2
-rw-r--r--arch/mips/txx9/generic/setup.c9
-rw-r--r--arch/parisc/include/asm/fcntl.h2
-rw-r--r--arch/parisc/kernel/unwind.c2
-rw-r--r--arch/parisc/kernel/vmlinux.lds.S6
-rw-r--r--arch/powerpc/Kconfig4
-rw-r--r--arch/powerpc/Kconfig.debug2
-rw-r--r--arch/powerpc/boot/addRamDisk.c6
-rw-r--r--arch/powerpc/boot/dts/mpc8377_wlan.dts2
-rw-r--r--arch/powerpc/boot/dts/mpc8569mds.dts4
-rw-r--r--arch/powerpc/boot/dts/sbc8548.dts17
-rw-r--r--arch/powerpc/configs/83xx/asp8347_defconfig60
-rw-r--r--arch/powerpc/configs/83xx/kmeter1_defconfig46
-rw-r--r--arch/powerpc/configs/83xx/mpc8313_rdb_defconfig73
-rw-r--r--arch/powerpc/configs/83xx/mpc8315_rdb_defconfig76
-rw-r--r--arch/powerpc/configs/83xx/mpc832x_mds_defconfig62
-rw-r--r--arch/powerpc/configs/83xx/mpc832x_rdb_defconfig66
-rw-r--r--arch/powerpc/configs/83xx/mpc834x_itx_defconfig60
-rw-r--r--arch/powerpc/configs/83xx/mpc834x_itxgp_defconfig58
-rw-r--r--arch/powerpc/configs/83xx/mpc834x_mds_defconfig58
-rw-r--r--arch/powerpc/configs/83xx/mpc836x_mds_defconfig64
-rw-r--r--arch/powerpc/configs/83xx/mpc836x_rdk_defconfig60
-rw-r--r--arch/powerpc/configs/83xx/mpc837x_mds_defconfig64
-rw-r--r--arch/powerpc/configs/83xx/mpc837x_rdb_defconfig70
-rw-r--r--arch/powerpc/configs/83xx/sbc834x_defconfig61
-rw-r--r--arch/powerpc/configs/85xx/ksi8560_defconfig61
-rw-r--r--arch/powerpc/configs/85xx/mpc8540_ads_defconfig57
-rw-r--r--arch/powerpc/configs/85xx/mpc8560_ads_defconfig63
-rw-r--r--arch/powerpc/configs/85xx/mpc85xx_cds_defconfig58
-rw-r--r--arch/powerpc/configs/85xx/sbc8548_defconfig53
-rw-r--r--arch/powerpc/configs/85xx/sbc8560_defconfig57
-rw-r--r--arch/powerpc/configs/85xx/socrates_defconfig68
-rw-r--r--arch/powerpc/configs/85xx/stx_gp3_defconfig77
-rw-r--r--arch/powerpc/configs/85xx/tqm8540_defconfig59
-rw-r--r--arch/powerpc/configs/85xx/tqm8541_defconfig64
-rw-r--r--arch/powerpc/configs/85xx/tqm8548_defconfig64
-rw-r--r--arch/powerpc/configs/85xx/tqm8555_defconfig64
-rw-r--r--arch/powerpc/configs/85xx/tqm8560_defconfig64
-rw-r--r--arch/powerpc/configs/85xx/xes_mpc85xx_defconfig76
-rw-r--r--arch/powerpc/configs/86xx/gef_ppc9a_defconfig74
-rw-r--r--arch/powerpc/configs/86xx/gef_sbc310_defconfig72
-rw-r--r--arch/powerpc/configs/86xx/gef_sbc610_defconfig80
-rw-r--r--arch/powerpc/configs/86xx/mpc8610_hpcd_defconfig64
-rw-r--r--arch/powerpc/configs/86xx/mpc8641_hpcn_defconfig65
-rw-r--r--arch/powerpc/configs/86xx/sbc8641d_defconfig66
-rw-r--r--arch/powerpc/configs/adder875_defconfig48
-rw-r--r--arch/powerpc/configs/c2k_defconfig77
-rw-r--r--arch/powerpc/configs/ep8248e_defconfig49
-rw-r--r--arch/powerpc/configs/ep88xc_defconfig47
-rw-r--r--arch/powerpc/configs/linkstation_defconfig72
-rw-r--r--arch/powerpc/configs/mgcoge_defconfig51
-rw-r--r--arch/powerpc/configs/mgsuvd_defconfig45
-rw-r--r--arch/powerpc/configs/mpc7448_hpc2_defconfig58
-rw-r--r--arch/powerpc/configs/mpc8272_ads_defconfig52
-rw-r--r--arch/powerpc/configs/mpc83xx_defconfig90
-rw-r--r--arch/powerpc/configs/mpc85xx_defconfig98
-rw-r--r--arch/powerpc/configs/mpc85xx_smp_defconfig99
-rw-r--r--arch/powerpc/configs/mpc866_ads_defconfig54
-rw-r--r--arch/powerpc/configs/mpc86xx_defconfig70
-rw-r--r--arch/powerpc/configs/mpc885_ads_defconfig47
-rw-r--r--arch/powerpc/configs/pasemi_defconfig628
-rw-r--r--arch/powerpc/configs/pq2fads_defconfig55
-rw-r--r--arch/powerpc/configs/prpmc2800_defconfig67
-rw-r--r--arch/powerpc/configs/pseries_defconfig2
-rw-r--r--arch/powerpc/configs/storcenter_defconfig54
-rw-r--r--arch/powerpc/include/asm/emulated_ops.h19
-rw-r--r--arch/powerpc/include/asm/hvcall.h2
-rw-r--r--arch/powerpc/include/asm/kmap_types.h11
-rw-r--r--arch/powerpc/include/asm/reg.h2
-rw-r--r--arch/powerpc/include/asm/trace.h133
-rw-r--r--arch/powerpc/kernel/align.c12
-rw-r--r--arch/powerpc/kernel/entry_64.S4
-rw-r--r--arch/powerpc/kernel/exceptions-64s.S3
-rw-r--r--arch/powerpc/kernel/irq.c6
-rw-r--r--arch/powerpc/kernel/perf_event.c2
-rw-r--r--arch/powerpc/kernel/power5+-pmu.c4
-rw-r--r--arch/powerpc/kernel/power5-pmu.c6
-rw-r--r--arch/powerpc/kernel/power6-pmu.c2
-rw-r--r--arch/powerpc/kernel/power7-pmu.c6
-rw-r--r--arch/powerpc/kernel/ppc970-pmu.c4
-rw-r--r--arch/powerpc/kernel/setup-common.c1
-rw-r--r--arch/powerpc/kernel/setup_32.c2
-rw-r--r--arch/powerpc/kernel/setup_64.c2
-rw-r--r--arch/powerpc/kernel/time.c21
-rw-r--r--arch/powerpc/kernel/traps.c18
-rw-r--r--arch/powerpc/kvm/timing.h4
-rw-r--r--arch/powerpc/lib/copypage_64.S4
-rw-r--r--arch/powerpc/mm/mmu_context_nohash.c4
-rw-r--r--arch/powerpc/platforms/82xx/ep8248e.c15
-rw-r--r--arch/powerpc/platforms/pseries/hvCall.S132
-rw-r--r--arch/powerpc/platforms/pseries/hvCall_inst.c38
-rw-r--r--arch/powerpc/platforms/pseries/lpar.c33
-rw-r--r--arch/powerpc/platforms/pseries/msi.c2
-rw-r--r--arch/powerpc/platforms/pseries/xics.c9
-rw-r--r--arch/s390/Kconfig28
-rw-r--r--arch/s390/include/asm/bug.h2
-rw-r--r--arch/s390/include/asm/spinlock.h29
-rw-r--r--arch/s390/kernel/early.c9
-rw-r--r--arch/s390/kernel/entry.S8
-rw-r--r--arch/s390/kernel/entry64.S8
-rw-r--r--arch/s390/kernel/ftrace.c67
-rw-r--r--arch/sh/include/asm/rwsem.h2
-rw-r--r--arch/sh/kernel/cpu/irq/imask.c2
-rw-r--r--arch/sh/kernel/cpu/irq/intc-sh5.c2
-rw-r--r--arch/sh/kernel/dwarf.c2
-rw-r--r--arch/sh/mm/cache-sh4.c5
-rw-r--r--arch/sparc/boot/btfixupprep.c8
-rw-r--r--arch/sparc/boot/piggyback_32.c10
-rw-r--r--arch/sparc/boot/piggyback_64.c2
-rw-r--r--arch/sparc/include/asm/system_64.h4
-rw-r--r--arch/sparc/kernel/prom_common.c4
-rw-r--r--arch/sparc/kernel/visemul.c2
-rw-r--r--arch/sparc/mm/init_64.h2
-rw-r--r--arch/x86/Kconfig1
-rw-r--r--arch/x86/Kconfig.cpu2
-rw-r--r--arch/x86/Kconfig.debug23
-rw-r--r--arch/x86/Makefile3
-rw-r--r--arch/x86/Makefile_32.cpu2
-rw-r--r--arch/x86/include/asm/Kbuild1
-rw-r--r--arch/x86/include/asm/a.out-core.h10
-rw-r--r--arch/x86/include/asm/alternative-asm.h10
-rw-r--r--arch/x86/include/asm/alternative.h1
-rw-r--r--arch/x86/include/asm/amd_iommu.h15
-rw-r--r--arch/x86/include/asm/amd_iommu_proto.h38
-rw-r--r--arch/x86/include/asm/amd_iommu_types.h54
-rw-r--r--arch/x86/include/asm/apic.h21
-rw-r--r--arch/x86/include/asm/apicdef.h6
-rw-r--r--arch/x86/include/asm/apicnum.h12
-rw-r--r--arch/x86/include/asm/bug.h4
-rw-r--r--arch/x86/include/asm/calgary.h2
-rw-r--r--arch/x86/include/asm/cmpxchg_32.h218
-rw-r--r--arch/x86/include/asm/cmpxchg_64.h234
-rw-r--r--arch/x86/include/asm/debugreg.h33
-rw-r--r--arch/x86/include/asm/desc.h2
-rw-r--r--arch/x86/include/asm/device.h2
-rw-r--r--arch/x86/include/asm/dma-mapping.h15
-rw-r--r--arch/x86/include/asm/gart.h9
-rw-r--r--arch/x86/include/asm/hardirq.h6
-rw-r--r--arch/x86/include/asm/hw_breakpoint.h73
-rw-r--r--arch/x86/include/asm/hw_irq.h30
-rw-r--r--arch/x86/include/asm/inat.h220
-rw-r--r--arch/x86/include/asm/inat_types.h29
-rw-r--r--arch/x86/include/asm/insn.h184
-rw-r--r--arch/x86/include/asm/iommu.h2
-rw-r--r--arch/x86/include/asm/irq.h1
-rw-r--r--arch/x86/include/asm/mce.h14
-rw-r--r--arch/x86/include/asm/mpspec.h16
-rw-r--r--arch/x86/include/asm/msr.h8
-rw-r--r--arch/x86/include/asm/perf_event.h13
-rw-r--r--arch/x86/include/asm/processor.h16
-rw-r--r--arch/x86/include/asm/ptrace.h62
-rw-r--r--arch/x86/include/asm/string_32.h9
-rw-r--r--arch/x86/include/asm/swiotlb.h9
-rw-r--r--arch/x86/include/asm/system.h31
-rw-r--r--arch/x86/include/asm/topology.h2
-rw-r--r--arch/x86/include/asm/uaccess.h1
-rw-r--r--arch/x86/include/asm/uaccess_32.h27
-rw-r--r--arch/x86/include/asm/uaccess_64.h36
-rw-r--r--arch/x86/include/asm/uv/uv_irq.h14
-rw-r--r--arch/x86/include/asm/x86_init.h10
-rw-r--r--arch/x86/kernel/Makefile2
-rw-r--r--arch/x86/kernel/acpi/processor.c3
-rw-r--r--arch/x86/kernel/amd_iommu.c1245
-rw-r--r--arch/x86/kernel/amd_iommu_init.c118
-rw-r--r--arch/x86/kernel/aperture_64.c4
-rw-r--r--arch/x86/kernel/apic/Makefile2
-rw-r--r--arch/x86/kernel/apic/apic.c34
-rw-r--r--arch/x86/kernel/apic/apic_noop.c200
-rw-r--r--arch/x86/kernel/apic/bigsmp_32.c13
-rw-r--r--arch/x86/kernel/apic/es7000_32.c16
-rw-r--r--arch/x86/kernel/apic/io_apic.c364
-rw-r--r--arch/x86/kernel/apic/numaq_32.c13
-rw-r--r--arch/x86/kernel/apic/probe_32.c2
-rw-r--r--arch/x86/kernel/apic/summit_32.c10
-rw-r--r--arch/x86/kernel/apic/x2apic_uv_x.c8
-rw-r--r--arch/x86/kernel/apm_32.c14
-rw-r--r--arch/x86/kernel/cpu/Makefile1
-rw-r--r--arch/x86/kernel/cpu/common.c4
-rw-r--r--arch/x86/kernel/cpu/cpufreq/acpi-cpufreq.c23
-rw-r--r--arch/x86/kernel/cpu/cpufreq/longhaul.c2
-rw-r--r--arch/x86/kernel/cpu/cpufreq/powernow-k8.c2
-rw-r--r--arch/x86/kernel/cpu/cpufreq/speedstep-ich.c19
-rw-r--r--arch/x86/kernel/cpu/mcheck/mce.c103
-rw-r--r--arch/x86/kernel/cpu/mcheck/therm_throt.c29
-rw-r--r--arch/x86/kernel/cpu/mtrr/cleanup.c2
-rw-r--r--arch/x86/kernel/cpu/perf_event.c205
-rw-r--r--arch/x86/kernel/cpu/perfctr-watchdog.c2
-rw-r--r--arch/x86/kernel/cpuid.c17
-rw-r--r--arch/x86/kernel/crash.c5
-rw-r--r--arch/x86/kernel/dumpstack.c7
-rw-r--r--arch/x86/kernel/entry_32.S31
-rw-r--r--arch/x86/kernel/entry_64.S25
-rw-r--r--arch/x86/kernel/ftrace.c84
-rw-r--r--arch/x86/kernel/head_64.S4
-rw-r--r--arch/x86/kernel/hw_breakpoint.c555
-rw-r--r--arch/x86/kernel/irq.c102
-rw-r--r--arch/x86/kernel/irq_32.c45
-rw-r--r--arch/x86/kernel/irq_64.c58
-rw-r--r--arch/x86/kernel/kgdb.c9
-rw-r--r--arch/x86/kernel/kprobes.c257
-rw-r--r--arch/x86/kernel/machine_kexec_32.c2
-rw-r--r--arch/x86/kernel/machine_kexec_64.c2
-rw-r--r--arch/x86/kernel/microcode_amd.c6
-rw-r--r--arch/x86/kernel/microcode_core.c2
-rw-r--r--arch/x86/kernel/msr.c16
-rw-r--r--arch/x86/kernel/pci-calgary_64.c94
-rw-r--r--arch/x86/kernel/pci-dma.c45
-rw-r--r--arch/x86/kernel/pci-gart_64.c156
-rw-r--r--arch/x86/kernel/pci-nommu.c11
-rw-r--r--arch/x86/kernel/pci-swiotlb.c18
-rw-r--r--arch/x86/kernel/process.c21
-rw-r--r--arch/x86/kernel/process_32.c8
-rw-r--r--arch/x86/kernel/process_64.c12
-rw-r--r--arch/x86/kernel/ptrace.c415
-rw-r--r--arch/x86/kernel/reboot.c12
-rw-r--r--arch/x86/kernel/setup.c14
-rw-r--r--arch/x86/kernel/signal.c9
-rw-r--r--arch/x86/kernel/smpboot.c9
-rw-r--r--arch/x86/kernel/traps.c73
-rw-r--r--arch/x86/kernel/uv_irq.c239
-rw-r--r--arch/x86/kernel/visws_quirks.c8
-rw-r--r--arch/x86/kernel/x8664_ksyms_64.c5
-rw-r--r--arch/x86/kernel/x86_init.c8
-rw-r--r--arch/x86/kvm/x86.c22
-rw-r--r--arch/x86/lib/.gitignore1
-rw-r--r--arch/x86/lib/Makefile13
-rw-r--r--arch/x86/lib/copy_user_64.S14
-rw-r--r--arch/x86/lib/inat.c90
-rw-r--r--arch/x86/lib/insn.c516
-rw-r--r--arch/x86/lib/msr.c46
-rw-r--r--arch/x86/lib/usercopy_32.c10
-rw-r--r--arch/x86/lib/x86-opcode-map.txt893
-rw-r--r--arch/x86/mm/extable.c31
-rw-r--r--arch/x86/mm/fault.c11
-rw-r--r--arch/x86/mm/ioremap.c24
-rw-r--r--arch/x86/mm/kmmio.c8
-rw-r--r--arch/x86/mm/srat_64.c4
-rw-r--r--arch/x86/mm/testmmiotrace.c29
-rw-r--r--arch/x86/power/cpu.c26
-rw-r--r--arch/x86/tools/Makefile31
-rw-r--r--arch/x86/tools/chkobjdump.awk23
-rw-r--r--arch/x86/tools/distill.awk47
-rw-r--r--arch/x86/tools/gen-insn-attr-x86.awk380
-rw-r--r--arch/x86/tools/test_get_len.c173
-rw-r--r--arch/x86/xen/enlighten.c11
-rw-r--r--block/cfq-iosched.c19
-rw-r--r--crypto/async_tx/Kconfig5
-rw-r--r--crypto/async_tx/async_pq.c14
-rw-r--r--crypto/async_tx/async_xor.c15
-rw-r--r--crypto/gcm.c107
-rw-r--r--drivers/acpi/acpica/acconfig.h4
-rw-r--r--drivers/acpi/acpica/acpredef.h5
-rw-r--r--drivers/acpi/acpica/exregion.c35
-rw-r--r--drivers/acpi/blacklist.c17
-rw-r--r--drivers/acpi/power_meter.c6
-rw-r--r--drivers/acpi/proc.c2
-rw-r--r--drivers/acpi/processor_core.c2
-rw-r--r--drivers/acpi/processor_throttling.c6
-rw-r--r--drivers/acpi/sleep.c32
-rw-r--r--drivers/acpi/video.c8
-rw-r--r--drivers/ata/ahci.c40
-rw-r--r--drivers/ata/libata-core.c9
-rw-r--r--drivers/ata/pata_pcmcia.c17
-rw-r--r--drivers/ata/sata_fsl.c84
-rw-r--r--drivers/ata/sata_via.c1
-rw-r--r--drivers/base/power/main.c1
-rw-r--r--drivers/base/power/runtime.c16
-rw-r--r--drivers/block/aoe/aoecmd.c23
-rw-r--r--drivers/block/cciss.c16
-rw-r--r--drivers/bluetooth/bluecard_cs.c16
-rw-r--r--drivers/bluetooth/bt3c_cs.c13
-rw-r--r--drivers/bluetooth/btuart_cs.c13
-rw-r--r--drivers/bluetooth/btusb.c5
-rw-r--r--drivers/bluetooth/dtl1_cs.c12
-rw-r--r--drivers/char/agp/Kconfig3
-rw-r--r--drivers/char/agp/intel-agp.c19
-rw-r--r--drivers/char/hvc_xen.c25
-rw-r--r--drivers/char/keyboard.c2
-rw-r--r--drivers/char/pcmcia/cm4000_cs.c73
-rw-r--r--drivers/char/pcmcia/cm4040_cs.c52
-rw-r--r--drivers/char/pcmcia/ipwireless/hardware.c8
-rw-r--r--drivers/char/pcmcia/ipwireless/main.c296
-rw-r--r--drivers/char/pcmcia/synclink_cs.c80
-rw-r--r--drivers/char/tpm/tpm.c2
-rw-r--r--drivers/char/tpm/tpm_tis.c11
-rw-r--r--drivers/char/tty_port.c10
-rw-r--r--drivers/char/vt_ioctl.c6
-rw-r--r--drivers/cpufreq/cpufreq.c48
-rw-r--r--drivers/cpufreq/cpufreq_conservative.c4
-rw-r--r--drivers/cpufreq/cpufreq_ondemand.c4
-rw-r--r--drivers/crypto/padlock-aes.c4
-rw-r--r--drivers/dma/Kconfig2
-rw-r--r--drivers/dma/dmaengine.c10
-rw-r--r--drivers/dma/ioat/dca.c6
-rw-r--r--drivers/dma/ioat/dma.h4
-rw-r--r--drivers/dma/ioat/dma_v2.c2
-rw-r--r--drivers/dma/ioat/dma_v3.c44
-rw-r--r--drivers/dma/ioat/hw.h2
-rw-r--r--drivers/dma/ioat/registers.h4
-rw-r--r--drivers/dma/shdma.c12
-rw-r--r--drivers/edac/amd64_edac.c6
-rw-r--r--drivers/edac/edac_mce_amd.c21
-rw-r--r--drivers/firewire/ohci.c41
-rw-r--r--drivers/gpio/gpiolib.c8
-rw-r--r--drivers/gpio/langwell_gpio.c11
-rw-r--r--drivers/gpu/drm/Kconfig1
-rw-r--r--drivers/gpu/drm/drm_crtc_helper.c1
-rw-r--r--drivers/gpu/drm/drm_edid.c6
-rw-r--r--drivers/gpu/drm/drm_fb_helper.c8
-rw-r--r--drivers/gpu/drm/drm_gem.c2
-rw-r--r--drivers/gpu/drm/drm_mm.c9
-rw-r--r--drivers/gpu/drm/i915/i915_debugfs.c4
-rw-r--r--drivers/gpu/drm/i915/i915_dma.c3
-rw-r--r--drivers/gpu/drm/i915/i915_drv.h51
-rw-r--r--drivers/gpu/drm/i915/i915_irq.c10
-rw-r--r--drivers/gpu/drm/i915/i915_reg.h30
-rw-r--r--drivers/gpu/drm/i915/i915_suspend.c341
-rw-r--r--drivers/gpu/drm/i915/intel_bios.c14
-rw-r--r--drivers/gpu/drm/i915/intel_crt.c4
-rw-r--r--drivers/gpu/drm/i915/intel_display.c193
-rw-r--r--drivers/gpu/drm/i915/intel_dp.c2
-rw-r--r--drivers/gpu/drm/i915/intel_hdmi.c26
-rw-r--r--drivers/gpu/drm/i915/intel_lvds.c10
-rw-r--r--drivers/gpu/drm/radeon/Makefile2
-rw-r--r--drivers/gpu/drm/radeon/atom.c1
-rw-r--r--drivers/gpu/drm/radeon/atombios.h2
-rw-r--r--drivers/gpu/drm/radeon/atombios_crtc.c357
-rw-r--r--drivers/gpu/drm/radeon/mkregtable.c12
-rw-r--r--drivers/gpu/drm/radeon/r100.c42
-rw-r--r--drivers/gpu/drm/radeon/r300.c2
-rw-r--r--drivers/gpu/drm/radeon/r420.c2
-rw-r--r--drivers/gpu/drm/radeon/r500_reg.h9
-rw-r--r--drivers/gpu/drm/radeon/r520.c2
-rw-r--r--drivers/gpu/drm/radeon/r600.c108
-rw-r--r--drivers/gpu/drm/radeon/r600_blit.c58
-rw-r--r--drivers/gpu/drm/radeon/r600_blit_kms.c5
-rw-r--r--drivers/gpu/drm/radeon/r600_cs.c18
-rw-r--r--drivers/gpu/drm/radeon/r600d.h14
-rw-r--r--drivers/gpu/drm/radeon/radeon.h12
-rw-r--r--drivers/gpu/drm/radeon/radeon_agp.c12
-rw-r--r--drivers/gpu/drm/radeon/radeon_asic.h23
-rw-r--r--drivers/gpu/drm/radeon/radeon_atombios.c282
-rw-r--r--drivers/gpu/drm/radeon/radeon_benchmark.c4
-rw-r--r--drivers/gpu/drm/radeon/radeon_bios.c3
-rw-r--r--drivers/gpu/drm/radeon/radeon_clocks.c2
-rw-r--r--drivers/gpu/drm/radeon/radeon_combios.c287
-rw-r--r--drivers/gpu/drm/radeon/radeon_connectors.c211
-rw-r--r--drivers/gpu/drm/radeon/radeon_cursor.c10
-rw-r--r--drivers/gpu/drm/radeon/radeon_device.c31
-rw-r--r--drivers/gpu/drm/radeon/radeon_display.c28
-rw-r--r--drivers/gpu/drm/radeon/radeon_encoders.c125
-rw-r--r--drivers/gpu/drm/radeon/radeon_gart.c20
-rw-r--r--drivers/gpu/drm/radeon/radeon_irq_kms.c9
-rw-r--r--drivers/gpu/drm/radeon/radeon_legacy_crtc.c40
-rw-r--r--drivers/gpu/drm/radeon/radeon_legacy_encoders.c27
-rw-r--r--drivers/gpu/drm/radeon/radeon_mode.h34
-rw-r--r--drivers/gpu/drm/radeon/radeon_pm.c65
-rw-r--r--drivers/gpu/drm/radeon/radeon_reg.h6
-rw-r--r--drivers/gpu/drm/radeon/radeon_test.c6
-rw-r--r--drivers/gpu/drm/radeon/radeon_ttm.c6
-rw-r--r--drivers/gpu/drm/radeon/rs400.c2
-rw-r--r--drivers/gpu/drm/radeon/rs600.c20
-rw-r--r--drivers/gpu/drm/radeon/rs690.c2
-rw-r--r--drivers/gpu/drm/radeon/rv515.c9
-rw-r--r--drivers/gpu/drm/radeon/rv770.c59
-rw-r--r--drivers/gpu/drm/radeon/rv770d.h5
-rw-r--r--drivers/gpu/drm/ttm/ttm_tt.c1
-rw-r--r--drivers/hwmon/adt7475.c17
-rw-r--r--drivers/hwmon/s3c-hwmon.c11
-rw-r--r--drivers/i2c/busses/Kconfig2
-rw-r--r--drivers/i2c/busses/i2c-imx.c86
-rw-r--r--drivers/i2c/busses/i2c-mpc.c10
-rw-r--r--drivers/i2c/busses/i2c-piix4.c8
-rw-r--r--drivers/i2c/busses/i2c-pnx.c9
-rw-r--r--drivers/i2c/chips/tsl2550.c3
-rw-r--r--drivers/i2c/i2c-core.c11
-rw-r--r--drivers/ide/ide-cs.c33
-rw-r--r--drivers/ide/ide-ioctls.c2
-rw-r--r--drivers/ide/ide-probe.c9
-rw-r--r--drivers/ieee802154/fakehard.c5
-rw-r--r--drivers/input/ff-core.c20
-rw-r--r--drivers/input/ff-memless.c26
-rw-r--r--drivers/input/input.c29
-rw-r--r--drivers/input/keyboard/atkbd.c49
-rw-r--r--drivers/input/keyboard/gpio_keys.c1
-rw-r--r--drivers/input/misc/Kconfig1
-rw-r--r--drivers/input/mouse/lifebook.c3
-rw-r--r--drivers/input/mouse/psmouse-base.c4
-rw-r--r--drivers/input/serio/i8042-x86ia64io.h21
-rw-r--r--drivers/input/serio/i8042.c35
-rw-r--r--drivers/isdn/hardware/avm/avm_cs.c4
-rw-r--r--drivers/isdn/hardware/eicon/maintidi.c5
-rw-r--r--drivers/isdn/hardware/eicon/message.c18
-rw-r--r--drivers/isdn/hardware/mISDN/hfcmulti.c2
-rw-r--r--drivers/isdn/hisax/amd7930_fn.c1
-rw-r--r--drivers/isdn/hisax/avma1_cs.c28
-rw-r--r--drivers/isdn/hisax/diva.c2
-rw-r--r--drivers/isdn/hisax/elsa_cs.c46
-rw-r--r--drivers/isdn/hisax/elsa_ser.c22
-rw-r--r--drivers/isdn/hisax/hfc_usb.c4
-rw-r--r--drivers/isdn/hisax/hscx_irq.c2
-rw-r--r--drivers/isdn/hisax/icc.c1
-rw-r--r--drivers/isdn/hisax/sedlbauer_cs.c64
-rw-r--r--drivers/isdn/hisax/teles_cs.c38
-rw-r--r--drivers/isdn/i4l/isdn_ppp.c352
-rw-r--r--drivers/isdn/mISDN/stack.c2
-rw-r--r--drivers/leds/leds-gpio.c2
-rw-r--r--drivers/md/md.c46
-rw-r--r--drivers/md/raid1.c7
-rw-r--r--drivers/md/raid5.c87
-rw-r--r--drivers/media/common/ir-functions.c2
-rw-r--r--drivers/media/common/tuners/tda18271-fe.c8
-rw-r--r--drivers/media/dvb/dvb-core/dvb_frontend.c1
-rw-r--r--drivers/media/dvb/dvb-usb/Kconfig2
-rw-r--r--drivers/media/dvb/dvb-usb/ce6230.c2
-rw-r--r--drivers/media/dvb/dvb-usb/cxusb.c10
-rw-r--r--drivers/media/dvb/dvb-usb/dib0700_devices.c15
-rw-r--r--drivers/media/dvb/firewire/firedtv-avc.c38
-rw-r--r--drivers/media/dvb/firewire/firedtv-fe.c8
-rw-r--r--drivers/media/dvb/frontends/dib0070.h7
-rw-r--r--drivers/media/dvb/frontends/dib7000p.c5
-rw-r--r--drivers/media/dvb/pt1/pt1.c1
-rw-r--r--drivers/media/dvb/siano/Kconfig2
-rw-r--r--drivers/media/dvb/siano/smsusb.c6
-rw-r--r--drivers/media/radio/radio-gemtek-pci.c2
-rw-r--r--drivers/media/video/bt8xx/bttv-driver.c33
-rw-r--r--drivers/media/video/davinci/vpif_display.c1
-rw-r--r--drivers/media/video/em28xx/em28xx-audio.c5
-rw-r--r--drivers/media/video/em28xx/em28xx-cards.c2
-rw-r--r--drivers/media/video/gspca/m5602/m5602_s5k4aa.c20
-rw-r--r--drivers/media/video/gspca/mr97310a.c2
-rw-r--r--drivers/media/video/gspca/ov519.c2
-rw-r--r--drivers/media/video/gspca/stv06xx/stv06xx.c3
-rw-r--r--drivers/media/video/mx1_camera.c1
-rw-r--r--drivers/media/video/mx3_camera.c1
-rw-r--r--drivers/media/video/pxa_camera.c5
-rw-r--r--drivers/media/video/s2255drv.c5
-rw-r--r--drivers/media/video/saa7134/saa7134-cards.c1
-rw-r--r--drivers/media/video/saa7134/saa7134-ts.c6
-rw-r--r--drivers/media/video/saa7134/saa7134.h1
-rw-r--r--drivers/media/video/saa7164/saa7164-cmd.c2
-rw-r--r--drivers/media/video/sh_mobile_ceu_camera.c11
-rw-r--r--drivers/media/video/soc_camera.c33
-rw-r--r--drivers/media/video/uvc/uvc_ctrl.c2
-rw-r--r--drivers/media/video/uvc/uvc_video.c3
-rw-r--r--drivers/media/video/videobuf-dma-contig.c1
-rw-r--r--drivers/mfd/wm831x-core.c2
-rw-r--r--drivers/misc/eeprom/at24.c76
-rw-r--r--drivers/misc/sgi-gru/gruprocfs.c13
-rw-r--r--drivers/misc/sgi-xp/xpc_uv.c5
-rw-r--r--drivers/mmc/host/omap.c1
-rw-r--r--drivers/mmc/host/pxamci.c4
-rw-r--r--drivers/mtd/maps/Kconfig1
-rw-r--r--drivers/mtd/maps/Makefile2
-rw-r--r--drivers/mtd/maps/gpio-addr-flash.c5
-rw-r--r--drivers/mtd/maps/pcmciamtd.c197
-rw-r--r--drivers/mtd/maps/sa1100-flash.c4
-rw-r--r--drivers/mtd/nand/nand_base.c6
-rw-r--r--drivers/net/Kconfig2
-rw-r--r--drivers/net/arm/ep93xx_eth.c12
-rw-r--r--drivers/net/au1000_eth.c15
-rw-r--r--drivers/net/b44.c3
-rw-r--r--drivers/net/benet/be.h2
-rw-r--r--drivers/net/benet/be_cmds.h2
-rw-r--r--drivers/net/benet/be_ethtool.c8
-rw-r--r--drivers/net/benet/be_main.c28
-rw-r--r--drivers/net/can/Kconfig60
-rw-r--r--drivers/net/can/dev.c23
-rw-r--r--drivers/net/can/sja1000/Kconfig47
-rw-r--r--drivers/net/can/usb/Kconfig10
-rw-r--r--drivers/net/can/usb/Makefile2
-rw-r--r--drivers/net/can/usb/ems_usb.c5
-rw-r--r--drivers/net/cassini.c5
-rw-r--r--drivers/net/cxgb3/sge.c4
-rw-r--r--drivers/net/davinci_emac.c31
-rw-r--r--drivers/net/e100.c43
-rw-r--r--drivers/net/e1000e/defines.h2
-rw-r--r--drivers/net/e1000e/e1000.h16
-rw-r--r--drivers/net/e1000e/ethtool.c12
-rw-r--r--drivers/net/e1000e/hw.h1
-rw-r--r--drivers/net/e1000e/ich8lan.c484
-rw-r--r--drivers/net/e1000e/netdev.c50
-rw-r--r--drivers/net/e1000e/phy.c71
-rw-r--r--drivers/net/forcedeth.c5
-rw-r--r--drivers/net/fsl_pq_mdio.c1
-rw-r--r--drivers/net/ibm_newemac/emac.h4
-rw-r--r--drivers/net/ixgbe/ixgbe_main.c85
-rw-r--r--drivers/net/ks8851_mll.c142
-rw-r--r--drivers/net/macsonic.c117
-rw-r--r--drivers/net/macvlan.c2
-rw-r--r--drivers/net/netxen/netxen_nic.h2
-rw-r--r--drivers/net/netxen/netxen_nic_hdr.h2
-rw-r--r--drivers/net/netxen/netxen_nic_hw.c55
-rw-r--r--drivers/net/netxen/netxen_nic_init.c2
-rw-r--r--drivers/net/netxen/netxen_nic_main.c4
-rw-r--r--drivers/net/pcmcia/3c574_cs.c90
-rw-r--r--drivers/net/pcmcia/3c589_cs.c102
-rw-r--r--drivers/net/pcmcia/axnet_cs.c56
-rw-r--r--drivers/net/pcmcia/com20020_cs.c63
-rw-r--r--drivers/net/pcmcia/fmvj18x_cs.c189
-rw-r--r--drivers/net/pcmcia/ibmtr_cs.c71
-rw-r--r--drivers/net/pcmcia/nmclan_cs.c173
-rw-r--r--drivers/net/pcmcia/pcnet_cs.c82
-rw-r--r--drivers/net/pcmcia/smc91c92_cs.c340
-rw-r--r--drivers/net/pcmcia/xirc2ps_cs.c259
-rw-r--r--drivers/net/phy/mdio-gpio.c2
-rw-r--r--drivers/net/ppp_generic.c11
-rw-r--r--drivers/net/qlge/qlge_main.c2
-rw-r--r--drivers/net/qlge/qlge_mpi.c2
-rw-r--r--drivers/net/r6040.c2
-rw-r--r--drivers/net/r8169.c13
-rw-r--r--drivers/net/s2io.c1
-rw-r--r--drivers/net/sfc/sfe4001.c4
-rw-r--r--drivers/net/sky2.c2
-rw-r--r--drivers/net/smc91x.c2
-rw-r--r--drivers/net/smsc911x.c2
-rw-r--r--drivers/net/smsc9420.c14
-rw-r--r--drivers/net/stmmac/stmmac_main.c50
-rw-r--r--drivers/net/stmmac/stmmac_timer.c4
-rw-r--r--drivers/net/stmmac/stmmac_timer.h1
-rw-r--r--drivers/net/sungem.c10
-rw-r--r--drivers/net/tokenring/ibmtr.c11
-rw-r--r--drivers/net/usb/Kconfig2
-rw-r--r--drivers/net/usb/cdc_ether.c42
-rw-r--r--drivers/net/usb/hso.c8
-rw-r--r--drivers/net/veth.c35
-rw-r--r--drivers/net/virtio_net.c6
-rw-r--r--drivers/net/wan/cosa.c1
-rw-r--r--drivers/net/wireless/airo_cs.c55
-rw-r--r--drivers/net/wireless/ath/ath5k/base.c1
-rw-r--r--drivers/net/wireless/ath/ath5k/led.c4
-rw-r--r--drivers/net/wireless/ath/ath9k/main.c2
-rw-r--r--drivers/net/wireless/ath/ath9k/rc.c2
-rw-r--r--drivers/net/wireless/atmel_cs.c51
-rw-r--r--drivers/net/wireless/b43/dma.c15
-rw-r--r--drivers/net/wireless/b43/main.c3
-rw-r--r--drivers/net/wireless/b43/pcmcia.c26
-rw-r--r--drivers/net/wireless/hostap/hostap_cs.c51
-rw-r--r--drivers/net/wireless/ipw2x00/ipw2100.c6
-rw-r--r--drivers/net/wireless/ipw2x00/ipw2200.c141
-rw-r--r--drivers/net/wireless/ipw2x00/libipw.h8
-rw-r--r--drivers/net/wireless/ipw2x00/libipw_module.c42
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-1000.c1
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-6000.c5
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-agn-rs.c9
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-agn.c10
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-core.h2
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-tx.c10
-rw-r--r--drivers/net/wireless/libertas/ethtool.c17
-rw-r--r--drivers/net/wireless/libertas/if_cs.c72
-rw-r--r--drivers/net/wireless/libertas/if_usb.c2
-rw-r--r--drivers/net/wireless/netwave_cs.c95
-rw-r--r--drivers/net/wireless/orinoco/orinoco_cs.c33
-rw-r--r--drivers/net/wireless/orinoco/spectrum_cs.c60
-rw-r--r--drivers/net/wireless/p54/p54usb.c10
-rw-r--r--drivers/net/wireless/ray_cs.c357
-rw-r--r--drivers/net/wireless/rt2x00/rt2x00dev.c4
-rw-r--r--drivers/net/wireless/rt2x00/rt2x00link.c11
-rw-r--r--drivers/net/wireless/rt2x00/rt2x00usb.c9
-rw-r--r--drivers/net/wireless/rt2x00/rt73usb.c5
-rw-r--r--drivers/net/wireless/rtl818x/rtl8187_leds.c4
-rw-r--r--drivers/net/wireless/rtl818x/rtl8187_rfkill.c1
-rw-r--r--drivers/net/wireless/wavelan_cs.c35
-rw-r--r--drivers/net/wireless/wl3501_cs.c74
-rw-r--r--drivers/parport/parport_cs.c38
-rw-r--r--drivers/pci/dmar.c59
-rw-r--r--drivers/pci/intel-iommu.c45
-rw-r--r--drivers/pci/pcie/aspm.c6
-rw-r--r--drivers/pcmcia/Kconfig42
-rw-r--r--drivers/pcmcia/Makefile10
-rw-r--r--drivers/pcmcia/cardbus.c4
-rw-r--r--drivers/pcmcia/cirrus.h10
-rw-r--r--drivers/pcmcia/cistpl.c71
-rw-r--r--drivers/pcmcia/cs.c136
-rw-r--r--drivers/pcmcia/cs_internal.h42
-rw-r--r--drivers/pcmcia/ds.c188
-rw-r--r--drivers/pcmcia/i82365.c37
-rw-r--r--drivers/pcmcia/m32r_cfc.c105
-rw-r--r--drivers/pcmcia/m32r_pcc.c51
-rw-r--r--drivers/pcmcia/m8xx_pcmcia.c40
-rw-r--r--drivers/pcmcia/o2micro.h22
-rw-r--r--drivers/pcmcia/pcmcia_ioctl.c92
-rw-r--r--drivers/pcmcia/pcmcia_resource.c482
-rw-r--r--drivers/pcmcia/pd6729.c70
-rw-r--r--drivers/pcmcia/pd6729.h7
-rw-r--r--drivers/pcmcia/pxa2xx_base.c94
-rw-r--r--drivers/pcmcia/pxa2xx_base.h3
-rw-r--r--drivers/pcmcia/pxa2xx_cm_x255.c2
-rw-r--r--drivers/pcmcia/pxa2xx_cm_x270.c2
-rw-r--r--drivers/pcmcia/pxa2xx_e740.c2
-rw-r--r--drivers/pcmcia/pxa2xx_lubbock.c14
-rw-r--r--drivers/pcmcia/pxa2xx_mainstone.c2
-rw-r--r--drivers/pcmcia/pxa2xx_palmld.c2
-rw-r--r--drivers/pcmcia/pxa2xx_palmtx.c2
-rw-r--r--drivers/pcmcia/pxa2xx_sharpsl.c2
-rw-r--r--drivers/pcmcia/pxa2xx_trizeps4.c4
-rw-r--r--drivers/pcmcia/pxa2xx_viper.c2
-rw-r--r--drivers/pcmcia/rsrc_mgr.c1
-rw-r--r--drivers/pcmcia/sa1100_assabet.c2
-rw-r--r--drivers/pcmcia/sa1100_badge4.c11
-rw-r--r--drivers/pcmcia/sa1100_cerf.c2
-rw-r--r--drivers/pcmcia/sa1100_generic.c11
-rw-r--r--drivers/pcmcia/sa1100_h3600.c4
-rw-r--r--drivers/pcmcia/sa1100_jornada720.c42
-rw-r--r--drivers/pcmcia/sa1100_neponset.c13
-rw-r--r--drivers/pcmcia/sa1100_shannon.c2
-rw-r--r--drivers/pcmcia/sa1100_simpad.c2
-rw-r--r--drivers/pcmcia/sa1111_generic.c65
-rw-r--r--drivers/pcmcia/sa1111_generic.h17
-rw-r--r--drivers/pcmcia/sa11xx_base.c99
-rw-r--r--drivers/pcmcia/sa11xx_base.h2
-rw-r--r--drivers/pcmcia/soc_common.c225
-rw-r--r--drivers/pcmcia/soc_common.h10
-rw-r--r--drivers/pcmcia/tcic.c29
-rw-r--r--drivers/pcmcia/topic.h15
-rw-r--r--drivers/pcmcia/yenta_socket.c12
-rw-r--r--drivers/platform/x86/acerhdf.c12
-rw-r--r--drivers/platform/x86/eeepc-laptop.c30
-rw-r--r--drivers/platform/x86/thinkpad_acpi.c26
-rw-r--r--drivers/pps/kapi.c20
-rw-r--r--drivers/pps/pps.c11
-rw-r--r--drivers/regulator/core.c3
-rw-r--r--drivers/regulator/fixed.c5
-rw-r--r--drivers/regulator/wm831x-isink.c2
-rw-r--r--drivers/regulator/wm831x-ldo.c6
-rw-r--r--drivers/rtc/rtc-coh901331.c11
-rw-r--r--drivers/rtc/rtc-pcf50633.c10
-rw-r--r--drivers/rtc/rtc-v3020.c2
-rw-r--r--drivers/rtc/rtc-vr41xx.c9
-rw-r--r--drivers/rtc/rtc-x1205.c6
-rw-r--r--drivers/s390/char/monreader.c1
-rw-r--r--drivers/s390/char/sclp_quiesce.c48
-rw-r--r--drivers/scsi/bfa/bfad_fwimg.c2
-rw-r--r--drivers/scsi/bfa/bfad_im.c2
-rw-r--r--drivers/scsi/gdth.c2
-rw-r--r--drivers/scsi/hosts.c2
-rw-r--r--drivers/scsi/ipr.c42
-rw-r--r--drivers/scsi/ipr.h1
-rw-r--r--drivers/scsi/libsas/sas_expander.c1
-rw-r--r--drivers/scsi/pcmcia/aha152x_stub.c42
-rw-r--r--drivers/scsi/pcmcia/fdomain_stub.c44
-rw-r--r--drivers/scsi/pcmcia/nsp_cs.c8
-rw-r--r--drivers/scsi/pcmcia/qlogic_stub.c45
-rw-r--r--drivers/scsi/pcmcia/sym53c500_cs.c42
-rw-r--r--drivers/scsi/pmcraid.c10
-rw-r--r--drivers/scsi/scsi_scan.c18
-rw-r--r--drivers/scsi/scsi_sysfs.c63
-rw-r--r--drivers/scsi/scsi_transport_fc.c3
-rw-r--r--drivers/scsi/sd_dif.c2
-rw-r--r--drivers/serial/8250.c2
-rw-r--r--drivers/serial/8250_pci.c8
-rw-r--r--drivers/serial/bcm63xx_uart.c4
-rw-r--r--drivers/serial/of_serial.c1
-rw-r--r--drivers/serial/serial_cs.c151
-rw-r--r--drivers/serial/sh-sci.c2
-rw-r--r--drivers/serial/suncore.c37
-rw-r--r--drivers/serial/suncore.h5
-rw-r--r--drivers/serial/sunhv.c2
-rw-r--r--drivers/serial/sunsab.c9
-rw-r--r--drivers/serial/sunsu.c36
-rw-r--r--drivers/serial/sunzilog.c8
-rw-r--r--drivers/spi/spi_stmp.c2
-rw-r--r--drivers/spi/spi_txx9.c13
-rw-r--r--drivers/ssb/pcmcia.c232
-rw-r--r--drivers/ssb/scan.c6
-rw-r--r--drivers/staging/comedi/drivers/cb_das16_cs.c221
-rw-r--r--drivers/staging/comedi/drivers/das08_cs.c203
-rw-r--r--drivers/staging/comedi/drivers/ni_daq_700.c237
-rw-r--r--drivers/staging/comedi/drivers/ni_daq_dio24.c236
-rw-r--r--drivers/staging/comedi/drivers/ni_labpc_cs.c225
-rw-r--r--drivers/staging/comedi/drivers/ni_mio_cs.c127
-rw-r--r--drivers/staging/comedi/drivers/quatech_daqp_cs.c219
-rw-r--r--drivers/staging/go7007/s2250-board.c4
-rw-r--r--drivers/staging/go7007/s2250-loader.h24
-rw-r--r--drivers/staging/hv/BlkVsc.c1
-rw-r--r--drivers/staging/hv/Channel.c16
-rw-r--r--drivers/staging/hv/ChannelMgmt.c2
-rw-r--r--drivers/staging/hv/NetVsc.c1
-rw-r--r--drivers/staging/hv/NetVsc.h1
-rw-r--r--drivers/staging/hv/StorVsc.c10
-rw-r--r--drivers/staging/hv/blkvsc_drv.c1
-rw-r--r--drivers/staging/hv/netvsc_drv.c1
-rw-r--r--drivers/staging/octeon/ethernet-mdio.c2
-rw-r--r--drivers/staging/octeon/ethernet-spi.c2
-rw-r--r--drivers/staging/octeon/ethernet.c53
-rw-r--r--drivers/staging/rtl8187se/TODO3
-rw-r--r--drivers/staging/rtl8192su/TODO3
-rw-r--r--drivers/staging/vt6655/TODO5
-rw-r--r--drivers/staging/vt6656/TODO5
-rw-r--r--drivers/telephony/ixj_pcmcia.c36
-rw-r--r--drivers/thermal/thermal_sys.c10
-rw-r--r--drivers/uio/uio_pdrv_genirq.c1
-rw-r--r--drivers/usb/class/cdc-acm.c18
-rw-r--r--drivers/usb/core/hub.c2
-rw-r--r--drivers/usb/gadget/amd5536udc.c49
-rw-r--r--drivers/usb/host/ehci-hcd.c2
-rw-r--r--drivers/usb/host/ehci-pci.c4
-rw-r--r--drivers/usb/host/ehci-q.c16
-rw-r--r--drivers/usb/host/ehci-sched.c12
-rw-r--r--drivers/usb/host/ehci.h2
-rw-r--r--drivers/usb/host/ohci-hcd.c5
-rw-r--r--drivers/usb/host/ohci-pci.c20
-rw-r--r--drivers/usb/host/ohci-q.c18
-rw-r--r--drivers/usb/host/ohci.h9
-rw-r--r--drivers/usb/host/sl811_cs.c49
-rw-r--r--drivers/usb/host/xhci-mem.c10
-rw-r--r--drivers/usb/host/xhci-ring.c7
-rw-r--r--drivers/usb/mon/mon_bin.c11
-rw-r--r--drivers/usb/musb/cppi_dma.c10
-rw-r--r--drivers/usb/musb/musb_core.c4
-rw-r--r--drivers/usb/musb/musb_gadget.c79
-rw-r--r--drivers/usb/musb/musb_gadget_ep0.c3
-rw-r--r--drivers/usb/musb/musb_host.c5
-rw-r--r--drivers/usb/serial/cp210x.c21
-rw-r--r--drivers/usb/serial/ftdi_sio.c3
-rw-r--r--drivers/usb/serial/option.c7
-rw-r--r--drivers/video/Kconfig2
-rw-r--r--drivers/video/atafb.c6
-rw-r--r--drivers/video/atmel_lcdfb.c11
-rw-r--r--drivers/video/backlight/corgi_lcd.c5
-rw-r--r--drivers/video/backlight/lcd.c2
-rw-r--r--drivers/video/console/fbcon.c5
-rw-r--r--drivers/video/da8xx-fb.c13
-rw-r--r--drivers/video/gbefb.c2
-rw-r--r--drivers/video/msm/mddi.c1
-rw-r--r--drivers/video/msm/mddi_client_nt35399.c1
-rw-r--r--drivers/video/msm/mddi_client_toshiba.c1
-rw-r--r--drivers/video/msm/mdp.c18
-rw-r--r--drivers/video/msm/mdp_ppp.c20
-rw-r--r--drivers/video/savage/savagefb_driver.c20
-rw-r--r--drivers/video/uvesafb.c28
-rw-r--r--drivers/watchdog/pnx4008_wdt.c4
-rw-r--r--drivers/watchdog/rc32434_wdt.c4
-rw-r--r--drivers/watchdog/sbc_fitpc2_wdt.c2
-rw-r--r--firmware/Makefile6
-rw-r--r--firmware/WHENCE4
-rw-r--r--firmware/cis/PE-200.cis.ihex9
-rw-r--r--firmware/cis/SW_555_SER.cis.ihex12
-rw-r--r--firmware/cis/SW_7xx_SER.cis.ihex13
-rw-r--r--firmware/cis/SW_8xx_SER.cis.ihex13
-rw-r--r--fs/9p/cache.c14
-rw-r--r--fs/Kconfig2
-rw-r--r--fs/afs/file.c15
-rw-r--r--fs/bio.c28
-rw-r--r--fs/btrfs/extent-tree.c113
-rw-r--r--fs/btrfs/extent_map.c2
-rw-r--r--fs/btrfs/free-space-cache.c2
-rw-r--r--fs/btrfs/inode.c95
-rw-r--r--fs/btrfs/root-tree.c2
-rw-r--r--fs/btrfs/transaction.c19
-rw-r--r--fs/cachefiles/interface.c32
-rw-r--r--fs/cachefiles/namei.c187
-rw-r--r--fs/cachefiles/rdwr.c130
-rw-r--r--fs/cifs/CHANGES9
-rw-r--r--fs/cifs/cifsfs.c2
-rw-r--r--fs/cifs/cifsproto.h1
-rw-r--r--fs/cifs/connect.c8
-rw-r--r--fs/cifs/dir.c8
-rw-r--r--fs/cifs/inode.c7
-rw-r--r--fs/cifs/misc.c14
-rw-r--r--fs/cifs/readdir.c7
-rw-r--r--fs/compat.c2
-rw-r--r--fs/compat_ioctl.c4
-rw-r--r--fs/exec.c12
-rw-r--r--fs/ext3/fsync.c36
-rw-r--r--fs/ext3/inode.c36
-rw-r--r--fs/ext3/super.c2
-rw-r--r--fs/ext4/ext4.h1
-rw-r--r--fs/ext4/extents.c36
-rw-r--r--fs/ext4/inode.c24
-rw-r--r--fs/ext4/namei.c16
-rw-r--r--fs/fcntl.c4
-rw-r--r--fs/file_table.c2
-rw-r--r--fs/fscache/Kconfig7
-rw-r--r--fs/fscache/Makefile1
-rw-r--r--fs/fscache/cache.c5
-rw-r--r--fs/fscache/cookie.c26
-rw-r--r--fs/fscache/internal.h56
-rw-r--r--fs/fscache/main.c6
-rw-r--r--fs/fscache/object-list.c432
-rw-r--r--fs/fscache/object.c104
-rw-r--r--fs/fscache/operation.c120
-rw-r--r--fs/fscache/page.c273
-rw-r--r--fs/fscache/proc.c13
-rw-r--r--fs/fscache/stats.c94
-rw-r--r--fs/fuse/dir.c7
-rw-r--r--fs/fuse/file.c5
-rw-r--r--fs/gfs2/Kconfig2
-rw-r--r--fs/gfs2/acl.c357
-rw-r--r--fs/gfs2/acl.h24
-rw-r--r--fs/gfs2/aops.c20
-rw-r--r--fs/gfs2/dir.c34
-rw-r--r--fs/gfs2/glock.c31
-rw-r--r--fs/gfs2/glock.h9
-rw-r--r--fs/gfs2/glops.c5
-rw-r--r--fs/gfs2/incore.h5
-rw-r--r--fs/gfs2/inode.c4
-rw-r--r--fs/gfs2/log.c2
-rw-r--r--fs/gfs2/lops.c4
-rw-r--r--fs/gfs2/main.c4
-rw-r--r--fs/gfs2/ops_fstype.c154
-rw-r--r--fs/gfs2/quota.c393
-rw-r--r--fs/gfs2/quota.h5
-rw-r--r--fs/gfs2/recovery.c4
-rw-r--r--fs/gfs2/rgrp.c14
-rw-r--r--fs/gfs2/super.c110
-rw-r--r--fs/gfs2/super.h4
-rw-r--r--fs/gfs2/sys.c14
-rw-r--r--fs/gfs2/xattr.c74
-rw-r--r--fs/gfs2/xattr.h8
-rw-r--r--fs/inode.c10
-rw-r--r--fs/ioctl.c2
-rw-r--r--fs/jbd/journal.c3
-rw-r--r--fs/jbd2/journal.c2
-rw-r--r--fs/jffs2/read.c9
-rw-r--r--fs/namespace.c20
-rw-r--r--fs/nfs/fscache.c10
-rw-r--r--fs/nfs/nfs4proc.c2
-rw-r--r--fs/nfsd/nfs3xdr.c2
-rw-r--r--fs/nilfs2/btnode.c4
-rw-r--r--fs/nilfs2/cpfile.c2
-rw-r--r--fs/nilfs2/inode.c1
-rw-r--r--fs/nilfs2/ioctl.c39
-rw-r--r--fs/nilfs2/segment.c17
-rw-r--r--fs/ocfs2/file.c3
-rw-r--r--fs/ocfs2/ocfs2.h7
-rw-r--r--fs/ocfs2/refcounttree.c69
-rw-r--r--fs/ocfs2/super.c20
-rw-r--r--fs/ocfs2/uptodate.c5
-rw-r--r--fs/open.c27
-rw-r--r--fs/proc/array.c25
-rw-r--r--fs/proc/base.c3
-rw-r--r--fs/proc/stat.c19
-rw-r--r--fs/quota/Kconfig2
-rw-r--r--fs/quota/dquot.c93
-rw-r--r--fs/quota/quota.c93
-rw-r--r--fs/sysfs/dir.c4
-rw-r--r--fs/xattr_acl.c2
-rw-r--r--fs/xfs/xfs_log_recover.c4
-rw-r--r--fs/xfs/xfs_trans_ail.c23
-rw-r--r--include/asm-generic/fcntl.h21
-rw-r--r--include/linux/Kbuild1
-rw-r--r--include/linux/bootmem.h1
-rw-r--r--include/linux/capability.h2
-rw-r--r--include/linux/compiler-gcc.h1
-rw-r--r--include/linux/compiler-gcc4.h22
-rw-r--r--include/linux/compiler.h20
-rw-r--r--include/linux/dmar.h15
-rw-r--r--include/linux/ext3_fs_i.h8
-rw-r--r--include/linux/fb.h6
-rw-r--r--include/linux/fscache-cache.h40
-rw-r--r--include/linux/fscache.h27
-rw-r--r--include/linux/ftrace_event.h38
-rw-r--r--include/linux/gfs2_ondisk.h6
-rw-r--r--include/linux/hardirq.h24
-rw-r--r--include/linux/hw_breakpoint.h131
-rw-r--r--include/linux/i2c-pnx.h2
-rw-r--r--include/linux/i2c.h18
-rw-r--r--include/linux/init_task.h4
-rw-r--r--include/linux/input.h4
-rw-r--r--include/linux/interrupt.h6
-rw-r--r--include/linux/irqflags.h2
-rw-r--r--include/linux/isdn_ppp.h2
-rw-r--r--include/linux/jiffies.h1
-rw-r--r--include/linux/kernel.h5
-rw-r--r--include/linux/kernel_stat.h1
-rw-r--r--include/linux/kprobes.h2
-rw-r--r--include/linux/lsm_audit.h18
-rw-r--r--include/linux/mfd/wm831x/regulator.h4
-rw-r--r--include/linux/net.h1
-rw-r--r--include/linux/nilfs2_fs.h9
-rw-r--r--include/linux/pci_ids.h6
-rw-r--r--include/linux/perf_counter.h3
-rw-r--r--include/linux/perf_event.h59
-rw-r--r--include/linux/posix_acl.h14
-rw-r--r--include/linux/preempt.h5
-rw-r--r--include/linux/quota.h11
-rw-r--r--include/linux/ratelimit.h33
-rw-r--r--include/linux/rcupdate.h10
-rw-r--r--include/linux/rcutiny.h104
-rw-r--r--include/linux/rcutree.h7
-rw-r--r--include/linux/sched.h45
-rw-r--r--include/linux/securebits.h24
-rw-r--r--include/linux/security.h48
-rw-r--r--include/linux/skbuff.h6
-rw-r--r--include/linux/slow-work.h72
-rw-r--r--include/linux/smp.h11
-rw-r--r--include/linux/smp_lock.h21
-rw-r--r--include/linux/spinlock.h6
-rw-r--r--include/linux/spinlock_api_smp.h75
-rw-r--r--include/linux/srcu.h1
-rw-r--r--include/linux/suspend.h21
-rw-r--r--include/linux/swiotlb.h12
-rw-r--r--include/linux/syscalls.h77
-rw-r--r--include/linux/tpm.h9
-rw-r--r--include/linux/tracepoint.h6
-rw-r--r--include/linux/vt.h4
-rw-r--r--include/net/ip_fib.h3
-rw-r--r--include/net/mac80211.h6
-rw-r--r--include/net/netfilter/nf_conntrack.h8
-rw-r--r--include/net/netfilter/nf_nat_helper.h4
-rw-r--r--include/net/sctp/structs.h3
-rw-r--r--include/pcmcia/cs.h14
-rw-r--r--include/pcmcia/cs_types.h3
-rw-r--r--include/pcmcia/ds.h88
-rw-r--r--include/pcmcia/ss.h17
-rw-r--r--include/scsi/scsi_device.h1
-rw-r--r--include/scsi/scsi_host.h29
-rw-r--r--include/trace/define_trace.h11
-rw-r--r--include/trace/events/bkl.h61
-rw-r--r--include/trace/events/block.h202
-rw-r--r--include/trace/events/ext4.h129
-rw-r--r--include/trace/events/irq.h52
-rw-r--r--include/trace/events/jbd2.h63
-rw-r--r--include/trace/events/kmem.h130
-rw-r--r--include/trace/events/lock.h (renamed from include/trace/events/lockdep.h)8
-rw-r--r--include/trace/events/mce.h69
-rw-r--r--include/trace/events/module.h22
-rw-r--r--include/trace/events/power.h38
-rw-r--r--include/trace/events/sched.h217
-rw-r--r--include/trace/events/signal.h173
-rw-r--r--include/trace/events/syscalls.h3
-rw-r--r--include/trace/events/timer.h79
-rw-r--r--include/trace/events/workqueue.h22
-rw-r--r--include/trace/ftrace.h340
-rw-r--r--include/trace/power.h32
-rw-r--r--include/trace/syscall.h33
-rw-r--r--init/Kconfig26
-rw-r--r--init/main.c11
-rw-r--r--kernel/Kconfig.locks202
-rw-r--r--kernel/Makefile4
-rw-r--r--kernel/capability.c15
-rw-r--r--kernel/cpuset.c27
-rw-r--r--kernel/exit.c27
-rw-r--r--kernel/fork.c7
-rw-r--r--kernel/hung_task.c2
-rw-r--r--kernel/hw_breakpoint.c423
-rw-r--r--kernel/irq/chip.c6
-rw-r--r--kernel/irq/proc.c40
-rw-r--r--kernel/irq/spurious.c16
-rw-r--r--kernel/kallsyms.c1
-rw-r--r--kernel/kgdb.c2
-rw-r--r--kernel/kmod.c8
-rw-r--r--kernel/kprobes.c72
-rw-r--r--kernel/kthread.c23
-rw-r--r--kernel/lockdep.c2
-rw-r--r--kernel/module.c5
-rw-r--r--kernel/mutex.c4
-rw-r--r--kernel/notifier.c2
-rw-r--r--kernel/perf_event.c627
-rw-r--r--kernel/power/hibernate.c11
-rw-r--r--kernel/power/swap.c43
-rw-r--r--kernel/printk.c7
-rw-r--r--kernel/rcupdate.c122
-rw-r--r--kernel/rcutiny.c282
-rw-r--r--kernel/rcutorture.c65
-rw-r--r--kernel/rcutree.c477
-rw-r--r--kernel/rcutree.h74
-rw-r--r--kernel/rcutree_plugin.h309
-rw-r--r--kernel/rcutree_trace.c12
-rw-r--r--kernel/sched.c314
-rw-r--r--kernel/sched_debug.c4
-rw-r--r--kernel/sched_fair.c138
-rw-r--r--kernel/sched_rt.c61
-rw-r--r--kernel/signal.c73
-rw-r--r--kernel/slow-work-debugfs.c227
-rw-r--r--kernel/slow-work.c512
-rw-r--r--kernel/slow-work.h72
-rw-r--r--kernel/smp.c56
-rw-r--r--kernel/softirq.c2
-rw-r--r--kernel/spinlock.c310
-rw-r--r--kernel/srcu.c74
-rw-r--r--kernel/sys.c21
-rw-r--r--kernel/sysctl.c3
-rw-r--r--kernel/time.c30
-rw-r--r--kernel/trace/Kconfig38
-rw-r--r--kernel/trace/Makefile2
-rw-r--r--kernel/trace/ftrace.c381
-rw-r--r--kernel/trace/ring_buffer.c26
-rw-r--r--kernel/trace/ring_buffer_benchmark.c85
-rw-r--r--kernel/trace/trace.c45
-rw-r--r--kernel/trace/trace.h80
-rw-r--r--kernel/trace/trace_clock.c8
-rw-r--r--kernel/trace/trace_entries.h16
-rw-r--r--kernel/trace/trace_event_profile.c43
-rw-r--r--kernel/trace/trace_events.c191
-rw-r--r--kernel/trace/trace_events_filter.c423
-rw-r--r--kernel/trace/trace_export.c43
-rw-r--r--kernel/trace/trace_kprobe.c1523
-rw-r--r--kernel/trace/trace_ksym.c550
-rw-r--r--kernel/trace/trace_selftest.c55
-rw-r--r--kernel/trace/trace_syscalls.c229
-rw-r--r--kernel/user.c2
-rw-r--r--kernel/workqueue.c28
-rw-r--r--lib/Kconfig.debug2
-rw-r--r--lib/dma-debug.c6
-rw-r--r--lib/kernel_lock.c20
-rw-r--r--lib/radix-tree.c5
-rw-r--r--lib/ratelimit.c45
-rw-r--r--lib/string.c20
-rw-r--r--lib/swiotlb.c46
-rw-r--r--mm/Kconfig5
-rw-r--r--mm/backing-dev.c11
-rw-r--r--mm/bootmem.c24
-rw-r--r--mm/highmem.c17
-rw-r--r--mm/ksm.c1
-rw-r--r--mm/memory_hotplug.c24
-rw-r--r--mm/migrate.c2
-rw-r--r--mm/mmap.c4
-rw-r--r--mm/page_alloc.c4
-rw-r--r--mm/percpu.c121
-rw-r--r--net/8021q/vlan.c7
-rw-r--r--net/bluetooth/hci_conn.c1
-rw-r--r--net/bluetooth/l2cap.c13
-rw-r--r--net/bridge/br_if.c6
-rw-r--r--net/can/bcm.c19
-rw-r--r--net/core/datagram.c10
-rw-r--r--net/core/dev.c11
-rw-r--r--net/core/pktgen.c32
-rw-r--r--net/core/skbuff.c3
-rw-r--r--net/core/sysctl_net_core.c2
-rw-r--r--net/core/utils.c2
-rw-r--r--net/decnet/sysctl_net_decnet.c7
-rw-r--r--net/ipv4/fib_frontend.c5
-rw-r--r--net/ipv4/ip_fragment.c2
-rw-r--r--net/ipv4/ip_gre.c28
-rw-r--r--net/ipv4/ipip.c32
-rw-r--r--net/ipv4/ipmr.c4
-rw-r--r--net/ipv4/netfilter/nf_nat_core.c3
-rw-r--r--net/ipv4/netfilter/nf_nat_helper.c34
-rw-r--r--net/ipv4/route.c8
-rw-r--r--net/ipv4/tcp.c19
-rw-r--r--net/ipv4/udp.c4
-rw-r--r--net/ipv6/udp.c4
-rw-r--r--net/mac80211/agg-rx.c4
-rw-r--r--net/mac80211/agg-tx.c38
-rw-r--r--net/mac80211/cfg.c6
-rw-r--r--net/mac80211/ht.c10
-rw-r--r--net/mac80211/ibss.c6
-rw-r--r--net/mac80211/ieee80211_i.h10
-rw-r--r--net/mac80211/util.c19
-rw-r--r--net/netfilter/nf_conntrack_core.c8
-rw-r--r--net/netfilter/nf_conntrack_proto_tcp.c64
-rw-r--r--net/netfilter/nf_log.c18
-rw-r--r--net/netfilter/xt_connlimit.c10
-rw-r--r--net/netfilter/xt_limit.c2
-rw-r--r--net/netfilter/xt_osf.c2
-rw-r--r--net/rfkill/core.c1
-rw-r--r--net/rose/rose_route.c16
-rw-r--r--net/sctp/associola.c4
-rw-r--r--net/sctp/outqueue.c10
-rw-r--r--net/sctp/sm_sideeffect.c1
-rw-r--r--net/sctp/sm_statefuns.c15
-rw-r--r--net/sctp/socket.c40
-rw-r--r--net/sctp/transport.c8
-rw-r--r--net/sunrpc/addr.c18
-rw-r--r--net/sunrpc/svcsock.c10
-rw-r--r--net/wireless/sme.c7
-rw-r--r--samples/Kconfig6
-rw-r--r--samples/Makefile3
-rw-r--r--samples/hw_breakpoint/Makefile1
-rw-r--r--samples/hw_breakpoint/data_breakpoint.c87
-rw-r--r--scripts/dtc/data.c2
-rw-r--r--scripts/dtc/dtc-lexer.l2
-rw-r--r--scripts/dtc/dtc-lexer.lex.c_shipped69
-rw-r--r--scripts/dtc/libfdt/fdt_ro.c2
-rw-r--r--scripts/dtc/treesource.c2
-rw-r--r--scripts/genksyms/keywords.c_shipped95
-rw-r--r--scripts/genksyms/keywords.gperf2
-rwxr-xr-xscripts/get_maintainer.pl4
-rw-r--r--scripts/kconfig/Makefile4
-rw-r--r--scripts/kconfig/lex.zconf.c_shipped25
-rw-r--r--scripts/kconfig/streamline_config.pl12
-rw-r--r--scripts/kconfig/zconf.gperf2
-rw-r--r--scripts/kconfig/zconf.hash.c_shipped2
-rw-r--r--scripts/kconfig/zconf.l6
-rw-r--r--scripts/kconfig/zconf.tab.c_shipped379
-rw-r--r--scripts/kconfig/zconf.y13
-rwxr-xr-xscripts/kernel-doc15
-rwxr-xr-xscripts/recordmcount.pl219
-rw-r--r--scripts/selinux/Makefile4
-rw-r--r--scripts/selinux/genheaders/.gitignore1
-rw-r--r--scripts/selinux/genheaders/Makefile5
-rw-r--r--scripts/selinux/genheaders/genheaders.c118
-rw-r--r--scripts/selinux/mdp/mdp.c151
-rw-r--r--security/Kconfig54
-rw-r--r--security/Makefile1
-rw-r--r--security/capability.c21
-rw-r--r--security/commoncap.c74
-rw-r--r--security/integrity/ima/Kconfig1
-rw-r--r--security/integrity/ima/ima_iint.c4
-rw-r--r--security/lsm_audit.c4
-rw-r--r--security/min_addr.c3
-rw-r--r--security/root_plug.c90
-rw-r--r--security/security.c61
-rw-r--r--security/selinux/.gitignore2
-rw-r--r--security/selinux/Makefile10
-rw-r--r--security/selinux/avc.c78
-rw-r--r--security/selinux/hooks.c25
-rw-r--r--security/selinux/include/av_inherit.h34
-rw-r--r--security/selinux/include/av_perm_to_string.h183
-rw-r--r--security/selinux/include/av_permissions.h870
-rw-r--r--security/selinux/include/avc_ss.h21
-rw-r--r--security/selinux/include/class_to_string.h80
-rw-r--r--security/selinux/include/classmap.h150
-rw-r--r--security/selinux/include/common_perm_to_string.h58
-rw-r--r--security/selinux/include/flask.h91
-rw-r--r--security/selinux/include/security.h13
-rw-r--r--security/selinux/selinuxfs.c4
-rw-r--r--security/selinux/ss/Makefile2
-rw-r--r--security/selinux/ss/mls.c2
-rw-r--r--security/selinux/ss/policydb.c47
-rw-r--r--security/selinux/ss/policydb.h7
-rw-r--r--security/selinux/ss/services.c562
-rw-r--r--security/tomoyo/common.c200
-rw-r--r--security/tomoyo/common.h4
-rw-r--r--security/tomoyo/realpath.c13
-rw-r--r--sound/arm/aaci.c6
-rw-r--r--sound/core/rawmidi.c42
-rw-r--r--sound/oss/dmasound/dmasound_core.c4
-rw-r--r--sound/oss/hex2hex.c2
-rw-r--r--sound/oss/sb_common.c4
-rw-r--r--sound/oss/sb_ess.c2
-rw-r--r--sound/pci/hda/hda_intel.c12
-rw-r--r--sound/pci/hda/patch_conexant.c16
-rw-r--r--sound/pci/hda/patch_nvhdmi.c2
-rw-r--r--sound/pci/hda/patch_realtek.c17
-rw-r--r--sound/pci/hda/patch_sigmatel.c70
-rw-r--r--sound/pci/ice1712/ice1712.h4
-rw-r--r--sound/pci/ice1712/prodigy_hifi.c2
-rw-r--r--sound/pci/intel8x0.c6
-rw-r--r--sound/pcmcia/pdaudiocf/pdaudiocf.c6
-rw-r--r--sound/pcmcia/vx/vxpocket.c6
-rw-r--r--sound/sh/aica.c1
-rw-r--r--sound/soc/codecs/tlv320aic23.c5
-rw-r--r--sound/soc/omap/omap-pcm.c8
-rw-r--r--sound/soc/omap/omap3evm.c2
-rw-r--r--sound/soc/omap/omap3pandora.c3
-rw-r--r--sound/soc/s3c24xx/s3c24xx-pcm.c17
-rw-r--r--sound/soc/s3c24xx/s3c64xx-i2s.c2
-rw-r--r--sound/soc/soc-dapm.c20
-rw-r--r--sound/usb/usbaudio.h2
-rw-r--r--sound/usb/usbmixer.c9
-rw-r--r--tools/perf/.gitignore1
-rw-r--r--tools/perf/Documentation/perf-bench.txt120
-rw-r--r--tools/perf/Documentation/perf-buildid-list.txt34
-rw-r--r--tools/perf/Documentation/perf-kmem.txt44
-rw-r--r--tools/perf/Documentation/perf-probe.txt49
-rw-r--r--tools/perf/Documentation/perf-record.txt16
-rw-r--r--tools/perf/Documentation/perf-report.txt8
-rw-r--r--tools/perf/Documentation/perf-timechart.txt5
-rw-r--r--tools/perf/Documentation/perf-trace-perl.txt219
-rw-r--r--tools/perf/Documentation/perf-trace.txt11
-rw-r--r--tools/perf/Makefile151
-rw-r--r--tools/perf/bench/bench.h17
-rw-r--r--tools/perf/bench/mem-memcpy.c193
-rw-r--r--tools/perf/bench/sched-messaging.c336
-rw-r--r--tools/perf/bench/sched-pipe.c124
-rw-r--r--tools/perf/builtin-annotate.c885
-rw-r--r--tools/perf/builtin-bench.c196
-rw-r--r--tools/perf/builtin-buildid-list.c116
-rw-r--r--tools/perf/builtin-help.c16
-rw-r--r--tools/perf/builtin-kmem.c807
-rw-r--r--tools/perf/builtin-probe.c242
-rw-r--r--tools/perf/builtin-record.c347
-rw-r--r--tools/perf/builtin-report.c1147
-rw-r--r--tools/perf/builtin-sched.c351
-rw-r--r--tools/perf/builtin-stat.c34
-rw-r--r--tools/perf/builtin-timechart.c267
-rw-r--r--tools/perf/builtin-top.c505
-rw-r--r--tools/perf/builtin-trace.c418
-rw-r--r--tools/perf/builtin.h4
-rw-r--r--tools/perf/command-list.txt4
-rw-r--r--tools/perf/design.txt2
-rw-r--r--tools/perf/perf.c86
-rw-r--r--tools/perf/perf.h12
-rw-r--r--tools/perf/scripts/perl/Perf-Trace-Util/Context.c134
-rw-r--r--tools/perf/scripts/perl/Perf-Trace-Util/Context.xs41
-rw-r--r--tools/perf/scripts/perl/Perf-Trace-Util/Makefile.PL17
-rw-r--r--tools/perf/scripts/perl/Perf-Trace-Util/README59
-rw-r--r--tools/perf/scripts/perl/Perf-Trace-Util/lib/Perf/Trace/Context.pm55
-rw-r--r--tools/perf/scripts/perl/Perf-Trace-Util/lib/Perf/Trace/Core.pm192
-rw-r--r--tools/perf/scripts/perl/Perf-Trace-Util/lib/Perf/Trace/Util.pm88
-rw-r--r--tools/perf/scripts/perl/Perf-Trace-Util/typemap1
-rw-r--r--tools/perf/scripts/perl/bin/check-perf-trace-record7
-rw-r--r--tools/perf/scripts/perl/bin/check-perf-trace-report5
-rw-r--r--tools/perf/scripts/perl/bin/rw-by-file-record2
-rw-r--r--tools/perf/scripts/perl/bin/rw-by-file-report5
-rw-r--r--tools/perf/scripts/perl/bin/rw-by-pid-record2
-rw-r--r--tools/perf/scripts/perl/bin/rw-by-pid-report5
-rw-r--r--tools/perf/scripts/perl/bin/wakeup-latency-record6
-rw-r--r--tools/perf/scripts/perl/bin/wakeup-latency-report5
-rw-r--r--tools/perf/scripts/perl/bin/workqueue-stats-record2
-rw-r--r--tools/perf/scripts/perl/bin/workqueue-stats-report6
-rw-r--r--tools/perf/scripts/perl/check-perf-trace.pl106
-rw-r--r--tools/perf/scripts/perl/rw-by-file.pl105
-rw-r--r--tools/perf/scripts/perl/rw-by-pid.pl170
-rw-r--r--tools/perf/scripts/perl/wakeup-latency.pl103
-rw-r--r--tools/perf/scripts/perl/workqueue-stats.pl129
-rw-r--r--tools/perf/util/cache.h11
-rw-r--r--tools/perf/util/callchain.c2
-rw-r--r--tools/perf/util/callchain.h2
-rw-r--r--tools/perf/util/color.h6
-rw-r--r--tools/perf/util/ctype.c8
-rw-r--r--tools/perf/util/data_map.c291
-rw-r--r--tools/perf/util/data_map.h32
-rw-r--r--tools/perf/util/debug.c4
-rw-r--r--tools/perf/util/debug.h9
-rw-r--r--tools/perf/util/debugfs.c241
-rw-r--r--tools/perf/util/debugfs.h25
-rw-r--r--tools/perf/util/event.c312
-rw-r--r--tools/perf/util/event.h75
-rw-r--r--tools/perf/util/exec_cmd.h6
-rw-r--r--tools/perf/util/header.c403
-rw-r--r--tools/perf/util/header.h76
-rw-r--r--tools/perf/util/help.h6
-rw-r--r--tools/perf/util/hist.c202
-rw-r--r--tools/perf/util/hist.h50
-rw-r--r--tools/perf/util/include/asm/asm-offsets.h1
-rw-r--r--tools/perf/util/include/asm/bitops.h18
-rw-r--r--tools/perf/util/include/asm/bug.h22
-rw-r--r--tools/perf/util/include/asm/byteorder.h2
-rw-r--r--tools/perf/util/include/asm/swab.h1
-rw-r--r--tools/perf/util/include/asm/uaccess.h14
-rw-r--r--tools/perf/util/include/linux/bitmap.h3
-rw-r--r--tools/perf/util/include/linux/bitops.h29
-rw-r--r--tools/perf/util/include/linux/compiler.h10
-rw-r--r--tools/perf/util/include/linux/ctype.h1
-rw-r--r--tools/perf/util/include/linux/kernel.h76
-rw-r--r--tools/perf/util/include/linux/string.h1
-rw-r--r--tools/perf/util/include/linux/types.h9
-rw-r--r--tools/perf/util/levenshtein.h6
-rw-r--r--tools/perf/util/map.c99
-rw-r--r--tools/perf/util/module.c545
-rw-r--r--tools/perf/util/module.h53
-rw-r--r--tools/perf/util/parse-events.c155
-rw-r--r--tools/perf/util/parse-events.h8
-rw-r--r--tools/perf/util/parse-options.h6
-rw-r--r--tools/perf/util/probe-event.c484
-rw-r--r--tools/perf/util/probe-event.h18
-rw-r--r--tools/perf/util/probe-finder.c732
-rw-r--r--tools/perf/util/probe-finder.h57
-rw-r--r--tools/perf/util/quote.h6
-rw-r--r--tools/perf/util/run-command.h6
-rw-r--r--tools/perf/util/sigchain.h6
-rw-r--r--tools/perf/util/sort.c290
-rw-r--r--tools/perf/util/sort.h99
-rw-r--r--tools/perf/util/strbuf.h6
-rw-r--r--tools/perf/util/string.c194
-rw-r--r--tools/perf/util/string.h10
-rw-r--r--tools/perf/util/strlist.h6
-rw-r--r--tools/perf/util/svghelper.h6
-rw-r--r--tools/perf/util/symbol.c1193
-rw-r--r--tools/perf/util/symbol.h92
-rw-r--r--tools/perf/util/thread.c250
-rw-r--r--tools/perf/util/thread.h50
-rw-r--r--tools/perf/util/trace-event-info.c26
-rw-r--r--tools/perf/util/trace-event-parse.c573
-rw-r--r--tools/perf/util/trace-event-perl.c598
-rw-r--r--tools/perf/util/trace-event-perl.h51
-rw-r--r--tools/perf/util/trace-event-read.c11
-rw-r--r--tools/perf/util/trace-event.h64
-rw-r--r--tools/perf/util/types.h6
-rw-r--r--tools/perf/util/util.h31
-rw-r--r--tools/perf/util/values.h6
-rw-r--r--tools/perf/util/wrapper.c61
1479 files changed, 46316 insertions, 23616 deletions
diff --git a/.gitignore b/.gitignore
index b93fb7eff942..946c7ec5c922 100644
--- a/.gitignore
+++ b/.gitignore
@@ -25,6 +25,7 @@
25*.elf 25*.elf
26*.bin 26*.bin
27*.gz 27*.gz
28*.bz2
28*.lzma 29*.lzma
29*.patch 30*.patch
30*.gcno 31*.gcno
diff --git a/Documentation/DocBook/tracepoint.tmpl b/Documentation/DocBook/tracepoint.tmpl
index b0756d0fd579..8bca1d5cec09 100644
--- a/Documentation/DocBook/tracepoint.tmpl
+++ b/Documentation/DocBook/tracepoint.tmpl
@@ -86,4 +86,9 @@
86!Iinclude/trace/events/irq.h 86!Iinclude/trace/events/irq.h
87 </chapter> 87 </chapter>
88 88
89 <chapter id="signal">
90 <title>SIGNAL</title>
91!Iinclude/trace/events/signal.h
92 </chapter>
93
89</book> 94</book>
diff --git a/Documentation/RCU/trace.txt b/Documentation/RCU/trace.txt
index 187bbf10c923..8608fd85e921 100644
--- a/Documentation/RCU/trace.txt
+++ b/Documentation/RCU/trace.txt
@@ -1,185 +1,10 @@
1CONFIG_RCU_TRACE debugfs Files and Formats 1CONFIG_RCU_TRACE debugfs Files and Formats
2 2
3 3
4The rcupreempt and rcutree implementations of RCU provide debugfs trace 4The rcutree implementation of RCU provides debugfs trace output that
5output that summarizes counters and state. This information is useful for 5summarizes counters and state. This information is useful for debugging
6debugging RCU itself, and can sometimes also help to debug abuses of RCU. 6RCU itself, and can sometimes also help to debug abuses of RCU.
7Note that the rcuclassic implementation of RCU does not provide debugfs 7The following sections describe the debugfs files and formats.
8trace output.
9
10The following sections describe the debugfs files and formats for
11preemptable RCU (rcupreempt) and hierarchical RCU (rcutree).
12
13
14Preemptable RCU debugfs Files and Formats
15
16This implementation of RCU provides three debugfs files under the
17top-level directory RCU: rcu/rcuctrs (which displays the per-CPU
18counters used by preemptable RCU) rcu/rcugp (which displays grace-period
19counters), and rcu/rcustats (which internal counters for debugging RCU).
20
21The output of "cat rcu/rcuctrs" looks as follows:
22
23CPU last cur F M
24 0 5 -5 0 0
25 1 -1 0 0 0
26 2 0 1 0 0
27 3 0 1 0 0
28 4 0 1 0 0
29 5 0 1 0 0
30 6 0 2 0 0
31 7 0 -1 0 0
32 8 0 1 0 0
33ggp = 26226, state = waitzero
34
35The per-CPU fields are as follows:
36
37o "CPU" gives the CPU number. Offline CPUs are not displayed.
38
39o "last" gives the value of the counter that is being decremented
40 for the current grace period phase. In the example above,
41 the counters sum to 4, indicating that there are still four
42 RCU read-side critical sections still running that started
43 before the last counter flip.
44
45o "cur" gives the value of the counter that is currently being
46 both incremented (by rcu_read_lock()) and decremented (by
47 rcu_read_unlock()). In the example above, the counters sum to
48 1, indicating that there is only one RCU read-side critical section
49 still running that started after the last counter flip.
50
51o "F" indicates whether RCU is waiting for this CPU to acknowledge
52 a counter flip. In the above example, RCU is not waiting on any,
53 which is consistent with the state being "waitzero" rather than
54 "waitack".
55
56o "M" indicates whether RCU is waiting for this CPU to execute a
57 memory barrier. In the above example, RCU is not waiting on any,
58 which is consistent with the state being "waitzero" rather than
59 "waitmb".
60
61o "ggp" is the global grace-period counter.
62
63o "state" is the RCU state, which can be one of the following:
64
65 o "idle": there is no grace period in progress.
66
67 o "waitack": RCU just incremented the global grace-period
68 counter, which has the effect of reversing the roles of
69 the "last" and "cur" counters above, and is waiting for
70 all the CPUs to acknowledge the flip. Once the flip has
71 been acknowledged, CPUs will no longer be incrementing
72 what are now the "last" counters, so that their sum will
73 decrease monotonically down to zero.
74
75 o "waitzero": RCU is waiting for the sum of the "last" counters
76 to decrease to zero.
77
78 o "waitmb": RCU is waiting for each CPU to execute a memory
79 barrier, which ensures that instructions from a given CPU's
80 last RCU read-side critical section cannot be reordered
81 with instructions following the memory-barrier instruction.
82
83The output of "cat rcu/rcugp" looks as follows:
84
85oldggp=48870 newggp=48873
86
87Note that reading from this file provokes a synchronize_rcu(). The
88"oldggp" value is that of "ggp" from rcu/rcuctrs above, taken before
89executing the synchronize_rcu(), and the "newggp" value is also the
90"ggp" value, but taken after the synchronize_rcu() command returns.
91
92
93The output of "cat rcu/rcugp" looks as follows:
94
95na=1337955 nl=40 wa=1337915 wl=44 da=1337871 dl=0 dr=1337871 di=1337871
961=50989 e1=6138 i1=49722 ie1=82 g1=49640 a1=315203 ae1=265563 a2=49640
97z1=1401244 ze1=1351605 z2=49639 m1=5661253 me1=5611614 m2=49639
98
99These are counters tracking internal preemptable-RCU events, however,
100some of them may be useful for debugging algorithms using RCU. In
101particular, the "nl", "wl", and "dl" values track the number of RCU
102callbacks in various states. The fields are as follows:
103
104o "na" is the total number of RCU callbacks that have been enqueued
105 since boot.
106
107o "nl" is the number of RCU callbacks waiting for the previous
108 grace period to end so that they can start waiting on the next
109 grace period.
110
111o "wa" is the total number of RCU callbacks that have started waiting
112 for a grace period since boot. "na" should be roughly equal to
113 "nl" plus "wa".
114
115o "wl" is the number of RCU callbacks currently waiting for their
116 grace period to end.
117
118o "da" is the total number of RCU callbacks whose grace periods
119 have completed since boot. "wa" should be roughly equal to
120 "wl" plus "da".
121
122o "dr" is the total number of RCU callbacks that have been removed
123 from the list of callbacks ready to invoke. "dr" should be roughly
124 equal to "da".
125
126o "di" is the total number of RCU callbacks that have been invoked
127 since boot. "di" should be roughly equal to "da", though some
128 early versions of preemptable RCU had a bug so that only the
129 last CPU's count of invocations was displayed, rather than the
130 sum of all CPU's counts.
131
132o "1" is the number of calls to rcu_try_flip(). This should be
133 roughly equal to the sum of "e1", "i1", "a1", "z1", and "m1"
134 described below. In other words, the number of times that
135 the state machine is visited should be equal to the sum of the
136 number of times that each state is visited plus the number of
137 times that the state-machine lock acquisition failed.
138
139o "e1" is the number of times that rcu_try_flip() was unable to
140 acquire the fliplock.
141
142o "i1" is the number of calls to rcu_try_flip_idle().
143
144o "ie1" is the number of times rcu_try_flip_idle() exited early
145 due to the calling CPU having no work for RCU.
146
147o "g1" is the number of times that rcu_try_flip_idle() decided
148 to start a new grace period. "i1" should be roughly equal to
149 "ie1" plus "g1".
150
151o "a1" is the number of calls to rcu_try_flip_waitack().
152
153o "ae1" is the number of times that rcu_try_flip_waitack() found
154 that at least one CPU had not yet acknowledge the new grace period
155 (AKA "counter flip").
156
157o "a2" is the number of time rcu_try_flip_waitack() found that
158 all CPUs had acknowledged. "a1" should be roughly equal to
159 "ae1" plus "a2". (This particular output was collected on
160 a 128-CPU machine, hence the smaller-than-usual fraction of
161 calls to rcu_try_flip_waitack() finding all CPUs having already
162 acknowledged.)
163
164o "z1" is the number of calls to rcu_try_flip_waitzero().
165
166o "ze1" is the number of times that rcu_try_flip_waitzero() found
167 that not all of the old RCU read-side critical sections had
168 completed.
169
170o "z2" is the number of times that rcu_try_flip_waitzero() finds
171 the sum of the counters equal to zero, in other words, that
172 all of the old RCU read-side critical sections had completed.
173 The value of "z1" should be roughly equal to "ze1" plus
174 "z2".
175
176o "m1" is the number of calls to rcu_try_flip_waitmb().
177
178o "me1" is the number of times that rcu_try_flip_waitmb() finds
179 that at least one CPU has not yet executed a memory barrier.
180
181o "m2" is the number of times that rcu_try_flip_waitmb() finds that
182 all CPUs have executed a memory barrier.
183 8
184 9
185Hierarchical RCU debugfs Files and Formats 10Hierarchical RCU debugfs Files and Formats
@@ -210,9 +35,10 @@ rcu_bh:
210 6 c=-275 g=-275 pq=1 pqc=-275 qp=0 dt=859/1 dn=0 df=15 of=0 ri=0 ql=0 b=10 35 6 c=-275 g=-275 pq=1 pqc=-275 qp=0 dt=859/1 dn=0 df=15 of=0 ri=0 ql=0 b=10
211 7 c=-275 g=-275 pq=1 pqc=-275 qp=0 dt=3761/1 dn=0 df=15 of=0 ri=0 ql=0 b=10 36 7 c=-275 g=-275 pq=1 pqc=-275 qp=0 dt=3761/1 dn=0 df=15 of=0 ri=0 ql=0 b=10
212 37
213The first section lists the rcu_data structures for rcu, the second for 38The first section lists the rcu_data structures for rcu_sched, the second
214rcu_bh. Each section has one line per CPU, or eight for this 8-CPU system. 39for rcu_bh. Note that CONFIG_TREE_PREEMPT_RCU kernels will have an
215The fields are as follows: 40additional section for rcu_preempt. Each section has one line per CPU,
41or eight for this 8-CPU system. The fields are as follows:
216 42
217o The number at the beginning of each line is the CPU number. 43o The number at the beginning of each line is the CPU number.
218 CPUs numbers followed by an exclamation mark are offline, 44 CPUs numbers followed by an exclamation mark are offline,
@@ -223,9 +49,9 @@ o The number at the beginning of each line is the CPU number.
223 49
224o "c" is the count of grace periods that this CPU believes have 50o "c" is the count of grace periods that this CPU believes have
225 completed. CPUs in dynticks idle mode may lag quite a ways 51 completed. CPUs in dynticks idle mode may lag quite a ways
226 behind, for example, CPU 4 under "rcu" above, which has slept 52 behind, for example, CPU 4 under "rcu_sched" above, which has
227 through the past 25 RCU grace periods. It is not unusual to 53 slept through the past 25 RCU grace periods. It is not unusual
228 see CPUs lagging by thousands of grace periods. 54 to see CPUs lagging by thousands of grace periods.
229 55
230o "g" is the count of grace periods that this CPU believes have 56o "g" is the count of grace periods that this CPU believes have
231 started. Again, CPUs in dynticks idle mode may lag behind. 57 started. Again, CPUs in dynticks idle mode may lag behind.
@@ -308,8 +134,10 @@ The output of "cat rcu/rcugp" looks as follows:
308rcu_sched: completed=33062 gpnum=33063 134rcu_sched: completed=33062 gpnum=33063
309rcu_bh: completed=464 gpnum=464 135rcu_bh: completed=464 gpnum=464
310 136
311Again, this output is for both "rcu" and "rcu_bh". The fields are 137Again, this output is for both "rcu_sched" and "rcu_bh". Note that
312taken from the rcu_state structure, and are as follows: 138kernels built with CONFIG_TREE_PREEMPT_RCU will have an additional
139"rcu_preempt" line. The fields are taken from the rcu_state structure,
140and are as follows:
313 141
314o "completed" is the number of grace periods that have completed. 142o "completed" is the number of grace periods that have completed.
315 It is comparable to the "c" field from rcu/rcudata in that a 143 It is comparable to the "c" field from rcu/rcudata in that a
@@ -324,23 +152,24 @@ o "gpnum" is the number of grace periods that have started. It is
324 If these two fields are equal (as they are for "rcu_bh" above), 152 If these two fields are equal (as they are for "rcu_bh" above),
325 then there is no grace period in progress, in other words, RCU 153 then there is no grace period in progress, in other words, RCU
326 is idle. On the other hand, if the two fields differ (as they 154 is idle. On the other hand, if the two fields differ (as they
327 do for "rcu" above), then an RCU grace period is in progress. 155 do for "rcu_sched" above), then an RCU grace period is in progress.
328 156
329 157
330The output of "cat rcu/rcuhier" looks as follows, with very long lines: 158The output of "cat rcu/rcuhier" looks as follows, with very long lines:
331 159
332c=6902 g=6903 s=2 jfq=3 j=72c7 nfqs=13142/nfqsng=0(13142) fqlh=6 160c=6902 g=6903 s=2 jfq=3 j=72c7 nfqs=13142/nfqsng=0(13142) fqlh=6 oqlen=0
3331/1 0:127 ^0 1611/1 .>. 0:127 ^0
3343/3 0:35 ^0 0/0 36:71 ^1 0/0 72:107 ^2 0/0 108:127 ^3 1623/3 .>. 0:35 ^0 0/0 .>. 36:71 ^1 0/0 .>. 72:107 ^2 0/0 .>. 108:127 ^3
3353/3f 0:5 ^0 2/3 6:11 ^1 0/0 12:17 ^2 0/0 18:23 ^3 0/0 24:29 ^4 0/0 30:35 ^5 0/0 36:41 ^0 0/0 42:47 ^1 0/0 48:53 ^2 0/0 54:59 ^3 0/0 60:65 ^4 0/0 66:71 ^5 0/0 72:77 ^0 0/0 78:83 ^1 0/0 84:89 ^2 0/0 90:95 ^3 0/0 96:101 ^4 0/0 102:107 ^5 0/0 108:113 ^0 0/0 114:119 ^1 0/0 120:125 ^2 0/0 126:127 ^3 1633/3f .>. 0:5 ^0 2/3 .>. 6:11 ^1 0/0 .>. 12:17 ^2 0/0 .>. 18:23 ^3 0/0 .>. 24:29 ^4 0/0 .>. 30:35 ^5 0/0 .>. 36:41 ^0 0/0 .>. 42:47 ^1 0/0 .>. 48:53 ^2 0/0 .>. 54:59 ^3 0/0 .>. 60:65 ^4 0/0 .>. 66:71 ^5 0/0 .>. 72:77 ^0 0/0 .>. 78:83 ^1 0/0 .>. 84:89 ^2 0/0 .>. 90:95 ^3 0/0 .>. 96:101 ^4 0/0 .>. 102:107 ^5 0/0 .>. 108:113 ^0 0/0 .>. 114:119 ^1 0/0 .>. 120:125 ^2 0/0 .>. 126:127 ^3
336rcu_bh: 164rcu_bh:
337c=-226 g=-226 s=1 jfq=-5701 j=72c7 nfqs=88/nfqsng=0(88) fqlh=0 165c=-226 g=-226 s=1 jfq=-5701 j=72c7 nfqs=88/nfqsng=0(88) fqlh=0 oqlen=0
3380/1 0:127 ^0 1660/1 .>. 0:127 ^0
3390/3 0:35 ^0 0/0 36:71 ^1 0/0 72:107 ^2 0/0 108:127 ^3 1670/3 .>. 0:35 ^0 0/0 .>. 36:71 ^1 0/0 .>. 72:107 ^2 0/0 .>. 108:127 ^3
3400/3f 0:5 ^0 0/3 6:11 ^1 0/0 12:17 ^2 0/0 18:23 ^3 0/0 24:29 ^4 0/0 30:35 ^5 0/0 36:41 ^0 0/0 42:47 ^1 0/0 48:53 ^2 0/0 54:59 ^3 0/0 60:65 ^4 0/0 66:71 ^5 0/0 72:77 ^0 0/0 78:83 ^1 0/0 84:89 ^2 0/0 90:95 ^3 0/0 96:101 ^4 0/0 102:107 ^5 0/0 108:113 ^0 0/0 114:119 ^1 0/0 120:125 ^2 0/0 126:127 ^3 1680/3f .>. 0:5 ^0 0/3 .>. 6:11 ^1 0/0 .>. 12:17 ^2 0/0 .>. 18:23 ^3 0/0 .>. 24:29 ^4 0/0 .>. 30:35 ^5 0/0 .>. 36:41 ^0 0/0 .>. 42:47 ^1 0/0 .>. 48:53 ^2 0/0 .>. 54:59 ^3 0/0 .>. 60:65 ^4 0/0 .>. 66:71 ^5 0/0 .>. 72:77 ^0 0/0 .>. 78:83 ^1 0/0 .>. 84:89 ^2 0/0 .>. 90:95 ^3 0/0 .>. 96:101 ^4 0/0 .>. 102:107 ^5 0/0 .>. 108:113 ^0 0/0 .>. 114:119 ^1 0/0 .>. 120:125 ^2 0/0 .>. 126:127 ^3
341 169
342This is once again split into "rcu" and "rcu_bh" portions. The fields are 170This is once again split into "rcu_sched" and "rcu_bh" portions,
343as follows: 171and CONFIG_TREE_PREEMPT_RCU kernels will again have an additional
172"rcu_preempt" section. The fields are as follows:
344 173
345o "c" is exactly the same as "completed" under rcu/rcugp. 174o "c" is exactly the same as "completed" under rcu/rcugp.
346 175
@@ -372,6 +201,11 @@ o "fqlh" is the number of calls to force_quiescent_state() that
372 exited immediately (without even being counted in nfqs above) 201 exited immediately (without even being counted in nfqs above)
373 due to contention on ->fqslock. 202 due to contention on ->fqslock.
374 203
204o "oqlen" is the number of callbacks on the "orphan" callback
205 list. RCU callbacks are placed on this list by CPUs going
206 offline, and are "adopted" either by the CPU helping the outgoing
207 CPU or by the next rcu_barrier*() call, whichever comes first.
208
375o Each element of the form "1/1 0:127 ^0" represents one struct 209o Each element of the form "1/1 0:127 ^0" represents one struct
376 rcu_node. Each line represents one level of the hierarchy, from 210 rcu_node. Each line represents one level of the hierarchy, from
377 root to leaves. It is best to think of the rcu_data structures 211 root to leaves. It is best to think of the rcu_data structures
@@ -379,7 +213,7 @@ o Each element of the form "1/1 0:127 ^0" represents one struct
379 might be either one, two, or three levels of rcu_node structures, 213 might be either one, two, or three levels of rcu_node structures,
380 depending on the relationship between CONFIG_RCU_FANOUT and 214 depending on the relationship between CONFIG_RCU_FANOUT and
381 CONFIG_NR_CPUS. 215 CONFIG_NR_CPUS.
382 216
383 o The numbers separated by the "/" are the qsmask followed 217 o The numbers separated by the "/" are the qsmask followed
384 by the qsmaskinit. The qsmask will have one bit 218 by the qsmaskinit. The qsmask will have one bit
385 set for each entity in the next lower level that 219 set for each entity in the next lower level that
@@ -389,10 +223,19 @@ o Each element of the form "1/1 0:127 ^0" represents one struct
389 The value of qsmaskinit is assigned to that of qsmask 223 The value of qsmaskinit is assigned to that of qsmask
390 at the beginning of each grace period. 224 at the beginning of each grace period.
391 225
392 For example, for "rcu", the qsmask of the first entry 226 For example, for "rcu_sched", the qsmask of the first
393 of the lowest level is 0x14, meaning that we are still 227 entry of the lowest level is 0x14, meaning that we
394 waiting for CPUs 2 and 4 to check in for the current 228 are still waiting for CPUs 2 and 4 to check in for the
395 grace period. 229 current grace period.
230
231 o The characters separated by the ">" indicate the state
232 of the blocked-tasks lists. A "T" preceding the ">"
233 indicates that at least one task blocked in an RCU
234 read-side critical section blocks the current grace
235 period, while a "." preceding the ">" indicates otherwise.
236 The character following the ">" indicates similarly for
237 the next grace period. A "T" should appear in this
238 field only for rcu-preempt.
396 239
397 o The numbers separated by the ":" are the range of CPUs 240 o The numbers separated by the ":" are the range of CPUs
398 served by this struct rcu_node. This can be helpful 241 served by this struct rcu_node. This can be helpful
@@ -431,8 +274,9 @@ rcu_bh:
431 6 np=120834 qsp=9902 cbr=0 cng=0 gpc=6 gps=3 nf=2 nn=110921 274 6 np=120834 qsp=9902 cbr=0 cng=0 gpc=6 gps=3 nf=2 nn=110921
432 7 np=144888 qsp=26336 cbr=0 cng=0 gpc=8 gps=2 nf=0 nn=118542 275 7 np=144888 qsp=26336 cbr=0 cng=0 gpc=8 gps=2 nf=0 nn=118542
433 276
434As always, this is once again split into "rcu" and "rcu_bh" portions. 277As always, this is once again split into "rcu_sched" and "rcu_bh"
435The fields are as follows: 278portions, with CONFIG_TREE_PREEMPT_RCU kernels having an additional
279"rcu_preempt" section. The fields are as follows:
436 280
437o "np" is the number of times that __rcu_pending() has been invoked 281o "np" is the number of times that __rcu_pending() has been invoked
438 for the corresponding flavor of RCU. 282 for the corresponding flavor of RCU.
diff --git a/Documentation/RCU/whatisRCU.txt b/Documentation/RCU/whatisRCU.txt
index e41a7fecf0d3..d542ca243b80 100644
--- a/Documentation/RCU/whatisRCU.txt
+++ b/Documentation/RCU/whatisRCU.txt
@@ -830,7 +830,7 @@ sched: Critical sections Grace period Barrier
830SRCU: Critical sections Grace period Barrier 830SRCU: Critical sections Grace period Barrier
831 831
832 srcu_read_lock synchronize_srcu N/A 832 srcu_read_lock synchronize_srcu N/A
833 srcu_read_unlock 833 srcu_read_unlock synchronize_srcu_expedited
834 834
835SRCU: Initialization/cleanup 835SRCU: Initialization/cleanup
836 init_srcu_struct 836 init_srcu_struct
diff --git a/Documentation/dontdiff b/Documentation/dontdiff
index e1efc400bed6..e151b2a36267 100644
--- a/Documentation/dontdiff
+++ b/Documentation/dontdiff
@@ -65,6 +65,7 @@ aicdb.h*
65asm-offsets.h 65asm-offsets.h
66asm_offsets.h 66asm_offsets.h
67autoconf.h* 67autoconf.h*
68av_permissions.h
68bbootsect 69bbootsect
69bin2c 70bin2c
70binkernel.spec 71binkernel.spec
@@ -95,12 +96,14 @@ docproc
95elf2ecoff 96elf2ecoff
96elfconfig.h* 97elfconfig.h*
97fixdep 98fixdep
99flask.h
98fore200e_mkfirm 100fore200e_mkfirm
99fore200e_pca_fw.c* 101fore200e_pca_fw.c*
100gconf 102gconf
101gen-devlist 103gen-devlist
102gen_crc32table 104gen_crc32table
103gen_init_cpio 105gen_init_cpio
106genheaders
104genksyms 107genksyms
105*_gray256.c 108*_gray256.c
106ihex2fw 109ihex2fw
diff --git a/Documentation/fb/framebuffer.txt b/Documentation/fb/framebuffer.txt
index b3e3a0356839..fe79e3c8847d 100644
--- a/Documentation/fb/framebuffer.txt
+++ b/Documentation/fb/framebuffer.txt
@@ -312,10 +312,8 @@ and to the following documentation:
3128. Mailing list 3128. Mailing list
313--------------- 313---------------
314 314
315There are several frame buffer device related mailing lists at SourceForge: 315There is a frame buffer device related mailing list at kernel.org:
316 - linux-fbdev-announce@lists.sourceforge.net, for announcements, 316linux-fbdev@vger.kernel.org.
317 - linux-fbdev-user@lists.sourceforge.net, for generic user support,
318 - linux-fbdev-devel@lists.sourceforge.net, for project developers.
319 317
320Point your web browser to http://sourceforge.net/projects/linux-fbdev/ for 318Point your web browser to http://sourceforge.net/projects/linux-fbdev/ for
321subscription information and archive browsing. 319subscription information and archive browsing.
diff --git a/Documentation/feature-removal-schedule.txt b/Documentation/feature-removal-schedule.txt
index bc693fffabe0..f613df8ec7bf 100644
--- a/Documentation/feature-removal-schedule.txt
+++ b/Documentation/feature-removal-schedule.txt
@@ -6,6 +6,21 @@ be removed from this file.
6 6
7--------------------------- 7---------------------------
8 8
9What: USER_SCHED
10When: 2.6.34
11
12Why: USER_SCHED was implemented as a proof of concept for group scheduling.
13 The effect of USER_SCHED can already be achieved from userspace with
14 the help of libcgroup. The removal of USER_SCHED will also simplify
15 the scheduler code with the removal of one major ifdef. There are also
16 issues USER_SCHED has with USER_NS. A decision was taken not to fix
17 those and instead remove USER_SCHED. Also new group scheduling
18 features will not be implemented for USER_SCHED.
19
20Who: Dhaval Giani <dhaval@linux.vnet.ibm.com>
21
22---------------------------
23
9What: PRISM54 24What: PRISM54
10When: 2.6.34 25When: 2.6.34
11 26
diff --git a/Documentation/filesystems/caching/fscache.txt b/Documentation/filesystems/caching/fscache.txt
index 9e94b9491d89..a91e2e2095b0 100644
--- a/Documentation/filesystems/caching/fscache.txt
+++ b/Documentation/filesystems/caching/fscache.txt
@@ -235,6 +235,7 @@ proc files.
235 neg=N Number of negative lookups made 235 neg=N Number of negative lookups made
236 pos=N Number of positive lookups made 236 pos=N Number of positive lookups made
237 crt=N Number of objects created by lookup 237 crt=N Number of objects created by lookup
238 tmo=N Number of lookups timed out and requeued
238 Updates n=N Number of update cookie requests seen 239 Updates n=N Number of update cookie requests seen
239 nul=N Number of upd reqs given a NULL parent 240 nul=N Number of upd reqs given a NULL parent
240 run=N Number of upd reqs granted CPU time 241 run=N Number of upd reqs granted CPU time
@@ -250,8 +251,10 @@ proc files.
250 ok=N Number of successful alloc reqs 251 ok=N Number of successful alloc reqs
251 wt=N Number of alloc reqs that waited on lookup completion 252 wt=N Number of alloc reqs that waited on lookup completion
252 nbf=N Number of alloc reqs rejected -ENOBUFS 253 nbf=N Number of alloc reqs rejected -ENOBUFS
254 int=N Number of alloc reqs aborted -ERESTARTSYS
253 ops=N Number of alloc reqs submitted 255 ops=N Number of alloc reqs submitted
254 owt=N Number of alloc reqs waited for CPU time 256 owt=N Number of alloc reqs waited for CPU time
257 abt=N Number of alloc reqs aborted due to object death
255 Retrvls n=N Number of retrieval (read) requests seen 258 Retrvls n=N Number of retrieval (read) requests seen
256 ok=N Number of successful retr reqs 259 ok=N Number of successful retr reqs
257 wt=N Number of retr reqs that waited on lookup completion 260 wt=N Number of retr reqs that waited on lookup completion
@@ -261,6 +264,7 @@ proc files.
261 oom=N Number of retr reqs failed -ENOMEM 264 oom=N Number of retr reqs failed -ENOMEM
262 ops=N Number of retr reqs submitted 265 ops=N Number of retr reqs submitted
263 owt=N Number of retr reqs waited for CPU time 266 owt=N Number of retr reqs waited for CPU time
267 abt=N Number of retr reqs aborted due to object death
264 Stores n=N Number of storage (write) requests seen 268 Stores n=N Number of storage (write) requests seen
265 ok=N Number of successful store reqs 269 ok=N Number of successful store reqs
266 agn=N Number of store reqs on a page already pending storage 270 agn=N Number of store reqs on a page already pending storage
@@ -268,12 +272,37 @@ proc files.
268 oom=N Number of store reqs failed -ENOMEM 272 oom=N Number of store reqs failed -ENOMEM
269 ops=N Number of store reqs submitted 273 ops=N Number of store reqs submitted
270 run=N Number of store reqs granted CPU time 274 run=N Number of store reqs granted CPU time
275 pgs=N Number of pages given store req processing time
276 rxd=N Number of store reqs deleted from tracking tree
277 olm=N Number of store reqs over store limit
278 VmScan nos=N Number of release reqs against pages with no pending store
279 gon=N Number of release reqs against pages stored by time lock granted
280 bsy=N Number of release reqs ignored due to in-progress store
281 can=N Number of page stores cancelled due to release req
271 Ops pend=N Number of times async ops added to pending queues 282 Ops pend=N Number of times async ops added to pending queues
272 run=N Number of times async ops given CPU time 283 run=N Number of times async ops given CPU time
273 enq=N Number of times async ops queued for processing 284 enq=N Number of times async ops queued for processing
285 can=N Number of async ops cancelled
286 rej=N Number of async ops rejected due to object lookup/create failure
274 dfr=N Number of async ops queued for deferred release 287 dfr=N Number of async ops queued for deferred release
275 rel=N Number of async ops released 288 rel=N Number of async ops released
276 gc=N Number of deferred-release async ops garbage collected 289 gc=N Number of deferred-release async ops garbage collected
290 CacheOp alo=N Number of in-progress alloc_object() cache ops
291 luo=N Number of in-progress lookup_object() cache ops
292 luc=N Number of in-progress lookup_complete() cache ops
293 gro=N Number of in-progress grab_object() cache ops
294 upo=N Number of in-progress update_object() cache ops
295 dro=N Number of in-progress drop_object() cache ops
296 pto=N Number of in-progress put_object() cache ops
297 syn=N Number of in-progress sync_cache() cache ops
298 atc=N Number of in-progress attr_changed() cache ops
299 rap=N Number of in-progress read_or_alloc_page() cache ops
300 ras=N Number of in-progress read_or_alloc_pages() cache ops
301 alp=N Number of in-progress allocate_page() cache ops
302 als=N Number of in-progress allocate_pages() cache ops
303 wrp=N Number of in-progress write_page() cache ops
304 ucp=N Number of in-progress uncache_page() cache ops
305 dsp=N Number of in-progress dissociate_pages() cache ops
277 306
278 307
279 (*) /proc/fs/fscache/histogram 308 (*) /proc/fs/fscache/histogram
@@ -299,6 +328,87 @@ proc files.
299 jiffy range covered, and the SECS field the equivalent number of seconds. 328 jiffy range covered, and the SECS field the equivalent number of seconds.
300 329
301 330
331===========
332OBJECT LIST
333===========
334
335If CONFIG_FSCACHE_OBJECT_LIST is enabled, the FS-Cache facility will maintain a
336list of all the objects currently allocated and allow them to be viewed
337through:
338
339 /proc/fs/fscache/objects
340
341This will look something like:
342
343 [root@andromeda ~]# head /proc/fs/fscache/objects
344 OBJECT PARENT STAT CHLDN OPS OOP IPR EX READS EM EV F S | NETFS_COOKIE_DEF TY FL NETFS_DATA OBJECT_KEY, AUX_DATA
345 ======== ======== ==== ===== === === === == ===== == == = = | ================ == == ================ ================
346 17e4b 2 ACTV 0 0 0 0 0 0 7b 4 0 8 | NFS.fh DT 0 ffff88001dd82820 010006017edcf8bbc93b43298fdfbe71e50b57b13a172c0117f38472, e567634700000000000000000000000063f2404a000000000000000000000000c9030000000000000000000063f2404a
347 1693a 2 ACTV 0 0 0 0 0 0 7b 4 0 8 | NFS.fh DT 0 ffff88002db23380 010006017edcf8bbc93b43298fdfbe71e50b57b1e0162c01a2df0ea6, 420ebc4a000000000000000000000000420ebc4a0000000000000000000000000e1801000000000000000000420ebc4a
348
349where the first set of columns before the '|' describe the object:
350
351 COLUMN DESCRIPTION
352 ======= ===============================================================
353 OBJECT Object debugging ID (appears as OBJ%x in some debug messages)
354 PARENT Debugging ID of parent object
355 STAT Object state
356 CHLDN Number of child objects of this object
357 OPS Number of outstanding operations on this object
358 OOP Number of outstanding child object management operations
359 IPR
360 EX Number of outstanding exclusive operations
361 READS Number of outstanding read operations
362 EM Object's event mask
363 EV Events raised on this object
364 F Object flags
365 S Object slow-work work item flags
366
367and the second set of columns describe the object's cookie, if present:
368
369 COLUMN DESCRIPTION
370 =============== =======================================================
371 NETFS_COOKIE_DEF Name of netfs cookie definition
372 TY Cookie type (IX - index, DT - data, hex - special)
373 FL Cookie flags
374 NETFS_DATA Netfs private data stored in the cookie
375 OBJECT_KEY Object key } 1 column, with separating comma
376 AUX_DATA Object aux data } presence may be configured
377
378The data shown may be filtered by attaching the a key to an appropriate keyring
379before viewing the file. Something like:
380
381 keyctl add user fscache:objlist <restrictions> @s
382
383where <restrictions> are a selection of the following letters:
384
385 K Show hexdump of object key (don't show if not given)
386 A Show hexdump of object aux data (don't show if not given)
387
388and the following paired letters:
389
390 C Show objects that have a cookie
391 c Show objects that don't have a cookie
392 B Show objects that are busy
393 b Show objects that aren't busy
394 W Show objects that have pending writes
395 w Show objects that don't have pending writes
396 R Show objects that have outstanding reads
397 r Show objects that don't have outstanding reads
398 S Show objects that have slow work queued
399 s Show objects that don't have slow work queued
400
401If neither side of a letter pair is given, then both are implied. For example:
402
403 keyctl add user fscache:objlist KB @s
404
405shows objects that are busy, and lists their object keys, but does not dump
406their auxiliary data. It also implies "CcWwRrSs", but as 'B' is given, 'b' is
407not implied.
408
409By default all objects and all fields will be shown.
410
411
302========= 412=========
303DEBUGGING 413DEBUGGING
304========= 414=========
diff --git a/Documentation/filesystems/caching/netfs-api.txt b/Documentation/filesystems/caching/netfs-api.txt
index 2666b1ed5e9e..1902c57b72ef 100644
--- a/Documentation/filesystems/caching/netfs-api.txt
+++ b/Documentation/filesystems/caching/netfs-api.txt
@@ -641,7 +641,7 @@ data file must be retired (see the relinquish cookie function below).
641 641
642Furthermore, note that this does not cancel the asynchronous read or write 642Furthermore, note that this does not cancel the asynchronous read or write
643operation started by the read/alloc and write functions, so the page 643operation started by the read/alloc and write functions, so the page
644invalidation and release functions must use: 644invalidation functions must use:
645 645
646 bool fscache_check_page_write(struct fscache_cookie *cookie, 646 bool fscache_check_page_write(struct fscache_cookie *cookie,
647 struct page *page); 647 struct page *page);
@@ -654,6 +654,25 @@ to see if a page is being written to the cache, and:
654to wait for it to finish if it is. 654to wait for it to finish if it is.
655 655
656 656
657When releasepage() is being implemented, a special FS-Cache function exists to
658manage the heuristics of coping with vmscan trying to eject pages, which may
659conflict with the cache trying to write pages to the cache (which may itself
660need to allocate memory):
661
662 bool fscache_maybe_release_page(struct fscache_cookie *cookie,
663 struct page *page,
664 gfp_t gfp);
665
666This takes the netfs cookie, and the page and gfp arguments as supplied to
667releasepage(). It will return false if the page cannot be released yet for
668some reason and if it returns true, the page has been uncached and can now be
669released.
670
671To make a page available for release, this function may wait for an outstanding
672storage request to complete, or it may attempt to cancel the storage request -
673in which case the page will not be stored in the cache this time.
674
675
657========================== 676==========================
658INDEX AND DATA FILE UPDATE 677INDEX AND DATA FILE UPDATE
659========================== 678==========================
diff --git a/Documentation/filesystems/ocfs2.txt b/Documentation/filesystems/ocfs2.txt
index c2a0871280a0..c58b9f5ba002 100644
--- a/Documentation/filesystems/ocfs2.txt
+++ b/Documentation/filesystems/ocfs2.txt
@@ -20,15 +20,16 @@ Lots of code taken from ext3 and other projects.
20Authors in alphabetical order: 20Authors in alphabetical order:
21Joel Becker <joel.becker@oracle.com> 21Joel Becker <joel.becker@oracle.com>
22Zach Brown <zach.brown@oracle.com> 22Zach Brown <zach.brown@oracle.com>
23Mark Fasheh <mark.fasheh@oracle.com> 23Mark Fasheh <mfasheh@suse.com>
24Kurt Hackel <kurt.hackel@oracle.com> 24Kurt Hackel <kurt.hackel@oracle.com>
25Tao Ma <tao.ma@oracle.com>
25Sunil Mushran <sunil.mushran@oracle.com> 26Sunil Mushran <sunil.mushran@oracle.com>
26Manish Singh <manish.singh@oracle.com> 27Manish Singh <manish.singh@oracle.com>
28Tiger Yang <tiger.yang@oracle.com>
27 29
28Caveats 30Caveats
29======= 31=======
30Features which OCFS2 does not support yet: 32Features which OCFS2 does not support yet:
31 - quotas
32 - Directory change notification (F_NOTIFY) 33 - Directory change notification (F_NOTIFY)
33 - Distributed Caching (F_SETLEASE/F_GETLEASE/break_lease) 34 - Distributed Caching (F_SETLEASE/F_GETLEASE/break_lease)
34 35
@@ -70,7 +71,6 @@ commit=nrsec (*) Ocfs2 can be told to sync all its data and metadata
70 performance. 71 performance.
71localalloc=8(*) Allows custom localalloc size in MB. If the value is too 72localalloc=8(*) Allows custom localalloc size in MB. If the value is too
72 large, the fs will silently revert it to the default. 73 large, the fs will silently revert it to the default.
73 Localalloc is not enabled for local mounts.
74localflocks This disables cluster aware flock. 74localflocks This disables cluster aware flock.
75inode64 Indicates that Ocfs2 is allowed to create inodes at 75inode64 Indicates that Ocfs2 is allowed to create inodes at
76 any location in the filesystem, including those which 76 any location in the filesystem, including those which
diff --git a/Documentation/filesystems/proc.txt b/Documentation/filesystems/proc.txt
index 2c48f945546b..4af0018533f2 100644
--- a/Documentation/filesystems/proc.txt
+++ b/Documentation/filesystems/proc.txt
@@ -1072,7 +1072,8 @@ second). The meanings of the columns are as follows, from left to right:
1072- irq: servicing interrupts 1072- irq: servicing interrupts
1073- softirq: servicing softirqs 1073- softirq: servicing softirqs
1074- steal: involuntary wait 1074- steal: involuntary wait
1075- guest: running a guest 1075- guest: running a normal guest
1076- guest_nice: running a niced guest
1076 1077
1077The "intr" line gives counts of interrupts serviced since boot time, for each 1078The "intr" line gives counts of interrupts serviced since boot time, for each
1078of the possible system interrupts. The first column is the total of all 1079of the possible system interrupts. The first column is the total of all
diff --git a/Documentation/i2c/busses/i2c-piix4 b/Documentation/i2c/busses/i2c-piix4
index c5b37c570554..ac540c71c7eb 100644
--- a/Documentation/i2c/busses/i2c-piix4
+++ b/Documentation/i2c/busses/i2c-piix4
@@ -8,7 +8,7 @@ Supported adapters:
8 Datasheet: Only available via NDA from ServerWorks 8 Datasheet: Only available via NDA from ServerWorks
9 * ATI IXP200, IXP300, IXP400, SB600, SB700 and SB800 southbridges 9 * ATI IXP200, IXP300, IXP400, SB600, SB700 and SB800 southbridges
10 Datasheet: Not publicly available 10 Datasheet: Not publicly available
11 * AMD SB900 11 * AMD Hudson-2
12 Datasheet: Not publicly available 12 Datasheet: Not publicly available
13 * Standard Microsystems (SMSC) SLC90E66 (Victory66) southbridge 13 * Standard Microsystems (SMSC) SLC90E66 (Victory66) southbridge
14 Datasheet: Publicly available at the SMSC website http://www.smsc.com 14 Datasheet: Publicly available at the SMSC website http://www.smsc.com
diff --git a/Documentation/kernel-parameters.txt b/Documentation/kernel-parameters.txt
index 9107b387e91f..fce5b5e516cc 100644
--- a/Documentation/kernel-parameters.txt
+++ b/Documentation/kernel-parameters.txt
@@ -85,7 +85,6 @@ parameter is applicable:
85 PPT Parallel port support is enabled. 85 PPT Parallel port support is enabled.
86 PS2 Appropriate PS/2 support is enabled. 86 PS2 Appropriate PS/2 support is enabled.
87 RAM RAM disk support is enabled. 87 RAM RAM disk support is enabled.
88 ROOTPLUG The example Root Plug LSM is enabled.
89 S390 S390 architecture is enabled. 88 S390 S390 architecture is enabled.
90 SCSI Appropriate SCSI support is enabled. 89 SCSI Appropriate SCSI support is enabled.
91 A lot of drivers has their options described inside of 90 A lot of drivers has their options described inside of
@@ -345,6 +344,15 @@ and is between 256 and 4096 characters. It is defined in the file
345 Change the amount of debugging information output 344 Change the amount of debugging information output
346 when initialising the APIC and IO-APIC components. 345 when initialising the APIC and IO-APIC components.
347 346
347 show_lapic= [APIC,X86] Advanced Programmable Interrupt Controller
348 Limit apic dumping. The parameter defines the maximal
349 number of local apics being dumped. Also it is possible
350 to set it to "all" by meaning -- no limit here.
351 Format: { 1 (default) | 2 | ... | all }.
352 The parameter valid if only apic=debug or
353 apic=verbose is specified.
354 Example: apic=debug show_lapic=all
355
348 apm= [APM] Advanced Power Management 356 apm= [APM] Advanced Power Management
349 See header of arch/x86/kernel/apm_32.c. 357 See header of arch/x86/kernel/apm_32.c.
350 358
@@ -779,6 +787,13 @@ and is between 256 and 4096 characters. It is defined in the file
779 by the set_ftrace_notrace file in the debugfs 787 by the set_ftrace_notrace file in the debugfs
780 tracing directory. 788 tracing directory.
781 789
790 ftrace_graph_filter=[function-list]
791 [FTRACE] Limit the top level callers functions traced
792 by the function graph tracer at boot up.
793 function-list is a comma separated list of functions
794 that can be changed at run time by the
795 set_graph_function file in the debugfs tracing directory.
796
782 gamecon.map[2|3]= 797 gamecon.map[2|3]=
783 [HW,JOY] Multisystem joystick and NES/SNES/PSX pad 798 [HW,JOY] Multisystem joystick and NES/SNES/PSX pad
784 support via parallel port (up to 5 devices per port) 799 support via parallel port (up to 5 devices per port)
@@ -2032,8 +2047,15 @@ and is between 256 and 4096 characters. It is defined in the file
2032 2047
2033 print-fatal-signals= 2048 print-fatal-signals=
2034 [KNL] debug: print fatal signals 2049 [KNL] debug: print fatal signals
2035 print-fatal-signals=1: print segfault info to 2050
2036 the kernel console. 2051 If enabled, warn about various signal handling
2052 related application anomalies: too many signals,
2053 too many POSIX.1 timers, fatal signals causing a
2054 coredump - etc.
2055
2056 If you hit the warning due to signal overflow,
2057 you might want to try "ulimit -i unlimited".
2058
2037 default: off. 2059 default: off.
2038 2060
2039 printk.time= Show timing data prefixed to each printk message line 2061 printk.time= Show timing data prefixed to each printk message line
@@ -2164,15 +2186,6 @@ and is between 256 and 4096 characters. It is defined in the file
2164 Useful for devices that are detected asynchronously 2186 Useful for devices that are detected asynchronously
2165 (e.g. USB and MMC devices). 2187 (e.g. USB and MMC devices).
2166 2188
2167 root_plug.vendor_id=
2168 [ROOTPLUG] Override the default vendor ID
2169
2170 root_plug.product_id=
2171 [ROOTPLUG] Override the default product ID
2172
2173 root_plug.debug=
2174 [ROOTPLUG] Enable debugging output
2175
2176 rw [KNL] Mount root device read-write on boot 2189 rw [KNL] Mount root device read-write on boot
2177 2190
2178 S [KNL] Run init in single mode 2191 S [KNL] Run init in single mode
@@ -2182,6 +2195,8 @@ and is between 256 and 4096 characters. It is defined in the file
2182 2195
2183 sbni= [NET] Granch SBNI12 leased line adapter 2196 sbni= [NET] Granch SBNI12 leased line adapter
2184 2197
2198 sched_debug [KNL] Enables verbose scheduler debug messages.
2199
2185 sc1200wdt= [HW,WDT] SC1200 WDT (watchdog) driver 2200 sc1200wdt= [HW,WDT] SC1200 WDT (watchdog) driver
2186 Format: <io>[,<timeout>[,<isapnp>]] 2201 Format: <io>[,<timeout>[,<isapnp>]]
2187 2202
diff --git a/Documentation/pcmcia/driver-changes.txt b/Documentation/pcmcia/driver-changes.txt
index 059934363caf..446f43b309df 100644
--- a/Documentation/pcmcia/driver-changes.txt
+++ b/Documentation/pcmcia/driver-changes.txt
@@ -1,5 +1,17 @@
1This file details changes in 2.6 which affect PCMCIA card driver authors: 1This file details changes in 2.6 which affect PCMCIA card driver authors:
2 2
3* no cs_error / CS_CHECK / CONFIG_PCMCIA_DEBUG (as of 2.6.33)
4 Instead of the cs_error() callback or the CS_CHECK() macro, please use
5 Linux-style checking of return values, and -- if necessary -- debug
6 messages using "dev_dbg()" or "pr_debug()".
7
8* New CIS tuple access (as of 2.6.33)
9 Instead of pcmcia_get_{first,next}_tuple(), pcmcia_get_tuple_data() and
10 pcmcia_parse_tuple(), a driver shall use "pcmcia_get_tuple()" if it is
11 only interested in one (raw) tuple, or "pcmcia_loop_tuple()" if it is
12 interested in all tuples of one type. To decode the MAC from CISTPL_FUNCE,
13 a new helper "pcmcia_get_mac_from_cis()" was added.
14
3* New configuration loop helper (as of 2.6.28) 15* New configuration loop helper (as of 2.6.28)
4 By calling pcmcia_loop_config(), a driver can iterate over all available 16 By calling pcmcia_loop_config(), a driver can iterate over all available
5 configuration options. During a driver's probe() phase, one doesn't need 17 configuration options. During a driver's probe() phase, one doesn't need
diff --git a/Documentation/slow-work.txt b/Documentation/slow-work.txt
index ebc50f808ea4..9dbf4470c7e1 100644
--- a/Documentation/slow-work.txt
+++ b/Documentation/slow-work.txt
@@ -41,6 +41,13 @@ expand files, provided the time taken to do so isn't too long.
41Operations of both types may sleep during execution, thus tying up the thread 41Operations of both types may sleep during execution, thus tying up the thread
42loaned to it. 42loaned to it.
43 43
44A further class of work item is available, based on the slow work item class:
45
46 (*) Delayed slow work items.
47
48These are slow work items that have a timer to defer queueing of the item for
49a while.
50
44 51
45THREAD-TO-CLASS ALLOCATION 52THREAD-TO-CLASS ALLOCATION
46-------------------------- 53--------------------------
@@ -64,9 +71,11 @@ USING SLOW WORK ITEMS
64Firstly, a module or subsystem wanting to make use of slow work items must 71Firstly, a module or subsystem wanting to make use of slow work items must
65register its interest: 72register its interest:
66 73
67 int ret = slow_work_register_user(); 74 int ret = slow_work_register_user(struct module *module);
68 75
69This will return 0 if successful, or a -ve error upon failure. 76This will return 0 if successful, or a -ve error upon failure. The module
77pointer should be the module interested in using this facility (almost
78certainly THIS_MODULE).
70 79
71 80
72Slow work items may then be set up by: 81Slow work items may then be set up by:
@@ -93,6 +102,10 @@ Slow work items may then be set up by:
93 102
94 or: 103 or:
95 104
105 delayed_slow_work_init(&myitem, &myitem_ops);
106
107 or:
108
96 vslow_work_init(&myitem, &myitem_ops); 109 vslow_work_init(&myitem, &myitem_ops);
97 110
98 depending on its class. 111 depending on its class.
@@ -102,15 +115,92 @@ A suitably set up work item can then be enqueued for processing:
102 int ret = slow_work_enqueue(&myitem); 115 int ret = slow_work_enqueue(&myitem);
103 116
104This will return a -ve error if the thread pool is unable to gain a reference 117This will return a -ve error if the thread pool is unable to gain a reference
105on the item, 0 otherwise. 118on the item, 0 otherwise, or (for delayed work):
119
120 int ret = delayed_slow_work_enqueue(&myitem, my_jiffy_delay);
106 121
107 122
108The items are reference counted, so there ought to be no need for a flush 123The items are reference counted, so there ought to be no need for a flush
109operation. When all a module's slow work items have been processed, and the 124operation. But as the reference counting is optional, means to cancel
125existing work items are also included:
126
127 cancel_slow_work(&myitem);
128 cancel_delayed_slow_work(&myitem);
129
130can be used to cancel pending work. The above cancel function waits for
131existing work to have been executed (or prevent execution of them, depending
132on timing).
133
134
135When all a module's slow work items have been processed, and the
110module has no further interest in the facility, it should unregister its 136module has no further interest in the facility, it should unregister its
111interest: 137interest:
112 138
113 slow_work_unregister_user(); 139 slow_work_unregister_user(struct module *module);
140
141The module pointer is used to wait for all outstanding work items for that
142module before completing the unregistration. This prevents the put_ref() code
143from being taken away before it completes. module should almost certainly be
144THIS_MODULE.
145
146
147================
148HELPER FUNCTIONS
149================
150
151The slow-work facility provides a function by which it can be determined
152whether or not an item is queued for later execution:
153
154 bool queued = slow_work_is_queued(struct slow_work *work);
155
156If it returns false, then the item is not on the queue (it may be executing
157with a requeue pending). This can be used to work out whether an item on which
158another depends is on the queue, thus allowing a dependent item to be queued
159after it.
160
161If the above shows an item on which another depends not to be queued, then the
162owner of the dependent item might need to wait. However, to avoid locking up
163the threads unnecessarily be sleeping in them, it can make sense under some
164circumstances to return the work item to the queue, thus deferring it until
165some other items have had a chance to make use of the yielded thread.
166
167To yield a thread and defer an item, the work function should simply enqueue
168the work item again and return. However, this doesn't work if there's nothing
169actually on the queue, as the thread just vacated will jump straight back into
170the item's work function, thus busy waiting on a CPU.
171
172Instead, the item should use the thread to wait for the dependency to go away,
173but rather than using schedule() or schedule_timeout() to sleep, it should use
174the following function:
175
176 bool requeue = slow_work_sleep_till_thread_needed(
177 struct slow_work *work,
178 signed long *_timeout);
179
180This will add a second wait and then sleep, such that it will be woken up if
181either something appears on the queue that could usefully make use of the
182thread - and behind which this item can be queued, or if the event the caller
183set up to wait for happens. True will be returned if something else appeared
184on the queue and this work function should perhaps return, of false if
185something else woke it up. The timeout is as for schedule_timeout().
186
187For example:
188
189 wq = bit_waitqueue(&my_flags, MY_BIT);
190 init_wait(&wait);
191 requeue = false;
192 do {
193 prepare_to_wait(wq, &wait, TASK_UNINTERRUPTIBLE);
194 if (!test_bit(MY_BIT, &my_flags))
195 break;
196 requeue = slow_work_sleep_till_thread_needed(&my_work,
197 &timeout);
198 } while (timeout > 0 && !requeue);
199 finish_wait(wq, &wait);
200 if (!test_bit(MY_BIT, &my_flags)
201 goto do_my_thing;
202 if (requeue)
203 return; // to slow_work
114 204
115 205
116=============== 206===============
@@ -118,7 +208,8 @@ ITEM OPERATIONS
118=============== 208===============
119 209
120Each work item requires a table of operations of type struct slow_work_ops. 210Each work item requires a table of operations of type struct slow_work_ops.
121All members are required: 211Only ->execute() is required; the getting and putting of a reference and the
212describing of an item are all optional.
122 213
123 (*) Get a reference on an item: 214 (*) Get a reference on an item:
124 215
@@ -148,6 +239,16 @@ All members are required:
148 This should perform the work required of the item. It may sleep, it may 239 This should perform the work required of the item. It may sleep, it may
149 perform disk I/O and it may wait for locks. 240 perform disk I/O and it may wait for locks.
150 241
242 (*) View an item through /proc:
243
244 void (*desc)(struct slow_work *work, struct seq_file *m);
245
246 If supplied, this should print to 'm' a small string describing the work
247 the item is to do. This should be no more than about 40 characters, and
248 shouldn't include a newline character.
249
250 See the 'Viewing executing and queued items' section below.
251
151 252
152================== 253==================
153POOL CONFIGURATION 254POOL CONFIGURATION
@@ -172,3 +273,50 @@ The slow-work thread pool has a number of configurables:
172 is bounded to between 1 and one fewer than the number of active threads. 273 is bounded to between 1 and one fewer than the number of active threads.
173 This ensures there is always at least one thread that can process very 274 This ensures there is always at least one thread that can process very
174 slow work items, and always at least one thread that won't. 275 slow work items, and always at least one thread that won't.
276
277
278==================================
279VIEWING EXECUTING AND QUEUED ITEMS
280==================================
281
282If CONFIG_SLOW_WORK_DEBUG is enabled, a debugfs file is made available:
283
284 /sys/kernel/debug/slow_work/runqueue
285
286through which the list of work items being executed and the queues of items to
287be executed may be viewed. The owner of a work item is given the chance to
288add some information of its own.
289
290The contents look something like the following:
291
292 THR PID ITEM ADDR FL MARK DESC
293 === ===== ================ == ===== ==========
294 0 3005 ffff880023f52348 a 952ms FSC: OBJ17d3: LOOK
295 1 3006 ffff880024e33668 2 160ms FSC: OBJ17e5 OP60d3b: Write1/Store fl=2
296 2 3165 ffff8800296dd180 a 424ms FSC: OBJ17e4: LOOK
297 3 4089 ffff8800262c8d78 a 212ms FSC: OBJ17ea: CRTN
298 4 4090 ffff88002792bed8 2 388ms FSC: OBJ17e8 OP60d36: Write1/Store fl=2
299 5 4092 ffff88002a0ef308 2 388ms FSC: OBJ17e7 OP60d2e: Write1/Store fl=2
300 6 4094 ffff88002abaf4b8 2 132ms FSC: OBJ17e2 OP60d4e: Write1/Store fl=2
301 7 4095 ffff88002bb188e0 a 388ms FSC: OBJ17e9: CRTN
302 vsq - ffff880023d99668 1 308ms FSC: OBJ17e0 OP60f91: Write1/EnQ fl=2
303 vsq - ffff8800295d1740 1 212ms FSC: OBJ16be OP4d4b6: Write1/EnQ fl=2
304 vsq - ffff880025ba3308 1 160ms FSC: OBJ179a OP58dec: Write1/EnQ fl=2
305 vsq - ffff880024ec83e0 1 160ms FSC: OBJ17ae OP599f2: Write1/EnQ fl=2
306 vsq - ffff880026618e00 1 160ms FSC: OBJ17e6 OP60d33: Write1/EnQ fl=2
307 vsq - ffff880025a2a4b8 1 132ms FSC: OBJ16a2 OP4d583: Write1/EnQ fl=2
308 vsq - ffff880023cbe6d8 9 212ms FSC: OBJ17eb: LOOK
309 vsq - ffff880024d37590 9 212ms FSC: OBJ17ec: LOOK
310 vsq - ffff880027746cb0 9 212ms FSC: OBJ17ed: LOOK
311 vsq - ffff880024d37ae8 9 212ms FSC: OBJ17ee: LOOK
312 vsq - ffff880024d37cb0 9 212ms FSC: OBJ17ef: LOOK
313 vsq - ffff880025036550 9 212ms FSC: OBJ17f0: LOOK
314 vsq - ffff8800250368e0 9 212ms FSC: OBJ17f1: LOOK
315 vsq - ffff880025036aa8 9 212ms FSC: OBJ17f2: LOOK
316
317In the 'THR' column, executing items show the thread they're occupying and
318queued threads indicate which queue they're on. 'PID' shows the process ID of
319a slow-work thread that's executing something. 'FL' shows the work item flags.
320'MARK' indicates how long since an item was queued or began executing. Lastly,
321the 'DESC' column permits the owner of an item to give some information.
322
diff --git a/Documentation/thermal/sysfs-api.txt b/Documentation/thermal/sysfs-api.txt
index 70d68ce8640a..a87dc277a5ca 100644
--- a/Documentation/thermal/sysfs-api.txt
+++ b/Documentation/thermal/sysfs-api.txt
@@ -1,5 +1,5 @@
1Generic Thermal Sysfs driver How To 1Generic Thermal Sysfs driver How To
2========================= 2===================================
3 3
4Written by Sujith Thomas <sujith.thomas@intel.com>, Zhang Rui <rui.zhang@intel.com> 4Written by Sujith Thomas <sujith.thomas@intel.com>, Zhang Rui <rui.zhang@intel.com>
5 5
@@ -10,20 +10,20 @@ Copyright (c) 2008 Intel Corporation
10 10
110. Introduction 110. Introduction
12 12
13The generic thermal sysfs provides a set of interfaces for thermal zone devices (sensors) 13The generic thermal sysfs provides a set of interfaces for thermal zone
14and thermal cooling devices (fan, processor...) to register with the thermal management 14devices (sensors) and thermal cooling devices (fan, processor...) to register
15solution and to be a part of it. 15with the thermal management solution and to be a part of it.
16 16
17This how-to focuses on enabling new thermal zone and cooling devices to participate 17This how-to focuses on enabling new thermal zone and cooling devices to
18in thermal management. 18participate in thermal management.
19This solution is platform independent and any type of thermal zone devices and 19This solution is platform independent and any type of thermal zone devices
20cooling devices should be able to make use of the infrastructure. 20and cooling devices should be able to make use of the infrastructure.
21 21
22The main task of the thermal sysfs driver is to expose thermal zone attributes as well 22The main task of the thermal sysfs driver is to expose thermal zone attributes
23as cooling device attributes to the user space. 23as well as cooling device attributes to the user space.
24An intelligent thermal management application can make decisions based on inputs 24An intelligent thermal management application can make decisions based on
25from thermal zone attributes (the current temperature and trip point temperature) 25inputs from thermal zone attributes (the current temperature and trip point
26and throttle appropriate devices. 26temperature) and throttle appropriate devices.
27 27
28[0-*] denotes any positive number starting from 0 28[0-*] denotes any positive number starting from 0
29[1-*] denotes any positive number starting from 1 29[1-*] denotes any positive number starting from 1
@@ -31,77 +31,77 @@ and throttle appropriate devices.
311. thermal sysfs driver interface functions 311. thermal sysfs driver interface functions
32 32
331.1 thermal zone device interface 331.1 thermal zone device interface
341.1.1 struct thermal_zone_device *thermal_zone_device_register(char *name, int trips, 341.1.1 struct thermal_zone_device *thermal_zone_device_register(char *name,
35 void *devdata, struct thermal_zone_device_ops *ops) 35 int trips, void *devdata, struct thermal_zone_device_ops *ops)
36 36
37 This interface function adds a new thermal zone device (sensor) to 37 This interface function adds a new thermal zone device (sensor) to
38 /sys/class/thermal folder as thermal_zone[0-*]. 38 /sys/class/thermal folder as thermal_zone[0-*]. It tries to bind all the
39 It tries to bind all the thermal cooling devices registered at the same time. 39 thermal cooling devices registered at the same time.
40 40
41 name: the thermal zone name. 41 name: the thermal zone name.
42 trips: the total number of trip points this thermal zone supports. 42 trips: the total number of trip points this thermal zone supports.
43 devdata: device private data 43 devdata: device private data
44 ops: thermal zone device call-backs. 44 ops: thermal zone device call-backs.
45 .bind: bind the thermal zone device with a thermal cooling device. 45 .bind: bind the thermal zone device with a thermal cooling device.
46 .unbind: unbind the thermal zone device with a thermal cooling device. 46 .unbind: unbind the thermal zone device with a thermal cooling device.
47 .get_temp: get the current temperature of the thermal zone. 47 .get_temp: get the current temperature of the thermal zone.
48 .get_mode: get the current mode (user/kernel) of the thermal zone. 48 .get_mode: get the current mode (user/kernel) of the thermal zone.
49 "kernel" means thermal management is done in kernel. 49 - "kernel" means thermal management is done in kernel.
50 "user" will prevent kernel thermal driver actions upon trip points 50 - "user" will prevent kernel thermal driver actions upon trip points
51 so that user applications can take charge of thermal management. 51 so that user applications can take charge of thermal management.
52 .set_mode: set the mode (user/kernel) of the thermal zone. 52 .set_mode: set the mode (user/kernel) of the thermal zone.
53 .get_trip_type: get the type of certain trip point. 53 .get_trip_type: get the type of certain trip point.
54 .get_trip_temp: get the temperature above which the certain trip point 54 .get_trip_temp: get the temperature above which the certain trip point
55 will be fired. 55 will be fired.
56 56
571.1.2 void thermal_zone_device_unregister(struct thermal_zone_device *tz) 571.1.2 void thermal_zone_device_unregister(struct thermal_zone_device *tz)
58 58
59 This interface function removes the thermal zone device. 59 This interface function removes the thermal zone device.
60 It deletes the corresponding entry form /sys/class/thermal folder and unbind all 60 It deletes the corresponding entry form /sys/class/thermal folder and
61 the thermal cooling devices it uses. 61 unbind all the thermal cooling devices it uses.
62 62
631.2 thermal cooling device interface 631.2 thermal cooling device interface
641.2.1 struct thermal_cooling_device *thermal_cooling_device_register(char *name, 641.2.1 struct thermal_cooling_device *thermal_cooling_device_register(char *name,
65 void *devdata, struct thermal_cooling_device_ops *) 65 void *devdata, struct thermal_cooling_device_ops *)
66 66
67 This interface function adds a new thermal cooling device (fan/processor/...) to 67 This interface function adds a new thermal cooling device (fan/processor/...)
68 /sys/class/thermal/ folder as cooling_device[0-*]. 68 to /sys/class/thermal/ folder as cooling_device[0-*]. It tries to bind itself
69 It tries to bind itself to all the thermal zone devices register at the same time. 69 to all the thermal zone devices register at the same time.
70 name: the cooling device name. 70 name: the cooling device name.
71 devdata: device private data. 71 devdata: device private data.
72 ops: thermal cooling devices call-backs. 72 ops: thermal cooling devices call-backs.
73 .get_max_state: get the Maximum throttle state of the cooling device. 73 .get_max_state: get the Maximum throttle state of the cooling device.
74 .get_cur_state: get the Current throttle state of the cooling device. 74 .get_cur_state: get the Current throttle state of the cooling device.
75 .set_cur_state: set the Current throttle state of the cooling device. 75 .set_cur_state: set the Current throttle state of the cooling device.
76 76
771.2.2 void thermal_cooling_device_unregister(struct thermal_cooling_device *cdev) 771.2.2 void thermal_cooling_device_unregister(struct thermal_cooling_device *cdev)
78 78
79 This interface function remove the thermal cooling device. 79 This interface function remove the thermal cooling device.
80 It deletes the corresponding entry form /sys/class/thermal folder and unbind 80 It deletes the corresponding entry form /sys/class/thermal folder and
81 itself from all the thermal zone devices using it. 81 unbind itself from all the thermal zone devices using it.
82 82
831.3 interface for binding a thermal zone device with a thermal cooling device 831.3 interface for binding a thermal zone device with a thermal cooling device
841.3.1 int thermal_zone_bind_cooling_device(struct thermal_zone_device *tz, 841.3.1 int thermal_zone_bind_cooling_device(struct thermal_zone_device *tz,
85 int trip, struct thermal_cooling_device *cdev); 85 int trip, struct thermal_cooling_device *cdev);
86 86
87 This interface function bind a thermal cooling device to the certain trip point 87 This interface function bind a thermal cooling device to the certain trip
88 of a thermal zone device. 88 point of a thermal zone device.
89 This function is usually called in the thermal zone device .bind callback. 89 This function is usually called in the thermal zone device .bind callback.
90 tz: the thermal zone device 90 tz: the thermal zone device
91 cdev: thermal cooling device 91 cdev: thermal cooling device
92 trip: indicates which trip point the cooling devices is associated with 92 trip: indicates which trip point the cooling devices is associated with
93 in this thermal zone. 93 in this thermal zone.
94 94
951.3.2 int thermal_zone_unbind_cooling_device(struct thermal_zone_device *tz, 951.3.2 int thermal_zone_unbind_cooling_device(struct thermal_zone_device *tz,
96 int trip, struct thermal_cooling_device *cdev); 96 int trip, struct thermal_cooling_device *cdev);
97 97
98 This interface function unbind a thermal cooling device from the certain trip point 98 This interface function unbind a thermal cooling device from the certain
99 of a thermal zone device. 99 trip point of a thermal zone device. This function is usually called in
100 This function is usually called in the thermal zone device .unbind callback. 100 the thermal zone device .unbind callback.
101 tz: the thermal zone device 101 tz: the thermal zone device
102 cdev: thermal cooling device 102 cdev: thermal cooling device
103 trip: indicates which trip point the cooling devices is associated with 103 trip: indicates which trip point the cooling devices is associated with
104 in this thermal zone. 104 in this thermal zone.
105 105
1062. sysfs attributes structure 1062. sysfs attributes structure
107 107
@@ -114,153 +114,166 @@ if hwmon is compiled in or built as a module.
114 114
115Thermal zone device sys I/F, created once it's registered: 115Thermal zone device sys I/F, created once it's registered:
116/sys/class/thermal/thermal_zone[0-*]: 116/sys/class/thermal/thermal_zone[0-*]:
117 |-----type: Type of the thermal zone 117 |---type: Type of the thermal zone
118 |-----temp: Current temperature 118 |---temp: Current temperature
119 |-----mode: Working mode of the thermal zone 119 |---mode: Working mode of the thermal zone
120 |-----trip_point_[0-*]_temp: Trip point temperature 120 |---trip_point_[0-*]_temp: Trip point temperature
121 |-----trip_point_[0-*]_type: Trip point type 121 |---trip_point_[0-*]_type: Trip point type
122 122
123Thermal cooling device sys I/F, created once it's registered: 123Thermal cooling device sys I/F, created once it's registered:
124/sys/class/thermal/cooling_device[0-*]: 124/sys/class/thermal/cooling_device[0-*]:
125 |-----type : Type of the cooling device(processor/fan/...) 125 |---type: Type of the cooling device(processor/fan/...)
126 |-----max_state: Maximum cooling state of the cooling device 126 |---max_state: Maximum cooling state of the cooling device
127 |-----cur_state: Current cooling state of the cooling device 127 |---cur_state: Current cooling state of the cooling device
128 128
129 129
130These two dynamic attributes are created/removed in pairs. 130Then next two dynamic attributes are created/removed in pairs. They represent
131They represent the relationship between a thermal zone and its associated cooling device. 131the relationship between a thermal zone and its associated cooling device.
132They are created/removed for each 132They are created/removed for each successful execution of
133thermal_zone_bind_cooling_device/thermal_zone_unbind_cooling_device successful execution. 133thermal_zone_bind_cooling_device/thermal_zone_unbind_cooling_device.
134 134
135/sys/class/thermal/thermal_zone[0-*] 135/sys/class/thermal/thermal_zone[0-*]:
136 |-----cdev[0-*]: The [0-*]th cooling device in the current thermal zone 136 |---cdev[0-*]: [0-*]th cooling device in current thermal zone
137 |-----cdev[0-*]_trip_point: Trip point that cdev[0-*] is associated with 137 |---cdev[0-*]_trip_point: Trip point that cdev[0-*] is associated with
138 138
139Besides the thermal zone device sysfs I/F and cooling device sysfs I/F, 139Besides the thermal zone device sysfs I/F and cooling device sysfs I/F,
140the generic thermal driver also creates a hwmon sysfs I/F for each _type_ of 140the generic thermal driver also creates a hwmon sysfs I/F for each _type_
141thermal zone device. E.g. the generic thermal driver registers one hwmon class device 141of thermal zone device. E.g. the generic thermal driver registers one hwmon
142and build the associated hwmon sysfs I/F for all the registered ACPI thermal zones. 142class device and build the associated hwmon sysfs I/F for all the registered
143ACPI thermal zones.
144
143/sys/class/hwmon/hwmon[0-*]: 145/sys/class/hwmon/hwmon[0-*]:
144 |-----name: The type of the thermal zone devices. 146 |---name: The type of the thermal zone devices
145 |-----temp[1-*]_input: The current temperature of thermal zone [1-*]. 147 |---temp[1-*]_input: The current temperature of thermal zone [1-*]
146 |-----temp[1-*]_critical: The critical trip point of thermal zone [1-*]. 148 |---temp[1-*]_critical: The critical trip point of thermal zone [1-*]
149
147Please read Documentation/hwmon/sysfs-interface for additional information. 150Please read Documentation/hwmon/sysfs-interface for additional information.
148 151
149*************************** 152***************************
150* Thermal zone attributes * 153* Thermal zone attributes *
151*************************** 154***************************
152 155
153type Strings which represent the thermal zone type. 156type
154 This is given by thermal zone driver as part of registration. 157 Strings which represent the thermal zone type.
155 Eg: "acpitz" indicates it's an ACPI thermal device. 158 This is given by thermal zone driver as part of registration.
156 In order to keep it consistent with hwmon sys attribute, 159 E.g: "acpitz" indicates it's an ACPI thermal device.
157 this should be a short, lowercase string, 160 In order to keep it consistent with hwmon sys attribute; this should
158 not containing spaces nor dashes. 161 be a short, lowercase string, not containing spaces nor dashes.
159 RO 162 RO, Required
160 Required 163
161 164temp
162temp Current temperature as reported by thermal zone (sensor) 165 Current temperature as reported by thermal zone (sensor).
163 Unit: millidegree Celsius 166 Unit: millidegree Celsius
164 RO 167 RO, Required
165 Required 168
166 169mode
167mode One of the predefined values in [kernel, user] 170 One of the predefined values in [kernel, user].
168 This file gives information about the algorithm 171 This file gives information about the algorithm that is currently
169 that is currently managing the thermal zone. 172 managing the thermal zone. It can be either default kernel based
170 It can be either default kernel based algorithm 173 algorithm or user space application.
171 or user space application. 174 kernel = Thermal management in kernel thermal zone driver.
172 RW 175 user = Preventing kernel thermal zone driver actions upon
173 Optional 176 trip points so that user application can take full
174 kernel = Thermal management in kernel thermal zone driver. 177 charge of the thermal management.
175 user = Preventing kernel thermal zone driver actions upon 178 RW, Optional
176 trip points so that user application can take full 179
177 charge of the thermal management. 180trip_point_[0-*]_temp
178 181 The temperature above which trip point will be fired.
179trip_point_[0-*]_temp The temperature above which trip point will be fired 182 Unit: millidegree Celsius
180 Unit: millidegree Celsius 183 RO, Optional
181 RO 184
182 Optional 185trip_point_[0-*]_type
183 186 Strings which indicate the type of the trip point.
184trip_point_[0-*]_type Strings which indicate the type of the trip point 187 E.g. it can be one of critical, hot, passive, active[0-*] for ACPI
185 E.g. it can be one of critical, hot, passive, 188 thermal zone.
186 active[0-*] for ACPI thermal zone. 189 RO, Optional
187 RO 190
188 Optional 191cdev[0-*]
189 192 Sysfs link to the thermal cooling device node where the sys I/F
190cdev[0-*] Sysfs link to the thermal cooling device node where the sys I/F 193 for cooling device throttling control represents.
191 for cooling device throttling control represents. 194 RO, Optional
192 RO 195
193 Optional 196cdev[0-*]_trip_point
194 197 The trip point with which cdev[0-*] is associated in this thermal
195cdev[0-*]_trip_point The trip point with which cdev[0-*] is associated in this thermal zone 198 zone; -1 means the cooling device is not associated with any trip
196 -1 means the cooling device is not associated with any trip point. 199 point.
197 RO 200 RO, Optional
198 Optional 201
199 202passive
200****************************** 203 Attribute is only present for zones in which the passive cooling
201* Cooling device attributes * 204 policy is not supported by native thermal driver. Default is zero
202****************************** 205 and can be set to a temperature (in millidegrees) to enable a
203 206 passive trip point for the zone. Activation is done by polling with
204type String which represents the type of device 207 an interval of 1 second.
205 eg: For generic ACPI: this should be "Fan", 208 Unit: millidegrees Celsius
206 "Processor" or "LCD" 209 RW, Optional
207 eg. For memory controller device on intel_menlow platform: 210
208 this should be "Memory controller" 211*****************************
209 RO 212* Cooling device attributes *
210 Required 213*****************************
211 214
212max_state The maximum permissible cooling state of this cooling device. 215type
213 RO 216 String which represents the type of device, e.g:
214 Required 217 - for generic ACPI: should be "Fan", "Processor" or "LCD"
215 218 - for memory controller device on intel_menlow platform:
216cur_state The current cooling state of this cooling device. 219 should be "Memory controller".
217 the value can any integer numbers between 0 and max_state, 220 RO, Required
218 cur_state == 0 means no cooling 221
219 cur_state == max_state means the maximum cooling. 222max_state
220 RW 223 The maximum permissible cooling state of this cooling device.
221 Required 224 RO, Required
225
226cur_state
227 The current cooling state of this cooling device.
228 The value can any integer numbers between 0 and max_state:
229 - cur_state == 0 means no cooling
230 - cur_state == max_state means the maximum cooling.
231 RW, Required
222 232
2233. A simple implementation 2333. A simple implementation
224 234
225ACPI thermal zone may support multiple trip points like critical/hot/passive/active. 235ACPI thermal zone may support multiple trip points like critical, hot,
226If an ACPI thermal zone supports critical, passive, active[0] and active[1] at the same time, 236passive, active. If an ACPI thermal zone supports critical, passive,
227it may register itself as a thermal_zone_device (thermal_zone1) with 4 trip points in all. 237active[0] and active[1] at the same time, it may register itself as a
228It has one processor and one fan, which are both registered as thermal_cooling_device. 238thermal_zone_device (thermal_zone1) with 4 trip points in all.
229If the processor is listed in _PSL method, and the fan is listed in _AL0 method, 239It has one processor and one fan, which are both registered as
230the sys I/F structure will be built like this: 240thermal_cooling_device.
241
242If the processor is listed in _PSL method, and the fan is listed in _AL0
243method, the sys I/F structure will be built like this:
231 244
232/sys/class/thermal: 245/sys/class/thermal:
233 246
234|thermal_zone1: 247|thermal_zone1:
235 |-----type: acpitz 248 |---type: acpitz
236 |-----temp: 37000 249 |---temp: 37000
237 |-----mode: kernel 250 |---mode: kernel
238 |-----trip_point_0_temp: 100000 251 |---trip_point_0_temp: 100000
239 |-----trip_point_0_type: critical 252 |---trip_point_0_type: critical
240 |-----trip_point_1_temp: 80000 253 |---trip_point_1_temp: 80000
241 |-----trip_point_1_type: passive 254 |---trip_point_1_type: passive
242 |-----trip_point_2_temp: 70000 255 |---trip_point_2_temp: 70000
243 |-----trip_point_2_type: active0 256 |---trip_point_2_type: active0
244 |-----trip_point_3_temp: 60000 257 |---trip_point_3_temp: 60000
245 |-----trip_point_3_type: active1 258 |---trip_point_3_type: active1
246 |-----cdev0: --->/sys/class/thermal/cooling_device0 259 |---cdev0: --->/sys/class/thermal/cooling_device0
247 |-----cdev0_trip_point: 1 /* cdev0 can be used for passive */ 260 |---cdev0_trip_point: 1 /* cdev0 can be used for passive */
248 |-----cdev1: --->/sys/class/thermal/cooling_device3 261 |---cdev1: --->/sys/class/thermal/cooling_device3
249 |-----cdev1_trip_point: 2 /* cdev1 can be used for active[0]*/ 262 |---cdev1_trip_point: 2 /* cdev1 can be used for active[0]*/
250 263
251|cooling_device0: 264|cooling_device0:
252 |-----type: Processor 265 |---type: Processor
253 |-----max_state: 8 266 |---max_state: 8
254 |-----cur_state: 0 267 |---cur_state: 0
255 268
256|cooling_device3: 269|cooling_device3:
257 |-----type: Fan 270 |---type: Fan
258 |-----max_state: 2 271 |---max_state: 2
259 |-----cur_state: 0 272 |---cur_state: 0
260 273
261/sys/class/hwmon: 274/sys/class/hwmon:
262 275
263|hwmon0: 276|hwmon0:
264 |-----name: acpitz 277 |---name: acpitz
265 |-----temp1_input: 37000 278 |---temp1_input: 37000
266 |-----temp1_crit: 100000 279 |---temp1_crit: 100000
diff --git a/Documentation/trace/ftrace-design.txt b/Documentation/trace/ftrace-design.txt
index 7003e10f10f5..641a1ef2a7ff 100644
--- a/Documentation/trace/ftrace-design.txt
+++ b/Documentation/trace/ftrace-design.txt
@@ -213,10 +213,19 @@ If you can't trace NMI functions, then skip this option.
213<details to be filled> 213<details to be filled>
214 214
215 215
216HAVE_FTRACE_SYSCALLS 216HAVE_SYSCALL_TRACEPOINTS
217--------------------- 217---------------------
218 218
219<details to be filled> 219You need very few things to get the syscalls tracing in an arch.
220
221- Have a NR_syscalls variable in <asm/unistd.h> that provides the number
222 of syscalls supported by the arch.
223- Implement arch_syscall_addr() that resolves a syscall address from a
224 syscall number.
225- Support the TIF_SYSCALL_TRACEPOINT thread flags
226- Put the trace_sys_enter() and trace_sys_exit() tracepoints calls from ptrace
227 in the ptrace syscalls tracing path.
228- Tag this arch as HAVE_SYSCALL_TRACEPOINTS.
220 229
221 230
222HAVE_FTRACE_MCOUNT_RECORD 231HAVE_FTRACE_MCOUNT_RECORD
diff --git a/Documentation/trace/kprobetrace.txt b/Documentation/trace/kprobetrace.txt
new file mode 100644
index 000000000000..47aabeebbdf6
--- /dev/null
+++ b/Documentation/trace/kprobetrace.txt
@@ -0,0 +1,149 @@
1 Kprobe-based Event Tracing
2 ==========================
3
4 Documentation is written by Masami Hiramatsu
5
6
7Overview
8--------
9These events are similar to tracepoint based events. Instead of Tracepoint,
10this is based on kprobes (kprobe and kretprobe). So it can probe wherever
11kprobes can probe (this means, all functions body except for __kprobes
12functions). Unlike the Tracepoint based event, this can be added and removed
13dynamically, on the fly.
14
15To enable this feature, build your kernel with CONFIG_KPROBE_TRACING=y.
16
17Similar to the events tracer, this doesn't need to be activated via
18current_tracer. Instead of that, add probe points via
19/sys/kernel/debug/tracing/kprobe_events, and enable it via
20/sys/kernel/debug/tracing/events/kprobes/<EVENT>/enabled.
21
22
23Synopsis of kprobe_events
24-------------------------
25 p[:[GRP/]EVENT] SYMBOL[+offs]|MEMADDR [FETCHARGS] : Set a probe
26 r[:[GRP/]EVENT] SYMBOL[+0] [FETCHARGS] : Set a return probe
27
28 GRP : Group name. If omitted, use "kprobes" for it.
29 EVENT : Event name. If omitted, the event name is generated
30 based on SYMBOL+offs or MEMADDR.
31 SYMBOL[+offs] : Symbol+offset where the probe is inserted.
32 MEMADDR : Address where the probe is inserted.
33
34 FETCHARGS : Arguments. Each probe can have up to 128 args.
35 %REG : Fetch register REG
36 @ADDR : Fetch memory at ADDR (ADDR should be in kernel)
37 @SYM[+|-offs] : Fetch memory at SYM +|- offs (SYM should be a data symbol)
38 $stackN : Fetch Nth entry of stack (N >= 0)
39 $stack : Fetch stack address.
40 $argN : Fetch function argument. (N >= 0)(*)
41 $retval : Fetch return value.(**)
42 +|-offs(FETCHARG) : Fetch memory at FETCHARG +|- offs address.(***)
43 NAME=FETCHARG: Set NAME as the argument name of FETCHARG.
44
45 (*) aN may not correct on asmlinkaged functions and at the middle of
46 function body.
47 (**) only for return probe.
48 (***) this is useful for fetching a field of data structures.
49
50
51Per-Probe Event Filtering
52-------------------------
53 Per-probe event filtering feature allows you to set different filter on each
54probe and gives you what arguments will be shown in trace buffer. If an event
55name is specified right after 'p:' or 'r:' in kprobe_events, it adds an event
56under tracing/events/kprobes/<EVENT>, at the directory you can see 'id',
57'enabled', 'format' and 'filter'.
58
59enabled:
60 You can enable/disable the probe by writing 1 or 0 on it.
61
62format:
63 This shows the format of this probe event.
64
65filter:
66 You can write filtering rules of this event.
67
68id:
69 This shows the id of this probe event.
70
71
72Event Profiling
73---------------
74 You can check the total number of probe hits and probe miss-hits via
75/sys/kernel/debug/tracing/kprobe_profile.
76 The first column is event name, the second is the number of probe hits,
77the third is the number of probe miss-hits.
78
79
80Usage examples
81--------------
82To add a probe as a new event, write a new definition to kprobe_events
83as below.
84
85 echo p:myprobe do_sys_open dfd=$arg0 filename=$arg1 flags=$arg2 mode=$arg3 > /sys/kernel/debug/tracing/kprobe_events
86
87 This sets a kprobe on the top of do_sys_open() function with recording
881st to 4th arguments as "myprobe" event. As this example shows, users can
89choose more familiar names for each arguments.
90
91 echo r:myretprobe do_sys_open $retval >> /sys/kernel/debug/tracing/kprobe_events
92
93 This sets a kretprobe on the return point of do_sys_open() function with
94recording return value as "myretprobe" event.
95 You can see the format of these events via
96/sys/kernel/debug/tracing/events/kprobes/<EVENT>/format.
97
98 cat /sys/kernel/debug/tracing/events/kprobes/myprobe/format
99name: myprobe
100ID: 75
101format:
102 field:unsigned short common_type; offset:0; size:2;
103 field:unsigned char common_flags; offset:2; size:1;
104 field:unsigned char common_preempt_count; offset:3; size:1;
105 field:int common_pid; offset:4; size:4;
106 field:int common_tgid; offset:8; size:4;
107
108 field: unsigned long ip; offset:16;tsize:8;
109 field: int nargs; offset:24;tsize:4;
110 field: unsigned long dfd; offset:32;tsize:8;
111 field: unsigned long filename; offset:40;tsize:8;
112 field: unsigned long flags; offset:48;tsize:8;
113 field: unsigned long mode; offset:56;tsize:8;
114
115print fmt: "(%lx) dfd=%lx filename=%lx flags=%lx mode=%lx", REC->ip, REC->dfd, REC->filename, REC->flags, REC->mode
116
117
118 You can see that the event has 4 arguments as in the expressions you specified.
119
120 echo > /sys/kernel/debug/tracing/kprobe_events
121
122 This clears all probe points.
123
124 Right after definition, each event is disabled by default. For tracing these
125events, you need to enable it.
126
127 echo 1 > /sys/kernel/debug/tracing/events/kprobes/myprobe/enable
128 echo 1 > /sys/kernel/debug/tracing/events/kprobes/myretprobe/enable
129
130 And you can see the traced information via /sys/kernel/debug/tracing/trace.
131
132 cat /sys/kernel/debug/tracing/trace
133# tracer: nop
134#
135# TASK-PID CPU# TIMESTAMP FUNCTION
136# | | | | |
137 <...>-1447 [001] 1038282.286875: myprobe: (do_sys_open+0x0/0xd6) dfd=3 filename=7fffd1ec4440 flags=8000 mode=0
138 <...>-1447 [001] 1038282.286878: myretprobe: (sys_openat+0xc/0xe <- do_sys_open) $retval=fffffffffffffffe
139 <...>-1447 [001] 1038282.286885: myprobe: (do_sys_open+0x0/0xd6) dfd=ffffff9c filename=40413c flags=8000 mode=1b6
140 <...>-1447 [001] 1038282.286915: myretprobe: (sys_open+0x1b/0x1d <- do_sys_open) $retval=3
141 <...>-1447 [001] 1038282.286969: myprobe: (do_sys_open+0x0/0xd6) dfd=ffffff9c filename=4041c6 flags=98800 mode=10
142 <...>-1447 [001] 1038282.286976: myretprobe: (sys_open+0x1b/0x1d <- do_sys_open) $retval=3
143
144
145 Each line shows when the kernel hits an event, and <- SYMBOL means kernel
146returns from SYMBOL(e.g. "sys_open+0x1b/0x1d <- do_sys_open" means kernel
147returns from do_sys_open to sys_open+0x1b).
148
149
diff --git a/Documentation/vm/page-types.c b/Documentation/vm/page-types.c
index 3ec4f2a22585..4793c6aac733 100644
--- a/Documentation/vm/page-types.c
+++ b/Documentation/vm/page-types.c
@@ -218,7 +218,7 @@ static void fatal(const char *x, ...)
218 exit(EXIT_FAILURE); 218 exit(EXIT_FAILURE);
219} 219}
220 220
221int checked_open(const char *pathname, int flags) 221static int checked_open(const char *pathname, int flags)
222{ 222{
223 int fd = open(pathname, flags); 223 int fd = open(pathname, flags);
224 224
diff --git a/MAINTAINERS b/MAINTAINERS
index a1a2aceca5bd..4f96ac81089c 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -182,7 +182,7 @@ M: Ron Minnich <rminnich@sandia.gov>
182M: Latchesar Ionkov <lucho@ionkov.net> 182M: Latchesar Ionkov <lucho@ionkov.net>
183L: v9fs-developer@lists.sourceforge.net 183L: v9fs-developer@lists.sourceforge.net
184W: http://swik.net/v9fs 184W: http://swik.net/v9fs
185T: git git://git.kernel.org/pub/scm/linux/kernel/ericvh/v9fs.git 185T: git git://git.kernel.org/pub/scm/linux/kernel/git/ericvh/v9fs.git
186S: Maintained 186S: Maintained
187F: Documentation/filesystems/9p.txt 187F: Documentation/filesystems/9p.txt
188F: fs/9p/ 188F: fs/9p/
@@ -512,10 +512,32 @@ W: http://www.arm.linux.org.uk/
512S: Maintained 512S: Maintained
513F: arch/arm/ 513F: arch/arm/
514 514
515ARM PRIMECELL AACI PL041 DRIVER
516M: Russell King <linux@arm.linux.org.uk>
517S: Maintained
518F: sound/arm/aaci.*
519
520ARM PRIMECELL CLCD PL110 DRIVER
521M: Russell King <linux@arm.linux.org.uk>
522S: Maintained
523F: drivers/video/amba-clcd.*
524
525ARM PRIMECELL KMI PL050 DRIVER
526M: Russell King <linux@arm.linux.org.uk>
527S: Maintained
528F: drivers/input/serio/ambakmi.*
529F: include/linux/amba/kmi.h
530
515ARM PRIMECELL MMCI PL180/1 DRIVER 531ARM PRIMECELL MMCI PL180/1 DRIVER
516S: Orphan 532S: Orphan
517F: drivers/mmc/host/mmci.* 533F: drivers/mmc/host/mmci.*
518 534
535ARM PRIMECELL BUS SUPPORT
536M: Russell King <linux@arm.linux.org.uk>
537S: Maintained
538F: drivers/amba/
539F: include/linux/amba/bus.h
540
519ARM/ADI ROADRUNNER MACHINE SUPPORT 541ARM/ADI ROADRUNNER MACHINE SUPPORT
520M: Lennert Buytenhek <kernel@wantstofly.org> 542M: Lennert Buytenhek <kernel@wantstofly.org>
521L: linux-arm-kernel@lists.infradead.org (moderated for non-subscribers) 543L: linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
@@ -906,7 +928,6 @@ M: Karol Kozimor <sziwan@users.sourceforge.net>
906L: acpi4asus-user@lists.sourceforge.net 928L: acpi4asus-user@lists.sourceforge.net
907W: http://acpi4asus.sf.net 929W: http://acpi4asus.sf.net
908S: Maintained 930S: Maintained
909F: arch/x86/kernel/acpi/boot.c
910F: drivers/platform/x86/asus_acpi.c 931F: drivers/platform/x86/asus_acpi.c
911 932
912ASUS ASB100 HARDWARE MONITOR DRIVER 933ASUS ASB100 HARDWARE MONITOR DRIVER
@@ -1028,7 +1049,7 @@ F: drivers/serial/atmel_serial.c
1028 1049
1029ATMEL LCDFB DRIVER 1050ATMEL LCDFB DRIVER
1030M: Nicolas Ferre <nicolas.ferre@atmel.com> 1051M: Nicolas Ferre <nicolas.ferre@atmel.com>
1031L: linux-fbdev-devel@lists.sourceforge.net (moderated for non-subscribers) 1052L: linux-fbdev@vger.kernel.org
1032S: Maintained 1053S: Maintained
1033F: drivers/video/atmel_lcdfb.c 1054F: drivers/video/atmel_lcdfb.c
1034F: include/video/atmel_lcdc.h 1055F: include/video/atmel_lcdc.h
@@ -1245,11 +1266,10 @@ S: Supported
1245F: drivers/net/tg3.* 1266F: drivers/net/tg3.*
1246 1267
1247BROCADE BFA FC SCSI DRIVER 1268BROCADE BFA FC SCSI DRIVER
1248P: Jing Huang 1269M: Jing Huang <huangj@brocade.com>
1249M: huangj@brocade.com 1270L: linux-scsi@vger.kernel.org
1250L: linux-scsi@vger.kernel.org 1271S: Supported
1251S: Supported 1272F: drivers/scsi/bfa/
1252F: drivers/scsi/bfa/
1253 1273
1254BSG (block layer generic sg v4 driver) 1274BSG (block layer generic sg v4 driver)
1255M: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> 1275M: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
@@ -2115,7 +2135,7 @@ F: drivers/net/wan/dlci.c
2115F: drivers/net/wan/sdla.c 2135F: drivers/net/wan/sdla.c
2116 2136
2117FRAMEBUFFER LAYER 2137FRAMEBUFFER LAYER
2118L: linux-fbdev-devel@lists.sourceforge.net (moderated for non-subscribers) 2138L: linux-fbdev@vger.kernel.org
2119W: http://linux-fbdev.sourceforge.net/ 2139W: http://linux-fbdev.sourceforge.net/
2120S: Orphan 2140S: Orphan
2121F: Documentation/fb/ 2141F: Documentation/fb/
@@ -2138,7 +2158,7 @@ F: drivers/i2c/busses/i2c-cpm.c
2138 2158
2139FREESCALE IMX / MXC FRAMEBUFFER DRIVER 2159FREESCALE IMX / MXC FRAMEBUFFER DRIVER
2140M: Sascha Hauer <kernel@pengutronix.de> 2160M: Sascha Hauer <kernel@pengutronix.de>
2141L: linux-fbdev-devel@lists.sourceforge.net (moderated for non-subscribers) 2161L: linux-fbdev@vger.kernel.org
2142L: linux-arm-kernel@lists.infradead.org (moderated for non-subscribers) 2162L: linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
2143S: Maintained 2163S: Maintained
2144F: arch/arm/plat-mxc/include/mach/imxfb.h 2164F: arch/arm/plat-mxc/include/mach/imxfb.h
@@ -2314,6 +2334,13 @@ T: git git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-2.6.git
2314S: Maintained 2334S: Maintained
2315F: drivers/media/video/gspca/finepix.c 2335F: drivers/media/video/gspca/finepix.c
2316 2336
2337GSPCA GL860 SUBDRIVER
2338M: Olivier Lorin <o.lorin@laposte.net>
2339L: linux-media@vger.kernel.org
2340T: git git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-2.6.git
2341S: Maintained
2342F: drivers/media/video/gspca/gl860/
2343
2317GSPCA M5602 SUBDRIVER 2344GSPCA M5602 SUBDRIVER
2318M: Erik Andren <erik.andren@gmail.com> 2345M: Erik Andren <erik.andren@gmail.com>
2319L: linux-media@vger.kernel.org 2346L: linux-media@vger.kernel.org
@@ -2535,8 +2562,7 @@ S: Maintained
2535F: Documentation/i2c/ 2562F: Documentation/i2c/
2536F: drivers/i2c/ 2563F: drivers/i2c/
2537F: include/linux/i2c.h 2564F: include/linux/i2c.h
2538F: include/linux/i2c-dev.h 2565F: include/linux/i2c-*.h
2539F: include/linux/i2c-id.h
2540 2566
2541I2C-TINY-USB DRIVER 2567I2C-TINY-USB DRIVER
2542M: Till Harbaum <till@harbaum.org> 2568M: Till Harbaum <till@harbaum.org>
@@ -2637,7 +2663,7 @@ S: Supported
2637F: security/integrity/ima/ 2663F: security/integrity/ima/
2638 2664
2639IMS TWINTURBO FRAMEBUFFER DRIVER 2665IMS TWINTURBO FRAMEBUFFER DRIVER
2640L: linux-fbdev-devel@lists.sourceforge.net (moderated for non-subscribers) 2666L: linux-fbdev@vger.kernel.org
2641S: Orphan 2667S: Orphan
2642F: drivers/video/imsttfb.c 2668F: drivers/video/imsttfb.c
2643 2669
@@ -2672,14 +2698,14 @@ F: drivers/input/
2672 2698
2673INTEL FRAMEBUFFER DRIVER (excluding 810 and 815) 2699INTEL FRAMEBUFFER DRIVER (excluding 810 and 815)
2674M: Sylvain Meyer <sylvain.meyer@worldonline.fr> 2700M: Sylvain Meyer <sylvain.meyer@worldonline.fr>
2675L: linux-fbdev-devel@lists.sourceforge.net (moderated for non-subscribers) 2701L: linux-fbdev@vger.kernel.org
2676S: Maintained 2702S: Maintained
2677F: Documentation/fb/intelfb.txt 2703F: Documentation/fb/intelfb.txt
2678F: drivers/video/intelfb/ 2704F: drivers/video/intelfb/
2679 2705
2680INTEL 810/815 FRAMEBUFFER DRIVER 2706INTEL 810/815 FRAMEBUFFER DRIVER
2681M: Antonino Daplas <adaplas@gmail.com> 2707M: Antonino Daplas <adaplas@gmail.com>
2682L: linux-fbdev-devel@lists.sourceforge.net (moderated for non-subscribers) 2708L: linux-fbdev@vger.kernel.org
2683S: Maintained 2709S: Maintained
2684F: drivers/video/i810/ 2710F: drivers/video/i810/
2685 2711
@@ -2825,7 +2851,7 @@ F: drivers/infiniband/hw/ipath/
2825 2851
2826IPMI SUBSYSTEM 2852IPMI SUBSYSTEM
2827M: Corey Minyard <minyard@acm.org> 2853M: Corey Minyard <minyard@acm.org>
2828L: openipmi-developer@lists.sourceforge.net 2854L: openipmi-developer@lists.sourceforge.net (moderated for non-subscribers)
2829W: http://openipmi.sourceforge.net/ 2855W: http://openipmi.sourceforge.net/
2830S: Supported 2856S: Supported
2831F: Documentation/IPMI.txt 2857F: Documentation/IPMI.txt
@@ -2989,11 +3015,8 @@ S: Maintained
2989F: fs/autofs4/ 3015F: fs/autofs4/
2990 3016
2991KERNEL BUILD 3017KERNEL BUILD
2992M: Sam Ravnborg <sam@ravnborg.org>
2993T: git git://git.kernel.org/pub/scm/linux/kernel/git/sam/kbuild-next.git
2994T: git git://git.kernel.org/pub/scm/linux/kernel/git/sam/kbuild-fixes.git
2995L: linux-kbuild@vger.kernel.org 3018L: linux-kbuild@vger.kernel.org
2996S: Maintained 3019S: Orphan
2997F: Documentation/kbuild/ 3020F: Documentation/kbuild/
2998F: Makefile 3021F: Makefile
2999F: scripts/Makefile.* 3022F: scripts/Makefile.*
@@ -3086,9 +3109,13 @@ F: kernel/kgdb.c
3086 3109
3087KMEMCHECK 3110KMEMCHECK
3088M: Vegard Nossum <vegardno@ifi.uio.no> 3111M: Vegard Nossum <vegardno@ifi.uio.no>
3089P Pekka Enberg 3112M: Pekka Enberg <penberg@cs.helsinki.fi>
3090M: penberg@cs.helsinki.fi
3091S: Maintained 3113S: Maintained
3114F: Documentation/kmemcheck.txt
3115F: arch/x86/include/asm/kmemcheck.h
3116F: arch/x86/mm/kmemcheck/
3117F: include/linux/kmemcheck.h
3118F: mm/kmemcheck.c
3092 3119
3093KMEMLEAK 3120KMEMLEAK
3094M: Catalin Marinas <catalin.marinas@arm.com> 3121M: Catalin Marinas <catalin.marinas@arm.com>
@@ -3389,7 +3416,7 @@ S: Supported
3389 3416
3390MATROX FRAMEBUFFER DRIVER 3417MATROX FRAMEBUFFER DRIVER
3391M: Petr Vandrovec <vandrove@vc.cvut.cz> 3418M: Petr Vandrovec <vandrove@vc.cvut.cz>
3392L: linux-fbdev-devel@lists.sourceforge.net (moderated for non-subscribers) 3419L: linux-fbdev@vger.kernel.org
3393S: Maintained 3420S: Maintained
3394F: drivers/video/matrox/matroxfb_* 3421F: drivers/video/matrox/matroxfb_*
3395F: include/linux/matroxfb.h 3422F: include/linux/matroxfb.h
@@ -3618,7 +3645,7 @@ L: netfilter@vger.kernel.org
3618L: coreteam@netfilter.org 3645L: coreteam@netfilter.org
3619W: http://www.netfilter.org/ 3646W: http://www.netfilter.org/
3620W: http://www.iptables.org/ 3647W: http://www.iptables.org/
3621T: git://git.kernel.org/pub/scm/linux/kernel/git/kaber/nf-2.6.git 3648T: git git://git.kernel.org/pub/scm/linux/kernel/git/kaber/nf-2.6.git
3622S: Supported 3649S: Supported
3623F: include/linux/netfilter* 3650F: include/linux/netfilter*
3624F: include/linux/netfilter/ 3651F: include/linux/netfilter/
@@ -3665,6 +3692,7 @@ L: netdev@vger.kernel.org
3665W: http://www.linuxfoundation.org/en/Net 3692W: http://www.linuxfoundation.org/en/Net
3666W: http://patchwork.ozlabs.org/project/netdev/list/ 3693W: http://patchwork.ozlabs.org/project/netdev/list/
3667T: git git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6.git 3694T: git git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6.git
3695T: git git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next-2.6.git
3668S: Maintained 3696S: Maintained
3669F: net/ 3697F: net/
3670F: include/net/ 3698F: include/net/
@@ -3775,7 +3803,7 @@ F: fs/ntfs/
3775 3803
3776NVIDIA (rivafb and nvidiafb) FRAMEBUFFER DRIVER 3804NVIDIA (rivafb and nvidiafb) FRAMEBUFFER DRIVER
3777M: Antonino Daplas <adaplas@gmail.com> 3805M: Antonino Daplas <adaplas@gmail.com>
3778L: linux-fbdev-devel@lists.sourceforge.net (moderated for non-subscribers) 3806L: linux-fbdev@vger.kernel.org
3779S: Maintained 3807S: Maintained
3780F: drivers/video/riva/ 3808F: drivers/video/riva/
3781F: drivers/video/nvidia/ 3809F: drivers/video/nvidia/
@@ -3810,7 +3838,7 @@ F: sound/soc/omap/
3810 3838
3811OMAP FRAMEBUFFER SUPPORT 3839OMAP FRAMEBUFFER SUPPORT
3812M: Imre Deak <imre.deak@nokia.com> 3840M: Imre Deak <imre.deak@nokia.com>
3813L: linux-fbdev-devel@lists.sourceforge.net (moderated for non-subscribers) 3841L: linux-fbdev@vger.kernel.org
3814L: linux-omap@vger.kernel.org 3842L: linux-omap@vger.kernel.org
3815S: Maintained 3843S: Maintained
3816F: drivers/video/omap/ 3844F: drivers/video/omap/
@@ -4316,19 +4344,21 @@ F: include/linux/qnxtypes.h
4316 4344
4317RADEON FRAMEBUFFER DISPLAY DRIVER 4345RADEON FRAMEBUFFER DISPLAY DRIVER
4318M: Benjamin Herrenschmidt <benh@kernel.crashing.org> 4346M: Benjamin Herrenschmidt <benh@kernel.crashing.org>
4319L: linux-fbdev-devel@lists.sourceforge.net (moderated for non-subscribers) 4347L: linux-fbdev@vger.kernel.org
4320S: Maintained 4348S: Maintained
4321F: drivers/video/aty/radeon* 4349F: drivers/video/aty/radeon*
4322F: include/linux/radeonfb.h 4350F: include/linux/radeonfb.h
4323 4351
4324RAGE128 FRAMEBUFFER DISPLAY DRIVER 4352RAGE128 FRAMEBUFFER DISPLAY DRIVER
4325M: Paul Mackerras <paulus@samba.org> 4353M: Paul Mackerras <paulus@samba.org>
4326L: linux-fbdev-devel@lists.sourceforge.net (moderated for non-subscribers) 4354L: linux-fbdev@vger.kernel.org
4327S: Maintained 4355S: Maintained
4328F: drivers/video/aty/aty128fb.c 4356F: drivers/video/aty/aty128fb.c
4329 4357
4330RALINK RT2X00 WIRELESS LAN DRIVER 4358RALINK RT2X00 WIRELESS LAN DRIVER
4331P: rt2x00 project 4359P: rt2x00 project
4360M: Ivo van Doorn <IvDoorn@gmail.com>
4361M: Gertjan van Wingerde <gwingerde@gmail.com>
4332L: linux-wireless@vger.kernel.org 4362L: linux-wireless@vger.kernel.org
4333L: users@rt2x00.serialmonkey.com (moderated for non-subscribers) 4363L: users@rt2x00.serialmonkey.com (moderated for non-subscribers)
4334W: http://rt2x00.serialmonkey.com/ 4364W: http://rt2x00.serialmonkey.com/
@@ -4416,7 +4446,7 @@ RFKILL
4416M: Johannes Berg <johannes@sipsolutions.net> 4446M: Johannes Berg <johannes@sipsolutions.net>
4417L: linux-wireless@vger.kernel.org 4447L: linux-wireless@vger.kernel.org
4418S: Maintained 4448S: Maintained
4419F Documentation/rfkill.txt 4449F: Documentation/rfkill.txt
4420F: net/rfkill/ 4450F: net/rfkill/
4421 4451
4422RISCOM8 DRIVER 4452RISCOM8 DRIVER
@@ -4460,7 +4490,7 @@ F: drivers/net/wireless/rtl818x/rtl8187*
4460 4490
4461S3 SAVAGE FRAMEBUFFER DRIVER 4491S3 SAVAGE FRAMEBUFFER DRIVER
4462M: Antonino Daplas <adaplas@gmail.com> 4492M: Antonino Daplas <adaplas@gmail.com>
4463L: linux-fbdev-devel@lists.sourceforge.net (moderated for non-subscribers) 4493L: linux-fbdev@vger.kernel.org
4464S: Maintained 4494S: Maintained
4465F: drivers/video/savage/ 4495F: drivers/video/savage/
4466 4496
@@ -4636,7 +4666,7 @@ F: drivers/mmc/host/sdhci-s3c.c
4636SECURITY SUBSYSTEM 4666SECURITY SUBSYSTEM
4637M: James Morris <jmorris@namei.org> 4667M: James Morris <jmorris@namei.org>
4638L: linux-security-module@vger.kernel.org (suggested Cc:) 4668L: linux-security-module@vger.kernel.org (suggested Cc:)
4639T: git git://www.kernel.org/pub/scm/linux/kernel/git/jmorris/security-testing-2.6.git 4669T: git git://git.kernel.org/pub/scm/linux/kernel/git/jmorris/security-testing-2.6.git
4640W: http://security.wiki.kernel.org/ 4670W: http://security.wiki.kernel.org/
4641S: Supported 4671S: Supported
4642F: security/ 4672F: security/
@@ -4672,12 +4702,11 @@ F: include/linux/ata.h
4672F: include/linux/libata.h 4702F: include/linux/libata.h
4673 4703
4674SERVER ENGINES 10Gbps iSCSI - BladeEngine 2 DRIVER 4704SERVER ENGINES 10Gbps iSCSI - BladeEngine 2 DRIVER
4675P: Jayamohan Kallickal 4705M: Jayamohan Kallickal <jayamohank@serverengines.com>
4676M: jayamohank@serverengines.com 4706L: linux-scsi@vger.kernel.org
4677L: linux-scsi@vger.kernel.org 4707W: http://www.serverengines.com
4678W: http://www.serverengines.com 4708S: Supported
4679S: Supported 4709F: drivers/scsi/be2iscsi/
4680F: drivers/scsi/be2iscsi/
4681 4710
4682SERVER ENGINES 10Gbps NIC - BladeEngine 2 DRIVER 4711SERVER ENGINES 10Gbps NIC - BladeEngine 2 DRIVER
4683M: Sathya Perla <sathyap@serverengines.com> 4712M: Sathya Perla <sathyap@serverengines.com>
@@ -5624,7 +5653,7 @@ S: Maintained
5624 5653
5625UVESAFB DRIVER 5654UVESAFB DRIVER
5626M: Michal Januszewski <spock@gentoo.org> 5655M: Michal Januszewski <spock@gentoo.org>
5627L: linux-fbdev-devel@lists.sourceforge.net (moderated for non-subscribers) 5656L: linux-fbdev@vger.kernel.org
5628W: http://dev.gentoo.org/~spock/projects/uvesafb/ 5657W: http://dev.gentoo.org/~spock/projects/uvesafb/
5629S: Maintained 5658S: Maintained
5630F: Documentation/fb/uvesafb.txt 5659F: Documentation/fb/uvesafb.txt
@@ -5657,7 +5686,7 @@ F: drivers/mmc/host/via-sdmmc.c
5657VIA UNICHROME(PRO)/CHROME9 FRAMEBUFFER DRIVER 5686VIA UNICHROME(PRO)/CHROME9 FRAMEBUFFER DRIVER
5658M: Joseph Chan <JosephChan@via.com.tw> 5687M: Joseph Chan <JosephChan@via.com.tw>
5659M: Scott Fang <ScottFang@viatech.com.cn> 5688M: Scott Fang <ScottFang@viatech.com.cn>
5660L: linux-fbdev-devel@lists.sourceforge.net (moderated for non-subscribers) 5689L: linux-fbdev@vger.kernel.org
5661S: Maintained 5690S: Maintained
5662F: drivers/video/via/ 5691F: drivers/video/via/
5663 5692
@@ -5683,11 +5712,11 @@ F: drivers/vlynq/vlynq.c
5683F: include/linux/vlynq.h 5712F: include/linux/vlynq.h
5684 5713
5685VMWARE VMXNET3 ETHERNET DRIVER 5714VMWARE VMXNET3 ETHERNET DRIVER
5686M: Shreyas Bhatewara <sbhatewara@vmware.com> 5715M: Shreyas Bhatewara <sbhatewara@vmware.com>
5687M: VMware, Inc. <pv-drivers@vmware.com> 5716M: "VMware, Inc." <pv-drivers@vmware.com>
5688L: netdev@vger.kernel.org 5717L: netdev@vger.kernel.org
5689S: Maintained 5718S: Maintained
5690F: drivers/net/vmxnet3/ 5719F: drivers/net/vmxnet3/
5691 5720
5692VOLTAGE AND CURRENT REGULATOR FRAMEWORK 5721VOLTAGE AND CURRENT REGULATOR FRAMEWORK
5693M: Liam Girdwood <lrg@slimlogic.co.uk> 5722M: Liam Girdwood <lrg@slimlogic.co.uk>
diff --git a/Makefile b/Makefile
index 9425d1de54c7..33d4732a6c4a 100644
--- a/Makefile
+++ b/Makefile
@@ -1,7 +1,7 @@
1VERSION = 2 1VERSION = 2
2PATCHLEVEL = 6 2PATCHLEVEL = 6
3SUBLEVEL = 32 3SUBLEVEL = 32
4EXTRAVERSION = -rc5 4EXTRAVERSION =
5NAME = Man-Eating Seals of Antiquity 5NAME = Man-Eating Seals of Antiquity
6 6
7# *DOCUMENTATION* 7# *DOCUMENTATION*
@@ -221,7 +221,7 @@ CONFIG_SHELL := $(shell if [ -x "$$BASH" ]; then echo $$BASH; \
221 221
222HOSTCC = gcc 222HOSTCC = gcc
223HOSTCXX = g++ 223HOSTCXX = g++
224HOSTCFLAGS = -Wall -Wstrict-prototypes -O2 -fomit-frame-pointer 224HOSTCFLAGS = -Wall -Wmissing-prototypes -Wstrict-prototypes -O2 -fomit-frame-pointer
225HOSTCXXFLAGS = -O2 225HOSTCXXFLAGS = -O2
226 226
227# Decide whether to build built-in, modular, or both. 227# Decide whether to build built-in, modular, or both.
@@ -379,6 +379,7 @@ export RCS_TAR_IGNORE := --exclude SCCS --exclude BitKeeper --exclude .svn --exc
379PHONY += scripts_basic 379PHONY += scripts_basic
380scripts_basic: 380scripts_basic:
381 $(Q)$(MAKE) $(build)=scripts/basic 381 $(Q)$(MAKE) $(build)=scripts/basic
382 $(Q)rm -f .tmp_quiet_recordmcount
382 383
383# To avoid any implicit rule to kick in, define an empty command. 384# To avoid any implicit rule to kick in, define an empty command.
384scripts/basic/%: scripts_basic ; 385scripts/basic/%: scripts_basic ;
diff --git a/arch/Kconfig b/arch/Kconfig
index 7f418bbc261a..eef3bbb97075 100644
--- a/arch/Kconfig
+++ b/arch/Kconfig
@@ -126,4 +126,11 @@ config HAVE_DMA_API_DEBUG
126config HAVE_DEFAULT_NO_SPIN_MUTEXES 126config HAVE_DEFAULT_NO_SPIN_MUTEXES
127 bool 127 bool
128 128
129config HAVE_HW_BREAKPOINT
130 bool
131 depends on HAVE_PERF_EVENTS
132 select ANON_INODES
133 select PERF_EVENTS
134
135
129source "kernel/gcov/Kconfig" 136source "kernel/gcov/Kconfig"
diff --git a/arch/alpha/boot/tools/objstrip.c b/arch/alpha/boot/tools/objstrip.c
index 9d0727d18aee..367d53d031fc 100644
--- a/arch/alpha/boot/tools/objstrip.c
+++ b/arch/alpha/boot/tools/objstrip.c
@@ -35,7 +35,7 @@
35const char * prog_name; 35const char * prog_name;
36 36
37 37
38void 38static void
39usage (void) 39usage (void)
40{ 40{
41 fprintf(stderr, 41 fprintf(stderr,
diff --git a/arch/alpha/include/asm/fcntl.h b/arch/alpha/include/asm/fcntl.h
index e42823e954aa..25da0017ec87 100644
--- a/arch/alpha/include/asm/fcntl.h
+++ b/arch/alpha/include/asm/fcntl.h
@@ -26,8 +26,6 @@
26#define F_GETOWN 6 /* for sockets. */ 26#define F_GETOWN 6 /* for sockets. */
27#define F_SETSIG 10 /* for sockets. */ 27#define F_SETSIG 10 /* for sockets. */
28#define F_GETSIG 11 /* for sockets. */ 28#define F_GETSIG 11 /* for sockets. */
29#define F_SETOWN_EX 12
30#define F_GETOWN_EX 13
31 29
32/* for posix fcntl() and lockf() */ 30/* for posix fcntl() and lockf() */
33#define F_RDLCK 1 31#define F_RDLCK 1
diff --git a/arch/alpha/include/asm/thread_info.h b/arch/alpha/include/asm/thread_info.h
index 5076a8860b18..b3e888638bb7 100644
--- a/arch/alpha/include/asm/thread_info.h
+++ b/arch/alpha/include/asm/thread_info.h
@@ -50,32 +50,35 @@ struct thread_info {
50register struct thread_info *__current_thread_info __asm__("$8"); 50register struct thread_info *__current_thread_info __asm__("$8");
51#define current_thread_info() __current_thread_info 51#define current_thread_info() __current_thread_info
52 52
53#endif /* __ASSEMBLY__ */
54
53/* Thread information allocation. */ 55/* Thread information allocation. */
54#define THREAD_SIZE_ORDER 1 56#define THREAD_SIZE_ORDER 1
55#define THREAD_SIZE (2*PAGE_SIZE) 57#define THREAD_SIZE (2*PAGE_SIZE)
56 58
57#endif /* __ASSEMBLY__ */
58
59#define PREEMPT_ACTIVE 0x40000000 59#define PREEMPT_ACTIVE 0x40000000
60 60
61/* 61/*
62 * Thread information flags: 62 * Thread information flags:
63 * - these are process state flags and used from assembly 63 * - these are process state flags and used from assembly
64 * - pending work-to-be-done flags come first to fit in and immediate operand. 64 * - pending work-to-be-done flags come first and must be assigned to be
65 * within bits 0 to 7 to fit in and immediate operand.
66 * - ALPHA_UAC_SHIFT below must be kept consistent with the unaligned
67 * control flags.
65 * 68 *
66 * TIF_SYSCALL_TRACE is known to be 0 via blbs. 69 * TIF_SYSCALL_TRACE is known to be 0 via blbs.
67 */ 70 */
68#define TIF_SYSCALL_TRACE 0 /* syscall trace active */ 71#define TIF_SYSCALL_TRACE 0 /* syscall trace active */
69#define TIF_SIGPENDING 1 /* signal pending */ 72#define TIF_NOTIFY_RESUME 1 /* callback before returning to user */
70#define TIF_NEED_RESCHED 2 /* rescheduling necessary */ 73#define TIF_SIGPENDING 2 /* signal pending */
71#define TIF_POLLING_NRFLAG 3 /* poll_idle is polling NEED_RESCHED */ 74#define TIF_NEED_RESCHED 3 /* rescheduling necessary */
72#define TIF_DIE_IF_KERNEL 4 /* dik recursion lock */ 75#define TIF_POLLING_NRFLAG 8 /* poll_idle is polling NEED_RESCHED */
73#define TIF_UAC_NOPRINT 5 /* see sysinfo.h */ 76#define TIF_DIE_IF_KERNEL 9 /* dik recursion lock */
74#define TIF_UAC_NOFIX 6 77#define TIF_UAC_NOPRINT 10 /* see sysinfo.h */
75#define TIF_UAC_SIGBUS 7 78#define TIF_UAC_NOFIX 11
76#define TIF_MEMDIE 8 79#define TIF_UAC_SIGBUS 12
77#define TIF_RESTORE_SIGMASK 9 /* restore signal mask in do_signal */ 80#define TIF_MEMDIE 13
78#define TIF_NOTIFY_RESUME 10 /* callback before returning to user */ 81#define TIF_RESTORE_SIGMASK 14 /* restore signal mask in do_signal */
79#define TIF_FREEZE 16 /* is freezing for suspend */ 82#define TIF_FREEZE 16 /* is freezing for suspend */
80 83
81#define _TIF_SYSCALL_TRACE (1<<TIF_SYSCALL_TRACE) 84#define _TIF_SYSCALL_TRACE (1<<TIF_SYSCALL_TRACE)
@@ -94,7 +97,7 @@ register struct thread_info *__current_thread_info __asm__("$8");
94#define _TIF_ALLWORK_MASK (_TIF_WORK_MASK \ 97#define _TIF_ALLWORK_MASK (_TIF_WORK_MASK \
95 | _TIF_SYSCALL_TRACE) 98 | _TIF_SYSCALL_TRACE)
96 99
97#define ALPHA_UAC_SHIFT 6 100#define ALPHA_UAC_SHIFT 10
98#define ALPHA_UAC_MASK (1 << TIF_UAC_NOPRINT | 1 << TIF_UAC_NOFIX | \ 101#define ALPHA_UAC_MASK (1 << TIF_UAC_NOPRINT | 1 << TIF_UAC_NOFIX | \
99 1 << TIF_UAC_SIGBUS) 102 1 << TIF_UAC_SIGBUS)
100 103
diff --git a/arch/alpha/kernel/core_marvel.c b/arch/alpha/kernel/core_marvel.c
index 8e059e58b0ac..53dd2f1a53aa 100644
--- a/arch/alpha/kernel/core_marvel.c
+++ b/arch/alpha/kernel/core_marvel.c
@@ -1103,6 +1103,8 @@ marvel_agp_info(void)
1103 * Allocate the info structure. 1103 * Allocate the info structure.
1104 */ 1104 */
1105 agp = kmalloc(sizeof(*agp), GFP_KERNEL); 1105 agp = kmalloc(sizeof(*agp), GFP_KERNEL);
1106 if (!agp)
1107 return NULL;
1106 1108
1107 /* 1109 /*
1108 * Fill it in. 1110 * Fill it in.
diff --git a/arch/alpha/kernel/core_titan.c b/arch/alpha/kernel/core_titan.c
index 76686497b1e2..219bf271c0ba 100644
--- a/arch/alpha/kernel/core_titan.c
+++ b/arch/alpha/kernel/core_titan.c
@@ -757,6 +757,8 @@ titan_agp_info(void)
757 * Allocate the info structure. 757 * Allocate the info structure.
758 */ 758 */
759 agp = kmalloc(sizeof(*agp), GFP_KERNEL); 759 agp = kmalloc(sizeof(*agp), GFP_KERNEL);
760 if (!agp)
761 return NULL;
760 762
761 /* 763 /*
762 * Fill it in. 764 * Fill it in.
diff --git a/arch/alpha/kernel/irq.c b/arch/alpha/kernel/irq.c
index cc7834661427..c0de072b8305 100644
--- a/arch/alpha/kernel/irq.c
+++ b/arch/alpha/kernel/irq.c
@@ -92,7 +92,7 @@ show_interrupts(struct seq_file *p, void *v)
92 for_each_online_cpu(j) 92 for_each_online_cpu(j)
93 seq_printf(p, "%10u ", kstat_irqs_cpu(irq, j)); 93 seq_printf(p, "%10u ", kstat_irqs_cpu(irq, j));
94#endif 94#endif
95 seq_printf(p, " %14s", irq_desc[irq].chip->typename); 95 seq_printf(p, " %14s", irq_desc[irq].chip->name);
96 seq_printf(p, " %c%s", 96 seq_printf(p, " %c%s",
97 (action->flags & IRQF_DISABLED)?'+':' ', 97 (action->flags & IRQF_DISABLED)?'+':' ',
98 action->name); 98 action->name);
diff --git a/arch/alpha/kernel/irq_alpha.c b/arch/alpha/kernel/irq_alpha.c
index 38c805dfc544..cfde865b78e0 100644
--- a/arch/alpha/kernel/irq_alpha.c
+++ b/arch/alpha/kernel/irq_alpha.c
@@ -228,7 +228,7 @@ struct irqaction timer_irqaction = {
228}; 228};
229 229
230static struct irq_chip rtc_irq_type = { 230static struct irq_chip rtc_irq_type = {
231 .typename = "RTC", 231 .name = "RTC",
232 .startup = rtc_startup, 232 .startup = rtc_startup,
233 .shutdown = rtc_enable_disable, 233 .shutdown = rtc_enable_disable,
234 .enable = rtc_enable_disable, 234 .enable = rtc_enable_disable,
diff --git a/arch/alpha/kernel/irq_i8259.c b/arch/alpha/kernel/irq_i8259.c
index 50bfec9b588f..83a9ac280890 100644
--- a/arch/alpha/kernel/irq_i8259.c
+++ b/arch/alpha/kernel/irq_i8259.c
@@ -84,7 +84,7 @@ i8259a_end_irq(unsigned int irq)
84} 84}
85 85
86struct irq_chip i8259a_irq_type = { 86struct irq_chip i8259a_irq_type = {
87 .typename = "XT-PIC", 87 .name = "XT-PIC",
88 .startup = i8259a_startup_irq, 88 .startup = i8259a_startup_irq,
89 .shutdown = i8259a_disable_irq, 89 .shutdown = i8259a_disable_irq,
90 .enable = i8259a_enable_irq, 90 .enable = i8259a_enable_irq,
diff --git a/arch/alpha/kernel/irq_pyxis.c b/arch/alpha/kernel/irq_pyxis.c
index 69199a76ec4a..989ce46a0cf3 100644
--- a/arch/alpha/kernel/irq_pyxis.c
+++ b/arch/alpha/kernel/irq_pyxis.c
@@ -71,7 +71,7 @@ pyxis_mask_and_ack_irq(unsigned int irq)
71} 71}
72 72
73static struct irq_chip pyxis_irq_type = { 73static struct irq_chip pyxis_irq_type = {
74 .typename = "PYXIS", 74 .name = "PYXIS",
75 .startup = pyxis_startup_irq, 75 .startup = pyxis_startup_irq,
76 .shutdown = pyxis_disable_irq, 76 .shutdown = pyxis_disable_irq,
77 .enable = pyxis_enable_irq, 77 .enable = pyxis_enable_irq,
diff --git a/arch/alpha/kernel/irq_srm.c b/arch/alpha/kernel/irq_srm.c
index 85229369a1f8..d63e93e1e8bf 100644
--- a/arch/alpha/kernel/irq_srm.c
+++ b/arch/alpha/kernel/irq_srm.c
@@ -49,7 +49,7 @@ srm_end_irq(unsigned int irq)
49 49
50/* Handle interrupts from the SRM, assuming no additional weirdness. */ 50/* Handle interrupts from the SRM, assuming no additional weirdness. */
51static struct irq_chip srm_irq_type = { 51static struct irq_chip srm_irq_type = {
52 .typename = "SRM", 52 .name = "SRM",
53 .startup = srm_startup_irq, 53 .startup = srm_startup_irq,
54 .shutdown = srm_disable_irq, 54 .shutdown = srm_disable_irq,
55 .enable = srm_enable_irq, 55 .enable = srm_enable_irq,
diff --git a/arch/alpha/kernel/sys_alcor.c b/arch/alpha/kernel/sys_alcor.c
index 382035ef7394..20a30b8b9655 100644
--- a/arch/alpha/kernel/sys_alcor.c
+++ b/arch/alpha/kernel/sys_alcor.c
@@ -90,7 +90,7 @@ alcor_end_irq(unsigned int irq)
90} 90}
91 91
92static struct irq_chip alcor_irq_type = { 92static struct irq_chip alcor_irq_type = {
93 .typename = "ALCOR", 93 .name = "ALCOR",
94 .startup = alcor_startup_irq, 94 .startup = alcor_startup_irq,
95 .shutdown = alcor_disable_irq, 95 .shutdown = alcor_disable_irq,
96 .enable = alcor_enable_irq, 96 .enable = alcor_enable_irq,
diff --git a/arch/alpha/kernel/sys_cabriolet.c b/arch/alpha/kernel/sys_cabriolet.c
index ed349436732b..affd0f3f25df 100644
--- a/arch/alpha/kernel/sys_cabriolet.c
+++ b/arch/alpha/kernel/sys_cabriolet.c
@@ -72,7 +72,7 @@ cabriolet_end_irq(unsigned int irq)
72} 72}
73 73
74static struct irq_chip cabriolet_irq_type = { 74static struct irq_chip cabriolet_irq_type = {
75 .typename = "CABRIOLET", 75 .name = "CABRIOLET",
76 .startup = cabriolet_startup_irq, 76 .startup = cabriolet_startup_irq,
77 .shutdown = cabriolet_disable_irq, 77 .shutdown = cabriolet_disable_irq,
78 .enable = cabriolet_enable_irq, 78 .enable = cabriolet_enable_irq,
diff --git a/arch/alpha/kernel/sys_dp264.c b/arch/alpha/kernel/sys_dp264.c
index 46e70ece5176..d64e1e497e76 100644
--- a/arch/alpha/kernel/sys_dp264.c
+++ b/arch/alpha/kernel/sys_dp264.c
@@ -199,7 +199,7 @@ clipper_set_affinity(unsigned int irq, const struct cpumask *affinity)
199} 199}
200 200
201static struct irq_chip dp264_irq_type = { 201static struct irq_chip dp264_irq_type = {
202 .typename = "DP264", 202 .name = "DP264",
203 .startup = dp264_startup_irq, 203 .startup = dp264_startup_irq,
204 .shutdown = dp264_disable_irq, 204 .shutdown = dp264_disable_irq,
205 .enable = dp264_enable_irq, 205 .enable = dp264_enable_irq,
@@ -210,7 +210,7 @@ static struct irq_chip dp264_irq_type = {
210}; 210};
211 211
212static struct irq_chip clipper_irq_type = { 212static struct irq_chip clipper_irq_type = {
213 .typename = "CLIPPER", 213 .name = "CLIPPER",
214 .startup = clipper_startup_irq, 214 .startup = clipper_startup_irq,
215 .shutdown = clipper_disable_irq, 215 .shutdown = clipper_disable_irq,
216 .enable = clipper_enable_irq, 216 .enable = clipper_enable_irq,
diff --git a/arch/alpha/kernel/sys_eb64p.c b/arch/alpha/kernel/sys_eb64p.c
index 660c23ef661f..df2090ce5e7f 100644
--- a/arch/alpha/kernel/sys_eb64p.c
+++ b/arch/alpha/kernel/sys_eb64p.c
@@ -70,7 +70,7 @@ eb64p_end_irq(unsigned int irq)
70} 70}
71 71
72static struct irq_chip eb64p_irq_type = { 72static struct irq_chip eb64p_irq_type = {
73 .typename = "EB64P", 73 .name = "EB64P",
74 .startup = eb64p_startup_irq, 74 .startup = eb64p_startup_irq,
75 .shutdown = eb64p_disable_irq, 75 .shutdown = eb64p_disable_irq,
76 .enable = eb64p_enable_irq, 76 .enable = eb64p_enable_irq,
diff --git a/arch/alpha/kernel/sys_eiger.c b/arch/alpha/kernel/sys_eiger.c
index b99ea488d844..3ca1dbcf4044 100644
--- a/arch/alpha/kernel/sys_eiger.c
+++ b/arch/alpha/kernel/sys_eiger.c
@@ -81,7 +81,7 @@ eiger_end_irq(unsigned int irq)
81} 81}
82 82
83static struct irq_chip eiger_irq_type = { 83static struct irq_chip eiger_irq_type = {
84 .typename = "EIGER", 84 .name = "EIGER",
85 .startup = eiger_startup_irq, 85 .startup = eiger_startup_irq,
86 .shutdown = eiger_disable_irq, 86 .shutdown = eiger_disable_irq,
87 .enable = eiger_enable_irq, 87 .enable = eiger_enable_irq,
diff --git a/arch/alpha/kernel/sys_jensen.c b/arch/alpha/kernel/sys_jensen.c
index ef0b83a070ac..7a7ae36fff91 100644
--- a/arch/alpha/kernel/sys_jensen.c
+++ b/arch/alpha/kernel/sys_jensen.c
@@ -119,7 +119,7 @@ jensen_local_end(unsigned int irq)
119} 119}
120 120
121static struct irq_chip jensen_local_irq_type = { 121static struct irq_chip jensen_local_irq_type = {
122 .typename = "LOCAL", 122 .name = "LOCAL",
123 .startup = jensen_local_startup, 123 .startup = jensen_local_startup,
124 .shutdown = jensen_local_shutdown, 124 .shutdown = jensen_local_shutdown,
125 .enable = jensen_local_enable, 125 .enable = jensen_local_enable,
diff --git a/arch/alpha/kernel/sys_marvel.c b/arch/alpha/kernel/sys_marvel.c
index bbfc4f20ca72..0bb3b5c4f693 100644
--- a/arch/alpha/kernel/sys_marvel.c
+++ b/arch/alpha/kernel/sys_marvel.c
@@ -170,7 +170,7 @@ marvel_irq_noop_return(unsigned int irq)
170} 170}
171 171
172static struct irq_chip marvel_legacy_irq_type = { 172static struct irq_chip marvel_legacy_irq_type = {
173 .typename = "LEGACY", 173 .name = "LEGACY",
174 .startup = marvel_irq_noop_return, 174 .startup = marvel_irq_noop_return,
175 .shutdown = marvel_irq_noop, 175 .shutdown = marvel_irq_noop,
176 .enable = marvel_irq_noop, 176 .enable = marvel_irq_noop,
@@ -180,7 +180,7 @@ static struct irq_chip marvel_legacy_irq_type = {
180}; 180};
181 181
182static struct irq_chip io7_lsi_irq_type = { 182static struct irq_chip io7_lsi_irq_type = {
183 .typename = "LSI", 183 .name = "LSI",
184 .startup = io7_startup_irq, 184 .startup = io7_startup_irq,
185 .shutdown = io7_disable_irq, 185 .shutdown = io7_disable_irq,
186 .enable = io7_enable_irq, 186 .enable = io7_enable_irq,
@@ -190,7 +190,7 @@ static struct irq_chip io7_lsi_irq_type = {
190}; 190};
191 191
192static struct irq_chip io7_msi_irq_type = { 192static struct irq_chip io7_msi_irq_type = {
193 .typename = "MSI", 193 .name = "MSI",
194 .startup = io7_startup_irq, 194 .startup = io7_startup_irq,
195 .shutdown = io7_disable_irq, 195 .shutdown = io7_disable_irq,
196 .enable = io7_enable_irq, 196 .enable = io7_enable_irq,
diff --git a/arch/alpha/kernel/sys_mikasa.c b/arch/alpha/kernel/sys_mikasa.c
index 4e366641a08e..ee8865169811 100644
--- a/arch/alpha/kernel/sys_mikasa.c
+++ b/arch/alpha/kernel/sys_mikasa.c
@@ -69,7 +69,7 @@ mikasa_end_irq(unsigned int irq)
69} 69}
70 70
71static struct irq_chip mikasa_irq_type = { 71static struct irq_chip mikasa_irq_type = {
72 .typename = "MIKASA", 72 .name = "MIKASA",
73 .startup = mikasa_startup_irq, 73 .startup = mikasa_startup_irq,
74 .shutdown = mikasa_disable_irq, 74 .shutdown = mikasa_disable_irq,
75 .enable = mikasa_enable_irq, 75 .enable = mikasa_enable_irq,
diff --git a/arch/alpha/kernel/sys_noritake.c b/arch/alpha/kernel/sys_noritake.c
index 35753a173bac..86503fe73a88 100644
--- a/arch/alpha/kernel/sys_noritake.c
+++ b/arch/alpha/kernel/sys_noritake.c
@@ -74,7 +74,7 @@ noritake_end_irq(unsigned int irq)
74} 74}
75 75
76static struct irq_chip noritake_irq_type = { 76static struct irq_chip noritake_irq_type = {
77 .typename = "NORITAKE", 77 .name = "NORITAKE",
78 .startup = noritake_startup_irq, 78 .startup = noritake_startup_irq,
79 .shutdown = noritake_disable_irq, 79 .shutdown = noritake_disable_irq,
80 .enable = noritake_enable_irq, 80 .enable = noritake_enable_irq,
diff --git a/arch/alpha/kernel/sys_rawhide.c b/arch/alpha/kernel/sys_rawhide.c
index f3aec7e085c8..26c322bf89ee 100644
--- a/arch/alpha/kernel/sys_rawhide.c
+++ b/arch/alpha/kernel/sys_rawhide.c
@@ -136,7 +136,7 @@ rawhide_end_irq(unsigned int irq)
136} 136}
137 137
138static struct irq_chip rawhide_irq_type = { 138static struct irq_chip rawhide_irq_type = {
139 .typename = "RAWHIDE", 139 .name = "RAWHIDE",
140 .startup = rawhide_startup_irq, 140 .startup = rawhide_startup_irq,
141 .shutdown = rawhide_disable_irq, 141 .shutdown = rawhide_disable_irq,
142 .enable = rawhide_enable_irq, 142 .enable = rawhide_enable_irq,
diff --git a/arch/alpha/kernel/sys_ruffian.c b/arch/alpha/kernel/sys_ruffian.c
index d9f9cfeb9931..8de1046fe91e 100644
--- a/arch/alpha/kernel/sys_ruffian.c
+++ b/arch/alpha/kernel/sys_ruffian.c
@@ -66,7 +66,7 @@ ruffian_init_irq(void)
66 common_init_isa_dma(); 66 common_init_isa_dma();
67} 67}
68 68
69#define RUFFIAN_LATCH ((PIT_TICK_RATE + HZ / 2) / HZ) 69#define RUFFIAN_LATCH DIV_ROUND_CLOSEST(PIT_TICK_RATE, HZ)
70 70
71static void __init 71static void __init
72ruffian_init_rtc(void) 72ruffian_init_rtc(void)
diff --git a/arch/alpha/kernel/sys_rx164.c b/arch/alpha/kernel/sys_rx164.c
index fc9246373452..be161129eab9 100644
--- a/arch/alpha/kernel/sys_rx164.c
+++ b/arch/alpha/kernel/sys_rx164.c
@@ -73,7 +73,7 @@ rx164_end_irq(unsigned int irq)
73} 73}
74 74
75static struct irq_chip rx164_irq_type = { 75static struct irq_chip rx164_irq_type = {
76 .typename = "RX164", 76 .name = "RX164",
77 .startup = rx164_startup_irq, 77 .startup = rx164_startup_irq,
78 .shutdown = rx164_disable_irq, 78 .shutdown = rx164_disable_irq,
79 .enable = rx164_enable_irq, 79 .enable = rx164_enable_irq,
diff --git a/arch/alpha/kernel/sys_sable.c b/arch/alpha/kernel/sys_sable.c
index 426eb6906d01..b2abe27a23cf 100644
--- a/arch/alpha/kernel/sys_sable.c
+++ b/arch/alpha/kernel/sys_sable.c
@@ -502,7 +502,7 @@ sable_lynx_mask_and_ack_irq(unsigned int irq)
502} 502}
503 503
504static struct irq_chip sable_lynx_irq_type = { 504static struct irq_chip sable_lynx_irq_type = {
505 .typename = "SABLE/LYNX", 505 .name = "SABLE/LYNX",
506 .startup = sable_lynx_startup_irq, 506 .startup = sable_lynx_startup_irq,
507 .shutdown = sable_lynx_disable_irq, 507 .shutdown = sable_lynx_disable_irq,
508 .enable = sable_lynx_enable_irq, 508 .enable = sable_lynx_enable_irq,
diff --git a/arch/alpha/kernel/sys_takara.c b/arch/alpha/kernel/sys_takara.c
index 830318c21661..230464885b5c 100644
--- a/arch/alpha/kernel/sys_takara.c
+++ b/arch/alpha/kernel/sys_takara.c
@@ -75,7 +75,7 @@ takara_end_irq(unsigned int irq)
75} 75}
76 76
77static struct irq_chip takara_irq_type = { 77static struct irq_chip takara_irq_type = {
78 .typename = "TAKARA", 78 .name = "TAKARA",
79 .startup = takara_startup_irq, 79 .startup = takara_startup_irq,
80 .shutdown = takara_disable_irq, 80 .shutdown = takara_disable_irq,
81 .enable = takara_enable_irq, 81 .enable = takara_enable_irq,
diff --git a/arch/alpha/kernel/sys_titan.c b/arch/alpha/kernel/sys_titan.c
index 88978fc60f83..288053342c83 100644
--- a/arch/alpha/kernel/sys_titan.c
+++ b/arch/alpha/kernel/sys_titan.c
@@ -195,7 +195,7 @@ init_titan_irqs(struct irq_chip * ops, int imin, int imax)
195} 195}
196 196
197static struct irq_chip titan_irq_type = { 197static struct irq_chip titan_irq_type = {
198 .typename = "TITAN", 198 .name = "TITAN",
199 .startup = titan_startup_irq, 199 .startup = titan_startup_irq,
200 .shutdown = titan_disable_irq, 200 .shutdown = titan_disable_irq,
201 .enable = titan_enable_irq, 201 .enable = titan_enable_irq,
diff --git a/arch/alpha/kernel/sys_wildfire.c b/arch/alpha/kernel/sys_wildfire.c
index e91b4c3838a8..62fd972e18ef 100644
--- a/arch/alpha/kernel/sys_wildfire.c
+++ b/arch/alpha/kernel/sys_wildfire.c
@@ -158,7 +158,7 @@ wildfire_end_irq(unsigned int irq)
158} 158}
159 159
160static struct irq_chip wildfire_irq_type = { 160static struct irq_chip wildfire_irq_type = {
161 .typename = "WILDFIRE", 161 .name = "WILDFIRE",
162 .startup = wildfire_startup_irq, 162 .startup = wildfire_startup_irq,
163 .shutdown = wildfire_disable_irq, 163 .shutdown = wildfire_disable_irq,
164 .enable = wildfire_enable_irq, 164 .enable = wildfire_enable_irq,
diff --git a/arch/arm/configs/ams_delta_defconfig b/arch/arm/configs/ams_delta_defconfig
index 764732529ea3..e8f7380b67d6 100644
--- a/arch/arm/configs/ams_delta_defconfig
+++ b/arch/arm/configs/ams_delta_defconfig
@@ -55,10 +55,10 @@ CONFIG_BLK_DEV_INITRD=y
55CONFIG_INITRAMFS_SOURCE="" 55CONFIG_INITRAMFS_SOURCE=""
56CONFIG_CC_OPTIMIZE_FOR_SIZE=y 56CONFIG_CC_OPTIMIZE_FOR_SIZE=y
57CONFIG_SYSCTL=y 57CONFIG_SYSCTL=y
58# CONFIG_EMBEDDED is not set 58CONFIG_EMBEDDED=y
59CONFIG_UID16=y 59CONFIG_UID16=y
60CONFIG_SYSCTL_SYSCALL=y 60CONFIG_SYSCTL_SYSCALL=y
61CONFIG_KALLSYMS=y 61# CONFIG_KALLSYMS is not set
62# CONFIG_KALLSYMS_ALL is not set 62# CONFIG_KALLSYMS_ALL is not set
63# CONFIG_KALLSYMS_EXTRA_PASS is not set 63# CONFIG_KALLSYMS_EXTRA_PASS is not set
64CONFIG_HOTPLUG=y 64CONFIG_HOTPLUG=y
@@ -224,7 +224,7 @@ CONFIG_CPU_CP15_MMU=y
224# 224#
225# Processor Features 225# Processor Features
226# 226#
227# CONFIG_ARM_THUMB is not set 227CONFIG_ARM_THUMB=y
228# CONFIG_CPU_ICACHE_DISABLE is not set 228# CONFIG_CPU_ICACHE_DISABLE is not set
229# CONFIG_CPU_DCACHE_DISABLE is not set 229# CONFIG_CPU_DCACHE_DISABLE is not set
230CONFIG_CPU_DCACHE_WRITETHROUGH=y 230CONFIG_CPU_DCACHE_WRITETHROUGH=y
@@ -248,7 +248,7 @@ CONFIG_CPU_DCACHE_WRITETHROUGH=y
248# CONFIG_HIGH_RES_TIMERS is not set 248# CONFIG_HIGH_RES_TIMERS is not set
249CONFIG_PREEMPT=y 249CONFIG_PREEMPT=y
250CONFIG_HZ=100 250CONFIG_HZ=100
251# CONFIG_AEABI is not set 251CONFIG_AEABI=y
252# CONFIG_ARCH_DISCONTIGMEM_ENABLE is not set 252# CONFIG_ARCH_DISCONTIGMEM_ENABLE is not set
253CONFIG_SELECT_MEMORY_MODEL=y 253CONFIG_SELECT_MEMORY_MODEL=y
254CONFIG_FLATMEM_MANUAL=y 254CONFIG_FLATMEM_MANUAL=y
@@ -299,7 +299,9 @@ CONFIG_BINFMT_ELF=y
299# 299#
300# Power management options 300# Power management options
301# 301#
302# CONFIG_PM is not set 302CONFIG_PM=y
303# CONFIG_SUSPEND is not set
304CONFIG_PM_RUNTIME=y
303 305
304# 306#
305# Networking 307# Networking
@@ -670,7 +672,7 @@ CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024
670CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768 672CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
671# CONFIG_INPUT_JOYDEV is not set 673# CONFIG_INPUT_JOYDEV is not set
672# CONFIG_INPUT_TSDEV is not set 674# CONFIG_INPUT_TSDEV is not set
673# CONFIG_INPUT_EVDEV is not set 675CONFIG_INPUT_EVDEV=y
674# CONFIG_INPUT_EVBUG is not set 676# CONFIG_INPUT_EVBUG is not set
675 677
676# 678#
@@ -784,6 +786,7 @@ CONFIG_I2C_OMAP=y
784# 786#
785# CONFIG_SPI is not set 787# CONFIG_SPI is not set
786# CONFIG_SPI_MASTER is not set 788# CONFIG_SPI_MASTER is not set
789CONFIG_GPIO_SYSFS=y
787 790
788# 791#
789# Dallas's 1-wire bus 792# Dallas's 1-wire bus
@@ -820,6 +823,7 @@ CONFIG_LEDS_AMS_DELTA=y
820CONFIG_LEDS_TRIGGERS=y 823CONFIG_LEDS_TRIGGERS=y
821CONFIG_LEDS_TRIGGER_TIMER=y 824CONFIG_LEDS_TRIGGER_TIMER=y
822CONFIG_LEDS_TRIGGER_HEARTBEAT=y 825CONFIG_LEDS_TRIGGER_HEARTBEAT=y
826CONFIG_LEDS_TRIGGER_DEFAULT_ON=y
823 827
824# 828#
825# Multimedia devices 829# Multimedia devices
@@ -896,7 +900,13 @@ CONFIG_LOGO_LINUX_CLUT224=y
896# 900#
897# Sound 901# Sound
898# 902#
899# CONFIG_SOUND is not set 903CONFIG_SOUND=y
904CONFIG_SND=y
905CONFIG_SND_MIXER_OSS=y
906CONFIG_SND_PCM_OSS=y
907CONFIG_SND_SOC=y
908CONFIG_SND_OMAP_SOC=y
909CONFIG_SND_OMAP_SOC_AMS_DELTA=y
900 910
901# 911#
902# HID Devices 912# HID Devices
diff --git a/arch/arm/configs/kirkwood_defconfig b/arch/arm/configs/kirkwood_defconfig
index af74cc2de8b6..bcfade33bca9 100644
--- a/arch/arm/configs/kirkwood_defconfig
+++ b/arch/arm/configs/kirkwood_defconfig
@@ -1,15 +1,13 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.30-rc4 3# Linux kernel version: 2.6.32-rc6
4# Mon May 4 11:58:57 2009 4# Sat Nov 7 20:31:18 2009
5# 5#
6CONFIG_ARM=y 6CONFIG_ARM=y
7CONFIG_SYS_SUPPORTS_APM_EMULATION=y 7CONFIG_SYS_SUPPORTS_APM_EMULATION=y
8CONFIG_GENERIC_GPIO=y 8CONFIG_GENERIC_GPIO=y
9CONFIG_GENERIC_TIME=y 9CONFIG_GENERIC_TIME=y
10CONFIG_GENERIC_CLOCKEVENTS=y 10CONFIG_GENERIC_CLOCKEVENTS=y
11CONFIG_MMU=y
12# CONFIG_NO_IOPORT is not set
13CONFIG_GENERIC_HARDIRQS=y 11CONFIG_GENERIC_HARDIRQS=y
14CONFIG_STACKTRACE_SUPPORT=y 12CONFIG_STACKTRACE_SUPPORT=y
15CONFIG_HAVE_LATENCYTOP_SUPPORT=y 13CONFIG_HAVE_LATENCYTOP_SUPPORT=y
@@ -18,13 +16,12 @@ CONFIG_TRACE_IRQFLAGS_SUPPORT=y
18CONFIG_HARDIRQS_SW_RESEND=y 16CONFIG_HARDIRQS_SW_RESEND=y
19CONFIG_GENERIC_IRQ_PROBE=y 17CONFIG_GENERIC_IRQ_PROBE=y
20CONFIG_RWSEM_GENERIC_SPINLOCK=y 18CONFIG_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 19CONFIG_GENERIC_HWEIGHT=y
24CONFIG_GENERIC_CALIBRATE_DELAY=y 20CONFIG_GENERIC_CALIBRATE_DELAY=y
25CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y 21CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y
26CONFIG_VECTORS_BASE=0xffff0000 22CONFIG_VECTORS_BASE=0xffff0000
27CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config" 23CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
24CONFIG_CONSTRUCTORS=y
28 25
29# 26#
30# General setup 27# General setup
@@ -46,11 +43,12 @@ CONFIG_SYSVIPC_SYSCTL=y
46# 43#
47# RCU Subsystem 44# RCU Subsystem
48# 45#
49CONFIG_CLASSIC_RCU=y 46CONFIG_TREE_RCU=y
50# CONFIG_TREE_RCU is not set 47# CONFIG_TREE_PREEMPT_RCU is not set
51# CONFIG_PREEMPT_RCU is not set 48# CONFIG_RCU_TRACE is not set
49CONFIG_RCU_FANOUT=32
50# CONFIG_RCU_FANOUT_EXACT is not set
52# CONFIG_TREE_RCU_TRACE is not set 51# CONFIG_TREE_RCU_TRACE is not set
53# CONFIG_PREEMPT_RCU_TRACE is not set
54# CONFIG_IKCONFIG is not set 52# CONFIG_IKCONFIG is not set
55CONFIG_LOG_BUF_SHIFT=19 53CONFIG_LOG_BUF_SHIFT=19
56# CONFIG_GROUP_SCHED is not set 54# CONFIG_GROUP_SCHED is not set
@@ -73,7 +71,6 @@ CONFIG_SYSCTL_SYSCALL=y
73CONFIG_KALLSYMS=y 71CONFIG_KALLSYMS=y
74# CONFIG_KALLSYMS_ALL is not set 72# CONFIG_KALLSYMS_ALL is not set
75# CONFIG_KALLSYMS_EXTRA_PASS is not set 73# CONFIG_KALLSYMS_EXTRA_PASS is not set
76# CONFIG_STRIP_ASM_SYMS is not set
77CONFIG_HOTPLUG=y 74CONFIG_HOTPLUG=y
78CONFIG_PRINTK=y 75CONFIG_PRINTK=y
79CONFIG_BUG=y 76CONFIG_BUG=y
@@ -86,6 +83,10 @@ CONFIG_TIMERFD=y
86CONFIG_EVENTFD=y 83CONFIG_EVENTFD=y
87CONFIG_SHMEM=y 84CONFIG_SHMEM=y
88CONFIG_AIO=y 85CONFIG_AIO=y
86
87#
88# Kernel Performance Events And Counters
89#
89CONFIG_VM_EVENT_COUNTERS=y 90CONFIG_VM_EVENT_COUNTERS=y
90CONFIG_PCI_QUIRKS=y 91CONFIG_PCI_QUIRKS=y
91CONFIG_SLUB_DEBUG=y 92CONFIG_SLUB_DEBUG=y
@@ -95,13 +96,17 @@ CONFIG_SLUB=y
95# CONFIG_SLOB is not set 96# CONFIG_SLOB is not set
96CONFIG_PROFILING=y 97CONFIG_PROFILING=y
97CONFIG_TRACEPOINTS=y 98CONFIG_TRACEPOINTS=y
98# CONFIG_MARKERS is not set
99CONFIG_OPROFILE=y 99CONFIG_OPROFILE=y
100CONFIG_HAVE_OPROFILE=y 100CONFIG_HAVE_OPROFILE=y
101CONFIG_KPROBES=y 101CONFIG_KPROBES=y
102CONFIG_KRETPROBES=y 102CONFIG_KRETPROBES=y
103CONFIG_HAVE_KPROBES=y 103CONFIG_HAVE_KPROBES=y
104CONFIG_HAVE_KRETPROBES=y 104CONFIG_HAVE_KRETPROBES=y
105
106#
107# GCOV-based kernel profiling
108#
109# CONFIG_GCOV_KERNEL is not set
105# CONFIG_SLOW_WORK is not set 110# CONFIG_SLOW_WORK is not set
106CONFIG_HAVE_GENERIC_DMA_COHERENT=y 111CONFIG_HAVE_GENERIC_DMA_COHERENT=y
107CONFIG_SLABINFO=y 112CONFIG_SLABINFO=y
@@ -114,7 +119,7 @@ CONFIG_MODULE_UNLOAD=y
114# CONFIG_MODVERSIONS is not set 119# CONFIG_MODVERSIONS is not set
115# CONFIG_MODULE_SRCVERSION_ALL is not set 120# CONFIG_MODULE_SRCVERSION_ALL is not set
116CONFIG_BLOCK=y 121CONFIG_BLOCK=y
117# CONFIG_LBD is not set 122CONFIG_LBDAF=y
118# CONFIG_BLK_DEV_BSG is not set 123# CONFIG_BLK_DEV_BSG is not set
119# CONFIG_BLK_DEV_INTEGRITY is not set 124# CONFIG_BLK_DEV_INTEGRITY is not set
120 125
@@ -135,19 +140,22 @@ CONFIG_DEFAULT_IOSCHED="cfq"
135# 140#
136# System Type 141# System Type
137# 142#
143CONFIG_MMU=y
138# CONFIG_ARCH_AAEC2000 is not set 144# CONFIG_ARCH_AAEC2000 is not set
139# CONFIG_ARCH_INTEGRATOR is not set 145# CONFIG_ARCH_INTEGRATOR is not set
140# CONFIG_ARCH_REALVIEW is not set 146# CONFIG_ARCH_REALVIEW is not set
141# CONFIG_ARCH_VERSATILE is not set 147# CONFIG_ARCH_VERSATILE is not set
142# CONFIG_ARCH_AT91 is not set 148# CONFIG_ARCH_AT91 is not set
143# CONFIG_ARCH_CLPS711X is not set 149# CONFIG_ARCH_CLPS711X is not set
150# CONFIG_ARCH_GEMINI is not set
144# CONFIG_ARCH_EBSA110 is not set 151# CONFIG_ARCH_EBSA110 is not set
145# CONFIG_ARCH_EP93XX is not set 152# CONFIG_ARCH_EP93XX is not set
146# CONFIG_ARCH_GEMINI is not set
147# CONFIG_ARCH_FOOTBRIDGE is not set 153# CONFIG_ARCH_FOOTBRIDGE is not set
154# CONFIG_ARCH_MXC is not set
155# CONFIG_ARCH_STMP3XXX is not set
148# CONFIG_ARCH_NETX is not set 156# CONFIG_ARCH_NETX is not set
149# CONFIG_ARCH_H720X is not set 157# CONFIG_ARCH_H720X is not set
150# CONFIG_ARCH_IMX is not set 158# CONFIG_ARCH_NOMADIK is not set
151# CONFIG_ARCH_IOP13XX is not set 159# CONFIG_ARCH_IOP13XX is not set
152# CONFIG_ARCH_IOP32X is not set 160# CONFIG_ARCH_IOP32X is not set
153# CONFIG_ARCH_IOP33X is not set 161# CONFIG_ARCH_IOP33X is not set
@@ -156,25 +164,27 @@ CONFIG_DEFAULT_IOSCHED="cfq"
156# CONFIG_ARCH_IXP4XX is not set 164# CONFIG_ARCH_IXP4XX is not set
157# CONFIG_ARCH_L7200 is not set 165# CONFIG_ARCH_L7200 is not set
158CONFIG_ARCH_KIRKWOOD=y 166CONFIG_ARCH_KIRKWOOD=y
159# CONFIG_ARCH_KS8695 is not set
160# CONFIG_ARCH_NS9XXX is not set
161# CONFIG_ARCH_LOKI is not set 167# CONFIG_ARCH_LOKI is not set
162# CONFIG_ARCH_MV78XX0 is not set 168# CONFIG_ARCH_MV78XX0 is not set
163# CONFIG_ARCH_MXC is not set
164# 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
165# CONFIG_ARCH_PNX4008 is not set 174# CONFIG_ARCH_PNX4008 is not set
166# CONFIG_ARCH_PXA is not set 175# CONFIG_ARCH_PXA is not set
167# CONFIG_ARCH_MMP is not set 176# CONFIG_ARCH_MSM is not set
168# CONFIG_ARCH_RPC is not set 177# CONFIG_ARCH_RPC is not set
169# CONFIG_ARCH_SA1100 is not set 178# CONFIG_ARCH_SA1100 is not set
170# CONFIG_ARCH_S3C2410 is not set 179# CONFIG_ARCH_S3C2410 is not set
171# CONFIG_ARCH_S3C64XX is not set 180# CONFIG_ARCH_S3C64XX is not set
181# CONFIG_ARCH_S5PC1XX is not set
172# CONFIG_ARCH_SHARK is not set 182# CONFIG_ARCH_SHARK is not set
173# CONFIG_ARCH_LH7A40X is not set 183# CONFIG_ARCH_LH7A40X is not set
184# CONFIG_ARCH_U300 is not set
174# CONFIG_ARCH_DAVINCI is not set 185# CONFIG_ARCH_DAVINCI is not set
175# CONFIG_ARCH_OMAP is not set 186# CONFIG_ARCH_OMAP is not set
176# CONFIG_ARCH_MSM is not set 187# CONFIG_ARCH_BCMRING is not set
177# CONFIG_ARCH_W90X900 is not set
178 188
179# 189#
180# Marvell Kirkwood Implementations 190# Marvell Kirkwood Implementations
@@ -185,6 +195,7 @@ CONFIG_MACH_RD88F6281=y
185CONFIG_MACH_MV88F6281GTW_GE=y 195CONFIG_MACH_MV88F6281GTW_GE=y
186CONFIG_MACH_SHEEVAPLUG=y 196CONFIG_MACH_SHEEVAPLUG=y
187CONFIG_MACH_TS219=y 197CONFIG_MACH_TS219=y
198CONFIG_MACH_OPENRD_BASE=y
188CONFIG_PLAT_ORION=y 199CONFIG_PLAT_ORION=y
189 200
190# 201#
@@ -195,7 +206,7 @@ CONFIG_CPU_FEROCEON=y
195# CONFIG_CPU_FEROCEON_OLD_ID is not set 206# CONFIG_CPU_FEROCEON_OLD_ID is not set
196CONFIG_CPU_32v5=y 207CONFIG_CPU_32v5=y
197CONFIG_CPU_ABRT_EV5T=y 208CONFIG_CPU_ABRT_EV5T=y
198CONFIG_CPU_PABRT_NOIFAR=y 209CONFIG_CPU_PABRT_LEGACY=y
199CONFIG_CPU_CACHE_VIVT=y 210CONFIG_CPU_CACHE_VIVT=y
200CONFIG_CPU_COPY_FEROCEON=y 211CONFIG_CPU_COPY_FEROCEON=y
201CONFIG_CPU_TLB_FEROCEON=y 212CONFIG_CPU_TLB_FEROCEON=y
@@ -211,6 +222,7 @@ CONFIG_ARM_THUMB=y
211CONFIG_OUTER_CACHE=y 222CONFIG_OUTER_CACHE=y
212CONFIG_CACHE_FEROCEON_L2=y 223CONFIG_CACHE_FEROCEON_L2=y
213# CONFIG_CACHE_FEROCEON_L2_WRITETHROUGH is not set 224# CONFIG_CACHE_FEROCEON_L2_WRITETHROUGH is not set
225CONFIG_ARM_L1_CACHE_SHIFT=5
214 226
215# 227#
216# Bus support 228# Bus support
@@ -235,11 +247,12 @@ CONFIG_VMSPLIT_3G=y
235# CONFIG_VMSPLIT_2G is not set 247# CONFIG_VMSPLIT_2G is not set
236# CONFIG_VMSPLIT_1G is not set 248# CONFIG_VMSPLIT_1G is not set
237CONFIG_PAGE_OFFSET=0xC0000000 249CONFIG_PAGE_OFFSET=0xC0000000
250# CONFIG_PREEMPT_NONE is not set
251# CONFIG_PREEMPT_VOLUNTARY is not set
238CONFIG_PREEMPT=y 252CONFIG_PREEMPT=y
239CONFIG_HZ=100 253CONFIG_HZ=100
240CONFIG_AEABI=y 254CONFIG_AEABI=y
241# CONFIG_OABI_COMPAT is not set 255# CONFIG_OABI_COMPAT is not set
242CONFIG_ARCH_FLATMEM_HAS_HOLES=y
243# CONFIG_ARCH_SPARSEMEM_DEFAULT is not set 256# CONFIG_ARCH_SPARSEMEM_DEFAULT is not set
244# CONFIG_ARCH_SELECT_MEMORY_MODEL is not set 257# CONFIG_ARCH_SELECT_MEMORY_MODEL is not set
245# CONFIG_HIGHMEM is not set 258# CONFIG_HIGHMEM is not set
@@ -254,10 +267,12 @@ CONFIG_SPLIT_PTLOCK_CPUS=4096
254# CONFIG_PHYS_ADDR_T_64BIT is not set 267# CONFIG_PHYS_ADDR_T_64BIT is not set
255CONFIG_ZONE_DMA_FLAG=0 268CONFIG_ZONE_DMA_FLAG=0
256CONFIG_VIRT_TO_BUS=y 269CONFIG_VIRT_TO_BUS=y
257CONFIG_UNEVICTABLE_LRU=y
258CONFIG_HAVE_MLOCK=y 270CONFIG_HAVE_MLOCK=y
259CONFIG_HAVE_MLOCKED_PAGE_BIT=y 271CONFIG_HAVE_MLOCKED_PAGE_BIT=y
272# CONFIG_KSM is not set
273CONFIG_DEFAULT_MMAP_MIN_ADDR=4096
260CONFIG_ALIGNMENT_TRAP=y 274CONFIG_ALIGNMENT_TRAP=y
275CONFIG_UACCESS_WITH_MEMCPY=y
261 276
262# 277#
263# Boot options 278# Boot options
@@ -345,6 +360,7 @@ CONFIG_DEFAULT_TCP_CONG="cubic"
345# CONFIG_NETFILTER is not set 360# CONFIG_NETFILTER is not set
346# CONFIG_IP_DCCP is not set 361# CONFIG_IP_DCCP is not set
347# CONFIG_IP_SCTP is not set 362# CONFIG_IP_SCTP is not set
363# CONFIG_RDS is not set
348# CONFIG_TIPC is not set 364# CONFIG_TIPC is not set
349# CONFIG_ATM is not set 365# CONFIG_ATM is not set
350# CONFIG_BRIDGE is not set 366# CONFIG_BRIDGE is not set
@@ -367,6 +383,7 @@ CONFIG_NET_DSA_MV88E6123_61_65=y
367# CONFIG_ECONET is not set 383# CONFIG_ECONET is not set
368# CONFIG_WAN_ROUTER is not set 384# CONFIG_WAN_ROUTER is not set
369# CONFIG_PHONET is not set 385# CONFIG_PHONET is not set
386# CONFIG_IEEE802154 is not set
370# CONFIG_NET_SCHED is not set 387# CONFIG_NET_SCHED is not set
371# CONFIG_DCB is not set 388# CONFIG_DCB is not set
372 389
@@ -383,17 +400,18 @@ CONFIG_NET_PKTGEN=m
383# CONFIG_AF_RXRPC is not set 400# CONFIG_AF_RXRPC is not set
384CONFIG_WIRELESS=y 401CONFIG_WIRELESS=y
385CONFIG_CFG80211=y 402CONFIG_CFG80211=y
403# CONFIG_NL80211_TESTMODE is not set
404# CONFIG_CFG80211_DEVELOPER_WARNINGS is not set
386# CONFIG_CFG80211_REG_DEBUG is not set 405# CONFIG_CFG80211_REG_DEBUG is not set
406CONFIG_CFG80211_DEFAULT_PS=y
407CONFIG_CFG80211_DEFAULT_PS_VALUE=1
408# CONFIG_CFG80211_DEBUGFS is not set
387CONFIG_WIRELESS_OLD_REGULATORY=y 409CONFIG_WIRELESS_OLD_REGULATORY=y
388CONFIG_WIRELESS_EXT=y 410CONFIG_WIRELESS_EXT=y
389CONFIG_WIRELESS_EXT_SYSFS=y 411CONFIG_WIRELESS_EXT_SYSFS=y
390CONFIG_LIB80211=y 412CONFIG_LIB80211=y
391# CONFIG_LIB80211_DEBUG is not set 413# CONFIG_LIB80211_DEBUG is not set
392CONFIG_MAC80211=y 414CONFIG_MAC80211=y
393
394#
395# Rate control algorithm selection
396#
397CONFIG_MAC80211_RC_MINSTREL=y 415CONFIG_MAC80211_RC_MINSTREL=y
398# CONFIG_MAC80211_RC_DEFAULT_PID is not set 416# CONFIG_MAC80211_RC_DEFAULT_PID is not set
399CONFIG_MAC80211_RC_DEFAULT_MINSTREL=y 417CONFIG_MAC80211_RC_DEFAULT_MINSTREL=y
@@ -414,6 +432,7 @@ CONFIG_MAC80211_RC_DEFAULT="minstrel"
414# Generic Driver Options 432# Generic Driver Options
415# 433#
416CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug" 434CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
435# CONFIG_DEVTMPFS is not set
417CONFIG_STANDALONE=y 436CONFIG_STANDALONE=y
418CONFIG_PREVENT_FIRMWARE_BUILD=y 437CONFIG_PREVENT_FIRMWARE_BUILD=y
419CONFIG_FW_LOADER=y 438CONFIG_FW_LOADER=y
@@ -425,9 +444,9 @@ CONFIG_EXTRA_FIRMWARE=""
425# CONFIG_CONNECTOR is not set 444# CONFIG_CONNECTOR is not set
426CONFIG_MTD=y 445CONFIG_MTD=y
427# CONFIG_MTD_DEBUG is not set 446# CONFIG_MTD_DEBUG is not set
447# CONFIG_MTD_TESTS is not set
428# CONFIG_MTD_CONCAT is not set 448# CONFIG_MTD_CONCAT is not set
429CONFIG_MTD_PARTITIONS=y 449CONFIG_MTD_PARTITIONS=y
430# CONFIG_MTD_TESTS is not set
431# CONFIG_MTD_REDBOOT_PARTS is not set 450# CONFIG_MTD_REDBOOT_PARTS is not set
432CONFIG_MTD_CMDLINE_PARTS=y 451CONFIG_MTD_CMDLINE_PARTS=y
433# CONFIG_MTD_AFS_PARTS is not set 452# CONFIG_MTD_AFS_PARTS is not set
@@ -494,6 +513,7 @@ CONFIG_MTD_PHYSMAP=y
494# CONFIG_MTD_DATAFLASH is not set 513# CONFIG_MTD_DATAFLASH is not set
495CONFIG_MTD_M25P80=y 514CONFIG_MTD_M25P80=y
496CONFIG_M25PXX_USE_FAST_READ=y 515CONFIG_M25PXX_USE_FAST_READ=y
516# CONFIG_MTD_SST25L is not set
497# CONFIG_MTD_SLRAM is not set 517# CONFIG_MTD_SLRAM is not set
498# CONFIG_MTD_PHRAM is not set 518# CONFIG_MTD_PHRAM is not set
499# CONFIG_MTD_MTDRAM is not set 519# CONFIG_MTD_MTDRAM is not set
@@ -543,6 +563,7 @@ CONFIG_BLK_DEV_LOOP=y
543# CONFIG_BLK_DEV_RAM is not set 563# CONFIG_BLK_DEV_RAM is not set
544# CONFIG_CDROM_PKTCDVD is not set 564# CONFIG_CDROM_PKTCDVD is not set
545# CONFIG_ATA_OVER_ETH is not set 565# CONFIG_ATA_OVER_ETH is not set
566# CONFIG_MG_DISK is not set
546# CONFIG_MISC_DEVICES is not set 567# CONFIG_MISC_DEVICES is not set
547CONFIG_HAVE_IDE=y 568CONFIG_HAVE_IDE=y
548# CONFIG_IDE is not set 569# CONFIG_IDE is not set
@@ -567,10 +588,6 @@ CONFIG_BLK_DEV_SR=m
567# CONFIG_BLK_DEV_SR_VENDOR is not set 588# CONFIG_BLK_DEV_SR_VENDOR is not set
568CONFIG_CHR_DEV_SG=m 589CONFIG_CHR_DEV_SG=m
569# CONFIG_CHR_DEV_SCH is not set 590# CONFIG_CHR_DEV_SCH is not set
570
571#
572# Some SCSI devices (e.g. CD jukebox) support multiple LUNs
573#
574# CONFIG_SCSI_MULTI_LUN is not set 591# CONFIG_SCSI_MULTI_LUN is not set
575# CONFIG_SCSI_CONSTANTS is not set 592# CONFIG_SCSI_CONSTANTS is not set
576# CONFIG_SCSI_LOGGING is not set 593# CONFIG_SCSI_LOGGING is not set
@@ -587,6 +604,8 @@ CONFIG_SCSI_WAIT_SCAN=m
587# CONFIG_SCSI_SRP_ATTRS is not set 604# CONFIG_SCSI_SRP_ATTRS is not set
588CONFIG_SCSI_LOWLEVEL=y 605CONFIG_SCSI_LOWLEVEL=y
589# CONFIG_ISCSI_TCP is not set 606# CONFIG_ISCSI_TCP is not set
607# CONFIG_SCSI_BNX2_ISCSI is not set
608# CONFIG_BE2ISCSI is not set
590# CONFIG_BLK_DEV_3W_XXXX_RAID is not set 609# CONFIG_BLK_DEV_3W_XXXX_RAID is not set
591# CONFIG_SCSI_3W_9XXX is not set 610# CONFIG_SCSI_3W_9XXX is not set
592# CONFIG_SCSI_ACARD is not set 611# CONFIG_SCSI_ACARD is not set
@@ -595,6 +614,7 @@ CONFIG_SCSI_LOWLEVEL=y
595# CONFIG_SCSI_AIC7XXX_OLD is not set 614# CONFIG_SCSI_AIC7XXX_OLD is not set
596# CONFIG_SCSI_AIC79XX is not set 615# CONFIG_SCSI_AIC79XX is not set
597# CONFIG_SCSI_AIC94XX is not set 616# CONFIG_SCSI_AIC94XX is not set
617# CONFIG_SCSI_MVSAS is not set
598# CONFIG_SCSI_DPT_I2O is not set 618# CONFIG_SCSI_DPT_I2O is not set
599# CONFIG_SCSI_ADVANSYS is not set 619# CONFIG_SCSI_ADVANSYS is not set
600# CONFIG_SCSI_ARCMSR is not set 620# CONFIG_SCSI_ARCMSR is not set
@@ -611,7 +631,6 @@ CONFIG_SCSI_LOWLEVEL=y
611# CONFIG_SCSI_IPS is not set 631# CONFIG_SCSI_IPS is not set
612# CONFIG_SCSI_INITIO is not set 632# CONFIG_SCSI_INITIO is not set
613# CONFIG_SCSI_INIA100 is not set 633# CONFIG_SCSI_INIA100 is not set
614# CONFIG_SCSI_MVSAS is not set
615# CONFIG_SCSI_STEX is not set 634# CONFIG_SCSI_STEX is not set
616# CONFIG_SCSI_SYM53C8XX_2 is not set 635# CONFIG_SCSI_SYM53C8XX_2 is not set
617# CONFIG_SCSI_IPR is not set 636# CONFIG_SCSI_IPR is not set
@@ -623,11 +642,14 @@ CONFIG_SCSI_LOWLEVEL=y
623# CONFIG_SCSI_DC390T is not set 642# CONFIG_SCSI_DC390T is not set
624# CONFIG_SCSI_NSP32 is not set 643# CONFIG_SCSI_NSP32 is not set
625# CONFIG_SCSI_DEBUG is not set 644# CONFIG_SCSI_DEBUG is not set
645# CONFIG_SCSI_PMCRAID is not set
626# CONFIG_SCSI_SRP is not set 646# CONFIG_SCSI_SRP is not set
647# CONFIG_SCSI_BFA_FC is not set
627# CONFIG_SCSI_DH is not set 648# CONFIG_SCSI_DH is not set
628# CONFIG_SCSI_OSD_INITIATOR is not set 649# CONFIG_SCSI_OSD_INITIATOR is not set
629CONFIG_ATA=y 650CONFIG_ATA=y
630# CONFIG_ATA_NONSTANDARD is not set 651# CONFIG_ATA_NONSTANDARD is not set
652CONFIG_ATA_VERBOSE_ERROR=y
631CONFIG_SATA_PMP=y 653CONFIG_SATA_PMP=y
632CONFIG_SATA_AHCI=y 654CONFIG_SATA_AHCI=y
633# CONFIG_SATA_SIL24 is not set 655# CONFIG_SATA_SIL24 is not set
@@ -649,6 +671,7 @@ CONFIG_SATA_MV=y
649# CONFIG_PATA_ALI is not set 671# CONFIG_PATA_ALI is not set
650# CONFIG_PATA_AMD is not set 672# CONFIG_PATA_AMD is not set
651# CONFIG_PATA_ARTOP is not set 673# CONFIG_PATA_ARTOP is not set
674# CONFIG_PATA_ATP867X is not set
652# CONFIG_PATA_ATIIXP is not set 675# CONFIG_PATA_ATIIXP is not set
653# CONFIG_PATA_CMD640_PCI is not set 676# CONFIG_PATA_CMD640_PCI is not set
654# CONFIG_PATA_CMD64X is not set 677# CONFIG_PATA_CMD64X is not set
@@ -676,6 +699,7 @@ CONFIG_SATA_MV=y
676# CONFIG_PATA_OPTIDMA is not set 699# CONFIG_PATA_OPTIDMA is not set
677# CONFIG_PATA_PDC_OLD is not set 700# CONFIG_PATA_PDC_OLD is not set
678# CONFIG_PATA_RADISYS is not set 701# CONFIG_PATA_RADISYS is not set
702# CONFIG_PATA_RDC is not set
679# CONFIG_PATA_RZ1000 is not set 703# CONFIG_PATA_RZ1000 is not set
680# CONFIG_PATA_SC1200 is not set 704# CONFIG_PATA_SC1200 is not set
681# CONFIG_PATA_SERVERWORKS is not set 705# CONFIG_PATA_SERVERWORKS is not set
@@ -693,13 +717,16 @@ CONFIG_SATA_MV=y
693# 717#
694 718
695# 719#
696# Enable only one of the two stacks, unless you know what you are doing 720# You can enable one or both FireWire driver stacks.
721#
722
723#
724# See the help texts for more information.
697# 725#
698# CONFIG_FIREWIRE is not set 726# CONFIG_FIREWIRE is not set
699# CONFIG_IEEE1394 is not set 727# CONFIG_IEEE1394 is not set
700# CONFIG_I2O is not set 728# CONFIG_I2O is not set
701CONFIG_NETDEVICES=y 729CONFIG_NETDEVICES=y
702CONFIG_COMPAT_NET_DEV_OPS=y
703# CONFIG_DUMMY is not set 730# CONFIG_DUMMY is not set
704# CONFIG_BONDING is not set 731# CONFIG_BONDING is not set
705# CONFIG_MACVLAN is not set 732# CONFIG_MACVLAN is not set
@@ -768,6 +795,9 @@ CONFIG_NET_PCI=y
768# CONFIG_SMSC9420 is not set 795# CONFIG_SMSC9420 is not set
769# CONFIG_SUNDANCE is not set 796# CONFIG_SUNDANCE is not set
770# CONFIG_TLAN is not set 797# CONFIG_TLAN is not set
798# CONFIG_KS8842 is not set
799# CONFIG_KS8851 is not set
800# CONFIG_KS8851_MLL is not set
771# CONFIG_VIA_RHINE is not set 801# CONFIG_VIA_RHINE is not set
772# CONFIG_SC92031 is not set 802# CONFIG_SC92031 is not set
773# CONFIG_ATL2 is not set 803# CONFIG_ATL2 is not set
@@ -789,6 +819,7 @@ CONFIG_NETDEV_1000=y
789# CONFIG_VIA_VELOCITY is not set 819# CONFIG_VIA_VELOCITY is not set
790# CONFIG_TIGON3 is not set 820# CONFIG_TIGON3 is not set
791# CONFIG_BNX2 is not set 821# CONFIG_BNX2 is not set
822# CONFIG_CNIC is not set
792CONFIG_MV643XX_ETH=y 823CONFIG_MV643XX_ETH=y
793# CONFIG_QLA3XXX is not set 824# CONFIG_QLA3XXX is not set
794# CONFIG_ATL1 is not set 825# CONFIG_ATL1 is not set
@@ -797,10 +828,7 @@ CONFIG_MV643XX_ETH=y
797# CONFIG_JME is not set 828# CONFIG_JME is not set
798# CONFIG_NETDEV_10000 is not set 829# CONFIG_NETDEV_10000 is not set
799# CONFIG_TR is not set 830# CONFIG_TR is not set
800 831CONFIG_WLAN=y
801#
802# Wireless LAN
803#
804# CONFIG_WLAN_PRE80211 is not set 832# CONFIG_WLAN_PRE80211 is not set
805CONFIG_WLAN_80211=y 833CONFIG_WLAN_80211=y
806CONFIG_LIBERTAS=y 834CONFIG_LIBERTAS=y
@@ -820,9 +848,7 @@ CONFIG_LIBERTAS_SDIO=y
820# CONFIG_MAC80211_HWSIM is not set 848# CONFIG_MAC80211_HWSIM is not set
821# CONFIG_MWL8K is not set 849# CONFIG_MWL8K is not set
822# CONFIG_P54_COMMON is not set 850# CONFIG_P54_COMMON is not set
823# CONFIG_ATH5K is not set 851# CONFIG_ATH_COMMON is not set
824# CONFIG_ATH9K is not set
825# CONFIG_AR9170_USB is not set
826# CONFIG_IPW2100 is not set 852# CONFIG_IPW2100 is not set
827# CONFIG_IPW2200 is not set 853# CONFIG_IPW2200 is not set
828# CONFIG_IWLWIFI is not set 854# CONFIG_IWLWIFI is not set
@@ -832,6 +858,8 @@ CONFIG_LIBERTAS_SDIO=y
832# CONFIG_ZD1211RW is not set 858# CONFIG_ZD1211RW is not set
833# CONFIG_RT2X00 is not set 859# CONFIG_RT2X00 is not set
834# CONFIG_HERMES is not set 860# CONFIG_HERMES is not set
861# CONFIG_WL12XX is not set
862# CONFIG_IWM is not set
835 863
836# 864#
837# Enable WiMAX (Networking options) to see the WiMAX drivers 865# Enable WiMAX (Networking options) to see the WiMAX drivers
@@ -855,6 +883,7 @@ CONFIG_LIBERTAS_SDIO=y
855# CONFIG_NETPOLL is not set 883# CONFIG_NETPOLL is not set
856# CONFIG_NET_POLL_CONTROLLER is not set 884# CONFIG_NET_POLL_CONTROLLER is not set
857# CONFIG_ISDN is not set 885# CONFIG_ISDN is not set
886# CONFIG_PHONE is not set
858 887
859# 888#
860# Input device support 889# Input device support
@@ -878,13 +907,19 @@ CONFIG_INPUT_EVDEV=y
878# Input Device Drivers 907# Input Device Drivers
879# 908#
880CONFIG_INPUT_KEYBOARD=y 909CONFIG_INPUT_KEYBOARD=y
910# CONFIG_KEYBOARD_ADP5588 is not set
881CONFIG_KEYBOARD_ATKBD=y 911CONFIG_KEYBOARD_ATKBD=y
882# CONFIG_KEYBOARD_SUNKBD is not set 912# CONFIG_QT2160 is not set
883# CONFIG_KEYBOARD_LKKBD is not set 913# CONFIG_KEYBOARD_LKKBD is not set
884# CONFIG_KEYBOARD_XTKBD is not set 914CONFIG_KEYBOARD_GPIO=y
915# CONFIG_KEYBOARD_MATRIX is not set
916# CONFIG_KEYBOARD_LM8323 is not set
917# CONFIG_KEYBOARD_MAX7359 is not set
885# CONFIG_KEYBOARD_NEWTON is not set 918# CONFIG_KEYBOARD_NEWTON is not set
919# CONFIG_KEYBOARD_OPENCORES is not set
886# CONFIG_KEYBOARD_STOWAWAY is not set 920# CONFIG_KEYBOARD_STOWAWAY is not set
887CONFIG_KEYBOARD_GPIO=y 921# CONFIG_KEYBOARD_SUNKBD is not set
922# CONFIG_KEYBOARD_XTKBD is not set
888# CONFIG_INPUT_MOUSE is not set 923# CONFIG_INPUT_MOUSE is not set
889# CONFIG_INPUT_JOYSTICK is not set 924# CONFIG_INPUT_JOYSTICK is not set
890# CONFIG_INPUT_TABLET is not set 925# CONFIG_INPUT_TABLET is not set
@@ -943,6 +978,7 @@ CONFIG_LEGACY_PTY_COUNT=16
943CONFIG_DEVPORT=y 978CONFIG_DEVPORT=y
944CONFIG_I2C=y 979CONFIG_I2C=y
945CONFIG_I2C_BOARDINFO=y 980CONFIG_I2C_BOARDINFO=y
981# CONFIG_I2C_COMPAT is not set
946CONFIG_I2C_CHARDEV=y 982CONFIG_I2C_CHARDEV=y
947CONFIG_I2C_HELPER_AUTO=y 983CONFIG_I2C_HELPER_AUTO=y
948 984
@@ -998,10 +1034,6 @@ CONFIG_I2C_MV64XXX=y
998# Miscellaneous I2C Chip support 1034# Miscellaneous I2C Chip support
999# 1035#
1000# CONFIG_DS1682 is not set 1036# CONFIG_DS1682 is not set
1001# CONFIG_SENSORS_PCF8574 is not set
1002# CONFIG_PCF8575 is not set
1003# CONFIG_SENSORS_PCA9539 is not set
1004# CONFIG_SENSORS_MAX6875 is not set
1005# CONFIG_SENSORS_TSL2550 is not set 1037# CONFIG_SENSORS_TSL2550 is not set
1006# CONFIG_I2C_DEBUG_CORE is not set 1038# CONFIG_I2C_DEBUG_CORE is not set
1007# CONFIG_I2C_DEBUG_ALGO is not set 1039# CONFIG_I2C_DEBUG_ALGO is not set
@@ -1023,11 +1055,47 @@ CONFIG_SPI_ORION=y
1023# 1055#
1024# CONFIG_SPI_SPIDEV is not set 1056# CONFIG_SPI_SPIDEV is not set
1025# CONFIG_SPI_TLE62X0 is not set 1057# CONFIG_SPI_TLE62X0 is not set
1058
1059#
1060# PPS support
1061#
1062# CONFIG_PPS is not set
1063CONFIG_ARCH_REQUIRE_GPIOLIB=y
1064CONFIG_GPIOLIB=y
1065# CONFIG_DEBUG_GPIO is not set
1066CONFIG_GPIO_SYSFS=y
1067
1068#
1069# Memory mapped GPIO expanders:
1070#
1071
1072#
1073# I2C GPIO expanders:
1074#
1075# CONFIG_GPIO_MAX732X is not set
1076# CONFIG_GPIO_PCA953X is not set
1077# CONFIG_GPIO_PCF857X is not set
1078
1079#
1080# PCI GPIO expanders:
1081#
1082# CONFIG_GPIO_BT8XX is not set
1083# CONFIG_GPIO_LANGWELL is not set
1084
1085#
1086# SPI GPIO expanders:
1087#
1088# CONFIG_GPIO_MAX7301 is not set
1089# CONFIG_GPIO_MCP23S08 is not set
1090# CONFIG_GPIO_MC33880 is not set
1091
1092#
1093# AC97 GPIO expanders:
1094#
1026# CONFIG_W1 is not set 1095# CONFIG_W1 is not set
1027# CONFIG_POWER_SUPPLY is not set 1096# CONFIG_POWER_SUPPLY is not set
1028# CONFIG_HWMON is not set 1097# CONFIG_HWMON is not set
1029# CONFIG_THERMAL is not set 1098# CONFIG_THERMAL is not set
1030# CONFIG_THERMAL_HWMON is not set
1031# CONFIG_WATCHDOG is not set 1099# CONFIG_WATCHDOG is not set
1032CONFIG_SSB_POSSIBLE=y 1100CONFIG_SSB_POSSIBLE=y
1033 1101
@@ -1041,33 +1109,28 @@ CONFIG_SSB_POSSIBLE=y
1041# 1109#
1042# CONFIG_MFD_CORE is not set 1110# CONFIG_MFD_CORE is not set
1043# CONFIG_MFD_SM501 is not set 1111# CONFIG_MFD_SM501 is not set
1112# CONFIG_MFD_ASIC3 is not set
1113# CONFIG_HTC_EGPIO is not set
1044# CONFIG_HTC_PASIC3 is not set 1114# CONFIG_HTC_PASIC3 is not set
1115# CONFIG_TPS65010 is not set
1045# CONFIG_TWL4030_CORE is not set 1116# CONFIG_TWL4030_CORE is not set
1046# CONFIG_MFD_TMIO is not set 1117# CONFIG_MFD_TMIO is not set
1118# CONFIG_MFD_TC6393XB is not set
1047# CONFIG_PMIC_DA903X is not set 1119# CONFIG_PMIC_DA903X is not set
1048# CONFIG_MFD_WM8400 is not set 1120# CONFIG_MFD_WM8400 is not set
1121# CONFIG_MFD_WM831X is not set
1049# CONFIG_MFD_WM8350_I2C is not set 1122# CONFIG_MFD_WM8350_I2C is not set
1050# CONFIG_MFD_PCF50633 is not set 1123# CONFIG_MFD_PCF50633 is not set
1051 1124# CONFIG_MFD_MC13783 is not set
1052# 1125# CONFIG_AB3100_CORE is not set
1053# Multimedia devices 1126# CONFIG_EZX_PCAP is not set
1054# 1127# CONFIG_REGULATOR is not set
1055 1128# CONFIG_MEDIA_SUPPORT is not set
1056#
1057# Multimedia core support
1058#
1059# CONFIG_VIDEO_DEV is not set
1060# CONFIG_DVB_CORE is not set
1061# CONFIG_VIDEO_MEDIA is not set
1062
1063#
1064# Multimedia drivers
1065#
1066# CONFIG_DAB is not set
1067 1129
1068# 1130#
1069# Graphics support 1131# Graphics support
1070# 1132#
1133CONFIG_VGA_ARB=y
1071# CONFIG_DRM is not set 1134# CONFIG_DRM is not set
1072# CONFIG_VGASTATE is not set 1135# CONFIG_VGASTATE is not set
1073# CONFIG_VIDEO_OUTPUT_CONTROL is not set 1136# CONFIG_VIDEO_OUTPUT_CONTROL is not set
@@ -1087,7 +1150,6 @@ CONFIG_DUMMY_CONSOLE=y
1087# CONFIG_SOUND is not set 1150# CONFIG_SOUND is not set
1088CONFIG_HID_SUPPORT=y 1151CONFIG_HID_SUPPORT=y
1089CONFIG_HID=y 1152CONFIG_HID=y
1090# CONFIG_HID_DEBUG is not set
1091# CONFIG_HIDRAW is not set 1153# CONFIG_HIDRAW is not set
1092 1154
1093# 1155#
@@ -1106,10 +1168,12 @@ CONFIG_HID_BELKIN=y
1106CONFIG_HID_CHERRY=y 1168CONFIG_HID_CHERRY=y
1107CONFIG_HID_CHICONY=y 1169CONFIG_HID_CHICONY=y
1108CONFIG_HID_CYPRESS=y 1170CONFIG_HID_CYPRESS=y
1171CONFIG_HID_DRAGONRISE=y
1109# CONFIG_DRAGONRISE_FF is not set 1172# CONFIG_DRAGONRISE_FF is not set
1110CONFIG_HID_EZKEY=y 1173CONFIG_HID_EZKEY=y
1111CONFIG_HID_KYE=y 1174CONFIG_HID_KYE=y
1112CONFIG_HID_GYRATION=y 1175CONFIG_HID_GYRATION=y
1176CONFIG_HID_TWINHAN=y
1113CONFIG_HID_KENSINGTON=y 1177CONFIG_HID_KENSINGTON=y
1114CONFIG_HID_LOGITECH=y 1178CONFIG_HID_LOGITECH=y
1115# CONFIG_LOGITECH_FF is not set 1179# CONFIG_LOGITECH_FF is not set
@@ -1123,9 +1187,14 @@ CONFIG_HID_PETALYNX=y
1123CONFIG_HID_SAMSUNG=y 1187CONFIG_HID_SAMSUNG=y
1124CONFIG_HID_SONY=y 1188CONFIG_HID_SONY=y
1125CONFIG_HID_SUNPLUS=y 1189CONFIG_HID_SUNPLUS=y
1190CONFIG_HID_GREENASIA=y
1126# CONFIG_GREENASIA_FF is not set 1191# CONFIG_GREENASIA_FF is not set
1192CONFIG_HID_SMARTJOYPLUS=y
1193# CONFIG_SMARTJOYPLUS_FF is not set
1127CONFIG_HID_TOPSEED=y 1194CONFIG_HID_TOPSEED=y
1195CONFIG_HID_THRUSTMASTER=y
1128# CONFIG_THRUSTMASTER_FF is not set 1196# CONFIG_THRUSTMASTER_FF is not set
1197CONFIG_HID_ZEROPLUS=y
1129# CONFIG_ZEROPLUS_FF is not set 1198# CONFIG_ZEROPLUS_FF is not set
1130CONFIG_USB_SUPPORT=y 1199CONFIG_USB_SUPPORT=y
1131CONFIG_USB_ARCH_HAS_HCD=y 1200CONFIG_USB_ARCH_HAS_HCD=y
@@ -1150,18 +1219,21 @@ CONFIG_USB_DEVICE_CLASS=y
1150# USB Host Controller Drivers 1219# USB Host Controller Drivers
1151# 1220#
1152# CONFIG_USB_C67X00_HCD is not set 1221# CONFIG_USB_C67X00_HCD is not set
1222# CONFIG_USB_XHCI_HCD is not set
1153CONFIG_USB_EHCI_HCD=y 1223CONFIG_USB_EHCI_HCD=y
1154CONFIG_USB_EHCI_ROOT_HUB_TT=y 1224CONFIG_USB_EHCI_ROOT_HUB_TT=y
1155CONFIG_USB_EHCI_TT_NEWSCHED=y 1225CONFIG_USB_EHCI_TT_NEWSCHED=y
1156# CONFIG_USB_OXU210HP_HCD is not set 1226# CONFIG_USB_OXU210HP_HCD is not set
1157# CONFIG_USB_ISP116X_HCD is not set 1227# CONFIG_USB_ISP116X_HCD is not set
1158# CONFIG_USB_ISP1760_HCD is not set 1228# CONFIG_USB_ISP1760_HCD is not set
1229# CONFIG_USB_ISP1362_HCD is not set
1159# CONFIG_USB_OHCI_HCD is not set 1230# CONFIG_USB_OHCI_HCD is not set
1160# CONFIG_USB_UHCI_HCD is not set 1231# CONFIG_USB_UHCI_HCD is not set
1161# CONFIG_USB_SL811_HCD is not set 1232# CONFIG_USB_SL811_HCD is not set
1162# CONFIG_USB_R8A66597_HCD is not set 1233# CONFIG_USB_R8A66597_HCD is not set
1163# CONFIG_USB_WHCI_HCD is not set 1234# CONFIG_USB_WHCI_HCD is not set
1164# CONFIG_USB_HWA_HCD is not set 1235# CONFIG_USB_HWA_HCD is not set
1236# CONFIG_USB_MUSB_HDRC is not set
1165 1237
1166# 1238#
1167# USB Device Class drivers 1239# USB Device Class drivers
@@ -1252,11 +1324,14 @@ CONFIG_SDIO_UART=y
1252# MMC/SD/SDIO Host Controller Drivers 1324# MMC/SD/SDIO Host Controller Drivers
1253# 1325#
1254# CONFIG_MMC_SDHCI is not set 1326# CONFIG_MMC_SDHCI is not set
1327# CONFIG_MMC_AT91 is not set
1328# CONFIG_MMC_ATMELMCI is not set
1255# CONFIG_MMC_TIFM_SD is not set 1329# CONFIG_MMC_TIFM_SD is not set
1256CONFIG_MMC_MVSDIO=y 1330CONFIG_MMC_MVSDIO=y
1257# CONFIG_MMC_SPI is not set 1331# CONFIG_MMC_SPI is not set
1332# CONFIG_MMC_CB710 is not set
1333# CONFIG_MMC_VIA_SDMMC is not set
1258# CONFIG_MEMSTICK is not set 1334# CONFIG_MEMSTICK is not set
1259# CONFIG_ACCESSIBILITY is not set
1260CONFIG_NEW_LEDS=y 1335CONFIG_NEW_LEDS=y
1261CONFIG_LEDS_CLASS=y 1336CONFIG_LEDS_CLASS=y
1262 1337
@@ -1266,7 +1341,7 @@ CONFIG_LEDS_CLASS=y
1266# CONFIG_LEDS_PCA9532 is not set 1341# CONFIG_LEDS_PCA9532 is not set
1267CONFIG_LEDS_GPIO=y 1342CONFIG_LEDS_GPIO=y
1268CONFIG_LEDS_GPIO_PLATFORM=y 1343CONFIG_LEDS_GPIO_PLATFORM=y
1269# CONFIG_LEDS_LP5521 is not set 1344# CONFIG_LEDS_LP3944 is not set
1270# CONFIG_LEDS_PCA955X is not set 1345# CONFIG_LEDS_PCA955X is not set
1271# CONFIG_LEDS_DAC124S085 is not set 1346# CONFIG_LEDS_DAC124S085 is not set
1272# CONFIG_LEDS_BD2802 is not set 1347# CONFIG_LEDS_BD2802 is not set
@@ -1278,11 +1353,14 @@ CONFIG_LEDS_TRIGGERS=y
1278CONFIG_LEDS_TRIGGER_TIMER=y 1353CONFIG_LEDS_TRIGGER_TIMER=y
1279CONFIG_LEDS_TRIGGER_HEARTBEAT=y 1354CONFIG_LEDS_TRIGGER_HEARTBEAT=y
1280# CONFIG_LEDS_TRIGGER_BACKLIGHT is not set 1355# CONFIG_LEDS_TRIGGER_BACKLIGHT is not set
1356# CONFIG_LEDS_TRIGGER_GPIO is not set
1281CONFIG_LEDS_TRIGGER_DEFAULT_ON=y 1357CONFIG_LEDS_TRIGGER_DEFAULT_ON=y
1282 1358
1283# 1359#
1284# iptables trigger is under Netfilter config (LED target) 1360# iptables trigger is under Netfilter config (LED target)
1285# 1361#
1362# CONFIG_ACCESSIBILITY is not set
1363# CONFIG_INFINIBAND is not set
1286CONFIG_RTC_LIB=y 1364CONFIG_RTC_LIB=y
1287CONFIG_RTC_CLASS=y 1365CONFIG_RTC_CLASS=y
1288CONFIG_RTC_HCTOSYS=y 1366CONFIG_RTC_HCTOSYS=y
@@ -1314,6 +1392,7 @@ CONFIG_RTC_INTF_DEV=y
1314CONFIG_RTC_DRV_S35390A=y 1392CONFIG_RTC_DRV_S35390A=y
1315# CONFIG_RTC_DRV_FM3130 is not set 1393# CONFIG_RTC_DRV_FM3130 is not set
1316# CONFIG_RTC_DRV_RX8581 is not set 1394# CONFIG_RTC_DRV_RX8581 is not set
1395# CONFIG_RTC_DRV_RX8025 is not set
1317 1396
1318# 1397#
1319# SPI RTC drivers 1398# SPI RTC drivers
@@ -1325,6 +1404,7 @@ CONFIG_RTC_DRV_S35390A=y
1325# CONFIG_RTC_DRV_R9701 is not set 1404# CONFIG_RTC_DRV_R9701 is not set
1326# CONFIG_RTC_DRV_RS5C348 is not set 1405# CONFIG_RTC_DRV_RS5C348 is not set
1327# CONFIG_RTC_DRV_DS3234 is not set 1406# CONFIG_RTC_DRV_DS3234 is not set
1407# CONFIG_RTC_DRV_PCF2123 is not set
1328 1408
1329# 1409#
1330# Platform RTC drivers 1410# Platform RTC drivers
@@ -1360,8 +1440,11 @@ CONFIG_DMA_ENGINE=y
1360# CONFIG_ASYNC_TX_DMA is not set 1440# CONFIG_ASYNC_TX_DMA is not set
1361# CONFIG_DMATEST is not set 1441# CONFIG_DMATEST is not set
1362# CONFIG_AUXDISPLAY is not set 1442# CONFIG_AUXDISPLAY is not set
1363# CONFIG_REGULATOR is not set
1364# CONFIG_UIO is not set 1443# CONFIG_UIO is not set
1444
1445#
1446# TI VLYNQ
1447#
1365# CONFIG_STAGING is not set 1448# CONFIG_STAGING is not set
1366 1449
1367# 1450#
@@ -1379,10 +1462,13 @@ CONFIG_JBD=y
1379# CONFIG_REISERFS_FS is not set 1462# CONFIG_REISERFS_FS is not set
1380# CONFIG_JFS_FS is not set 1463# CONFIG_JFS_FS is not set
1381# CONFIG_FS_POSIX_ACL is not set 1464# CONFIG_FS_POSIX_ACL is not set
1382CONFIG_FILE_LOCKING=y
1383# CONFIG_XFS_FS is not set 1465# CONFIG_XFS_FS is not set
1466# CONFIG_GFS2_FS is not set
1384# CONFIG_OCFS2_FS is not set 1467# CONFIG_OCFS2_FS is not set
1385# CONFIG_BTRFS_FS is not set 1468# CONFIG_BTRFS_FS is not set
1469# CONFIG_NILFS2_FS is not set
1470CONFIG_FILE_LOCKING=y
1471CONFIG_FSNOTIFY=y
1386CONFIG_DNOTIFY=y 1472CONFIG_DNOTIFY=y
1387CONFIG_INOTIFY=y 1473CONFIG_INOTIFY=y
1388CONFIG_INOTIFY_USER=y 1474CONFIG_INOTIFY_USER=y
@@ -1455,7 +1541,6 @@ CONFIG_CRAMFS=y
1455# CONFIG_ROMFS_FS is not set 1541# CONFIG_ROMFS_FS is not set
1456# CONFIG_SYSV_FS is not set 1542# CONFIG_SYSV_FS is not set
1457# CONFIG_UFS_FS is not set 1543# CONFIG_UFS_FS is not set
1458# CONFIG_NILFS2_FS is not set
1459CONFIG_NETWORK_FILESYSTEMS=y 1544CONFIG_NETWORK_FILESYSTEMS=y
1460CONFIG_NFS_FS=y 1545CONFIG_NFS_FS=y
1461CONFIG_NFS_V3=y 1546CONFIG_NFS_V3=y
@@ -1530,6 +1615,7 @@ CONFIG_ENABLE_WARN_DEPRECATED=y
1530CONFIG_ENABLE_MUST_CHECK=y 1615CONFIG_ENABLE_MUST_CHECK=y
1531CONFIG_FRAME_WARN=1024 1616CONFIG_FRAME_WARN=1024
1532CONFIG_MAGIC_SYSRQ=y 1617CONFIG_MAGIC_SYSRQ=y
1618# CONFIG_STRIP_ASM_SYMS is not set
1533# CONFIG_UNUSED_SYMBOLS is not set 1619# CONFIG_UNUSED_SYMBOLS is not set
1534CONFIG_DEBUG_FS=y 1620CONFIG_DEBUG_FS=y
1535# CONFIG_HEADERS_CHECK is not set 1621# CONFIG_HEADERS_CHECK is not set
@@ -1547,6 +1633,7 @@ CONFIG_BOOTPARAM_HUNG_TASK_PANIC_VALUE=0
1547# CONFIG_DEBUG_OBJECTS is not set 1633# CONFIG_DEBUG_OBJECTS is not set
1548# CONFIG_SLUB_DEBUG_ON is not set 1634# CONFIG_SLUB_DEBUG_ON is not set
1549# CONFIG_SLUB_STATS is not set 1635# CONFIG_SLUB_STATS is not set
1636# CONFIG_DEBUG_KMEMLEAK is not set
1550# CONFIG_DEBUG_PREEMPT is not set 1637# CONFIG_DEBUG_PREEMPT is not set
1551# CONFIG_DEBUG_RT_MUTEXES is not set 1638# CONFIG_DEBUG_RT_MUTEXES is not set
1552# CONFIG_RT_MUTEX_TESTER is not set 1639# CONFIG_RT_MUTEX_TESTER is not set
@@ -1567,12 +1654,14 @@ CONFIG_DEBUG_MEMORY_INIT=y
1567# CONFIG_DEBUG_LIST is not set 1654# CONFIG_DEBUG_LIST is not set
1568# CONFIG_DEBUG_SG is not set 1655# CONFIG_DEBUG_SG is not set
1569# CONFIG_DEBUG_NOTIFIERS is not set 1656# CONFIG_DEBUG_NOTIFIERS is not set
1657# CONFIG_DEBUG_CREDENTIALS is not set
1570# CONFIG_BOOT_PRINTK_DELAY is not set 1658# CONFIG_BOOT_PRINTK_DELAY is not set
1571# CONFIG_RCU_TORTURE_TEST is not set 1659# CONFIG_RCU_TORTURE_TEST is not set
1572# CONFIG_RCU_CPU_STALL_DETECTOR is not set 1660# CONFIG_RCU_CPU_STALL_DETECTOR is not set
1573# CONFIG_KPROBES_SANITY_TEST is not set 1661# CONFIG_KPROBES_SANITY_TEST is not set
1574# CONFIG_BACKTRACE_SELF_TEST is not set 1662# CONFIG_BACKTRACE_SELF_TEST is not set
1575# CONFIG_DEBUG_BLOCK_EXT_DEVT is not set 1663# CONFIG_DEBUG_BLOCK_EXT_DEVT is not set
1664# CONFIG_DEBUG_FORCE_WEAK_PER_CPU is not set
1576# CONFIG_LKDTM is not set 1665# CONFIG_LKDTM is not set
1577# CONFIG_FAULT_INJECTION is not set 1666# CONFIG_FAULT_INJECTION is not set
1578# CONFIG_LATENCYTOP is not set 1667# CONFIG_LATENCYTOP is not set
@@ -1581,25 +1670,12 @@ CONFIG_SYSCTL_SYSCALL_CHECK=y
1581CONFIG_NOP_TRACER=y 1670CONFIG_NOP_TRACER=y
1582CONFIG_HAVE_FUNCTION_TRACER=y 1671CONFIG_HAVE_FUNCTION_TRACER=y
1583CONFIG_RING_BUFFER=y 1672CONFIG_RING_BUFFER=y
1673CONFIG_EVENT_TRACING=y
1674CONFIG_CONTEXT_SWITCH_TRACER=y
1675CONFIG_RING_BUFFER_ALLOW_SWAP=y
1584CONFIG_TRACING=y 1676CONFIG_TRACING=y
1585CONFIG_TRACING_SUPPORT=y 1677CONFIG_TRACING_SUPPORT=y
1586 1678# CONFIG_FTRACE is not set
1587#
1588# Tracers
1589#
1590# CONFIG_FUNCTION_TRACER is not set
1591# CONFIG_IRQSOFF_TRACER is not set
1592# CONFIG_PREEMPT_TRACER is not set
1593# CONFIG_SCHED_TRACER is not set
1594# CONFIG_CONTEXT_SWITCH_TRACER is not set
1595# CONFIG_EVENT_TRACER is not set
1596# CONFIG_BOOT_TRACER is not set
1597# CONFIG_TRACE_BRANCH_PROFILING is not set
1598# CONFIG_STACK_TRACER is not set
1599# CONFIG_KMEMTRACE is not set
1600# CONFIG_WORKQUEUE_TRACER is not set
1601# CONFIG_BLK_DEV_IO_TRACE is not set
1602# CONFIG_FTRACE_STARTUP_TEST is not set
1603# CONFIG_DYNAMIC_DEBUG is not set 1679# CONFIG_DYNAMIC_DEBUG is not set
1604# CONFIG_SAMPLES is not set 1680# CONFIG_SAMPLES is not set
1605CONFIG_HAVE_ARCH_KGDB=y 1681CONFIG_HAVE_ARCH_KGDB=y
@@ -1623,7 +1699,6 @@ CONFIG_CRYPTO=y
1623# 1699#
1624# Crypto core or helper 1700# Crypto core or helper
1625# 1701#
1626# CONFIG_CRYPTO_FIPS is not set
1627CONFIG_CRYPTO_ALGAPI=y 1702CONFIG_CRYPTO_ALGAPI=y
1628CONFIG_CRYPTO_ALGAPI2=y 1703CONFIG_CRYPTO_ALGAPI2=y
1629CONFIG_CRYPTO_AEAD2=y 1704CONFIG_CRYPTO_AEAD2=y
@@ -1665,11 +1740,13 @@ CONFIG_CRYPTO_PCBC=m
1665# 1740#
1666# CONFIG_CRYPTO_HMAC is not set 1741# CONFIG_CRYPTO_HMAC is not set
1667# CONFIG_CRYPTO_XCBC is not set 1742# CONFIG_CRYPTO_XCBC is not set
1743# CONFIG_CRYPTO_VMAC is not set
1668 1744
1669# 1745#
1670# Digest 1746# Digest
1671# 1747#
1672CONFIG_CRYPTO_CRC32C=y 1748CONFIG_CRYPTO_CRC32C=y
1749# CONFIG_CRYPTO_GHASH is not set
1673# CONFIG_CRYPTO_MD4 is not set 1750# CONFIG_CRYPTO_MD4 is not set
1674# CONFIG_CRYPTO_MD5 is not set 1751# CONFIG_CRYPTO_MD5 is not set
1675# CONFIG_CRYPTO_MICHAEL_MIC is not set 1752# CONFIG_CRYPTO_MICHAEL_MIC is not set
@@ -1714,6 +1791,7 @@ CONFIG_CRYPTO_ARC4=y
1714# 1791#
1715# CONFIG_CRYPTO_ANSI_CPRNG is not set 1792# CONFIG_CRYPTO_ANSI_CPRNG is not set
1716CONFIG_CRYPTO_HW=y 1793CONFIG_CRYPTO_HW=y
1794CONFIG_CRYPTO_DEV_MV_CESA=y
1717# CONFIG_CRYPTO_DEV_HIFN_795X is not set 1795# CONFIG_CRYPTO_DEV_HIFN_795X is not set
1718CONFIG_BINARY_PRINTF=y 1796CONFIG_BINARY_PRINTF=y
1719 1797
diff --git a/arch/arm/configs/omap3_pandora_defconfig b/arch/arm/configs/omap3_pandora_defconfig
index b54ad2e2da36..150deafb0a6a 100644
--- a/arch/arm/configs/omap3_pandora_defconfig
+++ b/arch/arm/configs/omap3_pandora_defconfig
@@ -611,7 +611,7 @@ CONFIG_INPUT_KEYBOARD=y
611# CONFIG_KEYBOARD_XTKBD is not set 611# CONFIG_KEYBOARD_XTKBD is not set
612# CONFIG_KEYBOARD_NEWTON is not set 612# CONFIG_KEYBOARD_NEWTON is not set
613# CONFIG_KEYBOARD_STOWAWAY is not set 613# CONFIG_KEYBOARD_STOWAWAY is not set
614# CONFIG_KEYBOARD_GPIO is not set 614CONFIG_KEYBOARD_GPIO=y
615CONFIG_INPUT_MOUSE=y 615CONFIG_INPUT_MOUSE=y
616# CONFIG_MOUSE_PS2 is not set 616# CONFIG_MOUSE_PS2 is not set
617# CONFIG_MOUSE_SERIAL is not set 617# CONFIG_MOUSE_SERIAL is not set
@@ -634,7 +634,8 @@ CONFIG_TOUCHSCREEN_ADS7846=y
634# CONFIG_TOUCHSCREEN_TOUCHWIN is not set 634# CONFIG_TOUCHSCREEN_TOUCHWIN is not set
635# CONFIG_TOUCHSCREEN_USB_COMPOSITE is not set 635# CONFIG_TOUCHSCREEN_USB_COMPOSITE is not set
636# CONFIG_TOUCHSCREEN_TOUCHIT213 is not set 636# CONFIG_TOUCHSCREEN_TOUCHIT213 is not set
637# CONFIG_INPUT_MISC is not set 637CONFIG_INPUT_MISC=y
638CONFIG_INPUT_TWL4030_PWRBUTTON=y
638 639
639# 640#
640# Hardware I/O ports 641# Hardware I/O ports
@@ -834,7 +835,29 @@ CONFIG_DAB=y
834# 835#
835# CONFIG_VGA_CONSOLE is not set 836# CONFIG_VGA_CONSOLE is not set
836CONFIG_DUMMY_CONSOLE=y 837CONFIG_DUMMY_CONSOLE=y
837# CONFIG_SOUND is not set 838CONFIG_SOUND=y
839CONFIG_SOUND_OSS_CORE=y
840CONFIG_SOUND_OSS_CORE_PRECLAIM=y
841CONFIG_SND=y
842CONFIG_SND_TIMER=y
843CONFIG_SND_PCM=y
844CONFIG_SND_JACK=y
845CONFIG_SND_OSSEMUL=y
846CONFIG_SND_MIXER_OSS=y
847CONFIG_SND_PCM_OSS=y
848CONFIG_SND_PCM_OSS_PLUGINS=y
849CONFIG_SND_SUPPORT_OLD_API=y
850CONFIG_SND_VERBOSE_PROCFS=y
851CONFIG_SND_VERBOSE_PRINTK=y
852CONFIG_SND_DRIVERS=y
853CONFIG_SND_USB=y
854CONFIG_SND_SOC=y
855CONFIG_SND_OMAP_SOC=y
856CONFIG_SND_OMAP_SOC_MCBSP=y
857CONFIG_SND_OMAP_SOC_OMAP3_PANDORA=y
858CONFIG_SND_SOC_I2C_AND_SPI=y
859CONFIG_SND_SOC_TWL4030=y
860
838CONFIG_HID_SUPPORT=y 861CONFIG_HID_SUPPORT=y
839CONFIG_HID=y 862CONFIG_HID=y
840# CONFIG_HID_DEBUG is not set 863# CONFIG_HID_DEBUG is not set
@@ -1020,7 +1043,13 @@ CONFIG_MMC_BLOCK_BOUNCE=y
1020# CONFIG_MMC_SPI is not set 1043# CONFIG_MMC_SPI is not set
1021# CONFIG_MEMSTICK is not set 1044# CONFIG_MEMSTICK is not set
1022# CONFIG_ACCESSIBILITY is not set 1045# CONFIG_ACCESSIBILITY is not set
1023# CONFIG_NEW_LEDS is not set 1046CONFIG_NEW_LEDS=y
1047CONFIG_LEDS_CLASS=y
1048CONFIG_LEDS_GPIO=y
1049CONFIG_LEDS_GPIO_PLATFORM=y
1050CONFIG_LEDS_TRIGGERS=y
1051CONFIG_LEDS_TRIGGER_DEFAULT_ON=y
1052
1024CONFIG_RTC_LIB=y 1053CONFIG_RTC_LIB=y
1025CONFIG_RTC_CLASS=y 1054CONFIG_RTC_CLASS=y
1026CONFIG_RTC_HCTOSYS=y 1055CONFIG_RTC_HCTOSYS=y
@@ -1084,9 +1113,12 @@ CONFIG_RTC_DRV_TWL4030=y
1084# on-CPU RTC drivers 1113# on-CPU RTC drivers
1085# 1114#
1086# CONFIG_DMADEVICES is not set 1115# CONFIG_DMADEVICES is not set
1087# CONFIG_REGULATOR is not set
1088# CONFIG_UIO is not set 1116# CONFIG_UIO is not set
1089 1117
1118CONFIG_REGULATOR=y
1119CONFIG_REGULATOR_FIXED_VOLTAGE=y
1120CONFIG_REGULATOR_TWL4030=y
1121
1090# 1122#
1091# File systems 1123# File systems
1092# 1124#
@@ -1407,3 +1439,10 @@ CONFIG_PLIST=y
1407CONFIG_HAS_IOMEM=y 1439CONFIG_HAS_IOMEM=y
1408CONFIG_HAS_IOPORT=y 1440CONFIG_HAS_IOPORT=y
1409CONFIG_HAS_DMA=y 1441CONFIG_HAS_DMA=y
1442
1443# added by hand for now
1444CONFIG_KEYBOARD_TWL4030=y
1445CONFIG_USB_OTG_UTILS=y
1446CONFIG_TWL4030_USB=y
1447CONFIG_MMC_OMAP_HS=y
1448
diff --git a/arch/arm/configs/omap_3430sdp_defconfig b/arch/arm/configs/omap_3430sdp_defconfig
index 8a4a7e2ba87b..5a305f015307 100644
--- a/arch/arm/configs/omap_3430sdp_defconfig
+++ b/arch/arm/configs/omap_3430sdp_defconfig
@@ -1703,7 +1703,14 @@ CONFIG_RTC_DRV_TWL4030=y
1703# on-CPU RTC drivers 1703# on-CPU RTC drivers
1704# 1704#
1705# CONFIG_DMADEVICES is not set 1705# CONFIG_DMADEVICES is not set
1706# CONFIG_REGULATOR is not set 1706CONFIG_REGULATOR=y
1707# CONFIG_REGULATOR_DEBUG is not set
1708# CONFIG_REGULATOR_FIXED_VOLTAGE is not set
1709# CONFIG_REGULATOR_VIRTUAL_CONSUMER is not set
1710# CONFIG_REGULATOR_USERSPACE_CONSUMER is not set
1711# CONFIG_REGULATOR_BQ24022 is not set
1712# CONFIG_REGULATOR_MAX1586 is not set
1713CONFIG_REGULATOR_TWL4030=y
1707# CONFIG_UIO is not set 1714# CONFIG_UIO is not set
1708# CONFIG_STAGING is not set 1715# CONFIG_STAGING is not set
1709 1716
diff --git a/arch/arm/configs/orion5x_defconfig b/arch/arm/configs/orion5x_defconfig
index 9e2385293ecb..5383cd0dff54 100644
--- a/arch/arm/configs/orion5x_defconfig
+++ b/arch/arm/configs/orion5x_defconfig
@@ -1,15 +1,13 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.30-rc4 3# Linux kernel version: 2.6.32-rc6
4# Mon May 4 14:07:25 2009 4# Sat Nov 7 20:52:21 2009
5# 5#
6CONFIG_ARM=y 6CONFIG_ARM=y
7CONFIG_SYS_SUPPORTS_APM_EMULATION=y 7CONFIG_SYS_SUPPORTS_APM_EMULATION=y
8CONFIG_GENERIC_GPIO=y 8CONFIG_GENERIC_GPIO=y
9CONFIG_GENERIC_TIME=y 9CONFIG_GENERIC_TIME=y
10CONFIG_GENERIC_CLOCKEVENTS=y 10CONFIG_GENERIC_CLOCKEVENTS=y
11CONFIG_MMU=y
12# CONFIG_NO_IOPORT is not set
13CONFIG_GENERIC_HARDIRQS=y 11CONFIG_GENERIC_HARDIRQS=y
14CONFIG_STACKTRACE_SUPPORT=y 12CONFIG_STACKTRACE_SUPPORT=y
15CONFIG_HAVE_LATENCYTOP_SUPPORT=y 13CONFIG_HAVE_LATENCYTOP_SUPPORT=y
@@ -18,13 +16,12 @@ CONFIG_TRACE_IRQFLAGS_SUPPORT=y
18CONFIG_HARDIRQS_SW_RESEND=y 16CONFIG_HARDIRQS_SW_RESEND=y
19CONFIG_GENERIC_IRQ_PROBE=y 17CONFIG_GENERIC_IRQ_PROBE=y
20CONFIG_RWSEM_GENERIC_SPINLOCK=y 18CONFIG_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 19CONFIG_GENERIC_HWEIGHT=y
24CONFIG_GENERIC_CALIBRATE_DELAY=y 20CONFIG_GENERIC_CALIBRATE_DELAY=y
25CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y 21CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y
26CONFIG_VECTORS_BASE=0xffff0000 22CONFIG_VECTORS_BASE=0xffff0000
27CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config" 23CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
24CONFIG_CONSTRUCTORS=y
28 25
29# 26#
30# General setup 27# General setup
@@ -46,11 +43,12 @@ CONFIG_SYSVIPC_SYSCTL=y
46# 43#
47# RCU Subsystem 44# RCU Subsystem
48# 45#
49CONFIG_CLASSIC_RCU=y 46CONFIG_TREE_RCU=y
50# CONFIG_TREE_RCU is not set 47# CONFIG_TREE_PREEMPT_RCU is not set
51# CONFIG_PREEMPT_RCU is not set 48# CONFIG_RCU_TRACE is not set
49CONFIG_RCU_FANOUT=32
50# CONFIG_RCU_FANOUT_EXACT is not set
52# CONFIG_TREE_RCU_TRACE is not set 51# CONFIG_TREE_RCU_TRACE is not set
53# CONFIG_PREEMPT_RCU_TRACE is not set
54# CONFIG_IKCONFIG is not set 52# CONFIG_IKCONFIG is not set
55CONFIG_LOG_BUF_SHIFT=14 53CONFIG_LOG_BUF_SHIFT=14
56# CONFIG_GROUP_SCHED is not set 54# CONFIG_GROUP_SCHED is not set
@@ -69,7 +67,6 @@ CONFIG_SYSCTL_SYSCALL=y
69CONFIG_KALLSYMS=y 67CONFIG_KALLSYMS=y
70CONFIG_KALLSYMS_ALL=y 68CONFIG_KALLSYMS_ALL=y
71# CONFIG_KALLSYMS_EXTRA_PASS is not set 69# CONFIG_KALLSYMS_EXTRA_PASS is not set
72# CONFIG_STRIP_ASM_SYMS is not set
73CONFIG_HOTPLUG=y 70CONFIG_HOTPLUG=y
74CONFIG_PRINTK=y 71CONFIG_PRINTK=y
75CONFIG_BUG=y 72CONFIG_BUG=y
@@ -82,6 +79,10 @@ CONFIG_TIMERFD=y
82CONFIG_EVENTFD=y 79CONFIG_EVENTFD=y
83CONFIG_SHMEM=y 80CONFIG_SHMEM=y
84CONFIG_AIO=y 81CONFIG_AIO=y
82
83#
84# Kernel Performance Events And Counters
85#
85CONFIG_VM_EVENT_COUNTERS=y 86CONFIG_VM_EVENT_COUNTERS=y
86CONFIG_PCI_QUIRKS=y 87CONFIG_PCI_QUIRKS=y
87# CONFIG_SLUB_DEBUG is not set 88# CONFIG_SLUB_DEBUG is not set
@@ -91,13 +92,17 @@ CONFIG_SLUB=y
91# CONFIG_SLOB is not set 92# CONFIG_SLOB is not set
92CONFIG_PROFILING=y 93CONFIG_PROFILING=y
93CONFIG_TRACEPOINTS=y 94CONFIG_TRACEPOINTS=y
94# CONFIG_MARKERS is not set
95CONFIG_OPROFILE=y 95CONFIG_OPROFILE=y
96CONFIG_HAVE_OPROFILE=y 96CONFIG_HAVE_OPROFILE=y
97CONFIG_KPROBES=y 97CONFIG_KPROBES=y
98CONFIG_KRETPROBES=y 98CONFIG_KRETPROBES=y
99CONFIG_HAVE_KPROBES=y 99CONFIG_HAVE_KPROBES=y
100CONFIG_HAVE_KRETPROBES=y 100CONFIG_HAVE_KRETPROBES=y
101
102#
103# GCOV-based kernel profiling
104#
105# CONFIG_GCOV_KERNEL is not set
101# CONFIG_SLOW_WORK is not set 106# CONFIG_SLOW_WORK is not set
102CONFIG_HAVE_GENERIC_DMA_COHERENT=y 107CONFIG_HAVE_GENERIC_DMA_COHERENT=y
103CONFIG_RT_MUTEXES=y 108CONFIG_RT_MUTEXES=y
@@ -109,7 +114,7 @@ CONFIG_MODULE_UNLOAD=y
109# CONFIG_MODVERSIONS is not set 114# CONFIG_MODVERSIONS is not set
110# CONFIG_MODULE_SRCVERSION_ALL is not set 115# CONFIG_MODULE_SRCVERSION_ALL is not set
111CONFIG_BLOCK=y 116CONFIG_BLOCK=y
112# CONFIG_LBD is not set 117CONFIG_LBDAF=y
113# CONFIG_BLK_DEV_BSG is not set 118# CONFIG_BLK_DEV_BSG is not set
114# CONFIG_BLK_DEV_INTEGRITY is not set 119# CONFIG_BLK_DEV_INTEGRITY is not set
115 120
@@ -130,19 +135,22 @@ CONFIG_DEFAULT_IOSCHED="cfq"
130# 135#
131# System Type 136# System Type
132# 137#
138CONFIG_MMU=y
133# CONFIG_ARCH_AAEC2000 is not set 139# CONFIG_ARCH_AAEC2000 is not set
134# CONFIG_ARCH_INTEGRATOR is not set 140# CONFIG_ARCH_INTEGRATOR is not set
135# CONFIG_ARCH_REALVIEW is not set 141# CONFIG_ARCH_REALVIEW is not set
136# CONFIG_ARCH_VERSATILE is not set 142# CONFIG_ARCH_VERSATILE is not set
137# CONFIG_ARCH_AT91 is not set 143# CONFIG_ARCH_AT91 is not set
138# CONFIG_ARCH_CLPS711X is not set 144# CONFIG_ARCH_CLPS711X is not set
145# CONFIG_ARCH_GEMINI is not set
139# CONFIG_ARCH_EBSA110 is not set 146# CONFIG_ARCH_EBSA110 is not set
140# CONFIG_ARCH_EP93XX is not set 147# CONFIG_ARCH_EP93XX is not set
141# CONFIG_ARCH_GEMINI is not set
142# CONFIG_ARCH_FOOTBRIDGE is not set 148# CONFIG_ARCH_FOOTBRIDGE is not set
149# CONFIG_ARCH_MXC is not set
150# CONFIG_ARCH_STMP3XXX is not set
143# CONFIG_ARCH_NETX is not set 151# CONFIG_ARCH_NETX is not set
144# CONFIG_ARCH_H720X is not set 152# CONFIG_ARCH_H720X is not set
145# CONFIG_ARCH_IMX is not set 153# CONFIG_ARCH_NOMADIK is not set
146# CONFIG_ARCH_IOP13XX is not set 154# CONFIG_ARCH_IOP13XX is not set
147# CONFIG_ARCH_IOP32X is not set 155# CONFIG_ARCH_IOP32X is not set
148# CONFIG_ARCH_IOP33X is not set 156# CONFIG_ARCH_IOP33X is not set
@@ -151,25 +159,27 @@ CONFIG_DEFAULT_IOSCHED="cfq"
151# CONFIG_ARCH_IXP4XX is not set 159# CONFIG_ARCH_IXP4XX is not set
152# CONFIG_ARCH_L7200 is not set 160# CONFIG_ARCH_L7200 is not set
153# CONFIG_ARCH_KIRKWOOD is not set 161# 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 162# CONFIG_ARCH_LOKI is not set
157# CONFIG_ARCH_MV78XX0 is not set 163# CONFIG_ARCH_MV78XX0 is not set
158# CONFIG_ARCH_MXC is not set
159CONFIG_ARCH_ORION5X=y 164CONFIG_ARCH_ORION5X=y
165# CONFIG_ARCH_MMP is not set
166# CONFIG_ARCH_KS8695 is not set
167# CONFIG_ARCH_NS9XXX is not set
168# CONFIG_ARCH_W90X900 is not set
160# CONFIG_ARCH_PNX4008 is not set 169# CONFIG_ARCH_PNX4008 is not set
161# CONFIG_ARCH_PXA is not set 170# CONFIG_ARCH_PXA is not set
162# CONFIG_ARCH_MMP is not set 171# CONFIG_ARCH_MSM is not set
163# CONFIG_ARCH_RPC is not set 172# CONFIG_ARCH_RPC is not set
164# CONFIG_ARCH_SA1100 is not set 173# CONFIG_ARCH_SA1100 is not set
165# CONFIG_ARCH_S3C2410 is not set 174# CONFIG_ARCH_S3C2410 is not set
166# CONFIG_ARCH_S3C64XX is not set 175# CONFIG_ARCH_S3C64XX is not set
176# CONFIG_ARCH_S5PC1XX is not set
167# CONFIG_ARCH_SHARK is not set 177# CONFIG_ARCH_SHARK is not set
168# CONFIG_ARCH_LH7A40X is not set 178# CONFIG_ARCH_LH7A40X is not set
179# CONFIG_ARCH_U300 is not set
169# CONFIG_ARCH_DAVINCI is not set 180# CONFIG_ARCH_DAVINCI is not set
170# CONFIG_ARCH_OMAP is not set 181# CONFIG_ARCH_OMAP is not set
171# CONFIG_ARCH_MSM is not set 182# CONFIG_ARCH_BCMRING is not set
172# CONFIG_ARCH_W90X900 is not set
173 183
174# 184#
175# Orion Implementations 185# Orion Implementations
@@ -187,6 +197,9 @@ CONFIG_MACH_WRT350N_V2=y
187CONFIG_MACH_TS78XX=y 197CONFIG_MACH_TS78XX=y
188CONFIG_MACH_MV2120=y 198CONFIG_MACH_MV2120=y
189CONFIG_MACH_EDMINI_V2=y 199CONFIG_MACH_EDMINI_V2=y
200CONFIG_MACH_D2NET=y
201CONFIG_MACH_BIGDISK=y
202CONFIG_MACH_NET2BIG=y
190CONFIG_MACH_MSS2=y 203CONFIG_MACH_MSS2=y
191CONFIG_MACH_WNR854T=y 204CONFIG_MACH_WNR854T=y
192CONFIG_MACH_RD88F5181L_GE=y 205CONFIG_MACH_RD88F5181L_GE=y
@@ -202,7 +215,7 @@ CONFIG_CPU_FEROCEON=y
202CONFIG_CPU_FEROCEON_OLD_ID=y 215CONFIG_CPU_FEROCEON_OLD_ID=y
203CONFIG_CPU_32v5=y 216CONFIG_CPU_32v5=y
204CONFIG_CPU_ABRT_EV5T=y 217CONFIG_CPU_ABRT_EV5T=y
205CONFIG_CPU_PABRT_NOIFAR=y 218CONFIG_CPU_PABRT_LEGACY=y
206CONFIG_CPU_CACHE_VIVT=y 219CONFIG_CPU_CACHE_VIVT=y
207CONFIG_CPU_COPY_FEROCEON=y 220CONFIG_CPU_COPY_FEROCEON=y
208CONFIG_CPU_TLB_FEROCEON=y 221CONFIG_CPU_TLB_FEROCEON=y
@@ -215,7 +228,7 @@ CONFIG_CPU_CP15_MMU=y
215CONFIG_ARM_THUMB=y 228CONFIG_ARM_THUMB=y
216# CONFIG_CPU_ICACHE_DISABLE is not set 229# CONFIG_CPU_ICACHE_DISABLE is not set
217# CONFIG_CPU_DCACHE_DISABLE is not set 230# CONFIG_CPU_DCACHE_DISABLE is not set
218# CONFIG_OUTER_CACHE is not set 231CONFIG_ARM_L1_CACHE_SHIFT=5
219 232
220# 233#
221# Bus support 234# Bus support
@@ -240,11 +253,12 @@ CONFIG_VMSPLIT_3G=y
240# CONFIG_VMSPLIT_2G is not set 253# CONFIG_VMSPLIT_2G is not set
241# CONFIG_VMSPLIT_1G is not set 254# CONFIG_VMSPLIT_1G is not set
242CONFIG_PAGE_OFFSET=0xC0000000 255CONFIG_PAGE_OFFSET=0xC0000000
256# CONFIG_PREEMPT_NONE is not set
257# CONFIG_PREEMPT_VOLUNTARY is not set
243CONFIG_PREEMPT=y 258CONFIG_PREEMPT=y
244CONFIG_HZ=100 259CONFIG_HZ=100
245CONFIG_AEABI=y 260CONFIG_AEABI=y
246CONFIG_OABI_COMPAT=y 261CONFIG_OABI_COMPAT=y
247CONFIG_ARCH_FLATMEM_HAS_HOLES=y
248# CONFIG_ARCH_SPARSEMEM_DEFAULT is not set 262# CONFIG_ARCH_SPARSEMEM_DEFAULT is not set
249# CONFIG_ARCH_SELECT_MEMORY_MODEL is not set 263# CONFIG_ARCH_SELECT_MEMORY_MODEL is not set
250# CONFIG_HIGHMEM is not set 264# CONFIG_HIGHMEM is not set
@@ -259,12 +273,14 @@ CONFIG_SPLIT_PTLOCK_CPUS=4096
259# CONFIG_PHYS_ADDR_T_64BIT is not set 273# CONFIG_PHYS_ADDR_T_64BIT is not set
260CONFIG_ZONE_DMA_FLAG=0 274CONFIG_ZONE_DMA_FLAG=0
261CONFIG_VIRT_TO_BUS=y 275CONFIG_VIRT_TO_BUS=y
262CONFIG_UNEVICTABLE_LRU=y
263CONFIG_HAVE_MLOCK=y 276CONFIG_HAVE_MLOCK=y
264CONFIG_HAVE_MLOCKED_PAGE_BIT=y 277CONFIG_HAVE_MLOCKED_PAGE_BIT=y
278# CONFIG_KSM is not set
279CONFIG_DEFAULT_MMAP_MIN_ADDR=4096
265CONFIG_LEDS=y 280CONFIG_LEDS=y
266CONFIG_LEDS_CPU=y 281CONFIG_LEDS_CPU=y
267CONFIG_ALIGNMENT_TRAP=y 282CONFIG_ALIGNMENT_TRAP=y
283CONFIG_UACCESS_WITH_MEMCPY=y
268 284
269# 285#
270# Boot options 286# Boot options
@@ -308,6 +324,7 @@ CONFIG_PM=y
308# CONFIG_PM_DEBUG is not set 324# CONFIG_PM_DEBUG is not set
309# CONFIG_SUSPEND is not set 325# CONFIG_SUSPEND is not set
310# CONFIG_APM_EMULATION is not set 326# CONFIG_APM_EMULATION is not set
327# CONFIG_PM_RUNTIME is not set
311CONFIG_ARCH_SUSPEND_POSSIBLE=y 328CONFIG_ARCH_SUSPEND_POSSIBLE=y
312CONFIG_NET=y 329CONFIG_NET=y
313 330
@@ -356,6 +373,7 @@ CONFIG_DEFAULT_TCP_CONG="cubic"
356# CONFIG_NETFILTER is not set 373# CONFIG_NETFILTER is not set
357# CONFIG_IP_DCCP is not set 374# CONFIG_IP_DCCP is not set
358# CONFIG_IP_SCTP is not set 375# CONFIG_IP_SCTP is not set
376# CONFIG_RDS is not set
359# CONFIG_TIPC is not set 377# CONFIG_TIPC is not set
360# CONFIG_ATM is not set 378# CONFIG_ATM is not set
361# CONFIG_BRIDGE is not set 379# CONFIG_BRIDGE is not set
@@ -378,6 +396,7 @@ CONFIG_NET_DSA_MV88E6123_61_65=y
378# CONFIG_ECONET is not set 396# CONFIG_ECONET is not set
379# CONFIG_WAN_ROUTER is not set 397# CONFIG_WAN_ROUTER is not set
380# CONFIG_PHONET is not set 398# CONFIG_PHONET is not set
399# CONFIG_IEEE802154 is not set
381# CONFIG_NET_SCHED is not set 400# CONFIG_NET_SCHED is not set
382# CONFIG_DCB is not set 401# CONFIG_DCB is not set
383 402
@@ -394,11 +413,15 @@ CONFIG_NET_PKTGEN=m
394# CONFIG_AF_RXRPC is not set 413# CONFIG_AF_RXRPC is not set
395CONFIG_WIRELESS=y 414CONFIG_WIRELESS=y
396# CONFIG_CFG80211 is not set 415# CONFIG_CFG80211 is not set
416CONFIG_CFG80211_DEFAULT_PS_VALUE=0
397# CONFIG_WIRELESS_OLD_REGULATORY is not set 417# CONFIG_WIRELESS_OLD_REGULATORY is not set
398CONFIG_WIRELESS_EXT=y 418CONFIG_WIRELESS_EXT=y
399CONFIG_WIRELESS_EXT_SYSFS=y 419CONFIG_WIRELESS_EXT_SYSFS=y
400# CONFIG_LIB80211 is not set 420# CONFIG_LIB80211 is not set
401# CONFIG_MAC80211 is not set 421
422#
423# CFG80211 needs to be enabled for MAC80211
424#
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
@@ -411,6 +434,7 @@ CONFIG_WIRELESS_EXT_SYSFS=y
411# Generic Driver Options 434# Generic Driver Options
412# 435#
413CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug" 436CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
437# CONFIG_DEVTMPFS is not set
414CONFIG_STANDALONE=y 438CONFIG_STANDALONE=y
415CONFIG_PREVENT_FIRMWARE_BUILD=y 439CONFIG_PREVENT_FIRMWARE_BUILD=y
416CONFIG_FW_LOADER=y 440CONFIG_FW_LOADER=y
@@ -422,9 +446,9 @@ CONFIG_EXTRA_FIRMWARE=""
422# CONFIG_CONNECTOR is not set 446# CONFIG_CONNECTOR is not set
423CONFIG_MTD=y 447CONFIG_MTD=y
424# CONFIG_MTD_DEBUG is not set 448# CONFIG_MTD_DEBUG is not set
449# CONFIG_MTD_TESTS is not set
425# CONFIG_MTD_CONCAT is not set 450# CONFIG_MTD_CONCAT is not set
426CONFIG_MTD_PARTITIONS=y 451CONFIG_MTD_PARTITIONS=y
427# CONFIG_MTD_TESTS is not set
428# CONFIG_MTD_REDBOOT_PARTS is not set 452# CONFIG_MTD_REDBOOT_PARTS is not set
429CONFIG_MTD_CMDLINE_PARTS=y 453CONFIG_MTD_CMDLINE_PARTS=y
430# CONFIG_MTD_AFS_PARTS is not set 454# CONFIG_MTD_AFS_PARTS is not set
@@ -537,6 +561,7 @@ CONFIG_BLK_DEV_LOOP=y
537# CONFIG_BLK_DEV_RAM is not set 561# CONFIG_BLK_DEV_RAM is not set
538# CONFIG_CDROM_PKTCDVD is not set 562# CONFIG_CDROM_PKTCDVD is not set
539# CONFIG_ATA_OVER_ETH is not set 563# CONFIG_ATA_OVER_ETH is not set
564# CONFIG_MG_DISK is not set
540CONFIG_MISC_DEVICES=y 565CONFIG_MISC_DEVICES=y
541# CONFIG_PHANTOM is not set 566# CONFIG_PHANTOM is not set
542# CONFIG_SGI_IOC4 is not set 567# CONFIG_SGI_IOC4 is not set
@@ -552,7 +577,9 @@ CONFIG_MISC_DEVICES=y
552# 577#
553# CONFIG_EEPROM_AT24 is not set 578# CONFIG_EEPROM_AT24 is not set
554# CONFIG_EEPROM_LEGACY is not set 579# CONFIG_EEPROM_LEGACY is not set
580# CONFIG_EEPROM_MAX6875 is not set
555# CONFIG_EEPROM_93CX6 is not set 581# CONFIG_EEPROM_93CX6 is not set
582# CONFIG_CB710_CORE is not set
556CONFIG_HAVE_IDE=y 583CONFIG_HAVE_IDE=y
557# CONFIG_IDE is not set 584# CONFIG_IDE is not set
558 585
@@ -576,10 +603,6 @@ CONFIG_BLK_DEV_SR=m
576# CONFIG_BLK_DEV_SR_VENDOR is not set 603# CONFIG_BLK_DEV_SR_VENDOR is not set
577CONFIG_CHR_DEV_SG=m 604CONFIG_CHR_DEV_SG=m
578# CONFIG_CHR_DEV_SCH is not set 605# CONFIG_CHR_DEV_SCH is not set
579
580#
581# Some SCSI devices (e.g. CD jukebox) support multiple LUNs
582#
583# CONFIG_SCSI_MULTI_LUN is not set 606# CONFIG_SCSI_MULTI_LUN is not set
584# CONFIG_SCSI_CONSTANTS is not set 607# CONFIG_SCSI_CONSTANTS is not set
585# CONFIG_SCSI_LOGGING is not set 608# CONFIG_SCSI_LOGGING is not set
@@ -596,6 +619,8 @@ CONFIG_SCSI_WAIT_SCAN=m
596# CONFIG_SCSI_SRP_ATTRS is not set 619# CONFIG_SCSI_SRP_ATTRS is not set
597CONFIG_SCSI_LOWLEVEL=y 620CONFIG_SCSI_LOWLEVEL=y
598# CONFIG_ISCSI_TCP is not set 621# CONFIG_ISCSI_TCP is not set
622# CONFIG_SCSI_BNX2_ISCSI is not set
623# CONFIG_BE2ISCSI is not set
599# CONFIG_BLK_DEV_3W_XXXX_RAID is not set 624# CONFIG_BLK_DEV_3W_XXXX_RAID is not set
600# CONFIG_SCSI_3W_9XXX is not set 625# CONFIG_SCSI_3W_9XXX is not set
601# CONFIG_SCSI_ACARD is not set 626# CONFIG_SCSI_ACARD is not set
@@ -604,6 +629,7 @@ CONFIG_SCSI_LOWLEVEL=y
604# CONFIG_SCSI_AIC7XXX_OLD is not set 629# CONFIG_SCSI_AIC7XXX_OLD is not set
605# CONFIG_SCSI_AIC79XX is not set 630# CONFIG_SCSI_AIC79XX is not set
606# CONFIG_SCSI_AIC94XX is not set 631# CONFIG_SCSI_AIC94XX is not set
632# CONFIG_SCSI_MVSAS is not set
607# CONFIG_SCSI_DPT_I2O is not set 633# CONFIG_SCSI_DPT_I2O is not set
608# CONFIG_SCSI_ADVANSYS is not set 634# CONFIG_SCSI_ADVANSYS is not set
609# CONFIG_SCSI_ARCMSR is not set 635# CONFIG_SCSI_ARCMSR is not set
@@ -620,7 +646,6 @@ CONFIG_SCSI_LOWLEVEL=y
620# CONFIG_SCSI_IPS is not set 646# CONFIG_SCSI_IPS is not set
621# CONFIG_SCSI_INITIO is not set 647# CONFIG_SCSI_INITIO is not set
622# CONFIG_SCSI_INIA100 is not set 648# CONFIG_SCSI_INIA100 is not set
623# CONFIG_SCSI_MVSAS is not set
624# CONFIG_SCSI_STEX is not set 649# CONFIG_SCSI_STEX is not set
625# CONFIG_SCSI_SYM53C8XX_2 is not set 650# CONFIG_SCSI_SYM53C8XX_2 is not set
626# CONFIG_SCSI_IPR is not set 651# CONFIG_SCSI_IPR is not set
@@ -632,11 +657,14 @@ CONFIG_SCSI_LOWLEVEL=y
632# CONFIG_SCSI_DC390T is not set 657# CONFIG_SCSI_DC390T is not set
633# CONFIG_SCSI_NSP32 is not set 658# CONFIG_SCSI_NSP32 is not set
634# CONFIG_SCSI_DEBUG is not set 659# CONFIG_SCSI_DEBUG is not set
660# CONFIG_SCSI_PMCRAID is not set
635# CONFIG_SCSI_SRP is not set 661# CONFIG_SCSI_SRP is not set
662# CONFIG_SCSI_BFA_FC is not set
636# CONFIG_SCSI_DH is not set 663# CONFIG_SCSI_DH is not set
637# CONFIG_SCSI_OSD_INITIATOR is not set 664# CONFIG_SCSI_OSD_INITIATOR is not set
638CONFIG_ATA=y 665CONFIG_ATA=y
639# CONFIG_ATA_NONSTANDARD is not set 666# CONFIG_ATA_NONSTANDARD is not set
667CONFIG_ATA_VERBOSE_ERROR=y
640CONFIG_SATA_PMP=y 668CONFIG_SATA_PMP=y
641# CONFIG_SATA_AHCI is not set 669# CONFIG_SATA_AHCI is not set
642# CONFIG_SATA_SIL24 is not set 670# CONFIG_SATA_SIL24 is not set
@@ -658,6 +686,7 @@ CONFIG_SATA_MV=y
658# CONFIG_PATA_ALI is not set 686# CONFIG_PATA_ALI is not set
659# CONFIG_PATA_AMD is not set 687# CONFIG_PATA_AMD is not set
660# CONFIG_PATA_ARTOP is not set 688# CONFIG_PATA_ARTOP is not set
689# CONFIG_PATA_ATP867X is not set
661# CONFIG_PATA_ATIIXP is not set 690# CONFIG_PATA_ATIIXP is not set
662# CONFIG_PATA_CMD640_PCI is not set 691# CONFIG_PATA_CMD640_PCI is not set
663# CONFIG_PATA_CMD64X is not set 692# CONFIG_PATA_CMD64X is not set
@@ -685,6 +714,7 @@ CONFIG_SATA_MV=y
685# CONFIG_PATA_OPTIDMA is not set 714# CONFIG_PATA_OPTIDMA is not set
686# CONFIG_PATA_PDC_OLD is not set 715# CONFIG_PATA_PDC_OLD is not set
687# CONFIG_PATA_RADISYS is not set 716# CONFIG_PATA_RADISYS is not set
717# CONFIG_PATA_RDC is not set
688# CONFIG_PATA_RZ1000 is not set 718# CONFIG_PATA_RZ1000 is not set
689# CONFIG_PATA_SC1200 is not set 719# CONFIG_PATA_SC1200 is not set
690# CONFIG_PATA_SERVERWORKS is not set 720# CONFIG_PATA_SERVERWORKS is not set
@@ -703,13 +733,16 @@ CONFIG_SATA_MV=y
703# 733#
704 734
705# 735#
706# Enable only one of the two stacks, unless you know what you are doing 736# You can enable one or both FireWire driver stacks.
737#
738
739#
740# See the help texts for more information.
707# 741#
708# CONFIG_FIREWIRE is not set 742# CONFIG_FIREWIRE is not set
709# CONFIG_IEEE1394 is not set 743# CONFIG_IEEE1394 is not set
710# CONFIG_I2O is not set 744# CONFIG_I2O is not set
711CONFIG_NETDEVICES=y 745CONFIG_NETDEVICES=y
712CONFIG_COMPAT_NET_DEV_OPS=y
713# CONFIG_DUMMY is not set 746# CONFIG_DUMMY is not set
714# CONFIG_BONDING is not set 747# CONFIG_BONDING is not set
715# CONFIG_MACVLAN is not set 748# CONFIG_MACVLAN is not set
@@ -777,6 +810,8 @@ CONFIG_NET_PCI=y
777# CONFIG_SMSC9420 is not set 810# CONFIG_SMSC9420 is not set
778# CONFIG_SUNDANCE is not set 811# CONFIG_SUNDANCE is not set
779# CONFIG_TLAN is not set 812# CONFIG_TLAN is not set
813# CONFIG_KS8842 is not set
814# CONFIG_KS8851_MLL is not set
780# CONFIG_VIA_RHINE is not set 815# CONFIG_VIA_RHINE is not set
781# CONFIG_SC92031 is not set 816# CONFIG_SC92031 is not set
782# CONFIG_ATL2 is not set 817# CONFIG_ATL2 is not set
@@ -798,6 +833,7 @@ CONFIG_NETDEV_1000=y
798# CONFIG_VIA_VELOCITY is not set 833# CONFIG_VIA_VELOCITY is not set
799# CONFIG_TIGON3 is not set 834# CONFIG_TIGON3 is not set
800# CONFIG_BNX2 is not set 835# CONFIG_BNX2 is not set
836# CONFIG_CNIC is not set
801CONFIG_MV643XX_ETH=y 837CONFIG_MV643XX_ETH=y
802# CONFIG_QLA3XXX is not set 838# CONFIG_QLA3XXX is not set
803# CONFIG_ATL1 is not set 839# CONFIG_ATL1 is not set
@@ -806,10 +842,7 @@ CONFIG_MV643XX_ETH=y
806# CONFIG_JME is not set 842# CONFIG_JME is not set
807# CONFIG_NETDEV_10000 is not set 843# CONFIG_NETDEV_10000 is not set
808# CONFIG_TR is not set 844# CONFIG_TR is not set
809 845CONFIG_WLAN=y
810#
811# Wireless LAN
812#
813# CONFIG_WLAN_PRE80211 is not set 846# CONFIG_WLAN_PRE80211 is not set
814# CONFIG_WLAN_80211 is not set 847# CONFIG_WLAN_80211 is not set
815 848
@@ -835,6 +868,7 @@ CONFIG_MV643XX_ETH=y
835# CONFIG_NETPOLL is not set 868# CONFIG_NETPOLL is not set
836# CONFIG_NET_POLL_CONTROLLER is not set 869# CONFIG_NET_POLL_CONTROLLER is not set
837# CONFIG_ISDN is not set 870# CONFIG_ISDN is not set
871# CONFIG_PHONE is not set
838 872
839# 873#
840# Input device support 874# Input device support
@@ -855,13 +889,19 @@ CONFIG_INPUT_EVDEV=y
855# Input Device Drivers 889# Input Device Drivers
856# 890#
857CONFIG_INPUT_KEYBOARD=y 891CONFIG_INPUT_KEYBOARD=y
892# CONFIG_KEYBOARD_ADP5588 is not set
858# CONFIG_KEYBOARD_ATKBD is not set 893# CONFIG_KEYBOARD_ATKBD is not set
859# CONFIG_KEYBOARD_SUNKBD is not set 894# CONFIG_QT2160 is not set
860# CONFIG_KEYBOARD_LKKBD is not set 895# CONFIG_KEYBOARD_LKKBD is not set
861# CONFIG_KEYBOARD_XTKBD is not set 896CONFIG_KEYBOARD_GPIO=y
897# CONFIG_KEYBOARD_MATRIX is not set
898# CONFIG_KEYBOARD_LM8323 is not set
899# CONFIG_KEYBOARD_MAX7359 is not set
862# CONFIG_KEYBOARD_NEWTON is not set 900# CONFIG_KEYBOARD_NEWTON is not set
901# CONFIG_KEYBOARD_OPENCORES is not set
863# CONFIG_KEYBOARD_STOWAWAY is not set 902# CONFIG_KEYBOARD_STOWAWAY is not set
864CONFIG_KEYBOARD_GPIO=y 903# CONFIG_KEYBOARD_SUNKBD is not set
904# CONFIG_KEYBOARD_XTKBD is not set
865# CONFIG_INPUT_MOUSE is not set 905# CONFIG_INPUT_MOUSE is not set
866# CONFIG_INPUT_JOYSTICK is not set 906# CONFIG_INPUT_JOYSTICK is not set
867# CONFIG_INPUT_TABLET is not set 907# CONFIG_INPUT_TABLET is not set
@@ -912,6 +952,7 @@ CONFIG_HW_RANDOM_TIMERIOMEM=m
912CONFIG_DEVPORT=y 952CONFIG_DEVPORT=y
913CONFIG_I2C=y 953CONFIG_I2C=y
914CONFIG_I2C_BOARDINFO=y 954CONFIG_I2C_BOARDINFO=y
955# CONFIG_I2C_COMPAT is not set
915CONFIG_I2C_CHARDEV=y 956CONFIG_I2C_CHARDEV=y
916CONFIG_I2C_HELPER_AUTO=y 957CONFIG_I2C_HELPER_AUTO=y
917 958
@@ -967,20 +1008,55 @@ CONFIG_I2C_MV64XXX=y
967# Miscellaneous I2C Chip support 1008# Miscellaneous I2C Chip support
968# 1009#
969# CONFIG_DS1682 is not set 1010# CONFIG_DS1682 is not set
970# CONFIG_SENSORS_PCF8574 is not set
971# CONFIG_PCF8575 is not set
972# CONFIG_SENSORS_PCA9539 is not set
973# CONFIG_SENSORS_MAX6875 is not set
974# CONFIG_SENSORS_TSL2550 is not set 1011# CONFIG_SENSORS_TSL2550 is not set
975# CONFIG_I2C_DEBUG_CORE is not set 1012# CONFIG_I2C_DEBUG_CORE is not set
976# CONFIG_I2C_DEBUG_ALGO is not set 1013# CONFIG_I2C_DEBUG_ALGO is not set
977# CONFIG_I2C_DEBUG_BUS is not set 1014# CONFIG_I2C_DEBUG_BUS is not set
978# CONFIG_I2C_DEBUG_CHIP is not set 1015# CONFIG_I2C_DEBUG_CHIP is not set
979# CONFIG_SPI is not set 1016# CONFIG_SPI is not set
1017
1018#
1019# PPS support
1020#
1021# CONFIG_PPS is not set
1022CONFIG_ARCH_REQUIRE_GPIOLIB=y
1023CONFIG_GPIOLIB=y
1024# CONFIG_DEBUG_GPIO is not set
1025CONFIG_GPIO_SYSFS=y
1026
1027#
1028# Memory mapped GPIO expanders:
1029#
1030
1031#
1032# I2C GPIO expanders:
1033#
1034# CONFIG_GPIO_MAX732X is not set
1035# CONFIG_GPIO_PCA953X is not set
1036# CONFIG_GPIO_PCF857X is not set
1037
1038#
1039# PCI GPIO expanders:
1040#
1041# CONFIG_GPIO_BT8XX is not set
1042# CONFIG_GPIO_LANGWELL is not set
1043
1044#
1045# SPI GPIO expanders:
1046#
1047
1048#
1049# AC97 GPIO expanders:
1050#
980# CONFIG_W1 is not set 1051# CONFIG_W1 is not set
981# CONFIG_POWER_SUPPLY is not set 1052# CONFIG_POWER_SUPPLY is not set
982CONFIG_HWMON=y 1053CONFIG_HWMON=y
983# CONFIG_HWMON_VID is not set 1054# CONFIG_HWMON_VID is not set
1055# CONFIG_HWMON_DEBUG_CHIP is not set
1056
1057#
1058# Native drivers
1059#
984# CONFIG_SENSORS_AD7414 is not set 1060# CONFIG_SENSORS_AD7414 is not set
985# CONFIG_SENSORS_AD7418 is not set 1061# CONFIG_SENSORS_AD7418 is not set
986# CONFIG_SENSORS_ADM1021 is not set 1062# CONFIG_SENSORS_ADM1021 is not set
@@ -1030,6 +1106,8 @@ CONFIG_SENSORS_LM75=y
1030# CONFIG_SENSORS_SMSC47B397 is not set 1106# CONFIG_SENSORS_SMSC47B397 is not set
1031# CONFIG_SENSORS_ADS7828 is not set 1107# CONFIG_SENSORS_ADS7828 is not set
1032# CONFIG_SENSORS_THMC50 is not set 1108# CONFIG_SENSORS_THMC50 is not set
1109# CONFIG_SENSORS_TMP401 is not set
1110# CONFIG_SENSORS_TMP421 is not set
1033# CONFIG_SENSORS_VIA686A is not set 1111# CONFIG_SENSORS_VIA686A is not set
1034# CONFIG_SENSORS_VT1211 is not set 1112# CONFIG_SENSORS_VT1211 is not set
1035# CONFIG_SENSORS_VT8231 is not set 1113# CONFIG_SENSORS_VT8231 is not set
@@ -1041,9 +1119,7 @@ CONFIG_SENSORS_LM75=y
1041# CONFIG_SENSORS_W83L786NG is not set 1119# CONFIG_SENSORS_W83L786NG is not set
1042# CONFIG_SENSORS_W83627HF is not set 1120# CONFIG_SENSORS_W83627HF is not set
1043# CONFIG_SENSORS_W83627EHF is not set 1121# CONFIG_SENSORS_W83627EHF is not set
1044# CONFIG_HWMON_DEBUG_CHIP is not set
1045# CONFIG_THERMAL is not set 1122# CONFIG_THERMAL is not set
1046# CONFIG_THERMAL_HWMON is not set
1047# CONFIG_WATCHDOG is not set 1123# CONFIG_WATCHDOG is not set
1048CONFIG_SSB_POSSIBLE=y 1124CONFIG_SSB_POSSIBLE=y
1049 1125
@@ -1057,33 +1133,26 @@ CONFIG_SSB_POSSIBLE=y
1057# 1133#
1058# CONFIG_MFD_CORE is not set 1134# CONFIG_MFD_CORE is not set
1059# CONFIG_MFD_SM501 is not set 1135# CONFIG_MFD_SM501 is not set
1136# CONFIG_MFD_ASIC3 is not set
1137# CONFIG_HTC_EGPIO is not set
1060# CONFIG_HTC_PASIC3 is not set 1138# CONFIG_HTC_PASIC3 is not set
1139# CONFIG_TPS65010 is not set
1061# CONFIG_TWL4030_CORE is not set 1140# CONFIG_TWL4030_CORE is not set
1062# CONFIG_MFD_TMIO is not set 1141# CONFIG_MFD_TMIO is not set
1142# CONFIG_MFD_TC6393XB is not set
1063# CONFIG_PMIC_DA903X is not set 1143# CONFIG_PMIC_DA903X is not set
1064# CONFIG_MFD_WM8400 is not set 1144# CONFIG_MFD_WM8400 is not set
1145# CONFIG_MFD_WM831X is not set
1065# CONFIG_MFD_WM8350_I2C is not set 1146# CONFIG_MFD_WM8350_I2C is not set
1066# CONFIG_MFD_PCF50633 is not set 1147# CONFIG_MFD_PCF50633 is not set
1067 1148# CONFIG_AB3100_CORE is not set
1068# 1149# CONFIG_REGULATOR is not set
1069# Multimedia devices 1150# CONFIG_MEDIA_SUPPORT is not set
1070#
1071
1072#
1073# Multimedia core support
1074#
1075# CONFIG_VIDEO_DEV is not set
1076# CONFIG_DVB_CORE is not set
1077# CONFIG_VIDEO_MEDIA is not set
1078
1079#
1080# Multimedia drivers
1081#
1082# CONFIG_DAB is not set
1083 1151
1084# 1152#
1085# Graphics support 1153# Graphics support
1086# 1154#
1155# CONFIG_VGA_ARB is not set
1087# CONFIG_DRM is not set 1156# CONFIG_DRM is not set
1088# CONFIG_VGASTATE is not set 1157# CONFIG_VGASTATE is not set
1089# CONFIG_VIDEO_OUTPUT_CONTROL is not set 1158# CONFIG_VIDEO_OUTPUT_CONTROL is not set
@@ -1097,7 +1166,6 @@ CONFIG_SSB_POSSIBLE=y
1097# CONFIG_SOUND is not set 1166# CONFIG_SOUND is not set
1098CONFIG_HID_SUPPORT=y 1167CONFIG_HID_SUPPORT=y
1099CONFIG_HID=y 1168CONFIG_HID=y
1100# CONFIG_HID_DEBUG is not set
1101# CONFIG_HIDRAW is not set 1169# CONFIG_HIDRAW is not set
1102 1170
1103# 1171#
@@ -1116,10 +1184,11 @@ CONFIG_USB_HID=y
1116# CONFIG_HID_CHERRY is not set 1184# CONFIG_HID_CHERRY is not set
1117# CONFIG_HID_CHICONY is not set 1185# CONFIG_HID_CHICONY is not set
1118# CONFIG_HID_CYPRESS is not set 1186# CONFIG_HID_CYPRESS is not set
1119# CONFIG_DRAGONRISE_FF is not set 1187# CONFIG_HID_DRAGONRISE is not set
1120# CONFIG_HID_EZKEY is not set 1188# CONFIG_HID_EZKEY is not set
1121# CONFIG_HID_KYE is not set 1189# CONFIG_HID_KYE is not set
1122# CONFIG_HID_GYRATION is not set 1190# CONFIG_HID_GYRATION is not set
1191# CONFIG_HID_TWINHAN is not set
1123# CONFIG_HID_KENSINGTON is not set 1192# CONFIG_HID_KENSINGTON is not set
1124# CONFIG_HID_LOGITECH is not set 1193# CONFIG_HID_LOGITECH is not set
1125# CONFIG_HID_MICROSOFT is not set 1194# CONFIG_HID_MICROSOFT is not set
@@ -1130,10 +1199,11 @@ CONFIG_USB_HID=y
1130# CONFIG_HID_SAMSUNG is not set 1199# CONFIG_HID_SAMSUNG is not set
1131# CONFIG_HID_SONY is not set 1200# CONFIG_HID_SONY is not set
1132# CONFIG_HID_SUNPLUS is not set 1201# CONFIG_HID_SUNPLUS is not set
1133# CONFIG_GREENASIA_FF is not set 1202# CONFIG_HID_GREENASIA is not set
1203# CONFIG_HID_SMARTJOYPLUS is not set
1134# CONFIG_HID_TOPSEED is not set 1204# CONFIG_HID_TOPSEED is not set
1135# CONFIG_THRUSTMASTER_FF is not set 1205# CONFIG_HID_THRUSTMASTER is not set
1136# CONFIG_ZEROPLUS_FF is not set 1206# CONFIG_HID_ZEROPLUS is not set
1137CONFIG_USB_SUPPORT=y 1207CONFIG_USB_SUPPORT=y
1138CONFIG_USB_ARCH_HAS_HCD=y 1208CONFIG_USB_ARCH_HAS_HCD=y
1139CONFIG_USB_ARCH_HAS_OHCI=y 1209CONFIG_USB_ARCH_HAS_OHCI=y
@@ -1160,18 +1230,21 @@ CONFIG_USB_DEVICE_CLASS=y
1160# USB Host Controller Drivers 1230# USB Host Controller Drivers
1161# 1231#
1162# CONFIG_USB_C67X00_HCD is not set 1232# CONFIG_USB_C67X00_HCD is not set
1233# CONFIG_USB_XHCI_HCD is not set
1163CONFIG_USB_EHCI_HCD=y 1234CONFIG_USB_EHCI_HCD=y
1164CONFIG_USB_EHCI_ROOT_HUB_TT=y 1235CONFIG_USB_EHCI_ROOT_HUB_TT=y
1165CONFIG_USB_EHCI_TT_NEWSCHED=y 1236CONFIG_USB_EHCI_TT_NEWSCHED=y
1166# CONFIG_USB_OXU210HP_HCD is not set 1237# CONFIG_USB_OXU210HP_HCD is not set
1167# CONFIG_USB_ISP116X_HCD is not set 1238# CONFIG_USB_ISP116X_HCD is not set
1168# CONFIG_USB_ISP1760_HCD is not set 1239# CONFIG_USB_ISP1760_HCD is not set
1240# CONFIG_USB_ISP1362_HCD is not set
1169# CONFIG_USB_OHCI_HCD is not set 1241# CONFIG_USB_OHCI_HCD is not set
1170# CONFIG_USB_UHCI_HCD is not set 1242# CONFIG_USB_UHCI_HCD is not set
1171# CONFIG_USB_SL811_HCD is not set 1243# CONFIG_USB_SL811_HCD is not set
1172# CONFIG_USB_R8A66597_HCD is not set 1244# CONFIG_USB_R8A66597_HCD is not set
1173# CONFIG_USB_WHCI_HCD is not set 1245# CONFIG_USB_WHCI_HCD is not set
1174# CONFIG_USB_HWA_HCD is not set 1246# CONFIG_USB_HWA_HCD is not set
1247# CONFIG_USB_MUSB_HDRC is not set
1175 1248
1176# 1249#
1177# USB Device Class drivers 1250# USB Device Class drivers
@@ -1248,7 +1321,6 @@ CONFIG_USB_STORAGE_JUMPSHOT=y
1248# CONFIG_UWB is not set 1321# CONFIG_UWB is not set
1249# CONFIG_MMC is not set 1322# CONFIG_MMC is not set
1250# CONFIG_MEMSTICK is not set 1323# CONFIG_MEMSTICK is not set
1251# CONFIG_ACCESSIBILITY is not set
1252CONFIG_NEW_LEDS=y 1324CONFIG_NEW_LEDS=y
1253CONFIG_LEDS_CLASS=y 1325CONFIG_LEDS_CLASS=y
1254 1326
@@ -1258,7 +1330,7 @@ CONFIG_LEDS_CLASS=y
1258# CONFIG_LEDS_PCA9532 is not set 1330# CONFIG_LEDS_PCA9532 is not set
1259CONFIG_LEDS_GPIO=y 1331CONFIG_LEDS_GPIO=y
1260CONFIG_LEDS_GPIO_PLATFORM=y 1332CONFIG_LEDS_GPIO_PLATFORM=y
1261# CONFIG_LEDS_LP5521 is not set 1333# CONFIG_LEDS_LP3944 is not set
1262# CONFIG_LEDS_PCA955X is not set 1334# CONFIG_LEDS_PCA955X is not set
1263# CONFIG_LEDS_BD2802 is not set 1335# CONFIG_LEDS_BD2802 is not set
1264 1336
@@ -1269,11 +1341,14 @@ CONFIG_LEDS_TRIGGERS=y
1269CONFIG_LEDS_TRIGGER_TIMER=y 1341CONFIG_LEDS_TRIGGER_TIMER=y
1270CONFIG_LEDS_TRIGGER_HEARTBEAT=y 1342CONFIG_LEDS_TRIGGER_HEARTBEAT=y
1271# CONFIG_LEDS_TRIGGER_BACKLIGHT is not set 1343# CONFIG_LEDS_TRIGGER_BACKLIGHT is not set
1344# CONFIG_LEDS_TRIGGER_GPIO is not set
1272CONFIG_LEDS_TRIGGER_DEFAULT_ON=y 1345CONFIG_LEDS_TRIGGER_DEFAULT_ON=y
1273 1346
1274# 1347#
1275# iptables trigger is under Netfilter config (LED target) 1348# iptables trigger is under Netfilter config (LED target)
1276# 1349#
1350# CONFIG_ACCESSIBILITY is not set
1351# CONFIG_INFINIBAND is not set
1277CONFIG_RTC_LIB=y 1352CONFIG_RTC_LIB=y
1278CONFIG_RTC_CLASS=y 1353CONFIG_RTC_CLASS=y
1279CONFIG_RTC_HCTOSYS=y 1354CONFIG_RTC_HCTOSYS=y
@@ -1306,6 +1381,7 @@ CONFIG_RTC_DRV_M41T80=y
1306CONFIG_RTC_DRV_S35390A=y 1381CONFIG_RTC_DRV_S35390A=y
1307# CONFIG_RTC_DRV_FM3130 is not set 1382# CONFIG_RTC_DRV_FM3130 is not set
1308# CONFIG_RTC_DRV_RX8581 is not set 1383# CONFIG_RTC_DRV_RX8581 is not set
1384# CONFIG_RTC_DRV_RX8025 is not set
1309 1385
1310# 1386#
1311# SPI RTC drivers 1387# SPI RTC drivers
@@ -1344,8 +1420,11 @@ CONFIG_DMA_ENGINE=y
1344# CONFIG_ASYNC_TX_DMA is not set 1420# CONFIG_ASYNC_TX_DMA is not set
1345# CONFIG_DMATEST is not set 1421# CONFIG_DMATEST is not set
1346# CONFIG_AUXDISPLAY is not set 1422# CONFIG_AUXDISPLAY is not set
1347# CONFIG_REGULATOR is not set
1348# CONFIG_UIO is not set 1423# CONFIG_UIO is not set
1424
1425#
1426# TI VLYNQ
1427#
1349# CONFIG_STAGING is not set 1428# CONFIG_STAGING is not set
1350 1429
1351# 1430#
@@ -1358,10 +1437,10 @@ CONFIG_EXT3_FS=y
1358# CONFIG_EXT3_DEFAULTS_TO_ORDERED is not set 1437# CONFIG_EXT3_DEFAULTS_TO_ORDERED is not set
1359# CONFIG_EXT3_FS_XATTR is not set 1438# CONFIG_EXT3_FS_XATTR is not set
1360CONFIG_EXT4_FS=m 1439CONFIG_EXT4_FS=m
1361# CONFIG_EXT4DEV_COMPAT is not set
1362CONFIG_EXT4_FS_XATTR=y 1440CONFIG_EXT4_FS_XATTR=y
1363# CONFIG_EXT4_FS_POSIX_ACL is not set 1441# CONFIG_EXT4_FS_POSIX_ACL is not set
1364# CONFIG_EXT4_FS_SECURITY is not set 1442# CONFIG_EXT4_FS_SECURITY is not set
1443# CONFIG_EXT4_DEBUG is not set
1365CONFIG_JBD=y 1444CONFIG_JBD=y
1366# CONFIG_JBD_DEBUG is not set 1445# CONFIG_JBD_DEBUG is not set
1367CONFIG_JBD2=m 1446CONFIG_JBD2=m
@@ -1370,10 +1449,13 @@ CONFIG_FS_MBCACHE=m
1370# CONFIG_REISERFS_FS is not set 1449# CONFIG_REISERFS_FS is not set
1371# CONFIG_JFS_FS is not set 1450# CONFIG_JFS_FS is not set
1372# CONFIG_FS_POSIX_ACL is not set 1451# CONFIG_FS_POSIX_ACL is not set
1373CONFIG_FILE_LOCKING=y
1374# CONFIG_XFS_FS is not set 1452# CONFIG_XFS_FS is not set
1453# CONFIG_GFS2_FS is not set
1375# CONFIG_OCFS2_FS is not set 1454# CONFIG_OCFS2_FS is not set
1376# CONFIG_BTRFS_FS is not set 1455# CONFIG_BTRFS_FS is not set
1456# CONFIG_NILFS2_FS is not set
1457CONFIG_FILE_LOCKING=y
1458CONFIG_FSNOTIFY=y
1377CONFIG_DNOTIFY=y 1459CONFIG_DNOTIFY=y
1378CONFIG_INOTIFY=y 1460CONFIG_INOTIFY=y
1379CONFIG_INOTIFY_USER=y 1461CONFIG_INOTIFY_USER=y
@@ -1446,7 +1528,6 @@ CONFIG_CRAMFS=y
1446# CONFIG_ROMFS_FS is not set 1528# CONFIG_ROMFS_FS is not set
1447# CONFIG_SYSV_FS is not set 1529# CONFIG_SYSV_FS is not set
1448# CONFIG_UFS_FS is not set 1530# CONFIG_UFS_FS is not set
1449# CONFIG_NILFS2_FS is not set
1450CONFIG_NETWORK_FILESYSTEMS=y 1531CONFIG_NETWORK_FILESYSTEMS=y
1451CONFIG_NFS_FS=y 1532CONFIG_NFS_FS=y
1452CONFIG_NFS_V3=y 1533CONFIG_NFS_V3=y
@@ -1537,6 +1618,7 @@ CONFIG_ENABLE_WARN_DEPRECATED=y
1537CONFIG_ENABLE_MUST_CHECK=y 1618CONFIG_ENABLE_MUST_CHECK=y
1538CONFIG_FRAME_WARN=1024 1619CONFIG_FRAME_WARN=1024
1539CONFIG_MAGIC_SYSRQ=y 1620CONFIG_MAGIC_SYSRQ=y
1621# CONFIG_STRIP_ASM_SYMS is not set
1540# CONFIG_UNUSED_SYMBOLS is not set 1622# CONFIG_UNUSED_SYMBOLS is not set
1541CONFIG_DEBUG_FS=y 1623CONFIG_DEBUG_FS=y
1542# CONFIG_HEADERS_CHECK is not set 1624# CONFIG_HEADERS_CHECK is not set
@@ -1552,6 +1634,7 @@ CONFIG_SCHED_DEBUG=y
1552CONFIG_SCHEDSTATS=y 1634CONFIG_SCHEDSTATS=y
1553# CONFIG_TIMER_STATS is not set 1635# CONFIG_TIMER_STATS is not set
1554# CONFIG_DEBUG_OBJECTS is not set 1636# CONFIG_DEBUG_OBJECTS is not set
1637# CONFIG_DEBUG_KMEMLEAK is not set
1555CONFIG_DEBUG_PREEMPT=y 1638CONFIG_DEBUG_PREEMPT=y
1556# CONFIG_DEBUG_RT_MUTEXES is not set 1639# CONFIG_DEBUG_RT_MUTEXES is not set
1557# CONFIG_RT_MUTEX_TESTER is not set 1640# CONFIG_RT_MUTEX_TESTER is not set
@@ -1572,6 +1655,7 @@ CONFIG_DEBUG_INFO=y
1572# CONFIG_DEBUG_LIST is not set 1655# CONFIG_DEBUG_LIST is not set
1573# CONFIG_DEBUG_SG is not set 1656# CONFIG_DEBUG_SG is not set
1574# CONFIG_DEBUG_NOTIFIERS is not set 1657# CONFIG_DEBUG_NOTIFIERS is not set
1658# CONFIG_DEBUG_CREDENTIALS is not set
1575CONFIG_FRAME_POINTER=y 1659CONFIG_FRAME_POINTER=y
1576# CONFIG_BOOT_PRINTK_DELAY is not set 1660# CONFIG_BOOT_PRINTK_DELAY is not set
1577# CONFIG_RCU_TORTURE_TEST is not set 1661# CONFIG_RCU_TORTURE_TEST is not set
@@ -1579,6 +1663,7 @@ CONFIG_FRAME_POINTER=y
1579# CONFIG_KPROBES_SANITY_TEST is not set 1663# CONFIG_KPROBES_SANITY_TEST is not set
1580# CONFIG_BACKTRACE_SELF_TEST is not set 1664# CONFIG_BACKTRACE_SELF_TEST is not set
1581# CONFIG_DEBUG_BLOCK_EXT_DEVT is not set 1665# CONFIG_DEBUG_BLOCK_EXT_DEVT is not set
1666# CONFIG_DEBUG_FORCE_WEAK_PER_CPU is not set
1582# CONFIG_LKDTM is not set 1667# CONFIG_LKDTM is not set
1583# CONFIG_FAULT_INJECTION is not set 1668# CONFIG_FAULT_INJECTION is not set
1584CONFIG_LATENCYTOP=y 1669CONFIG_LATENCYTOP=y
@@ -1587,25 +1672,12 @@ CONFIG_SYSCTL_SYSCALL_CHECK=y
1587CONFIG_NOP_TRACER=y 1672CONFIG_NOP_TRACER=y
1588CONFIG_HAVE_FUNCTION_TRACER=y 1673CONFIG_HAVE_FUNCTION_TRACER=y
1589CONFIG_RING_BUFFER=y 1674CONFIG_RING_BUFFER=y
1675CONFIG_EVENT_TRACING=y
1676CONFIG_CONTEXT_SWITCH_TRACER=y
1677CONFIG_RING_BUFFER_ALLOW_SWAP=y
1590CONFIG_TRACING=y 1678CONFIG_TRACING=y
1591CONFIG_TRACING_SUPPORT=y 1679CONFIG_TRACING_SUPPORT=y
1592 1680# CONFIG_FTRACE is not set
1593#
1594# Tracers
1595#
1596# CONFIG_FUNCTION_TRACER is not set
1597# CONFIG_IRQSOFF_TRACER is not set
1598# CONFIG_PREEMPT_TRACER is not set
1599# CONFIG_SCHED_TRACER is not set
1600# CONFIG_CONTEXT_SWITCH_TRACER is not set
1601# CONFIG_EVENT_TRACER is not set
1602# CONFIG_BOOT_TRACER is not set
1603# CONFIG_TRACE_BRANCH_PROFILING is not set
1604# CONFIG_STACK_TRACER is not set
1605# CONFIG_KMEMTRACE is not set
1606# CONFIG_WORKQUEUE_TRACER is not set
1607# CONFIG_BLK_DEV_IO_TRACE is not set
1608# CONFIG_FTRACE_STARTUP_TEST is not set
1609# CONFIG_DYNAMIC_DEBUG is not set 1681# CONFIG_DYNAMIC_DEBUG is not set
1610# CONFIG_SAMPLES is not set 1682# CONFIG_SAMPLES is not set
1611CONFIG_HAVE_ARCH_KGDB=y 1683CONFIG_HAVE_ARCH_KGDB=y
@@ -1629,20 +1701,19 @@ CONFIG_CRYPTO=y
1629# 1701#
1630# Crypto core or helper 1702# Crypto core or helper
1631# 1703#
1632# CONFIG_CRYPTO_FIPS is not set 1704CONFIG_CRYPTO_ALGAPI=y
1633CONFIG_CRYPTO_ALGAPI=m 1705CONFIG_CRYPTO_ALGAPI2=y
1634CONFIG_CRYPTO_ALGAPI2=m 1706CONFIG_CRYPTO_AEAD2=y
1635CONFIG_CRYPTO_AEAD2=m
1636CONFIG_CRYPTO_BLKCIPHER=m 1707CONFIG_CRYPTO_BLKCIPHER=m
1637CONFIG_CRYPTO_BLKCIPHER2=m 1708CONFIG_CRYPTO_BLKCIPHER2=y
1638CONFIG_CRYPTO_HASH2=m 1709CONFIG_CRYPTO_HASH2=y
1639CONFIG_CRYPTO_RNG2=m 1710CONFIG_CRYPTO_RNG2=y
1640CONFIG_CRYPTO_PCOMP=m 1711CONFIG_CRYPTO_PCOMP=y
1641CONFIG_CRYPTO_MANAGER=m 1712CONFIG_CRYPTO_MANAGER=m
1642CONFIG_CRYPTO_MANAGER2=m 1713CONFIG_CRYPTO_MANAGER2=y
1643# CONFIG_CRYPTO_GF128MUL is not set 1714# CONFIG_CRYPTO_GF128MUL is not set
1644# CONFIG_CRYPTO_NULL is not set 1715# CONFIG_CRYPTO_NULL is not set
1645CONFIG_CRYPTO_WORKQUEUE=m 1716CONFIG_CRYPTO_WORKQUEUE=y
1646# CONFIG_CRYPTO_CRYPTD is not set 1717# CONFIG_CRYPTO_CRYPTD is not set
1647# CONFIG_CRYPTO_AUTHENC is not set 1718# CONFIG_CRYPTO_AUTHENC is not set
1648# CONFIG_CRYPTO_TEST is not set 1719# CONFIG_CRYPTO_TEST is not set
@@ -1670,11 +1741,13 @@ CONFIG_CRYPTO_PCBC=m
1670# 1741#
1671# CONFIG_CRYPTO_HMAC is not set 1742# CONFIG_CRYPTO_HMAC is not set
1672# CONFIG_CRYPTO_XCBC is not set 1743# CONFIG_CRYPTO_XCBC is not set
1744# CONFIG_CRYPTO_VMAC is not set
1673 1745
1674# 1746#
1675# Digest 1747# Digest
1676# 1748#
1677# CONFIG_CRYPTO_CRC32C is not set 1749# CONFIG_CRYPTO_CRC32C is not set
1750# CONFIG_CRYPTO_GHASH is not set
1678# CONFIG_CRYPTO_MD4 is not set 1751# CONFIG_CRYPTO_MD4 is not set
1679# CONFIG_CRYPTO_MD5 is not set 1752# CONFIG_CRYPTO_MD5 is not set
1680# CONFIG_CRYPTO_MICHAEL_MIC is not set 1753# CONFIG_CRYPTO_MICHAEL_MIC is not set
@@ -1691,7 +1764,7 @@ CONFIG_CRYPTO_PCBC=m
1691# 1764#
1692# Ciphers 1765# Ciphers
1693# 1766#
1694# CONFIG_CRYPTO_AES is not set 1767CONFIG_CRYPTO_AES=y
1695# CONFIG_CRYPTO_ANUBIS is not set 1768# CONFIG_CRYPTO_ANUBIS is not set
1696# CONFIG_CRYPTO_ARC4 is not set 1769# CONFIG_CRYPTO_ARC4 is not set
1697# CONFIG_CRYPTO_BLOWFISH is not set 1770# CONFIG_CRYPTO_BLOWFISH is not set
@@ -1719,6 +1792,7 @@ CONFIG_CRYPTO_PCBC=m
1719# 1792#
1720# CONFIG_CRYPTO_ANSI_CPRNG is not set 1793# CONFIG_CRYPTO_ANSI_CPRNG is not set
1721CONFIG_CRYPTO_HW=y 1794CONFIG_CRYPTO_HW=y
1795CONFIG_CRYPTO_DEV_MV_CESA=y
1722# CONFIG_CRYPTO_DEV_HIFN_795X is not set 1796# CONFIG_CRYPTO_DEV_HIFN_795X is not set
1723CONFIG_BINARY_PRINTF=y 1797CONFIG_BINARY_PRINTF=y
1724 1798
diff --git a/arch/arm/include/asm/kmap_types.h b/arch/arm/include/asm/kmap_types.h
index d16ec97ec9a9..c019949a5189 100644
--- a/arch/arm/include/asm/kmap_types.h
+++ b/arch/arm/include/asm/kmap_types.h
@@ -22,4 +22,10 @@ enum km_type {
22 KM_TYPE_NR 22 KM_TYPE_NR
23}; 23};
24 24
25#ifdef CONFIG_DEBUG_HIGHMEM
26#define KM_NMI (-1)
27#define KM_NMI_PTE (-1)
28#define KM_IRQ_PTE (-1)
29#endif
30
25#endif 31#endif
diff --git a/arch/arm/include/asm/unistd.h b/arch/arm/include/asm/unistd.h
index 7020217fc49f..4e506d09e5f9 100644
--- a/arch/arm/include/asm/unistd.h
+++ b/arch/arm/include/asm/unistd.h
@@ -403,6 +403,15 @@
403#define __ARM_NR_set_tls (__ARM_NR_BASE+5) 403#define __ARM_NR_set_tls (__ARM_NR_BASE+5)
404 404
405/* 405/*
406 * *NOTE*: This is a ghost syscall private to the kernel. Only the
407 * __kuser_cmpxchg code in entry-armv.S should be aware of its
408 * existence. Don't ever use this from user code.
409 */
410#ifdef __KERNEL__
411#define __ARM_NR_cmpxchg (__ARM_NR_BASE+0x00fff0)
412#endif
413
414/*
406 * The following syscalls are obsolete and no longer available for EABI. 415 * The following syscalls are obsolete and no longer available for EABI.
407 */ 416 */
408#if defined(__ARM_EABI__) && !defined(__KERNEL__) 417#if defined(__ARM_EABI__) && !defined(__KERNEL__)
diff --git a/arch/arm/kernel/entry-armv.S b/arch/arm/kernel/entry-armv.S
index 0022b4d57f8b..d2903e3bc861 100644
--- a/arch/arm/kernel/entry-armv.S
+++ b/arch/arm/kernel/entry-armv.S
@@ -21,6 +21,7 @@
21#include <mach/entry-macro.S> 21#include <mach/entry-macro.S>
22#include <asm/thread_notify.h> 22#include <asm/thread_notify.h>
23#include <asm/unwind.h> 23#include <asm/unwind.h>
24#include <asm/unistd.h>
24 25
25#include "entry-header.S" 26#include "entry-header.S"
26 27
@@ -908,10 +909,10 @@ __kuser_cmpxchg: @ 0xffff0fc0
908 * A special ghost syscall is used for that (see traps.c). 909 * A special ghost syscall is used for that (see traps.c).
909 */ 910 */
910 stmfd sp!, {r7, lr} 911 stmfd sp!, {r7, lr}
911 mov r7, #0xff00 @ 0xfff0 into r7 for EABI 912 ldr r7, =1f @ it's 20 bits
912 orr r7, r7, #0xf0 913 swi __ARM_NR_cmpxchg
913 swi #0x9ffff0
914 ldmfd sp!, {r7, pc} 914 ldmfd sp!, {r7, pc}
9151: .word __ARM_NR_cmpxchg
915 916
916#elif __LINUX_ARM_ARCH__ < 6 917#elif __LINUX_ARM_ARCH__ < 6
917 918
diff --git a/arch/arm/kernel/head-common.S b/arch/arm/kernel/head-common.S
index 885a7214418d..b9505aa267c0 100644
--- a/arch/arm/kernel/head-common.S
+++ b/arch/arm/kernel/head-common.S
@@ -97,7 +97,7 @@ __error_a:
97 bl printhex8 97 bl printhex8
98 adr r0, str_a2 98 adr r0, str_a2
99 bl printascii 99 bl printascii
100 adr r3, 3f 100 adr r3, 4f
101 ldmia r3, {r4, r5, r6} @ get machine desc list 101 ldmia r3, {r4, r5, r6} @ get machine desc list
102 sub r4, r3, r4 @ get offset between virt&phys 102 sub r4, r3, r4 @ get offset between virt&phys
103 add r5, r5, r4 @ convert virt addresses to 103 add r5, r5, r4 @ convert virt addresses to
diff --git a/arch/arm/kernel/signal.c b/arch/arm/kernel/signal.c
index 2a573d4fea24..e7714f367eb8 100644
--- a/arch/arm/kernel/signal.c
+++ b/arch/arm/kernel/signal.c
@@ -662,8 +662,12 @@ static void do_signal(struct pt_regs *regs, int syscall)
662 regs->ARM_sp -= 4; 662 regs->ARM_sp -= 4;
663 usp = (u32 __user *)regs->ARM_sp; 663 usp = (u32 __user *)regs->ARM_sp;
664 664
665 put_user(regs->ARM_pc, usp); 665 if (put_user(regs->ARM_pc, usp) == 0) {
666 regs->ARM_pc = KERN_RESTART_CODE; 666 regs->ARM_pc = KERN_RESTART_CODE;
667 } else {
668 regs->ARM_sp += 4;
669 force_sigsegv(0, current);
670 }
667#endif 671#endif
668 } 672 }
669 } 673 }
diff --git a/arch/arm/kernel/smp_scu.c b/arch/arm/kernel/smp_scu.c
index d3831f616ee9..9ab4149bd983 100644
--- a/arch/arm/kernel/smp_scu.c
+++ b/arch/arm/kernel/smp_scu.c
@@ -37,6 +37,10 @@ void __init scu_enable(void __iomem *scu_base)
37 u32 scu_ctrl; 37 u32 scu_ctrl;
38 38
39 scu_ctrl = __raw_readl(scu_base + SCU_CTRL); 39 scu_ctrl = __raw_readl(scu_base + SCU_CTRL);
40 /* already enabled? */
41 if (scu_ctrl & 1)
42 return;
43
40 scu_ctrl |= 1; 44 scu_ctrl |= 1;
41 __raw_writel(scu_ctrl, scu_base + SCU_CTRL); 45 __raw_writel(scu_ctrl, scu_base + SCU_CTRL);
42 46
diff --git a/arch/arm/kernel/traps.c b/arch/arm/kernel/traps.c
index 95718a6b50a6..3f361a783f43 100644
--- a/arch/arm/kernel/traps.c
+++ b/arch/arm/kernel/traps.c
@@ -528,7 +528,7 @@ asmlinkage int arm_syscall(int no, struct pt_regs *regs)
528 * __kuser_cmpxchg code in entry-armv.S should be aware of its 528 * __kuser_cmpxchg code in entry-armv.S should be aware of its
529 * existence. Don't ever use this from user code. 529 * existence. Don't ever use this from user code.
530 */ 530 */
531 case 0xfff0: 531 case NR(cmpxchg):
532 for (;;) { 532 for (;;) {
533 extern void do_DataAbort(unsigned long addr, unsigned int fsr, 533 extern void do_DataAbort(unsigned long addr, unsigned int fsr,
534 struct pt_regs *regs); 534 struct pt_regs *regs);
@@ -573,7 +573,7 @@ asmlinkage int arm_syscall(int no, struct pt_regs *regs)
573 if not implemented, rather than raising SIGILL. This 573 if not implemented, rather than raising SIGILL. This
574 way the calling program can gracefully determine whether 574 way the calling program can gracefully determine whether
575 a feature is supported. */ 575 a feature is supported. */
576 if (no <= 0x7ff) 576 if ((no & 0xffff) <= 0x7ff)
577 return -ENOSYS; 577 return -ENOSYS;
578 break; 578 break;
579 } 579 }
diff --git a/arch/arm/mach-at91/Kconfig b/arch/arm/mach-at91/Kconfig
index e35d54d43e70..2fd88437348b 100644
--- a/arch/arm/mach-at91/Kconfig
+++ b/arch/arm/mach-at91/Kconfig
@@ -289,13 +289,6 @@ config MACH_NEOCORE926
289 help 289 help
290 Select this if you are using the Adeneo Neocore 926 board. 290 Select this if you are using the Adeneo Neocore 926 board.
291 291
292config MACH_AT91SAM9G20EK_2MMC
293 bool "Atmel AT91SAM9G20-EK Evaluation Kit modified for 2 MMC Slots"
294 depends on ARCH_AT91SAM9G20
295 help
296 Select this if you are using an Atmel AT91SAM9G20-EK Evaluation Kit
297 Rev A or B modified for 2 MMC Slots.
298
299endif 292endif
300 293
301# ---------------------------------------------------------- 294# ----------------------------------------------------------
@@ -322,7 +315,16 @@ config MACH_AT91SAM9G20EK
322 bool "Atmel AT91SAM9G20-EK Evaluation Kit" 315 bool "Atmel AT91SAM9G20-EK Evaluation Kit"
323 depends on ARCH_AT91SAM9G20 316 depends on ARCH_AT91SAM9G20
324 help 317 help
325 Select this if you are using Atmel's AT91SAM9G20-EK Evaluation Kit. 318 Select this if you are using Atmel's AT91SAM9G20-EK Evaluation Kit
319 that embeds only one SD/MMC slot.
320
321config MACH_AT91SAM9G20EK_2MMC
322 bool "Atmel AT91SAM9G20-EK Evaluation Kit with 2 SD/MMC Slots"
323 depends on ARCH_AT91SAM9G20
324 help
325 Select this if you are using an Atmel AT91SAM9G20-EK Evaluation Kit
326 with 2 SD/MMC Slots. This is the case for AT91SAM9G20-EK rev. C and
327 onwards.
326 328
327config MACH_CPU9G20 329config MACH_CPU9G20
328 bool "Eukrea CPU9G20 board" 330 bool "Eukrea CPU9G20 board"
@@ -392,7 +394,7 @@ config MTD_AT91_DATAFLASH_CARD
392 394
393config MTD_NAND_ATMEL_BUSWIDTH_16 395config MTD_NAND_ATMEL_BUSWIDTH_16
394 bool "Enable 16-bit data bus interface to NAND flash" 396 bool "Enable 16-bit data bus interface to NAND flash"
395 depends on (MACH_AT91SAM9260EK || MACH_AT91SAM9261EK || MACH_AT91SAM9G10EK || MACH_AT91SAM9263EK || MACH_AT91SAM9G20EK || MACH_AT91SAM9G45EKES || MACH_AT91CAP9ADK) 397 depends on (MACH_AT91SAM9260EK || MACH_AT91SAM9261EK || MACH_AT91SAM9G10EK || MACH_AT91SAM9263EK || MACH_AT91SAM9G20EK || MACH_AT91SAM9G20EK_2MMC || MACH_AT91SAM9G45EKES || MACH_AT91CAP9ADK)
396 help 398 help
397 On AT91SAM926x boards both types of NAND flash can be present 399 On AT91SAM926x boards both types of NAND flash can be present
398 (8 and 16 bit data bus width). 400 (8 and 16 bit data bus width).
diff --git a/arch/arm/mach-at91/board-sam9g20ek-2slot-mmc.c b/arch/arm/mach-at91/board-sam9g20ek-2slot-mmc.c
index a28e53faf71d..a4102d72cc9b 100644
--- a/arch/arm/mach-at91/board-sam9g20ek-2slot-mmc.c
+++ b/arch/arm/mach-at91/board-sam9g20ek-2slot-mmc.c
@@ -90,7 +90,7 @@ static struct at91_udc_data __initdata ek_udc_data = {
90 * SPI devices. 90 * SPI devices.
91 */ 91 */
92static struct spi_board_info ek_spi_devices[] = { 92static struct spi_board_info ek_spi_devices[] = {
93#if !defined(CONFIG_MMC_ATMELMCI) 93#if !(defined(CONFIG_MMC_ATMELMCI) || defined(CONFIG_MMC_AT91))
94 { /* DataFlash chip */ 94 { /* DataFlash chip */
95 .modalias = "mtd_dataflash", 95 .modalias = "mtd_dataflash",
96 .chip_select = 1, 96 .chip_select = 1,
@@ -113,7 +113,7 @@ static struct spi_board_info ek_spi_devices[] = {
113 * MACB Ethernet device 113 * MACB Ethernet device
114 */ 114 */
115static struct at91_eth_data __initdata ek_macb_data = { 115static struct at91_eth_data __initdata ek_macb_data = {
116 .phy_irq_pin = AT91_PIN_PC12, 116 .phy_irq_pin = AT91_PIN_PB0,
117 .is_rmii = 1, 117 .is_rmii = 1,
118}; 118};
119 119
@@ -194,24 +194,27 @@ static void __init ek_add_device_nand(void)
194 194
195/* 195/*
196 * MCI (SD/MMC) 196 * MCI (SD/MMC)
197 * det_pin and wp_pin are not connected 197 * wp_pin is not connected
198 */ 198 */
199#if defined(CONFIG_MMC_ATMELMCI) || defined(CONFIG_MMC_ATMELMCI_MODULE) 199#if defined(CONFIG_MMC_ATMELMCI) || defined(CONFIG_MMC_ATMELMCI_MODULE)
200static struct mci_platform_data __initdata ek_mmc_data = { 200static struct mci_platform_data __initdata ek_mmc_data = {
201 .slot[0] = { 201 .slot[0] = {
202 .bus_width = 4, 202 .bus_width = 4,
203 .detect_pin = -ENODEV, 203 .detect_pin = AT91_PIN_PC2,
204 .wp_pin = -ENODEV, 204 .wp_pin = -ENODEV,
205 }, 205 },
206 .slot[1] = { 206 .slot[1] = {
207 .bus_width = 4, 207 .bus_width = 4,
208 .detect_pin = -ENODEV, 208 .detect_pin = AT91_PIN_PC9,
209 .wp_pin = -ENODEV, 209 .wp_pin = -ENODEV,
210 }, 210 },
211 211
212}; 212};
213#else 213#else
214static struct amci_platform_data __initdata ek_mmc_data = { 214static struct at91_mmc_data __initdata ek_mmc_data = {
215 .slot_b = 1, /* Only one slot so use slot B */
216 .wire4 = 1,
217 .det_pin = AT91_PIN_PC9,
215}; 218};
216#endif 219#endif
217 220
@@ -221,13 +224,13 @@ static struct amci_platform_data __initdata ek_mmc_data = {
221static struct gpio_led ek_leds[] = { 224static struct gpio_led ek_leds[] = {
222 { /* "bottom" led, green, userled1 to be defined */ 225 { /* "bottom" led, green, userled1 to be defined */
223 .name = "ds5", 226 .name = "ds5",
224 .gpio = AT91_PIN_PB12, 227 .gpio = AT91_PIN_PB8,
225 .active_low = 1, 228 .active_low = 1,
226 .default_trigger = "none", 229 .default_trigger = "none",
227 }, 230 },
228 { /* "power" led, yellow */ 231 { /* "power" led, yellow */
229 .name = "ds1", 232 .name = "ds1",
230 .gpio = AT91_PIN_PB13, 233 .gpio = AT91_PIN_PB9,
231 .default_trigger = "heartbeat", 234 .default_trigger = "heartbeat",
232 } 235 }
233}; 236};
@@ -254,7 +257,11 @@ static void __init ek_board_init(void)
254 /* Ethernet */ 257 /* Ethernet */
255 at91_add_device_eth(&ek_macb_data); 258 at91_add_device_eth(&ek_macb_data);
256 /* MMC */ 259 /* MMC */
260#if defined(CONFIG_MMC_ATMELMCI) || defined(CONFIG_MMC_ATMELMCI_MODULE)
257 at91_add_device_mci(0, &ek_mmc_data); 261 at91_add_device_mci(0, &ek_mmc_data);
262#else
263 at91_add_device_mmc(0, &ek_mmc_data);
264#endif
258 /* I2C */ 265 /* I2C */
259 at91_add_device_i2c(ek_i2c_devices, ARRAY_SIZE(ek_i2c_devices)); 266 at91_add_device_i2c(ek_i2c_devices, ARRAY_SIZE(ek_i2c_devices));
260 /* LEDs */ 267 /* LEDs */
diff --git a/arch/arm/mach-at91/include/mach/cpu.h b/arch/arm/mach-at91/include/mach/cpu.h
index 34a9502c48bc..c22df30ed5e5 100644
--- a/arch/arm/mach-at91/include/mach/cpu.h
+++ b/arch/arm/mach-at91/include/mach/cpu.h
@@ -25,6 +25,8 @@
25#define ARCH_ID_AT91SAM9G20 0x019905a0 25#define ARCH_ID_AT91SAM9G20 0x019905a0
26#define ARCH_ID_AT91SAM9RL64 0x019b03a0 26#define ARCH_ID_AT91SAM9RL64 0x019b03a0
27#define ARCH_ID_AT91SAM9G45 0x819b05a0 27#define ARCH_ID_AT91SAM9G45 0x819b05a0
28#define ARCH_ID_AT91SAM9G45MRL 0x819b05a2 /* aka 9G45-ES2 & non ES lots */
29#define ARCH_ID_AT91SAM9G45ES 0x819b05a1 /* 9G45-ES (Engineering Sample) */
28#define ARCH_ID_AT91CAP9 0x039A03A0 30#define ARCH_ID_AT91CAP9 0x039A03A0
29 31
30#define ARCH_ID_AT91SAM9XE128 0x329973a0 32#define ARCH_ID_AT91SAM9XE128 0x329973a0
@@ -41,6 +43,11 @@ static inline unsigned long at91_cpu_identify(void)
41 return (at91_sys_read(AT91_DBGU_CIDR) & ~AT91_CIDR_VERSION); 43 return (at91_sys_read(AT91_DBGU_CIDR) & ~AT91_CIDR_VERSION);
42} 44}
43 45
46static inline unsigned long at91_cpu_fully_identify(void)
47{
48 return at91_sys_read(AT91_DBGU_CIDR);
49}
50
44#define ARCH_EXID_AT91SAM9M11 0x00000001 51#define ARCH_EXID_AT91SAM9M11 0x00000001
45#define ARCH_EXID_AT91SAM9M10 0x00000002 52#define ARCH_EXID_AT91SAM9M10 0x00000002
46#define ARCH_EXID_AT91SAM9G45 0x00000004 53#define ARCH_EXID_AT91SAM9G45 0x00000004
@@ -118,8 +125,10 @@ static inline unsigned long at91cap9_rev_identify(void)
118 125
119#ifdef CONFIG_ARCH_AT91SAM9G45 126#ifdef CONFIG_ARCH_AT91SAM9G45
120#define cpu_is_at91sam9g45() (at91_cpu_identify() == ARCH_ID_AT91SAM9G45) 127#define cpu_is_at91sam9g45() (at91_cpu_identify() == ARCH_ID_AT91SAM9G45)
128#define cpu_is_at91sam9g45es() (at91_cpu_fully_identify() == ARCH_ID_AT91SAM9G45ES)
121#else 129#else
122#define cpu_is_at91sam9g45() (0) 130#define cpu_is_at91sam9g45() (0)
131#define cpu_is_at91sam9g45es() (0)
123#endif 132#endif
124 133
125#ifdef CONFIG_ARCH_AT91CAP9 134#ifdef CONFIG_ARCH_AT91CAP9
diff --git a/arch/arm/mach-ep93xx/micro9.c b/arch/arm/mach-ep93xx/micro9.c
index d83b80478b09..f3757a1c5a10 100644
--- a/arch/arm/mach-ep93xx/micro9.c
+++ b/arch/arm/mach-ep93xx/micro9.c
@@ -15,6 +15,7 @@
15#include <linux/init.h> 15#include <linux/init.h>
16#include <linux/platform_device.h> 16#include <linux/platform_device.h>
17#include <linux/mtd/physmap.h> 17#include <linux/mtd/physmap.h>
18#include <linux/io.h>
18 19
19#include <mach/hardware.h> 20#include <mach/hardware.h>
20 21
diff --git a/arch/arm/mach-kirkwood/addr-map.c b/arch/arm/mach-kirkwood/addr-map.c
index 1da5d1c18ecb..2e69168fc699 100644
--- a/arch/arm/mach-kirkwood/addr-map.c
+++ b/arch/arm/mach-kirkwood/addr-map.c
@@ -105,7 +105,7 @@ void __init kirkwood_setup_cpu_mbus(void)
105 setup_cpu_win(0, KIRKWOOD_PCIE_IO_PHYS_BASE, KIRKWOOD_PCIE_IO_SIZE, 105 setup_cpu_win(0, KIRKWOOD_PCIE_IO_PHYS_BASE, KIRKWOOD_PCIE_IO_SIZE,
106 TARGET_PCIE, ATTR_PCIE_IO, KIRKWOOD_PCIE_IO_BUS_BASE); 106 TARGET_PCIE, ATTR_PCIE_IO, KIRKWOOD_PCIE_IO_BUS_BASE);
107 setup_cpu_win(1, KIRKWOOD_PCIE_MEM_PHYS_BASE, KIRKWOOD_PCIE_MEM_SIZE, 107 setup_cpu_win(1, KIRKWOOD_PCIE_MEM_PHYS_BASE, KIRKWOOD_PCIE_MEM_SIZE,
108 TARGET_PCIE, ATTR_PCIE_MEM, -1); 108 TARGET_PCIE, ATTR_PCIE_MEM, KIRKWOOD_PCIE_MEM_BUS_BASE);
109 109
110 /* 110 /*
111 * Setup window for NAND controller. 111 * Setup window for NAND controller.
diff --git a/arch/arm/mach-kirkwood/common.c b/arch/arm/mach-kirkwood/common.c
index 0acb61f3c10b..242dd0775343 100644
--- a/arch/arm/mach-kirkwood/common.c
+++ b/arch/arm/mach-kirkwood/common.c
@@ -845,7 +845,7 @@ int __init kirkwood_find_tclk(void)
845 return 166666667; 845 return 166666667;
846} 846}
847 847
848static void kirkwood_timer_init(void) 848static void __init kirkwood_timer_init(void)
849{ 849{
850 kirkwood_tclk = kirkwood_find_tclk(); 850 kirkwood_tclk = kirkwood_find_tclk();
851 orion_time_init(IRQ_KIRKWOOD_BRIDGE, kirkwood_tclk); 851 orion_time_init(IRQ_KIRKWOOD_BRIDGE, kirkwood_tclk);
@@ -915,6 +915,14 @@ void __init kirkwood_init(void)
915 kirkwood_uart0_data[0].uartclk = kirkwood_tclk; 915 kirkwood_uart0_data[0].uartclk = kirkwood_tclk;
916 kirkwood_uart1_data[0].uartclk = kirkwood_tclk; 916 kirkwood_uart1_data[0].uartclk = kirkwood_tclk;
917 917
918 /*
919 * Disable propagation of mbus errors to the CPU local bus,
920 * as this causes mbus errors (which can occur for example
921 * for PCI aborts) to throw CPU aborts, which we're not set
922 * up to deal with.
923 */
924 writel(readl(CPU_CONFIG) & ~CPU_CONFIG_ERROR_PROP, CPU_CONFIG);
925
918 kirkwood_setup_cpu_mbus(); 926 kirkwood_setup_cpu_mbus();
919 927
920#ifdef CONFIG_CACHE_FEROCEON_L2 928#ifdef CONFIG_CACHE_FEROCEON_L2
diff --git a/arch/arm/mach-kirkwood/include/mach/bridge-regs.h b/arch/arm/mach-kirkwood/include/mach/bridge-regs.h
index 9e80d9232c83..418f5017c50e 100644
--- a/arch/arm/mach-kirkwood/include/mach/bridge-regs.h
+++ b/arch/arm/mach-kirkwood/include/mach/bridge-regs.h
@@ -13,6 +13,9 @@
13 13
14#include <mach/kirkwood.h> 14#include <mach/kirkwood.h>
15 15
16#define CPU_CONFIG (BRIDGE_VIRT_BASE | 0x0100)
17#define CPU_CONFIG_ERROR_PROP 0x00000004
18
16#define CPU_CONTROL (BRIDGE_VIRT_BASE | 0x0104) 19#define CPU_CONTROL (BRIDGE_VIRT_BASE | 0x0104)
17#define CPU_RESET 0x00000002 20#define CPU_RESET 0x00000002
18 21
diff --git a/arch/arm/mach-kirkwood/include/mach/io.h b/arch/arm/mach-kirkwood/include/mach/io.h
index a643a846d5fb..44e8be04f259 100644
--- a/arch/arm/mach-kirkwood/include/mach/io.h
+++ b/arch/arm/mach-kirkwood/include/mach/io.h
@@ -15,7 +15,7 @@
15 15
16static inline void __iomem *__io(unsigned long addr) 16static inline void __iomem *__io(unsigned long addr)
17{ 17{
18 return (void __iomem *)((addr - KIRKWOOD_PCIE_IO_PHYS_BASE) 18 return (void __iomem *)((addr - KIRKWOOD_PCIE_IO_BUS_BASE)
19 + KIRKWOOD_PCIE_IO_VIRT_BASE); 19 + KIRKWOOD_PCIE_IO_VIRT_BASE);
20} 20}
21 21
diff --git a/arch/arm/mach-kirkwood/include/mach/kirkwood.h b/arch/arm/mach-kirkwood/include/mach/kirkwood.h
index 54c132731d2d..a15cf0ee22bd 100644
--- a/arch/arm/mach-kirkwood/include/mach/kirkwood.h
+++ b/arch/arm/mach-kirkwood/include/mach/kirkwood.h
@@ -43,6 +43,7 @@
43#define KIRKWOOD_REGS_SIZE SZ_1M 43#define KIRKWOOD_REGS_SIZE SZ_1M
44 44
45#define KIRKWOOD_PCIE_MEM_PHYS_BASE 0xe0000000 45#define KIRKWOOD_PCIE_MEM_PHYS_BASE 0xe0000000
46#define KIRKWOOD_PCIE_MEM_BUS_BASE 0xe0000000
46#define KIRKWOOD_PCIE_MEM_SIZE SZ_128M 47#define KIRKWOOD_PCIE_MEM_SIZE SZ_128M
47 48
48/* 49/*
diff --git a/arch/arm/mach-kirkwood/openrd_base-setup.c b/arch/arm/mach-kirkwood/openrd_base-setup.c
index 947dfb8cd5b2..77617c722299 100644
--- a/arch/arm/mach-kirkwood/openrd_base-setup.c
+++ b/arch/arm/mach-kirkwood/openrd_base-setup.c
@@ -70,8 +70,20 @@ static void __init openrd_base_init(void)
70 kirkwood_ge00_init(&openrd_base_ge00_data); 70 kirkwood_ge00_init(&openrd_base_ge00_data);
71 kirkwood_sata_init(&openrd_base_sata_data); 71 kirkwood_sata_init(&openrd_base_sata_data);
72 kirkwood_sdio_init(&openrd_base_mvsdio_data); 72 kirkwood_sdio_init(&openrd_base_mvsdio_data);
73
74 kirkwood_i2c_init();
73} 75}
74 76
77static int __init openrd_base_pci_init(void)
78{
79 if (machine_is_openrd_base())
80 kirkwood_pcie_init();
81
82 return 0;
83 }
84subsys_initcall(openrd_base_pci_init);
85
86
75MACHINE_START(OPENRD_BASE, "Marvell OpenRD Base Board") 87MACHINE_START(OPENRD_BASE, "Marvell OpenRD Base Board")
76 /* Maintainer: Dhaval Vasa <dhaval.vasa@einfochips.com> */ 88 /* Maintainer: Dhaval Vasa <dhaval.vasa@einfochips.com> */
77 .phys_io = KIRKWOOD_REGS_PHYS_BASE, 89 .phys_io = KIRKWOOD_REGS_PHYS_BASE,
diff --git a/arch/arm/mach-kirkwood/pcie.c b/arch/arm/mach-kirkwood/pcie.c
index d90b9aae308d..a604b2a701aa 100644
--- a/arch/arm/mach-kirkwood/pcie.c
+++ b/arch/arm/mach-kirkwood/pcie.c
@@ -93,7 +93,7 @@ static struct pci_ops pcie_ops = {
93}; 93};
94 94
95 95
96static int kirkwood_pcie_setup(int nr, struct pci_sys_data *sys) 96static int __init kirkwood_pcie_setup(int nr, struct pci_sys_data *sys)
97{ 97{
98 struct resource *res; 98 struct resource *res;
99 extern unsigned int kirkwood_clk_ctrl; 99 extern unsigned int kirkwood_clk_ctrl;
@@ -115,7 +115,7 @@ static int kirkwood_pcie_setup(int nr, struct pci_sys_data *sys)
115 */ 115 */
116 res[0].name = "PCIe I/O Space"; 116 res[0].name = "PCIe I/O Space";
117 res[0].flags = IORESOURCE_IO; 117 res[0].flags = IORESOURCE_IO;
118 res[0].start = KIRKWOOD_PCIE_IO_PHYS_BASE; 118 res[0].start = KIRKWOOD_PCIE_IO_BUS_BASE;
119 res[0].end = res[0].start + KIRKWOOD_PCIE_IO_SIZE - 1; 119 res[0].end = res[0].start + KIRKWOOD_PCIE_IO_SIZE - 1;
120 if (request_resource(&ioport_resource, &res[0])) 120 if (request_resource(&ioport_resource, &res[0]))
121 panic("Request PCIe IO resource failed\n"); 121 panic("Request PCIe IO resource failed\n");
@@ -126,7 +126,7 @@ static int kirkwood_pcie_setup(int nr, struct pci_sys_data *sys)
126 */ 126 */
127 res[1].name = "PCIe Memory Space"; 127 res[1].name = "PCIe Memory Space";
128 res[1].flags = IORESOURCE_MEM; 128 res[1].flags = IORESOURCE_MEM;
129 res[1].start = KIRKWOOD_PCIE_MEM_PHYS_BASE; 129 res[1].start = KIRKWOOD_PCIE_MEM_BUS_BASE;
130 res[1].end = res[1].start + KIRKWOOD_PCIE_MEM_SIZE - 1; 130 res[1].end = res[1].start + KIRKWOOD_PCIE_MEM_SIZE - 1;
131 if (request_resource(&iomem_resource, &res[1])) 131 if (request_resource(&iomem_resource, &res[1]))
132 panic("Request PCIe Memory resource failed\n"); 132 panic("Request PCIe Memory resource failed\n");
diff --git a/arch/arm/mach-ks8695/include/mach/regs-switch.h b/arch/arm/mach-ks8695/include/mach/regs-switch.h
index 56d12e8de895..97e8acb1cf6c 100644
--- a/arch/arm/mach-ks8695/include/mach/regs-switch.h
+++ b/arch/arm/mach-ks8695/include/mach/regs-switch.h
@@ -25,7 +25,7 @@
25#define KS8695_SEC1 (0x04) /* Switch Engine Control 1 */ 25#define KS8695_SEC1 (0x04) /* Switch Engine Control 1 */
26#define KS8695_SEC2 (0x08) /* Switch Engine Control 2 */ 26#define KS8695_SEC2 (0x08) /* Switch Engine Control 2 */
27 27
28#define KS8695_P(x)_C(z) (0xc0 + (((x)-1)*3 + ((z)-1))*4) /* Port Configuration Registers */ 28#define KS8695_SEPXCZ(x,z) (0x0c + (((x)-1)*3 + ((z)-1))*4) /* Port Configuration Registers */
29 29
30#define KS8695_SEP12AN (0x48) /* Port 1 & 2 Auto-Negotiation */ 30#define KS8695_SEP12AN (0x48) /* Port 1 & 2 Auto-Negotiation */
31#define KS8695_SEP34AN (0x4c) /* Port 3 & 4 Auto-Negotiation */ 31#define KS8695_SEP34AN (0x4c) /* Port 3 & 4 Auto-Negotiation */
diff --git a/arch/arm/mach-mmp/include/mach/mfp-pxa910.h b/arch/arm/mach-mmp/include/mach/mfp-pxa910.h
index bf1189ff9a34..7e8a80f25ddc 100644
--- a/arch/arm/mach-mmp/include/mach/mfp-pxa910.h
+++ b/arch/arm/mach-mmp/include/mach/mfp-pxa910.h
@@ -160,7 +160,7 @@
160#define MMC1_WP_MMC1_WP MFP_CFG_DRV(MMC1_WP, AF0, MEDIUM) 160#define MMC1_WP_MMC1_WP MFP_CFG_DRV(MMC1_WP, AF0, MEDIUM)
161 161
162/* PWM */ 162/* PWM */
163#define GPIO27 PWM3 AF2 MFP_CFG(GPIO27, AF2) 163#define GPIO27_PWM3_AF2 MFP_CFG(GPIO27, AF2)
164#define GPIO51_PWM2_OUT MFP_CFG(GPIO51, AF2) 164#define GPIO51_PWM2_OUT MFP_CFG(GPIO51, AF2)
165#define GPIO117_PWM1_OUT MFP_CFG(GPIO117, AF2) 165#define GPIO117_PWM1_OUT MFP_CFG(GPIO117, AF2)
166#define GPIO118_PWM2_OUT MFP_CFG(GPIO118, AF2) 166#define GPIO118_PWM2_OUT MFP_CFG(GPIO118, AF2)
diff --git a/arch/arm/mach-mv78xx0/common.c b/arch/arm/mach-mv78xx0/common.c
index 1b22e4af8791..08465eb6a2c2 100644
--- a/arch/arm/mach-mv78xx0/common.c
+++ b/arch/arm/mach-mv78xx0/common.c
@@ -845,6 +845,8 @@ static char * __init mv78xx0_id(void)
845 } else if (dev == MV78100_DEV_ID) { 845 } else if (dev == MV78100_DEV_ID) {
846 if (rev == MV78100_REV_A0) 846 if (rev == MV78100_REV_A0)
847 return "MV78100-A0"; 847 return "MV78100-A0";
848 else if (rev == MV78100_REV_A1)
849 return "MV78100-A1";
848 else 850 else
849 return "MV78100-Rev-Unsupported"; 851 return "MV78100-Rev-Unsupported";
850 } else if (dev == MV78200_DEV_ID) { 852 } else if (dev == MV78200_DEV_ID) {
diff --git a/arch/arm/mach-mv78xx0/include/mach/mv78xx0.h b/arch/arm/mach-mv78xx0/include/mach/mv78xx0.h
index d715b92b0908..788bdace1304 100644
--- a/arch/arm/mach-mv78xx0/include/mach/mv78xx0.h
+++ b/arch/arm/mach-mv78xx0/include/mach/mv78xx0.h
@@ -112,6 +112,7 @@
112 112
113#define MV78100_DEV_ID 0x7810 113#define MV78100_DEV_ID 0x7810
114#define MV78100_REV_A0 1 114#define MV78100_REV_A0 1
115#define MV78100_REV_A1 2
115 116
116#define MV78200_DEV_ID 0x7820 117#define MV78200_DEV_ID 0x7820
117#define MV78200_REV_A0 1 118#define MV78200_REV_A0 1
diff --git a/arch/arm/mach-omap2/board-omap3beagle.c b/arch/arm/mach-omap2/board-omap3beagle.c
index 70df6b4dbcd4..08b0816afa61 100644
--- a/arch/arm/mach-omap2/board-omap3beagle.c
+++ b/arch/arm/mach-omap2/board-omap3beagle.c
@@ -162,7 +162,7 @@ static int beagle_twl_gpio_setup(struct device *dev,
162 162
163 /* TWL4030_GPIO_MAX + 0 == ledA, EHCI nEN_USB_PWR (out, active low) */ 163 /* TWL4030_GPIO_MAX + 0 == ledA, EHCI nEN_USB_PWR (out, active low) */
164 gpio_request(gpio + TWL4030_GPIO_MAX, "nEN_USB_PWR"); 164 gpio_request(gpio + TWL4030_GPIO_MAX, "nEN_USB_PWR");
165 gpio_direction_output(gpio + TWL4030_GPIO_MAX, 1); 165 gpio_direction_output(gpio + TWL4030_GPIO_MAX, 0);
166 166
167 /* TWL4030_GPIO_MAX + 1 == ledB, PMU_STAT (out, active low LED) */ 167 /* TWL4030_GPIO_MAX + 1 == ledB, PMU_STAT (out, active low LED) */
168 gpio_leds[2].gpio = gpio + TWL4030_GPIO_MAX + 1; 168 gpio_leds[2].gpio = gpio + TWL4030_GPIO_MAX + 1;
diff --git a/arch/arm/mach-omap2/board-omap3pandora.c b/arch/arm/mach-omap2/board-omap3pandora.c
index 5326e0d61597..7519edb69155 100644
--- a/arch/arm/mach-omap2/board-omap3pandora.c
+++ b/arch/arm/mach-omap2/board-omap3pandora.c
@@ -134,50 +134,50 @@ static void __init pandora_keys_gpio_init(void)
134} 134}
135 135
136static int board_keymap[] = { 136static int board_keymap[] = {
137 /* col, row, code */ 137 /* row, col, code */
138 KEY(0, 0, KEY_9), 138 KEY(0, 0, KEY_9),
139 KEY(0, 1, KEY_0), 139 KEY(0, 1, KEY_8),
140 KEY(0, 2, KEY_BACKSPACE), 140 KEY(0, 2, KEY_I),
141 KEY(0, 3, KEY_O), 141 KEY(0, 3, KEY_J),
142 KEY(0, 4, KEY_P), 142 KEY(0, 4, KEY_N),
143 KEY(0, 5, KEY_K), 143 KEY(0, 5, KEY_M),
144 KEY(0, 6, KEY_L), 144 KEY(1, 0, KEY_0),
145 KEY(0, 7, KEY_ENTER),
146 KEY(1, 0, KEY_8),
147 KEY(1, 1, KEY_7), 145 KEY(1, 1, KEY_7),
148 KEY(1, 2, KEY_6), 146 KEY(1, 2, KEY_U),
149 KEY(1, 3, KEY_5), 147 KEY(1, 3, KEY_H),
150 KEY(1, 4, KEY_4), 148 KEY(1, 4, KEY_B),
151 KEY(1, 5, KEY_3), 149 KEY(1, 5, KEY_SPACE),
152 KEY(1, 6, KEY_2), 150 KEY(2, 0, KEY_BACKSPACE),
153 KEY(1, 7, KEY_1), 151 KEY(2, 1, KEY_6),
154 KEY(2, 0, KEY_I),
155 KEY(2, 1, KEY_U),
156 KEY(2, 2, KEY_Y), 152 KEY(2, 2, KEY_Y),
157 KEY(2, 3, KEY_T), 153 KEY(2, 3, KEY_G),
158 KEY(2, 4, KEY_R), 154 KEY(2, 4, KEY_V),
159 KEY(2, 5, KEY_E), 155 KEY(2, 5, KEY_FN),
160 KEY(2, 6, KEY_W), 156 KEY(3, 0, KEY_O),
161 KEY(2, 7, KEY_Q), 157 KEY(3, 1, KEY_5),
162 KEY(3, 0, KEY_J), 158 KEY(3, 2, KEY_T),
163 KEY(3, 1, KEY_H),
164 KEY(3, 2, KEY_G),
165 KEY(3, 3, KEY_F), 159 KEY(3, 3, KEY_F),
166 KEY(3, 4, KEY_D), 160 KEY(3, 4, KEY_C),
167 KEY(3, 5, KEY_S), 161 KEY(4, 0, KEY_P),
168 KEY(3, 6, KEY_A), 162 KEY(4, 1, KEY_4),
169 KEY(3, 7, KEY_LEFTSHIFT), 163 KEY(4, 2, KEY_R),
170 KEY(4, 0, KEY_N), 164 KEY(4, 3, KEY_D),
171 KEY(4, 1, KEY_B),
172 KEY(4, 2, KEY_V),
173 KEY(4, 3, KEY_C),
174 KEY(4, 4, KEY_X), 165 KEY(4, 4, KEY_X),
175 KEY(4, 5, KEY_Z), 166 KEY(5, 0, KEY_K),
176 KEY(4, 6, KEY_DOT), 167 KEY(5, 1, KEY_3),
177 KEY(4, 7, KEY_COMMA), 168 KEY(5, 2, KEY_E),
178 KEY(5, 0, KEY_M), 169 KEY(5, 3, KEY_S),
179 KEY(5, 1, KEY_SPACE), 170 KEY(5, 4, KEY_Z),
180 KEY(5, 2, KEY_FN), 171 KEY(6, 0, KEY_L),
172 KEY(6, 1, KEY_2),
173 KEY(6, 2, KEY_W),
174 KEY(6, 3, KEY_A),
175 KEY(6, 4, KEY_DOT),
176 KEY(7, 0, KEY_ENTER),
177 KEY(7, 1, KEY_1),
178 KEY(7, 2, KEY_Q),
179 KEY(7, 3, KEY_LEFTSHIFT),
180 KEY(7, 4, KEY_COMMA),
181}; 181};
182 182
183static struct matrix_keymap_data board_map_data = { 183static struct matrix_keymap_data board_map_data = {
diff --git a/arch/arm/mach-omap2/board-zoom2.c b/arch/arm/mach-omap2/board-zoom2.c
index ea00486a5e53..51e0b3ba5f3a 100644
--- a/arch/arm/mach-omap2/board-zoom2.c
+++ b/arch/arm/mach-omap2/board-zoom2.c
@@ -30,57 +30,56 @@
30/* Zoom2 has Qwerty keyboard*/ 30/* Zoom2 has Qwerty keyboard*/
31static int board_keymap[] = { 31static int board_keymap[] = {
32 KEY(0, 0, KEY_E), 32 KEY(0, 0, KEY_E),
33 KEY(1, 0, KEY_R), 33 KEY(0, 1, KEY_R),
34 KEY(2, 0, KEY_T), 34 KEY(0, 2, KEY_T),
35 KEY(3, 0, KEY_HOME), 35 KEY(0, 3, KEY_HOME),
36 KEY(6, 0, KEY_I), 36 KEY(0, 6, KEY_I),
37 KEY(7, 0, KEY_LEFTSHIFT), 37 KEY(0, 7, KEY_LEFTSHIFT),
38 KEY(0, 1, KEY_D), 38 KEY(1, 0, KEY_D),
39 KEY(1, 1, KEY_F), 39 KEY(1, 1, KEY_F),
40 KEY(2, 1, KEY_G), 40 KEY(1, 2, KEY_G),
41 KEY(3, 1, KEY_SEND), 41 KEY(1, 3, KEY_SEND),
42 KEY(6, 1, KEY_K), 42 KEY(1, 6, KEY_K),
43 KEY(7, 1, KEY_ENTER), 43 KEY(1, 7, KEY_ENTER),
44 KEY(0, 2, KEY_X), 44 KEY(2, 0, KEY_X),
45 KEY(1, 2, KEY_C), 45 KEY(2, 1, KEY_C),
46 KEY(2, 2, KEY_V), 46 KEY(2, 2, KEY_V),
47 KEY(3, 2, KEY_END), 47 KEY(2, 3, KEY_END),
48 KEY(6, 2, KEY_DOT), 48 KEY(2, 6, KEY_DOT),
49 KEY(7, 2, KEY_CAPSLOCK), 49 KEY(2, 7, KEY_CAPSLOCK),
50 KEY(0, 3, KEY_Z), 50 KEY(3, 0, KEY_Z),
51 KEY(1, 3, KEY_KPPLUS), 51 KEY(3, 1, KEY_KPPLUS),
52 KEY(2, 3, KEY_B), 52 KEY(3, 2, KEY_B),
53 KEY(3, 3, KEY_F1), 53 KEY(3, 3, KEY_F1),
54 KEY(6, 3, KEY_O), 54 KEY(3, 6, KEY_O),
55 KEY(7, 3, KEY_SPACE), 55 KEY(3, 7, KEY_SPACE),
56 KEY(0, 4, KEY_W), 56 KEY(4, 0, KEY_W),
57 KEY(1, 4, KEY_Y), 57 KEY(4, 1, KEY_Y),
58 KEY(2, 4, KEY_U), 58 KEY(4, 2, KEY_U),
59 KEY(3, 4, KEY_F2), 59 KEY(4, 3, KEY_F2),
60 KEY(4, 4, KEY_VOLUMEUP), 60 KEY(4, 4, KEY_VOLUMEUP),
61 KEY(6, 4, KEY_L), 61 KEY(4, 6, KEY_L),
62 KEY(7, 4, KEY_LEFT), 62 KEY(4, 7, KEY_LEFT),
63 KEY(0, 5, KEY_S), 63 KEY(5, 0, KEY_S),
64 KEY(1, 5, KEY_H), 64 KEY(5, 1, KEY_H),
65 KEY(2, 5, KEY_J), 65 KEY(5, 2, KEY_J),
66 KEY(3, 5, KEY_F3), 66 KEY(5, 3, KEY_F3),
67 KEY(5, 5, KEY_VOLUMEDOWN), 67 KEY(5, 5, KEY_VOLUMEDOWN),
68 KEY(6, 5, KEY_M), 68 KEY(5, 6, KEY_M),
69 KEY(4, 5, KEY_ENTER), 69 KEY(5, 7, KEY_ENTER),
70 KEY(7, 5, KEY_RIGHT), 70 KEY(6, 0, KEY_Q),
71 KEY(0, 6, KEY_Q), 71 KEY(6, 1, KEY_A),
72 KEY(1, 6, KEY_A), 72 KEY(6, 2, KEY_N),
73 KEY(2, 6, KEY_N), 73 KEY(6, 3, KEY_BACKSPACE),
74 KEY(3, 6, KEY_BACKSPACE),
75 KEY(6, 6, KEY_P), 74 KEY(6, 6, KEY_P),
76 KEY(7, 6, KEY_UP),
77 KEY(6, 7, KEY_SELECT), 75 KEY(6, 7, KEY_SELECT),
78 KEY(7, 7, KEY_DOWN), 76 KEY(7, 0, KEY_PROG1), /*MACRO 1 <User defined> */
79 KEY(0, 7, KEY_PROG1), /*MACRO 1 <User defined> */ 77 KEY(7, 1, KEY_PROG2), /*MACRO 2 <User defined> */
80 KEY(1, 7, KEY_PROG2), /*MACRO 2 <User defined> */ 78 KEY(7, 2, KEY_PROG3), /*MACRO 3 <User defined> */
81 KEY(2, 7, KEY_PROG3), /*MACRO 3 <User defined> */ 79 KEY(7, 3, KEY_PROG4), /*MACRO 4 <User defined> */
82 KEY(3, 7, KEY_PROG4), /*MACRO 4 <User defined> */ 80 KEY(7, 5, KEY_RIGHT),
83 0 81 KEY(7, 6, KEY_UP),
82 KEY(7, 7, KEY_DOWN)
84}; 83};
85 84
86static struct matrix_keymap_data board_map_data = { 85static struct matrix_keymap_data board_map_data = {
diff --git a/arch/arm/mach-omap2/clock34xx.c b/arch/arm/mach-omap2/clock34xx.c
index 489556eecbd1..7c5c00df3c70 100644
--- a/arch/arm/mach-omap2/clock34xx.c
+++ b/arch/arm/mach-omap2/clock34xx.c
@@ -473,7 +473,7 @@ static u16 _omap3_dpll_compute_freqsel(struct clk *clk, u8 n)
473 unsigned long fint; 473 unsigned long fint;
474 u16 f = 0; 474 u16 f = 0;
475 475
476 fint = clk->dpll_data->clk_ref->rate / (n + 1); 476 fint = clk->dpll_data->clk_ref->rate / n;
477 477
478 pr_debug("clock: fint is %lu\n", fint); 478 pr_debug("clock: fint is %lu\n", fint);
479 479
diff --git a/arch/arm/mach-omap2/clock34xx.h b/arch/arm/mach-omap2/clock34xx.h
index c8119781e00a..9565c05bebd2 100644
--- a/arch/arm/mach-omap2/clock34xx.h
+++ b/arch/arm/mach-omap2/clock34xx.h
@@ -489,9 +489,9 @@ static struct clk core_ck = {
489static struct clk dpll3_m2x2_ck = { 489static struct clk dpll3_m2x2_ck = {
490 .name = "dpll3_m2x2_ck", 490 .name = "dpll3_m2x2_ck",
491 .ops = &clkops_null, 491 .ops = &clkops_null,
492 .parent = &dpll3_x2_ck, 492 .parent = &dpll3_m2_ck,
493 .clkdm_name = "dpll3_clkdm", 493 .clkdm_name = "dpll3_clkdm",
494 .recalc = &followparent_recalc, 494 .recalc = &omap3_clkoutx2_recalc,
495}; 495};
496 496
497/* The PWRDN bit is apparently only available on 3430ES2 and above */ 497/* The PWRDN bit is apparently only available on 3430ES2 and above */
diff --git a/arch/arm/mach-omap2/gpmc.c b/arch/arm/mach-omap2/gpmc.c
index 15876828db23..f3c992e29651 100644
--- a/arch/arm/mach-omap2/gpmc.c
+++ b/arch/arm/mach-omap2/gpmc.c
@@ -366,7 +366,7 @@ int gpmc_cs_request(int cs, unsigned long size, unsigned long *base)
366 if (r < 0) 366 if (r < 0)
367 goto out; 367 goto out;
368 368
369 gpmc_cs_enable_mem(cs, res->start, res->end - res->start + 1); 369 gpmc_cs_enable_mem(cs, res->start, resource_size(res));
370 *base = res->start; 370 *base = res->start;
371 gpmc_cs_set_reserved(cs, 1); 371 gpmc_cs_set_reserved(cs, 1);
372out: 372out:
@@ -378,7 +378,7 @@ EXPORT_SYMBOL(gpmc_cs_request);
378void gpmc_cs_free(int cs) 378void gpmc_cs_free(int cs)
379{ 379{
380 spin_lock(&gpmc_mem_lock); 380 spin_lock(&gpmc_mem_lock);
381 if (cs >= GPMC_CS_NUM || !gpmc_cs_reserved(cs)) { 381 if (cs >= GPMC_CS_NUM || cs < 0 || !gpmc_cs_reserved(cs)) {
382 printk(KERN_ERR "Trying to free non-reserved GPMC CS%d\n", cs); 382 printk(KERN_ERR "Trying to free non-reserved GPMC CS%d\n", cs);
383 BUG(); 383 BUG();
384 spin_unlock(&gpmc_mem_lock); 384 spin_unlock(&gpmc_mem_lock);
diff --git a/arch/arm/mach-omap2/mailbox.c b/arch/arm/mach-omap2/mailbox.c
index c035ad3426d0..ef57b38a56a4 100644
--- a/arch/arm/mach-omap2/mailbox.c
+++ b/arch/arm/mach-omap2/mailbox.c
@@ -300,7 +300,7 @@ static int __devinit omap2_mbox_probe(struct platform_device *pdev)
300 dev_err(&pdev->dev, "invalid mem resource\n"); 300 dev_err(&pdev->dev, "invalid mem resource\n");
301 return -ENODEV; 301 return -ENODEV;
302 } 302 }
303 mbox_base = ioremap(res->start, res->end - res->start); 303 mbox_base = ioremap(res->start, resource_size(res));
304 if (!mbox_base) 304 if (!mbox_base)
305 return -ENOMEM; 305 return -ENOMEM;
306 306
diff --git a/arch/arm/mach-pxa/colibri-pxa320.c b/arch/arm/mach-pxa/colibri-pxa320.c
index 494572825c7d..ec0e14b96682 100644
--- a/arch/arm/mach-pxa/colibri-pxa320.c
+++ b/arch/arm/mach-pxa/colibri-pxa320.c
@@ -27,6 +27,7 @@
27#include <mach/colibri.h> 27#include <mach/colibri.h>
28#include <mach/pxafb.h> 28#include <mach/pxafb.h>
29#include <mach/ohci.h> 29#include <mach/ohci.h>
30#include <mach/audio.h>
30 31
31#include "generic.h" 32#include "generic.h"
32#include "devices.h" 33#include "devices.h"
@@ -145,7 +146,8 @@ static void __init colibri_pxa320_init_lcd(void)
145static inline void colibri_pxa320_init_lcd(void) {} 146static inline void colibri_pxa320_init_lcd(void) {}
146#endif 147#endif
147 148
148#if defined(SND_AC97_CODEC) || defined(SND_AC97_CODEC_MODULE) 149#if defined(CONFIG_SND_AC97_CODEC) || \
150 defined(CONFIG_SND_AC97_CODEC_MODULE)
149static mfp_cfg_t colibri_pxa320_ac97_pin_config[] __initdata = { 151static mfp_cfg_t colibri_pxa320_ac97_pin_config[] __initdata = {
150 GPIO34_AC97_SYSCLK, 152 GPIO34_AC97_SYSCLK,
151 GPIO35_AC97_SDATA_IN_0, 153 GPIO35_AC97_SDATA_IN_0,
diff --git a/arch/arm/mach-pxa/cpufreq-pxa2xx.c b/arch/arm/mach-pxa/cpufreq-pxa2xx.c
index 983cc8c20081..9e4d9816726a 100644
--- a/arch/arm/mach-pxa/cpufreq-pxa2xx.c
+++ b/arch/arm/mach-pxa/cpufreq-pxa2xx.c
@@ -447,6 +447,7 @@ static __init int pxa_cpufreq_init(struct cpufreq_policy *policy)
447 pxa27x_freq_table[i].frequency = freq; 447 pxa27x_freq_table[i].frequency = freq;
448 pxa27x_freq_table[i].index = i; 448 pxa27x_freq_table[i].index = i;
449 } 449 }
450 pxa27x_freq_table[i].index = i;
450 pxa27x_freq_table[i].frequency = CPUFREQ_TABLE_END; 451 pxa27x_freq_table[i].frequency = CPUFREQ_TABLE_END;
451 452
452 /* 453 /*
diff --git a/arch/arm/mach-pxa/cpufreq-pxa3xx.c b/arch/arm/mach-pxa/cpufreq-pxa3xx.c
index 67f34a8d8e60..149cdd9aee4d 100644
--- a/arch/arm/mach-pxa/cpufreq-pxa3xx.c
+++ b/arch/arm/mach-pxa/cpufreq-pxa3xx.c
@@ -102,7 +102,7 @@ static int setup_freqs_table(struct cpufreq_policy *policy,
102 table[i].index = i; 102 table[i].index = i;
103 table[i].frequency = freqs[i].cpufreq_mhz * 1000; 103 table[i].frequency = freqs[i].cpufreq_mhz * 1000;
104 } 104 }
105 table[num].frequency = i; 105 table[num].index = i;
106 table[num].frequency = CPUFREQ_TABLE_END; 106 table[num].frequency = CPUFREQ_TABLE_END;
107 107
108 pxa3xx_freqs = freqs; 108 pxa3xx_freqs = freqs;
diff --git a/arch/arm/mach-pxa/hx4700.c b/arch/arm/mach-pxa/hx4700.c
index abff9e132749..83bd3c6e3884 100644
--- a/arch/arm/mach-pxa/hx4700.c
+++ b/arch/arm/mach-pxa/hx4700.c
@@ -604,7 +604,7 @@ static struct platform_device gpio_vbus = {
604static const struct ads7846_platform_data tsc2046_info = { 604static const struct ads7846_platform_data tsc2046_info = {
605 .model = 7846, 605 .model = 7846,
606 .vref_delay_usecs = 100, 606 .vref_delay_usecs = 100,
607 .pressure_max = 512, 607 .pressure_max = 1024,
608 .debounce_max = 10, 608 .debounce_max = 10,
609 .debounce_tol = 3, 609 .debounce_tol = 3,
610 .debounce_rep = 1, 610 .debounce_rep = 1,
diff --git a/arch/arm/mach-pxa/include/mach/entry-macro.S b/arch/arm/mach-pxa/include/mach/entry-macro.S
index 241880608ac6..a73bc86a3c26 100644
--- a/arch/arm/mach-pxa/include/mach/entry-macro.S
+++ b/arch/arm/mach-pxa/include/mach/entry-macro.S
@@ -46,5 +46,6 @@
46 beq 1001f 46 beq 1001f
47 bic \irqstat, \irqstat, #0x80000000 47 bic \irqstat, \irqstat, #0x80000000
48 mov \irqnr, \irqstat, lsr #16 48 mov \irqnr, \irqstat, lsr #16
49 add \irqnr, \irqnr, #(PXA_IRQ(0))
491001: 501001:
50 .endm 51 .endm
diff --git a/arch/arm/mach-pxa/irq.c b/arch/arm/mach-pxa/irq.c
index d694ce289668..6112af431fa4 100644
--- a/arch/arm/mach-pxa/irq.c
+++ b/arch/arm/mach-pxa/irq.c
@@ -25,6 +25,8 @@
25 25
26#include "generic.h" 26#include "generic.h"
27 27
28#define MAX_INTERNAL_IRQS 128
29
28#define IRQ_BIT(n) (((n) - PXA_IRQ(0)) & 0x1f) 30#define IRQ_BIT(n) (((n) - PXA_IRQ(0)) & 0x1f)
29#define _ICMR(n) (*((((n) - PXA_IRQ(0)) & ~0x1f) ? &ICMR2 : &ICMR)) 31#define _ICMR(n) (*((((n) - PXA_IRQ(0)) & ~0x1f) ? &ICMR2 : &ICMR))
30#define _ICLR(n) (*((((n) - PXA_IRQ(0)) & ~0x1f) ? &ICLR2 : &ICLR)) 32#define _ICLR(n) (*((((n) - PXA_IRQ(0)) & ~0x1f) ? &ICLR2 : &ICLR))
@@ -122,6 +124,8 @@ void __init pxa_init_irq(int irq_nr, set_wake_t fn)
122{ 124{
123 int irq, i; 125 int irq, i;
124 126
127 BUG_ON(irq_nr > MAX_INTERNAL_IRQS);
128
125 pxa_internal_irq_nr = irq_nr; 129 pxa_internal_irq_nr = irq_nr;
126 130
127 for (irq = PXA_IRQ(0); irq < PXA_IRQ(irq_nr); irq += 32) { 131 for (irq = PXA_IRQ(0); irq < PXA_IRQ(irq_nr); irq += 32) {
@@ -149,7 +153,8 @@ void __init pxa_init_irq(int irq_nr, set_wake_t fn)
149} 153}
150 154
151#ifdef CONFIG_PM 155#ifdef CONFIG_PM
152static unsigned long saved_icmr[2]; 156static unsigned long saved_icmr[MAX_INTERNAL_IRQS/32];
157static unsigned long saved_ipr[MAX_INTERNAL_IRQS];
153 158
154static int pxa_irq_suspend(struct sys_device *dev, pm_message_t state) 159static int pxa_irq_suspend(struct sys_device *dev, pm_message_t state)
155{ 160{
@@ -159,6 +164,8 @@ static int pxa_irq_suspend(struct sys_device *dev, pm_message_t state)
159 saved_icmr[i] = _ICMR(irq); 164 saved_icmr[i] = _ICMR(irq);
160 _ICMR(irq) = 0; 165 _ICMR(irq) = 0;
161 } 166 }
167 for (i = 0; i < pxa_internal_irq_nr; i++)
168 saved_ipr[i] = IPR(i);
162 169
163 return 0; 170 return 0;
164} 171}
@@ -171,6 +178,8 @@ static int pxa_irq_resume(struct sys_device *dev)
171 _ICMR(irq) = saved_icmr[i]; 178 _ICMR(irq) = saved_icmr[i];
172 _ICLR(irq) = 0; 179 _ICLR(irq) = 0;
173 } 180 }
181 for (i = 0; i < pxa_internal_irq_nr; i++)
182 IPR(i) = saved_ipr[i];
174 183
175 ICCR = 1; 184 ICCR = 1;
176 return 0; 185 return 0;
diff --git a/arch/arm/mach-pxa/palmtc.c b/arch/arm/mach-pxa/palmtc.c
index bb2cc0dd44ec..0b92291a58f6 100644
--- a/arch/arm/mach-pxa/palmtc.c
+++ b/arch/arm/mach-pxa/palmtc.c
@@ -292,10 +292,10 @@ const static unsigned int palmtc_keypad_col_gpios[] = {
292 292
293static struct matrix_keypad_platform_data palmtc_keypad_platform_data = { 293static struct matrix_keypad_platform_data palmtc_keypad_platform_data = {
294 .keymap_data = &palmtc_keymap_data, 294 .keymap_data = &palmtc_keymap_data,
295 .col_gpios = palmtc_keypad_row_gpios, 295 .row_gpios = palmtc_keypad_row_gpios,
296 .num_col_gpios = 12, 296 .num_row_gpios = ARRAY_SIZE(palmtc_keypad_row_gpios),
297 .row_gpios = palmtc_keypad_col_gpios, 297 .col_gpios = palmtc_keypad_col_gpios,
298 .num_row_gpios = 4, 298 .num_col_gpios = ARRAY_SIZE(palmtc_keypad_col_gpios),
299 .active_low = 1, 299 .active_low = 1,
300 300
301 .debounce_ms = 20, 301 .debounce_ms = 20,
diff --git a/arch/arm/mach-pxa/spitz.c b/arch/arm/mach-pxa/spitz.c
index 82ff5733e4dc..d98023f55503 100644
--- a/arch/arm/mach-pxa/spitz.c
+++ b/arch/arm/mach-pxa/spitz.c
@@ -779,11 +779,36 @@ static void __init common_init(void)
779 pxa_set_i2c_info(NULL); 779 pxa_set_i2c_info(NULL);
780} 780}
781 781
782#if defined(CONFIG_MACH_AKITA) || defined(CONFIG_MACH_BORZOI)
783static struct nand_bbt_descr sharpsl_akita_bbt = {
784 .options = 0,
785 .offs = 4,
786 .len = 1,
787 .pattern = scan_ff_pattern
788};
789
790static struct nand_ecclayout akita_oobinfo = {
791 .eccbytes = 24,
792 .eccpos = {
793 0x5, 0x1, 0x2, 0x3, 0x6, 0x7, 0x15, 0x11,
794 0x12, 0x13, 0x16, 0x17, 0x25, 0x21, 0x22, 0x23,
795 0x26, 0x27, 0x35, 0x31, 0x32, 0x33, 0x36, 0x37},
796 .oobfree = {{0x08, 0x09}}
797};
798#endif
799
782#if defined(CONFIG_MACH_SPITZ) || defined(CONFIG_MACH_BORZOI) 800#if defined(CONFIG_MACH_SPITZ) || defined(CONFIG_MACH_BORZOI)
783static void __init spitz_init(void) 801static void __init spitz_init(void)
784{ 802{
785 spitz_ficp_platform_data.gpio_pwdown = SPITZ_GPIO_IR_ON; 803 spitz_ficp_platform_data.gpio_pwdown = SPITZ_GPIO_IR_ON;
786 804
805#ifdef CONFIG_MACH_BORZOI
806 if (machine_is_borzoi()) {
807 sharpsl_nand_platform_data.badblock_pattern = &sharpsl_akita_bbt;
808 sharpsl_nand_platform_data.ecc_layout = &akita_oobinfo;
809 }
810#endif
811
787 platform_scoop_config = &spitz_pcmcia_config; 812 platform_scoop_config = &spitz_pcmcia_config;
788 813
789 common_init(); 814 common_init();
@@ -808,22 +833,6 @@ static struct i2c_board_info akita_i2c_board_info[] = {
808 }, 833 },
809}; 834};
810 835
811static struct nand_bbt_descr sharpsl_akita_bbt = {
812 .options = 0,
813 .offs = 4,
814 .len = 1,
815 .pattern = scan_ff_pattern
816};
817
818static struct nand_ecclayout akita_oobinfo = {
819 .eccbytes = 24,
820 .eccpos = {
821 0x5, 0x1, 0x2, 0x3, 0x6, 0x7, 0x15, 0x11,
822 0x12, 0x13, 0x16, 0x17, 0x25, 0x21, 0x22, 0x23,
823 0x26, 0x27, 0x35, 0x31, 0x32, 0x33, 0x36, 0x37},
824 .oobfree = {{0x08, 0x09}}
825};
826
827static void __init akita_init(void) 836static void __init akita_init(void)
828{ 837{
829 spitz_ficp_platform_data.gpio_pwdown = AKITA_GPIO_IR_ON; 838 spitz_ficp_platform_data.gpio_pwdown = AKITA_GPIO_IR_ON;
diff --git a/arch/arm/mach-realview/Kconfig b/arch/arm/mach-realview/Kconfig
index dfc9b0bc6eb2..c48e1f2c3349 100644
--- a/arch/arm/mach-realview/Kconfig
+++ b/arch/arm/mach-realview/Kconfig
@@ -70,6 +70,8 @@ config MACH_REALVIEW_PBX
70 bool "Support RealView/PBX platform" 70 bool "Support RealView/PBX platform"
71 select ARM_GIC 71 select ARM_GIC
72 select HAVE_PATA_PLATFORM 72 select HAVE_PATA_PLATFORM
73 select ARCH_SPARSEMEM_ENABLE if CPU_V7 && !HIGH_PHYS_OFFSET
74 select ZONE_DMA if SPARSEMEM
73 help 75 help
74 Include support for the ARM(R) RealView PBX platform. 76 Include support for the ARM(R) RealView PBX platform.
75 77
@@ -82,6 +84,7 @@ config REALVIEW_HIGH_PHYS_OFFSET
82 0x70000000, 256MB of which being mirrored at 0x00000000. If 84 0x70000000, 256MB of which being mirrored at 0x00000000. If
83 the board supports 512MB of RAM, this option allows the 85 the board supports 512MB of RAM, this option allows the
84 memory to be accessed contiguously at the high physical 86 memory to be accessed contiguously at the high physical
85 offset. 87 offset. On the PBX board, disabling this option allows 1GB of
88 RAM to be used with SPARSEMEM.
86 89
87endmenu 90endmenu
diff --git a/arch/arm/mach-realview/core.c b/arch/arm/mach-realview/core.c
index a2083b60e3fb..9f293438e020 100644
--- a/arch/arm/mach-realview/core.c
+++ b/arch/arm/mach-realview/core.c
@@ -59,6 +59,25 @@
59/* used by entry-macro.S and platsmp.c */ 59/* used by entry-macro.S and platsmp.c */
60void __iomem *gic_cpu_base_addr; 60void __iomem *gic_cpu_base_addr;
61 61
62#ifdef CONFIG_ZONE_DMA
63/*
64 * Adjust the zones if there are restrictions for DMA access.
65 */
66void __init realview_adjust_zones(int node, unsigned long *size,
67 unsigned long *hole)
68{
69 unsigned long dma_size = SZ_256M >> PAGE_SHIFT;
70
71 if (!machine_is_realview_pbx() || node || (size[0] <= dma_size))
72 return;
73
74 size[ZONE_NORMAL] = size[0] - dma_size;
75 size[ZONE_DMA] = dma_size;
76 hole[ZONE_NORMAL] = hole[0];
77 hole[ZONE_DMA] = 0;
78}
79#endif
80
62/* 81/*
63 * This is the RealView sched_clock implementation. This has 82 * This is the RealView sched_clock implementation. This has
64 * a resolution of 41.7ns, and a maximum value of about 179s. 83 * a resolution of 41.7ns, and a maximum value of about 179s.
@@ -543,7 +562,7 @@ static int realview_clcd_setup(struct clcd_fb *fb)
543 fb->panel = realview_clcd_panel(); 562 fb->panel = realview_clcd_panel();
544 563
545 fb->fb.screen_base = dma_alloc_writecombine(&fb->dev->dev, framesize, 564 fb->fb.screen_base = dma_alloc_writecombine(&fb->dev->dev, framesize,
546 &dma, GFP_KERNEL); 565 &dma, GFP_KERNEL | GFP_DMA);
547 if (!fb->fb.screen_base) { 566 if (!fb->fb.screen_base) {
548 printk(KERN_ERR "CLCD: unable to map framebuffer\n"); 567 printk(KERN_ERR "CLCD: unable to map framebuffer\n");
549 return -ENOMEM; 568 return -ENOMEM;
@@ -788,3 +807,24 @@ void __init realview_timer_init(unsigned int timer_irq)
788 realview_clocksource_init(); 807 realview_clocksource_init();
789 realview_clockevents_init(timer_irq); 808 realview_clockevents_init(timer_irq);
790} 809}
810
811/*
812 * Setup the memory banks.
813 */
814void realview_fixup(struct machine_desc *mdesc, struct tag *tags, char **from,
815 struct meminfo *meminfo)
816{
817 /*
818 * Most RealView platforms have 512MB contiguous RAM at 0x70000000.
819 * Half of this is mirrored at 0.
820 */
821#ifdef CONFIG_REALVIEW_HIGH_PHYS_OFFSET
822 meminfo->bank[0].start = 0x70000000;
823 meminfo->bank[0].size = SZ_512M;
824 meminfo->nr_banks = 1;
825#else
826 meminfo->bank[0].start = 0;
827 meminfo->bank[0].size = SZ_256M;
828 meminfo->nr_banks = 1;
829#endif
830}
diff --git a/arch/arm/mach-realview/core.h b/arch/arm/mach-realview/core.h
index 699671fa6e0b..781bca68a9fa 100644
--- a/arch/arm/mach-realview/core.h
+++ b/arch/arm/mach-realview/core.h
@@ -25,6 +25,7 @@
25#include <linux/amba/bus.h> 25#include <linux/amba/bus.h>
26#include <linux/io.h> 26#include <linux/io.h>
27 27
28#include <asm/setup.h>
28#include <asm/leds.h> 29#include <asm/leds.h>
29 30
30#define AMBA_DEVICE(name,busid,base,plat) \ 31#define AMBA_DEVICE(name,busid,base,plat) \
@@ -44,6 +45,8 @@ static struct amba_device name##_device = { \
44 /* .dma = base##_DMA,*/ \ 45 /* .dma = base##_DMA,*/ \
45} 46}
46 47
48struct machine_desc;
49
47extern struct platform_device realview_flash_device; 50extern struct platform_device realview_flash_device;
48extern struct platform_device realview_cf_device; 51extern struct platform_device realview_cf_device;
49extern struct platform_device realview_i2c_device; 52extern struct platform_device realview_i2c_device;
@@ -61,5 +64,8 @@ extern void realview_timer_init(unsigned int timer_irq);
61extern int realview_flash_register(struct resource *res, u32 num); 64extern int realview_flash_register(struct resource *res, u32 num);
62extern int realview_eth_register(const char *name, struct resource *res); 65extern int realview_eth_register(const char *name, struct resource *res);
63extern int realview_usb_register(struct resource *res); 66extern int realview_usb_register(struct resource *res);
67extern void realview_fixup(struct machine_desc *mdesc, struct tag *tags,
68 char **from, struct meminfo *meminfo);
64extern void (*realview_reset)(char); 69extern void (*realview_reset)(char);
70
65#endif 71#endif
diff --git a/arch/arm/mach-realview/include/mach/memory.h b/arch/arm/mach-realview/include/mach/memory.h
index 293c30025e7e..2417bbcf97fd 100644
--- a/arch/arm/mach-realview/include/mach/memory.h
+++ b/arch/arm/mach-realview/include/mach/memory.h
@@ -29,4 +29,53 @@
29#define PHYS_OFFSET UL(0x00000000) 29#define PHYS_OFFSET UL(0x00000000)
30#endif 30#endif
31 31
32#if !defined(__ASSEMBLY__) && defined(CONFIG_ZONE_DMA)
33extern void realview_adjust_zones(int node, unsigned long *size,
34 unsigned long *hole);
35#define arch_adjust_zones(node, size, hole) \
36 realview_adjust_zones(node, size, hole)
37
38#define ISA_DMA_THRESHOLD (PHYS_OFFSET + SZ_256M - 1)
39#define MAX_DMA_ADDRESS (PAGE_OFFSET + SZ_256M)
40#endif
41
42#ifdef CONFIG_SPARSEMEM
43
44/*
45 * Sparsemem definitions for RealView PBX.
46 *
47 * The RealView PBX board has another block of 512MB of RAM at 0x20000000,
48 * however only the block at 0x70000000 (or the 256MB mirror at 0x00000000)
49 * may be used for DMA.
50 *
51 * The macros below define a section size of 256MB and a non-linear virtual to
52 * physical mapping:
53 *
54 * 256MB @ 0x00000000 -> PAGE_OFFSET
55 * 512MB @ 0x20000000 -> PAGE_OFFSET + 0x10000000
56 * 256MB @ 0x80000000 -> PAGE_OFFSET + 0x30000000
57 */
58#ifdef CONFIG_REALVIEW_HIGH_PHYS_OFFSET
59#error "SPARSEMEM not available with REALVIEW_HIGH_PHYS_OFFSET"
60#endif
61
62#define MAX_PHYSMEM_BITS 32
63#define SECTION_SIZE_BITS 28
64
65/* bank page offsets */
66#define PAGE_OFFSET1 (PAGE_OFFSET + 0x10000000)
67#define PAGE_OFFSET2 (PAGE_OFFSET + 0x30000000)
68
69#define __phys_to_virt(phys) \
70 ((phys) >= 0x80000000 ? (phys) - 0x80000000 + PAGE_OFFSET2 : \
71 (phys) >= 0x20000000 ? (phys) - 0x20000000 + PAGE_OFFSET1 : \
72 (phys) + PAGE_OFFSET)
73
74#define __virt_to_phys(virt) \
75 ((virt) >= PAGE_OFFSET2 ? (virt) - PAGE_OFFSET2 + 0x80000000 : \
76 (virt) >= PAGE_OFFSET1 ? (virt) - PAGE_OFFSET1 + 0x20000000 : \
77 (virt) - PAGE_OFFSET)
78
79#endif /* CONFIG_SPARSEMEM */
80
32#endif 81#endif
diff --git a/arch/arm/mach-realview/platsmp.c b/arch/arm/mach-realview/platsmp.c
index a88458b4799d..009265818d55 100644
--- a/arch/arm/mach-realview/platsmp.c
+++ b/arch/arm/mach-realview/platsmp.c
@@ -146,11 +146,8 @@ static void __init poke_milo(void)
146 * register. The BootMonitor waits for this register to become 146 * register. The BootMonitor waits for this register to become
147 * non-zero. 147 * non-zero.
148 */ 148 */
149#define REALVIEW_SYS_FLAGSS_OFFSET 0x30
150#define REALVIEW_SYS_FLAGSC_OFFSET 0x34
151 __raw_writel(BSYM(virt_to_phys(realview_secondary_startup)), 149 __raw_writel(BSYM(virt_to_phys(realview_secondary_startup)),
152 __io_address(REALVIEW_SYS_BASE) + 150 __io_address(REALVIEW_SYS_FLAGSSET));
153 REALVIEW_SYS_FLAGSS_OFFSET);
154 151
155 mb(); 152 mb();
156} 153}
diff --git a/arch/arm/mach-realview/realview_eb.c b/arch/arm/mach-realview/realview_eb.c
index 1d65e64ae571..917f8ca3abff 100644
--- a/arch/arm/mach-realview/realview_eb.c
+++ b/arch/arm/mach-realview/realview_eb.c
@@ -415,6 +415,7 @@ MACHINE_START(REALVIEW_EB, "ARM-RealView EB")
415 .phys_io = REALVIEW_EB_UART0_BASE, 415 .phys_io = REALVIEW_EB_UART0_BASE,
416 .io_pg_offst = (IO_ADDRESS(REALVIEW_EB_UART0_BASE) >> 18) & 0xfffc, 416 .io_pg_offst = (IO_ADDRESS(REALVIEW_EB_UART0_BASE) >> 18) & 0xfffc,
417 .boot_params = PHYS_OFFSET + 0x00000100, 417 .boot_params = PHYS_OFFSET + 0x00000100,
418 .fixup = realview_fixup,
418 .map_io = realview_eb_map_io, 419 .map_io = realview_eb_map_io,
419 .init_irq = gic_init_irq, 420 .init_irq = gic_init_irq,
420 .timer = &realview_eb_timer, 421 .timer = &realview_eb_timer,
diff --git a/arch/arm/mach-realview/realview_pb1176.c b/arch/arm/mach-realview/realview_pb1176.c
index a6ba147692c1..7fb726d5f8b9 100644
--- a/arch/arm/mach-realview/realview_pb1176.c
+++ b/arch/arm/mach-realview/realview_pb1176.c
@@ -300,6 +300,18 @@ static void realview_pb1176_reset(char mode)
300 __raw_writel(REALVIEW_PB1176_SYS_LOCKVAL_RSTCTL, hdr_ctrl); 300 __raw_writel(REALVIEW_PB1176_SYS_LOCKVAL_RSTCTL, hdr_ctrl);
301} 301}
302 302
303static void realview_pb1176_fixup(struct machine_desc *mdesc,
304 struct tag *tags, char **from,
305 struct meminfo *meminfo)
306{
307 /*
308 * RealView PB1176 only has 128MB of RAM mapped at 0.
309 */
310 meminfo->bank[0].start = 0;
311 meminfo->bank[0].size = SZ_128M;
312 meminfo->nr_banks = 1;
313}
314
303static void __init realview_pb1176_init(void) 315static void __init realview_pb1176_init(void)
304{ 316{
305 int i; 317 int i;
@@ -331,6 +343,7 @@ MACHINE_START(REALVIEW_PB1176, "ARM-RealView PB1176")
331 .phys_io = REALVIEW_PB1176_UART0_BASE, 343 .phys_io = REALVIEW_PB1176_UART0_BASE,
332 .io_pg_offst = (IO_ADDRESS(REALVIEW_PB1176_UART0_BASE) >> 18) & 0xfffc, 344 .io_pg_offst = (IO_ADDRESS(REALVIEW_PB1176_UART0_BASE) >> 18) & 0xfffc,
333 .boot_params = PHYS_OFFSET + 0x00000100, 345 .boot_params = PHYS_OFFSET + 0x00000100,
346 .fixup = realview_pb1176_fixup,
334 .map_io = realview_pb1176_map_io, 347 .map_io = realview_pb1176_map_io,
335 .init_irq = gic_init_irq, 348 .init_irq = gic_init_irq,
336 .timer = &realview_pb1176_timer, 349 .timer = &realview_pb1176_timer,
diff --git a/arch/arm/mach-realview/realview_pb11mp.c b/arch/arm/mach-realview/realview_pb11mp.c
index 070d284ce96e..9bbbfc05f225 100644
--- a/arch/arm/mach-realview/realview_pb11mp.c
+++ b/arch/arm/mach-realview/realview_pb11mp.c
@@ -347,6 +347,7 @@ MACHINE_START(REALVIEW_PB11MP, "ARM-RealView PB11MPCore")
347 .phys_io = REALVIEW_PB11MP_UART0_BASE, 347 .phys_io = REALVIEW_PB11MP_UART0_BASE,
348 .io_pg_offst = (IO_ADDRESS(REALVIEW_PB11MP_UART0_BASE) >> 18) & 0xfffc, 348 .io_pg_offst = (IO_ADDRESS(REALVIEW_PB11MP_UART0_BASE) >> 18) & 0xfffc,
349 .boot_params = PHYS_OFFSET + 0x00000100, 349 .boot_params = PHYS_OFFSET + 0x00000100,
350 .fixup = realview_fixup,
350 .map_io = realview_pb11mp_map_io, 351 .map_io = realview_pb11mp_map_io,
351 .init_irq = gic_init_irq, 352 .init_irq = gic_init_irq,
352 .timer = &realview_pb11mp_timer, 353 .timer = &realview_pb11mp_timer,
diff --git a/arch/arm/mach-realview/realview_pba8.c b/arch/arm/mach-realview/realview_pba8.c
index 941beb2b9709..fe861e96c566 100644
--- a/arch/arm/mach-realview/realview_pba8.c
+++ b/arch/arm/mach-realview/realview_pba8.c
@@ -298,6 +298,7 @@ MACHINE_START(REALVIEW_PBA8, "ARM-RealView PB-A8")
298 .phys_io = REALVIEW_PBA8_UART0_BASE, 298 .phys_io = REALVIEW_PBA8_UART0_BASE,
299 .io_pg_offst = (IO_ADDRESS(REALVIEW_PBA8_UART0_BASE) >> 18) & 0xfffc, 299 .io_pg_offst = (IO_ADDRESS(REALVIEW_PBA8_UART0_BASE) >> 18) & 0xfffc,
300 .boot_params = PHYS_OFFSET + 0x00000100, 300 .boot_params = PHYS_OFFSET + 0x00000100,
301 .fixup = realview_fixup,
301 .map_io = realview_pba8_map_io, 302 .map_io = realview_pba8_map_io,
302 .init_irq = gic_init_irq, 303 .init_irq = gic_init_irq,
303 .timer = &realview_pba8_timer, 304 .timer = &realview_pba8_timer,
diff --git a/arch/arm/mach-realview/realview_pbx.c b/arch/arm/mach-realview/realview_pbx.c
index 7e4bc6cdca52..ec39488e2b42 100644
--- a/arch/arm/mach-realview/realview_pbx.c
+++ b/arch/arm/mach-realview/realview_pbx.c
@@ -304,6 +304,26 @@ static struct sys_timer realview_pbx_timer = {
304 .init = realview_pbx_timer_init, 304 .init = realview_pbx_timer_init,
305}; 305};
306 306
307static void realview_pbx_fixup(struct machine_desc *mdesc, struct tag *tags,
308 char **from, struct meminfo *meminfo)
309{
310#ifdef CONFIG_SPARSEMEM
311 /*
312 * Memory configuration with SPARSEMEM enabled on RealView PBX (see
313 * asm/mach/memory.h for more information).
314 */
315 meminfo->bank[0].start = 0;
316 meminfo->bank[0].size = SZ_256M;
317 meminfo->bank[1].start = 0x20000000;
318 meminfo->bank[1].size = SZ_512M;
319 meminfo->bank[2].start = 0x80000000;
320 meminfo->bank[2].size = SZ_256M;
321 meminfo->nr_banks = 3;
322#else
323 realview_fixup(mdesc, tags, from, meminfo);
324#endif
325}
326
307static void __init realview_pbx_init(void) 327static void __init realview_pbx_init(void)
308{ 328{
309 int i; 329 int i;
@@ -345,6 +365,7 @@ MACHINE_START(REALVIEW_PBX, "ARM-RealView PBX")
345 .phys_io = REALVIEW_PBX_UART0_BASE, 365 .phys_io = REALVIEW_PBX_UART0_BASE,
346 .io_pg_offst = (IO_ADDRESS(REALVIEW_PBX_UART0_BASE) >> 18) & 0xfffc, 366 .io_pg_offst = (IO_ADDRESS(REALVIEW_PBX_UART0_BASE) >> 18) & 0xfffc,
347 .boot_params = PHYS_OFFSET + 0x00000100, 367 .boot_params = PHYS_OFFSET + 0x00000100,
368 .fixup = realview_pbx_fixup,
348 .map_io = realview_pbx_map_io, 369 .map_io = realview_pbx_map_io,
349 .init_irq = gic_init_irq, 370 .init_irq = gic_init_irq,
350 .timer = &realview_pbx_timer, 371 .timer = &realview_pbx_timer,
diff --git a/arch/arm/mach-s3c2410/gpio.c b/arch/arm/mach-s3c2410/gpio.c
index 7974afca297c..9664e011dae2 100644
--- a/arch/arm/mach-s3c2410/gpio.c
+++ b/arch/arm/mach-s3c2410/gpio.c
@@ -28,6 +28,7 @@
28#include <linux/io.h> 28#include <linux/io.h>
29 29
30#include <mach/hardware.h> 30#include <mach/hardware.h>
31#include <mach/gpio-fns.h>
31#include <asm/irq.h> 32#include <asm/irq.h>
32 33
33#include <mach/regs-gpio.h> 34#include <mach/regs-gpio.h>
diff --git a/arch/arm/mach-s3c2410/include/mach/dma.h b/arch/arm/mach-s3c2410/include/mach/dma.h
index c3a2629e0ded..92e2687009ea 100644
--- a/arch/arm/mach-s3c2410/include/mach/dma.h
+++ b/arch/arm/mach-s3c2410/include/mach/dma.h
@@ -110,6 +110,8 @@ enum s3c2410_dma_loadst {
110 * waiting for reloads */ 110 * waiting for reloads */
111#define S3C2410_DMAF_AUTOSTART (1<<1) /* auto-start if buffer queued */ 111#define S3C2410_DMAF_AUTOSTART (1<<1) /* auto-start if buffer queued */
112 112
113#define S3C2410_DMAF_CIRCULAR (1 << 2) /* no circular dma support */
114
113/* dma buffer */ 115/* dma buffer */
114 116
115struct s3c2410_dma_buf; 117struct s3c2410_dma_buf;
@@ -194,4 +196,9 @@ struct s3c2410_dma_chan {
194 196
195typedef unsigned long dma_device_t; 197typedef unsigned long dma_device_t;
196 198
199static inline bool s3c_dma_has_circular(void)
200{
201 return false;
202}
203
197#endif /* __ASM_ARCH_DMA_H */ 204#endif /* __ASM_ARCH_DMA_H */
diff --git a/arch/arm/mach-s3c2440/Kconfig b/arch/arm/mach-s3c2440/Kconfig
index d7bba919a77e..a8b69d77571b 100644
--- a/arch/arm/mach-s3c2440/Kconfig
+++ b/arch/arm/mach-s3c2440/Kconfig
@@ -103,6 +103,7 @@ config MACH_MINI2440
103 select LEDS_TRIGGER_BACKLIGHT 103 select LEDS_TRIGGER_BACKLIGHT
104 select SND_S3C24XX_SOC_S3C24XX_UDA134X 104 select SND_S3C24XX_SOC_S3C24XX_UDA134X
105 select S3C_DEV_NAND 105 select S3C_DEV_NAND
106 select S3C_DEV_USB_HOST
106 help 107 help
107 Say Y here to select support for the MINI2440. Is a 10cm x 10cm board 108 Say Y here to select support for the MINI2440. Is a 10cm x 10cm board
108 available via various sources. It can come with a 3.5" or 7" touch LCD. 109 available via various sources. It can come with a 3.5" or 7" touch LCD.
diff --git a/arch/arm/mach-s3c2440/mach-mini2440.c b/arch/arm/mach-s3c2440/mach-mini2440.c
index ec71a6965786..1c3382fefdd2 100644
--- a/arch/arm/mach-s3c2440/mach-mini2440.c
+++ b/arch/arm/mach-s3c2440/mach-mini2440.c
@@ -144,7 +144,7 @@ static struct s3c2410_udc_mach_info mini2440_udc_cfg __initdata = {
144 .type = (S3C2410_LCDCON1_TFT16BPP |\ 144 .type = (S3C2410_LCDCON1_TFT16BPP |\
145 S3C2410_LCDCON1_TFT) 145 S3C2410_LCDCON1_TFT)
146 146
147struct s3c2410fb_display mini2440_lcd_cfg[] __initdata = { 147static struct s3c2410fb_display mini2440_lcd_cfg[] __initdata = {
148 [0] = { /* mini2440 + 3.5" TFT + touchscreen */ 148 [0] = { /* mini2440 + 3.5" TFT + touchscreen */
149 _LCD_DECLARE( 149 _LCD_DECLARE(
150 7, /* The 3.5 is quite fast */ 150 7, /* The 3.5 is quite fast */
@@ -191,7 +191,7 @@ struct s3c2410fb_display mini2440_lcd_cfg[] __initdata = {
191#define S3C2410_GPCCON_MASK(x) (3 << ((x) * 2)) 191#define S3C2410_GPCCON_MASK(x) (3 << ((x) * 2))
192#define S3C2410_GPDCON_MASK(x) (3 << ((x) * 2)) 192#define S3C2410_GPDCON_MASK(x) (3 << ((x) * 2))
193 193
194struct s3c2410fb_mach_info mini2440_fb_info __initdata = { 194static struct s3c2410fb_mach_info mini2440_fb_info __initdata = {
195 .displays = &mini2440_lcd_cfg[0], /* not constant! see init */ 195 .displays = &mini2440_lcd_cfg[0], /* not constant! see init */
196 .num_displays = 1, 196 .num_displays = 1,
197 .default_display = 0, 197 .default_display = 0,
diff --git a/arch/arm/mach-s3c6400/include/mach/dma.h b/arch/arm/mach-s3c6400/include/mach/dma.h
index 1067619f0ba0..6723860748be 100644
--- a/arch/arm/mach-s3c6400/include/mach/dma.h
+++ b/arch/arm/mach-s3c6400/include/mach/dma.h
@@ -58,12 +58,9 @@ enum dma_ch {
58 DMACH_MAX /* the end */ 58 DMACH_MAX /* the end */
59}; 59};
60 60
61static __inline__ int s3c_dma_has_circular(void) 61static __inline__ bool s3c_dma_has_circular(void)
62{ 62{
63 /* we will be supporting ciruclar buffers as soon as we have DMA 63 return true;
64 * engine support.
65 */
66 return 1;
67} 64}
68 65
69#define S3C2410_DMAF_CIRCULAR (1 << 0) 66#define S3C2410_DMAF_CIRCULAR (1 << 0)
diff --git a/arch/arm/mach-s3c6410/Kconfig b/arch/arm/mach-s3c6410/Kconfig
index 53fc3ff657f7..72d4b11b2077 100644
--- a/arch/arm/mach-s3c6410/Kconfig
+++ b/arch/arm/mach-s3c6410/Kconfig
@@ -77,6 +77,7 @@ config SMDK6410_WM1190_EV1
77 depends on MACH_SMDK6410 77 depends on MACH_SMDK6410
78 select REGULATOR 78 select REGULATOR
79 select REGULATOR_WM8350 79 select REGULATOR_WM8350
80 select S3C24XX_GPIO_EXTRA64
80 select MFD_WM8350_I2C 81 select MFD_WM8350_I2C
81 select MFD_WM8350_CONFIG_MODE_0 82 select MFD_WM8350_CONFIG_MODE_0
82 select MFD_WM8350_CONFIG_MODE_3 83 select MFD_WM8350_CONFIG_MODE_3
diff --git a/arch/arm/mach-s3c6410/mach-smdk6410.c b/arch/arm/mach-s3c6410/mach-smdk6410.c
index ea51dbe76e3e..9f1a21462620 100644
--- a/arch/arm/mach-s3c6410/mach-smdk6410.c
+++ b/arch/arm/mach-s3c6410/mach-smdk6410.c
@@ -320,6 +320,9 @@ static int __init smdk6410_wm8350_init(struct wm8350 *wm8350)
320{ 320{
321 int i; 321 int i;
322 322
323 /* Configure the IRQ line */
324 s3c_gpio_setpull(S3C64XX_GPN(12), S3C_GPIO_PULL_UP);
325
323 /* Instantiate the regulators */ 326 /* Instantiate the regulators */
324 for (i = 0; i < ARRAY_SIZE(wm1190_regulators); i++) 327 for (i = 0; i < ARRAY_SIZE(wm1190_regulators); i++)
325 wm8350_register_regulator(wm8350, 328 wm8350_register_regulator(wm8350,
diff --git a/arch/arm/mach-u300/core.c b/arch/arm/mach-u300/core.c
index be60d6deee8b..653e25be3dd8 100644
--- a/arch/arm/mach-u300/core.c
+++ b/arch/arm/mach-u300/core.c
@@ -408,7 +408,7 @@ static struct platform_device keypad_device = {
408}; 408};
409 409
410static struct platform_device rtc_device = { 410static struct platform_device rtc_device = {
411 .name = "rtc0", 411 .name = "rtc-coh901331",
412 .id = -1, 412 .id = -1,
413 .num_resources = ARRAY_SIZE(rtc_resources), 413 .num_resources = ARRAY_SIZE(rtc_resources),
414 .resource = rtc_resources, 414 .resource = rtc_resources,
diff --git a/arch/arm/mm/proc-v7.S b/arch/arm/mm/proc-v7.S
index eeeed01ee44a..3a285218fd15 100644
--- a/arch/arm/mm/proc-v7.S
+++ b/arch/arm/mm/proc-v7.S
@@ -186,9 +186,10 @@ cpu_v7_name:
186 */ 186 */
187__v7_setup: 187__v7_setup:
188#ifdef CONFIG_SMP 188#ifdef CONFIG_SMP
189 mrc p15, 0, r0, c1, c0, 1 @ Enable SMP/nAMP mode and 189 mrc p15, 0, r0, c1, c0, 1
190 orr r0, r0, #(1 << 6) | (1 << 0) @ TLB ops broadcasting 190 tst r0, #(1 << 6) @ SMP/nAMP mode enabled?
191 mcr p15, 0, r0, c1, c0, 1 191 orreq r0, r0, #(1 << 6) | (1 << 0) @ Enable SMP/nAMP mode and
192 mcreq p15, 0, r0, c1, c0, 1 @ TLB ops broadcasting
192#endif 193#endif
193 adr r12, __v7_setup_stack @ the local stack 194 adr r12, __v7_setup_stack @ the local stack
194 stmia r12, {r0-r5, r7, r9, r11, lr} 195 stmia r12, {r0-r5, r7, r9, r11, lr}
diff --git a/arch/arm/plat-omap/cpu-omap.c b/arch/arm/plat-omap/cpu-omap.c
index 1868c0d8f9b5..341235c278ac 100644
--- a/arch/arm/plat-omap/cpu-omap.c
+++ b/arch/arm/plat-omap/cpu-omap.c
@@ -127,7 +127,7 @@ static int __init omap_cpu_init(struct cpufreq_policy *policy)
127 } 127 }
128 128
129 /* FIXME: what's the actual transition time? */ 129 /* FIXME: what's the actual transition time? */
130 policy->cpuinfo.transition_latency = 10 * 1000 * 1000; 130 policy->cpuinfo.transition_latency = 300 * 1000;
131 131
132 return 0; 132 return 0;
133} 133}
diff --git a/arch/arm/plat-omap/dma.c b/arch/arm/plat-omap/dma.c
index b53125f41293..68eaae324b6a 100644
--- a/arch/arm/plat-omap/dma.c
+++ b/arch/arm/plat-omap/dma.c
@@ -691,13 +691,16 @@ static inline void disable_lnk(int lch)
691static inline void omap2_enable_irq_lch(int lch) 691static inline void omap2_enable_irq_lch(int lch)
692{ 692{
693 u32 val; 693 u32 val;
694 unsigned long flags;
694 695
695 if (!cpu_class_is_omap2()) 696 if (!cpu_class_is_omap2())
696 return; 697 return;
697 698
699 spin_lock_irqsave(&dma_chan_lock, flags);
698 val = dma_read(IRQENABLE_L0); 700 val = dma_read(IRQENABLE_L0);
699 val |= 1 << lch; 701 val |= 1 << lch;
700 dma_write(val, IRQENABLE_L0); 702 dma_write(val, IRQENABLE_L0);
703 spin_unlock_irqrestore(&dma_chan_lock, flags);
701} 704}
702 705
703int omap_request_dma(int dev_id, const char *dev_name, 706int omap_request_dma(int dev_id, const char *dev_name,
@@ -799,10 +802,13 @@ void omap_free_dma(int lch)
799 802
800 if (cpu_class_is_omap2()) { 803 if (cpu_class_is_omap2()) {
801 u32 val; 804 u32 val;
805
806 spin_lock_irqsave(&dma_chan_lock, flags);
802 /* Disable interrupts */ 807 /* Disable interrupts */
803 val = dma_read(IRQENABLE_L0); 808 val = dma_read(IRQENABLE_L0);
804 val &= ~(1 << lch); 809 val &= ~(1 << lch);
805 dma_write(val, IRQENABLE_L0); 810 dma_write(val, IRQENABLE_L0);
811 spin_unlock_irqrestore(&dma_chan_lock, flags);
806 812
807 /* Clear the CSR register and IRQ status register */ 813 /* Clear the CSR register and IRQ status register */
808 dma_write(OMAP2_DMA_CSR_CLEAR_MASK, CSR(lch)); 814 dma_write(OMAP2_DMA_CSR_CLEAR_MASK, CSR(lch));
@@ -1108,6 +1114,14 @@ int omap_dma_running(void)
1108{ 1114{
1109 int lch; 1115 int lch;
1110 1116
1117 /*
1118 * On OMAP1510, internal LCD controller will start the transfer
1119 * when it gets enabled, so assume DMA running if LCD enabled.
1120 */
1121 if (cpu_is_omap1510())
1122 if (omap_readw(0xfffec000 + 0x00) & (1 << 0))
1123 return 1;
1124
1111 /* Check if LCD DMA is running */ 1125 /* Check if LCD DMA is running */
1112 if (cpu_is_omap16xx()) 1126 if (cpu_is_omap16xx())
1113 if (omap_readw(OMAP1610_DMA_LCD_CCR) & OMAP_DMA_CCR_EN) 1127 if (omap_readw(OMAP1610_DMA_LCD_CCR) & OMAP_DMA_CCR_EN)
diff --git a/arch/arm/plat-omap/gpio.c b/arch/arm/plat-omap/gpio.c
index 71ebd7fcfea1..7c345b757df1 100644
--- a/arch/arm/plat-omap/gpio.c
+++ b/arch/arm/plat-omap/gpio.c
@@ -373,7 +373,7 @@ static inline int gpio_valid(int gpio)
373 373
374static int check_gpio(int gpio) 374static int check_gpio(int gpio)
375{ 375{
376 if (unlikely(gpio_valid(gpio)) < 0) { 376 if (unlikely(gpio_valid(gpio) < 0)) {
377 printk(KERN_ERR "omap-gpio: invalid GPIO %d\n", gpio); 377 printk(KERN_ERR "omap-gpio: invalid GPIO %d\n", gpio);
378 dump_stack(); 378 dump_stack();
379 return -1; 379 return -1;
diff --git a/arch/arm/plat-pxa/include/plat/mfp.h b/arch/arm/plat-pxa/include/plat/mfp.h
index 22086e696e8e..857a6839071c 100644
--- a/arch/arm/plat-pxa/include/plat/mfp.h
+++ b/arch/arm/plat-pxa/include/plat/mfp.h
@@ -16,7 +16,7 @@
16#ifndef __ASM_PLAT_MFP_H 16#ifndef __ASM_PLAT_MFP_H
17#define __ASM_PLAT_MFP_H 17#define __ASM_PLAT_MFP_H
18 18
19#define mfp_to_gpio(m) ((m) % 128) 19#define mfp_to_gpio(m) ((m) % 256)
20 20
21/* list of all the configurable MFP pins */ 21/* list of all the configurable MFP pins */
22enum { 22enum {
diff --git a/arch/arm/plat-pxa/mfp.c b/arch/arm/plat-pxa/mfp.c
index 9405d0379c85..be58f9fe65b0 100644
--- a/arch/arm/plat-pxa/mfp.c
+++ b/arch/arm/plat-pxa/mfp.c
@@ -207,7 +207,7 @@ unsigned long mfp_read(int mfp)
207{ 207{
208 unsigned long val, flags; 208 unsigned long val, flags;
209 209
210 BUG_ON(mfp >= MFP_PIN_MAX); 210 BUG_ON(mfp < 0 || mfp >= MFP_PIN_MAX);
211 211
212 spin_lock_irqsave(&mfp_spin_lock, flags); 212 spin_lock_irqsave(&mfp_spin_lock, flags);
213 val = mfpr_readl(mfp_table[mfp].mfpr_off); 213 val = mfpr_readl(mfp_table[mfp].mfpr_off);
@@ -220,7 +220,7 @@ void mfp_write(int mfp, unsigned long val)
220{ 220{
221 unsigned long flags; 221 unsigned long flags;
222 222
223 BUG_ON(mfp >= MFP_PIN_MAX); 223 BUG_ON(mfp < 0 || mfp >= MFP_PIN_MAX);
224 224
225 spin_lock_irqsave(&mfp_spin_lock, flags); 225 spin_lock_irqsave(&mfp_spin_lock, flags);
226 mfpr_writel(mfp_table[mfp].mfpr_off, val); 226 mfpr_writel(mfp_table[mfp].mfpr_off, val);
diff --git a/arch/arm/plat-s3c24xx/adc.c b/arch/arm/plat-s3c24xx/adc.c
index 4d36b784fb8b..df47322492d5 100644
--- a/arch/arm/plat-s3c24xx/adc.c
+++ b/arch/arm/plat-s3c24xx/adc.c
@@ -189,7 +189,7 @@ int s3c_adc_read(struct s3c_adc_client *client, unsigned int ch)
189err: 189err:
190 return ret; 190 return ret;
191} 191}
192EXPORT_SYMBOL_GPL(s3c_adc_convert); 192EXPORT_SYMBOL_GPL(s3c_adc_read);
193 193
194static void s3c_adc_default_select(struct s3c_adc_client *client, 194static void s3c_adc_default_select(struct s3c_adc_client *client,
195 unsigned select) 195 unsigned select)
diff --git a/arch/arm/plat-s3c24xx/cpu.c b/arch/arm/plat-s3c24xx/cpu.c
index 5447e60f3936..4af9dd948793 100644
--- a/arch/arm/plat-s3c24xx/cpu.c
+++ b/arch/arm/plat-s3c24xx/cpu.c
@@ -61,6 +61,7 @@ static const char name_s3c2410[] = "S3C2410";
61static const char name_s3c2412[] = "S3C2412"; 61static const char name_s3c2412[] = "S3C2412";
62static const char name_s3c2440[] = "S3C2440"; 62static const char name_s3c2440[] = "S3C2440";
63static const char name_s3c2442[] = "S3C2442"; 63static const char name_s3c2442[] = "S3C2442";
64static const char name_s3c2442b[] = "S3C2442B";
64static const char name_s3c2443[] = "S3C2443"; 65static const char name_s3c2443[] = "S3C2443";
65static const char name_s3c2410a[] = "S3C2410A"; 66static const char name_s3c2410a[] = "S3C2410A";
66static const char name_s3c2440a[] = "S3C2440A"; 67static const char name_s3c2440a[] = "S3C2440A";
@@ -112,6 +113,15 @@ static struct cpu_table cpu_ids[] __initdata = {
112 .name = name_s3c2442 113 .name = name_s3c2442
113 }, 114 },
114 { 115 {
116 .idcode = 0x32440aab,
117 .idmask = 0xffffffff,
118 .map_io = s3c244x_map_io,
119 .init_clocks = s3c244x_init_clocks,
120 .init_uarts = s3c244x_init_uarts,
121 .init = s3c2442_init,
122 .name = name_s3c2442b
123 },
124 {
115 .idcode = 0x32412001, 125 .idcode = 0x32412001,
116 .idmask = 0xffffffff, 126 .idmask = 0xffffffff,
117 .map_io = s3c2412_map_io, 127 .map_io = s3c2412_map_io,
diff --git a/arch/arm/plat-s3c24xx/dma.c b/arch/arm/plat-s3c24xx/dma.c
index 196b19123653..f046f8c51084 100644
--- a/arch/arm/plat-s3c24xx/dma.c
+++ b/arch/arm/plat-s3c24xx/dma.c
@@ -208,14 +208,14 @@ s3c2410_dma_loadbuffer(struct s3c2410_dma_chan *chan,
208{ 208{
209 unsigned long reload; 209 unsigned long reload;
210 210
211 pr_debug("s3c2410_chan_loadbuffer: loading buff %p (0x%08lx,0x%06x)\n",
212 buf, (unsigned long)buf->data, buf->size);
213
214 if (buf == NULL) { 211 if (buf == NULL) {
215 dmawarn("buffer is NULL\n"); 212 dmawarn("buffer is NULL\n");
216 return -EINVAL; 213 return -EINVAL;
217 } 214 }
218 215
216 pr_debug("s3c2410_chan_loadbuffer: loading buff %p (0x%08lx,0x%06x)\n",
217 buf, (unsigned long)buf->data, buf->size);
218
219 /* check the state of the channel before we do anything */ 219 /* check the state of the channel before we do anything */
220 220
221 if (chan->load_state == S3C2410_DMALOAD_1LOADED) { 221 if (chan->load_state == S3C2410_DMALOAD_1LOADED) {
diff --git a/arch/arm/plat-s3c24xx/gpio.c b/arch/arm/plat-s3c24xx/gpio.c
index 95df059b5a1d..5467470badfd 100644
--- a/arch/arm/plat-s3c24xx/gpio.c
+++ b/arch/arm/plat-s3c24xx/gpio.c
@@ -29,6 +29,7 @@
29#include <linux/io.h> 29#include <linux/io.h>
30 30
31#include <mach/hardware.h> 31#include <mach/hardware.h>
32#include <mach/gpio-fns.h>
32#include <asm/irq.h> 33#include <asm/irq.h>
33 34
34#include <mach/regs-gpio.h> 35#include <mach/regs-gpio.h>
diff --git a/arch/arm/plat-s3c24xx/include/plat/cpu-freq-core.h b/arch/arm/plat-s3c24xx/include/plat/cpu-freq-core.h
index efeb025affc7..c776120b99e6 100644
--- a/arch/arm/plat-s3c24xx/include/plat/cpu-freq-core.h
+++ b/arch/arm/plat-s3c24xx/include/plat/cpu-freq-core.h
@@ -222,7 +222,9 @@ extern struct clk *s3c_cpufreq_clk_get(struct device *, const char *);
222/* S3C2410 and compatible exported functions */ 222/* S3C2410 and compatible exported functions */
223 223
224extern void s3c2410_cpufreq_setrefresh(struct s3c_cpufreq_config *cfg); 224extern void s3c2410_cpufreq_setrefresh(struct s3c_cpufreq_config *cfg);
225extern void s3c2410_set_fvco(struct s3c_cpufreq_config *cfg);
225 226
227#ifdef CONFIG_S3C2410_IOTIMING
226extern int s3c2410_iotiming_calc(struct s3c_cpufreq_config *cfg, 228extern int s3c2410_iotiming_calc(struct s3c_cpufreq_config *cfg,
227 struct s3c_iotimings *iot); 229 struct s3c_iotimings *iot);
228 230
@@ -231,8 +233,11 @@ extern int s3c2410_iotiming_get(struct s3c_cpufreq_config *cfg,
231 233
232extern void s3c2410_iotiming_set(struct s3c_cpufreq_config *cfg, 234extern void s3c2410_iotiming_set(struct s3c_cpufreq_config *cfg,
233 struct s3c_iotimings *iot); 235 struct s3c_iotimings *iot);
234 236#else
235extern void s3c2410_set_fvco(struct s3c_cpufreq_config *cfg); 237#define s3c2410_iotiming_calc NULL
238#define s3c2410_iotiming_get NULL
239#define s3c2410_iotiming_set NULL
240#endif /* CONFIG_S3C2410_IOTIMING */
236 241
237/* S3C2412 compatible routines */ 242/* S3C2412 compatible routines */
238 243
diff --git a/arch/arm/plat-s3c24xx/include/plat/s3c2410.h b/arch/arm/plat-s3c24xx/include/plat/s3c2410.h
index b6deeef8f663..82ab4aad1bbe 100644
--- a/arch/arm/plat-s3c24xx/include/plat/s3c2410.h
+++ b/arch/arm/plat-s3c24xx/include/plat/s3c2410.h
@@ -27,6 +27,7 @@ extern void s3c2410_init_clocks(int xtal);
27#define s3c2410_init_uarts NULL 27#define s3c2410_init_uarts NULL
28#define s3c2410_map_io NULL 28#define s3c2410_map_io NULL
29#define s3c2410_init NULL 29#define s3c2410_init NULL
30#define s3c2410a_init NULL
30#endif 31#endif
31 32
32extern int s3c2410_baseclk_add(void); 33extern int s3c2410_baseclk_add(void);
diff --git a/arch/arm/plat-s3c64xx/dma.c b/arch/arm/plat-s3c64xx/dma.c
index 266a10745a85..d554b936fcfb 100644
--- a/arch/arm/plat-s3c64xx/dma.c
+++ b/arch/arm/plat-s3c64xx/dma.c
@@ -151,8 +151,6 @@ static void s3c64xx_dma_fill_lli(struct s3c2410_dma_chan *chan,
151 src = chan->dev_addr; 151 src = chan->dev_addr;
152 dst = data; 152 dst = data;
153 control0 = PL080_CONTROL_SRC_AHB2; 153 control0 = PL080_CONTROL_SRC_AHB2;
154 control0 |= (u32)chan->hw_width << PL080_CONTROL_SWIDTH_SHIFT;
155 control0 |= 2 << PL080_CONTROL_DWIDTH_SHIFT;
156 control0 |= PL080_CONTROL_DST_INCR; 154 control0 |= PL080_CONTROL_DST_INCR;
157 break; 155 break;
158 156
@@ -160,8 +158,6 @@ static void s3c64xx_dma_fill_lli(struct s3c2410_dma_chan *chan,
160 src = data; 158 src = data;
161 dst = chan->dev_addr; 159 dst = chan->dev_addr;
162 control0 = PL080_CONTROL_DST_AHB2; 160 control0 = PL080_CONTROL_DST_AHB2;
163 control0 |= (u32)chan->hw_width << PL080_CONTROL_DWIDTH_SHIFT;
164 control0 |= 2 << PL080_CONTROL_SWIDTH_SHIFT;
165 control0 |= PL080_CONTROL_SRC_INCR; 161 control0 |= PL080_CONTROL_SRC_INCR;
166 break; 162 break;
167 default: 163 default:
@@ -173,6 +169,8 @@ static void s3c64xx_dma_fill_lli(struct s3c2410_dma_chan *chan,
173 control1 = size >> chan->hw_width; /* size in no of xfers */ 169 control1 = size >> chan->hw_width; /* size in no of xfers */
174 control0 |= PL080_CONTROL_PROT_SYS; /* always in priv. mode */ 170 control0 |= PL080_CONTROL_PROT_SYS; /* always in priv. mode */
175 control0 |= PL080_CONTROL_TC_IRQ_EN; /* always fire IRQ */ 171 control0 |= PL080_CONTROL_TC_IRQ_EN; /* always fire IRQ */
172 control0 |= (u32)chan->hw_width << PL080_CONTROL_DWIDTH_SHIFT;
173 control0 |= (u32)chan->hw_width << PL080_CONTROL_SWIDTH_SHIFT;
176 174
177 lli->src_addr = src; 175 lli->src_addr = src;
178 lli->dst_addr = dst; 176 lli->dst_addr = dst;
@@ -339,6 +337,7 @@ int s3c2410_dma_enqueue(unsigned int channel, void *id,
339 struct s3c64xx_dma_buff *next; 337 struct s3c64xx_dma_buff *next;
340 struct s3c64xx_dma_buff *buff; 338 struct s3c64xx_dma_buff *buff;
341 struct pl080s_lli *lli; 339 struct pl080s_lli *lli;
340 unsigned long flags;
342 int ret; 341 int ret;
343 342
344 WARN_ON(!chan); 343 WARN_ON(!chan);
@@ -366,6 +365,8 @@ int s3c2410_dma_enqueue(unsigned int channel, void *id,
366 365
367 s3c64xx_dma_fill_lli(chan, lli, data, size); 366 s3c64xx_dma_fill_lli(chan, lli, data, size);
368 367
368 local_irq_save(flags);
369
369 if ((next = chan->next) != NULL) { 370 if ((next = chan->next) != NULL) {
370 struct s3c64xx_dma_buff *end = chan->end; 371 struct s3c64xx_dma_buff *end = chan->end;
371 struct pl080s_lli *endlli = end->lli; 372 struct pl080s_lli *endlli = end->lli;
@@ -397,6 +398,8 @@ int s3c2410_dma_enqueue(unsigned int channel, void *id,
397 s3c64xx_lli_to_regs(chan, lli); 398 s3c64xx_lli_to_regs(chan, lli);
398 } 399 }
399 400
401 local_irq_restore(flags);
402
400 show_lli(lli); 403 show_lli(lli);
401 404
402 dbg_showchan(chan); 405 dbg_showchan(chan);
@@ -560,26 +563,11 @@ int s3c2410_dma_free(unsigned int channel, struct s3c2410_dma_client *client)
560 563
561EXPORT_SYMBOL(s3c2410_dma_free); 564EXPORT_SYMBOL(s3c2410_dma_free);
562 565
563
564static void s3c64xx_dma_tcirq(struct s3c64xx_dmac *dmac, int offs)
565{
566 struct s3c2410_dma_chan *chan = dmac->channels + offs;
567
568 /* note, we currently do not bother to work out which buffer
569 * or buffers have been completed since the last tc-irq. */
570
571 if (chan->callback_fn)
572 (chan->callback_fn)(chan, chan->curr->pw, 0, S3C2410_RES_OK);
573}
574
575static void s3c64xx_dma_errirq(struct s3c64xx_dmac *dmac, int offs)
576{
577 printk(KERN_DEBUG "%s: offs %d\n", __func__, offs);
578}
579
580static irqreturn_t s3c64xx_dma_irq(int irq, void *pw) 566static irqreturn_t s3c64xx_dma_irq(int irq, void *pw)
581{ 567{
582 struct s3c64xx_dmac *dmac = pw; 568 struct s3c64xx_dmac *dmac = pw;
569 struct s3c2410_dma_chan *chan;
570 enum s3c2410_dma_buffresult res;
583 u32 tcstat, errstat; 571 u32 tcstat, errstat;
584 u32 bit; 572 u32 bit;
585 int offs; 573 int offs;
@@ -588,14 +576,54 @@ static irqreturn_t s3c64xx_dma_irq(int irq, void *pw)
588 errstat = readl(dmac->regs + PL080_ERR_STATUS); 576 errstat = readl(dmac->regs + PL080_ERR_STATUS);
589 577
590 for (offs = 0, bit = 1; offs < 8; offs++, bit <<= 1) { 578 for (offs = 0, bit = 1; offs < 8; offs++, bit <<= 1) {
579 struct s3c64xx_dma_buff *buff;
580
581 if (!(errstat & bit) && !(tcstat & bit))
582 continue;
583
584 chan = dmac->channels + offs;
585 res = S3C2410_RES_ERR;
586
591 if (tcstat & bit) { 587 if (tcstat & bit) {
592 writel(bit, dmac->regs + PL080_TC_CLEAR); 588 writel(bit, dmac->regs + PL080_TC_CLEAR);
593 s3c64xx_dma_tcirq(dmac, offs); 589 res = S3C2410_RES_OK;
594 } 590 }
595 591
596 if (errstat & bit) { 592 if (errstat & bit)
597 s3c64xx_dma_errirq(dmac, offs);
598 writel(bit, dmac->regs + PL080_ERR_CLEAR); 593 writel(bit, dmac->regs + PL080_ERR_CLEAR);
594
595 /* 'next' points to the buffer that is next to the
596 * currently active buffer.
597 * For CIRCULAR queues, 'next' will be same as 'curr'
598 * when 'end' is the active buffer.
599 */
600 buff = chan->curr;
601 while (buff && buff != chan->next
602 && buff->next != chan->next)
603 buff = buff->next;
604
605 if (!buff)
606 BUG();
607
608 if (buff == chan->next)
609 buff = chan->end;
610
611 s3c64xx_dma_bufffdone(chan, buff, res);
612
613 /* Free the node and update curr, if non-circular queue */
614 if (!(chan->flags & S3C2410_DMAF_CIRCULAR)) {
615 chan->curr = buff->next;
616 s3c64xx_dma_freebuff(buff);
617 }
618
619 /* Update 'next' */
620 buff = chan->next;
621 if (chan->next == chan->end) {
622 chan->next = chan->curr;
623 if (!(chan->flags & S3C2410_DMAF_CIRCULAR))
624 chan->end = NULL;
625 } else {
626 chan->next = buff->next;
599 } 627 }
600 } 628 }
601 629
diff --git a/arch/arm/plat-s3c64xx/include/plat/regs-clock.h b/arch/arm/plat-s3c64xx/include/plat/regs-clock.h
index a8777a755dfa..ff46e7fa957a 100644
--- a/arch/arm/plat-s3c64xx/include/plat/regs-clock.h
+++ b/arch/arm/plat-s3c64xx/include/plat/regs-clock.h
@@ -51,8 +51,8 @@
51#define S3C6400_CLKDIV0_HCLK_SHIFT (8) 51#define S3C6400_CLKDIV0_HCLK_SHIFT (8)
52#define S3C6400_CLKDIV0_MPLL_MASK (0x1 << 4) 52#define S3C6400_CLKDIV0_MPLL_MASK (0x1 << 4)
53#define S3C6400_CLKDIV0_MPLL_SHIFT (4) 53#define S3C6400_CLKDIV0_MPLL_SHIFT (4)
54#define S3C6400_CLKDIV0_ARM_MASK (0x3 << 0) 54#define S3C6400_CLKDIV0_ARM_MASK (0x7 << 0)
55#define S3C6410_CLKDIV0_ARM_MASK (0x7 << 0) 55#define S3C6410_CLKDIV0_ARM_MASK (0xf << 0)
56#define S3C6400_CLKDIV0_ARM_SHIFT (0) 56#define S3C6400_CLKDIV0_ARM_SHIFT (0)
57 57
58/* CLKDIV1 */ 58/* CLKDIV1 */
diff --git a/arch/arm/plat-s3c64xx/s3c6400-clock.c b/arch/arm/plat-s3c64xx/s3c6400-clock.c
index 9745852261e0..6ffa21eb1b91 100644
--- a/arch/arm/plat-s3c64xx/s3c6400-clock.c
+++ b/arch/arm/plat-s3c64xx/s3c6400-clock.c
@@ -677,6 +677,9 @@ void __init_or_cpufreq s3c6400_setup_clocks(void)
677 677
678 printk(KERN_DEBUG "%s: xtal is %ld\n", __func__, xtal); 678 printk(KERN_DEBUG "%s: xtal is %ld\n", __func__, xtal);
679 679
680 /* For now assume the mux always selects the crystal */
681 clk_ext_xtal_mux.parent = xtal_clk;
682
680 epll = s3c6400_get_epll(xtal); 683 epll = s3c6400_get_epll(xtal);
681 mpll = s3c6400_get_pll(xtal, __raw_readl(S3C_MPLL_CON)); 684 mpll = s3c6400_get_pll(xtal, __raw_readl(S3C_MPLL_CON));
682 apll = s3c6400_get_pll(xtal, __raw_readl(S3C_APLL_CON)); 685 apll = s3c6400_get_pll(xtal, __raw_readl(S3C_APLL_CON));
diff --git a/arch/arm/tools/mach-types b/arch/arm/tools/mach-types
index 94be7bb6cb9a..07b976da6174 100644
--- a/arch/arm/tools/mach-types
+++ b/arch/arm/tools/mach-types
@@ -12,7 +12,7 @@
12# 12#
13# http://www.arm.linux.org.uk/developer/machines/?action=new 13# http://www.arm.linux.org.uk/developer/machines/?action=new
14# 14#
15# Last update: Fri Sep 18 21:42:00 2009 15# Last update: Wed Nov 25 22:14:58 2009
16# 16#
17# machine_is_xxx CONFIG_xxxx MACH_TYPE_xxx number 17# machine_is_xxx CONFIG_xxxx MACH_TYPE_xxx number
18# 18#
@@ -928,7 +928,7 @@ palmt5 MACH_PALMT5 PALMT5 917
928palmtc MACH_PALMTC PALMTC 918 928palmtc MACH_PALMTC PALMTC 918
929omap_apollon MACH_OMAP_APOLLON OMAP_APOLLON 919 929omap_apollon MACH_OMAP_APOLLON OMAP_APOLLON 919
930mxc30030evb MACH_MXC30030EVB MXC30030EVB 920 930mxc30030evb MACH_MXC30030EVB MXC30030EVB 920
931rea_2d MACH_REA_2D REA_2D 921 931rea_cpu2 MACH_REA_2D REA_2D 921
932eti3e524 MACH_TI3E524 TI3E524 922 932eti3e524 MACH_TI3E524 TI3E524 922
933ateb9200 MACH_ATEB9200 ATEB9200 923 933ateb9200 MACH_ATEB9200 ATEB9200 923
934auckland MACH_AUCKLAND AUCKLAND 924 934auckland MACH_AUCKLAND AUCKLAND 924
@@ -2421,3 +2421,118 @@ liberty MACH_LIBERTY LIBERTY 2434
2421mh355 MACH_MH355 MH355 2435 2421mh355 MACH_MH355 MH355 2435
2422pc7802 MACH_PC7802 PC7802 2436 2422pc7802 MACH_PC7802 PC7802 2436
2423gnet_sgc MACH_GNET_SGC GNET_SGC 2437 2423gnet_sgc MACH_GNET_SGC GNET_SGC 2437
2424einstein15 MACH_EINSTEIN15 EINSTEIN15 2438
2425cmpd MACH_CMPD CMPD 2439
2426davinci_hase1 MACH_DAVINCI_HASE1 DAVINCI_HASE1 2440
2427lgeincitephone MACH_LGEINCITEPHONE LGEINCITEPHONE 2441
2428ea313x MACH_EA313X EA313X 2442
2429fwbd_39064 MACH_FWBD_39064 FWBD_39064 2443
2430fwbd_390128 MACH_FWBD_390128 FWBD_390128 2444
2431pelco_moe MACH_PELCO_MOE PELCO_MOE 2445
2432minimix27 MACH_MINIMIX27 MINIMIX27 2446
2433omap3_thunder MACH_OMAP3_THUNDER OMAP3_THUNDER 2447
2434passionc MACH_PASSIONC PASSIONC 2448
2435mx27amata MACH_MX27AMATA MX27AMATA 2449
2436bgat1 MACH_BGAT1 BGAT1 2450
2437buzz MACH_BUZZ BUZZ 2451
2438mb9g20 MACH_MB9G20 MB9G20 2452
2439yushan MACH_YUSHAN YUSHAN 2453
2440lizard MACH_LIZARD LIZARD 2454
2441omap3polycom MACH_OMAP3POLYCOM OMAP3POLYCOM 2455
2442smdkv210 MACH_SMDKV210 SMDKV210 2456
2443bravo MACH_BRAVO BRAVO 2457
2444siogentoo1 MACH_SIOGENTOO1 SIOGENTOO1 2458
2445siogentoo2 MACH_SIOGENTOO2 SIOGENTOO2 2459
2446sm3k MACH_SM3K SM3K 2460
2447acer_tempo_f900 MACH_ACER_TEMPO_F900 ACER_TEMPO_F900 2461
2448sst61vc010_dev MACH_SST61VC010_DEV SST61VC010_DEV 2462
2449glittertind MACH_GLITTERTIND GLITTERTIND 2463
2450omap_zoom3 MACH_OMAP_ZOOM3 OMAP_ZOOM3 2464
2451omap_3630sdp MACH_OMAP_3630SDP OMAP_3630SDP 2465
2452cybook2440 MACH_CYBOOK2440 CYBOOK2440 2466
2453torino_s MACH_TORINO_S TORINO_S 2467
2454havana MACH_HAVANA HAVANA 2468
2455beaumont_11 MACH_BEAUMONT_11 BEAUMONT_11 2469
2456vanguard MACH_VANGUARD VANGUARD 2470
2457s5pc110_draco MACH_S5PC110_DRACO S5PC110_DRACO 2471
2458cartesio_two MACH_CARTESIO_TWO CARTESIO_TWO 2472
2459aster MACH_ASTER ASTER 2473
2460voguesv210 MACH_VOGUESV210 VOGUESV210 2474
2461acm500x MACH_ACM500X ACM500X 2475
2462km9260 MACH_KM9260 KM9260 2476
2463nideflexg1 MACH_NIDEFLEXG1 NIDEFLEXG1 2477
2464ctera_plug_io MACH_CTERA_PLUG_IO CTERA_PLUG_IO 2478
2465smartq7 MACH_SMARTQ7 SMARTQ7 2479
2466at91sam9g10ek2 MACH_AT91SAM9G10EK2 AT91SAM9G10EK2 2480
2467asusp527 MACH_ASUSP527 ASUSP527 2481
2468at91sam9g20mpm2 MACH_AT91SAM9G20MPM2 AT91SAM9G20MPM2 2482
2469topasa900 MACH_TOPASA900 TOPASA900 2483
2470electrum_100 MACH_ELECTRUM_100 ELECTRUM_100 2484
2471mx51grb MACH_MX51GRB MX51GRB 2485
2472xea300 MACH_XEA300 XEA300 2486
2473htcstartrek MACH_HTCSTARTREK HTCSTARTREK 2487
2474lima MACH_LIMA LIMA 2488
2475csb740 MACH_CSB740 CSB740 2489
2476usb_s8815 MACH_USB_S8815 USB_S8815 2490
2477watson_efm_plugin MACH_WATSON_EFM_PLUGIN WATSON_EFM_PLUGIN 2491
2478milkyway MACH_MILKYWAY MILKYWAY 2492
2479g4evm MACH_G4EVM G4EVM 2493
2480picomod6 MACH_PICOMOD6 PICOMOD6 2494
2481omapl138_hawkboard MACH_OMAPL138_HAWKBOARD OMAPL138_HAWKBOARD 2495
2482ip6000 MACH_IP6000 IP6000 2496
2483ip6010 MACH_IP6010 IP6010 2497
2484utm400 MACH_UTM400 UTM400 2498
2485omap3_zybex MACH_OMAP3_ZYBEX OMAP3_ZYBEX 2499
2486wireless_space MACH_WIRELESS_SPACE WIRELESS_SPACE 2500
2487sx560 MACH_SX560 SX560 2501
2488ts41x MACH_TS41X TS41X 2502
2489elphel10373 MACH_ELPHEL10373 ELPHEL10373 2503
2490rhobot MACH_RHOBOT RHOBOT 2504
2491mx51_refresh MACH_MX51_REFRESH MX51_REFRESH 2505
2492ls9260 MACH_LS9260 LS9260 2506
2493shank MACH_SHANK SHANK 2507
2494qsd8x50_st1 MACH_QSD8X50_ST1 QSD8X50_ST1 2508
2495at91sam9m10ekes MACH_AT91SAM9M10EKES AT91SAM9M10EKES 2509
2496hiram MACH_HIRAM HIRAM 2510
2497phy3250 MACH_PHY3250 PHY3250 2511
2498ea3250 MACH_EA3250 EA3250 2512
2499fdi3250 MACH_FDI3250 FDI3250 2513
2500whitestone MACH_WHITESTONE WHITESTONE 2514
2501at91sam9263nit MACH_AT91SAM9263NIT AT91SAM9263NIT 2515
2502ccmx51 MACH_CCMX51 CCMX51 2516
2503ccmx51js MACH_CCMX51JS CCMX51JS 2517
2504ccwmx51 MACH_CCWMX51 CCWMX51 2518
2505ccwmx51js MACH_CCWMX51JS CCWMX51JS 2519
2506mini6410 MACH_MINI6410 MINI6410 2520
2507tiny6410 MACH_TINY6410 TINY6410 2521
2508nano6410 MACH_NANO6410 NANO6410 2522
2509at572d940hfnldb MACH_AT572D940HFNLDB AT572D940HFNLDB 2523
2510htcleo MACH_HTCLEO HTCLEO 2524
2511avp13 MACH_AVP13 AVP13 2525
2512xxsvideod MACH_XXSVIDEOD XXSVIDEOD 2526
2513vpnext MACH_VPNEXT VPNEXT 2527
2514swarco_itc3 MACH_SWARCO_ITC3 SWARCO_ITC3 2528
2515tx51 MACH_TX51 TX51 2529
2516dolby_cat1021 MACH_DOLBY_CAT1021 DOLBY_CAT1021 2530
2517mx28evk MACH_MX28EVK MX28EVK 2531
2518phoenix260 MACH_PHOENIX260 PHOENIX260 2532
2519uvaca_stork MACH_UVACA_STORK UVACA_STORK 2533
2520smartq5 MACH_SMARTQ5 SMARTQ5 2534
2521all3078 MACH_ALL3078 ALL3078 2535
2522ctera_2bay_ds MACH_CTERA_2BAY_DS CTERA_2BAY_DS 2536
2523siogentoo3 MACH_SIOGENTOO3 SIOGENTOO3 2537
2524epb5000 MACH_EPB5000 EPB5000 2538
2525hy9263 MACH_HY9263 HY9263 2539
2526acer_tempo_m900 MACH_ACER_TEMPO_M900 ACER_TEMPO_M900 2540
2527acer_tempo_dx650 MACH_ACER_TEMPO_DX900 ACER_TEMPO_DX900 2541
2528acer_tempo_x960 MACH_ACER_TEMPO_X960 ACER_TEMPO_X960 2542
2529acer_eten_v900 MACH_ACER_ETEN_V900 ACER_ETEN_V900 2543
2530acer_eten_x900 MACH_ACER_ETEN_X900 ACER_ETEN_X900 2544
2531bonnell MACH_BONNELL BONNELL 2545
2532oht_mx27 MACH_OHT_MX27 OHT_MX27 2546
2533htcquartz MACH_HTCQUARTZ HTCQUARTZ 2547
2534davinci_dm6467tevm MACH_DAVINCI_DM6467TEVM DAVINCI_DM6467TEVM 2548
2535c3ax03 MACH_C3AX03 C3AX03 2549
2536mxt_td60 MACH_MXT_TD60 MXT_TD60 2550
2537esyx MACH_ESYX ESYX 2551
2538bulldog MACH_BULLDOG BULLDOG 2553
diff --git a/arch/avr32/include/asm/bug.h b/arch/avr32/include/asm/bug.h
index 331d45bab18f..2aa373cc61b5 100644
--- a/arch/avr32/include/asm/bug.h
+++ b/arch/avr32/include/asm/bug.h
@@ -52,7 +52,7 @@
52#define BUG() \ 52#define BUG() \
53 do { \ 53 do { \
54 _BUG_OR_WARN(0); \ 54 _BUG_OR_WARN(0); \
55 for (;;); \ 55 unreachable(); \
56 } while (0) 56 } while (0)
57 57
58#define WARN_ON(condition) \ 58#define WARN_ON(condition) \
diff --git a/arch/avr32/mach-at32ap/include/mach/cpu.h b/arch/avr32/mach-at32ap/include/mach/cpu.h
index 44d0bfa1f409..9c96a130f3a8 100644
--- a/arch/avr32/mach-at32ap/include/mach/cpu.h
+++ b/arch/avr32/mach-at32ap/include/mach/cpu.h
@@ -31,5 +31,8 @@
31#define cpu_is_at91sam9263() (0) 31#define cpu_is_at91sam9263() (0)
32#define cpu_is_at91sam9rl() (0) 32#define cpu_is_at91sam9rl() (0)
33#define cpu_is_at91cap9() (0) 33#define cpu_is_at91cap9() (0)
34#define cpu_is_at91sam9g10() (0)
35#define cpu_is_at91sam9g45() (0)
36#define cpu_is_at91sam9g45es() (0)
34 37
35#endif /* __ASM_ARCH_CPU_H */ 38#endif /* __ASM_ARCH_CPU_H */
diff --git a/arch/blackfin/kernel/bfin_dma_5xx.c b/arch/blackfin/kernel/bfin_dma_5xx.c
index 1f170216d2f9..3946aff4f414 100644
--- a/arch/blackfin/kernel/bfin_dma_5xx.c
+++ b/arch/blackfin/kernel/bfin_dma_5xx.c
@@ -225,8 +225,13 @@ int blackfin_dma_suspend(void)
225void blackfin_dma_resume(void) 225void blackfin_dma_resume(void)
226{ 226{
227 int i; 227 int i;
228 for (i = 0; i < MAX_DMA_SUSPEND_CHANNELS; ++i) 228
229 dma_ch[i].regs->peripheral_map = dma_ch[i].saved_peripheral_map; 229 for (i = 0; i < MAX_DMA_CHANNELS; ++i) {
230 dma_ch[i].regs->cfg = 0;
231
232 if (i < MAX_DMA_SUSPEND_CHANNELS)
233 dma_ch[i].regs->peripheral_map = dma_ch[i].saved_peripheral_map;
234 }
230} 235}
231#endif 236#endif
232 237
diff --git a/arch/blackfin/kernel/cplb-mpu/cplbinit.c b/arch/blackfin/kernel/cplb-mpu/cplbinit.c
index f7b9cdce8239..b52c1f8c4bc0 100644
--- a/arch/blackfin/kernel/cplb-mpu/cplbinit.c
+++ b/arch/blackfin/kernel/cplb-mpu/cplbinit.c
@@ -38,7 +38,7 @@ void __init generate_cplb_tables_cpu(unsigned int cpu)
38 38
39#ifdef CONFIG_BFIN_EXTMEM_DCACHEABLE 39#ifdef CONFIG_BFIN_EXTMEM_DCACHEABLE
40 d_cache = CPLB_L1_CHBL; 40 d_cache = CPLB_L1_CHBL;
41#ifdef CONFIG_BFIN_EXTMEM_WRITETROUGH 41#ifdef CONFIG_BFIN_EXTMEM_WRITETHROUGH
42 d_cache |= CPLB_L1_AOW | CPLB_WT; 42 d_cache |= CPLB_L1_AOW | CPLB_WT;
43#endif 43#endif
44#endif 44#endif
diff --git a/arch/blackfin/kernel/process.c b/arch/blackfin/kernel/process.c
index 430ae39456e8..5cc7e2e9e415 100644
--- a/arch/blackfin/kernel/process.c
+++ b/arch/blackfin/kernel/process.c
@@ -151,7 +151,7 @@ void start_thread(struct pt_regs *regs, unsigned long new_ip, unsigned long new_
151 regs->pc = new_ip; 151 regs->pc = new_ip;
152 if (current->mm) 152 if (current->mm)
153 regs->p5 = current->mm->start_data; 153 regs->p5 = current->mm->start_data;
154#ifdef CONFIG_SMP 154#ifndef CONFIG_SMP
155 task_thread_info(current)->l1_task_info.stack_start = 155 task_thread_info(current)->l1_task_info.stack_start =
156 (void *)current->mm->context.stack_start; 156 (void *)current->mm->context.stack_start;
157 task_thread_info(current)->l1_task_info.lowest_sp = (void *)new_sp; 157 task_thread_info(current)->l1_task_info.lowest_sp = (void *)new_sp;
diff --git a/arch/blackfin/kernel/ptrace.c b/arch/blackfin/kernel/ptrace.c
index 0982b5d5af10..56b0ba12175f 100644
--- a/arch/blackfin/kernel/ptrace.c
+++ b/arch/blackfin/kernel/ptrace.c
@@ -315,7 +315,7 @@ long arch_ptrace(struct task_struct *child, long request, long addr, long data)
315 case BFIN_MEM_ACCESS_CORE: 315 case BFIN_MEM_ACCESS_CORE:
316 case BFIN_MEM_ACCESS_CORE_ONLY: 316 case BFIN_MEM_ACCESS_CORE_ONLY:
317 copied = access_process_vm(child, addr, &data, 317 copied = access_process_vm(child, addr, &data,
318 to_copy, 0); 318 to_copy, 1);
319 if (copied) 319 if (copied)
320 break; 320 break;
321 321
diff --git a/arch/blackfin/mach-bf518/include/mach/anomaly.h b/arch/blackfin/mach-bf518/include/mach/anomaly.h
index e9c65390edd1..2829dd0400f1 100644
--- a/arch/blackfin/mach-bf518/include/mach/anomaly.h
+++ b/arch/blackfin/mach-bf518/include/mach/anomaly.h
@@ -1,9 +1,13 @@
1/* 1/*
2 * File: include/asm-blackfin/mach-bf518/anomaly.h 2 * DO NOT EDIT THIS FILE
3 * Bugs: Enter bugs at http://blackfin.uclinux.org/ 3 * This file is under version control at
4 * svn://sources.blackfin.uclinux.org/toolchain/trunk/proc-defs/header-frags/
5 * and can be replaced with that version at any time
6 * DO NOT EDIT THIS FILE
4 * 7 *
5 * Copyright (C) 2004-2009 Analog Devices Inc. 8 * Copyright 2004-2009 Analog Devices Inc.
6 * Licensed under the GPL-2 or later. 9 * Licensed under the ADI BSD license.
10 * https://docs.blackfin.uclinux.org/doku.php?id=adi_bsd
7 */ 11 */
8 12
9/* This file should be up to date with: 13/* This file should be up to date with:
@@ -70,6 +74,10 @@
70#define ANOMALY_05000461 (1) 74#define ANOMALY_05000461 (1)
71/* Synchronization Problem at Startup May Cause SPORT Transmit Channels to Misalign */ 75/* Synchronization Problem at Startup May Cause SPORT Transmit Channels to Misalign */
72#define ANOMALY_05000462 (1) 76#define ANOMALY_05000462 (1)
77/* Interrupted 32-Bit SPORT Data Register Access Results In Underflow */
78#define ANOMALY_05000473 (1)
79/* TESTSET Instruction Cannot Be Interrupted */
80#define ANOMALY_05000477 (1)
73 81
74/* Anomalies that don't exist on this proc */ 82/* Anomalies that don't exist on this proc */
75#define ANOMALY_05000099 (0) 83#define ANOMALY_05000099 (0)
@@ -133,5 +141,7 @@
133#define ANOMALY_05000450 (0) 141#define ANOMALY_05000450 (0)
134#define ANOMALY_05000465 (0) 142#define ANOMALY_05000465 (0)
135#define ANOMALY_05000467 (0) 143#define ANOMALY_05000467 (0)
144#define ANOMALY_05000474 (0)
145#define ANOMALY_05000475 (0)
136 146
137#endif 147#endif
diff --git a/arch/blackfin/mach-bf527/include/mach/anomaly.h b/arch/blackfin/mach-bf527/include/mach/anomaly.h
index 3f9052687fa8..02040df8ec80 100644
--- a/arch/blackfin/mach-bf527/include/mach/anomaly.h
+++ b/arch/blackfin/mach-bf527/include/mach/anomaly.h
@@ -1,14 +1,18 @@
1/* 1/*
2 * File: include/asm-blackfin/mach-bf527/anomaly.h 2 * DO NOT EDIT THIS FILE
3 * Bugs: Enter bugs at http://blackfin.uclinux.org/ 3 * This file is under version control at
4 * svn://sources.blackfin.uclinux.org/toolchain/trunk/proc-defs/header-frags/
5 * and can be replaced with that version at any time
6 * DO NOT EDIT THIS FILE
4 * 7 *
5 * Copyright (C) 2004-2009 Analog Devices Inc. 8 * Copyright 2004-2009 Analog Devices Inc.
6 * Licensed under the GPL-2 or later. 9 * Licensed under the ADI BSD license.
10 * https://docs.blackfin.uclinux.org/doku.php?id=adi_bsd
7 */ 11 */
8 12
9/* This file should be up to date with: 13/* This file should be up to date with:
10 * - Revision D, 08/14/2009; ADSP-BF526 Blackfin Processor Anomaly List 14 * - Revision D, 08/14/2009; ADSP-BF526 Blackfin Processor Anomaly List
11 * - Revision F, 03/03/2009; ADSP-BF527 Blackfin Processor Anomaly List 15 * - Revision G, 08/25/2009; ADSP-BF527 Blackfin Processor Anomaly List
12 */ 16 */
13 17
14#ifndef _MACH_ANOMALY_H_ 18#ifndef _MACH_ANOMALY_H_
@@ -200,6 +204,10 @@
200#define ANOMALY_05000467 (1) 204#define ANOMALY_05000467 (1)
201/* PLL Latches Incorrect Settings During Reset */ 205/* PLL Latches Incorrect Settings During Reset */
202#define ANOMALY_05000469 (1) 206#define ANOMALY_05000469 (1)
207/* Interrupted 32-Bit SPORT Data Register Access Results In Underflow */
208#define ANOMALY_05000473 (1)
209/* TESTSET Instruction Cannot Be Interrupted */
210#define ANOMALY_05000477 (1)
203 211
204/* Anomalies that don't exist on this proc */ 212/* Anomalies that don't exist on this proc */
205#define ANOMALY_05000099 (0) 213#define ANOMALY_05000099 (0)
@@ -250,5 +258,7 @@
250#define ANOMALY_05000412 (0) 258#define ANOMALY_05000412 (0)
251#define ANOMALY_05000447 (0) 259#define ANOMALY_05000447 (0)
252#define ANOMALY_05000448 (0) 260#define ANOMALY_05000448 (0)
261#define ANOMALY_05000474 (0)
262#define ANOMALY_05000475 (0)
253 263
254#endif 264#endif
diff --git a/arch/blackfin/mach-bf533/include/mach/anomaly.h b/arch/blackfin/mach-bf533/include/mach/anomaly.h
index cd83db2fb1a1..9b3f7a27714d 100644
--- a/arch/blackfin/mach-bf533/include/mach/anomaly.h
+++ b/arch/blackfin/mach-bf533/include/mach/anomaly.h
@@ -1,9 +1,13 @@
1/* 1/*
2 * File: include/asm-blackfin/mach-bf533/anomaly.h 2 * DO NOT EDIT THIS FILE
3 * Bugs: Enter bugs at http://blackfin.uclinux.org/ 3 * This file is under version control at
4 * svn://sources.blackfin.uclinux.org/toolchain/trunk/proc-defs/header-frags/
5 * and can be replaced with that version at any time
6 * DO NOT EDIT THIS FILE
4 * 7 *
5 * Copyright (C) 2004-2009 Analog Devices Inc. 8 * Copyright 2004-2009 Analog Devices Inc.
6 * Licensed under the GPL-2 or later. 9 * Licensed under the ADI BSD license.
10 * https://docs.blackfin.uclinux.org/doku.php?id=adi_bsd
7 */ 11 */
8 12
9/* This file should be up to date with: 13/* This file should be up to date with:
@@ -202,6 +206,10 @@
202#define ANOMALY_05000443 (1) 206#define ANOMALY_05000443 (1)
203/* False Hardware Error when RETI Points to Invalid Memory */ 207/* False Hardware Error when RETI Points to Invalid Memory */
204#define ANOMALY_05000461 (1) 208#define ANOMALY_05000461 (1)
209/* Interrupted 32-Bit SPORT Data Register Access Results In Underflow */
210#define ANOMALY_05000473 (1)
211/* TESTSET Instruction Cannot Be Interrupted */
212#define ANOMALY_05000477 (1)
205 213
206/* These anomalies have been "phased" out of analog.com anomaly sheets and are 214/* These anomalies have been "phased" out of analog.com anomaly sheets and are
207 * here to show running on older silicon just isn't feasible. 215 * here to show running on older silicon just isn't feasible.
@@ -349,5 +357,7 @@
349#define ANOMALY_05000450 (0) 357#define ANOMALY_05000450 (0)
350#define ANOMALY_05000465 (0) 358#define ANOMALY_05000465 (0)
351#define ANOMALY_05000467 (0) 359#define ANOMALY_05000467 (0)
360#define ANOMALY_05000474 (0)
361#define ANOMALY_05000475 (0)
352 362
353#endif 363#endif
diff --git a/arch/blackfin/mach-bf537/include/mach/anomaly.h b/arch/blackfin/mach-bf537/include/mach/anomaly.h
index f091ad2d8ea8..d2c427bc6656 100644
--- a/arch/blackfin/mach-bf537/include/mach/anomaly.h
+++ b/arch/blackfin/mach-bf537/include/mach/anomaly.h
@@ -1,9 +1,13 @@
1/* 1/*
2 * File: include/asm-blackfin/mach-bf537/anomaly.h 2 * DO NOT EDIT THIS FILE
3 * Bugs: Enter bugs at http://blackfin.uclinux.org/ 3 * This file is under version control at
4 * svn://sources.blackfin.uclinux.org/toolchain/trunk/proc-defs/header-frags/
5 * and can be replaced with that version at any time
6 * DO NOT EDIT THIS FILE
4 * 7 *
5 * Copyright (C) 2004-2009 Analog Devices Inc. 8 * Copyright 2004-2009 Analog Devices Inc.
6 * Licensed under the GPL-2 or later. 9 * Licensed under the ADI BSD license.
10 * https://docs.blackfin.uclinux.org/doku.php?id=adi_bsd
7 */ 11 */
8 12
9/* This file should be up to date with: 13/* This file should be up to date with:
@@ -156,6 +160,10 @@
156#define ANOMALY_05000443 (1) 160#define ANOMALY_05000443 (1)
157/* False Hardware Error when RETI Points to Invalid Memory */ 161/* False Hardware Error when RETI Points to Invalid Memory */
158#define ANOMALY_05000461 (1) 162#define ANOMALY_05000461 (1)
163/* Interrupted 32-Bit SPORT Data Register Access Results In Underflow */
164#define ANOMALY_05000473 (1)
165/* TESTSET Instruction Cannot Be Interrupted */
166#define ANOMALY_05000477 (1)
159 167
160/* Anomalies that don't exist on this proc */ 168/* Anomalies that don't exist on this proc */
161#define ANOMALY_05000099 (0) 169#define ANOMALY_05000099 (0)
@@ -202,5 +210,7 @@
202#define ANOMALY_05000450 (0) 210#define ANOMALY_05000450 (0)
203#define ANOMALY_05000465 (0) 211#define ANOMALY_05000465 (0)
204#define ANOMALY_05000467 (0) 212#define ANOMALY_05000467 (0)
213#define ANOMALY_05000474 (0)
214#define ANOMALY_05000475 (0)
205 215
206#endif 216#endif
diff --git a/arch/blackfin/mach-bf538/include/mach/anomaly.h b/arch/blackfin/mach-bf538/include/mach/anomaly.h
index 26b76083e14c..d882b7e6f59b 100644
--- a/arch/blackfin/mach-bf538/include/mach/anomaly.h
+++ b/arch/blackfin/mach-bf538/include/mach/anomaly.h
@@ -1,9 +1,13 @@
1/* 1/*
2 * File: include/asm-blackfin/mach-bf538/anomaly.h 2 * DO NOT EDIT THIS FILE
3 * Bugs: Enter bugs at http://blackfin.uclinux.org/ 3 * This file is under version control at
4 * svn://sources.blackfin.uclinux.org/toolchain/trunk/proc-defs/header-frags/
5 * and can be replaced with that version at any time
6 * DO NOT EDIT THIS FILE
4 * 7 *
5 * Copyright (C) 2004-2009 Analog Devices Inc. 8 * Copyright 2004-2009 Analog Devices Inc.
6 * Licensed under the GPL-2 or later. 9 * Licensed under the ADI BSD license.
10 * https://docs.blackfin.uclinux.org/doku.php?id=adi_bsd
7 */ 11 */
8 12
9/* This file should be up to date with: 13/* This file should be up to date with:
@@ -128,6 +132,10 @@
128#define ANOMALY_05000443 (1) 132#define ANOMALY_05000443 (1)
129/* False Hardware Error when RETI Points to Invalid Memory */ 133/* False Hardware Error when RETI Points to Invalid Memory */
130#define ANOMALY_05000461 (1) 134#define ANOMALY_05000461 (1)
135/* Interrupted 32-Bit SPORT Data Register Access Results In Underflow */
136#define ANOMALY_05000473 (1)
137/* TESTSET Instruction Cannot Be Interrupted */
138#define ANOMALY_05000477 (1)
131 139
132/* Anomalies that don't exist on this proc */ 140/* Anomalies that don't exist on this proc */
133#define ANOMALY_05000099 (0) 141#define ANOMALY_05000099 (0)
@@ -176,5 +184,7 @@
176#define ANOMALY_05000450 (0) 184#define ANOMALY_05000450 (0)
177#define ANOMALY_05000465 (0) 185#define ANOMALY_05000465 (0)
178#define ANOMALY_05000467 (0) 186#define ANOMALY_05000467 (0)
187#define ANOMALY_05000474 (0)
188#define ANOMALY_05000475 (0)
179 189
180#endif 190#endif
diff --git a/arch/blackfin/mach-bf548/include/mach/anomaly.h b/arch/blackfin/mach-bf548/include/mach/anomaly.h
index 52b116ae522a..7d08c7524498 100644
--- a/arch/blackfin/mach-bf548/include/mach/anomaly.h
+++ b/arch/blackfin/mach-bf548/include/mach/anomaly.h
@@ -1,9 +1,13 @@
1/* 1/*
2 * File: include/asm-blackfin/mach-bf548/anomaly.h 2 * DO NOT EDIT THIS FILE
3 * Bugs: Enter bugs at http://blackfin.uclinux.org/ 3 * This file is under version control at
4 * svn://sources.blackfin.uclinux.org/toolchain/trunk/proc-defs/header-frags/
5 * and can be replaced with that version at any time
6 * DO NOT EDIT THIS FILE
4 * 7 *
5 * Copyright (C) 2004-2009 Analog Devices Inc. 8 * Copyright 2004-2009 Analog Devices Inc.
6 * Licensed under the GPL-2 or later. 9 * Licensed under the ADI BSD license.
10 * https://docs.blackfin.uclinux.org/doku.php?id=adi_bsd
7 */ 11 */
8 12
9/* This file should be up to date with: 13/* This file should be up to date with:
@@ -24,6 +28,8 @@
24#define ANOMALY_05000119 (1) 28#define ANOMALY_05000119 (1)
25/* Rx.H Cannot Be Used to Access 16-bit System MMR Registers */ 29/* Rx.H Cannot Be Used to Access 16-bit System MMR Registers */
26#define ANOMALY_05000122 (1) 30#define ANOMALY_05000122 (1)
31/* Data Corruption with Cached External Memory and Non-Cached On-Chip L2 Memory */
32#define ANOMALY_05000220 (1)
27/* False Hardware Error from an Access in the Shadow of a Conditional Branch */ 33/* False Hardware Error from an Access in the Shadow of a Conditional Branch */
28#define ANOMALY_05000245 (1) 34#define ANOMALY_05000245 (1)
29/* Sensitivity To Noise with Slow Input Edge Rates on External SPORT TX and RX Clocks */ 35/* Sensitivity To Noise with Slow Input Edge Rates on External SPORT TX and RX Clocks */
@@ -200,6 +206,14 @@
200#define ANOMALY_05000466 (1) 206#define ANOMALY_05000466 (1)
201/* Possible RX data corruption when control & data EP FIFOs are accessed via the core */ 207/* Possible RX data corruption when control & data EP FIFOs are accessed via the core */
202#define ANOMALY_05000467 (1) 208#define ANOMALY_05000467 (1)
209/* Interrupted 32-Bit SPORT Data Register Access Results In Underflow */
210#define ANOMALY_05000473 (1)
211/* Access to DDR-SDRAM causes system hang under certain PLL/VR settings */
212#define ANOMALY_05000474 (1)
213/* Core Hang With L2/L3 Configured in Writeback Cache Mode */
214#define ANOMALY_05000475 (1)
215/* TESTSET Instruction Cannot Be Interrupted */
216#define ANOMALY_05000477 (1)
203 217
204/* Anomalies that don't exist on this proc */ 218/* Anomalies that don't exist on this proc */
205#define ANOMALY_05000099 (0) 219#define ANOMALY_05000099 (0)
@@ -215,7 +229,6 @@
215#define ANOMALY_05000198 (0) 229#define ANOMALY_05000198 (0)
216#define ANOMALY_05000202 (0) 230#define ANOMALY_05000202 (0)
217#define ANOMALY_05000215 (0) 231#define ANOMALY_05000215 (0)
218#define ANOMALY_05000220 (0)
219#define ANOMALY_05000227 (0) 232#define ANOMALY_05000227 (0)
220#define ANOMALY_05000230 (0) 233#define ANOMALY_05000230 (0)
221#define ANOMALY_05000231 (0) 234#define ANOMALY_05000231 (0)
diff --git a/arch/blackfin/mach-bf561/atomic.S b/arch/blackfin/mach-bf561/atomic.S
index 0261a5e751b3..f99f174b129f 100644
--- a/arch/blackfin/mach-bf561/atomic.S
+++ b/arch/blackfin/mach-bf561/atomic.S
@@ -19,6 +19,16 @@
19 \reg\().h = _corelock; 19 \reg\().h = _corelock;
20.endm 20.endm
21 21
22.macro safe_testset addr:req, scratch:req
23#if ANOMALY_05000477
24 cli \scratch;
25 testset (\addr);
26 sti \scratch;
27#else
28 testset (\addr);
29#endif
30.endm
31
22/* 32/*
23 * r0 = address of atomic data to flush and invalidate (32bit). 33 * r0 = address of atomic data to flush and invalidate (32bit).
24 * 34 *
@@ -33,7 +43,7 @@ ENTRY(_get_core_lock)
33 cli r0; 43 cli r0;
34 coreslot_loadaddr p0; 44 coreslot_loadaddr p0;
35.Lretry_corelock: 45.Lretry_corelock:
36 testset (p0); 46 safe_testset p0, r2;
37 if cc jump .Ldone_corelock; 47 if cc jump .Ldone_corelock;
38 SSYNC(r2); 48 SSYNC(r2);
39 jump .Lretry_corelock 49 jump .Lretry_corelock
@@ -56,7 +66,7 @@ ENTRY(_get_core_lock_noflush)
56 cli r0; 66 cli r0;
57 coreslot_loadaddr p0; 67 coreslot_loadaddr p0;
58.Lretry_corelock_noflush: 68.Lretry_corelock_noflush:
59 testset (p0); 69 safe_testset p0, r2;
60 if cc jump .Ldone_corelock_noflush; 70 if cc jump .Ldone_corelock_noflush;
61 SSYNC(r2); 71 SSYNC(r2);
62 jump .Lretry_corelock_noflush 72 jump .Lretry_corelock_noflush
diff --git a/arch/blackfin/mach-bf561/include/mach/anomaly.h b/arch/blackfin/mach-bf561/include/mach/anomaly.h
index 70da495c9665..5ddc981e9937 100644
--- a/arch/blackfin/mach-bf561/include/mach/anomaly.h
+++ b/arch/blackfin/mach-bf561/include/mach/anomaly.h
@@ -1,9 +1,13 @@
1/* 1/*
2 * File: include/asm-blackfin/mach-bf561/anomaly.h 2 * DO NOT EDIT THIS FILE
3 * Bugs: Enter bugs at http://blackfin.uclinux.org/ 3 * This file is under version control at
4 * svn://sources.blackfin.uclinux.org/toolchain/trunk/proc-defs/header-frags/
5 * and can be replaced with that version at any time
6 * DO NOT EDIT THIS FILE
4 * 7 *
5 * Copyright (C) 2004-2009 Analog Devices Inc. 8 * Copyright 2004-2009 Analog Devices Inc.
6 * Licensed under the GPL-2 or later. 9 * Licensed under the ADI BSD license.
10 * https://docs.blackfin.uclinux.org/doku.php?id=adi_bsd
7 */ 11 */
8 12
9/* This file should be up to date with: 13/* This file should be up to date with:
@@ -213,7 +217,11 @@
213/* Disabling Peripherals with DMA Running May Cause DMA System Instability */ 217/* Disabling Peripherals with DMA Running May Cause DMA System Instability */
214#define ANOMALY_05000278 (__SILICON_REVISION__ < 5) 218#define ANOMALY_05000278 (__SILICON_REVISION__ < 5)
215/* False Hardware Error Exception when ISR Context Is Not Restored */ 219/* False Hardware Error Exception when ISR Context Is Not Restored */
216#define ANOMALY_05000281 (__SILICON_REVISION__ < 5) 220/* Temporarily walk around for bug 5423 till this issue is confirmed by
221 * official anomaly document. It looks 05000281 still exists on bf561
222 * v0.5.
223 */
224#define ANOMALY_05000281 (__SILICON_REVISION__ <= 5)
217/* System MMR Write Is Stalled Indefinitely when Killed in a Particular Stage */ 225/* System MMR Write Is Stalled Indefinitely when Killed in a Particular Stage */
218#define ANOMALY_05000283 (1) 226#define ANOMALY_05000283 (1)
219/* Reads Will Receive Incorrect Data under Certain Conditions */ 227/* Reads Will Receive Incorrect Data under Certain Conditions */
@@ -280,6 +288,12 @@
280#define ANOMALY_05000443 (1) 288#define ANOMALY_05000443 (1)
281/* False Hardware Error when RETI Points to Invalid Memory */ 289/* False Hardware Error when RETI Points to Invalid Memory */
282#define ANOMALY_05000461 (1) 290#define ANOMALY_05000461 (1)
291/* Interrupted 32-Bit SPORT Data Register Access Results In Underflow */
292#define ANOMALY_05000473 (1)
293/* Core Hang With L2/L3 Configured in Writeback Cache Mode */
294#define ANOMALY_05000475 (__SILICON_REVISION__ < 4)
295/* TESTSET Instruction Cannot Be Interrupted */
296#define ANOMALY_05000477 (1)
283 297
284/* Anomalies that don't exist on this proc */ 298/* Anomalies that don't exist on this proc */
285#define ANOMALY_05000119 (0) 299#define ANOMALY_05000119 (0)
@@ -304,5 +318,6 @@
304#define ANOMALY_05000450 (0) 318#define ANOMALY_05000450 (0)
305#define ANOMALY_05000465 (0) 319#define ANOMALY_05000465 (0)
306#define ANOMALY_05000467 (0) 320#define ANOMALY_05000467 (0)
321#define ANOMALY_05000474 (0)
307 322
308#endif 323#endif
diff --git a/arch/blackfin/mach-common/arch_checks.c b/arch/blackfin/mach-common/arch_checks.c
index 9dbafcdcf479..f2ca211a76a0 100644
--- a/arch/blackfin/mach-common/arch_checks.c
+++ b/arch/blackfin/mach-common/arch_checks.c
@@ -57,3 +57,8 @@
57 (!defined(CONFIG_BFIN_EXTMEM_DCACHEABLE) && defined(CONFIG_BFIN_L2_WRITEBACK))) 57 (!defined(CONFIG_BFIN_EXTMEM_DCACHEABLE) && defined(CONFIG_BFIN_L2_WRITEBACK)))
58# error You are exposing Anomaly 220 in this config, either config L2 as Write Through, or make External Memory WB. 58# error You are exposing Anomaly 220 in this config, either config L2 as Write Through, or make External Memory WB.
59#endif 59#endif
60
61#if ANOMALY_05000475 && \
62 (defined(CONFIG_BFIN_EXTMEM_WRITEBACK) || defined(CONFIG_BFIN_L2_WRITEBACK))
63# error "Anomaly 475 does not allow you to use Write Back cache with L2 or External Memory"
64#endif
diff --git a/arch/blackfin/mach-common/smp.c b/arch/blackfin/mach-common/smp.c
index d98585f3237d..d92b168c8328 100644
--- a/arch/blackfin/mach-common/smp.c
+++ b/arch/blackfin/mach-common/smp.c
@@ -276,10 +276,9 @@ void smp_send_reschedule(int cpu)
276 if (cpu_is_offline(cpu)) 276 if (cpu_is_offline(cpu))
277 return; 277 return;
278 278
279 msg = kmalloc(sizeof(*msg), GFP_ATOMIC); 279 msg = kzalloc(sizeof(*msg), GFP_ATOMIC);
280 if (!msg) 280 if (!msg)
281 return; 281 return;
282 memset(msg, 0, sizeof(msg));
283 INIT_LIST_HEAD(&msg->list); 282 INIT_LIST_HEAD(&msg->list);
284 msg->type = BFIN_IPI_RESCHEDULE; 283 msg->type = BFIN_IPI_RESCHEDULE;
285 284
@@ -305,10 +304,9 @@ void smp_send_stop(void)
305 if (cpus_empty(callmap)) 304 if (cpus_empty(callmap))
306 return; 305 return;
307 306
308 msg = kmalloc(sizeof(*msg), GFP_ATOMIC); 307 msg = kzalloc(sizeof(*msg), GFP_ATOMIC);
309 if (!msg) 308 if (!msg)
310 return; 309 return;
311 memset(msg, 0, sizeof(msg));
312 INIT_LIST_HEAD(&msg->list); 310 INIT_LIST_HEAD(&msg->list);
313 msg->type = BFIN_IPI_CPU_STOP; 311 msg->type = BFIN_IPI_CPU_STOP;
314 312
diff --git a/arch/ia64/include/asm/swiotlb.h b/arch/ia64/include/asm/swiotlb.h
index dcbaea7ce128..f0acde68aaea 100644
--- a/arch/ia64/include/asm/swiotlb.h
+++ b/arch/ia64/include/asm/swiotlb.h
@@ -4,8 +4,6 @@
4#include <linux/dma-mapping.h> 4#include <linux/dma-mapping.h>
5#include <linux/swiotlb.h> 5#include <linux/swiotlb.h>
6 6
7extern int swiotlb_force;
8
9#ifdef CONFIG_SWIOTLB 7#ifdef CONFIG_SWIOTLB
10extern int swiotlb; 8extern int swiotlb;
11extern void pci_swiotlb_init(void); 9extern void pci_swiotlb_init(void);
diff --git a/arch/ia64/kernel/pci-swiotlb.c b/arch/ia64/kernel/pci-swiotlb.c
index 285aae8431c6..53292abf846c 100644
--- a/arch/ia64/kernel/pci-swiotlb.c
+++ b/arch/ia64/kernel/pci-swiotlb.c
@@ -41,7 +41,7 @@ struct dma_map_ops swiotlb_dma_ops = {
41void __init swiotlb_dma_init(void) 41void __init swiotlb_dma_init(void)
42{ 42{
43 dma_ops = &swiotlb_dma_ops; 43 dma_ops = &swiotlb_dma_ops;
44 swiotlb_init(); 44 swiotlb_init(1);
45} 45}
46 46
47void __init pci_swiotlb_init(void) 47void __init pci_swiotlb_init(void)
@@ -51,7 +51,7 @@ void __init pci_swiotlb_init(void)
51 swiotlb = 1; 51 swiotlb = 1;
52 printk(KERN_INFO "PCI-DMA: Re-initialize machine vector.\n"); 52 printk(KERN_INFO "PCI-DMA: Re-initialize machine vector.\n");
53 machvec_init("dig"); 53 machvec_init("dig");
54 swiotlb_init(); 54 swiotlb_init(1);
55 dma_ops = &swiotlb_dma_ops; 55 dma_ops = &swiotlb_dma_ops;
56#else 56#else
57 panic("Unable to find Intel IOMMU"); 57 panic("Unable to find Intel IOMMU");
diff --git a/arch/m32r/Kconfig b/arch/m32r/Kconfig
index c41234f1b825..3a9319f93e89 100644
--- a/arch/m32r/Kconfig
+++ b/arch/m32r/Kconfig
@@ -11,6 +11,9 @@ config M32R
11 select HAVE_IDE 11 select HAVE_IDE
12 select HAVE_OPROFILE 12 select HAVE_OPROFILE
13 select INIT_ALL_POSSIBLE 13 select INIT_ALL_POSSIBLE
14 select HAVE_KERNEL_GZIP
15 select HAVE_KERNEL_BZIP2
16 select HAVE_KERNEL_LZMA
14 17
15config SBUS 18config SBUS
16 bool 19 bool
diff --git a/arch/m32r/boot/compressed/Makefile b/arch/m32r/boot/compressed/Makefile
index 560484ae35ec..177716b1d613 100644
--- a/arch/m32r/boot/compressed/Makefile
+++ b/arch/m32r/boot/compressed/Makefile
@@ -1,11 +1,11 @@
1# 1#
2# linux/arch/sh/boot/compressed/Makefile 2# linux/arch/m32r/boot/compressed/Makefile
3# 3#
4# create a compressed vmlinux image from the original vmlinux 4# create a compressed vmlinux image from the original vmlinux
5# 5#
6 6
7targets := vmlinux vmlinux.bin vmlinux.bin.gz head.o misc.o \ 7targets := vmlinux vmlinux.bin vmlinux.bin.gz vmlinux.bin.bz2 \
8 piggy.o vmlinux.lds 8 vmlinux.bin.lzma head.o misc.o piggy.o vmlinux.lds
9 9
10OBJECTS = $(obj)/head.o $(obj)/misc.o 10OBJECTS = $(obj)/head.o $(obj)/misc.o
11 11
@@ -27,6 +27,12 @@ $(obj)/vmlinux.bin: vmlinux FORCE
27$(obj)/vmlinux.bin.gz: $(obj)/vmlinux.bin FORCE 27$(obj)/vmlinux.bin.gz: $(obj)/vmlinux.bin FORCE
28 $(call if_changed,gzip) 28 $(call if_changed,gzip)
29 29
30$(obj)/vmlinux.bin.bz2: $(obj)/vmlinux.bin FORCE
31 $(call if_changed,bzip2)
32
33$(obj)/vmlinux.bin.lzma: $(obj)/vmlinux.bin FORCE
34 $(call if_changed,lzma)
35
30CFLAGS_misc.o += -fpic 36CFLAGS_misc.o += -fpic
31 37
32ifdef CONFIG_MMU 38ifdef CONFIG_MMU
@@ -37,5 +43,9 @@ endif
37 43
38OBJCOPYFLAGS += -R .empty_zero_page 44OBJCOPYFLAGS += -R .empty_zero_page
39 45
40$(obj)/piggy.o: $(obj)/vmlinux.scr $(obj)/vmlinux.bin.gz FORCE 46suffix_$(CONFIG_KERNEL_GZIP) = gz
47suffix_$(CONFIG_KERNEL_BZIP2) = bz2
48suffix_$(CONFIG_KERNEL_LZMA) = lzma
49
50$(obj)/piggy.o: $(obj)/vmlinux.scr $(obj)/vmlinux.bin.$(suffix-y) FORCE
41 $(call if_changed,ld) 51 $(call if_changed,ld)
diff --git a/arch/m32r/boot/compressed/misc.c b/arch/m32r/boot/compressed/misc.c
index d394292498c0..370d60881977 100644
--- a/arch/m32r/boot/compressed/misc.c
+++ b/arch/m32r/boot/compressed/misc.c
@@ -9,140 +9,49 @@
9 * Adapted for SH by Stuart Menefy, Aug 1999 9 * Adapted for SH by Stuart Menefy, Aug 1999
10 * 10 *
11 * 2003-02-12: Support M32R by Takeo Takahashi 11 * 2003-02-12: Support M32R by Takeo Takahashi
12 * This is based on arch/sh/boot/compressed/misc.c.
13 */ 12 */
14 13
15#include <linux/string.h>
16
17/* 14/*
18 * gzip declarations 15 * gzip declarations
19 */ 16 */
20
21#define OF(args) args
22#define STATIC static 17#define STATIC static
23 18
24#undef memset 19#undef memset
25#undef memcpy 20#undef memcpy
26#define memzero(s, n) memset ((s), 0, (n)) 21#define memzero(s, n) memset ((s), 0, (n))
27 22
28typedef unsigned char uch;
29typedef unsigned short ush;
30typedef unsigned long ulg;
31
32#define WSIZE 0x8000 /* Window size must be at least 32k, */
33 /* and a power of two */
34
35static uch *inbuf; /* input buffer */
36static uch window[WSIZE]; /* Sliding window buffer */
37
38static unsigned insize = 0; /* valid bytes in inbuf */
39static unsigned inptr = 0; /* index of next byte to be processed in inbuf */
40static unsigned outcnt = 0; /* bytes in output buffer */
41
42/* gzip flag byte */
43#define ASCII_FLAG 0x01 /* bit 0 set: file probably ASCII text */
44#define CONTINUATION 0x02 /* bit 1 set: continuation of multi-part gzip file */
45#define EXTRA_FIELD 0x04 /* bit 2 set: extra field present */
46#define ORIG_NAME 0x08 /* bit 3 set: original file name present */
47#define COMMENT 0x10 /* bit 4 set: file comment present */
48#define ENCRYPTED 0x20 /* bit 5 set: file is encrypted */
49#define RESERVED 0xC0 /* bit 6,7: reserved */
50
51#define get_byte() (inptr < insize ? inbuf[inptr++] : fill_inbuf())
52
53/* Diagnostic functions */
54#ifdef DEBUG
55# define Assert(cond,msg) {if(!(cond)) error(msg);}
56# define Trace(x) fprintf x
57# define Tracev(x) {if (verbose) fprintf x ;}
58# define Tracevv(x) {if (verbose>1) fprintf x ;}
59# define Tracec(c,x) {if (verbose && (c)) fprintf x ;}
60# define Tracecv(c,x) {if (verbose>1 && (c)) fprintf x ;}
61#else
62# define Assert(cond,msg)
63# define Trace(x)
64# define Tracev(x)
65# define Tracevv(x)
66# define Tracec(c,x)
67# define Tracecv(c,x)
68#endif
69
70static int fill_inbuf(void);
71static void flush_window(void);
72static void error(char *m); 23static void error(char *m);
73 24
74static unsigned char *input_data;
75static int input_len;
76
77static long bytes_out = 0;
78static uch *output_data;
79static unsigned long output_ptr = 0;
80
81#include "m32r_sio.c" 25#include "m32r_sio.c"
82 26
83static unsigned long free_mem_ptr; 27static unsigned long free_mem_ptr;
84static unsigned long free_mem_end_ptr; 28static unsigned long free_mem_end_ptr;
85 29
86#define HEAP_SIZE 0x10000 30#ifdef CONFIG_KERNEL_BZIP2
87 31static void *memset(void *s, int c, size_t n)
88#include "../../../../lib/inflate.c"
89
90void* memset(void* s, int c, size_t n)
91{ 32{
92 int i; 33 char *ss = s;
93 char *ss = (char*)s;
94 34
95 for (i=0;i<n;i++) ss[i] = c; 35 while (n--)
36 *ss++ = c;
96 return s; 37 return s;
97} 38}
39#endif
98 40
99void* memcpy(void* __dest, __const void* __src, 41#ifdef CONFIG_KERNEL_GZIP
100 size_t __n) 42#define BOOT_HEAP_SIZE 0x10000
101{ 43#include "../../../../lib/decompress_inflate.c"
102 int i; 44#endif
103 char *d = (char *)__dest, *s = (char *)__src;
104
105 for (i=0;i<__n;i++) d[i] = s[i];
106 return __dest;
107}
108
109/* ===========================================================================
110 * Fill the input buffer. This is called only when the buffer is empty
111 * and at least one byte is really needed.
112 */
113static int fill_inbuf(void)
114{
115 if (insize != 0) {
116 error("ran out of input data");
117 }
118
119 inbuf = input_data;
120 insize = input_len;
121 inptr = 1;
122 return inbuf[0];
123}
124 45
125/* =========================================================================== 46#ifdef CONFIG_KERNEL_BZIP2
126 * Write the output window window[0..outcnt-1] and update crc and bytes_out. 47#define BOOT_HEAP_SIZE 0x400000
127 * (Used for the decompressed data only.) 48#include "../../../../lib/decompress_bunzip2.c"
128 */ 49#endif
129static void flush_window(void)
130{
131 ulg c = crc; /* temporary variable */
132 unsigned n;
133 uch *in, *out, ch;
134 50
135 in = window; 51#ifdef CONFIG_KERNEL_LZMA
136 out = &output_data[output_ptr]; 52#define BOOT_HEAP_SIZE 0x10000
137 for (n = 0; n < outcnt; n++) { 53#include "../../../../lib/decompress_unlzma.c"
138 ch = *out++ = *in++; 54#endif
139 c = crc_32_tab[((int)c ^ ch) & 0xff] ^ (c >> 8);
140 }
141 crc = c;
142 bytes_out += (ulg)outcnt;
143 output_ptr += (ulg)outcnt;
144 outcnt = 0;
145}
146 55
147static void error(char *x) 56static void error(char *x)
148{ 57{
@@ -153,20 +62,20 @@ static void error(char *x)
153 while(1); /* Halt */ 62 while(1); /* Halt */
154} 63}
155 64
156/* return decompressed size */
157void 65void
158decompress_kernel(int mmu_on, unsigned char *zimage_data, 66decompress_kernel(int mmu_on, unsigned char *zimage_data,
159 unsigned int zimage_len, unsigned long heap) 67 unsigned int zimage_len, unsigned long heap)
160{ 68{
69 unsigned char *input_data = zimage_data;
70 int input_len = zimage_len;
71 unsigned char *output_data;
72
161 output_data = (unsigned char *)CONFIG_MEMORY_START + 0x2000 73 output_data = (unsigned char *)CONFIG_MEMORY_START + 0x2000
162 + (mmu_on ? 0x80000000 : 0); 74 + (mmu_on ? 0x80000000 : 0);
163 free_mem_ptr = heap; 75 free_mem_ptr = heap;
164 free_mem_end_ptr = free_mem_ptr + HEAP_SIZE; 76 free_mem_end_ptr = free_mem_ptr + BOOT_HEAP_SIZE;
165 input_data = zimage_data;
166 input_len = zimage_len;
167 77
168 makecrc(); 78 puts("\nDecompressing Linux... ");
169 puts("Uncompressing Linux... "); 79 decompress(input_data, input_len, NULL, NULL, output_data, NULL, error);
170 gunzip(); 80 puts("done.\nBooting the kernel.\n");
171 puts("Ok, booting the kernel.\n");
172} 81}
diff --git a/arch/m32r/kernel/smp.c b/arch/m32r/kernel/smp.c
index 8a88f1f0a3e2..31cef20b2996 100644
--- a/arch/m32r/kernel/smp.c
+++ b/arch/m32r/kernel/smp.c
@@ -806,7 +806,7 @@ unsigned long send_IPI_mask_phys(cpumask_t physid_mask, int ipi_num,
806 806
807 if (mask & ~physids_coerce(phys_cpu_present_map)) 807 if (mask & ~physids_coerce(phys_cpu_present_map))
808 BUG(); 808 BUG();
809 if (ipi_num >= NR_IPIS) 809 if (ipi_num >= NR_IPIS || ipi_num < 0)
810 BUG(); 810 BUG();
811 811
812 mask <<= IPI_SHIFT; 812 mask <<= IPI_SHIFT;
diff --git a/arch/m32r/kernel/time.c b/arch/m32r/kernel/time.c
index e7fee0f198d5..9cedcef11575 100644
--- a/arch/m32r/kernel/time.c
+++ b/arch/m32r/kernel/time.c
@@ -75,7 +75,7 @@ u32 arch_gettimeoffset(void)
75 count = 0; 75 count = 0;
76 76
77 count = (latch - count) * TICK_SIZE; 77 count = (latch - count) * TICK_SIZE;
78 elapsed_time = (count + latch / 2) / latch; 78 elapsed_time = DIV_ROUND_CLOSEST(count, latch);
79 /* NOTE: LATCH is equal to the "interval" value (= reload count). */ 79 /* NOTE: LATCH is equal to the "interval" value (= reload count). */
80 80
81#else /* CONFIG_SMP */ 81#else /* CONFIG_SMP */
@@ -93,7 +93,7 @@ u32 arch_gettimeoffset(void)
93 p_count = count; 93 p_count = count;
94 94
95 count = (latch - count) * TICK_SIZE; 95 count = (latch - count) * TICK_SIZE;
96 elapsed_time = (count + latch / 2) / latch; 96 elapsed_time = DIV_ROUND_CLOSEST(count, latch);
97 /* NOTE: LATCH is equal to the "interval" value (= reload count). */ 97 /* NOTE: LATCH is equal to the "interval" value (= reload count). */
98#endif /* CONFIG_SMP */ 98#endif /* CONFIG_SMP */
99#elif defined(CONFIG_CHIP_M32310) 99#elif defined(CONFIG_CHIP_M32310)
@@ -211,7 +211,7 @@ void __init time_init(void)
211 211
212 bus_clock = boot_cpu_data.bus_clock; 212 bus_clock = boot_cpu_data.bus_clock;
213 divide = boot_cpu_data.timer_divide; 213 divide = boot_cpu_data.timer_divide;
214 latch = (bus_clock/divide + HZ / 2) / HZ; 214 latch = DIV_ROUND_CLOSEST(bus_clock/divide, HZ);
215 215
216 printk("Timer start : latch = %ld\n", latch); 216 printk("Timer start : latch = %ld\n", latch);
217 217
diff --git a/arch/m32r/kernel/vmlinux.lds.S b/arch/m32r/kernel/vmlinux.lds.S
index 8ceb6181d805..7da94eaa082b 100644
--- a/arch/m32r/kernel/vmlinux.lds.S
+++ b/arch/m32r/kernel/vmlinux.lds.S
@@ -42,6 +42,8 @@ SECTIONS
42 _etext = .; /* End of text section */ 42 _etext = .; /* End of text section */
43 43
44 EXCEPTION_TABLE(16) 44 EXCEPTION_TABLE(16)
45 NOTES
46
45 RODATA 47 RODATA
46 RW_DATA_SECTION(32, PAGE_SIZE, THREAD_SIZE) 48 RW_DATA_SECTION(32, PAGE_SIZE, THREAD_SIZE)
47 _edata = .; /* End of data section */ 49 _edata = .; /* End of data section */
diff --git a/arch/mips/Kconfig b/arch/mips/Kconfig
index 705a7a9170f3..fd7620f025fa 100644
--- a/arch/mips/Kconfig
+++ b/arch/mips/Kconfig
@@ -1,6 +1,7 @@
1config MIPS 1config MIPS
2 bool 2 bool
3 default y 3 default y
4 select HAVE_GENERIC_DMA_COHERENT
4 select HAVE_IDE 5 select HAVE_IDE
5 select HAVE_OPROFILE 6 select HAVE_OPROFILE
6 select HAVE_ARCH_KGDB 7 select HAVE_ARCH_KGDB
@@ -357,7 +358,14 @@ config SGI_IP22
357 select SWAP_IO_SPACE 358 select SWAP_IO_SPACE
358 select SYS_HAS_CPU_R4X00 359 select SYS_HAS_CPU_R4X00
359 select SYS_HAS_CPU_R5000 360 select SYS_HAS_CPU_R5000
360 select SYS_HAS_EARLY_PRINTK 361 #
362 # Disable EARLY_PRINTK for now since it leads to overwritten prom
363 # memory during early boot on some machines.
364 #
365 # See http://www.linux-mips.org/cgi-bin/mesg.cgi?a=linux-mips&i=20091119164009.GA15038%40deprecation.cyrius.com
366 # for a more details discussion
367 #
368 # select SYS_HAS_EARLY_PRINTK
361 select SYS_SUPPORTS_32BIT_KERNEL 369 select SYS_SUPPORTS_32BIT_KERNEL
362 select SYS_SUPPORTS_64BIT_KERNEL 370 select SYS_SUPPORTS_64BIT_KERNEL
363 select SYS_SUPPORTS_BIG_ENDIAN 371 select SYS_SUPPORTS_BIG_ENDIAN
@@ -409,7 +417,14 @@ config SGI_IP28
409 select SGI_HAS_ZILOG 417 select SGI_HAS_ZILOG
410 select SWAP_IO_SPACE 418 select SWAP_IO_SPACE
411 select SYS_HAS_CPU_R10000 419 select SYS_HAS_CPU_R10000
412 select SYS_HAS_EARLY_PRINTK 420 #
421 # Disable EARLY_PRINTK for now since it leads to overwritten prom
422 # memory during early boot on some machines.
423 #
424 # See http://www.linux-mips.org/cgi-bin/mesg.cgi?a=linux-mips&i=20091119164009.GA15038%40deprecation.cyrius.com
425 # for a more details discussion
426 #
427 # select SYS_HAS_EARLY_PRINTK
413 select SYS_SUPPORTS_64BIT_KERNEL 428 select SYS_SUPPORTS_64BIT_KERNEL
414 select SYS_SUPPORTS_BIG_ENDIAN 429 select SYS_SUPPORTS_BIG_ENDIAN
415 help 430 help
@@ -1012,9 +1027,9 @@ config BOOT_ELF32
1012 1027
1013config MIPS_L1_CACHE_SHIFT 1028config MIPS_L1_CACHE_SHIFT
1014 int 1029 int
1015 default "4" if MACH_DECSTATION || MIKROTIK_RB532 1030 default "4" if MACH_DECSTATION || MIKROTIK_RB532 || PMC_MSP4200_EVAL
1031 default "6" if MIPS_CPU_SCACHE
1016 default "7" if SGI_IP22 || SGI_IP27 || SGI_IP28 || SNI_RM || CPU_CAVIUM_OCTEON 1032 default "7" if SGI_IP22 || SGI_IP27 || SGI_IP28 || SNI_RM || CPU_CAVIUM_OCTEON
1017 default "4" if PMC_MSP4200_EVAL
1018 default "5" 1033 default "5"
1019 1034
1020config HAVE_STD_PC_SERIAL_PORT 1035config HAVE_STD_PC_SERIAL_PORT
@@ -1438,6 +1453,7 @@ choice
1438 1453
1439config PAGE_SIZE_4KB 1454config PAGE_SIZE_4KB
1440 bool "4kB" 1455 bool "4kB"
1456 depends on !CPU_LOONGSON2
1441 help 1457 help
1442 This option select the standard 4kB Linux page size. On some 1458 This option select the standard 4kB Linux page size. On some
1443 R3000-family processors this is the only available page size. Using 1459 R3000-family processors this is the only available page size. Using
@@ -1762,7 +1778,7 @@ config SYS_SUPPORTS_SMARTMIPS
1762 1778
1763config ARCH_FLATMEM_ENABLE 1779config ARCH_FLATMEM_ENABLE
1764 def_bool y 1780 def_bool y
1765 depends on !NUMA 1781 depends on !NUMA && !CPU_LOONGSON2
1766 1782
1767config ARCH_DISCONTIGMEM_ENABLE 1783config ARCH_DISCONTIGMEM_ENABLE
1768 bool 1784 bool
diff --git a/arch/mips/alchemy/common/irq.c b/arch/mips/alchemy/common/irq.c
index c88c821b4c36..d670928afcfd 100644
--- a/arch/mips/alchemy/common/irq.c
+++ b/arch/mips/alchemy/common/irq.c
@@ -354,6 +354,28 @@ static void au1x_ic1_ack(unsigned int irq_nr)
354 au_sync(); 354 au_sync();
355} 355}
356 356
357static void au1x_ic0_maskack(unsigned int irq_nr)
358{
359 unsigned int bit = irq_nr - AU1000_INTC0_INT_BASE;
360
361 au_writel(1 << bit, IC0_WAKECLR);
362 au_writel(1 << bit, IC0_MASKCLR);
363 au_writel(1 << bit, IC0_RISINGCLR);
364 au_writel(1 << bit, IC0_FALLINGCLR);
365 au_sync();
366}
367
368static void au1x_ic1_maskack(unsigned int irq_nr)
369{
370 unsigned int bit = irq_nr - AU1000_INTC1_INT_BASE;
371
372 au_writel(1 << bit, IC1_WAKECLR);
373 au_writel(1 << bit, IC1_MASKCLR);
374 au_writel(1 << bit, IC1_RISINGCLR);
375 au_writel(1 << bit, IC1_FALLINGCLR);
376 au_sync();
377}
378
357static int au1x_ic1_setwake(unsigned int irq, unsigned int on) 379static int au1x_ic1_setwake(unsigned int irq, unsigned int on)
358{ 380{
359 unsigned int bit = irq - AU1000_INTC1_INT_BASE; 381 unsigned int bit = irq - AU1000_INTC1_INT_BASE;
@@ -379,25 +401,21 @@ static int au1x_ic1_setwake(unsigned int irq, unsigned int on)
379/* 401/*
380 * irq_chips for both ICs; this way the mask handlers can be 402 * irq_chips for both ICs; this way the mask handlers can be
381 * as short as possible. 403 * as short as possible.
382 *
383 * NOTE: the ->ack() callback is used by the handle_edge_irq
384 * flowhandler only, the ->mask_ack() one by handle_level_irq,
385 * so no need for an irq_chip for each type of irq (level/edge).
386 */ 404 */
387static struct irq_chip au1x_ic0_chip = { 405static struct irq_chip au1x_ic0_chip = {
388 .name = "Alchemy-IC0", 406 .name = "Alchemy-IC0",
389 .ack = au1x_ic0_ack, /* edge */ 407 .ack = au1x_ic0_ack,
390 .mask = au1x_ic0_mask, 408 .mask = au1x_ic0_mask,
391 .mask_ack = au1x_ic0_mask, /* level */ 409 .mask_ack = au1x_ic0_maskack,
392 .unmask = au1x_ic0_unmask, 410 .unmask = au1x_ic0_unmask,
393 .set_type = au1x_ic_settype, 411 .set_type = au1x_ic_settype,
394}; 412};
395 413
396static struct irq_chip au1x_ic1_chip = { 414static struct irq_chip au1x_ic1_chip = {
397 .name = "Alchemy-IC1", 415 .name = "Alchemy-IC1",
398 .ack = au1x_ic1_ack, /* edge */ 416 .ack = au1x_ic1_ack,
399 .mask = au1x_ic1_mask, 417 .mask = au1x_ic1_mask,
400 .mask_ack = au1x_ic1_mask, /* level */ 418 .mask_ack = au1x_ic1_maskack,
401 .unmask = au1x_ic1_unmask, 419 .unmask = au1x_ic1_unmask,
402 .set_type = au1x_ic_settype, 420 .set_type = au1x_ic_settype,
403 .set_wake = au1x_ic1_setwake, 421 .set_wake = au1x_ic1_setwake,
diff --git a/arch/mips/alchemy/mtx-1/board_setup.c b/arch/mips/alchemy/mtx-1/board_setup.c
index cc32c69a74ad..45b61c9b82b9 100644
--- a/arch/mips/alchemy/mtx-1/board_setup.c
+++ b/arch/mips/alchemy/mtx-1/board_setup.c
@@ -69,6 +69,7 @@ void __init board_setup(void)
69#else 69#else
70 au_writel(0xf, Au1500_PCI_CFG); 70 au_writel(0xf, Au1500_PCI_CFG);
71#endif 71#endif
72 board_pci_idsel = mtx1_pci_idsel;
72#endif 73#endif
73 74
74 /* Initialize sys_pinfunc */ 75 /* Initialize sys_pinfunc */
@@ -85,8 +86,6 @@ void __init board_setup(void)
85 alchemy_gpio_direction_output(211, 1); /* green on */ 86 alchemy_gpio_direction_output(211, 1); /* green on */
86 alchemy_gpio_direction_output(212, 0); /* red off */ 87 alchemy_gpio_direction_output(212, 0); /* red off */
87 88
88 board_pci_idsel = mtx1_pci_idsel;
89
90 printk(KERN_INFO "4G Systems MTX-1 Board\n"); 89 printk(KERN_INFO "4G Systems MTX-1 Board\n");
91} 90}
92 91
diff --git a/arch/mips/ar7/platform.c b/arch/mips/ar7/platform.c
index e2278c04459d..835f3f0319ca 100644
--- a/arch/mips/ar7/platform.c
+++ b/arch/mips/ar7/platform.c
@@ -503,6 +503,7 @@ static int __init ar7_register_devices(void)
503{ 503{
504 u16 chip_id; 504 u16 chip_id;
505 int res; 505 int res;
506 u32 *bootcr, val;
506#ifdef CONFIG_SERIAL_8250 507#ifdef CONFIG_SERIAL_8250
507 static struct uart_port uart_port[2]; 508 static struct uart_port uart_port[2];
508 509
@@ -595,7 +596,13 @@ static int __init ar7_register_devices(void)
595 596
596 ar7_wdt_res.end = ar7_wdt_res.start + 0x20; 597 ar7_wdt_res.end = ar7_wdt_res.start + 0x20;
597 598
598 res = platform_device_register(&ar7_wdt); 599 bootcr = (u32 *)ioremap_nocache(AR7_REGS_DCL, 4);
600 val = *bootcr;
601 iounmap(bootcr);
602
603 /* Register watchdog only if enabled in hardware */
604 if (val & AR7_WDT_HW_ENA)
605 res = platform_device_register(&ar7_wdt);
599 606
600 return res; 607 return res;
601} 608}
diff --git a/arch/mips/bcm47xx/prom.c b/arch/mips/bcm47xx/prom.c
index 079e33d52783..fb284c3b2cff 100644
--- a/arch/mips/bcm47xx/prom.c
+++ b/arch/mips/bcm47xx/prom.c
@@ -100,7 +100,7 @@ static __init void prom_init_console(void)
100 100
101static __init void prom_init_cmdline(void) 101static __init void prom_init_cmdline(void)
102{ 102{
103 char buf[CL_SIZE]; 103 static char buf[CL_SIZE] __initdata;
104 104
105 /* Get the kernel command line from CFE */ 105 /* Get the kernel command line from CFE */
106 if (cfe_getenv("LINUX_CMDLINE", buf, CL_SIZE) >= 0) { 106 if (cfe_getenv("LINUX_CMDLINE", buf, CL_SIZE) >= 0) {
diff --git a/arch/mips/bcm63xx/Makefile b/arch/mips/bcm63xx/Makefile
index c146d1ededed..00064b660809 100644
--- a/arch/mips/bcm63xx/Makefile
+++ b/arch/mips/bcm63xx/Makefile
@@ -1,5 +1,5 @@
1obj-y += clk.o cpu.o cs.o gpio.o irq.o prom.o setup.o timer.o \ 1obj-y += clk.o cpu.o cs.o gpio.o irq.o prom.o setup.o timer.o \
2 dev-dsp.o dev-enet.o dev-pcmcia.o dev-uart.o 2 dev-dsp.o dev-enet.o dev-pcmcia.o dev-uart.o dev-wdt.o
3obj-$(CONFIG_EARLY_PRINTK) += early_printk.o 3obj-$(CONFIG_EARLY_PRINTK) += early_printk.o
4 4
5obj-y += boards/ 5obj-y += boards/
diff --git a/arch/mips/bcm63xx/boards/board_bcm963xx.c b/arch/mips/bcm63xx/boards/board_bcm963xx.c
index 78e155d21be6..05a35cf5963d 100644
--- a/arch/mips/bcm63xx/boards/board_bcm963xx.c
+++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c
@@ -24,7 +24,6 @@
24#include <bcm63xx_dev_enet.h> 24#include <bcm63xx_dev_enet.h>
25#include <bcm63xx_dev_dsp.h> 25#include <bcm63xx_dev_dsp.h>
26#include <bcm63xx_dev_pcmcia.h> 26#include <bcm63xx_dev_pcmcia.h>
27#include <bcm63xx_dev_uart.h>
28#include <board_bcm963xx.h> 27#include <board_bcm963xx.h>
29 28
30#define PFX "board_bcm963xx: " 29#define PFX "board_bcm963xx: "
@@ -794,8 +793,6 @@ int __init board_register_devices(void)
794{ 793{
795 u32 val; 794 u32 val;
796 795
797 bcm63xx_uart_register();
798
799 if (board.has_pccard) 796 if (board.has_pccard)
800 bcm63xx_pcmcia_register(); 797 bcm63xx_pcmcia_register();
801 798
diff --git a/arch/mips/bcm63xx/cpu.c b/arch/mips/bcm63xx/cpu.c
index 6dc43f0483e8..70378bb5e3f9 100644
--- a/arch/mips/bcm63xx/cpu.c
+++ b/arch/mips/bcm63xx/cpu.c
@@ -10,6 +10,7 @@
10#include <linux/kernel.h> 10#include <linux/kernel.h>
11#include <linux/module.h> 11#include <linux/module.h>
12#include <linux/cpu.h> 12#include <linux/cpu.h>
13#include <asm/cpu-info.h>
13#include <bcm63xx_cpu.h> 14#include <bcm63xx_cpu.h>
14#include <bcm63xx_regs.h> 15#include <bcm63xx_regs.h>
15#include <bcm63xx_io.h> 16#include <bcm63xx_io.h>
@@ -284,6 +285,7 @@ void __init bcm63xx_cpu_init(void)
284{ 285{
285 unsigned int tmp, expected_cpu_id; 286 unsigned int tmp, expected_cpu_id;
286 struct cpuinfo_mips *c = &current_cpu_data; 287 struct cpuinfo_mips *c = &current_cpu_data;
288 unsigned int cpu = smp_processor_id();
287 289
288 /* soc registers location depends on cpu type */ 290 /* soc registers location depends on cpu type */
289 expected_cpu_id = 0; 291 expected_cpu_id = 0;
@@ -293,6 +295,7 @@ void __init bcm63xx_cpu_init(void)
293 * BCM6338 as the same PrId as BCM3302 see arch/mips/kernel/cpu-probe.c 295 * BCM6338 as the same PrId as BCM3302 see arch/mips/kernel/cpu-probe.c
294 */ 296 */
295 case CPU_BCM3302: 297 case CPU_BCM3302:
298 __cpu_name[cpu] = "Broadcom BCM6338";
296 expected_cpu_id = BCM6338_CPU_ID; 299 expected_cpu_id = BCM6338_CPU_ID;
297 bcm63xx_regs_base = bcm96338_regs_base; 300 bcm63xx_regs_base = bcm96338_regs_base;
298 bcm63xx_irqs = bcm96338_irqs; 301 bcm63xx_irqs = bcm96338_irqs;
diff --git a/arch/mips/bcm63xx/dev-uart.c b/arch/mips/bcm63xx/dev-uart.c
index 5f3d89c4a988..b0519461ad9b 100644
--- a/arch/mips/bcm63xx/dev-uart.c
+++ b/arch/mips/bcm63xx/dev-uart.c
@@ -10,7 +10,6 @@
10#include <linux/kernel.h> 10#include <linux/kernel.h>
11#include <linux/platform_device.h> 11#include <linux/platform_device.h>
12#include <bcm63xx_cpu.h> 12#include <bcm63xx_cpu.h>
13#include <bcm63xx_dev_uart.h>
14 13
15static struct resource uart_resources[] = { 14static struct resource uart_resources[] = {
16 { 15 {
@@ -39,3 +38,4 @@ int __init bcm63xx_uart_register(void)
39 uart_resources[1].start = bcm63xx_get_irq_number(IRQ_UART0); 38 uart_resources[1].start = bcm63xx_get_irq_number(IRQ_UART0);
40 return platform_device_register(&bcm63xx_uart_device); 39 return platform_device_register(&bcm63xx_uart_device);
41} 40}
41arch_initcall(bcm63xx_uart_register);
diff --git a/arch/mips/bcm63xx/dev-wdt.c b/arch/mips/bcm63xx/dev-wdt.c
new file mode 100644
index 000000000000..3e6c716a4c11
--- /dev/null
+++ b/arch/mips/bcm63xx/dev-wdt.c
@@ -0,0 +1,37 @@
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) 2008 Florian Fainelli <florian@openwrt.org>
7 */
8
9#include <linux/init.h>
10#include <linux/kernel.h>
11#include <linux/platform_device.h>
12#include <bcm63xx_cpu.h>
13
14static struct resource wdt_resources[] = {
15 {
16 .start = -1, /* filled at runtime */
17 .end = -1, /* filled at runtime */
18 .flags = IORESOURCE_MEM,
19 },
20};
21
22static struct platform_device bcm63xx_wdt_device = {
23 .name = "bcm63xx-wdt",
24 .id = 0,
25 .num_resources = ARRAY_SIZE(wdt_resources),
26 .resource = wdt_resources,
27};
28
29int __init bcm63xx_wdt_register(void)
30{
31 wdt_resources[0].start = bcm63xx_regset_address(RSET_WDT);
32 wdt_resources[0].end = wdt_resources[0].start;
33 wdt_resources[0].end += RSET_WDT_SIZE - 1;
34
35 return platform_device_register(&bcm63xx_wdt_device);
36}
37arch_initcall(bcm63xx_wdt_register);
diff --git a/arch/mips/bcm63xx/setup.c b/arch/mips/bcm63xx/setup.c
index b18a0ca926fa..d0056598fbfc 100644
--- a/arch/mips/bcm63xx/setup.c
+++ b/arch/mips/bcm63xx/setup.c
@@ -75,7 +75,9 @@ void bcm63xx_machine_reboot(void)
75 bcm6348_a1_reboot(); 75 bcm6348_a1_reboot();
76 76
77 printk(KERN_INFO "triggering watchdog soft-reset...\n"); 77 printk(KERN_INFO "triggering watchdog soft-reset...\n");
78 bcm_perf_writel(SYS_PLL_SOFT_RESET, PERF_SYS_PLL_CTL_REG); 78 reg = bcm_perf_readl(PERF_SYS_PLL_CTL_REG);
79 reg |= SYS_PLL_SOFT_RESET;
80 bcm_perf_writel(reg, PERF_SYS_PLL_CTL_REG);
79 while (1) 81 while (1)
80 ; 82 ;
81} 83}
diff --git a/arch/mips/cavium-octeon/octeon-irq.c b/arch/mips/cavium-octeon/octeon-irq.c
index 384f1842bfb1..6f2acf09328d 100644
--- a/arch/mips/cavium-octeon/octeon-irq.c
+++ b/arch/mips/cavium-octeon/octeon-irq.c
@@ -17,6 +17,15 @@ DEFINE_RWLOCK(octeon_irq_ciu0_rwlock);
17DEFINE_RWLOCK(octeon_irq_ciu1_rwlock); 17DEFINE_RWLOCK(octeon_irq_ciu1_rwlock);
18DEFINE_SPINLOCK(octeon_irq_msi_lock); 18DEFINE_SPINLOCK(octeon_irq_msi_lock);
19 19
20static int octeon_coreid_for_cpu(int cpu)
21{
22#ifdef CONFIG_SMP
23 return cpu_logical_map(cpu);
24#else
25 return cvmx_get_core_num();
26#endif
27}
28
20static void octeon_irq_core_ack(unsigned int irq) 29static void octeon_irq_core_ack(unsigned int irq)
21{ 30{
22 unsigned int bit = irq - OCTEON_IRQ_SW0; 31 unsigned int bit = irq - OCTEON_IRQ_SW0;
@@ -152,11 +161,10 @@ static void octeon_irq_ciu0_disable(unsigned int irq)
152 int bit = irq - OCTEON_IRQ_WORKQ0; /* Bit 0-63 of EN0 */ 161 int bit = irq - OCTEON_IRQ_WORKQ0; /* Bit 0-63 of EN0 */
153 unsigned long flags; 162 unsigned long flags;
154 uint64_t en0; 163 uint64_t en0;
155#ifdef CONFIG_SMP
156 int cpu; 164 int cpu;
157 write_lock_irqsave(&octeon_irq_ciu0_rwlock, flags); 165 write_lock_irqsave(&octeon_irq_ciu0_rwlock, flags);
158 for_each_online_cpu(cpu) { 166 for_each_online_cpu(cpu) {
159 int coreid = cpu_logical_map(cpu); 167 int coreid = octeon_coreid_for_cpu(cpu);
160 en0 = cvmx_read_csr(CVMX_CIU_INTX_EN0(coreid * 2)); 168 en0 = cvmx_read_csr(CVMX_CIU_INTX_EN0(coreid * 2));
161 en0 &= ~(1ull << bit); 169 en0 &= ~(1ull << bit);
162 cvmx_write_csr(CVMX_CIU_INTX_EN0(coreid * 2), en0); 170 cvmx_write_csr(CVMX_CIU_INTX_EN0(coreid * 2), en0);
@@ -167,26 +175,57 @@ static void octeon_irq_ciu0_disable(unsigned int irq)
167 */ 175 */
168 cvmx_read_csr(CVMX_CIU_INTX_EN0(cvmx_get_core_num() * 2)); 176 cvmx_read_csr(CVMX_CIU_INTX_EN0(cvmx_get_core_num() * 2));
169 write_unlock_irqrestore(&octeon_irq_ciu0_rwlock, flags); 177 write_unlock_irqrestore(&octeon_irq_ciu0_rwlock, flags);
170#else 178}
171 int coreid = cvmx_get_core_num(); 179
172 local_irq_save(flags); 180/*
173 en0 = cvmx_read_csr(CVMX_CIU_INTX_EN0(coreid * 2)); 181 * Enable the irq on the current core for chips that have the EN*_W1{S,C}
174 en0 &= ~(1ull << bit); 182 * registers.
175 cvmx_write_csr(CVMX_CIU_INTX_EN0(coreid * 2), en0); 183 */
176 cvmx_read_csr(CVMX_CIU_INTX_EN0(coreid * 2)); 184static void octeon_irq_ciu0_enable_v2(unsigned int irq)
177 local_irq_restore(flags); 185{
178#endif 186 int index = cvmx_get_core_num() * 2;
187 u64 mask = 1ull << (irq - OCTEON_IRQ_WORKQ0);
188
189 cvmx_write_csr(CVMX_CIU_INTX_EN0_W1S(index), mask);
190}
191
192/*
193 * Disable the irq on the current core for chips that have the EN*_W1{S,C}
194 * registers.
195 */
196static void octeon_irq_ciu0_disable_v2(unsigned int irq)
197{
198 int index = cvmx_get_core_num() * 2;
199 u64 mask = 1ull << (irq - OCTEON_IRQ_WORKQ0);
200
201 cvmx_write_csr(CVMX_CIU_INTX_EN0_W1C(index), mask);
202}
203
204/*
205 * Disable the irq on the all cores for chips that have the EN*_W1{S,C}
206 * registers.
207 */
208static void octeon_irq_ciu0_disable_all_v2(unsigned int irq)
209{
210 u64 mask = 1ull << (irq - OCTEON_IRQ_WORKQ0);
211 int index;
212 int cpu;
213 for_each_online_cpu(cpu) {
214 index = octeon_coreid_for_cpu(cpu) * 2;
215 cvmx_write_csr(CVMX_CIU_INTX_EN0_W1C(index), mask);
216 }
179} 217}
180 218
181#ifdef CONFIG_SMP 219#ifdef CONFIG_SMP
182static int octeon_irq_ciu0_set_affinity(unsigned int irq, const struct cpumask *dest) 220static int octeon_irq_ciu0_set_affinity(unsigned int irq, const struct cpumask *dest)
183{ 221{
184 int cpu; 222 int cpu;
223 unsigned long flags;
185 int bit = irq - OCTEON_IRQ_WORKQ0; /* Bit 0-63 of EN0 */ 224 int bit = irq - OCTEON_IRQ_WORKQ0; /* Bit 0-63 of EN0 */
186 225
187 write_lock(&octeon_irq_ciu0_rwlock); 226 write_lock_irqsave(&octeon_irq_ciu0_rwlock, flags);
188 for_each_online_cpu(cpu) { 227 for_each_online_cpu(cpu) {
189 int coreid = cpu_logical_map(cpu); 228 int coreid = octeon_coreid_for_cpu(cpu);
190 uint64_t en0 = 229 uint64_t en0 =
191 cvmx_read_csr(CVMX_CIU_INTX_EN0(coreid * 2)); 230 cvmx_read_csr(CVMX_CIU_INTX_EN0(coreid * 2));
192 if (cpumask_test_cpu(cpu, dest)) 231 if (cpumask_test_cpu(cpu, dest))
@@ -200,11 +239,45 @@ static int octeon_irq_ciu0_set_affinity(unsigned int irq, const struct cpumask *
200 * of them are done. 239 * of them are done.
201 */ 240 */
202 cvmx_read_csr(CVMX_CIU_INTX_EN0(cvmx_get_core_num() * 2)); 241 cvmx_read_csr(CVMX_CIU_INTX_EN0(cvmx_get_core_num() * 2));
203 write_unlock(&octeon_irq_ciu0_rwlock); 242 write_unlock_irqrestore(&octeon_irq_ciu0_rwlock, flags);
204 243
205 return 0; 244 return 0;
206} 245}
246
247/*
248 * Set affinity for the irq for chips that have the EN*_W1{S,C}
249 * registers.
250 */
251static int octeon_irq_ciu0_set_affinity_v2(unsigned int irq,
252 const struct cpumask *dest)
253{
254 int cpu;
255 int index;
256 u64 mask = 1ull << (irq - OCTEON_IRQ_WORKQ0);
257 for_each_online_cpu(cpu) {
258 index = octeon_coreid_for_cpu(cpu) * 2;
259 if (cpumask_test_cpu(cpu, dest))
260 cvmx_write_csr(CVMX_CIU_INTX_EN0_W1S(index), mask);
261 else
262 cvmx_write_csr(CVMX_CIU_INTX_EN0_W1C(index), mask);
263 }
264 return 0;
265}
266#endif
267
268/*
269 * Newer octeon chips have support for lockless CIU operation.
270 */
271static struct irq_chip octeon_irq_chip_ciu0_v2 = {
272 .name = "CIU0",
273 .enable = octeon_irq_ciu0_enable_v2,
274 .disable = octeon_irq_ciu0_disable_all_v2,
275 .ack = octeon_irq_ciu0_disable_v2,
276 .eoi = octeon_irq_ciu0_enable_v2,
277#ifdef CONFIG_SMP
278 .set_affinity = octeon_irq_ciu0_set_affinity_v2,
207#endif 279#endif
280};
208 281
209static struct irq_chip octeon_irq_chip_ciu0 = { 282static struct irq_chip octeon_irq_chip_ciu0 = {
210 .name = "CIU0", 283 .name = "CIU0",
@@ -269,11 +342,10 @@ static void octeon_irq_ciu1_disable(unsigned int irq)
269 int bit = irq - OCTEON_IRQ_WDOG0; /* Bit 0-63 of EN1 */ 342 int bit = irq - OCTEON_IRQ_WDOG0; /* Bit 0-63 of EN1 */
270 unsigned long flags; 343 unsigned long flags;
271 uint64_t en1; 344 uint64_t en1;
272#ifdef CONFIG_SMP
273 int cpu; 345 int cpu;
274 write_lock_irqsave(&octeon_irq_ciu1_rwlock, flags); 346 write_lock_irqsave(&octeon_irq_ciu1_rwlock, flags);
275 for_each_online_cpu(cpu) { 347 for_each_online_cpu(cpu) {
276 int coreid = cpu_logical_map(cpu); 348 int coreid = octeon_coreid_for_cpu(cpu);
277 en1 = cvmx_read_csr(CVMX_CIU_INTX_EN1(coreid * 2 + 1)); 349 en1 = cvmx_read_csr(CVMX_CIU_INTX_EN1(coreid * 2 + 1));
278 en1 &= ~(1ull << bit); 350 en1 &= ~(1ull << bit);
279 cvmx_write_csr(CVMX_CIU_INTX_EN1(coreid * 2 + 1), en1); 351 cvmx_write_csr(CVMX_CIU_INTX_EN1(coreid * 2 + 1), en1);
@@ -284,26 +356,58 @@ static void octeon_irq_ciu1_disable(unsigned int irq)
284 */ 356 */
285 cvmx_read_csr(CVMX_CIU_INTX_EN1(cvmx_get_core_num() * 2 + 1)); 357 cvmx_read_csr(CVMX_CIU_INTX_EN1(cvmx_get_core_num() * 2 + 1));
286 write_unlock_irqrestore(&octeon_irq_ciu1_rwlock, flags); 358 write_unlock_irqrestore(&octeon_irq_ciu1_rwlock, flags);
287#else 359}
288 int coreid = cvmx_get_core_num(); 360
289 local_irq_save(flags); 361/*
290 en1 = cvmx_read_csr(CVMX_CIU_INTX_EN1(coreid * 2 + 1)); 362 * Enable the irq on the current core for chips that have the EN*_W1{S,C}
291 en1 &= ~(1ull << bit); 363 * registers.
292 cvmx_write_csr(CVMX_CIU_INTX_EN1(coreid * 2 + 1), en1); 364 */
293 cvmx_read_csr(CVMX_CIU_INTX_EN1(coreid * 2 + 1)); 365static void octeon_irq_ciu1_enable_v2(unsigned int irq)
294 local_irq_restore(flags); 366{
295#endif 367 int index = cvmx_get_core_num() * 2 + 1;
368 u64 mask = 1ull << (irq - OCTEON_IRQ_WDOG0);
369
370 cvmx_write_csr(CVMX_CIU_INTX_EN1_W1S(index), mask);
371}
372
373/*
374 * Disable the irq on the current core for chips that have the EN*_W1{S,C}
375 * registers.
376 */
377static void octeon_irq_ciu1_disable_v2(unsigned int irq)
378{
379 int index = cvmx_get_core_num() * 2 + 1;
380 u64 mask = 1ull << (irq - OCTEON_IRQ_WDOG0);
381
382 cvmx_write_csr(CVMX_CIU_INTX_EN1_W1C(index), mask);
383}
384
385/*
386 * Disable the irq on the all cores for chips that have the EN*_W1{S,C}
387 * registers.
388 */
389static void octeon_irq_ciu1_disable_all_v2(unsigned int irq)
390{
391 u64 mask = 1ull << (irq - OCTEON_IRQ_WDOG0);
392 int index;
393 int cpu;
394 for_each_online_cpu(cpu) {
395 index = octeon_coreid_for_cpu(cpu) * 2 + 1;
396 cvmx_write_csr(CVMX_CIU_INTX_EN1_W1C(index), mask);
397 }
296} 398}
297 399
298#ifdef CONFIG_SMP 400#ifdef CONFIG_SMP
299static int octeon_irq_ciu1_set_affinity(unsigned int irq, const struct cpumask *dest) 401static int octeon_irq_ciu1_set_affinity(unsigned int irq,
402 const struct cpumask *dest)
300{ 403{
301 int cpu; 404 int cpu;
405 unsigned long flags;
302 int bit = irq - OCTEON_IRQ_WDOG0; /* Bit 0-63 of EN1 */ 406 int bit = irq - OCTEON_IRQ_WDOG0; /* Bit 0-63 of EN1 */
303 407
304 write_lock(&octeon_irq_ciu1_rwlock); 408 write_lock_irqsave(&octeon_irq_ciu1_rwlock, flags);
305 for_each_online_cpu(cpu) { 409 for_each_online_cpu(cpu) {
306 int coreid = cpu_logical_map(cpu); 410 int coreid = octeon_coreid_for_cpu(cpu);
307 uint64_t en1 = 411 uint64_t en1 =
308 cvmx_read_csr(CVMX_CIU_INTX_EN1 412 cvmx_read_csr(CVMX_CIU_INTX_EN1
309 (coreid * 2 + 1)); 413 (coreid * 2 + 1));
@@ -318,12 +422,46 @@ static int octeon_irq_ciu1_set_affinity(unsigned int irq, const struct cpumask *
318 * of them are done. 422 * of them are done.
319 */ 423 */
320 cvmx_read_csr(CVMX_CIU_INTX_EN1(cvmx_get_core_num() * 2 + 1)); 424 cvmx_read_csr(CVMX_CIU_INTX_EN1(cvmx_get_core_num() * 2 + 1));
321 write_unlock(&octeon_irq_ciu1_rwlock); 425 write_unlock_irqrestore(&octeon_irq_ciu1_rwlock, flags);
426
427 return 0;
428}
322 429
430/*
431 * Set affinity for the irq for chips that have the EN*_W1{S,C}
432 * registers.
433 */
434static int octeon_irq_ciu1_set_affinity_v2(unsigned int irq,
435 const struct cpumask *dest)
436{
437 int cpu;
438 int index;
439 u64 mask = 1ull << (irq - OCTEON_IRQ_WDOG0);
440 for_each_online_cpu(cpu) {
441 index = octeon_coreid_for_cpu(cpu) * 2 + 1;
442 if (cpumask_test_cpu(cpu, dest))
443 cvmx_write_csr(CVMX_CIU_INTX_EN1_W1S(index), mask);
444 else
445 cvmx_write_csr(CVMX_CIU_INTX_EN1_W1C(index), mask);
446 }
323 return 0; 447 return 0;
324} 448}
325#endif 449#endif
326 450
451/*
452 * Newer octeon chips have support for lockless CIU operation.
453 */
454static struct irq_chip octeon_irq_chip_ciu1_v2 = {
455 .name = "CIU0",
456 .enable = octeon_irq_ciu1_enable_v2,
457 .disable = octeon_irq_ciu1_disable_all_v2,
458 .ack = octeon_irq_ciu1_disable_v2,
459 .eoi = octeon_irq_ciu1_enable_v2,
460#ifdef CONFIG_SMP
461 .set_affinity = octeon_irq_ciu1_set_affinity_v2,
462#endif
463};
464
327static struct irq_chip octeon_irq_chip_ciu1 = { 465static struct irq_chip octeon_irq_chip_ciu1 = {
328 .name = "CIU1", 466 .name = "CIU1",
329 .enable = octeon_irq_ciu1_enable, 467 .enable = octeon_irq_ciu1_enable,
@@ -420,6 +558,8 @@ static struct irq_chip octeon_irq_chip_msi = {
420void __init arch_init_irq(void) 558void __init arch_init_irq(void)
421{ 559{
422 int irq; 560 int irq;
561 struct irq_chip *chip0;
562 struct irq_chip *chip1;
423 563
424#ifdef CONFIG_SMP 564#ifdef CONFIG_SMP
425 /* Set the default affinity to the boot cpu. */ 565 /* Set the default affinity to the boot cpu. */
@@ -430,6 +570,16 @@ void __init arch_init_irq(void)
430 if (NR_IRQS < OCTEON_IRQ_LAST) 570 if (NR_IRQS < OCTEON_IRQ_LAST)
431 pr_err("octeon_irq_init: NR_IRQS is set too low\n"); 571 pr_err("octeon_irq_init: NR_IRQS is set too low\n");
432 572
573 if (OCTEON_IS_MODEL(OCTEON_CN58XX_PASS2_X) ||
574 OCTEON_IS_MODEL(OCTEON_CN56XX_PASS2_X) ||
575 OCTEON_IS_MODEL(OCTEON_CN52XX_PASS2_X)) {
576 chip0 = &octeon_irq_chip_ciu0_v2;
577 chip1 = &octeon_irq_chip_ciu1_v2;
578 } else {
579 chip0 = &octeon_irq_chip_ciu0;
580 chip1 = &octeon_irq_chip_ciu1;
581 }
582
433 /* 0 - 15 reserved for i8259 master and slave controller. */ 583 /* 0 - 15 reserved for i8259 master and slave controller. */
434 584
435 /* 17 - 23 Mips internal */ 585 /* 17 - 23 Mips internal */
@@ -440,14 +590,12 @@ void __init arch_init_irq(void)
440 590
441 /* 24 - 87 CIU_INT_SUM0 */ 591 /* 24 - 87 CIU_INT_SUM0 */
442 for (irq = OCTEON_IRQ_WORKQ0; irq <= OCTEON_IRQ_BOOTDMA; irq++) { 592 for (irq = OCTEON_IRQ_WORKQ0; irq <= OCTEON_IRQ_BOOTDMA; irq++) {
443 set_irq_chip_and_handler(irq, &octeon_irq_chip_ciu0, 593 set_irq_chip_and_handler(irq, chip0, handle_percpu_irq);
444 handle_percpu_irq);
445 } 594 }
446 595
447 /* 88 - 151 CIU_INT_SUM1 */ 596 /* 88 - 151 CIU_INT_SUM1 */
448 for (irq = OCTEON_IRQ_WDOG0; irq <= OCTEON_IRQ_RESERVED151; irq++) { 597 for (irq = OCTEON_IRQ_WDOG0; irq <= OCTEON_IRQ_RESERVED151; irq++) {
449 set_irq_chip_and_handler(irq, &octeon_irq_chip_ciu1, 598 set_irq_chip_and_handler(irq, chip1, handle_percpu_irq);
450 handle_percpu_irq);
451 } 599 }
452 600
453#ifdef CONFIG_PCI_MSI 601#ifdef CONFIG_PCI_MSI
@@ -505,14 +653,10 @@ asmlinkage void plat_irq_dispatch(void)
505#ifdef CONFIG_HOTPLUG_CPU 653#ifdef CONFIG_HOTPLUG_CPU
506static int is_irq_enabled_on_cpu(unsigned int irq, unsigned int cpu) 654static int is_irq_enabled_on_cpu(unsigned int irq, unsigned int cpu)
507{ 655{
508 unsigned int isset; 656 unsigned int isset;
509#ifdef CONFIG_SMP 657 int coreid = octeon_coreid_for_cpu(cpu);
510 int coreid = cpu_logical_map(cpu);
511#else
512 int coreid = cvmx_get_core_num();
513#endif
514 int bit = (irq < OCTEON_IRQ_WDOG0) ? 658 int bit = (irq < OCTEON_IRQ_WDOG0) ?
515 irq - OCTEON_IRQ_WORKQ0 : irq - OCTEON_IRQ_WDOG0; 659 irq - OCTEON_IRQ_WORKQ0 : irq - OCTEON_IRQ_WDOG0;
516 if (irq < 64) { 660 if (irq < 64) {
517 isset = (cvmx_read_csr(CVMX_CIU_INTX_EN0(coreid * 2)) & 661 isset = (cvmx_read_csr(CVMX_CIU_INTX_EN0(coreid * 2)) &
518 (1ull << bit)) >> bit; 662 (1ull << bit)) >> bit;
diff --git a/arch/mips/cavium-octeon/smp.c b/arch/mips/cavium-octeon/smp.c
index 32d51a31dc48..c198efdf583e 100644
--- a/arch/mips/cavium-octeon/smp.c
+++ b/arch/mips/cavium-octeon/smp.c
@@ -65,11 +65,12 @@ void octeon_send_ipi_single(int cpu, unsigned int action)
65 cvmx_write_csr(CVMX_CIU_MBOX_SETX(coreid), action); 65 cvmx_write_csr(CVMX_CIU_MBOX_SETX(coreid), action);
66} 66}
67 67
68static inline void octeon_send_ipi_mask(cpumask_t mask, unsigned int action) 68static inline void octeon_send_ipi_mask(const struct cpumask *mask,
69 unsigned int action)
69{ 70{
70 unsigned int i; 71 unsigned int i;
71 72
72 for_each_cpu_mask(i, mask) 73 for_each_cpu_mask(i, *mask)
73 octeon_send_ipi_single(i, action); 74 octeon_send_ipi_single(i, action);
74} 75}
75 76
diff --git a/arch/mips/configs/rbtx49xx_defconfig b/arch/mips/configs/rbtx49xx_defconfig
index c69813b8488c..6c6a19aebe1f 100644
--- a/arch/mips/configs/rbtx49xx_defconfig
+++ b/arch/mips/configs/rbtx49xx_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-rc7 3# Linux kernel version: 2.6.32-rc6
4# Wed Mar 4 23:08:06 2009 4# Sun Nov 8 22:59:47 2009
5# 5#
6CONFIG_MIPS=y 6CONFIG_MIPS=y
7 7
@@ -9,16 +9,18 @@ CONFIG_MIPS=y
9# Machine selection 9# Machine selection
10# 10#
11# CONFIG_MACH_ALCHEMY is not set 11# CONFIG_MACH_ALCHEMY is not set
12# CONFIG_AR7 is not set
12# CONFIG_BASLER_EXCITE is not set 13# CONFIG_BASLER_EXCITE is not set
13# CONFIG_BCM47XX is not set 14# CONFIG_BCM47XX is not set
15# CONFIG_BCM63XX is not set
14# CONFIG_MIPS_COBALT is not set 16# CONFIG_MIPS_COBALT is not set
15# CONFIG_MACH_DECSTATION is not set 17# CONFIG_MACH_DECSTATION is not set
16# CONFIG_MACH_JAZZ is not set 18# CONFIG_MACH_JAZZ is not set
17# CONFIG_LASAT is not set 19# CONFIG_LASAT is not set
18# CONFIG_LEMOTE_FULONG is not set 20# CONFIG_MACH_LOONGSON is not set
19# CONFIG_MIPS_MALTA is not set 21# CONFIG_MIPS_MALTA is not set
20# CONFIG_MIPS_SIM is not set 22# CONFIG_MIPS_SIM is not set
21# CONFIG_MACH_EMMA is not set 23# CONFIG_NEC_MARKEINS is not set
22# CONFIG_MACH_VR41XX is not set 24# CONFIG_MACH_VR41XX is not set
23# CONFIG_NXP_STB220 is not set 25# CONFIG_NXP_STB220 is not set
24# CONFIG_NXP_STB225 is not set 26# CONFIG_NXP_STB225 is not set
@@ -45,6 +47,7 @@ CONFIG_MACH_TX49XX=y
45# CONFIG_WR_PPMC is not set 47# CONFIG_WR_PPMC is not set
46# CONFIG_CAVIUM_OCTEON_SIMULATOR is not set 48# CONFIG_CAVIUM_OCTEON_SIMULATOR is not set
47# CONFIG_CAVIUM_OCTEON_REFERENCE_BOARD is not set 49# CONFIG_CAVIUM_OCTEON_REFERENCE_BOARD is not set
50# CONFIG_ALCHEMY_GPIO_INDIRECT is not set
48CONFIG_MACH_TXX9=y 51CONFIG_MACH_TXX9=y
49CONFIG_TOSHIBA_RBTX4927=y 52CONFIG_TOSHIBA_RBTX4927=y
50CONFIG_TOSHIBA_RBTX4938=y 53CONFIG_TOSHIBA_RBTX4938=y
@@ -86,7 +89,6 @@ CONFIG_DMA_NONCOHERENT=y
86CONFIG_DMA_NEED_PCI_MAP_STATE=y 89CONFIG_DMA_NEED_PCI_MAP_STATE=y
87CONFIG_EARLY_PRINTK=y 90CONFIG_EARLY_PRINTK=y
88CONFIG_SYS_HAS_EARLY_PRINTK=y 91CONFIG_SYS_HAS_EARLY_PRINTK=y
89# CONFIG_HOTPLUG_CPU is not set
90# CONFIG_NO_IOPORT is not set 92# CONFIG_NO_IOPORT is not set
91CONFIG_GENERIC_GPIO=y 93CONFIG_GENERIC_GPIO=y
92CONFIG_CPU_BIG_ENDIAN=y 94CONFIG_CPU_BIG_ENDIAN=y
@@ -101,7 +103,7 @@ CONFIG_MIPS_L1_CACHE_SHIFT=5
101# 103#
102# CPU selection 104# CPU selection
103# 105#
104# CONFIG_CPU_LOONGSON2 is not set 106# CONFIG_CPU_LOONGSON2E is not set
105# CONFIG_CPU_MIPS32_R1 is not set 107# CONFIG_CPU_MIPS32_R1 is not set
106# CONFIG_CPU_MIPS32_R2 is not set 108# CONFIG_CPU_MIPS32_R2 is not set
107# CONFIG_CPU_MIPS64_R1 is not set 109# CONFIG_CPU_MIPS64_R1 is not set
@@ -137,6 +139,7 @@ CONFIG_32BIT=y
137CONFIG_PAGE_SIZE_4KB=y 139CONFIG_PAGE_SIZE_4KB=y
138# CONFIG_PAGE_SIZE_8KB is not set 140# CONFIG_PAGE_SIZE_8KB is not set
139# CONFIG_PAGE_SIZE_16KB is not set 141# CONFIG_PAGE_SIZE_16KB is not set
142# CONFIG_PAGE_SIZE_32KB is not set
140# CONFIG_PAGE_SIZE_64KB is not set 143# CONFIG_PAGE_SIZE_64KB is not set
141CONFIG_CPU_HAS_PREFETCH=y 144CONFIG_CPU_HAS_PREFETCH=y
142CONFIG_MIPS_MT_DISABLED=y 145CONFIG_MIPS_MT_DISABLED=y
@@ -154,7 +157,10 @@ CONFIG_SPLIT_PTLOCK_CPUS=4
154# CONFIG_PHYS_ADDR_T_64BIT is not set 157# CONFIG_PHYS_ADDR_T_64BIT is not set
155CONFIG_ZONE_DMA_FLAG=0 158CONFIG_ZONE_DMA_FLAG=0
156CONFIG_VIRT_TO_BUS=y 159CONFIG_VIRT_TO_BUS=y
157CONFIG_UNEVICTABLE_LRU=y 160CONFIG_HAVE_MLOCK=y
161CONFIG_HAVE_MLOCKED_PAGE_BIT=y
162# CONFIG_KSM is not set
163CONFIG_DEFAULT_MMAP_MIN_ADDR=4096
158CONFIG_TICK_ONESHOT=y 164CONFIG_TICK_ONESHOT=y
159CONFIG_NO_HZ=y 165CONFIG_NO_HZ=y
160CONFIG_HIGH_RES_TIMERS=y 166CONFIG_HIGH_RES_TIMERS=y
@@ -175,6 +181,7 @@ CONFIG_PREEMPT_NONE=y
175CONFIG_LOCKDEP_SUPPORT=y 181CONFIG_LOCKDEP_SUPPORT=y
176CONFIG_STACKTRACE_SUPPORT=y 182CONFIG_STACKTRACE_SUPPORT=y
177CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config" 183CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
184CONFIG_CONSTRUCTORS=y
178 185
179# 186#
180# General setup 187# General setup
@@ -194,11 +201,12 @@ CONFIG_SYSVIPC_SYSCTL=y
194# 201#
195# RCU Subsystem 202# RCU Subsystem
196# 203#
197CONFIG_CLASSIC_RCU=y 204CONFIG_TREE_RCU=y
198# CONFIG_TREE_RCU is not set 205# CONFIG_TREE_PREEMPT_RCU is not set
199# CONFIG_PREEMPT_RCU is not set 206# CONFIG_RCU_TRACE is not set
207CONFIG_RCU_FANOUT=32
208# CONFIG_RCU_FANOUT_EXACT is not set
200# CONFIG_TREE_RCU_TRACE is not set 209# CONFIG_TREE_RCU_TRACE is not set
201# CONFIG_PREEMPT_RCU_TRACE is not set
202CONFIG_IKCONFIG=y 210CONFIG_IKCONFIG=y
203CONFIG_IKCONFIG_PROC=y 211CONFIG_IKCONFIG_PROC=y
204CONFIG_LOG_BUF_SHIFT=14 212CONFIG_LOG_BUF_SHIFT=14
@@ -209,8 +217,12 @@ CONFIG_SYSFS_DEPRECATED_V2=y
209# CONFIG_NAMESPACES is not set 217# CONFIG_NAMESPACES is not set
210CONFIG_BLK_DEV_INITRD=y 218CONFIG_BLK_DEV_INITRD=y
211CONFIG_INITRAMFS_SOURCE="" 219CONFIG_INITRAMFS_SOURCE=""
220CONFIG_RD_GZIP=y
221# CONFIG_RD_BZIP2 is not set
222# CONFIG_RD_LZMA is not set
212CONFIG_CC_OPTIMIZE_FOR_SIZE=y 223CONFIG_CC_OPTIMIZE_FOR_SIZE=y
213CONFIG_SYSCTL=y 224CONFIG_SYSCTL=y
225CONFIG_ANON_INODES=y
214CONFIG_EMBEDDED=y 226CONFIG_EMBEDDED=y
215CONFIG_SYSCTL_SYSCALL=y 227CONFIG_SYSCTL_SYSCALL=y
216CONFIG_KALLSYMS=y 228CONFIG_KALLSYMS=y
@@ -220,25 +232,35 @@ CONFIG_PRINTK=y
220CONFIG_BUG=y 232CONFIG_BUG=y
221CONFIG_ELF_CORE=y 233CONFIG_ELF_CORE=y
222# CONFIG_PCSPKR_PLATFORM is not set 234# CONFIG_PCSPKR_PLATFORM is not set
223CONFIG_COMPAT_BRK=y
224CONFIG_BASE_FULL=y 235CONFIG_BASE_FULL=y
225# CONFIG_FUTEX is not set 236CONFIG_FUTEX=y
226CONFIG_ANON_INODES=y
227# CONFIG_EPOLL is not set 237# CONFIG_EPOLL is not set
228CONFIG_SIGNALFD=y 238CONFIG_SIGNALFD=y
229CONFIG_TIMERFD=y 239CONFIG_TIMERFD=y
230CONFIG_EVENTFD=y 240CONFIG_EVENTFD=y
231CONFIG_SHMEM=y 241CONFIG_SHMEM=y
232CONFIG_AIO=y 242CONFIG_AIO=y
243
244#
245# Kernel Performance Events And Counters
246#
233CONFIG_VM_EVENT_COUNTERS=y 247CONFIG_VM_EVENT_COUNTERS=y
234CONFIG_PCI_QUIRKS=y 248CONFIG_PCI_QUIRKS=y
249CONFIG_COMPAT_BRK=y
235CONFIG_SLAB=y 250CONFIG_SLAB=y
236# CONFIG_SLUB is not set 251# CONFIG_SLUB is not set
237# CONFIG_SLOB is not set 252# CONFIG_SLOB is not set
238# CONFIG_PROFILING is not set 253# CONFIG_PROFILING is not set
239CONFIG_HAVE_OPROFILE=y 254CONFIG_HAVE_OPROFILE=y
240# CONFIG_HAVE_GENERIC_DMA_COHERENT is not set 255
256#
257# GCOV-based kernel profiling
258#
259# CONFIG_GCOV_KERNEL is not set
260# CONFIG_SLOW_WORK is not set
261CONFIG_HAVE_GENERIC_DMA_COHERENT=y
241CONFIG_SLABINFO=y 262CONFIG_SLABINFO=y
263CONFIG_RT_MUTEXES=y
242CONFIG_BASE_SMALL=0 264CONFIG_BASE_SMALL=0
243CONFIG_MODULES=y 265CONFIG_MODULES=y
244# CONFIG_MODULE_FORCE_LOAD is not set 266# CONFIG_MODULE_FORCE_LOAD is not set
@@ -246,8 +268,8 @@ CONFIG_MODULE_UNLOAD=y
246# CONFIG_MODVERSIONS is not set 268# CONFIG_MODVERSIONS is not set
247# CONFIG_MODULE_SRCVERSION_ALL is not set 269# CONFIG_MODULE_SRCVERSION_ALL is not set
248CONFIG_BLOCK=y 270CONFIG_BLOCK=y
249# CONFIG_LBD is not set 271# CONFIG_LBDAF is not set
250# CONFIG_BLK_DEV_IO_TRACE is not set 272# CONFIG_BLK_DEV_BSG is not set
251# CONFIG_BLK_DEV_INTEGRITY is not set 273# CONFIG_BLK_DEV_INTEGRITY is not set
252 274
253# 275#
@@ -274,6 +296,7 @@ CONFIG_PCI_DOMAINS=y
274# CONFIG_ARCH_SUPPORTS_MSI is not set 296# CONFIG_ARCH_SUPPORTS_MSI is not set
275# CONFIG_PCI_LEGACY is not set 297# CONFIG_PCI_LEGACY is not set
276# CONFIG_PCI_STUB is not set 298# CONFIG_PCI_STUB is not set
299# CONFIG_PCI_IOV is not set
277CONFIG_MMU=y 300CONFIG_MMU=y
278 301
279# 302#
@@ -288,6 +311,7 @@ CONFIG_TRAD_SIGNALS=y
288# 311#
289# Power management options 312# Power management options
290# 313#
314CONFIG_ARCH_HIBERNATION_POSSIBLE=y
291CONFIG_ARCH_SUSPEND_POSSIBLE=y 315CONFIG_ARCH_SUSPEND_POSSIBLE=y
292# CONFIG_PM is not set 316# CONFIG_PM is not set
293CONFIG_NET=y 317CONFIG_NET=y
@@ -295,7 +319,6 @@ CONFIG_NET=y
295# 319#
296# Networking options 320# Networking options
297# 321#
298CONFIG_COMPAT_NET_DEV_OPS=y
299CONFIG_PACKET=y 322CONFIG_PACKET=y
300# CONFIG_PACKET_MMAP is not set 323# CONFIG_PACKET_MMAP is not set
301CONFIG_UNIX=y 324CONFIG_UNIX=y
@@ -311,6 +334,7 @@ CONFIG_IP_PNP=y
311# CONFIG_NET_IPIP is not set 334# CONFIG_NET_IPIP is not set
312# CONFIG_NET_IPGRE is not set 335# CONFIG_NET_IPGRE is not set
313# CONFIG_IP_MROUTE is not set 336# CONFIG_IP_MROUTE is not set
337# CONFIG_ARPD is not set
314# CONFIG_SYN_COOKIES is not set 338# CONFIG_SYN_COOKIES is not set
315# CONFIG_INET_AH is not set 339# CONFIG_INET_AH is not set
316# CONFIG_INET_ESP is not set 340# CONFIG_INET_ESP is not set
@@ -336,6 +360,7 @@ CONFIG_DEFAULT_TCP_CONG="cubic"
336# CONFIG_LLC2 is not set 360# CONFIG_LLC2 is not set
337# CONFIG_IPX is not set 361# CONFIG_IPX is not set
338# CONFIG_ATALK is not set 362# CONFIG_ATALK is not set
363# CONFIG_PHONET is not set
339# CONFIG_NET_SCHED is not set 364# CONFIG_NET_SCHED is not set
340# CONFIG_DCB is not set 365# CONFIG_DCB is not set
341 366
@@ -347,7 +372,6 @@ CONFIG_DEFAULT_TCP_CONG="cubic"
347# CONFIG_CAN is not set 372# CONFIG_CAN is not set
348# CONFIG_IRDA is not set 373# CONFIG_IRDA is not set
349# CONFIG_BT is not set 374# CONFIG_BT is not set
350# CONFIG_PHONET is not set
351# CONFIG_WIRELESS is not set 375# CONFIG_WIRELESS is not set
352# CONFIG_WIMAX is not set 376# CONFIG_WIMAX is not set
353# CONFIG_RFKILL is not set 377# CONFIG_RFKILL is not set
@@ -365,9 +389,9 @@ CONFIG_PREVENT_FIRMWARE_BUILD=y
365# CONFIG_CONNECTOR is not set 389# CONFIG_CONNECTOR is not set
366CONFIG_MTD=y 390CONFIG_MTD=y
367# CONFIG_MTD_DEBUG is not set 391# CONFIG_MTD_DEBUG is not set
392# CONFIG_MTD_TESTS is not set
368# CONFIG_MTD_CONCAT is not set 393# CONFIG_MTD_CONCAT is not set
369CONFIG_MTD_PARTITIONS=y 394CONFIG_MTD_PARTITIONS=y
370# CONFIG_MTD_TESTS is not set
371# CONFIG_MTD_REDBOOT_PARTS is not set 395# CONFIG_MTD_REDBOOT_PARTS is not set
372CONFIG_MTD_CMDLINE_PARTS=y 396CONFIG_MTD_CMDLINE_PARTS=y
373# CONFIG_MTD_AR7_PARTS is not set 397# CONFIG_MTD_AR7_PARTS is not set
@@ -376,9 +400,9 @@ CONFIG_MTD_CMDLINE_PARTS=y
376# User Modules And Translation Layers 400# User Modules And Translation Layers
377# 401#
378CONFIG_MTD_CHAR=y 402CONFIG_MTD_CHAR=y
379# CONFIG_MTD_BLKDEVS is not set 403CONFIG_MTD_BLKDEVS=m
380# CONFIG_MTD_BLOCK is not set 404CONFIG_MTD_BLOCK=m
381# CONFIG_MTD_BLOCK_RO is not set 405CONFIG_MTD_BLOCK_RO=m
382# CONFIG_FTL is not set 406# CONFIG_FTL is not set
383# CONFIG_NFTL is not set 407# CONFIG_NFTL is not set
384# CONFIG_INFTL is not set 408# CONFIG_INFTL is not set
@@ -414,16 +438,20 @@ CONFIG_MTD_CFI_UTIL=y
414# 438#
415# Mapping drivers for chip access 439# Mapping drivers for chip access
416# 440#
417# CONFIG_MTD_COMPLEX_MAPPINGS is not set 441CONFIG_MTD_COMPLEX_MAPPINGS=y
418CONFIG_MTD_PHYSMAP=y 442CONFIG_MTD_PHYSMAP=y
419# CONFIG_MTD_PHYSMAP_COMPAT is not set 443# CONFIG_MTD_PHYSMAP_COMPAT is not set
444# CONFIG_MTD_PCI is not set
445# CONFIG_MTD_GPIO_ADDR is not set
420# CONFIG_MTD_INTEL_VR_NOR is not set 446# CONFIG_MTD_INTEL_VR_NOR is not set
447CONFIG_MTD_RBTX4939=y
421# CONFIG_MTD_PLATRAM is not set 448# CONFIG_MTD_PLATRAM is not set
422 449
423# 450#
424# Self-contained MTD device drivers 451# Self-contained MTD device drivers
425# 452#
426# CONFIG_MTD_PMC551 is not set 453# CONFIG_MTD_PMC551 is not set
454# CONFIG_MTD_SST25L is not set
427# CONFIG_MTD_SLRAM is not set 455# CONFIG_MTD_SLRAM is not set
428# CONFIG_MTD_PHRAM is not set 456# CONFIG_MTD_PHRAM is not set
429# CONFIG_MTD_MTDRAM is not set 457# CONFIG_MTD_MTDRAM is not set
@@ -435,7 +463,15 @@ CONFIG_MTD_PHYSMAP=y
435# CONFIG_MTD_DOC2000 is not set 463# CONFIG_MTD_DOC2000 is not set
436# CONFIG_MTD_DOC2001 is not set 464# CONFIG_MTD_DOC2001 is not set
437# CONFIG_MTD_DOC2001PLUS is not set 465# CONFIG_MTD_DOC2001PLUS is not set
438# CONFIG_MTD_NAND is not set 466CONFIG_MTD_NAND=m
467# CONFIG_MTD_NAND_VERIFY_WRITE is not set
468# CONFIG_MTD_NAND_ECC_SMC is not set
469# CONFIG_MTD_NAND_MUSEUM_IDS is not set
470CONFIG_MTD_NAND_IDS=m
471# CONFIG_MTD_NAND_CAFE is not set
472# CONFIG_MTD_NAND_NANDSIM is not set
473# CONFIG_MTD_NAND_PLATFORM is not set
474CONFIG_MTD_NAND_TXX9NDFMC=m
439# CONFIG_MTD_ONENAND is not set 475# CONFIG_MTD_ONENAND is not set
440 476
441# 477#
@@ -471,6 +507,7 @@ CONFIG_IDE=y
471# 507#
472# Please see Documentation/ide/ide.txt for help/info on IDE drives 508# Please see Documentation/ide/ide.txt for help/info on IDE drives
473# 509#
510CONFIG_IDE_XFER_MODE=y
474CONFIG_IDE_TIMINGS=y 511CONFIG_IDE_TIMINGS=y
475# CONFIG_BLK_DEV_IDE_SATA is not set 512# CONFIG_BLK_DEV_IDE_SATA is not set
476CONFIG_IDE_GD=y 513CONFIG_IDE_GD=y
@@ -534,8 +571,13 @@ CONFIG_BLK_DEV_IDEDMA=y
534# 571#
535 572
536# 573#
537# A new alternative FireWire stack is available with EXPERIMENTAL=y 574# You can enable one or both FireWire driver stacks.
538# 575#
576
577#
578# See the help texts for more information.
579#
580# CONFIG_FIREWIRE is not set
539# CONFIG_IEEE1394 is not set 581# CONFIG_IEEE1394 is not set
540# CONFIG_I2O is not set 582# CONFIG_I2O is not set
541CONFIG_NETDEVICES=y 583CONFIG_NETDEVICES=y
@@ -574,6 +616,8 @@ CONFIG_MII=y
574# CONFIG_NET_VENDOR_3COM is not set 616# CONFIG_NET_VENDOR_3COM is not set
575CONFIG_SMC91X=y 617CONFIG_SMC91X=y
576# CONFIG_DM9000 is not set 618# CONFIG_DM9000 is not set
619# CONFIG_ETHOC is not set
620# CONFIG_DNET is not set
577# CONFIG_NET_TULIP is not set 621# CONFIG_NET_TULIP is not set
578# CONFIG_HP100 is not set 622# CONFIG_HP100 is not set
579CONFIG_NE2000=y 623CONFIG_NE2000=y
@@ -602,18 +646,15 @@ CONFIG_TC35815=y
602# CONFIG_SMSC9420 is not set 646# CONFIG_SMSC9420 is not set
603# CONFIG_SUNDANCE is not set 647# CONFIG_SUNDANCE is not set
604# CONFIG_TLAN is not set 648# CONFIG_TLAN is not set
649# CONFIG_KS8842 is not set
650# CONFIG_KS8851 is not set
651# CONFIG_KS8851_MLL is not set
605# CONFIG_VIA_RHINE is not set 652# CONFIG_VIA_RHINE is not set
606# CONFIG_ATL2 is not set 653# CONFIG_ATL2 is not set
607# CONFIG_NETDEV_1000 is not set 654# CONFIG_NETDEV_1000 is not set
608# CONFIG_NETDEV_10000 is not set 655# CONFIG_NETDEV_10000 is not set
609# CONFIG_TR is not set 656# CONFIG_TR is not set
610 657# CONFIG_WLAN is not set
611#
612# Wireless LAN
613#
614# CONFIG_WLAN_PRE80211 is not set
615# CONFIG_WLAN_80211 is not set
616# CONFIG_IWLWIFI_LEDS is not set
617 658
618# 659#
619# Enable WiMAX (Networking options) to see the WiMAX drivers 660# Enable WiMAX (Networking options) to see the WiMAX drivers
@@ -653,6 +694,7 @@ CONFIG_DEVKMEM=y
653# 694#
654# Non-8250 serial port support 695# Non-8250 serial port support
655# 696#
697# CONFIG_SERIAL_MAX3100 is not set
656CONFIG_SERIAL_CORE=y 698CONFIG_SERIAL_CORE=y
657CONFIG_SERIAL_CORE_CONSOLE=y 699CONFIG_SERIAL_CORE_CONSOLE=y
658CONFIG_SERIAL_TXX9=y 700CONFIG_SERIAL_TXX9=y
@@ -666,7 +708,9 @@ CONFIG_UNIX98_PTYS=y
666CONFIG_LEGACY_PTYS=y 708CONFIG_LEGACY_PTYS=y
667CONFIG_LEGACY_PTY_COUNT=256 709CONFIG_LEGACY_PTY_COUNT=256
668# CONFIG_IPMI_HANDLER is not set 710# CONFIG_IPMI_HANDLER is not set
669# CONFIG_HW_RANDOM is not set 711CONFIG_HW_RANDOM=m
712# CONFIG_HW_RANDOM_TIMERIOMEM is not set
713CONFIG_HW_RANDOM_TX4939=m
670# CONFIG_R3964 is not set 714# CONFIG_R3964 is not set
671# CONFIG_APPLICOM is not set 715# CONFIG_APPLICOM is not set
672# CONFIG_RAW_DRIVER is not set 716# CONFIG_RAW_DRIVER is not set
@@ -686,6 +730,10 @@ CONFIG_SPI_TXX9=y
686# SPI Protocol Masters 730# SPI Protocol Masters
687# 731#
688# CONFIG_SPI_TLE62X0 is not set 732# CONFIG_SPI_TLE62X0 is not set
733
734#
735# PPS support
736#
689CONFIG_ARCH_REQUIRE_GPIOLIB=y 737CONFIG_ARCH_REQUIRE_GPIOLIB=y
690CONFIG_GPIOLIB=y 738CONFIG_GPIOLIB=y
691 739
@@ -701,17 +749,22 @@ CONFIG_GPIOLIB=y
701# PCI GPIO expanders: 749# PCI GPIO expanders:
702# 750#
703# CONFIG_GPIO_BT8XX is not set 751# CONFIG_GPIO_BT8XX is not set
752# CONFIG_GPIO_LANGWELL is not set
704 753
705# 754#
706# SPI GPIO expanders: 755# SPI GPIO expanders:
707# 756#
708# CONFIG_GPIO_MAX7301 is not set 757# CONFIG_GPIO_MAX7301 is not set
709# CONFIG_GPIO_MCP23S08 is not set 758# CONFIG_GPIO_MCP23S08 is not set
759# CONFIG_GPIO_MC33880 is not set
760
761#
762# AC97 GPIO expanders:
763#
710# CONFIG_W1 is not set 764# CONFIG_W1 is not set
711# CONFIG_POWER_SUPPLY is not set 765# CONFIG_POWER_SUPPLY is not set
712# CONFIG_HWMON is not set 766# CONFIG_HWMON is not set
713# CONFIG_THERMAL is not set 767# CONFIG_THERMAL is not set
714# CONFIG_THERMAL_HWMON is not set
715CONFIG_WATCHDOG=y 768CONFIG_WATCHDOG=y
716# CONFIG_WATCHDOG_NOWAYOUT is not set 769# CONFIG_WATCHDOG_NOWAYOUT is not set
717 770
@@ -740,28 +793,17 @@ CONFIG_SSB_POSSIBLE=y
740# CONFIG_MFD_CORE is not set 793# CONFIG_MFD_CORE is not set
741# CONFIG_MFD_SM501 is not set 794# CONFIG_MFD_SM501 is not set
742# CONFIG_HTC_PASIC3 is not set 795# CONFIG_HTC_PASIC3 is not set
796# CONFIG_UCB1400_CORE is not set
743# CONFIG_MFD_TMIO is not set 797# CONFIG_MFD_TMIO is not set
798# CONFIG_MFD_MC13783 is not set
799# CONFIG_EZX_PCAP is not set
744# CONFIG_REGULATOR is not set 800# CONFIG_REGULATOR is not set
745 801# CONFIG_MEDIA_SUPPORT is not set
746#
747# Multimedia devices
748#
749
750#
751# Multimedia core support
752#
753# CONFIG_VIDEO_DEV is not set
754# CONFIG_DVB_CORE is not set
755# CONFIG_VIDEO_MEDIA is not set
756
757#
758# Multimedia drivers
759#
760# CONFIG_DAB is not set
761 802
762# 803#
763# Graphics support 804# Graphics support
764# 805#
806# CONFIG_VGA_ARB is not set
765# CONFIG_DRM is not set 807# CONFIG_DRM is not set
766# CONFIG_VGASTATE is not set 808# CONFIG_VGASTATE is not set
767# CONFIG_VIDEO_OUTPUT_CONTROL is not set 809# CONFIG_VIDEO_OUTPUT_CONTROL is not set
@@ -772,7 +814,42 @@ CONFIG_SSB_POSSIBLE=y
772# Display device support 814# Display device support
773# 815#
774# CONFIG_DISPLAY_SUPPORT is not set 816# CONFIG_DISPLAY_SUPPORT is not set
775# CONFIG_SOUND is not set 817CONFIG_SOUND=m
818# CONFIG_SOUND_OSS_CORE is not set
819CONFIG_SND=m
820CONFIG_SND_TIMER=m
821CONFIG_SND_PCM=m
822# CONFIG_SND_SEQUENCER is not set
823# CONFIG_SND_MIXER_OSS is not set
824# CONFIG_SND_PCM_OSS is not set
825# CONFIG_SND_HRTIMER is not set
826# CONFIG_SND_DYNAMIC_MINORS is not set
827# CONFIG_SND_SUPPORT_OLD_API is not set
828# CONFIG_SND_VERBOSE_PROCFS is not set
829# CONFIG_SND_VERBOSE_PRINTK is not set
830# CONFIG_SND_DEBUG is not set
831CONFIG_SND_VMASTER=y
832# CONFIG_SND_RAWMIDI_SEQ is not set
833# CONFIG_SND_OPL3_LIB_SEQ is not set
834# CONFIG_SND_OPL4_LIB_SEQ is not set
835# CONFIG_SND_SBAWE_SEQ is not set
836# CONFIG_SND_EMU10K1_SEQ is not set
837CONFIG_SND_AC97_CODEC=m
838# CONFIG_SND_DRIVERS is not set
839# CONFIG_SND_PCI is not set
840# CONFIG_SND_SPI is not set
841# CONFIG_SND_MIPS is not set
842CONFIG_SND_SOC=m
843CONFIG_SND_SOC_AC97_BUS=y
844CONFIG_SND_SOC_TXX9ACLC=m
845CONFIG_HAS_TXX9_ACLC=y
846CONFIG_SND_SOC_TXX9ACLC_AC97=m
847CONFIG_SND_SOC_TXX9ACLC_GENERIC=m
848CONFIG_SND_SOC_I2C_AND_SPI=m
849# CONFIG_SND_SOC_ALL_CODECS is not set
850CONFIG_SND_SOC_AC97_CODEC=m
851# CONFIG_SOUND_PRIME is not set
852CONFIG_AC97_BUS=m
776# CONFIG_USB_SUPPORT is not set 853# CONFIG_USB_SUPPORT is not set
777# CONFIG_MMC is not set 854# CONFIG_MMC is not set
778# CONFIG_MEMSTICK is not set 855# CONFIG_MEMSTICK is not set
@@ -783,6 +860,8 @@ CONFIG_LEDS_CLASS=y
783# LED drivers 860# LED drivers
784# 861#
785CONFIG_LEDS_GPIO=y 862CONFIG_LEDS_GPIO=y
863CONFIG_LEDS_GPIO_PLATFORM=y
864# CONFIG_LEDS_DAC124S085 is not set
786 865
787# 866#
788# LED Triggers 867# LED Triggers
@@ -792,7 +871,12 @@ CONFIG_LEDS_TRIGGERS=y
792CONFIG_LEDS_TRIGGER_IDE_DISK=y 871CONFIG_LEDS_TRIGGER_IDE_DISK=y
793CONFIG_LEDS_TRIGGER_HEARTBEAT=y 872CONFIG_LEDS_TRIGGER_HEARTBEAT=y
794# CONFIG_LEDS_TRIGGER_BACKLIGHT is not set 873# CONFIG_LEDS_TRIGGER_BACKLIGHT is not set
874# CONFIG_LEDS_TRIGGER_GPIO is not set
795# CONFIG_LEDS_TRIGGER_DEFAULT_ON is not set 875# CONFIG_LEDS_TRIGGER_DEFAULT_ON is not set
876
877#
878# iptables trigger is under Netfilter config (LED target)
879#
796# CONFIG_ACCESSIBILITY is not set 880# CONFIG_ACCESSIBILITY is not set
797# CONFIG_INFINIBAND is not set 881# CONFIG_INFINIBAND is not set
798CONFIG_RTC_LIB=y 882CONFIG_RTC_LIB=y
@@ -820,6 +904,7 @@ CONFIG_RTC_INTF_DEV_UIE_EMUL=y
820# CONFIG_RTC_DRV_R9701 is not set 904# CONFIG_RTC_DRV_R9701 is not set
821CONFIG_RTC_DRV_RS5C348=y 905CONFIG_RTC_DRV_RS5C348=y
822# CONFIG_RTC_DRV_DS3234 is not set 906# CONFIG_RTC_DRV_DS3234 is not set
907# CONFIG_RTC_DRV_PCF2123 is not set
823 908
824# 909#
825# Platform RTC drivers 910# Platform RTC drivers
@@ -840,8 +925,26 @@ CONFIG_RTC_DRV_DS1742=y
840# on-CPU RTC drivers 925# on-CPU RTC drivers
841# 926#
842CONFIG_RTC_DRV_TX4939=y 927CONFIG_RTC_DRV_TX4939=y
843# CONFIG_DMADEVICES is not set 928CONFIG_DMADEVICES=y
929
930#
931# DMA Devices
932#
933CONFIG_TXX9_DMAC=m
934CONFIG_DMA_ENGINE=y
935
936#
937# DMA Clients
938#
939# CONFIG_NET_DMA is not set
940# CONFIG_ASYNC_TX_DMA is not set
941# CONFIG_DMATEST is not set
942# CONFIG_AUXDISPLAY is not set
844# CONFIG_UIO is not set 943# CONFIG_UIO is not set
944
945#
946# TI VLYNQ
947#
845# CONFIG_STAGING is not set 948# CONFIG_STAGING is not set
846 949
847# 950#
@@ -853,9 +956,10 @@ CONFIG_RTC_DRV_TX4939=y
853# CONFIG_REISERFS_FS is not set 956# CONFIG_REISERFS_FS is not set
854# CONFIG_JFS_FS is not set 957# CONFIG_JFS_FS is not set
855CONFIG_FS_POSIX_ACL=y 958CONFIG_FS_POSIX_ACL=y
856CONFIG_FILE_LOCKING=y
857# CONFIG_XFS_FS is not set 959# CONFIG_XFS_FS is not set
858# CONFIG_OCFS2_FS is not set 960# CONFIG_OCFS2_FS is not set
961CONFIG_FILE_LOCKING=y
962CONFIG_FSNOTIFY=y
859# CONFIG_DNOTIFY is not set 963# CONFIG_DNOTIFY is not set
860CONFIG_INOTIFY=y 964CONFIG_INOTIFY=y
861CONFIG_INOTIFY_USER=y 965CONFIG_INOTIFY_USER=y
@@ -866,6 +970,10 @@ CONFIG_INOTIFY_USER=y
866CONFIG_GENERIC_ACL=y 970CONFIG_GENERIC_ACL=y
867 971
868# 972#
973# Caches
974#
975
976#
869# CD-ROM/DVD Filesystems 977# CD-ROM/DVD Filesystems
870# 978#
871# CONFIG_ISO9660_FS is not set 979# CONFIG_ISO9660_FS is not set
@@ -890,7 +998,27 @@ CONFIG_TMPFS=y
890CONFIG_TMPFS_POSIX_ACL=y 998CONFIG_TMPFS_POSIX_ACL=y
891# CONFIG_HUGETLB_PAGE is not set 999# CONFIG_HUGETLB_PAGE is not set
892# CONFIG_CONFIGFS_FS is not set 1000# CONFIG_CONFIGFS_FS is not set
893# CONFIG_MISC_FILESYSTEMS is not set 1001CONFIG_MISC_FILESYSTEMS=y
1002# CONFIG_HFSPLUS_FS is not set
1003CONFIG_JFFS2_FS=m
1004CONFIG_JFFS2_FS_DEBUG=0
1005CONFIG_JFFS2_FS_WRITEBUFFER=y
1006# CONFIG_JFFS2_FS_WBUF_VERIFY is not set
1007# CONFIG_JFFS2_COMPRESSION_OPTIONS is not set
1008CONFIG_JFFS2_ZLIB=y
1009# CONFIG_JFFS2_LZO is not set
1010CONFIG_JFFS2_RTIME=y
1011# CONFIG_JFFS2_RUBIN is not set
1012# CONFIG_CRAMFS is not set
1013# CONFIG_SQUASHFS is not set
1014# CONFIG_VXFS_FS is not set
1015# CONFIG_MINIX_FS is not set
1016# CONFIG_OMFS_FS is not set
1017# CONFIG_HPFS_FS is not set
1018# CONFIG_QNX4FS_FS is not set
1019# CONFIG_ROMFS_FS is not set
1020# CONFIG_SYSV_FS is not set
1021# CONFIG_UFS_FS is not set
894CONFIG_NETWORK_FILESYSTEMS=y 1022CONFIG_NETWORK_FILESYSTEMS=y
895CONFIG_NFS_FS=y 1023CONFIG_NFS_FS=y
896CONFIG_NFS_V3=y 1024CONFIG_NFS_V3=y
@@ -922,6 +1050,7 @@ CONFIG_ENABLE_WARN_DEPRECATED=y
922CONFIG_ENABLE_MUST_CHECK=y 1050CONFIG_ENABLE_MUST_CHECK=y
923CONFIG_FRAME_WARN=1024 1051CONFIG_FRAME_WARN=1024
924# CONFIG_MAGIC_SYSRQ is not set 1052# CONFIG_MAGIC_SYSRQ is not set
1053CONFIG_STRIP_ASM_SYMS=y
925# CONFIG_UNUSED_SYMBOLS is not set 1054# CONFIG_UNUSED_SYMBOLS is not set
926CONFIG_DEBUG_FS=y 1055CONFIG_DEBUG_FS=y
927# CONFIG_HEADERS_CHECK is not set 1056# CONFIG_HEADERS_CHECK is not set
@@ -929,11 +1058,9 @@ CONFIG_DEBUG_FS=y
929# CONFIG_DEBUG_MEMORY_INIT is not set 1058# CONFIG_DEBUG_MEMORY_INIT is not set
930# CONFIG_RCU_CPU_STALL_DETECTOR is not set 1059# CONFIG_RCU_CPU_STALL_DETECTOR is not set
931CONFIG_SYSCTL_SYSCALL_CHECK=y 1060CONFIG_SYSCTL_SYSCALL_CHECK=y
932 1061CONFIG_TRACING_SUPPORT=y
933# 1062# CONFIG_FTRACE is not set
934# Tracers 1063# CONFIG_DYNAMIC_DEBUG is not set
935#
936# CONFIG_DYNAMIC_PRINTK_DEBUG is not set
937# CONFIG_SAMPLES is not set 1064# CONFIG_SAMPLES is not set
938CONFIG_HAVE_ARCH_KGDB=y 1065CONFIG_HAVE_ARCH_KGDB=y
939CONFIG_CMDLINE="" 1066CONFIG_CMDLINE=""
@@ -946,6 +1073,7 @@ CONFIG_CMDLINE=""
946# CONFIG_SECURITYFS is not set 1073# CONFIG_SECURITYFS is not set
947# CONFIG_SECURITY_FILE_CAPABILITIES is not set 1074# CONFIG_SECURITY_FILE_CAPABILITIES is not set
948# CONFIG_CRYPTO is not set 1075# CONFIG_CRYPTO is not set
1076# CONFIG_BINARY_PRINTF is not set
949 1077
950# 1078#
951# Library routines 1079# Library routines
@@ -959,6 +1087,10 @@ CONFIG_GENERIC_FIND_LAST_BIT=y
959CONFIG_CRC32=y 1087CONFIG_CRC32=y
960# CONFIG_CRC7 is not set 1088# CONFIG_CRC7 is not set
961# CONFIG_LIBCRC32C is not set 1089# CONFIG_LIBCRC32C is not set
1090CONFIG_ZLIB_INFLATE=y
1091CONFIG_ZLIB_DEFLATE=m
1092CONFIG_DECOMPRESS_GZIP=y
962CONFIG_HAS_IOMEM=y 1093CONFIG_HAS_IOMEM=y
963CONFIG_HAS_IOPORT=y 1094CONFIG_HAS_IOPORT=y
964CONFIG_HAS_DMA=y 1095CONFIG_HAS_DMA=y
1096CONFIG_NLATTR=y
diff --git a/arch/mips/include/asm/bug.h b/arch/mips/include/asm/bug.h
index 6cf29c26e873..540c98a810d1 100644
--- a/arch/mips/include/asm/bug.h
+++ b/arch/mips/include/asm/bug.h
@@ -11,9 +11,7 @@
11static inline void __noreturn BUG(void) 11static inline void __noreturn BUG(void)
12{ 12{
13 __asm__ __volatile__("break %0" : : "i" (BRK_BUG)); 13 __asm__ __volatile__("break %0" : : "i" (BRK_BUG));
14 /* Fool GCC into thinking the function doesn't return. */ 14 unreachable();
15 while (1)
16 ;
17} 15}
18 16
19#define HAVE_ARCH_BUG 17#define HAVE_ARCH_BUG
diff --git a/arch/mips/include/asm/dma-mapping.h b/arch/mips/include/asm/dma-mapping.h
index d16afddb09a9..664ba53dc32a 100644
--- a/arch/mips/include/asm/dma-mapping.h
+++ b/arch/mips/include/asm/dma-mapping.h
@@ -3,6 +3,7 @@
3 3
4#include <asm/scatterlist.h> 4#include <asm/scatterlist.h>
5#include <asm/cache.h> 5#include <asm/cache.h>
6#include <asm-generic/dma-coherent.h>
6 7
7void *dma_alloc_noncoherent(struct device *dev, size_t size, 8void *dma_alloc_noncoherent(struct device *dev, size_t size,
8 dma_addr_t *dma_handle, gfp_t flag); 9 dma_addr_t *dma_handle, gfp_t flag);
@@ -73,14 +74,4 @@ extern int dma_is_consistent(struct device *dev, dma_addr_t dma_addr);
73extern void dma_cache_sync(struct device *dev, void *vaddr, size_t size, 74extern void dma_cache_sync(struct device *dev, void *vaddr, size_t size,
74 enum dma_data_direction direction); 75 enum dma_data_direction direction);
75 76
76#if 0
77#define ARCH_HAS_DMA_DECLARE_COHERENT_MEMORY
78
79extern int dma_declare_coherent_memory(struct device *dev, dma_addr_t bus_addr,
80 dma_addr_t device_addr, size_t size, int flags);
81extern void dma_release_declared_memory(struct device *dev);
82extern void * dma_mark_declared_memory_occupied(struct device *dev,
83 dma_addr_t device_addr, size_t size);
84#endif
85
86#endif /* _ASM_DMA_MAPPING_H */ 77#endif /* _ASM_DMA_MAPPING_H */
diff --git a/arch/mips/include/asm/fixmap.h b/arch/mips/include/asm/fixmap.h
index efeddc8db8b1..0b89b83e2055 100644
--- a/arch/mips/include/asm/fixmap.h
+++ b/arch/mips/include/asm/fixmap.h
@@ -48,9 +48,9 @@ enum fixed_addresses {
48#define FIX_N_COLOURS 8 48#define FIX_N_COLOURS 8
49 FIX_CMAP_BEGIN, 49 FIX_CMAP_BEGIN,
50#ifdef CONFIG_MIPS_MT_SMTC 50#ifdef CONFIG_MIPS_MT_SMTC
51 FIX_CMAP_END = FIX_CMAP_BEGIN + (FIX_N_COLOURS * NR_CPUS), 51 FIX_CMAP_END = FIX_CMAP_BEGIN + (FIX_N_COLOURS * NR_CPUS * 2),
52#else 52#else
53 FIX_CMAP_END = FIX_CMAP_BEGIN + FIX_N_COLOURS, 53 FIX_CMAP_END = FIX_CMAP_BEGIN + (FIX_N_COLOURS * 2),
54#endif 54#endif
55#ifdef CONFIG_HIGHMEM 55#ifdef CONFIG_HIGHMEM
56 /* reserved pte's for temporary kernel mappings */ 56 /* reserved pte's for temporary kernel mappings */
diff --git a/arch/mips/include/asm/gcmpregs.h b/arch/mips/include/asm/gcmpregs.h
index 36fd969d64d6..c0cf76a2ca89 100644
--- a/arch/mips/include/asm/gcmpregs.h
+++ b/arch/mips/include/asm/gcmpregs.h
@@ -19,15 +19,20 @@
19#define GCMP_GDB_OFS 0x8000 /* Global Debug Block */ 19#define GCMP_GDB_OFS 0x8000 /* Global Debug Block */
20 20
21/* Offsets to individual GCMP registers from GCMP base */ 21/* Offsets to individual GCMP registers from GCMP base */
22#define GCMPOFS(block, tag, reg) (GCMP_##block##_OFS + GCMP_##tag##_##reg##_OFS) 22#define GCMPOFS(block, tag, reg) \
23 (GCMP_##block##_OFS + GCMP_##tag##_##reg##_OFS)
24#define GCMPOFSn(block, tag, reg, n) \
25 (GCMP_##block##_OFS + GCMP_##tag##_##reg##_OFS(n))
23 26
24#define GCMPGCBOFS(reg) GCMPOFS(GCB, GCB, reg) 27#define GCMPGCBOFS(reg) GCMPOFS(GCB, GCB, reg)
28#define GCMPGCBOFSn(reg, n) GCMPOFSn(GCB, GCB, reg, n)
25#define GCMPCLCBOFS(reg) GCMPOFS(CLCB, CCB, reg) 29#define GCMPCLCBOFS(reg) GCMPOFS(CLCB, CCB, reg)
26#define GCMPCOCBOFS(reg) GCMPOFS(COCB, CCB, reg) 30#define GCMPCOCBOFS(reg) GCMPOFS(COCB, CCB, reg)
27#define GCMPGDBOFS(reg) GCMPOFS(GDB, GDB, reg) 31#define GCMPGDBOFS(reg) GCMPOFS(GDB, GDB, reg)
28 32
29/* GCMP register access */ 33/* GCMP register access */
30#define GCMPGCB(reg) REGP(_gcmp_base, GCMPGCBOFS(reg)) 34#define GCMPGCB(reg) REGP(_gcmp_base, GCMPGCBOFS(reg))
35#define GCMPGCBn(reg, n) REGP(_gcmp_base, GCMPGCBOFSn(reg, n))
31#define GCMPCLCB(reg) REGP(_gcmp_base, GCMPCLCBOFS(reg)) 36#define GCMPCLCB(reg) REGP(_gcmp_base, GCMPCLCBOFS(reg))
32#define GCMPCOCB(reg) REGP(_gcmp_base, GCMPCOCBOFS(reg)) 37#define GCMPCOCB(reg) REGP(_gcmp_base, GCMPCOCBOFS(reg))
33#define GCMPGDB(reg) REGP(_gcmp_base, GCMPGDBOFS(reg)) 38#define GCMPGDB(reg) REGP(_gcmp_base, GCMPGDBOFS(reg))
@@ -49,10 +54,10 @@
49#define GCMP_GCB_GCMPB_GCMPBASE_MSK GCMPGCBMSK(GCMPB_GCMPBASE, 17) 54#define GCMP_GCB_GCMPB_GCMPBASE_MSK GCMPGCBMSK(GCMPB_GCMPBASE, 17)
50#define GCMP_GCB_GCMPB_CMDEFTGT_SHF 0 55#define GCMP_GCB_GCMPB_CMDEFTGT_SHF 0
51#define GCMP_GCB_GCMPB_CMDEFTGT_MSK GCMPGCBMSK(GCMPB_CMDEFTGT, 2) 56#define GCMP_GCB_GCMPB_CMDEFTGT_MSK GCMPGCBMSK(GCMPB_CMDEFTGT, 2)
52#define GCMP_GCB_GCMPB_CMDEFTGT_MEM 0 57#define GCMP_GCB_GCMPB_CMDEFTGT_DISABLED 0
53#define GCMP_GCB_GCMPB_CMDEFTGT_MEM1 1 58#define GCMP_GCB_GCMPB_CMDEFTGT_MEM 1
54#define GCMP_GCB_GCMPB_CMDEFTGT_IOCU1 2 59#define GCMP_GCB_GCMPB_CMDEFTGT_IOCU1 2
55#define GCMP_GCB_GCMPB_CMDEFTGT_IOCU2 3 60#define GCMP_GCB_GCMPB_CMDEFTGT_IOCU2 3
56#define GCMP_GCB_CCMC_OFS 0x0010 /* Global CM Control */ 61#define GCMP_GCB_CCMC_OFS 0x0010 /* Global CM Control */
57#define GCMP_GCB_GCSRAP_OFS 0x0020 /* Global CSR Access Privilege */ 62#define GCMP_GCB_GCSRAP_OFS 0x0020 /* Global CSR Access Privilege */
58#define GCMP_GCB_GCSRAP_CMACCESS_SHF 0 63#define GCMP_GCB_GCSRAP_CMACCESS_SHF 0
@@ -115,5 +120,6 @@
115#define GCMP_CCB_DBGGROUP_OFS 0x0100 /* DebugBreak Group */ 120#define GCMP_CCB_DBGGROUP_OFS 0x0100 /* DebugBreak Group */
116 121
117extern int __init gcmp_probe(unsigned long, unsigned long); 122extern int __init gcmp_probe(unsigned long, unsigned long);
118 123extern int __init gcmp_niocu(void);
124extern void __init gcmp_setregion(int, unsigned long, unsigned long, int);
119#endif /* _ASM_GCMPREGS_H */ 125#endif /* _ASM_GCMPREGS_H */
diff --git a/arch/mips/include/asm/gic.h b/arch/mips/include/asm/gic.h
index a8f57341f123..9b9436a4d816 100644
--- a/arch/mips/include/asm/gic.h
+++ b/arch/mips/include/asm/gic.h
@@ -12,7 +12,6 @@
12#define _ASM_GICREGS_H 12#define _ASM_GICREGS_H
13 13
14#undef GICISBYTELITTLEENDIAN 14#undef GICISBYTELITTLEENDIAN
15#define GICISWORDLITTLEENDIAN
16 15
17/* Constants */ 16/* Constants */
18#define GIC_POL_POS 1 17#define GIC_POL_POS 1
@@ -20,11 +19,7 @@
20#define GIC_TRIG_EDGE 1 19#define GIC_TRIG_EDGE 1
21#define GIC_TRIG_LEVEL 0 20#define GIC_TRIG_LEVEL 0
22 21
23#ifdef CONFIG_SMP
24#define GIC_NUM_INTRS (24 + NR_CPUS * 2) 22#define GIC_NUM_INTRS (24 + NR_CPUS * 2)
25#else
26#define GIC_NUM_INTRS 32
27#endif
28 23
29#define MSK(n) ((1 << (n)) - 1) 24#define MSK(n) ((1 << (n)) - 1)
30#define REG32(addr) (*(volatile unsigned int *) (addr)) 25#define REG32(addr) (*(volatile unsigned int *) (addr))
@@ -70,13 +65,13 @@
70#define USM_VISIBLE_SECTION_SIZE 0x10000 65#define USM_VISIBLE_SECTION_SIZE 0x10000
71 66
72/* Register Map for Shared Section */ 67/* Register Map for Shared Section */
73#if defined(CONFIG_CPU_LITTLE_ENDIAN) || defined(GICISWORDLITTLEENDIAN)
74 68
75#define GIC_SH_CONFIG_OFS 0x0000 69#define GIC_SH_CONFIG_OFS 0x0000
76 70
77/* Shared Global Counter */ 71/* Shared Global Counter */
78#define GIC_SH_COUNTER_31_00_OFS 0x0010 72#define GIC_SH_COUNTER_31_00_OFS 0x0010
79#define GIC_SH_COUNTER_63_32_OFS 0x0014 73#define GIC_SH_COUNTER_63_32_OFS 0x0014
74#define GIC_SH_REVISIONID_OFS 0x0020
80 75
81/* Interrupt Polarity */ 76/* Interrupt Polarity */
82#define GIC_SH_POL_31_0_OFS 0x0100 77#define GIC_SH_POL_31_0_OFS 0x0100
@@ -164,24 +159,31 @@
164 (GIC_SH_INTR_MAP_TO_VPE_BASE_OFS + (32 * (intr)) + (((vpe) / 32) * 4)) 159 (GIC_SH_INTR_MAP_TO_VPE_BASE_OFS + (32 * (intr)) + (((vpe) / 32) * 4))
165#define GIC_SH_MAP_TO_VPE_REG_BIT(vpe) (1 << ((vpe) % 32)) 160#define GIC_SH_MAP_TO_VPE_REG_BIT(vpe) (1 << ((vpe) % 32))
166 161
162/* Convert an interrupt number to a byte offset/bit for multi-word registers */
163#define GIC_INTR_OFS(intr) (((intr) / 32)*4)
164#define GIC_INTR_BIT(intr) ((intr) % 32)
165
167/* Polarity : Reset Value is always 0 */ 166/* Polarity : Reset Value is always 0 */
168#define GIC_SH_SET_POLARITY_OFS 0x0100 167#define GIC_SH_SET_POLARITY_OFS 0x0100
169#define GIC_SET_POLARITY(intr, pol) \ 168#define GIC_SET_POLARITY(intr, pol) \
170 GICBIS(GIC_REG_ADDR(SHARED, GIC_SH_SET_POLARITY_OFS + (((intr) / 32) * 4)), (pol) << ((intr) % 32)) 169 GICBIS(GIC_REG_ADDR(SHARED, GIC_SH_SET_POLARITY_OFS + \
170 GIC_INTR_OFS(intr)), (pol) << GIC_INTR_BIT(intr))
171 171
172/* Triggering : Reset Value is always 0 */ 172/* Triggering : Reset Value is always 0 */
173#define GIC_SH_SET_TRIGGER_OFS 0x0180 173#define GIC_SH_SET_TRIGGER_OFS 0x0180
174#define GIC_SET_TRIGGER(intr, trig) \ 174#define GIC_SET_TRIGGER(intr, trig) \
175 GICBIS(GIC_REG_ADDR(SHARED, GIC_SH_SET_TRIGGER_OFS + (((intr) / 32) * 4)), (trig) << ((intr) % 32)) 175 GICBIS(GIC_REG_ADDR(SHARED, GIC_SH_SET_TRIGGER_OFS + \
176 GIC_INTR_OFS(intr)), (trig) << GIC_INTR_BIT(intr))
176 177
177/* Mask manipulation */ 178/* Mask manipulation */
178#define GIC_SH_SMASK_OFS 0x0380 179#define GIC_SH_SMASK_OFS 0x0380
179#define GIC_SET_INTR_MASK(intr, val) \ 180#define GIC_SET_INTR_MASK(intr) \
180 GICWRITE(GIC_REG_ADDR(SHARED, GIC_SH_SMASK_OFS + (((intr) / 32) * 4)), ((val) << ((intr) % 32))) 181 GICWRITE(GIC_REG_ADDR(SHARED, GIC_SH_SMASK_OFS + \
181 182 GIC_INTR_OFS(intr)), 1 << GIC_INTR_BIT(intr))
182#define GIC_SH_RMASK_OFS 0x0300 183#define GIC_SH_RMASK_OFS 0x0300
183#define GIC_CLR_INTR_MASK(intr, val) \ 184#define GIC_CLR_INTR_MASK(intr) \
184 GICWRITE(GIC_REG_ADDR(SHARED, GIC_SH_RMASK_OFS + (((intr) / 32) * 4)), ((val) << ((intr) % 32))) 185 GICWRITE(GIC_REG_ADDR(SHARED, GIC_SH_RMASK_OFS + \
186 GIC_INTR_OFS(intr)), 1 << GIC_INTR_BIT(intr))
185 187
186/* Register Map for Local Section */ 188/* Register Map for Local Section */
187#define GIC_VPE_CTL_OFS 0x0000 189#define GIC_VPE_CTL_OFS 0x0000
@@ -219,161 +221,6 @@
219#define GIC_UMV_SH_COUNTER_31_00_OFS 0x0000 221#define GIC_UMV_SH_COUNTER_31_00_OFS 0x0000
220#define GIC_UMV_SH_COUNTER_63_32_OFS 0x0004 222#define GIC_UMV_SH_COUNTER_63_32_OFS 0x0004
221 223
222#else /* CONFIG_CPU_BIG_ENDIAN */
223
224#define GIC_SH_CONFIG_OFS 0x0000
225
226/* Shared Global Counter */
227#define GIC_SH_COUNTER_31_00_OFS 0x0014
228#define GIC_SH_COUNTER_63_32_OFS 0x0010
229
230/* Interrupt Polarity */
231#define GIC_SH_POL_31_0_OFS 0x0104
232#define GIC_SH_POL_63_32_OFS 0x0100
233#define GIC_SH_POL_95_64_OFS 0x010c
234#define GIC_SH_POL_127_96_OFS 0x0108
235#define GIC_SH_POL_159_128_OFS 0x0114
236#define GIC_SH_POL_191_160_OFS 0x0110
237#define GIC_SH_POL_223_192_OFS 0x011c
238#define GIC_SH_POL_255_224_OFS 0x0118
239
240/* Edge/Level Triggering */
241#define GIC_SH_TRIG_31_0_OFS 0x0184
242#define GIC_SH_TRIG_63_32_OFS 0x0180
243#define GIC_SH_TRIG_95_64_OFS 0x018c
244#define GIC_SH_TRIG_127_96_OFS 0x0188
245#define GIC_SH_TRIG_159_128_OFS 0x0194
246#define GIC_SH_TRIG_191_160_OFS 0x0190
247#define GIC_SH_TRIG_223_192_OFS 0x019c
248#define GIC_SH_TRIG_255_224_OFS 0x0198
249
250/* Dual Edge Triggering */
251#define GIC_SH_DUAL_31_0_OFS 0x0204
252#define GIC_SH_DUAL_63_32_OFS 0x0200
253#define GIC_SH_DUAL_95_64_OFS 0x020c
254#define GIC_SH_DUAL_127_96_OFS 0x0208
255#define GIC_SH_DUAL_159_128_OFS 0x0214
256#define GIC_SH_DUAL_191_160_OFS 0x0210
257#define GIC_SH_DUAL_223_192_OFS 0x021c
258#define GIC_SH_DUAL_255_224_OFS 0x0218
259
260/* Set/Clear corresponding bit in Edge Detect Register */
261#define GIC_SH_WEDGE_OFS 0x0280
262
263/* Reset Mask - Disables Interrupt */
264#define GIC_SH_RMASK_31_0_OFS 0x0304
265#define GIC_SH_RMASK_63_32_OFS 0x0300
266#define GIC_SH_RMASK_95_64_OFS 0x030c
267#define GIC_SH_RMASK_127_96_OFS 0x0308
268#define GIC_SH_RMASK_159_128_OFS 0x0314
269#define GIC_SH_RMASK_191_160_OFS 0x0310
270#define GIC_SH_RMASK_223_192_OFS 0x031c
271#define GIC_SH_RMASK_255_224_OFS 0x0318
272
273/* Set Mask (WO) - Enables Interrupt */
274#define GIC_SH_SMASK_31_0_OFS 0x0384
275#define GIC_SH_SMASK_63_32_OFS 0x0380
276#define GIC_SH_SMASK_95_64_OFS 0x038c
277#define GIC_SH_SMASK_127_96_OFS 0x0388
278#define GIC_SH_SMASK_159_128_OFS 0x0394
279#define GIC_SH_SMASK_191_160_OFS 0x0390
280#define GIC_SH_SMASK_223_192_OFS 0x039c
281#define GIC_SH_SMASK_255_224_OFS 0x0398
282
283/* Global Interrupt Mask Register (RO) - Bit Set == Interrupt enabled */
284#define GIC_SH_MASK_31_0_OFS 0x0404
285#define GIC_SH_MASK_63_32_OFS 0x0400
286#define GIC_SH_MASK_95_64_OFS 0x040c
287#define GIC_SH_MASK_127_96_OFS 0x0408
288#define GIC_SH_MASK_159_128_OFS 0x0414
289#define GIC_SH_MASK_191_160_OFS 0x0410
290#define GIC_SH_MASK_223_192_OFS 0x041c
291#define GIC_SH_MASK_255_224_OFS 0x0418
292
293/* Pending Global Interrupts (RO) */
294#define GIC_SH_PEND_31_0_OFS 0x0484
295#define GIC_SH_PEND_63_32_OFS 0x0480
296#define GIC_SH_PEND_95_64_OFS 0x048c
297#define GIC_SH_PEND_127_96_OFS 0x0488
298#define GIC_SH_PEND_159_128_OFS 0x0494
299#define GIC_SH_PEND_191_160_OFS 0x0490
300#define GIC_SH_PEND_223_192_OFS 0x049c
301#define GIC_SH_PEND_255_224_OFS 0x0498
302
303#define GIC_SH_INTR_MAP_TO_PIN_BASE_OFS 0x0500
304
305/* Maps Interrupt X to a Pin */
306#define GIC_SH_MAP_TO_PIN(intr) \
307 (GIC_SH_INTR_MAP_TO_PIN_BASE_OFS + (4 * intr))
308
309#define GIC_SH_INTR_MAP_TO_VPE_BASE_OFS 0x2004
310
311/*
312 * Maps Interrupt X to a VPE. This is more complex than the LE case, as
313 * odd and even registers need to be transposed. It does work - trust me!
314 */
315#define GIC_SH_MAP_TO_VPE_REG_OFF(intr, vpe) \
316 (GIC_SH_INTR_MAP_TO_VPE_BASE_OFS + (32 * (intr)) + \
317 (((((vpe) / 32) ^ 1) - 1) * 4))
318#define GIC_SH_MAP_TO_VPE_REG_BIT(vpe) (1 << ((vpe) % 32))
319
320/* Polarity */
321#define GIC_SH_SET_POLARITY_OFS 0x0100
322#define GIC_SET_POLARITY(intr, pol) \
323 GICBIS(GIC_REG_ADDR(SHARED, GIC_SH_SET_POLARITY_OFS + 4 + (((((intr) / 32) ^ 1) - 1) * 4)), (pol) << ((intr) % 32))
324
325/* Triggering */
326#define GIC_SH_SET_TRIGGER_OFS 0x0180
327#define GIC_SET_TRIGGER(intr, trig) \
328 GICBIS(GIC_REG_ADDR(SHARED, GIC_SH_SET_TRIGGER_OFS + 4 + (((((intr) / 32) ^ 1) - 1) * 4)), (trig) << ((intr) % 32))
329
330/* Mask manipulation */
331#define GIC_SH_SMASK_OFS 0x0380
332#define GIC_SET_INTR_MASK(intr, val) \
333 GICWRITE(GIC_REG_ADDR(SHARED, GIC_SH_SMASK_OFS + 4 + (((((intr) / 32) ^ 1) - 1) * 4)), ((val) << ((intr) % 32)))
334
335#define GIC_SH_RMASK_OFS 0x0300
336#define GIC_CLR_INTR_MASK(intr, val) \
337 GICWRITE(GIC_REG_ADDR(SHARED, GIC_SH_RMASK_OFS + 4 + (((((intr) / 32) ^ 1) - 1) * 4)), ((val) << ((intr) % 32)))
338
339/* Register Map for Local Section */
340#define GIC_VPE_CTL_OFS 0x0000
341#define GIC_VPE_PEND_OFS 0x0004
342#define GIC_VPE_MASK_OFS 0x0008
343#define GIC_VPE_RMASK_OFS 0x000c
344#define GIC_VPE_SMASK_OFS 0x0010
345#define GIC_VPE_WD_MAP_OFS 0x0040
346#define GIC_VPE_COMPARE_MAP_OFS 0x0044
347#define GIC_VPE_TIMER_MAP_OFS 0x0048
348#define GIC_VPE_PERFCTR_MAP_OFS 0x0050
349#define GIC_VPE_SWINT0_MAP_OFS 0x0054
350#define GIC_VPE_SWINT1_MAP_OFS 0x0058
351#define GIC_VPE_OTHER_ADDR_OFS 0x0080
352#define GIC_VPE_WD_CONFIG0_OFS 0x0090
353#define GIC_VPE_WD_COUNT0_OFS 0x0094
354#define GIC_VPE_WD_INITIAL0_OFS 0x0098
355#define GIC_VPE_COMPARE_LO_OFS 0x00a4
356#define GIC_VPE_COMPARE_HI_OFS 0x00a0
357
358#define GIC_VPE_EIC_SHADOW_SET_BASE 0x0100
359#define GIC_VPE_EIC_SS(intr) \
360 (GIC_EIC_SHADOW_SET_BASE + (4 * intr))
361
362#define GIC_VPE_EIC_VEC_BASE 0x0800
363#define GIC_VPE_EIC_VEC(intr) \
364 (GIC_VPE_EIC_VEC_BASE + (4 * intr))
365
366#define GIC_VPE_TENABLE_NMI_OFS 0x1000
367#define GIC_VPE_TENABLE_YQ_OFS 0x1004
368#define GIC_VPE_TENABLE_INT_31_0_OFS 0x1080
369#define GIC_VPE_TENABLE_INT_63_32_OFS 0x1084
370
371/* User Mode Visible Section Register Map */
372#define GIC_UMV_SH_COUNTER_31_00_OFS 0x0004
373#define GIC_UMV_SH_COUNTER_63_32_OFS 0x0000
374
375#endif /* !LE */
376
377/* Masks */ 224/* Masks */
378#define GIC_SH_CONFIG_COUNTSTOP_SHF 28 225#define GIC_SH_CONFIG_COUNTSTOP_SHF 28
379#define GIC_SH_CONFIG_COUNTSTOP_MSK (MSK(1) << GIC_SH_CONFIG_COUNTSTOP_SHF) 226#define GIC_SH_CONFIG_COUNTSTOP_MSK (MSK(1) << GIC_SH_CONFIG_COUNTSTOP_SHF)
@@ -473,12 +320,13 @@ struct gic_intrmask_regs {
473 * in building ipi_map. 320 * in building ipi_map.
474 */ 321 */
475struct gic_intr_map { 322struct gic_intr_map {
476 unsigned int intrnum; /* Ext Intr Num */
477 unsigned int cpunum; /* Directed to this CPU */ 323 unsigned int cpunum; /* Directed to this CPU */
478 unsigned int pin; /* Directed to this Pin */ 324 unsigned int pin; /* Directed to this Pin */
479 unsigned int polarity; /* Polarity : +/- */ 325 unsigned int polarity; /* Polarity : +/- */
480 unsigned int trigtype; /* Trigger : Edge/Levl */ 326 unsigned int trigtype; /* Trigger : Edge/Levl */
481 unsigned int ipiflag; /* Is used for IPI ? */ 327 unsigned int flags; /* Misc flags */
328#define GIC_FLAG_IPI 0x01
329#define GIC_FLAG_TRANSPARENT 0x02
482}; 330};
483 331
484extern void gic_init(unsigned long gic_base_addr, 332extern void gic_init(unsigned long gic_base_addr,
diff --git a/arch/mips/include/asm/mach-ar7/ar7.h b/arch/mips/include/asm/mach-ar7/ar7.h
index de71694614de..21cbbc706448 100644
--- a/arch/mips/include/asm/mach-ar7/ar7.h
+++ b/arch/mips/include/asm/mach-ar7/ar7.h
@@ -78,6 +78,9 @@
78#define AR7_REF_CLOCK 25000000 78#define AR7_REF_CLOCK 25000000
79#define AR7_XTAL_CLOCK 24000000 79#define AR7_XTAL_CLOCK 24000000
80 80
81/* DCL */
82#define AR7_WDT_HW_ENA 0x10
83
81struct plat_cpmac_data { 84struct plat_cpmac_data {
82 int reset_bit; 85 int reset_bit;
83 int power_bit; 86 int power_bit;
diff --git a/arch/mips/include/asm/mach-au1x00/gpio-au1000.h b/arch/mips/include/asm/mach-au1x00/gpio-au1000.h
index feea00148b5d..91595fa89034 100644
--- a/arch/mips/include/asm/mach-au1x00/gpio-au1000.h
+++ b/arch/mips/include/asm/mach-au1x00/gpio-au1000.h
@@ -104,6 +104,8 @@ static inline int au1100_gpio2_to_irq(int gpio)
104 104
105 if ((gpio >= 8) && (gpio <= 15)) 105 if ((gpio >= 8) && (gpio <= 15))
106 return MAKE_IRQ(0, 29); /* shared GPIO208_215 */ 106 return MAKE_IRQ(0, 29); /* shared GPIO208_215 */
107
108 return -ENXIO;
107} 109}
108 110
109#ifdef CONFIG_SOC_AU1100 111#ifdef CONFIG_SOC_AU1100
diff --git a/arch/mips/include/asm/mach-bcm63xx/bcm63xx_dev_uart.h b/arch/mips/include/asm/mach-bcm63xx/bcm63xx_dev_uart.h
deleted file mode 100644
index bf348f573bbc..000000000000
--- a/arch/mips/include/asm/mach-bcm63xx/bcm63xx_dev_uart.h
+++ /dev/null
@@ -1,6 +0,0 @@
1#ifndef BCM63XX_DEV_UART_H_
2#define BCM63XX_DEV_UART_H_
3
4int bcm63xx_uart_register(void);
5
6#endif /* BCM63XX_DEV_UART_H_ */
diff --git a/arch/mips/include/asm/mach-ip27/topology.h b/arch/mips/include/asm/mach-ip27/topology.h
index f6837422fe65..09a59bcc1b07 100644
--- a/arch/mips/include/asm/mach-ip27/topology.h
+++ b/arch/mips/include/asm/mach-ip27/topology.h
@@ -44,8 +44,8 @@ extern unsigned char __node_distances[MAX_COMPACT_NODES][MAX_COMPACT_NODES];
44 .busy_factor = 32, \ 44 .busy_factor = 32, \
45 .imbalance_pct = 125, \ 45 .imbalance_pct = 125, \
46 .cache_nice_tries = 1, \ 46 .cache_nice_tries = 1, \
47 .flags = SD_LOAD_BALANCE \ 47 .flags = SD_LOAD_BALANCE | \
48 | SD_BALANCE_EXEC \ 48 SD_BALANCE_EXEC, \
49 .last_balance = jiffies, \ 49 .last_balance = jiffies, \
50 .balance_interval = 1, \ 50 .balance_interval = 1, \
51 .nr_balance_failed = 0, \ 51 .nr_balance_failed = 0, \
diff --git a/arch/mips/include/asm/mach-loongson/cpu-feature-overrides.h b/arch/mips/include/asm/mach-loongson/cpu-feature-overrides.h
index ce5b6e270e3f..9947e57c91de 100644
--- a/arch/mips/include/asm/mach-loongson/cpu-feature-overrides.h
+++ b/arch/mips/include/asm/mach-loongson/cpu-feature-overrides.h
@@ -29,7 +29,7 @@
29#define cpu_has_cache_cdex_p 0 29#define cpu_has_cache_cdex_p 0
30#define cpu_has_cache_cdex_s 0 30#define cpu_has_cache_cdex_s 0
31#define cpu_has_counter 1 31#define cpu_has_counter 1
32#define cpu_has_dc_aliases 1 32#define cpu_has_dc_aliases (PAGE_SIZE < 0x4000)
33#define cpu_has_divec 0 33#define cpu_has_divec 0
34#define cpu_has_dsp 0 34#define cpu_has_dsp 0
35#define cpu_has_ejtag 0 35#define cpu_has_ejtag 0
@@ -54,6 +54,5 @@
54#define cpu_has_vce 0 54#define cpu_has_vce 0
55#define cpu_has_vtag_icache 0 55#define cpu_has_vtag_icache 0
56#define cpu_has_watch 1 56#define cpu_has_watch 1
57#define cpu_icache_snoops_remote_store 1
58 57
59#endif /* __ASM_MACH_LOONGSON_CPU_FEATURE_OVERRIDES_H */ 58#endif /* __ASM_MACH_LOONGSON_CPU_FEATURE_OVERRIDES_H */
diff --git a/arch/mips/include/asm/mman.h b/arch/mips/include/asm/mman.h
index a2250f390a29..c892bfb3e2c1 100644
--- a/arch/mips/include/asm/mman.h
+++ b/arch/mips/include/asm/mman.h
@@ -75,6 +75,7 @@
75 75
76#define MADV_MERGEABLE 12 /* KSM may merge identical pages */ 76#define MADV_MERGEABLE 12 /* KSM may merge identical pages */
77#define MADV_UNMERGEABLE 13 /* KSM may not merge identical pages */ 77#define MADV_UNMERGEABLE 13 /* KSM may not merge identical pages */
78#define MADV_HWPOISON 100 /* poison a page for testing */
78 79
79/* compatibility flags */ 80/* compatibility flags */
80#define MAP_FILE 0 81#define MAP_FILE 0
diff --git a/arch/mips/include/asm/mmu_context.h b/arch/mips/include/asm/mmu_context.h
index d9743536a621..6083db586500 100644
--- a/arch/mips/include/asm/mmu_context.h
+++ b/arch/mips/include/asm/mmu_context.h
@@ -16,6 +16,7 @@
16#include <linux/smp.h> 16#include <linux/smp.h>
17#include <linux/slab.h> 17#include <linux/slab.h>
18#include <asm/cacheflush.h> 18#include <asm/cacheflush.h>
19#include <asm/hazards.h>
19#include <asm/tlbflush.h> 20#include <asm/tlbflush.h>
20#ifdef CONFIG_MIPS_MT_SMTC 21#ifdef CONFIG_MIPS_MT_SMTC
21#include <asm/mipsmtregs.h> 22#include <asm/mipsmtregs.h>
@@ -36,11 +37,13 @@ extern unsigned long pgd_current[];
36#ifdef CONFIG_32BIT 37#ifdef CONFIG_32BIT
37#define TLBMISS_HANDLER_SETUP() \ 38#define TLBMISS_HANDLER_SETUP() \
38 write_c0_context((unsigned long) smp_processor_id() << 25); \ 39 write_c0_context((unsigned long) smp_processor_id() << 25); \
40 back_to_back_c0_hazard(); \
39 TLBMISS_HANDLER_SETUP_PGD(swapper_pg_dir) 41 TLBMISS_HANDLER_SETUP_PGD(swapper_pg_dir)
40#endif 42#endif
41#ifdef CONFIG_64BIT 43#ifdef CONFIG_64BIT
42#define TLBMISS_HANDLER_SETUP() \ 44#define TLBMISS_HANDLER_SETUP() \
43 write_c0_context((unsigned long) smp_processor_id() << 26); \ 45 write_c0_context((unsigned long) smp_processor_id() << 26); \
46 back_to_back_c0_hazard(); \
44 TLBMISS_HANDLER_SETUP_PGD(swapper_pg_dir) 47 TLBMISS_HANDLER_SETUP_PGD(swapper_pg_dir)
45#endif 48#endif
46 49
@@ -165,12 +168,12 @@ static inline void switch_mm(struct mm_struct *prev, struct mm_struct *next,
165 * having ASID_MASK smaller than the hardware maximum, 168 * having ASID_MASK smaller than the hardware maximum,
166 * make sure no "soft" bits become "hard"... 169 * make sure no "soft" bits become "hard"...
167 */ 170 */
168 write_c0_entryhi((read_c0_entryhi() & ~HW_ASID_MASK) 171 write_c0_entryhi((read_c0_entryhi() & ~HW_ASID_MASK) |
169 | (cpu_context(cpu, next) & ASID_MASK)); 172 cpu_asid(cpu, next));
170 ehb(); /* Make sure it propagates to TCStatus */ 173 ehb(); /* Make sure it propagates to TCStatus */
171 evpe(mtflags); 174 evpe(mtflags);
172#else 175#else
173 write_c0_entryhi(cpu_context(cpu, next)); 176 write_c0_entryhi(cpu_asid(cpu, next));
174#endif /* CONFIG_MIPS_MT_SMTC */ 177#endif /* CONFIG_MIPS_MT_SMTC */
175 TLBMISS_HANDLER_SETUP_PGD(next->pgd); 178 TLBMISS_HANDLER_SETUP_PGD(next->pgd);
176 179
@@ -226,11 +229,11 @@ activate_mm(struct mm_struct *prev, struct mm_struct *next)
226 } 229 }
227 /* See comments for similar code above */ 230 /* See comments for similar code above */
228 write_c0_entryhi((read_c0_entryhi() & ~HW_ASID_MASK) | 231 write_c0_entryhi((read_c0_entryhi() & ~HW_ASID_MASK) |
229 (cpu_context(cpu, next) & ASID_MASK)); 232 cpu_asid(cpu, next));
230 ehb(); /* Make sure it propagates to TCStatus */ 233 ehb(); /* Make sure it propagates to TCStatus */
231 evpe(mtflags); 234 evpe(mtflags);
232#else 235#else
233 write_c0_entryhi(cpu_context(cpu, next)); 236 write_c0_entryhi(cpu_asid(cpu, next));
234#endif /* CONFIG_MIPS_MT_SMTC */ 237#endif /* CONFIG_MIPS_MT_SMTC */
235 TLBMISS_HANDLER_SETUP_PGD(next->pgd); 238 TLBMISS_HANDLER_SETUP_PGD(next->pgd);
236 239
diff --git a/arch/mips/include/asm/setup.h b/arch/mips/include/asm/setup.h
index e600cedda976..50511aac04e9 100644
--- a/arch/mips/include/asm/setup.h
+++ b/arch/mips/include/asm/setup.h
@@ -1,7 +1,7 @@
1#ifndef _MIPS_SETUP_H 1#ifndef _MIPS_SETUP_H
2#define _MIPS_SETUP_H 2#define _MIPS_SETUP_H
3 3
4#define COMMAND_LINE_SIZE 256 4#define COMMAND_LINE_SIZE 4096
5 5
6#ifdef __KERNEL__ 6#ifdef __KERNEL__
7extern void setup_early_printk(void); 7extern void setup_early_printk(void);
diff --git a/arch/mips/include/asm/smtc_ipi.h b/arch/mips/include/asm/smtc_ipi.h
index 8ce517574340..15278dbd7e79 100644
--- a/arch/mips/include/asm/smtc_ipi.h
+++ b/arch/mips/include/asm/smtc_ipi.h
@@ -45,6 +45,7 @@ struct smtc_ipi_q {
45 spinlock_t lock; 45 spinlock_t lock;
46 struct smtc_ipi *tail; 46 struct smtc_ipi *tail;
47 int depth; 47 int depth;
48 int resched_flag; /* reschedule already queued */
48}; 49};
49 50
50static inline void smtc_ipi_nq(struct smtc_ipi_q *q, struct smtc_ipi *p) 51static inline void smtc_ipi_nq(struct smtc_ipi_q *q, struct smtc_ipi *p)
diff --git a/arch/mips/include/asm/spram.h b/arch/mips/include/asm/spram.h
new file mode 100644
index 000000000000..0b89006e4907
--- /dev/null
+++ b/arch/mips/include/asm/spram.h
@@ -0,0 +1,10 @@
1#ifndef _MIPS_SPRAM_H
2#define _MIPS_SPRAM_H
3
4#ifdef CONFIG_CPU_MIPSR2
5extern __init void spram_config(void);
6#else
7static inline void spram_config(void) { };
8#endif /* CONFIG_CPU_MIPSR2 */
9
10#endif /* _MIPS_SPRAM_H */
diff --git a/arch/mips/include/asm/system.h b/arch/mips/include/asm/system.h
index fcf5f98d90cc..83b5509e09e8 100644
--- a/arch/mips/include/asm/system.h
+++ b/arch/mips/include/asm/system.h
@@ -12,6 +12,7 @@
12#ifndef _ASM_SYSTEM_H 12#ifndef _ASM_SYSTEM_H
13#define _ASM_SYSTEM_H 13#define _ASM_SYSTEM_H
14 14
15#include <linux/kernel.h>
15#include <linux/types.h> 16#include <linux/types.h>
16#include <linux/irqflags.h> 17#include <linux/irqflags.h>
17 18
@@ -193,10 +194,6 @@ extern __u64 __xchg_u64_unsupported_on_32bit_kernels(volatile __u64 * m, __u64 v
193#define __xchg_u64 __xchg_u64_unsupported_on_32bit_kernels 194#define __xchg_u64 __xchg_u64_unsupported_on_32bit_kernels
194#endif 195#endif
195 196
196/* This function doesn't exist, so you'll get a linker error
197 if something tries to do an invalid xchg(). */
198extern void __xchg_called_with_bad_pointer(void);
199
200static inline unsigned long __xchg(unsigned long x, volatile void * ptr, int size) 197static inline unsigned long __xchg(unsigned long x, volatile void * ptr, int size)
201{ 198{
202 switch (size) { 199 switch (size) {
@@ -205,11 +202,17 @@ static inline unsigned long __xchg(unsigned long x, volatile void * ptr, int siz
205 case 8: 202 case 8:
206 return __xchg_u64(ptr, x); 203 return __xchg_u64(ptr, x);
207 } 204 }
208 __xchg_called_with_bad_pointer(); 205
209 return x; 206 return x;
210} 207}
211 208
212#define xchg(ptr, x) ((__typeof__(*(ptr)))__xchg((unsigned long)(x), (ptr), sizeof(*(ptr)))) 209#define xchg(ptr, x) \
210({ \
211 BUILD_BUG_ON(sizeof(*(ptr)) & ~0xc); \
212 \
213 ((__typeof__(*(ptr))) \
214 __xchg((unsigned long)(x), (ptr), sizeof(*(ptr)))); \
215})
213 216
214extern void set_handler(unsigned long offset, void *addr, unsigned long len); 217extern void set_handler(unsigned long offset, void *addr, unsigned long len);
215extern void set_uncached_handler(unsigned long offset, void *addr, unsigned long len); 218extern void set_uncached_handler(unsigned long offset, void *addr, unsigned long len);
diff --git a/arch/mips/include/asm/thread_info.h b/arch/mips/include/asm/thread_info.h
index 01cc1630b66c..845da2107ed1 100644
--- a/arch/mips/include/asm/thread_info.h
+++ b/arch/mips/include/asm/thread_info.h
@@ -86,14 +86,7 @@ register struct thread_info *__current_thread_info __asm__("$28");
86#define __HAVE_ARCH_THREAD_INFO_ALLOCATOR 86#define __HAVE_ARCH_THREAD_INFO_ALLOCATOR
87 87
88#ifdef CONFIG_DEBUG_STACK_USAGE 88#ifdef CONFIG_DEBUG_STACK_USAGE
89#define alloc_thread_info(tsk) \ 89#define alloc_thread_info(tsk) kzalloc(THREAD_SIZE, GFP_KERNEL)
90({ \
91 struct thread_info *ret; \
92 \
93 ret = kzalloc(THREAD_SIZE, GFP_KERNEL); \
94 \
95 ret; \
96})
97#else 90#else
98#define alloc_thread_info(tsk) kmalloc(THREAD_SIZE, GFP_KERNEL) 91#define alloc_thread_info(tsk) kmalloc(THREAD_SIZE, GFP_KERNEL)
99#endif 92#endif
diff --git a/arch/mips/jazz/irq.c b/arch/mips/jazz/irq.c
index 7fd170d007e7..7bd32d04c2cc 100644
--- a/arch/mips/jazz/irq.c
+++ b/arch/mips/jazz/irq.c
@@ -134,7 +134,7 @@ static irqreturn_t r4030_timer_interrupt(int irq, void *dev_id)
134 134
135static struct irqaction r4030_timer_irqaction = { 135static struct irqaction r4030_timer_irqaction = {
136 .handler = r4030_timer_interrupt, 136 .handler = r4030_timer_interrupt,
137 .flags = IRQF_DISABLED, 137 .flags = IRQF_DISABLED | IRQF_TIMER,
138 .name = "R4030 timer", 138 .name = "R4030 timer",
139}; 139};
140 140
diff --git a/arch/mips/kernel/cevt-bcm1480.c b/arch/mips/kernel/cevt-bcm1480.c
index e02f79b1eb51..bfea327c636c 100644
--- a/arch/mips/kernel/cevt-bcm1480.c
+++ b/arch/mips/kernel/cevt-bcm1480.c
@@ -144,7 +144,7 @@ void __cpuinit sb1480_clockevent_init(void)
144 bcm1480_unmask_irq(cpu, irq); 144 bcm1480_unmask_irq(cpu, irq);
145 145
146 action->handler = sibyte_counter_handler; 146 action->handler = sibyte_counter_handler;
147 action->flags = IRQF_DISABLED | IRQF_PERCPU; 147 action->flags = IRQF_DISABLED | IRQF_PERCPU | IRQF_TIMER;
148 action->name = name; 148 action->name = name;
149 action->dev_id = cd; 149 action->dev_id = cd;
150 150
diff --git a/arch/mips/kernel/cevt-ds1287.c b/arch/mips/kernel/cevt-ds1287.c
index 6996da4d74a2..00a4da277cbb 100644
--- a/arch/mips/kernel/cevt-ds1287.c
+++ b/arch/mips/kernel/cevt-ds1287.c
@@ -107,7 +107,7 @@ static irqreturn_t ds1287_interrupt(int irq, void *dev_id)
107 107
108static struct irqaction ds1287_irqaction = { 108static struct irqaction ds1287_irqaction = {
109 .handler = ds1287_interrupt, 109 .handler = ds1287_interrupt,
110 .flags = IRQF_DISABLED | IRQF_PERCPU, 110 .flags = IRQF_DISABLED | IRQF_PERCPU | IRQF_TIMER,
111 .name = "ds1287", 111 .name = "ds1287",
112}; 112};
113 113
diff --git a/arch/mips/kernel/cevt-gt641xx.c b/arch/mips/kernel/cevt-gt641xx.c
index 92351e00ae0e..f5d265eb6eae 100644
--- a/arch/mips/kernel/cevt-gt641xx.c
+++ b/arch/mips/kernel/cevt-gt641xx.c
@@ -113,7 +113,7 @@ static irqreturn_t gt641xx_timer0_interrupt(int irq, void *dev_id)
113 113
114static struct irqaction gt641xx_timer0_irqaction = { 114static struct irqaction gt641xx_timer0_irqaction = {
115 .handler = gt641xx_timer0_interrupt, 115 .handler = gt641xx_timer0_interrupt,
116 .flags = IRQF_DISABLED | IRQF_PERCPU, 116 .flags = IRQF_DISABLED | IRQF_PERCPU | IRQF_TIMER,
117 .name = "gt641xx_timer0", 117 .name = "gt641xx_timer0",
118}; 118};
119 119
diff --git a/arch/mips/kernel/cevt-r4k.c b/arch/mips/kernel/cevt-r4k.c
index 2652362ce047..b469ad05d520 100644
--- a/arch/mips/kernel/cevt-r4k.c
+++ b/arch/mips/kernel/cevt-r4k.c
@@ -83,7 +83,7 @@ out:
83 83
84struct irqaction c0_compare_irqaction = { 84struct irqaction c0_compare_irqaction = {
85 .handler = c0_compare_interrupt, 85 .handler = c0_compare_interrupt,
86 .flags = IRQF_DISABLED | IRQF_PERCPU, 86 .flags = IRQF_DISABLED | IRQF_PERCPU | IRQF_TIMER,
87 .name = "timer", 87 .name = "timer",
88}; 88};
89 89
diff --git a/arch/mips/kernel/cevt-sb1250.c b/arch/mips/kernel/cevt-sb1250.c
index ac5903d1b20e..da78eeaea6e8 100644
--- a/arch/mips/kernel/cevt-sb1250.c
+++ b/arch/mips/kernel/cevt-sb1250.c
@@ -143,7 +143,7 @@ void __cpuinit sb1250_clockevent_init(void)
143 sb1250_unmask_irq(cpu, irq); 143 sb1250_unmask_irq(cpu, irq);
144 144
145 action->handler = sibyte_counter_handler; 145 action->handler = sibyte_counter_handler;
146 action->flags = IRQF_DISABLED | IRQF_PERCPU; 146 action->flags = IRQF_DISABLED | IRQF_PERCPU | IRQF_TIMER;
147 action->name = name; 147 action->name = name;
148 action->dev_id = cd; 148 action->dev_id = cd;
149 149
diff --git a/arch/mips/kernel/cevt-smtc.c b/arch/mips/kernel/cevt-smtc.c
index 98bd7de75778..b102e4f1630e 100644
--- a/arch/mips/kernel/cevt-smtc.c
+++ b/arch/mips/kernel/cevt-smtc.c
@@ -173,11 +173,12 @@ void smtc_distribute_timer(int vpe)
173 unsigned int mtflags; 173 unsigned int mtflags;
174 int cpu; 174 int cpu;
175 struct clock_event_device *cd; 175 struct clock_event_device *cd;
176 unsigned long nextstamp = 0L; 176 unsigned long nextstamp;
177 unsigned long reference; 177 unsigned long reference;
178 178
179 179
180repeat: 180repeat:
181 nextstamp = 0L;
181 for_each_online_cpu(cpu) { 182 for_each_online_cpu(cpu) {
182 /* 183 /*
183 * Find virtual CPUs within the current VPE who have 184 * Find virtual CPUs within the current VPE who have
diff --git a/arch/mips/kernel/cevt-txx9.c b/arch/mips/kernel/cevt-txx9.c
index 0037f21baf0d..218ee6bda935 100644
--- a/arch/mips/kernel/cevt-txx9.c
+++ b/arch/mips/kernel/cevt-txx9.c
@@ -146,7 +146,7 @@ static irqreturn_t txx9tmr_interrupt(int irq, void *dev_id)
146 146
147static struct irqaction txx9tmr_irq = { 147static struct irqaction txx9tmr_irq = {
148 .handler = txx9tmr_interrupt, 148 .handler = txx9tmr_interrupt,
149 .flags = IRQF_DISABLED | IRQF_PERCPU, 149 .flags = IRQF_DISABLED | IRQF_PERCPU | IRQF_TIMER,
150 .name = "txx9tmr", 150 .name = "txx9tmr",
151 .dev_id = &txx9_clock_event_device, 151 .dev_id = &txx9_clock_event_device,
152}; 152};
diff --git a/arch/mips/kernel/cpu-probe.c b/arch/mips/kernel/cpu-probe.c
index f709657e4dcd..7a51866068a4 100644
--- a/arch/mips/kernel/cpu-probe.c
+++ b/arch/mips/kernel/cpu-probe.c
@@ -23,7 +23,7 @@
23#include <asm/mipsregs.h> 23#include <asm/mipsregs.h>
24#include <asm/system.h> 24#include <asm/system.h>
25#include <asm/watch.h> 25#include <asm/watch.h>
26 26#include <asm/spram.h>
27/* 27/*
28 * Not all of the MIPS CPUs have the "wait" instruction available. Moreover, 28 * Not all of the MIPS CPUs have the "wait" instruction available. Moreover,
29 * the implementation of the "wait" feature differs between CPU families. This 29 * the implementation of the "wait" feature differs between CPU families. This
@@ -711,12 +711,6 @@ static void __cpuinit decode_configs(struct cpuinfo_mips *c)
711 mips_probe_watch_registers(c); 711 mips_probe_watch_registers(c);
712} 712}
713 713
714#ifdef CONFIG_CPU_MIPSR2
715extern void spram_config(void);
716#else
717static inline void spram_config(void) {}
718#endif
719
720static inline void cpu_probe_mips(struct cpuinfo_mips *c, unsigned int cpu) 714static inline void cpu_probe_mips(struct cpuinfo_mips *c, unsigned int cpu)
721{ 715{
722 decode_configs(c); 716 decode_configs(c);
diff --git a/arch/mips/kernel/head.S b/arch/mips/kernel/head.S
index 531ce7b16124..ea695d9605e9 100644
--- a/arch/mips/kernel/head.S
+++ b/arch/mips/kernel/head.S
@@ -191,6 +191,7 @@ NESTED(kernel_entry, 16, sp) # kernel entry point
191 /* Set the SP after an empty pt_regs. */ 191 /* Set the SP after an empty pt_regs. */
192 PTR_LI sp, _THREAD_SIZE - 32 - PT_SIZE 192 PTR_LI sp, _THREAD_SIZE - 32 - PT_SIZE
193 PTR_ADDU sp, $28 193 PTR_ADDU sp, $28
194 back_to_back_c0_hazard
194 set_saved_sp sp, t0, t1 195 set_saved_sp sp, t0, t1
195 PTR_SUBU sp, 4 * SZREG # init stack pointer 196 PTR_SUBU sp, 4 * SZREG # init stack pointer
196 197
diff --git a/arch/mips/kernel/i8253.c b/arch/mips/kernel/i8253.c
index f7d8d5d0ddbf..ed5c441615e4 100644
--- a/arch/mips/kernel/i8253.c
+++ b/arch/mips/kernel/i8253.c
@@ -98,7 +98,7 @@ static irqreturn_t timer_interrupt(int irq, void *dev_id)
98 98
99static struct irqaction irq0 = { 99static struct irqaction irq0 = {
100 .handler = timer_interrupt, 100 .handler = timer_interrupt,
101 .flags = IRQF_DISABLED | IRQF_NOBALANCING, 101 .flags = IRQF_DISABLED | IRQF_NOBALANCING | IRQF_TIMER,
102 .name = "timer" 102 .name = "timer"
103}; 103};
104 104
diff --git a/arch/mips/kernel/irq-gic.c b/arch/mips/kernel/irq-gic.c
index d2072cd38592..b181f2f0ea8e 100644
--- a/arch/mips/kernel/irq-gic.c
+++ b/arch/mips/kernel/irq-gic.c
@@ -14,38 +14,23 @@
14 14
15 15
16static unsigned long _gic_base; 16static unsigned long _gic_base;
17static unsigned int _irqbase, _mapsize, numvpes, numintrs; 17static unsigned int _irqbase;
18static struct gic_intr_map *_intrmap; 18static unsigned int gic_irq_flags[GIC_NUM_INTRS];
19#define GIC_IRQ_FLAG_EDGE 0x0001
19 20
20static struct gic_pcpu_mask pcpu_masks[NR_CPUS]; 21struct gic_pcpu_mask pcpu_masks[NR_CPUS];
21static struct gic_pending_regs pending_regs[NR_CPUS]; 22static struct gic_pending_regs pending_regs[NR_CPUS];
22static struct gic_intrmask_regs intrmask_regs[NR_CPUS]; 23static struct gic_intrmask_regs intrmask_regs[NR_CPUS];
23 24
24#define gic_wedgeb2bok 0 /*
25 * Can GIC handle b2b writes to wedge register?
26 */
27#if gic_wedgeb2bok == 0
28static DEFINE_SPINLOCK(gic_wedgeb2b_lock);
29#endif
30
31void gic_send_ipi(unsigned int intr) 25void gic_send_ipi(unsigned int intr)
32{ 26{
33#if gic_wedgeb2bok == 0
34 unsigned long flags;
35#endif
36 pr_debug("CPU%d: %s status %08x\n", smp_processor_id(), __func__, 27 pr_debug("CPU%d: %s status %08x\n", smp_processor_id(), __func__,
37 read_c0_status()); 28 read_c0_status());
38 if (!gic_wedgeb2bok)
39 spin_lock_irqsave(&gic_wedgeb2b_lock, flags);
40 GICWRITE(GIC_REG(SHARED, GIC_SH_WEDGE), 0x80000000 | intr); 29 GICWRITE(GIC_REG(SHARED, GIC_SH_WEDGE), 0x80000000 | intr);
41 if (!gic_wedgeb2bok) {
42 (void) GIC_REG(SHARED, GIC_SH_CONFIG);
43 spin_unlock_irqrestore(&gic_wedgeb2b_lock, flags);
44 }
45} 30}
46 31
47/* This is Malta specific and needs to be exported */ 32/* This is Malta specific and needs to be exported */
48static void vpe_local_setup(unsigned int numvpes) 33static void __init vpe_local_setup(unsigned int numvpes)
49{ 34{
50 int i; 35 int i;
51 unsigned long timer_interrupt = 5, perf_interrupt = 5; 36 unsigned long timer_interrupt = 5, perf_interrupt = 5;
@@ -105,44 +90,34 @@ unsigned int gic_get_int(void)
105 90
106static unsigned int gic_irq_startup(unsigned int irq) 91static unsigned int gic_irq_startup(unsigned int irq)
107{ 92{
108 pr_debug("CPU%d: %s: irq%d\n", smp_processor_id(), __func__, irq);
109 irq -= _irqbase; 93 irq -= _irqbase;
110 GIC_SET_INTR_MASK(irq, 1); 94 pr_debug("CPU%d: %s: irq%d\n", smp_processor_id(), __func__, irq);
95 GIC_SET_INTR_MASK(irq);
111 return 0; 96 return 0;
112} 97}
113 98
114static void gic_irq_ack(unsigned int irq) 99static void gic_irq_ack(unsigned int irq)
115{ 100{
116#if gic_wedgeb2bok == 0
117 unsigned long flags;
118#endif
119 pr_debug("CPU%d: %s: irq%d\n", smp_processor_id(), __func__, irq);
120 irq -= _irqbase; 101 irq -= _irqbase;
121 GIC_CLR_INTR_MASK(irq, 1); 102 pr_debug("CPU%d: %s: irq%d\n", smp_processor_id(), __func__, irq);
103 GIC_CLR_INTR_MASK(irq);
122 104
123 if (_intrmap[irq].trigtype == GIC_TRIG_EDGE) { 105 if (gic_irq_flags[irq] & GIC_IRQ_FLAG_EDGE)
124 if (!gic_wedgeb2bok)
125 spin_lock_irqsave(&gic_wedgeb2b_lock, flags);
126 GICWRITE(GIC_REG(SHARED, GIC_SH_WEDGE), irq); 106 GICWRITE(GIC_REG(SHARED, GIC_SH_WEDGE), irq);
127 if (!gic_wedgeb2bok) {
128 (void) GIC_REG(SHARED, GIC_SH_CONFIG);
129 spin_unlock_irqrestore(&gic_wedgeb2b_lock, flags);
130 }
131 }
132} 107}
133 108
134static void gic_mask_irq(unsigned int irq) 109static void gic_mask_irq(unsigned int irq)
135{ 110{
136 pr_debug("CPU%d: %s: irq%d\n", smp_processor_id(), __func__, irq);
137 irq -= _irqbase; 111 irq -= _irqbase;
138 GIC_CLR_INTR_MASK(irq, 1); 112 pr_debug("CPU%d: %s: irq%d\n", smp_processor_id(), __func__, irq);
113 GIC_CLR_INTR_MASK(irq);
139} 114}
140 115
141static void gic_unmask_irq(unsigned int irq) 116static void gic_unmask_irq(unsigned int irq)
142{ 117{
143 pr_debug("CPU%d: %s: irq%d\n", smp_processor_id(), __func__, irq);
144 irq -= _irqbase; 118 irq -= _irqbase;
145 GIC_SET_INTR_MASK(irq, 1); 119 pr_debug("CPU%d: %s: irq%d\n", smp_processor_id(), __func__, irq);
120 GIC_SET_INTR_MASK(irq);
146} 121}
147 122
148#ifdef CONFIG_SMP 123#ifdef CONFIG_SMP
@@ -155,9 +130,8 @@ static int gic_set_affinity(unsigned int irq, const struct cpumask *cpumask)
155 unsigned long flags; 130 unsigned long flags;
156 int i; 131 int i;
157 132
158 pr_debug(KERN_DEBUG "%s called\n", __func__);
159 irq -= _irqbase; 133 irq -= _irqbase;
160 134 pr_debug(KERN_DEBUG "%s(%d) called\n", __func__, irq);
161 cpumask_and(&tmp, cpumask, cpu_online_mask); 135 cpumask_and(&tmp, cpumask, cpu_online_mask);
162 if (cpus_empty(tmp)) 136 if (cpus_empty(tmp))
163 return -1; 137 return -1;
@@ -168,13 +142,6 @@ static int gic_set_affinity(unsigned int irq, const struct cpumask *cpumask)
168 /* Re-route this IRQ */ 142 /* Re-route this IRQ */
169 GIC_SH_MAP_TO_VPE_SMASK(irq, first_cpu(tmp)); 143 GIC_SH_MAP_TO_VPE_SMASK(irq, first_cpu(tmp));
170 144
171 /*
172 * FIXME: assumption that _intrmap is ordered and has no holes
173 */
174
175 /* Update the intr_map */
176 _intrmap[irq].cpunum = first_cpu(tmp);
177
178 /* Update the pcpu_masks */ 145 /* Update the pcpu_masks */
179 for (i = 0; i < NR_CPUS; i++) 146 for (i = 0; i < NR_CPUS; i++)
180 clear_bit(irq, pcpu_masks[i].pcpu_mask); 147 clear_bit(irq, pcpu_masks[i].pcpu_mask);
@@ -201,8 +168,9 @@ static struct irq_chip gic_irq_controller = {
201#endif 168#endif
202}; 169};
203 170
204static void __init setup_intr(unsigned int intr, unsigned int cpu, 171static void __init gic_setup_intr(unsigned int intr, unsigned int cpu,
205 unsigned int pin, unsigned int polarity, unsigned int trigtype) 172 unsigned int pin, unsigned int polarity, unsigned int trigtype,
173 unsigned int flags)
206{ 174{
207 /* Setup Intr to Pin mapping */ 175 /* Setup Intr to Pin mapping */
208 if (pin & GIC_MAP_TO_NMI_MSK) { 176 if (pin & GIC_MAP_TO_NMI_MSK) {
@@ -227,38 +195,43 @@ static void __init setup_intr(unsigned int intr, unsigned int cpu,
227 GIC_SET_TRIGGER(intr, trigtype); 195 GIC_SET_TRIGGER(intr, trigtype);
228 196
229 /* Init Intr Masks */ 197 /* Init Intr Masks */
230 GIC_SET_INTR_MASK(intr, 0); 198 GIC_CLR_INTR_MASK(intr);
199 /* Initialise per-cpu Interrupt software masks */
200 if (flags & GIC_FLAG_IPI)
201 set_bit(intr, pcpu_masks[cpu].pcpu_mask);
202 if (flags & GIC_FLAG_TRANSPARENT)
203 GIC_SET_INTR_MASK(intr);
204 if (trigtype == GIC_TRIG_EDGE)
205 gic_irq_flags[intr] |= GIC_IRQ_FLAG_EDGE;
231} 206}
232 207
233static void __init gic_basic_init(void) 208static void __init gic_basic_init(int numintrs, int numvpes,
209 struct gic_intr_map *intrmap, int mapsize)
234{ 210{
235 unsigned int i, cpu; 211 unsigned int i, cpu;
236 212
237 /* Setup defaults */ 213 /* Setup defaults */
238 for (i = 0; i < GIC_NUM_INTRS; i++) { 214 for (i = 0; i < numintrs; i++) {
239 GIC_SET_POLARITY(i, GIC_POL_POS); 215 GIC_SET_POLARITY(i, GIC_POL_POS);
240 GIC_SET_TRIGGER(i, GIC_TRIG_LEVEL); 216 GIC_SET_TRIGGER(i, GIC_TRIG_LEVEL);
241 GIC_SET_INTR_MASK(i, 0); 217 GIC_CLR_INTR_MASK(i);
218 if (i < GIC_NUM_INTRS)
219 gic_irq_flags[i] = 0;
242 } 220 }
243 221
244 /* Setup specifics */ 222 /* Setup specifics */
245 for (i = 0; i < _mapsize; i++) { 223 for (i = 0; i < mapsize; i++) {
246 cpu = _intrmap[i].cpunum; 224 cpu = intrmap[i].cpunum;
247 if (cpu == X) 225 if (cpu == X)
248 continue; 226 continue;
249 227 if (cpu == 0 && i != 0 && intrmap[i].flags == 0)
250 if (cpu == 0 && i != 0 && _intrmap[i].intrnum == 0 &&
251 _intrmap[i].ipiflag == 0)
252 continue; 228 continue;
253 229 gic_setup_intr(i,
254 setup_intr(_intrmap[i].intrnum, 230 intrmap[i].cpunum,
255 _intrmap[i].cpunum, 231 intrmap[i].pin,
256 _intrmap[i].pin, 232 intrmap[i].polarity,
257 _intrmap[i].polarity, 233 intrmap[i].trigtype,
258 _intrmap[i].trigtype); 234 intrmap[i].flags);
259 /* Initialise per-cpu Interrupt software masks */
260 if (_intrmap[i].ipiflag)
261 set_bit(_intrmap[i].intrnum, pcpu_masks[cpu].pcpu_mask);
262 } 235 }
263 236
264 vpe_local_setup(numvpes); 237 vpe_local_setup(numvpes);
@@ -273,12 +246,11 @@ void __init gic_init(unsigned long gic_base_addr,
273 unsigned int irqbase) 246 unsigned int irqbase)
274{ 247{
275 unsigned int gicconfig; 248 unsigned int gicconfig;
249 int numvpes, numintrs;
276 250
277 _gic_base = (unsigned long) ioremap_nocache(gic_base_addr, 251 _gic_base = (unsigned long) ioremap_nocache(gic_base_addr,
278 gic_addrspace_size); 252 gic_addrspace_size);
279 _irqbase = irqbase; 253 _irqbase = irqbase;
280 _intrmap = intr_map;
281 _mapsize = intr_map_size;
282 254
283 GICREAD(GIC_REG(SHARED, GIC_SH_CONFIG), gicconfig); 255 GICREAD(GIC_REG(SHARED, GIC_SH_CONFIG), gicconfig);
284 numintrs = (gicconfig & GIC_SH_CONFIG_NUMINTRS_MSK) >> 256 numintrs = (gicconfig & GIC_SH_CONFIG_NUMINTRS_MSK) >>
@@ -290,5 +262,5 @@ void __init gic_init(unsigned long gic_base_addr,
290 262
291 pr_debug("%s called\n", __func__); 263 pr_debug("%s called\n", __func__);
292 264
293 gic_basic_init(); 265 gic_basic_init(numintrs, numvpes, intr_map, intr_map_size);
294} 266}
diff --git a/arch/mips/kernel/linux32.c b/arch/mips/kernel/linux32.c
index 6242bc68add7..b77fefaff9da 100644
--- a/arch/mips/kernel/linux32.c
+++ b/arch/mips/kernel/linux32.c
@@ -428,3 +428,9 @@ _sys32_clone(nabi_no_regargs struct pt_regs regs)
428 return do_fork(clone_flags, newsp, &regs, 0, 428 return do_fork(clone_flags, newsp, &regs, 0,
429 parent_tidptr, child_tidptr); 429 parent_tidptr, child_tidptr);
430} 430}
431
432asmlinkage long sys32_lookup_dcookie(u32 a0, u32 a1, char __user *buf,
433 size_t len)
434{
435 return sys_lookup_dcookie(merge_64(a0, a1), buf, len);
436}
diff --git a/arch/mips/kernel/scall64-o32.S b/arch/mips/kernel/scall64-o32.S
index 9bbf9775e0bd..14dde4ca932e 100644
--- a/arch/mips/kernel/scall64-o32.S
+++ b/arch/mips/kernel/scall64-o32.S
@@ -450,7 +450,7 @@ sys_call_table:
450 PTR sys_io_submit 450 PTR sys_io_submit
451 PTR sys_io_cancel /* 4245 */ 451 PTR sys_io_cancel /* 4245 */
452 PTR sys_exit_group 452 PTR sys_exit_group
453 PTR sys_lookup_dcookie 453 PTR sys32_lookup_dcookie
454 PTR sys_epoll_create 454 PTR sys_epoll_create
455 PTR sys_epoll_ctl 455 PTR sys_epoll_ctl
456 PTR sys_epoll_wait /* 4250 */ 456 PTR sys_epoll_wait /* 4250 */
@@ -505,7 +505,7 @@ sys_call_table:
505 PTR sys_fchmodat 505 PTR sys_fchmodat
506 PTR sys_faccessat /* 4300 */ 506 PTR sys_faccessat /* 4300 */
507 PTR compat_sys_pselect6 507 PTR compat_sys_pselect6
508 PTR sys_ppoll 508 PTR compat_sys_ppoll
509 PTR sys_unshare 509 PTR sys_unshare
510 PTR sys_splice 510 PTR sys_splice
511 PTR sys32_sync_file_range /* 4305 */ 511 PTR sys32_sync_file_range /* 4305 */
diff --git a/arch/mips/kernel/smtc.c b/arch/mips/kernel/smtc.c
index 4d181df44a40..24630fd8ef60 100644
--- a/arch/mips/kernel/smtc.c
+++ b/arch/mips/kernel/smtc.c
@@ -75,7 +75,6 @@ unsigned long irq_hwmask[NR_IRQS];
75 75
76asiduse smtc_live_asid[MAX_SMTC_TLBS][MAX_SMTC_ASIDS]; 76asiduse smtc_live_asid[MAX_SMTC_TLBS][MAX_SMTC_ASIDS];
77 77
78
79/* 78/*
80 * Number of InterProcessor Interrupt (IPI) message buffers to allocate 79 * Number of InterProcessor Interrupt (IPI) message buffers to allocate
81 */ 80 */
@@ -388,6 +387,7 @@ void smtc_prepare_cpus(int cpus)
388 IPIQ[i].head = IPIQ[i].tail = NULL; 387 IPIQ[i].head = IPIQ[i].tail = NULL;
389 spin_lock_init(&IPIQ[i].lock); 388 spin_lock_init(&IPIQ[i].lock);
390 IPIQ[i].depth = 0; 389 IPIQ[i].depth = 0;
390 IPIQ[i].resched_flag = 0; /* No reschedules queued initially */
391 } 391 }
392 392
393 /* cpu_data index starts at zero */ 393 /* cpu_data index starts at zero */
@@ -741,11 +741,24 @@ void smtc_forward_irq(unsigned int irq)
741static void smtc_ipi_qdump(void) 741static void smtc_ipi_qdump(void)
742{ 742{
743 int i; 743 int i;
744 struct smtc_ipi *temp;
744 745
745 for (i = 0; i < NR_CPUS ;i++) { 746 for (i = 0; i < NR_CPUS ;i++) {
746 printk("IPIQ[%d]: head = 0x%x, tail = 0x%x, depth = %d\n", 747 pr_info("IPIQ[%d]: head = 0x%x, tail = 0x%x, depth = %d\n",
747 i, (unsigned)IPIQ[i].head, (unsigned)IPIQ[i].tail, 748 i, (unsigned)IPIQ[i].head, (unsigned)IPIQ[i].tail,
748 IPIQ[i].depth); 749 IPIQ[i].depth);
750 temp = IPIQ[i].head;
751
752 while (temp != IPIQ[i].tail) {
753 pr_debug("%d %d %d: ", temp->type, temp->dest,
754 (int)temp->arg);
755#ifdef SMTC_IPI_DEBUG
756 pr_debug("%u %lu\n", temp->sender, temp->stamp);
757#else
758 pr_debug("\n");
759#endif
760 temp = temp->flink;
761 }
749 } 762 }
750} 763}
751 764
@@ -784,11 +797,16 @@ void smtc_send_ipi(int cpu, int type, unsigned int action)
784 int mtflags; 797 int mtflags;
785 unsigned long tcrestart; 798 unsigned long tcrestart;
786 extern void r4k_wait_irqoff(void), __pastwait(void); 799 extern void r4k_wait_irqoff(void), __pastwait(void);
800 int set_resched_flag = (type == LINUX_SMP_IPI &&
801 action == SMP_RESCHEDULE_YOURSELF);
787 802
788 if (cpu == smp_processor_id()) { 803 if (cpu == smp_processor_id()) {
789 printk("Cannot Send IPI to self!\n"); 804 printk("Cannot Send IPI to self!\n");
790 return; 805 return;
791 } 806 }
807 if (set_resched_flag && IPIQ[cpu].resched_flag != 0)
808 return; /* There is a reschedule queued already */
809
792 /* Set up a descriptor, to be delivered either promptly or queued */ 810 /* Set up a descriptor, to be delivered either promptly or queued */
793 pipi = smtc_ipi_dq(&freeIPIq); 811 pipi = smtc_ipi_dq(&freeIPIq);
794 if (pipi == NULL) { 812 if (pipi == NULL) {
@@ -801,6 +819,7 @@ void smtc_send_ipi(int cpu, int type, unsigned int action)
801 pipi->dest = cpu; 819 pipi->dest = cpu;
802 if (cpu_data[cpu].vpe_id != cpu_data[smp_processor_id()].vpe_id) { 820 if (cpu_data[cpu].vpe_id != cpu_data[smp_processor_id()].vpe_id) {
803 /* If not on same VPE, enqueue and send cross-VPE interrupt */ 821 /* If not on same VPE, enqueue and send cross-VPE interrupt */
822 IPIQ[cpu].resched_flag |= set_resched_flag;
804 smtc_ipi_nq(&IPIQ[cpu], pipi); 823 smtc_ipi_nq(&IPIQ[cpu], pipi);
805 LOCK_CORE_PRA(); 824 LOCK_CORE_PRA();
806 settc(cpu_data[cpu].tc_id); 825 settc(cpu_data[cpu].tc_id);
@@ -847,6 +866,7 @@ void smtc_send_ipi(int cpu, int type, unsigned int action)
847 */ 866 */
848 write_tc_c0_tchalt(0); 867 write_tc_c0_tchalt(0);
849 UNLOCK_CORE_PRA(); 868 UNLOCK_CORE_PRA();
869 IPIQ[cpu].resched_flag |= set_resched_flag;
850 smtc_ipi_nq(&IPIQ[cpu], pipi); 870 smtc_ipi_nq(&IPIQ[cpu], pipi);
851 } else { 871 } else {
852postdirect: 872postdirect:
@@ -996,12 +1016,15 @@ void deferred_smtc_ipi(void)
996 * already enabled. 1016 * already enabled.
997 */ 1017 */
998 local_irq_save(flags); 1018 local_irq_save(flags);
999
1000 spin_lock(&q->lock); 1019 spin_lock(&q->lock);
1001 pipi = __smtc_ipi_dq(q); 1020 pipi = __smtc_ipi_dq(q);
1002 spin_unlock(&q->lock); 1021 spin_unlock(&q->lock);
1003 if (pipi != NULL) 1022 if (pipi != NULL) {
1023 if (pipi->type == LINUX_SMP_IPI &&
1024 (int)pipi->arg == SMP_RESCHEDULE_YOURSELF)
1025 IPIQ[cpu].resched_flag = 0;
1004 ipi_decode(pipi); 1026 ipi_decode(pipi);
1027 }
1005 /* 1028 /*
1006 * The use of the __raw_local restore isn't 1029 * The use of the __raw_local restore isn't
1007 * as obviously necessary here as in smtc_ipi_replay(), 1030 * as obviously necessary here as in smtc_ipi_replay(),
@@ -1082,6 +1105,9 @@ static irqreturn_t ipi_interrupt(int irq, void *dev_idm)
1082 * with interrupts off 1105 * with interrupts off
1083 */ 1106 */
1084 local_irq_save(flags); 1107 local_irq_save(flags);
1108 if (pipi->type == LINUX_SMP_IPI &&
1109 (int)pipi->arg == SMP_RESCHEDULE_YOURSELF)
1110 IPIQ[cpu].resched_flag = 0;
1085 ipi_decode(pipi); 1111 ipi_decode(pipi);
1086 local_irq_restore(flags); 1112 local_irq_restore(flags);
1087 } 1113 }
diff --git a/arch/mips/kernel/spram.c b/arch/mips/kernel/spram.c
index 6ddb507a87ef..1821d12a6410 100644
--- a/arch/mips/kernel/spram.c
+++ b/arch/mips/kernel/spram.c
@@ -13,7 +13,6 @@
13#include <linux/ptrace.h> 13#include <linux/ptrace.h>
14#include <linux/stddef.h> 14#include <linux/stddef.h>
15 15
16#include <asm/cpu.h>
17#include <asm/fpu.h> 16#include <asm/fpu.h>
18#include <asm/mipsregs.h> 17#include <asm/mipsregs.h>
19#include <asm/system.h> 18#include <asm/system.h>
@@ -198,8 +197,7 @@ static __cpuinit void probe_spram(char *type,
198 offset += 2 * SPRAM_TAG_STRIDE; 197 offset += 2 * SPRAM_TAG_STRIDE;
199 } 198 }
200} 199}
201 200void __cpuinit spram_config(void)
202__cpuinit void spram_config(void)
203{ 201{
204 struct cpuinfo_mips *c = &current_cpu_data; 202 struct cpuinfo_mips *c = &current_cpu_data;
205 unsigned int config0; 203 unsigned int config0;
@@ -208,6 +206,7 @@ __cpuinit void spram_config(void)
208 case CPU_24K: 206 case CPU_24K:
209 case CPU_34K: 207 case CPU_34K:
210 case CPU_74K: 208 case CPU_74K:
209 case CPU_1004K:
211 config0 = read_c0_config(); 210 config0 = read_c0_config();
212 /* FIXME: addresses are Malta specific */ 211 /* FIXME: addresses are Malta specific */
213 if (config0 & (1<<24)) { 212 if (config0 & (1<<24)) {
diff --git a/arch/mips/kernel/syscall.c b/arch/mips/kernel/syscall.c
index 3fe1fcfa2e73..fe0d79805603 100644
--- a/arch/mips/kernel/syscall.c
+++ b/arch/mips/kernel/syscall.c
@@ -306,6 +306,7 @@ static inline int mips_atomic_set(struct pt_regs *regs,
306 306
307 if (cpu_has_llsc && R10000_LLSC_WAR) { 307 if (cpu_has_llsc && R10000_LLSC_WAR) {
308 __asm__ __volatile__ ( 308 __asm__ __volatile__ (
309 " .set mips3 \n"
309 " li %[err], 0 \n" 310 " li %[err], 0 \n"
310 "1: ll %[old], (%[addr]) \n" 311 "1: ll %[old], (%[addr]) \n"
311 " move %[tmp], %[new] \n" 312 " move %[tmp], %[new] \n"
@@ -320,6 +321,7 @@ static inline int mips_atomic_set(struct pt_regs *regs,
320 " "STR(PTR)" 1b, 4b \n" 321 " "STR(PTR)" 1b, 4b \n"
321 " "STR(PTR)" 2b, 4b \n" 322 " "STR(PTR)" 2b, 4b \n"
322 " .previous \n" 323 " .previous \n"
324 " .set mips0 \n"
323 : [old] "=&r" (old), 325 : [old] "=&r" (old),
324 [err] "=&r" (err), 326 [err] "=&r" (err),
325 [tmp] "=&r" (tmp) 327 [tmp] "=&r" (tmp)
@@ -329,6 +331,7 @@ static inline int mips_atomic_set(struct pt_regs *regs,
329 : "memory"); 331 : "memory");
330 } else if (cpu_has_llsc) { 332 } else if (cpu_has_llsc) {
331 __asm__ __volatile__ ( 333 __asm__ __volatile__ (
334 " .set mips3 \n"
332 " li %[err], 0 \n" 335 " li %[err], 0 \n"
333 "1: ll %[old], (%[addr]) \n" 336 "1: ll %[old], (%[addr]) \n"
334 " move %[tmp], %[new] \n" 337 " move %[tmp], %[new] \n"
@@ -347,6 +350,7 @@ static inline int mips_atomic_set(struct pt_regs *regs,
347 " "STR(PTR)" 1b, 5b \n" 350 " "STR(PTR)" 1b, 5b \n"
348 " "STR(PTR)" 2b, 5b \n" 351 " "STR(PTR)" 2b, 5b \n"
349 " .previous \n" 352 " .previous \n"
353 " .set mips0 \n"
350 : [old] "=&r" (old), 354 : [old] "=&r" (old),
351 [err] "=&r" (err), 355 [err] "=&r" (err),
352 [tmp] "=&r" (tmp) 356 [tmp] "=&r" (tmp)
diff --git a/arch/mips/kernel/vpe.c b/arch/mips/kernel/vpe.c
index 03092ab2a296..60477529362e 100644
--- a/arch/mips/kernel/vpe.c
+++ b/arch/mips/kernel/vpe.c
@@ -1116,8 +1116,6 @@ static int vpe_open(struct inode *inode, struct file *filp)
1116 v->shared_ptr = NULL; 1116 v->shared_ptr = NULL;
1117 v->__start = 0; 1117 v->__start = 0;
1118 1118
1119 unlock_kernel();
1120
1121 return 0; 1119 return 0;
1122} 1120}
1123 1121
diff --git a/arch/mips/loongson/common/irq.c b/arch/mips/loongson/common/irq.c
index f368c735cbd3..b32b4a3e5137 100644
--- a/arch/mips/loongson/common/irq.c
+++ b/arch/mips/loongson/common/irq.c
@@ -55,7 +55,6 @@ void __init arch_init_irq(void)
55 * int-handler is not on bootstrap 55 * int-handler is not on bootstrap
56 */ 56 */
57 clear_c0_status(ST0_IM | ST0_BEV); 57 clear_c0_status(ST0_IM | ST0_BEV);
58 local_irq_disable();
59 58
60 /* setting irq trigger mode */ 59 /* setting irq trigger mode */
61 set_irq_trigger_mode(); 60 set_irq_trigger_mode();
diff --git a/arch/mips/math-emu/cp1emu.c b/arch/mips/math-emu/cp1emu.c
index 890f77927d62..454b53924490 100644
--- a/arch/mips/math-emu/cp1emu.c
+++ b/arch/mips/math-emu/cp1emu.c
@@ -163,33 +163,34 @@ static int isBranchInstr(mips_instruction * i)
163 163
164/* 164/*
165 * In the Linux kernel, we support selection of FPR format on the 165 * In the Linux kernel, we support selection of FPR format on the
166 * basis of the Status.FR bit. This does imply that, if a full 32 166 * basis of the Status.FR bit. If an FPU is not present, the FR bit
167 * FPRs are desired, there needs to be a flip-flop that can be written 167 * is hardwired to zero, which would imply a 32-bit FPU even for
168 * to one at that bit position. In any case, O32 MIPS ABI uses 168 * 64-bit CPUs. For 64-bit kernels with no FPU we use TIF_32BIT_REGS
169 * only the even FPRs (Status.FR = 0). 169 * as a proxy for the FR bit so that a 64-bit FPU is emulated. In any
170 * case, for a 32-bit kernel which uses the O32 MIPS ABI, only the
171 * even FPRs are used (Status.FR = 0).
170 */ 172 */
171 173static inline int cop1_64bit(struct pt_regs *xcp)
172#define CP0_STATUS_FR_SUPPORT 174{
173 175 if (cpu_has_fpu)
174#ifdef CP0_STATUS_FR_SUPPORT 176 return xcp->cp0_status & ST0_FR;
175#define FR_BIT ST0_FR 177#ifdef CONFIG_64BIT
178 return !test_thread_flag(TIF_32BIT_REGS);
176#else 179#else
177#define FR_BIT 0 180 return 0;
178#endif 181#endif
182}
183
184#define SIFROMREG(si, x) ((si) = cop1_64bit(xcp) || !(x & 1) ? \
185 (int)ctx->fpr[x] : (int)(ctx->fpr[x & ~1] >> 32))
179 186
180#define SIFROMREG(si, x) ((si) = \ 187#define SITOREG(si, x) (ctx->fpr[x & ~(cop1_64bit(xcp) == 0)] = \
181 (xcp->cp0_status & FR_BIT) || !(x & 1) ? \ 188 cop1_64bit(xcp) || !(x & 1) ? \
182 (int)ctx->fpr[x] : \
183 (int)(ctx->fpr[x & ~1] >> 32 ))
184#define SITOREG(si, x) (ctx->fpr[x & ~((xcp->cp0_status & FR_BIT) == 0)] = \
185 (xcp->cp0_status & FR_BIT) || !(x & 1) ? \
186 ctx->fpr[x & ~1] >> 32 << 32 | (u32)(si) : \ 189 ctx->fpr[x & ~1] >> 32 << 32 | (u32)(si) : \
187 ctx->fpr[x & ~1] << 32 >> 32 | (u64)(si) << 32) 190 ctx->fpr[x & ~1] << 32 >> 32 | (u64)(si) << 32)
188 191
189#define DIFROMREG(di, x) ((di) = \ 192#define DIFROMREG(di, x) ((di) = ctx->fpr[x & ~(cop1_64bit(xcp) == 0)])
190 ctx->fpr[x & ~((xcp->cp0_status & FR_BIT) == 0)]) 193#define DITOREG(di, x) (ctx->fpr[x & ~(cop1_64bit(xcp) == 0)] = (di))
191#define DITOREG(di, x) (ctx->fpr[x & ~((xcp->cp0_status & FR_BIT) == 0)] \
192 = (di))
193 194
194#define SPFROMREG(sp, x) SIFROMREG((sp).bits, x) 195#define SPFROMREG(sp, x) SIFROMREG((sp).bits, x)
195#define SPTOREG(sp, x) SITOREG((sp).bits, x) 196#define SPTOREG(sp, x) SITOREG((sp).bits, x)
diff --git a/arch/mips/math-emu/dp_simple.c b/arch/mips/math-emu/dp_simple.c
index 1c555e6c6a9f..d9ae1dbabda7 100644
--- a/arch/mips/math-emu/dp_simple.c
+++ b/arch/mips/math-emu/dp_simple.c
@@ -62,8 +62,6 @@ ieee754dp ieee754dp_neg(ieee754dp x)
62 return ieee754dp_nanxcpt(y, "neg"); 62 return ieee754dp_nanxcpt(y, "neg");
63 } 63 }
64 64
65 if (ieee754dp_isnan(x)) /* but not infinity */
66 return ieee754dp_nanxcpt(x, "neg", x);
67 return x; 65 return x;
68} 66}
69 67
@@ -76,15 +74,12 @@ ieee754dp ieee754dp_abs(ieee754dp x)
76 CLEARCX; 74 CLEARCX;
77 FLUSHXDP; 75 FLUSHXDP;
78 76
77 /* Clear sign ALWAYS, irrespective of NaN */
78 DPSIGN(x) = 0;
79
79 if (xc == IEEE754_CLASS_SNAN) { 80 if (xc == IEEE754_CLASS_SNAN) {
80 SETCX(IEEE754_INVALID_OPERATION); 81 return ieee754dp_nanxcpt(ieee754dp_indef(), "abs");
81 return ieee754dp_nanxcpt(ieee754dp_indef(), "neg");
82 } 82 }
83 83
84 if (ieee754dp_isnan(x)) /* but not infinity */
85 return ieee754dp_nanxcpt(x, "abs", x);
86
87 /* quick fix up */
88 DPSIGN(x) = 0;
89 return x; 84 return x;
90} 85}
diff --git a/arch/mips/math-emu/sp_simple.c b/arch/mips/math-emu/sp_simple.c
index 770f0f4677cd..3175477d36f6 100644
--- a/arch/mips/math-emu/sp_simple.c
+++ b/arch/mips/math-emu/sp_simple.c
@@ -62,8 +62,6 @@ ieee754sp ieee754sp_neg(ieee754sp x)
62 return ieee754sp_nanxcpt(y, "neg"); 62 return ieee754sp_nanxcpt(y, "neg");
63 } 63 }
64 64
65 if (ieee754sp_isnan(x)) /* but not infinity */
66 return ieee754sp_nanxcpt(x, "neg", x);
67 return x; 65 return x;
68} 66}
69 67
@@ -76,15 +74,12 @@ ieee754sp ieee754sp_abs(ieee754sp x)
76 CLEARCX; 74 CLEARCX;
77 FLUSHXSP; 75 FLUSHXSP;
78 76
77 /* Clear sign ALWAYS, irrespective of NaN */
78 SPSIGN(x) = 0;
79
79 if (xc == IEEE754_CLASS_SNAN) { 80 if (xc == IEEE754_CLASS_SNAN) {
80 SETCX(IEEE754_INVALID_OPERATION);
81 return ieee754sp_nanxcpt(ieee754sp_indef(), "abs"); 81 return ieee754sp_nanxcpt(ieee754sp_indef(), "abs");
82 } 82 }
83 83
84 if (ieee754sp_isnan(x)) /* but not infinity */
85 return ieee754sp_nanxcpt(x, "abs", x);
86
87 /* quick fix up */
88 SPSIGN(x) = 0;
89 return x; 84 return x;
90} 85}
diff --git a/arch/mips/mm/dma-default.c b/arch/mips/mm/dma-default.c
index 7e48e76148aa..9367e33fbd18 100644
--- a/arch/mips/mm/dma-default.c
+++ b/arch/mips/mm/dma-default.c
@@ -90,6 +90,9 @@ void *dma_alloc_coherent(struct device *dev, size_t size,
90{ 90{
91 void *ret; 91 void *ret;
92 92
93 if (dma_alloc_from_coherent(dev, size, dma_handle, &ret))
94 return ret;
95
93 gfp = massage_gfp_flags(dev, gfp); 96 gfp = massage_gfp_flags(dev, gfp);
94 97
95 ret = (void *) __get_free_pages(gfp, get_order(size)); 98 ret = (void *) __get_free_pages(gfp, get_order(size));
@@ -122,6 +125,10 @@ void dma_free_coherent(struct device *dev, size_t size, void *vaddr,
122 dma_addr_t dma_handle) 125 dma_addr_t dma_handle)
123{ 126{
124 unsigned long addr = (unsigned long) vaddr; 127 unsigned long addr = (unsigned long) vaddr;
128 int order = get_order(size);
129
130 if (dma_release_from_coherent(dev, order, vaddr))
131 return;
125 132
126 plat_unmap_dma_mem(dev, dma_handle, size, DMA_BIDIRECTIONAL); 133 plat_unmap_dma_mem(dev, dma_handle, size, DMA_BIDIRECTIONAL);
127 134
diff --git a/arch/mips/mm/init.c b/arch/mips/mm/init.c
index 15aa1902a788..8d1f4f363049 100644
--- a/arch/mips/mm/init.c
+++ b/arch/mips/mm/init.c
@@ -27,6 +27,7 @@
27#include <linux/swap.h> 27#include <linux/swap.h>
28#include <linux/proc_fs.h> 28#include <linux/proc_fs.h>
29#include <linux/pfn.h> 29#include <linux/pfn.h>
30#include <linux/hardirq.h>
30 31
31#include <asm/asm-offsets.h> 32#include <asm/asm-offsets.h>
32#include <asm/bootinfo.h> 33#include <asm/bootinfo.h>
@@ -132,7 +133,10 @@ void *kmap_coherent(struct page *page, unsigned long addr)
132 inc_preempt_count(); 133 inc_preempt_count();
133 idx = (addr >> PAGE_SHIFT) & (FIX_N_COLOURS - 1); 134 idx = (addr >> PAGE_SHIFT) & (FIX_N_COLOURS - 1);
134#ifdef CONFIG_MIPS_MT_SMTC 135#ifdef CONFIG_MIPS_MT_SMTC
135 idx += FIX_N_COLOURS * smp_processor_id(); 136 idx += FIX_N_COLOURS * smp_processor_id() +
137 (in_interrupt() ? (FIX_N_COLOURS * NR_CPUS) : 0);
138#else
139 idx += in_interrupt() ? FIX_N_COLOURS : 0;
136#endif 140#endif
137 vaddr = __fix_to_virt(FIX_CMAP_END - idx); 141 vaddr = __fix_to_virt(FIX_CMAP_END - idx);
138 pte = mk_pte(page, PAGE_KERNEL); 142 pte = mk_pte(page, PAGE_KERNEL);
diff --git a/arch/mips/mti-malta/malta-amon.c b/arch/mips/mti-malta/malta-amon.c
index df9e526312a2..469d9b0cee6d 100644
--- a/arch/mips/mti-malta/malta-amon.c
+++ b/arch/mips/mti-malta/malta-amon.c
@@ -70,11 +70,12 @@ void amon_cpu_start(int cpu,
70 launch->sp = sp; 70 launch->sp = sp;
71 launch->a0 = a0; 71 launch->a0 = a0;
72 72
73 /* Make sure target sees parameters before the go bit */ 73 smp_wmb(); /* Target must see parameters before go */
74 smp_mb();
75
76 launch->flags |= LAUNCH_FGO; 74 launch->flags |= LAUNCH_FGO;
75 smp_wmb(); /* Target must see go before we poll */
76
77 while ((launch->flags & LAUNCH_FGONE) == 0) 77 while ((launch->flags & LAUNCH_FGONE) == 0)
78 ; 78 ;
79 smp_rmb(); /* Target will be updating flags soon */
79 pr_debug("launch: cpu%d gone!\n", cpu); 80 pr_debug("launch: cpu%d gone!\n", cpu);
80} 81}
diff --git a/arch/mips/mti-malta/malta-int.c b/arch/mips/mti-malta/malta-int.c
index 3e0a9b35ba5c..4c3fca18a171 100644
--- a/arch/mips/mti-malta/malta-int.c
+++ b/arch/mips/mti-malta/malta-int.c
@@ -87,7 +87,7 @@ static inline int mips_pcibios_iack(void)
87 dummy = BONITO_PCIMAP_CFG; 87 dummy = BONITO_PCIMAP_CFG;
88 iob(); /* sync */ 88 iob(); /* sync */
89 89
90 irq = readl((u32 *)_pcictrl_bonito_pcicfg); 90 irq = __raw_readl((u32 *)_pcictrl_bonito_pcicfg);
91 iob(); /* sync */ 91 iob(); /* sync */
92 irq &= 0xff; 92 irq &= 0xff;
93 BONITO_PCIMAP_CFG = 0; 93 BONITO_PCIMAP_CFG = 0;
@@ -379,38 +379,43 @@ static msc_irqmap_t __initdata msc_eicirqmap[] = {
379 379
380static int __initdata msc_nr_eicirqs = ARRAY_SIZE(msc_eicirqmap); 380static int __initdata msc_nr_eicirqs = ARRAY_SIZE(msc_eicirqmap);
381 381
382#if defined(CONFIG_MIPS_MT_SMP)
383/* 382/*
384 * This GIC specific tabular array defines the association between External 383 * This GIC specific tabular array defines the association between External
385 * Interrupts and CPUs/Core Interrupts. The nature of the External 384 * Interrupts and CPUs/Core Interrupts. The nature of the External
386 * Interrupts is also defined here - polarity/trigger. 385 * Interrupts is also defined here - polarity/trigger.
387 */ 386 */
387
388#define GIC_CPU_NMI GIC_MAP_TO_NMI_MSK
388static struct gic_intr_map gic_intr_map[GIC_NUM_INTRS] = { 389static struct gic_intr_map gic_intr_map[GIC_NUM_INTRS] = {
389 { GIC_EXT_INTR(0), X, X, X, X, 0 }, 390 { X, X, X, X, 0 },
390 { GIC_EXT_INTR(1), X, X, X, X, 0 }, 391 { X, X, X, X, 0 },
391 { GIC_EXT_INTR(2), X, X, X, X, 0 }, 392 { X, X, X, X, 0 },
392 { GIC_EXT_INTR(3), 0, GIC_CPU_INT0, GIC_POL_POS, GIC_TRIG_LEVEL, 0 }, 393 { 0, GIC_CPU_INT0, GIC_POL_POS, GIC_TRIG_LEVEL, GIC_FLAG_TRANSPARENT },
393 { GIC_EXT_INTR(4), 0, GIC_CPU_INT1, GIC_POL_POS, GIC_TRIG_LEVEL, 0 }, 394 { 0, GIC_CPU_INT1, GIC_POL_POS, GIC_TRIG_LEVEL, GIC_FLAG_TRANSPARENT },
394 { GIC_EXT_INTR(5), 0, GIC_CPU_INT2, GIC_POL_POS, GIC_TRIG_LEVEL, 0 }, 395 { 0, GIC_CPU_INT2, GIC_POL_POS, GIC_TRIG_LEVEL, GIC_FLAG_TRANSPARENT },
395 { GIC_EXT_INTR(6), 0, GIC_CPU_INT3, GIC_POL_POS, GIC_TRIG_LEVEL, 0 }, 396 { 0, GIC_CPU_INT3, GIC_POL_POS, GIC_TRIG_LEVEL, GIC_FLAG_TRANSPARENT },
396 { GIC_EXT_INTR(7), 0, GIC_CPU_INT4, GIC_POL_POS, GIC_TRIG_LEVEL, 0 }, 397 { 0, GIC_CPU_INT4, GIC_POL_POS, GIC_TRIG_LEVEL, GIC_FLAG_TRANSPARENT },
397 { GIC_EXT_INTR(8), 0, GIC_CPU_INT3, GIC_POL_POS, GIC_TRIG_LEVEL, 0 }, 398 { 0, GIC_CPU_INT3, GIC_POL_POS, GIC_TRIG_LEVEL, GIC_FLAG_TRANSPARENT },
398 { GIC_EXT_INTR(9), 0, GIC_CPU_INT3, GIC_POL_POS, GIC_TRIG_LEVEL, 0 }, 399 { 0, GIC_CPU_INT3, GIC_POL_POS, GIC_TRIG_LEVEL, GIC_FLAG_TRANSPARENT },
399 { GIC_EXT_INTR(10), X, X, X, X, 0 }, 400 { X, X, X, X, 0 },
400 { GIC_EXT_INTR(11), X, X, X, X, 0 }, 401 { X, X, X, X, 0 },
401 { GIC_EXT_INTR(12), 0, GIC_CPU_INT3, GIC_POL_POS, GIC_TRIG_LEVEL, 0 }, 402 { 0, GIC_CPU_INT3, GIC_POL_POS, GIC_TRIG_LEVEL, GIC_FLAG_TRANSPARENT },
402 { GIC_EXT_INTR(13), 0, GIC_MAP_TO_NMI_MSK, GIC_POL_POS, GIC_TRIG_LEVEL, 0 }, 403 { 0, GIC_CPU_NMI, GIC_POL_POS, GIC_TRIG_LEVEL, GIC_FLAG_TRANSPARENT },
403 { GIC_EXT_INTR(14), 0, GIC_MAP_TO_NMI_MSK, GIC_POL_POS, GIC_TRIG_LEVEL, 0 }, 404 { 0, GIC_CPU_NMI, GIC_POL_POS, GIC_TRIG_LEVEL, GIC_FLAG_TRANSPARENT },
404 { GIC_EXT_INTR(15), X, X, X, X, 0 }, 405 { X, X, X, X, 0 },
405/* This is the end of the general interrupts now we do IPI ones */ 406 /* The remainder of this table is initialised by fill_ipi_map */
406}; 407};
407#endif
408 408
409/* 409/*
410 * GCMP needs to be detected before any SMP initialisation 410 * GCMP needs to be detected before any SMP initialisation
411 */ 411 */
412int __init gcmp_probe(unsigned long addr, unsigned long size) 412int __init gcmp_probe(unsigned long addr, unsigned long size)
413{ 413{
414 if (mips_revision_sconid != MIPS_REVISION_SCON_ROCIT) {
415 gcmp_present = 0;
416 return gcmp_present;
417 }
418
414 if (gcmp_present >= 0) 419 if (gcmp_present >= 0)
415 return gcmp_present; 420 return gcmp_present;
416 421
@@ -419,20 +424,35 @@ int __init gcmp_probe(unsigned long addr, unsigned long size)
419 gcmp_present = (GCMPGCB(GCMPB) & GCMP_GCB_GCMPB_GCMPBASE_MSK) == GCMP_BASE_ADDR; 424 gcmp_present = (GCMPGCB(GCMPB) & GCMP_GCB_GCMPB_GCMPBASE_MSK) == GCMP_BASE_ADDR;
420 425
421 if (gcmp_present) 426 if (gcmp_present)
422 printk(KERN_DEBUG "GCMP present\n"); 427 pr_debug("GCMP present\n");
423 return gcmp_present; 428 return gcmp_present;
424} 429}
425 430
431/* Return the number of IOCU's present */
432int __init gcmp_niocu(void)
433{
434 return gcmp_present ?
435 (GCMPGCB(GC) & GCMP_GCB_GC_NUMIOCU_MSK) >> GCMP_GCB_GC_NUMIOCU_SHF :
436 0;
437}
438
439/* Set GCMP region attributes */
440void __init gcmp_setregion(int region, unsigned long base,
441 unsigned long mask, int type)
442{
443 GCMPGCBn(CMxBASE, region) = base;
444 GCMPGCBn(CMxMASK, region) = mask | type;
445}
446
426#if defined(CONFIG_MIPS_MT_SMP) 447#if defined(CONFIG_MIPS_MT_SMP)
427static void __init fill_ipi_map1(int baseintr, int cpu, int cpupin) 448static void __init fill_ipi_map1(int baseintr, int cpu, int cpupin)
428{ 449{
429 int intr = baseintr + cpu; 450 int intr = baseintr + cpu;
430 gic_intr_map[intr].intrnum = GIC_EXT_INTR(intr);
431 gic_intr_map[intr].cpunum = cpu; 451 gic_intr_map[intr].cpunum = cpu;
432 gic_intr_map[intr].pin = cpupin; 452 gic_intr_map[intr].pin = cpupin;
433 gic_intr_map[intr].polarity = GIC_POL_POS; 453 gic_intr_map[intr].polarity = GIC_POL_POS;
434 gic_intr_map[intr].trigtype = GIC_TRIG_EDGE; 454 gic_intr_map[intr].trigtype = GIC_TRIG_EDGE;
435 gic_intr_map[intr].ipiflag = 1; 455 gic_intr_map[intr].flags = GIC_FLAG_IPI;
436 ipi_map[cpu] |= (1 << (cpupin + 2)); 456 ipi_map[cpu] |= (1 << (cpupin + 2));
437} 457}
438 458
@@ -447,6 +467,12 @@ static void __init fill_ipi_map(void)
447} 467}
448#endif 468#endif
449 469
470void __init arch_init_ipiirq(int irq, struct irqaction *action)
471{
472 setup_irq(irq, action);
473 set_irq_handler(irq, handle_percpu_irq);
474}
475
450void __init arch_init_irq(void) 476void __init arch_init_irq(void)
451{ 477{
452 init_i8259_irqs(); 478 init_i8259_irqs();
@@ -458,12 +484,17 @@ void __init arch_init_irq(void)
458 GCMPGCB(GICBA) = GIC_BASE_ADDR | GCMP_GCB_GICBA_EN_MSK; 484 GCMPGCB(GICBA) = GIC_BASE_ADDR | GCMP_GCB_GICBA_EN_MSK;
459 gic_present = 1; 485 gic_present = 1;
460 } else { 486 } else {
461 _msc01_biu_base = (unsigned long) ioremap_nocache(MSC01_BIU_REG_BASE, MSC01_BIU_ADDRSPACE_SZ); 487 if (mips_revision_sconid == MIPS_REVISION_SCON_ROCIT) {
462 gic_present = (REG(_msc01_biu_base, MSC01_SC_CFG) & 488 _msc01_biu_base = (unsigned long)
463 MSC01_SC_CFG_GICPRES_MSK) >> MSC01_SC_CFG_GICPRES_SHF; 489 ioremap_nocache(MSC01_BIU_REG_BASE,
490 MSC01_BIU_ADDRSPACE_SZ);
491 gic_present = (REG(_msc01_biu_base, MSC01_SC_CFG) &
492 MSC01_SC_CFG_GICPRES_MSK) >>
493 MSC01_SC_CFG_GICPRES_SHF;
494 }
464 } 495 }
465 if (gic_present) 496 if (gic_present)
466 printk(KERN_DEBUG "GIC present\n"); 497 pr_debug("GIC present\n");
467 498
468 switch (mips_revision_sconid) { 499 switch (mips_revision_sconid) {
469 case MIPS_REVISION_SCON_SOCIT: 500 case MIPS_REVISION_SCON_SOCIT:
@@ -526,16 +557,16 @@ void __init arch_init_irq(void)
526 &corehi_irqaction); 557 &corehi_irqaction);
527 } 558 }
528 559
529#if defined(CONFIG_MIPS_MT_SMP)
530 if (gic_present) { 560 if (gic_present) {
531 /* FIXME */ 561 /* FIXME */
532 int i; 562 int i;
533 563#if defined(CONFIG_MIPS_MT_SMP)
534 gic_call_int_base = GIC_NUM_INTRS - NR_CPUS; 564 gic_call_int_base = GIC_NUM_INTRS - NR_CPUS;
535 gic_resched_int_base = gic_call_int_base - NR_CPUS; 565 gic_resched_int_base = gic_call_int_base - NR_CPUS;
536
537 fill_ipi_map(); 566 fill_ipi_map();
538 gic_init(GIC_BASE_ADDR, GIC_ADDRSPACE_SZ, gic_intr_map, ARRAY_SIZE(gic_intr_map), MIPS_GIC_IRQ_BASE); 567#endif
568 gic_init(GIC_BASE_ADDR, GIC_ADDRSPACE_SZ, gic_intr_map,
569 ARRAY_SIZE(gic_intr_map), MIPS_GIC_IRQ_BASE);
539 if (!gcmp_present) { 570 if (!gcmp_present) {
540 /* Enable the GIC */ 571 /* Enable the GIC */
541 i = REG(_msc01_biu_base, MSC01_SC_CFG); 572 i = REG(_msc01_biu_base, MSC01_SC_CFG);
@@ -543,7 +574,7 @@ void __init arch_init_irq(void)
543 (i | (0x1 << MSC01_SC_CFG_GICENA_SHF)); 574 (i | (0x1 << MSC01_SC_CFG_GICENA_SHF));
544 pr_debug("GIC Enabled\n"); 575 pr_debug("GIC Enabled\n");
545 } 576 }
546 577#if defined(CONFIG_MIPS_MT_SMP)
547 /* set up ipi interrupts */ 578 /* set up ipi interrupts */
548 if (cpu_has_vint) { 579 if (cpu_has_vint) {
549 set_vi_handler(MIPSCPU_INT_IPI0, malta_ipi_irqdispatch); 580 set_vi_handler(MIPSCPU_INT_IPI0, malta_ipi_irqdispatch);
@@ -556,16 +587,14 @@ void __init arch_init_irq(void)
556 write_c0_status(0x1100dc00); 587 write_c0_status(0x1100dc00);
557 printk("CPU%d: status register frc %08x\n", smp_processor_id(), read_c0_status()); 588 printk("CPU%d: status register frc %08x\n", smp_processor_id(), read_c0_status());
558 for (i = 0; i < NR_CPUS; i++) { 589 for (i = 0; i < NR_CPUS; i++) {
559 setup_irq(MIPS_GIC_IRQ_BASE + 590 arch_init_ipiirq(MIPS_GIC_IRQ_BASE +
560 GIC_RESCHED_INT(i), &irq_resched); 591 GIC_RESCHED_INT(i), &irq_resched);
561 setup_irq(MIPS_GIC_IRQ_BASE + 592 arch_init_ipiirq(MIPS_GIC_IRQ_BASE +
562 GIC_CALL_INT(i), &irq_call); 593 GIC_CALL_INT(i), &irq_call);
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);
567 } 594 }
595#endif
568 } else { 596 } else {
597#if defined(CONFIG_MIPS_MT_SMP)
569 /* set up ipi interrupts */ 598 /* set up ipi interrupts */
570 if (cpu_has_veic) { 599 if (cpu_has_veic) {
571 set_vi_handler (MSC01E_INT_SW0, ipi_resched_dispatch); 600 set_vi_handler (MSC01E_INT_SW0, ipi_resched_dispatch);
@@ -580,14 +609,10 @@ void __init arch_init_irq(void)
580 cpu_ipi_resched_irq = MIPS_CPU_IRQ_BASE + MIPS_CPU_IPI_RESCHED_IRQ; 609 cpu_ipi_resched_irq = MIPS_CPU_IRQ_BASE + MIPS_CPU_IPI_RESCHED_IRQ;
581 cpu_ipi_call_irq = MIPS_CPU_IRQ_BASE + MIPS_CPU_IPI_CALL_IRQ; 610 cpu_ipi_call_irq = MIPS_CPU_IRQ_BASE + MIPS_CPU_IPI_CALL_IRQ;
582 } 611 }
583 612 arch_init_ipiirq(cpu_ipi_resched_irq, &irq_resched);
584 setup_irq(cpu_ipi_resched_irq, &irq_resched); 613 arch_init_ipiirq(cpu_ipi_call_irq, &irq_call);
585 setup_irq(cpu_ipi_call_irq, &irq_call);
586
587 set_irq_handler(cpu_ipi_resched_irq, handle_percpu_irq);
588 set_irq_handler(cpu_ipi_call_irq, handle_percpu_irq);
589 }
590#endif 614#endif
615 }
591} 616}
592 617
593void malta_be_init(void) 618void malta_be_init(void)
diff --git a/arch/mips/mti-malta/malta-memory.c b/arch/mips/mti-malta/malta-memory.c
index 61888ff72c87..9035c64bc5ed 100644
--- a/arch/mips/mti-malta/malta-memory.c
+++ b/arch/mips/mti-malta/malta-memory.c
@@ -54,7 +54,8 @@ static struct prom_pmemblock * __init prom_getmdesc(void)
54{ 54{
55 char *memsize_str; 55 char *memsize_str;
56 unsigned int memsize; 56 unsigned int memsize;
57 char cmdline[CL_SIZE], *ptr; 57 char *ptr;
58 static char cmdline[CL_SIZE] __initdata;
58 59
59 /* otherwise look in the environment */ 60 /* otherwise look in the environment */
60 memsize_str = prom_getenv("memsize"); 61 memsize_str = prom_getenv("memsize");
diff --git a/arch/mips/mti-malta/malta-pci.c b/arch/mips/mti-malta/malta-pci.c
index b9743190609a..2fbfa1a8c3a9 100644
--- a/arch/mips/mti-malta/malta-pci.c
+++ b/arch/mips/mti-malta/malta-pci.c
@@ -27,7 +27,7 @@
27#include <linux/init.h> 27#include <linux/init.h>
28 28
29#include <asm/gt64120.h> 29#include <asm/gt64120.h>
30 30#include <asm/gcmpregs.h>
31#include <asm/mips-boards/generic.h> 31#include <asm/mips-boards/generic.h>
32#include <asm/mips-boards/bonito64.h> 32#include <asm/mips-boards/bonito64.h>
33#include <asm/mips-boards/msc01_pci.h> 33#include <asm/mips-boards/msc01_pci.h>
@@ -201,7 +201,11 @@ void __init mips_pcibios_init(void)
201 msc_mem_resource.start = start & mask; 201 msc_mem_resource.start = start & mask;
202 msc_mem_resource.end = (start & mask) | ~mask; 202 msc_mem_resource.end = (start & mask) | ~mask;
203 msc_controller.mem_offset = (start & mask) - (map & mask); 203 msc_controller.mem_offset = (start & mask) - (map & mask);
204 204#ifdef CONFIG_MIPS_CMP
205 if (gcmp_niocu())
206 gcmp_setregion(0, start, mask,
207 GCMP_GCB_GCMPB_CMDEFTGT_IOCU1);
208#endif
205 MSC_READ(MSC01_PCI_SC2PIOBASL, start); 209 MSC_READ(MSC01_PCI_SC2PIOBASL, start);
206 MSC_READ(MSC01_PCI_SC2PIOMSKL, mask); 210 MSC_READ(MSC01_PCI_SC2PIOMSKL, mask);
207 MSC_READ(MSC01_PCI_SC2PIOMAPL, map); 211 MSC_READ(MSC01_PCI_SC2PIOMAPL, map);
@@ -209,7 +213,11 @@ void __init mips_pcibios_init(void)
209 msc_io_resource.end = (map & mask) | ~mask; 213 msc_io_resource.end = (map & mask) | ~mask;
210 msc_controller.io_offset = 0; 214 msc_controller.io_offset = 0;
211 ioport_resource.end = ~mask; 215 ioport_resource.end = ~mask;
212 216#ifdef CONFIG_MIPS_CMP
217 if (gcmp_niocu())
218 gcmp_setregion(1, start, mask,
219 GCMP_GCB_GCMPB_CMDEFTGT_IOCU1);
220#endif
213 /* If ranges overlap I/O takes precedence. */ 221 /* If ranges overlap I/O takes precedence. */
214 start = start & mask; 222 start = start & mask;
215 end = start | ~mask; 223 end = start | ~mask;
@@ -241,3 +249,16 @@ void __init mips_pcibios_init(void)
241 249
242 register_pci_controller(controller); 250 register_pci_controller(controller);
243} 251}
252
253/* Enable PCI 2.1 compatibility in PIIX4 */
254static void __init quirk_dlcsetup(struct pci_dev *dev)
255{
256 u8 odlc, ndlc;
257 (void) pci_read_config_byte(dev, 0x82, &odlc);
258 /* Enable passive releases and delayed transaction */
259 ndlc = odlc | 7;
260 (void) pci_write_config_byte(dev, 0x82, ndlc);
261}
262
263DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82371AB_0,
264 quirk_dlcsetup);
diff --git a/arch/mips/nxp/pnx8550/common/int.c b/arch/mips/nxp/pnx8550/common/int.c
index f080f114a1bf..7aca7d5375e5 100644
--- a/arch/mips/nxp/pnx8550/common/int.c
+++ b/arch/mips/nxp/pnx8550/common/int.c
@@ -172,7 +172,7 @@ static struct irqaction gic_action = {
172 172
173static struct irqaction timer_action = { 173static struct irqaction timer_action = {
174 .handler = no_action, 174 .handler = no_action,
175 .flags = IRQF_DISABLED, 175 .flags = IRQF_DISABLED | IRQF_TIMER,
176 .name = "Timer", 176 .name = "Timer",
177}; 177};
178 178
diff --git a/arch/mips/nxp/pnx8550/common/time.c b/arch/mips/nxp/pnx8550/common/time.c
index 18b192784877..8836c6203df0 100644
--- a/arch/mips/nxp/pnx8550/common/time.c
+++ b/arch/mips/nxp/pnx8550/common/time.c
@@ -59,7 +59,7 @@ static irqreturn_t pnx8xxx_timer_interrupt(int irq, void *dev_id)
59 59
60static struct irqaction pnx8xxx_timer_irq = { 60static struct irqaction pnx8xxx_timer_irq = {
61 .handler = pnx8xxx_timer_interrupt, 61 .handler = pnx8xxx_timer_interrupt,
62 .flags = IRQF_DISABLED | IRQF_PERCPU, 62 .flags = IRQF_DISABLED | IRQF_PERCPU | IRQF_TIMER,
63 .name = "pnx8xxx_timer", 63 .name = "pnx8xxx_timer",
64}; 64};
65 65
@@ -72,7 +72,7 @@ static irqreturn_t monotonic_interrupt(int irq, void *dev_id)
72 72
73static struct irqaction monotonic_irqaction = { 73static struct irqaction monotonic_irqaction = {
74 .handler = monotonic_interrupt, 74 .handler = monotonic_interrupt,
75 .flags = IRQF_DISABLED, 75 .flags = IRQF_DISABLED | IRQF_TIMER,
76 .name = "Monotonic timer", 76 .name = "Monotonic timer",
77}; 77};
78 78
diff --git a/arch/mips/oprofile/op_model_loongson2.c b/arch/mips/oprofile/op_model_loongson2.c
index deed1d5d4982..575cd1473475 100644
--- a/arch/mips/oprofile/op_model_loongson2.c
+++ b/arch/mips/oprofile/op_model_loongson2.c
@@ -22,7 +22,7 @@
22 * otherwise, the oprofile tool will not recognize this and complain about 22 * otherwise, the oprofile tool will not recognize this and complain about
23 * "cpu_type 'unset' is not valid". 23 * "cpu_type 'unset' is not valid".
24 */ 24 */
25#define LOONGSON2_CPU_TYPE "mips/godson2" 25#define LOONGSON2_CPU_TYPE "mips/loongson2"
26 26
27#define LOONGSON2_COUNTER1_EVENT(event) ((event & 0x0f) << 5) 27#define LOONGSON2_COUNTER1_EVENT(event) ((event & 0x0f) << 5)
28#define LOONGSON2_COUNTER2_EVENT(event) ((event & 0x0f) << 9) 28#define LOONGSON2_COUNTER2_EVENT(event) ((event & 0x0f) << 9)
diff --git a/arch/mips/rb532/devices.c b/arch/mips/rb532/devices.c
index 9f40e1ff9b4f..041fc1afc3f4 100644
--- a/arch/mips/rb532/devices.c
+++ b/arch/mips/rb532/devices.c
@@ -110,7 +110,6 @@ static struct korina_device korina_dev0_data = {
110static struct platform_device korina_dev0 = { 110static struct platform_device korina_dev0 = {
111 .id = -1, 111 .id = -1,
112 .name = "korina", 112 .name = "korina",
113 .dev.driver_data = &korina_dev0_data,
114 .resource = korina_dev0_res, 113 .resource = korina_dev0_res,
115 .num_resources = ARRAY_SIZE(korina_dev0_res), 114 .num_resources = ARRAY_SIZE(korina_dev0_res),
116}; 115};
@@ -332,6 +331,8 @@ static int __init plat_setup_devices(void)
332 /* set the uart clock to the current cpu frequency */ 331 /* set the uart clock to the current cpu frequency */
333 rb532_uart_res[0].uartclk = idt_cpu_freq; 332 rb532_uart_res[0].uartclk = idt_cpu_freq;
334 333
334 dev_set_drvdata(&korina_dev0.dev, &korina_dev0_data);
335
335 return platform_add_devices(rb532_devs, ARRAY_SIZE(rb532_devs)); 336 return platform_add_devices(rb532_devs, ARRAY_SIZE(rb532_devs));
336} 337}
337 338
diff --git a/arch/mips/rb532/prom.c b/arch/mips/rb532/prom.c
index 46ca24dbcc2d..ad5bd1097974 100644
--- a/arch/mips/rb532/prom.c
+++ b/arch/mips/rb532/prom.c
@@ -69,7 +69,7 @@ static inline unsigned long tag2ul(char *arg, const char *tag)
69 69
70void __init prom_setup_cmdline(void) 70void __init prom_setup_cmdline(void)
71{ 71{
72 char cmd_line[CL_SIZE]; 72 static char cmd_line[CL_SIZE] __initdata;
73 char *cp, *board; 73 char *cp, *board;
74 int prom_argc; 74 int prom_argc;
75 char **prom_argv, **prom_envp; 75 char **prom_argv, **prom_envp;
diff --git a/arch/mips/sgi-ip27/ip27-timer.c b/arch/mips/sgi-ip27/ip27-timer.c
index 6d0e59ffba2e..d6802d6d1f82 100644
--- a/arch/mips/sgi-ip27/ip27-timer.c
+++ b/arch/mips/sgi-ip27/ip27-timer.c
@@ -105,7 +105,7 @@ static irqreturn_t hub_rt_counter_handler(int irq, void *dev_id)
105 105
106struct irqaction hub_rt_irqaction = { 106struct irqaction hub_rt_irqaction = {
107 .handler = hub_rt_counter_handler, 107 .handler = hub_rt_counter_handler,
108 .flags = IRQF_DISABLED | IRQF_PERCPU, 108 .flags = IRQF_DISABLED | IRQF_PERCPU | IRQF_TIMER,
109 .name = "hub-rt", 109 .name = "hub-rt",
110}; 110};
111 111
diff --git a/arch/mips/sni/time.c b/arch/mips/sni/time.c
index 62df6a598e0a..f3b60e671207 100644
--- a/arch/mips/sni/time.c
+++ b/arch/mips/sni/time.c
@@ -67,7 +67,7 @@ static irqreturn_t a20r_interrupt(int irq, void *dev_id)
67 67
68static struct irqaction a20r_irqaction = { 68static struct irqaction a20r_irqaction = {
69 .handler = a20r_interrupt, 69 .handler = a20r_interrupt,
70 .flags = IRQF_DISABLED | IRQF_PERCPU, 70 .flags = IRQF_DISABLED | IRQF_PERCPU | IRQF_TIMER,
71 .name = "a20r-timer", 71 .name = "a20r-timer",
72}; 72};
73 73
diff --git a/arch/mips/txx9/generic/setup.c b/arch/mips/txx9/generic/setup.c
index c860810722c0..d66802edebb2 100644
--- a/arch/mips/txx9/generic/setup.c
+++ b/arch/mips/txx9/generic/setup.c
@@ -85,7 +85,7 @@ int txx9_ccfg_toeon __initdata = 1;
85struct clk *clk_get(struct device *dev, const char *id) 85struct clk *clk_get(struct device *dev, const char *id)
86{ 86{
87 if (!strcmp(id, "spi-baseclk")) 87 if (!strcmp(id, "spi-baseclk"))
88 return (struct clk *)((unsigned long)txx9_gbus_clock / 2 / 4); 88 return (struct clk *)((unsigned long)txx9_gbus_clock / 2 / 2);
89 if (!strcmp(id, "imbus_clk")) 89 if (!strcmp(id, "imbus_clk"))
90 return (struct clk *)((unsigned long)txx9_gbus_clock / 2); 90 return (struct clk *)((unsigned long)txx9_gbus_clock / 2);
91 return ERR_PTR(-ENOENT); 91 return ERR_PTR(-ENOENT);
@@ -160,7 +160,7 @@ static void __init prom_init_cmdline(void)
160 int argc; 160 int argc;
161 int *argv32; 161 int *argv32;
162 int i; /* Always ignore the "-c" at argv[0] */ 162 int i; /* Always ignore the "-c" at argv[0] */
163 char builtin[CL_SIZE]; 163 static char builtin[CL_SIZE] __initdata;
164 164
165 if (fw_arg0 >= CKSEG0 || fw_arg1 < CKSEG0) { 165 if (fw_arg0 >= CKSEG0 || fw_arg1 < CKSEG0) {
166 /* 166 /*
@@ -315,7 +315,7 @@ static inline void txx9_cache_fixup(void)
315 315
316static void __init preprocess_cmdline(void) 316static void __init preprocess_cmdline(void)
317{ 317{
318 char cmdline[CL_SIZE]; 318 static char cmdline[CL_SIZE] __initdata;
319 char *s; 319 char *s;
320 320
321 strcpy(cmdline, arcs_cmdline); 321 strcpy(cmdline, arcs_cmdline);
@@ -817,7 +817,8 @@ void __init txx9_iocled_init(unsigned long baseaddr,
817out_pdev: 817out_pdev:
818 platform_device_put(pdev); 818 platform_device_put(pdev);
819out_gpio: 819out_gpio:
820 gpio_remove(&iocled->chip); 820 if (gpiochip_remove(&iocled->chip))
821 return;
821out_unmap: 822out_unmap:
822 iounmap(iocled->mmioaddr); 823 iounmap(iocled->mmioaddr);
823out_free: 824out_free:
diff --git a/arch/parisc/include/asm/fcntl.h b/arch/parisc/include/asm/fcntl.h
index 5f39d5597ced..1e1c824764ee 100644
--- a/arch/parisc/include/asm/fcntl.h
+++ b/arch/parisc/include/asm/fcntl.h
@@ -28,8 +28,6 @@
28#define F_SETOWN 12 /* for sockets. */ 28#define F_SETOWN 12 /* for sockets. */
29#define F_SETSIG 13 /* for sockets. */ 29#define F_SETSIG 13 /* for sockets. */
30#define F_GETSIG 14 /* for sockets. */ 30#define F_GETSIG 14 /* for sockets. */
31#define F_GETOWN_EX 15
32#define F_SETOWN_EX 16
33 31
34/* for posix fcntl() and lockf() */ 32/* for posix fcntl() and lockf() */
35#define F_RDLCK 01 33#define F_RDLCK 01
diff --git a/arch/parisc/kernel/unwind.c b/arch/parisc/kernel/unwind.c
index 69dad5a850a8..a36799e85693 100644
--- a/arch/parisc/kernel/unwind.c
+++ b/arch/parisc/kernel/unwind.c
@@ -28,7 +28,7 @@
28#define dbg(x...) 28#define dbg(x...)
29#endif 29#endif
30 30
31#define KERNEL_START (KERNEL_BINARY_TEXT_START - 0x1000) 31#define KERNEL_START (KERNEL_BINARY_TEXT_START)
32 32
33extern struct unwind_table_entry __start___unwind[]; 33extern struct unwind_table_entry __start___unwind[];
34extern struct unwind_table_entry __stop___unwind[]; 34extern struct unwind_table_entry __stop___unwind[];
diff --git a/arch/parisc/kernel/vmlinux.lds.S b/arch/parisc/kernel/vmlinux.lds.S
index fda4baa059b5..9dab4a4e09f7 100644
--- a/arch/parisc/kernel/vmlinux.lds.S
+++ b/arch/parisc/kernel/vmlinux.lds.S
@@ -78,9 +78,6 @@ SECTIONS
78 */ 78 */
79 . = ALIGN(PAGE_SIZE); 79 . = ALIGN(PAGE_SIZE);
80 data_start = .; 80 data_start = .;
81 EXCEPTION_TABLE(16)
82
83 NOTES
84 81
85 /* unwind info */ 82 /* unwind info */
86 .PARISC.unwind : { 83 .PARISC.unwind : {
@@ -89,6 +86,9 @@ SECTIONS
89 __stop___unwind = .; 86 __stop___unwind = .;
90 } 87 }
91 88
89 EXCEPTION_TABLE(16)
90 NOTES
91
92 /* Data */ 92 /* Data */
93 RW_DATA_SECTION(L1_CACHE_BYTES, PAGE_SIZE, THREAD_SIZE) 93 RW_DATA_SECTION(L1_CACHE_BYTES, PAGE_SIZE, THREAD_SIZE)
94 94
diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig
index 10a0a5488a44..2ba14e77296c 100644
--- a/arch/powerpc/Kconfig
+++ b/arch/powerpc/Kconfig
@@ -414,6 +414,10 @@ config ARCH_SPARSEMEM_DEFAULT
414config ARCH_POPULATES_NODE_MAP 414config ARCH_POPULATES_NODE_MAP
415 def_bool y 415 def_bool y
416 416
417config SYS_SUPPORTS_HUGETLBFS
418 def_bool y
419 depends on PPC_BOOK3S_64
420
417source "mm/Kconfig" 421source "mm/Kconfig"
418 422
419config ARCH_MEMORY_PROBE 423config ARCH_MEMORY_PROBE
diff --git a/arch/powerpc/Kconfig.debug b/arch/powerpc/Kconfig.debug
index 3b1005185390..bf3382f1904d 100644
--- a/arch/powerpc/Kconfig.debug
+++ b/arch/powerpc/Kconfig.debug
@@ -46,7 +46,7 @@ config DEBUG_STACK_USAGE
46 46
47config HCALL_STATS 47config HCALL_STATS
48 bool "Hypervisor call instrumentation" 48 bool "Hypervisor call instrumentation"
49 depends on PPC_PSERIES && DEBUG_FS 49 depends on PPC_PSERIES && DEBUG_FS && TRACEPOINTS
50 help 50 help
51 Adds code to keep track of the number of hypervisor calls made and 51 Adds code to keep track of the number of hypervisor calls made and
52 the amount of time spent in hypervisor calls. Wall time spent in 52 the amount of time spent in hypervisor calls. Wall time spent in
diff --git a/arch/powerpc/boot/addRamDisk.c b/arch/powerpc/boot/addRamDisk.c
index c02a99952be7..893f446cbd22 100644
--- a/arch/powerpc/boot/addRamDisk.c
+++ b/arch/powerpc/boot/addRamDisk.c
@@ -58,7 +58,7 @@ static int check_elf64(void *p, int size, struct addr_range *r)
58 58
59 return 64; 59 return 64;
60} 60}
61void get4k(FILE *file, char *buf ) 61static void get4k(FILE *file, char *buf )
62{ 62{
63 unsigned j; 63 unsigned j;
64 unsigned num = fread(buf, 1, 4096, file); 64 unsigned num = fread(buf, 1, 4096, file);
@@ -66,12 +66,12 @@ void get4k(FILE *file, char *buf )
66 buf[j] = 0; 66 buf[j] = 0;
67} 67}
68 68
69void put4k(FILE *file, char *buf ) 69static void put4k(FILE *file, char *buf )
70{ 70{
71 fwrite(buf, 1, 4096, file); 71 fwrite(buf, 1, 4096, file);
72} 72}
73 73
74void death(const char *msg, FILE *fdesc, const char *fname) 74static void death(const char *msg, FILE *fdesc, const char *fname)
75{ 75{
76 fprintf(stderr, msg); 76 fprintf(stderr, msg);
77 fclose(fdesc); 77 fclose(fdesc);
diff --git a/arch/powerpc/boot/dts/mpc8377_wlan.dts b/arch/powerpc/boot/dts/mpc8377_wlan.dts
index 9a603695723b..9ea783056969 100644
--- a/arch/powerpc/boot/dts/mpc8377_wlan.dts
+++ b/arch/powerpc/boot/dts/mpc8377_wlan.dts
@@ -67,7 +67,7 @@
67 device-width = <1>; 67 device-width = <1>;
68 68
69 partition@0 { 69 partition@0 {
70 reg = <0 0x8000>; 70 reg = <0 0x80000>;
71 label = "u-boot"; 71 label = "u-boot";
72 read-only; 72 read-only;
73 }; 73 };
diff --git a/arch/powerpc/boot/dts/mpc8569mds.dts b/arch/powerpc/boot/dts/mpc8569mds.dts
index 06332d61830a..1e3ec8f059bf 100644
--- a/arch/powerpc/boot/dts/mpc8569mds.dts
+++ b/arch/powerpc/boot/dts/mpc8569mds.dts
@@ -487,8 +487,8 @@
487 &qe_pio_f 5 0 /* USBTN */ 487 &qe_pio_f 5 0 /* USBTN */
488 &qe_pio_f 6 0 /* USBRP */ 488 &qe_pio_f 6 0 /* USBRP */
489 &qe_pio_f 8 0 /* USBRN */ 489 &qe_pio_f 8 0 /* USBRN */
490 &bcsr17 6 0 /* SPEED */ 490 &bcsr17 1 0 /* SPEED */
491 &bcsr17 5 1>; /* POWER */ 491 &bcsr17 2 0>; /* POWER */
492 }; 492 };
493 493
494 enet0: ucc@2000 { 494 enet0: ucc@2000 {
diff --git a/arch/powerpc/boot/dts/sbc8548.dts b/arch/powerpc/boot/dts/sbc8548.dts
index 9eefe00ed253..94a332251710 100644
--- a/arch/powerpc/boot/dts/sbc8548.dts
+++ b/arch/powerpc/boot/dts/sbc8548.dts
@@ -26,8 +26,7 @@
26 serial0 = &serial0; 26 serial0 = &serial0;
27 serial1 = &serial1; 27 serial1 = &serial1;
28 pci0 = &pci0; 28 pci0 = &pci0;
29 /* pci1 doesn't have a corresponding physical connector */ 29 pci1 = &pci1;
30 pci2 = &pci2;
31 }; 30 };
32 31
33 cpus { 32 cpus {
@@ -381,7 +380,7 @@
381 bus-range = <0 0>; 380 bus-range = <0 0>;
382 ranges = <0x02000000 0x0 0x80000000 0x80000000 0x0 0x10000000 381 ranges = <0x02000000 0x0 0x80000000 0x80000000 0x0 0x10000000
383 0x01000000 0x0 0x00000000 0xe2000000 0x0 0x00800000>; 382 0x01000000 0x0 0x00000000 0xe2000000 0x0 0x00800000>;
384 clock-frequency = <66666666>; 383 clock-frequency = <66000000>;
385 #interrupt-cells = <1>; 384 #interrupt-cells = <1>;
386 #size-cells = <2>; 385 #size-cells = <2>;
387 #address-cells = <3>; 386 #address-cells = <3>;
@@ -390,7 +389,7 @@
390 device_type = "pci"; 389 device_type = "pci";
391 }; 390 };
392 391
393 pci2: pcie@e000a000 { 392 pci1: pcie@e000a000 {
394 interrupt-map-mask = <0xf800 0x0 0x0 0x7>; 393 interrupt-map-mask = <0xf800 0x0 0x0 0x7>;
395 interrupt-map = < 394 interrupt-map = <
396 395
@@ -403,9 +402,9 @@
403 interrupt-parent = <&mpic>; 402 interrupt-parent = <&mpic>;
404 interrupts = <0x1a 0x2>; 403 interrupts = <0x1a 0x2>;
405 bus-range = <0x0 0xff>; 404 bus-range = <0x0 0xff>;
406 ranges = <0x02000000 0x0 0xa0000000 0xa0000000 0x0 0x20000000 405 ranges = <0x02000000 0x0 0xa0000000 0xa0000000 0x0 0x10000000
407 0x01000000 0x0 0x00000000 0xe3000000 0x0 0x08000000>; 406 0x01000000 0x0 0x00000000 0xe2800000 0x0 0x08000000>;
408 clock-frequency = <33333333>; 407 clock-frequency = <33000000>;
409 #interrupt-cells = <1>; 408 #interrupt-cells = <1>;
410 #size-cells = <2>; 409 #size-cells = <2>;
411 #address-cells = <3>; 410 #address-cells = <3>;
@@ -419,11 +418,11 @@
419 device_type = "pci"; 418 device_type = "pci";
420 ranges = <0x02000000 0x0 0xa0000000 419 ranges = <0x02000000 0x0 0xa0000000
421 0x02000000 0x0 0xa0000000 420 0x02000000 0x0 0xa0000000
422 0x0 0x20000000 421 0x0 0x10000000
423 422
424 0x01000000 0x0 0x00000000 423 0x01000000 0x0 0x00000000
425 0x01000000 0x0 0x00000000 424 0x01000000 0x0 0x00000000
426 0x0 0x08000000>; 425 0x0 0x00800000>;
427 }; 426 };
428 }; 427 };
429}; 428};
diff --git a/arch/powerpc/configs/83xx/asp8347_defconfig b/arch/powerpc/configs/83xx/asp8347_defconfig
index a2df0635b6de..466f09ac3153 100644
--- a/arch/powerpc/configs/83xx/asp8347_defconfig
+++ b/arch/powerpc/configs/83xx/asp8347_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.31-rc4 3# Linux kernel version: 2.6.32-rc5
4# Wed Jul 29 23:32:02 2009 4# Thu Nov 5 08:20:20 2009
5# 5#
6# CONFIG_PPC64 is not set 6# CONFIG_PPC64 is not set
7 7
@@ -35,6 +35,7 @@ CONFIG_GENERIC_CLOCKEVENTS=y
35CONFIG_GENERIC_HARDIRQS=y 35CONFIG_GENERIC_HARDIRQS=y
36CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y 36CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y
37# CONFIG_HAVE_SETUP_PER_CPU_AREA is not set 37# CONFIG_HAVE_SETUP_PER_CPU_AREA is not set
38# CONFIG_NEED_PER_CPU_EMBED_FIRST_CHUNK 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
@@ -85,11 +86,12 @@ CONFIG_SYSVIPC_SYSCTL=y
85# 86#
86# RCU Subsystem 87# RCU Subsystem
87# 88#
88CONFIG_CLASSIC_RCU=y 89CONFIG_TREE_RCU=y
89# CONFIG_TREE_RCU is not set 90# CONFIG_TREE_PREEMPT_RCU is not set
90# CONFIG_PREEMPT_RCU is not set 91# CONFIG_RCU_TRACE is not set
92CONFIG_RCU_FANOUT=32
93# CONFIG_RCU_FANOUT_EXACT is not set
91# CONFIG_TREE_RCU_TRACE is not set 94# CONFIG_TREE_RCU_TRACE is not set
92# CONFIG_PREEMPT_RCU_TRACE is not set
93# CONFIG_IKCONFIG is not set 95# CONFIG_IKCONFIG is not set
94CONFIG_LOG_BUF_SHIFT=14 96CONFIG_LOG_BUF_SHIFT=14
95CONFIG_GROUP_SCHED=y 97CONFIG_GROUP_SCHED=y
@@ -125,28 +127,29 @@ CONFIG_TIMERFD=y
125CONFIG_EVENTFD=y 127CONFIG_EVENTFD=y
126CONFIG_SHMEM=y 128CONFIG_SHMEM=y
127CONFIG_AIO=y 129CONFIG_AIO=y
128CONFIG_HAVE_PERF_COUNTERS=y 130CONFIG_HAVE_PERF_EVENTS=y
129 131
130# 132#
131# Performance Counters 133# Kernel Performance Events And Counters
132# 134#
135# CONFIG_PERF_EVENTS is not set
133# CONFIG_PERF_COUNTERS is not set 136# CONFIG_PERF_COUNTERS is not set
134CONFIG_VM_EVENT_COUNTERS=y 137CONFIG_VM_EVENT_COUNTERS=y
135CONFIG_PCI_QUIRKS=y 138CONFIG_PCI_QUIRKS=y
136CONFIG_SLUB_DEBUG=y 139CONFIG_SLUB_DEBUG=y
137# CONFIG_STRIP_ASM_SYMS is not set
138CONFIG_COMPAT_BRK=y 140CONFIG_COMPAT_BRK=y
139# CONFIG_SLAB is not set 141# CONFIG_SLAB is not set
140CONFIG_SLUB=y 142CONFIG_SLUB=y
141# CONFIG_SLOB is not set 143# CONFIG_SLOB is not set
142# CONFIG_PROFILING is not set 144# CONFIG_PROFILING is not set
143# CONFIG_MARKERS is not set
144CONFIG_HAVE_OPROFILE=y 145CONFIG_HAVE_OPROFILE=y
145CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS=y 146CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS=y
146CONFIG_HAVE_IOREMAP_PROT=y 147CONFIG_HAVE_IOREMAP_PROT=y
147CONFIG_HAVE_KPROBES=y 148CONFIG_HAVE_KPROBES=y
148CONFIG_HAVE_KRETPROBES=y 149CONFIG_HAVE_KRETPROBES=y
149CONFIG_HAVE_ARCH_TRACEHOOK=y 150CONFIG_HAVE_ARCH_TRACEHOOK=y
151CONFIG_HAVE_DMA_ATTRS=y
152CONFIG_HAVE_DMA_API_DEBUG=y
150 153
151# 154#
152# GCOV-based kernel profiling 155# GCOV-based kernel profiling
@@ -257,6 +260,7 @@ CONFIG_ARCH_HAS_WALK_MEMORY=y
257CONFIG_ARCH_ENABLE_MEMORY_HOTREMOVE=y 260CONFIG_ARCH_ENABLE_MEMORY_HOTREMOVE=y
258# CONFIG_KEXEC is not set 261# CONFIG_KEXEC is not set
259# CONFIG_CRASH_DUMP is not set 262# CONFIG_CRASH_DUMP is not set
263CONFIG_MAX_ACTIVE_REGIONS=32
260CONFIG_ARCH_FLATMEM_ENABLE=y 264CONFIG_ARCH_FLATMEM_ENABLE=y
261CONFIG_ARCH_POPULATES_NODE_MAP=y 265CONFIG_ARCH_POPULATES_NODE_MAP=y
262CONFIG_SELECT_MEMORY_MODEL=y 266CONFIG_SELECT_MEMORY_MODEL=y
@@ -274,6 +278,7 @@ CONFIG_BOUNCE=y
274CONFIG_VIRT_TO_BUS=y 278CONFIG_VIRT_TO_BUS=y
275CONFIG_HAVE_MLOCK=y 279CONFIG_HAVE_MLOCK=y
276CONFIG_HAVE_MLOCKED_PAGE_BIT=y 280CONFIG_HAVE_MLOCKED_PAGE_BIT=y
281# CONFIG_KSM is not set
277CONFIG_DEFAULT_MMAP_MIN_ADDR=4096 282CONFIG_DEFAULT_MMAP_MIN_ADDR=4096
278CONFIG_PPC_4K_PAGES=y 283CONFIG_PPC_4K_PAGES=y
279# CONFIG_PPC_16K_PAGES is not set 284# CONFIG_PPC_16K_PAGES is not set
@@ -369,6 +374,7 @@ CONFIG_DEFAULT_TCP_CONG="cubic"
369# CONFIG_NETFILTER is not set 374# CONFIG_NETFILTER is not set
370# CONFIG_IP_DCCP is not set 375# CONFIG_IP_DCCP is not set
371# CONFIG_IP_SCTP is not set 376# CONFIG_IP_SCTP is not set
377# CONFIG_RDS is not set
372# CONFIG_TIPC is not set 378# CONFIG_TIPC is not set
373# CONFIG_ATM is not set 379# CONFIG_ATM is not set
374# CONFIG_BRIDGE is not set 380# CONFIG_BRIDGE is not set
@@ -398,6 +404,7 @@ CONFIG_DEFAULT_TCP_CONG="cubic"
398# CONFIG_AF_RXRPC is not set 404# CONFIG_AF_RXRPC is not set
399CONFIG_WIRELESS=y 405CONFIG_WIRELESS=y
400# CONFIG_CFG80211 is not set 406# CONFIG_CFG80211 is not set
407CONFIG_CFG80211_DEFAULT_PS_VALUE=0
401CONFIG_WIRELESS_OLD_REGULATORY=y 408CONFIG_WIRELESS_OLD_REGULATORY=y
402# CONFIG_WIRELESS_EXT is not set 409# CONFIG_WIRELESS_EXT is not set
403# CONFIG_LIB80211 is not set 410# CONFIG_LIB80211 is not set
@@ -405,7 +412,6 @@ CONFIG_WIRELESS_OLD_REGULATORY=y
405# 412#
406# CFG80211 needs to be enabled for MAC80211 413# CFG80211 needs to be enabled for MAC80211
407# 414#
408CONFIG_MAC80211_DEFAULT_PS_VALUE=0
409# CONFIG_WIMAX is not set 415# CONFIG_WIMAX is not set
410# CONFIG_RFKILL is not set 416# CONFIG_RFKILL is not set
411# CONFIG_NET_9P is not set 417# CONFIG_NET_9P is not set
@@ -418,6 +424,7 @@ CONFIG_MAC80211_DEFAULT_PS_VALUE=0
418# Generic Driver Options 424# Generic Driver Options
419# 425#
420CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug" 426CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
427# CONFIG_DEVTMPFS is not set
421CONFIG_STANDALONE=y 428CONFIG_STANDALONE=y
422CONFIG_PREVENT_FIRMWARE_BUILD=y 429CONFIG_PREVENT_FIRMWARE_BUILD=y
423# CONFIG_FW_LOADER is not set 430# CONFIG_FW_LOADER is not set
@@ -425,9 +432,9 @@ CONFIG_PREVENT_FIRMWARE_BUILD=y
425# CONFIG_CONNECTOR is not set 432# CONFIG_CONNECTOR is not set
426CONFIG_MTD=y 433CONFIG_MTD=y
427# CONFIG_MTD_DEBUG is not set 434# CONFIG_MTD_DEBUG is not set
435# CONFIG_MTD_TESTS is not set
428# CONFIG_MTD_CONCAT is not set 436# CONFIG_MTD_CONCAT is not set
429CONFIG_MTD_PARTITIONS=y 437CONFIG_MTD_PARTITIONS=y
430# CONFIG_MTD_TESTS is not set
431CONFIG_MTD_REDBOOT_PARTS=y 438CONFIG_MTD_REDBOOT_PARTS=y
432CONFIG_MTD_REDBOOT_DIRECTORY_BLOCK=-1 439CONFIG_MTD_REDBOOT_DIRECTORY_BLOCK=-1
433CONFIG_MTD_REDBOOT_PARTS_UNALLOCATED=y 440CONFIG_MTD_REDBOOT_PARTS_UNALLOCATED=y
@@ -628,7 +635,9 @@ CONFIG_MII=y
628# CONFIG_NET_PCI is not set 635# CONFIG_NET_PCI is not set
629# CONFIG_B44 is not set 636# CONFIG_B44 is not set
630# CONFIG_KS8842 is not set 637# CONFIG_KS8842 is not set
638# CONFIG_KS8851_MLL is not set
631# CONFIG_ATL2 is not set 639# CONFIG_ATL2 is not set
640# CONFIG_XILINX_EMACLITE is not set
632CONFIG_NETDEV_1000=y 641CONFIG_NETDEV_1000=y
633# CONFIG_ACENIC is not set 642# CONFIG_ACENIC is not set
634# CONFIG_DL2K is not set 643# CONFIG_DL2K is not set
@@ -658,10 +667,7 @@ CONFIG_GIANFAR=y
658# CONFIG_JME is not set 667# CONFIG_JME is not set
659# CONFIG_NETDEV_10000 is not set 668# CONFIG_NETDEV_10000 is not set
660# CONFIG_TR is not set 669# CONFIG_TR is not set
661 670CONFIG_WLAN=y
662#
663# Wireless LAN
664#
665# CONFIG_WLAN_PRE80211 is not set 671# CONFIG_WLAN_PRE80211 is not set
666# CONFIG_WLAN_80211 is not set 672# CONFIG_WLAN_80211 is not set
667 673
@@ -760,6 +766,7 @@ CONFIG_LEGACY_PTY_COUNT=256
760CONFIG_DEVPORT=y 766CONFIG_DEVPORT=y
761CONFIG_I2C=y 767CONFIG_I2C=y
762CONFIG_I2C_BOARDINFO=y 768CONFIG_I2C_BOARDINFO=y
769CONFIG_I2C_COMPAT=y
763CONFIG_I2C_CHARDEV=y 770CONFIG_I2C_CHARDEV=y
764CONFIG_I2C_HELPER_AUTO=y 771CONFIG_I2C_HELPER_AUTO=y
765 772
@@ -814,9 +821,6 @@ CONFIG_I2C_MPC=y
814# Miscellaneous I2C Chip support 821# Miscellaneous I2C Chip support
815# 822#
816# CONFIG_DS1682 is not set 823# CONFIG_DS1682 is not set
817# CONFIG_SENSORS_PCF8574 is not set
818# CONFIG_PCF8575 is not set
819# CONFIG_SENSORS_PCA9539 is not set
820# CONFIG_SENSORS_TSL2550 is not set 824# CONFIG_SENSORS_TSL2550 is not set
821# CONFIG_I2C_DEBUG_CORE is not set 825# CONFIG_I2C_DEBUG_CORE is not set
822# CONFIG_I2C_DEBUG_ALGO is not set 826# CONFIG_I2C_DEBUG_ALGO is not set
@@ -834,6 +838,11 @@ CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y
834# CONFIG_POWER_SUPPLY is not set 838# CONFIG_POWER_SUPPLY is not set
835CONFIG_HWMON=y 839CONFIG_HWMON=y
836# CONFIG_HWMON_VID is not set 840# CONFIG_HWMON_VID is not set
841# CONFIG_HWMON_DEBUG_CHIP is not set
842
843#
844# Native drivers
845#
837# CONFIG_SENSORS_AD7414 is not set 846# CONFIG_SENSORS_AD7414 is not set
838# CONFIG_SENSORS_AD7418 is not set 847# CONFIG_SENSORS_AD7418 is not set
839# CONFIG_SENSORS_ADM1021 is not set 848# CONFIG_SENSORS_ADM1021 is not set
@@ -883,6 +892,7 @@ CONFIG_HWMON=y
883# CONFIG_SENSORS_ADS7828 is not set 892# CONFIG_SENSORS_ADS7828 is not set
884# CONFIG_SENSORS_THMC50 is not set 893# CONFIG_SENSORS_THMC50 is not set
885# CONFIG_SENSORS_TMP401 is not set 894# CONFIG_SENSORS_TMP401 is not set
895# CONFIG_SENSORS_TMP421 is not set
886# CONFIG_SENSORS_VIA686A is not set 896# CONFIG_SENSORS_VIA686A is not set
887# CONFIG_SENSORS_VT1211 is not set 897# CONFIG_SENSORS_VT1211 is not set
888# CONFIG_SENSORS_VT8231 is not set 898# CONFIG_SENSORS_VT8231 is not set
@@ -894,7 +904,6 @@ CONFIG_HWMON=y
894# CONFIG_SENSORS_W83L786NG is not set 904# CONFIG_SENSORS_W83L786NG is not set
895# CONFIG_SENSORS_W83627HF is not set 905# CONFIG_SENSORS_W83627HF is not set
896# CONFIG_SENSORS_W83627EHF is not set 906# CONFIG_SENSORS_W83627EHF is not set
897# CONFIG_HWMON_DEBUG_CHIP is not set
898CONFIG_THERMAL=y 907CONFIG_THERMAL=y
899# CONFIG_THERMAL_HWMON is not set 908# CONFIG_THERMAL_HWMON is not set
900CONFIG_WATCHDOG=y 909CONFIG_WATCHDOG=y
@@ -934,6 +943,7 @@ CONFIG_SSB_POSSIBLE=y
934# CONFIG_MFD_TMIO is not set 943# CONFIG_MFD_TMIO is not set
935# CONFIG_PMIC_DA903X is not set 944# CONFIG_PMIC_DA903X is not set
936# CONFIG_MFD_WM8400 is not set 945# CONFIG_MFD_WM8400 is not set
946# CONFIG_MFD_WM831X is not set
937# CONFIG_MFD_WM8350_I2C is not set 947# CONFIG_MFD_WM8350_I2C is not set
938# CONFIG_MFD_PCF50633 is not set 948# CONFIG_MFD_PCF50633 is not set
939# CONFIG_AB3100_CORE is not set 949# CONFIG_AB3100_CORE is not set
@@ -944,6 +954,7 @@ CONFIG_SSB_POSSIBLE=y
944# Graphics support 954# Graphics support
945# 955#
946# CONFIG_AGP is not set 956# CONFIG_AGP is not set
957CONFIG_VGA_ARB=y
947# CONFIG_DRM is not set 958# CONFIG_DRM is not set
948# CONFIG_VGASTATE is not set 959# CONFIG_VGASTATE is not set
949CONFIG_VIDEO_OUTPUT_CONTROL=m 960CONFIG_VIDEO_OUTPUT_CONTROL=m
@@ -990,6 +1001,7 @@ CONFIG_USB_EHCI_HCD_PPC_OF=y
990# CONFIG_USB_OXU210HP_HCD is not set 1001# CONFIG_USB_OXU210HP_HCD is not set
991# CONFIG_USB_ISP116X_HCD is not set 1002# CONFIG_USB_ISP116X_HCD is not set
992# CONFIG_USB_ISP1760_HCD is not set 1003# CONFIG_USB_ISP1760_HCD is not set
1004# CONFIG_USB_ISP1362_HCD is not set
993# CONFIG_USB_OHCI_HCD is not set 1005# CONFIG_USB_OHCI_HCD is not set
994# CONFIG_USB_UHCI_HCD is not set 1006# CONFIG_USB_UHCI_HCD is not set
995# CONFIG_USB_SL811_HCD is not set 1007# CONFIG_USB_SL811_HCD is not set
@@ -1045,6 +1057,7 @@ CONFIG_USB_EHCI_HCD_PPC_OF=y
1045# CONFIG_USB_LD is not set 1057# CONFIG_USB_LD is not set
1046# CONFIG_USB_TRANCEVIBRATOR is not set 1058# CONFIG_USB_TRANCEVIBRATOR is not set
1047# CONFIG_USB_IOWARRIOR is not set 1059# CONFIG_USB_IOWARRIOR is not set
1060# CONFIG_USB_TEST is not set
1048# CONFIG_USB_ISIGHTFW is not set 1061# CONFIG_USB_ISIGHTFW is not set
1049# CONFIG_USB_VST is not set 1062# CONFIG_USB_VST is not set
1050# CONFIG_USB_GADGET is not set 1063# CONFIG_USB_GADGET is not set
@@ -1146,6 +1159,7 @@ CONFIG_FS_MBCACHE=y
1146# CONFIG_GFS2_FS is not set 1159# CONFIG_GFS2_FS is not set
1147# CONFIG_OCFS2_FS is not set 1160# CONFIG_OCFS2_FS is not set
1148# CONFIG_BTRFS_FS is not set 1161# CONFIG_BTRFS_FS is not set
1162# CONFIG_NILFS2_FS is not set
1149CONFIG_FILE_LOCKING=y 1163CONFIG_FILE_LOCKING=y
1150CONFIG_FSNOTIFY=y 1164CONFIG_FSNOTIFY=y
1151CONFIG_DNOTIFY=y 1165CONFIG_DNOTIFY=y
@@ -1215,7 +1229,6 @@ CONFIG_JFFS2_RTIME=y
1215# CONFIG_ROMFS_FS is not set 1229# CONFIG_ROMFS_FS is not set
1216# CONFIG_SYSV_FS is not set 1230# CONFIG_SYSV_FS is not set
1217# CONFIG_UFS_FS is not set 1231# CONFIG_UFS_FS is not set
1218# CONFIG_NILFS2_FS is not set
1219CONFIG_NETWORK_FILESYSTEMS=y 1232CONFIG_NETWORK_FILESYSTEMS=y
1220CONFIG_NFS_FS=y 1233CONFIG_NFS_FS=y
1221CONFIG_NFS_V3=y 1234CONFIG_NFS_V3=y
@@ -1327,6 +1340,7 @@ CONFIG_ENABLE_WARN_DEPRECATED=y
1327CONFIG_ENABLE_MUST_CHECK=y 1340CONFIG_ENABLE_MUST_CHECK=y
1328CONFIG_FRAME_WARN=1024 1341CONFIG_FRAME_WARN=1024
1329# CONFIG_MAGIC_SYSRQ is not set 1342# CONFIG_MAGIC_SYSRQ is not set
1343# CONFIG_STRIP_ASM_SYMS is not set
1330# CONFIG_UNUSED_SYMBOLS is not set 1344# CONFIG_UNUSED_SYMBOLS is not set
1331# CONFIG_DEBUG_FS is not set 1345# CONFIG_DEBUG_FS is not set
1332# CONFIG_HEADERS_CHECK is not set 1346# CONFIG_HEADERS_CHECK is not set
@@ -1344,6 +1358,7 @@ CONFIG_HAVE_DYNAMIC_FTRACE=y
1344CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y 1358CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y
1345CONFIG_TRACING_SUPPORT=y 1359CONFIG_TRACING_SUPPORT=y
1346# CONFIG_FTRACE is not set 1360# CONFIG_FTRACE is not set
1361# CONFIG_DMA_API_DEBUG is not set
1347# CONFIG_SAMPLES is not set 1362# CONFIG_SAMPLES is not set
1348CONFIG_HAVE_ARCH_KGDB=y 1363CONFIG_HAVE_ARCH_KGDB=y
1349# CONFIG_PPC_DISABLE_WERROR is not set 1364# CONFIG_PPC_DISABLE_WERROR is not set
@@ -1365,7 +1380,6 @@ CONFIG_CRYPTO=y
1365# 1380#
1366# Crypto core or helper 1381# Crypto core or helper
1367# 1382#
1368# CONFIG_CRYPTO_FIPS is not set
1369CONFIG_CRYPTO_ALGAPI=y 1383CONFIG_CRYPTO_ALGAPI=y
1370CONFIG_CRYPTO_ALGAPI2=y 1384CONFIG_CRYPTO_ALGAPI2=y
1371CONFIG_CRYPTO_AEAD2=y 1385CONFIG_CRYPTO_AEAD2=y
@@ -1407,11 +1421,13 @@ CONFIG_CRYPTO_PCBC=m
1407# 1421#
1408# CONFIG_CRYPTO_HMAC is not set 1422# CONFIG_CRYPTO_HMAC is not set
1409# CONFIG_CRYPTO_XCBC is not set 1423# CONFIG_CRYPTO_XCBC is not set
1424# CONFIG_CRYPTO_VMAC is not set
1410 1425
1411# 1426#
1412# Digest 1427# Digest
1413# 1428#
1414# CONFIG_CRYPTO_CRC32C is not set 1429# CONFIG_CRYPTO_CRC32C is not set
1430# CONFIG_CRYPTO_GHASH is not set
1415# CONFIG_CRYPTO_MD4 is not set 1431# CONFIG_CRYPTO_MD4 is not set
1416CONFIG_CRYPTO_MD5=y 1432CONFIG_CRYPTO_MD5=y
1417# CONFIG_CRYPTO_MICHAEL_MIC is not set 1433# CONFIG_CRYPTO_MICHAEL_MIC is not set
diff --git a/arch/powerpc/configs/83xx/kmeter1_defconfig b/arch/powerpc/configs/83xx/kmeter1_defconfig
index 93ebd443a18f..6694fb73cd99 100644
--- a/arch/powerpc/configs/83xx/kmeter1_defconfig
+++ b/arch/powerpc/configs/83xx/kmeter1_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.31-rc4 3# Linux kernel version: 2.6.32-rc5
4# Wed Jul 29 23:32:03 2009 4# Thu Nov 5 08:20:21 2009
5# 5#
6# CONFIG_PPC64 is not set 6# CONFIG_PPC64 is not set
7 7
@@ -35,6 +35,7 @@ CONFIG_GENERIC_CLOCKEVENTS=y
35CONFIG_GENERIC_HARDIRQS=y 35CONFIG_GENERIC_HARDIRQS=y
36CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y 36CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y
37# CONFIG_HAVE_SETUP_PER_CPU_AREA is not set 37# CONFIG_HAVE_SETUP_PER_CPU_AREA is not set
38# CONFIG_NEED_PER_CPU_EMBED_FIRST_CHUNK 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
@@ -86,11 +87,12 @@ CONFIG_POSIX_MQUEUE_SYSCTL=y
86# 87#
87# RCU Subsystem 88# RCU Subsystem
88# 89#
89CONFIG_CLASSIC_RCU=y 90CONFIG_TREE_RCU=y
90# CONFIG_TREE_RCU is not set 91# CONFIG_TREE_PREEMPT_RCU is not set
91# CONFIG_PREEMPT_RCU is not set 92# CONFIG_RCU_TRACE is not set
93CONFIG_RCU_FANOUT=32
94# CONFIG_RCU_FANOUT_EXACT is not set
92# CONFIG_TREE_RCU_TRACE is not set 95# CONFIG_TREE_RCU_TRACE is not set
93# CONFIG_PREEMPT_RCU_TRACE is not set
94# CONFIG_IKCONFIG is not set 96# CONFIG_IKCONFIG is not set
95CONFIG_LOG_BUF_SHIFT=14 97CONFIG_LOG_BUF_SHIFT=14
96# CONFIG_GROUP_SCHED is not set 98# CONFIG_GROUP_SCHED is not set
@@ -119,20 +121,19 @@ CONFIG_TIMERFD=y
119CONFIG_EVENTFD=y 121CONFIG_EVENTFD=y
120CONFIG_SHMEM=y 122CONFIG_SHMEM=y
121CONFIG_AIO=y 123CONFIG_AIO=y
122CONFIG_HAVE_PERF_COUNTERS=y 124CONFIG_HAVE_PERF_EVENTS=y
123 125
124# 126#
125# Performance Counters 127# Kernel Performance Events And Counters
126# 128#
129# CONFIG_PERF_EVENTS is not set
127# CONFIG_PERF_COUNTERS is not set 130# CONFIG_PERF_COUNTERS is not set
128CONFIG_VM_EVENT_COUNTERS=y 131CONFIG_VM_EVENT_COUNTERS=y
129# CONFIG_STRIP_ASM_SYMS is not set
130CONFIG_COMPAT_BRK=y 132CONFIG_COMPAT_BRK=y
131CONFIG_SLAB=y 133CONFIG_SLAB=y
132# CONFIG_SLUB is not set 134# CONFIG_SLUB is not set
133# CONFIG_SLOB is not set 135# CONFIG_SLOB is not set
134# CONFIG_PROFILING is not set 136# CONFIG_PROFILING is not set
135# CONFIG_MARKERS is not set
136CONFIG_HAVE_OPROFILE=y 137CONFIG_HAVE_OPROFILE=y
137# CONFIG_KPROBES is not set 138# CONFIG_KPROBES is not set
138CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS=y 139CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS=y
@@ -140,6 +141,8 @@ CONFIG_HAVE_IOREMAP_PROT=y
140CONFIG_HAVE_KPROBES=y 141CONFIG_HAVE_KPROBES=y
141CONFIG_HAVE_KRETPROBES=y 142CONFIG_HAVE_KRETPROBES=y
142CONFIG_HAVE_ARCH_TRACEHOOK=y 143CONFIG_HAVE_ARCH_TRACEHOOK=y
144CONFIG_HAVE_DMA_ATTRS=y
145CONFIG_HAVE_DMA_API_DEBUG=y
143 146
144# 147#
145# GCOV-based kernel profiling 148# GCOV-based kernel profiling
@@ -250,6 +253,7 @@ CONFIG_ARCH_HAS_WALK_MEMORY=y
250CONFIG_ARCH_ENABLE_MEMORY_HOTREMOVE=y 253CONFIG_ARCH_ENABLE_MEMORY_HOTREMOVE=y
251# CONFIG_KEXEC is not set 254# CONFIG_KEXEC is not set
252# CONFIG_CRASH_DUMP is not set 255# CONFIG_CRASH_DUMP is not set
256CONFIG_MAX_ACTIVE_REGIONS=32
253CONFIG_ARCH_FLATMEM_ENABLE=y 257CONFIG_ARCH_FLATMEM_ENABLE=y
254CONFIG_ARCH_POPULATES_NODE_MAP=y 258CONFIG_ARCH_POPULATES_NODE_MAP=y
255CONFIG_SELECT_MEMORY_MODEL=y 259CONFIG_SELECT_MEMORY_MODEL=y
@@ -267,6 +271,7 @@ CONFIG_BOUNCE=y
267CONFIG_VIRT_TO_BUS=y 271CONFIG_VIRT_TO_BUS=y
268CONFIG_HAVE_MLOCK=y 272CONFIG_HAVE_MLOCK=y
269CONFIG_HAVE_MLOCKED_PAGE_BIT=y 273CONFIG_HAVE_MLOCKED_PAGE_BIT=y
274# CONFIG_KSM is not set
270CONFIG_DEFAULT_MMAP_MIN_ADDR=4096 275CONFIG_DEFAULT_MMAP_MIN_ADDR=4096
271CONFIG_PPC_4K_PAGES=y 276CONFIG_PPC_4K_PAGES=y
272# CONFIG_PPC_16K_PAGES is not set 277# CONFIG_PPC_16K_PAGES is not set
@@ -348,6 +353,7 @@ CONFIG_DEFAULT_TCP_CONG="cubic"
348# CONFIG_NETFILTER is not set 353# CONFIG_NETFILTER is not set
349# CONFIG_IP_DCCP is not set 354# CONFIG_IP_DCCP is not set
350# CONFIG_IP_SCTP is not set 355# CONFIG_IP_SCTP is not set
356# CONFIG_RDS is not set
351# CONFIG_TIPC is not set 357# CONFIG_TIPC is not set
352# CONFIG_ATM is not set 358# CONFIG_ATM is not set
353CONFIG_STP=m 359CONFIG_STP=m
@@ -396,9 +402,9 @@ CONFIG_PREVENT_FIRMWARE_BUILD=y
396# CONFIG_CONNECTOR is not set 402# CONFIG_CONNECTOR is not set
397CONFIG_MTD=y 403CONFIG_MTD=y
398# CONFIG_MTD_DEBUG is not set 404# CONFIG_MTD_DEBUG is not set
405# CONFIG_MTD_TESTS is not set
399CONFIG_MTD_CONCAT=y 406CONFIG_MTD_CONCAT=y
400CONFIG_MTD_PARTITIONS=y 407CONFIG_MTD_PARTITIONS=y
401# CONFIG_MTD_TESTS is not set
402# CONFIG_MTD_REDBOOT_PARTS is not set 408# CONFIG_MTD_REDBOOT_PARTS is not set
403CONFIG_MTD_CMDLINE_PARTS=y 409CONFIG_MTD_CMDLINE_PARTS=y
404CONFIG_MTD_OF_PARTS=y 410CONFIG_MTD_OF_PARTS=y
@@ -565,18 +571,16 @@ CONFIG_MII=y
565# CONFIG_IBM_NEW_EMAC_MAL_COMMON_ERR is not set 571# CONFIG_IBM_NEW_EMAC_MAL_COMMON_ERR is not set
566# CONFIG_B44 is not set 572# CONFIG_B44 is not set
567# CONFIG_KS8842 is not set 573# CONFIG_KS8842 is not set
574# CONFIG_KS8851_MLL is not set
575# CONFIG_XILINX_EMACLITE is not set
568CONFIG_NETDEV_1000=y 576CONFIG_NETDEV_1000=y
569CONFIG_FSL_PQ_MDIO=y 577CONFIG_FSL_PQ_MDIO=y
570# CONFIG_GIANFAR is not set 578# CONFIG_GIANFAR is not set
571CONFIG_UCC_GETH=y 579CONFIG_UCC_GETH=y
572# CONFIG_UGETH_MAGIC_PACKET is not set
573# CONFIG_UGETH_TX_ON_DEMAND is not set 580# CONFIG_UGETH_TX_ON_DEMAND is not set
574# CONFIG_MV643XX_ETH is not set 581# CONFIG_MV643XX_ETH is not set
575# CONFIG_NETDEV_10000 is not set 582# CONFIG_NETDEV_10000 is not set
576 583CONFIG_WLAN=y
577#
578# Wireless LAN
579#
580# CONFIG_WLAN_PRE80211 is not set 584# CONFIG_WLAN_PRE80211 is not set
581# CONFIG_WLAN_80211 is not set 585# CONFIG_WLAN_80211 is not set
582 586
@@ -663,6 +667,7 @@ CONFIG_HW_RANDOM=y
663# CONFIG_TCG_TPM is not set 667# CONFIG_TCG_TPM is not set
664CONFIG_I2C=y 668CONFIG_I2C=y
665CONFIG_I2C_BOARDINFO=y 669CONFIG_I2C_BOARDINFO=y
670CONFIG_I2C_COMPAT=y
666CONFIG_I2C_CHARDEV=y 671CONFIG_I2C_CHARDEV=y
667CONFIG_I2C_HELPER_AUTO=y 672CONFIG_I2C_HELPER_AUTO=y
668 673
@@ -693,9 +698,6 @@ CONFIG_I2C_MPC=y
693# Miscellaneous I2C Chip support 698# Miscellaneous I2C Chip support
694# 699#
695# CONFIG_DS1682 is not set 700# CONFIG_DS1682 is not set
696# CONFIG_SENSORS_PCF8574 is not set
697# CONFIG_PCF8575 is not set
698# CONFIG_SENSORS_PCA9539 is not set
699# CONFIG_SENSORS_TSL2550 is not set 701# CONFIG_SENSORS_TSL2550 is not set
700# CONFIG_I2C_DEBUG_CORE is not set 702# CONFIG_I2C_DEBUG_CORE is not set
701# CONFIG_I2C_DEBUG_ALGO is not set 703# CONFIG_I2C_DEBUG_ALGO is not set
@@ -713,7 +715,6 @@ CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y
713# CONFIG_POWER_SUPPLY is not set 715# CONFIG_POWER_SUPPLY is not set
714# CONFIG_HWMON is not set 716# CONFIG_HWMON is not set
715# CONFIG_THERMAL is not set 717# CONFIG_THERMAL is not set
716# CONFIG_THERMAL_HWMON is not set
717# CONFIG_WATCHDOG is not set 718# CONFIG_WATCHDOG is not set
718CONFIG_SSB_POSSIBLE=y 719CONFIG_SSB_POSSIBLE=y
719 720
@@ -732,6 +733,7 @@ CONFIG_SSB_POSSIBLE=y
732# CONFIG_MFD_TMIO is not set 733# CONFIG_MFD_TMIO is not set
733# CONFIG_PMIC_DA903X is not set 734# CONFIG_PMIC_DA903X is not set
734# CONFIG_MFD_WM8400 is not set 735# CONFIG_MFD_WM8400 is not set
736# CONFIG_MFD_WM831X is not set
735# CONFIG_MFD_WM8350_I2C is not set 737# CONFIG_MFD_WM8350_I2C is not set
736# CONFIG_MFD_PCF50633 is not set 738# CONFIG_MFD_PCF50633 is not set
737# CONFIG_AB3100_CORE is not set 739# CONFIG_AB3100_CORE is not set
@@ -784,6 +786,7 @@ CONFIG_UIO=y
784# CONFIG_GFS2_FS is not set 786# CONFIG_GFS2_FS is not set
785# CONFIG_OCFS2_FS is not set 787# CONFIG_OCFS2_FS is not set
786# CONFIG_BTRFS_FS is not set 788# CONFIG_BTRFS_FS is not set
789# CONFIG_NILFS2_FS is not set
787CONFIG_FILE_LOCKING=y 790CONFIG_FILE_LOCKING=y
788CONFIG_FSNOTIFY=y 791CONFIG_FSNOTIFY=y
789# CONFIG_DNOTIFY is not set 792# CONFIG_DNOTIFY is not set
@@ -854,7 +857,6 @@ CONFIG_JFFS2_RTIME=y
854# CONFIG_ROMFS_FS is not set 857# CONFIG_ROMFS_FS is not set
855# CONFIG_SYSV_FS is not set 858# CONFIG_SYSV_FS is not set
856# CONFIG_UFS_FS is not set 859# CONFIG_UFS_FS is not set
857# CONFIG_NILFS2_FS is not set
858CONFIG_NETWORK_FILESYSTEMS=y 860CONFIG_NETWORK_FILESYSTEMS=y
859CONFIG_NFS_FS=y 861CONFIG_NFS_FS=y
860CONFIG_NFS_V3=y 862CONFIG_NFS_V3=y
@@ -926,6 +928,7 @@ CONFIG_ENABLE_WARN_DEPRECATED=y
926CONFIG_ENABLE_MUST_CHECK=y 928CONFIG_ENABLE_MUST_CHECK=y
927CONFIG_FRAME_WARN=1024 929CONFIG_FRAME_WARN=1024
928# CONFIG_MAGIC_SYSRQ is not set 930# CONFIG_MAGIC_SYSRQ is not set
931# CONFIG_STRIP_ASM_SYMS is not set
929# CONFIG_UNUSED_SYMBOLS is not set 932# CONFIG_UNUSED_SYMBOLS is not set
930CONFIG_DEBUG_FS=y 933CONFIG_DEBUG_FS=y
931# CONFIG_HEADERS_CHECK is not set 934# CONFIG_HEADERS_CHECK is not set
@@ -942,6 +945,7 @@ CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y
942CONFIG_TRACING_SUPPORT=y 945CONFIG_TRACING_SUPPORT=y
943# CONFIG_FTRACE is not set 946# CONFIG_FTRACE is not set
944# CONFIG_DYNAMIC_DEBUG is not set 947# CONFIG_DYNAMIC_DEBUG is not set
948# CONFIG_DMA_API_DEBUG is not set
945# CONFIG_SAMPLES is not set 949# CONFIG_SAMPLES is not set
946CONFIG_HAVE_ARCH_KGDB=y 950CONFIG_HAVE_ARCH_KGDB=y
947# CONFIG_PPC_DISABLE_WERROR is not set 951# CONFIG_PPC_DISABLE_WERROR is not set
diff --git a/arch/powerpc/configs/83xx/mpc8313_rdb_defconfig b/arch/powerpc/configs/83xx/mpc8313_rdb_defconfig
index ff33a7db2eab..86df19f041a4 100644
--- a/arch/powerpc/configs/83xx/mpc8313_rdb_defconfig
+++ b/arch/powerpc/configs/83xx/mpc8313_rdb_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.31-rc4 3# Linux kernel version: 2.6.32-rc5
4# Wed Jul 29 23:32:04 2009 4# Thu Nov 5 08:20:22 2009
5# 5#
6# CONFIG_PPC64 is not set 6# CONFIG_PPC64 is not set
7 7
@@ -35,6 +35,7 @@ CONFIG_GENERIC_CLOCKEVENTS=y
35CONFIG_GENERIC_HARDIRQS=y 35CONFIG_GENERIC_HARDIRQS=y
36CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y 36CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y
37# CONFIG_HAVE_SETUP_PER_CPU_AREA is not set 37# CONFIG_HAVE_SETUP_PER_CPU_AREA is not set
38# CONFIG_NEED_PER_CPU_EMBED_FIRST_CHUNK 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
@@ -84,11 +85,12 @@ CONFIG_SYSVIPC_SYSCTL=y
84# 85#
85# RCU Subsystem 86# RCU Subsystem
86# 87#
87CONFIG_CLASSIC_RCU=y 88CONFIG_TREE_RCU=y
88# CONFIG_TREE_RCU is not set 89# CONFIG_TREE_PREEMPT_RCU is not set
89# CONFIG_PREEMPT_RCU is not set 90# CONFIG_RCU_TRACE is not set
91CONFIG_RCU_FANOUT=32
92# CONFIG_RCU_FANOUT_EXACT is not set
90# CONFIG_TREE_RCU_TRACE is not set 93# CONFIG_TREE_RCU_TRACE is not set
91# CONFIG_PREEMPT_RCU_TRACE is not set
92# CONFIG_IKCONFIG is not set 94# CONFIG_IKCONFIG is not set
93CONFIG_LOG_BUF_SHIFT=14 95CONFIG_LOG_BUF_SHIFT=14
94CONFIG_GROUP_SCHED=y 96CONFIG_GROUP_SCHED=y
@@ -124,28 +126,29 @@ CONFIG_TIMERFD=y
124CONFIG_EVENTFD=y 126CONFIG_EVENTFD=y
125CONFIG_SHMEM=y 127CONFIG_SHMEM=y
126CONFIG_AIO=y 128CONFIG_AIO=y
127CONFIG_HAVE_PERF_COUNTERS=y 129CONFIG_HAVE_PERF_EVENTS=y
128 130
129# 131#
130# Performance Counters 132# Kernel Performance Events And Counters
131# 133#
134# CONFIG_PERF_EVENTS is not set
132# CONFIG_PERF_COUNTERS is not set 135# CONFIG_PERF_COUNTERS is not set
133CONFIG_VM_EVENT_COUNTERS=y 136CONFIG_VM_EVENT_COUNTERS=y
134CONFIG_PCI_QUIRKS=y 137CONFIG_PCI_QUIRKS=y
135CONFIG_SLUB_DEBUG=y 138CONFIG_SLUB_DEBUG=y
136# CONFIG_STRIP_ASM_SYMS is not set
137CONFIG_COMPAT_BRK=y 139CONFIG_COMPAT_BRK=y
138# CONFIG_SLAB is not set 140# CONFIG_SLAB is not set
139CONFIG_SLUB=y 141CONFIG_SLUB=y
140# CONFIG_SLOB is not set 142# CONFIG_SLOB is not set
141# CONFIG_PROFILING is not set 143# CONFIG_PROFILING is not set
142# CONFIG_MARKERS is not set
143CONFIG_HAVE_OPROFILE=y 144CONFIG_HAVE_OPROFILE=y
144CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS=y 145CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS=y
145CONFIG_HAVE_IOREMAP_PROT=y 146CONFIG_HAVE_IOREMAP_PROT=y
146CONFIG_HAVE_KPROBES=y 147CONFIG_HAVE_KPROBES=y
147CONFIG_HAVE_KRETPROBES=y 148CONFIG_HAVE_KRETPROBES=y
148CONFIG_HAVE_ARCH_TRACEHOOK=y 149CONFIG_HAVE_ARCH_TRACEHOOK=y
150CONFIG_HAVE_DMA_ATTRS=y
151CONFIG_HAVE_DMA_API_DEBUG=y
149 152
150# 153#
151# GCOV-based kernel profiling 154# GCOV-based kernel profiling
@@ -256,6 +259,7 @@ CONFIG_ARCH_HAS_WALK_MEMORY=y
256CONFIG_ARCH_ENABLE_MEMORY_HOTREMOVE=y 259CONFIG_ARCH_ENABLE_MEMORY_HOTREMOVE=y
257# CONFIG_KEXEC is not set 260# CONFIG_KEXEC is not set
258# CONFIG_CRASH_DUMP is not set 261# CONFIG_CRASH_DUMP is not set
262CONFIG_MAX_ACTIVE_REGIONS=32
259CONFIG_ARCH_FLATMEM_ENABLE=y 263CONFIG_ARCH_FLATMEM_ENABLE=y
260CONFIG_ARCH_POPULATES_NODE_MAP=y 264CONFIG_ARCH_POPULATES_NODE_MAP=y
261CONFIG_SELECT_MEMORY_MODEL=y 265CONFIG_SELECT_MEMORY_MODEL=y
@@ -273,6 +277,7 @@ CONFIG_BOUNCE=y
273CONFIG_VIRT_TO_BUS=y 277CONFIG_VIRT_TO_BUS=y
274CONFIG_HAVE_MLOCK=y 278CONFIG_HAVE_MLOCK=y
275CONFIG_HAVE_MLOCKED_PAGE_BIT=y 279CONFIG_HAVE_MLOCKED_PAGE_BIT=y
280# CONFIG_KSM is not set
276CONFIG_DEFAULT_MMAP_MIN_ADDR=4096 281CONFIG_DEFAULT_MMAP_MIN_ADDR=4096
277CONFIG_PPC_4K_PAGES=y 282CONFIG_PPC_4K_PAGES=y
278# CONFIG_PPC_16K_PAGES is not set 283# CONFIG_PPC_16K_PAGES is not set
@@ -369,6 +374,7 @@ CONFIG_DEFAULT_TCP_CONG="cubic"
369# CONFIG_NETFILTER is not set 374# CONFIG_NETFILTER is not set
370# CONFIG_IP_DCCP is not set 375# CONFIG_IP_DCCP is not set
371# CONFIG_IP_SCTP is not set 376# CONFIG_IP_SCTP is not set
377# CONFIG_RDS is not set
372# CONFIG_TIPC is not set 378# CONFIG_TIPC is not set
373# CONFIG_ATM is not set 379# CONFIG_ATM is not set
374# CONFIG_BRIDGE is not set 380# CONFIG_BRIDGE is not set
@@ -398,6 +404,7 @@ CONFIG_DEFAULT_TCP_CONG="cubic"
398# CONFIG_AF_RXRPC is not set 404# CONFIG_AF_RXRPC is not set
399CONFIG_WIRELESS=y 405CONFIG_WIRELESS=y
400# CONFIG_CFG80211 is not set 406# CONFIG_CFG80211 is not set
407CONFIG_CFG80211_DEFAULT_PS_VALUE=0
401CONFIG_WIRELESS_OLD_REGULATORY=y 408CONFIG_WIRELESS_OLD_REGULATORY=y
402# CONFIG_WIRELESS_EXT is not set 409# CONFIG_WIRELESS_EXT is not set
403# CONFIG_LIB80211 is not set 410# CONFIG_LIB80211 is not set
@@ -405,7 +412,6 @@ CONFIG_WIRELESS_OLD_REGULATORY=y
405# 412#
406# CFG80211 needs to be enabled for MAC80211 413# CFG80211 needs to be enabled for MAC80211
407# 414#
408CONFIG_MAC80211_DEFAULT_PS_VALUE=0
409# CONFIG_WIMAX is not set 415# CONFIG_WIMAX is not set
410# CONFIG_RFKILL is not set 416# CONFIG_RFKILL is not set
411# CONFIG_NET_9P is not set 417# CONFIG_NET_9P is not set
@@ -418,6 +424,7 @@ CONFIG_MAC80211_DEFAULT_PS_VALUE=0
418# Generic Driver Options 424# Generic Driver Options
419# 425#
420CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug" 426CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
427# CONFIG_DEVTMPFS is not set
421CONFIG_STANDALONE=y 428CONFIG_STANDALONE=y
422CONFIG_PREVENT_FIRMWARE_BUILD=y 429CONFIG_PREVENT_FIRMWARE_BUILD=y
423# CONFIG_FW_LOADER is not set 430# CONFIG_FW_LOADER is not set
@@ -427,9 +434,9 @@ CONFIG_PREVENT_FIRMWARE_BUILD=y
427# CONFIG_CONNECTOR is not set 434# CONFIG_CONNECTOR is not set
428CONFIG_MTD=y 435CONFIG_MTD=y
429# CONFIG_MTD_DEBUG is not set 436# CONFIG_MTD_DEBUG is not set
437# CONFIG_MTD_TESTS is not set
430# CONFIG_MTD_CONCAT is not set 438# CONFIG_MTD_CONCAT is not set
431CONFIG_MTD_PARTITIONS=y 439CONFIG_MTD_PARTITIONS=y
432# CONFIG_MTD_TESTS is not set
433# CONFIG_MTD_REDBOOT_PARTS is not set 440# CONFIG_MTD_REDBOOT_PARTS is not set
434# CONFIG_MTD_CMDLINE_PARTS is not set 441# CONFIG_MTD_CMDLINE_PARTS is not set
435CONFIG_MTD_OF_PARTS=y 442CONFIG_MTD_OF_PARTS=y
@@ -488,6 +495,7 @@ CONFIG_MTD_PHYSMAP_OF=y
488# CONFIG_MTD_PMC551 is not set 495# CONFIG_MTD_PMC551 is not set
489# CONFIG_MTD_DATAFLASH is not set 496# CONFIG_MTD_DATAFLASH is not set
490# CONFIG_MTD_M25P80 is not set 497# CONFIG_MTD_M25P80 is not set
498# CONFIG_MTD_SST25L is not set
491# CONFIG_MTD_SLRAM is not set 499# CONFIG_MTD_SLRAM is not set
492# CONFIG_MTD_PHRAM is not set 500# CONFIG_MTD_PHRAM is not set
493# CONFIG_MTD_MTDRAM is not set 501# CONFIG_MTD_MTDRAM is not set
@@ -605,6 +613,7 @@ CONFIG_SCSI_LOWLEVEL=y
605# CONFIG_ISCSI_TCP is not set 613# CONFIG_ISCSI_TCP is not set
606# CONFIG_SCSI_CXGB3_ISCSI is not set 614# CONFIG_SCSI_CXGB3_ISCSI is not set
607# CONFIG_SCSI_BNX2_ISCSI is not set 615# CONFIG_SCSI_BNX2_ISCSI is not set
616# CONFIG_BE2ISCSI is not set
608# CONFIG_BLK_DEV_3W_XXXX_RAID is not set 617# CONFIG_BLK_DEV_3W_XXXX_RAID is not set
609# CONFIG_SCSI_3W_9XXX is not set 618# CONFIG_SCSI_3W_9XXX is not set
610# CONFIG_SCSI_ACARD is not set 619# CONFIG_SCSI_ACARD is not set
@@ -643,7 +652,9 @@ CONFIG_SCSI_LOWLEVEL=y
643# CONFIG_SCSI_DC390T is not set 652# CONFIG_SCSI_DC390T is not set
644# CONFIG_SCSI_NSP32 is not set 653# CONFIG_SCSI_NSP32 is not set
645# CONFIG_SCSI_DEBUG is not set 654# CONFIG_SCSI_DEBUG is not set
655# CONFIG_SCSI_PMCRAID is not set
646# CONFIG_SCSI_SRP is not set 656# CONFIG_SCSI_SRP is not set
657# CONFIG_SCSI_BFA_FC is not set
647# CONFIG_SCSI_DH is not set 658# CONFIG_SCSI_DH is not set
648# CONFIG_SCSI_OSD_INITIATOR is not set 659# CONFIG_SCSI_OSD_INITIATOR is not set
649# CONFIG_ATA is not set 660# CONFIG_ATA is not set
@@ -741,9 +752,11 @@ CONFIG_E100=y
741# CONFIG_TLAN is not set 752# CONFIG_TLAN is not set
742# CONFIG_KS8842 is not set 753# CONFIG_KS8842 is not set
743# CONFIG_KS8851 is not set 754# CONFIG_KS8851 is not set
755# CONFIG_KS8851_MLL is not set
744# CONFIG_VIA_RHINE is not set 756# CONFIG_VIA_RHINE is not set
745# CONFIG_SC92031 is not set 757# CONFIG_SC92031 is not set
746# CONFIG_ATL2 is not set 758# CONFIG_ATL2 is not set
759# CONFIG_XILINX_EMACLITE is not set
747CONFIG_NETDEV_1000=y 760CONFIG_NETDEV_1000=y
748# CONFIG_ACENIC is not set 761# CONFIG_ACENIC is not set
749# CONFIG_DL2K is not set 762# CONFIG_DL2K is not set
@@ -791,10 +804,7 @@ CONFIG_CHELSIO_T3_DEPENDS=y
791# CONFIG_SFC is not set 804# CONFIG_SFC is not set
792# CONFIG_BE2NET is not set 805# CONFIG_BE2NET is not set
793# CONFIG_TR is not set 806# CONFIG_TR is not set
794 807CONFIG_WLAN=y
795#
796# Wireless LAN
797#
798# CONFIG_WLAN_PRE80211 is not set 808# CONFIG_WLAN_PRE80211 is not set
799# CONFIG_WLAN_80211 is not set 809# CONFIG_WLAN_80211 is not set
800 810
@@ -896,6 +906,7 @@ CONFIG_HW_RANDOM=y
896CONFIG_DEVPORT=y 906CONFIG_DEVPORT=y
897CONFIG_I2C=y 907CONFIG_I2C=y
898CONFIG_I2C_BOARDINFO=y 908CONFIG_I2C_BOARDINFO=y
909CONFIG_I2C_COMPAT=y
899CONFIG_I2C_CHARDEV=y 910CONFIG_I2C_CHARDEV=y
900CONFIG_I2C_HELPER_AUTO=y 911CONFIG_I2C_HELPER_AUTO=y
901 912
@@ -950,9 +961,6 @@ CONFIG_I2C_MPC=y
950# Miscellaneous I2C Chip support 961# Miscellaneous I2C Chip support
951# 962#
952# CONFIG_DS1682 is not set 963# CONFIG_DS1682 is not set
953# CONFIG_SENSORS_PCF8574 is not set
954# CONFIG_PCF8575 is not set
955# CONFIG_SENSORS_PCA9539 is not set
956# CONFIG_SENSORS_TSL2550 is not set 964# CONFIG_SENSORS_TSL2550 is not set
957# CONFIG_I2C_DEBUG_CORE is not set 965# CONFIG_I2C_DEBUG_CORE is not set
958# CONFIG_I2C_DEBUG_ALGO is not set 966# CONFIG_I2C_DEBUG_ALGO is not set
@@ -984,6 +992,11 @@ CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y
984# CONFIG_POWER_SUPPLY is not set 992# CONFIG_POWER_SUPPLY is not set
985CONFIG_HWMON=y 993CONFIG_HWMON=y
986# CONFIG_HWMON_VID is not set 994# CONFIG_HWMON_VID is not set
995# CONFIG_HWMON_DEBUG_CHIP is not set
996
997#
998# Native drivers
999#
987# CONFIG_SENSORS_AD7414 is not set 1000# CONFIG_SENSORS_AD7414 is not set
988# CONFIG_SENSORS_AD7418 is not set 1001# CONFIG_SENSORS_AD7418 is not set
989# CONFIG_SENSORS_ADCXX is not set 1002# CONFIG_SENSORS_ADCXX is not set
@@ -1036,6 +1049,7 @@ CONFIG_HWMON=y
1036# CONFIG_SENSORS_ADS7828 is not set 1049# CONFIG_SENSORS_ADS7828 is not set
1037# CONFIG_SENSORS_THMC50 is not set 1050# CONFIG_SENSORS_THMC50 is not set
1038# CONFIG_SENSORS_TMP401 is not set 1051# CONFIG_SENSORS_TMP401 is not set
1052# CONFIG_SENSORS_TMP421 is not set
1039# CONFIG_SENSORS_VIA686A is not set 1053# CONFIG_SENSORS_VIA686A is not set
1040# CONFIG_SENSORS_VT1211 is not set 1054# CONFIG_SENSORS_VT1211 is not set
1041# CONFIG_SENSORS_VT8231 is not set 1055# CONFIG_SENSORS_VT8231 is not set
@@ -1048,9 +1062,7 @@ CONFIG_HWMON=y
1048# CONFIG_SENSORS_W83627HF is not set 1062# CONFIG_SENSORS_W83627HF is not set
1049# CONFIG_SENSORS_W83627EHF is not set 1063# CONFIG_SENSORS_W83627EHF is not set
1050# CONFIG_SENSORS_LIS3_SPI is not set 1064# CONFIG_SENSORS_LIS3_SPI is not set
1051# CONFIG_HWMON_DEBUG_CHIP is not set
1052# CONFIG_THERMAL is not set 1065# CONFIG_THERMAL is not set
1053# CONFIG_THERMAL_HWMON is not set
1054CONFIG_WATCHDOG=y 1066CONFIG_WATCHDOG=y
1055# CONFIG_WATCHDOG_NOWAYOUT is not set 1067# CONFIG_WATCHDOG_NOWAYOUT is not set
1056 1068
@@ -1088,8 +1100,10 @@ CONFIG_SSB_POSSIBLE=y
1088# CONFIG_MFD_TMIO is not set 1100# CONFIG_MFD_TMIO is not set
1089# CONFIG_PMIC_DA903X is not set 1101# CONFIG_PMIC_DA903X is not set
1090# CONFIG_MFD_WM8400 is not set 1102# CONFIG_MFD_WM8400 is not set
1103# CONFIG_MFD_WM831X is not set
1091# CONFIG_MFD_WM8350_I2C is not set 1104# CONFIG_MFD_WM8350_I2C is not set
1092# CONFIG_MFD_PCF50633 is not set 1105# CONFIG_MFD_PCF50633 is not set
1106# CONFIG_MFD_MC13783 is not set
1093# CONFIG_AB3100_CORE is not set 1107# CONFIG_AB3100_CORE is not set
1094# CONFIG_EZX_PCAP is not set 1108# CONFIG_EZX_PCAP is not set
1095# CONFIG_REGULATOR is not set 1109# CONFIG_REGULATOR is not set
@@ -1099,6 +1113,7 @@ CONFIG_SSB_POSSIBLE=y
1099# Graphics support 1113# Graphics support
1100# 1114#
1101# CONFIG_AGP is not set 1115# CONFIG_AGP is not set
1116CONFIG_VGA_ARB=y
1102# CONFIG_DRM is not set 1117# CONFIG_DRM is not set
1103# CONFIG_VGASTATE is not set 1118# CONFIG_VGASTATE is not set
1104CONFIG_VIDEO_OUTPUT_CONTROL=m 1119CONFIG_VIDEO_OUTPUT_CONTROL=m
@@ -1112,7 +1127,6 @@ CONFIG_VIDEO_OUTPUT_CONTROL=m
1112# CONFIG_SOUND is not set 1127# CONFIG_SOUND is not set
1113CONFIG_HID_SUPPORT=y 1128CONFIG_HID_SUPPORT=y
1114CONFIG_HID=y 1129CONFIG_HID=y
1115# CONFIG_HID_DEBUG is not set
1116# CONFIG_HIDRAW is not set 1130# CONFIG_HIDRAW is not set
1117 1131
1118# 1132#
@@ -1164,6 +1178,7 @@ CONFIG_USB_EHCI_HCD_PPC_OF=y
1164# CONFIG_USB_OXU210HP_HCD is not set 1178# CONFIG_USB_OXU210HP_HCD is not set
1165# CONFIG_USB_ISP116X_HCD is not set 1179# CONFIG_USB_ISP116X_HCD is not set
1166# CONFIG_USB_ISP1760_HCD is not set 1180# CONFIG_USB_ISP1760_HCD is not set
1181# CONFIG_USB_ISP1362_HCD is not set
1167CONFIG_USB_OHCI_HCD=y 1182CONFIG_USB_OHCI_HCD=y
1168CONFIG_USB_OHCI_HCD_PPC_OF_BE=y 1183CONFIG_USB_OHCI_HCD_PPC_OF_BE=y
1169# CONFIG_USB_OHCI_HCD_PPC_OF_LE is not set 1184# CONFIG_USB_OHCI_HCD_PPC_OF_LE is not set
@@ -1255,6 +1270,7 @@ CONFIG_USB_GADGET_SELECTED=y
1255# CONFIG_USB_GADGET_LH7A40X is not set 1270# CONFIG_USB_GADGET_LH7A40X is not set
1256# CONFIG_USB_GADGET_OMAP is not set 1271# CONFIG_USB_GADGET_OMAP is not set
1257# CONFIG_USB_GADGET_PXA25X is not set 1272# CONFIG_USB_GADGET_PXA25X is not set
1273# CONFIG_USB_GADGET_R8A66597 is not set
1258# CONFIG_USB_GADGET_PXA27X is not set 1274# CONFIG_USB_GADGET_PXA27X is not set
1259# CONFIG_USB_GADGET_S3C_HSOTG is not set 1275# CONFIG_USB_GADGET_S3C_HSOTG is not set
1260# CONFIG_USB_GADGET_IMX is not set 1276# CONFIG_USB_GADGET_IMX is not set
@@ -1273,6 +1289,7 @@ CONFIG_USB_GADGET_DUALSPEED=y
1273# CONFIG_USB_AUDIO is not set 1289# CONFIG_USB_AUDIO is not set
1274CONFIG_USB_ETH=y 1290CONFIG_USB_ETH=y
1275CONFIG_USB_ETH_RNDIS=y 1291CONFIG_USB_ETH_RNDIS=y
1292# CONFIG_USB_ETH_EEM is not set
1276# CONFIG_USB_GADGETFS is not set 1293# CONFIG_USB_GADGETFS is not set
1277# CONFIG_USB_FILE_STORAGE is not set 1294# CONFIG_USB_FILE_STORAGE is not set
1278# CONFIG_USB_G_SERIAL is not set 1295# CONFIG_USB_G_SERIAL is not set
@@ -1334,6 +1351,7 @@ CONFIG_RTC_DRV_DS1307=y
1334# CONFIG_RTC_DRV_R9701 is not set 1351# CONFIG_RTC_DRV_R9701 is not set
1335# CONFIG_RTC_DRV_RS5C348 is not set 1352# CONFIG_RTC_DRV_RS5C348 is not set
1336# CONFIG_RTC_DRV_DS3234 is not set 1353# CONFIG_RTC_DRV_DS3234 is not set
1354# CONFIG_RTC_DRV_PCF2123 is not set
1337 1355
1338# 1356#
1339# Platform RTC drivers 1357# Platform RTC drivers
@@ -1384,6 +1402,7 @@ CONFIG_FS_MBCACHE=y
1384# CONFIG_GFS2_FS is not set 1402# CONFIG_GFS2_FS is not set
1385# CONFIG_OCFS2_FS is not set 1403# CONFIG_OCFS2_FS is not set
1386# CONFIG_BTRFS_FS is not set 1404# CONFIG_BTRFS_FS is not set
1405# CONFIG_NILFS2_FS is not set
1387CONFIG_FILE_LOCKING=y 1406CONFIG_FILE_LOCKING=y
1388CONFIG_FSNOTIFY=y 1407CONFIG_FSNOTIFY=y
1389CONFIG_DNOTIFY=y 1408CONFIG_DNOTIFY=y
@@ -1453,7 +1472,6 @@ CONFIG_JFFS2_RTIME=y
1453# CONFIG_ROMFS_FS is not set 1472# CONFIG_ROMFS_FS is not set
1454# CONFIG_SYSV_FS is not set 1473# CONFIG_SYSV_FS is not set
1455# CONFIG_UFS_FS is not set 1474# CONFIG_UFS_FS is not set
1456# CONFIG_NILFS2_FS is not set
1457CONFIG_NETWORK_FILESYSTEMS=y 1475CONFIG_NETWORK_FILESYSTEMS=y
1458CONFIG_NFS_FS=y 1476CONFIG_NFS_FS=y
1459CONFIG_NFS_V3=y 1477CONFIG_NFS_V3=y
@@ -1569,6 +1587,7 @@ CONFIG_ENABLE_WARN_DEPRECATED=y
1569CONFIG_ENABLE_MUST_CHECK=y 1587CONFIG_ENABLE_MUST_CHECK=y
1570CONFIG_FRAME_WARN=1024 1588CONFIG_FRAME_WARN=1024
1571# CONFIG_MAGIC_SYSRQ is not set 1589# CONFIG_MAGIC_SYSRQ is not set
1590# CONFIG_STRIP_ASM_SYMS is not set
1572# CONFIG_UNUSED_SYMBOLS is not set 1591# CONFIG_UNUSED_SYMBOLS is not set
1573# CONFIG_DEBUG_FS is not set 1592# CONFIG_DEBUG_FS is not set
1574# CONFIG_HEADERS_CHECK is not set 1593# CONFIG_HEADERS_CHECK is not set
@@ -1586,6 +1605,7 @@ CONFIG_SCHED_DEBUG=y
1586# CONFIG_DEBUG_OBJECTS is not set 1605# CONFIG_DEBUG_OBJECTS is not set
1587# CONFIG_SLUB_DEBUG_ON is not set 1606# CONFIG_SLUB_DEBUG_ON is not set
1588# CONFIG_SLUB_STATS is not set 1607# CONFIG_SLUB_STATS is not set
1608# CONFIG_DEBUG_KMEMLEAK is not set
1589# CONFIG_DEBUG_RT_MUTEXES is not set 1609# CONFIG_DEBUG_RT_MUTEXES is not set
1590# CONFIG_RT_MUTEX_TESTER is not set 1610# CONFIG_RT_MUTEX_TESTER is not set
1591# CONFIG_DEBUG_SPINLOCK is not set 1611# CONFIG_DEBUG_SPINLOCK is not set
@@ -1604,10 +1624,12 @@ CONFIG_SCHED_DEBUG=y
1604# CONFIG_DEBUG_LIST is not set 1624# CONFIG_DEBUG_LIST is not set
1605# CONFIG_DEBUG_SG is not set 1625# CONFIG_DEBUG_SG is not set
1606# CONFIG_DEBUG_NOTIFIERS is not set 1626# CONFIG_DEBUG_NOTIFIERS is not set
1627# CONFIG_DEBUG_CREDENTIALS is not set
1607# CONFIG_RCU_TORTURE_TEST is not set 1628# CONFIG_RCU_TORTURE_TEST is not set
1608# CONFIG_RCU_CPU_STALL_DETECTOR is not set 1629# CONFIG_RCU_CPU_STALL_DETECTOR is not set
1609# CONFIG_BACKTRACE_SELF_TEST is not set 1630# CONFIG_BACKTRACE_SELF_TEST is not set
1610# CONFIG_DEBUG_BLOCK_EXT_DEVT is not set 1631# CONFIG_DEBUG_BLOCK_EXT_DEVT is not set
1632# CONFIG_DEBUG_FORCE_WEAK_PER_CPU is not set
1611# CONFIG_FAULT_INJECTION is not set 1633# CONFIG_FAULT_INJECTION is not set
1612# CONFIG_LATENCYTOP is not set 1634# CONFIG_LATENCYTOP is not set
1613CONFIG_SYSCTL_SYSCALL_CHECK=y 1635CONFIG_SYSCTL_SYSCALL_CHECK=y
@@ -1630,10 +1652,10 @@ CONFIG_BRANCH_PROFILE_NONE=y
1630# CONFIG_KMEMTRACE is not set 1652# CONFIG_KMEMTRACE is not set
1631# CONFIG_WORKQUEUE_TRACER is not set 1653# CONFIG_WORKQUEUE_TRACER is not set
1632# CONFIG_BLK_DEV_IO_TRACE is not set 1654# CONFIG_BLK_DEV_IO_TRACE is not set
1655# CONFIG_DMA_API_DEBUG is not set
1633# CONFIG_SAMPLES is not set 1656# CONFIG_SAMPLES is not set
1634CONFIG_HAVE_ARCH_KGDB=y 1657CONFIG_HAVE_ARCH_KGDB=y
1635# CONFIG_KGDB is not set 1658# CONFIG_KGDB is not set
1636# CONFIG_KMEMCHECK is not set
1637# CONFIG_PPC_DISABLE_WERROR is not set 1659# CONFIG_PPC_DISABLE_WERROR is not set
1638CONFIG_PPC_WERROR=y 1660CONFIG_PPC_WERROR=y
1639CONFIG_PRINT_STACK_DEPTH=64 1661CONFIG_PRINT_STACK_DEPTH=64
@@ -1660,7 +1682,6 @@ CONFIG_CRYPTO=y
1660# 1682#
1661# Crypto core or helper 1683# Crypto core or helper
1662# 1684#
1663# CONFIG_CRYPTO_FIPS is not set
1664CONFIG_CRYPTO_ALGAPI=y 1685CONFIG_CRYPTO_ALGAPI=y
1665CONFIG_CRYPTO_ALGAPI2=y 1686CONFIG_CRYPTO_ALGAPI2=y
1666CONFIG_CRYPTO_AEAD2=y 1687CONFIG_CRYPTO_AEAD2=y
@@ -1702,11 +1723,13 @@ CONFIG_CRYPTO_PCBC=m
1702# 1723#
1703# CONFIG_CRYPTO_HMAC is not set 1724# CONFIG_CRYPTO_HMAC is not set
1704# CONFIG_CRYPTO_XCBC is not set 1725# CONFIG_CRYPTO_XCBC is not set
1726# CONFIG_CRYPTO_VMAC is not set
1705 1727
1706# 1728#
1707# Digest 1729# Digest
1708# 1730#
1709# CONFIG_CRYPTO_CRC32C is not set 1731# CONFIG_CRYPTO_CRC32C is not set
1732# CONFIG_CRYPTO_GHASH is not set
1710# CONFIG_CRYPTO_MD4 is not set 1733# CONFIG_CRYPTO_MD4 is not set
1711CONFIG_CRYPTO_MD5=y 1734CONFIG_CRYPTO_MD5=y
1712# CONFIG_CRYPTO_MICHAEL_MIC is not set 1735# CONFIG_CRYPTO_MICHAEL_MIC is not set
diff --git a/arch/powerpc/configs/83xx/mpc8315_rdb_defconfig b/arch/powerpc/configs/83xx/mpc8315_rdb_defconfig
index 76237d466702..7bf71d577033 100644
--- a/arch/powerpc/configs/83xx/mpc8315_rdb_defconfig
+++ b/arch/powerpc/configs/83xx/mpc8315_rdb_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.31-rc4 3# Linux kernel version: 2.6.32-rc5
4# Wed Jul 29 23:32:05 2009 4# Thu Nov 5 08:20:23 2009
5# 5#
6# CONFIG_PPC64 is not set 6# CONFIG_PPC64 is not set
7 7
@@ -35,6 +35,7 @@ CONFIG_GENERIC_CLOCKEVENTS=y
35CONFIG_GENERIC_HARDIRQS=y 35CONFIG_GENERIC_HARDIRQS=y
36CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y 36CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y
37# CONFIG_HAVE_SETUP_PER_CPU_AREA is not set 37# CONFIG_HAVE_SETUP_PER_CPU_AREA is not set
38# CONFIG_NEED_PER_CPU_EMBED_FIRST_CHUNK 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
@@ -84,11 +85,12 @@ CONFIG_SYSVIPC_SYSCTL=y
84# 85#
85# RCU Subsystem 86# RCU Subsystem
86# 87#
87CONFIG_CLASSIC_RCU=y 88CONFIG_TREE_RCU=y
88# CONFIG_TREE_RCU is not set 89# CONFIG_TREE_PREEMPT_RCU is not set
89# CONFIG_PREEMPT_RCU is not set 90# CONFIG_RCU_TRACE is not set
91CONFIG_RCU_FANOUT=32
92# CONFIG_RCU_FANOUT_EXACT is not set
90# CONFIG_TREE_RCU_TRACE is not set 93# CONFIG_TREE_RCU_TRACE is not set
91# CONFIG_PREEMPT_RCU_TRACE is not set
92# CONFIG_IKCONFIG is not set 94# CONFIG_IKCONFIG is not set
93CONFIG_LOG_BUF_SHIFT=14 95CONFIG_LOG_BUF_SHIFT=14
94CONFIG_GROUP_SCHED=y 96CONFIG_GROUP_SCHED=y
@@ -124,28 +126,29 @@ CONFIG_TIMERFD=y
124CONFIG_EVENTFD=y 126CONFIG_EVENTFD=y
125CONFIG_SHMEM=y 127CONFIG_SHMEM=y
126CONFIG_AIO=y 128CONFIG_AIO=y
127CONFIG_HAVE_PERF_COUNTERS=y 129CONFIG_HAVE_PERF_EVENTS=y
128 130
129# 131#
130# Performance Counters 132# Kernel Performance Events And Counters
131# 133#
134# CONFIG_PERF_EVENTS is not set
132# CONFIG_PERF_COUNTERS is not set 135# CONFIG_PERF_COUNTERS is not set
133CONFIG_VM_EVENT_COUNTERS=y 136CONFIG_VM_EVENT_COUNTERS=y
134CONFIG_PCI_QUIRKS=y 137CONFIG_PCI_QUIRKS=y
135CONFIG_SLUB_DEBUG=y 138CONFIG_SLUB_DEBUG=y
136# CONFIG_STRIP_ASM_SYMS is not set
137CONFIG_COMPAT_BRK=y 139CONFIG_COMPAT_BRK=y
138# CONFIG_SLAB is not set 140# CONFIG_SLAB is not set
139CONFIG_SLUB=y 141CONFIG_SLUB=y
140# CONFIG_SLOB is not set 142# CONFIG_SLOB is not set
141# CONFIG_PROFILING is not set 143# CONFIG_PROFILING is not set
142# CONFIG_MARKERS is not set
143CONFIG_HAVE_OPROFILE=y 144CONFIG_HAVE_OPROFILE=y
144CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS=y 145CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS=y
145CONFIG_HAVE_IOREMAP_PROT=y 146CONFIG_HAVE_IOREMAP_PROT=y
146CONFIG_HAVE_KPROBES=y 147CONFIG_HAVE_KPROBES=y
147CONFIG_HAVE_KRETPROBES=y 148CONFIG_HAVE_KRETPROBES=y
148CONFIG_HAVE_ARCH_TRACEHOOK=y 149CONFIG_HAVE_ARCH_TRACEHOOK=y
150CONFIG_HAVE_DMA_ATTRS=y
151CONFIG_HAVE_DMA_API_DEBUG=y
149 152
150# 153#
151# GCOV-based kernel profiling 154# GCOV-based kernel profiling
@@ -256,6 +259,7 @@ CONFIG_ARCH_HAS_WALK_MEMORY=y
256CONFIG_ARCH_ENABLE_MEMORY_HOTREMOVE=y 259CONFIG_ARCH_ENABLE_MEMORY_HOTREMOVE=y
257# CONFIG_KEXEC is not set 260# CONFIG_KEXEC is not set
258# CONFIG_CRASH_DUMP is not set 261# CONFIG_CRASH_DUMP is not set
262CONFIG_MAX_ACTIVE_REGIONS=32
259CONFIG_ARCH_FLATMEM_ENABLE=y 263CONFIG_ARCH_FLATMEM_ENABLE=y
260CONFIG_ARCH_POPULATES_NODE_MAP=y 264CONFIG_ARCH_POPULATES_NODE_MAP=y
261CONFIG_SELECT_MEMORY_MODEL=y 265CONFIG_SELECT_MEMORY_MODEL=y
@@ -273,6 +277,7 @@ CONFIG_BOUNCE=y
273CONFIG_VIRT_TO_BUS=y 277CONFIG_VIRT_TO_BUS=y
274CONFIG_HAVE_MLOCK=y 278CONFIG_HAVE_MLOCK=y
275CONFIG_HAVE_MLOCKED_PAGE_BIT=y 279CONFIG_HAVE_MLOCKED_PAGE_BIT=y
280# CONFIG_KSM is not set
276CONFIG_DEFAULT_MMAP_MIN_ADDR=4096 281CONFIG_DEFAULT_MMAP_MIN_ADDR=4096
277CONFIG_PPC_4K_PAGES=y 282CONFIG_PPC_4K_PAGES=y
278# CONFIG_PPC_16K_PAGES is not set 283# CONFIG_PPC_16K_PAGES is not set
@@ -369,6 +374,7 @@ CONFIG_DEFAULT_TCP_CONG="cubic"
369# CONFIG_NETFILTER is not set 374# CONFIG_NETFILTER is not set
370# CONFIG_IP_DCCP is not set 375# CONFIG_IP_DCCP is not set
371# CONFIG_IP_SCTP is not set 376# CONFIG_IP_SCTP is not set
377# CONFIG_RDS is not set
372# CONFIG_TIPC is not set 378# CONFIG_TIPC is not set
373# CONFIG_ATM is not set 379# CONFIG_ATM is not set
374# CONFIG_BRIDGE is not set 380# CONFIG_BRIDGE is not set
@@ -398,6 +404,7 @@ CONFIG_DEFAULT_TCP_CONG="cubic"
398# CONFIG_AF_RXRPC is not set 404# CONFIG_AF_RXRPC is not set
399CONFIG_WIRELESS=y 405CONFIG_WIRELESS=y
400# CONFIG_CFG80211 is not set 406# CONFIG_CFG80211 is not set
407CONFIG_CFG80211_DEFAULT_PS_VALUE=0
401CONFIG_WIRELESS_OLD_REGULATORY=y 408CONFIG_WIRELESS_OLD_REGULATORY=y
402# CONFIG_WIRELESS_EXT is not set 409# CONFIG_WIRELESS_EXT is not set
403# CONFIG_LIB80211 is not set 410# CONFIG_LIB80211 is not set
@@ -405,7 +412,6 @@ CONFIG_WIRELESS_OLD_REGULATORY=y
405# 412#
406# CFG80211 needs to be enabled for MAC80211 413# CFG80211 needs to be enabled for MAC80211
407# 414#
408CONFIG_MAC80211_DEFAULT_PS_VALUE=0
409# CONFIG_WIMAX is not set 415# CONFIG_WIMAX is not set
410# CONFIG_RFKILL is not set 416# CONFIG_RFKILL is not set
411# CONFIG_NET_9P is not set 417# CONFIG_NET_9P is not set
@@ -418,6 +424,7 @@ CONFIG_MAC80211_DEFAULT_PS_VALUE=0
418# Generic Driver Options 424# Generic Driver Options
419# 425#
420CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug" 426CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
427# CONFIG_DEVTMPFS is not set
421CONFIG_STANDALONE=y 428CONFIG_STANDALONE=y
422CONFIG_PREVENT_FIRMWARE_BUILD=y 429CONFIG_PREVENT_FIRMWARE_BUILD=y
423# CONFIG_FW_LOADER is not set 430# CONFIG_FW_LOADER is not set
@@ -427,9 +434,9 @@ CONFIG_PREVENT_FIRMWARE_BUILD=y
427# CONFIG_CONNECTOR is not set 434# CONFIG_CONNECTOR is not set
428CONFIG_MTD=y 435CONFIG_MTD=y
429# CONFIG_MTD_DEBUG is not set 436# CONFIG_MTD_DEBUG is not set
437# CONFIG_MTD_TESTS is not set
430# CONFIG_MTD_CONCAT is not set 438# CONFIG_MTD_CONCAT is not set
431CONFIG_MTD_PARTITIONS=y 439CONFIG_MTD_PARTITIONS=y
432# CONFIG_MTD_TESTS is not set
433# CONFIG_MTD_REDBOOT_PARTS is not set 440# CONFIG_MTD_REDBOOT_PARTS is not set
434# CONFIG_MTD_CMDLINE_PARTS is not set 441# CONFIG_MTD_CMDLINE_PARTS is not set
435# CONFIG_MTD_OF_PARTS is not set 442# CONFIG_MTD_OF_PARTS is not set
@@ -488,6 +495,7 @@ CONFIG_MTD_PHYSMAP_OF=y
488# CONFIG_MTD_PMC551 is not set 495# CONFIG_MTD_PMC551 is not set
489# CONFIG_MTD_DATAFLASH is not set 496# CONFIG_MTD_DATAFLASH is not set
490# CONFIG_MTD_M25P80 is not set 497# CONFIG_MTD_M25P80 is not set
498# CONFIG_MTD_SST25L is not set
491# CONFIG_MTD_SLRAM is not set 499# CONFIG_MTD_SLRAM is not set
492# CONFIG_MTD_PHRAM is not set 500# CONFIG_MTD_PHRAM is not set
493# CONFIG_MTD_MTDRAM is not set 501# CONFIG_MTD_MTDRAM is not set
@@ -605,6 +613,7 @@ CONFIG_SCSI_LOWLEVEL=y
605# CONFIG_ISCSI_TCP is not set 613# CONFIG_ISCSI_TCP is not set
606# CONFIG_SCSI_CXGB3_ISCSI is not set 614# CONFIG_SCSI_CXGB3_ISCSI is not set
607# CONFIG_SCSI_BNX2_ISCSI is not set 615# CONFIG_SCSI_BNX2_ISCSI is not set
616# CONFIG_BE2ISCSI is not set
608# CONFIG_BLK_DEV_3W_XXXX_RAID is not set 617# CONFIG_BLK_DEV_3W_XXXX_RAID is not set
609# CONFIG_SCSI_3W_9XXX is not set 618# CONFIG_SCSI_3W_9XXX is not set
610# CONFIG_SCSI_ACARD is not set 619# CONFIG_SCSI_ACARD is not set
@@ -644,11 +653,14 @@ CONFIG_SCSI_LOWLEVEL=y
644# CONFIG_SCSI_DC390T is not set 653# CONFIG_SCSI_DC390T is not set
645# CONFIG_SCSI_NSP32 is not set 654# CONFIG_SCSI_NSP32 is not set
646# CONFIG_SCSI_DEBUG is not set 655# CONFIG_SCSI_DEBUG is not set
656# CONFIG_SCSI_PMCRAID is not set
647# CONFIG_SCSI_SRP is not set 657# CONFIG_SCSI_SRP is not set
658# CONFIG_SCSI_BFA_FC is not set
648# CONFIG_SCSI_DH is not set 659# CONFIG_SCSI_DH is not set
649# CONFIG_SCSI_OSD_INITIATOR is not set 660# CONFIG_SCSI_OSD_INITIATOR is not set
650CONFIG_ATA=y 661CONFIG_ATA=y
651# CONFIG_ATA_NONSTANDARD is not set 662# CONFIG_ATA_NONSTANDARD is not set
663CONFIG_ATA_VERBOSE_ERROR=y
652CONFIG_SATA_PMP=y 664CONFIG_SATA_PMP=y
653# CONFIG_SATA_AHCI is not set 665# CONFIG_SATA_AHCI is not set
654# CONFIG_SATA_SIL24 is not set 666# CONFIG_SATA_SIL24 is not set
@@ -671,6 +683,7 @@ CONFIG_ATA_SFF=y
671# CONFIG_PATA_ALI is not set 683# CONFIG_PATA_ALI is not set
672# CONFIG_PATA_AMD is not set 684# CONFIG_PATA_AMD is not set
673# CONFIG_PATA_ARTOP is not set 685# CONFIG_PATA_ARTOP is not set
686# CONFIG_PATA_ATP867X is not set
674# CONFIG_PATA_ATIIXP is not set 687# CONFIG_PATA_ATIIXP is not set
675# CONFIG_PATA_CMD640_PCI is not set 688# CONFIG_PATA_CMD640_PCI is not set
676# CONFIG_PATA_CMD64X is not set 689# CONFIG_PATA_CMD64X is not set
@@ -698,6 +711,7 @@ CONFIG_ATA_SFF=y
698# CONFIG_PATA_OPTIDMA is not set 711# CONFIG_PATA_OPTIDMA is not set
699# CONFIG_PATA_PDC_OLD is not set 712# CONFIG_PATA_PDC_OLD is not set
700# CONFIG_PATA_RADISYS is not set 713# CONFIG_PATA_RADISYS is not set
714# CONFIG_PATA_RDC is not set
701# CONFIG_PATA_RZ1000 is not set 715# CONFIG_PATA_RZ1000 is not set
702# CONFIG_PATA_SC1200 is not set 716# CONFIG_PATA_SC1200 is not set
703# CONFIG_PATA_SERVERWORKS is not set 717# CONFIG_PATA_SERVERWORKS is not set
@@ -802,9 +816,11 @@ CONFIG_E100=y
802# CONFIG_TLAN is not set 816# CONFIG_TLAN is not set
803# CONFIG_KS8842 is not set 817# CONFIG_KS8842 is not set
804# CONFIG_KS8851 is not set 818# CONFIG_KS8851 is not set
819# CONFIG_KS8851_MLL is not set
805# CONFIG_VIA_RHINE is not set 820# CONFIG_VIA_RHINE is not set
806# CONFIG_SC92031 is not set 821# CONFIG_SC92031 is not set
807# CONFIG_ATL2 is not set 822# CONFIG_ATL2 is not set
823# CONFIG_XILINX_EMACLITE is not set
808CONFIG_NETDEV_1000=y 824CONFIG_NETDEV_1000=y
809# CONFIG_ACENIC is not set 825# CONFIG_ACENIC is not set
810# CONFIG_DL2K is not set 826# CONFIG_DL2K is not set
@@ -852,10 +868,7 @@ CONFIG_CHELSIO_T3_DEPENDS=y
852# CONFIG_SFC is not set 868# CONFIG_SFC is not set
853# CONFIG_BE2NET is not set 869# CONFIG_BE2NET is not set
854# CONFIG_TR is not set 870# CONFIG_TR is not set
855 871CONFIG_WLAN=y
856#
857# Wireless LAN
858#
859# CONFIG_WLAN_PRE80211 is not set 872# CONFIG_WLAN_PRE80211 is not set
860# CONFIG_WLAN_80211 is not set 873# CONFIG_WLAN_80211 is not set
861 874
@@ -957,6 +970,7 @@ CONFIG_HW_RANDOM=y
957CONFIG_DEVPORT=y 970CONFIG_DEVPORT=y
958CONFIG_I2C=y 971CONFIG_I2C=y
959CONFIG_I2C_BOARDINFO=y 972CONFIG_I2C_BOARDINFO=y
973CONFIG_I2C_COMPAT=y
960CONFIG_I2C_CHARDEV=y 974CONFIG_I2C_CHARDEV=y
961CONFIG_I2C_HELPER_AUTO=y 975CONFIG_I2C_HELPER_AUTO=y
962 976
@@ -1011,9 +1025,6 @@ CONFIG_I2C_MPC=y
1011# Miscellaneous I2C Chip support 1025# Miscellaneous I2C Chip support
1012# 1026#
1013# CONFIG_DS1682 is not set 1027# CONFIG_DS1682 is not set
1014# CONFIG_SENSORS_PCF8574 is not set
1015# CONFIG_PCF8575 is not set
1016# CONFIG_SENSORS_PCA9539 is not set
1017# CONFIG_SENSORS_TSL2550 is not set 1028# CONFIG_SENSORS_TSL2550 is not set
1018# CONFIG_I2C_DEBUG_CORE is not set 1029# CONFIG_I2C_DEBUG_CORE is not set
1019# CONFIG_I2C_DEBUG_ALGO is not set 1030# CONFIG_I2C_DEBUG_ALGO is not set
@@ -1045,6 +1056,11 @@ CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y
1045# CONFIG_POWER_SUPPLY is not set 1056# CONFIG_POWER_SUPPLY is not set
1046CONFIG_HWMON=y 1057CONFIG_HWMON=y
1047# CONFIG_HWMON_VID is not set 1058# CONFIG_HWMON_VID is not set
1059# CONFIG_HWMON_DEBUG_CHIP is not set
1060
1061#
1062# Native drivers
1063#
1048# CONFIG_SENSORS_AD7414 is not set 1064# CONFIG_SENSORS_AD7414 is not set
1049# CONFIG_SENSORS_AD7418 is not set 1065# CONFIG_SENSORS_AD7418 is not set
1050# CONFIG_SENSORS_ADCXX is not set 1066# CONFIG_SENSORS_ADCXX is not set
@@ -1097,6 +1113,7 @@ CONFIG_HWMON=y
1097# CONFIG_SENSORS_ADS7828 is not set 1113# CONFIG_SENSORS_ADS7828 is not set
1098# CONFIG_SENSORS_THMC50 is not set 1114# CONFIG_SENSORS_THMC50 is not set
1099# CONFIG_SENSORS_TMP401 is not set 1115# CONFIG_SENSORS_TMP401 is not set
1116# CONFIG_SENSORS_TMP421 is not set
1100# CONFIG_SENSORS_VIA686A is not set 1117# CONFIG_SENSORS_VIA686A is not set
1101# CONFIG_SENSORS_VT1211 is not set 1118# CONFIG_SENSORS_VT1211 is not set
1102# CONFIG_SENSORS_VT8231 is not set 1119# CONFIG_SENSORS_VT8231 is not set
@@ -1109,9 +1126,7 @@ CONFIG_HWMON=y
1109# CONFIG_SENSORS_W83627HF is not set 1126# CONFIG_SENSORS_W83627HF is not set
1110# CONFIG_SENSORS_W83627EHF is not set 1127# CONFIG_SENSORS_W83627EHF is not set
1111# CONFIG_SENSORS_LIS3_SPI is not set 1128# CONFIG_SENSORS_LIS3_SPI is not set
1112# CONFIG_HWMON_DEBUG_CHIP is not set
1113# CONFIG_THERMAL is not set 1129# CONFIG_THERMAL is not set
1114# CONFIG_THERMAL_HWMON is not set
1115CONFIG_WATCHDOG=y 1130CONFIG_WATCHDOG=y
1116# CONFIG_WATCHDOG_NOWAYOUT is not set 1131# CONFIG_WATCHDOG_NOWAYOUT is not set
1117 1132
@@ -1149,8 +1164,10 @@ CONFIG_SSB_POSSIBLE=y
1149# CONFIG_MFD_TMIO is not set 1164# CONFIG_MFD_TMIO is not set
1150# CONFIG_PMIC_DA903X is not set 1165# CONFIG_PMIC_DA903X is not set
1151# CONFIG_MFD_WM8400 is not set 1166# CONFIG_MFD_WM8400 is not set
1167# CONFIG_MFD_WM831X is not set
1152# CONFIG_MFD_WM8350_I2C is not set 1168# CONFIG_MFD_WM8350_I2C is not set
1153# CONFIG_MFD_PCF50633 is not set 1169# CONFIG_MFD_PCF50633 is not set
1170# CONFIG_MFD_MC13783 is not set
1154# CONFIG_AB3100_CORE is not set 1171# CONFIG_AB3100_CORE is not set
1155# CONFIG_EZX_PCAP is not set 1172# CONFIG_EZX_PCAP is not set
1156# CONFIG_REGULATOR is not set 1173# CONFIG_REGULATOR is not set
@@ -1160,6 +1177,7 @@ CONFIG_SSB_POSSIBLE=y
1160# Graphics support 1177# Graphics support
1161# 1178#
1162# CONFIG_AGP is not set 1179# CONFIG_AGP is not set
1180CONFIG_VGA_ARB=y
1163# CONFIG_DRM is not set 1181# CONFIG_DRM is not set
1164# CONFIG_VGASTATE is not set 1182# CONFIG_VGASTATE is not set
1165CONFIG_VIDEO_OUTPUT_CONTROL=m 1183CONFIG_VIDEO_OUTPUT_CONTROL=m
@@ -1173,7 +1191,6 @@ CONFIG_VIDEO_OUTPUT_CONTROL=m
1173# CONFIG_SOUND is not set 1191# CONFIG_SOUND is not set
1174CONFIG_HID_SUPPORT=y 1192CONFIG_HID_SUPPORT=y
1175CONFIG_HID=y 1193CONFIG_HID=y
1176# CONFIG_HID_DEBUG is not set
1177# CONFIG_HIDRAW is not set 1194# CONFIG_HIDRAW is not set
1178 1195
1179# 1196#
@@ -1225,6 +1242,7 @@ CONFIG_USB_EHCI_HCD_PPC_OF=y
1225# CONFIG_USB_OXU210HP_HCD is not set 1242# CONFIG_USB_OXU210HP_HCD is not set
1226# CONFIG_USB_ISP116X_HCD is not set 1243# CONFIG_USB_ISP116X_HCD is not set
1227# CONFIG_USB_ISP1760_HCD is not set 1244# CONFIG_USB_ISP1760_HCD is not set
1245# CONFIG_USB_ISP1362_HCD is not set
1228CONFIG_USB_OHCI_HCD=y 1246CONFIG_USB_OHCI_HCD=y
1229CONFIG_USB_OHCI_HCD_PPC_OF_BE=y 1247CONFIG_USB_OHCI_HCD_PPC_OF_BE=y
1230# CONFIG_USB_OHCI_HCD_PPC_OF_LE is not set 1248# CONFIG_USB_OHCI_HCD_PPC_OF_LE is not set
@@ -1316,6 +1334,7 @@ CONFIG_USB_GADGET_SELECTED=y
1316# CONFIG_USB_GADGET_LH7A40X is not set 1334# CONFIG_USB_GADGET_LH7A40X is not set
1317# CONFIG_USB_GADGET_OMAP is not set 1335# CONFIG_USB_GADGET_OMAP is not set
1318# CONFIG_USB_GADGET_PXA25X is not set 1336# CONFIG_USB_GADGET_PXA25X is not set
1337# CONFIG_USB_GADGET_R8A66597 is not set
1319# CONFIG_USB_GADGET_PXA27X is not set 1338# CONFIG_USB_GADGET_PXA27X is not set
1320# CONFIG_USB_GADGET_S3C_HSOTG is not set 1339# CONFIG_USB_GADGET_S3C_HSOTG is not set
1321# CONFIG_USB_GADGET_IMX is not set 1340# CONFIG_USB_GADGET_IMX is not set
@@ -1334,6 +1353,7 @@ CONFIG_USB_GADGET_DUALSPEED=y
1334# CONFIG_USB_AUDIO is not set 1353# CONFIG_USB_AUDIO is not set
1335CONFIG_USB_ETH=y 1354CONFIG_USB_ETH=y
1336CONFIG_USB_ETH_RNDIS=y 1355CONFIG_USB_ETH_RNDIS=y
1356# CONFIG_USB_ETH_EEM is not set
1337# CONFIG_USB_GADGETFS is not set 1357# CONFIG_USB_GADGETFS is not set
1338# CONFIG_USB_FILE_STORAGE is not set 1358# CONFIG_USB_FILE_STORAGE is not set
1339# CONFIG_USB_G_SERIAL is not set 1359# CONFIG_USB_G_SERIAL is not set
@@ -1395,6 +1415,7 @@ CONFIG_RTC_DRV_DS1307=y
1395# CONFIG_RTC_DRV_R9701 is not set 1415# CONFIG_RTC_DRV_R9701 is not set
1396# CONFIG_RTC_DRV_RS5C348 is not set 1416# CONFIG_RTC_DRV_RS5C348 is not set
1397# CONFIG_RTC_DRV_DS3234 is not set 1417# CONFIG_RTC_DRV_DS3234 is not set
1418# CONFIG_RTC_DRV_PCF2123 is not set
1398 1419
1399# 1420#
1400# Platform RTC drivers 1421# Platform RTC drivers
@@ -1445,6 +1466,7 @@ CONFIG_FS_MBCACHE=y
1445# CONFIG_GFS2_FS is not set 1466# CONFIG_GFS2_FS is not set
1446# CONFIG_OCFS2_FS is not set 1467# CONFIG_OCFS2_FS is not set
1447# CONFIG_BTRFS_FS is not set 1468# CONFIG_BTRFS_FS is not set
1469# CONFIG_NILFS2_FS is not set
1448CONFIG_FILE_LOCKING=y 1470CONFIG_FILE_LOCKING=y
1449CONFIG_FSNOTIFY=y 1471CONFIG_FSNOTIFY=y
1450CONFIG_DNOTIFY=y 1472CONFIG_DNOTIFY=y
@@ -1514,7 +1536,6 @@ CONFIG_JFFS2_RTIME=y
1514# CONFIG_ROMFS_FS is not set 1536# CONFIG_ROMFS_FS is not set
1515# CONFIG_SYSV_FS is not set 1537# CONFIG_SYSV_FS is not set
1516# CONFIG_UFS_FS is not set 1538# CONFIG_UFS_FS is not set
1517# CONFIG_NILFS2_FS is not set
1518CONFIG_NETWORK_FILESYSTEMS=y 1539CONFIG_NETWORK_FILESYSTEMS=y
1519CONFIG_NFS_FS=y 1540CONFIG_NFS_FS=y
1520CONFIG_NFS_V3=y 1541CONFIG_NFS_V3=y
@@ -1630,6 +1651,7 @@ CONFIG_ENABLE_WARN_DEPRECATED=y
1630CONFIG_ENABLE_MUST_CHECK=y 1651CONFIG_ENABLE_MUST_CHECK=y
1631CONFIG_FRAME_WARN=1024 1652CONFIG_FRAME_WARN=1024
1632# CONFIG_MAGIC_SYSRQ is not set 1653# CONFIG_MAGIC_SYSRQ is not set
1654# CONFIG_STRIP_ASM_SYMS is not set
1633# CONFIG_UNUSED_SYMBOLS is not set 1655# CONFIG_UNUSED_SYMBOLS is not set
1634# CONFIG_DEBUG_FS is not set 1656# CONFIG_DEBUG_FS is not set
1635# CONFIG_HEADERS_CHECK is not set 1657# CONFIG_HEADERS_CHECK is not set
@@ -1647,6 +1669,7 @@ CONFIG_SCHED_DEBUG=y
1647# CONFIG_DEBUG_OBJECTS is not set 1669# CONFIG_DEBUG_OBJECTS is not set
1648# CONFIG_SLUB_DEBUG_ON is not set 1670# CONFIG_SLUB_DEBUG_ON is not set
1649# CONFIG_SLUB_STATS is not set 1671# CONFIG_SLUB_STATS is not set
1672# CONFIG_DEBUG_KMEMLEAK is not set
1650# CONFIG_DEBUG_RT_MUTEXES is not set 1673# CONFIG_DEBUG_RT_MUTEXES is not set
1651# CONFIG_RT_MUTEX_TESTER is not set 1674# CONFIG_RT_MUTEX_TESTER is not set
1652# CONFIG_DEBUG_SPINLOCK is not set 1675# CONFIG_DEBUG_SPINLOCK is not set
@@ -1665,10 +1688,12 @@ CONFIG_SCHED_DEBUG=y
1665# CONFIG_DEBUG_LIST is not set 1688# CONFIG_DEBUG_LIST is not set
1666# CONFIG_DEBUG_SG is not set 1689# CONFIG_DEBUG_SG is not set
1667# CONFIG_DEBUG_NOTIFIERS is not set 1690# CONFIG_DEBUG_NOTIFIERS is not set
1691# CONFIG_DEBUG_CREDENTIALS is not set
1668# CONFIG_RCU_TORTURE_TEST is not set 1692# CONFIG_RCU_TORTURE_TEST is not set
1669# CONFIG_RCU_CPU_STALL_DETECTOR is not set 1693# CONFIG_RCU_CPU_STALL_DETECTOR is not set
1670# CONFIG_BACKTRACE_SELF_TEST is not set 1694# CONFIG_BACKTRACE_SELF_TEST is not set
1671# CONFIG_DEBUG_BLOCK_EXT_DEVT is not set 1695# CONFIG_DEBUG_BLOCK_EXT_DEVT is not set
1696# CONFIG_DEBUG_FORCE_WEAK_PER_CPU is not set
1672# CONFIG_FAULT_INJECTION is not set 1697# CONFIG_FAULT_INJECTION is not set
1673# CONFIG_LATENCYTOP is not set 1698# CONFIG_LATENCYTOP is not set
1674CONFIG_SYSCTL_SYSCALL_CHECK=y 1699CONFIG_SYSCTL_SYSCALL_CHECK=y
@@ -1691,10 +1716,10 @@ CONFIG_BRANCH_PROFILE_NONE=y
1691# CONFIG_KMEMTRACE is not set 1716# CONFIG_KMEMTRACE is not set
1692# CONFIG_WORKQUEUE_TRACER is not set 1717# CONFIG_WORKQUEUE_TRACER is not set
1693# CONFIG_BLK_DEV_IO_TRACE is not set 1718# CONFIG_BLK_DEV_IO_TRACE is not set
1719# CONFIG_DMA_API_DEBUG is not set
1694# CONFIG_SAMPLES is not set 1720# CONFIG_SAMPLES is not set
1695CONFIG_HAVE_ARCH_KGDB=y 1721CONFIG_HAVE_ARCH_KGDB=y
1696# CONFIG_KGDB is not set 1722# CONFIG_KGDB is not set
1697# CONFIG_KMEMCHECK is not set
1698# CONFIG_PPC_DISABLE_WERROR is not set 1723# CONFIG_PPC_DISABLE_WERROR is not set
1699CONFIG_PPC_WERROR=y 1724CONFIG_PPC_WERROR=y
1700CONFIG_PRINT_STACK_DEPTH=64 1725CONFIG_PRINT_STACK_DEPTH=64
@@ -1721,7 +1746,6 @@ CONFIG_CRYPTO=y
1721# 1746#
1722# Crypto core or helper 1747# Crypto core or helper
1723# 1748#
1724# CONFIG_CRYPTO_FIPS is not set
1725CONFIG_CRYPTO_ALGAPI=y 1749CONFIG_CRYPTO_ALGAPI=y
1726CONFIG_CRYPTO_ALGAPI2=y 1750CONFIG_CRYPTO_ALGAPI2=y
1727CONFIG_CRYPTO_AEAD2=y 1751CONFIG_CRYPTO_AEAD2=y
@@ -1763,11 +1787,13 @@ CONFIG_CRYPTO_PCBC=m
1763# 1787#
1764# CONFIG_CRYPTO_HMAC is not set 1788# CONFIG_CRYPTO_HMAC is not set
1765# CONFIG_CRYPTO_XCBC is not set 1789# CONFIG_CRYPTO_XCBC is not set
1790# CONFIG_CRYPTO_VMAC is not set
1766 1791
1767# 1792#
1768# Digest 1793# Digest
1769# 1794#
1770# CONFIG_CRYPTO_CRC32C is not set 1795# CONFIG_CRYPTO_CRC32C is not set
1796# CONFIG_CRYPTO_GHASH is not set
1771# CONFIG_CRYPTO_MD4 is not set 1797# CONFIG_CRYPTO_MD4 is not set
1772CONFIG_CRYPTO_MD5=y 1798CONFIG_CRYPTO_MD5=y
1773# CONFIG_CRYPTO_MICHAEL_MIC is not set 1799# CONFIG_CRYPTO_MICHAEL_MIC is not set
diff --git a/arch/powerpc/configs/83xx/mpc832x_mds_defconfig b/arch/powerpc/configs/83xx/mpc832x_mds_defconfig
index e0e36a113409..7def83518a6c 100644
--- a/arch/powerpc/configs/83xx/mpc832x_mds_defconfig
+++ b/arch/powerpc/configs/83xx/mpc832x_mds_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.31-rc4 3# Linux kernel version: 2.6.32-rc5
4# Wed Jul 29 23:32:06 2009 4# Thu Nov 5 08:20:24 2009
5# 5#
6# CONFIG_PPC64 is not set 6# CONFIG_PPC64 is not set
7 7
@@ -35,6 +35,7 @@ CONFIG_GENERIC_CLOCKEVENTS=y
35CONFIG_GENERIC_HARDIRQS=y 35CONFIG_GENERIC_HARDIRQS=y
36CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y 36CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y
37# CONFIG_HAVE_SETUP_PER_CPU_AREA is not set 37# CONFIG_HAVE_SETUP_PER_CPU_AREA is not set
38# CONFIG_NEED_PER_CPU_EMBED_FIRST_CHUNK 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
@@ -84,11 +85,12 @@ CONFIG_SYSVIPC_SYSCTL=y
84# 85#
85# RCU Subsystem 86# RCU Subsystem
86# 87#
87CONFIG_CLASSIC_RCU=y 88CONFIG_TREE_RCU=y
88# CONFIG_TREE_RCU is not set 89# CONFIG_TREE_PREEMPT_RCU is not set
89# CONFIG_PREEMPT_RCU is not set 90# CONFIG_RCU_TRACE is not set
91CONFIG_RCU_FANOUT=32
92# CONFIG_RCU_FANOUT_EXACT is not set
90# CONFIG_TREE_RCU_TRACE is not set 93# CONFIG_TREE_RCU_TRACE is not set
91# CONFIG_PREEMPT_RCU_TRACE is not set
92# CONFIG_IKCONFIG is not set 94# CONFIG_IKCONFIG is not set
93CONFIG_LOG_BUF_SHIFT=14 95CONFIG_LOG_BUF_SHIFT=14
94CONFIG_GROUP_SCHED=y 96CONFIG_GROUP_SCHED=y
@@ -124,28 +126,29 @@ CONFIG_TIMERFD=y
124CONFIG_EVENTFD=y 126CONFIG_EVENTFD=y
125CONFIG_SHMEM=y 127CONFIG_SHMEM=y
126CONFIG_AIO=y 128CONFIG_AIO=y
127CONFIG_HAVE_PERF_COUNTERS=y 129CONFIG_HAVE_PERF_EVENTS=y
128 130
129# 131#
130# Performance Counters 132# Kernel Performance Events And Counters
131# 133#
134# CONFIG_PERF_EVENTS is not set
132# CONFIG_PERF_COUNTERS is not set 135# CONFIG_PERF_COUNTERS is not set
133CONFIG_VM_EVENT_COUNTERS=y 136CONFIG_VM_EVENT_COUNTERS=y
134CONFIG_PCI_QUIRKS=y 137CONFIG_PCI_QUIRKS=y
135CONFIG_SLUB_DEBUG=y 138CONFIG_SLUB_DEBUG=y
136# CONFIG_STRIP_ASM_SYMS is not set
137CONFIG_COMPAT_BRK=y 139CONFIG_COMPAT_BRK=y
138# CONFIG_SLAB is not set 140# CONFIG_SLAB is not set
139CONFIG_SLUB=y 141CONFIG_SLUB=y
140# CONFIG_SLOB is not set 142# CONFIG_SLOB is not set
141# CONFIG_PROFILING is not set 143# CONFIG_PROFILING is not set
142# CONFIG_MARKERS is not set
143CONFIG_HAVE_OPROFILE=y 144CONFIG_HAVE_OPROFILE=y
144CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS=y 145CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS=y
145CONFIG_HAVE_IOREMAP_PROT=y 146CONFIG_HAVE_IOREMAP_PROT=y
146CONFIG_HAVE_KPROBES=y 147CONFIG_HAVE_KPROBES=y
147CONFIG_HAVE_KRETPROBES=y 148CONFIG_HAVE_KRETPROBES=y
148CONFIG_HAVE_ARCH_TRACEHOOK=y 149CONFIG_HAVE_ARCH_TRACEHOOK=y
150CONFIG_HAVE_DMA_ATTRS=y
151CONFIG_HAVE_DMA_API_DEBUG=y
149 152
150# 153#
151# GCOV-based kernel profiling 154# GCOV-based kernel profiling
@@ -257,6 +260,7 @@ CONFIG_ARCH_HAS_WALK_MEMORY=y
257CONFIG_ARCH_ENABLE_MEMORY_HOTREMOVE=y 260CONFIG_ARCH_ENABLE_MEMORY_HOTREMOVE=y
258# CONFIG_KEXEC is not set 261# CONFIG_KEXEC is not set
259# CONFIG_CRASH_DUMP is not set 262# CONFIG_CRASH_DUMP is not set
263CONFIG_MAX_ACTIVE_REGIONS=32
260CONFIG_ARCH_FLATMEM_ENABLE=y 264CONFIG_ARCH_FLATMEM_ENABLE=y
261CONFIG_ARCH_POPULATES_NODE_MAP=y 265CONFIG_ARCH_POPULATES_NODE_MAP=y
262CONFIG_SELECT_MEMORY_MODEL=y 266CONFIG_SELECT_MEMORY_MODEL=y
@@ -274,6 +278,7 @@ CONFIG_BOUNCE=y
274CONFIG_VIRT_TO_BUS=y 278CONFIG_VIRT_TO_BUS=y
275CONFIG_HAVE_MLOCK=y 279CONFIG_HAVE_MLOCK=y
276CONFIG_HAVE_MLOCKED_PAGE_BIT=y 280CONFIG_HAVE_MLOCKED_PAGE_BIT=y
281# CONFIG_KSM is not set
277CONFIG_DEFAULT_MMAP_MIN_ADDR=4096 282CONFIG_DEFAULT_MMAP_MIN_ADDR=4096
278CONFIG_PPC_4K_PAGES=y 283CONFIG_PPC_4K_PAGES=y
279# CONFIG_PPC_16K_PAGES is not set 284# CONFIG_PPC_16K_PAGES is not set
@@ -369,6 +374,7 @@ CONFIG_DEFAULT_TCP_CONG="cubic"
369# CONFIG_NETFILTER is not set 374# CONFIG_NETFILTER is not set
370# CONFIG_IP_DCCP is not set 375# CONFIG_IP_DCCP is not set
371# CONFIG_IP_SCTP is not set 376# CONFIG_IP_SCTP is not set
377# CONFIG_RDS is not set
372# CONFIG_TIPC is not set 378# CONFIG_TIPC is not set
373# CONFIG_ATM is not set 379# CONFIG_ATM is not set
374# CONFIG_BRIDGE is not set 380# CONFIG_BRIDGE is not set
@@ -398,6 +404,7 @@ CONFIG_DEFAULT_TCP_CONG="cubic"
398# CONFIG_AF_RXRPC is not set 404# CONFIG_AF_RXRPC is not set
399CONFIG_WIRELESS=y 405CONFIG_WIRELESS=y
400# CONFIG_CFG80211 is not set 406# CONFIG_CFG80211 is not set
407CONFIG_CFG80211_DEFAULT_PS_VALUE=0
401CONFIG_WIRELESS_OLD_REGULATORY=y 408CONFIG_WIRELESS_OLD_REGULATORY=y
402# CONFIG_WIRELESS_EXT is not set 409# CONFIG_WIRELESS_EXT is not set
403# CONFIG_LIB80211 is not set 410# CONFIG_LIB80211 is not set
@@ -405,7 +412,6 @@ CONFIG_WIRELESS_OLD_REGULATORY=y
405# 412#
406# CFG80211 needs to be enabled for MAC80211 413# CFG80211 needs to be enabled for MAC80211
407# 414#
408CONFIG_MAC80211_DEFAULT_PS_VALUE=0
409# CONFIG_WIMAX is not set 415# CONFIG_WIMAX is not set
410# CONFIG_RFKILL is not set 416# CONFIG_RFKILL is not set
411# CONFIG_NET_9P is not set 417# CONFIG_NET_9P is not set
@@ -418,6 +424,7 @@ CONFIG_MAC80211_DEFAULT_PS_VALUE=0
418# Generic Driver Options 424# Generic Driver Options
419# 425#
420CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug" 426CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
427# CONFIG_DEVTMPFS is not set
421CONFIG_STANDALONE=y 428CONFIG_STANDALONE=y
422CONFIG_PREVENT_FIRMWARE_BUILD=y 429CONFIG_PREVENT_FIRMWARE_BUILD=y
423# CONFIG_FW_LOADER is not set 430# CONFIG_FW_LOADER is not set
@@ -504,6 +511,7 @@ CONFIG_SCSI_LOWLEVEL=y
504# CONFIG_ISCSI_TCP is not set 511# CONFIG_ISCSI_TCP is not set
505# CONFIG_SCSI_CXGB3_ISCSI is not set 512# CONFIG_SCSI_CXGB3_ISCSI is not set
506# CONFIG_SCSI_BNX2_ISCSI is not set 513# CONFIG_SCSI_BNX2_ISCSI is not set
514# CONFIG_BE2ISCSI is not set
507# CONFIG_BLK_DEV_3W_XXXX_RAID is not set 515# CONFIG_BLK_DEV_3W_XXXX_RAID is not set
508# CONFIG_SCSI_3W_9XXX is not set 516# CONFIG_SCSI_3W_9XXX is not set
509# CONFIG_SCSI_ACARD is not set 517# CONFIG_SCSI_ACARD is not set
@@ -542,7 +550,9 @@ CONFIG_SCSI_LOWLEVEL=y
542# CONFIG_SCSI_DC390T is not set 550# CONFIG_SCSI_DC390T is not set
543# CONFIG_SCSI_NSP32 is not set 551# CONFIG_SCSI_NSP32 is not set
544# CONFIG_SCSI_DEBUG is not set 552# CONFIG_SCSI_DEBUG is not set
553# CONFIG_SCSI_PMCRAID is not set
545# CONFIG_SCSI_SRP is not set 554# CONFIG_SCSI_SRP is not set
555# CONFIG_SCSI_BFA_FC is not set
546# CONFIG_SCSI_DH is not set 556# CONFIG_SCSI_DH is not set
547# CONFIG_SCSI_OSD_INITIATOR is not set 557# CONFIG_SCSI_OSD_INITIATOR is not set
548# CONFIG_ATA is not set 558# CONFIG_ATA is not set
@@ -612,7 +622,9 @@ CONFIG_MII=y
612# CONFIG_NET_PCI is not set 622# CONFIG_NET_PCI is not set
613# CONFIG_B44 is not set 623# CONFIG_B44 is not set
614# CONFIG_KS8842 is not set 624# CONFIG_KS8842 is not set
625# CONFIG_KS8851_MLL is not set
615# CONFIG_ATL2 is not set 626# CONFIG_ATL2 is not set
627# CONFIG_XILINX_EMACLITE is not set
616CONFIG_NETDEV_1000=y 628CONFIG_NETDEV_1000=y
617# CONFIG_ACENIC is not set 629# CONFIG_ACENIC is not set
618# CONFIG_DL2K is not set 630# CONFIG_DL2K is not set
@@ -635,7 +647,6 @@ CONFIG_NETDEV_1000=y
635CONFIG_FSL_PQ_MDIO=y 647CONFIG_FSL_PQ_MDIO=y
636# CONFIG_GIANFAR is not set 648# CONFIG_GIANFAR is not set
637CONFIG_UCC_GETH=y 649CONFIG_UCC_GETH=y
638# CONFIG_UGETH_MAGIC_PACKET is not set
639# CONFIG_UGETH_TX_ON_DEMAND is not set 650# CONFIG_UGETH_TX_ON_DEMAND is not set
640# CONFIG_MV643XX_ETH is not set 651# CONFIG_MV643XX_ETH is not set
641# CONFIG_QLA3XXX is not set 652# CONFIG_QLA3XXX is not set
@@ -663,10 +674,7 @@ CONFIG_CHELSIO_T3_DEPENDS=y
663# CONFIG_SFC is not set 674# CONFIG_SFC is not set
664# CONFIG_BE2NET is not set 675# CONFIG_BE2NET is not set
665# CONFIG_TR is not set 676# CONFIG_TR is not set
666 677CONFIG_WLAN=y
667#
668# Wireless LAN
669#
670# CONFIG_WLAN_PRE80211 is not set 678# CONFIG_WLAN_PRE80211 is not set
671# CONFIG_WLAN_80211 is not set 679# CONFIG_WLAN_80211 is not set
672 680
@@ -759,6 +767,7 @@ CONFIG_HW_RANDOM=y
759CONFIG_DEVPORT=y 767CONFIG_DEVPORT=y
760CONFIG_I2C=y 768CONFIG_I2C=y
761CONFIG_I2C_BOARDINFO=y 769CONFIG_I2C_BOARDINFO=y
770CONFIG_I2C_COMPAT=y
762CONFIG_I2C_CHARDEV=y 771CONFIG_I2C_CHARDEV=y
763CONFIG_I2C_HELPER_AUTO=y 772CONFIG_I2C_HELPER_AUTO=y
764 773
@@ -812,9 +821,6 @@ CONFIG_I2C_MPC=y
812# Miscellaneous I2C Chip support 821# Miscellaneous I2C Chip support
813# 822#
814# CONFIG_DS1682 is not set 823# CONFIG_DS1682 is not set
815# CONFIG_SENSORS_PCF8574 is not set
816# CONFIG_PCF8575 is not set
817# CONFIG_SENSORS_PCA9539 is not set
818# CONFIG_SENSORS_TSL2550 is not set 824# CONFIG_SENSORS_TSL2550 is not set
819# CONFIG_I2C_DEBUG_CORE is not set 825# CONFIG_I2C_DEBUG_CORE is not set
820# CONFIG_I2C_DEBUG_ALGO is not set 826# CONFIG_I2C_DEBUG_ALGO is not set
@@ -832,6 +838,11 @@ CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y
832# CONFIG_POWER_SUPPLY is not set 838# CONFIG_POWER_SUPPLY is not set
833CONFIG_HWMON=y 839CONFIG_HWMON=y
834# CONFIG_HWMON_VID is not set 840# CONFIG_HWMON_VID is not set
841# CONFIG_HWMON_DEBUG_CHIP is not set
842
843#
844# Native drivers
845#
835# CONFIG_SENSORS_AD7414 is not set 846# CONFIG_SENSORS_AD7414 is not set
836# CONFIG_SENSORS_AD7418 is not set 847# CONFIG_SENSORS_AD7418 is not set
837# CONFIG_SENSORS_ADM1021 is not set 848# CONFIG_SENSORS_ADM1021 is not set
@@ -881,6 +892,7 @@ CONFIG_HWMON=y
881# CONFIG_SENSORS_ADS7828 is not set 892# CONFIG_SENSORS_ADS7828 is not set
882# CONFIG_SENSORS_THMC50 is not set 893# CONFIG_SENSORS_THMC50 is not set
883# CONFIG_SENSORS_TMP401 is not set 894# CONFIG_SENSORS_TMP401 is not set
895# CONFIG_SENSORS_TMP421 is not set
884# CONFIG_SENSORS_VIA686A is not set 896# CONFIG_SENSORS_VIA686A is not set
885# CONFIG_SENSORS_VT1211 is not set 897# CONFIG_SENSORS_VT1211 is not set
886# CONFIG_SENSORS_VT8231 is not set 898# CONFIG_SENSORS_VT8231 is not set
@@ -892,9 +904,7 @@ CONFIG_HWMON=y
892# CONFIG_SENSORS_W83L786NG is not set 904# CONFIG_SENSORS_W83L786NG is not set
893# CONFIG_SENSORS_W83627HF is not set 905# CONFIG_SENSORS_W83627HF is not set
894# CONFIG_SENSORS_W83627EHF is not set 906# CONFIG_SENSORS_W83627EHF is not set
895# CONFIG_HWMON_DEBUG_CHIP is not set
896# CONFIG_THERMAL is not set 907# CONFIG_THERMAL is not set
897# CONFIG_THERMAL_HWMON is not set
898CONFIG_WATCHDOG=y 908CONFIG_WATCHDOG=y
899# CONFIG_WATCHDOG_NOWAYOUT is not set 909# CONFIG_WATCHDOG_NOWAYOUT is not set
900 910
@@ -927,6 +937,7 @@ CONFIG_SSB_POSSIBLE=y
927# CONFIG_MFD_TMIO is not set 937# CONFIG_MFD_TMIO is not set
928# CONFIG_PMIC_DA903X is not set 938# CONFIG_PMIC_DA903X is not set
929# CONFIG_MFD_WM8400 is not set 939# CONFIG_MFD_WM8400 is not set
940# CONFIG_MFD_WM831X is not set
930# CONFIG_MFD_WM8350_I2C is not set 941# CONFIG_MFD_WM8350_I2C is not set
931# CONFIG_MFD_PCF50633 is not set 942# CONFIG_MFD_PCF50633 is not set
932# CONFIG_AB3100_CORE is not set 943# CONFIG_AB3100_CORE is not set
@@ -937,6 +948,7 @@ CONFIG_SSB_POSSIBLE=y
937# Graphics support 948# Graphics support
938# 949#
939# CONFIG_AGP is not set 950# CONFIG_AGP is not set
951CONFIG_VGA_ARB=y
940# CONFIG_DRM is not set 952# CONFIG_DRM is not set
941# CONFIG_VGASTATE is not set 953# CONFIG_VGASTATE is not set
942CONFIG_VIDEO_OUTPUT_CONTROL=m 954CONFIG_VIDEO_OUTPUT_CONTROL=m
@@ -950,7 +962,6 @@ CONFIG_VIDEO_OUTPUT_CONTROL=m
950# CONFIG_SOUND is not set 962# CONFIG_SOUND is not set
951CONFIG_HID_SUPPORT=y 963CONFIG_HID_SUPPORT=y
952CONFIG_HID=y 964CONFIG_HID=y
953# CONFIG_HID_DEBUG is not set
954# CONFIG_HIDRAW is not set 965# CONFIG_HIDRAW is not set
955# CONFIG_HID_PID is not set 966# CONFIG_HID_PID is not set
956 967
@@ -1070,6 +1081,7 @@ CONFIG_FS_MBCACHE=y
1070# CONFIG_GFS2_FS is not set 1081# CONFIG_GFS2_FS is not set
1071# CONFIG_OCFS2_FS is not set 1082# CONFIG_OCFS2_FS is not set
1072# CONFIG_BTRFS_FS is not set 1083# CONFIG_BTRFS_FS is not set
1084# CONFIG_NILFS2_FS is not set
1073CONFIG_FILE_LOCKING=y 1085CONFIG_FILE_LOCKING=y
1074CONFIG_FSNOTIFY=y 1086CONFIG_FSNOTIFY=y
1075CONFIG_DNOTIFY=y 1087CONFIG_DNOTIFY=y
@@ -1128,7 +1140,6 @@ CONFIG_MISC_FILESYSTEMS=y
1128# CONFIG_ROMFS_FS is not set 1140# CONFIG_ROMFS_FS is not set
1129# CONFIG_SYSV_FS is not set 1141# CONFIG_SYSV_FS is not set
1130# CONFIG_UFS_FS is not set 1142# CONFIG_UFS_FS is not set
1131# CONFIG_NILFS2_FS is not set
1132CONFIG_NETWORK_FILESYSTEMS=y 1143CONFIG_NETWORK_FILESYSTEMS=y
1133CONFIG_NFS_FS=y 1144CONFIG_NFS_FS=y
1134CONFIG_NFS_V3=y 1145CONFIG_NFS_V3=y
@@ -1202,6 +1213,7 @@ CONFIG_ENABLE_WARN_DEPRECATED=y
1202CONFIG_ENABLE_MUST_CHECK=y 1213CONFIG_ENABLE_MUST_CHECK=y
1203CONFIG_FRAME_WARN=1024 1214CONFIG_FRAME_WARN=1024
1204# CONFIG_MAGIC_SYSRQ is not set 1215# CONFIG_MAGIC_SYSRQ is not set
1216# CONFIG_STRIP_ASM_SYMS is not set
1205# CONFIG_UNUSED_SYMBOLS is not set 1217# CONFIG_UNUSED_SYMBOLS is not set
1206# CONFIG_DEBUG_FS is not set 1218# CONFIG_DEBUG_FS is not set
1207# CONFIG_HEADERS_CHECK is not set 1219# CONFIG_HEADERS_CHECK is not set
@@ -1219,6 +1231,7 @@ CONFIG_HAVE_DYNAMIC_FTRACE=y
1219CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y 1231CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y
1220CONFIG_TRACING_SUPPORT=y 1232CONFIG_TRACING_SUPPORT=y
1221# CONFIG_FTRACE is not set 1233# CONFIG_FTRACE is not set
1234# CONFIG_DMA_API_DEBUG is not set
1222# CONFIG_SAMPLES is not set 1235# CONFIG_SAMPLES is not set
1223CONFIG_HAVE_ARCH_KGDB=y 1236CONFIG_HAVE_ARCH_KGDB=y
1224# CONFIG_PPC_DISABLE_WERROR is not set 1237# CONFIG_PPC_DISABLE_WERROR is not set
@@ -1240,7 +1253,6 @@ CONFIG_CRYPTO=y
1240# 1253#
1241# Crypto core or helper 1254# Crypto core or helper
1242# 1255#
1243# CONFIG_CRYPTO_FIPS is not set
1244CONFIG_CRYPTO_ALGAPI=y 1256CONFIG_CRYPTO_ALGAPI=y
1245CONFIG_CRYPTO_ALGAPI2=y 1257CONFIG_CRYPTO_ALGAPI2=y
1246CONFIG_CRYPTO_AEAD2=y 1258CONFIG_CRYPTO_AEAD2=y
@@ -1282,11 +1294,13 @@ CONFIG_CRYPTO_PCBC=m
1282# 1294#
1283# CONFIG_CRYPTO_HMAC is not set 1295# CONFIG_CRYPTO_HMAC is not set
1284# CONFIG_CRYPTO_XCBC is not set 1296# CONFIG_CRYPTO_XCBC is not set
1297# CONFIG_CRYPTO_VMAC is not set
1285 1298
1286# 1299#
1287# Digest 1300# Digest
1288# 1301#
1289# CONFIG_CRYPTO_CRC32C is not set 1302# CONFIG_CRYPTO_CRC32C is not set
1303# CONFIG_CRYPTO_GHASH is not set
1290# CONFIG_CRYPTO_MD4 is not set 1304# CONFIG_CRYPTO_MD4 is not set
1291CONFIG_CRYPTO_MD5=y 1305CONFIG_CRYPTO_MD5=y
1292# CONFIG_CRYPTO_MICHAEL_MIC is not set 1306# CONFIG_CRYPTO_MICHAEL_MIC is not set
diff --git a/arch/powerpc/configs/83xx/mpc832x_rdb_defconfig b/arch/powerpc/configs/83xx/mpc832x_rdb_defconfig
index 4f27d4548223..b398b9b2b635 100644
--- a/arch/powerpc/configs/83xx/mpc832x_rdb_defconfig
+++ b/arch/powerpc/configs/83xx/mpc832x_rdb_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.31-rc4 3# Linux kernel version: 2.6.32-rc5
4# Wed Jul 29 23:32:07 2009 4# Thu Nov 5 08:20:24 2009
5# 5#
6# CONFIG_PPC64 is not set 6# CONFIG_PPC64 is not set
7 7
@@ -35,6 +35,7 @@ CONFIG_GENERIC_CLOCKEVENTS=y
35CONFIG_GENERIC_HARDIRQS=y 35CONFIG_GENERIC_HARDIRQS=y
36CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y 36CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y
37# CONFIG_HAVE_SETUP_PER_CPU_AREA is not set 37# CONFIG_HAVE_SETUP_PER_CPU_AREA is not set
38# CONFIG_NEED_PER_CPU_EMBED_FIRST_CHUNK 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
@@ -84,11 +85,12 @@ CONFIG_SYSVIPC_SYSCTL=y
84# 85#
85# RCU Subsystem 86# RCU Subsystem
86# 87#
87CONFIG_CLASSIC_RCU=y 88CONFIG_TREE_RCU=y
88# CONFIG_TREE_RCU is not set 89# CONFIG_TREE_PREEMPT_RCU is not set
89# CONFIG_PREEMPT_RCU is not set 90# CONFIG_RCU_TRACE is not set
91CONFIG_RCU_FANOUT=32
92# CONFIG_RCU_FANOUT_EXACT is not set
90# CONFIG_TREE_RCU_TRACE is not set 93# CONFIG_TREE_RCU_TRACE is not set
91# CONFIG_PREEMPT_RCU_TRACE is not set
92# CONFIG_IKCONFIG is not set 94# CONFIG_IKCONFIG is not set
93CONFIG_LOG_BUF_SHIFT=14 95CONFIG_LOG_BUF_SHIFT=14
94CONFIG_GROUP_SCHED=y 96CONFIG_GROUP_SCHED=y
@@ -124,28 +126,29 @@ CONFIG_TIMERFD=y
124CONFIG_EVENTFD=y 126CONFIG_EVENTFD=y
125CONFIG_SHMEM=y 127CONFIG_SHMEM=y
126CONFIG_AIO=y 128CONFIG_AIO=y
127CONFIG_HAVE_PERF_COUNTERS=y 129CONFIG_HAVE_PERF_EVENTS=y
128 130
129# 131#
130# Performance Counters 132# Kernel Performance Events And Counters
131# 133#
134# CONFIG_PERF_EVENTS is not set
132# CONFIG_PERF_COUNTERS is not set 135# CONFIG_PERF_COUNTERS is not set
133CONFIG_VM_EVENT_COUNTERS=y 136CONFIG_VM_EVENT_COUNTERS=y
134CONFIG_PCI_QUIRKS=y 137CONFIG_PCI_QUIRKS=y
135CONFIG_SLUB_DEBUG=y 138CONFIG_SLUB_DEBUG=y
136# CONFIG_STRIP_ASM_SYMS is not set
137CONFIG_COMPAT_BRK=y 139CONFIG_COMPAT_BRK=y
138# CONFIG_SLAB is not set 140# CONFIG_SLAB is not set
139CONFIG_SLUB=y 141CONFIG_SLUB=y
140# CONFIG_SLOB is not set 142# CONFIG_SLOB is not set
141# CONFIG_PROFILING is not set 143# CONFIG_PROFILING is not set
142# CONFIG_MARKERS is not set
143CONFIG_HAVE_OPROFILE=y 144CONFIG_HAVE_OPROFILE=y
144CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS=y 145CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS=y
145CONFIG_HAVE_IOREMAP_PROT=y 146CONFIG_HAVE_IOREMAP_PROT=y
146CONFIG_HAVE_KPROBES=y 147CONFIG_HAVE_KPROBES=y
147CONFIG_HAVE_KRETPROBES=y 148CONFIG_HAVE_KRETPROBES=y
148CONFIG_HAVE_ARCH_TRACEHOOK=y 149CONFIG_HAVE_ARCH_TRACEHOOK=y
150CONFIG_HAVE_DMA_ATTRS=y
151CONFIG_HAVE_DMA_API_DEBUG=y
149 152
150# 153#
151# GCOV-based kernel profiling 154# GCOV-based kernel profiling
@@ -257,6 +260,7 @@ CONFIG_ARCH_HAS_WALK_MEMORY=y
257CONFIG_ARCH_ENABLE_MEMORY_HOTREMOVE=y 260CONFIG_ARCH_ENABLE_MEMORY_HOTREMOVE=y
258# CONFIG_KEXEC is not set 261# CONFIG_KEXEC is not set
259# CONFIG_CRASH_DUMP is not set 262# CONFIG_CRASH_DUMP is not set
263CONFIG_MAX_ACTIVE_REGIONS=32
260CONFIG_ARCH_FLATMEM_ENABLE=y 264CONFIG_ARCH_FLATMEM_ENABLE=y
261CONFIG_ARCH_POPULATES_NODE_MAP=y 265CONFIG_ARCH_POPULATES_NODE_MAP=y
262CONFIG_SELECT_MEMORY_MODEL=y 266CONFIG_SELECT_MEMORY_MODEL=y
@@ -274,6 +278,7 @@ CONFIG_BOUNCE=y
274CONFIG_VIRT_TO_BUS=y 278CONFIG_VIRT_TO_BUS=y
275CONFIG_HAVE_MLOCK=y 279CONFIG_HAVE_MLOCK=y
276CONFIG_HAVE_MLOCKED_PAGE_BIT=y 280CONFIG_HAVE_MLOCKED_PAGE_BIT=y
281# CONFIG_KSM is not set
277CONFIG_DEFAULT_MMAP_MIN_ADDR=4096 282CONFIG_DEFAULT_MMAP_MIN_ADDR=4096
278CONFIG_PPC_4K_PAGES=y 283CONFIG_PPC_4K_PAGES=y
279# CONFIG_PPC_16K_PAGES is not set 284# CONFIG_PPC_16K_PAGES is not set
@@ -369,6 +374,7 @@ CONFIG_DEFAULT_TCP_CONG="cubic"
369# CONFIG_NETFILTER is not set 374# CONFIG_NETFILTER is not set
370# CONFIG_IP_DCCP is not set 375# CONFIG_IP_DCCP is not set
371# CONFIG_IP_SCTP is not set 376# CONFIG_IP_SCTP is not set
377# CONFIG_RDS is not set
372# CONFIG_TIPC is not set 378# CONFIG_TIPC is not set
373# CONFIG_ATM is not set 379# CONFIG_ATM is not set
374# CONFIG_BRIDGE is not set 380# CONFIG_BRIDGE is not set
@@ -398,6 +404,7 @@ CONFIG_DEFAULT_TCP_CONG="cubic"
398# CONFIG_AF_RXRPC is not set 404# CONFIG_AF_RXRPC is not set
399CONFIG_WIRELESS=y 405CONFIG_WIRELESS=y
400# CONFIG_CFG80211 is not set 406# CONFIG_CFG80211 is not set
407CONFIG_CFG80211_DEFAULT_PS_VALUE=0
401CONFIG_WIRELESS_OLD_REGULATORY=y 408CONFIG_WIRELESS_OLD_REGULATORY=y
402# CONFIG_WIRELESS_EXT is not set 409# CONFIG_WIRELESS_EXT is not set
403# CONFIG_LIB80211 is not set 410# CONFIG_LIB80211 is not set
@@ -405,7 +412,6 @@ CONFIG_WIRELESS_OLD_REGULATORY=y
405# 412#
406# CFG80211 needs to be enabled for MAC80211 413# CFG80211 needs to be enabled for MAC80211
407# 414#
408CONFIG_MAC80211_DEFAULT_PS_VALUE=0
409# CONFIG_WIMAX is not set 415# CONFIG_WIMAX is not set
410# CONFIG_RFKILL is not set 416# CONFIG_RFKILL is not set
411# CONFIG_NET_9P is not set 417# CONFIG_NET_9P is not set
@@ -418,6 +424,7 @@ CONFIG_MAC80211_DEFAULT_PS_VALUE=0
418# Generic Driver Options 424# Generic Driver Options
419# 425#
420CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug" 426CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
427# CONFIG_DEVTMPFS is not set
421CONFIG_STANDALONE=y 428CONFIG_STANDALONE=y
422CONFIG_PREVENT_FIRMWARE_BUILD=y 429CONFIG_PREVENT_FIRMWARE_BUILD=y
423# CONFIG_FW_LOADER is not set 430# CONFIG_FW_LOADER is not set
@@ -507,6 +514,7 @@ CONFIG_SCSI_LOWLEVEL=y
507# CONFIG_ISCSI_TCP is not set 514# CONFIG_ISCSI_TCP is not set
508# CONFIG_SCSI_CXGB3_ISCSI is not set 515# CONFIG_SCSI_CXGB3_ISCSI is not set
509# CONFIG_SCSI_BNX2_ISCSI is not set 516# CONFIG_SCSI_BNX2_ISCSI is not set
517# CONFIG_BE2ISCSI is not set
510# CONFIG_BLK_DEV_3W_XXXX_RAID is not set 518# CONFIG_BLK_DEV_3W_XXXX_RAID is not set
511# CONFIG_SCSI_3W_9XXX is not set 519# CONFIG_SCSI_3W_9XXX is not set
512# CONFIG_SCSI_ACARD is not set 520# CONFIG_SCSI_ACARD is not set
@@ -545,7 +553,9 @@ CONFIG_SCSI_LOWLEVEL=y
545# CONFIG_SCSI_DC390T is not set 553# CONFIG_SCSI_DC390T is not set
546# CONFIG_SCSI_NSP32 is not set 554# CONFIG_SCSI_NSP32 is not set
547# CONFIG_SCSI_DEBUG is not set 555# CONFIG_SCSI_DEBUG is not set
556# CONFIG_SCSI_PMCRAID is not set
548# CONFIG_SCSI_SRP is not set 557# CONFIG_SCSI_SRP is not set
558# CONFIG_SCSI_BFA_FC is not set
549# CONFIG_SCSI_DH is not set 559# CONFIG_SCSI_DH is not set
550# CONFIG_SCSI_OSD_INITIATOR is not set 560# CONFIG_SCSI_OSD_INITIATOR is not set
551# CONFIG_ATA is not set 561# CONFIG_ATA is not set
@@ -617,7 +627,9 @@ CONFIG_MII=y
617# CONFIG_B44 is not set 627# CONFIG_B44 is not set
618# CONFIG_KS8842 is not set 628# CONFIG_KS8842 is not set
619# CONFIG_KS8851 is not set 629# CONFIG_KS8851 is not set
630# CONFIG_KS8851_MLL is not set
620# CONFIG_ATL2 is not set 631# CONFIG_ATL2 is not set
632# CONFIG_XILINX_EMACLITE is not set
621CONFIG_NETDEV_1000=y 633CONFIG_NETDEV_1000=y
622# CONFIG_ACENIC is not set 634# CONFIG_ACENIC is not set
623# CONFIG_DL2K is not set 635# CONFIG_DL2K is not set
@@ -640,7 +652,6 @@ CONFIG_E1000=y
640CONFIG_FSL_PQ_MDIO=y 652CONFIG_FSL_PQ_MDIO=y
641# CONFIG_GIANFAR is not set 653# CONFIG_GIANFAR is not set
642CONFIG_UCC_GETH=y 654CONFIG_UCC_GETH=y
643# CONFIG_UGETH_MAGIC_PACKET is not set
644# CONFIG_UGETH_TX_ON_DEMAND is not set 655# CONFIG_UGETH_TX_ON_DEMAND is not set
645# CONFIG_MV643XX_ETH is not set 656# CONFIG_MV643XX_ETH is not set
646# CONFIG_QLA3XXX is not set 657# CONFIG_QLA3XXX is not set
@@ -668,10 +679,7 @@ CONFIG_CHELSIO_T3_DEPENDS=y
668# CONFIG_SFC is not set 679# CONFIG_SFC is not set
669# CONFIG_BE2NET is not set 680# CONFIG_BE2NET is not set
670# CONFIG_TR is not set 681# CONFIG_TR is not set
671 682CONFIG_WLAN=y
672#
673# Wireless LAN
674#
675# CONFIG_WLAN_PRE80211 is not set 683# CONFIG_WLAN_PRE80211 is not set
676# CONFIG_WLAN_80211 is not set 684# CONFIG_WLAN_80211 is not set
677 685
@@ -776,6 +784,7 @@ CONFIG_GEN_RTC=y
776CONFIG_DEVPORT=y 784CONFIG_DEVPORT=y
777CONFIG_I2C=y 785CONFIG_I2C=y
778CONFIG_I2C_BOARDINFO=y 786CONFIG_I2C_BOARDINFO=y
787CONFIG_I2C_COMPAT=y
779CONFIG_I2C_CHARDEV=y 788CONFIG_I2C_CHARDEV=y
780CONFIG_I2C_HELPER_AUTO=y 789CONFIG_I2C_HELPER_AUTO=y
781 790
@@ -830,9 +839,6 @@ CONFIG_I2C_MPC=y
830# Miscellaneous I2C Chip support 839# Miscellaneous I2C Chip support
831# 840#
832# CONFIG_DS1682 is not set 841# CONFIG_DS1682 is not set
833# CONFIG_SENSORS_PCF8574 is not set
834# CONFIG_PCF8575 is not set
835# CONFIG_SENSORS_PCA9539 is not set
836# CONFIG_SENSORS_TSL2550 is not set 842# CONFIG_SENSORS_TSL2550 is not set
837# CONFIG_I2C_DEBUG_CORE is not set 843# CONFIG_I2C_DEBUG_CORE is not set
838# CONFIG_I2C_DEBUG_ALGO is not set 844# CONFIG_I2C_DEBUG_ALGO is not set
@@ -863,6 +869,11 @@ CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y
863# CONFIG_POWER_SUPPLY is not set 869# CONFIG_POWER_SUPPLY is not set
864CONFIG_HWMON=y 870CONFIG_HWMON=y
865# CONFIG_HWMON_VID is not set 871# CONFIG_HWMON_VID is not set
872# CONFIG_HWMON_DEBUG_CHIP is not set
873
874#
875# Native drivers
876#
866# CONFIG_SENSORS_AD7414 is not set 877# CONFIG_SENSORS_AD7414 is not set
867# CONFIG_SENSORS_AD7418 is not set 878# CONFIG_SENSORS_AD7418 is not set
868# CONFIG_SENSORS_ADCXX is not set 879# CONFIG_SENSORS_ADCXX is not set
@@ -915,6 +926,7 @@ CONFIG_HWMON=y
915# CONFIG_SENSORS_ADS7828 is not set 926# CONFIG_SENSORS_ADS7828 is not set
916# CONFIG_SENSORS_THMC50 is not set 927# CONFIG_SENSORS_THMC50 is not set
917# CONFIG_SENSORS_TMP401 is not set 928# CONFIG_SENSORS_TMP401 is not set
929# CONFIG_SENSORS_TMP421 is not set
918# CONFIG_SENSORS_VIA686A is not set 930# CONFIG_SENSORS_VIA686A is not set
919# CONFIG_SENSORS_VT1211 is not set 931# CONFIG_SENSORS_VT1211 is not set
920# CONFIG_SENSORS_VT8231 is not set 932# CONFIG_SENSORS_VT8231 is not set
@@ -927,9 +939,7 @@ CONFIG_HWMON=y
927# CONFIG_SENSORS_W83627HF is not set 939# CONFIG_SENSORS_W83627HF is not set
928# CONFIG_SENSORS_W83627EHF is not set 940# CONFIG_SENSORS_W83627EHF is not set
929# CONFIG_SENSORS_LIS3_SPI is not set 941# CONFIG_SENSORS_LIS3_SPI is not set
930# CONFIG_HWMON_DEBUG_CHIP is not set
931# CONFIG_THERMAL is not set 942# CONFIG_THERMAL is not set
932# CONFIG_THERMAL_HWMON is not set
933CONFIG_WATCHDOG=y 943CONFIG_WATCHDOG=y
934# CONFIG_WATCHDOG_NOWAYOUT is not set 944# CONFIG_WATCHDOG_NOWAYOUT is not set
935 945
@@ -967,8 +977,10 @@ CONFIG_SSB_POSSIBLE=y
967# CONFIG_MFD_TMIO is not set 977# CONFIG_MFD_TMIO is not set
968# CONFIG_PMIC_DA903X is not set 978# CONFIG_PMIC_DA903X is not set
969# CONFIG_MFD_WM8400 is not set 979# CONFIG_MFD_WM8400 is not set
980# CONFIG_MFD_WM831X is not set
970# CONFIG_MFD_WM8350_I2C is not set 981# CONFIG_MFD_WM8350_I2C is not set
971# CONFIG_MFD_PCF50633 is not set 982# CONFIG_MFD_PCF50633 is not set
983# CONFIG_MFD_MC13783 is not set
972# CONFIG_AB3100_CORE is not set 984# CONFIG_AB3100_CORE is not set
973# CONFIG_EZX_PCAP is not set 985# CONFIG_EZX_PCAP is not set
974# CONFIG_REGULATOR is not set 986# CONFIG_REGULATOR is not set
@@ -978,6 +990,7 @@ CONFIG_SSB_POSSIBLE=y
978# Graphics support 990# Graphics support
979# 991#
980# CONFIG_AGP is not set 992# CONFIG_AGP is not set
993CONFIG_VGA_ARB=y
981# CONFIG_DRM is not set 994# CONFIG_DRM is not set
982# CONFIG_VGASTATE is not set 995# CONFIG_VGASTATE is not set
983CONFIG_VIDEO_OUTPUT_CONTROL=m 996CONFIG_VIDEO_OUTPUT_CONTROL=m
@@ -991,7 +1004,6 @@ CONFIG_VIDEO_OUTPUT_CONTROL=m
991# CONFIG_SOUND is not set 1004# CONFIG_SOUND is not set
992CONFIG_HID_SUPPORT=y 1005CONFIG_HID_SUPPORT=y
993CONFIG_HID=y 1006CONFIG_HID=y
994# CONFIG_HID_DEBUG is not set
995# CONFIG_HIDRAW is not set 1007# CONFIG_HIDRAW is not set
996 1008
997# 1009#
@@ -1043,6 +1055,7 @@ CONFIG_USB_EHCI_HCD_PPC_OF=y
1043# CONFIG_USB_OXU210HP_HCD is not set 1055# CONFIG_USB_OXU210HP_HCD is not set
1044# CONFIG_USB_ISP116X_HCD is not set 1056# CONFIG_USB_ISP116X_HCD is not set
1045# CONFIG_USB_ISP1760_HCD is not set 1057# CONFIG_USB_ISP1760_HCD is not set
1058# CONFIG_USB_ISP1362_HCD is not set
1046CONFIG_USB_OHCI_HCD=y 1059CONFIG_USB_OHCI_HCD=y
1047CONFIG_USB_OHCI_HCD_PPC_OF_BE=y 1060CONFIG_USB_OHCI_HCD_PPC_OF_BE=y
1048# CONFIG_USB_OHCI_HCD_PPC_OF_LE is not set 1061# CONFIG_USB_OHCI_HCD_PPC_OF_LE is not set
@@ -1146,6 +1159,8 @@ CONFIG_MMC_BLOCK_BOUNCE=y
1146# 1159#
1147# CONFIG_MMC_SDHCI is not set 1160# CONFIG_MMC_SDHCI is not set
1148# CONFIG_MMC_WBSD is not set 1161# CONFIG_MMC_WBSD is not set
1162# CONFIG_MMC_AT91 is not set
1163# CONFIG_MMC_ATMELMCI is not set
1149# CONFIG_MMC_TIFM_SD is not set 1164# CONFIG_MMC_TIFM_SD is not set
1150CONFIG_MMC_SPI=y 1165CONFIG_MMC_SPI=y
1151# CONFIG_MMC_CB710 is not set 1166# CONFIG_MMC_CB710 is not set
@@ -1186,6 +1201,7 @@ CONFIG_FS_MBCACHE=y
1186# CONFIG_GFS2_FS is not set 1201# CONFIG_GFS2_FS is not set
1187# CONFIG_OCFS2_FS is not set 1202# CONFIG_OCFS2_FS is not set
1188# CONFIG_BTRFS_FS is not set 1203# CONFIG_BTRFS_FS is not set
1204# CONFIG_NILFS2_FS is not set
1189CONFIG_FILE_LOCKING=y 1205CONFIG_FILE_LOCKING=y
1190CONFIG_FSNOTIFY=y 1206CONFIG_FSNOTIFY=y
1191CONFIG_DNOTIFY=y 1207CONFIG_DNOTIFY=y
@@ -1247,7 +1263,6 @@ CONFIG_MISC_FILESYSTEMS=y
1247# CONFIG_ROMFS_FS is not set 1263# CONFIG_ROMFS_FS is not set
1248# CONFIG_SYSV_FS is not set 1264# CONFIG_SYSV_FS is not set
1249# CONFIG_UFS_FS is not set 1265# CONFIG_UFS_FS is not set
1250# CONFIG_NILFS2_FS is not set
1251CONFIG_NETWORK_FILESYSTEMS=y 1266CONFIG_NETWORK_FILESYSTEMS=y
1252CONFIG_NFS_FS=y 1267CONFIG_NFS_FS=y
1253CONFIG_NFS_V3=y 1268CONFIG_NFS_V3=y
@@ -1365,6 +1380,7 @@ CONFIG_ENABLE_WARN_DEPRECATED=y
1365CONFIG_ENABLE_MUST_CHECK=y 1380CONFIG_ENABLE_MUST_CHECK=y
1366CONFIG_FRAME_WARN=1024 1381CONFIG_FRAME_WARN=1024
1367# CONFIG_MAGIC_SYSRQ is not set 1382# CONFIG_MAGIC_SYSRQ is not set
1383# CONFIG_STRIP_ASM_SYMS is not set
1368# CONFIG_UNUSED_SYMBOLS is not set 1384# CONFIG_UNUSED_SYMBOLS is not set
1369# CONFIG_DEBUG_FS is not set 1385# CONFIG_DEBUG_FS is not set
1370# CONFIG_HEADERS_CHECK is not set 1386# CONFIG_HEADERS_CHECK is not set
@@ -1382,6 +1398,7 @@ CONFIG_HAVE_DYNAMIC_FTRACE=y
1382CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y 1398CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y
1383CONFIG_TRACING_SUPPORT=y 1399CONFIG_TRACING_SUPPORT=y
1384# CONFIG_FTRACE is not set 1400# CONFIG_FTRACE is not set
1401# CONFIG_DMA_API_DEBUG is not set
1385# CONFIG_SAMPLES is not set 1402# CONFIG_SAMPLES is not set
1386CONFIG_HAVE_ARCH_KGDB=y 1403CONFIG_HAVE_ARCH_KGDB=y
1387# CONFIG_PPC_DISABLE_WERROR is not set 1404# CONFIG_PPC_DISABLE_WERROR is not set
@@ -1403,7 +1420,6 @@ CONFIG_CRYPTO=y
1403# 1420#
1404# Crypto core or helper 1421# Crypto core or helper
1405# 1422#
1406# CONFIG_CRYPTO_FIPS is not set
1407CONFIG_CRYPTO_ALGAPI=y 1423CONFIG_CRYPTO_ALGAPI=y
1408CONFIG_CRYPTO_ALGAPI2=y 1424CONFIG_CRYPTO_ALGAPI2=y
1409CONFIG_CRYPTO_AEAD2=y 1425CONFIG_CRYPTO_AEAD2=y
@@ -1445,11 +1461,13 @@ CONFIG_CRYPTO_PCBC=m
1445# 1461#
1446# CONFIG_CRYPTO_HMAC is not set 1462# CONFIG_CRYPTO_HMAC is not set
1447# CONFIG_CRYPTO_XCBC is not set 1463# CONFIG_CRYPTO_XCBC is not set
1464# CONFIG_CRYPTO_VMAC is not set
1448 1465
1449# 1466#
1450# Digest 1467# Digest
1451# 1468#
1452# CONFIG_CRYPTO_CRC32C is not set 1469# CONFIG_CRYPTO_CRC32C is not set
1470# CONFIG_CRYPTO_GHASH is not set
1453# CONFIG_CRYPTO_MD4 is not set 1471# CONFIG_CRYPTO_MD4 is not set
1454CONFIG_CRYPTO_MD5=y 1472CONFIG_CRYPTO_MD5=y
1455# CONFIG_CRYPTO_MICHAEL_MIC is not set 1473# CONFIG_CRYPTO_MICHAEL_MIC is not set
diff --git a/arch/powerpc/configs/83xx/mpc834x_itx_defconfig b/arch/powerpc/configs/83xx/mpc834x_itx_defconfig
index 648dac0c9d8d..f67317e1934c 100644
--- a/arch/powerpc/configs/83xx/mpc834x_itx_defconfig
+++ b/arch/powerpc/configs/83xx/mpc834x_itx_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.31-rc4 3# Linux kernel version: 2.6.32-rc5
4# Wed Jul 29 23:32:07 2009 4# Thu Nov 5 08:20:25 2009
5# 5#
6# CONFIG_PPC64 is not set 6# CONFIG_PPC64 is not set
7 7
@@ -35,6 +35,7 @@ CONFIG_GENERIC_CLOCKEVENTS=y
35CONFIG_GENERIC_HARDIRQS=y 35CONFIG_GENERIC_HARDIRQS=y
36CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y 36CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y
37# CONFIG_HAVE_SETUP_PER_CPU_AREA is not set 37# CONFIG_HAVE_SETUP_PER_CPU_AREA is not set
38# CONFIG_NEED_PER_CPU_EMBED_FIRST_CHUNK 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
@@ -84,11 +85,12 @@ CONFIG_SYSVIPC_SYSCTL=y
84# 85#
85# RCU Subsystem 86# RCU Subsystem
86# 87#
87CONFIG_CLASSIC_RCU=y 88CONFIG_TREE_RCU=y
88# CONFIG_TREE_RCU is not set 89# CONFIG_TREE_PREEMPT_RCU is not set
89# CONFIG_PREEMPT_RCU is not set 90# CONFIG_RCU_TRACE is not set
91CONFIG_RCU_FANOUT=32
92# CONFIG_RCU_FANOUT_EXACT is not set
90# CONFIG_TREE_RCU_TRACE is not set 93# CONFIG_TREE_RCU_TRACE is not set
91# CONFIG_PREEMPT_RCU_TRACE is not set
92# CONFIG_IKCONFIG is not set 94# CONFIG_IKCONFIG is not set
93CONFIG_LOG_BUF_SHIFT=14 95CONFIG_LOG_BUF_SHIFT=14
94CONFIG_GROUP_SCHED=y 96CONFIG_GROUP_SCHED=y
@@ -124,28 +126,29 @@ CONFIG_TIMERFD=y
124CONFIG_EVENTFD=y 126CONFIG_EVENTFD=y
125CONFIG_SHMEM=y 127CONFIG_SHMEM=y
126CONFIG_AIO=y 128CONFIG_AIO=y
127CONFIG_HAVE_PERF_COUNTERS=y 129CONFIG_HAVE_PERF_EVENTS=y
128 130
129# 131#
130# Performance Counters 132# Kernel Performance Events And Counters
131# 133#
134# CONFIG_PERF_EVENTS is not set
132# CONFIG_PERF_COUNTERS is not set 135# CONFIG_PERF_COUNTERS is not set
133CONFIG_VM_EVENT_COUNTERS=y 136CONFIG_VM_EVENT_COUNTERS=y
134CONFIG_PCI_QUIRKS=y 137CONFIG_PCI_QUIRKS=y
135CONFIG_SLUB_DEBUG=y 138CONFIG_SLUB_DEBUG=y
136# CONFIG_STRIP_ASM_SYMS is not set
137CONFIG_COMPAT_BRK=y 139CONFIG_COMPAT_BRK=y
138# CONFIG_SLAB is not set 140# CONFIG_SLAB is not set
139CONFIG_SLUB=y 141CONFIG_SLUB=y
140# CONFIG_SLOB is not set 142# CONFIG_SLOB is not set
141# CONFIG_PROFILING is not set 143# CONFIG_PROFILING is not set
142# CONFIG_MARKERS is not set
143CONFIG_HAVE_OPROFILE=y 144CONFIG_HAVE_OPROFILE=y
144CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS=y 145CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS=y
145CONFIG_HAVE_IOREMAP_PROT=y 146CONFIG_HAVE_IOREMAP_PROT=y
146CONFIG_HAVE_KPROBES=y 147CONFIG_HAVE_KPROBES=y
147CONFIG_HAVE_KRETPROBES=y 148CONFIG_HAVE_KRETPROBES=y
148CONFIG_HAVE_ARCH_TRACEHOOK=y 149CONFIG_HAVE_ARCH_TRACEHOOK=y
150CONFIG_HAVE_DMA_ATTRS=y
151CONFIG_HAVE_DMA_API_DEBUG=y
149 152
150# 153#
151# GCOV-based kernel profiling 154# GCOV-based kernel profiling
@@ -256,6 +259,7 @@ CONFIG_ARCH_HAS_WALK_MEMORY=y
256CONFIG_ARCH_ENABLE_MEMORY_HOTREMOVE=y 259CONFIG_ARCH_ENABLE_MEMORY_HOTREMOVE=y
257# CONFIG_KEXEC is not set 260# CONFIG_KEXEC is not set
258# CONFIG_CRASH_DUMP is not set 261# CONFIG_CRASH_DUMP is not set
262CONFIG_MAX_ACTIVE_REGIONS=32
259CONFIG_ARCH_FLATMEM_ENABLE=y 263CONFIG_ARCH_FLATMEM_ENABLE=y
260CONFIG_ARCH_POPULATES_NODE_MAP=y 264CONFIG_ARCH_POPULATES_NODE_MAP=y
261CONFIG_SELECT_MEMORY_MODEL=y 265CONFIG_SELECT_MEMORY_MODEL=y
@@ -273,6 +277,7 @@ CONFIG_BOUNCE=y
273CONFIG_VIRT_TO_BUS=y 277CONFIG_VIRT_TO_BUS=y
274CONFIG_HAVE_MLOCK=y 278CONFIG_HAVE_MLOCK=y
275CONFIG_HAVE_MLOCKED_PAGE_BIT=y 279CONFIG_HAVE_MLOCKED_PAGE_BIT=y
280# CONFIG_KSM is not set
276CONFIG_DEFAULT_MMAP_MIN_ADDR=4096 281CONFIG_DEFAULT_MMAP_MIN_ADDR=4096
277CONFIG_PPC_4K_PAGES=y 282CONFIG_PPC_4K_PAGES=y
278# CONFIG_PPC_16K_PAGES is not set 283# CONFIG_PPC_16K_PAGES is not set
@@ -368,6 +373,7 @@ CONFIG_DEFAULT_TCP_CONG="cubic"
368# CONFIG_NETFILTER is not set 373# CONFIG_NETFILTER is not set
369# CONFIG_IP_DCCP is not set 374# CONFIG_IP_DCCP is not set
370# CONFIG_IP_SCTP is not set 375# CONFIG_IP_SCTP is not set
376# CONFIG_RDS is not set
371# CONFIG_TIPC is not set 377# CONFIG_TIPC is not set
372# CONFIG_ATM is not set 378# CONFIG_ATM is not set
373# CONFIG_BRIDGE is not set 379# CONFIG_BRIDGE is not set
@@ -397,6 +403,7 @@ CONFIG_DEFAULT_TCP_CONG="cubic"
397# CONFIG_AF_RXRPC is not set 403# CONFIG_AF_RXRPC is not set
398CONFIG_WIRELESS=y 404CONFIG_WIRELESS=y
399# CONFIG_CFG80211 is not set 405# CONFIG_CFG80211 is not set
406CONFIG_CFG80211_DEFAULT_PS_VALUE=0
400CONFIG_WIRELESS_OLD_REGULATORY=y 407CONFIG_WIRELESS_OLD_REGULATORY=y
401# CONFIG_WIRELESS_EXT is not set 408# CONFIG_WIRELESS_EXT is not set
402# CONFIG_LIB80211 is not set 409# CONFIG_LIB80211 is not set
@@ -404,7 +411,6 @@ CONFIG_WIRELESS_OLD_REGULATORY=y
404# 411#
405# CFG80211 needs to be enabled for MAC80211 412# CFG80211 needs to be enabled for MAC80211
406# 413#
407CONFIG_MAC80211_DEFAULT_PS_VALUE=0
408# CONFIG_WIMAX is not set 414# CONFIG_WIMAX is not set
409# CONFIG_RFKILL is not set 415# CONFIG_RFKILL is not set
410# CONFIG_NET_9P is not set 416# CONFIG_NET_9P is not set
@@ -417,6 +423,7 @@ CONFIG_MAC80211_DEFAULT_PS_VALUE=0
417# Generic Driver Options 423# Generic Driver Options
418# 424#
419CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug" 425CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
426# CONFIG_DEVTMPFS is not set
420CONFIG_STANDALONE=y 427CONFIG_STANDALONE=y
421CONFIG_PREVENT_FIRMWARE_BUILD=y 428CONFIG_PREVENT_FIRMWARE_BUILD=y
422# CONFIG_FW_LOADER is not set 429# CONFIG_FW_LOADER is not set
@@ -424,9 +431,9 @@ CONFIG_PREVENT_FIRMWARE_BUILD=y
424# CONFIG_CONNECTOR is not set 431# CONFIG_CONNECTOR is not set
425CONFIG_MTD=y 432CONFIG_MTD=y
426# CONFIG_MTD_DEBUG is not set 433# CONFIG_MTD_DEBUG is not set
434# CONFIG_MTD_TESTS is not set
427# CONFIG_MTD_CONCAT is not set 435# CONFIG_MTD_CONCAT is not set
428# CONFIG_MTD_PARTITIONS is not set 436# CONFIG_MTD_PARTITIONS is not set
429# CONFIG_MTD_TESTS is not set
430 437
431# 438#
432# User Modules And Translation Layers 439# User Modules And Translation Layers
@@ -483,6 +490,7 @@ CONFIG_MTD_PHYSMAP=y
483# CONFIG_MTD_PMC551 is not set 490# CONFIG_MTD_PMC551 is not set
484# CONFIG_MTD_DATAFLASH is not set 491# CONFIG_MTD_DATAFLASH is not set
485# CONFIG_MTD_M25P80 is not set 492# CONFIG_MTD_M25P80 is not set
493# CONFIG_MTD_SST25L is not set
486# CONFIG_MTD_SLRAM is not set 494# CONFIG_MTD_SLRAM is not set
487# CONFIG_MTD_PHRAM is not set 495# CONFIG_MTD_PHRAM is not set
488# CONFIG_MTD_MTDRAM is not set 496# CONFIG_MTD_MTDRAM is not set
@@ -637,6 +645,7 @@ CONFIG_SCSI_LOWLEVEL=y
637# CONFIG_ISCSI_TCP is not set 645# CONFIG_ISCSI_TCP is not set
638# CONFIG_SCSI_CXGB3_ISCSI is not set 646# CONFIG_SCSI_CXGB3_ISCSI is not set
639# CONFIG_SCSI_BNX2_ISCSI is not set 647# CONFIG_SCSI_BNX2_ISCSI is not set
648# CONFIG_BE2ISCSI is not set
640# CONFIG_BLK_DEV_3W_XXXX_RAID is not set 649# CONFIG_BLK_DEV_3W_XXXX_RAID is not set
641# CONFIG_SCSI_3W_9XXX is not set 650# CONFIG_SCSI_3W_9XXX is not set
642# CONFIG_SCSI_ACARD is not set 651# CONFIG_SCSI_ACARD is not set
@@ -676,11 +685,14 @@ CONFIG_SCSI_LOWLEVEL=y
676# CONFIG_SCSI_DC390T is not set 685# CONFIG_SCSI_DC390T is not set
677# CONFIG_SCSI_NSP32 is not set 686# CONFIG_SCSI_NSP32 is not set
678# CONFIG_SCSI_DEBUG is not set 687# CONFIG_SCSI_DEBUG is not set
688# CONFIG_SCSI_PMCRAID is not set
679# CONFIG_SCSI_SRP is not set 689# CONFIG_SCSI_SRP is not set
690# CONFIG_SCSI_BFA_FC is not set
680# CONFIG_SCSI_DH is not set 691# CONFIG_SCSI_DH is not set
681# CONFIG_SCSI_OSD_INITIATOR is not set 692# CONFIG_SCSI_OSD_INITIATOR is not set
682CONFIG_ATA=y 693CONFIG_ATA=y
683# CONFIG_ATA_NONSTANDARD is not set 694# CONFIG_ATA_NONSTANDARD is not set
695CONFIG_ATA_VERBOSE_ERROR=y
684CONFIG_SATA_PMP=y 696CONFIG_SATA_PMP=y
685# CONFIG_SATA_AHCI is not set 697# CONFIG_SATA_AHCI is not set
686# CONFIG_SATA_SIL24 is not set 698# CONFIG_SATA_SIL24 is not set
@@ -703,6 +715,7 @@ CONFIG_SATA_SIL=y
703# CONFIG_PATA_ALI is not set 715# CONFIG_PATA_ALI is not set
704# CONFIG_PATA_AMD is not set 716# CONFIG_PATA_AMD is not set
705# CONFIG_PATA_ARTOP is not set 717# CONFIG_PATA_ARTOP is not set
718# CONFIG_PATA_ATP867X is not set
706# CONFIG_PATA_ATIIXP is not set 719# CONFIG_PATA_ATIIXP is not set
707# CONFIG_PATA_CMD640_PCI is not set 720# CONFIG_PATA_CMD640_PCI is not set
708# CONFIG_PATA_CMD64X is not set 721# CONFIG_PATA_CMD64X is not set
@@ -730,6 +743,7 @@ CONFIG_SATA_SIL=y
730# CONFIG_PATA_OPTIDMA is not set 743# CONFIG_PATA_OPTIDMA is not set
731# CONFIG_PATA_PDC_OLD is not set 744# CONFIG_PATA_PDC_OLD is not set
732# CONFIG_PATA_RADISYS is not set 745# CONFIG_PATA_RADISYS is not set
746# CONFIG_PATA_RDC is not set
733# CONFIG_PATA_RZ1000 is not set 747# CONFIG_PATA_RZ1000 is not set
734# CONFIG_PATA_SC1200 is not set 748# CONFIG_PATA_SC1200 is not set
735# CONFIG_PATA_SERVERWORKS is not set 749# CONFIG_PATA_SERVERWORKS is not set
@@ -845,10 +859,7 @@ CONFIG_CHELSIO_T3_DEPENDS=y
845# CONFIG_SFC is not set 859# CONFIG_SFC is not set
846# CONFIG_BE2NET is not set 860# CONFIG_BE2NET is not set
847# CONFIG_TR is not set 861# CONFIG_TR is not set
848 862CONFIG_WLAN=y
849#
850# Wireless LAN
851#
852# CONFIG_WLAN_PRE80211 is not set 863# CONFIG_WLAN_PRE80211 is not set
853# CONFIG_WLAN_80211 is not set 864# CONFIG_WLAN_80211 is not set
854 865
@@ -930,6 +941,7 @@ CONFIG_HW_RANDOM=y
930CONFIG_DEVPORT=y 941CONFIG_DEVPORT=y
931CONFIG_I2C=y 942CONFIG_I2C=y
932CONFIG_I2C_BOARDINFO=y 943CONFIG_I2C_BOARDINFO=y
944CONFIG_I2C_COMPAT=y
933CONFIG_I2C_CHARDEV=y 945CONFIG_I2C_CHARDEV=y
934CONFIG_I2C_HELPER_AUTO=y 946CONFIG_I2C_HELPER_AUTO=y
935 947
@@ -984,9 +996,6 @@ CONFIG_I2C_MPC=y
984# Miscellaneous I2C Chip support 996# Miscellaneous I2C Chip support
985# 997#
986# CONFIG_DS1682 is not set 998# CONFIG_DS1682 is not set
987CONFIG_SENSORS_PCF8574=y
988# CONFIG_PCF8575 is not set
989# CONFIG_SENSORS_PCA9539 is not set
990# CONFIG_SENSORS_TSL2550 is not set 999# CONFIG_SENSORS_TSL2550 is not set
991# CONFIG_I2C_DEBUG_CORE is not set 1000# CONFIG_I2C_DEBUG_CORE is not set
992# CONFIG_I2C_DEBUG_ALGO is not set 1001# CONFIG_I2C_DEBUG_ALGO is not set
@@ -1017,7 +1026,6 @@ CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y
1017# CONFIG_POWER_SUPPLY is not set 1026# CONFIG_POWER_SUPPLY is not set
1018# CONFIG_HWMON is not set 1027# CONFIG_HWMON is not set
1019# CONFIG_THERMAL is not set 1028# CONFIG_THERMAL is not set
1020# CONFIG_THERMAL_HWMON is not set
1021CONFIG_WATCHDOG=y 1029CONFIG_WATCHDOG=y
1022# CONFIG_WATCHDOG_NOWAYOUT is not set 1030# CONFIG_WATCHDOG_NOWAYOUT is not set
1023 1031
@@ -1055,8 +1063,10 @@ CONFIG_SSB_POSSIBLE=y
1055# CONFIG_MFD_TMIO is not set 1063# CONFIG_MFD_TMIO is not set
1056# CONFIG_PMIC_DA903X is not set 1064# CONFIG_PMIC_DA903X is not set
1057# CONFIG_MFD_WM8400 is not set 1065# CONFIG_MFD_WM8400 is not set
1066# CONFIG_MFD_WM831X is not set
1058# CONFIG_MFD_WM8350_I2C is not set 1067# CONFIG_MFD_WM8350_I2C is not set
1059# CONFIG_MFD_PCF50633 is not set 1068# CONFIG_MFD_PCF50633 is not set
1069# CONFIG_MFD_MC13783 is not set
1060# CONFIG_AB3100_CORE is not set 1070# CONFIG_AB3100_CORE is not set
1061# CONFIG_EZX_PCAP is not set 1071# CONFIG_EZX_PCAP is not set
1062# CONFIG_REGULATOR is not set 1072# CONFIG_REGULATOR is not set
@@ -1066,6 +1076,7 @@ CONFIG_SSB_POSSIBLE=y
1066# Graphics support 1076# Graphics support
1067# 1077#
1068# CONFIG_AGP is not set 1078# CONFIG_AGP is not set
1079CONFIG_VGA_ARB=y
1069# CONFIG_DRM is not set 1080# CONFIG_DRM is not set
1070# CONFIG_VGASTATE is not set 1081# CONFIG_VGASTATE is not set
1071CONFIG_VIDEO_OUTPUT_CONTROL=m 1082CONFIG_VIDEO_OUTPUT_CONTROL=m
@@ -1111,6 +1122,7 @@ CONFIG_USB_EHCI_HCD_PPC_OF=y
1111# CONFIG_USB_OXU210HP_HCD is not set 1122# CONFIG_USB_OXU210HP_HCD is not set
1112# CONFIG_USB_ISP116X_HCD is not set 1123# CONFIG_USB_ISP116X_HCD is not set
1113# CONFIG_USB_ISP1760_HCD is not set 1124# CONFIG_USB_ISP1760_HCD is not set
1125# CONFIG_USB_ISP1362_HCD is not set
1114# CONFIG_USB_OHCI_HCD is not set 1126# CONFIG_USB_OHCI_HCD is not set
1115CONFIG_USB_UHCI_HCD=y 1127CONFIG_USB_UHCI_HCD=y
1116# CONFIG_USB_SL811_HCD is not set 1128# CONFIG_USB_SL811_HCD is not set
@@ -1238,6 +1250,7 @@ CONFIG_RTC_DRV_DS1307=y
1238# CONFIG_RTC_DRV_R9701 is not set 1250# CONFIG_RTC_DRV_R9701 is not set
1239# CONFIG_RTC_DRV_RS5C348 is not set 1251# CONFIG_RTC_DRV_RS5C348 is not set
1240# CONFIG_RTC_DRV_DS3234 is not set 1252# CONFIG_RTC_DRV_DS3234 is not set
1253# CONFIG_RTC_DRV_PCF2123 is not set
1241 1254
1242# 1255#
1243# Platform RTC drivers 1256# Platform RTC drivers
@@ -1288,6 +1301,7 @@ CONFIG_FS_MBCACHE=y
1288# CONFIG_GFS2_FS is not set 1301# CONFIG_GFS2_FS is not set
1289# CONFIG_OCFS2_FS is not set 1302# CONFIG_OCFS2_FS is not set
1290# CONFIG_BTRFS_FS is not set 1303# CONFIG_BTRFS_FS is not set
1304# CONFIG_NILFS2_FS is not set
1291CONFIG_FILE_LOCKING=y 1305CONFIG_FILE_LOCKING=y
1292CONFIG_FSNOTIFY=y 1306CONFIG_FSNOTIFY=y
1293CONFIG_DNOTIFY=y 1307CONFIG_DNOTIFY=y
@@ -1350,7 +1364,6 @@ CONFIG_MISC_FILESYSTEMS=y
1350# CONFIG_ROMFS_FS is not set 1364# CONFIG_ROMFS_FS is not set
1351# CONFIG_SYSV_FS is not set 1365# CONFIG_SYSV_FS is not set
1352# CONFIG_UFS_FS is not set 1366# CONFIG_UFS_FS is not set
1353# CONFIG_NILFS2_FS is not set
1354CONFIG_NETWORK_FILESYSTEMS=y 1367CONFIG_NETWORK_FILESYSTEMS=y
1355CONFIG_NFS_FS=y 1368CONFIG_NFS_FS=y
1356CONFIG_NFS_V3=y 1369CONFIG_NFS_V3=y
@@ -1465,6 +1478,7 @@ CONFIG_ENABLE_WARN_DEPRECATED=y
1465CONFIG_ENABLE_MUST_CHECK=y 1478CONFIG_ENABLE_MUST_CHECK=y
1466CONFIG_FRAME_WARN=1024 1479CONFIG_FRAME_WARN=1024
1467# CONFIG_MAGIC_SYSRQ is not set 1480# CONFIG_MAGIC_SYSRQ is not set
1481# CONFIG_STRIP_ASM_SYMS is not set
1468# CONFIG_UNUSED_SYMBOLS is not set 1482# CONFIG_UNUSED_SYMBOLS is not set
1469# CONFIG_DEBUG_FS is not set 1483# CONFIG_DEBUG_FS is not set
1470# CONFIG_HEADERS_CHECK is not set 1484# CONFIG_HEADERS_CHECK is not set
@@ -1482,6 +1496,7 @@ CONFIG_HAVE_DYNAMIC_FTRACE=y
1482CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y 1496CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y
1483CONFIG_TRACING_SUPPORT=y 1497CONFIG_TRACING_SUPPORT=y
1484# CONFIG_FTRACE is not set 1498# CONFIG_FTRACE is not set
1499# CONFIG_DMA_API_DEBUG is not set
1485# CONFIG_SAMPLES is not set 1500# CONFIG_SAMPLES is not set
1486CONFIG_HAVE_ARCH_KGDB=y 1501CONFIG_HAVE_ARCH_KGDB=y
1487# CONFIG_PPC_DISABLE_WERROR is not set 1502# CONFIG_PPC_DISABLE_WERROR is not set
@@ -1503,7 +1518,6 @@ CONFIG_CRYPTO=y
1503# 1518#
1504# Crypto core or helper 1519# Crypto core or helper
1505# 1520#
1506# CONFIG_CRYPTO_FIPS is not set
1507CONFIG_CRYPTO_ALGAPI=y 1521CONFIG_CRYPTO_ALGAPI=y
1508CONFIG_CRYPTO_ALGAPI2=y 1522CONFIG_CRYPTO_ALGAPI2=y
1509CONFIG_CRYPTO_AEAD2=y 1523CONFIG_CRYPTO_AEAD2=y
@@ -1545,11 +1559,13 @@ CONFIG_CRYPTO_PCBC=m
1545# 1559#
1546# CONFIG_CRYPTO_HMAC is not set 1560# CONFIG_CRYPTO_HMAC is not set
1547# CONFIG_CRYPTO_XCBC is not set 1561# CONFIG_CRYPTO_XCBC is not set
1562# CONFIG_CRYPTO_VMAC is not set
1548 1563
1549# 1564#
1550# Digest 1565# Digest
1551# 1566#
1552# CONFIG_CRYPTO_CRC32C is not set 1567# CONFIG_CRYPTO_CRC32C is not set
1568# CONFIG_CRYPTO_GHASH is not set
1553# CONFIG_CRYPTO_MD4 is not set 1569# CONFIG_CRYPTO_MD4 is not set
1554CONFIG_CRYPTO_MD5=y 1570CONFIG_CRYPTO_MD5=y
1555# CONFIG_CRYPTO_MICHAEL_MIC is not set 1571# CONFIG_CRYPTO_MICHAEL_MIC is not set
diff --git a/arch/powerpc/configs/83xx/mpc834x_itxgp_defconfig b/arch/powerpc/configs/83xx/mpc834x_itxgp_defconfig
index bf6deb831dc3..a668110c10f6 100644
--- a/arch/powerpc/configs/83xx/mpc834x_itxgp_defconfig
+++ b/arch/powerpc/configs/83xx/mpc834x_itxgp_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.31-rc4 3# Linux kernel version: 2.6.32-rc5
4# Wed Jul 29 23:32:08 2009 4# Thu Nov 5 08:20:26 2009
5# 5#
6# CONFIG_PPC64 is not set 6# CONFIG_PPC64 is not set
7 7
@@ -35,6 +35,7 @@ CONFIG_GENERIC_CLOCKEVENTS=y
35CONFIG_GENERIC_HARDIRQS=y 35CONFIG_GENERIC_HARDIRQS=y
36CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y 36CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y
37# CONFIG_HAVE_SETUP_PER_CPU_AREA is not set 37# CONFIG_HAVE_SETUP_PER_CPU_AREA is not set
38# CONFIG_NEED_PER_CPU_EMBED_FIRST_CHUNK 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
@@ -84,11 +85,12 @@ CONFIG_SYSVIPC_SYSCTL=y
84# 85#
85# RCU Subsystem 86# RCU Subsystem
86# 87#
87CONFIG_CLASSIC_RCU=y 88CONFIG_TREE_RCU=y
88# CONFIG_TREE_RCU is not set 89# CONFIG_TREE_PREEMPT_RCU is not set
89# CONFIG_PREEMPT_RCU is not set 90# CONFIG_RCU_TRACE is not set
91CONFIG_RCU_FANOUT=32
92# CONFIG_RCU_FANOUT_EXACT is not set
90# CONFIG_TREE_RCU_TRACE is not set 93# CONFIG_TREE_RCU_TRACE is not set
91# CONFIG_PREEMPT_RCU_TRACE is not set
92# CONFIG_IKCONFIG is not set 94# CONFIG_IKCONFIG is not set
93CONFIG_LOG_BUF_SHIFT=14 95CONFIG_LOG_BUF_SHIFT=14
94CONFIG_GROUP_SCHED=y 96CONFIG_GROUP_SCHED=y
@@ -124,28 +126,29 @@ CONFIG_TIMERFD=y
124CONFIG_EVENTFD=y 126CONFIG_EVENTFD=y
125CONFIG_SHMEM=y 127CONFIG_SHMEM=y
126CONFIG_AIO=y 128CONFIG_AIO=y
127CONFIG_HAVE_PERF_COUNTERS=y 129CONFIG_HAVE_PERF_EVENTS=y
128 130
129# 131#
130# Performance Counters 132# Kernel Performance Events And Counters
131# 133#
134# CONFIG_PERF_EVENTS is not set
132# CONFIG_PERF_COUNTERS is not set 135# CONFIG_PERF_COUNTERS is not set
133CONFIG_VM_EVENT_COUNTERS=y 136CONFIG_VM_EVENT_COUNTERS=y
134CONFIG_PCI_QUIRKS=y 137CONFIG_PCI_QUIRKS=y
135CONFIG_SLUB_DEBUG=y 138CONFIG_SLUB_DEBUG=y
136# CONFIG_STRIP_ASM_SYMS is not set
137CONFIG_COMPAT_BRK=y 139CONFIG_COMPAT_BRK=y
138# CONFIG_SLAB is not set 140# CONFIG_SLAB is not set
139CONFIG_SLUB=y 141CONFIG_SLUB=y
140# CONFIG_SLOB is not set 142# CONFIG_SLOB is not set
141# CONFIG_PROFILING is not set 143# CONFIG_PROFILING is not set
142# CONFIG_MARKERS is not set
143CONFIG_HAVE_OPROFILE=y 144CONFIG_HAVE_OPROFILE=y
144CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS=y 145CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS=y
145CONFIG_HAVE_IOREMAP_PROT=y 146CONFIG_HAVE_IOREMAP_PROT=y
146CONFIG_HAVE_KPROBES=y 147CONFIG_HAVE_KPROBES=y
147CONFIG_HAVE_KRETPROBES=y 148CONFIG_HAVE_KRETPROBES=y
148CONFIG_HAVE_ARCH_TRACEHOOK=y 149CONFIG_HAVE_ARCH_TRACEHOOK=y
150CONFIG_HAVE_DMA_ATTRS=y
151CONFIG_HAVE_DMA_API_DEBUG=y
149 152
150# 153#
151# GCOV-based kernel profiling 154# GCOV-based kernel profiling
@@ -256,6 +259,7 @@ CONFIG_ARCH_HAS_WALK_MEMORY=y
256CONFIG_ARCH_ENABLE_MEMORY_HOTREMOVE=y 259CONFIG_ARCH_ENABLE_MEMORY_HOTREMOVE=y
257# CONFIG_KEXEC is not set 260# CONFIG_KEXEC is not set
258# CONFIG_CRASH_DUMP is not set 261# CONFIG_CRASH_DUMP is not set
262CONFIG_MAX_ACTIVE_REGIONS=32
259CONFIG_ARCH_FLATMEM_ENABLE=y 263CONFIG_ARCH_FLATMEM_ENABLE=y
260CONFIG_ARCH_POPULATES_NODE_MAP=y 264CONFIG_ARCH_POPULATES_NODE_MAP=y
261CONFIG_SELECT_MEMORY_MODEL=y 265CONFIG_SELECT_MEMORY_MODEL=y
@@ -273,6 +277,7 @@ CONFIG_BOUNCE=y
273CONFIG_VIRT_TO_BUS=y 277CONFIG_VIRT_TO_BUS=y
274CONFIG_HAVE_MLOCK=y 278CONFIG_HAVE_MLOCK=y
275CONFIG_HAVE_MLOCKED_PAGE_BIT=y 279CONFIG_HAVE_MLOCKED_PAGE_BIT=y
280# CONFIG_KSM is not set
276CONFIG_DEFAULT_MMAP_MIN_ADDR=4096 281CONFIG_DEFAULT_MMAP_MIN_ADDR=4096
277CONFIG_PPC_4K_PAGES=y 282CONFIG_PPC_4K_PAGES=y
278# CONFIG_PPC_16K_PAGES is not set 283# CONFIG_PPC_16K_PAGES is not set
@@ -368,6 +373,7 @@ CONFIG_DEFAULT_TCP_CONG="cubic"
368# CONFIG_NETFILTER is not set 373# CONFIG_NETFILTER is not set
369# CONFIG_IP_DCCP is not set 374# CONFIG_IP_DCCP is not set
370# CONFIG_IP_SCTP is not set 375# CONFIG_IP_SCTP is not set
376# CONFIG_RDS is not set
371# CONFIG_TIPC is not set 377# CONFIG_TIPC is not set
372# CONFIG_ATM is not set 378# CONFIG_ATM is not set
373# CONFIG_BRIDGE is not set 379# CONFIG_BRIDGE is not set
@@ -397,6 +403,7 @@ CONFIG_DEFAULT_TCP_CONG="cubic"
397# CONFIG_AF_RXRPC is not set 403# CONFIG_AF_RXRPC is not set
398CONFIG_WIRELESS=y 404CONFIG_WIRELESS=y
399# CONFIG_CFG80211 is not set 405# CONFIG_CFG80211 is not set
406CONFIG_CFG80211_DEFAULT_PS_VALUE=0
400CONFIG_WIRELESS_OLD_REGULATORY=y 407CONFIG_WIRELESS_OLD_REGULATORY=y
401# CONFIG_WIRELESS_EXT is not set 408# CONFIG_WIRELESS_EXT is not set
402# CONFIG_LIB80211 is not set 409# CONFIG_LIB80211 is not set
@@ -404,7 +411,6 @@ CONFIG_WIRELESS_OLD_REGULATORY=y
404# 411#
405# CFG80211 needs to be enabled for MAC80211 412# CFG80211 needs to be enabled for MAC80211
406# 413#
407CONFIG_MAC80211_DEFAULT_PS_VALUE=0
408# CONFIG_WIMAX is not set 414# CONFIG_WIMAX is not set
409# CONFIG_RFKILL is not set 415# CONFIG_RFKILL is not set
410# CONFIG_NET_9P is not set 416# CONFIG_NET_9P is not set
@@ -417,6 +423,7 @@ CONFIG_MAC80211_DEFAULT_PS_VALUE=0
417# Generic Driver Options 423# Generic Driver Options
418# 424#
419CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug" 425CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
426# CONFIG_DEVTMPFS is not set
420CONFIG_STANDALONE=y 427CONFIG_STANDALONE=y
421CONFIG_PREVENT_FIRMWARE_BUILD=y 428CONFIG_PREVENT_FIRMWARE_BUILD=y
422# CONFIG_FW_LOADER is not set 429# CONFIG_FW_LOADER is not set
@@ -424,9 +431,9 @@ CONFIG_PREVENT_FIRMWARE_BUILD=y
424# CONFIG_CONNECTOR is not set 431# CONFIG_CONNECTOR is not set
425CONFIG_MTD=y 432CONFIG_MTD=y
426# CONFIG_MTD_DEBUG is not set 433# CONFIG_MTD_DEBUG is not set
434# CONFIG_MTD_TESTS is not set
427# CONFIG_MTD_CONCAT is not set 435# CONFIG_MTD_CONCAT is not set
428# CONFIG_MTD_PARTITIONS is not set 436# CONFIG_MTD_PARTITIONS is not set
429# CONFIG_MTD_TESTS is not set
430 437
431# 438#
432# User Modules And Translation Layers 439# User Modules And Translation Layers
@@ -483,6 +490,7 @@ CONFIG_MTD_PHYSMAP=y
483# CONFIG_MTD_PMC551 is not set 490# CONFIG_MTD_PMC551 is not set
484# CONFIG_MTD_DATAFLASH is not set 491# CONFIG_MTD_DATAFLASH is not set
485# CONFIG_MTD_M25P80 is not set 492# CONFIG_MTD_M25P80 is not set
493# CONFIG_MTD_SST25L is not set
486# CONFIG_MTD_SLRAM is not set 494# CONFIG_MTD_SLRAM is not set
487# CONFIG_MTD_PHRAM is not set 495# CONFIG_MTD_PHRAM is not set
488# CONFIG_MTD_MTDRAM is not set 496# CONFIG_MTD_MTDRAM is not set
@@ -589,6 +597,7 @@ CONFIG_SCSI_LOWLEVEL=y
589# CONFIG_ISCSI_TCP is not set 597# CONFIG_ISCSI_TCP is not set
590# CONFIG_SCSI_CXGB3_ISCSI is not set 598# CONFIG_SCSI_CXGB3_ISCSI is not set
591# CONFIG_SCSI_BNX2_ISCSI is not set 599# CONFIG_SCSI_BNX2_ISCSI is not set
600# CONFIG_BE2ISCSI is not set
592# CONFIG_BLK_DEV_3W_XXXX_RAID is not set 601# CONFIG_BLK_DEV_3W_XXXX_RAID is not set
593# CONFIG_SCSI_3W_9XXX is not set 602# CONFIG_SCSI_3W_9XXX is not set
594# CONFIG_SCSI_ACARD is not set 603# CONFIG_SCSI_ACARD is not set
@@ -627,7 +636,9 @@ CONFIG_SCSI_LOWLEVEL=y
627# CONFIG_SCSI_DC390T is not set 636# CONFIG_SCSI_DC390T is not set
628# CONFIG_SCSI_NSP32 is not set 637# CONFIG_SCSI_NSP32 is not set
629# CONFIG_SCSI_DEBUG is not set 638# CONFIG_SCSI_DEBUG is not set
639# CONFIG_SCSI_PMCRAID is not set
630# CONFIG_SCSI_SRP is not set 640# CONFIG_SCSI_SRP is not set
641# CONFIG_SCSI_BFA_FC is not set
631# CONFIG_SCSI_DH is not set 642# CONFIG_SCSI_DH is not set
632# CONFIG_SCSI_OSD_INITIATOR is not set 643# CONFIG_SCSI_OSD_INITIATOR is not set
633# CONFIG_ATA is not set 644# CONFIG_ATA is not set
@@ -725,10 +736,7 @@ CONFIG_CHELSIO_T3_DEPENDS=y
725# CONFIG_SFC is not set 736# CONFIG_SFC is not set
726# CONFIG_BE2NET is not set 737# CONFIG_BE2NET is not set
727# CONFIG_TR is not set 738# CONFIG_TR is not set
728 739CONFIG_WLAN=y
729#
730# Wireless LAN
731#
732# CONFIG_WLAN_PRE80211 is not set 740# CONFIG_WLAN_PRE80211 is not set
733# CONFIG_WLAN_80211 is not set 741# CONFIG_WLAN_80211 is not set
734 742
@@ -810,6 +818,7 @@ CONFIG_HW_RANDOM=y
810CONFIG_DEVPORT=y 818CONFIG_DEVPORT=y
811CONFIG_I2C=y 819CONFIG_I2C=y
812CONFIG_I2C_BOARDINFO=y 820CONFIG_I2C_BOARDINFO=y
821CONFIG_I2C_COMPAT=y
813CONFIG_I2C_CHARDEV=y 822CONFIG_I2C_CHARDEV=y
814CONFIG_I2C_HELPER_AUTO=y 823CONFIG_I2C_HELPER_AUTO=y
815 824
@@ -864,9 +873,6 @@ CONFIG_I2C_MPC=y
864# Miscellaneous I2C Chip support 873# Miscellaneous I2C Chip support
865# 874#
866# CONFIG_DS1682 is not set 875# CONFIG_DS1682 is not set
867CONFIG_SENSORS_PCF8574=y
868# CONFIG_PCF8575 is not set
869# CONFIG_SENSORS_PCA9539 is not set
870# CONFIG_SENSORS_TSL2550 is not set 876# CONFIG_SENSORS_TSL2550 is not set
871# CONFIG_I2C_DEBUG_CORE is not set 877# CONFIG_I2C_DEBUG_CORE is not set
872# CONFIG_I2C_DEBUG_ALGO is not set 878# CONFIG_I2C_DEBUG_ALGO is not set
@@ -897,7 +903,6 @@ CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y
897# CONFIG_POWER_SUPPLY is not set 903# CONFIG_POWER_SUPPLY is not set
898# CONFIG_HWMON is not set 904# CONFIG_HWMON is not set
899# CONFIG_THERMAL is not set 905# CONFIG_THERMAL is not set
900# CONFIG_THERMAL_HWMON is not set
901CONFIG_WATCHDOG=y 906CONFIG_WATCHDOG=y
902# CONFIG_WATCHDOG_NOWAYOUT is not set 907# CONFIG_WATCHDOG_NOWAYOUT is not set
903 908
@@ -935,8 +940,10 @@ CONFIG_SSB_POSSIBLE=y
935# CONFIG_MFD_TMIO is not set 940# CONFIG_MFD_TMIO is not set
936# CONFIG_PMIC_DA903X is not set 941# CONFIG_PMIC_DA903X is not set
937# CONFIG_MFD_WM8400 is not set 942# CONFIG_MFD_WM8400 is not set
943# CONFIG_MFD_WM831X is not set
938# CONFIG_MFD_WM8350_I2C is not set 944# CONFIG_MFD_WM8350_I2C is not set
939# CONFIG_MFD_PCF50633 is not set 945# CONFIG_MFD_PCF50633 is not set
946# CONFIG_MFD_MC13783 is not set
940# CONFIG_AB3100_CORE is not set 947# CONFIG_AB3100_CORE is not set
941# CONFIG_EZX_PCAP is not set 948# CONFIG_EZX_PCAP is not set
942# CONFIG_REGULATOR is not set 949# CONFIG_REGULATOR is not set
@@ -946,6 +953,7 @@ CONFIG_SSB_POSSIBLE=y
946# Graphics support 953# Graphics support
947# 954#
948# CONFIG_AGP is not set 955# CONFIG_AGP is not set
956CONFIG_VGA_ARB=y
949# CONFIG_DRM is not set 957# CONFIG_DRM is not set
950# CONFIG_VGASTATE is not set 958# CONFIG_VGASTATE is not set
951CONFIG_VIDEO_OUTPUT_CONTROL=m 959CONFIG_VIDEO_OUTPUT_CONTROL=m
@@ -991,6 +999,7 @@ CONFIG_USB_EHCI_HCD_PPC_OF=y
991# CONFIG_USB_OXU210HP_HCD is not set 999# CONFIG_USB_OXU210HP_HCD is not set
992# CONFIG_USB_ISP116X_HCD is not set 1000# CONFIG_USB_ISP116X_HCD is not set
993# CONFIG_USB_ISP1760_HCD is not set 1001# CONFIG_USB_ISP1760_HCD is not set
1002# CONFIG_USB_ISP1362_HCD is not set
994# CONFIG_USB_OHCI_HCD is not set 1003# CONFIG_USB_OHCI_HCD is not set
995CONFIG_USB_UHCI_HCD=y 1004CONFIG_USB_UHCI_HCD=y
996# CONFIG_USB_SL811_HCD is not set 1005# CONFIG_USB_SL811_HCD is not set
@@ -1059,6 +1068,7 @@ CONFIG_USB_STORAGE=y
1059# CONFIG_USB_LD is not set 1068# CONFIG_USB_LD is not set
1060# CONFIG_USB_TRANCEVIBRATOR is not set 1069# CONFIG_USB_TRANCEVIBRATOR is not set
1061# CONFIG_USB_IOWARRIOR is not set 1070# CONFIG_USB_IOWARRIOR is not set
1071# CONFIG_USB_TEST is not set
1062# CONFIG_USB_ISIGHTFW is not set 1072# CONFIG_USB_ISIGHTFW is not set
1063# CONFIG_USB_VST is not set 1073# CONFIG_USB_VST is not set
1064# CONFIG_USB_GADGET is not set 1074# CONFIG_USB_GADGET is not set
@@ -1117,6 +1127,7 @@ CONFIG_RTC_DRV_DS1307=y
1117# CONFIG_RTC_DRV_R9701 is not set 1127# CONFIG_RTC_DRV_R9701 is not set
1118# CONFIG_RTC_DRV_RS5C348 is not set 1128# CONFIG_RTC_DRV_RS5C348 is not set
1119# CONFIG_RTC_DRV_DS3234 is not set 1129# CONFIG_RTC_DRV_DS3234 is not set
1130# CONFIG_RTC_DRV_PCF2123 is not set
1120 1131
1121# 1132#
1122# Platform RTC drivers 1133# Platform RTC drivers
@@ -1167,6 +1178,7 @@ CONFIG_FS_MBCACHE=y
1167# CONFIG_GFS2_FS is not set 1178# CONFIG_GFS2_FS is not set
1168# CONFIG_OCFS2_FS is not set 1179# CONFIG_OCFS2_FS is not set
1169# CONFIG_BTRFS_FS is not set 1180# CONFIG_BTRFS_FS is not set
1181# CONFIG_NILFS2_FS is not set
1170CONFIG_FILE_LOCKING=y 1182CONFIG_FILE_LOCKING=y
1171CONFIG_FSNOTIFY=y 1183CONFIG_FSNOTIFY=y
1172CONFIG_DNOTIFY=y 1184CONFIG_DNOTIFY=y
@@ -1229,7 +1241,6 @@ CONFIG_MISC_FILESYSTEMS=y
1229# CONFIG_ROMFS_FS is not set 1241# CONFIG_ROMFS_FS is not set
1230# CONFIG_SYSV_FS is not set 1242# CONFIG_SYSV_FS is not set
1231# CONFIG_UFS_FS is not set 1243# CONFIG_UFS_FS is not set
1232# CONFIG_NILFS2_FS is not set
1233CONFIG_NETWORK_FILESYSTEMS=y 1244CONFIG_NETWORK_FILESYSTEMS=y
1234CONFIG_NFS_FS=y 1245CONFIG_NFS_FS=y
1235CONFIG_NFS_V3=y 1246CONFIG_NFS_V3=y
@@ -1344,6 +1355,7 @@ CONFIG_ENABLE_WARN_DEPRECATED=y
1344CONFIG_ENABLE_MUST_CHECK=y 1355CONFIG_ENABLE_MUST_CHECK=y
1345CONFIG_FRAME_WARN=1024 1356CONFIG_FRAME_WARN=1024
1346# CONFIG_MAGIC_SYSRQ is not set 1357# CONFIG_MAGIC_SYSRQ is not set
1358# CONFIG_STRIP_ASM_SYMS is not set
1347# CONFIG_UNUSED_SYMBOLS is not set 1359# CONFIG_UNUSED_SYMBOLS is not set
1348# CONFIG_DEBUG_FS is not set 1360# CONFIG_DEBUG_FS is not set
1349# CONFIG_HEADERS_CHECK is not set 1361# CONFIG_HEADERS_CHECK is not set
@@ -1361,6 +1373,7 @@ CONFIG_HAVE_DYNAMIC_FTRACE=y
1361CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y 1373CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y
1362CONFIG_TRACING_SUPPORT=y 1374CONFIG_TRACING_SUPPORT=y
1363# CONFIG_FTRACE is not set 1375# CONFIG_FTRACE is not set
1376# CONFIG_DMA_API_DEBUG is not set
1364# CONFIG_SAMPLES is not set 1377# CONFIG_SAMPLES is not set
1365CONFIG_HAVE_ARCH_KGDB=y 1378CONFIG_HAVE_ARCH_KGDB=y
1366# CONFIG_PPC_DISABLE_WERROR is not set 1379# CONFIG_PPC_DISABLE_WERROR is not set
@@ -1382,7 +1395,6 @@ CONFIG_CRYPTO=y
1382# 1395#
1383# Crypto core or helper 1396# Crypto core or helper
1384# 1397#
1385# CONFIG_CRYPTO_FIPS is not set
1386CONFIG_CRYPTO_ALGAPI=y 1398CONFIG_CRYPTO_ALGAPI=y
1387CONFIG_CRYPTO_ALGAPI2=y 1399CONFIG_CRYPTO_ALGAPI2=y
1388CONFIG_CRYPTO_AEAD2=y 1400CONFIG_CRYPTO_AEAD2=y
@@ -1424,11 +1436,13 @@ CONFIG_CRYPTO_PCBC=m
1424# 1436#
1425# CONFIG_CRYPTO_HMAC is not set 1437# CONFIG_CRYPTO_HMAC is not set
1426# CONFIG_CRYPTO_XCBC is not set 1438# CONFIG_CRYPTO_XCBC is not set
1439# CONFIG_CRYPTO_VMAC is not set
1427 1440
1428# 1441#
1429# Digest 1442# Digest
1430# 1443#
1431# CONFIG_CRYPTO_CRC32C is not set 1444# CONFIG_CRYPTO_CRC32C is not set
1445# CONFIG_CRYPTO_GHASH is not set
1432# CONFIG_CRYPTO_MD4 is not set 1446# CONFIG_CRYPTO_MD4 is not set
1433CONFIG_CRYPTO_MD5=y 1447CONFIG_CRYPTO_MD5=y
1434# CONFIG_CRYPTO_MICHAEL_MIC is not set 1448# CONFIG_CRYPTO_MICHAEL_MIC is not set
diff --git a/arch/powerpc/configs/83xx/mpc834x_mds_defconfig b/arch/powerpc/configs/83xx/mpc834x_mds_defconfig
index 3236c47712c2..c4e92ba5c38b 100644
--- a/arch/powerpc/configs/83xx/mpc834x_mds_defconfig
+++ b/arch/powerpc/configs/83xx/mpc834x_mds_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.31-rc4 3# Linux kernel version: 2.6.32-rc5
4# Wed Jul 29 23:32:09 2009 4# Thu Nov 5 08:20:27 2009
5# 5#
6# CONFIG_PPC64 is not set 6# CONFIG_PPC64 is not set
7 7
@@ -35,6 +35,7 @@ CONFIG_GENERIC_CLOCKEVENTS=y
35CONFIG_GENERIC_HARDIRQS=y 35CONFIG_GENERIC_HARDIRQS=y
36CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y 36CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y
37# CONFIG_HAVE_SETUP_PER_CPU_AREA is not set 37# CONFIG_HAVE_SETUP_PER_CPU_AREA is not set
38# CONFIG_NEED_PER_CPU_EMBED_FIRST_CHUNK 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
@@ -84,11 +85,12 @@ CONFIG_SYSVIPC_SYSCTL=y
84# 85#
85# RCU Subsystem 86# RCU Subsystem
86# 87#
87CONFIG_CLASSIC_RCU=y 88CONFIG_TREE_RCU=y
88# CONFIG_TREE_RCU is not set 89# CONFIG_TREE_PREEMPT_RCU is not set
89# CONFIG_PREEMPT_RCU is not set 90# CONFIG_RCU_TRACE is not set
91CONFIG_RCU_FANOUT=32
92# CONFIG_RCU_FANOUT_EXACT is not set
90# CONFIG_TREE_RCU_TRACE is not set 93# CONFIG_TREE_RCU_TRACE is not set
91# CONFIG_PREEMPT_RCU_TRACE is not set
92# CONFIG_IKCONFIG is not set 94# CONFIG_IKCONFIG is not set
93CONFIG_LOG_BUF_SHIFT=14 95CONFIG_LOG_BUF_SHIFT=14
94CONFIG_GROUP_SCHED=y 96CONFIG_GROUP_SCHED=y
@@ -124,28 +126,29 @@ CONFIG_TIMERFD=y
124CONFIG_EVENTFD=y 126CONFIG_EVENTFD=y
125CONFIG_SHMEM=y 127CONFIG_SHMEM=y
126CONFIG_AIO=y 128CONFIG_AIO=y
127CONFIG_HAVE_PERF_COUNTERS=y 129CONFIG_HAVE_PERF_EVENTS=y
128 130
129# 131#
130# Performance Counters 132# Kernel Performance Events And Counters
131# 133#
134# CONFIG_PERF_EVENTS is not set
132# CONFIG_PERF_COUNTERS is not set 135# CONFIG_PERF_COUNTERS is not set
133CONFIG_VM_EVENT_COUNTERS=y 136CONFIG_VM_EVENT_COUNTERS=y
134CONFIG_PCI_QUIRKS=y 137CONFIG_PCI_QUIRKS=y
135CONFIG_SLUB_DEBUG=y 138CONFIG_SLUB_DEBUG=y
136# CONFIG_STRIP_ASM_SYMS is not set
137CONFIG_COMPAT_BRK=y 139CONFIG_COMPAT_BRK=y
138# CONFIG_SLAB is not set 140# CONFIG_SLAB is not set
139CONFIG_SLUB=y 141CONFIG_SLUB=y
140# CONFIG_SLOB is not set 142# CONFIG_SLOB is not set
141# CONFIG_PROFILING is not set 143# CONFIG_PROFILING is not set
142# CONFIG_MARKERS is not set
143CONFIG_HAVE_OPROFILE=y 144CONFIG_HAVE_OPROFILE=y
144CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS=y 145CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS=y
145CONFIG_HAVE_IOREMAP_PROT=y 146CONFIG_HAVE_IOREMAP_PROT=y
146CONFIG_HAVE_KPROBES=y 147CONFIG_HAVE_KPROBES=y
147CONFIG_HAVE_KRETPROBES=y 148CONFIG_HAVE_KRETPROBES=y
148CONFIG_HAVE_ARCH_TRACEHOOK=y 149CONFIG_HAVE_ARCH_TRACEHOOK=y
150CONFIG_HAVE_DMA_ATTRS=y
151CONFIG_HAVE_DMA_API_DEBUG=y
149 152
150# 153#
151# GCOV-based kernel profiling 154# GCOV-based kernel profiling
@@ -256,6 +259,7 @@ CONFIG_ARCH_HAS_WALK_MEMORY=y
256CONFIG_ARCH_ENABLE_MEMORY_HOTREMOVE=y 259CONFIG_ARCH_ENABLE_MEMORY_HOTREMOVE=y
257# CONFIG_KEXEC is not set 260# CONFIG_KEXEC is not set
258# CONFIG_CRASH_DUMP is not set 261# CONFIG_CRASH_DUMP is not set
262CONFIG_MAX_ACTIVE_REGIONS=32
259CONFIG_ARCH_FLATMEM_ENABLE=y 263CONFIG_ARCH_FLATMEM_ENABLE=y
260CONFIG_ARCH_POPULATES_NODE_MAP=y 264CONFIG_ARCH_POPULATES_NODE_MAP=y
261CONFIG_SELECT_MEMORY_MODEL=y 265CONFIG_SELECT_MEMORY_MODEL=y
@@ -273,6 +277,7 @@ CONFIG_BOUNCE=y
273CONFIG_VIRT_TO_BUS=y 277CONFIG_VIRT_TO_BUS=y
274CONFIG_HAVE_MLOCK=y 278CONFIG_HAVE_MLOCK=y
275CONFIG_HAVE_MLOCKED_PAGE_BIT=y 279CONFIG_HAVE_MLOCKED_PAGE_BIT=y
280# CONFIG_KSM is not set
276CONFIG_DEFAULT_MMAP_MIN_ADDR=4096 281CONFIG_DEFAULT_MMAP_MIN_ADDR=4096
277CONFIG_PPC_4K_PAGES=y 282CONFIG_PPC_4K_PAGES=y
278# CONFIG_PPC_16K_PAGES is not set 283# CONFIG_PPC_16K_PAGES is not set
@@ -368,6 +373,7 @@ CONFIG_DEFAULT_TCP_CONG="cubic"
368# CONFIG_NETFILTER is not set 373# CONFIG_NETFILTER is not set
369# CONFIG_IP_DCCP is not set 374# CONFIG_IP_DCCP is not set
370# CONFIG_IP_SCTP is not set 375# CONFIG_IP_SCTP is not set
376# CONFIG_RDS is not set
371# CONFIG_TIPC is not set 377# CONFIG_TIPC is not set
372# CONFIG_ATM is not set 378# CONFIG_ATM is not set
373# CONFIG_BRIDGE is not set 379# CONFIG_BRIDGE is not set
@@ -397,6 +403,7 @@ CONFIG_DEFAULT_TCP_CONG="cubic"
397# CONFIG_AF_RXRPC is not set 403# CONFIG_AF_RXRPC is not set
398CONFIG_WIRELESS=y 404CONFIG_WIRELESS=y
399# CONFIG_CFG80211 is not set 405# CONFIG_CFG80211 is not set
406CONFIG_CFG80211_DEFAULT_PS_VALUE=0
400CONFIG_WIRELESS_OLD_REGULATORY=y 407CONFIG_WIRELESS_OLD_REGULATORY=y
401# CONFIG_WIRELESS_EXT is not set 408# CONFIG_WIRELESS_EXT is not set
402# CONFIG_LIB80211 is not set 409# CONFIG_LIB80211 is not set
@@ -404,7 +411,6 @@ CONFIG_WIRELESS_OLD_REGULATORY=y
404# 411#
405# CFG80211 needs to be enabled for MAC80211 412# CFG80211 needs to be enabled for MAC80211
406# 413#
407CONFIG_MAC80211_DEFAULT_PS_VALUE=0
408# CONFIG_WIMAX is not set 414# CONFIG_WIMAX is not set
409# CONFIG_RFKILL is not set 415# CONFIG_RFKILL is not set
410# CONFIG_NET_9P is not set 416# CONFIG_NET_9P is not set
@@ -417,6 +423,7 @@ CONFIG_MAC80211_DEFAULT_PS_VALUE=0
417# Generic Driver Options 423# Generic Driver Options
418# 424#
419CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug" 425CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
426# CONFIG_DEVTMPFS is not set
420CONFIG_STANDALONE=y 427CONFIG_STANDALONE=y
421CONFIG_PREVENT_FIRMWARE_BUILD=y 428CONFIG_PREVENT_FIRMWARE_BUILD=y
422# CONFIG_FW_LOADER is not set 429# CONFIG_FW_LOADER is not set
@@ -556,9 +563,11 @@ CONFIG_E100=y
556# CONFIG_SUNDANCE is not set 563# CONFIG_SUNDANCE is not set
557# CONFIG_TLAN is not set 564# CONFIG_TLAN is not set
558# CONFIG_KS8842 is not set 565# CONFIG_KS8842 is not set
566# CONFIG_KS8851_MLL is not set
559# CONFIG_VIA_RHINE is not set 567# CONFIG_VIA_RHINE is not set
560# CONFIG_SC92031 is not set 568# CONFIG_SC92031 is not set
561# CONFIG_ATL2 is not set 569# CONFIG_ATL2 is not set
570# CONFIG_XILINX_EMACLITE is not set
562CONFIG_NETDEV_1000=y 571CONFIG_NETDEV_1000=y
563# CONFIG_ACENIC is not set 572# CONFIG_ACENIC is not set
564# CONFIG_DL2K is not set 573# CONFIG_DL2K is not set
@@ -606,10 +615,7 @@ CONFIG_CHELSIO_T3_DEPENDS=y
606# CONFIG_SFC is not set 615# CONFIG_SFC is not set
607# CONFIG_BE2NET is not set 616# CONFIG_BE2NET is not set
608# CONFIG_TR is not set 617# CONFIG_TR is not set
609 618CONFIG_WLAN=y
610#
611# Wireless LAN
612#
613# CONFIG_WLAN_PRE80211 is not set 619# CONFIG_WLAN_PRE80211 is not set
614# CONFIG_WLAN_80211 is not set 620# CONFIG_WLAN_80211 is not set
615 621
@@ -699,6 +705,7 @@ CONFIG_LEGACY_PTY_COUNT=256
699CONFIG_DEVPORT=y 705CONFIG_DEVPORT=y
700CONFIG_I2C=y 706CONFIG_I2C=y
701CONFIG_I2C_BOARDINFO=y 707CONFIG_I2C_BOARDINFO=y
708CONFIG_I2C_COMPAT=y
702CONFIG_I2C_CHARDEV=y 709CONFIG_I2C_CHARDEV=y
703CONFIG_I2C_HELPER_AUTO=y 710CONFIG_I2C_HELPER_AUTO=y
704 711
@@ -752,9 +759,6 @@ CONFIG_I2C_MPC=y
752# Miscellaneous I2C Chip support 759# Miscellaneous I2C Chip support
753# 760#
754# CONFIG_DS1682 is not set 761# CONFIG_DS1682 is not set
755# CONFIG_SENSORS_PCF8574 is not set
756# CONFIG_PCF8575 is not set
757# CONFIG_SENSORS_PCA9539 is not set
758# CONFIG_SENSORS_TSL2550 is not set 762# CONFIG_SENSORS_TSL2550 is not set
759# CONFIG_I2C_DEBUG_CORE is not set 763# CONFIG_I2C_DEBUG_CORE is not set
760# CONFIG_I2C_DEBUG_ALGO is not set 764# CONFIG_I2C_DEBUG_ALGO is not set
@@ -772,6 +776,11 @@ CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y
772# CONFIG_POWER_SUPPLY is not set 776# CONFIG_POWER_SUPPLY is not set
773CONFIG_HWMON=y 777CONFIG_HWMON=y
774# CONFIG_HWMON_VID is not set 778# CONFIG_HWMON_VID is not set
779# CONFIG_HWMON_DEBUG_CHIP is not set
780
781#
782# Native drivers
783#
775# CONFIG_SENSORS_AD7414 is not set 784# CONFIG_SENSORS_AD7414 is not set
776# CONFIG_SENSORS_AD7418 is not set 785# CONFIG_SENSORS_AD7418 is not set
777# CONFIG_SENSORS_ADM1021 is not set 786# CONFIG_SENSORS_ADM1021 is not set
@@ -821,6 +830,7 @@ CONFIG_HWMON=y
821# CONFIG_SENSORS_ADS7828 is not set 830# CONFIG_SENSORS_ADS7828 is not set
822# CONFIG_SENSORS_THMC50 is not set 831# CONFIG_SENSORS_THMC50 is not set
823# CONFIG_SENSORS_TMP401 is not set 832# CONFIG_SENSORS_TMP401 is not set
833# CONFIG_SENSORS_TMP421 is not set
824# CONFIG_SENSORS_VIA686A is not set 834# CONFIG_SENSORS_VIA686A is not set
825# CONFIG_SENSORS_VT1211 is not set 835# CONFIG_SENSORS_VT1211 is not set
826# CONFIG_SENSORS_VT8231 is not set 836# CONFIG_SENSORS_VT8231 is not set
@@ -832,9 +842,7 @@ CONFIG_HWMON=y
832# CONFIG_SENSORS_W83L786NG is not set 842# CONFIG_SENSORS_W83L786NG is not set
833# CONFIG_SENSORS_W83627HF is not set 843# CONFIG_SENSORS_W83627HF is not set
834# CONFIG_SENSORS_W83627EHF is not set 844# CONFIG_SENSORS_W83627EHF is not set
835# CONFIG_HWMON_DEBUG_CHIP is not set
836# CONFIG_THERMAL is not set 845# CONFIG_THERMAL is not set
837# CONFIG_THERMAL_HWMON is not set
838CONFIG_WATCHDOG=y 846CONFIG_WATCHDOG=y
839# CONFIG_WATCHDOG_NOWAYOUT is not set 847# CONFIG_WATCHDOG_NOWAYOUT is not set
840 848
@@ -867,6 +875,7 @@ CONFIG_SSB_POSSIBLE=y
867# CONFIG_MFD_TMIO is not set 875# CONFIG_MFD_TMIO is not set
868# CONFIG_PMIC_DA903X is not set 876# CONFIG_PMIC_DA903X is not set
869# CONFIG_MFD_WM8400 is not set 877# CONFIG_MFD_WM8400 is not set
878# CONFIG_MFD_WM831X is not set
870# CONFIG_MFD_WM8350_I2C is not set 879# CONFIG_MFD_WM8350_I2C is not set
871# CONFIG_MFD_PCF50633 is not set 880# CONFIG_MFD_PCF50633 is not set
872# CONFIG_AB3100_CORE is not set 881# CONFIG_AB3100_CORE is not set
@@ -877,6 +886,7 @@ CONFIG_SSB_POSSIBLE=y
877# Graphics support 886# Graphics support
878# 887#
879# CONFIG_AGP is not set 888# CONFIG_AGP is not set
889CONFIG_VGA_ARB=y
880# CONFIG_DRM is not set 890# CONFIG_DRM is not set
881# CONFIG_VGASTATE is not set 891# CONFIG_VGASTATE is not set
882CONFIG_VIDEO_OUTPUT_CONTROL=m 892CONFIG_VIDEO_OUTPUT_CONTROL=m
@@ -890,7 +900,6 @@ CONFIG_VIDEO_OUTPUT_CONTROL=m
890# CONFIG_SOUND is not set 900# CONFIG_SOUND is not set
891CONFIG_HID_SUPPORT=y 901CONFIG_HID_SUPPORT=y
892CONFIG_HID=y 902CONFIG_HID=y
893# CONFIG_HID_DEBUG is not set
894# CONFIG_HIDRAW is not set 903# CONFIG_HIDRAW is not set
895# CONFIG_HID_PID is not set 904# CONFIG_HID_PID is not set
896 905
@@ -1010,6 +1019,7 @@ CONFIG_FS_MBCACHE=y
1010# CONFIG_GFS2_FS is not set 1019# CONFIG_GFS2_FS is not set
1011# CONFIG_OCFS2_FS is not set 1020# CONFIG_OCFS2_FS is not set
1012# CONFIG_BTRFS_FS is not set 1021# CONFIG_BTRFS_FS is not set
1022# CONFIG_NILFS2_FS is not set
1013CONFIG_FILE_LOCKING=y 1023CONFIG_FILE_LOCKING=y
1014CONFIG_FSNOTIFY=y 1024CONFIG_FSNOTIFY=y
1015CONFIG_DNOTIFY=y 1025CONFIG_DNOTIFY=y
@@ -1068,7 +1078,6 @@ CONFIG_MISC_FILESYSTEMS=y
1068# CONFIG_ROMFS_FS is not set 1078# CONFIG_ROMFS_FS is not set
1069# CONFIG_SYSV_FS is not set 1079# CONFIG_SYSV_FS is not set
1070# CONFIG_UFS_FS is not set 1080# CONFIG_UFS_FS is not set
1071# CONFIG_NILFS2_FS is not set
1072CONFIG_NETWORK_FILESYSTEMS=y 1081CONFIG_NETWORK_FILESYSTEMS=y
1073CONFIG_NFS_FS=y 1082CONFIG_NFS_FS=y
1074CONFIG_NFS_V3=y 1083CONFIG_NFS_V3=y
@@ -1140,6 +1149,7 @@ CONFIG_ENABLE_WARN_DEPRECATED=y
1140CONFIG_ENABLE_MUST_CHECK=y 1149CONFIG_ENABLE_MUST_CHECK=y
1141CONFIG_FRAME_WARN=1024 1150CONFIG_FRAME_WARN=1024
1142# CONFIG_MAGIC_SYSRQ is not set 1151# CONFIG_MAGIC_SYSRQ is not set
1152# CONFIG_STRIP_ASM_SYMS is not set
1143# CONFIG_UNUSED_SYMBOLS is not set 1153# CONFIG_UNUSED_SYMBOLS is not set
1144# CONFIG_DEBUG_FS is not set 1154# CONFIG_DEBUG_FS is not set
1145# CONFIG_HEADERS_CHECK is not set 1155# CONFIG_HEADERS_CHECK is not set
@@ -1157,6 +1167,7 @@ CONFIG_HAVE_DYNAMIC_FTRACE=y
1157CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y 1167CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y
1158CONFIG_TRACING_SUPPORT=y 1168CONFIG_TRACING_SUPPORT=y
1159# CONFIG_FTRACE is not set 1169# CONFIG_FTRACE is not set
1170# CONFIG_DMA_API_DEBUG is not set
1160# CONFIG_SAMPLES is not set 1171# CONFIG_SAMPLES is not set
1161CONFIG_HAVE_ARCH_KGDB=y 1172CONFIG_HAVE_ARCH_KGDB=y
1162# CONFIG_PPC_DISABLE_WERROR is not set 1173# CONFIG_PPC_DISABLE_WERROR is not set
@@ -1178,7 +1189,6 @@ CONFIG_CRYPTO=y
1178# 1189#
1179# Crypto core or helper 1190# Crypto core or helper
1180# 1191#
1181# CONFIG_CRYPTO_FIPS is not set
1182CONFIG_CRYPTO_ALGAPI=y 1192CONFIG_CRYPTO_ALGAPI=y
1183CONFIG_CRYPTO_ALGAPI2=y 1193CONFIG_CRYPTO_ALGAPI2=y
1184CONFIG_CRYPTO_AEAD2=y 1194CONFIG_CRYPTO_AEAD2=y
@@ -1220,11 +1230,13 @@ CONFIG_CRYPTO_PCBC=m
1220# 1230#
1221# CONFIG_CRYPTO_HMAC is not set 1231# CONFIG_CRYPTO_HMAC is not set
1222# CONFIG_CRYPTO_XCBC is not set 1232# CONFIG_CRYPTO_XCBC is not set
1233# CONFIG_CRYPTO_VMAC is not set
1223 1234
1224# 1235#
1225# Digest 1236# Digest
1226# 1237#
1227# CONFIG_CRYPTO_CRC32C is not set 1238# CONFIG_CRYPTO_CRC32C is not set
1239# CONFIG_CRYPTO_GHASH is not set
1228# CONFIG_CRYPTO_MD4 is not set 1240# CONFIG_CRYPTO_MD4 is not set
1229CONFIG_CRYPTO_MD5=y 1241CONFIG_CRYPTO_MD5=y
1230# CONFIG_CRYPTO_MICHAEL_MIC is not set 1242# CONFIG_CRYPTO_MICHAEL_MIC is not set
diff --git a/arch/powerpc/configs/83xx/mpc836x_mds_defconfig b/arch/powerpc/configs/83xx/mpc836x_mds_defconfig
index 8c5299d74813..4f434b1492fa 100644
--- a/arch/powerpc/configs/83xx/mpc836x_mds_defconfig
+++ b/arch/powerpc/configs/83xx/mpc836x_mds_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.31-rc4 3# Linux kernel version: 2.6.32-rc5
4# Wed Jul 29 23:32:10 2009 4# Thu Nov 5 08:20:28 2009
5# 5#
6# CONFIG_PPC64 is not set 6# CONFIG_PPC64 is not set
7 7
@@ -35,6 +35,7 @@ CONFIG_GENERIC_CLOCKEVENTS=y
35CONFIG_GENERIC_HARDIRQS=y 35CONFIG_GENERIC_HARDIRQS=y
36CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y 36CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y
37# CONFIG_HAVE_SETUP_PER_CPU_AREA is not set 37# CONFIG_HAVE_SETUP_PER_CPU_AREA is not set
38# CONFIG_NEED_PER_CPU_EMBED_FIRST_CHUNK 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
@@ -84,11 +85,12 @@ CONFIG_SYSVIPC_SYSCTL=y
84# 85#
85# RCU Subsystem 86# RCU Subsystem
86# 87#
87CONFIG_CLASSIC_RCU=y 88CONFIG_TREE_RCU=y
88# CONFIG_TREE_RCU is not set 89# CONFIG_TREE_PREEMPT_RCU is not set
89# CONFIG_PREEMPT_RCU is not set 90# CONFIG_RCU_TRACE is not set
91CONFIG_RCU_FANOUT=32
92# CONFIG_RCU_FANOUT_EXACT is not set
90# CONFIG_TREE_RCU_TRACE is not set 93# CONFIG_TREE_RCU_TRACE is not set
91# CONFIG_PREEMPT_RCU_TRACE is not set
92# CONFIG_IKCONFIG is not set 94# CONFIG_IKCONFIG is not set
93CONFIG_LOG_BUF_SHIFT=14 95CONFIG_LOG_BUF_SHIFT=14
94CONFIG_GROUP_SCHED=y 96CONFIG_GROUP_SCHED=y
@@ -124,28 +126,29 @@ CONFIG_TIMERFD=y
124CONFIG_EVENTFD=y 126CONFIG_EVENTFD=y
125CONFIG_SHMEM=y 127CONFIG_SHMEM=y
126CONFIG_AIO=y 128CONFIG_AIO=y
127CONFIG_HAVE_PERF_COUNTERS=y 129CONFIG_HAVE_PERF_EVENTS=y
128 130
129# 131#
130# Performance Counters 132# Kernel Performance Events And Counters
131# 133#
134# CONFIG_PERF_EVENTS is not set
132# CONFIG_PERF_COUNTERS is not set 135# CONFIG_PERF_COUNTERS is not set
133CONFIG_VM_EVENT_COUNTERS=y 136CONFIG_VM_EVENT_COUNTERS=y
134CONFIG_PCI_QUIRKS=y 137CONFIG_PCI_QUIRKS=y
135CONFIG_SLUB_DEBUG=y 138CONFIG_SLUB_DEBUG=y
136# CONFIG_STRIP_ASM_SYMS is not set
137CONFIG_COMPAT_BRK=y 139CONFIG_COMPAT_BRK=y
138# CONFIG_SLAB is not set 140# CONFIG_SLAB is not set
139CONFIG_SLUB=y 141CONFIG_SLUB=y
140# CONFIG_SLOB is not set 142# CONFIG_SLOB is not set
141# CONFIG_PROFILING is not set 143# CONFIG_PROFILING is not set
142# CONFIG_MARKERS is not set
143CONFIG_HAVE_OPROFILE=y 144CONFIG_HAVE_OPROFILE=y
144CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS=y 145CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS=y
145CONFIG_HAVE_IOREMAP_PROT=y 146CONFIG_HAVE_IOREMAP_PROT=y
146CONFIG_HAVE_KPROBES=y 147CONFIG_HAVE_KPROBES=y
147CONFIG_HAVE_KRETPROBES=y 148CONFIG_HAVE_KRETPROBES=y
148CONFIG_HAVE_ARCH_TRACEHOOK=y 149CONFIG_HAVE_ARCH_TRACEHOOK=y
150CONFIG_HAVE_DMA_ATTRS=y
151CONFIG_HAVE_DMA_API_DEBUG=y
149 152
150# 153#
151# GCOV-based kernel profiling 154# GCOV-based kernel profiling
@@ -255,6 +258,7 @@ CONFIG_ARCH_HAS_WALK_MEMORY=y
255CONFIG_ARCH_ENABLE_MEMORY_HOTREMOVE=y 258CONFIG_ARCH_ENABLE_MEMORY_HOTREMOVE=y
256# CONFIG_KEXEC is not set 259# CONFIG_KEXEC is not set
257# CONFIG_CRASH_DUMP is not set 260# CONFIG_CRASH_DUMP is not set
261CONFIG_MAX_ACTIVE_REGIONS=32
258CONFIG_ARCH_FLATMEM_ENABLE=y 262CONFIG_ARCH_FLATMEM_ENABLE=y
259CONFIG_ARCH_POPULATES_NODE_MAP=y 263CONFIG_ARCH_POPULATES_NODE_MAP=y
260CONFIG_SELECT_MEMORY_MODEL=y 264CONFIG_SELECT_MEMORY_MODEL=y
@@ -272,6 +276,7 @@ CONFIG_BOUNCE=y
272CONFIG_VIRT_TO_BUS=y 276CONFIG_VIRT_TO_BUS=y
273CONFIG_HAVE_MLOCK=y 277CONFIG_HAVE_MLOCK=y
274CONFIG_HAVE_MLOCKED_PAGE_BIT=y 278CONFIG_HAVE_MLOCKED_PAGE_BIT=y
279# CONFIG_KSM is not set
275CONFIG_DEFAULT_MMAP_MIN_ADDR=4096 280CONFIG_DEFAULT_MMAP_MIN_ADDR=4096
276CONFIG_PPC_4K_PAGES=y 281CONFIG_PPC_4K_PAGES=y
277# CONFIG_PPC_16K_PAGES is not set 282# CONFIG_PPC_16K_PAGES is not set
@@ -367,6 +372,7 @@ CONFIG_DEFAULT_TCP_CONG="cubic"
367# CONFIG_NETFILTER is not set 372# CONFIG_NETFILTER is not set
368# CONFIG_IP_DCCP is not set 373# CONFIG_IP_DCCP is not set
369# CONFIG_IP_SCTP is not set 374# CONFIG_IP_SCTP is not set
375# CONFIG_RDS is not set
370# CONFIG_TIPC is not set 376# CONFIG_TIPC is not set
371# CONFIG_ATM is not set 377# CONFIG_ATM is not set
372# CONFIG_BRIDGE is not set 378# CONFIG_BRIDGE is not set
@@ -396,6 +402,7 @@ CONFIG_DEFAULT_TCP_CONG="cubic"
396# CONFIG_AF_RXRPC is not set 402# CONFIG_AF_RXRPC is not set
397CONFIG_WIRELESS=y 403CONFIG_WIRELESS=y
398# CONFIG_CFG80211 is not set 404# CONFIG_CFG80211 is not set
405CONFIG_CFG80211_DEFAULT_PS_VALUE=0
399CONFIG_WIRELESS_OLD_REGULATORY=y 406CONFIG_WIRELESS_OLD_REGULATORY=y
400# CONFIG_WIRELESS_EXT is not set 407# CONFIG_WIRELESS_EXT is not set
401# CONFIG_LIB80211 is not set 408# CONFIG_LIB80211 is not set
@@ -403,7 +410,6 @@ CONFIG_WIRELESS_OLD_REGULATORY=y
403# 410#
404# CFG80211 needs to be enabled for MAC80211 411# CFG80211 needs to be enabled for MAC80211
405# 412#
406CONFIG_MAC80211_DEFAULT_PS_VALUE=0
407# CONFIG_WIMAX is not set 413# CONFIG_WIMAX is not set
408# CONFIG_RFKILL is not set 414# CONFIG_RFKILL is not set
409# CONFIG_NET_9P is not set 415# CONFIG_NET_9P is not set
@@ -416,6 +422,7 @@ CONFIG_MAC80211_DEFAULT_PS_VALUE=0
416# Generic Driver Options 422# Generic Driver Options
417# 423#
418CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug" 424CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
425# CONFIG_DEVTMPFS is not set
419CONFIG_STANDALONE=y 426CONFIG_STANDALONE=y
420CONFIG_PREVENT_FIRMWARE_BUILD=y 427CONFIG_PREVENT_FIRMWARE_BUILD=y
421# CONFIG_FW_LOADER is not set 428# CONFIG_FW_LOADER is not set
@@ -423,9 +430,9 @@ CONFIG_PREVENT_FIRMWARE_BUILD=y
423# CONFIG_CONNECTOR is not set 430# CONFIG_CONNECTOR is not set
424CONFIG_MTD=y 431CONFIG_MTD=y
425# CONFIG_MTD_DEBUG is not set 432# CONFIG_MTD_DEBUG is not set
433# CONFIG_MTD_TESTS is not set
426# CONFIG_MTD_CONCAT is not set 434# CONFIG_MTD_CONCAT is not set
427CONFIG_MTD_PARTITIONS=y 435CONFIG_MTD_PARTITIONS=y
428# CONFIG_MTD_TESTS is not set
429# CONFIG_MTD_REDBOOT_PARTS is not set 436# CONFIG_MTD_REDBOOT_PARTS is not set
430CONFIG_MTD_CMDLINE_PARTS=y 437CONFIG_MTD_CMDLINE_PARTS=y
431# CONFIG_MTD_OF_PARTS is not set 438# CONFIG_MTD_OF_PARTS is not set
@@ -585,6 +592,7 @@ CONFIG_SCSI_LOWLEVEL=y
585# CONFIG_ISCSI_TCP is not set 592# CONFIG_ISCSI_TCP is not set
586# CONFIG_SCSI_CXGB3_ISCSI is not set 593# CONFIG_SCSI_CXGB3_ISCSI is not set
587# CONFIG_SCSI_BNX2_ISCSI is not set 594# CONFIG_SCSI_BNX2_ISCSI is not set
595# CONFIG_BE2ISCSI is not set
588# CONFIG_BLK_DEV_3W_XXXX_RAID is not set 596# CONFIG_BLK_DEV_3W_XXXX_RAID is not set
589# CONFIG_SCSI_3W_9XXX is not set 597# CONFIG_SCSI_3W_9XXX is not set
590# CONFIG_SCSI_ACARD is not set 598# CONFIG_SCSI_ACARD is not set
@@ -623,7 +631,9 @@ CONFIG_SCSI_LOWLEVEL=y
623# CONFIG_SCSI_DC390T is not set 631# CONFIG_SCSI_DC390T is not set
624# CONFIG_SCSI_NSP32 is not set 632# CONFIG_SCSI_NSP32 is not set
625# CONFIG_SCSI_DEBUG is not set 633# CONFIG_SCSI_DEBUG is not set
634# CONFIG_SCSI_PMCRAID is not set
626# CONFIG_SCSI_SRP is not set 635# CONFIG_SCSI_SRP is not set
636# CONFIG_SCSI_BFA_FC is not set
627# CONFIG_SCSI_DH is not set 637# CONFIG_SCSI_DH is not set
628# CONFIG_SCSI_OSD_INITIATOR is not set 638# CONFIG_SCSI_OSD_INITIATOR is not set
629# CONFIG_ATA is not set 639# CONFIG_ATA is not set
@@ -693,7 +703,9 @@ CONFIG_MII=y
693# CONFIG_NET_PCI is not set 703# CONFIG_NET_PCI is not set
694# CONFIG_B44 is not set 704# CONFIG_B44 is not set
695# CONFIG_KS8842 is not set 705# CONFIG_KS8842 is not set
706# CONFIG_KS8851_MLL is not set
696# CONFIG_ATL2 is not set 707# CONFIG_ATL2 is not set
708# CONFIG_XILINX_EMACLITE is not set
697CONFIG_NETDEV_1000=y 709CONFIG_NETDEV_1000=y
698# CONFIG_ACENIC is not set 710# CONFIG_ACENIC is not set
699# CONFIG_DL2K is not set 711# CONFIG_DL2K is not set
@@ -716,7 +728,6 @@ CONFIG_NETDEV_1000=y
716CONFIG_FSL_PQ_MDIO=y 728CONFIG_FSL_PQ_MDIO=y
717# CONFIG_GIANFAR is not set 729# CONFIG_GIANFAR is not set
718CONFIG_UCC_GETH=y 730CONFIG_UCC_GETH=y
719# CONFIG_UGETH_MAGIC_PACKET is not set
720# CONFIG_UGETH_TX_ON_DEMAND is not set 731# CONFIG_UGETH_TX_ON_DEMAND is not set
721# CONFIG_MV643XX_ETH is not set 732# CONFIG_MV643XX_ETH is not set
722# CONFIG_QLA3XXX is not set 733# CONFIG_QLA3XXX is not set
@@ -744,10 +755,7 @@ CONFIG_CHELSIO_T3_DEPENDS=y
744# CONFIG_SFC is not set 755# CONFIG_SFC is not set
745# CONFIG_BE2NET is not set 756# CONFIG_BE2NET is not set
746# CONFIG_TR is not set 757# CONFIG_TR is not set
747 758CONFIG_WLAN=y
748#
749# Wireless LAN
750#
751# CONFIG_WLAN_PRE80211 is not set 759# CONFIG_WLAN_PRE80211 is not set
752# CONFIG_WLAN_80211 is not set 760# CONFIG_WLAN_80211 is not set
753 761
@@ -840,6 +848,7 @@ CONFIG_HW_RANDOM=y
840CONFIG_DEVPORT=y 848CONFIG_DEVPORT=y
841CONFIG_I2C=y 849CONFIG_I2C=y
842CONFIG_I2C_BOARDINFO=y 850CONFIG_I2C_BOARDINFO=y
851CONFIG_I2C_COMPAT=y
843CONFIG_I2C_CHARDEV=y 852CONFIG_I2C_CHARDEV=y
844CONFIG_I2C_HELPER_AUTO=y 853CONFIG_I2C_HELPER_AUTO=y
845 854
@@ -893,9 +902,6 @@ CONFIG_I2C_MPC=y
893# Miscellaneous I2C Chip support 902# Miscellaneous I2C Chip support
894# 903#
895# CONFIG_DS1682 is not set 904# CONFIG_DS1682 is not set
896# CONFIG_SENSORS_PCF8574 is not set
897# CONFIG_PCF8575 is not set
898# CONFIG_SENSORS_PCA9539 is not set
899# CONFIG_SENSORS_TSL2550 is not set 905# CONFIG_SENSORS_TSL2550 is not set
900# CONFIG_I2C_DEBUG_CORE is not set 906# CONFIG_I2C_DEBUG_CORE is not set
901# CONFIG_I2C_DEBUG_ALGO is not set 907# CONFIG_I2C_DEBUG_ALGO is not set
@@ -913,6 +919,11 @@ CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y
913# CONFIG_POWER_SUPPLY is not set 919# CONFIG_POWER_SUPPLY is not set
914CONFIG_HWMON=y 920CONFIG_HWMON=y
915# CONFIG_HWMON_VID is not set 921# CONFIG_HWMON_VID is not set
922# CONFIG_HWMON_DEBUG_CHIP is not set
923
924#
925# Native drivers
926#
916# CONFIG_SENSORS_AD7414 is not set 927# CONFIG_SENSORS_AD7414 is not set
917# CONFIG_SENSORS_AD7418 is not set 928# CONFIG_SENSORS_AD7418 is not set
918# CONFIG_SENSORS_ADM1021 is not set 929# CONFIG_SENSORS_ADM1021 is not set
@@ -962,6 +973,7 @@ CONFIG_HWMON=y
962# CONFIG_SENSORS_ADS7828 is not set 973# CONFIG_SENSORS_ADS7828 is not set
963# CONFIG_SENSORS_THMC50 is not set 974# CONFIG_SENSORS_THMC50 is not set
964# CONFIG_SENSORS_TMP401 is not set 975# CONFIG_SENSORS_TMP401 is not set
976# CONFIG_SENSORS_TMP421 is not set
965# CONFIG_SENSORS_VIA686A is not set 977# CONFIG_SENSORS_VIA686A is not set
966# CONFIG_SENSORS_VT1211 is not set 978# CONFIG_SENSORS_VT1211 is not set
967# CONFIG_SENSORS_VT8231 is not set 979# CONFIG_SENSORS_VT8231 is not set
@@ -973,9 +985,7 @@ CONFIG_HWMON=y
973# CONFIG_SENSORS_W83L786NG is not set 985# CONFIG_SENSORS_W83L786NG is not set
974# CONFIG_SENSORS_W83627HF is not set 986# CONFIG_SENSORS_W83627HF is not set
975# CONFIG_SENSORS_W83627EHF is not set 987# CONFIG_SENSORS_W83627EHF is not set
976# CONFIG_HWMON_DEBUG_CHIP is not set
977# CONFIG_THERMAL is not set 988# CONFIG_THERMAL is not set
978# CONFIG_THERMAL_HWMON is not set
979CONFIG_WATCHDOG=y 989CONFIG_WATCHDOG=y
980# CONFIG_WATCHDOG_NOWAYOUT is not set 990# CONFIG_WATCHDOG_NOWAYOUT is not set
981 991
@@ -1008,6 +1018,7 @@ CONFIG_SSB_POSSIBLE=y
1008# CONFIG_MFD_TMIO is not set 1018# CONFIG_MFD_TMIO is not set
1009# CONFIG_PMIC_DA903X is not set 1019# CONFIG_PMIC_DA903X is not set
1010# CONFIG_MFD_WM8400 is not set 1020# CONFIG_MFD_WM8400 is not set
1021# CONFIG_MFD_WM831X is not set
1011# CONFIG_MFD_WM8350_I2C is not set 1022# CONFIG_MFD_WM8350_I2C is not set
1012# CONFIG_MFD_PCF50633 is not set 1023# CONFIG_MFD_PCF50633 is not set
1013# CONFIG_AB3100_CORE is not set 1024# CONFIG_AB3100_CORE is not set
@@ -1018,6 +1029,7 @@ CONFIG_SSB_POSSIBLE=y
1018# Graphics support 1029# Graphics support
1019# 1030#
1020# CONFIG_AGP is not set 1031# CONFIG_AGP is not set
1032CONFIG_VGA_ARB=y
1021# CONFIG_DRM is not set 1033# CONFIG_DRM is not set
1022# CONFIG_VGASTATE is not set 1034# CONFIG_VGASTATE is not set
1023CONFIG_VIDEO_OUTPUT_CONTROL=m 1035CONFIG_VIDEO_OUTPUT_CONTROL=m
@@ -1031,7 +1043,6 @@ CONFIG_VIDEO_OUTPUT_CONTROL=m
1031# CONFIG_SOUND is not set 1043# CONFIG_SOUND is not set
1032CONFIG_HID_SUPPORT=y 1044CONFIG_HID_SUPPORT=y
1033CONFIG_HID=y 1045CONFIG_HID=y
1034# CONFIG_HID_DEBUG is not set
1035# CONFIG_HIDRAW is not set 1046# CONFIG_HIDRAW is not set
1036# CONFIG_HID_PID is not set 1047# CONFIG_HID_PID is not set
1037 1048
@@ -1151,6 +1162,7 @@ CONFIG_FS_MBCACHE=y
1151# CONFIG_GFS2_FS is not set 1162# CONFIG_GFS2_FS is not set
1152# CONFIG_OCFS2_FS is not set 1163# CONFIG_OCFS2_FS is not set
1153# CONFIG_BTRFS_FS is not set 1164# CONFIG_BTRFS_FS is not set
1165# CONFIG_NILFS2_FS is not set
1154CONFIG_FILE_LOCKING=y 1166CONFIG_FILE_LOCKING=y
1155CONFIG_FSNOTIFY=y 1167CONFIG_FSNOTIFY=y
1156CONFIG_DNOTIFY=y 1168CONFIG_DNOTIFY=y
@@ -1210,7 +1222,6 @@ CONFIG_MISC_FILESYSTEMS=y
1210# CONFIG_ROMFS_FS is not set 1222# CONFIG_ROMFS_FS is not set
1211# CONFIG_SYSV_FS is not set 1223# CONFIG_SYSV_FS is not set
1212# CONFIG_UFS_FS is not set 1224# CONFIG_UFS_FS is not set
1213# CONFIG_NILFS2_FS is not set
1214CONFIG_NETWORK_FILESYSTEMS=y 1225CONFIG_NETWORK_FILESYSTEMS=y
1215CONFIG_NFS_FS=y 1226CONFIG_NFS_FS=y
1216CONFIG_NFS_V3=y 1227CONFIG_NFS_V3=y
@@ -1284,6 +1295,7 @@ CONFIG_ENABLE_WARN_DEPRECATED=y
1284CONFIG_ENABLE_MUST_CHECK=y 1295CONFIG_ENABLE_MUST_CHECK=y
1285CONFIG_FRAME_WARN=1024 1296CONFIG_FRAME_WARN=1024
1286# CONFIG_MAGIC_SYSRQ is not set 1297# CONFIG_MAGIC_SYSRQ is not set
1298# CONFIG_STRIP_ASM_SYMS is not set
1287# CONFIG_UNUSED_SYMBOLS is not set 1299# CONFIG_UNUSED_SYMBOLS is not set
1288# CONFIG_DEBUG_FS is not set 1300# CONFIG_DEBUG_FS is not set
1289# CONFIG_HEADERS_CHECK is not set 1301# CONFIG_HEADERS_CHECK is not set
@@ -1301,6 +1313,7 @@ CONFIG_HAVE_DYNAMIC_FTRACE=y
1301CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y 1313CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y
1302CONFIG_TRACING_SUPPORT=y 1314CONFIG_TRACING_SUPPORT=y
1303# CONFIG_FTRACE is not set 1315# CONFIG_FTRACE is not set
1316# CONFIG_DMA_API_DEBUG is not set
1304# CONFIG_SAMPLES is not set 1317# CONFIG_SAMPLES is not set
1305CONFIG_HAVE_ARCH_KGDB=y 1318CONFIG_HAVE_ARCH_KGDB=y
1306# CONFIG_PPC_DISABLE_WERROR is not set 1319# CONFIG_PPC_DISABLE_WERROR is not set
@@ -1322,7 +1335,6 @@ CONFIG_CRYPTO=y
1322# 1335#
1323# Crypto core or helper 1336# Crypto core or helper
1324# 1337#
1325# CONFIG_CRYPTO_FIPS is not set
1326CONFIG_CRYPTO_ALGAPI=y 1338CONFIG_CRYPTO_ALGAPI=y
1327CONFIG_CRYPTO_ALGAPI2=y 1339CONFIG_CRYPTO_ALGAPI2=y
1328CONFIG_CRYPTO_AEAD2=y 1340CONFIG_CRYPTO_AEAD2=y
@@ -1364,11 +1376,13 @@ CONFIG_CRYPTO_PCBC=m
1364# 1376#
1365# CONFIG_CRYPTO_HMAC is not set 1377# CONFIG_CRYPTO_HMAC is not set
1366# CONFIG_CRYPTO_XCBC is not set 1378# CONFIG_CRYPTO_XCBC is not set
1379# CONFIG_CRYPTO_VMAC is not set
1367 1380
1368# 1381#
1369# Digest 1382# Digest
1370# 1383#
1371# CONFIG_CRYPTO_CRC32C is not set 1384# CONFIG_CRYPTO_CRC32C is not set
1385# CONFIG_CRYPTO_GHASH is not set
1372# CONFIG_CRYPTO_MD4 is not set 1386# CONFIG_CRYPTO_MD4 is not set
1373CONFIG_CRYPTO_MD5=y 1387CONFIG_CRYPTO_MD5=y
1374# CONFIG_CRYPTO_MICHAEL_MIC is not set 1388# CONFIG_CRYPTO_MICHAEL_MIC is not set
diff --git a/arch/powerpc/configs/83xx/mpc836x_rdk_defconfig b/arch/powerpc/configs/83xx/mpc836x_rdk_defconfig
index ff31667a890b..b52ec0861679 100644
--- a/arch/powerpc/configs/83xx/mpc836x_rdk_defconfig
+++ b/arch/powerpc/configs/83xx/mpc836x_rdk_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.31-rc4 3# Linux kernel version: 2.6.32-rc5
4# Wed Jul 29 23:32:12 2009 4# Thu Nov 5 08:20:30 2009
5# 5#
6# CONFIG_PPC64 is not set 6# CONFIG_PPC64 is not set
7 7
@@ -35,6 +35,7 @@ CONFIG_GENERIC_CLOCKEVENTS=y
35CONFIG_GENERIC_HARDIRQS=y 35CONFIG_GENERIC_HARDIRQS=y
36CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y 36CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y
37# CONFIG_HAVE_SETUP_PER_CPU_AREA is not set 37# CONFIG_HAVE_SETUP_PER_CPU_AREA is not set
38# CONFIG_NEED_PER_CPU_EMBED_FIRST_CHUNK 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
@@ -85,11 +86,12 @@ CONFIG_SYSVIPC_SYSCTL=y
85# 86#
86# RCU Subsystem 87# RCU Subsystem
87# 88#
88CONFIG_CLASSIC_RCU=y 89CONFIG_TREE_RCU=y
89# CONFIG_TREE_RCU is not set 90# CONFIG_TREE_PREEMPT_RCU is not set
90# CONFIG_PREEMPT_RCU is not set 91# CONFIG_RCU_TRACE is not set
92CONFIG_RCU_FANOUT=32
93# CONFIG_RCU_FANOUT_EXACT is not set
91# CONFIG_TREE_RCU_TRACE is not set 94# CONFIG_TREE_RCU_TRACE is not set
92# CONFIG_PREEMPT_RCU_TRACE is not set
93# CONFIG_IKCONFIG is not set 95# CONFIG_IKCONFIG is not set
94CONFIG_LOG_BUF_SHIFT=14 96CONFIG_LOG_BUF_SHIFT=14
95CONFIG_GROUP_SCHED=y 97CONFIG_GROUP_SCHED=y
@@ -125,28 +127,29 @@ CONFIG_TIMERFD=y
125CONFIG_EVENTFD=y 127CONFIG_EVENTFD=y
126CONFIG_SHMEM=y 128CONFIG_SHMEM=y
127CONFIG_AIO=y 129CONFIG_AIO=y
128CONFIG_HAVE_PERF_COUNTERS=y 130CONFIG_HAVE_PERF_EVENTS=y
129 131
130# 132#
131# Performance Counters 133# Kernel Performance Events And Counters
132# 134#
135# CONFIG_PERF_EVENTS is not set
133# CONFIG_PERF_COUNTERS is not set 136# CONFIG_PERF_COUNTERS is not set
134CONFIG_VM_EVENT_COUNTERS=y 137CONFIG_VM_EVENT_COUNTERS=y
135CONFIG_PCI_QUIRKS=y 138CONFIG_PCI_QUIRKS=y
136CONFIG_SLUB_DEBUG=y 139CONFIG_SLUB_DEBUG=y
137# CONFIG_STRIP_ASM_SYMS is not set
138CONFIG_COMPAT_BRK=y 140CONFIG_COMPAT_BRK=y
139# CONFIG_SLAB is not set 141# CONFIG_SLAB is not set
140CONFIG_SLUB=y 142CONFIG_SLUB=y
141# CONFIG_SLOB is not set 143# CONFIG_SLOB is not set
142# CONFIG_PROFILING is not set 144# CONFIG_PROFILING is not set
143# CONFIG_MARKERS is not set
144CONFIG_HAVE_OPROFILE=y 145CONFIG_HAVE_OPROFILE=y
145CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS=y 146CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS=y
146CONFIG_HAVE_IOREMAP_PROT=y 147CONFIG_HAVE_IOREMAP_PROT=y
147CONFIG_HAVE_KPROBES=y 148CONFIG_HAVE_KPROBES=y
148CONFIG_HAVE_KRETPROBES=y 149CONFIG_HAVE_KRETPROBES=y
149CONFIG_HAVE_ARCH_TRACEHOOK=y 150CONFIG_HAVE_ARCH_TRACEHOOK=y
151CONFIG_HAVE_DMA_ATTRS=y
152CONFIG_HAVE_DMA_API_DEBUG=y
150 153
151# 154#
152# GCOV-based kernel profiling 155# GCOV-based kernel profiling
@@ -255,6 +258,7 @@ CONFIG_ARCH_HAS_WALK_MEMORY=y
255CONFIG_ARCH_ENABLE_MEMORY_HOTREMOVE=y 258CONFIG_ARCH_ENABLE_MEMORY_HOTREMOVE=y
256# CONFIG_KEXEC is not set 259# CONFIG_KEXEC is not set
257# CONFIG_CRASH_DUMP is not set 260# CONFIG_CRASH_DUMP is not set
261CONFIG_MAX_ACTIVE_REGIONS=32
258CONFIG_ARCH_FLATMEM_ENABLE=y 262CONFIG_ARCH_FLATMEM_ENABLE=y
259CONFIG_ARCH_POPULATES_NODE_MAP=y 263CONFIG_ARCH_POPULATES_NODE_MAP=y
260CONFIG_SELECT_MEMORY_MODEL=y 264CONFIG_SELECT_MEMORY_MODEL=y
@@ -272,6 +276,7 @@ CONFIG_BOUNCE=y
272CONFIG_VIRT_TO_BUS=y 276CONFIG_VIRT_TO_BUS=y
273CONFIG_HAVE_MLOCK=y 277CONFIG_HAVE_MLOCK=y
274CONFIG_HAVE_MLOCKED_PAGE_BIT=y 278CONFIG_HAVE_MLOCKED_PAGE_BIT=y
279# CONFIG_KSM is not set
275CONFIG_DEFAULT_MMAP_MIN_ADDR=4096 280CONFIG_DEFAULT_MMAP_MIN_ADDR=4096
276CONFIG_PPC_4K_PAGES=y 281CONFIG_PPC_4K_PAGES=y
277# CONFIG_PPC_16K_PAGES is not set 282# CONFIG_PPC_16K_PAGES is not set
@@ -369,6 +374,7 @@ CONFIG_DEFAULT_TCP_CONG="cubic"
369# CONFIG_NETFILTER is not set 374# CONFIG_NETFILTER is not set
370# CONFIG_IP_DCCP is not set 375# CONFIG_IP_DCCP is not set
371# CONFIG_IP_SCTP is not set 376# CONFIG_IP_SCTP is not set
377# CONFIG_RDS is not set
372# CONFIG_TIPC is not set 378# CONFIG_TIPC is not set
373# CONFIG_ATM is not set 379# CONFIG_ATM is not set
374# CONFIG_BRIDGE is not set 380# CONFIG_BRIDGE is not set
@@ -398,6 +404,7 @@ CONFIG_DEFAULT_TCP_CONG="cubic"
398# CONFIG_AF_RXRPC is not set 404# CONFIG_AF_RXRPC is not set
399CONFIG_WIRELESS=y 405CONFIG_WIRELESS=y
400# CONFIG_CFG80211 is not set 406# CONFIG_CFG80211 is not set
407CONFIG_CFG80211_DEFAULT_PS_VALUE=0
401CONFIG_WIRELESS_OLD_REGULATORY=y 408CONFIG_WIRELESS_OLD_REGULATORY=y
402# CONFIG_WIRELESS_EXT is not set 409# CONFIG_WIRELESS_EXT is not set
403# CONFIG_LIB80211 is not set 410# CONFIG_LIB80211 is not set
@@ -405,7 +412,6 @@ CONFIG_WIRELESS_OLD_REGULATORY=y
405# 412#
406# CFG80211 needs to be enabled for MAC80211 413# CFG80211 needs to be enabled for MAC80211
407# 414#
408CONFIG_MAC80211_DEFAULT_PS_VALUE=0
409# CONFIG_WIMAX is not set 415# CONFIG_WIMAX is not set
410# CONFIG_RFKILL is not set 416# CONFIG_RFKILL is not set
411# CONFIG_NET_9P is not set 417# CONFIG_NET_9P is not set
@@ -418,6 +424,7 @@ CONFIG_MAC80211_DEFAULT_PS_VALUE=0
418# Generic Driver Options 424# Generic Driver Options
419# 425#
420CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug" 426CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
427# CONFIG_DEVTMPFS is not set
421CONFIG_STANDALONE=y 428CONFIG_STANDALONE=y
422CONFIG_PREVENT_FIRMWARE_BUILD=y 429CONFIG_PREVENT_FIRMWARE_BUILD=y
423CONFIG_FW_LOADER=y 430CONFIG_FW_LOADER=y
@@ -427,9 +434,9 @@ CONFIG_EXTRA_FIRMWARE=""
427# CONFIG_CONNECTOR is not set 434# CONFIG_CONNECTOR is not set
428CONFIG_MTD=y 435CONFIG_MTD=y
429# CONFIG_MTD_DEBUG is not set 436# CONFIG_MTD_DEBUG is not set
437# CONFIG_MTD_TESTS is not set
430# CONFIG_MTD_CONCAT is not set 438# CONFIG_MTD_CONCAT is not set
431CONFIG_MTD_PARTITIONS=y 439CONFIG_MTD_PARTITIONS=y
432# CONFIG_MTD_TESTS is not set
433# CONFIG_MTD_REDBOOT_PARTS is not set 440# CONFIG_MTD_REDBOOT_PARTS is not set
434CONFIG_MTD_CMDLINE_PARTS=y 441CONFIG_MTD_CMDLINE_PARTS=y
435# CONFIG_MTD_OF_PARTS is not set 442# CONFIG_MTD_OF_PARTS is not set
@@ -493,6 +500,7 @@ CONFIG_MTD_PHYSMAP_OF=y
493# CONFIG_MTD_PMC551 is not set 500# CONFIG_MTD_PMC551 is not set
494# CONFIG_MTD_DATAFLASH is not set 501# CONFIG_MTD_DATAFLASH is not set
495# CONFIG_MTD_M25P80 is not set 502# CONFIG_MTD_M25P80 is not set
503# CONFIG_MTD_SST25L is not set
496# CONFIG_MTD_SLRAM is not set 504# CONFIG_MTD_SLRAM is not set
497# CONFIG_MTD_PHRAM is not set 505# CONFIG_MTD_PHRAM is not set
498# CONFIG_MTD_MTDRAM is not set 506# CONFIG_MTD_MTDRAM is not set
@@ -639,7 +647,6 @@ CONFIG_NETDEV_1000=y
639CONFIG_FSL_PQ_MDIO=y 647CONFIG_FSL_PQ_MDIO=y
640# CONFIG_GIANFAR is not set 648# CONFIG_GIANFAR is not set
641CONFIG_UCC_GETH=y 649CONFIG_UCC_GETH=y
642# CONFIG_UGETH_MAGIC_PACKET is not set
643# CONFIG_UGETH_TX_ON_DEMAND is not set 650# CONFIG_UGETH_TX_ON_DEMAND is not set
644# CONFIG_MV643XX_ETH is not set 651# CONFIG_MV643XX_ETH is not set
645# CONFIG_QLA3XXX is not set 652# CONFIG_QLA3XXX is not set
@@ -649,10 +656,7 @@ CONFIG_UCC_GETH=y
649# CONFIG_JME is not set 656# CONFIG_JME is not set
650# CONFIG_NETDEV_10000 is not set 657# CONFIG_NETDEV_10000 is not set
651# CONFIG_TR is not set 658# CONFIG_TR is not set
652 659CONFIG_WLAN=y
653#
654# Wireless LAN
655#
656# CONFIG_WLAN_PRE80211 is not set 660# CONFIG_WLAN_PRE80211 is not set
657# CONFIG_WLAN_80211 is not set 661# CONFIG_WLAN_80211 is not set
658 662
@@ -750,6 +754,7 @@ CONFIG_HW_RANDOM=y
750CONFIG_DEVPORT=y 754CONFIG_DEVPORT=y
751CONFIG_I2C=y 755CONFIG_I2C=y
752CONFIG_I2C_BOARDINFO=y 756CONFIG_I2C_BOARDINFO=y
757CONFIG_I2C_COMPAT=y
753CONFIG_I2C_CHARDEV=y 758CONFIG_I2C_CHARDEV=y
754CONFIG_I2C_HELPER_AUTO=y 759CONFIG_I2C_HELPER_AUTO=y
755 760
@@ -804,9 +809,6 @@ CONFIG_I2C_MPC=y
804# Miscellaneous I2C Chip support 809# Miscellaneous I2C Chip support
805# 810#
806# CONFIG_DS1682 is not set 811# CONFIG_DS1682 is not set
807# CONFIG_SENSORS_PCF8574 is not set
808# CONFIG_PCF8575 is not set
809# CONFIG_SENSORS_PCA9539 is not set
810# CONFIG_SENSORS_TSL2550 is not set 812# CONFIG_SENSORS_TSL2550 is not set
811# CONFIG_I2C_DEBUG_CORE is not set 813# CONFIG_I2C_DEBUG_CORE is not set
812# CONFIG_I2C_DEBUG_ALGO is not set 814# CONFIG_I2C_DEBUG_ALGO is not set
@@ -853,17 +855,22 @@ CONFIG_GPIOLIB=y
853# PCI GPIO expanders: 855# PCI GPIO expanders:
854# 856#
855# CONFIG_GPIO_BT8XX is not set 857# CONFIG_GPIO_BT8XX is not set
858# CONFIG_GPIO_LANGWELL is not set
856 859
857# 860#
858# SPI GPIO expanders: 861# SPI GPIO expanders:
859# 862#
860# CONFIG_GPIO_MAX7301 is not set 863# CONFIG_GPIO_MAX7301 is not set
861# CONFIG_GPIO_MCP23S08 is not set 864# CONFIG_GPIO_MCP23S08 is not set
865# CONFIG_GPIO_MC33880 is not set
866
867#
868# AC97 GPIO expanders:
869#
862# CONFIG_W1 is not set 870# CONFIG_W1 is not set
863# CONFIG_POWER_SUPPLY is not set 871# CONFIG_POWER_SUPPLY is not set
864# CONFIG_HWMON is not set 872# CONFIG_HWMON is not set
865# CONFIG_THERMAL is not set 873# CONFIG_THERMAL is not set
866# CONFIG_THERMAL_HWMON is not set
867CONFIG_WATCHDOG=y 874CONFIG_WATCHDOG=y
868# CONFIG_WATCHDOG_NOWAYOUT is not set 875# CONFIG_WATCHDOG_NOWAYOUT is not set
869 876
@@ -897,8 +904,10 @@ CONFIG_SSB_POSSIBLE=y
897# CONFIG_MFD_TMIO is not set 904# CONFIG_MFD_TMIO is not set
898# CONFIG_PMIC_DA903X is not set 905# CONFIG_PMIC_DA903X is not set
899# CONFIG_MFD_WM8400 is not set 906# CONFIG_MFD_WM8400 is not set
907# CONFIG_MFD_WM831X is not set
900# CONFIG_MFD_WM8350_I2C is not set 908# CONFIG_MFD_WM8350_I2C is not set
901# CONFIG_MFD_PCF50633 is not set 909# CONFIG_MFD_PCF50633 is not set
910# CONFIG_MFD_MC13783 is not set
902# CONFIG_AB3100_CORE is not set 911# CONFIG_AB3100_CORE is not set
903# CONFIG_EZX_PCAP is not set 912# CONFIG_EZX_PCAP is not set
904# CONFIG_REGULATOR is not set 913# CONFIG_REGULATOR is not set
@@ -908,6 +917,7 @@ CONFIG_SSB_POSSIBLE=y
908# Graphics support 917# Graphics support
909# 918#
910# CONFIG_AGP is not set 919# CONFIG_AGP is not set
920CONFIG_VGA_ARB=y
911# CONFIG_DRM is not set 921# CONFIG_DRM is not set
912# CONFIG_VGASTATE is not set 922# CONFIG_VGASTATE is not set
913# CONFIG_VIDEO_OUTPUT_CONTROL is not set 923# CONFIG_VIDEO_OUTPUT_CONTROL is not set
@@ -992,7 +1002,6 @@ CONFIG_LOGO_LINUX_CLUT224=y
992# CONFIG_SOUND is not set 1002# CONFIG_SOUND is not set
993CONFIG_HID_SUPPORT=y 1003CONFIG_HID_SUPPORT=y
994CONFIG_HID=y 1004CONFIG_HID=y
995# CONFIG_HID_DEBUG is not set
996# CONFIG_HIDRAW is not set 1005# CONFIG_HIDRAW is not set
997# CONFIG_HID_PID is not set 1006# CONFIG_HID_PID is not set
998 1007
@@ -1038,6 +1047,7 @@ CONFIG_FS_MBCACHE=y
1038# CONFIG_GFS2_FS is not set 1047# CONFIG_GFS2_FS is not set
1039# CONFIG_OCFS2_FS is not set 1048# CONFIG_OCFS2_FS is not set
1040# CONFIG_BTRFS_FS is not set 1049# CONFIG_BTRFS_FS is not set
1050# CONFIG_NILFS2_FS is not set
1041CONFIG_FILE_LOCKING=y 1051CONFIG_FILE_LOCKING=y
1042CONFIG_FSNOTIFY=y 1052CONFIG_FSNOTIFY=y
1043CONFIG_DNOTIFY=y 1053CONFIG_DNOTIFY=y
@@ -1107,7 +1117,6 @@ CONFIG_JFFS2_RTIME=y
1107# CONFIG_ROMFS_FS is not set 1117# CONFIG_ROMFS_FS is not set
1108# CONFIG_SYSV_FS is not set 1118# CONFIG_SYSV_FS is not set
1109# CONFIG_UFS_FS is not set 1119# CONFIG_UFS_FS is not set
1110# CONFIG_NILFS2_FS is not set
1111CONFIG_NETWORK_FILESYSTEMS=y 1120CONFIG_NETWORK_FILESYSTEMS=y
1112CONFIG_NFS_FS=y 1121CONFIG_NFS_FS=y
1113CONFIG_NFS_V3=y 1122CONFIG_NFS_V3=y
@@ -1183,6 +1192,7 @@ CONFIG_ENABLE_WARN_DEPRECATED=y
1183CONFIG_ENABLE_MUST_CHECK=y 1192CONFIG_ENABLE_MUST_CHECK=y
1184CONFIG_FRAME_WARN=1024 1193CONFIG_FRAME_WARN=1024
1185# CONFIG_MAGIC_SYSRQ is not set 1194# CONFIG_MAGIC_SYSRQ is not set
1195# CONFIG_STRIP_ASM_SYMS is not set
1186# CONFIG_UNUSED_SYMBOLS is not set 1196# CONFIG_UNUSED_SYMBOLS is not set
1187# CONFIG_DEBUG_FS is not set 1197# CONFIG_DEBUG_FS is not set
1188# CONFIG_HEADERS_CHECK is not set 1198# CONFIG_HEADERS_CHECK is not set
@@ -1200,6 +1210,7 @@ CONFIG_HAVE_DYNAMIC_FTRACE=y
1200CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y 1210CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y
1201CONFIG_TRACING_SUPPORT=y 1211CONFIG_TRACING_SUPPORT=y
1202# CONFIG_FTRACE is not set 1212# CONFIG_FTRACE is not set
1213# CONFIG_DMA_API_DEBUG is not set
1203# CONFIG_SAMPLES is not set 1214# CONFIG_SAMPLES is not set
1204CONFIG_HAVE_ARCH_KGDB=y 1215CONFIG_HAVE_ARCH_KGDB=y
1205# CONFIG_PPC_DISABLE_WERROR is not set 1216# CONFIG_PPC_DISABLE_WERROR is not set
@@ -1232,7 +1243,6 @@ CONFIG_CRYPTO=y
1232# 1243#
1233# Crypto core or helper 1244# Crypto core or helper
1234# 1245#
1235# CONFIG_CRYPTO_FIPS is not set
1236CONFIG_CRYPTO_ALGAPI=y 1246CONFIG_CRYPTO_ALGAPI=y
1237CONFIG_CRYPTO_ALGAPI2=y 1247CONFIG_CRYPTO_ALGAPI2=y
1238CONFIG_CRYPTO_AEAD2=y 1248CONFIG_CRYPTO_AEAD2=y
@@ -1274,11 +1284,13 @@ CONFIG_CRYPTO_CBC=y
1274# 1284#
1275# CONFIG_CRYPTO_HMAC is not set 1285# CONFIG_CRYPTO_HMAC is not set
1276# CONFIG_CRYPTO_XCBC is not set 1286# CONFIG_CRYPTO_XCBC is not set
1287# CONFIG_CRYPTO_VMAC is not set
1277 1288
1278# 1289#
1279# Digest 1290# Digest
1280# 1291#
1281# CONFIG_CRYPTO_CRC32C is not set 1292# CONFIG_CRYPTO_CRC32C is not set
1293# CONFIG_CRYPTO_GHASH is not set
1282# CONFIG_CRYPTO_MD4 is not set 1294# CONFIG_CRYPTO_MD4 is not set
1283CONFIG_CRYPTO_MD5=y 1295CONFIG_CRYPTO_MD5=y
1284# CONFIG_CRYPTO_MICHAEL_MIC is not set 1296# CONFIG_CRYPTO_MICHAEL_MIC is not set
diff --git a/arch/powerpc/configs/83xx/mpc837x_mds_defconfig b/arch/powerpc/configs/83xx/mpc837x_mds_defconfig
index e285ec0fe958..730061574f96 100644
--- a/arch/powerpc/configs/83xx/mpc837x_mds_defconfig
+++ b/arch/powerpc/configs/83xx/mpc837x_mds_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.31-rc4 3# Linux kernel version: 2.6.32-rc5
4# Wed Jul 29 23:32:11 2009 4# Thu Nov 5 08:20:29 2009
5# 5#
6# CONFIG_PPC64 is not set 6# CONFIG_PPC64 is not set
7 7
@@ -35,6 +35,7 @@ CONFIG_GENERIC_CLOCKEVENTS=y
35CONFIG_GENERIC_HARDIRQS=y 35CONFIG_GENERIC_HARDIRQS=y
36CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y 36CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y
37# CONFIG_HAVE_SETUP_PER_CPU_AREA is not set 37# CONFIG_HAVE_SETUP_PER_CPU_AREA is not set
38# CONFIG_NEED_PER_CPU_EMBED_FIRST_CHUNK 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
@@ -84,11 +85,12 @@ CONFIG_SYSVIPC_SYSCTL=y
84# 85#
85# RCU Subsystem 86# RCU Subsystem
86# 87#
87CONFIG_CLASSIC_RCU=y 88CONFIG_TREE_RCU=y
88# CONFIG_TREE_RCU is not set 89# CONFIG_TREE_PREEMPT_RCU is not set
89# CONFIG_PREEMPT_RCU is not set 90# CONFIG_RCU_TRACE is not set
91CONFIG_RCU_FANOUT=32
92# CONFIG_RCU_FANOUT_EXACT is not set
90# CONFIG_TREE_RCU_TRACE is not set 93# CONFIG_TREE_RCU_TRACE is not set
91# CONFIG_PREEMPT_RCU_TRACE is not set
92# CONFIG_IKCONFIG is not set 94# CONFIG_IKCONFIG is not set
93CONFIG_LOG_BUF_SHIFT=14 95CONFIG_LOG_BUF_SHIFT=14
94CONFIG_GROUP_SCHED=y 96CONFIG_GROUP_SCHED=y
@@ -125,21 +127,20 @@ CONFIG_TIMERFD=y
125CONFIG_EVENTFD=y 127CONFIG_EVENTFD=y
126CONFIG_SHMEM=y 128CONFIG_SHMEM=y
127CONFIG_AIO=y 129CONFIG_AIO=y
128CONFIG_HAVE_PERF_COUNTERS=y 130CONFIG_HAVE_PERF_EVENTS=y
129 131
130# 132#
131# Performance Counters 133# Kernel Performance Events And Counters
132# 134#
135# CONFIG_PERF_EVENTS is not set
133# CONFIG_PERF_COUNTERS is not set 136# CONFIG_PERF_COUNTERS is not set
134CONFIG_VM_EVENT_COUNTERS=y 137CONFIG_VM_EVENT_COUNTERS=y
135CONFIG_PCI_QUIRKS=y 138CONFIG_PCI_QUIRKS=y
136# CONFIG_STRIP_ASM_SYMS is not set
137CONFIG_COMPAT_BRK=y 139CONFIG_COMPAT_BRK=y
138CONFIG_SLAB=y 140CONFIG_SLAB=y
139# CONFIG_SLUB is not set 141# CONFIG_SLUB is not set
140# CONFIG_SLOB is not set 142# CONFIG_SLOB is not set
141# CONFIG_PROFILING is not set 143# CONFIG_PROFILING is not set
142# CONFIG_MARKERS is not set
143CONFIG_HAVE_OPROFILE=y 144CONFIG_HAVE_OPROFILE=y
144# CONFIG_KPROBES is not set 145# CONFIG_KPROBES is not set
145CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS=y 146CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS=y
@@ -147,6 +148,8 @@ CONFIG_HAVE_IOREMAP_PROT=y
147CONFIG_HAVE_KPROBES=y 148CONFIG_HAVE_KPROBES=y
148CONFIG_HAVE_KRETPROBES=y 149CONFIG_HAVE_KRETPROBES=y
149CONFIG_HAVE_ARCH_TRACEHOOK=y 150CONFIG_HAVE_ARCH_TRACEHOOK=y
151CONFIG_HAVE_DMA_ATTRS=y
152CONFIG_HAVE_DMA_API_DEBUG=y
150 153
151# 154#
152# GCOV-based kernel profiling 155# GCOV-based kernel profiling
@@ -256,6 +259,7 @@ CONFIG_ARCH_HAS_WALK_MEMORY=y
256CONFIG_ARCH_ENABLE_MEMORY_HOTREMOVE=y 259CONFIG_ARCH_ENABLE_MEMORY_HOTREMOVE=y
257# CONFIG_KEXEC is not set 260# CONFIG_KEXEC is not set
258# CONFIG_CRASH_DUMP is not set 261# CONFIG_CRASH_DUMP is not set
262CONFIG_MAX_ACTIVE_REGIONS=32
259CONFIG_ARCH_FLATMEM_ENABLE=y 263CONFIG_ARCH_FLATMEM_ENABLE=y
260CONFIG_ARCH_POPULATES_NODE_MAP=y 264CONFIG_ARCH_POPULATES_NODE_MAP=y
261CONFIG_SELECT_MEMORY_MODEL=y 265CONFIG_SELECT_MEMORY_MODEL=y
@@ -273,6 +277,7 @@ CONFIG_BOUNCE=y
273CONFIG_VIRT_TO_BUS=y 277CONFIG_VIRT_TO_BUS=y
274CONFIG_HAVE_MLOCK=y 278CONFIG_HAVE_MLOCK=y
275CONFIG_HAVE_MLOCKED_PAGE_BIT=y 279CONFIG_HAVE_MLOCKED_PAGE_BIT=y
280# CONFIG_KSM is not set
276CONFIG_DEFAULT_MMAP_MIN_ADDR=4096 281CONFIG_DEFAULT_MMAP_MIN_ADDR=4096
277CONFIG_PPC_4K_PAGES=y 282CONFIG_PPC_4K_PAGES=y
278# CONFIG_PPC_16K_PAGES is not set 283# CONFIG_PPC_16K_PAGES is not set
@@ -368,6 +373,7 @@ CONFIG_DEFAULT_TCP_CONG="cubic"
368# CONFIG_NETFILTER is not set 373# CONFIG_NETFILTER is not set
369# CONFIG_IP_DCCP is not set 374# CONFIG_IP_DCCP is not set
370# CONFIG_IP_SCTP is not set 375# CONFIG_IP_SCTP is not set
376# CONFIG_RDS is not set
371# CONFIG_TIPC is not set 377# CONFIG_TIPC is not set
372# CONFIG_ATM is not set 378# CONFIG_ATM is not set
373# CONFIG_BRIDGE is not set 379# CONFIG_BRIDGE is not set
@@ -397,6 +403,7 @@ CONFIG_DEFAULT_TCP_CONG="cubic"
397# CONFIG_AF_RXRPC is not set 403# CONFIG_AF_RXRPC is not set
398CONFIG_WIRELESS=y 404CONFIG_WIRELESS=y
399# CONFIG_CFG80211 is not set 405# CONFIG_CFG80211 is not set
406CONFIG_CFG80211_DEFAULT_PS_VALUE=0
400CONFIG_WIRELESS_OLD_REGULATORY=y 407CONFIG_WIRELESS_OLD_REGULATORY=y
401# CONFIG_WIRELESS_EXT is not set 408# CONFIG_WIRELESS_EXT is not set
402# CONFIG_LIB80211 is not set 409# CONFIG_LIB80211 is not set
@@ -404,7 +411,6 @@ CONFIG_WIRELESS_OLD_REGULATORY=y
404# 411#
405# CFG80211 needs to be enabled for MAC80211 412# CFG80211 needs to be enabled for MAC80211
406# 413#
407CONFIG_MAC80211_DEFAULT_PS_VALUE=0
408# CONFIG_WIMAX is not set 414# CONFIG_WIMAX is not set
409# CONFIG_RFKILL is not set 415# CONFIG_RFKILL is not set
410# CONFIG_NET_9P is not set 416# CONFIG_NET_9P is not set
@@ -417,6 +423,7 @@ CONFIG_MAC80211_DEFAULT_PS_VALUE=0
417# Generic Driver Options 423# Generic Driver Options
418# 424#
419CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug" 425CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
426# CONFIG_DEVTMPFS is not set
420CONFIG_STANDALONE=y 427CONFIG_STANDALONE=y
421CONFIG_PREVENT_FIRMWARE_BUILD=y 428CONFIG_PREVENT_FIRMWARE_BUILD=y
422# CONFIG_FW_LOADER is not set 429# CONFIG_FW_LOADER is not set
@@ -503,6 +510,7 @@ CONFIG_SCSI_LOWLEVEL=y
503# CONFIG_ISCSI_TCP is not set 510# CONFIG_ISCSI_TCP is not set
504# CONFIG_SCSI_CXGB3_ISCSI is not set 511# CONFIG_SCSI_CXGB3_ISCSI is not set
505# CONFIG_SCSI_BNX2_ISCSI is not set 512# CONFIG_SCSI_BNX2_ISCSI is not set
513# CONFIG_BE2ISCSI is not set
506# CONFIG_BLK_DEV_3W_XXXX_RAID is not set 514# CONFIG_BLK_DEV_3W_XXXX_RAID is not set
507# CONFIG_SCSI_3W_9XXX is not set 515# CONFIG_SCSI_3W_9XXX is not set
508# CONFIG_SCSI_ACARD is not set 516# CONFIG_SCSI_ACARD is not set
@@ -542,11 +550,14 @@ CONFIG_SCSI_LOWLEVEL=y
542# CONFIG_SCSI_DC390T is not set 550# CONFIG_SCSI_DC390T is not set
543# CONFIG_SCSI_NSP32 is not set 551# CONFIG_SCSI_NSP32 is not set
544# CONFIG_SCSI_DEBUG is not set 552# CONFIG_SCSI_DEBUG is not set
553# CONFIG_SCSI_PMCRAID is not set
545# CONFIG_SCSI_SRP is not set 554# CONFIG_SCSI_SRP is not set
555# CONFIG_SCSI_BFA_FC is not set
546# CONFIG_SCSI_DH is not set 556# CONFIG_SCSI_DH is not set
547# CONFIG_SCSI_OSD_INITIATOR is not set 557# CONFIG_SCSI_OSD_INITIATOR is not set
548CONFIG_ATA=y 558CONFIG_ATA=y
549# CONFIG_ATA_NONSTANDARD is not set 559# CONFIG_ATA_NONSTANDARD is not set
560CONFIG_ATA_VERBOSE_ERROR=y
550CONFIG_SATA_PMP=y 561CONFIG_SATA_PMP=y
551# CONFIG_SATA_AHCI is not set 562# CONFIG_SATA_AHCI is not set
552# CONFIG_SATA_SIL24 is not set 563# CONFIG_SATA_SIL24 is not set
@@ -569,6 +580,7 @@ CONFIG_ATA_SFF=y
569# CONFIG_PATA_ALI is not set 580# CONFIG_PATA_ALI is not set
570# CONFIG_PATA_AMD is not set 581# CONFIG_PATA_AMD is not set
571# CONFIG_PATA_ARTOP is not set 582# CONFIG_PATA_ARTOP is not set
583# CONFIG_PATA_ATP867X is not set
572# CONFIG_PATA_ATIIXP is not set 584# CONFIG_PATA_ATIIXP is not set
573# CONFIG_PATA_CMD640_PCI is not set 585# CONFIG_PATA_CMD640_PCI is not set
574# CONFIG_PATA_CMD64X is not set 586# CONFIG_PATA_CMD64X is not set
@@ -596,6 +608,7 @@ CONFIG_ATA_SFF=y
596# CONFIG_PATA_OPTIDMA is not set 608# CONFIG_PATA_OPTIDMA is not set
597# CONFIG_PATA_PDC_OLD is not set 609# CONFIG_PATA_PDC_OLD is not set
598# CONFIG_PATA_RADISYS is not set 610# CONFIG_PATA_RADISYS is not set
611# CONFIG_PATA_RDC is not set
599# CONFIG_PATA_RZ1000 is not set 612# CONFIG_PATA_RZ1000 is not set
600# CONFIG_PATA_SC1200 is not set 613# CONFIG_PATA_SC1200 is not set
601# CONFIG_PATA_SERVERWORKS is not set 614# CONFIG_PATA_SERVERWORKS is not set
@@ -672,7 +685,9 @@ CONFIG_MII=y
672# CONFIG_NET_PCI is not set 685# CONFIG_NET_PCI is not set
673# CONFIG_B44 is not set 686# CONFIG_B44 is not set
674# CONFIG_KS8842 is not set 687# CONFIG_KS8842 is not set
688# CONFIG_KS8851_MLL is not set
675# CONFIG_ATL2 is not set 689# CONFIG_ATL2 is not set
690# CONFIG_XILINX_EMACLITE is not set
676CONFIG_NETDEV_1000=y 691CONFIG_NETDEV_1000=y
677# CONFIG_ACENIC is not set 692# CONFIG_ACENIC is not set
678# CONFIG_DL2K is not set 693# CONFIG_DL2K is not set
@@ -720,10 +735,7 @@ CONFIG_CHELSIO_T3_DEPENDS=y
720# CONFIG_SFC is not set 735# CONFIG_SFC is not set
721# CONFIG_BE2NET is not set 736# CONFIG_BE2NET is not set
722# CONFIG_TR is not set 737# CONFIG_TR is not set
723 738CONFIG_WLAN=y
724#
725# Wireless LAN
726#
727# CONFIG_WLAN_PRE80211 is not set 739# CONFIG_WLAN_PRE80211 is not set
728# CONFIG_WLAN_80211 is not set 740# CONFIG_WLAN_80211 is not set
729 741
@@ -816,6 +828,7 @@ CONFIG_GEN_RTC=y
816CONFIG_DEVPORT=y 828CONFIG_DEVPORT=y
817CONFIG_I2C=y 829CONFIG_I2C=y
818CONFIG_I2C_BOARDINFO=y 830CONFIG_I2C_BOARDINFO=y
831CONFIG_I2C_COMPAT=y
819CONFIG_I2C_CHARDEV=y 832CONFIG_I2C_CHARDEV=y
820CONFIG_I2C_HELPER_AUTO=y 833CONFIG_I2C_HELPER_AUTO=y
821 834
@@ -869,9 +882,6 @@ CONFIG_I2C_MPC=y
869# Miscellaneous I2C Chip support 882# Miscellaneous I2C Chip support
870# 883#
871# CONFIG_DS1682 is not set 884# CONFIG_DS1682 is not set
872# CONFIG_SENSORS_PCF8574 is not set
873# CONFIG_PCF8575 is not set
874# CONFIG_SENSORS_PCA9539 is not set
875# CONFIG_SENSORS_TSL2550 is not set 885# CONFIG_SENSORS_TSL2550 is not set
876# CONFIG_I2C_DEBUG_CORE is not set 886# CONFIG_I2C_DEBUG_CORE is not set
877# CONFIG_I2C_DEBUG_ALGO is not set 887# CONFIG_I2C_DEBUG_ALGO is not set
@@ -889,6 +899,11 @@ CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y
889# CONFIG_POWER_SUPPLY is not set 899# CONFIG_POWER_SUPPLY is not set
890CONFIG_HWMON=y 900CONFIG_HWMON=y
891# CONFIG_HWMON_VID is not set 901# CONFIG_HWMON_VID is not set
902# CONFIG_HWMON_DEBUG_CHIP is not set
903
904#
905# Native drivers
906#
892# CONFIG_SENSORS_AD7414 is not set 907# CONFIG_SENSORS_AD7414 is not set
893# CONFIG_SENSORS_AD7418 is not set 908# CONFIG_SENSORS_AD7418 is not set
894# CONFIG_SENSORS_ADM1021 is not set 909# CONFIG_SENSORS_ADM1021 is not set
@@ -938,6 +953,7 @@ CONFIG_HWMON=y
938# CONFIG_SENSORS_ADS7828 is not set 953# CONFIG_SENSORS_ADS7828 is not set
939# CONFIG_SENSORS_THMC50 is not set 954# CONFIG_SENSORS_THMC50 is not set
940# CONFIG_SENSORS_TMP401 is not set 955# CONFIG_SENSORS_TMP401 is not set
956# CONFIG_SENSORS_TMP421 is not set
941# CONFIG_SENSORS_VIA686A is not set 957# CONFIG_SENSORS_VIA686A is not set
942# CONFIG_SENSORS_VT1211 is not set 958# CONFIG_SENSORS_VT1211 is not set
943# CONFIG_SENSORS_VT8231 is not set 959# CONFIG_SENSORS_VT8231 is not set
@@ -949,9 +965,7 @@ CONFIG_HWMON=y
949# CONFIG_SENSORS_W83L786NG is not set 965# CONFIG_SENSORS_W83L786NG is not set
950# CONFIG_SENSORS_W83627HF is not set 966# CONFIG_SENSORS_W83627HF is not set
951# CONFIG_SENSORS_W83627EHF is not set 967# CONFIG_SENSORS_W83627EHF is not set
952# CONFIG_HWMON_DEBUG_CHIP is not set
953# CONFIG_THERMAL is not set 968# CONFIG_THERMAL is not set
954# CONFIG_THERMAL_HWMON is not set
955CONFIG_WATCHDOG=y 969CONFIG_WATCHDOG=y
956# CONFIG_WATCHDOG_NOWAYOUT is not set 970# CONFIG_WATCHDOG_NOWAYOUT is not set
957 971
@@ -984,6 +998,7 @@ CONFIG_SSB_POSSIBLE=y
984# CONFIG_MFD_TMIO is not set 998# CONFIG_MFD_TMIO is not set
985# CONFIG_PMIC_DA903X is not set 999# CONFIG_PMIC_DA903X is not set
986# CONFIG_MFD_WM8400 is not set 1000# CONFIG_MFD_WM8400 is not set
1001# CONFIG_MFD_WM831X is not set
987# CONFIG_MFD_WM8350_I2C is not set 1002# CONFIG_MFD_WM8350_I2C is not set
988# CONFIG_MFD_PCF50633 is not set 1003# CONFIG_MFD_PCF50633 is not set
989# CONFIG_AB3100_CORE is not set 1004# CONFIG_AB3100_CORE is not set
@@ -994,6 +1009,7 @@ CONFIG_SSB_POSSIBLE=y
994# Graphics support 1009# Graphics support
995# 1010#
996# CONFIG_AGP is not set 1011# CONFIG_AGP is not set
1012CONFIG_VGA_ARB=y
997# CONFIG_DRM is not set 1013# CONFIG_DRM is not set
998# CONFIG_VGASTATE is not set 1014# CONFIG_VGASTATE is not set
999CONFIG_VIDEO_OUTPUT_CONTROL=m 1015CONFIG_VIDEO_OUTPUT_CONTROL=m
@@ -1007,7 +1023,6 @@ CONFIG_VIDEO_OUTPUT_CONTROL=m
1007# CONFIG_SOUND is not set 1023# CONFIG_SOUND is not set
1008CONFIG_HID_SUPPORT=y 1024CONFIG_HID_SUPPORT=y
1009CONFIG_HID=y 1025CONFIG_HID=y
1010# CONFIG_HID_DEBUG is not set
1011# CONFIG_HIDRAW is not set 1026# CONFIG_HIDRAW is not set
1012# CONFIG_HID_PID is not set 1027# CONFIG_HID_PID is not set
1013 1028
@@ -1072,6 +1087,7 @@ CONFIG_FS_MBCACHE=y
1072# CONFIG_GFS2_FS is not set 1087# CONFIG_GFS2_FS is not set
1073# CONFIG_OCFS2_FS is not set 1088# CONFIG_OCFS2_FS is not set
1074# CONFIG_BTRFS_FS is not set 1089# CONFIG_BTRFS_FS is not set
1090# CONFIG_NILFS2_FS is not set
1075CONFIG_FILE_LOCKING=y 1091CONFIG_FILE_LOCKING=y
1076CONFIG_FSNOTIFY=y 1092CONFIG_FSNOTIFY=y
1077CONFIG_DNOTIFY=y 1093CONFIG_DNOTIFY=y
@@ -1130,7 +1146,6 @@ CONFIG_MISC_FILESYSTEMS=y
1130# CONFIG_ROMFS_FS is not set 1146# CONFIG_ROMFS_FS is not set
1131# CONFIG_SYSV_FS is not set 1147# CONFIG_SYSV_FS is not set
1132# CONFIG_UFS_FS is not set 1148# CONFIG_UFS_FS is not set
1133# CONFIG_NILFS2_FS is not set
1134CONFIG_NETWORK_FILESYSTEMS=y 1149CONFIG_NETWORK_FILESYSTEMS=y
1135CONFIG_NFS_FS=y 1150CONFIG_NFS_FS=y
1136CONFIG_NFS_V3=y 1151CONFIG_NFS_V3=y
@@ -1206,6 +1221,7 @@ CONFIG_ENABLE_WARN_DEPRECATED=y
1206CONFIG_ENABLE_MUST_CHECK=y 1221CONFIG_ENABLE_MUST_CHECK=y
1207CONFIG_FRAME_WARN=1024 1222CONFIG_FRAME_WARN=1024
1208# CONFIG_MAGIC_SYSRQ is not set 1223# CONFIG_MAGIC_SYSRQ is not set
1224# CONFIG_STRIP_ASM_SYMS is not set
1209# CONFIG_UNUSED_SYMBOLS is not set 1225# CONFIG_UNUSED_SYMBOLS is not set
1210# CONFIG_DEBUG_FS is not set 1226# CONFIG_DEBUG_FS is not set
1211# CONFIG_HEADERS_CHECK is not set 1227# CONFIG_HEADERS_CHECK is not set
@@ -1221,6 +1237,7 @@ CONFIG_HAVE_DYNAMIC_FTRACE=y
1221CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y 1237CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y
1222CONFIG_TRACING_SUPPORT=y 1238CONFIG_TRACING_SUPPORT=y
1223# CONFIG_FTRACE is not set 1239# CONFIG_FTRACE is not set
1240# CONFIG_DMA_API_DEBUG is not set
1224# CONFIG_SAMPLES is not set 1241# CONFIG_SAMPLES is not set
1225CONFIG_HAVE_ARCH_KGDB=y 1242CONFIG_HAVE_ARCH_KGDB=y
1226# CONFIG_PPC_DISABLE_WERROR is not set 1243# CONFIG_PPC_DISABLE_WERROR is not set
@@ -1242,7 +1259,6 @@ CONFIG_CRYPTO=y
1242# 1259#
1243# Crypto core or helper 1260# Crypto core or helper
1244# 1261#
1245# CONFIG_CRYPTO_FIPS is not set
1246CONFIG_CRYPTO_ALGAPI=y 1262CONFIG_CRYPTO_ALGAPI=y
1247CONFIG_CRYPTO_ALGAPI2=y 1263CONFIG_CRYPTO_ALGAPI2=y
1248CONFIG_CRYPTO_AEAD2=y 1264CONFIG_CRYPTO_AEAD2=y
@@ -1284,11 +1300,13 @@ CONFIG_CRYPTO_PCBC=m
1284# 1300#
1285# CONFIG_CRYPTO_HMAC is not set 1301# CONFIG_CRYPTO_HMAC is not set
1286# CONFIG_CRYPTO_XCBC is not set 1302# CONFIG_CRYPTO_XCBC is not set
1303# CONFIG_CRYPTO_VMAC is not set
1287 1304
1288# 1305#
1289# Digest 1306# Digest
1290# 1307#
1291# CONFIG_CRYPTO_CRC32C is not set 1308# CONFIG_CRYPTO_CRC32C is not set
1309# CONFIG_CRYPTO_GHASH is not set
1292# CONFIG_CRYPTO_MD4 is not set 1310# CONFIG_CRYPTO_MD4 is not set
1293CONFIG_CRYPTO_MD5=y 1311CONFIG_CRYPTO_MD5=y
1294# CONFIG_CRYPTO_MICHAEL_MIC is not set 1312# CONFIG_CRYPTO_MICHAEL_MIC is not set
diff --git a/arch/powerpc/configs/83xx/mpc837x_rdb_defconfig b/arch/powerpc/configs/83xx/mpc837x_rdb_defconfig
index 1ab3e4cd3018..9e9158a5b190 100644
--- a/arch/powerpc/configs/83xx/mpc837x_rdb_defconfig
+++ b/arch/powerpc/configs/83xx/mpc837x_rdb_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.31-rc4 3# Linux kernel version: 2.6.32-rc5
4# Wed Jul 29 23:32:13 2009 4# Thu Nov 5 08:20:30 2009
5# 5#
6# CONFIG_PPC64 is not set 6# CONFIG_PPC64 is not set
7 7
@@ -35,6 +35,7 @@ CONFIG_GENERIC_CLOCKEVENTS=y
35CONFIG_GENERIC_HARDIRQS=y 35CONFIG_GENERIC_HARDIRQS=y
36CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y 36CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y
37# CONFIG_HAVE_SETUP_PER_CPU_AREA is not set 37# CONFIG_HAVE_SETUP_PER_CPU_AREA is not set
38# CONFIG_NEED_PER_CPU_EMBED_FIRST_CHUNK 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
@@ -84,11 +85,12 @@ CONFIG_SYSVIPC_SYSCTL=y
84# 85#
85# RCU Subsystem 86# RCU Subsystem
86# 87#
87CONFIG_CLASSIC_RCU=y 88CONFIG_TREE_RCU=y
88# CONFIG_TREE_RCU is not set 89# CONFIG_TREE_PREEMPT_RCU is not set
89# CONFIG_PREEMPT_RCU is not set 90# CONFIG_RCU_TRACE is not set
91CONFIG_RCU_FANOUT=32
92# CONFIG_RCU_FANOUT_EXACT is not set
90# CONFIG_TREE_RCU_TRACE is not set 93# CONFIG_TREE_RCU_TRACE is not set
91# CONFIG_PREEMPT_RCU_TRACE is not set
92# CONFIG_IKCONFIG is not set 94# CONFIG_IKCONFIG is not set
93CONFIG_LOG_BUF_SHIFT=14 95CONFIG_LOG_BUF_SHIFT=14
94CONFIG_GROUP_SCHED=y 96CONFIG_GROUP_SCHED=y
@@ -125,21 +127,20 @@ CONFIG_TIMERFD=y
125CONFIG_EVENTFD=y 127CONFIG_EVENTFD=y
126CONFIG_SHMEM=y 128CONFIG_SHMEM=y
127CONFIG_AIO=y 129CONFIG_AIO=y
128CONFIG_HAVE_PERF_COUNTERS=y 130CONFIG_HAVE_PERF_EVENTS=y
129 131
130# 132#
131# Performance Counters 133# Kernel Performance Events And Counters
132# 134#
135# CONFIG_PERF_EVENTS is not set
133# CONFIG_PERF_COUNTERS is not set 136# CONFIG_PERF_COUNTERS is not set
134CONFIG_VM_EVENT_COUNTERS=y 137CONFIG_VM_EVENT_COUNTERS=y
135CONFIG_PCI_QUIRKS=y 138CONFIG_PCI_QUIRKS=y
136# CONFIG_STRIP_ASM_SYMS is not set
137CONFIG_COMPAT_BRK=y 139CONFIG_COMPAT_BRK=y
138CONFIG_SLAB=y 140CONFIG_SLAB=y
139# CONFIG_SLUB is not set 141# CONFIG_SLUB is not set
140# CONFIG_SLOB is not set 142# CONFIG_SLOB is not set
141# CONFIG_PROFILING is not set 143# CONFIG_PROFILING is not set
142# CONFIG_MARKERS is not set
143CONFIG_HAVE_OPROFILE=y 144CONFIG_HAVE_OPROFILE=y
144# CONFIG_KPROBES is not set 145# CONFIG_KPROBES is not set
145CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS=y 146CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS=y
@@ -147,6 +148,8 @@ CONFIG_HAVE_IOREMAP_PROT=y
147CONFIG_HAVE_KPROBES=y 148CONFIG_HAVE_KPROBES=y
148CONFIG_HAVE_KRETPROBES=y 149CONFIG_HAVE_KRETPROBES=y
149CONFIG_HAVE_ARCH_TRACEHOOK=y 150CONFIG_HAVE_ARCH_TRACEHOOK=y
151CONFIG_HAVE_DMA_ATTRS=y
152CONFIG_HAVE_DMA_API_DEBUG=y
150 153
151# 154#
152# GCOV-based kernel profiling 155# GCOV-based kernel profiling
@@ -256,6 +259,7 @@ CONFIG_ARCH_HAS_WALK_MEMORY=y
256CONFIG_ARCH_ENABLE_MEMORY_HOTREMOVE=y 259CONFIG_ARCH_ENABLE_MEMORY_HOTREMOVE=y
257# CONFIG_KEXEC is not set 260# CONFIG_KEXEC is not set
258# CONFIG_CRASH_DUMP is not set 261# CONFIG_CRASH_DUMP is not set
262CONFIG_MAX_ACTIVE_REGIONS=32
259CONFIG_ARCH_FLATMEM_ENABLE=y 263CONFIG_ARCH_FLATMEM_ENABLE=y
260CONFIG_ARCH_POPULATES_NODE_MAP=y 264CONFIG_ARCH_POPULATES_NODE_MAP=y
261CONFIG_SELECT_MEMORY_MODEL=y 265CONFIG_SELECT_MEMORY_MODEL=y
@@ -273,6 +277,7 @@ CONFIG_BOUNCE=y
273CONFIG_VIRT_TO_BUS=y 277CONFIG_VIRT_TO_BUS=y
274CONFIG_HAVE_MLOCK=y 278CONFIG_HAVE_MLOCK=y
275CONFIG_HAVE_MLOCKED_PAGE_BIT=y 279CONFIG_HAVE_MLOCKED_PAGE_BIT=y
280# CONFIG_KSM is not set
276CONFIG_DEFAULT_MMAP_MIN_ADDR=4096 281CONFIG_DEFAULT_MMAP_MIN_ADDR=4096
277CONFIG_PPC_4K_PAGES=y 282CONFIG_PPC_4K_PAGES=y
278# CONFIG_PPC_16K_PAGES is not set 283# CONFIG_PPC_16K_PAGES is not set
@@ -363,6 +368,7 @@ CONFIG_DEFAULT_TCP_CONG="cubic"
363# CONFIG_NETFILTER is not set 368# CONFIG_NETFILTER is not set
364# CONFIG_IP_DCCP is not set 369# CONFIG_IP_DCCP is not set
365# CONFIG_IP_SCTP is not set 370# CONFIG_IP_SCTP is not set
371# CONFIG_RDS is not set
366# CONFIG_TIPC is not set 372# CONFIG_TIPC is not set
367# CONFIG_ATM is not set 373# CONFIG_ATM is not set
368# CONFIG_BRIDGE is not set 374# CONFIG_BRIDGE is not set
@@ -392,6 +398,7 @@ CONFIG_DEFAULT_TCP_CONG="cubic"
392# CONFIG_AF_RXRPC is not set 398# CONFIG_AF_RXRPC is not set
393CONFIG_WIRELESS=y 399CONFIG_WIRELESS=y
394# CONFIG_CFG80211 is not set 400# CONFIG_CFG80211 is not set
401CONFIG_CFG80211_DEFAULT_PS_VALUE=0
395CONFIG_WIRELESS_OLD_REGULATORY=y 402CONFIG_WIRELESS_OLD_REGULATORY=y
396# CONFIG_WIRELESS_EXT is not set 403# CONFIG_WIRELESS_EXT is not set
397# CONFIG_LIB80211 is not set 404# CONFIG_LIB80211 is not set
@@ -399,7 +406,6 @@ CONFIG_WIRELESS_OLD_REGULATORY=y
399# 406#
400# CFG80211 needs to be enabled for MAC80211 407# CFG80211 needs to be enabled for MAC80211
401# 408#
402CONFIG_MAC80211_DEFAULT_PS_VALUE=0
403# CONFIG_WIMAX is not set 409# CONFIG_WIMAX is not set
404# CONFIG_RFKILL is not set 410# CONFIG_RFKILL is not set
405# CONFIG_NET_9P is not set 411# CONFIG_NET_9P is not set
@@ -412,6 +418,7 @@ CONFIG_MAC80211_DEFAULT_PS_VALUE=0
412# Generic Driver Options 418# Generic Driver Options
413# 419#
414CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug" 420CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
421# CONFIG_DEVTMPFS is not set
415CONFIG_STANDALONE=y 422CONFIG_STANDALONE=y
416CONFIG_PREVENT_FIRMWARE_BUILD=y 423CONFIG_PREVENT_FIRMWARE_BUILD=y
417# CONFIG_FW_LOADER is not set 424# CONFIG_FW_LOADER is not set
@@ -498,6 +505,7 @@ CONFIG_SCSI_WAIT_SCAN=m
498CONFIG_SCSI_LOWLEVEL=y 505CONFIG_SCSI_LOWLEVEL=y
499# CONFIG_ISCSI_TCP is not set 506# CONFIG_ISCSI_TCP is not set
500# CONFIG_SCSI_BNX2_ISCSI is not set 507# CONFIG_SCSI_BNX2_ISCSI is not set
508# CONFIG_BE2ISCSI is not set
501# CONFIG_BLK_DEV_3W_XXXX_RAID is not set 509# CONFIG_BLK_DEV_3W_XXXX_RAID is not set
502# CONFIG_SCSI_3W_9XXX is not set 510# CONFIG_SCSI_3W_9XXX is not set
503# CONFIG_SCSI_ACARD is not set 511# CONFIG_SCSI_ACARD is not set
@@ -537,11 +545,14 @@ CONFIG_SCSI_LOWLEVEL=y
537# CONFIG_SCSI_DC390T is not set 545# CONFIG_SCSI_DC390T is not set
538# CONFIG_SCSI_NSP32 is not set 546# CONFIG_SCSI_NSP32 is not set
539# CONFIG_SCSI_DEBUG is not set 547# CONFIG_SCSI_DEBUG is not set
548# CONFIG_SCSI_PMCRAID is not set
540# CONFIG_SCSI_SRP is not set 549# CONFIG_SCSI_SRP is not set
550# CONFIG_SCSI_BFA_FC is not set
541# CONFIG_SCSI_DH is not set 551# CONFIG_SCSI_DH is not set
542# CONFIG_SCSI_OSD_INITIATOR is not set 552# CONFIG_SCSI_OSD_INITIATOR is not set
543CONFIG_ATA=y 553CONFIG_ATA=y
544# CONFIG_ATA_NONSTANDARD is not set 554# CONFIG_ATA_NONSTANDARD is not set
555CONFIG_ATA_VERBOSE_ERROR=y
545CONFIG_SATA_PMP=y 556CONFIG_SATA_PMP=y
546# CONFIG_SATA_AHCI is not set 557# CONFIG_SATA_AHCI is not set
547# CONFIG_SATA_SIL24 is not set 558# CONFIG_SATA_SIL24 is not set
@@ -564,6 +575,7 @@ CONFIG_ATA_SFF=y
564# CONFIG_PATA_ALI is not set 575# CONFIG_PATA_ALI is not set
565# CONFIG_PATA_AMD is not set 576# CONFIG_PATA_AMD is not set
566# CONFIG_PATA_ARTOP is not set 577# CONFIG_PATA_ARTOP is not set
578# CONFIG_PATA_ATP867X is not set
567# CONFIG_PATA_ATIIXP is not set 579# CONFIG_PATA_ATIIXP is not set
568# CONFIG_PATA_CMD640_PCI is not set 580# CONFIG_PATA_CMD640_PCI is not set
569# CONFIG_PATA_CMD64X is not set 581# CONFIG_PATA_CMD64X is not set
@@ -591,6 +603,7 @@ CONFIG_ATA_SFF=y
591# CONFIG_PATA_OPTIDMA is not set 603# CONFIG_PATA_OPTIDMA is not set
592# CONFIG_PATA_PDC_OLD is not set 604# CONFIG_PATA_PDC_OLD is not set
593# CONFIG_PATA_RADISYS is not set 605# CONFIG_PATA_RADISYS is not set
606# CONFIG_PATA_RDC is not set
594# CONFIG_PATA_RZ1000 is not set 607# CONFIG_PATA_RZ1000 is not set
595# CONFIG_PATA_SC1200 is not set 608# CONFIG_PATA_SC1200 is not set
596# CONFIG_PATA_SERVERWORKS is not set 609# CONFIG_PATA_SERVERWORKS is not set
@@ -610,6 +623,7 @@ CONFIG_MD_RAID1=y
610# CONFIG_MD_RAID10 is not set 623# CONFIG_MD_RAID10 is not set
611CONFIG_MD_RAID456=y 624CONFIG_MD_RAID456=y
612CONFIG_MD_RAID6_PQ=y 625CONFIG_MD_RAID6_PQ=y
626# CONFIG_ASYNC_RAID6_TEST is not set
613# CONFIG_MD_MULTIPATH is not set 627# CONFIG_MD_MULTIPATH is not set
614# CONFIG_MD_FAULTY is not set 628# CONFIG_MD_FAULTY is not set
615# CONFIG_BLK_DEV_DM is not set 629# CONFIG_BLK_DEV_DM is not set
@@ -678,7 +692,9 @@ CONFIG_MII=y
678# CONFIG_NET_PCI is not set 692# CONFIG_NET_PCI is not set
679# CONFIG_B44 is not set 693# CONFIG_B44 is not set
680# CONFIG_KS8842 is not set 694# CONFIG_KS8842 is not set
695# CONFIG_KS8851_MLL is not set
681# CONFIG_ATL2 is not set 696# CONFIG_ATL2 is not set
697# CONFIG_XILINX_EMACLITE is not set
682CONFIG_NETDEV_1000=y 698CONFIG_NETDEV_1000=y
683# CONFIG_ACENIC is not set 699# CONFIG_ACENIC is not set
684# CONFIG_DL2K is not set 700# CONFIG_DL2K is not set
@@ -708,10 +724,7 @@ CONFIG_GIANFAR=y
708# CONFIG_JME is not set 724# CONFIG_JME is not set
709# CONFIG_NETDEV_10000 is not set 725# CONFIG_NETDEV_10000 is not set
710# CONFIG_TR is not set 726# CONFIG_TR is not set
711 727CONFIG_WLAN=y
712#
713# Wireless LAN
714#
715# CONFIG_WLAN_PRE80211 is not set 728# CONFIG_WLAN_PRE80211 is not set
716# CONFIG_WLAN_80211 is not set 729# CONFIG_WLAN_80211 is not set
717 730
@@ -813,6 +826,7 @@ CONFIG_GEN_RTC=y
813CONFIG_DEVPORT=y 826CONFIG_DEVPORT=y
814CONFIG_I2C=y 827CONFIG_I2C=y
815CONFIG_I2C_BOARDINFO=y 828CONFIG_I2C_BOARDINFO=y
829CONFIG_I2C_COMPAT=y
816CONFIG_I2C_CHARDEV=y 830CONFIG_I2C_CHARDEV=y
817CONFIG_I2C_HELPER_AUTO=y 831CONFIG_I2C_HELPER_AUTO=y
818 832
@@ -867,9 +881,6 @@ CONFIG_I2C_MPC=y
867# Miscellaneous I2C Chip support 881# Miscellaneous I2C Chip support
868# 882#
869# CONFIG_DS1682 is not set 883# CONFIG_DS1682 is not set
870# CONFIG_SENSORS_PCF8574 is not set
871# CONFIG_PCF8575 is not set
872# CONFIG_SENSORS_PCA9539 is not set
873# CONFIG_SENSORS_TSL2550 is not set 884# CONFIG_SENSORS_TSL2550 is not set
874# CONFIG_I2C_DEBUG_CORE is not set 885# CONFIG_I2C_DEBUG_CORE is not set
875# CONFIG_I2C_DEBUG_ALGO is not set 886# CONFIG_I2C_DEBUG_ALGO is not set
@@ -887,6 +898,11 @@ CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y
887# CONFIG_POWER_SUPPLY is not set 898# CONFIG_POWER_SUPPLY is not set
888CONFIG_HWMON=y 899CONFIG_HWMON=y
889# CONFIG_HWMON_VID is not set 900# CONFIG_HWMON_VID is not set
901# CONFIG_HWMON_DEBUG_CHIP is not set
902
903#
904# Native drivers
905#
890# CONFIG_SENSORS_AD7414 is not set 906# CONFIG_SENSORS_AD7414 is not set
891# CONFIG_SENSORS_AD7418 is not set 907# CONFIG_SENSORS_AD7418 is not set
892# CONFIG_SENSORS_ADM1021 is not set 908# CONFIG_SENSORS_ADM1021 is not set
@@ -936,6 +952,7 @@ CONFIG_HWMON=y
936# CONFIG_SENSORS_ADS7828 is not set 952# CONFIG_SENSORS_ADS7828 is not set
937# CONFIG_SENSORS_THMC50 is not set 953# CONFIG_SENSORS_THMC50 is not set
938# CONFIG_SENSORS_TMP401 is not set 954# CONFIG_SENSORS_TMP401 is not set
955# CONFIG_SENSORS_TMP421 is not set
939# CONFIG_SENSORS_VIA686A is not set 956# CONFIG_SENSORS_VIA686A is not set
940# CONFIG_SENSORS_VT1211 is not set 957# CONFIG_SENSORS_VT1211 is not set
941# CONFIG_SENSORS_VT8231 is not set 958# CONFIG_SENSORS_VT8231 is not set
@@ -947,9 +964,7 @@ CONFIG_HWMON=y
947# CONFIG_SENSORS_W83L786NG is not set 964# CONFIG_SENSORS_W83L786NG is not set
948# CONFIG_SENSORS_W83627HF is not set 965# CONFIG_SENSORS_W83627HF is not set
949# CONFIG_SENSORS_W83627EHF is not set 966# CONFIG_SENSORS_W83627EHF is not set
950# CONFIG_HWMON_DEBUG_CHIP is not set
951# CONFIG_THERMAL is not set 967# CONFIG_THERMAL is not set
952# CONFIG_THERMAL_HWMON is not set
953CONFIG_WATCHDOG=y 968CONFIG_WATCHDOG=y
954# CONFIG_WATCHDOG_NOWAYOUT is not set 969# CONFIG_WATCHDOG_NOWAYOUT is not set
955 970
@@ -987,6 +1002,7 @@ CONFIG_SSB_POSSIBLE=y
987# CONFIG_MFD_TMIO is not set 1002# CONFIG_MFD_TMIO is not set
988# CONFIG_PMIC_DA903X is not set 1003# CONFIG_PMIC_DA903X is not set
989# CONFIG_MFD_WM8400 is not set 1004# CONFIG_MFD_WM8400 is not set
1005# CONFIG_MFD_WM831X is not set
990# CONFIG_MFD_WM8350_I2C is not set 1006# CONFIG_MFD_WM8350_I2C is not set
991# CONFIG_MFD_PCF50633 is not set 1007# CONFIG_MFD_PCF50633 is not set
992# CONFIG_AB3100_CORE is not set 1008# CONFIG_AB3100_CORE is not set
@@ -997,6 +1013,7 @@ CONFIG_SSB_POSSIBLE=y
997# Graphics support 1013# Graphics support
998# 1014#
999# CONFIG_AGP is not set 1015# CONFIG_AGP is not set
1016CONFIG_VGA_ARB=y
1000# CONFIG_DRM is not set 1017# CONFIG_DRM is not set
1001# CONFIG_VGASTATE is not set 1018# CONFIG_VGASTATE is not set
1002CONFIG_VIDEO_OUTPUT_CONTROL=m 1019CONFIG_VIDEO_OUTPUT_CONTROL=m
@@ -1010,7 +1027,6 @@ CONFIG_VIDEO_OUTPUT_CONTROL=m
1010# CONFIG_SOUND is not set 1027# CONFIG_SOUND is not set
1011CONFIG_HID_SUPPORT=y 1028CONFIG_HID_SUPPORT=y
1012CONFIG_HID=y 1029CONFIG_HID=y
1013# CONFIG_HID_DEBUG is not set
1014# CONFIG_HIDRAW is not set 1030# CONFIG_HIDRAW is not set
1015 1031
1016# 1032#
@@ -1033,6 +1049,7 @@ CONFIG_HID_CYPRESS=y
1033CONFIG_HID_EZKEY=y 1049CONFIG_HID_EZKEY=y
1034# CONFIG_HID_KYE is not set 1050# CONFIG_HID_KYE is not set
1035CONFIG_HID_GYRATION=y 1051CONFIG_HID_GYRATION=y
1052# CONFIG_HID_TWINHAN is not set
1036# CONFIG_HID_KENSINGTON is not set 1053# CONFIG_HID_KENSINGTON is not set
1037CONFIG_HID_LOGITECH=y 1054CONFIG_HID_LOGITECH=y
1038# CONFIG_LOGITECH_FF is not set 1055# CONFIG_LOGITECH_FF is not set
@@ -1085,6 +1102,7 @@ CONFIG_USB_EHCI_HCD_PPC_OF=y
1085# CONFIG_USB_OXU210HP_HCD is not set 1102# CONFIG_USB_OXU210HP_HCD is not set
1086# CONFIG_USB_ISP116X_HCD is not set 1103# CONFIG_USB_ISP116X_HCD is not set
1087# CONFIG_USB_ISP1760_HCD is not set 1104# CONFIG_USB_ISP1760_HCD is not set
1105# CONFIG_USB_ISP1362_HCD is not set
1088# CONFIG_USB_OHCI_HCD is not set 1106# CONFIG_USB_OHCI_HCD is not set
1089# CONFIG_USB_UHCI_HCD is not set 1107# CONFIG_USB_UHCI_HCD is not set
1090# CONFIG_USB_SL811_HCD is not set 1108# CONFIG_USB_SL811_HCD is not set
@@ -1142,6 +1160,7 @@ CONFIG_USB_EHCI_HCD_PPC_OF=y
1142# CONFIG_USB_LD is not set 1160# CONFIG_USB_LD is not set
1143# CONFIG_USB_TRANCEVIBRATOR is not set 1161# CONFIG_USB_TRANCEVIBRATOR is not set
1144# CONFIG_USB_IOWARRIOR is not set 1162# CONFIG_USB_IOWARRIOR is not set
1163# CONFIG_USB_TEST is not set
1145# CONFIG_USB_ISIGHTFW is not set 1164# CONFIG_USB_ISIGHTFW is not set
1146# CONFIG_USB_VST is not set 1165# CONFIG_USB_VST is not set
1147# CONFIG_USB_GADGET is not set 1166# CONFIG_USB_GADGET is not set
@@ -1188,6 +1207,7 @@ CONFIG_FS_MBCACHE=y
1188# CONFIG_GFS2_FS is not set 1207# CONFIG_GFS2_FS is not set
1189# CONFIG_OCFS2_FS is not set 1208# CONFIG_OCFS2_FS is not set
1190# CONFIG_BTRFS_FS is not set 1209# CONFIG_BTRFS_FS is not set
1210# CONFIG_NILFS2_FS is not set
1191CONFIG_FILE_LOCKING=y 1211CONFIG_FILE_LOCKING=y
1192CONFIG_FSNOTIFY=y 1212CONFIG_FSNOTIFY=y
1193CONFIG_DNOTIFY=y 1213CONFIG_DNOTIFY=y
@@ -1246,7 +1266,6 @@ CONFIG_MISC_FILESYSTEMS=y
1246# CONFIG_ROMFS_FS is not set 1266# CONFIG_ROMFS_FS is not set
1247# CONFIG_SYSV_FS is not set 1267# CONFIG_SYSV_FS is not set
1248# CONFIG_UFS_FS is not set 1268# CONFIG_UFS_FS is not set
1249# CONFIG_NILFS2_FS is not set
1250CONFIG_NETWORK_FILESYSTEMS=y 1269CONFIG_NETWORK_FILESYSTEMS=y
1251CONFIG_NFS_FS=y 1270CONFIG_NFS_FS=y
1252CONFIG_NFS_V3=y 1271CONFIG_NFS_V3=y
@@ -1361,6 +1380,7 @@ CONFIG_ENABLE_WARN_DEPRECATED=y
1361# CONFIG_ENABLE_MUST_CHECK is not set 1380# CONFIG_ENABLE_MUST_CHECK is not set
1362CONFIG_FRAME_WARN=1024 1381CONFIG_FRAME_WARN=1024
1363# CONFIG_MAGIC_SYSRQ is not set 1382# CONFIG_MAGIC_SYSRQ is not set
1383# CONFIG_STRIP_ASM_SYMS is not set
1364# CONFIG_UNUSED_SYMBOLS is not set 1384# CONFIG_UNUSED_SYMBOLS is not set
1365# CONFIG_DEBUG_FS is not set 1385# CONFIG_DEBUG_FS is not set
1366# CONFIG_HEADERS_CHECK is not set 1386# CONFIG_HEADERS_CHECK is not set
@@ -1376,6 +1396,7 @@ CONFIG_HAVE_DYNAMIC_FTRACE=y
1376CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y 1396CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y
1377CONFIG_TRACING_SUPPORT=y 1397CONFIG_TRACING_SUPPORT=y
1378# CONFIG_FTRACE is not set 1398# CONFIG_FTRACE is not set
1399# CONFIG_DMA_API_DEBUG is not set
1379# CONFIG_SAMPLES is not set 1400# CONFIG_SAMPLES is not set
1380CONFIG_HAVE_ARCH_KGDB=y 1401CONFIG_HAVE_ARCH_KGDB=y
1381# CONFIG_PPC_DISABLE_WERROR is not set 1402# CONFIG_PPC_DISABLE_WERROR is not set
@@ -1396,12 +1417,13 @@ CONFIG_XOR_BLOCKS=y
1396CONFIG_ASYNC_CORE=y 1417CONFIG_ASYNC_CORE=y
1397CONFIG_ASYNC_MEMCPY=y 1418CONFIG_ASYNC_MEMCPY=y
1398CONFIG_ASYNC_XOR=y 1419CONFIG_ASYNC_XOR=y
1420CONFIG_ASYNC_PQ=y
1421CONFIG_ASYNC_RAID6_RECOV=y
1399CONFIG_CRYPTO=y 1422CONFIG_CRYPTO=y
1400 1423
1401# 1424#
1402# Crypto core or helper 1425# Crypto core or helper
1403# 1426#
1404# CONFIG_CRYPTO_FIPS is not set
1405CONFIG_CRYPTO_ALGAPI=y 1427CONFIG_CRYPTO_ALGAPI=y
1406CONFIG_CRYPTO_ALGAPI2=y 1428CONFIG_CRYPTO_ALGAPI2=y
1407CONFIG_CRYPTO_AEAD2=y 1429CONFIG_CRYPTO_AEAD2=y
@@ -1443,11 +1465,13 @@ CONFIG_CRYPTO_PCBC=m
1443# 1465#
1444# CONFIG_CRYPTO_HMAC is not set 1466# CONFIG_CRYPTO_HMAC is not set
1445# CONFIG_CRYPTO_XCBC is not set 1467# CONFIG_CRYPTO_XCBC is not set
1468# CONFIG_CRYPTO_VMAC is not set
1446 1469
1447# 1470#
1448# Digest 1471# Digest
1449# 1472#
1450# CONFIG_CRYPTO_CRC32C is not set 1473# CONFIG_CRYPTO_CRC32C is not set
1474# CONFIG_CRYPTO_GHASH is not set
1451# CONFIG_CRYPTO_MD4 is not set 1475# CONFIG_CRYPTO_MD4 is not set
1452CONFIG_CRYPTO_MD5=y 1476CONFIG_CRYPTO_MD5=y
1453# CONFIG_CRYPTO_MICHAEL_MIC is not set 1477# CONFIG_CRYPTO_MICHAEL_MIC is not set
diff --git a/arch/powerpc/configs/83xx/sbc834x_defconfig b/arch/powerpc/configs/83xx/sbc834x_defconfig
index 3a68f861b1bd..6b399154970f 100644
--- a/arch/powerpc/configs/83xx/sbc834x_defconfig
+++ b/arch/powerpc/configs/83xx/sbc834x_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.31-rc5 3# Linux kernel version: 2.6.32-rc5
4# Tue Aug 11 19:57:51 2009 4# Thu Nov 5 08:20:31 2009
5# 5#
6# CONFIG_PPC64 is not set 6# CONFIG_PPC64 is not set
7 7
@@ -35,6 +35,7 @@ CONFIG_GENERIC_CLOCKEVENTS=y
35CONFIG_GENERIC_HARDIRQS=y 35CONFIG_GENERIC_HARDIRQS=y
36CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y 36CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y
37# CONFIG_HAVE_SETUP_PER_CPU_AREA is not set 37# CONFIG_HAVE_SETUP_PER_CPU_AREA is not set
38# CONFIG_NEED_PER_CPU_EMBED_FIRST_CHUNK 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
@@ -84,11 +85,12 @@ CONFIG_SYSVIPC_SYSCTL=y
84# 85#
85# RCU Subsystem 86# RCU Subsystem
86# 87#
87CONFIG_CLASSIC_RCU=y 88CONFIG_TREE_RCU=y
88# CONFIG_TREE_RCU is not set 89# CONFIG_TREE_PREEMPT_RCU is not set
89# CONFIG_PREEMPT_RCU is not set 90# CONFIG_RCU_TRACE is not set
91CONFIG_RCU_FANOUT=32
92# CONFIG_RCU_FANOUT_EXACT is not set
90# CONFIG_TREE_RCU_TRACE is not set 93# CONFIG_TREE_RCU_TRACE is not set
91# CONFIG_PREEMPT_RCU_TRACE is not set
92# CONFIG_IKCONFIG is not set 94# CONFIG_IKCONFIG is not set
93CONFIG_LOG_BUF_SHIFT=14 95CONFIG_LOG_BUF_SHIFT=14
94CONFIG_GROUP_SCHED=y 96CONFIG_GROUP_SCHED=y
@@ -124,27 +126,28 @@ CONFIG_TIMERFD=y
124CONFIG_EVENTFD=y 126CONFIG_EVENTFD=y
125CONFIG_SHMEM=y 127CONFIG_SHMEM=y
126CONFIG_AIO=y 128CONFIG_AIO=y
127CONFIG_HAVE_PERF_COUNTERS=y 129CONFIG_HAVE_PERF_EVENTS=y
128 130
129# 131#
130# Performance Counters 132# Kernel Performance Events And Counters
131# 133#
134# CONFIG_PERF_EVENTS is not set
132# CONFIG_PERF_COUNTERS is not set 135# CONFIG_PERF_COUNTERS is not set
133CONFIG_VM_EVENT_COUNTERS=y 136CONFIG_VM_EVENT_COUNTERS=y
134CONFIG_PCI_QUIRKS=y 137CONFIG_PCI_QUIRKS=y
135# CONFIG_STRIP_ASM_SYMS is not set
136CONFIG_COMPAT_BRK=y 138CONFIG_COMPAT_BRK=y
137CONFIG_SLAB=y 139CONFIG_SLAB=y
138# CONFIG_SLUB is not set 140# CONFIG_SLUB is not set
139# CONFIG_SLOB is not set 141# CONFIG_SLOB is not set
140# CONFIG_PROFILING is not set 142# CONFIG_PROFILING is not set
141# CONFIG_MARKERS is not set
142CONFIG_HAVE_OPROFILE=y 143CONFIG_HAVE_OPROFILE=y
143CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS=y 144CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS=y
144CONFIG_HAVE_IOREMAP_PROT=y 145CONFIG_HAVE_IOREMAP_PROT=y
145CONFIG_HAVE_KPROBES=y 146CONFIG_HAVE_KPROBES=y
146CONFIG_HAVE_KRETPROBES=y 147CONFIG_HAVE_KRETPROBES=y
147CONFIG_HAVE_ARCH_TRACEHOOK=y 148CONFIG_HAVE_ARCH_TRACEHOOK=y
149CONFIG_HAVE_DMA_ATTRS=y
150CONFIG_HAVE_DMA_API_DEBUG=y
148 151
149# 152#
150# GCOV-based kernel profiling 153# GCOV-based kernel profiling
@@ -254,6 +257,7 @@ CONFIG_ARCH_HAS_WALK_MEMORY=y
254CONFIG_ARCH_ENABLE_MEMORY_HOTREMOVE=y 257CONFIG_ARCH_ENABLE_MEMORY_HOTREMOVE=y
255# CONFIG_KEXEC is not set 258# CONFIG_KEXEC is not set
256# CONFIG_CRASH_DUMP is not set 259# CONFIG_CRASH_DUMP is not set
260CONFIG_MAX_ACTIVE_REGIONS=32
257CONFIG_ARCH_FLATMEM_ENABLE=y 261CONFIG_ARCH_FLATMEM_ENABLE=y
258CONFIG_ARCH_POPULATES_NODE_MAP=y 262CONFIG_ARCH_POPULATES_NODE_MAP=y
259CONFIG_SELECT_MEMORY_MODEL=y 263CONFIG_SELECT_MEMORY_MODEL=y
@@ -271,6 +275,7 @@ CONFIG_BOUNCE=y
271CONFIG_VIRT_TO_BUS=y 275CONFIG_VIRT_TO_BUS=y
272CONFIG_HAVE_MLOCK=y 276CONFIG_HAVE_MLOCK=y
273CONFIG_HAVE_MLOCKED_PAGE_BIT=y 277CONFIG_HAVE_MLOCKED_PAGE_BIT=y
278# CONFIG_KSM is not set
274CONFIG_DEFAULT_MMAP_MIN_ADDR=4096 279CONFIG_DEFAULT_MMAP_MIN_ADDR=4096
275CONFIG_PPC_4K_PAGES=y 280CONFIG_PPC_4K_PAGES=y
276# CONFIG_PPC_16K_PAGES is not set 281# CONFIG_PPC_16K_PAGES is not set
@@ -366,6 +371,7 @@ CONFIG_DEFAULT_TCP_CONG="cubic"
366# CONFIG_NETFILTER is not set 371# CONFIG_NETFILTER is not set
367# CONFIG_IP_DCCP is not set 372# CONFIG_IP_DCCP is not set
368# CONFIG_IP_SCTP is not set 373# CONFIG_IP_SCTP is not set
374# CONFIG_RDS is not set
369# CONFIG_TIPC is not set 375# CONFIG_TIPC is not set
370# CONFIG_ATM is not set 376# CONFIG_ATM is not set
371# CONFIG_BRIDGE is not set 377# CONFIG_BRIDGE is not set
@@ -395,6 +401,7 @@ CONFIG_DEFAULT_TCP_CONG="cubic"
395# CONFIG_AF_RXRPC is not set 401# CONFIG_AF_RXRPC is not set
396CONFIG_WIRELESS=y 402CONFIG_WIRELESS=y
397# CONFIG_CFG80211 is not set 403# CONFIG_CFG80211 is not set
404CONFIG_CFG80211_DEFAULT_PS_VALUE=0
398CONFIG_WIRELESS_OLD_REGULATORY=y 405CONFIG_WIRELESS_OLD_REGULATORY=y
399# CONFIG_WIRELESS_EXT is not set 406# CONFIG_WIRELESS_EXT is not set
400# CONFIG_LIB80211 is not set 407# CONFIG_LIB80211 is not set
@@ -402,7 +409,6 @@ CONFIG_WIRELESS_OLD_REGULATORY=y
402# 409#
403# CFG80211 needs to be enabled for MAC80211 410# CFG80211 needs to be enabled for MAC80211
404# 411#
405CONFIG_MAC80211_DEFAULT_PS_VALUE=0
406# CONFIG_WIMAX is not set 412# CONFIG_WIMAX is not set
407# CONFIG_RFKILL is not set 413# CONFIG_RFKILL is not set
408# CONFIG_NET_9P is not set 414# CONFIG_NET_9P is not set
@@ -415,6 +421,7 @@ CONFIG_MAC80211_DEFAULT_PS_VALUE=0
415# Generic Driver Options 421# Generic Driver Options
416# 422#
417CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug" 423CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
424# CONFIG_DEVTMPFS is not set
418CONFIG_STANDALONE=y 425CONFIG_STANDALONE=y
419CONFIG_PREVENT_FIRMWARE_BUILD=y 426CONFIG_PREVENT_FIRMWARE_BUILD=y
420# CONFIG_FW_LOADER is not set 427# CONFIG_FW_LOADER is not set
@@ -422,9 +429,9 @@ CONFIG_PREVENT_FIRMWARE_BUILD=y
422# CONFIG_CONNECTOR is not set 429# CONFIG_CONNECTOR is not set
423CONFIG_MTD=y 430CONFIG_MTD=y
424# CONFIG_MTD_DEBUG is not set 431# CONFIG_MTD_DEBUG is not set
432# CONFIG_MTD_TESTS is not set
425CONFIG_MTD_CONCAT=y 433CONFIG_MTD_CONCAT=y
426CONFIG_MTD_PARTITIONS=y 434CONFIG_MTD_PARTITIONS=y
427# CONFIG_MTD_TESTS is not set
428# CONFIG_MTD_REDBOOT_PARTS is not set 435# CONFIG_MTD_REDBOOT_PARTS is not set
429CONFIG_MTD_CMDLINE_PARTS=y 436CONFIG_MTD_CMDLINE_PARTS=y
430CONFIG_MTD_OF_PARTS=y 437CONFIG_MTD_OF_PARTS=y
@@ -651,7 +658,9 @@ CONFIG_MII=y
651# CONFIG_NET_PCI is not set 658# CONFIG_NET_PCI is not set
652# CONFIG_B44 is not set 659# CONFIG_B44 is not set
653# CONFIG_KS8842 is not set 660# CONFIG_KS8842 is not set
661# CONFIG_KS8851_MLL is not set
654# CONFIG_ATL2 is not set 662# CONFIG_ATL2 is not set
663# CONFIG_XILINX_EMACLITE is not set
655CONFIG_NETDEV_1000=y 664CONFIG_NETDEV_1000=y
656# CONFIG_ACENIC is not set 665# CONFIG_ACENIC is not set
657# CONFIG_DL2K is not set 666# CONFIG_DL2K is not set
@@ -681,10 +690,7 @@ CONFIG_GIANFAR=y
681# CONFIG_JME is not set 690# CONFIG_JME is not set
682# CONFIG_NETDEV_10000 is not set 691# CONFIG_NETDEV_10000 is not set
683# CONFIG_TR is not set 692# CONFIG_TR is not set
684 693CONFIG_WLAN=y
685#
686# Wireless LAN
687#
688# CONFIG_WLAN_PRE80211 is not set 694# CONFIG_WLAN_PRE80211 is not set
689# CONFIG_WLAN_80211 is not set 695# CONFIG_WLAN_80211 is not set
690 696
@@ -786,6 +792,7 @@ CONFIG_GEN_RTC=y
786CONFIG_DEVPORT=y 792CONFIG_DEVPORT=y
787CONFIG_I2C=y 793CONFIG_I2C=y
788CONFIG_I2C_BOARDINFO=y 794CONFIG_I2C_BOARDINFO=y
795CONFIG_I2C_COMPAT=y
789CONFIG_I2C_CHARDEV=y 796CONFIG_I2C_CHARDEV=y
790CONFIG_I2C_HELPER_AUTO=y 797CONFIG_I2C_HELPER_AUTO=y
791 798
@@ -840,9 +847,6 @@ CONFIG_I2C_MPC=y
840# Miscellaneous I2C Chip support 847# Miscellaneous I2C Chip support
841# 848#
842# CONFIG_DS1682 is not set 849# CONFIG_DS1682 is not set
843# CONFIG_SENSORS_PCF8574 is not set
844# CONFIG_PCF8575 is not set
845# CONFIG_SENSORS_PCA9539 is not set
846# CONFIG_SENSORS_TSL2550 is not set 850# CONFIG_SENSORS_TSL2550 is not set
847# CONFIG_I2C_DEBUG_CORE is not set 851# CONFIG_I2C_DEBUG_CORE is not set
848# CONFIG_I2C_DEBUG_ALGO is not set 852# CONFIG_I2C_DEBUG_ALGO is not set
@@ -860,6 +864,11 @@ CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y
860# CONFIG_POWER_SUPPLY is not set 864# CONFIG_POWER_SUPPLY is not set
861CONFIG_HWMON=y 865CONFIG_HWMON=y
862# CONFIG_HWMON_VID is not set 866# CONFIG_HWMON_VID is not set
867# CONFIG_HWMON_DEBUG_CHIP is not set
868
869#
870# Native drivers
871#
863# CONFIG_SENSORS_AD7414 is not set 872# CONFIG_SENSORS_AD7414 is not set
864# CONFIG_SENSORS_AD7418 is not set 873# CONFIG_SENSORS_AD7418 is not set
865# CONFIG_SENSORS_ADM1021 is not set 874# CONFIG_SENSORS_ADM1021 is not set
@@ -909,6 +918,7 @@ CONFIG_HWMON=y
909# CONFIG_SENSORS_ADS7828 is not set 918# CONFIG_SENSORS_ADS7828 is not set
910# CONFIG_SENSORS_THMC50 is not set 919# CONFIG_SENSORS_THMC50 is not set
911# CONFIG_SENSORS_TMP401 is not set 920# CONFIG_SENSORS_TMP401 is not set
921# CONFIG_SENSORS_TMP421 is not set
912# CONFIG_SENSORS_VIA686A is not set 922# CONFIG_SENSORS_VIA686A is not set
913# CONFIG_SENSORS_VT1211 is not set 923# CONFIG_SENSORS_VT1211 is not set
914# CONFIG_SENSORS_VT8231 is not set 924# CONFIG_SENSORS_VT8231 is not set
@@ -920,9 +930,7 @@ CONFIG_HWMON=y
920# CONFIG_SENSORS_W83L786NG is not set 930# CONFIG_SENSORS_W83L786NG is not set
921# CONFIG_SENSORS_W83627HF is not set 931# CONFIG_SENSORS_W83627HF is not set
922# CONFIG_SENSORS_W83627EHF is not set 932# CONFIG_SENSORS_W83627EHF is not set
923# CONFIG_HWMON_DEBUG_CHIP is not set
924# CONFIG_THERMAL is not set 933# CONFIG_THERMAL is not set
925# CONFIG_THERMAL_HWMON is not set
926CONFIG_WATCHDOG=y 934CONFIG_WATCHDOG=y
927# CONFIG_WATCHDOG_NOWAYOUT is not set 935# CONFIG_WATCHDOG_NOWAYOUT is not set
928 936
@@ -960,6 +968,7 @@ CONFIG_SSB_POSSIBLE=y
960# CONFIG_MFD_TMIO is not set 968# CONFIG_MFD_TMIO is not set
961# CONFIG_PMIC_DA903X is not set 969# CONFIG_PMIC_DA903X is not set
962# CONFIG_MFD_WM8400 is not set 970# CONFIG_MFD_WM8400 is not set
971# CONFIG_MFD_WM831X is not set
963# CONFIG_MFD_WM8350_I2C is not set 972# CONFIG_MFD_WM8350_I2C is not set
964# CONFIG_MFD_PCF50633 is not set 973# CONFIG_MFD_PCF50633 is not set
965# CONFIG_AB3100_CORE is not set 974# CONFIG_AB3100_CORE is not set
@@ -970,6 +979,7 @@ CONFIG_SSB_POSSIBLE=y
970# Graphics support 979# Graphics support
971# 980#
972# CONFIG_AGP is not set 981# CONFIG_AGP is not set
982CONFIG_VGA_ARB=y
973# CONFIG_DRM is not set 983# CONFIG_DRM is not set
974# CONFIG_VGASTATE is not set 984# CONFIG_VGASTATE is not set
975# CONFIG_VIDEO_OUTPUT_CONTROL is not set 985# CONFIG_VIDEO_OUTPUT_CONTROL is not set
@@ -983,7 +993,6 @@ CONFIG_SSB_POSSIBLE=y
983# CONFIG_SOUND is not set 993# CONFIG_SOUND is not set
984CONFIG_HID_SUPPORT=y 994CONFIG_HID_SUPPORT=y
985CONFIG_HID=y 995CONFIG_HID=y
986# CONFIG_HID_DEBUG is not set
987# CONFIG_HIDRAW is not set 996# CONFIG_HIDRAW is not set
988 997
989# 998#
@@ -1035,6 +1044,7 @@ CONFIG_USB_EHCI_HCD_PPC_OF=y
1035# CONFIG_USB_OXU210HP_HCD is not set 1044# CONFIG_USB_OXU210HP_HCD is not set
1036# CONFIG_USB_ISP116X_HCD is not set 1045# CONFIG_USB_ISP116X_HCD is not set
1037# CONFIG_USB_ISP1760_HCD is not set 1046# CONFIG_USB_ISP1760_HCD is not set
1047# CONFIG_USB_ISP1362_HCD is not set
1038# CONFIG_USB_OHCI_HCD is not set 1048# CONFIG_USB_OHCI_HCD is not set
1039# CONFIG_USB_UHCI_HCD is not set 1049# CONFIG_USB_UHCI_HCD is not set
1040# CONFIG_USB_SL811_HCD is not set 1050# CONFIG_USB_SL811_HCD is not set
@@ -1148,6 +1158,7 @@ CONFIG_JBD=y
1148# CONFIG_GFS2_FS is not set 1158# CONFIG_GFS2_FS is not set
1149# CONFIG_OCFS2_FS is not set 1159# CONFIG_OCFS2_FS is not set
1150# CONFIG_BTRFS_FS is not set 1160# CONFIG_BTRFS_FS is not set
1161# CONFIG_NILFS2_FS is not set
1151CONFIG_FILE_LOCKING=y 1162CONFIG_FILE_LOCKING=y
1152CONFIG_FSNOTIFY=y 1163CONFIG_FSNOTIFY=y
1153CONFIG_DNOTIFY=y 1164CONFIG_DNOTIFY=y
@@ -1207,7 +1218,6 @@ CONFIG_MISC_FILESYSTEMS=y
1207# CONFIG_ROMFS_FS is not set 1218# CONFIG_ROMFS_FS is not set
1208# CONFIG_SYSV_FS is not set 1219# CONFIG_SYSV_FS is not set
1209# CONFIG_UFS_FS is not set 1220# CONFIG_UFS_FS is not set
1210# CONFIG_NILFS2_FS is not set
1211CONFIG_NETWORK_FILESYSTEMS=y 1221CONFIG_NETWORK_FILESYSTEMS=y
1212CONFIG_NFS_FS=y 1222CONFIG_NFS_FS=y
1213CONFIG_NFS_V3=y 1223CONFIG_NFS_V3=y
@@ -1306,6 +1316,7 @@ CONFIG_ENABLE_WARN_DEPRECATED=y
1306CONFIG_ENABLE_MUST_CHECK=y 1316CONFIG_ENABLE_MUST_CHECK=y
1307CONFIG_FRAME_WARN=1024 1317CONFIG_FRAME_WARN=1024
1308# CONFIG_MAGIC_SYSRQ is not set 1318# CONFIG_MAGIC_SYSRQ is not set
1319# CONFIG_STRIP_ASM_SYMS is not set
1309# CONFIG_UNUSED_SYMBOLS is not set 1320# CONFIG_UNUSED_SYMBOLS is not set
1310# CONFIG_DEBUG_FS is not set 1321# CONFIG_DEBUG_FS is not set
1311# CONFIG_HEADERS_CHECK is not set 1322# CONFIG_HEADERS_CHECK is not set
@@ -1321,6 +1332,7 @@ CONFIG_HAVE_DYNAMIC_FTRACE=y
1321CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y 1332CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y
1322CONFIG_TRACING_SUPPORT=y 1333CONFIG_TRACING_SUPPORT=y
1323# CONFIG_FTRACE is not set 1334# CONFIG_FTRACE is not set
1335# CONFIG_DMA_API_DEBUG is not set
1324# CONFIG_SAMPLES is not set 1336# CONFIG_SAMPLES is not set
1325CONFIG_HAVE_ARCH_KGDB=y 1337CONFIG_HAVE_ARCH_KGDB=y
1326# CONFIG_PPC_DISABLE_WERROR is not set 1338# CONFIG_PPC_DISABLE_WERROR is not set
@@ -1342,7 +1354,6 @@ CONFIG_CRYPTO=y
1342# 1354#
1343# Crypto core or helper 1355# Crypto core or helper
1344# 1356#
1345# CONFIG_CRYPTO_FIPS is not set
1346CONFIG_CRYPTO_ALGAPI=y 1357CONFIG_CRYPTO_ALGAPI=y
1347CONFIG_CRYPTO_ALGAPI2=y 1358CONFIG_CRYPTO_ALGAPI2=y
1348CONFIG_CRYPTO_AEAD2=y 1359CONFIG_CRYPTO_AEAD2=y
@@ -1384,11 +1395,13 @@ CONFIG_CRYPTO_PCBC=m
1384# 1395#
1385# CONFIG_CRYPTO_HMAC is not set 1396# CONFIG_CRYPTO_HMAC is not set
1386# CONFIG_CRYPTO_XCBC is not set 1397# CONFIG_CRYPTO_XCBC is not set
1398# CONFIG_CRYPTO_VMAC is not set
1387 1399
1388# 1400#
1389# Digest 1401# Digest
1390# 1402#
1391# CONFIG_CRYPTO_CRC32C is not set 1403# CONFIG_CRYPTO_CRC32C is not set
1404# CONFIG_CRYPTO_GHASH is not set
1392# CONFIG_CRYPTO_MD4 is not set 1405# CONFIG_CRYPTO_MD4 is not set
1393CONFIG_CRYPTO_MD5=y 1406CONFIG_CRYPTO_MD5=y
1394# CONFIG_CRYPTO_MICHAEL_MIC is not set 1407# CONFIG_CRYPTO_MICHAEL_MIC is not set
diff --git a/arch/powerpc/configs/85xx/ksi8560_defconfig b/arch/powerpc/configs/85xx/ksi8560_defconfig
index ff04e1028f5e..a5bde8da462c 100644
--- a/arch/powerpc/configs/85xx/ksi8560_defconfig
+++ b/arch/powerpc/configs/85xx/ksi8560_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.31-rc4 3# Linux kernel version: 2.6.32-rc5
4# Wed Jul 29 23:32:14 2009 4# Thu Nov 5 08:20:32 2009
5# 5#
6# CONFIG_PPC64 is not set 6# CONFIG_PPC64 is not set
7 7
@@ -22,6 +22,7 @@ CONFIG_FSL_EMB_PERFMON=y
22# CONFIG_PHYS_64BIT is not set 22# CONFIG_PHYS_64BIT is not set
23CONFIG_SPE=y 23CONFIG_SPE=y
24CONFIG_PPC_MMU_NOHASH=y 24CONFIG_PPC_MMU_NOHASH=y
25CONFIG_PPC_MMU_NOHASH_32=y
25CONFIG_PPC_BOOK3E_MMU=y 26CONFIG_PPC_BOOK3E_MMU=y
26# CONFIG_PPC_MM_SLICES is not set 27# CONFIG_PPC_MM_SLICES is not set
27# CONFIG_SMP is not set 28# CONFIG_SMP is not set
@@ -36,6 +37,7 @@ CONFIG_GENERIC_CLOCKEVENTS=y
36CONFIG_GENERIC_HARDIRQS=y 37CONFIG_GENERIC_HARDIRQS=y
37CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=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
40# CONFIG_NEED_PER_CPU_EMBED_FIRST_CHUNK is not set
39CONFIG_IRQ_PER_CPU=y 41CONFIG_IRQ_PER_CPU=y
40CONFIG_STACKTRACE_SUPPORT=y 42CONFIG_STACKTRACE_SUPPORT=y
41CONFIG_HAVE_LATENCYTOP_SUPPORT=y 43CONFIG_HAVE_LATENCYTOP_SUPPORT=y
@@ -85,11 +87,12 @@ CONFIG_SYSVIPC_SYSCTL=y
85# 87#
86# RCU Subsystem 88# RCU Subsystem
87# 89#
88CONFIG_CLASSIC_RCU=y 90CONFIG_TREE_RCU=y
89# CONFIG_TREE_RCU is not set 91# CONFIG_TREE_PREEMPT_RCU is not set
90# CONFIG_PREEMPT_RCU is not set 92# CONFIG_RCU_TRACE is not set
93CONFIG_RCU_FANOUT=32
94# CONFIG_RCU_FANOUT_EXACT is not set
91# CONFIG_TREE_RCU_TRACE is not set 95# CONFIG_TREE_RCU_TRACE is not set
92# CONFIG_PREEMPT_RCU_TRACE is not set
93# CONFIG_IKCONFIG is not set 96# CONFIG_IKCONFIG is not set
94CONFIG_LOG_BUF_SHIFT=14 97CONFIG_LOG_BUF_SHIFT=14
95# CONFIG_GROUP_SCHED is not set 98# CONFIG_GROUP_SCHED is not set
@@ -123,28 +126,29 @@ CONFIG_TIMERFD=y
123CONFIG_EVENTFD=y 126CONFIG_EVENTFD=y
124CONFIG_SHMEM=y 127CONFIG_SHMEM=y
125CONFIG_AIO=y 128CONFIG_AIO=y
126CONFIG_HAVE_PERF_COUNTERS=y 129CONFIG_HAVE_PERF_EVENTS=y
127 130
128# 131#
129# Performance Counters 132# Kernel Performance Events And Counters
130# 133#
134# CONFIG_PERF_EVENTS is not set
131# CONFIG_PERF_COUNTERS is not set 135# CONFIG_PERF_COUNTERS is not set
132CONFIG_VM_EVENT_COUNTERS=y 136CONFIG_VM_EVENT_COUNTERS=y
133CONFIG_SLUB_DEBUG=y 137CONFIG_SLUB_DEBUG=y
134# CONFIG_STRIP_ASM_SYMS is not set
135CONFIG_COMPAT_BRK=y 138CONFIG_COMPAT_BRK=y
136# CONFIG_SLAB is not set 139# CONFIG_SLAB is not set
137CONFIG_SLUB=y 140CONFIG_SLUB=y
138# CONFIG_SLOB is not set 141# CONFIG_SLOB is not set
139# CONFIG_PROFILING is not set 142# CONFIG_PROFILING is not set
140# CONFIG_MARKERS is not set
141CONFIG_HAVE_OPROFILE=y 143CONFIG_HAVE_OPROFILE=y
142CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS=y 144CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS=y
143CONFIG_HAVE_IOREMAP_PROT=y 145CONFIG_HAVE_IOREMAP_PROT=y
144CONFIG_HAVE_KPROBES=y 146CONFIG_HAVE_KPROBES=y
145CONFIG_HAVE_KRETPROBES=y 147CONFIG_HAVE_KRETPROBES=y
146CONFIG_HAVE_ARCH_TRACEHOOK=y 148CONFIG_HAVE_ARCH_TRACEHOOK=y
149CONFIG_HAVE_DMA_ATTRS=y
147CONFIG_HAVE_CLK=y 150CONFIG_HAVE_CLK=y
151CONFIG_HAVE_DMA_API_DEBUG=y
148 152
149# 153#
150# GCOV-based kernel profiling 154# GCOV-based kernel profiling
@@ -188,6 +192,7 @@ CONFIG_MPC85xx=y
188# CONFIG_MPC85xx_MDS is not set 192# CONFIG_MPC85xx_MDS is not set
189# CONFIG_MPC8536_DS is not set 193# CONFIG_MPC8536_DS is not set
190# CONFIG_MPC85xx_DS is not set 194# CONFIG_MPC85xx_DS is not set
195# CONFIG_MPC85xx_RDB is not set
191# CONFIG_SOCRATES is not set 196# CONFIG_SOCRATES is not set
192CONFIG_KSI8560=y 197CONFIG_KSI8560=y
193# CONFIG_XES_MPC85xx is not set 198# CONFIG_XES_MPC85xx is not set
@@ -243,6 +248,7 @@ CONFIG_MATH_EMULATION=y
243CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y 248CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y
244CONFIG_ARCH_HAS_WALK_MEMORY=y 249CONFIG_ARCH_HAS_WALK_MEMORY=y
245CONFIG_ARCH_ENABLE_MEMORY_HOTREMOVE=y 250CONFIG_ARCH_ENABLE_MEMORY_HOTREMOVE=y
251CONFIG_MAX_ACTIVE_REGIONS=32
246CONFIG_ARCH_FLATMEM_ENABLE=y 252CONFIG_ARCH_FLATMEM_ENABLE=y
247CONFIG_ARCH_POPULATES_NODE_MAP=y 253CONFIG_ARCH_POPULATES_NODE_MAP=y
248CONFIG_SELECT_MEMORY_MODEL=y 254CONFIG_SELECT_MEMORY_MODEL=y
@@ -260,6 +266,7 @@ CONFIG_BOUNCE=y
260CONFIG_VIRT_TO_BUS=y 266CONFIG_VIRT_TO_BUS=y
261CONFIG_HAVE_MLOCK=y 267CONFIG_HAVE_MLOCK=y
262CONFIG_HAVE_MLOCKED_PAGE_BIT=y 268CONFIG_HAVE_MLOCKED_PAGE_BIT=y
269# CONFIG_KSM is not set
263CONFIG_DEFAULT_MMAP_MIN_ADDR=4096 270CONFIG_DEFAULT_MMAP_MIN_ADDR=4096
264CONFIG_PPC_4K_PAGES=y 271CONFIG_PPC_4K_PAGES=y
265# CONFIG_PPC_16K_PAGES is not set 272# CONFIG_PPC_16K_PAGES is not set
@@ -348,6 +355,7 @@ CONFIG_DEFAULT_TCP_CONG="cubic"
348# CONFIG_NETFILTER is not set 355# CONFIG_NETFILTER is not set
349# CONFIG_IP_DCCP is not set 356# CONFIG_IP_DCCP is not set
350# CONFIG_IP_SCTP is not set 357# CONFIG_IP_SCTP is not set
358# CONFIG_RDS is not set
351# CONFIG_TIPC is not set 359# CONFIG_TIPC is not set
352# CONFIG_ATM is not set 360# CONFIG_ATM is not set
353# CONFIG_BRIDGE is not set 361# CONFIG_BRIDGE is not set
@@ -377,6 +385,7 @@ CONFIG_DEFAULT_TCP_CONG="cubic"
377# CONFIG_AF_RXRPC is not set 385# CONFIG_AF_RXRPC is not set
378CONFIG_WIRELESS=y 386CONFIG_WIRELESS=y
379# CONFIG_CFG80211 is not set 387# CONFIG_CFG80211 is not set
388CONFIG_CFG80211_DEFAULT_PS_VALUE=0
380CONFIG_WIRELESS_OLD_REGULATORY=y 389CONFIG_WIRELESS_OLD_REGULATORY=y
381# CONFIG_WIRELESS_EXT is not set 390# CONFIG_WIRELESS_EXT is not set
382# CONFIG_LIB80211 is not set 391# CONFIG_LIB80211 is not set
@@ -384,7 +393,6 @@ CONFIG_WIRELESS_OLD_REGULATORY=y
384# 393#
385# CFG80211 needs to be enabled for MAC80211 394# CFG80211 needs to be enabled for MAC80211
386# 395#
387CONFIG_MAC80211_DEFAULT_PS_VALUE=0
388# CONFIG_WIMAX is not set 396# CONFIG_WIMAX is not set
389# CONFIG_RFKILL is not set 397# CONFIG_RFKILL is not set
390# CONFIG_NET_9P is not set 398# CONFIG_NET_9P is not set
@@ -397,6 +405,7 @@ CONFIG_MAC80211_DEFAULT_PS_VALUE=0
397# Generic Driver Options 405# Generic Driver Options
398# 406#
399CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug" 407CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
408# CONFIG_DEVTMPFS is not set
400CONFIG_STANDALONE=y 409CONFIG_STANDALONE=y
401CONFIG_PREVENT_FIRMWARE_BUILD=y 410CONFIG_PREVENT_FIRMWARE_BUILD=y
402# CONFIG_FW_LOADER is not set 411# CONFIG_FW_LOADER is not set
@@ -582,6 +591,8 @@ CONFIG_MII=y
582# CONFIG_IBM_NEW_EMAC_MAL_COMMON_ERR is not set 591# CONFIG_IBM_NEW_EMAC_MAL_COMMON_ERR is not set
583# CONFIG_B44 is not set 592# CONFIG_B44 is not set
584# CONFIG_KS8842 is not set 593# CONFIG_KS8842 is not set
594# CONFIG_KS8851_MLL is not set
595# CONFIG_XILINX_EMACLITE is not set
585CONFIG_FS_ENET=y 596CONFIG_FS_ENET=y
586# CONFIG_FS_ENET_HAS_SCC is not set 597# CONFIG_FS_ENET_HAS_SCC is not set
587CONFIG_FS_ENET_HAS_FCC=y 598CONFIG_FS_ENET_HAS_FCC=y
@@ -591,10 +602,7 @@ CONFIG_FSL_PQ_MDIO=y
591CONFIG_GIANFAR=y 602CONFIG_GIANFAR=y
592# CONFIG_MV643XX_ETH is not set 603# CONFIG_MV643XX_ETH is not set
593CONFIG_NETDEV_10000=y 604CONFIG_NETDEV_10000=y
594 605CONFIG_WLAN=y
595#
596# Wireless LAN
597#
598# CONFIG_WLAN_PRE80211 is not set 606# CONFIG_WLAN_PRE80211 is not set
599# CONFIG_WLAN_80211 is not set 607# CONFIG_WLAN_80211 is not set
600 608
@@ -704,10 +712,19 @@ CONFIG_GPIOLIB=y
704# 712#
705# SPI GPIO expanders: 713# SPI GPIO expanders:
706# 714#
715
716#
717# AC97 GPIO expanders:
718#
707# CONFIG_W1 is not set 719# CONFIG_W1 is not set
708# CONFIG_POWER_SUPPLY is not set 720# CONFIG_POWER_SUPPLY is not set
709CONFIG_HWMON=y 721CONFIG_HWMON=y
710# CONFIG_HWMON_VID is not set 722# CONFIG_HWMON_VID is not set
723# CONFIG_HWMON_DEBUG_CHIP is not set
724
725#
726# Native drivers
727#
711# CONFIG_SENSORS_F71805F is not set 728# CONFIG_SENSORS_F71805F is not set
712# CONFIG_SENSORS_F71882FG is not set 729# CONFIG_SENSORS_F71882FG is not set
713# CONFIG_SENSORS_IT87 is not set 730# CONFIG_SENSORS_IT87 is not set
@@ -719,9 +736,7 @@ CONFIG_HWMON=y
719# CONFIG_SENSORS_VT1211 is not set 736# CONFIG_SENSORS_VT1211 is not set
720# CONFIG_SENSORS_W83627HF is not set 737# CONFIG_SENSORS_W83627HF is not set
721# CONFIG_SENSORS_W83627EHF is not set 738# CONFIG_SENSORS_W83627EHF is not set
722# CONFIG_HWMON_DEBUG_CHIP is not set
723# CONFIG_THERMAL is not set 739# CONFIG_THERMAL is not set
724# CONFIG_THERMAL_HWMON is not set
725# CONFIG_WATCHDOG is not set 740# CONFIG_WATCHDOG is not set
726CONFIG_SSB_POSSIBLE=y 741CONFIG_SSB_POSSIBLE=y
727 742
@@ -755,7 +770,6 @@ CONFIG_VIDEO_OUTPUT_CONTROL=y
755# CONFIG_SOUND is not set 770# CONFIG_SOUND is not set
756CONFIG_HID_SUPPORT=y 771CONFIG_HID_SUPPORT=y
757CONFIG_HID=y 772CONFIG_HID=y
758# CONFIG_HID_DEBUG is not set
759# CONFIG_HIDRAW is not set 773# CONFIG_HIDRAW is not set
760# CONFIG_HID_PID is not set 774# CONFIG_HID_PID is not set
761 775
@@ -818,6 +832,7 @@ CONFIG_FS_MBCACHE=y
818# CONFIG_GFS2_FS is not set 832# CONFIG_GFS2_FS is not set
819# CONFIG_OCFS2_FS is not set 833# CONFIG_OCFS2_FS is not set
820# CONFIG_BTRFS_FS is not set 834# CONFIG_BTRFS_FS is not set
835# CONFIG_NILFS2_FS is not set
821CONFIG_FILE_LOCKING=y 836CONFIG_FILE_LOCKING=y
822CONFIG_FSNOTIFY=y 837CONFIG_FSNOTIFY=y
823CONFIG_DNOTIFY=y 838CONFIG_DNOTIFY=y
@@ -877,7 +892,6 @@ CONFIG_MISC_FILESYSTEMS=y
877# CONFIG_ROMFS_FS is not set 892# CONFIG_ROMFS_FS is not set
878# CONFIG_SYSV_FS is not set 893# CONFIG_SYSV_FS is not set
879# CONFIG_UFS_FS is not set 894# CONFIG_UFS_FS is not set
880# CONFIG_NILFS2_FS is not set
881CONFIG_NETWORK_FILESYSTEMS=y 895CONFIG_NETWORK_FILESYSTEMS=y
882CONFIG_NFS_FS=y 896CONFIG_NFS_FS=y
883# CONFIG_NFS_V3 is not set 897# CONFIG_NFS_V3 is not set
@@ -945,6 +959,7 @@ CONFIG_ENABLE_WARN_DEPRECATED=y
945CONFIG_ENABLE_MUST_CHECK=y 959CONFIG_ENABLE_MUST_CHECK=y
946CONFIG_FRAME_WARN=1024 960CONFIG_FRAME_WARN=1024
947# CONFIG_MAGIC_SYSRQ is not set 961# CONFIG_MAGIC_SYSRQ is not set
962# CONFIG_STRIP_ASM_SYMS is not set
948# CONFIG_UNUSED_SYMBOLS is not set 963# CONFIG_UNUSED_SYMBOLS is not set
949CONFIG_DEBUG_FS=y 964CONFIG_DEBUG_FS=y
950# CONFIG_HEADERS_CHECK is not set 965# CONFIG_HEADERS_CHECK is not set
@@ -962,6 +977,7 @@ CONFIG_SCHED_DEBUG=y
962# CONFIG_DEBUG_OBJECTS is not set 977# CONFIG_DEBUG_OBJECTS is not set
963# CONFIG_SLUB_DEBUG_ON is not set 978# CONFIG_SLUB_DEBUG_ON is not set
964# CONFIG_SLUB_STATS is not set 979# CONFIG_SLUB_STATS is not set
980# CONFIG_DEBUG_KMEMLEAK is not set
965# CONFIG_DEBUG_RT_MUTEXES is not set 981# CONFIG_DEBUG_RT_MUTEXES is not set
966# CONFIG_RT_MUTEX_TESTER is not set 982# CONFIG_RT_MUTEX_TESTER is not set
967# CONFIG_DEBUG_SPINLOCK is not set 983# CONFIG_DEBUG_SPINLOCK is not set
@@ -981,10 +997,12 @@ CONFIG_DEBUG_MUTEXES=y
981# CONFIG_DEBUG_LIST is not set 997# CONFIG_DEBUG_LIST is not set
982# CONFIG_DEBUG_SG is not set 998# CONFIG_DEBUG_SG is not set
983# CONFIG_DEBUG_NOTIFIERS is not set 999# CONFIG_DEBUG_NOTIFIERS is not set
1000# CONFIG_DEBUG_CREDENTIALS is not set
984# CONFIG_RCU_TORTURE_TEST is not set 1001# CONFIG_RCU_TORTURE_TEST is not set
985# CONFIG_RCU_CPU_STALL_DETECTOR is not set 1002# CONFIG_RCU_CPU_STALL_DETECTOR is not set
986# CONFIG_BACKTRACE_SELF_TEST is not set 1003# CONFIG_BACKTRACE_SELF_TEST is not set
987# CONFIG_DEBUG_BLOCK_EXT_DEVT is not set 1004# CONFIG_DEBUG_BLOCK_EXT_DEVT is not set
1005# CONFIG_DEBUG_FORCE_WEAK_PER_CPU is not set
988# CONFIG_FAULT_INJECTION is not set 1006# CONFIG_FAULT_INJECTION is not set
989# CONFIG_LATENCYTOP is not set 1007# CONFIG_LATENCYTOP is not set
990CONFIG_SYSCTL_SYSCALL_CHECK=y 1008CONFIG_SYSCTL_SYSCALL_CHECK=y
@@ -1008,10 +1026,10 @@ CONFIG_BRANCH_PROFILE_NONE=y
1008# CONFIG_WORKQUEUE_TRACER is not set 1026# CONFIG_WORKQUEUE_TRACER is not set
1009# CONFIG_BLK_DEV_IO_TRACE is not set 1027# CONFIG_BLK_DEV_IO_TRACE is not set
1010# CONFIG_DYNAMIC_DEBUG is not set 1028# CONFIG_DYNAMIC_DEBUG is not set
1029# CONFIG_DMA_API_DEBUG is not set
1011# CONFIG_SAMPLES is not set 1030# CONFIG_SAMPLES is not set
1012CONFIG_HAVE_ARCH_KGDB=y 1031CONFIG_HAVE_ARCH_KGDB=y
1013# CONFIG_KGDB is not set 1032# CONFIG_KGDB is not set
1014# CONFIG_KMEMCHECK is not set
1015# CONFIG_PPC_DISABLE_WERROR is not set 1033# CONFIG_PPC_DISABLE_WERROR is not set
1016CONFIG_PPC_WERROR=y 1034CONFIG_PPC_WERROR=y
1017CONFIG_PRINT_STACK_DEPTH=64 1035CONFIG_PRINT_STACK_DEPTH=64
@@ -1039,7 +1057,6 @@ CONFIG_CRYPTO=y
1039# 1057#
1040# Crypto core or helper 1058# Crypto core or helper
1041# 1059#
1042# CONFIG_CRYPTO_FIPS is not set
1043# CONFIG_CRYPTO_MANAGER is not set 1060# CONFIG_CRYPTO_MANAGER is not set
1044# CONFIG_CRYPTO_MANAGER2 is not set 1061# CONFIG_CRYPTO_MANAGER2 is not set
1045# CONFIG_CRYPTO_GF128MUL is not set 1062# CONFIG_CRYPTO_GF128MUL is not set
@@ -1070,11 +1087,13 @@ CONFIG_CRYPTO=y
1070# 1087#
1071# CONFIG_CRYPTO_HMAC is not set 1088# CONFIG_CRYPTO_HMAC is not set
1072# CONFIG_CRYPTO_XCBC is not set 1089# CONFIG_CRYPTO_XCBC is not set
1090# CONFIG_CRYPTO_VMAC is not set
1073 1091
1074# 1092#
1075# Digest 1093# Digest
1076# 1094#
1077# CONFIG_CRYPTO_CRC32C is not set 1095# CONFIG_CRYPTO_CRC32C is not set
1096# CONFIG_CRYPTO_GHASH is not set
1078# CONFIG_CRYPTO_MD4 is not set 1097# CONFIG_CRYPTO_MD4 is not set
1079# CONFIG_CRYPTO_MD5 is not set 1098# CONFIG_CRYPTO_MD5 is not set
1080# CONFIG_CRYPTO_MICHAEL_MIC is not set 1099# CONFIG_CRYPTO_MICHAEL_MIC is not set
diff --git a/arch/powerpc/configs/85xx/mpc8540_ads_defconfig b/arch/powerpc/configs/85xx/mpc8540_ads_defconfig
index fb10cc83702e..c10e26f8763f 100644
--- a/arch/powerpc/configs/85xx/mpc8540_ads_defconfig
+++ b/arch/powerpc/configs/85xx/mpc8540_ads_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.31-rc4 3# Linux kernel version: 2.6.32-rc5
4# Wed Jul 29 23:32:15 2009 4# Thu Nov 5 08:20:33 2009
5# 5#
6# CONFIG_PPC64 is not set 6# CONFIG_PPC64 is not set
7 7
@@ -22,6 +22,7 @@ CONFIG_FSL_EMB_PERFMON=y
22# CONFIG_PHYS_64BIT is not set 22# CONFIG_PHYS_64BIT is not set
23CONFIG_SPE=y 23CONFIG_SPE=y
24CONFIG_PPC_MMU_NOHASH=y 24CONFIG_PPC_MMU_NOHASH=y
25CONFIG_PPC_MMU_NOHASH_32=y
25CONFIG_PPC_BOOK3E_MMU=y 26CONFIG_PPC_BOOK3E_MMU=y
26# CONFIG_PPC_MM_SLICES is not set 27# CONFIG_PPC_MM_SLICES is not set
27# CONFIG_SMP is not set 28# CONFIG_SMP is not set
@@ -36,6 +37,7 @@ CONFIG_GENERIC_CLOCKEVENTS=y
36CONFIG_GENERIC_HARDIRQS=y 37CONFIG_GENERIC_HARDIRQS=y
37CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=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
40# CONFIG_NEED_PER_CPU_EMBED_FIRST_CHUNK is not set
39CONFIG_IRQ_PER_CPU=y 41CONFIG_IRQ_PER_CPU=y
40CONFIG_STACKTRACE_SUPPORT=y 42CONFIG_STACKTRACE_SUPPORT=y
41CONFIG_HAVE_LATENCYTOP_SUPPORT=y 43CONFIG_HAVE_LATENCYTOP_SUPPORT=y
@@ -84,11 +86,12 @@ CONFIG_SYSVIPC_SYSCTL=y
84# 86#
85# RCU Subsystem 87# RCU Subsystem
86# 88#
87CONFIG_CLASSIC_RCU=y 89CONFIG_TREE_RCU=y
88# CONFIG_TREE_RCU is not set 90# CONFIG_TREE_PREEMPT_RCU is not set
89# CONFIG_PREEMPT_RCU is not set 91# CONFIG_RCU_TRACE is not set
92CONFIG_RCU_FANOUT=32
93# CONFIG_RCU_FANOUT_EXACT is not set
90# CONFIG_TREE_RCU_TRACE is not set 94# CONFIG_TREE_RCU_TRACE is not set
91# CONFIG_PREEMPT_RCU_TRACE is not set
92# CONFIG_IKCONFIG is not set 95# CONFIG_IKCONFIG is not set
93CONFIG_LOG_BUF_SHIFT=14 96CONFIG_LOG_BUF_SHIFT=14
94CONFIG_GROUP_SCHED=y 97CONFIG_GROUP_SCHED=y
@@ -126,27 +129,28 @@ CONFIG_TIMERFD=y
126CONFIG_EVENTFD=y 129CONFIG_EVENTFD=y
127CONFIG_SHMEM=y 130CONFIG_SHMEM=y
128CONFIG_AIO=y 131CONFIG_AIO=y
129CONFIG_HAVE_PERF_COUNTERS=y 132CONFIG_HAVE_PERF_EVENTS=y
130 133
131# 134#
132# Performance Counters 135# Kernel Performance Events And Counters
133# 136#
137# CONFIG_PERF_EVENTS is not set
134# CONFIG_PERF_COUNTERS is not set 138# CONFIG_PERF_COUNTERS is not set
135CONFIG_VM_EVENT_COUNTERS=y 139CONFIG_VM_EVENT_COUNTERS=y
136CONFIG_SLUB_DEBUG=y 140CONFIG_SLUB_DEBUG=y
137# CONFIG_STRIP_ASM_SYMS is not set
138CONFIG_COMPAT_BRK=y 141CONFIG_COMPAT_BRK=y
139# CONFIG_SLAB is not set 142# CONFIG_SLAB is not set
140CONFIG_SLUB=y 143CONFIG_SLUB=y
141# CONFIG_SLOB is not set 144# CONFIG_SLOB is not set
142# CONFIG_PROFILING is not set 145# CONFIG_PROFILING is not set
143# CONFIG_MARKERS is not set
144CONFIG_HAVE_OPROFILE=y 146CONFIG_HAVE_OPROFILE=y
145CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS=y 147CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS=y
146CONFIG_HAVE_IOREMAP_PROT=y 148CONFIG_HAVE_IOREMAP_PROT=y
147CONFIG_HAVE_KPROBES=y 149CONFIG_HAVE_KPROBES=y
148CONFIG_HAVE_KRETPROBES=y 150CONFIG_HAVE_KRETPROBES=y
149CONFIG_HAVE_ARCH_TRACEHOOK=y 151CONFIG_HAVE_ARCH_TRACEHOOK=y
152CONFIG_HAVE_DMA_ATTRS=y
153CONFIG_HAVE_DMA_API_DEBUG=y
150 154
151# 155#
152# GCOV-based kernel profiling 156# GCOV-based kernel profiling
@@ -189,6 +193,7 @@ CONFIG_MPC8540_ADS=y
189# CONFIG_MPC85xx_MDS is not set 193# CONFIG_MPC85xx_MDS is not set
190# CONFIG_MPC8536_DS is not set 194# CONFIG_MPC8536_DS is not set
191# CONFIG_MPC85xx_DS is not set 195# CONFIG_MPC85xx_DS is not set
196# CONFIG_MPC85xx_RDB is not set
192# CONFIG_SOCRATES is not set 197# CONFIG_SOCRATES is not set
193# CONFIG_KSI8560 is not set 198# CONFIG_KSI8560 is not set
194# CONFIG_XES_MPC85xx is not set 199# CONFIG_XES_MPC85xx is not set
@@ -244,6 +249,7 @@ CONFIG_MATH_EMULATION=y
244CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y 249CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y
245CONFIG_ARCH_HAS_WALK_MEMORY=y 250CONFIG_ARCH_HAS_WALK_MEMORY=y
246CONFIG_ARCH_ENABLE_MEMORY_HOTREMOVE=y 251CONFIG_ARCH_ENABLE_MEMORY_HOTREMOVE=y
252CONFIG_MAX_ACTIVE_REGIONS=32
247CONFIG_ARCH_FLATMEM_ENABLE=y 253CONFIG_ARCH_FLATMEM_ENABLE=y
248CONFIG_ARCH_POPULATES_NODE_MAP=y 254CONFIG_ARCH_POPULATES_NODE_MAP=y
249CONFIG_SELECT_MEMORY_MODEL=y 255CONFIG_SELECT_MEMORY_MODEL=y
@@ -261,6 +267,7 @@ CONFIG_BOUNCE=y
261CONFIG_VIRT_TO_BUS=y 267CONFIG_VIRT_TO_BUS=y
262CONFIG_HAVE_MLOCK=y 268CONFIG_HAVE_MLOCK=y
263CONFIG_HAVE_MLOCKED_PAGE_BIT=y 269CONFIG_HAVE_MLOCKED_PAGE_BIT=y
270# CONFIG_KSM is not set
264CONFIG_DEFAULT_MMAP_MIN_ADDR=4096 271CONFIG_DEFAULT_MMAP_MIN_ADDR=4096
265CONFIG_PPC_4K_PAGES=y 272CONFIG_PPC_4K_PAGES=y
266# CONFIG_PPC_16K_PAGES is not set 273# CONFIG_PPC_16K_PAGES is not set
@@ -349,6 +356,7 @@ CONFIG_DEFAULT_TCP_CONG="cubic"
349# CONFIG_NETFILTER is not set 356# CONFIG_NETFILTER is not set
350# CONFIG_IP_DCCP is not set 357# CONFIG_IP_DCCP is not set
351# CONFIG_IP_SCTP is not set 358# CONFIG_IP_SCTP is not set
359# CONFIG_RDS is not set
352# CONFIG_TIPC is not set 360# CONFIG_TIPC is not set
353# CONFIG_ATM is not set 361# CONFIG_ATM is not set
354# CONFIG_BRIDGE is not set 362# CONFIG_BRIDGE is not set
@@ -378,6 +386,7 @@ CONFIG_DEFAULT_TCP_CONG="cubic"
378# CONFIG_AF_RXRPC is not set 386# CONFIG_AF_RXRPC is not set
379CONFIG_WIRELESS=y 387CONFIG_WIRELESS=y
380# CONFIG_CFG80211 is not set 388# CONFIG_CFG80211 is not set
389CONFIG_CFG80211_DEFAULT_PS_VALUE=0
381CONFIG_WIRELESS_OLD_REGULATORY=y 390CONFIG_WIRELESS_OLD_REGULATORY=y
382# CONFIG_WIRELESS_EXT is not set 391# CONFIG_WIRELESS_EXT is not set
383# CONFIG_LIB80211 is not set 392# CONFIG_LIB80211 is not set
@@ -385,7 +394,6 @@ CONFIG_WIRELESS_OLD_REGULATORY=y
385# 394#
386# CFG80211 needs to be enabled for MAC80211 395# CFG80211 needs to be enabled for MAC80211
387# 396#
388CONFIG_MAC80211_DEFAULT_PS_VALUE=0
389# CONFIG_WIMAX is not set 397# CONFIG_WIMAX is not set
390# CONFIG_RFKILL is not set 398# CONFIG_RFKILL is not set
391# CONFIG_NET_9P is not set 399# CONFIG_NET_9P is not set
@@ -398,6 +406,7 @@ CONFIG_MAC80211_DEFAULT_PS_VALUE=0
398# Generic Driver Options 406# Generic Driver Options
399# 407#
400CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug" 408CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
409# CONFIG_DEVTMPFS is not set
401CONFIG_STANDALONE=y 410CONFIG_STANDALONE=y
402CONFIG_PREVENT_FIRMWARE_BUILD=y 411CONFIG_PREVENT_FIRMWARE_BUILD=y
403# CONFIG_FW_LOADER is not set 412# CONFIG_FW_LOADER is not set
@@ -483,15 +492,14 @@ CONFIG_MII=y
483# CONFIG_IBM_NEW_EMAC_MAL_COMMON_ERR is not set 492# CONFIG_IBM_NEW_EMAC_MAL_COMMON_ERR is not set
484# CONFIG_B44 is not set 493# CONFIG_B44 is not set
485# CONFIG_KS8842 is not set 494# CONFIG_KS8842 is not set
495# CONFIG_KS8851_MLL is not set
496# CONFIG_XILINX_EMACLITE is not set
486CONFIG_NETDEV_1000=y 497CONFIG_NETDEV_1000=y
487CONFIG_FSL_PQ_MDIO=y 498CONFIG_FSL_PQ_MDIO=y
488CONFIG_GIANFAR=y 499CONFIG_GIANFAR=y
489# CONFIG_MV643XX_ETH is not set 500# CONFIG_MV643XX_ETH is not set
490CONFIG_NETDEV_10000=y 501CONFIG_NETDEV_10000=y
491 502CONFIG_WLAN=y
492#
493# Wireless LAN
494#
495# CONFIG_WLAN_PRE80211 is not set 503# CONFIG_WLAN_PRE80211 is not set
496# CONFIG_WLAN_80211 is not set 504# CONFIG_WLAN_80211 is not set
497 505
@@ -588,6 +596,11 @@ CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y
588# CONFIG_POWER_SUPPLY is not set 596# CONFIG_POWER_SUPPLY is not set
589CONFIG_HWMON=y 597CONFIG_HWMON=y
590# CONFIG_HWMON_VID is not set 598# CONFIG_HWMON_VID is not set
599# CONFIG_HWMON_DEBUG_CHIP is not set
600
601#
602# Native drivers
603#
591# CONFIG_SENSORS_F71805F is not set 604# CONFIG_SENSORS_F71805F is not set
592# CONFIG_SENSORS_F71882FG is not set 605# CONFIG_SENSORS_F71882FG is not set
593# CONFIG_SENSORS_IT87 is not set 606# CONFIG_SENSORS_IT87 is not set
@@ -598,9 +611,7 @@ CONFIG_HWMON=y
598# CONFIG_SENSORS_VT1211 is not set 611# CONFIG_SENSORS_VT1211 is not set
599# CONFIG_SENSORS_W83627HF is not set 612# CONFIG_SENSORS_W83627HF is not set
600# CONFIG_SENSORS_W83627EHF is not set 613# CONFIG_SENSORS_W83627EHF is not set
601# CONFIG_HWMON_DEBUG_CHIP is not set
602# CONFIG_THERMAL is not set 614# CONFIG_THERMAL is not set
603# CONFIG_THERMAL_HWMON is not set
604# CONFIG_WATCHDOG is not set 615# CONFIG_WATCHDOG is not set
605CONFIG_SSB_POSSIBLE=y 616CONFIG_SSB_POSSIBLE=y
606 617
@@ -634,7 +645,6 @@ CONFIG_VIDEO_OUTPUT_CONTROL=y
634# CONFIG_SOUND is not set 645# CONFIG_SOUND is not set
635CONFIG_HID_SUPPORT=y 646CONFIG_HID_SUPPORT=y
636CONFIG_HID=y 647CONFIG_HID=y
637# CONFIG_HID_DEBUG is not set
638# CONFIG_HIDRAW is not set 648# CONFIG_HIDRAW is not set
639# CONFIG_HID_PID is not set 649# CONFIG_HID_PID is not set
640 650
@@ -696,6 +706,7 @@ CONFIG_FS_MBCACHE=y
696# CONFIG_GFS2_FS is not set 706# CONFIG_GFS2_FS is not set
697# CONFIG_OCFS2_FS is not set 707# CONFIG_OCFS2_FS is not set
698# CONFIG_BTRFS_FS is not set 708# CONFIG_BTRFS_FS is not set
709# CONFIG_NILFS2_FS is not set
699CONFIG_FILE_LOCKING=y 710CONFIG_FILE_LOCKING=y
700CONFIG_FSNOTIFY=y 711CONFIG_FSNOTIFY=y
701CONFIG_DNOTIFY=y 712CONFIG_DNOTIFY=y
@@ -754,7 +765,6 @@ CONFIG_MISC_FILESYSTEMS=y
754# CONFIG_ROMFS_FS is not set 765# CONFIG_ROMFS_FS is not set
755# CONFIG_SYSV_FS is not set 766# CONFIG_SYSV_FS is not set
756# CONFIG_UFS_FS is not set 767# CONFIG_UFS_FS is not set
757# CONFIG_NILFS2_FS is not set
758CONFIG_NETWORK_FILESYSTEMS=y 768CONFIG_NETWORK_FILESYSTEMS=y
759CONFIG_NFS_FS=y 769CONFIG_NFS_FS=y
760# CONFIG_NFS_V3 is not set 770# CONFIG_NFS_V3 is not set
@@ -822,6 +832,7 @@ CONFIG_ENABLE_WARN_DEPRECATED=y
822CONFIG_ENABLE_MUST_CHECK=y 832CONFIG_ENABLE_MUST_CHECK=y
823CONFIG_FRAME_WARN=1024 833CONFIG_FRAME_WARN=1024
824# CONFIG_MAGIC_SYSRQ is not set 834# CONFIG_MAGIC_SYSRQ is not set
835# CONFIG_STRIP_ASM_SYMS is not set
825# CONFIG_UNUSED_SYMBOLS is not set 836# CONFIG_UNUSED_SYMBOLS is not set
826# CONFIG_DEBUG_FS is not set 837# CONFIG_DEBUG_FS is not set
827# CONFIG_HEADERS_CHECK is not set 838# CONFIG_HEADERS_CHECK is not set
@@ -839,6 +850,7 @@ CONFIG_SCHED_DEBUG=y
839# CONFIG_DEBUG_OBJECTS is not set 850# CONFIG_DEBUG_OBJECTS is not set
840# CONFIG_SLUB_DEBUG_ON is not set 851# CONFIG_SLUB_DEBUG_ON is not set
841# CONFIG_SLUB_STATS is not set 852# CONFIG_SLUB_STATS is not set
853# CONFIG_DEBUG_KMEMLEAK is not set
842# CONFIG_DEBUG_RT_MUTEXES is not set 854# CONFIG_DEBUG_RT_MUTEXES is not set
843# CONFIG_RT_MUTEX_TESTER is not set 855# CONFIG_RT_MUTEX_TESTER is not set
844# CONFIG_DEBUG_SPINLOCK is not set 856# CONFIG_DEBUG_SPINLOCK is not set
@@ -857,10 +869,12 @@ CONFIG_DEBUG_MUTEXES=y
857# CONFIG_DEBUG_LIST is not set 869# CONFIG_DEBUG_LIST is not set
858# CONFIG_DEBUG_SG is not set 870# CONFIG_DEBUG_SG is not set
859# CONFIG_DEBUG_NOTIFIERS is not set 871# CONFIG_DEBUG_NOTIFIERS is not set
872# CONFIG_DEBUG_CREDENTIALS is not set
860# CONFIG_RCU_TORTURE_TEST is not set 873# CONFIG_RCU_TORTURE_TEST is not set
861# CONFIG_RCU_CPU_STALL_DETECTOR is not set 874# CONFIG_RCU_CPU_STALL_DETECTOR is not set
862# CONFIG_BACKTRACE_SELF_TEST is not set 875# CONFIG_BACKTRACE_SELF_TEST is not set
863# CONFIG_DEBUG_BLOCK_EXT_DEVT is not set 876# CONFIG_DEBUG_BLOCK_EXT_DEVT is not set
877# CONFIG_DEBUG_FORCE_WEAK_PER_CPU is not set
864# CONFIG_FAULT_INJECTION is not set 878# CONFIG_FAULT_INJECTION is not set
865# CONFIG_LATENCYTOP is not set 879# CONFIG_LATENCYTOP is not set
866CONFIG_SYSCTL_SYSCALL_CHECK=y 880CONFIG_SYSCTL_SYSCALL_CHECK=y
@@ -883,10 +897,10 @@ CONFIG_BRANCH_PROFILE_NONE=y
883# CONFIG_KMEMTRACE is not set 897# CONFIG_KMEMTRACE is not set
884# CONFIG_WORKQUEUE_TRACER is not set 898# CONFIG_WORKQUEUE_TRACER is not set
885# CONFIG_BLK_DEV_IO_TRACE is not set 899# CONFIG_BLK_DEV_IO_TRACE is not set
900# CONFIG_DMA_API_DEBUG is not set
886# CONFIG_SAMPLES is not set 901# CONFIG_SAMPLES is not set
887CONFIG_HAVE_ARCH_KGDB=y 902CONFIG_HAVE_ARCH_KGDB=y
888# CONFIG_KGDB is not set 903# CONFIG_KGDB is not set
889# CONFIG_KMEMCHECK is not set
890# CONFIG_PPC_DISABLE_WERROR is not set 904# CONFIG_PPC_DISABLE_WERROR is not set
891CONFIG_PPC_WERROR=y 905CONFIG_PPC_WERROR=y
892CONFIG_PRINT_STACK_DEPTH=64 906CONFIG_PRINT_STACK_DEPTH=64
@@ -912,7 +926,6 @@ CONFIG_CRYPTO=y
912# 926#
913# Crypto core or helper 927# Crypto core or helper
914# 928#
915# CONFIG_CRYPTO_FIPS is not set
916# CONFIG_CRYPTO_MANAGER is not set 929# CONFIG_CRYPTO_MANAGER is not set
917# CONFIG_CRYPTO_MANAGER2 is not set 930# CONFIG_CRYPTO_MANAGER2 is not set
918# CONFIG_CRYPTO_GF128MUL is not set 931# CONFIG_CRYPTO_GF128MUL is not set
@@ -943,11 +956,13 @@ CONFIG_CRYPTO=y
943# 956#
944# CONFIG_CRYPTO_HMAC is not set 957# CONFIG_CRYPTO_HMAC is not set
945# CONFIG_CRYPTO_XCBC is not set 958# CONFIG_CRYPTO_XCBC is not set
959# CONFIG_CRYPTO_VMAC is not set
946 960
947# 961#
948# Digest 962# Digest
949# 963#
950# CONFIG_CRYPTO_CRC32C is not set 964# CONFIG_CRYPTO_CRC32C is not set
965# CONFIG_CRYPTO_GHASH is not set
951# CONFIG_CRYPTO_MD4 is not set 966# CONFIG_CRYPTO_MD4 is not set
952# CONFIG_CRYPTO_MD5 is not set 967# CONFIG_CRYPTO_MD5 is not set
953# CONFIG_CRYPTO_MICHAEL_MIC is not set 968# CONFIG_CRYPTO_MICHAEL_MIC is not set
diff --git a/arch/powerpc/configs/85xx/mpc8560_ads_defconfig b/arch/powerpc/configs/85xx/mpc8560_ads_defconfig
index 5c8ce6978825..8d9f0a4b5205 100644
--- a/arch/powerpc/configs/85xx/mpc8560_ads_defconfig
+++ b/arch/powerpc/configs/85xx/mpc8560_ads_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.31-rc4 3# Linux kernel version: 2.6.32-rc5
4# Wed Jul 29 23:32:16 2009 4# Thu Nov 5 08:20:34 2009
5# 5#
6# CONFIG_PPC64 is not set 6# CONFIG_PPC64 is not set
7 7
@@ -22,6 +22,7 @@ CONFIG_FSL_EMB_PERFMON=y
22# CONFIG_PHYS_64BIT is not set 22# CONFIG_PHYS_64BIT is not set
23CONFIG_SPE=y 23CONFIG_SPE=y
24CONFIG_PPC_MMU_NOHASH=y 24CONFIG_PPC_MMU_NOHASH=y
25CONFIG_PPC_MMU_NOHASH_32=y
25CONFIG_PPC_BOOK3E_MMU=y 26CONFIG_PPC_BOOK3E_MMU=y
26# CONFIG_PPC_MM_SLICES is not set 27# CONFIG_PPC_MM_SLICES is not set
27# CONFIG_SMP is not set 28# CONFIG_SMP is not set
@@ -36,6 +37,7 @@ CONFIG_GENERIC_CLOCKEVENTS=y
36CONFIG_GENERIC_HARDIRQS=y 37CONFIG_GENERIC_HARDIRQS=y
37CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=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
40# CONFIG_NEED_PER_CPU_EMBED_FIRST_CHUNK is not set
39CONFIG_IRQ_PER_CPU=y 41CONFIG_IRQ_PER_CPU=y
40CONFIG_STACKTRACE_SUPPORT=y 42CONFIG_STACKTRACE_SUPPORT=y
41CONFIG_HAVE_LATENCYTOP_SUPPORT=y 43CONFIG_HAVE_LATENCYTOP_SUPPORT=y
@@ -85,11 +87,12 @@ CONFIG_SYSVIPC_SYSCTL=y
85# 87#
86# RCU Subsystem 88# RCU Subsystem
87# 89#
88CONFIG_CLASSIC_RCU=y 90CONFIG_TREE_RCU=y
89# CONFIG_TREE_RCU is not set 91# CONFIG_TREE_PREEMPT_RCU is not set
90# CONFIG_PREEMPT_RCU is not set 92# CONFIG_RCU_TRACE is not set
93CONFIG_RCU_FANOUT=32
94# CONFIG_RCU_FANOUT_EXACT is not set
91# CONFIG_TREE_RCU_TRACE is not set 95# CONFIG_TREE_RCU_TRACE is not set
92# CONFIG_PREEMPT_RCU_TRACE is not set
93# CONFIG_IKCONFIG is not set 96# CONFIG_IKCONFIG is not set
94CONFIG_LOG_BUF_SHIFT=14 97CONFIG_LOG_BUF_SHIFT=14
95CONFIG_GROUP_SCHED=y 98CONFIG_GROUP_SCHED=y
@@ -127,29 +130,30 @@ CONFIG_TIMERFD=y
127CONFIG_EVENTFD=y 130CONFIG_EVENTFD=y
128CONFIG_SHMEM=y 131CONFIG_SHMEM=y
129CONFIG_AIO=y 132CONFIG_AIO=y
130CONFIG_HAVE_PERF_COUNTERS=y 133CONFIG_HAVE_PERF_EVENTS=y
131 134
132# 135#
133# Performance Counters 136# Kernel Performance Events And Counters
134# 137#
138# CONFIG_PERF_EVENTS is not set
135# CONFIG_PERF_COUNTERS is not set 139# CONFIG_PERF_COUNTERS is not set
136CONFIG_VM_EVENT_COUNTERS=y 140CONFIG_VM_EVENT_COUNTERS=y
137CONFIG_PCI_QUIRKS=y 141CONFIG_PCI_QUIRKS=y
138CONFIG_SLUB_DEBUG=y 142CONFIG_SLUB_DEBUG=y
139# CONFIG_STRIP_ASM_SYMS is not set
140CONFIG_COMPAT_BRK=y 143CONFIG_COMPAT_BRK=y
141# CONFIG_SLAB is not set 144# CONFIG_SLAB is not set
142CONFIG_SLUB=y 145CONFIG_SLUB=y
143# CONFIG_SLOB is not set 146# CONFIG_SLOB is not set
144# CONFIG_PROFILING is not set 147# CONFIG_PROFILING is not set
145# CONFIG_MARKERS is not set
146CONFIG_HAVE_OPROFILE=y 148CONFIG_HAVE_OPROFILE=y
147CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS=y 149CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS=y
148CONFIG_HAVE_IOREMAP_PROT=y 150CONFIG_HAVE_IOREMAP_PROT=y
149CONFIG_HAVE_KPROBES=y 151CONFIG_HAVE_KPROBES=y
150CONFIG_HAVE_KRETPROBES=y 152CONFIG_HAVE_KRETPROBES=y
151CONFIG_HAVE_ARCH_TRACEHOOK=y 153CONFIG_HAVE_ARCH_TRACEHOOK=y
154CONFIG_HAVE_DMA_ATTRS=y
152CONFIG_HAVE_CLK=y 155CONFIG_HAVE_CLK=y
156CONFIG_HAVE_DMA_API_DEBUG=y
153 157
154# 158#
155# GCOV-based kernel profiling 159# GCOV-based kernel profiling
@@ -192,6 +196,7 @@ CONFIG_MPC8560_ADS=y
192# CONFIG_MPC85xx_MDS is not set 196# CONFIG_MPC85xx_MDS is not set
193# CONFIG_MPC8536_DS is not set 197# CONFIG_MPC8536_DS is not set
194# CONFIG_MPC85xx_DS is not set 198# CONFIG_MPC85xx_DS is not set
199# CONFIG_MPC85xx_RDB is not set
195# CONFIG_SOCRATES is not set 200# CONFIG_SOCRATES is not set
196# CONFIG_KSI8560 is not set 201# CONFIG_KSI8560 is not set
197# CONFIG_XES_MPC85xx is not set 202# CONFIG_XES_MPC85xx is not set
@@ -247,6 +252,7 @@ CONFIG_MATH_EMULATION=y
247CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y 252CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y
248CONFIG_ARCH_HAS_WALK_MEMORY=y 253CONFIG_ARCH_HAS_WALK_MEMORY=y
249CONFIG_ARCH_ENABLE_MEMORY_HOTREMOVE=y 254CONFIG_ARCH_ENABLE_MEMORY_HOTREMOVE=y
255CONFIG_MAX_ACTIVE_REGIONS=32
250CONFIG_ARCH_FLATMEM_ENABLE=y 256CONFIG_ARCH_FLATMEM_ENABLE=y
251CONFIG_ARCH_POPULATES_NODE_MAP=y 257CONFIG_ARCH_POPULATES_NODE_MAP=y
252CONFIG_SELECT_MEMORY_MODEL=y 258CONFIG_SELECT_MEMORY_MODEL=y
@@ -264,6 +270,7 @@ CONFIG_BOUNCE=y
264CONFIG_VIRT_TO_BUS=y 270CONFIG_VIRT_TO_BUS=y
265CONFIG_HAVE_MLOCK=y 271CONFIG_HAVE_MLOCK=y
266CONFIG_HAVE_MLOCKED_PAGE_BIT=y 272CONFIG_HAVE_MLOCKED_PAGE_BIT=y
273# CONFIG_KSM is not set
267CONFIG_DEFAULT_MMAP_MIN_ADDR=4096 274CONFIG_DEFAULT_MMAP_MIN_ADDR=4096
268CONFIG_PPC_4K_PAGES=y 275CONFIG_PPC_4K_PAGES=y
269# CONFIG_PPC_16K_PAGES is not set 276# CONFIG_PPC_16K_PAGES is not set
@@ -361,6 +368,7 @@ CONFIG_DEFAULT_TCP_CONG="cubic"
361# CONFIG_NETFILTER is not set 368# CONFIG_NETFILTER is not set
362# CONFIG_IP_DCCP is not set 369# CONFIG_IP_DCCP is not set
363# CONFIG_IP_SCTP is not set 370# CONFIG_IP_SCTP is not set
371# CONFIG_RDS is not set
364# CONFIG_TIPC is not set 372# CONFIG_TIPC is not set
365# CONFIG_ATM is not set 373# CONFIG_ATM is not set
366# CONFIG_BRIDGE is not set 374# CONFIG_BRIDGE is not set
@@ -390,6 +398,7 @@ CONFIG_DEFAULT_TCP_CONG="cubic"
390# CONFIG_AF_RXRPC is not set 398# CONFIG_AF_RXRPC is not set
391CONFIG_WIRELESS=y 399CONFIG_WIRELESS=y
392# CONFIG_CFG80211 is not set 400# CONFIG_CFG80211 is not set
401CONFIG_CFG80211_DEFAULT_PS_VALUE=0
393CONFIG_WIRELESS_OLD_REGULATORY=y 402CONFIG_WIRELESS_OLD_REGULATORY=y
394# CONFIG_WIRELESS_EXT is not set 403# CONFIG_WIRELESS_EXT is not set
395# CONFIG_LIB80211 is not set 404# CONFIG_LIB80211 is not set
@@ -397,7 +406,6 @@ CONFIG_WIRELESS_OLD_REGULATORY=y
397# 406#
398# CFG80211 needs to be enabled for MAC80211 407# CFG80211 needs to be enabled for MAC80211
399# 408#
400CONFIG_MAC80211_DEFAULT_PS_VALUE=0
401# CONFIG_WIMAX is not set 409# CONFIG_WIMAX is not set
402# CONFIG_RFKILL is not set 410# CONFIG_RFKILL is not set
403# CONFIG_NET_9P is not set 411# CONFIG_NET_9P is not set
@@ -410,6 +418,7 @@ CONFIG_MAC80211_DEFAULT_PS_VALUE=0
410# Generic Driver Options 418# Generic Driver Options
411# 419#
412CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug" 420CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
421# CONFIG_DEVTMPFS is not set
413CONFIG_STANDALONE=y 422CONFIG_STANDALONE=y
414CONFIG_PREVENT_FIRMWARE_BUILD=y 423CONFIG_PREVENT_FIRMWARE_BUILD=y
415# CONFIG_FW_LOADER is not set 424# CONFIG_FW_LOADER is not set
@@ -530,7 +539,9 @@ CONFIG_MII=y
530# CONFIG_NET_PCI is not set 539# CONFIG_NET_PCI is not set
531# CONFIG_B44 is not set 540# CONFIG_B44 is not set
532# CONFIG_KS8842 is not set 541# CONFIG_KS8842 is not set
542# CONFIG_KS8851_MLL is not set
533# CONFIG_ATL2 is not set 543# CONFIG_ATL2 is not set
544# CONFIG_XILINX_EMACLITE is not set
534CONFIG_FS_ENET=y 545CONFIG_FS_ENET=y
535# CONFIG_FS_ENET_HAS_SCC is not set 546# CONFIG_FS_ENET_HAS_SCC is not set
536CONFIG_FS_ENET_HAS_FCC=y 547CONFIG_FS_ENET_HAS_FCC=y
@@ -582,10 +593,7 @@ CONFIG_CHELSIO_T3_DEPENDS=y
582# CONFIG_SFC is not set 593# CONFIG_SFC is not set
583# CONFIG_BE2NET is not set 594# CONFIG_BE2NET is not set
584# CONFIG_TR is not set 595# CONFIG_TR is not set
585 596CONFIG_WLAN=y
586#
587# Wireless LAN
588#
589# CONFIG_WLAN_PRE80211 is not set 597# CONFIG_WLAN_PRE80211 is not set
590# CONFIG_WLAN_80211 is not set 598# CONFIG_WLAN_80211 is not set
591 599
@@ -698,14 +706,24 @@ CONFIG_GPIOLIB=y
698# PCI GPIO expanders: 706# PCI GPIO expanders:
699# 707#
700# CONFIG_GPIO_BT8XX is not set 708# CONFIG_GPIO_BT8XX is not set
709# CONFIG_GPIO_LANGWELL is not set
701 710
702# 711#
703# SPI GPIO expanders: 712# SPI GPIO expanders:
704# 713#
714
715#
716# AC97 GPIO expanders:
717#
705# CONFIG_W1 is not set 718# CONFIG_W1 is not set
706# CONFIG_POWER_SUPPLY is not set 719# CONFIG_POWER_SUPPLY is not set
707CONFIG_HWMON=y 720CONFIG_HWMON=y
708# CONFIG_HWMON_VID is not set 721# CONFIG_HWMON_VID is not set
722# CONFIG_HWMON_DEBUG_CHIP is not set
723
724#
725# Native drivers
726#
709# CONFIG_SENSORS_I5K_AMB is not set 727# CONFIG_SENSORS_I5K_AMB is not set
710# CONFIG_SENSORS_F71805F is not set 728# CONFIG_SENSORS_F71805F is not set
711# CONFIG_SENSORS_F71882FG is not set 729# CONFIG_SENSORS_F71882FG is not set
@@ -721,9 +739,7 @@ CONFIG_HWMON=y
721# CONFIG_SENSORS_VT8231 is not set 739# CONFIG_SENSORS_VT8231 is not set
722# CONFIG_SENSORS_W83627HF is not set 740# CONFIG_SENSORS_W83627HF is not set
723# CONFIG_SENSORS_W83627EHF is not set 741# CONFIG_SENSORS_W83627EHF is not set
724# CONFIG_HWMON_DEBUG_CHIP is not set
725# CONFIG_THERMAL is not set 742# CONFIG_THERMAL is not set
726# CONFIG_THERMAL_HWMON is not set
727# CONFIG_WATCHDOG is not set 743# CONFIG_WATCHDOG is not set
728CONFIG_SSB_POSSIBLE=y 744CONFIG_SSB_POSSIBLE=y
729 745
@@ -746,6 +762,7 @@ CONFIG_SSB_POSSIBLE=y
746# Graphics support 762# Graphics support
747# 763#
748# CONFIG_AGP is not set 764# CONFIG_AGP is not set
765CONFIG_VGA_ARB=y
749# CONFIG_DRM is not set 766# CONFIG_DRM is not set
750# CONFIG_VGASTATE is not set 767# CONFIG_VGASTATE is not set
751CONFIG_VIDEO_OUTPUT_CONTROL=y 768CONFIG_VIDEO_OUTPUT_CONTROL=y
@@ -759,7 +776,6 @@ CONFIG_VIDEO_OUTPUT_CONTROL=y
759# CONFIG_SOUND is not set 776# CONFIG_SOUND is not set
760CONFIG_HID_SUPPORT=y 777CONFIG_HID_SUPPORT=y
761CONFIG_HID=y 778CONFIG_HID=y
762# CONFIG_HID_DEBUG is not set
763# CONFIG_HIDRAW is not set 779# CONFIG_HIDRAW is not set
764# CONFIG_HID_PID is not set 780# CONFIG_HID_PID is not set
765 781
@@ -824,6 +840,7 @@ CONFIG_FS_MBCACHE=y
824# CONFIG_GFS2_FS is not set 840# CONFIG_GFS2_FS is not set
825# CONFIG_OCFS2_FS is not set 841# CONFIG_OCFS2_FS is not set
826# CONFIG_BTRFS_FS is not set 842# CONFIG_BTRFS_FS is not set
843# CONFIG_NILFS2_FS is not set
827CONFIG_FILE_LOCKING=y 844CONFIG_FILE_LOCKING=y
828CONFIG_FSNOTIFY=y 845CONFIG_FSNOTIFY=y
829CONFIG_DNOTIFY=y 846CONFIG_DNOTIFY=y
@@ -882,7 +899,6 @@ CONFIG_MISC_FILESYSTEMS=y
882# CONFIG_ROMFS_FS is not set 899# CONFIG_ROMFS_FS is not set
883# CONFIG_SYSV_FS is not set 900# CONFIG_SYSV_FS is not set
884# CONFIG_UFS_FS is not set 901# CONFIG_UFS_FS is not set
885# CONFIG_NILFS2_FS is not set
886CONFIG_NETWORK_FILESYSTEMS=y 902CONFIG_NETWORK_FILESYSTEMS=y
887CONFIG_NFS_FS=y 903CONFIG_NFS_FS=y
888# CONFIG_NFS_V3 is not set 904# CONFIG_NFS_V3 is not set
@@ -950,6 +966,7 @@ CONFIG_ENABLE_WARN_DEPRECATED=y
950CONFIG_ENABLE_MUST_CHECK=y 966CONFIG_ENABLE_MUST_CHECK=y
951CONFIG_FRAME_WARN=1024 967CONFIG_FRAME_WARN=1024
952# CONFIG_MAGIC_SYSRQ is not set 968# CONFIG_MAGIC_SYSRQ is not set
969# CONFIG_STRIP_ASM_SYMS is not set
953# CONFIG_UNUSED_SYMBOLS is not set 970# CONFIG_UNUSED_SYMBOLS is not set
954# CONFIG_DEBUG_FS is not set 971# CONFIG_DEBUG_FS is not set
955# CONFIG_HEADERS_CHECK is not set 972# CONFIG_HEADERS_CHECK is not set
@@ -967,6 +984,7 @@ CONFIG_SCHED_DEBUG=y
967# CONFIG_DEBUG_OBJECTS is not set 984# CONFIG_DEBUG_OBJECTS is not set
968# CONFIG_SLUB_DEBUG_ON is not set 985# CONFIG_SLUB_DEBUG_ON is not set
969# CONFIG_SLUB_STATS is not set 986# CONFIG_SLUB_STATS is not set
987# CONFIG_DEBUG_KMEMLEAK is not set
970# CONFIG_DEBUG_RT_MUTEXES is not set 988# CONFIG_DEBUG_RT_MUTEXES is not set
971# CONFIG_RT_MUTEX_TESTER is not set 989# CONFIG_RT_MUTEX_TESTER is not set
972# CONFIG_DEBUG_SPINLOCK is not set 990# CONFIG_DEBUG_SPINLOCK is not set
@@ -985,10 +1003,12 @@ CONFIG_DEBUG_MUTEXES=y
985# CONFIG_DEBUG_LIST is not set 1003# CONFIG_DEBUG_LIST is not set
986# CONFIG_DEBUG_SG is not set 1004# CONFIG_DEBUG_SG is not set
987# CONFIG_DEBUG_NOTIFIERS is not set 1005# CONFIG_DEBUG_NOTIFIERS is not set
1006# CONFIG_DEBUG_CREDENTIALS is not set
988# CONFIG_RCU_TORTURE_TEST is not set 1007# CONFIG_RCU_TORTURE_TEST is not set
989# CONFIG_RCU_CPU_STALL_DETECTOR is not set 1008# CONFIG_RCU_CPU_STALL_DETECTOR is not set
990# CONFIG_BACKTRACE_SELF_TEST is not set 1009# CONFIG_BACKTRACE_SELF_TEST is not set
991# CONFIG_DEBUG_BLOCK_EXT_DEVT is not set 1010# CONFIG_DEBUG_BLOCK_EXT_DEVT is not set
1011# CONFIG_DEBUG_FORCE_WEAK_PER_CPU is not set
992# CONFIG_FAULT_INJECTION is not set 1012# CONFIG_FAULT_INJECTION is not set
993# CONFIG_LATENCYTOP is not set 1013# CONFIG_LATENCYTOP is not set
994CONFIG_SYSCTL_SYSCALL_CHECK=y 1014CONFIG_SYSCTL_SYSCALL_CHECK=y
@@ -1011,10 +1031,10 @@ CONFIG_BRANCH_PROFILE_NONE=y
1011# CONFIG_KMEMTRACE is not set 1031# CONFIG_KMEMTRACE is not set
1012# CONFIG_WORKQUEUE_TRACER is not set 1032# CONFIG_WORKQUEUE_TRACER is not set
1013# CONFIG_BLK_DEV_IO_TRACE is not set 1033# CONFIG_BLK_DEV_IO_TRACE is not set
1034# CONFIG_DMA_API_DEBUG is not set
1014# CONFIG_SAMPLES is not set 1035# CONFIG_SAMPLES is not set
1015CONFIG_HAVE_ARCH_KGDB=y 1036CONFIG_HAVE_ARCH_KGDB=y
1016# CONFIG_KGDB is not set 1037# CONFIG_KGDB is not set
1017# CONFIG_KMEMCHECK is not set
1018# CONFIG_PPC_DISABLE_WERROR is not set 1038# CONFIG_PPC_DISABLE_WERROR is not set
1019CONFIG_PPC_WERROR=y 1039CONFIG_PPC_WERROR=y
1020CONFIG_PRINT_STACK_DEPTH=64 1040CONFIG_PRINT_STACK_DEPTH=64
@@ -1040,7 +1060,6 @@ CONFIG_CRYPTO=y
1040# 1060#
1041# Crypto core or helper 1061# Crypto core or helper
1042# 1062#
1043# CONFIG_CRYPTO_FIPS is not set
1044# CONFIG_CRYPTO_MANAGER is not set 1063# CONFIG_CRYPTO_MANAGER is not set
1045# CONFIG_CRYPTO_MANAGER2 is not set 1064# CONFIG_CRYPTO_MANAGER2 is not set
1046# CONFIG_CRYPTO_GF128MUL is not set 1065# CONFIG_CRYPTO_GF128MUL is not set
@@ -1071,11 +1090,13 @@ CONFIG_CRYPTO=y
1071# 1090#
1072# CONFIG_CRYPTO_HMAC is not set 1091# CONFIG_CRYPTO_HMAC is not set
1073# CONFIG_CRYPTO_XCBC is not set 1092# CONFIG_CRYPTO_XCBC is not set
1093# CONFIG_CRYPTO_VMAC is not set
1074 1094
1075# 1095#
1076# Digest 1096# Digest
1077# 1097#
1078# CONFIG_CRYPTO_CRC32C is not set 1098# CONFIG_CRYPTO_CRC32C is not set
1099# CONFIG_CRYPTO_GHASH is not set
1079# CONFIG_CRYPTO_MD4 is not set 1100# CONFIG_CRYPTO_MD4 is not set
1080# CONFIG_CRYPTO_MD5 is not set 1101# CONFIG_CRYPTO_MD5 is not set
1081# CONFIG_CRYPTO_MICHAEL_MIC is not set 1102# CONFIG_CRYPTO_MICHAEL_MIC is not set
diff --git a/arch/powerpc/configs/85xx/mpc85xx_cds_defconfig b/arch/powerpc/configs/85xx/mpc85xx_cds_defconfig
index 158e63e8607f..9b63e258dac6 100644
--- a/arch/powerpc/configs/85xx/mpc85xx_cds_defconfig
+++ b/arch/powerpc/configs/85xx/mpc85xx_cds_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.31-rc4 3# Linux kernel version: 2.6.32-rc5
4# Wed Jul 29 23:32:17 2009 4# Thu Nov 5 08:20:35 2009
5# 5#
6# CONFIG_PPC64 is not set 6# CONFIG_PPC64 is not set
7 7
@@ -22,6 +22,7 @@ CONFIG_FSL_EMB_PERFMON=y
22# CONFIG_PHYS_64BIT is not set 22# CONFIG_PHYS_64BIT is not set
23CONFIG_SPE=y 23CONFIG_SPE=y
24CONFIG_PPC_MMU_NOHASH=y 24CONFIG_PPC_MMU_NOHASH=y
25CONFIG_PPC_MMU_NOHASH_32=y
25CONFIG_PPC_BOOK3E_MMU=y 26CONFIG_PPC_BOOK3E_MMU=y
26# CONFIG_PPC_MM_SLICES is not set 27# CONFIG_PPC_MM_SLICES is not set
27# CONFIG_SMP is not set 28# CONFIG_SMP is not set
@@ -36,6 +37,7 @@ CONFIG_GENERIC_CLOCKEVENTS=y
36CONFIG_GENERIC_HARDIRQS=y 37CONFIG_GENERIC_HARDIRQS=y
37CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=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
40# CONFIG_NEED_PER_CPU_EMBED_FIRST_CHUNK is not set
39CONFIG_IRQ_PER_CPU=y 41CONFIG_IRQ_PER_CPU=y
40CONFIG_STACKTRACE_SUPPORT=y 42CONFIG_STACKTRACE_SUPPORT=y
41CONFIG_HAVE_LATENCYTOP_SUPPORT=y 43CONFIG_HAVE_LATENCYTOP_SUPPORT=y
@@ -84,11 +86,12 @@ CONFIG_SYSVIPC_SYSCTL=y
84# 86#
85# RCU Subsystem 87# RCU Subsystem
86# 88#
87CONFIG_CLASSIC_RCU=y 89CONFIG_TREE_RCU=y
88# CONFIG_TREE_RCU is not set 90# CONFIG_TREE_PREEMPT_RCU is not set
89# CONFIG_PREEMPT_RCU is not set 91# CONFIG_RCU_TRACE is not set
92CONFIG_RCU_FANOUT=32
93# CONFIG_RCU_FANOUT_EXACT is not set
90# CONFIG_TREE_RCU_TRACE is not set 94# CONFIG_TREE_RCU_TRACE is not set
91# CONFIG_PREEMPT_RCU_TRACE is not set
92# CONFIG_IKCONFIG is not set 95# CONFIG_IKCONFIG is not set
93CONFIG_LOG_BUF_SHIFT=14 96CONFIG_LOG_BUF_SHIFT=14
94CONFIG_GROUP_SCHED=y 97CONFIG_GROUP_SCHED=y
@@ -126,28 +129,29 @@ CONFIG_TIMERFD=y
126CONFIG_EVENTFD=y 129CONFIG_EVENTFD=y
127CONFIG_SHMEM=y 130CONFIG_SHMEM=y
128CONFIG_AIO=y 131CONFIG_AIO=y
129CONFIG_HAVE_PERF_COUNTERS=y 132CONFIG_HAVE_PERF_EVENTS=y
130 133
131# 134#
132# Performance Counters 135# Kernel Performance Events And Counters
133# 136#
137# CONFIG_PERF_EVENTS is not set
134# CONFIG_PERF_COUNTERS is not set 138# CONFIG_PERF_COUNTERS is not set
135CONFIG_VM_EVENT_COUNTERS=y 139CONFIG_VM_EVENT_COUNTERS=y
136CONFIG_PCI_QUIRKS=y 140CONFIG_PCI_QUIRKS=y
137CONFIG_SLUB_DEBUG=y 141CONFIG_SLUB_DEBUG=y
138# CONFIG_STRIP_ASM_SYMS is not set
139CONFIG_COMPAT_BRK=y 142CONFIG_COMPAT_BRK=y
140# CONFIG_SLAB is not set 143# CONFIG_SLAB is not set
141CONFIG_SLUB=y 144CONFIG_SLUB=y
142# CONFIG_SLOB is not set 145# CONFIG_SLOB is not set
143# CONFIG_PROFILING is not set 146# CONFIG_PROFILING is not set
144# CONFIG_MARKERS is not set
145CONFIG_HAVE_OPROFILE=y 147CONFIG_HAVE_OPROFILE=y
146CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS=y 148CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS=y
147CONFIG_HAVE_IOREMAP_PROT=y 149CONFIG_HAVE_IOREMAP_PROT=y
148CONFIG_HAVE_KPROBES=y 150CONFIG_HAVE_KPROBES=y
149CONFIG_HAVE_KRETPROBES=y 151CONFIG_HAVE_KRETPROBES=y
150CONFIG_HAVE_ARCH_TRACEHOOK=y 152CONFIG_HAVE_ARCH_TRACEHOOK=y
153CONFIG_HAVE_DMA_ATTRS=y
154CONFIG_HAVE_DMA_API_DEBUG=y
151 155
152# 156#
153# GCOV-based kernel profiling 157# GCOV-based kernel profiling
@@ -190,6 +194,7 @@ CONFIG_MPC85xx_CDS=y
190# CONFIG_MPC85xx_MDS is not set 194# CONFIG_MPC85xx_MDS is not set
191# CONFIG_MPC8536_DS is not set 195# CONFIG_MPC8536_DS is not set
192# CONFIG_MPC85xx_DS is not set 196# CONFIG_MPC85xx_DS is not set
197# CONFIG_MPC85xx_RDB is not set
193# CONFIG_SOCRATES is not set 198# CONFIG_SOCRATES is not set
194# CONFIG_KSI8560 is not set 199# CONFIG_KSI8560 is not set
195# CONFIG_XES_MPC85xx is not set 200# CONFIG_XES_MPC85xx is not set
@@ -245,6 +250,7 @@ CONFIG_MATH_EMULATION=y
245CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y 250CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y
246CONFIG_ARCH_HAS_WALK_MEMORY=y 251CONFIG_ARCH_HAS_WALK_MEMORY=y
247CONFIG_ARCH_ENABLE_MEMORY_HOTREMOVE=y 252CONFIG_ARCH_ENABLE_MEMORY_HOTREMOVE=y
253CONFIG_MAX_ACTIVE_REGIONS=32
248CONFIG_ARCH_FLATMEM_ENABLE=y 254CONFIG_ARCH_FLATMEM_ENABLE=y
249CONFIG_ARCH_POPULATES_NODE_MAP=y 255CONFIG_ARCH_POPULATES_NODE_MAP=y
250CONFIG_SELECT_MEMORY_MODEL=y 256CONFIG_SELECT_MEMORY_MODEL=y
@@ -262,6 +268,7 @@ CONFIG_BOUNCE=y
262CONFIG_VIRT_TO_BUS=y 268CONFIG_VIRT_TO_BUS=y
263CONFIG_HAVE_MLOCK=y 269CONFIG_HAVE_MLOCK=y
264CONFIG_HAVE_MLOCKED_PAGE_BIT=y 270CONFIG_HAVE_MLOCKED_PAGE_BIT=y
271# CONFIG_KSM is not set
265CONFIG_DEFAULT_MMAP_MIN_ADDR=4096 272CONFIG_DEFAULT_MMAP_MIN_ADDR=4096
266CONFIG_PPC_4K_PAGES=y 273CONFIG_PPC_4K_PAGES=y
267# CONFIG_PPC_16K_PAGES is not set 274# CONFIG_PPC_16K_PAGES is not set
@@ -359,6 +366,7 @@ CONFIG_DEFAULT_TCP_CONG="cubic"
359# CONFIG_NETFILTER is not set 366# CONFIG_NETFILTER is not set
360# CONFIG_IP_DCCP is not set 367# CONFIG_IP_DCCP is not set
361# CONFIG_IP_SCTP is not set 368# CONFIG_IP_SCTP is not set
369# CONFIG_RDS is not set
362# CONFIG_TIPC is not set 370# CONFIG_TIPC is not set
363# CONFIG_ATM is not set 371# CONFIG_ATM is not set
364# CONFIG_BRIDGE is not set 372# CONFIG_BRIDGE is not set
@@ -388,6 +396,7 @@ CONFIG_DEFAULT_TCP_CONG="cubic"
388# CONFIG_AF_RXRPC is not set 396# CONFIG_AF_RXRPC is not set
389CONFIG_WIRELESS=y 397CONFIG_WIRELESS=y
390# CONFIG_CFG80211 is not set 398# CONFIG_CFG80211 is not set
399CONFIG_CFG80211_DEFAULT_PS_VALUE=0
391CONFIG_WIRELESS_OLD_REGULATORY=y 400CONFIG_WIRELESS_OLD_REGULATORY=y
392# CONFIG_WIRELESS_EXT is not set 401# CONFIG_WIRELESS_EXT is not set
393# CONFIG_LIB80211 is not set 402# CONFIG_LIB80211 is not set
@@ -395,7 +404,6 @@ CONFIG_WIRELESS_OLD_REGULATORY=y
395# 404#
396# CFG80211 needs to be enabled for MAC80211 405# CFG80211 needs to be enabled for MAC80211
397# 406#
398CONFIG_MAC80211_DEFAULT_PS_VALUE=0
399# CONFIG_WIMAX is not set 407# CONFIG_WIMAX is not set
400# CONFIG_RFKILL is not set 408# CONFIG_RFKILL is not set
401# CONFIG_NET_9P is not set 409# CONFIG_NET_9P is not set
@@ -408,6 +416,7 @@ CONFIG_MAC80211_DEFAULT_PS_VALUE=0
408# Generic Driver Options 416# Generic Driver Options
409# 417#
410CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug" 418CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
419# CONFIG_DEVTMPFS is not set
411CONFIG_STANDALONE=y 420CONFIG_STANDALONE=y
412CONFIG_PREVENT_FIRMWARE_BUILD=y 421CONFIG_PREVENT_FIRMWARE_BUILD=y
413# CONFIG_FW_LOADER is not set 422# CONFIG_FW_LOADER is not set
@@ -582,7 +591,9 @@ CONFIG_MII=y
582# CONFIG_NET_PCI is not set 591# CONFIG_NET_PCI is not set
583# CONFIG_B44 is not set 592# CONFIG_B44 is not set
584# CONFIG_KS8842 is not set 593# CONFIG_KS8842 is not set
594# CONFIG_KS8851_MLL is not set
585# CONFIG_ATL2 is not set 595# CONFIG_ATL2 is not set
596# CONFIG_XILINX_EMACLITE is not set
586CONFIG_NETDEV_1000=y 597CONFIG_NETDEV_1000=y
587# CONFIG_ACENIC is not set 598# CONFIG_ACENIC is not set
588# CONFIG_DL2K is not set 599# CONFIG_DL2K is not set
@@ -630,10 +641,7 @@ CONFIG_CHELSIO_T3_DEPENDS=y
630# CONFIG_SFC is not set 641# CONFIG_SFC is not set
631# CONFIG_BE2NET is not set 642# CONFIG_BE2NET is not set
632# CONFIG_TR is not set 643# CONFIG_TR is not set
633 644CONFIG_WLAN=y
634#
635# Wireless LAN
636#
637# CONFIG_WLAN_PRE80211 is not set 645# CONFIG_WLAN_PRE80211 is not set
638# CONFIG_WLAN_80211 is not set 646# CONFIG_WLAN_80211 is not set
639 647
@@ -737,6 +745,11 @@ CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y
737# CONFIG_POWER_SUPPLY is not set 745# CONFIG_POWER_SUPPLY is not set
738CONFIG_HWMON=y 746CONFIG_HWMON=y
739# CONFIG_HWMON_VID is not set 747# CONFIG_HWMON_VID is not set
748# CONFIG_HWMON_DEBUG_CHIP is not set
749
750#
751# Native drivers
752#
740# CONFIG_SENSORS_I5K_AMB is not set 753# CONFIG_SENSORS_I5K_AMB is not set
741# CONFIG_SENSORS_F71805F is not set 754# CONFIG_SENSORS_F71805F is not set
742# CONFIG_SENSORS_F71882FG is not set 755# CONFIG_SENSORS_F71882FG is not set
@@ -751,9 +764,7 @@ CONFIG_HWMON=y
751# CONFIG_SENSORS_VT8231 is not set 764# CONFIG_SENSORS_VT8231 is not set
752# CONFIG_SENSORS_W83627HF is not set 765# CONFIG_SENSORS_W83627HF is not set
753# CONFIG_SENSORS_W83627EHF is not set 766# CONFIG_SENSORS_W83627EHF is not set
754# CONFIG_HWMON_DEBUG_CHIP is not set
755# CONFIG_THERMAL is not set 767# CONFIG_THERMAL is not set
756# CONFIG_THERMAL_HWMON is not set
757# CONFIG_WATCHDOG is not set 768# CONFIG_WATCHDOG is not set
758CONFIG_SSB_POSSIBLE=y 769CONFIG_SSB_POSSIBLE=y
759 770
@@ -776,6 +787,7 @@ CONFIG_SSB_POSSIBLE=y
776# Graphics support 787# Graphics support
777# 788#
778# CONFIG_AGP is not set 789# CONFIG_AGP is not set
790CONFIG_VGA_ARB=y
779# CONFIG_DRM is not set 791# CONFIG_DRM is not set
780# CONFIG_VGASTATE is not set 792# CONFIG_VGASTATE is not set
781CONFIG_VIDEO_OUTPUT_CONTROL=y 793CONFIG_VIDEO_OUTPUT_CONTROL=y
@@ -789,7 +801,6 @@ CONFIG_VIDEO_OUTPUT_CONTROL=y
789# CONFIG_SOUND is not set 801# CONFIG_SOUND is not set
790CONFIG_HID_SUPPORT=y 802CONFIG_HID_SUPPORT=y
791CONFIG_HID=y 803CONFIG_HID=y
792# CONFIG_HID_DEBUG is not set
793# CONFIG_HIDRAW is not set 804# CONFIG_HIDRAW is not set
794# CONFIG_HID_PID is not set 805# CONFIG_HID_PID is not set
795 806
@@ -854,6 +865,7 @@ CONFIG_FS_MBCACHE=y
854# CONFIG_GFS2_FS is not set 865# CONFIG_GFS2_FS is not set
855# CONFIG_OCFS2_FS is not set 866# CONFIG_OCFS2_FS is not set
856# CONFIG_BTRFS_FS is not set 867# CONFIG_BTRFS_FS is not set
868# CONFIG_NILFS2_FS is not set
857CONFIG_FILE_LOCKING=y 869CONFIG_FILE_LOCKING=y
858CONFIG_FSNOTIFY=y 870CONFIG_FSNOTIFY=y
859CONFIG_DNOTIFY=y 871CONFIG_DNOTIFY=y
@@ -912,7 +924,6 @@ CONFIG_MISC_FILESYSTEMS=y
912# CONFIG_ROMFS_FS is not set 924# CONFIG_ROMFS_FS is not set
913# CONFIG_SYSV_FS is not set 925# CONFIG_SYSV_FS is not set
914# CONFIG_UFS_FS is not set 926# CONFIG_UFS_FS is not set
915# CONFIG_NILFS2_FS is not set
916CONFIG_NETWORK_FILESYSTEMS=y 927CONFIG_NETWORK_FILESYSTEMS=y
917CONFIG_NFS_FS=y 928CONFIG_NFS_FS=y
918# CONFIG_NFS_V3 is not set 929# CONFIG_NFS_V3 is not set
@@ -980,6 +991,7 @@ CONFIG_ENABLE_WARN_DEPRECATED=y
980CONFIG_ENABLE_MUST_CHECK=y 991CONFIG_ENABLE_MUST_CHECK=y
981CONFIG_FRAME_WARN=1024 992CONFIG_FRAME_WARN=1024
982# CONFIG_MAGIC_SYSRQ is not set 993# CONFIG_MAGIC_SYSRQ is not set
994# CONFIG_STRIP_ASM_SYMS is not set
983# CONFIG_UNUSED_SYMBOLS is not set 995# CONFIG_UNUSED_SYMBOLS is not set
984# CONFIG_DEBUG_FS is not set 996# CONFIG_DEBUG_FS is not set
985# CONFIG_HEADERS_CHECK is not set 997# CONFIG_HEADERS_CHECK is not set
@@ -997,6 +1009,7 @@ CONFIG_SCHED_DEBUG=y
997# CONFIG_DEBUG_OBJECTS is not set 1009# CONFIG_DEBUG_OBJECTS is not set
998# CONFIG_SLUB_DEBUG_ON is not set 1010# CONFIG_SLUB_DEBUG_ON is not set
999# CONFIG_SLUB_STATS is not set 1011# CONFIG_SLUB_STATS is not set
1012# CONFIG_DEBUG_KMEMLEAK is not set
1000# CONFIG_DEBUG_RT_MUTEXES is not set 1013# CONFIG_DEBUG_RT_MUTEXES is not set
1001# CONFIG_RT_MUTEX_TESTER is not set 1014# CONFIG_RT_MUTEX_TESTER is not set
1002# CONFIG_DEBUG_SPINLOCK is not set 1015# CONFIG_DEBUG_SPINLOCK is not set
@@ -1015,10 +1028,12 @@ CONFIG_DEBUG_MUTEXES=y
1015# CONFIG_DEBUG_LIST is not set 1028# CONFIG_DEBUG_LIST is not set
1016# CONFIG_DEBUG_SG is not set 1029# CONFIG_DEBUG_SG is not set
1017# CONFIG_DEBUG_NOTIFIERS is not set 1030# CONFIG_DEBUG_NOTIFIERS is not set
1031# CONFIG_DEBUG_CREDENTIALS is not set
1018# CONFIG_RCU_TORTURE_TEST is not set 1032# CONFIG_RCU_TORTURE_TEST is not set
1019# CONFIG_RCU_CPU_STALL_DETECTOR is not set 1033# CONFIG_RCU_CPU_STALL_DETECTOR is not set
1020# CONFIG_BACKTRACE_SELF_TEST is not set 1034# CONFIG_BACKTRACE_SELF_TEST is not set
1021# CONFIG_DEBUG_BLOCK_EXT_DEVT is not set 1035# CONFIG_DEBUG_BLOCK_EXT_DEVT is not set
1036# CONFIG_DEBUG_FORCE_WEAK_PER_CPU is not set
1022# CONFIG_FAULT_INJECTION is not set 1037# CONFIG_FAULT_INJECTION is not set
1023# CONFIG_LATENCYTOP is not set 1038# CONFIG_LATENCYTOP is not set
1024CONFIG_SYSCTL_SYSCALL_CHECK=y 1039CONFIG_SYSCTL_SYSCALL_CHECK=y
@@ -1041,10 +1056,10 @@ CONFIG_BRANCH_PROFILE_NONE=y
1041# CONFIG_KMEMTRACE is not set 1056# CONFIG_KMEMTRACE is not set
1042# CONFIG_WORKQUEUE_TRACER is not set 1057# CONFIG_WORKQUEUE_TRACER is not set
1043# CONFIG_BLK_DEV_IO_TRACE is not set 1058# CONFIG_BLK_DEV_IO_TRACE is not set
1059# CONFIG_DMA_API_DEBUG is not set
1044# CONFIG_SAMPLES is not set 1060# CONFIG_SAMPLES is not set
1045CONFIG_HAVE_ARCH_KGDB=y 1061CONFIG_HAVE_ARCH_KGDB=y
1046# CONFIG_KGDB is not set 1062# CONFIG_KGDB is not set
1047# CONFIG_KMEMCHECK is not set
1048# CONFIG_PPC_DISABLE_WERROR is not set 1063# CONFIG_PPC_DISABLE_WERROR is not set
1049CONFIG_PPC_WERROR=y 1064CONFIG_PPC_WERROR=y
1050CONFIG_PRINT_STACK_DEPTH=64 1065CONFIG_PRINT_STACK_DEPTH=64
@@ -1070,7 +1085,6 @@ CONFIG_CRYPTO=y
1070# 1085#
1071# Crypto core or helper 1086# Crypto core or helper
1072# 1087#
1073# CONFIG_CRYPTO_FIPS is not set
1074# CONFIG_CRYPTO_MANAGER is not set 1088# CONFIG_CRYPTO_MANAGER is not set
1075# CONFIG_CRYPTO_MANAGER2 is not set 1089# CONFIG_CRYPTO_MANAGER2 is not set
1076# CONFIG_CRYPTO_GF128MUL is not set 1090# CONFIG_CRYPTO_GF128MUL is not set
@@ -1101,11 +1115,13 @@ CONFIG_CRYPTO=y
1101# 1115#
1102# CONFIG_CRYPTO_HMAC is not set 1116# CONFIG_CRYPTO_HMAC is not set
1103# CONFIG_CRYPTO_XCBC is not set 1117# CONFIG_CRYPTO_XCBC is not set
1118# CONFIG_CRYPTO_VMAC is not set
1104 1119
1105# 1120#
1106# Digest 1121# Digest
1107# 1122#
1108# CONFIG_CRYPTO_CRC32C is not set 1123# CONFIG_CRYPTO_CRC32C is not set
1124# CONFIG_CRYPTO_GHASH is not set
1109# CONFIG_CRYPTO_MD4 is not set 1125# CONFIG_CRYPTO_MD4 is not set
1110# CONFIG_CRYPTO_MD5 is not set 1126# CONFIG_CRYPTO_MD5 is not set
1111# CONFIG_CRYPTO_MICHAEL_MIC is not set 1127# CONFIG_CRYPTO_MICHAEL_MIC is not set
diff --git a/arch/powerpc/configs/85xx/sbc8548_defconfig b/arch/powerpc/configs/85xx/sbc8548_defconfig
index 2726fca1d694..1b2356830173 100644
--- a/arch/powerpc/configs/85xx/sbc8548_defconfig
+++ b/arch/powerpc/configs/85xx/sbc8548_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.31-rc4 3# Linux kernel version: 2.6.32-rc5
4# Wed Jul 29 23:32:18 2009 4# Thu Nov 5 08:20:36 2009
5# 5#
6# CONFIG_PPC64 is not set 6# CONFIG_PPC64 is not set
7 7
@@ -22,6 +22,7 @@ CONFIG_FSL_EMB_PERFMON=y
22# CONFIG_PHYS_64BIT is not set 22# CONFIG_PHYS_64BIT is not set
23CONFIG_SPE=y 23CONFIG_SPE=y
24CONFIG_PPC_MMU_NOHASH=y 24CONFIG_PPC_MMU_NOHASH=y
25CONFIG_PPC_MMU_NOHASH_32=y
25CONFIG_PPC_BOOK3E_MMU=y 26CONFIG_PPC_BOOK3E_MMU=y
26# CONFIG_PPC_MM_SLICES is not set 27# CONFIG_PPC_MM_SLICES is not set
27# CONFIG_SMP is not set 28# CONFIG_SMP is not set
@@ -36,6 +37,7 @@ CONFIG_GENERIC_CLOCKEVENTS=y
36CONFIG_GENERIC_HARDIRQS=y 37CONFIG_GENERIC_HARDIRQS=y
37CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=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
40# CONFIG_NEED_PER_CPU_EMBED_FIRST_CHUNK is not set
39CONFIG_IRQ_PER_CPU=y 41CONFIG_IRQ_PER_CPU=y
40CONFIG_STACKTRACE_SUPPORT=y 42CONFIG_STACKTRACE_SUPPORT=y
41CONFIG_HAVE_LATENCYTOP_SUPPORT=y 43CONFIG_HAVE_LATENCYTOP_SUPPORT=y
@@ -84,11 +86,12 @@ CONFIG_SYSVIPC_SYSCTL=y
84# 86#
85# RCU Subsystem 87# RCU Subsystem
86# 88#
87CONFIG_CLASSIC_RCU=y 89CONFIG_TREE_RCU=y
88# CONFIG_TREE_RCU is not set 90# CONFIG_TREE_PREEMPT_RCU is not set
89# CONFIG_PREEMPT_RCU is not set 91# CONFIG_RCU_TRACE is not set
92CONFIG_RCU_FANOUT=32
93# CONFIG_RCU_FANOUT_EXACT is not set
90# CONFIG_TREE_RCU_TRACE is not set 94# CONFIG_TREE_RCU_TRACE is not set
91# CONFIG_PREEMPT_RCU_TRACE is not set
92# CONFIG_IKCONFIG is not set 95# CONFIG_IKCONFIG is not set
93CONFIG_LOG_BUF_SHIFT=14 96CONFIG_LOG_BUF_SHIFT=14
94CONFIG_GROUP_SCHED=y 97CONFIG_GROUP_SCHED=y
@@ -125,27 +128,28 @@ CONFIG_TIMERFD=y
125CONFIG_EVENTFD=y 128CONFIG_EVENTFD=y
126CONFIG_SHMEM=y 129CONFIG_SHMEM=y
127CONFIG_AIO=y 130CONFIG_AIO=y
128CONFIG_HAVE_PERF_COUNTERS=y 131CONFIG_HAVE_PERF_EVENTS=y
129 132
130# 133#
131# Performance Counters 134# Kernel Performance Events And Counters
132# 135#
136# CONFIG_PERF_EVENTS is not set
133# CONFIG_PERF_COUNTERS is not set 137# CONFIG_PERF_COUNTERS is not set
134CONFIG_VM_EVENT_COUNTERS=y 138CONFIG_VM_EVENT_COUNTERS=y
135CONFIG_PCI_QUIRKS=y 139CONFIG_PCI_QUIRKS=y
136# CONFIG_STRIP_ASM_SYMS is not set
137CONFIG_COMPAT_BRK=y 140CONFIG_COMPAT_BRK=y
138CONFIG_SLAB=y 141CONFIG_SLAB=y
139# CONFIG_SLUB is not set 142# CONFIG_SLUB is not set
140# CONFIG_SLOB is not set 143# CONFIG_SLOB is not set
141# CONFIG_PROFILING is not set 144# CONFIG_PROFILING is not set
142# CONFIG_MARKERS is not set
143CONFIG_HAVE_OPROFILE=y 145CONFIG_HAVE_OPROFILE=y
144CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS=y 146CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS=y
145CONFIG_HAVE_IOREMAP_PROT=y 147CONFIG_HAVE_IOREMAP_PROT=y
146CONFIG_HAVE_KPROBES=y 148CONFIG_HAVE_KPROBES=y
147CONFIG_HAVE_KRETPROBES=y 149CONFIG_HAVE_KRETPROBES=y
148CONFIG_HAVE_ARCH_TRACEHOOK=y 150CONFIG_HAVE_ARCH_TRACEHOOK=y
151CONFIG_HAVE_DMA_ATTRS=y
152CONFIG_HAVE_DMA_API_DEBUG=y
149 153
150# 154#
151# GCOV-based kernel profiling 155# GCOV-based kernel profiling
@@ -188,6 +192,7 @@ CONFIG_MPC85xx=y
188# CONFIG_MPC85xx_MDS is not set 192# CONFIG_MPC85xx_MDS is not set
189# CONFIG_MPC8536_DS is not set 193# CONFIG_MPC8536_DS is not set
190# CONFIG_MPC85xx_DS is not set 194# CONFIG_MPC85xx_DS is not set
195# CONFIG_MPC85xx_RDB is not set
191# CONFIG_SOCRATES is not set 196# CONFIG_SOCRATES is not set
192# CONFIG_KSI8560 is not set 197# CONFIG_KSI8560 is not set
193# CONFIG_XES_MPC85xx is not set 198# CONFIG_XES_MPC85xx is not set
@@ -242,6 +247,7 @@ CONFIG_MATH_EMULATION=y
242CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y 247CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y
243CONFIG_ARCH_HAS_WALK_MEMORY=y 248CONFIG_ARCH_HAS_WALK_MEMORY=y
244CONFIG_ARCH_ENABLE_MEMORY_HOTREMOVE=y 249CONFIG_ARCH_ENABLE_MEMORY_HOTREMOVE=y
250CONFIG_MAX_ACTIVE_REGIONS=32
245CONFIG_ARCH_FLATMEM_ENABLE=y 251CONFIG_ARCH_FLATMEM_ENABLE=y
246CONFIG_ARCH_POPULATES_NODE_MAP=y 252CONFIG_ARCH_POPULATES_NODE_MAP=y
247CONFIG_SELECT_MEMORY_MODEL=y 253CONFIG_SELECT_MEMORY_MODEL=y
@@ -259,6 +265,7 @@ CONFIG_BOUNCE=y
259CONFIG_VIRT_TO_BUS=y 265CONFIG_VIRT_TO_BUS=y
260CONFIG_HAVE_MLOCK=y 266CONFIG_HAVE_MLOCK=y
261CONFIG_HAVE_MLOCKED_PAGE_BIT=y 267CONFIG_HAVE_MLOCKED_PAGE_BIT=y
268# CONFIG_KSM is not set
262CONFIG_DEFAULT_MMAP_MIN_ADDR=4096 269CONFIG_DEFAULT_MMAP_MIN_ADDR=4096
263CONFIG_PPC_4K_PAGES=y 270CONFIG_PPC_4K_PAGES=y
264# CONFIG_PPC_16K_PAGES is not set 271# CONFIG_PPC_16K_PAGES is not set
@@ -355,6 +362,7 @@ CONFIG_DEFAULT_TCP_CONG="cubic"
355# CONFIG_NETFILTER is not set 362# CONFIG_NETFILTER is not set
356# CONFIG_IP_DCCP is not set 363# CONFIG_IP_DCCP is not set
357# CONFIG_IP_SCTP is not set 364# CONFIG_IP_SCTP is not set
365# CONFIG_RDS is not set
358# CONFIG_TIPC is not set 366# CONFIG_TIPC is not set
359# CONFIG_ATM is not set 367# CONFIG_ATM is not set
360# CONFIG_BRIDGE is not set 368# CONFIG_BRIDGE is not set
@@ -384,6 +392,7 @@ CONFIG_DEFAULT_TCP_CONG="cubic"
384# CONFIG_AF_RXRPC is not set 392# CONFIG_AF_RXRPC is not set
385CONFIG_WIRELESS=y 393CONFIG_WIRELESS=y
386# CONFIG_CFG80211 is not set 394# CONFIG_CFG80211 is not set
395CONFIG_CFG80211_DEFAULT_PS_VALUE=0
387CONFIG_WIRELESS_OLD_REGULATORY=y 396CONFIG_WIRELESS_OLD_REGULATORY=y
388# CONFIG_WIRELESS_EXT is not set 397# CONFIG_WIRELESS_EXT is not set
389# CONFIG_LIB80211 is not set 398# CONFIG_LIB80211 is not set
@@ -391,7 +400,6 @@ CONFIG_WIRELESS_OLD_REGULATORY=y
391# 400#
392# CFG80211 needs to be enabled for MAC80211 401# CFG80211 needs to be enabled for MAC80211
393# 402#
394CONFIG_MAC80211_DEFAULT_PS_VALUE=0
395# CONFIG_WIMAX is not set 403# CONFIG_WIMAX is not set
396# CONFIG_RFKILL is not set 404# CONFIG_RFKILL is not set
397# CONFIG_NET_9P is not set 405# CONFIG_NET_9P is not set
@@ -404,6 +412,7 @@ CONFIG_MAC80211_DEFAULT_PS_VALUE=0
404# Generic Driver Options 412# Generic Driver Options
405# 413#
406CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug" 414CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
415# CONFIG_DEVTMPFS is not set
407CONFIG_STANDALONE=y 416CONFIG_STANDALONE=y
408CONFIG_PREVENT_FIRMWARE_BUILD=y 417CONFIG_PREVENT_FIRMWARE_BUILD=y
409# CONFIG_FW_LOADER is not set 418# CONFIG_FW_LOADER is not set
@@ -521,7 +530,9 @@ CONFIG_MII=y
521# CONFIG_NET_PCI is not set 530# CONFIG_NET_PCI is not set
522# CONFIG_B44 is not set 531# CONFIG_B44 is not set
523# CONFIG_KS8842 is not set 532# CONFIG_KS8842 is not set
533# CONFIG_KS8851_MLL is not set
524# CONFIG_ATL2 is not set 534# CONFIG_ATL2 is not set
535# CONFIG_XILINX_EMACLITE is not set
525CONFIG_NETDEV_1000=y 536CONFIG_NETDEV_1000=y
526# CONFIG_ACENIC is not set 537# CONFIG_ACENIC is not set
527# CONFIG_DL2K is not set 538# CONFIG_DL2K is not set
@@ -569,10 +580,7 @@ CONFIG_CHELSIO_T3_DEPENDS=y
569# CONFIG_SFC is not set 580# CONFIG_SFC is not set
570# CONFIG_BE2NET is not set 581# CONFIG_BE2NET is not set
571# CONFIG_TR is not set 582# CONFIG_TR is not set
572 583CONFIG_WLAN=y
573#
574# Wireless LAN
575#
576# CONFIG_WLAN_PRE80211 is not set 584# CONFIG_WLAN_PRE80211 is not set
577# CONFIG_WLAN_80211 is not set 585# CONFIG_WLAN_80211 is not set
578 586
@@ -676,6 +684,11 @@ CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y
676# CONFIG_POWER_SUPPLY is not set 684# CONFIG_POWER_SUPPLY is not set
677CONFIG_HWMON=y 685CONFIG_HWMON=y
678# CONFIG_HWMON_VID is not set 686# CONFIG_HWMON_VID is not set
687# CONFIG_HWMON_DEBUG_CHIP is not set
688
689#
690# Native drivers
691#
679# CONFIG_SENSORS_I5K_AMB is not set 692# CONFIG_SENSORS_I5K_AMB is not set
680# CONFIG_SENSORS_F71805F is not set 693# CONFIG_SENSORS_F71805F is not set
681# CONFIG_SENSORS_F71882FG is not set 694# CONFIG_SENSORS_F71882FG is not set
@@ -690,9 +703,7 @@ CONFIG_HWMON=y
690# CONFIG_SENSORS_VT8231 is not set 703# CONFIG_SENSORS_VT8231 is not set
691# CONFIG_SENSORS_W83627HF is not set 704# CONFIG_SENSORS_W83627HF is not set
692# CONFIG_SENSORS_W83627EHF is not set 705# CONFIG_SENSORS_W83627EHF is not set
693# CONFIG_HWMON_DEBUG_CHIP is not set
694# CONFIG_THERMAL is not set 706# CONFIG_THERMAL is not set
695# CONFIG_THERMAL_HWMON is not set
696# CONFIG_WATCHDOG is not set 707# CONFIG_WATCHDOG is not set
697CONFIG_SSB_POSSIBLE=y 708CONFIG_SSB_POSSIBLE=y
698 709
@@ -715,6 +726,7 @@ CONFIG_SSB_POSSIBLE=y
715# Graphics support 726# Graphics support
716# 727#
717# CONFIG_AGP is not set 728# CONFIG_AGP is not set
729CONFIG_VGA_ARB=y
718# CONFIG_DRM is not set 730# CONFIG_DRM is not set
719# CONFIG_VGASTATE is not set 731# CONFIG_VGASTATE is not set
720CONFIG_VIDEO_OUTPUT_CONTROL=y 732CONFIG_VIDEO_OUTPUT_CONTROL=y
@@ -758,6 +770,7 @@ CONFIG_VIDEO_OUTPUT_CONTROL=y
758# CONFIG_GFS2_FS is not set 770# CONFIG_GFS2_FS is not set
759# CONFIG_OCFS2_FS is not set 771# CONFIG_OCFS2_FS is not set
760# CONFIG_BTRFS_FS is not set 772# CONFIG_BTRFS_FS is not set
773# CONFIG_NILFS2_FS is not set
761CONFIG_FILE_LOCKING=y 774CONFIG_FILE_LOCKING=y
762CONFIG_FSNOTIFY=y 775CONFIG_FSNOTIFY=y
763CONFIG_DNOTIFY=y 776CONFIG_DNOTIFY=y
@@ -816,7 +829,6 @@ CONFIG_MISC_FILESYSTEMS=y
816# CONFIG_ROMFS_FS is not set 829# CONFIG_ROMFS_FS is not set
817# CONFIG_SYSV_FS is not set 830# CONFIG_SYSV_FS is not set
818# CONFIG_UFS_FS is not set 831# CONFIG_UFS_FS is not set
819# CONFIG_NILFS2_FS is not set
820CONFIG_NETWORK_FILESYSTEMS=y 832CONFIG_NETWORK_FILESYSTEMS=y
821CONFIG_NFS_FS=y 833CONFIG_NFS_FS=y
822# CONFIG_NFS_V3 is not set 834# CONFIG_NFS_V3 is not set
@@ -872,6 +884,7 @@ CONFIG_ENABLE_WARN_DEPRECATED=y
872CONFIG_ENABLE_MUST_CHECK=y 884CONFIG_ENABLE_MUST_CHECK=y
873CONFIG_FRAME_WARN=1024 885CONFIG_FRAME_WARN=1024
874# CONFIG_MAGIC_SYSRQ is not set 886# CONFIG_MAGIC_SYSRQ is not set
887# CONFIG_STRIP_ASM_SYMS is not set
875# CONFIG_UNUSED_SYMBOLS is not set 888# CONFIG_UNUSED_SYMBOLS is not set
876# CONFIG_DEBUG_FS is not set 889# CONFIG_DEBUG_FS is not set
877# CONFIG_HEADERS_CHECK is not set 890# CONFIG_HEADERS_CHECK is not set
@@ -887,6 +900,7 @@ CONFIG_HAVE_DYNAMIC_FTRACE=y
887CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y 900CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y
888CONFIG_TRACING_SUPPORT=y 901CONFIG_TRACING_SUPPORT=y
889# CONFIG_FTRACE is not set 902# CONFIG_FTRACE is not set
903# CONFIG_DMA_API_DEBUG is not set
890# CONFIG_SAMPLES is not set 904# CONFIG_SAMPLES is not set
891CONFIG_HAVE_ARCH_KGDB=y 905CONFIG_HAVE_ARCH_KGDB=y
892# CONFIG_PPC_DISABLE_WERROR is not set 906# CONFIG_PPC_DISABLE_WERROR is not set
@@ -907,7 +921,6 @@ CONFIG_CRYPTO=y
907# 921#
908# Crypto core or helper 922# Crypto core or helper
909# 923#
910# CONFIG_CRYPTO_FIPS is not set
911# CONFIG_CRYPTO_MANAGER is not set 924# CONFIG_CRYPTO_MANAGER is not set
912# CONFIG_CRYPTO_MANAGER2 is not set 925# CONFIG_CRYPTO_MANAGER2 is not set
913# CONFIG_CRYPTO_GF128MUL is not set 926# CONFIG_CRYPTO_GF128MUL is not set
@@ -938,11 +951,13 @@ CONFIG_CRYPTO=y
938# 951#
939# CONFIG_CRYPTO_HMAC is not set 952# CONFIG_CRYPTO_HMAC is not set
940# CONFIG_CRYPTO_XCBC is not set 953# CONFIG_CRYPTO_XCBC is not set
954# CONFIG_CRYPTO_VMAC is not set
941 955
942# 956#
943# Digest 957# Digest
944# 958#
945# CONFIG_CRYPTO_CRC32C is not set 959# CONFIG_CRYPTO_CRC32C is not set
960# CONFIG_CRYPTO_GHASH is not set
946# CONFIG_CRYPTO_MD4 is not set 961# CONFIG_CRYPTO_MD4 is not set
947# CONFIG_CRYPTO_MD5 is not set 962# CONFIG_CRYPTO_MD5 is not set
948# CONFIG_CRYPTO_MICHAEL_MIC is not set 963# CONFIG_CRYPTO_MICHAEL_MIC is not set
diff --git a/arch/powerpc/configs/85xx/sbc8560_defconfig b/arch/powerpc/configs/85xx/sbc8560_defconfig
index b0c469823b02..959d0281431b 100644
--- a/arch/powerpc/configs/85xx/sbc8560_defconfig
+++ b/arch/powerpc/configs/85xx/sbc8560_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.31-rc4 3# Linux kernel version: 2.6.32-rc5
4# Wed Jul 29 23:32:19 2009 4# Thu Nov 5 08:20:37 2009
5# 5#
6# CONFIG_PPC64 is not set 6# CONFIG_PPC64 is not set
7 7
@@ -22,6 +22,7 @@ CONFIG_FSL_EMB_PERFMON=y
22# CONFIG_PHYS_64BIT is not set 22# CONFIG_PHYS_64BIT is not set
23CONFIG_SPE=y 23CONFIG_SPE=y
24CONFIG_PPC_MMU_NOHASH=y 24CONFIG_PPC_MMU_NOHASH=y
25CONFIG_PPC_MMU_NOHASH_32=y
25CONFIG_PPC_BOOK3E_MMU=y 26CONFIG_PPC_BOOK3E_MMU=y
26# CONFIG_PPC_MM_SLICES is not set 27# CONFIG_PPC_MM_SLICES is not set
27# CONFIG_SMP is not set 28# CONFIG_SMP is not set
@@ -36,6 +37,7 @@ CONFIG_GENERIC_CLOCKEVENTS=y
36CONFIG_GENERIC_HARDIRQS=y 37CONFIG_GENERIC_HARDIRQS=y
37CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=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
40# CONFIG_NEED_PER_CPU_EMBED_FIRST_CHUNK is not set
39CONFIG_IRQ_PER_CPU=y 41CONFIG_IRQ_PER_CPU=y
40CONFIG_STACKTRACE_SUPPORT=y 42CONFIG_STACKTRACE_SUPPORT=y
41CONFIG_HAVE_LATENCYTOP_SUPPORT=y 43CONFIG_HAVE_LATENCYTOP_SUPPORT=y
@@ -84,11 +86,12 @@ CONFIG_SYSVIPC_SYSCTL=y
84# 86#
85# RCU Subsystem 87# RCU Subsystem
86# 88#
87CONFIG_CLASSIC_RCU=y 89CONFIG_TREE_RCU=y
88# CONFIG_TREE_RCU is not set 90# CONFIG_TREE_PREEMPT_RCU is not set
89# CONFIG_PREEMPT_RCU is not set 91# CONFIG_RCU_TRACE is not set
92CONFIG_RCU_FANOUT=32
93# CONFIG_RCU_FANOUT_EXACT is not set
90# CONFIG_TREE_RCU_TRACE is not set 94# CONFIG_TREE_RCU_TRACE is not set
91# CONFIG_PREEMPT_RCU_TRACE is not set
92# CONFIG_IKCONFIG is not set 95# CONFIG_IKCONFIG is not set
93CONFIG_LOG_BUF_SHIFT=14 96CONFIG_LOG_BUF_SHIFT=14
94CONFIG_GROUP_SCHED=y 97CONFIG_GROUP_SCHED=y
@@ -126,26 +129,27 @@ CONFIG_TIMERFD=y
126CONFIG_EVENTFD=y 129CONFIG_EVENTFD=y
127CONFIG_SHMEM=y 130CONFIG_SHMEM=y
128CONFIG_AIO=y 131CONFIG_AIO=y
129CONFIG_HAVE_PERF_COUNTERS=y 132CONFIG_HAVE_PERF_EVENTS=y
130 133
131# 134#
132# Performance Counters 135# Kernel Performance Events And Counters
133# 136#
137# CONFIG_PERF_EVENTS is not set
134# CONFIG_PERF_COUNTERS is not set 138# CONFIG_PERF_COUNTERS is not set
135CONFIG_VM_EVENT_COUNTERS=y 139CONFIG_VM_EVENT_COUNTERS=y
136# CONFIG_STRIP_ASM_SYMS is not set
137CONFIG_COMPAT_BRK=y 140CONFIG_COMPAT_BRK=y
138CONFIG_SLAB=y 141CONFIG_SLAB=y
139# CONFIG_SLUB is not set 142# CONFIG_SLUB is not set
140# CONFIG_SLOB is not set 143# CONFIG_SLOB is not set
141# CONFIG_PROFILING is not set 144# CONFIG_PROFILING is not set
142# CONFIG_MARKERS is not set
143CONFIG_HAVE_OPROFILE=y 145CONFIG_HAVE_OPROFILE=y
144CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS=y 146CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS=y
145CONFIG_HAVE_IOREMAP_PROT=y 147CONFIG_HAVE_IOREMAP_PROT=y
146CONFIG_HAVE_KPROBES=y 148CONFIG_HAVE_KPROBES=y
147CONFIG_HAVE_KRETPROBES=y 149CONFIG_HAVE_KRETPROBES=y
148CONFIG_HAVE_ARCH_TRACEHOOK=y 150CONFIG_HAVE_ARCH_TRACEHOOK=y
151CONFIG_HAVE_DMA_ATTRS=y
152CONFIG_HAVE_DMA_API_DEBUG=y
149 153
150# 154#
151# GCOV-based kernel profiling 155# GCOV-based kernel profiling
@@ -188,6 +192,7 @@ CONFIG_MPC85xx=y
188# CONFIG_MPC85xx_MDS is not set 192# CONFIG_MPC85xx_MDS is not set
189# CONFIG_MPC8536_DS is not set 193# CONFIG_MPC8536_DS is not set
190# CONFIG_MPC85xx_DS is not set 194# CONFIG_MPC85xx_DS is not set
195# CONFIG_MPC85xx_RDB is not set
191# CONFIG_SOCRATES is not set 196# CONFIG_SOCRATES is not set
192# CONFIG_KSI8560 is not set 197# CONFIG_KSI8560 is not set
193# CONFIG_XES_MPC85xx is not set 198# CONFIG_XES_MPC85xx is not set
@@ -242,6 +247,7 @@ CONFIG_BINFMT_MISC=y
242CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y 247CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y
243CONFIG_ARCH_HAS_WALK_MEMORY=y 248CONFIG_ARCH_HAS_WALK_MEMORY=y
244CONFIG_ARCH_ENABLE_MEMORY_HOTREMOVE=y 249CONFIG_ARCH_ENABLE_MEMORY_HOTREMOVE=y
250CONFIG_MAX_ACTIVE_REGIONS=32
245CONFIG_ARCH_FLATMEM_ENABLE=y 251CONFIG_ARCH_FLATMEM_ENABLE=y
246CONFIG_ARCH_POPULATES_NODE_MAP=y 252CONFIG_ARCH_POPULATES_NODE_MAP=y
247CONFIG_SELECT_MEMORY_MODEL=y 253CONFIG_SELECT_MEMORY_MODEL=y
@@ -259,6 +265,7 @@ CONFIG_BOUNCE=y
259CONFIG_VIRT_TO_BUS=y 265CONFIG_VIRT_TO_BUS=y
260CONFIG_HAVE_MLOCK=y 266CONFIG_HAVE_MLOCK=y
261CONFIG_HAVE_MLOCKED_PAGE_BIT=y 267CONFIG_HAVE_MLOCKED_PAGE_BIT=y
268# CONFIG_KSM is not set
262CONFIG_DEFAULT_MMAP_MIN_ADDR=4096 269CONFIG_DEFAULT_MMAP_MIN_ADDR=4096
263CONFIG_PPC_4K_PAGES=y 270CONFIG_PPC_4K_PAGES=y
264# CONFIG_PPC_16K_PAGES is not set 271# CONFIG_PPC_16K_PAGES is not set
@@ -347,6 +354,7 @@ CONFIG_DEFAULT_TCP_CONG="cubic"
347# CONFIG_NETFILTER is not set 354# CONFIG_NETFILTER is not set
348# CONFIG_IP_DCCP is not set 355# CONFIG_IP_DCCP is not set
349# CONFIG_IP_SCTP is not set 356# CONFIG_IP_SCTP is not set
357# CONFIG_RDS is not set
350# CONFIG_TIPC is not set 358# CONFIG_TIPC is not set
351# CONFIG_ATM is not set 359# CONFIG_ATM is not set
352# CONFIG_BRIDGE is not set 360# CONFIG_BRIDGE is not set
@@ -376,6 +384,7 @@ CONFIG_DEFAULT_TCP_CONG="cubic"
376# CONFIG_AF_RXRPC is not set 384# CONFIG_AF_RXRPC is not set
377CONFIG_WIRELESS=y 385CONFIG_WIRELESS=y
378# CONFIG_CFG80211 is not set 386# CONFIG_CFG80211 is not set
387CONFIG_CFG80211_DEFAULT_PS_VALUE=0
379CONFIG_WIRELESS_OLD_REGULATORY=y 388CONFIG_WIRELESS_OLD_REGULATORY=y
380# CONFIG_WIRELESS_EXT is not set 389# CONFIG_WIRELESS_EXT is not set
381# CONFIG_LIB80211 is not set 390# CONFIG_LIB80211 is not set
@@ -383,7 +392,6 @@ CONFIG_WIRELESS_OLD_REGULATORY=y
383# 392#
384# CFG80211 needs to be enabled for MAC80211 393# CFG80211 needs to be enabled for MAC80211
385# 394#
386CONFIG_MAC80211_DEFAULT_PS_VALUE=0
387# CONFIG_WIMAX is not set 395# CONFIG_WIMAX is not set
388# CONFIG_RFKILL is not set 396# CONFIG_RFKILL is not set
389# CONFIG_NET_9P is not set 397# CONFIG_NET_9P is not set
@@ -396,6 +404,7 @@ CONFIG_MAC80211_DEFAULT_PS_VALUE=0
396# Generic Driver Options 404# Generic Driver Options
397# 405#
398CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug" 406CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
407# CONFIG_DEVTMPFS is not set
399CONFIG_STANDALONE=y 408CONFIG_STANDALONE=y
400CONFIG_PREVENT_FIRMWARE_BUILD=y 409CONFIG_PREVENT_FIRMWARE_BUILD=y
401# CONFIG_FW_LOADER is not set 410# CONFIG_FW_LOADER is not set
@@ -481,15 +490,14 @@ CONFIG_MII=y
481# CONFIG_IBM_NEW_EMAC_MAL_COMMON_ERR is not set 490# CONFIG_IBM_NEW_EMAC_MAL_COMMON_ERR is not set
482# CONFIG_B44 is not set 491# CONFIG_B44 is not set
483# CONFIG_KS8842 is not set 492# CONFIG_KS8842 is not set
493# CONFIG_KS8851_MLL is not set
494# CONFIG_XILINX_EMACLITE is not set
484CONFIG_NETDEV_1000=y 495CONFIG_NETDEV_1000=y
485CONFIG_FSL_PQ_MDIO=y 496CONFIG_FSL_PQ_MDIO=y
486CONFIG_GIANFAR=y 497CONFIG_GIANFAR=y
487# CONFIG_MV643XX_ETH is not set 498# CONFIG_MV643XX_ETH is not set
488CONFIG_NETDEV_10000=y 499CONFIG_NETDEV_10000=y
489 500CONFIG_WLAN=y
490#
491# Wireless LAN
492#
493# CONFIG_WLAN_PRE80211 is not set 501# CONFIG_WLAN_PRE80211 is not set
494# CONFIG_WLAN_80211 is not set 502# CONFIG_WLAN_80211 is not set
495 503
@@ -584,6 +592,11 @@ CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y
584# CONFIG_POWER_SUPPLY is not set 592# CONFIG_POWER_SUPPLY is not set
585CONFIG_HWMON=y 593CONFIG_HWMON=y
586# CONFIG_HWMON_VID is not set 594# CONFIG_HWMON_VID is not set
595# CONFIG_HWMON_DEBUG_CHIP is not set
596
597#
598# Native drivers
599#
587# CONFIG_SENSORS_F71805F is not set 600# CONFIG_SENSORS_F71805F is not set
588# CONFIG_SENSORS_F71882FG is not set 601# CONFIG_SENSORS_F71882FG is not set
589# CONFIG_SENSORS_IT87 is not set 602# CONFIG_SENSORS_IT87 is not set
@@ -594,9 +607,7 @@ CONFIG_HWMON=y
594# CONFIG_SENSORS_VT1211 is not set 607# CONFIG_SENSORS_VT1211 is not set
595# CONFIG_SENSORS_W83627HF is not set 608# CONFIG_SENSORS_W83627HF is not set
596# CONFIG_SENSORS_W83627EHF is not set 609# CONFIG_SENSORS_W83627EHF is not set
597# CONFIG_HWMON_DEBUG_CHIP is not set
598# CONFIG_THERMAL is not set 610# CONFIG_THERMAL is not set
599# CONFIG_THERMAL_HWMON is not set
600# CONFIG_WATCHDOG is not set 611# CONFIG_WATCHDOG is not set
601CONFIG_SSB_POSSIBLE=y 612CONFIG_SSB_POSSIBLE=y
602 613
@@ -630,7 +641,6 @@ CONFIG_VIDEO_OUTPUT_CONTROL=y
630# CONFIG_SOUND is not set 641# CONFIG_SOUND is not set
631CONFIG_HID_SUPPORT=y 642CONFIG_HID_SUPPORT=y
632CONFIG_HID=y 643CONFIG_HID=y
633# CONFIG_HID_DEBUG is not set
634# CONFIG_HIDRAW is not set 644# CONFIG_HIDRAW is not set
635# CONFIG_HID_PID is not set 645# CONFIG_HID_PID is not set
636 646
@@ -721,6 +731,7 @@ CONFIG_RTC_DRV_M48T59=y
721# CONFIG_GFS2_FS is not set 731# CONFIG_GFS2_FS is not set
722# CONFIG_OCFS2_FS is not set 732# CONFIG_OCFS2_FS is not set
723# CONFIG_BTRFS_FS is not set 733# CONFIG_BTRFS_FS is not set
734# CONFIG_NILFS2_FS is not set
724CONFIG_FILE_LOCKING=y 735CONFIG_FILE_LOCKING=y
725CONFIG_FSNOTIFY=y 736CONFIG_FSNOTIFY=y
726CONFIG_DNOTIFY=y 737CONFIG_DNOTIFY=y
@@ -779,7 +790,6 @@ CONFIG_MISC_FILESYSTEMS=y
779# CONFIG_ROMFS_FS is not set 790# CONFIG_ROMFS_FS is not set
780# CONFIG_SYSV_FS is not set 791# CONFIG_SYSV_FS is not set
781# CONFIG_UFS_FS is not set 792# CONFIG_UFS_FS is not set
782# CONFIG_NILFS2_FS is not set
783CONFIG_NETWORK_FILESYSTEMS=y 793CONFIG_NETWORK_FILESYSTEMS=y
784CONFIG_NFS_FS=y 794CONFIG_NFS_FS=y
785# CONFIG_NFS_V3 is not set 795# CONFIG_NFS_V3 is not set
@@ -847,6 +857,7 @@ CONFIG_ENABLE_WARN_DEPRECATED=y
847CONFIG_ENABLE_MUST_CHECK=y 857CONFIG_ENABLE_MUST_CHECK=y
848CONFIG_FRAME_WARN=1024 858CONFIG_FRAME_WARN=1024
849CONFIG_MAGIC_SYSRQ=y 859CONFIG_MAGIC_SYSRQ=y
860# CONFIG_STRIP_ASM_SYMS is not set
850# CONFIG_UNUSED_SYMBOLS is not set 861# CONFIG_UNUSED_SYMBOLS is not set
851# CONFIG_DEBUG_FS is not set 862# CONFIG_DEBUG_FS is not set
852# CONFIG_HEADERS_CHECK is not set 863# CONFIG_HEADERS_CHECK is not set
@@ -863,6 +874,7 @@ CONFIG_SCHED_DEBUG=y
863# CONFIG_TIMER_STATS is not set 874# CONFIG_TIMER_STATS is not set
864# CONFIG_DEBUG_OBJECTS is not set 875# CONFIG_DEBUG_OBJECTS is not set
865# CONFIG_DEBUG_SLAB is not set 876# CONFIG_DEBUG_SLAB is not set
877# CONFIG_DEBUG_KMEMLEAK is not set
866# CONFIG_DEBUG_RT_MUTEXES is not set 878# CONFIG_DEBUG_RT_MUTEXES is not set
867# CONFIG_RT_MUTEX_TESTER is not set 879# CONFIG_RT_MUTEX_TESTER is not set
868# CONFIG_DEBUG_SPINLOCK is not set 880# CONFIG_DEBUG_SPINLOCK is not set
@@ -881,10 +893,12 @@ CONFIG_DEBUG_MUTEXES=y
881# CONFIG_DEBUG_LIST is not set 893# CONFIG_DEBUG_LIST is not set
882# CONFIG_DEBUG_SG is not set 894# CONFIG_DEBUG_SG is not set
883# CONFIG_DEBUG_NOTIFIERS is not set 895# CONFIG_DEBUG_NOTIFIERS is not set
896# CONFIG_DEBUG_CREDENTIALS is not set
884# CONFIG_RCU_TORTURE_TEST is not set 897# CONFIG_RCU_TORTURE_TEST is not set
885# CONFIG_RCU_CPU_STALL_DETECTOR is not set 898# CONFIG_RCU_CPU_STALL_DETECTOR is not set
886# CONFIG_BACKTRACE_SELF_TEST is not set 899# CONFIG_BACKTRACE_SELF_TEST is not set
887# CONFIG_DEBUG_BLOCK_EXT_DEVT is not set 900# CONFIG_DEBUG_BLOCK_EXT_DEVT is not set
901# CONFIG_DEBUG_FORCE_WEAK_PER_CPU is not set
888# CONFIG_FAULT_INJECTION is not set 902# CONFIG_FAULT_INJECTION is not set
889# CONFIG_LATENCYTOP is not set 903# CONFIG_LATENCYTOP is not set
890CONFIG_SYSCTL_SYSCALL_CHECK=y 904CONFIG_SYSCTL_SYSCALL_CHECK=y
@@ -907,10 +921,10 @@ CONFIG_BRANCH_PROFILE_NONE=y
907# CONFIG_KMEMTRACE is not set 921# CONFIG_KMEMTRACE is not set
908# CONFIG_WORKQUEUE_TRACER is not set 922# CONFIG_WORKQUEUE_TRACER is not set
909# CONFIG_BLK_DEV_IO_TRACE is not set 923# CONFIG_BLK_DEV_IO_TRACE is not set
924# CONFIG_DMA_API_DEBUG is not set
910# CONFIG_SAMPLES is not set 925# CONFIG_SAMPLES is not set
911CONFIG_HAVE_ARCH_KGDB=y 926CONFIG_HAVE_ARCH_KGDB=y
912# CONFIG_KGDB is not set 927# CONFIG_KGDB is not set
913# CONFIG_KMEMCHECK is not set
914# CONFIG_PPC_DISABLE_WERROR is not set 928# CONFIG_PPC_DISABLE_WERROR is not set
915CONFIG_PPC_WERROR=y 929CONFIG_PPC_WERROR=y
916CONFIG_PRINT_STACK_DEPTH=64 930CONFIG_PRINT_STACK_DEPTH=64
@@ -947,7 +961,6 @@ CONFIG_CRYPTO=y
947# 961#
948# Crypto core or helper 962# Crypto core or helper
949# 963#
950# CONFIG_CRYPTO_FIPS is not set
951# CONFIG_CRYPTO_MANAGER is not set 964# CONFIG_CRYPTO_MANAGER is not set
952# CONFIG_CRYPTO_MANAGER2 is not set 965# CONFIG_CRYPTO_MANAGER2 is not set
953# CONFIG_CRYPTO_GF128MUL is not set 966# CONFIG_CRYPTO_GF128MUL is not set
@@ -978,11 +991,13 @@ CONFIG_CRYPTO=y
978# 991#
979# CONFIG_CRYPTO_HMAC is not set 992# CONFIG_CRYPTO_HMAC is not set
980# CONFIG_CRYPTO_XCBC is not set 993# CONFIG_CRYPTO_XCBC is not set
994# CONFIG_CRYPTO_VMAC is not set
981 995
982# 996#
983# Digest 997# Digest
984# 998#
985# CONFIG_CRYPTO_CRC32C is not set 999# CONFIG_CRYPTO_CRC32C is not set
1000# CONFIG_CRYPTO_GHASH is not set
986# CONFIG_CRYPTO_MD4 is not set 1001# CONFIG_CRYPTO_MD4 is not set
987# CONFIG_CRYPTO_MD5 is not set 1002# CONFIG_CRYPTO_MD5 is not set
988# CONFIG_CRYPTO_MICHAEL_MIC is not set 1003# CONFIG_CRYPTO_MICHAEL_MIC is not set
diff --git a/arch/powerpc/configs/85xx/socrates_defconfig b/arch/powerpc/configs/85xx/socrates_defconfig
index 04c85dada845..7f5ec35bf199 100644
--- a/arch/powerpc/configs/85xx/socrates_defconfig
+++ b/arch/powerpc/configs/85xx/socrates_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.31-rc4 3# Linux kernel version: 2.6.32-rc5
4# Wed Jul 29 23:32:19 2009 4# Thu Nov 5 08:20:37 2009
5# 5#
6# CONFIG_PPC64 is not set 6# CONFIG_PPC64 is not set
7 7
@@ -22,6 +22,7 @@ CONFIG_FSL_EMB_PERFMON=y
22# CONFIG_PHYS_64BIT is not set 22# CONFIG_PHYS_64BIT is not set
23CONFIG_SPE=y 23CONFIG_SPE=y
24CONFIG_PPC_MMU_NOHASH=y 24CONFIG_PPC_MMU_NOHASH=y
25CONFIG_PPC_MMU_NOHASH_32=y
25CONFIG_PPC_BOOK3E_MMU=y 26CONFIG_PPC_BOOK3E_MMU=y
26# CONFIG_PPC_MM_SLICES is not set 27# CONFIG_PPC_MM_SLICES is not set
27# CONFIG_SMP is not set 28# CONFIG_SMP is not set
@@ -36,6 +37,7 @@ CONFIG_GENERIC_CLOCKEVENTS=y
36CONFIG_GENERIC_HARDIRQS=y 37CONFIG_GENERIC_HARDIRQS=y
37CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=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
40# CONFIG_NEED_PER_CPU_EMBED_FIRST_CHUNK is not set
39CONFIG_IRQ_PER_CPU=y 41CONFIG_IRQ_PER_CPU=y
40CONFIG_STACKTRACE_SUPPORT=y 42CONFIG_STACKTRACE_SUPPORT=y
41CONFIG_HAVE_LATENCYTOP_SUPPORT=y 43CONFIG_HAVE_LATENCYTOP_SUPPORT=y
@@ -84,11 +86,12 @@ CONFIG_SYSVIPC_SYSCTL=y
84# 86#
85# RCU Subsystem 87# RCU Subsystem
86# 88#
87CONFIG_CLASSIC_RCU=y 89CONFIG_TREE_RCU=y
88# CONFIG_TREE_RCU is not set 90# CONFIG_TREE_PREEMPT_RCU is not set
89# CONFIG_PREEMPT_RCU is not set 91# CONFIG_RCU_TRACE is not set
92CONFIG_RCU_FANOUT=32
93# CONFIG_RCU_FANOUT_EXACT is not set
90# CONFIG_TREE_RCU_TRACE is not set 94# CONFIG_TREE_RCU_TRACE is not set
91# CONFIG_PREEMPT_RCU_TRACE is not set
92# CONFIG_IKCONFIG is not set 95# CONFIG_IKCONFIG is not set
93CONFIG_LOG_BUF_SHIFT=16 96CONFIG_LOG_BUF_SHIFT=16
94CONFIG_GROUP_SCHED=y 97CONFIG_GROUP_SCHED=y
@@ -124,28 +127,29 @@ CONFIG_TIMERFD=y
124CONFIG_EVENTFD=y 127CONFIG_EVENTFD=y
125CONFIG_SHMEM=y 128CONFIG_SHMEM=y
126CONFIG_AIO=y 129CONFIG_AIO=y
127CONFIG_HAVE_PERF_COUNTERS=y 130CONFIG_HAVE_PERF_EVENTS=y
128 131
129# 132#
130# Performance Counters 133# Kernel Performance Events And Counters
131# 134#
135# CONFIG_PERF_EVENTS is not set
132# CONFIG_PERF_COUNTERS is not set 136# CONFIG_PERF_COUNTERS is not set
133CONFIG_VM_EVENT_COUNTERS=y 137CONFIG_VM_EVENT_COUNTERS=y
134CONFIG_PCI_QUIRKS=y 138CONFIG_PCI_QUIRKS=y
135CONFIG_SLUB_DEBUG=y 139CONFIG_SLUB_DEBUG=y
136# CONFIG_STRIP_ASM_SYMS is not set
137CONFIG_COMPAT_BRK=y 140CONFIG_COMPAT_BRK=y
138# CONFIG_SLAB is not set 141# CONFIG_SLAB is not set
139CONFIG_SLUB=y 142CONFIG_SLUB=y
140# CONFIG_SLOB is not set 143# CONFIG_SLOB is not set
141# CONFIG_PROFILING is not set 144# CONFIG_PROFILING is not set
142# CONFIG_MARKERS is not set
143CONFIG_HAVE_OPROFILE=y 145CONFIG_HAVE_OPROFILE=y
144CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS=y 146CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS=y
145CONFIG_HAVE_IOREMAP_PROT=y 147CONFIG_HAVE_IOREMAP_PROT=y
146CONFIG_HAVE_KPROBES=y 148CONFIG_HAVE_KPROBES=y
147CONFIG_HAVE_KRETPROBES=y 149CONFIG_HAVE_KRETPROBES=y
148CONFIG_HAVE_ARCH_TRACEHOOK=y 150CONFIG_HAVE_ARCH_TRACEHOOK=y
151CONFIG_HAVE_DMA_ATTRS=y
152CONFIG_HAVE_DMA_API_DEBUG=y
149 153
150# 154#
151# GCOV-based kernel profiling 155# GCOV-based kernel profiling
@@ -193,6 +197,7 @@ CONFIG_MPC85xx=y
193# CONFIG_MPC85xx_MDS is not set 197# CONFIG_MPC85xx_MDS is not set
194# CONFIG_MPC8536_DS is not set 198# CONFIG_MPC8536_DS is not set
195# CONFIG_MPC85xx_DS is not set 199# CONFIG_MPC85xx_DS is not set
200# CONFIG_MPC85xx_RDB is not set
196CONFIG_SOCRATES=y 201CONFIG_SOCRATES=y
197# CONFIG_KSI8560 is not set 202# CONFIG_KSI8560 is not set
198# CONFIG_XES_MPC85xx is not set 203# CONFIG_XES_MPC85xx is not set
@@ -247,6 +252,7 @@ CONFIG_MATH_EMULATION=y
247CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y 252CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y
248CONFIG_ARCH_HAS_WALK_MEMORY=y 253CONFIG_ARCH_HAS_WALK_MEMORY=y
249CONFIG_ARCH_ENABLE_MEMORY_HOTREMOVE=y 254CONFIG_ARCH_ENABLE_MEMORY_HOTREMOVE=y
255CONFIG_MAX_ACTIVE_REGIONS=32
250CONFIG_ARCH_FLATMEM_ENABLE=y 256CONFIG_ARCH_FLATMEM_ENABLE=y
251CONFIG_ARCH_POPULATES_NODE_MAP=y 257CONFIG_ARCH_POPULATES_NODE_MAP=y
252CONFIG_SELECT_MEMORY_MODEL=y 258CONFIG_SELECT_MEMORY_MODEL=y
@@ -264,6 +270,7 @@ CONFIG_BOUNCE=y
264CONFIG_VIRT_TO_BUS=y 270CONFIG_VIRT_TO_BUS=y
265CONFIG_HAVE_MLOCK=y 271CONFIG_HAVE_MLOCK=y
266CONFIG_HAVE_MLOCKED_PAGE_BIT=y 272CONFIG_HAVE_MLOCKED_PAGE_BIT=y
273# CONFIG_KSM is not set
267CONFIG_DEFAULT_MMAP_MIN_ADDR=4096 274CONFIG_DEFAULT_MMAP_MIN_ADDR=4096
268CONFIG_PPC_4K_PAGES=y 275CONFIG_PPC_4K_PAGES=y
269# CONFIG_PPC_16K_PAGES is not set 276# CONFIG_PPC_16K_PAGES is not set
@@ -358,6 +365,7 @@ CONFIG_DEFAULT_TCP_CONG="cubic"
358# CONFIG_NETFILTER is not set 365# CONFIG_NETFILTER is not set
359# CONFIG_IP_DCCP is not set 366# CONFIG_IP_DCCP is not set
360# CONFIG_IP_SCTP is not set 367# CONFIG_IP_SCTP is not set
368# CONFIG_RDS is not set
361# CONFIG_TIPC is not set 369# CONFIG_TIPC is not set
362# CONFIG_ATM is not set 370# CONFIG_ATM is not set
363# CONFIG_BRIDGE is not set 371# CONFIG_BRIDGE is not set
@@ -396,6 +404,7 @@ CONFIG_CAN_BCM=y
396# CONFIG_AF_RXRPC is not set 404# CONFIG_AF_RXRPC is not set
397CONFIG_WIRELESS=y 405CONFIG_WIRELESS=y
398# CONFIG_CFG80211 is not set 406# CONFIG_CFG80211 is not set
407CONFIG_CFG80211_DEFAULT_PS_VALUE=0
399# CONFIG_WIRELESS_OLD_REGULATORY is not set 408# CONFIG_WIRELESS_OLD_REGULATORY is not set
400# CONFIG_WIRELESS_EXT is not set 409# CONFIG_WIRELESS_EXT is not set
401# CONFIG_LIB80211 is not set 410# CONFIG_LIB80211 is not set
@@ -403,7 +412,6 @@ CONFIG_WIRELESS=y
403# 412#
404# CFG80211 needs to be enabled for MAC80211 413# CFG80211 needs to be enabled for MAC80211
405# 414#
406CONFIG_MAC80211_DEFAULT_PS_VALUE=0
407# CONFIG_WIMAX is not set 415# CONFIG_WIMAX is not set
408# CONFIG_RFKILL is not set 416# CONFIG_RFKILL is not set
409# CONFIG_NET_9P is not set 417# CONFIG_NET_9P is not set
@@ -421,9 +429,9 @@ CONFIG_PREVENT_FIRMWARE_BUILD=y
421# CONFIG_CONNECTOR is not set 429# CONFIG_CONNECTOR is not set
422CONFIG_MTD=y 430CONFIG_MTD=y
423# CONFIG_MTD_DEBUG is not set 431# CONFIG_MTD_DEBUG is not set
432# CONFIG_MTD_TESTS is not set
424CONFIG_MTD_CONCAT=y 433CONFIG_MTD_CONCAT=y
425CONFIG_MTD_PARTITIONS=y 434CONFIG_MTD_PARTITIONS=y
426# CONFIG_MTD_TESTS is not set
427# CONFIG_MTD_REDBOOT_PARTS is not set 435# CONFIG_MTD_REDBOOT_PARTS is not set
428CONFIG_MTD_CMDLINE_PARTS=y 436CONFIG_MTD_CMDLINE_PARTS=y
429CONFIG_MTD_OF_PARTS=y 437CONFIG_MTD_OF_PARTS=y
@@ -482,6 +490,7 @@ CONFIG_MTD_PHYSMAP_OF=y
482# CONFIG_MTD_PMC551 is not set 490# CONFIG_MTD_PMC551 is not set
483# CONFIG_MTD_DATAFLASH is not set 491# CONFIG_MTD_DATAFLASH is not set
484# CONFIG_MTD_M25P80 is not set 492# CONFIG_MTD_M25P80 is not set
493# CONFIG_MTD_SST25L is not set
485# CONFIG_MTD_SLRAM is not set 494# CONFIG_MTD_SLRAM is not set
486# CONFIG_MTD_PHRAM is not set 495# CONFIG_MTD_PHRAM is not set
487# CONFIG_MTD_MTDRAM is not set 496# CONFIG_MTD_MTDRAM is not set
@@ -668,7 +677,9 @@ CONFIG_MII=y
668# CONFIG_B44 is not set 677# CONFIG_B44 is not set
669# CONFIG_KS8842 is not set 678# CONFIG_KS8842 is not set
670# CONFIG_KS8851 is not set 679# CONFIG_KS8851 is not set
680# CONFIG_KS8851_MLL is not set
671# CONFIG_ATL2 is not set 681# CONFIG_ATL2 is not set
682# CONFIG_XILINX_EMACLITE is not set
672CONFIG_NETDEV_1000=y 683CONFIG_NETDEV_1000=y
673# CONFIG_ACENIC is not set 684# CONFIG_ACENIC is not set
674# CONFIG_DL2K is not set 685# CONFIG_DL2K is not set
@@ -698,10 +709,7 @@ CONFIG_GIANFAR=y
698# CONFIG_JME is not set 709# CONFIG_JME is not set
699# CONFIG_NETDEV_10000 is not set 710# CONFIG_NETDEV_10000 is not set
700# CONFIG_TR is not set 711# CONFIG_TR is not set
701 712CONFIG_WLAN=y
702#
703# Wireless LAN
704#
705# CONFIG_WLAN_PRE80211 is not set 713# CONFIG_WLAN_PRE80211 is not set
706# CONFIG_WLAN_80211 is not set 714# CONFIG_WLAN_80211 is not set
707 715
@@ -765,6 +773,7 @@ CONFIG_INPUT_TOUCHSCREEN=y
765# CONFIG_TOUCHSCREEN_GUNZE is not set 773# CONFIG_TOUCHSCREEN_GUNZE is not set
766# CONFIG_TOUCHSCREEN_ELO is not set 774# CONFIG_TOUCHSCREEN_ELO is not set
767# CONFIG_TOUCHSCREEN_WACOM_W8001 is not set 775# CONFIG_TOUCHSCREEN_WACOM_W8001 is not set
776# CONFIG_TOUCHSCREEN_MCS5000 is not set
768# CONFIG_TOUCHSCREEN_MTOUCH is not set 777# CONFIG_TOUCHSCREEN_MTOUCH is not set
769# CONFIG_TOUCHSCREEN_INEXIO is not set 778# CONFIG_TOUCHSCREEN_INEXIO is not set
770# CONFIG_TOUCHSCREEN_MK712 is not set 779# CONFIG_TOUCHSCREEN_MK712 is not set
@@ -774,7 +783,6 @@ CONFIG_INPUT_TOUCHSCREEN=y
774# CONFIG_TOUCHSCREEN_USB_COMPOSITE is not set 783# CONFIG_TOUCHSCREEN_USB_COMPOSITE is not set
775# CONFIG_TOUCHSCREEN_TOUCHIT213 is not set 784# CONFIG_TOUCHSCREEN_TOUCHIT213 is not set
776# CONFIG_TOUCHSCREEN_TSC2007 is not set 785# CONFIG_TOUCHSCREEN_TSC2007 is not set
777# CONFIG_TOUCHSCREEN_W90X900 is not set
778# CONFIG_INPUT_MISC is not set 786# CONFIG_INPUT_MISC is not set
779 787
780# 788#
@@ -834,6 +842,7 @@ CONFIG_HW_RANDOM=y
834CONFIG_DEVPORT=y 842CONFIG_DEVPORT=y
835CONFIG_I2C=y 843CONFIG_I2C=y
836CONFIG_I2C_BOARDINFO=y 844CONFIG_I2C_BOARDINFO=y
845CONFIG_I2C_COMPAT=y
837CONFIG_I2C_CHARDEV=y 846CONFIG_I2C_CHARDEV=y
838CONFIG_I2C_HELPER_AUTO=y 847CONFIG_I2C_HELPER_AUTO=y
839 848
@@ -888,9 +897,6 @@ CONFIG_I2C_MPC=y
888# Miscellaneous I2C Chip support 897# Miscellaneous I2C Chip support
889# 898#
890# CONFIG_DS1682 is not set 899# CONFIG_DS1682 is not set
891# CONFIG_SENSORS_PCF8574 is not set
892# CONFIG_PCF8575 is not set
893# CONFIG_SENSORS_PCA9539 is not set
894# CONFIG_SENSORS_TSL2550 is not set 900# CONFIG_SENSORS_TSL2550 is not set
895# CONFIG_I2C_DEBUG_CORE is not set 901# CONFIG_I2C_DEBUG_CORE is not set
896# CONFIG_I2C_DEBUG_ALGO is not set 902# CONFIG_I2C_DEBUG_ALGO is not set
@@ -921,6 +927,11 @@ CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y
921# CONFIG_POWER_SUPPLY is not set 927# CONFIG_POWER_SUPPLY is not set
922CONFIG_HWMON=y 928CONFIG_HWMON=y
923CONFIG_HWMON_VID=y 929CONFIG_HWMON_VID=y
930CONFIG_HWMON_DEBUG_CHIP=y
931
932#
933# Native drivers
934#
924# CONFIG_SENSORS_AD7414 is not set 935# CONFIG_SENSORS_AD7414 is not set
925# CONFIG_SENSORS_AD7418 is not set 936# CONFIG_SENSORS_AD7418 is not set
926# CONFIG_SENSORS_ADCXX is not set 937# CONFIG_SENSORS_ADCXX is not set
@@ -973,6 +984,7 @@ CONFIG_SENSORS_LM75=y
973# CONFIG_SENSORS_ADS7828 is not set 984# CONFIG_SENSORS_ADS7828 is not set
974# CONFIG_SENSORS_THMC50 is not set 985# CONFIG_SENSORS_THMC50 is not set
975# CONFIG_SENSORS_TMP401 is not set 986# CONFIG_SENSORS_TMP401 is not set
987# CONFIG_SENSORS_TMP421 is not set
976# CONFIG_SENSORS_VIA686A is not set 988# CONFIG_SENSORS_VIA686A is not set
977# CONFIG_SENSORS_VT1211 is not set 989# CONFIG_SENSORS_VT1211 is not set
978# CONFIG_SENSORS_VT8231 is not set 990# CONFIG_SENSORS_VT8231 is not set
@@ -985,9 +997,7 @@ CONFIG_SENSORS_W83781D=y
985# CONFIG_SENSORS_W83627HF is not set 997# CONFIG_SENSORS_W83627HF is not set
986# CONFIG_SENSORS_W83627EHF is not set 998# CONFIG_SENSORS_W83627EHF is not set
987# CONFIG_SENSORS_LIS3_SPI is not set 999# CONFIG_SENSORS_LIS3_SPI is not set
988CONFIG_HWMON_DEBUG_CHIP=y
989# CONFIG_THERMAL is not set 1000# CONFIG_THERMAL is not set
990# CONFIG_THERMAL_HWMON is not set
991# CONFIG_WATCHDOG is not set 1001# CONFIG_WATCHDOG is not set
992CONFIG_SSB_POSSIBLE=y 1002CONFIG_SSB_POSSIBLE=y
993 1003
@@ -1006,8 +1016,10 @@ CONFIG_SSB_POSSIBLE=y
1006# CONFIG_MFD_TMIO is not set 1016# CONFIG_MFD_TMIO is not set
1007# CONFIG_PMIC_DA903X is not set 1017# CONFIG_PMIC_DA903X is not set
1008# CONFIG_MFD_WM8400 is not set 1018# CONFIG_MFD_WM8400 is not set
1019# CONFIG_MFD_WM831X is not set
1009# CONFIG_MFD_WM8350_I2C is not set 1020# CONFIG_MFD_WM8350_I2C is not set
1010# CONFIG_MFD_PCF50633 is not set 1021# CONFIG_MFD_PCF50633 is not set
1022# CONFIG_MFD_MC13783 is not set
1011# CONFIG_AB3100_CORE is not set 1023# CONFIG_AB3100_CORE is not set
1012# CONFIG_EZX_PCAP is not set 1024# CONFIG_EZX_PCAP is not set
1013# CONFIG_REGULATOR is not set 1025# CONFIG_REGULATOR is not set
@@ -1017,6 +1029,7 @@ CONFIG_SSB_POSSIBLE=y
1017# Graphics support 1029# Graphics support
1018# 1030#
1019# CONFIG_AGP is not set 1031# CONFIG_AGP is not set
1032CONFIG_VGA_ARB=y
1020# CONFIG_DRM is not set 1033# CONFIG_DRM is not set
1021# CONFIG_VGASTATE is not set 1034# CONFIG_VGASTATE is not set
1022# CONFIG_VIDEO_OUTPUT_CONTROL is not set 1035# CONFIG_VIDEO_OUTPUT_CONTROL is not set
@@ -1112,7 +1125,6 @@ CONFIG_FONT_8x16=y
1112# CONFIG_SOUND is not set 1125# CONFIG_SOUND is not set
1113CONFIG_HID_SUPPORT=y 1126CONFIG_HID_SUPPORT=y
1114CONFIG_HID=y 1127CONFIG_HID=y
1115# CONFIG_HID_DEBUG is not set
1116# CONFIG_HIDRAW is not set 1128# CONFIG_HIDRAW is not set
1117 1129
1118# 1130#
@@ -1135,6 +1147,7 @@ CONFIG_USB_HID=y
1135# CONFIG_HID_EZKEY is not set 1147# CONFIG_HID_EZKEY is not set
1136# CONFIG_HID_KYE is not set 1148# CONFIG_HID_KYE is not set
1137# CONFIG_HID_GYRATION is not set 1149# CONFIG_HID_GYRATION is not set
1150# CONFIG_HID_TWINHAN is not set
1138# CONFIG_HID_KENSINGTON is not set 1151# CONFIG_HID_KENSINGTON is not set
1139# CONFIG_HID_LOGITECH is not set 1152# CONFIG_HID_LOGITECH is not set
1140# CONFIG_HID_MICROSOFT is not set 1153# CONFIG_HID_MICROSOFT is not set
@@ -1184,6 +1197,7 @@ CONFIG_USB_EHCI_HCD_PPC_OF=y
1184# CONFIG_USB_OXU210HP_HCD is not set 1197# CONFIG_USB_OXU210HP_HCD is not set
1185# CONFIG_USB_ISP116X_HCD is not set 1198# CONFIG_USB_ISP116X_HCD is not set
1186# CONFIG_USB_ISP1760_HCD is not set 1199# CONFIG_USB_ISP1760_HCD is not set
1200# CONFIG_USB_ISP1362_HCD is not set
1187CONFIG_USB_OHCI_HCD=y 1201CONFIG_USB_OHCI_HCD=y
1188CONFIG_USB_OHCI_HCD_PPC_OF_BE=y 1202CONFIG_USB_OHCI_HCD_PPC_OF_BE=y
1189# CONFIG_USB_OHCI_HCD_PPC_OF_LE is not set 1203# CONFIG_USB_OHCI_HCD_PPC_OF_LE is not set
@@ -1319,6 +1333,7 @@ CONFIG_RTC_INTF_DEV=y
1319# CONFIG_RTC_DRV_R9701 is not set 1333# CONFIG_RTC_DRV_R9701 is not set
1320# CONFIG_RTC_DRV_RS5C348 is not set 1334# CONFIG_RTC_DRV_RS5C348 is not set
1321# CONFIG_RTC_DRV_DS3234 is not set 1335# CONFIG_RTC_DRV_DS3234 is not set
1336# CONFIG_RTC_DRV_PCF2123 is not set
1322 1337
1323# 1338#
1324# Platform RTC drivers 1339# Platform RTC drivers
@@ -1369,6 +1384,7 @@ CONFIG_FS_MBCACHE=y
1369# CONFIG_GFS2_FS is not set 1384# CONFIG_GFS2_FS is not set
1370# CONFIG_OCFS2_FS is not set 1385# CONFIG_OCFS2_FS is not set
1371# CONFIG_BTRFS_FS is not set 1386# CONFIG_BTRFS_FS is not set
1387# CONFIG_NILFS2_FS is not set
1372CONFIG_FILE_LOCKING=y 1388CONFIG_FILE_LOCKING=y
1373CONFIG_FSNOTIFY=y 1389CONFIG_FSNOTIFY=y
1374CONFIG_DNOTIFY=y 1390CONFIG_DNOTIFY=y
@@ -1438,7 +1454,6 @@ CONFIG_CRAMFS=y
1438# CONFIG_ROMFS_FS is not set 1454# CONFIG_ROMFS_FS is not set
1439# CONFIG_SYSV_FS is not set 1455# CONFIG_SYSV_FS is not set
1440# CONFIG_UFS_FS is not set 1456# CONFIG_UFS_FS is not set
1441# CONFIG_NILFS2_FS is not set
1442CONFIG_NETWORK_FILESYSTEMS=y 1457CONFIG_NETWORK_FILESYSTEMS=y
1443CONFIG_NFS_FS=y 1458CONFIG_NFS_FS=y
1444CONFIG_NFS_V3=y 1459CONFIG_NFS_V3=y
@@ -1552,6 +1567,7 @@ CONFIG_ENABLE_WARN_DEPRECATED=y
1552CONFIG_ENABLE_MUST_CHECK=y 1567CONFIG_ENABLE_MUST_CHECK=y
1553CONFIG_FRAME_WARN=1024 1568CONFIG_FRAME_WARN=1024
1554# CONFIG_MAGIC_SYSRQ is not set 1569# CONFIG_MAGIC_SYSRQ is not set
1570# CONFIG_STRIP_ASM_SYMS is not set
1555# CONFIG_UNUSED_SYMBOLS is not set 1571# CONFIG_UNUSED_SYMBOLS is not set
1556# CONFIG_DEBUG_FS is not set 1572# CONFIG_DEBUG_FS is not set
1557# CONFIG_HEADERS_CHECK is not set 1573# CONFIG_HEADERS_CHECK is not set
@@ -1569,6 +1585,7 @@ CONFIG_HAVE_DYNAMIC_FTRACE=y
1569CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y 1585CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y
1570CONFIG_TRACING_SUPPORT=y 1586CONFIG_TRACING_SUPPORT=y
1571# CONFIG_FTRACE is not set 1587# CONFIG_FTRACE is not set
1588# CONFIG_DMA_API_DEBUG is not set
1572# CONFIG_SAMPLES is not set 1589# CONFIG_SAMPLES is not set
1573CONFIG_HAVE_ARCH_KGDB=y 1590CONFIG_HAVE_ARCH_KGDB=y
1574# CONFIG_PPC_DISABLE_WERROR is not set 1591# CONFIG_PPC_DISABLE_WERROR is not set
@@ -1589,7 +1606,6 @@ CONFIG_CRYPTO=y
1589# 1606#
1590# Crypto core or helper 1607# Crypto core or helper
1591# 1608#
1592# CONFIG_CRYPTO_FIPS is not set
1593# CONFIG_CRYPTO_MANAGER is not set 1609# CONFIG_CRYPTO_MANAGER is not set
1594# CONFIG_CRYPTO_MANAGER2 is not set 1610# CONFIG_CRYPTO_MANAGER2 is not set
1595# CONFIG_CRYPTO_GF128MUL is not set 1611# CONFIG_CRYPTO_GF128MUL is not set
@@ -1621,11 +1637,13 @@ CONFIG_CRYPTO=y
1621# 1637#
1622# CONFIG_CRYPTO_HMAC is not set 1638# CONFIG_CRYPTO_HMAC is not set
1623# CONFIG_CRYPTO_XCBC is not set 1639# CONFIG_CRYPTO_XCBC is not set
1640# CONFIG_CRYPTO_VMAC is not set
1624 1641
1625# 1642#
1626# Digest 1643# Digest
1627# 1644#
1628# CONFIG_CRYPTO_CRC32C is not set 1645# CONFIG_CRYPTO_CRC32C is not set
1646# CONFIG_CRYPTO_GHASH is not set
1629# CONFIG_CRYPTO_MD4 is not set 1647# CONFIG_CRYPTO_MD4 is not set
1630# CONFIG_CRYPTO_MD5 is not set 1648# CONFIG_CRYPTO_MD5 is not set
1631# CONFIG_CRYPTO_MICHAEL_MIC is not set 1649# CONFIG_CRYPTO_MICHAEL_MIC is not set
diff --git a/arch/powerpc/configs/85xx/stx_gp3_defconfig b/arch/powerpc/configs/85xx/stx_gp3_defconfig
index e7e81d6769fe..c8327e88a987 100644
--- a/arch/powerpc/configs/85xx/stx_gp3_defconfig
+++ b/arch/powerpc/configs/85xx/stx_gp3_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.31-rc4 3# Linux kernel version: 2.6.32-rc5
4# Wed Jul 29 23:32:20 2009 4# Thu Nov 5 08:20:38 2009
5# 5#
6# CONFIG_PPC64 is not set 6# CONFIG_PPC64 is not set
7 7
@@ -22,6 +22,7 @@ CONFIG_FSL_EMB_PERFMON=y
22# CONFIG_PHYS_64BIT is not set 22# CONFIG_PHYS_64BIT is not set
23CONFIG_SPE=y 23CONFIG_SPE=y
24CONFIG_PPC_MMU_NOHASH=y 24CONFIG_PPC_MMU_NOHASH=y
25CONFIG_PPC_MMU_NOHASH_32=y
25CONFIG_PPC_BOOK3E_MMU=y 26CONFIG_PPC_BOOK3E_MMU=y
26# CONFIG_PPC_MM_SLICES is not set 27# CONFIG_PPC_MM_SLICES is not set
27# CONFIG_SMP is not set 28# CONFIG_SMP is not set
@@ -36,6 +37,7 @@ CONFIG_GENERIC_CLOCKEVENTS=y
36CONFIG_GENERIC_HARDIRQS=y 37CONFIG_GENERIC_HARDIRQS=y
37CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=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
40# CONFIG_NEED_PER_CPU_EMBED_FIRST_CHUNK is not set
39CONFIG_IRQ_PER_CPU=y 41CONFIG_IRQ_PER_CPU=y
40CONFIG_STACKTRACE_SUPPORT=y 42CONFIG_STACKTRACE_SUPPORT=y
41CONFIG_HAVE_LATENCYTOP_SUPPORT=y 43CONFIG_HAVE_LATENCYTOP_SUPPORT=y
@@ -85,11 +87,12 @@ CONFIG_SYSVIPC_SYSCTL=y
85# 87#
86# RCU Subsystem 88# RCU Subsystem
87# 89#
88CONFIG_CLASSIC_RCU=y 90CONFIG_TREE_RCU=y
89# CONFIG_TREE_RCU is not set 91# CONFIG_TREE_PREEMPT_RCU is not set
90# CONFIG_PREEMPT_RCU is not set 92# CONFIG_RCU_TRACE is not set
93CONFIG_RCU_FANOUT=32
94# CONFIG_RCU_FANOUT_EXACT is not set
91# CONFIG_TREE_RCU_TRACE is not set 95# CONFIG_TREE_RCU_TRACE is not set
92# CONFIG_PREEMPT_RCU_TRACE is not set
93# CONFIG_IKCONFIG is not set 96# CONFIG_IKCONFIG is not set
94CONFIG_LOG_BUF_SHIFT=14 97CONFIG_LOG_BUF_SHIFT=14
95CONFIG_GROUP_SCHED=y 98CONFIG_GROUP_SCHED=y
@@ -127,22 +130,21 @@ CONFIG_TIMERFD=y
127CONFIG_EVENTFD=y 130CONFIG_EVENTFD=y
128CONFIG_SHMEM=y 131CONFIG_SHMEM=y
129CONFIG_AIO=y 132CONFIG_AIO=y
130CONFIG_HAVE_PERF_COUNTERS=y 133CONFIG_HAVE_PERF_EVENTS=y
131 134
132# 135#
133# Performance Counters 136# Kernel Performance Events And Counters
134# 137#
138# CONFIG_PERF_EVENTS is not set
135# CONFIG_PERF_COUNTERS is not set 139# CONFIG_PERF_COUNTERS is not set
136CONFIG_VM_EVENT_COUNTERS=y 140CONFIG_VM_EVENT_COUNTERS=y
137CONFIG_PCI_QUIRKS=y 141CONFIG_PCI_QUIRKS=y
138CONFIG_SLUB_DEBUG=y 142CONFIG_SLUB_DEBUG=y
139# CONFIG_STRIP_ASM_SYMS is not set
140CONFIG_COMPAT_BRK=y 143CONFIG_COMPAT_BRK=y
141# CONFIG_SLAB is not set 144# CONFIG_SLAB is not set
142CONFIG_SLUB=y 145CONFIG_SLUB=y
143# CONFIG_SLOB is not set 146# CONFIG_SLOB is not set
144# CONFIG_PROFILING is not set 147# CONFIG_PROFILING is not set
145# CONFIG_MARKERS is not set
146CONFIG_HAVE_OPROFILE=y 148CONFIG_HAVE_OPROFILE=y
147# CONFIG_KPROBES is not set 149# CONFIG_KPROBES is not set
148CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS=y 150CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS=y
@@ -150,7 +152,9 @@ CONFIG_HAVE_IOREMAP_PROT=y
150CONFIG_HAVE_KPROBES=y 152CONFIG_HAVE_KPROBES=y
151CONFIG_HAVE_KRETPROBES=y 153CONFIG_HAVE_KRETPROBES=y
152CONFIG_HAVE_ARCH_TRACEHOOK=y 154CONFIG_HAVE_ARCH_TRACEHOOK=y
155CONFIG_HAVE_DMA_ATTRS=y
153CONFIG_HAVE_CLK=y 156CONFIG_HAVE_CLK=y
157CONFIG_HAVE_DMA_API_DEBUG=y
154 158
155# 159#
156# GCOV-based kernel profiling 160# GCOV-based kernel profiling
@@ -197,6 +201,7 @@ CONFIG_MPC85xx=y
197# CONFIG_MPC85xx_MDS is not set 201# CONFIG_MPC85xx_MDS is not set
198# CONFIG_MPC8536_DS is not set 202# CONFIG_MPC8536_DS is not set
199# CONFIG_MPC85xx_DS is not set 203# CONFIG_MPC85xx_DS is not set
204# CONFIG_MPC85xx_RDB is not set
200# CONFIG_SOCRATES is not set 205# CONFIG_SOCRATES is not set
201# CONFIG_KSI8560 is not set 206# CONFIG_KSI8560 is not set
202# CONFIG_XES_MPC85xx is not set 207# CONFIG_XES_MPC85xx is not set
@@ -252,6 +257,7 @@ CONFIG_MATH_EMULATION=y
252CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y 257CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y
253CONFIG_ARCH_HAS_WALK_MEMORY=y 258CONFIG_ARCH_HAS_WALK_MEMORY=y
254CONFIG_ARCH_ENABLE_MEMORY_HOTREMOVE=y 259CONFIG_ARCH_ENABLE_MEMORY_HOTREMOVE=y
260CONFIG_MAX_ACTIVE_REGIONS=32
255CONFIG_ARCH_FLATMEM_ENABLE=y 261CONFIG_ARCH_FLATMEM_ENABLE=y
256CONFIG_ARCH_POPULATES_NODE_MAP=y 262CONFIG_ARCH_POPULATES_NODE_MAP=y
257CONFIG_SELECT_MEMORY_MODEL=y 263CONFIG_SELECT_MEMORY_MODEL=y
@@ -269,6 +275,7 @@ CONFIG_BOUNCE=y
269CONFIG_VIRT_TO_BUS=y 275CONFIG_VIRT_TO_BUS=y
270CONFIG_HAVE_MLOCK=y 276CONFIG_HAVE_MLOCK=y
271CONFIG_HAVE_MLOCKED_PAGE_BIT=y 277CONFIG_HAVE_MLOCKED_PAGE_BIT=y
278# CONFIG_KSM is not set
272CONFIG_DEFAULT_MMAP_MIN_ADDR=4096 279CONFIG_DEFAULT_MMAP_MIN_ADDR=4096
273CONFIG_PPC_4K_PAGES=y 280CONFIG_PPC_4K_PAGES=y
274# CONFIG_PPC_16K_PAGES is not set 281# CONFIG_PPC_16K_PAGES is not set
@@ -426,6 +433,7 @@ CONFIG_IP_NF_FILTER=m
426# CONFIG_IP_NF_ARPTABLES is not set 433# CONFIG_IP_NF_ARPTABLES is not set
427# CONFIG_IP_DCCP is not set 434# CONFIG_IP_DCCP is not set
428# CONFIG_IP_SCTP is not set 435# CONFIG_IP_SCTP is not set
436# CONFIG_RDS is not set
429# CONFIG_TIPC is not set 437# CONFIG_TIPC is not set
430# CONFIG_ATM is not set 438# CONFIG_ATM is not set
431# CONFIG_BRIDGE is not set 439# CONFIG_BRIDGE is not set
@@ -455,6 +463,7 @@ CONFIG_NET_PKTGEN=y
455# CONFIG_AF_RXRPC is not set 463# CONFIG_AF_RXRPC is not set
456CONFIG_WIRELESS=y 464CONFIG_WIRELESS=y
457# CONFIG_CFG80211 is not set 465# CONFIG_CFG80211 is not set
466CONFIG_CFG80211_DEFAULT_PS_VALUE=0
458CONFIG_WIRELESS_OLD_REGULATORY=y 467CONFIG_WIRELESS_OLD_REGULATORY=y
459# CONFIG_WIRELESS_EXT is not set 468# CONFIG_WIRELESS_EXT is not set
460# CONFIG_LIB80211 is not set 469# CONFIG_LIB80211 is not set
@@ -462,7 +471,6 @@ CONFIG_WIRELESS_OLD_REGULATORY=y
462# 471#
463# CFG80211 needs to be enabled for MAC80211 472# CFG80211 needs to be enabled for MAC80211
464# 473#
465CONFIG_MAC80211_DEFAULT_PS_VALUE=0
466# CONFIG_WIMAX is not set 474# CONFIG_WIMAX is not set
467# CONFIG_RFKILL is not set 475# CONFIG_RFKILL is not set
468# CONFIG_NET_9P is not set 476# CONFIG_NET_9P is not set
@@ -475,6 +483,7 @@ CONFIG_MAC80211_DEFAULT_PS_VALUE=0
475# Generic Driver Options 483# Generic Driver Options
476# 484#
477CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug" 485CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
486# CONFIG_DEVTMPFS is not set
478CONFIG_STANDALONE=y 487CONFIG_STANDALONE=y
479CONFIG_PREVENT_FIRMWARE_BUILD=y 488CONFIG_PREVENT_FIRMWARE_BUILD=y
480# CONFIG_FW_LOADER is not set 489# CONFIG_FW_LOADER is not set
@@ -622,6 +631,7 @@ CONFIG_SCSI_LOWLEVEL=y
622# CONFIG_ISCSI_TCP is not set 631# CONFIG_ISCSI_TCP is not set
623# CONFIG_SCSI_CXGB3_ISCSI is not set 632# CONFIG_SCSI_CXGB3_ISCSI is not set
624# CONFIG_SCSI_BNX2_ISCSI is not set 633# CONFIG_SCSI_BNX2_ISCSI is not set
634# CONFIG_BE2ISCSI is not set
625# CONFIG_BLK_DEV_3W_XXXX_RAID is not set 635# CONFIG_BLK_DEV_3W_XXXX_RAID is not set
626# CONFIG_SCSI_3W_9XXX is not set 636# CONFIG_SCSI_3W_9XXX is not set
627# CONFIG_SCSI_ACARD is not set 637# CONFIG_SCSI_ACARD is not set
@@ -662,7 +672,9 @@ CONFIG_SCSI_LOWLEVEL=y
662# CONFIG_SCSI_DC390T is not set 672# CONFIG_SCSI_DC390T is not set
663# CONFIG_SCSI_NSP32 is not set 673# CONFIG_SCSI_NSP32 is not set
664# CONFIG_SCSI_DEBUG is not set 674# CONFIG_SCSI_DEBUG is not set
675# CONFIG_SCSI_PMCRAID is not set
665# CONFIG_SCSI_SRP is not set 676# CONFIG_SCSI_SRP is not set
677# CONFIG_SCSI_BFA_FC is not set
666# CONFIG_SCSI_DH is not set 678# CONFIG_SCSI_DH is not set
667# CONFIG_SCSI_OSD_INITIATOR is not set 679# CONFIG_SCSI_OSD_INITIATOR is not set
668# CONFIG_ATA is not set 680# CONFIG_ATA is not set
@@ -732,8 +744,10 @@ CONFIG_NET_ETHERNET=y
732# CONFIG_NET_PCI is not set 744# CONFIG_NET_PCI is not set
733# CONFIG_B44 is not set 745# CONFIG_B44 is not set
734# CONFIG_KS8842 is not set 746# CONFIG_KS8842 is not set
747# CONFIG_KS8851_MLL is not set
735# CONFIG_NET_POCKET is not set 748# CONFIG_NET_POCKET is not set
736# CONFIG_ATL2 is not set 749# CONFIG_ATL2 is not set
750# CONFIG_XILINX_EMACLITE is not set
737# CONFIG_FS_ENET is not set 751# CONFIG_FS_ENET is not set
738CONFIG_NETDEV_1000=y 752CONFIG_NETDEV_1000=y
739# CONFIG_ACENIC is not set 753# CONFIG_ACENIC is not set
@@ -782,10 +796,7 @@ CONFIG_CHELSIO_T3_DEPENDS=y
782# CONFIG_SFC is not set 796# CONFIG_SFC is not set
783# CONFIG_BE2NET is not set 797# CONFIG_BE2NET is not set
784# CONFIG_TR is not set 798# CONFIG_TR is not set
785 799CONFIG_WLAN=y
786#
787# Wireless LAN
788#
789# CONFIG_WLAN_PRE80211 is not set 800# CONFIG_WLAN_PRE80211 is not set
790# CONFIG_WLAN_80211 is not set 801# CONFIG_WLAN_80211 is not set
791 802
@@ -827,11 +838,15 @@ CONFIG_INPUT_EVDEV=m
827# Input Device Drivers 838# Input Device Drivers
828# 839#
829CONFIG_INPUT_KEYBOARD=y 840CONFIG_INPUT_KEYBOARD=y
841# CONFIG_KEYBOARD_ADP5588 is not set
830CONFIG_KEYBOARD_ATKBD=y 842CONFIG_KEYBOARD_ATKBD=y
843# CONFIG_QT2160 is not set
831# CONFIG_KEYBOARD_LKKBD is not set 844# CONFIG_KEYBOARD_LKKBD is not set
832# CONFIG_KEYBOARD_GPIO is not set 845# CONFIG_KEYBOARD_GPIO is not set
833# CONFIG_KEYBOARD_MATRIX is not set 846# CONFIG_KEYBOARD_MATRIX is not set
847# CONFIG_KEYBOARD_MAX7359 is not set
834# CONFIG_KEYBOARD_NEWTON is not set 848# CONFIG_KEYBOARD_NEWTON is not set
849# CONFIG_KEYBOARD_OPENCORES is not set
835# CONFIG_KEYBOARD_STOWAWAY is not set 850# CONFIG_KEYBOARD_STOWAWAY is not set
836# CONFIG_KEYBOARD_SUNKBD is not set 851# CONFIG_KEYBOARD_SUNKBD is not set
837# CONFIG_KEYBOARD_XTKBD is not set 852# CONFIG_KEYBOARD_XTKBD is not set
@@ -842,6 +857,7 @@ CONFIG_MOUSE_PS2_LOGIPS2PP=y
842CONFIG_MOUSE_PS2_SYNAPTICS=y 857CONFIG_MOUSE_PS2_SYNAPTICS=y
843CONFIG_MOUSE_PS2_TRACKPOINT=y 858CONFIG_MOUSE_PS2_TRACKPOINT=y
844# CONFIG_MOUSE_PS2_ELANTECH is not set 859# CONFIG_MOUSE_PS2_ELANTECH is not set
860# CONFIG_MOUSE_PS2_SENTELIC is not set
845# CONFIG_MOUSE_PS2_TOUCHKIT is not set 861# CONFIG_MOUSE_PS2_TOUCHKIT is not set
846# CONFIG_MOUSE_SERIAL is not set 862# CONFIG_MOUSE_SERIAL is not set
847# CONFIG_MOUSE_APPLETOUCH is not set 863# CONFIG_MOUSE_APPLETOUCH is not set
@@ -909,6 +925,7 @@ CONFIG_HW_RANDOM=m
909CONFIG_DEVPORT=y 925CONFIG_DEVPORT=y
910CONFIG_I2C=m 926CONFIG_I2C=m
911CONFIG_I2C_BOARDINFO=y 927CONFIG_I2C_BOARDINFO=y
928CONFIG_I2C_COMPAT=y
912CONFIG_I2C_CHARDEV=m 929CONFIG_I2C_CHARDEV=m
913CONFIG_I2C_HELPER_AUTO=y 930CONFIG_I2C_HELPER_AUTO=y
914CONFIG_I2C_ALGOBIT=m 931CONFIG_I2C_ALGOBIT=m
@@ -967,9 +984,6 @@ CONFIG_I2C_ALGOBIT=m
967# Miscellaneous I2C Chip support 984# Miscellaneous I2C Chip support
968# 985#
969# CONFIG_DS1682 is not set 986# CONFIG_DS1682 is not set
970# CONFIG_SENSORS_PCF8574 is not set
971# CONFIG_PCF8575 is not set
972# CONFIG_SENSORS_PCA9539 is not set
973# CONFIG_SENSORS_TSL2550 is not set 987# CONFIG_SENSORS_TSL2550 is not set
974# CONFIG_I2C_DEBUG_CORE is not set 988# CONFIG_I2C_DEBUG_CORE is not set
975# CONFIG_I2C_DEBUG_ALGO is not set 989# CONFIG_I2C_DEBUG_ALGO is not set
@@ -1003,14 +1017,24 @@ CONFIG_GPIOLIB=y
1003# PCI GPIO expanders: 1017# PCI GPIO expanders:
1004# 1018#
1005# CONFIG_GPIO_BT8XX is not set 1019# CONFIG_GPIO_BT8XX is not set
1020# CONFIG_GPIO_LANGWELL is not set
1006 1021
1007# 1022#
1008# SPI GPIO expanders: 1023# SPI GPIO expanders:
1009# 1024#
1025
1026#
1027# AC97 GPIO expanders:
1028#
1010# CONFIG_W1 is not set 1029# CONFIG_W1 is not set
1011# CONFIG_POWER_SUPPLY is not set 1030# CONFIG_POWER_SUPPLY is not set
1012CONFIG_HWMON=y 1031CONFIG_HWMON=y
1013# CONFIG_HWMON_VID is not set 1032# CONFIG_HWMON_VID is not set
1033# CONFIG_HWMON_DEBUG_CHIP is not set
1034
1035#
1036# Native drivers
1037#
1014# CONFIG_SENSORS_AD7414 is not set 1038# CONFIG_SENSORS_AD7414 is not set
1015# CONFIG_SENSORS_AD7418 is not set 1039# CONFIG_SENSORS_AD7418 is not set
1016# CONFIG_SENSORS_ADM1021 is not set 1040# CONFIG_SENSORS_ADM1021 is not set
@@ -1061,6 +1085,7 @@ CONFIG_HWMON=y
1061# CONFIG_SENSORS_ADS7828 is not set 1085# CONFIG_SENSORS_ADS7828 is not set
1062# CONFIG_SENSORS_THMC50 is not set 1086# CONFIG_SENSORS_THMC50 is not set
1063# CONFIG_SENSORS_TMP401 is not set 1087# CONFIG_SENSORS_TMP401 is not set
1088# CONFIG_SENSORS_TMP421 is not set
1064# CONFIG_SENSORS_VIA686A is not set 1089# CONFIG_SENSORS_VIA686A is not set
1065# CONFIG_SENSORS_VT1211 is not set 1090# CONFIG_SENSORS_VT1211 is not set
1066# CONFIG_SENSORS_VT8231 is not set 1091# CONFIG_SENSORS_VT8231 is not set
@@ -1072,9 +1097,7 @@ CONFIG_HWMON=y
1072# CONFIG_SENSORS_W83L786NG is not set 1097# CONFIG_SENSORS_W83L786NG is not set
1073# CONFIG_SENSORS_W83627HF is not set 1098# CONFIG_SENSORS_W83627HF is not set
1074# CONFIG_SENSORS_W83627EHF is not set 1099# CONFIG_SENSORS_W83627EHF is not set
1075# CONFIG_HWMON_DEBUG_CHIP is not set
1076# CONFIG_THERMAL is not set 1100# CONFIG_THERMAL is not set
1077# CONFIG_THERMAL_HWMON is not set
1078# CONFIG_WATCHDOG is not set 1101# CONFIG_WATCHDOG is not set
1079CONFIG_SSB_POSSIBLE=y 1102CONFIG_SSB_POSSIBLE=y
1080 1103
@@ -1092,6 +1115,7 @@ CONFIG_SSB_POSSIBLE=y
1092# CONFIG_TPS65010 is not set 1115# CONFIG_TPS65010 is not set
1093# CONFIG_MFD_TMIO is not set 1116# CONFIG_MFD_TMIO is not set
1094# CONFIG_MFD_WM8400 is not set 1117# CONFIG_MFD_WM8400 is not set
1118# CONFIG_MFD_WM831X is not set
1095# CONFIG_MFD_WM8350_I2C is not set 1119# CONFIG_MFD_WM8350_I2C is not set
1096# CONFIG_MFD_PCF50633 is not set 1120# CONFIG_MFD_PCF50633 is not set
1097# CONFIG_AB3100_CORE is not set 1121# CONFIG_AB3100_CORE is not set
@@ -1102,6 +1126,7 @@ CONFIG_SSB_POSSIBLE=y
1102# Graphics support 1126# Graphics support
1103# 1127#
1104CONFIG_AGP=m 1128CONFIG_AGP=m
1129CONFIG_VGA_ARB=y
1105CONFIG_DRM=m 1130CONFIG_DRM=m
1106# CONFIG_DRM_TDFX is not set 1131# CONFIG_DRM_TDFX is not set
1107# CONFIG_DRM_R128 is not set 1132# CONFIG_DRM_R128 is not set
@@ -1125,7 +1150,6 @@ CONFIG_SOUND=m
1125# CONFIG_SOUND_PRIME is not set 1150# CONFIG_SOUND_PRIME is not set
1126CONFIG_HID_SUPPORT=y 1151CONFIG_HID_SUPPORT=y
1127CONFIG_HID=y 1152CONFIG_HID=y
1128# CONFIG_HID_DEBUG is not set
1129# CONFIG_HIDRAW is not set 1153# CONFIG_HIDRAW is not set
1130# CONFIG_HID_PID is not set 1154# CONFIG_HID_PID is not set
1131 1155
@@ -1190,6 +1214,7 @@ CONFIG_FS_MBCACHE=y
1190# CONFIG_GFS2_FS is not set 1214# CONFIG_GFS2_FS is not set
1191# CONFIG_OCFS2_FS is not set 1215# CONFIG_OCFS2_FS is not set
1192# CONFIG_BTRFS_FS is not set 1216# CONFIG_BTRFS_FS is not set
1217# CONFIG_NILFS2_FS is not set
1193CONFIG_FILE_LOCKING=y 1218CONFIG_FILE_LOCKING=y
1194CONFIG_FSNOTIFY=y 1219CONFIG_FSNOTIFY=y
1195CONFIG_DNOTIFY=y 1220CONFIG_DNOTIFY=y
@@ -1254,7 +1279,6 @@ CONFIG_CRAMFS=m
1254# CONFIG_ROMFS_FS is not set 1279# CONFIG_ROMFS_FS is not set
1255# CONFIG_SYSV_FS is not set 1280# CONFIG_SYSV_FS is not set
1256# CONFIG_UFS_FS is not set 1281# CONFIG_UFS_FS is not set
1257# CONFIG_NILFS2_FS is not set
1258CONFIG_NETWORK_FILESYSTEMS=y 1282CONFIG_NETWORK_FILESYSTEMS=y
1259CONFIG_NFS_FS=y 1283CONFIG_NFS_FS=y
1260CONFIG_NFS_V3=y 1284CONFIG_NFS_V3=y
@@ -1352,6 +1376,7 @@ CONFIG_ENABLE_WARN_DEPRECATED=y
1352CONFIG_ENABLE_MUST_CHECK=y 1376CONFIG_ENABLE_MUST_CHECK=y
1353CONFIG_FRAME_WARN=1024 1377CONFIG_FRAME_WARN=1024
1354# CONFIG_MAGIC_SYSRQ is not set 1378# CONFIG_MAGIC_SYSRQ is not set
1379# CONFIG_STRIP_ASM_SYMS is not set
1355# CONFIG_UNUSED_SYMBOLS is not set 1380# CONFIG_UNUSED_SYMBOLS is not set
1356# CONFIG_DEBUG_FS is not set 1381# CONFIG_DEBUG_FS is not set
1357# CONFIG_HEADERS_CHECK is not set 1382# CONFIG_HEADERS_CHECK is not set
@@ -1369,6 +1394,7 @@ CONFIG_SCHED_DEBUG=y
1369# CONFIG_DEBUG_OBJECTS is not set 1394# CONFIG_DEBUG_OBJECTS is not set
1370# CONFIG_SLUB_DEBUG_ON is not set 1395# CONFIG_SLUB_DEBUG_ON is not set
1371# CONFIG_SLUB_STATS is not set 1396# CONFIG_SLUB_STATS is not set
1397# CONFIG_DEBUG_KMEMLEAK is not set
1372# CONFIG_DEBUG_RT_MUTEXES is not set 1398# CONFIG_DEBUG_RT_MUTEXES is not set
1373# CONFIG_RT_MUTEX_TESTER is not set 1399# CONFIG_RT_MUTEX_TESTER is not set
1374# CONFIG_DEBUG_SPINLOCK is not set 1400# CONFIG_DEBUG_SPINLOCK is not set
@@ -1388,10 +1414,12 @@ CONFIG_SCHED_DEBUG=y
1388# CONFIG_DEBUG_LIST is not set 1414# CONFIG_DEBUG_LIST is not set
1389# CONFIG_DEBUG_SG is not set 1415# CONFIG_DEBUG_SG is not set
1390# CONFIG_DEBUG_NOTIFIERS is not set 1416# CONFIG_DEBUG_NOTIFIERS is not set
1417# CONFIG_DEBUG_CREDENTIALS is not set
1391# CONFIG_RCU_TORTURE_TEST is not set 1418# CONFIG_RCU_TORTURE_TEST is not set
1392# CONFIG_RCU_CPU_STALL_DETECTOR is not set 1419# CONFIG_RCU_CPU_STALL_DETECTOR is not set
1393# CONFIG_BACKTRACE_SELF_TEST is not set 1420# CONFIG_BACKTRACE_SELF_TEST is not set
1394# CONFIG_DEBUG_BLOCK_EXT_DEVT is not set 1421# CONFIG_DEBUG_BLOCK_EXT_DEVT is not set
1422# CONFIG_DEBUG_FORCE_WEAK_PER_CPU is not set
1395# CONFIG_FAULT_INJECTION is not set 1423# CONFIG_FAULT_INJECTION is not set
1396# CONFIG_LATENCYTOP is not set 1424# CONFIG_LATENCYTOP is not set
1397CONFIG_SYSCTL_SYSCALL_CHECK=y 1425CONFIG_SYSCTL_SYSCALL_CHECK=y
@@ -1414,10 +1442,10 @@ CONFIG_BRANCH_PROFILE_NONE=y
1414# CONFIG_KMEMTRACE is not set 1442# CONFIG_KMEMTRACE is not set
1415# CONFIG_WORKQUEUE_TRACER is not set 1443# CONFIG_WORKQUEUE_TRACER is not set
1416# CONFIG_BLK_DEV_IO_TRACE is not set 1444# CONFIG_BLK_DEV_IO_TRACE is not set
1445# CONFIG_DMA_API_DEBUG is not set
1417# CONFIG_SAMPLES is not set 1446# CONFIG_SAMPLES is not set
1418CONFIG_HAVE_ARCH_KGDB=y 1447CONFIG_HAVE_ARCH_KGDB=y
1419# CONFIG_KGDB is not set 1448# CONFIG_KGDB is not set
1420# CONFIG_KMEMCHECK is not set
1421# CONFIG_PPC_DISABLE_WERROR is not set 1449# CONFIG_PPC_DISABLE_WERROR is not set
1422CONFIG_PPC_WERROR=y 1450CONFIG_PPC_WERROR=y
1423CONFIG_PRINT_STACK_DEPTH=64 1451CONFIG_PRINT_STACK_DEPTH=64
@@ -1443,7 +1471,6 @@ CONFIG_CRYPTO=y
1443# 1471#
1444# Crypto core or helper 1472# Crypto core or helper
1445# 1473#
1446# CONFIG_CRYPTO_FIPS is not set
1447# CONFIG_CRYPTO_MANAGER is not set 1474# CONFIG_CRYPTO_MANAGER is not set
1448# CONFIG_CRYPTO_MANAGER2 is not set 1475# CONFIG_CRYPTO_MANAGER2 is not set
1449# CONFIG_CRYPTO_GF128MUL is not set 1476# CONFIG_CRYPTO_GF128MUL is not set
@@ -1475,11 +1502,13 @@ CONFIG_CRYPTO=y
1475# 1502#
1476# CONFIG_CRYPTO_HMAC is not set 1503# CONFIG_CRYPTO_HMAC is not set
1477# CONFIG_CRYPTO_XCBC is not set 1504# CONFIG_CRYPTO_XCBC is not set
1505# CONFIG_CRYPTO_VMAC is not set
1478 1506
1479# 1507#
1480# Digest 1508# Digest
1481# 1509#
1482# CONFIG_CRYPTO_CRC32C is not set 1510# CONFIG_CRYPTO_CRC32C is not set
1511# CONFIG_CRYPTO_GHASH is not set
1483# CONFIG_CRYPTO_MD4 is not set 1512# CONFIG_CRYPTO_MD4 is not set
1484# CONFIG_CRYPTO_MD5 is not set 1513# CONFIG_CRYPTO_MD5 is not set
1485# CONFIG_CRYPTO_MICHAEL_MIC is not set 1514# CONFIG_CRYPTO_MICHAEL_MIC is not set
diff --git a/arch/powerpc/configs/85xx/tqm8540_defconfig b/arch/powerpc/configs/85xx/tqm8540_defconfig
index 2c407523aad2..82563703d5e3 100644
--- a/arch/powerpc/configs/85xx/tqm8540_defconfig
+++ b/arch/powerpc/configs/85xx/tqm8540_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.31-rc4 3# Linux kernel version: 2.6.32-rc5
4# Wed Jul 29 23:32:21 2009 4# Thu Nov 5 08:20:39 2009
5# 5#
6# CONFIG_PPC64 is not set 6# CONFIG_PPC64 is not set
7 7
@@ -22,6 +22,7 @@ CONFIG_FSL_EMB_PERFMON=y
22# CONFIG_PHYS_64BIT is not set 22# CONFIG_PHYS_64BIT is not set
23CONFIG_SPE=y 23CONFIG_SPE=y
24CONFIG_PPC_MMU_NOHASH=y 24CONFIG_PPC_MMU_NOHASH=y
25CONFIG_PPC_MMU_NOHASH_32=y
25CONFIG_PPC_BOOK3E_MMU=y 26CONFIG_PPC_BOOK3E_MMU=y
26# CONFIG_PPC_MM_SLICES is not set 27# CONFIG_PPC_MM_SLICES is not set
27# CONFIG_SMP is not set 28# CONFIG_SMP is not set
@@ -36,6 +37,7 @@ CONFIG_GENERIC_CLOCKEVENTS=y
36CONFIG_GENERIC_HARDIRQS=y 37CONFIG_GENERIC_HARDIRQS=y
37CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=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
40# CONFIG_NEED_PER_CPU_EMBED_FIRST_CHUNK is not set
39CONFIG_IRQ_PER_CPU=y 41CONFIG_IRQ_PER_CPU=y
40CONFIG_STACKTRACE_SUPPORT=y 42CONFIG_STACKTRACE_SUPPORT=y
41CONFIG_HAVE_LATENCYTOP_SUPPORT=y 43CONFIG_HAVE_LATENCYTOP_SUPPORT=y
@@ -84,11 +86,12 @@ CONFIG_SYSVIPC_SYSCTL=y
84# 86#
85# RCU Subsystem 87# RCU Subsystem
86# 88#
87CONFIG_CLASSIC_RCU=y 89CONFIG_TREE_RCU=y
88# CONFIG_TREE_RCU is not set 90# CONFIG_TREE_PREEMPT_RCU is not set
89# CONFIG_PREEMPT_RCU is not set 91# CONFIG_RCU_TRACE is not set
92CONFIG_RCU_FANOUT=32
93# CONFIG_RCU_FANOUT_EXACT is not set
90# CONFIG_TREE_RCU_TRACE is not set 94# CONFIG_TREE_RCU_TRACE is not set
91# CONFIG_PREEMPT_RCU_TRACE is not set
92# CONFIG_IKCONFIG is not set 95# CONFIG_IKCONFIG is not set
93CONFIG_LOG_BUF_SHIFT=14 96CONFIG_LOG_BUF_SHIFT=14
94CONFIG_GROUP_SCHED=y 97CONFIG_GROUP_SCHED=y
@@ -124,28 +127,29 @@ CONFIG_TIMERFD=y
124CONFIG_EVENTFD=y 127CONFIG_EVENTFD=y
125CONFIG_SHMEM=y 128CONFIG_SHMEM=y
126CONFIG_AIO=y 129CONFIG_AIO=y
127CONFIG_HAVE_PERF_COUNTERS=y 130CONFIG_HAVE_PERF_EVENTS=y
128 131
129# 132#
130# Performance Counters 133# Kernel Performance Events And Counters
131# 134#
135# CONFIG_PERF_EVENTS is not set
132# CONFIG_PERF_COUNTERS is not set 136# CONFIG_PERF_COUNTERS is not set
133CONFIG_VM_EVENT_COUNTERS=y 137CONFIG_VM_EVENT_COUNTERS=y
134CONFIG_PCI_QUIRKS=y 138CONFIG_PCI_QUIRKS=y
135CONFIG_SLUB_DEBUG=y 139CONFIG_SLUB_DEBUG=y
136# CONFIG_STRIP_ASM_SYMS is not set
137CONFIG_COMPAT_BRK=y 140CONFIG_COMPAT_BRK=y
138# CONFIG_SLAB is not set 141# CONFIG_SLAB is not set
139CONFIG_SLUB=y 142CONFIG_SLUB=y
140# CONFIG_SLOB is not set 143# CONFIG_SLOB is not set
141# CONFIG_PROFILING is not set 144# CONFIG_PROFILING is not set
142# CONFIG_MARKERS is not set
143CONFIG_HAVE_OPROFILE=y 145CONFIG_HAVE_OPROFILE=y
144CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS=y 146CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS=y
145CONFIG_HAVE_IOREMAP_PROT=y 147CONFIG_HAVE_IOREMAP_PROT=y
146CONFIG_HAVE_KPROBES=y 148CONFIG_HAVE_KPROBES=y
147CONFIG_HAVE_KRETPROBES=y 149CONFIG_HAVE_KRETPROBES=y
148CONFIG_HAVE_ARCH_TRACEHOOK=y 150CONFIG_HAVE_ARCH_TRACEHOOK=y
151CONFIG_HAVE_DMA_ATTRS=y
152CONFIG_HAVE_DMA_API_DEBUG=y
149 153
150# 154#
151# GCOV-based kernel profiling 155# GCOV-based kernel profiling
@@ -188,6 +192,7 @@ CONFIG_MPC85xx=y
188# CONFIG_MPC85xx_MDS is not set 192# CONFIG_MPC85xx_MDS is not set
189# CONFIG_MPC8536_DS is not set 193# CONFIG_MPC8536_DS is not set
190# CONFIG_MPC85xx_DS is not set 194# CONFIG_MPC85xx_DS is not set
195# CONFIG_MPC85xx_RDB is not set
191# CONFIG_SOCRATES is not set 196# CONFIG_SOCRATES is not set
192# CONFIG_KSI8560 is not set 197# CONFIG_KSI8560 is not set
193# CONFIG_XES_MPC85xx is not set 198# CONFIG_XES_MPC85xx is not set
@@ -243,6 +248,7 @@ CONFIG_MATH_EMULATION=y
243CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y 248CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y
244CONFIG_ARCH_HAS_WALK_MEMORY=y 249CONFIG_ARCH_HAS_WALK_MEMORY=y
245CONFIG_ARCH_ENABLE_MEMORY_HOTREMOVE=y 250CONFIG_ARCH_ENABLE_MEMORY_HOTREMOVE=y
251CONFIG_MAX_ACTIVE_REGIONS=32
246CONFIG_ARCH_FLATMEM_ENABLE=y 252CONFIG_ARCH_FLATMEM_ENABLE=y
247CONFIG_ARCH_POPULATES_NODE_MAP=y 253CONFIG_ARCH_POPULATES_NODE_MAP=y
248CONFIG_SELECT_MEMORY_MODEL=y 254CONFIG_SELECT_MEMORY_MODEL=y
@@ -260,6 +266,7 @@ CONFIG_BOUNCE=y
260CONFIG_VIRT_TO_BUS=y 266CONFIG_VIRT_TO_BUS=y
261CONFIG_HAVE_MLOCK=y 267CONFIG_HAVE_MLOCK=y
262CONFIG_HAVE_MLOCKED_PAGE_BIT=y 268CONFIG_HAVE_MLOCKED_PAGE_BIT=y
269# CONFIG_KSM is not set
263CONFIG_DEFAULT_MMAP_MIN_ADDR=4096 270CONFIG_DEFAULT_MMAP_MIN_ADDR=4096
264CONFIG_PPC_4K_PAGES=y 271CONFIG_PPC_4K_PAGES=y
265# CONFIG_PPC_16K_PAGES is not set 272# CONFIG_PPC_16K_PAGES is not set
@@ -354,6 +361,7 @@ CONFIG_DEFAULT_TCP_CONG="cubic"
354# CONFIG_NETFILTER is not set 361# CONFIG_NETFILTER is not set
355# CONFIG_IP_DCCP is not set 362# CONFIG_IP_DCCP is not set
356# CONFIG_IP_SCTP is not set 363# CONFIG_IP_SCTP is not set
364# CONFIG_RDS is not set
357# CONFIG_TIPC is not set 365# CONFIG_TIPC is not set
358# CONFIG_ATM is not set 366# CONFIG_ATM is not set
359# CONFIG_BRIDGE is not set 367# CONFIG_BRIDGE is not set
@@ -383,6 +391,7 @@ CONFIG_DEFAULT_TCP_CONG="cubic"
383# CONFIG_AF_RXRPC is not set 391# CONFIG_AF_RXRPC is not set
384CONFIG_WIRELESS=y 392CONFIG_WIRELESS=y
385# CONFIG_CFG80211 is not set 393# CONFIG_CFG80211 is not set
394CONFIG_CFG80211_DEFAULT_PS_VALUE=0
386CONFIG_WIRELESS_OLD_REGULATORY=y 395CONFIG_WIRELESS_OLD_REGULATORY=y
387# CONFIG_WIRELESS_EXT is not set 396# CONFIG_WIRELESS_EXT is not set
388# CONFIG_LIB80211 is not set 397# CONFIG_LIB80211 is not set
@@ -390,7 +399,6 @@ CONFIG_WIRELESS_OLD_REGULATORY=y
390# 399#
391# CFG80211 needs to be enabled for MAC80211 400# CFG80211 needs to be enabled for MAC80211
392# 401#
393CONFIG_MAC80211_DEFAULT_PS_VALUE=0
394# CONFIG_WIMAX is not set 402# CONFIG_WIMAX is not set
395# CONFIG_RFKILL is not set 403# CONFIG_RFKILL is not set
396# CONFIG_NET_9P is not set 404# CONFIG_NET_9P is not set
@@ -677,9 +685,11 @@ CONFIG_E100=y
677# CONFIG_SUNDANCE is not set 685# CONFIG_SUNDANCE is not set
678# CONFIG_TLAN is not set 686# CONFIG_TLAN is not set
679# CONFIG_KS8842 is not set 687# CONFIG_KS8842 is not set
688# CONFIG_KS8851_MLL is not set
680# CONFIG_VIA_RHINE is not set 689# CONFIG_VIA_RHINE is not set
681# CONFIG_SC92031 is not set 690# CONFIG_SC92031 is not set
682# CONFIG_ATL2 is not set 691# CONFIG_ATL2 is not set
692# CONFIG_XILINX_EMACLITE is not set
683CONFIG_NETDEV_1000=y 693CONFIG_NETDEV_1000=y
684# CONFIG_ACENIC is not set 694# CONFIG_ACENIC is not set
685# CONFIG_DL2K is not set 695# CONFIG_DL2K is not set
@@ -727,10 +737,7 @@ CONFIG_CHELSIO_T3_DEPENDS=y
727# CONFIG_SFC is not set 737# CONFIG_SFC is not set
728# CONFIG_BE2NET is not set 738# CONFIG_BE2NET is not set
729# CONFIG_TR is not set 739# CONFIG_TR is not set
730 740CONFIG_WLAN=y
731#
732# Wireless LAN
733#
734# CONFIG_WLAN_PRE80211 is not set 741# CONFIG_WLAN_PRE80211 is not set
735# CONFIG_WLAN_80211 is not set 742# CONFIG_WLAN_80211 is not set
736 743
@@ -824,6 +831,7 @@ CONFIG_GEN_RTC=y
824CONFIG_DEVPORT=y 831CONFIG_DEVPORT=y
825CONFIG_I2C=y 832CONFIG_I2C=y
826CONFIG_I2C_BOARDINFO=y 833CONFIG_I2C_BOARDINFO=y
834CONFIG_I2C_COMPAT=y
827CONFIG_I2C_CHARDEV=y 835CONFIG_I2C_CHARDEV=y
828CONFIG_I2C_HELPER_AUTO=y 836CONFIG_I2C_HELPER_AUTO=y
829 837
@@ -876,9 +884,6 @@ CONFIG_I2C_MPC=y
876# Miscellaneous I2C Chip support 884# Miscellaneous I2C Chip support
877# 885#
878# CONFIG_DS1682 is not set 886# CONFIG_DS1682 is not set
879# CONFIG_SENSORS_PCF8574 is not set
880# CONFIG_PCF8575 is not set
881# CONFIG_SENSORS_PCA9539 is not set
882# CONFIG_SENSORS_TSL2550 is not set 887# CONFIG_SENSORS_TSL2550 is not set
883# CONFIG_I2C_DEBUG_CORE is not set 888# CONFIG_I2C_DEBUG_CORE is not set
884# CONFIG_I2C_DEBUG_ALGO is not set 889# CONFIG_I2C_DEBUG_ALGO is not set
@@ -896,6 +901,11 @@ CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y
896# CONFIG_POWER_SUPPLY is not set 901# CONFIG_POWER_SUPPLY is not set
897CONFIG_HWMON=y 902CONFIG_HWMON=y
898# CONFIG_HWMON_VID is not set 903# CONFIG_HWMON_VID is not set
904CONFIG_HWMON_DEBUG_CHIP=y
905
906#
907# Native drivers
908#
899# CONFIG_SENSORS_AD7414 is not set 909# CONFIG_SENSORS_AD7414 is not set
900# CONFIG_SENSORS_AD7418 is not set 910# CONFIG_SENSORS_AD7418 is not set
901# CONFIG_SENSORS_ADM1021 is not set 911# CONFIG_SENSORS_ADM1021 is not set
@@ -945,6 +955,7 @@ CONFIG_SENSORS_LM75=y
945# CONFIG_SENSORS_ADS7828 is not set 955# CONFIG_SENSORS_ADS7828 is not set
946# CONFIG_SENSORS_THMC50 is not set 956# CONFIG_SENSORS_THMC50 is not set
947# CONFIG_SENSORS_TMP401 is not set 957# CONFIG_SENSORS_TMP401 is not set
958# CONFIG_SENSORS_TMP421 is not set
948# CONFIG_SENSORS_VIA686A is not set 959# CONFIG_SENSORS_VIA686A is not set
949# CONFIG_SENSORS_VT1211 is not set 960# CONFIG_SENSORS_VT1211 is not set
950# CONFIG_SENSORS_VT8231 is not set 961# CONFIG_SENSORS_VT8231 is not set
@@ -956,9 +967,7 @@ CONFIG_SENSORS_LM75=y
956# CONFIG_SENSORS_W83L786NG is not set 967# CONFIG_SENSORS_W83L786NG is not set
957# CONFIG_SENSORS_W83627HF is not set 968# CONFIG_SENSORS_W83627HF is not set
958# CONFIG_SENSORS_W83627EHF is not set 969# CONFIG_SENSORS_W83627EHF is not set
959CONFIG_HWMON_DEBUG_CHIP=y
960# CONFIG_THERMAL is not set 970# CONFIG_THERMAL is not set
961# CONFIG_THERMAL_HWMON is not set
962# CONFIG_WATCHDOG is not set 971# CONFIG_WATCHDOG is not set
963CONFIG_SSB_POSSIBLE=y 972CONFIG_SSB_POSSIBLE=y
964 973
@@ -977,6 +986,7 @@ CONFIG_SSB_POSSIBLE=y
977# CONFIG_MFD_TMIO is not set 986# CONFIG_MFD_TMIO is not set
978# CONFIG_PMIC_DA903X is not set 987# CONFIG_PMIC_DA903X is not set
979# CONFIG_MFD_WM8400 is not set 988# CONFIG_MFD_WM8400 is not set
989# CONFIG_MFD_WM831X is not set
980# CONFIG_MFD_WM8350_I2C is not set 990# CONFIG_MFD_WM8350_I2C is not set
981# CONFIG_MFD_PCF50633 is not set 991# CONFIG_MFD_PCF50633 is not set
982# CONFIG_AB3100_CORE is not set 992# CONFIG_AB3100_CORE is not set
@@ -987,6 +997,7 @@ CONFIG_SSB_POSSIBLE=y
987# Graphics support 997# Graphics support
988# 998#
989# CONFIG_AGP is not set 999# CONFIG_AGP is not set
1000CONFIG_VGA_ARB=y
990# CONFIG_DRM is not set 1001# CONFIG_DRM is not set
991# CONFIG_VGASTATE is not set 1002# CONFIG_VGASTATE is not set
992# CONFIG_VIDEO_OUTPUT_CONTROL is not set 1003# CONFIG_VIDEO_OUTPUT_CONTROL is not set
@@ -1000,7 +1011,6 @@ CONFIG_SSB_POSSIBLE=y
1000# CONFIG_SOUND is not set 1011# CONFIG_SOUND is not set
1001CONFIG_HID_SUPPORT=y 1012CONFIG_HID_SUPPORT=y
1002CONFIG_HID=y 1013CONFIG_HID=y
1003# CONFIG_HID_DEBUG is not set
1004# CONFIG_HIDRAW is not set 1014# CONFIG_HIDRAW is not set
1005# CONFIG_HID_PID is not set 1015# CONFIG_HID_PID is not set
1006 1016
@@ -1065,6 +1075,7 @@ CONFIG_FS_MBCACHE=y
1065# CONFIG_GFS2_FS is not set 1075# CONFIG_GFS2_FS is not set
1066# CONFIG_OCFS2_FS is not set 1076# CONFIG_OCFS2_FS is not set
1067# CONFIG_BTRFS_FS is not set 1077# CONFIG_BTRFS_FS is not set
1078# CONFIG_NILFS2_FS is not set
1068CONFIG_FILE_LOCKING=y 1079CONFIG_FILE_LOCKING=y
1069CONFIG_FSNOTIFY=y 1080CONFIG_FSNOTIFY=y
1070CONFIG_DNOTIFY=y 1081CONFIG_DNOTIFY=y
@@ -1134,7 +1145,6 @@ CONFIG_CRAMFS=y
1134# CONFIG_ROMFS_FS is not set 1145# CONFIG_ROMFS_FS is not set
1135# CONFIG_SYSV_FS is not set 1146# CONFIG_SYSV_FS is not set
1136# CONFIG_UFS_FS is not set 1147# CONFIG_UFS_FS is not set
1137# CONFIG_NILFS2_FS is not set
1138CONFIG_NETWORK_FILESYSTEMS=y 1148CONFIG_NETWORK_FILESYSTEMS=y
1139CONFIG_NFS_FS=y 1149CONFIG_NFS_FS=y
1140# CONFIG_NFS_V3 is not set 1150# CONFIG_NFS_V3 is not set
@@ -1203,6 +1213,7 @@ CONFIG_ENABLE_WARN_DEPRECATED=y
1203CONFIG_ENABLE_MUST_CHECK=y 1213CONFIG_ENABLE_MUST_CHECK=y
1204CONFIG_FRAME_WARN=1024 1214CONFIG_FRAME_WARN=1024
1205# CONFIG_MAGIC_SYSRQ is not set 1215# CONFIG_MAGIC_SYSRQ is not set
1216# CONFIG_STRIP_ASM_SYMS is not set
1206# CONFIG_UNUSED_SYMBOLS is not set 1217# CONFIG_UNUSED_SYMBOLS is not set
1207# CONFIG_DEBUG_FS is not set 1218# CONFIG_DEBUG_FS is not set
1208# CONFIG_HEADERS_CHECK is not set 1219# CONFIG_HEADERS_CHECK is not set
@@ -1220,6 +1231,7 @@ CONFIG_HAVE_DYNAMIC_FTRACE=y
1220CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y 1231CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y
1221CONFIG_TRACING_SUPPORT=y 1232CONFIG_TRACING_SUPPORT=y
1222# CONFIG_FTRACE is not set 1233# CONFIG_FTRACE is not set
1234# CONFIG_DMA_API_DEBUG is not set
1223# CONFIG_SAMPLES is not set 1235# CONFIG_SAMPLES is not set
1224CONFIG_HAVE_ARCH_KGDB=y 1236CONFIG_HAVE_ARCH_KGDB=y
1225# CONFIG_PPC_DISABLE_WERROR is not set 1237# CONFIG_PPC_DISABLE_WERROR is not set
@@ -1240,7 +1252,6 @@ CONFIG_CRYPTO=y
1240# 1252#
1241# Crypto core or helper 1253# Crypto core or helper
1242# 1254#
1243# CONFIG_CRYPTO_FIPS is not set
1244# CONFIG_CRYPTO_MANAGER is not set 1255# CONFIG_CRYPTO_MANAGER is not set
1245# CONFIG_CRYPTO_MANAGER2 is not set 1256# CONFIG_CRYPTO_MANAGER2 is not set
1246# CONFIG_CRYPTO_GF128MUL is not set 1257# CONFIG_CRYPTO_GF128MUL is not set
@@ -1271,11 +1282,13 @@ CONFIG_CRYPTO=y
1271# 1282#
1272# CONFIG_CRYPTO_HMAC is not set 1283# CONFIG_CRYPTO_HMAC is not set
1273# CONFIG_CRYPTO_XCBC is not set 1284# CONFIG_CRYPTO_XCBC is not set
1285# CONFIG_CRYPTO_VMAC is not set
1274 1286
1275# 1287#
1276# Digest 1288# Digest
1277# 1289#
1278# CONFIG_CRYPTO_CRC32C is not set 1290# CONFIG_CRYPTO_CRC32C is not set
1291# CONFIG_CRYPTO_GHASH is not set
1279# CONFIG_CRYPTO_MD4 is not set 1292# CONFIG_CRYPTO_MD4 is not set
1280# CONFIG_CRYPTO_MD5 is not set 1293# CONFIG_CRYPTO_MD5 is not set
1281# CONFIG_CRYPTO_MICHAEL_MIC is not set 1294# CONFIG_CRYPTO_MICHAEL_MIC is not set
diff --git a/arch/powerpc/configs/85xx/tqm8541_defconfig b/arch/powerpc/configs/85xx/tqm8541_defconfig
index 845731dc51c6..91d85d733827 100644
--- a/arch/powerpc/configs/85xx/tqm8541_defconfig
+++ b/arch/powerpc/configs/85xx/tqm8541_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.31-rc4 3# Linux kernel version: 2.6.32-rc5
4# Wed Jul 29 23:32:22 2009 4# Thu Nov 5 08:20:40 2009
5# 5#
6# CONFIG_PPC64 is not set 6# CONFIG_PPC64 is not set
7 7
@@ -22,6 +22,7 @@ CONFIG_FSL_EMB_PERFMON=y
22# CONFIG_PHYS_64BIT is not set 22# CONFIG_PHYS_64BIT is not set
23CONFIG_SPE=y 23CONFIG_SPE=y
24CONFIG_PPC_MMU_NOHASH=y 24CONFIG_PPC_MMU_NOHASH=y
25CONFIG_PPC_MMU_NOHASH_32=y
25CONFIG_PPC_BOOK3E_MMU=y 26CONFIG_PPC_BOOK3E_MMU=y
26# CONFIG_PPC_MM_SLICES is not set 27# CONFIG_PPC_MM_SLICES is not set
27# CONFIG_SMP is not set 28# CONFIG_SMP is not set
@@ -36,6 +37,7 @@ CONFIG_GENERIC_CLOCKEVENTS=y
36CONFIG_GENERIC_HARDIRQS=y 37CONFIG_GENERIC_HARDIRQS=y
37CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=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
40# CONFIG_NEED_PER_CPU_EMBED_FIRST_CHUNK is not set
39CONFIG_IRQ_PER_CPU=y 41CONFIG_IRQ_PER_CPU=y
40CONFIG_STACKTRACE_SUPPORT=y 42CONFIG_STACKTRACE_SUPPORT=y
41CONFIG_HAVE_LATENCYTOP_SUPPORT=y 43CONFIG_HAVE_LATENCYTOP_SUPPORT=y
@@ -85,11 +87,12 @@ CONFIG_SYSVIPC_SYSCTL=y
85# 87#
86# RCU Subsystem 88# RCU Subsystem
87# 89#
88CONFIG_CLASSIC_RCU=y 90CONFIG_TREE_RCU=y
89# CONFIG_TREE_RCU is not set 91# CONFIG_TREE_PREEMPT_RCU is not set
90# CONFIG_PREEMPT_RCU is not set 92# CONFIG_RCU_TRACE is not set
93CONFIG_RCU_FANOUT=32
94# CONFIG_RCU_FANOUT_EXACT is not set
91# CONFIG_TREE_RCU_TRACE is not set 95# CONFIG_TREE_RCU_TRACE is not set
92# CONFIG_PREEMPT_RCU_TRACE is not set
93# CONFIG_IKCONFIG is not set 96# CONFIG_IKCONFIG is not set
94CONFIG_LOG_BUF_SHIFT=14 97CONFIG_LOG_BUF_SHIFT=14
95CONFIG_GROUP_SCHED=y 98CONFIG_GROUP_SCHED=y
@@ -125,29 +128,30 @@ CONFIG_TIMERFD=y
125CONFIG_EVENTFD=y 128CONFIG_EVENTFD=y
126CONFIG_SHMEM=y 129CONFIG_SHMEM=y
127CONFIG_AIO=y 130CONFIG_AIO=y
128CONFIG_HAVE_PERF_COUNTERS=y 131CONFIG_HAVE_PERF_EVENTS=y
129 132
130# 133#
131# Performance Counters 134# Kernel Performance Events And Counters
132# 135#
136# CONFIG_PERF_EVENTS is not set
133# CONFIG_PERF_COUNTERS is not set 137# CONFIG_PERF_COUNTERS is not set
134CONFIG_VM_EVENT_COUNTERS=y 138CONFIG_VM_EVENT_COUNTERS=y
135CONFIG_PCI_QUIRKS=y 139CONFIG_PCI_QUIRKS=y
136CONFIG_SLUB_DEBUG=y 140CONFIG_SLUB_DEBUG=y
137# CONFIG_STRIP_ASM_SYMS is not set
138CONFIG_COMPAT_BRK=y 141CONFIG_COMPAT_BRK=y
139# CONFIG_SLAB is not set 142# CONFIG_SLAB is not set
140CONFIG_SLUB=y 143CONFIG_SLUB=y
141# CONFIG_SLOB is not set 144# CONFIG_SLOB is not set
142# CONFIG_PROFILING is not set 145# CONFIG_PROFILING is not set
143# CONFIG_MARKERS is not set
144CONFIG_HAVE_OPROFILE=y 146CONFIG_HAVE_OPROFILE=y
145CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS=y 147CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS=y
146CONFIG_HAVE_IOREMAP_PROT=y 148CONFIG_HAVE_IOREMAP_PROT=y
147CONFIG_HAVE_KPROBES=y 149CONFIG_HAVE_KPROBES=y
148CONFIG_HAVE_KRETPROBES=y 150CONFIG_HAVE_KRETPROBES=y
149CONFIG_HAVE_ARCH_TRACEHOOK=y 151CONFIG_HAVE_ARCH_TRACEHOOK=y
152CONFIG_HAVE_DMA_ATTRS=y
150CONFIG_HAVE_CLK=y 153CONFIG_HAVE_CLK=y
154CONFIG_HAVE_DMA_API_DEBUG=y
151 155
152# 156#
153# GCOV-based kernel profiling 157# GCOV-based kernel profiling
@@ -190,6 +194,7 @@ CONFIG_MPC85xx=y
190# CONFIG_MPC85xx_MDS is not set 194# CONFIG_MPC85xx_MDS is not set
191# CONFIG_MPC8536_DS is not set 195# CONFIG_MPC8536_DS is not set
192# CONFIG_MPC85xx_DS is not set 196# CONFIG_MPC85xx_DS is not set
197# CONFIG_MPC85xx_RDB is not set
193# CONFIG_SOCRATES is not set 198# CONFIG_SOCRATES is not set
194# CONFIG_KSI8560 is not set 199# CONFIG_KSI8560 is not set
195# CONFIG_XES_MPC85xx is not set 200# CONFIG_XES_MPC85xx is not set
@@ -246,6 +251,7 @@ CONFIG_MATH_EMULATION=y
246CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y 251CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y
247CONFIG_ARCH_HAS_WALK_MEMORY=y 252CONFIG_ARCH_HAS_WALK_MEMORY=y
248CONFIG_ARCH_ENABLE_MEMORY_HOTREMOVE=y 253CONFIG_ARCH_ENABLE_MEMORY_HOTREMOVE=y
254CONFIG_MAX_ACTIVE_REGIONS=32
249CONFIG_ARCH_FLATMEM_ENABLE=y 255CONFIG_ARCH_FLATMEM_ENABLE=y
250CONFIG_ARCH_POPULATES_NODE_MAP=y 256CONFIG_ARCH_POPULATES_NODE_MAP=y
251CONFIG_SELECT_MEMORY_MODEL=y 257CONFIG_SELECT_MEMORY_MODEL=y
@@ -263,6 +269,7 @@ CONFIG_BOUNCE=y
263CONFIG_VIRT_TO_BUS=y 269CONFIG_VIRT_TO_BUS=y
264CONFIG_HAVE_MLOCK=y 270CONFIG_HAVE_MLOCK=y
265CONFIG_HAVE_MLOCKED_PAGE_BIT=y 271CONFIG_HAVE_MLOCKED_PAGE_BIT=y
272# CONFIG_KSM is not set
266CONFIG_DEFAULT_MMAP_MIN_ADDR=4096 273CONFIG_DEFAULT_MMAP_MIN_ADDR=4096
267CONFIG_PPC_4K_PAGES=y 274CONFIG_PPC_4K_PAGES=y
268# CONFIG_PPC_16K_PAGES is not set 275# CONFIG_PPC_16K_PAGES is not set
@@ -357,6 +364,7 @@ CONFIG_DEFAULT_TCP_CONG="cubic"
357# CONFIG_NETFILTER is not set 364# CONFIG_NETFILTER is not set
358# CONFIG_IP_DCCP is not set 365# CONFIG_IP_DCCP is not set
359# CONFIG_IP_SCTP is not set 366# CONFIG_IP_SCTP is not set
367# CONFIG_RDS is not set
360# CONFIG_TIPC is not set 368# CONFIG_TIPC is not set
361# CONFIG_ATM is not set 369# CONFIG_ATM is not set
362# CONFIG_BRIDGE is not set 370# CONFIG_BRIDGE is not set
@@ -386,6 +394,7 @@ CONFIG_DEFAULT_TCP_CONG="cubic"
386# CONFIG_AF_RXRPC is not set 394# CONFIG_AF_RXRPC is not set
387CONFIG_WIRELESS=y 395CONFIG_WIRELESS=y
388# CONFIG_CFG80211 is not set 396# CONFIG_CFG80211 is not set
397CONFIG_CFG80211_DEFAULT_PS_VALUE=0
389CONFIG_WIRELESS_OLD_REGULATORY=y 398CONFIG_WIRELESS_OLD_REGULATORY=y
390# CONFIG_WIRELESS_EXT is not set 399# CONFIG_WIRELESS_EXT is not set
391# CONFIG_LIB80211 is not set 400# CONFIG_LIB80211 is not set
@@ -393,7 +402,6 @@ CONFIG_WIRELESS_OLD_REGULATORY=y
393# 402#
394# CFG80211 needs to be enabled for MAC80211 403# CFG80211 needs to be enabled for MAC80211
395# 404#
396CONFIG_MAC80211_DEFAULT_PS_VALUE=0
397# CONFIG_WIMAX is not set 405# CONFIG_WIMAX is not set
398# CONFIG_RFKILL is not set 406# CONFIG_RFKILL is not set
399# CONFIG_NET_9P is not set 407# CONFIG_NET_9P is not set
@@ -681,9 +689,11 @@ CONFIG_E100=y
681# CONFIG_SUNDANCE is not set 689# CONFIG_SUNDANCE is not set
682# CONFIG_TLAN is not set 690# CONFIG_TLAN is not set
683# CONFIG_KS8842 is not set 691# CONFIG_KS8842 is not set
692# CONFIG_KS8851_MLL is not set
684# CONFIG_VIA_RHINE is not set 693# CONFIG_VIA_RHINE is not set
685# CONFIG_SC92031 is not set 694# CONFIG_SC92031 is not set
686# CONFIG_ATL2 is not set 695# CONFIG_ATL2 is not set
696# CONFIG_XILINX_EMACLITE is not set
687# CONFIG_FS_ENET is not set 697# CONFIG_FS_ENET is not set
688CONFIG_NETDEV_1000=y 698CONFIG_NETDEV_1000=y
689# CONFIG_ACENIC is not set 699# CONFIG_ACENIC is not set
@@ -732,10 +742,7 @@ CONFIG_CHELSIO_T3_DEPENDS=y
732# CONFIG_SFC is not set 742# CONFIG_SFC is not set
733# CONFIG_BE2NET is not set 743# CONFIG_BE2NET is not set
734# CONFIG_TR is not set 744# CONFIG_TR is not set
735 745CONFIG_WLAN=y
736#
737# Wireless LAN
738#
739# CONFIG_WLAN_PRE80211 is not set 746# CONFIG_WLAN_PRE80211 is not set
740# CONFIG_WLAN_80211 is not set 747# CONFIG_WLAN_80211 is not set
741 748
@@ -831,6 +838,7 @@ CONFIG_GEN_RTC=y
831CONFIG_DEVPORT=y 838CONFIG_DEVPORT=y
832CONFIG_I2C=y 839CONFIG_I2C=y
833CONFIG_I2C_BOARDINFO=y 840CONFIG_I2C_BOARDINFO=y
841CONFIG_I2C_COMPAT=y
834CONFIG_I2C_CHARDEV=y 842CONFIG_I2C_CHARDEV=y
835CONFIG_I2C_HELPER_AUTO=y 843CONFIG_I2C_HELPER_AUTO=y
836 844
@@ -886,9 +894,6 @@ CONFIG_I2C_MPC=y
886# Miscellaneous I2C Chip support 894# Miscellaneous I2C Chip support
887# 895#
888# CONFIG_DS1682 is not set 896# CONFIG_DS1682 is not set
889# CONFIG_SENSORS_PCF8574 is not set
890# CONFIG_PCF8575 is not set
891# CONFIG_SENSORS_PCA9539 is not set
892# CONFIG_SENSORS_TSL2550 is not set 897# CONFIG_SENSORS_TSL2550 is not set
893# CONFIG_I2C_DEBUG_CORE is not set 898# CONFIG_I2C_DEBUG_CORE is not set
894# CONFIG_I2C_DEBUG_ALGO is not set 899# CONFIG_I2C_DEBUG_ALGO is not set
@@ -921,14 +926,24 @@ CONFIG_GPIOLIB=y
921# PCI GPIO expanders: 926# PCI GPIO expanders:
922# 927#
923# CONFIG_GPIO_BT8XX is not set 928# CONFIG_GPIO_BT8XX is not set
929# CONFIG_GPIO_LANGWELL is not set
924 930
925# 931#
926# SPI GPIO expanders: 932# SPI GPIO expanders:
927# 933#
934
935#
936# AC97 GPIO expanders:
937#
928# CONFIG_W1 is not set 938# CONFIG_W1 is not set
929# CONFIG_POWER_SUPPLY is not set 939# CONFIG_POWER_SUPPLY is not set
930CONFIG_HWMON=y 940CONFIG_HWMON=y
931# CONFIG_HWMON_VID is not set 941# CONFIG_HWMON_VID is not set
942CONFIG_HWMON_DEBUG_CHIP=y
943
944#
945# Native drivers
946#
932# CONFIG_SENSORS_AD7414 is not set 947# CONFIG_SENSORS_AD7414 is not set
933# CONFIG_SENSORS_AD7418 is not set 948# CONFIG_SENSORS_AD7418 is not set
934# CONFIG_SENSORS_ADM1021 is not set 949# CONFIG_SENSORS_ADM1021 is not set
@@ -979,6 +994,7 @@ CONFIG_SENSORS_LM75=y
979# CONFIG_SENSORS_ADS7828 is not set 994# CONFIG_SENSORS_ADS7828 is not set
980# CONFIG_SENSORS_THMC50 is not set 995# CONFIG_SENSORS_THMC50 is not set
981# CONFIG_SENSORS_TMP401 is not set 996# CONFIG_SENSORS_TMP401 is not set
997# CONFIG_SENSORS_TMP421 is not set
982# CONFIG_SENSORS_VIA686A is not set 998# CONFIG_SENSORS_VIA686A is not set
983# CONFIG_SENSORS_VT1211 is not set 999# CONFIG_SENSORS_VT1211 is not set
984# CONFIG_SENSORS_VT8231 is not set 1000# CONFIG_SENSORS_VT8231 is not set
@@ -990,9 +1006,7 @@ CONFIG_SENSORS_LM75=y
990# CONFIG_SENSORS_W83L786NG is not set 1006# CONFIG_SENSORS_W83L786NG is not set
991# CONFIG_SENSORS_W83627HF is not set 1007# CONFIG_SENSORS_W83627HF is not set
992# CONFIG_SENSORS_W83627EHF is not set 1008# CONFIG_SENSORS_W83627EHF is not set
993CONFIG_HWMON_DEBUG_CHIP=y
994# CONFIG_THERMAL is not set 1009# CONFIG_THERMAL is not set
995# CONFIG_THERMAL_HWMON is not set
996# CONFIG_WATCHDOG is not set 1010# CONFIG_WATCHDOG is not set
997CONFIG_SSB_POSSIBLE=y 1011CONFIG_SSB_POSSIBLE=y
998 1012
@@ -1012,6 +1026,7 @@ CONFIG_SSB_POSSIBLE=y
1012# CONFIG_MFD_TMIO is not set 1026# CONFIG_MFD_TMIO is not set
1013# CONFIG_PMIC_DA903X is not set 1027# CONFIG_PMIC_DA903X is not set
1014# CONFIG_MFD_WM8400 is not set 1028# CONFIG_MFD_WM8400 is not set
1029# CONFIG_MFD_WM831X is not set
1015# CONFIG_MFD_WM8350_I2C is not set 1030# CONFIG_MFD_WM8350_I2C is not set
1016# CONFIG_MFD_PCF50633 is not set 1031# CONFIG_MFD_PCF50633 is not set
1017# CONFIG_AB3100_CORE is not set 1032# CONFIG_AB3100_CORE is not set
@@ -1022,6 +1037,7 @@ CONFIG_SSB_POSSIBLE=y
1022# Graphics support 1037# Graphics support
1023# 1038#
1024# CONFIG_AGP is not set 1039# CONFIG_AGP is not set
1040CONFIG_VGA_ARB=y
1025# CONFIG_DRM is not set 1041# CONFIG_DRM is not set
1026# CONFIG_VGASTATE is not set 1042# CONFIG_VGASTATE is not set
1027# CONFIG_VIDEO_OUTPUT_CONTROL is not set 1043# CONFIG_VIDEO_OUTPUT_CONTROL is not set
@@ -1035,7 +1051,6 @@ CONFIG_SSB_POSSIBLE=y
1035# CONFIG_SOUND is not set 1051# CONFIG_SOUND is not set
1036CONFIG_HID_SUPPORT=y 1052CONFIG_HID_SUPPORT=y
1037CONFIG_HID=y 1053CONFIG_HID=y
1038# CONFIG_HID_DEBUG is not set
1039# CONFIG_HIDRAW is not set 1054# CONFIG_HIDRAW is not set
1040# CONFIG_HID_PID is not set 1055# CONFIG_HID_PID is not set
1041 1056
@@ -1100,6 +1115,7 @@ CONFIG_FS_MBCACHE=y
1100# CONFIG_GFS2_FS is not set 1115# CONFIG_GFS2_FS is not set
1101# CONFIG_OCFS2_FS is not set 1116# CONFIG_OCFS2_FS is not set
1102# CONFIG_BTRFS_FS is not set 1117# CONFIG_BTRFS_FS is not set
1118# CONFIG_NILFS2_FS is not set
1103CONFIG_FILE_LOCKING=y 1119CONFIG_FILE_LOCKING=y
1104CONFIG_FSNOTIFY=y 1120CONFIG_FSNOTIFY=y
1105CONFIG_DNOTIFY=y 1121CONFIG_DNOTIFY=y
@@ -1169,7 +1185,6 @@ CONFIG_CRAMFS=y
1169# CONFIG_ROMFS_FS is not set 1185# CONFIG_ROMFS_FS is not set
1170# CONFIG_SYSV_FS is not set 1186# CONFIG_SYSV_FS is not set
1171# CONFIG_UFS_FS is not set 1187# CONFIG_UFS_FS is not set
1172# CONFIG_NILFS2_FS is not set
1173CONFIG_NETWORK_FILESYSTEMS=y 1188CONFIG_NETWORK_FILESYSTEMS=y
1174CONFIG_NFS_FS=y 1189CONFIG_NFS_FS=y
1175# CONFIG_NFS_V3 is not set 1190# CONFIG_NFS_V3 is not set
@@ -1238,6 +1253,7 @@ CONFIG_ENABLE_WARN_DEPRECATED=y
1238CONFIG_ENABLE_MUST_CHECK=y 1253CONFIG_ENABLE_MUST_CHECK=y
1239CONFIG_FRAME_WARN=1024 1254CONFIG_FRAME_WARN=1024
1240# CONFIG_MAGIC_SYSRQ is not set 1255# CONFIG_MAGIC_SYSRQ is not set
1256# CONFIG_STRIP_ASM_SYMS is not set
1241# CONFIG_UNUSED_SYMBOLS is not set 1257# CONFIG_UNUSED_SYMBOLS is not set
1242# CONFIG_DEBUG_FS is not set 1258# CONFIG_DEBUG_FS is not set
1243# CONFIG_HEADERS_CHECK is not set 1259# CONFIG_HEADERS_CHECK is not set
@@ -1255,6 +1271,7 @@ CONFIG_HAVE_DYNAMIC_FTRACE=y
1255CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y 1271CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y
1256CONFIG_TRACING_SUPPORT=y 1272CONFIG_TRACING_SUPPORT=y
1257# CONFIG_FTRACE is not set 1273# CONFIG_FTRACE is not set
1274# CONFIG_DMA_API_DEBUG is not set
1258# CONFIG_SAMPLES is not set 1275# CONFIG_SAMPLES is not set
1259CONFIG_HAVE_ARCH_KGDB=y 1276CONFIG_HAVE_ARCH_KGDB=y
1260# CONFIG_PPC_DISABLE_WERROR is not set 1277# CONFIG_PPC_DISABLE_WERROR is not set
@@ -1275,7 +1292,6 @@ CONFIG_CRYPTO=y
1275# 1292#
1276# Crypto core or helper 1293# Crypto core or helper
1277# 1294#
1278# CONFIG_CRYPTO_FIPS is not set
1279# CONFIG_CRYPTO_MANAGER is not set 1295# CONFIG_CRYPTO_MANAGER is not set
1280# CONFIG_CRYPTO_MANAGER2 is not set 1296# CONFIG_CRYPTO_MANAGER2 is not set
1281# CONFIG_CRYPTO_GF128MUL is not set 1297# CONFIG_CRYPTO_GF128MUL is not set
@@ -1306,11 +1322,13 @@ CONFIG_CRYPTO=y
1306# 1322#
1307# CONFIG_CRYPTO_HMAC is not set 1323# CONFIG_CRYPTO_HMAC is not set
1308# CONFIG_CRYPTO_XCBC is not set 1324# CONFIG_CRYPTO_XCBC is not set
1325# CONFIG_CRYPTO_VMAC is not set
1309 1326
1310# 1327#
1311# Digest 1328# Digest
1312# 1329#
1313# CONFIG_CRYPTO_CRC32C is not set 1330# CONFIG_CRYPTO_CRC32C is not set
1331# CONFIG_CRYPTO_GHASH is not set
1314# CONFIG_CRYPTO_MD4 is not set 1332# CONFIG_CRYPTO_MD4 is not set
1315# CONFIG_CRYPTO_MD5 is not set 1333# CONFIG_CRYPTO_MD5 is not set
1316# CONFIG_CRYPTO_MICHAEL_MIC is not set 1334# CONFIG_CRYPTO_MICHAEL_MIC is not set
diff --git a/arch/powerpc/configs/85xx/tqm8548_defconfig b/arch/powerpc/configs/85xx/tqm8548_defconfig
index 4f228a905274..debe268f43d1 100644
--- a/arch/powerpc/configs/85xx/tqm8548_defconfig
+++ b/arch/powerpc/configs/85xx/tqm8548_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.31-rc4 3# Linux kernel version: 2.6.32-rc5
4# Wed Jul 29 23:32:23 2009 4# Thu Nov 5 08:20:41 2009
5# 5#
6# CONFIG_PPC64 is not set 6# CONFIG_PPC64 is not set
7 7
@@ -22,6 +22,7 @@ CONFIG_FSL_EMB_PERFMON=y
22# CONFIG_PHYS_64BIT is not set 22# CONFIG_PHYS_64BIT is not set
23CONFIG_SPE=y 23CONFIG_SPE=y
24CONFIG_PPC_MMU_NOHASH=y 24CONFIG_PPC_MMU_NOHASH=y
25CONFIG_PPC_MMU_NOHASH_32=y
25CONFIG_PPC_BOOK3E_MMU=y 26CONFIG_PPC_BOOK3E_MMU=y
26# CONFIG_PPC_MM_SLICES is not set 27# CONFIG_PPC_MM_SLICES is not set
27# CONFIG_SMP is not set 28# CONFIG_SMP is not set
@@ -36,6 +37,7 @@ CONFIG_GENERIC_CLOCKEVENTS=y
36CONFIG_GENERIC_HARDIRQS=y 37CONFIG_GENERIC_HARDIRQS=y
37CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=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
40# CONFIG_NEED_PER_CPU_EMBED_FIRST_CHUNK is not set
39CONFIG_IRQ_PER_CPU=y 41CONFIG_IRQ_PER_CPU=y
40CONFIG_STACKTRACE_SUPPORT=y 42CONFIG_STACKTRACE_SUPPORT=y
41CONFIG_HAVE_LATENCYTOP_SUPPORT=y 43CONFIG_HAVE_LATENCYTOP_SUPPORT=y
@@ -84,11 +86,12 @@ CONFIG_SYSVIPC_SYSCTL=y
84# 86#
85# RCU Subsystem 87# RCU Subsystem
86# 88#
87CONFIG_CLASSIC_RCU=y 89CONFIG_TREE_RCU=y
88# CONFIG_TREE_RCU is not set 90# CONFIG_TREE_PREEMPT_RCU is not set
89# CONFIG_PREEMPT_RCU is not set 91# CONFIG_RCU_TRACE is not set
92CONFIG_RCU_FANOUT=32
93# CONFIG_RCU_FANOUT_EXACT is not set
90# CONFIG_TREE_RCU_TRACE is not set 94# CONFIG_TREE_RCU_TRACE is not set
91# CONFIG_PREEMPT_RCU_TRACE is not set
92# CONFIG_IKCONFIG is not set 95# CONFIG_IKCONFIG is not set
93CONFIG_LOG_BUF_SHIFT=14 96CONFIG_LOG_BUF_SHIFT=14
94CONFIG_GROUP_SCHED=y 97CONFIG_GROUP_SCHED=y
@@ -126,22 +129,21 @@ CONFIG_TIMERFD=y
126CONFIG_EVENTFD=y 129CONFIG_EVENTFD=y
127CONFIG_SHMEM=y 130CONFIG_SHMEM=y
128CONFIG_AIO=y 131CONFIG_AIO=y
129CONFIG_HAVE_PERF_COUNTERS=y 132CONFIG_HAVE_PERF_EVENTS=y
130 133
131# 134#
132# Performance Counters 135# Kernel Performance Events And Counters
133# 136#
137# CONFIG_PERF_EVENTS is not set
134# CONFIG_PERF_COUNTERS is not set 138# CONFIG_PERF_COUNTERS is not set
135CONFIG_VM_EVENT_COUNTERS=y 139CONFIG_VM_EVENT_COUNTERS=y
136CONFIG_PCI_QUIRKS=y 140CONFIG_PCI_QUIRKS=y
137CONFIG_SLUB_DEBUG=y 141CONFIG_SLUB_DEBUG=y
138# CONFIG_STRIP_ASM_SYMS is not set
139CONFIG_COMPAT_BRK=y 142CONFIG_COMPAT_BRK=y
140# CONFIG_SLAB is not set 143# CONFIG_SLAB is not set
141CONFIG_SLUB=y 144CONFIG_SLUB=y
142# CONFIG_SLOB is not set 145# CONFIG_SLOB is not set
143# CONFIG_PROFILING is not set 146# CONFIG_PROFILING is not set
144# CONFIG_MARKERS is not set
145CONFIG_HAVE_OPROFILE=y 147CONFIG_HAVE_OPROFILE=y
146# CONFIG_KPROBES is not set 148# CONFIG_KPROBES is not set
147CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS=y 149CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS=y
@@ -149,6 +151,8 @@ CONFIG_HAVE_IOREMAP_PROT=y
149CONFIG_HAVE_KPROBES=y 151CONFIG_HAVE_KPROBES=y
150CONFIG_HAVE_KRETPROBES=y 152CONFIG_HAVE_KRETPROBES=y
151CONFIG_HAVE_ARCH_TRACEHOOK=y 153CONFIG_HAVE_ARCH_TRACEHOOK=y
154CONFIG_HAVE_DMA_ATTRS=y
155CONFIG_HAVE_DMA_API_DEBUG=y
152 156
153# 157#
154# GCOV-based kernel profiling 158# GCOV-based kernel profiling
@@ -196,6 +200,7 @@ CONFIG_MPC85xx=y
196# CONFIG_MPC85xx_MDS is not set 200# CONFIG_MPC85xx_MDS is not set
197# CONFIG_MPC8536_DS is not set 201# CONFIG_MPC8536_DS is not set
198# CONFIG_MPC85xx_DS is not set 202# CONFIG_MPC85xx_DS is not set
203# CONFIG_MPC85xx_RDB is not set
199# CONFIG_SOCRATES is not set 204# CONFIG_SOCRATES is not set
200# CONFIG_KSI8560 is not set 205# CONFIG_KSI8560 is not set
201# CONFIG_XES_MPC85xx is not set 206# CONFIG_XES_MPC85xx is not set
@@ -252,6 +257,7 @@ CONFIG_MATH_EMULATION=y
252CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y 257CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y
253CONFIG_ARCH_HAS_WALK_MEMORY=y 258CONFIG_ARCH_HAS_WALK_MEMORY=y
254CONFIG_ARCH_ENABLE_MEMORY_HOTREMOVE=y 259CONFIG_ARCH_ENABLE_MEMORY_HOTREMOVE=y
260CONFIG_MAX_ACTIVE_REGIONS=32
255CONFIG_ARCH_FLATMEM_ENABLE=y 261CONFIG_ARCH_FLATMEM_ENABLE=y
256CONFIG_ARCH_POPULATES_NODE_MAP=y 262CONFIG_ARCH_POPULATES_NODE_MAP=y
257CONFIG_SELECT_MEMORY_MODEL=y 263CONFIG_SELECT_MEMORY_MODEL=y
@@ -269,6 +275,7 @@ CONFIG_BOUNCE=y
269CONFIG_VIRT_TO_BUS=y 275CONFIG_VIRT_TO_BUS=y
270CONFIG_HAVE_MLOCK=y 276CONFIG_HAVE_MLOCK=y
271CONFIG_HAVE_MLOCKED_PAGE_BIT=y 277CONFIG_HAVE_MLOCKED_PAGE_BIT=y
278# CONFIG_KSM is not set
272CONFIG_DEFAULT_MMAP_MIN_ADDR=4096 279CONFIG_DEFAULT_MMAP_MIN_ADDR=4096
273CONFIG_PPC_4K_PAGES=y 280CONFIG_PPC_4K_PAGES=y
274# CONFIG_PPC_16K_PAGES is not set 281# CONFIG_PPC_16K_PAGES is not set
@@ -371,6 +378,7 @@ CONFIG_DEFAULT_TCP_CONG="cubic"
371# CONFIG_NETFILTER is not set 378# CONFIG_NETFILTER is not set
372# CONFIG_IP_DCCP is not set 379# CONFIG_IP_DCCP is not set
373# CONFIG_IP_SCTP is not set 380# CONFIG_IP_SCTP is not set
381# CONFIG_RDS is not set
374# CONFIG_TIPC is not set 382# CONFIG_TIPC is not set
375# CONFIG_ATM is not set 383# CONFIG_ATM is not set
376# CONFIG_BRIDGE is not set 384# CONFIG_BRIDGE is not set
@@ -411,6 +419,7 @@ CONFIG_DEFAULT_TCP_CONG="cubic"
411# Generic Driver Options 419# Generic Driver Options
412# 420#
413CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug" 421CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
422# CONFIG_DEVTMPFS is not set
414CONFIG_STANDALONE=y 423CONFIG_STANDALONE=y
415CONFIG_PREVENT_FIRMWARE_BUILD=y 424CONFIG_PREVENT_FIRMWARE_BUILD=y
416# CONFIG_FW_LOADER is not set 425# CONFIG_FW_LOADER is not set
@@ -420,9 +429,9 @@ CONFIG_PREVENT_FIRMWARE_BUILD=y
420# CONFIG_CONNECTOR is not set 429# CONFIG_CONNECTOR is not set
421CONFIG_MTD=y 430CONFIG_MTD=y
422# CONFIG_MTD_DEBUG is not set 431# CONFIG_MTD_DEBUG is not set
432# CONFIG_MTD_TESTS is not set
423# CONFIG_MTD_CONCAT is not set 433# CONFIG_MTD_CONCAT is not set
424CONFIG_MTD_PARTITIONS=y 434CONFIG_MTD_PARTITIONS=y
425# CONFIG_MTD_TESTS is not set
426# CONFIG_MTD_REDBOOT_PARTS is not set 435# CONFIG_MTD_REDBOOT_PARTS is not set
427# CONFIG_MTD_CMDLINE_PARTS is not set 436# CONFIG_MTD_CMDLINE_PARTS is not set
428CONFIG_MTD_OF_PARTS=y 437CONFIG_MTD_OF_PARTS=y
@@ -630,7 +639,9 @@ CONFIG_MII=y
630# CONFIG_NET_PCI is not set 639# CONFIG_NET_PCI is not set
631# CONFIG_B44 is not set 640# CONFIG_B44 is not set
632# CONFIG_KS8842 is not set 641# CONFIG_KS8842 is not set
642# CONFIG_KS8851_MLL is not set
633# CONFIG_ATL2 is not set 643# CONFIG_ATL2 is not set
644# CONFIG_XILINX_EMACLITE is not set
634CONFIG_NETDEV_1000=y 645CONFIG_NETDEV_1000=y
635# CONFIG_ACENIC is not set 646# CONFIG_ACENIC is not set
636# CONFIG_DL2K is not set 647# CONFIG_DL2K is not set
@@ -678,10 +689,7 @@ CONFIG_CHELSIO_T3_DEPENDS=y
678# CONFIG_SFC is not set 689# CONFIG_SFC is not set
679# CONFIG_BE2NET is not set 690# CONFIG_BE2NET is not set
680# CONFIG_TR is not set 691# CONFIG_TR is not set
681 692CONFIG_WLAN=y
682#
683# Wireless LAN
684#
685# CONFIG_WLAN_PRE80211 is not set 693# CONFIG_WLAN_PRE80211 is not set
686# CONFIG_WLAN_80211 is not set 694# CONFIG_WLAN_80211 is not set
687 695
@@ -772,6 +780,7 @@ CONFIG_LEGACY_PTY_COUNT=256
772CONFIG_DEVPORT=y 780CONFIG_DEVPORT=y
773CONFIG_I2C=y 781CONFIG_I2C=y
774CONFIG_I2C_BOARDINFO=y 782CONFIG_I2C_BOARDINFO=y
783CONFIG_I2C_COMPAT=y
775CONFIG_I2C_CHARDEV=y 784CONFIG_I2C_CHARDEV=y
776CONFIG_I2C_HELPER_AUTO=y 785CONFIG_I2C_HELPER_AUTO=y
777 786
@@ -825,9 +834,6 @@ CONFIG_I2C_MPC=y
825# Miscellaneous I2C Chip support 834# Miscellaneous I2C Chip support
826# 835#
827# CONFIG_DS1682 is not set 836# CONFIG_DS1682 is not set
828# CONFIG_SENSORS_PCF8574 is not set
829# CONFIG_PCF8575 is not set
830# CONFIG_SENSORS_PCA9539 is not set
831# CONFIG_SENSORS_TSL2550 is not set 837# CONFIG_SENSORS_TSL2550 is not set
832# CONFIG_I2C_DEBUG_CORE is not set 838# CONFIG_I2C_DEBUG_CORE is not set
833# CONFIG_I2C_DEBUG_ALGO is not set 839# CONFIG_I2C_DEBUG_ALGO is not set
@@ -845,6 +851,11 @@ CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y
845# CONFIG_POWER_SUPPLY is not set 851# CONFIG_POWER_SUPPLY is not set
846CONFIG_HWMON=y 852CONFIG_HWMON=y
847# CONFIG_HWMON_VID is not set 853# CONFIG_HWMON_VID is not set
854# CONFIG_HWMON_DEBUG_CHIP is not set
855
856#
857# Native drivers
858#
848# CONFIG_SENSORS_AD7414 is not set 859# CONFIG_SENSORS_AD7414 is not set
849# CONFIG_SENSORS_AD7418 is not set 860# CONFIG_SENSORS_AD7418 is not set
850# CONFIG_SENSORS_ADM1021 is not set 861# CONFIG_SENSORS_ADM1021 is not set
@@ -894,6 +905,7 @@ CONFIG_SENSORS_LM75=y
894# CONFIG_SENSORS_ADS7828 is not set 905# CONFIG_SENSORS_ADS7828 is not set
895# CONFIG_SENSORS_THMC50 is not set 906# CONFIG_SENSORS_THMC50 is not set
896# CONFIG_SENSORS_TMP401 is not set 907# CONFIG_SENSORS_TMP401 is not set
908# CONFIG_SENSORS_TMP421 is not set
897# CONFIG_SENSORS_VIA686A is not set 909# CONFIG_SENSORS_VIA686A is not set
898# CONFIG_SENSORS_VT1211 is not set 910# CONFIG_SENSORS_VT1211 is not set
899# CONFIG_SENSORS_VT8231 is not set 911# CONFIG_SENSORS_VT8231 is not set
@@ -905,9 +917,7 @@ CONFIG_SENSORS_LM75=y
905# CONFIG_SENSORS_W83L786NG is not set 917# CONFIG_SENSORS_W83L786NG is not set
906# CONFIG_SENSORS_W83627HF is not set 918# CONFIG_SENSORS_W83627HF is not set
907# CONFIG_SENSORS_W83627EHF is not set 919# CONFIG_SENSORS_W83627EHF is not set
908# CONFIG_HWMON_DEBUG_CHIP is not set
909# CONFIG_THERMAL is not set 920# CONFIG_THERMAL is not set
910# CONFIG_THERMAL_HWMON is not set
911# CONFIG_WATCHDOG is not set 921# CONFIG_WATCHDOG is not set
912CONFIG_SSB_POSSIBLE=y 922CONFIG_SSB_POSSIBLE=y
913 923
@@ -926,6 +936,7 @@ CONFIG_SSB_POSSIBLE=y
926# CONFIG_MFD_TMIO is not set 936# CONFIG_MFD_TMIO is not set
927# CONFIG_PMIC_DA903X is not set 937# CONFIG_PMIC_DA903X is not set
928# CONFIG_MFD_WM8400 is not set 938# CONFIG_MFD_WM8400 is not set
939# CONFIG_MFD_WM831X is not set
929# CONFIG_MFD_WM8350_I2C is not set 940# CONFIG_MFD_WM8350_I2C is not set
930# CONFIG_MFD_PCF50633 is not set 941# CONFIG_MFD_PCF50633 is not set
931# CONFIG_AB3100_CORE is not set 942# CONFIG_AB3100_CORE is not set
@@ -936,6 +947,7 @@ CONFIG_SSB_POSSIBLE=y
936# Graphics support 947# Graphics support
937# 948#
938# CONFIG_AGP is not set 949# CONFIG_AGP is not set
950CONFIG_VGA_ARB=y
939# CONFIG_DRM is not set 951# CONFIG_DRM is not set
940# CONFIG_VGASTATE is not set 952# CONFIG_VGASTATE is not set
941CONFIG_VIDEO_OUTPUT_CONTROL=y 953CONFIG_VIDEO_OUTPUT_CONTROL=y
@@ -949,7 +961,6 @@ CONFIG_VIDEO_OUTPUT_CONTROL=y
949# CONFIG_SOUND is not set 961# CONFIG_SOUND is not set
950CONFIG_HID_SUPPORT=y 962CONFIG_HID_SUPPORT=y
951CONFIG_HID=y 963CONFIG_HID=y
952# CONFIG_HID_DEBUG is not set
953# CONFIG_HIDRAW is not set 964# CONFIG_HIDRAW is not set
954# CONFIG_HID_PID is not set 965# CONFIG_HID_PID is not set
955 966
@@ -1042,6 +1053,7 @@ CONFIG_RTC_DRV_DS1307=y
1042# CONFIG_GFS2_FS is not set 1053# CONFIG_GFS2_FS is not set
1043# CONFIG_OCFS2_FS is not set 1054# CONFIG_OCFS2_FS is not set
1044# CONFIG_BTRFS_FS is not set 1055# CONFIG_BTRFS_FS is not set
1056# CONFIG_NILFS2_FS is not set
1045CONFIG_FILE_LOCKING=y 1057CONFIG_FILE_LOCKING=y
1046CONFIG_FSNOTIFY=y 1058CONFIG_FSNOTIFY=y
1047CONFIG_DNOTIFY=y 1059CONFIG_DNOTIFY=y
@@ -1111,7 +1123,6 @@ CONFIG_JFFS2_RTIME=y
1111# CONFIG_ROMFS_FS is not set 1123# CONFIG_ROMFS_FS is not set
1112# CONFIG_SYSV_FS is not set 1124# CONFIG_SYSV_FS is not set
1113# CONFIG_UFS_FS is not set 1125# CONFIG_UFS_FS is not set
1114# CONFIG_NILFS2_FS is not set
1115CONFIG_NETWORK_FILESYSTEMS=y 1126CONFIG_NETWORK_FILESYSTEMS=y
1116CONFIG_NFS_FS=y 1127CONFIG_NFS_FS=y
1117# CONFIG_NFS_V3 is not set 1128# CONFIG_NFS_V3 is not set
@@ -1180,6 +1191,7 @@ CONFIG_ENABLE_WARN_DEPRECATED=y
1180CONFIG_ENABLE_MUST_CHECK=y 1191CONFIG_ENABLE_MUST_CHECK=y
1181CONFIG_FRAME_WARN=1024 1192CONFIG_FRAME_WARN=1024
1182# CONFIG_MAGIC_SYSRQ is not set 1193# CONFIG_MAGIC_SYSRQ is not set
1194# CONFIG_STRIP_ASM_SYMS is not set
1183# CONFIG_UNUSED_SYMBOLS is not set 1195# CONFIG_UNUSED_SYMBOLS is not set
1184# CONFIG_DEBUG_FS is not set 1196# CONFIG_DEBUG_FS is not set
1185# CONFIG_HEADERS_CHECK is not set 1197# CONFIG_HEADERS_CHECK is not set
@@ -1197,6 +1209,7 @@ CONFIG_SCHED_DEBUG=y
1197# CONFIG_DEBUG_OBJECTS is not set 1209# CONFIG_DEBUG_OBJECTS is not set
1198# CONFIG_SLUB_DEBUG_ON is not set 1210# CONFIG_SLUB_DEBUG_ON is not set
1199# CONFIG_SLUB_STATS is not set 1211# CONFIG_SLUB_STATS is not set
1212# CONFIG_DEBUG_KMEMLEAK is not set
1200# CONFIG_DEBUG_RT_MUTEXES is not set 1213# CONFIG_DEBUG_RT_MUTEXES is not set
1201# CONFIG_RT_MUTEX_TESTER is not set 1214# CONFIG_RT_MUTEX_TESTER is not set
1202# CONFIG_DEBUG_SPINLOCK is not set 1215# CONFIG_DEBUG_SPINLOCK is not set
@@ -1216,10 +1229,12 @@ CONFIG_DEBUG_MUTEXES=y
1216# CONFIG_DEBUG_LIST is not set 1229# CONFIG_DEBUG_LIST is not set
1217# CONFIG_DEBUG_SG is not set 1230# CONFIG_DEBUG_SG is not set
1218# CONFIG_DEBUG_NOTIFIERS is not set 1231# CONFIG_DEBUG_NOTIFIERS is not set
1232# CONFIG_DEBUG_CREDENTIALS is not set
1219# CONFIG_RCU_TORTURE_TEST is not set 1233# CONFIG_RCU_TORTURE_TEST is not set
1220# CONFIG_RCU_CPU_STALL_DETECTOR is not set 1234# CONFIG_RCU_CPU_STALL_DETECTOR is not set
1221# CONFIG_BACKTRACE_SELF_TEST is not set 1235# CONFIG_BACKTRACE_SELF_TEST is not set
1222# CONFIG_DEBUG_BLOCK_EXT_DEVT is not set 1236# CONFIG_DEBUG_BLOCK_EXT_DEVT is not set
1237# CONFIG_DEBUG_FORCE_WEAK_PER_CPU is not set
1223# CONFIG_FAULT_INJECTION is not set 1238# CONFIG_FAULT_INJECTION is not set
1224# CONFIG_LATENCYTOP is not set 1239# CONFIG_LATENCYTOP is not set
1225CONFIG_SYSCTL_SYSCALL_CHECK=y 1240CONFIG_SYSCTL_SYSCALL_CHECK=y
@@ -1242,10 +1257,10 @@ CONFIG_BRANCH_PROFILE_NONE=y
1242# CONFIG_KMEMTRACE is not set 1257# CONFIG_KMEMTRACE is not set
1243# CONFIG_WORKQUEUE_TRACER is not set 1258# CONFIG_WORKQUEUE_TRACER is not set
1244# CONFIG_BLK_DEV_IO_TRACE is not set 1259# CONFIG_BLK_DEV_IO_TRACE is not set
1260# CONFIG_DMA_API_DEBUG is not set
1245# CONFIG_SAMPLES is not set 1261# CONFIG_SAMPLES is not set
1246CONFIG_HAVE_ARCH_KGDB=y 1262CONFIG_HAVE_ARCH_KGDB=y
1247# CONFIG_KGDB is not set 1263# CONFIG_KGDB is not set
1248# CONFIG_KMEMCHECK is not set
1249# CONFIG_PPC_DISABLE_WERROR is not set 1264# CONFIG_PPC_DISABLE_WERROR is not set
1250CONFIG_PPC_WERROR=y 1265CONFIG_PPC_WERROR=y
1251CONFIG_PRINT_STACK_DEPTH=64 1266CONFIG_PRINT_STACK_DEPTH=64
@@ -1271,7 +1286,6 @@ CONFIG_CRYPTO=y
1271# 1286#
1272# Crypto core or helper 1287# Crypto core or helper
1273# 1288#
1274# CONFIG_CRYPTO_FIPS is not set
1275# CONFIG_CRYPTO_MANAGER is not set 1289# CONFIG_CRYPTO_MANAGER is not set
1276# CONFIG_CRYPTO_MANAGER2 is not set 1290# CONFIG_CRYPTO_MANAGER2 is not set
1277# CONFIG_CRYPTO_GF128MUL is not set 1291# CONFIG_CRYPTO_GF128MUL is not set
@@ -1303,11 +1317,13 @@ CONFIG_CRYPTO=y
1303# 1317#
1304# CONFIG_CRYPTO_HMAC is not set 1318# CONFIG_CRYPTO_HMAC is not set
1305# CONFIG_CRYPTO_XCBC is not set 1319# CONFIG_CRYPTO_XCBC is not set
1320# CONFIG_CRYPTO_VMAC is not set
1306 1321
1307# 1322#
1308# Digest 1323# Digest
1309# 1324#
1310# CONFIG_CRYPTO_CRC32C is not set 1325# CONFIG_CRYPTO_CRC32C is not set
1326# CONFIG_CRYPTO_GHASH is not set
1311# CONFIG_CRYPTO_MD4 is not set 1327# CONFIG_CRYPTO_MD4 is not set
1312# CONFIG_CRYPTO_MD5 is not set 1328# CONFIG_CRYPTO_MD5 is not set
1313# CONFIG_CRYPTO_MICHAEL_MIC is not set 1329# CONFIG_CRYPTO_MICHAEL_MIC is not set
diff --git a/arch/powerpc/configs/85xx/tqm8555_defconfig b/arch/powerpc/configs/85xx/tqm8555_defconfig
index 9196724bebc7..74515501f5b7 100644
--- a/arch/powerpc/configs/85xx/tqm8555_defconfig
+++ b/arch/powerpc/configs/85xx/tqm8555_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.31-rc4 3# Linux kernel version: 2.6.32-rc5
4# Wed Jul 29 23:32:24 2009 4# Thu Nov 5 08:20:42 2009
5# 5#
6# CONFIG_PPC64 is not set 6# CONFIG_PPC64 is not set
7 7
@@ -22,6 +22,7 @@ CONFIG_FSL_EMB_PERFMON=y
22# CONFIG_PHYS_64BIT is not set 22# CONFIG_PHYS_64BIT is not set
23CONFIG_SPE=y 23CONFIG_SPE=y
24CONFIG_PPC_MMU_NOHASH=y 24CONFIG_PPC_MMU_NOHASH=y
25CONFIG_PPC_MMU_NOHASH_32=y
25CONFIG_PPC_BOOK3E_MMU=y 26CONFIG_PPC_BOOK3E_MMU=y
26# CONFIG_PPC_MM_SLICES is not set 27# CONFIG_PPC_MM_SLICES is not set
27# CONFIG_SMP is not set 28# CONFIG_SMP is not set
@@ -36,6 +37,7 @@ CONFIG_GENERIC_CLOCKEVENTS=y
36CONFIG_GENERIC_HARDIRQS=y 37CONFIG_GENERIC_HARDIRQS=y
37CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=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
40# CONFIG_NEED_PER_CPU_EMBED_FIRST_CHUNK is not set
39CONFIG_IRQ_PER_CPU=y 41CONFIG_IRQ_PER_CPU=y
40CONFIG_STACKTRACE_SUPPORT=y 42CONFIG_STACKTRACE_SUPPORT=y
41CONFIG_HAVE_LATENCYTOP_SUPPORT=y 43CONFIG_HAVE_LATENCYTOP_SUPPORT=y
@@ -85,11 +87,12 @@ CONFIG_SYSVIPC_SYSCTL=y
85# 87#
86# RCU Subsystem 88# RCU Subsystem
87# 89#
88CONFIG_CLASSIC_RCU=y 90CONFIG_TREE_RCU=y
89# CONFIG_TREE_RCU is not set 91# CONFIG_TREE_PREEMPT_RCU is not set
90# CONFIG_PREEMPT_RCU is not set 92# CONFIG_RCU_TRACE is not set
93CONFIG_RCU_FANOUT=32
94# CONFIG_RCU_FANOUT_EXACT is not set
91# CONFIG_TREE_RCU_TRACE is not set 95# CONFIG_TREE_RCU_TRACE is not set
92# CONFIG_PREEMPT_RCU_TRACE is not set
93# CONFIG_IKCONFIG is not set 96# CONFIG_IKCONFIG is not set
94CONFIG_LOG_BUF_SHIFT=14 97CONFIG_LOG_BUF_SHIFT=14
95CONFIG_GROUP_SCHED=y 98CONFIG_GROUP_SCHED=y
@@ -125,29 +128,30 @@ CONFIG_TIMERFD=y
125CONFIG_EVENTFD=y 128CONFIG_EVENTFD=y
126CONFIG_SHMEM=y 129CONFIG_SHMEM=y
127CONFIG_AIO=y 130CONFIG_AIO=y
128CONFIG_HAVE_PERF_COUNTERS=y 131CONFIG_HAVE_PERF_EVENTS=y
129 132
130# 133#
131# Performance Counters 134# Kernel Performance Events And Counters
132# 135#
136# CONFIG_PERF_EVENTS is not set
133# CONFIG_PERF_COUNTERS is not set 137# CONFIG_PERF_COUNTERS is not set
134CONFIG_VM_EVENT_COUNTERS=y 138CONFIG_VM_EVENT_COUNTERS=y
135CONFIG_PCI_QUIRKS=y 139CONFIG_PCI_QUIRKS=y
136CONFIG_SLUB_DEBUG=y 140CONFIG_SLUB_DEBUG=y
137# CONFIG_STRIP_ASM_SYMS is not set
138CONFIG_COMPAT_BRK=y 141CONFIG_COMPAT_BRK=y
139# CONFIG_SLAB is not set 142# CONFIG_SLAB is not set
140CONFIG_SLUB=y 143CONFIG_SLUB=y
141# CONFIG_SLOB is not set 144# CONFIG_SLOB is not set
142# CONFIG_PROFILING is not set 145# CONFIG_PROFILING is not set
143# CONFIG_MARKERS is not set
144CONFIG_HAVE_OPROFILE=y 146CONFIG_HAVE_OPROFILE=y
145CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS=y 147CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS=y
146CONFIG_HAVE_IOREMAP_PROT=y 148CONFIG_HAVE_IOREMAP_PROT=y
147CONFIG_HAVE_KPROBES=y 149CONFIG_HAVE_KPROBES=y
148CONFIG_HAVE_KRETPROBES=y 150CONFIG_HAVE_KRETPROBES=y
149CONFIG_HAVE_ARCH_TRACEHOOK=y 151CONFIG_HAVE_ARCH_TRACEHOOK=y
152CONFIG_HAVE_DMA_ATTRS=y
150CONFIG_HAVE_CLK=y 153CONFIG_HAVE_CLK=y
154CONFIG_HAVE_DMA_API_DEBUG=y
151 155
152# 156#
153# GCOV-based kernel profiling 157# GCOV-based kernel profiling
@@ -190,6 +194,7 @@ CONFIG_MPC85xx=y
190# CONFIG_MPC85xx_MDS is not set 194# CONFIG_MPC85xx_MDS is not set
191# CONFIG_MPC8536_DS is not set 195# CONFIG_MPC8536_DS is not set
192# CONFIG_MPC85xx_DS is not set 196# CONFIG_MPC85xx_DS is not set
197# CONFIG_MPC85xx_RDB is not set
193# CONFIG_SOCRATES is not set 198# CONFIG_SOCRATES is not set
194# CONFIG_KSI8560 is not set 199# CONFIG_KSI8560 is not set
195# CONFIG_XES_MPC85xx is not set 200# CONFIG_XES_MPC85xx is not set
@@ -246,6 +251,7 @@ CONFIG_MATH_EMULATION=y
246CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y 251CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y
247CONFIG_ARCH_HAS_WALK_MEMORY=y 252CONFIG_ARCH_HAS_WALK_MEMORY=y
248CONFIG_ARCH_ENABLE_MEMORY_HOTREMOVE=y 253CONFIG_ARCH_ENABLE_MEMORY_HOTREMOVE=y
254CONFIG_MAX_ACTIVE_REGIONS=32
249CONFIG_ARCH_FLATMEM_ENABLE=y 255CONFIG_ARCH_FLATMEM_ENABLE=y
250CONFIG_ARCH_POPULATES_NODE_MAP=y 256CONFIG_ARCH_POPULATES_NODE_MAP=y
251CONFIG_SELECT_MEMORY_MODEL=y 257CONFIG_SELECT_MEMORY_MODEL=y
@@ -263,6 +269,7 @@ CONFIG_BOUNCE=y
263CONFIG_VIRT_TO_BUS=y 269CONFIG_VIRT_TO_BUS=y
264CONFIG_HAVE_MLOCK=y 270CONFIG_HAVE_MLOCK=y
265CONFIG_HAVE_MLOCKED_PAGE_BIT=y 271CONFIG_HAVE_MLOCKED_PAGE_BIT=y
272# CONFIG_KSM is not set
266CONFIG_DEFAULT_MMAP_MIN_ADDR=4096 273CONFIG_DEFAULT_MMAP_MIN_ADDR=4096
267CONFIG_PPC_4K_PAGES=y 274CONFIG_PPC_4K_PAGES=y
268# CONFIG_PPC_16K_PAGES is not set 275# CONFIG_PPC_16K_PAGES is not set
@@ -357,6 +364,7 @@ CONFIG_DEFAULT_TCP_CONG="cubic"
357# CONFIG_NETFILTER is not set 364# CONFIG_NETFILTER is not set
358# CONFIG_IP_DCCP is not set 365# CONFIG_IP_DCCP is not set
359# CONFIG_IP_SCTP is not set 366# CONFIG_IP_SCTP is not set
367# CONFIG_RDS is not set
360# CONFIG_TIPC is not set 368# CONFIG_TIPC is not set
361# CONFIG_ATM is not set 369# CONFIG_ATM is not set
362# CONFIG_BRIDGE is not set 370# CONFIG_BRIDGE is not set
@@ -386,6 +394,7 @@ CONFIG_DEFAULT_TCP_CONG="cubic"
386# CONFIG_AF_RXRPC is not set 394# CONFIG_AF_RXRPC is not set
387CONFIG_WIRELESS=y 395CONFIG_WIRELESS=y
388# CONFIG_CFG80211 is not set 396# CONFIG_CFG80211 is not set
397CONFIG_CFG80211_DEFAULT_PS_VALUE=0
389CONFIG_WIRELESS_OLD_REGULATORY=y 398CONFIG_WIRELESS_OLD_REGULATORY=y
390# CONFIG_WIRELESS_EXT is not set 399# CONFIG_WIRELESS_EXT is not set
391# CONFIG_LIB80211 is not set 400# CONFIG_LIB80211 is not set
@@ -393,7 +402,6 @@ CONFIG_WIRELESS_OLD_REGULATORY=y
393# 402#
394# CFG80211 needs to be enabled for MAC80211 403# CFG80211 needs to be enabled for MAC80211
395# 404#
396CONFIG_MAC80211_DEFAULT_PS_VALUE=0
397# CONFIG_WIMAX is not set 405# CONFIG_WIMAX is not set
398# CONFIG_RFKILL is not set 406# CONFIG_RFKILL is not set
399# CONFIG_NET_9P is not set 407# CONFIG_NET_9P is not set
@@ -681,9 +689,11 @@ CONFIG_E100=y
681# CONFIG_SUNDANCE is not set 689# CONFIG_SUNDANCE is not set
682# CONFIG_TLAN is not set 690# CONFIG_TLAN is not set
683# CONFIG_KS8842 is not set 691# CONFIG_KS8842 is not set
692# CONFIG_KS8851_MLL is not set
684# CONFIG_VIA_RHINE is not set 693# CONFIG_VIA_RHINE is not set
685# CONFIG_SC92031 is not set 694# CONFIG_SC92031 is not set
686# CONFIG_ATL2 is not set 695# CONFIG_ATL2 is not set
696# CONFIG_XILINX_EMACLITE is not set
687# CONFIG_FS_ENET is not set 697# CONFIG_FS_ENET is not set
688CONFIG_NETDEV_1000=y 698CONFIG_NETDEV_1000=y
689# CONFIG_ACENIC is not set 699# CONFIG_ACENIC is not set
@@ -732,10 +742,7 @@ CONFIG_CHELSIO_T3_DEPENDS=y
732# CONFIG_SFC is not set 742# CONFIG_SFC is not set
733# CONFIG_BE2NET is not set 743# CONFIG_BE2NET is not set
734# CONFIG_TR is not set 744# CONFIG_TR is not set
735 745CONFIG_WLAN=y
736#
737# Wireless LAN
738#
739# CONFIG_WLAN_PRE80211 is not set 746# CONFIG_WLAN_PRE80211 is not set
740# CONFIG_WLAN_80211 is not set 747# CONFIG_WLAN_80211 is not set
741 748
@@ -831,6 +838,7 @@ CONFIG_GEN_RTC=y
831CONFIG_DEVPORT=y 838CONFIG_DEVPORT=y
832CONFIG_I2C=y 839CONFIG_I2C=y
833CONFIG_I2C_BOARDINFO=y 840CONFIG_I2C_BOARDINFO=y
841CONFIG_I2C_COMPAT=y
834CONFIG_I2C_CHARDEV=y 842CONFIG_I2C_CHARDEV=y
835CONFIG_I2C_HELPER_AUTO=y 843CONFIG_I2C_HELPER_AUTO=y
836 844
@@ -886,9 +894,6 @@ CONFIG_I2C_MPC=y
886# Miscellaneous I2C Chip support 894# Miscellaneous I2C Chip support
887# 895#
888# CONFIG_DS1682 is not set 896# CONFIG_DS1682 is not set
889# CONFIG_SENSORS_PCF8574 is not set
890# CONFIG_PCF8575 is not set
891# CONFIG_SENSORS_PCA9539 is not set
892# CONFIG_SENSORS_TSL2550 is not set 897# CONFIG_SENSORS_TSL2550 is not set
893# CONFIG_I2C_DEBUG_CORE is not set 898# CONFIG_I2C_DEBUG_CORE is not set
894# CONFIG_I2C_DEBUG_ALGO is not set 899# CONFIG_I2C_DEBUG_ALGO is not set
@@ -921,14 +926,24 @@ CONFIG_GPIOLIB=y
921# PCI GPIO expanders: 926# PCI GPIO expanders:
922# 927#
923# CONFIG_GPIO_BT8XX is not set 928# CONFIG_GPIO_BT8XX is not set
929# CONFIG_GPIO_LANGWELL is not set
924 930
925# 931#
926# SPI GPIO expanders: 932# SPI GPIO expanders:
927# 933#
934
935#
936# AC97 GPIO expanders:
937#
928# CONFIG_W1 is not set 938# CONFIG_W1 is not set
929# CONFIG_POWER_SUPPLY is not set 939# CONFIG_POWER_SUPPLY is not set
930CONFIG_HWMON=y 940CONFIG_HWMON=y
931# CONFIG_HWMON_VID is not set 941# CONFIG_HWMON_VID is not set
942CONFIG_HWMON_DEBUG_CHIP=y
943
944#
945# Native drivers
946#
932# CONFIG_SENSORS_AD7414 is not set 947# CONFIG_SENSORS_AD7414 is not set
933# CONFIG_SENSORS_AD7418 is not set 948# CONFIG_SENSORS_AD7418 is not set
934# CONFIG_SENSORS_ADM1021 is not set 949# CONFIG_SENSORS_ADM1021 is not set
@@ -979,6 +994,7 @@ CONFIG_SENSORS_LM75=y
979# CONFIG_SENSORS_ADS7828 is not set 994# CONFIG_SENSORS_ADS7828 is not set
980# CONFIG_SENSORS_THMC50 is not set 995# CONFIG_SENSORS_THMC50 is not set
981# CONFIG_SENSORS_TMP401 is not set 996# CONFIG_SENSORS_TMP401 is not set
997# CONFIG_SENSORS_TMP421 is not set
982# CONFIG_SENSORS_VIA686A is not set 998# CONFIG_SENSORS_VIA686A is not set
983# CONFIG_SENSORS_VT1211 is not set 999# CONFIG_SENSORS_VT1211 is not set
984# CONFIG_SENSORS_VT8231 is not set 1000# CONFIG_SENSORS_VT8231 is not set
@@ -990,9 +1006,7 @@ CONFIG_SENSORS_LM75=y
990# CONFIG_SENSORS_W83L786NG is not set 1006# CONFIG_SENSORS_W83L786NG is not set
991# CONFIG_SENSORS_W83627HF is not set 1007# CONFIG_SENSORS_W83627HF is not set
992# CONFIG_SENSORS_W83627EHF is not set 1008# CONFIG_SENSORS_W83627EHF is not set
993CONFIG_HWMON_DEBUG_CHIP=y
994# CONFIG_THERMAL is not set 1009# CONFIG_THERMAL is not set
995# CONFIG_THERMAL_HWMON is not set
996# CONFIG_WATCHDOG is not set 1010# CONFIG_WATCHDOG is not set
997CONFIG_SSB_POSSIBLE=y 1011CONFIG_SSB_POSSIBLE=y
998 1012
@@ -1012,6 +1026,7 @@ CONFIG_SSB_POSSIBLE=y
1012# CONFIG_MFD_TMIO is not set 1026# CONFIG_MFD_TMIO is not set
1013# CONFIG_PMIC_DA903X is not set 1027# CONFIG_PMIC_DA903X is not set
1014# CONFIG_MFD_WM8400 is not set 1028# CONFIG_MFD_WM8400 is not set
1029# CONFIG_MFD_WM831X is not set
1015# CONFIG_MFD_WM8350_I2C is not set 1030# CONFIG_MFD_WM8350_I2C is not set
1016# CONFIG_MFD_PCF50633 is not set 1031# CONFIG_MFD_PCF50633 is not set
1017# CONFIG_AB3100_CORE is not set 1032# CONFIG_AB3100_CORE is not set
@@ -1022,6 +1037,7 @@ CONFIG_SSB_POSSIBLE=y
1022# Graphics support 1037# Graphics support
1023# 1038#
1024# CONFIG_AGP is not set 1039# CONFIG_AGP is not set
1040CONFIG_VGA_ARB=y
1025# CONFIG_DRM is not set 1041# CONFIG_DRM is not set
1026# CONFIG_VGASTATE is not set 1042# CONFIG_VGASTATE is not set
1027# CONFIG_VIDEO_OUTPUT_CONTROL is not set 1043# CONFIG_VIDEO_OUTPUT_CONTROL is not set
@@ -1035,7 +1051,6 @@ CONFIG_SSB_POSSIBLE=y
1035# CONFIG_SOUND is not set 1051# CONFIG_SOUND is not set
1036CONFIG_HID_SUPPORT=y 1052CONFIG_HID_SUPPORT=y
1037CONFIG_HID=y 1053CONFIG_HID=y
1038# CONFIG_HID_DEBUG is not set
1039# CONFIG_HIDRAW is not set 1054# CONFIG_HIDRAW is not set
1040# CONFIG_HID_PID is not set 1055# CONFIG_HID_PID is not set
1041 1056
@@ -1100,6 +1115,7 @@ CONFIG_FS_MBCACHE=y
1100# CONFIG_GFS2_FS is not set 1115# CONFIG_GFS2_FS is not set
1101# CONFIG_OCFS2_FS is not set 1116# CONFIG_OCFS2_FS is not set
1102# CONFIG_BTRFS_FS is not set 1117# CONFIG_BTRFS_FS is not set
1118# CONFIG_NILFS2_FS is not set
1103CONFIG_FILE_LOCKING=y 1119CONFIG_FILE_LOCKING=y
1104CONFIG_FSNOTIFY=y 1120CONFIG_FSNOTIFY=y
1105CONFIG_DNOTIFY=y 1121CONFIG_DNOTIFY=y
@@ -1169,7 +1185,6 @@ CONFIG_CRAMFS=y
1169# CONFIG_ROMFS_FS is not set 1185# CONFIG_ROMFS_FS is not set
1170# CONFIG_SYSV_FS is not set 1186# CONFIG_SYSV_FS is not set
1171# CONFIG_UFS_FS is not set 1187# CONFIG_UFS_FS is not set
1172# CONFIG_NILFS2_FS is not set
1173CONFIG_NETWORK_FILESYSTEMS=y 1188CONFIG_NETWORK_FILESYSTEMS=y
1174CONFIG_NFS_FS=y 1189CONFIG_NFS_FS=y
1175# CONFIG_NFS_V3 is not set 1190# CONFIG_NFS_V3 is not set
@@ -1238,6 +1253,7 @@ CONFIG_ENABLE_WARN_DEPRECATED=y
1238CONFIG_ENABLE_MUST_CHECK=y 1253CONFIG_ENABLE_MUST_CHECK=y
1239CONFIG_FRAME_WARN=1024 1254CONFIG_FRAME_WARN=1024
1240# CONFIG_MAGIC_SYSRQ is not set 1255# CONFIG_MAGIC_SYSRQ is not set
1256# CONFIG_STRIP_ASM_SYMS is not set
1241# CONFIG_UNUSED_SYMBOLS is not set 1257# CONFIG_UNUSED_SYMBOLS is not set
1242# CONFIG_DEBUG_FS is not set 1258# CONFIG_DEBUG_FS is not set
1243# CONFIG_HEADERS_CHECK is not set 1259# CONFIG_HEADERS_CHECK is not set
@@ -1255,6 +1271,7 @@ CONFIG_HAVE_DYNAMIC_FTRACE=y
1255CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y 1271CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y
1256CONFIG_TRACING_SUPPORT=y 1272CONFIG_TRACING_SUPPORT=y
1257# CONFIG_FTRACE is not set 1273# CONFIG_FTRACE is not set
1274# CONFIG_DMA_API_DEBUG is not set
1258# CONFIG_SAMPLES is not set 1275# CONFIG_SAMPLES is not set
1259CONFIG_HAVE_ARCH_KGDB=y 1276CONFIG_HAVE_ARCH_KGDB=y
1260# CONFIG_PPC_DISABLE_WERROR is not set 1277# CONFIG_PPC_DISABLE_WERROR is not set
@@ -1275,7 +1292,6 @@ CONFIG_CRYPTO=y
1275# 1292#
1276# Crypto core or helper 1293# Crypto core or helper
1277# 1294#
1278# CONFIG_CRYPTO_FIPS is not set
1279# CONFIG_CRYPTO_MANAGER is not set 1295# CONFIG_CRYPTO_MANAGER is not set
1280# CONFIG_CRYPTO_MANAGER2 is not set 1296# CONFIG_CRYPTO_MANAGER2 is not set
1281# CONFIG_CRYPTO_GF128MUL is not set 1297# CONFIG_CRYPTO_GF128MUL is not set
@@ -1306,11 +1322,13 @@ CONFIG_CRYPTO=y
1306# 1322#
1307# CONFIG_CRYPTO_HMAC is not set 1323# CONFIG_CRYPTO_HMAC is not set
1308# CONFIG_CRYPTO_XCBC is not set 1324# CONFIG_CRYPTO_XCBC is not set
1325# CONFIG_CRYPTO_VMAC is not set
1309 1326
1310# 1327#
1311# Digest 1328# Digest
1312# 1329#
1313# CONFIG_CRYPTO_CRC32C is not set 1330# CONFIG_CRYPTO_CRC32C is not set
1331# CONFIG_CRYPTO_GHASH is not set
1314# CONFIG_CRYPTO_MD4 is not set 1332# CONFIG_CRYPTO_MD4 is not set
1315# CONFIG_CRYPTO_MD5 is not set 1333# CONFIG_CRYPTO_MD5 is not set
1316# CONFIG_CRYPTO_MICHAEL_MIC is not set 1334# CONFIG_CRYPTO_MICHAEL_MIC is not set
diff --git a/arch/powerpc/configs/85xx/tqm8560_defconfig b/arch/powerpc/configs/85xx/tqm8560_defconfig
index 2e49a6e9faf2..631d92b4d4e6 100644
--- a/arch/powerpc/configs/85xx/tqm8560_defconfig
+++ b/arch/powerpc/configs/85xx/tqm8560_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.31-rc4 3# Linux kernel version: 2.6.32-rc5
4# Wed Jul 29 23:32:25 2009 4# Thu Nov 5 08:20:43 2009
5# 5#
6# CONFIG_PPC64 is not set 6# CONFIG_PPC64 is not set
7 7
@@ -22,6 +22,7 @@ CONFIG_FSL_EMB_PERFMON=y
22# CONFIG_PHYS_64BIT is not set 22# CONFIG_PHYS_64BIT is not set
23CONFIG_SPE=y 23CONFIG_SPE=y
24CONFIG_PPC_MMU_NOHASH=y 24CONFIG_PPC_MMU_NOHASH=y
25CONFIG_PPC_MMU_NOHASH_32=y
25CONFIG_PPC_BOOK3E_MMU=y 26CONFIG_PPC_BOOK3E_MMU=y
26# CONFIG_PPC_MM_SLICES is not set 27# CONFIG_PPC_MM_SLICES is not set
27# CONFIG_SMP is not set 28# CONFIG_SMP is not set
@@ -36,6 +37,7 @@ CONFIG_GENERIC_CLOCKEVENTS=y
36CONFIG_GENERIC_HARDIRQS=y 37CONFIG_GENERIC_HARDIRQS=y
37CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=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
40# CONFIG_NEED_PER_CPU_EMBED_FIRST_CHUNK is not set
39CONFIG_IRQ_PER_CPU=y 41CONFIG_IRQ_PER_CPU=y
40CONFIG_STACKTRACE_SUPPORT=y 42CONFIG_STACKTRACE_SUPPORT=y
41CONFIG_HAVE_LATENCYTOP_SUPPORT=y 43CONFIG_HAVE_LATENCYTOP_SUPPORT=y
@@ -85,11 +87,12 @@ CONFIG_SYSVIPC_SYSCTL=y
85# 87#
86# RCU Subsystem 88# RCU Subsystem
87# 89#
88CONFIG_CLASSIC_RCU=y 90CONFIG_TREE_RCU=y
89# CONFIG_TREE_RCU is not set 91# CONFIG_TREE_PREEMPT_RCU is not set
90# CONFIG_PREEMPT_RCU is not set 92# CONFIG_RCU_TRACE is not set
93CONFIG_RCU_FANOUT=32
94# CONFIG_RCU_FANOUT_EXACT is not set
91# CONFIG_TREE_RCU_TRACE is not set 95# CONFIG_TREE_RCU_TRACE is not set
92# CONFIG_PREEMPT_RCU_TRACE is not set
93# CONFIG_IKCONFIG is not set 96# CONFIG_IKCONFIG is not set
94CONFIG_LOG_BUF_SHIFT=14 97CONFIG_LOG_BUF_SHIFT=14
95CONFIG_GROUP_SCHED=y 98CONFIG_GROUP_SCHED=y
@@ -125,29 +128,30 @@ CONFIG_TIMERFD=y
125CONFIG_EVENTFD=y 128CONFIG_EVENTFD=y
126CONFIG_SHMEM=y 129CONFIG_SHMEM=y
127CONFIG_AIO=y 130CONFIG_AIO=y
128CONFIG_HAVE_PERF_COUNTERS=y 131CONFIG_HAVE_PERF_EVENTS=y
129 132
130# 133#
131# Performance Counters 134# Kernel Performance Events And Counters
132# 135#
136# CONFIG_PERF_EVENTS is not set
133# CONFIG_PERF_COUNTERS is not set 137# CONFIG_PERF_COUNTERS is not set
134CONFIG_VM_EVENT_COUNTERS=y 138CONFIG_VM_EVENT_COUNTERS=y
135CONFIG_PCI_QUIRKS=y 139CONFIG_PCI_QUIRKS=y
136CONFIG_SLUB_DEBUG=y 140CONFIG_SLUB_DEBUG=y
137# CONFIG_STRIP_ASM_SYMS is not set
138CONFIG_COMPAT_BRK=y 141CONFIG_COMPAT_BRK=y
139# CONFIG_SLAB is not set 142# CONFIG_SLAB is not set
140CONFIG_SLUB=y 143CONFIG_SLUB=y
141# CONFIG_SLOB is not set 144# CONFIG_SLOB is not set
142# CONFIG_PROFILING is not set 145# CONFIG_PROFILING is not set
143# CONFIG_MARKERS is not set
144CONFIG_HAVE_OPROFILE=y 146CONFIG_HAVE_OPROFILE=y
145CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS=y 147CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS=y
146CONFIG_HAVE_IOREMAP_PROT=y 148CONFIG_HAVE_IOREMAP_PROT=y
147CONFIG_HAVE_KPROBES=y 149CONFIG_HAVE_KPROBES=y
148CONFIG_HAVE_KRETPROBES=y 150CONFIG_HAVE_KRETPROBES=y
149CONFIG_HAVE_ARCH_TRACEHOOK=y 151CONFIG_HAVE_ARCH_TRACEHOOK=y
152CONFIG_HAVE_DMA_ATTRS=y
150CONFIG_HAVE_CLK=y 153CONFIG_HAVE_CLK=y
154CONFIG_HAVE_DMA_API_DEBUG=y
151 155
152# 156#
153# GCOV-based kernel profiling 157# GCOV-based kernel profiling
@@ -190,6 +194,7 @@ CONFIG_MPC85xx=y
190# CONFIG_MPC85xx_MDS is not set 194# CONFIG_MPC85xx_MDS is not set
191# CONFIG_MPC8536_DS is not set 195# CONFIG_MPC8536_DS is not set
192# CONFIG_MPC85xx_DS is not set 196# CONFIG_MPC85xx_DS is not set
197# CONFIG_MPC85xx_RDB is not set
193# CONFIG_SOCRATES is not set 198# CONFIG_SOCRATES is not set
194# CONFIG_KSI8560 is not set 199# CONFIG_KSI8560 is not set
195# CONFIG_XES_MPC85xx is not set 200# CONFIG_XES_MPC85xx is not set
@@ -246,6 +251,7 @@ CONFIG_MATH_EMULATION=y
246CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y 251CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y
247CONFIG_ARCH_HAS_WALK_MEMORY=y 252CONFIG_ARCH_HAS_WALK_MEMORY=y
248CONFIG_ARCH_ENABLE_MEMORY_HOTREMOVE=y 253CONFIG_ARCH_ENABLE_MEMORY_HOTREMOVE=y
254CONFIG_MAX_ACTIVE_REGIONS=32
249CONFIG_ARCH_FLATMEM_ENABLE=y 255CONFIG_ARCH_FLATMEM_ENABLE=y
250CONFIG_ARCH_POPULATES_NODE_MAP=y 256CONFIG_ARCH_POPULATES_NODE_MAP=y
251CONFIG_SELECT_MEMORY_MODEL=y 257CONFIG_SELECT_MEMORY_MODEL=y
@@ -263,6 +269,7 @@ CONFIG_BOUNCE=y
263CONFIG_VIRT_TO_BUS=y 269CONFIG_VIRT_TO_BUS=y
264CONFIG_HAVE_MLOCK=y 270CONFIG_HAVE_MLOCK=y
265CONFIG_HAVE_MLOCKED_PAGE_BIT=y 271CONFIG_HAVE_MLOCKED_PAGE_BIT=y
272# CONFIG_KSM is not set
266CONFIG_DEFAULT_MMAP_MIN_ADDR=4096 273CONFIG_DEFAULT_MMAP_MIN_ADDR=4096
267CONFIG_PPC_4K_PAGES=y 274CONFIG_PPC_4K_PAGES=y
268# CONFIG_PPC_16K_PAGES is not set 275# CONFIG_PPC_16K_PAGES is not set
@@ -357,6 +364,7 @@ CONFIG_DEFAULT_TCP_CONG="cubic"
357# CONFIG_NETFILTER is not set 364# CONFIG_NETFILTER is not set
358# CONFIG_IP_DCCP is not set 365# CONFIG_IP_DCCP is not set
359# CONFIG_IP_SCTP is not set 366# CONFIG_IP_SCTP is not set
367# CONFIG_RDS is not set
360# CONFIG_TIPC is not set 368# CONFIG_TIPC is not set
361# CONFIG_ATM is not set 369# CONFIG_ATM is not set
362# CONFIG_BRIDGE is not set 370# CONFIG_BRIDGE is not set
@@ -386,6 +394,7 @@ CONFIG_DEFAULT_TCP_CONG="cubic"
386# CONFIG_AF_RXRPC is not set 394# CONFIG_AF_RXRPC is not set
387CONFIG_WIRELESS=y 395CONFIG_WIRELESS=y
388# CONFIG_CFG80211 is not set 396# CONFIG_CFG80211 is not set
397CONFIG_CFG80211_DEFAULT_PS_VALUE=0
389CONFIG_WIRELESS_OLD_REGULATORY=y 398CONFIG_WIRELESS_OLD_REGULATORY=y
390# CONFIG_WIRELESS_EXT is not set 399# CONFIG_WIRELESS_EXT is not set
391# CONFIG_LIB80211 is not set 400# CONFIG_LIB80211 is not set
@@ -393,7 +402,6 @@ CONFIG_WIRELESS_OLD_REGULATORY=y
393# 402#
394# CFG80211 needs to be enabled for MAC80211 403# CFG80211 needs to be enabled for MAC80211
395# 404#
396CONFIG_MAC80211_DEFAULT_PS_VALUE=0
397# CONFIG_WIMAX is not set 405# CONFIG_WIMAX is not set
398# CONFIG_RFKILL is not set 406# CONFIG_RFKILL is not set
399# CONFIG_NET_9P is not set 407# CONFIG_NET_9P is not set
@@ -681,9 +689,11 @@ CONFIG_E100=y
681# CONFIG_SUNDANCE is not set 689# CONFIG_SUNDANCE is not set
682# CONFIG_TLAN is not set 690# CONFIG_TLAN is not set
683# CONFIG_KS8842 is not set 691# CONFIG_KS8842 is not set
692# CONFIG_KS8851_MLL is not set
684# CONFIG_VIA_RHINE is not set 693# CONFIG_VIA_RHINE is not set
685# CONFIG_SC92031 is not set 694# CONFIG_SC92031 is not set
686# CONFIG_ATL2 is not set 695# CONFIG_ATL2 is not set
696# CONFIG_XILINX_EMACLITE is not set
687# CONFIG_FS_ENET is not set 697# CONFIG_FS_ENET is not set
688CONFIG_NETDEV_1000=y 698CONFIG_NETDEV_1000=y
689# CONFIG_ACENIC is not set 699# CONFIG_ACENIC is not set
@@ -732,10 +742,7 @@ CONFIG_CHELSIO_T3_DEPENDS=y
732# CONFIG_SFC is not set 742# CONFIG_SFC is not set
733# CONFIG_BE2NET is not set 743# CONFIG_BE2NET is not set
734# CONFIG_TR is not set 744# CONFIG_TR is not set
735 745CONFIG_WLAN=y
736#
737# Wireless LAN
738#
739# CONFIG_WLAN_PRE80211 is not set 746# CONFIG_WLAN_PRE80211 is not set
740# CONFIG_WLAN_80211 is not set 747# CONFIG_WLAN_80211 is not set
741 748
@@ -831,6 +838,7 @@ CONFIG_GEN_RTC=y
831CONFIG_DEVPORT=y 838CONFIG_DEVPORT=y
832CONFIG_I2C=y 839CONFIG_I2C=y
833CONFIG_I2C_BOARDINFO=y 840CONFIG_I2C_BOARDINFO=y
841CONFIG_I2C_COMPAT=y
834CONFIG_I2C_CHARDEV=y 842CONFIG_I2C_CHARDEV=y
835CONFIG_I2C_HELPER_AUTO=y 843CONFIG_I2C_HELPER_AUTO=y
836 844
@@ -886,9 +894,6 @@ CONFIG_I2C_MPC=y
886# Miscellaneous I2C Chip support 894# Miscellaneous I2C Chip support
887# 895#
888# CONFIG_DS1682 is not set 896# CONFIG_DS1682 is not set
889# CONFIG_SENSORS_PCF8574 is not set
890# CONFIG_PCF8575 is not set
891# CONFIG_SENSORS_PCA9539 is not set
892# CONFIG_SENSORS_TSL2550 is not set 897# CONFIG_SENSORS_TSL2550 is not set
893# CONFIG_I2C_DEBUG_CORE is not set 898# CONFIG_I2C_DEBUG_CORE is not set
894# CONFIG_I2C_DEBUG_ALGO is not set 899# CONFIG_I2C_DEBUG_ALGO is not set
@@ -921,14 +926,24 @@ CONFIG_GPIOLIB=y
921# PCI GPIO expanders: 926# PCI GPIO expanders:
922# 927#
923# CONFIG_GPIO_BT8XX is not set 928# CONFIG_GPIO_BT8XX is not set
929# CONFIG_GPIO_LANGWELL is not set
924 930
925# 931#
926# SPI GPIO expanders: 932# SPI GPIO expanders:
927# 933#
934
935#
936# AC97 GPIO expanders:
937#
928# CONFIG_W1 is not set 938# CONFIG_W1 is not set
929# CONFIG_POWER_SUPPLY is not set 939# CONFIG_POWER_SUPPLY is not set
930CONFIG_HWMON=y 940CONFIG_HWMON=y
931# CONFIG_HWMON_VID is not set 941# CONFIG_HWMON_VID is not set
942CONFIG_HWMON_DEBUG_CHIP=y
943
944#
945# Native drivers
946#
932# CONFIG_SENSORS_AD7414 is not set 947# CONFIG_SENSORS_AD7414 is not set
933# CONFIG_SENSORS_AD7418 is not set 948# CONFIG_SENSORS_AD7418 is not set
934# CONFIG_SENSORS_ADM1021 is not set 949# CONFIG_SENSORS_ADM1021 is not set
@@ -979,6 +994,7 @@ CONFIG_SENSORS_LM75=y
979# CONFIG_SENSORS_ADS7828 is not set 994# CONFIG_SENSORS_ADS7828 is not set
980# CONFIG_SENSORS_THMC50 is not set 995# CONFIG_SENSORS_THMC50 is not set
981# CONFIG_SENSORS_TMP401 is not set 996# CONFIG_SENSORS_TMP401 is not set
997# CONFIG_SENSORS_TMP421 is not set
982# CONFIG_SENSORS_VIA686A is not set 998# CONFIG_SENSORS_VIA686A is not set
983# CONFIG_SENSORS_VT1211 is not set 999# CONFIG_SENSORS_VT1211 is not set
984# CONFIG_SENSORS_VT8231 is not set 1000# CONFIG_SENSORS_VT8231 is not set
@@ -990,9 +1006,7 @@ CONFIG_SENSORS_LM75=y
990# CONFIG_SENSORS_W83L786NG is not set 1006# CONFIG_SENSORS_W83L786NG is not set
991# CONFIG_SENSORS_W83627HF is not set 1007# CONFIG_SENSORS_W83627HF is not set
992# CONFIG_SENSORS_W83627EHF is not set 1008# CONFIG_SENSORS_W83627EHF is not set
993CONFIG_HWMON_DEBUG_CHIP=y
994# CONFIG_THERMAL is not set 1009# CONFIG_THERMAL is not set
995# CONFIG_THERMAL_HWMON is not set
996# CONFIG_WATCHDOG is not set 1010# CONFIG_WATCHDOG is not set
997CONFIG_SSB_POSSIBLE=y 1011CONFIG_SSB_POSSIBLE=y
998 1012
@@ -1012,6 +1026,7 @@ CONFIG_SSB_POSSIBLE=y
1012# CONFIG_MFD_TMIO is not set 1026# CONFIG_MFD_TMIO is not set
1013# CONFIG_PMIC_DA903X is not set 1027# CONFIG_PMIC_DA903X is not set
1014# CONFIG_MFD_WM8400 is not set 1028# CONFIG_MFD_WM8400 is not set
1029# CONFIG_MFD_WM831X is not set
1015# CONFIG_MFD_WM8350_I2C is not set 1030# CONFIG_MFD_WM8350_I2C is not set
1016# CONFIG_MFD_PCF50633 is not set 1031# CONFIG_MFD_PCF50633 is not set
1017# CONFIG_AB3100_CORE is not set 1032# CONFIG_AB3100_CORE is not set
@@ -1022,6 +1037,7 @@ CONFIG_SSB_POSSIBLE=y
1022# Graphics support 1037# Graphics support
1023# 1038#
1024# CONFIG_AGP is not set 1039# CONFIG_AGP is not set
1040CONFIG_VGA_ARB=y
1025# CONFIG_DRM is not set 1041# CONFIG_DRM is not set
1026# CONFIG_VGASTATE is not set 1042# CONFIG_VGASTATE is not set
1027# CONFIG_VIDEO_OUTPUT_CONTROL is not set 1043# CONFIG_VIDEO_OUTPUT_CONTROL is not set
@@ -1035,7 +1051,6 @@ CONFIG_SSB_POSSIBLE=y
1035# CONFIG_SOUND is not set 1051# CONFIG_SOUND is not set
1036CONFIG_HID_SUPPORT=y 1052CONFIG_HID_SUPPORT=y
1037CONFIG_HID=y 1053CONFIG_HID=y
1038# CONFIG_HID_DEBUG is not set
1039# CONFIG_HIDRAW is not set 1054# CONFIG_HIDRAW is not set
1040# CONFIG_HID_PID is not set 1055# CONFIG_HID_PID is not set
1041 1056
@@ -1100,6 +1115,7 @@ CONFIG_FS_MBCACHE=y
1100# CONFIG_GFS2_FS is not set 1115# CONFIG_GFS2_FS is not set
1101# CONFIG_OCFS2_FS is not set 1116# CONFIG_OCFS2_FS is not set
1102# CONFIG_BTRFS_FS is not set 1117# CONFIG_BTRFS_FS is not set
1118# CONFIG_NILFS2_FS is not set
1103CONFIG_FILE_LOCKING=y 1119CONFIG_FILE_LOCKING=y
1104CONFIG_FSNOTIFY=y 1120CONFIG_FSNOTIFY=y
1105CONFIG_DNOTIFY=y 1121CONFIG_DNOTIFY=y
@@ -1169,7 +1185,6 @@ CONFIG_CRAMFS=y
1169# CONFIG_ROMFS_FS is not set 1185# CONFIG_ROMFS_FS is not set
1170# CONFIG_SYSV_FS is not set 1186# CONFIG_SYSV_FS is not set
1171# CONFIG_UFS_FS is not set 1187# CONFIG_UFS_FS is not set
1172# CONFIG_NILFS2_FS is not set
1173CONFIG_NETWORK_FILESYSTEMS=y 1188CONFIG_NETWORK_FILESYSTEMS=y
1174CONFIG_NFS_FS=y 1189CONFIG_NFS_FS=y
1175# CONFIG_NFS_V3 is not set 1190# CONFIG_NFS_V3 is not set
@@ -1238,6 +1253,7 @@ CONFIG_ENABLE_WARN_DEPRECATED=y
1238CONFIG_ENABLE_MUST_CHECK=y 1253CONFIG_ENABLE_MUST_CHECK=y
1239CONFIG_FRAME_WARN=1024 1254CONFIG_FRAME_WARN=1024
1240# CONFIG_MAGIC_SYSRQ is not set 1255# CONFIG_MAGIC_SYSRQ is not set
1256# CONFIG_STRIP_ASM_SYMS is not set
1241# CONFIG_UNUSED_SYMBOLS is not set 1257# CONFIG_UNUSED_SYMBOLS is not set
1242# CONFIG_DEBUG_FS is not set 1258# CONFIG_DEBUG_FS is not set
1243# CONFIG_HEADERS_CHECK is not set 1259# CONFIG_HEADERS_CHECK is not set
@@ -1255,6 +1271,7 @@ CONFIG_HAVE_DYNAMIC_FTRACE=y
1255CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y 1271CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y
1256CONFIG_TRACING_SUPPORT=y 1272CONFIG_TRACING_SUPPORT=y
1257# CONFIG_FTRACE is not set 1273# CONFIG_FTRACE is not set
1274# CONFIG_DMA_API_DEBUG is not set
1258# CONFIG_SAMPLES is not set 1275# CONFIG_SAMPLES is not set
1259CONFIG_HAVE_ARCH_KGDB=y 1276CONFIG_HAVE_ARCH_KGDB=y
1260# CONFIG_PPC_DISABLE_WERROR is not set 1277# CONFIG_PPC_DISABLE_WERROR is not set
@@ -1275,7 +1292,6 @@ CONFIG_CRYPTO=y
1275# 1292#
1276# Crypto core or helper 1293# Crypto core or helper
1277# 1294#
1278# CONFIG_CRYPTO_FIPS is not set
1279# CONFIG_CRYPTO_MANAGER is not set 1295# CONFIG_CRYPTO_MANAGER is not set
1280# CONFIG_CRYPTO_MANAGER2 is not set 1296# CONFIG_CRYPTO_MANAGER2 is not set
1281# CONFIG_CRYPTO_GF128MUL is not set 1297# CONFIG_CRYPTO_GF128MUL is not set
@@ -1306,11 +1322,13 @@ CONFIG_CRYPTO=y
1306# 1322#
1307# CONFIG_CRYPTO_HMAC is not set 1323# CONFIG_CRYPTO_HMAC is not set
1308# CONFIG_CRYPTO_XCBC is not set 1324# CONFIG_CRYPTO_XCBC is not set
1325# CONFIG_CRYPTO_VMAC is not set
1309 1326
1310# 1327#
1311# Digest 1328# Digest
1312# 1329#
1313# CONFIG_CRYPTO_CRC32C is not set 1330# CONFIG_CRYPTO_CRC32C is not set
1331# CONFIG_CRYPTO_GHASH is not set
1314# CONFIG_CRYPTO_MD4 is not set 1332# CONFIG_CRYPTO_MD4 is not set
1315# CONFIG_CRYPTO_MD5 is not set 1333# CONFIG_CRYPTO_MD5 is not set
1316# CONFIG_CRYPTO_MICHAEL_MIC is not set 1334# CONFIG_CRYPTO_MICHAEL_MIC is not set
diff --git a/arch/powerpc/configs/85xx/xes_mpc85xx_defconfig b/arch/powerpc/configs/85xx/xes_mpc85xx_defconfig
index 1025da2bf069..52acbac0c4fe 100644
--- a/arch/powerpc/configs/85xx/xes_mpc85xx_defconfig
+++ b/arch/powerpc/configs/85xx/xes_mpc85xx_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.31-rc4 3# Linux kernel version: 2.6.32-rc5
4# Wed Jul 29 23:32:25 2009 4# Thu Nov 5 08:20:44 2009
5# 5#
6# CONFIG_PPC64 is not set 6# CONFIG_PPC64 is not set
7 7
@@ -22,6 +22,7 @@ CONFIG_FSL_EMB_PERFMON=y
22# CONFIG_PHYS_64BIT is not set 22# CONFIG_PHYS_64BIT is not set
23CONFIG_SPE=y 23CONFIG_SPE=y
24CONFIG_PPC_MMU_NOHASH=y 24CONFIG_PPC_MMU_NOHASH=y
25CONFIG_PPC_MMU_NOHASH_32=y
25CONFIG_PPC_BOOK3E_MMU=y 26CONFIG_PPC_BOOK3E_MMU=y
26# CONFIG_PPC_MM_SLICES is not set 27# CONFIG_PPC_MM_SLICES is not set
27CONFIG_SMP=y 28CONFIG_SMP=y
@@ -37,6 +38,7 @@ CONFIG_GENERIC_CLOCKEVENTS=y
37CONFIG_GENERIC_HARDIRQS=y 38CONFIG_GENERIC_HARDIRQS=y
38CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y 39CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y
39# CONFIG_HAVE_SETUP_PER_CPU_AREA is not set 40# CONFIG_HAVE_SETUP_PER_CPU_AREA is not set
41# CONFIG_NEED_PER_CPU_EMBED_FIRST_CHUNK is not set
40CONFIG_IRQ_PER_CPU=y 42CONFIG_IRQ_PER_CPU=y
41CONFIG_STACKTRACE_SUPPORT=y 43CONFIG_STACKTRACE_SUPPORT=y
42CONFIG_HAVE_LATENCYTOP_SUPPORT=y 44CONFIG_HAVE_LATENCYTOP_SUPPORT=y
@@ -89,11 +91,12 @@ CONFIG_AUDIT=y
89# 91#
90# RCU Subsystem 92# RCU Subsystem
91# 93#
92CONFIG_CLASSIC_RCU=y 94CONFIG_TREE_RCU=y
93# CONFIG_TREE_RCU is not set 95# CONFIG_TREE_PREEMPT_RCU is not set
94# CONFIG_PREEMPT_RCU is not set 96# CONFIG_RCU_TRACE is not set
97CONFIG_RCU_FANOUT=32
98# CONFIG_RCU_FANOUT_EXACT is not set
95# CONFIG_TREE_RCU_TRACE is not set 99# CONFIG_TREE_RCU_TRACE is not set
96# CONFIG_PREEMPT_RCU_TRACE is not set
97CONFIG_IKCONFIG=y 100CONFIG_IKCONFIG=y
98CONFIG_IKCONFIG_PROC=y 101CONFIG_IKCONFIG_PROC=y
99CONFIG_LOG_BUF_SHIFT=14 102CONFIG_LOG_BUF_SHIFT=14
@@ -128,22 +131,21 @@ CONFIG_TIMERFD=y
128CONFIG_EVENTFD=y 131CONFIG_EVENTFD=y
129CONFIG_SHMEM=y 132CONFIG_SHMEM=y
130CONFIG_AIO=y 133CONFIG_AIO=y
131CONFIG_HAVE_PERF_COUNTERS=y 134CONFIG_HAVE_PERF_EVENTS=y
132 135
133# 136#
134# Performance Counters 137# Kernel Performance Events And Counters
135# 138#
139# CONFIG_PERF_EVENTS is not set
136# CONFIG_PERF_COUNTERS is not set 140# CONFIG_PERF_COUNTERS is not set
137CONFIG_VM_EVENT_COUNTERS=y 141CONFIG_VM_EVENT_COUNTERS=y
138CONFIG_PCI_QUIRKS=y 142CONFIG_PCI_QUIRKS=y
139CONFIG_SLUB_DEBUG=y 143CONFIG_SLUB_DEBUG=y
140# CONFIG_STRIP_ASM_SYMS is not set
141CONFIG_COMPAT_BRK=y 144CONFIG_COMPAT_BRK=y
142# CONFIG_SLAB is not set 145# CONFIG_SLAB is not set
143CONFIG_SLUB=y 146CONFIG_SLUB=y
144# CONFIG_SLOB is not set 147# CONFIG_SLOB is not set
145# CONFIG_PROFILING is not set 148# CONFIG_PROFILING is not set
146# CONFIG_MARKERS is not set
147CONFIG_HAVE_OPROFILE=y 149CONFIG_HAVE_OPROFILE=y
148# CONFIG_KPROBES is not set 150# CONFIG_KPROBES is not set
149CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS=y 151CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS=y
@@ -151,7 +153,9 @@ CONFIG_HAVE_IOREMAP_PROT=y
151CONFIG_HAVE_KPROBES=y 153CONFIG_HAVE_KPROBES=y
152CONFIG_HAVE_KRETPROBES=y 154CONFIG_HAVE_KRETPROBES=y
153CONFIG_HAVE_ARCH_TRACEHOOK=y 155CONFIG_HAVE_ARCH_TRACEHOOK=y
156CONFIG_HAVE_DMA_ATTRS=y
154CONFIG_USE_GENERIC_SMP_HELPERS=y 157CONFIG_USE_GENERIC_SMP_HELPERS=y
158CONFIG_HAVE_DMA_API_DEBUG=y
155 159
156# 160#
157# GCOV-based kernel profiling 161# GCOV-based kernel profiling
@@ -201,6 +205,7 @@ CONFIG_MPC85xx=y
201# CONFIG_MPC85xx_MDS is not set 205# CONFIG_MPC85xx_MDS is not set
202# CONFIG_MPC8536_DS is not set 206# CONFIG_MPC8536_DS is not set
203# CONFIG_MPC85xx_DS is not set 207# CONFIG_MPC85xx_DS is not set
208# CONFIG_MPC85xx_RDB is not set
204# CONFIG_SOCRATES is not set 209# CONFIG_SOCRATES is not set
205# CONFIG_KSI8560 is not set 210# CONFIG_KSI8560 is not set
206CONFIG_XES_MPC85xx=y 211CONFIG_XES_MPC85xx=y
@@ -256,6 +261,7 @@ CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y
256CONFIG_ARCH_HAS_WALK_MEMORY=y 261CONFIG_ARCH_HAS_WALK_MEMORY=y
257CONFIG_ARCH_ENABLE_MEMORY_HOTREMOVE=y 262CONFIG_ARCH_ENABLE_MEMORY_HOTREMOVE=y
258# CONFIG_IRQ_ALL_CPUS is not set 263# CONFIG_IRQ_ALL_CPUS is not set
264CONFIG_MAX_ACTIVE_REGIONS=32
259CONFIG_ARCH_FLATMEM_ENABLE=y 265CONFIG_ARCH_FLATMEM_ENABLE=y
260CONFIG_ARCH_POPULATES_NODE_MAP=y 266CONFIG_ARCH_POPULATES_NODE_MAP=y
261CONFIG_SELECT_MEMORY_MODEL=y 267CONFIG_SELECT_MEMORY_MODEL=y
@@ -273,6 +279,7 @@ CONFIG_BOUNCE=y
273CONFIG_VIRT_TO_BUS=y 279CONFIG_VIRT_TO_BUS=y
274CONFIG_HAVE_MLOCK=y 280CONFIG_HAVE_MLOCK=y
275CONFIG_HAVE_MLOCKED_PAGE_BIT=y 281CONFIG_HAVE_MLOCKED_PAGE_BIT=y
282# CONFIG_KSM is not set
276CONFIG_DEFAULT_MMAP_MIN_ADDR=4096 283CONFIG_DEFAULT_MMAP_MIN_ADDR=4096
277CONFIG_PPC_4K_PAGES=y 284CONFIG_PPC_4K_PAGES=y
278# CONFIG_PPC_16K_PAGES is not set 285# CONFIG_PPC_16K_PAGES is not set
@@ -405,6 +412,7 @@ CONFIG_IPV6_NDISC_NODETYPE=y
405# CONFIG_NETFILTER is not set 412# CONFIG_NETFILTER is not set
406# CONFIG_IP_DCCP is not set 413# CONFIG_IP_DCCP is not set
407# CONFIG_IP_SCTP is not set 414# CONFIG_IP_SCTP is not set
415# CONFIG_RDS is not set
408# CONFIG_TIPC is not set 416# CONFIG_TIPC is not set
409# CONFIG_ATM is not set 417# CONFIG_ATM is not set
410# CONFIG_BRIDGE is not set 418# CONFIG_BRIDGE is not set
@@ -446,6 +454,7 @@ CONFIG_FIB_RULES=y
446# Generic Driver Options 454# Generic Driver Options
447# 455#
448CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug" 456CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
457# CONFIG_DEVTMPFS is not set
449CONFIG_STANDALONE=y 458CONFIG_STANDALONE=y
450CONFIG_PREVENT_FIRMWARE_BUILD=y 459CONFIG_PREVENT_FIRMWARE_BUILD=y
451CONFIG_FW_LOADER=y 460CONFIG_FW_LOADER=y
@@ -457,9 +466,9 @@ CONFIG_EXTRA_FIRMWARE=""
457# CONFIG_CONNECTOR is not set 466# CONFIG_CONNECTOR is not set
458CONFIG_MTD=y 467CONFIG_MTD=y
459# CONFIG_MTD_DEBUG is not set 468# CONFIG_MTD_DEBUG is not set
469# CONFIG_MTD_TESTS is not set
460# CONFIG_MTD_CONCAT is not set 470# CONFIG_MTD_CONCAT is not set
461CONFIG_MTD_PARTITIONS=y 471CONFIG_MTD_PARTITIONS=y
462# CONFIG_MTD_TESTS is not set
463CONFIG_MTD_REDBOOT_PARTS=y 472CONFIG_MTD_REDBOOT_PARTS=y
464CONFIG_MTD_REDBOOT_DIRECTORY_BLOCK=-1 473CONFIG_MTD_REDBOOT_DIRECTORY_BLOCK=-1
465# CONFIG_MTD_REDBOOT_PARTS_UNALLOCATED is not set 474# CONFIG_MTD_REDBOOT_PARTS_UNALLOCATED is not set
@@ -635,6 +644,7 @@ CONFIG_SCSI_WAIT_SCAN=m
635CONFIG_SCSI_LOWLEVEL=y 644CONFIG_SCSI_LOWLEVEL=y
636# CONFIG_ISCSI_TCP is not set 645# CONFIG_ISCSI_TCP is not set
637# CONFIG_SCSI_BNX2_ISCSI is not set 646# CONFIG_SCSI_BNX2_ISCSI is not set
647# CONFIG_BE2ISCSI is not set
638# CONFIG_BLK_DEV_3W_XXXX_RAID is not set 648# CONFIG_BLK_DEV_3W_XXXX_RAID is not set
639# CONFIG_SCSI_3W_9XXX is not set 649# CONFIG_SCSI_3W_9XXX is not set
640# CONFIG_SCSI_ACARD is not set 650# CONFIG_SCSI_ACARD is not set
@@ -674,11 +684,14 @@ CONFIG_SCSI_LOWLEVEL=y
674# CONFIG_SCSI_DC390T is not set 684# CONFIG_SCSI_DC390T is not set
675# CONFIG_SCSI_NSP32 is not set 685# CONFIG_SCSI_NSP32 is not set
676# CONFIG_SCSI_DEBUG is not set 686# CONFIG_SCSI_DEBUG is not set
687# CONFIG_SCSI_PMCRAID is not set
677# CONFIG_SCSI_SRP is not set 688# CONFIG_SCSI_SRP is not set
689# CONFIG_SCSI_BFA_FC is not set
678# CONFIG_SCSI_DH is not set 690# CONFIG_SCSI_DH is not set
679# CONFIG_SCSI_OSD_INITIATOR is not set 691# CONFIG_SCSI_OSD_INITIATOR is not set
680CONFIG_ATA=y 692CONFIG_ATA=y
681# CONFIG_ATA_NONSTANDARD is not set 693# CONFIG_ATA_NONSTANDARD is not set
694CONFIG_ATA_VERBOSE_ERROR=y
682CONFIG_SATA_PMP=y 695CONFIG_SATA_PMP=y
683CONFIG_SATA_AHCI=y 696CONFIG_SATA_AHCI=y
684# CONFIG_SATA_SIL24 is not set 697# CONFIG_SATA_SIL24 is not set
@@ -701,6 +714,7 @@ CONFIG_ATA_SFF=y
701CONFIG_PATA_ALI=y 714CONFIG_PATA_ALI=y
702# CONFIG_PATA_AMD is not set 715# CONFIG_PATA_AMD is not set
703# CONFIG_PATA_ARTOP is not set 716# CONFIG_PATA_ARTOP is not set
717# CONFIG_PATA_ATP867X is not set
704# CONFIG_PATA_ATIIXP is not set 718# CONFIG_PATA_ATIIXP is not set
705# CONFIG_PATA_CMD640_PCI is not set 719# CONFIG_PATA_CMD640_PCI is not set
706# CONFIG_PATA_CMD64X is not set 720# CONFIG_PATA_CMD64X is not set
@@ -728,6 +742,7 @@ CONFIG_PATA_ALI=y
728# CONFIG_PATA_OPTIDMA is not set 742# CONFIG_PATA_OPTIDMA is not set
729# CONFIG_PATA_PDC_OLD is not set 743# CONFIG_PATA_PDC_OLD is not set
730# CONFIG_PATA_RADISYS is not set 744# CONFIG_PATA_RADISYS is not set
745# CONFIG_PATA_RDC is not set
731# CONFIG_PATA_RZ1000 is not set 746# CONFIG_PATA_RZ1000 is not set
732# CONFIG_PATA_SC1200 is not set 747# CONFIG_PATA_SC1200 is not set
733# CONFIG_PATA_SERVERWORKS is not set 748# CONFIG_PATA_SERVERWORKS is not set
@@ -804,7 +819,9 @@ CONFIG_MII=y
804# CONFIG_NET_PCI is not set 819# CONFIG_NET_PCI is not set
805# CONFIG_B44 is not set 820# CONFIG_B44 is not set
806# CONFIG_KS8842 is not set 821# CONFIG_KS8842 is not set
822# CONFIG_KS8851_MLL is not set
807# CONFIG_ATL2 is not set 823# CONFIG_ATL2 is not set
824# CONFIG_XILINX_EMACLITE is not set
808CONFIG_NETDEV_1000=y 825CONFIG_NETDEV_1000=y
809# CONFIG_ACENIC is not set 826# CONFIG_ACENIC is not set
810# CONFIG_DL2K is not set 827# CONFIG_DL2K is not set
@@ -834,10 +851,7 @@ CONFIG_GIANFAR=y
834# CONFIG_JME is not set 851# CONFIG_JME is not set
835# CONFIG_NETDEV_10000 is not set 852# CONFIG_NETDEV_10000 is not set
836# CONFIG_TR is not set 853# CONFIG_TR is not set
837 854CONFIG_WLAN=y
838#
839# Wireless LAN
840#
841# CONFIG_WLAN_PRE80211 is not set 855# CONFIG_WLAN_PRE80211 is not set
842# CONFIG_WLAN_80211 is not set 856# CONFIG_WLAN_80211 is not set
843 857
@@ -951,6 +965,7 @@ CONFIG_NVRAM=y
951CONFIG_DEVPORT=y 965CONFIG_DEVPORT=y
952CONFIG_I2C=y 966CONFIG_I2C=y
953CONFIG_I2C_BOARDINFO=y 967CONFIG_I2C_BOARDINFO=y
968CONFIG_I2C_COMPAT=y
954CONFIG_I2C_CHARDEV=y 969CONFIG_I2C_CHARDEV=y
955CONFIG_I2C_HELPER_AUTO=y 970CONFIG_I2C_HELPER_AUTO=y
956 971
@@ -1006,8 +1021,6 @@ CONFIG_I2C_MPC=y
1006# Miscellaneous I2C Chip support 1021# Miscellaneous I2C Chip support
1007# 1022#
1008# CONFIG_DS1682 is not set 1023# CONFIG_DS1682 is not set
1009# CONFIG_SENSORS_PCF8574 is not set
1010# CONFIG_PCF8575 is not set
1011# CONFIG_SENSORS_TSL2550 is not set 1024# CONFIG_SENSORS_TSL2550 is not set
1012# CONFIG_I2C_DEBUG_CORE is not set 1025# CONFIG_I2C_DEBUG_CORE is not set
1013# CONFIG_I2C_DEBUG_ALGO is not set 1026# CONFIG_I2C_DEBUG_ALGO is not set
@@ -1041,14 +1054,24 @@ CONFIG_GPIO_PCA953X=y
1041# PCI GPIO expanders: 1054# PCI GPIO expanders:
1042# 1055#
1043# CONFIG_GPIO_BT8XX is not set 1056# CONFIG_GPIO_BT8XX is not set
1057# CONFIG_GPIO_LANGWELL is not set
1044 1058
1045# 1059#
1046# SPI GPIO expanders: 1060# SPI GPIO expanders:
1047# 1061#
1062
1063#
1064# AC97 GPIO expanders:
1065#
1048# CONFIG_W1 is not set 1066# CONFIG_W1 is not set
1049# CONFIG_POWER_SUPPLY is not set 1067# CONFIG_POWER_SUPPLY is not set
1050CONFIG_HWMON=y 1068CONFIG_HWMON=y
1051# CONFIG_HWMON_VID is not set 1069# CONFIG_HWMON_VID is not set
1070# CONFIG_HWMON_DEBUG_CHIP is not set
1071
1072#
1073# Native drivers
1074#
1052# CONFIG_SENSORS_AD7414 is not set 1075# CONFIG_SENSORS_AD7414 is not set
1053# CONFIG_SENSORS_AD7418 is not set 1076# CONFIG_SENSORS_AD7418 is not set
1054# CONFIG_SENSORS_ADM1021 is not set 1077# CONFIG_SENSORS_ADM1021 is not set
@@ -1099,6 +1122,7 @@ CONFIG_SENSORS_LM90=y
1099# CONFIG_SENSORS_ADS7828 is not set 1122# CONFIG_SENSORS_ADS7828 is not set
1100# CONFIG_SENSORS_THMC50 is not set 1123# CONFIG_SENSORS_THMC50 is not set
1101# CONFIG_SENSORS_TMP401 is not set 1124# CONFIG_SENSORS_TMP401 is not set
1125# CONFIG_SENSORS_TMP421 is not set
1102# CONFIG_SENSORS_VIA686A is not set 1126# CONFIG_SENSORS_VIA686A is not set
1103# CONFIG_SENSORS_VT1211 is not set 1127# CONFIG_SENSORS_VT1211 is not set
1104# CONFIG_SENSORS_VT8231 is not set 1128# CONFIG_SENSORS_VT8231 is not set
@@ -1110,9 +1134,7 @@ CONFIG_SENSORS_LM90=y
1110# CONFIG_SENSORS_W83L786NG is not set 1134# CONFIG_SENSORS_W83L786NG is not set
1111# CONFIG_SENSORS_W83627HF is not set 1135# CONFIG_SENSORS_W83627HF is not set
1112# CONFIG_SENSORS_W83627EHF is not set 1136# CONFIG_SENSORS_W83627EHF is not set
1113# CONFIG_HWMON_DEBUG_CHIP is not set
1114# CONFIG_THERMAL is not set 1137# CONFIG_THERMAL is not set
1115# CONFIG_THERMAL_HWMON is not set
1116CONFIG_WATCHDOG=y 1138CONFIG_WATCHDOG=y
1117# CONFIG_WATCHDOG_NOWAYOUT is not set 1139# CONFIG_WATCHDOG_NOWAYOUT is not set
1118 1140
@@ -1151,6 +1173,7 @@ CONFIG_SSB_POSSIBLE=y
1151# CONFIG_MFD_TMIO is not set 1173# CONFIG_MFD_TMIO is not set
1152# CONFIG_PMIC_DA903X is not set 1174# CONFIG_PMIC_DA903X is not set
1153# CONFIG_MFD_WM8400 is not set 1175# CONFIG_MFD_WM8400 is not set
1176# CONFIG_MFD_WM831X is not set
1154# CONFIG_MFD_WM8350_I2C is not set 1177# CONFIG_MFD_WM8350_I2C is not set
1155# CONFIG_MFD_PCF50633 is not set 1178# CONFIG_MFD_PCF50633 is not set
1156# CONFIG_AB3100_CORE is not set 1179# CONFIG_AB3100_CORE is not set
@@ -1161,6 +1184,7 @@ CONFIG_SSB_POSSIBLE=y
1161# Graphics support 1184# Graphics support
1162# 1185#
1163# CONFIG_AGP is not set 1186# CONFIG_AGP is not set
1187CONFIG_VGA_ARB=y
1164# CONFIG_DRM is not set 1188# CONFIG_DRM is not set
1165# CONFIG_VGASTATE is not set 1189# CONFIG_VGASTATE is not set
1166CONFIG_VIDEO_OUTPUT_CONTROL=y 1190CONFIG_VIDEO_OUTPUT_CONTROL=y
@@ -1181,7 +1205,6 @@ CONFIG_DUMMY_CONSOLE=y
1181# CONFIG_SOUND is not set 1205# CONFIG_SOUND is not set
1182CONFIG_HID_SUPPORT=y 1206CONFIG_HID_SUPPORT=y
1183CONFIG_HID=y 1207CONFIG_HID=y
1184# CONFIG_HID_DEBUG is not set
1185# CONFIG_HIDRAW is not set 1208# CONFIG_HIDRAW is not set
1186 1209
1187# 1210#
@@ -1204,6 +1227,7 @@ CONFIG_USB_HID=y
1204# CONFIG_HID_EZKEY is not set 1227# CONFIG_HID_EZKEY is not set
1205# CONFIG_HID_KYE is not set 1228# CONFIG_HID_KYE is not set
1206# CONFIG_HID_GYRATION is not set 1229# CONFIG_HID_GYRATION is not set
1230# CONFIG_HID_TWINHAN is not set
1207# CONFIG_HID_KENSINGTON is not set 1231# CONFIG_HID_KENSINGTON is not set
1208# CONFIG_HID_LOGITECH is not set 1232# CONFIG_HID_LOGITECH is not set
1209# CONFIG_HID_MICROSOFT is not set 1233# CONFIG_HID_MICROSOFT is not set
@@ -1249,6 +1273,7 @@ CONFIG_USB_MON=y
1249# CONFIG_USB_OXU210HP_HCD is not set 1273# CONFIG_USB_OXU210HP_HCD is not set
1250# CONFIG_USB_ISP116X_HCD is not set 1274# CONFIG_USB_ISP116X_HCD is not set
1251CONFIG_USB_ISP1760_HCD=y 1275CONFIG_USB_ISP1760_HCD=y
1276# CONFIG_USB_ISP1362_HCD is not set
1252# CONFIG_USB_OHCI_HCD is not set 1277# CONFIG_USB_OHCI_HCD is not set
1253# CONFIG_USB_UHCI_HCD is not set 1278# CONFIG_USB_UHCI_HCD is not set
1254# CONFIG_USB_SL811_HCD is not set 1279# CONFIG_USB_SL811_HCD is not set
@@ -1466,6 +1491,7 @@ CONFIG_FS_MBCACHE=y
1466# CONFIG_GFS2_FS is not set 1491# CONFIG_GFS2_FS is not set
1467# CONFIG_OCFS2_FS is not set 1492# CONFIG_OCFS2_FS is not set
1468# CONFIG_BTRFS_FS is not set 1493# CONFIG_BTRFS_FS is not set
1494# CONFIG_NILFS2_FS is not set
1469CONFIG_FILE_LOCKING=y 1495CONFIG_FILE_LOCKING=y
1470CONFIG_FSNOTIFY=y 1496CONFIG_FSNOTIFY=y
1471CONFIG_DNOTIFY=y 1497CONFIG_DNOTIFY=y
@@ -1541,7 +1567,6 @@ CONFIG_JFFS2_RTIME=y
1541# CONFIG_ROMFS_FS is not set 1567# CONFIG_ROMFS_FS is not set
1542# CONFIG_SYSV_FS is not set 1568# CONFIG_SYSV_FS is not set
1543# CONFIG_UFS_FS is not set 1569# CONFIG_UFS_FS is not set
1544# CONFIG_NILFS2_FS is not set
1545CONFIG_NETWORK_FILESYSTEMS=y 1570CONFIG_NETWORK_FILESYSTEMS=y
1546CONFIG_NFS_FS=y 1571CONFIG_NFS_FS=y
1547CONFIG_NFS_V3=y 1572CONFIG_NFS_V3=y
@@ -1658,6 +1683,7 @@ CONFIG_ENABLE_WARN_DEPRECATED=y
1658CONFIG_ENABLE_MUST_CHECK=y 1683CONFIG_ENABLE_MUST_CHECK=y
1659CONFIG_FRAME_WARN=1024 1684CONFIG_FRAME_WARN=1024
1660# CONFIG_MAGIC_SYSRQ is not set 1685# CONFIG_MAGIC_SYSRQ is not set
1686# CONFIG_STRIP_ASM_SYMS is not set
1661# CONFIG_UNUSED_SYMBOLS is not set 1687# CONFIG_UNUSED_SYMBOLS is not set
1662# CONFIG_DEBUG_FS is not set 1688# CONFIG_DEBUG_FS is not set
1663# CONFIG_HEADERS_CHECK is not set 1689# CONFIG_HEADERS_CHECK is not set
@@ -1675,6 +1701,7 @@ CONFIG_SCHED_DEBUG=y
1675# CONFIG_DEBUG_OBJECTS is not set 1701# CONFIG_DEBUG_OBJECTS is not set
1676# CONFIG_SLUB_DEBUG_ON is not set 1702# CONFIG_SLUB_DEBUG_ON is not set
1677# CONFIG_SLUB_STATS is not set 1703# CONFIG_SLUB_STATS is not set
1704# CONFIG_DEBUG_KMEMLEAK is not set
1678# CONFIG_DEBUG_RT_MUTEXES is not set 1705# CONFIG_DEBUG_RT_MUTEXES is not set
1679# CONFIG_RT_MUTEX_TESTER is not set 1706# CONFIG_RT_MUTEX_TESTER is not set
1680# CONFIG_DEBUG_SPINLOCK is not set 1707# CONFIG_DEBUG_SPINLOCK is not set
@@ -1694,10 +1721,12 @@ CONFIG_SCHED_DEBUG=y
1694# CONFIG_DEBUG_LIST is not set 1721# CONFIG_DEBUG_LIST is not set
1695# CONFIG_DEBUG_SG is not set 1722# CONFIG_DEBUG_SG is not set
1696# CONFIG_DEBUG_NOTIFIERS is not set 1723# CONFIG_DEBUG_NOTIFIERS is not set
1724# CONFIG_DEBUG_CREDENTIALS is not set
1697# CONFIG_RCU_TORTURE_TEST is not set 1725# CONFIG_RCU_TORTURE_TEST is not set
1698# CONFIG_RCU_CPU_STALL_DETECTOR is not set 1726# CONFIG_RCU_CPU_STALL_DETECTOR is not set
1699# CONFIG_BACKTRACE_SELF_TEST is not set 1727# CONFIG_BACKTRACE_SELF_TEST is not set
1700# CONFIG_DEBUG_BLOCK_EXT_DEVT is not set 1728# CONFIG_DEBUG_BLOCK_EXT_DEVT is not set
1729# CONFIG_DEBUG_FORCE_WEAK_PER_CPU is not set
1701# CONFIG_FAULT_INJECTION is not set 1730# CONFIG_FAULT_INJECTION is not set
1702# CONFIG_LATENCYTOP is not set 1731# CONFIG_LATENCYTOP is not set
1703# CONFIG_SYSCTL_SYSCALL_CHECK is not set 1732# CONFIG_SYSCTL_SYSCALL_CHECK is not set
@@ -1720,10 +1749,10 @@ CONFIG_BRANCH_PROFILE_NONE=y
1720# CONFIG_KMEMTRACE is not set 1749# CONFIG_KMEMTRACE is not set
1721# CONFIG_WORKQUEUE_TRACER is not set 1750# CONFIG_WORKQUEUE_TRACER is not set
1722# CONFIG_BLK_DEV_IO_TRACE is not set 1751# CONFIG_BLK_DEV_IO_TRACE is not set
1752# CONFIG_DMA_API_DEBUG is not set
1723# CONFIG_SAMPLES is not set 1753# CONFIG_SAMPLES is not set
1724CONFIG_HAVE_ARCH_KGDB=y 1754CONFIG_HAVE_ARCH_KGDB=y
1725# CONFIG_KGDB is not set 1755# CONFIG_KGDB is not set
1726# CONFIG_KMEMCHECK is not set
1727# CONFIG_PPC_DISABLE_WERROR is not set 1756# CONFIG_PPC_DISABLE_WERROR is not set
1728CONFIG_PPC_WERROR=y 1757CONFIG_PPC_WERROR=y
1729CONFIG_PRINT_STACK_DEPTH=64 1758CONFIG_PRINT_STACK_DEPTH=64
@@ -1749,7 +1778,6 @@ CONFIG_CRYPTO=y
1749# 1778#
1750# Crypto core or helper 1779# Crypto core or helper
1751# 1780#
1752# CONFIG_CRYPTO_FIPS is not set
1753CONFIG_CRYPTO_ALGAPI=y 1781CONFIG_CRYPTO_ALGAPI=y
1754CONFIG_CRYPTO_ALGAPI2=y 1782CONFIG_CRYPTO_ALGAPI2=y
1755CONFIG_CRYPTO_AEAD2=y 1783CONFIG_CRYPTO_AEAD2=y
@@ -1790,11 +1818,13 @@ CONFIG_CRYPTO_WORKQUEUE=y
1790# 1818#
1791CONFIG_CRYPTO_HMAC=y 1819CONFIG_CRYPTO_HMAC=y
1792# CONFIG_CRYPTO_XCBC is not set 1820# CONFIG_CRYPTO_XCBC is not set
1821# CONFIG_CRYPTO_VMAC is not set
1793 1822
1794# 1823#
1795# Digest 1824# Digest
1796# 1825#
1797# CONFIG_CRYPTO_CRC32C is not set 1826# CONFIG_CRYPTO_CRC32C is not set
1827# CONFIG_CRYPTO_GHASH is not set
1798# CONFIG_CRYPTO_MD4 is not set 1828# CONFIG_CRYPTO_MD4 is not set
1799CONFIG_CRYPTO_MD5=y 1829CONFIG_CRYPTO_MD5=y
1800# CONFIG_CRYPTO_MICHAEL_MIC is not set 1830# CONFIG_CRYPTO_MICHAEL_MIC is not set
diff --git a/arch/powerpc/configs/86xx/gef_ppc9a_defconfig b/arch/powerpc/configs/86xx/gef_ppc9a_defconfig
index 527ad1a5e802..28980738776c 100644
--- a/arch/powerpc/configs/86xx/gef_ppc9a_defconfig
+++ b/arch/powerpc/configs/86xx/gef_ppc9a_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.31-rc4 3# Linux kernel version: 2.6.32-rc5
4# Wed Jul 29 23:32:31 2009 4# Thu Nov 5 08:20:49 2009
5# 5#
6# CONFIG_PPC64 is not set 6# CONFIG_PPC64 is not set
7 7
@@ -36,6 +36,7 @@ CONFIG_GENERIC_CLOCKEVENTS=y
36CONFIG_GENERIC_HARDIRQS=y 36CONFIG_GENERIC_HARDIRQS=y
37CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y 37CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y
38# CONFIG_HAVE_SETUP_PER_CPU_AREA is not set 38# CONFIG_HAVE_SETUP_PER_CPU_AREA is not set
39# CONFIG_NEED_PER_CPU_EMBED_FIRST_CHUNK 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
@@ -88,11 +89,12 @@ CONFIG_BSD_PROCESS_ACCT_V3=y
88# 89#
89# RCU Subsystem 90# RCU Subsystem
90# 91#
91CONFIG_CLASSIC_RCU=y 92CONFIG_TREE_RCU=y
92# CONFIG_TREE_RCU is not set 93# CONFIG_TREE_PREEMPT_RCU is not set
93# CONFIG_PREEMPT_RCU is not set 94# CONFIG_RCU_TRACE is not set
95CONFIG_RCU_FANOUT=32
96# CONFIG_RCU_FANOUT_EXACT is not set
94# CONFIG_TREE_RCU_TRACE is not set 97# CONFIG_TREE_RCU_TRACE is not set
95# CONFIG_PREEMPT_RCU_TRACE is not set
96CONFIG_IKCONFIG=y 98CONFIG_IKCONFIG=y
97CONFIG_IKCONFIG_PROC=y 99CONFIG_IKCONFIG_PROC=y
98CONFIG_LOG_BUF_SHIFT=14 100CONFIG_LOG_BUF_SHIFT=14
@@ -130,21 +132,20 @@ CONFIG_TIMERFD=y
130CONFIG_EVENTFD=y 132CONFIG_EVENTFD=y
131CONFIG_SHMEM=y 133CONFIG_SHMEM=y
132CONFIG_AIO=y 134CONFIG_AIO=y
133CONFIG_HAVE_PERF_COUNTERS=y 135CONFIG_HAVE_PERF_EVENTS=y
134 136
135# 137#
136# Performance Counters 138# Kernel Performance Events And Counters
137# 139#
140# CONFIG_PERF_EVENTS is not set
138# CONFIG_PERF_COUNTERS is not set 141# CONFIG_PERF_COUNTERS is not set
139CONFIG_VM_EVENT_COUNTERS=y 142CONFIG_VM_EVENT_COUNTERS=y
140CONFIG_PCI_QUIRKS=y 143CONFIG_PCI_QUIRKS=y
141# CONFIG_STRIP_ASM_SYMS is not set
142CONFIG_COMPAT_BRK=y 144CONFIG_COMPAT_BRK=y
143CONFIG_SLAB=y 145CONFIG_SLAB=y
144# CONFIG_SLUB is not set 146# CONFIG_SLUB is not set
145# CONFIG_SLOB is not set 147# CONFIG_SLOB is not set
146# CONFIG_PROFILING is not set 148# CONFIG_PROFILING is not set
147# CONFIG_MARKERS is not set
148CONFIG_HAVE_OPROFILE=y 149CONFIG_HAVE_OPROFILE=y
149# CONFIG_KPROBES is not set 150# CONFIG_KPROBES is not set
150CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS=y 151CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS=y
@@ -152,12 +153,14 @@ CONFIG_HAVE_IOREMAP_PROT=y
152CONFIG_HAVE_KPROBES=y 153CONFIG_HAVE_KPROBES=y
153CONFIG_HAVE_KRETPROBES=y 154CONFIG_HAVE_KRETPROBES=y
154CONFIG_HAVE_ARCH_TRACEHOOK=y 155CONFIG_HAVE_ARCH_TRACEHOOK=y
156CONFIG_HAVE_DMA_ATTRS=y
155CONFIG_USE_GENERIC_SMP_HELPERS=y 157CONFIG_USE_GENERIC_SMP_HELPERS=y
158CONFIG_HAVE_DMA_API_DEBUG=y
156 159
157# 160#
158# GCOV-based kernel profiling 161# GCOV-based kernel profiling
159# 162#
160# CONFIG_SLOW_WORK is not set 163CONFIG_SLOW_WORK=y
161# CONFIG_HAVE_GENERIC_DMA_COHERENT is not set 164# CONFIG_HAVE_GENERIC_DMA_COHERENT is not set
162CONFIG_SLABINFO=y 165CONFIG_SLABINFO=y
163CONFIG_RT_MUTEXES=y 166CONFIG_RT_MUTEXES=y
@@ -256,6 +259,7 @@ CONFIG_ARCH_ENABLE_MEMORY_HOTREMOVE=y
256# CONFIG_KEXEC is not set 259# CONFIG_KEXEC is not set
257# CONFIG_CRASH_DUMP is not set 260# CONFIG_CRASH_DUMP is not set
258CONFIG_IRQ_ALL_CPUS=y 261CONFIG_IRQ_ALL_CPUS=y
262CONFIG_MAX_ACTIVE_REGIONS=32
259CONFIG_ARCH_FLATMEM_ENABLE=y 263CONFIG_ARCH_FLATMEM_ENABLE=y
260CONFIG_ARCH_POPULATES_NODE_MAP=y 264CONFIG_ARCH_POPULATES_NODE_MAP=y
261CONFIG_SELECT_MEMORY_MODEL=y 265CONFIG_SELECT_MEMORY_MODEL=y
@@ -273,6 +277,7 @@ CONFIG_BOUNCE=y
273CONFIG_VIRT_TO_BUS=y 277CONFIG_VIRT_TO_BUS=y
274CONFIG_HAVE_MLOCK=y 278CONFIG_HAVE_MLOCK=y
275CONFIG_HAVE_MLOCKED_PAGE_BIT=y 279CONFIG_HAVE_MLOCKED_PAGE_BIT=y
280# CONFIG_KSM is not set
276CONFIG_DEFAULT_MMAP_MIN_ADDR=4096 281CONFIG_DEFAULT_MMAP_MIN_ADDR=4096
277CONFIG_PPC_4K_PAGES=y 282CONFIG_PPC_4K_PAGES=y
278# CONFIG_PPC_16K_PAGES is not set 283# CONFIG_PPC_16K_PAGES is not set
@@ -417,6 +422,7 @@ CONFIG_IPV6_TUNNEL=m
417# CONFIG_NETFILTER is not set 422# CONFIG_NETFILTER is not set
418# CONFIG_IP_DCCP is not set 423# CONFIG_IP_DCCP is not set
419# CONFIG_IP_SCTP is not set 424# CONFIG_IP_SCTP is not set
425# CONFIG_RDS is not set
420# CONFIG_TIPC is not set 426# CONFIG_TIPC is not set
421# CONFIG_ATM is not set 427# CONFIG_ATM is not set
422# CONFIG_BRIDGE is not set 428# CONFIG_BRIDGE is not set
@@ -458,6 +464,7 @@ CONFIG_FIB_RULES=y
458# Generic Driver Options 464# Generic Driver Options
459# 465#
460CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug" 466CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
467# CONFIG_DEVTMPFS is not set
461CONFIG_STANDALONE=y 468CONFIG_STANDALONE=y
462CONFIG_PREVENT_FIRMWARE_BUILD=y 469CONFIG_PREVENT_FIRMWARE_BUILD=y
463CONFIG_FW_LOADER=y 470CONFIG_FW_LOADER=y
@@ -467,9 +474,9 @@ CONFIG_EXTRA_FIRMWARE=""
467# CONFIG_CONNECTOR is not set 474# CONFIG_CONNECTOR is not set
468CONFIG_MTD=y 475CONFIG_MTD=y
469# CONFIG_MTD_DEBUG is not set 476# CONFIG_MTD_DEBUG is not set
477# CONFIG_MTD_TESTS is not set
470CONFIG_MTD_CONCAT=y 478CONFIG_MTD_CONCAT=y
471CONFIG_MTD_PARTITIONS=y 479CONFIG_MTD_PARTITIONS=y
472# CONFIG_MTD_TESTS is not set
473# CONFIG_MTD_REDBOOT_PARTS is not set 480# CONFIG_MTD_REDBOOT_PARTS is not set
474# CONFIG_MTD_CMDLINE_PARTS is not set 481# CONFIG_MTD_CMDLINE_PARTS is not set
475CONFIG_MTD_OF_PARTS=y 482CONFIG_MTD_OF_PARTS=y
@@ -680,6 +687,7 @@ CONFIG_SCSI_WAIT_SCAN=m
680CONFIG_SCSI_LOWLEVEL=y 687CONFIG_SCSI_LOWLEVEL=y
681# CONFIG_ISCSI_TCP is not set 688# CONFIG_ISCSI_TCP is not set
682# CONFIG_SCSI_BNX2_ISCSI is not set 689# CONFIG_SCSI_BNX2_ISCSI is not set
690# CONFIG_BE2ISCSI is not set
683# CONFIG_BLK_DEV_3W_XXXX_RAID is not set 691# CONFIG_BLK_DEV_3W_XXXX_RAID is not set
684# CONFIG_SCSI_3W_9XXX is not set 692# CONFIG_SCSI_3W_9XXX is not set
685# CONFIG_SCSI_ACARD is not set 693# CONFIG_SCSI_ACARD is not set
@@ -719,12 +727,15 @@ CONFIG_SCSI_LOWLEVEL=y
719# CONFIG_SCSI_DC390T is not set 727# CONFIG_SCSI_DC390T is not set
720# CONFIG_SCSI_NSP32 is not set 728# CONFIG_SCSI_NSP32 is not set
721# CONFIG_SCSI_DEBUG is not set 729# CONFIG_SCSI_DEBUG is not set
730# CONFIG_SCSI_PMCRAID is not set
722# CONFIG_SCSI_SRP is not set 731# CONFIG_SCSI_SRP is not set
732# CONFIG_SCSI_BFA_FC is not set
723# CONFIG_SCSI_LOWLEVEL_PCMCIA is not set 733# CONFIG_SCSI_LOWLEVEL_PCMCIA is not set
724# CONFIG_SCSI_DH is not set 734# CONFIG_SCSI_DH is not set
725# CONFIG_SCSI_OSD_INITIATOR is not set 735# CONFIG_SCSI_OSD_INITIATOR is not set
726CONFIG_ATA=y 736CONFIG_ATA=y
727# CONFIG_ATA_NONSTANDARD is not set 737# CONFIG_ATA_NONSTANDARD is not set
738CONFIG_ATA_VERBOSE_ERROR=y
728CONFIG_SATA_PMP=y 739CONFIG_SATA_PMP=y
729# CONFIG_SATA_AHCI is not set 740# CONFIG_SATA_AHCI is not set
730# CONFIG_SATA_SIL24 is not set 741# CONFIG_SATA_SIL24 is not set
@@ -747,6 +758,7 @@ CONFIG_SATA_SIL=y
747# CONFIG_PATA_ALI is not set 758# CONFIG_PATA_ALI is not set
748# CONFIG_PATA_AMD is not set 759# CONFIG_PATA_AMD is not set
749# CONFIG_PATA_ARTOP is not set 760# CONFIG_PATA_ARTOP is not set
761# CONFIG_PATA_ATP867X is not set
750# CONFIG_PATA_ATIIXP is not set 762# CONFIG_PATA_ATIIXP is not set
751# CONFIG_PATA_CMD640_PCI is not set 763# CONFIG_PATA_CMD640_PCI is not set
752# CONFIG_PATA_CMD64X is not set 764# CONFIG_PATA_CMD64X is not set
@@ -775,6 +787,7 @@ CONFIG_SATA_SIL=y
775# CONFIG_PATA_PCMCIA is not set 787# CONFIG_PATA_PCMCIA is not set
776# CONFIG_PATA_PDC_OLD is not set 788# CONFIG_PATA_PDC_OLD is not set
777# CONFIG_PATA_RADISYS is not set 789# CONFIG_PATA_RADISYS is not set
790# CONFIG_PATA_RDC is not set
778# CONFIG_PATA_RZ1000 is not set 791# CONFIG_PATA_RZ1000 is not set
779# CONFIG_PATA_SC1200 is not set 792# CONFIG_PATA_SC1200 is not set
780# CONFIG_PATA_SERVERWORKS is not set 793# CONFIG_PATA_SERVERWORKS is not set
@@ -851,7 +864,9 @@ CONFIG_MII=y
851# CONFIG_NET_PCI is not set 864# CONFIG_NET_PCI is not set
852# CONFIG_B44 is not set 865# CONFIG_B44 is not set
853# CONFIG_KS8842 is not set 866# CONFIG_KS8842 is not set
867# CONFIG_KS8851_MLL is not set
854# CONFIG_ATL2 is not set 868# CONFIG_ATL2 is not set
869# CONFIG_XILINX_EMACLITE is not set
855CONFIG_NETDEV_1000=y 870CONFIG_NETDEV_1000=y
856# CONFIG_ACENIC is not set 871# CONFIG_ACENIC is not set
857# CONFIG_DL2K is not set 872# CONFIG_DL2K is not set
@@ -881,10 +896,7 @@ CONFIG_GIANFAR=y
881# CONFIG_JME is not set 896# CONFIG_JME is not set
882# CONFIG_NETDEV_10000 is not set 897# CONFIG_NETDEV_10000 is not set
883# CONFIG_TR is not set 898# CONFIG_TR is not set
884 899CONFIG_WLAN=y
885#
886# Wireless LAN
887#
888# CONFIG_WLAN_PRE80211 is not set 900# CONFIG_WLAN_PRE80211 is not set
889# CONFIG_WLAN_80211 is not set 901# CONFIG_WLAN_80211 is not set
890 902
@@ -1016,6 +1028,7 @@ CONFIG_NVRAM=y
1016CONFIG_DEVPORT=y 1028CONFIG_DEVPORT=y
1017CONFIG_I2C=y 1029CONFIG_I2C=y
1018CONFIG_I2C_BOARDINFO=y 1030CONFIG_I2C_BOARDINFO=y
1031CONFIG_I2C_COMPAT=y
1019CONFIG_I2C_CHARDEV=y 1032CONFIG_I2C_CHARDEV=y
1020CONFIG_I2C_HELPER_AUTO=y 1033CONFIG_I2C_HELPER_AUTO=y
1021 1034
@@ -1071,9 +1084,6 @@ CONFIG_I2C_MPC=y
1071# Miscellaneous I2C Chip support 1084# Miscellaneous I2C Chip support
1072# 1085#
1073CONFIG_DS1682=y 1086CONFIG_DS1682=y
1074# CONFIG_SENSORS_PCF8574 is not set
1075# CONFIG_PCF8575 is not set
1076# CONFIG_SENSORS_PCA9539 is not set
1077# CONFIG_SENSORS_TSL2550 is not set 1087# CONFIG_SENSORS_TSL2550 is not set
1078# CONFIG_I2C_DEBUG_CORE is not set 1088# CONFIG_I2C_DEBUG_CORE is not set
1079# CONFIG_I2C_DEBUG_ALGO is not set 1089# CONFIG_I2C_DEBUG_ALGO is not set
@@ -1106,14 +1116,24 @@ CONFIG_GPIO_SYSFS=y
1106# PCI GPIO expanders: 1116# PCI GPIO expanders:
1107# 1117#
1108# CONFIG_GPIO_BT8XX is not set 1118# CONFIG_GPIO_BT8XX is not set
1119# CONFIG_GPIO_LANGWELL is not set
1109 1120
1110# 1121#
1111# SPI GPIO expanders: 1122# SPI GPIO expanders:
1112# 1123#
1124
1125#
1126# AC97 GPIO expanders:
1127#
1113# CONFIG_W1 is not set 1128# CONFIG_W1 is not set
1114# CONFIG_POWER_SUPPLY is not set 1129# CONFIG_POWER_SUPPLY is not set
1115CONFIG_HWMON=y 1130CONFIG_HWMON=y
1116# CONFIG_HWMON_VID is not set 1131# CONFIG_HWMON_VID is not set
1132# CONFIG_HWMON_DEBUG_CHIP is not set
1133
1134#
1135# Native drivers
1136#
1117# CONFIG_SENSORS_AD7414 is not set 1137# CONFIG_SENSORS_AD7414 is not set
1118# CONFIG_SENSORS_AD7418 is not set 1138# CONFIG_SENSORS_AD7418 is not set
1119# CONFIG_SENSORS_ADM1021 is not set 1139# CONFIG_SENSORS_ADM1021 is not set
@@ -1164,6 +1184,7 @@ CONFIG_SENSORS_LM92=y
1164# CONFIG_SENSORS_ADS7828 is not set 1184# CONFIG_SENSORS_ADS7828 is not set
1165# CONFIG_SENSORS_THMC50 is not set 1185# CONFIG_SENSORS_THMC50 is not set
1166# CONFIG_SENSORS_TMP401 is not set 1186# CONFIG_SENSORS_TMP401 is not set
1187# CONFIG_SENSORS_TMP421 is not set
1167# CONFIG_SENSORS_VIA686A is not set 1188# CONFIG_SENSORS_VIA686A is not set
1168# CONFIG_SENSORS_VT1211 is not set 1189# CONFIG_SENSORS_VT1211 is not set
1169# CONFIG_SENSORS_VT8231 is not set 1190# CONFIG_SENSORS_VT8231 is not set
@@ -1175,9 +1196,7 @@ CONFIG_SENSORS_LM92=y
1175# CONFIG_SENSORS_W83L786NG is not set 1196# CONFIG_SENSORS_W83L786NG is not set
1176# CONFIG_SENSORS_W83627HF is not set 1197# CONFIG_SENSORS_W83627HF is not set
1177# CONFIG_SENSORS_W83627EHF is not set 1198# CONFIG_SENSORS_W83627EHF is not set
1178# CONFIG_HWMON_DEBUG_CHIP is not set
1179# CONFIG_THERMAL is not set 1199# CONFIG_THERMAL is not set
1180# CONFIG_THERMAL_HWMON is not set
1181CONFIG_WATCHDOG=y 1200CONFIG_WATCHDOG=y
1182# CONFIG_WATCHDOG_NOWAYOUT is not set 1201# CONFIG_WATCHDOG_NOWAYOUT is not set
1183 1202
@@ -1217,6 +1236,7 @@ CONFIG_SSB_POSSIBLE=y
1217# CONFIG_MFD_TMIO is not set 1236# CONFIG_MFD_TMIO is not set
1218# CONFIG_PMIC_DA903X is not set 1237# CONFIG_PMIC_DA903X is not set
1219# CONFIG_MFD_WM8400 is not set 1238# CONFIG_MFD_WM8400 is not set
1239# CONFIG_MFD_WM831X is not set
1220# CONFIG_MFD_WM8350_I2C is not set 1240# CONFIG_MFD_WM8350_I2C is not set
1221# CONFIG_MFD_PCF50633 is not set 1241# CONFIG_MFD_PCF50633 is not set
1222# CONFIG_AB3100_CORE is not set 1242# CONFIG_AB3100_CORE is not set
@@ -1227,6 +1247,7 @@ CONFIG_SSB_POSSIBLE=y
1227# Graphics support 1247# Graphics support
1228# 1248#
1229# CONFIG_AGP is not set 1249# CONFIG_AGP is not set
1250CONFIG_VGA_ARB=y
1230# CONFIG_DRM is not set 1251# CONFIG_DRM is not set
1231# CONFIG_VGASTATE is not set 1252# CONFIG_VGASTATE is not set
1232CONFIG_VIDEO_OUTPUT_CONTROL=m 1253CONFIG_VIDEO_OUTPUT_CONTROL=m
@@ -1247,7 +1268,6 @@ CONFIG_DUMMY_CONSOLE=y
1247# CONFIG_SOUND is not set 1268# CONFIG_SOUND is not set
1248CONFIG_HID_SUPPORT=y 1269CONFIG_HID_SUPPORT=y
1249CONFIG_HID=y 1270CONFIG_HID=y
1250# CONFIG_HID_DEBUG is not set
1251# CONFIG_HIDRAW is not set 1271# CONFIG_HIDRAW is not set
1252 1272
1253# 1273#
@@ -1270,6 +1290,7 @@ CONFIG_HID_CYPRESS=y
1270CONFIG_HID_EZKEY=y 1290CONFIG_HID_EZKEY=y
1271# CONFIG_HID_KYE is not set 1291# CONFIG_HID_KYE is not set
1272CONFIG_HID_GYRATION=y 1292CONFIG_HID_GYRATION=y
1293# CONFIG_HID_TWINHAN is not set
1273# CONFIG_HID_KENSINGTON is not set 1294# CONFIG_HID_KENSINGTON is not set
1274CONFIG_HID_LOGITECH=y 1295CONFIG_HID_LOGITECH=y
1275# CONFIG_LOGITECH_FF is not set 1296# CONFIG_LOGITECH_FF is not set
@@ -1322,6 +1343,7 @@ CONFIG_USB_EHCI_HCD=y
1322# CONFIG_USB_OXU210HP_HCD is not set 1343# CONFIG_USB_OXU210HP_HCD is not set
1323# CONFIG_USB_ISP116X_HCD is not set 1344# CONFIG_USB_ISP116X_HCD is not set
1324# CONFIG_USB_ISP1760_HCD is not set 1345# CONFIG_USB_ISP1760_HCD is not set
1346# CONFIG_USB_ISP1362_HCD is not set
1325CONFIG_USB_OHCI_HCD=y 1347CONFIG_USB_OHCI_HCD=y
1326# CONFIG_USB_OHCI_HCD_PPC_OF_BE is not set 1348# CONFIG_USB_OHCI_HCD_PPC_OF_BE is not set
1327# CONFIG_USB_OHCI_HCD_PPC_OF_LE is not set 1349# CONFIG_USB_OHCI_HCD_PPC_OF_LE is not set
@@ -1397,6 +1419,7 @@ CONFIG_USB_STORAGE=y
1397# CONFIG_USB_LD is not set 1419# CONFIG_USB_LD is not set
1398# CONFIG_USB_TRANCEVIBRATOR is not set 1420# CONFIG_USB_TRANCEVIBRATOR is not set
1399# CONFIG_USB_IOWARRIOR is not set 1421# CONFIG_USB_IOWARRIOR is not set
1422# CONFIG_USB_TEST is not set
1400# CONFIG_USB_ISIGHTFW is not set 1423# CONFIG_USB_ISIGHTFW is not set
1401# CONFIG_USB_VST is not set 1424# CONFIG_USB_VST is not set
1402# CONFIG_USB_GADGET is not set 1425# CONFIG_USB_GADGET is not set
@@ -1501,6 +1524,7 @@ CONFIG_FS_POSIX_ACL=y
1501# CONFIG_GFS2_FS is not set 1524# CONFIG_GFS2_FS is not set
1502# CONFIG_OCFS2_FS is not set 1525# CONFIG_OCFS2_FS is not set
1503# CONFIG_BTRFS_FS is not set 1526# CONFIG_BTRFS_FS is not set
1527# CONFIG_NILFS2_FS is not set
1504CONFIG_FILE_LOCKING=y 1528CONFIG_FILE_LOCKING=y
1505CONFIG_FSNOTIFY=y 1529CONFIG_FSNOTIFY=y
1506CONFIG_DNOTIFY=y 1530CONFIG_DNOTIFY=y
@@ -1576,7 +1600,6 @@ CONFIG_JFFS2_RTIME=y
1576# CONFIG_ROMFS_FS is not set 1600# CONFIG_ROMFS_FS is not set
1577# CONFIG_SYSV_FS is not set 1601# CONFIG_SYSV_FS is not set
1578# CONFIG_UFS_FS is not set 1602# CONFIG_UFS_FS is not set
1579# CONFIG_NILFS2_FS is not set
1580CONFIG_NETWORK_FILESYSTEMS=y 1603CONFIG_NETWORK_FILESYSTEMS=y
1581CONFIG_NFS_FS=y 1604CONFIG_NFS_FS=y
1582CONFIG_NFS_V3=y 1605CONFIG_NFS_V3=y
@@ -1682,6 +1705,7 @@ CONFIG_ENABLE_WARN_DEPRECATED=y
1682CONFIG_ENABLE_MUST_CHECK=y 1705CONFIG_ENABLE_MUST_CHECK=y
1683CONFIG_FRAME_WARN=1024 1706CONFIG_FRAME_WARN=1024
1684CONFIG_MAGIC_SYSRQ=y 1707CONFIG_MAGIC_SYSRQ=y
1708# CONFIG_STRIP_ASM_SYMS is not set
1685# CONFIG_UNUSED_SYMBOLS is not set 1709# CONFIG_UNUSED_SYMBOLS is not set
1686# CONFIG_DEBUG_FS is not set 1710# CONFIG_DEBUG_FS is not set
1687# CONFIG_HEADERS_CHECK is not set 1711# CONFIG_HEADERS_CHECK is not set
@@ -1697,6 +1721,7 @@ CONFIG_HAVE_DYNAMIC_FTRACE=y
1697CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y 1721CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y
1698CONFIG_TRACING_SUPPORT=y 1722CONFIG_TRACING_SUPPORT=y
1699# CONFIG_FTRACE is not set 1723# CONFIG_FTRACE is not set
1724# CONFIG_DMA_API_DEBUG is not set
1700# CONFIG_SAMPLES is not set 1725# CONFIG_SAMPLES is not set
1701CONFIG_HAVE_ARCH_KGDB=y 1726CONFIG_HAVE_ARCH_KGDB=y
1702# CONFIG_PPC_DISABLE_WERROR is not set 1727# CONFIG_PPC_DISABLE_WERROR is not set
@@ -1718,7 +1743,6 @@ CONFIG_CRYPTO=y
1718# 1743#
1719# Crypto core or helper 1744# Crypto core or helper
1720# 1745#
1721# CONFIG_CRYPTO_FIPS is not set
1722CONFIG_CRYPTO_ALGAPI=y 1746CONFIG_CRYPTO_ALGAPI=y
1723CONFIG_CRYPTO_ALGAPI2=y 1747CONFIG_CRYPTO_ALGAPI2=y
1724CONFIG_CRYPTO_AEAD=m 1748CONFIG_CRYPTO_AEAD=m
@@ -1761,11 +1785,13 @@ CONFIG_CRYPTO_CBC=y
1761# 1785#
1762CONFIG_CRYPTO_HMAC=m 1786CONFIG_CRYPTO_HMAC=m
1763# CONFIG_CRYPTO_XCBC is not set 1787# CONFIG_CRYPTO_XCBC is not set
1788# CONFIG_CRYPTO_VMAC is not set
1764 1789
1765# 1790#
1766# Digest 1791# Digest
1767# 1792#
1768CONFIG_CRYPTO_CRC32C=y 1793CONFIG_CRYPTO_CRC32C=y
1794# CONFIG_CRYPTO_GHASH is not set
1769# CONFIG_CRYPTO_MD4 is not set 1795# CONFIG_CRYPTO_MD4 is not set
1770CONFIG_CRYPTO_MD5=y 1796CONFIG_CRYPTO_MD5=y
1771# CONFIG_CRYPTO_MICHAEL_MIC is not set 1797# CONFIG_CRYPTO_MICHAEL_MIC is not set
diff --git a/arch/powerpc/configs/86xx/gef_sbc310_defconfig b/arch/powerpc/configs/86xx/gef_sbc310_defconfig
index cd338d493bed..e199d1cacbaf 100644
--- a/arch/powerpc/configs/86xx/gef_sbc310_defconfig
+++ b/arch/powerpc/configs/86xx/gef_sbc310_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.31-rc4 3# Linux kernel version: 2.6.32-rc5
4# Wed Jul 29 23:32:29 2009 4# Thu Nov 5 08:20:47 2009
5# 5#
6# CONFIG_PPC64 is not set 6# CONFIG_PPC64 is not set
7 7
@@ -36,6 +36,7 @@ CONFIG_GENERIC_CLOCKEVENTS=y
36CONFIG_GENERIC_HARDIRQS=y 36CONFIG_GENERIC_HARDIRQS=y
37CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y 37CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y
38# CONFIG_HAVE_SETUP_PER_CPU_AREA is not set 38# CONFIG_HAVE_SETUP_PER_CPU_AREA is not set
39# CONFIG_NEED_PER_CPU_EMBED_FIRST_CHUNK 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
@@ -88,11 +89,12 @@ CONFIG_BSD_PROCESS_ACCT_V3=y
88# 89#
89# RCU Subsystem 90# RCU Subsystem
90# 91#
91CONFIG_CLASSIC_RCU=y 92CONFIG_TREE_RCU=y
92# CONFIG_TREE_RCU is not set 93# CONFIG_TREE_PREEMPT_RCU is not set
93# CONFIG_PREEMPT_RCU is not set 94# CONFIG_RCU_TRACE is not set
95CONFIG_RCU_FANOUT=32
96# CONFIG_RCU_FANOUT_EXACT is not set
94# CONFIG_TREE_RCU_TRACE is not set 97# CONFIG_TREE_RCU_TRACE is not set
95# CONFIG_PREEMPT_RCU_TRACE is not set
96CONFIG_IKCONFIG=y 98CONFIG_IKCONFIG=y
97CONFIG_IKCONFIG_PROC=y 99CONFIG_IKCONFIG_PROC=y
98CONFIG_LOG_BUF_SHIFT=14 100CONFIG_LOG_BUF_SHIFT=14
@@ -130,21 +132,20 @@ CONFIG_TIMERFD=y
130CONFIG_EVENTFD=y 132CONFIG_EVENTFD=y
131CONFIG_SHMEM=y 133CONFIG_SHMEM=y
132CONFIG_AIO=y 134CONFIG_AIO=y
133CONFIG_HAVE_PERF_COUNTERS=y 135CONFIG_HAVE_PERF_EVENTS=y
134 136
135# 137#
136# Performance Counters 138# Kernel Performance Events And Counters
137# 139#
140# CONFIG_PERF_EVENTS is not set
138# CONFIG_PERF_COUNTERS is not set 141# CONFIG_PERF_COUNTERS is not set
139CONFIG_VM_EVENT_COUNTERS=y 142CONFIG_VM_EVENT_COUNTERS=y
140CONFIG_PCI_QUIRKS=y 143CONFIG_PCI_QUIRKS=y
141# CONFIG_STRIP_ASM_SYMS is not set
142CONFIG_COMPAT_BRK=y 144CONFIG_COMPAT_BRK=y
143CONFIG_SLAB=y 145CONFIG_SLAB=y
144# CONFIG_SLUB is not set 146# CONFIG_SLUB is not set
145# CONFIG_SLOB is not set 147# CONFIG_SLOB is not set
146# CONFIG_PROFILING is not set 148# CONFIG_PROFILING is not set
147# CONFIG_MARKERS is not set
148CONFIG_HAVE_OPROFILE=y 149CONFIG_HAVE_OPROFILE=y
149# CONFIG_KPROBES is not set 150# CONFIG_KPROBES is not set
150CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS=y 151CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS=y
@@ -152,12 +153,14 @@ CONFIG_HAVE_IOREMAP_PROT=y
152CONFIG_HAVE_KPROBES=y 153CONFIG_HAVE_KPROBES=y
153CONFIG_HAVE_KRETPROBES=y 154CONFIG_HAVE_KRETPROBES=y
154CONFIG_HAVE_ARCH_TRACEHOOK=y 155CONFIG_HAVE_ARCH_TRACEHOOK=y
156CONFIG_HAVE_DMA_ATTRS=y
155CONFIG_USE_GENERIC_SMP_HELPERS=y 157CONFIG_USE_GENERIC_SMP_HELPERS=y
158CONFIG_HAVE_DMA_API_DEBUG=y
156 159
157# 160#
158# GCOV-based kernel profiling 161# GCOV-based kernel profiling
159# 162#
160# CONFIG_SLOW_WORK is not set 163CONFIG_SLOW_WORK=y
161# CONFIG_HAVE_GENERIC_DMA_COHERENT is not set 164# CONFIG_HAVE_GENERIC_DMA_COHERENT is not set
162CONFIG_SLABINFO=y 165CONFIG_SLABINFO=y
163CONFIG_RT_MUTEXES=y 166CONFIG_RT_MUTEXES=y
@@ -256,6 +259,7 @@ CONFIG_ARCH_ENABLE_MEMORY_HOTREMOVE=y
256# CONFIG_KEXEC is not set 259# CONFIG_KEXEC is not set
257# CONFIG_CRASH_DUMP is not set 260# CONFIG_CRASH_DUMP is not set
258CONFIG_IRQ_ALL_CPUS=y 261CONFIG_IRQ_ALL_CPUS=y
262CONFIG_MAX_ACTIVE_REGIONS=32
259CONFIG_ARCH_FLATMEM_ENABLE=y 263CONFIG_ARCH_FLATMEM_ENABLE=y
260CONFIG_ARCH_POPULATES_NODE_MAP=y 264CONFIG_ARCH_POPULATES_NODE_MAP=y
261CONFIG_SELECT_MEMORY_MODEL=y 265CONFIG_SELECT_MEMORY_MODEL=y
@@ -273,6 +277,7 @@ CONFIG_BOUNCE=y
273CONFIG_VIRT_TO_BUS=y 277CONFIG_VIRT_TO_BUS=y
274CONFIG_HAVE_MLOCK=y 278CONFIG_HAVE_MLOCK=y
275CONFIG_HAVE_MLOCKED_PAGE_BIT=y 279CONFIG_HAVE_MLOCKED_PAGE_BIT=y
280# CONFIG_KSM is not set
276CONFIG_DEFAULT_MMAP_MIN_ADDR=4096 281CONFIG_DEFAULT_MMAP_MIN_ADDR=4096
277CONFIG_PPC_4K_PAGES=y 282CONFIG_PPC_4K_PAGES=y
278# CONFIG_PPC_16K_PAGES is not set 283# CONFIG_PPC_16K_PAGES is not set
@@ -417,6 +422,7 @@ CONFIG_IPV6_TUNNEL=m
417# CONFIG_NETFILTER is not set 422# CONFIG_NETFILTER is not set
418# CONFIG_IP_DCCP is not set 423# CONFIG_IP_DCCP is not set
419# CONFIG_IP_SCTP is not set 424# CONFIG_IP_SCTP is not set
425# CONFIG_RDS is not set
420# CONFIG_TIPC is not set 426# CONFIG_TIPC is not set
421# CONFIG_ATM is not set 427# CONFIG_ATM is not set
422# CONFIG_BRIDGE is not set 428# CONFIG_BRIDGE is not set
@@ -458,6 +464,7 @@ CONFIG_FIB_RULES=y
458# Generic Driver Options 464# Generic Driver Options
459# 465#
460CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug" 466CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
467# CONFIG_DEVTMPFS is not set
461CONFIG_STANDALONE=y 468CONFIG_STANDALONE=y
462CONFIG_PREVENT_FIRMWARE_BUILD=y 469CONFIG_PREVENT_FIRMWARE_BUILD=y
463CONFIG_FW_LOADER=y 470CONFIG_FW_LOADER=y
@@ -467,9 +474,9 @@ CONFIG_EXTRA_FIRMWARE=""
467# CONFIG_CONNECTOR is not set 474# CONFIG_CONNECTOR is not set
468CONFIG_MTD=y 475CONFIG_MTD=y
469# CONFIG_MTD_DEBUG is not set 476# CONFIG_MTD_DEBUG is not set
477# CONFIG_MTD_TESTS is not set
470CONFIG_MTD_CONCAT=y 478CONFIG_MTD_CONCAT=y
471CONFIG_MTD_PARTITIONS=y 479CONFIG_MTD_PARTITIONS=y
472# CONFIG_MTD_TESTS is not set
473# CONFIG_MTD_REDBOOT_PARTS is not set 480# CONFIG_MTD_REDBOOT_PARTS is not set
474# CONFIG_MTD_CMDLINE_PARTS is not set 481# CONFIG_MTD_CMDLINE_PARTS is not set
475CONFIG_MTD_OF_PARTS=y 482CONFIG_MTD_OF_PARTS=y
@@ -680,6 +687,7 @@ CONFIG_SCSI_WAIT_SCAN=m
680CONFIG_SCSI_LOWLEVEL=y 687CONFIG_SCSI_LOWLEVEL=y
681# CONFIG_ISCSI_TCP is not set 688# CONFIG_ISCSI_TCP is not set
682# CONFIG_SCSI_BNX2_ISCSI is not set 689# CONFIG_SCSI_BNX2_ISCSI is not set
690# CONFIG_BE2ISCSI is not set
683# CONFIG_BLK_DEV_3W_XXXX_RAID is not set 691# CONFIG_BLK_DEV_3W_XXXX_RAID is not set
684# CONFIG_SCSI_3W_9XXX is not set 692# CONFIG_SCSI_3W_9XXX is not set
685# CONFIG_SCSI_ACARD is not set 693# CONFIG_SCSI_ACARD is not set
@@ -719,12 +727,15 @@ CONFIG_SCSI_LOWLEVEL=y
719# CONFIG_SCSI_DC390T is not set 727# CONFIG_SCSI_DC390T is not set
720# CONFIG_SCSI_NSP32 is not set 728# CONFIG_SCSI_NSP32 is not set
721# CONFIG_SCSI_DEBUG is not set 729# CONFIG_SCSI_DEBUG is not set
730# CONFIG_SCSI_PMCRAID is not set
722# CONFIG_SCSI_SRP is not set 731# CONFIG_SCSI_SRP is not set
732# CONFIG_SCSI_BFA_FC is not set
723# CONFIG_SCSI_LOWLEVEL_PCMCIA is not set 733# CONFIG_SCSI_LOWLEVEL_PCMCIA is not set
724# CONFIG_SCSI_DH is not set 734# CONFIG_SCSI_DH is not set
725# CONFIG_SCSI_OSD_INITIATOR is not set 735# CONFIG_SCSI_OSD_INITIATOR is not set
726CONFIG_ATA=y 736CONFIG_ATA=y
727# CONFIG_ATA_NONSTANDARD is not set 737# CONFIG_ATA_NONSTANDARD is not set
738CONFIG_ATA_VERBOSE_ERROR=y
728CONFIG_SATA_PMP=y 739CONFIG_SATA_PMP=y
729# CONFIG_SATA_AHCI is not set 740# CONFIG_SATA_AHCI is not set
730CONFIG_SATA_SIL24=y 741CONFIG_SATA_SIL24=y
@@ -796,7 +807,9 @@ CONFIG_MII=y
796# CONFIG_NET_PCI is not set 807# CONFIG_NET_PCI is not set
797# CONFIG_B44 is not set 808# CONFIG_B44 is not set
798# CONFIG_KS8842 is not set 809# CONFIG_KS8842 is not set
810# CONFIG_KS8851_MLL is not set
799# CONFIG_ATL2 is not set 811# CONFIG_ATL2 is not set
812# CONFIG_XILINX_EMACLITE is not set
800CONFIG_NETDEV_1000=y 813CONFIG_NETDEV_1000=y
801# CONFIG_ACENIC is not set 814# CONFIG_ACENIC is not set
802# CONFIG_DL2K is not set 815# CONFIG_DL2K is not set
@@ -826,10 +839,7 @@ CONFIG_GIANFAR=y
826# CONFIG_JME is not set 839# CONFIG_JME is not set
827# CONFIG_NETDEV_10000 is not set 840# CONFIG_NETDEV_10000 is not set
828# CONFIG_TR is not set 841# CONFIG_TR is not set
829 842CONFIG_WLAN=y
830#
831# Wireless LAN
832#
833# CONFIG_WLAN_PRE80211 is not set 843# CONFIG_WLAN_PRE80211 is not set
834# CONFIG_WLAN_80211 is not set 844# CONFIG_WLAN_80211 is not set
835 845
@@ -961,6 +971,7 @@ CONFIG_NVRAM=y
961CONFIG_DEVPORT=y 971CONFIG_DEVPORT=y
962CONFIG_I2C=y 972CONFIG_I2C=y
963CONFIG_I2C_BOARDINFO=y 973CONFIG_I2C_BOARDINFO=y
974CONFIG_I2C_COMPAT=y
964CONFIG_I2C_CHARDEV=y 975CONFIG_I2C_CHARDEV=y
965CONFIG_I2C_HELPER_AUTO=y 976CONFIG_I2C_HELPER_AUTO=y
966 977
@@ -1016,9 +1027,6 @@ CONFIG_I2C_MPC=y
1016# Miscellaneous I2C Chip support 1027# Miscellaneous I2C Chip support
1017# 1028#
1018CONFIG_DS1682=y 1029CONFIG_DS1682=y
1019# CONFIG_SENSORS_PCF8574 is not set
1020# CONFIG_PCF8575 is not set
1021# CONFIG_SENSORS_PCA9539 is not set
1022# CONFIG_SENSORS_TSL2550 is not set 1030# CONFIG_SENSORS_TSL2550 is not set
1023# CONFIG_I2C_DEBUG_CORE is not set 1031# CONFIG_I2C_DEBUG_CORE is not set
1024# CONFIG_I2C_DEBUG_ALGO is not set 1032# CONFIG_I2C_DEBUG_ALGO is not set
@@ -1051,14 +1059,24 @@ CONFIG_GPIO_SYSFS=y
1051# PCI GPIO expanders: 1059# PCI GPIO expanders:
1052# 1060#
1053# CONFIG_GPIO_BT8XX is not set 1061# CONFIG_GPIO_BT8XX is not set
1062# CONFIG_GPIO_LANGWELL is not set
1054 1063
1055# 1064#
1056# SPI GPIO expanders: 1065# SPI GPIO expanders:
1057# 1066#
1067
1068#
1069# AC97 GPIO expanders:
1070#
1058# CONFIG_W1 is not set 1071# CONFIG_W1 is not set
1059# CONFIG_POWER_SUPPLY is not set 1072# CONFIG_POWER_SUPPLY is not set
1060CONFIG_HWMON=y 1073CONFIG_HWMON=y
1061# CONFIG_HWMON_VID is not set 1074# CONFIG_HWMON_VID is not set
1075# CONFIG_HWMON_DEBUG_CHIP is not set
1076
1077#
1078# Native drivers
1079#
1062# CONFIG_SENSORS_AD7414 is not set 1080# CONFIG_SENSORS_AD7414 is not set
1063# CONFIG_SENSORS_AD7418 is not set 1081# CONFIG_SENSORS_AD7418 is not set
1064# CONFIG_SENSORS_ADM1021 is not set 1082# CONFIG_SENSORS_ADM1021 is not set
@@ -1109,6 +1127,7 @@ CONFIG_SENSORS_LM92=y
1109# CONFIG_SENSORS_ADS7828 is not set 1127# CONFIG_SENSORS_ADS7828 is not set
1110# CONFIG_SENSORS_THMC50 is not set 1128# CONFIG_SENSORS_THMC50 is not set
1111# CONFIG_SENSORS_TMP401 is not set 1129# CONFIG_SENSORS_TMP401 is not set
1130# CONFIG_SENSORS_TMP421 is not set
1112# CONFIG_SENSORS_VIA686A is not set 1131# CONFIG_SENSORS_VIA686A is not set
1113# CONFIG_SENSORS_VT1211 is not set 1132# CONFIG_SENSORS_VT1211 is not set
1114# CONFIG_SENSORS_VT8231 is not set 1133# CONFIG_SENSORS_VT8231 is not set
@@ -1120,9 +1139,7 @@ CONFIG_SENSORS_LM92=y
1120# CONFIG_SENSORS_W83L786NG is not set 1139# CONFIG_SENSORS_W83L786NG is not set
1121# CONFIG_SENSORS_W83627HF is not set 1140# CONFIG_SENSORS_W83627HF is not set
1122# CONFIG_SENSORS_W83627EHF is not set 1141# CONFIG_SENSORS_W83627EHF is not set
1123# CONFIG_HWMON_DEBUG_CHIP is not set
1124# CONFIG_THERMAL is not set 1142# CONFIG_THERMAL is not set
1125# CONFIG_THERMAL_HWMON is not set
1126CONFIG_WATCHDOG=y 1143CONFIG_WATCHDOG=y
1127# CONFIG_WATCHDOG_NOWAYOUT is not set 1144# CONFIG_WATCHDOG_NOWAYOUT is not set
1128 1145
@@ -1162,6 +1179,7 @@ CONFIG_SSB_POSSIBLE=y
1162# CONFIG_MFD_TMIO is not set 1179# CONFIG_MFD_TMIO is not set
1163# CONFIG_PMIC_DA903X is not set 1180# CONFIG_PMIC_DA903X is not set
1164# CONFIG_MFD_WM8400 is not set 1181# CONFIG_MFD_WM8400 is not set
1182# CONFIG_MFD_WM831X is not set
1165# CONFIG_MFD_WM8350_I2C is not set 1183# CONFIG_MFD_WM8350_I2C is not set
1166# CONFIG_MFD_PCF50633 is not set 1184# CONFIG_MFD_PCF50633 is not set
1167# CONFIG_AB3100_CORE is not set 1185# CONFIG_AB3100_CORE is not set
@@ -1172,6 +1190,7 @@ CONFIG_SSB_POSSIBLE=y
1172# Graphics support 1190# Graphics support
1173# 1191#
1174# CONFIG_AGP is not set 1192# CONFIG_AGP is not set
1193CONFIG_VGA_ARB=y
1175# CONFIG_DRM is not set 1194# CONFIG_DRM is not set
1176# CONFIG_VGASTATE is not set 1195# CONFIG_VGASTATE is not set
1177CONFIG_VIDEO_OUTPUT_CONTROL=m 1196CONFIG_VIDEO_OUTPUT_CONTROL=m
@@ -1192,7 +1211,6 @@ CONFIG_DUMMY_CONSOLE=y
1192# CONFIG_SOUND is not set 1211# CONFIG_SOUND is not set
1193CONFIG_HID_SUPPORT=y 1212CONFIG_HID_SUPPORT=y
1194CONFIG_HID=y 1213CONFIG_HID=y
1195# CONFIG_HID_DEBUG is not set
1196# CONFIG_HIDRAW is not set 1214# CONFIG_HIDRAW is not set
1197 1215
1198# 1216#
@@ -1215,6 +1233,7 @@ CONFIG_HID_CYPRESS=y
1215CONFIG_HID_EZKEY=y 1233CONFIG_HID_EZKEY=y
1216# CONFIG_HID_KYE is not set 1234# CONFIG_HID_KYE is not set
1217CONFIG_HID_GYRATION=y 1235CONFIG_HID_GYRATION=y
1236# CONFIG_HID_TWINHAN is not set
1218# CONFIG_HID_KENSINGTON is not set 1237# CONFIG_HID_KENSINGTON is not set
1219CONFIG_HID_LOGITECH=y 1238CONFIG_HID_LOGITECH=y
1220# CONFIG_LOGITECH_FF is not set 1239# CONFIG_LOGITECH_FF is not set
@@ -1267,6 +1286,7 @@ CONFIG_USB_EHCI_HCD=y
1267# CONFIG_USB_OXU210HP_HCD is not set 1286# CONFIG_USB_OXU210HP_HCD is not set
1268# CONFIG_USB_ISP116X_HCD is not set 1287# CONFIG_USB_ISP116X_HCD is not set
1269# CONFIG_USB_ISP1760_HCD is not set 1288# CONFIG_USB_ISP1760_HCD is not set
1289# CONFIG_USB_ISP1362_HCD is not set
1270CONFIG_USB_OHCI_HCD=y 1290CONFIG_USB_OHCI_HCD=y
1271# CONFIG_USB_OHCI_HCD_PPC_OF_BE is not set 1291# CONFIG_USB_OHCI_HCD_PPC_OF_BE is not set
1272# CONFIG_USB_OHCI_HCD_PPC_OF_LE is not set 1292# CONFIG_USB_OHCI_HCD_PPC_OF_LE is not set
@@ -1342,6 +1362,7 @@ CONFIG_USB_STORAGE=y
1342# CONFIG_USB_LD is not set 1362# CONFIG_USB_LD is not set
1343# CONFIG_USB_TRANCEVIBRATOR is not set 1363# CONFIG_USB_TRANCEVIBRATOR is not set
1344# CONFIG_USB_IOWARRIOR is not set 1364# CONFIG_USB_IOWARRIOR is not set
1365# CONFIG_USB_TEST is not set
1345# CONFIG_USB_ISIGHTFW is not set 1366# CONFIG_USB_ISIGHTFW is not set
1346# CONFIG_USB_VST is not set 1367# CONFIG_USB_VST is not set
1347# CONFIG_USB_GADGET is not set 1368# CONFIG_USB_GADGET is not set
@@ -1446,6 +1467,7 @@ CONFIG_FS_POSIX_ACL=y
1446# CONFIG_GFS2_FS is not set 1467# CONFIG_GFS2_FS is not set
1447# CONFIG_OCFS2_FS is not set 1468# CONFIG_OCFS2_FS is not set
1448# CONFIG_BTRFS_FS is not set 1469# CONFIG_BTRFS_FS is not set
1470# CONFIG_NILFS2_FS is not set
1449CONFIG_FILE_LOCKING=y 1471CONFIG_FILE_LOCKING=y
1450CONFIG_FSNOTIFY=y 1472CONFIG_FSNOTIFY=y
1451CONFIG_DNOTIFY=y 1473CONFIG_DNOTIFY=y
@@ -1521,7 +1543,6 @@ CONFIG_JFFS2_RTIME=y
1521# CONFIG_ROMFS_FS is not set 1543# CONFIG_ROMFS_FS is not set
1522# CONFIG_SYSV_FS is not set 1544# CONFIG_SYSV_FS is not set
1523# CONFIG_UFS_FS is not set 1545# CONFIG_UFS_FS is not set
1524# CONFIG_NILFS2_FS is not set
1525CONFIG_NETWORK_FILESYSTEMS=y 1546CONFIG_NETWORK_FILESYSTEMS=y
1526CONFIG_NFS_FS=y 1547CONFIG_NFS_FS=y
1527CONFIG_NFS_V3=y 1548CONFIG_NFS_V3=y
@@ -1627,6 +1648,7 @@ CONFIG_ENABLE_WARN_DEPRECATED=y
1627CONFIG_ENABLE_MUST_CHECK=y 1648CONFIG_ENABLE_MUST_CHECK=y
1628CONFIG_FRAME_WARN=1024 1649CONFIG_FRAME_WARN=1024
1629CONFIG_MAGIC_SYSRQ=y 1650CONFIG_MAGIC_SYSRQ=y
1651# CONFIG_STRIP_ASM_SYMS is not set
1630# CONFIG_UNUSED_SYMBOLS is not set 1652# CONFIG_UNUSED_SYMBOLS is not set
1631# CONFIG_DEBUG_FS is not set 1653# CONFIG_DEBUG_FS is not set
1632# CONFIG_HEADERS_CHECK is not set 1654# CONFIG_HEADERS_CHECK is not set
@@ -1642,6 +1664,7 @@ CONFIG_HAVE_DYNAMIC_FTRACE=y
1642CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y 1664CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y
1643CONFIG_TRACING_SUPPORT=y 1665CONFIG_TRACING_SUPPORT=y
1644# CONFIG_FTRACE is not set 1666# CONFIG_FTRACE is not set
1667# CONFIG_DMA_API_DEBUG is not set
1645# CONFIG_SAMPLES is not set 1668# CONFIG_SAMPLES is not set
1646CONFIG_HAVE_ARCH_KGDB=y 1669CONFIG_HAVE_ARCH_KGDB=y
1647# CONFIG_PPC_DISABLE_WERROR is not set 1670# CONFIG_PPC_DISABLE_WERROR is not set
@@ -1663,7 +1686,6 @@ CONFIG_CRYPTO=y
1663# 1686#
1664# Crypto core or helper 1687# Crypto core or helper
1665# 1688#
1666# CONFIG_CRYPTO_FIPS is not set
1667CONFIG_CRYPTO_ALGAPI=y 1689CONFIG_CRYPTO_ALGAPI=y
1668CONFIG_CRYPTO_ALGAPI2=y 1690CONFIG_CRYPTO_ALGAPI2=y
1669CONFIG_CRYPTO_AEAD=m 1691CONFIG_CRYPTO_AEAD=m
@@ -1706,11 +1728,13 @@ CONFIG_CRYPTO_CBC=y
1706# 1728#
1707CONFIG_CRYPTO_HMAC=m 1729CONFIG_CRYPTO_HMAC=m
1708# CONFIG_CRYPTO_XCBC is not set 1730# CONFIG_CRYPTO_XCBC is not set
1731# CONFIG_CRYPTO_VMAC is not set
1709 1732
1710# 1733#
1711# Digest 1734# Digest
1712# 1735#
1713CONFIG_CRYPTO_CRC32C=y 1736CONFIG_CRYPTO_CRC32C=y
1737# CONFIG_CRYPTO_GHASH is not set
1714# CONFIG_CRYPTO_MD4 is not set 1738# CONFIG_CRYPTO_MD4 is not set
1715CONFIG_CRYPTO_MD5=y 1739CONFIG_CRYPTO_MD5=y
1716# CONFIG_CRYPTO_MICHAEL_MIC is not set 1740# CONFIG_CRYPTO_MICHAEL_MIC is not set
diff --git a/arch/powerpc/configs/86xx/gef_sbc610_defconfig b/arch/powerpc/configs/86xx/gef_sbc610_defconfig
index ba47883f4aa0..3b0fbfb28efd 100644
--- a/arch/powerpc/configs/86xx/gef_sbc610_defconfig
+++ b/arch/powerpc/configs/86xx/gef_sbc610_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.31-rc4 3# Linux kernel version: 2.6.32-rc5
4# Wed Jul 29 23:32:30 2009 4# Thu Nov 5 08:20:48 2009
5# 5#
6# CONFIG_PPC64 is not set 6# CONFIG_PPC64 is not set
7 7
@@ -36,6 +36,7 @@ CONFIG_GENERIC_CLOCKEVENTS=y
36CONFIG_GENERIC_HARDIRQS=y 36CONFIG_GENERIC_HARDIRQS=y
37CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y 37CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y
38# CONFIG_HAVE_SETUP_PER_CPU_AREA is not set 38# CONFIG_HAVE_SETUP_PER_CPU_AREA is not set
39# CONFIG_NEED_PER_CPU_EMBED_FIRST_CHUNK 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
@@ -88,11 +89,12 @@ CONFIG_BSD_PROCESS_ACCT_V3=y
88# 89#
89# RCU Subsystem 90# RCU Subsystem
90# 91#
91CONFIG_CLASSIC_RCU=y 92CONFIG_TREE_RCU=y
92# CONFIG_TREE_RCU is not set 93# CONFIG_TREE_PREEMPT_RCU is not set
93# CONFIG_PREEMPT_RCU is not set 94# CONFIG_RCU_TRACE is not set
95CONFIG_RCU_FANOUT=32
96# CONFIG_RCU_FANOUT_EXACT is not set
94# CONFIG_TREE_RCU_TRACE is not set 97# CONFIG_TREE_RCU_TRACE is not set
95# CONFIG_PREEMPT_RCU_TRACE is not set
96CONFIG_IKCONFIG=y 98CONFIG_IKCONFIG=y
97CONFIG_IKCONFIG_PROC=y 99CONFIG_IKCONFIG_PROC=y
98CONFIG_LOG_BUF_SHIFT=14 100CONFIG_LOG_BUF_SHIFT=14
@@ -131,21 +133,20 @@ CONFIG_TIMERFD=y
131CONFIG_EVENTFD=y 133CONFIG_EVENTFD=y
132CONFIG_SHMEM=y 134CONFIG_SHMEM=y
133CONFIG_AIO=y 135CONFIG_AIO=y
134CONFIG_HAVE_PERF_COUNTERS=y 136CONFIG_HAVE_PERF_EVENTS=y
135 137
136# 138#
137# Performance Counters 139# Kernel Performance Events And Counters
138# 140#
141# CONFIG_PERF_EVENTS is not set
139# CONFIG_PERF_COUNTERS is not set 142# CONFIG_PERF_COUNTERS is not set
140CONFIG_VM_EVENT_COUNTERS=y 143CONFIG_VM_EVENT_COUNTERS=y
141CONFIG_PCI_QUIRKS=y 144CONFIG_PCI_QUIRKS=y
142# CONFIG_STRIP_ASM_SYMS is not set
143CONFIG_COMPAT_BRK=y 145CONFIG_COMPAT_BRK=y
144CONFIG_SLAB=y 146CONFIG_SLAB=y
145# CONFIG_SLUB is not set 147# CONFIG_SLUB is not set
146# CONFIG_SLOB is not set 148# CONFIG_SLOB is not set
147# CONFIG_PROFILING is not set 149# CONFIG_PROFILING is not set
148# CONFIG_MARKERS is not set
149CONFIG_HAVE_OPROFILE=y 150CONFIG_HAVE_OPROFILE=y
150# CONFIG_KPROBES is not set 151# CONFIG_KPROBES is not set
151CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS=y 152CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS=y
@@ -153,12 +154,14 @@ CONFIG_HAVE_IOREMAP_PROT=y
153CONFIG_HAVE_KPROBES=y 154CONFIG_HAVE_KPROBES=y
154CONFIG_HAVE_KRETPROBES=y 155CONFIG_HAVE_KRETPROBES=y
155CONFIG_HAVE_ARCH_TRACEHOOK=y 156CONFIG_HAVE_ARCH_TRACEHOOK=y
157CONFIG_HAVE_DMA_ATTRS=y
156CONFIG_USE_GENERIC_SMP_HELPERS=y 158CONFIG_USE_GENERIC_SMP_HELPERS=y
159CONFIG_HAVE_DMA_API_DEBUG=y
157 160
158# 161#
159# GCOV-based kernel profiling 162# GCOV-based kernel profiling
160# 163#
161# CONFIG_SLOW_WORK is not set 164CONFIG_SLOW_WORK=y
162# CONFIG_HAVE_GENERIC_DMA_COHERENT is not set 165# CONFIG_HAVE_GENERIC_DMA_COHERENT is not set
163CONFIG_SLABINFO=y 166CONFIG_SLABINFO=y
164CONFIG_RT_MUTEXES=y 167CONFIG_RT_MUTEXES=y
@@ -257,6 +260,7 @@ CONFIG_ARCH_ENABLE_MEMORY_HOTREMOVE=y
257# CONFIG_KEXEC is not set 260# CONFIG_KEXEC is not set
258# CONFIG_CRASH_DUMP is not set 261# CONFIG_CRASH_DUMP is not set
259CONFIG_IRQ_ALL_CPUS=y 262CONFIG_IRQ_ALL_CPUS=y
263CONFIG_MAX_ACTIVE_REGIONS=32
260CONFIG_ARCH_FLATMEM_ENABLE=y 264CONFIG_ARCH_FLATMEM_ENABLE=y
261CONFIG_ARCH_POPULATES_NODE_MAP=y 265CONFIG_ARCH_POPULATES_NODE_MAP=y
262CONFIG_SELECT_MEMORY_MODEL=y 266CONFIG_SELECT_MEMORY_MODEL=y
@@ -274,6 +278,7 @@ CONFIG_BOUNCE=y
274CONFIG_VIRT_TO_BUS=y 278CONFIG_VIRT_TO_BUS=y
275CONFIG_HAVE_MLOCK=y 279CONFIG_HAVE_MLOCK=y
276CONFIG_HAVE_MLOCKED_PAGE_BIT=y 280CONFIG_HAVE_MLOCKED_PAGE_BIT=y
281# CONFIG_KSM is not set
277CONFIG_DEFAULT_MMAP_MIN_ADDR=4096 282CONFIG_DEFAULT_MMAP_MIN_ADDR=4096
278CONFIG_PPC_4K_PAGES=y 283CONFIG_PPC_4K_PAGES=y
279# CONFIG_PPC_16K_PAGES is not set 284# CONFIG_PPC_16K_PAGES is not set
@@ -503,6 +508,7 @@ CONFIG_IP_SCTP=m
503# CONFIG_SCTP_HMAC_NONE is not set 508# CONFIG_SCTP_HMAC_NONE is not set
504# CONFIG_SCTP_HMAC_SHA1 is not set 509# CONFIG_SCTP_HMAC_SHA1 is not set
505CONFIG_SCTP_HMAC_MD5=y 510CONFIG_SCTP_HMAC_MD5=y
511# CONFIG_RDS is not set
506CONFIG_TIPC=m 512CONFIG_TIPC=m
507# CONFIG_TIPC_ADVANCED is not set 513# CONFIG_TIPC_ADVANCED is not set
508# CONFIG_TIPC_DEBUG is not set 514# CONFIG_TIPC_DEBUG is not set
@@ -582,6 +588,7 @@ CONFIG_NET_PKTGEN=m
582CONFIG_FIB_RULES=y 588CONFIG_FIB_RULES=y
583CONFIG_WIRELESS=y 589CONFIG_WIRELESS=y
584# CONFIG_CFG80211 is not set 590# CONFIG_CFG80211 is not set
591CONFIG_CFG80211_DEFAULT_PS_VALUE=0
585CONFIG_WIRELESS_OLD_REGULATORY=y 592CONFIG_WIRELESS_OLD_REGULATORY=y
586# CONFIG_WIRELESS_EXT is not set 593# CONFIG_WIRELESS_EXT is not set
587# CONFIG_LIB80211 is not set 594# CONFIG_LIB80211 is not set
@@ -589,7 +596,6 @@ CONFIG_WIRELESS_OLD_REGULATORY=y
589# 596#
590# CFG80211 needs to be enabled for MAC80211 597# CFG80211 needs to be enabled for MAC80211
591# 598#
592CONFIG_MAC80211_DEFAULT_PS_VALUE=0
593# CONFIG_WIMAX is not set 599# CONFIG_WIMAX is not set
594# CONFIG_RFKILL is not set 600# CONFIG_RFKILL is not set
595# CONFIG_NET_9P is not set 601# CONFIG_NET_9P is not set
@@ -602,6 +608,7 @@ CONFIG_MAC80211_DEFAULT_PS_VALUE=0
602# Generic Driver Options 608# Generic Driver Options
603# 609#
604CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug" 610CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
611# CONFIG_DEVTMPFS is not set
605CONFIG_STANDALONE=y 612CONFIG_STANDALONE=y
606CONFIG_PREVENT_FIRMWARE_BUILD=y 613CONFIG_PREVENT_FIRMWARE_BUILD=y
607# CONFIG_FW_LOADER is not set 614# CONFIG_FW_LOADER is not set
@@ -611,9 +618,9 @@ CONFIG_PREVENT_FIRMWARE_BUILD=y
611# CONFIG_CONNECTOR is not set 618# CONFIG_CONNECTOR is not set
612CONFIG_MTD=y 619CONFIG_MTD=y
613# CONFIG_MTD_DEBUG is not set 620# CONFIG_MTD_DEBUG is not set
621# CONFIG_MTD_TESTS is not set
614CONFIG_MTD_CONCAT=y 622CONFIG_MTD_CONCAT=y
615CONFIG_MTD_PARTITIONS=y 623CONFIG_MTD_PARTITIONS=y
616# CONFIG_MTD_TESTS is not set
617# CONFIG_MTD_REDBOOT_PARTS is not set 624# CONFIG_MTD_REDBOOT_PARTS is not set
618# CONFIG_MTD_CMDLINE_PARTS is not set 625# CONFIG_MTD_CMDLINE_PARTS is not set
619# CONFIG_MTD_OF_PARTS is not set 626# CONFIG_MTD_OF_PARTS is not set
@@ -780,6 +787,7 @@ CONFIG_SCSI_WAIT_SCAN=m
780CONFIG_SCSI_LOWLEVEL=y 787CONFIG_SCSI_LOWLEVEL=y
781# CONFIG_ISCSI_TCP is not set 788# CONFIG_ISCSI_TCP is not set
782# CONFIG_SCSI_BNX2_ISCSI is not set 789# CONFIG_SCSI_BNX2_ISCSI is not set
790# CONFIG_BE2ISCSI is not set
783# CONFIG_BLK_DEV_3W_XXXX_RAID is not set 791# CONFIG_BLK_DEV_3W_XXXX_RAID is not set
784# CONFIG_SCSI_3W_9XXX is not set 792# CONFIG_SCSI_3W_9XXX is not set
785# CONFIG_SCSI_ACARD is not set 793# CONFIG_SCSI_ACARD is not set
@@ -819,11 +827,14 @@ CONFIG_SCSI_LOWLEVEL=y
819# CONFIG_SCSI_DC390T is not set 827# CONFIG_SCSI_DC390T is not set
820# CONFIG_SCSI_NSP32 is not set 828# CONFIG_SCSI_NSP32 is not set
821# CONFIG_SCSI_DEBUG is not set 829# CONFIG_SCSI_DEBUG is not set
830# CONFIG_SCSI_PMCRAID is not set
822# CONFIG_SCSI_SRP is not set 831# CONFIG_SCSI_SRP is not set
832# CONFIG_SCSI_BFA_FC is not set
823# CONFIG_SCSI_DH is not set 833# CONFIG_SCSI_DH is not set
824# CONFIG_SCSI_OSD_INITIATOR is not set 834# CONFIG_SCSI_OSD_INITIATOR is not set
825CONFIG_ATA=y 835CONFIG_ATA=y
826# CONFIG_ATA_NONSTANDARD is not set 836# CONFIG_ATA_NONSTANDARD is not set
837CONFIG_ATA_VERBOSE_ERROR=y
827CONFIG_SATA_PMP=y 838CONFIG_SATA_PMP=y
828# CONFIG_SATA_AHCI is not set 839# CONFIG_SATA_AHCI is not set
829# CONFIG_SATA_SIL24 is not set 840# CONFIG_SATA_SIL24 is not set
@@ -846,6 +857,7 @@ CONFIG_SATA_SIL=y
846# CONFIG_PATA_ALI is not set 857# CONFIG_PATA_ALI is not set
847# CONFIG_PATA_AMD is not set 858# CONFIG_PATA_AMD is not set
848# CONFIG_PATA_ARTOP is not set 859# CONFIG_PATA_ARTOP is not set
860# CONFIG_PATA_ATP867X is not set
849# CONFIG_PATA_ATIIXP is not set 861# CONFIG_PATA_ATIIXP is not set
850# CONFIG_PATA_CMD640_PCI is not set 862# CONFIG_PATA_CMD640_PCI is not set
851# CONFIG_PATA_CMD64X is not set 863# CONFIG_PATA_CMD64X is not set
@@ -873,6 +885,7 @@ CONFIG_SATA_SIL=y
873# CONFIG_PATA_OPTIDMA is not set 885# CONFIG_PATA_OPTIDMA is not set
874# CONFIG_PATA_PDC_OLD is not set 886# CONFIG_PATA_PDC_OLD is not set
875# CONFIG_PATA_RADISYS is not set 887# CONFIG_PATA_RADISYS is not set
888# CONFIG_PATA_RDC is not set
876# CONFIG_PATA_RZ1000 is not set 889# CONFIG_PATA_RZ1000 is not set
877# CONFIG_PATA_SC1200 is not set 890# CONFIG_PATA_SC1200 is not set
878# CONFIG_PATA_SERVERWORKS is not set 891# CONFIG_PATA_SERVERWORKS is not set
@@ -949,7 +962,9 @@ CONFIG_MII=y
949# CONFIG_NET_PCI is not set 962# CONFIG_NET_PCI is not set
950# CONFIG_B44 is not set 963# CONFIG_B44 is not set
951# CONFIG_KS8842 is not set 964# CONFIG_KS8842 is not set
965# CONFIG_KS8851_MLL is not set
952# CONFIG_ATL2 is not set 966# CONFIG_ATL2 is not set
967# CONFIG_XILINX_EMACLITE is not set
953CONFIG_NETDEV_1000=y 968CONFIG_NETDEV_1000=y
954# CONFIG_ACENIC is not set 969# CONFIG_ACENIC is not set
955# CONFIG_DL2K is not set 970# CONFIG_DL2K is not set
@@ -979,10 +994,7 @@ CONFIG_GIANFAR=y
979# CONFIG_JME is not set 994# CONFIG_JME is not set
980# CONFIG_NETDEV_10000 is not set 995# CONFIG_NETDEV_10000 is not set
981# CONFIG_TR is not set 996# CONFIG_TR is not set
982 997CONFIG_WLAN=y
983#
984# Wireless LAN
985#
986# CONFIG_WLAN_PRE80211 is not set 998# CONFIG_WLAN_PRE80211 is not set
987# CONFIG_WLAN_80211 is not set 999# CONFIG_WLAN_80211 is not set
988 1000
@@ -1120,6 +1132,7 @@ CONFIG_HW_RANDOM=y
1120CONFIG_DEVPORT=y 1132CONFIG_DEVPORT=y
1121CONFIG_I2C=y 1133CONFIG_I2C=y
1122CONFIG_I2C_BOARDINFO=y 1134CONFIG_I2C_BOARDINFO=y
1135CONFIG_I2C_COMPAT=y
1123CONFIG_I2C_CHARDEV=y 1136CONFIG_I2C_CHARDEV=y
1124CONFIG_I2C_HELPER_AUTO=y 1137CONFIG_I2C_HELPER_AUTO=y
1125 1138
@@ -1175,9 +1188,6 @@ CONFIG_I2C_MPC=y
1175# Miscellaneous I2C Chip support 1188# Miscellaneous I2C Chip support
1176# 1189#
1177CONFIG_DS1682=y 1190CONFIG_DS1682=y
1178# CONFIG_SENSORS_PCF8574 is not set
1179# CONFIG_PCF8575 is not set
1180# CONFIG_SENSORS_PCA9539 is not set
1181# CONFIG_SENSORS_TSL2550 is not set 1191# CONFIG_SENSORS_TSL2550 is not set
1182# CONFIG_I2C_DEBUG_CORE is not set 1192# CONFIG_I2C_DEBUG_CORE is not set
1183# CONFIG_I2C_DEBUG_ALGO is not set 1193# CONFIG_I2C_DEBUG_ALGO is not set
@@ -1211,14 +1221,24 @@ CONFIG_GPIOLIB=y
1211# PCI GPIO expanders: 1221# PCI GPIO expanders:
1212# 1222#
1213# CONFIG_GPIO_BT8XX is not set 1223# CONFIG_GPIO_BT8XX is not set
1224# CONFIG_GPIO_LANGWELL is not set
1214 1225
1215# 1226#
1216# SPI GPIO expanders: 1227# SPI GPIO expanders:
1217# 1228#
1229
1230#
1231# AC97 GPIO expanders:
1232#
1218# CONFIG_W1 is not set 1233# CONFIG_W1 is not set
1219# CONFIG_POWER_SUPPLY is not set 1234# CONFIG_POWER_SUPPLY is not set
1220CONFIG_HWMON=y 1235CONFIG_HWMON=y
1221# CONFIG_HWMON_VID is not set 1236# CONFIG_HWMON_VID is not set
1237# CONFIG_HWMON_DEBUG_CHIP is not set
1238
1239#
1240# Native drivers
1241#
1222# CONFIG_SENSORS_AD7414 is not set 1242# CONFIG_SENSORS_AD7414 is not set
1223# CONFIG_SENSORS_AD7418 is not set 1243# CONFIG_SENSORS_AD7418 is not set
1224# CONFIG_SENSORS_ADM1021 is not set 1244# CONFIG_SENSORS_ADM1021 is not set
@@ -1269,6 +1289,7 @@ CONFIG_SENSORS_LM92=y
1269# CONFIG_SENSORS_ADS7828 is not set 1289# CONFIG_SENSORS_ADS7828 is not set
1270# CONFIG_SENSORS_THMC50 is not set 1290# CONFIG_SENSORS_THMC50 is not set
1271# CONFIG_SENSORS_TMP401 is not set 1291# CONFIG_SENSORS_TMP401 is not set
1292# CONFIG_SENSORS_TMP421 is not set
1272# CONFIG_SENSORS_VIA686A is not set 1293# CONFIG_SENSORS_VIA686A is not set
1273# CONFIG_SENSORS_VT1211 is not set 1294# CONFIG_SENSORS_VT1211 is not set
1274# CONFIG_SENSORS_VT8231 is not set 1295# CONFIG_SENSORS_VT8231 is not set
@@ -1280,9 +1301,7 @@ CONFIG_SENSORS_LM92=y
1280# CONFIG_SENSORS_W83L786NG is not set 1301# CONFIG_SENSORS_W83L786NG is not set
1281# CONFIG_SENSORS_W83627HF is not set 1302# CONFIG_SENSORS_W83627HF is not set
1282# CONFIG_SENSORS_W83627EHF is not set 1303# CONFIG_SENSORS_W83627EHF is not set
1283# CONFIG_HWMON_DEBUG_CHIP is not set
1284# CONFIG_THERMAL is not set 1304# CONFIG_THERMAL is not set
1285# CONFIG_THERMAL_HWMON is not set
1286CONFIG_WATCHDOG=y 1305CONFIG_WATCHDOG=y
1287# CONFIG_WATCHDOG_NOWAYOUT is not set 1306# CONFIG_WATCHDOG_NOWAYOUT is not set
1288 1307
@@ -1322,6 +1341,7 @@ CONFIG_SSB_POSSIBLE=y
1322# CONFIG_MFD_TMIO is not set 1341# CONFIG_MFD_TMIO is not set
1323# CONFIG_PMIC_DA903X is not set 1342# CONFIG_PMIC_DA903X is not set
1324# CONFIG_MFD_WM8400 is not set 1343# CONFIG_MFD_WM8400 is not set
1344# CONFIG_MFD_WM831X is not set
1325# CONFIG_MFD_WM8350_I2C is not set 1345# CONFIG_MFD_WM8350_I2C is not set
1326# CONFIG_MFD_PCF50633 is not set 1346# CONFIG_MFD_PCF50633 is not set
1327# CONFIG_AB3100_CORE is not set 1347# CONFIG_AB3100_CORE is not set
@@ -1332,6 +1352,7 @@ CONFIG_SSB_POSSIBLE=y
1332# Graphics support 1352# Graphics support
1333# 1353#
1334# CONFIG_AGP is not set 1354# CONFIG_AGP is not set
1355CONFIG_VGA_ARB=y
1335# CONFIG_DRM is not set 1356# CONFIG_DRM is not set
1336# CONFIG_VGASTATE is not set 1357# CONFIG_VGASTATE is not set
1337CONFIG_VIDEO_OUTPUT_CONTROL=m 1358CONFIG_VIDEO_OUTPUT_CONTROL=m
@@ -1352,7 +1373,6 @@ CONFIG_DUMMY_CONSOLE=y
1352# CONFIG_SOUND is not set 1373# CONFIG_SOUND is not set
1353CONFIG_HID_SUPPORT=y 1374CONFIG_HID_SUPPORT=y
1354CONFIG_HID=y 1375CONFIG_HID=y
1355# CONFIG_HID_DEBUG is not set
1356# CONFIG_HIDRAW is not set 1376# CONFIG_HIDRAW is not set
1357 1377
1358# 1378#
@@ -1375,6 +1395,7 @@ CONFIG_HID_CYPRESS=y
1375CONFIG_HID_EZKEY=y 1395CONFIG_HID_EZKEY=y
1376# CONFIG_HID_KYE is not set 1396# CONFIG_HID_KYE is not set
1377CONFIG_HID_GYRATION=y 1397CONFIG_HID_GYRATION=y
1398# CONFIG_HID_TWINHAN is not set
1378# CONFIG_HID_KENSINGTON is not set 1399# CONFIG_HID_KENSINGTON is not set
1379CONFIG_HID_LOGITECH=y 1400CONFIG_HID_LOGITECH=y
1380# CONFIG_LOGITECH_FF is not set 1401# CONFIG_LOGITECH_FF is not set
@@ -1427,6 +1448,7 @@ CONFIG_USB_EHCI_HCD=y
1427# CONFIG_USB_OXU210HP_HCD is not set 1448# CONFIG_USB_OXU210HP_HCD is not set
1428# CONFIG_USB_ISP116X_HCD is not set 1449# CONFIG_USB_ISP116X_HCD is not set
1429# CONFIG_USB_ISP1760_HCD is not set 1450# CONFIG_USB_ISP1760_HCD is not set
1451# CONFIG_USB_ISP1362_HCD is not set
1430CONFIG_USB_OHCI_HCD=y 1452CONFIG_USB_OHCI_HCD=y
1431# CONFIG_USB_OHCI_HCD_PPC_OF_BE is not set 1453# CONFIG_USB_OHCI_HCD_PPC_OF_BE is not set
1432# CONFIG_USB_OHCI_HCD_PPC_OF_LE is not set 1454# CONFIG_USB_OHCI_HCD_PPC_OF_LE is not set
@@ -1502,6 +1524,7 @@ CONFIG_USB_STORAGE=y
1502# CONFIG_USB_LD is not set 1524# CONFIG_USB_LD is not set
1503# CONFIG_USB_TRANCEVIBRATOR is not set 1525# CONFIG_USB_TRANCEVIBRATOR is not set
1504# CONFIG_USB_IOWARRIOR is not set 1526# CONFIG_USB_IOWARRIOR is not set
1527# CONFIG_USB_TEST is not set
1505# CONFIG_USB_ISIGHTFW is not set 1528# CONFIG_USB_ISIGHTFW is not set
1506# CONFIG_USB_VST is not set 1529# CONFIG_USB_VST is not set
1507# CONFIG_USB_ATM is not set 1530# CONFIG_USB_ATM is not set
@@ -1607,6 +1630,7 @@ CONFIG_FS_POSIX_ACL=y
1607# CONFIG_GFS2_FS is not set 1630# CONFIG_GFS2_FS is not set
1608# CONFIG_OCFS2_FS is not set 1631# CONFIG_OCFS2_FS is not set
1609# CONFIG_BTRFS_FS is not set 1632# CONFIG_BTRFS_FS is not set
1633# CONFIG_NILFS2_FS is not set
1610CONFIG_FILE_LOCKING=y 1634CONFIG_FILE_LOCKING=y
1611CONFIG_FSNOTIFY=y 1635CONFIG_FSNOTIFY=y
1612CONFIG_DNOTIFY=y 1636CONFIG_DNOTIFY=y
@@ -1669,7 +1693,6 @@ CONFIG_MISC_FILESYSTEMS=y
1669# CONFIG_ROMFS_FS is not set 1693# CONFIG_ROMFS_FS is not set
1670# CONFIG_SYSV_FS is not set 1694# CONFIG_SYSV_FS is not set
1671# CONFIG_UFS_FS is not set 1695# CONFIG_UFS_FS is not set
1672# CONFIG_NILFS2_FS is not set
1673CONFIG_NETWORK_FILESYSTEMS=y 1696CONFIG_NETWORK_FILESYSTEMS=y
1674CONFIG_NFS_FS=y 1697CONFIG_NFS_FS=y
1675CONFIG_NFS_V3=y 1698CONFIG_NFS_V3=y
@@ -1775,6 +1798,7 @@ CONFIG_ENABLE_WARN_DEPRECATED=y
1775CONFIG_ENABLE_MUST_CHECK=y 1798CONFIG_ENABLE_MUST_CHECK=y
1776CONFIG_FRAME_WARN=1024 1799CONFIG_FRAME_WARN=1024
1777CONFIG_MAGIC_SYSRQ=y 1800CONFIG_MAGIC_SYSRQ=y
1801# CONFIG_STRIP_ASM_SYMS is not set
1778# CONFIG_UNUSED_SYMBOLS is not set 1802# CONFIG_UNUSED_SYMBOLS is not set
1779# CONFIG_DEBUG_FS is not set 1803# CONFIG_DEBUG_FS is not set
1780# CONFIG_HEADERS_CHECK is not set 1804# CONFIG_HEADERS_CHECK is not set
@@ -1791,6 +1815,7 @@ CONFIG_SCHED_DEBUG=y
1791# CONFIG_TIMER_STATS is not set 1815# CONFIG_TIMER_STATS is not set
1792# CONFIG_DEBUG_OBJECTS is not set 1816# CONFIG_DEBUG_OBJECTS is not set
1793# CONFIG_DEBUG_SLAB is not set 1817# CONFIG_DEBUG_SLAB is not set
1818# CONFIG_DEBUG_KMEMLEAK is not set
1794CONFIG_DEBUG_PREEMPT=y 1819CONFIG_DEBUG_PREEMPT=y
1795# CONFIG_DEBUG_RT_MUTEXES is not set 1820# CONFIG_DEBUG_RT_MUTEXES is not set
1796# CONFIG_RT_MUTEX_TESTER is not set 1821# CONFIG_RT_MUTEX_TESTER is not set
@@ -1810,10 +1835,12 @@ CONFIG_DEBUG_INFO=y
1810# CONFIG_DEBUG_LIST is not set 1835# CONFIG_DEBUG_LIST is not set
1811# CONFIG_DEBUG_SG is not set 1836# CONFIG_DEBUG_SG is not set
1812# CONFIG_DEBUG_NOTIFIERS is not set 1837# CONFIG_DEBUG_NOTIFIERS is not set
1838# CONFIG_DEBUG_CREDENTIALS is not set
1813# CONFIG_RCU_TORTURE_TEST is not set 1839# CONFIG_RCU_TORTURE_TEST is not set
1814# CONFIG_RCU_CPU_STALL_DETECTOR is not set 1840# CONFIG_RCU_CPU_STALL_DETECTOR is not set
1815# CONFIG_BACKTRACE_SELF_TEST is not set 1841# CONFIG_BACKTRACE_SELF_TEST is not set
1816# CONFIG_DEBUG_BLOCK_EXT_DEVT is not set 1842# CONFIG_DEBUG_BLOCK_EXT_DEVT is not set
1843# CONFIG_DEBUG_FORCE_WEAK_PER_CPU is not set
1817# CONFIG_FAULT_INJECTION is not set 1844# CONFIG_FAULT_INJECTION is not set
1818# CONFIG_LATENCYTOP is not set 1845# CONFIG_LATENCYTOP is not set
1819CONFIG_SYSCTL_SYSCALL_CHECK=y 1846CONFIG_SYSCTL_SYSCALL_CHECK=y
@@ -1837,10 +1864,10 @@ CONFIG_BRANCH_PROFILE_NONE=y
1837# CONFIG_KMEMTRACE is not set 1864# CONFIG_KMEMTRACE is not set
1838# CONFIG_WORKQUEUE_TRACER is not set 1865# CONFIG_WORKQUEUE_TRACER is not set
1839# CONFIG_BLK_DEV_IO_TRACE is not set 1866# CONFIG_BLK_DEV_IO_TRACE is not set
1867# CONFIG_DMA_API_DEBUG is not set
1840# CONFIG_SAMPLES is not set 1868# CONFIG_SAMPLES is not set
1841CONFIG_HAVE_ARCH_KGDB=y 1869CONFIG_HAVE_ARCH_KGDB=y
1842# CONFIG_KGDB is not set 1870# CONFIG_KGDB is not set
1843# CONFIG_KMEMCHECK is not set
1844# CONFIG_PPC_DISABLE_WERROR is not set 1871# CONFIG_PPC_DISABLE_WERROR is not set
1845CONFIG_PPC_WERROR=y 1872CONFIG_PPC_WERROR=y
1846CONFIG_PRINT_STACK_DEPTH=64 1873CONFIG_PRINT_STACK_DEPTH=64
@@ -1872,7 +1899,6 @@ CONFIG_CRYPTO=y
1872# 1899#
1873# Crypto core or helper 1900# Crypto core or helper
1874# 1901#
1875# CONFIG_CRYPTO_FIPS is not set
1876CONFIG_CRYPTO_ALGAPI=y 1902CONFIG_CRYPTO_ALGAPI=y
1877CONFIG_CRYPTO_ALGAPI2=y 1903CONFIG_CRYPTO_ALGAPI2=y
1878CONFIG_CRYPTO_AEAD=m 1904CONFIG_CRYPTO_AEAD=m
@@ -1915,11 +1941,13 @@ CONFIG_CRYPTO_PCBC=m
1915# 1941#
1916CONFIG_CRYPTO_HMAC=y 1942CONFIG_CRYPTO_HMAC=y
1917# CONFIG_CRYPTO_XCBC is not set 1943# CONFIG_CRYPTO_XCBC is not set
1944# CONFIG_CRYPTO_VMAC is not set
1918 1945
1919# 1946#
1920# Digest 1947# Digest
1921# 1948#
1922CONFIG_CRYPTO_CRC32C=m 1949CONFIG_CRYPTO_CRC32C=m
1950# CONFIG_CRYPTO_GHASH is not set
1923CONFIG_CRYPTO_MD4=m 1951CONFIG_CRYPTO_MD4=m
1924CONFIG_CRYPTO_MD5=y 1952CONFIG_CRYPTO_MD5=y
1925CONFIG_CRYPTO_MICHAEL_MIC=m 1953CONFIG_CRYPTO_MICHAEL_MIC=m
diff --git a/arch/powerpc/configs/86xx/mpc8610_hpcd_defconfig b/arch/powerpc/configs/86xx/mpc8610_hpcd_defconfig
index a61f183f7186..de4d52504fe4 100644
--- a/arch/powerpc/configs/86xx/mpc8610_hpcd_defconfig
+++ b/arch/powerpc/configs/86xx/mpc8610_hpcd_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.31-rc4 3# Linux kernel version: 2.6.32-rc5
4# Wed Jul 29 23:32:27 2009 4# Thu Nov 5 08:20:45 2009
5# 5#
6# CONFIG_PPC64 is not set 6# CONFIG_PPC64 is not set
7 7
@@ -35,6 +35,7 @@ CONFIG_GENERIC_CLOCKEVENTS=y
35CONFIG_GENERIC_HARDIRQS=y 35CONFIG_GENERIC_HARDIRQS=y
36CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y 36CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y
37# CONFIG_HAVE_SETUP_PER_CPU_AREA is not set 37# CONFIG_HAVE_SETUP_PER_CPU_AREA is not set
38# CONFIG_NEED_PER_CPU_EMBED_FIRST_CHUNK 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
@@ -83,11 +84,12 @@ CONFIG_SYSVIPC_SYSCTL=y
83# 84#
84# RCU Subsystem 85# RCU Subsystem
85# 86#
86CONFIG_CLASSIC_RCU=y 87CONFIG_TREE_RCU=y
87# CONFIG_TREE_RCU is not set 88# CONFIG_TREE_PREEMPT_RCU is not set
88# CONFIG_PREEMPT_RCU is not set 89# CONFIG_RCU_TRACE is not set
90CONFIG_RCU_FANOUT=32
91# CONFIG_RCU_FANOUT_EXACT is not set
89# CONFIG_TREE_RCU_TRACE is not set 92# CONFIG_TREE_RCU_TRACE is not set
90# CONFIG_PREEMPT_RCU_TRACE is not set
91CONFIG_IKCONFIG=y 93CONFIG_IKCONFIG=y
92CONFIG_IKCONFIG_PROC=y 94CONFIG_IKCONFIG_PROC=y
93CONFIG_LOG_BUF_SHIFT=14 95CONFIG_LOG_BUF_SHIFT=14
@@ -126,22 +128,21 @@ CONFIG_TIMERFD=y
126CONFIG_EVENTFD=y 128CONFIG_EVENTFD=y
127CONFIG_SHMEM=y 129CONFIG_SHMEM=y
128CONFIG_AIO=y 130CONFIG_AIO=y
129CONFIG_HAVE_PERF_COUNTERS=y 131CONFIG_HAVE_PERF_EVENTS=y
130 132
131# 133#
132# Performance Counters 134# Kernel Performance Events And Counters
133# 135#
136# CONFIG_PERF_EVENTS is not set
134# CONFIG_PERF_COUNTERS is not set 137# CONFIG_PERF_COUNTERS is not set
135CONFIG_VM_EVENT_COUNTERS=y 138CONFIG_VM_EVENT_COUNTERS=y
136CONFIG_PCI_QUIRKS=y 139CONFIG_PCI_QUIRKS=y
137CONFIG_SLUB_DEBUG=y 140CONFIG_SLUB_DEBUG=y
138# CONFIG_STRIP_ASM_SYMS is not set
139CONFIG_COMPAT_BRK=y 141CONFIG_COMPAT_BRK=y
140# CONFIG_SLAB is not set 142# CONFIG_SLAB is not set
141CONFIG_SLUB=y 143CONFIG_SLUB=y
142# CONFIG_SLOB is not set 144# CONFIG_SLOB is not set
143# CONFIG_PROFILING is not set 145# CONFIG_PROFILING is not set
144# CONFIG_MARKERS is not set
145CONFIG_HAVE_OPROFILE=y 146CONFIG_HAVE_OPROFILE=y
146# CONFIG_KPROBES is not set 147# CONFIG_KPROBES is not set
147CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS=y 148CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS=y
@@ -149,6 +150,8 @@ CONFIG_HAVE_IOREMAP_PROT=y
149CONFIG_HAVE_KPROBES=y 150CONFIG_HAVE_KPROBES=y
150CONFIG_HAVE_KRETPROBES=y 151CONFIG_HAVE_KRETPROBES=y
151CONFIG_HAVE_ARCH_TRACEHOOK=y 152CONFIG_HAVE_ARCH_TRACEHOOK=y
153CONFIG_HAVE_DMA_ATTRS=y
154CONFIG_HAVE_DMA_API_DEBUG=y
152 155
153# 156#
154# GCOV-based kernel profiling 157# GCOV-based kernel profiling
@@ -251,6 +254,7 @@ CONFIG_ARCH_HAS_WALK_MEMORY=y
251CONFIG_ARCH_ENABLE_MEMORY_HOTREMOVE=y 254CONFIG_ARCH_ENABLE_MEMORY_HOTREMOVE=y
252# CONFIG_KEXEC is not set 255# CONFIG_KEXEC is not set
253# CONFIG_CRASH_DUMP is not set 256# CONFIG_CRASH_DUMP is not set
257CONFIG_MAX_ACTIVE_REGIONS=32
254CONFIG_ARCH_FLATMEM_ENABLE=y 258CONFIG_ARCH_FLATMEM_ENABLE=y
255CONFIG_ARCH_POPULATES_NODE_MAP=y 259CONFIG_ARCH_POPULATES_NODE_MAP=y
256CONFIG_SELECT_MEMORY_MODEL=y 260CONFIG_SELECT_MEMORY_MODEL=y
@@ -268,6 +272,7 @@ CONFIG_BOUNCE=y
268CONFIG_VIRT_TO_BUS=y 272CONFIG_VIRT_TO_BUS=y
269CONFIG_HAVE_MLOCK=y 273CONFIG_HAVE_MLOCK=y
270CONFIG_HAVE_MLOCKED_PAGE_BIT=y 274CONFIG_HAVE_MLOCKED_PAGE_BIT=y
275# CONFIG_KSM is not set
271CONFIG_DEFAULT_MMAP_MIN_ADDR=4096 276CONFIG_DEFAULT_MMAP_MIN_ADDR=4096
272CONFIG_PPC_4K_PAGES=y 277CONFIG_PPC_4K_PAGES=y
273# CONFIG_PPC_16K_PAGES is not set 278# CONFIG_PPC_16K_PAGES is not set
@@ -385,6 +390,7 @@ CONFIG_IPV6_NDISC_NODETYPE=y
385# CONFIG_NETFILTER is not set 390# CONFIG_NETFILTER is not set
386# CONFIG_IP_DCCP is not set 391# CONFIG_IP_DCCP is not set
387# CONFIG_IP_SCTP is not set 392# CONFIG_IP_SCTP is not set
393# CONFIG_RDS is not set
388# CONFIG_TIPC is not set 394# CONFIG_TIPC is not set
389# CONFIG_ATM is not set 395# CONFIG_ATM is not set
390# CONFIG_BRIDGE is not set 396# CONFIG_BRIDGE is not set
@@ -414,6 +420,7 @@ CONFIG_IPV6_NDISC_NODETYPE=y
414# CONFIG_AF_RXRPC is not set 420# CONFIG_AF_RXRPC is not set
415CONFIG_WIRELESS=y 421CONFIG_WIRELESS=y
416# CONFIG_CFG80211 is not set 422# CONFIG_CFG80211 is not set
423CONFIG_CFG80211_DEFAULT_PS_VALUE=0
417CONFIG_WIRELESS_OLD_REGULATORY=y 424CONFIG_WIRELESS_OLD_REGULATORY=y
418# CONFIG_WIRELESS_EXT is not set 425# CONFIG_WIRELESS_EXT is not set
419# CONFIG_LIB80211 is not set 426# CONFIG_LIB80211 is not set
@@ -421,7 +428,6 @@ CONFIG_WIRELESS_OLD_REGULATORY=y
421# 428#
422# CFG80211 needs to be enabled for MAC80211 429# CFG80211 needs to be enabled for MAC80211
423# 430#
424CONFIG_MAC80211_DEFAULT_PS_VALUE=0
425# CONFIG_WIMAX is not set 431# CONFIG_WIMAX is not set
426# CONFIG_RFKILL is not set 432# CONFIG_RFKILL is not set
427# CONFIG_NET_9P is not set 433# CONFIG_NET_9P is not set
@@ -434,6 +440,7 @@ CONFIG_MAC80211_DEFAULT_PS_VALUE=0
434# Generic Driver Options 440# Generic Driver Options
435# 441#
436CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug" 442CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
443# CONFIG_DEVTMPFS is not set
437CONFIG_STANDALONE=y 444CONFIG_STANDALONE=y
438CONFIG_PREVENT_FIRMWARE_BUILD=y 445CONFIG_PREVENT_FIRMWARE_BUILD=y
439CONFIG_FW_LOADER=y 446CONFIG_FW_LOADER=y
@@ -445,9 +452,9 @@ CONFIG_EXTRA_FIRMWARE=""
445# CONFIG_CONNECTOR is not set 452# CONFIG_CONNECTOR is not set
446CONFIG_MTD=y 453CONFIG_MTD=y
447# CONFIG_MTD_DEBUG is not set 454# CONFIG_MTD_DEBUG is not set
455# CONFIG_MTD_TESTS is not set
448# CONFIG_MTD_CONCAT is not set 456# CONFIG_MTD_CONCAT is not set
449CONFIG_MTD_PARTITIONS=y 457CONFIG_MTD_PARTITIONS=y
450# CONFIG_MTD_TESTS is not set
451# CONFIG_MTD_REDBOOT_PARTS is not set 458# CONFIG_MTD_REDBOOT_PARTS is not set
452CONFIG_MTD_CMDLINE_PARTS=y 459CONFIG_MTD_CMDLINE_PARTS=y
453# CONFIG_MTD_OF_PARTS is not set 460# CONFIG_MTD_OF_PARTS is not set
@@ -662,6 +669,7 @@ CONFIG_SCSI_WAIT_SCAN=m
662CONFIG_SCSI_LOWLEVEL=y 669CONFIG_SCSI_LOWLEVEL=y
663# CONFIG_ISCSI_TCP is not set 670# CONFIG_ISCSI_TCP is not set
664# CONFIG_SCSI_BNX2_ISCSI is not set 671# CONFIG_SCSI_BNX2_ISCSI is not set
672# CONFIG_BE2ISCSI is not set
665# CONFIG_BLK_DEV_3W_XXXX_RAID is not set 673# CONFIG_BLK_DEV_3W_XXXX_RAID is not set
666# CONFIG_SCSI_3W_9XXX is not set 674# CONFIG_SCSI_3W_9XXX is not set
667# CONFIG_SCSI_ACARD is not set 675# CONFIG_SCSI_ACARD is not set
@@ -701,11 +709,14 @@ CONFIG_SCSI_LOWLEVEL=y
701# CONFIG_SCSI_DC390T is not set 709# CONFIG_SCSI_DC390T is not set
702# CONFIG_SCSI_NSP32 is not set 710# CONFIG_SCSI_NSP32 is not set
703# CONFIG_SCSI_DEBUG is not set 711# CONFIG_SCSI_DEBUG is not set
712# CONFIG_SCSI_PMCRAID is not set
704# CONFIG_SCSI_SRP is not set 713# CONFIG_SCSI_SRP is not set
714# CONFIG_SCSI_BFA_FC is not set
705# CONFIG_SCSI_DH is not set 715# CONFIG_SCSI_DH is not set
706# CONFIG_SCSI_OSD_INITIATOR is not set 716# CONFIG_SCSI_OSD_INITIATOR is not set
707CONFIG_ATA=y 717CONFIG_ATA=y
708# CONFIG_ATA_NONSTANDARD is not set 718# CONFIG_ATA_NONSTANDARD is not set
719CONFIG_ATA_VERBOSE_ERROR=y
709CONFIG_SATA_PMP=y 720CONFIG_SATA_PMP=y
710CONFIG_SATA_AHCI=y 721CONFIG_SATA_AHCI=y
711# CONFIG_SATA_SIL24 is not set 722# CONFIG_SATA_SIL24 is not set
@@ -728,6 +739,7 @@ CONFIG_ATA_SFF=y
728CONFIG_PATA_ALI=y 739CONFIG_PATA_ALI=y
729# CONFIG_PATA_AMD is not set 740# CONFIG_PATA_AMD is not set
730# CONFIG_PATA_ARTOP is not set 741# CONFIG_PATA_ARTOP is not set
742# CONFIG_PATA_ATP867X is not set
731# CONFIG_PATA_ATIIXP is not set 743# CONFIG_PATA_ATIIXP is not set
732# CONFIG_PATA_CMD640_PCI is not set 744# CONFIG_PATA_CMD640_PCI is not set
733# CONFIG_PATA_CMD64X is not set 745# CONFIG_PATA_CMD64X is not set
@@ -755,6 +767,7 @@ CONFIG_PATA_ALI=y
755# CONFIG_PATA_OPTIDMA is not set 767# CONFIG_PATA_OPTIDMA is not set
756# CONFIG_PATA_PDC_OLD is not set 768# CONFIG_PATA_PDC_OLD is not set
757# CONFIG_PATA_RADISYS is not set 769# CONFIG_PATA_RADISYS is not set
770# CONFIG_PATA_RDC is not set
758# CONFIG_PATA_RZ1000 is not set 771# CONFIG_PATA_RZ1000 is not set
759# CONFIG_PATA_SC1200 is not set 772# CONFIG_PATA_SC1200 is not set
760# CONFIG_PATA_SERVERWORKS is not set 773# CONFIG_PATA_SERVERWORKS is not set
@@ -818,14 +831,13 @@ CONFIG_ULI526X=y
818# CONFIG_NET_PCI is not set 831# CONFIG_NET_PCI is not set
819# CONFIG_B44 is not set 832# CONFIG_B44 is not set
820# CONFIG_KS8842 is not set 833# CONFIG_KS8842 is not set
834# CONFIG_KS8851_MLL is not set
821# CONFIG_ATL2 is not set 835# CONFIG_ATL2 is not set
836# CONFIG_XILINX_EMACLITE is not set
822# CONFIG_NETDEV_1000 is not set 837# CONFIG_NETDEV_1000 is not set
823# CONFIG_NETDEV_10000 is not set 838# CONFIG_NETDEV_10000 is not set
824# CONFIG_TR is not set 839# CONFIG_TR is not set
825 840CONFIG_WLAN=y
826#
827# Wireless LAN
828#
829# CONFIG_WLAN_PRE80211 is not set 841# CONFIG_WLAN_PRE80211 is not set
830# CONFIG_WLAN_80211 is not set 842# CONFIG_WLAN_80211 is not set
831 843
@@ -929,6 +941,7 @@ CONFIG_UNIX98_PTYS=y
929CONFIG_DEVPORT=y 941CONFIG_DEVPORT=y
930CONFIG_I2C=y 942CONFIG_I2C=y
931CONFIG_I2C_BOARDINFO=y 943CONFIG_I2C_BOARDINFO=y
944CONFIG_I2C_COMPAT=y
932# CONFIG_I2C_CHARDEV is not set 945# CONFIG_I2C_CHARDEV is not set
933CONFIG_I2C_HELPER_AUTO=y 946CONFIG_I2C_HELPER_AUTO=y
934 947
@@ -982,9 +995,6 @@ CONFIG_I2C_MPC=y
982# Miscellaneous I2C Chip support 995# Miscellaneous I2C Chip support
983# 996#
984# CONFIG_DS1682 is not set 997# CONFIG_DS1682 is not set
985# CONFIG_SENSORS_PCF8574 is not set
986# CONFIG_PCF8575 is not set
987# CONFIG_SENSORS_PCA9539 is not set
988# CONFIG_SENSORS_TSL2550 is not set 998# CONFIG_SENSORS_TSL2550 is not set
989# CONFIG_I2C_DEBUG_CORE is not set 999# CONFIG_I2C_DEBUG_CORE is not set
990# CONFIG_I2C_DEBUG_ALGO is not set 1000# CONFIG_I2C_DEBUG_ALGO is not set
@@ -1002,7 +1012,6 @@ CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y
1002# CONFIG_POWER_SUPPLY is not set 1012# CONFIG_POWER_SUPPLY is not set
1003# CONFIG_HWMON is not set 1013# CONFIG_HWMON is not set
1004# CONFIG_THERMAL is not set 1014# CONFIG_THERMAL is not set
1005# CONFIG_THERMAL_HWMON is not set
1006# CONFIG_WATCHDOG is not set 1015# CONFIG_WATCHDOG is not set
1007CONFIG_SSB_POSSIBLE=y 1016CONFIG_SSB_POSSIBLE=y
1008 1017
@@ -1021,6 +1030,7 @@ CONFIG_SSB_POSSIBLE=y
1021# CONFIG_MFD_TMIO is not set 1030# CONFIG_MFD_TMIO is not set
1022# CONFIG_PMIC_DA903X is not set 1031# CONFIG_PMIC_DA903X is not set
1023# CONFIG_MFD_WM8400 is not set 1032# CONFIG_MFD_WM8400 is not set
1033# CONFIG_MFD_WM831X is not set
1024# CONFIG_MFD_WM8350_I2C is not set 1034# CONFIG_MFD_WM8350_I2C is not set
1025# CONFIG_MFD_PCF50633 is not set 1035# CONFIG_MFD_PCF50633 is not set
1026# CONFIG_AB3100_CORE is not set 1036# CONFIG_AB3100_CORE is not set
@@ -1031,6 +1041,7 @@ CONFIG_SSB_POSSIBLE=y
1031# Graphics support 1041# Graphics support
1032# 1042#
1033# CONFIG_AGP is not set 1043# CONFIG_AGP is not set
1044CONFIG_VGA_ARB=y
1034# CONFIG_DRM is not set 1045# CONFIG_DRM is not set
1035# CONFIG_VGASTATE is not set 1046# CONFIG_VGASTATE is not set
1036CONFIG_VIDEO_OUTPUT_CONTROL=y 1047CONFIG_VIDEO_OUTPUT_CONTROL=y
@@ -1107,6 +1118,7 @@ CONFIG_DUMMY_CONSOLE=y
1107# CONFIG_LOGO is not set 1118# CONFIG_LOGO is not set
1108CONFIG_SOUND=y 1119CONFIG_SOUND=y
1109CONFIG_SOUND_OSS_CORE=y 1120CONFIG_SOUND_OSS_CORE=y
1121CONFIG_SOUND_OSS_CORE_PRECLAIM=y
1110CONFIG_SND=y 1122CONFIG_SND=y
1111CONFIG_SND_TIMER=y 1123CONFIG_SND_TIMER=y
1112CONFIG_SND_PCM=y 1124CONFIG_SND_PCM=y
@@ -1209,7 +1221,6 @@ CONFIG_SND_SOC_CS4270_VD33_ERRATA=y
1209# CONFIG_SOUND_PRIME is not set 1221# CONFIG_SOUND_PRIME is not set
1210CONFIG_HID_SUPPORT=y 1222CONFIG_HID_SUPPORT=y
1211CONFIG_HID=y 1223CONFIG_HID=y
1212# CONFIG_HID_DEBUG is not set
1213# CONFIG_HIDRAW is not set 1224# CONFIG_HIDRAW is not set
1214# CONFIG_HID_PID is not set 1225# CONFIG_HID_PID is not set
1215 1226
@@ -1329,6 +1340,7 @@ CONFIG_FS_MBCACHE=y
1329# CONFIG_GFS2_FS is not set 1340# CONFIG_GFS2_FS is not set
1330# CONFIG_OCFS2_FS is not set 1341# CONFIG_OCFS2_FS is not set
1331# CONFIG_BTRFS_FS is not set 1342# CONFIG_BTRFS_FS is not set
1343# CONFIG_NILFS2_FS is not set
1332CONFIG_FILE_LOCKING=y 1344CONFIG_FILE_LOCKING=y
1333CONFIG_FSNOTIFY=y 1345CONFIG_FSNOTIFY=y
1334# CONFIG_DNOTIFY is not set 1346# CONFIG_DNOTIFY is not set
@@ -1388,7 +1400,6 @@ CONFIG_MISC_FILESYSTEMS=y
1388# CONFIG_ROMFS_FS is not set 1400# CONFIG_ROMFS_FS is not set
1389# CONFIG_SYSV_FS is not set 1401# CONFIG_SYSV_FS is not set
1390# CONFIG_UFS_FS is not set 1402# CONFIG_UFS_FS is not set
1391# CONFIG_NILFS2_FS is not set
1392CONFIG_NETWORK_FILESYSTEMS=y 1403CONFIG_NETWORK_FILESYSTEMS=y
1393CONFIG_NFS_FS=y 1404CONFIG_NFS_FS=y
1394CONFIG_NFS_V3=y 1405CONFIG_NFS_V3=y
@@ -1505,6 +1516,7 @@ CONFIG_ENABLE_WARN_DEPRECATED=y
1505CONFIG_ENABLE_MUST_CHECK=y 1516CONFIG_ENABLE_MUST_CHECK=y
1506CONFIG_FRAME_WARN=1024 1517CONFIG_FRAME_WARN=1024
1507# CONFIG_MAGIC_SYSRQ is not set 1518# CONFIG_MAGIC_SYSRQ is not set
1519# CONFIG_STRIP_ASM_SYMS is not set
1508# CONFIG_UNUSED_SYMBOLS is not set 1520# CONFIG_UNUSED_SYMBOLS is not set
1509# CONFIG_DEBUG_FS is not set 1521# CONFIG_DEBUG_FS is not set
1510# CONFIG_HEADERS_CHECK is not set 1522# CONFIG_HEADERS_CHECK is not set
@@ -1522,6 +1534,7 @@ CONFIG_SCHED_DEBUG=y
1522# CONFIG_DEBUG_OBJECTS is not set 1534# CONFIG_DEBUG_OBJECTS is not set
1523# CONFIG_SLUB_DEBUG_ON is not set 1535# CONFIG_SLUB_DEBUG_ON is not set
1524# CONFIG_SLUB_STATS is not set 1536# CONFIG_SLUB_STATS is not set
1537# CONFIG_DEBUG_KMEMLEAK is not set
1525# CONFIG_DEBUG_RT_MUTEXES is not set 1538# CONFIG_DEBUG_RT_MUTEXES is not set
1526# CONFIG_RT_MUTEX_TESTER is not set 1539# CONFIG_RT_MUTEX_TESTER is not set
1527# CONFIG_DEBUG_SPINLOCK is not set 1540# CONFIG_DEBUG_SPINLOCK is not set
@@ -1541,10 +1554,12 @@ CONFIG_DEBUG_INFO=y
1541# CONFIG_DEBUG_LIST is not set 1554# CONFIG_DEBUG_LIST is not set
1542# CONFIG_DEBUG_SG is not set 1555# CONFIG_DEBUG_SG is not set
1543# CONFIG_DEBUG_NOTIFIERS is not set 1556# CONFIG_DEBUG_NOTIFIERS is not set
1557# CONFIG_DEBUG_CREDENTIALS is not set
1544# CONFIG_RCU_TORTURE_TEST is not set 1558# CONFIG_RCU_TORTURE_TEST is not set
1545# CONFIG_RCU_CPU_STALL_DETECTOR is not set 1559# CONFIG_RCU_CPU_STALL_DETECTOR is not set
1546# CONFIG_BACKTRACE_SELF_TEST is not set 1560# CONFIG_BACKTRACE_SELF_TEST is not set
1547# CONFIG_DEBUG_BLOCK_EXT_DEVT is not set 1561# CONFIG_DEBUG_BLOCK_EXT_DEVT is not set
1562# CONFIG_DEBUG_FORCE_WEAK_PER_CPU is not set
1548# CONFIG_FAULT_INJECTION is not set 1563# CONFIG_FAULT_INJECTION is not set
1549# CONFIG_LATENCYTOP is not set 1564# CONFIG_LATENCYTOP is not set
1550CONFIG_SYSCTL_SYSCALL_CHECK=y 1565CONFIG_SYSCTL_SYSCALL_CHECK=y
@@ -1567,10 +1582,10 @@ CONFIG_BRANCH_PROFILE_NONE=y
1567# CONFIG_KMEMTRACE is not set 1582# CONFIG_KMEMTRACE is not set
1568# CONFIG_WORKQUEUE_TRACER is not set 1583# CONFIG_WORKQUEUE_TRACER is not set
1569# CONFIG_BLK_DEV_IO_TRACE is not set 1584# CONFIG_BLK_DEV_IO_TRACE is not set
1585# CONFIG_DMA_API_DEBUG is not set
1570# CONFIG_SAMPLES is not set 1586# CONFIG_SAMPLES is not set
1571CONFIG_HAVE_ARCH_KGDB=y 1587CONFIG_HAVE_ARCH_KGDB=y
1572# CONFIG_KGDB is not set 1588# CONFIG_KGDB is not set
1573# CONFIG_KMEMCHECK is not set
1574# CONFIG_PPC_DISABLE_WERROR is not set 1589# CONFIG_PPC_DISABLE_WERROR is not set
1575CONFIG_PPC_WERROR=y 1590CONFIG_PPC_WERROR=y
1576CONFIG_PRINT_STACK_DEPTH=64 1591CONFIG_PRINT_STACK_DEPTH=64
@@ -1597,7 +1612,6 @@ CONFIG_CRYPTO=y
1597# 1612#
1598# Crypto core or helper 1613# Crypto core or helper
1599# 1614#
1600# CONFIG_CRYPTO_FIPS is not set
1601# CONFIG_CRYPTO_MANAGER is not set 1615# CONFIG_CRYPTO_MANAGER is not set
1602# CONFIG_CRYPTO_MANAGER2 is not set 1616# CONFIG_CRYPTO_MANAGER2 is not set
1603# CONFIG_CRYPTO_GF128MUL is not set 1617# CONFIG_CRYPTO_GF128MUL is not set
@@ -1629,11 +1643,13 @@ CONFIG_CRYPTO=y
1629# 1643#
1630# CONFIG_CRYPTO_HMAC is not set 1644# CONFIG_CRYPTO_HMAC is not set
1631# CONFIG_CRYPTO_XCBC is not set 1645# CONFIG_CRYPTO_XCBC is not set
1646# CONFIG_CRYPTO_VMAC is not set
1632 1647
1633# 1648#
1634# Digest 1649# Digest
1635# 1650#
1636# CONFIG_CRYPTO_CRC32C is not set 1651# CONFIG_CRYPTO_CRC32C is not set
1652# CONFIG_CRYPTO_GHASH is not set
1637# CONFIG_CRYPTO_MD4 is not set 1653# CONFIG_CRYPTO_MD4 is not set
1638# CONFIG_CRYPTO_MD5 is not set 1654# CONFIG_CRYPTO_MD5 is not set
1639# CONFIG_CRYPTO_MICHAEL_MIC is not set 1655# CONFIG_CRYPTO_MICHAEL_MIC is not set
diff --git a/arch/powerpc/configs/86xx/mpc8641_hpcn_defconfig b/arch/powerpc/configs/86xx/mpc8641_hpcn_defconfig
index 7016ce732605..754a79ba74a9 100644
--- a/arch/powerpc/configs/86xx/mpc8641_hpcn_defconfig
+++ b/arch/powerpc/configs/86xx/mpc8641_hpcn_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.31-rc4 3# Linux kernel version: 2.6.32-rc5
4# Wed Jul 29 23:32:28 2009 4# Thu Nov 5 08:20:46 2009
5# 5#
6# CONFIG_PPC64 is not set 6# CONFIG_PPC64 is not set
7 7
@@ -36,6 +36,7 @@ CONFIG_GENERIC_CLOCKEVENTS=y
36CONFIG_GENERIC_HARDIRQS=y 36CONFIG_GENERIC_HARDIRQS=y
37CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y 37CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y
38# CONFIG_HAVE_SETUP_PER_CPU_AREA is not set 38# CONFIG_HAVE_SETUP_PER_CPU_AREA is not set
39# CONFIG_NEED_PER_CPU_EMBED_FIRST_CHUNK 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
@@ -87,11 +88,12 @@ CONFIG_AUDIT=y
87# 88#
88# RCU Subsystem 89# RCU Subsystem
89# 90#
90CONFIG_CLASSIC_RCU=y 91CONFIG_TREE_RCU=y
91# CONFIG_TREE_RCU is not set 92# CONFIG_TREE_PREEMPT_RCU is not set
92# CONFIG_PREEMPT_RCU is not set 93# CONFIG_RCU_TRACE is not set
94CONFIG_RCU_FANOUT=32
95# CONFIG_RCU_FANOUT_EXACT is not set
93# CONFIG_TREE_RCU_TRACE is not set 96# CONFIG_TREE_RCU_TRACE is not set
94# CONFIG_PREEMPT_RCU_TRACE is not set
95CONFIG_IKCONFIG=y 97CONFIG_IKCONFIG=y
96CONFIG_IKCONFIG_PROC=y 98CONFIG_IKCONFIG_PROC=y
97CONFIG_LOG_BUF_SHIFT=14 99CONFIG_LOG_BUF_SHIFT=14
@@ -130,22 +132,21 @@ CONFIG_TIMERFD=y
130CONFIG_EVENTFD=y 132CONFIG_EVENTFD=y
131CONFIG_SHMEM=y 133CONFIG_SHMEM=y
132CONFIG_AIO=y 134CONFIG_AIO=y
133CONFIG_HAVE_PERF_COUNTERS=y 135CONFIG_HAVE_PERF_EVENTS=y
134 136
135# 137#
136# Performance Counters 138# Kernel Performance Events And Counters
137# 139#
140# CONFIG_PERF_EVENTS is not set
138# CONFIG_PERF_COUNTERS is not set 141# CONFIG_PERF_COUNTERS is not set
139CONFIG_VM_EVENT_COUNTERS=y 142CONFIG_VM_EVENT_COUNTERS=y
140CONFIG_PCI_QUIRKS=y 143CONFIG_PCI_QUIRKS=y
141CONFIG_SLUB_DEBUG=y 144CONFIG_SLUB_DEBUG=y
142# CONFIG_STRIP_ASM_SYMS is not set
143CONFIG_COMPAT_BRK=y 145CONFIG_COMPAT_BRK=y
144# CONFIG_SLAB is not set 146# CONFIG_SLAB is not set
145CONFIG_SLUB=y 147CONFIG_SLUB=y
146# CONFIG_SLOB is not set 148# CONFIG_SLOB is not set
147# CONFIG_PROFILING is not set 149# CONFIG_PROFILING is not set
148# CONFIG_MARKERS is not set
149CONFIG_HAVE_OPROFILE=y 150CONFIG_HAVE_OPROFILE=y
150# CONFIG_KPROBES is not set 151# CONFIG_KPROBES is not set
151CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS=y 152CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS=y
@@ -153,7 +154,9 @@ CONFIG_HAVE_IOREMAP_PROT=y
153CONFIG_HAVE_KPROBES=y 154CONFIG_HAVE_KPROBES=y
154CONFIG_HAVE_KRETPROBES=y 155CONFIG_HAVE_KRETPROBES=y
155CONFIG_HAVE_ARCH_TRACEHOOK=y 156CONFIG_HAVE_ARCH_TRACEHOOK=y
157CONFIG_HAVE_DMA_ATTRS=y
156CONFIG_USE_GENERIC_SMP_HELPERS=y 158CONFIG_USE_GENERIC_SMP_HELPERS=y
159CONFIG_HAVE_DMA_API_DEBUG=y
157 160
158# 161#
159# GCOV-based kernel profiling 162# GCOV-based kernel profiling
@@ -251,13 +254,13 @@ CONFIG_BINFMT_ELF=y
251CONFIG_BINFMT_MISC=m 254CONFIG_BINFMT_MISC=m
252CONFIG_IOMMU_HELPER=y 255CONFIG_IOMMU_HELPER=y
253CONFIG_SWIOTLB=y 256CONFIG_SWIOTLB=y
254CONFIG_PPC_NEED_DMA_SYNC_OPS=y
255CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y 257CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y
256CONFIG_ARCH_HAS_WALK_MEMORY=y 258CONFIG_ARCH_HAS_WALK_MEMORY=y
257CONFIG_ARCH_ENABLE_MEMORY_HOTREMOVE=y 259CONFIG_ARCH_ENABLE_MEMORY_HOTREMOVE=y
258# CONFIG_KEXEC is not set 260# CONFIG_KEXEC is not set
259# CONFIG_CRASH_DUMP is not set 261# CONFIG_CRASH_DUMP is not set
260# CONFIG_IRQ_ALL_CPUS is not set 262# CONFIG_IRQ_ALL_CPUS is not set
263CONFIG_MAX_ACTIVE_REGIONS=32
261CONFIG_ARCH_FLATMEM_ENABLE=y 264CONFIG_ARCH_FLATMEM_ENABLE=y
262CONFIG_ARCH_POPULATES_NODE_MAP=y 265CONFIG_ARCH_POPULATES_NODE_MAP=y
263CONFIG_SELECT_MEMORY_MODEL=y 266CONFIG_SELECT_MEMORY_MODEL=y
@@ -275,6 +278,7 @@ CONFIG_BOUNCE=y
275CONFIG_VIRT_TO_BUS=y 278CONFIG_VIRT_TO_BUS=y
276CONFIG_HAVE_MLOCK=y 279CONFIG_HAVE_MLOCK=y
277CONFIG_HAVE_MLOCKED_PAGE_BIT=y 280CONFIG_HAVE_MLOCKED_PAGE_BIT=y
281# CONFIG_KSM is not set
278CONFIG_DEFAULT_MMAP_MIN_ADDR=4096 282CONFIG_DEFAULT_MMAP_MIN_ADDR=4096
279CONFIG_PPC_4K_PAGES=y 283CONFIG_PPC_4K_PAGES=y
280# CONFIG_PPC_16K_PAGES is not set 284# CONFIG_PPC_16K_PAGES is not set
@@ -404,6 +408,7 @@ CONFIG_IP_SCTP=m
404# CONFIG_SCTP_HMAC_NONE is not set 408# CONFIG_SCTP_HMAC_NONE is not set
405# CONFIG_SCTP_HMAC_SHA1 is not set 409# CONFIG_SCTP_HMAC_SHA1 is not set
406CONFIG_SCTP_HMAC_MD5=y 410CONFIG_SCTP_HMAC_MD5=y
411# CONFIG_RDS is not set
407# CONFIG_TIPC is not set 412# CONFIG_TIPC is not set
408# CONFIG_ATM is not set 413# CONFIG_ATM is not set
409# CONFIG_BRIDGE is not set 414# CONFIG_BRIDGE is not set
@@ -434,6 +439,7 @@ CONFIG_SCTP_HMAC_MD5=y
434CONFIG_FIB_RULES=y 439CONFIG_FIB_RULES=y
435CONFIG_WIRELESS=y 440CONFIG_WIRELESS=y
436# CONFIG_CFG80211 is not set 441# CONFIG_CFG80211 is not set
442CONFIG_CFG80211_DEFAULT_PS_VALUE=0
437CONFIG_WIRELESS_OLD_REGULATORY=y 443CONFIG_WIRELESS_OLD_REGULATORY=y
438# CONFIG_WIRELESS_EXT is not set 444# CONFIG_WIRELESS_EXT is not set
439# CONFIG_LIB80211 is not set 445# CONFIG_LIB80211 is not set
@@ -441,7 +447,6 @@ CONFIG_WIRELESS_OLD_REGULATORY=y
441# 447#
442# CFG80211 needs to be enabled for MAC80211 448# CFG80211 needs to be enabled for MAC80211
443# 449#
444CONFIG_MAC80211_DEFAULT_PS_VALUE=0
445# CONFIG_WIMAX is not set 450# CONFIG_WIMAX is not set
446# CONFIG_RFKILL is not set 451# CONFIG_RFKILL is not set
447# CONFIG_NET_9P is not set 452# CONFIG_NET_9P is not set
@@ -454,6 +459,7 @@ CONFIG_MAC80211_DEFAULT_PS_VALUE=0
454# Generic Driver Options 459# Generic Driver Options
455# 460#
456CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug" 461CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
462# CONFIG_DEVTMPFS is not set
457CONFIG_STANDALONE=y 463CONFIG_STANDALONE=y
458CONFIG_PREVENT_FIRMWARE_BUILD=y 464CONFIG_PREVENT_FIRMWARE_BUILD=y
459CONFIG_FW_LOADER=y 465CONFIG_FW_LOADER=y
@@ -546,6 +552,7 @@ CONFIG_SCSI_LOWLEVEL=y
546# CONFIG_ISCSI_TCP is not set 552# CONFIG_ISCSI_TCP is not set
547# CONFIG_SCSI_CXGB3_ISCSI is not set 553# CONFIG_SCSI_CXGB3_ISCSI is not set
548# CONFIG_SCSI_BNX2_ISCSI is not set 554# CONFIG_SCSI_BNX2_ISCSI is not set
555# CONFIG_BE2ISCSI is not set
549# CONFIG_BLK_DEV_3W_XXXX_RAID is not set 556# CONFIG_BLK_DEV_3W_XXXX_RAID is not set
550# CONFIG_SCSI_3W_9XXX is not set 557# CONFIG_SCSI_3W_9XXX is not set
551# CONFIG_SCSI_ACARD is not set 558# CONFIG_SCSI_ACARD is not set
@@ -585,11 +592,14 @@ CONFIG_SCSI_LOWLEVEL=y
585# CONFIG_SCSI_DC390T is not set 592# CONFIG_SCSI_DC390T is not set
586# CONFIG_SCSI_NSP32 is not set 593# CONFIG_SCSI_NSP32 is not set
587# CONFIG_SCSI_DEBUG is not set 594# CONFIG_SCSI_DEBUG is not set
595# CONFIG_SCSI_PMCRAID is not set
588# CONFIG_SCSI_SRP is not set 596# CONFIG_SCSI_SRP is not set
597# CONFIG_SCSI_BFA_FC is not set
589# CONFIG_SCSI_DH is not set 598# CONFIG_SCSI_DH is not set
590# CONFIG_SCSI_OSD_INITIATOR is not set 599# CONFIG_SCSI_OSD_INITIATOR is not set
591CONFIG_ATA=y 600CONFIG_ATA=y
592# CONFIG_ATA_NONSTANDARD is not set 601# CONFIG_ATA_NONSTANDARD is not set
602CONFIG_ATA_VERBOSE_ERROR=y
593CONFIG_SATA_PMP=y 603CONFIG_SATA_PMP=y
594CONFIG_SATA_AHCI=y 604CONFIG_SATA_AHCI=y
595# CONFIG_SATA_SIL24 is not set 605# CONFIG_SATA_SIL24 is not set
@@ -612,6 +622,7 @@ CONFIG_ATA_SFF=y
612CONFIG_PATA_ALI=y 622CONFIG_PATA_ALI=y
613# CONFIG_PATA_AMD is not set 623# CONFIG_PATA_AMD is not set
614# CONFIG_PATA_ARTOP is not set 624# CONFIG_PATA_ARTOP is not set
625# CONFIG_PATA_ATP867X is not set
615# CONFIG_PATA_ATIIXP is not set 626# CONFIG_PATA_ATIIXP is not set
616# CONFIG_PATA_CMD640_PCI is not set 627# CONFIG_PATA_CMD640_PCI is not set
617# CONFIG_PATA_CMD64X is not set 628# CONFIG_PATA_CMD64X is not set
@@ -639,6 +650,7 @@ CONFIG_PATA_ALI=y
639# CONFIG_PATA_OPTIDMA is not set 650# CONFIG_PATA_OPTIDMA is not set
640# CONFIG_PATA_PDC_OLD is not set 651# CONFIG_PATA_PDC_OLD is not set
641# CONFIG_PATA_RADISYS is not set 652# CONFIG_PATA_RADISYS is not set
653# CONFIG_PATA_RDC is not set
642# CONFIG_PATA_RZ1000 is not set 654# CONFIG_PATA_RZ1000 is not set
643# CONFIG_PATA_SC1200 is not set 655# CONFIG_PATA_SC1200 is not set
644# CONFIG_PATA_SERVERWORKS is not set 656# CONFIG_PATA_SERVERWORKS is not set
@@ -715,7 +727,9 @@ CONFIG_MII=y
715# CONFIG_NET_PCI is not set 727# CONFIG_NET_PCI is not set
716# CONFIG_B44 is not set 728# CONFIG_B44 is not set
717# CONFIG_KS8842 is not set 729# CONFIG_KS8842 is not set
730# CONFIG_KS8851_MLL is not set
718# CONFIG_ATL2 is not set 731# CONFIG_ATL2 is not set
732# CONFIG_XILINX_EMACLITE is not set
719CONFIG_NETDEV_1000=y 733CONFIG_NETDEV_1000=y
720# CONFIG_ACENIC is not set 734# CONFIG_ACENIC is not set
721# CONFIG_DL2K is not set 735# CONFIG_DL2K is not set
@@ -763,10 +777,7 @@ CONFIG_CHELSIO_T3_DEPENDS=y
763# CONFIG_SFC is not set 777# CONFIG_SFC is not set
764# CONFIG_BE2NET is not set 778# CONFIG_BE2NET is not set
765# CONFIG_TR is not set 779# CONFIG_TR is not set
766 780CONFIG_WLAN=y
767#
768# Wireless LAN
769#
770# CONFIG_WLAN_PRE80211 is not set 781# CONFIG_WLAN_PRE80211 is not set
771# CONFIG_WLAN_80211 is not set 782# CONFIG_WLAN_80211 is not set
772 783
@@ -880,6 +891,7 @@ CONFIG_NVRAM=y
880CONFIG_DEVPORT=y 891CONFIG_DEVPORT=y
881CONFIG_I2C=y 892CONFIG_I2C=y
882CONFIG_I2C_BOARDINFO=y 893CONFIG_I2C_BOARDINFO=y
894CONFIG_I2C_COMPAT=y
883# CONFIG_I2C_CHARDEV is not set 895# CONFIG_I2C_CHARDEV is not set
884CONFIG_I2C_HELPER_AUTO=y 896CONFIG_I2C_HELPER_AUTO=y
885 897
@@ -934,9 +946,6 @@ CONFIG_I2C_MPC=y
934# Miscellaneous I2C Chip support 946# Miscellaneous I2C Chip support
935# 947#
936# CONFIG_DS1682 is not set 948# CONFIG_DS1682 is not set
937# CONFIG_SENSORS_PCF8574 is not set
938# CONFIG_PCF8575 is not set
939# CONFIG_SENSORS_PCA9539 is not set
940# CONFIG_SENSORS_TSL2550 is not set 949# CONFIG_SENSORS_TSL2550 is not set
941# CONFIG_I2C_DEBUG_CORE is not set 950# CONFIG_I2C_DEBUG_CORE is not set
942# CONFIG_I2C_DEBUG_ALGO is not set 951# CONFIG_I2C_DEBUG_ALGO is not set
@@ -954,7 +963,6 @@ CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y
954# CONFIG_POWER_SUPPLY is not set 963# CONFIG_POWER_SUPPLY is not set
955# CONFIG_HWMON is not set 964# CONFIG_HWMON is not set
956# CONFIG_THERMAL is not set 965# CONFIG_THERMAL is not set
957# CONFIG_THERMAL_HWMON is not set
958# CONFIG_WATCHDOG is not set 966# CONFIG_WATCHDOG is not set
959CONFIG_SSB_POSSIBLE=y 967CONFIG_SSB_POSSIBLE=y
960 968
@@ -973,6 +981,7 @@ CONFIG_SSB_POSSIBLE=y
973# CONFIG_MFD_TMIO is not set 981# CONFIG_MFD_TMIO is not set
974# CONFIG_PMIC_DA903X is not set 982# CONFIG_PMIC_DA903X is not set
975# CONFIG_MFD_WM8400 is not set 983# CONFIG_MFD_WM8400 is not set
984# CONFIG_MFD_WM831X is not set
976# CONFIG_MFD_WM8350_I2C is not set 985# CONFIG_MFD_WM8350_I2C is not set
977# CONFIG_MFD_PCF50633 is not set 986# CONFIG_MFD_PCF50633 is not set
978# CONFIG_AB3100_CORE is not set 987# CONFIG_AB3100_CORE is not set
@@ -983,6 +992,7 @@ CONFIG_SSB_POSSIBLE=y
983# Graphics support 992# Graphics support
984# 993#
985# CONFIG_AGP is not set 994# CONFIG_AGP is not set
995CONFIG_VGA_ARB=y
986# CONFIG_DRM is not set 996# CONFIG_DRM is not set
987# CONFIG_VGASTATE is not set 997# CONFIG_VGASTATE is not set
988CONFIG_VIDEO_OUTPUT_CONTROL=y 998CONFIG_VIDEO_OUTPUT_CONTROL=y
@@ -1002,6 +1012,7 @@ CONFIG_VGA_CONSOLE=y
1002CONFIG_DUMMY_CONSOLE=y 1012CONFIG_DUMMY_CONSOLE=y
1003CONFIG_SOUND=y 1013CONFIG_SOUND=y
1004CONFIG_SOUND_OSS_CORE=y 1014CONFIG_SOUND_OSS_CORE=y
1015CONFIG_SOUND_OSS_CORE_PRECLAIM=y
1005CONFIG_SND=y 1016CONFIG_SND=y
1006CONFIG_SND_TIMER=y 1017CONFIG_SND_TIMER=y
1007CONFIG_SND_PCM=y 1018CONFIG_SND_PCM=y
@@ -1105,7 +1116,6 @@ CONFIG_SND_USB=y
1105CONFIG_AC97_BUS=y 1116CONFIG_AC97_BUS=y
1106CONFIG_HID_SUPPORT=y 1117CONFIG_HID_SUPPORT=y
1107CONFIG_HID=y 1118CONFIG_HID=y
1108# CONFIG_HID_DEBUG is not set
1109# CONFIG_HIDRAW is not set 1119# CONFIG_HIDRAW is not set
1110 1120
1111# 1121#
@@ -1128,6 +1138,7 @@ CONFIG_HID_CYPRESS=y
1128CONFIG_HID_EZKEY=y 1138CONFIG_HID_EZKEY=y
1129# CONFIG_HID_KYE is not set 1139# CONFIG_HID_KYE is not set
1130CONFIG_HID_GYRATION=y 1140CONFIG_HID_GYRATION=y
1141# CONFIG_HID_TWINHAN is not set
1131# CONFIG_HID_KENSINGTON is not set 1142# CONFIG_HID_KENSINGTON is not set
1132CONFIG_HID_LOGITECH=y 1143CONFIG_HID_LOGITECH=y
1133# CONFIG_LOGITECH_FF is not set 1144# CONFIG_LOGITECH_FF is not set
@@ -1180,6 +1191,7 @@ CONFIG_USB_EHCI_HCD_PPC_OF=y
1180# CONFIG_USB_OXU210HP_HCD is not set 1191# CONFIG_USB_OXU210HP_HCD is not set
1181# CONFIG_USB_ISP116X_HCD is not set 1192# CONFIG_USB_ISP116X_HCD is not set
1182# CONFIG_USB_ISP1760_HCD is not set 1193# CONFIG_USB_ISP1760_HCD is not set
1194# CONFIG_USB_ISP1362_HCD is not set
1183CONFIG_USB_OHCI_HCD=y 1195CONFIG_USB_OHCI_HCD=y
1184CONFIG_USB_OHCI_HCD_PPC_OF_BE=y 1196CONFIG_USB_OHCI_HCD_PPC_OF_BE=y
1185CONFIG_USB_OHCI_HCD_PPC_OF_LE=y 1197CONFIG_USB_OHCI_HCD_PPC_OF_LE=y
@@ -1358,6 +1370,7 @@ CONFIG_FS_MBCACHE=y
1358# CONFIG_GFS2_FS is not set 1370# CONFIG_GFS2_FS is not set
1359# CONFIG_OCFS2_FS is not set 1371# CONFIG_OCFS2_FS is not set
1360# CONFIG_BTRFS_FS is not set 1372# CONFIG_BTRFS_FS is not set
1373# CONFIG_NILFS2_FS is not set
1361CONFIG_FILE_LOCKING=y 1374CONFIG_FILE_LOCKING=y
1362CONFIG_FSNOTIFY=y 1375CONFIG_FSNOTIFY=y
1363CONFIG_DNOTIFY=y 1376CONFIG_DNOTIFY=y
@@ -1428,7 +1441,6 @@ CONFIG_SYSV_FS=m
1428CONFIG_UFS_FS=m 1441CONFIG_UFS_FS=m
1429# CONFIG_UFS_FS_WRITE is not set 1442# CONFIG_UFS_FS_WRITE is not set
1430# CONFIG_UFS_DEBUG is not set 1443# CONFIG_UFS_DEBUG is not set
1431# CONFIG_NILFS2_FS is not set
1432CONFIG_NETWORK_FILESYSTEMS=y 1444CONFIG_NETWORK_FILESYSTEMS=y
1433CONFIG_NFS_FS=y 1445CONFIG_NFS_FS=y
1434CONFIG_NFS_V3=y 1446CONFIG_NFS_V3=y
@@ -1546,6 +1558,7 @@ CONFIG_ENABLE_WARN_DEPRECATED=y
1546CONFIG_ENABLE_MUST_CHECK=y 1558CONFIG_ENABLE_MUST_CHECK=y
1547CONFIG_FRAME_WARN=1024 1559CONFIG_FRAME_WARN=1024
1548# CONFIG_MAGIC_SYSRQ is not set 1560# CONFIG_MAGIC_SYSRQ is not set
1561# CONFIG_STRIP_ASM_SYMS is not set
1549# CONFIG_UNUSED_SYMBOLS is not set 1562# CONFIG_UNUSED_SYMBOLS is not set
1550# CONFIG_DEBUG_FS is not set 1563# CONFIG_DEBUG_FS is not set
1551# CONFIG_HEADERS_CHECK is not set 1564# CONFIG_HEADERS_CHECK is not set
@@ -1563,6 +1576,7 @@ CONFIG_SCHED_DEBUG=y
1563# CONFIG_DEBUG_OBJECTS is not set 1576# CONFIG_DEBUG_OBJECTS is not set
1564# CONFIG_SLUB_DEBUG_ON is not set 1577# CONFIG_SLUB_DEBUG_ON is not set
1565# CONFIG_SLUB_STATS is not set 1578# CONFIG_SLUB_STATS is not set
1579# CONFIG_DEBUG_KMEMLEAK is not set
1566# CONFIG_DEBUG_RT_MUTEXES is not set 1580# CONFIG_DEBUG_RT_MUTEXES is not set
1567# CONFIG_RT_MUTEX_TESTER is not set 1581# CONFIG_RT_MUTEX_TESTER is not set
1568# CONFIG_DEBUG_SPINLOCK is not set 1582# CONFIG_DEBUG_SPINLOCK is not set
@@ -1582,10 +1596,12 @@ CONFIG_DEBUG_INFO=y
1582# CONFIG_DEBUG_LIST is not set 1596# CONFIG_DEBUG_LIST is not set
1583# CONFIG_DEBUG_SG is not set 1597# CONFIG_DEBUG_SG is not set
1584# CONFIG_DEBUG_NOTIFIERS is not set 1598# CONFIG_DEBUG_NOTIFIERS is not set
1599# CONFIG_DEBUG_CREDENTIALS is not set
1585# CONFIG_RCU_TORTURE_TEST is not set 1600# CONFIG_RCU_TORTURE_TEST is not set
1586# CONFIG_RCU_CPU_STALL_DETECTOR is not set 1601# CONFIG_RCU_CPU_STALL_DETECTOR is not set
1587# CONFIG_BACKTRACE_SELF_TEST is not set 1602# CONFIG_BACKTRACE_SELF_TEST is not set
1588# CONFIG_DEBUG_BLOCK_EXT_DEVT is not set 1603# CONFIG_DEBUG_BLOCK_EXT_DEVT is not set
1604# CONFIG_DEBUG_FORCE_WEAK_PER_CPU is not set
1589# CONFIG_FAULT_INJECTION is not set 1605# CONFIG_FAULT_INJECTION is not set
1590# CONFIG_LATENCYTOP is not set 1606# CONFIG_LATENCYTOP is not set
1591CONFIG_SYSCTL_SYSCALL_CHECK=y 1607CONFIG_SYSCTL_SYSCALL_CHECK=y
@@ -1608,10 +1624,10 @@ CONFIG_BRANCH_PROFILE_NONE=y
1608# CONFIG_KMEMTRACE is not set 1624# CONFIG_KMEMTRACE is not set
1609# CONFIG_WORKQUEUE_TRACER is not set 1625# CONFIG_WORKQUEUE_TRACER is not set
1610# CONFIG_BLK_DEV_IO_TRACE is not set 1626# CONFIG_BLK_DEV_IO_TRACE is not set
1627# CONFIG_DMA_API_DEBUG is not set
1611# CONFIG_SAMPLES is not set 1628# CONFIG_SAMPLES is not set
1612CONFIG_HAVE_ARCH_KGDB=y 1629CONFIG_HAVE_ARCH_KGDB=y
1613# CONFIG_KGDB is not set 1630# CONFIG_KGDB is not set
1614# CONFIG_KMEMCHECK is not set
1615# CONFIG_PPC_DISABLE_WERROR is not set 1631# CONFIG_PPC_DISABLE_WERROR is not set
1616CONFIG_PPC_WERROR=y 1632CONFIG_PPC_WERROR=y
1617CONFIG_PRINT_STACK_DEPTH=64 1633CONFIG_PRINT_STACK_DEPTH=64
@@ -1638,7 +1654,6 @@ CONFIG_CRYPTO=y
1638# 1654#
1639# Crypto core or helper 1655# Crypto core or helper
1640# 1656#
1641# CONFIG_CRYPTO_FIPS is not set
1642CONFIG_CRYPTO_ALGAPI=y 1657CONFIG_CRYPTO_ALGAPI=y
1643CONFIG_CRYPTO_ALGAPI2=y 1658CONFIG_CRYPTO_ALGAPI2=y
1644CONFIG_CRYPTO_AEAD2=y 1659CONFIG_CRYPTO_AEAD2=y
@@ -1680,11 +1695,13 @@ CONFIG_CRYPTO_PCBC=m
1680# 1695#
1681CONFIG_CRYPTO_HMAC=y 1696CONFIG_CRYPTO_HMAC=y
1682# CONFIG_CRYPTO_XCBC is not set 1697# CONFIG_CRYPTO_XCBC is not set
1698# CONFIG_CRYPTO_VMAC is not set
1683 1699
1684# 1700#
1685# Digest 1701# Digest
1686# 1702#
1687CONFIG_CRYPTO_CRC32C=m 1703CONFIG_CRYPTO_CRC32C=m
1704# CONFIG_CRYPTO_GHASH is not set
1688# CONFIG_CRYPTO_MD4 is not set 1705# CONFIG_CRYPTO_MD4 is not set
1689CONFIG_CRYPTO_MD5=y 1706CONFIG_CRYPTO_MD5=y
1690# CONFIG_CRYPTO_MICHAEL_MIC is not set 1707# CONFIG_CRYPTO_MICHAEL_MIC is not set
diff --git a/arch/powerpc/configs/86xx/sbc8641d_defconfig b/arch/powerpc/configs/86xx/sbc8641d_defconfig
index f5ca2e0cd402..89991f157ae8 100644
--- a/arch/powerpc/configs/86xx/sbc8641d_defconfig
+++ b/arch/powerpc/configs/86xx/sbc8641d_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.31-rc4 3# Linux kernel version: 2.6.32-rc5
4# Wed Jul 29 23:32:26 2009 4# Thu Nov 5 08:20:45 2009
5# 5#
6# CONFIG_PPC64 is not set 6# CONFIG_PPC64 is not set
7 7
@@ -36,6 +36,7 @@ CONFIG_GENERIC_CLOCKEVENTS=y
36CONFIG_GENERIC_HARDIRQS=y 36CONFIG_GENERIC_HARDIRQS=y
37CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y 37CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y
38# CONFIG_HAVE_SETUP_PER_CPU_AREA is not set 38# CONFIG_HAVE_SETUP_PER_CPU_AREA is not set
39# CONFIG_NEED_PER_CPU_EMBED_FIRST_CHUNK 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
@@ -87,11 +88,12 @@ CONFIG_BSD_PROCESS_ACCT_V3=y
87# 88#
88# RCU Subsystem 89# RCU Subsystem
89# 90#
90CONFIG_CLASSIC_RCU=y 91CONFIG_TREE_RCU=y
91# CONFIG_TREE_RCU is not set 92# CONFIG_TREE_PREEMPT_RCU is not set
92# CONFIG_PREEMPT_RCU is not set 93# CONFIG_RCU_TRACE is not set
94CONFIG_RCU_FANOUT=32
95# CONFIG_RCU_FANOUT_EXACT is not set
93# CONFIG_TREE_RCU_TRACE is not set 96# CONFIG_TREE_RCU_TRACE is not set
94# CONFIG_PREEMPT_RCU_TRACE is not set
95CONFIG_IKCONFIG=y 97CONFIG_IKCONFIG=y
96CONFIG_IKCONFIG_PROC=y 98CONFIG_IKCONFIG_PROC=y
97CONFIG_LOG_BUF_SHIFT=14 99CONFIG_LOG_BUF_SHIFT=14
@@ -130,21 +132,20 @@ CONFIG_TIMERFD=y
130CONFIG_EVENTFD=y 132CONFIG_EVENTFD=y
131CONFIG_SHMEM=y 133CONFIG_SHMEM=y
132CONFIG_AIO=y 134CONFIG_AIO=y
133CONFIG_HAVE_PERF_COUNTERS=y 135CONFIG_HAVE_PERF_EVENTS=y
134 136
135# 137#
136# Performance Counters 138# Kernel Performance Events And Counters
137# 139#
140# CONFIG_PERF_EVENTS is not set
138# CONFIG_PERF_COUNTERS is not set 141# CONFIG_PERF_COUNTERS is not set
139CONFIG_VM_EVENT_COUNTERS=y 142CONFIG_VM_EVENT_COUNTERS=y
140CONFIG_PCI_QUIRKS=y 143CONFIG_PCI_QUIRKS=y
141# CONFIG_STRIP_ASM_SYMS is not set
142CONFIG_COMPAT_BRK=y 144CONFIG_COMPAT_BRK=y
143CONFIG_SLAB=y 145CONFIG_SLAB=y
144# CONFIG_SLUB is not set 146# CONFIG_SLUB is not set
145# CONFIG_SLOB is not set 147# CONFIG_SLOB is not set
146# CONFIG_PROFILING is not set 148# CONFIG_PROFILING is not set
147# CONFIG_MARKERS is not set
148CONFIG_HAVE_OPROFILE=y 149CONFIG_HAVE_OPROFILE=y
149# CONFIG_KPROBES is not set 150# CONFIG_KPROBES is not set
150CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS=y 151CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS=y
@@ -152,13 +153,15 @@ CONFIG_HAVE_IOREMAP_PROT=y
152CONFIG_HAVE_KPROBES=y 153CONFIG_HAVE_KPROBES=y
153CONFIG_HAVE_KRETPROBES=y 154CONFIG_HAVE_KRETPROBES=y
154CONFIG_HAVE_ARCH_TRACEHOOK=y 155CONFIG_HAVE_ARCH_TRACEHOOK=y
156CONFIG_HAVE_DMA_ATTRS=y
155CONFIG_USE_GENERIC_SMP_HELPERS=y 157CONFIG_USE_GENERIC_SMP_HELPERS=y
158CONFIG_HAVE_DMA_API_DEBUG=y
156 159
157# 160#
158# GCOV-based kernel profiling 161# GCOV-based kernel profiling
159# 162#
160# CONFIG_GCOV_KERNEL is not set 163# CONFIG_GCOV_KERNEL is not set
161# CONFIG_SLOW_WORK is not set 164CONFIG_SLOW_WORK=y
162# CONFIG_HAVE_GENERIC_DMA_COHERENT is not set 165# CONFIG_HAVE_GENERIC_DMA_COHERENT is not set
163CONFIG_SLABINFO=y 166CONFIG_SLABINFO=y
164CONFIG_RT_MUTEXES=y 167CONFIG_RT_MUTEXES=y
@@ -257,6 +260,7 @@ CONFIG_ARCH_ENABLE_MEMORY_HOTREMOVE=y
257# CONFIG_KEXEC is not set 260# CONFIG_KEXEC is not set
258# CONFIG_CRASH_DUMP is not set 261# CONFIG_CRASH_DUMP is not set
259CONFIG_IRQ_ALL_CPUS=y 262CONFIG_IRQ_ALL_CPUS=y
263CONFIG_MAX_ACTIVE_REGIONS=32
260CONFIG_ARCH_FLATMEM_ENABLE=y 264CONFIG_ARCH_FLATMEM_ENABLE=y
261CONFIG_ARCH_POPULATES_NODE_MAP=y 265CONFIG_ARCH_POPULATES_NODE_MAP=y
262CONFIG_SELECT_MEMORY_MODEL=y 266CONFIG_SELECT_MEMORY_MODEL=y
@@ -274,6 +278,7 @@ CONFIG_BOUNCE=y
274CONFIG_VIRT_TO_BUS=y 278CONFIG_VIRT_TO_BUS=y
275CONFIG_HAVE_MLOCK=y 279CONFIG_HAVE_MLOCK=y
276CONFIG_HAVE_MLOCKED_PAGE_BIT=y 280CONFIG_HAVE_MLOCKED_PAGE_BIT=y
281# CONFIG_KSM is not set
277CONFIG_DEFAULT_MMAP_MIN_ADDR=4096 282CONFIG_DEFAULT_MMAP_MIN_ADDR=4096
278CONFIG_PPC_4K_PAGES=y 283CONFIG_PPC_4K_PAGES=y
279# CONFIG_PPC_16K_PAGES is not set 284# CONFIG_PPC_16K_PAGES is not set
@@ -502,6 +507,7 @@ CONFIG_IP_SCTP=m
502# CONFIG_SCTP_HMAC_NONE is not set 507# CONFIG_SCTP_HMAC_NONE is not set
503# CONFIG_SCTP_HMAC_SHA1 is not set 508# CONFIG_SCTP_HMAC_SHA1 is not set
504CONFIG_SCTP_HMAC_MD5=y 509CONFIG_SCTP_HMAC_MD5=y
510# CONFIG_RDS is not set
505CONFIG_TIPC=m 511CONFIG_TIPC=m
506# CONFIG_TIPC_ADVANCED is not set 512# CONFIG_TIPC_ADVANCED is not set
507# CONFIG_TIPC_DEBUG is not set 513# CONFIG_TIPC_DEBUG is not set
@@ -581,6 +587,7 @@ CONFIG_NET_PKTGEN=m
581CONFIG_FIB_RULES=y 587CONFIG_FIB_RULES=y
582CONFIG_WIRELESS=y 588CONFIG_WIRELESS=y
583# CONFIG_CFG80211 is not set 589# CONFIG_CFG80211 is not set
590CONFIG_CFG80211_DEFAULT_PS_VALUE=0
584CONFIG_WIRELESS_OLD_REGULATORY=y 591CONFIG_WIRELESS_OLD_REGULATORY=y
585# CONFIG_WIRELESS_EXT is not set 592# CONFIG_WIRELESS_EXT is not set
586# CONFIG_LIB80211 is not set 593# CONFIG_LIB80211 is not set
@@ -588,7 +595,6 @@ CONFIG_WIRELESS_OLD_REGULATORY=y
588# 595#
589# CFG80211 needs to be enabled for MAC80211 596# CFG80211 needs to be enabled for MAC80211
590# 597#
591CONFIG_MAC80211_DEFAULT_PS_VALUE=0
592# CONFIG_WIMAX is not set 598# CONFIG_WIMAX is not set
593# CONFIG_RFKILL is not set 599# CONFIG_RFKILL is not set
594# CONFIG_NET_9P is not set 600# CONFIG_NET_9P is not set
@@ -601,6 +607,7 @@ CONFIG_MAC80211_DEFAULT_PS_VALUE=0
601# Generic Driver Options 607# Generic Driver Options
602# 608#
603CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug" 609CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
610# CONFIG_DEVTMPFS is not set
604CONFIG_STANDALONE=y 611CONFIG_STANDALONE=y
605CONFIG_PREVENT_FIRMWARE_BUILD=y 612CONFIG_PREVENT_FIRMWARE_BUILD=y
606# CONFIG_FW_LOADER is not set 613# CONFIG_FW_LOADER is not set
@@ -610,9 +617,9 @@ CONFIG_PREVENT_FIRMWARE_BUILD=y
610# CONFIG_CONNECTOR is not set 617# CONFIG_CONNECTOR is not set
611CONFIG_MTD=y 618CONFIG_MTD=y
612# CONFIG_MTD_DEBUG is not set 619# CONFIG_MTD_DEBUG is not set
620# CONFIG_MTD_TESTS is not set
613CONFIG_MTD_CONCAT=y 621CONFIG_MTD_CONCAT=y
614CONFIG_MTD_PARTITIONS=y 622CONFIG_MTD_PARTITIONS=y
615# CONFIG_MTD_TESTS is not set
616# CONFIG_MTD_REDBOOT_PARTS is not set 623# CONFIG_MTD_REDBOOT_PARTS is not set
617# CONFIG_MTD_CMDLINE_PARTS is not set 624# CONFIG_MTD_CMDLINE_PARTS is not set
618# CONFIG_MTD_OF_PARTS is not set 625# CONFIG_MTD_OF_PARTS is not set
@@ -833,7 +840,9 @@ CONFIG_MII=y
833# CONFIG_NET_PCI is not set 840# CONFIG_NET_PCI is not set
834# CONFIG_B44 is not set 841# CONFIG_B44 is not set
835# CONFIG_KS8842 is not set 842# CONFIG_KS8842 is not set
843# CONFIG_KS8851_MLL is not set
836# CONFIG_ATL2 is not set 844# CONFIG_ATL2 is not set
845# CONFIG_XILINX_EMACLITE is not set
837CONFIG_NETDEV_1000=y 846CONFIG_NETDEV_1000=y
838# CONFIG_ACENIC is not set 847# CONFIG_ACENIC is not set
839# CONFIG_DL2K is not set 848# CONFIG_DL2K is not set
@@ -863,10 +872,7 @@ CONFIG_GIANFAR=y
863# CONFIG_JME is not set 872# CONFIG_JME is not set
864# CONFIG_NETDEV_10000 is not set 873# CONFIG_NETDEV_10000 is not set
865# CONFIG_TR is not set 874# CONFIG_TR is not set
866 875CONFIG_WLAN=y
867#
868# Wireless LAN
869#
870# CONFIG_WLAN_PRE80211 is not set 876# CONFIG_WLAN_PRE80211 is not set
871# CONFIG_WLAN_80211 is not set 877# CONFIG_WLAN_80211 is not set
872 878
@@ -996,6 +1002,7 @@ CONFIG_HW_RANDOM=m
996CONFIG_DEVPORT=y 1002CONFIG_DEVPORT=y
997CONFIG_I2C=y 1003CONFIG_I2C=y
998CONFIG_I2C_BOARDINFO=y 1004CONFIG_I2C_BOARDINFO=y
1005CONFIG_I2C_COMPAT=y
999CONFIG_I2C_CHARDEV=y 1006CONFIG_I2C_CHARDEV=y
1000CONFIG_I2C_HELPER_AUTO=y 1007CONFIG_I2C_HELPER_AUTO=y
1001 1008
@@ -1049,9 +1056,6 @@ CONFIG_I2C_MPC=y
1049# Miscellaneous I2C Chip support 1056# Miscellaneous I2C Chip support
1050# 1057#
1051# CONFIG_DS1682 is not set 1058# CONFIG_DS1682 is not set
1052# CONFIG_SENSORS_PCF8574 is not set
1053# CONFIG_PCF8575 is not set
1054# CONFIG_SENSORS_PCA9539 is not set
1055# CONFIG_SENSORS_TSL2550 is not set 1059# CONFIG_SENSORS_TSL2550 is not set
1056# CONFIG_I2C_DEBUG_CORE is not set 1060# CONFIG_I2C_DEBUG_CORE is not set
1057# CONFIG_I2C_DEBUG_ALGO is not set 1061# CONFIG_I2C_DEBUG_ALGO is not set
@@ -1069,6 +1073,11 @@ CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y
1069# CONFIG_POWER_SUPPLY is not set 1073# CONFIG_POWER_SUPPLY is not set
1070CONFIG_HWMON=y 1074CONFIG_HWMON=y
1071# CONFIG_HWMON_VID is not set 1075# CONFIG_HWMON_VID is not set
1076# CONFIG_HWMON_DEBUG_CHIP is not set
1077
1078#
1079# Native drivers
1080#
1072# CONFIG_SENSORS_AD7414 is not set 1081# CONFIG_SENSORS_AD7414 is not set
1073# CONFIG_SENSORS_AD7418 is not set 1082# CONFIG_SENSORS_AD7418 is not set
1074# CONFIG_SENSORS_ADM1021 is not set 1083# CONFIG_SENSORS_ADM1021 is not set
@@ -1118,6 +1127,7 @@ CONFIG_HWMON=y
1118# CONFIG_SENSORS_ADS7828 is not set 1127# CONFIG_SENSORS_ADS7828 is not set
1119# CONFIG_SENSORS_THMC50 is not set 1128# CONFIG_SENSORS_THMC50 is not set
1120# CONFIG_SENSORS_TMP401 is not set 1129# CONFIG_SENSORS_TMP401 is not set
1130# CONFIG_SENSORS_TMP421 is not set
1121# CONFIG_SENSORS_VIA686A is not set 1131# CONFIG_SENSORS_VIA686A is not set
1122# CONFIG_SENSORS_VT1211 is not set 1132# CONFIG_SENSORS_VT1211 is not set
1123# CONFIG_SENSORS_VT8231 is not set 1133# CONFIG_SENSORS_VT8231 is not set
@@ -1129,9 +1139,7 @@ CONFIG_HWMON=y
1129# CONFIG_SENSORS_W83L786NG is not set 1139# CONFIG_SENSORS_W83L786NG is not set
1130# CONFIG_SENSORS_W83627HF is not set 1140# CONFIG_SENSORS_W83627HF is not set
1131# CONFIG_SENSORS_W83627EHF is not set 1141# CONFIG_SENSORS_W83627EHF is not set
1132# CONFIG_HWMON_DEBUG_CHIP is not set
1133# CONFIG_THERMAL is not set 1142# CONFIG_THERMAL is not set
1134# CONFIG_THERMAL_HWMON is not set
1135CONFIG_WATCHDOG=y 1143CONFIG_WATCHDOG=y
1136# CONFIG_WATCHDOG_NOWAYOUT is not set 1144# CONFIG_WATCHDOG_NOWAYOUT is not set
1137 1145
@@ -1164,6 +1172,7 @@ CONFIG_SSB_POSSIBLE=y
1164# CONFIG_MFD_TMIO is not set 1172# CONFIG_MFD_TMIO is not set
1165# CONFIG_PMIC_DA903X is not set 1173# CONFIG_PMIC_DA903X is not set
1166# CONFIG_MFD_WM8400 is not set 1174# CONFIG_MFD_WM8400 is not set
1175# CONFIG_MFD_WM831X is not set
1167# CONFIG_MFD_WM8350_I2C is not set 1176# CONFIG_MFD_WM8350_I2C is not set
1168# CONFIG_MFD_PCF50633 is not set 1177# CONFIG_MFD_PCF50633 is not set
1169# CONFIG_AB3100_CORE is not set 1178# CONFIG_AB3100_CORE is not set
@@ -1174,6 +1183,7 @@ CONFIG_SSB_POSSIBLE=y
1174# Graphics support 1183# Graphics support
1175# 1184#
1176# CONFIG_AGP is not set 1185# CONFIG_AGP is not set
1186CONFIG_VGA_ARB=y
1177# CONFIG_DRM is not set 1187# CONFIG_DRM is not set
1178# CONFIG_VGASTATE is not set 1188# CONFIG_VGASTATE is not set
1179CONFIG_VIDEO_OUTPUT_CONTROL=m 1189CONFIG_VIDEO_OUTPUT_CONTROL=m
@@ -1194,7 +1204,6 @@ CONFIG_DUMMY_CONSOLE=y
1194# CONFIG_SOUND is not set 1204# CONFIG_SOUND is not set
1195CONFIG_HID_SUPPORT=y 1205CONFIG_HID_SUPPORT=y
1196CONFIG_HID=y 1206CONFIG_HID=y
1197# CONFIG_HID_DEBUG is not set
1198# CONFIG_HIDRAW is not set 1207# CONFIG_HIDRAW is not set
1199# CONFIG_HID_PID is not set 1208# CONFIG_HID_PID is not set
1200 1209
@@ -1274,6 +1283,7 @@ CONFIG_OCFS2_DEBUG_MASKLOG=y
1274# CONFIG_OCFS2_DEBUG_FS is not set 1283# CONFIG_OCFS2_DEBUG_FS is not set
1275# CONFIG_OCFS2_FS_POSIX_ACL is not set 1284# CONFIG_OCFS2_FS_POSIX_ACL is not set
1276# CONFIG_BTRFS_FS is not set 1285# CONFIG_BTRFS_FS is not set
1286# CONFIG_NILFS2_FS is not set
1277CONFIG_FILE_LOCKING=y 1287CONFIG_FILE_LOCKING=y
1278CONFIG_FSNOTIFY=y 1288CONFIG_FSNOTIFY=y
1279CONFIG_DNOTIFY=y 1289CONFIG_DNOTIFY=y
@@ -1343,7 +1353,6 @@ CONFIG_ROMFS_BACKED_BY_BLOCK=y
1343CONFIG_ROMFS_ON_BLOCK=y 1353CONFIG_ROMFS_ON_BLOCK=y
1344# CONFIG_SYSV_FS is not set 1354# CONFIG_SYSV_FS is not set
1345# CONFIG_UFS_FS is not set 1355# CONFIG_UFS_FS is not set
1346# CONFIG_NILFS2_FS is not set
1347CONFIG_NETWORK_FILESYSTEMS=y 1356CONFIG_NETWORK_FILESYSTEMS=y
1348CONFIG_NFS_FS=y 1357CONFIG_NFS_FS=y
1349CONFIG_NFS_V3=y 1358CONFIG_NFS_V3=y
@@ -1451,6 +1460,7 @@ CONFIG_ENABLE_WARN_DEPRECATED=y
1451CONFIG_ENABLE_MUST_CHECK=y 1460CONFIG_ENABLE_MUST_CHECK=y
1452CONFIG_FRAME_WARN=1024 1461CONFIG_FRAME_WARN=1024
1453CONFIG_MAGIC_SYSRQ=y 1462CONFIG_MAGIC_SYSRQ=y
1463# CONFIG_STRIP_ASM_SYMS is not set
1454# CONFIG_UNUSED_SYMBOLS is not set 1464# CONFIG_UNUSED_SYMBOLS is not set
1455CONFIG_DEBUG_FS=y 1465CONFIG_DEBUG_FS=y
1456# CONFIG_HEADERS_CHECK is not set 1466# CONFIG_HEADERS_CHECK is not set
@@ -1467,6 +1477,7 @@ CONFIG_SCHED_DEBUG=y
1467# CONFIG_TIMER_STATS is not set 1477# CONFIG_TIMER_STATS is not set
1468# CONFIG_DEBUG_OBJECTS is not set 1478# CONFIG_DEBUG_OBJECTS is not set
1469# CONFIG_DEBUG_SLAB is not set 1479# CONFIG_DEBUG_SLAB is not set
1480# CONFIG_DEBUG_KMEMLEAK is not set
1470CONFIG_DEBUG_PREEMPT=y 1481CONFIG_DEBUG_PREEMPT=y
1471# CONFIG_DEBUG_RT_MUTEXES is not set 1482# CONFIG_DEBUG_RT_MUTEXES is not set
1472# CONFIG_RT_MUTEX_TESTER is not set 1483# CONFIG_RT_MUTEX_TESTER is not set
@@ -1486,10 +1497,12 @@ CONFIG_DEBUG_INFO=y
1486# CONFIG_DEBUG_LIST is not set 1497# CONFIG_DEBUG_LIST is not set
1487# CONFIG_DEBUG_SG is not set 1498# CONFIG_DEBUG_SG is not set
1488# CONFIG_DEBUG_NOTIFIERS is not set 1499# CONFIG_DEBUG_NOTIFIERS is not set
1500# CONFIG_DEBUG_CREDENTIALS is not set
1489# CONFIG_RCU_TORTURE_TEST is not set 1501# CONFIG_RCU_TORTURE_TEST is not set
1490# CONFIG_RCU_CPU_STALL_DETECTOR is not set 1502# CONFIG_RCU_CPU_STALL_DETECTOR is not set
1491# CONFIG_BACKTRACE_SELF_TEST is not set 1503# CONFIG_BACKTRACE_SELF_TEST is not set
1492# CONFIG_DEBUG_BLOCK_EXT_DEVT is not set 1504# CONFIG_DEBUG_BLOCK_EXT_DEVT is not set
1505# CONFIG_DEBUG_FORCE_WEAK_PER_CPU is not set
1493# CONFIG_FAULT_INJECTION is not set 1506# CONFIG_FAULT_INJECTION is not set
1494# CONFIG_LATENCYTOP is not set 1507# CONFIG_LATENCYTOP is not set
1495CONFIG_SYSCTL_SYSCALL_CHECK=y 1508CONFIG_SYSCTL_SYSCALL_CHECK=y
@@ -1514,10 +1527,10 @@ CONFIG_BRANCH_PROFILE_NONE=y
1514# CONFIG_WORKQUEUE_TRACER is not set 1527# CONFIG_WORKQUEUE_TRACER is not set
1515# CONFIG_BLK_DEV_IO_TRACE is not set 1528# CONFIG_BLK_DEV_IO_TRACE is not set
1516# CONFIG_DYNAMIC_DEBUG is not set 1529# CONFIG_DYNAMIC_DEBUG is not set
1530# CONFIG_DMA_API_DEBUG is not set
1517# CONFIG_SAMPLES is not set 1531# CONFIG_SAMPLES is not set
1518CONFIG_HAVE_ARCH_KGDB=y 1532CONFIG_HAVE_ARCH_KGDB=y
1519# CONFIG_KGDB is not set 1533# CONFIG_KGDB is not set
1520# CONFIG_KMEMCHECK is not set
1521# CONFIG_PPC_DISABLE_WERROR is not set 1534# CONFIG_PPC_DISABLE_WERROR is not set
1522CONFIG_PPC_WERROR=y 1535CONFIG_PPC_WERROR=y
1523CONFIG_PRINT_STACK_DEPTH=64 1536CONFIG_PRINT_STACK_DEPTH=64
@@ -1550,7 +1563,6 @@ CONFIG_CRYPTO=y
1550# 1563#
1551# Crypto core or helper 1564# Crypto core or helper
1552# 1565#
1553# CONFIG_CRYPTO_FIPS is not set
1554CONFIG_CRYPTO_ALGAPI=y 1566CONFIG_CRYPTO_ALGAPI=y
1555CONFIG_CRYPTO_ALGAPI2=y 1567CONFIG_CRYPTO_ALGAPI2=y
1556CONFIG_CRYPTO_AEAD=m 1568CONFIG_CRYPTO_AEAD=m
@@ -1593,11 +1605,13 @@ CONFIG_CRYPTO_PCBC=m
1593# 1605#
1594CONFIG_CRYPTO_HMAC=y 1606CONFIG_CRYPTO_HMAC=y
1595# CONFIG_CRYPTO_XCBC is not set 1607# CONFIG_CRYPTO_XCBC is not set
1608# CONFIG_CRYPTO_VMAC is not set
1596 1609
1597# 1610#
1598# Digest 1611# Digest
1599# 1612#
1600CONFIG_CRYPTO_CRC32C=m 1613CONFIG_CRYPTO_CRC32C=m
1614# CONFIG_CRYPTO_GHASH is not set
1601CONFIG_CRYPTO_MD4=m 1615CONFIG_CRYPTO_MD4=m
1602CONFIG_CRYPTO_MD5=y 1616CONFIG_CRYPTO_MD5=y
1603CONFIG_CRYPTO_MICHAEL_MIC=m 1617CONFIG_CRYPTO_MICHAEL_MIC=m
diff --git a/arch/powerpc/configs/adder875_defconfig b/arch/powerpc/configs/adder875_defconfig
index aece6bb5f733..052cf134e018 100644
--- a/arch/powerpc/configs/adder875_defconfig
+++ b/arch/powerpc/configs/adder875_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.31-rc4 3# Linux kernel version: 2.6.32-rc5
4# Wed Jul 29 23:31:47 2009 4# Thu Nov 5 08:20:04 2009
5# 5#
6# CONFIG_PPC64 is not set 6# CONFIG_PPC64 is not set
7 7
@@ -16,6 +16,7 @@ CONFIG_PPC_8xx=y
16# CONFIG_E200 is not set 16# CONFIG_E200 is not set
17CONFIG_8xx=y 17CONFIG_8xx=y
18CONFIG_PPC_MMU_NOHASH=y 18CONFIG_PPC_MMU_NOHASH=y
19CONFIG_PPC_MMU_NOHASH_32=y
19# CONFIG_PPC_MM_SLICES is not set 20# CONFIG_PPC_MM_SLICES is not set
20CONFIG_NOT_COHERENT_CACHE=y 21CONFIG_NOT_COHERENT_CACHE=y
21CONFIG_PPC32=y 22CONFIG_PPC32=y
@@ -29,6 +30,7 @@ CONFIG_GENERIC_CLOCKEVENTS=y
29CONFIG_GENERIC_HARDIRQS=y 30CONFIG_GENERIC_HARDIRQS=y
30CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y 31CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y
31# CONFIG_HAVE_SETUP_PER_CPU_AREA is not set 32# CONFIG_HAVE_SETUP_PER_CPU_AREA is not set
33# CONFIG_NEED_PER_CPU_EMBED_FIRST_CHUNK is not set
32CONFIG_IRQ_PER_CPU=y 34CONFIG_IRQ_PER_CPU=y
33CONFIG_STACKTRACE_SUPPORT=y 35CONFIG_STACKTRACE_SUPPORT=y
34CONFIG_HAVE_LATENCYTOP_SUPPORT=y 36CONFIG_HAVE_LATENCYTOP_SUPPORT=y
@@ -78,11 +80,12 @@ CONFIG_SYSVIPC_SYSCTL=y
78# 80#
79# RCU Subsystem 81# RCU Subsystem
80# 82#
81CONFIG_CLASSIC_RCU=y 83CONFIG_TREE_RCU=y
82# CONFIG_TREE_RCU is not set 84# CONFIG_TREE_PREEMPT_RCU is not set
83# CONFIG_PREEMPT_RCU is not set 85# CONFIG_RCU_TRACE is not set
86CONFIG_RCU_FANOUT=32
87# CONFIG_RCU_FANOUT_EXACT is not set
84# CONFIG_TREE_RCU_TRACE is not set 88# CONFIG_TREE_RCU_TRACE is not set
85# CONFIG_PREEMPT_RCU_TRACE is not set
86# CONFIG_IKCONFIG is not set 89# CONFIG_IKCONFIG is not set
87CONFIG_LOG_BUF_SHIFT=14 90CONFIG_LOG_BUF_SHIFT=14
88CONFIG_GROUP_SCHED=y 91CONFIG_GROUP_SCHED=y
@@ -116,28 +119,29 @@ CONFIG_TIMERFD=y
116CONFIG_EVENTFD=y 119CONFIG_EVENTFD=y
117CONFIG_SHMEM=y 120CONFIG_SHMEM=y
118CONFIG_AIO=y 121CONFIG_AIO=y
119CONFIG_HAVE_PERF_COUNTERS=y 122CONFIG_HAVE_PERF_EVENTS=y
120 123
121# 124#
122# Performance Counters 125# Kernel Performance Events And Counters
123# 126#
127# CONFIG_PERF_EVENTS is not set
124# CONFIG_PERF_COUNTERS is not set 128# CONFIG_PERF_COUNTERS is not set
125# CONFIG_VM_EVENT_COUNTERS is not set 129# CONFIG_VM_EVENT_COUNTERS is not set
126CONFIG_SLUB_DEBUG=y 130CONFIG_SLUB_DEBUG=y
127# CONFIG_STRIP_ASM_SYMS is not set
128CONFIG_COMPAT_BRK=y 131CONFIG_COMPAT_BRK=y
129# CONFIG_SLAB is not set 132# CONFIG_SLAB is not set
130CONFIG_SLUB=y 133CONFIG_SLUB=y
131# CONFIG_SLOB is not set 134# CONFIG_SLOB is not set
132# CONFIG_PROFILING is not set 135# CONFIG_PROFILING is not set
133# CONFIG_MARKERS is not set
134CONFIG_HAVE_OPROFILE=y 136CONFIG_HAVE_OPROFILE=y
135CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS=y 137CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS=y
136CONFIG_HAVE_IOREMAP_PROT=y 138CONFIG_HAVE_IOREMAP_PROT=y
137CONFIG_HAVE_KPROBES=y 139CONFIG_HAVE_KPROBES=y
138CONFIG_HAVE_KRETPROBES=y 140CONFIG_HAVE_KRETPROBES=y
139CONFIG_HAVE_ARCH_TRACEHOOK=y 141CONFIG_HAVE_ARCH_TRACEHOOK=y
142CONFIG_HAVE_DMA_ATTRS=y
140CONFIG_HAVE_CLK=y 143CONFIG_HAVE_CLK=y
144CONFIG_HAVE_DMA_API_DEBUG=y
141 145
142# 146#
143# GCOV-based kernel profiling 147# GCOV-based kernel profiling
@@ -235,10 +239,10 @@ CONFIG_BINFMT_ELF=y
235# CONFIG_8XX_MINIMAL_FPEMU is not set 239# CONFIG_8XX_MINIMAL_FPEMU is not set
236# CONFIG_IOMMU_HELPER is not set 240# CONFIG_IOMMU_HELPER is not set
237# CONFIG_SWIOTLB is not set 241# CONFIG_SWIOTLB is not set
238CONFIG_PPC_NEED_DMA_SYNC_OPS=y
239CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y 242CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y
240CONFIG_ARCH_HAS_WALK_MEMORY=y 243CONFIG_ARCH_HAS_WALK_MEMORY=y
241CONFIG_ARCH_ENABLE_MEMORY_HOTREMOVE=y 244CONFIG_ARCH_ENABLE_MEMORY_HOTREMOVE=y
245CONFIG_MAX_ACTIVE_REGIONS=32
242CONFIG_ARCH_FLATMEM_ENABLE=y 246CONFIG_ARCH_FLATMEM_ENABLE=y
243CONFIG_ARCH_POPULATES_NODE_MAP=y 247CONFIG_ARCH_POPULATES_NODE_MAP=y
244CONFIG_SELECT_MEMORY_MODEL=y 248CONFIG_SELECT_MEMORY_MODEL=y
@@ -256,6 +260,7 @@ CONFIG_BOUNCE=y
256CONFIG_VIRT_TO_BUS=y 260CONFIG_VIRT_TO_BUS=y
257CONFIG_HAVE_MLOCK=y 261CONFIG_HAVE_MLOCK=y
258CONFIG_HAVE_MLOCKED_PAGE_BIT=y 262CONFIG_HAVE_MLOCKED_PAGE_BIT=y
263# CONFIG_KSM is not set
259CONFIG_DEFAULT_MMAP_MIN_ADDR=4096 264CONFIG_DEFAULT_MMAP_MIN_ADDR=4096
260CONFIG_PPC_4K_PAGES=y 265CONFIG_PPC_4K_PAGES=y
261# CONFIG_PPC_16K_PAGES is not set 266# CONFIG_PPC_16K_PAGES is not set
@@ -338,6 +343,7 @@ CONFIG_DEFAULT_TCP_CONG="cubic"
338# CONFIG_NETFILTER is not set 343# CONFIG_NETFILTER is not set
339# CONFIG_IP_DCCP is not set 344# CONFIG_IP_DCCP is not set
340# CONFIG_IP_SCTP is not set 345# CONFIG_IP_SCTP is not set
346# CONFIG_RDS is not set
341# CONFIG_TIPC is not set 347# CONFIG_TIPC is not set
342# CONFIG_ATM is not set 348# CONFIG_ATM is not set
343# CONFIG_BRIDGE is not set 349# CONFIG_BRIDGE is not set
@@ -367,6 +373,7 @@ CONFIG_DEFAULT_TCP_CONG="cubic"
367# CONFIG_AF_RXRPC is not set 373# CONFIG_AF_RXRPC is not set
368CONFIG_WIRELESS=y 374CONFIG_WIRELESS=y
369# CONFIG_CFG80211 is not set 375# CONFIG_CFG80211 is not set
376CONFIG_CFG80211_DEFAULT_PS_VALUE=0
370CONFIG_WIRELESS_OLD_REGULATORY=y 377CONFIG_WIRELESS_OLD_REGULATORY=y
371# CONFIG_WIRELESS_EXT is not set 378# CONFIG_WIRELESS_EXT is not set
372# CONFIG_LIB80211 is not set 379# CONFIG_LIB80211 is not set
@@ -374,7 +381,6 @@ CONFIG_WIRELESS_OLD_REGULATORY=y
374# 381#
375# CFG80211 needs to be enabled for MAC80211 382# CFG80211 needs to be enabled for MAC80211
376# 383#
377CONFIG_MAC80211_DEFAULT_PS_VALUE=0
378# CONFIG_WIMAX is not set 384# CONFIG_WIMAX is not set
379# CONFIG_RFKILL is not set 385# CONFIG_RFKILL is not set
380# CONFIG_NET_9P is not set 386# CONFIG_NET_9P is not set
@@ -387,6 +393,7 @@ CONFIG_MAC80211_DEFAULT_PS_VALUE=0
387# Generic Driver Options 393# Generic Driver Options
388# 394#
389CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug" 395CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
396# CONFIG_DEVTMPFS is not set
390CONFIG_STANDALONE=y 397CONFIG_STANDALONE=y
391CONFIG_PREVENT_FIRMWARE_BUILD=y 398CONFIG_PREVENT_FIRMWARE_BUILD=y
392# CONFIG_FW_LOADER is not set 399# CONFIG_FW_LOADER is not set
@@ -530,16 +537,15 @@ CONFIG_MII=y
530# CONFIG_IBM_NEW_EMAC_MAL_COMMON_ERR is not set 537# CONFIG_IBM_NEW_EMAC_MAL_COMMON_ERR is not set
531# CONFIG_B44 is not set 538# CONFIG_B44 is not set
532# CONFIG_KS8842 is not set 539# CONFIG_KS8842 is not set
540# CONFIG_KS8851_MLL is not set
541# CONFIG_XILINX_EMACLITE is not set
533CONFIG_FS_ENET=y 542CONFIG_FS_ENET=y
534# CONFIG_FS_ENET_HAS_SCC is not set 543# CONFIG_FS_ENET_HAS_SCC is not set
535CONFIG_FS_ENET_HAS_FEC=y 544CONFIG_FS_ENET_HAS_FEC=y
536CONFIG_FS_ENET_MDIO_FEC=y 545CONFIG_FS_ENET_MDIO_FEC=y
537# CONFIG_NETDEV_1000 is not set 546# CONFIG_NETDEV_1000 is not set
538# CONFIG_NETDEV_10000 is not set 547# CONFIG_NETDEV_10000 is not set
539 548CONFIG_WLAN=y
540#
541# Wireless LAN
542#
543# CONFIG_WLAN_PRE80211 is not set 549# CONFIG_WLAN_PRE80211 is not set
544# CONFIG_WLAN_80211 is not set 550# CONFIG_WLAN_80211 is not set
545 551
@@ -580,6 +586,7 @@ CONFIG_INPUT_KEYBOARD=y
580CONFIG_KEYBOARD_ATKBD=y 586CONFIG_KEYBOARD_ATKBD=y
581# CONFIG_KEYBOARD_LKKBD is not set 587# CONFIG_KEYBOARD_LKKBD is not set
582# CONFIG_KEYBOARD_NEWTON is not set 588# CONFIG_KEYBOARD_NEWTON is not set
589# CONFIG_KEYBOARD_OPENCORES is not set
583# CONFIG_KEYBOARD_STOWAWAY is not set 590# CONFIG_KEYBOARD_STOWAWAY is not set
584# CONFIG_KEYBOARD_SUNKBD is not set 591# CONFIG_KEYBOARD_SUNKBD is not set
585# CONFIG_KEYBOARD_XTKBD is not set 592# CONFIG_KEYBOARD_XTKBD is not set
@@ -590,6 +597,7 @@ CONFIG_MOUSE_PS2_LOGIPS2PP=y
590CONFIG_MOUSE_PS2_SYNAPTICS=y 597CONFIG_MOUSE_PS2_SYNAPTICS=y
591CONFIG_MOUSE_PS2_TRACKPOINT=y 598CONFIG_MOUSE_PS2_TRACKPOINT=y
592# CONFIG_MOUSE_PS2_ELANTECH is not set 599# CONFIG_MOUSE_PS2_ELANTECH is not set
600# CONFIG_MOUSE_PS2_SENTELIC is not set
593# CONFIG_MOUSE_PS2_TOUCHKIT is not set 601# CONFIG_MOUSE_PS2_TOUCHKIT is not set
594# CONFIG_MOUSE_SERIAL is not set 602# CONFIG_MOUSE_SERIAL is not set
595# CONFIG_MOUSE_VSXXXAA is not set 603# CONFIG_MOUSE_VSXXXAA is not set
@@ -716,6 +724,7 @@ CONFIG_VIDEO_OUTPUT_CONTROL=y
716# CONFIG_GFS2_FS is not set 724# CONFIG_GFS2_FS is not set
717# CONFIG_OCFS2_FS is not set 725# CONFIG_OCFS2_FS is not set
718# CONFIG_BTRFS_FS is not set 726# CONFIG_BTRFS_FS is not set
727# CONFIG_NILFS2_FS is not set
719CONFIG_FILE_LOCKING=y 728CONFIG_FILE_LOCKING=y
720CONFIG_FSNOTIFY=y 729CONFIG_FSNOTIFY=y
721# CONFIG_DNOTIFY is not set 730# CONFIG_DNOTIFY is not set
@@ -775,7 +784,6 @@ CONFIG_CRAMFS=y
775# CONFIG_ROMFS_FS is not set 784# CONFIG_ROMFS_FS is not set
776# CONFIG_SYSV_FS is not set 785# CONFIG_SYSV_FS is not set
777# CONFIG_UFS_FS is not set 786# CONFIG_UFS_FS is not set
778# CONFIG_NILFS2_FS is not set
779CONFIG_NETWORK_FILESYSTEMS=y 787CONFIG_NETWORK_FILESYSTEMS=y
780CONFIG_NFS_FS=y 788CONFIG_NFS_FS=y
781CONFIG_NFS_V3=y 789CONFIG_NFS_V3=y
@@ -847,6 +855,7 @@ CONFIG_ENABLE_WARN_DEPRECATED=y
847CONFIG_ENABLE_MUST_CHECK=y 855CONFIG_ENABLE_MUST_CHECK=y
848CONFIG_FRAME_WARN=1024 856CONFIG_FRAME_WARN=1024
849CONFIG_MAGIC_SYSRQ=y 857CONFIG_MAGIC_SYSRQ=y
858# CONFIG_STRIP_ASM_SYMS is not set
850# CONFIG_UNUSED_SYMBOLS is not set 859# CONFIG_UNUSED_SYMBOLS is not set
851CONFIG_DEBUG_FS=y 860CONFIG_DEBUG_FS=y
852# CONFIG_HEADERS_CHECK is not set 861# CONFIG_HEADERS_CHECK is not set
@@ -864,6 +873,7 @@ CONFIG_SCHED_DEBUG=y
864# CONFIG_DEBUG_OBJECTS is not set 873# CONFIG_DEBUG_OBJECTS is not set
865# CONFIG_SLUB_DEBUG_ON is not set 874# CONFIG_SLUB_DEBUG_ON is not set
866# CONFIG_SLUB_STATS is not set 875# CONFIG_SLUB_STATS is not set
876# CONFIG_DEBUG_KMEMLEAK is not set
867# CONFIG_DEBUG_SPINLOCK is not set 877# CONFIG_DEBUG_SPINLOCK is not set
868# CONFIG_DEBUG_MUTEXES is not set 878# CONFIG_DEBUG_MUTEXES is not set
869# CONFIG_DEBUG_LOCK_ALLOC is not set 879# CONFIG_DEBUG_LOCK_ALLOC is not set
@@ -880,10 +890,12 @@ CONFIG_DEBUG_INFO=y
880# CONFIG_DEBUG_LIST is not set 890# CONFIG_DEBUG_LIST is not set
881# CONFIG_DEBUG_SG is not set 891# CONFIG_DEBUG_SG is not set
882# CONFIG_DEBUG_NOTIFIERS is not set 892# CONFIG_DEBUG_NOTIFIERS is not set
893# CONFIG_DEBUG_CREDENTIALS is not set
883# CONFIG_RCU_TORTURE_TEST is not set 894# CONFIG_RCU_TORTURE_TEST is not set
884# CONFIG_RCU_CPU_STALL_DETECTOR is not set 895# CONFIG_RCU_CPU_STALL_DETECTOR is not set
885# CONFIG_BACKTRACE_SELF_TEST is not set 896# CONFIG_BACKTRACE_SELF_TEST is not set
886# CONFIG_DEBUG_BLOCK_EXT_DEVT is not set 897# CONFIG_DEBUG_BLOCK_EXT_DEVT is not set
898# CONFIG_DEBUG_FORCE_WEAK_PER_CPU is not set
887# CONFIG_FAULT_INJECTION is not set 899# CONFIG_FAULT_INJECTION is not set
888# CONFIG_LATENCYTOP is not set 900# CONFIG_LATENCYTOP is not set
889# CONFIG_DEBUG_PAGEALLOC is not set 901# CONFIG_DEBUG_PAGEALLOC is not set
@@ -906,10 +918,10 @@ CONFIG_BRANCH_PROFILE_NONE=y
906# CONFIG_WORKQUEUE_TRACER is not set 918# CONFIG_WORKQUEUE_TRACER is not set
907# CONFIG_BLK_DEV_IO_TRACE is not set 919# CONFIG_BLK_DEV_IO_TRACE is not set
908# CONFIG_DYNAMIC_DEBUG is not set 920# CONFIG_DYNAMIC_DEBUG is not set
921# CONFIG_DMA_API_DEBUG is not set
909# CONFIG_SAMPLES is not set 922# CONFIG_SAMPLES is not set
910CONFIG_HAVE_ARCH_KGDB=y 923CONFIG_HAVE_ARCH_KGDB=y
911# CONFIG_KGDB is not set 924# CONFIG_KGDB is not set
912# CONFIG_KMEMCHECK is not set
913# CONFIG_PPC_DISABLE_WERROR is not set 925# CONFIG_PPC_DISABLE_WERROR is not set
914CONFIG_PPC_WERROR=y 926CONFIG_PPC_WERROR=y
915CONFIG_PRINT_STACK_DEPTH=64 927CONFIG_PRINT_STACK_DEPTH=64
diff --git a/arch/powerpc/configs/c2k_defconfig b/arch/powerpc/configs/c2k_defconfig
index 8105360d53f4..0fb65a85dfdf 100644
--- a/arch/powerpc/configs/c2k_defconfig
+++ b/arch/powerpc/configs/c2k_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.31-rc4 3# Linux kernel version: 2.6.32-rc5
4# Wed Jul 29 23:31:48 2009 4# Thu Nov 5 08:20:05 2009
5# 5#
6# CONFIG_PPC64 is not set 6# CONFIG_PPC64 is not set
7 7
@@ -22,6 +22,7 @@ CONFIG_PPC_STD_MMU=y
22CONFIG_PPC_STD_MMU_32=y 22CONFIG_PPC_STD_MMU_32=y
23# CONFIG_PPC_MM_SLICES is not set 23# CONFIG_PPC_MM_SLICES is not set
24CONFIG_PPC_HAVE_PMU_SUPPORT=y 24CONFIG_PPC_HAVE_PMU_SUPPORT=y
25CONFIG_PPC_PERF_CTRS=y
25# CONFIG_SMP is not set 26# CONFIG_SMP is not set
26CONFIG_NOT_COHERENT_CACHE=y 27CONFIG_NOT_COHERENT_CACHE=y
27CONFIG_CHECK_CACHE_COHERENCY=y 28CONFIG_CHECK_CACHE_COHERENCY=y
@@ -36,6 +37,7 @@ CONFIG_GENERIC_CLOCKEVENTS=y
36CONFIG_GENERIC_HARDIRQS=y 37CONFIG_GENERIC_HARDIRQS=y
37CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=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
40# CONFIG_NEED_PER_CPU_EMBED_FIRST_CHUNK is not set
39CONFIG_IRQ_PER_CPU=y 41CONFIG_IRQ_PER_CPU=y
40CONFIG_STACKTRACE_SUPPORT=y 42CONFIG_STACKTRACE_SUPPORT=y
41CONFIG_HAVE_LATENCYTOP_SUPPORT=y 43CONFIG_HAVE_LATENCYTOP_SUPPORT=y
@@ -88,11 +90,12 @@ CONFIG_AUDIT_TREE=y
88# 90#
89# RCU Subsystem 91# RCU Subsystem
90# 92#
91CONFIG_CLASSIC_RCU=y 93CONFIG_TREE_RCU=y
92# CONFIG_TREE_RCU is not set 94# CONFIG_TREE_PREEMPT_RCU is not set
93# CONFIG_PREEMPT_RCU is not set 95# CONFIG_RCU_TRACE is not set
96CONFIG_RCU_FANOUT=32
97# CONFIG_RCU_FANOUT_EXACT is not set
94# CONFIG_TREE_RCU_TRACE is not set 98# CONFIG_TREE_RCU_TRACE is not set
95# CONFIG_PREEMPT_RCU_TRACE is not set
96# CONFIG_IKCONFIG is not set 99# CONFIG_IKCONFIG is not set
97CONFIG_LOG_BUF_SHIFT=17 100CONFIG_LOG_BUF_SHIFT=17
98CONFIG_GROUP_SCHED=y 101CONFIG_GROUP_SCHED=y
@@ -135,23 +138,24 @@ CONFIG_TIMERFD=y
135CONFIG_EVENTFD=y 138CONFIG_EVENTFD=y
136CONFIG_SHMEM=y 139CONFIG_SHMEM=y
137CONFIG_AIO=y 140CONFIG_AIO=y
138CONFIG_HAVE_PERF_COUNTERS=y 141CONFIG_HAVE_PERF_EVENTS=y
139 142
140# 143#
141# Performance Counters 144# Kernel Performance Events And Counters
142# 145#
146CONFIG_PERF_EVENTS=y
147CONFIG_EVENT_PROFILE=y
143# CONFIG_PERF_COUNTERS is not set 148# CONFIG_PERF_COUNTERS is not set
149# CONFIG_DEBUG_PERF_USE_VMALLOC is not set
144CONFIG_VM_EVENT_COUNTERS=y 150CONFIG_VM_EVENT_COUNTERS=y
145CONFIG_PCI_QUIRKS=y 151CONFIG_PCI_QUIRKS=y
146CONFIG_SLUB_DEBUG=y 152CONFIG_SLUB_DEBUG=y
147# CONFIG_STRIP_ASM_SYMS is not set
148CONFIG_COMPAT_BRK=y 153CONFIG_COMPAT_BRK=y
149# CONFIG_SLAB is not set 154# CONFIG_SLAB is not set
150CONFIG_SLUB=y 155CONFIG_SLUB=y
151# CONFIG_SLOB is not set 156# CONFIG_SLOB is not set
152CONFIG_PROFILING=y 157CONFIG_PROFILING=y
153CONFIG_TRACEPOINTS=y 158CONFIG_TRACEPOINTS=y
154CONFIG_MARKERS=y
155CONFIG_OPROFILE=m 159CONFIG_OPROFILE=m
156CONFIG_HAVE_OPROFILE=y 160CONFIG_HAVE_OPROFILE=y
157CONFIG_KPROBES=y 161CONFIG_KPROBES=y
@@ -161,12 +165,14 @@ CONFIG_HAVE_IOREMAP_PROT=y
161CONFIG_HAVE_KPROBES=y 165CONFIG_HAVE_KPROBES=y
162CONFIG_HAVE_KRETPROBES=y 166CONFIG_HAVE_KRETPROBES=y
163CONFIG_HAVE_ARCH_TRACEHOOK=y 167CONFIG_HAVE_ARCH_TRACEHOOK=y
168CONFIG_HAVE_DMA_ATTRS=y
169CONFIG_HAVE_DMA_API_DEBUG=y
164 170
165# 171#
166# GCOV-based kernel profiling 172# GCOV-based kernel profiling
167# 173#
168# CONFIG_GCOV_KERNEL is not set 174# CONFIG_GCOV_KERNEL is not set
169# CONFIG_SLOW_WORK is not set 175CONFIG_SLOW_WORK=y
170# CONFIG_HAVE_GENERIC_DMA_COHERENT is not set 176# CONFIG_HAVE_GENERIC_DMA_COHERENT is not set
171CONFIG_SLABINFO=y 177CONFIG_SLABINFO=y
172CONFIG_RT_MUTEXES=y 178CONFIG_RT_MUTEXES=y
@@ -275,12 +281,12 @@ CONFIG_BINFMT_ELF=y
275CONFIG_BINFMT_MISC=y 281CONFIG_BINFMT_MISC=y
276# CONFIG_IOMMU_HELPER is not set 282# CONFIG_IOMMU_HELPER is not set
277# CONFIG_SWIOTLB is not set 283# CONFIG_SWIOTLB is not set
278CONFIG_PPC_NEED_DMA_SYNC_OPS=y
279CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y 284CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y
280CONFIG_ARCH_HAS_WALK_MEMORY=y 285CONFIG_ARCH_HAS_WALK_MEMORY=y
281CONFIG_ARCH_ENABLE_MEMORY_HOTREMOVE=y 286CONFIG_ARCH_ENABLE_MEMORY_HOTREMOVE=y
282# CONFIG_KEXEC is not set 287# CONFIG_KEXEC is not set
283# CONFIG_CRASH_DUMP is not set 288# CONFIG_CRASH_DUMP is not set
289CONFIG_MAX_ACTIVE_REGIONS=32
284CONFIG_ARCH_FLATMEM_ENABLE=y 290CONFIG_ARCH_FLATMEM_ENABLE=y
285CONFIG_ARCH_POPULATES_NODE_MAP=y 291CONFIG_ARCH_POPULATES_NODE_MAP=y
286CONFIG_SELECT_MEMORY_MODEL=y 292CONFIG_SELECT_MEMORY_MODEL=y
@@ -298,6 +304,7 @@ CONFIG_BOUNCE=y
298CONFIG_VIRT_TO_BUS=y 304CONFIG_VIRT_TO_BUS=y
299CONFIG_HAVE_MLOCK=y 305CONFIG_HAVE_MLOCK=y
300CONFIG_HAVE_MLOCKED_PAGE_BIT=y 306CONFIG_HAVE_MLOCKED_PAGE_BIT=y
307# CONFIG_KSM is not set
301CONFIG_DEFAULT_MMAP_MIN_ADDR=4096 308CONFIG_DEFAULT_MMAP_MIN_ADDR=4096
302CONFIG_PPC_4K_PAGES=y 309CONFIG_PPC_4K_PAGES=y
303# CONFIG_PPC_16K_PAGES is not set 310# CONFIG_PPC_16K_PAGES is not set
@@ -309,6 +316,7 @@ CONFIG_FORCE_MAX_ZONEORDER=11
309CONFIG_EXTRA_TARGETS="" 316CONFIG_EXTRA_TARGETS=""
310CONFIG_PM=y 317CONFIG_PM=y
311# CONFIG_PM_DEBUG is not set 318# CONFIG_PM_DEBUG is not set
319# CONFIG_PM_RUNTIME is not set
312CONFIG_SECCOMP=y 320CONFIG_SECCOMP=y
313CONFIG_ISA_DMA_API=y 321CONFIG_ISA_DMA_API=y
314 322
@@ -674,10 +682,12 @@ CONFIG_BT_HCIBCM203X=m
674# CONFIG_BT_HCIBPA10X is not set 682# CONFIG_BT_HCIBPA10X is not set
675CONFIG_BT_HCIBFUSB=m 683CONFIG_BT_HCIBFUSB=m
676CONFIG_BT_HCIVHCI=m 684CONFIG_BT_HCIVHCI=m
685# CONFIG_BT_MRVL is not set
677# CONFIG_AF_RXRPC is not set 686# CONFIG_AF_RXRPC is not set
678CONFIG_FIB_RULES=y 687CONFIG_FIB_RULES=y
679CONFIG_WIRELESS=y 688CONFIG_WIRELESS=y
680# CONFIG_CFG80211 is not set 689# CONFIG_CFG80211 is not set
690CONFIG_CFG80211_DEFAULT_PS_VALUE=0
681CONFIG_WIRELESS_OLD_REGULATORY=y 691CONFIG_WIRELESS_OLD_REGULATORY=y
682CONFIG_WIRELESS_EXT=y 692CONFIG_WIRELESS_EXT=y
683CONFIG_WIRELESS_EXT_SYSFS=y 693CONFIG_WIRELESS_EXT_SYSFS=y
@@ -686,7 +696,6 @@ CONFIG_WIRELESS_EXT_SYSFS=y
686# 696#
687# CFG80211 needs to be enabled for MAC80211 697# CFG80211 needs to be enabled for MAC80211
688# 698#
689CONFIG_MAC80211_DEFAULT_PS_VALUE=0
690# CONFIG_WIMAX is not set 699# CONFIG_WIMAX is not set
691# CONFIG_RFKILL is not set 700# CONFIG_RFKILL is not set
692# CONFIG_NET_9P is not set 701# CONFIG_NET_9P is not set
@@ -699,6 +708,7 @@ CONFIG_MAC80211_DEFAULT_PS_VALUE=0
699# Generic Driver Options 708# Generic Driver Options
700# 709#
701CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug" 710CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
711# CONFIG_DEVTMPFS is not set
702CONFIG_STANDALONE=y 712CONFIG_STANDALONE=y
703CONFIG_PREVENT_FIRMWARE_BUILD=y 713CONFIG_PREVENT_FIRMWARE_BUILD=y
704CONFIG_FW_LOADER=y 714CONFIG_FW_LOADER=y
@@ -710,9 +720,9 @@ CONFIG_EXTRA_FIRMWARE=""
710# CONFIG_CONNECTOR is not set 720# CONFIG_CONNECTOR is not set
711CONFIG_MTD=y 721CONFIG_MTD=y
712# CONFIG_MTD_DEBUG is not set 722# CONFIG_MTD_DEBUG is not set
723# CONFIG_MTD_TESTS is not set
713CONFIG_MTD_CONCAT=m 724CONFIG_MTD_CONCAT=m
714CONFIG_MTD_PARTITIONS=y 725CONFIG_MTD_PARTITIONS=y
715# CONFIG_MTD_TESTS is not set
716# CONFIG_MTD_REDBOOT_PARTS is not set 726# CONFIG_MTD_REDBOOT_PARTS is not set
717# CONFIG_MTD_CMDLINE_PARTS is not set 727# CONFIG_MTD_CMDLINE_PARTS is not set
718CONFIG_MTD_OF_PARTS=y 728CONFIG_MTD_OF_PARTS=y
@@ -763,6 +773,7 @@ CONFIG_MTD_COMPLEX_MAPPINGS=y
763# CONFIG_MTD_PHYSMAP is not set 773# CONFIG_MTD_PHYSMAP is not set
764CONFIG_MTD_PHYSMAP_OF=y 774CONFIG_MTD_PHYSMAP_OF=y
765# CONFIG_MTD_PCI is not set 775# CONFIG_MTD_PCI is not set
776# CONFIG_MTD_GPIO_ADDR is not set
766# CONFIG_MTD_INTEL_VR_NOR is not set 777# CONFIG_MTD_INTEL_VR_NOR is not set
767# CONFIG_MTD_PLATRAM is not set 778# CONFIG_MTD_PLATRAM is not set
768 779
@@ -857,6 +868,7 @@ CONFIG_SCSI_SRP_ATTRS=m
857CONFIG_SCSI_LOWLEVEL=y 868CONFIG_SCSI_LOWLEVEL=y
858# CONFIG_ISCSI_TCP is not set 869# CONFIG_ISCSI_TCP is not set
859# CONFIG_SCSI_BNX2_ISCSI is not set 870# CONFIG_SCSI_BNX2_ISCSI is not set
871# CONFIG_BE2ISCSI is not set
860CONFIG_BLK_DEV_3W_XXXX_RAID=m 872CONFIG_BLK_DEV_3W_XXXX_RAID=m
861CONFIG_SCSI_3W_9XXX=m 873CONFIG_SCSI_3W_9XXX=m
862CONFIG_SCSI_ACARD=m 874CONFIG_SCSI_ACARD=m
@@ -912,7 +924,9 @@ CONFIG_SCSI_LPFC=m
912# CONFIG_SCSI_DC390T is not set 924# CONFIG_SCSI_DC390T is not set
913# CONFIG_SCSI_NSP32 is not set 925# CONFIG_SCSI_NSP32 is not set
914# CONFIG_SCSI_DEBUG is not set 926# CONFIG_SCSI_DEBUG is not set
927# CONFIG_SCSI_PMCRAID is not set
915# CONFIG_SCSI_SRP is not set 928# CONFIG_SCSI_SRP is not set
929# CONFIG_SCSI_BFA_FC is not set
916# CONFIG_SCSI_DH is not set 930# CONFIG_SCSI_DH is not set
917# CONFIG_SCSI_OSD_INITIATOR is not set 931# CONFIG_SCSI_OSD_INITIATOR is not set
918# CONFIG_ATA is not set 932# CONFIG_ATA is not set
@@ -982,7 +996,9 @@ CONFIG_MII=y
982# CONFIG_NET_PCI is not set 996# CONFIG_NET_PCI is not set
983# CONFIG_B44 is not set 997# CONFIG_B44 is not set
984# CONFIG_KS8842 is not set 998# CONFIG_KS8842 is not set
999# CONFIG_KS8851_MLL is not set
985# CONFIG_ATL2 is not set 1000# CONFIG_ATL2 is not set
1001# CONFIG_XILINX_EMACLITE is not set
986CONFIG_NETDEV_1000=y 1002CONFIG_NETDEV_1000=y
987# CONFIG_ACENIC is not set 1003# CONFIG_ACENIC is not set
988# CONFIG_DL2K is not set 1004# CONFIG_DL2K is not set
@@ -1010,10 +1026,7 @@ CONFIG_MV643XX_ETH=y
1010# CONFIG_JME is not set 1026# CONFIG_JME is not set
1011# CONFIG_NETDEV_10000 is not set 1027# CONFIG_NETDEV_10000 is not set
1012# CONFIG_TR is not set 1028# CONFIG_TR is not set
1013 1029CONFIG_WLAN=y
1014#
1015# Wireless LAN
1016#
1017# CONFIG_WLAN_PRE80211 is not set 1030# CONFIG_WLAN_PRE80211 is not set
1018# CONFIG_WLAN_80211 is not set 1031# CONFIG_WLAN_80211 is not set
1019 1032
@@ -1145,6 +1158,7 @@ CONFIG_MAX_RAW_DEVS=8192
1145CONFIG_DEVPORT=y 1158CONFIG_DEVPORT=y
1146CONFIG_I2C=m 1159CONFIG_I2C=m
1147CONFIG_I2C_BOARDINFO=y 1160CONFIG_I2C_BOARDINFO=y
1161CONFIG_I2C_COMPAT=y
1148CONFIG_I2C_CHARDEV=m 1162CONFIG_I2C_CHARDEV=m
1149CONFIG_I2C_HELPER_AUTO=y 1163CONFIG_I2C_HELPER_AUTO=y
1150 1164
@@ -1200,9 +1214,6 @@ CONFIG_I2C_MV64XXX=m
1200# Miscellaneous I2C Chip support 1214# Miscellaneous I2C Chip support
1201# 1215#
1202# CONFIG_DS1682 is not set 1216# CONFIG_DS1682 is not set
1203CONFIG_SENSORS_PCF8574=m
1204# CONFIG_PCF8575 is not set
1205# CONFIG_SENSORS_PCA9539 is not set
1206# CONFIG_SENSORS_TSL2550 is not set 1217# CONFIG_SENSORS_TSL2550 is not set
1207# CONFIG_I2C_DEBUG_CORE is not set 1218# CONFIG_I2C_DEBUG_CORE is not set
1208# CONFIG_I2C_DEBUG_ALGO is not set 1219# CONFIG_I2C_DEBUG_ALGO is not set
@@ -1220,6 +1231,11 @@ CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y
1220# CONFIG_POWER_SUPPLY is not set 1231# CONFIG_POWER_SUPPLY is not set
1221CONFIG_HWMON=m 1232CONFIG_HWMON=m
1222CONFIG_HWMON_VID=m 1233CONFIG_HWMON_VID=m
1234# CONFIG_HWMON_DEBUG_CHIP is not set
1235
1236#
1237# Native drivers
1238#
1223# CONFIG_SENSORS_AD7414 is not set 1239# CONFIG_SENSORS_AD7414 is not set
1224# CONFIG_SENSORS_AD7418 is not set 1240# CONFIG_SENSORS_AD7418 is not set
1225CONFIG_SENSORS_ADM1021=m 1241CONFIG_SENSORS_ADM1021=m
@@ -1269,6 +1285,7 @@ CONFIG_SENSORS_SMSC47B397=m
1269# CONFIG_SENSORS_ADS7828 is not set 1285# CONFIG_SENSORS_ADS7828 is not set
1270# CONFIG_SENSORS_THMC50 is not set 1286# CONFIG_SENSORS_THMC50 is not set
1271# CONFIG_SENSORS_TMP401 is not set 1287# CONFIG_SENSORS_TMP401 is not set
1288# CONFIG_SENSORS_TMP421 is not set
1272CONFIG_SENSORS_VIA686A=m 1289CONFIG_SENSORS_VIA686A=m
1273# CONFIG_SENSORS_VT1211 is not set 1290# CONFIG_SENSORS_VT1211 is not set
1274# CONFIG_SENSORS_VT8231 is not set 1291# CONFIG_SENSORS_VT8231 is not set
@@ -1280,7 +1297,6 @@ CONFIG_SENSORS_W83L785TS=m
1280# CONFIG_SENSORS_W83L786NG is not set 1297# CONFIG_SENSORS_W83L786NG is not set
1281CONFIG_SENSORS_W83627HF=m 1298CONFIG_SENSORS_W83627HF=m
1282# CONFIG_SENSORS_W83627EHF is not set 1299# CONFIG_SENSORS_W83627EHF is not set
1283# CONFIG_HWMON_DEBUG_CHIP is not set
1284# CONFIG_THERMAL is not set 1300# CONFIG_THERMAL is not set
1285CONFIG_WATCHDOG=y 1301CONFIG_WATCHDOG=y
1286# CONFIG_WATCHDOG_NOWAYOUT is not set 1302# CONFIG_WATCHDOG_NOWAYOUT is not set
@@ -1317,6 +1333,7 @@ CONFIG_SSB_POSSIBLE=y
1317# CONFIG_HTC_PASIC3 is not set 1333# CONFIG_HTC_PASIC3 is not set
1318# CONFIG_MFD_TMIO is not set 1334# CONFIG_MFD_TMIO is not set
1319# CONFIG_MFD_WM8400 is not set 1335# CONFIG_MFD_WM8400 is not set
1336# CONFIG_MFD_WM831X is not set
1320# CONFIG_MFD_WM8350_I2C is not set 1337# CONFIG_MFD_WM8350_I2C is not set
1321# CONFIG_MFD_PCF50633 is not set 1338# CONFIG_MFD_PCF50633 is not set
1322# CONFIG_AB3100_CORE is not set 1339# CONFIG_AB3100_CORE is not set
@@ -1327,6 +1344,7 @@ CONFIG_SSB_POSSIBLE=y
1327# Graphics support 1344# Graphics support
1328# 1345#
1329# CONFIG_AGP is not set 1346# CONFIG_AGP is not set
1347CONFIG_VGA_ARB=y
1330# CONFIG_DRM is not set 1348# CONFIG_DRM is not set
1331# CONFIG_VGASTATE is not set 1349# CONFIG_VGASTATE is not set
1332# CONFIG_VIDEO_OUTPUT_CONTROL is not set 1350# CONFIG_VIDEO_OUTPUT_CONTROL is not set
@@ -1378,6 +1396,7 @@ CONFIG_USB_EHCI_HCD_PPC_OF=y
1378# CONFIG_USB_OXU210HP_HCD is not set 1396# CONFIG_USB_OXU210HP_HCD is not set
1379# CONFIG_USB_ISP116X_HCD is not set 1397# CONFIG_USB_ISP116X_HCD is not set
1380# CONFIG_USB_ISP1760_HCD is not set 1398# CONFIG_USB_ISP1760_HCD is not set
1399# CONFIG_USB_ISP1362_HCD is not set
1381CONFIG_USB_OHCI_HCD=m 1400CONFIG_USB_OHCI_HCD=m
1382CONFIG_USB_OHCI_HCD_PPC_OF_BE=y 1401CONFIG_USB_OHCI_HCD_PPC_OF_BE=y
1383# CONFIG_USB_OHCI_HCD_PPC_OF_LE is not set 1402# CONFIG_USB_OHCI_HCD_PPC_OF_LE is not set
@@ -1588,6 +1607,7 @@ CONFIG_FS_POSIX_ACL=y
1588# CONFIG_GFS2_FS is not set 1607# CONFIG_GFS2_FS is not set
1589# CONFIG_OCFS2_FS is not set 1608# CONFIG_OCFS2_FS is not set
1590# CONFIG_BTRFS_FS is not set 1609# CONFIG_BTRFS_FS is not set
1610# CONFIG_NILFS2_FS is not set
1591CONFIG_FILE_LOCKING=y 1611CONFIG_FILE_LOCKING=y
1592CONFIG_FSNOTIFY=y 1612CONFIG_FSNOTIFY=y
1593CONFIG_DNOTIFY=y 1613CONFIG_DNOTIFY=y
@@ -1668,7 +1688,6 @@ CONFIG_VXFS_FS=m
1668# CONFIG_ROMFS_FS is not set 1688# CONFIG_ROMFS_FS is not set
1669# CONFIG_SYSV_FS is not set 1689# CONFIG_SYSV_FS is not set
1670# CONFIG_UFS_FS is not set 1690# CONFIG_UFS_FS is not set
1671# CONFIG_NILFS2_FS is not set
1672CONFIG_NETWORK_FILESYSTEMS=y 1691CONFIG_NETWORK_FILESYSTEMS=y
1673CONFIG_NFS_FS=y 1692CONFIG_NFS_FS=y
1674CONFIG_NFS_V3=y 1693CONFIG_NFS_V3=y
@@ -1770,7 +1789,7 @@ CONFIG_BINARY_PRINTF=y
1770CONFIG_BITREVERSE=y 1789CONFIG_BITREVERSE=y
1771CONFIG_GENERIC_FIND_LAST_BIT=y 1790CONFIG_GENERIC_FIND_LAST_BIT=y
1772CONFIG_CRC_CCITT=m 1791CONFIG_CRC_CCITT=m
1773# CONFIG_CRC16 is not set 1792CONFIG_CRC16=m
1774CONFIG_CRC_T10DIF=m 1793CONFIG_CRC_T10DIF=m
1775CONFIG_CRC_ITU_T=m 1794CONFIG_CRC_ITU_T=m
1776CONFIG_CRC32=y 1795CONFIG_CRC32=y
@@ -1797,6 +1816,7 @@ CONFIG_ENABLE_WARN_DEPRECATED=y
1797CONFIG_ENABLE_MUST_CHECK=y 1816CONFIG_ENABLE_MUST_CHECK=y
1798CONFIG_FRAME_WARN=1024 1817CONFIG_FRAME_WARN=1024
1799CONFIG_MAGIC_SYSRQ=y 1818CONFIG_MAGIC_SYSRQ=y
1819# CONFIG_STRIP_ASM_SYMS is not set
1800# CONFIG_UNUSED_SYMBOLS is not set 1820# CONFIG_UNUSED_SYMBOLS is not set
1801CONFIG_DEBUG_FS=y 1821CONFIG_DEBUG_FS=y
1802# CONFIG_HEADERS_CHECK is not set 1822# CONFIG_HEADERS_CHECK is not set
@@ -1814,6 +1834,7 @@ CONFIG_SCHED_DEBUG=y
1814# CONFIG_DEBUG_OBJECTS is not set 1834# CONFIG_DEBUG_OBJECTS is not set
1815# CONFIG_SLUB_DEBUG_ON is not set 1835# CONFIG_SLUB_DEBUG_ON is not set
1816# CONFIG_SLUB_STATS is not set 1836# CONFIG_SLUB_STATS is not set
1837# CONFIG_DEBUG_KMEMLEAK is not set
1817# CONFIG_DEBUG_RT_MUTEXES is not set 1838# CONFIG_DEBUG_RT_MUTEXES is not set
1818# CONFIG_RT_MUTEX_TESTER is not set 1839# CONFIG_RT_MUTEX_TESTER is not set
1819CONFIG_DEBUG_SPINLOCK=y 1840CONFIG_DEBUG_SPINLOCK=y
@@ -1834,11 +1855,13 @@ CONFIG_DEBUG_MEMORY_INIT=y
1834# CONFIG_DEBUG_LIST is not set 1855# CONFIG_DEBUG_LIST is not set
1835# CONFIG_DEBUG_SG is not set 1856# CONFIG_DEBUG_SG is not set
1836# CONFIG_DEBUG_NOTIFIERS is not set 1857# CONFIG_DEBUG_NOTIFIERS is not set
1858# CONFIG_DEBUG_CREDENTIALS is not set
1837# CONFIG_RCU_TORTURE_TEST is not set 1859# CONFIG_RCU_TORTURE_TEST is not set
1838# CONFIG_RCU_CPU_STALL_DETECTOR is not set 1860# CONFIG_RCU_CPU_STALL_DETECTOR is not set
1839# CONFIG_KPROBES_SANITY_TEST is not set 1861# CONFIG_KPROBES_SANITY_TEST is not set
1840# CONFIG_BACKTRACE_SELF_TEST is not set 1862# CONFIG_BACKTRACE_SELF_TEST is not set
1841# CONFIG_DEBUG_BLOCK_EXT_DEVT is not set 1863# CONFIG_DEBUG_BLOCK_EXT_DEVT is not set
1864# CONFIG_DEBUG_FORCE_WEAK_PER_CPU is not set
1842# CONFIG_LKDTM is not set 1865# CONFIG_LKDTM is not set
1843# CONFIG_FAULT_INJECTION is not set 1866# CONFIG_FAULT_INJECTION is not set
1844# CONFIG_LATENCYTOP is not set 1867# CONFIG_LATENCYTOP is not set
@@ -1852,6 +1875,7 @@ CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y
1852CONFIG_RING_BUFFER=y 1875CONFIG_RING_BUFFER=y
1853CONFIG_EVENT_TRACING=y 1876CONFIG_EVENT_TRACING=y
1854CONFIG_CONTEXT_SWITCH_TRACER=y 1877CONFIG_CONTEXT_SWITCH_TRACER=y
1878CONFIG_RING_BUFFER_ALLOW_SWAP=y
1855CONFIG_TRACING=y 1879CONFIG_TRACING=y
1856CONFIG_TRACING_SUPPORT=y 1880CONFIG_TRACING_SUPPORT=y
1857CONFIG_FTRACE=y 1881CONFIG_FTRACE=y
@@ -1869,6 +1893,7 @@ CONFIG_BRANCH_PROFILE_NONE=y
1869# CONFIG_BLK_DEV_IO_TRACE is not set 1893# CONFIG_BLK_DEV_IO_TRACE is not set
1870# CONFIG_RING_BUFFER_BENCHMARK is not set 1894# CONFIG_RING_BUFFER_BENCHMARK is not set
1871# CONFIG_DYNAMIC_DEBUG is not set 1895# CONFIG_DYNAMIC_DEBUG is not set
1896# CONFIG_DMA_API_DEBUG is not set
1872# CONFIG_SAMPLES is not set 1897# CONFIG_SAMPLES is not set
1873CONFIG_HAVE_ARCH_KGDB=y 1898CONFIG_HAVE_ARCH_KGDB=y
1874# CONFIG_KGDB is not set 1899# CONFIG_KGDB is not set
@@ -1899,6 +1924,7 @@ CONFIG_SECURITY_NETWORK=y
1899# CONFIG_SECURITY_NETWORK_XFRM is not set 1924# CONFIG_SECURITY_NETWORK_XFRM is not set
1900# CONFIG_SECURITY_PATH is not set 1925# CONFIG_SECURITY_PATH is not set
1901# CONFIG_SECURITY_FILE_CAPABILITIES is not set 1926# CONFIG_SECURITY_FILE_CAPABILITIES is not set
1927CONFIG_LSM_MMAP_MIN_ADDR=65536
1902CONFIG_SECURITY_SELINUX=y 1928CONFIG_SECURITY_SELINUX=y
1903CONFIG_SECURITY_SELINUX_BOOTPARAM=y 1929CONFIG_SECURITY_SELINUX_BOOTPARAM=y
1904CONFIG_SECURITY_SELINUX_BOOTPARAM_VALUE=1 1930CONFIG_SECURITY_SELINUX_BOOTPARAM_VALUE=1
@@ -1913,7 +1939,6 @@ CONFIG_CRYPTO=y
1913# 1939#
1914# Crypto core or helper 1940# Crypto core or helper
1915# 1941#
1916# CONFIG_CRYPTO_FIPS is not set
1917CONFIG_CRYPTO_ALGAPI=y 1942CONFIG_CRYPTO_ALGAPI=y
1918CONFIG_CRYPTO_ALGAPI2=y 1943CONFIG_CRYPTO_ALGAPI2=y
1919CONFIG_CRYPTO_AEAD=m 1944CONFIG_CRYPTO_AEAD=m
@@ -1956,11 +1981,13 @@ CONFIG_CRYPTO_ECB=m
1956# 1981#
1957CONFIG_CRYPTO_HMAC=y 1982CONFIG_CRYPTO_HMAC=y
1958# CONFIG_CRYPTO_XCBC is not set 1983# CONFIG_CRYPTO_XCBC is not set
1984# CONFIG_CRYPTO_VMAC is not set
1959 1985
1960# 1986#
1961# Digest 1987# Digest
1962# 1988#
1963CONFIG_CRYPTO_CRC32C=m 1989CONFIG_CRYPTO_CRC32C=m
1990# CONFIG_CRYPTO_GHASH is not set
1964CONFIG_CRYPTO_MD4=m 1991CONFIG_CRYPTO_MD4=m
1965CONFIG_CRYPTO_MD5=y 1992CONFIG_CRYPTO_MD5=y
1966CONFIG_CRYPTO_MICHAEL_MIC=m 1993CONFIG_CRYPTO_MICHAEL_MIC=m
diff --git a/arch/powerpc/configs/ep8248e_defconfig b/arch/powerpc/configs/ep8248e_defconfig
index 0aa5b43ffeb2..ef5edc7203f5 100644
--- a/arch/powerpc/configs/ep8248e_defconfig
+++ b/arch/powerpc/configs/ep8248e_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.31-rc4 3# Linux kernel version: 2.6.32-rc5
4# Wed Jul 29 23:31:49 2009 4# Thu Nov 5 08:20:06 2009
5# 5#
6# CONFIG_PPC64 is not set 6# CONFIG_PPC64 is not set
7 7
@@ -34,6 +34,7 @@ CONFIG_GENERIC_CLOCKEVENTS=y
34CONFIG_GENERIC_HARDIRQS=y 34CONFIG_GENERIC_HARDIRQS=y
35CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y 35CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y
36# CONFIG_HAVE_SETUP_PER_CPU_AREA is not set 36# CONFIG_HAVE_SETUP_PER_CPU_AREA is not set
37# CONFIG_NEED_PER_CPU_EMBED_FIRST_CHUNK is not set
37CONFIG_IRQ_PER_CPU=y 38CONFIG_IRQ_PER_CPU=y
38CONFIG_STACKTRACE_SUPPORT=y 39CONFIG_STACKTRACE_SUPPORT=y
39CONFIG_HAVE_LATENCYTOP_SUPPORT=y 40CONFIG_HAVE_LATENCYTOP_SUPPORT=y
@@ -82,11 +83,12 @@ CONFIG_SYSVIPC_SYSCTL=y
82# 83#
83# RCU Subsystem 84# RCU Subsystem
84# 85#
85CONFIG_CLASSIC_RCU=y 86CONFIG_TREE_RCU=y
86# CONFIG_TREE_RCU is not set 87# CONFIG_TREE_PREEMPT_RCU is not set
87# CONFIG_PREEMPT_RCU is not set 88# CONFIG_RCU_TRACE is not set
89CONFIG_RCU_FANOUT=32
90# CONFIG_RCU_FANOUT_EXACT is not set
88# CONFIG_TREE_RCU_TRACE is not set 91# CONFIG_TREE_RCU_TRACE is not set
89# CONFIG_PREEMPT_RCU_TRACE is not set
90CONFIG_IKCONFIG=y 92CONFIG_IKCONFIG=y
91CONFIG_IKCONFIG_PROC=y 93CONFIG_IKCONFIG_PROC=y
92CONFIG_LOG_BUF_SHIFT=14 94CONFIG_LOG_BUF_SHIFT=14
@@ -116,28 +118,29 @@ CONFIG_TIMERFD=y
116CONFIG_EVENTFD=y 118CONFIG_EVENTFD=y
117CONFIG_SHMEM=y 119CONFIG_SHMEM=y
118CONFIG_AIO=y 120CONFIG_AIO=y
119CONFIG_HAVE_PERF_COUNTERS=y 121CONFIG_HAVE_PERF_EVENTS=y
120 122
121# 123#
122# Performance Counters 124# Kernel Performance Events And Counters
123# 125#
126# CONFIG_PERF_EVENTS is not set
124# CONFIG_PERF_COUNTERS is not set 127# CONFIG_PERF_COUNTERS is not set
125CONFIG_VM_EVENT_COUNTERS=y 128CONFIG_VM_EVENT_COUNTERS=y
126CONFIG_PCI_QUIRKS=y 129CONFIG_PCI_QUIRKS=y
127# CONFIG_STRIP_ASM_SYMS is not set
128CONFIG_COMPAT_BRK=y 130CONFIG_COMPAT_BRK=y
129CONFIG_SLAB=y 131CONFIG_SLAB=y
130# CONFIG_SLUB is not set 132# CONFIG_SLUB is not set
131# CONFIG_SLOB is not set 133# CONFIG_SLOB is not set
132# CONFIG_PROFILING is not set 134# CONFIG_PROFILING is not set
133# CONFIG_MARKERS is not set
134CONFIG_HAVE_OPROFILE=y 135CONFIG_HAVE_OPROFILE=y
135CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS=y 136CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS=y
136CONFIG_HAVE_IOREMAP_PROT=y 137CONFIG_HAVE_IOREMAP_PROT=y
137CONFIG_HAVE_KPROBES=y 138CONFIG_HAVE_KPROBES=y
138CONFIG_HAVE_KRETPROBES=y 139CONFIG_HAVE_KRETPROBES=y
139CONFIG_HAVE_ARCH_TRACEHOOK=y 140CONFIG_HAVE_ARCH_TRACEHOOK=y
141CONFIG_HAVE_DMA_ATTRS=y
140CONFIG_HAVE_CLK=y 142CONFIG_HAVE_CLK=y
143CONFIG_HAVE_DMA_API_DEBUG=y
141 144
142# 145#
143# GCOV-based kernel profiling 146# GCOV-based kernel profiling
@@ -150,6 +153,7 @@ CONFIG_BASE_SMALL=0
150# CONFIG_MODULES is not set 153# CONFIG_MODULES is not set
151CONFIG_BLOCK=y 154CONFIG_BLOCK=y
152CONFIG_LBDAF=y 155CONFIG_LBDAF=y
156CONFIG_BLK_DEV_BSG=y
153# CONFIG_BLK_DEV_INTEGRITY is not set 157# CONFIG_BLK_DEV_INTEGRITY is not set
154 158
155# 159#
@@ -233,6 +237,7 @@ CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y
233CONFIG_ARCH_HAS_WALK_MEMORY=y 237CONFIG_ARCH_HAS_WALK_MEMORY=y
234CONFIG_ARCH_ENABLE_MEMORY_HOTREMOVE=y 238CONFIG_ARCH_ENABLE_MEMORY_HOTREMOVE=y
235# CONFIG_CRASH_DUMP is not set 239# CONFIG_CRASH_DUMP is not set
240CONFIG_MAX_ACTIVE_REGIONS=32
236CONFIG_ARCH_FLATMEM_ENABLE=y 241CONFIG_ARCH_FLATMEM_ENABLE=y
237CONFIG_ARCH_POPULATES_NODE_MAP=y 242CONFIG_ARCH_POPULATES_NODE_MAP=y
238CONFIG_FLATMEM=y 243CONFIG_FLATMEM=y
@@ -246,6 +251,7 @@ CONFIG_BOUNCE=y
246CONFIG_VIRT_TO_BUS=y 251CONFIG_VIRT_TO_BUS=y
247CONFIG_HAVE_MLOCK=y 252CONFIG_HAVE_MLOCK=y
248CONFIG_HAVE_MLOCKED_PAGE_BIT=y 253CONFIG_HAVE_MLOCKED_PAGE_BIT=y
254# CONFIG_KSM is not set
249CONFIG_DEFAULT_MMAP_MIN_ADDR=4096 255CONFIG_DEFAULT_MMAP_MIN_ADDR=4096
250CONFIG_PPC_4K_PAGES=y 256CONFIG_PPC_4K_PAGES=y
251# CONFIG_PPC_16K_PAGES is not set 257# CONFIG_PPC_16K_PAGES is not set
@@ -394,6 +400,7 @@ CONFIG_NETFILTER_ADVANCED=y
394# CONFIG_BT is not set 400# CONFIG_BT is not set
395CONFIG_WIRELESS=y 401CONFIG_WIRELESS=y
396# CONFIG_CFG80211 is not set 402# CONFIG_CFG80211 is not set
403CONFIG_CFG80211_DEFAULT_PS_VALUE=0
397CONFIG_WIRELESS_OLD_REGULATORY=y 404CONFIG_WIRELESS_OLD_REGULATORY=y
398# CONFIG_WIRELESS_EXT is not set 405# CONFIG_WIRELESS_EXT is not set
399# CONFIG_LIB80211 is not set 406# CONFIG_LIB80211 is not set
@@ -401,7 +408,6 @@ CONFIG_WIRELESS_OLD_REGULATORY=y
401# 408#
402# CFG80211 needs to be enabled for MAC80211 409# CFG80211 needs to be enabled for MAC80211
403# 410#
404CONFIG_MAC80211_DEFAULT_PS_VALUE=0
405# CONFIG_WIMAX is not set 411# CONFIG_WIMAX is not set
406# CONFIG_RFKILL is not set 412# CONFIG_RFKILL is not set
407 413
@@ -413,6 +419,7 @@ CONFIG_MAC80211_DEFAULT_PS_VALUE=0
413# Generic Driver Options 419# Generic Driver Options
414# 420#
415CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug" 421CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
422# CONFIG_DEVTMPFS is not set
416CONFIG_STANDALONE=y 423CONFIG_STANDALONE=y
417CONFIG_PREVENT_FIRMWARE_BUILD=y 424CONFIG_PREVENT_FIRMWARE_BUILD=y
418# CONFIG_FW_LOADER is not set 425# CONFIG_FW_LOADER is not set
@@ -600,7 +607,9 @@ CONFIG_MII=y
600# CONFIG_NET_PCI is not set 607# CONFIG_NET_PCI is not set
601# CONFIG_B44 is not set 608# CONFIG_B44 is not set
602# CONFIG_KS8842 is not set 609# CONFIG_KS8842 is not set
610# CONFIG_KS8851_MLL is not set
603# CONFIG_ATL2 is not set 611# CONFIG_ATL2 is not set
612# CONFIG_XILINX_EMACLITE is not set
604CONFIG_FS_ENET=y 613CONFIG_FS_ENET=y
605# CONFIG_FS_ENET_HAS_SCC is not set 614# CONFIG_FS_ENET_HAS_SCC is not set
606CONFIG_FS_ENET_HAS_FCC=y 615CONFIG_FS_ENET_HAS_FCC=y
@@ -648,10 +657,7 @@ CONFIG_CHELSIO_T3_DEPENDS=y
648# CONFIG_SFC is not set 657# CONFIG_SFC is not set
649# CONFIG_BE2NET is not set 658# CONFIG_BE2NET is not set
650# CONFIG_TR is not set 659# CONFIG_TR is not set
651 660CONFIG_WLAN=y
652#
653# Wireless LAN
654#
655# CONFIG_WLAN_PRE80211 is not set 661# CONFIG_WLAN_PRE80211 is not set
656# CONFIG_WLAN_80211 is not set 662# CONFIG_WLAN_80211 is not set
657 663
@@ -736,15 +742,19 @@ CONFIG_GPIOLIB=y
736# PCI GPIO expanders: 742# PCI GPIO expanders:
737# 743#
738# CONFIG_GPIO_BT8XX is not set 744# CONFIG_GPIO_BT8XX is not set
745# CONFIG_GPIO_LANGWELL is not set
739 746
740# 747#
741# SPI GPIO expanders: 748# SPI GPIO expanders:
742# 749#
750
751#
752# AC97 GPIO expanders:
753#
743# CONFIG_W1 is not set 754# CONFIG_W1 is not set
744# CONFIG_POWER_SUPPLY is not set 755# CONFIG_POWER_SUPPLY is not set
745# CONFIG_HWMON is not set 756# CONFIG_HWMON is not set
746# CONFIG_THERMAL is not set 757# CONFIG_THERMAL is not set
747# CONFIG_THERMAL_HWMON is not set
748# CONFIG_WATCHDOG is not set 758# CONFIG_WATCHDOG is not set
749CONFIG_SSB_POSSIBLE=y 759CONFIG_SSB_POSSIBLE=y
750 760
@@ -767,6 +777,7 @@ CONFIG_SSB_POSSIBLE=y
767# Graphics support 777# Graphics support
768# 778#
769# CONFIG_AGP is not set 779# CONFIG_AGP is not set
780CONFIG_VGA_ARB=y
770# CONFIG_DRM is not set 781# CONFIG_DRM is not set
771# CONFIG_VGASTATE is not set 782# CONFIG_VGASTATE is not set
772# CONFIG_VIDEO_OUTPUT_CONTROL is not set 783# CONFIG_VIDEO_OUTPUT_CONTROL is not set
@@ -968,6 +979,7 @@ CONFIG_ENABLE_WARN_DEPRECATED=y
968CONFIG_ENABLE_MUST_CHECK=y 979CONFIG_ENABLE_MUST_CHECK=y
969CONFIG_FRAME_WARN=1024 980CONFIG_FRAME_WARN=1024
970CONFIG_MAGIC_SYSRQ=y 981CONFIG_MAGIC_SYSRQ=y
982# CONFIG_STRIP_ASM_SYMS is not set
971# CONFIG_UNUSED_SYMBOLS is not set 983# CONFIG_UNUSED_SYMBOLS is not set
972# CONFIG_DEBUG_FS is not set 984# CONFIG_DEBUG_FS is not set
973# CONFIG_HEADERS_CHECK is not set 985# CONFIG_HEADERS_CHECK is not set
@@ -998,10 +1010,12 @@ CONFIG_DEBUG_INFO=y
998# CONFIG_DEBUG_LIST is not set 1010# CONFIG_DEBUG_LIST is not set
999# CONFIG_DEBUG_SG is not set 1011# CONFIG_DEBUG_SG is not set
1000# CONFIG_DEBUG_NOTIFIERS is not set 1012# CONFIG_DEBUG_NOTIFIERS is not set
1013# CONFIG_DEBUG_CREDENTIALS is not set
1001# CONFIG_RCU_TORTURE_TEST is not set 1014# CONFIG_RCU_TORTURE_TEST is not set
1002# CONFIG_RCU_CPU_STALL_DETECTOR is not set 1015# CONFIG_RCU_CPU_STALL_DETECTOR is not set
1003# CONFIG_BACKTRACE_SELF_TEST is not set 1016# CONFIG_BACKTRACE_SELF_TEST is not set
1004# CONFIG_DEBUG_BLOCK_EXT_DEVT is not set 1017# CONFIG_DEBUG_BLOCK_EXT_DEVT is not set
1018# CONFIG_DEBUG_FORCE_WEAK_PER_CPU is not set
1005# CONFIG_FAULT_INJECTION is not set 1019# CONFIG_FAULT_INJECTION is not set
1006# CONFIG_LATENCYTOP is not set 1020# CONFIG_LATENCYTOP is not set
1007CONFIG_SYSCTL_SYSCALL_CHECK=y 1021CONFIG_SYSCTL_SYSCALL_CHECK=y
@@ -1024,6 +1038,7 @@ CONFIG_BRANCH_PROFILE_NONE=y
1024# CONFIG_KMEMTRACE is not set 1038# CONFIG_KMEMTRACE is not set
1025# CONFIG_WORKQUEUE_TRACER is not set 1039# CONFIG_WORKQUEUE_TRACER is not set
1026# CONFIG_BLK_DEV_IO_TRACE is not set 1040# CONFIG_BLK_DEV_IO_TRACE is not set
1041# CONFIG_DMA_API_DEBUG is not set
1027# CONFIG_SAMPLES is not set 1042# CONFIG_SAMPLES is not set
1028CONFIG_HAVE_ARCH_KGDB=y 1043CONFIG_HAVE_ARCH_KGDB=y
1029# CONFIG_PPC_DISABLE_WERROR is not set 1044# CONFIG_PPC_DISABLE_WERROR is not set
@@ -1052,7 +1067,6 @@ CONFIG_CRYPTO=y
1052# 1067#
1053# Crypto core or helper 1068# Crypto core or helper
1054# 1069#
1055# CONFIG_CRYPTO_FIPS is not set
1056CONFIG_CRYPTO_ALGAPI=y 1070CONFIG_CRYPTO_ALGAPI=y
1057CONFIG_CRYPTO_ALGAPI2=y 1071CONFIG_CRYPTO_ALGAPI2=y
1058CONFIG_CRYPTO_AEAD2=y 1072CONFIG_CRYPTO_AEAD2=y
@@ -1094,6 +1108,7 @@ CONFIG_CRYPTO_PCBC=y
1094# Digest 1108# Digest
1095# 1109#
1096# CONFIG_CRYPTO_CRC32C is not set 1110# CONFIG_CRYPTO_CRC32C is not set
1111# CONFIG_CRYPTO_GHASH is not set
1097# CONFIG_CRYPTO_MD4 is not set 1112# CONFIG_CRYPTO_MD4 is not set
1098CONFIG_CRYPTO_MD5=y 1113CONFIG_CRYPTO_MD5=y
1099# CONFIG_CRYPTO_MICHAEL_MIC is not set 1114# CONFIG_CRYPTO_MICHAEL_MIC is not set
diff --git a/arch/powerpc/configs/ep88xc_defconfig b/arch/powerpc/configs/ep88xc_defconfig
index 2c292e25cc01..73ef9be41280 100644
--- a/arch/powerpc/configs/ep88xc_defconfig
+++ b/arch/powerpc/configs/ep88xc_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.31-rc4 3# Linux kernel version: 2.6.32-rc5
4# Wed Jul 29 23:31:49 2009 4# Thu Nov 5 08:20:07 2009
5# 5#
6# CONFIG_PPC64 is not set 6# CONFIG_PPC64 is not set
7 7
@@ -16,6 +16,7 @@ CONFIG_PPC_8xx=y
16# CONFIG_E200 is not set 16# CONFIG_E200 is not set
17CONFIG_8xx=y 17CONFIG_8xx=y
18CONFIG_PPC_MMU_NOHASH=y 18CONFIG_PPC_MMU_NOHASH=y
19CONFIG_PPC_MMU_NOHASH_32=y
19# CONFIG_PPC_MM_SLICES is not set 20# CONFIG_PPC_MM_SLICES is not set
20CONFIG_NOT_COHERENT_CACHE=y 21CONFIG_NOT_COHERENT_CACHE=y
21CONFIG_PPC32=y 22CONFIG_PPC32=y
@@ -29,6 +30,7 @@ CONFIG_GENERIC_CLOCKEVENTS=y
29CONFIG_GENERIC_HARDIRQS=y 30CONFIG_GENERIC_HARDIRQS=y
30CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y 31CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y
31# CONFIG_HAVE_SETUP_PER_CPU_AREA is not set 32# CONFIG_HAVE_SETUP_PER_CPU_AREA is not set
33# CONFIG_NEED_PER_CPU_EMBED_FIRST_CHUNK is not set
32CONFIG_IRQ_PER_CPU=y 34CONFIG_IRQ_PER_CPU=y
33CONFIG_STACKTRACE_SUPPORT=y 35CONFIG_STACKTRACE_SUPPORT=y
34CONFIG_HAVE_LATENCYTOP_SUPPORT=y 36CONFIG_HAVE_LATENCYTOP_SUPPORT=y
@@ -77,11 +79,12 @@ CONFIG_SYSVIPC_SYSCTL=y
77# 79#
78# RCU Subsystem 80# RCU Subsystem
79# 81#
80CONFIG_CLASSIC_RCU=y 82CONFIG_TREE_RCU=y
81# CONFIG_TREE_RCU is not set 83# CONFIG_TREE_PREEMPT_RCU is not set
82# CONFIG_PREEMPT_RCU is not set 84# CONFIG_RCU_TRACE is not set
85CONFIG_RCU_FANOUT=32
86# CONFIG_RCU_FANOUT_EXACT is not set
83# CONFIG_TREE_RCU_TRACE is not set 87# CONFIG_TREE_RCU_TRACE is not set
84# CONFIG_PREEMPT_RCU_TRACE is not set
85# CONFIG_IKCONFIG is not set 88# CONFIG_IKCONFIG is not set
86CONFIG_LOG_BUF_SHIFT=14 89CONFIG_LOG_BUF_SHIFT=14
87CONFIG_GROUP_SCHED=y 90CONFIG_GROUP_SCHED=y
@@ -115,28 +118,29 @@ CONFIG_TIMERFD=y
115CONFIG_EVENTFD=y 118CONFIG_EVENTFD=y
116CONFIG_SHMEM=y 119CONFIG_SHMEM=y
117CONFIG_AIO=y 120CONFIG_AIO=y
118CONFIG_HAVE_PERF_COUNTERS=y 121CONFIG_HAVE_PERF_EVENTS=y
119 122
120# 123#
121# Performance Counters 124# Kernel Performance Events And Counters
122# 125#
126# CONFIG_PERF_EVENTS is not set
123# CONFIG_PERF_COUNTERS is not set 127# CONFIG_PERF_COUNTERS is not set
124# CONFIG_VM_EVENT_COUNTERS is not set 128# CONFIG_VM_EVENT_COUNTERS is not set
125CONFIG_SLUB_DEBUG=y 129CONFIG_SLUB_DEBUG=y
126# CONFIG_STRIP_ASM_SYMS is not set
127CONFIG_COMPAT_BRK=y 130CONFIG_COMPAT_BRK=y
128# CONFIG_SLAB is not set 131# CONFIG_SLAB is not set
129CONFIG_SLUB=y 132CONFIG_SLUB=y
130# CONFIG_SLOB is not set 133# CONFIG_SLOB is not set
131# CONFIG_PROFILING is not set 134# CONFIG_PROFILING is not set
132# CONFIG_MARKERS is not set
133CONFIG_HAVE_OPROFILE=y 135CONFIG_HAVE_OPROFILE=y
134CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS=y 136CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS=y
135CONFIG_HAVE_IOREMAP_PROT=y 137CONFIG_HAVE_IOREMAP_PROT=y
136CONFIG_HAVE_KPROBES=y 138CONFIG_HAVE_KPROBES=y
137CONFIG_HAVE_KRETPROBES=y 139CONFIG_HAVE_KRETPROBES=y
138CONFIG_HAVE_ARCH_TRACEHOOK=y 140CONFIG_HAVE_ARCH_TRACEHOOK=y
141CONFIG_HAVE_DMA_ATTRS=y
139CONFIG_HAVE_CLK=y 142CONFIG_HAVE_CLK=y
143CONFIG_HAVE_DMA_API_DEBUG=y
140 144
141# 145#
142# GCOV-based kernel profiling 146# GCOV-based kernel profiling
@@ -234,10 +238,10 @@ CONFIG_BINFMT_ELF=y
234CONFIG_8XX_MINIMAL_FPEMU=y 238CONFIG_8XX_MINIMAL_FPEMU=y
235# CONFIG_IOMMU_HELPER is not set 239# CONFIG_IOMMU_HELPER is not set
236# CONFIG_SWIOTLB is not set 240# CONFIG_SWIOTLB is not set
237CONFIG_PPC_NEED_DMA_SYNC_OPS=y
238CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y 241CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y
239CONFIG_ARCH_HAS_WALK_MEMORY=y 242CONFIG_ARCH_HAS_WALK_MEMORY=y
240CONFIG_ARCH_ENABLE_MEMORY_HOTREMOVE=y 243CONFIG_ARCH_ENABLE_MEMORY_HOTREMOVE=y
244CONFIG_MAX_ACTIVE_REGIONS=32
241CONFIG_ARCH_FLATMEM_ENABLE=y 245CONFIG_ARCH_FLATMEM_ENABLE=y
242CONFIG_ARCH_POPULATES_NODE_MAP=y 246CONFIG_ARCH_POPULATES_NODE_MAP=y
243CONFIG_SELECT_MEMORY_MODEL=y 247CONFIG_SELECT_MEMORY_MODEL=y
@@ -255,6 +259,7 @@ CONFIG_BOUNCE=y
255CONFIG_VIRT_TO_BUS=y 259CONFIG_VIRT_TO_BUS=y
256CONFIG_HAVE_MLOCK=y 260CONFIG_HAVE_MLOCK=y
257CONFIG_HAVE_MLOCKED_PAGE_BIT=y 261CONFIG_HAVE_MLOCKED_PAGE_BIT=y
262# CONFIG_KSM is not set
258CONFIG_DEFAULT_MMAP_MIN_ADDR=4096 263CONFIG_DEFAULT_MMAP_MIN_ADDR=4096
259CONFIG_PPC_4K_PAGES=y 264CONFIG_PPC_4K_PAGES=y
260# CONFIG_PPC_16K_PAGES is not set 265# CONFIG_PPC_16K_PAGES is not set
@@ -337,6 +342,7 @@ CONFIG_DEFAULT_TCP_CONG="cubic"
337# CONFIG_NETFILTER is not set 342# CONFIG_NETFILTER is not set
338# CONFIG_IP_DCCP is not set 343# CONFIG_IP_DCCP is not set
339# CONFIG_IP_SCTP is not set 344# CONFIG_IP_SCTP is not set
345# CONFIG_RDS is not set
340# CONFIG_TIPC is not set 346# CONFIG_TIPC is not set
341# CONFIG_ATM is not set 347# CONFIG_ATM is not set
342# CONFIG_BRIDGE is not set 348# CONFIG_BRIDGE is not set
@@ -366,6 +372,7 @@ CONFIG_DEFAULT_TCP_CONG="cubic"
366# CONFIG_AF_RXRPC is not set 372# CONFIG_AF_RXRPC is not set
367CONFIG_WIRELESS=y 373CONFIG_WIRELESS=y
368# CONFIG_CFG80211 is not set 374# CONFIG_CFG80211 is not set
375CONFIG_CFG80211_DEFAULT_PS_VALUE=0
369CONFIG_WIRELESS_OLD_REGULATORY=y 376CONFIG_WIRELESS_OLD_REGULATORY=y
370# CONFIG_WIRELESS_EXT is not set 377# CONFIG_WIRELESS_EXT is not set
371# CONFIG_LIB80211 is not set 378# CONFIG_LIB80211 is not set
@@ -373,7 +380,6 @@ CONFIG_WIRELESS_OLD_REGULATORY=y
373# 380#
374# CFG80211 needs to be enabled for MAC80211 381# CFG80211 needs to be enabled for MAC80211
375# 382#
376CONFIG_MAC80211_DEFAULT_PS_VALUE=0
377# CONFIG_WIMAX is not set 383# CONFIG_WIMAX is not set
378# CONFIG_RFKILL is not set 384# CONFIG_RFKILL is not set
379# CONFIG_NET_9P is not set 385# CONFIG_NET_9P is not set
@@ -386,6 +392,7 @@ CONFIG_MAC80211_DEFAULT_PS_VALUE=0
386# Generic Driver Options 392# Generic Driver Options
387# 393#
388CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug" 394CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
395# CONFIG_DEVTMPFS is not set
389CONFIG_STANDALONE=y 396CONFIG_STANDALONE=y
390CONFIG_PREVENT_FIRMWARE_BUILD=y 397CONFIG_PREVENT_FIRMWARE_BUILD=y
391# CONFIG_FW_LOADER is not set 398# CONFIG_FW_LOADER is not set
@@ -529,16 +536,15 @@ CONFIG_MII=y
529# CONFIG_IBM_NEW_EMAC_MAL_COMMON_ERR is not set 536# CONFIG_IBM_NEW_EMAC_MAL_COMMON_ERR is not set
530# CONFIG_B44 is not set 537# CONFIG_B44 is not set
531# CONFIG_KS8842 is not set 538# CONFIG_KS8842 is not set
539# CONFIG_KS8851_MLL is not set
540# CONFIG_XILINX_EMACLITE is not set
532CONFIG_FS_ENET=y 541CONFIG_FS_ENET=y
533# CONFIG_FS_ENET_HAS_SCC is not set 542# CONFIG_FS_ENET_HAS_SCC is not set
534CONFIG_FS_ENET_HAS_FEC=y 543CONFIG_FS_ENET_HAS_FEC=y
535CONFIG_FS_ENET_MDIO_FEC=y 544CONFIG_FS_ENET_MDIO_FEC=y
536# CONFIG_NETDEV_1000 is not set 545# CONFIG_NETDEV_1000 is not set
537# CONFIG_NETDEV_10000 is not set 546# CONFIG_NETDEV_10000 is not set
538 547CONFIG_WLAN=y
539#
540# Wireless LAN
541#
542# CONFIG_WLAN_PRE80211 is not set 548# CONFIG_WLAN_PRE80211 is not set
543# CONFIG_WLAN_80211 is not set 549# CONFIG_WLAN_80211 is not set
544 550
@@ -611,7 +617,6 @@ CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y
611# CONFIG_POWER_SUPPLY is not set 617# CONFIG_POWER_SUPPLY is not set
612# CONFIG_HWMON is not set 618# CONFIG_HWMON is not set
613# CONFIG_THERMAL is not set 619# CONFIG_THERMAL is not set
614# CONFIG_THERMAL_HWMON is not set
615# CONFIG_WATCHDOG is not set 620# CONFIG_WATCHDOG is not set
616CONFIG_SSB_POSSIBLE=y 621CONFIG_SSB_POSSIBLE=y
617 622
@@ -672,6 +677,7 @@ CONFIG_SSB_POSSIBLE=y
672# CONFIG_GFS2_FS is not set 677# CONFIG_GFS2_FS is not set
673# CONFIG_OCFS2_FS is not set 678# CONFIG_OCFS2_FS is not set
674# CONFIG_BTRFS_FS is not set 679# CONFIG_BTRFS_FS is not set
680# CONFIG_NILFS2_FS is not set
675CONFIG_FILE_LOCKING=y 681CONFIG_FILE_LOCKING=y
676CONFIG_FSNOTIFY=y 682CONFIG_FSNOTIFY=y
677# CONFIG_DNOTIFY is not set 683# CONFIG_DNOTIFY is not set
@@ -731,7 +737,6 @@ CONFIG_CRAMFS=y
731# CONFIG_ROMFS_FS is not set 737# CONFIG_ROMFS_FS is not set
732# CONFIG_SYSV_FS is not set 738# CONFIG_SYSV_FS is not set
733# CONFIG_UFS_FS is not set 739# CONFIG_UFS_FS is not set
734# CONFIG_NILFS2_FS is not set
735CONFIG_NETWORK_FILESYSTEMS=y 740CONFIG_NETWORK_FILESYSTEMS=y
736CONFIG_NFS_FS=y 741CONFIG_NFS_FS=y
737CONFIG_NFS_V3=y 742CONFIG_NFS_V3=y
@@ -803,6 +808,7 @@ CONFIG_ENABLE_WARN_DEPRECATED=y
803CONFIG_ENABLE_MUST_CHECK=y 808CONFIG_ENABLE_MUST_CHECK=y
804CONFIG_FRAME_WARN=1024 809CONFIG_FRAME_WARN=1024
805CONFIG_MAGIC_SYSRQ=y 810CONFIG_MAGIC_SYSRQ=y
811# CONFIG_STRIP_ASM_SYMS is not set
806# CONFIG_UNUSED_SYMBOLS is not set 812# CONFIG_UNUSED_SYMBOLS is not set
807# CONFIG_DEBUG_FS is not set 813# CONFIG_DEBUG_FS is not set
808# CONFIG_HEADERS_CHECK is not set 814# CONFIG_HEADERS_CHECK is not set
@@ -820,6 +826,7 @@ CONFIG_SCHED_DEBUG=y
820# CONFIG_DEBUG_OBJECTS is not set 826# CONFIG_DEBUG_OBJECTS is not set
821# CONFIG_SLUB_DEBUG_ON is not set 827# CONFIG_SLUB_DEBUG_ON is not set
822# CONFIG_SLUB_STATS is not set 828# CONFIG_SLUB_STATS is not set
829# CONFIG_DEBUG_KMEMLEAK is not set
823# CONFIG_DEBUG_SPINLOCK is not set 830# CONFIG_DEBUG_SPINLOCK is not set
824# CONFIG_DEBUG_MUTEXES is not set 831# CONFIG_DEBUG_MUTEXES is not set
825# CONFIG_DEBUG_LOCK_ALLOC is not set 832# CONFIG_DEBUG_LOCK_ALLOC is not set
@@ -836,10 +843,12 @@ CONFIG_DEBUG_INFO=y
836# CONFIG_DEBUG_LIST is not set 843# CONFIG_DEBUG_LIST is not set
837# CONFIG_DEBUG_SG is not set 844# CONFIG_DEBUG_SG is not set
838# CONFIG_DEBUG_NOTIFIERS is not set 845# CONFIG_DEBUG_NOTIFIERS is not set
846# CONFIG_DEBUG_CREDENTIALS is not set
839# CONFIG_RCU_TORTURE_TEST is not set 847# CONFIG_RCU_TORTURE_TEST is not set
840# CONFIG_RCU_CPU_STALL_DETECTOR is not set 848# CONFIG_RCU_CPU_STALL_DETECTOR is not set
841# CONFIG_BACKTRACE_SELF_TEST is not set 849# CONFIG_BACKTRACE_SELF_TEST is not set
842# CONFIG_DEBUG_BLOCK_EXT_DEVT is not set 850# CONFIG_DEBUG_BLOCK_EXT_DEVT is not set
851# CONFIG_DEBUG_FORCE_WEAK_PER_CPU is not set
843# CONFIG_FAULT_INJECTION is not set 852# CONFIG_FAULT_INJECTION is not set
844# CONFIG_LATENCYTOP is not set 853# CONFIG_LATENCYTOP is not set
845# CONFIG_DEBUG_PAGEALLOC is not set 854# CONFIG_DEBUG_PAGEALLOC is not set
@@ -861,10 +870,10 @@ CONFIG_BRANCH_PROFILE_NONE=y
861# CONFIG_KMEMTRACE is not set 870# CONFIG_KMEMTRACE is not set
862# CONFIG_WORKQUEUE_TRACER is not set 871# CONFIG_WORKQUEUE_TRACER is not set
863# CONFIG_BLK_DEV_IO_TRACE is not set 872# CONFIG_BLK_DEV_IO_TRACE is not set
873# CONFIG_DMA_API_DEBUG is not set
864# CONFIG_SAMPLES is not set 874# CONFIG_SAMPLES is not set
865CONFIG_HAVE_ARCH_KGDB=y 875CONFIG_HAVE_ARCH_KGDB=y
866# CONFIG_KGDB is not set 876# CONFIG_KGDB is not set
867# CONFIG_KMEMCHECK is not set
868# CONFIG_PPC_DISABLE_WERROR is not set 877# CONFIG_PPC_DISABLE_WERROR is not set
869CONFIG_PPC_WERROR=y 878CONFIG_PPC_WERROR=y
870CONFIG_PRINT_STACK_DEPTH=64 879CONFIG_PRINT_STACK_DEPTH=64
diff --git a/arch/powerpc/configs/linkstation_defconfig b/arch/powerpc/configs/linkstation_defconfig
index 45671e7dd2c7..63c3e8de8f16 100644
--- a/arch/powerpc/configs/linkstation_defconfig
+++ b/arch/powerpc/configs/linkstation_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.31-rc4 3# Linux kernel version: 2.6.32-rc5
4# Wed Jul 29 23:31:50 2009 4# Thu Nov 5 08:20:08 2009
5# 5#
6# CONFIG_PPC64 is not set 6# CONFIG_PPC64 is not set
7 7
@@ -34,6 +34,7 @@ CONFIG_GENERIC_CLOCKEVENTS=y
34CONFIG_GENERIC_HARDIRQS=y 34CONFIG_GENERIC_HARDIRQS=y
35CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y 35CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y
36# CONFIG_HAVE_SETUP_PER_CPU_AREA is not set 36# CONFIG_HAVE_SETUP_PER_CPU_AREA is not set
37# CONFIG_NEED_PER_CPU_EMBED_FIRST_CHUNK is not set
37CONFIG_IRQ_PER_CPU=y 38CONFIG_IRQ_PER_CPU=y
38CONFIG_STACKTRACE_SUPPORT=y 39CONFIG_STACKTRACE_SUPPORT=y
39CONFIG_HAVE_LATENCYTOP_SUPPORT=y 40CONFIG_HAVE_LATENCYTOP_SUPPORT=y
@@ -83,11 +84,12 @@ CONFIG_POSIX_MQUEUE_SYSCTL=y
83# 84#
84# RCU Subsystem 85# RCU Subsystem
85# 86#
86CONFIG_CLASSIC_RCU=y 87CONFIG_TREE_RCU=y
87# CONFIG_TREE_RCU is not set 88# CONFIG_TREE_PREEMPT_RCU is not set
88# CONFIG_PREEMPT_RCU is not set 89# CONFIG_RCU_TRACE is not set
90CONFIG_RCU_FANOUT=32
91# CONFIG_RCU_FANOUT_EXACT is not set
89# CONFIG_TREE_RCU_TRACE is not set 92# CONFIG_TREE_RCU_TRACE is not set
90# CONFIG_PREEMPT_RCU_TRACE is not set
91CONFIG_IKCONFIG=y 93CONFIG_IKCONFIG=y
92CONFIG_IKCONFIG_PROC=y 94CONFIG_IKCONFIG_PROC=y
93CONFIG_LOG_BUF_SHIFT=14 95CONFIG_LOG_BUF_SHIFT=14
@@ -131,22 +133,21 @@ CONFIG_TIMERFD=y
131CONFIG_EVENTFD=y 133CONFIG_EVENTFD=y
132CONFIG_SHMEM=y 134CONFIG_SHMEM=y
133CONFIG_AIO=y 135CONFIG_AIO=y
134CONFIG_HAVE_PERF_COUNTERS=y 136CONFIG_HAVE_PERF_EVENTS=y
135 137
136# 138#
137# Performance Counters 139# Kernel Performance Events And Counters
138# 140#
141# CONFIG_PERF_EVENTS is not set
139# CONFIG_PERF_COUNTERS is not set 142# CONFIG_PERF_COUNTERS is not set
140CONFIG_VM_EVENT_COUNTERS=y 143CONFIG_VM_EVENT_COUNTERS=y
141CONFIG_PCI_QUIRKS=y 144CONFIG_PCI_QUIRKS=y
142CONFIG_SLUB_DEBUG=y 145CONFIG_SLUB_DEBUG=y
143# CONFIG_STRIP_ASM_SYMS is not set
144# CONFIG_COMPAT_BRK is not set 146# CONFIG_COMPAT_BRK is not set
145# CONFIG_SLAB is not set 147# CONFIG_SLAB is not set
146CONFIG_SLUB=y 148CONFIG_SLUB=y
147# CONFIG_SLOB is not set 149# CONFIG_SLOB is not set
148# CONFIG_PROFILING is not set 150# CONFIG_PROFILING is not set
149# CONFIG_MARKERS is not set
150CONFIG_HAVE_OPROFILE=y 151CONFIG_HAVE_OPROFILE=y
151# CONFIG_KPROBES is not set 152# CONFIG_KPROBES is not set
152CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS=y 153CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS=y
@@ -154,11 +155,13 @@ CONFIG_HAVE_IOREMAP_PROT=y
154CONFIG_HAVE_KPROBES=y 155CONFIG_HAVE_KPROBES=y
155CONFIG_HAVE_KRETPROBES=y 156CONFIG_HAVE_KRETPROBES=y
156CONFIG_HAVE_ARCH_TRACEHOOK=y 157CONFIG_HAVE_ARCH_TRACEHOOK=y
158CONFIG_HAVE_DMA_ATTRS=y
159CONFIG_HAVE_DMA_API_DEBUG=y
157 160
158# 161#
159# GCOV-based kernel profiling 162# GCOV-based kernel profiling
160# 163#
161# CONFIG_SLOW_WORK is not set 164CONFIG_SLOW_WORK=y
162# CONFIG_HAVE_GENERIC_DMA_COHERENT is not set 165# CONFIG_HAVE_GENERIC_DMA_COHERENT is not set
163CONFIG_SLABINFO=y 166CONFIG_SLABINFO=y
164CONFIG_RT_MUTEXES=y 167CONFIG_RT_MUTEXES=y
@@ -258,6 +261,7 @@ CONFIG_ARCH_HAS_WALK_MEMORY=y
258CONFIG_ARCH_ENABLE_MEMORY_HOTREMOVE=y 261CONFIG_ARCH_ENABLE_MEMORY_HOTREMOVE=y
259# CONFIG_KEXEC is not set 262# CONFIG_KEXEC is not set
260# CONFIG_CRASH_DUMP is not set 263# CONFIG_CRASH_DUMP is not set
264CONFIG_MAX_ACTIVE_REGIONS=32
261CONFIG_ARCH_FLATMEM_ENABLE=y 265CONFIG_ARCH_FLATMEM_ENABLE=y
262CONFIG_ARCH_POPULATES_NODE_MAP=y 266CONFIG_ARCH_POPULATES_NODE_MAP=y
263CONFIG_SELECT_MEMORY_MODEL=y 267CONFIG_SELECT_MEMORY_MODEL=y
@@ -275,6 +279,7 @@ CONFIG_BOUNCE=y
275CONFIG_VIRT_TO_BUS=y 279CONFIG_VIRT_TO_BUS=y
276CONFIG_HAVE_MLOCK=y 280CONFIG_HAVE_MLOCK=y
277CONFIG_HAVE_MLOCKED_PAGE_BIT=y 281CONFIG_HAVE_MLOCKED_PAGE_BIT=y
282# CONFIG_KSM is not set
278CONFIG_DEFAULT_MMAP_MIN_ADDR=4096 283CONFIG_DEFAULT_MMAP_MIN_ADDR=4096
279CONFIG_PPC_4K_PAGES=y 284CONFIG_PPC_4K_PAGES=y
280# CONFIG_PPC_16K_PAGES is not set 285# CONFIG_PPC_16K_PAGES is not set
@@ -482,6 +487,7 @@ CONFIG_IP_NF_ARPFILTER=m
482CONFIG_IP_NF_ARP_MANGLE=m 487CONFIG_IP_NF_ARP_MANGLE=m
483# CONFIG_IP_DCCP is not set 488# CONFIG_IP_DCCP is not set
484# CONFIG_IP_SCTP is not set 489# CONFIG_IP_SCTP is not set
490# CONFIG_RDS is not set
485# CONFIG_TIPC is not set 491# CONFIG_TIPC is not set
486# CONFIG_ATM is not set 492# CONFIG_ATM is not set
487# CONFIG_BRIDGE is not set 493# CONFIG_BRIDGE is not set
@@ -511,6 +517,7 @@ CONFIG_IP_NF_ARP_MANGLE=m
511# CONFIG_AF_RXRPC is not set 517# CONFIG_AF_RXRPC is not set
512CONFIG_WIRELESS=y 518CONFIG_WIRELESS=y
513# CONFIG_CFG80211 is not set 519# CONFIG_CFG80211 is not set
520CONFIG_CFG80211_DEFAULT_PS_VALUE=0
514CONFIG_WIRELESS_OLD_REGULATORY=y 521CONFIG_WIRELESS_OLD_REGULATORY=y
515CONFIG_WIRELESS_EXT=y 522CONFIG_WIRELESS_EXT=y
516CONFIG_WIRELESS_EXT_SYSFS=y 523CONFIG_WIRELESS_EXT_SYSFS=y
@@ -519,7 +526,6 @@ CONFIG_WIRELESS_EXT_SYSFS=y
519# 526#
520# CFG80211 needs to be enabled for MAC80211 527# CFG80211 needs to be enabled for MAC80211
521# 528#
522CONFIG_MAC80211_DEFAULT_PS_VALUE=0
523# CONFIG_WIMAX is not set 529# CONFIG_WIMAX is not set
524# CONFIG_RFKILL is not set 530# CONFIG_RFKILL is not set
525# CONFIG_NET_9P is not set 531# CONFIG_NET_9P is not set
@@ -532,6 +538,7 @@ CONFIG_MAC80211_DEFAULT_PS_VALUE=0
532# Generic Driver Options 538# Generic Driver Options
533# 539#
534CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug" 540CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
541# CONFIG_DEVTMPFS is not set
535CONFIG_STANDALONE=y 542CONFIG_STANDALONE=y
536CONFIG_PREVENT_FIRMWARE_BUILD=y 543CONFIG_PREVENT_FIRMWARE_BUILD=y
537CONFIG_FW_LOADER=y 544CONFIG_FW_LOADER=y
@@ -543,9 +550,9 @@ CONFIG_EXTRA_FIRMWARE=""
543# CONFIG_CONNECTOR is not set 550# CONFIG_CONNECTOR is not set
544CONFIG_MTD=y 551CONFIG_MTD=y
545# CONFIG_MTD_DEBUG is not set 552# CONFIG_MTD_DEBUG is not set
553# CONFIG_MTD_TESTS is not set
546CONFIG_MTD_CONCAT=y 554CONFIG_MTD_CONCAT=y
547CONFIG_MTD_PARTITIONS=y 555CONFIG_MTD_PARTITIONS=y
548# CONFIG_MTD_TESTS is not set
549# CONFIG_MTD_REDBOOT_PARTS is not set 556# CONFIG_MTD_REDBOOT_PARTS is not set
550CONFIG_MTD_CMDLINE_PARTS=y 557CONFIG_MTD_CMDLINE_PARTS=y
551CONFIG_MTD_OF_PARTS=y 558CONFIG_MTD_OF_PARTS=y
@@ -711,6 +718,7 @@ CONFIG_SCSI_LOWLEVEL=y
711# CONFIG_ISCSI_TCP is not set 718# CONFIG_ISCSI_TCP is not set
712# CONFIG_SCSI_CXGB3_ISCSI is not set 719# CONFIG_SCSI_CXGB3_ISCSI is not set
713# CONFIG_SCSI_BNX2_ISCSI is not set 720# CONFIG_SCSI_BNX2_ISCSI is not set
721# CONFIG_BE2ISCSI is not set
714# CONFIG_BLK_DEV_3W_XXXX_RAID is not set 722# CONFIG_BLK_DEV_3W_XXXX_RAID is not set
715# CONFIG_SCSI_3W_9XXX is not set 723# CONFIG_SCSI_3W_9XXX is not set
716# CONFIG_SCSI_ACARD is not set 724# CONFIG_SCSI_ACARD is not set
@@ -750,11 +758,14 @@ CONFIG_SCSI_LOWLEVEL=y
750# CONFIG_SCSI_DC390T is not set 758# CONFIG_SCSI_DC390T is not set
751# CONFIG_SCSI_NSP32 is not set 759# CONFIG_SCSI_NSP32 is not set
752# CONFIG_SCSI_DEBUG is not set 760# CONFIG_SCSI_DEBUG is not set
761# CONFIG_SCSI_PMCRAID is not set
753# CONFIG_SCSI_SRP is not set 762# CONFIG_SCSI_SRP is not set
763# CONFIG_SCSI_BFA_FC is not set
754# CONFIG_SCSI_DH is not set 764# CONFIG_SCSI_DH is not set
755# CONFIG_SCSI_OSD_INITIATOR is not set 765# CONFIG_SCSI_OSD_INITIATOR is not set
756CONFIG_ATA=y 766CONFIG_ATA=y
757# CONFIG_ATA_NONSTANDARD is not set 767# CONFIG_ATA_NONSTANDARD is not set
768CONFIG_ATA_VERBOSE_ERROR=y
758CONFIG_SATA_PMP=y 769CONFIG_SATA_PMP=y
759# CONFIG_SATA_AHCI is not set 770# CONFIG_SATA_AHCI is not set
760# CONFIG_SATA_SIL24 is not set 771# CONFIG_SATA_SIL24 is not set
@@ -777,6 +788,7 @@ CONFIG_ATA_SFF=y
777# CONFIG_PATA_ALI is not set 788# CONFIG_PATA_ALI is not set
778# CONFIG_PATA_AMD is not set 789# CONFIG_PATA_AMD is not set
779# CONFIG_PATA_ARTOP is not set 790# CONFIG_PATA_ARTOP is not set
791# CONFIG_PATA_ATP867X is not set
780# CONFIG_PATA_ATIIXP is not set 792# CONFIG_PATA_ATIIXP is not set
781# CONFIG_PATA_CMD640_PCI is not set 793# CONFIG_PATA_CMD640_PCI is not set
782# CONFIG_PATA_CMD64X is not set 794# CONFIG_PATA_CMD64X is not set
@@ -804,6 +816,7 @@ CONFIG_PATA_IT821X=y
804# CONFIG_PATA_OPTIDMA is not set 816# CONFIG_PATA_OPTIDMA is not set
805# CONFIG_PATA_PDC_OLD is not set 817# CONFIG_PATA_PDC_OLD is not set
806# CONFIG_PATA_RADISYS is not set 818# CONFIG_PATA_RADISYS is not set
819# CONFIG_PATA_RDC is not set
807# CONFIG_PATA_RZ1000 is not set 820# CONFIG_PATA_RZ1000 is not set
808# CONFIG_PATA_SC1200 is not set 821# CONFIG_PATA_SC1200 is not set
809# CONFIG_PATA_SERVERWORKS is not set 822# CONFIG_PATA_SERVERWORKS is not set
@@ -870,7 +883,9 @@ CONFIG_TULIP_MMIO=y
870# CONFIG_NET_PCI is not set 883# CONFIG_NET_PCI is not set
871# CONFIG_B44 is not set 884# CONFIG_B44 is not set
872# CONFIG_KS8842 is not set 885# CONFIG_KS8842 is not set
886# CONFIG_KS8851_MLL is not set
873# CONFIG_ATL2 is not set 887# CONFIG_ATL2 is not set
888# CONFIG_XILINX_EMACLITE is not set
874CONFIG_NETDEV_1000=y 889CONFIG_NETDEV_1000=y
875# CONFIG_ACENIC is not set 890# CONFIG_ACENIC is not set
876# CONFIG_DL2K is not set 891# CONFIG_DL2K is not set
@@ -918,10 +933,7 @@ CONFIG_CHELSIO_T3_DEPENDS=y
918# CONFIG_SFC is not set 933# CONFIG_SFC is not set
919# CONFIG_BE2NET is not set 934# CONFIG_BE2NET is not set
920# CONFIG_TR is not set 935# CONFIG_TR is not set
921 936CONFIG_WLAN=y
922#
923# Wireless LAN
924#
925# CONFIG_WLAN_PRE80211 is not set 937# CONFIG_WLAN_PRE80211 is not set
926# CONFIG_WLAN_80211 is not set 938# CONFIG_WLAN_80211 is not set
927 939
@@ -1043,6 +1055,7 @@ CONFIG_HW_RANDOM=y
1043CONFIG_DEVPORT=y 1055CONFIG_DEVPORT=y
1044CONFIG_I2C=y 1056CONFIG_I2C=y
1045CONFIG_I2C_BOARDINFO=y 1057CONFIG_I2C_BOARDINFO=y
1058CONFIG_I2C_COMPAT=y
1046CONFIG_I2C_CHARDEV=y 1059CONFIG_I2C_CHARDEV=y
1047CONFIG_I2C_HELPER_AUTO=y 1060CONFIG_I2C_HELPER_AUTO=y
1048 1061
@@ -1097,9 +1110,6 @@ CONFIG_I2C_MPC=y
1097# Miscellaneous I2C Chip support 1110# Miscellaneous I2C Chip support
1098# 1111#
1099# CONFIG_DS1682 is not set 1112# CONFIG_DS1682 is not set
1100# CONFIG_SENSORS_PCF8574 is not set
1101# CONFIG_PCF8575 is not set
1102# CONFIG_SENSORS_PCA9539 is not set
1103# CONFIG_SENSORS_TSL2550 is not set 1113# CONFIG_SENSORS_TSL2550 is not set
1104# CONFIG_I2C_DEBUG_CORE is not set 1114# CONFIG_I2C_DEBUG_CORE is not set
1105# CONFIG_I2C_DEBUG_ALGO is not set 1115# CONFIG_I2C_DEBUG_ALGO is not set
@@ -1117,6 +1127,11 @@ CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y
1117# CONFIG_POWER_SUPPLY is not set 1127# CONFIG_POWER_SUPPLY is not set
1118CONFIG_HWMON=y 1128CONFIG_HWMON=y
1119# CONFIG_HWMON_VID is not set 1129# CONFIG_HWMON_VID is not set
1130# CONFIG_HWMON_DEBUG_CHIP is not set
1131
1132#
1133# Native drivers
1134#
1120# CONFIG_SENSORS_AD7414 is not set 1135# CONFIG_SENSORS_AD7414 is not set
1121# CONFIG_SENSORS_AD7418 is not set 1136# CONFIG_SENSORS_AD7418 is not set
1122# CONFIG_SENSORS_ADM1021 is not set 1137# CONFIG_SENSORS_ADM1021 is not set
@@ -1166,6 +1181,7 @@ CONFIG_HWMON=y
1166# CONFIG_SENSORS_ADS7828 is not set 1181# CONFIG_SENSORS_ADS7828 is not set
1167# CONFIG_SENSORS_THMC50 is not set 1182# CONFIG_SENSORS_THMC50 is not set
1168# CONFIG_SENSORS_TMP401 is not set 1183# CONFIG_SENSORS_TMP401 is not set
1184# CONFIG_SENSORS_TMP421 is not set
1169# CONFIG_SENSORS_VIA686A is not set 1185# CONFIG_SENSORS_VIA686A is not set
1170# CONFIG_SENSORS_VT1211 is not set 1186# CONFIG_SENSORS_VT1211 is not set
1171# CONFIG_SENSORS_VT8231 is not set 1187# CONFIG_SENSORS_VT8231 is not set
@@ -1177,9 +1193,7 @@ CONFIG_HWMON=y
1177# CONFIG_SENSORS_W83L786NG is not set 1193# CONFIG_SENSORS_W83L786NG is not set
1178# CONFIG_SENSORS_W83627HF is not set 1194# CONFIG_SENSORS_W83627HF is not set
1179# CONFIG_SENSORS_W83627EHF is not set 1195# CONFIG_SENSORS_W83627EHF is not set
1180# CONFIG_HWMON_DEBUG_CHIP is not set
1181# CONFIG_THERMAL is not set 1196# CONFIG_THERMAL is not set
1182# CONFIG_THERMAL_HWMON is not set
1183# CONFIG_WATCHDOG is not set 1197# CONFIG_WATCHDOG is not set
1184CONFIG_SSB_POSSIBLE=y 1198CONFIG_SSB_POSSIBLE=y
1185 1199
@@ -1198,6 +1212,7 @@ CONFIG_SSB_POSSIBLE=y
1198# CONFIG_MFD_TMIO is not set 1212# CONFIG_MFD_TMIO is not set
1199# CONFIG_PMIC_DA903X is not set 1213# CONFIG_PMIC_DA903X is not set
1200# CONFIG_MFD_WM8400 is not set 1214# CONFIG_MFD_WM8400 is not set
1215# CONFIG_MFD_WM831X is not set
1201# CONFIG_MFD_WM8350_I2C is not set 1216# CONFIG_MFD_WM8350_I2C is not set
1202# CONFIG_MFD_PCF50633 is not set 1217# CONFIG_MFD_PCF50633 is not set
1203# CONFIG_AB3100_CORE is not set 1218# CONFIG_AB3100_CORE is not set
@@ -1208,6 +1223,7 @@ CONFIG_SSB_POSSIBLE=y
1208# Graphics support 1223# Graphics support
1209# 1224#
1210# CONFIG_AGP is not set 1225# CONFIG_AGP is not set
1226CONFIG_VGA_ARB=y
1211# CONFIG_DRM is not set 1227# CONFIG_DRM is not set
1212# CONFIG_VGASTATE is not set 1228# CONFIG_VGASTATE is not set
1213CONFIG_VIDEO_OUTPUT_CONTROL=m 1229CONFIG_VIDEO_OUTPUT_CONTROL=m
@@ -1227,7 +1243,6 @@ CONFIG_DUMMY_CONSOLE=y
1227# CONFIG_SOUND is not set 1243# CONFIG_SOUND is not set
1228CONFIG_HID_SUPPORT=y 1244CONFIG_HID_SUPPORT=y
1229CONFIG_HID=m 1245CONFIG_HID=m
1230# CONFIG_HID_DEBUG is not set
1231# CONFIG_HIDRAW is not set 1246# CONFIG_HIDRAW is not set
1232 1247
1233# 1248#
@@ -1271,6 +1286,7 @@ CONFIG_USB_EHCI_HCD_PPC_OF=y
1271# CONFIG_USB_OXU210HP_HCD is not set 1286# CONFIG_USB_OXU210HP_HCD is not set
1272# CONFIG_USB_ISP116X_HCD is not set 1287# CONFIG_USB_ISP116X_HCD is not set
1273# CONFIG_USB_ISP1760_HCD is not set 1288# CONFIG_USB_ISP1760_HCD is not set
1289# CONFIG_USB_ISP1362_HCD is not set
1274CONFIG_USB_OHCI_HCD=y 1290CONFIG_USB_OHCI_HCD=y
1275CONFIG_USB_OHCI_HCD_PPC_OF_BE=y 1291CONFIG_USB_OHCI_HCD_PPC_OF_BE=y
1276# CONFIG_USB_OHCI_HCD_PPC_OF_LE is not set 1292# CONFIG_USB_OHCI_HCD_PPC_OF_LE is not set
@@ -1500,6 +1516,7 @@ CONFIG_XFS_FS=m
1500# CONFIG_GFS2_FS is not set 1516# CONFIG_GFS2_FS is not set
1501# CONFIG_OCFS2_FS is not set 1517# CONFIG_OCFS2_FS is not set
1502# CONFIG_BTRFS_FS is not set 1518# CONFIG_BTRFS_FS is not set
1519# CONFIG_NILFS2_FS is not set
1503CONFIG_FILE_LOCKING=y 1520CONFIG_FILE_LOCKING=y
1504CONFIG_FSNOTIFY=y 1521CONFIG_FSNOTIFY=y
1505CONFIG_DNOTIFY=y 1522CONFIG_DNOTIFY=y
@@ -1567,7 +1584,6 @@ CONFIG_MISC_FILESYSTEMS=y
1567# CONFIG_ROMFS_FS is not set 1584# CONFIG_ROMFS_FS is not set
1568# CONFIG_SYSV_FS is not set 1585# CONFIG_SYSV_FS is not set
1569# CONFIG_UFS_FS is not set 1586# CONFIG_UFS_FS is not set
1570# CONFIG_NILFS2_FS is not set
1571CONFIG_NETWORK_FILESYSTEMS=y 1587CONFIG_NETWORK_FILESYSTEMS=y
1572CONFIG_NFS_FS=y 1588CONFIG_NFS_FS=y
1573CONFIG_NFS_V3=y 1589CONFIG_NFS_V3=y
@@ -1681,6 +1697,7 @@ CONFIG_ENABLE_WARN_DEPRECATED=y
1681CONFIG_ENABLE_MUST_CHECK=y 1697CONFIG_ENABLE_MUST_CHECK=y
1682CONFIG_FRAME_WARN=1024 1698CONFIG_FRAME_WARN=1024
1683CONFIG_MAGIC_SYSRQ=y 1699CONFIG_MAGIC_SYSRQ=y
1700# CONFIG_STRIP_ASM_SYMS is not set
1684# CONFIG_UNUSED_SYMBOLS is not set 1701# CONFIG_UNUSED_SYMBOLS is not set
1685# CONFIG_DEBUG_FS is not set 1702# CONFIG_DEBUG_FS is not set
1686# CONFIG_HEADERS_CHECK is not set 1703# CONFIG_HEADERS_CHECK is not set
@@ -1698,6 +1715,7 @@ CONFIG_SCHED_DEBUG=y
1698# CONFIG_DEBUG_OBJECTS is not set 1715# CONFIG_DEBUG_OBJECTS is not set
1699# CONFIG_SLUB_DEBUG_ON is not set 1716# CONFIG_SLUB_DEBUG_ON is not set
1700# CONFIG_SLUB_STATS is not set 1717# CONFIG_SLUB_STATS is not set
1718# CONFIG_DEBUG_KMEMLEAK is not set
1701# CONFIG_DEBUG_RT_MUTEXES is not set 1719# CONFIG_DEBUG_RT_MUTEXES is not set
1702# CONFIG_RT_MUTEX_TESTER is not set 1720# CONFIG_RT_MUTEX_TESTER is not set
1703# CONFIG_DEBUG_SPINLOCK is not set 1721# CONFIG_DEBUG_SPINLOCK is not set
@@ -1716,10 +1734,12 @@ CONFIG_DEBUG_MEMORY_INIT=y
1716# CONFIG_DEBUG_LIST is not set 1734# CONFIG_DEBUG_LIST is not set
1717# CONFIG_DEBUG_SG is not set 1735# CONFIG_DEBUG_SG is not set
1718# CONFIG_DEBUG_NOTIFIERS is not set 1736# CONFIG_DEBUG_NOTIFIERS is not set
1737# CONFIG_DEBUG_CREDENTIALS is not set
1719# CONFIG_RCU_TORTURE_TEST is not set 1738# CONFIG_RCU_TORTURE_TEST is not set
1720# CONFIG_RCU_CPU_STALL_DETECTOR is not set 1739# CONFIG_RCU_CPU_STALL_DETECTOR is not set
1721# CONFIG_BACKTRACE_SELF_TEST is not set 1740# CONFIG_BACKTRACE_SELF_TEST is not set
1722# CONFIG_DEBUG_BLOCK_EXT_DEVT is not set 1741# CONFIG_DEBUG_BLOCK_EXT_DEVT is not set
1742# CONFIG_DEBUG_FORCE_WEAK_PER_CPU is not set
1723# CONFIG_FAULT_INJECTION is not set 1743# CONFIG_FAULT_INJECTION is not set
1724# CONFIG_LATENCYTOP is not set 1744# CONFIG_LATENCYTOP is not set
1725CONFIG_SYSCTL_SYSCALL_CHECK=y 1745CONFIG_SYSCTL_SYSCALL_CHECK=y
@@ -1742,6 +1762,7 @@ CONFIG_BRANCH_PROFILE_NONE=y
1742# CONFIG_KMEMTRACE is not set 1762# CONFIG_KMEMTRACE is not set
1743# CONFIG_WORKQUEUE_TRACER is not set 1763# CONFIG_WORKQUEUE_TRACER is not set
1744# CONFIG_BLK_DEV_IO_TRACE is not set 1764# CONFIG_BLK_DEV_IO_TRACE is not set
1765# CONFIG_DMA_API_DEBUG is not set
1745# CONFIG_SAMPLES is not set 1766# CONFIG_SAMPLES is not set
1746CONFIG_HAVE_ARCH_KGDB=y 1767CONFIG_HAVE_ARCH_KGDB=y
1747# CONFIG_KGDB is not set 1768# CONFIG_KGDB is not set
@@ -1771,7 +1792,6 @@ CONFIG_CRYPTO=y
1771# 1792#
1772# Crypto core or helper 1793# Crypto core or helper
1773# 1794#
1774# CONFIG_CRYPTO_FIPS is not set
1775CONFIG_CRYPTO_ALGAPI=y 1795CONFIG_CRYPTO_ALGAPI=y
1776CONFIG_CRYPTO_ALGAPI2=y 1796CONFIG_CRYPTO_ALGAPI2=y
1777CONFIG_CRYPTO_AEAD2=y 1797CONFIG_CRYPTO_AEAD2=y
@@ -1813,11 +1833,13 @@ CONFIG_CRYPTO_PCBC=m
1813# 1833#
1814# CONFIG_CRYPTO_HMAC is not set 1834# CONFIG_CRYPTO_HMAC is not set
1815# CONFIG_CRYPTO_XCBC is not set 1835# CONFIG_CRYPTO_XCBC is not set
1836# CONFIG_CRYPTO_VMAC is not set
1816 1837
1817# 1838#
1818# Digest 1839# Digest
1819# 1840#
1820CONFIG_CRYPTO_CRC32C=m 1841CONFIG_CRYPTO_CRC32C=m
1842# CONFIG_CRYPTO_GHASH is not set
1821CONFIG_CRYPTO_MD4=m 1843CONFIG_CRYPTO_MD4=m
1822CONFIG_CRYPTO_MD5=y 1844CONFIG_CRYPTO_MD5=y
1823CONFIG_CRYPTO_MICHAEL_MIC=m 1845CONFIG_CRYPTO_MICHAEL_MIC=m
diff --git a/arch/powerpc/configs/mgcoge_defconfig b/arch/powerpc/configs/mgcoge_defconfig
index 30b68bfacebf..520b04a0def9 100644
--- a/arch/powerpc/configs/mgcoge_defconfig
+++ b/arch/powerpc/configs/mgcoge_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.31-rc5 3# Linux kernel version: 2.6.32-rc5
4# Fri Aug 7 08:19:15 2009 4# Thu Nov 5 08:20:09 2009
5# 5#
6# CONFIG_PPC64 is not set 6# CONFIG_PPC64 is not set
7 7
@@ -34,6 +34,7 @@ CONFIG_GENERIC_CLOCKEVENTS=y
34CONFIG_GENERIC_HARDIRQS=y 34CONFIG_GENERIC_HARDIRQS=y
35CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y 35CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y
36# CONFIG_HAVE_SETUP_PER_CPU_AREA is not set 36# CONFIG_HAVE_SETUP_PER_CPU_AREA is not set
37# CONFIG_NEED_PER_CPU_EMBED_FIRST_CHUNK is not set
37CONFIG_IRQ_PER_CPU=y 38CONFIG_IRQ_PER_CPU=y
38CONFIG_STACKTRACE_SUPPORT=y 39CONFIG_STACKTRACE_SUPPORT=y
39CONFIG_HAVE_LATENCYTOP_SUPPORT=y 40CONFIG_HAVE_LATENCYTOP_SUPPORT=y
@@ -84,11 +85,12 @@ CONFIG_SYSVIPC_SYSCTL=y
84# 85#
85# RCU Subsystem 86# RCU Subsystem
86# 87#
87CONFIG_CLASSIC_RCU=y 88CONFIG_TREE_RCU=y
88# CONFIG_TREE_RCU is not set 89# CONFIG_TREE_PREEMPT_RCU is not set
89# CONFIG_PREEMPT_RCU is not set 90# CONFIG_RCU_TRACE is not set
91CONFIG_RCU_FANOUT=32
92# CONFIG_RCU_FANOUT_EXACT is not set
90# CONFIG_TREE_RCU_TRACE is not set 93# CONFIG_TREE_RCU_TRACE is not set
91# CONFIG_PREEMPT_RCU_TRACE is not set
92CONFIG_IKCONFIG=y 94CONFIG_IKCONFIG=y
93CONFIG_IKCONFIG_PROC=y 95CONFIG_IKCONFIG_PROC=y
94CONFIG_LOG_BUF_SHIFT=14 96CONFIG_LOG_BUF_SHIFT=14
@@ -123,28 +125,29 @@ CONFIG_TIMERFD=y
123CONFIG_EVENTFD=y 125CONFIG_EVENTFD=y
124CONFIG_SHMEM=y 126CONFIG_SHMEM=y
125CONFIG_AIO=y 127CONFIG_AIO=y
126CONFIG_HAVE_PERF_COUNTERS=y 128CONFIG_HAVE_PERF_EVENTS=y
127 129
128# 130#
129# Performance Counters 131# Kernel Performance Events And Counters
130# 132#
133# CONFIG_PERF_EVENTS is not set
131# CONFIG_PERF_COUNTERS is not set 134# CONFIG_PERF_COUNTERS is not set
132CONFIG_VM_EVENT_COUNTERS=y 135CONFIG_VM_EVENT_COUNTERS=y
133CONFIG_PCI_QUIRKS=y 136CONFIG_PCI_QUIRKS=y
134# CONFIG_STRIP_ASM_SYMS is not set
135CONFIG_COMPAT_BRK=y 137CONFIG_COMPAT_BRK=y
136CONFIG_SLAB=y 138CONFIG_SLAB=y
137# CONFIG_SLUB is not set 139# CONFIG_SLUB is not set
138# CONFIG_SLOB is not set 140# CONFIG_SLOB is not set
139# CONFIG_PROFILING is not set 141# CONFIG_PROFILING is not set
140# CONFIG_MARKERS is not set
141CONFIG_HAVE_OPROFILE=y 142CONFIG_HAVE_OPROFILE=y
142CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS=y 143CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS=y
143CONFIG_HAVE_IOREMAP_PROT=y 144CONFIG_HAVE_IOREMAP_PROT=y
144CONFIG_HAVE_KPROBES=y 145CONFIG_HAVE_KPROBES=y
145CONFIG_HAVE_KRETPROBES=y 146CONFIG_HAVE_KRETPROBES=y
146CONFIG_HAVE_ARCH_TRACEHOOK=y 147CONFIG_HAVE_ARCH_TRACEHOOK=y
148CONFIG_HAVE_DMA_ATTRS=y
147CONFIG_HAVE_CLK=y 149CONFIG_HAVE_CLK=y
150CONFIG_HAVE_DMA_API_DEBUG=y
148 151
149# 152#
150# GCOV-based kernel profiling 153# GCOV-based kernel profiling
@@ -247,6 +250,7 @@ CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y
247CONFIG_ARCH_HAS_WALK_MEMORY=y 250CONFIG_ARCH_HAS_WALK_MEMORY=y
248CONFIG_ARCH_ENABLE_MEMORY_HOTREMOVE=y 251CONFIG_ARCH_ENABLE_MEMORY_HOTREMOVE=y
249# CONFIG_CRASH_DUMP is not set 252# CONFIG_CRASH_DUMP is not set
253CONFIG_MAX_ACTIVE_REGIONS=32
250CONFIG_ARCH_FLATMEM_ENABLE=y 254CONFIG_ARCH_FLATMEM_ENABLE=y
251CONFIG_ARCH_POPULATES_NODE_MAP=y 255CONFIG_ARCH_POPULATES_NODE_MAP=y
252CONFIG_FLATMEM=y 256CONFIG_FLATMEM=y
@@ -260,6 +264,7 @@ CONFIG_BOUNCE=y
260CONFIG_VIRT_TO_BUS=y 264CONFIG_VIRT_TO_BUS=y
261CONFIG_HAVE_MLOCK=y 265CONFIG_HAVE_MLOCK=y
262CONFIG_HAVE_MLOCKED_PAGE_BIT=y 266CONFIG_HAVE_MLOCKED_PAGE_BIT=y
267# CONFIG_KSM is not set
263CONFIG_DEFAULT_MMAP_MIN_ADDR=4096 268CONFIG_DEFAULT_MMAP_MIN_ADDR=4096
264CONFIG_PPC_4K_PAGES=y 269CONFIG_PPC_4K_PAGES=y
265# CONFIG_PPC_16K_PAGES is not set 270# CONFIG_PPC_16K_PAGES is not set
@@ -390,6 +395,7 @@ CONFIG_NETFILTER_ADVANCED=y
390# CONFIG_BT is not set 395# CONFIG_BT is not set
391CONFIG_WIRELESS=y 396CONFIG_WIRELESS=y
392# CONFIG_CFG80211 is not set 397# CONFIG_CFG80211 is not set
398CONFIG_CFG80211_DEFAULT_PS_VALUE=0
393CONFIG_WIRELESS_OLD_REGULATORY=y 399CONFIG_WIRELESS_OLD_REGULATORY=y
394# CONFIG_WIRELESS_EXT is not set 400# CONFIG_WIRELESS_EXT is not set
395# CONFIG_LIB80211 is not set 401# CONFIG_LIB80211 is not set
@@ -397,7 +403,6 @@ CONFIG_WIRELESS_OLD_REGULATORY=y
397# 403#
398# CFG80211 needs to be enabled for MAC80211 404# CFG80211 needs to be enabled for MAC80211
399# 405#
400CONFIG_MAC80211_DEFAULT_PS_VALUE=0
401# CONFIG_WIMAX is not set 406# CONFIG_WIMAX is not set
402# CONFIG_RFKILL is not set 407# CONFIG_RFKILL is not set
403 408
@@ -409,6 +414,7 @@ CONFIG_MAC80211_DEFAULT_PS_VALUE=0
409# Generic Driver Options 414# Generic Driver Options
410# 415#
411CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug" 416CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
417# CONFIG_DEVTMPFS is not set
412CONFIG_STANDALONE=y 418CONFIG_STANDALONE=y
413CONFIG_PREVENT_FIRMWARE_BUILD=y 419CONFIG_PREVENT_FIRMWARE_BUILD=y
414# CONFIG_FW_LOADER is not set 420# CONFIG_FW_LOADER is not set
@@ -608,7 +614,9 @@ CONFIG_MII=y
608# CONFIG_NET_PCI is not set 614# CONFIG_NET_PCI is not set
609# CONFIG_B44 is not set 615# CONFIG_B44 is not set
610# CONFIG_KS8842 is not set 616# CONFIG_KS8842 is not set
617# CONFIG_KS8851_MLL is not set
611# CONFIG_ATL2 is not set 618# CONFIG_ATL2 is not set
619# CONFIG_XILINX_EMACLITE is not set
612CONFIG_FS_ENET=y 620CONFIG_FS_ENET=y
613CONFIG_FS_ENET_HAS_SCC=y 621CONFIG_FS_ENET_HAS_SCC=y
614CONFIG_FS_ENET_HAS_FCC=y 622CONFIG_FS_ENET_HAS_FCC=y
@@ -616,10 +624,7 @@ CONFIG_FS_ENET_MDIO_FCC=y
616# CONFIG_NETDEV_1000 is not set 624# CONFIG_NETDEV_1000 is not set
617# CONFIG_NETDEV_10000 is not set 625# CONFIG_NETDEV_10000 is not set
618# CONFIG_TR is not set 626# CONFIG_TR is not set
619 627CONFIG_WLAN=y
620#
621# Wireless LAN
622#
623# CONFIG_WLAN_PRE80211 is not set 628# CONFIG_WLAN_PRE80211 is not set
624# CONFIG_WLAN_80211 is not set 629# CONFIG_WLAN_80211 is not set
625 630
@@ -685,6 +690,7 @@ CONFIG_HW_RANDOM=y
685CONFIG_DEVPORT=y 690CONFIG_DEVPORT=y
686CONFIG_I2C=y 691CONFIG_I2C=y
687CONFIG_I2C_BOARDINFO=y 692CONFIG_I2C_BOARDINFO=y
693CONFIG_I2C_COMPAT=y
688CONFIG_I2C_CHARDEV=y 694CONFIG_I2C_CHARDEV=y
689CONFIG_I2C_HELPER_AUTO=y 695CONFIG_I2C_HELPER_AUTO=y
690 696
@@ -740,7 +746,6 @@ CONFIG_I2C_CPM=y
740# 746#
741# Miscellaneous I2C Chip support 747# Miscellaneous I2C Chip support
742# 748#
743# CONFIG_PCF8575 is not set
744# CONFIG_I2C_DEBUG_CORE is not set 749# CONFIG_I2C_DEBUG_CORE is not set
745# CONFIG_I2C_DEBUG_ALGO is not set 750# CONFIG_I2C_DEBUG_ALGO is not set
746# CONFIG_I2C_DEBUG_BUS is not set 751# CONFIG_I2C_DEBUG_BUS is not set
@@ -771,15 +776,19 @@ CONFIG_GPIOLIB=y
771# PCI GPIO expanders: 776# PCI GPIO expanders:
772# 777#
773# CONFIG_GPIO_BT8XX is not set 778# CONFIG_GPIO_BT8XX is not set
779# CONFIG_GPIO_LANGWELL is not set
774 780
775# 781#
776# SPI GPIO expanders: 782# SPI GPIO expanders:
777# 783#
784
785#
786# AC97 GPIO expanders:
787#
778# CONFIG_W1 is not set 788# CONFIG_W1 is not set
779# CONFIG_POWER_SUPPLY is not set 789# CONFIG_POWER_SUPPLY is not set
780# CONFIG_HWMON is not set 790# CONFIG_HWMON is not set
781# CONFIG_THERMAL is not set 791# CONFIG_THERMAL is not set
782# CONFIG_THERMAL_HWMON is not set
783# CONFIG_WATCHDOG is not set 792# CONFIG_WATCHDOG is not set
784CONFIG_SSB_POSSIBLE=y 793CONFIG_SSB_POSSIBLE=y
785 794
@@ -799,6 +808,7 @@ CONFIG_SSB_POSSIBLE=y
799# CONFIG_MFD_TMIO is not set 808# CONFIG_MFD_TMIO is not set
800# CONFIG_PMIC_DA903X is not set 809# CONFIG_PMIC_DA903X is not set
801# CONFIG_MFD_WM8400 is not set 810# CONFIG_MFD_WM8400 is not set
811# CONFIG_MFD_WM831X is not set
802# CONFIG_MFD_WM8350_I2C is not set 812# CONFIG_MFD_WM8350_I2C is not set
803# CONFIG_MFD_PCF50633 is not set 813# CONFIG_MFD_PCF50633 is not set
804# CONFIG_AB3100_CORE is not set 814# CONFIG_AB3100_CORE is not set
@@ -809,6 +819,7 @@ CONFIG_SSB_POSSIBLE=y
809# Graphics support 819# Graphics support
810# 820#
811# CONFIG_AGP is not set 821# CONFIG_AGP is not set
822CONFIG_VGA_ARB=y
812# CONFIG_DRM is not set 823# CONFIG_DRM is not set
813# CONFIG_VGASTATE is not set 824# CONFIG_VGASTATE is not set
814# CONFIG_VIDEO_OUTPUT_CONTROL is not set 825# CONFIG_VIDEO_OUTPUT_CONTROL is not set
@@ -1022,6 +1033,7 @@ CONFIG_ENABLE_WARN_DEPRECATED=y
1022CONFIG_ENABLE_MUST_CHECK=y 1033CONFIG_ENABLE_MUST_CHECK=y
1023CONFIG_FRAME_WARN=1024 1034CONFIG_FRAME_WARN=1024
1024CONFIG_MAGIC_SYSRQ=y 1035CONFIG_MAGIC_SYSRQ=y
1036# CONFIG_STRIP_ASM_SYMS is not set
1025# CONFIG_UNUSED_SYMBOLS is not set 1037# CONFIG_UNUSED_SYMBOLS is not set
1026CONFIG_DEBUG_FS=y 1038CONFIG_DEBUG_FS=y
1027# CONFIG_HEADERS_CHECK is not set 1039# CONFIG_HEADERS_CHECK is not set
@@ -1052,10 +1064,12 @@ CONFIG_DEBUG_INFO=y
1052# CONFIG_DEBUG_LIST is not set 1064# CONFIG_DEBUG_LIST is not set
1053# CONFIG_DEBUG_SG is not set 1065# CONFIG_DEBUG_SG is not set
1054# CONFIG_DEBUG_NOTIFIERS is not set 1066# CONFIG_DEBUG_NOTIFIERS is not set
1067# CONFIG_DEBUG_CREDENTIALS is not set
1055# CONFIG_RCU_TORTURE_TEST is not set 1068# CONFIG_RCU_TORTURE_TEST is not set
1056# CONFIG_RCU_CPU_STALL_DETECTOR is not set 1069# CONFIG_RCU_CPU_STALL_DETECTOR is not set
1057# CONFIG_BACKTRACE_SELF_TEST is not set 1070# CONFIG_BACKTRACE_SELF_TEST is not set
1058# CONFIG_DEBUG_BLOCK_EXT_DEVT is not set 1071# CONFIG_DEBUG_BLOCK_EXT_DEVT is not set
1072# CONFIG_DEBUG_FORCE_WEAK_PER_CPU is not set
1059# CONFIG_FAULT_INJECTION is not set 1073# CONFIG_FAULT_INJECTION is not set
1060# CONFIG_LATENCYTOP is not set 1074# CONFIG_LATENCYTOP is not set
1061CONFIG_SYSCTL_SYSCALL_CHECK=y 1075CONFIG_SYSCTL_SYSCALL_CHECK=y
@@ -1079,6 +1093,7 @@ CONFIG_BRANCH_PROFILE_NONE=y
1079# CONFIG_WORKQUEUE_TRACER is not set 1093# CONFIG_WORKQUEUE_TRACER is not set
1080# CONFIG_BLK_DEV_IO_TRACE is not set 1094# CONFIG_BLK_DEV_IO_TRACE is not set
1081# CONFIG_DYNAMIC_DEBUG is not set 1095# CONFIG_DYNAMIC_DEBUG is not set
1096# CONFIG_DMA_API_DEBUG is not set
1082# CONFIG_SAMPLES is not set 1097# CONFIG_SAMPLES is not set
1083CONFIG_HAVE_ARCH_KGDB=y 1098CONFIG_HAVE_ARCH_KGDB=y
1084# CONFIG_PPC_DISABLE_WERROR is not set 1099# CONFIG_PPC_DISABLE_WERROR is not set
@@ -1109,7 +1124,6 @@ CONFIG_CRYPTO=y
1109# 1124#
1110# Crypto core or helper 1125# Crypto core or helper
1111# 1126#
1112# CONFIG_CRYPTO_FIPS is not set
1113CONFIG_CRYPTO_ALGAPI=y 1127CONFIG_CRYPTO_ALGAPI=y
1114CONFIG_CRYPTO_ALGAPI2=y 1128CONFIG_CRYPTO_ALGAPI2=y
1115CONFIG_CRYPTO_AEAD2=y 1129CONFIG_CRYPTO_AEAD2=y
@@ -1151,6 +1165,7 @@ CONFIG_CRYPTO_PCBC=y
1151# Digest 1165# Digest
1152# 1166#
1153# CONFIG_CRYPTO_CRC32C is not set 1167# CONFIG_CRYPTO_CRC32C is not set
1168# CONFIG_CRYPTO_GHASH is not set
1154# CONFIG_CRYPTO_MD4 is not set 1169# CONFIG_CRYPTO_MD4 is not set
1155CONFIG_CRYPTO_MD5=y 1170CONFIG_CRYPTO_MD5=y
1156# CONFIG_CRYPTO_MICHAEL_MIC is not set 1171# CONFIG_CRYPTO_MICHAEL_MIC is not set
diff --git a/arch/powerpc/configs/mgsuvd_defconfig b/arch/powerpc/configs/mgsuvd_defconfig
index 1ae85a3b2942..43c3c4fcdce3 100644
--- a/arch/powerpc/configs/mgsuvd_defconfig
+++ b/arch/powerpc/configs/mgsuvd_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.31-rc4 3# Linux kernel version: 2.6.32-rc5
4# Wed Jul 29 23:31:52 2009 4# Thu Nov 5 08:20:10 2009
5# 5#
6# CONFIG_PPC64 is not set 6# CONFIG_PPC64 is not set
7 7
@@ -16,6 +16,7 @@ CONFIG_PPC_8xx=y
16# CONFIG_E200 is not set 16# CONFIG_E200 is not set
17CONFIG_8xx=y 17CONFIG_8xx=y
18CONFIG_PPC_MMU_NOHASH=y 18CONFIG_PPC_MMU_NOHASH=y
19CONFIG_PPC_MMU_NOHASH_32=y
19# CONFIG_PPC_MM_SLICES is not set 20# CONFIG_PPC_MM_SLICES is not set
20CONFIG_NOT_COHERENT_CACHE=y 21CONFIG_NOT_COHERENT_CACHE=y
21CONFIG_PPC32=y 22CONFIG_PPC32=y
@@ -29,6 +30,7 @@ CONFIG_GENERIC_CLOCKEVENTS=y
29CONFIG_GENERIC_HARDIRQS=y 30CONFIG_GENERIC_HARDIRQS=y
30CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y 31CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y
31# CONFIG_HAVE_SETUP_PER_CPU_AREA is not set 32# CONFIG_HAVE_SETUP_PER_CPU_AREA is not set
33# CONFIG_NEED_PER_CPU_EMBED_FIRST_CHUNK is not set
32CONFIG_IRQ_PER_CPU=y 34CONFIG_IRQ_PER_CPU=y
33CONFIG_STACKTRACE_SUPPORT=y 35CONFIG_STACKTRACE_SUPPORT=y
34CONFIG_HAVE_LATENCYTOP_SUPPORT=y 36CONFIG_HAVE_LATENCYTOP_SUPPORT=y
@@ -76,11 +78,12 @@ CONFIG_SYSVIPC_SYSCTL=y
76# 78#
77# RCU Subsystem 79# RCU Subsystem
78# 80#
79CONFIG_CLASSIC_RCU=y 81CONFIG_TREE_RCU=y
80# CONFIG_TREE_RCU is not set 82# CONFIG_TREE_PREEMPT_RCU is not set
81# CONFIG_PREEMPT_RCU is not set 83# CONFIG_RCU_TRACE is not set
84CONFIG_RCU_FANOUT=32
85# CONFIG_RCU_FANOUT_EXACT is not set
82# CONFIG_TREE_RCU_TRACE is not set 86# CONFIG_TREE_RCU_TRACE is not set
83# CONFIG_PREEMPT_RCU_TRACE is not set
84# CONFIG_IKCONFIG is not set 87# CONFIG_IKCONFIG is not set
85CONFIG_LOG_BUF_SHIFT=17 88CONFIG_LOG_BUF_SHIFT=17
86CONFIG_GROUP_SCHED=y 89CONFIG_GROUP_SCHED=y
@@ -117,27 +120,28 @@ CONFIG_TIMERFD=y
117CONFIG_EVENTFD=y 120CONFIG_EVENTFD=y
118CONFIG_SHMEM=y 121CONFIG_SHMEM=y
119CONFIG_AIO=y 122CONFIG_AIO=y
120CONFIG_HAVE_PERF_COUNTERS=y 123CONFIG_HAVE_PERF_EVENTS=y
121 124
122# 125#
123# Performance Counters 126# Kernel Performance Events And Counters
124# 127#
128# CONFIG_PERF_EVENTS is not set
125# CONFIG_PERF_COUNTERS is not set 129# CONFIG_PERF_COUNTERS is not set
126# CONFIG_VM_EVENT_COUNTERS is not set 130# CONFIG_VM_EVENT_COUNTERS is not set
127# CONFIG_STRIP_ASM_SYMS is not set
128CONFIG_COMPAT_BRK=y 131CONFIG_COMPAT_BRK=y
129CONFIG_SLAB=y 132CONFIG_SLAB=y
130# CONFIG_SLUB is not set 133# CONFIG_SLUB is not set
131# CONFIG_SLOB is not set 134# CONFIG_SLOB is not set
132# CONFIG_PROFILING is not set 135# CONFIG_PROFILING is not set
133# CONFIG_MARKERS is not set
134CONFIG_HAVE_OPROFILE=y 136CONFIG_HAVE_OPROFILE=y
135CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS=y 137CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS=y
136CONFIG_HAVE_IOREMAP_PROT=y 138CONFIG_HAVE_IOREMAP_PROT=y
137CONFIG_HAVE_KPROBES=y 139CONFIG_HAVE_KPROBES=y
138CONFIG_HAVE_KRETPROBES=y 140CONFIG_HAVE_KRETPROBES=y
139CONFIG_HAVE_ARCH_TRACEHOOK=y 141CONFIG_HAVE_ARCH_TRACEHOOK=y
142CONFIG_HAVE_DMA_ATTRS=y
140CONFIG_HAVE_CLK=y 143CONFIG_HAVE_CLK=y
144CONFIG_HAVE_DMA_API_DEBUG=y
141 145
142# 146#
143# GCOV-based kernel profiling 147# GCOV-based kernel profiling
@@ -237,10 +241,10 @@ CONFIG_BINFMT_ELF=y
237CONFIG_MATH_EMULATION=y 241CONFIG_MATH_EMULATION=y
238# CONFIG_IOMMU_HELPER is not set 242# CONFIG_IOMMU_HELPER is not set
239# CONFIG_SWIOTLB is not set 243# CONFIG_SWIOTLB is not set
240CONFIG_PPC_NEED_DMA_SYNC_OPS=y
241CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y 244CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y
242CONFIG_ARCH_HAS_WALK_MEMORY=y 245CONFIG_ARCH_HAS_WALK_MEMORY=y
243CONFIG_ARCH_ENABLE_MEMORY_HOTREMOVE=y 246CONFIG_ARCH_ENABLE_MEMORY_HOTREMOVE=y
247CONFIG_MAX_ACTIVE_REGIONS=32
244CONFIG_ARCH_FLATMEM_ENABLE=y 248CONFIG_ARCH_FLATMEM_ENABLE=y
245CONFIG_ARCH_POPULATES_NODE_MAP=y 249CONFIG_ARCH_POPULATES_NODE_MAP=y
246CONFIG_SELECT_MEMORY_MODEL=y 250CONFIG_SELECT_MEMORY_MODEL=y
@@ -258,6 +262,7 @@ CONFIG_BOUNCE=y
258CONFIG_VIRT_TO_BUS=y 262CONFIG_VIRT_TO_BUS=y
259CONFIG_HAVE_MLOCK=y 263CONFIG_HAVE_MLOCK=y
260CONFIG_HAVE_MLOCKED_PAGE_BIT=y 264CONFIG_HAVE_MLOCKED_PAGE_BIT=y
265# CONFIG_KSM is not set
261CONFIG_DEFAULT_MMAP_MIN_ADDR=4096 266CONFIG_DEFAULT_MMAP_MIN_ADDR=4096
262CONFIG_PPC_4K_PAGES=y 267CONFIG_PPC_4K_PAGES=y
263# CONFIG_PPC_16K_PAGES is not set 268# CONFIG_PPC_16K_PAGES is not set
@@ -344,6 +349,7 @@ CONFIG_DEFAULT_TCP_CONG="cubic"
344# CONFIG_NETFILTER is not set 349# CONFIG_NETFILTER is not set
345# CONFIG_IP_DCCP is not set 350# CONFIG_IP_DCCP is not set
346# CONFIG_IP_SCTP is not set 351# CONFIG_IP_SCTP is not set
352# CONFIG_RDS is not set
347# CONFIG_TIPC is not set 353# CONFIG_TIPC is not set
348# CONFIG_ATM is not set 354# CONFIG_ATM is not set
349# CONFIG_BRIDGE is not set 355# CONFIG_BRIDGE is not set
@@ -373,6 +379,7 @@ CONFIG_DEFAULT_TCP_CONG="cubic"
373# CONFIG_AF_RXRPC is not set 379# CONFIG_AF_RXRPC is not set
374CONFIG_WIRELESS=y 380CONFIG_WIRELESS=y
375# CONFIG_CFG80211 is not set 381# CONFIG_CFG80211 is not set
382CONFIG_CFG80211_DEFAULT_PS_VALUE=0
376CONFIG_WIRELESS_OLD_REGULATORY=y 383CONFIG_WIRELESS_OLD_REGULATORY=y
377# CONFIG_WIRELESS_EXT is not set 384# CONFIG_WIRELESS_EXT is not set
378# CONFIG_LIB80211 is not set 385# CONFIG_LIB80211 is not set
@@ -380,7 +387,6 @@ CONFIG_WIRELESS_OLD_REGULATORY=y
380# 387#
381# CFG80211 needs to be enabled for MAC80211 388# CFG80211 needs to be enabled for MAC80211
382# 389#
383CONFIG_MAC80211_DEFAULT_PS_VALUE=0
384# CONFIG_WIMAX is not set 390# CONFIG_WIMAX is not set
385# CONFIG_RFKILL is not set 391# CONFIG_RFKILL is not set
386# CONFIG_NET_9P is not set 392# CONFIG_NET_9P is not set
@@ -553,16 +559,15 @@ CONFIG_MII=y
553# CONFIG_IBM_NEW_EMAC_MAL_COMMON_ERR is not set 559# CONFIG_IBM_NEW_EMAC_MAL_COMMON_ERR is not set
554# CONFIG_B44 is not set 560# CONFIG_B44 is not set
555# CONFIG_KS8842 is not set 561# CONFIG_KS8842 is not set
562# CONFIG_KS8851_MLL is not set
563# CONFIG_XILINX_EMACLITE is not set
556CONFIG_FS_ENET=y 564CONFIG_FS_ENET=y
557CONFIG_FS_ENET_HAS_SCC=y 565CONFIG_FS_ENET_HAS_SCC=y
558# CONFIG_FS_ENET_HAS_FEC is not set 566# CONFIG_FS_ENET_HAS_FEC is not set
559# CONFIG_FS_ENET_MDIO_FEC is not set 567# CONFIG_FS_ENET_MDIO_FEC is not set
560# CONFIG_NETDEV_1000 is not set 568# CONFIG_NETDEV_1000 is not set
561# CONFIG_NETDEV_10000 is not set 569# CONFIG_NETDEV_10000 is not set
562 570CONFIG_WLAN=y
563#
564# Wireless LAN
565#
566# CONFIG_WLAN_PRE80211 is not set 571# CONFIG_WLAN_PRE80211 is not set
567# CONFIG_WLAN_80211 is not set 572# CONFIG_WLAN_80211 is not set
568 573
@@ -635,7 +640,6 @@ CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y
635# CONFIG_POWER_SUPPLY is not set 640# CONFIG_POWER_SUPPLY is not set
636# CONFIG_HWMON is not set 641# CONFIG_HWMON is not set
637# CONFIG_THERMAL is not set 642# CONFIG_THERMAL is not set
638# CONFIG_THERMAL_HWMON is not set
639# CONFIG_WATCHDOG is not set 643# CONFIG_WATCHDOG is not set
640CONFIG_SSB_POSSIBLE=y 644CONFIG_SSB_POSSIBLE=y
641 645
@@ -707,6 +711,7 @@ CONFIG_FS_MBCACHE=y
707# CONFIG_GFS2_FS is not set 711# CONFIG_GFS2_FS is not set
708# CONFIG_OCFS2_FS is not set 712# CONFIG_OCFS2_FS is not set
709# CONFIG_BTRFS_FS is not set 713# CONFIG_BTRFS_FS is not set
714# CONFIG_NILFS2_FS is not set
710CONFIG_FILE_LOCKING=y 715CONFIG_FILE_LOCKING=y
711CONFIG_FSNOTIFY=y 716CONFIG_FSNOTIFY=y
712CONFIG_DNOTIFY=y 717CONFIG_DNOTIFY=y
@@ -776,7 +781,6 @@ CONFIG_CRAMFS=y
776# CONFIG_ROMFS_FS is not set 781# CONFIG_ROMFS_FS is not set
777# CONFIG_SYSV_FS is not set 782# CONFIG_SYSV_FS is not set
778# CONFIG_UFS_FS is not set 783# CONFIG_UFS_FS is not set
779# CONFIG_NILFS2_FS is not set
780CONFIG_NETWORK_FILESYSTEMS=y 784CONFIG_NETWORK_FILESYSTEMS=y
781CONFIG_NFS_FS=y 785CONFIG_NFS_FS=y
782CONFIG_NFS_V3=y 786CONFIG_NFS_V3=y
@@ -851,6 +855,7 @@ CONFIG_ENABLE_WARN_DEPRECATED=y
851CONFIG_ENABLE_MUST_CHECK=y 855CONFIG_ENABLE_MUST_CHECK=y
852CONFIG_FRAME_WARN=1024 856CONFIG_FRAME_WARN=1024
853# CONFIG_MAGIC_SYSRQ is not set 857# CONFIG_MAGIC_SYSRQ is not set
858# CONFIG_STRIP_ASM_SYMS is not set
854# CONFIG_UNUSED_SYMBOLS is not set 859# CONFIG_UNUSED_SYMBOLS is not set
855CONFIG_DEBUG_FS=y 860CONFIG_DEBUG_FS=y
856# CONFIG_HEADERS_CHECK is not set 861# CONFIG_HEADERS_CHECK is not set
@@ -865,6 +870,7 @@ CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y
865CONFIG_TRACING_SUPPORT=y 870CONFIG_TRACING_SUPPORT=y
866# CONFIG_FTRACE is not set 871# CONFIG_FTRACE is not set
867# CONFIG_DYNAMIC_DEBUG is not set 872# CONFIG_DYNAMIC_DEBUG is not set
873# CONFIG_DMA_API_DEBUG is not set
868# CONFIG_SAMPLES is not set 874# CONFIG_SAMPLES is not set
869CONFIG_HAVE_ARCH_KGDB=y 875CONFIG_HAVE_ARCH_KGDB=y
870# CONFIG_PPC_DISABLE_WERROR is not set 876# CONFIG_PPC_DISABLE_WERROR is not set
@@ -887,7 +893,6 @@ CONFIG_CRYPTO=y
887# 893#
888# Crypto core or helper 894# Crypto core or helper
889# 895#
890# CONFIG_CRYPTO_FIPS is not set
891# CONFIG_CRYPTO_MANAGER is not set 896# CONFIG_CRYPTO_MANAGER is not set
892# CONFIG_CRYPTO_MANAGER2 is not set 897# CONFIG_CRYPTO_MANAGER2 is not set
893# CONFIG_CRYPTO_GF128MUL is not set 898# CONFIG_CRYPTO_GF128MUL is not set
@@ -918,11 +923,13 @@ CONFIG_CRYPTO=y
918# 923#
919# CONFIG_CRYPTO_HMAC is not set 924# CONFIG_CRYPTO_HMAC is not set
920# CONFIG_CRYPTO_XCBC is not set 925# CONFIG_CRYPTO_XCBC is not set
926# CONFIG_CRYPTO_VMAC is not set
921 927
922# 928#
923# Digest 929# Digest
924# 930#
925# CONFIG_CRYPTO_CRC32C is not set 931# CONFIG_CRYPTO_CRC32C is not set
932# CONFIG_CRYPTO_GHASH is not set
926# CONFIG_CRYPTO_MD4 is not set 933# CONFIG_CRYPTO_MD4 is not set
927# CONFIG_CRYPTO_MD5 is not set 934# CONFIG_CRYPTO_MD5 is not set
928# CONFIG_CRYPTO_MICHAEL_MIC is not set 935# CONFIG_CRYPTO_MICHAEL_MIC is not set
diff --git a/arch/powerpc/configs/mpc7448_hpc2_defconfig b/arch/powerpc/configs/mpc7448_hpc2_defconfig
index f23428c3b34e..d8b364a45944 100644
--- a/arch/powerpc/configs/mpc7448_hpc2_defconfig
+++ b/arch/powerpc/configs/mpc7448_hpc2_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.31-rc4 3# Linux kernel version: 2.6.32-rc5
4# Wed Jul 29 23:31:53 2009 4# Thu Nov 5 08:20:10 2009
5# 5#
6# CONFIG_PPC64 is not set 6# CONFIG_PPC64 is not set
7 7
@@ -34,6 +34,7 @@ CONFIG_GENERIC_CLOCKEVENTS=y
34CONFIG_GENERIC_HARDIRQS=y 34CONFIG_GENERIC_HARDIRQS=y
35CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y 35CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y
36# CONFIG_HAVE_SETUP_PER_CPU_AREA is not set 36# CONFIG_HAVE_SETUP_PER_CPU_AREA is not set
37# CONFIG_NEED_PER_CPU_EMBED_FIRST_CHUNK is not set
37CONFIG_IRQ_PER_CPU=y 38CONFIG_IRQ_PER_CPU=y
38CONFIG_STACKTRACE_SUPPORT=y 39CONFIG_STACKTRACE_SUPPORT=y
39CONFIG_HAVE_LATENCYTOP_SUPPORT=y 40CONFIG_HAVE_LATENCYTOP_SUPPORT=y
@@ -82,11 +83,12 @@ CONFIG_SYSVIPC_SYSCTL=y
82# 83#
83# RCU Subsystem 84# RCU Subsystem
84# 85#
85CONFIG_CLASSIC_RCU=y 86CONFIG_TREE_RCU=y
86# CONFIG_TREE_RCU is not set 87# CONFIG_TREE_PREEMPT_RCU is not set
87# CONFIG_PREEMPT_RCU is not set 88# CONFIG_RCU_TRACE is not set
89CONFIG_RCU_FANOUT=32
90# CONFIG_RCU_FANOUT_EXACT is not set
88# CONFIG_TREE_RCU_TRACE is not set 91# CONFIG_TREE_RCU_TRACE is not set
89# CONFIG_PREEMPT_RCU_TRACE is not set
90# CONFIG_IKCONFIG is not set 92# CONFIG_IKCONFIG is not set
91CONFIG_LOG_BUF_SHIFT=14 93CONFIG_LOG_BUF_SHIFT=14
92CONFIG_GROUP_SCHED=y 94CONFIG_GROUP_SCHED=y
@@ -123,28 +125,29 @@ CONFIG_TIMERFD=y
123CONFIG_EVENTFD=y 125CONFIG_EVENTFD=y
124CONFIG_SHMEM=y 126CONFIG_SHMEM=y
125CONFIG_AIO=y 127CONFIG_AIO=y
126CONFIG_HAVE_PERF_COUNTERS=y 128CONFIG_HAVE_PERF_EVENTS=y
127 129
128# 130#
129# Performance Counters 131# Kernel Performance Events And Counters
130# 132#
133# CONFIG_PERF_EVENTS is not set
131# CONFIG_PERF_COUNTERS is not set 134# CONFIG_PERF_COUNTERS is not set
132CONFIG_VM_EVENT_COUNTERS=y 135CONFIG_VM_EVENT_COUNTERS=y
133CONFIG_PCI_QUIRKS=y 136CONFIG_PCI_QUIRKS=y
134CONFIG_SLUB_DEBUG=y 137CONFIG_SLUB_DEBUG=y
135# CONFIG_STRIP_ASM_SYMS is not set
136CONFIG_COMPAT_BRK=y 138CONFIG_COMPAT_BRK=y
137# CONFIG_SLAB is not set 139# CONFIG_SLAB is not set
138CONFIG_SLUB=y 140CONFIG_SLUB=y
139# CONFIG_SLOB is not set 141# CONFIG_SLOB is not set
140# CONFIG_PROFILING is not set 142# CONFIG_PROFILING is not set
141# CONFIG_MARKERS is not set
142CONFIG_HAVE_OPROFILE=y 143CONFIG_HAVE_OPROFILE=y
143CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS=y 144CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS=y
144CONFIG_HAVE_IOREMAP_PROT=y 145CONFIG_HAVE_IOREMAP_PROT=y
145CONFIG_HAVE_KPROBES=y 146CONFIG_HAVE_KPROBES=y
146CONFIG_HAVE_KRETPROBES=y 147CONFIG_HAVE_KRETPROBES=y
147CONFIG_HAVE_ARCH_TRACEHOOK=y 148CONFIG_HAVE_ARCH_TRACEHOOK=y
149CONFIG_HAVE_DMA_ATTRS=y
150CONFIG_HAVE_DMA_API_DEBUG=y
148 151
149# 152#
150# GCOV-based kernel profiling 153# GCOV-based kernel profiling
@@ -241,6 +244,7 @@ CONFIG_ARCH_HAS_WALK_MEMORY=y
241CONFIG_ARCH_ENABLE_MEMORY_HOTREMOVE=y 244CONFIG_ARCH_ENABLE_MEMORY_HOTREMOVE=y
242# CONFIG_KEXEC is not set 245# CONFIG_KEXEC is not set
243# CONFIG_CRASH_DUMP is not set 246# CONFIG_CRASH_DUMP is not set
247CONFIG_MAX_ACTIVE_REGIONS=32
244CONFIG_ARCH_FLATMEM_ENABLE=y 248CONFIG_ARCH_FLATMEM_ENABLE=y
245CONFIG_ARCH_POPULATES_NODE_MAP=y 249CONFIG_ARCH_POPULATES_NODE_MAP=y
246CONFIG_SELECT_MEMORY_MODEL=y 250CONFIG_SELECT_MEMORY_MODEL=y
@@ -258,6 +262,7 @@ CONFIG_BOUNCE=y
258CONFIG_VIRT_TO_BUS=y 262CONFIG_VIRT_TO_BUS=y
259CONFIG_HAVE_MLOCK=y 263CONFIG_HAVE_MLOCK=y
260CONFIG_HAVE_MLOCKED_PAGE_BIT=y 264CONFIG_HAVE_MLOCKED_PAGE_BIT=y
265# CONFIG_KSM is not set
261CONFIG_DEFAULT_MMAP_MIN_ADDR=4096 266CONFIG_DEFAULT_MMAP_MIN_ADDR=4096
262CONFIG_PPC_4K_PAGES=y 267CONFIG_PPC_4K_PAGES=y
263# CONFIG_PPC_16K_PAGES is not set 268# CONFIG_PPC_16K_PAGES is not set
@@ -350,6 +355,7 @@ CONFIG_DEFAULT_TCP_CONG="cubic"
350# CONFIG_NETFILTER is not set 355# CONFIG_NETFILTER is not set
351# CONFIG_IP_DCCP is not set 356# CONFIG_IP_DCCP is not set
352# CONFIG_IP_SCTP is not set 357# CONFIG_IP_SCTP is not set
358# CONFIG_RDS is not set
353# CONFIG_TIPC is not set 359# CONFIG_TIPC is not set
354# CONFIG_ATM is not set 360# CONFIG_ATM is not set
355# CONFIG_BRIDGE is not set 361# CONFIG_BRIDGE is not set
@@ -379,6 +385,7 @@ CONFIG_DEFAULT_TCP_CONG="cubic"
379# CONFIG_AF_RXRPC is not set 385# CONFIG_AF_RXRPC is not set
380CONFIG_WIRELESS=y 386CONFIG_WIRELESS=y
381# CONFIG_CFG80211 is not set 387# CONFIG_CFG80211 is not set
388CONFIG_CFG80211_DEFAULT_PS_VALUE=0
382CONFIG_WIRELESS_OLD_REGULATORY=y 389CONFIG_WIRELESS_OLD_REGULATORY=y
383# CONFIG_WIRELESS_EXT is not set 390# CONFIG_WIRELESS_EXT is not set
384# CONFIG_LIB80211 is not set 391# CONFIG_LIB80211 is not set
@@ -386,7 +393,6 @@ CONFIG_WIRELESS_OLD_REGULATORY=y
386# 393#
387# CFG80211 needs to be enabled for MAC80211 394# CFG80211 needs to be enabled for MAC80211
388# 395#
389CONFIG_MAC80211_DEFAULT_PS_VALUE=0
390# CONFIG_WIMAX is not set 396# CONFIG_WIMAX is not set
391# CONFIG_RFKILL is not set 397# CONFIG_RFKILL is not set
392# CONFIG_NET_9P is not set 398# CONFIG_NET_9P is not set
@@ -399,6 +405,7 @@ CONFIG_MAC80211_DEFAULT_PS_VALUE=0
399# Generic Driver Options 405# Generic Driver Options
400# 406#
401CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug" 407CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
408# CONFIG_DEVTMPFS is not set
402CONFIG_STANDALONE=y 409CONFIG_STANDALONE=y
403CONFIG_PREVENT_FIRMWARE_BUILD=y 410CONFIG_PREVENT_FIRMWARE_BUILD=y
404# CONFIG_FW_LOADER is not set 411# CONFIG_FW_LOADER is not set
@@ -478,6 +485,7 @@ CONFIG_SCSI_LOWLEVEL=y
478# CONFIG_ISCSI_TCP is not set 485# CONFIG_ISCSI_TCP is not set
479# CONFIG_SCSI_CXGB3_ISCSI is not set 486# CONFIG_SCSI_CXGB3_ISCSI is not set
480# CONFIG_SCSI_BNX2_ISCSI is not set 487# CONFIG_SCSI_BNX2_ISCSI is not set
488# CONFIG_BE2ISCSI is not set
481# CONFIG_BLK_DEV_3W_XXXX_RAID is not set 489# CONFIG_BLK_DEV_3W_XXXX_RAID is not set
482# CONFIG_SCSI_3W_9XXX is not set 490# CONFIG_SCSI_3W_9XXX is not set
483# CONFIG_SCSI_ACARD is not set 491# CONFIG_SCSI_ACARD is not set
@@ -517,11 +525,14 @@ CONFIG_SCSI_LOWLEVEL=y
517# CONFIG_SCSI_DC390T is not set 525# CONFIG_SCSI_DC390T is not set
518# CONFIG_SCSI_NSP32 is not set 526# CONFIG_SCSI_NSP32 is not set
519# CONFIG_SCSI_DEBUG is not set 527# CONFIG_SCSI_DEBUG is not set
528# CONFIG_SCSI_PMCRAID is not set
520# CONFIG_SCSI_SRP is not set 529# CONFIG_SCSI_SRP is not set
530# CONFIG_SCSI_BFA_FC is not set
521# CONFIG_SCSI_DH is not set 531# CONFIG_SCSI_DH is not set
522# CONFIG_SCSI_OSD_INITIATOR is not set 532# CONFIG_SCSI_OSD_INITIATOR is not set
523CONFIG_ATA=y 533CONFIG_ATA=y
524# CONFIG_ATA_NONSTANDARD is not set 534# CONFIG_ATA_NONSTANDARD is not set
535CONFIG_ATA_VERBOSE_ERROR=y
525CONFIG_SATA_PMP=y 536CONFIG_SATA_PMP=y
526# CONFIG_SATA_AHCI is not set 537# CONFIG_SATA_AHCI is not set
527# CONFIG_SATA_SIL24 is not set 538# CONFIG_SATA_SIL24 is not set
@@ -543,6 +554,7 @@ CONFIG_SATA_MV=y
543# CONFIG_PATA_ALI is not set 554# CONFIG_PATA_ALI is not set
544# CONFIG_PATA_AMD is not set 555# CONFIG_PATA_AMD is not set
545# CONFIG_PATA_ARTOP is not set 556# CONFIG_PATA_ARTOP is not set
557# CONFIG_PATA_ATP867X is not set
546# CONFIG_PATA_ATIIXP is not set 558# CONFIG_PATA_ATIIXP is not set
547# CONFIG_PATA_CMD640_PCI is not set 559# CONFIG_PATA_CMD640_PCI is not set
548# CONFIG_PATA_CMD64X is not set 560# CONFIG_PATA_CMD64X is not set
@@ -570,6 +582,7 @@ CONFIG_SATA_MV=y
570# CONFIG_PATA_OPTIDMA is not set 582# CONFIG_PATA_OPTIDMA is not set
571# CONFIG_PATA_PDC_OLD is not set 583# CONFIG_PATA_PDC_OLD is not set
572# CONFIG_PATA_RADISYS is not set 584# CONFIG_PATA_RADISYS is not set
585# CONFIG_PATA_RDC is not set
573# CONFIG_PATA_RZ1000 is not set 586# CONFIG_PATA_RZ1000 is not set
574# CONFIG_PATA_SC1200 is not set 587# CONFIG_PATA_SC1200 is not set
575# CONFIG_PATA_SERVERWORKS is not set 588# CONFIG_PATA_SERVERWORKS is not set
@@ -666,9 +679,11 @@ CONFIG_8139TOO=y
666# CONFIG_SUNDANCE is not set 679# CONFIG_SUNDANCE is not set
667# CONFIG_TLAN is not set 680# CONFIG_TLAN is not set
668# CONFIG_KS8842 is not set 681# CONFIG_KS8842 is not set
682# CONFIG_KS8851_MLL is not set
669# CONFIG_VIA_RHINE is not set 683# CONFIG_VIA_RHINE is not set
670# CONFIG_SC92031 is not set 684# CONFIG_SC92031 is not set
671# CONFIG_ATL2 is not set 685# CONFIG_ATL2 is not set
686# CONFIG_XILINX_EMACLITE is not set
672CONFIG_NETDEV_1000=y 687CONFIG_NETDEV_1000=y
673# CONFIG_ACENIC is not set 688# CONFIG_ACENIC is not set
674# CONFIG_DL2K is not set 689# CONFIG_DL2K is not set
@@ -715,10 +730,7 @@ CONFIG_CHELSIO_T3_DEPENDS=y
715# CONFIG_SFC is not set 730# CONFIG_SFC is not set
716# CONFIG_BE2NET is not set 731# CONFIG_BE2NET is not set
717# CONFIG_TR is not set 732# CONFIG_TR is not set
718 733CONFIG_WLAN=y
719#
720# Wireless LAN
721#
722# CONFIG_WLAN_PRE80211 is not set 734# CONFIG_WLAN_PRE80211 is not set
723# CONFIG_WLAN_80211 is not set 735# CONFIG_WLAN_80211 is not set
724 736
@@ -822,6 +834,11 @@ CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y
822# CONFIG_POWER_SUPPLY is not set 834# CONFIG_POWER_SUPPLY is not set
823CONFIG_HWMON=y 835CONFIG_HWMON=y
824# CONFIG_HWMON_VID is not set 836# CONFIG_HWMON_VID is not set
837# CONFIG_HWMON_DEBUG_CHIP is not set
838
839#
840# Native drivers
841#
825# CONFIG_SENSORS_I5K_AMB is not set 842# CONFIG_SENSORS_I5K_AMB is not set
826# CONFIG_SENSORS_F71805F is not set 843# CONFIG_SENSORS_F71805F is not set
827# CONFIG_SENSORS_F71882FG is not set 844# CONFIG_SENSORS_F71882FG is not set
@@ -836,9 +853,7 @@ CONFIG_HWMON=y
836# CONFIG_SENSORS_VT8231 is not set 853# CONFIG_SENSORS_VT8231 is not set
837# CONFIG_SENSORS_W83627HF is not set 854# CONFIG_SENSORS_W83627HF is not set
838# CONFIG_SENSORS_W83627EHF is not set 855# CONFIG_SENSORS_W83627EHF is not set
839# CONFIG_HWMON_DEBUG_CHIP is not set
840# CONFIG_THERMAL is not set 856# CONFIG_THERMAL is not set
841# CONFIG_THERMAL_HWMON is not set
842# CONFIG_WATCHDOG is not set 857# CONFIG_WATCHDOG is not set
843CONFIG_SSB_POSSIBLE=y 858CONFIG_SSB_POSSIBLE=y
844 859
@@ -861,6 +876,7 @@ CONFIG_SSB_POSSIBLE=y
861# Graphics support 876# Graphics support
862# 877#
863# CONFIG_AGP is not set 878# CONFIG_AGP is not set
879CONFIG_VGA_ARB=y
864# CONFIG_DRM is not set 880# CONFIG_DRM is not set
865# CONFIG_VGASTATE is not set 881# CONFIG_VGASTATE is not set
866CONFIG_VIDEO_OUTPUT_CONTROL=y 882CONFIG_VIDEO_OUTPUT_CONTROL=y
@@ -874,7 +890,6 @@ CONFIG_VIDEO_OUTPUT_CONTROL=y
874# CONFIG_SOUND is not set 890# CONFIG_SOUND is not set
875CONFIG_HID_SUPPORT=y 891CONFIG_HID_SUPPORT=y
876CONFIG_HID=y 892CONFIG_HID=y
877# CONFIG_HID_DEBUG is not set
878# CONFIG_HIDRAW is not set 893# CONFIG_HIDRAW is not set
879# CONFIG_HID_PID is not set 894# CONFIG_HID_PID is not set
880 895
@@ -939,6 +954,7 @@ CONFIG_FS_MBCACHE=y
939# CONFIG_GFS2_FS is not set 954# CONFIG_GFS2_FS is not set
940# CONFIG_OCFS2_FS is not set 955# CONFIG_OCFS2_FS is not set
941# CONFIG_BTRFS_FS is not set 956# CONFIG_BTRFS_FS is not set
957# CONFIG_NILFS2_FS is not set
942CONFIG_FILE_LOCKING=y 958CONFIG_FILE_LOCKING=y
943CONFIG_FSNOTIFY=y 959CONFIG_FSNOTIFY=y
944CONFIG_DNOTIFY=y 960CONFIG_DNOTIFY=y
@@ -997,7 +1013,6 @@ CONFIG_MISC_FILESYSTEMS=y
997# CONFIG_ROMFS_FS is not set 1013# CONFIG_ROMFS_FS is not set
998# CONFIG_SYSV_FS is not set 1014# CONFIG_SYSV_FS is not set
999# CONFIG_UFS_FS is not set 1015# CONFIG_UFS_FS is not set
1000# CONFIG_NILFS2_FS is not set
1001CONFIG_NETWORK_FILESYSTEMS=y 1016CONFIG_NETWORK_FILESYSTEMS=y
1002CONFIG_NFS_FS=y 1017CONFIG_NFS_FS=y
1003# CONFIG_NFS_V3 is not set 1018# CONFIG_NFS_V3 is not set
@@ -1069,6 +1084,7 @@ CONFIG_ENABLE_WARN_DEPRECATED=y
1069CONFIG_ENABLE_MUST_CHECK=y 1084CONFIG_ENABLE_MUST_CHECK=y
1070CONFIG_FRAME_WARN=1024 1085CONFIG_FRAME_WARN=1024
1071# CONFIG_MAGIC_SYSRQ is not set 1086# CONFIG_MAGIC_SYSRQ is not set
1087# CONFIG_STRIP_ASM_SYMS is not set
1072# CONFIG_UNUSED_SYMBOLS is not set 1088# CONFIG_UNUSED_SYMBOLS is not set
1073# CONFIG_DEBUG_FS is not set 1089# CONFIG_DEBUG_FS is not set
1074# CONFIG_HEADERS_CHECK is not set 1090# CONFIG_HEADERS_CHECK is not set
@@ -1086,6 +1102,7 @@ CONFIG_HAVE_DYNAMIC_FTRACE=y
1086CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y 1102CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y
1087CONFIG_TRACING_SUPPORT=y 1103CONFIG_TRACING_SUPPORT=y
1088# CONFIG_FTRACE is not set 1104# CONFIG_FTRACE is not set
1105# CONFIG_DMA_API_DEBUG is not set
1089# CONFIG_SAMPLES is not set 1106# CONFIG_SAMPLES is not set
1090CONFIG_HAVE_ARCH_KGDB=y 1107CONFIG_HAVE_ARCH_KGDB=y
1091# CONFIG_PPC_DISABLE_WERROR is not set 1108# CONFIG_PPC_DISABLE_WERROR is not set
@@ -1107,7 +1124,6 @@ CONFIG_CRYPTO=y
1107# 1124#
1108# Crypto core or helper 1125# Crypto core or helper
1109# 1126#
1110# CONFIG_CRYPTO_FIPS is not set
1111# CONFIG_CRYPTO_MANAGER is not set 1127# CONFIG_CRYPTO_MANAGER is not set
1112# CONFIG_CRYPTO_MANAGER2 is not set 1128# CONFIG_CRYPTO_MANAGER2 is not set
1113# CONFIG_CRYPTO_GF128MUL is not set 1129# CONFIG_CRYPTO_GF128MUL is not set
@@ -1138,11 +1154,13 @@ CONFIG_CRYPTO=y
1138# 1154#
1139# CONFIG_CRYPTO_HMAC is not set 1155# CONFIG_CRYPTO_HMAC is not set
1140# CONFIG_CRYPTO_XCBC is not set 1156# CONFIG_CRYPTO_XCBC is not set
1157# CONFIG_CRYPTO_VMAC is not set
1141 1158
1142# 1159#
1143# Digest 1160# Digest
1144# 1161#
1145# CONFIG_CRYPTO_CRC32C is not set 1162# CONFIG_CRYPTO_CRC32C is not set
1163# CONFIG_CRYPTO_GHASH is not set
1146# CONFIG_CRYPTO_MD4 is not set 1164# CONFIG_CRYPTO_MD4 is not set
1147# CONFIG_CRYPTO_MD5 is not set 1165# CONFIG_CRYPTO_MD5 is not set
1148# CONFIG_CRYPTO_MICHAEL_MIC is not set 1166# CONFIG_CRYPTO_MICHAEL_MIC is not set
diff --git a/arch/powerpc/configs/mpc8272_ads_defconfig b/arch/powerpc/configs/mpc8272_ads_defconfig
index 02716f72db6f..00fad81b6fce 100644
--- a/arch/powerpc/configs/mpc8272_ads_defconfig
+++ b/arch/powerpc/configs/mpc8272_ads_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.31-rc4 3# Linux kernel version: 2.6.32-rc5
4# Wed Jul 29 23:31:54 2009 4# Thu Nov 5 08:20:11 2009
5# 5#
6# CONFIG_PPC64 is not set 6# CONFIG_PPC64 is not set
7 7
@@ -34,6 +34,7 @@ CONFIG_GENERIC_CLOCKEVENTS=y
34CONFIG_GENERIC_HARDIRQS=y 34CONFIG_GENERIC_HARDIRQS=y
35CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y 35CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y
36# CONFIG_HAVE_SETUP_PER_CPU_AREA is not set 36# CONFIG_HAVE_SETUP_PER_CPU_AREA is not set
37# CONFIG_NEED_PER_CPU_EMBED_FIRST_CHUNK is not set
37CONFIG_IRQ_PER_CPU=y 38CONFIG_IRQ_PER_CPU=y
38CONFIG_STACKTRACE_SUPPORT=y 39CONFIG_STACKTRACE_SUPPORT=y
39CONFIG_HAVE_LATENCYTOP_SUPPORT=y 40CONFIG_HAVE_LATENCYTOP_SUPPORT=y
@@ -82,11 +83,12 @@ CONFIG_SYSVIPC_SYSCTL=y
82# 83#
83# RCU Subsystem 84# RCU Subsystem
84# 85#
85CONFIG_CLASSIC_RCU=y 86CONFIG_TREE_RCU=y
86# CONFIG_TREE_RCU is not set 87# CONFIG_TREE_PREEMPT_RCU is not set
87# CONFIG_PREEMPT_RCU is not set 88# CONFIG_RCU_TRACE is not set
89CONFIG_RCU_FANOUT=32
90# CONFIG_RCU_FANOUT_EXACT is not set
88# CONFIG_TREE_RCU_TRACE is not set 91# CONFIG_TREE_RCU_TRACE is not set
89# CONFIG_PREEMPT_RCU_TRACE is not set
90CONFIG_IKCONFIG=y 92CONFIG_IKCONFIG=y
91CONFIG_IKCONFIG_PROC=y 93CONFIG_IKCONFIG_PROC=y
92CONFIG_LOG_BUF_SHIFT=14 94CONFIG_LOG_BUF_SHIFT=14
@@ -116,29 +118,30 @@ CONFIG_TIMERFD=y
116CONFIG_EVENTFD=y 118CONFIG_EVENTFD=y
117CONFIG_SHMEM=y 119CONFIG_SHMEM=y
118CONFIG_AIO=y 120CONFIG_AIO=y
119CONFIG_HAVE_PERF_COUNTERS=y 121CONFIG_HAVE_PERF_EVENTS=y
120 122
121# 123#
122# Performance Counters 124# Kernel Performance Events And Counters
123# 125#
126# CONFIG_PERF_EVENTS is not set
124# CONFIG_PERF_COUNTERS is not set 127# CONFIG_PERF_COUNTERS is not set
125CONFIG_VM_EVENT_COUNTERS=y 128CONFIG_VM_EVENT_COUNTERS=y
126CONFIG_PCI_QUIRKS=y 129CONFIG_PCI_QUIRKS=y
127CONFIG_SLUB_DEBUG=y 130CONFIG_SLUB_DEBUG=y
128# CONFIG_STRIP_ASM_SYMS is not set
129CONFIG_COMPAT_BRK=y 131CONFIG_COMPAT_BRK=y
130# CONFIG_SLAB is not set 132# CONFIG_SLAB is not set
131CONFIG_SLUB=y 133CONFIG_SLUB=y
132# CONFIG_SLOB is not set 134# CONFIG_SLOB is not set
133# CONFIG_PROFILING is not set 135# CONFIG_PROFILING is not set
134# CONFIG_MARKERS is not set
135CONFIG_HAVE_OPROFILE=y 136CONFIG_HAVE_OPROFILE=y
136CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS=y 137CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS=y
137CONFIG_HAVE_IOREMAP_PROT=y 138CONFIG_HAVE_IOREMAP_PROT=y
138CONFIG_HAVE_KPROBES=y 139CONFIG_HAVE_KPROBES=y
139CONFIG_HAVE_KRETPROBES=y 140CONFIG_HAVE_KRETPROBES=y
140CONFIG_HAVE_ARCH_TRACEHOOK=y 141CONFIG_HAVE_ARCH_TRACEHOOK=y
142CONFIG_HAVE_DMA_ATTRS=y
141CONFIG_HAVE_CLK=y 143CONFIG_HAVE_CLK=y
144CONFIG_HAVE_DMA_API_DEBUG=y
142 145
143# 146#
144# GCOV-based kernel profiling 147# GCOV-based kernel profiling
@@ -151,6 +154,7 @@ CONFIG_BASE_SMALL=0
151# CONFIG_MODULES is not set 154# CONFIG_MODULES is not set
152CONFIG_BLOCK=y 155CONFIG_BLOCK=y
153CONFIG_LBDAF=y 156CONFIG_LBDAF=y
157CONFIG_BLK_DEV_BSG=y
154# CONFIG_BLK_DEV_INTEGRITY is not set 158# CONFIG_BLK_DEV_INTEGRITY is not set
155 159
156# 160#
@@ -236,6 +240,7 @@ CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y
236CONFIG_ARCH_HAS_WALK_MEMORY=y 240CONFIG_ARCH_HAS_WALK_MEMORY=y
237CONFIG_ARCH_ENABLE_MEMORY_HOTREMOVE=y 241CONFIG_ARCH_ENABLE_MEMORY_HOTREMOVE=y
238# CONFIG_CRASH_DUMP is not set 242# CONFIG_CRASH_DUMP is not set
243CONFIG_MAX_ACTIVE_REGIONS=32
239CONFIG_ARCH_FLATMEM_ENABLE=y 244CONFIG_ARCH_FLATMEM_ENABLE=y
240CONFIG_ARCH_POPULATES_NODE_MAP=y 245CONFIG_ARCH_POPULATES_NODE_MAP=y
241CONFIG_FLATMEM=y 246CONFIG_FLATMEM=y
@@ -249,6 +254,7 @@ CONFIG_BOUNCE=y
249CONFIG_VIRT_TO_BUS=y 254CONFIG_VIRT_TO_BUS=y
250CONFIG_HAVE_MLOCK=y 255CONFIG_HAVE_MLOCK=y
251CONFIG_HAVE_MLOCKED_PAGE_BIT=y 256CONFIG_HAVE_MLOCKED_PAGE_BIT=y
257# CONFIG_KSM is not set
252CONFIG_DEFAULT_MMAP_MIN_ADDR=4096 258CONFIG_DEFAULT_MMAP_MIN_ADDR=4096
253CONFIG_PPC_4K_PAGES=y 259CONFIG_PPC_4K_PAGES=y
254# CONFIG_PPC_16K_PAGES is not set 260# CONFIG_PPC_16K_PAGES is not set
@@ -397,6 +403,7 @@ CONFIG_NETFILTER_ADVANCED=y
397# CONFIG_BT is not set 403# CONFIG_BT is not set
398CONFIG_WIRELESS=y 404CONFIG_WIRELESS=y
399# CONFIG_CFG80211 is not set 405# CONFIG_CFG80211 is not set
406CONFIG_CFG80211_DEFAULT_PS_VALUE=0
400CONFIG_WIRELESS_OLD_REGULATORY=y 407CONFIG_WIRELESS_OLD_REGULATORY=y
401# CONFIG_WIRELESS_EXT is not set 408# CONFIG_WIRELESS_EXT is not set
402# CONFIG_LIB80211 is not set 409# CONFIG_LIB80211 is not set
@@ -404,7 +411,6 @@ CONFIG_WIRELESS_OLD_REGULATORY=y
404# 411#
405# CFG80211 needs to be enabled for MAC80211 412# CFG80211 needs to be enabled for MAC80211
406# 413#
407CONFIG_MAC80211_DEFAULT_PS_VALUE=0
408# CONFIG_WIMAX is not set 414# CONFIG_WIMAX is not set
409# CONFIG_RFKILL is not set 415# CONFIG_RFKILL is not set
410 416
@@ -416,6 +422,7 @@ CONFIG_MAC80211_DEFAULT_PS_VALUE=0
416# Generic Driver Options 422# Generic Driver Options
417# 423#
418CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug" 424CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
425# CONFIG_DEVTMPFS is not set
419CONFIG_STANDALONE=y 426CONFIG_STANDALONE=y
420CONFIG_PREVENT_FIRMWARE_BUILD=y 427CONFIG_PREVENT_FIRMWARE_BUILD=y
421# CONFIG_FW_LOADER is not set 428# CONFIG_FW_LOADER is not set
@@ -477,7 +484,6 @@ CONFIG_MTD_CFI_UTIL=y
477# CONFIG_MTD_COMPLEX_MAPPINGS is not set 484# CONFIG_MTD_COMPLEX_MAPPINGS is not set
478# CONFIG_MTD_PHYSMAP is not set 485# CONFIG_MTD_PHYSMAP is not set
479CONFIG_MTD_PHYSMAP_OF=y 486CONFIG_MTD_PHYSMAP_OF=y
480# CONFIG_MTD_SBC8240 is not set
481# CONFIG_MTD_INTEL_VR_NOR is not set 487# CONFIG_MTD_INTEL_VR_NOR is not set
482# CONFIG_MTD_PLATRAM is not set 488# CONFIG_MTD_PLATRAM is not set
483 489
@@ -604,7 +610,9 @@ CONFIG_MII=y
604# CONFIG_NET_PCI is not set 610# CONFIG_NET_PCI is not set
605# CONFIG_B44 is not set 611# CONFIG_B44 is not set
606# CONFIG_KS8842 is not set 612# CONFIG_KS8842 is not set
613# CONFIG_KS8851_MLL is not set
607# CONFIG_ATL2 is not set 614# CONFIG_ATL2 is not set
615# CONFIG_XILINX_EMACLITE is not set
608CONFIG_FS_ENET=y 616CONFIG_FS_ENET=y
609# CONFIG_FS_ENET_HAS_SCC is not set 617# CONFIG_FS_ENET_HAS_SCC is not set
610CONFIG_FS_ENET_HAS_FCC=y 618CONFIG_FS_ENET_HAS_FCC=y
@@ -652,10 +660,7 @@ CONFIG_CHELSIO_T3_DEPENDS=y
652# CONFIG_SFC is not set 660# CONFIG_SFC is not set
653# CONFIG_BE2NET is not set 661# CONFIG_BE2NET is not set
654# CONFIG_TR is not set 662# CONFIG_TR is not set
655 663CONFIG_WLAN=y
656#
657# Wireless LAN
658#
659# CONFIG_WLAN_PRE80211 is not set 664# CONFIG_WLAN_PRE80211 is not set
660# CONFIG_WLAN_80211 is not set 665# CONFIG_WLAN_80211 is not set
661 666
@@ -704,6 +709,7 @@ CONFIG_KEYBOARD_ATKBD=y
704# CONFIG_KEYBOARD_GPIO is not set 709# CONFIG_KEYBOARD_GPIO is not set
705# CONFIG_KEYBOARD_MATRIX is not set 710# CONFIG_KEYBOARD_MATRIX is not set
706# CONFIG_KEYBOARD_NEWTON is not set 711# CONFIG_KEYBOARD_NEWTON is not set
712# CONFIG_KEYBOARD_OPENCORES is not set
707# CONFIG_KEYBOARD_STOWAWAY is not set 713# CONFIG_KEYBOARD_STOWAWAY is not set
708# CONFIG_KEYBOARD_SUNKBD is not set 714# CONFIG_KEYBOARD_SUNKBD is not set
709# CONFIG_KEYBOARD_XTKBD is not set 715# CONFIG_KEYBOARD_XTKBD is not set
@@ -714,6 +720,7 @@ CONFIG_MOUSE_PS2_LOGIPS2PP=y
714CONFIG_MOUSE_PS2_SYNAPTICS=y 720CONFIG_MOUSE_PS2_SYNAPTICS=y
715CONFIG_MOUSE_PS2_TRACKPOINT=y 721CONFIG_MOUSE_PS2_TRACKPOINT=y
716# CONFIG_MOUSE_PS2_ELANTECH is not set 722# CONFIG_MOUSE_PS2_ELANTECH is not set
723# CONFIG_MOUSE_PS2_SENTELIC is not set
717# CONFIG_MOUSE_PS2_TOUCHKIT is not set 724# CONFIG_MOUSE_PS2_TOUCHKIT is not set
718# CONFIG_MOUSE_SERIAL is not set 725# CONFIG_MOUSE_SERIAL is not set
719# CONFIG_MOUSE_VSXXXAA is not set 726# CONFIG_MOUSE_VSXXXAA is not set
@@ -793,15 +800,19 @@ CONFIG_GPIOLIB=y
793# PCI GPIO expanders: 800# PCI GPIO expanders:
794# 801#
795# CONFIG_GPIO_BT8XX is not set 802# CONFIG_GPIO_BT8XX is not set
803# CONFIG_GPIO_LANGWELL is not set
796 804
797# 805#
798# SPI GPIO expanders: 806# SPI GPIO expanders:
799# 807#
808
809#
810# AC97 GPIO expanders:
811#
800# CONFIG_W1 is not set 812# CONFIG_W1 is not set
801# CONFIG_POWER_SUPPLY is not set 813# CONFIG_POWER_SUPPLY is not set
802# CONFIG_HWMON is not set 814# CONFIG_HWMON is not set
803# CONFIG_THERMAL is not set 815# CONFIG_THERMAL is not set
804# CONFIG_THERMAL_HWMON is not set
805# CONFIG_WATCHDOG is not set 816# CONFIG_WATCHDOG is not set
806CONFIG_SSB_POSSIBLE=y 817CONFIG_SSB_POSSIBLE=y
807 818
@@ -824,6 +835,7 @@ CONFIG_SSB_POSSIBLE=y
824# Graphics support 835# Graphics support
825# 836#
826# CONFIG_AGP is not set 837# CONFIG_AGP is not set
838CONFIG_VGA_ARB=y
827# CONFIG_DRM is not set 839# CONFIG_DRM is not set
828# CONFIG_VGASTATE is not set 840# CONFIG_VGASTATE is not set
829# CONFIG_VIDEO_OUTPUT_CONTROL is not set 841# CONFIG_VIDEO_OUTPUT_CONTROL is not set
@@ -1032,6 +1044,7 @@ CONFIG_ENABLE_WARN_DEPRECATED=y
1032CONFIG_ENABLE_MUST_CHECK=y 1044CONFIG_ENABLE_MUST_CHECK=y
1033CONFIG_FRAME_WARN=1024 1045CONFIG_FRAME_WARN=1024
1034CONFIG_MAGIC_SYSRQ=y 1046CONFIG_MAGIC_SYSRQ=y
1047# CONFIG_STRIP_ASM_SYMS is not set
1035# CONFIG_UNUSED_SYMBOLS is not set 1048# CONFIG_UNUSED_SYMBOLS is not set
1036# CONFIG_DEBUG_FS is not set 1049# CONFIG_DEBUG_FS is not set
1037# CONFIG_HEADERS_CHECK is not set 1050# CONFIG_HEADERS_CHECK is not set
@@ -1067,10 +1080,12 @@ CONFIG_DEBUG_INFO=y
1067# CONFIG_DEBUG_LIST is not set 1080# CONFIG_DEBUG_LIST is not set
1068# CONFIG_DEBUG_SG is not set 1081# CONFIG_DEBUG_SG is not set
1069# CONFIG_DEBUG_NOTIFIERS is not set 1082# CONFIG_DEBUG_NOTIFIERS is not set
1083# CONFIG_DEBUG_CREDENTIALS is not set
1070# CONFIG_RCU_TORTURE_TEST is not set 1084# CONFIG_RCU_TORTURE_TEST is not set
1071# CONFIG_RCU_CPU_STALL_DETECTOR is not set 1085# CONFIG_RCU_CPU_STALL_DETECTOR is not set
1072# CONFIG_BACKTRACE_SELF_TEST is not set 1086# CONFIG_BACKTRACE_SELF_TEST is not set
1073# CONFIG_DEBUG_BLOCK_EXT_DEVT is not set 1087# CONFIG_DEBUG_BLOCK_EXT_DEVT is not set
1088# CONFIG_DEBUG_FORCE_WEAK_PER_CPU is not set
1074# CONFIG_FAULT_INJECTION is not set 1089# CONFIG_FAULT_INJECTION is not set
1075# CONFIG_LATENCYTOP is not set 1090# CONFIG_LATENCYTOP is not set
1076CONFIG_SYSCTL_SYSCALL_CHECK=y 1091CONFIG_SYSCTL_SYSCALL_CHECK=y
@@ -1093,6 +1108,7 @@ CONFIG_BRANCH_PROFILE_NONE=y
1093# CONFIG_KMEMTRACE is not set 1108# CONFIG_KMEMTRACE is not set
1094# CONFIG_WORKQUEUE_TRACER is not set 1109# CONFIG_WORKQUEUE_TRACER is not set
1095# CONFIG_BLK_DEV_IO_TRACE is not set 1110# CONFIG_BLK_DEV_IO_TRACE is not set
1111# CONFIG_DMA_API_DEBUG is not set
1096# CONFIG_SAMPLES is not set 1112# CONFIG_SAMPLES is not set
1097CONFIG_HAVE_ARCH_KGDB=y 1113CONFIG_HAVE_ARCH_KGDB=y
1098# CONFIG_PPC_DISABLE_WERROR is not set 1114# CONFIG_PPC_DISABLE_WERROR is not set
@@ -1121,7 +1137,6 @@ CONFIG_CRYPTO=y
1121# 1137#
1122# Crypto core or helper 1138# Crypto core or helper
1123# 1139#
1124# CONFIG_CRYPTO_FIPS is not set
1125CONFIG_CRYPTO_ALGAPI=y 1140CONFIG_CRYPTO_ALGAPI=y
1126CONFIG_CRYPTO_ALGAPI2=y 1141CONFIG_CRYPTO_ALGAPI2=y
1127CONFIG_CRYPTO_AEAD2=y 1142CONFIG_CRYPTO_AEAD2=y
@@ -1163,6 +1178,7 @@ CONFIG_CRYPTO_PCBC=y
1163# Digest 1178# Digest
1164# 1179#
1165# CONFIG_CRYPTO_CRC32C is not set 1180# CONFIG_CRYPTO_CRC32C is not set
1181# CONFIG_CRYPTO_GHASH is not set
1166# CONFIG_CRYPTO_MD4 is not set 1182# CONFIG_CRYPTO_MD4 is not set
1167CONFIG_CRYPTO_MD5=y 1183CONFIG_CRYPTO_MD5=y
1168# CONFIG_CRYPTO_MICHAEL_MIC is not set 1184# CONFIG_CRYPTO_MICHAEL_MIC is not set
diff --git a/arch/powerpc/configs/mpc83xx_defconfig b/arch/powerpc/configs/mpc83xx_defconfig
index 4a96cb6925b4..64dff21516cb 100644
--- a/arch/powerpc/configs/mpc83xx_defconfig
+++ b/arch/powerpc/configs/mpc83xx_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.31-rc4 3# Linux kernel version: 2.6.32-rc5
4# Wed Jul 29 23:31:55 2009 4# Thu Nov 5 08:20:12 2009
5# 5#
6# CONFIG_PPC64 is not set 6# CONFIG_PPC64 is not set
7 7
@@ -35,6 +35,7 @@ CONFIG_GENERIC_CLOCKEVENTS=y
35CONFIG_GENERIC_HARDIRQS=y 35CONFIG_GENERIC_HARDIRQS=y
36CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y 36CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y
37# CONFIG_HAVE_SETUP_PER_CPU_AREA is not set 37# CONFIG_HAVE_SETUP_PER_CPU_AREA is not set
38# CONFIG_NEED_PER_CPU_EMBED_FIRST_CHUNK 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
@@ -86,11 +87,12 @@ CONFIG_SYSVIPC_SYSCTL=y
86# 87#
87# RCU Subsystem 88# RCU Subsystem
88# 89#
89CONFIG_CLASSIC_RCU=y 90CONFIG_TREE_RCU=y
90# CONFIG_TREE_RCU is not set 91# CONFIG_TREE_PREEMPT_RCU is not set
91# CONFIG_PREEMPT_RCU is not set 92# CONFIG_RCU_TRACE is not set
93CONFIG_RCU_FANOUT=32
94# CONFIG_RCU_FANOUT_EXACT is not set
92# CONFIG_TREE_RCU_TRACE is not set 95# CONFIG_TREE_RCU_TRACE is not set
93# CONFIG_PREEMPT_RCU_TRACE is not set
94# CONFIG_IKCONFIG is not set 96# CONFIG_IKCONFIG is not set
95CONFIG_LOG_BUF_SHIFT=14 97CONFIG_LOG_BUF_SHIFT=14
96CONFIG_GROUP_SCHED=y 98CONFIG_GROUP_SCHED=y
@@ -127,21 +129,20 @@ CONFIG_TIMERFD=y
127CONFIG_EVENTFD=y 129CONFIG_EVENTFD=y
128CONFIG_SHMEM=y 130CONFIG_SHMEM=y
129CONFIG_AIO=y 131CONFIG_AIO=y
130CONFIG_HAVE_PERF_COUNTERS=y 132CONFIG_HAVE_PERF_EVENTS=y
131 133
132# 134#
133# Performance Counters 135# Kernel Performance Events And Counters
134# 136#
137# CONFIG_PERF_EVENTS is not set
135# CONFIG_PERF_COUNTERS is not set 138# CONFIG_PERF_COUNTERS is not set
136CONFIG_VM_EVENT_COUNTERS=y 139CONFIG_VM_EVENT_COUNTERS=y
137CONFIG_PCI_QUIRKS=y 140CONFIG_PCI_QUIRKS=y
138# CONFIG_STRIP_ASM_SYMS is not set
139CONFIG_COMPAT_BRK=y 141CONFIG_COMPAT_BRK=y
140CONFIG_SLAB=y 142CONFIG_SLAB=y
141# CONFIG_SLUB is not set 143# CONFIG_SLUB is not set
142# CONFIG_SLOB is not set 144# CONFIG_SLOB is not set
143# CONFIG_PROFILING is not set 145# CONFIG_PROFILING is not set
144# CONFIG_MARKERS is not set
145CONFIG_HAVE_OPROFILE=y 146CONFIG_HAVE_OPROFILE=y
146# CONFIG_KPROBES is not set 147# CONFIG_KPROBES is not set
147CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS=y 148CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS=y
@@ -149,6 +150,8 @@ CONFIG_HAVE_IOREMAP_PROT=y
149CONFIG_HAVE_KPROBES=y 150CONFIG_HAVE_KPROBES=y
150CONFIG_HAVE_KRETPROBES=y 151CONFIG_HAVE_KRETPROBES=y
151CONFIG_HAVE_ARCH_TRACEHOOK=y 152CONFIG_HAVE_ARCH_TRACEHOOK=y
153CONFIG_HAVE_DMA_ATTRS=y
154CONFIG_HAVE_DMA_API_DEBUG=y
152 155
153# 156#
154# GCOV-based kernel profiling 157# GCOV-based kernel profiling
@@ -263,6 +266,7 @@ CONFIG_ARCH_HAS_WALK_MEMORY=y
263CONFIG_ARCH_ENABLE_MEMORY_HOTREMOVE=y 266CONFIG_ARCH_ENABLE_MEMORY_HOTREMOVE=y
264# CONFIG_KEXEC is not set 267# CONFIG_KEXEC is not set
265# CONFIG_CRASH_DUMP is not set 268# CONFIG_CRASH_DUMP is not set
269CONFIG_MAX_ACTIVE_REGIONS=32
266CONFIG_ARCH_FLATMEM_ENABLE=y 270CONFIG_ARCH_FLATMEM_ENABLE=y
267CONFIG_ARCH_POPULATES_NODE_MAP=y 271CONFIG_ARCH_POPULATES_NODE_MAP=y
268CONFIG_SELECT_MEMORY_MODEL=y 272CONFIG_SELECT_MEMORY_MODEL=y
@@ -280,6 +284,7 @@ CONFIG_BOUNCE=y
280CONFIG_VIRT_TO_BUS=y 284CONFIG_VIRT_TO_BUS=y
281CONFIG_HAVE_MLOCK=y 285CONFIG_HAVE_MLOCK=y
282CONFIG_HAVE_MLOCKED_PAGE_BIT=y 286CONFIG_HAVE_MLOCKED_PAGE_BIT=y
287# CONFIG_KSM is not set
283CONFIG_DEFAULT_MMAP_MIN_ADDR=4096 288CONFIG_DEFAULT_MMAP_MIN_ADDR=4096
284CONFIG_PPC_4K_PAGES=y 289CONFIG_PPC_4K_PAGES=y
285# CONFIG_PPC_16K_PAGES is not set 290# CONFIG_PPC_16K_PAGES is not set
@@ -343,7 +348,8 @@ CONFIG_XFRM_USER=m
343# CONFIG_XFRM_SUB_POLICY is not set 348# CONFIG_XFRM_SUB_POLICY is not set
344# CONFIG_XFRM_MIGRATE is not set 349# CONFIG_XFRM_MIGRATE is not set
345# CONFIG_XFRM_STATISTICS is not set 350# CONFIG_XFRM_STATISTICS is not set
346# CONFIG_NET_KEY is not set 351CONFIG_NET_KEY=y
352# CONFIG_NET_KEY_MIGRATE is not set
347CONFIG_INET=y 353CONFIG_INET=y
348CONFIG_IP_MULTICAST=y 354CONFIG_IP_MULTICAST=y
349# CONFIG_IP_ADVANCED_ROUTER is not set 355# CONFIG_IP_ADVANCED_ROUTER is not set
@@ -358,7 +364,7 @@ CONFIG_IP_PNP_BOOTP=y
358# CONFIG_ARPD is not set 364# CONFIG_ARPD is not set
359CONFIG_SYN_COOKIES=y 365CONFIG_SYN_COOKIES=y
360# CONFIG_INET_AH is not set 366# CONFIG_INET_AH is not set
361# CONFIG_INET_ESP is not set 367CONFIG_INET_ESP=y
362# CONFIG_INET_IPCOMP is not set 368# CONFIG_INET_IPCOMP is not set
363# CONFIG_INET_XFRM_TUNNEL is not set 369# CONFIG_INET_XFRM_TUNNEL is not set
364# CONFIG_INET_TUNNEL is not set 370# CONFIG_INET_TUNNEL is not set
@@ -377,6 +383,7 @@ CONFIG_DEFAULT_TCP_CONG="cubic"
377# CONFIG_NETFILTER is not set 383# CONFIG_NETFILTER is not set
378# CONFIG_IP_DCCP is not set 384# CONFIG_IP_DCCP is not set
379# CONFIG_IP_SCTP is not set 385# CONFIG_IP_SCTP is not set
386# CONFIG_RDS is not set
380# CONFIG_TIPC is not set 387# CONFIG_TIPC is not set
381# CONFIG_ATM is not set 388# CONFIG_ATM is not set
382# CONFIG_BRIDGE is not set 389# CONFIG_BRIDGE is not set
@@ -406,6 +413,7 @@ CONFIG_DEFAULT_TCP_CONG="cubic"
406# CONFIG_AF_RXRPC is not set 413# CONFIG_AF_RXRPC is not set
407CONFIG_WIRELESS=y 414CONFIG_WIRELESS=y
408# CONFIG_CFG80211 is not set 415# CONFIG_CFG80211 is not set
416CONFIG_CFG80211_DEFAULT_PS_VALUE=0
409CONFIG_WIRELESS_OLD_REGULATORY=y 417CONFIG_WIRELESS_OLD_REGULATORY=y
410# CONFIG_WIRELESS_EXT is not set 418# CONFIG_WIRELESS_EXT is not set
411# CONFIG_LIB80211 is not set 419# CONFIG_LIB80211 is not set
@@ -413,7 +421,6 @@ CONFIG_WIRELESS_OLD_REGULATORY=y
413# 421#
414# CFG80211 needs to be enabled for MAC80211 422# CFG80211 needs to be enabled for MAC80211
415# 423#
416CONFIG_MAC80211_DEFAULT_PS_VALUE=0
417# CONFIG_WIMAX is not set 424# CONFIG_WIMAX is not set
418# CONFIG_RFKILL is not set 425# CONFIG_RFKILL is not set
419# CONFIG_NET_9P is not set 426# CONFIG_NET_9P is not set
@@ -426,6 +433,7 @@ CONFIG_MAC80211_DEFAULT_PS_VALUE=0
426# Generic Driver Options 433# Generic Driver Options
427# 434#
428CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug" 435CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
436# CONFIG_DEVTMPFS is not set
429CONFIG_STANDALONE=y 437CONFIG_STANDALONE=y
430CONFIG_PREVENT_FIRMWARE_BUILD=y 438CONFIG_PREVENT_FIRMWARE_BUILD=y
431# CONFIG_FW_LOADER is not set 439# CONFIG_FW_LOADER is not set
@@ -433,9 +441,9 @@ CONFIG_PREVENT_FIRMWARE_BUILD=y
433# CONFIG_CONNECTOR is not set 441# CONFIG_CONNECTOR is not set
434CONFIG_MTD=y 442CONFIG_MTD=y
435# CONFIG_MTD_DEBUG is not set 443# CONFIG_MTD_DEBUG is not set
444# CONFIG_MTD_TESTS is not set
436# CONFIG_MTD_CONCAT is not set 445# CONFIG_MTD_CONCAT is not set
437CONFIG_MTD_PARTITIONS=y 446CONFIG_MTD_PARTITIONS=y
438# CONFIG_MTD_TESTS is not set
439# CONFIG_MTD_REDBOOT_PARTS is not set 447# CONFIG_MTD_REDBOOT_PARTS is not set
440# CONFIG_MTD_CMDLINE_PARTS is not set 448# CONFIG_MTD_CMDLINE_PARTS is not set
441CONFIG_MTD_OF_PARTS=y 449CONFIG_MTD_OF_PARTS=y
@@ -608,6 +616,7 @@ CONFIG_SCSI_LOWLEVEL=y
608# CONFIG_ISCSI_TCP is not set 616# CONFIG_ISCSI_TCP is not set
609# CONFIG_SCSI_CXGB3_ISCSI is not set 617# CONFIG_SCSI_CXGB3_ISCSI is not set
610# CONFIG_SCSI_BNX2_ISCSI is not set 618# CONFIG_SCSI_BNX2_ISCSI is not set
619# CONFIG_BE2ISCSI is not set
611# CONFIG_BLK_DEV_3W_XXXX_RAID is not set 620# CONFIG_BLK_DEV_3W_XXXX_RAID is not set
612# CONFIG_SCSI_3W_9XXX is not set 621# CONFIG_SCSI_3W_9XXX is not set
613# CONFIG_SCSI_ACARD is not set 622# CONFIG_SCSI_ACARD is not set
@@ -647,11 +656,14 @@ CONFIG_SCSI_LOWLEVEL=y
647# CONFIG_SCSI_DC390T is not set 656# CONFIG_SCSI_DC390T is not set
648# CONFIG_SCSI_NSP32 is not set 657# CONFIG_SCSI_NSP32 is not set
649# CONFIG_SCSI_DEBUG is not set 658# CONFIG_SCSI_DEBUG is not set
659# CONFIG_SCSI_PMCRAID is not set
650# CONFIG_SCSI_SRP is not set 660# CONFIG_SCSI_SRP is not set
661# CONFIG_SCSI_BFA_FC is not set
651# CONFIG_SCSI_DH is not set 662# CONFIG_SCSI_DH is not set
652# CONFIG_SCSI_OSD_INITIATOR is not set 663# CONFIG_SCSI_OSD_INITIATOR is not set
653CONFIG_ATA=y 664CONFIG_ATA=y
654# CONFIG_ATA_NONSTANDARD is not set 665# CONFIG_ATA_NONSTANDARD is not set
666CONFIG_ATA_VERBOSE_ERROR=y
655CONFIG_SATA_PMP=y 667CONFIG_SATA_PMP=y
656# CONFIG_SATA_AHCI is not set 668# CONFIG_SATA_AHCI is not set
657# CONFIG_SATA_SIL24 is not set 669# CONFIG_SATA_SIL24 is not set
@@ -674,6 +686,7 @@ CONFIG_ATA_SFF=y
674# CONFIG_PATA_ALI is not set 686# CONFIG_PATA_ALI is not set
675# CONFIG_PATA_AMD is not set 687# CONFIG_PATA_AMD is not set
676# CONFIG_PATA_ARTOP is not set 688# CONFIG_PATA_ARTOP is not set
689# CONFIG_PATA_ATP867X is not set
677# CONFIG_PATA_ATIIXP is not set 690# CONFIG_PATA_ATIIXP is not set
678# CONFIG_PATA_CMD640_PCI is not set 691# CONFIG_PATA_CMD640_PCI is not set
679# CONFIG_PATA_CMD64X is not set 692# CONFIG_PATA_CMD64X is not set
@@ -701,6 +714,7 @@ CONFIG_ATA_SFF=y
701# CONFIG_PATA_OPTIDMA is not set 714# CONFIG_PATA_OPTIDMA is not set
702# CONFIG_PATA_PDC_OLD is not set 715# CONFIG_PATA_PDC_OLD is not set
703# CONFIG_PATA_RADISYS is not set 716# CONFIG_PATA_RADISYS is not set
717# CONFIG_PATA_RDC is not set
704# CONFIG_PATA_RZ1000 is not set 718# CONFIG_PATA_RZ1000 is not set
705# CONFIG_PATA_SC1200 is not set 719# CONFIG_PATA_SC1200 is not set
706# CONFIG_PATA_SERVERWORKS is not set 720# CONFIG_PATA_SERVERWORKS is not set
@@ -777,7 +791,9 @@ CONFIG_MII=y
777# CONFIG_NET_PCI is not set 791# CONFIG_NET_PCI is not set
778# CONFIG_B44 is not set 792# CONFIG_B44 is not set
779# CONFIG_KS8842 is not set 793# CONFIG_KS8842 is not set
794# CONFIG_KS8851_MLL is not set
780# CONFIG_ATL2 is not set 795# CONFIG_ATL2 is not set
796# CONFIG_XILINX_EMACLITE is not set
781CONFIG_NETDEV_1000=y 797CONFIG_NETDEV_1000=y
782# CONFIG_ACENIC is not set 798# CONFIG_ACENIC is not set
783# CONFIG_DL2K is not set 799# CONFIG_DL2K is not set
@@ -800,7 +816,6 @@ CONFIG_NETDEV_1000=y
800CONFIG_FSL_PQ_MDIO=y 816CONFIG_FSL_PQ_MDIO=y
801CONFIG_GIANFAR=y 817CONFIG_GIANFAR=y
802CONFIG_UCC_GETH=y 818CONFIG_UCC_GETH=y
803# CONFIG_UGETH_MAGIC_PACKET is not set
804# CONFIG_UGETH_TX_ON_DEMAND is not set 819# CONFIG_UGETH_TX_ON_DEMAND is not set
805# CONFIG_MV643XX_ETH is not set 820# CONFIG_MV643XX_ETH is not set
806# CONFIG_QLA3XXX is not set 821# CONFIG_QLA3XXX is not set
@@ -828,10 +843,7 @@ CONFIG_CHELSIO_T3_DEPENDS=y
828# CONFIG_SFC is not set 843# CONFIG_SFC is not set
829# CONFIG_BE2NET is not set 844# CONFIG_BE2NET is not set
830# CONFIG_TR is not set 845# CONFIG_TR is not set
831 846CONFIG_WLAN=y
832#
833# Wireless LAN
834#
835# CONFIG_WLAN_PRE80211 is not set 847# CONFIG_WLAN_PRE80211 is not set
836# CONFIG_WLAN_80211 is not set 848# CONFIG_WLAN_80211 is not set
837 849
@@ -935,6 +947,7 @@ CONFIG_GEN_RTC=y
935CONFIG_DEVPORT=y 947CONFIG_DEVPORT=y
936CONFIG_I2C=y 948CONFIG_I2C=y
937CONFIG_I2C_BOARDINFO=y 949CONFIG_I2C_BOARDINFO=y
950CONFIG_I2C_COMPAT=y
938CONFIG_I2C_CHARDEV=y 951CONFIG_I2C_CHARDEV=y
939CONFIG_I2C_HELPER_AUTO=y 952CONFIG_I2C_HELPER_AUTO=y
940 953
@@ -990,9 +1003,6 @@ CONFIG_I2C_MPC=y
990# Miscellaneous I2C Chip support 1003# Miscellaneous I2C Chip support
991# 1004#
992# CONFIG_DS1682 is not set 1005# CONFIG_DS1682 is not set
993# CONFIG_SENSORS_PCF8574 is not set
994# CONFIG_PCF8575 is not set
995# CONFIG_SENSORS_PCA9539 is not set
996# CONFIG_SENSORS_TSL2550 is not set 1006# CONFIG_SENSORS_TSL2550 is not set
997# CONFIG_I2C_DEBUG_CORE is not set 1007# CONFIG_I2C_DEBUG_CORE is not set
998# CONFIG_I2C_DEBUG_ALGO is not set 1008# CONFIG_I2C_DEBUG_ALGO is not set
@@ -1025,14 +1035,24 @@ CONFIG_GPIOLIB=y
1025# PCI GPIO expanders: 1035# PCI GPIO expanders:
1026# 1036#
1027# CONFIG_GPIO_BT8XX is not set 1037# CONFIG_GPIO_BT8XX is not set
1038# CONFIG_GPIO_LANGWELL is not set
1028 1039
1029# 1040#
1030# SPI GPIO expanders: 1041# SPI GPIO expanders:
1031# 1042#
1043
1044#
1045# AC97 GPIO expanders:
1046#
1032# CONFIG_W1 is not set 1047# CONFIG_W1 is not set
1033# CONFIG_POWER_SUPPLY is not set 1048# CONFIG_POWER_SUPPLY is not set
1034CONFIG_HWMON=y 1049CONFIG_HWMON=y
1035# CONFIG_HWMON_VID is not set 1050# CONFIG_HWMON_VID is not set
1051# CONFIG_HWMON_DEBUG_CHIP is not set
1052
1053#
1054# Native drivers
1055#
1036# CONFIG_SENSORS_AD7414 is not set 1056# CONFIG_SENSORS_AD7414 is not set
1037# CONFIG_SENSORS_AD7418 is not set 1057# CONFIG_SENSORS_AD7418 is not set
1038# CONFIG_SENSORS_ADM1021 is not set 1058# CONFIG_SENSORS_ADM1021 is not set
@@ -1083,6 +1103,7 @@ CONFIG_HWMON=y
1083# CONFIG_SENSORS_ADS7828 is not set 1103# CONFIG_SENSORS_ADS7828 is not set
1084# CONFIG_SENSORS_THMC50 is not set 1104# CONFIG_SENSORS_THMC50 is not set
1085# CONFIG_SENSORS_TMP401 is not set 1105# CONFIG_SENSORS_TMP401 is not set
1106# CONFIG_SENSORS_TMP421 is not set
1086# CONFIG_SENSORS_VIA686A is not set 1107# CONFIG_SENSORS_VIA686A is not set
1087# CONFIG_SENSORS_VT1211 is not set 1108# CONFIG_SENSORS_VT1211 is not set
1088# CONFIG_SENSORS_VT8231 is not set 1109# CONFIG_SENSORS_VT8231 is not set
@@ -1094,9 +1115,7 @@ CONFIG_HWMON=y
1094# CONFIG_SENSORS_W83L786NG is not set 1115# CONFIG_SENSORS_W83L786NG is not set
1095# CONFIG_SENSORS_W83627HF is not set 1116# CONFIG_SENSORS_W83627HF is not set
1096# CONFIG_SENSORS_W83627EHF is not set 1117# CONFIG_SENSORS_W83627EHF is not set
1097# CONFIG_HWMON_DEBUG_CHIP is not set
1098# CONFIG_THERMAL is not set 1118# CONFIG_THERMAL is not set
1099# CONFIG_THERMAL_HWMON is not set
1100CONFIG_WATCHDOG=y 1119CONFIG_WATCHDOG=y
1101# CONFIG_WATCHDOG_NOWAYOUT is not set 1120# CONFIG_WATCHDOG_NOWAYOUT is not set
1102 1121
@@ -1135,6 +1154,7 @@ CONFIG_SSB_POSSIBLE=y
1135# CONFIG_MFD_TMIO is not set 1154# CONFIG_MFD_TMIO is not set
1136# CONFIG_PMIC_DA903X is not set 1155# CONFIG_PMIC_DA903X is not set
1137# CONFIG_MFD_WM8400 is not set 1156# CONFIG_MFD_WM8400 is not set
1157# CONFIG_MFD_WM831X is not set
1138# CONFIG_MFD_WM8350_I2C is not set 1158# CONFIG_MFD_WM8350_I2C is not set
1139# CONFIG_MFD_PCF50633 is not set 1159# CONFIG_MFD_PCF50633 is not set
1140# CONFIG_AB3100_CORE is not set 1160# CONFIG_AB3100_CORE is not set
@@ -1145,6 +1165,7 @@ CONFIG_SSB_POSSIBLE=y
1145# Graphics support 1165# Graphics support
1146# 1166#
1147# CONFIG_AGP is not set 1167# CONFIG_AGP is not set
1168CONFIG_VGA_ARB=y
1148# CONFIG_DRM is not set 1169# CONFIG_DRM is not set
1149# CONFIG_VGASTATE is not set 1170# CONFIG_VGASTATE is not set
1150CONFIG_VIDEO_OUTPUT_CONTROL=m 1171CONFIG_VIDEO_OUTPUT_CONTROL=m
@@ -1158,7 +1179,6 @@ CONFIG_VIDEO_OUTPUT_CONTROL=m
1158# CONFIG_SOUND is not set 1179# CONFIG_SOUND is not set
1159CONFIG_HID_SUPPORT=y 1180CONFIG_HID_SUPPORT=y
1160CONFIG_HID=y 1181CONFIG_HID=y
1161# CONFIG_HID_DEBUG is not set
1162# CONFIG_HIDRAW is not set 1182# CONFIG_HIDRAW is not set
1163 1183
1164# 1184#
@@ -1181,6 +1201,7 @@ CONFIG_HID_CYPRESS=y
1181CONFIG_HID_EZKEY=y 1201CONFIG_HID_EZKEY=y
1182# CONFIG_HID_KYE is not set 1202# CONFIG_HID_KYE is not set
1183CONFIG_HID_GYRATION=y 1203CONFIG_HID_GYRATION=y
1204# CONFIG_HID_TWINHAN is not set
1184# CONFIG_HID_KENSINGTON is not set 1205# CONFIG_HID_KENSINGTON is not set
1185CONFIG_HID_LOGITECH=y 1206CONFIG_HID_LOGITECH=y
1186# CONFIG_LOGITECH_FF is not set 1207# CONFIG_LOGITECH_FF is not set
@@ -1233,6 +1254,7 @@ CONFIG_USB_EHCI_HCD_PPC_OF=y
1233# CONFIG_USB_OXU210HP_HCD is not set 1254# CONFIG_USB_OXU210HP_HCD is not set
1234# CONFIG_USB_ISP116X_HCD is not set 1255# CONFIG_USB_ISP116X_HCD is not set
1235# CONFIG_USB_ISP1760_HCD is not set 1256# CONFIG_USB_ISP1760_HCD is not set
1257# CONFIG_USB_ISP1362_HCD is not set
1236# CONFIG_USB_OHCI_HCD is not set 1258# CONFIG_USB_OHCI_HCD is not set
1237# CONFIG_USB_UHCI_HCD is not set 1259# CONFIG_USB_UHCI_HCD is not set
1238# CONFIG_USB_FHCI_HCD is not set 1260# CONFIG_USB_FHCI_HCD is not set
@@ -1291,6 +1313,7 @@ CONFIG_USB_EHCI_HCD_PPC_OF=y
1291# CONFIG_USB_LD is not set 1313# CONFIG_USB_LD is not set
1292# CONFIG_USB_TRANCEVIBRATOR is not set 1314# CONFIG_USB_TRANCEVIBRATOR is not set
1293# CONFIG_USB_IOWARRIOR is not set 1315# CONFIG_USB_IOWARRIOR is not set
1316# CONFIG_USB_TEST is not set
1294# CONFIG_USB_ISIGHTFW is not set 1317# CONFIG_USB_ISIGHTFW is not set
1295# CONFIG_USB_VST is not set 1318# CONFIG_USB_VST is not set
1296# CONFIG_USB_GADGET is not set 1319# CONFIG_USB_GADGET is not set
@@ -1338,6 +1361,7 @@ CONFIG_FS_MBCACHE=y
1338# CONFIG_GFS2_FS is not set 1361# CONFIG_GFS2_FS is not set
1339# CONFIG_OCFS2_FS is not set 1362# CONFIG_OCFS2_FS is not set
1340# CONFIG_BTRFS_FS is not set 1363# CONFIG_BTRFS_FS is not set
1364# CONFIG_NILFS2_FS is not set
1341CONFIG_FILE_LOCKING=y 1365CONFIG_FILE_LOCKING=y
1342CONFIG_FSNOTIFY=y 1366CONFIG_FSNOTIFY=y
1343CONFIG_DNOTIFY=y 1367CONFIG_DNOTIFY=y
@@ -1397,7 +1421,6 @@ CONFIG_MISC_FILESYSTEMS=y
1397# CONFIG_ROMFS_FS is not set 1421# CONFIG_ROMFS_FS is not set
1398# CONFIG_SYSV_FS is not set 1422# CONFIG_SYSV_FS is not set
1399# CONFIG_UFS_FS is not set 1423# CONFIG_UFS_FS is not set
1400# CONFIG_NILFS2_FS is not set
1401CONFIG_NETWORK_FILESYSTEMS=y 1424CONFIG_NETWORK_FILESYSTEMS=y
1402CONFIG_NFS_FS=y 1425CONFIG_NFS_FS=y
1403CONFIG_NFS_V3=y 1426CONFIG_NFS_V3=y
@@ -1514,6 +1537,7 @@ CONFIG_ENABLE_WARN_DEPRECATED=y
1514CONFIG_ENABLE_MUST_CHECK=y 1537CONFIG_ENABLE_MUST_CHECK=y
1515CONFIG_FRAME_WARN=1024 1538CONFIG_FRAME_WARN=1024
1516# CONFIG_MAGIC_SYSRQ is not set 1539# CONFIG_MAGIC_SYSRQ is not set
1540# CONFIG_STRIP_ASM_SYMS is not set
1517# CONFIG_UNUSED_SYMBOLS is not set 1541# CONFIG_UNUSED_SYMBOLS is not set
1518# CONFIG_DEBUG_FS is not set 1542# CONFIG_DEBUG_FS is not set
1519# CONFIG_HEADERS_CHECK is not set 1543# CONFIG_HEADERS_CHECK is not set
@@ -1529,6 +1553,7 @@ CONFIG_HAVE_DYNAMIC_FTRACE=y
1529CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y 1553CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y
1530CONFIG_TRACING_SUPPORT=y 1554CONFIG_TRACING_SUPPORT=y
1531# CONFIG_FTRACE is not set 1555# CONFIG_FTRACE is not set
1556# CONFIG_DMA_API_DEBUG is not set
1532# CONFIG_SAMPLES is not set 1557# CONFIG_SAMPLES is not set
1533CONFIG_HAVE_ARCH_KGDB=y 1558CONFIG_HAVE_ARCH_KGDB=y
1534# CONFIG_PPC_DISABLE_WERROR is not set 1559# CONFIG_PPC_DISABLE_WERROR is not set
@@ -1550,7 +1575,6 @@ CONFIG_CRYPTO=y
1550# 1575#
1551# Crypto core or helper 1576# Crypto core or helper
1552# 1577#
1553# CONFIG_CRYPTO_FIPS is not set
1554CONFIG_CRYPTO_ALGAPI=y 1578CONFIG_CRYPTO_ALGAPI=y
1555CONFIG_CRYPTO_ALGAPI2=y 1579CONFIG_CRYPTO_ALGAPI2=y
1556CONFIG_CRYPTO_AEAD=y 1580CONFIG_CRYPTO_AEAD=y
@@ -1591,13 +1615,15 @@ CONFIG_CRYPTO_PCBC=m
1591# 1615#
1592# Hash modes 1616# Hash modes
1593# 1617#
1594# CONFIG_CRYPTO_HMAC is not set 1618CONFIG_CRYPTO_HMAC=y
1595# CONFIG_CRYPTO_XCBC is not set 1619# CONFIG_CRYPTO_XCBC is not set
1620# CONFIG_CRYPTO_VMAC is not set
1596 1621
1597# 1622#
1598# Digest 1623# Digest
1599# 1624#
1600# CONFIG_CRYPTO_CRC32C is not set 1625# CONFIG_CRYPTO_CRC32C is not set
1626# CONFIG_CRYPTO_GHASH is not set
1601# CONFIG_CRYPTO_MD4 is not set 1627# CONFIG_CRYPTO_MD4 is not set
1602CONFIG_CRYPTO_MD5=y 1628CONFIG_CRYPTO_MD5=y
1603# CONFIG_CRYPTO_MICHAEL_MIC is not set 1629# CONFIG_CRYPTO_MICHAEL_MIC is not set
@@ -1605,16 +1631,16 @@ CONFIG_CRYPTO_MD5=y
1605# CONFIG_CRYPTO_RMD160 is not set 1631# CONFIG_CRYPTO_RMD160 is not set
1606# CONFIG_CRYPTO_RMD256 is not set 1632# CONFIG_CRYPTO_RMD256 is not set
1607# CONFIG_CRYPTO_RMD320 is not set 1633# CONFIG_CRYPTO_RMD320 is not set
1608# CONFIG_CRYPTO_SHA1 is not set 1634CONFIG_CRYPTO_SHA1=y
1609# CONFIG_CRYPTO_SHA256 is not set 1635CONFIG_CRYPTO_SHA256=y
1610# CONFIG_CRYPTO_SHA512 is not set 1636CONFIG_CRYPTO_SHA512=y
1611# CONFIG_CRYPTO_TGR192 is not set 1637# CONFIG_CRYPTO_TGR192 is not set
1612# CONFIG_CRYPTO_WP512 is not set 1638# CONFIG_CRYPTO_WP512 is not set
1613 1639
1614# 1640#
1615# Ciphers 1641# Ciphers
1616# 1642#
1617# CONFIG_CRYPTO_AES is not set 1643CONFIG_CRYPTO_AES=y
1618# CONFIG_CRYPTO_ANUBIS is not set 1644# CONFIG_CRYPTO_ANUBIS is not set
1619# CONFIG_CRYPTO_ARC4 is not set 1645# CONFIG_CRYPTO_ARC4 is not set
1620# CONFIG_CRYPTO_BLOWFISH is not set 1646# CONFIG_CRYPTO_BLOWFISH is not set
diff --git a/arch/powerpc/configs/mpc85xx_defconfig b/arch/powerpc/configs/mpc85xx_defconfig
index ee6acc6557f8..a12e7ba87a43 100644
--- a/arch/powerpc/configs/mpc85xx_defconfig
+++ b/arch/powerpc/configs/mpc85xx_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.31-rc4 3# Linux kernel version: 2.6.32-rc5
4# Wed Jul 29 23:31:55 2009 4# Thu Nov 5 08:25:20 2009
5# 5#
6# CONFIG_PPC64 is not set 6# CONFIG_PPC64 is not set
7 7
@@ -22,6 +22,7 @@ CONFIG_FSL_EMB_PERFMON=y
22# CONFIG_PHYS_64BIT is not set 22# CONFIG_PHYS_64BIT is not set
23CONFIG_SPE=y 23CONFIG_SPE=y
24CONFIG_PPC_MMU_NOHASH=y 24CONFIG_PPC_MMU_NOHASH=y
25CONFIG_PPC_MMU_NOHASH_32=y
25CONFIG_PPC_BOOK3E_MMU=y 26CONFIG_PPC_BOOK3E_MMU=y
26# CONFIG_PPC_MM_SLICES is not set 27# CONFIG_PPC_MM_SLICES is not set
27# CONFIG_SMP is not set 28# CONFIG_SMP is not set
@@ -36,6 +37,7 @@ CONFIG_GENERIC_CLOCKEVENTS=y
36CONFIG_GENERIC_HARDIRQS=y 37CONFIG_GENERIC_HARDIRQS=y
37CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=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
40# CONFIG_NEED_PER_CPU_EMBED_FIRST_CHUNK is not set
39CONFIG_IRQ_PER_CPU=y 41CONFIG_IRQ_PER_CPU=y
40CONFIG_STACKTRACE_SUPPORT=y 42CONFIG_STACKTRACE_SUPPORT=y
41CONFIG_HAVE_LATENCYTOP_SUPPORT=y 43CONFIG_HAVE_LATENCYTOP_SUPPORT=y
@@ -88,11 +90,12 @@ CONFIG_AUDIT=y
88# 90#
89# RCU Subsystem 91# RCU Subsystem
90# 92#
91CONFIG_CLASSIC_RCU=y 93CONFIG_TREE_RCU=y
92# CONFIG_TREE_RCU is not set 94# CONFIG_TREE_PREEMPT_RCU is not set
93# CONFIG_PREEMPT_RCU is not set 95# CONFIG_RCU_TRACE is not set
96CONFIG_RCU_FANOUT=32
97# CONFIG_RCU_FANOUT_EXACT is not set
94# CONFIG_TREE_RCU_TRACE is not set 98# CONFIG_TREE_RCU_TRACE is not set
95# CONFIG_PREEMPT_RCU_TRACE is not set
96CONFIG_IKCONFIG=y 99CONFIG_IKCONFIG=y
97CONFIG_IKCONFIG_PROC=y 100CONFIG_IKCONFIG_PROC=y
98CONFIG_LOG_BUF_SHIFT=14 101CONFIG_LOG_BUF_SHIFT=14
@@ -131,22 +134,21 @@ CONFIG_TIMERFD=y
131CONFIG_EVENTFD=y 134CONFIG_EVENTFD=y
132CONFIG_SHMEM=y 135CONFIG_SHMEM=y
133CONFIG_AIO=y 136CONFIG_AIO=y
134CONFIG_HAVE_PERF_COUNTERS=y 137CONFIG_HAVE_PERF_EVENTS=y
135 138
136# 139#
137# Performance Counters 140# Kernel Performance Events And Counters
138# 141#
142# CONFIG_PERF_EVENTS is not set
139# CONFIG_PERF_COUNTERS is not set 143# CONFIG_PERF_COUNTERS is not set
140CONFIG_VM_EVENT_COUNTERS=y 144CONFIG_VM_EVENT_COUNTERS=y
141CONFIG_PCI_QUIRKS=y 145CONFIG_PCI_QUIRKS=y
142CONFIG_SLUB_DEBUG=y 146CONFIG_SLUB_DEBUG=y
143# CONFIG_STRIP_ASM_SYMS is not set
144CONFIG_COMPAT_BRK=y 147CONFIG_COMPAT_BRK=y
145# CONFIG_SLAB is not set 148# CONFIG_SLAB is not set
146CONFIG_SLUB=y 149CONFIG_SLUB=y
147# CONFIG_SLOB is not set 150# CONFIG_SLOB is not set
148# CONFIG_PROFILING is not set 151# CONFIG_PROFILING is not set
149# CONFIG_MARKERS is not set
150CONFIG_HAVE_OPROFILE=y 152CONFIG_HAVE_OPROFILE=y
151# CONFIG_KPROBES is not set 153# CONFIG_KPROBES is not set
152CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS=y 154CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS=y
@@ -154,7 +156,9 @@ CONFIG_HAVE_IOREMAP_PROT=y
154CONFIG_HAVE_KPROBES=y 156CONFIG_HAVE_KPROBES=y
155CONFIG_HAVE_KRETPROBES=y 157CONFIG_HAVE_KRETPROBES=y
156CONFIG_HAVE_ARCH_TRACEHOOK=y 158CONFIG_HAVE_ARCH_TRACEHOOK=y
159CONFIG_HAVE_DMA_ATTRS=y
157CONFIG_HAVE_CLK=y 160CONFIG_HAVE_CLK=y
161CONFIG_HAVE_DMA_API_DEBUG=y
158 162
159# 163#
160# GCOV-based kernel profiling 164# GCOV-based kernel profiling
@@ -189,6 +193,7 @@ CONFIG_DEFAULT_CFQ=y
189# CONFIG_DEFAULT_NOOP is not set 193# CONFIG_DEFAULT_NOOP is not set
190CONFIG_DEFAULT_IOSCHED="cfq" 194CONFIG_DEFAULT_IOSCHED="cfq"
191# CONFIG_FREEZER is not set 195# CONFIG_FREEZER is not set
196CONFIG_PPC_MSI_BITMAP=y
192 197
193# 198#
194# Platform support 199# Platform support
@@ -206,7 +211,7 @@ CONFIG_MPC85xx_DS=y
206CONFIG_MPC85xx_RDB=y 211CONFIG_MPC85xx_RDB=y
207CONFIG_SOCRATES=y 212CONFIG_SOCRATES=y
208CONFIG_KSI8560=y 213CONFIG_KSI8560=y
209# CONFIG_XES_MPC85xx is not set 214CONFIG_XES_MPC85xx=y
210CONFIG_STX_GP3=y 215CONFIG_STX_GP3=y
211CONFIG_TQM8540=y 216CONFIG_TQM8540=y
212CONFIG_TQM8541=y 217CONFIG_TQM8541=y
@@ -259,10 +264,10 @@ CONFIG_BINFMT_MISC=m
259CONFIG_MATH_EMULATION=y 264CONFIG_MATH_EMULATION=y
260CONFIG_IOMMU_HELPER=y 265CONFIG_IOMMU_HELPER=y
261CONFIG_SWIOTLB=y 266CONFIG_SWIOTLB=y
262CONFIG_PPC_NEED_DMA_SYNC_OPS=y
263CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y 267CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y
264CONFIG_ARCH_HAS_WALK_MEMORY=y 268CONFIG_ARCH_HAS_WALK_MEMORY=y
265CONFIG_ARCH_ENABLE_MEMORY_HOTREMOVE=y 269CONFIG_ARCH_ENABLE_MEMORY_HOTREMOVE=y
270CONFIG_MAX_ACTIVE_REGIONS=32
266CONFIG_ARCH_FLATMEM_ENABLE=y 271CONFIG_ARCH_FLATMEM_ENABLE=y
267CONFIG_ARCH_POPULATES_NODE_MAP=y 272CONFIG_ARCH_POPULATES_NODE_MAP=y
268CONFIG_SELECT_MEMORY_MODEL=y 273CONFIG_SELECT_MEMORY_MODEL=y
@@ -280,6 +285,7 @@ CONFIG_BOUNCE=y
280CONFIG_VIRT_TO_BUS=y 285CONFIG_VIRT_TO_BUS=y
281CONFIG_HAVE_MLOCK=y 286CONFIG_HAVE_MLOCK=y
282CONFIG_HAVE_MLOCKED_PAGE_BIT=y 287CONFIG_HAVE_MLOCKED_PAGE_BIT=y
288# CONFIG_KSM is not set
283CONFIG_DEFAULT_MMAP_MIN_ADDR=4096 289CONFIG_DEFAULT_MMAP_MIN_ADDR=4096
284CONFIG_PPC_4K_PAGES=y 290CONFIG_PPC_4K_PAGES=y
285# CONFIG_PPC_16K_PAGES is not set 291# CONFIG_PPC_16K_PAGES is not set
@@ -307,7 +313,7 @@ CONFIG_PCI_DOMAINS=y
307CONFIG_PCI_SYSCALL=y 313CONFIG_PCI_SYSCALL=y
308# CONFIG_PCIEPORTBUS is not set 314# CONFIG_PCIEPORTBUS is not set
309CONFIG_ARCH_SUPPORTS_MSI=y 315CONFIG_ARCH_SUPPORTS_MSI=y
310# CONFIG_PCI_MSI is not set 316CONFIG_PCI_MSI=y
311# CONFIG_PCI_LEGACY is not set 317# CONFIG_PCI_LEGACY is not set
312# CONFIG_PCI_DEBUG is not set 318# CONFIG_PCI_DEBUG is not set
313# CONFIG_PCI_STUB is not set 319# CONFIG_PCI_STUB is not set
@@ -315,7 +321,8 @@ CONFIG_ARCH_SUPPORTS_MSI=y
315# CONFIG_PCCARD is not set 321# CONFIG_PCCARD is not set
316# CONFIG_HOTPLUG_PCI is not set 322# CONFIG_HOTPLUG_PCI is not set
317CONFIG_HAS_RAPIDIO=y 323CONFIG_HAS_RAPIDIO=y
318# CONFIG_RAPIDIO is not set 324CONFIG_RAPIDIO=y
325CONFIG_RAPIDIO_DISC_TIMEOUT=30
319 326
320# 327#
321# Advanced setup 328# Advanced setup
@@ -345,7 +352,7 @@ CONFIG_XFRM_USER=y
345# CONFIG_XFRM_SUB_POLICY is not set 352# CONFIG_XFRM_SUB_POLICY is not set
346# CONFIG_XFRM_MIGRATE is not set 353# CONFIG_XFRM_MIGRATE is not set
347# CONFIG_XFRM_STATISTICS is not set 354# CONFIG_XFRM_STATISTICS is not set
348CONFIG_NET_KEY=m 355CONFIG_NET_KEY=y
349# CONFIG_NET_KEY_MIGRATE is not set 356# CONFIG_NET_KEY_MIGRATE is not set
350CONFIG_INET=y 357CONFIG_INET=y
351CONFIG_IP_MULTICAST=y 358CONFIG_IP_MULTICAST=y
@@ -369,12 +376,12 @@ CONFIG_IP_PIMSM_V2=y
369CONFIG_ARPD=y 376CONFIG_ARPD=y
370# CONFIG_SYN_COOKIES is not set 377# CONFIG_SYN_COOKIES is not set
371# CONFIG_INET_AH is not set 378# CONFIG_INET_AH is not set
372# CONFIG_INET_ESP is not set 379CONFIG_INET_ESP=y
373# CONFIG_INET_IPCOMP is not set 380# CONFIG_INET_IPCOMP is not set
374# CONFIG_INET_XFRM_TUNNEL is not set 381# CONFIG_INET_XFRM_TUNNEL is not set
375CONFIG_INET_TUNNEL=y 382CONFIG_INET_TUNNEL=y
376# CONFIG_INET_XFRM_MODE_TRANSPORT is not set 383CONFIG_INET_XFRM_MODE_TRANSPORT=y
377# CONFIG_INET_XFRM_MODE_TUNNEL is not set 384CONFIG_INET_XFRM_MODE_TUNNEL=y
378# CONFIG_INET_XFRM_MODE_BEET is not set 385# CONFIG_INET_XFRM_MODE_BEET is not set
379# CONFIG_INET_LRO is not set 386# CONFIG_INET_LRO is not set
380CONFIG_INET_DIAG=y 387CONFIG_INET_DIAG=y
@@ -411,6 +418,7 @@ CONFIG_IP_SCTP=m
411# CONFIG_SCTP_HMAC_NONE is not set 418# CONFIG_SCTP_HMAC_NONE is not set
412# CONFIG_SCTP_HMAC_SHA1 is not set 419# CONFIG_SCTP_HMAC_SHA1 is not set
413CONFIG_SCTP_HMAC_MD5=y 420CONFIG_SCTP_HMAC_MD5=y
421# CONFIG_RDS is not set
414# CONFIG_TIPC is not set 422# CONFIG_TIPC is not set
415# CONFIG_ATM is not set 423# CONFIG_ATM is not set
416# CONFIG_BRIDGE is not set 424# CONFIG_BRIDGE is not set
@@ -441,6 +449,7 @@ CONFIG_SCTP_HMAC_MD5=y
441CONFIG_FIB_RULES=y 449CONFIG_FIB_RULES=y
442CONFIG_WIRELESS=y 450CONFIG_WIRELESS=y
443# CONFIG_CFG80211 is not set 451# CONFIG_CFG80211 is not set
452CONFIG_CFG80211_DEFAULT_PS_VALUE=0
444CONFIG_WIRELESS_OLD_REGULATORY=y 453CONFIG_WIRELESS_OLD_REGULATORY=y
445# CONFIG_WIRELESS_EXT is not set 454# CONFIG_WIRELESS_EXT is not set
446# CONFIG_LIB80211 is not set 455# CONFIG_LIB80211 is not set
@@ -448,7 +457,6 @@ CONFIG_WIRELESS_OLD_REGULATORY=y
448# 457#
449# CFG80211 needs to be enabled for MAC80211 458# CFG80211 needs to be enabled for MAC80211
450# 459#
451CONFIG_MAC80211_DEFAULT_PS_VALUE=0
452# CONFIG_WIMAX is not set 460# CONFIG_WIMAX is not set
453# CONFIG_RFKILL is not set 461# CONFIG_RFKILL is not set
454# CONFIG_NET_9P is not set 462# CONFIG_NET_9P is not set
@@ -461,6 +469,7 @@ CONFIG_MAC80211_DEFAULT_PS_VALUE=0
461# Generic Driver Options 469# Generic Driver Options
462# 470#
463CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug" 471CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
472# CONFIG_DEVTMPFS is not set
464CONFIG_STANDALONE=y 473CONFIG_STANDALONE=y
465CONFIG_PREVENT_FIRMWARE_BUILD=y 474CONFIG_PREVENT_FIRMWARE_BUILD=y
466CONFIG_FW_LOADER=y 475CONFIG_FW_LOADER=y
@@ -554,6 +563,7 @@ CONFIG_SCSI_LOWLEVEL=y
554# CONFIG_ISCSI_TCP is not set 563# CONFIG_ISCSI_TCP is not set
555# CONFIG_SCSI_CXGB3_ISCSI is not set 564# CONFIG_SCSI_CXGB3_ISCSI is not set
556# CONFIG_SCSI_BNX2_ISCSI is not set 565# CONFIG_SCSI_BNX2_ISCSI is not set
566# CONFIG_BE2ISCSI is not set
557# CONFIG_BLK_DEV_3W_XXXX_RAID is not set 567# CONFIG_BLK_DEV_3W_XXXX_RAID is not set
558# CONFIG_SCSI_3W_9XXX is not set 568# CONFIG_SCSI_3W_9XXX is not set
559# CONFIG_SCSI_ACARD is not set 569# CONFIG_SCSI_ACARD is not set
@@ -593,11 +603,14 @@ CONFIG_SCSI_LOWLEVEL=y
593# CONFIG_SCSI_DC390T is not set 603# CONFIG_SCSI_DC390T is not set
594# CONFIG_SCSI_NSP32 is not set 604# CONFIG_SCSI_NSP32 is not set
595# CONFIG_SCSI_DEBUG is not set 605# CONFIG_SCSI_DEBUG is not set
606# CONFIG_SCSI_PMCRAID is not set
596# CONFIG_SCSI_SRP is not set 607# CONFIG_SCSI_SRP is not set
608# CONFIG_SCSI_BFA_FC is not set
597# CONFIG_SCSI_DH is not set 609# CONFIG_SCSI_DH is not set
598# CONFIG_SCSI_OSD_INITIATOR is not set 610# CONFIG_SCSI_OSD_INITIATOR is not set
599CONFIG_ATA=y 611CONFIG_ATA=y
600# CONFIG_ATA_NONSTANDARD is not set 612# CONFIG_ATA_NONSTANDARD is not set
613CONFIG_ATA_VERBOSE_ERROR=y
601CONFIG_SATA_PMP=y 614CONFIG_SATA_PMP=y
602CONFIG_SATA_AHCI=y 615CONFIG_SATA_AHCI=y
603# CONFIG_SATA_SIL24 is not set 616# CONFIG_SATA_SIL24 is not set
@@ -620,6 +633,7 @@ CONFIG_ATA_SFF=y
620CONFIG_PATA_ALI=y 633CONFIG_PATA_ALI=y
621# CONFIG_PATA_AMD is not set 634# CONFIG_PATA_AMD is not set
622# CONFIG_PATA_ARTOP is not set 635# CONFIG_PATA_ARTOP is not set
636# CONFIG_PATA_ATP867X is not set
623# CONFIG_PATA_ATIIXP is not set 637# CONFIG_PATA_ATIIXP is not set
624# CONFIG_PATA_CMD640_PCI is not set 638# CONFIG_PATA_CMD640_PCI is not set
625# CONFIG_PATA_CMD64X is not set 639# CONFIG_PATA_CMD64X is not set
@@ -647,6 +661,7 @@ CONFIG_PATA_ALI=y
647# CONFIG_PATA_OPTIDMA is not set 661# CONFIG_PATA_OPTIDMA is not set
648# CONFIG_PATA_PDC_OLD is not set 662# CONFIG_PATA_PDC_OLD is not set
649# CONFIG_PATA_RADISYS is not set 663# CONFIG_PATA_RADISYS is not set
664# CONFIG_PATA_RDC is not set
650# CONFIG_PATA_RZ1000 is not set 665# CONFIG_PATA_RZ1000 is not set
651# CONFIG_PATA_SC1200 is not set 666# CONFIG_PATA_SC1200 is not set
652# CONFIG_PATA_SERVERWORKS is not set 667# CONFIG_PATA_SERVERWORKS is not set
@@ -723,7 +738,9 @@ CONFIG_MII=y
723# CONFIG_NET_PCI is not set 738# CONFIG_NET_PCI is not set
724# CONFIG_B44 is not set 739# CONFIG_B44 is not set
725# CONFIG_KS8842 is not set 740# CONFIG_KS8842 is not set
741# CONFIG_KS8851_MLL is not set
726# CONFIG_ATL2 is not set 742# CONFIG_ATL2 is not set
743# CONFIG_XILINX_EMACLITE is not set
727CONFIG_FS_ENET=y 744CONFIG_FS_ENET=y
728CONFIG_FS_ENET_HAS_SCC=y 745CONFIG_FS_ENET_HAS_SCC=y
729CONFIG_FS_ENET_HAS_FCC=y 746CONFIG_FS_ENET_HAS_FCC=y
@@ -750,7 +767,6 @@ CONFIG_NETDEV_1000=y
750CONFIG_FSL_PQ_MDIO=y 767CONFIG_FSL_PQ_MDIO=y
751CONFIG_GIANFAR=y 768CONFIG_GIANFAR=y
752CONFIG_UCC_GETH=y 769CONFIG_UCC_GETH=y
753# CONFIG_UGETH_MAGIC_PACKET is not set
754# CONFIG_UGETH_TX_ON_DEMAND is not set 770# CONFIG_UGETH_TX_ON_DEMAND is not set
755# CONFIG_MV643XX_ETH is not set 771# CONFIG_MV643XX_ETH is not set
756# CONFIG_QLA3XXX is not set 772# CONFIG_QLA3XXX is not set
@@ -778,10 +794,7 @@ CONFIG_CHELSIO_T3_DEPENDS=y
778# CONFIG_SFC is not set 794# CONFIG_SFC is not set
779# CONFIG_BE2NET is not set 795# CONFIG_BE2NET is not set
780# CONFIG_TR is not set 796# CONFIG_TR is not set
781 797CONFIG_WLAN=y
782#
783# Wireless LAN
784#
785# CONFIG_WLAN_PRE80211 is not set 798# CONFIG_WLAN_PRE80211 is not set
786# CONFIG_WLAN_80211 is not set 799# CONFIG_WLAN_80211 is not set
787 800
@@ -798,6 +811,7 @@ CONFIG_CHELSIO_T3_DEPENDS=y
798# CONFIG_USB_RTL8150 is not set 811# CONFIG_USB_RTL8150 is not set
799# CONFIG_USB_USBNET is not set 812# CONFIG_USB_USBNET is not set
800# CONFIG_WAN is not set 813# CONFIG_WAN is not set
814# CONFIG_RIONET is not set
801# CONFIG_FDDI is not set 815# CONFIG_FDDI is not set
802# CONFIG_HIPPI is not set 816# CONFIG_HIPPI is not set
803# CONFIG_PPP is not set 817# CONFIG_PPP is not set
@@ -898,6 +912,7 @@ CONFIG_NVRAM=y
898CONFIG_DEVPORT=y 912CONFIG_DEVPORT=y
899CONFIG_I2C=y 913CONFIG_I2C=y
900CONFIG_I2C_BOARDINFO=y 914CONFIG_I2C_BOARDINFO=y
915CONFIG_I2C_COMPAT=y
901# CONFIG_I2C_CHARDEV is not set 916# CONFIG_I2C_CHARDEV is not set
902CONFIG_I2C_HELPER_AUTO=y 917CONFIG_I2C_HELPER_AUTO=y
903 918
@@ -955,9 +970,6 @@ CONFIG_I2C_MPC=y
955# Miscellaneous I2C Chip support 970# Miscellaneous I2C Chip support
956# 971#
957# CONFIG_DS1682 is not set 972# CONFIG_DS1682 is not set
958# CONFIG_SENSORS_PCF8574 is not set
959# CONFIG_PCF8575 is not set
960# CONFIG_SENSORS_PCA9539 is not set
961# CONFIG_SENSORS_TSL2550 is not set 973# CONFIG_SENSORS_TSL2550 is not set
962# CONFIG_I2C_DEBUG_CORE is not set 974# CONFIG_I2C_DEBUG_CORE is not set
963# CONFIG_I2C_DEBUG_ALGO is not set 975# CONFIG_I2C_DEBUG_ALGO is not set
@@ -991,15 +1003,19 @@ CONFIG_GPIOLIB=y
991# PCI GPIO expanders: 1003# PCI GPIO expanders:
992# 1004#
993# CONFIG_GPIO_BT8XX is not set 1005# CONFIG_GPIO_BT8XX is not set
1006# CONFIG_GPIO_LANGWELL is not set
994 1007
995# 1008#
996# SPI GPIO expanders: 1009# SPI GPIO expanders:
997# 1010#
1011
1012#
1013# AC97 GPIO expanders:
1014#
998# CONFIG_W1 is not set 1015# CONFIG_W1 is not set
999# CONFIG_POWER_SUPPLY is not set 1016# CONFIG_POWER_SUPPLY is not set
1000# CONFIG_HWMON is not set 1017# CONFIG_HWMON is not set
1001# CONFIG_THERMAL is not set 1018# CONFIG_THERMAL is not set
1002# CONFIG_THERMAL_HWMON is not set
1003# CONFIG_WATCHDOG is not set 1019# CONFIG_WATCHDOG is not set
1004CONFIG_SSB_POSSIBLE=y 1020CONFIG_SSB_POSSIBLE=y
1005 1021
@@ -1020,6 +1036,7 @@ CONFIG_SSB_POSSIBLE=y
1020# CONFIG_MFD_TMIO is not set 1036# CONFIG_MFD_TMIO is not set
1021# CONFIG_PMIC_DA903X is not set 1037# CONFIG_PMIC_DA903X is not set
1022# CONFIG_MFD_WM8400 is not set 1038# CONFIG_MFD_WM8400 is not set
1039# CONFIG_MFD_WM831X is not set
1023# CONFIG_MFD_WM8350_I2C is not set 1040# CONFIG_MFD_WM8350_I2C is not set
1024# CONFIG_MFD_PCF50633 is not set 1041# CONFIG_MFD_PCF50633 is not set
1025# CONFIG_AB3100_CORE is not set 1042# CONFIG_AB3100_CORE is not set
@@ -1030,6 +1047,7 @@ CONFIG_SSB_POSSIBLE=y
1030# Graphics support 1047# Graphics support
1031# 1048#
1032# CONFIG_AGP is not set 1049# CONFIG_AGP is not set
1050CONFIG_VGA_ARB=y
1033# CONFIG_DRM is not set 1051# CONFIG_DRM is not set
1034# CONFIG_VGASTATE is not set 1052# CONFIG_VGASTATE is not set
1035CONFIG_VIDEO_OUTPUT_CONTROL=y 1053CONFIG_VIDEO_OUTPUT_CONTROL=y
@@ -1049,6 +1067,7 @@ CONFIG_VGA_CONSOLE=y
1049CONFIG_DUMMY_CONSOLE=y 1067CONFIG_DUMMY_CONSOLE=y
1050CONFIG_SOUND=y 1068CONFIG_SOUND=y
1051CONFIG_SOUND_OSS_CORE=y 1069CONFIG_SOUND_OSS_CORE=y
1070CONFIG_SOUND_OSS_CORE_PRECLAIM=y
1052CONFIG_SND=y 1071CONFIG_SND=y
1053CONFIG_SND_TIMER=y 1072CONFIG_SND_TIMER=y
1054CONFIG_SND_PCM=y 1073CONFIG_SND_PCM=y
@@ -1152,7 +1171,6 @@ CONFIG_SND_USB=y
1152CONFIG_AC97_BUS=y 1171CONFIG_AC97_BUS=y
1153CONFIG_HID_SUPPORT=y 1172CONFIG_HID_SUPPORT=y
1154CONFIG_HID=y 1173CONFIG_HID=y
1155# CONFIG_HID_DEBUG is not set
1156# CONFIG_HIDRAW is not set 1174# CONFIG_HIDRAW is not set
1157 1175
1158# 1176#
@@ -1175,6 +1193,7 @@ CONFIG_HID_CYPRESS=y
1175CONFIG_HID_EZKEY=y 1193CONFIG_HID_EZKEY=y
1176# CONFIG_HID_KYE is not set 1194# CONFIG_HID_KYE is not set
1177CONFIG_HID_GYRATION=y 1195CONFIG_HID_GYRATION=y
1196# CONFIG_HID_TWINHAN is not set
1178# CONFIG_HID_KENSINGTON is not set 1197# CONFIG_HID_KENSINGTON is not set
1179CONFIG_HID_LOGITECH=y 1198CONFIG_HID_LOGITECH=y
1180# CONFIG_LOGITECH_FF is not set 1199# CONFIG_LOGITECH_FF is not set
@@ -1227,6 +1246,7 @@ CONFIG_USB_EHCI_HCD_PPC_OF=y
1227# CONFIG_USB_OXU210HP_HCD is not set 1246# CONFIG_USB_OXU210HP_HCD is not set
1228# CONFIG_USB_ISP116X_HCD is not set 1247# CONFIG_USB_ISP116X_HCD is not set
1229# CONFIG_USB_ISP1760_HCD is not set 1248# CONFIG_USB_ISP1760_HCD is not set
1249# CONFIG_USB_ISP1362_HCD is not set
1230CONFIG_USB_OHCI_HCD=y 1250CONFIG_USB_OHCI_HCD=y
1231CONFIG_USB_OHCI_HCD_PPC_OF_BE=y 1251CONFIG_USB_OHCI_HCD_PPC_OF_BE=y
1232CONFIG_USB_OHCI_HCD_PPC_OF_LE=y 1252CONFIG_USB_OHCI_HCD_PPC_OF_LE=y
@@ -1241,7 +1261,6 @@ CONFIG_USB_OHCI_LITTLE_ENDIAN=y
1241# CONFIG_USB_R8A66597_HCD is not set 1261# CONFIG_USB_R8A66597_HCD is not set
1242# CONFIG_USB_WHCI_HCD is not set 1262# CONFIG_USB_WHCI_HCD is not set
1243# CONFIG_USB_HWA_HCD is not set 1263# CONFIG_USB_HWA_HCD is not set
1244# CONFIG_USB_MUSB_HDRC is not set
1245 1264
1246# 1265#
1247# USB Device Class drivers 1266# USB Device Class drivers
@@ -1429,6 +1448,7 @@ CONFIG_FS_MBCACHE=y
1429# CONFIG_GFS2_FS is not set 1448# CONFIG_GFS2_FS is not set
1430# CONFIG_OCFS2_FS is not set 1449# CONFIG_OCFS2_FS is not set
1431# CONFIG_BTRFS_FS is not set 1450# CONFIG_BTRFS_FS is not set
1451# CONFIG_NILFS2_FS is not set
1432CONFIG_FILE_LOCKING=y 1452CONFIG_FILE_LOCKING=y
1433CONFIG_FSNOTIFY=y 1453CONFIG_FSNOTIFY=y
1434CONFIG_DNOTIFY=y 1454CONFIG_DNOTIFY=y
@@ -1499,7 +1519,6 @@ CONFIG_SYSV_FS=m
1499CONFIG_UFS_FS=m 1519CONFIG_UFS_FS=m
1500# CONFIG_UFS_FS_WRITE is not set 1520# CONFIG_UFS_FS_WRITE is not set
1501# CONFIG_UFS_DEBUG is not set 1521# CONFIG_UFS_DEBUG is not set
1502# CONFIG_NILFS2_FS is not set
1503CONFIG_NETWORK_FILESYSTEMS=y 1522CONFIG_NETWORK_FILESYSTEMS=y
1504CONFIG_NFS_FS=y 1523CONFIG_NFS_FS=y
1505CONFIG_NFS_V3=y 1524CONFIG_NFS_V3=y
@@ -1620,6 +1639,7 @@ CONFIG_ENABLE_WARN_DEPRECATED=y
1620CONFIG_ENABLE_MUST_CHECK=y 1639CONFIG_ENABLE_MUST_CHECK=y
1621CONFIG_FRAME_WARN=1024 1640CONFIG_FRAME_WARN=1024
1622# CONFIG_MAGIC_SYSRQ is not set 1641# CONFIG_MAGIC_SYSRQ is not set
1642# CONFIG_STRIP_ASM_SYMS is not set
1623# CONFIG_UNUSED_SYMBOLS is not set 1643# CONFIG_UNUSED_SYMBOLS is not set
1624CONFIG_DEBUG_FS=y 1644CONFIG_DEBUG_FS=y
1625# CONFIG_HEADERS_CHECK is not set 1645# CONFIG_HEADERS_CHECK is not set
@@ -1637,6 +1657,7 @@ CONFIG_SCHED_DEBUG=y
1637# CONFIG_DEBUG_OBJECTS is not set 1657# CONFIG_DEBUG_OBJECTS is not set
1638# CONFIG_SLUB_DEBUG_ON is not set 1658# CONFIG_SLUB_DEBUG_ON is not set
1639# CONFIG_SLUB_STATS is not set 1659# CONFIG_SLUB_STATS is not set
1660# CONFIG_DEBUG_KMEMLEAK is not set
1640# CONFIG_DEBUG_RT_MUTEXES is not set 1661# CONFIG_DEBUG_RT_MUTEXES is not set
1641# CONFIG_RT_MUTEX_TESTER is not set 1662# CONFIG_RT_MUTEX_TESTER is not set
1642# CONFIG_DEBUG_SPINLOCK is not set 1663# CONFIG_DEBUG_SPINLOCK is not set
@@ -1656,10 +1677,12 @@ CONFIG_DEBUG_INFO=y
1656# CONFIG_DEBUG_LIST is not set 1677# CONFIG_DEBUG_LIST is not set
1657# CONFIG_DEBUG_SG is not set 1678# CONFIG_DEBUG_SG is not set
1658# CONFIG_DEBUG_NOTIFIERS is not set 1679# CONFIG_DEBUG_NOTIFIERS is not set
1680# CONFIG_DEBUG_CREDENTIALS is not set
1659# CONFIG_RCU_TORTURE_TEST is not set 1681# CONFIG_RCU_TORTURE_TEST is not set
1660# CONFIG_RCU_CPU_STALL_DETECTOR is not set 1682# CONFIG_RCU_CPU_STALL_DETECTOR is not set
1661# CONFIG_BACKTRACE_SELF_TEST is not set 1683# CONFIG_BACKTRACE_SELF_TEST is not set
1662# CONFIG_DEBUG_BLOCK_EXT_DEVT is not set 1684# CONFIG_DEBUG_BLOCK_EXT_DEVT is not set
1685# CONFIG_DEBUG_FORCE_WEAK_PER_CPU is not set
1663# CONFIG_FAULT_INJECTION is not set 1686# CONFIG_FAULT_INJECTION is not set
1664# CONFIG_LATENCYTOP is not set 1687# CONFIG_LATENCYTOP is not set
1665CONFIG_SYSCTL_SYSCALL_CHECK=y 1688CONFIG_SYSCTL_SYSCALL_CHECK=y
@@ -1683,10 +1706,10 @@ CONFIG_BRANCH_PROFILE_NONE=y
1683# CONFIG_WORKQUEUE_TRACER is not set 1706# CONFIG_WORKQUEUE_TRACER is not set
1684# CONFIG_BLK_DEV_IO_TRACE is not set 1707# CONFIG_BLK_DEV_IO_TRACE is not set
1685# CONFIG_DYNAMIC_DEBUG is not set 1708# CONFIG_DYNAMIC_DEBUG is not set
1709# CONFIG_DMA_API_DEBUG is not set
1686# CONFIG_SAMPLES is not set 1710# CONFIG_SAMPLES is not set
1687CONFIG_HAVE_ARCH_KGDB=y 1711CONFIG_HAVE_ARCH_KGDB=y
1688# CONFIG_KGDB is not set 1712# CONFIG_KGDB is not set
1689# CONFIG_KMEMCHECK is not set
1690# CONFIG_PPC_DISABLE_WERROR is not set 1713# CONFIG_PPC_DISABLE_WERROR is not set
1691CONFIG_PPC_WERROR=y 1714CONFIG_PPC_WERROR=y
1692CONFIG_PRINT_STACK_DEPTH=64 1715CONFIG_PRINT_STACK_DEPTH=64
@@ -1714,7 +1737,6 @@ CONFIG_CRYPTO=y
1714# 1737#
1715# Crypto core or helper 1738# Crypto core or helper
1716# 1739#
1717# CONFIG_CRYPTO_FIPS is not set
1718CONFIG_CRYPTO_ALGAPI=y 1740CONFIG_CRYPTO_ALGAPI=y
1719CONFIG_CRYPTO_ALGAPI2=y 1741CONFIG_CRYPTO_ALGAPI2=y
1720CONFIG_CRYPTO_AEAD=y 1742CONFIG_CRYPTO_AEAD=y
@@ -1757,11 +1779,13 @@ CONFIG_CRYPTO_PCBC=m
1757# 1779#
1758CONFIG_CRYPTO_HMAC=y 1780CONFIG_CRYPTO_HMAC=y
1759# CONFIG_CRYPTO_XCBC is not set 1781# CONFIG_CRYPTO_XCBC is not set
1782# CONFIG_CRYPTO_VMAC is not set
1760 1783
1761# 1784#
1762# Digest 1785# Digest
1763# 1786#
1764CONFIG_CRYPTO_CRC32C=m 1787CONFIG_CRYPTO_CRC32C=m
1788# CONFIG_CRYPTO_GHASH is not set
1765# CONFIG_CRYPTO_MD4 is not set 1789# CONFIG_CRYPTO_MD4 is not set
1766CONFIG_CRYPTO_MD5=y 1790CONFIG_CRYPTO_MD5=y
1767# CONFIG_CRYPTO_MICHAEL_MIC is not set 1791# CONFIG_CRYPTO_MICHAEL_MIC is not set
@@ -1769,16 +1793,16 @@ CONFIG_CRYPTO_MD5=y
1769# CONFIG_CRYPTO_RMD160 is not set 1793# CONFIG_CRYPTO_RMD160 is not set
1770# CONFIG_CRYPTO_RMD256 is not set 1794# CONFIG_CRYPTO_RMD256 is not set
1771# CONFIG_CRYPTO_RMD320 is not set 1795# CONFIG_CRYPTO_RMD320 is not set
1772CONFIG_CRYPTO_SHA1=m 1796CONFIG_CRYPTO_SHA1=y
1773# CONFIG_CRYPTO_SHA256 is not set 1797CONFIG_CRYPTO_SHA256=y
1774# CONFIG_CRYPTO_SHA512 is not set 1798CONFIG_CRYPTO_SHA512=y
1775# CONFIG_CRYPTO_TGR192 is not set 1799# CONFIG_CRYPTO_TGR192 is not set
1776# CONFIG_CRYPTO_WP512 is not set 1800# CONFIG_CRYPTO_WP512 is not set
1777 1801
1778# 1802#
1779# Ciphers 1803# Ciphers
1780# 1804#
1781# CONFIG_CRYPTO_AES is not set 1805CONFIG_CRYPTO_AES=y
1782# CONFIG_CRYPTO_ANUBIS is not set 1806# CONFIG_CRYPTO_ANUBIS is not set
1783# CONFIG_CRYPTO_ARC4 is not set 1807# CONFIG_CRYPTO_ARC4 is not set
1784# CONFIG_CRYPTO_BLOWFISH is not set 1808# CONFIG_CRYPTO_BLOWFISH is not set
diff --git a/arch/powerpc/configs/mpc85xx_smp_defconfig b/arch/powerpc/configs/mpc85xx_smp_defconfig
index db082ce5a1c5..cd70b4a4ce01 100644
--- a/arch/powerpc/configs/mpc85xx_smp_defconfig
+++ b/arch/powerpc/configs/mpc85xx_smp_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.31-rc4 3# Linux kernel version: 2.6.32-rc5
4# Wed Jul 29 23:31:56 2009 4# Thu Nov 5 08:26:01 2009
5# 5#
6# CONFIG_PPC64 is not set 6# CONFIG_PPC64 is not set
7 7
@@ -22,6 +22,7 @@ CONFIG_FSL_EMB_PERFMON=y
22# CONFIG_PHYS_64BIT is not set 22# CONFIG_PHYS_64BIT is not set
23CONFIG_SPE=y 23CONFIG_SPE=y
24CONFIG_PPC_MMU_NOHASH=y 24CONFIG_PPC_MMU_NOHASH=y
25CONFIG_PPC_MMU_NOHASH_32=y
25CONFIG_PPC_BOOK3E_MMU=y 26CONFIG_PPC_BOOK3E_MMU=y
26# CONFIG_PPC_MM_SLICES is not set 27# CONFIG_PPC_MM_SLICES is not set
27CONFIG_SMP=y 28CONFIG_SMP=y
@@ -37,6 +38,7 @@ CONFIG_GENERIC_CLOCKEVENTS=y
37CONFIG_GENERIC_HARDIRQS=y 38CONFIG_GENERIC_HARDIRQS=y
38CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y 39CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y
39# CONFIG_HAVE_SETUP_PER_CPU_AREA is not set 40# CONFIG_HAVE_SETUP_PER_CPU_AREA is not set
41# CONFIG_NEED_PER_CPU_EMBED_FIRST_CHUNK is not set
40CONFIG_IRQ_PER_CPU=y 42CONFIG_IRQ_PER_CPU=y
41CONFIG_STACKTRACE_SUPPORT=y 43CONFIG_STACKTRACE_SUPPORT=y
42CONFIG_HAVE_LATENCYTOP_SUPPORT=y 44CONFIG_HAVE_LATENCYTOP_SUPPORT=y
@@ -89,11 +91,12 @@ CONFIG_AUDIT=y
89# 91#
90# RCU Subsystem 92# RCU Subsystem
91# 93#
92CONFIG_CLASSIC_RCU=y 94CONFIG_TREE_RCU=y
93# CONFIG_TREE_RCU is not set 95# CONFIG_TREE_PREEMPT_RCU is not set
94# CONFIG_PREEMPT_RCU is not set 96# CONFIG_RCU_TRACE is not set
97CONFIG_RCU_FANOUT=32
98# CONFIG_RCU_FANOUT_EXACT is not set
95# CONFIG_TREE_RCU_TRACE is not set 99# CONFIG_TREE_RCU_TRACE is not set
96# CONFIG_PREEMPT_RCU_TRACE is not set
97CONFIG_IKCONFIG=y 100CONFIG_IKCONFIG=y
98CONFIG_IKCONFIG_PROC=y 101CONFIG_IKCONFIG_PROC=y
99CONFIG_LOG_BUF_SHIFT=14 102CONFIG_LOG_BUF_SHIFT=14
@@ -132,22 +135,21 @@ CONFIG_TIMERFD=y
132CONFIG_EVENTFD=y 135CONFIG_EVENTFD=y
133CONFIG_SHMEM=y 136CONFIG_SHMEM=y
134CONFIG_AIO=y 137CONFIG_AIO=y
135CONFIG_HAVE_PERF_COUNTERS=y 138CONFIG_HAVE_PERF_EVENTS=y
136 139
137# 140#
138# Performance Counters 141# Kernel Performance Events And Counters
139# 142#
143# CONFIG_PERF_EVENTS is not set
140# CONFIG_PERF_COUNTERS is not set 144# CONFIG_PERF_COUNTERS is not set
141CONFIG_VM_EVENT_COUNTERS=y 145CONFIG_VM_EVENT_COUNTERS=y
142CONFIG_PCI_QUIRKS=y 146CONFIG_PCI_QUIRKS=y
143CONFIG_SLUB_DEBUG=y 147CONFIG_SLUB_DEBUG=y
144# CONFIG_STRIP_ASM_SYMS is not set
145CONFIG_COMPAT_BRK=y 148CONFIG_COMPAT_BRK=y
146# CONFIG_SLAB is not set 149# CONFIG_SLAB is not set
147CONFIG_SLUB=y 150CONFIG_SLUB=y
148# CONFIG_SLOB is not set 151# CONFIG_SLOB is not set
149# CONFIG_PROFILING is not set 152# CONFIG_PROFILING is not set
150# CONFIG_MARKERS is not set
151CONFIG_HAVE_OPROFILE=y 153CONFIG_HAVE_OPROFILE=y
152# CONFIG_KPROBES is not set 154# CONFIG_KPROBES is not set
153CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS=y 155CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS=y
@@ -155,8 +157,10 @@ CONFIG_HAVE_IOREMAP_PROT=y
155CONFIG_HAVE_KPROBES=y 157CONFIG_HAVE_KPROBES=y
156CONFIG_HAVE_KRETPROBES=y 158CONFIG_HAVE_KRETPROBES=y
157CONFIG_HAVE_ARCH_TRACEHOOK=y 159CONFIG_HAVE_ARCH_TRACEHOOK=y
160CONFIG_HAVE_DMA_ATTRS=y
158CONFIG_USE_GENERIC_SMP_HELPERS=y 161CONFIG_USE_GENERIC_SMP_HELPERS=y
159CONFIG_HAVE_CLK=y 162CONFIG_HAVE_CLK=y
163CONFIG_HAVE_DMA_API_DEBUG=y
160 164
161# 165#
162# GCOV-based kernel profiling 166# GCOV-based kernel profiling
@@ -192,6 +196,7 @@ CONFIG_DEFAULT_CFQ=y
192# CONFIG_DEFAULT_NOOP is not set 196# CONFIG_DEFAULT_NOOP is not set
193CONFIG_DEFAULT_IOSCHED="cfq" 197CONFIG_DEFAULT_IOSCHED="cfq"
194# CONFIG_FREEZER is not set 198# CONFIG_FREEZER is not set
199CONFIG_PPC_MSI_BITMAP=y
195 200
196# 201#
197# Platform support 202# Platform support
@@ -206,9 +211,10 @@ CONFIG_MPC85xx_CDS=y
206CONFIG_MPC85xx_MDS=y 211CONFIG_MPC85xx_MDS=y
207CONFIG_MPC8536_DS=y 212CONFIG_MPC8536_DS=y
208CONFIG_MPC85xx_DS=y 213CONFIG_MPC85xx_DS=y
214CONFIG_MPC85xx_RDB=y
209CONFIG_SOCRATES=y 215CONFIG_SOCRATES=y
210CONFIG_KSI8560=y 216CONFIG_KSI8560=y
211# CONFIG_XES_MPC85xx is not set 217CONFIG_XES_MPC85xx=y
212CONFIG_STX_GP3=y 218CONFIG_STX_GP3=y
213CONFIG_TQM8540=y 219CONFIG_TQM8540=y
214CONFIG_TQM8541=y 220CONFIG_TQM8541=y
@@ -261,11 +267,11 @@ CONFIG_BINFMT_MISC=m
261CONFIG_MATH_EMULATION=y 267CONFIG_MATH_EMULATION=y
262CONFIG_IOMMU_HELPER=y 268CONFIG_IOMMU_HELPER=y
263CONFIG_SWIOTLB=y 269CONFIG_SWIOTLB=y
264CONFIG_PPC_NEED_DMA_SYNC_OPS=y
265CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y 270CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y
266CONFIG_ARCH_HAS_WALK_MEMORY=y 271CONFIG_ARCH_HAS_WALK_MEMORY=y
267CONFIG_ARCH_ENABLE_MEMORY_HOTREMOVE=y 272CONFIG_ARCH_ENABLE_MEMORY_HOTREMOVE=y
268# CONFIG_IRQ_ALL_CPUS is not set 273# CONFIG_IRQ_ALL_CPUS is not set
274CONFIG_MAX_ACTIVE_REGIONS=32
269CONFIG_ARCH_FLATMEM_ENABLE=y 275CONFIG_ARCH_FLATMEM_ENABLE=y
270CONFIG_ARCH_POPULATES_NODE_MAP=y 276CONFIG_ARCH_POPULATES_NODE_MAP=y
271CONFIG_SELECT_MEMORY_MODEL=y 277CONFIG_SELECT_MEMORY_MODEL=y
@@ -283,6 +289,7 @@ CONFIG_BOUNCE=y
283CONFIG_VIRT_TO_BUS=y 289CONFIG_VIRT_TO_BUS=y
284CONFIG_HAVE_MLOCK=y 290CONFIG_HAVE_MLOCK=y
285CONFIG_HAVE_MLOCKED_PAGE_BIT=y 291CONFIG_HAVE_MLOCKED_PAGE_BIT=y
292# CONFIG_KSM is not set
286CONFIG_DEFAULT_MMAP_MIN_ADDR=4096 293CONFIG_DEFAULT_MMAP_MIN_ADDR=4096
287CONFIG_PPC_4K_PAGES=y 294CONFIG_PPC_4K_PAGES=y
288# CONFIG_PPC_16K_PAGES is not set 295# CONFIG_PPC_16K_PAGES is not set
@@ -310,7 +317,7 @@ CONFIG_PCI_DOMAINS=y
310CONFIG_PCI_SYSCALL=y 317CONFIG_PCI_SYSCALL=y
311# CONFIG_PCIEPORTBUS is not set 318# CONFIG_PCIEPORTBUS is not set
312CONFIG_ARCH_SUPPORTS_MSI=y 319CONFIG_ARCH_SUPPORTS_MSI=y
313# CONFIG_PCI_MSI is not set 320CONFIG_PCI_MSI=y
314# CONFIG_PCI_LEGACY is not set 321# CONFIG_PCI_LEGACY is not set
315# CONFIG_PCI_DEBUG is not set 322# CONFIG_PCI_DEBUG is not set
316# CONFIG_PCI_STUB is not set 323# CONFIG_PCI_STUB is not set
@@ -318,7 +325,8 @@ CONFIG_ARCH_SUPPORTS_MSI=y
318# CONFIG_PCCARD is not set 325# CONFIG_PCCARD is not set
319# CONFIG_HOTPLUG_PCI is not set 326# CONFIG_HOTPLUG_PCI is not set
320CONFIG_HAS_RAPIDIO=y 327CONFIG_HAS_RAPIDIO=y
321# CONFIG_RAPIDIO is not set 328CONFIG_RAPIDIO=y
329CONFIG_RAPIDIO_DISC_TIMEOUT=30
322 330
323# 331#
324# Advanced setup 332# Advanced setup
@@ -348,7 +356,7 @@ CONFIG_XFRM_USER=y
348# CONFIG_XFRM_SUB_POLICY is not set 356# CONFIG_XFRM_SUB_POLICY is not set
349# CONFIG_XFRM_MIGRATE is not set 357# CONFIG_XFRM_MIGRATE is not set
350# CONFIG_XFRM_STATISTICS is not set 358# CONFIG_XFRM_STATISTICS is not set
351CONFIG_NET_KEY=m 359CONFIG_NET_KEY=y
352# CONFIG_NET_KEY_MIGRATE is not set 360# CONFIG_NET_KEY_MIGRATE is not set
353CONFIG_INET=y 361CONFIG_INET=y
354CONFIG_IP_MULTICAST=y 362CONFIG_IP_MULTICAST=y
@@ -372,12 +380,12 @@ CONFIG_IP_PIMSM_V2=y
372CONFIG_ARPD=y 380CONFIG_ARPD=y
373# CONFIG_SYN_COOKIES is not set 381# CONFIG_SYN_COOKIES is not set
374# CONFIG_INET_AH is not set 382# CONFIG_INET_AH is not set
375# CONFIG_INET_ESP is not set 383CONFIG_INET_ESP=y
376# CONFIG_INET_IPCOMP is not set 384# CONFIG_INET_IPCOMP is not set
377# CONFIG_INET_XFRM_TUNNEL is not set 385# CONFIG_INET_XFRM_TUNNEL is not set
378CONFIG_INET_TUNNEL=y 386CONFIG_INET_TUNNEL=y
379# CONFIG_INET_XFRM_MODE_TRANSPORT is not set 387CONFIG_INET_XFRM_MODE_TRANSPORT=y
380# CONFIG_INET_XFRM_MODE_TUNNEL is not set 388CONFIG_INET_XFRM_MODE_TUNNEL=y
381# CONFIG_INET_XFRM_MODE_BEET is not set 389# CONFIG_INET_XFRM_MODE_BEET is not set
382# CONFIG_INET_LRO is not set 390# CONFIG_INET_LRO is not set
383CONFIG_INET_DIAG=y 391CONFIG_INET_DIAG=y
@@ -414,6 +422,7 @@ CONFIG_IP_SCTP=m
414# CONFIG_SCTP_HMAC_NONE is not set 422# CONFIG_SCTP_HMAC_NONE is not set
415# CONFIG_SCTP_HMAC_SHA1 is not set 423# CONFIG_SCTP_HMAC_SHA1 is not set
416CONFIG_SCTP_HMAC_MD5=y 424CONFIG_SCTP_HMAC_MD5=y
425# CONFIG_RDS is not set
417# CONFIG_TIPC is not set 426# CONFIG_TIPC is not set
418# CONFIG_ATM is not set 427# CONFIG_ATM is not set
419# CONFIG_BRIDGE is not set 428# CONFIG_BRIDGE is not set
@@ -444,6 +453,7 @@ CONFIG_SCTP_HMAC_MD5=y
444CONFIG_FIB_RULES=y 453CONFIG_FIB_RULES=y
445CONFIG_WIRELESS=y 454CONFIG_WIRELESS=y
446# CONFIG_CFG80211 is not set 455# CONFIG_CFG80211 is not set
456CONFIG_CFG80211_DEFAULT_PS_VALUE=0
447CONFIG_WIRELESS_OLD_REGULATORY=y 457CONFIG_WIRELESS_OLD_REGULATORY=y
448# CONFIG_WIRELESS_EXT is not set 458# CONFIG_WIRELESS_EXT is not set
449# CONFIG_LIB80211 is not set 459# CONFIG_LIB80211 is not set
@@ -451,7 +461,6 @@ CONFIG_WIRELESS_OLD_REGULATORY=y
451# 461#
452# CFG80211 needs to be enabled for MAC80211 462# CFG80211 needs to be enabled for MAC80211
453# 463#
454CONFIG_MAC80211_DEFAULT_PS_VALUE=0
455# CONFIG_WIMAX is not set 464# CONFIG_WIMAX is not set
456# CONFIG_RFKILL is not set 465# CONFIG_RFKILL is not set
457# CONFIG_NET_9P is not set 466# CONFIG_NET_9P is not set
@@ -464,6 +473,7 @@ CONFIG_MAC80211_DEFAULT_PS_VALUE=0
464# Generic Driver Options 473# Generic Driver Options
465# 474#
466CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug" 475CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
476# CONFIG_DEVTMPFS is not set
467CONFIG_STANDALONE=y 477CONFIG_STANDALONE=y
468CONFIG_PREVENT_FIRMWARE_BUILD=y 478CONFIG_PREVENT_FIRMWARE_BUILD=y
469CONFIG_FW_LOADER=y 479CONFIG_FW_LOADER=y
@@ -557,6 +567,7 @@ CONFIG_SCSI_LOWLEVEL=y
557# CONFIG_ISCSI_TCP is not set 567# CONFIG_ISCSI_TCP is not set
558# CONFIG_SCSI_CXGB3_ISCSI is not set 568# CONFIG_SCSI_CXGB3_ISCSI is not set
559# CONFIG_SCSI_BNX2_ISCSI is not set 569# CONFIG_SCSI_BNX2_ISCSI is not set
570# CONFIG_BE2ISCSI is not set
560# CONFIG_BLK_DEV_3W_XXXX_RAID is not set 571# CONFIG_BLK_DEV_3W_XXXX_RAID is not set
561# CONFIG_SCSI_3W_9XXX is not set 572# CONFIG_SCSI_3W_9XXX is not set
562# CONFIG_SCSI_ACARD is not set 573# CONFIG_SCSI_ACARD is not set
@@ -596,11 +607,14 @@ CONFIG_SCSI_LOWLEVEL=y
596# CONFIG_SCSI_DC390T is not set 607# CONFIG_SCSI_DC390T is not set
597# CONFIG_SCSI_NSP32 is not set 608# CONFIG_SCSI_NSP32 is not set
598# CONFIG_SCSI_DEBUG is not set 609# CONFIG_SCSI_DEBUG is not set
610# CONFIG_SCSI_PMCRAID is not set
599# CONFIG_SCSI_SRP is not set 611# CONFIG_SCSI_SRP is not set
612# CONFIG_SCSI_BFA_FC is not set
600# CONFIG_SCSI_DH is not set 613# CONFIG_SCSI_DH is not set
601# CONFIG_SCSI_OSD_INITIATOR is not set 614# CONFIG_SCSI_OSD_INITIATOR is not set
602CONFIG_ATA=y 615CONFIG_ATA=y
603# CONFIG_ATA_NONSTANDARD is not set 616# CONFIG_ATA_NONSTANDARD is not set
617CONFIG_ATA_VERBOSE_ERROR=y
604CONFIG_SATA_PMP=y 618CONFIG_SATA_PMP=y
605CONFIG_SATA_AHCI=y 619CONFIG_SATA_AHCI=y
606# CONFIG_SATA_SIL24 is not set 620# CONFIG_SATA_SIL24 is not set
@@ -623,6 +637,7 @@ CONFIG_ATA_SFF=y
623CONFIG_PATA_ALI=y 637CONFIG_PATA_ALI=y
624# CONFIG_PATA_AMD is not set 638# CONFIG_PATA_AMD is not set
625# CONFIG_PATA_ARTOP is not set 639# CONFIG_PATA_ARTOP is not set
640# CONFIG_PATA_ATP867X is not set
626# CONFIG_PATA_ATIIXP is not set 641# CONFIG_PATA_ATIIXP is not set
627# CONFIG_PATA_CMD640_PCI is not set 642# CONFIG_PATA_CMD640_PCI is not set
628# CONFIG_PATA_CMD64X is not set 643# CONFIG_PATA_CMD64X is not set
@@ -650,6 +665,7 @@ CONFIG_PATA_ALI=y
650# CONFIG_PATA_OPTIDMA is not set 665# CONFIG_PATA_OPTIDMA is not set
651# CONFIG_PATA_PDC_OLD is not set 666# CONFIG_PATA_PDC_OLD is not set
652# CONFIG_PATA_RADISYS is not set 667# CONFIG_PATA_RADISYS is not set
668# CONFIG_PATA_RDC is not set
653# CONFIG_PATA_RZ1000 is not set 669# CONFIG_PATA_RZ1000 is not set
654# CONFIG_PATA_SC1200 is not set 670# CONFIG_PATA_SC1200 is not set
655# CONFIG_PATA_SERVERWORKS is not set 671# CONFIG_PATA_SERVERWORKS is not set
@@ -726,7 +742,9 @@ CONFIG_MII=y
726# CONFIG_NET_PCI is not set 742# CONFIG_NET_PCI is not set
727# CONFIG_B44 is not set 743# CONFIG_B44 is not set
728# CONFIG_KS8842 is not set 744# CONFIG_KS8842 is not set
745# CONFIG_KS8851_MLL is not set
729# CONFIG_ATL2 is not set 746# CONFIG_ATL2 is not set
747# CONFIG_XILINX_EMACLITE is not set
730CONFIG_FS_ENET=y 748CONFIG_FS_ENET=y
731CONFIG_FS_ENET_HAS_SCC=y 749CONFIG_FS_ENET_HAS_SCC=y
732CONFIG_FS_ENET_HAS_FCC=y 750CONFIG_FS_ENET_HAS_FCC=y
@@ -753,7 +771,6 @@ CONFIG_NETDEV_1000=y
753CONFIG_FSL_PQ_MDIO=y 771CONFIG_FSL_PQ_MDIO=y
754CONFIG_GIANFAR=y 772CONFIG_GIANFAR=y
755CONFIG_UCC_GETH=y 773CONFIG_UCC_GETH=y
756# CONFIG_UGETH_MAGIC_PACKET is not set
757# CONFIG_UGETH_TX_ON_DEMAND is not set 774# CONFIG_UGETH_TX_ON_DEMAND is not set
758# CONFIG_MV643XX_ETH is not set 775# CONFIG_MV643XX_ETH is not set
759# CONFIG_QLA3XXX is not set 776# CONFIG_QLA3XXX is not set
@@ -781,10 +798,7 @@ CONFIG_CHELSIO_T3_DEPENDS=y
781# CONFIG_SFC is not set 798# CONFIG_SFC is not set
782# CONFIG_BE2NET is not set 799# CONFIG_BE2NET is not set
783# CONFIG_TR is not set 800# CONFIG_TR is not set
784 801CONFIG_WLAN=y
785#
786# Wireless LAN
787#
788# CONFIG_WLAN_PRE80211 is not set 802# CONFIG_WLAN_PRE80211 is not set
789# CONFIG_WLAN_80211 is not set 803# CONFIG_WLAN_80211 is not set
790 804
@@ -801,6 +815,7 @@ CONFIG_CHELSIO_T3_DEPENDS=y
801# CONFIG_USB_RTL8150 is not set 815# CONFIG_USB_RTL8150 is not set
802# CONFIG_USB_USBNET is not set 816# CONFIG_USB_USBNET is not set
803# CONFIG_WAN is not set 817# CONFIG_WAN is not set
818# CONFIG_RIONET is not set
804# CONFIG_FDDI is not set 819# CONFIG_FDDI is not set
805# CONFIG_HIPPI is not set 820# CONFIG_HIPPI is not set
806# CONFIG_PPP is not set 821# CONFIG_PPP is not set
@@ -901,6 +916,7 @@ CONFIG_NVRAM=y
901CONFIG_DEVPORT=y 916CONFIG_DEVPORT=y
902CONFIG_I2C=y 917CONFIG_I2C=y
903CONFIG_I2C_BOARDINFO=y 918CONFIG_I2C_BOARDINFO=y
919CONFIG_I2C_COMPAT=y
904# CONFIG_I2C_CHARDEV is not set 920# CONFIG_I2C_CHARDEV is not set
905CONFIG_I2C_HELPER_AUTO=y 921CONFIG_I2C_HELPER_AUTO=y
906 922
@@ -958,9 +974,6 @@ CONFIG_I2C_MPC=y
958# Miscellaneous I2C Chip support 974# Miscellaneous I2C Chip support
959# 975#
960# CONFIG_DS1682 is not set 976# CONFIG_DS1682 is not set
961# CONFIG_SENSORS_PCF8574 is not set
962# CONFIG_PCF8575 is not set
963# CONFIG_SENSORS_PCA9539 is not set
964# CONFIG_SENSORS_TSL2550 is not set 977# CONFIG_SENSORS_TSL2550 is not set
965# CONFIG_I2C_DEBUG_CORE is not set 978# CONFIG_I2C_DEBUG_CORE is not set
966# CONFIG_I2C_DEBUG_ALGO is not set 979# CONFIG_I2C_DEBUG_ALGO is not set
@@ -994,15 +1007,19 @@ CONFIG_GPIOLIB=y
994# PCI GPIO expanders: 1007# PCI GPIO expanders:
995# 1008#
996# CONFIG_GPIO_BT8XX is not set 1009# CONFIG_GPIO_BT8XX is not set
1010# CONFIG_GPIO_LANGWELL is not set
997 1011
998# 1012#
999# SPI GPIO expanders: 1013# SPI GPIO expanders:
1000# 1014#
1015
1016#
1017# AC97 GPIO expanders:
1018#
1001# CONFIG_W1 is not set 1019# CONFIG_W1 is not set
1002# CONFIG_POWER_SUPPLY is not set 1020# CONFIG_POWER_SUPPLY is not set
1003# CONFIG_HWMON is not set 1021# CONFIG_HWMON is not set
1004# CONFIG_THERMAL is not set 1022# CONFIG_THERMAL is not set
1005# CONFIG_THERMAL_HWMON is not set
1006# CONFIG_WATCHDOG is not set 1023# CONFIG_WATCHDOG is not set
1007CONFIG_SSB_POSSIBLE=y 1024CONFIG_SSB_POSSIBLE=y
1008 1025
@@ -1023,6 +1040,7 @@ CONFIG_SSB_POSSIBLE=y
1023# CONFIG_MFD_TMIO is not set 1040# CONFIG_MFD_TMIO is not set
1024# CONFIG_PMIC_DA903X is not set 1041# CONFIG_PMIC_DA903X is not set
1025# CONFIG_MFD_WM8400 is not set 1042# CONFIG_MFD_WM8400 is not set
1043# CONFIG_MFD_WM831X is not set
1026# CONFIG_MFD_WM8350_I2C is not set 1044# CONFIG_MFD_WM8350_I2C is not set
1027# CONFIG_MFD_PCF50633 is not set 1045# CONFIG_MFD_PCF50633 is not set
1028# CONFIG_AB3100_CORE is not set 1046# CONFIG_AB3100_CORE is not set
@@ -1033,6 +1051,7 @@ CONFIG_SSB_POSSIBLE=y
1033# Graphics support 1051# Graphics support
1034# 1052#
1035# CONFIG_AGP is not set 1053# CONFIG_AGP is not set
1054CONFIG_VGA_ARB=y
1036# CONFIG_DRM is not set 1055# CONFIG_DRM is not set
1037# CONFIG_VGASTATE is not set 1056# CONFIG_VGASTATE is not set
1038CONFIG_VIDEO_OUTPUT_CONTROL=y 1057CONFIG_VIDEO_OUTPUT_CONTROL=y
@@ -1052,6 +1071,7 @@ CONFIG_VGA_CONSOLE=y
1052CONFIG_DUMMY_CONSOLE=y 1071CONFIG_DUMMY_CONSOLE=y
1053CONFIG_SOUND=y 1072CONFIG_SOUND=y
1054CONFIG_SOUND_OSS_CORE=y 1073CONFIG_SOUND_OSS_CORE=y
1074CONFIG_SOUND_OSS_CORE_PRECLAIM=y
1055CONFIG_SND=y 1075CONFIG_SND=y
1056CONFIG_SND_TIMER=y 1076CONFIG_SND_TIMER=y
1057CONFIG_SND_PCM=y 1077CONFIG_SND_PCM=y
@@ -1155,7 +1175,6 @@ CONFIG_SND_USB=y
1155CONFIG_AC97_BUS=y 1175CONFIG_AC97_BUS=y
1156CONFIG_HID_SUPPORT=y 1176CONFIG_HID_SUPPORT=y
1157CONFIG_HID=y 1177CONFIG_HID=y
1158# CONFIG_HID_DEBUG is not set
1159# CONFIG_HIDRAW is not set 1178# CONFIG_HIDRAW is not set
1160 1179
1161# 1180#
@@ -1178,6 +1197,7 @@ CONFIG_HID_CYPRESS=y
1178CONFIG_HID_EZKEY=y 1197CONFIG_HID_EZKEY=y
1179# CONFIG_HID_KYE is not set 1198# CONFIG_HID_KYE is not set
1180CONFIG_HID_GYRATION=y 1199CONFIG_HID_GYRATION=y
1200# CONFIG_HID_TWINHAN is not set
1181# CONFIG_HID_KENSINGTON is not set 1201# CONFIG_HID_KENSINGTON is not set
1182CONFIG_HID_LOGITECH=y 1202CONFIG_HID_LOGITECH=y
1183# CONFIG_LOGITECH_FF is not set 1203# CONFIG_LOGITECH_FF is not set
@@ -1230,6 +1250,7 @@ CONFIG_USB_EHCI_HCD_PPC_OF=y
1230# CONFIG_USB_OXU210HP_HCD is not set 1250# CONFIG_USB_OXU210HP_HCD is not set
1231# CONFIG_USB_ISP116X_HCD is not set 1251# CONFIG_USB_ISP116X_HCD is not set
1232# CONFIG_USB_ISP1760_HCD is not set 1252# CONFIG_USB_ISP1760_HCD is not set
1253# CONFIG_USB_ISP1362_HCD is not set
1233CONFIG_USB_OHCI_HCD=y 1254CONFIG_USB_OHCI_HCD=y
1234CONFIG_USB_OHCI_HCD_PPC_OF_BE=y 1255CONFIG_USB_OHCI_HCD_PPC_OF_BE=y
1235CONFIG_USB_OHCI_HCD_PPC_OF_LE=y 1256CONFIG_USB_OHCI_HCD_PPC_OF_LE=y
@@ -1244,7 +1265,6 @@ CONFIG_USB_OHCI_LITTLE_ENDIAN=y
1244# CONFIG_USB_R8A66597_HCD is not set 1265# CONFIG_USB_R8A66597_HCD is not set
1245# CONFIG_USB_WHCI_HCD is not set 1266# CONFIG_USB_WHCI_HCD is not set
1246# CONFIG_USB_HWA_HCD is not set 1267# CONFIG_USB_HWA_HCD is not set
1247# CONFIG_USB_MUSB_HDRC is not set
1248 1268
1249# 1269#
1250# USB Device Class drivers 1270# USB Device Class drivers
@@ -1432,6 +1452,7 @@ CONFIG_FS_MBCACHE=y
1432# CONFIG_GFS2_FS is not set 1452# CONFIG_GFS2_FS is not set
1433# CONFIG_OCFS2_FS is not set 1453# CONFIG_OCFS2_FS is not set
1434# CONFIG_BTRFS_FS is not set 1454# CONFIG_BTRFS_FS is not set
1455# CONFIG_NILFS2_FS is not set
1435CONFIG_FILE_LOCKING=y 1456CONFIG_FILE_LOCKING=y
1436CONFIG_FSNOTIFY=y 1457CONFIG_FSNOTIFY=y
1437CONFIG_DNOTIFY=y 1458CONFIG_DNOTIFY=y
@@ -1502,7 +1523,6 @@ CONFIG_SYSV_FS=m
1502CONFIG_UFS_FS=m 1523CONFIG_UFS_FS=m
1503# CONFIG_UFS_FS_WRITE is not set 1524# CONFIG_UFS_FS_WRITE is not set
1504# CONFIG_UFS_DEBUG is not set 1525# CONFIG_UFS_DEBUG is not set
1505# CONFIG_NILFS2_FS is not set
1506CONFIG_NETWORK_FILESYSTEMS=y 1526CONFIG_NETWORK_FILESYSTEMS=y
1507CONFIG_NFS_FS=y 1527CONFIG_NFS_FS=y
1508CONFIG_NFS_V3=y 1528CONFIG_NFS_V3=y
@@ -1623,6 +1643,7 @@ CONFIG_ENABLE_WARN_DEPRECATED=y
1623CONFIG_ENABLE_MUST_CHECK=y 1643CONFIG_ENABLE_MUST_CHECK=y
1624CONFIG_FRAME_WARN=1024 1644CONFIG_FRAME_WARN=1024
1625# CONFIG_MAGIC_SYSRQ is not set 1645# CONFIG_MAGIC_SYSRQ is not set
1646# CONFIG_STRIP_ASM_SYMS is not set
1626# CONFIG_UNUSED_SYMBOLS is not set 1647# CONFIG_UNUSED_SYMBOLS is not set
1627CONFIG_DEBUG_FS=y 1648CONFIG_DEBUG_FS=y
1628# CONFIG_HEADERS_CHECK is not set 1649# CONFIG_HEADERS_CHECK is not set
@@ -1640,6 +1661,7 @@ CONFIG_SCHED_DEBUG=y
1640# CONFIG_DEBUG_OBJECTS is not set 1661# CONFIG_DEBUG_OBJECTS is not set
1641# CONFIG_SLUB_DEBUG_ON is not set 1662# CONFIG_SLUB_DEBUG_ON is not set
1642# CONFIG_SLUB_STATS is not set 1663# CONFIG_SLUB_STATS is not set
1664# CONFIG_DEBUG_KMEMLEAK is not set
1643# CONFIG_DEBUG_RT_MUTEXES is not set 1665# CONFIG_DEBUG_RT_MUTEXES is not set
1644# CONFIG_RT_MUTEX_TESTER is not set 1666# CONFIG_RT_MUTEX_TESTER is not set
1645# CONFIG_DEBUG_SPINLOCK is not set 1667# CONFIG_DEBUG_SPINLOCK is not set
@@ -1659,10 +1681,12 @@ CONFIG_DEBUG_INFO=y
1659# CONFIG_DEBUG_LIST is not set 1681# CONFIG_DEBUG_LIST is not set
1660# CONFIG_DEBUG_SG is not set 1682# CONFIG_DEBUG_SG is not set
1661# CONFIG_DEBUG_NOTIFIERS is not set 1683# CONFIG_DEBUG_NOTIFIERS is not set
1684# CONFIG_DEBUG_CREDENTIALS is not set
1662# CONFIG_RCU_TORTURE_TEST is not set 1685# CONFIG_RCU_TORTURE_TEST is not set
1663# CONFIG_RCU_CPU_STALL_DETECTOR is not set 1686# CONFIG_RCU_CPU_STALL_DETECTOR is not set
1664# CONFIG_BACKTRACE_SELF_TEST is not set 1687# CONFIG_BACKTRACE_SELF_TEST is not set
1665# CONFIG_DEBUG_BLOCK_EXT_DEVT is not set 1688# CONFIG_DEBUG_BLOCK_EXT_DEVT is not set
1689# CONFIG_DEBUG_FORCE_WEAK_PER_CPU is not set
1666# CONFIG_FAULT_INJECTION is not set 1690# CONFIG_FAULT_INJECTION is not set
1667# CONFIG_LATENCYTOP is not set 1691# CONFIG_LATENCYTOP is not set
1668CONFIG_SYSCTL_SYSCALL_CHECK=y 1692CONFIG_SYSCTL_SYSCALL_CHECK=y
@@ -1686,10 +1710,10 @@ CONFIG_BRANCH_PROFILE_NONE=y
1686# CONFIG_WORKQUEUE_TRACER is not set 1710# CONFIG_WORKQUEUE_TRACER is not set
1687# CONFIG_BLK_DEV_IO_TRACE is not set 1711# CONFIG_BLK_DEV_IO_TRACE is not set
1688# CONFIG_DYNAMIC_DEBUG is not set 1712# CONFIG_DYNAMIC_DEBUG is not set
1713# CONFIG_DMA_API_DEBUG is not set
1689# CONFIG_SAMPLES is not set 1714# CONFIG_SAMPLES is not set
1690CONFIG_HAVE_ARCH_KGDB=y 1715CONFIG_HAVE_ARCH_KGDB=y
1691# CONFIG_KGDB is not set 1716# CONFIG_KGDB is not set
1692# CONFIG_KMEMCHECK is not set
1693# CONFIG_PPC_DISABLE_WERROR is not set 1717# CONFIG_PPC_DISABLE_WERROR is not set
1694CONFIG_PPC_WERROR=y 1718CONFIG_PPC_WERROR=y
1695CONFIG_PRINT_STACK_DEPTH=64 1719CONFIG_PRINT_STACK_DEPTH=64
@@ -1717,7 +1741,6 @@ CONFIG_CRYPTO=y
1717# 1741#
1718# Crypto core or helper 1742# Crypto core or helper
1719# 1743#
1720# CONFIG_CRYPTO_FIPS is not set
1721CONFIG_CRYPTO_ALGAPI=y 1744CONFIG_CRYPTO_ALGAPI=y
1722CONFIG_CRYPTO_ALGAPI2=y 1745CONFIG_CRYPTO_ALGAPI2=y
1723CONFIG_CRYPTO_AEAD=y 1746CONFIG_CRYPTO_AEAD=y
@@ -1760,11 +1783,13 @@ CONFIG_CRYPTO_PCBC=m
1760# 1783#
1761CONFIG_CRYPTO_HMAC=y 1784CONFIG_CRYPTO_HMAC=y
1762# CONFIG_CRYPTO_XCBC is not set 1785# CONFIG_CRYPTO_XCBC is not set
1786# CONFIG_CRYPTO_VMAC is not set
1763 1787
1764# 1788#
1765# Digest 1789# Digest
1766# 1790#
1767CONFIG_CRYPTO_CRC32C=m 1791CONFIG_CRYPTO_CRC32C=m
1792# CONFIG_CRYPTO_GHASH is not set
1768# CONFIG_CRYPTO_MD4 is not set 1793# CONFIG_CRYPTO_MD4 is not set
1769CONFIG_CRYPTO_MD5=y 1794CONFIG_CRYPTO_MD5=y
1770# CONFIG_CRYPTO_MICHAEL_MIC is not set 1795# CONFIG_CRYPTO_MICHAEL_MIC is not set
@@ -1772,16 +1797,16 @@ CONFIG_CRYPTO_MD5=y
1772# CONFIG_CRYPTO_RMD160 is not set 1797# CONFIG_CRYPTO_RMD160 is not set
1773# CONFIG_CRYPTO_RMD256 is not set 1798# CONFIG_CRYPTO_RMD256 is not set
1774# CONFIG_CRYPTO_RMD320 is not set 1799# CONFIG_CRYPTO_RMD320 is not set
1775CONFIG_CRYPTO_SHA1=m 1800CONFIG_CRYPTO_SHA1=y
1776# CONFIG_CRYPTO_SHA256 is not set 1801CONFIG_CRYPTO_SHA256=y
1777# CONFIG_CRYPTO_SHA512 is not set 1802CONFIG_CRYPTO_SHA512=y
1778# CONFIG_CRYPTO_TGR192 is not set 1803# CONFIG_CRYPTO_TGR192 is not set
1779# CONFIG_CRYPTO_WP512 is not set 1804# CONFIG_CRYPTO_WP512 is not set
1780 1805
1781# 1806#
1782# Ciphers 1807# Ciphers
1783# 1808#
1784# CONFIG_CRYPTO_AES is not set 1809CONFIG_CRYPTO_AES=y
1785# CONFIG_CRYPTO_ANUBIS is not set 1810# CONFIG_CRYPTO_ANUBIS is not set
1786# CONFIG_CRYPTO_ARC4 is not set 1811# CONFIG_CRYPTO_ARC4 is not set
1787# CONFIG_CRYPTO_BLOWFISH is not set 1812# CONFIG_CRYPTO_BLOWFISH is not set
diff --git a/arch/powerpc/configs/mpc866_ads_defconfig b/arch/powerpc/configs/mpc866_ads_defconfig
index 6809b61ed3de..40d6f0568ca5 100644
--- a/arch/powerpc/configs/mpc866_ads_defconfig
+++ b/arch/powerpc/configs/mpc866_ads_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.31-rc4 3# Linux kernel version: 2.6.32-rc5
4# Wed Jul 29 23:31:57 2009 4# Thu Nov 5 08:20:15 2009
5# 5#
6# CONFIG_PPC64 is not set 6# CONFIG_PPC64 is not set
7 7
@@ -16,6 +16,7 @@ CONFIG_PPC_8xx=y
16# CONFIG_E200 is not set 16# CONFIG_E200 is not set
17CONFIG_8xx=y 17CONFIG_8xx=y
18CONFIG_PPC_MMU_NOHASH=y 18CONFIG_PPC_MMU_NOHASH=y
19CONFIG_PPC_MMU_NOHASH_32=y
19# CONFIG_PPC_MM_SLICES is not set 20# CONFIG_PPC_MM_SLICES is not set
20CONFIG_NOT_COHERENT_CACHE=y 21CONFIG_NOT_COHERENT_CACHE=y
21CONFIG_PPC32=y 22CONFIG_PPC32=y
@@ -29,6 +30,7 @@ CONFIG_GENERIC_CLOCKEVENTS=y
29CONFIG_GENERIC_HARDIRQS=y 30CONFIG_GENERIC_HARDIRQS=y
30CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y 31CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y
31# CONFIG_HAVE_SETUP_PER_CPU_AREA is not set 32# CONFIG_HAVE_SETUP_PER_CPU_AREA is not set
33# CONFIG_NEED_PER_CPU_EMBED_FIRST_CHUNK is not set
32CONFIG_IRQ_PER_CPU=y 34CONFIG_IRQ_PER_CPU=y
33CONFIG_STACKTRACE_SUPPORT=y 35CONFIG_STACKTRACE_SUPPORT=y
34CONFIG_HAVE_LATENCYTOP_SUPPORT=y 36CONFIG_HAVE_LATENCYTOP_SUPPORT=y
@@ -76,11 +78,12 @@ CONFIG_SYSVIPC_SYSCTL=y
76# 78#
77# RCU Subsystem 79# RCU Subsystem
78# 80#
79CONFIG_CLASSIC_RCU=y 81CONFIG_TREE_RCU=y
80# CONFIG_TREE_RCU is not set 82# CONFIG_TREE_PREEMPT_RCU is not set
81# CONFIG_PREEMPT_RCU is not set 83# CONFIG_RCU_TRACE is not set
84CONFIG_RCU_FANOUT=32
85# CONFIG_RCU_FANOUT_EXACT is not set
82# CONFIG_TREE_RCU_TRACE is not set 86# CONFIG_TREE_RCU_TRACE is not set
83# CONFIG_PREEMPT_RCU_TRACE is not set
84# CONFIG_IKCONFIG is not set 87# CONFIG_IKCONFIG is not set
85CONFIG_LOG_BUF_SHIFT=14 88CONFIG_LOG_BUF_SHIFT=14
86CONFIG_GROUP_SCHED=y 89CONFIG_GROUP_SCHED=y
@@ -113,28 +116,29 @@ CONFIG_TIMERFD=y
113CONFIG_EVENTFD=y 116CONFIG_EVENTFD=y
114CONFIG_SHMEM=y 117CONFIG_SHMEM=y
115CONFIG_AIO=y 118CONFIG_AIO=y
116CONFIG_HAVE_PERF_COUNTERS=y 119CONFIG_HAVE_PERF_EVENTS=y
117 120
118# 121#
119# Performance Counters 122# Kernel Performance Events And Counters
120# 123#
124# CONFIG_PERF_EVENTS is not set
121# CONFIG_PERF_COUNTERS is not set 125# CONFIG_PERF_COUNTERS is not set
122# CONFIG_VM_EVENT_COUNTERS is not set 126# CONFIG_VM_EVENT_COUNTERS is not set
123CONFIG_SLUB_DEBUG=y 127CONFIG_SLUB_DEBUG=y
124# CONFIG_STRIP_ASM_SYMS is not set
125CONFIG_COMPAT_BRK=y 128CONFIG_COMPAT_BRK=y
126# CONFIG_SLAB is not set 129# CONFIG_SLAB is not set
127CONFIG_SLUB=y 130CONFIG_SLUB=y
128# CONFIG_SLOB is not set 131# CONFIG_SLOB is not set
129# CONFIG_PROFILING is not set 132# CONFIG_PROFILING is not set
130# CONFIG_MARKERS is not set
131CONFIG_HAVE_OPROFILE=y 133CONFIG_HAVE_OPROFILE=y
132CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS=y 134CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS=y
133CONFIG_HAVE_IOREMAP_PROT=y 135CONFIG_HAVE_IOREMAP_PROT=y
134CONFIG_HAVE_KPROBES=y 136CONFIG_HAVE_KPROBES=y
135CONFIG_HAVE_KRETPROBES=y 137CONFIG_HAVE_KRETPROBES=y
136CONFIG_HAVE_ARCH_TRACEHOOK=y 138CONFIG_HAVE_ARCH_TRACEHOOK=y
139CONFIG_HAVE_DMA_ATTRS=y
137CONFIG_HAVE_CLK=y 140CONFIG_HAVE_CLK=y
141CONFIG_HAVE_DMA_API_DEBUG=y
138 142
139# 143#
140# GCOV-based kernel profiling 144# GCOV-based kernel profiling
@@ -233,10 +237,10 @@ CONFIG_BINFMT_ELF=y
233CONFIG_MATH_EMULATION=y 237CONFIG_MATH_EMULATION=y
234# CONFIG_IOMMU_HELPER is not set 238# CONFIG_IOMMU_HELPER is not set
235# CONFIG_SWIOTLB is not set 239# CONFIG_SWIOTLB is not set
236CONFIG_PPC_NEED_DMA_SYNC_OPS=y
237CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y 240CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y
238CONFIG_ARCH_HAS_WALK_MEMORY=y 241CONFIG_ARCH_HAS_WALK_MEMORY=y
239CONFIG_ARCH_ENABLE_MEMORY_HOTREMOVE=y 242CONFIG_ARCH_ENABLE_MEMORY_HOTREMOVE=y
243CONFIG_MAX_ACTIVE_REGIONS=32
240CONFIG_ARCH_FLATMEM_ENABLE=y 244CONFIG_ARCH_FLATMEM_ENABLE=y
241CONFIG_ARCH_POPULATES_NODE_MAP=y 245CONFIG_ARCH_POPULATES_NODE_MAP=y
242CONFIG_SELECT_MEMORY_MODEL=y 246CONFIG_SELECT_MEMORY_MODEL=y
@@ -254,6 +258,7 @@ CONFIG_BOUNCE=y
254CONFIG_VIRT_TO_BUS=y 258CONFIG_VIRT_TO_BUS=y
255CONFIG_HAVE_MLOCK=y 259CONFIG_HAVE_MLOCK=y
256CONFIG_HAVE_MLOCKED_PAGE_BIT=y 260CONFIG_HAVE_MLOCKED_PAGE_BIT=y
261# CONFIG_KSM is not set
257CONFIG_DEFAULT_MMAP_MIN_ADDR=4096 262CONFIG_DEFAULT_MMAP_MIN_ADDR=4096
258CONFIG_PPC_4K_PAGES=y 263CONFIG_PPC_4K_PAGES=y
259# CONFIG_PPC_16K_PAGES is not set 264# CONFIG_PPC_16K_PAGES is not set
@@ -340,6 +345,7 @@ CONFIG_DEFAULT_TCP_CONG="cubic"
340# CONFIG_NETFILTER is not set 345# CONFIG_NETFILTER is not set
341# CONFIG_IP_DCCP is not set 346# CONFIG_IP_DCCP is not set
342# CONFIG_IP_SCTP is not set 347# CONFIG_IP_SCTP is not set
348# CONFIG_RDS is not set
343# CONFIG_TIPC is not set 349# CONFIG_TIPC is not set
344# CONFIG_ATM is not set 350# CONFIG_ATM is not set
345# CONFIG_BRIDGE is not set 351# CONFIG_BRIDGE is not set
@@ -369,6 +375,7 @@ CONFIG_DEFAULT_TCP_CONG="cubic"
369# CONFIG_AF_RXRPC is not set 375# CONFIG_AF_RXRPC is not set
370CONFIG_WIRELESS=y 376CONFIG_WIRELESS=y
371# CONFIG_CFG80211 is not set 377# CONFIG_CFG80211 is not set
378CONFIG_CFG80211_DEFAULT_PS_VALUE=0
372CONFIG_WIRELESS_OLD_REGULATORY=y 379CONFIG_WIRELESS_OLD_REGULATORY=y
373# CONFIG_WIRELESS_EXT is not set 380# CONFIG_WIRELESS_EXT is not set
374# CONFIG_LIB80211 is not set 381# CONFIG_LIB80211 is not set
@@ -376,7 +383,6 @@ CONFIG_WIRELESS_OLD_REGULATORY=y
376# 383#
377# CFG80211 needs to be enabled for MAC80211 384# CFG80211 needs to be enabled for MAC80211
378# 385#
379CONFIG_MAC80211_DEFAULT_PS_VALUE=0
380# CONFIG_WIMAX is not set 386# CONFIG_WIMAX is not set
381# CONFIG_RFKILL is not set 387# CONFIG_RFKILL is not set
382# CONFIG_NET_9P is not set 388# CONFIG_NET_9P is not set
@@ -467,6 +473,8 @@ CONFIG_MII=y
467# CONFIG_IBM_NEW_EMAC_MAL_COMMON_ERR is not set 473# CONFIG_IBM_NEW_EMAC_MAL_COMMON_ERR is not set
468# CONFIG_B44 is not set 474# CONFIG_B44 is not set
469# CONFIG_KS8842 is not set 475# CONFIG_KS8842 is not set
476# CONFIG_KS8851_MLL is not set
477# CONFIG_XILINX_EMACLITE is not set
470CONFIG_FS_ENET=y 478CONFIG_FS_ENET=y
471CONFIG_FS_ENET_HAS_SCC=y 479CONFIG_FS_ENET_HAS_SCC=y
472CONFIG_FS_ENET_HAS_FEC=y 480CONFIG_FS_ENET_HAS_FEC=y
@@ -476,10 +484,7 @@ CONFIG_NETDEV_1000=y
476# CONFIG_GIANFAR is not set 484# CONFIG_GIANFAR is not set
477# CONFIG_MV643XX_ETH is not set 485# CONFIG_MV643XX_ETH is not set
478CONFIG_NETDEV_10000=y 486CONFIG_NETDEV_10000=y
479 487CONFIG_WLAN=y
480#
481# Wireless LAN
482#
483# CONFIG_WLAN_PRE80211 is not set 488# CONFIG_WLAN_PRE80211 is not set
484# CONFIG_WLAN_80211 is not set 489# CONFIG_WLAN_80211 is not set
485 490
@@ -520,6 +525,7 @@ CONFIG_INPUT_KEYBOARD=y
520CONFIG_KEYBOARD_ATKBD=y 525CONFIG_KEYBOARD_ATKBD=y
521# CONFIG_KEYBOARD_LKKBD is not set 526# CONFIG_KEYBOARD_LKKBD is not set
522# CONFIG_KEYBOARD_NEWTON is not set 527# CONFIG_KEYBOARD_NEWTON is not set
528# CONFIG_KEYBOARD_OPENCORES is not set
523# CONFIG_KEYBOARD_STOWAWAY is not set 529# CONFIG_KEYBOARD_STOWAWAY is not set
524# CONFIG_KEYBOARD_SUNKBD is not set 530# CONFIG_KEYBOARD_SUNKBD is not set
525# CONFIG_KEYBOARD_XTKBD is not set 531# CONFIG_KEYBOARD_XTKBD is not set
@@ -530,6 +536,7 @@ CONFIG_MOUSE_PS2_LOGIPS2PP=y
530CONFIG_MOUSE_PS2_SYNAPTICS=y 536CONFIG_MOUSE_PS2_SYNAPTICS=y
531CONFIG_MOUSE_PS2_TRACKPOINT=y 537CONFIG_MOUSE_PS2_TRACKPOINT=y
532# CONFIG_MOUSE_PS2_ELANTECH is not set 538# CONFIG_MOUSE_PS2_ELANTECH is not set
539# CONFIG_MOUSE_PS2_SENTELIC is not set
533# CONFIG_MOUSE_PS2_TOUCHKIT is not set 540# CONFIG_MOUSE_PS2_TOUCHKIT is not set
534# CONFIG_MOUSE_SERIAL is not set 541# CONFIG_MOUSE_SERIAL is not set
535# CONFIG_MOUSE_VSXXXAA is not set 542# CONFIG_MOUSE_VSXXXAA is not set
@@ -595,6 +602,11 @@ CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y
595# CONFIG_POWER_SUPPLY is not set 602# CONFIG_POWER_SUPPLY is not set
596CONFIG_HWMON=y 603CONFIG_HWMON=y
597# CONFIG_HWMON_VID is not set 604# CONFIG_HWMON_VID is not set
605# CONFIG_HWMON_DEBUG_CHIP is not set
606
607#
608# Native drivers
609#
598# CONFIG_SENSORS_F71805F is not set 610# CONFIG_SENSORS_F71805F is not set
599# CONFIG_SENSORS_F71882FG is not set 611# CONFIG_SENSORS_F71882FG is not set
600# CONFIG_SENSORS_IT87 is not set 612# CONFIG_SENSORS_IT87 is not set
@@ -605,9 +617,7 @@ CONFIG_HWMON=y
605# CONFIG_SENSORS_VT1211 is not set 617# CONFIG_SENSORS_VT1211 is not set
606# CONFIG_SENSORS_W83627HF is not set 618# CONFIG_SENSORS_W83627HF is not set
607# CONFIG_SENSORS_W83627EHF is not set 619# CONFIG_SENSORS_W83627EHF is not set
608# CONFIG_HWMON_DEBUG_CHIP is not set
609# CONFIG_THERMAL is not set 620# CONFIG_THERMAL is not set
610# CONFIG_THERMAL_HWMON is not set
611# CONFIG_WATCHDOG is not set 621# CONFIG_WATCHDOG is not set
612CONFIG_SSB_POSSIBLE=y 622CONFIG_SSB_POSSIBLE=y
613 623
@@ -641,7 +651,6 @@ CONFIG_VIDEO_OUTPUT_CONTROL=y
641# CONFIG_SOUND is not set 651# CONFIG_SOUND is not set
642CONFIG_HID_SUPPORT=y 652CONFIG_HID_SUPPORT=y
643CONFIG_HID=y 653CONFIG_HID=y
644# CONFIG_HID_DEBUG is not set
645# CONFIG_HIDRAW is not set 654# CONFIG_HIDRAW is not set
646# CONFIG_HID_PID is not set 655# CONFIG_HID_PID is not set
647 656
@@ -705,6 +714,7 @@ CONFIG_FS_MBCACHE=y
705# CONFIG_GFS2_FS is not set 714# CONFIG_GFS2_FS is not set
706# CONFIG_OCFS2_FS is not set 715# CONFIG_OCFS2_FS is not set
707# CONFIG_BTRFS_FS is not set 716# CONFIG_BTRFS_FS is not set
717# CONFIG_NILFS2_FS is not set
708CONFIG_FILE_LOCKING=y 718CONFIG_FILE_LOCKING=y
709CONFIG_FSNOTIFY=y 719CONFIG_FSNOTIFY=y
710CONFIG_DNOTIFY=y 720CONFIG_DNOTIFY=y
@@ -763,7 +773,6 @@ CONFIG_CRAMFS=y
763# CONFIG_ROMFS_FS is not set 773# CONFIG_ROMFS_FS is not set
764# CONFIG_SYSV_FS is not set 774# CONFIG_SYSV_FS is not set
765# CONFIG_UFS_FS is not set 775# CONFIG_UFS_FS is not set
766# CONFIG_NILFS2_FS is not set
767CONFIG_NETWORK_FILESYSTEMS=y 776CONFIG_NETWORK_FILESYSTEMS=y
768CONFIG_NFS_FS=y 777CONFIG_NFS_FS=y
769CONFIG_NFS_V3=y 778CONFIG_NFS_V3=y
@@ -836,6 +845,7 @@ CONFIG_ENABLE_WARN_DEPRECATED=y
836CONFIG_ENABLE_MUST_CHECK=y 845CONFIG_ENABLE_MUST_CHECK=y
837CONFIG_FRAME_WARN=1024 846CONFIG_FRAME_WARN=1024
838# CONFIG_MAGIC_SYSRQ is not set 847# CONFIG_MAGIC_SYSRQ is not set
848# CONFIG_STRIP_ASM_SYMS is not set
839# CONFIG_UNUSED_SYMBOLS is not set 849# CONFIG_UNUSED_SYMBOLS is not set
840# CONFIG_DEBUG_FS is not set 850# CONFIG_DEBUG_FS is not set
841# CONFIG_HEADERS_CHECK is not set 851# CONFIG_HEADERS_CHECK is not set
@@ -851,6 +861,7 @@ CONFIG_HAVE_DYNAMIC_FTRACE=y
851CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y 861CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y
852CONFIG_TRACING_SUPPORT=y 862CONFIG_TRACING_SUPPORT=y
853# CONFIG_FTRACE is not set 863# CONFIG_FTRACE is not set
864# CONFIG_DMA_API_DEBUG is not set
854# CONFIG_SAMPLES is not set 865# CONFIG_SAMPLES is not set
855CONFIG_HAVE_ARCH_KGDB=y 866CONFIG_HAVE_ARCH_KGDB=y
856# CONFIG_PPC_DISABLE_WERROR is not set 867# CONFIG_PPC_DISABLE_WERROR is not set
@@ -871,7 +882,6 @@ CONFIG_CRYPTO=y
871# 882#
872# Crypto core or helper 883# Crypto core or helper
873# 884#
874# CONFIG_CRYPTO_FIPS is not set
875# CONFIG_CRYPTO_MANAGER is not set 885# CONFIG_CRYPTO_MANAGER is not set
876# CONFIG_CRYPTO_MANAGER2 is not set 886# CONFIG_CRYPTO_MANAGER2 is not set
877# CONFIG_CRYPTO_GF128MUL is not set 887# CONFIG_CRYPTO_GF128MUL is not set
@@ -902,11 +912,13 @@ CONFIG_CRYPTO=y
902# 912#
903# CONFIG_CRYPTO_HMAC is not set 913# CONFIG_CRYPTO_HMAC is not set
904# CONFIG_CRYPTO_XCBC is not set 914# CONFIG_CRYPTO_XCBC is not set
915# CONFIG_CRYPTO_VMAC is not set
905 916
906# 917#
907# Digest 918# Digest
908# 919#
909# CONFIG_CRYPTO_CRC32C is not set 920# CONFIG_CRYPTO_CRC32C is not set
921# CONFIG_CRYPTO_GHASH is not set
910# CONFIG_CRYPTO_MD4 is not set 922# CONFIG_CRYPTO_MD4 is not set
911# CONFIG_CRYPTO_MD5 is not set 923# CONFIG_CRYPTO_MD5 is not set
912# CONFIG_CRYPTO_MICHAEL_MIC is not set 924# CONFIG_CRYPTO_MICHAEL_MIC is not set
diff --git a/arch/powerpc/configs/mpc86xx_defconfig b/arch/powerpc/configs/mpc86xx_defconfig
index 0e8684a3138d..5b3abb42ae30 100644
--- a/arch/powerpc/configs/mpc86xx_defconfig
+++ b/arch/powerpc/configs/mpc86xx_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.31-rc4 3# Linux kernel version: 2.6.32-rc5
4# Wed Jul 29 23:31:58 2009 4# Thu Nov 5 08:20:16 2009
5# 5#
6# CONFIG_PPC64 is not set 6# CONFIG_PPC64 is not set
7 7
@@ -36,6 +36,7 @@ CONFIG_GENERIC_CLOCKEVENTS=y
36CONFIG_GENERIC_HARDIRQS=y 36CONFIG_GENERIC_HARDIRQS=y
37CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y 37CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y
38# CONFIG_HAVE_SETUP_PER_CPU_AREA is not set 38# CONFIG_HAVE_SETUP_PER_CPU_AREA is not set
39# CONFIG_NEED_PER_CPU_EMBED_FIRST_CHUNK 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
@@ -88,11 +89,12 @@ CONFIG_AUDIT=y
88# 89#
89# RCU Subsystem 90# RCU Subsystem
90# 91#
91CONFIG_CLASSIC_RCU=y 92CONFIG_TREE_RCU=y
92# CONFIG_TREE_RCU is not set 93# CONFIG_TREE_PREEMPT_RCU is not set
93# CONFIG_PREEMPT_RCU is not set 94# CONFIG_RCU_TRACE is not set
95CONFIG_RCU_FANOUT=32
96# CONFIG_RCU_FANOUT_EXACT is not set
94# CONFIG_TREE_RCU_TRACE is not set 97# CONFIG_TREE_RCU_TRACE is not set
95# CONFIG_PREEMPT_RCU_TRACE is not set
96CONFIG_IKCONFIG=y 98CONFIG_IKCONFIG=y
97CONFIG_IKCONFIG_PROC=y 99CONFIG_IKCONFIG_PROC=y
98CONFIG_LOG_BUF_SHIFT=14 100CONFIG_LOG_BUF_SHIFT=14
@@ -131,22 +133,21 @@ CONFIG_TIMERFD=y
131CONFIG_EVENTFD=y 133CONFIG_EVENTFD=y
132CONFIG_SHMEM=y 134CONFIG_SHMEM=y
133CONFIG_AIO=y 135CONFIG_AIO=y
134CONFIG_HAVE_PERF_COUNTERS=y 136CONFIG_HAVE_PERF_EVENTS=y
135 137
136# 138#
137# Performance Counters 139# Kernel Performance Events And Counters
138# 140#
141# CONFIG_PERF_EVENTS is not set
139# CONFIG_PERF_COUNTERS is not set 142# CONFIG_PERF_COUNTERS is not set
140CONFIG_VM_EVENT_COUNTERS=y 143CONFIG_VM_EVENT_COUNTERS=y
141CONFIG_PCI_QUIRKS=y 144CONFIG_PCI_QUIRKS=y
142CONFIG_SLUB_DEBUG=y 145CONFIG_SLUB_DEBUG=y
143# CONFIG_STRIP_ASM_SYMS is not set
144CONFIG_COMPAT_BRK=y 146CONFIG_COMPAT_BRK=y
145# CONFIG_SLAB is not set 147# CONFIG_SLAB is not set
146CONFIG_SLUB=y 148CONFIG_SLUB=y
147# CONFIG_SLOB is not set 149# CONFIG_SLOB is not set
148# CONFIG_PROFILING is not set 150# CONFIG_PROFILING is not set
149# CONFIG_MARKERS is not set
150CONFIG_HAVE_OPROFILE=y 151CONFIG_HAVE_OPROFILE=y
151# CONFIG_KPROBES is not set 152# CONFIG_KPROBES is not set
152CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS=y 153CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS=y
@@ -154,7 +155,9 @@ CONFIG_HAVE_IOREMAP_PROT=y
154CONFIG_HAVE_KPROBES=y 155CONFIG_HAVE_KPROBES=y
155CONFIG_HAVE_KRETPROBES=y 156CONFIG_HAVE_KRETPROBES=y
156CONFIG_HAVE_ARCH_TRACEHOOK=y 157CONFIG_HAVE_ARCH_TRACEHOOK=y
158CONFIG_HAVE_DMA_ATTRS=y
157CONFIG_USE_GENERIC_SMP_HELPERS=y 159CONFIG_USE_GENERIC_SMP_HELPERS=y
160CONFIG_HAVE_DMA_API_DEBUG=y
158 161
159# 162#
160# GCOV-based kernel profiling 163# GCOV-based kernel profiling
@@ -253,13 +256,13 @@ CONFIG_BINFMT_ELF=y
253CONFIG_BINFMT_MISC=m 256CONFIG_BINFMT_MISC=m
254CONFIG_IOMMU_HELPER=y 257CONFIG_IOMMU_HELPER=y
255CONFIG_SWIOTLB=y 258CONFIG_SWIOTLB=y
256CONFIG_PPC_NEED_DMA_SYNC_OPS=y
257CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y 259CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y
258CONFIG_ARCH_HAS_WALK_MEMORY=y 260CONFIG_ARCH_HAS_WALK_MEMORY=y
259CONFIG_ARCH_ENABLE_MEMORY_HOTREMOVE=y 261CONFIG_ARCH_ENABLE_MEMORY_HOTREMOVE=y
260# CONFIG_KEXEC is not set 262# CONFIG_KEXEC is not set
261# CONFIG_CRASH_DUMP is not set 263# CONFIG_CRASH_DUMP is not set
262# CONFIG_IRQ_ALL_CPUS is not set 264# CONFIG_IRQ_ALL_CPUS is not set
265CONFIG_MAX_ACTIVE_REGIONS=32
263CONFIG_ARCH_FLATMEM_ENABLE=y 266CONFIG_ARCH_FLATMEM_ENABLE=y
264CONFIG_ARCH_POPULATES_NODE_MAP=y 267CONFIG_ARCH_POPULATES_NODE_MAP=y
265CONFIG_SELECT_MEMORY_MODEL=y 268CONFIG_SELECT_MEMORY_MODEL=y
@@ -277,6 +280,7 @@ CONFIG_BOUNCE=y
277CONFIG_VIRT_TO_BUS=y 280CONFIG_VIRT_TO_BUS=y
278CONFIG_HAVE_MLOCK=y 281CONFIG_HAVE_MLOCK=y
279CONFIG_HAVE_MLOCKED_PAGE_BIT=y 282CONFIG_HAVE_MLOCKED_PAGE_BIT=y
283# CONFIG_KSM is not set
280CONFIG_DEFAULT_MMAP_MIN_ADDR=4096 284CONFIG_DEFAULT_MMAP_MIN_ADDR=4096
281CONFIG_PPC_4K_PAGES=y 285CONFIG_PPC_4K_PAGES=y
282# CONFIG_PPC_16K_PAGES is not set 286# CONFIG_PPC_16K_PAGES is not set
@@ -406,6 +410,7 @@ CONFIG_IP_SCTP=m
406# CONFIG_SCTP_HMAC_NONE is not set 410# CONFIG_SCTP_HMAC_NONE is not set
407# CONFIG_SCTP_HMAC_SHA1 is not set 411# CONFIG_SCTP_HMAC_SHA1 is not set
408CONFIG_SCTP_HMAC_MD5=y 412CONFIG_SCTP_HMAC_MD5=y
413# CONFIG_RDS is not set
409# CONFIG_TIPC is not set 414# CONFIG_TIPC is not set
410# CONFIG_ATM is not set 415# CONFIG_ATM is not set
411# CONFIG_BRIDGE is not set 416# CONFIG_BRIDGE is not set
@@ -436,6 +441,7 @@ CONFIG_SCTP_HMAC_MD5=y
436CONFIG_FIB_RULES=y 441CONFIG_FIB_RULES=y
437CONFIG_WIRELESS=y 442CONFIG_WIRELESS=y
438# CONFIG_CFG80211 is not set 443# CONFIG_CFG80211 is not set
444CONFIG_CFG80211_DEFAULT_PS_VALUE=0
439CONFIG_WIRELESS_OLD_REGULATORY=y 445CONFIG_WIRELESS_OLD_REGULATORY=y
440# CONFIG_WIRELESS_EXT is not set 446# CONFIG_WIRELESS_EXT is not set
441# CONFIG_LIB80211 is not set 447# CONFIG_LIB80211 is not set
@@ -443,7 +449,6 @@ CONFIG_WIRELESS_OLD_REGULATORY=y
443# 449#
444# CFG80211 needs to be enabled for MAC80211 450# CFG80211 needs to be enabled for MAC80211
445# 451#
446CONFIG_MAC80211_DEFAULT_PS_VALUE=0
447# CONFIG_WIMAX is not set 452# CONFIG_WIMAX is not set
448# CONFIG_RFKILL is not set 453# CONFIG_RFKILL is not set
449# CONFIG_NET_9P is not set 454# CONFIG_NET_9P is not set
@@ -456,6 +461,7 @@ CONFIG_MAC80211_DEFAULT_PS_VALUE=0
456# Generic Driver Options 461# Generic Driver Options
457# 462#
458CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug" 463CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
464# CONFIG_DEVTMPFS is not set
459CONFIG_STANDALONE=y 465CONFIG_STANDALONE=y
460CONFIG_PREVENT_FIRMWARE_BUILD=y 466CONFIG_PREVENT_FIRMWARE_BUILD=y
461CONFIG_FW_LOADER=y 467CONFIG_FW_LOADER=y
@@ -549,6 +555,7 @@ CONFIG_SCSI_LOWLEVEL=y
549# CONFIG_ISCSI_TCP is not set 555# CONFIG_ISCSI_TCP is not set
550# CONFIG_SCSI_CXGB3_ISCSI is not set 556# CONFIG_SCSI_CXGB3_ISCSI is not set
551# CONFIG_SCSI_BNX2_ISCSI is not set 557# CONFIG_SCSI_BNX2_ISCSI is not set
558# CONFIG_BE2ISCSI is not set
552# CONFIG_BLK_DEV_3W_XXXX_RAID is not set 559# CONFIG_BLK_DEV_3W_XXXX_RAID is not set
553# CONFIG_SCSI_3W_9XXX is not set 560# CONFIG_SCSI_3W_9XXX is not set
554# CONFIG_SCSI_ACARD is not set 561# CONFIG_SCSI_ACARD is not set
@@ -588,11 +595,14 @@ CONFIG_SCSI_LOWLEVEL=y
588# CONFIG_SCSI_DC390T is not set 595# CONFIG_SCSI_DC390T is not set
589# CONFIG_SCSI_NSP32 is not set 596# CONFIG_SCSI_NSP32 is not set
590# CONFIG_SCSI_DEBUG is not set 597# CONFIG_SCSI_DEBUG is not set
598# CONFIG_SCSI_PMCRAID is not set
591# CONFIG_SCSI_SRP is not set 599# CONFIG_SCSI_SRP is not set
600# CONFIG_SCSI_BFA_FC is not set
592# CONFIG_SCSI_DH is not set 601# CONFIG_SCSI_DH is not set
593# CONFIG_SCSI_OSD_INITIATOR is not set 602# CONFIG_SCSI_OSD_INITIATOR is not set
594CONFIG_ATA=y 603CONFIG_ATA=y
595# CONFIG_ATA_NONSTANDARD is not set 604# CONFIG_ATA_NONSTANDARD is not set
605CONFIG_ATA_VERBOSE_ERROR=y
596CONFIG_SATA_PMP=y 606CONFIG_SATA_PMP=y
597CONFIG_SATA_AHCI=y 607CONFIG_SATA_AHCI=y
598# CONFIG_SATA_SIL24 is not set 608# CONFIG_SATA_SIL24 is not set
@@ -615,6 +625,7 @@ CONFIG_ATA_SFF=y
615CONFIG_PATA_ALI=y 625CONFIG_PATA_ALI=y
616# CONFIG_PATA_AMD is not set 626# CONFIG_PATA_AMD is not set
617# CONFIG_PATA_ARTOP is not set 627# CONFIG_PATA_ARTOP is not set
628# CONFIG_PATA_ATP867X is not set
618# CONFIG_PATA_ATIIXP is not set 629# CONFIG_PATA_ATIIXP is not set
619# CONFIG_PATA_CMD640_PCI is not set 630# CONFIG_PATA_CMD640_PCI is not set
620# CONFIG_PATA_CMD64X is not set 631# CONFIG_PATA_CMD64X is not set
@@ -642,6 +653,7 @@ CONFIG_PATA_ALI=y
642# CONFIG_PATA_OPTIDMA is not set 653# CONFIG_PATA_OPTIDMA is not set
643# CONFIG_PATA_PDC_OLD is not set 654# CONFIG_PATA_PDC_OLD is not set
644# CONFIG_PATA_RADISYS is not set 655# CONFIG_PATA_RADISYS is not set
656# CONFIG_PATA_RDC is not set
645# CONFIG_PATA_RZ1000 is not set 657# CONFIG_PATA_RZ1000 is not set
646# CONFIG_PATA_SC1200 is not set 658# CONFIG_PATA_SC1200 is not set
647# CONFIG_PATA_SERVERWORKS is not set 659# CONFIG_PATA_SERVERWORKS is not set
@@ -718,7 +730,9 @@ CONFIG_MII=y
718# CONFIG_NET_PCI is not set 730# CONFIG_NET_PCI is not set
719# CONFIG_B44 is not set 731# CONFIG_B44 is not set
720# CONFIG_KS8842 is not set 732# CONFIG_KS8842 is not set
733# CONFIG_KS8851_MLL is not set
721# CONFIG_ATL2 is not set 734# CONFIG_ATL2 is not set
735# CONFIG_XILINX_EMACLITE is not set
722CONFIG_NETDEV_1000=y 736CONFIG_NETDEV_1000=y
723# CONFIG_ACENIC is not set 737# CONFIG_ACENIC is not set
724# CONFIG_DL2K is not set 738# CONFIG_DL2K is not set
@@ -766,10 +780,7 @@ CONFIG_CHELSIO_T3_DEPENDS=y
766# CONFIG_SFC is not set 780# CONFIG_SFC is not set
767# CONFIG_BE2NET is not set 781# CONFIG_BE2NET is not set
768# CONFIG_TR is not set 782# CONFIG_TR is not set
769 783CONFIG_WLAN=y
770#
771# Wireless LAN
772#
773# CONFIG_WLAN_PRE80211 is not set 784# CONFIG_WLAN_PRE80211 is not set
774# CONFIG_WLAN_80211 is not set 785# CONFIG_WLAN_80211 is not set
775 786
@@ -883,6 +894,7 @@ CONFIG_NVRAM=y
883CONFIG_DEVPORT=y 894CONFIG_DEVPORT=y
884CONFIG_I2C=y 895CONFIG_I2C=y
885CONFIG_I2C_BOARDINFO=y 896CONFIG_I2C_BOARDINFO=y
897CONFIG_I2C_COMPAT=y
886# CONFIG_I2C_CHARDEV is not set 898# CONFIG_I2C_CHARDEV is not set
887CONFIG_I2C_HELPER_AUTO=y 899CONFIG_I2C_HELPER_AUTO=y
888 900
@@ -938,9 +950,6 @@ CONFIG_I2C_MPC=y
938# Miscellaneous I2C Chip support 950# Miscellaneous I2C Chip support
939# 951#
940# CONFIG_DS1682 is not set 952# CONFIG_DS1682 is not set
941# CONFIG_SENSORS_PCF8574 is not set
942# CONFIG_PCF8575 is not set
943# CONFIG_SENSORS_PCA9539 is not set
944# CONFIG_SENSORS_TSL2550 is not set 953# CONFIG_SENSORS_TSL2550 is not set
945# CONFIG_I2C_DEBUG_CORE is not set 954# CONFIG_I2C_DEBUG_CORE is not set
946# CONFIG_I2C_DEBUG_ALGO is not set 955# CONFIG_I2C_DEBUG_ALGO is not set
@@ -974,15 +983,19 @@ CONFIG_GPIOLIB=y
974# PCI GPIO expanders: 983# PCI GPIO expanders:
975# 984#
976# CONFIG_GPIO_BT8XX is not set 985# CONFIG_GPIO_BT8XX is not set
986# CONFIG_GPIO_LANGWELL is not set
977 987
978# 988#
979# SPI GPIO expanders: 989# SPI GPIO expanders:
980# 990#
991
992#
993# AC97 GPIO expanders:
994#
981# CONFIG_W1 is not set 995# CONFIG_W1 is not set
982# CONFIG_POWER_SUPPLY is not set 996# CONFIG_POWER_SUPPLY is not set
983# CONFIG_HWMON is not set 997# CONFIG_HWMON is not set
984# CONFIG_THERMAL is not set 998# CONFIG_THERMAL is not set
985# CONFIG_THERMAL_HWMON is not set
986# CONFIG_WATCHDOG is not set 999# CONFIG_WATCHDOG is not set
987CONFIG_SSB_POSSIBLE=y 1000CONFIG_SSB_POSSIBLE=y
988 1001
@@ -1003,6 +1016,7 @@ CONFIG_SSB_POSSIBLE=y
1003# CONFIG_MFD_TMIO is not set 1016# CONFIG_MFD_TMIO is not set
1004# CONFIG_PMIC_DA903X is not set 1017# CONFIG_PMIC_DA903X is not set
1005# CONFIG_MFD_WM8400 is not set 1018# CONFIG_MFD_WM8400 is not set
1019# CONFIG_MFD_WM831X is not set
1006# CONFIG_MFD_WM8350_I2C is not set 1020# CONFIG_MFD_WM8350_I2C is not set
1007# CONFIG_MFD_PCF50633 is not set 1021# CONFIG_MFD_PCF50633 is not set
1008# CONFIG_AB3100_CORE is not set 1022# CONFIG_AB3100_CORE is not set
@@ -1013,6 +1027,7 @@ CONFIG_SSB_POSSIBLE=y
1013# Graphics support 1027# Graphics support
1014# 1028#
1015# CONFIG_AGP is not set 1029# CONFIG_AGP is not set
1030CONFIG_VGA_ARB=y
1016# CONFIG_DRM is not set 1031# CONFIG_DRM is not set
1017# CONFIG_VGASTATE is not set 1032# CONFIG_VGASTATE is not set
1018CONFIG_VIDEO_OUTPUT_CONTROL=y 1033CONFIG_VIDEO_OUTPUT_CONTROL=y
@@ -1032,6 +1047,7 @@ CONFIG_VGA_CONSOLE=y
1032CONFIG_DUMMY_CONSOLE=y 1047CONFIG_DUMMY_CONSOLE=y
1033CONFIG_SOUND=y 1048CONFIG_SOUND=y
1034CONFIG_SOUND_OSS_CORE=y 1049CONFIG_SOUND_OSS_CORE=y
1050CONFIG_SOUND_OSS_CORE_PRECLAIM=y
1035CONFIG_SND=y 1051CONFIG_SND=y
1036CONFIG_SND_TIMER=y 1052CONFIG_SND_TIMER=y
1037CONFIG_SND_PCM=y 1053CONFIG_SND_PCM=y
@@ -1135,7 +1151,6 @@ CONFIG_SND_USB=y
1135CONFIG_AC97_BUS=y 1151CONFIG_AC97_BUS=y
1136CONFIG_HID_SUPPORT=y 1152CONFIG_HID_SUPPORT=y
1137CONFIG_HID=y 1153CONFIG_HID=y
1138# CONFIG_HID_DEBUG is not set
1139# CONFIG_HIDRAW is not set 1154# CONFIG_HIDRAW is not set
1140 1155
1141# 1156#
@@ -1158,6 +1173,7 @@ CONFIG_HID_CYPRESS=y
1158CONFIG_HID_EZKEY=y 1173CONFIG_HID_EZKEY=y
1159# CONFIG_HID_KYE is not set 1174# CONFIG_HID_KYE is not set
1160CONFIG_HID_GYRATION=y 1175CONFIG_HID_GYRATION=y
1176# CONFIG_HID_TWINHAN is not set
1161# CONFIG_HID_KENSINGTON is not set 1177# CONFIG_HID_KENSINGTON is not set
1162CONFIG_HID_LOGITECH=y 1178CONFIG_HID_LOGITECH=y
1163# CONFIG_LOGITECH_FF is not set 1179# CONFIG_LOGITECH_FF is not set
@@ -1210,6 +1226,7 @@ CONFIG_USB_EHCI_HCD_PPC_OF=y
1210# CONFIG_USB_OXU210HP_HCD is not set 1226# CONFIG_USB_OXU210HP_HCD is not set
1211# CONFIG_USB_ISP116X_HCD is not set 1227# CONFIG_USB_ISP116X_HCD is not set
1212# CONFIG_USB_ISP1760_HCD is not set 1228# CONFIG_USB_ISP1760_HCD is not set
1229# CONFIG_USB_ISP1362_HCD is not set
1213CONFIG_USB_OHCI_HCD=y 1230CONFIG_USB_OHCI_HCD=y
1214CONFIG_USB_OHCI_HCD_PPC_OF_BE=y 1231CONFIG_USB_OHCI_HCD_PPC_OF_BE=y
1215CONFIG_USB_OHCI_HCD_PPC_OF_LE=y 1232CONFIG_USB_OHCI_HCD_PPC_OF_LE=y
@@ -1389,6 +1406,7 @@ CONFIG_FS_MBCACHE=y
1389# CONFIG_GFS2_FS is not set 1406# CONFIG_GFS2_FS is not set
1390# CONFIG_OCFS2_FS is not set 1407# CONFIG_OCFS2_FS is not set
1391# CONFIG_BTRFS_FS is not set 1408# CONFIG_BTRFS_FS is not set
1409# CONFIG_NILFS2_FS is not set
1392CONFIG_FILE_LOCKING=y 1410CONFIG_FILE_LOCKING=y
1393CONFIG_FSNOTIFY=y 1411CONFIG_FSNOTIFY=y
1394CONFIG_DNOTIFY=y 1412CONFIG_DNOTIFY=y
@@ -1459,7 +1477,6 @@ CONFIG_SYSV_FS=m
1459CONFIG_UFS_FS=m 1477CONFIG_UFS_FS=m
1460# CONFIG_UFS_FS_WRITE is not set 1478# CONFIG_UFS_FS_WRITE is not set
1461# CONFIG_UFS_DEBUG is not set 1479# CONFIG_UFS_DEBUG is not set
1462# CONFIG_NILFS2_FS is not set
1463CONFIG_NETWORK_FILESYSTEMS=y 1480CONFIG_NETWORK_FILESYSTEMS=y
1464CONFIG_NFS_FS=y 1481CONFIG_NFS_FS=y
1465CONFIG_NFS_V3=y 1482CONFIG_NFS_V3=y
@@ -1577,6 +1594,7 @@ CONFIG_ENABLE_WARN_DEPRECATED=y
1577CONFIG_ENABLE_MUST_CHECK=y 1594CONFIG_ENABLE_MUST_CHECK=y
1578CONFIG_FRAME_WARN=1024 1595CONFIG_FRAME_WARN=1024
1579# CONFIG_MAGIC_SYSRQ is not set 1596# CONFIG_MAGIC_SYSRQ is not set
1597# CONFIG_STRIP_ASM_SYMS is not set
1580# CONFIG_UNUSED_SYMBOLS is not set 1598# CONFIG_UNUSED_SYMBOLS is not set
1581# CONFIG_DEBUG_FS is not set 1599# CONFIG_DEBUG_FS is not set
1582# CONFIG_HEADERS_CHECK is not set 1600# CONFIG_HEADERS_CHECK is not set
@@ -1594,6 +1612,7 @@ CONFIG_SCHED_DEBUG=y
1594# CONFIG_DEBUG_OBJECTS is not set 1612# CONFIG_DEBUG_OBJECTS is not set
1595# CONFIG_SLUB_DEBUG_ON is not set 1613# CONFIG_SLUB_DEBUG_ON is not set
1596# CONFIG_SLUB_STATS is not set 1614# CONFIG_SLUB_STATS is not set
1615# CONFIG_DEBUG_KMEMLEAK is not set
1597# CONFIG_DEBUG_RT_MUTEXES is not set 1616# CONFIG_DEBUG_RT_MUTEXES is not set
1598# CONFIG_RT_MUTEX_TESTER is not set 1617# CONFIG_RT_MUTEX_TESTER is not set
1599# CONFIG_DEBUG_SPINLOCK is not set 1618# CONFIG_DEBUG_SPINLOCK is not set
@@ -1613,10 +1632,12 @@ CONFIG_DEBUG_INFO=y
1613# CONFIG_DEBUG_LIST is not set 1632# CONFIG_DEBUG_LIST is not set
1614# CONFIG_DEBUG_SG is not set 1633# CONFIG_DEBUG_SG is not set
1615# CONFIG_DEBUG_NOTIFIERS is not set 1634# CONFIG_DEBUG_NOTIFIERS is not set
1635# CONFIG_DEBUG_CREDENTIALS is not set
1616# CONFIG_RCU_TORTURE_TEST is not set 1636# CONFIG_RCU_TORTURE_TEST is not set
1617# CONFIG_RCU_CPU_STALL_DETECTOR is not set 1637# CONFIG_RCU_CPU_STALL_DETECTOR is not set
1618# CONFIG_BACKTRACE_SELF_TEST is not set 1638# CONFIG_BACKTRACE_SELF_TEST is not set
1619# CONFIG_DEBUG_BLOCK_EXT_DEVT is not set 1639# CONFIG_DEBUG_BLOCK_EXT_DEVT is not set
1640# CONFIG_DEBUG_FORCE_WEAK_PER_CPU is not set
1620# CONFIG_FAULT_INJECTION is not set 1641# CONFIG_FAULT_INJECTION is not set
1621# CONFIG_LATENCYTOP is not set 1642# CONFIG_LATENCYTOP is not set
1622CONFIG_SYSCTL_SYSCALL_CHECK=y 1643CONFIG_SYSCTL_SYSCALL_CHECK=y
@@ -1639,10 +1660,10 @@ CONFIG_BRANCH_PROFILE_NONE=y
1639# CONFIG_KMEMTRACE is not set 1660# CONFIG_KMEMTRACE is not set
1640# CONFIG_WORKQUEUE_TRACER is not set 1661# CONFIG_WORKQUEUE_TRACER is not set
1641# CONFIG_BLK_DEV_IO_TRACE is not set 1662# CONFIG_BLK_DEV_IO_TRACE is not set
1663# CONFIG_DMA_API_DEBUG is not set
1642# CONFIG_SAMPLES is not set 1664# CONFIG_SAMPLES is not set
1643CONFIG_HAVE_ARCH_KGDB=y 1665CONFIG_HAVE_ARCH_KGDB=y
1644# CONFIG_KGDB is not set 1666# CONFIG_KGDB is not set
1645# CONFIG_KMEMCHECK is not set
1646# CONFIG_PPC_DISABLE_WERROR is not set 1667# CONFIG_PPC_DISABLE_WERROR is not set
1647CONFIG_PPC_WERROR=y 1668CONFIG_PPC_WERROR=y
1648CONFIG_PRINT_STACK_DEPTH=64 1669CONFIG_PRINT_STACK_DEPTH=64
@@ -1669,7 +1690,6 @@ CONFIG_CRYPTO=y
1669# 1690#
1670# Crypto core or helper 1691# Crypto core or helper
1671# 1692#
1672# CONFIG_CRYPTO_FIPS is not set
1673CONFIG_CRYPTO_ALGAPI=y 1693CONFIG_CRYPTO_ALGAPI=y
1674CONFIG_CRYPTO_ALGAPI2=y 1694CONFIG_CRYPTO_ALGAPI2=y
1675CONFIG_CRYPTO_AEAD2=y 1695CONFIG_CRYPTO_AEAD2=y
@@ -1711,11 +1731,13 @@ CONFIG_CRYPTO_PCBC=m
1711# 1731#
1712CONFIG_CRYPTO_HMAC=y 1732CONFIG_CRYPTO_HMAC=y
1713# CONFIG_CRYPTO_XCBC is not set 1733# CONFIG_CRYPTO_XCBC is not set
1734# CONFIG_CRYPTO_VMAC is not set
1714 1735
1715# 1736#
1716# Digest 1737# Digest
1717# 1738#
1718CONFIG_CRYPTO_CRC32C=m 1739CONFIG_CRYPTO_CRC32C=m
1740# CONFIG_CRYPTO_GHASH is not set
1719# CONFIG_CRYPTO_MD4 is not set 1741# CONFIG_CRYPTO_MD4 is not set
1720CONFIG_CRYPTO_MD5=y 1742CONFIG_CRYPTO_MD5=y
1721# CONFIG_CRYPTO_MICHAEL_MIC is not set 1743# CONFIG_CRYPTO_MICHAEL_MIC is not set
diff --git a/arch/powerpc/configs/mpc885_ads_defconfig b/arch/powerpc/configs/mpc885_ads_defconfig
index dbe8e869a827..1da3488a603d 100644
--- a/arch/powerpc/configs/mpc885_ads_defconfig
+++ b/arch/powerpc/configs/mpc885_ads_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.31-rc4 3# Linux kernel version: 2.6.32-rc5
4# Wed Jul 29 23:31:59 2009 4# Thu Nov 5 08:20:17 2009
5# 5#
6# CONFIG_PPC64 is not set 6# CONFIG_PPC64 is not set
7 7
@@ -16,6 +16,7 @@ CONFIG_PPC_8xx=y
16# CONFIG_E200 is not set 16# CONFIG_E200 is not set
17CONFIG_8xx=y 17CONFIG_8xx=y
18CONFIG_PPC_MMU_NOHASH=y 18CONFIG_PPC_MMU_NOHASH=y
19CONFIG_PPC_MMU_NOHASH_32=y
19# CONFIG_PPC_MM_SLICES is not set 20# CONFIG_PPC_MM_SLICES is not set
20CONFIG_NOT_COHERENT_CACHE=y 21CONFIG_NOT_COHERENT_CACHE=y
21CONFIG_PPC32=y 22CONFIG_PPC32=y
@@ -29,6 +30,7 @@ CONFIG_GENERIC_CLOCKEVENTS=y
29CONFIG_GENERIC_HARDIRQS=y 30CONFIG_GENERIC_HARDIRQS=y
30CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y 31CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y
31# CONFIG_HAVE_SETUP_PER_CPU_AREA is not set 32# CONFIG_HAVE_SETUP_PER_CPU_AREA is not set
33# CONFIG_NEED_PER_CPU_EMBED_FIRST_CHUNK is not set
32CONFIG_IRQ_PER_CPU=y 34CONFIG_IRQ_PER_CPU=y
33CONFIG_STACKTRACE_SUPPORT=y 35CONFIG_STACKTRACE_SUPPORT=y
34CONFIG_HAVE_LATENCYTOP_SUPPORT=y 36CONFIG_HAVE_LATENCYTOP_SUPPORT=y
@@ -77,11 +79,12 @@ CONFIG_SYSVIPC_SYSCTL=y
77# 79#
78# RCU Subsystem 80# RCU Subsystem
79# 81#
80CONFIG_CLASSIC_RCU=y 82CONFIG_TREE_RCU=y
81# CONFIG_TREE_RCU is not set 83# CONFIG_TREE_PREEMPT_RCU is not set
82# CONFIG_PREEMPT_RCU is not set 84# CONFIG_RCU_TRACE is not set
85CONFIG_RCU_FANOUT=32
86# CONFIG_RCU_FANOUT_EXACT is not set
83# CONFIG_TREE_RCU_TRACE is not set 87# CONFIG_TREE_RCU_TRACE is not set
84# CONFIG_PREEMPT_RCU_TRACE is not set
85# CONFIG_IKCONFIG is not set 88# CONFIG_IKCONFIG is not set
86CONFIG_LOG_BUF_SHIFT=14 89CONFIG_LOG_BUF_SHIFT=14
87CONFIG_GROUP_SCHED=y 90CONFIG_GROUP_SCHED=y
@@ -115,28 +118,29 @@ CONFIG_TIMERFD=y
115CONFIG_EVENTFD=y 118CONFIG_EVENTFD=y
116CONFIG_SHMEM=y 119CONFIG_SHMEM=y
117CONFIG_AIO=y 120CONFIG_AIO=y
118CONFIG_HAVE_PERF_COUNTERS=y 121CONFIG_HAVE_PERF_EVENTS=y
119 122
120# 123#
121# Performance Counters 124# Kernel Performance Events And Counters
122# 125#
126# CONFIG_PERF_EVENTS is not set
123# CONFIG_PERF_COUNTERS is not set 127# CONFIG_PERF_COUNTERS is not set
124# CONFIG_VM_EVENT_COUNTERS is not set 128# CONFIG_VM_EVENT_COUNTERS is not set
125CONFIG_SLUB_DEBUG=y 129CONFIG_SLUB_DEBUG=y
126# CONFIG_STRIP_ASM_SYMS is not set
127CONFIG_COMPAT_BRK=y 130CONFIG_COMPAT_BRK=y
128# CONFIG_SLAB is not set 131# CONFIG_SLAB is not set
129CONFIG_SLUB=y 132CONFIG_SLUB=y
130# CONFIG_SLOB is not set 133# CONFIG_SLOB is not set
131# CONFIG_PROFILING is not set 134# CONFIG_PROFILING is not set
132# CONFIG_MARKERS is not set
133CONFIG_HAVE_OPROFILE=y 135CONFIG_HAVE_OPROFILE=y
134CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS=y 136CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS=y
135CONFIG_HAVE_IOREMAP_PROT=y 137CONFIG_HAVE_IOREMAP_PROT=y
136CONFIG_HAVE_KPROBES=y 138CONFIG_HAVE_KPROBES=y
137CONFIG_HAVE_KRETPROBES=y 139CONFIG_HAVE_KRETPROBES=y
138CONFIG_HAVE_ARCH_TRACEHOOK=y 140CONFIG_HAVE_ARCH_TRACEHOOK=y
141CONFIG_HAVE_DMA_ATTRS=y
139CONFIG_HAVE_CLK=y 142CONFIG_HAVE_CLK=y
143CONFIG_HAVE_DMA_API_DEBUG=y
140 144
141# 145#
142# GCOV-based kernel profiling 146# GCOV-based kernel profiling
@@ -241,10 +245,10 @@ CONFIG_BINFMT_ELF=y
241CONFIG_8XX_MINIMAL_FPEMU=y 245CONFIG_8XX_MINIMAL_FPEMU=y
242# CONFIG_IOMMU_HELPER is not set 246# CONFIG_IOMMU_HELPER is not set
243# CONFIG_SWIOTLB is not set 247# CONFIG_SWIOTLB is not set
244CONFIG_PPC_NEED_DMA_SYNC_OPS=y
245CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y 248CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y
246CONFIG_ARCH_HAS_WALK_MEMORY=y 249CONFIG_ARCH_HAS_WALK_MEMORY=y
247CONFIG_ARCH_ENABLE_MEMORY_HOTREMOVE=y 250CONFIG_ARCH_ENABLE_MEMORY_HOTREMOVE=y
251CONFIG_MAX_ACTIVE_REGIONS=32
248CONFIG_ARCH_FLATMEM_ENABLE=y 252CONFIG_ARCH_FLATMEM_ENABLE=y
249CONFIG_ARCH_POPULATES_NODE_MAP=y 253CONFIG_ARCH_POPULATES_NODE_MAP=y
250CONFIG_SELECT_MEMORY_MODEL=y 254CONFIG_SELECT_MEMORY_MODEL=y
@@ -262,6 +266,7 @@ CONFIG_BOUNCE=y
262CONFIG_VIRT_TO_BUS=y 266CONFIG_VIRT_TO_BUS=y
263CONFIG_HAVE_MLOCK=y 267CONFIG_HAVE_MLOCK=y
264CONFIG_HAVE_MLOCKED_PAGE_BIT=y 268CONFIG_HAVE_MLOCKED_PAGE_BIT=y
269# CONFIG_KSM is not set
265CONFIG_DEFAULT_MMAP_MIN_ADDR=4096 270CONFIG_DEFAULT_MMAP_MIN_ADDR=4096
266CONFIG_PPC_4K_PAGES=y 271CONFIG_PPC_4K_PAGES=y
267# CONFIG_PPC_16K_PAGES is not set 272# CONFIG_PPC_16K_PAGES is not set
@@ -344,6 +349,7 @@ CONFIG_DEFAULT_TCP_CONG="cubic"
344# CONFIG_NETFILTER is not set 349# CONFIG_NETFILTER is not set
345# CONFIG_IP_DCCP is not set 350# CONFIG_IP_DCCP is not set
346# CONFIG_IP_SCTP is not set 351# CONFIG_IP_SCTP is not set
352# CONFIG_RDS is not set
347# CONFIG_TIPC is not set 353# CONFIG_TIPC is not set
348# CONFIG_ATM is not set 354# CONFIG_ATM is not set
349# CONFIG_BRIDGE is not set 355# CONFIG_BRIDGE is not set
@@ -373,6 +379,7 @@ CONFIG_DEFAULT_TCP_CONG="cubic"
373# CONFIG_AF_RXRPC is not set 379# CONFIG_AF_RXRPC is not set
374CONFIG_WIRELESS=y 380CONFIG_WIRELESS=y
375# CONFIG_CFG80211 is not set 381# CONFIG_CFG80211 is not set
382CONFIG_CFG80211_DEFAULT_PS_VALUE=0
376CONFIG_WIRELESS_OLD_REGULATORY=y 383CONFIG_WIRELESS_OLD_REGULATORY=y
377# CONFIG_WIRELESS_EXT is not set 384# CONFIG_WIRELESS_EXT is not set
378# CONFIG_LIB80211 is not set 385# CONFIG_LIB80211 is not set
@@ -380,7 +387,6 @@ CONFIG_WIRELESS_OLD_REGULATORY=y
380# 387#
381# CFG80211 needs to be enabled for MAC80211 388# CFG80211 needs to be enabled for MAC80211
382# 389#
383CONFIG_MAC80211_DEFAULT_PS_VALUE=0
384# CONFIG_WIMAX is not set 390# CONFIG_WIMAX is not set
385# CONFIG_RFKILL is not set 391# CONFIG_RFKILL is not set
386# CONFIG_NET_9P is not set 392# CONFIG_NET_9P is not set
@@ -393,6 +399,7 @@ CONFIG_MAC80211_DEFAULT_PS_VALUE=0
393# Generic Driver Options 399# Generic Driver Options
394# 400#
395CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug" 401CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
402# CONFIG_DEVTMPFS is not set
396CONFIG_STANDALONE=y 403CONFIG_STANDALONE=y
397CONFIG_PREVENT_FIRMWARE_BUILD=y 404CONFIG_PREVENT_FIRMWARE_BUILD=y
398# CONFIG_FW_LOADER is not set 405# CONFIG_FW_LOADER is not set
@@ -540,16 +547,15 @@ CONFIG_MII=y
540# CONFIG_IBM_NEW_EMAC_MAL_COMMON_ERR is not set 547# CONFIG_IBM_NEW_EMAC_MAL_COMMON_ERR is not set
541# CONFIG_B44 is not set 548# CONFIG_B44 is not set
542# CONFIG_KS8842 is not set 549# CONFIG_KS8842 is not set
550# CONFIG_KS8851_MLL is not set
551# CONFIG_XILINX_EMACLITE is not set
543CONFIG_FS_ENET=y 552CONFIG_FS_ENET=y
544# CONFIG_FS_ENET_HAS_SCC is not set 553# CONFIG_FS_ENET_HAS_SCC is not set
545CONFIG_FS_ENET_HAS_FEC=y 554CONFIG_FS_ENET_HAS_FEC=y
546CONFIG_FS_ENET_MDIO_FEC=y 555CONFIG_FS_ENET_MDIO_FEC=y
547# CONFIG_NETDEV_1000 is not set 556# CONFIG_NETDEV_1000 is not set
548# CONFIG_NETDEV_10000 is not set 557# CONFIG_NETDEV_10000 is not set
549 558CONFIG_WLAN=y
550#
551# Wireless LAN
552#
553# CONFIG_WLAN_PRE80211 is not set 559# CONFIG_WLAN_PRE80211 is not set
554# CONFIG_WLAN_80211 is not set 560# CONFIG_WLAN_80211 is not set
555 561
@@ -622,7 +628,6 @@ CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y
622# CONFIG_POWER_SUPPLY is not set 628# CONFIG_POWER_SUPPLY is not set
623# CONFIG_HWMON is not set 629# CONFIG_HWMON is not set
624# CONFIG_THERMAL is not set 630# CONFIG_THERMAL is not set
625# CONFIG_THERMAL_HWMON is not set
626# CONFIG_WATCHDOG is not set 631# CONFIG_WATCHDOG is not set
627CONFIG_SSB_POSSIBLE=y 632CONFIG_SSB_POSSIBLE=y
628 633
@@ -683,6 +688,7 @@ CONFIG_SSB_POSSIBLE=y
683# CONFIG_GFS2_FS is not set 688# CONFIG_GFS2_FS is not set
684# CONFIG_OCFS2_FS is not set 689# CONFIG_OCFS2_FS is not set
685# CONFIG_BTRFS_FS is not set 690# CONFIG_BTRFS_FS is not set
691# CONFIG_NILFS2_FS is not set
686CONFIG_FILE_LOCKING=y 692CONFIG_FILE_LOCKING=y
687CONFIG_FSNOTIFY=y 693CONFIG_FSNOTIFY=y
688# CONFIG_DNOTIFY is not set 694# CONFIG_DNOTIFY is not set
@@ -742,7 +748,6 @@ CONFIG_CRAMFS=y
742# CONFIG_ROMFS_FS is not set 748# CONFIG_ROMFS_FS is not set
743# CONFIG_SYSV_FS is not set 749# CONFIG_SYSV_FS is not set
744# CONFIG_UFS_FS is not set 750# CONFIG_UFS_FS is not set
745# CONFIG_NILFS2_FS is not set
746CONFIG_NETWORK_FILESYSTEMS=y 751CONFIG_NETWORK_FILESYSTEMS=y
747CONFIG_NFS_FS=y 752CONFIG_NFS_FS=y
748CONFIG_NFS_V3=y 753CONFIG_NFS_V3=y
@@ -814,6 +819,7 @@ CONFIG_ENABLE_WARN_DEPRECATED=y
814CONFIG_ENABLE_MUST_CHECK=y 819CONFIG_ENABLE_MUST_CHECK=y
815CONFIG_FRAME_WARN=1024 820CONFIG_FRAME_WARN=1024
816CONFIG_MAGIC_SYSRQ=y 821CONFIG_MAGIC_SYSRQ=y
822# CONFIG_STRIP_ASM_SYMS is not set
817# CONFIG_UNUSED_SYMBOLS is not set 823# CONFIG_UNUSED_SYMBOLS is not set
818# CONFIG_DEBUG_FS is not set 824# CONFIG_DEBUG_FS is not set
819# CONFIG_HEADERS_CHECK is not set 825# CONFIG_HEADERS_CHECK is not set
@@ -831,6 +837,7 @@ CONFIG_SCHED_DEBUG=y
831# CONFIG_DEBUG_OBJECTS is not set 837# CONFIG_DEBUG_OBJECTS is not set
832# CONFIG_SLUB_DEBUG_ON is not set 838# CONFIG_SLUB_DEBUG_ON is not set
833# CONFIG_SLUB_STATS is not set 839# CONFIG_SLUB_STATS is not set
840# CONFIG_DEBUG_KMEMLEAK is not set
834# CONFIG_DEBUG_SPINLOCK is not set 841# CONFIG_DEBUG_SPINLOCK is not set
835# CONFIG_DEBUG_MUTEXES is not set 842# CONFIG_DEBUG_MUTEXES is not set
836# CONFIG_DEBUG_LOCK_ALLOC is not set 843# CONFIG_DEBUG_LOCK_ALLOC is not set
@@ -847,10 +854,12 @@ CONFIG_DEBUG_INFO=y
847# CONFIG_DEBUG_LIST is not set 854# CONFIG_DEBUG_LIST is not set
848# CONFIG_DEBUG_SG is not set 855# CONFIG_DEBUG_SG is not set
849# CONFIG_DEBUG_NOTIFIERS is not set 856# CONFIG_DEBUG_NOTIFIERS is not set
857# CONFIG_DEBUG_CREDENTIALS is not set
850# CONFIG_RCU_TORTURE_TEST is not set 858# CONFIG_RCU_TORTURE_TEST is not set
851# CONFIG_RCU_CPU_STALL_DETECTOR is not set 859# CONFIG_RCU_CPU_STALL_DETECTOR is not set
852# CONFIG_BACKTRACE_SELF_TEST is not set 860# CONFIG_BACKTRACE_SELF_TEST is not set
853# CONFIG_DEBUG_BLOCK_EXT_DEVT is not set 861# CONFIG_DEBUG_BLOCK_EXT_DEVT is not set
862# CONFIG_DEBUG_FORCE_WEAK_PER_CPU is not set
854# CONFIG_FAULT_INJECTION is not set 863# CONFIG_FAULT_INJECTION is not set
855# CONFIG_LATENCYTOP is not set 864# CONFIG_LATENCYTOP is not set
856# CONFIG_DEBUG_PAGEALLOC is not set 865# CONFIG_DEBUG_PAGEALLOC is not set
@@ -872,10 +881,10 @@ CONFIG_BRANCH_PROFILE_NONE=y
872# CONFIG_KMEMTRACE is not set 881# CONFIG_KMEMTRACE is not set
873# CONFIG_WORKQUEUE_TRACER is not set 882# CONFIG_WORKQUEUE_TRACER is not set
874# CONFIG_BLK_DEV_IO_TRACE is not set 883# CONFIG_BLK_DEV_IO_TRACE is not set
884# CONFIG_DMA_API_DEBUG is not set
875# CONFIG_SAMPLES is not set 885# CONFIG_SAMPLES is not set
876CONFIG_HAVE_ARCH_KGDB=y 886CONFIG_HAVE_ARCH_KGDB=y
877# CONFIG_KGDB is not set 887# CONFIG_KGDB is not set
878# CONFIG_KMEMCHECK is not set
879# CONFIG_PPC_DISABLE_WERROR is not set 888# CONFIG_PPC_DISABLE_WERROR is not set
880CONFIG_PPC_WERROR=y 889CONFIG_PPC_WERROR=y
881CONFIG_PRINT_STACK_DEPTH=64 890CONFIG_PRINT_STACK_DEPTH=64
diff --git a/arch/powerpc/configs/pasemi_defconfig b/arch/powerpc/configs/pasemi_defconfig
index 4f8681cc8d77..20ba0cfff8ba 100644
--- a/arch/powerpc/configs/pasemi_defconfig
+++ b/arch/powerpc/configs/pasemi_defconfig
@@ -1,49 +1,58 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.26-rc3 3# Linux kernel version: 2.6.32-rc3
4# Tue May 27 16:08:06 2008 4# Tue Oct 6 10:27:18 2009
5# 5#
6CONFIG_PPC64=y 6CONFIG_PPC64=y
7 7
8# 8#
9# Processor support 9# Processor support
10# 10#
11CONFIG_PPC_BOOK3S_64=y
12# CONFIG_PPC_BOOK3E_64 is not set
13CONFIG_PPC_BOOK3S=y
11CONFIG_POWER4_ONLY=y 14CONFIG_POWER4_ONLY=y
12CONFIG_POWER4=y 15CONFIG_POWER4=y
13# CONFIG_TUNE_CELL is not set 16# CONFIG_TUNE_CELL is not set
14CONFIG_PPC_FPU=y 17CONFIG_PPC_FPU=y
15CONFIG_ALTIVEC=y 18CONFIG_ALTIVEC=y
19# CONFIG_VSX is not set
16CONFIG_PPC_STD_MMU=y 20CONFIG_PPC_STD_MMU=y
21CONFIG_PPC_STD_MMU_64=y
17CONFIG_PPC_MM_SLICES=y 22CONFIG_PPC_MM_SLICES=y
18# CONFIG_VIRT_CPU_ACCOUNTING is not set 23# CONFIG_VIRT_CPU_ACCOUNTING is not set
24CONFIG_PPC_HAVE_PMU_SUPPORT=y
25CONFIG_PPC_PERF_CTRS=y
19CONFIG_SMP=y 26CONFIG_SMP=y
20CONFIG_NR_CPUS=2 27CONFIG_NR_CPUS=2
21CONFIG_64BIT=y 28CONFIG_64BIT=y
22CONFIG_WORD_SIZE=64 29CONFIG_WORD_SIZE=64
23CONFIG_PPC_MERGE=y 30CONFIG_ARCH_PHYS_ADDR_T_64BIT=y
24CONFIG_MMU=y 31CONFIG_MMU=y
25CONFIG_GENERIC_CMOS_UPDATE=y 32CONFIG_GENERIC_CMOS_UPDATE=y
26CONFIG_GENERIC_TIME=y 33CONFIG_GENERIC_TIME=y
27CONFIG_GENERIC_TIME_VSYSCALL=y 34CONFIG_GENERIC_TIME_VSYSCALL=y
28CONFIG_GENERIC_CLOCKEVENTS=y 35CONFIG_GENERIC_CLOCKEVENTS=y
29CONFIG_GENERIC_HARDIRQS=y 36CONFIG_GENERIC_HARDIRQS=y
37CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y
30CONFIG_HAVE_SETUP_PER_CPU_AREA=y 38CONFIG_HAVE_SETUP_PER_CPU_AREA=y
39CONFIG_NEED_PER_CPU_EMBED_FIRST_CHUNK=y
31CONFIG_IRQ_PER_CPU=y 40CONFIG_IRQ_PER_CPU=y
32CONFIG_STACKTRACE_SUPPORT=y 41CONFIG_STACKTRACE_SUPPORT=y
42CONFIG_HAVE_LATENCYTOP_SUPPORT=y
33CONFIG_TRACE_IRQFLAGS_SUPPORT=y 43CONFIG_TRACE_IRQFLAGS_SUPPORT=y
34CONFIG_LOCKDEP_SUPPORT=y 44CONFIG_LOCKDEP_SUPPORT=y
35CONFIG_RWSEM_XCHGADD_ALGORITHM=y 45CONFIG_RWSEM_XCHGADD_ALGORITHM=y
36CONFIG_ARCH_HAS_ILOG2_U32=y 46CONFIG_ARCH_HAS_ILOG2_U32=y
37CONFIG_ARCH_HAS_ILOG2_U64=y 47CONFIG_ARCH_HAS_ILOG2_U64=y
38CONFIG_GENERIC_HWEIGHT=y 48CONFIG_GENERIC_HWEIGHT=y
39CONFIG_GENERIC_CALIBRATE_DELAY=y
40CONFIG_GENERIC_FIND_NEXT_BIT=y 49CONFIG_GENERIC_FIND_NEXT_BIT=y
41CONFIG_ARCH_NO_VIRT_TO_BUS=y 50CONFIG_ARCH_NO_VIRT_TO_BUS=y
42CONFIG_PPC=y 51CONFIG_PPC=y
43CONFIG_EARLY_PRINTK=y 52CONFIG_EARLY_PRINTK=y
44CONFIG_COMPAT=y 53CONFIG_COMPAT=y
45CONFIG_SYSVIPC_COMPAT=y 54CONFIG_SYSVIPC_COMPAT=y
46CONFIG_SCHED_NO_NO_OMIT_FRAME_POINTER=y 55CONFIG_SCHED_OMIT_FRAME_POINTER=y
47CONFIG_ARCH_MAY_HAVE_PC_FDC=y 56CONFIG_ARCH_MAY_HAVE_PC_FDC=y
48CONFIG_PPC_OF=y 57CONFIG_PPC_OF=y
49CONFIG_OF=y 58CONFIG_OF=y
@@ -51,11 +60,14 @@ CONFIG_PPC_UDBG_16550=y
51# CONFIG_GENERIC_TBSYNC is not set 60# CONFIG_GENERIC_TBSYNC is not set
52CONFIG_AUDIT_ARCH=y 61CONFIG_AUDIT_ARCH=y
53CONFIG_GENERIC_BUG=y 62CONFIG_GENERIC_BUG=y
63CONFIG_DTC=y
54# CONFIG_DEFAULT_UIMAGE is not set 64# CONFIG_DEFAULT_UIMAGE is not set
55# CONFIG_PPC_DCR_NATIVE is not set 65# CONFIG_PPC_DCR_NATIVE is not set
56# CONFIG_PPC_DCR_MMIO is not set 66# CONFIG_PPC_DCR_MMIO is not set
57# CONFIG_PPC_OF_PLATFORM_PCI is not set 67# CONFIG_PPC_OF_PLATFORM_PCI is not set
68CONFIG_ARCH_SUPPORTS_DEBUG_PAGEALLOC=y
58CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config" 69CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
70CONFIG_CONSTRUCTORS=y
59 71
60# 72#
61# General setup 73# General setup
@@ -72,10 +84,20 @@ CONFIG_SYSVIPC_SYSCTL=y
72# CONFIG_BSD_PROCESS_ACCT is not set 84# CONFIG_BSD_PROCESS_ACCT is not set
73# CONFIG_TASKSTATS is not set 85# CONFIG_TASKSTATS is not set
74# CONFIG_AUDIT is not set 86# CONFIG_AUDIT is not set
87
88#
89# RCU Subsystem
90#
91CONFIG_TREE_RCU=y
92# CONFIG_TREE_PREEMPT_RCU is not set
93# CONFIG_RCU_TRACE is not set
94CONFIG_RCU_FANOUT=64
95# CONFIG_RCU_FANOUT_EXACT is not set
96# CONFIG_TREE_RCU_TRACE is not set
75# CONFIG_IKCONFIG is not set 97# CONFIG_IKCONFIG is not set
76CONFIG_LOG_BUF_SHIFT=17 98CONFIG_LOG_BUF_SHIFT=17
77# CONFIG_CGROUPS is not set
78# CONFIG_GROUP_SCHED is not set 99# CONFIG_GROUP_SCHED is not set
100# CONFIG_CGROUPS is not set
79CONFIG_SYSFS_DEPRECATED=y 101CONFIG_SYSFS_DEPRECATED=y
80CONFIG_SYSFS_DEPRECATED_V2=y 102CONFIG_SYSFS_DEPRECATED_V2=y
81# CONFIG_RELAY is not set 103# CONFIG_RELAY is not set
@@ -84,13 +106,17 @@ CONFIG_NAMESPACES=y
84# CONFIG_IPC_NS is not set 106# CONFIG_IPC_NS is not set
85# CONFIG_USER_NS is not set 107# CONFIG_USER_NS is not set
86# CONFIG_PID_NS is not set 108# CONFIG_PID_NS is not set
109# CONFIG_NET_NS is not set
87CONFIG_BLK_DEV_INITRD=y 110CONFIG_BLK_DEV_INITRD=y
88CONFIG_INITRAMFS_SOURCE="" 111CONFIG_INITRAMFS_SOURCE=""
112CONFIG_RD_GZIP=y
113CONFIG_RD_BZIP2=y
114CONFIG_RD_LZMA=y
89# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set 115# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
90CONFIG_SYSCTL=y 116CONFIG_SYSCTL=y
117CONFIG_ANON_INODES=y
91# CONFIG_EMBEDDED is not set 118# CONFIG_EMBEDDED is not set
92CONFIG_SYSCTL_SYSCALL=y 119CONFIG_SYSCTL_SYSCALL=y
93CONFIG_SYSCTL_SYSCALL_CHECK=y
94CONFIG_KALLSYMS=y 120CONFIG_KALLSYMS=y
95# CONFIG_KALLSYMS_ALL is not set 121# CONFIG_KALLSYMS_ALL is not set
96# CONFIG_KALLSYMS_EXTRA_PASS is not set 122# CONFIG_KALLSYMS_EXTRA_PASS is not set
@@ -98,32 +124,52 @@ CONFIG_HOTPLUG=y
98CONFIG_PRINTK=y 124CONFIG_PRINTK=y
99CONFIG_BUG=y 125CONFIG_BUG=y
100CONFIG_ELF_CORE=y 126CONFIG_ELF_CORE=y
101CONFIG_COMPAT_BRK=y
102CONFIG_BASE_FULL=y 127CONFIG_BASE_FULL=y
103CONFIG_FUTEX=y 128CONFIG_FUTEX=y
104CONFIG_ANON_INODES=y
105CONFIG_EPOLL=y 129CONFIG_EPOLL=y
106CONFIG_SIGNALFD=y 130CONFIG_SIGNALFD=y
107CONFIG_TIMERFD=y 131CONFIG_TIMERFD=y
108CONFIG_EVENTFD=y 132CONFIG_EVENTFD=y
109CONFIG_SHMEM=y 133CONFIG_SHMEM=y
134CONFIG_AIO=y
135CONFIG_HAVE_PERF_EVENTS=y
136
137#
138# Kernel Performance Events And Counters
139#
140CONFIG_PERF_EVENTS=y
141CONFIG_EVENT_PROFILE=y
142# CONFIG_PERF_COUNTERS is not set
110CONFIG_VM_EVENT_COUNTERS=y 143CONFIG_VM_EVENT_COUNTERS=y
144CONFIG_PCI_QUIRKS=y
111CONFIG_SLUB_DEBUG=y 145CONFIG_SLUB_DEBUG=y
146CONFIG_COMPAT_BRK=y
112# CONFIG_SLAB is not set 147# CONFIG_SLAB is not set
113CONFIG_SLUB=y 148CONFIG_SLUB=y
114# CONFIG_SLOB is not set 149# CONFIG_SLOB is not set
115CONFIG_PROFILING=y 150CONFIG_PROFILING=y
116# CONFIG_MARKERS is not set 151CONFIG_TRACEPOINTS=y
117CONFIG_OPROFILE=y 152CONFIG_OPROFILE=y
118CONFIG_HAVE_OPROFILE=y 153CONFIG_HAVE_OPROFILE=y
119# CONFIG_KPROBES is not set 154# CONFIG_KPROBES is not set
155CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS=y
156CONFIG_HAVE_SYSCALL_WRAPPERS=y
157CONFIG_HAVE_IOREMAP_PROT=y
120CONFIG_HAVE_KPROBES=y 158CONFIG_HAVE_KPROBES=y
121CONFIG_HAVE_KRETPROBES=y 159CONFIG_HAVE_KRETPROBES=y
122# CONFIG_HAVE_DMA_ATTRS is not set 160CONFIG_HAVE_ARCH_TRACEHOOK=y
123CONFIG_PROC_PAGE_MONITOR=y 161CONFIG_HAVE_DMA_ATTRS=y
162CONFIG_USE_GENERIC_SMP_HELPERS=y
163CONFIG_HAVE_DMA_API_DEBUG=y
164
165#
166# GCOV-based kernel profiling
167#
168# CONFIG_GCOV_KERNEL is not set
169# CONFIG_SLOW_WORK is not set
170# CONFIG_HAVE_GENERIC_DMA_COHERENT is not set
124CONFIG_SLABINFO=y 171CONFIG_SLABINFO=y
125CONFIG_RT_MUTEXES=y 172CONFIG_RT_MUTEXES=y
126# CONFIG_TINY_SHMEM is not set
127CONFIG_BASE_SMALL=0 173CONFIG_BASE_SMALL=0
128CONFIG_MODULES=y 174CONFIG_MODULES=y
129# CONFIG_MODULE_FORCE_LOAD is not set 175# CONFIG_MODULE_FORCE_LOAD is not set
@@ -131,11 +177,10 @@ CONFIG_MODULE_UNLOAD=y
131# CONFIG_MODULE_FORCE_UNLOAD is not set 177# CONFIG_MODULE_FORCE_UNLOAD is not set
132# CONFIG_MODVERSIONS is not set 178# CONFIG_MODVERSIONS is not set
133# CONFIG_MODULE_SRCVERSION_ALL is not set 179# CONFIG_MODULE_SRCVERSION_ALL is not set
134# CONFIG_KMOD is not set
135CONFIG_STOP_MACHINE=y 180CONFIG_STOP_MACHINE=y
136CONFIG_BLOCK=y 181CONFIG_BLOCK=y
137# CONFIG_BLK_DEV_IO_TRACE is not set
138# CONFIG_BLK_DEV_BSG is not set 182# CONFIG_BLK_DEV_BSG is not set
183# CONFIG_BLK_DEV_INTEGRITY is not set
139CONFIG_BLOCK_COMPAT=y 184CONFIG_BLOCK_COMPAT=y
140 185
141# 186#
@@ -150,19 +195,14 @@ CONFIG_DEFAULT_AS=y
150# CONFIG_DEFAULT_CFQ is not set 195# CONFIG_DEFAULT_CFQ is not set
151# CONFIG_DEFAULT_NOOP is not set 196# CONFIG_DEFAULT_NOOP is not set
152CONFIG_DEFAULT_IOSCHED="anticipatory" 197CONFIG_DEFAULT_IOSCHED="anticipatory"
153CONFIG_CLASSIC_RCU=y 198# CONFIG_FREEZER is not set
199CONFIG_PPC_MSI_BITMAP=y
154 200
155# 201#
156# Platform support 202# Platform support
157# 203#
158CONFIG_PPC_MULTIPLATFORM=y
159# CONFIG_PPC_82xx is not set
160# CONFIG_PPC_83xx is not set
161# CONFIG_PPC_86xx is not set
162# CONFIG_PPC_PSERIES is not set 204# CONFIG_PPC_PSERIES is not set
163# CONFIG_PPC_ISERIES is not set 205# CONFIG_PPC_ISERIES is not set
164# CONFIG_PPC_MPC512x is not set
165# CONFIG_PPC_MPC5121 is not set
166# CONFIG_PPC_PMAC is not set 206# CONFIG_PPC_PMAC is not set
167# CONFIG_PPC_MAPLE is not set 207# CONFIG_PPC_MAPLE is not set
168CONFIG_PPC_PASEMI=y 208CONFIG_PPC_PASEMI=y
@@ -178,8 +218,10 @@ CONFIG_PPC_PASEMI_MDIO=y
178# CONFIG_PPC_CELL_NATIVE is not set 218# CONFIG_PPC_CELL_NATIVE is not set
179# CONFIG_PPC_IBM_CELL_BLADE is not set 219# CONFIG_PPC_IBM_CELL_BLADE is not set
180# CONFIG_PPC_CELLEB is not set 220# CONFIG_PPC_CELLEB is not set
221# CONFIG_PPC_CELL_QPACE is not set
181# CONFIG_PQ2ADS is not set 222# CONFIG_PQ2ADS is not set
182CONFIG_PPC_NATIVE=y 223CONFIG_PPC_NATIVE=y
224CONFIG_PPC_OF_BOOT_TRAMPOLINE=y
183# CONFIG_IPIC is not set 225# CONFIG_IPIC is not set
184CONFIG_MPIC=y 226CONFIG_MPIC=y
185# CONFIG_MPIC_WEIRD is not set 227# CONFIG_MPIC_WEIRD is not set
@@ -213,6 +255,7 @@ CONFIG_CPU_FREQ_GOV_ONDEMAND=y
213# 255#
214CONFIG_PPC_PASEMI_CPUFREQ=y 256CONFIG_PPC_PASEMI_CPUFREQ=y
215# CONFIG_FSL_ULI1575 is not set 257# CONFIG_FSL_ULI1575 is not set
258# CONFIG_SIMPLE_GPIO is not set
216 259
217# 260#
218# Kernel options 261# Kernel options
@@ -226,16 +269,19 @@ CONFIG_GENERIC_CLOCKEVENTS_BUILD=y
226# CONFIG_HZ_300 is not set 269# CONFIG_HZ_300 is not set
227CONFIG_HZ_1000=y 270CONFIG_HZ_1000=y
228CONFIG_HZ=1000 271CONFIG_HZ=1000
229# CONFIG_SCHED_HRTICK is not set 272CONFIG_SCHED_HRTICK=y
230CONFIG_PREEMPT_NONE=y 273CONFIG_PREEMPT_NONE=y
231# CONFIG_PREEMPT_VOLUNTARY is not set 274# CONFIG_PREEMPT_VOLUNTARY is not set
232# CONFIG_PREEMPT is not set 275# CONFIG_PREEMPT is not set
233CONFIG_BINFMT_ELF=y 276CONFIG_BINFMT_ELF=y
234CONFIG_COMPAT_BINFMT_ELF=y 277CONFIG_COMPAT_BINFMT_ELF=y
278# CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set
279# CONFIG_HAVE_AOUT is not set
235# CONFIG_BINFMT_MISC is not set 280# CONFIG_BINFMT_MISC is not set
236CONFIG_HUGETLB_PAGE_SIZE_VARIABLE=y 281CONFIG_HUGETLB_PAGE_SIZE_VARIABLE=y
237CONFIG_IOMMU_VMERGE=y 282CONFIG_IOMMU_VMERGE=y
238CONFIG_IOMMU_HELPER=y 283CONFIG_IOMMU_HELPER=y
284# CONFIG_SWIOTLB is not set
239CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y 285CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y
240CONFIG_ARCH_HAS_WALK_MEMORY=y 286CONFIG_ARCH_HAS_WALK_MEMORY=y
241CONFIG_ARCH_ENABLE_MEMORY_HOTREMOVE=y 287CONFIG_ARCH_ENABLE_MEMORY_HOTREMOVE=y
@@ -243,6 +289,7 @@ CONFIG_ARCH_ENABLE_MEMORY_HOTREMOVE=y
243# CONFIG_CRASH_DUMP is not set 289# CONFIG_CRASH_DUMP is not set
244# CONFIG_IRQ_ALL_CPUS is not set 290# CONFIG_IRQ_ALL_CPUS is not set
245# CONFIG_NUMA is not set 291# CONFIG_NUMA is not set
292CONFIG_MAX_ACTIVE_REGIONS=256
246CONFIG_ARCH_SELECT_MEMORY_MODEL=y 293CONFIG_ARCH_SELECT_MEMORY_MODEL=y
247CONFIG_ARCH_FLATMEM_ENABLE=y 294CONFIG_ARCH_FLATMEM_ENABLE=y
248CONFIG_ARCH_SPARSEMEM_ENABLE=y 295CONFIG_ARCH_SPARSEMEM_ENABLE=y
@@ -253,20 +300,28 @@ CONFIG_FLATMEM_MANUAL=y
253# CONFIG_SPARSEMEM_MANUAL is not set 300# CONFIG_SPARSEMEM_MANUAL is not set
254CONFIG_FLATMEM=y 301CONFIG_FLATMEM=y
255CONFIG_FLAT_NODE_MEM_MAP=y 302CONFIG_FLAT_NODE_MEM_MAP=y
256# CONFIG_SPARSEMEM_STATIC is not set
257CONFIG_SPARSEMEM_VMEMMAP_ENABLE=y 303CONFIG_SPARSEMEM_VMEMMAP_ENABLE=y
258CONFIG_PAGEFLAGS_EXTENDED=y 304CONFIG_PAGEFLAGS_EXTENDED=y
259CONFIG_SPLIT_PTLOCK_CPUS=4 305CONFIG_SPLIT_PTLOCK_CPUS=4
260CONFIG_RESOURCES_64BIT=y 306CONFIG_MIGRATION=y
307CONFIG_PHYS_ADDR_T_64BIT=y
261CONFIG_ZONE_DMA_FLAG=1 308CONFIG_ZONE_DMA_FLAG=1
262CONFIG_BOUNCE=y 309CONFIG_BOUNCE=y
310CONFIG_HAVE_MLOCK=y
311CONFIG_HAVE_MLOCKED_PAGE_BIT=y
312# CONFIG_KSM is not set
313CONFIG_DEFAULT_MMAP_MIN_ADDR=4096
263CONFIG_PPC_HAS_HASH_64K=y 314CONFIG_PPC_HAS_HASH_64K=y
315# CONFIG_PPC_4K_PAGES is not set
316# CONFIG_PPC_16K_PAGES is not set
264CONFIG_PPC_64K_PAGES=y 317CONFIG_PPC_64K_PAGES=y
318# CONFIG_PPC_256K_PAGES is not set
265CONFIG_FORCE_MAX_ZONEORDER=9 319CONFIG_FORCE_MAX_ZONEORDER=9
266# CONFIG_PPC_SUBPAGE_PROT is not set 320# CONFIG_PPC_SUBPAGE_PROT is not set
267# CONFIG_SCHED_SMT is not set 321# CONFIG_SCHED_SMT is not set
268CONFIG_PROC_DEVICETREE=y 322CONFIG_PROC_DEVICETREE=y
269# CONFIG_CMDLINE_BOOL is not set 323# CONFIG_CMDLINE_BOOL is not set
324CONFIG_EXTRA_TARGETS=""
270# CONFIG_PM is not set 325# CONFIG_PM is not set
271# CONFIG_SECCOMP is not set 326# CONFIG_SECCOMP is not set
272CONFIG_ISA_DMA_API=y 327CONFIG_ISA_DMA_API=y
@@ -285,6 +340,8 @@ CONFIG_ARCH_SUPPORTS_MSI=y
285CONFIG_PCI_MSI=y 340CONFIG_PCI_MSI=y
286CONFIG_PCI_LEGACY=y 341CONFIG_PCI_LEGACY=y
287# CONFIG_PCI_DEBUG is not set 342# CONFIG_PCI_DEBUG is not set
343# CONFIG_PCI_STUB is not set
344# CONFIG_PCI_IOV is not set
288CONFIG_PCCARD=y 345CONFIG_PCCARD=y
289CONFIG_PCMCIA_DEBUG=y 346CONFIG_PCMCIA_DEBUG=y
290CONFIG_PCMCIA=y 347CONFIG_PCMCIA=y
@@ -301,13 +358,10 @@ CONFIG_CARDBUS=y
301CONFIG_ELECTRA_CF=y 358CONFIG_ELECTRA_CF=y
302# CONFIG_HOTPLUG_PCI is not set 359# CONFIG_HOTPLUG_PCI is not set
303# CONFIG_HAS_RAPIDIO is not set 360# CONFIG_HAS_RAPIDIO is not set
361# CONFIG_RELOCATABLE is not set
304CONFIG_PAGE_OFFSET=0xc000000000000000 362CONFIG_PAGE_OFFSET=0xc000000000000000
305CONFIG_KERNEL_START=0xc000000000000000 363CONFIG_KERNEL_START=0xc000000000000000
306CONFIG_PHYSICAL_START=0x00000000 364CONFIG_PHYSICAL_START=0x00000000
307
308#
309# Networking
310#
311CONFIG_NET=y 365CONFIG_NET=y
312 366
313# 367#
@@ -356,9 +410,11 @@ CONFIG_DEFAULT_TCP_CONG="cubic"
356# CONFIG_NETFILTER is not set 410# CONFIG_NETFILTER is not set
357# CONFIG_IP_DCCP is not set 411# CONFIG_IP_DCCP is not set
358# CONFIG_IP_SCTP is not set 412# CONFIG_IP_SCTP is not set
413# CONFIG_RDS is not set
359# CONFIG_TIPC is not set 414# CONFIG_TIPC is not set
360# CONFIG_ATM is not set 415# CONFIG_ATM is not set
361# CONFIG_BRIDGE is not set 416# CONFIG_BRIDGE is not set
417# CONFIG_NET_DSA is not set
362# CONFIG_VLAN_8021Q is not set 418# CONFIG_VLAN_8021Q is not set
363# CONFIG_DECNET is not set 419# CONFIG_DECNET is not set
364# CONFIG_LLC2 is not set 420# CONFIG_LLC2 is not set
@@ -368,25 +424,32 @@ CONFIG_DEFAULT_TCP_CONG="cubic"
368# CONFIG_LAPB is not set 424# CONFIG_LAPB is not set
369# CONFIG_ECONET is not set 425# CONFIG_ECONET is not set
370# CONFIG_WAN_ROUTER is not set 426# CONFIG_WAN_ROUTER is not set
427# CONFIG_PHONET is not set
428# CONFIG_IEEE802154 is not set
371# CONFIG_NET_SCHED is not set 429# CONFIG_NET_SCHED is not set
430# CONFIG_DCB is not set
372 431
373# 432#
374# Network testing 433# Network testing
375# 434#
376# CONFIG_NET_PKTGEN is not set 435# CONFIG_NET_PKTGEN is not set
436# CONFIG_NET_DROP_MONITOR is not set
377# CONFIG_HAMRADIO is not set 437# CONFIG_HAMRADIO is not set
378# CONFIG_CAN is not set 438# CONFIG_CAN is not set
379# CONFIG_IRDA is not set 439# CONFIG_IRDA is not set
380# CONFIG_BT is not set 440# CONFIG_BT is not set
381# CONFIG_AF_RXRPC is not set 441# CONFIG_AF_RXRPC is not set
442CONFIG_WIRELESS=y
443# CONFIG_CFG80211 is not set
444CONFIG_CFG80211_DEFAULT_PS_VALUE=0
445# CONFIG_WIRELESS_OLD_REGULATORY is not set
446# CONFIG_WIRELESS_EXT is not set
447# CONFIG_LIB80211 is not set
382 448
383# 449#
384# Wireless 450# CFG80211 needs to be enabled for MAC80211
385# 451#
386# CONFIG_CFG80211 is not set 452# CONFIG_WIMAX is not set
387# CONFIG_WIRELESS_EXT is not set
388# CONFIG_MAC80211 is not set
389# CONFIG_IEEE80211 is not set
390# CONFIG_RFKILL is not set 453# CONFIG_RFKILL is not set
391# CONFIG_NET_9P is not set 454# CONFIG_NET_9P is not set
392 455
@@ -398,15 +461,19 @@ CONFIG_DEFAULT_TCP_CONG="cubic"
398# Generic Driver Options 461# Generic Driver Options
399# 462#
400CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug" 463CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
464# CONFIG_DEVTMPFS is not set
401CONFIG_STANDALONE=y 465CONFIG_STANDALONE=y
402CONFIG_PREVENT_FIRMWARE_BUILD=y 466CONFIG_PREVENT_FIRMWARE_BUILD=y
403CONFIG_FW_LOADER=y 467CONFIG_FW_LOADER=y
468CONFIG_FIRMWARE_IN_KERNEL=y
469CONFIG_EXTRA_FIRMWARE=""
404# CONFIG_DEBUG_DRIVER is not set 470# CONFIG_DEBUG_DRIVER is not set
405# CONFIG_DEBUG_DEVRES is not set 471# CONFIG_DEBUG_DEVRES is not set
406# CONFIG_SYS_HYPERVISOR is not set 472# CONFIG_SYS_HYPERVISOR is not set
407# CONFIG_CONNECTOR is not set 473# CONFIG_CONNECTOR is not set
408CONFIG_MTD=y 474CONFIG_MTD=y
409# CONFIG_MTD_DEBUG is not set 475# CONFIG_MTD_DEBUG is not set
476# CONFIG_MTD_TESTS is not set
410CONFIG_MTD_CONCAT=y 477CONFIG_MTD_CONCAT=y
411# CONFIG_MTD_PARTITIONS is not set 478# CONFIG_MTD_PARTITIONS is not set
412 479
@@ -478,11 +545,17 @@ CONFIG_MTD_NAND_PASEMI=y
478# CONFIG_MTD_ONENAND is not set 545# CONFIG_MTD_ONENAND is not set
479 546
480# 547#
548# LPDDR flash memory drivers
549#
550# CONFIG_MTD_LPDDR is not set
551
552#
481# UBI - Unsorted block images 553# UBI - Unsorted block images
482# 554#
483# CONFIG_MTD_UBI is not set 555# CONFIG_MTD_UBI is not set
484CONFIG_OF_DEVICE=y 556CONFIG_OF_DEVICE=y
485CONFIG_OF_I2C=y 557CONFIG_OF_I2C=y
558CONFIG_OF_MDIO=y
486# CONFIG_PARPORT is not set 559# CONFIG_PARPORT is not set
487CONFIG_BLK_DEV=y 560CONFIG_BLK_DEV=y
488# CONFIG_BLK_DEV_FD is not set 561# CONFIG_BLK_DEV_FD is not set
@@ -501,29 +574,41 @@ CONFIG_BLK_DEV_RAM_SIZE=16384
501# CONFIG_BLK_DEV_XIP is not set 574# CONFIG_BLK_DEV_XIP is not set
502# CONFIG_CDROM_PKTCDVD is not set 575# CONFIG_CDROM_PKTCDVD is not set
503# CONFIG_ATA_OVER_ETH is not set 576# CONFIG_ATA_OVER_ETH is not set
577# CONFIG_BLK_DEV_HD is not set
504CONFIG_MISC_DEVICES=y 578CONFIG_MISC_DEVICES=y
505# CONFIG_PHANTOM is not set 579# CONFIG_PHANTOM is not set
506# CONFIG_EEPROM_93CX6 is not set
507# CONFIG_SGI_IOC4 is not set 580# CONFIG_SGI_IOC4 is not set
508# CONFIG_TIFM_CORE is not set 581# CONFIG_TIFM_CORE is not set
582# CONFIG_ICS932S401 is not set
509# CONFIG_ENCLOSURE_SERVICES is not set 583# CONFIG_ENCLOSURE_SERVICES is not set
584# CONFIG_HP_ILO is not set
585# CONFIG_ISL29003 is not set
586# CONFIG_C2PORT is not set
587
588#
589# EEPROM support
590#
591# CONFIG_EEPROM_AT24 is not set
592CONFIG_EEPROM_LEGACY=y
593# CONFIG_EEPROM_MAX6875 is not set
594# CONFIG_EEPROM_93CX6 is not set
595# CONFIG_CB710_CORE is not set
510CONFIG_HAVE_IDE=y 596CONFIG_HAVE_IDE=y
511CONFIG_IDE=y 597CONFIG_IDE=y
512CONFIG_BLK_DEV_IDE=y
513 598
514# 599#
515# Please see Documentation/ide/ide.txt for help/info on IDE drives 600# Please see Documentation/ide/ide.txt for help/info on IDE drives
516# 601#
602CONFIG_IDE_ATAPI=y
517# CONFIG_BLK_DEV_IDE_SATA is not set 603# CONFIG_BLK_DEV_IDE_SATA is not set
518CONFIG_BLK_DEV_IDEDISK=y 604CONFIG_IDE_GD=y
519CONFIG_IDEDISK_MULTI_MODE=y 605CONFIG_IDE_GD_ATA=y
606# CONFIG_IDE_GD_ATAPI is not set
520# CONFIG_BLK_DEV_IDECS is not set 607# CONFIG_BLK_DEV_IDECS is not set
521# CONFIG_BLK_DEV_DELKIN is not set 608# CONFIG_BLK_DEV_DELKIN is not set
522CONFIG_BLK_DEV_IDECD=y 609CONFIG_BLK_DEV_IDECD=y
523CONFIG_BLK_DEV_IDECD_VERBOSE_ERRORS=y 610CONFIG_BLK_DEV_IDECD_VERBOSE_ERRORS=y
524# CONFIG_BLK_DEV_IDETAPE is not set 611# CONFIG_BLK_DEV_IDETAPE is not set
525# CONFIG_BLK_DEV_IDEFLOPPY is not set
526CONFIG_BLK_DEV_IDESCSI=y
527CONFIG_IDE_TASK_IOCTL=y 612CONFIG_IDE_TASK_IOCTL=y
528CONFIG_IDE_PROC_FS=y 613CONFIG_IDE_PROC_FS=y
529 614
@@ -542,14 +627,13 @@ CONFIG_IDE_PROC_FS=y
542# CONFIG_BLK_DEV_AMD74XX is not set 627# CONFIG_BLK_DEV_AMD74XX is not set
543# CONFIG_BLK_DEV_CMD64X is not set 628# CONFIG_BLK_DEV_CMD64X is not set
544# CONFIG_BLK_DEV_TRIFLEX is not set 629# CONFIG_BLK_DEV_TRIFLEX is not set
545# CONFIG_BLK_DEV_CY82C693 is not set
546# CONFIG_BLK_DEV_CS5520 is not set 630# CONFIG_BLK_DEV_CS5520 is not set
547# CONFIG_BLK_DEV_CS5530 is not set 631# CONFIG_BLK_DEV_CS5530 is not set
548# CONFIG_BLK_DEV_HPT34X is not set
549# CONFIG_BLK_DEV_HPT366 is not set 632# CONFIG_BLK_DEV_HPT366 is not set
550# CONFIG_BLK_DEV_JMICRON is not set 633# CONFIG_BLK_DEV_JMICRON is not set
551# CONFIG_BLK_DEV_SC1200 is not set 634# CONFIG_BLK_DEV_SC1200 is not set
552# CONFIG_BLK_DEV_PIIX is not set 635# CONFIG_BLK_DEV_PIIX is not set
636# CONFIG_BLK_DEV_IT8172 is not set
553# CONFIG_BLK_DEV_IT8213 is not set 637# CONFIG_BLK_DEV_IT8213 is not set
554# CONFIG_BLK_DEV_IT821X is not set 638# CONFIG_BLK_DEV_IT821X is not set
555# CONFIG_BLK_DEV_NS87415 is not set 639# CONFIG_BLK_DEV_NS87415 is not set
@@ -563,8 +647,6 @@ CONFIG_IDE_PROC_FS=y
563# CONFIG_BLK_DEV_VIA82CXXX is not set 647# CONFIG_BLK_DEV_VIA82CXXX is not set
564# CONFIG_BLK_DEV_TC86C001 is not set 648# CONFIG_BLK_DEV_TC86C001 is not set
565# CONFIG_BLK_DEV_IDEDMA is not set 649# CONFIG_BLK_DEV_IDEDMA is not set
566# CONFIG_BLK_DEV_HD_ONLY is not set
567# CONFIG_BLK_DEV_HD is not set
568 650
569# 651#
570# SCSI device support 652# SCSI device support
@@ -586,10 +668,6 @@ CONFIG_BLK_DEV_SR=y
586CONFIG_BLK_DEV_SR_VENDOR=y 668CONFIG_BLK_DEV_SR_VENDOR=y
587CONFIG_CHR_DEV_SG=y 669CONFIG_CHR_DEV_SG=y
588CONFIG_CHR_DEV_SCH=y 670CONFIG_CHR_DEV_SCH=y
589
590#
591# Some SCSI devices (e.g. CD jukebox) support multiple LUNs
592#
593CONFIG_SCSI_MULTI_LUN=y 671CONFIG_SCSI_MULTI_LUN=y
594CONFIG_SCSI_CONSTANTS=y 672CONFIG_SCSI_CONSTANTS=y
595CONFIG_SCSI_LOGGING=y 673CONFIG_SCSI_LOGGING=y
@@ -606,6 +684,8 @@ CONFIG_SCSI_WAIT_SCAN=m
606# CONFIG_SCSI_SRP_ATTRS is not set 684# CONFIG_SCSI_SRP_ATTRS is not set
607CONFIG_SCSI_LOWLEVEL=y 685CONFIG_SCSI_LOWLEVEL=y
608# CONFIG_ISCSI_TCP is not set 686# CONFIG_ISCSI_TCP is not set
687# CONFIG_SCSI_CXGB3_ISCSI is not set
688# CONFIG_SCSI_BNX2_ISCSI is not set
609# CONFIG_BLK_DEV_3W_XXXX_RAID is not set 689# CONFIG_BLK_DEV_3W_XXXX_RAID is not set
610# CONFIG_SCSI_3W_9XXX is not set 690# CONFIG_SCSI_3W_9XXX is not set
611# CONFIG_SCSI_ACARD is not set 691# CONFIG_SCSI_ACARD is not set
@@ -614,11 +694,16 @@ CONFIG_SCSI_LOWLEVEL=y
614# CONFIG_SCSI_AIC7XXX_OLD is not set 694# CONFIG_SCSI_AIC7XXX_OLD is not set
615# CONFIG_SCSI_AIC79XX is not set 695# CONFIG_SCSI_AIC79XX is not set
616# CONFIG_SCSI_AIC94XX is not set 696# CONFIG_SCSI_AIC94XX is not set
697# CONFIG_SCSI_MVSAS is not set
617# CONFIG_SCSI_ARCMSR is not set 698# CONFIG_SCSI_ARCMSR is not set
618# CONFIG_MEGARAID_NEWGEN is not set 699# CONFIG_MEGARAID_NEWGEN is not set
619# CONFIG_MEGARAID_LEGACY is not set 700# CONFIG_MEGARAID_LEGACY is not set
620# CONFIG_MEGARAID_SAS is not set 701# CONFIG_MEGARAID_SAS is not set
702# CONFIG_SCSI_MPT2SAS is not set
621# CONFIG_SCSI_HPTIOP is not set 703# CONFIG_SCSI_HPTIOP is not set
704# CONFIG_LIBFC is not set
705# CONFIG_LIBFCOE is not set
706# CONFIG_FCOE is not set
622# CONFIG_SCSI_DMX3191D is not set 707# CONFIG_SCSI_DMX3191D is not set
623# CONFIG_SCSI_EATA is not set 708# CONFIG_SCSI_EATA is not set
624# CONFIG_SCSI_FUTURE_DOMAIN is not set 709# CONFIG_SCSI_FUTURE_DOMAIN is not set
@@ -626,7 +711,6 @@ CONFIG_SCSI_LOWLEVEL=y
626# CONFIG_SCSI_IPS is not set 711# CONFIG_SCSI_IPS is not set
627# CONFIG_SCSI_INITIO is not set 712# CONFIG_SCSI_INITIO is not set
628# CONFIG_SCSI_INIA100 is not set 713# CONFIG_SCSI_INIA100 is not set
629# CONFIG_SCSI_MVSAS is not set
630# CONFIG_SCSI_STEX is not set 714# CONFIG_SCSI_STEX is not set
631# CONFIG_SCSI_SYM53C8XX_2 is not set 715# CONFIG_SCSI_SYM53C8XX_2 is not set
632# CONFIG_SCSI_IPR is not set 716# CONFIG_SCSI_IPR is not set
@@ -637,10 +721,14 @@ CONFIG_SCSI_LOWLEVEL=y
637# CONFIG_SCSI_DC395x is not set 721# CONFIG_SCSI_DC395x is not set
638# CONFIG_SCSI_DC390T is not set 722# CONFIG_SCSI_DC390T is not set
639# CONFIG_SCSI_DEBUG is not set 723# CONFIG_SCSI_DEBUG is not set
724# CONFIG_SCSI_PMCRAID is not set
640# CONFIG_SCSI_SRP is not set 725# CONFIG_SCSI_SRP is not set
641# CONFIG_SCSI_LOWLEVEL_PCMCIA is not set 726# CONFIG_SCSI_LOWLEVEL_PCMCIA is not set
727# CONFIG_SCSI_DH is not set
728# CONFIG_SCSI_OSD_INITIATOR is not set
642CONFIG_ATA=y 729CONFIG_ATA=y
643# CONFIG_ATA_NONSTANDARD is not set 730# CONFIG_ATA_NONSTANDARD is not set
731CONFIG_ATA_VERBOSE_ERROR=y
644CONFIG_SATA_PMP=y 732CONFIG_SATA_PMP=y
645# CONFIG_SATA_AHCI is not set 733# CONFIG_SATA_AHCI is not set
646CONFIG_SATA_SIL24=y 734CONFIG_SATA_SIL24=y
@@ -662,6 +750,7 @@ CONFIG_SATA_MV=y
662# CONFIG_PATA_ALI is not set 750# CONFIG_PATA_ALI is not set
663# CONFIG_PATA_AMD is not set 751# CONFIG_PATA_AMD is not set
664# CONFIG_PATA_ARTOP is not set 752# CONFIG_PATA_ARTOP is not set
753# CONFIG_PATA_ATP867X is not set
665# CONFIG_PATA_ATIIXP is not set 754# CONFIG_PATA_ATIIXP is not set
666# CONFIG_PATA_CMD640_PCI is not set 755# CONFIG_PATA_CMD640_PCI is not set
667# CONFIG_PATA_CMD64X is not set 756# CONFIG_PATA_CMD64X is not set
@@ -690,6 +779,7 @@ CONFIG_ATA_GENERIC=y
690CONFIG_PATA_PCMCIA=y 779CONFIG_PATA_PCMCIA=y
691# CONFIG_PATA_PDC_OLD is not set 780# CONFIG_PATA_PDC_OLD is not set
692# CONFIG_PATA_RADISYS is not set 781# CONFIG_PATA_RADISYS is not set
782# CONFIG_PATA_RDC is not set
693# CONFIG_PATA_RZ1000 is not set 783# CONFIG_PATA_RZ1000 is not set
694# CONFIG_PATA_SC1200 is not set 784# CONFIG_PATA_SC1200 is not set
695# CONFIG_PATA_SERVERWORKS is not set 785# CONFIG_PATA_SERVERWORKS is not set
@@ -703,12 +793,15 @@ CONFIG_PATA_OF_PLATFORM=y
703# CONFIG_PATA_SCH is not set 793# CONFIG_PATA_SCH is not set
704CONFIG_MD=y 794CONFIG_MD=y
705CONFIG_BLK_DEV_MD=y 795CONFIG_BLK_DEV_MD=y
796CONFIG_MD_AUTODETECT=y
706CONFIG_MD_LINEAR=y 797CONFIG_MD_LINEAR=y
707CONFIG_MD_RAID0=y 798CONFIG_MD_RAID0=y
708CONFIG_MD_RAID1=y 799CONFIG_MD_RAID1=y
709CONFIG_MD_RAID10=y 800CONFIG_MD_RAID10=y
710CONFIG_MD_RAID456=y 801CONFIG_MD_RAID456=y
711CONFIG_MD_RAID5_RESHAPE=y 802# CONFIG_MULTICORE_RAID456 is not set
803CONFIG_MD_RAID6_PQ=y
804# CONFIG_ASYNC_RAID6_TEST is not set
712# CONFIG_MD_MULTIPATH is not set 805# CONFIG_MD_MULTIPATH is not set
713# CONFIG_MD_FAULTY is not set 806# CONFIG_MD_FAULTY is not set
714CONFIG_BLK_DEV_DM=y 807CONFIG_BLK_DEV_DM=y
@@ -725,12 +818,19 @@ CONFIG_DM_CRYPT=y
725# 818#
726# IEEE 1394 (FireWire) support 819# IEEE 1394 (FireWire) support
727# 820#
821
822#
823# You can enable one or both FireWire driver stacks.
824#
825
826#
827# See the help texts for more information.
828#
728# CONFIG_FIREWIRE is not set 829# CONFIG_FIREWIRE is not set
729# CONFIG_IEEE1394 is not set 830# CONFIG_IEEE1394 is not set
730# CONFIG_I2O is not set 831# CONFIG_I2O is not set
731# CONFIG_MACINTOSH_DRIVERS is not set 832# CONFIG_MACINTOSH_DRIVERS is not set
732CONFIG_NETDEVICES=y 833CONFIG_NETDEVICES=y
733# CONFIG_NETDEVICES_MULTIQUEUE is not set
734CONFIG_DUMMY=y 834CONFIG_DUMMY=y
735# CONFIG_BONDING is not set 835# CONFIG_BONDING is not set
736# CONFIG_MACVLAN is not set 836# CONFIG_MACVLAN is not set
@@ -753,6 +853,9 @@ CONFIG_MARVELL_PHY=y
753# CONFIG_BROADCOM_PHY is not set 853# CONFIG_BROADCOM_PHY is not set
754# CONFIG_ICPLUS_PHY is not set 854# CONFIG_ICPLUS_PHY is not set
755# CONFIG_REALTEK_PHY is not set 855# CONFIG_REALTEK_PHY is not set
856# CONFIG_NATIONAL_PHY is not set
857# CONFIG_STE10XP is not set
858# CONFIG_LSI_ET1011C_PHY is not set
756# CONFIG_FIXED_PHY is not set 859# CONFIG_FIXED_PHY is not set
757# CONFIG_MDIO_BITBANG is not set 860# CONFIG_MDIO_BITBANG is not set
758CONFIG_NET_ETHERNET=y 861CONFIG_NET_ETHERNET=y
@@ -761,19 +864,23 @@ CONFIG_MII=y
761# CONFIG_SUNGEM is not set 864# CONFIG_SUNGEM is not set
762# CONFIG_CASSINI is not set 865# CONFIG_CASSINI is not set
763# CONFIG_NET_VENDOR_3COM is not set 866# CONFIG_NET_VENDOR_3COM is not set
867# CONFIG_ETHOC is not set
868# CONFIG_DNET is not set
764# CONFIG_NET_TULIP is not set 869# CONFIG_NET_TULIP is not set
765# CONFIG_HP100 is not set 870# CONFIG_HP100 is not set
766# CONFIG_IBM_NEW_EMAC_ZMII is not set 871# CONFIG_IBM_NEW_EMAC_ZMII is not set
767# CONFIG_IBM_NEW_EMAC_RGMII is not set 872# CONFIG_IBM_NEW_EMAC_RGMII is not set
768# CONFIG_IBM_NEW_EMAC_TAH is not set 873# CONFIG_IBM_NEW_EMAC_TAH is not set
769# CONFIG_IBM_NEW_EMAC_EMAC4 is not set 874# CONFIG_IBM_NEW_EMAC_EMAC4 is not set
875# CONFIG_IBM_NEW_EMAC_NO_FLOW_CTRL is not set
876# CONFIG_IBM_NEW_EMAC_MAL_CLR_ICINTSTAT is not set
877# CONFIG_IBM_NEW_EMAC_MAL_COMMON_ERR is not set
770CONFIG_NET_PCI=y 878CONFIG_NET_PCI=y
771# CONFIG_PCNET32 is not set 879# CONFIG_PCNET32 is not set
772# CONFIG_AMD8111_ETH is not set 880# CONFIG_AMD8111_ETH is not set
773# CONFIG_ADAPTEC_STARFIRE is not set 881# CONFIG_ADAPTEC_STARFIRE is not set
774# CONFIG_B44 is not set 882# CONFIG_B44 is not set
775# CONFIG_FORCEDETH is not set 883# CONFIG_FORCEDETH is not set
776# CONFIG_EEPRO100 is not set
777# CONFIG_E100 is not set 884# CONFIG_E100 is not set
778# CONFIG_FEALNX is not set 885# CONFIG_FEALNX is not set
779# CONFIG_NATSEMI is not set 886# CONFIG_NATSEMI is not set
@@ -783,19 +890,22 @@ CONFIG_NET_PCI=y
783# CONFIG_R6040 is not set 890# CONFIG_R6040 is not set
784# CONFIG_SIS900 is not set 891# CONFIG_SIS900 is not set
785# CONFIG_EPIC100 is not set 892# CONFIG_EPIC100 is not set
893# CONFIG_SMSC9420 is not set
786# CONFIG_SUNDANCE is not set 894# CONFIG_SUNDANCE is not set
895# CONFIG_TLAN is not set
896# CONFIG_KS8842 is not set
897# CONFIG_KS8851_MLL is not set
787# CONFIG_VIA_RHINE is not set 898# CONFIG_VIA_RHINE is not set
788# CONFIG_SC92031 is not set 899# CONFIG_SC92031 is not set
900# CONFIG_ATL2 is not set
789CONFIG_NETDEV_1000=y 901CONFIG_NETDEV_1000=y
790# CONFIG_ACENIC is not set 902# CONFIG_ACENIC is not set
791# CONFIG_DL2K is not set 903# CONFIG_DL2K is not set
792CONFIG_E1000=y 904CONFIG_E1000=y
793CONFIG_E1000_NAPI=y
794# CONFIG_E1000_DISABLE_PACKET_SPLIT is not set
795# CONFIG_E1000E is not set 905# CONFIG_E1000E is not set
796# CONFIG_E1000E_ENABLED is not set
797# CONFIG_IP1000 is not set 906# CONFIG_IP1000 is not set
798# CONFIG_IGB is not set 907# CONFIG_IGB is not set
908# CONFIG_IGBVF is not set
799# CONFIG_NS83820 is not set 909# CONFIG_NS83820 is not set
800# CONFIG_HAMACHI is not set 910# CONFIG_HAMACHI is not set
801# CONFIG_YELLOWFIN is not set 911# CONFIG_YELLOWFIN is not set
@@ -806,30 +916,40 @@ CONFIG_E1000_NAPI=y
806# CONFIG_VIA_VELOCITY is not set 916# CONFIG_VIA_VELOCITY is not set
807CONFIG_TIGON3=y 917CONFIG_TIGON3=y
808# CONFIG_BNX2 is not set 918# CONFIG_BNX2 is not set
919# CONFIG_CNIC is not set
809# CONFIG_QLA3XXX is not set 920# CONFIG_QLA3XXX is not set
810# CONFIG_ATL1 is not set 921# CONFIG_ATL1 is not set
922# CONFIG_ATL1E is not set
923# CONFIG_ATL1C is not set
924# CONFIG_JME is not set
811CONFIG_NETDEV_10000=y 925CONFIG_NETDEV_10000=y
812# CONFIG_CHELSIO_T1 is not set 926# CONFIG_CHELSIO_T1 is not set
927CONFIG_CHELSIO_T3_DEPENDS=y
813# CONFIG_CHELSIO_T3 is not set 928# CONFIG_CHELSIO_T3 is not set
929# CONFIG_ENIC is not set
814# CONFIG_IXGBE is not set 930# CONFIG_IXGBE is not set
815# CONFIG_IXGB is not set 931# CONFIG_IXGB is not set
816# CONFIG_S2IO is not set 932# CONFIG_S2IO is not set
933# CONFIG_VXGE is not set
817# CONFIG_MYRI10GE is not set 934# CONFIG_MYRI10GE is not set
818# CONFIG_NETXEN_NIC is not set 935# CONFIG_NETXEN_NIC is not set
819# CONFIG_NIU is not set 936# CONFIG_NIU is not set
820CONFIG_PASEMI_MAC=y 937CONFIG_PASEMI_MAC=y
938# CONFIG_MLX4_EN is not set
821# CONFIG_MLX4_CORE is not set 939# CONFIG_MLX4_CORE is not set
822# CONFIG_TEHUTI is not set 940# CONFIG_TEHUTI is not set
823# CONFIG_BNX2X is not set 941# CONFIG_BNX2X is not set
942# CONFIG_QLGE is not set
824# CONFIG_SFC is not set 943# CONFIG_SFC is not set
944# CONFIG_BE2NET is not set
825# CONFIG_TR is not set 945# CONFIG_TR is not set
946CONFIG_WLAN=y
947# CONFIG_WLAN_PRE80211 is not set
948# CONFIG_WLAN_80211 is not set
826 949
827# 950#
828# Wireless LAN 951# Enable WiMAX (Networking options) to see the WiMAX drivers
829# 952#
830# CONFIG_WLAN_PRE80211 is not set
831# CONFIG_WLAN_80211 is not set
832# CONFIG_IWLWIFI_LEDS is not set
833 953
834# 954#
835# USB Network Adapters 955# USB Network Adapters
@@ -874,17 +994,23 @@ CONFIG_INPUT_EVDEV=y
874# Input Device Drivers 994# Input Device Drivers
875# 995#
876CONFIG_INPUT_KEYBOARD=y 996CONFIG_INPUT_KEYBOARD=y
997# CONFIG_KEYBOARD_ADP5588 is not set
877# CONFIG_KEYBOARD_ATKBD is not set 998# CONFIG_KEYBOARD_ATKBD is not set
878# CONFIG_KEYBOARD_SUNKBD is not set 999# CONFIG_QT2160 is not set
879# CONFIG_KEYBOARD_LKKBD is not set 1000# CONFIG_KEYBOARD_LKKBD is not set
880# CONFIG_KEYBOARD_XTKBD is not set 1001# CONFIG_KEYBOARD_MAX7359 is not set
881# CONFIG_KEYBOARD_NEWTON is not set 1002# CONFIG_KEYBOARD_NEWTON is not set
1003# CONFIG_KEYBOARD_OPENCORES is not set
882# CONFIG_KEYBOARD_STOWAWAY is not set 1004# CONFIG_KEYBOARD_STOWAWAY is not set
1005# CONFIG_KEYBOARD_SUNKBD is not set
1006# CONFIG_KEYBOARD_XTKBD is not set
883CONFIG_INPUT_MOUSE=y 1007CONFIG_INPUT_MOUSE=y
884# CONFIG_MOUSE_PS2 is not set 1008# CONFIG_MOUSE_PS2 is not set
885# CONFIG_MOUSE_SERIAL is not set 1009# CONFIG_MOUSE_SERIAL is not set
886# CONFIG_MOUSE_APPLETOUCH is not set 1010# CONFIG_MOUSE_APPLETOUCH is not set
1011# CONFIG_MOUSE_BCM5974 is not set
887# CONFIG_MOUSE_VSXXXAA is not set 1012# CONFIG_MOUSE_VSXXXAA is not set
1013# CONFIG_MOUSE_SYNAPTICS_I2C is not set
888# CONFIG_INPUT_JOYSTICK is not set 1014# CONFIG_INPUT_JOYSTICK is not set
889# CONFIG_INPUT_TABLET is not set 1015# CONFIG_INPUT_TABLET is not set
890# CONFIG_INPUT_TOUCHSCREEN is not set 1016# CONFIG_INPUT_TOUCHSCREEN is not set
@@ -900,6 +1026,7 @@ CONFIG_INPUT_MOUSE=y
900# Character devices 1026# Character devices
901# 1027#
902CONFIG_VT=y 1028CONFIG_VT=y
1029CONFIG_CONSOLE_TRANSLATIONS=y
903CONFIG_VT_CONSOLE=y 1030CONFIG_VT_CONSOLE=y
904CONFIG_HW_CONSOLE=y 1031CONFIG_HW_CONSOLE=y
905# CONFIG_VT_HW_CONSOLE_BINDING is not set 1032# CONFIG_VT_HW_CONSOLE_BINDING is not set
@@ -926,10 +1053,13 @@ CONFIG_SERIAL_CORE_CONSOLE=y
926# CONFIG_SERIAL_JSM is not set 1053# CONFIG_SERIAL_JSM is not set
927# CONFIG_SERIAL_OF_PLATFORM is not set 1054# CONFIG_SERIAL_OF_PLATFORM is not set
928CONFIG_UNIX98_PTYS=y 1055CONFIG_UNIX98_PTYS=y
1056# CONFIG_DEVPTS_MULTIPLE_INSTANCES is not set
929CONFIG_LEGACY_PTYS=y 1057CONFIG_LEGACY_PTYS=y
930CONFIG_LEGACY_PTY_COUNT=4 1058CONFIG_LEGACY_PTY_COUNT=4
1059# CONFIG_HVC_UDBG is not set
931# CONFIG_IPMI_HANDLER is not set 1060# CONFIG_IPMI_HANDLER is not set
932CONFIG_HW_RANDOM=y 1061CONFIG_HW_RANDOM=y
1062# CONFIG_HW_RANDOM_TIMERIOMEM is not set
933CONFIG_HW_RANDOM_PASEMI=y 1063CONFIG_HW_RANDOM_PASEMI=y
934# CONFIG_R3964 is not set 1064# CONFIG_R3964 is not set
935# CONFIG_APPLICOM is not set 1065# CONFIG_APPLICOM is not set
@@ -948,57 +1078,85 @@ CONFIG_MAX_RAW_DEVS=256
948CONFIG_DEVPORT=y 1078CONFIG_DEVPORT=y
949CONFIG_I2C=y 1079CONFIG_I2C=y
950CONFIG_I2C_BOARDINFO=y 1080CONFIG_I2C_BOARDINFO=y
1081CONFIG_I2C_COMPAT=y
951CONFIG_I2C_CHARDEV=y 1082CONFIG_I2C_CHARDEV=y
1083CONFIG_I2C_HELPER_AUTO=y
952CONFIG_I2C_ALGOBIT=y 1084CONFIG_I2C_ALGOBIT=y
953 1085
954# 1086#
955# I2C Hardware Bus support 1087# I2C Hardware Bus support
956# 1088#
1089
1090#
1091# PC SMBus host controller drivers
1092#
957# CONFIG_I2C_ALI1535 is not set 1093# CONFIG_I2C_ALI1535 is not set
958# CONFIG_I2C_ALI1563 is not set 1094# CONFIG_I2C_ALI1563 is not set
959# CONFIG_I2C_ALI15X3 is not set 1095# CONFIG_I2C_ALI15X3 is not set
960# CONFIG_I2C_AMD756 is not set 1096# CONFIG_I2C_AMD756 is not set
961# CONFIG_I2C_AMD8111 is not set 1097# CONFIG_I2C_AMD8111 is not set
962# CONFIG_I2C_I801 is not set 1098# CONFIG_I2C_I801 is not set
963# CONFIG_I2C_I810 is not set 1099# CONFIG_I2C_ISCH is not set
964# CONFIG_I2C_PIIX4 is not set 1100# CONFIG_I2C_PIIX4 is not set
965# CONFIG_I2C_NFORCE2 is not set 1101# CONFIG_I2C_NFORCE2 is not set
966# CONFIG_I2C_OCORES is not set
967# CONFIG_I2C_PARPORT_LIGHT is not set
968CONFIG_I2C_PASEMI=y
969# CONFIG_I2C_PROSAVAGE is not set
970# CONFIG_I2C_SAVAGE4 is not set
971# CONFIG_I2C_SIMTEC is not set
972# CONFIG_I2C_SIS5595 is not set 1102# CONFIG_I2C_SIS5595 is not set
973# CONFIG_I2C_SIS630 is not set 1103# CONFIG_I2C_SIS630 is not set
974# CONFIG_I2C_SIS96X is not set 1104# CONFIG_I2C_SIS96X is not set
975# CONFIG_I2C_TAOS_EVM is not set
976# CONFIG_I2C_STUB is not set
977# CONFIG_I2C_TINY_USB is not set
978# CONFIG_I2C_VIA is not set 1105# CONFIG_I2C_VIA is not set
979# CONFIG_I2C_VIAPRO is not set 1106# CONFIG_I2C_VIAPRO is not set
1107
1108#
1109# I2C system bus drivers (mostly embedded / system-on-chip)
1110#
1111# CONFIG_I2C_OCORES is not set
1112CONFIG_I2C_PASEMI=y
1113# CONFIG_I2C_SIMTEC is not set
1114
1115#
1116# External I2C/SMBus adapter drivers
1117#
1118# CONFIG_I2C_PARPORT_LIGHT is not set
1119# CONFIG_I2C_TAOS_EVM is not set
1120# CONFIG_I2C_TINY_USB is not set
1121
1122#
1123# Graphics adapter I2C/DDC channel drivers
1124#
980# CONFIG_I2C_VOODOO3 is not set 1125# CONFIG_I2C_VOODOO3 is not set
1126
1127#
1128# Other I2C/SMBus bus drivers
1129#
981# CONFIG_I2C_PCA_PLATFORM is not set 1130# CONFIG_I2C_PCA_PLATFORM is not set
1131# CONFIG_I2C_STUB is not set
982 1132
983# 1133#
984# Miscellaneous I2C Chip support 1134# Miscellaneous I2C Chip support
985# 1135#
986# CONFIG_DS1682 is not set 1136# CONFIG_DS1682 is not set
987CONFIG_EEPROM_LEGACY=y
988# CONFIG_SENSORS_PCF8574 is not set
989# CONFIG_PCF8575 is not set
990# CONFIG_SENSORS_PCF8591 is not set
991# CONFIG_SENSORS_MAX6875 is not set
992# CONFIG_SENSORS_TSL2550 is not set 1137# CONFIG_SENSORS_TSL2550 is not set
993# CONFIG_I2C_DEBUG_CORE is not set 1138# CONFIG_I2C_DEBUG_CORE is not set
994# CONFIG_I2C_DEBUG_ALGO is not set 1139# CONFIG_I2C_DEBUG_ALGO is not set
995# CONFIG_I2C_DEBUG_BUS is not set 1140# CONFIG_I2C_DEBUG_BUS is not set
996# CONFIG_I2C_DEBUG_CHIP is not set 1141# CONFIG_I2C_DEBUG_CHIP is not set
997# CONFIG_SPI is not set 1142# CONFIG_SPI is not set
1143
1144#
1145# PPS support
1146#
1147# CONFIG_PPS is not set
1148CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y
1149# CONFIG_GPIOLIB is not set
998# CONFIG_W1 is not set 1150# CONFIG_W1 is not set
999# CONFIG_POWER_SUPPLY is not set 1151# CONFIG_POWER_SUPPLY is not set
1000CONFIG_HWMON=y 1152CONFIG_HWMON=y
1001CONFIG_HWMON_VID=y 1153CONFIG_HWMON_VID=y
1154# CONFIG_HWMON_DEBUG_CHIP is not set
1155
1156#
1157# Native drivers
1158#
1159# CONFIG_SENSORS_AD7414 is not set
1002# CONFIG_SENSORS_AD7418 is not set 1160# CONFIG_SENSORS_AD7418 is not set
1003# CONFIG_SENSORS_ADM1021 is not set 1161# CONFIG_SENSORS_ADM1021 is not set
1004# CONFIG_SENSORS_ADM1025 is not set 1162# CONFIG_SENSORS_ADM1025 is not set
@@ -1006,14 +1164,17 @@ CONFIG_HWMON_VID=y
1006# CONFIG_SENSORS_ADM1029 is not set 1164# CONFIG_SENSORS_ADM1029 is not set
1007# CONFIG_SENSORS_ADM1031 is not set 1165# CONFIG_SENSORS_ADM1031 is not set
1008# CONFIG_SENSORS_ADM9240 is not set 1166# CONFIG_SENSORS_ADM9240 is not set
1167# CONFIG_SENSORS_ADT7462 is not set
1009# CONFIG_SENSORS_ADT7470 is not set 1168# CONFIG_SENSORS_ADT7470 is not set
1010# CONFIG_SENSORS_ADT7473 is not set 1169# CONFIG_SENSORS_ADT7473 is not set
1170# CONFIG_SENSORS_ADT7475 is not set
1011# CONFIG_SENSORS_ATXP1 is not set 1171# CONFIG_SENSORS_ATXP1 is not set
1012# CONFIG_SENSORS_DS1621 is not set 1172# CONFIG_SENSORS_DS1621 is not set
1013# CONFIG_SENSORS_I5K_AMB is not set 1173# CONFIG_SENSORS_I5K_AMB is not set
1014# CONFIG_SENSORS_F71805F is not set 1174# CONFIG_SENSORS_F71805F is not set
1015# CONFIG_SENSORS_F71882FG is not set 1175# CONFIG_SENSORS_F71882FG is not set
1016# CONFIG_SENSORS_F75375S is not set 1176# CONFIG_SENSORS_F75375S is not set
1177# CONFIG_SENSORS_G760A is not set
1017# CONFIG_SENSORS_GL518SM is not set 1178# CONFIG_SENSORS_GL518SM is not set
1018# CONFIG_SENSORS_GL520SM is not set 1179# CONFIG_SENSORS_GL520SM is not set
1019# CONFIG_SENSORS_IT87 is not set 1180# CONFIG_SENSORS_IT87 is not set
@@ -1028,10 +1189,14 @@ CONFIG_SENSORS_LM85=y
1028CONFIG_SENSORS_LM90=y 1189CONFIG_SENSORS_LM90=y
1029# CONFIG_SENSORS_LM92 is not set 1190# CONFIG_SENSORS_LM92 is not set
1030# CONFIG_SENSORS_LM93 is not set 1191# CONFIG_SENSORS_LM93 is not set
1192# CONFIG_SENSORS_LTC4215 is not set
1193# CONFIG_SENSORS_LTC4245 is not set
1194# CONFIG_SENSORS_LM95241 is not set
1031# CONFIG_SENSORS_MAX1619 is not set 1195# CONFIG_SENSORS_MAX1619 is not set
1032# CONFIG_SENSORS_MAX6650 is not set 1196# CONFIG_SENSORS_MAX6650 is not set
1033# CONFIG_SENSORS_PC87360 is not set 1197# CONFIG_SENSORS_PC87360 is not set
1034# CONFIG_SENSORS_PC87427 is not set 1198# CONFIG_SENSORS_PC87427 is not set
1199# CONFIG_SENSORS_PCF8591 is not set
1035# CONFIG_SENSORS_SIS5595 is not set 1200# CONFIG_SENSORS_SIS5595 is not set
1036# CONFIG_SENSORS_DME1737 is not set 1201# CONFIG_SENSORS_DME1737 is not set
1037# CONFIG_SENSORS_SMSC47M1 is not set 1202# CONFIG_SENSORS_SMSC47M1 is not set
@@ -1039,6 +1204,8 @@ CONFIG_SENSORS_LM90=y
1039# CONFIG_SENSORS_SMSC47B397 is not set 1204# CONFIG_SENSORS_SMSC47B397 is not set
1040# CONFIG_SENSORS_ADS7828 is not set 1205# CONFIG_SENSORS_ADS7828 is not set
1041# CONFIG_SENSORS_THMC50 is not set 1206# CONFIG_SENSORS_THMC50 is not set
1207# CONFIG_SENSORS_TMP401 is not set
1208# CONFIG_SENSORS_TMP421 is not set
1042# CONFIG_SENSORS_VIA686A is not set 1209# CONFIG_SENSORS_VIA686A is not set
1043# CONFIG_SENSORS_VT1211 is not set 1210# CONFIG_SENSORS_VT1211 is not set
1044# CONFIG_SENSORS_VT8231 is not set 1211# CONFIG_SENSORS_VT8231 is not set
@@ -1050,44 +1217,40 @@ CONFIG_SENSORS_LM90=y
1050# CONFIG_SENSORS_W83L786NG is not set 1217# CONFIG_SENSORS_W83L786NG is not set
1051# CONFIG_SENSORS_W83627HF is not set 1218# CONFIG_SENSORS_W83627HF is not set
1052# CONFIG_SENSORS_W83627EHF is not set 1219# CONFIG_SENSORS_W83627EHF is not set
1053# CONFIG_HWMON_DEBUG_CHIP is not set
1054# CONFIG_THERMAL is not set 1220# CONFIG_THERMAL is not set
1055# CONFIG_WATCHDOG is not set 1221# CONFIG_WATCHDOG is not set
1222CONFIG_SSB_POSSIBLE=y
1056 1223
1057# 1224#
1058# Sonics Silicon Backplane 1225# Sonics Silicon Backplane
1059# 1226#
1060CONFIG_SSB_POSSIBLE=y
1061# CONFIG_SSB is not set 1227# CONFIG_SSB is not set
1062 1228
1063# 1229#
1064# Multifunction device drivers 1230# Multifunction device drivers
1065# 1231#
1232# CONFIG_MFD_CORE is not set
1066# CONFIG_MFD_SM501 is not set 1233# CONFIG_MFD_SM501 is not set
1067# CONFIG_HTC_PASIC3 is not set 1234# CONFIG_HTC_PASIC3 is not set
1068 1235# CONFIG_TWL4030_CORE is not set
1069# 1236# CONFIG_MFD_TMIO is not set
1070# Multimedia devices 1237# CONFIG_PMIC_DA903X is not set
1071# 1238# CONFIG_MFD_WM8400 is not set
1072 1239# CONFIG_MFD_WM831X is not set
1073# 1240# CONFIG_MFD_WM8350_I2C is not set
1074# Multimedia core support 1241# CONFIG_MFD_PCF50633 is not set
1075# 1242# CONFIG_AB3100_CORE is not set
1076# CONFIG_VIDEO_DEV is not set 1243# CONFIG_REGULATOR is not set
1077# CONFIG_DVB_CORE is not set 1244# CONFIG_MEDIA_SUPPORT is not set
1078# CONFIG_VIDEO_MEDIA is not set
1079
1080#
1081# Multimedia drivers
1082#
1083CONFIG_DAB=y
1084# CONFIG_USB_DABUSB is not set
1085 1245
1086# 1246#
1087# Graphics support 1247# Graphics support
1088# 1248#
1089# CONFIG_AGP is not set 1249# CONFIG_AGP is not set
1250CONFIG_VGA_ARB=y
1090CONFIG_DRM=y 1251CONFIG_DRM=y
1252CONFIG_DRM_KMS_HELPER=y
1253CONFIG_DRM_TTM=y
1091# CONFIG_DRM_TDFX is not set 1254# CONFIG_DRM_TDFX is not set
1092# CONFIG_DRM_R128 is not set 1255# CONFIG_DRM_R128 is not set
1093CONFIG_DRM_RADEON=y 1256CONFIG_DRM_RADEON=y
@@ -1099,6 +1262,7 @@ CONFIG_VGASTATE=y
1099CONFIG_FB=y 1262CONFIG_FB=y
1100CONFIG_FIRMWARE_EDID=y 1263CONFIG_FIRMWARE_EDID=y
1101CONFIG_FB_DDC=y 1264CONFIG_FB_DDC=y
1265# CONFIG_FB_BOOT_VESA_SUPPORT is not set
1102CONFIG_FB_CFB_FILLRECT=y 1266CONFIG_FB_CFB_FILLRECT=y
1103CONFIG_FB_CFB_COPYAREA=y 1267CONFIG_FB_CFB_COPYAREA=y
1104CONFIG_FB_CFB_IMAGEBLIT=y 1268CONFIG_FB_CFB_IMAGEBLIT=y
@@ -1140,6 +1304,7 @@ CONFIG_FB_RADEON_BACKLIGHT=y
1140# CONFIG_FB_S3 is not set 1304# CONFIG_FB_S3 is not set
1141# CONFIG_FB_SAVAGE is not set 1305# CONFIG_FB_SAVAGE is not set
1142# CONFIG_FB_SIS is not set 1306# CONFIG_FB_SIS is not set
1307# CONFIG_FB_VIA is not set
1143# CONFIG_FB_NEOMAGIC is not set 1308# CONFIG_FB_NEOMAGIC is not set
1144# CONFIG_FB_KYRO is not set 1309# CONFIG_FB_KYRO is not set
1145# CONFIG_FB_3DFX is not set 1310# CONFIG_FB_3DFX is not set
@@ -1148,12 +1313,16 @@ CONFIG_FB_RADEON_BACKLIGHT=y
1148# CONFIG_FB_TRIDENT is not set 1313# CONFIG_FB_TRIDENT is not set
1149# CONFIG_FB_ARK is not set 1314# CONFIG_FB_ARK is not set
1150# CONFIG_FB_PM3 is not set 1315# CONFIG_FB_PM3 is not set
1316# CONFIG_FB_CARMINE is not set
1151# CONFIG_FB_IBM_GXT4500 is not set 1317# CONFIG_FB_IBM_GXT4500 is not set
1152# CONFIG_FB_VIRTUAL is not set 1318# CONFIG_FB_VIRTUAL is not set
1319# CONFIG_FB_METRONOME is not set
1320# CONFIG_FB_MB862XX is not set
1321# CONFIG_FB_BROADSHEET is not set
1153CONFIG_BACKLIGHT_LCD_SUPPORT=y 1322CONFIG_BACKLIGHT_LCD_SUPPORT=y
1154# CONFIG_LCD_CLASS_DEVICE is not set 1323# CONFIG_LCD_CLASS_DEVICE is not set
1155CONFIG_BACKLIGHT_CLASS_DEVICE=y 1324CONFIG_BACKLIGHT_CLASS_DEVICE=y
1156# CONFIG_BACKLIGHT_CORGI is not set 1325CONFIG_BACKLIGHT_GENERIC=y
1157 1326
1158# 1327#
1159# Display device support 1328# Display device support
@@ -1177,15 +1346,9 @@ CONFIG_LOGO=y
1177CONFIG_LOGO_LINUX_MONO=y 1346CONFIG_LOGO_LINUX_MONO=y
1178CONFIG_LOGO_LINUX_VGA16=y 1347CONFIG_LOGO_LINUX_VGA16=y
1179CONFIG_LOGO_LINUX_CLUT224=y 1348CONFIG_LOGO_LINUX_CLUT224=y
1180
1181#
1182# Sound
1183#
1184CONFIG_SOUND=y 1349CONFIG_SOUND=y
1185 1350CONFIG_SOUND_OSS_CORE=y
1186# 1351CONFIG_SOUND_OSS_CORE_PRECLAIM=y
1187# Advanced Linux Sound Architecture
1188#
1189CONFIG_SND=y 1352CONFIG_SND=y
1190CONFIG_SND_TIMER=y 1353CONFIG_SND_TIMER=y
1191CONFIG_SND_PCM=y 1354CONFIG_SND_PCM=y
@@ -1198,24 +1361,24 @@ CONFIG_SND_MIXER_OSS=y
1198CONFIG_SND_PCM_OSS=y 1361CONFIG_SND_PCM_OSS=y
1199CONFIG_SND_PCM_OSS_PLUGINS=y 1362CONFIG_SND_PCM_OSS_PLUGINS=y
1200CONFIG_SND_SEQUENCER_OSS=y 1363CONFIG_SND_SEQUENCER_OSS=y
1364# CONFIG_SND_HRTIMER is not set
1201# CONFIG_SND_DYNAMIC_MINORS is not set 1365# CONFIG_SND_DYNAMIC_MINORS is not set
1202CONFIG_SND_SUPPORT_OLD_API=y 1366CONFIG_SND_SUPPORT_OLD_API=y
1203CONFIG_SND_VERBOSE_PROCFS=y 1367CONFIG_SND_VERBOSE_PROCFS=y
1204# CONFIG_SND_VERBOSE_PRINTK is not set 1368# CONFIG_SND_VERBOSE_PRINTK is not set
1205# CONFIG_SND_DEBUG is not set 1369# CONFIG_SND_DEBUG is not set
1206 1370CONFIG_SND_RAWMIDI_SEQ=y
1207# 1371# CONFIG_SND_OPL3_LIB_SEQ is not set
1208# Generic devices 1372# CONFIG_SND_OPL4_LIB_SEQ is not set
1209# 1373# CONFIG_SND_SBAWE_SEQ is not set
1374# CONFIG_SND_EMU10K1_SEQ is not set
1375CONFIG_SND_DRIVERS=y
1210# CONFIG_SND_DUMMY is not set 1376# CONFIG_SND_DUMMY is not set
1211# CONFIG_SND_VIRMIDI is not set 1377# CONFIG_SND_VIRMIDI is not set
1212# CONFIG_SND_MTPAV is not set 1378# CONFIG_SND_MTPAV is not set
1213# CONFIG_SND_SERIAL_U16550 is not set 1379# CONFIG_SND_SERIAL_U16550 is not set
1214# CONFIG_SND_MPU401 is not set 1380# CONFIG_SND_MPU401 is not set
1215 1381CONFIG_SND_PCI=y
1216#
1217# PCI devices
1218#
1219# CONFIG_SND_AD1889 is not set 1382# CONFIG_SND_AD1889 is not set
1220# CONFIG_SND_ALS300 is not set 1383# CONFIG_SND_ALS300 is not set
1221# CONFIG_SND_ALS4000 is not set 1384# CONFIG_SND_ALS4000 is not set
@@ -1234,6 +1397,7 @@ CONFIG_SND_VERBOSE_PROCFS=y
1234# CONFIG_SND_CS4281 is not set 1397# CONFIG_SND_CS4281 is not set
1235# CONFIG_SND_CS46XX is not set 1398# CONFIG_SND_CS46XX is not set
1236# CONFIG_SND_CS5530 is not set 1399# CONFIG_SND_CS5530 is not set
1400# CONFIG_SND_CTXFI is not set
1237# CONFIG_SND_DARLA20 is not set 1401# CONFIG_SND_DARLA20 is not set
1238# CONFIG_SND_GINA20 is not set 1402# CONFIG_SND_GINA20 is not set
1239# CONFIG_SND_LAYLA20 is not set 1403# CONFIG_SND_LAYLA20 is not set
@@ -1246,6 +1410,8 @@ CONFIG_SND_VERBOSE_PROCFS=y
1246# CONFIG_SND_INDIGO is not set 1410# CONFIG_SND_INDIGO is not set
1247# CONFIG_SND_INDIGOIO is not set 1411# CONFIG_SND_INDIGOIO is not set
1248# CONFIG_SND_INDIGODJ is not set 1412# CONFIG_SND_INDIGODJ is not set
1413# CONFIG_SND_INDIGOIOX is not set
1414# CONFIG_SND_INDIGODJX is not set
1249# CONFIG_SND_EMU10K1 is not set 1415# CONFIG_SND_EMU10K1 is not set
1250# CONFIG_SND_EMU10K1X is not set 1416# CONFIG_SND_EMU10K1X is not set
1251# CONFIG_SND_ENS1370 is not set 1417# CONFIG_SND_ENS1370 is not set
@@ -1262,6 +1428,7 @@ CONFIG_SND_VERBOSE_PROCFS=y
1262# CONFIG_SND_INTEL8X0 is not set 1428# CONFIG_SND_INTEL8X0 is not set
1263# CONFIG_SND_INTEL8X0M is not set 1429# CONFIG_SND_INTEL8X0M is not set
1264# CONFIG_SND_KORG1212 is not set 1430# CONFIG_SND_KORG1212 is not set
1431# CONFIG_SND_LX6464ES is not set
1265# CONFIG_SND_MAESTRO3 is not set 1432# CONFIG_SND_MAESTRO3 is not set
1266# CONFIG_SND_MIXART is not set 1433# CONFIG_SND_MIXART is not set
1267# CONFIG_SND_NM256 is not set 1434# CONFIG_SND_NM256 is not set
@@ -1277,57 +1444,64 @@ CONFIG_SND_VERBOSE_PROCFS=y
1277# CONFIG_SND_VIRTUOSO is not set 1444# CONFIG_SND_VIRTUOSO is not set
1278# CONFIG_SND_VX222 is not set 1445# CONFIG_SND_VX222 is not set
1279# CONFIG_SND_YMFPCI is not set 1446# CONFIG_SND_YMFPCI is not set
1280 1447CONFIG_SND_PPC=y
1281# 1448CONFIG_SND_USB=y
1282# ALSA PowerMac devices
1283#
1284
1285#
1286# ALSA PowerPC devices
1287#
1288
1289#
1290# USB devices
1291#
1292CONFIG_SND_USB_AUDIO=y 1449CONFIG_SND_USB_AUDIO=y
1293CONFIG_SND_USB_USX2Y=y 1450CONFIG_SND_USB_USX2Y=y
1294# CONFIG_SND_USB_CAIAQ is not set 1451# CONFIG_SND_USB_CAIAQ is not set
1295 1452CONFIG_SND_PCMCIA=y
1296#
1297# PCMCIA devices
1298#
1299# CONFIG_SND_VXPOCKET is not set 1453# CONFIG_SND_VXPOCKET is not set
1300# CONFIG_SND_PDAUDIOCF is not set 1454# CONFIG_SND_PDAUDIOCF is not set
1301
1302#
1303# System on Chip audio support
1304#
1305# CONFIG_SND_SOC is not set 1455# CONFIG_SND_SOC is not set
1306
1307#
1308# ALSA SoC audio for Freescale SOCs
1309#
1310
1311#
1312# SoC Audio for the Texas Instruments OMAP
1313#
1314
1315#
1316# Open Sound System
1317#
1318# CONFIG_SOUND_PRIME is not set 1456# CONFIG_SOUND_PRIME is not set
1319CONFIG_HID_SUPPORT=y 1457CONFIG_HID_SUPPORT=y
1320CONFIG_HID=y 1458CONFIG_HID=y
1321# CONFIG_HID_DEBUG is not set
1322# CONFIG_HIDRAW is not set 1459# CONFIG_HIDRAW is not set
1323 1460
1324# 1461#
1325# USB Input Devices 1462# USB Input Devices
1326# 1463#
1327CONFIG_USB_HID=y 1464CONFIG_USB_HID=y
1328# CONFIG_USB_HIDINPUT_POWERBOOK is not set 1465# CONFIG_HID_PID is not set
1329# CONFIG_HID_FF is not set
1330# CONFIG_USB_HIDDEV is not set 1466# CONFIG_USB_HIDDEV is not set
1467
1468#
1469# Special HID drivers
1470#
1471CONFIG_HID_A4TECH=y
1472CONFIG_HID_APPLE=y
1473CONFIG_HID_BELKIN=y
1474CONFIG_HID_CHERRY=y
1475CONFIG_HID_CHICONY=y
1476CONFIG_HID_CYPRESS=y
1477CONFIG_HID_DRAGONRISE=y
1478# CONFIG_DRAGONRISE_FF is not set
1479CONFIG_HID_EZKEY=y
1480CONFIG_HID_KYE=y
1481CONFIG_HID_GYRATION=y
1482CONFIG_HID_TWINHAN=y
1483CONFIG_HID_KENSINGTON=y
1484CONFIG_HID_LOGITECH=y
1485# CONFIG_LOGITECH_FF is not set
1486# CONFIG_LOGIRUMBLEPAD2_FF is not set
1487CONFIG_HID_MICROSOFT=y
1488CONFIG_HID_MONTEREY=y
1489CONFIG_HID_NTRIG=y
1490CONFIG_HID_PANTHERLORD=y
1491# CONFIG_PANTHERLORD_FF is not set
1492CONFIG_HID_PETALYNX=y
1493CONFIG_HID_SAMSUNG=y
1494CONFIG_HID_SONY=y
1495CONFIG_HID_SUNPLUS=y
1496CONFIG_HID_GREENASIA=y
1497# CONFIG_GREENASIA_FF is not set
1498CONFIG_HID_SMARTJOYPLUS=y
1499# CONFIG_SMARTJOYPLUS_FF is not set
1500CONFIG_HID_TOPSEED=y
1501CONFIG_HID_THRUSTMASTER=y
1502# CONFIG_THRUSTMASTER_FF is not set
1503CONFIG_HID_ZEROPLUS=y
1504# CONFIG_ZEROPLUS_FF is not set
1331CONFIG_USB_SUPPORT=y 1505CONFIG_USB_SUPPORT=y
1332CONFIG_USB_ARCH_HAS_HCD=y 1506CONFIG_USB_ARCH_HAS_HCD=y
1333CONFIG_USB_ARCH_HAS_OHCI=y 1507CONFIG_USB_ARCH_HAS_OHCI=y
@@ -1343,18 +1517,26 @@ CONFIG_USB_DEVICEFS=y
1343# CONFIG_USB_DEVICE_CLASS is not set 1517# CONFIG_USB_DEVICE_CLASS is not set
1344# CONFIG_USB_DYNAMIC_MINORS is not set 1518# CONFIG_USB_DYNAMIC_MINORS is not set
1345# CONFIG_USB_OTG is not set 1519# CONFIG_USB_OTG is not set
1520# CONFIG_USB_MON is not set
1521# CONFIG_USB_WUSB is not set
1522# CONFIG_USB_WUSB_CBAF is not set
1346 1523
1347# 1524#
1348# USB Host Controller Drivers 1525# USB Host Controller Drivers
1349# 1526#
1350# CONFIG_USB_C67X00_HCD is not set 1527# CONFIG_USB_C67X00_HCD is not set
1528# CONFIG_USB_XHCI_HCD is not set
1351CONFIG_USB_EHCI_HCD=y 1529CONFIG_USB_EHCI_HCD=y
1352# CONFIG_USB_EHCI_ROOT_HUB_TT is not set 1530# CONFIG_USB_EHCI_ROOT_HUB_TT is not set
1353# CONFIG_USB_EHCI_TT_NEWSCHED is not set 1531# CONFIG_USB_EHCI_TT_NEWSCHED is not set
1354CONFIG_USB_EHCI_HCD_PPC_OF=y 1532CONFIG_USB_EHCI_HCD_PPC_OF=y
1533# CONFIG_USB_OXU210HP_HCD is not set
1355# CONFIG_USB_ISP116X_HCD is not set 1534# CONFIG_USB_ISP116X_HCD is not set
1356# CONFIG_USB_ISP1760_HCD is not set 1535# CONFIG_USB_ISP1760_HCD is not set
1536# CONFIG_USB_ISP1362_HCD is not set
1357CONFIG_USB_OHCI_HCD=y 1537CONFIG_USB_OHCI_HCD=y
1538# CONFIG_USB_OHCI_HCD_PPC_OF_BE is not set
1539# CONFIG_USB_OHCI_HCD_PPC_OF_LE is not set
1358# CONFIG_USB_OHCI_HCD_PPC_OF is not set 1540# CONFIG_USB_OHCI_HCD_PPC_OF is not set
1359# CONFIG_USB_OHCI_BIG_ENDIAN_DESC is not set 1541# CONFIG_USB_OHCI_BIG_ENDIAN_DESC is not set
1360# CONFIG_USB_OHCI_BIG_ENDIAN_MMIO is not set 1542# CONFIG_USB_OHCI_BIG_ENDIAN_MMIO is not set
@@ -1363,6 +1545,8 @@ CONFIG_USB_UHCI_HCD=y
1363CONFIG_USB_SL811_HCD=y 1545CONFIG_USB_SL811_HCD=y
1364# CONFIG_USB_SL811_CS is not set 1546# CONFIG_USB_SL811_CS is not set
1365# CONFIG_USB_R8A66597_HCD is not set 1547# CONFIG_USB_R8A66597_HCD is not set
1548# CONFIG_USB_WHCI_HCD is not set
1549# CONFIG_USB_HWA_HCD is not set
1366 1550
1367# 1551#
1368# USB Device Class drivers 1552# USB Device Class drivers
@@ -1370,20 +1554,20 @@ CONFIG_USB_SL811_HCD=y
1370# CONFIG_USB_ACM is not set 1554# CONFIG_USB_ACM is not set
1371# CONFIG_USB_PRINTER is not set 1555# CONFIG_USB_PRINTER is not set
1372# CONFIG_USB_WDM is not set 1556# CONFIG_USB_WDM is not set
1557# CONFIG_USB_TMC is not set
1373 1558
1374# 1559#
1375# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support' 1560# NOTE: USB_STORAGE depends on SCSI but BLK_DEV_SD may
1376# 1561#
1377 1562
1378# 1563#
1379# may also be needed; see USB_STORAGE Help for more information 1564# also be needed; see USB_STORAGE Help for more info
1380# 1565#
1381CONFIG_USB_STORAGE=y 1566CONFIG_USB_STORAGE=y
1382# CONFIG_USB_STORAGE_DEBUG is not set 1567# CONFIG_USB_STORAGE_DEBUG is not set
1383# CONFIG_USB_STORAGE_DATAFAB is not set 1568# CONFIG_USB_STORAGE_DATAFAB is not set
1384# CONFIG_USB_STORAGE_FREECOM is not set 1569# CONFIG_USB_STORAGE_FREECOM is not set
1385# CONFIG_USB_STORAGE_ISD200 is not set 1570# CONFIG_USB_STORAGE_ISD200 is not set
1386# CONFIG_USB_STORAGE_DPCM is not set
1387# CONFIG_USB_STORAGE_USBAT is not set 1571# CONFIG_USB_STORAGE_USBAT is not set
1388# CONFIG_USB_STORAGE_SDDR09 is not set 1572# CONFIG_USB_STORAGE_SDDR09 is not set
1389# CONFIG_USB_STORAGE_SDDR55 is not set 1573# CONFIG_USB_STORAGE_SDDR55 is not set
@@ -1399,7 +1583,6 @@ CONFIG_USB_LIBUSUAL=y
1399# 1583#
1400# CONFIG_USB_MDC800 is not set 1584# CONFIG_USB_MDC800 is not set
1401# CONFIG_USB_MICROTEK is not set 1585# CONFIG_USB_MICROTEK is not set
1402# CONFIG_USB_MON is not set
1403 1586
1404# 1587#
1405# USB port drivers 1588# USB port drivers
@@ -1412,7 +1595,7 @@ CONFIG_USB_LIBUSUAL=y
1412# CONFIG_USB_EMI62 is not set 1595# CONFIG_USB_EMI62 is not set
1413# CONFIG_USB_EMI26 is not set 1596# CONFIG_USB_EMI26 is not set
1414# CONFIG_USB_ADUTUX is not set 1597# CONFIG_USB_ADUTUX is not set
1415# CONFIG_USB_AUERSWALD is not set 1598# CONFIG_USB_SEVSEG is not set
1416# CONFIG_USB_RIO500 is not set 1599# CONFIG_USB_RIO500 is not set
1417# CONFIG_USB_LEGOTOWER is not set 1600# CONFIG_USB_LEGOTOWER is not set
1418# CONFIG_USB_LCD is not set 1601# CONFIG_USB_LCD is not set
@@ -1420,7 +1603,6 @@ CONFIG_USB_LIBUSUAL=y
1420# CONFIG_USB_LED is not set 1603# CONFIG_USB_LED is not set
1421# CONFIG_USB_CYPRESS_CY7C63 is not set 1604# CONFIG_USB_CYPRESS_CY7C63 is not set
1422# CONFIG_USB_CYTHERM is not set 1605# CONFIG_USB_CYTHERM is not set
1423# CONFIG_USB_PHIDGET is not set
1424# CONFIG_USB_IDMOUSE is not set 1606# CONFIG_USB_IDMOUSE is not set
1425# CONFIG_USB_FTDI_ELAN is not set 1607# CONFIG_USB_FTDI_ELAN is not set
1426# CONFIG_USB_APPLEDISPLAY is not set 1608# CONFIG_USB_APPLEDISPLAY is not set
@@ -1429,7 +1611,15 @@ CONFIG_USB_LIBUSUAL=y
1429# CONFIG_USB_TRANCEVIBRATOR is not set 1611# CONFIG_USB_TRANCEVIBRATOR is not set
1430# CONFIG_USB_IOWARRIOR is not set 1612# CONFIG_USB_IOWARRIOR is not set
1431# CONFIG_USB_TEST is not set 1613# CONFIG_USB_TEST is not set
1614# CONFIG_USB_ISIGHTFW is not set
1615# CONFIG_USB_VST is not set
1432# CONFIG_USB_GADGET is not set 1616# CONFIG_USB_GADGET is not set
1617
1618#
1619# OTG and related infrastructure
1620#
1621# CONFIG_NOP_USB_XCEIV is not set
1622# CONFIG_UWB is not set
1433# CONFIG_MMC is not set 1623# CONFIG_MMC is not set
1434# CONFIG_MEMSTICK is not set 1624# CONFIG_MEMSTICK is not set
1435# CONFIG_NEW_LEDS is not set 1625# CONFIG_NEW_LEDS is not set
@@ -1443,6 +1633,7 @@ CONFIG_EDAC=y
1443# CONFIG_EDAC_DEBUG is not set 1633# CONFIG_EDAC_DEBUG is not set
1444CONFIG_EDAC_MM_EDAC=y 1634CONFIG_EDAC_MM_EDAC=y
1445CONFIG_EDAC_PASEMI=y 1635CONFIG_EDAC_PASEMI=y
1636# CONFIG_EDAC_CPC925 is not set
1446CONFIG_RTC_LIB=y 1637CONFIG_RTC_LIB=y
1447CONFIG_RTC_CLASS=y 1638CONFIG_RTC_CLASS=y
1448CONFIG_RTC_HCTOSYS=y 1639CONFIG_RTC_HCTOSYS=y
@@ -1472,6 +1663,9 @@ CONFIG_RTC_DRV_DS1307=y
1472# CONFIG_RTC_DRV_PCF8583 is not set 1663# CONFIG_RTC_DRV_PCF8583 is not set
1473# CONFIG_RTC_DRV_M41T80 is not set 1664# CONFIG_RTC_DRV_M41T80 is not set
1474# CONFIG_RTC_DRV_S35390A is not set 1665# CONFIG_RTC_DRV_S35390A is not set
1666# CONFIG_RTC_DRV_FM3130 is not set
1667# CONFIG_RTC_DRV_RX8581 is not set
1668# CONFIG_RTC_DRV_RX8025 is not set
1475 1669
1476# 1670#
1477# SPI RTC drivers 1671# SPI RTC drivers
@@ -1481,21 +1675,31 @@ CONFIG_RTC_DRV_DS1307=y
1481# Platform RTC drivers 1675# Platform RTC drivers
1482# 1676#
1483# CONFIG_RTC_DRV_CMOS is not set 1677# CONFIG_RTC_DRV_CMOS is not set
1678# CONFIG_RTC_DRV_DS1286 is not set
1484# CONFIG_RTC_DRV_DS1511 is not set 1679# CONFIG_RTC_DRV_DS1511 is not set
1485# CONFIG_RTC_DRV_DS1553 is not set 1680# CONFIG_RTC_DRV_DS1553 is not set
1486# CONFIG_RTC_DRV_DS1742 is not set 1681# CONFIG_RTC_DRV_DS1742 is not set
1487# CONFIG_RTC_DRV_STK17TA8 is not set 1682# CONFIG_RTC_DRV_STK17TA8 is not set
1488# CONFIG_RTC_DRV_M48T86 is not set 1683# CONFIG_RTC_DRV_M48T86 is not set
1684# CONFIG_RTC_DRV_M48T35 is not set
1489# CONFIG_RTC_DRV_M48T59 is not set 1685# CONFIG_RTC_DRV_M48T59 is not set
1686# CONFIG_RTC_DRV_BQ4802 is not set
1490# CONFIG_RTC_DRV_V3020 is not set 1687# CONFIG_RTC_DRV_V3020 is not set
1491 1688
1492# 1689#
1493# on-CPU RTC drivers 1690# on-CPU RTC drivers
1494# 1691#
1692# CONFIG_RTC_DRV_GENERIC is not set
1495# CONFIG_DMADEVICES is not set 1693# CONFIG_DMADEVICES is not set
1694# CONFIG_AUXDISPLAY is not set
1496# CONFIG_UIO is not set 1695# CONFIG_UIO is not set
1497 1696
1498# 1697#
1698# TI VLYNQ
1699#
1700# CONFIG_STAGING is not set
1701
1702#
1499# File systems 1703# File systems
1500# 1704#
1501CONFIG_EXT2_FS=y 1705CONFIG_EXT2_FS=y
@@ -1504,11 +1708,13 @@ CONFIG_EXT2_FS_POSIX_ACL=y
1504# CONFIG_EXT2_FS_SECURITY is not set 1708# CONFIG_EXT2_FS_SECURITY is not set
1505# CONFIG_EXT2_FS_XIP is not set 1709# CONFIG_EXT2_FS_XIP is not set
1506CONFIG_EXT3_FS=y 1710CONFIG_EXT3_FS=y
1711# CONFIG_EXT3_DEFAULTS_TO_ORDERED is not set
1507CONFIG_EXT3_FS_XATTR=y 1712CONFIG_EXT3_FS_XATTR=y
1508# CONFIG_EXT3_FS_POSIX_ACL is not set 1713# CONFIG_EXT3_FS_POSIX_ACL is not set
1509# CONFIG_EXT3_FS_SECURITY is not set 1714# CONFIG_EXT3_FS_SECURITY is not set
1510# CONFIG_EXT4DEV_FS is not set 1715# CONFIG_EXT4_FS is not set
1511CONFIG_JBD=y 1716CONFIG_JBD=y
1717# CONFIG_JBD_DEBUG is not set
1512CONFIG_FS_MBCACHE=y 1718CONFIG_FS_MBCACHE=y
1513# CONFIG_REISERFS_FS is not set 1719# CONFIG_REISERFS_FS is not set
1514# CONFIG_JFS_FS is not set 1720# CONFIG_JFS_FS is not set
@@ -1516,6 +1722,10 @@ CONFIG_FS_POSIX_ACL=y
1516# CONFIG_XFS_FS is not set 1722# CONFIG_XFS_FS is not set
1517# CONFIG_GFS2_FS is not set 1723# CONFIG_GFS2_FS is not set
1518# CONFIG_OCFS2_FS is not set 1724# CONFIG_OCFS2_FS is not set
1725# CONFIG_BTRFS_FS is not set
1726# CONFIG_NILFS2_FS is not set
1727CONFIG_FILE_LOCKING=y
1728CONFIG_FSNOTIFY=y
1519CONFIG_DNOTIFY=y 1729CONFIG_DNOTIFY=y
1520CONFIG_INOTIFY=y 1730CONFIG_INOTIFY=y
1521CONFIG_INOTIFY_USER=y 1731CONFIG_INOTIFY_USER=y
@@ -1525,6 +1735,11 @@ CONFIG_AUTOFS4_FS=y
1525# CONFIG_FUSE_FS is not set 1735# CONFIG_FUSE_FS is not set
1526 1736
1527# 1737#
1738# Caches
1739#
1740# CONFIG_FSCACHE is not set
1741
1742#
1528# CD-ROM/DVD Filesystems 1743# CD-ROM/DVD Filesystems
1529# 1744#
1530CONFIG_ISO9660_FS=y 1745CONFIG_ISO9660_FS=y
@@ -1549,16 +1764,14 @@ CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1"
1549CONFIG_PROC_FS=y 1764CONFIG_PROC_FS=y
1550CONFIG_PROC_KCORE=y 1765CONFIG_PROC_KCORE=y
1551CONFIG_PROC_SYSCTL=y 1766CONFIG_PROC_SYSCTL=y
1767CONFIG_PROC_PAGE_MONITOR=y
1552CONFIG_SYSFS=y 1768CONFIG_SYSFS=y
1553CONFIG_TMPFS=y 1769CONFIG_TMPFS=y
1554# CONFIG_TMPFS_POSIX_ACL is not set 1770# CONFIG_TMPFS_POSIX_ACL is not set
1555CONFIG_HUGETLBFS=y 1771CONFIG_HUGETLBFS=y
1556CONFIG_HUGETLB_PAGE=y 1772CONFIG_HUGETLB_PAGE=y
1557CONFIG_CONFIGFS_FS=y 1773CONFIG_CONFIGFS_FS=y
1558 1774CONFIG_MISC_FILESYSTEMS=y
1559#
1560# Miscellaneous filesystems
1561#
1562# CONFIG_ADFS_FS is not set 1775# CONFIG_ADFS_FS is not set
1563# CONFIG_AFFS_FS is not set 1776# CONFIG_AFFS_FS is not set
1564# CONFIG_HFS_FS is not set 1777# CONFIG_HFS_FS is not set
@@ -1578,8 +1791,10 @@ CONFIG_JFFS2_ZLIB=y
1578CONFIG_JFFS2_RTIME=y 1791CONFIG_JFFS2_RTIME=y
1579# CONFIG_JFFS2_RUBIN is not set 1792# CONFIG_JFFS2_RUBIN is not set
1580# CONFIG_CRAMFS is not set 1793# CONFIG_CRAMFS is not set
1794# CONFIG_SQUASHFS is not set
1581# CONFIG_VXFS_FS is not set 1795# CONFIG_VXFS_FS is not set
1582# CONFIG_MINIX_FS is not set 1796# CONFIG_MINIX_FS is not set
1797# CONFIG_OMFS_FS is not set
1583# CONFIG_HPFS_FS is not set 1798# CONFIG_HPFS_FS is not set
1584# CONFIG_QNX4FS_FS is not set 1799# CONFIG_QNX4FS_FS is not set
1585# CONFIG_ROMFS_FS is not set 1800# CONFIG_ROMFS_FS is not set
@@ -1590,18 +1805,17 @@ CONFIG_NFS_FS=y
1590CONFIG_NFS_V3=y 1805CONFIG_NFS_V3=y
1591# CONFIG_NFS_V3_ACL is not set 1806# CONFIG_NFS_V3_ACL is not set
1592# CONFIG_NFS_V4 is not set 1807# CONFIG_NFS_V4 is not set
1808CONFIG_ROOT_NFS=y
1593CONFIG_NFSD=y 1809CONFIG_NFSD=y
1594CONFIG_NFSD_V3=y 1810CONFIG_NFSD_V3=y
1595# CONFIG_NFSD_V3_ACL is not set 1811# CONFIG_NFSD_V3_ACL is not set
1596CONFIG_NFSD_V4=y 1812CONFIG_NFSD_V4=y
1597CONFIG_ROOT_NFS=y
1598CONFIG_LOCKD=y 1813CONFIG_LOCKD=y
1599CONFIG_LOCKD_V4=y 1814CONFIG_LOCKD_V4=y
1600CONFIG_EXPORTFS=y 1815CONFIG_EXPORTFS=y
1601CONFIG_NFS_COMMON=y 1816CONFIG_NFS_COMMON=y
1602CONFIG_SUNRPC=y 1817CONFIG_SUNRPC=y
1603CONFIG_SUNRPC_GSS=y 1818CONFIG_SUNRPC_GSS=y
1604# CONFIG_SUNRPC_BIND34 is not set
1605CONFIG_RPCSEC_GSS_KRB5=y 1819CONFIG_RPCSEC_GSS_KRB5=y
1606# CONFIG_RPCSEC_GSS_SPKM3 is not set 1820# CONFIG_RPCSEC_GSS_SPKM3 is not set
1607# CONFIG_SMB_FS is not set 1821# CONFIG_SMB_FS is not set
@@ -1672,25 +1886,30 @@ CONFIG_NLS_ISO8859_1=y
1672# CONFIG_NLS_KOI8_U is not set 1886# CONFIG_NLS_KOI8_U is not set
1673# CONFIG_NLS_UTF8 is not set 1887# CONFIG_NLS_UTF8 is not set
1674# CONFIG_DLM is not set 1888# CONFIG_DLM is not set
1889CONFIG_BINARY_PRINTF=y
1675 1890
1676# 1891#
1677# Library routines 1892# Library routines
1678# 1893#
1679CONFIG_BITREVERSE=y 1894CONFIG_BITREVERSE=y
1680# CONFIG_GENERIC_FIND_FIRST_BIT is not set 1895CONFIG_GENERIC_FIND_LAST_BIT=y
1681CONFIG_CRC_CCITT=y 1896CONFIG_CRC_CCITT=y
1682# CONFIG_CRC16 is not set 1897# CONFIG_CRC16 is not set
1898# CONFIG_CRC_T10DIF is not set
1683CONFIG_CRC_ITU_T=y 1899CONFIG_CRC_ITU_T=y
1684CONFIG_CRC32=y 1900CONFIG_CRC32=y
1685# CONFIG_CRC7 is not set 1901# CONFIG_CRC7 is not set
1686CONFIG_LIBCRC32C=m 1902# CONFIG_LIBCRC32C is not set
1687CONFIG_ZLIB_INFLATE=y 1903CONFIG_ZLIB_INFLATE=y
1688CONFIG_ZLIB_DEFLATE=y 1904CONFIG_ZLIB_DEFLATE=y
1689CONFIG_PLIST=y 1905CONFIG_DECOMPRESS_GZIP=y
1906CONFIG_DECOMPRESS_BZIP2=y
1907CONFIG_DECOMPRESS_LZMA=y
1690CONFIG_HAS_IOMEM=y 1908CONFIG_HAS_IOMEM=y
1691CONFIG_HAS_IOPORT=y 1909CONFIG_HAS_IOPORT=y
1692CONFIG_HAS_DMA=y 1910CONFIG_HAS_DMA=y
1693CONFIG_HAVE_LMB=y 1911CONFIG_HAVE_LMB=y
1912CONFIG_NLATTR=y
1694 1913
1695# 1914#
1696# Kernel hacking 1915# Kernel hacking
@@ -1700,18 +1919,25 @@ CONFIG_ENABLE_WARN_DEPRECATED=y
1700CONFIG_ENABLE_MUST_CHECK=y 1919CONFIG_ENABLE_MUST_CHECK=y
1701CONFIG_FRAME_WARN=2048 1920CONFIG_FRAME_WARN=2048
1702CONFIG_MAGIC_SYSRQ=y 1921CONFIG_MAGIC_SYSRQ=y
1922# CONFIG_STRIP_ASM_SYMS is not set
1703# CONFIG_UNUSED_SYMBOLS is not set 1923# CONFIG_UNUSED_SYMBOLS is not set
1704# CONFIG_DEBUG_FS is not set 1924CONFIG_DEBUG_FS=y
1705# CONFIG_HEADERS_CHECK is not set 1925# CONFIG_HEADERS_CHECK is not set
1706CONFIG_DEBUG_KERNEL=y 1926CONFIG_DEBUG_KERNEL=y
1707# CONFIG_DEBUG_SHIRQ is not set 1927# CONFIG_DEBUG_SHIRQ is not set
1708CONFIG_DETECT_SOFTLOCKUP=y 1928CONFIG_DETECT_SOFTLOCKUP=y
1929# CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC is not set
1930CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC_VALUE=0
1931CONFIG_DETECT_HUNG_TASK=y
1932# CONFIG_BOOTPARAM_HUNG_TASK_PANIC is not set
1933CONFIG_BOOTPARAM_HUNG_TASK_PANIC_VALUE=0
1709# CONFIG_SCHED_DEBUG is not set 1934# CONFIG_SCHED_DEBUG is not set
1710# CONFIG_SCHEDSTATS is not set 1935# CONFIG_SCHEDSTATS is not set
1711# CONFIG_TIMER_STATS is not set 1936# CONFIG_TIMER_STATS is not set
1712# CONFIG_DEBUG_OBJECTS is not set 1937# CONFIG_DEBUG_OBJECTS is not set
1713# CONFIG_SLUB_DEBUG_ON is not set 1938# CONFIG_SLUB_DEBUG_ON is not set
1714# CONFIG_SLUB_STATS is not set 1939# CONFIG_SLUB_STATS is not set
1940# CONFIG_DEBUG_KMEMLEAK is not set
1715# CONFIG_DEBUG_RT_MUTEXES is not set 1941# CONFIG_DEBUG_RT_MUTEXES is not set
1716# CONFIG_RT_MUTEX_TESTER is not set 1942# CONFIG_RT_MUTEX_TESTER is not set
1717# CONFIG_DEBUG_SPINLOCK is not set 1943# CONFIG_DEBUG_SPINLOCK is not set
@@ -1721,26 +1947,71 @@ CONFIG_DETECT_SOFTLOCKUP=y
1721# CONFIG_LOCK_STAT is not set 1947# CONFIG_LOCK_STAT is not set
1722# CONFIG_DEBUG_SPINLOCK_SLEEP is not set 1948# CONFIG_DEBUG_SPINLOCK_SLEEP is not set
1723# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set 1949# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set
1950CONFIG_STACKTRACE=y
1724# CONFIG_DEBUG_KOBJECT is not set 1951# CONFIG_DEBUG_KOBJECT is not set
1725CONFIG_DEBUG_BUGVERBOSE=y 1952CONFIG_DEBUG_BUGVERBOSE=y
1726# CONFIG_DEBUG_INFO is not set 1953# CONFIG_DEBUG_INFO is not set
1727# CONFIG_DEBUG_VM is not set 1954# CONFIG_DEBUG_VM is not set
1728# CONFIG_DEBUG_WRITECOUNT is not set 1955# CONFIG_DEBUG_WRITECOUNT is not set
1956CONFIG_DEBUG_MEMORY_INIT=y
1729# CONFIG_DEBUG_LIST is not set 1957# CONFIG_DEBUG_LIST is not set
1730# CONFIG_DEBUG_SG is not set 1958# CONFIG_DEBUG_SG is not set
1731# CONFIG_BOOT_PRINTK_DELAY is not set 1959# CONFIG_DEBUG_NOTIFIERS is not set
1960# CONFIG_DEBUG_CREDENTIALS is not set
1732# CONFIG_RCU_TORTURE_TEST is not set 1961# CONFIG_RCU_TORTURE_TEST is not set
1962# CONFIG_RCU_CPU_STALL_DETECTOR is not set
1733# CONFIG_BACKTRACE_SELF_TEST is not set 1963# CONFIG_BACKTRACE_SELF_TEST is not set
1964# CONFIG_DEBUG_BLOCK_EXT_DEVT is not set
1965# CONFIG_DEBUG_FORCE_WEAK_PER_CPU is not set
1734# CONFIG_FAULT_INJECTION is not set 1966# CONFIG_FAULT_INJECTION is not set
1967# CONFIG_LATENCYTOP is not set
1968CONFIG_SYSCTL_SYSCALL_CHECK=y
1969# CONFIG_DEBUG_PAGEALLOC is not set
1970CONFIG_NOP_TRACER=y
1971CONFIG_HAVE_FUNCTION_TRACER=y
1972CONFIG_HAVE_FUNCTION_GRAPH_TRACER=y
1973CONFIG_HAVE_DYNAMIC_FTRACE=y
1974CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y
1975CONFIG_RING_BUFFER=y
1976CONFIG_EVENT_TRACING=y
1977CONFIG_CONTEXT_SWITCH_TRACER=y
1978CONFIG_RING_BUFFER_ALLOW_SWAP=y
1979CONFIG_TRACING=y
1980CONFIG_TRACING_SUPPORT=y
1981CONFIG_FTRACE=y
1982# CONFIG_FUNCTION_TRACER is not set
1983# CONFIG_IRQSOFF_TRACER is not set
1984# CONFIG_SCHED_TRACER is not set
1985# CONFIG_ENABLE_DEFAULT_TRACERS is not set
1986# CONFIG_BOOT_TRACER is not set
1987CONFIG_BRANCH_PROFILE_NONE=y
1988# CONFIG_PROFILE_ANNOTATED_BRANCHES is not set
1989# CONFIG_PROFILE_ALL_BRANCHES is not set
1990# CONFIG_STACK_TRACER is not set
1991# CONFIG_KMEMTRACE is not set
1992# CONFIG_WORKQUEUE_TRACER is not set
1993# CONFIG_BLK_DEV_IO_TRACE is not set
1994# CONFIG_RING_BUFFER_BENCHMARK is not set
1995# CONFIG_DYNAMIC_DEBUG is not set
1996# CONFIG_DMA_API_DEBUG is not set
1735# CONFIG_SAMPLES is not set 1997# CONFIG_SAMPLES is not set
1998CONFIG_HAVE_ARCH_KGDB=y
1999# CONFIG_KGDB is not set
2000# CONFIG_PPC_DISABLE_WERROR is not set
2001CONFIG_PPC_WERROR=y
2002CONFIG_PRINT_STACK_DEPTH=64
1736# CONFIG_DEBUG_STACKOVERFLOW is not set 2003# CONFIG_DEBUG_STACKOVERFLOW is not set
1737# CONFIG_DEBUG_STACK_USAGE is not set 2004# CONFIG_DEBUG_STACK_USAGE is not set
1738# CONFIG_DEBUG_PAGEALLOC is not set 2005# CONFIG_PPC_EMULATED_STATS is not set
1739CONFIG_DEBUGGER=y 2006# CONFIG_CODE_PATCHING_SELFTEST is not set
2007# CONFIG_FTR_FIXUP_SELFTEST is not set
2008# CONFIG_MSI_BITMAP_SELFTEST is not set
1740CONFIG_XMON=y 2009CONFIG_XMON=y
1741CONFIG_XMON_DEFAULT=y 2010CONFIG_XMON_DEFAULT=y
1742CONFIG_XMON_DISASSEMBLY=y 2011CONFIG_XMON_DISASSEMBLY=y
2012CONFIG_DEBUGGER=y
1743# CONFIG_IRQSTACKS is not set 2013# CONFIG_IRQSTACKS is not set
2014# CONFIG_VIRQ_DEBUG is not set
1744# CONFIG_BOOTX_TEXT is not set 2015# CONFIG_BOOTX_TEXT is not set
1745# CONFIG_PPC_EARLY_DEBUG is not set 2016# CONFIG_PPC_EARLY_DEBUG is not set
1746 2017
@@ -1749,23 +2020,34 @@ CONFIG_XMON_DISASSEMBLY=y
1749# 2020#
1750# CONFIG_KEYS is not set 2021# CONFIG_KEYS is not set
1751# CONFIG_SECURITY is not set 2022# CONFIG_SECURITY is not set
2023# CONFIG_SECURITYFS is not set
1752# CONFIG_SECURITY_FILE_CAPABILITIES is not set 2024# CONFIG_SECURITY_FILE_CAPABILITIES is not set
1753CONFIG_XOR_BLOCKS=y 2025CONFIG_XOR_BLOCKS=y
1754CONFIG_ASYNC_CORE=y 2026CONFIG_ASYNC_CORE=y
1755CONFIG_ASYNC_MEMCPY=y 2027CONFIG_ASYNC_MEMCPY=y
1756CONFIG_ASYNC_XOR=y 2028CONFIG_ASYNC_XOR=y
2029CONFIG_ASYNC_PQ=y
2030CONFIG_ASYNC_RAID6_RECOV=y
1757CONFIG_CRYPTO=y 2031CONFIG_CRYPTO=y
1758 2032
1759# 2033#
1760# Crypto core or helper 2034# Crypto core or helper
1761# 2035#
1762CONFIG_CRYPTO_ALGAPI=y 2036CONFIG_CRYPTO_ALGAPI=y
2037CONFIG_CRYPTO_ALGAPI2=y
1763CONFIG_CRYPTO_AEAD=y 2038CONFIG_CRYPTO_AEAD=y
2039CONFIG_CRYPTO_AEAD2=y
1764CONFIG_CRYPTO_BLKCIPHER=y 2040CONFIG_CRYPTO_BLKCIPHER=y
2041CONFIG_CRYPTO_BLKCIPHER2=y
1765CONFIG_CRYPTO_HASH=y 2042CONFIG_CRYPTO_HASH=y
2043CONFIG_CRYPTO_HASH2=y
2044CONFIG_CRYPTO_RNG2=y
2045CONFIG_CRYPTO_PCOMP=y
1766CONFIG_CRYPTO_MANAGER=y 2046CONFIG_CRYPTO_MANAGER=y
2047CONFIG_CRYPTO_MANAGER2=y
1767# CONFIG_CRYPTO_GF128MUL is not set 2048# CONFIG_CRYPTO_GF128MUL is not set
1768# CONFIG_CRYPTO_NULL is not set 2049# CONFIG_CRYPTO_NULL is not set
2050CONFIG_CRYPTO_WORKQUEUE=y
1769# CONFIG_CRYPTO_CRYPTD is not set 2051# CONFIG_CRYPTO_CRYPTD is not set
1770CONFIG_CRYPTO_AUTHENC=y 2052CONFIG_CRYPTO_AUTHENC=y
1771# CONFIG_CRYPTO_TEST is not set 2053# CONFIG_CRYPTO_TEST is not set
@@ -1793,14 +2075,20 @@ CONFIG_CRYPTO_CBC=y
1793# 2075#
1794CONFIG_CRYPTO_HMAC=y 2076CONFIG_CRYPTO_HMAC=y
1795# CONFIG_CRYPTO_XCBC is not set 2077# CONFIG_CRYPTO_XCBC is not set
2078# CONFIG_CRYPTO_VMAC is not set
1796 2079
1797# 2080#
1798# Digest 2081# Digest
1799# 2082#
1800# CONFIG_CRYPTO_CRC32C is not set 2083# CONFIG_CRYPTO_CRC32C is not set
2084# CONFIG_CRYPTO_GHASH is not set
1801CONFIG_CRYPTO_MD4=y 2085CONFIG_CRYPTO_MD4=y
1802CONFIG_CRYPTO_MD5=y 2086CONFIG_CRYPTO_MD5=y
1803# CONFIG_CRYPTO_MICHAEL_MIC is not set 2087# CONFIG_CRYPTO_MICHAEL_MIC is not set
2088# CONFIG_CRYPTO_RMD128 is not set
2089# CONFIG_CRYPTO_RMD160 is not set
2090# CONFIG_CRYPTO_RMD256 is not set
2091# CONFIG_CRYPTO_RMD320 is not set
1804CONFIG_CRYPTO_SHA1=y 2092CONFIG_CRYPTO_SHA1=y
1805CONFIG_CRYPTO_SHA256=y 2093CONFIG_CRYPTO_SHA256=y
1806CONFIG_CRYPTO_SHA512=y 2094CONFIG_CRYPTO_SHA512=y
@@ -1830,7 +2118,13 @@ CONFIG_CRYPTO_DES=y
1830# Compression 2118# Compression
1831# 2119#
1832# CONFIG_CRYPTO_DEFLATE is not set 2120# CONFIG_CRYPTO_DEFLATE is not set
2121# CONFIG_CRYPTO_ZLIB is not set
1833# CONFIG_CRYPTO_LZO is not set 2122# CONFIG_CRYPTO_LZO is not set
2123
2124#
2125# Random Number Generation
2126#
2127# CONFIG_CRYPTO_ANSI_CPRNG is not set
1834CONFIG_CRYPTO_HW=y 2128CONFIG_CRYPTO_HW=y
1835# CONFIG_CRYPTO_DEV_HIFN_795X is not set 2129# CONFIG_CRYPTO_DEV_HIFN_795X is not set
1836# CONFIG_PPC_CLOCK is not set 2130# CONFIG_PPC_CLOCK is not set
diff --git a/arch/powerpc/configs/pq2fads_defconfig b/arch/powerpc/configs/pq2fads_defconfig
index ff96bb43c32d..b7911216af78 100644
--- a/arch/powerpc/configs/pq2fads_defconfig
+++ b/arch/powerpc/configs/pq2fads_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.31-rc4 3# Linux kernel version: 2.6.32-rc5
4# Wed Jul 29 23:32:00 2009 4# Thu Nov 5 08:20:17 2009
5# 5#
6# CONFIG_PPC64 is not set 6# CONFIG_PPC64 is not set
7 7
@@ -34,6 +34,7 @@ CONFIG_GENERIC_CLOCKEVENTS=y
34CONFIG_GENERIC_HARDIRQS=y 34CONFIG_GENERIC_HARDIRQS=y
35CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y 35CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y
36# CONFIG_HAVE_SETUP_PER_CPU_AREA is not set 36# CONFIG_HAVE_SETUP_PER_CPU_AREA is not set
37# CONFIG_NEED_PER_CPU_EMBED_FIRST_CHUNK is not set
37CONFIG_IRQ_PER_CPU=y 38CONFIG_IRQ_PER_CPU=y
38CONFIG_STACKTRACE_SUPPORT=y 39CONFIG_STACKTRACE_SUPPORT=y
39CONFIG_HAVE_LATENCYTOP_SUPPORT=y 40CONFIG_HAVE_LATENCYTOP_SUPPORT=y
@@ -82,11 +83,12 @@ CONFIG_SYSVIPC_SYSCTL=y
82# 83#
83# RCU Subsystem 84# RCU Subsystem
84# 85#
85CONFIG_CLASSIC_RCU=y 86CONFIG_TREE_RCU=y
86# CONFIG_TREE_RCU is not set 87# CONFIG_TREE_PREEMPT_RCU is not set
87# CONFIG_PREEMPT_RCU is not set 88# CONFIG_RCU_TRACE is not set
89CONFIG_RCU_FANOUT=32
90# CONFIG_RCU_FANOUT_EXACT is not set
88# CONFIG_TREE_RCU_TRACE is not set 91# CONFIG_TREE_RCU_TRACE is not set
89# CONFIG_PREEMPT_RCU_TRACE is not set
90CONFIG_IKCONFIG=y 92CONFIG_IKCONFIG=y
91CONFIG_IKCONFIG_PROC=y 93CONFIG_IKCONFIG_PROC=y
92CONFIG_LOG_BUF_SHIFT=14 94CONFIG_LOG_BUF_SHIFT=14
@@ -120,29 +122,30 @@ CONFIG_TIMERFD=y
120CONFIG_EVENTFD=y 122CONFIG_EVENTFD=y
121CONFIG_SHMEM=y 123CONFIG_SHMEM=y
122CONFIG_AIO=y 124CONFIG_AIO=y
123CONFIG_HAVE_PERF_COUNTERS=y 125CONFIG_HAVE_PERF_EVENTS=y
124 126
125# 127#
126# Performance Counters 128# Kernel Performance Events And Counters
127# 129#
130# CONFIG_PERF_EVENTS is not set
128# CONFIG_PERF_COUNTERS is not set 131# CONFIG_PERF_COUNTERS is not set
129CONFIG_VM_EVENT_COUNTERS=y 132CONFIG_VM_EVENT_COUNTERS=y
130CONFIG_PCI_QUIRKS=y 133CONFIG_PCI_QUIRKS=y
131CONFIG_SLUB_DEBUG=y 134CONFIG_SLUB_DEBUG=y
132# CONFIG_STRIP_ASM_SYMS is not set
133CONFIG_COMPAT_BRK=y 135CONFIG_COMPAT_BRK=y
134# CONFIG_SLAB is not set 136# CONFIG_SLAB is not set
135CONFIG_SLUB=y 137CONFIG_SLUB=y
136# CONFIG_SLOB is not set 138# CONFIG_SLOB is not set
137# CONFIG_PROFILING is not set 139# CONFIG_PROFILING is not set
138# CONFIG_MARKERS is not set
139CONFIG_HAVE_OPROFILE=y 140CONFIG_HAVE_OPROFILE=y
140CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS=y 141CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS=y
141CONFIG_HAVE_IOREMAP_PROT=y 142CONFIG_HAVE_IOREMAP_PROT=y
142CONFIG_HAVE_KPROBES=y 143CONFIG_HAVE_KPROBES=y
143CONFIG_HAVE_KRETPROBES=y 144CONFIG_HAVE_KRETPROBES=y
144CONFIG_HAVE_ARCH_TRACEHOOK=y 145CONFIG_HAVE_ARCH_TRACEHOOK=y
146CONFIG_HAVE_DMA_ATTRS=y
145CONFIG_HAVE_CLK=y 147CONFIG_HAVE_CLK=y
148CONFIG_HAVE_DMA_API_DEBUG=y
146 149
147# 150#
148# GCOV-based kernel profiling 151# GCOV-based kernel profiling
@@ -155,6 +158,7 @@ CONFIG_BASE_SMALL=0
155# CONFIG_MODULES is not set 158# CONFIG_MODULES is not set
156CONFIG_BLOCK=y 159CONFIG_BLOCK=y
157CONFIG_LBDAF=y 160CONFIG_LBDAF=y
161CONFIG_BLK_DEV_BSG=y
158# CONFIG_BLK_DEV_INTEGRITY is not set 162# CONFIG_BLK_DEV_INTEGRITY is not set
159 163
160# 164#
@@ -239,6 +243,7 @@ CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y
239CONFIG_ARCH_HAS_WALK_MEMORY=y 243CONFIG_ARCH_HAS_WALK_MEMORY=y
240CONFIG_ARCH_ENABLE_MEMORY_HOTREMOVE=y 244CONFIG_ARCH_ENABLE_MEMORY_HOTREMOVE=y
241# CONFIG_CRASH_DUMP is not set 245# CONFIG_CRASH_DUMP is not set
246CONFIG_MAX_ACTIVE_REGIONS=32
242CONFIG_ARCH_FLATMEM_ENABLE=y 247CONFIG_ARCH_FLATMEM_ENABLE=y
243CONFIG_ARCH_POPULATES_NODE_MAP=y 248CONFIG_ARCH_POPULATES_NODE_MAP=y
244CONFIG_FLATMEM=y 249CONFIG_FLATMEM=y
@@ -252,6 +257,7 @@ CONFIG_BOUNCE=y
252CONFIG_VIRT_TO_BUS=y 257CONFIG_VIRT_TO_BUS=y
253CONFIG_HAVE_MLOCK=y 258CONFIG_HAVE_MLOCK=y
254CONFIG_HAVE_MLOCKED_PAGE_BIT=y 259CONFIG_HAVE_MLOCKED_PAGE_BIT=y
260# CONFIG_KSM is not set
255CONFIG_DEFAULT_MMAP_MIN_ADDR=4096 261CONFIG_DEFAULT_MMAP_MIN_ADDR=4096
256CONFIG_PPC_4K_PAGES=y 262CONFIG_PPC_4K_PAGES=y
257# CONFIG_PPC_16K_PAGES is not set 263# CONFIG_PPC_16K_PAGES is not set
@@ -401,6 +407,7 @@ CONFIG_NETFILTER_ADVANCED=y
401# CONFIG_BT is not set 407# CONFIG_BT is not set
402CONFIG_WIRELESS=y 408CONFIG_WIRELESS=y
403# CONFIG_CFG80211 is not set 409# CONFIG_CFG80211 is not set
410CONFIG_CFG80211_DEFAULT_PS_VALUE=0
404CONFIG_WIRELESS_OLD_REGULATORY=y 411CONFIG_WIRELESS_OLD_REGULATORY=y
405# CONFIG_WIRELESS_EXT is not set 412# CONFIG_WIRELESS_EXT is not set
406# CONFIG_LIB80211 is not set 413# CONFIG_LIB80211 is not set
@@ -408,7 +415,6 @@ CONFIG_WIRELESS_OLD_REGULATORY=y
408# 415#
409# CFG80211 needs to be enabled for MAC80211 416# CFG80211 needs to be enabled for MAC80211
410# 417#
411CONFIG_MAC80211_DEFAULT_PS_VALUE=0
412# CONFIG_WIMAX is not set 418# CONFIG_WIMAX is not set
413# CONFIG_RFKILL is not set 419# CONFIG_RFKILL is not set
414 420
@@ -420,6 +426,7 @@ CONFIG_MAC80211_DEFAULT_PS_VALUE=0
420# Generic Driver Options 426# Generic Driver Options
421# 427#
422CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug" 428CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
429# CONFIG_DEVTMPFS is not set
423CONFIG_STANDALONE=y 430CONFIG_STANDALONE=y
424CONFIG_PREVENT_FIRMWARE_BUILD=y 431CONFIG_PREVENT_FIRMWARE_BUILD=y
425# CONFIG_FW_LOADER is not set 432# CONFIG_FW_LOADER is not set
@@ -481,7 +488,6 @@ CONFIG_MTD_CFI_UTIL=y
481# CONFIG_MTD_COMPLEX_MAPPINGS is not set 488# CONFIG_MTD_COMPLEX_MAPPINGS is not set
482# CONFIG_MTD_PHYSMAP is not set 489# CONFIG_MTD_PHYSMAP is not set
483CONFIG_MTD_PHYSMAP_OF=y 490CONFIG_MTD_PHYSMAP_OF=y
484# CONFIG_MTD_SBC8240 is not set
485# CONFIG_MTD_INTEL_VR_NOR is not set 491# CONFIG_MTD_INTEL_VR_NOR is not set
486# CONFIG_MTD_PLATRAM is not set 492# CONFIG_MTD_PLATRAM is not set
487 493
@@ -664,7 +670,9 @@ CONFIG_MII=y
664# CONFIG_NET_PCI is not set 670# CONFIG_NET_PCI is not set
665# CONFIG_B44 is not set 671# CONFIG_B44 is not set
666# CONFIG_KS8842 is not set 672# CONFIG_KS8842 is not set
673# CONFIG_KS8851_MLL is not set
667# CONFIG_ATL2 is not set 674# CONFIG_ATL2 is not set
675# CONFIG_XILINX_EMACLITE is not set
668CONFIG_FS_ENET=y 676CONFIG_FS_ENET=y
669# CONFIG_FS_ENET_HAS_SCC is not set 677# CONFIG_FS_ENET_HAS_SCC is not set
670CONFIG_FS_ENET_HAS_FCC=y 678CONFIG_FS_ENET_HAS_FCC=y
@@ -712,10 +720,7 @@ CONFIG_CHELSIO_T3_DEPENDS=y
712# CONFIG_SFC is not set 720# CONFIG_SFC is not set
713# CONFIG_BE2NET is not set 721# CONFIG_BE2NET is not set
714# CONFIG_TR is not set 722# CONFIG_TR is not set
715 723CONFIG_WLAN=y
716#
717# Wireless LAN
718#
719# CONFIG_WLAN_PRE80211 is not set 724# CONFIG_WLAN_PRE80211 is not set
720# CONFIG_WLAN_80211 is not set 725# CONFIG_WLAN_80211 is not set
721 726
@@ -764,6 +769,7 @@ CONFIG_KEYBOARD_ATKBD=y
764# CONFIG_KEYBOARD_GPIO is not set 769# CONFIG_KEYBOARD_GPIO is not set
765# CONFIG_KEYBOARD_MATRIX is not set 770# CONFIG_KEYBOARD_MATRIX is not set
766# CONFIG_KEYBOARD_NEWTON is not set 771# CONFIG_KEYBOARD_NEWTON is not set
772# CONFIG_KEYBOARD_OPENCORES is not set
767# CONFIG_KEYBOARD_STOWAWAY is not set 773# CONFIG_KEYBOARD_STOWAWAY is not set
768# CONFIG_KEYBOARD_SUNKBD is not set 774# CONFIG_KEYBOARD_SUNKBD is not set
769# CONFIG_KEYBOARD_XTKBD is not set 775# CONFIG_KEYBOARD_XTKBD is not set
@@ -774,6 +780,7 @@ CONFIG_MOUSE_PS2_LOGIPS2PP=y
774CONFIG_MOUSE_PS2_SYNAPTICS=y 780CONFIG_MOUSE_PS2_SYNAPTICS=y
775CONFIG_MOUSE_PS2_TRACKPOINT=y 781CONFIG_MOUSE_PS2_TRACKPOINT=y
776# CONFIG_MOUSE_PS2_ELANTECH is not set 782# CONFIG_MOUSE_PS2_ELANTECH is not set
783# CONFIG_MOUSE_PS2_SENTELIC is not set
777# CONFIG_MOUSE_PS2_TOUCHKIT is not set 784# CONFIG_MOUSE_PS2_TOUCHKIT is not set
778# CONFIG_MOUSE_SERIAL is not set 785# CONFIG_MOUSE_SERIAL is not set
779# CONFIG_MOUSE_APPLETOUCH is not set 786# CONFIG_MOUSE_APPLETOUCH is not set
@@ -855,15 +862,19 @@ CONFIG_GPIOLIB=y
855# PCI GPIO expanders: 862# PCI GPIO expanders:
856# 863#
857# CONFIG_GPIO_BT8XX is not set 864# CONFIG_GPIO_BT8XX is not set
865# CONFIG_GPIO_LANGWELL is not set
858 866
859# 867#
860# SPI GPIO expanders: 868# SPI GPIO expanders:
861# 869#
870
871#
872# AC97 GPIO expanders:
873#
862# CONFIG_W1 is not set 874# CONFIG_W1 is not set
863# CONFIG_POWER_SUPPLY is not set 875# CONFIG_POWER_SUPPLY is not set
864# CONFIG_HWMON is not set 876# CONFIG_HWMON is not set
865# CONFIG_THERMAL is not set 877# CONFIG_THERMAL is not set
866# CONFIG_THERMAL_HWMON is not set
867# CONFIG_WATCHDOG is not set 878# CONFIG_WATCHDOG is not set
868CONFIG_SSB_POSSIBLE=y 879CONFIG_SSB_POSSIBLE=y
869 880
@@ -886,6 +897,7 @@ CONFIG_SSB_POSSIBLE=y
886# Graphics support 897# Graphics support
887# 898#
888# CONFIG_AGP is not set 899# CONFIG_AGP is not set
900CONFIG_VGA_ARB=y
889# CONFIG_DRM is not set 901# CONFIG_DRM is not set
890# CONFIG_VGASTATE is not set 902# CONFIG_VGASTATE is not set
891CONFIG_VIDEO_OUTPUT_CONTROL=y 903CONFIG_VIDEO_OUTPUT_CONTROL=y
@@ -905,7 +917,6 @@ CONFIG_USB_ARCH_HAS_EHCI=y
905# CONFIG_USB is not set 917# CONFIG_USB is not set
906# CONFIG_USB_OTG_WHITELIST is not set 918# CONFIG_USB_OTG_WHITELIST is not set
907# CONFIG_USB_OTG_BLACKLIST_HUB is not set 919# CONFIG_USB_OTG_BLACKLIST_HUB is not set
908# CONFIG_USB_MUSB_HDRC is not set
909# CONFIG_USB_GADGET_MUSB_HDRC is not set 920# CONFIG_USB_GADGET_MUSB_HDRC is not set
910 921
911# 922#
@@ -922,6 +933,7 @@ CONFIG_USB_GADGET_SELECTED=y
922# CONFIG_USB_GADGET_LH7A40X is not set 933# CONFIG_USB_GADGET_LH7A40X is not set
923# CONFIG_USB_GADGET_OMAP is not set 934# CONFIG_USB_GADGET_OMAP is not set
924# CONFIG_USB_GADGET_PXA25X is not set 935# CONFIG_USB_GADGET_PXA25X is not set
936# CONFIG_USB_GADGET_R8A66597 is not set
925# CONFIG_USB_GADGET_PXA27X is not set 937# CONFIG_USB_GADGET_PXA27X is not set
926# CONFIG_USB_GADGET_S3C_HSOTG is not set 938# CONFIG_USB_GADGET_S3C_HSOTG is not set
927# CONFIG_USB_GADGET_IMX is not set 939# CONFIG_USB_GADGET_IMX is not set
@@ -940,6 +952,7 @@ CONFIG_USB_GADGET_DUALSPEED=y
940# CONFIG_USB_AUDIO is not set 952# CONFIG_USB_AUDIO is not set
941CONFIG_USB_ETH=y 953CONFIG_USB_ETH=y
942CONFIG_USB_ETH_RNDIS=y 954CONFIG_USB_ETH_RNDIS=y
955# CONFIG_USB_ETH_EEM is not set
943# CONFIG_USB_GADGETFS is not set 956# CONFIG_USB_GADGETFS is not set
944# CONFIG_USB_FILE_STORAGE is not set 957# CONFIG_USB_FILE_STORAGE is not set
945# CONFIG_USB_G_SERIAL is not set 958# CONFIG_USB_G_SERIAL is not set
@@ -1148,6 +1161,7 @@ CONFIG_ENABLE_WARN_DEPRECATED=y
1148CONFIG_ENABLE_MUST_CHECK=y 1161CONFIG_ENABLE_MUST_CHECK=y
1149CONFIG_FRAME_WARN=1024 1162CONFIG_FRAME_WARN=1024
1150CONFIG_MAGIC_SYSRQ=y 1163CONFIG_MAGIC_SYSRQ=y
1164# CONFIG_STRIP_ASM_SYMS is not set
1151# CONFIG_UNUSED_SYMBOLS is not set 1165# CONFIG_UNUSED_SYMBOLS is not set
1152# CONFIG_DEBUG_FS is not set 1166# CONFIG_DEBUG_FS is not set
1153# CONFIG_HEADERS_CHECK is not set 1167# CONFIG_HEADERS_CHECK is not set
@@ -1183,10 +1197,12 @@ CONFIG_DEBUG_INFO=y
1183# CONFIG_DEBUG_LIST is not set 1197# CONFIG_DEBUG_LIST is not set
1184# CONFIG_DEBUG_SG is not set 1198# CONFIG_DEBUG_SG is not set
1185# CONFIG_DEBUG_NOTIFIERS is not set 1199# CONFIG_DEBUG_NOTIFIERS is not set
1200# CONFIG_DEBUG_CREDENTIALS is not set
1186# CONFIG_RCU_TORTURE_TEST is not set 1201# CONFIG_RCU_TORTURE_TEST is not set
1187# CONFIG_RCU_CPU_STALL_DETECTOR is not set 1202# CONFIG_RCU_CPU_STALL_DETECTOR is not set
1188# CONFIG_BACKTRACE_SELF_TEST is not set 1203# CONFIG_BACKTRACE_SELF_TEST is not set
1189# CONFIG_DEBUG_BLOCK_EXT_DEVT is not set 1204# CONFIG_DEBUG_BLOCK_EXT_DEVT is not set
1205# CONFIG_DEBUG_FORCE_WEAK_PER_CPU is not set
1190# CONFIG_FAULT_INJECTION is not set 1206# CONFIG_FAULT_INJECTION is not set
1191# CONFIG_LATENCYTOP is not set 1207# CONFIG_LATENCYTOP is not set
1192CONFIG_SYSCTL_SYSCALL_CHECK=y 1208CONFIG_SYSCTL_SYSCALL_CHECK=y
@@ -1209,6 +1225,7 @@ CONFIG_BRANCH_PROFILE_NONE=y
1209# CONFIG_KMEMTRACE is not set 1225# CONFIG_KMEMTRACE is not set
1210# CONFIG_WORKQUEUE_TRACER is not set 1226# CONFIG_WORKQUEUE_TRACER is not set
1211# CONFIG_BLK_DEV_IO_TRACE is not set 1227# CONFIG_BLK_DEV_IO_TRACE is not set
1228# CONFIG_DMA_API_DEBUG is not set
1212# CONFIG_SAMPLES is not set 1229# CONFIG_SAMPLES is not set
1213CONFIG_HAVE_ARCH_KGDB=y 1230CONFIG_HAVE_ARCH_KGDB=y
1214# CONFIG_PPC_DISABLE_WERROR is not set 1231# CONFIG_PPC_DISABLE_WERROR is not set
@@ -1237,7 +1254,6 @@ CONFIG_CRYPTO=y
1237# 1254#
1238# Crypto core or helper 1255# Crypto core or helper
1239# 1256#
1240# CONFIG_CRYPTO_FIPS is not set
1241CONFIG_CRYPTO_ALGAPI=y 1257CONFIG_CRYPTO_ALGAPI=y
1242CONFIG_CRYPTO_ALGAPI2=y 1258CONFIG_CRYPTO_ALGAPI2=y
1243CONFIG_CRYPTO_AEAD2=y 1259CONFIG_CRYPTO_AEAD2=y
@@ -1279,6 +1295,7 @@ CONFIG_CRYPTO_PCBC=y
1279# Digest 1295# Digest
1280# 1296#
1281# CONFIG_CRYPTO_CRC32C is not set 1297# CONFIG_CRYPTO_CRC32C is not set
1298# CONFIG_CRYPTO_GHASH is not set
1282# CONFIG_CRYPTO_MD4 is not set 1299# CONFIG_CRYPTO_MD4 is not set
1283CONFIG_CRYPTO_MD5=y 1300CONFIG_CRYPTO_MD5=y
1284# CONFIG_CRYPTO_MICHAEL_MIC is not set 1301# CONFIG_CRYPTO_MICHAEL_MIC is not set
diff --git a/arch/powerpc/configs/prpmc2800_defconfig b/arch/powerpc/configs/prpmc2800_defconfig
index 1293c465d7fa..ef50ce45d50b 100644
--- a/arch/powerpc/configs/prpmc2800_defconfig
+++ b/arch/powerpc/configs/prpmc2800_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.31-rc4 3# Linux kernel version: 2.6.32-rc5
4# Wed Jul 29 23:32:01 2009 4# Thu Nov 5 08:20:18 2009
5# 5#
6# CONFIG_PPC64 is not set 6# CONFIG_PPC64 is not set
7 7
@@ -36,6 +36,7 @@ CONFIG_GENERIC_CLOCKEVENTS=y
36CONFIG_GENERIC_HARDIRQS=y 36CONFIG_GENERIC_HARDIRQS=y
37CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y 37CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y
38# CONFIG_HAVE_SETUP_PER_CPU_AREA is not set 38# CONFIG_HAVE_SETUP_PER_CPU_AREA is not set
39# CONFIG_NEED_PER_CPU_EMBED_FIRST_CHUNK 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
@@ -85,11 +86,12 @@ CONFIG_POSIX_MQUEUE_SYSCTL=y
85# 86#
86# RCU Subsystem 87# RCU Subsystem
87# 88#
88CONFIG_CLASSIC_RCU=y 89CONFIG_TREE_RCU=y
89# CONFIG_TREE_RCU is not set 90# CONFIG_TREE_PREEMPT_RCU is not set
90# CONFIG_PREEMPT_RCU is not set 91# CONFIG_RCU_TRACE is not set
92CONFIG_RCU_FANOUT=32
93# CONFIG_RCU_FANOUT_EXACT is not set
91# CONFIG_TREE_RCU_TRACE is not set 94# CONFIG_TREE_RCU_TRACE is not set
92# CONFIG_PREEMPT_RCU_TRACE is not set
93# CONFIG_IKCONFIG is not set 95# CONFIG_IKCONFIG is not set
94CONFIG_LOG_BUF_SHIFT=14 96CONFIG_LOG_BUF_SHIFT=14
95CONFIG_GROUP_SCHED=y 97CONFIG_GROUP_SCHED=y
@@ -131,28 +133,29 @@ CONFIG_TIMERFD=y
131CONFIG_EVENTFD=y 133CONFIG_EVENTFD=y
132CONFIG_SHMEM=y 134CONFIG_SHMEM=y
133CONFIG_AIO=y 135CONFIG_AIO=y
134CONFIG_HAVE_PERF_COUNTERS=y 136CONFIG_HAVE_PERF_EVENTS=y
135 137
136# 138#
137# Performance Counters 139# Kernel Performance Events And Counters
138# 140#
141# CONFIG_PERF_EVENTS is not set
139# CONFIG_PERF_COUNTERS is not set 142# CONFIG_PERF_COUNTERS is not set
140CONFIG_VM_EVENT_COUNTERS=y 143CONFIG_VM_EVENT_COUNTERS=y
141CONFIG_PCI_QUIRKS=y 144CONFIG_PCI_QUIRKS=y
142CONFIG_SLUB_DEBUG=y 145CONFIG_SLUB_DEBUG=y
143# CONFIG_STRIP_ASM_SYMS is not set
144CONFIG_COMPAT_BRK=y 146CONFIG_COMPAT_BRK=y
145# CONFIG_SLAB is not set 147# CONFIG_SLAB is not set
146CONFIG_SLUB=y 148CONFIG_SLUB=y
147# CONFIG_SLOB is not set 149# CONFIG_SLOB is not set
148# CONFIG_PROFILING is not set 150# CONFIG_PROFILING is not set
149# CONFIG_MARKERS is not set
150CONFIG_HAVE_OPROFILE=y 151CONFIG_HAVE_OPROFILE=y
151CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS=y 152CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS=y
152CONFIG_HAVE_IOREMAP_PROT=y 153CONFIG_HAVE_IOREMAP_PROT=y
153CONFIG_HAVE_KPROBES=y 154CONFIG_HAVE_KPROBES=y
154CONFIG_HAVE_KRETPROBES=y 155CONFIG_HAVE_KRETPROBES=y
155CONFIG_HAVE_ARCH_TRACEHOOK=y 156CONFIG_HAVE_ARCH_TRACEHOOK=y
157CONFIG_HAVE_DMA_ATTRS=y
158CONFIG_HAVE_DMA_API_DEBUG=y
156 159
157# 160#
158# GCOV-based kernel profiling 161# GCOV-based kernel profiling
@@ -244,12 +247,12 @@ CONFIG_BINFMT_ELF=y
244CONFIG_BINFMT_MISC=y 247CONFIG_BINFMT_MISC=y
245# CONFIG_IOMMU_HELPER is not set 248# CONFIG_IOMMU_HELPER is not set
246# CONFIG_SWIOTLB is not set 249# CONFIG_SWIOTLB is not set
247CONFIG_PPC_NEED_DMA_SYNC_OPS=y
248CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y 250CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y
249CONFIG_ARCH_HAS_WALK_MEMORY=y 251CONFIG_ARCH_HAS_WALK_MEMORY=y
250CONFIG_ARCH_ENABLE_MEMORY_HOTREMOVE=y 252CONFIG_ARCH_ENABLE_MEMORY_HOTREMOVE=y
251# CONFIG_KEXEC is not set 253# CONFIG_KEXEC is not set
252# CONFIG_CRASH_DUMP is not set 254# CONFIG_CRASH_DUMP is not set
255CONFIG_MAX_ACTIVE_REGIONS=32
253CONFIG_ARCH_FLATMEM_ENABLE=y 256CONFIG_ARCH_FLATMEM_ENABLE=y
254CONFIG_ARCH_POPULATES_NODE_MAP=y 257CONFIG_ARCH_POPULATES_NODE_MAP=y
255CONFIG_SELECT_MEMORY_MODEL=y 258CONFIG_SELECT_MEMORY_MODEL=y
@@ -267,6 +270,7 @@ CONFIG_BOUNCE=y
267CONFIG_VIRT_TO_BUS=y 270CONFIG_VIRT_TO_BUS=y
268CONFIG_HAVE_MLOCK=y 271CONFIG_HAVE_MLOCK=y
269CONFIG_HAVE_MLOCKED_PAGE_BIT=y 272CONFIG_HAVE_MLOCKED_PAGE_BIT=y
273# CONFIG_KSM is not set
270CONFIG_DEFAULT_MMAP_MIN_ADDR=4096 274CONFIG_DEFAULT_MMAP_MIN_ADDR=4096
271CONFIG_PPC_4K_PAGES=y 275CONFIG_PPC_4K_PAGES=y
272# CONFIG_PPC_16K_PAGES is not set 276# CONFIG_PPC_16K_PAGES is not set
@@ -360,6 +364,7 @@ CONFIG_DEFAULT_TCP_CONG="cubic"
360# CONFIG_NETFILTER is not set 364# CONFIG_NETFILTER is not set
361# CONFIG_IP_DCCP is not set 365# CONFIG_IP_DCCP is not set
362# CONFIG_IP_SCTP is not set 366# CONFIG_IP_SCTP is not set
367# CONFIG_RDS is not set
363# CONFIG_TIPC is not set 368# CONFIG_TIPC is not set
364# CONFIG_ATM is not set 369# CONFIG_ATM is not set
365# CONFIG_BRIDGE is not set 370# CONFIG_BRIDGE is not set
@@ -389,6 +394,7 @@ CONFIG_DEFAULT_TCP_CONG="cubic"
389# CONFIG_AF_RXRPC is not set 394# CONFIG_AF_RXRPC is not set
390CONFIG_WIRELESS=y 395CONFIG_WIRELESS=y
391# CONFIG_CFG80211 is not set 396# CONFIG_CFG80211 is not set
397CONFIG_CFG80211_DEFAULT_PS_VALUE=0
392CONFIG_WIRELESS_OLD_REGULATORY=y 398CONFIG_WIRELESS_OLD_REGULATORY=y
393# CONFIG_WIRELESS_EXT is not set 399# CONFIG_WIRELESS_EXT is not set
394# CONFIG_LIB80211 is not set 400# CONFIG_LIB80211 is not set
@@ -396,7 +402,6 @@ CONFIG_WIRELESS_OLD_REGULATORY=y
396# 402#
397# CFG80211 needs to be enabled for MAC80211 403# CFG80211 needs to be enabled for MAC80211
398# 404#
399CONFIG_MAC80211_DEFAULT_PS_VALUE=0
400# CONFIG_WIMAX is not set 405# CONFIG_WIMAX is not set
401# CONFIG_RFKILL is not set 406# CONFIG_RFKILL is not set
402# CONFIG_NET_9P is not set 407# CONFIG_NET_9P is not set
@@ -409,6 +414,7 @@ CONFIG_MAC80211_DEFAULT_PS_VALUE=0
409# Generic Driver Options 414# Generic Driver Options
410# 415#
411CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug" 416CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
417# CONFIG_DEVTMPFS is not set
412CONFIG_STANDALONE=y 418CONFIG_STANDALONE=y
413CONFIG_PREVENT_FIRMWARE_BUILD=y 419CONFIG_PREVENT_FIRMWARE_BUILD=y
414CONFIG_FW_LOADER=y 420CONFIG_FW_LOADER=y
@@ -633,6 +639,7 @@ CONFIG_SCSI_LOWLEVEL=y
633# CONFIG_ISCSI_TCP is not set 639# CONFIG_ISCSI_TCP is not set
634# CONFIG_SCSI_CXGB3_ISCSI is not set 640# CONFIG_SCSI_CXGB3_ISCSI is not set
635# CONFIG_SCSI_BNX2_ISCSI is not set 641# CONFIG_SCSI_BNX2_ISCSI is not set
642# CONFIG_BE2ISCSI is not set
636# CONFIG_BLK_DEV_3W_XXXX_RAID is not set 643# CONFIG_BLK_DEV_3W_XXXX_RAID is not set
637# CONFIG_SCSI_3W_9XXX is not set 644# CONFIG_SCSI_3W_9XXX is not set
638# CONFIG_SCSI_ACARD is not set 645# CONFIG_SCSI_ACARD is not set
@@ -672,11 +679,14 @@ CONFIG_SCSI_LOWLEVEL=y
672# CONFIG_SCSI_DC390T is not set 679# CONFIG_SCSI_DC390T is not set
673# CONFIG_SCSI_NSP32 is not set 680# CONFIG_SCSI_NSP32 is not set
674# CONFIG_SCSI_DEBUG is not set 681# CONFIG_SCSI_DEBUG is not set
682# CONFIG_SCSI_PMCRAID is not set
675# CONFIG_SCSI_SRP is not set 683# CONFIG_SCSI_SRP is not set
684# CONFIG_SCSI_BFA_FC is not set
676# CONFIG_SCSI_DH is not set 685# CONFIG_SCSI_DH is not set
677# CONFIG_SCSI_OSD_INITIATOR is not set 686# CONFIG_SCSI_OSD_INITIATOR is not set
678CONFIG_ATA=y 687CONFIG_ATA=y
679# CONFIG_ATA_NONSTANDARD is not set 688# CONFIG_ATA_NONSTANDARD is not set
689CONFIG_ATA_VERBOSE_ERROR=y
680CONFIG_SATA_PMP=y 690CONFIG_SATA_PMP=y
681# CONFIG_SATA_AHCI is not set 691# CONFIG_SATA_AHCI is not set
682# CONFIG_SATA_SIL24 is not set 692# CONFIG_SATA_SIL24 is not set
@@ -698,6 +708,7 @@ CONFIG_SATA_MV=y
698# CONFIG_PATA_ALI is not set 708# CONFIG_PATA_ALI is not set
699# CONFIG_PATA_AMD is not set 709# CONFIG_PATA_AMD is not set
700# CONFIG_PATA_ARTOP is not set 710# CONFIG_PATA_ARTOP is not set
711# CONFIG_PATA_ATP867X is not set
701# CONFIG_PATA_ATIIXP is not set 712# CONFIG_PATA_ATIIXP is not set
702# CONFIG_PATA_CMD640_PCI is not set 713# CONFIG_PATA_CMD640_PCI is not set
703# CONFIG_PATA_CMD64X is not set 714# CONFIG_PATA_CMD64X is not set
@@ -725,6 +736,7 @@ CONFIG_SATA_MV=y
725# CONFIG_PATA_OPTIDMA is not set 736# CONFIG_PATA_OPTIDMA is not set
726# CONFIG_PATA_PDC_OLD is not set 737# CONFIG_PATA_PDC_OLD is not set
727# CONFIG_PATA_RADISYS is not set 738# CONFIG_PATA_RADISYS is not set
739# CONFIG_PATA_RDC is not set
728# CONFIG_PATA_RZ1000 is not set 740# CONFIG_PATA_RZ1000 is not set
729# CONFIG_PATA_SC1200 is not set 741# CONFIG_PATA_SC1200 is not set
730# CONFIG_PATA_SERVERWORKS is not set 742# CONFIG_PATA_SERVERWORKS is not set
@@ -823,9 +835,11 @@ CONFIG_8139TOO=y
823# CONFIG_SUNDANCE is not set 835# CONFIG_SUNDANCE is not set
824# CONFIG_TLAN is not set 836# CONFIG_TLAN is not set
825# CONFIG_KS8842 is not set 837# CONFIG_KS8842 is not set
838# CONFIG_KS8851_MLL is not set
826# CONFIG_VIA_RHINE is not set 839# CONFIG_VIA_RHINE is not set
827# CONFIG_SC92031 is not set 840# CONFIG_SC92031 is not set
828# CONFIG_ATL2 is not set 841# CONFIG_ATL2 is not set
842# CONFIG_XILINX_EMACLITE is not set
829CONFIG_NETDEV_1000=y 843CONFIG_NETDEV_1000=y
830# CONFIG_ACENIC is not set 844# CONFIG_ACENIC is not set
831# CONFIG_DL2K is not set 845# CONFIG_DL2K is not set
@@ -871,10 +885,7 @@ CONFIG_CHELSIO_T3_DEPENDS=y
871# CONFIG_SFC is not set 885# CONFIG_SFC is not set
872# CONFIG_BE2NET is not set 886# CONFIG_BE2NET is not set
873# CONFIG_TR is not set 887# CONFIG_TR is not set
874 888CONFIG_WLAN=y
875#
876# Wireless LAN
877#
878# CONFIG_WLAN_PRE80211 is not set 889# CONFIG_WLAN_PRE80211 is not set
879# CONFIG_WLAN_80211 is not set 890# CONFIG_WLAN_80211 is not set
880 891
@@ -977,6 +988,7 @@ CONFIG_LEGACY_PTY_COUNT=256
977CONFIG_DEVPORT=y 988CONFIG_DEVPORT=y
978CONFIG_I2C=y 989CONFIG_I2C=y
979CONFIG_I2C_BOARDINFO=y 990CONFIG_I2C_BOARDINFO=y
991CONFIG_I2C_COMPAT=y
980CONFIG_I2C_CHARDEV=y 992CONFIG_I2C_CHARDEV=y
981CONFIG_I2C_HELPER_AUTO=y 993CONFIG_I2C_HELPER_AUTO=y
982 994
@@ -1031,9 +1043,6 @@ CONFIG_I2C_MV64XXX=y
1031# Miscellaneous I2C Chip support 1043# Miscellaneous I2C Chip support
1032# 1044#
1033# CONFIG_DS1682 is not set 1045# CONFIG_DS1682 is not set
1034# CONFIG_SENSORS_PCF8574 is not set
1035# CONFIG_PCF8575 is not set
1036# CONFIG_SENSORS_PCA9539 is not set
1037# CONFIG_SENSORS_TSL2550 is not set 1046# CONFIG_SENSORS_TSL2550 is not set
1038# CONFIG_I2C_DEBUG_CORE is not set 1047# CONFIG_I2C_DEBUG_CORE is not set
1039# CONFIG_I2C_DEBUG_ALGO is not set 1048# CONFIG_I2C_DEBUG_ALGO is not set
@@ -1051,6 +1060,11 @@ CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y
1051# CONFIG_POWER_SUPPLY is not set 1060# CONFIG_POWER_SUPPLY is not set
1052CONFIG_HWMON=y 1061CONFIG_HWMON=y
1053# CONFIG_HWMON_VID is not set 1062# CONFIG_HWMON_VID is not set
1063# CONFIG_HWMON_DEBUG_CHIP is not set
1064
1065#
1066# Native drivers
1067#
1054# CONFIG_SENSORS_AD7414 is not set 1068# CONFIG_SENSORS_AD7414 is not set
1055# CONFIG_SENSORS_AD7418 is not set 1069# CONFIG_SENSORS_AD7418 is not set
1056# CONFIG_SENSORS_ADM1021 is not set 1070# CONFIG_SENSORS_ADM1021 is not set
@@ -1100,6 +1114,7 @@ CONFIG_HWMON=y
1100# CONFIG_SENSORS_ADS7828 is not set 1114# CONFIG_SENSORS_ADS7828 is not set
1101# CONFIG_SENSORS_THMC50 is not set 1115# CONFIG_SENSORS_THMC50 is not set
1102# CONFIG_SENSORS_TMP401 is not set 1116# CONFIG_SENSORS_TMP401 is not set
1117# CONFIG_SENSORS_TMP421 is not set
1103# CONFIG_SENSORS_VIA686A is not set 1118# CONFIG_SENSORS_VIA686A is not set
1104# CONFIG_SENSORS_VT1211 is not set 1119# CONFIG_SENSORS_VT1211 is not set
1105# CONFIG_SENSORS_VT8231 is not set 1120# CONFIG_SENSORS_VT8231 is not set
@@ -1111,9 +1126,7 @@ CONFIG_HWMON=y
1111# CONFIG_SENSORS_W83L786NG is not set 1126# CONFIG_SENSORS_W83L786NG is not set
1112# CONFIG_SENSORS_W83627HF is not set 1127# CONFIG_SENSORS_W83627HF is not set
1113# CONFIG_SENSORS_W83627EHF is not set 1128# CONFIG_SENSORS_W83627EHF is not set
1114# CONFIG_HWMON_DEBUG_CHIP is not set
1115# CONFIG_THERMAL is not set 1129# CONFIG_THERMAL is not set
1116# CONFIG_THERMAL_HWMON is not set
1117# CONFIG_WATCHDOG is not set 1130# CONFIG_WATCHDOG is not set
1118CONFIG_SSB_POSSIBLE=y 1131CONFIG_SSB_POSSIBLE=y
1119 1132
@@ -1132,6 +1145,7 @@ CONFIG_SSB_POSSIBLE=y
1132# CONFIG_MFD_TMIO is not set 1145# CONFIG_MFD_TMIO is not set
1133# CONFIG_PMIC_DA903X is not set 1146# CONFIG_PMIC_DA903X is not set
1134# CONFIG_MFD_WM8400 is not set 1147# CONFIG_MFD_WM8400 is not set
1148# CONFIG_MFD_WM831X is not set
1135# CONFIG_MFD_WM8350_I2C is not set 1149# CONFIG_MFD_WM8350_I2C is not set
1136# CONFIG_MFD_PCF50633 is not set 1150# CONFIG_MFD_PCF50633 is not set
1137# CONFIG_AB3100_CORE is not set 1151# CONFIG_AB3100_CORE is not set
@@ -1142,6 +1156,7 @@ CONFIG_SSB_POSSIBLE=y
1142# Graphics support 1156# Graphics support
1143# 1157#
1144# CONFIG_AGP is not set 1158# CONFIG_AGP is not set
1159CONFIG_VGA_ARB=y
1145# CONFIG_DRM is not set 1160# CONFIG_DRM is not set
1146# CONFIG_VGASTATE is not set 1161# CONFIG_VGASTATE is not set
1147CONFIG_VIDEO_OUTPUT_CONTROL=y 1162CONFIG_VIDEO_OUTPUT_CONTROL=y
@@ -1162,7 +1177,6 @@ CONFIG_DUMMY_CONSOLE=y
1162# CONFIG_SOUND is not set 1177# CONFIG_SOUND is not set
1163CONFIG_HID_SUPPORT=y 1178CONFIG_HID_SUPPORT=y
1164CONFIG_HID=y 1179CONFIG_HID=y
1165# CONFIG_HID_DEBUG is not set
1166# CONFIG_HIDRAW is not set 1180# CONFIG_HIDRAW is not set
1167 1181
1168# 1182#
@@ -1186,6 +1200,7 @@ CONFIG_HID_DRAGONRISE=y
1186CONFIG_HID_EZKEY=y 1200CONFIG_HID_EZKEY=y
1187CONFIG_HID_KYE=y 1201CONFIG_HID_KYE=y
1188CONFIG_HID_GYRATION=y 1202CONFIG_HID_GYRATION=y
1203CONFIG_HID_TWINHAN=y
1189CONFIG_HID_KENSINGTON=y 1204CONFIG_HID_KENSINGTON=y
1190CONFIG_HID_LOGITECH=y 1205CONFIG_HID_LOGITECH=y
1191# CONFIG_LOGITECH_FF is not set 1206# CONFIG_LOGITECH_FF is not set
@@ -1239,6 +1254,7 @@ CONFIG_USB_EHCI_HCD_PPC_OF=y
1239# CONFIG_USB_OXU210HP_HCD is not set 1254# CONFIG_USB_OXU210HP_HCD is not set
1240# CONFIG_USB_ISP116X_HCD is not set 1255# CONFIG_USB_ISP116X_HCD is not set
1241# CONFIG_USB_ISP1760_HCD is not set 1256# CONFIG_USB_ISP1760_HCD is not set
1257# CONFIG_USB_ISP1362_HCD is not set
1242CONFIG_USB_OHCI_HCD=y 1258CONFIG_USB_OHCI_HCD=y
1243# CONFIG_USB_OHCI_HCD_PPC_OF_BE is not set 1259# CONFIG_USB_OHCI_HCD_PPC_OF_BE is not set
1244# CONFIG_USB_OHCI_HCD_PPC_OF_LE is not set 1260# CONFIG_USB_OHCI_HCD_PPC_OF_LE is not set
@@ -1404,6 +1420,7 @@ CONFIG_FS_MBCACHE=y
1404# CONFIG_GFS2_FS is not set 1420# CONFIG_GFS2_FS is not set
1405# CONFIG_OCFS2_FS is not set 1421# CONFIG_OCFS2_FS is not set
1406# CONFIG_BTRFS_FS is not set 1422# CONFIG_BTRFS_FS is not set
1423# CONFIG_NILFS2_FS is not set
1407CONFIG_FILE_LOCKING=y 1424CONFIG_FILE_LOCKING=y
1408CONFIG_FSNOTIFY=y 1425CONFIG_FSNOTIFY=y
1409CONFIG_DNOTIFY=y 1426CONFIG_DNOTIFY=y
@@ -1463,7 +1480,6 @@ CONFIG_MISC_FILESYSTEMS=y
1463# CONFIG_ROMFS_FS is not set 1480# CONFIG_ROMFS_FS is not set
1464# CONFIG_SYSV_FS is not set 1481# CONFIG_SYSV_FS is not set
1465# CONFIG_UFS_FS is not set 1482# CONFIG_UFS_FS is not set
1466# CONFIG_NILFS2_FS is not set
1467CONFIG_NETWORK_FILESYSTEMS=y 1483CONFIG_NETWORK_FILESYSTEMS=y
1468CONFIG_NFS_FS=y 1484CONFIG_NFS_FS=y
1469# CONFIG_NFS_V3 is not set 1485# CONFIG_NFS_V3 is not set
@@ -1576,6 +1592,7 @@ CONFIG_ENABLE_WARN_DEPRECATED=y
1576CONFIG_ENABLE_MUST_CHECK=y 1592CONFIG_ENABLE_MUST_CHECK=y
1577CONFIG_FRAME_WARN=1024 1593CONFIG_FRAME_WARN=1024
1578# CONFIG_MAGIC_SYSRQ is not set 1594# CONFIG_MAGIC_SYSRQ is not set
1595# CONFIG_STRIP_ASM_SYMS is not set
1579# CONFIG_UNUSED_SYMBOLS is not set 1596# CONFIG_UNUSED_SYMBOLS is not set
1580# CONFIG_DEBUG_FS is not set 1597# CONFIG_DEBUG_FS is not set
1581# CONFIG_HEADERS_CHECK is not set 1598# CONFIG_HEADERS_CHECK is not set
@@ -1593,6 +1610,7 @@ CONFIG_HAVE_DYNAMIC_FTRACE=y
1593CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y 1610CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y
1594CONFIG_TRACING_SUPPORT=y 1611CONFIG_TRACING_SUPPORT=y
1595# CONFIG_FTRACE is not set 1612# CONFIG_FTRACE is not set
1613# CONFIG_DMA_API_DEBUG is not set
1596# CONFIG_SAMPLES is not set 1614# CONFIG_SAMPLES is not set
1597CONFIG_HAVE_ARCH_KGDB=y 1615CONFIG_HAVE_ARCH_KGDB=y
1598# CONFIG_PPC_DISABLE_WERROR is not set 1616# CONFIG_PPC_DISABLE_WERROR is not set
@@ -1614,7 +1632,6 @@ CONFIG_CRYPTO=y
1614# 1632#
1615# Crypto core or helper 1633# Crypto core or helper
1616# 1634#
1617# CONFIG_CRYPTO_FIPS is not set
1618# CONFIG_CRYPTO_MANAGER is not set 1635# CONFIG_CRYPTO_MANAGER is not set
1619# CONFIG_CRYPTO_MANAGER2 is not set 1636# CONFIG_CRYPTO_MANAGER2 is not set
1620# CONFIG_CRYPTO_GF128MUL is not set 1637# CONFIG_CRYPTO_GF128MUL is not set
@@ -1645,11 +1662,13 @@ CONFIG_CRYPTO=y
1645# 1662#
1646# CONFIG_CRYPTO_HMAC is not set 1663# CONFIG_CRYPTO_HMAC is not set
1647# CONFIG_CRYPTO_XCBC is not set 1664# CONFIG_CRYPTO_XCBC is not set
1665# CONFIG_CRYPTO_VMAC is not set
1648 1666
1649# 1667#
1650# Digest 1668# Digest
1651# 1669#
1652# CONFIG_CRYPTO_CRC32C is not set 1670# CONFIG_CRYPTO_CRC32C is not set
1671# CONFIG_CRYPTO_GHASH is not set
1653# CONFIG_CRYPTO_MD4 is not set 1672# CONFIG_CRYPTO_MD4 is not set
1654# CONFIG_CRYPTO_MD5 is not set 1673# CONFIG_CRYPTO_MD5 is not set
1655# CONFIG_CRYPTO_MICHAEL_MIC is not set 1674# CONFIG_CRYPTO_MICHAEL_MIC is not set
diff --git a/arch/powerpc/configs/pseries_defconfig b/arch/powerpc/configs/pseries_defconfig
index f1889abb89b1..c568329723b8 100644
--- a/arch/powerpc/configs/pseries_defconfig
+++ b/arch/powerpc/configs/pseries_defconfig
@@ -1683,7 +1683,7 @@ CONFIG_HAVE_ARCH_KGDB=y
1683CONFIG_DEBUG_STACKOVERFLOW=y 1683CONFIG_DEBUG_STACKOVERFLOW=y
1684# CONFIG_DEBUG_STACK_USAGE is not set 1684# CONFIG_DEBUG_STACK_USAGE is not set
1685# CONFIG_DEBUG_PAGEALLOC is not set 1685# CONFIG_DEBUG_PAGEALLOC is not set
1686CONFIG_HCALL_STATS=y 1686# CONFIG_HCALL_STATS is not set
1687# CONFIG_CODE_PATCHING_SELFTEST is not set 1687# CONFIG_CODE_PATCHING_SELFTEST is not set
1688# CONFIG_FTR_FIXUP_SELFTEST is not set 1688# CONFIG_FTR_FIXUP_SELFTEST is not set
1689# CONFIG_MSI_BITMAP_SELFTEST is not set 1689# CONFIG_MSI_BITMAP_SELFTEST is not set
diff --git a/arch/powerpc/configs/storcenter_defconfig b/arch/powerpc/configs/storcenter_defconfig
index 28384dc01003..524263158fc0 100644
--- a/arch/powerpc/configs/storcenter_defconfig
+++ b/arch/powerpc/configs/storcenter_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.31-rc4 3# Linux kernel version: 2.6.32-rc5
4# Wed Jul 29 23:32:01 2009 4# Thu Nov 5 08:20:19 2009
5# 5#
6# CONFIG_PPC64 is not set 6# CONFIG_PPC64 is not set
7 7
@@ -34,6 +34,7 @@ CONFIG_GENERIC_CLOCKEVENTS=y
34CONFIG_GENERIC_HARDIRQS=y 34CONFIG_GENERIC_HARDIRQS=y
35CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y 35CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y
36# CONFIG_HAVE_SETUP_PER_CPU_AREA is not set 36# CONFIG_HAVE_SETUP_PER_CPU_AREA is not set
37# CONFIG_NEED_PER_CPU_EMBED_FIRST_CHUNK is not set
37CONFIG_IRQ_PER_CPU=y 38CONFIG_IRQ_PER_CPU=y
38CONFIG_STACKTRACE_SUPPORT=y 39CONFIG_STACKTRACE_SUPPORT=y
39CONFIG_HAVE_LATENCYTOP_SUPPORT=y 40CONFIG_HAVE_LATENCYTOP_SUPPORT=y
@@ -82,11 +83,12 @@ CONFIG_SYSVIPC_SYSCTL=y
82# 83#
83# RCU Subsystem 84# RCU Subsystem
84# 85#
85CONFIG_CLASSIC_RCU=y 86CONFIG_TREE_RCU=y
86# CONFIG_TREE_RCU is not set 87# CONFIG_TREE_PREEMPT_RCU is not set
87# CONFIG_PREEMPT_RCU is not set 88# CONFIG_RCU_TRACE is not set
89CONFIG_RCU_FANOUT=32
90# CONFIG_RCU_FANOUT_EXACT is not set
88# CONFIG_TREE_RCU_TRACE is not set 91# CONFIG_TREE_RCU_TRACE is not set
89# CONFIG_PREEMPT_RCU_TRACE is not set
90# CONFIG_IKCONFIG is not set 92# CONFIG_IKCONFIG is not set
91CONFIG_LOG_BUF_SHIFT=14 93CONFIG_LOG_BUF_SHIFT=14
92CONFIG_GROUP_SCHED=y 94CONFIG_GROUP_SCHED=y
@@ -118,28 +120,29 @@ CONFIG_TIMERFD=y
118CONFIG_EVENTFD=y 120CONFIG_EVENTFD=y
119CONFIG_SHMEM=y 121CONFIG_SHMEM=y
120CONFIG_AIO=y 122CONFIG_AIO=y
121CONFIG_HAVE_PERF_COUNTERS=y 123CONFIG_HAVE_PERF_EVENTS=y
122 124
123# 125#
124# Performance Counters 126# Kernel Performance Events And Counters
125# 127#
128# CONFIG_PERF_EVENTS is not set
126# CONFIG_PERF_COUNTERS is not set 129# CONFIG_PERF_COUNTERS is not set
127CONFIG_VM_EVENT_COUNTERS=y 130CONFIG_VM_EVENT_COUNTERS=y
128CONFIG_PCI_QUIRKS=y 131CONFIG_PCI_QUIRKS=y
129CONFIG_SLUB_DEBUG=y 132CONFIG_SLUB_DEBUG=y
130# CONFIG_STRIP_ASM_SYMS is not set
131CONFIG_COMPAT_BRK=y 133CONFIG_COMPAT_BRK=y
132# CONFIG_SLAB is not set 134# CONFIG_SLAB is not set
133CONFIG_SLUB=y 135CONFIG_SLUB=y
134# CONFIG_SLOB is not set 136# CONFIG_SLOB is not set
135# CONFIG_PROFILING is not set 137# CONFIG_PROFILING is not set
136# CONFIG_MARKERS is not set
137CONFIG_HAVE_OPROFILE=y 138CONFIG_HAVE_OPROFILE=y
138CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS=y 139CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS=y
139CONFIG_HAVE_IOREMAP_PROT=y 140CONFIG_HAVE_IOREMAP_PROT=y
140CONFIG_HAVE_KPROBES=y 141CONFIG_HAVE_KPROBES=y
141CONFIG_HAVE_KRETPROBES=y 142CONFIG_HAVE_KRETPROBES=y
142CONFIG_HAVE_ARCH_TRACEHOOK=y 143CONFIG_HAVE_ARCH_TRACEHOOK=y
144CONFIG_HAVE_DMA_ATTRS=y
145CONFIG_HAVE_DMA_API_DEBUG=y
143 146
144# 147#
145# GCOV-based kernel profiling 148# GCOV-based kernel profiling
@@ -243,6 +246,7 @@ CONFIG_ARCH_HAS_WALK_MEMORY=y
243CONFIG_ARCH_ENABLE_MEMORY_HOTREMOVE=y 246CONFIG_ARCH_ENABLE_MEMORY_HOTREMOVE=y
244# CONFIG_KEXEC is not set 247# CONFIG_KEXEC is not set
245# CONFIG_CRASH_DUMP is not set 248# CONFIG_CRASH_DUMP is not set
249CONFIG_MAX_ACTIVE_REGIONS=32
246CONFIG_ARCH_FLATMEM_ENABLE=y 250CONFIG_ARCH_FLATMEM_ENABLE=y
247CONFIG_ARCH_POPULATES_NODE_MAP=y 251CONFIG_ARCH_POPULATES_NODE_MAP=y
248CONFIG_SELECT_MEMORY_MODEL=y 252CONFIG_SELECT_MEMORY_MODEL=y
@@ -260,6 +264,7 @@ CONFIG_BOUNCE=y
260CONFIG_VIRT_TO_BUS=y 264CONFIG_VIRT_TO_BUS=y
261CONFIG_HAVE_MLOCK=y 265CONFIG_HAVE_MLOCK=y
262CONFIG_HAVE_MLOCKED_PAGE_BIT=y 266CONFIG_HAVE_MLOCKED_PAGE_BIT=y
267# CONFIG_KSM is not set
263CONFIG_DEFAULT_MMAP_MIN_ADDR=4096 268CONFIG_DEFAULT_MMAP_MIN_ADDR=4096
264CONFIG_PPC_4K_PAGES=y 269CONFIG_PPC_4K_PAGES=y
265# CONFIG_PPC_16K_PAGES is not set 270# CONFIG_PPC_16K_PAGES is not set
@@ -349,6 +354,7 @@ CONFIG_DEFAULT_TCP_CONG="cubic"
349# CONFIG_NETFILTER is not set 354# CONFIG_NETFILTER is not set
350# CONFIG_IP_DCCP is not set 355# CONFIG_IP_DCCP is not set
351# CONFIG_IP_SCTP is not set 356# CONFIG_IP_SCTP is not set
357# CONFIG_RDS is not set
352# CONFIG_TIPC is not set 358# CONFIG_TIPC is not set
353# CONFIG_ATM is not set 359# CONFIG_ATM is not set
354# CONFIG_BRIDGE is not set 360# CONFIG_BRIDGE is not set
@@ -378,6 +384,7 @@ CONFIG_DEFAULT_TCP_CONG="cubic"
378# CONFIG_AF_RXRPC is not set 384# CONFIG_AF_RXRPC is not set
379CONFIG_WIRELESS=y 385CONFIG_WIRELESS=y
380# CONFIG_CFG80211 is not set 386# CONFIG_CFG80211 is not set
387CONFIG_CFG80211_DEFAULT_PS_VALUE=0
381CONFIG_WIRELESS_OLD_REGULATORY=y 388CONFIG_WIRELESS_OLD_REGULATORY=y
382# CONFIG_WIRELESS_EXT is not set 389# CONFIG_WIRELESS_EXT is not set
383# CONFIG_LIB80211 is not set 390# CONFIG_LIB80211 is not set
@@ -385,7 +392,6 @@ CONFIG_WIRELESS_OLD_REGULATORY=y
385# 392#
386# CFG80211 needs to be enabled for MAC80211 393# CFG80211 needs to be enabled for MAC80211
387# 394#
388CONFIG_MAC80211_DEFAULT_PS_VALUE=0
389# CONFIG_WIMAX is not set 395# CONFIG_WIMAX is not set
390# CONFIG_RFKILL is not set 396# CONFIG_RFKILL is not set
391# CONFIG_NET_9P is not set 397# CONFIG_NET_9P is not set
@@ -398,6 +404,7 @@ CONFIG_MAC80211_DEFAULT_PS_VALUE=0
398# Generic Driver Options 404# Generic Driver Options
399# 405#
400CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug" 406CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
407# CONFIG_DEVTMPFS is not set
401CONFIG_STANDALONE=y 408CONFIG_STANDALONE=y
402CONFIG_PREVENT_FIRMWARE_BUILD=y 409CONFIG_PREVENT_FIRMWARE_BUILD=y
403# CONFIG_FW_LOADER is not set 410# CONFIG_FW_LOADER is not set
@@ -405,9 +412,9 @@ CONFIG_PREVENT_FIRMWARE_BUILD=y
405# CONFIG_CONNECTOR is not set 412# CONFIG_CONNECTOR is not set
406CONFIG_MTD=y 413CONFIG_MTD=y
407# CONFIG_MTD_DEBUG is not set 414# CONFIG_MTD_DEBUG is not set
415# CONFIG_MTD_TESTS is not set
408# CONFIG_MTD_CONCAT is not set 416# CONFIG_MTD_CONCAT is not set
409CONFIG_MTD_PARTITIONS=y 417CONFIG_MTD_PARTITIONS=y
410# CONFIG_MTD_TESTS is not set
411# CONFIG_MTD_REDBOOT_PARTS is not set 418# CONFIG_MTD_REDBOOT_PARTS is not set
412CONFIG_MTD_CMDLINE_PARTS=y 419CONFIG_MTD_CMDLINE_PARTS=y
413CONFIG_MTD_OF_PARTS=y 420CONFIG_MTD_OF_PARTS=y
@@ -619,6 +626,7 @@ CONFIG_SCSI_SPI_ATTRS=y
619CONFIG_SCSI_LOWLEVEL=y 626CONFIG_SCSI_LOWLEVEL=y
620# CONFIG_ISCSI_TCP is not set 627# CONFIG_ISCSI_TCP is not set
621# CONFIG_SCSI_BNX2_ISCSI is not set 628# CONFIG_SCSI_BNX2_ISCSI is not set
629# CONFIG_BE2ISCSI is not set
622# CONFIG_BLK_DEV_3W_XXXX_RAID is not set 630# CONFIG_BLK_DEV_3W_XXXX_RAID is not set
623# CONFIG_SCSI_3W_9XXX is not set 631# CONFIG_SCSI_3W_9XXX is not set
624# CONFIG_SCSI_ACARD is not set 632# CONFIG_SCSI_ACARD is not set
@@ -657,7 +665,9 @@ CONFIG_SCSI_LOWLEVEL=y
657# CONFIG_SCSI_DC390T is not set 665# CONFIG_SCSI_DC390T is not set
658# CONFIG_SCSI_NSP32 is not set 666# CONFIG_SCSI_NSP32 is not set
659# CONFIG_SCSI_DEBUG is not set 667# CONFIG_SCSI_DEBUG is not set
668# CONFIG_SCSI_PMCRAID is not set
660# CONFIG_SCSI_SRP is not set 669# CONFIG_SCSI_SRP is not set
670# CONFIG_SCSI_BFA_FC is not set
661# CONFIG_SCSI_DH is not set 671# CONFIG_SCSI_DH is not set
662# CONFIG_SCSI_OSD_INITIATOR is not set 672# CONFIG_SCSI_OSD_INITIATOR is not set
663# CONFIG_ATA is not set 673# CONFIG_ATA is not set
@@ -670,6 +680,7 @@ CONFIG_MD_RAID1=y
670# CONFIG_MD_RAID10 is not set 680# CONFIG_MD_RAID10 is not set
671CONFIG_MD_RAID456=y 681CONFIG_MD_RAID456=y
672CONFIG_MD_RAID6_PQ=y 682CONFIG_MD_RAID6_PQ=y
683# CONFIG_ASYNC_RAID6_TEST is not set
673# CONFIG_MD_MULTIPATH is not set 684# CONFIG_MD_MULTIPATH is not set
674# CONFIG_MD_FAULTY is not set 685# CONFIG_MD_FAULTY is not set
675# CONFIG_BLK_DEV_DM is not set 686# CONFIG_BLK_DEV_DM is not set
@@ -729,10 +740,7 @@ CONFIG_R8169=y
729# CONFIG_JME is not set 740# CONFIG_JME is not set
730# CONFIG_NETDEV_10000 is not set 741# CONFIG_NETDEV_10000 is not set
731# CONFIG_TR is not set 742# CONFIG_TR is not set
732 743CONFIG_WLAN=y
733#
734# Wireless LAN
735#
736# CONFIG_WLAN_PRE80211 is not set 744# CONFIG_WLAN_PRE80211 is not set
737# CONFIG_WLAN_80211 is not set 745# CONFIG_WLAN_80211 is not set
738 746
@@ -813,6 +821,7 @@ CONFIG_NVRAM=y
813CONFIG_DEVPORT=y 821CONFIG_DEVPORT=y
814CONFIG_I2C=y 822CONFIG_I2C=y
815CONFIG_I2C_BOARDINFO=y 823CONFIG_I2C_BOARDINFO=y
824CONFIG_I2C_COMPAT=y
816CONFIG_I2C_CHARDEV=y 825CONFIG_I2C_CHARDEV=y
817CONFIG_I2C_HELPER_AUTO=y 826CONFIG_I2C_HELPER_AUTO=y
818 827
@@ -867,9 +876,6 @@ CONFIG_I2C_MPC=y
867# Miscellaneous I2C Chip support 876# Miscellaneous I2C Chip support
868# 877#
869# CONFIG_DS1682 is not set 878# CONFIG_DS1682 is not set
870# CONFIG_SENSORS_PCF8574 is not set
871# CONFIG_PCF8575 is not set
872# CONFIG_SENSORS_PCA9539 is not set
873# CONFIG_SENSORS_TSL2550 is not set 879# CONFIG_SENSORS_TSL2550 is not set
874# CONFIG_I2C_DEBUG_CORE is not set 880# CONFIG_I2C_DEBUG_CORE is not set
875# CONFIG_I2C_DEBUG_ALGO is not set 881# CONFIG_I2C_DEBUG_ALGO is not set
@@ -887,7 +893,6 @@ CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y
887# CONFIG_POWER_SUPPLY is not set 893# CONFIG_POWER_SUPPLY is not set
888# CONFIG_HWMON is not set 894# CONFIG_HWMON is not set
889# CONFIG_THERMAL is not set 895# CONFIG_THERMAL is not set
890# CONFIG_THERMAL_HWMON is not set
891# CONFIG_WATCHDOG is not set 896# CONFIG_WATCHDOG is not set
892CONFIG_SSB_POSSIBLE=y 897CONFIG_SSB_POSSIBLE=y
893 898
@@ -906,6 +911,7 @@ CONFIG_SSB_POSSIBLE=y
906# CONFIG_MFD_TMIO is not set 911# CONFIG_MFD_TMIO is not set
907# CONFIG_PMIC_DA903X is not set 912# CONFIG_PMIC_DA903X is not set
908# CONFIG_MFD_WM8400 is not set 913# CONFIG_MFD_WM8400 is not set
914# CONFIG_MFD_WM831X is not set
909# CONFIG_MFD_WM8350_I2C is not set 915# CONFIG_MFD_WM8350_I2C is not set
910# CONFIG_MFD_PCF50633 is not set 916# CONFIG_MFD_PCF50633 is not set
911# CONFIG_AB3100_CORE is not set 917# CONFIG_AB3100_CORE is not set
@@ -916,6 +922,7 @@ CONFIG_SSB_POSSIBLE=y
916# Graphics support 922# Graphics support
917# 923#
918# CONFIG_AGP is not set 924# CONFIG_AGP is not set
925CONFIG_VGA_ARB=y
919# CONFIG_DRM is not set 926# CONFIG_DRM is not set
920# CONFIG_VGASTATE is not set 927# CONFIG_VGASTATE is not set
921# CONFIG_VIDEO_OUTPUT_CONTROL is not set 928# CONFIG_VIDEO_OUTPUT_CONTROL is not set
@@ -961,6 +968,7 @@ CONFIG_USB_EHCI_HCD_PPC_OF=y
961# CONFIG_USB_OXU210HP_HCD is not set 968# CONFIG_USB_OXU210HP_HCD is not set
962# CONFIG_USB_ISP116X_HCD is not set 969# CONFIG_USB_ISP116X_HCD is not set
963# CONFIG_USB_ISP1760_HCD is not set 970# CONFIG_USB_ISP1760_HCD is not set
971# CONFIG_USB_ISP1362_HCD is not set
964CONFIG_USB_OHCI_HCD=y 972CONFIG_USB_OHCI_HCD=y
965# CONFIG_USB_OHCI_HCD_PPC_OF_BE is not set 973# CONFIG_USB_OHCI_HCD_PPC_OF_BE is not set
966# CONFIG_USB_OHCI_HCD_PPC_OF_LE is not set 974# CONFIG_USB_OHCI_HCD_PPC_OF_LE is not set
@@ -1141,6 +1149,7 @@ CONFIG_XFS_FS=m
1141# CONFIG_GFS2_FS is not set 1149# CONFIG_GFS2_FS is not set
1142# CONFIG_OCFS2_FS is not set 1150# CONFIG_OCFS2_FS is not set
1143# CONFIG_BTRFS_FS is not set 1151# CONFIG_BTRFS_FS is not set
1152# CONFIG_NILFS2_FS is not set
1144CONFIG_FILE_LOCKING=y 1153CONFIG_FILE_LOCKING=y
1145CONFIG_FSNOTIFY=y 1154CONFIG_FSNOTIFY=y
1146CONFIG_DNOTIFY=y 1155CONFIG_DNOTIFY=y
@@ -1210,7 +1219,6 @@ CONFIG_JFFS2_RTIME=y
1210# CONFIG_ROMFS_FS is not set 1219# CONFIG_ROMFS_FS is not set
1211# CONFIG_SYSV_FS is not set 1220# CONFIG_SYSV_FS is not set
1212# CONFIG_UFS_FS is not set 1221# CONFIG_UFS_FS is not set
1213# CONFIG_NILFS2_FS is not set
1214# CONFIG_NETWORK_FILESYSTEMS is not set 1222# CONFIG_NETWORK_FILESYSTEMS is not set
1215CONFIG_EXPORTFS=m 1223CONFIG_EXPORTFS=m
1216 1224
@@ -1307,6 +1315,7 @@ CONFIG_GENERIC_ATOMIC64=y
1307# CONFIG_ENABLE_MUST_CHECK is not set 1315# CONFIG_ENABLE_MUST_CHECK is not set
1308CONFIG_FRAME_WARN=1024 1316CONFIG_FRAME_WARN=1024
1309# CONFIG_MAGIC_SYSRQ is not set 1317# CONFIG_MAGIC_SYSRQ is not set
1318# CONFIG_STRIP_ASM_SYMS is not set
1310# CONFIG_UNUSED_SYMBOLS is not set 1319# CONFIG_UNUSED_SYMBOLS is not set
1311# CONFIG_DEBUG_FS is not set 1320# CONFIG_DEBUG_FS is not set
1312# CONFIG_HEADERS_CHECK is not set 1321# CONFIG_HEADERS_CHECK is not set
@@ -1324,6 +1333,7 @@ CONFIG_HAVE_DYNAMIC_FTRACE=y
1324CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y 1333CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y
1325CONFIG_TRACING_SUPPORT=y 1334CONFIG_TRACING_SUPPORT=y
1326# CONFIG_FTRACE is not set 1335# CONFIG_FTRACE is not set
1336# CONFIG_DMA_API_DEBUG is not set
1327# CONFIG_SAMPLES is not set 1337# CONFIG_SAMPLES is not set
1328CONFIG_HAVE_ARCH_KGDB=y 1338CONFIG_HAVE_ARCH_KGDB=y
1329# CONFIG_PPC_DISABLE_WERROR is not set 1339# CONFIG_PPC_DISABLE_WERROR is not set
@@ -1344,6 +1354,8 @@ CONFIG_XOR_BLOCKS=y
1344CONFIG_ASYNC_CORE=y 1354CONFIG_ASYNC_CORE=y
1345CONFIG_ASYNC_MEMCPY=y 1355CONFIG_ASYNC_MEMCPY=y
1346CONFIG_ASYNC_XOR=y 1356CONFIG_ASYNC_XOR=y
1357CONFIG_ASYNC_PQ=y
1358CONFIG_ASYNC_RAID6_RECOV=y
1347# CONFIG_CRYPTO is not set 1359# CONFIG_CRYPTO is not set
1348# CONFIG_PPC_CLOCK is not set 1360# CONFIG_PPC_CLOCK is not set
1349# CONFIG_VIRTUALIZATION is not set 1361# CONFIG_VIRTUALIZATION is not set
diff --git a/arch/powerpc/include/asm/emulated_ops.h b/arch/powerpc/include/asm/emulated_ops.h
index 9154e8526732..f0fb4fc1f6e6 100644
--- a/arch/powerpc/include/asm/emulated_ops.h
+++ b/arch/powerpc/include/asm/emulated_ops.h
@@ -19,6 +19,7 @@
19#define _ASM_POWERPC_EMULATED_OPS_H 19#define _ASM_POWERPC_EMULATED_OPS_H
20 20
21#include <asm/atomic.h> 21#include <asm/atomic.h>
22#include <linux/perf_event.h>
22 23
23 24
24#ifdef CONFIG_PPC_EMULATED_STATS 25#ifdef CONFIG_PPC_EMULATED_STATS
@@ -57,7 +58,7 @@ extern u32 ppc_warn_emulated;
57 58
58extern void ppc_warn_emulated_print(const char *type); 59extern void ppc_warn_emulated_print(const char *type);
59 60
60#define PPC_WARN_EMULATED(type) \ 61#define __PPC_WARN_EMULATED(type) \
61 do { \ 62 do { \
62 atomic_inc(&ppc_emulated.type.val); \ 63 atomic_inc(&ppc_emulated.type.val); \
63 if (ppc_warn_emulated) \ 64 if (ppc_warn_emulated) \
@@ -66,8 +67,22 @@ extern void ppc_warn_emulated_print(const char *type);
66 67
67#else /* !CONFIG_PPC_EMULATED_STATS */ 68#else /* !CONFIG_PPC_EMULATED_STATS */
68 69
69#define PPC_WARN_EMULATED(type) do { } while (0) 70#define __PPC_WARN_EMULATED(type) do { } while (0)
70 71
71#endif /* !CONFIG_PPC_EMULATED_STATS */ 72#endif /* !CONFIG_PPC_EMULATED_STATS */
72 73
74#define PPC_WARN_EMULATED(type, regs) \
75 do { \
76 perf_sw_event(PERF_COUNT_SW_EMULATION_FAULTS, \
77 1, 0, regs, 0); \
78 __PPC_WARN_EMULATED(type); \
79 } while (0)
80
81#define PPC_WARN_ALIGNMENT(type, regs) \
82 do { \
83 perf_sw_event(PERF_COUNT_SW_ALIGNMENT_FAULTS, \
84 1, 0, regs, regs->dar); \
85 __PPC_WARN_EMULATED(type); \
86 } while (0)
87
73#endif /* _ASM_POWERPC_EMULATED_OPS_H */ 88#endif /* _ASM_POWERPC_EMULATED_OPS_H */
diff --git a/arch/powerpc/include/asm/hvcall.h b/arch/powerpc/include/asm/hvcall.h
index 6251a4b10be7..c27caac47ad1 100644
--- a/arch/powerpc/include/asm/hvcall.h
+++ b/arch/powerpc/include/asm/hvcall.h
@@ -274,6 +274,8 @@ struct hcall_stats {
274 unsigned long num_calls; /* number of calls (on this CPU) */ 274 unsigned long num_calls; /* number of calls (on this CPU) */
275 unsigned long tb_total; /* total wall time (mftb) of calls. */ 275 unsigned long tb_total; /* total wall time (mftb) of calls. */
276 unsigned long purr_total; /* total cpu time (PURR) of calls. */ 276 unsigned long purr_total; /* total cpu time (PURR) of calls. */
277 unsigned long tb_start;
278 unsigned long purr_start;
277}; 279};
278#define HCALL_STAT_ARRAY_SIZE ((MAX_HCALL_OPCODE >> 2) + 1) 280#define HCALL_STAT_ARRAY_SIZE ((MAX_HCALL_OPCODE >> 2) + 1)
279 281
diff --git a/arch/powerpc/include/asm/kmap_types.h b/arch/powerpc/include/asm/kmap_types.h
index b6bac6f61c16..916369575c97 100644
--- a/arch/powerpc/include/asm/kmap_types.h
+++ b/arch/powerpc/include/asm/kmap_types.h
@@ -29,5 +29,16 @@ enum km_type {
29 KM_TYPE_NR 29 KM_TYPE_NR
30}; 30};
31 31
32/*
33 * This is a temporary build fix that (so they say on lkml....) should no longer
34 * be required after 2.6.33, because of changes planned to the kmap code.
35 * Let's try to remove this cruft then.
36 */
37#ifdef CONFIG_DEBUG_HIGHMEM
38#define KM_NMI (-1)
39#define KM_NMI_PTE (-1)
40#define KM_IRQ_PTE (-1)
41#endif
42
32#endif /* __KERNEL__ */ 43#endif /* __KERNEL__ */
33#endif /* _ASM_POWERPC_KMAP_TYPES_H */ 44#endif /* _ASM_POWERPC_KMAP_TYPES_H */
diff --git a/arch/powerpc/include/asm/reg.h b/arch/powerpc/include/asm/reg.h
index 6315edc205d8..bc8dd53f718a 100644
--- a/arch/powerpc/include/asm/reg.h
+++ b/arch/powerpc/include/asm/reg.h
@@ -489,6 +489,8 @@
489#define SPRN_MMCR1 798 489#define SPRN_MMCR1 798
490#define SPRN_MMCRA 0x312 490#define SPRN_MMCRA 0x312
491#define MMCRA_SDSYNC 0x80000000UL /* SDAR synced with SIAR */ 491#define MMCRA_SDSYNC 0x80000000UL /* SDAR synced with SIAR */
492#define MMCRA_SDAR_DCACHE_MISS 0x40000000UL
493#define MMCRA_SDAR_ERAT_MISS 0x20000000UL
492#define MMCRA_SIHV 0x10000000UL /* state of MSR HV when SIAR set */ 494#define MMCRA_SIHV 0x10000000UL /* state of MSR HV when SIAR set */
493#define MMCRA_SIPR 0x08000000UL /* state of MSR PR when SIAR set */ 495#define MMCRA_SIPR 0x08000000UL /* state of MSR PR when SIAR set */
494#define MMCRA_SLOT 0x07000000UL /* SLOT bits (37-39) */ 496#define MMCRA_SLOT 0x07000000UL /* SLOT bits (37-39) */
diff --git a/arch/powerpc/include/asm/trace.h b/arch/powerpc/include/asm/trace.h
new file mode 100644
index 000000000000..cbe2297d68b6
--- /dev/null
+++ b/arch/powerpc/include/asm/trace.h
@@ -0,0 +1,133 @@
1#undef TRACE_SYSTEM
2#define TRACE_SYSTEM powerpc
3
4#if !defined(_TRACE_POWERPC_H) || defined(TRACE_HEADER_MULTI_READ)
5#define _TRACE_POWERPC_H
6
7#include <linux/tracepoint.h>
8
9struct pt_regs;
10
11TRACE_EVENT(irq_entry,
12
13 TP_PROTO(struct pt_regs *regs),
14
15 TP_ARGS(regs),
16
17 TP_STRUCT__entry(
18 __field(struct pt_regs *, regs)
19 ),
20
21 TP_fast_assign(
22 __entry->regs = regs;
23 ),
24
25 TP_printk("pt_regs=%p", __entry->regs)
26);
27
28TRACE_EVENT(irq_exit,
29
30 TP_PROTO(struct pt_regs *regs),
31
32 TP_ARGS(regs),
33
34 TP_STRUCT__entry(
35 __field(struct pt_regs *, regs)
36 ),
37
38 TP_fast_assign(
39 __entry->regs = regs;
40 ),
41
42 TP_printk("pt_regs=%p", __entry->regs)
43);
44
45TRACE_EVENT(timer_interrupt_entry,
46
47 TP_PROTO(struct pt_regs *regs),
48
49 TP_ARGS(regs),
50
51 TP_STRUCT__entry(
52 __field(struct pt_regs *, regs)
53 ),
54
55 TP_fast_assign(
56 __entry->regs = regs;
57 ),
58
59 TP_printk("pt_regs=%p", __entry->regs)
60);
61
62TRACE_EVENT(timer_interrupt_exit,
63
64 TP_PROTO(struct pt_regs *regs),
65
66 TP_ARGS(regs),
67
68 TP_STRUCT__entry(
69 __field(struct pt_regs *, regs)
70 ),
71
72 TP_fast_assign(
73 __entry->regs = regs;
74 ),
75
76 TP_printk("pt_regs=%p", __entry->regs)
77);
78
79#ifdef CONFIG_PPC_PSERIES
80extern void hcall_tracepoint_regfunc(void);
81extern void hcall_tracepoint_unregfunc(void);
82
83TRACE_EVENT_FN(hcall_entry,
84
85 TP_PROTO(unsigned long opcode, unsigned long *args),
86
87 TP_ARGS(opcode, args),
88
89 TP_STRUCT__entry(
90 __field(unsigned long, opcode)
91 ),
92
93 TP_fast_assign(
94 __entry->opcode = opcode;
95 ),
96
97 TP_printk("opcode=%lu", __entry->opcode),
98
99 hcall_tracepoint_regfunc, hcall_tracepoint_unregfunc
100);
101
102TRACE_EVENT_FN(hcall_exit,
103
104 TP_PROTO(unsigned long opcode, unsigned long retval,
105 unsigned long *retbuf),
106
107 TP_ARGS(opcode, retval, retbuf),
108
109 TP_STRUCT__entry(
110 __field(unsigned long, opcode)
111 __field(unsigned long, retval)
112 ),
113
114 TP_fast_assign(
115 __entry->opcode = opcode;
116 __entry->retval = retval;
117 ),
118
119 TP_printk("opcode=%lu retval=%lu", __entry->opcode, __entry->retval),
120
121 hcall_tracepoint_regfunc, hcall_tracepoint_unregfunc
122);
123#endif
124
125#endif /* _TRACE_POWERPC_H */
126
127#undef TRACE_INCLUDE_PATH
128#undef TRACE_INCLUDE_FILE
129
130#define TRACE_INCLUDE_PATH asm
131#define TRACE_INCLUDE_FILE trace
132
133#include <trace/define_trace.h>
diff --git a/arch/powerpc/kernel/align.c b/arch/powerpc/kernel/align.c
index a5b632e52fae..3839839f83c7 100644
--- a/arch/powerpc/kernel/align.c
+++ b/arch/powerpc/kernel/align.c
@@ -732,7 +732,7 @@ int fix_alignment(struct pt_regs *regs)
732 732
733#ifdef CONFIG_SPE 733#ifdef CONFIG_SPE
734 if ((instr >> 26) == 0x4) { 734 if ((instr >> 26) == 0x4) {
735 PPC_WARN_EMULATED(spe); 735 PPC_WARN_ALIGNMENT(spe, regs);
736 return emulate_spe(regs, reg, instr); 736 return emulate_spe(regs, reg, instr);
737 } 737 }
738#endif 738#endif
@@ -786,7 +786,7 @@ int fix_alignment(struct pt_regs *regs)
786 flags |= SPLT; 786 flags |= SPLT;
787 nb = 8; 787 nb = 8;
788 } 788 }
789 PPC_WARN_EMULATED(vsx); 789 PPC_WARN_ALIGNMENT(vsx, regs);
790 return emulate_vsx(addr, reg, areg, regs, flags, nb); 790 return emulate_vsx(addr, reg, areg, regs, flags, nb);
791 } 791 }
792#endif 792#endif
@@ -794,7 +794,7 @@ int fix_alignment(struct pt_regs *regs)
794 * the exception of DCBZ which is handled as a special case here 794 * the exception of DCBZ which is handled as a special case here
795 */ 795 */
796 if (instr == DCBZ) { 796 if (instr == DCBZ) {
797 PPC_WARN_EMULATED(dcbz); 797 PPC_WARN_ALIGNMENT(dcbz, regs);
798 return emulate_dcbz(regs, addr); 798 return emulate_dcbz(regs, addr);
799 } 799 }
800 if (unlikely(nb == 0)) 800 if (unlikely(nb == 0))
@@ -804,7 +804,7 @@ int fix_alignment(struct pt_regs *regs)
804 * function 804 * function
805 */ 805 */
806 if (flags & M) { 806 if (flags & M) {
807 PPC_WARN_EMULATED(multiple); 807 PPC_WARN_ALIGNMENT(multiple, regs);
808 return emulate_multiple(regs, addr, reg, nb, 808 return emulate_multiple(regs, addr, reg, nb,
809 flags, instr, swiz); 809 flags, instr, swiz);
810 } 810 }
@@ -825,11 +825,11 @@ int fix_alignment(struct pt_regs *regs)
825 825
826 /* Special case for 16-byte FP loads and stores */ 826 /* Special case for 16-byte FP loads and stores */
827 if (nb == 16) { 827 if (nb == 16) {
828 PPC_WARN_EMULATED(fp_pair); 828 PPC_WARN_ALIGNMENT(fp_pair, regs);
829 return emulate_fp_pair(addr, reg, flags); 829 return emulate_fp_pair(addr, reg, flags);
830 } 830 }
831 831
832 PPC_WARN_EMULATED(unaligned); 832 PPC_WARN_ALIGNMENT(unaligned, regs);
833 833
834 /* If we are loading, get the data from user space, else 834 /* If we are loading, get the data from user space, else
835 * get it from register values 835 * get it from register values
diff --git a/arch/powerpc/kernel/entry_64.S b/arch/powerpc/kernel/entry_64.S
index 9763267e38b4..bdcb557d470a 100644
--- a/arch/powerpc/kernel/entry_64.S
+++ b/arch/powerpc/kernel/entry_64.S
@@ -551,7 +551,7 @@ restore:
551BEGIN_FW_FTR_SECTION 551BEGIN_FW_FTR_SECTION
552 ld r5,SOFTE(r1) 552 ld r5,SOFTE(r1)
553FW_FTR_SECTION_ELSE 553FW_FTR_SECTION_ELSE
554 b iseries_check_pending_irqs 554 b .Liseries_check_pending_irqs
555ALT_FW_FTR_SECTION_END_IFCLR(FW_FEATURE_ISERIES) 555ALT_FW_FTR_SECTION_END_IFCLR(FW_FEATURE_ISERIES)
5562: 5562:
557 TRACE_AND_RESTORE_IRQ(r5); 557 TRACE_AND_RESTORE_IRQ(r5);
@@ -623,7 +623,7 @@ ALT_FW_FTR_SECTION_END_IFCLR(FW_FEATURE_ISERIES)
623 623
624#endif /* CONFIG_PPC_BOOK3E */ 624#endif /* CONFIG_PPC_BOOK3E */
625 625
626iseries_check_pending_irqs: 626.Liseries_check_pending_irqs:
627#ifdef CONFIG_PPC_ISERIES 627#ifdef CONFIG_PPC_ISERIES
628 ld r5,SOFTE(r1) 628 ld r5,SOFTE(r1)
629 cmpdi 0,r5,0 629 cmpdi 0,r5,0
diff --git a/arch/powerpc/kernel/exceptions-64s.S b/arch/powerpc/kernel/exceptions-64s.S
index 1808876edcc9..c7eb4e0eb86c 100644
--- a/arch/powerpc/kernel/exceptions-64s.S
+++ b/arch/powerpc/kernel/exceptions-64s.S
@@ -185,12 +185,15 @@ END_FTR_SECTION_IFSET(CPU_FTR_REAL_LE)
185 * prolog code of the PerformanceMonitor one. A little 185 * prolog code of the PerformanceMonitor one. A little
186 * trickery is thus necessary 186 * trickery is thus necessary
187 */ 187 */
188performance_monitor_pSeries_1:
188 . = 0xf00 189 . = 0xf00
189 b performance_monitor_pSeries 190 b performance_monitor_pSeries
190 191
192altivec_unavailable_pSeries_1:
191 . = 0xf20 193 . = 0xf20
192 b altivec_unavailable_pSeries 194 b altivec_unavailable_pSeries
193 195
196vsx_unavailable_pSeries_1:
194 . = 0xf40 197 . = 0xf40
195 b vsx_unavailable_pSeries 198 b vsx_unavailable_pSeries
196 199
diff --git a/arch/powerpc/kernel/irq.c b/arch/powerpc/kernel/irq.c
index e5d121177984..02a334662cc0 100644
--- a/arch/powerpc/kernel/irq.c
+++ b/arch/powerpc/kernel/irq.c
@@ -70,6 +70,8 @@
70#include <asm/firmware.h> 70#include <asm/firmware.h>
71#include <asm/lv1call.h> 71#include <asm/lv1call.h>
72#endif 72#endif
73#define CREATE_TRACE_POINTS
74#include <asm/trace.h>
73 75
74int __irq_offset_value; 76int __irq_offset_value;
75static int ppc_spurious_interrupts; 77static int ppc_spurious_interrupts;
@@ -325,6 +327,8 @@ void do_IRQ(struct pt_regs *regs)
325 struct pt_regs *old_regs = set_irq_regs(regs); 327 struct pt_regs *old_regs = set_irq_regs(regs);
326 unsigned int irq; 328 unsigned int irq;
327 329
330 trace_irq_entry(regs);
331
328 irq_enter(); 332 irq_enter();
329 333
330 check_stack_overflow(); 334 check_stack_overflow();
@@ -348,6 +352,8 @@ void do_IRQ(struct pt_regs *regs)
348 timer_interrupt(regs); 352 timer_interrupt(regs);
349 } 353 }
350#endif 354#endif
355
356 trace_irq_exit(regs);
351} 357}
352 358
353void __init init_IRQ(void) 359void __init init_IRQ(void)
diff --git a/arch/powerpc/kernel/perf_event.c b/arch/powerpc/kernel/perf_event.c
index 87f1663584b0..1eb85fbf53a5 100644
--- a/arch/powerpc/kernel/perf_event.c
+++ b/arch/powerpc/kernel/perf_event.c
@@ -1165,7 +1165,7 @@ static void record_and_restart(struct perf_event *event, unsigned long val,
1165 */ 1165 */
1166 if (record) { 1166 if (record) {
1167 struct perf_sample_data data = { 1167 struct perf_sample_data data = {
1168 .addr = 0, 1168 .addr = ~0ULL,
1169 .period = event->hw.last_period, 1169 .period = event->hw.last_period,
1170 }; 1170 };
1171 1171
diff --git a/arch/powerpc/kernel/power5+-pmu.c b/arch/powerpc/kernel/power5+-pmu.c
index 0f4c1c73a6ad..199de527d411 100644
--- a/arch/powerpc/kernel/power5+-pmu.c
+++ b/arch/powerpc/kernel/power5+-pmu.c
@@ -73,10 +73,6 @@
73#define MMCR1_PMCSEL_MSK 0x7f 73#define MMCR1_PMCSEL_MSK 0x7f
74 74
75/* 75/*
76 * Bits in MMCRA
77 */
78
79/*
80 * Layout of constraint bits: 76 * Layout of constraint bits:
81 * 6666555555555544444444443333333333222222222211111111110000000000 77 * 6666555555555544444444443333333333222222222211111111110000000000
82 * 3210987654321098765432109876543210987654321098765432109876543210 78 * 3210987654321098765432109876543210987654321098765432109876543210
diff --git a/arch/powerpc/kernel/power5-pmu.c b/arch/powerpc/kernel/power5-pmu.c
index c351b3a57fbb..98b6a729a9dd 100644
--- a/arch/powerpc/kernel/power5-pmu.c
+++ b/arch/powerpc/kernel/power5-pmu.c
@@ -73,10 +73,6 @@
73#define MMCR1_PMCSEL_MSK 0x7f 73#define MMCR1_PMCSEL_MSK 0x7f
74 74
75/* 75/*
76 * Bits in MMCRA
77 */
78
79/*
80 * Layout of constraint bits: 76 * Layout of constraint bits:
81 * 6666555555555544444444443333333333222222222211111111110000000000 77 * 6666555555555544444444443333333333222222222211111111110000000000
82 * 3210987654321098765432109876543210987654321098765432109876543210 78 * 3210987654321098765432109876543210987654321098765432109876543210
@@ -390,7 +386,7 @@ static int power5_compute_mmcr(u64 event[], int n_ev,
390 unsigned int hwc[], unsigned long mmcr[]) 386 unsigned int hwc[], unsigned long mmcr[])
391{ 387{
392 unsigned long mmcr1 = 0; 388 unsigned long mmcr1 = 0;
393 unsigned long mmcra = 0; 389 unsigned long mmcra = MMCRA_SDAR_DCACHE_MISS | MMCRA_SDAR_ERAT_MISS;
394 unsigned int pmc, unit, byte, psel; 390 unsigned int pmc, unit, byte, psel;
395 unsigned int ttm, grp; 391 unsigned int ttm, grp;
396 int i, isbus, bit, grsel; 392 int i, isbus, bit, grsel;
diff --git a/arch/powerpc/kernel/power6-pmu.c b/arch/powerpc/kernel/power6-pmu.c
index ca399ba5034c..84a607bda8fb 100644
--- a/arch/powerpc/kernel/power6-pmu.c
+++ b/arch/powerpc/kernel/power6-pmu.c
@@ -178,7 +178,7 @@ static int p6_compute_mmcr(u64 event[], int n_ev,
178 unsigned int hwc[], unsigned long mmcr[]) 178 unsigned int hwc[], unsigned long mmcr[])
179{ 179{
180 unsigned long mmcr1 = 0; 180 unsigned long mmcr1 = 0;
181 unsigned long mmcra = 0; 181 unsigned long mmcra = MMCRA_SDAR_DCACHE_MISS | MMCRA_SDAR_ERAT_MISS;
182 int i; 182 int i;
183 unsigned int pmc, ev, b, u, s, psel; 183 unsigned int pmc, ev, b, u, s, psel;
184 unsigned int ttmset = 0; 184 unsigned int ttmset = 0;
diff --git a/arch/powerpc/kernel/power7-pmu.c b/arch/powerpc/kernel/power7-pmu.c
index 28a4daacdc02..852f7b7f6b40 100644
--- a/arch/powerpc/kernel/power7-pmu.c
+++ b/arch/powerpc/kernel/power7-pmu.c
@@ -51,10 +51,6 @@
51#define MMCR1_PMCSEL_MSK 0xff 51#define MMCR1_PMCSEL_MSK 0xff
52 52
53/* 53/*
54 * Bits in MMCRA
55 */
56
57/*
58 * Layout of constraint bits: 54 * Layout of constraint bits:
59 * 6666555555555544444444443333333333222222222211111111110000000000 55 * 6666555555555544444444443333333333222222222211111111110000000000
60 * 3210987654321098765432109876543210987654321098765432109876543210 56 * 3210987654321098765432109876543210987654321098765432109876543210
@@ -230,7 +226,7 @@ static int power7_compute_mmcr(u64 event[], int n_ev,
230 unsigned int hwc[], unsigned long mmcr[]) 226 unsigned int hwc[], unsigned long mmcr[])
231{ 227{
232 unsigned long mmcr1 = 0; 228 unsigned long mmcr1 = 0;
233 unsigned long mmcra = 0; 229 unsigned long mmcra = MMCRA_SDAR_DCACHE_MISS | MMCRA_SDAR_ERAT_MISS;
234 unsigned int pmc, unit, combine, l2sel, psel; 230 unsigned int pmc, unit, combine, l2sel, psel;
235 unsigned int pmc_inuse = 0; 231 unsigned int pmc_inuse = 0;
236 int i; 232 int i;
diff --git a/arch/powerpc/kernel/ppc970-pmu.c b/arch/powerpc/kernel/ppc970-pmu.c
index 479574413a93..8eff48e20dba 100644
--- a/arch/powerpc/kernel/ppc970-pmu.c
+++ b/arch/powerpc/kernel/ppc970-pmu.c
@@ -84,10 +84,6 @@ static short mmcr1_adder_bits[8] = {
84}; 84};
85 85
86/* 86/*
87 * Bits in MMCRA
88 */
89
90/*
91 * Layout of constraint bits: 87 * Layout of constraint bits:
92 * 6666555555555544444444443333333333222222222211111111110000000000 88 * 6666555555555544444444443333333333222222222211111111110000000000
93 * 3210987654321098765432109876543210987654321098765432109876543210 89 * 3210987654321098765432109876543210987654321098765432109876543210
diff --git a/arch/powerpc/kernel/setup-common.c b/arch/powerpc/kernel/setup-common.c
index 4271f7a655a3..845c72ab7357 100644
--- a/arch/powerpc/kernel/setup-common.c
+++ b/arch/powerpc/kernel/setup-common.c
@@ -660,6 +660,7 @@ late_initcall(check_cache_coherency);
660 660
661#ifdef CONFIG_DEBUG_FS 661#ifdef CONFIG_DEBUG_FS
662struct dentry *powerpc_debugfs_root; 662struct dentry *powerpc_debugfs_root;
663EXPORT_SYMBOL(powerpc_debugfs_root);
663 664
664static int powerpc_debugfs_init(void) 665static int powerpc_debugfs_init(void)
665{ 666{
diff --git a/arch/powerpc/kernel/setup_32.c b/arch/powerpc/kernel/setup_32.c
index 53bcf3d792db..b152de3e64d4 100644
--- a/arch/powerpc/kernel/setup_32.c
+++ b/arch/powerpc/kernel/setup_32.c
@@ -345,7 +345,7 @@ void __init setup_arch(char **cmdline_p)
345 345
346#ifdef CONFIG_SWIOTLB 346#ifdef CONFIG_SWIOTLB
347 if (ppc_swiotlb_enable) 347 if (ppc_swiotlb_enable)
348 swiotlb_init(); 348 swiotlb_init(1);
349#endif 349#endif
350 350
351 paging_init(); 351 paging_init();
diff --git a/arch/powerpc/kernel/setup_64.c b/arch/powerpc/kernel/setup_64.c
index 04f638d82fb3..df2c9e932b37 100644
--- a/arch/powerpc/kernel/setup_64.c
+++ b/arch/powerpc/kernel/setup_64.c
@@ -550,7 +550,7 @@ void __init setup_arch(char **cmdline_p)
550 550
551#ifdef CONFIG_SWIOTLB 551#ifdef CONFIG_SWIOTLB
552 if (ppc_swiotlb_enable) 552 if (ppc_swiotlb_enable)
553 swiotlb_init(); 553 swiotlb_init(1);
554#endif 554#endif
555 555
556 paging_init(); 556 paging_init();
diff --git a/arch/powerpc/kernel/time.c b/arch/powerpc/kernel/time.c
index 92dc844299b6..36707dec94d7 100644
--- a/arch/powerpc/kernel/time.c
+++ b/arch/powerpc/kernel/time.c
@@ -54,6 +54,7 @@
54#include <linux/irq.h> 54#include <linux/irq.h>
55#include <linux/delay.h> 55#include <linux/delay.h>
56#include <linux/perf_event.h> 56#include <linux/perf_event.h>
57#include <asm/trace.h>
57 58
58#include <asm/io.h> 59#include <asm/io.h>
59#include <asm/processor.h> 60#include <asm/processor.h>
@@ -571,6 +572,8 @@ void timer_interrupt(struct pt_regs * regs)
571 struct clock_event_device *evt = &decrementer->event; 572 struct clock_event_device *evt = &decrementer->event;
572 u64 now; 573 u64 now;
573 574
575 trace_timer_interrupt_entry(regs);
576
574 /* Ensure a positive value is written to the decrementer, or else 577 /* Ensure a positive value is written to the decrementer, or else
575 * some CPUs will continuue to take decrementer exceptions */ 578 * some CPUs will continuue to take decrementer exceptions */
576 set_dec(DECREMENTER_MAX); 579 set_dec(DECREMENTER_MAX);
@@ -590,6 +593,7 @@ void timer_interrupt(struct pt_regs * regs)
590 now = decrementer->next_tb - now; 593 now = decrementer->next_tb - now;
591 if (now <= DECREMENTER_MAX) 594 if (now <= DECREMENTER_MAX)
592 set_dec((int)now); 595 set_dec((int)now);
596 trace_timer_interrupt_exit(regs);
593 return; 597 return;
594 } 598 }
595 old_regs = set_irq_regs(regs); 599 old_regs = set_irq_regs(regs);
@@ -620,6 +624,8 @@ void timer_interrupt(struct pt_regs * regs)
620 624
621 irq_exit(); 625 irq_exit();
622 set_irq_regs(old_regs); 626 set_irq_regs(old_regs);
627
628 trace_timer_interrupt_exit(regs);
623} 629}
624 630
625void wakeup_decrementer(void) 631void wakeup_decrementer(void)
@@ -777,7 +783,7 @@ int update_persistent_clock(struct timespec now)
777 return ppc_md.set_rtc_time(&tm); 783 return ppc_md.set_rtc_time(&tm);
778} 784}
779 785
780void read_persistent_clock(struct timespec *ts) 786static void __read_persistent_clock(struct timespec *ts)
781{ 787{
782 struct rtc_time tm; 788 struct rtc_time tm;
783 static int first = 1; 789 static int first = 1;
@@ -800,10 +806,23 @@ void read_persistent_clock(struct timespec *ts)
800 return; 806 return;
801 } 807 }
802 ppc_md.get_rtc_time(&tm); 808 ppc_md.get_rtc_time(&tm);
809
803 ts->tv_sec = mktime(tm.tm_year+1900, tm.tm_mon+1, tm.tm_mday, 810 ts->tv_sec = mktime(tm.tm_year+1900, tm.tm_mon+1, tm.tm_mday,
804 tm.tm_hour, tm.tm_min, tm.tm_sec); 811 tm.tm_hour, tm.tm_min, tm.tm_sec);
805} 812}
806 813
814void read_persistent_clock(struct timespec *ts)
815{
816 __read_persistent_clock(ts);
817
818 /* Sanitize it in case real time clock is set below EPOCH */
819 if (ts->tv_sec < 0) {
820 ts->tv_sec = 0;
821 ts->tv_nsec = 0;
822 }
823
824}
825
807/* clocksource code */ 826/* clocksource code */
808static cycle_t rtc_read(struct clocksource *cs) 827static cycle_t rtc_read(struct clocksource *cs)
809{ 828{
diff --git a/arch/powerpc/kernel/traps.c b/arch/powerpc/kernel/traps.c
index 6f0ae1a9bfae..9d1f9354d6ca 100644
--- a/arch/powerpc/kernel/traps.c
+++ b/arch/powerpc/kernel/traps.c
@@ -759,7 +759,7 @@ static int emulate_instruction(struct pt_regs *regs)
759 759
760 /* Emulate the mfspr rD, PVR. */ 760 /* Emulate the mfspr rD, PVR. */
761 if ((instword & PPC_INST_MFSPR_PVR_MASK) == PPC_INST_MFSPR_PVR) { 761 if ((instword & PPC_INST_MFSPR_PVR_MASK) == PPC_INST_MFSPR_PVR) {
762 PPC_WARN_EMULATED(mfpvr); 762 PPC_WARN_EMULATED(mfpvr, regs);
763 rd = (instword >> 21) & 0x1f; 763 rd = (instword >> 21) & 0x1f;
764 regs->gpr[rd] = mfspr(SPRN_PVR); 764 regs->gpr[rd] = mfspr(SPRN_PVR);
765 return 0; 765 return 0;
@@ -767,7 +767,7 @@ static int emulate_instruction(struct pt_regs *regs)
767 767
768 /* Emulating the dcba insn is just a no-op. */ 768 /* Emulating the dcba insn is just a no-op. */
769 if ((instword & PPC_INST_DCBA_MASK) == PPC_INST_DCBA) { 769 if ((instword & PPC_INST_DCBA_MASK) == PPC_INST_DCBA) {
770 PPC_WARN_EMULATED(dcba); 770 PPC_WARN_EMULATED(dcba, regs);
771 return 0; 771 return 0;
772 } 772 }
773 773
@@ -776,7 +776,7 @@ static int emulate_instruction(struct pt_regs *regs)
776 int shift = (instword >> 21) & 0x1c; 776 int shift = (instword >> 21) & 0x1c;
777 unsigned long msk = 0xf0000000UL >> shift; 777 unsigned long msk = 0xf0000000UL >> shift;
778 778
779 PPC_WARN_EMULATED(mcrxr); 779 PPC_WARN_EMULATED(mcrxr, regs);
780 regs->ccr = (regs->ccr & ~msk) | ((regs->xer >> shift) & msk); 780 regs->ccr = (regs->ccr & ~msk) | ((regs->xer >> shift) & msk);
781 regs->xer &= ~0xf0000000UL; 781 regs->xer &= ~0xf0000000UL;
782 return 0; 782 return 0;
@@ -784,19 +784,19 @@ static int emulate_instruction(struct pt_regs *regs)
784 784
785 /* Emulate load/store string insn. */ 785 /* Emulate load/store string insn. */
786 if ((instword & PPC_INST_STRING_GEN_MASK) == PPC_INST_STRING) { 786 if ((instword & PPC_INST_STRING_GEN_MASK) == PPC_INST_STRING) {
787 PPC_WARN_EMULATED(string); 787 PPC_WARN_EMULATED(string, regs);
788 return emulate_string_inst(regs, instword); 788 return emulate_string_inst(regs, instword);
789 } 789 }
790 790
791 /* Emulate the popcntb (Population Count Bytes) instruction. */ 791 /* Emulate the popcntb (Population Count Bytes) instruction. */
792 if ((instword & PPC_INST_POPCNTB_MASK) == PPC_INST_POPCNTB) { 792 if ((instword & PPC_INST_POPCNTB_MASK) == PPC_INST_POPCNTB) {
793 PPC_WARN_EMULATED(popcntb); 793 PPC_WARN_EMULATED(popcntb, regs);
794 return emulate_popcntb_inst(regs, instword); 794 return emulate_popcntb_inst(regs, instword);
795 } 795 }
796 796
797 /* Emulate isel (Integer Select) instruction */ 797 /* Emulate isel (Integer Select) instruction */
798 if ((instword & PPC_INST_ISEL_MASK) == PPC_INST_ISEL) { 798 if ((instword & PPC_INST_ISEL_MASK) == PPC_INST_ISEL) {
799 PPC_WARN_EMULATED(isel); 799 PPC_WARN_EMULATED(isel, regs);
800 return emulate_isel(regs, instword); 800 return emulate_isel(regs, instword);
801 } 801 }
802 802
@@ -995,7 +995,7 @@ void SoftwareEmulation(struct pt_regs *regs)
995#ifdef CONFIG_MATH_EMULATION 995#ifdef CONFIG_MATH_EMULATION
996 errcode = do_mathemu(regs); 996 errcode = do_mathemu(regs);
997 if (errcode >= 0) 997 if (errcode >= 0)
998 PPC_WARN_EMULATED(math); 998 PPC_WARN_EMULATED(math, regs);
999 999
1000 switch (errcode) { 1000 switch (errcode) {
1001 case 0: 1001 case 0:
@@ -1018,7 +1018,7 @@ void SoftwareEmulation(struct pt_regs *regs)
1018#elif defined(CONFIG_8XX_MINIMAL_FPEMU) 1018#elif defined(CONFIG_8XX_MINIMAL_FPEMU)
1019 errcode = Soft_emulate_8xx(regs); 1019 errcode = Soft_emulate_8xx(regs);
1020 if (errcode >= 0) 1020 if (errcode >= 0)
1021 PPC_WARN_EMULATED(8xx); 1021 PPC_WARN_EMULATED(8xx, regs);
1022 1022
1023 switch (errcode) { 1023 switch (errcode) {
1024 case 0: 1024 case 0:
@@ -1129,7 +1129,7 @@ void altivec_assist_exception(struct pt_regs *regs)
1129 1129
1130 flush_altivec_to_thread(current); 1130 flush_altivec_to_thread(current);
1131 1131
1132 PPC_WARN_EMULATED(altivec); 1132 PPC_WARN_EMULATED(altivec, regs);
1133 err = emulate_altivec(regs); 1133 err = emulate_altivec(regs);
1134 if (err == 0) { 1134 if (err == 0) {
1135 regs->nip += 4; /* skip emulated instruction */ 1135 regs->nip += 4; /* skip emulated instruction */
diff --git a/arch/powerpc/kvm/timing.h b/arch/powerpc/kvm/timing.h
index bb13b1f3cd5a..806ef67868bd 100644
--- a/arch/powerpc/kvm/timing.h
+++ b/arch/powerpc/kvm/timing.h
@@ -48,7 +48,11 @@ static inline void kvmppc_set_exit_type(struct kvm_vcpu *vcpu, int type) {}
48static inline void kvmppc_account_exit_stat(struct kvm_vcpu *vcpu, int type) 48static inline void kvmppc_account_exit_stat(struct kvm_vcpu *vcpu, int type)
49{ 49{
50 /* type has to be known at build time for optimization */ 50 /* type has to be known at build time for optimization */
51
52 /* The BUILD_BUG_ON below breaks in funny ways, commented out
53 * for now ... -BenH
51 BUILD_BUG_ON(__builtin_constant_p(type)); 54 BUILD_BUG_ON(__builtin_constant_p(type));
55 */
52 switch (type) { 56 switch (type) {
53 case EXT_INTR_EXITS: 57 case EXT_INTR_EXITS:
54 vcpu->stat.ext_intr_exits++; 58 vcpu->stat.ext_intr_exits++;
diff --git a/arch/powerpc/lib/copypage_64.S b/arch/powerpc/lib/copypage_64.S
index 75f3267fdc30..e68beac0a171 100644
--- a/arch/powerpc/lib/copypage_64.S
+++ b/arch/powerpc/lib/copypage_64.S
@@ -26,11 +26,11 @@ BEGIN_FTR_SECTION
26 srd r8,r5,r11 26 srd r8,r5,r11
27 27
28 mtctr r8 28 mtctr r8
29setup: 29.Lsetup:
30 dcbt r9,r4 30 dcbt r9,r4
31 dcbz r9,r3 31 dcbz r9,r3
32 add r9,r9,r12 32 add r9,r9,r12
33 bdnz setup 33 bdnz .Lsetup
34END_FTR_SECTION_IFSET(CPU_FTR_CP_USE_DCBTZ) 34END_FTR_SECTION_IFSET(CPU_FTR_CP_USE_DCBTZ)
35 addi r3,r3,-8 35 addi r3,r3,-8
36 srdi r8,r5,7 /* page is copied in 128 byte strides */ 36 srdi r8,r5,7 /* page is copied in 128 byte strides */
diff --git a/arch/powerpc/mm/mmu_context_nohash.c b/arch/powerpc/mm/mmu_context_nohash.c
index c2f93dc470e6..be4f34c30a0b 100644
--- a/arch/powerpc/mm/mmu_context_nohash.c
+++ b/arch/powerpc/mm/mmu_context_nohash.c
@@ -25,8 +25,8 @@
25 * also clear mm->cpu_vm_mask bits when processes are migrated 25 * also clear mm->cpu_vm_mask bits when processes are migrated
26 */ 26 */
27 27
28#define DEBUG_MAP_CONSISTENCY 28//#define DEBUG_MAP_CONSISTENCY
29#define DEBUG_CLAMP_LAST_CONTEXT 31 29//#define DEBUG_CLAMP_LAST_CONTEXT 31
30//#define DEBUG_HARDER 30//#define DEBUG_HARDER
31 31
32/* We don't use DEBUG because it tends to be compiled in always nowadays 32/* We don't use DEBUG because it tends to be compiled in always nowadays
diff --git a/arch/powerpc/platforms/82xx/ep8248e.c b/arch/powerpc/platforms/82xx/ep8248e.c
index 51fcae41f08a..f9aee182e6f7 100644
--- a/arch/powerpc/platforms/82xx/ep8248e.c
+++ b/arch/powerpc/platforms/82xx/ep8248e.c
@@ -132,12 +132,25 @@ static int __devinit ep8248e_mdio_probe(struct of_device *ofdev,
132 return -ENOMEM; 132 return -ENOMEM;
133 133
134 bus->irq = kmalloc(sizeof(int) * PHY_MAX_ADDR, GFP_KERNEL); 134 bus->irq = kmalloc(sizeof(int) * PHY_MAX_ADDR, GFP_KERNEL);
135 if (bus->irq == NULL) {
136 ret = -ENOMEM;
137 goto err_free_bus;
138 }
135 139
136 bus->name = "ep8248e-mdio-bitbang"; 140 bus->name = "ep8248e-mdio-bitbang";
137 bus->parent = &ofdev->dev; 141 bus->parent = &ofdev->dev;
138 snprintf(bus->id, MII_BUS_ID_SIZE, "%x", res.start); 142 snprintf(bus->id, MII_BUS_ID_SIZE, "%x", res.start);
139 143
140 return of_mdiobus_register(bus, ofdev->node); 144 ret = of_mdiobus_register(bus, ofdev->node);
145 if (ret)
146 goto err_free_irq;
147
148 return 0;
149err_free_irq:
150 kfree(bus->irq);
151err_free_bus:
152 free_mdio_bitbang(bus);
153 return ret;
141} 154}
142 155
143static int ep8248e_mdio_remove(struct of_device *ofdev) 156static int ep8248e_mdio_remove(struct of_device *ofdev)
diff --git a/arch/powerpc/platforms/pseries/hvCall.S b/arch/powerpc/platforms/pseries/hvCall.S
index c1427b3634ec..383a5d0e9818 100644
--- a/arch/powerpc/platforms/pseries/hvCall.S
+++ b/arch/powerpc/platforms/pseries/hvCall.S
@@ -14,68 +14,94 @@
14 14
15#define STK_PARM(i) (48 + ((i)-3)*8) 15#define STK_PARM(i) (48 + ((i)-3)*8)
16 16
17#ifdef CONFIG_HCALL_STATS 17#ifdef CONFIG_TRACEPOINTS
18
19 .section ".toc","aw"
20
21 .globl hcall_tracepoint_refcount
22hcall_tracepoint_refcount:
23 .llong 0
24
25 .section ".text"
26
18/* 27/*
19 * precall must preserve all registers. use unused STK_PARM() 28 * precall must preserve all registers. use unused STK_PARM()
20 * areas to save snapshots and opcode. 29 * areas to save snapshots and opcode. We branch around this
30 * in early init (eg when populating the MMU hashtable) by using an
31 * unconditional cpu feature.
21 */ 32 */
22#define HCALL_INST_PRECALL \ 33#define HCALL_INST_PRECALL(FIRST_REG) \
23 std r3,STK_PARM(r3)(r1); /* save opcode */ \
24 mftb r0; /* get timebase and */ \
25 std r0,STK_PARM(r5)(r1); /* save for later */ \
26BEGIN_FTR_SECTION; \ 34BEGIN_FTR_SECTION; \
27 mfspr r0,SPRN_PURR; /* get PURR and */ \ 35 b 1f; \
28 std r0,STK_PARM(r6)(r1); /* save for later */ \ 36END_FTR_SECTION(0, 1); \
29END_FTR_SECTION_IFSET(CPU_FTR_PURR); 37 ld r12,hcall_tracepoint_refcount@toc(r2); \
30 38 cmpdi r12,0; \
39 beq+ 1f; \
40 mflr r0; \
41 std r3,STK_PARM(r3)(r1); \
42 std r4,STK_PARM(r4)(r1); \
43 std r5,STK_PARM(r5)(r1); \
44 std r6,STK_PARM(r6)(r1); \
45 std r7,STK_PARM(r7)(r1); \
46 std r8,STK_PARM(r8)(r1); \
47 std r9,STK_PARM(r9)(r1); \
48 std r10,STK_PARM(r10)(r1); \
49 std r0,16(r1); \
50 addi r4,r1,STK_PARM(FIRST_REG); \
51 stdu r1,-STACK_FRAME_OVERHEAD(r1); \
52 bl .__trace_hcall_entry; \
53 addi r1,r1,STACK_FRAME_OVERHEAD; \
54 ld r0,16(r1); \
55 ld r3,STK_PARM(r3)(r1); \
56 ld r4,STK_PARM(r4)(r1); \
57 ld r5,STK_PARM(r5)(r1); \
58 ld r6,STK_PARM(r6)(r1); \
59 ld r7,STK_PARM(r7)(r1); \
60 ld r8,STK_PARM(r8)(r1); \
61 ld r9,STK_PARM(r9)(r1); \
62 ld r10,STK_PARM(r10)(r1); \
63 mtlr r0; \
641:
65
31/* 66/*
32 * postcall is performed immediately before function return which 67 * postcall is performed immediately before function return which
33 * allows liberal use of volatile registers. We branch around this 68 * allows liberal use of volatile registers. We branch around this
34 * in early init (eg when populating the MMU hashtable) by using an 69 * in early init (eg when populating the MMU hashtable) by using an
35 * unconditional cpu feature. 70 * unconditional cpu feature.
36 */ 71 */
37#define HCALL_INST_POSTCALL \ 72#define __HCALL_INST_POSTCALL \
38BEGIN_FTR_SECTION; \ 73BEGIN_FTR_SECTION; \
39 b 1f; \ 74 b 1f; \
40END_FTR_SECTION(0, 1); \ 75END_FTR_SECTION(0, 1); \
41 ld r4,STK_PARM(r3)(r1); /* validate opcode */ \ 76 ld r12,hcall_tracepoint_refcount@toc(r2); \
42 cmpldi cr7,r4,MAX_HCALL_OPCODE; \ 77 cmpdi r12,0; \
43 bgt- cr7,1f; \ 78 beq+ 1f; \
44 \ 79 mflr r0; \
45 /* get time and PURR snapshots after hcall */ \ 80 ld r6,STK_PARM(r3)(r1); \
46 mftb r7; /* timebase after */ \ 81 std r3,STK_PARM(r3)(r1); \
47BEGIN_FTR_SECTION; \ 82 mr r4,r3; \
48 mfspr r8,SPRN_PURR; /* PURR after */ \ 83 mr r3,r6; \
49 ld r6,STK_PARM(r6)(r1); /* PURR before */ \ 84 std r0,16(r1); \
50 subf r6,r6,r8; /* delta */ \ 85 stdu r1,-STACK_FRAME_OVERHEAD(r1); \
51END_FTR_SECTION_IFSET(CPU_FTR_PURR); \ 86 bl .__trace_hcall_exit; \
52 ld r5,STK_PARM(r5)(r1); /* timebase before */ \ 87 addi r1,r1,STACK_FRAME_OVERHEAD; \
53 subf r5,r5,r7; /* time delta */ \ 88 ld r0,16(r1); \
54 \ 89 ld r3,STK_PARM(r3)(r1); \
55 /* calculate address of stat structure r4 = opcode */ \ 90 mtlr r0; \
56 srdi r4,r4,2; /* index into array */ \
57 mulli r4,r4,HCALL_STAT_SIZE; \
58 LOAD_REG_ADDR(r7, per_cpu__hcall_stats); \
59 add r4,r4,r7; \
60 ld r7,PACA_DATA_OFFSET(r13); /* per cpu offset */ \
61 add r4,r4,r7; \
62 \
63 /* update stats */ \
64 ld r7,HCALL_STAT_CALLS(r4); /* count */ \
65 addi r7,r7,1; \
66 std r7,HCALL_STAT_CALLS(r4); \
67 ld r7,HCALL_STAT_TB(r4); /* timebase */ \
68 add r7,r7,r5; \
69 std r7,HCALL_STAT_TB(r4); \
70BEGIN_FTR_SECTION; \
71 ld r7,HCALL_STAT_PURR(r4); /* PURR */ \
72 add r7,r7,r6; \
73 std r7,HCALL_STAT_PURR(r4); \
74END_FTR_SECTION_IFSET(CPU_FTR_PURR); \
751: 911:
92
93#define HCALL_INST_POSTCALL_NORETS \
94 li r5,0; \
95 __HCALL_INST_POSTCALL
96
97#define HCALL_INST_POSTCALL(BUFREG) \
98 mr r5,BUFREG; \
99 __HCALL_INST_POSTCALL
100
76#else 101#else
77#define HCALL_INST_PRECALL 102#define HCALL_INST_PRECALL(FIRST_ARG)
78#define HCALL_INST_POSTCALL 103#define HCALL_INST_POSTCALL_NORETS
104#define HCALL_INST_POSTCALL(BUFREG)
79#endif 105#endif
80 106
81 .text 107 .text
@@ -86,11 +112,11 @@ _GLOBAL(plpar_hcall_norets)
86 mfcr r0 112 mfcr r0
87 stw r0,8(r1) 113 stw r0,8(r1)
88 114
89 HCALL_INST_PRECALL 115 HCALL_INST_PRECALL(r4)
90 116
91 HVSC /* invoke the hypervisor */ 117 HVSC /* invoke the hypervisor */
92 118
93 HCALL_INST_POSTCALL 119 HCALL_INST_POSTCALL_NORETS
94 120
95 lwz r0,8(r1) 121 lwz r0,8(r1)
96 mtcrf 0xff,r0 122 mtcrf 0xff,r0
@@ -102,7 +128,7 @@ _GLOBAL(plpar_hcall)
102 mfcr r0 128 mfcr r0
103 stw r0,8(r1) 129 stw r0,8(r1)
104 130
105 HCALL_INST_PRECALL 131 HCALL_INST_PRECALL(r5)
106 132
107 std r4,STK_PARM(r4)(r1) /* Save ret buffer */ 133 std r4,STK_PARM(r4)(r1) /* Save ret buffer */
108 134
@@ -121,7 +147,7 @@ _GLOBAL(plpar_hcall)
121 std r6, 16(r12) 147 std r6, 16(r12)
122 std r7, 24(r12) 148 std r7, 24(r12)
123 149
124 HCALL_INST_POSTCALL 150 HCALL_INST_POSTCALL(r12)
125 151
126 lwz r0,8(r1) 152 lwz r0,8(r1)
127 mtcrf 0xff,r0 153 mtcrf 0xff,r0
@@ -168,7 +194,7 @@ _GLOBAL(plpar_hcall9)
168 mfcr r0 194 mfcr r0
169 stw r0,8(r1) 195 stw r0,8(r1)
170 196
171 HCALL_INST_PRECALL 197 HCALL_INST_PRECALL(r5)
172 198
173 std r4,STK_PARM(r4)(r1) /* Save ret buffer */ 199 std r4,STK_PARM(r4)(r1) /* Save ret buffer */
174 200
@@ -196,7 +222,7 @@ _GLOBAL(plpar_hcall9)
196 std r11,56(r12) 222 std r11,56(r12)
197 std r0, 64(r12) 223 std r0, 64(r12)
198 224
199 HCALL_INST_POSTCALL 225 HCALL_INST_POSTCALL(r12)
200 226
201 lwz r0,8(r1) 227 lwz r0,8(r1)
202 mtcrf 0xff,r0 228 mtcrf 0xff,r0
diff --git a/arch/powerpc/platforms/pseries/hvCall_inst.c b/arch/powerpc/platforms/pseries/hvCall_inst.c
index 3631a4f277eb..2f58c71b7259 100644
--- a/arch/powerpc/platforms/pseries/hvCall_inst.c
+++ b/arch/powerpc/platforms/pseries/hvCall_inst.c
@@ -26,6 +26,7 @@
26#include <asm/hvcall.h> 26#include <asm/hvcall.h>
27#include <asm/firmware.h> 27#include <asm/firmware.h>
28#include <asm/cputable.h> 28#include <asm/cputable.h>
29#include <asm/trace.h>
29 30
30DEFINE_PER_CPU(struct hcall_stats[HCALL_STAT_ARRAY_SIZE], hcall_stats); 31DEFINE_PER_CPU(struct hcall_stats[HCALL_STAT_ARRAY_SIZE], hcall_stats);
31 32
@@ -100,6 +101,35 @@ static const struct file_operations hcall_inst_seq_fops = {
100#define HCALL_ROOT_DIR "hcall_inst" 101#define HCALL_ROOT_DIR "hcall_inst"
101#define CPU_NAME_BUF_SIZE 32 102#define CPU_NAME_BUF_SIZE 32
102 103
104
105static void probe_hcall_entry(unsigned long opcode, unsigned long *args)
106{
107 struct hcall_stats *h;
108
109 if (opcode > MAX_HCALL_OPCODE)
110 return;
111
112 h = &get_cpu_var(hcall_stats)[opcode / 4];
113 h->tb_start = mftb();
114 h->purr_start = mfspr(SPRN_PURR);
115}
116
117static void probe_hcall_exit(unsigned long opcode, unsigned long retval,
118 unsigned long *retbuf)
119{
120 struct hcall_stats *h;
121
122 if (opcode > MAX_HCALL_OPCODE)
123 return;
124
125 h = &__get_cpu_var(hcall_stats)[opcode / 4];
126 h->num_calls++;
127 h->tb_total = mftb() - h->tb_start;
128 h->purr_total = mfspr(SPRN_PURR) - h->purr_start;
129
130 put_cpu_var(hcall_stats);
131}
132
103static int __init hcall_inst_init(void) 133static int __init hcall_inst_init(void)
104{ 134{
105 struct dentry *hcall_root; 135 struct dentry *hcall_root;
@@ -110,6 +140,14 @@ static int __init hcall_inst_init(void)
110 if (!firmware_has_feature(FW_FEATURE_LPAR)) 140 if (!firmware_has_feature(FW_FEATURE_LPAR))
111 return 0; 141 return 0;
112 142
143 if (register_trace_hcall_entry(probe_hcall_entry))
144 return -EINVAL;
145
146 if (register_trace_hcall_exit(probe_hcall_exit)) {
147 unregister_trace_hcall_entry(probe_hcall_entry);
148 return -EINVAL;
149 }
150
113 hcall_root = debugfs_create_dir(HCALL_ROOT_DIR, NULL); 151 hcall_root = debugfs_create_dir(HCALL_ROOT_DIR, NULL);
114 if (!hcall_root) 152 if (!hcall_root)
115 return -ENOMEM; 153 return -ENOMEM;
diff --git a/arch/powerpc/platforms/pseries/lpar.c b/arch/powerpc/platforms/pseries/lpar.c
index 903eb9eec687..0707653612ba 100644
--- a/arch/powerpc/platforms/pseries/lpar.c
+++ b/arch/powerpc/platforms/pseries/lpar.c
@@ -39,6 +39,7 @@
39#include <asm/cputable.h> 39#include <asm/cputable.h>
40#include <asm/udbg.h> 40#include <asm/udbg.h>
41#include <asm/smp.h> 41#include <asm/smp.h>
42#include <asm/trace.h>
42 43
43#include "plpar_wrappers.h" 44#include "plpar_wrappers.h"
44#include "pseries.h" 45#include "pseries.h"
@@ -661,3 +662,35 @@ void arch_free_page(struct page *page, int order)
661EXPORT_SYMBOL(arch_free_page); 662EXPORT_SYMBOL(arch_free_page);
662 663
663#endif 664#endif
665
666#ifdef CONFIG_TRACEPOINTS
667/*
668 * We optimise our hcall path by placing hcall_tracepoint_refcount
669 * directly in the TOC so we can check if the hcall tracepoints are
670 * enabled via a single load.
671 */
672
673/* NB: reg/unreg are called while guarded with the tracepoints_mutex */
674extern long hcall_tracepoint_refcount;
675
676void hcall_tracepoint_regfunc(void)
677{
678 hcall_tracepoint_refcount++;
679}
680
681void hcall_tracepoint_unregfunc(void)
682{
683 hcall_tracepoint_refcount--;
684}
685
686void __trace_hcall_entry(unsigned long opcode, unsigned long *args)
687{
688 trace_hcall_entry(opcode, args);
689}
690
691void __trace_hcall_exit(long opcode, unsigned long retval,
692 unsigned long *retbuf)
693{
694 trace_hcall_exit(opcode, retval, retbuf);
695}
696#endif
diff --git a/arch/powerpc/platforms/pseries/msi.c b/arch/powerpc/platforms/pseries/msi.c
index bf2e1ac41308..1164c3430f2c 100644
--- a/arch/powerpc/platforms/pseries/msi.c
+++ b/arch/powerpc/platforms/pseries/msi.c
@@ -432,8 +432,6 @@ static int rtas_setup_msi_irqs(struct pci_dev *pdev, int nvec, int type)
432 /* Read config space back so we can restore after reset */ 432 /* Read config space back so we can restore after reset */
433 read_msi_msg(virq, &msg); 433 read_msi_msg(virq, &msg);
434 entry->msg = msg; 434 entry->msg = msg;
435
436 unmask_msi_irq(virq);
437 } 435 }
438 436
439 return 0; 437 return 0;
diff --git a/arch/powerpc/platforms/pseries/xics.c b/arch/powerpc/platforms/pseries/xics.c
index 419f8a637ffe..b9bf0eedccf2 100644
--- a/arch/powerpc/platforms/pseries/xics.c
+++ b/arch/powerpc/platforms/pseries/xics.c
@@ -18,6 +18,7 @@
18#include <linux/init.h> 18#include <linux/init.h>
19#include <linux/radix-tree.h> 19#include <linux/radix-tree.h>
20#include <linux/cpu.h> 20#include <linux/cpu.h>
21#include <linux/msi.h>
21#include <linux/of.h> 22#include <linux/of.h>
22 23
23#include <asm/firmware.h> 24#include <asm/firmware.h>
@@ -219,6 +220,14 @@ static void xics_unmask_irq(unsigned int virq)
219 220
220static unsigned int xics_startup(unsigned int virq) 221static unsigned int xics_startup(unsigned int virq)
221{ 222{
223 /*
224 * The generic MSI code returns with the interrupt disabled on the
225 * card, using the MSI mask bits. Firmware doesn't appear to unmask
226 * at that level, so we do it here by hand.
227 */
228 if (irq_to_desc(virq)->msi_desc)
229 unmask_msi_irq(virq);
230
222 /* unmask it */ 231 /* unmask it */
223 xics_unmask_irq(virq); 232 xics_unmask_irq(virq);
224 return 0; 233 return 0;
diff --git a/arch/s390/Kconfig b/arch/s390/Kconfig
index 43c0acad7160..16c673096a22 100644
--- a/arch/s390/Kconfig
+++ b/arch/s390/Kconfig
@@ -95,6 +95,34 @@ 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_EVENTS 97 select HAVE_PERF_EVENTS
98 select ARCH_INLINE_SPIN_TRYLOCK
99 select ARCH_INLINE_SPIN_TRYLOCK_BH
100 select ARCH_INLINE_SPIN_LOCK
101 select ARCH_INLINE_SPIN_LOCK_BH
102 select ARCH_INLINE_SPIN_LOCK_IRQ
103 select ARCH_INLINE_SPIN_LOCK_IRQSAVE
104 select ARCH_INLINE_SPIN_UNLOCK
105 select ARCH_INLINE_SPIN_UNLOCK_BH
106 select ARCH_INLINE_SPIN_UNLOCK_IRQ
107 select ARCH_INLINE_SPIN_UNLOCK_IRQRESTORE
108 select ARCH_INLINE_READ_TRYLOCK
109 select ARCH_INLINE_READ_LOCK
110 select ARCH_INLINE_READ_LOCK_BH
111 select ARCH_INLINE_READ_LOCK_IRQ
112 select ARCH_INLINE_READ_LOCK_IRQSAVE
113 select ARCH_INLINE_READ_UNLOCK
114 select ARCH_INLINE_READ_UNLOCK_BH
115 select ARCH_INLINE_READ_UNLOCK_IRQ
116 select ARCH_INLINE_READ_UNLOCK_IRQRESTORE
117 select ARCH_INLINE_WRITE_TRYLOCK
118 select ARCH_INLINE_WRITE_LOCK
119 select ARCH_INLINE_WRITE_LOCK_BH
120 select ARCH_INLINE_WRITE_LOCK_IRQ
121 select ARCH_INLINE_WRITE_LOCK_IRQSAVE
122 select ARCH_INLINE_WRITE_UNLOCK
123 select ARCH_INLINE_WRITE_UNLOCK_BH
124 select ARCH_INLINE_WRITE_UNLOCK_IRQ
125 select ARCH_INLINE_WRITE_UNLOCK_IRQRESTORE
98 126
99config SCHED_OMIT_FRAME_POINTER 127config SCHED_OMIT_FRAME_POINTER
100 bool 128 bool
diff --git a/arch/s390/include/asm/bug.h b/arch/s390/include/asm/bug.h
index 7efd0abe8887..efb74fd5156e 100644
--- a/arch/s390/include/asm/bug.h
+++ b/arch/s390/include/asm/bug.h
@@ -49,7 +49,7 @@
49 49
50#define BUG() do { \ 50#define BUG() do { \
51 __EMIT_BUG(0); \ 51 __EMIT_BUG(0); \
52 for (;;); \ 52 unreachable(); \
53} while (0) 53} while (0)
54 54
55#define WARN_ON(x) ({ \ 55#define WARN_ON(x) ({ \
diff --git a/arch/s390/include/asm/spinlock.h b/arch/s390/include/asm/spinlock.h
index 41ce6861174e..c9af0d19c7ab 100644
--- a/arch/s390/include/asm/spinlock.h
+++ b/arch/s390/include/asm/spinlock.h
@@ -191,33 +191,4 @@ static inline int __raw_write_trylock(raw_rwlock_t *rw)
191#define _raw_read_relax(lock) cpu_relax() 191#define _raw_read_relax(lock) cpu_relax()
192#define _raw_write_relax(lock) cpu_relax() 192#define _raw_write_relax(lock) cpu_relax()
193 193
194#define __always_inline__spin_lock
195#define __always_inline__read_lock
196#define __always_inline__write_lock
197#define __always_inline__spin_lock_bh
198#define __always_inline__read_lock_bh
199#define __always_inline__write_lock_bh
200#define __always_inline__spin_lock_irq
201#define __always_inline__read_lock_irq
202#define __always_inline__write_lock_irq
203#define __always_inline__spin_lock_irqsave
204#define __always_inline__read_lock_irqsave
205#define __always_inline__write_lock_irqsave
206#define __always_inline__spin_trylock
207#define __always_inline__read_trylock
208#define __always_inline__write_trylock
209#define __always_inline__spin_trylock_bh
210#define __always_inline__spin_unlock
211#define __always_inline__read_unlock
212#define __always_inline__write_unlock
213#define __always_inline__spin_unlock_bh
214#define __always_inline__read_unlock_bh
215#define __always_inline__write_unlock_bh
216#define __always_inline__spin_unlock_irq
217#define __always_inline__read_unlock_irq
218#define __always_inline__write_unlock_irq
219#define __always_inline__spin_unlock_irqrestore
220#define __always_inline__read_unlock_irqrestore
221#define __always_inline__write_unlock_irqrestore
222
223#endif /* __ASM_SPINLOCK_H */ 194#endif /* __ASM_SPINLOCK_H */
diff --git a/arch/s390/kernel/early.c b/arch/s390/kernel/early.c
index bf8b4ae7ff2d..e49e9e0c69fd 100644
--- a/arch/s390/kernel/early.c
+++ b/arch/s390/kernel/early.c
@@ -55,6 +55,7 @@ static void __init reset_tod_clock(void)
55 disabled_wait(0); 55 disabled_wait(0);
56 56
57 sched_clock_base_cc = TOD_UNIX_EPOCH; 57 sched_clock_base_cc = TOD_UNIX_EPOCH;
58 S390_lowcore.last_update_clock = sched_clock_base_cc;
58} 59}
59 60
60#ifdef CONFIG_SHARED_KERNEL 61#ifdef CONFIG_SHARED_KERNEL
@@ -167,6 +168,14 @@ static noinline __init void create_kernel_nss(void)
167 return; 168 return;
168 } 169 }
169 170
171 /* re-initialize cputime accounting. */
172 sched_clock_base_cc = get_clock();
173 S390_lowcore.last_update_clock = sched_clock_base_cc;
174 S390_lowcore.last_update_timer = 0x7fffffffffffffffULL;
175 S390_lowcore.user_timer = 0;
176 S390_lowcore.system_timer = 0;
177 asm volatile("SPT 0(%0)" : : "a" (&S390_lowcore.last_update_timer));
178
170 /* re-setup boot command line with new ipl vm parms */ 179 /* re-setup boot command line with new ipl vm parms */
171 ipl_update_parameters(); 180 ipl_update_parameters();
172 setup_boot_command_line(); 181 setup_boot_command_line();
diff --git a/arch/s390/kernel/entry.S b/arch/s390/kernel/entry.S
index f43d2ee54464..48215d15762b 100644
--- a/arch/s390/kernel/entry.S
+++ b/arch/s390/kernel/entry.S
@@ -565,10 +565,10 @@ pgm_svcper:
565 lh %r7,0x8a # get svc number from lowcore 565 lh %r7,0x8a # get svc number from lowcore
566 l %r9,__LC_THREAD_INFO # load pointer to thread_info struct 566 l %r9,__LC_THREAD_INFO # load pointer to thread_info struct
567 TRACE_IRQS_OFF 567 TRACE_IRQS_OFF
568 l %r1,__TI_task(%r9) 568 l %r8,__TI_task(%r9)
569 mvc __THREAD_per+__PER_atmid(2,%r1),__LC_PER_ATMID 569 mvc __THREAD_per+__PER_atmid(2,%r8),__LC_PER_ATMID
570 mvc __THREAD_per+__PER_address(4,%r1),__LC_PER_ADDRESS 570 mvc __THREAD_per+__PER_address(4,%r8),__LC_PER_ADDRESS
571 mvc __THREAD_per+__PER_access_id(1,%r1),__LC_PER_ACCESS_ID 571 mvc __THREAD_per+__PER_access_id(1,%r8),__LC_PER_ACCESS_ID
572 oi __TI_flags+3(%r9),_TIF_SINGLE_STEP # set TIF_SINGLE_STEP 572 oi __TI_flags+3(%r9),_TIF_SINGLE_STEP # set TIF_SINGLE_STEP
573 TRACE_IRQS_ON 573 TRACE_IRQS_ON
574 stosm __SF_EMPTY(%r15),0x03 # reenable interrupts 574 stosm __SF_EMPTY(%r15),0x03 # reenable interrupts
diff --git a/arch/s390/kernel/entry64.S b/arch/s390/kernel/entry64.S
index a6f7b20df616..9aff1d449b6e 100644
--- a/arch/s390/kernel/entry64.S
+++ b/arch/s390/kernel/entry64.S
@@ -543,10 +543,10 @@ pgm_svcper:
543 mvc __LC_LAST_UPDATE_TIMER(8),__LC_SYNC_ENTER_TIMER 543 mvc __LC_LAST_UPDATE_TIMER(8),__LC_SYNC_ENTER_TIMER
544 llgh %r7,__LC_SVC_INT_CODE # get svc number from lowcore 544 llgh %r7,__LC_SVC_INT_CODE # get svc number from lowcore
545 lg %r9,__LC_THREAD_INFO # load pointer to thread_info struct 545 lg %r9,__LC_THREAD_INFO # load pointer to thread_info struct
546 lg %r1,__TI_task(%r9) 546 lg %r8,__TI_task(%r9)
547 mvc __THREAD_per+__PER_atmid(2,%r1),__LC_PER_ATMID 547 mvc __THREAD_per+__PER_atmid(2,%r8),__LC_PER_ATMID
548 mvc __THREAD_per+__PER_address(8,%r1),__LC_PER_ADDRESS 548 mvc __THREAD_per+__PER_address(8,%r8),__LC_PER_ADDRESS
549 mvc __THREAD_per+__PER_access_id(1,%r1),__LC_PER_ACCESS_ID 549 mvc __THREAD_per+__PER_access_id(1,%r8),__LC_PER_ACCESS_ID
550 oi __TI_flags+7(%r9),_TIF_SINGLE_STEP # set TIF_SINGLE_STEP 550 oi __TI_flags+7(%r9),_TIF_SINGLE_STEP # set TIF_SINGLE_STEP
551 TRACE_IRQS_ON 551 TRACE_IRQS_ON
552 stosm __SF_EMPTY(%r15),0x03 # reenable interrupts 552 stosm __SF_EMPTY(%r15),0x03 # reenable interrupts
diff --git a/arch/s390/kernel/ftrace.c b/arch/s390/kernel/ftrace.c
index f5fe34dd821b..5a82bc68193e 100644
--- a/arch/s390/kernel/ftrace.c
+++ b/arch/s390/kernel/ftrace.c
@@ -203,73 +203,10 @@ out:
203 203
204#ifdef CONFIG_FTRACE_SYSCALLS 204#ifdef CONFIG_FTRACE_SYSCALLS
205 205
206extern unsigned long __start_syscalls_metadata[];
207extern unsigned long __stop_syscalls_metadata[];
208extern unsigned int sys_call_table[]; 206extern unsigned int sys_call_table[];
209 207
210static struct syscall_metadata **syscalls_metadata; 208unsigned long __init arch_syscall_addr(int nr)
211
212struct syscall_metadata *syscall_nr_to_meta(int nr)
213{
214 if (!syscalls_metadata || nr >= NR_syscalls || nr < 0)
215 return NULL;
216
217 return syscalls_metadata[nr];
218}
219
220int syscall_name_to_nr(char *name)
221{
222 int i;
223
224 if (!syscalls_metadata)
225 return -1;
226 for (i = 0; i < NR_syscalls; i++)
227 if (syscalls_metadata[i])
228 if (!strcmp(syscalls_metadata[i]->name, name))
229 return i;
230 return -1;
231}
232
233void set_syscall_enter_id(int num, int id)
234{
235 syscalls_metadata[num]->enter_id = id;
236}
237
238void set_syscall_exit_id(int num, int id)
239{ 209{
240 syscalls_metadata[num]->exit_id = id; 210 return (unsigned long)sys_call_table[nr];
241}
242
243static struct syscall_metadata *find_syscall_meta(unsigned long syscall)
244{
245 struct syscall_metadata *start;
246 struct syscall_metadata *stop;
247 char str[KSYM_SYMBOL_LEN];
248
249 start = (struct syscall_metadata *)__start_syscalls_metadata;
250 stop = (struct syscall_metadata *)__stop_syscalls_metadata;
251 kallsyms_lookup(syscall, NULL, NULL, NULL, str);
252
253 for ( ; start < stop; start++) {
254 if (start->name && !strcmp(start->name + 3, str + 3))
255 return start;
256 }
257 return NULL;
258}
259
260static int __init arch_init_ftrace_syscalls(void)
261{
262 struct syscall_metadata *meta;
263 int i;
264 syscalls_metadata = kzalloc(sizeof(*syscalls_metadata) * NR_syscalls,
265 GFP_KERNEL);
266 if (!syscalls_metadata)
267 return -ENOMEM;
268 for (i = 0; i < NR_syscalls; i++) {
269 meta = find_syscall_meta((unsigned long)sys_call_table[i]);
270 syscalls_metadata[i] = meta;
271 }
272 return 0;
273} 211}
274arch_initcall(arch_init_ftrace_syscalls);
275#endif 212#endif
diff --git a/arch/sh/include/asm/rwsem.h b/arch/sh/include/asm/rwsem.h
index 1987f3ea7f1b..06e2251a5e48 100644
--- a/arch/sh/include/asm/rwsem.h
+++ b/arch/sh/include/asm/rwsem.h
@@ -41,7 +41,7 @@ struct rw_semaphore {
41#endif 41#endif
42 42
43#define __RWSEM_INITIALIZER(name) \ 43#define __RWSEM_INITIALIZER(name) \
44 { RWSEM_UNLOCKED_VALUE, SPIN_LOCK_UNLOCKED, \ 44 { RWSEM_UNLOCKED_VALUE, __SPIN_LOCK_UNLOCKED((name).wait_lock), \
45 LIST_HEAD_INIT((name).wait_list) \ 45 LIST_HEAD_INIT((name).wait_list) \
46 __RWSEM_DEP_MAP_INIT(name) } 46 __RWSEM_DEP_MAP_INIT(name) }
47 47
diff --git a/arch/sh/kernel/cpu/irq/imask.c b/arch/sh/kernel/cpu/irq/imask.c
index 6b5d191eec3a..a351ed84eec5 100644
--- a/arch/sh/kernel/cpu/irq/imask.c
+++ b/arch/sh/kernel/cpu/irq/imask.c
@@ -68,7 +68,7 @@ static void unmask_imask_irq(unsigned int irq)
68} 68}
69 69
70static struct irq_chip imask_irq_chip = { 70static struct irq_chip imask_irq_chip = {
71 .typename = "SR.IMASK", 71 .name = "SR.IMASK",
72 .mask = mask_imask_irq, 72 .mask = mask_imask_irq,
73 .unmask = unmask_imask_irq, 73 .unmask = unmask_imask_irq,
74 .mask_ack = mask_imask_irq, 74 .mask_ack = mask_imask_irq,
diff --git a/arch/sh/kernel/cpu/irq/intc-sh5.c b/arch/sh/kernel/cpu/irq/intc-sh5.c
index 6c092f1f5557..06e7e2959b54 100644
--- a/arch/sh/kernel/cpu/irq/intc-sh5.c
+++ b/arch/sh/kernel/cpu/irq/intc-sh5.c
@@ -85,7 +85,7 @@ static void mask_and_ack_intc(unsigned int);
85static void end_intc_irq(unsigned int irq); 85static void end_intc_irq(unsigned int irq);
86 86
87static struct irq_chip intc_irq_type = { 87static struct irq_chip intc_irq_type = {
88 .typename = "INTC", 88 .name = "INTC",
89 .startup = startup_intc_irq, 89 .startup = startup_intc_irq,
90 .shutdown = shutdown_intc_irq, 90 .shutdown = shutdown_intc_irq,
91 .enable = enable_intc_irq, 91 .enable = enable_intc_irq,
diff --git a/arch/sh/kernel/dwarf.c b/arch/sh/kernel/dwarf.c
index 2d07084e4882..d76a23170dbb 100644
--- a/arch/sh/kernel/dwarf.c
+++ b/arch/sh/kernel/dwarf.c
@@ -555,7 +555,7 @@ struct dwarf_frame * dwarf_unwind_stack(unsigned long pc,
555 * NOTE: the return address is guaranteed to be setup by the 555 * NOTE: the return address is guaranteed to be setup by the
556 * time this function makes its first function call. 556 * time this function makes its first function call.
557 */ 557 */
558 if (!pc && !prev) 558 if (!pc || !prev)
559 pc = (unsigned long)current_text_addr(); 559 pc = (unsigned long)current_text_addr();
560 560
561#ifdef CONFIG_FUNCTION_GRAPH_TRACER 561#ifdef CONFIG_FUNCTION_GRAPH_TRACER
diff --git a/arch/sh/mm/cache-sh4.c b/arch/sh/mm/cache-sh4.c
index 519e2d16cd06..b7f235c74d66 100644
--- a/arch/sh/mm/cache-sh4.c
+++ b/arch/sh/mm/cache-sh4.c
@@ -72,6 +72,7 @@ static void __uses_jump_to_uncached sh4_flush_icache_range(void *args)
72 72
73 for (v = start; v < end; v += L1_CACHE_BYTES) { 73 for (v = start; v < end; v += L1_CACHE_BYTES) {
74 unsigned long icacheaddr; 74 unsigned long icacheaddr;
75 int j, n;
75 76
76 __ocbwb(v); 77 __ocbwb(v);
77 78
@@ -79,8 +80,10 @@ static void __uses_jump_to_uncached sh4_flush_icache_range(void *args)
79 cpu_data->icache.entry_mask); 80 cpu_data->icache.entry_mask);
80 81
81 /* Clear i-cache line valid-bit */ 82 /* Clear i-cache line valid-bit */
83 n = boot_cpu_data.icache.n_aliases;
82 for (i = 0; i < cpu_data->icache.ways; i++) { 84 for (i = 0; i < cpu_data->icache.ways; i++) {
83 __raw_writel(0, icacheaddr); 85 for (j = 0; j < n; j++)
86 __raw_writel(0, icacheaddr + (j * PAGE_SIZE));
84 icacheaddr += cpu_data->icache.way_incr; 87 icacheaddr += cpu_data->icache.way_incr;
85 } 88 }
86 } 89 }
diff --git a/arch/sparc/boot/btfixupprep.c b/arch/sparc/boot/btfixupprep.c
index 52a4208fe4f0..bbf91b9c3d39 100644
--- a/arch/sparc/boot/btfixupprep.c
+++ b/arch/sparc/boot/btfixupprep.c
@@ -61,14 +61,14 @@ unsigned long lastfoffset = -1;
61unsigned long lastfrelno; 61unsigned long lastfrelno;
62btfixup *lastf; 62btfixup *lastf;
63 63
64void fatal(void) __attribute__((noreturn)); 64static void fatal(void) __attribute__((noreturn));
65void fatal(void) 65static void fatal(void)
66{ 66{
67 fprintf(stderr, "Malformed output from objdump\n%s\n", buffer); 67 fprintf(stderr, "Malformed output from objdump\n%s\n", buffer);
68 exit(1); 68 exit(1);
69} 69}
70 70
71btfixup *find(int type, char *name) 71static btfixup *find(int type, char *name)
72{ 72{
73 int i; 73 int i;
74 for (i = 0; i < last; i++) { 74 for (i = 0; i < last; i++) {
@@ -88,7 +88,7 @@ btfixup *find(int type, char *name)
88 return array + last - 1; 88 return array + last - 1;
89} 89}
90 90
91void set_mode (char *buffer) 91static void set_mode (char *buffer)
92{ 92{
93 for (mode = 0;; mode++) 93 for (mode = 0;; mode++)
94 if (buffer[mode] < '0' || buffer[mode] > '9') 94 if (buffer[mode] < '0' || buffer[mode] > '9')
diff --git a/arch/sparc/boot/piggyback_32.c b/arch/sparc/boot/piggyback_32.c
index e8dc9adfcd61..ac944aec7301 100644
--- a/arch/sparc/boot/piggyback_32.c
+++ b/arch/sparc/boot/piggyback_32.c
@@ -35,17 +35,17 @@
35 * as PROM looks for a.out image only. 35 * as PROM looks for a.out image only.
36 */ 36 */
37 37
38unsigned short ld2(char *p) 38static unsigned short ld2(char *p)
39{ 39{
40 return (p[0] << 8) | p[1]; 40 return (p[0] << 8) | p[1];
41} 41}
42 42
43unsigned int ld4(char *p) 43static unsigned int ld4(char *p)
44{ 44{
45 return (p[0] << 24) | (p[1] << 16) | (p[2] << 8) | p[3]; 45 return (p[0] << 24) | (p[1] << 16) | (p[2] << 8) | p[3];
46} 46}
47 47
48void st4(char *p, unsigned int x) 48static void st4(char *p, unsigned int x)
49{ 49{
50 p[0] = x >> 24; 50 p[0] = x >> 24;
51 p[1] = x >> 16; 51 p[1] = x >> 16;
@@ -53,7 +53,7 @@ void st4(char *p, unsigned int x)
53 p[3] = x; 53 p[3] = x;
54} 54}
55 55
56void usage(void) 56static void usage(void)
57{ 57{
58 /* fs_img.gz is an image of initial ramdisk. */ 58 /* fs_img.gz is an image of initial ramdisk. */
59 fprintf(stderr, "Usage: piggyback vmlinux.aout System.map fs_img.gz\n"); 59 fprintf(stderr, "Usage: piggyback vmlinux.aout System.map fs_img.gz\n");
@@ -61,7 +61,7 @@ void usage(void)
61 exit(1); 61 exit(1);
62} 62}
63 63
64void die(char *str) 64static void die(char *str)
65{ 65{
66 perror (str); 66 perror (str);
67 exit(1); 67 exit(1);
diff --git a/arch/sparc/boot/piggyback_64.c b/arch/sparc/boot/piggyback_64.c
index c63fd1b6bdd4..a26a686cb5aa 100644
--- a/arch/sparc/boot/piggyback_64.c
+++ b/arch/sparc/boot/piggyback_64.c
@@ -32,7 +32,7 @@
32/* Note: run this on an a.out kernel (use elftoaout for it), as PROM looks for a.out image onlly 32/* Note: run this on an a.out kernel (use elftoaout for it), as PROM looks for a.out image onlly
33 usage: piggyback vmlinux System.map tail, where tail is gzipped fs of the initial ramdisk */ 33 usage: piggyback vmlinux System.map tail, where tail is gzipped fs of the initial ramdisk */
34 34
35void die(char *str) 35static void die(char *str)
36{ 36{
37 perror (str); 37 perror (str);
38 exit(1); 38 exit(1);
diff --git a/arch/sparc/include/asm/system_64.h b/arch/sparc/include/asm/system_64.h
index 25e848f0cad7..d47a98e66972 100644
--- a/arch/sparc/include/asm/system_64.h
+++ b/arch/sparc/include/asm/system_64.h
@@ -63,6 +63,10 @@ do { __asm__ __volatile__("ba,pt %%xcc, 1f\n\t" \
63 : : : "memory"); \ 63 : : : "memory"); \
64} while (0) 64} while (0)
65 65
66/* The kernel always executes in TSO memory model these days,
67 * and furthermore most sparc64 chips implement more stringent
68 * memory ordering than required by the specifications.
69 */
66#define mb() membar_safe("#StoreLoad") 70#define mb() membar_safe("#StoreLoad")
67#define rmb() __asm__ __volatile__("":::"memory") 71#define rmb() __asm__ __volatile__("":::"memory")
68#define wmb() __asm__ __volatile__("":::"memory") 72#define wmb() __asm__ __volatile__("":::"memory")
diff --git a/arch/sparc/kernel/prom_common.c b/arch/sparc/kernel/prom_common.c
index 138910c67206..d80a65d9e893 100644
--- a/arch/sparc/kernel/prom_common.c
+++ b/arch/sparc/kernel/prom_common.c
@@ -79,6 +79,7 @@ int of_set_property(struct device_node *dp, const char *name, void *val, int len
79 79
80 err = -ENODEV; 80 err = -ENODEV;
81 81
82 mutex_lock(&of_set_property_mutex);
82 write_lock(&devtree_lock); 83 write_lock(&devtree_lock);
83 prevp = &dp->properties; 84 prevp = &dp->properties;
84 while (*prevp) { 85 while (*prevp) {
@@ -88,9 +89,7 @@ int of_set_property(struct device_node *dp, const char *name, void *val, int len
88 void *old_val = prop->value; 89 void *old_val = prop->value;
89 int ret; 90 int ret;
90 91
91 mutex_lock(&of_set_property_mutex);
92 ret = prom_setprop(dp->node, name, val, len); 92 ret = prom_setprop(dp->node, name, val, len);
93 mutex_unlock(&of_set_property_mutex);
94 93
95 err = -EINVAL; 94 err = -EINVAL;
96 if (ret >= 0) { 95 if (ret >= 0) {
@@ -109,6 +108,7 @@ int of_set_property(struct device_node *dp, const char *name, void *val, int len
109 prevp = &(*prevp)->next; 108 prevp = &(*prevp)->next;
110 } 109 }
111 write_unlock(&devtree_lock); 110 write_unlock(&devtree_lock);
111 mutex_unlock(&of_set_property_mutex);
112 112
113 /* XXX Upate procfs if necessary... */ 113 /* XXX Upate procfs if necessary... */
114 114
diff --git a/arch/sparc/kernel/visemul.c b/arch/sparc/kernel/visemul.c
index b956fd71c131..d231cbd5c526 100644
--- a/arch/sparc/kernel/visemul.c
+++ b/arch/sparc/kernel/visemul.c
@@ -617,7 +617,7 @@ static void pmul(struct pt_regs *regs, unsigned int insn, unsigned int opf)
617 rs2 = fps_regval(f, RS2(insn)); 617 rs2 = fps_regval(f, RS2(insn));
618 618
619 rd_val = 0; 619 rd_val = 0;
620 src2 = (rs2 >> (opf == FMUL8x16AU_OPF) ? 16 : 0); 620 src2 = rs2 >> (opf == FMUL8x16AU_OPF ? 16 : 0);
621 for (byte = 0; byte < 4; byte++) { 621 for (byte = 0; byte < 4; byte++) {
622 u16 src1 = (rs1 >> (byte * 8)) & 0x00ff; 622 u16 src1 = (rs1 >> (byte * 8)) & 0x00ff;
623 u32 prod = src1 * src2; 623 u32 prod = src1 * src2;
diff --git a/arch/sparc/mm/init_64.h b/arch/sparc/mm/init_64.h
index c2f772dbd556..77d1b313e344 100644
--- a/arch/sparc/mm/init_64.h
+++ b/arch/sparc/mm/init_64.h
@@ -45,7 +45,7 @@ extern void free_initmem(void);
45#define VMEMMAP_ALIGN(x) (((x)+VMEMMAP_CHUNK-1UL)&VMEMMAP_CHUNK_MASK) 45#define VMEMMAP_ALIGN(x) (((x)+VMEMMAP_CHUNK-1UL)&VMEMMAP_CHUNK_MASK)
46 46
47#define VMEMMAP_SIZE ((((1UL << MAX_PHYSADDR_BITS) >> PAGE_SHIFT) * \ 47#define VMEMMAP_SIZE ((((1UL << MAX_PHYSADDR_BITS) >> PAGE_SHIFT) * \
48 sizeof(struct page *)) >> VMEMMAP_CHUNK_SHIFT) 48 sizeof(struct page)) >> VMEMMAP_CHUNK_SHIFT)
49extern unsigned long vmemmap_table[VMEMMAP_SIZE]; 49extern unsigned long vmemmap_table[VMEMMAP_SIZE];
50#endif 50#endif
51 51
diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
index 72ace9515a07..178084b4377c 100644
--- a/arch/x86/Kconfig
+++ b/arch/x86/Kconfig
@@ -49,6 +49,7 @@ config X86
49 select HAVE_KERNEL_GZIP 49 select HAVE_KERNEL_GZIP
50 select HAVE_KERNEL_BZIP2 50 select HAVE_KERNEL_BZIP2
51 select HAVE_KERNEL_LZMA 51 select HAVE_KERNEL_LZMA
52 select HAVE_HW_BREAKPOINT
52 select HAVE_ARCH_KMEMCHECK 53 select HAVE_ARCH_KMEMCHECK
53 54
54config OUTPUT_FORMAT 55config OUTPUT_FORMAT
diff --git a/arch/x86/Kconfig.cpu b/arch/x86/Kconfig.cpu
index 2649840d888f..5e99762eb5c2 100644
--- a/arch/x86/Kconfig.cpu
+++ b/arch/x86/Kconfig.cpu
@@ -406,7 +406,7 @@ config X86_CMPXCHG64
406# generates cmov. 406# generates cmov.
407config X86_CMOV 407config X86_CMOV
408 def_bool y 408 def_bool y
409 depends on (MK8 || MK7 || MCORE2 || MPENTIUM4 || MPENTIUMM || MPENTIUMIII || MPENTIUMII || M686 || MVIAC3_2 || MVIAC7 || MCRUSOE || MEFFICEON || X86_64 || MATOM) 409 depends on (MK8 || MK7 || MCORE2 || MPENTIUM4 || MPENTIUMM || MPENTIUMIII || MPENTIUMII || M686 || MVIAC3_2 || MVIAC7 || MCRUSOE || MEFFICEON || X86_64 || MATOM || MGEODE_LX)
410 410
411config X86_MINIMUM_CPU_FAMILY 411config X86_MINIMUM_CPU_FAMILY
412 int 412 int
diff --git a/arch/x86/Kconfig.debug b/arch/x86/Kconfig.debug
index d105f29bb6bb..731318e5ac1d 100644
--- a/arch/x86/Kconfig.debug
+++ b/arch/x86/Kconfig.debug
@@ -186,6 +186,15 @@ config X86_DS_SELFTEST
186config HAVE_MMIOTRACE_SUPPORT 186config HAVE_MMIOTRACE_SUPPORT
187 def_bool y 187 def_bool y
188 188
189config X86_DECODER_SELFTEST
190 bool "x86 instruction decoder selftest"
191 depends on DEBUG_KERNEL
192 ---help---
193 Perform x86 instruction decoder selftests at build time.
194 This option is useful for checking the sanity of x86 instruction
195 decoder code.
196 If unsure, say "N".
197
189# 198#
190# IO delay types: 199# IO delay types:
191# 200#
@@ -287,4 +296,18 @@ config OPTIMIZE_INLINING
287 296
288 If unsure, say N. 297 If unsure, say N.
289 298
299config DEBUG_STRICT_USER_COPY_CHECKS
300 bool "Strict copy size checks"
301 depends on DEBUG_KERNEL && !TRACE_BRANCH_PROFILING
302 ---help---
303 Enabling this option turns a certain set of sanity checks for user
304 copy operations into compile time failures.
305
306 The copy_from_user() etc checks are there to help test if there
307 are sufficient security checks on the length argument of
308 the copy operation, by having gcc prove that the argument is
309 within bounds.
310
311 If unsure, or if you run an older (pre 4.4) gcc, say N.
312
290endmenu 313endmenu
diff --git a/arch/x86/Makefile b/arch/x86/Makefile
index d2d24c9ee64d..78b32be55e9e 100644
--- a/arch/x86/Makefile
+++ b/arch/x86/Makefile
@@ -155,6 +155,9 @@ all: bzImage
155KBUILD_IMAGE := $(boot)/bzImage 155KBUILD_IMAGE := $(boot)/bzImage
156 156
157bzImage: vmlinux 157bzImage: vmlinux
158ifeq ($(CONFIG_X86_DECODER_SELFTEST),y)
159 $(Q)$(MAKE) $(build)=arch/x86/tools posttest
160endif
158 $(Q)$(MAKE) $(build)=$(boot) $(KBUILD_IMAGE) 161 $(Q)$(MAKE) $(build)=$(boot) $(KBUILD_IMAGE)
159 $(Q)mkdir -p $(objtree)/arch/$(UTS_MACHINE)/boot 162 $(Q)mkdir -p $(objtree)/arch/$(UTS_MACHINE)/boot
160 $(Q)ln -fsn ../../x86/boot/bzImage $(objtree)/arch/$(UTS_MACHINE)/boot/$@ 163 $(Q)ln -fsn ../../x86/boot/bzImage $(objtree)/arch/$(UTS_MACHINE)/boot/$@
diff --git a/arch/x86/Makefile_32.cpu b/arch/x86/Makefile_32.cpu
index 30e9a264f69d..cbf0776dbec1 100644
--- a/arch/x86/Makefile_32.cpu
+++ b/arch/x86/Makefile_32.cpu
@@ -41,7 +41,7 @@ cflags-$(CONFIG_X86_ELAN) += -march=i486
41 41
42# Geode GX1 support 42# Geode GX1 support
43cflags-$(CONFIG_MGEODEGX1) += -march=pentium-mmx 43cflags-$(CONFIG_MGEODEGX1) += -march=pentium-mmx
44 44cflags-$(CONFIG_MGEODE_LX) += $(call cc-option,-march=geode,-march=pentium-mmx)
45# add at the end to overwrite eventual tuning options from earlier 45# add at the end to overwrite eventual tuning options from earlier
46# cpu entries 46# cpu entries
47cflags-$(CONFIG_X86_GENERIC) += $(call tune,generic,$(call tune,i686)) 47cflags-$(CONFIG_X86_GENERIC) += $(call tune,generic,$(call tune,i686))
diff --git a/arch/x86/include/asm/Kbuild b/arch/x86/include/asm/Kbuild
index 4a8e80cdcfa5..9f828f87ca35 100644
--- a/arch/x86/include/asm/Kbuild
+++ b/arch/x86/include/asm/Kbuild
@@ -10,6 +10,7 @@ header-y += ptrace-abi.h
10header-y += sigcontext32.h 10header-y += sigcontext32.h
11header-y += ucontext.h 11header-y += ucontext.h
12header-y += processor-flags.h 12header-y += processor-flags.h
13header-y += hw_breakpoint.h
13 14
14unifdef-y += e820.h 15unifdef-y += e820.h
15unifdef-y += ist.h 16unifdef-y += ist.h
diff --git a/arch/x86/include/asm/a.out-core.h b/arch/x86/include/asm/a.out-core.h
index bb70e397aa84..7a15588e45d4 100644
--- a/arch/x86/include/asm/a.out-core.h
+++ b/arch/x86/include/asm/a.out-core.h
@@ -17,6 +17,7 @@
17 17
18#include <linux/user.h> 18#include <linux/user.h>
19#include <linux/elfcore.h> 19#include <linux/elfcore.h>
20#include <asm/debugreg.h>
20 21
21/* 22/*
22 * fill in the user structure for an a.out core dump 23 * fill in the user structure for an a.out core dump
@@ -32,14 +33,7 @@ static inline void aout_dump_thread(struct pt_regs *regs, struct user *dump)
32 >> PAGE_SHIFT; 33 >> PAGE_SHIFT;
33 dump->u_dsize -= dump->u_tsize; 34 dump->u_dsize -= dump->u_tsize;
34 dump->u_ssize = 0; 35 dump->u_ssize = 0;
35 dump->u_debugreg[0] = current->thread.debugreg0; 36 aout_dump_debugregs(dump);
36 dump->u_debugreg[1] = current->thread.debugreg1;
37 dump->u_debugreg[2] = current->thread.debugreg2;
38 dump->u_debugreg[3] = current->thread.debugreg3;
39 dump->u_debugreg[4] = 0;
40 dump->u_debugreg[5] = 0;
41 dump->u_debugreg[6] = current->thread.debugreg6;
42 dump->u_debugreg[7] = current->thread.debugreg7;
43 37
44 if (dump->start_stack < TASK_SIZE) 38 if (dump->start_stack < TASK_SIZE)
45 dump->u_ssize = ((unsigned long)(TASK_SIZE - dump->start_stack)) 39 dump->u_ssize = ((unsigned long)(TASK_SIZE - dump->start_stack))
diff --git a/arch/x86/include/asm/alternative-asm.h b/arch/x86/include/asm/alternative-asm.h
index e2077d343c33..b97f786a48d5 100644
--- a/arch/x86/include/asm/alternative-asm.h
+++ b/arch/x86/include/asm/alternative-asm.h
@@ -1,17 +1,13 @@
1#ifdef __ASSEMBLY__ 1#ifdef __ASSEMBLY__
2 2
3#ifdef CONFIG_X86_32 3#include <asm/asm.h>
4# define X86_ALIGN .long
5#else
6# define X86_ALIGN .quad
7#endif
8 4
9#ifdef CONFIG_SMP 5#ifdef CONFIG_SMP
10 .macro LOCK_PREFIX 6 .macro LOCK_PREFIX
111: lock 71: lock
12 .section .smp_locks,"a" 8 .section .smp_locks,"a"
13 .align 4 9 _ASM_ALIGN
14 X86_ALIGN 1b 10 _ASM_PTR 1b
15 .previous 11 .previous
16 .endm 12 .endm
17#else 13#else
diff --git a/arch/x86/include/asm/alternative.h b/arch/x86/include/asm/alternative.h
index c240efc74e00..69b74a7b877f 100644
--- a/arch/x86/include/asm/alternative.h
+++ b/arch/x86/include/asm/alternative.h
@@ -84,6 +84,7 @@ static inline void alternatives_smp_switch(int smp) {}
84 " .byte " __stringify(feature) "\n" /* feature bit */ \ 84 " .byte " __stringify(feature) "\n" /* feature bit */ \
85 " .byte 662b-661b\n" /* sourcelen */ \ 85 " .byte 662b-661b\n" /* sourcelen */ \
86 " .byte 664f-663f\n" /* replacementlen */ \ 86 " .byte 664f-663f\n" /* replacementlen */ \
87 " .byte 0xff + (664f-663f) - (662b-661b)\n" /* rlen <= slen */ \
87 ".previous\n" \ 88 ".previous\n" \
88 ".section .altinstr_replacement, \"ax\"\n" \ 89 ".section .altinstr_replacement, \"ax\"\n" \
89 "663:\n\t" newinstr "\n664:\n" /* replacement */ \ 90 "663:\n\t" newinstr "\n664:\n" /* replacement */ \
diff --git a/arch/x86/include/asm/amd_iommu.h b/arch/x86/include/asm/amd_iommu.h
index ac95995b7bad..5af2982133b5 100644
--- a/arch/x86/include/asm/amd_iommu.h
+++ b/arch/x86/include/asm/amd_iommu.h
@@ -1,5 +1,5 @@
1/* 1/*
2 * Copyright (C) 2007-2008 Advanced Micro Devices, Inc. 2 * Copyright (C) 2007-2009 Advanced Micro Devices, Inc.
3 * Author: Joerg Roedel <joerg.roedel@amd.com> 3 * Author: Joerg Roedel <joerg.roedel@amd.com>
4 * Leo Duran <leo.duran@amd.com> 4 * Leo Duran <leo.duran@amd.com>
5 * 5 *
@@ -23,18 +23,13 @@
23#include <linux/irqreturn.h> 23#include <linux/irqreturn.h>
24 24
25#ifdef CONFIG_AMD_IOMMU 25#ifdef CONFIG_AMD_IOMMU
26extern int amd_iommu_init(void); 26
27extern int amd_iommu_init_dma_ops(void);
28extern int amd_iommu_init_passthrough(void);
29extern void amd_iommu_detect(void); 27extern void amd_iommu_detect(void);
30extern irqreturn_t amd_iommu_int_handler(int irq, void *data); 28
31extern void amd_iommu_flush_all_domains(void);
32extern void amd_iommu_flush_all_devices(void);
33extern void amd_iommu_shutdown(void);
34#else 29#else
35static inline int amd_iommu_init(void) { return -ENODEV; } 30
36static inline void amd_iommu_detect(void) { } 31static inline void amd_iommu_detect(void) { }
37static inline void amd_iommu_shutdown(void) { } 32
38#endif 33#endif
39 34
40#endif /* _ASM_X86_AMD_IOMMU_H */ 35#endif /* _ASM_X86_AMD_IOMMU_H */
diff --git a/arch/x86/include/asm/amd_iommu_proto.h b/arch/x86/include/asm/amd_iommu_proto.h
new file mode 100644
index 000000000000..84786fb9a23b
--- /dev/null
+++ b/arch/x86/include/asm/amd_iommu_proto.h
@@ -0,0 +1,38 @@
1/*
2 * Copyright (C) 2009 Advanced Micro Devices, Inc.
3 * Author: Joerg Roedel <joerg.roedel@amd.com>
4 *
5 * This program is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 as published
7 * by the Free Software Foundation.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 */
18
19#ifndef _ASM_X86_AMD_IOMMU_PROTO_H
20#define _ASM_X86_AMD_IOMMU_PROTO_H
21
22struct amd_iommu;
23
24extern int amd_iommu_init_dma_ops(void);
25extern int amd_iommu_init_passthrough(void);
26extern irqreturn_t amd_iommu_int_handler(int irq, void *data);
27extern void amd_iommu_flush_all_domains(void);
28extern void amd_iommu_flush_all_devices(void);
29extern void amd_iommu_apply_erratum_63(u16 devid);
30extern void amd_iommu_reset_cmd_buffer(struct amd_iommu *iommu);
31
32#ifndef CONFIG_AMD_IOMMU_STATS
33
34static inline void amd_iommu_stats_init(void) { }
35
36#endif /* !CONFIG_AMD_IOMMU_STATS */
37
38#endif /* _ASM_X86_AMD_IOMMU_PROTO_H */
diff --git a/arch/x86/include/asm/amd_iommu_types.h b/arch/x86/include/asm/amd_iommu_types.h
index 2a2cc7a78a81..ba19ad4c47d0 100644
--- a/arch/x86/include/asm/amd_iommu_types.h
+++ b/arch/x86/include/asm/amd_iommu_types.h
@@ -1,5 +1,5 @@
1/* 1/*
2 * Copyright (C) 2007-2008 Advanced Micro Devices, Inc. 2 * Copyright (C) 2007-2009 Advanced Micro Devices, Inc.
3 * Author: Joerg Roedel <joerg.roedel@amd.com> 3 * Author: Joerg Roedel <joerg.roedel@amd.com>
4 * Leo Duran <leo.duran@amd.com> 4 * Leo Duran <leo.duran@amd.com>
5 * 5 *
@@ -25,6 +25,11 @@
25#include <linux/spinlock.h> 25#include <linux/spinlock.h>
26 26
27/* 27/*
28 * Maximum number of IOMMUs supported
29 */
30#define MAX_IOMMUS 32
31
32/*
28 * some size calculation constants 33 * some size calculation constants
29 */ 34 */
30#define DEV_TABLE_ENTRY_SIZE 32 35#define DEV_TABLE_ENTRY_SIZE 32
@@ -206,6 +211,9 @@ extern bool amd_iommu_dump;
206 printk(KERN_INFO "AMD-Vi: " format, ## arg); \ 211 printk(KERN_INFO "AMD-Vi: " format, ## arg); \
207 } while(0); 212 } while(0);
208 213
214/* global flag if IOMMUs cache non-present entries */
215extern bool amd_iommu_np_cache;
216
209/* 217/*
210 * Make iterating over all IOMMUs easier 218 * Make iterating over all IOMMUs easier
211 */ 219 */
@@ -226,6 +234,8 @@ extern bool amd_iommu_dump;
226 * independent of their use. 234 * independent of their use.
227 */ 235 */
228struct protection_domain { 236struct protection_domain {
237 struct list_head list; /* for list of all protection domains */
238 struct list_head dev_list; /* List of all devices in this domain */
229 spinlock_t lock; /* mostly used to lock the page table*/ 239 spinlock_t lock; /* mostly used to lock the page table*/
230 u16 id; /* the domain id written to the device table */ 240 u16 id; /* the domain id written to the device table */
231 int mode; /* paging mode (0-6 levels) */ 241 int mode; /* paging mode (0-6 levels) */
@@ -233,7 +243,20 @@ struct protection_domain {
233 unsigned long flags; /* flags to find out type of domain */ 243 unsigned long flags; /* flags to find out type of domain */
234 bool updated; /* complete domain flush required */ 244 bool updated; /* complete domain flush required */
235 unsigned dev_cnt; /* devices assigned to this domain */ 245 unsigned dev_cnt; /* devices assigned to this domain */
246 unsigned dev_iommu[MAX_IOMMUS]; /* per-IOMMU reference count */
236 void *priv; /* private data */ 247 void *priv; /* private data */
248
249};
250
251/*
252 * This struct contains device specific data for the IOMMU
253 */
254struct iommu_dev_data {
255 struct list_head list; /* For domain->dev_list */
256 struct device *dev; /* Device this data belong to */
257 struct device *alias; /* The Alias Device */
258 struct protection_domain *domain; /* Domain the device is bound to */
259 atomic_t bind; /* Domain attach reverent count */
237}; 260};
238 261
239/* 262/*
@@ -291,6 +314,9 @@ struct dma_ops_domain {
291struct amd_iommu { 314struct amd_iommu {
292 struct list_head list; 315 struct list_head list;
293 316
317 /* Index within the IOMMU array */
318 int index;
319
294 /* locks the accesses to the hardware */ 320 /* locks the accesses to the hardware */
295 spinlock_t lock; 321 spinlock_t lock;
296 322
@@ -357,6 +383,21 @@ struct amd_iommu {
357extern struct list_head amd_iommu_list; 383extern struct list_head amd_iommu_list;
358 384
359/* 385/*
386 * Array with pointers to each IOMMU struct
387 * The indices are referenced in the protection domains
388 */
389extern struct amd_iommu *amd_iommus[MAX_IOMMUS];
390
391/* Number of IOMMUs present in the system */
392extern int amd_iommus_present;
393
394/*
395 * Declarations for the global list of all protection domains
396 */
397extern spinlock_t amd_iommu_pd_lock;
398extern struct list_head amd_iommu_pd_list;
399
400/*
360 * Structure defining one entry in the device table 401 * Structure defining one entry in the device table
361 */ 402 */
362struct dev_table_entry { 403struct dev_table_entry {
@@ -416,15 +457,9 @@ extern unsigned amd_iommu_aperture_order;
416/* largest PCI device id we expect translation requests for */ 457/* largest PCI device id we expect translation requests for */
417extern u16 amd_iommu_last_bdf; 458extern u16 amd_iommu_last_bdf;
418 459
419/* data structures for protection domain handling */
420extern struct protection_domain **amd_iommu_pd_table;
421
422/* allocation bitmap for domain ids */ 460/* allocation bitmap for domain ids */
423extern unsigned long *amd_iommu_pd_alloc_bitmap; 461extern unsigned long *amd_iommu_pd_alloc_bitmap;
424 462
425/* will be 1 if device isolation is enabled */
426extern bool amd_iommu_isolate;
427
428/* 463/*
429 * If true, the addresses will be flushed on unmap time, not when 464 * If true, the addresses will be flushed on unmap time, not when
430 * they are reused 465 * they are reused
@@ -462,11 +497,6 @@ struct __iommu_counter {
462#define ADD_STATS_COUNTER(name, x) 497#define ADD_STATS_COUNTER(name, x)
463#define SUB_STATS_COUNTER(name, x) 498#define SUB_STATS_COUNTER(name, x)
464 499
465static inline void amd_iommu_stats_init(void) { }
466
467#endif /* CONFIG_AMD_IOMMU_STATS */ 500#endif /* CONFIG_AMD_IOMMU_STATS */
468 501
469/* some function prototypes */
470extern void amd_iommu_reset_cmd_buffer(struct amd_iommu *iommu);
471
472#endif /* _ASM_X86_AMD_IOMMU_TYPES_H */ 502#endif /* _ASM_X86_AMD_IOMMU_TYPES_H */
diff --git a/arch/x86/include/asm/apic.h b/arch/x86/include/asm/apic.h
index 474d80d3e6cc..b4ac2cdcb64f 100644
--- a/arch/x86/include/asm/apic.h
+++ b/arch/x86/include/asm/apic.h
@@ -297,20 +297,20 @@ struct apic {
297 int disable_esr; 297 int disable_esr;
298 298
299 int dest_logical; 299 int dest_logical;
300 unsigned long (*check_apicid_used)(physid_mask_t bitmap, int apicid); 300 unsigned long (*check_apicid_used)(physid_mask_t *map, int apicid);
301 unsigned long (*check_apicid_present)(int apicid); 301 unsigned long (*check_apicid_present)(int apicid);
302 302
303 void (*vector_allocation_domain)(int cpu, struct cpumask *retmask); 303 void (*vector_allocation_domain)(int cpu, struct cpumask *retmask);
304 void (*init_apic_ldr)(void); 304 void (*init_apic_ldr)(void);
305 305
306 physid_mask_t (*ioapic_phys_id_map)(physid_mask_t map); 306 void (*ioapic_phys_id_map)(physid_mask_t *phys_map, physid_mask_t *retmap);
307 307
308 void (*setup_apic_routing)(void); 308 void (*setup_apic_routing)(void);
309 int (*multi_timer_check)(int apic, int irq); 309 int (*multi_timer_check)(int apic, int irq);
310 int (*apicid_to_node)(int logical_apicid); 310 int (*apicid_to_node)(int logical_apicid);
311 int (*cpu_to_logical_apicid)(int cpu); 311 int (*cpu_to_logical_apicid)(int cpu);
312 int (*cpu_present_to_apicid)(int mps_cpu); 312 int (*cpu_present_to_apicid)(int mps_cpu);
313 physid_mask_t (*apicid_to_cpu_present)(int phys_apicid); 313 void (*apicid_to_cpu_present)(int phys_apicid, physid_mask_t *retmap);
314 void (*setup_portio_remap)(void); 314 void (*setup_portio_remap)(void);
315 int (*check_phys_apicid_present)(int phys_apicid); 315 int (*check_phys_apicid_present)(int phys_apicid);
316 void (*enable_apic_mode)(void); 316 void (*enable_apic_mode)(void);
@@ -488,6 +488,8 @@ static inline unsigned int read_apic_id(void)
488 488
489extern void default_setup_apic_routing(void); 489extern void default_setup_apic_routing(void);
490 490
491extern struct apic apic_noop;
492
491#ifdef CONFIG_X86_32 493#ifdef CONFIG_X86_32
492 494
493extern struct apic apic_default; 495extern struct apic apic_default;
@@ -532,9 +534,9 @@ default_cpu_mask_to_apicid_and(const struct cpumask *cpumask,
532 return (unsigned int)(mask1 & mask2 & mask3); 534 return (unsigned int)(mask1 & mask2 & mask3);
533} 535}
534 536
535static inline unsigned long default_check_apicid_used(physid_mask_t bitmap, int apicid) 537static inline unsigned long default_check_apicid_used(physid_mask_t *map, int apicid)
536{ 538{
537 return physid_isset(apicid, bitmap); 539 return physid_isset(apicid, *map);
538} 540}
539 541
540static inline unsigned long default_check_apicid_present(int bit) 542static inline unsigned long default_check_apicid_present(int bit)
@@ -542,9 +544,9 @@ static inline unsigned long default_check_apicid_present(int bit)
542 return physid_isset(bit, phys_cpu_present_map); 544 return physid_isset(bit, phys_cpu_present_map);
543} 545}
544 546
545static inline physid_mask_t default_ioapic_phys_id_map(physid_mask_t phys_map) 547static inline void default_ioapic_phys_id_map(physid_mask_t *phys_map, physid_mask_t *retmap)
546{ 548{
547 return phys_map; 549 *retmap = *phys_map;
548} 550}
549 551
550/* Mapping from cpu number to logical apicid */ 552/* Mapping from cpu number to logical apicid */
@@ -583,11 +585,6 @@ extern int default_cpu_present_to_apicid(int mps_cpu);
583extern int default_check_phys_apicid_present(int phys_apicid); 585extern int default_check_phys_apicid_present(int phys_apicid);
584#endif 586#endif
585 587
586static inline physid_mask_t default_apicid_to_cpu_present(int phys_apicid)
587{
588 return physid_mask_of_physid(phys_apicid);
589}
590
591#endif /* CONFIG_X86_LOCAL_APIC */ 588#endif /* CONFIG_X86_LOCAL_APIC */
592 589
593#ifdef CONFIG_X86_32 590#ifdef CONFIG_X86_32
diff --git a/arch/x86/include/asm/apicdef.h b/arch/x86/include/asm/apicdef.h
index 3b62da926de9..7fe3b3060f08 100644
--- a/arch/x86/include/asm/apicdef.h
+++ b/arch/x86/include/asm/apicdef.h
@@ -11,6 +11,12 @@
11#define IO_APIC_DEFAULT_PHYS_BASE 0xfec00000 11#define IO_APIC_DEFAULT_PHYS_BASE 0xfec00000
12#define APIC_DEFAULT_PHYS_BASE 0xfee00000 12#define APIC_DEFAULT_PHYS_BASE 0xfee00000
13 13
14/*
15 * This is the IO-APIC register space as specified
16 * by Intel docs:
17 */
18#define IO_APIC_SLOT_SIZE 1024
19
14#define APIC_ID 0x20 20#define APIC_ID 0x20
15 21
16#define APIC_LVR 0x30 22#define APIC_LVR 0x30
diff --git a/arch/x86/include/asm/apicnum.h b/arch/x86/include/asm/apicnum.h
deleted file mode 100644
index 82f613c607ce..000000000000
--- a/arch/x86/include/asm/apicnum.h
+++ /dev/null
@@ -1,12 +0,0 @@
1#ifndef _ASM_X86_APICNUM_H
2#define _ASM_X86_APICNUM_H
3
4/* define MAX_IO_APICS */
5#ifdef CONFIG_X86_32
6# define MAX_IO_APICS 64
7#else
8# define MAX_IO_APICS 128
9# define MAX_LOCAL_APIC 32768
10#endif
11
12#endif /* _ASM_X86_APICNUM_H */
diff --git a/arch/x86/include/asm/bug.h b/arch/x86/include/asm/bug.h
index d9cf1cd156d2..f654d1bb17fb 100644
--- a/arch/x86/include/asm/bug.h
+++ b/arch/x86/include/asm/bug.h
@@ -22,14 +22,14 @@ do { \
22 ".popsection" \ 22 ".popsection" \
23 : : "i" (__FILE__), "i" (__LINE__), \ 23 : : "i" (__FILE__), "i" (__LINE__), \
24 "i" (sizeof(struct bug_entry))); \ 24 "i" (sizeof(struct bug_entry))); \
25 for (;;) ; \ 25 unreachable(); \
26} while (0) 26} while (0)
27 27
28#else 28#else
29#define BUG() \ 29#define BUG() \
30do { \ 30do { \
31 asm volatile("ud2"); \ 31 asm volatile("ud2"); \
32 for (;;) ; \ 32 unreachable(); \
33} while (0) 33} while (0)
34#endif 34#endif
35 35
diff --git a/arch/x86/include/asm/calgary.h b/arch/x86/include/asm/calgary.h
index b03bedb62aa7..0918654305af 100644
--- a/arch/x86/include/asm/calgary.h
+++ b/arch/x86/include/asm/calgary.h
@@ -62,10 +62,8 @@ struct cal_chipset_ops {
62extern int use_calgary; 62extern int use_calgary;
63 63
64#ifdef CONFIG_CALGARY_IOMMU 64#ifdef CONFIG_CALGARY_IOMMU
65extern int calgary_iommu_init(void);
66extern void detect_calgary(void); 65extern void detect_calgary(void);
67#else 66#else
68static inline int calgary_iommu_init(void) { return 1; }
69static inline void detect_calgary(void) { return; } 67static inline void detect_calgary(void) { return; }
70#endif 68#endif
71 69
diff --git a/arch/x86/include/asm/cmpxchg_32.h b/arch/x86/include/asm/cmpxchg_32.h
index ee1931be6593..ffb9bb6b6c37 100644
--- a/arch/x86/include/asm/cmpxchg_32.h
+++ b/arch/x86/include/asm/cmpxchg_32.h
@@ -8,14 +8,50 @@
8 * you need to test for the feature in boot_cpu_data. 8 * you need to test for the feature in boot_cpu_data.
9 */ 9 */
10 10
11#define xchg(ptr, v) \ 11extern void __xchg_wrong_size(void);
12 ((__typeof__(*(ptr)))__xchg((unsigned long)(v), (ptr), sizeof(*(ptr)))) 12
13/*
14 * Note: no "lock" prefix even on SMP: xchg always implies lock anyway
15 * Note 2: xchg has side effect, so that attribute volatile is necessary,
16 * but generally the primitive is invalid, *ptr is output argument. --ANK
17 */
13 18
14struct __xchg_dummy { 19struct __xchg_dummy {
15 unsigned long a[100]; 20 unsigned long a[100];
16}; 21};
17#define __xg(x) ((struct __xchg_dummy *)(x)) 22#define __xg(x) ((struct __xchg_dummy *)(x))
18 23
24#define __xchg(x, ptr, size) \
25({ \
26 __typeof(*(ptr)) __x = (x); \
27 switch (size) { \
28 case 1: \
29 asm volatile("xchgb %b0,%1" \
30 : "=q" (__x) \
31 : "m" (*__xg(ptr)), "0" (__x) \
32 : "memory"); \
33 break; \
34 case 2: \
35 asm volatile("xchgw %w0,%1" \
36 : "=r" (__x) \
37 : "m" (*__xg(ptr)), "0" (__x) \
38 : "memory"); \
39 break; \
40 case 4: \
41 asm volatile("xchgl %0,%1" \
42 : "=r" (__x) \
43 : "m" (*__xg(ptr)), "0" (__x) \
44 : "memory"); \
45 break; \
46 default: \
47 __xchg_wrong_size(); \
48 } \
49 __x; \
50})
51
52#define xchg(ptr, v) \
53 __xchg((v), (ptr), sizeof(*ptr))
54
19/* 55/*
20 * The semantics of XCHGCMP8B are a bit strange, this is why 56 * The semantics of XCHGCMP8B are a bit strange, this is why
21 * there is a loop and the loading of %%eax and %%edx has to 57 * there is a loop and the loading of %%eax and %%edx has to
@@ -71,57 +107,63 @@ static inline void __set_64bit_var(unsigned long long *ptr,
71 (unsigned int)((value) >> 32)) \ 107 (unsigned int)((value) >> 32)) \
72 : __set_64bit(ptr, ll_low((value)), ll_high((value)))) 108 : __set_64bit(ptr, ll_low((value)), ll_high((value))))
73 109
74/* 110extern void __cmpxchg_wrong_size(void);
75 * Note: no "lock" prefix even on SMP: xchg always implies lock anyway
76 * Note 2: xchg has side effect, so that attribute volatile is necessary,
77 * but generally the primitive is invalid, *ptr is output argument. --ANK
78 */
79static inline unsigned long __xchg(unsigned long x, volatile void *ptr,
80 int size)
81{
82 switch (size) {
83 case 1:
84 asm volatile("xchgb %b0,%1"
85 : "=q" (x)
86 : "m" (*__xg(ptr)), "0" (x)
87 : "memory");
88 break;
89 case 2:
90 asm volatile("xchgw %w0,%1"
91 : "=r" (x)
92 : "m" (*__xg(ptr)), "0" (x)
93 : "memory");
94 break;
95 case 4:
96 asm volatile("xchgl %0,%1"
97 : "=r" (x)
98 : "m" (*__xg(ptr)), "0" (x)
99 : "memory");
100 break;
101 }
102 return x;
103}
104 111
105/* 112/*
106 * Atomic compare and exchange. Compare OLD with MEM, if identical, 113 * Atomic compare and exchange. Compare OLD with MEM, if identical,
107 * store NEW in MEM. Return the initial value in MEM. Success is 114 * store NEW in MEM. Return the initial value in MEM. Success is
108 * indicated by comparing RETURN with OLD. 115 * indicated by comparing RETURN with OLD.
109 */ 116 */
117#define __raw_cmpxchg(ptr, old, new, size, lock) \
118({ \
119 __typeof__(*(ptr)) __ret; \
120 __typeof__(*(ptr)) __old = (old); \
121 __typeof__(*(ptr)) __new = (new); \
122 switch (size) { \
123 case 1: \
124 asm volatile(lock "cmpxchgb %b1,%2" \
125 : "=a"(__ret) \
126 : "q"(__new), "m"(*__xg(ptr)), "0"(__old) \
127 : "memory"); \
128 break; \
129 case 2: \
130 asm volatile(lock "cmpxchgw %w1,%2" \
131 : "=a"(__ret) \
132 : "r"(__new), "m"(*__xg(ptr)), "0"(__old) \
133 : "memory"); \
134 break; \
135 case 4: \
136 asm volatile(lock "cmpxchgl %1,%2" \
137 : "=a"(__ret) \
138 : "r"(__new), "m"(*__xg(ptr)), "0"(__old) \
139 : "memory"); \
140 break; \
141 default: \
142 __cmpxchg_wrong_size(); \
143 } \
144 __ret; \
145})
146
147#define __cmpxchg(ptr, old, new, size) \
148 __raw_cmpxchg((ptr), (old), (new), (size), LOCK_PREFIX)
149
150#define __sync_cmpxchg(ptr, old, new, size) \
151 __raw_cmpxchg((ptr), (old), (new), (size), "lock; ")
152
153#define __cmpxchg_local(ptr, old, new, size) \
154 __raw_cmpxchg((ptr), (old), (new), (size), "")
110 155
111#ifdef CONFIG_X86_CMPXCHG 156#ifdef CONFIG_X86_CMPXCHG
112#define __HAVE_ARCH_CMPXCHG 1 157#define __HAVE_ARCH_CMPXCHG 1
113#define cmpxchg(ptr, o, n) \ 158
114 ((__typeof__(*(ptr)))__cmpxchg((ptr), (unsigned long)(o), \ 159#define cmpxchg(ptr, old, new) \
115 (unsigned long)(n), \ 160 __cmpxchg((ptr), (old), (new), sizeof(*ptr))
116 sizeof(*(ptr)))) 161
117#define sync_cmpxchg(ptr, o, n) \ 162#define sync_cmpxchg(ptr, old, new) \
118 ((__typeof__(*(ptr)))__sync_cmpxchg((ptr), (unsigned long)(o), \ 163 __sync_cmpxchg((ptr), (old), (new), sizeof(*ptr))
119 (unsigned long)(n), \ 164
120 sizeof(*(ptr)))) 165#define cmpxchg_local(ptr, old, new) \
121#define cmpxchg_local(ptr, o, n) \ 166 __cmpxchg_local((ptr), (old), (new), sizeof(*ptr))
122 ((__typeof__(*(ptr)))__cmpxchg_local((ptr), (unsigned long)(o), \
123 (unsigned long)(n), \
124 sizeof(*(ptr))))
125#endif 167#endif
126 168
127#ifdef CONFIG_X86_CMPXCHG64 169#ifdef CONFIG_X86_CMPXCHG64
@@ -133,94 +175,6 @@ static inline unsigned long __xchg(unsigned long x, volatile void *ptr,
133 (unsigned long long)(n))) 175 (unsigned long long)(n)))
134#endif 176#endif
135 177
136static inline unsigned long __cmpxchg(volatile void *ptr, unsigned long old,
137 unsigned long new, int size)
138{
139 unsigned long prev;
140 switch (size) {
141 case 1:
142 asm volatile(LOCK_PREFIX "cmpxchgb %b1,%2"
143 : "=a"(prev)
144 : "q"(new), "m"(*__xg(ptr)), "0"(old)
145 : "memory");
146 return prev;
147 case 2:
148 asm volatile(LOCK_PREFIX "cmpxchgw %w1,%2"
149 : "=a"(prev)
150 : "r"(new), "m"(*__xg(ptr)), "0"(old)
151 : "memory");
152 return prev;
153 case 4:
154 asm volatile(LOCK_PREFIX "cmpxchgl %1,%2"
155 : "=a"(prev)
156 : "r"(new), "m"(*__xg(ptr)), "0"(old)
157 : "memory");
158 return prev;
159 }
160 return old;
161}
162
163/*
164 * Always use locked operations when touching memory shared with a
165 * hypervisor, since the system may be SMP even if the guest kernel
166 * isn't.
167 */
168static inline unsigned long __sync_cmpxchg(volatile void *ptr,
169 unsigned long old,
170 unsigned long new, int size)
171{
172 unsigned long prev;
173 switch (size) {
174 case 1:
175 asm volatile("lock; cmpxchgb %b1,%2"
176 : "=a"(prev)
177 : "q"(new), "m"(*__xg(ptr)), "0"(old)
178 : "memory");
179 return prev;
180 case 2:
181 asm volatile("lock; cmpxchgw %w1,%2"
182 : "=a"(prev)
183 : "r"(new), "m"(*__xg(ptr)), "0"(old)
184 : "memory");
185 return prev;
186 case 4:
187 asm volatile("lock; cmpxchgl %1,%2"
188 : "=a"(prev)
189 : "r"(new), "m"(*__xg(ptr)), "0"(old)
190 : "memory");
191 return prev;
192 }
193 return old;
194}
195
196static inline unsigned long __cmpxchg_local(volatile void *ptr,
197 unsigned long old,
198 unsigned long new, int size)
199{
200 unsigned long prev;
201 switch (size) {
202 case 1:
203 asm volatile("cmpxchgb %b1,%2"
204 : "=a"(prev)
205 : "q"(new), "m"(*__xg(ptr)), "0"(old)
206 : "memory");
207 return prev;
208 case 2:
209 asm volatile("cmpxchgw %w1,%2"
210 : "=a"(prev)
211 : "r"(new), "m"(*__xg(ptr)), "0"(old)
212 : "memory");
213 return prev;
214 case 4:
215 asm volatile("cmpxchgl %1,%2"
216 : "=a"(prev)
217 : "r"(new), "m"(*__xg(ptr)), "0"(old)
218 : "memory");
219 return prev;
220 }
221 return old;
222}
223
224static inline unsigned long long __cmpxchg64(volatile void *ptr, 178static inline unsigned long long __cmpxchg64(volatile void *ptr,
225 unsigned long long old, 179 unsigned long long old,
226 unsigned long long new) 180 unsigned long long new)
diff --git a/arch/x86/include/asm/cmpxchg_64.h b/arch/x86/include/asm/cmpxchg_64.h
index 52de72e0de8c..485ae415faec 100644
--- a/arch/x86/include/asm/cmpxchg_64.h
+++ b/arch/x86/include/asm/cmpxchg_64.h
@@ -3,9 +3,6 @@
3 3
4#include <asm/alternative.h> /* Provides LOCK_PREFIX */ 4#include <asm/alternative.h> /* Provides LOCK_PREFIX */
5 5
6#define xchg(ptr, v) ((__typeof__(*(ptr)))__xchg((unsigned long)(v), \
7 (ptr), sizeof(*(ptr))))
8
9#define __xg(x) ((volatile long *)(x)) 6#define __xg(x) ((volatile long *)(x))
10 7
11static inline void set_64bit(volatile unsigned long *ptr, unsigned long val) 8static inline void set_64bit(volatile unsigned long *ptr, unsigned long val)
@@ -15,167 +12,118 @@ static inline void set_64bit(volatile unsigned long *ptr, unsigned long val)
15 12
16#define _set_64bit set_64bit 13#define _set_64bit set_64bit
17 14
15extern void __xchg_wrong_size(void);
16extern void __cmpxchg_wrong_size(void);
17
18/* 18/*
19 * Note: no "lock" prefix even on SMP: xchg always implies lock anyway 19 * Note: no "lock" prefix even on SMP: xchg always implies lock anyway
20 * Note 2: xchg has side effect, so that attribute volatile is necessary, 20 * Note 2: xchg has side effect, so that attribute volatile is necessary,
21 * but generally the primitive is invalid, *ptr is output argument. --ANK 21 * but generally the primitive is invalid, *ptr is output argument. --ANK
22 */ 22 */
23static inline unsigned long __xchg(unsigned long x, volatile void *ptr, 23#define __xchg(x, ptr, size) \
24 int size) 24({ \
25{ 25 __typeof(*(ptr)) __x = (x); \
26 switch (size) { 26 switch (size) { \
27 case 1: 27 case 1: \
28 asm volatile("xchgb %b0,%1" 28 asm volatile("xchgb %b0,%1" \
29 : "=q" (x) 29 : "=q" (__x) \
30 : "m" (*__xg(ptr)), "0" (x) 30 : "m" (*__xg(ptr)), "0" (__x) \
31 : "memory"); 31 : "memory"); \
32 break; 32 break; \
33 case 2: 33 case 2: \
34 asm volatile("xchgw %w0,%1" 34 asm volatile("xchgw %w0,%1" \
35 : "=r" (x) 35 : "=r" (__x) \
36 : "m" (*__xg(ptr)), "0" (x) 36 : "m" (*__xg(ptr)), "0" (__x) \
37 : "memory"); 37 : "memory"); \
38 break; 38 break; \
39 case 4: 39 case 4: \
40 asm volatile("xchgl %k0,%1" 40 asm volatile("xchgl %k0,%1" \
41 : "=r" (x) 41 : "=r" (__x) \
42 : "m" (*__xg(ptr)), "0" (x) 42 : "m" (*__xg(ptr)), "0" (__x) \
43 : "memory"); 43 : "memory"); \
44 break; 44 break; \
45 case 8: 45 case 8: \
46 asm volatile("xchgq %0,%1" 46 asm volatile("xchgq %0,%1" \
47 : "=r" (x) 47 : "=r" (__x) \
48 : "m" (*__xg(ptr)), "0" (x) 48 : "m" (*__xg(ptr)), "0" (__x) \
49 : "memory"); 49 : "memory"); \
50 break; 50 break; \
51 } 51 default: \
52 return x; 52 __xchg_wrong_size(); \
53} 53 } \
54 __x; \
55})
56
57#define xchg(ptr, v) \
58 __xchg((v), (ptr), sizeof(*ptr))
59
60#define __HAVE_ARCH_CMPXCHG 1
54 61
55/* 62/*
56 * Atomic compare and exchange. Compare OLD with MEM, if identical, 63 * Atomic compare and exchange. Compare OLD with MEM, if identical,
57 * store NEW in MEM. Return the initial value in MEM. Success is 64 * store NEW in MEM. Return the initial value in MEM. Success is
58 * indicated by comparing RETURN with OLD. 65 * indicated by comparing RETURN with OLD.
59 */ 66 */
67#define __raw_cmpxchg(ptr, old, new, size, lock) \
68({ \
69 __typeof__(*(ptr)) __ret; \
70 __typeof__(*(ptr)) __old = (old); \
71 __typeof__(*(ptr)) __new = (new); \
72 switch (size) { \
73 case 1: \
74 asm volatile(lock "cmpxchgb %b1,%2" \
75 : "=a"(__ret) \
76 : "q"(__new), "m"(*__xg(ptr)), "0"(__old) \
77 : "memory"); \
78 break; \
79 case 2: \
80 asm volatile(lock "cmpxchgw %w1,%2" \
81 : "=a"(__ret) \
82 : "r"(__new), "m"(*__xg(ptr)), "0"(__old) \
83 : "memory"); \
84 break; \
85 case 4: \
86 asm volatile(lock "cmpxchgl %k1,%2" \
87 : "=a"(__ret) \
88 : "r"(__new), "m"(*__xg(ptr)), "0"(__old) \
89 : "memory"); \
90 break; \
91 case 8: \
92 asm volatile(lock "cmpxchgq %1,%2" \
93 : "=a"(__ret) \
94 : "r"(__new), "m"(*__xg(ptr)), "0"(__old) \
95 : "memory"); \
96 break; \
97 default: \
98 __cmpxchg_wrong_size(); \
99 } \
100 __ret; \
101})
60 102
61#define __HAVE_ARCH_CMPXCHG 1 103#define __cmpxchg(ptr, old, new, size) \
104 __raw_cmpxchg((ptr), (old), (new), (size), LOCK_PREFIX)
62 105
63static inline unsigned long __cmpxchg(volatile void *ptr, unsigned long old, 106#define __sync_cmpxchg(ptr, old, new, size) \
64 unsigned long new, int size) 107 __raw_cmpxchg((ptr), (old), (new), (size), "lock; ")
65{
66 unsigned long prev;
67 switch (size) {
68 case 1:
69 asm volatile(LOCK_PREFIX "cmpxchgb %b1,%2"
70 : "=a"(prev)
71 : "q"(new), "m"(*__xg(ptr)), "0"(old)
72 : "memory");
73 return prev;
74 case 2:
75 asm volatile(LOCK_PREFIX "cmpxchgw %w1,%2"
76 : "=a"(prev)
77 : "r"(new), "m"(*__xg(ptr)), "0"(old)
78 : "memory");
79 return prev;
80 case 4:
81 asm volatile(LOCK_PREFIX "cmpxchgl %k1,%2"
82 : "=a"(prev)
83 : "r"(new), "m"(*__xg(ptr)), "0"(old)
84 : "memory");
85 return prev;
86 case 8:
87 asm volatile(LOCK_PREFIX "cmpxchgq %1,%2"
88 : "=a"(prev)
89 : "r"(new), "m"(*__xg(ptr)), "0"(old)
90 : "memory");
91 return prev;
92 }
93 return old;
94}
95 108
96/* 109#define __cmpxchg_local(ptr, old, new, size) \
97 * Always use locked operations when touching memory shared with a 110 __raw_cmpxchg((ptr), (old), (new), (size), "")
98 * hypervisor, since the system may be SMP even if the guest kernel
99 * isn't.
100 */
101static inline unsigned long __sync_cmpxchg(volatile void *ptr,
102 unsigned long old,
103 unsigned long new, int size)
104{
105 unsigned long prev;
106 switch (size) {
107 case 1:
108 asm volatile("lock; cmpxchgb %b1,%2"
109 : "=a"(prev)
110 : "q"(new), "m"(*__xg(ptr)), "0"(old)
111 : "memory");
112 return prev;
113 case 2:
114 asm volatile("lock; cmpxchgw %w1,%2"
115 : "=a"(prev)
116 : "r"(new), "m"(*__xg(ptr)), "0"(old)
117 : "memory");
118 return prev;
119 case 4:
120 asm volatile("lock; cmpxchgl %1,%2"
121 : "=a"(prev)
122 : "r"(new), "m"(*__xg(ptr)), "0"(old)
123 : "memory");
124 return prev;
125 }
126 return old;
127}
128 111
129static inline unsigned long __cmpxchg_local(volatile void *ptr, 112#define cmpxchg(ptr, old, new) \
130 unsigned long old, 113 __cmpxchg((ptr), (old), (new), sizeof(*ptr))
131 unsigned long new, int size) 114
132{ 115#define sync_cmpxchg(ptr, old, new) \
133 unsigned long prev; 116 __sync_cmpxchg((ptr), (old), (new), sizeof(*ptr))
134 switch (size) { 117
135 case 1: 118#define cmpxchg_local(ptr, old, new) \
136 asm volatile("cmpxchgb %b1,%2" 119 __cmpxchg_local((ptr), (old), (new), sizeof(*ptr))
137 : "=a"(prev)
138 : "q"(new), "m"(*__xg(ptr)), "0"(old)
139 : "memory");
140 return prev;
141 case 2:
142 asm volatile("cmpxchgw %w1,%2"
143 : "=a"(prev)
144 : "r"(new), "m"(*__xg(ptr)), "0"(old)
145 : "memory");
146 return prev;
147 case 4:
148 asm volatile("cmpxchgl %k1,%2"
149 : "=a"(prev)
150 : "r"(new), "m"(*__xg(ptr)), "0"(old)
151 : "memory");
152 return prev;
153 case 8:
154 asm volatile("cmpxchgq %1,%2"
155 : "=a"(prev)
156 : "r"(new), "m"(*__xg(ptr)), "0"(old)
157 : "memory");
158 return prev;
159 }
160 return old;
161}
162 120
163#define cmpxchg(ptr, o, n) \
164 ((__typeof__(*(ptr)))__cmpxchg((ptr), (unsigned long)(o), \
165 (unsigned long)(n), sizeof(*(ptr))))
166#define cmpxchg64(ptr, o, n) \ 121#define cmpxchg64(ptr, o, n) \
167({ \ 122({ \
168 BUILD_BUG_ON(sizeof(*(ptr)) != 8); \ 123 BUILD_BUG_ON(sizeof(*(ptr)) != 8); \
169 cmpxchg((ptr), (o), (n)); \ 124 cmpxchg((ptr), (o), (n)); \
170}) 125})
171#define cmpxchg_local(ptr, o, n) \ 126
172 ((__typeof__(*(ptr)))__cmpxchg_local((ptr), (unsigned long)(o), \
173 (unsigned long)(n), \
174 sizeof(*(ptr))))
175#define sync_cmpxchg(ptr, o, n) \
176 ((__typeof__(*(ptr)))__sync_cmpxchg((ptr), (unsigned long)(o), \
177 (unsigned long)(n), \
178 sizeof(*(ptr))))
179#define cmpxchg64_local(ptr, o, n) \ 127#define cmpxchg64_local(ptr, o, n) \
180({ \ 128({ \
181 BUILD_BUG_ON(sizeof(*(ptr)) != 8); \ 129 BUILD_BUG_ON(sizeof(*(ptr)) != 8); \
diff --git a/arch/x86/include/asm/debugreg.h b/arch/x86/include/asm/debugreg.h
index 3ea6f37be9e2..8240f76b531e 100644
--- a/arch/x86/include/asm/debugreg.h
+++ b/arch/x86/include/asm/debugreg.h
@@ -18,6 +18,7 @@
18#define DR_TRAP1 (0x2) /* db1 */ 18#define DR_TRAP1 (0x2) /* db1 */
19#define DR_TRAP2 (0x4) /* db2 */ 19#define DR_TRAP2 (0x4) /* db2 */
20#define DR_TRAP3 (0x8) /* db3 */ 20#define DR_TRAP3 (0x8) /* db3 */
21#define DR_TRAP_BITS (DR_TRAP0|DR_TRAP1|DR_TRAP2|DR_TRAP3)
21 22
22#define DR_STEP (0x4000) /* single-step */ 23#define DR_STEP (0x4000) /* single-step */
23#define DR_SWITCH (0x8000) /* task switch */ 24#define DR_SWITCH (0x8000) /* task switch */
@@ -49,6 +50,8 @@
49 50
50#define DR_LOCAL_ENABLE_SHIFT 0 /* Extra shift to the local enable bit */ 51#define DR_LOCAL_ENABLE_SHIFT 0 /* Extra shift to the local enable bit */
51#define DR_GLOBAL_ENABLE_SHIFT 1 /* Extra shift to the global enable bit */ 52#define DR_GLOBAL_ENABLE_SHIFT 1 /* Extra shift to the global enable bit */
53#define DR_LOCAL_ENABLE (0x1) /* Local enable for reg 0 */
54#define DR_GLOBAL_ENABLE (0x2) /* Global enable for reg 0 */
52#define DR_ENABLE_SIZE 2 /* 2 enable bits per register */ 55#define DR_ENABLE_SIZE 2 /* 2 enable bits per register */
53 56
54#define DR_LOCAL_ENABLE_MASK (0x55) /* Set local bits for all 4 regs */ 57#define DR_LOCAL_ENABLE_MASK (0x55) /* Set local bits for all 4 regs */
@@ -67,4 +70,34 @@
67#define DR_LOCAL_SLOWDOWN (0x100) /* Local slow the pipeline */ 70#define DR_LOCAL_SLOWDOWN (0x100) /* Local slow the pipeline */
68#define DR_GLOBAL_SLOWDOWN (0x200) /* Global slow the pipeline */ 71#define DR_GLOBAL_SLOWDOWN (0x200) /* Global slow the pipeline */
69 72
73/*
74 * HW breakpoint additions
75 */
76#ifdef __KERNEL__
77
78DECLARE_PER_CPU(unsigned long, cpu_dr7);
79
80static inline void hw_breakpoint_disable(void)
81{
82 /* Zero the control register for HW Breakpoint */
83 set_debugreg(0UL, 7);
84
85 /* Zero-out the individual HW breakpoint address registers */
86 set_debugreg(0UL, 0);
87 set_debugreg(0UL, 1);
88 set_debugreg(0UL, 2);
89 set_debugreg(0UL, 3);
90}
91
92static inline int hw_breakpoint_active(void)
93{
94 return __get_cpu_var(cpu_dr7) & DR_GLOBAL_ENABLE_MASK;
95}
96
97extern void aout_dump_debugregs(struct user *dump);
98
99extern void hw_breakpoint_restore(void);
100
101#endif /* __KERNEL__ */
102
70#endif /* _ASM_X86_DEBUGREG_H */ 103#endif /* _ASM_X86_DEBUGREG_H */
diff --git a/arch/x86/include/asm/desc.h b/arch/x86/include/asm/desc.h
index e8de2f6f5ca5..617bd56b3070 100644
--- a/arch/x86/include/asm/desc.h
+++ b/arch/x86/include/asm/desc.h
@@ -288,7 +288,7 @@ static inline void load_LDT(mm_context_t *pc)
288 288
289static inline unsigned long get_desc_base(const struct desc_struct *desc) 289static inline unsigned long get_desc_base(const struct desc_struct *desc)
290{ 290{
291 return desc->base0 | ((desc->base1) << 16) | ((desc->base2) << 24); 291 return (unsigned)(desc->base0 | ((desc->base1) << 16) | ((desc->base2) << 24));
292} 292}
293 293
294static inline void set_desc_base(struct desc_struct *desc, unsigned long base) 294static inline void set_desc_base(struct desc_struct *desc, unsigned long base)
diff --git a/arch/x86/include/asm/device.h b/arch/x86/include/asm/device.h
index cee34e9ca45b..029f230ab637 100644
--- a/arch/x86/include/asm/device.h
+++ b/arch/x86/include/asm/device.h
@@ -8,7 +8,7 @@ struct dev_archdata {
8#ifdef CONFIG_X86_64 8#ifdef CONFIG_X86_64
9struct dma_map_ops *dma_ops; 9struct dma_map_ops *dma_ops;
10#endif 10#endif
11#ifdef CONFIG_DMAR 11#if defined(CONFIG_DMAR) || defined(CONFIG_AMD_IOMMU)
12 void *iommu; /* hook for IOMMU specific extension */ 12 void *iommu; /* hook for IOMMU specific extension */
13#endif 13#endif
14}; 14};
diff --git a/arch/x86/include/asm/dma-mapping.h b/arch/x86/include/asm/dma-mapping.h
index 0ee770d23d0e..0f6c02f3b7d4 100644
--- a/arch/x86/include/asm/dma-mapping.h
+++ b/arch/x86/include/asm/dma-mapping.h
@@ -14,7 +14,14 @@
14#include <asm/swiotlb.h> 14#include <asm/swiotlb.h>
15#include <asm-generic/dma-coherent.h> 15#include <asm-generic/dma-coherent.h>
16 16
17extern dma_addr_t bad_dma_address; 17#ifdef CONFIG_ISA
18# define ISA_DMA_BIT_MASK DMA_BIT_MASK(24)
19#else
20# define ISA_DMA_BIT_MASK DMA_BIT_MASK(32)
21#endif
22
23#define DMA_ERROR_CODE 0
24
18extern int iommu_merge; 25extern int iommu_merge;
19extern struct device x86_dma_fallback_dev; 26extern struct device x86_dma_fallback_dev;
20extern int panic_on_overflow; 27extern int panic_on_overflow;
@@ -42,7 +49,7 @@ static inline int dma_mapping_error(struct device *dev, dma_addr_t dma_addr)
42 if (ops->mapping_error) 49 if (ops->mapping_error)
43 return ops->mapping_error(dev, dma_addr); 50 return ops->mapping_error(dev, dma_addr);
44 51
45 return (dma_addr == bad_dma_address); 52 return (dma_addr == DMA_ERROR_CODE);
46} 53}
47 54
48#define dma_alloc_noncoherent(d, s, h, f) dma_alloc_coherent(d, s, h, f) 55#define dma_alloc_noncoherent(d, s, h, f) dma_alloc_coherent(d, s, h, f)
@@ -124,10 +131,8 @@ dma_alloc_coherent(struct device *dev, size_t size, dma_addr_t *dma_handle,
124 if (dma_alloc_from_coherent(dev, size, dma_handle, &memory)) 131 if (dma_alloc_from_coherent(dev, size, dma_handle, &memory))
125 return memory; 132 return memory;
126 133
127 if (!dev) { 134 if (!dev)
128 dev = &x86_dma_fallback_dev; 135 dev = &x86_dma_fallback_dev;
129 gfp |= GFP_DMA;
130 }
131 136
132 if (!is_device_dma_capable(dev)) 137 if (!is_device_dma_capable(dev))
133 return NULL; 138 return NULL;
diff --git a/arch/x86/include/asm/gart.h b/arch/x86/include/asm/gart.h
index 6cfdafa409d8..4ac5b0f33fc1 100644
--- a/arch/x86/include/asm/gart.h
+++ b/arch/x86/include/asm/gart.h
@@ -35,8 +35,7 @@ extern int gart_iommu_aperture_allowed;
35extern int gart_iommu_aperture_disabled; 35extern int gart_iommu_aperture_disabled;
36 36
37extern void early_gart_iommu_check(void); 37extern void early_gart_iommu_check(void);
38extern void gart_iommu_init(void); 38extern int gart_iommu_init(void);
39extern void gart_iommu_shutdown(void);
40extern void __init gart_parse_options(char *); 39extern void __init gart_parse_options(char *);
41extern void gart_iommu_hole_init(void); 40extern void gart_iommu_hole_init(void);
42 41
@@ -48,12 +47,6 @@ extern void gart_iommu_hole_init(void);
48static inline void early_gart_iommu_check(void) 47static inline void early_gart_iommu_check(void)
49{ 48{
50} 49}
51static inline void gart_iommu_init(void)
52{
53}
54static inline void gart_iommu_shutdown(void)
55{
56}
57static inline void gart_parse_options(char *options) 50static inline void gart_parse_options(char *options)
58{ 51{
59} 52}
diff --git a/arch/x86/include/asm/hardirq.h b/arch/x86/include/asm/hardirq.h
index 82e3e8f01043..108eb6fd1ae7 100644
--- a/arch/x86/include/asm/hardirq.h
+++ b/arch/x86/include/asm/hardirq.h
@@ -20,11 +20,11 @@ typedef struct {
20 unsigned int irq_call_count; 20 unsigned int irq_call_count;
21 unsigned int irq_tlb_count; 21 unsigned int irq_tlb_count;
22#endif 22#endif
23#ifdef CONFIG_X86_MCE 23#ifdef CONFIG_X86_THERMAL_VECTOR
24 unsigned int irq_thermal_count; 24 unsigned int irq_thermal_count;
25# ifdef CONFIG_X86_MCE_THRESHOLD 25#endif
26#ifdef CONFIG_X86_MCE_THRESHOLD
26 unsigned int irq_threshold_count; 27 unsigned int irq_threshold_count;
27# endif
28#endif 28#endif
29} ____cacheline_aligned irq_cpustat_t; 29} ____cacheline_aligned irq_cpustat_t;
30 30
diff --git a/arch/x86/include/asm/hw_breakpoint.h b/arch/x86/include/asm/hw_breakpoint.h
new file mode 100644
index 000000000000..0675a7c4c20e
--- /dev/null
+++ b/arch/x86/include/asm/hw_breakpoint.h
@@ -0,0 +1,73 @@
1#ifndef _I386_HW_BREAKPOINT_H
2#define _I386_HW_BREAKPOINT_H
3
4#ifdef __KERNEL__
5#define __ARCH_HW_BREAKPOINT_H
6
7/*
8 * The name should probably be something dealt in
9 * a higher level. While dealing with the user
10 * (display/resolving)
11 */
12struct arch_hw_breakpoint {
13 char *name; /* Contains name of the symbol to set bkpt */
14 unsigned long address;
15 u8 len;
16 u8 type;
17};
18
19#include <linux/kdebug.h>
20#include <linux/percpu.h>
21#include <linux/list.h>
22
23/* Available HW breakpoint length encodings */
24#define X86_BREAKPOINT_LEN_1 0x40
25#define X86_BREAKPOINT_LEN_2 0x44
26#define X86_BREAKPOINT_LEN_4 0x4c
27#define X86_BREAKPOINT_LEN_EXECUTE 0x40
28
29#ifdef CONFIG_X86_64
30#define X86_BREAKPOINT_LEN_8 0x48
31#endif
32
33/* Available HW breakpoint type encodings */
34
35/* trigger on instruction execute */
36#define X86_BREAKPOINT_EXECUTE 0x80
37/* trigger on memory write */
38#define X86_BREAKPOINT_WRITE 0x81
39/* trigger on memory read or write */
40#define X86_BREAKPOINT_RW 0x83
41
42/* Total number of available HW breakpoint registers */
43#define HBP_NUM 4
44
45struct perf_event;
46struct pmu;
47
48extern int arch_check_va_in_userspace(unsigned long va, u8 hbp_len);
49extern int arch_validate_hwbkpt_settings(struct perf_event *bp,
50 struct task_struct *tsk);
51extern int hw_breakpoint_exceptions_notify(struct notifier_block *unused,
52 unsigned long val, void *data);
53
54
55int arch_install_hw_breakpoint(struct perf_event *bp);
56void arch_uninstall_hw_breakpoint(struct perf_event *bp);
57void hw_breakpoint_pmu_read(struct perf_event *bp);
58void hw_breakpoint_pmu_unthrottle(struct perf_event *bp);
59
60extern void
61arch_fill_perf_breakpoint(struct perf_event *bp);
62
63unsigned long encode_dr7(int drnum, unsigned int len, unsigned int type);
64int decode_dr7(unsigned long dr7, int bpnum, unsigned *len, unsigned *type);
65
66extern int arch_bp_generic_fields(int x86_len, int x86_type,
67 int *gen_len, int *gen_type);
68
69extern struct pmu perf_ops_bp;
70
71#endif /* __KERNEL__ */
72#endif /* _I386_HW_BREAKPOINT_H */
73
diff --git a/arch/x86/include/asm/hw_irq.h b/arch/x86/include/asm/hw_irq.h
index ba180d93b08c..6e124269fd4b 100644
--- a/arch/x86/include/asm/hw_irq.h
+++ b/arch/x86/include/asm/hw_irq.h
@@ -79,14 +79,32 @@ static inline void set_io_apic_irq_attr(struct io_apic_irq_attr *irq_attr,
79 int ioapic, int ioapic_pin, 79 int ioapic, int ioapic_pin,
80 int trigger, int polarity) 80 int trigger, int polarity)
81{ 81{
82 irq_attr->ioapic = ioapic; 82 irq_attr->ioapic = ioapic;
83 irq_attr->ioapic_pin = ioapic_pin; 83 irq_attr->ioapic_pin = ioapic_pin;
84 irq_attr->trigger = trigger; 84 irq_attr->trigger = trigger;
85 irq_attr->polarity = polarity; 85 irq_attr->polarity = polarity;
86} 86}
87 87
88extern int IO_APIC_get_PCI_irq_vector(int bus, int devfn, int pin, 88/*
89 struct io_apic_irq_attr *irq_attr); 89 * This is performance-critical, we want to do it O(1)
90 *
91 * Most irqs are mapped 1:1 with pins.
92 */
93struct irq_cfg {
94 struct irq_pin_list *irq_2_pin;
95 cpumask_var_t domain;
96 cpumask_var_t old_domain;
97 u8 vector;
98 u8 move_in_progress : 1;
99};
100
101extern struct irq_cfg *irq_cfg(unsigned int);
102extern int assign_irq_vector(int, struct irq_cfg *, const struct cpumask *);
103extern void send_cleanup_vector(struct irq_cfg *);
104
105struct irq_desc;
106extern unsigned int set_desc_affinity(struct irq_desc *, const struct cpumask *);
107extern int IO_APIC_get_PCI_irq_vector(int bus, int devfn, int pin, struct io_apic_irq_attr *irq_attr);
90extern void setup_ioapic_dest(void); 108extern void setup_ioapic_dest(void);
91 109
92extern void enable_IO_APIC(void); 110extern void enable_IO_APIC(void);
diff --git a/arch/x86/include/asm/inat.h b/arch/x86/include/asm/inat.h
new file mode 100644
index 000000000000..205b063e3e32
--- /dev/null
+++ b/arch/x86/include/asm/inat.h
@@ -0,0 +1,220 @@
1#ifndef _ASM_X86_INAT_H
2#define _ASM_X86_INAT_H
3/*
4 * x86 instruction attributes
5 *
6 * Written by Masami Hiramatsu <mhiramat@redhat.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 as published by
10 * the Free Software Foundation; either version 2 of the License, or
11 * (at your option) any later version.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
21 *
22 */
23#include <asm/inat_types.h>
24
25/*
26 * Internal bits. Don't use bitmasks directly, because these bits are
27 * unstable. You should use checking functions.
28 */
29
30#define INAT_OPCODE_TABLE_SIZE 256
31#define INAT_GROUP_TABLE_SIZE 8
32
33/* Legacy last prefixes */
34#define INAT_PFX_OPNDSZ 1 /* 0x66 */ /* LPFX1 */
35#define INAT_PFX_REPE 2 /* 0xF3 */ /* LPFX2 */
36#define INAT_PFX_REPNE 3 /* 0xF2 */ /* LPFX3 */
37/* Other Legacy prefixes */
38#define INAT_PFX_LOCK 4 /* 0xF0 */
39#define INAT_PFX_CS 5 /* 0x2E */
40#define INAT_PFX_DS 6 /* 0x3E */
41#define INAT_PFX_ES 7 /* 0x26 */
42#define INAT_PFX_FS 8 /* 0x64 */
43#define INAT_PFX_GS 9 /* 0x65 */
44#define INAT_PFX_SS 10 /* 0x36 */
45#define INAT_PFX_ADDRSZ 11 /* 0x67 */
46/* x86-64 REX prefix */
47#define INAT_PFX_REX 12 /* 0x4X */
48/* AVX VEX prefixes */
49#define INAT_PFX_VEX2 13 /* 2-bytes VEX prefix */
50#define INAT_PFX_VEX3 14 /* 3-bytes VEX prefix */
51
52#define INAT_LSTPFX_MAX 3
53#define INAT_LGCPFX_MAX 11
54
55/* Immediate size */
56#define INAT_IMM_BYTE 1
57#define INAT_IMM_WORD 2
58#define INAT_IMM_DWORD 3
59#define INAT_IMM_QWORD 4
60#define INAT_IMM_PTR 5
61#define INAT_IMM_VWORD32 6
62#define INAT_IMM_VWORD 7
63
64/* Legacy prefix */
65#define INAT_PFX_OFFS 0
66#define INAT_PFX_BITS 4
67#define INAT_PFX_MAX ((1 << INAT_PFX_BITS) - 1)
68#define INAT_PFX_MASK (INAT_PFX_MAX << INAT_PFX_OFFS)
69/* Escape opcodes */
70#define INAT_ESC_OFFS (INAT_PFX_OFFS + INAT_PFX_BITS)
71#define INAT_ESC_BITS 2
72#define INAT_ESC_MAX ((1 << INAT_ESC_BITS) - 1)
73#define INAT_ESC_MASK (INAT_ESC_MAX << INAT_ESC_OFFS)
74/* Group opcodes (1-16) */
75#define INAT_GRP_OFFS (INAT_ESC_OFFS + INAT_ESC_BITS)
76#define INAT_GRP_BITS 5
77#define INAT_GRP_MAX ((1 << INAT_GRP_BITS) - 1)
78#define INAT_GRP_MASK (INAT_GRP_MAX << INAT_GRP_OFFS)
79/* Immediates */
80#define INAT_IMM_OFFS (INAT_GRP_OFFS + INAT_GRP_BITS)
81#define INAT_IMM_BITS 3
82#define INAT_IMM_MASK (((1 << INAT_IMM_BITS) - 1) << INAT_IMM_OFFS)
83/* Flags */
84#define INAT_FLAG_OFFS (INAT_IMM_OFFS + INAT_IMM_BITS)
85#define INAT_MODRM (1 << (INAT_FLAG_OFFS))
86#define INAT_FORCE64 (1 << (INAT_FLAG_OFFS + 1))
87#define INAT_SCNDIMM (1 << (INAT_FLAG_OFFS + 2))
88#define INAT_MOFFSET (1 << (INAT_FLAG_OFFS + 3))
89#define INAT_VARIANT (1 << (INAT_FLAG_OFFS + 4))
90#define INAT_VEXOK (1 << (INAT_FLAG_OFFS + 5))
91#define INAT_VEXONLY (1 << (INAT_FLAG_OFFS + 6))
92/* Attribute making macros for attribute tables */
93#define INAT_MAKE_PREFIX(pfx) (pfx << INAT_PFX_OFFS)
94#define INAT_MAKE_ESCAPE(esc) (esc << INAT_ESC_OFFS)
95#define INAT_MAKE_GROUP(grp) ((grp << INAT_GRP_OFFS) | INAT_MODRM)
96#define INAT_MAKE_IMM(imm) (imm << INAT_IMM_OFFS)
97
98/* Attribute search APIs */
99extern insn_attr_t inat_get_opcode_attribute(insn_byte_t opcode);
100extern insn_attr_t inat_get_escape_attribute(insn_byte_t opcode,
101 insn_byte_t last_pfx,
102 insn_attr_t esc_attr);
103extern insn_attr_t inat_get_group_attribute(insn_byte_t modrm,
104 insn_byte_t last_pfx,
105 insn_attr_t esc_attr);
106extern insn_attr_t inat_get_avx_attribute(insn_byte_t opcode,
107 insn_byte_t vex_m,
108 insn_byte_t vex_pp);
109
110/* Attribute checking functions */
111static inline int inat_is_legacy_prefix(insn_attr_t attr)
112{
113 attr &= INAT_PFX_MASK;
114 return attr && attr <= INAT_LGCPFX_MAX;
115}
116
117static inline int inat_is_address_size_prefix(insn_attr_t attr)
118{
119 return (attr & INAT_PFX_MASK) == INAT_PFX_ADDRSZ;
120}
121
122static inline int inat_is_operand_size_prefix(insn_attr_t attr)
123{
124 return (attr & INAT_PFX_MASK) == INAT_PFX_OPNDSZ;
125}
126
127static inline int inat_is_rex_prefix(insn_attr_t attr)
128{
129 return (attr & INAT_PFX_MASK) == INAT_PFX_REX;
130}
131
132static inline int inat_last_prefix_id(insn_attr_t attr)
133{
134 if ((attr & INAT_PFX_MASK) > INAT_LSTPFX_MAX)
135 return 0;
136 else
137 return attr & INAT_PFX_MASK;
138}
139
140static inline int inat_is_vex_prefix(insn_attr_t attr)
141{
142 attr &= INAT_PFX_MASK;
143 return attr == INAT_PFX_VEX2 || attr == INAT_PFX_VEX3;
144}
145
146static inline int inat_is_vex3_prefix(insn_attr_t attr)
147{
148 return (attr & INAT_PFX_MASK) == INAT_PFX_VEX3;
149}
150
151static inline int inat_is_escape(insn_attr_t attr)
152{
153 return attr & INAT_ESC_MASK;
154}
155
156static inline int inat_escape_id(insn_attr_t attr)
157{
158 return (attr & INAT_ESC_MASK) >> INAT_ESC_OFFS;
159}
160
161static inline int inat_is_group(insn_attr_t attr)
162{
163 return attr & INAT_GRP_MASK;
164}
165
166static inline int inat_group_id(insn_attr_t attr)
167{
168 return (attr & INAT_GRP_MASK) >> INAT_GRP_OFFS;
169}
170
171static inline int inat_group_common_attribute(insn_attr_t attr)
172{
173 return attr & ~INAT_GRP_MASK;
174}
175
176static inline int inat_has_immediate(insn_attr_t attr)
177{
178 return attr & INAT_IMM_MASK;
179}
180
181static inline int inat_immediate_size(insn_attr_t attr)
182{
183 return (attr & INAT_IMM_MASK) >> INAT_IMM_OFFS;
184}
185
186static inline int inat_has_modrm(insn_attr_t attr)
187{
188 return attr & INAT_MODRM;
189}
190
191static inline int inat_is_force64(insn_attr_t attr)
192{
193 return attr & INAT_FORCE64;
194}
195
196static inline int inat_has_second_immediate(insn_attr_t attr)
197{
198 return attr & INAT_SCNDIMM;
199}
200
201static inline int inat_has_moffset(insn_attr_t attr)
202{
203 return attr & INAT_MOFFSET;
204}
205
206static inline int inat_has_variant(insn_attr_t attr)
207{
208 return attr & INAT_VARIANT;
209}
210
211static inline int inat_accept_vex(insn_attr_t attr)
212{
213 return attr & INAT_VEXOK;
214}
215
216static inline int inat_must_vex(insn_attr_t attr)
217{
218 return attr & INAT_VEXONLY;
219}
220#endif
diff --git a/arch/x86/include/asm/inat_types.h b/arch/x86/include/asm/inat_types.h
new file mode 100644
index 000000000000..cb3c20ce39cf
--- /dev/null
+++ b/arch/x86/include/asm/inat_types.h
@@ -0,0 +1,29 @@
1#ifndef _ASM_X86_INAT_TYPES_H
2#define _ASM_X86_INAT_TYPES_H
3/*
4 * x86 instruction attributes
5 *
6 * Written by Masami Hiramatsu <mhiramat@redhat.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 as published by
10 * the Free Software Foundation; either version 2 of the License, or
11 * (at your option) any later version.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
21 *
22 */
23
24/* Instruction attributes */
25typedef unsigned int insn_attr_t;
26typedef unsigned char insn_byte_t;
27typedef signed int insn_value_t;
28
29#endif
diff --git a/arch/x86/include/asm/insn.h b/arch/x86/include/asm/insn.h
new file mode 100644
index 000000000000..96c2e0ad04ca
--- /dev/null
+++ b/arch/x86/include/asm/insn.h
@@ -0,0 +1,184 @@
1#ifndef _ASM_X86_INSN_H
2#define _ASM_X86_INSN_H
3/*
4 * x86 instruction analysis
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 * Copyright (C) IBM Corporation, 2009
21 */
22
23/* insn_attr_t is defined in inat.h */
24#include <asm/inat.h>
25
26struct insn_field {
27 union {
28 insn_value_t value;
29 insn_byte_t bytes[4];
30 };
31 /* !0 if we've run insn_get_xxx() for this field */
32 unsigned char got;
33 unsigned char nbytes;
34};
35
36struct insn {
37 struct insn_field prefixes; /*
38 * Prefixes
39 * prefixes.bytes[3]: last prefix
40 */
41 struct insn_field rex_prefix; /* REX prefix */
42 struct insn_field vex_prefix; /* VEX prefix */
43 struct insn_field opcode; /*
44 * opcode.bytes[0]: opcode1
45 * opcode.bytes[1]: opcode2
46 * opcode.bytes[2]: opcode3
47 */
48 struct insn_field modrm;
49 struct insn_field sib;
50 struct insn_field displacement;
51 union {
52 struct insn_field immediate;
53 struct insn_field moffset1; /* for 64bit MOV */
54 struct insn_field immediate1; /* for 64bit imm or off16/32 */
55 };
56 union {
57 struct insn_field moffset2; /* for 64bit MOV */
58 struct insn_field immediate2; /* for 64bit imm or seg16 */
59 };
60
61 insn_attr_t attr;
62 unsigned char opnd_bytes;
63 unsigned char addr_bytes;
64 unsigned char length;
65 unsigned char x86_64;
66
67 const insn_byte_t *kaddr; /* kernel address of insn to analyze */
68 const insn_byte_t *next_byte;
69};
70
71#define X86_MODRM_MOD(modrm) (((modrm) & 0xc0) >> 6)
72#define X86_MODRM_REG(modrm) (((modrm) & 0x38) >> 3)
73#define X86_MODRM_RM(modrm) ((modrm) & 0x07)
74
75#define X86_SIB_SCALE(sib) (((sib) & 0xc0) >> 6)
76#define X86_SIB_INDEX(sib) (((sib) & 0x38) >> 3)
77#define X86_SIB_BASE(sib) ((sib) & 0x07)
78
79#define X86_REX_W(rex) ((rex) & 8)
80#define X86_REX_R(rex) ((rex) & 4)
81#define X86_REX_X(rex) ((rex) & 2)
82#define X86_REX_B(rex) ((rex) & 1)
83
84/* VEX bit flags */
85#define X86_VEX_W(vex) ((vex) & 0x80) /* VEX3 Byte2 */
86#define X86_VEX_R(vex) ((vex) & 0x80) /* VEX2/3 Byte1 */
87#define X86_VEX_X(vex) ((vex) & 0x40) /* VEX3 Byte1 */
88#define X86_VEX_B(vex) ((vex) & 0x20) /* VEX3 Byte1 */
89#define X86_VEX_L(vex) ((vex) & 0x04) /* VEX3 Byte2, VEX2 Byte1 */
90/* VEX bit fields */
91#define X86_VEX3_M(vex) ((vex) & 0x1f) /* VEX3 Byte1 */
92#define X86_VEX2_M 1 /* VEX2.M always 1 */
93#define X86_VEX_V(vex) (((vex) & 0x78) >> 3) /* VEX3 Byte2, VEX2 Byte1 */
94#define X86_VEX_P(vex) ((vex) & 0x03) /* VEX3 Byte2, VEX2 Byte1 */
95#define X86_VEX_M_MAX 0x1f /* VEX3.M Maximum value */
96
97/* The last prefix is needed for two-byte and three-byte opcodes */
98static inline insn_byte_t insn_last_prefix(struct insn *insn)
99{
100 return insn->prefixes.bytes[3];
101}
102
103extern void insn_init(struct insn *insn, const void *kaddr, int x86_64);
104extern void insn_get_prefixes(struct insn *insn);
105extern void insn_get_opcode(struct insn *insn);
106extern void insn_get_modrm(struct insn *insn);
107extern void insn_get_sib(struct insn *insn);
108extern void insn_get_displacement(struct insn *insn);
109extern void insn_get_immediate(struct insn *insn);
110extern void insn_get_length(struct insn *insn);
111
112/* Attribute will be determined after getting ModRM (for opcode groups) */
113static inline void insn_get_attribute(struct insn *insn)
114{
115 insn_get_modrm(insn);
116}
117
118/* Instruction uses RIP-relative addressing */
119extern int insn_rip_relative(struct insn *insn);
120
121/* Init insn for kernel text */
122static inline void kernel_insn_init(struct insn *insn, const void *kaddr)
123{
124#ifdef CONFIG_X86_64
125 insn_init(insn, kaddr, 1);
126#else /* CONFIG_X86_32 */
127 insn_init(insn, kaddr, 0);
128#endif
129}
130
131static inline int insn_is_avx(struct insn *insn)
132{
133 if (!insn->prefixes.got)
134 insn_get_prefixes(insn);
135 return (insn->vex_prefix.value != 0);
136}
137
138static inline insn_byte_t insn_vex_m_bits(struct insn *insn)
139{
140 if (insn->vex_prefix.nbytes == 2) /* 2 bytes VEX */
141 return X86_VEX2_M;
142 else
143 return X86_VEX3_M(insn->vex_prefix.bytes[1]);
144}
145
146static inline insn_byte_t insn_vex_p_bits(struct insn *insn)
147{
148 if (insn->vex_prefix.nbytes == 2) /* 2 bytes VEX */
149 return X86_VEX_P(insn->vex_prefix.bytes[1]);
150 else
151 return X86_VEX_P(insn->vex_prefix.bytes[2]);
152}
153
154/* Offset of each field from kaddr */
155static inline int insn_offset_rex_prefix(struct insn *insn)
156{
157 return insn->prefixes.nbytes;
158}
159static inline int insn_offset_vex_prefix(struct insn *insn)
160{
161 return insn_offset_rex_prefix(insn) + insn->rex_prefix.nbytes;
162}
163static inline int insn_offset_opcode(struct insn *insn)
164{
165 return insn_offset_vex_prefix(insn) + insn->vex_prefix.nbytes;
166}
167static inline int insn_offset_modrm(struct insn *insn)
168{
169 return insn_offset_opcode(insn) + insn->opcode.nbytes;
170}
171static inline int insn_offset_sib(struct insn *insn)
172{
173 return insn_offset_modrm(insn) + insn->modrm.nbytes;
174}
175static inline int insn_offset_displacement(struct insn *insn)
176{
177 return insn_offset_sib(insn) + insn->sib.nbytes;
178}
179static inline int insn_offset_immediate(struct insn *insn)
180{
181 return insn_offset_displacement(insn) + insn->displacement.nbytes;
182}
183
184#endif /* _ASM_X86_INSN_H */
diff --git a/arch/x86/include/asm/iommu.h b/arch/x86/include/asm/iommu.h
index fd6d21bbee6c..345c99cef152 100644
--- a/arch/x86/include/asm/iommu.h
+++ b/arch/x86/include/asm/iommu.h
@@ -1,8 +1,6 @@
1#ifndef _ASM_X86_IOMMU_H 1#ifndef _ASM_X86_IOMMU_H
2#define _ASM_X86_IOMMU_H 2#define _ASM_X86_IOMMU_H
3 3
4extern void pci_iommu_shutdown(void);
5extern void no_iommu_init(void);
6extern struct dma_map_ops nommu_dma_ops; 4extern struct dma_map_ops nommu_dma_ops;
7extern int force_iommu, no_iommu; 5extern int force_iommu, no_iommu;
8extern int iommu_detected; 6extern int iommu_detected;
diff --git a/arch/x86/include/asm/irq.h b/arch/x86/include/asm/irq.h
index ddda6cbed6f4..ffd700ff5dcb 100644
--- a/arch/x86/include/asm/irq.h
+++ b/arch/x86/include/asm/irq.h
@@ -34,6 +34,7 @@ static inline int irq_canonicalize(int irq)
34#ifdef CONFIG_HOTPLUG_CPU 34#ifdef CONFIG_HOTPLUG_CPU
35#include <linux/cpumask.h> 35#include <linux/cpumask.h>
36extern void fixup_irqs(void); 36extern void fixup_irqs(void);
37extern void irq_force_complete_move(int);
37#endif 38#endif
38 39
39extern void (*generic_interrupt_extension)(void); 40extern void (*generic_interrupt_extension)(void);
diff --git a/arch/x86/include/asm/mce.h b/arch/x86/include/asm/mce.h
index f1363b72364f..858baa061cfc 100644
--- a/arch/x86/include/asm/mce.h
+++ b/arch/x86/include/asm/mce.h
@@ -108,6 +108,8 @@ struct mce_log {
108#define K8_MCE_THRESHOLD_BANK_5 (MCE_THRESHOLD_BASE + 5 * 9) 108#define K8_MCE_THRESHOLD_BANK_5 (MCE_THRESHOLD_BASE + 5 * 9)
109#define K8_MCE_THRESHOLD_DRAM_ECC (MCE_THRESHOLD_BANK_4 + 0) 109#define K8_MCE_THRESHOLD_DRAM_ECC (MCE_THRESHOLD_BANK_4 + 0)
110 110
111extern struct atomic_notifier_head x86_mce_decoder_chain;
112
111#ifdef __KERNEL__ 113#ifdef __KERNEL__
112 114
113#include <linux/percpu.h> 115#include <linux/percpu.h>
@@ -118,9 +120,11 @@ extern int mce_disabled;
118extern int mce_p5_enabled; 120extern int mce_p5_enabled;
119 121
120#ifdef CONFIG_X86_MCE 122#ifdef CONFIG_X86_MCE
121void mcheck_init(struct cpuinfo_x86 *c); 123int mcheck_init(void);
124void mcheck_cpu_init(struct cpuinfo_x86 *c);
122#else 125#else
123static inline void mcheck_init(struct cpuinfo_x86 *c) {} 126static inline int mcheck_init(void) { return 0; }
127static inline void mcheck_cpu_init(struct cpuinfo_x86 *c) {}
124#endif 128#endif
125 129
126#ifdef CONFIG_X86_ANCIENT_MCE 130#ifdef CONFIG_X86_ANCIENT_MCE
@@ -214,5 +218,11 @@ void intel_init_thermal(struct cpuinfo_x86 *c);
214 218
215void mce_log_therm_throt_event(__u64 status); 219void mce_log_therm_throt_event(__u64 status);
216 220
221#ifdef CONFIG_X86_THERMAL_VECTOR
222extern void mcheck_intel_therm_init(void);
223#else
224static inline void mcheck_intel_therm_init(void) { }
225#endif
226
217#endif /* __KERNEL__ */ 227#endif /* __KERNEL__ */
218#endif /* _ASM_X86_MCE_H */ 228#endif /* _ASM_X86_MCE_H */
diff --git a/arch/x86/include/asm/mpspec.h b/arch/x86/include/asm/mpspec.h
index 79c94500c0bb..61d90b1331c3 100644
--- a/arch/x86/include/asm/mpspec.h
+++ b/arch/x86/include/asm/mpspec.h
@@ -163,14 +163,16 @@ typedef struct physid_mask physid_mask_t;
163#define physids_shift_left(d, s, n) \ 163#define physids_shift_left(d, s, n) \
164 bitmap_shift_left((d).mask, (s).mask, n, MAX_APICS) 164 bitmap_shift_left((d).mask, (s).mask, n, MAX_APICS)
165 165
166#define physids_coerce(map) ((map).mask[0]) 166static inline unsigned long physids_coerce(physid_mask_t *map)
167{
168 return map->mask[0];
169}
167 170
168#define physids_promote(physids) \ 171static inline void physids_promote(unsigned long physids, physid_mask_t *map)
169 ({ \ 172{
170 physid_mask_t __physid_mask = PHYSID_MASK_NONE; \ 173 physids_clear(*map);
171 __physid_mask.mask[0] = physids; \ 174 map->mask[0] = physids;
172 __physid_mask; \ 175}
173 })
174 176
175/* Note: will create very large stack frames if physid_mask_t is big */ 177/* Note: will create very large stack frames if physid_mask_t is big */
176#define physid_mask_of_physid(physid) \ 178#define physid_mask_of_physid(physid) \
diff --git a/arch/x86/include/asm/msr.h b/arch/x86/include/asm/msr.h
index 7e2b6ba962ff..5bef931f8b14 100644
--- a/arch/x86/include/asm/msr.h
+++ b/arch/x86/include/asm/msr.h
@@ -247,8 +247,8 @@ do { \
247#ifdef CONFIG_SMP 247#ifdef CONFIG_SMP
248int rdmsr_on_cpu(unsigned int cpu, u32 msr_no, u32 *l, u32 *h); 248int rdmsr_on_cpu(unsigned int cpu, u32 msr_no, u32 *l, u32 *h);
249int wrmsr_on_cpu(unsigned int cpu, u32 msr_no, u32 l, u32 h); 249int wrmsr_on_cpu(unsigned int cpu, u32 msr_no, u32 l, u32 h);
250void rdmsr_on_cpus(const cpumask_t *mask, u32 msr_no, struct msr *msrs); 250void rdmsr_on_cpus(const struct cpumask *mask, u32 msr_no, struct msr *msrs);
251void wrmsr_on_cpus(const cpumask_t *mask, u32 msr_no, struct msr *msrs); 251void wrmsr_on_cpus(const struct cpumask *mask, u32 msr_no, struct msr *msrs);
252int rdmsr_safe_on_cpu(unsigned int cpu, u32 msr_no, u32 *l, u32 *h); 252int rdmsr_safe_on_cpu(unsigned int cpu, u32 msr_no, u32 *l, u32 *h);
253int wrmsr_safe_on_cpu(unsigned int cpu, u32 msr_no, u32 l, u32 h); 253int wrmsr_safe_on_cpu(unsigned int cpu, u32 msr_no, u32 l, u32 h);
254int rdmsr_safe_regs_on_cpu(unsigned int cpu, u32 regs[8]); 254int rdmsr_safe_regs_on_cpu(unsigned int cpu, u32 regs[8]);
@@ -264,12 +264,12 @@ static inline int wrmsr_on_cpu(unsigned int cpu, u32 msr_no, u32 l, u32 h)
264 wrmsr(msr_no, l, h); 264 wrmsr(msr_no, l, h);
265 return 0; 265 return 0;
266} 266}
267static inline void rdmsr_on_cpus(const cpumask_t *m, u32 msr_no, 267static inline void rdmsr_on_cpus(const struct cpumask *m, u32 msr_no,
268 struct msr *msrs) 268 struct msr *msrs)
269{ 269{
270 rdmsr_on_cpu(0, msr_no, &(msrs[0].l), &(msrs[0].h)); 270 rdmsr_on_cpu(0, msr_no, &(msrs[0].l), &(msrs[0].h));
271} 271}
272static inline void wrmsr_on_cpus(const cpumask_t *m, u32 msr_no, 272static inline void wrmsr_on_cpus(const struct cpumask *m, u32 msr_no,
273 struct msr *msrs) 273 struct msr *msrs)
274{ 274{
275 wrmsr_on_cpu(0, msr_no, msrs[0].l, msrs[0].h); 275 wrmsr_on_cpu(0, msr_no, msrs[0].l, msrs[0].h);
diff --git a/arch/x86/include/asm/perf_event.h b/arch/x86/include/asm/perf_event.h
index ad7ce3fd5065..8d9f8548a870 100644
--- a/arch/x86/include/asm/perf_event.h
+++ b/arch/x86/include/asm/perf_event.h
@@ -28,9 +28,20 @@
28 */ 28 */
29#define ARCH_PERFMON_EVENT_MASK 0xffff 29#define ARCH_PERFMON_EVENT_MASK 0xffff
30 30
31/*
32 * filter mask to validate fixed counter events.
33 * the following filters disqualify for fixed counters:
34 * - inv
35 * - edge
36 * - cnt-mask
37 * The other filters are supported by fixed counters.
38 * The any-thread option is supported starting with v3.
39 */
40#define ARCH_PERFMON_EVENT_FILTER_MASK 0xff840000
41
31#define ARCH_PERFMON_UNHALTED_CORE_CYCLES_SEL 0x3c 42#define ARCH_PERFMON_UNHALTED_CORE_CYCLES_SEL 0x3c
32#define ARCH_PERFMON_UNHALTED_CORE_CYCLES_UMASK (0x00 << 8) 43#define ARCH_PERFMON_UNHALTED_CORE_CYCLES_UMASK (0x00 << 8)
33#define ARCH_PERFMON_UNHALTED_CORE_CYCLES_INDEX 0 44#define ARCH_PERFMON_UNHALTED_CORE_CYCLES_INDEX 0
34#define ARCH_PERFMON_UNHALTED_CORE_CYCLES_PRESENT \ 45#define ARCH_PERFMON_UNHALTED_CORE_CYCLES_PRESENT \
35 (1 << (ARCH_PERFMON_UNHALTED_CORE_CYCLES_INDEX)) 46 (1 << (ARCH_PERFMON_UNHALTED_CORE_CYCLES_INDEX))
36 47
diff --git a/arch/x86/include/asm/processor.h b/arch/x86/include/asm/processor.h
index c3429e8b2424..6f8ec1c37e0a 100644
--- a/arch/x86/include/asm/processor.h
+++ b/arch/x86/include/asm/processor.h
@@ -30,6 +30,7 @@ struct mm_struct;
30#include <linux/math64.h> 30#include <linux/math64.h>
31#include <linux/init.h> 31#include <linux/init.h>
32 32
33#define HBP_NUM 4
33/* 34/*
34 * Default implementation of macro that returns current 35 * Default implementation of macro that returns current
35 * instruction pointer ("program counter"). 36 * instruction pointer ("program counter").
@@ -422,6 +423,8 @@ extern unsigned int xstate_size;
422extern void free_thread_xstate(struct task_struct *); 423extern void free_thread_xstate(struct task_struct *);
423extern struct kmem_cache *task_xstate_cachep; 424extern struct kmem_cache *task_xstate_cachep;
424 425
426struct perf_event;
427
425struct thread_struct { 428struct thread_struct {
426 /* Cached TLS descriptors: */ 429 /* Cached TLS descriptors: */
427 struct desc_struct tls_array[GDT_ENTRY_TLS_ENTRIES]; 430 struct desc_struct tls_array[GDT_ENTRY_TLS_ENTRIES];
@@ -443,13 +446,10 @@ struct thread_struct {
443 unsigned long fs; 446 unsigned long fs;
444#endif 447#endif
445 unsigned long gs; 448 unsigned long gs;
446 /* Hardware debugging registers: */ 449 /* Save middle states of ptrace breakpoints */
447 unsigned long debugreg0; 450 struct perf_event *ptrace_bps[HBP_NUM];
448 unsigned long debugreg1; 451 /* Debug status used for traps, single steps, etc... */
449 unsigned long debugreg2; 452 unsigned long debugreg6;
450 unsigned long debugreg3;
451 unsigned long debugreg6;
452 unsigned long debugreg7;
453 /* Fault info: */ 453 /* Fault info: */
454 unsigned long cr2; 454 unsigned long cr2;
455 unsigned long trap_no; 455 unsigned long trap_no;
@@ -1000,7 +1000,7 @@ extern unsigned long thread_saved_pc(struct task_struct *tsk);
1000#define thread_saved_pc(t) (*(unsigned long *)((t)->thread.sp - 8)) 1000#define thread_saved_pc(t) (*(unsigned long *)((t)->thread.sp - 8))
1001 1001
1002#define task_pt_regs(tsk) ((struct pt_regs *)(tsk)->thread.sp0 - 1) 1002#define task_pt_regs(tsk) ((struct pt_regs *)(tsk)->thread.sp0 - 1)
1003#define KSTK_ESP(tsk) -1 /* sorry. doesn't work for syscall. */ 1003extern unsigned long KSTK_ESP(struct task_struct *task);
1004#endif /* CONFIG_X86_64 */ 1004#endif /* CONFIG_X86_64 */
1005 1005
1006extern void start_thread(struct pt_regs *regs, unsigned long new_ip, 1006extern void start_thread(struct pt_regs *regs, unsigned long new_ip,
diff --git a/arch/x86/include/asm/ptrace.h b/arch/x86/include/asm/ptrace.h
index 0f0d908349aa..3d11fd0f44c5 100644
--- a/arch/x86/include/asm/ptrace.h
+++ b/arch/x86/include/asm/ptrace.h
@@ -7,6 +7,7 @@
7 7
8#ifdef __KERNEL__ 8#ifdef __KERNEL__
9#include <asm/segment.h> 9#include <asm/segment.h>
10#include <asm/page_types.h>
10#endif 11#endif
11 12
12#ifndef __ASSEMBLY__ 13#ifndef __ASSEMBLY__
@@ -216,6 +217,67 @@ static inline unsigned long user_stack_pointer(struct pt_regs *regs)
216 return regs->sp; 217 return regs->sp;
217} 218}
218 219
220/* Query offset/name of register from its name/offset */
221extern int regs_query_register_offset(const char *name);
222extern const char *regs_query_register_name(unsigned int offset);
223#define MAX_REG_OFFSET (offsetof(struct pt_regs, ss))
224
225/**
226 * regs_get_register() - get register value from its offset
227 * @regs: pt_regs from which register value is gotten.
228 * @offset: offset number of the register.
229 *
230 * regs_get_register returns the value of a register. The @offset is the
231 * offset of the register in struct pt_regs address which specified by @regs.
232 * If @offset is bigger than MAX_REG_OFFSET, this returns 0.
233 */
234static inline unsigned long regs_get_register(struct pt_regs *regs,
235 unsigned int offset)
236{
237 if (unlikely(offset > MAX_REG_OFFSET))
238 return 0;
239 return *(unsigned long *)((unsigned long)regs + offset);
240}
241
242/**
243 * regs_within_kernel_stack() - check the address in the stack
244 * @regs: pt_regs which contains kernel stack pointer.
245 * @addr: address which is checked.
246 *
247 * regs_within_kernel_stack() checks @addr is within the kernel stack page(s).
248 * If @addr is within the kernel stack, it returns true. If not, returns false.
249 */
250static inline int regs_within_kernel_stack(struct pt_regs *regs,
251 unsigned long addr)
252{
253 return ((addr & ~(THREAD_SIZE - 1)) ==
254 (kernel_stack_pointer(regs) & ~(THREAD_SIZE - 1)));
255}
256
257/**
258 * regs_get_kernel_stack_nth() - get Nth entry of the stack
259 * @regs: pt_regs which contains kernel stack pointer.
260 * @n: stack entry number.
261 *
262 * regs_get_kernel_stack_nth() returns @n th entry of the kernel stack which
263 * is specified by @regs. If the @n th entry is NOT in the kernel stack,
264 * this returns 0.
265 */
266static inline unsigned long regs_get_kernel_stack_nth(struct pt_regs *regs,
267 unsigned int n)
268{
269 unsigned long *addr = (unsigned long *)kernel_stack_pointer(regs);
270 addr += n;
271 if (regs_within_kernel_stack(regs, (unsigned long)addr))
272 return *addr;
273 else
274 return 0;
275}
276
277/* Get Nth argument at function call */
278extern unsigned long regs_get_argument_nth(struct pt_regs *regs,
279 unsigned int n);
280
219/* 281/*
220 * These are defined as per linux/ptrace.h, which see. 282 * These are defined as per linux/ptrace.h, which see.
221 */ 283 */
diff --git a/arch/x86/include/asm/string_32.h b/arch/x86/include/asm/string_32.h
index ae907e617181..3d3e8353ee5c 100644
--- a/arch/x86/include/asm/string_32.h
+++ b/arch/x86/include/asm/string_32.h
@@ -177,10 +177,15 @@ static inline void *__memcpy3d(void *to, const void *from, size_t len)
177 */ 177 */
178 178
179#ifndef CONFIG_KMEMCHECK 179#ifndef CONFIG_KMEMCHECK
180
181#if (__GNUC__ >= 4)
182#define memcpy(t, f, n) __builtin_memcpy(t, f, n)
183#else
180#define memcpy(t, f, n) \ 184#define memcpy(t, f, n) \
181 (__builtin_constant_p((n)) \ 185 (__builtin_constant_p((n)) \
182 ? __constant_memcpy((t), (f), (n)) \ 186 ? __constant_memcpy((t), (f), (n)) \
183 : __memcpy((t), (f), (n))) 187 : __memcpy((t), (f), (n)))
188#endif
184#else 189#else
185/* 190/*
186 * kmemcheck becomes very happy if we use the REP instructions unconditionally, 191 * kmemcheck becomes very happy if we use the REP instructions unconditionally,
@@ -316,11 +321,15 @@ void *__constant_c_and_count_memset(void *s, unsigned long pattern,
316 : __memset_generic((s), (c), (count))) 321 : __memset_generic((s), (c), (count)))
317 322
318#define __HAVE_ARCH_MEMSET 323#define __HAVE_ARCH_MEMSET
324#if (__GNUC__ >= 4)
325#define memset(s, c, count) __builtin_memset(s, c, count)
326#else
319#define memset(s, c, count) \ 327#define memset(s, c, count) \
320 (__builtin_constant_p(c) \ 328 (__builtin_constant_p(c) \
321 ? __constant_c_x_memset((s), (0x01010101UL * (unsigned char)(c)), \ 329 ? __constant_c_x_memset((s), (0x01010101UL * (unsigned char)(c)), \
322 (count)) \ 330 (count)) \
323 : __memset((s), (c), (count))) 331 : __memset((s), (c), (count)))
332#endif
324 333
325/* 334/*
326 * find the first occurrence of byte 'c', or 1 past the area if none 335 * find the first occurrence of byte 'c', or 1 past the area if none
diff --git a/arch/x86/include/asm/swiotlb.h b/arch/x86/include/asm/swiotlb.h
index b9e4e20174fb..87ffcb12a1b8 100644
--- a/arch/x86/include/asm/swiotlb.h
+++ b/arch/x86/include/asm/swiotlb.h
@@ -3,17 +3,14 @@
3 3
4#include <linux/swiotlb.h> 4#include <linux/swiotlb.h>
5 5
6/* SWIOTLB interface */
7
8extern int swiotlb_force;
9
10#ifdef CONFIG_SWIOTLB 6#ifdef CONFIG_SWIOTLB
11extern int swiotlb; 7extern int swiotlb;
12extern void pci_swiotlb_init(void); 8extern int pci_swiotlb_init(void);
13#else 9#else
14#define swiotlb 0 10#define swiotlb 0
15static inline void pci_swiotlb_init(void) 11static inline int pci_swiotlb_init(void)
16{ 12{
13 return 0;
17} 14}
18#endif 15#endif
19 16
diff --git a/arch/x86/include/asm/system.h b/arch/x86/include/asm/system.h
index f08f97374892..022a84386de8 100644
--- a/arch/x86/include/asm/system.h
+++ b/arch/x86/include/asm/system.h
@@ -128,8 +128,6 @@ do { \
128 "movq %%rsp,%P[threadrsp](%[prev])\n\t" /* save RSP */ \ 128 "movq %%rsp,%P[threadrsp](%[prev])\n\t" /* save RSP */ \
129 "movq %P[threadrsp](%[next]),%%rsp\n\t" /* restore RSP */ \ 129 "movq %P[threadrsp](%[next]),%%rsp\n\t" /* restore RSP */ \
130 "call __switch_to\n\t" \ 130 "call __switch_to\n\t" \
131 ".globl thread_return\n" \
132 "thread_return:\n\t" \
133 "movq "__percpu_arg([current_task])",%%rsi\n\t" \ 131 "movq "__percpu_arg([current_task])",%%rsi\n\t" \
134 __switch_canary \ 132 __switch_canary \
135 "movq %P[thread_info](%%rsi),%%r8\n\t" \ 133 "movq %P[thread_info](%%rsi),%%r8\n\t" \
@@ -157,19 +155,22 @@ extern void native_load_gs_index(unsigned);
157 * Load a segment. Fall back on loading the zero 155 * Load a segment. Fall back on loading the zero
158 * segment if something goes wrong.. 156 * segment if something goes wrong..
159 */ 157 */
160#define loadsegment(seg, value) \ 158#define loadsegment(seg, value) \
161 asm volatile("\n" \ 159do { \
162 "1:\t" \ 160 unsigned short __val = (value); \
163 "movl %k0,%%" #seg "\n" \ 161 \
164 "2:\n" \ 162 asm volatile(" \n" \
165 ".section .fixup,\"ax\"\n" \ 163 "1: movl %k0,%%" #seg " \n" \
166 "3:\t" \ 164 \
167 "movl %k1, %%" #seg "\n\t" \ 165 ".section .fixup,\"ax\" \n" \
168 "jmp 2b\n" \ 166 "2: xorl %k0,%k0 \n" \
169 ".previous\n" \ 167 " jmp 1b \n" \
170 _ASM_EXTABLE(1b,3b) \ 168 ".previous \n" \
171 : :"r" (value), "r" (0) : "memory") 169 \
172 170 _ASM_EXTABLE(1b, 2b) \
171 \
172 : "+r" (__val) : : "memory"); \
173} while (0)
173 174
174/* 175/*
175 * Save a segment register away 176 * Save a segment register away
diff --git a/arch/x86/include/asm/topology.h b/arch/x86/include/asm/topology.h
index d823c245f63b..40e37b10c6c0 100644
--- a/arch/x86/include/asm/topology.h
+++ b/arch/x86/include/asm/topology.h
@@ -143,7 +143,7 @@ extern unsigned long node_remap_size[];
143 | 1*SD_BALANCE_FORK \ 143 | 1*SD_BALANCE_FORK \
144 | 0*SD_BALANCE_WAKE \ 144 | 0*SD_BALANCE_WAKE \
145 | 1*SD_WAKE_AFFINE \ 145 | 1*SD_WAKE_AFFINE \
146 | 1*SD_PREFER_LOCAL \ 146 | 0*SD_PREFER_LOCAL \
147 | 0*SD_SHARE_CPUPOWER \ 147 | 0*SD_SHARE_CPUPOWER \
148 | 0*SD_POWERSAVINGS_BALANCE \ 148 | 0*SD_POWERSAVINGS_BALANCE \
149 | 0*SD_SHARE_PKG_RESOURCES \ 149 | 0*SD_SHARE_PKG_RESOURCES \
diff --git a/arch/x86/include/asm/uaccess.h b/arch/x86/include/asm/uaccess.h
index d2c6c930b491..abd3e0ea762a 100644
--- a/arch/x86/include/asm/uaccess.h
+++ b/arch/x86/include/asm/uaccess.h
@@ -570,7 +570,6 @@ extern struct movsl_mask {
570#ifdef CONFIG_X86_32 570#ifdef CONFIG_X86_32
571# include "uaccess_32.h" 571# include "uaccess_32.h"
572#else 572#else
573# define ARCH_HAS_SEARCH_EXTABLE
574# include "uaccess_64.h" 573# include "uaccess_64.h"
575#endif 574#endif
576 575
diff --git a/arch/x86/include/asm/uaccess_32.h b/arch/x86/include/asm/uaccess_32.h
index 632fb44b4cb5..0c9825e97f36 100644
--- a/arch/x86/include/asm/uaccess_32.h
+++ b/arch/x86/include/asm/uaccess_32.h
@@ -187,9 +187,34 @@ __copy_from_user_inatomic_nocache(void *to, const void __user *from,
187 187
188unsigned long __must_check copy_to_user(void __user *to, 188unsigned long __must_check copy_to_user(void __user *to,
189 const void *from, unsigned long n); 189 const void *from, unsigned long n);
190unsigned long __must_check copy_from_user(void *to, 190unsigned long __must_check _copy_from_user(void *to,
191 const void __user *from, 191 const void __user *from,
192 unsigned long n); 192 unsigned long n);
193
194
195extern void copy_from_user_overflow(void)
196#ifdef CONFIG_DEBUG_STRICT_USER_COPY_CHECKS
197 __compiletime_error("copy_from_user() buffer size is not provably correct")
198#else
199 __compiletime_warning("copy_from_user() buffer size is not provably correct")
200#endif
201;
202
203static inline unsigned long __must_check copy_from_user(void *to,
204 const void __user *from,
205 unsigned long n)
206{
207 int sz = __compiletime_object_size(to);
208 int ret = -EFAULT;
209
210 if (likely(sz == -1 || sz >= n))
211 ret = _copy_from_user(to, from, n);
212 else
213 copy_from_user_overflow();
214
215 return ret;
216}
217
193long __must_check strncpy_from_user(char *dst, const char __user *src, 218long __must_check strncpy_from_user(char *dst, const char __user *src,
194 long count); 219 long count);
195long __must_check __strncpy_from_user(char *dst, 220long __must_check __strncpy_from_user(char *dst,
diff --git a/arch/x86/include/asm/uaccess_64.h b/arch/x86/include/asm/uaccess_64.h
index db24b215fc50..46324c6a4f6e 100644
--- a/arch/x86/include/asm/uaccess_64.h
+++ b/arch/x86/include/asm/uaccess_64.h
@@ -19,12 +19,37 @@ __must_check unsigned long
19copy_user_generic(void *to, const void *from, unsigned len); 19copy_user_generic(void *to, const void *from, unsigned len);
20 20
21__must_check unsigned long 21__must_check unsigned long
22copy_to_user(void __user *to, const void *from, unsigned len); 22_copy_to_user(void __user *to, const void *from, unsigned len);
23__must_check unsigned long 23__must_check unsigned long
24copy_from_user(void *to, const void __user *from, unsigned len); 24_copy_from_user(void *to, const void __user *from, unsigned len);
25__must_check unsigned long 25__must_check unsigned long
26copy_in_user(void __user *to, const void __user *from, unsigned len); 26copy_in_user(void __user *to, const void __user *from, unsigned len);
27 27
28static inline unsigned long __must_check copy_from_user(void *to,
29 const void __user *from,
30 unsigned long n)
31{
32 int sz = __compiletime_object_size(to);
33 int ret = -EFAULT;
34
35 might_fault();
36 if (likely(sz == -1 || sz >= n))
37 ret = _copy_from_user(to, from, n);
38#ifdef CONFIG_DEBUG_VM
39 else
40 WARN(1, "Buffer overflow detected!\n");
41#endif
42 return ret;
43}
44
45static __always_inline __must_check
46int copy_to_user(void __user *dst, const void *src, unsigned size)
47{
48 might_fault();
49
50 return _copy_to_user(dst, src, size);
51}
52
28static __always_inline __must_check 53static __always_inline __must_check
29int __copy_from_user(void *dst, const void __user *src, unsigned size) 54int __copy_from_user(void *dst, const void __user *src, unsigned size)
30{ 55{
@@ -176,8 +201,11 @@ __must_check long strlen_user(const char __user *str);
176__must_check unsigned long clear_user(void __user *mem, unsigned long len); 201__must_check unsigned long clear_user(void __user *mem, unsigned long len);
177__must_check unsigned long __clear_user(void __user *mem, unsigned long len); 202__must_check unsigned long __clear_user(void __user *mem, unsigned long len);
178 203
179__must_check long __copy_from_user_inatomic(void *dst, const void __user *src, 204static __must_check __always_inline int
180 unsigned size); 205__copy_from_user_inatomic(void *dst, const void __user *src, unsigned size)
206{
207 return copy_user_generic(dst, (__force const void *)src, size);
208}
181 209
182static __must_check __always_inline int 210static __must_check __always_inline int
183__copy_to_user_inatomic(void __user *dst, const void *src, unsigned size) 211__copy_to_user_inatomic(void __user *dst, const void *src, unsigned size)
diff --git a/arch/x86/include/asm/uv/uv_irq.h b/arch/x86/include/asm/uv/uv_irq.h
index 9613c8c0b647..d6b17c760622 100644
--- a/arch/x86/include/asm/uv/uv_irq.h
+++ b/arch/x86/include/asm/uv/uv_irq.h
@@ -25,12 +25,14 @@ struct uv_IO_APIC_route_entry {
25 dest : 32; 25 dest : 32;
26}; 26};
27 27
28extern struct irq_chip uv_irq_chip; 28enum {
29 29 UV_AFFINITY_ALL,
30extern int arch_enable_uv_irq(char *, unsigned int, int, int, unsigned long); 30 UV_AFFINITY_NODE,
31extern void arch_disable_uv_irq(int, unsigned long); 31 UV_AFFINITY_CPU
32};
32 33
33extern int uv_setup_irq(char *, int, int, unsigned long); 34extern int uv_irq_2_mmr_info(int, unsigned long *, int *);
34extern void uv_teardown_irq(unsigned int, int, unsigned long); 35extern int uv_setup_irq(char *, int, int, unsigned long, int);
36extern void uv_teardown_irq(unsigned int);
35 37
36#endif /* _ASM_X86_UV_UV_IRQ_H */ 38#endif /* _ASM_X86_UV_UV_IRQ_H */
diff --git a/arch/x86/include/asm/x86_init.h b/arch/x86/include/asm/x86_init.h
index 2c756fd4ab0e..d8e71459f025 100644
--- a/arch/x86/include/asm/x86_init.h
+++ b/arch/x86/include/asm/x86_init.h
@@ -91,6 +91,14 @@ struct x86_init_timers {
91}; 91};
92 92
93/** 93/**
94 * struct x86_init_iommu - platform specific iommu setup
95 * @iommu_init: platform specific iommu setup
96 */
97struct x86_init_iommu {
98 int (*iommu_init)(void);
99};
100
101/**
94 * struct x86_init_ops - functions for platform specific setup 102 * struct x86_init_ops - functions for platform specific setup
95 * 103 *
96 */ 104 */
@@ -101,6 +109,7 @@ struct x86_init_ops {
101 struct x86_init_oem oem; 109 struct x86_init_oem oem;
102 struct x86_init_paging paging; 110 struct x86_init_paging paging;
103 struct x86_init_timers timers; 111 struct x86_init_timers timers;
112 struct x86_init_iommu iommu;
104}; 113};
105 114
106/** 115/**
@@ -121,6 +130,7 @@ struct x86_platform_ops {
121 unsigned long (*calibrate_tsc)(void); 130 unsigned long (*calibrate_tsc)(void);
122 unsigned long (*get_wallclock)(void); 131 unsigned long (*get_wallclock)(void);
123 int (*set_wallclock)(unsigned long nowtime); 132 int (*set_wallclock)(unsigned long nowtime);
133 void (*iommu_shutdown)(void);
124}; 134};
125 135
126extern struct x86_init_ops x86_init; 136extern struct x86_init_ops x86_init;
diff --git a/arch/x86/kernel/Makefile b/arch/x86/kernel/Makefile
index d8e5d0cdd678..4f2e66e29ecc 100644
--- a/arch/x86/kernel/Makefile
+++ b/arch/x86/kernel/Makefile
@@ -40,7 +40,7 @@ obj-$(CONFIG_X86_64) += sys_x86_64.o x8664_ksyms_64.o
40obj-$(CONFIG_X86_64) += syscall_64.o vsyscall_64.o 40obj-$(CONFIG_X86_64) += syscall_64.o vsyscall_64.o
41obj-y += bootflag.o e820.o 41obj-y += bootflag.o e820.o
42obj-y += pci-dma.o quirks.o i8237.o topology.o kdebugfs.o 42obj-y += pci-dma.o quirks.o i8237.o topology.o kdebugfs.o
43obj-y += alternative.o i8253.o pci-nommu.o 43obj-y += alternative.o i8253.o pci-nommu.o hw_breakpoint.o
44obj-y += tsc.o io_delay.o rtc.o 44obj-y += tsc.o io_delay.o rtc.o
45 45
46obj-$(CONFIG_X86_TRAMPOLINE) += trampoline.o 46obj-$(CONFIG_X86_TRAMPOLINE) += trampoline.o
diff --git a/arch/x86/kernel/acpi/processor.c b/arch/x86/kernel/acpi/processor.c
index d296f4a195c9..d85d1b2432ba 100644
--- a/arch/x86/kernel/acpi/processor.c
+++ b/arch/x86/kernel/acpi/processor.c
@@ -79,7 +79,8 @@ void arch_acpi_processor_init_pdc(struct acpi_processor *pr)
79 struct cpuinfo_x86 *c = &cpu_data(pr->id); 79 struct cpuinfo_x86 *c = &cpu_data(pr->id);
80 80
81 pr->pdc = NULL; 81 pr->pdc = NULL;
82 if (c->x86_vendor == X86_VENDOR_INTEL) 82 if (c->x86_vendor == X86_VENDOR_INTEL ||
83 c->x86_vendor == X86_VENDOR_CENTAUR)
83 init_intel_pdc(pr, c); 84 init_intel_pdc(pr, c);
84 85
85 return; 86 return;
diff --git a/arch/x86/kernel/amd_iommu.c b/arch/x86/kernel/amd_iommu.c
index 98f230f6a28d..32fb09102a13 100644
--- a/arch/x86/kernel/amd_iommu.c
+++ b/arch/x86/kernel/amd_iommu.c
@@ -1,5 +1,5 @@
1/* 1/*
2 * Copyright (C) 2007-2008 Advanced Micro Devices, Inc. 2 * Copyright (C) 2007-2009 Advanced Micro Devices, Inc.
3 * Author: Joerg Roedel <joerg.roedel@amd.com> 3 * Author: Joerg Roedel <joerg.roedel@amd.com>
4 * Leo Duran <leo.duran@amd.com> 4 * Leo Duran <leo.duran@amd.com>
5 * 5 *
@@ -28,6 +28,7 @@
28#include <asm/proto.h> 28#include <asm/proto.h>
29#include <asm/iommu.h> 29#include <asm/iommu.h>
30#include <asm/gart.h> 30#include <asm/gart.h>
31#include <asm/amd_iommu_proto.h>
31#include <asm/amd_iommu_types.h> 32#include <asm/amd_iommu_types.h>
32#include <asm/amd_iommu.h> 33#include <asm/amd_iommu.h>
33 34
@@ -56,20 +57,115 @@ struct iommu_cmd {
56 u32 data[4]; 57 u32 data[4];
57}; 58};
58 59
59static int dma_ops_unity_map(struct dma_ops_domain *dma_dom,
60 struct unity_map_entry *e);
61static struct dma_ops_domain *find_protection_domain(u16 devid);
62static u64 *alloc_pte(struct protection_domain *domain,
63 unsigned long address, int end_lvl,
64 u64 **pte_page, gfp_t gfp);
65static void dma_ops_reserve_addresses(struct dma_ops_domain *dom,
66 unsigned long start_page,
67 unsigned int pages);
68static void reset_iommu_command_buffer(struct amd_iommu *iommu); 60static void reset_iommu_command_buffer(struct amd_iommu *iommu);
69static u64 *fetch_pte(struct protection_domain *domain,
70 unsigned long address, int map_size);
71static void update_domain(struct protection_domain *domain); 61static void update_domain(struct protection_domain *domain);
72 62
63/****************************************************************************
64 *
65 * Helper functions
66 *
67 ****************************************************************************/
68
69static inline u16 get_device_id(struct device *dev)
70{
71 struct pci_dev *pdev = to_pci_dev(dev);
72
73 return calc_devid(pdev->bus->number, pdev->devfn);
74}
75
76static struct iommu_dev_data *get_dev_data(struct device *dev)
77{
78 return dev->archdata.iommu;
79}
80
81/*
82 * In this function the list of preallocated protection domains is traversed to
83 * find the domain for a specific device
84 */
85static struct dma_ops_domain *find_protection_domain(u16 devid)
86{
87 struct dma_ops_domain *entry, *ret = NULL;
88 unsigned long flags;
89 u16 alias = amd_iommu_alias_table[devid];
90
91 if (list_empty(&iommu_pd_list))
92 return NULL;
93
94 spin_lock_irqsave(&iommu_pd_list_lock, flags);
95
96 list_for_each_entry(entry, &iommu_pd_list, list) {
97 if (entry->target_dev == devid ||
98 entry->target_dev == alias) {
99 ret = entry;
100 break;
101 }
102 }
103
104 spin_unlock_irqrestore(&iommu_pd_list_lock, flags);
105
106 return ret;
107}
108
109/*
110 * This function checks if the driver got a valid device from the caller to
111 * avoid dereferencing invalid pointers.
112 */
113static bool check_device(struct device *dev)
114{
115 u16 devid;
116
117 if (!dev || !dev->dma_mask)
118 return false;
119
120 /* No device or no PCI device */
121 if (!dev || dev->bus != &pci_bus_type)
122 return false;
123
124 devid = get_device_id(dev);
125
126 /* Out of our scope? */
127 if (devid > amd_iommu_last_bdf)
128 return false;
129
130 if (amd_iommu_rlookup_table[devid] == NULL)
131 return false;
132
133 return true;
134}
135
136static int iommu_init_device(struct device *dev)
137{
138 struct iommu_dev_data *dev_data;
139 struct pci_dev *pdev;
140 u16 devid, alias;
141
142 if (dev->archdata.iommu)
143 return 0;
144
145 dev_data = kzalloc(sizeof(*dev_data), GFP_KERNEL);
146 if (!dev_data)
147 return -ENOMEM;
148
149 dev_data->dev = dev;
150
151 devid = get_device_id(dev);
152 alias = amd_iommu_alias_table[devid];
153 pdev = pci_get_bus_and_slot(PCI_BUS(alias), alias & 0xff);
154 if (pdev)
155 dev_data->alias = &pdev->dev;
156
157 atomic_set(&dev_data->bind, 0);
158
159 dev->archdata.iommu = dev_data;
160
161
162 return 0;
163}
164
165static void iommu_uninit_device(struct device *dev)
166{
167 kfree(dev->archdata.iommu);
168}
73#ifdef CONFIG_AMD_IOMMU_STATS 169#ifdef CONFIG_AMD_IOMMU_STATS
74 170
75/* 171/*
@@ -90,7 +186,6 @@ DECLARE_STATS_COUNTER(alloced_io_mem);
90DECLARE_STATS_COUNTER(total_map_requests); 186DECLARE_STATS_COUNTER(total_map_requests);
91 187
92static struct dentry *stats_dir; 188static struct dentry *stats_dir;
93static struct dentry *de_isolate;
94static struct dentry *de_fflush; 189static struct dentry *de_fflush;
95 190
96static void amd_iommu_stats_add(struct __iommu_counter *cnt) 191static void amd_iommu_stats_add(struct __iommu_counter *cnt)
@@ -108,9 +203,6 @@ static void amd_iommu_stats_init(void)
108 if (stats_dir == NULL) 203 if (stats_dir == NULL)
109 return; 204 return;
110 205
111 de_isolate = debugfs_create_bool("isolation", 0444, stats_dir,
112 (u32 *)&amd_iommu_isolate);
113
114 de_fflush = debugfs_create_bool("fullflush", 0444, stats_dir, 206 de_fflush = debugfs_create_bool("fullflush", 0444, stats_dir,
115 (u32 *)&amd_iommu_unmap_flush); 207 (u32 *)&amd_iommu_unmap_flush);
116 208
@@ -130,12 +222,6 @@ static void amd_iommu_stats_init(void)
130 222
131#endif 223#endif
132 224
133/* returns !0 if the IOMMU is caching non-present entries in its TLB */
134static int iommu_has_npcache(struct amd_iommu *iommu)
135{
136 return iommu->cap & (1UL << IOMMU_CAP_NPCACHE);
137}
138
139/**************************************************************************** 225/****************************************************************************
140 * 226 *
141 * Interrupt handling functions 227 * Interrupt handling functions
@@ -199,6 +285,7 @@ static void iommu_print_event(struct amd_iommu *iommu, void *__evt)
199 break; 285 break;
200 case EVENT_TYPE_ILL_CMD: 286 case EVENT_TYPE_ILL_CMD:
201 printk("ILLEGAL_COMMAND_ERROR address=0x%016llx]\n", address); 287 printk("ILLEGAL_COMMAND_ERROR address=0x%016llx]\n", address);
288 iommu->reset_in_progress = true;
202 reset_iommu_command_buffer(iommu); 289 reset_iommu_command_buffer(iommu);
203 dump_command(address); 290 dump_command(address);
204 break; 291 break;
@@ -321,11 +408,8 @@ static void __iommu_wait_for_completion(struct amd_iommu *iommu)
321 status &= ~MMIO_STATUS_COM_WAIT_INT_MASK; 408 status &= ~MMIO_STATUS_COM_WAIT_INT_MASK;
322 writel(status, iommu->mmio_base + MMIO_STATUS_OFFSET); 409 writel(status, iommu->mmio_base + MMIO_STATUS_OFFSET);
323 410
324 if (unlikely(i == EXIT_LOOP_COUNT)) { 411 if (unlikely(i == EXIT_LOOP_COUNT))
325 spin_unlock(&iommu->lock); 412 iommu->reset_in_progress = true;
326 reset_iommu_command_buffer(iommu);
327 spin_lock(&iommu->lock);
328 }
329} 413}
330 414
331/* 415/*
@@ -372,26 +456,46 @@ static int iommu_completion_wait(struct amd_iommu *iommu)
372out: 456out:
373 spin_unlock_irqrestore(&iommu->lock, flags); 457 spin_unlock_irqrestore(&iommu->lock, flags);
374 458
459 if (iommu->reset_in_progress)
460 reset_iommu_command_buffer(iommu);
461
375 return 0; 462 return 0;
376} 463}
377 464
465static void iommu_flush_complete(struct protection_domain *domain)
466{
467 int i;
468
469 for (i = 0; i < amd_iommus_present; ++i) {
470 if (!domain->dev_iommu[i])
471 continue;
472
473 /*
474 * Devices of this domain are behind this IOMMU
475 * We need to wait for completion of all commands.
476 */
477 iommu_completion_wait(amd_iommus[i]);
478 }
479}
480
378/* 481/*
379 * Command send function for invalidating a device table entry 482 * Command send function for invalidating a device table entry
380 */ 483 */
381static int iommu_queue_inv_dev_entry(struct amd_iommu *iommu, u16 devid) 484static int iommu_flush_device(struct device *dev)
382{ 485{
486 struct amd_iommu *iommu;
383 struct iommu_cmd cmd; 487 struct iommu_cmd cmd;
384 int ret; 488 u16 devid;
385 489
386 BUG_ON(iommu == NULL); 490 devid = get_device_id(dev);
491 iommu = amd_iommu_rlookup_table[devid];
387 492
493 /* Build command */
388 memset(&cmd, 0, sizeof(cmd)); 494 memset(&cmd, 0, sizeof(cmd));
389 CMD_SET_TYPE(&cmd, CMD_INV_DEV_ENTRY); 495 CMD_SET_TYPE(&cmd, CMD_INV_DEV_ENTRY);
390 cmd.data[0] = devid; 496 cmd.data[0] = devid;
391 497
392 ret = iommu_queue_command(iommu, &cmd); 498 return iommu_queue_command(iommu, &cmd);
393
394 return ret;
395} 499}
396 500
397static void __iommu_build_inv_iommu_pages(struct iommu_cmd *cmd, u64 address, 501static void __iommu_build_inv_iommu_pages(struct iommu_cmd *cmd, u64 address,
@@ -430,11 +534,11 @@ static int iommu_queue_inv_iommu_pages(struct amd_iommu *iommu,
430 * It invalidates a single PTE if the range to flush is within a single 534 * It invalidates a single PTE if the range to flush is within a single
431 * page. Otherwise it flushes the whole TLB of the IOMMU. 535 * page. Otherwise it flushes the whole TLB of the IOMMU.
432 */ 536 */
433static int iommu_flush_pages(struct amd_iommu *iommu, u16 domid, 537static void __iommu_flush_pages(struct protection_domain *domain,
434 u64 address, size_t size) 538 u64 address, size_t size, int pde)
435{ 539{
436 int s = 0; 540 int s = 0, i;
437 unsigned pages = iommu_num_pages(address, size, PAGE_SIZE); 541 unsigned long pages = iommu_num_pages(address, size, PAGE_SIZE);
438 542
439 address &= PAGE_MASK; 543 address &= PAGE_MASK;
440 544
@@ -447,142 +551,212 @@ static int iommu_flush_pages(struct amd_iommu *iommu, u16 domid,
447 s = 1; 551 s = 1;
448 } 552 }
449 553
450 iommu_queue_inv_iommu_pages(iommu, address, domid, 0, s);
451 554
452 return 0; 555 for (i = 0; i < amd_iommus_present; ++i) {
556 if (!domain->dev_iommu[i])
557 continue;
558
559 /*
560 * Devices of this domain are behind this IOMMU
561 * We need a TLB flush
562 */
563 iommu_queue_inv_iommu_pages(amd_iommus[i], address,
564 domain->id, pde, s);
565 }
566
567 return;
453} 568}
454 569
455/* Flush the whole IO/TLB for a given protection domain */ 570static void iommu_flush_pages(struct protection_domain *domain,
456static void iommu_flush_tlb(struct amd_iommu *iommu, u16 domid) 571 u64 address, size_t size)
457{ 572{
458 u64 address = CMD_INV_IOMMU_ALL_PAGES_ADDRESS; 573 __iommu_flush_pages(domain, address, size, 0);
459 574}
460 INC_STATS_COUNTER(domain_flush_single);
461 575
462 iommu_queue_inv_iommu_pages(iommu, address, domid, 0, 1); 576/* Flush the whole IO/TLB for a given protection domain */
577static void iommu_flush_tlb(struct protection_domain *domain)
578{
579 __iommu_flush_pages(domain, 0, CMD_INV_IOMMU_ALL_PAGES_ADDRESS, 0);
463} 580}
464 581
465/* Flush the whole IO/TLB for a given protection domain - including PDE */ 582/* Flush the whole IO/TLB for a given protection domain - including PDE */
466static void iommu_flush_tlb_pde(struct amd_iommu *iommu, u16 domid) 583static void iommu_flush_tlb_pde(struct protection_domain *domain)
467{ 584{
468 u64 address = CMD_INV_IOMMU_ALL_PAGES_ADDRESS; 585 __iommu_flush_pages(domain, 0, CMD_INV_IOMMU_ALL_PAGES_ADDRESS, 1);
469
470 INC_STATS_COUNTER(domain_flush_single);
471
472 iommu_queue_inv_iommu_pages(iommu, address, domid, 1, 1);
473} 586}
474 587
588
475/* 589/*
476 * This function flushes one domain on one IOMMU 590 * This function flushes the DTEs for all devices in domain
477 */ 591 */
478static void flush_domain_on_iommu(struct amd_iommu *iommu, u16 domid) 592static void iommu_flush_domain_devices(struct protection_domain *domain)
479{ 593{
480 struct iommu_cmd cmd; 594 struct iommu_dev_data *dev_data;
481 unsigned long flags; 595 unsigned long flags;
482 596
483 __iommu_build_inv_iommu_pages(&cmd, CMD_INV_IOMMU_ALL_PAGES_ADDRESS, 597 spin_lock_irqsave(&domain->lock, flags);
484 domid, 1, 1);
485 598
486 spin_lock_irqsave(&iommu->lock, flags); 599 list_for_each_entry(dev_data, &domain->dev_list, list)
487 __iommu_queue_command(iommu, &cmd); 600 iommu_flush_device(dev_data->dev);
488 __iommu_completion_wait(iommu); 601
489 __iommu_wait_for_completion(iommu); 602 spin_unlock_irqrestore(&domain->lock, flags);
490 spin_unlock_irqrestore(&iommu->lock, flags);
491} 603}
492 604
493static void flush_all_domains_on_iommu(struct amd_iommu *iommu) 605static void iommu_flush_all_domain_devices(void)
494{ 606{
495 int i; 607 struct protection_domain *domain;
608 unsigned long flags;
496 609
497 for (i = 1; i < MAX_DOMAIN_ID; ++i) { 610 spin_lock_irqsave(&amd_iommu_pd_lock, flags);
498 if (!test_bit(i, amd_iommu_pd_alloc_bitmap)) 611
499 continue; 612 list_for_each_entry(domain, &amd_iommu_pd_list, list) {
500 flush_domain_on_iommu(iommu, i); 613 iommu_flush_domain_devices(domain);
614 iommu_flush_complete(domain);
501 } 615 }
502 616
617 spin_unlock_irqrestore(&amd_iommu_pd_lock, flags);
618}
619
620void amd_iommu_flush_all_devices(void)
621{
622 iommu_flush_all_domain_devices();
503} 623}
504 624
505/* 625/*
506 * This function is used to flush the IO/TLB for a given protection domain 626 * This function uses heavy locking and may disable irqs for some time. But
507 * on every IOMMU in the system 627 * this is no issue because it is only called during resume.
508 */ 628 */
509static void iommu_flush_domain(u16 domid) 629void amd_iommu_flush_all_domains(void)
510{ 630{
511 struct amd_iommu *iommu; 631 struct protection_domain *domain;
632 unsigned long flags;
512 633
513 INC_STATS_COUNTER(domain_flush_all); 634 spin_lock_irqsave(&amd_iommu_pd_lock, flags);
514 635
515 for_each_iommu(iommu) 636 list_for_each_entry(domain, &amd_iommu_pd_list, list) {
516 flush_domain_on_iommu(iommu, domid); 637 spin_lock(&domain->lock);
638 iommu_flush_tlb_pde(domain);
639 iommu_flush_complete(domain);
640 spin_unlock(&domain->lock);
641 }
642
643 spin_unlock_irqrestore(&amd_iommu_pd_lock, flags);
517} 644}
518 645
519void amd_iommu_flush_all_domains(void) 646static void reset_iommu_command_buffer(struct amd_iommu *iommu)
520{ 647{
521 struct amd_iommu *iommu; 648 pr_err("AMD-Vi: Resetting IOMMU command buffer\n");
522 649
523 for_each_iommu(iommu) 650 if (iommu->reset_in_progress)
524 flush_all_domains_on_iommu(iommu); 651 panic("AMD-Vi: ILLEGAL_COMMAND_ERROR while resetting command buffer\n");
652
653 amd_iommu_reset_cmd_buffer(iommu);
654 amd_iommu_flush_all_devices();
655 amd_iommu_flush_all_domains();
656
657 iommu->reset_in_progress = false;
525} 658}
526 659
527static void flush_all_devices_for_iommu(struct amd_iommu *iommu) 660/****************************************************************************
661 *
662 * The functions below are used the create the page table mappings for
663 * unity mapped regions.
664 *
665 ****************************************************************************/
666
667/*
668 * This function is used to add another level to an IO page table. Adding
669 * another level increases the size of the address space by 9 bits to a size up
670 * to 64 bits.
671 */
672static bool increase_address_space(struct protection_domain *domain,
673 gfp_t gfp)
528{ 674{
529 int i; 675 u64 *pte;
530 676
531 for (i = 0; i <= amd_iommu_last_bdf; ++i) { 677 if (domain->mode == PAGE_MODE_6_LEVEL)
532 if (iommu != amd_iommu_rlookup_table[i]) 678 /* address space already 64 bit large */
533 continue; 679 return false;
534 680
535 iommu_queue_inv_dev_entry(iommu, i); 681 pte = (void *)get_zeroed_page(gfp);
536 iommu_completion_wait(iommu); 682 if (!pte)
537 } 683 return false;
684
685 *pte = PM_LEVEL_PDE(domain->mode,
686 virt_to_phys(domain->pt_root));
687 domain->pt_root = pte;
688 domain->mode += 1;
689 domain->updated = true;
690
691 return true;
538} 692}
539 693
540static void flush_devices_by_domain(struct protection_domain *domain) 694static u64 *alloc_pte(struct protection_domain *domain,
695 unsigned long address,
696 int end_lvl,
697 u64 **pte_page,
698 gfp_t gfp)
541{ 699{
542 struct amd_iommu *iommu; 700 u64 *pte, *page;
543 int i; 701 int level;
544 702
545 for (i = 0; i <= amd_iommu_last_bdf; ++i) { 703 while (address > PM_LEVEL_SIZE(domain->mode))
546 if ((domain == NULL && amd_iommu_pd_table[i] == NULL) || 704 increase_address_space(domain, gfp);
547 (amd_iommu_pd_table[i] != domain))
548 continue;
549 705
550 iommu = amd_iommu_rlookup_table[i]; 706 level = domain->mode - 1;
551 if (!iommu) 707 pte = &domain->pt_root[PM_LEVEL_INDEX(level, address)];
552 continue; 708
709 while (level > end_lvl) {
710 if (!IOMMU_PTE_PRESENT(*pte)) {
711 page = (u64 *)get_zeroed_page(gfp);
712 if (!page)
713 return NULL;
714 *pte = PM_LEVEL_PDE(level, virt_to_phys(page));
715 }
553 716
554 iommu_queue_inv_dev_entry(iommu, i); 717 level -= 1;
555 iommu_completion_wait(iommu); 718
719 pte = IOMMU_PTE_PAGE(*pte);
720
721 if (pte_page && level == end_lvl)
722 *pte_page = pte;
723
724 pte = &pte[PM_LEVEL_INDEX(level, address)];
556 } 725 }
726
727 return pte;
557} 728}
558 729
559static void reset_iommu_command_buffer(struct amd_iommu *iommu) 730/*
731 * This function checks if there is a PTE for a given dma address. If
732 * there is one, it returns the pointer to it.
733 */
734static u64 *fetch_pte(struct protection_domain *domain,
735 unsigned long address, int map_size)
560{ 736{
561 pr_err("AMD-Vi: Resetting IOMMU command buffer\n"); 737 int level;
738 u64 *pte;
562 739
563 if (iommu->reset_in_progress) 740 level = domain->mode - 1;
564 panic("AMD-Vi: ILLEGAL_COMMAND_ERROR while resetting command buffer\n"); 741 pte = &domain->pt_root[PM_LEVEL_INDEX(level, address)];
565 742
566 iommu->reset_in_progress = true; 743 while (level > map_size) {
744 if (!IOMMU_PTE_PRESENT(*pte))
745 return NULL;
567 746
568 amd_iommu_reset_cmd_buffer(iommu); 747 level -= 1;
569 flush_all_devices_for_iommu(iommu);
570 flush_all_domains_on_iommu(iommu);
571 748
572 iommu->reset_in_progress = false; 749 pte = IOMMU_PTE_PAGE(*pte);
573} 750 pte = &pte[PM_LEVEL_INDEX(level, address)];
574 751
575void amd_iommu_flush_all_devices(void) 752 if ((PM_PTE_LEVEL(*pte) == 0) && level != map_size) {
576{ 753 pte = NULL;
577 flush_devices_by_domain(NULL); 754 break;
578} 755 }
756 }
579 757
580/**************************************************************************** 758 return pte;
581 * 759}
582 * The functions below are used the create the page table mappings for
583 * unity mapped regions.
584 *
585 ****************************************************************************/
586 760
587/* 761/*
588 * Generic mapping functions. It maps a physical address into a DMA 762 * Generic mapping functions. It maps a physical address into a DMA
@@ -654,28 +828,6 @@ static int iommu_for_unity_map(struct amd_iommu *iommu,
654} 828}
655 829
656/* 830/*
657 * Init the unity mappings for a specific IOMMU in the system
658 *
659 * Basically iterates over all unity mapping entries and applies them to
660 * the default domain DMA of that IOMMU if necessary.
661 */
662static int iommu_init_unity_mappings(struct amd_iommu *iommu)
663{
664 struct unity_map_entry *entry;
665 int ret;
666
667 list_for_each_entry(entry, &amd_iommu_unity_map, list) {
668 if (!iommu_for_unity_map(iommu, entry))
669 continue;
670 ret = dma_ops_unity_map(iommu->default_dom, entry);
671 if (ret)
672 return ret;
673 }
674
675 return 0;
676}
677
678/*
679 * This function actually applies the mapping to the page table of the 831 * This function actually applies the mapping to the page table of the
680 * dma_ops domain. 832 * dma_ops domain.
681 */ 833 */
@@ -704,6 +856,28 @@ static int dma_ops_unity_map(struct dma_ops_domain *dma_dom,
704} 856}
705 857
706/* 858/*
859 * Init the unity mappings for a specific IOMMU in the system
860 *
861 * Basically iterates over all unity mapping entries and applies them to
862 * the default domain DMA of that IOMMU if necessary.
863 */
864static int iommu_init_unity_mappings(struct amd_iommu *iommu)
865{
866 struct unity_map_entry *entry;
867 int ret;
868
869 list_for_each_entry(entry, &amd_iommu_unity_map, list) {
870 if (!iommu_for_unity_map(iommu, entry))
871 continue;
872 ret = dma_ops_unity_map(iommu->default_dom, entry);
873 if (ret)
874 return ret;
875 }
876
877 return 0;
878}
879
880/*
707 * Inits the unity mappings required for a specific device 881 * Inits the unity mappings required for a specific device
708 */ 882 */
709static int init_unity_mappings_for_device(struct dma_ops_domain *dma_dom, 883static int init_unity_mappings_for_device(struct dma_ops_domain *dma_dom,
@@ -740,34 +914,23 @@ static int init_unity_mappings_for_device(struct dma_ops_domain *dma_dom,
740 */ 914 */
741 915
742/* 916/*
743 * This function checks if there is a PTE for a given dma address. If 917 * Used to reserve address ranges in the aperture (e.g. for exclusion
744 * there is one, it returns the pointer to it. 918 * ranges.
745 */ 919 */
746static u64 *fetch_pte(struct protection_domain *domain, 920static void dma_ops_reserve_addresses(struct dma_ops_domain *dom,
747 unsigned long address, int map_size) 921 unsigned long start_page,
922 unsigned int pages)
748{ 923{
749 int level; 924 unsigned int i, last_page = dom->aperture_size >> PAGE_SHIFT;
750 u64 *pte;
751
752 level = domain->mode - 1;
753 pte = &domain->pt_root[PM_LEVEL_INDEX(level, address)];
754
755 while (level > map_size) {
756 if (!IOMMU_PTE_PRESENT(*pte))
757 return NULL;
758
759 level -= 1;
760 925
761 pte = IOMMU_PTE_PAGE(*pte); 926 if (start_page + pages > last_page)
762 pte = &pte[PM_LEVEL_INDEX(level, address)]; 927 pages = last_page - start_page;
763 928
764 if ((PM_PTE_LEVEL(*pte) == 0) && level != map_size) { 929 for (i = start_page; i < start_page + pages; ++i) {
765 pte = NULL; 930 int index = i / APERTURE_RANGE_PAGES;
766 break; 931 int page = i % APERTURE_RANGE_PAGES;
767 } 932 __set_bit(page, dom->aperture[index]->bitmap);
768 } 933 }
769
770 return pte;
771} 934}
772 935
773/* 936/*
@@ -775,11 +938,11 @@ static u64 *fetch_pte(struct protection_domain *domain,
775 * aperture in case of dma_ops domain allocation or address allocation 938 * aperture in case of dma_ops domain allocation or address allocation
776 * failure. 939 * failure.
777 */ 940 */
778static int alloc_new_range(struct amd_iommu *iommu, 941static int alloc_new_range(struct dma_ops_domain *dma_dom,
779 struct dma_ops_domain *dma_dom,
780 bool populate, gfp_t gfp) 942 bool populate, gfp_t gfp)
781{ 943{
782 int index = dma_dom->aperture_size >> APERTURE_RANGE_SHIFT; 944 int index = dma_dom->aperture_size >> APERTURE_RANGE_SHIFT;
945 struct amd_iommu *iommu;
783 int i; 946 int i;
784 947
785#ifdef CONFIG_IOMMU_STRESS 948#ifdef CONFIG_IOMMU_STRESS
@@ -819,14 +982,17 @@ static int alloc_new_range(struct amd_iommu *iommu,
819 dma_dom->aperture_size += APERTURE_RANGE_SIZE; 982 dma_dom->aperture_size += APERTURE_RANGE_SIZE;
820 983
821 /* Intialize the exclusion range if necessary */ 984 /* Intialize the exclusion range if necessary */
822 if (iommu->exclusion_start && 985 for_each_iommu(iommu) {
823 iommu->exclusion_start >= dma_dom->aperture[index]->offset && 986 if (iommu->exclusion_start &&
824 iommu->exclusion_start < dma_dom->aperture_size) { 987 iommu->exclusion_start >= dma_dom->aperture[index]->offset
825 unsigned long startpage = iommu->exclusion_start >> PAGE_SHIFT; 988 && iommu->exclusion_start < dma_dom->aperture_size) {
826 int pages = iommu_num_pages(iommu->exclusion_start, 989 unsigned long startpage;
827 iommu->exclusion_length, 990 int pages = iommu_num_pages(iommu->exclusion_start,
828 PAGE_SIZE); 991 iommu->exclusion_length,
829 dma_ops_reserve_addresses(dma_dom, startpage, pages); 992 PAGE_SIZE);
993 startpage = iommu->exclusion_start >> PAGE_SHIFT;
994 dma_ops_reserve_addresses(dma_dom, startpage, pages);
995 }
830 } 996 }
831 997
832 /* 998 /*
@@ -928,7 +1094,7 @@ static unsigned long dma_ops_alloc_addresses(struct device *dev,
928 } 1094 }
929 1095
930 if (unlikely(address == -1)) 1096 if (unlikely(address == -1))
931 address = bad_dma_address; 1097 address = DMA_ERROR_CODE;
932 1098
933 WARN_ON((address + (PAGE_SIZE*pages)) > dom->aperture_size); 1099 WARN_ON((address + (PAGE_SIZE*pages)) > dom->aperture_size);
934 1100
@@ -973,6 +1139,31 @@ static void dma_ops_free_addresses(struct dma_ops_domain *dom,
973 * 1139 *
974 ****************************************************************************/ 1140 ****************************************************************************/
975 1141
1142/*
1143 * This function adds a protection domain to the global protection domain list
1144 */
1145static void add_domain_to_list(struct protection_domain *domain)
1146{
1147 unsigned long flags;
1148
1149 spin_lock_irqsave(&amd_iommu_pd_lock, flags);
1150 list_add(&domain->list, &amd_iommu_pd_list);
1151 spin_unlock_irqrestore(&amd_iommu_pd_lock, flags);
1152}
1153
1154/*
1155 * This function removes a protection domain to the global
1156 * protection domain list
1157 */
1158static void del_domain_from_list(struct protection_domain *domain)
1159{
1160 unsigned long flags;
1161
1162 spin_lock_irqsave(&amd_iommu_pd_lock, flags);
1163 list_del(&domain->list);
1164 spin_unlock_irqrestore(&amd_iommu_pd_lock, flags);
1165}
1166
976static u16 domain_id_alloc(void) 1167static u16 domain_id_alloc(void)
977{ 1168{
978 unsigned long flags; 1169 unsigned long flags;
@@ -1000,26 +1191,6 @@ static void domain_id_free(int id)
1000 write_unlock_irqrestore(&amd_iommu_devtable_lock, flags); 1191 write_unlock_irqrestore(&amd_iommu_devtable_lock, flags);
1001} 1192}
1002 1193
1003/*
1004 * Used to reserve address ranges in the aperture (e.g. for exclusion
1005 * ranges.
1006 */
1007static void dma_ops_reserve_addresses(struct dma_ops_domain *dom,
1008 unsigned long start_page,
1009 unsigned int pages)
1010{
1011 unsigned int i, last_page = dom->aperture_size >> PAGE_SHIFT;
1012
1013 if (start_page + pages > last_page)
1014 pages = last_page - start_page;
1015
1016 for (i = start_page; i < start_page + pages; ++i) {
1017 int index = i / APERTURE_RANGE_PAGES;
1018 int page = i % APERTURE_RANGE_PAGES;
1019 __set_bit(page, dom->aperture[index]->bitmap);
1020 }
1021}
1022
1023static void free_pagetable(struct protection_domain *domain) 1194static void free_pagetable(struct protection_domain *domain)
1024{ 1195{
1025 int i, j; 1196 int i, j;
@@ -1061,6 +1232,8 @@ static void dma_ops_domain_free(struct dma_ops_domain *dom)
1061 if (!dom) 1232 if (!dom)
1062 return; 1233 return;
1063 1234
1235 del_domain_from_list(&dom->domain);
1236
1064 free_pagetable(&dom->domain); 1237 free_pagetable(&dom->domain);
1065 1238
1066 for (i = 0; i < APERTURE_MAX_RANGES; ++i) { 1239 for (i = 0; i < APERTURE_MAX_RANGES; ++i) {
@@ -1078,7 +1251,7 @@ static void dma_ops_domain_free(struct dma_ops_domain *dom)
1078 * It also intializes the page table and the address allocator data 1251 * It also intializes the page table and the address allocator data
1079 * structures required for the dma_ops interface 1252 * structures required for the dma_ops interface
1080 */ 1253 */
1081static struct dma_ops_domain *dma_ops_domain_alloc(struct amd_iommu *iommu) 1254static struct dma_ops_domain *dma_ops_domain_alloc(void)
1082{ 1255{
1083 struct dma_ops_domain *dma_dom; 1256 struct dma_ops_domain *dma_dom;
1084 1257
@@ -1091,6 +1264,7 @@ static struct dma_ops_domain *dma_ops_domain_alloc(struct amd_iommu *iommu)
1091 dma_dom->domain.id = domain_id_alloc(); 1264 dma_dom->domain.id = domain_id_alloc();
1092 if (dma_dom->domain.id == 0) 1265 if (dma_dom->domain.id == 0)
1093 goto free_dma_dom; 1266 goto free_dma_dom;
1267 INIT_LIST_HEAD(&dma_dom->domain.dev_list);
1094 dma_dom->domain.mode = PAGE_MODE_2_LEVEL; 1268 dma_dom->domain.mode = PAGE_MODE_2_LEVEL;
1095 dma_dom->domain.pt_root = (void *)get_zeroed_page(GFP_KERNEL); 1269 dma_dom->domain.pt_root = (void *)get_zeroed_page(GFP_KERNEL);
1096 dma_dom->domain.flags = PD_DMA_OPS_MASK; 1270 dma_dom->domain.flags = PD_DMA_OPS_MASK;
@@ -1101,7 +1275,9 @@ static struct dma_ops_domain *dma_ops_domain_alloc(struct amd_iommu *iommu)
1101 dma_dom->need_flush = false; 1275 dma_dom->need_flush = false;
1102 dma_dom->target_dev = 0xffff; 1276 dma_dom->target_dev = 0xffff;
1103 1277
1104 if (alloc_new_range(iommu, dma_dom, true, GFP_KERNEL)) 1278 add_domain_to_list(&dma_dom->domain);
1279
1280 if (alloc_new_range(dma_dom, true, GFP_KERNEL))
1105 goto free_dma_dom; 1281 goto free_dma_dom;
1106 1282
1107 /* 1283 /*
@@ -1129,22 +1305,6 @@ static bool dma_ops_domain(struct protection_domain *domain)
1129 return domain->flags & PD_DMA_OPS_MASK; 1305 return domain->flags & PD_DMA_OPS_MASK;
1130} 1306}
1131 1307
1132/*
1133 * Find out the protection domain structure for a given PCI device. This
1134 * will give us the pointer to the page table root for example.
1135 */
1136static struct protection_domain *domain_for_device(u16 devid)
1137{
1138 struct protection_domain *dom;
1139 unsigned long flags;
1140
1141 read_lock_irqsave(&amd_iommu_devtable_lock, flags);
1142 dom = amd_iommu_pd_table[devid];
1143 read_unlock_irqrestore(&amd_iommu_devtable_lock, flags);
1144
1145 return dom;
1146}
1147
1148static void set_dte_entry(u16 devid, struct protection_domain *domain) 1308static void set_dte_entry(u16 devid, struct protection_domain *domain)
1149{ 1309{
1150 u64 pte_root = virt_to_phys(domain->pt_root); 1310 u64 pte_root = virt_to_phys(domain->pt_root);
@@ -1156,42 +1316,123 @@ static void set_dte_entry(u16 devid, struct protection_domain *domain)
1156 amd_iommu_dev_table[devid].data[2] = domain->id; 1316 amd_iommu_dev_table[devid].data[2] = domain->id;
1157 amd_iommu_dev_table[devid].data[1] = upper_32_bits(pte_root); 1317 amd_iommu_dev_table[devid].data[1] = upper_32_bits(pte_root);
1158 amd_iommu_dev_table[devid].data[0] = lower_32_bits(pte_root); 1318 amd_iommu_dev_table[devid].data[0] = lower_32_bits(pte_root);
1319}
1320
1321static void clear_dte_entry(u16 devid)
1322{
1323 /* remove entry from the device table seen by the hardware */
1324 amd_iommu_dev_table[devid].data[0] = IOMMU_PTE_P | IOMMU_PTE_TV;
1325 amd_iommu_dev_table[devid].data[1] = 0;
1326 amd_iommu_dev_table[devid].data[2] = 0;
1159 1327
1160 amd_iommu_pd_table[devid] = domain; 1328 amd_iommu_apply_erratum_63(devid);
1329}
1330
1331static void do_attach(struct device *dev, struct protection_domain *domain)
1332{
1333 struct iommu_dev_data *dev_data;
1334 struct amd_iommu *iommu;
1335 u16 devid;
1336
1337 devid = get_device_id(dev);
1338 iommu = amd_iommu_rlookup_table[devid];
1339 dev_data = get_dev_data(dev);
1340
1341 /* Update data structures */
1342 dev_data->domain = domain;
1343 list_add(&dev_data->list, &domain->dev_list);
1344 set_dte_entry(devid, domain);
1345
1346 /* Do reference counting */
1347 domain->dev_iommu[iommu->index] += 1;
1348 domain->dev_cnt += 1;
1349
1350 /* Flush the DTE entry */
1351 iommu_flush_device(dev);
1352}
1353
1354static void do_detach(struct device *dev)
1355{
1356 struct iommu_dev_data *dev_data;
1357 struct amd_iommu *iommu;
1358 u16 devid;
1359
1360 devid = get_device_id(dev);
1361 iommu = amd_iommu_rlookup_table[devid];
1362 dev_data = get_dev_data(dev);
1363
1364 /* decrease reference counters */
1365 dev_data->domain->dev_iommu[iommu->index] -= 1;
1366 dev_data->domain->dev_cnt -= 1;
1367
1368 /* Update data structures */
1369 dev_data->domain = NULL;
1370 list_del(&dev_data->list);
1371 clear_dte_entry(devid);
1372
1373 /* Flush the DTE entry */
1374 iommu_flush_device(dev);
1161} 1375}
1162 1376
1163/* 1377/*
1164 * If a device is not yet associated with a domain, this function does 1378 * If a device is not yet associated with a domain, this function does
1165 * assigns it visible for the hardware 1379 * assigns it visible for the hardware
1166 */ 1380 */
1167static void __attach_device(struct amd_iommu *iommu, 1381static int __attach_device(struct device *dev,
1168 struct protection_domain *domain, 1382 struct protection_domain *domain)
1169 u16 devid)
1170{ 1383{
1384 struct iommu_dev_data *dev_data, *alias_data;
1385
1386 dev_data = get_dev_data(dev);
1387 alias_data = get_dev_data(dev_data->alias);
1388
1389 if (!alias_data)
1390 return -EINVAL;
1391
1171 /* lock domain */ 1392 /* lock domain */
1172 spin_lock(&domain->lock); 1393 spin_lock(&domain->lock);
1173 1394
1174 /* update DTE entry */ 1395 /* Some sanity checks */
1175 set_dte_entry(devid, domain); 1396 if (alias_data->domain != NULL &&
1397 alias_data->domain != domain)
1398 return -EBUSY;
1399
1400 if (dev_data->domain != NULL &&
1401 dev_data->domain != domain)
1402 return -EBUSY;
1176 1403
1177 domain->dev_cnt += 1; 1404 /* Do real assignment */
1405 if (dev_data->alias != dev) {
1406 alias_data = get_dev_data(dev_data->alias);
1407 if (alias_data->domain == NULL)
1408 do_attach(dev_data->alias, domain);
1409
1410 atomic_inc(&alias_data->bind);
1411 }
1412
1413 if (dev_data->domain == NULL)
1414 do_attach(dev, domain);
1415
1416 atomic_inc(&dev_data->bind);
1178 1417
1179 /* ready */ 1418 /* ready */
1180 spin_unlock(&domain->lock); 1419 spin_unlock(&domain->lock);
1420
1421 return 0;
1181} 1422}
1182 1423
1183/* 1424/*
1184 * If a device is not yet associated with a domain, this function does 1425 * If a device is not yet associated with a domain, this function does
1185 * assigns it visible for the hardware 1426 * assigns it visible for the hardware
1186 */ 1427 */
1187static void attach_device(struct amd_iommu *iommu, 1428static int attach_device(struct device *dev,
1188 struct protection_domain *domain, 1429 struct protection_domain *domain)
1189 u16 devid)
1190{ 1430{
1191 unsigned long flags; 1431 unsigned long flags;
1432 int ret;
1192 1433
1193 write_lock_irqsave(&amd_iommu_devtable_lock, flags); 1434 write_lock_irqsave(&amd_iommu_devtable_lock, flags);
1194 __attach_device(iommu, domain, devid); 1435 ret = __attach_device(dev, domain);
1195 write_unlock_irqrestore(&amd_iommu_devtable_lock, flags); 1436 write_unlock_irqrestore(&amd_iommu_devtable_lock, flags);
1196 1437
1197 /* 1438 /*
@@ -1199,96 +1440,125 @@ static void attach_device(struct amd_iommu *iommu,
1199 * left the caches in the IOMMU dirty. So we have to flush 1440 * left the caches in the IOMMU dirty. So we have to flush
1200 * here to evict all dirty stuff. 1441 * here to evict all dirty stuff.
1201 */ 1442 */
1202 iommu_queue_inv_dev_entry(iommu, devid); 1443 iommu_flush_tlb_pde(domain);
1203 iommu_flush_tlb_pde(iommu, domain->id); 1444
1445 return ret;
1204} 1446}
1205 1447
1206/* 1448/*
1207 * Removes a device from a protection domain (unlocked) 1449 * Removes a device from a protection domain (unlocked)
1208 */ 1450 */
1209static void __detach_device(struct protection_domain *domain, u16 devid) 1451static void __detach_device(struct device *dev)
1210{ 1452{
1453 struct iommu_dev_data *dev_data = get_dev_data(dev);
1454 struct iommu_dev_data *alias_data;
1455 unsigned long flags;
1211 1456
1212 /* lock domain */ 1457 BUG_ON(!dev_data->domain);
1213 spin_lock(&domain->lock);
1214 1458
1215 /* remove domain from the lookup table */ 1459 spin_lock_irqsave(&dev_data->domain->lock, flags);
1216 amd_iommu_pd_table[devid] = NULL;
1217 1460
1218 /* remove entry from the device table seen by the hardware */ 1461 if (dev_data->alias != dev) {
1219 amd_iommu_dev_table[devid].data[0] = IOMMU_PTE_P | IOMMU_PTE_TV; 1462 alias_data = get_dev_data(dev_data->alias);
1220 amd_iommu_dev_table[devid].data[1] = 0; 1463 if (atomic_dec_and_test(&alias_data->bind))
1221 amd_iommu_dev_table[devid].data[2] = 0; 1464 do_detach(dev_data->alias);
1465 }
1222 1466
1223 /* decrease reference counter */ 1467 if (atomic_dec_and_test(&dev_data->bind))
1224 domain->dev_cnt -= 1; 1468 do_detach(dev);
1225 1469
1226 /* ready */ 1470 spin_unlock_irqrestore(&dev_data->domain->lock, flags);
1227 spin_unlock(&domain->lock);
1228 1471
1229 /* 1472 /*
1230 * If we run in passthrough mode the device must be assigned to the 1473 * If we run in passthrough mode the device must be assigned to the
1231 * passthrough domain if it is detached from any other domain 1474 * passthrough domain if it is detached from any other domain
1232 */ 1475 */
1233 if (iommu_pass_through) { 1476 if (iommu_pass_through && dev_data->domain == NULL)
1234 struct amd_iommu *iommu = amd_iommu_rlookup_table[devid]; 1477 __attach_device(dev, pt_domain);
1235 __attach_device(iommu, pt_domain, devid);
1236 }
1237} 1478}
1238 1479
1239/* 1480/*
1240 * Removes a device from a protection domain (with devtable_lock held) 1481 * Removes a device from a protection domain (with devtable_lock held)
1241 */ 1482 */
1242static void detach_device(struct protection_domain *domain, u16 devid) 1483static void detach_device(struct device *dev)
1243{ 1484{
1244 unsigned long flags; 1485 unsigned long flags;
1245 1486
1246 /* lock device table */ 1487 /* lock device table */
1247 write_lock_irqsave(&amd_iommu_devtable_lock, flags); 1488 write_lock_irqsave(&amd_iommu_devtable_lock, flags);
1248 __detach_device(domain, devid); 1489 __detach_device(dev);
1249 write_unlock_irqrestore(&amd_iommu_devtable_lock, flags); 1490 write_unlock_irqrestore(&amd_iommu_devtable_lock, flags);
1250} 1491}
1251 1492
1493/*
1494 * Find out the protection domain structure for a given PCI device. This
1495 * will give us the pointer to the page table root for example.
1496 */
1497static struct protection_domain *domain_for_device(struct device *dev)
1498{
1499 struct protection_domain *dom;
1500 struct iommu_dev_data *dev_data, *alias_data;
1501 unsigned long flags;
1502 u16 devid, alias;
1503
1504 devid = get_device_id(dev);
1505 alias = amd_iommu_alias_table[devid];
1506 dev_data = get_dev_data(dev);
1507 alias_data = get_dev_data(dev_data->alias);
1508 if (!alias_data)
1509 return NULL;
1510
1511 read_lock_irqsave(&amd_iommu_devtable_lock, flags);
1512 dom = dev_data->domain;
1513 if (dom == NULL &&
1514 alias_data->domain != NULL) {
1515 __attach_device(dev, alias_data->domain);
1516 dom = alias_data->domain;
1517 }
1518
1519 read_unlock_irqrestore(&amd_iommu_devtable_lock, flags);
1520
1521 return dom;
1522}
1523
1252static int device_change_notifier(struct notifier_block *nb, 1524static int device_change_notifier(struct notifier_block *nb,
1253 unsigned long action, void *data) 1525 unsigned long action, void *data)
1254{ 1526{
1255 struct device *dev = data; 1527 struct device *dev = data;
1256 struct pci_dev *pdev = to_pci_dev(dev); 1528 u16 devid;
1257 u16 devid = calc_devid(pdev->bus->number, pdev->devfn);
1258 struct protection_domain *domain; 1529 struct protection_domain *domain;
1259 struct dma_ops_domain *dma_domain; 1530 struct dma_ops_domain *dma_domain;
1260 struct amd_iommu *iommu; 1531 struct amd_iommu *iommu;
1261 unsigned long flags; 1532 unsigned long flags;
1262 1533
1263 if (devid > amd_iommu_last_bdf) 1534 if (!check_device(dev))
1264 goto out; 1535 return 0;
1265
1266 devid = amd_iommu_alias_table[devid];
1267
1268 iommu = amd_iommu_rlookup_table[devid];
1269 if (iommu == NULL)
1270 goto out;
1271
1272 domain = domain_for_device(devid);
1273 1536
1274 if (domain && !dma_ops_domain(domain)) 1537 devid = get_device_id(dev);
1275 WARN_ONCE(1, "AMD IOMMU WARNING: device %s already bound " 1538 iommu = amd_iommu_rlookup_table[devid];
1276 "to a non-dma-ops domain\n", dev_name(dev));
1277 1539
1278 switch (action) { 1540 switch (action) {
1279 case BUS_NOTIFY_UNBOUND_DRIVER: 1541 case BUS_NOTIFY_UNBOUND_DRIVER:
1542
1543 domain = domain_for_device(dev);
1544
1280 if (!domain) 1545 if (!domain)
1281 goto out; 1546 goto out;
1282 if (iommu_pass_through) 1547 if (iommu_pass_through)
1283 break; 1548 break;
1284 detach_device(domain, devid); 1549 detach_device(dev);
1285 break; 1550 break;
1286 case BUS_NOTIFY_ADD_DEVICE: 1551 case BUS_NOTIFY_ADD_DEVICE:
1552
1553 iommu_init_device(dev);
1554
1555 domain = domain_for_device(dev);
1556
1287 /* allocate a protection domain if a device is added */ 1557 /* allocate a protection domain if a device is added */
1288 dma_domain = find_protection_domain(devid); 1558 dma_domain = find_protection_domain(devid);
1289 if (dma_domain) 1559 if (dma_domain)
1290 goto out; 1560 goto out;
1291 dma_domain = dma_ops_domain_alloc(iommu); 1561 dma_domain = dma_ops_domain_alloc();
1292 if (!dma_domain) 1562 if (!dma_domain)
1293 goto out; 1563 goto out;
1294 dma_domain->target_dev = devid; 1564 dma_domain->target_dev = devid;
@@ -1298,11 +1568,15 @@ static int device_change_notifier(struct notifier_block *nb,
1298 spin_unlock_irqrestore(&iommu_pd_list_lock, flags); 1568 spin_unlock_irqrestore(&iommu_pd_list_lock, flags);
1299 1569
1300 break; 1570 break;
1571 case BUS_NOTIFY_DEL_DEVICE:
1572
1573 iommu_uninit_device(dev);
1574
1301 default: 1575 default:
1302 goto out; 1576 goto out;
1303 } 1577 }
1304 1578
1305 iommu_queue_inv_dev_entry(iommu, devid); 1579 iommu_flush_device(dev);
1306 iommu_completion_wait(iommu); 1580 iommu_completion_wait(iommu);
1307 1581
1308out: 1582out:
@@ -1320,106 +1594,46 @@ static struct notifier_block device_nb = {
1320 *****************************************************************************/ 1594 *****************************************************************************/
1321 1595
1322/* 1596/*
1323 * This function checks if the driver got a valid device from the caller to
1324 * avoid dereferencing invalid pointers.
1325 */
1326static bool check_device(struct device *dev)
1327{
1328 if (!dev || !dev->dma_mask)
1329 return false;
1330
1331 return true;
1332}
1333
1334/*
1335 * In this function the list of preallocated protection domains is traversed to
1336 * find the domain for a specific device
1337 */
1338static struct dma_ops_domain *find_protection_domain(u16 devid)
1339{
1340 struct dma_ops_domain *entry, *ret = NULL;
1341 unsigned long flags;
1342
1343 if (list_empty(&iommu_pd_list))
1344 return NULL;
1345
1346 spin_lock_irqsave(&iommu_pd_list_lock, flags);
1347
1348 list_for_each_entry(entry, &iommu_pd_list, list) {
1349 if (entry->target_dev == devid) {
1350 ret = entry;
1351 break;
1352 }
1353 }
1354
1355 spin_unlock_irqrestore(&iommu_pd_list_lock, flags);
1356
1357 return ret;
1358}
1359
1360/*
1361 * In the dma_ops path we only have the struct device. This function 1597 * In the dma_ops path we only have the struct device. This function
1362 * finds the corresponding IOMMU, the protection domain and the 1598 * finds the corresponding IOMMU, the protection domain and the
1363 * requestor id for a given device. 1599 * requestor id for a given device.
1364 * If the device is not yet associated with a domain this is also done 1600 * If the device is not yet associated with a domain this is also done
1365 * in this function. 1601 * in this function.
1366 */ 1602 */
1367static int get_device_resources(struct device *dev, 1603static struct protection_domain *get_domain(struct device *dev)
1368 struct amd_iommu **iommu,
1369 struct protection_domain **domain,
1370 u16 *bdf)
1371{ 1604{
1605 struct protection_domain *domain;
1372 struct dma_ops_domain *dma_dom; 1606 struct dma_ops_domain *dma_dom;
1373 struct pci_dev *pcidev; 1607 u16 devid = get_device_id(dev);
1374 u16 _bdf;
1375
1376 *iommu = NULL;
1377 *domain = NULL;
1378 *bdf = 0xffff;
1379
1380 if (dev->bus != &pci_bus_type)
1381 return 0;
1382 1608
1383 pcidev = to_pci_dev(dev); 1609 if (!check_device(dev))
1384 _bdf = calc_devid(pcidev->bus->number, pcidev->devfn); 1610 return ERR_PTR(-EINVAL);
1385
1386 /* device not translated by any IOMMU in the system? */
1387 if (_bdf > amd_iommu_last_bdf)
1388 return 0;
1389 1611
1390 *bdf = amd_iommu_alias_table[_bdf]; 1612 domain = domain_for_device(dev);
1613 if (domain != NULL && !dma_ops_domain(domain))
1614 return ERR_PTR(-EBUSY);
1391 1615
1392 *iommu = amd_iommu_rlookup_table[*bdf]; 1616 if (domain != NULL)
1393 if (*iommu == NULL) 1617 return domain;
1394 return 0;
1395 *domain = domain_for_device(*bdf);
1396 if (*domain == NULL) {
1397 dma_dom = find_protection_domain(*bdf);
1398 if (!dma_dom)
1399 dma_dom = (*iommu)->default_dom;
1400 *domain = &dma_dom->domain;
1401 attach_device(*iommu, *domain, *bdf);
1402 DUMP_printk("Using protection domain %d for device %s\n",
1403 (*domain)->id, dev_name(dev));
1404 }
1405 1618
1406 if (domain_for_device(_bdf) == NULL) 1619 /* Device not bount yet - bind it */
1407 attach_device(*iommu, *domain, _bdf); 1620 dma_dom = find_protection_domain(devid);
1621 if (!dma_dom)
1622 dma_dom = amd_iommu_rlookup_table[devid]->default_dom;
1623 attach_device(dev, &dma_dom->domain);
1624 DUMP_printk("Using protection domain %d for device %s\n",
1625 dma_dom->domain.id, dev_name(dev));
1408 1626
1409 return 1; 1627 return &dma_dom->domain;
1410} 1628}
1411 1629
1412static void update_device_table(struct protection_domain *domain) 1630static void update_device_table(struct protection_domain *domain)
1413{ 1631{
1414 unsigned long flags; 1632 struct iommu_dev_data *dev_data;
1415 int i;
1416 1633
1417 for (i = 0; i <= amd_iommu_last_bdf; ++i) { 1634 list_for_each_entry(dev_data, &domain->dev_list, list) {
1418 if (amd_iommu_pd_table[i] != domain) 1635 u16 devid = get_device_id(dev_data->dev);
1419 continue; 1636 set_dte_entry(devid, domain);
1420 write_lock_irqsave(&amd_iommu_devtable_lock, flags);
1421 set_dte_entry(i, domain);
1422 write_unlock_irqrestore(&amd_iommu_devtable_lock, flags);
1423 } 1637 }
1424} 1638}
1425 1639
@@ -1429,76 +1643,13 @@ static void update_domain(struct protection_domain *domain)
1429 return; 1643 return;
1430 1644
1431 update_device_table(domain); 1645 update_device_table(domain);
1432 flush_devices_by_domain(domain); 1646 iommu_flush_domain_devices(domain);
1433 iommu_flush_domain(domain->id); 1647 iommu_flush_tlb_pde(domain);
1434 1648
1435 domain->updated = false; 1649 domain->updated = false;
1436} 1650}
1437 1651
1438/* 1652/*
1439 * This function is used to add another level to an IO page table. Adding
1440 * another level increases the size of the address space by 9 bits to a size up
1441 * to 64 bits.
1442 */
1443static bool increase_address_space(struct protection_domain *domain,
1444 gfp_t gfp)
1445{
1446 u64 *pte;
1447
1448 if (domain->mode == PAGE_MODE_6_LEVEL)
1449 /* address space already 64 bit large */
1450 return false;
1451
1452 pte = (void *)get_zeroed_page(gfp);
1453 if (!pte)
1454 return false;
1455
1456 *pte = PM_LEVEL_PDE(domain->mode,
1457 virt_to_phys(domain->pt_root));
1458 domain->pt_root = pte;
1459 domain->mode += 1;
1460 domain->updated = true;
1461
1462 return true;
1463}
1464
1465static u64 *alloc_pte(struct protection_domain *domain,
1466 unsigned long address,
1467 int end_lvl,
1468 u64 **pte_page,
1469 gfp_t gfp)
1470{
1471 u64 *pte, *page;
1472 int level;
1473
1474 while (address > PM_LEVEL_SIZE(domain->mode))
1475 increase_address_space(domain, gfp);
1476
1477 level = domain->mode - 1;
1478 pte = &domain->pt_root[PM_LEVEL_INDEX(level, address)];
1479
1480 while (level > end_lvl) {
1481 if (!IOMMU_PTE_PRESENT(*pte)) {
1482 page = (u64 *)get_zeroed_page(gfp);
1483 if (!page)
1484 return NULL;
1485 *pte = PM_LEVEL_PDE(level, virt_to_phys(page));
1486 }
1487
1488 level -= 1;
1489
1490 pte = IOMMU_PTE_PAGE(*pte);
1491
1492 if (pte_page && level == end_lvl)
1493 *pte_page = pte;
1494
1495 pte = &pte[PM_LEVEL_INDEX(level, address)];
1496 }
1497
1498 return pte;
1499}
1500
1501/*
1502 * This function fetches the PTE for a given address in the aperture 1653 * This function fetches the PTE for a given address in the aperture
1503 */ 1654 */
1504static u64* dma_ops_get_pte(struct dma_ops_domain *dom, 1655static u64* dma_ops_get_pte(struct dma_ops_domain *dom,
@@ -1528,8 +1679,7 @@ static u64* dma_ops_get_pte(struct dma_ops_domain *dom,
1528 * This is the generic map function. It maps one 4kb page at paddr to 1679 * This is the generic map function. It maps one 4kb page at paddr to
1529 * the given address in the DMA address space for the domain. 1680 * the given address in the DMA address space for the domain.
1530 */ 1681 */
1531static dma_addr_t dma_ops_domain_map(struct amd_iommu *iommu, 1682static dma_addr_t dma_ops_domain_map(struct dma_ops_domain *dom,
1532 struct dma_ops_domain *dom,
1533 unsigned long address, 1683 unsigned long address,
1534 phys_addr_t paddr, 1684 phys_addr_t paddr,
1535 int direction) 1685 int direction)
@@ -1542,7 +1692,7 @@ static dma_addr_t dma_ops_domain_map(struct amd_iommu *iommu,
1542 1692
1543 pte = dma_ops_get_pte(dom, address); 1693 pte = dma_ops_get_pte(dom, address);
1544 if (!pte) 1694 if (!pte)
1545 return bad_dma_address; 1695 return DMA_ERROR_CODE;
1546 1696
1547 __pte = paddr | IOMMU_PTE_P | IOMMU_PTE_FC; 1697 __pte = paddr | IOMMU_PTE_P | IOMMU_PTE_FC;
1548 1698
@@ -1563,8 +1713,7 @@ static dma_addr_t dma_ops_domain_map(struct amd_iommu *iommu,
1563/* 1713/*
1564 * The generic unmapping function for on page in the DMA address space. 1714 * The generic unmapping function for on page in the DMA address space.
1565 */ 1715 */
1566static void dma_ops_domain_unmap(struct amd_iommu *iommu, 1716static void dma_ops_domain_unmap(struct dma_ops_domain *dom,
1567 struct dma_ops_domain *dom,
1568 unsigned long address) 1717 unsigned long address)
1569{ 1718{
1570 struct aperture_range *aperture; 1719 struct aperture_range *aperture;
@@ -1595,7 +1744,6 @@ static void dma_ops_domain_unmap(struct amd_iommu *iommu,
1595 * Must be called with the domain lock held. 1744 * Must be called with the domain lock held.
1596 */ 1745 */
1597static dma_addr_t __map_single(struct device *dev, 1746static dma_addr_t __map_single(struct device *dev,
1598 struct amd_iommu *iommu,
1599 struct dma_ops_domain *dma_dom, 1747 struct dma_ops_domain *dma_dom,
1600 phys_addr_t paddr, 1748 phys_addr_t paddr,
1601 size_t size, 1749 size_t size,
@@ -1623,7 +1771,7 @@ static dma_addr_t __map_single(struct device *dev,
1623retry: 1771retry:
1624 address = dma_ops_alloc_addresses(dev, dma_dom, pages, align_mask, 1772 address = dma_ops_alloc_addresses(dev, dma_dom, pages, align_mask,
1625 dma_mask); 1773 dma_mask);
1626 if (unlikely(address == bad_dma_address)) { 1774 if (unlikely(address == DMA_ERROR_CODE)) {
1627 /* 1775 /*
1628 * setting next_address here will let the address 1776 * setting next_address here will let the address
1629 * allocator only scan the new allocated range in the 1777 * allocator only scan the new allocated range in the
@@ -1631,7 +1779,7 @@ retry:
1631 */ 1779 */
1632 dma_dom->next_address = dma_dom->aperture_size; 1780 dma_dom->next_address = dma_dom->aperture_size;
1633 1781
1634 if (alloc_new_range(iommu, dma_dom, false, GFP_ATOMIC)) 1782 if (alloc_new_range(dma_dom, false, GFP_ATOMIC))
1635 goto out; 1783 goto out;
1636 1784
1637 /* 1785 /*
@@ -1643,8 +1791,8 @@ retry:
1643 1791
1644 start = address; 1792 start = address;
1645 for (i = 0; i < pages; ++i) { 1793 for (i = 0; i < pages; ++i) {
1646 ret = dma_ops_domain_map(iommu, dma_dom, start, paddr, dir); 1794 ret = dma_ops_domain_map(dma_dom, start, paddr, dir);
1647 if (ret == bad_dma_address) 1795 if (ret == DMA_ERROR_CODE)
1648 goto out_unmap; 1796 goto out_unmap;
1649 1797
1650 paddr += PAGE_SIZE; 1798 paddr += PAGE_SIZE;
@@ -1655,10 +1803,10 @@ retry:
1655 ADD_STATS_COUNTER(alloced_io_mem, size); 1803 ADD_STATS_COUNTER(alloced_io_mem, size);
1656 1804
1657 if (unlikely(dma_dom->need_flush && !amd_iommu_unmap_flush)) { 1805 if (unlikely(dma_dom->need_flush && !amd_iommu_unmap_flush)) {
1658 iommu_flush_tlb(iommu, dma_dom->domain.id); 1806 iommu_flush_tlb(&dma_dom->domain);
1659 dma_dom->need_flush = false; 1807 dma_dom->need_flush = false;
1660 } else if (unlikely(iommu_has_npcache(iommu))) 1808 } else if (unlikely(amd_iommu_np_cache))
1661 iommu_flush_pages(iommu, dma_dom->domain.id, address, size); 1809 iommu_flush_pages(&dma_dom->domain, address, size);
1662 1810
1663out: 1811out:
1664 return address; 1812 return address;
@@ -1667,20 +1815,19 @@ out_unmap:
1667 1815
1668 for (--i; i >= 0; --i) { 1816 for (--i; i >= 0; --i) {
1669 start -= PAGE_SIZE; 1817 start -= PAGE_SIZE;
1670 dma_ops_domain_unmap(iommu, dma_dom, start); 1818 dma_ops_domain_unmap(dma_dom, start);
1671 } 1819 }
1672 1820
1673 dma_ops_free_addresses(dma_dom, address, pages); 1821 dma_ops_free_addresses(dma_dom, address, pages);
1674 1822
1675 return bad_dma_address; 1823 return DMA_ERROR_CODE;
1676} 1824}
1677 1825
1678/* 1826/*
1679 * Does the reverse of the __map_single function. Must be called with 1827 * Does the reverse of the __map_single function. Must be called with
1680 * the domain lock held too 1828 * the domain lock held too
1681 */ 1829 */
1682static void __unmap_single(struct amd_iommu *iommu, 1830static void __unmap_single(struct dma_ops_domain *dma_dom,
1683 struct dma_ops_domain *dma_dom,
1684 dma_addr_t dma_addr, 1831 dma_addr_t dma_addr,
1685 size_t size, 1832 size_t size,
1686 int dir) 1833 int dir)
@@ -1688,7 +1835,7 @@ static void __unmap_single(struct amd_iommu *iommu,
1688 dma_addr_t i, start; 1835 dma_addr_t i, start;
1689 unsigned int pages; 1836 unsigned int pages;
1690 1837
1691 if ((dma_addr == bad_dma_address) || 1838 if ((dma_addr == DMA_ERROR_CODE) ||
1692 (dma_addr + size > dma_dom->aperture_size)) 1839 (dma_addr + size > dma_dom->aperture_size))
1693 return; 1840 return;
1694 1841
@@ -1697,7 +1844,7 @@ static void __unmap_single(struct amd_iommu *iommu,
1697 start = dma_addr; 1844 start = dma_addr;
1698 1845
1699 for (i = 0; i < pages; ++i) { 1846 for (i = 0; i < pages; ++i) {
1700 dma_ops_domain_unmap(iommu, dma_dom, start); 1847 dma_ops_domain_unmap(dma_dom, start);
1701 start += PAGE_SIZE; 1848 start += PAGE_SIZE;
1702 } 1849 }
1703 1850
@@ -1706,7 +1853,7 @@ static void __unmap_single(struct amd_iommu *iommu,
1706 dma_ops_free_addresses(dma_dom, dma_addr, pages); 1853 dma_ops_free_addresses(dma_dom, dma_addr, pages);
1707 1854
1708 if (amd_iommu_unmap_flush || dma_dom->need_flush) { 1855 if (amd_iommu_unmap_flush || dma_dom->need_flush) {
1709 iommu_flush_pages(iommu, dma_dom->domain.id, dma_addr, size); 1856 iommu_flush_pages(&dma_dom->domain, dma_addr, size);
1710 dma_dom->need_flush = false; 1857 dma_dom->need_flush = false;
1711 } 1858 }
1712} 1859}
@@ -1720,36 +1867,29 @@ static dma_addr_t map_page(struct device *dev, struct page *page,
1720 struct dma_attrs *attrs) 1867 struct dma_attrs *attrs)
1721{ 1868{
1722 unsigned long flags; 1869 unsigned long flags;
1723 struct amd_iommu *iommu;
1724 struct protection_domain *domain; 1870 struct protection_domain *domain;
1725 u16 devid;
1726 dma_addr_t addr; 1871 dma_addr_t addr;
1727 u64 dma_mask; 1872 u64 dma_mask;
1728 phys_addr_t paddr = page_to_phys(page) + offset; 1873 phys_addr_t paddr = page_to_phys(page) + offset;
1729 1874
1730 INC_STATS_COUNTER(cnt_map_single); 1875 INC_STATS_COUNTER(cnt_map_single);
1731 1876
1732 if (!check_device(dev)) 1877 domain = get_domain(dev);
1733 return bad_dma_address; 1878 if (PTR_ERR(domain) == -EINVAL)
1734
1735 dma_mask = *dev->dma_mask;
1736
1737 get_device_resources(dev, &iommu, &domain, &devid);
1738
1739 if (iommu == NULL || domain == NULL)
1740 /* device not handled by any AMD IOMMU */
1741 return (dma_addr_t)paddr; 1879 return (dma_addr_t)paddr;
1880 else if (IS_ERR(domain))
1881 return DMA_ERROR_CODE;
1742 1882
1743 if (!dma_ops_domain(domain)) 1883 dma_mask = *dev->dma_mask;
1744 return bad_dma_address;
1745 1884
1746 spin_lock_irqsave(&domain->lock, flags); 1885 spin_lock_irqsave(&domain->lock, flags);
1747 addr = __map_single(dev, iommu, domain->priv, paddr, size, dir, false, 1886
1887 addr = __map_single(dev, domain->priv, paddr, size, dir, false,
1748 dma_mask); 1888 dma_mask);
1749 if (addr == bad_dma_address) 1889 if (addr == DMA_ERROR_CODE)
1750 goto out; 1890 goto out;
1751 1891
1752 iommu_completion_wait(iommu); 1892 iommu_flush_complete(domain);
1753 1893
1754out: 1894out:
1755 spin_unlock_irqrestore(&domain->lock, flags); 1895 spin_unlock_irqrestore(&domain->lock, flags);
@@ -1764,25 +1904,19 @@ static void unmap_page(struct device *dev, dma_addr_t dma_addr, size_t size,
1764 enum dma_data_direction dir, struct dma_attrs *attrs) 1904 enum dma_data_direction dir, struct dma_attrs *attrs)
1765{ 1905{
1766 unsigned long flags; 1906 unsigned long flags;
1767 struct amd_iommu *iommu;
1768 struct protection_domain *domain; 1907 struct protection_domain *domain;
1769 u16 devid;
1770 1908
1771 INC_STATS_COUNTER(cnt_unmap_single); 1909 INC_STATS_COUNTER(cnt_unmap_single);
1772 1910
1773 if (!check_device(dev) || 1911 domain = get_domain(dev);
1774 !get_device_resources(dev, &iommu, &domain, &devid)) 1912 if (IS_ERR(domain))
1775 /* device not handled by any AMD IOMMU */
1776 return;
1777
1778 if (!dma_ops_domain(domain))
1779 return; 1913 return;
1780 1914
1781 spin_lock_irqsave(&domain->lock, flags); 1915 spin_lock_irqsave(&domain->lock, flags);
1782 1916
1783 __unmap_single(iommu, domain->priv, dma_addr, size, dir); 1917 __unmap_single(domain->priv, dma_addr, size, dir);
1784 1918
1785 iommu_completion_wait(iommu); 1919 iommu_flush_complete(domain);
1786 1920
1787 spin_unlock_irqrestore(&domain->lock, flags); 1921 spin_unlock_irqrestore(&domain->lock, flags);
1788} 1922}
@@ -1814,9 +1948,7 @@ static int map_sg(struct device *dev, struct scatterlist *sglist,
1814 struct dma_attrs *attrs) 1948 struct dma_attrs *attrs)
1815{ 1949{
1816 unsigned long flags; 1950 unsigned long flags;
1817 struct amd_iommu *iommu;
1818 struct protection_domain *domain; 1951 struct protection_domain *domain;
1819 u16 devid;
1820 int i; 1952 int i;
1821 struct scatterlist *s; 1953 struct scatterlist *s;
1822 phys_addr_t paddr; 1954 phys_addr_t paddr;
@@ -1825,25 +1957,20 @@ static int map_sg(struct device *dev, struct scatterlist *sglist,
1825 1957
1826 INC_STATS_COUNTER(cnt_map_sg); 1958 INC_STATS_COUNTER(cnt_map_sg);
1827 1959
1828 if (!check_device(dev)) 1960 domain = get_domain(dev);
1961 if (PTR_ERR(domain) == -EINVAL)
1962 return map_sg_no_iommu(dev, sglist, nelems, dir);
1963 else if (IS_ERR(domain))
1829 return 0; 1964 return 0;
1830 1965
1831 dma_mask = *dev->dma_mask; 1966 dma_mask = *dev->dma_mask;
1832 1967
1833 get_device_resources(dev, &iommu, &domain, &devid);
1834
1835 if (!iommu || !domain)
1836 return map_sg_no_iommu(dev, sglist, nelems, dir);
1837
1838 if (!dma_ops_domain(domain))
1839 return 0;
1840
1841 spin_lock_irqsave(&domain->lock, flags); 1968 spin_lock_irqsave(&domain->lock, flags);
1842 1969
1843 for_each_sg(sglist, s, nelems, i) { 1970 for_each_sg(sglist, s, nelems, i) {
1844 paddr = sg_phys(s); 1971 paddr = sg_phys(s);
1845 1972
1846 s->dma_address = __map_single(dev, iommu, domain->priv, 1973 s->dma_address = __map_single(dev, domain->priv,
1847 paddr, s->length, dir, false, 1974 paddr, s->length, dir, false,
1848 dma_mask); 1975 dma_mask);
1849 1976
@@ -1854,7 +1981,7 @@ static int map_sg(struct device *dev, struct scatterlist *sglist,
1854 goto unmap; 1981 goto unmap;
1855 } 1982 }
1856 1983
1857 iommu_completion_wait(iommu); 1984 iommu_flush_complete(domain);
1858 1985
1859out: 1986out:
1860 spin_unlock_irqrestore(&domain->lock, flags); 1987 spin_unlock_irqrestore(&domain->lock, flags);
@@ -1863,7 +1990,7 @@ out:
1863unmap: 1990unmap:
1864 for_each_sg(sglist, s, mapped_elems, i) { 1991 for_each_sg(sglist, s, mapped_elems, i) {
1865 if (s->dma_address) 1992 if (s->dma_address)
1866 __unmap_single(iommu, domain->priv, s->dma_address, 1993 __unmap_single(domain->priv, s->dma_address,
1867 s->dma_length, dir); 1994 s->dma_length, dir);
1868 s->dma_address = s->dma_length = 0; 1995 s->dma_address = s->dma_length = 0;
1869 } 1996 }
@@ -1882,30 +2009,25 @@ static void unmap_sg(struct device *dev, struct scatterlist *sglist,
1882 struct dma_attrs *attrs) 2009 struct dma_attrs *attrs)
1883{ 2010{
1884 unsigned long flags; 2011 unsigned long flags;
1885 struct amd_iommu *iommu;
1886 struct protection_domain *domain; 2012 struct protection_domain *domain;
1887 struct scatterlist *s; 2013 struct scatterlist *s;
1888 u16 devid;
1889 int i; 2014 int i;
1890 2015
1891 INC_STATS_COUNTER(cnt_unmap_sg); 2016 INC_STATS_COUNTER(cnt_unmap_sg);
1892 2017
1893 if (!check_device(dev) || 2018 domain = get_domain(dev);
1894 !get_device_resources(dev, &iommu, &domain, &devid)) 2019 if (IS_ERR(domain))
1895 return;
1896
1897 if (!dma_ops_domain(domain))
1898 return; 2020 return;
1899 2021
1900 spin_lock_irqsave(&domain->lock, flags); 2022 spin_lock_irqsave(&domain->lock, flags);
1901 2023
1902 for_each_sg(sglist, s, nelems, i) { 2024 for_each_sg(sglist, s, nelems, i) {
1903 __unmap_single(iommu, domain->priv, s->dma_address, 2025 __unmap_single(domain->priv, s->dma_address,
1904 s->dma_length, dir); 2026 s->dma_length, dir);
1905 s->dma_address = s->dma_length = 0; 2027 s->dma_address = s->dma_length = 0;
1906 } 2028 }
1907 2029
1908 iommu_completion_wait(iommu); 2030 iommu_flush_complete(domain);
1909 2031
1910 spin_unlock_irqrestore(&domain->lock, flags); 2032 spin_unlock_irqrestore(&domain->lock, flags);
1911} 2033}
@@ -1918,49 +2040,44 @@ static void *alloc_coherent(struct device *dev, size_t size,
1918{ 2040{
1919 unsigned long flags; 2041 unsigned long flags;
1920 void *virt_addr; 2042 void *virt_addr;
1921 struct amd_iommu *iommu;
1922 struct protection_domain *domain; 2043 struct protection_domain *domain;
1923 u16 devid;
1924 phys_addr_t paddr; 2044 phys_addr_t paddr;
1925 u64 dma_mask = dev->coherent_dma_mask; 2045 u64 dma_mask = dev->coherent_dma_mask;
1926 2046
1927 INC_STATS_COUNTER(cnt_alloc_coherent); 2047 INC_STATS_COUNTER(cnt_alloc_coherent);
1928 2048
1929 if (!check_device(dev)) 2049 domain = get_domain(dev);
2050 if (PTR_ERR(domain) == -EINVAL) {
2051 virt_addr = (void *)__get_free_pages(flag, get_order(size));
2052 *dma_addr = __pa(virt_addr);
2053 return virt_addr;
2054 } else if (IS_ERR(domain))
1930 return NULL; 2055 return NULL;
1931 2056
1932 if (!get_device_resources(dev, &iommu, &domain, &devid)) 2057 dma_mask = dev->coherent_dma_mask;
1933 flag &= ~(__GFP_DMA | __GFP_HIGHMEM | __GFP_DMA32); 2058 flag &= ~(__GFP_DMA | __GFP_HIGHMEM | __GFP_DMA32);
2059 flag |= __GFP_ZERO;
1934 2060
1935 flag |= __GFP_ZERO;
1936 virt_addr = (void *)__get_free_pages(flag, get_order(size)); 2061 virt_addr = (void *)__get_free_pages(flag, get_order(size));
1937 if (!virt_addr) 2062 if (!virt_addr)
1938 return NULL; 2063 return NULL;
1939 2064
1940 paddr = virt_to_phys(virt_addr); 2065 paddr = virt_to_phys(virt_addr);
1941 2066
1942 if (!iommu || !domain) {
1943 *dma_addr = (dma_addr_t)paddr;
1944 return virt_addr;
1945 }
1946
1947 if (!dma_ops_domain(domain))
1948 goto out_free;
1949
1950 if (!dma_mask) 2067 if (!dma_mask)
1951 dma_mask = *dev->dma_mask; 2068 dma_mask = *dev->dma_mask;
1952 2069
1953 spin_lock_irqsave(&domain->lock, flags); 2070 spin_lock_irqsave(&domain->lock, flags);
1954 2071
1955 *dma_addr = __map_single(dev, iommu, domain->priv, paddr, 2072 *dma_addr = __map_single(dev, domain->priv, paddr,
1956 size, DMA_BIDIRECTIONAL, true, dma_mask); 2073 size, DMA_BIDIRECTIONAL, true, dma_mask);
1957 2074
1958 if (*dma_addr == bad_dma_address) { 2075 if (*dma_addr == DMA_ERROR_CODE) {
1959 spin_unlock_irqrestore(&domain->lock, flags); 2076 spin_unlock_irqrestore(&domain->lock, flags);
1960 goto out_free; 2077 goto out_free;
1961 } 2078 }
1962 2079
1963 iommu_completion_wait(iommu); 2080 iommu_flush_complete(domain);
1964 2081
1965 spin_unlock_irqrestore(&domain->lock, flags); 2082 spin_unlock_irqrestore(&domain->lock, flags);
1966 2083
@@ -1980,28 +2097,19 @@ static void free_coherent(struct device *dev, size_t size,
1980 void *virt_addr, dma_addr_t dma_addr) 2097 void *virt_addr, dma_addr_t dma_addr)
1981{ 2098{
1982 unsigned long flags; 2099 unsigned long flags;
1983 struct amd_iommu *iommu;
1984 struct protection_domain *domain; 2100 struct protection_domain *domain;
1985 u16 devid;
1986 2101
1987 INC_STATS_COUNTER(cnt_free_coherent); 2102 INC_STATS_COUNTER(cnt_free_coherent);
1988 2103
1989 if (!check_device(dev)) 2104 domain = get_domain(dev);
1990 return; 2105 if (IS_ERR(domain))
1991
1992 get_device_resources(dev, &iommu, &domain, &devid);
1993
1994 if (!iommu || !domain)
1995 goto free_mem;
1996
1997 if (!dma_ops_domain(domain))
1998 goto free_mem; 2106 goto free_mem;
1999 2107
2000 spin_lock_irqsave(&domain->lock, flags); 2108 spin_lock_irqsave(&domain->lock, flags);
2001 2109
2002 __unmap_single(iommu, domain->priv, dma_addr, size, DMA_BIDIRECTIONAL); 2110 __unmap_single(domain->priv, dma_addr, size, DMA_BIDIRECTIONAL);
2003 2111
2004 iommu_completion_wait(iommu); 2112 iommu_flush_complete(domain);
2005 2113
2006 spin_unlock_irqrestore(&domain->lock, flags); 2114 spin_unlock_irqrestore(&domain->lock, flags);
2007 2115
@@ -2015,22 +2123,7 @@ free_mem:
2015 */ 2123 */
2016static int amd_iommu_dma_supported(struct device *dev, u64 mask) 2124static int amd_iommu_dma_supported(struct device *dev, u64 mask)
2017{ 2125{
2018 u16 bdf; 2126 return check_device(dev);
2019 struct pci_dev *pcidev;
2020
2021 /* No device or no PCI device */
2022 if (!dev || dev->bus != &pci_bus_type)
2023 return 0;
2024
2025 pcidev = to_pci_dev(dev);
2026
2027 bdf = calc_devid(pcidev->bus->number, pcidev->devfn);
2028
2029 /* Out of our scope? */
2030 if (bdf > amd_iommu_last_bdf)
2031 return 0;
2032
2033 return 1;
2034} 2127}
2035 2128
2036/* 2129/*
@@ -2044,25 +2137,30 @@ static void prealloc_protection_domains(void)
2044{ 2137{
2045 struct pci_dev *dev = NULL; 2138 struct pci_dev *dev = NULL;
2046 struct dma_ops_domain *dma_dom; 2139 struct dma_ops_domain *dma_dom;
2047 struct amd_iommu *iommu;
2048 u16 devid; 2140 u16 devid;
2049 2141
2050 while ((dev = pci_get_device(PCI_ANY_ID, PCI_ANY_ID, dev)) != NULL) { 2142 while ((dev = pci_get_device(PCI_ANY_ID, PCI_ANY_ID, dev)) != NULL) {
2051 devid = calc_devid(dev->bus->number, dev->devfn); 2143
2052 if (devid > amd_iommu_last_bdf) 2144 /* Do we handle this device? */
2053 continue; 2145 if (!check_device(&dev->dev))
2054 devid = amd_iommu_alias_table[devid];
2055 if (domain_for_device(devid))
2056 continue; 2146 continue;
2057 iommu = amd_iommu_rlookup_table[devid]; 2147
2058 if (!iommu) 2148 iommu_init_device(&dev->dev);
2149
2150 /* Is there already any domain for it? */
2151 if (domain_for_device(&dev->dev))
2059 continue; 2152 continue;
2060 dma_dom = dma_ops_domain_alloc(iommu); 2153
2154 devid = get_device_id(&dev->dev);
2155
2156 dma_dom = dma_ops_domain_alloc();
2061 if (!dma_dom) 2157 if (!dma_dom)
2062 continue; 2158 continue;
2063 init_unity_mappings_for_device(dma_dom, devid); 2159 init_unity_mappings_for_device(dma_dom, devid);
2064 dma_dom->target_dev = devid; 2160 dma_dom->target_dev = devid;
2065 2161
2162 attach_device(&dev->dev, &dma_dom->domain);
2163
2066 list_add_tail(&dma_dom->list, &iommu_pd_list); 2164 list_add_tail(&dma_dom->list, &iommu_pd_list);
2067 } 2165 }
2068} 2166}
@@ -2091,7 +2189,7 @@ int __init amd_iommu_init_dma_ops(void)
2091 * protection domain will be assigned to the default one. 2189 * protection domain will be assigned to the default one.
2092 */ 2190 */
2093 for_each_iommu(iommu) { 2191 for_each_iommu(iommu) {
2094 iommu->default_dom = dma_ops_domain_alloc(iommu); 2192 iommu->default_dom = dma_ops_domain_alloc();
2095 if (iommu->default_dom == NULL) 2193 if (iommu->default_dom == NULL)
2096 return -ENOMEM; 2194 return -ENOMEM;
2097 iommu->default_dom->domain.flags |= PD_DEFAULT_MASK; 2195 iommu->default_dom->domain.flags |= PD_DEFAULT_MASK;
@@ -2101,15 +2199,12 @@ int __init amd_iommu_init_dma_ops(void)
2101 } 2199 }
2102 2200
2103 /* 2201 /*
2104 * If device isolation is enabled, pre-allocate the protection 2202 * Pre-allocate the protection domains for each device.
2105 * domains for each device.
2106 */ 2203 */
2107 if (amd_iommu_isolate) 2204 prealloc_protection_domains();
2108 prealloc_protection_domains();
2109 2205
2110 iommu_detected = 1; 2206 iommu_detected = 1;
2111 force_iommu = 1; 2207 swiotlb = 0;
2112 bad_dma_address = 0;
2113#ifdef CONFIG_GART_IOMMU 2208#ifdef CONFIG_GART_IOMMU
2114 gart_iommu_aperture_disabled = 1; 2209 gart_iommu_aperture_disabled = 1;
2115 gart_iommu_aperture = 0; 2210 gart_iommu_aperture = 0;
@@ -2148,14 +2243,17 @@ free_domains:
2148 2243
2149static void cleanup_domain(struct protection_domain *domain) 2244static void cleanup_domain(struct protection_domain *domain)
2150{ 2245{
2246 struct iommu_dev_data *dev_data, *next;
2151 unsigned long flags; 2247 unsigned long flags;
2152 u16 devid;
2153 2248
2154 write_lock_irqsave(&amd_iommu_devtable_lock, flags); 2249 write_lock_irqsave(&amd_iommu_devtable_lock, flags);
2155 2250
2156 for (devid = 0; devid <= amd_iommu_last_bdf; ++devid) 2251 list_for_each_entry_safe(dev_data, next, &domain->dev_list, list) {
2157 if (amd_iommu_pd_table[devid] == domain) 2252 struct device *dev = dev_data->dev;
2158 __detach_device(domain, devid); 2253
2254 do_detach(dev);
2255 atomic_set(&dev_data->bind, 0);
2256 }
2159 2257
2160 write_unlock_irqrestore(&amd_iommu_devtable_lock, flags); 2258 write_unlock_irqrestore(&amd_iommu_devtable_lock, flags);
2161} 2259}
@@ -2165,6 +2263,8 @@ static void protection_domain_free(struct protection_domain *domain)
2165 if (!domain) 2263 if (!domain)
2166 return; 2264 return;
2167 2265
2266 del_domain_from_list(domain);
2267
2168 if (domain->id) 2268 if (domain->id)
2169 domain_id_free(domain->id); 2269 domain_id_free(domain->id);
2170 2270
@@ -2183,6 +2283,9 @@ static struct protection_domain *protection_domain_alloc(void)
2183 domain->id = domain_id_alloc(); 2283 domain->id = domain_id_alloc();
2184 if (!domain->id) 2284 if (!domain->id)
2185 goto out_err; 2285 goto out_err;
2286 INIT_LIST_HEAD(&domain->dev_list);
2287
2288 add_domain_to_list(domain);
2186 2289
2187 return domain; 2290 return domain;
2188 2291
@@ -2239,26 +2342,23 @@ static void amd_iommu_domain_destroy(struct iommu_domain *dom)
2239static void amd_iommu_detach_device(struct iommu_domain *dom, 2342static void amd_iommu_detach_device(struct iommu_domain *dom,
2240 struct device *dev) 2343 struct device *dev)
2241{ 2344{
2242 struct protection_domain *domain = dom->priv; 2345 struct iommu_dev_data *dev_data = dev->archdata.iommu;
2243 struct amd_iommu *iommu; 2346 struct amd_iommu *iommu;
2244 struct pci_dev *pdev;
2245 u16 devid; 2347 u16 devid;
2246 2348
2247 if (dev->bus != &pci_bus_type) 2349 if (!check_device(dev))
2248 return; 2350 return;
2249 2351
2250 pdev = to_pci_dev(dev); 2352 devid = get_device_id(dev);
2251
2252 devid = calc_devid(pdev->bus->number, pdev->devfn);
2253 2353
2254 if (devid > 0) 2354 if (dev_data->domain != NULL)
2255 detach_device(domain, devid); 2355 detach_device(dev);
2256 2356
2257 iommu = amd_iommu_rlookup_table[devid]; 2357 iommu = amd_iommu_rlookup_table[devid];
2258 if (!iommu) 2358 if (!iommu)
2259 return; 2359 return;
2260 2360
2261 iommu_queue_inv_dev_entry(iommu, devid); 2361 iommu_flush_device(dev);
2262 iommu_completion_wait(iommu); 2362 iommu_completion_wait(iommu);
2263} 2363}
2264 2364
@@ -2266,35 +2366,30 @@ static int amd_iommu_attach_device(struct iommu_domain *dom,
2266 struct device *dev) 2366 struct device *dev)
2267{ 2367{
2268 struct protection_domain *domain = dom->priv; 2368 struct protection_domain *domain = dom->priv;
2269 struct protection_domain *old_domain; 2369 struct iommu_dev_data *dev_data;
2270 struct amd_iommu *iommu; 2370 struct amd_iommu *iommu;
2271 struct pci_dev *pdev; 2371 int ret;
2272 u16 devid; 2372 u16 devid;
2273 2373
2274 if (dev->bus != &pci_bus_type) 2374 if (!check_device(dev))
2275 return -EINVAL; 2375 return -EINVAL;
2276 2376
2277 pdev = to_pci_dev(dev); 2377 dev_data = dev->archdata.iommu;
2278 2378
2279 devid = calc_devid(pdev->bus->number, pdev->devfn); 2379 devid = get_device_id(dev);
2280
2281 if (devid >= amd_iommu_last_bdf ||
2282 devid != amd_iommu_alias_table[devid])
2283 return -EINVAL;
2284 2380
2285 iommu = amd_iommu_rlookup_table[devid]; 2381 iommu = amd_iommu_rlookup_table[devid];
2286 if (!iommu) 2382 if (!iommu)
2287 return -EINVAL; 2383 return -EINVAL;
2288 2384
2289 old_domain = domain_for_device(devid); 2385 if (dev_data->domain)
2290 if (old_domain) 2386 detach_device(dev);
2291 detach_device(old_domain, devid);
2292 2387
2293 attach_device(iommu, domain, devid); 2388 ret = attach_device(dev, domain);
2294 2389
2295 iommu_completion_wait(iommu); 2390 iommu_completion_wait(iommu);
2296 2391
2297 return 0; 2392 return ret;
2298} 2393}
2299 2394
2300static int amd_iommu_map_range(struct iommu_domain *dom, 2395static int amd_iommu_map_range(struct iommu_domain *dom,
@@ -2340,7 +2435,7 @@ static void amd_iommu_unmap_range(struct iommu_domain *dom,
2340 iova += PAGE_SIZE; 2435 iova += PAGE_SIZE;
2341 } 2436 }
2342 2437
2343 iommu_flush_domain(domain->id); 2438 iommu_flush_tlb_pde(domain);
2344} 2439}
2345 2440
2346static phys_addr_t amd_iommu_iova_to_phys(struct iommu_domain *dom, 2441static phys_addr_t amd_iommu_iova_to_phys(struct iommu_domain *dom,
@@ -2391,8 +2486,9 @@ static struct iommu_ops amd_iommu_ops = {
2391 2486
2392int __init amd_iommu_init_passthrough(void) 2487int __init amd_iommu_init_passthrough(void)
2393{ 2488{
2489 struct amd_iommu *iommu;
2394 struct pci_dev *dev = NULL; 2490 struct pci_dev *dev = NULL;
2395 u16 devid, devid2; 2491 u16 devid;
2396 2492
2397 /* allocate passthroug domain */ 2493 /* allocate passthroug domain */
2398 pt_domain = protection_domain_alloc(); 2494 pt_domain = protection_domain_alloc();
@@ -2402,20 +2498,17 @@ int __init amd_iommu_init_passthrough(void)
2402 pt_domain->mode |= PAGE_MODE_NONE; 2498 pt_domain->mode |= PAGE_MODE_NONE;
2403 2499
2404 while ((dev = pci_get_device(PCI_ANY_ID, PCI_ANY_ID, dev)) != NULL) { 2500 while ((dev = pci_get_device(PCI_ANY_ID, PCI_ANY_ID, dev)) != NULL) {
2405 struct amd_iommu *iommu;
2406 2501
2407 devid = calc_devid(dev->bus->number, dev->devfn); 2502 if (!check_device(&dev->dev))
2408 if (devid > amd_iommu_last_bdf)
2409 continue; 2503 continue;
2410 2504
2411 devid2 = amd_iommu_alias_table[devid]; 2505 devid = get_device_id(&dev->dev);
2412 2506
2413 iommu = amd_iommu_rlookup_table[devid2]; 2507 iommu = amd_iommu_rlookup_table[devid];
2414 if (!iommu) 2508 if (!iommu)
2415 continue; 2509 continue;
2416 2510
2417 __attach_device(iommu, pt_domain, devid); 2511 attach_device(&dev->dev, pt_domain);
2418 __attach_device(iommu, pt_domain, devid2);
2419 } 2512 }
2420 2513
2421 pr_info("AMD-Vi: Initialized for Passthrough Mode\n"); 2514 pr_info("AMD-Vi: Initialized for Passthrough Mode\n");
diff --git a/arch/x86/kernel/amd_iommu_init.c b/arch/x86/kernel/amd_iommu_init.c
index b4b61d462dcc..7ffc39965233 100644
--- a/arch/x86/kernel/amd_iommu_init.c
+++ b/arch/x86/kernel/amd_iommu_init.c
@@ -1,5 +1,5 @@
1/* 1/*
2 * Copyright (C) 2007-2008 Advanced Micro Devices, Inc. 2 * Copyright (C) 2007-2009 Advanced Micro Devices, Inc.
3 * Author: Joerg Roedel <joerg.roedel@amd.com> 3 * Author: Joerg Roedel <joerg.roedel@amd.com>
4 * Leo Duran <leo.duran@amd.com> 4 * Leo Duran <leo.duran@amd.com>
5 * 5 *
@@ -25,10 +25,12 @@
25#include <linux/interrupt.h> 25#include <linux/interrupt.h>
26#include <linux/msi.h> 26#include <linux/msi.h>
27#include <asm/pci-direct.h> 27#include <asm/pci-direct.h>
28#include <asm/amd_iommu_proto.h>
28#include <asm/amd_iommu_types.h> 29#include <asm/amd_iommu_types.h>
29#include <asm/amd_iommu.h> 30#include <asm/amd_iommu.h>
30#include <asm/iommu.h> 31#include <asm/iommu.h>
31#include <asm/gart.h> 32#include <asm/gart.h>
33#include <asm/x86_init.h>
32 34
33/* 35/*
34 * definitions for the ACPI scanning code 36 * definitions for the ACPI scanning code
@@ -123,18 +125,24 @@ u16 amd_iommu_last_bdf; /* largest PCI device id we have
123 to handle */ 125 to handle */
124LIST_HEAD(amd_iommu_unity_map); /* a list of required unity mappings 126LIST_HEAD(amd_iommu_unity_map); /* a list of required unity mappings
125 we find in ACPI */ 127 we find in ACPI */
126#ifdef CONFIG_IOMMU_STRESS
127bool amd_iommu_isolate = false;
128#else
129bool amd_iommu_isolate = true; /* if true, device isolation is
130 enabled */
131#endif
132
133bool amd_iommu_unmap_flush; /* if true, flush on every unmap */ 128bool amd_iommu_unmap_flush; /* if true, flush on every unmap */
134 129
135LIST_HEAD(amd_iommu_list); /* list of all AMD IOMMUs in the 130LIST_HEAD(amd_iommu_list); /* list of all AMD IOMMUs in the
136 system */ 131 system */
137 132
133/* Array to assign indices to IOMMUs*/
134struct amd_iommu *amd_iommus[MAX_IOMMUS];
135int amd_iommus_present;
136
137/* IOMMUs have a non-present cache? */
138bool amd_iommu_np_cache __read_mostly;
139
140/*
141 * List of protection domains - used during resume
142 */
143LIST_HEAD(amd_iommu_pd_list);
144spinlock_t amd_iommu_pd_lock;
145
138/* 146/*
139 * Pointer to the device table which is shared by all AMD IOMMUs 147 * Pointer to the device table which is shared by all AMD IOMMUs
140 * it is indexed by the PCI device id or the HT unit id and contains 148 * it is indexed by the PCI device id or the HT unit id and contains
@@ -157,12 +165,6 @@ u16 *amd_iommu_alias_table;
157struct amd_iommu **amd_iommu_rlookup_table; 165struct amd_iommu **amd_iommu_rlookup_table;
158 166
159/* 167/*
160 * The pd table (protection domain table) is used to find the protection domain
161 * data structure a device belongs to. Indexed with the PCI device id too.
162 */
163struct protection_domain **amd_iommu_pd_table;
164
165/*
166 * AMD IOMMU allows up to 2^16 differend protection domains. This is a bitmap 168 * AMD IOMMU allows up to 2^16 differend protection domains. This is a bitmap
167 * to know which ones are already in use. 169 * to know which ones are already in use.
168 */ 170 */
@@ -240,7 +242,7 @@ static void iommu_feature_enable(struct amd_iommu *iommu, u8 bit)
240 writel(ctrl, iommu->mmio_base + MMIO_CONTROL_OFFSET); 242 writel(ctrl, iommu->mmio_base + MMIO_CONTROL_OFFSET);
241} 243}
242 244
243static void __init iommu_feature_disable(struct amd_iommu *iommu, u8 bit) 245static void iommu_feature_disable(struct amd_iommu *iommu, u8 bit)
244{ 246{
245 u32 ctrl; 247 u32 ctrl;
246 248
@@ -519,6 +521,26 @@ static void set_dev_entry_bit(u16 devid, u8 bit)
519 amd_iommu_dev_table[devid].data[i] |= (1 << _bit); 521 amd_iommu_dev_table[devid].data[i] |= (1 << _bit);
520} 522}
521 523
524static int get_dev_entry_bit(u16 devid, u8 bit)
525{
526 int i = (bit >> 5) & 0x07;
527 int _bit = bit & 0x1f;
528
529 return (amd_iommu_dev_table[devid].data[i] & (1 << _bit)) >> _bit;
530}
531
532
533void amd_iommu_apply_erratum_63(u16 devid)
534{
535 int sysmgt;
536
537 sysmgt = get_dev_entry_bit(devid, DEV_ENTRY_SYSMGT1) |
538 (get_dev_entry_bit(devid, DEV_ENTRY_SYSMGT2) << 1);
539
540 if (sysmgt == 0x01)
541 set_dev_entry_bit(devid, DEV_ENTRY_IW);
542}
543
522/* Writes the specific IOMMU for a device into the rlookup table */ 544/* Writes the specific IOMMU for a device into the rlookup table */
523static void __init set_iommu_for_device(struct amd_iommu *iommu, u16 devid) 545static void __init set_iommu_for_device(struct amd_iommu *iommu, u16 devid)
524{ 546{
@@ -547,6 +569,8 @@ static void __init set_dev_entry_from_acpi(struct amd_iommu *iommu,
547 if (flags & ACPI_DEVFLAG_LINT1) 569 if (flags & ACPI_DEVFLAG_LINT1)
548 set_dev_entry_bit(devid, DEV_ENTRY_LINT1_PASS); 570 set_dev_entry_bit(devid, DEV_ENTRY_LINT1_PASS);
549 571
572 amd_iommu_apply_erratum_63(devid);
573
550 set_iommu_for_device(iommu, devid); 574 set_iommu_for_device(iommu, devid);
551} 575}
552 576
@@ -816,7 +840,18 @@ static void __init free_iommu_all(void)
816static int __init init_iommu_one(struct amd_iommu *iommu, struct ivhd_header *h) 840static int __init init_iommu_one(struct amd_iommu *iommu, struct ivhd_header *h)
817{ 841{
818 spin_lock_init(&iommu->lock); 842 spin_lock_init(&iommu->lock);
843
844 /* Add IOMMU to internal data structures */
819 list_add_tail(&iommu->list, &amd_iommu_list); 845 list_add_tail(&iommu->list, &amd_iommu_list);
846 iommu->index = amd_iommus_present++;
847
848 if (unlikely(iommu->index >= MAX_IOMMUS)) {
849 WARN(1, "AMD-Vi: System has more IOMMUs than supported by this driver\n");
850 return -ENOSYS;
851 }
852
853 /* Index is fine - add IOMMU to the array */
854 amd_iommus[iommu->index] = iommu;
820 855
821 /* 856 /*
822 * Copy data from ACPI table entry to the iommu struct 857 * Copy data from ACPI table entry to the iommu struct
@@ -846,6 +881,9 @@ static int __init init_iommu_one(struct amd_iommu *iommu, struct ivhd_header *h)
846 init_iommu_from_acpi(iommu, h); 881 init_iommu_from_acpi(iommu, h);
847 init_iommu_devices(iommu); 882 init_iommu_devices(iommu);
848 883
884 if (iommu->cap & (1UL << IOMMU_CAP_NPCACHE))
885 amd_iommu_np_cache = true;
886
849 return pci_enable_device(iommu->dev); 887 return pci_enable_device(iommu->dev);
850} 888}
851 889
@@ -903,7 +941,7 @@ static int __init init_iommu_all(struct acpi_table_header *table)
903 * 941 *
904 ****************************************************************************/ 942 ****************************************************************************/
905 943
906static int __init iommu_setup_msi(struct amd_iommu *iommu) 944static int iommu_setup_msi(struct amd_iommu *iommu)
907{ 945{
908 int r; 946 int r;
909 947
@@ -1154,19 +1192,10 @@ static struct sys_device device_amd_iommu = {
1154 * functions. Finally it prints some information about AMD IOMMUs and 1192 * functions. Finally it prints some information about AMD IOMMUs and
1155 * the driver state and enables the hardware. 1193 * the driver state and enables the hardware.
1156 */ 1194 */
1157int __init amd_iommu_init(void) 1195static int __init amd_iommu_init(void)
1158{ 1196{
1159 int i, ret = 0; 1197 int i, ret = 0;
1160 1198
1161
1162 if (no_iommu) {
1163 printk(KERN_INFO "AMD-Vi disabled by kernel command line\n");
1164 return 0;
1165 }
1166
1167 if (!amd_iommu_detected)
1168 return -ENODEV;
1169
1170 /* 1199 /*
1171 * First parse ACPI tables to find the largest Bus/Dev/Func 1200 * First parse ACPI tables to find the largest Bus/Dev/Func
1172 * we need to handle. Upon this information the shared data 1201 * we need to handle. Upon this information the shared data
@@ -1203,15 +1232,6 @@ int __init amd_iommu_init(void)
1203 if (amd_iommu_rlookup_table == NULL) 1232 if (amd_iommu_rlookup_table == NULL)
1204 goto free; 1233 goto free;
1205 1234
1206 /*
1207 * Protection Domain table - maps devices to protection domains
1208 * This table has the same size as the rlookup_table
1209 */
1210 amd_iommu_pd_table = (void *)__get_free_pages(GFP_KERNEL | __GFP_ZERO,
1211 get_order(rlookup_table_size));
1212 if (amd_iommu_pd_table == NULL)
1213 goto free;
1214
1215 amd_iommu_pd_alloc_bitmap = (void *)__get_free_pages( 1235 amd_iommu_pd_alloc_bitmap = (void *)__get_free_pages(
1216 GFP_KERNEL | __GFP_ZERO, 1236 GFP_KERNEL | __GFP_ZERO,
1217 get_order(MAX_DOMAIN_ID/8)); 1237 get_order(MAX_DOMAIN_ID/8));
@@ -1233,6 +1253,8 @@ int __init amd_iommu_init(void)
1233 */ 1253 */
1234 amd_iommu_pd_alloc_bitmap[0] = 1; 1254 amd_iommu_pd_alloc_bitmap[0] = 1;
1235 1255
1256 spin_lock_init(&amd_iommu_pd_lock);
1257
1236 /* 1258 /*
1237 * now the data structures are allocated and basically initialized 1259 * now the data structures are allocated and basically initialized
1238 * start the real acpi table scan 1260 * start the real acpi table scan
@@ -1264,17 +1286,12 @@ int __init amd_iommu_init(void)
1264 if (iommu_pass_through) 1286 if (iommu_pass_through)
1265 goto out; 1287 goto out;
1266 1288
1267 printk(KERN_INFO "AMD-Vi: device isolation ");
1268 if (amd_iommu_isolate)
1269 printk("enabled\n");
1270 else
1271 printk("disabled\n");
1272
1273 if (amd_iommu_unmap_flush) 1289 if (amd_iommu_unmap_flush)
1274 printk(KERN_INFO "AMD-Vi: IO/TLB flush on unmap enabled\n"); 1290 printk(KERN_INFO "AMD-Vi: IO/TLB flush on unmap enabled\n");
1275 else 1291 else
1276 printk(KERN_INFO "AMD-Vi: Lazy IO/TLB flushing enabled\n"); 1292 printk(KERN_INFO "AMD-Vi: Lazy IO/TLB flushing enabled\n");
1277 1293
1294 x86_platform.iommu_shutdown = disable_iommus;
1278out: 1295out:
1279 return ret; 1296 return ret;
1280 1297
@@ -1282,9 +1299,6 @@ free:
1282 free_pages((unsigned long)amd_iommu_pd_alloc_bitmap, 1299 free_pages((unsigned long)amd_iommu_pd_alloc_bitmap,
1283 get_order(MAX_DOMAIN_ID/8)); 1300 get_order(MAX_DOMAIN_ID/8));
1284 1301
1285 free_pages((unsigned long)amd_iommu_pd_table,
1286 get_order(rlookup_table_size));
1287
1288 free_pages((unsigned long)amd_iommu_rlookup_table, 1302 free_pages((unsigned long)amd_iommu_rlookup_table,
1289 get_order(rlookup_table_size)); 1303 get_order(rlookup_table_size));
1290 1304
@@ -1301,11 +1315,6 @@ free:
1301 goto out; 1315 goto out;
1302} 1316}
1303 1317
1304void amd_iommu_shutdown(void)
1305{
1306 disable_iommus();
1307}
1308
1309/**************************************************************************** 1318/****************************************************************************
1310 * 1319 *
1311 * Early detect code. This code runs at IOMMU detection time in the DMA 1320 * Early detect code. This code runs at IOMMU detection time in the DMA
@@ -1320,16 +1329,13 @@ static int __init early_amd_iommu_detect(struct acpi_table_header *table)
1320 1329
1321void __init amd_iommu_detect(void) 1330void __init amd_iommu_detect(void)
1322{ 1331{
1323 if (swiotlb || no_iommu || (iommu_detected && !gart_iommu_aperture)) 1332 if (no_iommu || (iommu_detected && !gart_iommu_aperture))
1324 return; 1333 return;
1325 1334
1326 if (acpi_table_parse("IVRS", early_amd_iommu_detect) == 0) { 1335 if (acpi_table_parse("IVRS", early_amd_iommu_detect) == 0) {
1327 iommu_detected = 1; 1336 iommu_detected = 1;
1328 amd_iommu_detected = 1; 1337 amd_iommu_detected = 1;
1329#ifdef CONFIG_GART_IOMMU 1338 x86_init.iommu.iommu_init = amd_iommu_init;
1330 gart_iommu_aperture_disabled = 1;
1331 gart_iommu_aperture = 0;
1332#endif
1333 } 1339 }
1334} 1340}
1335 1341
@@ -1350,10 +1356,6 @@ static int __init parse_amd_iommu_dump(char *str)
1350static int __init parse_amd_iommu_options(char *str) 1356static int __init parse_amd_iommu_options(char *str)
1351{ 1357{
1352 for (; *str; ++str) { 1358 for (; *str; ++str) {
1353 if (strncmp(str, "isolate", 7) == 0)
1354 amd_iommu_isolate = true;
1355 if (strncmp(str, "share", 5) == 0)
1356 amd_iommu_isolate = false;
1357 if (strncmp(str, "fullflush", 9) == 0) 1359 if (strncmp(str, "fullflush", 9) == 0)
1358 amd_iommu_unmap_flush = true; 1360 amd_iommu_unmap_flush = true;
1359 } 1361 }
diff --git a/arch/x86/kernel/aperture_64.c b/arch/x86/kernel/aperture_64.c
index 128111d8ffe0..e0dfb6856aa2 100644
--- a/arch/x86/kernel/aperture_64.c
+++ b/arch/x86/kernel/aperture_64.c
@@ -28,6 +28,7 @@
28#include <asm/pci-direct.h> 28#include <asm/pci-direct.h>
29#include <asm/dma.h> 29#include <asm/dma.h>
30#include <asm/k8.h> 30#include <asm/k8.h>
31#include <asm/x86_init.h>
31 32
32int gart_iommu_aperture; 33int gart_iommu_aperture;
33int gart_iommu_aperture_disabled __initdata; 34int gart_iommu_aperture_disabled __initdata;
@@ -400,6 +401,7 @@ void __init gart_iommu_hole_init(void)
400 401
401 iommu_detected = 1; 402 iommu_detected = 1;
402 gart_iommu_aperture = 1; 403 gart_iommu_aperture = 1;
404 x86_init.iommu.iommu_init = gart_iommu_init;
403 405
404 aper_order = (read_pci_config(bus, slot, 3, AMD64_GARTAPERTURECTL) >> 1) & 7; 406 aper_order = (read_pci_config(bus, slot, 3, AMD64_GARTAPERTURECTL) >> 1) & 7;
405 aper_size = (32 * 1024 * 1024) << aper_order; 407 aper_size = (32 * 1024 * 1024) << aper_order;
@@ -456,7 +458,7 @@ out:
456 458
457 if (aper_alloc) { 459 if (aper_alloc) {
458 /* Got the aperture from the AGP bridge */ 460 /* Got the aperture from the AGP bridge */
459 } else if (swiotlb && !valid_agp) { 461 } else if (!valid_agp) {
460 /* Do nothing */ 462 /* Do nothing */
461 } else if ((!no_iommu && max_pfn > MAX_DMA32_PFN) || 463 } else if ((!no_iommu && max_pfn > MAX_DMA32_PFN) ||
462 force_iommu || 464 force_iommu ||
diff --git a/arch/x86/kernel/apic/Makefile b/arch/x86/kernel/apic/Makefile
index da7b7b9f8bd8..565c1bfc507d 100644
--- a/arch/x86/kernel/apic/Makefile
+++ b/arch/x86/kernel/apic/Makefile
@@ -2,7 +2,7 @@
2# Makefile for local APIC drivers and for the IO-APIC code 2# Makefile for local APIC drivers and for the IO-APIC code
3# 3#
4 4
5obj-$(CONFIG_X86_LOCAL_APIC) += apic.o probe_$(BITS).o ipi.o nmi.o 5obj-$(CONFIG_X86_LOCAL_APIC) += apic.o apic_noop.o probe_$(BITS).o ipi.o nmi.o
6obj-$(CONFIG_X86_IO_APIC) += io_apic.o 6obj-$(CONFIG_X86_IO_APIC) += io_apic.o
7obj-$(CONFIG_SMP) += ipi.o 7obj-$(CONFIG_SMP) += ipi.o
8 8
diff --git a/arch/x86/kernel/apic/apic.c b/arch/x86/kernel/apic/apic.c
index 894aa97f0717..ad8c75b9e453 100644
--- a/arch/x86/kernel/apic/apic.c
+++ b/arch/x86/kernel/apic/apic.c
@@ -241,28 +241,13 @@ static int modern_apic(void)
241} 241}
242 242
243/* 243/*
244 * bare function to substitute write operation 244 * right after this call apic become NOOP driven
245 * and it's _that_ fast :) 245 * so apic->write/read doesn't do anything
246 */
247static void native_apic_write_dummy(u32 reg, u32 v)
248{
249 WARN_ON_ONCE((cpu_has_apic || !disable_apic));
250}
251
252static u32 native_apic_read_dummy(u32 reg)
253{
254 WARN_ON_ONCE((cpu_has_apic && !disable_apic));
255 return 0;
256}
257
258/*
259 * right after this call apic->write/read doesn't do anything
260 * note that there is no restore operation it works one way
261 */ 246 */
262void apic_disable(void) 247void apic_disable(void)
263{ 248{
264 apic->read = native_apic_read_dummy; 249 pr_info("APIC: switched to apic NOOP\n");
265 apic->write = native_apic_write_dummy; 250 apic = &apic_noop;
266} 251}
267 252
268void native_apic_wait_icr_idle(void) 253void native_apic_wait_icr_idle(void)
@@ -459,7 +444,7 @@ static void lapic_timer_setup(enum clock_event_mode mode,
459 v = apic_read(APIC_LVTT); 444 v = apic_read(APIC_LVTT);
460 v |= (APIC_LVT_MASKED | LOCAL_TIMER_VECTOR); 445 v |= (APIC_LVT_MASKED | LOCAL_TIMER_VECTOR);
461 apic_write(APIC_LVTT, v); 446 apic_write(APIC_LVTT, v);
462 apic_write(APIC_TMICT, 0xffffffff); 447 apic_write(APIC_TMICT, 0);
463 break; 448 break;
464 case CLOCK_EVT_MODE_RESUME: 449 case CLOCK_EVT_MODE_RESUME:
465 /* Nothing to do here */ 450 /* Nothing to do here */
@@ -1392,14 +1377,11 @@ void __init enable_IR_x2apic(void)
1392 unsigned long flags; 1377 unsigned long flags;
1393 struct IO_APIC_route_entry **ioapic_entries = NULL; 1378 struct IO_APIC_route_entry **ioapic_entries = NULL;
1394 int ret, x2apic_enabled = 0; 1379 int ret, x2apic_enabled = 0;
1395 int dmar_table_init_ret = 0; 1380 int dmar_table_init_ret;
1396 1381
1397#ifdef CONFIG_INTR_REMAP
1398 dmar_table_init_ret = dmar_table_init(); 1382 dmar_table_init_ret = dmar_table_init();
1399 if (dmar_table_init_ret) 1383 if (dmar_table_init_ret && !x2apic_supported())
1400 pr_debug("dmar_table_init() failed with %d:\n", 1384 return;
1401 dmar_table_init_ret);
1402#endif
1403 1385
1404 ioapic_entries = alloc_ioapic_entries(); 1386 ioapic_entries = alloc_ioapic_entries();
1405 if (!ioapic_entries) { 1387 if (!ioapic_entries) {
diff --git a/arch/x86/kernel/apic/apic_noop.c b/arch/x86/kernel/apic/apic_noop.c
new file mode 100644
index 000000000000..d9acc3bee0f4
--- /dev/null
+++ b/arch/x86/kernel/apic/apic_noop.c
@@ -0,0 +1,200 @@
1/*
2 * NOOP APIC driver.
3 *
4 * Does almost nothing and should be substituted by a real apic driver via
5 * probe routine.
6 *
7 * Though in case if apic is disabled (for some reason) we try
8 * to not uglify the caller's code and allow to call (some) apic routines
9 * like self-ipi, etc...
10 */
11
12#include <linux/threads.h>
13#include <linux/cpumask.h>
14#include <linux/module.h>
15#include <linux/string.h>
16#include <linux/kernel.h>
17#include <linux/ctype.h>
18#include <linux/init.h>
19#include <linux/errno.h>
20#include <asm/fixmap.h>
21#include <asm/mpspec.h>
22#include <asm/apicdef.h>
23#include <asm/apic.h>
24#include <asm/setup.h>
25
26#include <linux/smp.h>
27#include <asm/ipi.h>
28
29#include <linux/interrupt.h>
30#include <asm/acpi.h>
31#include <asm/e820.h>
32
33static void noop_init_apic_ldr(void) { }
34static void noop_send_IPI_mask(const struct cpumask *cpumask, int vector) { }
35static void noop_send_IPI_mask_allbutself(const struct cpumask *cpumask, int vector) { }
36static void noop_send_IPI_allbutself(int vector) { }
37static void noop_send_IPI_all(int vector) { }
38static void noop_send_IPI_self(int vector) { }
39static void noop_apic_wait_icr_idle(void) { }
40static void noop_apic_icr_write(u32 low, u32 id) { }
41
42static int noop_wakeup_secondary_cpu(int apicid, unsigned long start_eip)
43{
44 return -1;
45}
46
47static u32 noop_safe_apic_wait_icr_idle(void)
48{
49 return 0;
50}
51
52static u64 noop_apic_icr_read(void)
53{
54 return 0;
55}
56
57static int noop_cpu_to_logical_apicid(int cpu)
58{
59 return 0;
60}
61
62static int noop_phys_pkg_id(int cpuid_apic, int index_msb)
63{
64 return 0;
65}
66
67static unsigned int noop_get_apic_id(unsigned long x)
68{
69 return 0;
70}
71
72static int noop_probe(void)
73{
74 /*
75 * NOOP apic should not ever be
76 * enabled via probe routine
77 */
78 return 0;
79}
80
81static int noop_apic_id_registered(void)
82{
83 /*
84 * if we would be really "pedantic"
85 * we should pass read_apic_id() here
86 * but since NOOP suppose APIC ID = 0
87 * lets save a few cycles
88 */
89 return physid_isset(0, phys_cpu_present_map);
90}
91
92static const struct cpumask *noop_target_cpus(void)
93{
94 /* only BSP here */
95 return cpumask_of(0);
96}
97
98static unsigned long noop_check_apicid_used(physid_mask_t *map, int apicid)
99{
100 return physid_isset(apicid, *map);
101}
102
103static unsigned long noop_check_apicid_present(int bit)
104{
105 return physid_isset(bit, phys_cpu_present_map);
106}
107
108static void noop_vector_allocation_domain(int cpu, struct cpumask *retmask)
109{
110 if (cpu != 0)
111 pr_warning("APIC: Vector allocated for non-BSP cpu\n");
112 cpumask_clear(retmask);
113 cpumask_set_cpu(cpu, retmask);
114}
115
116int noop_apicid_to_node(int logical_apicid)
117{
118 /* we're always on node 0 */
119 return 0;
120}
121
122static u32 noop_apic_read(u32 reg)
123{
124 WARN_ON_ONCE((cpu_has_apic && !disable_apic));
125 return 0;
126}
127
128static void noop_apic_write(u32 reg, u32 v)
129{
130 WARN_ON_ONCE((cpu_has_apic || !disable_apic));
131}
132
133struct apic apic_noop = {
134 .name = "noop",
135 .probe = noop_probe,
136 .acpi_madt_oem_check = NULL,
137
138 .apic_id_registered = noop_apic_id_registered,
139
140 .irq_delivery_mode = dest_LowestPrio,
141 /* logical delivery broadcast to all CPUs: */
142 .irq_dest_mode = 1,
143
144 .target_cpus = noop_target_cpus,
145 .disable_esr = 0,
146 .dest_logical = APIC_DEST_LOGICAL,
147 .check_apicid_used = noop_check_apicid_used,
148 .check_apicid_present = noop_check_apicid_present,
149
150 .vector_allocation_domain = noop_vector_allocation_domain,
151 .init_apic_ldr = noop_init_apic_ldr,
152
153 .ioapic_phys_id_map = default_ioapic_phys_id_map,
154 .setup_apic_routing = NULL,
155 .multi_timer_check = NULL,
156 .apicid_to_node = noop_apicid_to_node,
157
158 .cpu_to_logical_apicid = noop_cpu_to_logical_apicid,
159 .cpu_present_to_apicid = default_cpu_present_to_apicid,
160 .apicid_to_cpu_present = physid_set_mask_of_physid,
161
162 .setup_portio_remap = NULL,
163 .check_phys_apicid_present = default_check_phys_apicid_present,
164 .enable_apic_mode = NULL,
165
166 .phys_pkg_id = noop_phys_pkg_id,
167
168 .mps_oem_check = NULL,
169
170 .get_apic_id = noop_get_apic_id,
171 .set_apic_id = NULL,
172 .apic_id_mask = 0x0F << 24,
173
174 .cpu_mask_to_apicid = default_cpu_mask_to_apicid,
175 .cpu_mask_to_apicid_and = default_cpu_mask_to_apicid_and,
176
177 .send_IPI_mask = noop_send_IPI_mask,
178 .send_IPI_mask_allbutself = noop_send_IPI_mask_allbutself,
179 .send_IPI_allbutself = noop_send_IPI_allbutself,
180 .send_IPI_all = noop_send_IPI_all,
181 .send_IPI_self = noop_send_IPI_self,
182
183 .wakeup_secondary_cpu = noop_wakeup_secondary_cpu,
184
185 /* should be safe */
186 .trampoline_phys_low = DEFAULT_TRAMPOLINE_PHYS_LOW,
187 .trampoline_phys_high = DEFAULT_TRAMPOLINE_PHYS_HIGH,
188
189 .wait_for_init_deassert = NULL,
190
191 .smp_callin_clear_local_apic = NULL,
192 .inquire_remote_apic = NULL,
193
194 .read = noop_apic_read,
195 .write = noop_apic_write,
196 .icr_read = noop_apic_icr_read,
197 .icr_write = noop_apic_icr_write,
198 .wait_icr_idle = noop_apic_wait_icr_idle,
199 .safe_wait_icr_idle = noop_safe_apic_wait_icr_idle,
200};
diff --git a/arch/x86/kernel/apic/bigsmp_32.c b/arch/x86/kernel/apic/bigsmp_32.c
index 77a06413b6b2..38dcecfa5818 100644
--- a/arch/x86/kernel/apic/bigsmp_32.c
+++ b/arch/x86/kernel/apic/bigsmp_32.c
@@ -35,7 +35,7 @@ static const struct cpumask *bigsmp_target_cpus(void)
35#endif 35#endif
36} 36}
37 37
38static unsigned long bigsmp_check_apicid_used(physid_mask_t bitmap, int apicid) 38static unsigned long bigsmp_check_apicid_used(physid_mask_t *map, int apicid)
39{ 39{
40 return 0; 40 return 0;
41} 41}
@@ -93,11 +93,6 @@ static int bigsmp_cpu_present_to_apicid(int mps_cpu)
93 return BAD_APICID; 93 return BAD_APICID;
94} 94}
95 95
96static physid_mask_t bigsmp_apicid_to_cpu_present(int phys_apicid)
97{
98 return physid_mask_of_physid(phys_apicid);
99}
100
101/* Mapping from cpu number to logical apicid */ 96/* Mapping from cpu number to logical apicid */
102static inline int bigsmp_cpu_to_logical_apicid(int cpu) 97static inline int bigsmp_cpu_to_logical_apicid(int cpu)
103{ 98{
@@ -106,10 +101,10 @@ static inline int bigsmp_cpu_to_logical_apicid(int cpu)
106 return cpu_physical_id(cpu); 101 return cpu_physical_id(cpu);
107} 102}
108 103
109static physid_mask_t bigsmp_ioapic_phys_id_map(physid_mask_t phys_map) 104static void bigsmp_ioapic_phys_id_map(physid_mask_t *phys_map, physid_mask_t *retmap)
110{ 105{
111 /* For clustered we don't have a good way to do this yet - hack */ 106 /* For clustered we don't have a good way to do this yet - hack */
112 return physids_promote(0xFFL); 107 physids_promote(0xFFL, retmap);
113} 108}
114 109
115static int bigsmp_check_phys_apicid_present(int phys_apicid) 110static int bigsmp_check_phys_apicid_present(int phys_apicid)
@@ -230,7 +225,7 @@ struct apic apic_bigsmp = {
230 .apicid_to_node = bigsmp_apicid_to_node, 225 .apicid_to_node = bigsmp_apicid_to_node,
231 .cpu_to_logical_apicid = bigsmp_cpu_to_logical_apicid, 226 .cpu_to_logical_apicid = bigsmp_cpu_to_logical_apicid,
232 .cpu_present_to_apicid = bigsmp_cpu_present_to_apicid, 227 .cpu_present_to_apicid = bigsmp_cpu_present_to_apicid,
233 .apicid_to_cpu_present = bigsmp_apicid_to_cpu_present, 228 .apicid_to_cpu_present = physid_set_mask_of_physid,
234 .setup_portio_remap = NULL, 229 .setup_portio_remap = NULL,
235 .check_phys_apicid_present = bigsmp_check_phys_apicid_present, 230 .check_phys_apicid_present = bigsmp_check_phys_apicid_present,
236 .enable_apic_mode = NULL, 231 .enable_apic_mode = NULL,
diff --git a/arch/x86/kernel/apic/es7000_32.c b/arch/x86/kernel/apic/es7000_32.c
index 89174f847b49..e85f8fb7f8e7 100644
--- a/arch/x86/kernel/apic/es7000_32.c
+++ b/arch/x86/kernel/apic/es7000_32.c
@@ -466,11 +466,11 @@ static const struct cpumask *es7000_target_cpus(void)
466 return cpumask_of(smp_processor_id()); 466 return cpumask_of(smp_processor_id());
467} 467}
468 468
469static unsigned long 469static unsigned long es7000_check_apicid_used(physid_mask_t *map, int apicid)
470es7000_check_apicid_used(physid_mask_t bitmap, int apicid)
471{ 470{
472 return 0; 471 return 0;
473} 472}
473
474static unsigned long es7000_check_apicid_present(int bit) 474static unsigned long es7000_check_apicid_present(int bit)
475{ 475{
476 return physid_isset(bit, phys_cpu_present_map); 476 return physid_isset(bit, phys_cpu_present_map);
@@ -539,14 +539,10 @@ static int es7000_cpu_present_to_apicid(int mps_cpu)
539 539
540static int cpu_id; 540static int cpu_id;
541 541
542static physid_mask_t es7000_apicid_to_cpu_present(int phys_apicid) 542static void es7000_apicid_to_cpu_present(int phys_apicid, physid_mask_t *retmap)
543{ 543{
544 physid_mask_t mask; 544 physid_set_mask_of_physid(cpu_id, retmap);
545
546 mask = physid_mask_of_physid(cpu_id);
547 ++cpu_id; 545 ++cpu_id;
548
549 return mask;
550} 546}
551 547
552/* Mapping from cpu number to logical apicid */ 548/* Mapping from cpu number to logical apicid */
@@ -561,10 +557,10 @@ static int es7000_cpu_to_logical_apicid(int cpu)
561#endif 557#endif
562} 558}
563 559
564static physid_mask_t es7000_ioapic_phys_id_map(physid_mask_t phys_map) 560static void es7000_ioapic_phys_id_map(physid_mask_t *phys_map, physid_mask_t *retmap)
565{ 561{
566 /* For clustered we don't have a good way to do this yet - hack */ 562 /* For clustered we don't have a good way to do this yet - hack */
567 return physids_promote(0xff); 563 physids_promote(0xFFL, retmap);
568} 564}
569 565
570static int es7000_check_phys_apicid_present(int cpu_physical_apicid) 566static int es7000_check_phys_apicid_present(int cpu_physical_apicid)
diff --git a/arch/x86/kernel/apic/io_apic.c b/arch/x86/kernel/apic/io_apic.c
index dc69f28489f5..c0b4468683f9 100644
--- a/arch/x86/kernel/apic/io_apic.c
+++ b/arch/x86/kernel/apic/io_apic.c
@@ -60,8 +60,6 @@
60#include <asm/irq_remapping.h> 60#include <asm/irq_remapping.h>
61#include <asm/hpet.h> 61#include <asm/hpet.h>
62#include <asm/hw_irq.h> 62#include <asm/hw_irq.h>
63#include <asm/uv/uv_hub.h>
64#include <asm/uv/uv_irq.h>
65 63
66#include <asm/apic.h> 64#include <asm/apic.h>
67 65
@@ -140,20 +138,6 @@ static struct irq_pin_list *get_one_free_irq_2_pin(int node)
140 return pin; 138 return pin;
141} 139}
142 140
143/*
144 * This is performance-critical, we want to do it O(1)
145 *
146 * Most irqs are mapped 1:1 with pins.
147 */
148struct irq_cfg {
149 struct irq_pin_list *irq_2_pin;
150 cpumask_var_t domain;
151 cpumask_var_t old_domain;
152 unsigned move_cleanup_count;
153 u8 vector;
154 u8 move_in_progress : 1;
155};
156
157/* irq_cfg is indexed by the sum of all RTEs in all I/O APICs. */ 141/* irq_cfg is indexed by the sum of all RTEs in all I/O APICs. */
158#ifdef CONFIG_SPARSE_IRQ 142#ifdef CONFIG_SPARSE_IRQ
159static struct irq_cfg irq_cfgx[] = { 143static struct irq_cfg irq_cfgx[] = {
@@ -209,7 +193,7 @@ int __init arch_early_irq_init(void)
209} 193}
210 194
211#ifdef CONFIG_SPARSE_IRQ 195#ifdef CONFIG_SPARSE_IRQ
212static struct irq_cfg *irq_cfg(unsigned int irq) 196struct irq_cfg *irq_cfg(unsigned int irq)
213{ 197{
214 struct irq_cfg *cfg = NULL; 198 struct irq_cfg *cfg = NULL;
215 struct irq_desc *desc; 199 struct irq_desc *desc;
@@ -361,7 +345,7 @@ void arch_free_chip_data(struct irq_desc *old_desc, struct irq_desc *desc)
361/* end for move_irq_desc */ 345/* end for move_irq_desc */
362 346
363#else 347#else
364static struct irq_cfg *irq_cfg(unsigned int irq) 348struct irq_cfg *irq_cfg(unsigned int irq)
365{ 349{
366 return irq < nr_irqs ? irq_cfgx + irq : NULL; 350 return irq < nr_irqs ? irq_cfgx + irq : NULL;
367} 351}
@@ -555,23 +539,41 @@ static void __init replace_pin_at_irq_node(struct irq_cfg *cfg, int node,
555 add_pin_to_irq_node(cfg, node, newapic, newpin); 539 add_pin_to_irq_node(cfg, node, newapic, newpin);
556} 540}
557 541
542static void __io_apic_modify_irq(struct irq_pin_list *entry,
543 int mask_and, int mask_or,
544 void (*final)(struct irq_pin_list *entry))
545{
546 unsigned int reg, pin;
547
548 pin = entry->pin;
549 reg = io_apic_read(entry->apic, 0x10 + pin * 2);
550 reg &= mask_and;
551 reg |= mask_or;
552 io_apic_modify(entry->apic, 0x10 + pin * 2, reg);
553 if (final)
554 final(entry);
555}
556
558static void io_apic_modify_irq(struct irq_cfg *cfg, 557static void io_apic_modify_irq(struct irq_cfg *cfg,
559 int mask_and, int mask_or, 558 int mask_and, int mask_or,
560 void (*final)(struct irq_pin_list *entry)) 559 void (*final)(struct irq_pin_list *entry))
561{ 560{
562 int pin;
563 struct irq_pin_list *entry; 561 struct irq_pin_list *entry;
564 562
565 for_each_irq_pin(entry, cfg->irq_2_pin) { 563 for_each_irq_pin(entry, cfg->irq_2_pin)
566 unsigned int reg; 564 __io_apic_modify_irq(entry, mask_and, mask_or, final);
567 pin = entry->pin; 565}
568 reg = io_apic_read(entry->apic, 0x10 + pin * 2); 566
569 reg &= mask_and; 567static void __mask_and_edge_IO_APIC_irq(struct irq_pin_list *entry)
570 reg |= mask_or; 568{
571 io_apic_modify(entry->apic, 0x10 + pin * 2, reg); 569 __io_apic_modify_irq(entry, ~IO_APIC_REDIR_LEVEL_TRIGGER,
572 if (final) 570 IO_APIC_REDIR_MASKED, NULL);
573 final(entry); 571}
574 } 572
573static void __unmask_and_level_IO_APIC_irq(struct irq_pin_list *entry)
574{
575 __io_apic_modify_irq(entry, ~IO_APIC_REDIR_MASKED,
576 IO_APIC_REDIR_LEVEL_TRIGGER, NULL);
575} 577}
576 578
577static void __unmask_IO_APIC_irq(struct irq_cfg *cfg) 579static void __unmask_IO_APIC_irq(struct irq_cfg *cfg)
@@ -595,18 +597,6 @@ static void __mask_IO_APIC_irq(struct irq_cfg *cfg)
595 io_apic_modify_irq(cfg, ~0, IO_APIC_REDIR_MASKED, &io_apic_sync); 597 io_apic_modify_irq(cfg, ~0, IO_APIC_REDIR_MASKED, &io_apic_sync);
596} 598}
597 599
598static void __mask_and_edge_IO_APIC_irq(struct irq_cfg *cfg)
599{
600 io_apic_modify_irq(cfg, ~IO_APIC_REDIR_LEVEL_TRIGGER,
601 IO_APIC_REDIR_MASKED, NULL);
602}
603
604static void __unmask_and_level_IO_APIC_irq(struct irq_cfg *cfg)
605{
606 io_apic_modify_irq(cfg, ~IO_APIC_REDIR_MASKED,
607 IO_APIC_REDIR_LEVEL_TRIGGER, NULL);
608}
609
610static void mask_IO_APIC_irq_desc(struct irq_desc *desc) 600static void mask_IO_APIC_irq_desc(struct irq_desc *desc)
611{ 601{
612 struct irq_cfg *cfg = desc->chip_data; 602 struct irq_cfg *cfg = desc->chip_data;
@@ -1177,7 +1167,7 @@ __assign_irq_vector(int irq, struct irq_cfg *cfg, const struct cpumask *mask)
1177 int cpu, err; 1167 int cpu, err;
1178 cpumask_var_t tmp_mask; 1168 cpumask_var_t tmp_mask;
1179 1169
1180 if ((cfg->move_in_progress) || cfg->move_cleanup_count) 1170 if (cfg->move_in_progress)
1181 return -EBUSY; 1171 return -EBUSY;
1182 1172
1183 if (!alloc_cpumask_var(&tmp_mask, GFP_ATOMIC)) 1173 if (!alloc_cpumask_var(&tmp_mask, GFP_ATOMIC))
@@ -1237,8 +1227,7 @@ next:
1237 return err; 1227 return err;
1238} 1228}
1239 1229
1240static int 1230int assign_irq_vector(int irq, struct irq_cfg *cfg, const struct cpumask *mask)
1241assign_irq_vector(int irq, struct irq_cfg *cfg, const struct cpumask *mask)
1242{ 1231{
1243 int err; 1232 int err;
1244 unsigned long flags; 1233 unsigned long flags;
@@ -1599,9 +1588,6 @@ __apicdebuginit(void) print_IO_APIC(void)
1599 struct irq_desc *desc; 1588 struct irq_desc *desc;
1600 unsigned int irq; 1589 unsigned int irq;
1601 1590
1602 if (apic_verbosity == APIC_QUIET)
1603 return;
1604
1605 printk(KERN_DEBUG "number of MP IRQ sources: %d.\n", mp_irq_entries); 1591 printk(KERN_DEBUG "number of MP IRQ sources: %d.\n", mp_irq_entries);
1606 for (i = 0; i < nr_ioapics; i++) 1592 for (i = 0; i < nr_ioapics; i++)
1607 printk(KERN_DEBUG "number of IO-APIC #%d registers: %d.\n", 1593 printk(KERN_DEBUG "number of IO-APIC #%d registers: %d.\n",
@@ -1708,9 +1694,6 @@ __apicdebuginit(void) print_APIC_field(int base)
1708{ 1694{
1709 int i; 1695 int i;
1710 1696
1711 if (apic_verbosity == APIC_QUIET)
1712 return;
1713
1714 printk(KERN_DEBUG); 1697 printk(KERN_DEBUG);
1715 1698
1716 for (i = 0; i < 8; i++) 1699 for (i = 0; i < 8; i++)
@@ -1724,9 +1707,6 @@ __apicdebuginit(void) print_local_APIC(void *dummy)
1724 unsigned int i, v, ver, maxlvt; 1707 unsigned int i, v, ver, maxlvt;
1725 u64 icr; 1708 u64 icr;
1726 1709
1727 if (apic_verbosity == APIC_QUIET)
1728 return;
1729
1730 printk(KERN_DEBUG "printing local APIC contents on CPU#%d/%d:\n", 1710 printk(KERN_DEBUG "printing local APIC contents on CPU#%d/%d:\n",
1731 smp_processor_id(), hard_smp_processor_id()); 1711 smp_processor_id(), hard_smp_processor_id());
1732 v = apic_read(APIC_ID); 1712 v = apic_read(APIC_ID);
@@ -1824,13 +1804,19 @@ __apicdebuginit(void) print_local_APIC(void *dummy)
1824 printk("\n"); 1804 printk("\n");
1825} 1805}
1826 1806
1827__apicdebuginit(void) print_all_local_APICs(void) 1807__apicdebuginit(void) print_local_APICs(int maxcpu)
1828{ 1808{
1829 int cpu; 1809 int cpu;
1830 1810
1811 if (!maxcpu)
1812 return;
1813
1831 preempt_disable(); 1814 preempt_disable();
1832 for_each_online_cpu(cpu) 1815 for_each_online_cpu(cpu) {
1816 if (cpu >= maxcpu)
1817 break;
1833 smp_call_function_single(cpu, print_local_APIC, NULL, 1); 1818 smp_call_function_single(cpu, print_local_APIC, NULL, 1);
1819 }
1834 preempt_enable(); 1820 preempt_enable();
1835} 1821}
1836 1822
@@ -1839,7 +1825,7 @@ __apicdebuginit(void) print_PIC(void)
1839 unsigned int v; 1825 unsigned int v;
1840 unsigned long flags; 1826 unsigned long flags;
1841 1827
1842 if (apic_verbosity == APIC_QUIET || !nr_legacy_irqs) 1828 if (!nr_legacy_irqs)
1843 return; 1829 return;
1844 1830
1845 printk(KERN_DEBUG "\nprinting PIC contents\n"); 1831 printk(KERN_DEBUG "\nprinting PIC contents\n");
@@ -1866,21 +1852,41 @@ __apicdebuginit(void) print_PIC(void)
1866 printk(KERN_DEBUG "... PIC ELCR: %04x\n", v); 1852 printk(KERN_DEBUG "... PIC ELCR: %04x\n", v);
1867} 1853}
1868 1854
1869__apicdebuginit(int) print_all_ICs(void) 1855static int __initdata show_lapic = 1;
1856static __init int setup_show_lapic(char *arg)
1870{ 1857{
1858 int num = -1;
1859
1860 if (strcmp(arg, "all") == 0) {
1861 show_lapic = CONFIG_NR_CPUS;
1862 } else {
1863 get_option(&arg, &num);
1864 if (num >= 0)
1865 show_lapic = num;
1866 }
1867
1868 return 1;
1869}
1870__setup("show_lapic=", setup_show_lapic);
1871
1872__apicdebuginit(int) print_ICs(void)
1873{
1874 if (apic_verbosity == APIC_QUIET)
1875 return 0;
1876
1871 print_PIC(); 1877 print_PIC();
1872 1878
1873 /* don't print out if apic is not there */ 1879 /* don't print out if apic is not there */
1874 if (!cpu_has_apic && !apic_from_smp_config()) 1880 if (!cpu_has_apic && !apic_from_smp_config())
1875 return 0; 1881 return 0;
1876 1882
1877 print_all_local_APICs(); 1883 print_local_APICs(show_lapic);
1878 print_IO_APIC(); 1884 print_IO_APIC();
1879 1885
1880 return 0; 1886 return 0;
1881} 1887}
1882 1888
1883fs_initcall(print_all_ICs); 1889fs_initcall(print_ICs);
1884 1890
1885 1891
1886/* Where if anywhere is the i8259 connect in external int mode */ 1892/* Where if anywhere is the i8259 connect in external int mode */
@@ -2031,7 +2037,7 @@ void __init setup_ioapic_ids_from_mpc(void)
2031 * This is broken; anything with a real cpu count has to 2037 * This is broken; anything with a real cpu count has to
2032 * circumvent this idiocy regardless. 2038 * circumvent this idiocy regardless.
2033 */ 2039 */
2034 phys_id_present_map = apic->ioapic_phys_id_map(phys_cpu_present_map); 2040 apic->ioapic_phys_id_map(&phys_cpu_present_map, &phys_id_present_map);
2035 2041
2036 /* 2042 /*
2037 * Set the IOAPIC ID to the value stored in the MPC table. 2043 * Set the IOAPIC ID to the value stored in the MPC table.
@@ -2058,7 +2064,7 @@ void __init setup_ioapic_ids_from_mpc(void)
2058 * system must have a unique ID or we get lots of nice 2064 * system must have a unique ID or we get lots of nice
2059 * 'stuck on smp_invalidate_needed IPI wait' messages. 2065 * 'stuck on smp_invalidate_needed IPI wait' messages.
2060 */ 2066 */
2061 if (apic->check_apicid_used(phys_id_present_map, 2067 if (apic->check_apicid_used(&phys_id_present_map,
2062 mp_ioapics[apic_id].apicid)) { 2068 mp_ioapics[apic_id].apicid)) {
2063 printk(KERN_ERR "BIOS bug, IO-APIC#%d ID %d is already used!...\n", 2069 printk(KERN_ERR "BIOS bug, IO-APIC#%d ID %d is already used!...\n",
2064 apic_id, mp_ioapics[apic_id].apicid); 2070 apic_id, mp_ioapics[apic_id].apicid);
@@ -2073,7 +2079,7 @@ void __init setup_ioapic_ids_from_mpc(void)
2073 mp_ioapics[apic_id].apicid = i; 2079 mp_ioapics[apic_id].apicid = i;
2074 } else { 2080 } else {
2075 physid_mask_t tmp; 2081 physid_mask_t tmp;
2076 tmp = apic->apicid_to_cpu_present(mp_ioapics[apic_id].apicid); 2082 apic->apicid_to_cpu_present(mp_ioapics[apic_id].apicid, &tmp);
2077 apic_printk(APIC_VERBOSE, "Setting %d in the " 2083 apic_printk(APIC_VERBOSE, "Setting %d in the "
2078 "phys_id_present_map\n", 2084 "phys_id_present_map\n",
2079 mp_ioapics[apic_id].apicid); 2085 mp_ioapics[apic_id].apicid);
@@ -2228,20 +2234,16 @@ static int ioapic_retrigger_irq(unsigned int irq)
2228 */ 2234 */
2229 2235
2230#ifdef CONFIG_SMP 2236#ifdef CONFIG_SMP
2231static void send_cleanup_vector(struct irq_cfg *cfg) 2237void send_cleanup_vector(struct irq_cfg *cfg)
2232{ 2238{
2233 cpumask_var_t cleanup_mask; 2239 cpumask_var_t cleanup_mask;
2234 2240
2235 if (unlikely(!alloc_cpumask_var(&cleanup_mask, GFP_ATOMIC))) { 2241 if (unlikely(!alloc_cpumask_var(&cleanup_mask, GFP_ATOMIC))) {
2236 unsigned int i; 2242 unsigned int i;
2237 cfg->move_cleanup_count = 0;
2238 for_each_cpu_and(i, cfg->old_domain, cpu_online_mask)
2239 cfg->move_cleanup_count++;
2240 for_each_cpu_and(i, cfg->old_domain, cpu_online_mask) 2243 for_each_cpu_and(i, cfg->old_domain, cpu_online_mask)
2241 apic->send_IPI_mask(cpumask_of(i), IRQ_MOVE_CLEANUP_VECTOR); 2244 apic->send_IPI_mask(cpumask_of(i), IRQ_MOVE_CLEANUP_VECTOR);
2242 } else { 2245 } else {
2243 cpumask_and(cleanup_mask, cfg->old_domain, cpu_online_mask); 2246 cpumask_and(cleanup_mask, cfg->old_domain, cpu_online_mask);
2244 cfg->move_cleanup_count = cpumask_weight(cleanup_mask);
2245 apic->send_IPI_mask(cleanup_mask, IRQ_MOVE_CLEANUP_VECTOR); 2247 apic->send_IPI_mask(cleanup_mask, IRQ_MOVE_CLEANUP_VECTOR);
2246 free_cpumask_var(cleanup_mask); 2248 free_cpumask_var(cleanup_mask);
2247 } 2249 }
@@ -2272,15 +2274,12 @@ static void __target_IO_APIC_irq(unsigned int irq, unsigned int dest, struct irq
2272 } 2274 }
2273} 2275}
2274 2276
2275static int
2276assign_irq_vector(int irq, struct irq_cfg *cfg, const struct cpumask *mask);
2277
2278/* 2277/*
2279 * Either sets desc->affinity to a valid value, and returns 2278 * Either sets desc->affinity to a valid value, and returns
2280 * ->cpu_mask_to_apicid of that, or returns BAD_APICID and 2279 * ->cpu_mask_to_apicid of that, or returns BAD_APICID and
2281 * leaves desc->affinity untouched. 2280 * leaves desc->affinity untouched.
2282 */ 2281 */
2283static unsigned int 2282unsigned int
2284set_desc_affinity(struct irq_desc *desc, const struct cpumask *mask) 2283set_desc_affinity(struct irq_desc *desc, const struct cpumask *mask)
2285{ 2284{
2286 struct irq_cfg *cfg; 2285 struct irq_cfg *cfg;
@@ -2433,8 +2432,6 @@ asmlinkage void smp_irq_move_cleanup_interrupt(void)
2433 2432
2434 cfg = irq_cfg(irq); 2433 cfg = irq_cfg(irq);
2435 spin_lock(&desc->lock); 2434 spin_lock(&desc->lock);
2436 if (!cfg->move_cleanup_count)
2437 goto unlock;
2438 2435
2439 if (vector == cfg->vector && cpumask_test_cpu(me, cfg->domain)) 2436 if (vector == cfg->vector && cpumask_test_cpu(me, cfg->domain))
2440 goto unlock; 2437 goto unlock;
@@ -2452,7 +2449,6 @@ asmlinkage void smp_irq_move_cleanup_interrupt(void)
2452 goto unlock; 2449 goto unlock;
2453 } 2450 }
2454 __get_cpu_var(vector_irq)[vector] = -1; 2451 __get_cpu_var(vector_irq)[vector] = -1;
2455 cfg->move_cleanup_count--;
2456unlock: 2452unlock:
2457 spin_unlock(&desc->lock); 2453 spin_unlock(&desc->lock);
2458 } 2454 }
@@ -2460,21 +2456,33 @@ unlock:
2460 irq_exit(); 2456 irq_exit();
2461} 2457}
2462 2458
2463static void irq_complete_move(struct irq_desc **descp) 2459static void __irq_complete_move(struct irq_desc **descp, unsigned vector)
2464{ 2460{
2465 struct irq_desc *desc = *descp; 2461 struct irq_desc *desc = *descp;
2466 struct irq_cfg *cfg = desc->chip_data; 2462 struct irq_cfg *cfg = desc->chip_data;
2467 unsigned vector, me; 2463 unsigned me;
2468 2464
2469 if (likely(!cfg->move_in_progress)) 2465 if (likely(!cfg->move_in_progress))
2470 return; 2466 return;
2471 2467
2472 vector = ~get_irq_regs()->orig_ax;
2473 me = smp_processor_id(); 2468 me = smp_processor_id();
2474 2469
2475 if (vector == cfg->vector && cpumask_test_cpu(me, cfg->domain)) 2470 if (vector == cfg->vector && cpumask_test_cpu(me, cfg->domain))
2476 send_cleanup_vector(cfg); 2471 send_cleanup_vector(cfg);
2477} 2472}
2473
2474static void irq_complete_move(struct irq_desc **descp)
2475{
2476 __irq_complete_move(descp, ~get_irq_regs()->orig_ax);
2477}
2478
2479void irq_force_complete_move(int irq)
2480{
2481 struct irq_desc *desc = irq_to_desc(irq);
2482 struct irq_cfg *cfg = desc->chip_data;
2483
2484 __irq_complete_move(&desc, cfg->vector);
2485}
2478#else 2486#else
2479static inline void irq_complete_move(struct irq_desc **descp) {} 2487static inline void irq_complete_move(struct irq_desc **descp) {}
2480#endif 2488#endif
@@ -2490,6 +2498,59 @@ static void ack_apic_edge(unsigned int irq)
2490 2498
2491atomic_t irq_mis_count; 2499atomic_t irq_mis_count;
2492 2500
2501/*
2502 * IO-APIC versions below 0x20 don't support EOI register.
2503 * For the record, here is the information about various versions:
2504 * 0Xh 82489DX
2505 * 1Xh I/OAPIC or I/O(x)APIC which are not PCI 2.2 Compliant
2506 * 2Xh I/O(x)APIC which is PCI 2.2 Compliant
2507 * 30h-FFh Reserved
2508 *
2509 * Some of the Intel ICH Specs (ICH2 to ICH5) documents the io-apic
2510 * version as 0x2. This is an error with documentation and these ICH chips
2511 * use io-apic's of version 0x20.
2512 *
2513 * For IO-APIC's with EOI register, we use that to do an explicit EOI.
2514 * Otherwise, we simulate the EOI message manually by changing the trigger
2515 * mode to edge and then back to level, with RTE being masked during this.
2516*/
2517static void __eoi_ioapic_irq(unsigned int irq, struct irq_cfg *cfg)
2518{
2519 struct irq_pin_list *entry;
2520
2521 for_each_irq_pin(entry, cfg->irq_2_pin) {
2522 if (mp_ioapics[entry->apic].apicver >= 0x20) {
2523 /*
2524 * Intr-remapping uses pin number as the virtual vector
2525 * in the RTE. Actual vector is programmed in
2526 * intr-remapping table entry. Hence for the io-apic
2527 * EOI we use the pin number.
2528 */
2529 if (irq_remapped(irq))
2530 io_apic_eoi(entry->apic, entry->pin);
2531 else
2532 io_apic_eoi(entry->apic, cfg->vector);
2533 } else {
2534 __mask_and_edge_IO_APIC_irq(entry);
2535 __unmask_and_level_IO_APIC_irq(entry);
2536 }
2537 }
2538}
2539
2540static void eoi_ioapic_irq(struct irq_desc *desc)
2541{
2542 struct irq_cfg *cfg;
2543 unsigned long flags;
2544 unsigned int irq;
2545
2546 irq = desc->irq;
2547 cfg = desc->chip_data;
2548
2549 spin_lock_irqsave(&ioapic_lock, flags);
2550 __eoi_ioapic_irq(irq, cfg);
2551 spin_unlock_irqrestore(&ioapic_lock, flags);
2552}
2553
2493static void ack_apic_level(unsigned int irq) 2554static void ack_apic_level(unsigned int irq)
2494{ 2555{
2495 struct irq_desc *desc = irq_to_desc(irq); 2556 struct irq_desc *desc = irq_to_desc(irq);
@@ -2525,6 +2586,19 @@ static void ack_apic_level(unsigned int irq)
2525 * level-triggered interrupt. We mask the source for the time of the 2586 * level-triggered interrupt. We mask the source for the time of the
2526 * operation to prevent an edge-triggered interrupt escaping meanwhile. 2587 * operation to prevent an edge-triggered interrupt escaping meanwhile.
2527 * The idea is from Manfred Spraul. --macro 2588 * The idea is from Manfred Spraul. --macro
2589 *
2590 * Also in the case when cpu goes offline, fixup_irqs() will forward
2591 * any unhandled interrupt on the offlined cpu to the new cpu
2592 * destination that is handling the corresponding interrupt. This
2593 * interrupt forwarding is done via IPI's. Hence, in this case also
2594 * level-triggered io-apic interrupt will be seen as an edge
2595 * interrupt in the IRR. And we can't rely on the cpu's EOI
2596 * to be broadcasted to the IO-APIC's which will clear the remoteIRR
2597 * corresponding to the level-triggered interrupt. Hence on IO-APIC's
2598 * supporting EOI register, we do an explicit EOI to clear the
2599 * remote IRR and on IO-APIC's which don't have an EOI register,
2600 * we use the above logic (mask+edge followed by unmask+level) from
2601 * Manfred Spraul to clear the remote IRR.
2528 */ 2602 */
2529 cfg = desc->chip_data; 2603 cfg = desc->chip_data;
2530 i = cfg->vector; 2604 i = cfg->vector;
@@ -2536,6 +2610,19 @@ static void ack_apic_level(unsigned int irq)
2536 */ 2610 */
2537 ack_APIC_irq(); 2611 ack_APIC_irq();
2538 2612
2613 /*
2614 * Tail end of clearing remote IRR bit (either by delivering the EOI
2615 * message via io-apic EOI register write or simulating it using
2616 * mask+edge followed by unnask+level logic) manually when the
2617 * level triggered interrupt is seen as the edge triggered interrupt
2618 * at the cpu.
2619 */
2620 if (!(v & (1 << (i & 0x1f)))) {
2621 atomic_inc(&irq_mis_count);
2622
2623 eoi_ioapic_irq(desc);
2624 }
2625
2539 /* Now we can move and renable the irq */ 2626 /* Now we can move and renable the irq */
2540 if (unlikely(do_unmask_irq)) { 2627 if (unlikely(do_unmask_irq)) {
2541 /* Only migrate the irq if the ack has been received. 2628 /* Only migrate the irq if the ack has been received.
@@ -2569,41 +2656,9 @@ static void ack_apic_level(unsigned int irq)
2569 move_masked_irq(irq); 2656 move_masked_irq(irq);
2570 unmask_IO_APIC_irq_desc(desc); 2657 unmask_IO_APIC_irq_desc(desc);
2571 } 2658 }
2572
2573 /* Tail end of version 0x11 I/O APIC bug workaround */
2574 if (!(v & (1 << (i & 0x1f)))) {
2575 atomic_inc(&irq_mis_count);
2576 spin_lock(&ioapic_lock);
2577 __mask_and_edge_IO_APIC_irq(cfg);
2578 __unmask_and_level_IO_APIC_irq(cfg);
2579 spin_unlock(&ioapic_lock);
2580 }
2581} 2659}
2582 2660
2583#ifdef CONFIG_INTR_REMAP 2661#ifdef CONFIG_INTR_REMAP
2584static void __eoi_ioapic_irq(unsigned int irq, struct irq_cfg *cfg)
2585{
2586 struct irq_pin_list *entry;
2587
2588 for_each_irq_pin(entry, cfg->irq_2_pin)
2589 io_apic_eoi(entry->apic, entry->pin);
2590}
2591
2592static void
2593eoi_ioapic_irq(struct irq_desc *desc)
2594{
2595 struct irq_cfg *cfg;
2596 unsigned long flags;
2597 unsigned int irq;
2598
2599 irq = desc->irq;
2600 cfg = desc->chip_data;
2601
2602 spin_lock_irqsave(&ioapic_lock, flags);
2603 __eoi_ioapic_irq(irq, cfg);
2604 spin_unlock_irqrestore(&ioapic_lock, flags);
2605}
2606
2607static void ir_ack_apic_edge(unsigned int irq) 2662static void ir_ack_apic_edge(unsigned int irq)
2608{ 2663{
2609 ack_APIC_irq(); 2664 ack_APIC_irq();
@@ -3157,6 +3212,7 @@ unsigned int create_irq_nr(unsigned int irq_want, int node)
3157 continue; 3212 continue;
3158 3213
3159 desc_new = move_irq_desc(desc_new, node); 3214 desc_new = move_irq_desc(desc_new, node);
3215 cfg_new = desc_new->chip_data;
3160 3216
3161 if (__assign_irq_vector(new, cfg_new, apic->target_cpus()) == 0) 3217 if (__assign_irq_vector(new, cfg_new, apic->target_cpus()) == 0)
3162 irq = new; 3218 irq = new;
@@ -3708,75 +3764,6 @@ int arch_setup_ht_irq(unsigned int irq, struct pci_dev *dev)
3708} 3764}
3709#endif /* CONFIG_HT_IRQ */ 3765#endif /* CONFIG_HT_IRQ */
3710 3766
3711#ifdef CONFIG_X86_UV
3712/*
3713 * Re-target the irq to the specified CPU and enable the specified MMR located
3714 * on the specified blade to allow the sending of MSIs to the specified CPU.
3715 */
3716int arch_enable_uv_irq(char *irq_name, unsigned int irq, int cpu, int mmr_blade,
3717 unsigned long mmr_offset)
3718{
3719 const struct cpumask *eligible_cpu = cpumask_of(cpu);
3720 struct irq_cfg *cfg;
3721 int mmr_pnode;
3722 unsigned long mmr_value;
3723 struct uv_IO_APIC_route_entry *entry;
3724 unsigned long flags;
3725 int err;
3726
3727 BUILD_BUG_ON(sizeof(struct uv_IO_APIC_route_entry) != sizeof(unsigned long));
3728
3729 cfg = irq_cfg(irq);
3730
3731 err = assign_irq_vector(irq, cfg, eligible_cpu);
3732 if (err != 0)
3733 return err;
3734
3735 spin_lock_irqsave(&vector_lock, flags);
3736 set_irq_chip_and_handler_name(irq, &uv_irq_chip, handle_percpu_irq,
3737 irq_name);
3738 spin_unlock_irqrestore(&vector_lock, flags);
3739
3740 mmr_value = 0;
3741 entry = (struct uv_IO_APIC_route_entry *)&mmr_value;
3742 entry->vector = cfg->vector;
3743 entry->delivery_mode = apic->irq_delivery_mode;
3744 entry->dest_mode = apic->irq_dest_mode;
3745 entry->polarity = 0;
3746 entry->trigger = 0;
3747 entry->mask = 0;
3748 entry->dest = apic->cpu_mask_to_apicid(eligible_cpu);
3749
3750 mmr_pnode = uv_blade_to_pnode(mmr_blade);
3751 uv_write_global_mmr64(mmr_pnode, mmr_offset, mmr_value);
3752
3753 if (cfg->move_in_progress)
3754 send_cleanup_vector(cfg);
3755
3756 return irq;
3757}
3758
3759/*
3760 * Disable the specified MMR located on the specified blade so that MSIs are
3761 * longer allowed to be sent.
3762 */
3763void arch_disable_uv_irq(int mmr_blade, unsigned long mmr_offset)
3764{
3765 unsigned long mmr_value;
3766 struct uv_IO_APIC_route_entry *entry;
3767 int mmr_pnode;
3768
3769 BUILD_BUG_ON(sizeof(struct uv_IO_APIC_route_entry) != sizeof(unsigned long));
3770
3771 mmr_value = 0;
3772 entry = (struct uv_IO_APIC_route_entry *)&mmr_value;
3773 entry->mask = 1;
3774
3775 mmr_pnode = uv_blade_to_pnode(mmr_blade);
3776 uv_write_global_mmr64(mmr_pnode, mmr_offset, mmr_value);
3777}
3778#endif /* CONFIG_X86_64 */
3779
3780int __init io_apic_get_redir_entries (int ioapic) 3767int __init io_apic_get_redir_entries (int ioapic)
3781{ 3768{
3782 union IO_APIC_reg_01 reg_01; 3769 union IO_APIC_reg_01 reg_01;
@@ -3944,7 +3931,7 @@ int __init io_apic_get_unique_id(int ioapic, int apic_id)
3944 */ 3931 */
3945 3932
3946 if (physids_empty(apic_id_map)) 3933 if (physids_empty(apic_id_map))
3947 apic_id_map = apic->ioapic_phys_id_map(phys_cpu_present_map); 3934 apic->ioapic_phys_id_map(&phys_cpu_present_map, &apic_id_map);
3948 3935
3949 spin_lock_irqsave(&ioapic_lock, flags); 3936 spin_lock_irqsave(&ioapic_lock, flags);
3950 reg_00.raw = io_apic_read(ioapic, 0); 3937 reg_00.raw = io_apic_read(ioapic, 0);
@@ -3960,10 +3947,10 @@ int __init io_apic_get_unique_id(int ioapic, int apic_id)
3960 * Every APIC in a system must have a unique ID or we get lots of nice 3947 * Every APIC in a system must have a unique ID or we get lots of nice
3961 * 'stuck on smp_invalidate_needed IPI wait' messages. 3948 * 'stuck on smp_invalidate_needed IPI wait' messages.
3962 */ 3949 */
3963 if (apic->check_apicid_used(apic_id_map, apic_id)) { 3950 if (apic->check_apicid_used(&apic_id_map, apic_id)) {
3964 3951
3965 for (i = 0; i < get_physical_broadcast(); i++) { 3952 for (i = 0; i < get_physical_broadcast(); i++) {
3966 if (!apic->check_apicid_used(apic_id_map, i)) 3953 if (!apic->check_apicid_used(&apic_id_map, i))
3967 break; 3954 break;
3968 } 3955 }
3969 3956
@@ -3976,7 +3963,7 @@ int __init io_apic_get_unique_id(int ioapic, int apic_id)
3976 apic_id = i; 3963 apic_id = i;
3977 } 3964 }
3978 3965
3979 tmp = apic->apicid_to_cpu_present(apic_id); 3966 apic->apicid_to_cpu_present(apic_id, &tmp);
3980 physids_or(apic_id_map, apic_id_map, tmp); 3967 physids_or(apic_id_map, apic_id_map, tmp);
3981 3968
3982 if (reg_00.bits.ID != apic_id) { 3969 if (reg_00.bits.ID != apic_id) {
@@ -4106,7 +4093,7 @@ static struct resource * __init ioapic_setup_resources(int nr_ioapics)
4106 for (i = 0; i < nr_ioapics; i++) { 4093 for (i = 0; i < nr_ioapics; i++) {
4107 res[i].name = mem; 4094 res[i].name = mem;
4108 res[i].flags = IORESOURCE_MEM | IORESOURCE_BUSY; 4095 res[i].flags = IORESOURCE_MEM | IORESOURCE_BUSY;
4109 sprintf(mem, "IOAPIC %u", i); 4096 snprintf(mem, IOAPIC_RESOURCE_NAME_SIZE, "IOAPIC %u", i);
4110 mem += IOAPIC_RESOURCE_NAME_SIZE; 4097 mem += IOAPIC_RESOURCE_NAME_SIZE;
4111 } 4098 }
4112 4099
@@ -4140,18 +4127,17 @@ void __init ioapic_init_mappings(void)
4140#ifdef CONFIG_X86_32 4127#ifdef CONFIG_X86_32
4141fake_ioapic_page: 4128fake_ioapic_page:
4142#endif 4129#endif
4143 ioapic_phys = (unsigned long) 4130 ioapic_phys = (unsigned long)alloc_bootmem_pages(PAGE_SIZE);
4144 alloc_bootmem_pages(PAGE_SIZE);
4145 ioapic_phys = __pa(ioapic_phys); 4131 ioapic_phys = __pa(ioapic_phys);
4146 } 4132 }
4147 set_fixmap_nocache(idx, ioapic_phys); 4133 set_fixmap_nocache(idx, ioapic_phys);
4148 apic_printk(APIC_VERBOSE, 4134 apic_printk(APIC_VERBOSE, "mapped IOAPIC to %08lx (%08lx)\n",
4149 "mapped IOAPIC to %08lx (%08lx)\n", 4135 __fix_to_virt(idx) + (ioapic_phys & ~PAGE_MASK),
4150 __fix_to_virt(idx), ioapic_phys); 4136 ioapic_phys);
4151 idx++; 4137 idx++;
4152 4138
4153 ioapic_res->start = ioapic_phys; 4139 ioapic_res->start = ioapic_phys;
4154 ioapic_res->end = ioapic_phys + (4 * 1024) - 1; 4140 ioapic_res->end = ioapic_phys + IO_APIC_SLOT_SIZE - 1;
4155 ioapic_res++; 4141 ioapic_res++;
4156 } 4142 }
4157} 4143}
diff --git a/arch/x86/kernel/apic/numaq_32.c b/arch/x86/kernel/apic/numaq_32.c
index efa00e2b8505..07cdbdcd7a92 100644
--- a/arch/x86/kernel/apic/numaq_32.c
+++ b/arch/x86/kernel/apic/numaq_32.c
@@ -334,10 +334,9 @@ static inline const struct cpumask *numaq_target_cpus(void)
334 return cpu_all_mask; 334 return cpu_all_mask;
335} 335}
336 336
337static inline unsigned long 337static unsigned long numaq_check_apicid_used(physid_mask_t *map, int apicid)
338numaq_check_apicid_used(physid_mask_t bitmap, int apicid)
339{ 338{
340 return physid_isset(apicid, bitmap); 339 return physid_isset(apicid, *map);
341} 340}
342 341
343static inline unsigned long numaq_check_apicid_present(int bit) 342static inline unsigned long numaq_check_apicid_present(int bit)
@@ -371,10 +370,10 @@ static inline int numaq_multi_timer_check(int apic, int irq)
371 return apic != 0 && irq == 0; 370 return apic != 0 && irq == 0;
372} 371}
373 372
374static inline physid_mask_t numaq_ioapic_phys_id_map(physid_mask_t phys_map) 373static inline void numaq_ioapic_phys_id_map(physid_mask_t *phys_map, physid_mask_t *retmap)
375{ 374{
376 /* We don't have a good way to do this yet - hack */ 375 /* We don't have a good way to do this yet - hack */
377 return physids_promote(0xFUL); 376 return physids_promote(0xFUL, retmap);
378} 377}
379 378
380static inline int numaq_cpu_to_logical_apicid(int cpu) 379static inline int numaq_cpu_to_logical_apicid(int cpu)
@@ -402,12 +401,12 @@ static inline int numaq_apicid_to_node(int logical_apicid)
402 return logical_apicid >> 4; 401 return logical_apicid >> 4;
403} 402}
404 403
405static inline physid_mask_t numaq_apicid_to_cpu_present(int logical_apicid) 404static void numaq_apicid_to_cpu_present(int logical_apicid, physid_mask_t *retmap)
406{ 405{
407 int node = numaq_apicid_to_node(logical_apicid); 406 int node = numaq_apicid_to_node(logical_apicid);
408 int cpu = __ffs(logical_apicid & 0xf); 407 int cpu = __ffs(logical_apicid & 0xf);
409 408
410 return physid_mask_of_physid(cpu + 4*node); 409 physid_set_mask_of_physid(cpu + 4*node, retmap);
411} 410}
412 411
413/* Where the IO area was mapped on multiquad, always 0 otherwise */ 412/* Where the IO area was mapped on multiquad, always 0 otherwise */
diff --git a/arch/x86/kernel/apic/probe_32.c b/arch/x86/kernel/apic/probe_32.c
index 0c0182cc947d..1a6559f6768c 100644
--- a/arch/x86/kernel/apic/probe_32.c
+++ b/arch/x86/kernel/apic/probe_32.c
@@ -108,7 +108,7 @@ struct apic apic_default = {
108 .apicid_to_node = default_apicid_to_node, 108 .apicid_to_node = default_apicid_to_node,
109 .cpu_to_logical_apicid = default_cpu_to_logical_apicid, 109 .cpu_to_logical_apicid = default_cpu_to_logical_apicid,
110 .cpu_present_to_apicid = default_cpu_present_to_apicid, 110 .cpu_present_to_apicid = default_cpu_present_to_apicid,
111 .apicid_to_cpu_present = default_apicid_to_cpu_present, 111 .apicid_to_cpu_present = physid_set_mask_of_physid,
112 .setup_portio_remap = NULL, 112 .setup_portio_remap = NULL,
113 .check_phys_apicid_present = default_check_phys_apicid_present, 113 .check_phys_apicid_present = default_check_phys_apicid_present,
114 .enable_apic_mode = NULL, 114 .enable_apic_mode = NULL,
diff --git a/arch/x86/kernel/apic/summit_32.c b/arch/x86/kernel/apic/summit_32.c
index 645ecc4ff0be..9b419263d90d 100644
--- a/arch/x86/kernel/apic/summit_32.c
+++ b/arch/x86/kernel/apic/summit_32.c
@@ -183,7 +183,7 @@ static const struct cpumask *summit_target_cpus(void)
183 return cpumask_of(0); 183 return cpumask_of(0);
184} 184}
185 185
186static unsigned long summit_check_apicid_used(physid_mask_t bitmap, int apicid) 186static unsigned long summit_check_apicid_used(physid_mask_t *map, int apicid)
187{ 187{
188 return 0; 188 return 0;
189} 189}
@@ -261,15 +261,15 @@ static int summit_cpu_present_to_apicid(int mps_cpu)
261 return BAD_APICID; 261 return BAD_APICID;
262} 262}
263 263
264static physid_mask_t summit_ioapic_phys_id_map(physid_mask_t phys_id_map) 264static void summit_ioapic_phys_id_map(physid_mask_t *phys_id_map, physid_mask_t *retmap)
265{ 265{
266 /* For clustered we don't have a good way to do this yet - hack */ 266 /* For clustered we don't have a good way to do this yet - hack */
267 return physids_promote(0x0F); 267 physids_promote(0x0FL, retmap);
268} 268}
269 269
270static physid_mask_t summit_apicid_to_cpu_present(int apicid) 270static void summit_apicid_to_cpu_present(int apicid, physid_mask_t *retmap)
271{ 271{
272 return physid_mask_of_physid(0); 272 physid_set_mask_of_physid(0, retmap);
273} 273}
274 274
275static int summit_check_phys_apicid_present(int physical_apicid) 275static int summit_check_phys_apicid_present(int physical_apicid)
diff --git a/arch/x86/kernel/apic/x2apic_uv_x.c b/arch/x86/kernel/apic/x2apic_uv_x.c
index 326c25477d3d..130c4b934877 100644
--- a/arch/x86/kernel/apic/x2apic_uv_x.c
+++ b/arch/x86/kernel/apic/x2apic_uv_x.c
@@ -409,6 +409,12 @@ static __init void map_mmioh_high(int max_pnode)
409 map_high("MMIOH", mmioh.s.base, shift, max_pnode, map_uc); 409 map_high("MMIOH", mmioh.s.base, shift, max_pnode, map_uc);
410} 410}
411 411
412static __init void map_low_mmrs(void)
413{
414 init_extra_mapping_uc(UV_GLOBAL_MMR32_BASE, UV_GLOBAL_MMR32_SIZE);
415 init_extra_mapping_uc(UV_LOCAL_MMR_BASE, UV_LOCAL_MMR_SIZE);
416}
417
412static __init void uv_rtc_init(void) 418static __init void uv_rtc_init(void)
413{ 419{
414 long status; 420 long status;
@@ -550,6 +556,8 @@ void __init uv_system_init(void)
550 unsigned long mmr_base, present, paddr; 556 unsigned long mmr_base, present, paddr;
551 unsigned short pnode_mask; 557 unsigned short pnode_mask;
552 558
559 map_low_mmrs();
560
553 m_n_config.v = uv_read_local_mmr(UVH_SI_ADDR_MAP_CONFIG); 561 m_n_config.v = uv_read_local_mmr(UVH_SI_ADDR_MAP_CONFIG);
554 m_val = m_n_config.s.m_skt; 562 m_val = m_n_config.s.m_skt;
555 n_val = m_n_config.s.n_skt; 563 n_val = m_n_config.s.n_skt;
diff --git a/arch/x86/kernel/apm_32.c b/arch/x86/kernel/apm_32.c
index 151ace69a5aa..b5b6b23bce53 100644
--- a/arch/x86/kernel/apm_32.c
+++ b/arch/x86/kernel/apm_32.c
@@ -204,7 +204,6 @@
204#include <linux/module.h> 204#include <linux/module.h>
205 205
206#include <linux/poll.h> 206#include <linux/poll.h>
207#include <linux/smp_lock.h>
208#include <linux/types.h> 207#include <linux/types.h>
209#include <linux/stddef.h> 208#include <linux/stddef.h>
210#include <linux/timer.h> 209#include <linux/timer.h>
@@ -403,6 +402,7 @@ static DECLARE_WAIT_QUEUE_HEAD(apm_waitqueue);
403static DECLARE_WAIT_QUEUE_HEAD(apm_suspend_waitqueue); 402static DECLARE_WAIT_QUEUE_HEAD(apm_suspend_waitqueue);
404static struct apm_user *user_list; 403static struct apm_user *user_list;
405static DEFINE_SPINLOCK(user_list_lock); 404static DEFINE_SPINLOCK(user_list_lock);
405static DEFINE_MUTEX(apm_mutex);
406 406
407/* 407/*
408 * Set up a segment that references the real mode segment 0x40 408 * Set up a segment that references the real mode segment 0x40
@@ -1531,7 +1531,7 @@ static long do_ioctl(struct file *filp, u_int cmd, u_long arg)
1531 return -EPERM; 1531 return -EPERM;
1532 switch (cmd) { 1532 switch (cmd) {
1533 case APM_IOC_STANDBY: 1533 case APM_IOC_STANDBY:
1534 lock_kernel(); 1534 mutex_lock(&apm_mutex);
1535 if (as->standbys_read > 0) { 1535 if (as->standbys_read > 0) {
1536 as->standbys_read--; 1536 as->standbys_read--;
1537 as->standbys_pending--; 1537 as->standbys_pending--;
@@ -1540,10 +1540,10 @@ static long do_ioctl(struct file *filp, u_int cmd, u_long arg)
1540 queue_event(APM_USER_STANDBY, as); 1540 queue_event(APM_USER_STANDBY, as);
1541 if (standbys_pending <= 0) 1541 if (standbys_pending <= 0)
1542 standby(); 1542 standby();
1543 unlock_kernel(); 1543 mutex_unlock(&apm_mutex);
1544 break; 1544 break;
1545 case APM_IOC_SUSPEND: 1545 case APM_IOC_SUSPEND:
1546 lock_kernel(); 1546 mutex_lock(&apm_mutex);
1547 if (as->suspends_read > 0) { 1547 if (as->suspends_read > 0) {
1548 as->suspends_read--; 1548 as->suspends_read--;
1549 as->suspends_pending--; 1549 as->suspends_pending--;
@@ -1552,13 +1552,14 @@ static long do_ioctl(struct file *filp, u_int cmd, u_long arg)
1552 queue_event(APM_USER_SUSPEND, as); 1552 queue_event(APM_USER_SUSPEND, as);
1553 if (suspends_pending <= 0) { 1553 if (suspends_pending <= 0) {
1554 ret = suspend(1); 1554 ret = suspend(1);
1555 mutex_unlock(&apm_mutex);
1555 } else { 1556 } else {
1556 as->suspend_wait = 1; 1557 as->suspend_wait = 1;
1558 mutex_unlock(&apm_mutex);
1557 wait_event_interruptible(apm_suspend_waitqueue, 1559 wait_event_interruptible(apm_suspend_waitqueue,
1558 as->suspend_wait == 0); 1560 as->suspend_wait == 0);
1559 ret = as->suspend_result; 1561 ret = as->suspend_result;
1560 } 1562 }
1561 unlock_kernel();
1562 return ret; 1563 return ret;
1563 default: 1564 default:
1564 return -ENOTTY; 1565 return -ENOTTY;
@@ -1608,12 +1609,10 @@ static int do_open(struct inode *inode, struct file *filp)
1608{ 1609{
1609 struct apm_user *as; 1610 struct apm_user *as;
1610 1611
1611 lock_kernel();
1612 as = kmalloc(sizeof(*as), GFP_KERNEL); 1612 as = kmalloc(sizeof(*as), GFP_KERNEL);
1613 if (as == NULL) { 1613 if (as == NULL) {
1614 printk(KERN_ERR "apm: cannot allocate struct of size %d bytes\n", 1614 printk(KERN_ERR "apm: cannot allocate struct of size %d bytes\n",
1615 sizeof(*as)); 1615 sizeof(*as));
1616 unlock_kernel();
1617 return -ENOMEM; 1616 return -ENOMEM;
1618 } 1617 }
1619 as->magic = APM_BIOS_MAGIC; 1618 as->magic = APM_BIOS_MAGIC;
@@ -1635,7 +1634,6 @@ static int do_open(struct inode *inode, struct file *filp)
1635 user_list = as; 1634 user_list = as;
1636 spin_unlock(&user_list_lock); 1635 spin_unlock(&user_list_lock);
1637 filp->private_data = as; 1636 filp->private_data = as;
1638 unlock_kernel();
1639 return 0; 1637 return 0;
1640} 1638}
1641 1639
diff --git a/arch/x86/kernel/cpu/Makefile b/arch/x86/kernel/cpu/Makefile
index 68537e957a9b..1d2cb383410e 100644
--- a/arch/x86/kernel/cpu/Makefile
+++ b/arch/x86/kernel/cpu/Makefile
@@ -5,6 +5,7 @@
5# Don't trace early stages of a secondary CPU boot 5# Don't trace early stages of a secondary CPU boot
6ifdef CONFIG_FUNCTION_TRACER 6ifdef CONFIG_FUNCTION_TRACER
7CFLAGS_REMOVE_common.o = -pg 7CFLAGS_REMOVE_common.o = -pg
8CFLAGS_REMOVE_perf_event.o = -pg
8endif 9endif
9 10
10# Make sure load_percpu_segment has no stackprotector 11# Make sure load_percpu_segment has no stackprotector
diff --git a/arch/x86/kernel/cpu/common.c b/arch/x86/kernel/cpu/common.c
index 9bf845dc8055..a4ec8b647544 100644
--- a/arch/x86/kernel/cpu/common.c
+++ b/arch/x86/kernel/cpu/common.c
@@ -839,10 +839,8 @@ static void __cpuinit identify_cpu(struct cpuinfo_x86 *c)
839 boot_cpu_data.x86_capability[i] &= c->x86_capability[i]; 839 boot_cpu_data.x86_capability[i] &= c->x86_capability[i];
840 } 840 }
841 841
842#ifdef CONFIG_X86_MCE
843 /* Init Machine Check Exception if available. */ 842 /* Init Machine Check Exception if available. */
844 mcheck_init(c); 843 mcheck_cpu_init(c);
845#endif
846 844
847 select_idle_routine(c); 845 select_idle_routine(c);
848 846
diff --git a/arch/x86/kernel/cpu/cpufreq/acpi-cpufreq.c b/arch/x86/kernel/cpu/cpufreq/acpi-cpufreq.c
index 7d5c3b0ea8da..8b581d3905cb 100644
--- a/arch/x86/kernel/cpu/cpufreq/acpi-cpufreq.c
+++ b/arch/x86/kernel/cpu/cpufreq/acpi-cpufreq.c
@@ -526,15 +526,21 @@ static const struct dmi_system_id sw_any_bug_dmi_table[] = {
526 526
527static int acpi_cpufreq_blacklist(struct cpuinfo_x86 *c) 527static int acpi_cpufreq_blacklist(struct cpuinfo_x86 *c)
528{ 528{
529 /* http://www.intel.com/Assets/PDF/specupdate/314554.pdf 529 /* Intel Xeon Processor 7100 Series Specification Update
530 * http://www.intel.com/Assets/PDF/specupdate/314554.pdf
530 * AL30: A Machine Check Exception (MCE) Occurring during an 531 * AL30: A Machine Check Exception (MCE) Occurring during an
531 * Enhanced Intel SpeedStep Technology Ratio Change May Cause 532 * Enhanced Intel SpeedStep Technology Ratio Change May Cause
532 * Both Processor Cores to Lock Up when HT is enabled*/ 533 * Both Processor Cores to Lock Up. */
533 if (c->x86_vendor == X86_VENDOR_INTEL) { 534 if (c->x86_vendor == X86_VENDOR_INTEL) {
534 if ((c->x86 == 15) && 535 if ((c->x86 == 15) &&
535 (c->x86_model == 6) && 536 (c->x86_model == 6) &&
536 (c->x86_mask == 8) && smt_capable()) 537 (c->x86_mask == 8)) {
538 printk(KERN_INFO "acpi-cpufreq: Intel(R) "
539 "Xeon(R) 7100 Errata AL30, processors may "
540 "lock up on frequency changes: disabling "
541 "acpi-cpufreq.\n");
537 return -ENODEV; 542 return -ENODEV;
543 }
538 } 544 }
539 return 0; 545 return 0;
540} 546}
@@ -549,13 +555,18 @@ static int acpi_cpufreq_cpu_init(struct cpufreq_policy *policy)
549 unsigned int result = 0; 555 unsigned int result = 0;
550 struct cpuinfo_x86 *c = &cpu_data(policy->cpu); 556 struct cpuinfo_x86 *c = &cpu_data(policy->cpu);
551 struct acpi_processor_performance *perf; 557 struct acpi_processor_performance *perf;
558#ifdef CONFIG_SMP
559 static int blacklisted;
560#endif
552 561
553 dprintk("acpi_cpufreq_cpu_init\n"); 562 dprintk("acpi_cpufreq_cpu_init\n");
554 563
555#ifdef CONFIG_SMP 564#ifdef CONFIG_SMP
556 result = acpi_cpufreq_blacklist(c); 565 if (blacklisted)
557 if (result) 566 return blacklisted;
558 return result; 567 blacklisted = acpi_cpufreq_blacklist(c);
568 if (blacklisted)
569 return blacklisted;
559#endif 570#endif
560 571
561 data = kzalloc(sizeof(struct acpi_cpufreq_data), GFP_KERNEL); 572 data = kzalloc(sizeof(struct acpi_cpufreq_data), GFP_KERNEL);
diff --git a/arch/x86/kernel/cpu/cpufreq/longhaul.c b/arch/x86/kernel/cpu/cpufreq/longhaul.c
index ce2ed3e4aad9..cabd2fa3fc93 100644
--- a/arch/x86/kernel/cpu/cpufreq/longhaul.c
+++ b/arch/x86/kernel/cpu/cpufreq/longhaul.c
@@ -813,7 +813,7 @@ static int __init longhaul_cpu_init(struct cpufreq_policy *policy)
813 memcpy(eblcr, samuel2_eblcr, sizeof(samuel2_eblcr)); 813 memcpy(eblcr, samuel2_eblcr, sizeof(samuel2_eblcr));
814 break; 814 break;
815 case 1 ... 15: 815 case 1 ... 15:
816 longhaul_version = TYPE_LONGHAUL_V1; 816 longhaul_version = TYPE_LONGHAUL_V2;
817 if (c->x86_mask < 8) { 817 if (c->x86_mask < 8) {
818 cpu_model = CPU_SAMUEL2; 818 cpu_model = CPU_SAMUEL2;
819 cpuname = "C3 'Samuel 2' [C5B]"; 819 cpuname = "C3 'Samuel 2' [C5B]";
diff --git a/arch/x86/kernel/cpu/cpufreq/powernow-k8.c b/arch/x86/kernel/cpu/cpufreq/powernow-k8.c
index 6394aa5c7985..3f12dabeab52 100644
--- a/arch/x86/kernel/cpu/cpufreq/powernow-k8.c
+++ b/arch/x86/kernel/cpu/cpufreq/powernow-k8.c
@@ -1022,7 +1022,7 @@ static int get_transition_latency(struct powernow_k8_data *data)
1022 * set it to 1 to avoid problems in the future. 1022 * set it to 1 to avoid problems in the future.
1023 * For all others it's a BIOS bug. 1023 * For all others it's a BIOS bug.
1024 */ 1024 */
1025 if (!boot_cpu_data.x86 == 0x11) 1025 if (boot_cpu_data.x86 != 0x11)
1026 printk(KERN_ERR FW_WARN PFX "Invalid zero transition " 1026 printk(KERN_ERR FW_WARN PFX "Invalid zero transition "
1027 "latency\n"); 1027 "latency\n");
1028 max_latency = 1; 1028 max_latency = 1;
diff --git a/arch/x86/kernel/cpu/cpufreq/speedstep-ich.c b/arch/x86/kernel/cpu/cpufreq/speedstep-ich.c
index 6911e91fb4f6..3ae5a7a3a500 100644
--- a/arch/x86/kernel/cpu/cpufreq/speedstep-ich.c
+++ b/arch/x86/kernel/cpu/cpufreq/speedstep-ich.c
@@ -232,28 +232,23 @@ static unsigned int speedstep_detect_chipset(void)
232 return 0; 232 return 0;
233} 233}
234 234
235struct get_freq_data { 235static void get_freq_data(void *_speed)
236 unsigned int speed;
237 unsigned int processor;
238};
239
240static void get_freq_data(void *_data)
241{ 236{
242 struct get_freq_data *data = _data; 237 unsigned int *speed = _speed;
243 238
244 data->speed = speedstep_get_frequency(data->processor); 239 *speed = speedstep_get_frequency(speedstep_processor);
245} 240}
246 241
247static unsigned int speedstep_get(unsigned int cpu) 242static unsigned int speedstep_get(unsigned int cpu)
248{ 243{
249 struct get_freq_data data = { .processor = cpu }; 244 unsigned int speed;
250 245
251 /* You're supposed to ensure CPU is online. */ 246 /* You're supposed to ensure CPU is online. */
252 if (smp_call_function_single(cpu, get_freq_data, &data, 1) != 0) 247 if (smp_call_function_single(cpu, get_freq_data, &speed, 1) != 0)
253 BUG(); 248 BUG();
254 249
255 dprintk("detected %u kHz as current frequency\n", data.speed); 250 dprintk("detected %u kHz as current frequency\n", speed);
256 return data.speed; 251 return speed;
257} 252}
258 253
259/** 254/**
diff --git a/arch/x86/kernel/cpu/mcheck/mce.c b/arch/x86/kernel/cpu/mcheck/mce.c
index 721a77ca8115..0bcaa3875863 100644
--- a/arch/x86/kernel/cpu/mcheck/mce.c
+++ b/arch/x86/kernel/cpu/mcheck/mce.c
@@ -46,6 +46,9 @@
46 46
47#include "mce-internal.h" 47#include "mce-internal.h"
48 48
49#define CREATE_TRACE_POINTS
50#include <trace/events/mce.h>
51
49int mce_disabled __read_mostly; 52int mce_disabled __read_mostly;
50 53
51#define MISC_MCELOG_MINOR 227 54#define MISC_MCELOG_MINOR 227
@@ -85,18 +88,26 @@ static DECLARE_WAIT_QUEUE_HEAD(mce_wait);
85static DEFINE_PER_CPU(struct mce, mces_seen); 88static DEFINE_PER_CPU(struct mce, mces_seen);
86static int cpu_missing; 89static int cpu_missing;
87 90
88static void default_decode_mce(struct mce *m) 91/*
92 * CPU/chipset specific EDAC code can register a notifier call here to print
93 * MCE errors in a human-readable form.
94 */
95ATOMIC_NOTIFIER_HEAD(x86_mce_decoder_chain);
96EXPORT_SYMBOL_GPL(x86_mce_decoder_chain);
97
98static int default_decode_mce(struct notifier_block *nb, unsigned long val,
99 void *data)
89{ 100{
90 pr_emerg("No human readable MCE decoding support on this CPU type.\n"); 101 pr_emerg("No human readable MCE decoding support on this CPU type.\n");
91 pr_emerg("Run the message through 'mcelog --ascii' to decode.\n"); 102 pr_emerg("Run the message through 'mcelog --ascii' to decode.\n");
103
104 return NOTIFY_STOP;
92} 105}
93 106
94/* 107static struct notifier_block mce_dec_nb = {
95 * CPU/chipset specific EDAC code can register a callback here to print 108 .notifier_call = default_decode_mce,
96 * MCE errors in a human-readable form: 109 .priority = -1,
97 */ 110};
98void (*x86_mce_decode_callback)(struct mce *m) = default_decode_mce;
99EXPORT_SYMBOL(x86_mce_decode_callback);
100 111
101/* MCA banks polled by the period polling timer for corrected events */ 112/* MCA banks polled by the period polling timer for corrected events */
102DEFINE_PER_CPU(mce_banks_t, mce_poll_banks) = { 113DEFINE_PER_CPU(mce_banks_t, mce_poll_banks) = {
@@ -141,6 +152,9 @@ void mce_log(struct mce *mce)
141{ 152{
142 unsigned next, entry; 153 unsigned next, entry;
143 154
155 /* Emit the trace record: */
156 trace_mce_record(mce);
157
144 mce->finished = 0; 158 mce->finished = 0;
145 wmb(); 159 wmb();
146 for (;;) { 160 for (;;) {
@@ -204,9 +218,9 @@ static void print_mce(struct mce *m)
204 218
205 /* 219 /*
206 * Print out human-readable details about the MCE error, 220 * Print out human-readable details about the MCE error,
207 * (if the CPU has an implementation for that): 221 * (if the CPU has an implementation for that)
208 */ 222 */
209 x86_mce_decode_callback(m); 223 atomic_notifier_call_chain(&x86_mce_decoder_chain, 0, m);
210} 224}
211 225
212static void print_mce_head(void) 226static void print_mce_head(void)
@@ -1122,7 +1136,7 @@ static int check_interval = 5 * 60; /* 5 minutes */
1122static DEFINE_PER_CPU(int, mce_next_interval); /* in jiffies */ 1136static DEFINE_PER_CPU(int, mce_next_interval); /* in jiffies */
1123static DEFINE_PER_CPU(struct timer_list, mce_timer); 1137static DEFINE_PER_CPU(struct timer_list, mce_timer);
1124 1138
1125static void mcheck_timer(unsigned long data) 1139static void mce_start_timer(unsigned long data)
1126{ 1140{
1127 struct timer_list *t = &per_cpu(mce_timer, data); 1141 struct timer_list *t = &per_cpu(mce_timer, data);
1128 int *n; 1142 int *n;
@@ -1187,7 +1201,7 @@ int mce_notify_irq(void)
1187} 1201}
1188EXPORT_SYMBOL_GPL(mce_notify_irq); 1202EXPORT_SYMBOL_GPL(mce_notify_irq);
1189 1203
1190static int mce_banks_init(void) 1204static int __cpuinit __mcheck_cpu_mce_banks_init(void)
1191{ 1205{
1192 int i; 1206 int i;
1193 1207
@@ -1206,7 +1220,7 @@ static int mce_banks_init(void)
1206/* 1220/*
1207 * Initialize Machine Checks for a CPU. 1221 * Initialize Machine Checks for a CPU.
1208 */ 1222 */
1209static int __cpuinit mce_cap_init(void) 1223static int __cpuinit __mcheck_cpu_cap_init(void)
1210{ 1224{
1211 unsigned b; 1225 unsigned b;
1212 u64 cap; 1226 u64 cap;
@@ -1228,7 +1242,7 @@ static int __cpuinit mce_cap_init(void)
1228 WARN_ON(banks != 0 && b != banks); 1242 WARN_ON(banks != 0 && b != banks);
1229 banks = b; 1243 banks = b;
1230 if (!mce_banks) { 1244 if (!mce_banks) {
1231 int err = mce_banks_init(); 1245 int err = __mcheck_cpu_mce_banks_init();
1232 1246
1233 if (err) 1247 if (err)
1234 return err; 1248 return err;
@@ -1244,7 +1258,7 @@ static int __cpuinit mce_cap_init(void)
1244 return 0; 1258 return 0;
1245} 1259}
1246 1260
1247static void mce_init(void) 1261static void __mcheck_cpu_init_generic(void)
1248{ 1262{
1249 mce_banks_t all_banks; 1263 mce_banks_t all_banks;
1250 u64 cap; 1264 u64 cap;
@@ -1273,7 +1287,7 @@ static void mce_init(void)
1273} 1287}
1274 1288
1275/* Add per CPU specific workarounds here */ 1289/* Add per CPU specific workarounds here */
1276static int __cpuinit mce_cpu_quirks(struct cpuinfo_x86 *c) 1290static int __cpuinit __mcheck_cpu_apply_quirks(struct cpuinfo_x86 *c)
1277{ 1291{
1278 if (c->x86_vendor == X86_VENDOR_UNKNOWN) { 1292 if (c->x86_vendor == X86_VENDOR_UNKNOWN) {
1279 pr_info("MCE: unknown CPU type - not enabling MCE support.\n"); 1293 pr_info("MCE: unknown CPU type - not enabling MCE support.\n");
@@ -1341,7 +1355,7 @@ static int __cpuinit mce_cpu_quirks(struct cpuinfo_x86 *c)
1341 return 0; 1355 return 0;
1342} 1356}
1343 1357
1344static void __cpuinit mce_ancient_init(struct cpuinfo_x86 *c) 1358static void __cpuinit __mcheck_cpu_ancient_init(struct cpuinfo_x86 *c)
1345{ 1359{
1346 if (c->x86 != 5) 1360 if (c->x86 != 5)
1347 return; 1361 return;
@@ -1355,7 +1369,7 @@ static void __cpuinit mce_ancient_init(struct cpuinfo_x86 *c)
1355 } 1369 }
1356} 1370}
1357 1371
1358static void mce_cpu_features(struct cpuinfo_x86 *c) 1372static void __mcheck_cpu_init_vendor(struct cpuinfo_x86 *c)
1359{ 1373{
1360 switch (c->x86_vendor) { 1374 switch (c->x86_vendor) {
1361 case X86_VENDOR_INTEL: 1375 case X86_VENDOR_INTEL:
@@ -1369,7 +1383,7 @@ static void mce_cpu_features(struct cpuinfo_x86 *c)
1369 } 1383 }
1370} 1384}
1371 1385
1372static void mce_init_timer(void) 1386static void __mcheck_cpu_init_timer(void)
1373{ 1387{
1374 struct timer_list *t = &__get_cpu_var(mce_timer); 1388 struct timer_list *t = &__get_cpu_var(mce_timer);
1375 int *n = &__get_cpu_var(mce_next_interval); 1389 int *n = &__get_cpu_var(mce_next_interval);
@@ -1380,7 +1394,7 @@ static void mce_init_timer(void)
1380 *n = check_interval * HZ; 1394 *n = check_interval * HZ;
1381 if (!*n) 1395 if (!*n)
1382 return; 1396 return;
1383 setup_timer(t, mcheck_timer, smp_processor_id()); 1397 setup_timer(t, mce_start_timer, smp_processor_id());
1384 t->expires = round_jiffies(jiffies + *n); 1398 t->expires = round_jiffies(jiffies + *n);
1385 add_timer_on(t, smp_processor_id()); 1399 add_timer_on(t, smp_processor_id());
1386} 1400}
@@ -1400,27 +1414,28 @@ void (*machine_check_vector)(struct pt_regs *, long error_code) =
1400 * Called for each booted CPU to set up machine checks. 1414 * Called for each booted CPU to set up machine checks.
1401 * Must be called with preempt off: 1415 * Must be called with preempt off:
1402 */ 1416 */
1403void __cpuinit mcheck_init(struct cpuinfo_x86 *c) 1417void __cpuinit mcheck_cpu_init(struct cpuinfo_x86 *c)
1404{ 1418{
1405 if (mce_disabled) 1419 if (mce_disabled)
1406 return; 1420 return;
1407 1421
1408 mce_ancient_init(c); 1422 __mcheck_cpu_ancient_init(c);
1409 1423
1410 if (!mce_available(c)) 1424 if (!mce_available(c))
1411 return; 1425 return;
1412 1426
1413 if (mce_cap_init() < 0 || mce_cpu_quirks(c) < 0) { 1427 if (__mcheck_cpu_cap_init() < 0 || __mcheck_cpu_apply_quirks(c) < 0) {
1414 mce_disabled = 1; 1428 mce_disabled = 1;
1415 return; 1429 return;
1416 } 1430 }
1417 1431
1418 machine_check_vector = do_machine_check; 1432 machine_check_vector = do_machine_check;
1419 1433
1420 mce_init(); 1434 __mcheck_cpu_init_generic();
1421 mce_cpu_features(c); 1435 __mcheck_cpu_init_vendor(c);
1422 mce_init_timer(); 1436 __mcheck_cpu_init_timer();
1423 INIT_WORK(&__get_cpu_var(mce_work), mce_process_work); 1437 INIT_WORK(&__get_cpu_var(mce_work), mce_process_work);
1438
1424} 1439}
1425 1440
1426/* 1441/*
@@ -1640,6 +1655,15 @@ static int __init mcheck_enable(char *str)
1640} 1655}
1641__setup("mce", mcheck_enable); 1656__setup("mce", mcheck_enable);
1642 1657
1658int __init mcheck_init(void)
1659{
1660 atomic_notifier_chain_register(&x86_mce_decoder_chain, &mce_dec_nb);
1661
1662 mcheck_intel_therm_init();
1663
1664 return 0;
1665}
1666
1643/* 1667/*
1644 * Sysfs support 1668 * Sysfs support
1645 */ 1669 */
@@ -1648,7 +1672,7 @@ __setup("mce", mcheck_enable);
1648 * Disable machine checks on suspend and shutdown. We can't really handle 1672 * Disable machine checks on suspend and shutdown. We can't really handle
1649 * them later. 1673 * them later.
1650 */ 1674 */
1651static int mce_disable(void) 1675static int mce_disable_error_reporting(void)
1652{ 1676{
1653 int i; 1677 int i;
1654 1678
@@ -1663,12 +1687,12 @@ static int mce_disable(void)
1663 1687
1664static int mce_suspend(struct sys_device *dev, pm_message_t state) 1688static int mce_suspend(struct sys_device *dev, pm_message_t state)
1665{ 1689{
1666 return mce_disable(); 1690 return mce_disable_error_reporting();
1667} 1691}
1668 1692
1669static int mce_shutdown(struct sys_device *dev) 1693static int mce_shutdown(struct sys_device *dev)
1670{ 1694{
1671 return mce_disable(); 1695 return mce_disable_error_reporting();
1672} 1696}
1673 1697
1674/* 1698/*
@@ -1678,8 +1702,8 @@ static int mce_shutdown(struct sys_device *dev)
1678 */ 1702 */
1679static int mce_resume(struct sys_device *dev) 1703static int mce_resume(struct sys_device *dev)
1680{ 1704{
1681 mce_init(); 1705 __mcheck_cpu_init_generic();
1682 mce_cpu_features(&current_cpu_data); 1706 __mcheck_cpu_init_vendor(&current_cpu_data);
1683 1707
1684 return 0; 1708 return 0;
1685} 1709}
@@ -1689,8 +1713,8 @@ static void mce_cpu_restart(void *data)
1689 del_timer_sync(&__get_cpu_var(mce_timer)); 1713 del_timer_sync(&__get_cpu_var(mce_timer));
1690 if (!mce_available(&current_cpu_data)) 1714 if (!mce_available(&current_cpu_data))
1691 return; 1715 return;
1692 mce_init(); 1716 __mcheck_cpu_init_generic();
1693 mce_init_timer(); 1717 __mcheck_cpu_init_timer();
1694} 1718}
1695 1719
1696/* Reinit MCEs after user configuration changes */ 1720/* Reinit MCEs after user configuration changes */
@@ -1716,7 +1740,7 @@ static void mce_enable_ce(void *all)
1716 cmci_reenable(); 1740 cmci_reenable();
1717 cmci_recheck(); 1741 cmci_recheck();
1718 if (all) 1742 if (all)
1719 mce_init_timer(); 1743 __mcheck_cpu_init_timer();
1720} 1744}
1721 1745
1722static struct sysdev_class mce_sysclass = { 1746static struct sysdev_class mce_sysclass = {
@@ -1929,13 +1953,14 @@ static __cpuinit void mce_remove_device(unsigned int cpu)
1929} 1953}
1930 1954
1931/* Make sure there are no machine checks on offlined CPUs. */ 1955/* Make sure there are no machine checks on offlined CPUs. */
1932static void mce_disable_cpu(void *h) 1956static void __cpuinit mce_disable_cpu(void *h)
1933{ 1957{
1934 unsigned long action = *(unsigned long *)h; 1958 unsigned long action = *(unsigned long *)h;
1935 int i; 1959 int i;
1936 1960
1937 if (!mce_available(&current_cpu_data)) 1961 if (!mce_available(&current_cpu_data))
1938 return; 1962 return;
1963
1939 if (!(action & CPU_TASKS_FROZEN)) 1964 if (!(action & CPU_TASKS_FROZEN))
1940 cmci_clear(); 1965 cmci_clear();
1941 for (i = 0; i < banks; i++) { 1966 for (i = 0; i < banks; i++) {
@@ -1946,7 +1971,7 @@ static void mce_disable_cpu(void *h)
1946 } 1971 }
1947} 1972}
1948 1973
1949static void mce_reenable_cpu(void *h) 1974static void __cpuinit mce_reenable_cpu(void *h)
1950{ 1975{
1951 unsigned long action = *(unsigned long *)h; 1976 unsigned long action = *(unsigned long *)h;
1952 int i; 1977 int i;
@@ -2025,7 +2050,7 @@ static __init void mce_init_banks(void)
2025 } 2050 }
2026} 2051}
2027 2052
2028static __init int mce_init_device(void) 2053static __init int mcheck_init_device(void)
2029{ 2054{
2030 int err; 2055 int err;
2031 int i = 0; 2056 int i = 0;
@@ -2053,7 +2078,7 @@ static __init int mce_init_device(void)
2053 return err; 2078 return err;
2054} 2079}
2055 2080
2056device_initcall(mce_init_device); 2081device_initcall(mcheck_init_device);
2057 2082
2058/* 2083/*
2059 * Old style boot options parsing. Only for compatibility. 2084 * Old style boot options parsing. Only for compatibility.
@@ -2101,7 +2126,7 @@ static int fake_panic_set(void *data, u64 val)
2101DEFINE_SIMPLE_ATTRIBUTE(fake_panic_fops, fake_panic_get, 2126DEFINE_SIMPLE_ATTRIBUTE(fake_panic_fops, fake_panic_get,
2102 fake_panic_set, "%llu\n"); 2127 fake_panic_set, "%llu\n");
2103 2128
2104static int __init mce_debugfs_init(void) 2129static int __init mcheck_debugfs_init(void)
2105{ 2130{
2106 struct dentry *dmce, *ffake_panic; 2131 struct dentry *dmce, *ffake_panic;
2107 2132
@@ -2115,5 +2140,5 @@ static int __init mce_debugfs_init(void)
2115 2140
2116 return 0; 2141 return 0;
2117} 2142}
2118late_initcall(mce_debugfs_init); 2143late_initcall(mcheck_debugfs_init);
2119#endif 2144#endif
diff --git a/arch/x86/kernel/cpu/mcheck/therm_throt.c b/arch/x86/kernel/cpu/mcheck/therm_throt.c
index b3a1dba75330..4fef985fc221 100644
--- a/arch/x86/kernel/cpu/mcheck/therm_throt.c
+++ b/arch/x86/kernel/cpu/mcheck/therm_throt.c
@@ -49,6 +49,8 @@ static DEFINE_PER_CPU(struct thermal_state, thermal_state);
49 49
50static atomic_t therm_throt_en = ATOMIC_INIT(0); 50static atomic_t therm_throt_en = ATOMIC_INIT(0);
51 51
52static u32 lvtthmr_init __read_mostly;
53
52#ifdef CONFIG_SYSFS 54#ifdef CONFIG_SYSFS
53#define define_therm_throt_sysdev_one_ro(_name) \ 55#define define_therm_throt_sysdev_one_ro(_name) \
54 static SYSDEV_ATTR(_name, 0444, therm_throt_sysdev_show_##_name, NULL) 56 static SYSDEV_ATTR(_name, 0444, therm_throt_sysdev_show_##_name, NULL)
@@ -254,6 +256,18 @@ asmlinkage void smp_thermal_interrupt(struct pt_regs *regs)
254 ack_APIC_irq(); 256 ack_APIC_irq();
255} 257}
256 258
259void __init mcheck_intel_therm_init(void)
260{
261 /*
262 * This function is only called on boot CPU. Save the init thermal
263 * LVT value on BSP and use that value to restore APs' thermal LVT
264 * entry BIOS programmed later
265 */
266 if (cpu_has(&boot_cpu_data, X86_FEATURE_ACPI) &&
267 cpu_has(&boot_cpu_data, X86_FEATURE_ACC))
268 lvtthmr_init = apic_read(APIC_LVTTHMR);
269}
270
257void intel_init_thermal(struct cpuinfo_x86 *c) 271void intel_init_thermal(struct cpuinfo_x86 *c)
258{ 272{
259 unsigned int cpu = smp_processor_id(); 273 unsigned int cpu = smp_processor_id();
@@ -270,7 +284,20 @@ void intel_init_thermal(struct cpuinfo_x86 *c)
270 * since it might be delivered via SMI already: 284 * since it might be delivered via SMI already:
271 */ 285 */
272 rdmsr(MSR_IA32_MISC_ENABLE, l, h); 286 rdmsr(MSR_IA32_MISC_ENABLE, l, h);
273 h = apic_read(APIC_LVTTHMR); 287
288 /*
289 * The initial value of thermal LVT entries on all APs always reads
290 * 0x10000 because APs are woken up by BSP issuing INIT-SIPI-SIPI
291 * sequence to them and LVT registers are reset to 0s except for
292 * the mask bits which are set to 1s when APs receive INIT IPI.
293 * Always restore the value that BIOS has programmed on AP based on
294 * BSP's info we saved since BIOS is always setting the same value
295 * for all threads/cores
296 */
297 apic_write(APIC_LVTTHMR, lvtthmr_init);
298
299 h = lvtthmr_init;
300
274 if ((l & MSR_IA32_MISC_ENABLE_TM1) && (h & APIC_DM_SMI)) { 301 if ((l & MSR_IA32_MISC_ENABLE_TM1) && (h & APIC_DM_SMI)) {
275 printk(KERN_DEBUG 302 printk(KERN_DEBUG
276 "CPU%d: Thermal monitoring handled by SMI\n", cpu); 303 "CPU%d: Thermal monitoring handled by SMI\n", cpu);
diff --git a/arch/x86/kernel/cpu/mtrr/cleanup.c b/arch/x86/kernel/cpu/mtrr/cleanup.c
index 315738c74aad..73c86db5acbe 100644
--- a/arch/x86/kernel/cpu/mtrr/cleanup.c
+++ b/arch/x86/kernel/cpu/mtrr/cleanup.c
@@ -846,7 +846,7 @@ int __init mtrr_cleanup(unsigned address_bits)
846 sort(range, nr_range, sizeof(struct res_range), cmp_range, NULL); 846 sort(range, nr_range, sizeof(struct res_range), cmp_range, NULL);
847 847
848 range_sums = sum_ranges(range, nr_range); 848 range_sums = sum_ranges(range, nr_range);
849 printk(KERN_INFO "total RAM coverred: %ldM\n", 849 printk(KERN_INFO "total RAM covered: %ldM\n",
850 range_sums >> (20 - PAGE_SHIFT)); 850 range_sums >> (20 - PAGE_SHIFT));
851 851
852 if (mtrr_chunk_size && mtrr_gran_size) { 852 if (mtrr_chunk_size && mtrr_gran_size) {
diff --git a/arch/x86/kernel/cpu/perf_event.c b/arch/x86/kernel/cpu/perf_event.c
index b5801c311846..c1bbed1021d9 100644
--- a/arch/x86/kernel/cpu/perf_event.c
+++ b/arch/x86/kernel/cpu/perf_event.c
@@ -77,6 +77,18 @@ struct cpu_hw_events {
77 struct debug_store *ds; 77 struct debug_store *ds;
78}; 78};
79 79
80struct event_constraint {
81 unsigned long idxmsk[BITS_TO_LONGS(X86_PMC_IDX_MAX)];
82 int code;
83};
84
85#define EVENT_CONSTRAINT(c, m) { .code = (c), .idxmsk[0] = (m) }
86#define EVENT_CONSTRAINT_END { .code = 0, .idxmsk[0] = 0 }
87
88#define for_each_event_constraint(e, c) \
89 for ((e) = (c); (e)->idxmsk[0]; (e)++)
90
91
80/* 92/*
81 * struct x86_pmu - generic x86 pmu 93 * struct x86_pmu - generic x86 pmu
82 */ 94 */
@@ -102,6 +114,8 @@ struct x86_pmu {
102 u64 intel_ctrl; 114 u64 intel_ctrl;
103 void (*enable_bts)(u64 config); 115 void (*enable_bts)(u64 config);
104 void (*disable_bts)(void); 116 void (*disable_bts)(void);
117 int (*get_event_idx)(struct cpu_hw_events *cpuc,
118 struct hw_perf_event *hwc);
105}; 119};
106 120
107static struct x86_pmu x86_pmu __read_mostly; 121static struct x86_pmu x86_pmu __read_mostly;
@@ -110,6 +124,8 @@ static DEFINE_PER_CPU(struct cpu_hw_events, cpu_hw_events) = {
110 .enabled = 1, 124 .enabled = 1,
111}; 125};
112 126
127static const struct event_constraint *event_constraints;
128
113/* 129/*
114 * Not sure about some of these 130 * Not sure about some of these
115 */ 131 */
@@ -155,6 +171,16 @@ static u64 p6_pmu_raw_event(u64 hw_event)
155 return hw_event & P6_EVNTSEL_MASK; 171 return hw_event & P6_EVNTSEL_MASK;
156} 172}
157 173
174static const struct event_constraint intel_p6_event_constraints[] =
175{
176 EVENT_CONSTRAINT(0xc1, 0x1), /* FLOPS */
177 EVENT_CONSTRAINT(0x10, 0x1), /* FP_COMP_OPS_EXE */
178 EVENT_CONSTRAINT(0x11, 0x1), /* FP_ASSIST */
179 EVENT_CONSTRAINT(0x12, 0x2), /* MUL */
180 EVENT_CONSTRAINT(0x13, 0x2), /* DIV */
181 EVENT_CONSTRAINT(0x14, 0x1), /* CYCLES_DIV_BUSY */
182 EVENT_CONSTRAINT_END
183};
158 184
159/* 185/*
160 * Intel PerfMon v3. Used on Core2 and later. 186 * Intel PerfMon v3. Used on Core2 and later.
@@ -170,6 +196,35 @@ static const u64 intel_perfmon_event_map[] =
170 [PERF_COUNT_HW_BUS_CYCLES] = 0x013c, 196 [PERF_COUNT_HW_BUS_CYCLES] = 0x013c,
171}; 197};
172 198
199static const struct event_constraint intel_core_event_constraints[] =
200{
201 EVENT_CONSTRAINT(0x10, 0x1), /* FP_COMP_OPS_EXE */
202 EVENT_CONSTRAINT(0x11, 0x2), /* FP_ASSIST */
203 EVENT_CONSTRAINT(0x12, 0x2), /* MUL */
204 EVENT_CONSTRAINT(0x13, 0x2), /* DIV */
205 EVENT_CONSTRAINT(0x14, 0x1), /* CYCLES_DIV_BUSY */
206 EVENT_CONSTRAINT(0x18, 0x1), /* IDLE_DURING_DIV */
207 EVENT_CONSTRAINT(0x19, 0x2), /* DELAYED_BYPASS */
208 EVENT_CONSTRAINT(0xa1, 0x1), /* RS_UOPS_DISPATCH_CYCLES */
209 EVENT_CONSTRAINT(0xcb, 0x1), /* MEM_LOAD_RETIRED */
210 EVENT_CONSTRAINT_END
211};
212
213static const struct event_constraint intel_nehalem_event_constraints[] =
214{
215 EVENT_CONSTRAINT(0x40, 0x3), /* L1D_CACHE_LD */
216 EVENT_CONSTRAINT(0x41, 0x3), /* L1D_CACHE_ST */
217 EVENT_CONSTRAINT(0x42, 0x3), /* L1D_CACHE_LOCK */
218 EVENT_CONSTRAINT(0x43, 0x3), /* L1D_ALL_REF */
219 EVENT_CONSTRAINT(0x4e, 0x3), /* L1D_PREFETCH */
220 EVENT_CONSTRAINT(0x4c, 0x3), /* LOAD_HIT_PRE */
221 EVENT_CONSTRAINT(0x51, 0x3), /* L1D */
222 EVENT_CONSTRAINT(0x52, 0x3), /* L1D_CACHE_PREFETCH_LOCK_FB_HIT */
223 EVENT_CONSTRAINT(0x53, 0x3), /* L1D_CACHE_LOCK_FB_HIT */
224 EVENT_CONSTRAINT(0xc5, 0x3), /* CACHE_LOCK_CYCLES */
225 EVENT_CONSTRAINT_END
226};
227
173static u64 intel_pmu_event_map(int hw_event) 228static u64 intel_pmu_event_map(int hw_event)
174{ 229{
175 return intel_perfmon_event_map[hw_event]; 230 return intel_perfmon_event_map[hw_event];
@@ -190,7 +245,7 @@ static u64 __read_mostly hw_cache_event_ids
190 [PERF_COUNT_HW_CACHE_OP_MAX] 245 [PERF_COUNT_HW_CACHE_OP_MAX]
191 [PERF_COUNT_HW_CACHE_RESULT_MAX]; 246 [PERF_COUNT_HW_CACHE_RESULT_MAX];
192 247
193static const u64 nehalem_hw_cache_event_ids 248static __initconst u64 nehalem_hw_cache_event_ids
194 [PERF_COUNT_HW_CACHE_MAX] 249 [PERF_COUNT_HW_CACHE_MAX]
195 [PERF_COUNT_HW_CACHE_OP_MAX] 250 [PERF_COUNT_HW_CACHE_OP_MAX]
196 [PERF_COUNT_HW_CACHE_RESULT_MAX] = 251 [PERF_COUNT_HW_CACHE_RESULT_MAX] =
@@ -281,7 +336,7 @@ static const u64 nehalem_hw_cache_event_ids
281 }, 336 },
282}; 337};
283 338
284static const u64 core2_hw_cache_event_ids 339static __initconst u64 core2_hw_cache_event_ids
285 [PERF_COUNT_HW_CACHE_MAX] 340 [PERF_COUNT_HW_CACHE_MAX]
286 [PERF_COUNT_HW_CACHE_OP_MAX] 341 [PERF_COUNT_HW_CACHE_OP_MAX]
287 [PERF_COUNT_HW_CACHE_RESULT_MAX] = 342 [PERF_COUNT_HW_CACHE_RESULT_MAX] =
@@ -372,7 +427,7 @@ static const u64 core2_hw_cache_event_ids
372 }, 427 },
373}; 428};
374 429
375static const u64 atom_hw_cache_event_ids 430static __initconst u64 atom_hw_cache_event_ids
376 [PERF_COUNT_HW_CACHE_MAX] 431 [PERF_COUNT_HW_CACHE_MAX]
377 [PERF_COUNT_HW_CACHE_OP_MAX] 432 [PERF_COUNT_HW_CACHE_OP_MAX]
378 [PERF_COUNT_HW_CACHE_RESULT_MAX] = 433 [PERF_COUNT_HW_CACHE_RESULT_MAX] =
@@ -469,7 +524,7 @@ static u64 intel_pmu_raw_event(u64 hw_event)
469#define CORE_EVNTSEL_UNIT_MASK 0x0000FF00ULL 524#define CORE_EVNTSEL_UNIT_MASK 0x0000FF00ULL
470#define CORE_EVNTSEL_EDGE_MASK 0x00040000ULL 525#define CORE_EVNTSEL_EDGE_MASK 0x00040000ULL
471#define CORE_EVNTSEL_INV_MASK 0x00800000ULL 526#define CORE_EVNTSEL_INV_MASK 0x00800000ULL
472#define CORE_EVNTSEL_REG_MASK 0xFF000000ULL 527#define CORE_EVNTSEL_REG_MASK 0xFF000000ULL
473 528
474#define CORE_EVNTSEL_MASK \ 529#define CORE_EVNTSEL_MASK \
475 (CORE_EVNTSEL_EVENT_MASK | \ 530 (CORE_EVNTSEL_EVENT_MASK | \
@@ -481,7 +536,7 @@ static u64 intel_pmu_raw_event(u64 hw_event)
481 return hw_event & CORE_EVNTSEL_MASK; 536 return hw_event & CORE_EVNTSEL_MASK;
482} 537}
483 538
484static const u64 amd_hw_cache_event_ids 539static __initconst u64 amd_hw_cache_event_ids
485 [PERF_COUNT_HW_CACHE_MAX] 540 [PERF_COUNT_HW_CACHE_MAX]
486 [PERF_COUNT_HW_CACHE_OP_MAX] 541 [PERF_COUNT_HW_CACHE_OP_MAX]
487 [PERF_COUNT_HW_CACHE_RESULT_MAX] = 542 [PERF_COUNT_HW_CACHE_RESULT_MAX] =
@@ -932,6 +987,8 @@ static int __hw_perf_event_init(struct perf_event *event)
932 */ 987 */
933 hwc->config = ARCH_PERFMON_EVENTSEL_INT; 988 hwc->config = ARCH_PERFMON_EVENTSEL_INT;
934 989
990 hwc->idx = -1;
991
935 /* 992 /*
936 * Count user and OS events unless requested not to. 993 * Count user and OS events unless requested not to.
937 */ 994 */
@@ -1334,8 +1391,7 @@ static void amd_pmu_enable_event(struct hw_perf_event *hwc, int idx)
1334 x86_pmu_enable_event(hwc, idx); 1391 x86_pmu_enable_event(hwc, idx);
1335} 1392}
1336 1393
1337static int 1394static int fixed_mode_idx(struct hw_perf_event *hwc)
1338fixed_mode_idx(struct perf_event *event, struct hw_perf_event *hwc)
1339{ 1395{
1340 unsigned int hw_event; 1396 unsigned int hw_event;
1341 1397
@@ -1349,6 +1405,12 @@ fixed_mode_idx(struct perf_event *event, struct hw_perf_event *hwc)
1349 if (!x86_pmu.num_events_fixed) 1405 if (!x86_pmu.num_events_fixed)
1350 return -1; 1406 return -1;
1351 1407
1408 /*
1409 * fixed counters do not take all possible filters
1410 */
1411 if (hwc->config & ARCH_PERFMON_EVENT_FILTER_MASK)
1412 return -1;
1413
1352 if (unlikely(hw_event == x86_pmu.event_map(PERF_COUNT_HW_INSTRUCTIONS))) 1414 if (unlikely(hw_event == x86_pmu.event_map(PERF_COUNT_HW_INSTRUCTIONS)))
1353 return X86_PMC_IDX_FIXED_INSTRUCTIONS; 1415 return X86_PMC_IDX_FIXED_INSTRUCTIONS;
1354 if (unlikely(hw_event == x86_pmu.event_map(PERF_COUNT_HW_CPU_CYCLES))) 1416 if (unlikely(hw_event == x86_pmu.event_map(PERF_COUNT_HW_CPU_CYCLES)))
@@ -1360,22 +1422,57 @@ fixed_mode_idx(struct perf_event *event, struct hw_perf_event *hwc)
1360} 1422}
1361 1423
1362/* 1424/*
1363 * Find a PMC slot for the freshly enabled / scheduled in event: 1425 * generic counter allocator: get next free counter
1364 */ 1426 */
1365static int x86_pmu_enable(struct perf_event *event) 1427static int
1428gen_get_event_idx(struct cpu_hw_events *cpuc, struct hw_perf_event *hwc)
1429{
1430 int idx;
1431
1432 idx = find_first_zero_bit(cpuc->used_mask, x86_pmu.num_events);
1433 return idx == x86_pmu.num_events ? -1 : idx;
1434}
1435
1436/*
1437 * intel-specific counter allocator: check event constraints
1438 */
1439static int
1440intel_get_event_idx(struct cpu_hw_events *cpuc, struct hw_perf_event *hwc)
1441{
1442 const struct event_constraint *event_constraint;
1443 int i, code;
1444
1445 if (!event_constraints)
1446 goto skip;
1447
1448 code = hwc->config & CORE_EVNTSEL_EVENT_MASK;
1449
1450 for_each_event_constraint(event_constraint, event_constraints) {
1451 if (code == event_constraint->code) {
1452 for_each_bit(i, event_constraint->idxmsk, X86_PMC_IDX_MAX) {
1453 if (!test_and_set_bit(i, cpuc->used_mask))
1454 return i;
1455 }
1456 return -1;
1457 }
1458 }
1459skip:
1460 return gen_get_event_idx(cpuc, hwc);
1461}
1462
1463static int
1464x86_schedule_event(struct cpu_hw_events *cpuc, struct hw_perf_event *hwc)
1366{ 1465{
1367 struct cpu_hw_events *cpuc = &__get_cpu_var(cpu_hw_events);
1368 struct hw_perf_event *hwc = &event->hw;
1369 int idx; 1466 int idx;
1370 1467
1371 idx = fixed_mode_idx(event, hwc); 1468 idx = fixed_mode_idx(hwc);
1372 if (idx == X86_PMC_IDX_FIXED_BTS) { 1469 if (idx == X86_PMC_IDX_FIXED_BTS) {
1373 /* BTS is already occupied. */ 1470 /* BTS is already occupied. */
1374 if (test_and_set_bit(idx, cpuc->used_mask)) 1471 if (test_and_set_bit(idx, cpuc->used_mask))
1375 return -EAGAIN; 1472 return -EAGAIN;
1376 1473
1377 hwc->config_base = 0; 1474 hwc->config_base = 0;
1378 hwc->event_base = 0; 1475 hwc->event_base = 0;
1379 hwc->idx = idx; 1476 hwc->idx = idx;
1380 } else if (idx >= 0) { 1477 } else if (idx >= 0) {
1381 /* 1478 /*
@@ -1396,20 +1493,35 @@ static int x86_pmu_enable(struct perf_event *event)
1396 } else { 1493 } else {
1397 idx = hwc->idx; 1494 idx = hwc->idx;
1398 /* Try to get the previous generic event again */ 1495 /* Try to get the previous generic event again */
1399 if (test_and_set_bit(idx, cpuc->used_mask)) { 1496 if (idx == -1 || test_and_set_bit(idx, cpuc->used_mask)) {
1400try_generic: 1497try_generic:
1401 idx = find_first_zero_bit(cpuc->used_mask, 1498 idx = x86_pmu.get_event_idx(cpuc, hwc);
1402 x86_pmu.num_events); 1499 if (idx == -1)
1403 if (idx == x86_pmu.num_events)
1404 return -EAGAIN; 1500 return -EAGAIN;
1405 1501
1406 set_bit(idx, cpuc->used_mask); 1502 set_bit(idx, cpuc->used_mask);
1407 hwc->idx = idx; 1503 hwc->idx = idx;
1408 } 1504 }
1409 hwc->config_base = x86_pmu.eventsel; 1505 hwc->config_base = x86_pmu.eventsel;
1410 hwc->event_base = x86_pmu.perfctr; 1506 hwc->event_base = x86_pmu.perfctr;
1411 } 1507 }
1412 1508
1509 return idx;
1510}
1511
1512/*
1513 * Find a PMC slot for the freshly enabled / scheduled in event:
1514 */
1515static int x86_pmu_enable(struct perf_event *event)
1516{
1517 struct cpu_hw_events *cpuc = &__get_cpu_var(cpu_hw_events);
1518 struct hw_perf_event *hwc = &event->hw;
1519 int idx;
1520
1521 idx = x86_schedule_event(cpuc, hwc);
1522 if (idx < 0)
1523 return idx;
1524
1413 perf_events_lapic_init(); 1525 perf_events_lapic_init();
1414 1526
1415 x86_pmu.disable(hwc, idx); 1527 x86_pmu.disable(hwc, idx);
@@ -1852,7 +1964,7 @@ static __read_mostly struct notifier_block perf_event_nmi_notifier = {
1852 .priority = 1 1964 .priority = 1
1853}; 1965};
1854 1966
1855static struct x86_pmu p6_pmu = { 1967static __initconst struct x86_pmu p6_pmu = {
1856 .name = "p6", 1968 .name = "p6",
1857 .handle_irq = p6_pmu_handle_irq, 1969 .handle_irq = p6_pmu_handle_irq,
1858 .disable_all = p6_pmu_disable_all, 1970 .disable_all = p6_pmu_disable_all,
@@ -1877,9 +1989,10 @@ static struct x86_pmu p6_pmu = {
1877 */ 1989 */
1878 .event_bits = 32, 1990 .event_bits = 32,
1879 .event_mask = (1ULL << 32) - 1, 1991 .event_mask = (1ULL << 32) - 1,
1992 .get_event_idx = intel_get_event_idx,
1880}; 1993};
1881 1994
1882static struct x86_pmu intel_pmu = { 1995static __initconst struct x86_pmu intel_pmu = {
1883 .name = "Intel", 1996 .name = "Intel",
1884 .handle_irq = intel_pmu_handle_irq, 1997 .handle_irq = intel_pmu_handle_irq,
1885 .disable_all = intel_pmu_disable_all, 1998 .disable_all = intel_pmu_disable_all,
@@ -1900,9 +2013,10 @@ static struct x86_pmu intel_pmu = {
1900 .max_period = (1ULL << 31) - 1, 2013 .max_period = (1ULL << 31) - 1,
1901 .enable_bts = intel_pmu_enable_bts, 2014 .enable_bts = intel_pmu_enable_bts,
1902 .disable_bts = intel_pmu_disable_bts, 2015 .disable_bts = intel_pmu_disable_bts,
2016 .get_event_idx = intel_get_event_idx,
1903}; 2017};
1904 2018
1905static struct x86_pmu amd_pmu = { 2019static __initconst struct x86_pmu amd_pmu = {
1906 .name = "AMD", 2020 .name = "AMD",
1907 .handle_irq = amd_pmu_handle_irq, 2021 .handle_irq = amd_pmu_handle_irq,
1908 .disable_all = amd_pmu_disable_all, 2022 .disable_all = amd_pmu_disable_all,
@@ -1920,9 +2034,10 @@ static struct x86_pmu amd_pmu = {
1920 .apic = 1, 2034 .apic = 1,
1921 /* use highest bit to detect overflow */ 2035 /* use highest bit to detect overflow */
1922 .max_period = (1ULL << 47) - 1, 2036 .max_period = (1ULL << 47) - 1,
2037 .get_event_idx = gen_get_event_idx,
1923}; 2038};
1924 2039
1925static int p6_pmu_init(void) 2040static __init int p6_pmu_init(void)
1926{ 2041{
1927 switch (boot_cpu_data.x86_model) { 2042 switch (boot_cpu_data.x86_model) {
1928 case 1: 2043 case 1:
@@ -1932,10 +2047,12 @@ static int p6_pmu_init(void)
1932 case 7: 2047 case 7:
1933 case 8: 2048 case 8:
1934 case 11: /* Pentium III */ 2049 case 11: /* Pentium III */
2050 event_constraints = intel_p6_event_constraints;
1935 break; 2051 break;
1936 case 9: 2052 case 9:
1937 case 13: 2053 case 13:
1938 /* Pentium M */ 2054 /* Pentium M */
2055 event_constraints = intel_p6_event_constraints;
1939 break; 2056 break;
1940 default: 2057 default:
1941 pr_cont("unsupported p6 CPU model %d ", 2058 pr_cont("unsupported p6 CPU model %d ",
@@ -1954,7 +2071,7 @@ static int p6_pmu_init(void)
1954 return 0; 2071 return 0;
1955} 2072}
1956 2073
1957static int intel_pmu_init(void) 2074static __init int intel_pmu_init(void)
1958{ 2075{
1959 union cpuid10_edx edx; 2076 union cpuid10_edx edx;
1960 union cpuid10_eax eax; 2077 union cpuid10_eax eax;
@@ -2007,12 +2124,14 @@ static int intel_pmu_init(void)
2007 sizeof(hw_cache_event_ids)); 2124 sizeof(hw_cache_event_ids));
2008 2125
2009 pr_cont("Core2 events, "); 2126 pr_cont("Core2 events, ");
2127 event_constraints = intel_core_event_constraints;
2010 break; 2128 break;
2011 default: 2129 default:
2012 case 26: 2130 case 26:
2013 memcpy(hw_cache_event_ids, nehalem_hw_cache_event_ids, 2131 memcpy(hw_cache_event_ids, nehalem_hw_cache_event_ids,
2014 sizeof(hw_cache_event_ids)); 2132 sizeof(hw_cache_event_ids));
2015 2133
2134 event_constraints = intel_nehalem_event_constraints;
2016 pr_cont("Nehalem/Corei7 events, "); 2135 pr_cont("Nehalem/Corei7 events, ");
2017 break; 2136 break;
2018 case 28: 2137 case 28:
@@ -2025,7 +2144,7 @@ static int intel_pmu_init(void)
2025 return 0; 2144 return 0;
2026} 2145}
2027 2146
2028static int amd_pmu_init(void) 2147static __init int amd_pmu_init(void)
2029{ 2148{
2030 /* Performance-monitoring supported from K7 and later: */ 2149 /* Performance-monitoring supported from K7 and later: */
2031 if (boot_cpu_data.x86 < 6) 2150 if (boot_cpu_data.x86 < 6)
@@ -2105,11 +2224,47 @@ static const struct pmu pmu = {
2105 .unthrottle = x86_pmu_unthrottle, 2224 .unthrottle = x86_pmu_unthrottle,
2106}; 2225};
2107 2226
2227static int
2228validate_event(struct cpu_hw_events *cpuc, struct perf_event *event)
2229{
2230 struct hw_perf_event fake_event = event->hw;
2231
2232 if (event->pmu && event->pmu != &pmu)
2233 return 0;
2234
2235 return x86_schedule_event(cpuc, &fake_event) >= 0;
2236}
2237
2238static int validate_group(struct perf_event *event)
2239{
2240 struct perf_event *sibling, *leader = event->group_leader;
2241 struct cpu_hw_events fake_pmu;
2242
2243 memset(&fake_pmu, 0, sizeof(fake_pmu));
2244
2245 if (!validate_event(&fake_pmu, leader))
2246 return -ENOSPC;
2247
2248 list_for_each_entry(sibling, &leader->sibling_list, group_entry) {
2249 if (!validate_event(&fake_pmu, sibling))
2250 return -ENOSPC;
2251 }
2252
2253 if (!validate_event(&fake_pmu, event))
2254 return -ENOSPC;
2255
2256 return 0;
2257}
2258
2108const struct pmu *hw_perf_event_init(struct perf_event *event) 2259const struct pmu *hw_perf_event_init(struct perf_event *event)
2109{ 2260{
2110 int err; 2261 int err;
2111 2262
2112 err = __hw_perf_event_init(event); 2263 err = __hw_perf_event_init(event);
2264 if (!err) {
2265 if (event->group_leader != event)
2266 err = validate_group(event);
2267 }
2113 if (err) { 2268 if (err) {
2114 if (event->destroy) 2269 if (event->destroy)
2115 event->destroy(event); 2270 event->destroy(event);
diff --git a/arch/x86/kernel/cpu/perfctr-watchdog.c b/arch/x86/kernel/cpu/perfctr-watchdog.c
index fab786f60ed6..898df9719afb 100644
--- a/arch/x86/kernel/cpu/perfctr-watchdog.c
+++ b/arch/x86/kernel/cpu/perfctr-watchdog.c
@@ -712,7 +712,7 @@ static void probe_nmi_watchdog(void)
712 switch (boot_cpu_data.x86_vendor) { 712 switch (boot_cpu_data.x86_vendor) {
713 case X86_VENDOR_AMD: 713 case X86_VENDOR_AMD:
714 if (boot_cpu_data.x86 != 6 && boot_cpu_data.x86 != 15 && 714 if (boot_cpu_data.x86 != 6 && boot_cpu_data.x86 != 15 &&
715 boot_cpu_data.x86 != 16) 715 boot_cpu_data.x86 != 16 && boot_cpu_data.x86 != 17)
716 return; 716 return;
717 wd_ops = &k7_wd_ops; 717 wd_ops = &k7_wd_ops;
718 break; 718 break;
diff --git a/arch/x86/kernel/cpuid.c b/arch/x86/kernel/cpuid.c
index 6a52d4b36a30..7ef24a796992 100644
--- a/arch/x86/kernel/cpuid.c
+++ b/arch/x86/kernel/cpuid.c
@@ -116,21 +116,16 @@ static int cpuid_open(struct inode *inode, struct file *file)
116{ 116{
117 unsigned int cpu; 117 unsigned int cpu;
118 struct cpuinfo_x86 *c; 118 struct cpuinfo_x86 *c;
119 int ret = 0;
120
121 lock_kernel();
122 119
123 cpu = iminor(file->f_path.dentry->d_inode); 120 cpu = iminor(file->f_path.dentry->d_inode);
124 if (cpu >= nr_cpu_ids || !cpu_online(cpu)) { 121 if (cpu >= nr_cpu_ids || !cpu_online(cpu))
125 ret = -ENXIO; /* No such CPU */ 122 return -ENXIO; /* No such CPU */
126 goto out; 123
127 }
128 c = &cpu_data(cpu); 124 c = &cpu_data(cpu);
129 if (c->cpuid_level < 0) 125 if (c->cpuid_level < 0)
130 ret = -EIO; /* CPUID not supported */ 126 return -EIO; /* CPUID not supported */
131out: 127
132 unlock_kernel(); 128 return 0;
133 return ret;
134} 129}
135 130
136/* 131/*
diff --git a/arch/x86/kernel/crash.c b/arch/x86/kernel/crash.c
index 5e409dc298a4..a4849c10a77e 100644
--- a/arch/x86/kernel/crash.c
+++ b/arch/x86/kernel/crash.c
@@ -27,8 +27,7 @@
27#include <asm/cpu.h> 27#include <asm/cpu.h>
28#include <asm/reboot.h> 28#include <asm/reboot.h>
29#include <asm/virtext.h> 29#include <asm/virtext.h>
30#include <asm/iommu.h> 30#include <asm/x86_init.h>
31
32 31
33#if defined(CONFIG_SMP) && defined(CONFIG_X86_LOCAL_APIC) 32#if defined(CONFIG_SMP) && defined(CONFIG_X86_LOCAL_APIC)
34 33
@@ -106,7 +105,7 @@ void native_machine_crash_shutdown(struct pt_regs *regs)
106#endif 105#endif
107 106
108#ifdef CONFIG_X86_64 107#ifdef CONFIG_X86_64
109 pci_iommu_shutdown(); 108 x86_platform.iommu_shutdown();
110#endif 109#endif
111 110
112 crash_save_cpu(regs, safe_smp_processor_id()); 111 crash_save_cpu(regs, safe_smp_processor_id());
diff --git a/arch/x86/kernel/dumpstack.c b/arch/x86/kernel/dumpstack.c
index 2d8a371d4339..b8ce165dde5d 100644
--- a/arch/x86/kernel/dumpstack.c
+++ b/arch/x86/kernel/dumpstack.c
@@ -268,11 +268,12 @@ int __kprobes __die(const char *str, struct pt_regs *regs, long err)
268 268
269 show_registers(regs); 269 show_registers(regs);
270#ifdef CONFIG_X86_32 270#ifdef CONFIG_X86_32
271 sp = (unsigned long) (&regs->sp); 271 if (user_mode_vm(regs)) {
272 savesegment(ss, ss);
273 if (user_mode(regs)) {
274 sp = regs->sp; 272 sp = regs->sp;
275 ss = regs->ss & 0xffff; 273 ss = regs->ss & 0xffff;
274 } else {
275 sp = kernel_stack_pointer(regs);
276 savesegment(ss, ss);
276 } 277 }
277 printk(KERN_EMERG "EIP: [<%08lx>] ", regs->ip); 278 printk(KERN_EMERG "EIP: [<%08lx>] ", regs->ip);
278 print_symbol("%s", regs->ip); 279 print_symbol("%s", regs->ip);
diff --git a/arch/x86/kernel/entry_32.S b/arch/x86/kernel/entry_32.S
index c097e7d607c6..50b9c220e121 100644
--- a/arch/x86/kernel/entry_32.S
+++ b/arch/x86/kernel/entry_32.S
@@ -334,6 +334,10 @@ ENTRY(ret_from_fork)
334END(ret_from_fork) 334END(ret_from_fork)
335 335
336/* 336/*
337 * Interrupt exit functions should be protected against kprobes
338 */
339 .pushsection .kprobes.text, "ax"
340/*
337 * Return to user mode is not as complex as all this looks, 341 * Return to user mode is not as complex as all this looks,
338 * but we want the default path for a system call return to 342 * but we want the default path for a system call return to
339 * go as quickly as possible which is why some of this is 343 * go as quickly as possible which is why some of this is
@@ -383,6 +387,10 @@ need_resched:
383END(resume_kernel) 387END(resume_kernel)
384#endif 388#endif
385 CFI_ENDPROC 389 CFI_ENDPROC
390/*
391 * End of kprobes section
392 */
393 .popsection
386 394
387/* SYSENTER_RETURN points to after the "sysenter" instruction in 395/* SYSENTER_RETURN points to after the "sysenter" instruction in
388 the vsyscall page. See vsyscall-sysentry.S, which defines the symbol. */ 396 the vsyscall page. See vsyscall-sysentry.S, which defines the symbol. */
@@ -513,6 +521,10 @@ sysexit_audit:
513 PTGS_TO_GS_EX 521 PTGS_TO_GS_EX
514ENDPROC(ia32_sysenter_target) 522ENDPROC(ia32_sysenter_target)
515 523
524/*
525 * syscall stub including irq exit should be protected against kprobes
526 */
527 .pushsection .kprobes.text, "ax"
516 # system call handler stub 528 # system call handler stub
517ENTRY(system_call) 529ENTRY(system_call)
518 RING0_INT_FRAME # can't unwind into user space anyway 530 RING0_INT_FRAME # can't unwind into user space anyway
@@ -705,6 +717,10 @@ syscall_badsys:
705 jmp resume_userspace 717 jmp resume_userspace
706END(syscall_badsys) 718END(syscall_badsys)
707 CFI_ENDPROC 719 CFI_ENDPROC
720/*
721 * End of kprobes section
722 */
723 .popsection
708 724
709/* 725/*
710 * System calls that need a pt_regs pointer. 726 * System calls that need a pt_regs pointer.
@@ -814,6 +830,10 @@ common_interrupt:
814ENDPROC(common_interrupt) 830ENDPROC(common_interrupt)
815 CFI_ENDPROC 831 CFI_ENDPROC
816 832
833/*
834 * Irq entries should be protected against kprobes
835 */
836 .pushsection .kprobes.text, "ax"
817#define BUILD_INTERRUPT3(name, nr, fn) \ 837#define BUILD_INTERRUPT3(name, nr, fn) \
818ENTRY(name) \ 838ENTRY(name) \
819 RING0_INT_FRAME; \ 839 RING0_INT_FRAME; \
@@ -980,6 +1000,10 @@ ENTRY(spurious_interrupt_bug)
980 jmp error_code 1000 jmp error_code
981 CFI_ENDPROC 1001 CFI_ENDPROC
982END(spurious_interrupt_bug) 1002END(spurious_interrupt_bug)
1003/*
1004 * End of kprobes section
1005 */
1006 .popsection
983 1007
984ENTRY(kernel_thread_helper) 1008ENTRY(kernel_thread_helper)
985 pushl $0 # fake return address for unwinder 1009 pushl $0 # fake return address for unwinder
@@ -1185,17 +1209,14 @@ END(ftrace_graph_caller)
1185 1209
1186.globl return_to_handler 1210.globl return_to_handler
1187return_to_handler: 1211return_to_handler:
1188 pushl $0
1189 pushl %eax 1212 pushl %eax
1190 pushl %ecx
1191 pushl %edx 1213 pushl %edx
1192 movl %ebp, %eax 1214 movl %ebp, %eax
1193 call ftrace_return_to_handler 1215 call ftrace_return_to_handler
1194 movl %eax, 0xc(%esp) 1216 movl %eax, %ecx
1195 popl %edx 1217 popl %edx
1196 popl %ecx
1197 popl %eax 1218 popl %eax
1198 ret 1219 jmp *%ecx
1199#endif 1220#endif
1200 1221
1201.section .rodata,"a" 1222.section .rodata,"a"
diff --git a/arch/x86/kernel/entry_64.S b/arch/x86/kernel/entry_64.S
index b5c061f8f358..4deb8fc849dd 100644
--- a/arch/x86/kernel/entry_64.S
+++ b/arch/x86/kernel/entry_64.S
@@ -155,11 +155,11 @@ GLOBAL(return_to_handler)
155 155
156 call ftrace_return_to_handler 156 call ftrace_return_to_handler
157 157
158 movq %rax, 16(%rsp) 158 movq %rax, %rdi
159 movq 8(%rsp), %rdx 159 movq 8(%rsp), %rdx
160 movq (%rsp), %rax 160 movq (%rsp), %rax
161 addq $16, %rsp 161 addq $24, %rsp
162 retq 162 jmp *%rdi
163#endif 163#endif
164 164
165 165
@@ -803,6 +803,10 @@ END(interrupt)
803 call \func 803 call \func
804 .endm 804 .endm
805 805
806/*
807 * Interrupt entry/exit should be protected against kprobes
808 */
809 .pushsection .kprobes.text, "ax"
806 /* 810 /*
807 * The interrupt stubs push (~vector+0x80) onto the stack and 811 * The interrupt stubs push (~vector+0x80) onto the stack and
808 * then jump to common_interrupt. 812 * then jump to common_interrupt.
@@ -941,6 +945,10 @@ ENTRY(retint_kernel)
941 945
942 CFI_ENDPROC 946 CFI_ENDPROC
943END(common_interrupt) 947END(common_interrupt)
948/*
949 * End of kprobes section
950 */
951 .popsection
944 952
945/* 953/*
946 * APIC interrupts. 954 * APIC interrupts.
@@ -1491,12 +1499,17 @@ error_kernelspace:
1491 leaq irq_return(%rip),%rcx 1499 leaq irq_return(%rip),%rcx
1492 cmpq %rcx,RIP+8(%rsp) 1500 cmpq %rcx,RIP+8(%rsp)
1493 je error_swapgs 1501 je error_swapgs
1494 movl %ecx,%ecx /* zero extend */ 1502 movl %ecx,%eax /* zero extend */
1495 cmpq %rcx,RIP+8(%rsp) 1503 cmpq %rax,RIP+8(%rsp)
1496 je error_swapgs 1504 je bstep_iret
1497 cmpq $gs_change,RIP+8(%rsp) 1505 cmpq $gs_change,RIP+8(%rsp)
1498 je error_swapgs 1506 je error_swapgs
1499 jmp error_sti 1507 jmp error_sti
1508
1509bstep_iret:
1510 /* Fix truncated RIP */
1511 movq %rcx,RIP+8(%rsp)
1512 jmp error_swapgs
1500END(error_entry) 1513END(error_entry)
1501 1514
1502 1515
diff --git a/arch/x86/kernel/ftrace.c b/arch/x86/kernel/ftrace.c
index 9dbb527e1652..5a1b9758fd62 100644
--- a/arch/x86/kernel/ftrace.c
+++ b/arch/x86/kernel/ftrace.c
@@ -9,6 +9,8 @@
9 * the dangers of modifying code on the run. 9 * the dangers of modifying code on the run.
10 */ 10 */
11 11
12#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
13
12#include <linux/spinlock.h> 14#include <linux/spinlock.h>
13#include <linux/hardirq.h> 15#include <linux/hardirq.h>
14#include <linux/uaccess.h> 16#include <linux/uaccess.h>
@@ -336,15 +338,15 @@ int __init ftrace_dyn_arch_init(void *data)
336 338
337 switch (faulted) { 339 switch (faulted) {
338 case 0: 340 case 0:
339 pr_info("ftrace: converting mcount calls to 0f 1f 44 00 00\n"); 341 pr_info("converting mcount calls to 0f 1f 44 00 00\n");
340 memcpy(ftrace_nop, ftrace_test_p6nop, MCOUNT_INSN_SIZE); 342 memcpy(ftrace_nop, ftrace_test_p6nop, MCOUNT_INSN_SIZE);
341 break; 343 break;
342 case 1: 344 case 1:
343 pr_info("ftrace: converting mcount calls to 66 66 66 66 90\n"); 345 pr_info("converting mcount calls to 66 66 66 66 90\n");
344 memcpy(ftrace_nop, ftrace_test_nop5, MCOUNT_INSN_SIZE); 346 memcpy(ftrace_nop, ftrace_test_nop5, MCOUNT_INSN_SIZE);
345 break; 347 break;
346 case 2: 348 case 2:
347 pr_info("ftrace: converting mcount calls to jmp . + 5\n"); 349 pr_info("converting mcount calls to jmp . + 5\n");
348 memcpy(ftrace_nop, ftrace_test_jmp, MCOUNT_INSN_SIZE); 350 memcpy(ftrace_nop, ftrace_test_jmp, MCOUNT_INSN_SIZE);
349 break; 351 break;
350 } 352 }
@@ -468,82 +470,10 @@ void prepare_ftrace_return(unsigned long *parent, unsigned long self_addr,
468 470
469#ifdef CONFIG_FTRACE_SYSCALLS 471#ifdef CONFIG_FTRACE_SYSCALLS
470 472
471extern unsigned long __start_syscalls_metadata[];
472extern unsigned long __stop_syscalls_metadata[];
473extern unsigned long *sys_call_table; 473extern unsigned long *sys_call_table;
474 474
475static struct syscall_metadata **syscalls_metadata; 475unsigned long __init arch_syscall_addr(int nr)
476
477static struct syscall_metadata *find_syscall_meta(unsigned long *syscall)
478{
479 struct syscall_metadata *start;
480 struct syscall_metadata *stop;
481 char str[KSYM_SYMBOL_LEN];
482
483
484 start = (struct syscall_metadata *)__start_syscalls_metadata;
485 stop = (struct syscall_metadata *)__stop_syscalls_metadata;
486 kallsyms_lookup((unsigned long) syscall, NULL, NULL, NULL, str);
487
488 for ( ; start < stop; start++) {
489 if (start->name && !strcmp(start->name, str))
490 return start;
491 }
492 return NULL;
493}
494
495struct syscall_metadata *syscall_nr_to_meta(int nr)
496{
497 if (!syscalls_metadata || nr >= NR_syscalls || nr < 0)
498 return NULL;
499
500 return syscalls_metadata[nr];
501}
502
503int syscall_name_to_nr(char *name)
504{ 476{
505 int i; 477 return (unsigned long)(&sys_call_table)[nr];
506
507 if (!syscalls_metadata)
508 return -1;
509
510 for (i = 0; i < NR_syscalls; i++) {
511 if (syscalls_metadata[i]) {
512 if (!strcmp(syscalls_metadata[i]->name, name))
513 return i;
514 }
515 }
516 return -1;
517}
518
519void set_syscall_enter_id(int num, int id)
520{
521 syscalls_metadata[num]->enter_id = id;
522}
523
524void set_syscall_exit_id(int num, int id)
525{
526 syscalls_metadata[num]->exit_id = id;
527}
528
529static int __init arch_init_ftrace_syscalls(void)
530{
531 int i;
532 struct syscall_metadata *meta;
533 unsigned long **psys_syscall_table = &sys_call_table;
534
535 syscalls_metadata = kzalloc(sizeof(*syscalls_metadata) *
536 NR_syscalls, GFP_KERNEL);
537 if (!syscalls_metadata) {
538 WARN_ON(1);
539 return -ENOMEM;
540 }
541
542 for (i = 0; i < NR_syscalls; i++) {
543 meta = find_syscall_meta(psys_syscall_table[i]);
544 syscalls_metadata[i] = meta;
545 }
546 return 0;
547} 478}
548arch_initcall(arch_init_ftrace_syscalls);
549#endif 479#endif
diff --git a/arch/x86/kernel/head_64.S b/arch/x86/kernel/head_64.S
index 780cd928fcd5..22db86a37643 100644
--- a/arch/x86/kernel/head_64.S
+++ b/arch/x86/kernel/head_64.S
@@ -212,8 +212,8 @@ ENTRY(secondary_startup_64)
212 */ 212 */
213 lgdt early_gdt_descr(%rip) 213 lgdt early_gdt_descr(%rip)
214 214
215 /* set up data segments. actually 0 would do too */ 215 /* set up data segments */
216 movl $__KERNEL_DS,%eax 216 xorl %eax,%eax
217 movl %eax,%ds 217 movl %eax,%ds
218 movl %eax,%ss 218 movl %eax,%ss
219 movl %eax,%es 219 movl %eax,%es
diff --git a/arch/x86/kernel/hw_breakpoint.c b/arch/x86/kernel/hw_breakpoint.c
new file mode 100644
index 000000000000..d42f65ac4927
--- /dev/null
+++ b/arch/x86/kernel/hw_breakpoint.c
@@ -0,0 +1,555 @@
1/*
2 * This program is free software; you can redistribute it and/or modify
3 * it under the terms of the GNU General Public License as published by
4 * the Free Software Foundation; either version 2 of the License, or
5 * (at your option) any later version.
6 *
7 * This program is distributed in the hope that it will be useful,
8 * but WITHOUT ANY WARRANTY; without even the implied warranty of
9 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10 * GNU General Public License for more details.
11 *
12 * You should have received a copy of the GNU General Public License
13 * along with this program; if not, write to the Free Software
14 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
15 *
16 * Copyright (C) 2007 Alan Stern
17 * Copyright (C) 2009 IBM Corporation
18 * Copyright (C) 2009 Frederic Weisbecker <fweisbec@gmail.com>
19 *
20 * Authors: Alan Stern <stern@rowland.harvard.edu>
21 * K.Prasad <prasad@linux.vnet.ibm.com>
22 * Frederic Weisbecker <fweisbec@gmail.com>
23 */
24
25/*
26 * HW_breakpoint: a unified kernel/user-space hardware breakpoint facility,
27 * using the CPU's debug registers.
28 */
29
30#include <linux/perf_event.h>
31#include <linux/hw_breakpoint.h>
32#include <linux/irqflags.h>
33#include <linux/notifier.h>
34#include <linux/kallsyms.h>
35#include <linux/kprobes.h>
36#include <linux/percpu.h>
37#include <linux/kdebug.h>
38#include <linux/kernel.h>
39#include <linux/module.h>
40#include <linux/sched.h>
41#include <linux/init.h>
42#include <linux/smp.h>
43
44#include <asm/hw_breakpoint.h>
45#include <asm/processor.h>
46#include <asm/debugreg.h>
47
48/* Per cpu debug control register value */
49DEFINE_PER_CPU(unsigned long, cpu_dr7);
50EXPORT_PER_CPU_SYMBOL(cpu_dr7);
51
52/* Per cpu debug address registers values */
53static DEFINE_PER_CPU(unsigned long, cpu_debugreg[HBP_NUM]);
54
55/*
56 * Stores the breakpoints currently in use on each breakpoint address
57 * register for each cpus
58 */
59static DEFINE_PER_CPU(struct perf_event *, bp_per_reg[HBP_NUM]);
60
61
62static inline unsigned long
63__encode_dr7(int drnum, unsigned int len, unsigned int type)
64{
65 unsigned long bp_info;
66
67 bp_info = (len | type) & 0xf;
68 bp_info <<= (DR_CONTROL_SHIFT + drnum * DR_CONTROL_SIZE);
69 bp_info |= (DR_GLOBAL_ENABLE << (drnum * DR_ENABLE_SIZE));
70
71 return bp_info;
72}
73
74/*
75 * Encode the length, type, Exact, and Enable bits for a particular breakpoint
76 * as stored in debug register 7.
77 */
78unsigned long encode_dr7(int drnum, unsigned int len, unsigned int type)
79{
80 return __encode_dr7(drnum, len, type) | DR_GLOBAL_SLOWDOWN;
81}
82
83/*
84 * Decode the length and type bits for a particular breakpoint as
85 * stored in debug register 7. Return the "enabled" status.
86 */
87int decode_dr7(unsigned long dr7, int bpnum, unsigned *len, unsigned *type)
88{
89 int bp_info = dr7 >> (DR_CONTROL_SHIFT + bpnum * DR_CONTROL_SIZE);
90
91 *len = (bp_info & 0xc) | 0x40;
92 *type = (bp_info & 0x3) | 0x80;
93
94 return (dr7 >> (bpnum * DR_ENABLE_SIZE)) & 0x3;
95}
96
97/*
98 * Install a perf counter breakpoint.
99 *
100 * We seek a free debug address register and use it for this
101 * breakpoint. Eventually we enable it in the debug control register.
102 *
103 * Atomic: we hold the counter->ctx->lock and we only handle variables
104 * and registers local to this cpu.
105 */
106int arch_install_hw_breakpoint(struct perf_event *bp)
107{
108 struct arch_hw_breakpoint *info = counter_arch_bp(bp);
109 unsigned long *dr7;
110 int i;
111
112 for (i = 0; i < HBP_NUM; i++) {
113 struct perf_event **slot = &__get_cpu_var(bp_per_reg[i]);
114
115 if (!*slot) {
116 *slot = bp;
117 break;
118 }
119 }
120
121 if (WARN_ONCE(i == HBP_NUM, "Can't find any breakpoint slot"))
122 return -EBUSY;
123
124 set_debugreg(info->address, i);
125 __get_cpu_var(cpu_debugreg[i]) = info->address;
126
127 dr7 = &__get_cpu_var(cpu_dr7);
128 *dr7 |= encode_dr7(i, info->len, info->type);
129
130 set_debugreg(*dr7, 7);
131
132 return 0;
133}
134
135/*
136 * Uninstall the breakpoint contained in the given counter.
137 *
138 * First we search the debug address register it uses and then we disable
139 * it.
140 *
141 * Atomic: we hold the counter->ctx->lock and we only handle variables
142 * and registers local to this cpu.
143 */
144void arch_uninstall_hw_breakpoint(struct perf_event *bp)
145{
146 struct arch_hw_breakpoint *info = counter_arch_bp(bp);
147 unsigned long *dr7;
148 int i;
149
150 for (i = 0; i < HBP_NUM; i++) {
151 struct perf_event **slot = &__get_cpu_var(bp_per_reg[i]);
152
153 if (*slot == bp) {
154 *slot = NULL;
155 break;
156 }
157 }
158
159 if (WARN_ONCE(i == HBP_NUM, "Can't find any breakpoint slot"))
160 return;
161
162 dr7 = &__get_cpu_var(cpu_dr7);
163 *dr7 &= ~__encode_dr7(i, info->len, info->type);
164
165 set_debugreg(*dr7, 7);
166}
167
168static int get_hbp_len(u8 hbp_len)
169{
170 unsigned int len_in_bytes = 0;
171
172 switch (hbp_len) {
173 case X86_BREAKPOINT_LEN_1:
174 len_in_bytes = 1;
175 break;
176 case X86_BREAKPOINT_LEN_2:
177 len_in_bytes = 2;
178 break;
179 case X86_BREAKPOINT_LEN_4:
180 len_in_bytes = 4;
181 break;
182#ifdef CONFIG_X86_64
183 case X86_BREAKPOINT_LEN_8:
184 len_in_bytes = 8;
185 break;
186#endif
187 }
188 return len_in_bytes;
189}
190
191/*
192 * Check for virtual address in user space.
193 */
194int arch_check_va_in_userspace(unsigned long va, u8 hbp_len)
195{
196 unsigned int len;
197
198 len = get_hbp_len(hbp_len);
199
200 return (va <= TASK_SIZE - len);
201}
202
203/*
204 * Check for virtual address in kernel space.
205 */
206static int arch_check_va_in_kernelspace(unsigned long va, u8 hbp_len)
207{
208 unsigned int len;
209
210 len = get_hbp_len(hbp_len);
211
212 return (va >= TASK_SIZE) && ((va + len - 1) >= TASK_SIZE);
213}
214
215/*
216 * Store a breakpoint's encoded address, length, and type.
217 */
218static int arch_store_info(struct perf_event *bp)
219{
220 struct arch_hw_breakpoint *info = counter_arch_bp(bp);
221 /*
222 * For kernel-addresses, either the address or symbol name can be
223 * specified.
224 */
225 if (info->name)
226 info->address = (unsigned long)
227 kallsyms_lookup_name(info->name);
228 if (info->address)
229 return 0;
230
231 return -EINVAL;
232}
233
234int arch_bp_generic_fields(int x86_len, int x86_type,
235 int *gen_len, int *gen_type)
236{
237 /* Len */
238 switch (x86_len) {
239 case X86_BREAKPOINT_LEN_1:
240 *gen_len = HW_BREAKPOINT_LEN_1;
241 break;
242 case X86_BREAKPOINT_LEN_2:
243 *gen_len = HW_BREAKPOINT_LEN_2;
244 break;
245 case X86_BREAKPOINT_LEN_4:
246 *gen_len = HW_BREAKPOINT_LEN_4;
247 break;
248#ifdef CONFIG_X86_64
249 case X86_BREAKPOINT_LEN_8:
250 *gen_len = HW_BREAKPOINT_LEN_8;
251 break;
252#endif
253 default:
254 return -EINVAL;
255 }
256
257 /* Type */
258 switch (x86_type) {
259 case X86_BREAKPOINT_EXECUTE:
260 *gen_type = HW_BREAKPOINT_X;
261 break;
262 case X86_BREAKPOINT_WRITE:
263 *gen_type = HW_BREAKPOINT_W;
264 break;
265 case X86_BREAKPOINT_RW:
266 *gen_type = HW_BREAKPOINT_W | HW_BREAKPOINT_R;
267 break;
268 default:
269 return -EINVAL;
270 }
271
272 return 0;
273}
274
275
276static int arch_build_bp_info(struct perf_event *bp)
277{
278 struct arch_hw_breakpoint *info = counter_arch_bp(bp);
279
280 info->address = bp->attr.bp_addr;
281
282 /* Len */
283 switch (bp->attr.bp_len) {
284 case HW_BREAKPOINT_LEN_1:
285 info->len = X86_BREAKPOINT_LEN_1;
286 break;
287 case HW_BREAKPOINT_LEN_2:
288 info->len = X86_BREAKPOINT_LEN_2;
289 break;
290 case HW_BREAKPOINT_LEN_4:
291 info->len = X86_BREAKPOINT_LEN_4;
292 break;
293#ifdef CONFIG_X86_64
294 case HW_BREAKPOINT_LEN_8:
295 info->len = X86_BREAKPOINT_LEN_8;
296 break;
297#endif
298 default:
299 return -EINVAL;
300 }
301
302 /* Type */
303 switch (bp->attr.bp_type) {
304 case HW_BREAKPOINT_W:
305 info->type = X86_BREAKPOINT_WRITE;
306 break;
307 case HW_BREAKPOINT_W | HW_BREAKPOINT_R:
308 info->type = X86_BREAKPOINT_RW;
309 break;
310 case HW_BREAKPOINT_X:
311 info->type = X86_BREAKPOINT_EXECUTE;
312 break;
313 default:
314 return -EINVAL;
315 }
316
317 return 0;
318}
319/*
320 * Validate the arch-specific HW Breakpoint register settings
321 */
322int arch_validate_hwbkpt_settings(struct perf_event *bp,
323 struct task_struct *tsk)
324{
325 struct arch_hw_breakpoint *info = counter_arch_bp(bp);
326 unsigned int align;
327 int ret;
328
329
330 ret = arch_build_bp_info(bp);
331 if (ret)
332 return ret;
333
334 ret = -EINVAL;
335
336 if (info->type == X86_BREAKPOINT_EXECUTE)
337 /*
338 * Ptrace-refactoring code
339 * For now, we'll allow instruction breakpoint only for user-space
340 * addresses
341 */
342 if ((!arch_check_va_in_userspace(info->address, info->len)) &&
343 info->len != X86_BREAKPOINT_EXECUTE)
344 return ret;
345
346 switch (info->len) {
347 case X86_BREAKPOINT_LEN_1:
348 align = 0;
349 break;
350 case X86_BREAKPOINT_LEN_2:
351 align = 1;
352 break;
353 case X86_BREAKPOINT_LEN_4:
354 align = 3;
355 break;
356#ifdef CONFIG_X86_64
357 case X86_BREAKPOINT_LEN_8:
358 align = 7;
359 break;
360#endif
361 default:
362 return ret;
363 }
364
365 if (bp->callback)
366 ret = arch_store_info(bp);
367
368 if (ret < 0)
369 return ret;
370 /*
371 * Check that the low-order bits of the address are appropriate
372 * for the alignment implied by len.
373 */
374 if (info->address & align)
375 return -EINVAL;
376
377 /* Check that the virtual address is in the proper range */
378 if (tsk) {
379 if (!arch_check_va_in_userspace(info->address, info->len))
380 return -EFAULT;
381 } else {
382 if (!arch_check_va_in_kernelspace(info->address, info->len))
383 return -EFAULT;
384 }
385
386 return 0;
387}
388
389/*
390 * Dump the debug register contents to the user.
391 * We can't dump our per cpu values because it
392 * may contain cpu wide breakpoint, something that
393 * doesn't belong to the current task.
394 *
395 * TODO: include non-ptrace user breakpoints (perf)
396 */
397void aout_dump_debugregs(struct user *dump)
398{
399 int i;
400 int dr7 = 0;
401 struct perf_event *bp;
402 struct arch_hw_breakpoint *info;
403 struct thread_struct *thread = &current->thread;
404
405 for (i = 0; i < HBP_NUM; i++) {
406 bp = thread->ptrace_bps[i];
407
408 if (bp && !bp->attr.disabled) {
409 dump->u_debugreg[i] = bp->attr.bp_addr;
410 info = counter_arch_bp(bp);
411 dr7 |= encode_dr7(i, info->len, info->type);
412 } else {
413 dump->u_debugreg[i] = 0;
414 }
415 }
416
417 dump->u_debugreg[4] = 0;
418 dump->u_debugreg[5] = 0;
419 dump->u_debugreg[6] = current->thread.debugreg6;
420
421 dump->u_debugreg[7] = dr7;
422}
423EXPORT_SYMBOL_GPL(aout_dump_debugregs);
424
425/*
426 * Release the user breakpoints used by ptrace
427 */
428void flush_ptrace_hw_breakpoint(struct task_struct *tsk)
429{
430 int i;
431 struct thread_struct *t = &tsk->thread;
432
433 for (i = 0; i < HBP_NUM; i++) {
434 unregister_hw_breakpoint(t->ptrace_bps[i]);
435 t->ptrace_bps[i] = NULL;
436 }
437}
438
439void hw_breakpoint_restore(void)
440{
441 set_debugreg(__get_cpu_var(cpu_debugreg[0]), 0);
442 set_debugreg(__get_cpu_var(cpu_debugreg[1]), 1);
443 set_debugreg(__get_cpu_var(cpu_debugreg[2]), 2);
444 set_debugreg(__get_cpu_var(cpu_debugreg[3]), 3);
445 set_debugreg(current->thread.debugreg6, 6);
446 set_debugreg(__get_cpu_var(cpu_dr7), 7);
447}
448EXPORT_SYMBOL_GPL(hw_breakpoint_restore);
449
450/*
451 * Handle debug exception notifications.
452 *
453 * Return value is either NOTIFY_STOP or NOTIFY_DONE as explained below.
454 *
455 * NOTIFY_DONE returned if one of the following conditions is true.
456 * i) When the causative address is from user-space and the exception
457 * is a valid one, i.e. not triggered as a result of lazy debug register
458 * switching
459 * ii) When there are more bits than trap<n> set in DR6 register (such
460 * as BD, BS or BT) indicating that more than one debug condition is
461 * met and requires some more action in do_debug().
462 *
463 * NOTIFY_STOP returned for all other cases
464 *
465 */
466static int __kprobes hw_breakpoint_handler(struct die_args *args)
467{
468 int i, cpu, rc = NOTIFY_STOP;
469 struct perf_event *bp;
470 unsigned long dr7, dr6;
471 unsigned long *dr6_p;
472
473 /* The DR6 value is pointed by args->err */
474 dr6_p = (unsigned long *)ERR_PTR(args->err);
475 dr6 = *dr6_p;
476
477 /* Do an early return if no trap bits are set in DR6 */
478 if ((dr6 & DR_TRAP_BITS) == 0)
479 return NOTIFY_DONE;
480
481 get_debugreg(dr7, 7);
482 /* Disable breakpoints during exception handling */
483 set_debugreg(0UL, 7);
484 /*
485 * Assert that local interrupts are disabled
486 * Reset the DRn bits in the virtualized register value.
487 * The ptrace trigger routine will add in whatever is needed.
488 */
489 current->thread.debugreg6 &= ~DR_TRAP_BITS;
490 cpu = get_cpu();
491
492 /* Handle all the breakpoints that were triggered */
493 for (i = 0; i < HBP_NUM; ++i) {
494 if (likely(!(dr6 & (DR_TRAP0 << i))))
495 continue;
496
497 /*
498 * The counter may be concurrently released but that can only
499 * occur from a call_rcu() path. We can then safely fetch
500 * the breakpoint, use its callback, touch its counter
501 * while we are in an rcu_read_lock() path.
502 */
503 rcu_read_lock();
504
505 bp = per_cpu(bp_per_reg[i], cpu);
506 if (bp)
507 rc = NOTIFY_DONE;
508 /*
509 * Reset the 'i'th TRAP bit in dr6 to denote completion of
510 * exception handling
511 */
512 (*dr6_p) &= ~(DR_TRAP0 << i);
513 /*
514 * bp can be NULL due to lazy debug register switching
515 * or due to concurrent perf counter removing.
516 */
517 if (!bp) {
518 rcu_read_unlock();
519 break;
520 }
521
522 (bp->callback)(bp, args->regs);
523
524 rcu_read_unlock();
525 }
526 if (dr6 & (~DR_TRAP_BITS))
527 rc = NOTIFY_DONE;
528
529 set_debugreg(dr7, 7);
530 put_cpu();
531
532 return rc;
533}
534
535/*
536 * Handle debug exception notifications.
537 */
538int __kprobes hw_breakpoint_exceptions_notify(
539 struct notifier_block *unused, unsigned long val, void *data)
540{
541 if (val != DIE_DEBUG)
542 return NOTIFY_DONE;
543
544 return hw_breakpoint_handler(data);
545}
546
547void hw_breakpoint_pmu_read(struct perf_event *bp)
548{
549 /* TODO */
550}
551
552void hw_breakpoint_pmu_unthrottle(struct perf_event *bp)
553{
554 /* TODO */
555}
diff --git a/arch/x86/kernel/irq.c b/arch/x86/kernel/irq.c
index 04bbd5278568..fee6cc2b2079 100644
--- a/arch/x86/kernel/irq.c
+++ b/arch/x86/kernel/irq.c
@@ -92,17 +92,17 @@ static int show_other_interrupts(struct seq_file *p, int prec)
92 seq_printf(p, "%10u ", irq_stats(j)->irq_tlb_count); 92 seq_printf(p, "%10u ", irq_stats(j)->irq_tlb_count);
93 seq_printf(p, " TLB shootdowns\n"); 93 seq_printf(p, " TLB shootdowns\n");
94#endif 94#endif
95#ifdef CONFIG_X86_MCE 95#ifdef CONFIG_X86_THERMAL_VECTOR
96 seq_printf(p, "%*s: ", prec, "TRM"); 96 seq_printf(p, "%*s: ", prec, "TRM");
97 for_each_online_cpu(j) 97 for_each_online_cpu(j)
98 seq_printf(p, "%10u ", irq_stats(j)->irq_thermal_count); 98 seq_printf(p, "%10u ", irq_stats(j)->irq_thermal_count);
99 seq_printf(p, " Thermal event interrupts\n"); 99 seq_printf(p, " Thermal event interrupts\n");
100# ifdef CONFIG_X86_MCE_THRESHOLD 100#endif
101#ifdef CONFIG_X86_MCE_THRESHOLD
101 seq_printf(p, "%*s: ", prec, "THR"); 102 seq_printf(p, "%*s: ", prec, "THR");
102 for_each_online_cpu(j) 103 for_each_online_cpu(j)
103 seq_printf(p, "%10u ", irq_stats(j)->irq_threshold_count); 104 seq_printf(p, "%10u ", irq_stats(j)->irq_threshold_count);
104 seq_printf(p, " Threshold APIC interrupts\n"); 105 seq_printf(p, " Threshold APIC interrupts\n");
105# endif
106#endif 106#endif
107#ifdef CONFIG_X86_MCE 107#ifdef CONFIG_X86_MCE
108 seq_printf(p, "%*s: ", prec, "MCE"); 108 seq_printf(p, "%*s: ", prec, "MCE");
@@ -194,11 +194,11 @@ u64 arch_irq_stat_cpu(unsigned int cpu)
194 sum += irq_stats(cpu)->irq_call_count; 194 sum += irq_stats(cpu)->irq_call_count;
195 sum += irq_stats(cpu)->irq_tlb_count; 195 sum += irq_stats(cpu)->irq_tlb_count;
196#endif 196#endif
197#ifdef CONFIG_X86_MCE 197#ifdef CONFIG_X86_THERMAL_VECTOR
198 sum += irq_stats(cpu)->irq_thermal_count; 198 sum += irq_stats(cpu)->irq_thermal_count;
199# ifdef CONFIG_X86_MCE_THRESHOLD 199#endif
200#ifdef CONFIG_X86_MCE_THRESHOLD
200 sum += irq_stats(cpu)->irq_threshold_count; 201 sum += irq_stats(cpu)->irq_threshold_count;
201# endif
202#endif 202#endif
203#ifdef CONFIG_X86_MCE 203#ifdef CONFIG_X86_MCE
204 sum += per_cpu(mce_exception_count, cpu); 204 sum += per_cpu(mce_exception_count, cpu);
@@ -274,3 +274,93 @@ void smp_generic_interrupt(struct pt_regs *regs)
274} 274}
275 275
276EXPORT_SYMBOL_GPL(vector_used_by_percpu_irq); 276EXPORT_SYMBOL_GPL(vector_used_by_percpu_irq);
277
278#ifdef CONFIG_HOTPLUG_CPU
279/* A cpu has been removed from cpu_online_mask. Reset irq affinities. */
280void fixup_irqs(void)
281{
282 unsigned int irq, vector;
283 static int warned;
284 struct irq_desc *desc;
285
286 for_each_irq_desc(irq, desc) {
287 int break_affinity = 0;
288 int set_affinity = 1;
289 const struct cpumask *affinity;
290
291 if (!desc)
292 continue;
293 if (irq == 2)
294 continue;
295
296 /* interrupt's are disabled at this point */
297 spin_lock(&desc->lock);
298
299 affinity = desc->affinity;
300 if (!irq_has_action(irq) ||
301 cpumask_equal(affinity, cpu_online_mask)) {
302 spin_unlock(&desc->lock);
303 continue;
304 }
305
306 /*
307 * Complete the irq move. This cpu is going down and for
308 * non intr-remapping case, we can't wait till this interrupt
309 * arrives at this cpu before completing the irq move.
310 */
311 irq_force_complete_move(irq);
312
313 if (cpumask_any_and(affinity, cpu_online_mask) >= nr_cpu_ids) {
314 break_affinity = 1;
315 affinity = cpu_all_mask;
316 }
317
318 if (!(desc->status & IRQ_MOVE_PCNTXT) && desc->chip->mask)
319 desc->chip->mask(irq);
320
321 if (desc->chip->set_affinity)
322 desc->chip->set_affinity(irq, affinity);
323 else if (!(warned++))
324 set_affinity = 0;
325
326 if (!(desc->status & IRQ_MOVE_PCNTXT) && desc->chip->unmask)
327 desc->chip->unmask(irq);
328
329 spin_unlock(&desc->lock);
330
331 if (break_affinity && set_affinity)
332 printk("Broke affinity for irq %i\n", irq);
333 else if (!set_affinity)
334 printk("Cannot set affinity for irq %i\n", irq);
335 }
336
337 /*
338 * We can remove mdelay() and then send spuriuous interrupts to
339 * new cpu targets for all the irqs that were handled previously by
340 * this cpu. While it works, I have seen spurious interrupt messages
341 * (nothing wrong but still...).
342 *
343 * So for now, retain mdelay(1) and check the IRR and then send those
344 * interrupts to new targets as this cpu is already offlined...
345 */
346 mdelay(1);
347
348 for (vector = FIRST_EXTERNAL_VECTOR; vector < NR_VECTORS; vector++) {
349 unsigned int irr;
350
351 if (__get_cpu_var(vector_irq)[vector] < 0)
352 continue;
353
354 irr = apic_read(APIC_IRR + (vector / 32 * 0x10));
355 if (irr & (1 << (vector % 32))) {
356 irq = __get_cpu_var(vector_irq)[vector];
357
358 desc = irq_to_desc(irq);
359 spin_lock(&desc->lock);
360 if (desc->chip->retrigger)
361 desc->chip->retrigger(irq);
362 spin_unlock(&desc->lock);
363 }
364 }
365}
366#endif
diff --git a/arch/x86/kernel/irq_32.c b/arch/x86/kernel/irq_32.c
index 7d35d0fe2329..10709f29d166 100644
--- a/arch/x86/kernel/irq_32.c
+++ b/arch/x86/kernel/irq_32.c
@@ -211,48 +211,3 @@ bool handle_irq(unsigned irq, struct pt_regs *regs)
211 211
212 return true; 212 return true;
213} 213}
214
215#ifdef CONFIG_HOTPLUG_CPU
216
217/* A cpu has been removed from cpu_online_mask. Reset irq affinities. */
218void fixup_irqs(void)
219{
220 unsigned int irq;
221 struct irq_desc *desc;
222
223 for_each_irq_desc(irq, desc) {
224 const struct cpumask *affinity;
225
226 if (!desc)
227 continue;
228 if (irq == 2)
229 continue;
230
231 affinity = desc->affinity;
232 if (cpumask_any_and(affinity, cpu_online_mask) >= nr_cpu_ids) {
233 printk("Breaking affinity for irq %i\n", irq);
234 affinity = cpu_all_mask;
235 }
236 if (desc->chip->set_affinity)
237 desc->chip->set_affinity(irq, affinity);
238 else if (desc->action)
239 printk_once("Cannot set affinity for irq %i\n", irq);
240 }
241
242#if 0
243 barrier();
244 /* Ingo Molnar says: "after the IO-APIC masks have been redirected
245 [note the nop - the interrupt-enable boundary on x86 is two
246 instructions from sti] - to flush out pending hardirqs and
247 IPIs. After this point nothing is supposed to reach this CPU." */
248 __asm__ __volatile__("sti; nop; cli");
249 barrier();
250#else
251 /* That doesn't seem sufficient. Give it 1ms. */
252 local_irq_enable();
253 mdelay(1);
254 local_irq_disable();
255#endif
256}
257#endif
258
diff --git a/arch/x86/kernel/irq_64.c b/arch/x86/kernel/irq_64.c
index 977d8b43a0dd..acf8fbf8fbda 100644
--- a/arch/x86/kernel/irq_64.c
+++ b/arch/x86/kernel/irq_64.c
@@ -62,64 +62,6 @@ bool handle_irq(unsigned irq, struct pt_regs *regs)
62 return true; 62 return true;
63} 63}
64 64
65#ifdef CONFIG_HOTPLUG_CPU
66/* A cpu has been removed from cpu_online_mask. Reset irq affinities. */
67void fixup_irqs(void)
68{
69 unsigned int irq;
70 static int warned;
71 struct irq_desc *desc;
72
73 for_each_irq_desc(irq, desc) {
74 int break_affinity = 0;
75 int set_affinity = 1;
76 const struct cpumask *affinity;
77
78 if (!desc)
79 continue;
80 if (irq == 2)
81 continue;
82
83 /* interrupt's are disabled at this point */
84 spin_lock(&desc->lock);
85
86 affinity = desc->affinity;
87 if (!irq_has_action(irq) ||
88 cpumask_equal(affinity, cpu_online_mask)) {
89 spin_unlock(&desc->lock);
90 continue;
91 }
92
93 if (cpumask_any_and(affinity, cpu_online_mask) >= nr_cpu_ids) {
94 break_affinity = 1;
95 affinity = cpu_all_mask;
96 }
97
98 if (desc->chip->mask)
99 desc->chip->mask(irq);
100
101 if (desc->chip->set_affinity)
102 desc->chip->set_affinity(irq, affinity);
103 else if (!(warned++))
104 set_affinity = 0;
105
106 if (desc->chip->unmask)
107 desc->chip->unmask(irq);
108
109 spin_unlock(&desc->lock);
110
111 if (break_affinity && set_affinity)
112 printk("Broke affinity for irq %i\n", irq);
113 else if (!set_affinity)
114 printk("Cannot set affinity for irq %i\n", irq);
115 }
116
117 /* That doesn't seem sufficient. Give it 1ms. */
118 local_irq_enable();
119 mdelay(1);
120 local_irq_disable();
121}
122#endif
123 65
124extern void call_softirq(void); 66extern void call_softirq(void);
125 67
diff --git a/arch/x86/kernel/kgdb.c b/arch/x86/kernel/kgdb.c
index 8d82a77a3f3b..20a5b3689463 100644
--- a/arch/x86/kernel/kgdb.c
+++ b/arch/x86/kernel/kgdb.c
@@ -43,6 +43,7 @@
43#include <linux/smp.h> 43#include <linux/smp.h>
44#include <linux/nmi.h> 44#include <linux/nmi.h>
45 45
46#include <asm/debugreg.h>
46#include <asm/apicdef.h> 47#include <asm/apicdef.h>
47#include <asm/system.h> 48#include <asm/system.h>
48 49
@@ -88,7 +89,6 @@ void pt_regs_to_gdb_regs(unsigned long *gdb_regs, struct pt_regs *regs)
88 gdb_regs[GDB_SS] = __KERNEL_DS; 89 gdb_regs[GDB_SS] = __KERNEL_DS;
89 gdb_regs[GDB_FS] = 0xFFFF; 90 gdb_regs[GDB_FS] = 0xFFFF;
90 gdb_regs[GDB_GS] = 0xFFFF; 91 gdb_regs[GDB_GS] = 0xFFFF;
91 gdb_regs[GDB_SP] = (int)&regs->sp;
92#else 92#else
93 gdb_regs[GDB_R8] = regs->r8; 93 gdb_regs[GDB_R8] = regs->r8;
94 gdb_regs[GDB_R9] = regs->r9; 94 gdb_regs[GDB_R9] = regs->r9;
@@ -101,8 +101,8 @@ void pt_regs_to_gdb_regs(unsigned long *gdb_regs, struct pt_regs *regs)
101 gdb_regs32[GDB_PS] = regs->flags; 101 gdb_regs32[GDB_PS] = regs->flags;
102 gdb_regs32[GDB_CS] = regs->cs; 102 gdb_regs32[GDB_CS] = regs->cs;
103 gdb_regs32[GDB_SS] = regs->ss; 103 gdb_regs32[GDB_SS] = regs->ss;
104 gdb_regs[GDB_SP] = regs->sp;
105#endif 104#endif
105 gdb_regs[GDB_SP] = kernel_stack_pointer(regs);
106} 106}
107 107
108/** 108/**
@@ -434,6 +434,11 @@ single_step_cont(struct pt_regs *regs, struct die_args *args)
434 "resuming...\n"); 434 "resuming...\n");
435 kgdb_arch_handle_exception(args->trapnr, args->signr, 435 kgdb_arch_handle_exception(args->trapnr, args->signr,
436 args->err, "c", "", regs); 436 args->err, "c", "", regs);
437 /*
438 * Reset the BS bit in dr6 (pointed by args->err) to
439 * denote completion of processing
440 */
441 (*(unsigned long *)ERR_PTR(args->err)) &= ~DR_STEP;
437 442
438 return NOTIFY_STOP; 443 return NOTIFY_STOP;
439} 444}
diff --git a/arch/x86/kernel/kprobes.c b/arch/x86/kernel/kprobes.c
index 7b5169d2b000..1f3186ce213c 100644
--- a/arch/x86/kernel/kprobes.c
+++ b/arch/x86/kernel/kprobes.c
@@ -48,31 +48,22 @@
48#include <linux/preempt.h> 48#include <linux/preempt.h>
49#include <linux/module.h> 49#include <linux/module.h>
50#include <linux/kdebug.h> 50#include <linux/kdebug.h>
51#include <linux/kallsyms.h>
51 52
52#include <asm/cacheflush.h> 53#include <asm/cacheflush.h>
53#include <asm/desc.h> 54#include <asm/desc.h>
54#include <asm/pgtable.h> 55#include <asm/pgtable.h>
55#include <asm/uaccess.h> 56#include <asm/uaccess.h>
56#include <asm/alternative.h> 57#include <asm/alternative.h>
58#include <asm/insn.h>
59#include <asm/debugreg.h>
57 60
58void jprobe_return_end(void); 61void jprobe_return_end(void);
59 62
60DEFINE_PER_CPU(struct kprobe *, current_kprobe) = NULL; 63DEFINE_PER_CPU(struct kprobe *, current_kprobe) = NULL;
61DEFINE_PER_CPU(struct kprobe_ctlblk, kprobe_ctlblk); 64DEFINE_PER_CPU(struct kprobe_ctlblk, kprobe_ctlblk);
62 65
63#ifdef CONFIG_X86_64 66#define stack_addr(regs) ((unsigned long *)kernel_stack_pointer(regs))
64#define stack_addr(regs) ((unsigned long *)regs->sp)
65#else
66/*
67 * "&regs->sp" looks wrong, but it's correct for x86_32. x86_32 CPUs
68 * don't save the ss and esp registers if the CPU is already in kernel
69 * mode when it traps. So for kprobes, regs->sp and regs->ss are not
70 * the [nonexistent] saved stack pointer and ss register, but rather
71 * the top 8 bytes of the pre-int3 stack. So &regs->sp happens to
72 * point to the top of the pre-int3 stack.
73 */
74#define stack_addr(regs) ((unsigned long *)&regs->sp)
75#endif
76 67
77#define W(row, b0, b1, b2, b3, b4, b5, b6, b7, b8, b9, ba, bb, bc, bd, be, bf)\ 68#define W(row, b0, b1, b2, b3, b4, b5, b6, b7, b8, b9, ba, bb, bc, bd, be, bf)\
78 (((b0##UL << 0x0)|(b1##UL << 0x1)|(b2##UL << 0x2)|(b3##UL << 0x3) | \ 69 (((b0##UL << 0x0)|(b1##UL << 0x1)|(b2##UL << 0x2)|(b3##UL << 0x3) | \
@@ -106,50 +97,6 @@ static const u32 twobyte_is_boostable[256 / 32] = {
106 /* ----------------------------------------------- */ 97 /* ----------------------------------------------- */
107 /* 0 1 2 3 4 5 6 7 8 9 a b c d e f */ 98 /* 0 1 2 3 4 5 6 7 8 9 a b c d e f */
108}; 99};
109static const u32 onebyte_has_modrm[256 / 32] = {
110 /* 0 1 2 3 4 5 6 7 8 9 a b c d e f */
111 /* ----------------------------------------------- */
112 W(0x00, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0) | /* 00 */
113 W(0x10, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0) , /* 10 */
114 W(0x20, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0) | /* 20 */
115 W(0x30, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0) , /* 30 */
116 W(0x40, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0) | /* 40 */
117 W(0x50, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0) , /* 50 */
118 W(0x60, 0, 0, 1, 1, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0) | /* 60 */
119 W(0x70, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0) , /* 70 */
120 W(0x80, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1) | /* 80 */
121 W(0x90, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0) , /* 90 */
122 W(0xa0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0) | /* a0 */
123 W(0xb0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0) , /* b0 */
124 W(0xc0, 1, 1, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0) | /* c0 */
125 W(0xd0, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1) , /* d0 */
126 W(0xe0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0) | /* e0 */
127 W(0xf0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 1, 1) /* f0 */
128 /* ----------------------------------------------- */
129 /* 0 1 2 3 4 5 6 7 8 9 a b c d e f */
130};
131static const u32 twobyte_has_modrm[256 / 32] = {
132 /* 0 1 2 3 4 5 6 7 8 9 a b c d e f */
133 /* ----------------------------------------------- */
134 W(0x00, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1) | /* 0f */
135 W(0x10, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0) , /* 1f */
136 W(0x20, 1, 1, 1, 1, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1) | /* 2f */
137 W(0x30, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0) , /* 3f */
138 W(0x40, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1) | /* 4f */
139 W(0x50, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1) , /* 5f */
140 W(0x60, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1) | /* 6f */
141 W(0x70, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 1, 1, 1, 1) , /* 7f */
142 W(0x80, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0) | /* 8f */
143 W(0x90, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1) , /* 9f */
144 W(0xa0, 0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0, 1, 1, 1, 1, 1) | /* af */
145 W(0xb0, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1) , /* bf */
146 W(0xc0, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0) | /* cf */
147 W(0xd0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1) , /* df */
148 W(0xe0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1) | /* ef */
149 W(0xf0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0) /* ff */
150 /* ----------------------------------------------- */
151 /* 0 1 2 3 4 5 6 7 8 9 a b c d e f */
152};
153#undef W 100#undef W
154 101
155struct kretprobe_blackpoint kretprobe_blacklist[] = { 102struct kretprobe_blackpoint kretprobe_blacklist[] = {
@@ -244,6 +191,75 @@ retry:
244 } 191 }
245} 192}
246 193
194/* Recover the probed instruction at addr for further analysis. */
195static int recover_probed_instruction(kprobe_opcode_t *buf, unsigned long addr)
196{
197 struct kprobe *kp;
198 kp = get_kprobe((void *)addr);
199 if (!kp)
200 return -EINVAL;
201
202 /*
203 * Basically, kp->ainsn.insn has an original instruction.
204 * However, RIP-relative instruction can not do single-stepping
205 * at different place, fix_riprel() tweaks the displacement of
206 * that instruction. In that case, we can't recover the instruction
207 * from the kp->ainsn.insn.
208 *
209 * On the other hand, kp->opcode has a copy of the first byte of
210 * the probed instruction, which is overwritten by int3. And
211 * the instruction at kp->addr is not modified by kprobes except
212 * for the first byte, we can recover the original instruction
213 * from it and kp->opcode.
214 */
215 memcpy(buf, kp->addr, MAX_INSN_SIZE * sizeof(kprobe_opcode_t));
216 buf[0] = kp->opcode;
217 return 0;
218}
219
220/* Dummy buffers for kallsyms_lookup */
221static char __dummy_buf[KSYM_NAME_LEN];
222
223/* Check if paddr is at an instruction boundary */
224static int __kprobes can_probe(unsigned long paddr)
225{
226 int ret;
227 unsigned long addr, offset = 0;
228 struct insn insn;
229 kprobe_opcode_t buf[MAX_INSN_SIZE];
230
231 if (!kallsyms_lookup(paddr, NULL, &offset, NULL, __dummy_buf))
232 return 0;
233
234 /* Decode instructions */
235 addr = paddr - offset;
236 while (addr < paddr) {
237 kernel_insn_init(&insn, (void *)addr);
238 insn_get_opcode(&insn);
239
240 /*
241 * Check if the instruction has been modified by another
242 * kprobe, in which case we replace the breakpoint by the
243 * original instruction in our buffer.
244 */
245 if (insn.opcode.bytes[0] == BREAKPOINT_INSTRUCTION) {
246 ret = recover_probed_instruction(buf, addr);
247 if (ret)
248 /*
249 * Another debugging subsystem might insert
250 * this breakpoint. In that case, we can't
251 * recover it.
252 */
253 return 0;
254 kernel_insn_init(&insn, buf);
255 }
256 insn_get_length(&insn);
257 addr += insn.length;
258 }
259
260 return (addr == paddr);
261}
262
247/* 263/*
248 * Returns non-zero if opcode modifies the interrupt flag. 264 * Returns non-zero if opcode modifies the interrupt flag.
249 */ 265 */
@@ -277,68 +293,30 @@ static int __kprobes is_IF_modifier(kprobe_opcode_t *insn)
277static void __kprobes fix_riprel(struct kprobe *p) 293static void __kprobes fix_riprel(struct kprobe *p)
278{ 294{
279#ifdef CONFIG_X86_64 295#ifdef CONFIG_X86_64
280 u8 *insn = p->ainsn.insn; 296 struct insn insn;
281 s64 disp; 297 kernel_insn_init(&insn, p->ainsn.insn);
282 int need_modrm;
283
284 /* Skip legacy instruction prefixes. */
285 while (1) {
286 switch (*insn) {
287 case 0x66:
288 case 0x67:
289 case 0x2e:
290 case 0x3e:
291 case 0x26:
292 case 0x64:
293 case 0x65:
294 case 0x36:
295 case 0xf0:
296 case 0xf3:
297 case 0xf2:
298 ++insn;
299 continue;
300 }
301 break;
302 }
303 298
304 /* Skip REX instruction prefix. */ 299 if (insn_rip_relative(&insn)) {
305 if (is_REX_prefix(insn)) 300 s64 newdisp;
306 ++insn; 301 u8 *disp;
307 302 insn_get_displacement(&insn);
308 if (*insn == 0x0f) { 303 /*
309 /* Two-byte opcode. */ 304 * The copied instruction uses the %rip-relative addressing
310 ++insn; 305 * mode. Adjust the displacement for the difference between
311 need_modrm = test_bit(*insn, 306 * the original location of this instruction and the location
312 (unsigned long *)twobyte_has_modrm); 307 * of the copy that will actually be run. The tricky bit here
313 } else 308 * is making sure that the sign extension happens correctly in
314 /* One-byte opcode. */ 309 * this calculation, since we need a signed 32-bit result to
315 need_modrm = test_bit(*insn, 310 * be sign-extended to 64 bits when it's added to the %rip
316 (unsigned long *)onebyte_has_modrm); 311 * value and yield the same 64-bit result that the sign-
317 312 * extension of the original signed 32-bit displacement would
318 if (need_modrm) { 313 * have given.
319 u8 modrm = *++insn; 314 */
320 if ((modrm & 0xc7) == 0x05) { 315 newdisp = (u8 *) p->addr + (s64) insn.displacement.value -
321 /* %rip+disp32 addressing mode */ 316 (u8 *) p->ainsn.insn;
322 /* Displacement follows ModRM byte. */ 317 BUG_ON((s64) (s32) newdisp != newdisp); /* Sanity check. */
323 ++insn; 318 disp = (u8 *) p->ainsn.insn + insn_offset_displacement(&insn);
324 /* 319 *(s32 *) disp = (s32) newdisp;
325 * The copied instruction uses the %rip-relative
326 * addressing mode. Adjust the displacement for the
327 * difference between the original location of this
328 * instruction and the location of the copy that will
329 * actually be run. The tricky bit here is making sure
330 * that the sign extension happens correctly in this
331 * calculation, since we need a signed 32-bit result to
332 * be sign-extended to 64 bits when it's added to the
333 * %rip value and yield the same 64-bit result that the
334 * sign-extension of the original signed 32-bit
335 * displacement would have given.
336 */
337 disp = (u8 *) p->addr + *((s32 *) insn) -
338 (u8 *) p->ainsn.insn;
339 BUG_ON((s64) (s32) disp != disp); /* Sanity check. */
340 *(s32 *)insn = (s32) disp;
341 }
342 } 320 }
343#endif 321#endif
344} 322}
@@ -359,6 +337,8 @@ static void __kprobes arch_copy_kprobe(struct kprobe *p)
359 337
360int __kprobes arch_prepare_kprobe(struct kprobe *p) 338int __kprobes arch_prepare_kprobe(struct kprobe *p)
361{ 339{
340 if (!can_probe((unsigned long)p->addr))
341 return -EILSEQ;
362 /* insn: must be on special executable page on x86. */ 342 /* insn: must be on special executable page on x86. */
363 p->ainsn.insn = get_insn_slot(); 343 p->ainsn.insn = get_insn_slot();
364 if (!p->ainsn.insn) 344 if (!p->ainsn.insn)
@@ -472,17 +452,6 @@ static int __kprobes reenter_kprobe(struct kprobe *p, struct pt_regs *regs,
472{ 452{
473 switch (kcb->kprobe_status) { 453 switch (kcb->kprobe_status) {
474 case KPROBE_HIT_SSDONE: 454 case KPROBE_HIT_SSDONE:
475#ifdef CONFIG_X86_64
476 /* TODO: Provide re-entrancy from post_kprobes_handler() and
477 * avoid exception stack corruption while single-stepping on
478 * the instruction of the new probe.
479 */
480 arch_disarm_kprobe(p);
481 regs->ip = (unsigned long)p->addr;
482 reset_current_kprobe();
483 preempt_enable_no_resched();
484 break;
485#endif
486 case KPROBE_HIT_ACTIVE: 455 case KPROBE_HIT_ACTIVE:
487 save_previous_kprobe(kcb); 456 save_previous_kprobe(kcb);
488 set_current_kprobe(p, regs, kcb); 457 set_current_kprobe(p, regs, kcb);
@@ -491,18 +460,16 @@ static int __kprobes reenter_kprobe(struct kprobe *p, struct pt_regs *regs,
491 kcb->kprobe_status = KPROBE_REENTER; 460 kcb->kprobe_status = KPROBE_REENTER;
492 break; 461 break;
493 case KPROBE_HIT_SS: 462 case KPROBE_HIT_SS:
494 if (p == kprobe_running()) { 463 /* A probe has been hit in the codepath leading up to, or just
495 regs->flags &= ~X86_EFLAGS_TF; 464 * after, single-stepping of a probed instruction. This entire
496 regs->flags |= kcb->kprobe_saved_flags; 465 * codepath should strictly reside in .kprobes.text section.
497 return 0; 466 * Raise a BUG or we'll continue in an endless reentering loop
498 } else { 467 * and eventually a stack overflow.
499 /* A probe has been hit in the codepath leading up 468 */
500 * to, or just after, single-stepping of a probed 469 printk(KERN_WARNING "Unrecoverable kprobe detected at %p.\n",
501 * instruction. This entire codepath should strictly 470 p->addr);
502 * reside in .kprobes.text section. Raise a warning 471 dump_kprobe(p);
503 * to highlight this peculiar case. 472 BUG();
504 */
505 }
506 default: 473 default:
507 /* impossible cases */ 474 /* impossible cases */
508 WARN_ON(1); 475 WARN_ON(1);
@@ -967,8 +934,14 @@ int __kprobes kprobe_exceptions_notify(struct notifier_block *self,
967 ret = NOTIFY_STOP; 934 ret = NOTIFY_STOP;
968 break; 935 break;
969 case DIE_DEBUG: 936 case DIE_DEBUG:
970 if (post_kprobe_handler(args->regs)) 937 if (post_kprobe_handler(args->regs)) {
938 /*
939 * Reset the BS bit in dr6 (pointed by args->err) to
940 * denote completion of processing
941 */
942 (*(unsigned long *)ERR_PTR(args->err)) &= ~DR_STEP;
971 ret = NOTIFY_STOP; 943 ret = NOTIFY_STOP;
944 }
972 break; 945 break;
973 case DIE_GPF: 946 case DIE_GPF:
974 /* 947 /*
diff --git a/arch/x86/kernel/machine_kexec_32.c b/arch/x86/kernel/machine_kexec_32.c
index c1c429d00130..c843f8406da2 100644
--- a/arch/x86/kernel/machine_kexec_32.c
+++ b/arch/x86/kernel/machine_kexec_32.c
@@ -25,6 +25,7 @@
25#include <asm/desc.h> 25#include <asm/desc.h>
26#include <asm/system.h> 26#include <asm/system.h>
27#include <asm/cacheflush.h> 27#include <asm/cacheflush.h>
28#include <asm/debugreg.h>
28 29
29static void set_idt(void *newidt, __u16 limit) 30static void set_idt(void *newidt, __u16 limit)
30{ 31{
@@ -202,6 +203,7 @@ void machine_kexec(struct kimage *image)
202 203
203 /* Interrupts aren't acceptable while we reboot */ 204 /* Interrupts aren't acceptable while we reboot */
204 local_irq_disable(); 205 local_irq_disable();
206 hw_breakpoint_disable();
205 207
206 if (image->preserve_context) { 208 if (image->preserve_context) {
207#ifdef CONFIG_X86_IO_APIC 209#ifdef CONFIG_X86_IO_APIC
diff --git a/arch/x86/kernel/machine_kexec_64.c b/arch/x86/kernel/machine_kexec_64.c
index 84c3bf209e98..4a8bb82248ae 100644
--- a/arch/x86/kernel/machine_kexec_64.c
+++ b/arch/x86/kernel/machine_kexec_64.c
@@ -18,6 +18,7 @@
18#include <asm/pgtable.h> 18#include <asm/pgtable.h>
19#include <asm/tlbflush.h> 19#include <asm/tlbflush.h>
20#include <asm/mmu_context.h> 20#include <asm/mmu_context.h>
21#include <asm/debugreg.h>
21 22
22static int init_one_level2_page(struct kimage *image, pgd_t *pgd, 23static int init_one_level2_page(struct kimage *image, pgd_t *pgd,
23 unsigned long addr) 24 unsigned long addr)
@@ -282,6 +283,7 @@ void machine_kexec(struct kimage *image)
282 283
283 /* Interrupts aren't acceptable while we reboot */ 284 /* Interrupts aren't acceptable while we reboot */
284 local_irq_disable(); 285 local_irq_disable();
286 hw_breakpoint_disable();
285 287
286 if (image->preserve_context) { 288 if (image->preserve_context) {
287#ifdef CONFIG_X86_IO_APIC 289#ifdef CONFIG_X86_IO_APIC
diff --git a/arch/x86/kernel/microcode_amd.c b/arch/x86/kernel/microcode_amd.c
index 366baa179913..f4c538b681ca 100644
--- a/arch/x86/kernel/microcode_amd.c
+++ b/arch/x86/kernel/microcode_amd.c
@@ -317,6 +317,12 @@ static enum ucode_state request_microcode_fw(int cpu, struct device *device)
317 return UCODE_NFOUND; 317 return UCODE_NFOUND;
318 } 318 }
319 319
320 if (*(u32 *)firmware->data != UCODE_MAGIC) {
321 printk(KERN_ERR "microcode: invalid UCODE_MAGIC (0x%08x)\n",
322 *(u32 *)firmware->data);
323 return UCODE_ERROR;
324 }
325
320 ret = generic_load_microcode(cpu, firmware->data, firmware->size); 326 ret = generic_load_microcode(cpu, firmware->data, firmware->size);
321 327
322 release_firmware(firmware); 328 release_firmware(firmware);
diff --git a/arch/x86/kernel/microcode_core.c b/arch/x86/kernel/microcode_core.c
index 378e9a8f1bf8..2bcad3926edb 100644
--- a/arch/x86/kernel/microcode_core.c
+++ b/arch/x86/kernel/microcode_core.c
@@ -73,7 +73,6 @@
73#include <linux/platform_device.h> 73#include <linux/platform_device.h>
74#include <linux/miscdevice.h> 74#include <linux/miscdevice.h>
75#include <linux/capability.h> 75#include <linux/capability.h>
76#include <linux/smp_lock.h>
77#include <linux/kernel.h> 76#include <linux/kernel.h>
78#include <linux/module.h> 77#include <linux/module.h>
79#include <linux/mutex.h> 78#include <linux/mutex.h>
@@ -201,7 +200,6 @@ static int do_microcode_update(const void __user *buf, size_t size)
201 200
202static int microcode_open(struct inode *unused1, struct file *unused2) 201static int microcode_open(struct inode *unused1, struct file *unused2)
203{ 202{
204 cycle_kernel_lock();
205 return capable(CAP_SYS_RAWIO) ? 0 : -EPERM; 203 return capable(CAP_SYS_RAWIO) ? 0 : -EPERM;
206} 204}
207 205
diff --git a/arch/x86/kernel/msr.c b/arch/x86/kernel/msr.c
index 6a3cefc7dda1..553449951b84 100644
--- a/arch/x86/kernel/msr.c
+++ b/arch/x86/kernel/msr.c
@@ -174,21 +174,17 @@ static int msr_open(struct inode *inode, struct file *file)
174{ 174{
175 unsigned int cpu = iminor(file->f_path.dentry->d_inode); 175 unsigned int cpu = iminor(file->f_path.dentry->d_inode);
176 struct cpuinfo_x86 *c = &cpu_data(cpu); 176 struct cpuinfo_x86 *c = &cpu_data(cpu);
177 int ret = 0;
178 177
179 lock_kernel();
180 cpu = iminor(file->f_path.dentry->d_inode); 178 cpu = iminor(file->f_path.dentry->d_inode);
181 179
182 if (cpu >= nr_cpu_ids || !cpu_online(cpu)) { 180 if (cpu >= nr_cpu_ids || !cpu_online(cpu))
183 ret = -ENXIO; /* No such CPU */ 181 return -ENXIO; /* No such CPU */
184 goto out; 182
185 }
186 c = &cpu_data(cpu); 183 c = &cpu_data(cpu);
187 if (!cpu_has(c, X86_FEATURE_MSR)) 184 if (!cpu_has(c, X86_FEATURE_MSR))
188 ret = -EIO; /* MSR not supported */ 185 return -EIO; /* MSR not supported */
189out: 186
190 unlock_kernel(); 187 return 0;
191 return ret;
192} 188}
193 189
194/* 190/*
diff --git a/arch/x86/kernel/pci-calgary_64.c b/arch/x86/kernel/pci-calgary_64.c
index 971a3bec47a8..c563e4c8ff39 100644
--- a/arch/x86/kernel/pci-calgary_64.c
+++ b/arch/x86/kernel/pci-calgary_64.c
@@ -46,6 +46,7 @@
46#include <asm/dma.h> 46#include <asm/dma.h>
47#include <asm/rio.h> 47#include <asm/rio.h>
48#include <asm/bios_ebda.h> 48#include <asm/bios_ebda.h>
49#include <asm/x86_init.h>
49 50
50#ifdef CONFIG_CALGARY_IOMMU_ENABLED_BY_DEFAULT 51#ifdef CONFIG_CALGARY_IOMMU_ENABLED_BY_DEFAULT
51int use_calgary __read_mostly = 1; 52int use_calgary __read_mostly = 1;
@@ -244,7 +245,7 @@ static unsigned long iommu_range_alloc(struct device *dev,
244 if (panic_on_overflow) 245 if (panic_on_overflow)
245 panic("Calgary: fix the allocator.\n"); 246 panic("Calgary: fix the allocator.\n");
246 else 247 else
247 return bad_dma_address; 248 return DMA_ERROR_CODE;
248 } 249 }
249 } 250 }
250 251
@@ -260,12 +261,15 @@ static dma_addr_t iommu_alloc(struct device *dev, struct iommu_table *tbl,
260 void *vaddr, unsigned int npages, int direction) 261 void *vaddr, unsigned int npages, int direction)
261{ 262{
262 unsigned long entry; 263 unsigned long entry;
263 dma_addr_t ret = bad_dma_address; 264 dma_addr_t ret;
264 265
265 entry = iommu_range_alloc(dev, tbl, npages); 266 entry = iommu_range_alloc(dev, tbl, npages);
266 267
267 if (unlikely(entry == bad_dma_address)) 268 if (unlikely(entry == DMA_ERROR_CODE)) {
268 goto error; 269 printk(KERN_WARNING "Calgary: failed to allocate %u pages in "
270 "iommu %p\n", npages, tbl);
271 return DMA_ERROR_CODE;
272 }
269 273
270 /* set the return dma address */ 274 /* set the return dma address */
271 ret = (entry << PAGE_SHIFT) | ((unsigned long)vaddr & ~PAGE_MASK); 275 ret = (entry << PAGE_SHIFT) | ((unsigned long)vaddr & ~PAGE_MASK);
@@ -273,13 +277,7 @@ static dma_addr_t iommu_alloc(struct device *dev, struct iommu_table *tbl,
273 /* put the TCEs in the HW table */ 277 /* put the TCEs in the HW table */
274 tce_build(tbl, entry, npages, (unsigned long)vaddr & PAGE_MASK, 278 tce_build(tbl, entry, npages, (unsigned long)vaddr & PAGE_MASK,
275 direction); 279 direction);
276
277 return ret; 280 return ret;
278
279error:
280 printk(KERN_WARNING "Calgary: failed to allocate %u pages in "
281 "iommu %p\n", npages, tbl);
282 return bad_dma_address;
283} 281}
284 282
285static void iommu_free(struct iommu_table *tbl, dma_addr_t dma_addr, 283static void iommu_free(struct iommu_table *tbl, dma_addr_t dma_addr,
@@ -290,8 +288,8 @@ static void iommu_free(struct iommu_table *tbl, dma_addr_t dma_addr,
290 unsigned long flags; 288 unsigned long flags;
291 289
292 /* were we called with bad_dma_address? */ 290 /* were we called with bad_dma_address? */
293 badend = bad_dma_address + (EMERGENCY_PAGES * PAGE_SIZE); 291 badend = DMA_ERROR_CODE + (EMERGENCY_PAGES * PAGE_SIZE);
294 if (unlikely((dma_addr >= bad_dma_address) && (dma_addr < badend))) { 292 if (unlikely((dma_addr >= DMA_ERROR_CODE) && (dma_addr < badend))) {
295 WARN(1, KERN_ERR "Calgary: driver tried unmapping bad DMA " 293 WARN(1, KERN_ERR "Calgary: driver tried unmapping bad DMA "
296 "address 0x%Lx\n", dma_addr); 294 "address 0x%Lx\n", dma_addr);
297 return; 295 return;
@@ -318,13 +316,15 @@ static inline struct iommu_table *find_iommu_table(struct device *dev)
318 316
319 pdev = to_pci_dev(dev); 317 pdev = to_pci_dev(dev);
320 318
319 /* search up the device tree for an iommu */
321 pbus = pdev->bus; 320 pbus = pdev->bus;
322 321 do {
323 /* is the device behind a bridge? Look for the root bus */ 322 tbl = pci_iommu(pbus);
324 while (pbus->parent) 323 if (tbl && tbl->it_busno == pbus->number)
324 break;
325 tbl = NULL;
325 pbus = pbus->parent; 326 pbus = pbus->parent;
326 327 } while (pbus);
327 tbl = pci_iommu(pbus);
328 328
329 BUG_ON(tbl && (tbl->it_busno != pbus->number)); 329 BUG_ON(tbl && (tbl->it_busno != pbus->number));
330 330
@@ -373,7 +373,7 @@ static int calgary_map_sg(struct device *dev, struct scatterlist *sg,
373 npages = iommu_num_pages(vaddr, s->length, PAGE_SIZE); 373 npages = iommu_num_pages(vaddr, s->length, PAGE_SIZE);
374 374
375 entry = iommu_range_alloc(dev, tbl, npages); 375 entry = iommu_range_alloc(dev, tbl, npages);
376 if (entry == bad_dma_address) { 376 if (entry == DMA_ERROR_CODE) {
377 /* makes sure unmap knows to stop */ 377 /* makes sure unmap knows to stop */
378 s->dma_length = 0; 378 s->dma_length = 0;
379 goto error; 379 goto error;
@@ -391,7 +391,7 @@ static int calgary_map_sg(struct device *dev, struct scatterlist *sg,
391error: 391error:
392 calgary_unmap_sg(dev, sg, nelems, dir, NULL); 392 calgary_unmap_sg(dev, sg, nelems, dir, NULL);
393 for_each_sg(sg, s, nelems, i) { 393 for_each_sg(sg, s, nelems, i) {
394 sg->dma_address = bad_dma_address; 394 sg->dma_address = DMA_ERROR_CODE;
395 sg->dma_length = 0; 395 sg->dma_length = 0;
396 } 396 }
397 return 0; 397 return 0;
@@ -446,7 +446,7 @@ static void* calgary_alloc_coherent(struct device *dev, size_t size,
446 446
447 /* set up tces to cover the allocated range */ 447 /* set up tces to cover the allocated range */
448 mapping = iommu_alloc(dev, tbl, ret, npages, DMA_BIDIRECTIONAL); 448 mapping = iommu_alloc(dev, tbl, ret, npages, DMA_BIDIRECTIONAL);
449 if (mapping == bad_dma_address) 449 if (mapping == DMA_ERROR_CODE)
450 goto free; 450 goto free;
451 *dma_handle = mapping; 451 *dma_handle = mapping;
452 return ret; 452 return ret;
@@ -727,7 +727,7 @@ static void __init calgary_reserve_regions(struct pci_dev *dev)
727 struct iommu_table *tbl = pci_iommu(dev->bus); 727 struct iommu_table *tbl = pci_iommu(dev->bus);
728 728
729 /* reserve EMERGENCY_PAGES from bad_dma_address and up */ 729 /* reserve EMERGENCY_PAGES from bad_dma_address and up */
730 iommu_range_reserve(tbl, bad_dma_address, EMERGENCY_PAGES); 730 iommu_range_reserve(tbl, DMA_ERROR_CODE, EMERGENCY_PAGES);
731 731
732 /* avoid the BIOS/VGA first 640KB-1MB region */ 732 /* avoid the BIOS/VGA first 640KB-1MB region */
733 /* for CalIOC2 - avoid the entire first MB */ 733 /* for CalIOC2 - avoid the entire first MB */
@@ -1344,6 +1344,23 @@ static void __init get_tce_space_from_tar(void)
1344 return; 1344 return;
1345} 1345}
1346 1346
1347static int __init calgary_iommu_init(void)
1348{
1349 int ret;
1350
1351 /* ok, we're trying to use Calgary - let's roll */
1352 printk(KERN_INFO "PCI-DMA: Using Calgary IOMMU\n");
1353
1354 ret = calgary_init();
1355 if (ret) {
1356 printk(KERN_ERR "PCI-DMA: Calgary init failed %d, "
1357 "falling back to no_iommu\n", ret);
1358 return ret;
1359 }
1360
1361 return 0;
1362}
1363
1347void __init detect_calgary(void) 1364void __init detect_calgary(void)
1348{ 1365{
1349 int bus; 1366 int bus;
@@ -1357,7 +1374,7 @@ void __init detect_calgary(void)
1357 * if the user specified iommu=off or iommu=soft or we found 1374 * if the user specified iommu=off or iommu=soft or we found
1358 * another HW IOMMU already, bail out. 1375 * another HW IOMMU already, bail out.
1359 */ 1376 */
1360 if (swiotlb || no_iommu || iommu_detected) 1377 if (no_iommu || iommu_detected)
1361 return; 1378 return;
1362 1379
1363 if (!use_calgary) 1380 if (!use_calgary)
@@ -1442,9 +1459,7 @@ void __init detect_calgary(void)
1442 printk(KERN_INFO "PCI-DMA: Calgary TCE table spec is %d\n", 1459 printk(KERN_INFO "PCI-DMA: Calgary TCE table spec is %d\n",
1443 specified_table_size); 1460 specified_table_size);
1444 1461
1445 /* swiotlb for devices that aren't behind the Calgary. */ 1462 x86_init.iommu.iommu_init = calgary_iommu_init;
1446 if (max_pfn > MAX_DMA32_PFN)
1447 swiotlb = 1;
1448 } 1463 }
1449 return; 1464 return;
1450 1465
@@ -1457,35 +1472,6 @@ cleanup:
1457 } 1472 }
1458} 1473}
1459 1474
1460int __init calgary_iommu_init(void)
1461{
1462 int ret;
1463
1464 if (no_iommu || (swiotlb && !calgary_detected))
1465 return -ENODEV;
1466
1467 if (!calgary_detected)
1468 return -ENODEV;
1469
1470 /* ok, we're trying to use Calgary - let's roll */
1471 printk(KERN_INFO "PCI-DMA: Using Calgary IOMMU\n");
1472
1473 ret = calgary_init();
1474 if (ret) {
1475 printk(KERN_ERR "PCI-DMA: Calgary init failed %d, "
1476 "falling back to no_iommu\n", ret);
1477 return ret;
1478 }
1479
1480 force_iommu = 1;
1481 bad_dma_address = 0x0;
1482 /* dma_ops is set to swiotlb or nommu */
1483 if (!dma_ops)
1484 dma_ops = &nommu_dma_ops;
1485
1486 return 0;
1487}
1488
1489static int __init calgary_parse_options(char *p) 1475static int __init calgary_parse_options(char *p)
1490{ 1476{
1491 unsigned int bridge; 1477 unsigned int bridge;
diff --git a/arch/x86/kernel/pci-dma.c b/arch/x86/kernel/pci-dma.c
index b2a71dca5642..afcc58b69c7c 100644
--- a/arch/x86/kernel/pci-dma.c
+++ b/arch/x86/kernel/pci-dma.c
@@ -11,10 +11,11 @@
11#include <asm/gart.h> 11#include <asm/gart.h>
12#include <asm/calgary.h> 12#include <asm/calgary.h>
13#include <asm/amd_iommu.h> 13#include <asm/amd_iommu.h>
14#include <asm/x86_init.h>
14 15
15static int forbid_dac __read_mostly; 16static int forbid_dac __read_mostly;
16 17
17struct dma_map_ops *dma_ops; 18struct dma_map_ops *dma_ops = &nommu_dma_ops;
18EXPORT_SYMBOL(dma_ops); 19EXPORT_SYMBOL(dma_ops);
19 20
20static int iommu_sac_force __read_mostly; 21static int iommu_sac_force __read_mostly;
@@ -42,15 +43,10 @@ int iommu_detected __read_mostly = 0;
42 */ 43 */
43int iommu_pass_through __read_mostly; 44int iommu_pass_through __read_mostly;
44 45
45dma_addr_t bad_dma_address __read_mostly = 0; 46/* Dummy device used for NULL arguments (normally ISA). */
46EXPORT_SYMBOL(bad_dma_address);
47
48/* Dummy device used for NULL arguments (normally ISA). Better would
49 be probably a smaller DMA mask, but this is bug-to-bug compatible
50 to older i386. */
51struct device x86_dma_fallback_dev = { 47struct device x86_dma_fallback_dev = {
52 .init_name = "fallback device", 48 .init_name = "fallback device",
53 .coherent_dma_mask = DMA_BIT_MASK(32), 49 .coherent_dma_mask = ISA_DMA_BIT_MASK,
54 .dma_mask = &x86_dma_fallback_dev.coherent_dma_mask, 50 .dma_mask = &x86_dma_fallback_dev.coherent_dma_mask,
55}; 51};
56EXPORT_SYMBOL(x86_dma_fallback_dev); 52EXPORT_SYMBOL(x86_dma_fallback_dev);
@@ -128,20 +124,17 @@ void __init pci_iommu_alloc(void)
128 /* free the range so iommu could get some range less than 4G */ 124 /* free the range so iommu could get some range less than 4G */
129 dma32_free_bootmem(); 125 dma32_free_bootmem();
130#endif 126#endif
127 if (pci_swiotlb_init())
128 return;
131 129
132 /*
133 * The order of these functions is important for
134 * fall-back/fail-over reasons
135 */
136 gart_iommu_hole_init(); 130 gart_iommu_hole_init();
137 131
138 detect_calgary(); 132 detect_calgary();
139 133
140 detect_intel_iommu(); 134 detect_intel_iommu();
141 135
136 /* needs to be called after gart_iommu_hole_init */
142 amd_iommu_detect(); 137 amd_iommu_detect();
143
144 pci_swiotlb_init();
145} 138}
146 139
147void *dma_generic_alloc_coherent(struct device *dev, size_t size, 140void *dma_generic_alloc_coherent(struct device *dev, size_t size,
@@ -216,7 +209,7 @@ static __init int iommu_setup(char *p)
216 if (!strncmp(p, "allowdac", 8)) 209 if (!strncmp(p, "allowdac", 8))
217 forbid_dac = 0; 210 forbid_dac = 0;
218 if (!strncmp(p, "nodac", 5)) 211 if (!strncmp(p, "nodac", 5))
219 forbid_dac = -1; 212 forbid_dac = 1;
220 if (!strncmp(p, "usedac", 6)) { 213 if (!strncmp(p, "usedac", 6)) {
221 forbid_dac = -1; 214 forbid_dac = -1;
222 return 1; 215 return 1;
@@ -291,25 +284,17 @@ static int __init pci_iommu_init(void)
291#ifdef CONFIG_PCI 284#ifdef CONFIG_PCI
292 dma_debug_add_bus(&pci_bus_type); 285 dma_debug_add_bus(&pci_bus_type);
293#endif 286#endif
287 x86_init.iommu.iommu_init();
294 288
295 calgary_iommu_init(); 289 if (swiotlb) {
296 290 printk(KERN_INFO "PCI-DMA: "
297 intel_iommu_init(); 291 "Using software bounce buffering for IO (SWIOTLB)\n");
292 swiotlb_print_info();
293 } else
294 swiotlb_free();
298 295
299 amd_iommu_init();
300
301 gart_iommu_init();
302
303 no_iommu_init();
304 return 0; 296 return 0;
305} 297}
306
307void pci_iommu_shutdown(void)
308{
309 gart_iommu_shutdown();
310
311 amd_iommu_shutdown();
312}
313/* Must execute after PCI subsystem */ 298/* Must execute after PCI subsystem */
314rootfs_initcall(pci_iommu_init); 299rootfs_initcall(pci_iommu_init);
315 300
diff --git a/arch/x86/kernel/pci-gart_64.c b/arch/x86/kernel/pci-gart_64.c
index a7f1b64f86e0..e6a0d402f171 100644
--- a/arch/x86/kernel/pci-gart_64.c
+++ b/arch/x86/kernel/pci-gart_64.c
@@ -39,6 +39,7 @@
39#include <asm/swiotlb.h> 39#include <asm/swiotlb.h>
40#include <asm/dma.h> 40#include <asm/dma.h>
41#include <asm/k8.h> 41#include <asm/k8.h>
42#include <asm/x86_init.h>
42 43
43static unsigned long iommu_bus_base; /* GART remapping area (physical) */ 44static unsigned long iommu_bus_base; /* GART remapping area (physical) */
44static unsigned long iommu_size; /* size of remapping area bytes */ 45static unsigned long iommu_size; /* size of remapping area bytes */
@@ -46,6 +47,8 @@ static unsigned long iommu_pages; /* .. and in pages */
46 47
47static u32 *iommu_gatt_base; /* Remapping table */ 48static u32 *iommu_gatt_base; /* Remapping table */
48 49
50static dma_addr_t bad_dma_addr;
51
49/* 52/*
50 * If this is disabled the IOMMU will use an optimized flushing strategy 53 * If this is disabled the IOMMU will use an optimized flushing strategy
51 * of only flushing when an mapping is reused. With it true the GART is 54 * of only flushing when an mapping is reused. With it true the GART is
@@ -92,7 +95,7 @@ static unsigned long alloc_iommu(struct device *dev, int size,
92 95
93 base_index = ALIGN(iommu_bus_base & dma_get_seg_boundary(dev), 96 base_index = ALIGN(iommu_bus_base & dma_get_seg_boundary(dev),
94 PAGE_SIZE) >> PAGE_SHIFT; 97 PAGE_SIZE) >> PAGE_SHIFT;
95 boundary_size = ALIGN((unsigned long long)dma_get_seg_boundary(dev) + 1, 98 boundary_size = ALIGN((u64)dma_get_seg_boundary(dev) + 1,
96 PAGE_SIZE) >> PAGE_SHIFT; 99 PAGE_SIZE) >> PAGE_SHIFT;
97 100
98 spin_lock_irqsave(&iommu_bitmap_lock, flags); 101 spin_lock_irqsave(&iommu_bitmap_lock, flags);
@@ -216,7 +219,7 @@ static dma_addr_t dma_map_area(struct device *dev, dma_addr_t phys_mem,
216 if (panic_on_overflow) 219 if (panic_on_overflow)
217 panic("dma_map_area overflow %lu bytes\n", size); 220 panic("dma_map_area overflow %lu bytes\n", size);
218 iommu_full(dev, size, dir); 221 iommu_full(dev, size, dir);
219 return bad_dma_address; 222 return bad_dma_addr;
220 } 223 }
221 224
222 for (i = 0; i < npages; i++) { 225 for (i = 0; i < npages; i++) {
@@ -294,7 +297,7 @@ static int dma_map_sg_nonforce(struct device *dev, struct scatterlist *sg,
294 int i; 297 int i;
295 298
296#ifdef CONFIG_IOMMU_DEBUG 299#ifdef CONFIG_IOMMU_DEBUG
297 printk(KERN_DEBUG "dma_map_sg overflow\n"); 300 pr_debug("dma_map_sg overflow\n");
298#endif 301#endif
299 302
300 for_each_sg(sg, s, nents, i) { 303 for_each_sg(sg, s, nents, i) {
@@ -302,7 +305,7 @@ static int dma_map_sg_nonforce(struct device *dev, struct scatterlist *sg,
302 305
303 if (nonforced_iommu(dev, addr, s->length)) { 306 if (nonforced_iommu(dev, addr, s->length)) {
304 addr = dma_map_area(dev, addr, s->length, dir, 0); 307 addr = dma_map_area(dev, addr, s->length, dir, 0);
305 if (addr == bad_dma_address) { 308 if (addr == bad_dma_addr) {
306 if (i > 0) 309 if (i > 0)
307 gart_unmap_sg(dev, sg, i, dir, NULL); 310 gart_unmap_sg(dev, sg, i, dir, NULL);
308 nents = 0; 311 nents = 0;
@@ -389,12 +392,14 @@ static int gart_map_sg(struct device *dev, struct scatterlist *sg, int nents,
389 if (!dev) 392 if (!dev)
390 dev = &x86_dma_fallback_dev; 393 dev = &x86_dma_fallback_dev;
391 394
392 out = 0; 395 out = 0;
393 start = 0; 396 start = 0;
394 start_sg = sgmap = sg; 397 start_sg = sg;
395 seg_size = 0; 398 sgmap = sg;
396 max_seg_size = dma_get_max_seg_size(dev); 399 seg_size = 0;
397 ps = NULL; /* shut up gcc */ 400 max_seg_size = dma_get_max_seg_size(dev);
401 ps = NULL; /* shut up gcc */
402
398 for_each_sg(sg, s, nents, i) { 403 for_each_sg(sg, s, nents, i) {
399 dma_addr_t addr = sg_phys(s); 404 dma_addr_t addr = sg_phys(s);
400 405
@@ -417,11 +422,12 @@ static int gart_map_sg(struct device *dev, struct scatterlist *sg, int nents,
417 sgmap, pages, need) < 0) 422 sgmap, pages, need) < 0)
418 goto error; 423 goto error;
419 out++; 424 out++;
420 seg_size = 0; 425
421 sgmap = sg_next(sgmap); 426 seg_size = 0;
422 pages = 0; 427 sgmap = sg_next(sgmap);
423 start = i; 428 pages = 0;
424 start_sg = s; 429 start = i;
430 start_sg = s;
425 } 431 }
426 } 432 }
427 433
@@ -455,7 +461,7 @@ error:
455 461
456 iommu_full(dev, pages << PAGE_SHIFT, dir); 462 iommu_full(dev, pages << PAGE_SHIFT, dir);
457 for_each_sg(sg, s, nents, i) 463 for_each_sg(sg, s, nents, i)
458 s->dma_address = bad_dma_address; 464 s->dma_address = bad_dma_addr;
459 return 0; 465 return 0;
460} 466}
461 467
@@ -479,7 +485,7 @@ gart_alloc_coherent(struct device *dev, size_t size, dma_addr_t *dma_addr,
479 DMA_BIDIRECTIONAL, align_mask); 485 DMA_BIDIRECTIONAL, align_mask);
480 486
481 flush_gart(); 487 flush_gart();
482 if (paddr != bad_dma_address) { 488 if (paddr != bad_dma_addr) {
483 *dma_addr = paddr; 489 *dma_addr = paddr;
484 return page_address(page); 490 return page_address(page);
485 } 491 }
@@ -499,6 +505,11 @@ gart_free_coherent(struct device *dev, size_t size, void *vaddr,
499 free_pages((unsigned long)vaddr, get_order(size)); 505 free_pages((unsigned long)vaddr, get_order(size));
500} 506}
501 507
508static int gart_mapping_error(struct device *dev, dma_addr_t dma_addr)
509{
510 return (dma_addr == bad_dma_addr);
511}
512
502static int no_agp; 513static int no_agp;
503 514
504static __init unsigned long check_iommu_size(unsigned long aper, u64 aper_size) 515static __init unsigned long check_iommu_size(unsigned long aper, u64 aper_size)
@@ -515,7 +526,7 @@ static __init unsigned long check_iommu_size(unsigned long aper, u64 aper_size)
515 iommu_size -= round_up(a, PMD_PAGE_SIZE) - a; 526 iommu_size -= round_up(a, PMD_PAGE_SIZE) - a;
516 527
517 if (iommu_size < 64*1024*1024) { 528 if (iommu_size < 64*1024*1024) {
518 printk(KERN_WARNING 529 pr_warning(
519 "PCI-DMA: Warning: Small IOMMU %luMB." 530 "PCI-DMA: Warning: Small IOMMU %luMB."
520 " Consider increasing the AGP aperture in BIOS\n", 531 " Consider increasing the AGP aperture in BIOS\n",
521 iommu_size >> 20); 532 iommu_size >> 20);
@@ -570,28 +581,32 @@ void set_up_gart_resume(u32 aper_order, u32 aper_alloc)
570 aperture_alloc = aper_alloc; 581 aperture_alloc = aper_alloc;
571} 582}
572 583
573static int gart_resume(struct sys_device *dev) 584static void gart_fixup_northbridges(struct sys_device *dev)
574{ 585{
575 printk(KERN_INFO "PCI-DMA: Resuming GART IOMMU\n"); 586 int i;
576 587
577 if (fix_up_north_bridges) { 588 if (!fix_up_north_bridges)
578 int i; 589 return;
579 590
580 printk(KERN_INFO "PCI-DMA: Restoring GART aperture settings\n"); 591 pr_info("PCI-DMA: Restoring GART aperture settings\n");
581 592
582 for (i = 0; i < num_k8_northbridges; i++) { 593 for (i = 0; i < num_k8_northbridges; i++) {
583 struct pci_dev *dev = k8_northbridges[i]; 594 struct pci_dev *dev = k8_northbridges[i];
584 595
585 /* 596 /*
586 * Don't enable translations just yet. That is the next 597 * Don't enable translations just yet. That is the next
587 * step. Restore the pre-suspend aperture settings. 598 * step. Restore the pre-suspend aperture settings.
588 */ 599 */
589 pci_write_config_dword(dev, AMD64_GARTAPERTURECTL, 600 pci_write_config_dword(dev, AMD64_GARTAPERTURECTL, aperture_order << 1);
590 aperture_order << 1); 601 pci_write_config_dword(dev, AMD64_GARTAPERTUREBASE, aperture_alloc >> 25);
591 pci_write_config_dword(dev, AMD64_GARTAPERTUREBASE,
592 aperture_alloc >> 25);
593 }
594 } 602 }
603}
604
605static int gart_resume(struct sys_device *dev)
606{
607 pr_info("PCI-DMA: Resuming GART IOMMU\n");
608
609 gart_fixup_northbridges(dev);
595 610
596 enable_gart_translations(); 611 enable_gart_translations();
597 612
@@ -604,15 +619,14 @@ static int gart_suspend(struct sys_device *dev, pm_message_t state)
604} 619}
605 620
606static struct sysdev_class gart_sysdev_class = { 621static struct sysdev_class gart_sysdev_class = {
607 .name = "gart", 622 .name = "gart",
608 .suspend = gart_suspend, 623 .suspend = gart_suspend,
609 .resume = gart_resume, 624 .resume = gart_resume,
610 625
611}; 626};
612 627
613static struct sys_device device_gart = { 628static struct sys_device device_gart = {
614 .id = 0, 629 .cls = &gart_sysdev_class,
615 .cls = &gart_sysdev_class,
616}; 630};
617 631
618/* 632/*
@@ -627,7 +641,8 @@ static __init int init_k8_gatt(struct agp_kern_info *info)
627 void *gatt; 641 void *gatt;
628 int i, error; 642 int i, error;
629 643
630 printk(KERN_INFO "PCI-DMA: Disabling AGP.\n"); 644 pr_info("PCI-DMA: Disabling AGP.\n");
645
631 aper_size = aper_base = info->aper_size = 0; 646 aper_size = aper_base = info->aper_size = 0;
632 dev = NULL; 647 dev = NULL;
633 for (i = 0; i < num_k8_northbridges; i++) { 648 for (i = 0; i < num_k8_northbridges; i++) {
@@ -645,6 +660,7 @@ static __init int init_k8_gatt(struct agp_kern_info *info)
645 } 660 }
646 if (!aper_base) 661 if (!aper_base)
647 goto nommu; 662 goto nommu;
663
648 info->aper_base = aper_base; 664 info->aper_base = aper_base;
649 info->aper_size = aper_size >> 20; 665 info->aper_size = aper_size >> 20;
650 666
@@ -667,14 +683,14 @@ static __init int init_k8_gatt(struct agp_kern_info *info)
667 683
668 flush_gart(); 684 flush_gart();
669 685
670 printk(KERN_INFO "PCI-DMA: aperture base @ %x size %u KB\n", 686 pr_info("PCI-DMA: aperture base @ %x size %u KB\n",
671 aper_base, aper_size>>10); 687 aper_base, aper_size>>10);
672 688
673 return 0; 689 return 0;
674 690
675 nommu: 691 nommu:
676 /* Should not happen anymore */ 692 /* Should not happen anymore */
677 printk(KERN_WARNING "PCI-DMA: More than 4GB of RAM and no IOMMU\n" 693 pr_warning("PCI-DMA: More than 4GB of RAM and no IOMMU\n"
678 "falling back to iommu=soft.\n"); 694 "falling back to iommu=soft.\n");
679 return -1; 695 return -1;
680} 696}
@@ -686,14 +702,15 @@ static struct dma_map_ops gart_dma_ops = {
686 .unmap_page = gart_unmap_page, 702 .unmap_page = gart_unmap_page,
687 .alloc_coherent = gart_alloc_coherent, 703 .alloc_coherent = gart_alloc_coherent,
688 .free_coherent = gart_free_coherent, 704 .free_coherent = gart_free_coherent,
705 .mapping_error = gart_mapping_error,
689}; 706};
690 707
691void gart_iommu_shutdown(void) 708static void gart_iommu_shutdown(void)
692{ 709{
693 struct pci_dev *dev; 710 struct pci_dev *dev;
694 int i; 711 int i;
695 712
696 if (no_agp && (dma_ops != &gart_dma_ops)) 713 if (no_agp)
697 return; 714 return;
698 715
699 for (i = 0; i < num_k8_northbridges; i++) { 716 for (i = 0; i < num_k8_northbridges; i++) {
@@ -708,7 +725,7 @@ void gart_iommu_shutdown(void)
708 } 725 }
709} 726}
710 727
711void __init gart_iommu_init(void) 728int __init gart_iommu_init(void)
712{ 729{
713 struct agp_kern_info info; 730 struct agp_kern_info info;
714 unsigned long iommu_start; 731 unsigned long iommu_start;
@@ -718,7 +735,7 @@ void __init gart_iommu_init(void)
718 long i; 735 long i;
719 736
720 if (cache_k8_northbridges() < 0 || num_k8_northbridges == 0) 737 if (cache_k8_northbridges() < 0 || num_k8_northbridges == 0)
721 return; 738 return 0;
722 739
723#ifndef CONFIG_AGP_AMD64 740#ifndef CONFIG_AGP_AMD64
724 no_agp = 1; 741 no_agp = 1;
@@ -730,35 +747,28 @@ void __init gart_iommu_init(void)
730 (agp_copy_info(agp_bridge, &info) < 0); 747 (agp_copy_info(agp_bridge, &info) < 0);
731#endif 748#endif
732 749
733 if (swiotlb)
734 return;
735
736 /* Did we detect a different HW IOMMU? */
737 if (iommu_detected && !gart_iommu_aperture)
738 return;
739
740 if (no_iommu || 750 if (no_iommu ||
741 (!force_iommu && max_pfn <= MAX_DMA32_PFN) || 751 (!force_iommu && max_pfn <= MAX_DMA32_PFN) ||
742 !gart_iommu_aperture || 752 !gart_iommu_aperture ||
743 (no_agp && init_k8_gatt(&info) < 0)) { 753 (no_agp && init_k8_gatt(&info) < 0)) {
744 if (max_pfn > MAX_DMA32_PFN) { 754 if (max_pfn > MAX_DMA32_PFN) {
745 printk(KERN_WARNING "More than 4GB of memory " 755 pr_warning("More than 4GB of memory but GART IOMMU not available.\n");
746 "but GART IOMMU not available.\n"); 756 pr_warning("falling back to iommu=soft.\n");
747 printk(KERN_WARNING "falling back to iommu=soft.\n");
748 } 757 }
749 return; 758 return 0;
750 } 759 }
751 760
752 /* need to map that range */ 761 /* need to map that range */
753 aper_size = info.aper_size << 20; 762 aper_size = info.aper_size << 20;
754 aper_base = info.aper_base; 763 aper_base = info.aper_base;
755 end_pfn = (aper_base>>PAGE_SHIFT) + (aper_size>>PAGE_SHIFT); 764 end_pfn = (aper_base>>PAGE_SHIFT) + (aper_size>>PAGE_SHIFT);
765
756 if (end_pfn > max_low_pfn_mapped) { 766 if (end_pfn > max_low_pfn_mapped) {
757 start_pfn = (aper_base>>PAGE_SHIFT); 767 start_pfn = (aper_base>>PAGE_SHIFT);
758 init_memory_mapping(start_pfn<<PAGE_SHIFT, end_pfn<<PAGE_SHIFT); 768 init_memory_mapping(start_pfn<<PAGE_SHIFT, end_pfn<<PAGE_SHIFT);
759 } 769 }
760 770
761 printk(KERN_INFO "PCI-DMA: using GART IOMMU.\n"); 771 pr_info("PCI-DMA: using GART IOMMU.\n");
762 iommu_size = check_iommu_size(info.aper_base, aper_size); 772 iommu_size = check_iommu_size(info.aper_base, aper_size);
763 iommu_pages = iommu_size >> PAGE_SHIFT; 773 iommu_pages = iommu_size >> PAGE_SHIFT;
764 774
@@ -773,8 +783,7 @@ void __init gart_iommu_init(void)
773 783
774 ret = dma_debug_resize_entries(iommu_pages); 784 ret = dma_debug_resize_entries(iommu_pages);
775 if (ret) 785 if (ret)
776 printk(KERN_DEBUG 786 pr_debug("PCI-DMA: Cannot trace all the entries\n");
777 "PCI-DMA: Cannot trace all the entries\n");
778 } 787 }
779#endif 788#endif
780 789
@@ -784,15 +793,14 @@ void __init gart_iommu_init(void)
784 */ 793 */
785 iommu_area_reserve(iommu_gart_bitmap, 0, EMERGENCY_PAGES); 794 iommu_area_reserve(iommu_gart_bitmap, 0, EMERGENCY_PAGES);
786 795
787 agp_memory_reserved = iommu_size; 796 pr_info("PCI-DMA: Reserving %luMB of IOMMU area in the AGP aperture\n",
788 printk(KERN_INFO
789 "PCI-DMA: Reserving %luMB of IOMMU area in the AGP aperture\n",
790 iommu_size >> 20); 797 iommu_size >> 20);
791 798
792 iommu_start = aper_size - iommu_size; 799 agp_memory_reserved = iommu_size;
793 iommu_bus_base = info.aper_base + iommu_start; 800 iommu_start = aper_size - iommu_size;
794 bad_dma_address = iommu_bus_base; 801 iommu_bus_base = info.aper_base + iommu_start;
795 iommu_gatt_base = agp_gatt_table + (iommu_start>>PAGE_SHIFT); 802 bad_dma_addr = iommu_bus_base;
803 iommu_gatt_base = agp_gatt_table + (iommu_start>>PAGE_SHIFT);
796 804
797 /* 805 /*
798 * Unmap the IOMMU part of the GART. The alias of the page is 806 * Unmap the IOMMU part of the GART. The alias of the page is
@@ -814,7 +822,7 @@ void __init gart_iommu_init(void)
814 * the pages as Not-Present: 822 * the pages as Not-Present:
815 */ 823 */
816 wbinvd(); 824 wbinvd();
817 825
818 /* 826 /*
819 * Now all caches are flushed and we can safely enable 827 * Now all caches are flushed and we can safely enable
820 * GART hardware. Doing it early leaves the possibility 828 * GART hardware. Doing it early leaves the possibility
@@ -838,6 +846,10 @@ void __init gart_iommu_init(void)
838 846
839 flush_gart(); 847 flush_gart();
840 dma_ops = &gart_dma_ops; 848 dma_ops = &gart_dma_ops;
849 x86_platform.iommu_shutdown = gart_iommu_shutdown;
850 swiotlb = 0;
851
852 return 0;
841} 853}
842 854
843void __init gart_parse_options(char *p) 855void __init gart_parse_options(char *p)
@@ -856,7 +868,7 @@ void __init gart_parse_options(char *p)
856#endif 868#endif
857 if (isdigit(*p) && get_option(&p, &arg)) 869 if (isdigit(*p) && get_option(&p, &arg))
858 iommu_size = arg; 870 iommu_size = arg;
859 if (!strncmp(p, "fullflush", 8)) 871 if (!strncmp(p, "fullflush", 9))
860 iommu_fullflush = 1; 872 iommu_fullflush = 1;
861 if (!strncmp(p, "nofullflush", 11)) 873 if (!strncmp(p, "nofullflush", 11))
862 iommu_fullflush = 0; 874 iommu_fullflush = 0;
diff --git a/arch/x86/kernel/pci-nommu.c b/arch/x86/kernel/pci-nommu.c
index a3933d4330cd..22be12b60a8f 100644
--- a/arch/x86/kernel/pci-nommu.c
+++ b/arch/x86/kernel/pci-nommu.c
@@ -33,7 +33,7 @@ static dma_addr_t nommu_map_page(struct device *dev, struct page *page,
33 dma_addr_t bus = page_to_phys(page) + offset; 33 dma_addr_t bus = page_to_phys(page) + offset;
34 WARN_ON(size == 0); 34 WARN_ON(size == 0);
35 if (!check_addr("map_single", dev, bus, size)) 35 if (!check_addr("map_single", dev, bus, size))
36 return bad_dma_address; 36 return DMA_ERROR_CODE;
37 flush_write_buffers(); 37 flush_write_buffers();
38 return bus; 38 return bus;
39} 39}
@@ -103,12 +103,3 @@ struct dma_map_ops nommu_dma_ops = {
103 .sync_sg_for_device = nommu_sync_sg_for_device, 103 .sync_sg_for_device = nommu_sync_sg_for_device,
104 .is_phys = 1, 104 .is_phys = 1,
105}; 105};
106
107void __init no_iommu_init(void)
108{
109 if (dma_ops)
110 return;
111
112 force_iommu = 0; /* no HW IOMMU */
113 dma_ops = &nommu_dma_ops;
114}
diff --git a/arch/x86/kernel/pci-swiotlb.c b/arch/x86/kernel/pci-swiotlb.c
index aaa6b7839f1e..e3c0a66b9e77 100644
--- a/arch/x86/kernel/pci-swiotlb.c
+++ b/arch/x86/kernel/pci-swiotlb.c
@@ -42,18 +42,28 @@ static struct dma_map_ops swiotlb_dma_ops = {
42 .dma_supported = NULL, 42 .dma_supported = NULL,
43}; 43};
44 44
45void __init pci_swiotlb_init(void) 45/*
46 * pci_swiotlb_init - initialize swiotlb if necessary
47 *
48 * This returns non-zero if we are forced to use swiotlb (by the boot
49 * option).
50 */
51int __init pci_swiotlb_init(void)
46{ 52{
53 int use_swiotlb = swiotlb | swiotlb_force;
54
47 /* don't initialize swiotlb if iommu=off (no_iommu=1) */ 55 /* don't initialize swiotlb if iommu=off (no_iommu=1) */
48#ifdef CONFIG_X86_64 56#ifdef CONFIG_X86_64
49 if ((!iommu_detected && !no_iommu && max_pfn > MAX_DMA32_PFN)) 57 if (!no_iommu && max_pfn > MAX_DMA32_PFN)
50 swiotlb = 1; 58 swiotlb = 1;
51#endif 59#endif
52 if (swiotlb_force) 60 if (swiotlb_force)
53 swiotlb = 1; 61 swiotlb = 1;
62
54 if (swiotlb) { 63 if (swiotlb) {
55 printk(KERN_INFO "PCI-DMA: Using software bounce buffering for IO (SWIOTLB)\n"); 64 swiotlb_init(0);
56 swiotlb_init();
57 dma_ops = &swiotlb_dma_ops; 65 dma_ops = &swiotlb_dma_ops;
58 } 66 }
67
68 return use_swiotlb;
59} 69}
diff --git a/arch/x86/kernel/process.c b/arch/x86/kernel/process.c
index 5284cd2b5776..744508e7cfdd 100644
--- a/arch/x86/kernel/process.c
+++ b/arch/x86/kernel/process.c
@@ -10,6 +10,7 @@
10#include <linux/clockchips.h> 10#include <linux/clockchips.h>
11#include <linux/random.h> 11#include <linux/random.h>
12#include <trace/events/power.h> 12#include <trace/events/power.h>
13#include <linux/hw_breakpoint.h>
13#include <asm/system.h> 14#include <asm/system.h>
14#include <asm/apic.h> 15#include <asm/apic.h>
15#include <asm/syscalls.h> 16#include <asm/syscalls.h>
@@ -17,6 +18,7 @@
17#include <asm/uaccess.h> 18#include <asm/uaccess.h>
18#include <asm/i387.h> 19#include <asm/i387.h>
19#include <asm/ds.h> 20#include <asm/ds.h>
21#include <asm/debugreg.h>
20 22
21unsigned long idle_halt; 23unsigned long idle_halt;
22EXPORT_SYMBOL(idle_halt); 24EXPORT_SYMBOL(idle_halt);
@@ -103,14 +105,7 @@ void flush_thread(void)
103 } 105 }
104#endif 106#endif
105 107
106 clear_tsk_thread_flag(tsk, TIF_DEBUG); 108 flush_ptrace_hw_breakpoint(tsk);
107
108 tsk->thread.debugreg0 = 0;
109 tsk->thread.debugreg1 = 0;
110 tsk->thread.debugreg2 = 0;
111 tsk->thread.debugreg3 = 0;
112 tsk->thread.debugreg6 = 0;
113 tsk->thread.debugreg7 = 0;
114 memset(tsk->thread.tls_array, 0, sizeof(tsk->thread.tls_array)); 109 memset(tsk->thread.tls_array, 0, sizeof(tsk->thread.tls_array));
115 /* 110 /*
116 * Forget coprocessor state.. 111 * Forget coprocessor state..
@@ -192,16 +187,6 @@ void __switch_to_xtra(struct task_struct *prev_p, struct task_struct *next_p,
192 else if (next->debugctlmsr != prev->debugctlmsr) 187 else if (next->debugctlmsr != prev->debugctlmsr)
193 update_debugctlmsr(next->debugctlmsr); 188 update_debugctlmsr(next->debugctlmsr);
194 189
195 if (test_tsk_thread_flag(next_p, TIF_DEBUG)) {
196 set_debugreg(next->debugreg0, 0);
197 set_debugreg(next->debugreg1, 1);
198 set_debugreg(next->debugreg2, 2);
199 set_debugreg(next->debugreg3, 3);
200 /* no 4 and 5 */
201 set_debugreg(next->debugreg6, 6);
202 set_debugreg(next->debugreg7, 7);
203 }
204
205 if (test_tsk_thread_flag(prev_p, TIF_NOTSC) ^ 190 if (test_tsk_thread_flag(prev_p, TIF_NOTSC) ^
206 test_tsk_thread_flag(next_p, TIF_NOTSC)) { 191 test_tsk_thread_flag(next_p, TIF_NOTSC)) {
207 /* prev and next are different */ 192 /* prev and next are different */
diff --git a/arch/x86/kernel/process_32.c b/arch/x86/kernel/process_32.c
index e658331edb6d..075580b35682 100644
--- a/arch/x86/kernel/process_32.c
+++ b/arch/x86/kernel/process_32.c
@@ -58,6 +58,7 @@
58#include <asm/idle.h> 58#include <asm/idle.h>
59#include <asm/syscalls.h> 59#include <asm/syscalls.h>
60#include <asm/ds.h> 60#include <asm/ds.h>
61#include <asm/debugreg.h>
61 62
62asmlinkage void ret_from_fork(void) __asm__("ret_from_fork"); 63asmlinkage void ret_from_fork(void) __asm__("ret_from_fork");
63 64
@@ -134,7 +135,7 @@ void __show_regs(struct pt_regs *regs, int all)
134 ss = regs->ss & 0xffff; 135 ss = regs->ss & 0xffff;
135 gs = get_user_gs(regs); 136 gs = get_user_gs(regs);
136 } else { 137 } else {
137 sp = (unsigned long) (&regs->sp); 138 sp = kernel_stack_pointer(regs);
138 savesegment(ss, ss); 139 savesegment(ss, ss);
139 savesegment(gs, gs); 140 savesegment(gs, gs);
140 } 141 }
@@ -259,7 +260,12 @@ int copy_thread(unsigned long clone_flags, unsigned long sp,
259 260
260 task_user_gs(p) = get_user_gs(regs); 261 task_user_gs(p) = get_user_gs(regs);
261 262
263 p->thread.io_bitmap_ptr = NULL;
262 tsk = current; 264 tsk = current;
265 err = -ENOMEM;
266
267 memset(p->thread.ptrace_bps, 0, sizeof(p->thread.ptrace_bps));
268
263 if (unlikely(test_tsk_thread_flag(tsk, TIF_IO_BITMAP))) { 269 if (unlikely(test_tsk_thread_flag(tsk, TIF_IO_BITMAP))) {
264 p->thread.io_bitmap_ptr = kmemdup(tsk->thread.io_bitmap_ptr, 270 p->thread.io_bitmap_ptr = kmemdup(tsk->thread.io_bitmap_ptr,
265 IO_BITMAP_BYTES, GFP_KERNEL); 271 IO_BITMAP_BYTES, GFP_KERNEL);
diff --git a/arch/x86/kernel/process_64.c b/arch/x86/kernel/process_64.c
index 2386999bfcd2..a98fe88fab64 100644
--- a/arch/x86/kernel/process_64.c
+++ b/arch/x86/kernel/process_64.c
@@ -52,6 +52,7 @@
52#include <asm/idle.h> 52#include <asm/idle.h>
53#include <asm/syscalls.h> 53#include <asm/syscalls.h>
54#include <asm/ds.h> 54#include <asm/ds.h>
55#include <asm/debugreg.h>
55 56
56asmlinkage extern void ret_from_fork(void); 57asmlinkage extern void ret_from_fork(void);
57 58
@@ -296,12 +297,16 @@ int copy_thread(unsigned long clone_flags, unsigned long sp,
296 297
297 p->thread.fs = me->thread.fs; 298 p->thread.fs = me->thread.fs;
298 p->thread.gs = me->thread.gs; 299 p->thread.gs = me->thread.gs;
300 p->thread.io_bitmap_ptr = NULL;
299 301
300 savesegment(gs, p->thread.gsindex); 302 savesegment(gs, p->thread.gsindex);
301 savesegment(fs, p->thread.fsindex); 303 savesegment(fs, p->thread.fsindex);
302 savesegment(es, p->thread.es); 304 savesegment(es, p->thread.es);
303 savesegment(ds, p->thread.ds); 305 savesegment(ds, p->thread.ds);
304 306
307 err = -ENOMEM;
308 memset(p->thread.ptrace_bps, 0, sizeof(p->thread.ptrace_bps));
309
305 if (unlikely(test_tsk_thread_flag(me, TIF_IO_BITMAP))) { 310 if (unlikely(test_tsk_thread_flag(me, TIF_IO_BITMAP))) {
306 p->thread.io_bitmap_ptr = kmalloc(IO_BITMAP_BYTES, GFP_KERNEL); 311 p->thread.io_bitmap_ptr = kmalloc(IO_BITMAP_BYTES, GFP_KERNEL);
307 if (!p->thread.io_bitmap_ptr) { 312 if (!p->thread.io_bitmap_ptr) {
@@ -340,6 +345,7 @@ out:
340 kfree(p->thread.io_bitmap_ptr); 345 kfree(p->thread.io_bitmap_ptr);
341 p->thread.io_bitmap_max = 0; 346 p->thread.io_bitmap_max = 0;
342 } 347 }
348
343 return err; 349 return err;
344} 350}
345 351
@@ -494,6 +500,7 @@ __switch_to(struct task_struct *prev_p, struct task_struct *next_p)
494 */ 500 */
495 if (preload_fpu) 501 if (preload_fpu)
496 __math_state_restore(); 502 __math_state_restore();
503
497 return prev_p; 504 return prev_p;
498} 505}
499 506
@@ -663,3 +670,8 @@ long sys_arch_prctl(int code, unsigned long addr)
663 return do_arch_prctl(current, code, addr); 670 return do_arch_prctl(current, code, addr);
664} 671}
665 672
673unsigned long KSTK_ESP(struct task_struct *task)
674{
675 return (test_tsk_thread_flag(task, TIF_IA32)) ?
676 (task_pt_regs(task)->sp) : ((task)->thread.usersp);
677}
diff --git a/arch/x86/kernel/ptrace.c b/arch/x86/kernel/ptrace.c
index 7b058a2dc66a..04d182a7cfdb 100644
--- a/arch/x86/kernel/ptrace.c
+++ b/arch/x86/kernel/ptrace.c
@@ -22,6 +22,8 @@
22#include <linux/seccomp.h> 22#include <linux/seccomp.h>
23#include <linux/signal.h> 23#include <linux/signal.h>
24#include <linux/workqueue.h> 24#include <linux/workqueue.h>
25#include <linux/perf_event.h>
26#include <linux/hw_breakpoint.h>
25 27
26#include <asm/uaccess.h> 28#include <asm/uaccess.h>
27#include <asm/pgtable.h> 29#include <asm/pgtable.h>
@@ -34,6 +36,7 @@
34#include <asm/prctl.h> 36#include <asm/prctl.h>
35#include <asm/proto.h> 37#include <asm/proto.h>
36#include <asm/ds.h> 38#include <asm/ds.h>
39#include <asm/hw_breakpoint.h>
37 40
38#include "tls.h" 41#include "tls.h"
39 42
@@ -49,6 +52,118 @@ enum x86_regset {
49 REGSET_IOPERM32, 52 REGSET_IOPERM32,
50}; 53};
51 54
55struct pt_regs_offset {
56 const char *name;
57 int offset;
58};
59
60#define REG_OFFSET_NAME(r) {.name = #r, .offset = offsetof(struct pt_regs, r)}
61#define REG_OFFSET_END {.name = NULL, .offset = 0}
62
63static const struct pt_regs_offset regoffset_table[] = {
64#ifdef CONFIG_X86_64
65 REG_OFFSET_NAME(r15),
66 REG_OFFSET_NAME(r14),
67 REG_OFFSET_NAME(r13),
68 REG_OFFSET_NAME(r12),
69 REG_OFFSET_NAME(r11),
70 REG_OFFSET_NAME(r10),
71 REG_OFFSET_NAME(r9),
72 REG_OFFSET_NAME(r8),
73#endif
74 REG_OFFSET_NAME(bx),
75 REG_OFFSET_NAME(cx),
76 REG_OFFSET_NAME(dx),
77 REG_OFFSET_NAME(si),
78 REG_OFFSET_NAME(di),
79 REG_OFFSET_NAME(bp),
80 REG_OFFSET_NAME(ax),
81#ifdef CONFIG_X86_32
82 REG_OFFSET_NAME(ds),
83 REG_OFFSET_NAME(es),
84 REG_OFFSET_NAME(fs),
85 REG_OFFSET_NAME(gs),
86#endif
87 REG_OFFSET_NAME(orig_ax),
88 REG_OFFSET_NAME(ip),
89 REG_OFFSET_NAME(cs),
90 REG_OFFSET_NAME(flags),
91 REG_OFFSET_NAME(sp),
92 REG_OFFSET_NAME(ss),
93 REG_OFFSET_END,
94};
95
96/**
97 * regs_query_register_offset() - query register offset from its name
98 * @name: the name of a register
99 *
100 * regs_query_register_offset() returns the offset of a register in struct
101 * pt_regs from its name. If the name is invalid, this returns -EINVAL;
102 */
103int regs_query_register_offset(const char *name)
104{
105 const struct pt_regs_offset *roff;
106 for (roff = regoffset_table; roff->name != NULL; roff++)
107 if (!strcmp(roff->name, name))
108 return roff->offset;
109 return -EINVAL;
110}
111
112/**
113 * regs_query_register_name() - query register name from its offset
114 * @offset: the offset of a register in struct pt_regs.
115 *
116 * regs_query_register_name() returns the name of a register from its
117 * offset in struct pt_regs. If the @offset is invalid, this returns NULL;
118 */
119const char *regs_query_register_name(unsigned int offset)
120{
121 const struct pt_regs_offset *roff;
122 for (roff = regoffset_table; roff->name != NULL; roff++)
123 if (roff->offset == offset)
124 return roff->name;
125 return NULL;
126}
127
128static const int arg_offs_table[] = {
129#ifdef CONFIG_X86_32
130 [0] = offsetof(struct pt_regs, ax),
131 [1] = offsetof(struct pt_regs, dx),
132 [2] = offsetof(struct pt_regs, cx)
133#else /* CONFIG_X86_64 */
134 [0] = offsetof(struct pt_regs, di),
135 [1] = offsetof(struct pt_regs, si),
136 [2] = offsetof(struct pt_regs, dx),
137 [3] = offsetof(struct pt_regs, cx),
138 [4] = offsetof(struct pt_regs, r8),
139 [5] = offsetof(struct pt_regs, r9)
140#endif
141};
142
143/**
144 * regs_get_argument_nth() - get Nth argument at function call
145 * @regs: pt_regs which contains registers at function entry.
146 * @n: argument number.
147 *
148 * regs_get_argument_nth() returns @n th argument of a function call.
149 * Since usually the kernel stack will be changed right after function entry,
150 * you must use this at function entry. If the @n th entry is NOT in the
151 * kernel stack or pt_regs, this returns 0.
152 */
153unsigned long regs_get_argument_nth(struct pt_regs *regs, unsigned int n)
154{
155 if (n < ARRAY_SIZE(arg_offs_table))
156 return *(unsigned long *)((char *)regs + arg_offs_table[n]);
157 else {
158 /*
159 * The typical case: arg n is on the stack.
160 * (Note: stack[0] = return address, so skip it)
161 */
162 n -= ARRAY_SIZE(arg_offs_table);
163 return regs_get_kernel_stack_nth(regs, 1 + n);
164 }
165}
166
52/* 167/*
53 * does not yet catch signals sent when the child dies. 168 * does not yet catch signals sent when the child dies.
54 * in exit.c or in signal.c. 169 * in exit.c or in signal.c.
@@ -137,11 +252,6 @@ static int set_segment_reg(struct task_struct *task,
137 return 0; 252 return 0;
138} 253}
139 254
140static unsigned long debugreg_addr_limit(struct task_struct *task)
141{
142 return TASK_SIZE - 3;
143}
144
145#else /* CONFIG_X86_64 */ 255#else /* CONFIG_X86_64 */
146 256
147#define FLAG_MASK (FLAG_MASK_32 | X86_EFLAGS_NT) 257#define FLAG_MASK (FLAG_MASK_32 | X86_EFLAGS_NT)
@@ -266,15 +376,6 @@ static int set_segment_reg(struct task_struct *task,
266 return 0; 376 return 0;
267} 377}
268 378
269static unsigned long debugreg_addr_limit(struct task_struct *task)
270{
271#ifdef CONFIG_IA32_EMULATION
272 if (test_tsk_thread_flag(task, TIF_IA32))
273 return IA32_PAGE_OFFSET - 3;
274#endif
275 return TASK_SIZE_MAX - 7;
276}
277
278#endif /* CONFIG_X86_32 */ 379#endif /* CONFIG_X86_32 */
279 380
280static unsigned long get_flags(struct task_struct *task) 381static unsigned long get_flags(struct task_struct *task)
@@ -454,99 +555,239 @@ static int genregs_set(struct task_struct *target,
454 return ret; 555 return ret;
455} 556}
456 557
558static void ptrace_triggered(struct perf_event *bp, void *data)
559{
560 int i;
561 struct thread_struct *thread = &(current->thread);
562
563 /*
564 * Store in the virtual DR6 register the fact that the breakpoint
565 * was hit so the thread's debugger will see it.
566 */
567 for (i = 0; i < HBP_NUM; i++) {
568 if (thread->ptrace_bps[i] == bp)
569 break;
570 }
571
572 thread->debugreg6 |= (DR_TRAP0 << i);
573}
574
457/* 575/*
458 * This function is trivial and will be inlined by the compiler. 576 * Walk through every ptrace breakpoints for this thread and
459 * Having it separates the implementation details of debug 577 * build the dr7 value on top of their attributes.
460 * registers from the interface details of ptrace. 578 *
461 */ 579 */
462static unsigned long ptrace_get_debugreg(struct task_struct *child, int n) 580static unsigned long ptrace_get_dr7(struct perf_event *bp[])
463{ 581{
464 switch (n) { 582 int i;
465 case 0: return child->thread.debugreg0; 583 int dr7 = 0;
466 case 1: return child->thread.debugreg1; 584 struct arch_hw_breakpoint *info;
467 case 2: return child->thread.debugreg2; 585
468 case 3: return child->thread.debugreg3; 586 for (i = 0; i < HBP_NUM; i++) {
469 case 6: return child->thread.debugreg6; 587 if (bp[i] && !bp[i]->attr.disabled) {
470 case 7: return child->thread.debugreg7; 588 info = counter_arch_bp(bp[i]);
589 dr7 |= encode_dr7(i, info->len, info->type);
590 }
471 } 591 }
472 return 0; 592
593 return dr7;
473} 594}
474 595
475static int ptrace_set_debugreg(struct task_struct *child, 596static struct perf_event *
476 int n, unsigned long data) 597ptrace_modify_breakpoint(struct perf_event *bp, int len, int type,
598 struct task_struct *tsk, int disabled)
477{ 599{
478 int i; 600 int err;
601 int gen_len, gen_type;
602 DEFINE_BREAKPOINT_ATTR(attr);
479 603
480 if (unlikely(n == 4 || n == 5)) 604 /*
481 return -EIO; 605 * We shoud have at least an inactive breakpoint at this
606 * slot. It means the user is writing dr7 without having
607 * written the address register first
608 */
609 if (!bp)
610 return ERR_PTR(-EINVAL);
482 611
483 if (n < 4 && unlikely(data >= debugreg_addr_limit(child))) 612 err = arch_bp_generic_fields(len, type, &gen_len, &gen_type);
484 return -EIO; 613 if (err)
614 return ERR_PTR(err);
485 615
486 switch (n) { 616 attr = bp->attr;
487 case 0: child->thread.debugreg0 = data; break; 617 attr.bp_len = gen_len;
488 case 1: child->thread.debugreg1 = data; break; 618 attr.bp_type = gen_type;
489 case 2: child->thread.debugreg2 = data; break; 619 attr.disabled = disabled;
490 case 3: child->thread.debugreg3 = data; break;
491 620
492 case 6: 621 return modify_user_hw_breakpoint(bp, &attr, bp->callback, tsk);
493 if ((data & ~0xffffffffUL) != 0) 622}
494 return -EIO; 623
495 child->thread.debugreg6 = data; 624/*
496 break; 625 * Handle ptrace writes to debug register 7.
626 */
627static int ptrace_write_dr7(struct task_struct *tsk, unsigned long data)
628{
629 struct thread_struct *thread = &(tsk->thread);
630 unsigned long old_dr7;
631 int i, orig_ret = 0, rc = 0;
632 int enabled, second_pass = 0;
633 unsigned len, type;
634 struct perf_event *bp;
635
636 data &= ~DR_CONTROL_RESERVED;
637 old_dr7 = ptrace_get_dr7(thread->ptrace_bps);
638restore:
639 /*
640 * Loop through all the hardware breakpoints, making the
641 * appropriate changes to each.
642 */
643 for (i = 0; i < HBP_NUM; i++) {
644 enabled = decode_dr7(data, i, &len, &type);
645 bp = thread->ptrace_bps[i];
646
647 if (!enabled) {
648 if (bp) {
649 /*
650 * Don't unregister the breakpoints right-away,
651 * unless all register_user_hw_breakpoint()
652 * requests have succeeded. This prevents
653 * any window of opportunity for debug
654 * register grabbing by other users.
655 */
656 if (!second_pass)
657 continue;
658
659 thread->ptrace_bps[i] = NULL;
660 bp = ptrace_modify_breakpoint(bp, len, type,
661 tsk, 1);
662 if (IS_ERR(bp)) {
663 rc = PTR_ERR(bp);
664 thread->ptrace_bps[i] = NULL;
665 break;
666 }
667 thread->ptrace_bps[i] = bp;
668 }
669 continue;
670 }
671
672 bp = ptrace_modify_breakpoint(bp, len, type, tsk, 0);
673
674 /* Incorrect bp, or we have a bug in bp API */
675 if (IS_ERR(bp)) {
676 rc = PTR_ERR(bp);
677 thread->ptrace_bps[i] = NULL;
678 break;
679 }
680 thread->ptrace_bps[i] = bp;
681 }
682 /*
683 * Make a second pass to free the remaining unused breakpoints
684 * or to restore the original breakpoints if an error occurred.
685 */
686 if (!second_pass) {
687 second_pass = 1;
688 if (rc < 0) {
689 orig_ret = rc;
690 data = old_dr7;
691 }
692 goto restore;
693 }
694 return ((orig_ret < 0) ? orig_ret : rc);
695}
696
697/*
698 * Handle PTRACE_PEEKUSR calls for the debug register area.
699 */
700static unsigned long ptrace_get_debugreg(struct task_struct *tsk, int n)
701{
702 struct thread_struct *thread = &(tsk->thread);
703 unsigned long val = 0;
497 704
498 case 7: 705 if (n < HBP_NUM) {
706 struct perf_event *bp;
707 bp = thread->ptrace_bps[n];
708 if (!bp)
709 return 0;
710 val = bp->hw.info.address;
711 } else if (n == 6) {
712 val = thread->debugreg6;
713 } else if (n == 7) {
714 val = ptrace_get_dr7(thread->ptrace_bps);
715 }
716 return val;
717}
718
719static int ptrace_set_breakpoint_addr(struct task_struct *tsk, int nr,
720 unsigned long addr)
721{
722 struct perf_event *bp;
723 struct thread_struct *t = &tsk->thread;
724 DEFINE_BREAKPOINT_ATTR(attr);
725
726 if (!t->ptrace_bps[nr]) {
499 /* 727 /*
500 * Sanity-check data. Take one half-byte at once with 728 * Put stub len and type to register (reserve) an inactive but
501 * check = (val >> (16 + 4*i)) & 0xf. It contains the 729 * correct bp
502 * R/Wi and LENi bits; bits 0 and 1 are R/Wi, and bits
503 * 2 and 3 are LENi. Given a list of invalid values,
504 * we do mask |= 1 << invalid_value, so that
505 * (mask >> check) & 1 is a correct test for invalid
506 * values.
507 *
508 * R/Wi contains the type of the breakpoint /
509 * watchpoint, LENi contains the length of the watched
510 * data in the watchpoint case.
511 *
512 * The invalid values are:
513 * - LENi == 0x10 (undefined), so mask |= 0x0f00. [32-bit]
514 * - R/Wi == 0x10 (break on I/O reads or writes), so
515 * mask |= 0x4444.
516 * - R/Wi == 0x00 && LENi != 0x00, so we have mask |=
517 * 0x1110.
518 *
519 * Finally, mask = 0x0f00 | 0x4444 | 0x1110 == 0x5f54.
520 *
521 * See the Intel Manual "System Programming Guide",
522 * 15.2.4
523 *
524 * Note that LENi == 0x10 is defined on x86_64 in long
525 * mode (i.e. even for 32-bit userspace software, but
526 * 64-bit kernel), so the x86_64 mask value is 0x5454.
527 * See the AMD manual no. 24593 (AMD64 System Programming)
528 */ 730 */
529#ifdef CONFIG_X86_32 731 attr.bp_addr = addr;
530#define DR7_MASK 0x5f54 732 attr.bp_len = HW_BREAKPOINT_LEN_1;
531#else 733 attr.bp_type = HW_BREAKPOINT_W;
532#define DR7_MASK 0x5554 734 attr.disabled = 1;
533#endif 735
534 data &= ~DR_CONTROL_RESERVED; 736 bp = register_user_hw_breakpoint(&attr, ptrace_triggered, tsk);
535 for (i = 0; i < 4; i++) 737 } else {
536 if ((DR7_MASK >> ((data >> (16 + 4*i)) & 0xf)) & 1) 738 bp = t->ptrace_bps[nr];
537 return -EIO; 739 t->ptrace_bps[nr] = NULL;
538 child->thread.debugreg7 = data; 740
539 if (data) 741 attr = bp->attr;
540 set_tsk_thread_flag(child, TIF_DEBUG); 742 attr.bp_addr = addr;
541 else 743 bp = modify_user_hw_breakpoint(bp, &attr, bp->callback, tsk);
542 clear_tsk_thread_flag(child, TIF_DEBUG);
543 break;
544 } 744 }
745 /*
746 * CHECKME: the previous code returned -EIO if the addr wasn't a
747 * valid task virtual addr. The new one will return -EINVAL in this
748 * case.
749 * -EINVAL may be what we want for in-kernel breakpoints users, but
750 * -EIO looks better for ptrace, since we refuse a register writing
751 * for the user. And anyway this is the previous behaviour.
752 */
753 if (IS_ERR(bp))
754 return PTR_ERR(bp);
755
756 t->ptrace_bps[nr] = bp;
545 757
546 return 0; 758 return 0;
547} 759}
548 760
549/* 761/*
762 * Handle PTRACE_POKEUSR calls for the debug register area.
763 */
764int ptrace_set_debugreg(struct task_struct *tsk, int n, unsigned long val)
765{
766 struct thread_struct *thread = &(tsk->thread);
767 int rc = 0;
768
769 /* There are no DR4 or DR5 registers */
770 if (n == 4 || n == 5)
771 return -EIO;
772
773 if (n == 6) {
774 thread->debugreg6 = val;
775 goto ret_path;
776 }
777 if (n < HBP_NUM) {
778 rc = ptrace_set_breakpoint_addr(tsk, n, val);
779 if (rc)
780 return rc;
781 }
782 /* All that's left is DR7 */
783 if (n == 7)
784 rc = ptrace_write_dr7(tsk, val);
785
786ret_path:
787 return rc;
788}
789
790/*
550 * These access the current or another (stopped) task's io permission 791 * These access the current or another (stopped) task's io permission
551 * bitmap for debugging or core dump. 792 * bitmap for debugging or core dump.
552 */ 793 */
diff --git a/arch/x86/kernel/reboot.c b/arch/x86/kernel/reboot.c
index a1a3cdda06e1..2b97fc5b124e 100644
--- a/arch/x86/kernel/reboot.c
+++ b/arch/x86/kernel/reboot.c
@@ -23,7 +23,7 @@
23# include <linux/ctype.h> 23# include <linux/ctype.h>
24# include <linux/mc146818rtc.h> 24# include <linux/mc146818rtc.h>
25#else 25#else
26# include <asm/iommu.h> 26# include <asm/x86_init.h>
27#endif 27#endif
28 28
29/* 29/*
@@ -436,6 +436,14 @@ static struct dmi_system_id __initdata pci_reboot_dmi_table[] = {
436 DMI_MATCH(DMI_PRODUCT_NAME, "MacBookPro5"), 436 DMI_MATCH(DMI_PRODUCT_NAME, "MacBookPro5"),
437 }, 437 },
438 }, 438 },
439 { /* Handle problems with rebooting on Apple Macmini3,1 */
440 .callback = set_pci_reboot,
441 .ident = "Apple Macmini3,1",
442 .matches = {
443 DMI_MATCH(DMI_SYS_VENDOR, "Apple Inc."),
444 DMI_MATCH(DMI_PRODUCT_NAME, "Macmini3,1"),
445 },
446 },
439 { } 447 { }
440}; 448};
441 449
@@ -614,7 +622,7 @@ void native_machine_shutdown(void)
614#endif 622#endif
615 623
616#ifdef CONFIG_X86_64 624#ifdef CONFIG_X86_64
617 pci_iommu_shutdown(); 625 x86_platform.iommu_shutdown();
618#endif 626#endif
619} 627}
620 628
diff --git a/arch/x86/kernel/setup.c b/arch/x86/kernel/setup.c
index e09f0e2c14b5..82e88cdda9bc 100644
--- a/arch/x86/kernel/setup.c
+++ b/arch/x86/kernel/setup.c
@@ -109,6 +109,7 @@
109#ifdef CONFIG_X86_64 109#ifdef CONFIG_X86_64
110#include <asm/numa_64.h> 110#include <asm/numa_64.h>
111#endif 111#endif
112#include <asm/mce.h>
112 113
113/* 114/*
114 * end_pfn only includes RAM, while max_pfn_mapped includes all e820 entries. 115 * end_pfn only includes RAM, while max_pfn_mapped includes all e820 entries.
@@ -247,7 +248,7 @@ EXPORT_SYMBOL(edd);
247 * from boot_params into a safe place. 248 * from boot_params into a safe place.
248 * 249 *
249 */ 250 */
250static inline void copy_edd(void) 251static inline void __init copy_edd(void)
251{ 252{
252 memcpy(edd.mbr_signature, boot_params.edd_mbr_sig_buffer, 253 memcpy(edd.mbr_signature, boot_params.edd_mbr_sig_buffer,
253 sizeof(edd.mbr_signature)); 254 sizeof(edd.mbr_signature));
@@ -256,7 +257,7 @@ static inline void copy_edd(void)
256 edd.edd_info_nr = boot_params.eddbuf_entries; 257 edd.edd_info_nr = boot_params.eddbuf_entries;
257} 258}
258#else 259#else
259static inline void copy_edd(void) 260static inline void __init copy_edd(void)
260{ 261{
261} 262}
262#endif 263#endif
@@ -660,6 +661,13 @@ static struct dmi_system_id __initdata bad_bios_dmi_table[] = {
660 }, 661 },
661 }, 662 },
662 { 663 {
664 .callback = dmi_low_memory_corruption,
665 .ident = "Phoenix/MSC BIOS",
666 .matches = {
667 DMI_MATCH(DMI_BIOS_VENDOR, "Phoenix/MSC"),
668 },
669 },
670 {
663 /* 671 /*
664 * AMI BIOS with low memory corruption was found on Intel DG45ID board. 672 * AMI BIOS with low memory corruption was found on Intel DG45ID board.
665 * It hase different DMI_BIOS_VENDOR = "Intel Corp.", for now we will 673 * It hase different DMI_BIOS_VENDOR = "Intel Corp.", for now we will
@@ -1024,6 +1032,8 @@ void __init setup_arch(char **cmdline_p)
1024#endif 1032#endif
1025#endif 1033#endif
1026 x86_init.oem.banner(); 1034 x86_init.oem.banner();
1035
1036 mcheck_init();
1027} 1037}
1028 1038
1029#ifdef CONFIG_X86_32 1039#ifdef CONFIG_X86_32
diff --git a/arch/x86/kernel/signal.c b/arch/x86/kernel/signal.c
index 6a44a76055ad..fbf3b07c8567 100644
--- a/arch/x86/kernel/signal.c
+++ b/arch/x86/kernel/signal.c
@@ -799,15 +799,6 @@ static void do_signal(struct pt_regs *regs)
799 799
800 signr = get_signal_to_deliver(&info, &ka, regs, NULL); 800 signr = get_signal_to_deliver(&info, &ka, regs, NULL);
801 if (signr > 0) { 801 if (signr > 0) {
802 /*
803 * Re-enable any watchpoints before delivering the
804 * signal to user space. The processor register will
805 * have been cleared if the watchpoint triggered
806 * inside the kernel.
807 */
808 if (current->thread.debugreg7)
809 set_debugreg(current->thread.debugreg7, 7);
810
811 /* Whee! Actually deliver the signal. */ 802 /* Whee! Actually deliver the signal. */
812 if (handle_signal(signr, &info, &ka, oldset, regs) == 0) { 803 if (handle_signal(signr, &info, &ka, oldset, regs) == 0) {
813 /* 804 /*
diff --git a/arch/x86/kernel/smpboot.c b/arch/x86/kernel/smpboot.c
index 565ebc65920e..324f2a44c221 100644
--- a/arch/x86/kernel/smpboot.c
+++ b/arch/x86/kernel/smpboot.c
@@ -1250,16 +1250,7 @@ static void __ref remove_cpu_from_maps(int cpu)
1250void cpu_disable_common(void) 1250void cpu_disable_common(void)
1251{ 1251{
1252 int cpu = smp_processor_id(); 1252 int cpu = smp_processor_id();
1253 /*
1254 * HACK:
1255 * Allow any queued timer interrupts to get serviced
1256 * This is only a temporary solution until we cleanup
1257 * fixup_irqs as we do for IA64.
1258 */
1259 local_irq_enable();
1260 mdelay(1);
1261 1253
1262 local_irq_disable();
1263 remove_siblinginfo(cpu); 1254 remove_siblinginfo(cpu);
1264 1255
1265 /* It's now safe to remove this processor from the online map */ 1256 /* It's now safe to remove this processor from the online map */
diff --git a/arch/x86/kernel/traps.c b/arch/x86/kernel/traps.c
index 7e37dcee0cc3..33399176512a 100644
--- a/arch/x86/kernel/traps.c
+++ b/arch/x86/kernel/traps.c
@@ -529,77 +529,56 @@ asmlinkage __kprobes struct pt_regs *sync_regs(struct pt_regs *eregs)
529dotraplinkage void __kprobes do_debug(struct pt_regs *regs, long error_code) 529dotraplinkage void __kprobes do_debug(struct pt_regs *regs, long error_code)
530{ 530{
531 struct task_struct *tsk = current; 531 struct task_struct *tsk = current;
532 unsigned long condition; 532 unsigned long dr6;
533 int si_code; 533 int si_code;
534 534
535 get_debugreg(condition, 6); 535 get_debugreg(dr6, 6);
536 536
537 /* Catch kmemcheck conditions first of all! */ 537 /* Catch kmemcheck conditions first of all! */
538 if (condition & DR_STEP && kmemcheck_trap(regs)) 538 if ((dr6 & DR_STEP) && kmemcheck_trap(regs))
539 return; 539 return;
540 540
541 /* DR6 may or may not be cleared by the CPU */
542 set_debugreg(0, 6);
541 /* 543 /*
542 * The processor cleared BTF, so don't mark that we need it set. 544 * The processor cleared BTF, so don't mark that we need it set.
543 */ 545 */
544 clear_tsk_thread_flag(tsk, TIF_DEBUGCTLMSR); 546 clear_tsk_thread_flag(tsk, TIF_DEBUGCTLMSR);
545 tsk->thread.debugctlmsr = 0; 547 tsk->thread.debugctlmsr = 0;
546 548
547 if (notify_die(DIE_DEBUG, "debug", regs, condition, error_code, 549 /* Store the virtualized DR6 value */
548 SIGTRAP) == NOTIFY_STOP) 550 tsk->thread.debugreg6 = dr6;
551
552 if (notify_die(DIE_DEBUG, "debug", regs, PTR_ERR(&dr6), error_code,
553 SIGTRAP) == NOTIFY_STOP)
549 return; 554 return;
550 555
551 /* It's safe to allow irq's after DR6 has been saved */ 556 /* It's safe to allow irq's after DR6 has been saved */
552 preempt_conditional_sti(regs); 557 preempt_conditional_sti(regs);
553 558
554 /* Mask out spurious debug traps due to lazy DR7 setting */ 559 if (regs->flags & X86_VM_MASK) {
555 if (condition & (DR_TRAP0|DR_TRAP1|DR_TRAP2|DR_TRAP3)) { 560 handle_vm86_trap((struct kernel_vm86_regs *) regs,
556 if (!tsk->thread.debugreg7) 561 error_code, 1);
557 goto clear_dr7; 562 return;
558 } 563 }
559 564
560#ifdef CONFIG_X86_32
561 if (regs->flags & X86_VM_MASK)
562 goto debug_vm86;
563#endif
564
565 /* Save debug status register where ptrace can see it */
566 tsk->thread.debugreg6 = condition;
567
568 /* 565 /*
569 * Single-stepping through TF: make sure we ignore any events in 566 * Single-stepping through system calls: ignore any exceptions in
570 * kernel space (but re-enable TF when returning to user mode). 567 * kernel space, but re-enable TF when returning to user mode.
568 *
569 * We already checked v86 mode above, so we can check for kernel mode
570 * by just checking the CPL of CS.
571 */ 571 */
572 if (condition & DR_STEP) { 572 if ((dr6 & DR_STEP) && !user_mode(regs)) {
573 if (!user_mode(regs)) 573 tsk->thread.debugreg6 &= ~DR_STEP;
574 goto clear_TF_reenable; 574 set_tsk_thread_flag(tsk, TIF_SINGLESTEP);
575 regs->flags &= ~X86_EFLAGS_TF;
575 } 576 }
576 577 si_code = get_si_code(tsk->thread.debugreg6);
577 si_code = get_si_code(condition); 578 if (tsk->thread.debugreg6 & (DR_STEP | DR_TRAP_BITS))
578 /* Ok, finally something we can handle */ 579 send_sigtrap(tsk, regs, error_code, si_code);
579 send_sigtrap(tsk, regs, error_code, si_code);
580
581 /*
582 * Disable additional traps. They'll be re-enabled when
583 * the signal is delivered.
584 */
585clear_dr7:
586 set_debugreg(0, 7);
587 preempt_conditional_cli(regs); 580 preempt_conditional_cli(regs);
588 return;
589 581
590#ifdef CONFIG_X86_32
591debug_vm86:
592 /* reenable preemption: handle_vm86_trap() might sleep */
593 dec_preempt_count();
594 handle_vm86_trap((struct kernel_vm86_regs *) regs, error_code, 1);
595 conditional_cli(regs);
596 return;
597#endif
598
599clear_TF_reenable:
600 set_tsk_thread_flag(tsk, TIF_SINGLESTEP);
601 regs->flags &= ~X86_EFLAGS_TF;
602 preempt_conditional_cli(regs);
603 return; 582 return;
604} 583}
605 584
diff --git a/arch/x86/kernel/uv_irq.c b/arch/x86/kernel/uv_irq.c
index aeef529917e4..61d805df4c91 100644
--- a/arch/x86/kernel/uv_irq.c
+++ b/arch/x86/kernel/uv_irq.c
@@ -9,10 +9,25 @@
9 */ 9 */
10 10
11#include <linux/module.h> 11#include <linux/module.h>
12#include <linux/rbtree.h>
12#include <linux/irq.h> 13#include <linux/irq.h>
13 14
14#include <asm/apic.h> 15#include <asm/apic.h>
15#include <asm/uv/uv_irq.h> 16#include <asm/uv/uv_irq.h>
17#include <asm/uv/uv_hub.h>
18
19/* MMR offset and pnode of hub sourcing interrupts for a given irq */
20struct uv_irq_2_mmr_pnode{
21 struct rb_node list;
22 unsigned long offset;
23 int pnode;
24 int irq;
25};
26
27static spinlock_t uv_irq_lock;
28static struct rb_root uv_irq_root;
29
30static int uv_set_irq_affinity(unsigned int, const struct cpumask *);
16 31
17static void uv_noop(unsigned int irq) 32static void uv_noop(unsigned int irq)
18{ 33{
@@ -39,25 +54,214 @@ struct irq_chip uv_irq_chip = {
39 .unmask = uv_noop, 54 .unmask = uv_noop,
40 .eoi = uv_ack_apic, 55 .eoi = uv_ack_apic,
41 .end = uv_noop, 56 .end = uv_noop,
57 .set_affinity = uv_set_irq_affinity,
42}; 58};
43 59
44/* 60/*
61 * Add offset and pnode information of the hub sourcing interrupts to the
62 * rb tree for a specific irq.
63 */
64static int uv_set_irq_2_mmr_info(int irq, unsigned long offset, unsigned blade)
65{
66 struct rb_node **link = &uv_irq_root.rb_node;
67 struct rb_node *parent = NULL;
68 struct uv_irq_2_mmr_pnode *n;
69 struct uv_irq_2_mmr_pnode *e;
70 unsigned long irqflags;
71
72 n = kmalloc_node(sizeof(struct uv_irq_2_mmr_pnode), GFP_KERNEL,
73 uv_blade_to_memory_nid(blade));
74 if (!n)
75 return -ENOMEM;
76
77 n->irq = irq;
78 n->offset = offset;
79 n->pnode = uv_blade_to_pnode(blade);
80 spin_lock_irqsave(&uv_irq_lock, irqflags);
81 /* Find the right place in the rbtree: */
82 while (*link) {
83 parent = *link;
84 e = rb_entry(parent, struct uv_irq_2_mmr_pnode, list);
85
86 if (unlikely(irq == e->irq)) {
87 /* irq entry exists */
88 e->pnode = uv_blade_to_pnode(blade);
89 e->offset = offset;
90 spin_unlock_irqrestore(&uv_irq_lock, irqflags);
91 kfree(n);
92 return 0;
93 }
94
95 if (irq < e->irq)
96 link = &(*link)->rb_left;
97 else
98 link = &(*link)->rb_right;
99 }
100
101 /* Insert the node into the rbtree. */
102 rb_link_node(&n->list, parent, link);
103 rb_insert_color(&n->list, &uv_irq_root);
104
105 spin_unlock_irqrestore(&uv_irq_lock, irqflags);
106 return 0;
107}
108
109/* Retrieve offset and pnode information from the rb tree for a specific irq */
110int uv_irq_2_mmr_info(int irq, unsigned long *offset, int *pnode)
111{
112 struct uv_irq_2_mmr_pnode *e;
113 struct rb_node *n;
114 unsigned long irqflags;
115
116 spin_lock_irqsave(&uv_irq_lock, irqflags);
117 n = uv_irq_root.rb_node;
118 while (n) {
119 e = rb_entry(n, struct uv_irq_2_mmr_pnode, list);
120
121 if (e->irq == irq) {
122 *offset = e->offset;
123 *pnode = e->pnode;
124 spin_unlock_irqrestore(&uv_irq_lock, irqflags);
125 return 0;
126 }
127
128 if (irq < e->irq)
129 n = n->rb_left;
130 else
131 n = n->rb_right;
132 }
133 spin_unlock_irqrestore(&uv_irq_lock, irqflags);
134 return -1;
135}
136
137/*
138 * Re-target the irq to the specified CPU and enable the specified MMR located
139 * on the specified blade to allow the sending of MSIs to the specified CPU.
140 */
141static int
142arch_enable_uv_irq(char *irq_name, unsigned int irq, int cpu, int mmr_blade,
143 unsigned long mmr_offset, int restrict)
144{
145 const struct cpumask *eligible_cpu = cpumask_of(cpu);
146 struct irq_desc *desc = irq_to_desc(irq);
147 struct irq_cfg *cfg;
148 int mmr_pnode;
149 unsigned long mmr_value;
150 struct uv_IO_APIC_route_entry *entry;
151 int err;
152
153 BUILD_BUG_ON(sizeof(struct uv_IO_APIC_route_entry) !=
154 sizeof(unsigned long));
155
156 cfg = irq_cfg(irq);
157
158 err = assign_irq_vector(irq, cfg, eligible_cpu);
159 if (err != 0)
160 return err;
161
162 if (restrict == UV_AFFINITY_CPU)
163 desc->status |= IRQ_NO_BALANCING;
164 else
165 desc->status |= IRQ_MOVE_PCNTXT;
166
167 set_irq_chip_and_handler_name(irq, &uv_irq_chip, handle_percpu_irq,
168 irq_name);
169
170 mmr_value = 0;
171 entry = (struct uv_IO_APIC_route_entry *)&mmr_value;
172 entry->vector = cfg->vector;
173 entry->delivery_mode = apic->irq_delivery_mode;
174 entry->dest_mode = apic->irq_dest_mode;
175 entry->polarity = 0;
176 entry->trigger = 0;
177 entry->mask = 0;
178 entry->dest = apic->cpu_mask_to_apicid(eligible_cpu);
179
180 mmr_pnode = uv_blade_to_pnode(mmr_blade);
181 uv_write_global_mmr64(mmr_pnode, mmr_offset, mmr_value);
182
183 if (cfg->move_in_progress)
184 send_cleanup_vector(cfg);
185
186 return irq;
187}
188
189/*
190 * Disable the specified MMR located on the specified blade so that MSIs are
191 * longer allowed to be sent.
192 */
193static void arch_disable_uv_irq(int mmr_pnode, unsigned long mmr_offset)
194{
195 unsigned long mmr_value;
196 struct uv_IO_APIC_route_entry *entry;
197
198 BUILD_BUG_ON(sizeof(struct uv_IO_APIC_route_entry) !=
199 sizeof(unsigned long));
200
201 mmr_value = 0;
202 entry = (struct uv_IO_APIC_route_entry *)&mmr_value;
203 entry->mask = 1;
204
205 uv_write_global_mmr64(mmr_pnode, mmr_offset, mmr_value);
206}
207
208static int uv_set_irq_affinity(unsigned int irq, const struct cpumask *mask)
209{
210 struct irq_desc *desc = irq_to_desc(irq);
211 struct irq_cfg *cfg = desc->chip_data;
212 unsigned int dest;
213 unsigned long mmr_value;
214 struct uv_IO_APIC_route_entry *entry;
215 unsigned long mmr_offset;
216 unsigned mmr_pnode;
217
218 dest = set_desc_affinity(desc, mask);
219 if (dest == BAD_APICID)
220 return -1;
221
222 mmr_value = 0;
223 entry = (struct uv_IO_APIC_route_entry *)&mmr_value;
224
225 entry->vector = cfg->vector;
226 entry->delivery_mode = apic->irq_delivery_mode;
227 entry->dest_mode = apic->irq_dest_mode;
228 entry->polarity = 0;
229 entry->trigger = 0;
230 entry->mask = 0;
231 entry->dest = dest;
232
233 /* Get previously stored MMR and pnode of hub sourcing interrupts */
234 if (uv_irq_2_mmr_info(irq, &mmr_offset, &mmr_pnode))
235 return -1;
236
237 uv_write_global_mmr64(mmr_pnode, mmr_offset, mmr_value);
238
239 if (cfg->move_in_progress)
240 send_cleanup_vector(cfg);
241
242 return 0;
243}
244
245/*
45 * Set up a mapping of an available irq and vector, and enable the specified 246 * Set up a mapping of an available irq and vector, and enable the specified
46 * MMR that defines the MSI that is to be sent to the specified CPU when an 247 * MMR that defines the MSI that is to be sent to the specified CPU when an
47 * interrupt is raised. 248 * interrupt is raised.
48 */ 249 */
49int uv_setup_irq(char *irq_name, int cpu, int mmr_blade, 250int uv_setup_irq(char *irq_name, int cpu, int mmr_blade,
50 unsigned long mmr_offset) 251 unsigned long mmr_offset, int restrict)
51{ 252{
52 int irq; 253 int irq, ret;
53 int ret; 254
255 irq = create_irq_nr(NR_IRQS_LEGACY, uv_blade_to_memory_nid(mmr_blade));
54 256
55 irq = create_irq();
56 if (irq <= 0) 257 if (irq <= 0)
57 return -EBUSY; 258 return -EBUSY;
58 259
59 ret = arch_enable_uv_irq(irq_name, irq, cpu, mmr_blade, mmr_offset); 260 ret = arch_enable_uv_irq(irq_name, irq, cpu, mmr_blade, mmr_offset,
60 if (ret != irq) 261 restrict);
262 if (ret == irq)
263 uv_set_irq_2_mmr_info(irq, mmr_offset, mmr_blade);
264 else
61 destroy_irq(irq); 265 destroy_irq(irq);
62 266
63 return ret; 267 return ret;
@@ -71,9 +275,28 @@ EXPORT_SYMBOL_GPL(uv_setup_irq);
71 * 275 *
72 * Set mmr_blade and mmr_offset to what was passed in on uv_setup_irq(). 276 * Set mmr_blade and mmr_offset to what was passed in on uv_setup_irq().
73 */ 277 */
74void uv_teardown_irq(unsigned int irq, int mmr_blade, unsigned long mmr_offset) 278void uv_teardown_irq(unsigned int irq)
75{ 279{
76 arch_disable_uv_irq(mmr_blade, mmr_offset); 280 struct uv_irq_2_mmr_pnode *e;
281 struct rb_node *n;
282 unsigned long irqflags;
283
284 spin_lock_irqsave(&uv_irq_lock, irqflags);
285 n = uv_irq_root.rb_node;
286 while (n) {
287 e = rb_entry(n, struct uv_irq_2_mmr_pnode, list);
288 if (e->irq == irq) {
289 arch_disable_uv_irq(e->pnode, e->offset);
290 rb_erase(n, &uv_irq_root);
291 kfree(e);
292 break;
293 }
294 if (irq < e->irq)
295 n = n->rb_left;
296 else
297 n = n->rb_right;
298 }
299 spin_unlock_irqrestore(&uv_irq_lock, irqflags);
77 destroy_irq(irq); 300 destroy_irq(irq);
78} 301}
79EXPORT_SYMBOL_GPL(uv_teardown_irq); 302EXPORT_SYMBOL_GPL(uv_teardown_irq);
diff --git a/arch/x86/kernel/visws_quirks.c b/arch/x86/kernel/visws_quirks.c
index f068553a1b17..abda6f53e71e 100644
--- a/arch/x86/kernel/visws_quirks.c
+++ b/arch/x86/kernel/visws_quirks.c
@@ -183,7 +183,7 @@ static void __init MP_processor_info(struct mpc_cpu *m)
183 return; 183 return;
184 } 184 }
185 185
186 apic_cpus = apic->apicid_to_cpu_present(m->apicid); 186 apic->apicid_to_cpu_present(m->apicid, &apic_cpus);
187 physids_or(phys_cpu_present_map, phys_cpu_present_map, apic_cpus); 187 physids_or(phys_cpu_present_map, phys_cpu_present_map, apic_cpus);
188 /* 188 /*
189 * Validate version 189 * Validate version
@@ -486,7 +486,7 @@ static void end_cobalt_irq(unsigned int irq)
486} 486}
487 487
488static struct irq_chip cobalt_irq_type = { 488static struct irq_chip cobalt_irq_type = {
489 .typename = "Cobalt-APIC", 489 .name = "Cobalt-APIC",
490 .startup = startup_cobalt_irq, 490 .startup = startup_cobalt_irq,
491 .shutdown = disable_cobalt_irq, 491 .shutdown = disable_cobalt_irq,
492 .enable = enable_cobalt_irq, 492 .enable = enable_cobalt_irq,
@@ -523,7 +523,7 @@ static void end_piix4_master_irq(unsigned int irq)
523} 523}
524 524
525static struct irq_chip piix4_master_irq_type = { 525static struct irq_chip piix4_master_irq_type = {
526 .typename = "PIIX4-master", 526 .name = "PIIX4-master",
527 .startup = startup_piix4_master_irq, 527 .startup = startup_piix4_master_irq,
528 .ack = ack_cobalt_irq, 528 .ack = ack_cobalt_irq,
529 .end = end_piix4_master_irq, 529 .end = end_piix4_master_irq,
@@ -531,7 +531,7 @@ static struct irq_chip piix4_master_irq_type = {
531 531
532 532
533static struct irq_chip piix4_virtual_irq_type = { 533static struct irq_chip piix4_virtual_irq_type = {
534 .typename = "PIIX4-virtual", 534 .name = "PIIX4-virtual",
535 .shutdown = disable_8259A_irq, 535 .shutdown = disable_8259A_irq,
536 .enable = enable_8259A_irq, 536 .enable = enable_8259A_irq,
537 .disable = disable_8259A_irq, 537 .disable = disable_8259A_irq,
diff --git a/arch/x86/kernel/x8664_ksyms_64.c b/arch/x86/kernel/x8664_ksyms_64.c
index 3909e3ba5ce3..a1029769b6f2 100644
--- a/arch/x86/kernel/x8664_ksyms_64.c
+++ b/arch/x86/kernel/x8664_ksyms_64.c
@@ -30,9 +30,8 @@ EXPORT_SYMBOL(__put_user_8);
30 30
31EXPORT_SYMBOL(copy_user_generic); 31EXPORT_SYMBOL(copy_user_generic);
32EXPORT_SYMBOL(__copy_user_nocache); 32EXPORT_SYMBOL(__copy_user_nocache);
33EXPORT_SYMBOL(copy_from_user); 33EXPORT_SYMBOL(_copy_from_user);
34EXPORT_SYMBOL(copy_to_user); 34EXPORT_SYMBOL(_copy_to_user);
35EXPORT_SYMBOL(__copy_from_user_inatomic);
36 35
37EXPORT_SYMBOL(copy_page); 36EXPORT_SYMBOL(copy_page);
38EXPORT_SYMBOL(clear_page); 37EXPORT_SYMBOL(clear_page);
diff --git a/arch/x86/kernel/x86_init.c b/arch/x86/kernel/x86_init.c
index 4449a4a2c2ed..d11c5ff7c65e 100644
--- a/arch/x86/kernel/x86_init.c
+++ b/arch/x86/kernel/x86_init.c
@@ -14,10 +14,13 @@
14#include <asm/time.h> 14#include <asm/time.h>
15#include <asm/irq.h> 15#include <asm/irq.h>
16#include <asm/tsc.h> 16#include <asm/tsc.h>
17#include <asm/iommu.h>
17 18
18void __cpuinit x86_init_noop(void) { } 19void __cpuinit x86_init_noop(void) { }
19void __init x86_init_uint_noop(unsigned int unused) { } 20void __init x86_init_uint_noop(unsigned int unused) { }
20void __init x86_init_pgd_noop(pgd_t *unused) { } 21void __init x86_init_pgd_noop(pgd_t *unused) { }
22int __init iommu_init_noop(void) { return 0; }
23void iommu_shutdown_noop(void) { }
21 24
22/* 25/*
23 * The platform setup functions are preset with the default functions 26 * The platform setup functions are preset with the default functions
@@ -62,6 +65,10 @@ struct x86_init_ops x86_init __initdata = {
62 .tsc_pre_init = x86_init_noop, 65 .tsc_pre_init = x86_init_noop,
63 .timer_init = hpet_time_init, 66 .timer_init = hpet_time_init,
64 }, 67 },
68
69 .iommu = {
70 .iommu_init = iommu_init_noop,
71 },
65}; 72};
66 73
67struct x86_cpuinit_ops x86_cpuinit __cpuinitdata = { 74struct x86_cpuinit_ops x86_cpuinit __cpuinitdata = {
@@ -72,4 +79,5 @@ struct x86_platform_ops x86_platform = {
72 .calibrate_tsc = native_calibrate_tsc, 79 .calibrate_tsc = native_calibrate_tsc,
73 .get_wallclock = mach_get_cmos_time, 80 .get_wallclock = mach_get_cmos_time,
74 .set_wallclock = mach_set_rtc_mmss, 81 .set_wallclock = mach_set_rtc_mmss,
82 .iommu_shutdown = iommu_shutdown_noop,
75}; 83};
diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
index 9b9695322f56..4fc80174191c 100644
--- a/arch/x86/kvm/x86.c
+++ b/arch/x86/kvm/x86.c
@@ -42,6 +42,7 @@
42#define CREATE_TRACE_POINTS 42#define CREATE_TRACE_POINTS
43#include "trace.h" 43#include "trace.h"
44 44
45#include <asm/debugreg.h>
45#include <asm/uaccess.h> 46#include <asm/uaccess.h>
46#include <asm/msr.h> 47#include <asm/msr.h>
47#include <asm/desc.h> 48#include <asm/desc.h>
@@ -1692,7 +1693,7 @@ static int kvm_vcpu_ioctl_x86_setup_mce(struct kvm_vcpu *vcpu,
1692 unsigned bank_num = mcg_cap & 0xff, bank; 1693 unsigned bank_num = mcg_cap & 0xff, bank;
1693 1694
1694 r = -EINVAL; 1695 r = -EINVAL;
1695 if (!bank_num) 1696 if (!bank_num || bank_num >= KVM_MAX_MCE_BANKS)
1696 goto out; 1697 goto out;
1697 if (mcg_cap & ~(KVM_MCE_CAP_SUPPORTED | 0xff | 0xff0000)) 1698 if (mcg_cap & ~(KVM_MCE_CAP_SUPPORTED | 0xff | 0xff0000))
1698 goto out; 1699 goto out;
@@ -3643,14 +3644,15 @@ static int vcpu_enter_guest(struct kvm_vcpu *vcpu, struct kvm_run *kvm_run)
3643 trace_kvm_entry(vcpu->vcpu_id); 3644 trace_kvm_entry(vcpu->vcpu_id);
3644 kvm_x86_ops->run(vcpu, kvm_run); 3645 kvm_x86_ops->run(vcpu, kvm_run);
3645 3646
3646 if (unlikely(vcpu->arch.switch_db_regs || test_thread_flag(TIF_DEBUG))) { 3647 /*
3647 set_debugreg(current->thread.debugreg0, 0); 3648 * If the guest has used debug registers, at least dr7
3648 set_debugreg(current->thread.debugreg1, 1); 3649 * will be disabled while returning to the host.
3649 set_debugreg(current->thread.debugreg2, 2); 3650 * If we don't have active breakpoints in the host, we don't
3650 set_debugreg(current->thread.debugreg3, 3); 3651 * care about the messed up debug address registers. But if
3651 set_debugreg(current->thread.debugreg6, 6); 3652 * we have some of them active, restore the old state.
3652 set_debugreg(current->thread.debugreg7, 7); 3653 */
3653 } 3654 if (hw_breakpoint_active())
3655 hw_breakpoint_restore();
3654 3656
3655 set_bit(KVM_REQ_KICK, &vcpu->requests); 3657 set_bit(KVM_REQ_KICK, &vcpu->requests);
3656 local_irq_enable(); 3658 local_irq_enable();
@@ -4051,7 +4053,7 @@ static int save_guest_segment_descriptor(struct kvm_vcpu *vcpu, u16 selector,
4051 return kvm_write_guest_virt(dtable.base + index*8, seg_desc, sizeof(*seg_desc), vcpu); 4053 return kvm_write_guest_virt(dtable.base + index*8, seg_desc, sizeof(*seg_desc), vcpu);
4052} 4054}
4053 4055
4054static u32 get_tss_base_addr(struct kvm_vcpu *vcpu, 4056static gpa_t get_tss_base_addr(struct kvm_vcpu *vcpu,
4055 struct desc_struct *seg_desc) 4057 struct desc_struct *seg_desc)
4056{ 4058{
4057 u32 base_addr = get_desc_base(seg_desc); 4059 u32 base_addr = get_desc_base(seg_desc);
diff --git a/arch/x86/lib/.gitignore b/arch/x86/lib/.gitignore
new file mode 100644
index 000000000000..8df89f0a3fe6
--- /dev/null
+++ b/arch/x86/lib/.gitignore
@@ -0,0 +1 @@
inat-tables.c
diff --git a/arch/x86/lib/Makefile b/arch/x86/lib/Makefile
index 85f5db95c60f..a2d6472895fb 100644
--- a/arch/x86/lib/Makefile
+++ b/arch/x86/lib/Makefile
@@ -2,12 +2,25 @@
2# Makefile for x86 specific library files. 2# Makefile for x86 specific library files.
3# 3#
4 4
5inat_tables_script = $(srctree)/arch/x86/tools/gen-insn-attr-x86.awk
6inat_tables_maps = $(srctree)/arch/x86/lib/x86-opcode-map.txt
7quiet_cmd_inat_tables = GEN $@
8 cmd_inat_tables = $(AWK) -f $(inat_tables_script) $(inat_tables_maps) > $@
9
10$(obj)/inat-tables.c: $(inat_tables_script) $(inat_tables_maps)
11 $(call cmd,inat_tables)
12
13$(obj)/inat.o: $(obj)/inat-tables.c
14
15clean-files := inat-tables.c
16
5obj-$(CONFIG_SMP) := msr.o 17obj-$(CONFIG_SMP) := msr.o
6 18
7lib-y := delay.o 19lib-y := delay.o
8lib-y += thunk_$(BITS).o 20lib-y += thunk_$(BITS).o
9lib-y += usercopy_$(BITS).o getuser.o putuser.o 21lib-y += usercopy_$(BITS).o getuser.o putuser.o
10lib-y += memcpy_$(BITS).o 22lib-y += memcpy_$(BITS).o
23lib-y += insn.o inat.o
11 24
12obj-y += msr-reg.o msr-reg-export.o 25obj-y += msr-reg.o msr-reg-export.o
13 26
diff --git a/arch/x86/lib/copy_user_64.S b/arch/x86/lib/copy_user_64.S
index 6ba0f7bb85ea..cf889d4e076a 100644
--- a/arch/x86/lib/copy_user_64.S
+++ b/arch/x86/lib/copy_user_64.S
@@ -65,7 +65,7 @@
65 .endm 65 .endm
66 66
67/* Standard copy_to_user with segment limit checking */ 67/* Standard copy_to_user with segment limit checking */
68ENTRY(copy_to_user) 68ENTRY(_copy_to_user)
69 CFI_STARTPROC 69 CFI_STARTPROC
70 GET_THREAD_INFO(%rax) 70 GET_THREAD_INFO(%rax)
71 movq %rdi,%rcx 71 movq %rdi,%rcx
@@ -75,10 +75,10 @@ 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) 78ENDPROC(_copy_to_user)
79 79
80/* Standard copy_from_user with segment limit checking */ 80/* Standard copy_from_user with segment limit checking */
81ENTRY(copy_from_user) 81ENTRY(_copy_from_user)
82 CFI_STARTPROC 82 CFI_STARTPROC
83 GET_THREAD_INFO(%rax) 83 GET_THREAD_INFO(%rax)
84 movq %rsi,%rcx 84 movq %rsi,%rcx
@@ -88,7 +88,7 @@ ENTRY(copy_from_user)
88 jae bad_from_user 88 jae bad_from_user
89 ALTERNATIVE_JUMP X86_FEATURE_REP_GOOD,copy_user_generic_unrolled,copy_user_generic_string 89 ALTERNATIVE_JUMP X86_FEATURE_REP_GOOD,copy_user_generic_unrolled,copy_user_generic_string
90 CFI_ENDPROC 90 CFI_ENDPROC
91ENDPROC(copy_from_user) 91ENDPROC(_copy_from_user)
92 92
93ENTRY(copy_user_generic) 93ENTRY(copy_user_generic)
94 CFI_STARTPROC 94 CFI_STARTPROC
@@ -96,12 +96,6 @@ ENTRY(copy_user_generic)
96 CFI_ENDPROC 96 CFI_ENDPROC
97ENDPROC(copy_user_generic) 97ENDPROC(copy_user_generic)
98 98
99ENTRY(__copy_from_user_inatomic)
100 CFI_STARTPROC
101 ALTERNATIVE_JUMP X86_FEATURE_REP_GOOD,copy_user_generic_unrolled,copy_user_generic_string
102 CFI_ENDPROC
103ENDPROC(__copy_from_user_inatomic)
104
105 .section .fixup,"ax" 99 .section .fixup,"ax"
106 /* must zero dest */ 100 /* must zero dest */
107ENTRY(bad_from_user) 101ENTRY(bad_from_user)
diff --git a/arch/x86/lib/inat.c b/arch/x86/lib/inat.c
new file mode 100644
index 000000000000..46fc4ee09fc4
--- /dev/null
+++ b/arch/x86/lib/inat.c
@@ -0,0 +1,90 @@
1/*
2 * x86 instruction attribute tables
3 *
4 * Written by Masami Hiramatsu <mhiramat@redhat.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 * (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 */
21#include <asm/insn.h>
22
23/* Attribute tables are generated from opcode map */
24#include "inat-tables.c"
25
26/* Attribute search APIs */
27insn_attr_t inat_get_opcode_attribute(insn_byte_t opcode)
28{
29 return inat_primary_table[opcode];
30}
31
32insn_attr_t inat_get_escape_attribute(insn_byte_t opcode, insn_byte_t last_pfx,
33 insn_attr_t esc_attr)
34{
35 const insn_attr_t *table;
36 insn_attr_t lpfx_attr;
37 int n, m = 0;
38
39 n = inat_escape_id(esc_attr);
40 if (last_pfx) {
41 lpfx_attr = inat_get_opcode_attribute(last_pfx);
42 m = inat_last_prefix_id(lpfx_attr);
43 }
44 table = inat_escape_tables[n][0];
45 if (!table)
46 return 0;
47 if (inat_has_variant(table[opcode]) && m) {
48 table = inat_escape_tables[n][m];
49 if (!table)
50 return 0;
51 }
52 return table[opcode];
53}
54
55insn_attr_t inat_get_group_attribute(insn_byte_t modrm, insn_byte_t last_pfx,
56 insn_attr_t grp_attr)
57{
58 const insn_attr_t *table;
59 insn_attr_t lpfx_attr;
60 int n, m = 0;
61
62 n = inat_group_id(grp_attr);
63 if (last_pfx) {
64 lpfx_attr = inat_get_opcode_attribute(last_pfx);
65 m = inat_last_prefix_id(lpfx_attr);
66 }
67 table = inat_group_tables[n][0];
68 if (!table)
69 return inat_group_common_attribute(grp_attr);
70 if (inat_has_variant(table[X86_MODRM_REG(modrm)]) && m) {
71 table = inat_group_tables[n][m];
72 if (!table)
73 return inat_group_common_attribute(grp_attr);
74 }
75 return table[X86_MODRM_REG(modrm)] |
76 inat_group_common_attribute(grp_attr);
77}
78
79insn_attr_t inat_get_avx_attribute(insn_byte_t opcode, insn_byte_t vex_m,
80 insn_byte_t vex_p)
81{
82 const insn_attr_t *table;
83 if (vex_m > X86_VEX_M_MAX || vex_p > INAT_LSTPFX_MAX)
84 return 0;
85 table = inat_avx_tables[vex_m][vex_p];
86 if (!table)
87 return 0;
88 return table[opcode];
89}
90
diff --git a/arch/x86/lib/insn.c b/arch/x86/lib/insn.c
new file mode 100644
index 000000000000..9f33b984d0ef
--- /dev/null
+++ b/arch/x86/lib/insn.c
@@ -0,0 +1,516 @@
1/*
2 * x86 instruction analysis
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 (C) IBM Corporation, 2002, 2004, 2009
19 */
20
21#include <linux/string.h>
22#include <asm/inat.h>
23#include <asm/insn.h>
24
25#define get_next(t, insn) \
26 ({t r; r = *(t*)insn->next_byte; insn->next_byte += sizeof(t); r; })
27
28#define peek_next(t, insn) \
29 ({t r; r = *(t*)insn->next_byte; r; })
30
31#define peek_nbyte_next(t, insn, n) \
32 ({t r; r = *(t*)((insn)->next_byte + n); r; })
33
34/**
35 * insn_init() - initialize struct insn
36 * @insn: &struct insn to be initialized
37 * @kaddr: address (in kernel memory) of instruction (or copy thereof)
38 * @x86_64: !0 for 64-bit kernel or 64-bit app
39 */
40void insn_init(struct insn *insn, const void *kaddr, int x86_64)
41{
42 memset(insn, 0, sizeof(*insn));
43 insn->kaddr = kaddr;
44 insn->next_byte = kaddr;
45 insn->x86_64 = x86_64 ? 1 : 0;
46 insn->opnd_bytes = 4;
47 if (x86_64)
48 insn->addr_bytes = 8;
49 else
50 insn->addr_bytes = 4;
51}
52
53/**
54 * insn_get_prefixes - scan x86 instruction prefix bytes
55 * @insn: &struct insn containing instruction
56 *
57 * Populates the @insn->prefixes bitmap, and updates @insn->next_byte
58 * to point to the (first) opcode. No effect if @insn->prefixes.got
59 * is already set.
60 */
61void insn_get_prefixes(struct insn *insn)
62{
63 struct insn_field *prefixes = &insn->prefixes;
64 insn_attr_t attr;
65 insn_byte_t b, lb;
66 int i, nb;
67
68 if (prefixes->got)
69 return;
70
71 nb = 0;
72 lb = 0;
73 b = peek_next(insn_byte_t, insn);
74 attr = inat_get_opcode_attribute(b);
75 while (inat_is_legacy_prefix(attr)) {
76 /* Skip if same prefix */
77 for (i = 0; i < nb; i++)
78 if (prefixes->bytes[i] == b)
79 goto found;
80 if (nb == 4)
81 /* Invalid instruction */
82 break;
83 prefixes->bytes[nb++] = b;
84 if (inat_is_address_size_prefix(attr)) {
85 /* address size switches 2/4 or 4/8 */
86 if (insn->x86_64)
87 insn->addr_bytes ^= 12;
88 else
89 insn->addr_bytes ^= 6;
90 } else if (inat_is_operand_size_prefix(attr)) {
91 /* oprand size switches 2/4 */
92 insn->opnd_bytes ^= 6;
93 }
94found:
95 prefixes->nbytes++;
96 insn->next_byte++;
97 lb = b;
98 b = peek_next(insn_byte_t, insn);
99 attr = inat_get_opcode_attribute(b);
100 }
101 /* Set the last prefix */
102 if (lb && lb != insn->prefixes.bytes[3]) {
103 if (unlikely(insn->prefixes.bytes[3])) {
104 /* Swap the last prefix */
105 b = insn->prefixes.bytes[3];
106 for (i = 0; i < nb; i++)
107 if (prefixes->bytes[i] == lb)
108 prefixes->bytes[i] = b;
109 }
110 insn->prefixes.bytes[3] = lb;
111 }
112
113 /* Decode REX prefix */
114 if (insn->x86_64) {
115 b = peek_next(insn_byte_t, insn);
116 attr = inat_get_opcode_attribute(b);
117 if (inat_is_rex_prefix(attr)) {
118 insn->rex_prefix.value = b;
119 insn->rex_prefix.nbytes = 1;
120 insn->next_byte++;
121 if (X86_REX_W(b))
122 /* REX.W overrides opnd_size */
123 insn->opnd_bytes = 8;
124 }
125 }
126 insn->rex_prefix.got = 1;
127
128 /* Decode VEX prefix */
129 b = peek_next(insn_byte_t, insn);
130 attr = inat_get_opcode_attribute(b);
131 if (inat_is_vex_prefix(attr)) {
132 insn_byte_t b2 = peek_nbyte_next(insn_byte_t, insn, 1);
133 if (!insn->x86_64) {
134 /*
135 * In 32-bits mode, if the [7:6] bits (mod bits of
136 * ModRM) on the second byte are not 11b, it is
137 * LDS or LES.
138 */
139 if (X86_MODRM_MOD(b2) != 3)
140 goto vex_end;
141 }
142 insn->vex_prefix.bytes[0] = b;
143 insn->vex_prefix.bytes[1] = b2;
144 if (inat_is_vex3_prefix(attr)) {
145 b2 = peek_nbyte_next(insn_byte_t, insn, 2);
146 insn->vex_prefix.bytes[2] = b2;
147 insn->vex_prefix.nbytes = 3;
148 insn->next_byte += 3;
149 if (insn->x86_64 && X86_VEX_W(b2))
150 /* VEX.W overrides opnd_size */
151 insn->opnd_bytes = 8;
152 } else {
153 insn->vex_prefix.nbytes = 2;
154 insn->next_byte += 2;
155 }
156 }
157vex_end:
158 insn->vex_prefix.got = 1;
159
160 prefixes->got = 1;
161 return;
162}
163
164/**
165 * insn_get_opcode - collect opcode(s)
166 * @insn: &struct insn containing instruction
167 *
168 * Populates @insn->opcode, updates @insn->next_byte to point past the
169 * opcode byte(s), and set @insn->attr (except for groups).
170 * If necessary, first collects any preceding (prefix) bytes.
171 * Sets @insn->opcode.value = opcode1. No effect if @insn->opcode.got
172 * is already 1.
173 */
174void insn_get_opcode(struct insn *insn)
175{
176 struct insn_field *opcode = &insn->opcode;
177 insn_byte_t op, pfx;
178 if (opcode->got)
179 return;
180 if (!insn->prefixes.got)
181 insn_get_prefixes(insn);
182
183 /* Get first opcode */
184 op = get_next(insn_byte_t, insn);
185 opcode->bytes[0] = op;
186 opcode->nbytes = 1;
187
188 /* Check if there is VEX prefix or not */
189 if (insn_is_avx(insn)) {
190 insn_byte_t m, p;
191 m = insn_vex_m_bits(insn);
192 p = insn_vex_p_bits(insn);
193 insn->attr = inat_get_avx_attribute(op, m, p);
194 if (!inat_accept_vex(insn->attr))
195 insn->attr = 0; /* This instruction is bad */
196 goto end; /* VEX has only 1 byte for opcode */
197 }
198
199 insn->attr = inat_get_opcode_attribute(op);
200 while (inat_is_escape(insn->attr)) {
201 /* Get escaped opcode */
202 op = get_next(insn_byte_t, insn);
203 opcode->bytes[opcode->nbytes++] = op;
204 pfx = insn_last_prefix(insn);
205 insn->attr = inat_get_escape_attribute(op, pfx, insn->attr);
206 }
207 if (inat_must_vex(insn->attr))
208 insn->attr = 0; /* This instruction is bad */
209end:
210 opcode->got = 1;
211}
212
213/**
214 * insn_get_modrm - collect ModRM byte, if any
215 * @insn: &struct insn containing instruction
216 *
217 * Populates @insn->modrm and updates @insn->next_byte to point past the
218 * ModRM byte, if any. If necessary, first collects the preceding bytes
219 * (prefixes and opcode(s)). No effect if @insn->modrm.got is already 1.
220 */
221void insn_get_modrm(struct insn *insn)
222{
223 struct insn_field *modrm = &insn->modrm;
224 insn_byte_t pfx, mod;
225 if (modrm->got)
226 return;
227 if (!insn->opcode.got)
228 insn_get_opcode(insn);
229
230 if (inat_has_modrm(insn->attr)) {
231 mod = get_next(insn_byte_t, insn);
232 modrm->value = mod;
233 modrm->nbytes = 1;
234 if (inat_is_group(insn->attr)) {
235 pfx = insn_last_prefix(insn);
236 insn->attr = inat_get_group_attribute(mod, pfx,
237 insn->attr);
238 }
239 }
240
241 if (insn->x86_64 && inat_is_force64(insn->attr))
242 insn->opnd_bytes = 8;
243 modrm->got = 1;
244}
245
246
247/**
248 * insn_rip_relative() - Does instruction use RIP-relative addressing mode?
249 * @insn: &struct insn containing instruction
250 *
251 * If necessary, first collects the instruction up to and including the
252 * ModRM byte. No effect if @insn->x86_64 is 0.
253 */
254int insn_rip_relative(struct insn *insn)
255{
256 struct insn_field *modrm = &insn->modrm;
257
258 if (!insn->x86_64)
259 return 0;
260 if (!modrm->got)
261 insn_get_modrm(insn);
262 /*
263 * For rip-relative instructions, the mod field (top 2 bits)
264 * is zero and the r/m field (bottom 3 bits) is 0x5.
265 */
266 return (modrm->nbytes && (modrm->value & 0xc7) == 0x5);
267}
268
269/**
270 * insn_get_sib() - Get the SIB byte of instruction
271 * @insn: &struct insn containing instruction
272 *
273 * If necessary, first collects the instruction up to and including the
274 * ModRM byte.
275 */
276void insn_get_sib(struct insn *insn)
277{
278 insn_byte_t modrm;
279
280 if (insn->sib.got)
281 return;
282 if (!insn->modrm.got)
283 insn_get_modrm(insn);
284 if (insn->modrm.nbytes) {
285 modrm = (insn_byte_t)insn->modrm.value;
286 if (insn->addr_bytes != 2 &&
287 X86_MODRM_MOD(modrm) != 3 && X86_MODRM_RM(modrm) == 4) {
288 insn->sib.value = get_next(insn_byte_t, insn);
289 insn->sib.nbytes = 1;
290 }
291 }
292 insn->sib.got = 1;
293}
294
295
296/**
297 * insn_get_displacement() - Get the displacement of instruction
298 * @insn: &struct insn containing instruction
299 *
300 * If necessary, first collects the instruction up to and including the
301 * SIB byte.
302 * Displacement value is sign-expanded.
303 */
304void insn_get_displacement(struct insn *insn)
305{
306 insn_byte_t mod, rm, base;
307
308 if (insn->displacement.got)
309 return;
310 if (!insn->sib.got)
311 insn_get_sib(insn);
312 if (insn->modrm.nbytes) {
313 /*
314 * Interpreting the modrm byte:
315 * mod = 00 - no displacement fields (exceptions below)
316 * mod = 01 - 1-byte displacement field
317 * mod = 10 - displacement field is 4 bytes, or 2 bytes if
318 * address size = 2 (0x67 prefix in 32-bit mode)
319 * mod = 11 - no memory operand
320 *
321 * If address size = 2...
322 * mod = 00, r/m = 110 - displacement field is 2 bytes
323 *
324 * If address size != 2...
325 * mod != 11, r/m = 100 - SIB byte exists
326 * mod = 00, SIB base = 101 - displacement field is 4 bytes
327 * mod = 00, r/m = 101 - rip-relative addressing, displacement
328 * field is 4 bytes
329 */
330 mod = X86_MODRM_MOD(insn->modrm.value);
331 rm = X86_MODRM_RM(insn->modrm.value);
332 base = X86_SIB_BASE(insn->sib.value);
333 if (mod == 3)
334 goto out;
335 if (mod == 1) {
336 insn->displacement.value = get_next(char, insn);
337 insn->displacement.nbytes = 1;
338 } else if (insn->addr_bytes == 2) {
339 if ((mod == 0 && rm == 6) || mod == 2) {
340 insn->displacement.value =
341 get_next(short, insn);
342 insn->displacement.nbytes = 2;
343 }
344 } else {
345 if ((mod == 0 && rm == 5) || mod == 2 ||
346 (mod == 0 && base == 5)) {
347 insn->displacement.value = get_next(int, insn);
348 insn->displacement.nbytes = 4;
349 }
350 }
351 }
352out:
353 insn->displacement.got = 1;
354}
355
356/* Decode moffset16/32/64 */
357static void __get_moffset(struct insn *insn)
358{
359 switch (insn->addr_bytes) {
360 case 2:
361 insn->moffset1.value = get_next(short, insn);
362 insn->moffset1.nbytes = 2;
363 break;
364 case 4:
365 insn->moffset1.value = get_next(int, insn);
366 insn->moffset1.nbytes = 4;
367 break;
368 case 8:
369 insn->moffset1.value = get_next(int, insn);
370 insn->moffset1.nbytes = 4;
371 insn->moffset2.value = get_next(int, insn);
372 insn->moffset2.nbytes = 4;
373 break;
374 }
375 insn->moffset1.got = insn->moffset2.got = 1;
376}
377
378/* Decode imm v32(Iz) */
379static void __get_immv32(struct insn *insn)
380{
381 switch (insn->opnd_bytes) {
382 case 2:
383 insn->immediate.value = get_next(short, insn);
384 insn->immediate.nbytes = 2;
385 break;
386 case 4:
387 case 8:
388 insn->immediate.value = get_next(int, insn);
389 insn->immediate.nbytes = 4;
390 break;
391 }
392}
393
394/* Decode imm v64(Iv/Ov) */
395static void __get_immv(struct insn *insn)
396{
397 switch (insn->opnd_bytes) {
398 case 2:
399 insn->immediate1.value = get_next(short, insn);
400 insn->immediate1.nbytes = 2;
401 break;
402 case 4:
403 insn->immediate1.value = get_next(int, insn);
404 insn->immediate1.nbytes = 4;
405 break;
406 case 8:
407 insn->immediate1.value = get_next(int, insn);
408 insn->immediate1.nbytes = 4;
409 insn->immediate2.value = get_next(int, insn);
410 insn->immediate2.nbytes = 4;
411 break;
412 }
413 insn->immediate1.got = insn->immediate2.got = 1;
414}
415
416/* Decode ptr16:16/32(Ap) */
417static void __get_immptr(struct insn *insn)
418{
419 switch (insn->opnd_bytes) {
420 case 2:
421 insn->immediate1.value = get_next(short, insn);
422 insn->immediate1.nbytes = 2;
423 break;
424 case 4:
425 insn->immediate1.value = get_next(int, insn);
426 insn->immediate1.nbytes = 4;
427 break;
428 case 8:
429 /* ptr16:64 is not exist (no segment) */
430 return;
431 }
432 insn->immediate2.value = get_next(unsigned short, insn);
433 insn->immediate2.nbytes = 2;
434 insn->immediate1.got = insn->immediate2.got = 1;
435}
436
437/**
438 * insn_get_immediate() - Get the immediates of instruction
439 * @insn: &struct insn containing instruction
440 *
441 * If necessary, first collects the instruction up to and including the
442 * displacement bytes.
443 * Basically, most of immediates are sign-expanded. Unsigned-value can be
444 * get by bit masking with ((1 << (nbytes * 8)) - 1)
445 */
446void insn_get_immediate(struct insn *insn)
447{
448 if (insn->immediate.got)
449 return;
450 if (!insn->displacement.got)
451 insn_get_displacement(insn);
452
453 if (inat_has_moffset(insn->attr)) {
454 __get_moffset(insn);
455 goto done;
456 }
457
458 if (!inat_has_immediate(insn->attr))
459 /* no immediates */
460 goto done;
461
462 switch (inat_immediate_size(insn->attr)) {
463 case INAT_IMM_BYTE:
464 insn->immediate.value = get_next(char, insn);
465 insn->immediate.nbytes = 1;
466 break;
467 case INAT_IMM_WORD:
468 insn->immediate.value = get_next(short, insn);
469 insn->immediate.nbytes = 2;
470 break;
471 case INAT_IMM_DWORD:
472 insn->immediate.value = get_next(int, insn);
473 insn->immediate.nbytes = 4;
474 break;
475 case INAT_IMM_QWORD:
476 insn->immediate1.value = get_next(int, insn);
477 insn->immediate1.nbytes = 4;
478 insn->immediate2.value = get_next(int, insn);
479 insn->immediate2.nbytes = 4;
480 break;
481 case INAT_IMM_PTR:
482 __get_immptr(insn);
483 break;
484 case INAT_IMM_VWORD32:
485 __get_immv32(insn);
486 break;
487 case INAT_IMM_VWORD:
488 __get_immv(insn);
489 break;
490 default:
491 break;
492 }
493 if (inat_has_second_immediate(insn->attr)) {
494 insn->immediate2.value = get_next(char, insn);
495 insn->immediate2.nbytes = 1;
496 }
497done:
498 insn->immediate.got = 1;
499}
500
501/**
502 * insn_get_length() - Get the length of instruction
503 * @insn: &struct insn containing instruction
504 *
505 * If necessary, first collects the instruction up to and including the
506 * immediates bytes.
507 */
508void insn_get_length(struct insn *insn)
509{
510 if (insn->length)
511 return;
512 if (!insn->immediate.got)
513 insn_get_immediate(insn);
514 insn->length = (unsigned char)((unsigned long)insn->next_byte
515 - (unsigned long)insn->kaddr);
516}
diff --git a/arch/x86/lib/msr.c b/arch/x86/lib/msr.c
index 33a1e3ca22d8..41628b104b9e 100644
--- a/arch/x86/lib/msr.c
+++ b/arch/x86/lib/msr.c
@@ -71,14 +71,9 @@ int wrmsr_on_cpu(unsigned int cpu, u32 msr_no, u32 l, u32 h)
71} 71}
72EXPORT_SYMBOL(wrmsr_on_cpu); 72EXPORT_SYMBOL(wrmsr_on_cpu);
73 73
74/* rdmsr on a bunch of CPUs 74static void __rwmsr_on_cpus(const struct cpumask *mask, u32 msr_no,
75 * 75 struct msr *msrs,
76 * @mask: which CPUs 76 void (*msr_func) (void *info))
77 * @msr_no: which MSR
78 * @msrs: array of MSR values
79 *
80 */
81void rdmsr_on_cpus(const cpumask_t *mask, u32 msr_no, struct msr *msrs)
82{ 77{
83 struct msr_info rv; 78 struct msr_info rv;
84 int this_cpu; 79 int this_cpu;
@@ -92,11 +87,23 @@ void rdmsr_on_cpus(const cpumask_t *mask, u32 msr_no, struct msr *msrs)
92 this_cpu = get_cpu(); 87 this_cpu = get_cpu();
93 88
94 if (cpumask_test_cpu(this_cpu, mask)) 89 if (cpumask_test_cpu(this_cpu, mask))
95 __rdmsr_on_cpu(&rv); 90 msr_func(&rv);
96 91
97 smp_call_function_many(mask, __rdmsr_on_cpu, &rv, 1); 92 smp_call_function_many(mask, msr_func, &rv, 1);
98 put_cpu(); 93 put_cpu();
99} 94}
95
96/* rdmsr on a bunch of CPUs
97 *
98 * @mask: which CPUs
99 * @msr_no: which MSR
100 * @msrs: array of MSR values
101 *
102 */
103void rdmsr_on_cpus(const struct cpumask *mask, u32 msr_no, struct msr *msrs)
104{
105 __rwmsr_on_cpus(mask, msr_no, msrs, __rdmsr_on_cpu);
106}
100EXPORT_SYMBOL(rdmsr_on_cpus); 107EXPORT_SYMBOL(rdmsr_on_cpus);
101 108
102/* 109/*
@@ -107,24 +114,9 @@ EXPORT_SYMBOL(rdmsr_on_cpus);
107 * @msrs: array of MSR values 114 * @msrs: array of MSR values
108 * 115 *
109 */ 116 */
110void wrmsr_on_cpus(const cpumask_t *mask, u32 msr_no, struct msr *msrs) 117void wrmsr_on_cpus(const struct cpumask *mask, u32 msr_no, struct msr *msrs)
111{ 118{
112 struct msr_info rv; 119 __rwmsr_on_cpus(mask, msr_no, msrs, __wrmsr_on_cpu);
113 int this_cpu;
114
115 memset(&rv, 0, sizeof(rv));
116
117 rv.off = cpumask_first(mask);
118 rv.msrs = msrs;
119 rv.msr_no = msr_no;
120
121 this_cpu = get_cpu();
122
123 if (cpumask_test_cpu(this_cpu, mask))
124 __wrmsr_on_cpu(&rv);
125
126 smp_call_function_many(mask, __wrmsr_on_cpu, &rv, 1);
127 put_cpu();
128} 120}
129EXPORT_SYMBOL(wrmsr_on_cpus); 121EXPORT_SYMBOL(wrmsr_on_cpus);
130 122
diff --git a/arch/x86/lib/usercopy_32.c b/arch/x86/lib/usercopy_32.c
index 1f118d462acc..e218d5df85ff 100644
--- a/arch/x86/lib/usercopy_32.c
+++ b/arch/x86/lib/usercopy_32.c
@@ -874,7 +874,7 @@ EXPORT_SYMBOL(copy_to_user);
874 * data to the requested size using zero bytes. 874 * data to the requested size using zero bytes.
875 */ 875 */
876unsigned long 876unsigned long
877copy_from_user(void *to, const void __user *from, unsigned long n) 877_copy_from_user(void *to, const void __user *from, unsigned long n)
878{ 878{
879 if (access_ok(VERIFY_READ, from, n)) 879 if (access_ok(VERIFY_READ, from, n))
880 n = __copy_from_user(to, from, n); 880 n = __copy_from_user(to, from, n);
@@ -882,4 +882,10 @@ copy_from_user(void *to, const void __user *from, unsigned long n)
882 memset(to, 0, n); 882 memset(to, 0, n);
883 return n; 883 return n;
884} 884}
885EXPORT_SYMBOL(copy_from_user); 885EXPORT_SYMBOL(_copy_from_user);
886
887void copy_from_user_overflow(void)
888{
889 WARN(1, "Buffer overflow detected!\n");
890}
891EXPORT_SYMBOL(copy_from_user_overflow);
diff --git a/arch/x86/lib/x86-opcode-map.txt b/arch/x86/lib/x86-opcode-map.txt
new file mode 100644
index 000000000000..a793da5e560e
--- /dev/null
+++ b/arch/x86/lib/x86-opcode-map.txt
@@ -0,0 +1,893 @@
1# x86 Opcode Maps
2#
3#<Opcode maps>
4# Table: table-name
5# Referrer: escaped-name
6# AVXcode: avx-code
7# opcode: mnemonic|GrpXXX [operand1[,operand2...]] [(extra1)[,(extra2)...] [| 2nd-mnemonic ...]
8# (or)
9# opcode: escape # escaped-name
10# EndTable
11#
12#<group maps>
13# GrpTable: GrpXXX
14# reg: mnemonic [operand1[,operand2...]] [(extra1)[,(extra2)...] [| 2nd-mnemonic ...]
15# EndTable
16#
17# AVX Superscripts
18# (VEX): this opcode can accept VEX prefix.
19# (oVEX): this opcode requires VEX prefix.
20# (o128): this opcode only supports 128bit VEX.
21# (o256): this opcode only supports 256bit VEX.
22#
23
24Table: one byte opcode
25Referrer:
26AVXcode:
27# 0x00 - 0x0f
2800: ADD Eb,Gb
2901: ADD Ev,Gv
3002: ADD Gb,Eb
3103: ADD Gv,Ev
3204: ADD AL,Ib
3305: ADD rAX,Iz
3406: PUSH ES (i64)
3507: POP ES (i64)
3608: OR Eb,Gb
3709: OR Ev,Gv
380a: OR Gb,Eb
390b: OR Gv,Ev
400c: OR AL,Ib
410d: OR rAX,Iz
420e: PUSH CS (i64)
430f: escape # 2-byte escape
44# 0x10 - 0x1f
4510: ADC Eb,Gb
4611: ADC Ev,Gv
4712: ADC Gb,Eb
4813: ADC Gv,Ev
4914: ADC AL,Ib
5015: ADC rAX,Iz
5116: PUSH SS (i64)
5217: POP SS (i64)
5318: SBB Eb,Gb
5419: SBB Ev,Gv
551a: SBB Gb,Eb
561b: SBB Gv,Ev
571c: SBB AL,Ib
581d: SBB rAX,Iz
591e: PUSH DS (i64)
601f: POP DS (i64)
61# 0x20 - 0x2f
6220: AND Eb,Gb
6321: AND Ev,Gv
6422: AND Gb,Eb
6523: AND Gv,Ev
6624: AND AL,Ib
6725: AND rAx,Iz
6826: SEG=ES (Prefix)
6927: DAA (i64)
7028: SUB Eb,Gb
7129: SUB Ev,Gv
722a: SUB Gb,Eb
732b: SUB Gv,Ev
742c: SUB AL,Ib
752d: SUB rAX,Iz
762e: SEG=CS (Prefix)
772f: DAS (i64)
78# 0x30 - 0x3f
7930: XOR Eb,Gb
8031: XOR Ev,Gv
8132: XOR Gb,Eb
8233: XOR Gv,Ev
8334: XOR AL,Ib
8435: XOR rAX,Iz
8536: SEG=SS (Prefix)
8637: AAA (i64)
8738: CMP Eb,Gb
8839: CMP Ev,Gv
893a: CMP Gb,Eb
903b: CMP Gv,Ev
913c: CMP AL,Ib
923d: CMP rAX,Iz
933e: SEG=DS (Prefix)
943f: AAS (i64)
95# 0x40 - 0x4f
9640: INC eAX (i64) | REX (o64)
9741: INC eCX (i64) | REX.B (o64)
9842: INC eDX (i64) | REX.X (o64)
9943: INC eBX (i64) | REX.XB (o64)
10044: INC eSP (i64) | REX.R (o64)
10145: INC eBP (i64) | REX.RB (o64)
10246: INC eSI (i64) | REX.RX (o64)
10347: INC eDI (i64) | REX.RXB (o64)
10448: DEC eAX (i64) | REX.W (o64)
10549: DEC eCX (i64) | REX.WB (o64)
1064a: DEC eDX (i64) | REX.WX (o64)
1074b: DEC eBX (i64) | REX.WXB (o64)
1084c: DEC eSP (i64) | REX.WR (o64)
1094d: DEC eBP (i64) | REX.WRB (o64)
1104e: DEC eSI (i64) | REX.WRX (o64)
1114f: DEC eDI (i64) | REX.WRXB (o64)
112# 0x50 - 0x5f
11350: PUSH rAX/r8 (d64)
11451: PUSH rCX/r9 (d64)
11552: PUSH rDX/r10 (d64)
11653: PUSH rBX/r11 (d64)
11754: PUSH rSP/r12 (d64)
11855: PUSH rBP/r13 (d64)
11956: PUSH rSI/r14 (d64)
12057: PUSH rDI/r15 (d64)
12158: POP rAX/r8 (d64)
12259: POP rCX/r9 (d64)
1235a: POP rDX/r10 (d64)
1245b: POP rBX/r11 (d64)
1255c: POP rSP/r12 (d64)
1265d: POP rBP/r13 (d64)
1275e: POP rSI/r14 (d64)
1285f: POP rDI/r15 (d64)
129# 0x60 - 0x6f
13060: PUSHA/PUSHAD (i64)
13161: POPA/POPAD (i64)
13262: BOUND Gv,Ma (i64)
13363: ARPL Ew,Gw (i64) | MOVSXD Gv,Ev (o64)
13464: SEG=FS (Prefix)
13565: SEG=GS (Prefix)
13666: Operand-Size (Prefix)
13767: Address-Size (Prefix)
13868: PUSH Iz (d64)
13969: IMUL Gv,Ev,Iz
1406a: PUSH Ib (d64)
1416b: IMUL Gv,Ev,Ib
1426c: INS/INSB Yb,DX
1436d: INS/INSW/INSD Yz,DX
1446e: OUTS/OUTSB DX,Xb
1456f: OUTS/OUTSW/OUTSD DX,Xz
146# 0x70 - 0x7f
14770: JO Jb
14871: JNO Jb
14972: JB/JNAE/JC Jb
15073: JNB/JAE/JNC Jb
15174: JZ/JE Jb
15275: JNZ/JNE Jb
15376: JBE/JNA Jb
15477: JNBE/JA Jb
15578: JS Jb
15679: JNS Jb
1577a: JP/JPE Jb
1587b: JNP/JPO Jb
1597c: JL/JNGE Jb
1607d: JNL/JGE Jb
1617e: JLE/JNG Jb
1627f: JNLE/JG Jb
163# 0x80 - 0x8f
16480: Grp1 Eb,Ib (1A)
16581: Grp1 Ev,Iz (1A)
16682: Grp1 Eb,Ib (1A),(i64)
16783: Grp1 Ev,Ib (1A)
16884: TEST Eb,Gb
16985: TEST Ev,Gv
17086: XCHG Eb,Gb
17187: XCHG Ev,Gv
17288: MOV Eb,Gb
17389: MOV Ev,Gv
1748a: MOV Gb,Eb
1758b: MOV Gv,Ev
1768c: MOV Ev,Sw
1778d: LEA Gv,M
1788e: MOV Sw,Ew
1798f: Grp1A (1A) | POP Ev (d64)
180# 0x90 - 0x9f
18190: NOP | PAUSE (F3) | XCHG r8,rAX
18291: XCHG rCX/r9,rAX
18392: XCHG rDX/r10,rAX
18493: XCHG rBX/r11,rAX
18594: XCHG rSP/r12,rAX
18695: XCHG rBP/r13,rAX
18796: XCHG rSI/r14,rAX
18897: XCHG rDI/r15,rAX
18998: CBW/CWDE/CDQE
19099: CWD/CDQ/CQO
1919a: CALLF Ap (i64)
1929b: FWAIT/WAIT
1939c: PUSHF/D/Q Fv (d64)
1949d: POPF/D/Q Fv (d64)
1959e: SAHF
1969f: LAHF
197# 0xa0 - 0xaf
198a0: MOV AL,Ob
199a1: MOV rAX,Ov
200a2: MOV Ob,AL
201a3: MOV Ov,rAX
202a4: MOVS/B Xb,Yb
203a5: MOVS/W/D/Q Xv,Yv
204a6: CMPS/B Xb,Yb
205a7: CMPS/W/D Xv,Yv
206a8: TEST AL,Ib
207a9: TEST rAX,Iz
208aa: STOS/B Yb,AL
209ab: STOS/W/D/Q Yv,rAX
210ac: LODS/B AL,Xb
211ad: LODS/W/D/Q rAX,Xv
212ae: SCAS/B AL,Yb
213af: SCAS/W/D/Q rAX,Xv
214# 0xb0 - 0xbf
215b0: MOV AL/R8L,Ib
216b1: MOV CL/R9L,Ib
217b2: MOV DL/R10L,Ib
218b3: MOV BL/R11L,Ib
219b4: MOV AH/R12L,Ib
220b5: MOV CH/R13L,Ib
221b6: MOV DH/R14L,Ib
222b7: MOV BH/R15L,Ib
223b8: MOV rAX/r8,Iv
224b9: MOV rCX/r9,Iv
225ba: MOV rDX/r10,Iv
226bb: MOV rBX/r11,Iv
227bc: MOV rSP/r12,Iv
228bd: MOV rBP/r13,Iv
229be: MOV rSI/r14,Iv
230bf: MOV rDI/r15,Iv
231# 0xc0 - 0xcf
232c0: Grp2 Eb,Ib (1A)
233c1: Grp2 Ev,Ib (1A)
234c2: RETN Iw (f64)
235c3: RETN
236c4: LES Gz,Mp (i64) | 3bytes-VEX (Prefix)
237c5: LDS Gz,Mp (i64) | 2bytes-VEX (Prefix)
238c6: Grp11 Eb,Ib (1A)
239c7: Grp11 Ev,Iz (1A)
240c8: ENTER Iw,Ib
241c9: LEAVE (d64)
242ca: RETF Iw
243cb: RETF
244cc: INT3
245cd: INT Ib
246ce: INTO (i64)
247cf: IRET/D/Q
248# 0xd0 - 0xdf
249d0: Grp2 Eb,1 (1A)
250d1: Grp2 Ev,1 (1A)
251d2: Grp2 Eb,CL (1A)
252d3: Grp2 Ev,CL (1A)
253d4: AAM Ib (i64)
254d5: AAD Ib (i64)
255d6:
256d7: XLAT/XLATB
257d8: ESC
258d9: ESC
259da: ESC
260db: ESC
261dc: ESC
262dd: ESC
263de: ESC
264df: ESC
265# 0xe0 - 0xef
266e0: LOOPNE/LOOPNZ Jb (f64)
267e1: LOOPE/LOOPZ Jb (f64)
268e2: LOOP Jb (f64)
269e3: JrCXZ Jb (f64)
270e4: IN AL,Ib
271e5: IN eAX,Ib
272e6: OUT Ib,AL
273e7: OUT Ib,eAX
274e8: CALL Jz (f64)
275e9: JMP-near Jz (f64)
276ea: JMP-far Ap (i64)
277eb: JMP-short Jb (f64)
278ec: IN AL,DX
279ed: IN eAX,DX
280ee: OUT DX,AL
281ef: OUT DX,eAX
282# 0xf0 - 0xff
283f0: LOCK (Prefix)
284f1:
285f2: REPNE (Prefix)
286f3: REP/REPE (Prefix)
287f4: HLT
288f5: CMC
289f6: Grp3_1 Eb (1A)
290f7: Grp3_2 Ev (1A)
291f8: CLC
292f9: STC
293fa: CLI
294fb: STI
295fc: CLD
296fd: STD
297fe: Grp4 (1A)
298ff: Grp5 (1A)
299EndTable
300
301Table: 2-byte opcode (0x0f)
302Referrer: 2-byte escape
303AVXcode: 1
304# 0x0f 0x00-0x0f
30500: Grp6 (1A)
30601: Grp7 (1A)
30702: LAR Gv,Ew
30803: LSL Gv,Ew
30904:
31005: SYSCALL (o64)
31106: CLTS
31207: SYSRET (o64)
31308: INVD
31409: WBINVD
3150a:
3160b: UD2 (1B)
3170c:
3180d: NOP Ev | GrpP
3190e: FEMMS
320# 3DNow! uses the last imm byte as opcode extension.
3210f: 3DNow! Pq,Qq,Ib
322# 0x0f 0x10-0x1f
32310: movups Vps,Wps (VEX) | movss Vss,Wss (F3),(VEX),(o128) | movupd Vpd,Wpd (66),(VEX) | movsd Vsd,Wsd (F2),(VEX),(o128)
32411: movups Wps,Vps (VEX) | movss Wss,Vss (F3),(VEX),(o128) | movupd Wpd,Vpd (66),(VEX) | movsd Wsd,Vsd (F2),(VEX),(o128)
32512: movlps Vq,Mq (VEX),(o128) | movlpd Vq,Mq (66),(VEX),(o128) | movhlps Vq,Uq (VEX),(o128) | movddup Vq,Wq (F2),(VEX) | movsldup Vq,Wq (F3),(VEX)
32613: mpvlps Mq,Vq (VEX),(o128) | movlpd Mq,Vq (66),(VEX),(o128)
32714: unpcklps Vps,Wq (VEX) | unpcklpd Vpd,Wq (66),(VEX)
32815: unpckhps Vps,Wq (VEX) | unpckhpd Vpd,Wq (66),(VEX)
32916: movhps Vq,Mq (VEX),(o128) | movhpd Vq,Mq (66),(VEX),(o128) | movlsps Vq,Uq (VEX),(o128) | movshdup Vq,Wq (F3),(VEX)
33017: movhps Mq,Vq (VEX),(o128) | movhpd Mq,Vq (66),(VEX),(o128)
33118: Grp16 (1A)
33219:
3331a:
3341b:
3351c:
3361d:
3371e:
3381f: NOP Ev
339# 0x0f 0x20-0x2f
34020: MOV Rd,Cd
34121: MOV Rd,Dd
34222: MOV Cd,Rd
34323: MOV Dd,Rd
34424:
34525:
34626:
34727:
34828: movaps Vps,Wps (VEX) | movapd Vpd,Wpd (66),(VEX)
34929: movaps Wps,Vps (VEX) | movapd Wpd,Vpd (66),(VEX)
3502a: cvtpi2ps Vps,Qpi | cvtsi2ss Vss,Ed/q (F3),(VEX),(o128) | cvtpi2pd Vpd,Qpi (66) | cvtsi2sd Vsd,Ed/q (F2),(VEX),(o128)
3512b: movntps Mps,Vps (VEX) | movntpd Mpd,Vpd (66),(VEX)
3522c: cvttps2pi Ppi,Wps | cvttss2si Gd/q,Wss (F3),(VEX),(o128) | cvttpd2pi Ppi,Wpd (66) | cvttsd2si Gd/q,Wsd (F2),(VEX),(o128)
3532d: cvtps2pi Ppi,Wps | cvtss2si Gd/q,Wss (F3),(VEX),(o128) | cvtpd2pi Qpi,Wpd (66) | cvtsd2si Gd/q,Wsd (F2),(VEX),(o128)
3542e: ucomiss Vss,Wss (VEX),(o128) | ucomisd Vsd,Wsd (66),(VEX),(o128)
3552f: comiss Vss,Wss (VEX),(o128) | comisd Vsd,Wsd (66),(VEX),(o128)
356# 0x0f 0x30-0x3f
35730: WRMSR
35831: RDTSC
35932: RDMSR
36033: RDPMC
36134: SYSENTER
36235: SYSEXIT
36336:
36437: GETSEC
36538: escape # 3-byte escape 1
36639:
3673a: escape # 3-byte escape 2
3683b:
3693c:
3703d:
3713e:
3723f:
373# 0x0f 0x40-0x4f
37440: CMOVO Gv,Ev
37541: CMOVNO Gv,Ev
37642: CMOVB/C/NAE Gv,Ev
37743: CMOVAE/NB/NC Gv,Ev
37844: CMOVE/Z Gv,Ev
37945: CMOVNE/NZ Gv,Ev
38046: CMOVBE/NA Gv,Ev
38147: CMOVA/NBE Gv,Ev
38248: CMOVS Gv,Ev
38349: CMOVNS Gv,Ev
3844a: CMOVP/PE Gv,Ev
3854b: CMOVNP/PO Gv,Ev
3864c: CMOVL/NGE Gv,Ev
3874d: CMOVNL/GE Gv,Ev
3884e: CMOVLE/NG Gv,Ev
3894f: CMOVNLE/G Gv,Ev
390# 0x0f 0x50-0x5f
39150: movmskps Gd/q,Ups (VEX) | movmskpd Gd/q,Upd (66),(VEX)
39251: sqrtps Vps,Wps (VEX) | sqrtss Vss,Wss (F3),(VEX),(o128) | sqrtpd Vpd,Wpd (66),(VEX) | sqrtsd Vsd,Wsd (F2),(VEX),(o128)
39352: rsqrtps Vps,Wps (VEX) | rsqrtss Vss,Wss (F3),(VEX),(o128)
39453: rcpps Vps,Wps (VEX) | rcpss Vss,Wss (F3),(VEX),(o128)
39554: andps Vps,Wps (VEX) | andpd Vpd,Wpd (66),(VEX)
39655: andnps Vps,Wps (VEX) | andnpd Vpd,Wpd (66),(VEX)
39756: orps Vps,Wps (VEX) | orpd Vpd,Wpd (66),(VEX)
39857: xorps Vps,Wps (VEX) | xorpd Vpd,Wpd (66),(VEX)
39958: addps Vps,Wps (VEX) | addss Vss,Wss (F3),(VEX),(o128) | addpd Vpd,Wpd (66),(VEX) | addsd Vsd,Wsd (F2),(VEX),(o128)
40059: mulps Vps,Wps (VEX) | mulss Vss,Wss (F3),(VEX),(o128) | mulpd Vpd,Wpd (66),(VEX) | mulsd Vsd,Wsd (F2),(VEX),(o128)
4015a: cvtps2pd Vpd,Wps (VEX) | cvtss2sd Vsd,Wss (F3),(VEX),(o128) | cvtpd2ps Vps,Wpd (66),(VEX) | cvtsd2ss Vsd,Wsd (F2),(VEX),(o128)
4025b: cvtdq2ps Vps,Wdq (VEX) | cvtps2dq Vdq,Wps (66),(VEX) | cvttps2dq Vdq,Wps (F3),(VEX)
4035c: subps Vps,Wps (VEX) | subss Vss,Wss (F3),(VEX),(o128) | subpd Vpd,Wpd (66),(VEX) | subsd Vsd,Wsd (F2),(VEX),(o128)
4045d: minps Vps,Wps (VEX) | minss Vss,Wss (F3),(VEX),(o128) | minpd Vpd,Wpd (66),(VEX) | minsd Vsd,Wsd (F2),(VEX),(o128)
4055e: divps Vps,Wps (VEX) | divss Vss,Wss (F3),(VEX),(o128) | divpd Vpd,Wpd (66),(VEX) | divsd Vsd,Wsd (F2),(VEX),(o128)
4065f: maxps Vps,Wps (VEX) | maxss Vss,Wss (F3),(VEX),(o128) | maxpd Vpd,Wpd (66),(VEX) | maxsd Vsd,Wsd (F2),(VEX),(o128)
407# 0x0f 0x60-0x6f
40860: punpcklbw Pq,Qd | punpcklbw Vdq,Wdq (66),(VEX),(o128)
40961: punpcklwd Pq,Qd | punpcklwd Vdq,Wdq (66),(VEX),(o128)
41062: punpckldq Pq,Qd | punpckldq Vdq,Wdq (66),(VEX),(o128)
41163: packsswb Pq,Qq | packsswb Vdq,Wdq (66),(VEX),(o128)
41264: pcmpgtb Pq,Qq | pcmpgtb Vdq,Wdq (66),(VEX),(o128)
41365: pcmpgtw Pq,Qq | pcmpgtw Vdq,Wdq (66),(VEX),(o128)
41466: pcmpgtd Pq,Qq | pcmpgtd Vdq,Wdq (66),(VEX),(o128)
41567: packuswb Pq,Qq | packuswb Vdq,Wdq (66),(VEX),(o128)
41668: punpckhbw Pq,Qd | punpckhbw Vdq,Wdq (66),(VEX),(o128)
41769: punpckhwd Pq,Qd | punpckhwd Vdq,Wdq (66),(VEX),(o128)
4186a: punpckhdq Pq,Qd | punpckhdq Vdq,Wdq (66),(VEX),(o128)
4196b: packssdw Pq,Qd | packssdw Vdq,Wdq (66),(VEX),(o128)
4206c: punpcklqdq Vdq,Wdq (66),(VEX),(o128)
4216d: punpckhqdq Vdq,Wdq (66),(VEX),(o128)
4226e: movd/q/ Pd,Ed/q | movd/q Vdq,Ed/q (66),(VEX),(o128)
4236f: movq Pq,Qq | movdqa Vdq,Wdq (66),(VEX) | movdqu Vdq,Wdq (F3),(VEX)
424# 0x0f 0x70-0x7f
42570: pshufw Pq,Qq,Ib | pshufd Vdq,Wdq,Ib (66),(VEX),(o128) | pshufhw Vdq,Wdq,Ib (F3),(VEX),(o128) | pshuflw VdqWdq,Ib (F2),(VEX),(o128)
42671: Grp12 (1A)
42772: Grp13 (1A)
42873: Grp14 (1A)
42974: pcmpeqb Pq,Qq | pcmpeqb Vdq,Wdq (66),(VEX),(o128)
43075: pcmpeqw Pq,Qq | pcmpeqw Vdq,Wdq (66),(VEX),(o128)
43176: pcmpeqd Pq,Qq | pcmpeqd Vdq,Wdq (66),(VEX),(o128)
43277: emms/vzeroupper/vzeroall (VEX)
43378: VMREAD Ed/q,Gd/q
43479: VMWRITE Gd/q,Ed/q
4357a:
4367b:
4377c: haddps Vps,Wps (F2),(VEX) | haddpd Vpd,Wpd (66),(VEX)
4387d: hsubps Vps,Wps (F2),(VEX) | hsubpd Vpd,Wpd (66),(VEX)
4397e: movd/q Ed/q,Pd | movd/q Ed/q,Vdq (66),(VEX),(o128) | movq Vq,Wq (F3),(VEX),(o128)
4407f: movq Qq,Pq | movdqa Wdq,Vdq (66),(VEX) | movdqu Wdq,Vdq (F3),(VEX)
441# 0x0f 0x80-0x8f
44280: JO Jz (f64)
44381: JNO Jz (f64)
44482: JB/JNAE/JC Jz (f64)
44583: JNB/JAE/JNC Jz (f64)
44684: JZ/JE Jz (f64)
44785: JNZ/JNE Jz (f64)
44886: JBE/JNA Jz (f64)
44987: JNBE/JA Jz (f64)
45088: JS Jz (f64)
45189: JNS Jz (f64)
4528a: JP/JPE Jz (f64)
4538b: JNP/JPO Jz (f64)
4548c: JL/JNGE Jz (f64)
4558d: JNL/JGE Jz (f64)
4568e: JLE/JNG Jz (f64)
4578f: JNLE/JG Jz (f64)
458# 0x0f 0x90-0x9f
45990: SETO Eb
46091: SETNO Eb
46192: SETB/C/NAE Eb
46293: SETAE/NB/NC Eb
46394: SETE/Z Eb
46495: SETNE/NZ Eb
46596: SETBE/NA Eb
46697: SETA/NBE Eb
46798: SETS Eb
46899: SETNS Eb
4699a: SETP/PE Eb
4709b: SETNP/PO Eb
4719c: SETL/NGE Eb
4729d: SETNL/GE Eb
4739e: SETLE/NG Eb
4749f: SETNLE/G Eb
475# 0x0f 0xa0-0xaf
476a0: PUSH FS (d64)
477a1: POP FS (d64)
478a2: CPUID
479a3: BT Ev,Gv
480a4: SHLD Ev,Gv,Ib
481a5: SHLD Ev,Gv,CL
482a6: GrpPDLK
483a7: GrpRNG
484a8: PUSH GS (d64)
485a9: POP GS (d64)
486aa: RSM
487ab: BTS Ev,Gv
488ac: SHRD Ev,Gv,Ib
489ad: SHRD Ev,Gv,CL
490ae: Grp15 (1A),(1C)
491af: IMUL Gv,Ev
492# 0x0f 0xb0-0xbf
493b0: CMPXCHG Eb,Gb
494b1: CMPXCHG Ev,Gv
495b2: LSS Gv,Mp
496b3: BTR Ev,Gv
497b4: LFS Gv,Mp
498b5: LGS Gv,Mp
499b6: MOVZX Gv,Eb
500b7: MOVZX Gv,Ew
501b8: JMPE | POPCNT Gv,Ev (F3)
502b9: Grp10 (1A)
503ba: Grp8 Ev,Ib (1A)
504bb: BTC Ev,Gv
505bc: BSF Gv,Ev
506bd: BSR Gv,Ev
507be: MOVSX Gv,Eb
508bf: MOVSX Gv,Ew
509# 0x0f 0xc0-0xcf
510c0: XADD Eb,Gb
511c1: XADD Ev,Gv
512c2: cmpps Vps,Wps,Ib (VEX) | cmpss Vss,Wss,Ib (F3),(VEX),(o128) | cmppd Vpd,Wpd,Ib (66),(VEX) | cmpsd Vsd,Wsd,Ib (F2),(VEX)
513c3: movnti Md/q,Gd/q
514c4: pinsrw Pq,Rd/q/Mw,Ib | pinsrw Vdq,Rd/q/Mw,Ib (66),(VEX),(o128)
515c5: pextrw Gd,Nq,Ib | pextrw Gd,Udq,Ib (66),(VEX),(o128)
516c6: shufps Vps,Wps,Ib (VEX) | shufpd Vpd,Wpd,Ib (66),(VEX)
517c7: Grp9 (1A)
518c8: BSWAP RAX/EAX/R8/R8D
519c9: BSWAP RCX/ECX/R9/R9D
520ca: BSWAP RDX/EDX/R10/R10D
521cb: BSWAP RBX/EBX/R11/R11D
522cc: BSWAP RSP/ESP/R12/R12D
523cd: BSWAP RBP/EBP/R13/R13D
524ce: BSWAP RSI/ESI/R14/R14D
525cf: BSWAP RDI/EDI/R15/R15D
526# 0x0f 0xd0-0xdf
527d0: addsubps Vps,Wps (F2),(VEX) | addsubpd Vpd,Wpd (66),(VEX)
528d1: psrlw Pq,Qq | psrlw Vdq,Wdq (66),(VEX),(o128)
529d2: psrld Pq,Qq | psrld Vdq,Wdq (66),(VEX),(o128)
530d3: psrlq Pq,Qq | psrlq Vdq,Wdq (66),(VEX),(o128)
531d4: paddq Pq,Qq | paddq Vdq,Wdq (66),(VEX),(o128)
532d5: pmullw Pq,Qq | pmullw Vdq,Wdq (66),(VEX),(o128)
533d6: movq Wq,Vq (66),(VEX),(o128) | movq2dq Vdq,Nq (F3) | movdq2q Pq,Uq (F2)
534d7: pmovmskb Gd,Nq | pmovmskb Gd,Udq (66),(VEX),(o128)
535d8: psubusb Pq,Qq | psubusb Vdq,Wdq (66),(VEX),(o128)
536d9: psubusw Pq,Qq | psubusw Vdq,Wdq (66),(VEX),(o128)
537da: pminub Pq,Qq | pminub Vdq,Wdq (66),(VEX),(o128)
538db: pand Pq,Qq | pand Vdq,Wdq (66),(VEX),(o128)
539dc: paddusb Pq,Qq | paddusb Vdq,Wdq (66),(VEX),(o128)
540dd: paddusw Pq,Qq | paddusw Vdq,Wdq (66),(VEX),(o128)
541de: pmaxub Pq,Qq | pmaxub Vdq,Wdq (66),(VEX),(o128)
542df: pandn Pq,Qq | pandn Vdq,Wdq (66),(VEX),(o128)
543# 0x0f 0xe0-0xef
544e0: pavgb Pq,Qq | pavgb Vdq,Wdq (66),(VEX),(o128)
545e1: psraw Pq,Qq | psraw Vdq,Wdq (66),(VEX),(o128)
546e2: psrad Pq,Qq | psrad Vdq,Wdq (66),(VEX),(o128)
547e3: pavgw Pq,Qq | pavgw Vdq,Wdq (66),(VEX),(o128)
548e4: pmulhuw Pq,Qq | pmulhuw Vdq,Wdq (66),(VEX),(o128)
549e5: pmulhw Pq,Qq | pmulhw Vdq,Wdq (66),(VEX),(o128)
550e6: cvtpd2dq Vdq,Wpd (F2),(VEX) | cvttpd2dq Vdq,Wpd (66),(VEX) | cvtdq2pd Vpd,Wdq (F3),(VEX)
551e7: movntq Mq,Pq | movntdq Mdq,Vdq (66),(VEX)
552e8: psubsb Pq,Qq | psubsb Vdq,Wdq (66),(VEX),(o128)
553e9: psubsw Pq,Qq | psubsw Vdq,Wdq (66),(VEX),(o128)
554ea: pminsw Pq,Qq | pminsw Vdq,Wdq (66),(VEX),(o128)
555eb: por Pq,Qq | por Vdq,Wdq (66),(VEX),(o128)
556ec: paddsb Pq,Qq | paddsb Vdq,Wdq (66),(VEX),(o128)
557ed: paddsw Pq,Qq | paddsw Vdq,Wdq (66),(VEX),(o128)
558ee: pmaxsw Pq,Qq | pmaxsw Vdq,Wdq (66),(VEX),(o128)
559ef: pxor Pq,Qq | pxor Vdq,Wdq (66),(VEX),(o128)
560# 0x0f 0xf0-0xff
561f0: lddqu Vdq,Mdq (F2),(VEX)
562f1: psllw Pq,Qq | psllw Vdq,Wdq (66),(VEX),(o128)
563f2: pslld Pq,Qq | pslld Vdq,Wdq (66),(VEX),(o128)
564f3: psllq Pq,Qq | psllq Vdq,Wdq (66),(VEX),(o128)
565f4: pmuludq Pq,Qq | pmuludq Vdq,Wdq (66),(VEX),(o128)
566f5: pmaddwd Pq,Qq | pmaddwd Vdq,Wdq (66),(VEX),(o128)
567f6: psadbw Pq,Qq | psadbw Vdq,Wdq (66),(VEX),(o128)
568f7: maskmovq Pq,Nq | maskmovdqu Vdq,Udq (66),(VEX),(o128)
569f8: psubb Pq,Qq | psubb Vdq,Wdq (66),(VEX),(o128)
570f9: psubw Pq,Qq | psubw Vdq,Wdq (66),(VEX),(o128)
571fa: psubd Pq,Qq | psubd Vdq,Wdq (66),(VEX),(o128)
572fb: psubq Pq,Qq | psubq Vdq,Wdq (66),(VEX),(o128)
573fc: paddb Pq,Qq | paddb Vdq,Wdq (66),(VEX),(o128)
574fd: paddw Pq,Qq | paddw Vdq,Wdq (66),(VEX),(o128)
575fe: paddd Pq,Qq | paddd Vdq,Wdq (66),(VEX),(o128)
576ff:
577EndTable
578
579Table: 3-byte opcode 1 (0x0f 0x38)
580Referrer: 3-byte escape 1
581AVXcode: 2
582# 0x0f 0x38 0x00-0x0f
58300: pshufb Pq,Qq | pshufb Vdq,Wdq (66),(VEX),(o128)
58401: phaddw Pq,Qq | phaddw Vdq,Wdq (66),(VEX),(o128)
58502: phaddd Pq,Qq | phaddd Vdq,Wdq (66),(VEX),(o128)
58603: phaddsw Pq,Qq | phaddsw Vdq,Wdq (66),(VEX),(o128)
58704: pmaddubsw Pq,Qq | pmaddubsw Vdq,Wdq (66),(VEX),(o128)
58805: phsubw Pq,Qq | phsubw Vdq,Wdq (66),(VEX),(o128)
58906: phsubd Pq,Qq | phsubd Vdq,Wdq (66),(VEX),(o128)
59007: phsubsw Pq,Qq | phsubsw Vdq,Wdq (66),(VEX),(o128)
59108: psignb Pq,Qq | psignb Vdq,Wdq (66),(VEX),(o128)
59209: psignw Pq,Qq | psignw Vdq,Wdq (66),(VEX),(o128)
5930a: psignd Pq,Qq | psignd Vdq,Wdq (66),(VEX),(o128)
5940b: pmulhrsw Pq,Qq | pmulhrsw Vdq,Wdq (66),(VEX),(o128)
5950c: Vpermilps /r (66),(oVEX)
5960d: Vpermilpd /r (66),(oVEX)
5970e: vtestps /r (66),(oVEX)
5980f: vtestpd /r (66),(oVEX)
599# 0x0f 0x38 0x10-0x1f
60010: pblendvb Vdq,Wdq (66)
60111:
60212:
60313:
60414: blendvps Vdq,Wdq (66)
60515: blendvpd Vdq,Wdq (66)
60616:
60717: ptest Vdq,Wdq (66),(VEX)
60818: vbroadcastss /r (66),(oVEX)
60919: vbroadcastsd /r (66),(oVEX),(o256)
6101a: vbroadcastf128 /r (66),(oVEX),(o256)
6111b:
6121c: pabsb Pq,Qq | pabsb Vdq,Wdq (66),(VEX),(o128)
6131d: pabsw Pq,Qq | pabsw Vdq,Wdq (66),(VEX),(o128)
6141e: pabsd Pq,Qq | pabsd Vdq,Wdq (66),(VEX),(o128)
6151f:
616# 0x0f 0x38 0x20-0x2f
61720: pmovsxbw Vdq,Udq/Mq (66),(VEX),(o128)
61821: pmovsxbd Vdq,Udq/Md (66),(VEX),(o128)
61922: pmovsxbq Vdq,Udq/Mw (66),(VEX),(o128)
62023: pmovsxwd Vdq,Udq/Mq (66),(VEX),(o128)
62124: pmovsxwq Vdq,Udq/Md (66),(VEX),(o128)
62225: pmovsxdq Vdq,Udq/Mq (66),(VEX),(o128)
62326:
62427:
62528: pmuldq Vdq,Wdq (66),(VEX),(o128)
62629: pcmpeqq Vdq,Wdq (66),(VEX),(o128)
6272a: movntdqa Vdq,Mdq (66),(VEX),(o128)
6282b: packusdw Vdq,Wdq (66),(VEX),(o128)
6292c: vmaskmovps(ld) /r (66),(oVEX)
6302d: vmaskmovpd(ld) /r (66),(oVEX)
6312e: vmaskmovps(st) /r (66),(oVEX)
6322f: vmaskmovpd(st) /r (66),(oVEX)
633# 0x0f 0x38 0x30-0x3f
63430: pmovzxbw Vdq,Udq/Mq (66),(VEX),(o128)
63531: pmovzxbd Vdq,Udq/Md (66),(VEX),(o128)
63632: pmovzxbq Vdq,Udq/Mw (66),(VEX),(o128)
63733: pmovzxwd Vdq,Udq/Mq (66),(VEX),(o128)
63834: pmovzxwq Vdq,Udq/Md (66),(VEX),(o128)
63935: pmovzxdq Vdq,Udq/Mq (66),(VEX),(o128)
64036:
64137: pcmpgtq Vdq,Wdq (66),(VEX),(o128)
64238: pminsb Vdq,Wdq (66),(VEX),(o128)
64339: pminsd Vdq,Wdq (66),(VEX),(o128)
6443a: pminuw Vdq,Wdq (66),(VEX),(o128)
6453b: pminud Vdq,Wdq (66),(VEX),(o128)
6463c: pmaxsb Vdq,Wdq (66),(VEX),(o128)
6473d: pmaxsd Vdq,Wdq (66),(VEX),(o128)
6483e: pmaxuw Vdq,Wdq (66),(VEX),(o128)
6493f: pmaxud Vdq,Wdq (66),(VEX),(o128)
650# 0x0f 0x38 0x40-0x8f
65140: pmulld Vdq,Wdq (66),(VEX),(o128)
65241: phminposuw Vdq,Wdq (66),(VEX),(o128)
65380: INVEPT Gd/q,Mdq (66)
65481: INVPID Gd/q,Mdq (66)
655# 0x0f 0x38 0x90-0xbf (FMA)
65696: vfmaddsub132pd/ps /r (66),(VEX)
65797: vfmsubadd132pd/ps /r (66),(VEX)
65898: vfmadd132pd/ps /r (66),(VEX)
65999: vfmadd132sd/ss /r (66),(VEX),(o128)
6609a: vfmsub132pd/ps /r (66),(VEX)
6619b: vfmsub132sd/ss /r (66),(VEX),(o128)
6629c: vfnmadd132pd/ps /r (66),(VEX)
6639d: vfnmadd132sd/ss /r (66),(VEX),(o128)
6649e: vfnmsub132pd/ps /r (66),(VEX)
6659f: vfnmsub132sd/ss /r (66),(VEX),(o128)
666a6: vfmaddsub213pd/ps /r (66),(VEX)
667a7: vfmsubadd213pd/ps /r (66),(VEX)
668a8: vfmadd213pd/ps /r (66),(VEX)
669a9: vfmadd213sd/ss /r (66),(VEX),(o128)
670aa: vfmsub213pd/ps /r (66),(VEX)
671ab: vfmsub213sd/ss /r (66),(VEX),(o128)
672ac: vfnmadd213pd/ps /r (66),(VEX)
673ad: vfnmadd213sd/ss /r (66),(VEX),(o128)
674ae: vfnmsub213pd/ps /r (66),(VEX)
675af: vfnmsub213sd/ss /r (66),(VEX),(o128)
676b6: vfmaddsub231pd/ps /r (66),(VEX)
677b7: vfmsubadd231pd/ps /r (66),(VEX)
678b8: vfmadd231pd/ps /r (66),(VEX)
679b9: vfmadd231sd/ss /r (66),(VEX),(o128)
680ba: vfmsub231pd/ps /r (66),(VEX)
681bb: vfmsub231sd/ss /r (66),(VEX),(o128)
682bc: vfnmadd231pd/ps /r (66),(VEX)
683bd: vfnmadd231sd/ss /r (66),(VEX),(o128)
684be: vfnmsub231pd/ps /r (66),(VEX)
685bf: vfnmsub231sd/ss /r (66),(VEX),(o128)
686# 0x0f 0x38 0xc0-0xff
687db: aesimc Vdq,Wdq (66),(VEX),(o128)
688dc: aesenc Vdq,Wdq (66),(VEX),(o128)
689dd: aesenclast Vdq,Wdq (66),(VEX),(o128)
690de: aesdec Vdq,Wdq (66),(VEX),(o128)
691df: aesdeclast Vdq,Wdq (66),(VEX),(o128)
692f0: MOVBE Gv,Mv | CRC32 Gd,Eb (F2)
693f1: MOVBE Mv,Gv | CRC32 Gd,Ev (F2)
694EndTable
695
696Table: 3-byte opcode 2 (0x0f 0x3a)
697Referrer: 3-byte escape 2
698AVXcode: 3
699# 0x0f 0x3a 0x00-0xff
70004: vpermilps /r,Ib (66),(oVEX)
70105: vpermilpd /r,Ib (66),(oVEX)
70206: vperm2f128 /r,Ib (66),(oVEX),(o256)
70308: roundps Vdq,Wdq,Ib (66),(VEX)
70409: roundpd Vdq,Wdq,Ib (66),(VEX)
7050a: roundss Vss,Wss,Ib (66),(VEX),(o128)
7060b: roundsd Vsd,Wsd,Ib (66),(VEX),(o128)
7070c: blendps Vdq,Wdq,Ib (66),(VEX)
7080d: blendpd Vdq,Wdq,Ib (66),(VEX)
7090e: pblendw Vdq,Wdq,Ib (66),(VEX),(o128)
7100f: palignr Pq,Qq,Ib | palignr Vdq,Wdq,Ib (66),(VEX),(o128)
71114: pextrb Rd/Mb,Vdq,Ib (66),(VEX),(o128)
71215: pextrw Rd/Mw,Vdq,Ib (66),(VEX),(o128)
71316: pextrd/pextrq Ed/q,Vdq,Ib (66),(VEX),(o128)
71417: extractps Ed,Vdq,Ib (66),(VEX),(o128)
71518: vinsertf128 /r,Ib (66),(oVEX),(o256)
71619: vextractf128 /r,Ib (66),(oVEX),(o256)
71720: pinsrb Vdq,Rd/q/Mb,Ib (66),(VEX),(o128)
71821: insertps Vdq,Udq/Md,Ib (66),(VEX),(o128)
71922: pinsrd/pinsrq Vdq,Ed/q,Ib (66),(VEX),(o128)
72040: dpps Vdq,Wdq,Ib (66),(VEX)
72141: dppd Vdq,Wdq,Ib (66),(VEX),(o128)
72242: mpsadbw Vdq,Wdq,Ib (66),(VEX),(o128)
72344: pclmulq Vdq,Wdq,Ib (66),(VEX),(o128)
7244a: vblendvps /r,Ib (66),(oVEX)
7254b: vblendvpd /r,Ib (66),(oVEX)
7264c: vpblendvb /r,Ib (66),(oVEX),(o128)
72760: pcmpestrm Vdq,Wdq,Ib (66),(VEX),(o128)
72861: pcmpestri Vdq,Wdq,Ib (66),(VEX),(o128)
72962: pcmpistrm Vdq,Wdq,Ib (66),(VEX),(o128)
73063: pcmpistri Vdq,Wdq,Ib (66),(VEX),(o128)
731df: aeskeygenassist Vdq,Wdq,Ib (66),(VEX),(o128)
732EndTable
733
734GrpTable: Grp1
7350: ADD
7361: OR
7372: ADC
7383: SBB
7394: AND
7405: SUB
7416: XOR
7427: CMP
743EndTable
744
745GrpTable: Grp1A
7460: POP
747EndTable
748
749GrpTable: Grp2
7500: ROL
7511: ROR
7522: RCL
7533: RCR
7544: SHL/SAL
7555: SHR
7566:
7577: SAR
758EndTable
759
760GrpTable: Grp3_1
7610: TEST Eb,Ib
7621:
7632: NOT Eb
7643: NEG Eb
7654: MUL AL,Eb
7665: IMUL AL,Eb
7676: DIV AL,Eb
7687: IDIV AL,Eb
769EndTable
770
771GrpTable: Grp3_2
7720: TEST Ev,Iz
7731:
7742: NOT Ev
7753: NEG Ev
7764: MUL rAX,Ev
7775: IMUL rAX,Ev
7786: DIV rAX,Ev
7797: IDIV rAX,Ev
780EndTable
781
782GrpTable: Grp4
7830: INC Eb
7841: DEC Eb
785EndTable
786
787GrpTable: Grp5
7880: INC Ev
7891: DEC Ev
7902: CALLN Ev (f64)
7913: CALLF Ep
7924: JMPN Ev (f64)
7935: JMPF Ep
7946: PUSH Ev (d64)
7957:
796EndTable
797
798GrpTable: Grp6
7990: SLDT Rv/Mw
8001: STR Rv/Mw
8012: LLDT Ew
8023: LTR Ew
8034: VERR Ew
8045: VERW Ew
805EndTable
806
807GrpTable: Grp7
8080: SGDT Ms | VMCALL (001),(11B) | VMLAUNCH (010),(11B) | VMRESUME (011),(11B) | VMXOFF (100),(11B)
8091: SIDT Ms | MONITOR (000),(11B) | MWAIT (001)
8102: LGDT Ms | XGETBV (000),(11B) | XSETBV (001),(11B)
8113: LIDT Ms
8124: SMSW Mw/Rv
8135:
8146: LMSW Ew
8157: INVLPG Mb | SWAPGS (o64),(000),(11B) | RDTSCP (001),(11B)
816EndTable
817
818GrpTable: Grp8
8194: BT
8205: BTS
8216: BTR
8227: BTC
823EndTable
824
825GrpTable: Grp9
8261: CMPXCHG8B/16B Mq/Mdq
8276: VMPTRLD Mq | VMCLEAR Mq (66) | VMXON Mq (F3)
8287: VMPTRST Mq
829EndTable
830
831GrpTable: Grp10
832EndTable
833
834GrpTable: Grp11
8350: MOV
836EndTable
837
838GrpTable: Grp12
8392: psrlw Nq,Ib (11B) | psrlw Udq,Ib (66),(11B),(VEX),(o128)
8404: psraw Nq,Ib (11B) | psraw Udq,Ib (66),(11B),(VEX),(o128)
8416: psllw Nq,Ib (11B) | psllw Udq,Ib (66),(11B),(VEX),(o128)
842EndTable
843
844GrpTable: Grp13
8452: psrld Nq,Ib (11B) | psrld Udq,Ib (66),(11B),(VEX),(o128)
8464: psrad Nq,Ib (11B) | psrad Udq,Ib (66),(11B),(VEX),(o128)
8476: pslld Nq,Ib (11B) | pslld Udq,Ib (66),(11B),(VEX),(o128)
848EndTable
849
850GrpTable: Grp14
8512: psrlq Nq,Ib (11B) | psrlq Udq,Ib (66),(11B),(VEX),(o128)
8523: psrldq Udq,Ib (66),(11B),(VEX),(o128)
8536: psllq Nq,Ib (11B) | psllq Udq,Ib (66),(11B),(VEX),(o128)
8547: pslldq Udq,Ib (66),(11B),(VEX),(o128)
855EndTable
856
857GrpTable: Grp15
8580: fxsave
8591: fxstor
8602: ldmxcsr (VEX)
8613: stmxcsr (VEX)
8624: XSAVE
8635: XRSTOR | lfence (11B)
8646: mfence (11B)
8657: clflush | sfence (11B)
866EndTable
867
868GrpTable: Grp16
8690: prefetch NTA
8701: prefetch T0
8712: prefetch T1
8723: prefetch T2
873EndTable
874
875# AMD's Prefetch Group
876GrpTable: GrpP
8770: PREFETCH
8781: PREFETCHW
879EndTable
880
881GrpTable: GrpPDLK
8820: MONTMUL
8831: XSHA1
8842: XSHA2
885EndTable
886
887GrpTable: GrpRNG
8880: xstore-rng
8891: xcrypt-ecb
8902: xcrypt-cbc
8914: xcrypt-cfb
8925: xcrypt-ofb
893EndTable
diff --git a/arch/x86/mm/extable.c b/arch/x86/mm/extable.c
index 61b41ca3b5a2..d0474ad2a6e5 100644
--- a/arch/x86/mm/extable.c
+++ b/arch/x86/mm/extable.c
@@ -35,34 +35,3 @@ int fixup_exception(struct pt_regs *regs)
35 35
36 return 0; 36 return 0;
37} 37}
38
39#ifdef CONFIG_X86_64
40/*
41 * Need to defined our own search_extable on X86_64 to work around
42 * a B stepping K8 bug.
43 */
44const struct exception_table_entry *
45search_extable(const struct exception_table_entry *first,
46 const struct exception_table_entry *last,
47 unsigned long value)
48{
49 /* B stepping K8 bug */
50 if ((value >> 32) == 0)
51 value |= 0xffffffffUL << 32;
52
53 while (first <= last) {
54 const struct exception_table_entry *mid;
55 long diff;
56
57 mid = (last - first) / 2 + first;
58 diff = mid->insn - value;
59 if (diff == 0)
60 return mid;
61 else if (diff < 0)
62 first = mid+1;
63 else
64 last = mid-1;
65 }
66 return NULL;
67}
68#endif
diff --git a/arch/x86/mm/fault.c b/arch/x86/mm/fault.c
index 071eee604147..f62777940dfb 100644
--- a/arch/x86/mm/fault.c
+++ b/arch/x86/mm/fault.c
@@ -38,7 +38,8 @@ enum x86_pf_error_code {
38 * Returns 0 if mmiotrace is disabled, or if the fault is not 38 * Returns 0 if mmiotrace is disabled, or if the fault is not
39 * handled by mmiotrace: 39 * handled by mmiotrace:
40 */ 40 */
41static inline int kmmio_fault(struct pt_regs *regs, unsigned long addr) 41static inline int __kprobes
42kmmio_fault(struct pt_regs *regs, unsigned long addr)
42{ 43{
43 if (unlikely(is_kmmio_active())) 44 if (unlikely(is_kmmio_active()))
44 if (kmmio_handler(regs, addr) == 1) 45 if (kmmio_handler(regs, addr) == 1)
@@ -46,7 +47,7 @@ static inline int kmmio_fault(struct pt_regs *regs, unsigned long addr)
46 return 0; 47 return 0;
47} 48}
48 49
49static inline int notify_page_fault(struct pt_regs *regs) 50static inline int __kprobes notify_page_fault(struct pt_regs *regs)
50{ 51{
51 int ret = 0; 52 int ret = 0;
52 53
@@ -240,7 +241,7 @@ void vmalloc_sync_all(void)
240 * 241 *
241 * Handle a fault on the vmalloc or module mapping area 242 * Handle a fault on the vmalloc or module mapping area
242 */ 243 */
243static noinline int vmalloc_fault(unsigned long address) 244static noinline __kprobes int vmalloc_fault(unsigned long address)
244{ 245{
245 unsigned long pgd_paddr; 246 unsigned long pgd_paddr;
246 pmd_t *pmd_k; 247 pmd_t *pmd_k;
@@ -357,7 +358,7 @@ void vmalloc_sync_all(void)
357 * 358 *
358 * This assumes no large pages in there. 359 * This assumes no large pages in there.
359 */ 360 */
360static noinline int vmalloc_fault(unsigned long address) 361static noinline __kprobes int vmalloc_fault(unsigned long address)
361{ 362{
362 pgd_t *pgd, *pgd_ref; 363 pgd_t *pgd, *pgd_ref;
363 pud_t *pud, *pud_ref; 364 pud_t *pud, *pud_ref;
@@ -860,7 +861,7 @@ static int spurious_fault_check(unsigned long error_code, pte_t *pte)
860 * There are no security implications to leaving a stale TLB when 861 * There are no security implications to leaving a stale TLB when
861 * increasing the permissions on a page. 862 * increasing the permissions on a page.
862 */ 863 */
863static noinline int 864static noinline __kprobes int
864spurious_fault(unsigned long error_code, unsigned long address) 865spurious_fault(unsigned long error_code, unsigned long address)
865{ 866{
866 pgd_t *pgd; 867 pgd_t *pgd;
diff --git a/arch/x86/mm/ioremap.c b/arch/x86/mm/ioremap.c
index 334e63ca7b2b..2feb9bdedaaf 100644
--- a/arch/x86/mm/ioremap.c
+++ b/arch/x86/mm/ioremap.c
@@ -170,8 +170,7 @@ static void __iomem *__ioremap_caller(resource_size_t phys_addr,
170 (unsigned long long)phys_addr, 170 (unsigned long long)phys_addr,
171 (unsigned long long)(phys_addr + size), 171 (unsigned long long)(phys_addr + size),
172 prot_val, new_prot_val); 172 prot_val, new_prot_val);
173 free_memtype(phys_addr, phys_addr + size); 173 goto err_free_memtype;
174 return NULL;
175 } 174 }
176 prot_val = new_prot_val; 175 prot_val = new_prot_val;
177 } 176 }
@@ -197,26 +196,25 @@ static void __iomem *__ioremap_caller(resource_size_t phys_addr,
197 */ 196 */
198 area = get_vm_area_caller(size, VM_IOREMAP, caller); 197 area = get_vm_area_caller(size, VM_IOREMAP, caller);
199 if (!area) 198 if (!area)
200 return NULL; 199 goto err_free_memtype;
201 area->phys_addr = phys_addr; 200 area->phys_addr = phys_addr;
202 vaddr = (unsigned long) area->addr; 201 vaddr = (unsigned long) area->addr;
203 202
204 if (kernel_map_sync_memtype(phys_addr, size, prot_val)) { 203 if (kernel_map_sync_memtype(phys_addr, size, prot_val))
205 free_memtype(phys_addr, phys_addr + size); 204 goto err_free_area;
206 free_vm_area(area);
207 return NULL;
208 }
209 205
210 if (ioremap_page_range(vaddr, vaddr + size, phys_addr, prot)) { 206 if (ioremap_page_range(vaddr, vaddr + size, phys_addr, prot))
211 free_memtype(phys_addr, phys_addr + size); 207 goto err_free_area;
212 free_vm_area(area);
213 return NULL;
214 }
215 208
216 ret_addr = (void __iomem *) (vaddr + offset); 209 ret_addr = (void __iomem *) (vaddr + offset);
217 mmiotrace_ioremap(unaligned_phys_addr, unaligned_size, ret_addr); 210 mmiotrace_ioremap(unaligned_phys_addr, unaligned_size, ret_addr);
218 211
219 return ret_addr; 212 return ret_addr;
213err_free_area:
214 free_vm_area(area);
215err_free_memtype:
216 free_memtype(phys_addr, phys_addr + size);
217 return NULL;
220} 218}
221 219
222/** 220/**
diff --git a/arch/x86/mm/kmmio.c b/arch/x86/mm/kmmio.c
index 16ccbd77917f..11a4ad4d6253 100644
--- a/arch/x86/mm/kmmio.c
+++ b/arch/x86/mm/kmmio.c
@@ -540,8 +540,14 @@ kmmio_die_notifier(struct notifier_block *nb, unsigned long val, void *args)
540 struct die_args *arg = args; 540 struct die_args *arg = args;
541 541
542 if (val == DIE_DEBUG && (arg->err & DR_STEP)) 542 if (val == DIE_DEBUG && (arg->err & DR_STEP))
543 if (post_kmmio_handler(arg->err, arg->regs) == 1) 543 if (post_kmmio_handler(arg->err, arg->regs) == 1) {
544 /*
545 * Reset the BS bit in dr6 (pointed by args->err) to
546 * denote completion of processing
547 */
548 (*(unsigned long *)ERR_PTR(arg->err)) &= ~DR_STEP;
544 return NOTIFY_STOP; 549 return NOTIFY_STOP;
550 }
545 551
546 return NOTIFY_DONE; 552 return NOTIFY_DONE;
547} 553}
diff --git a/arch/x86/mm/srat_64.c b/arch/x86/mm/srat_64.c
index dbb5381f7b3b..9d7ce96e5a5c 100644
--- a/arch/x86/mm/srat_64.c
+++ b/arch/x86/mm/srat_64.c
@@ -136,7 +136,7 @@ acpi_numa_x2apic_affinity_init(struct acpi_srat_x2apic_cpu_affinity *pa)
136 apicid_to_node[apic_id] = node; 136 apicid_to_node[apic_id] = node;
137 node_set(node, cpu_nodes_parsed); 137 node_set(node, cpu_nodes_parsed);
138 acpi_numa = 1; 138 acpi_numa = 1;
139 printk(KERN_INFO "SRAT: PXM %u -> APIC %u -> Node %u\n", 139 printk(KERN_INFO "SRAT: PXM %u -> APIC 0x%04x -> Node %u\n",
140 pxm, apic_id, node); 140 pxm, apic_id, node);
141} 141}
142 142
@@ -170,7 +170,7 @@ acpi_numa_processor_affinity_init(struct acpi_srat_cpu_affinity *pa)
170 apicid_to_node[apic_id] = node; 170 apicid_to_node[apic_id] = node;
171 node_set(node, cpu_nodes_parsed); 171 node_set(node, cpu_nodes_parsed);
172 acpi_numa = 1; 172 acpi_numa = 1;
173 printk(KERN_INFO "SRAT: PXM %u -> APIC %u -> Node %u\n", 173 printk(KERN_INFO "SRAT: PXM %u -> APIC 0x%02x -> Node %u\n",
174 pxm, apic_id, node); 174 pxm, apic_id, node);
175} 175}
176 176
diff --git a/arch/x86/mm/testmmiotrace.c b/arch/x86/mm/testmmiotrace.c
index 427fd1b56df5..8565d944f7cf 100644
--- a/arch/x86/mm/testmmiotrace.c
+++ b/arch/x86/mm/testmmiotrace.c
@@ -1,12 +1,13 @@
1/* 1/*
2 * Written by Pekka Paalanen, 2008-2009 <pq@iki.fi> 2 * Written by Pekka Paalanen, 2008-2009 <pq@iki.fi>
3 */ 3 */
4
5#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
6
4#include <linux/module.h> 7#include <linux/module.h>
5#include <linux/io.h> 8#include <linux/io.h>
6#include <linux/mmiotrace.h> 9#include <linux/mmiotrace.h>
7 10
8#define MODULE_NAME "testmmiotrace"
9
10static unsigned long mmio_address; 11static unsigned long mmio_address;
11module_param(mmio_address, ulong, 0); 12module_param(mmio_address, ulong, 0);
12MODULE_PARM_DESC(mmio_address, " Start address of the mapping of 16 kB " 13MODULE_PARM_DESC(mmio_address, " Start address of the mapping of 16 kB "
@@ -30,7 +31,7 @@ static unsigned v32(unsigned i)
30static void do_write_test(void __iomem *p) 31static void do_write_test(void __iomem *p)
31{ 32{
32 unsigned int i; 33 unsigned int i;
33 pr_info(MODULE_NAME ": write test.\n"); 34 pr_info("write test.\n");
34 mmiotrace_printk("Write test.\n"); 35 mmiotrace_printk("Write test.\n");
35 36
36 for (i = 0; i < 256; i++) 37 for (i = 0; i < 256; i++)
@@ -47,7 +48,7 @@ static void do_read_test(void __iomem *p)
47{ 48{
48 unsigned int i; 49 unsigned int i;
49 unsigned errs[3] = { 0 }; 50 unsigned errs[3] = { 0 };
50 pr_info(MODULE_NAME ": read test.\n"); 51 pr_info("read test.\n");
51 mmiotrace_printk("Read test.\n"); 52 mmiotrace_printk("Read test.\n");
52 53
53 for (i = 0; i < 256; i++) 54 for (i = 0; i < 256; i++)
@@ -68,7 +69,7 @@ static void do_read_test(void __iomem *p)
68 69
69static void do_read_far_test(void __iomem *p) 70static void do_read_far_test(void __iomem *p)
70{ 71{
71 pr_info(MODULE_NAME ": read far test.\n"); 72 pr_info("read far test.\n");
72 mmiotrace_printk("Read far test.\n"); 73 mmiotrace_printk("Read far test.\n");
73 74
74 ioread32(p + read_far); 75 ioread32(p + read_far);
@@ -78,7 +79,7 @@ static void do_test(unsigned long size)
78{ 79{
79 void __iomem *p = ioremap_nocache(mmio_address, size); 80 void __iomem *p = ioremap_nocache(mmio_address, size);
80 if (!p) { 81 if (!p) {
81 pr_err(MODULE_NAME ": could not ioremap, aborting.\n"); 82 pr_err("could not ioremap, aborting.\n");
82 return; 83 return;
83 } 84 }
84 mmiotrace_printk("ioremap returned %p.\n", p); 85 mmiotrace_printk("ioremap returned %p.\n", p);
@@ -94,24 +95,22 @@ static int __init init(void)
94 unsigned long size = (read_far) ? (8 << 20) : (16 << 10); 95 unsigned long size = (read_far) ? (8 << 20) : (16 << 10);
95 96
96 if (mmio_address == 0) { 97 if (mmio_address == 0) {
97 pr_err(MODULE_NAME ": you have to use the module argument " 98 pr_err("you have to use the module argument mmio_address.\n");
98 "mmio_address.\n"); 99 pr_err("DO NOT LOAD THIS MODULE UNLESS YOU REALLY KNOW WHAT YOU ARE DOING!\n");
99 pr_err(MODULE_NAME ": DO NOT LOAD THIS MODULE UNLESS"
100 " YOU REALLY KNOW WHAT YOU ARE DOING!\n");
101 return -ENXIO; 100 return -ENXIO;
102 } 101 }
103 102
104 pr_warning(MODULE_NAME ": WARNING: mapping %lu kB @ 0x%08lx in PCI " 103 pr_warning("WARNING: mapping %lu kB @ 0x%08lx in PCI address space, "
105 "address space, and writing 16 kB of rubbish in there.\n", 104 "and writing 16 kB of rubbish in there.\n",
106 size >> 10, mmio_address); 105 size >> 10, mmio_address);
107 do_test(size); 106 do_test(size);
108 pr_info(MODULE_NAME ": All done.\n"); 107 pr_info("All done.\n");
109 return 0; 108 return 0;
110} 109}
111 110
112static void __exit cleanup(void) 111static void __exit cleanup(void)
113{ 112{
114 pr_debug(MODULE_NAME ": unloaded.\n"); 113 pr_debug("unloaded.\n");
115} 114}
116 115
117module_init(init); 116module_init(init);
diff --git a/arch/x86/power/cpu.c b/arch/x86/power/cpu.c
index 8aa85f17667e..0a979f3e5b8a 100644
--- a/arch/x86/power/cpu.c
+++ b/arch/x86/power/cpu.c
@@ -18,6 +18,7 @@
18#include <asm/mce.h> 18#include <asm/mce.h>
19#include <asm/xcr.h> 19#include <asm/xcr.h>
20#include <asm/suspend.h> 20#include <asm/suspend.h>
21#include <asm/debugreg.h>
21 22
22#ifdef CONFIG_X86_32 23#ifdef CONFIG_X86_32
23static struct saved_context saved_context; 24static struct saved_context saved_context;
@@ -142,31 +143,6 @@ static void fix_processor_context(void)
142#endif 143#endif
143 load_TR_desc(); /* This does ltr */ 144 load_TR_desc(); /* This does ltr */
144 load_LDT(&current->active_mm->context); /* This does lldt */ 145 load_LDT(&current->active_mm->context); /* This does lldt */
145
146 /*
147 * Now maybe reload the debug registers
148 */
149 if (current->thread.debugreg7) {
150#ifdef CONFIG_X86_32
151 set_debugreg(current->thread.debugreg0, 0);
152 set_debugreg(current->thread.debugreg1, 1);
153 set_debugreg(current->thread.debugreg2, 2);
154 set_debugreg(current->thread.debugreg3, 3);
155 /* no 4 and 5 */
156 set_debugreg(current->thread.debugreg6, 6);
157 set_debugreg(current->thread.debugreg7, 7);
158#else
159 /* CONFIG_X86_64 */
160 loaddebug(&current->thread, 0);
161 loaddebug(&current->thread, 1);
162 loaddebug(&current->thread, 2);
163 loaddebug(&current->thread, 3);
164 /* no 4 and 5 */
165 loaddebug(&current->thread, 6);
166 loaddebug(&current->thread, 7);
167#endif
168 }
169
170} 146}
171 147
172/** 148/**
diff --git a/arch/x86/tools/Makefile b/arch/x86/tools/Makefile
new file mode 100644
index 000000000000..f82082677337
--- /dev/null
+++ b/arch/x86/tools/Makefile
@@ -0,0 +1,31 @@
1PHONY += posttest
2
3ifeq ($(KBUILD_VERBOSE),1)
4 posttest_verbose = -v
5else
6 posttest_verbose =
7endif
8
9ifeq ($(CONFIG_64BIT),y)
10 posttest_64bit = -y
11else
12 posttest_64bit = -n
13endif
14
15distill_awk = $(srctree)/arch/x86/tools/distill.awk
16chkobjdump = $(srctree)/arch/x86/tools/chkobjdump.awk
17
18quiet_cmd_posttest = TEST $@
19 cmd_posttest = ($(OBJDUMP) -v | $(AWK) -f $(chkobjdump)) || $(OBJDUMP) -d -j .text $(objtree)/vmlinux | $(AWK) -f $(distill_awk) | $(obj)/test_get_len $(posttest_64bit) $(posttest_verbose)
20
21posttest: $(obj)/test_get_len vmlinux
22 $(call cmd,posttest)
23
24hostprogs-y := test_get_len
25
26# -I needed for generated C source and C source which in the kernel tree.
27HOSTCFLAGS_test_get_len.o := -Wall -I$(objtree)/arch/x86/lib/ -I$(srctree)/arch/x86/include/ -I$(srctree)/arch/x86/lib/ -I$(srctree)/include/
28
29# Dependencies are also needed.
30$(obj)/test_get_len.o: $(srctree)/arch/x86/lib/insn.c $(srctree)/arch/x86/lib/inat.c $(srctree)/arch/x86/include/asm/inat_types.h $(srctree)/arch/x86/include/asm/inat.h $(srctree)/arch/x86/include/asm/insn.h $(objtree)/arch/x86/lib/inat-tables.c
31
diff --git a/arch/x86/tools/chkobjdump.awk b/arch/x86/tools/chkobjdump.awk
new file mode 100644
index 000000000000..0d13cd9fdcff
--- /dev/null
+++ b/arch/x86/tools/chkobjdump.awk
@@ -0,0 +1,23 @@
1# GNU objdump version checker
2#
3# Usage:
4# objdump -v | awk -f chkobjdump.awk
5BEGIN {
6 # objdump version 2.19 or later is OK for the test.
7 od_ver = 2;
8 od_sver = 19;
9}
10
11/^GNU/ {
12 split($4, ver, ".");
13 if (ver[1] > od_ver ||
14 (ver[1] == od_ver && ver[2] >= od_sver)) {
15 exit 1;
16 } else {
17 printf("Warning: objdump version %s is older than %d.%d\n",
18 $4, od_ver, od_sver);
19 print("Warning: Skipping posttest.");
20 # Logic is inverted, because we just skip test without error.
21 exit 0;
22 }
23}
diff --git a/arch/x86/tools/distill.awk b/arch/x86/tools/distill.awk
new file mode 100644
index 000000000000..c13c0ee48ab4
--- /dev/null
+++ b/arch/x86/tools/distill.awk
@@ -0,0 +1,47 @@
1#!/bin/awk -f
2# Usage: objdump -d a.out | awk -f distill.awk | ./test_get_len
3# Distills the disassembly as follows:
4# - Removes all lines except the disassembled instructions.
5# - For instructions that exceed 1 line (7 bytes), crams all the hex bytes
6# into a single line.
7# - Remove bad(or prefix only) instructions
8
9BEGIN {
10 prev_addr = ""
11 prev_hex = ""
12 prev_mnemonic = ""
13 bad_expr = "(\\(bad\\)|^rex|^.byte|^rep(z|nz)$|^lock$|^es$|^cs$|^ss$|^ds$|^fs$|^gs$|^data(16|32)$|^addr(16|32|64))"
14 fwait_expr = "^9b "
15 fwait_str="9b\tfwait"
16}
17
18/^ *[0-9a-f]+ <[^>]*>:/ {
19 # Symbol entry
20 printf("%s%s\n", $2, $1)
21}
22
23/^ *[0-9a-f]+:/ {
24 if (split($0, field, "\t") < 3) {
25 # This is a continuation of the same insn.
26 prev_hex = prev_hex field[2]
27 } else {
28 # Skip bad instructions
29 if (match(prev_mnemonic, bad_expr))
30 prev_addr = ""
31 # Split fwait from other f* instructions
32 if (match(prev_hex, fwait_expr) && prev_mnemonic != "fwait") {
33 printf "%s\t%s\n", prev_addr, fwait_str
34 sub(fwait_expr, "", prev_hex)
35 }
36 if (prev_addr != "")
37 printf "%s\t%s\t%s\n", prev_addr, prev_hex, prev_mnemonic
38 prev_addr = field[1]
39 prev_hex = field[2]
40 prev_mnemonic = field[3]
41 }
42}
43
44END {
45 if (prev_addr != "")
46 printf "%s\t%s\t%s\n", prev_addr, prev_hex, prev_mnemonic
47}
diff --git a/arch/x86/tools/gen-insn-attr-x86.awk b/arch/x86/tools/gen-insn-attr-x86.awk
new file mode 100644
index 000000000000..e34e92a28eb6
--- /dev/null
+++ b/arch/x86/tools/gen-insn-attr-x86.awk
@@ -0,0 +1,380 @@
1#!/bin/awk -f
2# gen-insn-attr-x86.awk: Instruction attribute table generator
3# Written by Masami Hiramatsu <mhiramat@redhat.com>
4#
5# Usage: awk -f gen-insn-attr-x86.awk x86-opcode-map.txt > inat-tables.c
6
7# Awk implementation sanity check
8function check_awk_implement() {
9 if (!match("abc", "[[:lower:]]+"))
10 return "Your awk doesn't support charactor-class."
11 if (sprintf("%x", 0) != "0")
12 return "Your awk has a printf-format problem."
13 return ""
14}
15
16# Clear working vars
17function clear_vars() {
18 delete table
19 delete lptable2
20 delete lptable1
21 delete lptable3
22 eid = -1 # escape id
23 gid = -1 # group id
24 aid = -1 # AVX id
25 tname = ""
26}
27
28BEGIN {
29 # Implementation error checking
30 awkchecked = check_awk_implement()
31 if (awkchecked != "") {
32 print "Error: " awkchecked > "/dev/stderr"
33 print "Please try to use gawk." > "/dev/stderr"
34 exit 1
35 }
36
37 # Setup generating tables
38 print "/* x86 opcode map generated from x86-opcode-map.txt */"
39 print "/* Do not change this code. */\n"
40 ggid = 1
41 geid = 1
42 gaid = 0
43 delete etable
44 delete gtable
45 delete atable
46
47 opnd_expr = "^[[:alpha:]/]"
48 ext_expr = "^\\("
49 sep_expr = "^\\|$"
50 group_expr = "^Grp[[:alnum:]]+"
51
52 imm_expr = "^[IJAO][[:lower:]]"
53 imm_flag["Ib"] = "INAT_MAKE_IMM(INAT_IMM_BYTE)"
54 imm_flag["Jb"] = "INAT_MAKE_IMM(INAT_IMM_BYTE)"
55 imm_flag["Iw"] = "INAT_MAKE_IMM(INAT_IMM_WORD)"
56 imm_flag["Id"] = "INAT_MAKE_IMM(INAT_IMM_DWORD)"
57 imm_flag["Iq"] = "INAT_MAKE_IMM(INAT_IMM_QWORD)"
58 imm_flag["Ap"] = "INAT_MAKE_IMM(INAT_IMM_PTR)"
59 imm_flag["Iz"] = "INAT_MAKE_IMM(INAT_IMM_VWORD32)"
60 imm_flag["Jz"] = "INAT_MAKE_IMM(INAT_IMM_VWORD32)"
61 imm_flag["Iv"] = "INAT_MAKE_IMM(INAT_IMM_VWORD)"
62 imm_flag["Ob"] = "INAT_MOFFSET"
63 imm_flag["Ov"] = "INAT_MOFFSET"
64
65 modrm_expr = "^([CDEGMNPQRSUVW/][[:lower:]]+|NTA|T[012])"
66 force64_expr = "\\([df]64\\)"
67 rex_expr = "^REX(\\.[XRWB]+)*"
68 fpu_expr = "^ESC" # TODO
69
70 lprefix1_expr = "\\(66\\)"
71 lprefix2_expr = "\\(F3\\)"
72 lprefix3_expr = "\\(F2\\)"
73 max_lprefix = 4
74
75 vexok_expr = "\\(VEX\\)"
76 vexonly_expr = "\\(oVEX\\)"
77
78 prefix_expr = "\\(Prefix\\)"
79 prefix_num["Operand-Size"] = "INAT_PFX_OPNDSZ"
80 prefix_num["REPNE"] = "INAT_PFX_REPNE"
81 prefix_num["REP/REPE"] = "INAT_PFX_REPE"
82 prefix_num["LOCK"] = "INAT_PFX_LOCK"
83 prefix_num["SEG=CS"] = "INAT_PFX_CS"
84 prefix_num["SEG=DS"] = "INAT_PFX_DS"
85 prefix_num["SEG=ES"] = "INAT_PFX_ES"
86 prefix_num["SEG=FS"] = "INAT_PFX_FS"
87 prefix_num["SEG=GS"] = "INAT_PFX_GS"
88 prefix_num["SEG=SS"] = "INAT_PFX_SS"
89 prefix_num["Address-Size"] = "INAT_PFX_ADDRSZ"
90 prefix_num["2bytes-VEX"] = "INAT_PFX_VEX2"
91 prefix_num["3bytes-VEX"] = "INAT_PFX_VEX3"
92
93 clear_vars()
94}
95
96function semantic_error(msg) {
97 print "Semantic error at " NR ": " msg > "/dev/stderr"
98 exit 1
99}
100
101function debug(msg) {
102 print "DEBUG: " msg
103}
104
105function array_size(arr, i,c) {
106 c = 0
107 for (i in arr)
108 c++
109 return c
110}
111
112/^Table:/ {
113 print "/* " $0 " */"
114 if (tname != "")
115 semantic_error("Hit Table: before EndTable:.");
116}
117
118/^Referrer:/ {
119 if (NF != 1) {
120 # escape opcode table
121 ref = ""
122 for (i = 2; i <= NF; i++)
123 ref = ref $i
124 eid = escape[ref]
125 tname = sprintf("inat_escape_table_%d", eid)
126 }
127}
128
129/^AVXcode:/ {
130 if (NF != 1) {
131 # AVX/escape opcode table
132 aid = $2
133 if (gaid <= aid)
134 gaid = aid + 1
135 if (tname == "") # AVX only opcode table
136 tname = sprintf("inat_avx_table_%d", $2)
137 }
138 if (aid == -1 && eid == -1) # primary opcode table
139 tname = "inat_primary_table"
140}
141
142/^GrpTable:/ {
143 print "/* " $0 " */"
144 if (!($2 in group))
145 semantic_error("No group: " $2 )
146 gid = group[$2]
147 tname = "inat_group_table_" gid
148}
149
150function print_table(tbl,name,fmt,n)
151{
152 print "const insn_attr_t " name " = {"
153 for (i = 0; i < n; i++) {
154 id = sprintf(fmt, i)
155 if (tbl[id])
156 print " [" id "] = " tbl[id] ","
157 }
158 print "};"
159}
160
161/^EndTable/ {
162 if (gid != -1) {
163 # print group tables
164 if (array_size(table) != 0) {
165 print_table(table, tname "[INAT_GROUP_TABLE_SIZE]",
166 "0x%x", 8)
167 gtable[gid,0] = tname
168 }
169 if (array_size(lptable1) != 0) {
170 print_table(lptable1, tname "_1[INAT_GROUP_TABLE_SIZE]",
171 "0x%x", 8)
172 gtable[gid,1] = tname "_1"
173 }
174 if (array_size(lptable2) != 0) {
175 print_table(lptable2, tname "_2[INAT_GROUP_TABLE_SIZE]",
176 "0x%x", 8)
177 gtable[gid,2] = tname "_2"
178 }
179 if (array_size(lptable3) != 0) {
180 print_table(lptable3, tname "_3[INAT_GROUP_TABLE_SIZE]",
181 "0x%x", 8)
182 gtable[gid,3] = tname "_3"
183 }
184 } else {
185 # print primary/escaped tables
186 if (array_size(table) != 0) {
187 print_table(table, tname "[INAT_OPCODE_TABLE_SIZE]",
188 "0x%02x", 256)
189 etable[eid,0] = tname
190 if (aid >= 0)
191 atable[aid,0] = tname
192 }
193 if (array_size(lptable1) != 0) {
194 print_table(lptable1,tname "_1[INAT_OPCODE_TABLE_SIZE]",
195 "0x%02x", 256)
196 etable[eid,1] = tname "_1"
197 if (aid >= 0)
198 atable[aid,1] = tname "_1"
199 }
200 if (array_size(lptable2) != 0) {
201 print_table(lptable2,tname "_2[INAT_OPCODE_TABLE_SIZE]",
202 "0x%02x", 256)
203 etable[eid,2] = tname "_2"
204 if (aid >= 0)
205 atable[aid,2] = tname "_2"
206 }
207 if (array_size(lptable3) != 0) {
208 print_table(lptable3,tname "_3[INAT_OPCODE_TABLE_SIZE]",
209 "0x%02x", 256)
210 etable[eid,3] = tname "_3"
211 if (aid >= 0)
212 atable[aid,3] = tname "_3"
213 }
214 }
215 print ""
216 clear_vars()
217}
218
219function add_flags(old,new) {
220 if (old && new)
221 return old " | " new
222 else if (old)
223 return old
224 else
225 return new
226}
227
228# convert operands to flags.
229function convert_operands(opnd, i,imm,mod)
230{
231 imm = null
232 mod = null
233 for (i in opnd) {
234 i = opnd[i]
235 if (match(i, imm_expr) == 1) {
236 if (!imm_flag[i])
237 semantic_error("Unknown imm opnd: " i)
238 if (imm) {
239 if (i != "Ib")
240 semantic_error("Second IMM error")
241 imm = add_flags(imm, "INAT_SCNDIMM")
242 } else
243 imm = imm_flag[i]
244 } else if (match(i, modrm_expr))
245 mod = "INAT_MODRM"
246 }
247 return add_flags(imm, mod)
248}
249
250/^[0-9a-f]+\:/ {
251 if (NR == 1)
252 next
253 # get index
254 idx = "0x" substr($1, 1, index($1,":") - 1)
255 if (idx in table)
256 semantic_error("Redefine " idx " in " tname)
257
258 # check if escaped opcode
259 if ("escape" == $2) {
260 if ($3 != "#")
261 semantic_error("No escaped name")
262 ref = ""
263 for (i = 4; i <= NF; i++)
264 ref = ref $i
265 if (ref in escape)
266 semantic_error("Redefine escape (" ref ")")
267 escape[ref] = geid
268 geid++
269 table[idx] = "INAT_MAKE_ESCAPE(" escape[ref] ")"
270 next
271 }
272
273 variant = null
274 # converts
275 i = 2
276 while (i <= NF) {
277 opcode = $(i++)
278 delete opnds
279 ext = null
280 flags = null
281 opnd = null
282 # parse one opcode
283 if (match($i, opnd_expr)) {
284 opnd = $i
285 split($(i++), opnds, ",")
286 flags = convert_operands(opnds)
287 }
288 if (match($i, ext_expr))
289 ext = $(i++)
290 if (match($i, sep_expr))
291 i++
292 else if (i < NF)
293 semantic_error($i " is not a separator")
294
295 # check if group opcode
296 if (match(opcode, group_expr)) {
297 if (!(opcode in group)) {
298 group[opcode] = ggid
299 ggid++
300 }
301 flags = add_flags(flags, "INAT_MAKE_GROUP(" group[opcode] ")")
302 }
303 # check force(or default) 64bit
304 if (match(ext, force64_expr))
305 flags = add_flags(flags, "INAT_FORCE64")
306
307 # check REX prefix
308 if (match(opcode, rex_expr))
309 flags = add_flags(flags, "INAT_MAKE_PREFIX(INAT_PFX_REX)")
310
311 # check coprocessor escape : TODO
312 if (match(opcode, fpu_expr))
313 flags = add_flags(flags, "INAT_MODRM")
314
315 # check VEX only code
316 if (match(ext, vexonly_expr))
317 flags = add_flags(flags, "INAT_VEXOK | INAT_VEXONLY")
318
319 # check VEX only code
320 if (match(ext, vexok_expr))
321 flags = add_flags(flags, "INAT_VEXOK")
322
323 # check prefixes
324 if (match(ext, prefix_expr)) {
325 if (!prefix_num[opcode])
326 semantic_error("Unknown prefix: " opcode)
327 flags = add_flags(flags, "INAT_MAKE_PREFIX(" prefix_num[opcode] ")")
328 }
329 if (length(flags) == 0)
330 continue
331 # check if last prefix
332 if (match(ext, lprefix1_expr)) {
333 lptable1[idx] = add_flags(lptable1[idx],flags)
334 variant = "INAT_VARIANT"
335 } else if (match(ext, lprefix2_expr)) {
336 lptable2[idx] = add_flags(lptable2[idx],flags)
337 variant = "INAT_VARIANT"
338 } else if (match(ext, lprefix3_expr)) {
339 lptable3[idx] = add_flags(lptable3[idx],flags)
340 variant = "INAT_VARIANT"
341 } else {
342 table[idx] = add_flags(table[idx],flags)
343 }
344 }
345 if (variant)
346 table[idx] = add_flags(table[idx],variant)
347}
348
349END {
350 if (awkchecked != "")
351 exit 1
352 # print escape opcode map's array
353 print "/* Escape opcode map array */"
354 print "const insn_attr_t const *inat_escape_tables[INAT_ESC_MAX + 1]" \
355 "[INAT_LSTPFX_MAX + 1] = {"
356 for (i = 0; i < geid; i++)
357 for (j = 0; j < max_lprefix; j++)
358 if (etable[i,j])
359 print " ["i"]["j"] = "etable[i,j]","
360 print "};\n"
361 # print group opcode map's array
362 print "/* Group opcode map array */"
363 print "const insn_attr_t const *inat_group_tables[INAT_GRP_MAX + 1]"\
364 "[INAT_LSTPFX_MAX + 1] = {"
365 for (i = 0; i < ggid; i++)
366 for (j = 0; j < max_lprefix; j++)
367 if (gtable[i,j])
368 print " ["i"]["j"] = "gtable[i,j]","
369 print "};\n"
370 # print AVX opcode map's array
371 print "/* AVX opcode map array */"
372 print "const insn_attr_t const *inat_avx_tables[X86_VEX_M_MAX + 1]"\
373 "[INAT_LSTPFX_MAX + 1] = {"
374 for (i = 0; i < gaid; i++)
375 for (j = 0; j < max_lprefix; j++)
376 if (atable[i,j])
377 print " ["i"]["j"] = "atable[i,j]","
378 print "};"
379}
380
diff --git a/arch/x86/tools/test_get_len.c b/arch/x86/tools/test_get_len.c
new file mode 100644
index 000000000000..d8214dc03fa7
--- /dev/null
+++ b/arch/x86/tools/test_get_len.c
@@ -0,0 +1,173 @@
1/*
2 * This program is free software; you can redistribute it and/or modify
3 * it under the terms of the GNU General Public License as published by
4 * the Free Software Foundation; either version 2 of the License, or
5 * (at your option) any later version.
6 *
7 * This program is distributed in the hope that it will be useful,
8 * but WITHOUT ANY WARRANTY; without even the implied warranty of
9 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10 * GNU General Public License for more details.
11 *
12 * You should have received a copy of the GNU General Public License
13 * along with this program; if not, write to the Free Software
14 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
15 *
16 * Copyright (C) IBM Corporation, 2009
17 */
18
19#include <stdlib.h>
20#include <stdio.h>
21#include <string.h>
22#include <assert.h>
23#include <unistd.h>
24
25#define unlikely(cond) (cond)
26
27#include <asm/insn.h>
28#include <inat.c>
29#include <insn.c>
30
31/*
32 * Test of instruction analysis in general and insn_get_length() in
33 * particular. See if insn_get_length() and the disassembler agree
34 * on the length of each instruction in an elf disassembly.
35 *
36 * Usage: objdump -d a.out | awk -f distill.awk | ./test_get_len
37 */
38
39const char *prog;
40static int verbose;
41static int x86_64;
42
43static void usage(void)
44{
45 fprintf(stderr, "Usage: objdump -d a.out | awk -f distill.awk |"
46 " %s [-y|-n] [-v] \n", prog);
47 fprintf(stderr, "\t-y 64bit mode\n");
48 fprintf(stderr, "\t-n 32bit mode\n");
49 fprintf(stderr, "\t-v verbose mode\n");
50 exit(1);
51}
52
53static void malformed_line(const char *line, int line_nr)
54{
55 fprintf(stderr, "%s: malformed line %d:\n%s", prog, line_nr, line);
56 exit(3);
57}
58
59static void dump_field(FILE *fp, const char *name, const char *indent,
60 struct insn_field *field)
61{
62 fprintf(fp, "%s.%s = {\n", indent, name);
63 fprintf(fp, "%s\t.value = %d, bytes[] = {%x, %x, %x, %x},\n",
64 indent, field->value, field->bytes[0], field->bytes[1],
65 field->bytes[2], field->bytes[3]);
66 fprintf(fp, "%s\t.got = %d, .nbytes = %d},\n", indent,
67 field->got, field->nbytes);
68}
69
70static void dump_insn(FILE *fp, struct insn *insn)
71{
72 fprintf(fp, "Instruction = { \n");
73 dump_field(fp, "prefixes", "\t", &insn->prefixes);
74 dump_field(fp, "rex_prefix", "\t", &insn->rex_prefix);
75 dump_field(fp, "vex_prefix", "\t", &insn->vex_prefix);
76 dump_field(fp, "opcode", "\t", &insn->opcode);
77 dump_field(fp, "modrm", "\t", &insn->modrm);
78 dump_field(fp, "sib", "\t", &insn->sib);
79 dump_field(fp, "displacement", "\t", &insn->displacement);
80 dump_field(fp, "immediate1", "\t", &insn->immediate1);
81 dump_field(fp, "immediate2", "\t", &insn->immediate2);
82 fprintf(fp, "\t.attr = %x, .opnd_bytes = %d, .addr_bytes = %d,\n",
83 insn->attr, insn->opnd_bytes, insn->addr_bytes);
84 fprintf(fp, "\t.length = %d, .x86_64 = %d, .kaddr = %p}\n",
85 insn->length, insn->x86_64, insn->kaddr);
86}
87
88static void parse_args(int argc, char **argv)
89{
90 int c;
91 prog = argv[0];
92 while ((c = getopt(argc, argv, "ynv")) != -1) {
93 switch (c) {
94 case 'y':
95 x86_64 = 1;
96 break;
97 case 'n':
98 x86_64 = 0;
99 break;
100 case 'v':
101 verbose = 1;
102 break;
103 default:
104 usage();
105 }
106 }
107}
108
109#define BUFSIZE 256
110
111int main(int argc, char **argv)
112{
113 char line[BUFSIZE], sym[BUFSIZE] = "<unknown>";
114 unsigned char insn_buf[16];
115 struct insn insn;
116 int insns = 0, c;
117 int warnings = 0;
118
119 parse_args(argc, argv);
120
121 while (fgets(line, BUFSIZE, stdin)) {
122 char copy[BUFSIZE], *s, *tab1, *tab2;
123 int nb = 0;
124 unsigned int b;
125
126 if (line[0] == '<') {
127 /* Symbol line */
128 strcpy(sym, line);
129 continue;
130 }
131
132 insns++;
133 memset(insn_buf, 0, 16);
134 strcpy(copy, line);
135 tab1 = strchr(copy, '\t');
136 if (!tab1)
137 malformed_line(line, insns);
138 s = tab1 + 1;
139 s += strspn(s, " ");
140 tab2 = strchr(s, '\t');
141 if (!tab2)
142 malformed_line(line, insns);
143 *tab2 = '\0'; /* Characters beyond tab2 aren't examined */
144 while (s < tab2) {
145 if (sscanf(s, "%x", &b) == 1) {
146 insn_buf[nb++] = (unsigned char) b;
147 s += 3;
148 } else
149 break;
150 }
151 /* Decode an instruction */
152 insn_init(&insn, insn_buf, x86_64);
153 insn_get_length(&insn);
154 if (insn.length != nb) {
155 warnings++;
156 fprintf(stderr, "Warning: %s found difference at %s\n",
157 prog, sym);
158 fprintf(stderr, "Warning: %s", line);
159 fprintf(stderr, "Warning: objdump says %d bytes, but "
160 "insn_get_length() says %d\n", nb,
161 insn.length);
162 if (verbose)
163 dump_insn(stderr, &insn);
164 }
165 }
166 if (warnings)
167 fprintf(stderr, "Warning: decoded and checked %d"
168 " instructions with %d warnings\n", insns, warnings);
169 else
170 fprintf(stderr, "Succeed: decoded and checked %d"
171 " instructions\n", insns);
172 return 0;
173}
diff --git a/arch/x86/xen/enlighten.c b/arch/x86/xen/enlighten.c
index 23a4d80fb39e..dfbf70e65860 100644
--- a/arch/x86/xen/enlighten.c
+++ b/arch/x86/xen/enlighten.c
@@ -178,6 +178,7 @@ static __read_mostly unsigned int cpuid_leaf1_ecx_mask = ~0;
178static void xen_cpuid(unsigned int *ax, unsigned int *bx, 178static void xen_cpuid(unsigned int *ax, unsigned int *bx,
179 unsigned int *cx, unsigned int *dx) 179 unsigned int *cx, unsigned int *dx)
180{ 180{
181 unsigned maskebx = ~0;
181 unsigned maskecx = ~0; 182 unsigned maskecx = ~0;
182 unsigned maskedx = ~0; 183 unsigned maskedx = ~0;
183 184
@@ -185,9 +186,16 @@ static void xen_cpuid(unsigned int *ax, unsigned int *bx,
185 * Mask out inconvenient features, to try and disable as many 186 * Mask out inconvenient features, to try and disable as many
186 * unsupported kernel subsystems as possible. 187 * unsupported kernel subsystems as possible.
187 */ 188 */
188 if (*ax == 1) { 189 switch (*ax) {
190 case 1:
189 maskecx = cpuid_leaf1_ecx_mask; 191 maskecx = cpuid_leaf1_ecx_mask;
190 maskedx = cpuid_leaf1_edx_mask; 192 maskedx = cpuid_leaf1_edx_mask;
193 break;
194
195 case 0xb:
196 /* Suppress extended topology stuff */
197 maskebx = 0;
198 break;
191 } 199 }
192 200
193 asm(XEN_EMULATE_PREFIX "cpuid" 201 asm(XEN_EMULATE_PREFIX "cpuid"
@@ -197,6 +205,7 @@ static void xen_cpuid(unsigned int *ax, unsigned int *bx,
197 "=d" (*dx) 205 "=d" (*dx)
198 : "0" (*ax), "2" (*cx)); 206 : "0" (*ax), "2" (*cx));
199 207
208 *bx &= maskebx;
200 *cx &= maskecx; 209 *cx &= maskecx;
201 *dx &= maskedx; 210 *dx &= maskedx;
202} 211}
diff --git a/block/cfq-iosched.c b/block/cfq-iosched.c
index 069a61017c02..aa1e9535e358 100644
--- a/block/cfq-iosched.c
+++ b/block/cfq-iosched.c
@@ -196,6 +196,7 @@ enum cfqq_state_flags {
196 CFQ_CFQQ_FLAG_slice_new, /* no requests dispatched in slice */ 196 CFQ_CFQQ_FLAG_slice_new, /* no requests dispatched in slice */
197 CFQ_CFQQ_FLAG_sync, /* synchronous queue */ 197 CFQ_CFQQ_FLAG_sync, /* synchronous queue */
198 CFQ_CFQQ_FLAG_coop, /* has done a coop jump of the queue */ 198 CFQ_CFQQ_FLAG_coop, /* has done a coop jump of the queue */
199 CFQ_CFQQ_FLAG_coop_preempt, /* coop preempt */
199}; 200};
200 201
201#define CFQ_CFQQ_FNS(name) \ 202#define CFQ_CFQQ_FNS(name) \
@@ -222,6 +223,7 @@ CFQ_CFQQ_FNS(prio_changed);
222CFQ_CFQQ_FNS(slice_new); 223CFQ_CFQQ_FNS(slice_new);
223CFQ_CFQQ_FNS(sync); 224CFQ_CFQQ_FNS(sync);
224CFQ_CFQQ_FNS(coop); 225CFQ_CFQQ_FNS(coop);
226CFQ_CFQQ_FNS(coop_preempt);
225#undef CFQ_CFQQ_FNS 227#undef CFQ_CFQQ_FNS
226 228
227#define cfq_log_cfqq(cfqd, cfqq, fmt, args...) \ 229#define cfq_log_cfqq(cfqd, cfqq, fmt, args...) \
@@ -945,10 +947,13 @@ static struct cfq_queue *cfq_set_active_queue(struct cfq_data *cfqd,
945{ 947{
946 if (!cfqq) { 948 if (!cfqq) {
947 cfqq = cfq_get_next_queue(cfqd); 949 cfqq = cfq_get_next_queue(cfqd);
948 if (cfqq) 950 if (cfqq && !cfq_cfqq_coop_preempt(cfqq))
949 cfq_clear_cfqq_coop(cfqq); 951 cfq_clear_cfqq_coop(cfqq);
950 } 952 }
951 953
954 if (cfqq)
955 cfq_clear_cfqq_coop_preempt(cfqq);
956
952 __cfq_set_active_queue(cfqd, cfqq); 957 __cfq_set_active_queue(cfqd, cfqq);
953 return cfqq; 958 return cfqq;
954} 959}
@@ -2051,7 +2056,7 @@ cfq_should_preempt(struct cfq_data *cfqd, struct cfq_queue *new_cfqq,
2051 * it's a metadata request and the current queue is doing regular IO. 2056 * it's a metadata request and the current queue is doing regular IO.
2052 */ 2057 */
2053 if (rq_is_meta(rq) && !cfqq->meta_pending) 2058 if (rq_is_meta(rq) && !cfqq->meta_pending)
2054 return false; 2059 return true;
2055 2060
2056 /* 2061 /*
2057 * Allow an RT request to pre-empt an ongoing non-RT cfqq timeslice. 2062 * Allow an RT request to pre-empt an ongoing non-RT cfqq timeslice.
@@ -2066,8 +2071,16 @@ cfq_should_preempt(struct cfq_data *cfqd, struct cfq_queue *new_cfqq,
2066 * if this request is as-good as one we would expect from the 2071 * if this request is as-good as one we would expect from the
2067 * current cfqq, let it preempt 2072 * current cfqq, let it preempt
2068 */ 2073 */
2069 if (cfq_rq_close(cfqd, rq)) 2074 if (cfq_rq_close(cfqd, rq) && (!cfq_cfqq_coop(new_cfqq) ||
2075 cfqd->busy_queues == 1)) {
2076 /*
2077 * Mark new queue coop_preempt, so its coop flag will not be
2078 * cleared when new queue gets scheduled at the very first time
2079 */
2080 cfq_mark_cfqq_coop_preempt(new_cfqq);
2081 cfq_mark_cfqq_coop(new_cfqq);
2070 return true; 2082 return true;
2083 }
2071 2084
2072 return false; 2085 return false;
2073} 2086}
diff --git a/crypto/async_tx/Kconfig b/crypto/async_tx/Kconfig
index e5aeb2b79e6f..e28e276ac611 100644
--- a/crypto/async_tx/Kconfig
+++ b/crypto/async_tx/Kconfig
@@ -23,3 +23,8 @@ config ASYNC_RAID6_RECOV
23 select ASYNC_CORE 23 select ASYNC_CORE
24 select ASYNC_PQ 24 select ASYNC_PQ
25 25
26config ASYNC_TX_DISABLE_PQ_VAL_DMA
27 bool
28
29config ASYNC_TX_DISABLE_XOR_VAL_DMA
30 bool
diff --git a/crypto/async_tx/async_pq.c b/crypto/async_tx/async_pq.c
index 6b5cc4fba59f..ec87f53d5059 100644
--- a/crypto/async_tx/async_pq.c
+++ b/crypto/async_tx/async_pq.c
@@ -240,6 +240,16 @@ async_gen_syndrome(struct page **blocks, unsigned int offset, int disks,
240} 240}
241EXPORT_SYMBOL_GPL(async_gen_syndrome); 241EXPORT_SYMBOL_GPL(async_gen_syndrome);
242 242
243static inline struct dma_chan *
244pq_val_chan(struct async_submit_ctl *submit, struct page **blocks, int disks, size_t len)
245{
246 #ifdef CONFIG_ASYNC_TX_DISABLE_PQ_VAL_DMA
247 return NULL;
248 #endif
249 return async_tx_find_channel(submit, DMA_PQ_VAL, NULL, 0, blocks,
250 disks, len);
251}
252
243/** 253/**
244 * async_syndrome_val - asynchronously validate a raid6 syndrome 254 * async_syndrome_val - asynchronously validate a raid6 syndrome
245 * @blocks: source blocks from idx 0..disks-3, P @ disks-2 and Q @ disks-1 255 * @blocks: source blocks from idx 0..disks-3, P @ disks-2 and Q @ disks-1
@@ -260,9 +270,7 @@ async_syndrome_val(struct page **blocks, unsigned int offset, int disks,
260 size_t len, enum sum_check_flags *pqres, struct page *spare, 270 size_t len, enum sum_check_flags *pqres, struct page *spare,
261 struct async_submit_ctl *submit) 271 struct async_submit_ctl *submit)
262{ 272{
263 struct dma_chan *chan = async_tx_find_channel(submit, DMA_PQ_VAL, 273 struct dma_chan *chan = pq_val_chan(submit, blocks, disks, len);
264 NULL, 0, blocks, disks,
265 len);
266 struct dma_device *device = chan ? chan->device : NULL; 274 struct dma_device *device = chan ? chan->device : NULL;
267 struct dma_async_tx_descriptor *tx; 275 struct dma_async_tx_descriptor *tx;
268 unsigned char coefs[disks-2]; 276 unsigned char coefs[disks-2];
diff --git a/crypto/async_tx/async_xor.c b/crypto/async_tx/async_xor.c
index 79182dcb91b7..079ae8ca590b 100644
--- a/crypto/async_tx/async_xor.c
+++ b/crypto/async_tx/async_xor.c
@@ -234,6 +234,17 @@ static int page_is_zero(struct page *p, unsigned int offset, size_t len)
234 memcmp(a, a + 4, len - 4) == 0); 234 memcmp(a, a + 4, len - 4) == 0);
235} 235}
236 236
237static inline struct dma_chan *
238xor_val_chan(struct async_submit_ctl *submit, struct page *dest,
239 struct page **src_list, int src_cnt, size_t len)
240{
241 #ifdef CONFIG_ASYNC_TX_DISABLE_XOR_VAL_DMA
242 return NULL;
243 #endif
244 return async_tx_find_channel(submit, DMA_XOR_VAL, &dest, 1, src_list,
245 src_cnt, len);
246}
247
237/** 248/**
238 * async_xor_val - attempt a xor parity check with a dma engine. 249 * async_xor_val - attempt a xor parity check with a dma engine.
239 * @dest: destination page used if the xor is performed synchronously 250 * @dest: destination page used if the xor is performed synchronously
@@ -255,9 +266,7 @@ async_xor_val(struct page *dest, struct page **src_list, unsigned int offset,
255 int src_cnt, size_t len, enum sum_check_flags *result, 266 int src_cnt, size_t len, enum sum_check_flags *result,
256 struct async_submit_ctl *submit) 267 struct async_submit_ctl *submit)
257{ 268{
258 struct dma_chan *chan = async_tx_find_channel(submit, DMA_XOR_VAL, 269 struct dma_chan *chan = xor_val_chan(submit, dest, src_list, src_cnt, len);
259 &dest, 1, src_list,
260 src_cnt, len);
261 struct dma_device *device = chan ? chan->device : NULL; 270 struct dma_device *device = chan ? chan->device : NULL;
262 struct dma_async_tx_descriptor *tx = NULL; 271 struct dma_async_tx_descriptor *tx = NULL;
263 dma_addr_t *dma_src = NULL; 272 dma_addr_t *dma_src = NULL;
diff --git a/crypto/gcm.c b/crypto/gcm.c
index 5fc3292483ef..c6547130624c 100644
--- a/crypto/gcm.c
+++ b/crypto/gcm.c
@@ -40,7 +40,7 @@ struct crypto_rfc4106_ctx {
40struct crypto_gcm_ghash_ctx { 40struct crypto_gcm_ghash_ctx {
41 unsigned int cryptlen; 41 unsigned int cryptlen;
42 struct scatterlist *src; 42 struct scatterlist *src;
43 crypto_completion_t complete; 43 void (*complete)(struct aead_request *req, int err);
44}; 44};
45 45
46struct crypto_gcm_req_priv_ctx { 46struct crypto_gcm_req_priv_ctx {
@@ -267,23 +267,26 @@ static int gcm_hash_final(struct aead_request *req,
267 return crypto_ahash_final(ahreq); 267 return crypto_ahash_final(ahreq);
268} 268}
269 269
270static void gcm_hash_final_done(struct crypto_async_request *areq, 270static void __gcm_hash_final_done(struct aead_request *req, int err)
271 int err)
272{ 271{
273 struct aead_request *req = areq->data;
274 struct crypto_gcm_req_priv_ctx *pctx = crypto_gcm_reqctx(req); 272 struct crypto_gcm_req_priv_ctx *pctx = crypto_gcm_reqctx(req);
275 struct crypto_gcm_ghash_ctx *gctx = &pctx->ghash_ctx; 273 struct crypto_gcm_ghash_ctx *gctx = &pctx->ghash_ctx;
276 274
277 if (!err) 275 if (!err)
278 crypto_xor(pctx->auth_tag, pctx->iauth_tag, 16); 276 crypto_xor(pctx->auth_tag, pctx->iauth_tag, 16);
279 277
280 gctx->complete(areq, err); 278 gctx->complete(req, err);
281} 279}
282 280
283static void gcm_hash_len_done(struct crypto_async_request *areq, 281static void gcm_hash_final_done(struct crypto_async_request *areq, int err)
284 int err)
285{ 282{
286 struct aead_request *req = areq->data; 283 struct aead_request *req = areq->data;
284
285 __gcm_hash_final_done(req, err);
286}
287
288static void __gcm_hash_len_done(struct aead_request *req, int err)
289{
287 struct crypto_gcm_req_priv_ctx *pctx = crypto_gcm_reqctx(req); 290 struct crypto_gcm_req_priv_ctx *pctx = crypto_gcm_reqctx(req);
288 291
289 if (!err) { 292 if (!err) {
@@ -292,13 +295,18 @@ static void gcm_hash_len_done(struct crypto_async_request *areq,
292 return; 295 return;
293 } 296 }
294 297
295 gcm_hash_final_done(areq, err); 298 __gcm_hash_final_done(req, err);
296} 299}
297 300
298static void gcm_hash_crypt_remain_done(struct crypto_async_request *areq, 301static void gcm_hash_len_done(struct crypto_async_request *areq, int err)
299 int err)
300{ 302{
301 struct aead_request *req = areq->data; 303 struct aead_request *req = areq->data;
304
305 __gcm_hash_len_done(req, err);
306}
307
308static void __gcm_hash_crypt_remain_done(struct aead_request *req, int err)
309{
302 struct crypto_gcm_req_priv_ctx *pctx = crypto_gcm_reqctx(req); 310 struct crypto_gcm_req_priv_ctx *pctx = crypto_gcm_reqctx(req);
303 311
304 if (!err) { 312 if (!err) {
@@ -307,13 +315,19 @@ static void gcm_hash_crypt_remain_done(struct crypto_async_request *areq,
307 return; 315 return;
308 } 316 }
309 317
310 gcm_hash_len_done(areq, err); 318 __gcm_hash_len_done(req, err);
311} 319}
312 320
313static void gcm_hash_crypt_done(struct crypto_async_request *areq, 321static void gcm_hash_crypt_remain_done(struct crypto_async_request *areq,
314 int err) 322 int err)
315{ 323{
316 struct aead_request *req = areq->data; 324 struct aead_request *req = areq->data;
325
326 __gcm_hash_crypt_remain_done(req, err);
327}
328
329static void __gcm_hash_crypt_done(struct aead_request *req, int err)
330{
317 struct crypto_gcm_req_priv_ctx *pctx = crypto_gcm_reqctx(req); 331 struct crypto_gcm_req_priv_ctx *pctx = crypto_gcm_reqctx(req);
318 struct crypto_gcm_ghash_ctx *gctx = &pctx->ghash_ctx; 332 struct crypto_gcm_ghash_ctx *gctx = &pctx->ghash_ctx;
319 unsigned int remain; 333 unsigned int remain;
@@ -327,13 +341,18 @@ static void gcm_hash_crypt_done(struct crypto_async_request *areq,
327 return; 341 return;
328 } 342 }
329 343
330 gcm_hash_crypt_remain_done(areq, err); 344 __gcm_hash_crypt_remain_done(req, err);
331} 345}
332 346
333static void gcm_hash_assoc_remain_done(struct crypto_async_request *areq, 347static void gcm_hash_crypt_done(struct crypto_async_request *areq, int err)
334 int err)
335{ 348{
336 struct aead_request *req = areq->data; 349 struct aead_request *req = areq->data;
350
351 __gcm_hash_crypt_done(req, err);
352}
353
354static void __gcm_hash_assoc_remain_done(struct aead_request *req, int err)
355{
337 struct crypto_gcm_req_priv_ctx *pctx = crypto_gcm_reqctx(req); 356 struct crypto_gcm_req_priv_ctx *pctx = crypto_gcm_reqctx(req);
338 struct crypto_gcm_ghash_ctx *gctx = &pctx->ghash_ctx; 357 struct crypto_gcm_ghash_ctx *gctx = &pctx->ghash_ctx;
339 crypto_completion_t complete; 358 crypto_completion_t complete;
@@ -350,15 +369,21 @@ static void gcm_hash_assoc_remain_done(struct crypto_async_request *areq,
350 } 369 }
351 370
352 if (remain) 371 if (remain)
353 gcm_hash_crypt_done(areq, err); 372 __gcm_hash_crypt_done(req, err);
354 else 373 else
355 gcm_hash_crypt_remain_done(areq, err); 374 __gcm_hash_crypt_remain_done(req, err);
356} 375}
357 376
358static void gcm_hash_assoc_done(struct crypto_async_request *areq, 377static void gcm_hash_assoc_remain_done(struct crypto_async_request *areq,
359 int err) 378 int err)
360{ 379{
361 struct aead_request *req = areq->data; 380 struct aead_request *req = areq->data;
381
382 __gcm_hash_assoc_remain_done(req, err);
383}
384
385static void __gcm_hash_assoc_done(struct aead_request *req, int err)
386{
362 struct crypto_gcm_req_priv_ctx *pctx = crypto_gcm_reqctx(req); 387 struct crypto_gcm_req_priv_ctx *pctx = crypto_gcm_reqctx(req);
363 unsigned int remain; 388 unsigned int remain;
364 389
@@ -371,13 +396,18 @@ static void gcm_hash_assoc_done(struct crypto_async_request *areq,
371 return; 396 return;
372 } 397 }
373 398
374 gcm_hash_assoc_remain_done(areq, err); 399 __gcm_hash_assoc_remain_done(req, err);
375} 400}
376 401
377static void gcm_hash_init_done(struct crypto_async_request *areq, 402static void gcm_hash_assoc_done(struct crypto_async_request *areq, int err)
378 int err)
379{ 403{
380 struct aead_request *req = areq->data; 404 struct aead_request *req = areq->data;
405
406 __gcm_hash_assoc_done(req, err);
407}
408
409static void __gcm_hash_init_done(struct aead_request *req, int err)
410{
381 struct crypto_gcm_req_priv_ctx *pctx = crypto_gcm_reqctx(req); 411 struct crypto_gcm_req_priv_ctx *pctx = crypto_gcm_reqctx(req);
382 crypto_completion_t complete; 412 crypto_completion_t complete;
383 unsigned int remain = 0; 413 unsigned int remain = 0;
@@ -393,9 +423,16 @@ static void gcm_hash_init_done(struct crypto_async_request *areq,
393 } 423 }
394 424
395 if (remain) 425 if (remain)
396 gcm_hash_assoc_done(areq, err); 426 __gcm_hash_assoc_done(req, err);
397 else 427 else
398 gcm_hash_assoc_remain_done(areq, err); 428 __gcm_hash_assoc_remain_done(req, err);
429}
430
431static void gcm_hash_init_done(struct crypto_async_request *areq, int err)
432{
433 struct aead_request *req = areq->data;
434
435 __gcm_hash_init_done(req, err);
399} 436}
400 437
401static int gcm_hash(struct aead_request *req, 438static int gcm_hash(struct aead_request *req,
@@ -457,10 +494,8 @@ static void gcm_enc_copy_hash(struct aead_request *req,
457 crypto_aead_authsize(aead), 1); 494 crypto_aead_authsize(aead), 1);
458} 495}
459 496
460static void gcm_enc_hash_done(struct crypto_async_request *areq, 497static void gcm_enc_hash_done(struct aead_request *req, int err)
461 int err)
462{ 498{
463 struct aead_request *req = areq->data;
464 struct crypto_gcm_req_priv_ctx *pctx = crypto_gcm_reqctx(req); 499 struct crypto_gcm_req_priv_ctx *pctx = crypto_gcm_reqctx(req);
465 500
466 if (!err) 501 if (!err)
@@ -469,8 +504,7 @@ static void gcm_enc_hash_done(struct crypto_async_request *areq,
469 aead_request_complete(req, err); 504 aead_request_complete(req, err);
470} 505}
471 506
472static void gcm_encrypt_done(struct crypto_async_request *areq, 507static void gcm_encrypt_done(struct crypto_async_request *areq, int err)
473 int err)
474{ 508{
475 struct aead_request *req = areq->data; 509 struct aead_request *req = areq->data;
476 struct crypto_gcm_req_priv_ctx *pctx = crypto_gcm_reqctx(req); 510 struct crypto_gcm_req_priv_ctx *pctx = crypto_gcm_reqctx(req);
@@ -479,9 +513,13 @@ static void gcm_encrypt_done(struct crypto_async_request *areq,
479 err = gcm_hash(req, pctx); 513 err = gcm_hash(req, pctx);
480 if (err == -EINPROGRESS || err == -EBUSY) 514 if (err == -EINPROGRESS || err == -EBUSY)
481 return; 515 return;
516 else if (!err) {
517 crypto_xor(pctx->auth_tag, pctx->iauth_tag, 16);
518 gcm_enc_copy_hash(req, pctx);
519 }
482 } 520 }
483 521
484 gcm_enc_hash_done(areq, err); 522 aead_request_complete(req, err);
485} 523}
486 524
487static int crypto_gcm_encrypt(struct aead_request *req) 525static int crypto_gcm_encrypt(struct aead_request *req)
@@ -538,9 +576,8 @@ static void gcm_decrypt_done(struct crypto_async_request *areq, int err)
538 aead_request_complete(req, err); 576 aead_request_complete(req, err);
539} 577}
540 578
541static void gcm_dec_hash_done(struct crypto_async_request *areq, int err) 579static void gcm_dec_hash_done(struct aead_request *req, int err)
542{ 580{
543 struct aead_request *req = areq->data;
544 struct crypto_gcm_req_priv_ctx *pctx = crypto_gcm_reqctx(req); 581 struct crypto_gcm_req_priv_ctx *pctx = crypto_gcm_reqctx(req);
545 struct ablkcipher_request *abreq = &pctx->u.abreq; 582 struct ablkcipher_request *abreq = &pctx->u.abreq;
546 struct crypto_gcm_ghash_ctx *gctx = &pctx->ghash_ctx; 583 struct crypto_gcm_ghash_ctx *gctx = &pctx->ghash_ctx;
@@ -552,9 +589,11 @@ static void gcm_dec_hash_done(struct crypto_async_request *areq, int err)
552 err = crypto_ablkcipher_decrypt(abreq); 589 err = crypto_ablkcipher_decrypt(abreq);
553 if (err == -EINPROGRESS || err == -EBUSY) 590 if (err == -EINPROGRESS || err == -EBUSY)
554 return; 591 return;
592 else if (!err)
593 err = crypto_gcm_verify(req, pctx);
555 } 594 }
556 595
557 gcm_decrypt_done(areq, err); 596 aead_request_complete(req, err);
558} 597}
559 598
560static int crypto_gcm_decrypt(struct aead_request *req) 599static int crypto_gcm_decrypt(struct aead_request *req)
diff --git a/drivers/acpi/acpica/acconfig.h b/drivers/acpi/acpica/acconfig.h
index 8e679ef5b231..a4471e3d3853 100644
--- a/drivers/acpi/acpica/acconfig.h
+++ b/drivers/acpi/acpica/acconfig.h
@@ -103,9 +103,9 @@
103 103
104#define ACPI_MAX_REFERENCE_COUNT 0x1000 104#define ACPI_MAX_REFERENCE_COUNT 0x1000
105 105
106/* Size of cached memory mapping for system memory operation region */ 106/* Default page size for use in mapping memory for operation regions */
107 107
108#define ACPI_SYSMEM_REGION_WINDOW_SIZE 4096 108#define ACPI_DEFAULT_PAGE_SIZE 4096 /* Must be power of 2 */
109 109
110/* owner_id tracking. 8 entries allows for 255 owner_ids */ 110/* owner_id tracking. 8 entries allows for 255 owner_ids */
111 111
diff --git a/drivers/acpi/acpica/acpredef.h b/drivers/acpi/acpica/acpredef.h
index cd80d1dd1950..57bdaf6ffab1 100644
--- a/drivers/acpi/acpica/acpredef.h
+++ b/drivers/acpi/acpica/acpredef.h
@@ -203,8 +203,9 @@ static const union acpi_predefined_info predefined_names[] =
203 {{"_BCT", 1, ACPI_RTYPE_INTEGER}}, 203 {{"_BCT", 1, ACPI_RTYPE_INTEGER}},
204 {{"_BDN", 0, ACPI_RTYPE_INTEGER}}, 204 {{"_BDN", 0, ACPI_RTYPE_INTEGER}},
205 {{"_BFS", 1, 0}}, 205 {{"_BFS", 1, 0}},
206 {{"_BIF", 0, ACPI_RTYPE_PACKAGE}}, /* Fixed-length (9 Int),(4 Str) */ 206 {{"_BIF", 0, ACPI_RTYPE_PACKAGE} }, /* Fixed-length (9 Int),(4 Str/Buf) */
207 {{{ACPI_PTYPE1_FIXED, ACPI_RTYPE_INTEGER, 9, ACPI_RTYPE_STRING}, 4,0}}, 207 {{{ACPI_PTYPE1_FIXED, ACPI_RTYPE_INTEGER, 9,
208 ACPI_RTYPE_STRING | ACPI_RTYPE_BUFFER}, 4, 0} },
208 209
209 {{"_BIX", 0, ACPI_RTYPE_PACKAGE}}, /* Fixed-length (16 Int),(4 Str) */ 210 {{"_BIX", 0, ACPI_RTYPE_PACKAGE}}, /* Fixed-length (16 Int),(4 Str) */
210 {{{ACPI_PTYPE1_FIXED, ACPI_RTYPE_INTEGER, 16, ACPI_RTYPE_STRING}, 4, 211 {{{ACPI_PTYPE1_FIXED, ACPI_RTYPE_INTEGER, 16, ACPI_RTYPE_STRING}, 4,
diff --git a/drivers/acpi/acpica/exregion.c b/drivers/acpi/acpica/exregion.c
index 3a54b737d2da..2bd83ac57c3a 100644
--- a/drivers/acpi/acpica/exregion.c
+++ b/drivers/acpi/acpica/exregion.c
@@ -77,7 +77,8 @@ acpi_ex_system_memory_space_handler(u32 function,
77 void *logical_addr_ptr = NULL; 77 void *logical_addr_ptr = NULL;
78 struct acpi_mem_space_context *mem_info = region_context; 78 struct acpi_mem_space_context *mem_info = region_context;
79 u32 length; 79 u32 length;
80 acpi_size window_size; 80 acpi_size map_length;
81 acpi_size page_boundary_map_length;
81#ifdef ACPI_MISALIGNMENT_NOT_SUPPORTED 82#ifdef ACPI_MISALIGNMENT_NOT_SUPPORTED
82 u32 remainder; 83 u32 remainder;
83#endif 84#endif
@@ -144,25 +145,39 @@ acpi_ex_system_memory_space_handler(u32 function,
144 } 145 }
145 146
146 /* 147 /*
147 * Don't attempt to map memory beyond the end of the region, and 148 * Attempt to map from the requested address to the end of the region.
148 * constrain the maximum mapping size to something reasonable. 149 * However, we will never map more than one page, nor will we cross
150 * a page boundary.
149 */ 151 */
150 window_size = (acpi_size) 152 map_length = (acpi_size)
151 ((mem_info->address + mem_info->length) - address); 153 ((mem_info->address + mem_info->length) - address);
152 154
153 if (window_size > ACPI_SYSMEM_REGION_WINDOW_SIZE) { 155 /*
154 window_size = ACPI_SYSMEM_REGION_WINDOW_SIZE; 156 * If mapping the entire remaining portion of the region will cross
157 * a page boundary, just map up to the page boundary, do not cross.
158 * On some systems, crossing a page boundary while mapping regions
159 * can cause warnings if the pages have different attributes
160 * due to resource management
161 */
162 page_boundary_map_length =
163 ACPI_ROUND_UP(address, ACPI_DEFAULT_PAGE_SIZE) - address;
164
165 if (!page_boundary_map_length) {
166 page_boundary_map_length = ACPI_DEFAULT_PAGE_SIZE;
167 }
168
169 if (map_length > page_boundary_map_length) {
170 map_length = page_boundary_map_length;
155 } 171 }
156 172
157 /* Create a new mapping starting at the address given */ 173 /* Create a new mapping starting at the address given */
158 174
159 mem_info->mapped_logical_address = 175 mem_info->mapped_logical_address = acpi_os_map_memory((acpi_physical_address) address, map_length);
160 acpi_os_map_memory((acpi_physical_address) address, window_size);
161 if (!mem_info->mapped_logical_address) { 176 if (!mem_info->mapped_logical_address) {
162 ACPI_ERROR((AE_INFO, 177 ACPI_ERROR((AE_INFO,
163 "Could not map memory at %8.8X%8.8X, size %X", 178 "Could not map memory at %8.8X%8.8X, size %X",
164 ACPI_FORMAT_NATIVE_UINT(address), 179 ACPI_FORMAT_NATIVE_UINT(address),
165 (u32) window_size)); 180 (u32) map_length));
166 mem_info->mapped_length = 0; 181 mem_info->mapped_length = 0;
167 return_ACPI_STATUS(AE_NO_MEMORY); 182 return_ACPI_STATUS(AE_NO_MEMORY);
168 } 183 }
@@ -170,7 +185,7 @@ acpi_ex_system_memory_space_handler(u32 function,
170 /* Save the physical address and mapping size */ 185 /* Save the physical address and mapping size */
171 186
172 mem_info->mapped_physical_address = address; 187 mem_info->mapped_physical_address = address;
173 mem_info->mapped_length = window_size; 188 mem_info->mapped_length = map_length;
174 } 189 }
175 190
176 /* 191 /*
diff --git a/drivers/acpi/blacklist.c b/drivers/acpi/blacklist.c
index e56b2a7b53db..23e5a0519af5 100644
--- a/drivers/acpi/blacklist.c
+++ b/drivers/acpi/blacklist.c
@@ -224,6 +224,7 @@ static struct dmi_system_id acpi_osi_dmi_table[] __initdata = {
224 * _OSI(Linux) helps sound 224 * _OSI(Linux) helps sound
225 * DMI_MATCH(DMI_PRODUCT_VERSION, "ThinkPad R61"), 225 * DMI_MATCH(DMI_PRODUCT_VERSION, "ThinkPad R61"),
226 * DMI_MATCH(DMI_PRODUCT_VERSION, "ThinkPad T61"), 226 * DMI_MATCH(DMI_PRODUCT_VERSION, "ThinkPad T61"),
227 * T400, T500
227 * _OSI(Linux) has Linux specific hooks 228 * _OSI(Linux) has Linux specific hooks
228 * DMI_MATCH(DMI_PRODUCT_VERSION, "ThinkPad X61"), 229 * DMI_MATCH(DMI_PRODUCT_VERSION, "ThinkPad X61"),
229 * _OSI(Linux) is a NOP: 230 * _OSI(Linux) is a NOP:
@@ -254,6 +255,22 @@ static struct dmi_system_id acpi_osi_dmi_table[] __initdata = {
254 DMI_MATCH(DMI_PRODUCT_VERSION, "ThinkPad X61"), 255 DMI_MATCH(DMI_PRODUCT_VERSION, "ThinkPad X61"),
255 }, 256 },
256 }, 257 },
258 {
259 .callback = dmi_enable_osi_linux,
260 .ident = "Lenovo ThinkPad T400",
261 .matches = {
262 DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
263 DMI_MATCH(DMI_PRODUCT_VERSION, "ThinkPad T400"),
264 },
265 },
266 {
267 .callback = dmi_enable_osi_linux,
268 .ident = "Lenovo ThinkPad T500",
269 .matches = {
270 DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
271 DMI_MATCH(DMI_PRODUCT_VERSION, "ThinkPad T500"),
272 },
273 },
257 {} 274 {}
258}; 275};
259 276
diff --git a/drivers/acpi/power_meter.c b/drivers/acpi/power_meter.c
index e6bfd77986b8..2ef7030a0c28 100644
--- a/drivers/acpi/power_meter.c
+++ b/drivers/acpi/power_meter.c
@@ -294,7 +294,11 @@ static int set_acpi_trip(struct acpi_power_meter_resource *resource)
294 return -EINVAL; 294 return -EINVAL;
295 } 295 }
296 296
297 return data; 297 /* _PTP returns 0 on success, nonzero otherwise */
298 if (data)
299 return -EINVAL;
300
301 return 0;
298} 302}
299 303
300static ssize_t set_trip(struct device *dev, struct device_attribute *devattr, 304static ssize_t set_trip(struct device *dev, struct device_attribute *devattr,
diff --git a/drivers/acpi/proc.c b/drivers/acpi/proc.c
index f8b6f555ba52..d0d25e2e1ced 100644
--- a/drivers/acpi/proc.c
+++ b/drivers/acpi/proc.c
@@ -393,7 +393,7 @@ acpi_system_write_wakeup_device(struct file *file,
393 struct list_head *node, *next; 393 struct list_head *node, *next;
394 char strbuf[5]; 394 char strbuf[5];
395 char str[5] = ""; 395 char str[5] = "";
396 int len = count; 396 unsigned int len = count;
397 struct acpi_device *found_dev = NULL; 397 struct acpi_device *found_dev = NULL;
398 398
399 if (len > 4) 399 if (len > 4)
diff --git a/drivers/acpi/processor_core.c b/drivers/acpi/processor_core.c
index c567b46dfa0f..ec742a4e5635 100644
--- a/drivers/acpi/processor_core.c
+++ b/drivers/acpi/processor_core.c
@@ -770,7 +770,7 @@ static struct notifier_block acpi_cpu_notifier =
770 .notifier_call = acpi_cpu_soft_notify, 770 .notifier_call = acpi_cpu_soft_notify,
771}; 771};
772 772
773static int acpi_processor_add(struct acpi_device *device) 773static int __cpuinit acpi_processor_add(struct acpi_device *device)
774{ 774{
775 struct acpi_processor *pr = NULL; 775 struct acpi_processor *pr = NULL;
776 int result = 0; 776 int result = 0;
diff --git a/drivers/acpi/processor_throttling.c b/drivers/acpi/processor_throttling.c
index 4c6c14c1e307..1c5d7a8b2fdf 100644
--- a/drivers/acpi/processor_throttling.c
+++ b/drivers/acpi/processor_throttling.c
@@ -1133,15 +1133,15 @@ int acpi_processor_get_throttling_info(struct acpi_processor *pr)
1133 int result = 0; 1133 int result = 0;
1134 struct acpi_processor_throttling *pthrottling; 1134 struct acpi_processor_throttling *pthrottling;
1135 1135
1136 if (!pr)
1137 return -EINVAL;
1138
1136 ACPI_DEBUG_PRINT((ACPI_DB_INFO, 1139 ACPI_DEBUG_PRINT((ACPI_DB_INFO,
1137 "pblk_address[0x%08x] duty_offset[%d] duty_width[%d]\n", 1140 "pblk_address[0x%08x] duty_offset[%d] duty_width[%d]\n",
1138 pr->throttling.address, 1141 pr->throttling.address,
1139 pr->throttling.duty_offset, 1142 pr->throttling.duty_offset,
1140 pr->throttling.duty_width)); 1143 pr->throttling.duty_width));
1141 1144
1142 if (!pr)
1143 return -EINVAL;
1144
1145 /* 1145 /*
1146 * Evaluate _PTC, _TSS and _TPC 1146 * Evaluate _PTC, _TSS and _TPC
1147 * They must all be present or none of them can be used. 1147 * They must all be present or none of them can be used.
diff --git a/drivers/acpi/sleep.c b/drivers/acpi/sleep.c
index a90afcc723ab..5f2c379ab7bf 100644
--- a/drivers/acpi/sleep.c
+++ b/drivers/acpi/sleep.c
@@ -413,6 +413,38 @@ static struct dmi_system_id __initdata acpisleep_dmi_table[] = {
413 }, 413 },
414 }, 414 },
415 { 415 {
416 .callback = init_set_sci_en_on_resume,
417 .ident = "Hewlett-Packard Pavilion dv4",
418 .matches = {
419 DMI_MATCH(DMI_SYS_VENDOR, "Hewlett-Packard"),
420 DMI_MATCH(DMI_PRODUCT_NAME, "HP Pavilion dv4"),
421 },
422 },
423 {
424 .callback = init_set_sci_en_on_resume,
425 .ident = "Hewlett-Packard Pavilion dv7",
426 .matches = {
427 DMI_MATCH(DMI_SYS_VENDOR, "Hewlett-Packard"),
428 DMI_MATCH(DMI_PRODUCT_NAME, "HP Pavilion dv7"),
429 },
430 },
431 {
432 .callback = init_set_sci_en_on_resume,
433 .ident = "Hewlett-Packard Compaq Presario C700 Notebook PC",
434 .matches = {
435 DMI_MATCH(DMI_SYS_VENDOR, "Hewlett-Packard"),
436 DMI_MATCH(DMI_PRODUCT_NAME, "Compaq Presario C700 Notebook PC"),
437 },
438 },
439 {
440 .callback = init_set_sci_en_on_resume,
441 .ident = "Hewlett-Packard Compaq Presario CQ40 Notebook PC",
442 .matches = {
443 DMI_MATCH(DMI_SYS_VENDOR, "Hewlett-Packard"),
444 DMI_MATCH(DMI_PRODUCT_NAME, "Compaq Presario CQ40 Notebook PC"),
445 },
446 },
447 {
416 .callback = init_old_suspend_ordering, 448 .callback = init_old_suspend_ordering,
417 .ident = "Panasonic CF51-2L", 449 .ident = "Panasonic CF51-2L",
418 .matches = { 450 .matches = {
diff --git a/drivers/acpi/video.c b/drivers/acpi/video.c
index 64e3c581b7a9..05dff631591c 100644
--- a/drivers/acpi/video.c
+++ b/drivers/acpi/video.c
@@ -1223,7 +1223,7 @@ acpi_video_device_write_state(struct file *file,
1223 u32 state = 0; 1223 u32 state = 0;
1224 1224
1225 1225
1226 if (!dev || count + 1 > sizeof str) 1226 if (!dev || count >= sizeof(str))
1227 return -EINVAL; 1227 return -EINVAL;
1228 1228
1229 if (copy_from_user(str, buffer, count)) 1229 if (copy_from_user(str, buffer, count))
@@ -1280,7 +1280,7 @@ acpi_video_device_write_brightness(struct file *file,
1280 int i; 1280 int i;
1281 1281
1282 1282
1283 if (!dev || !dev->brightness || count + 1 > sizeof str) 1283 if (!dev || !dev->brightness || count >= sizeof(str))
1284 return -EINVAL; 1284 return -EINVAL;
1285 1285
1286 if (copy_from_user(str, buffer, count)) 1286 if (copy_from_user(str, buffer, count))
@@ -1562,7 +1562,7 @@ acpi_video_bus_write_POST(struct file *file,
1562 unsigned long long opt, options; 1562 unsigned long long opt, options;
1563 1563
1564 1564
1565 if (!video || count + 1 > sizeof str) 1565 if (!video || count >= sizeof(str))
1566 return -EINVAL; 1566 return -EINVAL;
1567 1567
1568 status = acpi_video_bus_POST_options(video, &options); 1568 status = acpi_video_bus_POST_options(video, &options);
@@ -1602,7 +1602,7 @@ acpi_video_bus_write_DOS(struct file *file,
1602 unsigned long opt; 1602 unsigned long opt;
1603 1603
1604 1604
1605 if (!video || count + 1 > sizeof str) 1605 if (!video || count >= sizeof(str))
1606 return -EINVAL; 1606 return -EINVAL;
1607 1607
1608 if (copy_from_user(str, buffer, count)) 1608 if (copy_from_user(str, buffer, count))
diff --git a/drivers/ata/ahci.c b/drivers/ata/ahci.c
index a06f5d6375a8..a3241a1a710b 100644
--- a/drivers/ata/ahci.c
+++ b/drivers/ata/ahci.c
@@ -2718,6 +2718,30 @@ static bool ahci_sb600_enable_64bit(struct pci_dev *pdev)
2718 }, 2718 },
2719 .driver_data = "20071026", /* yyyymmdd */ 2719 .driver_data = "20071026", /* yyyymmdd */
2720 }, 2720 },
2721 /*
2722 * All BIOS versions for the MSI K9A2 Platinum (MS-7376)
2723 * support 64bit DMA.
2724 *
2725 * BIOS versions earlier than 1.5 had the Manufacturer DMI
2726 * fields as "MICRO-STAR INTERANTIONAL CO.,LTD".
2727 * This spelling mistake was fixed in BIOS version 1.5, so
2728 * 1.5 and later have the Manufacturer as
2729 * "MICRO-STAR INTERNATIONAL CO.,LTD".
2730 * So try to match on DMI_BOARD_VENDOR of "MICRO-STAR INTER".
2731 *
2732 * BIOS versions earlier than 1.9 had a Board Product Name
2733 * DMI field of "MS-7376". This was changed to be
2734 * "K9A2 Platinum (MS-7376)" in version 1.9, but we can still
2735 * match on DMI_BOARD_NAME of "MS-7376".
2736 */
2737 {
2738 .ident = "MSI K9A2 Platinum",
2739 .matches = {
2740 DMI_MATCH(DMI_BOARD_VENDOR,
2741 "MICRO-STAR INTER"),
2742 DMI_MATCH(DMI_BOARD_NAME, "MS-7376"),
2743 },
2744 },
2721 { } 2745 { }
2722 }; 2746 };
2723 const struct dmi_system_id *match; 2747 const struct dmi_system_id *match;
@@ -2729,18 +2753,24 @@ static bool ahci_sb600_enable_64bit(struct pci_dev *pdev)
2729 !match) 2753 !match)
2730 return false; 2754 return false;
2731 2755
2756 if (!match->driver_data)
2757 goto enable_64bit;
2758
2732 dmi_get_date(DMI_BIOS_DATE, &year, &month, &date); 2759 dmi_get_date(DMI_BIOS_DATE, &year, &month, &date);
2733 snprintf(buf, sizeof(buf), "%04d%02d%02d", year, month, date); 2760 snprintf(buf, sizeof(buf), "%04d%02d%02d", year, month, date);
2734 2761
2735 if (strcmp(buf, match->driver_data) >= 0) { 2762 if (strcmp(buf, match->driver_data) >= 0)
2736 dev_printk(KERN_WARNING, &pdev->dev, "%s: enabling 64bit DMA\n", 2763 goto enable_64bit;
2737 match->ident); 2764 else {
2738 return true;
2739 } else {
2740 dev_printk(KERN_WARNING, &pdev->dev, "%s: BIOS too old, " 2765 dev_printk(KERN_WARNING, &pdev->dev, "%s: BIOS too old, "
2741 "forcing 32bit DMA, update BIOS\n", match->ident); 2766 "forcing 32bit DMA, update BIOS\n", match->ident);
2742 return false; 2767 return false;
2743 } 2768 }
2769
2770enable_64bit:
2771 dev_printk(KERN_WARNING, &pdev->dev, "%s: enabling 64bit DMA\n",
2772 match->ident);
2773 return true;
2744} 2774}
2745 2775
2746static bool ahci_broken_system_poweroff(struct pci_dev *pdev) 2776static bool ahci_broken_system_poweroff(struct pci_dev *pdev)
diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c
index d7f0f1b1ae3e..dc72690ed5db 100644
--- a/drivers/ata/libata-core.c
+++ b/drivers/ata/libata-core.c
@@ -4919,10 +4919,11 @@ struct ata_queued_cmd *ata_qc_new_init(struct ata_device *dev)
4919 */ 4919 */
4920void ata_qc_free(struct ata_queued_cmd *qc) 4920void ata_qc_free(struct ata_queued_cmd *qc)
4921{ 4921{
4922 struct ata_port *ap = qc->ap; 4922 struct ata_port *ap;
4923 unsigned int tag; 4923 unsigned int tag;
4924 4924
4925 WARN_ON_ONCE(qc == NULL); /* ata_qc_from_tag _might_ return NULL */ 4925 WARN_ON_ONCE(qc == NULL); /* ata_qc_from_tag _might_ return NULL */
4926 ap = qc->ap;
4926 4927
4927 qc->flags = 0; 4928 qc->flags = 0;
4928 tag = qc->tag; 4929 tag = qc->tag;
@@ -4934,11 +4935,13 @@ void ata_qc_free(struct ata_queued_cmd *qc)
4934 4935
4935void __ata_qc_complete(struct ata_queued_cmd *qc) 4936void __ata_qc_complete(struct ata_queued_cmd *qc)
4936{ 4937{
4937 struct ata_port *ap = qc->ap; 4938 struct ata_port *ap;
4938 struct ata_link *link = qc->dev->link; 4939 struct ata_link *link;
4939 4940
4940 WARN_ON_ONCE(qc == NULL); /* ata_qc_from_tag _might_ return NULL */ 4941 WARN_ON_ONCE(qc == NULL); /* ata_qc_from_tag _might_ return NULL */
4941 WARN_ON_ONCE(!(qc->flags & ATA_QCFLAG_ACTIVE)); 4942 WARN_ON_ONCE(!(qc->flags & ATA_QCFLAG_ACTIVE));
4943 ap = qc->ap;
4944 link = qc->dev->link;
4942 4945
4943 if (likely(qc->flags & ATA_QCFLAG_DMAMAP)) 4946 if (likely(qc->flags & ATA_QCFLAG_DMAMAP))
4944 ata_sg_clean(qc); 4947 ata_sg_clean(qc);
diff --git a/drivers/ata/pata_pcmcia.c b/drivers/ata/pata_pcmcia.c
index dc99e26f8e5b..1b392c9e8531 100644
--- a/drivers/ata/pata_pcmcia.c
+++ b/drivers/ata/pata_pcmcia.c
@@ -177,9 +177,6 @@ static struct ata_port_operations pcmcia_8bit_port_ops = {
177 .drain_fifo = pcmcia_8bit_drain_fifo, 177 .drain_fifo = pcmcia_8bit_drain_fifo,
178}; 178};
179 179
180#define CS_CHECK(fn, ret) \
181do { last_fn = (fn); if ((last_ret = (ret)) != 0) goto cs_failed; } while (0)
182
183 180
184struct pcmcia_config_check { 181struct pcmcia_config_check {
185 unsigned long ctl_base; 182 unsigned long ctl_base;
@@ -252,7 +249,7 @@ static int pcmcia_init_one(struct pcmcia_device *pdev)
252 struct ata_port *ap; 249 struct ata_port *ap;
253 struct ata_pcmcia_info *info; 250 struct ata_pcmcia_info *info;
254 struct pcmcia_config_check *stk = NULL; 251 struct pcmcia_config_check *stk = NULL;
255 int last_ret = 0, last_fn = 0, is_kme = 0, ret = -ENOMEM, p; 252 int is_kme = 0, ret = -ENOMEM, p;
256 unsigned long io_base, ctl_base; 253 unsigned long io_base, ctl_base;
257 void __iomem *io_addr, *ctl_addr; 254 void __iomem *io_addr, *ctl_addr;
258 int n_ports = 1; 255 int n_ports = 1;
@@ -271,7 +268,6 @@ static int pcmcia_init_one(struct pcmcia_device *pdev)
271 pdev->io.Attributes2 = IO_DATA_PATH_WIDTH_8; 268 pdev->io.Attributes2 = IO_DATA_PATH_WIDTH_8;
272 pdev->io.IOAddrLines = 3; 269 pdev->io.IOAddrLines = 3;
273 pdev->irq.Attributes = IRQ_TYPE_DYNAMIC_SHARING; 270 pdev->irq.Attributes = IRQ_TYPE_DYNAMIC_SHARING;
274 pdev->irq.IRQInfo1 = IRQ_LEVEL_ID;
275 pdev->conf.Attributes = CONF_ENABLE_IRQ; 271 pdev->conf.Attributes = CONF_ENABLE_IRQ;
276 pdev->conf.IntType = INT_MEMORY_AND_IO; 272 pdev->conf.IntType = INT_MEMORY_AND_IO;
277 273
@@ -296,8 +292,13 @@ static int pcmcia_init_one(struct pcmcia_device *pdev)
296 } 292 }
297 io_base = pdev->io.BasePort1; 293 io_base = pdev->io.BasePort1;
298 ctl_base = stk->ctl_base; 294 ctl_base = stk->ctl_base;
299 CS_CHECK(RequestIRQ, pcmcia_request_irq(pdev, &pdev->irq)); 295 ret = pcmcia_request_irq(pdev, &pdev->irq);
300 CS_CHECK(RequestConfiguration, pcmcia_request_configuration(pdev, &pdev->conf)); 296 if (ret)
297 goto failed;
298
299 ret = pcmcia_request_configuration(pdev, &pdev->conf);
300 if (ret)
301 goto failed;
301 302
302 /* iomap */ 303 /* iomap */
303 ret = -ENOMEM; 304 ret = -ENOMEM;
@@ -351,8 +352,6 @@ static int pcmcia_init_one(struct pcmcia_device *pdev)
351 kfree(stk); 352 kfree(stk);
352 return 0; 353 return 0;
353 354
354cs_failed:
355 cs_error(pdev, last_fn, last_ret);
356failed: 355failed:
357 kfree(stk); 356 kfree(stk);
358 info->ndev = 0; 357 info->ndev = 0;
diff --git a/drivers/ata/sata_fsl.c b/drivers/ata/sata_fsl.c
index d344db42a002..172b57e6543f 100644
--- a/drivers/ata/sata_fsl.c
+++ b/drivers/ata/sata_fsl.c
@@ -707,34 +707,17 @@ static unsigned int sata_fsl_dev_classify(struct ata_port *ap)
707 return ata_dev_classify(&tf); 707 return ata_dev_classify(&tf);
708} 708}
709 709
710static int sata_fsl_prereset(struct ata_link *link, unsigned long deadline) 710static int sata_fsl_hardreset(struct ata_link *link, unsigned int *class,
711{
712 /* FIXME: Never skip softreset, sata_fsl_softreset() is
713 * combination of soft and hard resets. sata_fsl_softreset()
714 * needs to be splitted into soft and hard resets.
715 */
716 return 0;
717}
718
719static int sata_fsl_softreset(struct ata_link *link, unsigned int *class,
720 unsigned long deadline) 711 unsigned long deadline)
721{ 712{
722 struct ata_port *ap = link->ap; 713 struct ata_port *ap = link->ap;
723 struct sata_fsl_port_priv *pp = ap->private_data;
724 struct sata_fsl_host_priv *host_priv = ap->host->private_data; 714 struct sata_fsl_host_priv *host_priv = ap->host->private_data;
725 void __iomem *hcr_base = host_priv->hcr_base; 715 void __iomem *hcr_base = host_priv->hcr_base;
726 int pmp = sata_srst_pmp(link);
727 u32 temp; 716 u32 temp;
728 struct ata_taskfile tf;
729 u8 *cfis;
730 u32 Serror;
731 int i = 0; 717 int i = 0;
732 unsigned long start_jiffies; 718 unsigned long start_jiffies;
733 719
734 DPRINTK("in xx_softreset\n"); 720 DPRINTK("in xx_hardreset\n");
735
736 if (pmp != SATA_PMP_CTRL_PORT)
737 goto issue_srst;
738 721
739try_offline_again: 722try_offline_again:
740 /* 723 /*
@@ -749,7 +732,7 @@ try_offline_again:
749 732
750 if (temp & ONLINE) { 733 if (temp & ONLINE) {
751 ata_port_printk(ap, KERN_ERR, 734 ata_port_printk(ap, KERN_ERR,
752 "Softreset failed, not off-lined %d\n", i); 735 "Hardreset failed, not off-lined %d\n", i);
753 736
754 /* 737 /*
755 * Try to offline controller atleast twice 738 * Try to offline controller atleast twice
@@ -761,7 +744,7 @@ try_offline_again:
761 goto try_offline_again; 744 goto try_offline_again;
762 } 745 }
763 746
764 DPRINTK("softreset, controller off-lined\n"); 747 DPRINTK("hardreset, controller off-lined\n");
765 VPRINTK("HStatus = 0x%x\n", ioread32(hcr_base + HSTATUS)); 748 VPRINTK("HStatus = 0x%x\n", ioread32(hcr_base + HSTATUS));
766 VPRINTK("HControl = 0x%x\n", ioread32(hcr_base + HCONTROL)); 749 VPRINTK("HControl = 0x%x\n", ioread32(hcr_base + HCONTROL));
767 750
@@ -786,11 +769,11 @@ try_offline_again:
786 769
787 if (!(temp & ONLINE)) { 770 if (!(temp & ONLINE)) {
788 ata_port_printk(ap, KERN_ERR, 771 ata_port_printk(ap, KERN_ERR,
789 "Softreset failed, not on-lined\n"); 772 "Hardreset failed, not on-lined\n");
790 goto err; 773 goto err;
791 } 774 }
792 775
793 DPRINTK("softreset, controller off-lined & on-lined\n"); 776 DPRINTK("hardreset, controller off-lined & on-lined\n");
794 VPRINTK("HStatus = 0x%x\n", ioread32(hcr_base + HSTATUS)); 777 VPRINTK("HStatus = 0x%x\n", ioread32(hcr_base + HSTATUS));
795 VPRINTK("HControl = 0x%x\n", ioread32(hcr_base + HCONTROL)); 778 VPRINTK("HControl = 0x%x\n", ioread32(hcr_base + HCONTROL));
796 779
@@ -806,7 +789,7 @@ try_offline_again:
806 "No Device OR PHYRDY change,Hstatus = 0x%x\n", 789 "No Device OR PHYRDY change,Hstatus = 0x%x\n",
807 ioread32(hcr_base + HSTATUS)); 790 ioread32(hcr_base + HSTATUS));
808 *class = ATA_DEV_NONE; 791 *class = ATA_DEV_NONE;
809 goto out; 792 return 0;
810 } 793 }
811 794
812 /* 795 /*
@@ -819,11 +802,44 @@ try_offline_again:
819 if ((temp & 0xFF) != 0x18) { 802 if ((temp & 0xFF) != 0x18) {
820 ata_port_printk(ap, KERN_WARNING, "No Signature Update\n"); 803 ata_port_printk(ap, KERN_WARNING, "No Signature Update\n");
821 *class = ATA_DEV_NONE; 804 *class = ATA_DEV_NONE;
822 goto out; 805 goto do_followup_srst;
823 } else { 806 } else {
824 ata_port_printk(ap, KERN_INFO, 807 ata_port_printk(ap, KERN_INFO,
825 "Signature Update detected @ %d msecs\n", 808 "Signature Update detected @ %d msecs\n",
826 jiffies_to_msecs(jiffies - start_jiffies)); 809 jiffies_to_msecs(jiffies - start_jiffies));
810 *class = sata_fsl_dev_classify(ap);
811 return 0;
812 }
813
814do_followup_srst:
815 /*
816 * request libATA to perform follow-up softreset
817 */
818 return -EAGAIN;
819
820err:
821 return -EIO;
822}
823
824static int sata_fsl_softreset(struct ata_link *link, unsigned int *class,
825 unsigned long deadline)
826{
827 struct ata_port *ap = link->ap;
828 struct sata_fsl_port_priv *pp = ap->private_data;
829 struct sata_fsl_host_priv *host_priv = ap->host->private_data;
830 void __iomem *hcr_base = host_priv->hcr_base;
831 int pmp = sata_srst_pmp(link);
832 u32 temp;
833 struct ata_taskfile tf;
834 u8 *cfis;
835 u32 Serror;
836
837 DPRINTK("in xx_softreset\n");
838
839 if (ata_link_offline(link)) {
840 DPRINTK("PHY reports no device\n");
841 *class = ATA_DEV_NONE;
842 return 0;
827 } 843 }
828 844
829 /* 845 /*
@@ -834,7 +850,6 @@ try_offline_again:
834 * reached here, we can send a command to the target device 850 * reached here, we can send a command to the target device
835 */ 851 */
836 852
837issue_srst:
838 DPRINTK("Sending SRST/device reset\n"); 853 DPRINTK("Sending SRST/device reset\n");
839 854
840 ata_tf_init(link->device, &tf); 855 ata_tf_init(link->device, &tf);
@@ -860,6 +875,8 @@ issue_srst:
860 ioread32(CA + hcr_base), ioread32(CC + hcr_base)); 875 ioread32(CA + hcr_base), ioread32(CC + hcr_base));
861 876
862 iowrite32(0xFFFF, CC + hcr_base); 877 iowrite32(0xFFFF, CC + hcr_base);
878 if (pmp != SATA_PMP_CTRL_PORT)
879 iowrite32(pmp, CQPMP + hcr_base);
863 iowrite32(1, CQ + hcr_base); 880 iowrite32(1, CQ + hcr_base);
864 881
865 temp = ata_wait_register(CQ + hcr_base, 0x1, 0x1, 1, 5000); 882 temp = ata_wait_register(CQ + hcr_base, 0x1, 0x1, 1, 5000);
@@ -926,7 +943,6 @@ issue_srst:
926 VPRINTK("cereg = 0x%x\n", ioread32(hcr_base + CE)); 943 VPRINTK("cereg = 0x%x\n", ioread32(hcr_base + CE));
927 } 944 }
928 945
929out:
930 return 0; 946 return 0;
931 947
932err: 948err:
@@ -988,18 +1004,6 @@ static void sata_fsl_error_intr(struct ata_port *ap)
988 ehi->err_mask |= AC_ERR_ATA_BUS; 1004 ehi->err_mask |= AC_ERR_ATA_BUS;
989 ehi->action |= ATA_EH_SOFTRESET; 1005 ehi->action |= ATA_EH_SOFTRESET;
990 1006
991 /*
992 * Ignore serror in case of fatal errors as we always want
993 * to do a soft-reset of the FSL SATA controller. Analyzing
994 * serror may cause libata to schedule a hard-reset action,
995 * and hard-reset currently does not do controller
996 * offline/online, causing command timeouts and leads to an
997 * un-recoverable state, hence make libATA ignore
998 * autopsy in case of fatal errors.
999 */
1000
1001 ehi->flags |= ATA_EHI_NO_AUTOPSY;
1002
1003 freeze = 1; 1007 freeze = 1;
1004 } 1008 }
1005 1009
@@ -1267,8 +1271,8 @@ static struct ata_port_operations sata_fsl_ops = {
1267 1271
1268 .freeze = sata_fsl_freeze, 1272 .freeze = sata_fsl_freeze,
1269 .thaw = sata_fsl_thaw, 1273 .thaw = sata_fsl_thaw,
1270 .prereset = sata_fsl_prereset,
1271 .softreset = sata_fsl_softreset, 1274 .softreset = sata_fsl_softreset,
1275 .hardreset = sata_fsl_hardreset,
1272 .pmp_softreset = sata_fsl_softreset, 1276 .pmp_softreset = sata_fsl_softreset,
1273 .error_handler = sata_fsl_error_handler, 1277 .error_handler = sata_fsl_error_handler,
1274 .post_internal_cmd = sata_fsl_post_internal_cmd, 1278 .post_internal_cmd = sata_fsl_post_internal_cmd,
diff --git a/drivers/ata/sata_via.c b/drivers/ata/sata_via.c
index bdd43c7f432e..02efd9a83d26 100644
--- a/drivers/ata/sata_via.c
+++ b/drivers/ata/sata_via.c
@@ -93,7 +93,6 @@ static const struct pci_device_id svia_pci_tbl[] = {
93 { PCI_VDEVICE(VIA, 0x7372), vt6420 }, 93 { PCI_VDEVICE(VIA, 0x7372), vt6420 },
94 { PCI_VDEVICE(VIA, 0x5287), vt8251 }, /* 2 sata chnls (Master/Slave) */ 94 { PCI_VDEVICE(VIA, 0x5287), vt8251 }, /* 2 sata chnls (Master/Slave) */
95 { PCI_VDEVICE(VIA, 0x9000), vt8251 }, 95 { PCI_VDEVICE(VIA, 0x9000), vt8251 },
96 { PCI_VDEVICE(VIA, 0x9040), vt8251 },
97 96
98 { } /* terminate list */ 97 { } /* terminate list */
99}; 98};
diff --git a/drivers/base/power/main.c b/drivers/base/power/main.c
index e0dc4071e088..8aa2443182d5 100644
--- a/drivers/base/power/main.c
+++ b/drivers/base/power/main.c
@@ -511,6 +511,7 @@ static void dpm_complete(pm_message_t state)
511 511
512 INIT_LIST_HEAD(&list); 512 INIT_LIST_HEAD(&list);
513 mutex_lock(&dpm_list_mtx); 513 mutex_lock(&dpm_list_mtx);
514 transition_started = false;
514 while (!list_empty(&dpm_list)) { 515 while (!list_empty(&dpm_list)) {
515 struct device *dev = to_device(dpm_list.prev); 516 struct device *dev = to_device(dpm_list.prev);
516 517
diff --git a/drivers/base/power/runtime.c b/drivers/base/power/runtime.c
index 38556f6cc22d..846d89e3d122 100644
--- a/drivers/base/power/runtime.c
+++ b/drivers/base/power/runtime.c
@@ -51,8 +51,6 @@ static int __pm_runtime_idle(struct device *dev)
51{ 51{
52 int retval = 0; 52 int retval = 0;
53 53
54 dev_dbg(dev, "__pm_runtime_idle()!\n");
55
56 if (dev->power.runtime_error) 54 if (dev->power.runtime_error)
57 retval = -EINVAL; 55 retval = -EINVAL;
58 else if (dev->power.idle_notification) 56 else if (dev->power.idle_notification)
@@ -93,8 +91,6 @@ static int __pm_runtime_idle(struct device *dev)
93 wake_up_all(&dev->power.wait_queue); 91 wake_up_all(&dev->power.wait_queue);
94 92
95 out: 93 out:
96 dev_dbg(dev, "__pm_runtime_idle() returns %d!\n", retval);
97
98 return retval; 94 return retval;
99} 95}
100 96
@@ -332,11 +328,11 @@ int __pm_runtime_resume(struct device *dev, bool from_wq)
332 * necessary. 328 * necessary.
333 */ 329 */
334 parent = dev->parent; 330 parent = dev->parent;
335 spin_unlock_irq(&dev->power.lock); 331 spin_unlock(&dev->power.lock);
336 332
337 pm_runtime_get_noresume(parent); 333 pm_runtime_get_noresume(parent);
338 334
339 spin_lock_irq(&parent->power.lock); 335 spin_lock(&parent->power.lock);
340 /* 336 /*
341 * We can resume if the parent's run-time PM is disabled or it 337 * We can resume if the parent's run-time PM is disabled or it
342 * is set to ignore children. 338 * is set to ignore children.
@@ -347,9 +343,9 @@ int __pm_runtime_resume(struct device *dev, bool from_wq)
347 if (parent->power.runtime_status != RPM_ACTIVE) 343 if (parent->power.runtime_status != RPM_ACTIVE)
348 retval = -EBUSY; 344 retval = -EBUSY;
349 } 345 }
350 spin_unlock_irq(&parent->power.lock); 346 spin_unlock(&parent->power.lock);
351 347
352 spin_lock_irq(&dev->power.lock); 348 spin_lock(&dev->power.lock);
353 if (retval) 349 if (retval)
354 goto out; 350 goto out;
355 goto repeat; 351 goto repeat;
@@ -781,7 +777,7 @@ int __pm_runtime_set_status(struct device *dev, unsigned int status)
781 } 777 }
782 778
783 if (parent) { 779 if (parent) {
784 spin_lock_irq(&parent->power.lock); 780 spin_lock(&parent->power.lock);
785 781
786 /* 782 /*
787 * It is invalid to put an active child under a parent that is 783 * It is invalid to put an active child under a parent that is
@@ -797,7 +793,7 @@ int __pm_runtime_set_status(struct device *dev, unsigned int status)
797 atomic_inc(&parent->power.child_count); 793 atomic_inc(&parent->power.child_count);
798 } 794 }
799 795
800 spin_unlock_irq(&parent->power.lock); 796 spin_unlock(&parent->power.lock);
801 797
802 if (error) 798 if (error)
803 goto out; 799 goto out;
diff --git a/drivers/block/aoe/aoecmd.c b/drivers/block/aoe/aoecmd.c
index 965ece2c7e4d..13bb69d2abb3 100644
--- a/drivers/block/aoe/aoecmd.c
+++ b/drivers/block/aoe/aoecmd.c
@@ -735,6 +735,21 @@ diskstats(struct gendisk *disk, struct bio *bio, ulong duration, sector_t sector
735 part_stat_unlock(); 735 part_stat_unlock();
736} 736}
737 737
738/*
739 * Ensure we don't create aliases in VI caches
740 */
741static inline void
742killalias(struct bio *bio)
743{
744 struct bio_vec *bv;
745 int i;
746
747 if (bio_data_dir(bio) == READ)
748 __bio_for_each_segment(bv, bio, i, 0) {
749 flush_dcache_page(bv->bv_page);
750 }
751}
752
738void 753void
739aoecmd_ata_rsp(struct sk_buff *skb) 754aoecmd_ata_rsp(struct sk_buff *skb)
740{ 755{
@@ -853,8 +868,12 @@ aoecmd_ata_rsp(struct sk_buff *skb)
853 868
854 if (buf && --buf->nframesout == 0 && buf->resid == 0) { 869 if (buf && --buf->nframesout == 0 && buf->resid == 0) {
855 diskstats(d->gd, buf->bio, jiffies - buf->stime, buf->sector); 870 diskstats(d->gd, buf->bio, jiffies - buf->stime, buf->sector);
856 n = (buf->flags & BUFFL_FAIL) ? -EIO : 0; 871 if (buf->flags & BUFFL_FAIL)
857 bio_endio(buf->bio, n); 872 bio_endio(buf->bio, -EIO);
873 else {
874 killalias(buf->bio);
875 bio_endio(buf->bio, 0);
876 }
858 mempool_free(buf, d->bufpool); 877 mempool_free(buf, d->bufpool);
859 } 878 }
860 879
diff --git a/drivers/block/cciss.c b/drivers/block/cciss.c
index 6399e5090df4..92b126394fa1 100644
--- a/drivers/block/cciss.c
+++ b/drivers/block/cciss.c
@@ -482,7 +482,7 @@ static ssize_t host_store_rescan(struct device *dev,
482 482
483 return count; 483 return count;
484} 484}
485DEVICE_ATTR(rescan, S_IWUSR, NULL, host_store_rescan); 485static DEVICE_ATTR(rescan, S_IWUSR, NULL, host_store_rescan);
486 486
487static ssize_t dev_show_unique_id(struct device *dev, 487static ssize_t dev_show_unique_id(struct device *dev,
488 struct device_attribute *attr, 488 struct device_attribute *attr,
@@ -512,7 +512,7 @@ static ssize_t dev_show_unique_id(struct device *dev,
512 sn[8], sn[9], sn[10], sn[11], 512 sn[8], sn[9], sn[10], sn[11],
513 sn[12], sn[13], sn[14], sn[15]); 513 sn[12], sn[13], sn[14], sn[15]);
514} 514}
515DEVICE_ATTR(unique_id, S_IRUGO, dev_show_unique_id, NULL); 515static DEVICE_ATTR(unique_id, S_IRUGO, dev_show_unique_id, NULL);
516 516
517static ssize_t dev_show_vendor(struct device *dev, 517static ssize_t dev_show_vendor(struct device *dev,
518 struct device_attribute *attr, 518 struct device_attribute *attr,
@@ -536,7 +536,7 @@ static ssize_t dev_show_vendor(struct device *dev,
536 else 536 else
537 return snprintf(buf, sizeof(vendor) + 1, "%s\n", drv->vendor); 537 return snprintf(buf, sizeof(vendor) + 1, "%s\n", drv->vendor);
538} 538}
539DEVICE_ATTR(vendor, S_IRUGO, dev_show_vendor, NULL); 539static DEVICE_ATTR(vendor, S_IRUGO, dev_show_vendor, NULL);
540 540
541static ssize_t dev_show_model(struct device *dev, 541static ssize_t dev_show_model(struct device *dev,
542 struct device_attribute *attr, 542 struct device_attribute *attr,
@@ -560,7 +560,7 @@ static ssize_t dev_show_model(struct device *dev,
560 else 560 else
561 return snprintf(buf, sizeof(model) + 1, "%s\n", drv->model); 561 return snprintf(buf, sizeof(model) + 1, "%s\n", drv->model);
562} 562}
563DEVICE_ATTR(model, S_IRUGO, dev_show_model, NULL); 563static DEVICE_ATTR(model, S_IRUGO, dev_show_model, NULL);
564 564
565static ssize_t dev_show_rev(struct device *dev, 565static ssize_t dev_show_rev(struct device *dev,
566 struct device_attribute *attr, 566 struct device_attribute *attr,
@@ -584,7 +584,7 @@ static ssize_t dev_show_rev(struct device *dev,
584 else 584 else
585 return snprintf(buf, sizeof(rev) + 1, "%s\n", drv->rev); 585 return snprintf(buf, sizeof(rev) + 1, "%s\n", drv->rev);
586} 586}
587DEVICE_ATTR(rev, S_IRUGO, dev_show_rev, NULL); 587static DEVICE_ATTR(rev, S_IRUGO, dev_show_rev, NULL);
588 588
589static ssize_t cciss_show_lunid(struct device *dev, 589static ssize_t cciss_show_lunid(struct device *dev,
590 struct device_attribute *attr, char *buf) 590 struct device_attribute *attr, char *buf)
@@ -609,7 +609,7 @@ static ssize_t cciss_show_lunid(struct device *dev,
609 lunid[0], lunid[1], lunid[2], lunid[3], 609 lunid[0], lunid[1], lunid[2], lunid[3],
610 lunid[4], lunid[5], lunid[6], lunid[7]); 610 lunid[4], lunid[5], lunid[6], lunid[7]);
611} 611}
612DEVICE_ATTR(lunid, S_IRUGO, cciss_show_lunid, NULL); 612static DEVICE_ATTR(lunid, S_IRUGO, cciss_show_lunid, NULL);
613 613
614static ssize_t cciss_show_raid_level(struct device *dev, 614static ssize_t cciss_show_raid_level(struct device *dev,
615 struct device_attribute *attr, char *buf) 615 struct device_attribute *attr, char *buf)
@@ -632,7 +632,7 @@ static ssize_t cciss_show_raid_level(struct device *dev,
632 return snprintf(buf, strlen(raid_label[raid]) + 7, "RAID %s\n", 632 return snprintf(buf, strlen(raid_label[raid]) + 7, "RAID %s\n",
633 raid_label[raid]); 633 raid_label[raid]);
634} 634}
635DEVICE_ATTR(raid_level, S_IRUGO, cciss_show_raid_level, NULL); 635static DEVICE_ATTR(raid_level, S_IRUGO, cciss_show_raid_level, NULL);
636 636
637static ssize_t cciss_show_usage_count(struct device *dev, 637static ssize_t cciss_show_usage_count(struct device *dev,
638 struct device_attribute *attr, char *buf) 638 struct device_attribute *attr, char *buf)
@@ -651,7 +651,7 @@ static ssize_t cciss_show_usage_count(struct device *dev,
651 spin_unlock_irqrestore(CCISS_LOCK(h->ctlr), flags); 651 spin_unlock_irqrestore(CCISS_LOCK(h->ctlr), flags);
652 return snprintf(buf, 20, "%d\n", count); 652 return snprintf(buf, 20, "%d\n", count);
653} 653}
654DEVICE_ATTR(usage_count, S_IRUGO, cciss_show_usage_count, NULL); 654static DEVICE_ATTR(usage_count, S_IRUGO, cciss_show_usage_count, NULL);
655 655
656static struct attribute *cciss_host_attrs[] = { 656static struct attribute *cciss_host_attrs[] = {
657 &dev_attr_rescan.attr, 657 &dev_attr_rescan.attr,
diff --git a/drivers/bluetooth/bluecard_cs.c b/drivers/bluetooth/bluecard_cs.c
index b0e569ba730d..2acdc605cb4b 100644
--- a/drivers/bluetooth/bluecard_cs.c
+++ b/drivers/bluetooth/bluecard_cs.c
@@ -867,11 +867,9 @@ static int bluecard_probe(struct pcmcia_device *link)
867 867
868 link->io.Attributes1 = IO_DATA_PATH_WIDTH_8; 868 link->io.Attributes1 = IO_DATA_PATH_WIDTH_8;
869 link->io.NumPorts1 = 8; 869 link->io.NumPorts1 = 8;
870 link->irq.Attributes = IRQ_TYPE_DYNAMIC_SHARING | IRQ_HANDLE_PRESENT; 870 link->irq.Attributes = IRQ_TYPE_DYNAMIC_SHARING;
871 link->irq.IRQInfo1 = IRQ_LEVEL_ID;
872 871
873 link->irq.Handler = bluecard_interrupt; 872 link->irq.Handler = bluecard_interrupt;
874 link->irq.Instance = info;
875 873
876 link->conf.Attributes = CONF_ENABLE_IRQ; 874 link->conf.Attributes = CONF_ENABLE_IRQ;
877 link->conf.IntType = INT_MEMORY_AND_IO; 875 link->conf.IntType = INT_MEMORY_AND_IO;
@@ -905,22 +903,16 @@ static int bluecard_config(struct pcmcia_device *link)
905 break; 903 break;
906 } 904 }
907 905
908 if (i != 0) { 906 if (i != 0)
909 cs_error(link, RequestIO, i);
910 goto failed; 907 goto failed;
911 }
912 908
913 i = pcmcia_request_irq(link, &link->irq); 909 i = pcmcia_request_irq(link, &link->irq);
914 if (i != 0) { 910 if (i != 0)
915 cs_error(link, RequestIRQ, i);
916 link->irq.AssignedIRQ = 0; 911 link->irq.AssignedIRQ = 0;
917 }
918 912
919 i = pcmcia_request_configuration(link, &link->conf); 913 i = pcmcia_request_configuration(link, &link->conf);
920 if (i != 0) { 914 if (i != 0)
921 cs_error(link, RequestConfiguration, i);
922 goto failed; 915 goto failed;
923 }
924 916
925 if (bluecard_open(info) != 0) 917 if (bluecard_open(info) != 0)
926 goto failed; 918 goto failed;
diff --git a/drivers/bluetooth/bt3c_cs.c b/drivers/bluetooth/bt3c_cs.c
index d58e22b9f06a..d814a2755ccb 100644
--- a/drivers/bluetooth/bt3c_cs.c
+++ b/drivers/bluetooth/bt3c_cs.c
@@ -659,11 +659,9 @@ static int bt3c_probe(struct pcmcia_device *link)
659 659
660 link->io.Attributes1 = IO_DATA_PATH_WIDTH_8; 660 link->io.Attributes1 = IO_DATA_PATH_WIDTH_8;
661 link->io.NumPorts1 = 8; 661 link->io.NumPorts1 = 8;
662 link->irq.Attributes = IRQ_TYPE_DYNAMIC_SHARING | IRQ_HANDLE_PRESENT; 662 link->irq.Attributes = IRQ_TYPE_DYNAMIC_SHARING;
663 link->irq.IRQInfo1 = IRQ_LEVEL_ID;
664 663
665 link->irq.Handler = bt3c_interrupt; 664 link->irq.Handler = bt3c_interrupt;
666 link->irq.Instance = info;
667 665
668 link->conf.Attributes = CONF_ENABLE_IRQ; 666 link->conf.Attributes = CONF_ENABLE_IRQ;
669 link->conf.IntType = INT_MEMORY_AND_IO; 667 link->conf.IntType = INT_MEMORY_AND_IO;
@@ -740,21 +738,16 @@ static int bt3c_config(struct pcmcia_device *link)
740 goto found_port; 738 goto found_port;
741 739
742 BT_ERR("No usable port range found"); 740 BT_ERR("No usable port range found");
743 cs_error(link, RequestIO, -ENODEV);
744 goto failed; 741 goto failed;
745 742
746found_port: 743found_port:
747 i = pcmcia_request_irq(link, &link->irq); 744 i = pcmcia_request_irq(link, &link->irq);
748 if (i != 0) { 745 if (i != 0)
749 cs_error(link, RequestIRQ, i);
750 link->irq.AssignedIRQ = 0; 746 link->irq.AssignedIRQ = 0;
751 }
752 747
753 i = pcmcia_request_configuration(link, &link->conf); 748 i = pcmcia_request_configuration(link, &link->conf);
754 if (i != 0) { 749 if (i != 0)
755 cs_error(link, RequestConfiguration, i);
756 goto failed; 750 goto failed;
757 }
758 751
759 if (bt3c_open(info) != 0) 752 if (bt3c_open(info) != 0)
760 goto failed; 753 goto failed;
diff --git a/drivers/bluetooth/btuart_cs.c b/drivers/bluetooth/btuart_cs.c
index efd689a062eb..d339464dc15e 100644
--- a/drivers/bluetooth/btuart_cs.c
+++ b/drivers/bluetooth/btuart_cs.c
@@ -588,11 +588,9 @@ static int btuart_probe(struct pcmcia_device *link)
588 588
589 link->io.Attributes1 = IO_DATA_PATH_WIDTH_8; 589 link->io.Attributes1 = IO_DATA_PATH_WIDTH_8;
590 link->io.NumPorts1 = 8; 590 link->io.NumPorts1 = 8;
591 link->irq.Attributes = IRQ_TYPE_DYNAMIC_SHARING | IRQ_HANDLE_PRESENT; 591 link->irq.Attributes = IRQ_TYPE_DYNAMIC_SHARING;
592 link->irq.IRQInfo1 = IRQ_LEVEL_ID;
593 592
594 link->irq.Handler = btuart_interrupt; 593 link->irq.Handler = btuart_interrupt;
595 link->irq.Instance = info;
596 594
597 link->conf.Attributes = CONF_ENABLE_IRQ; 595 link->conf.Attributes = CONF_ENABLE_IRQ;
598 link->conf.IntType = INT_MEMORY_AND_IO; 596 link->conf.IntType = INT_MEMORY_AND_IO;
@@ -669,21 +667,16 @@ static int btuart_config(struct pcmcia_device *link)
669 goto found_port; 667 goto found_port;
670 668
671 BT_ERR("No usable port range found"); 669 BT_ERR("No usable port range found");
672 cs_error(link, RequestIO, -ENODEV);
673 goto failed; 670 goto failed;
674 671
675found_port: 672found_port:
676 i = pcmcia_request_irq(link, &link->irq); 673 i = pcmcia_request_irq(link, &link->irq);
677 if (i != 0) { 674 if (i != 0)
678 cs_error(link, RequestIRQ, i);
679 link->irq.AssignedIRQ = 0; 675 link->irq.AssignedIRQ = 0;
680 }
681 676
682 i = pcmcia_request_configuration(link, &link->conf); 677 i = pcmcia_request_configuration(link, &link->conf);
683 if (i != 0) { 678 if (i != 0)
684 cs_error(link, RequestConfiguration, i);
685 goto failed; 679 goto failed;
686 }
687 680
688 if (btuart_open(info) != 0) 681 if (btuart_open(info) != 0)
689 goto failed; 682 goto failed;
diff --git a/drivers/bluetooth/btusb.c b/drivers/bluetooth/btusb.c
index 7ba91aa3fe8b..44bc8bbabf54 100644
--- a/drivers/bluetooth/btusb.c
+++ b/drivers/bluetooth/btusb.c
@@ -591,6 +591,7 @@ static int btusb_close(struct hci_dev *hdev)
591 return 0; 591 return 0;
592 592
593 cancel_work_sync(&data->work); 593 cancel_work_sync(&data->work);
594 cancel_work_sync(&data->waker);
594 595
595 clear_bit(BTUSB_ISOC_RUNNING, &data->flags); 596 clear_bit(BTUSB_ISOC_RUNNING, &data->flags);
596 clear_bit(BTUSB_BULK_RUNNING, &data->flags); 597 clear_bit(BTUSB_BULK_RUNNING, &data->flags);
@@ -599,11 +600,13 @@ static int btusb_close(struct hci_dev *hdev)
599 btusb_stop_traffic(data); 600 btusb_stop_traffic(data);
600 err = usb_autopm_get_interface(data->intf); 601 err = usb_autopm_get_interface(data->intf);
601 if (err < 0) 602 if (err < 0)
602 return 0; 603 goto failed;
603 604
604 data->intf->needs_remote_wakeup = 0; 605 data->intf->needs_remote_wakeup = 0;
605 usb_autopm_put_interface(data->intf); 606 usb_autopm_put_interface(data->intf);
606 607
608failed:
609 usb_scuttle_anchored_urbs(&data->deferred);
607 return 0; 610 return 0;
608} 611}
609 612
diff --git a/drivers/bluetooth/dtl1_cs.c b/drivers/bluetooth/dtl1_cs.c
index b881a9cd8741..4f02a6f3c980 100644
--- a/drivers/bluetooth/dtl1_cs.c
+++ b/drivers/bluetooth/dtl1_cs.c
@@ -573,11 +573,9 @@ static int dtl1_probe(struct pcmcia_device *link)
573 573
574 link->io.Attributes1 = IO_DATA_PATH_WIDTH_8; 574 link->io.Attributes1 = IO_DATA_PATH_WIDTH_8;
575 link->io.NumPorts1 = 8; 575 link->io.NumPorts1 = 8;
576 link->irq.Attributes = IRQ_TYPE_DYNAMIC_SHARING | IRQ_HANDLE_PRESENT; 576 link->irq.Attributes = IRQ_TYPE_DYNAMIC_SHARING;
577 link->irq.IRQInfo1 = IRQ_LEVEL_ID;
578 577
579 link->irq.Handler = dtl1_interrupt; 578 link->irq.Handler = dtl1_interrupt;
580 link->irq.Instance = info;
581 579
582 link->conf.Attributes = CONF_ENABLE_IRQ; 580 link->conf.Attributes = CONF_ENABLE_IRQ;
583 link->conf.IntType = INT_MEMORY_AND_IO; 581 link->conf.IntType = INT_MEMORY_AND_IO;
@@ -622,16 +620,12 @@ static int dtl1_config(struct pcmcia_device *link)
622 goto failed; 620 goto failed;
623 621
624 i = pcmcia_request_irq(link, &link->irq); 622 i = pcmcia_request_irq(link, &link->irq);
625 if (i != 0) { 623 if (i != 0)
626 cs_error(link, RequestIRQ, i);
627 link->irq.AssignedIRQ = 0; 624 link->irq.AssignedIRQ = 0;
628 }
629 625
630 i = pcmcia_request_configuration(link, &link->conf); 626 i = pcmcia_request_configuration(link, &link->conf);
631 if (i != 0) { 627 if (i != 0)
632 cs_error(link, RequestConfiguration, i);
633 goto failed; 628 goto failed;
634 }
635 629
636 if (dtl1_open(info) != 0) 630 if (dtl1_open(info) != 0)
637 goto failed; 631 goto failed;
diff --git a/drivers/char/agp/Kconfig b/drivers/char/agp/Kconfig
index ccb1fa89de29..2fb3a480f6b0 100644
--- a/drivers/char/agp/Kconfig
+++ b/drivers/char/agp/Kconfig
@@ -56,9 +56,8 @@ config AGP_AMD
56 X on AMD Irongate, 761, and 762 chipsets. 56 X on AMD Irongate, 761, and 762 chipsets.
57 57
58config AGP_AMD64 58config AGP_AMD64
59 tristate "AMD Opteron/Athlon64 on-CPU GART support" if !GART_IOMMU 59 tristate "AMD Opteron/Athlon64 on-CPU GART support"
60 depends on AGP && X86 60 depends on AGP && X86
61 default y if GART_IOMMU
62 help 61 help
63 This option gives you AGP support for the GLX component of 62 This option gives you AGP support for the GLX component of
64 X using the on-CPU northbridge of the AMD Athlon64/Opteron CPUs. 63 X using the on-CPU northbridge of the AMD Athlon64/Opteron CPUs.
diff --git a/drivers/char/agp/intel-agp.c b/drivers/char/agp/intel-agp.c
index 4068467ce7b9..3cb56a049e24 100644
--- a/drivers/char/agp/intel-agp.c
+++ b/drivers/char/agp/intel-agp.c
@@ -62,6 +62,7 @@
62#define PCI_DEVICE_ID_INTEL_IGDNG_D_IG 0x0042 62#define PCI_DEVICE_ID_INTEL_IGDNG_D_IG 0x0042
63#define PCI_DEVICE_ID_INTEL_IGDNG_M_HB 0x0044 63#define PCI_DEVICE_ID_INTEL_IGDNG_M_HB 0x0044
64#define PCI_DEVICE_ID_INTEL_IGDNG_MA_HB 0x0062 64#define PCI_DEVICE_ID_INTEL_IGDNG_MA_HB 0x0062
65#define PCI_DEVICE_ID_INTEL_IGDNG_MC2_HB 0x006a
65#define PCI_DEVICE_ID_INTEL_IGDNG_M_IG 0x0046 66#define PCI_DEVICE_ID_INTEL_IGDNG_M_IG 0x0046
66 67
67/* cover 915 and 945 variants */ 68/* cover 915 and 945 variants */
@@ -96,7 +97,8 @@
96 agp_bridge->dev->device == PCI_DEVICE_ID_INTEL_B43_HB || \ 97 agp_bridge->dev->device == PCI_DEVICE_ID_INTEL_B43_HB || \
97 agp_bridge->dev->device == PCI_DEVICE_ID_INTEL_IGDNG_D_HB || \ 98 agp_bridge->dev->device == PCI_DEVICE_ID_INTEL_IGDNG_D_HB || \
98 agp_bridge->dev->device == PCI_DEVICE_ID_INTEL_IGDNG_M_HB || \ 99 agp_bridge->dev->device == PCI_DEVICE_ID_INTEL_IGDNG_M_HB || \
99 agp_bridge->dev->device == PCI_DEVICE_ID_INTEL_IGDNG_MA_HB) 100 agp_bridge->dev->device == PCI_DEVICE_ID_INTEL_IGDNG_MA_HB || \
101 agp_bridge->dev->device == PCI_DEVICE_ID_INTEL_IGDNG_MC2_HB)
100 102
101extern int agp_memory_reserved; 103extern int agp_memory_reserved;
102 104
@@ -1161,12 +1163,6 @@ static int intel_i915_configure(void)
1161 1163
1162 intel_i9xx_setup_flush(); 1164 intel_i9xx_setup_flush();
1163 1165
1164#ifdef USE_PCI_DMA_API
1165 if (pci_set_dma_mask(intel_private.pcidev, DMA_BIT_MASK(36)))
1166 dev_err(&intel_private.pcidev->dev,
1167 "set gfx device dma mask 36bit failed!\n");
1168#endif
1169
1170 return 0; 1166 return 0;
1171} 1167}
1172 1168
@@ -1364,6 +1360,7 @@ static void intel_i965_get_gtt_range(int *gtt_offset, int *gtt_size)
1364 case PCI_DEVICE_ID_INTEL_IGDNG_D_HB: 1360 case PCI_DEVICE_ID_INTEL_IGDNG_D_HB:
1365 case PCI_DEVICE_ID_INTEL_IGDNG_M_HB: 1361 case PCI_DEVICE_ID_INTEL_IGDNG_M_HB:
1366 case PCI_DEVICE_ID_INTEL_IGDNG_MA_HB: 1362 case PCI_DEVICE_ID_INTEL_IGDNG_MA_HB:
1363 case PCI_DEVICE_ID_INTEL_IGDNG_MC2_HB:
1367 *gtt_offset = *gtt_size = MB(2); 1364 *gtt_offset = *gtt_size = MB(2);
1368 break; 1365 break;
1369 default: 1366 default:
@@ -2365,6 +2362,8 @@ static const struct intel_driver_description {
2365 "IGDNG/M", NULL, &intel_i965_driver }, 2362 "IGDNG/M", NULL, &intel_i965_driver },
2366 { PCI_DEVICE_ID_INTEL_IGDNG_MA_HB, PCI_DEVICE_ID_INTEL_IGDNG_M_IG, 0, 2363 { PCI_DEVICE_ID_INTEL_IGDNG_MA_HB, PCI_DEVICE_ID_INTEL_IGDNG_M_IG, 0,
2367 "IGDNG/MA", NULL, &intel_i965_driver }, 2364 "IGDNG/MA", NULL, &intel_i965_driver },
2365 { PCI_DEVICE_ID_INTEL_IGDNG_MC2_HB, PCI_DEVICE_ID_INTEL_IGDNG_M_IG, 0,
2366 "IGDNG/MC2", NULL, &intel_i965_driver },
2368 { 0, 0, 0, NULL, NULL, NULL } 2367 { 0, 0, 0, NULL, NULL, NULL }
2369}; 2368};
2370 2369
@@ -2456,6 +2455,11 @@ static int __devinit agp_intel_probe(struct pci_dev *pdev,
2456 &bridge->mode); 2455 &bridge->mode);
2457 } 2456 }
2458 2457
2458 if (bridge->driver->mask_memory == intel_i965_mask_memory)
2459 if (pci_set_dma_mask(intel_private.pcidev, DMA_BIT_MASK(36)))
2460 dev_err(&intel_private.pcidev->dev,
2461 "set gfx device dma mask 36bit failed!\n");
2462
2459 pci_set_drvdata(pdev, bridge); 2463 pci_set_drvdata(pdev, bridge);
2460 return agp_add_bridge(bridge); 2464 return agp_add_bridge(bridge);
2461} 2465}
@@ -2561,6 +2565,7 @@ static struct pci_device_id agp_intel_pci_table[] = {
2561 ID(PCI_DEVICE_ID_INTEL_IGDNG_D_HB), 2565 ID(PCI_DEVICE_ID_INTEL_IGDNG_D_HB),
2562 ID(PCI_DEVICE_ID_INTEL_IGDNG_M_HB), 2566 ID(PCI_DEVICE_ID_INTEL_IGDNG_M_HB),
2563 ID(PCI_DEVICE_ID_INTEL_IGDNG_MA_HB), 2567 ID(PCI_DEVICE_ID_INTEL_IGDNG_MA_HB),
2568 ID(PCI_DEVICE_ID_INTEL_IGDNG_MC2_HB),
2564 { } 2569 { }
2565}; 2570};
2566 2571
diff --git a/drivers/char/hvc_xen.c b/drivers/char/hvc_xen.c
index eba999f8598d..a6ee32b599a8 100644
--- a/drivers/char/hvc_xen.c
+++ b/drivers/char/hvc_xen.c
@@ -55,7 +55,7 @@ static inline void notify_daemon(void)
55 notify_remote_via_evtchn(xen_start_info->console.domU.evtchn); 55 notify_remote_via_evtchn(xen_start_info->console.domU.evtchn);
56} 56}
57 57
58static int write_console(uint32_t vtermno, const char *data, int len) 58static int __write_console(const char *data, int len)
59{ 59{
60 struct xencons_interface *intf = xencons_interface(); 60 struct xencons_interface *intf = xencons_interface();
61 XENCONS_RING_IDX cons, prod; 61 XENCONS_RING_IDX cons, prod;
@@ -76,6 +76,29 @@ static int write_console(uint32_t vtermno, const char *data, int len)
76 return sent; 76 return sent;
77} 77}
78 78
79static int write_console(uint32_t vtermno, const char *data, int len)
80{
81 int ret = len;
82
83 /*
84 * Make sure the whole buffer is emitted, polling if
85 * necessary. We don't ever want to rely on the hvc daemon
86 * because the most interesting console output is when the
87 * kernel is crippled.
88 */
89 while (len) {
90 int sent = __write_console(data, len);
91
92 data += sent;
93 len -= sent;
94
95 if (unlikely(len))
96 HYPERVISOR_sched_op(SCHEDOP_yield, NULL);
97 }
98
99 return ret;
100}
101
79static int read_console(uint32_t vtermno, char *buf, int len) 102static int read_console(uint32_t vtermno, char *buf, int len)
80{ 103{
81 struct xencons_interface *intf = xencons_interface(); 104 struct xencons_interface *intf = xencons_interface();
diff --git a/drivers/char/keyboard.c b/drivers/char/keyboard.c
index 737be953cc58..950837cf9e9c 100644
--- a/drivers/char/keyboard.c
+++ b/drivers/char/keyboard.c
@@ -1249,7 +1249,7 @@ static void kbd_keycode(unsigned int keycode, int down, int hw_raw)
1249 1249
1250 if (keycode >= NR_KEYS) 1250 if (keycode >= NR_KEYS)
1251 if (keycode >= KEY_BRL_DOT1 && keycode <= KEY_BRL_DOT8) 1251 if (keycode >= KEY_BRL_DOT1 && keycode <= KEY_BRL_DOT8)
1252 keysym = K(KT_BRL, keycode - KEY_BRL_DOT1 + 1); 1252 keysym = U(K(KT_BRL, keycode - KEY_BRL_DOT1 + 1));
1253 else 1253 else
1254 return; 1254 return;
1255 else 1255 else
diff --git a/drivers/char/pcmcia/cm4000_cs.c b/drivers/char/pcmcia/cm4000_cs.c
index c250a31efa53..2db4c0a29b05 100644
--- a/drivers/char/pcmcia/cm4000_cs.c
+++ b/drivers/char/pcmcia/cm4000_cs.c
@@ -23,8 +23,6 @@
23 * All rights reserved. Licensed under dual BSD/GPL license. 23 * All rights reserved. Licensed under dual BSD/GPL license.
24 */ 24 */
25 25
26/* #define PCMCIA_DEBUG 6 */
27
28#include <linux/kernel.h> 26#include <linux/kernel.h>
29#include <linux/module.h> 27#include <linux/module.h>
30#include <linux/slab.h> 28#include <linux/slab.h>
@@ -47,18 +45,17 @@
47 45
48/* #define ATR_CSUM */ 46/* #define ATR_CSUM */
49 47
50#ifdef PCMCIA_DEBUG 48#define reader_to_dev(x) (&x->p_dev->dev)
51#define reader_to_dev(x) (&handle_to_dev(x->p_dev)) 49
52static int pc_debug = PCMCIA_DEBUG; 50/* n (debug level) is ignored */
53module_param(pc_debug, int, 0600); 51/* additional debug output may be enabled by re-compiling with
54#define DEBUGP(n, rdr, x, args...) do { \ 52 * CM4000_DEBUG set */
55 if (pc_debug >= (n)) \ 53/* #define CM4000_DEBUG */
56 dev_printk(KERN_DEBUG, reader_to_dev(rdr), "%s:" x, \ 54#define DEBUGP(n, rdr, x, args...) do { \
57 __func__ , ## args); \ 55 dev_dbg(reader_to_dev(rdr), "%s:" x, \
56 __func__ , ## args); \
58 } while (0) 57 } while (0)
59#else 58
60#define DEBUGP(n, rdr, x, args...)
61#endif
62static char *version = "cm4000_cs.c v2.4.0gm6 - All bugs added by Harald Welte"; 59static char *version = "cm4000_cs.c v2.4.0gm6 - All bugs added by Harald Welte";
63 60
64#define T_1SEC (HZ) 61#define T_1SEC (HZ)
@@ -174,14 +171,13 @@ static unsigned char fi_di_table[10][14] = {
174/* 9 */ {0x09,0x19,0x29,0x39,0x49,0x59,0x69,0x11,0x11,0x99,0xA9,0xB9,0xC9,0xD9} 171/* 9 */ {0x09,0x19,0x29,0x39,0x49,0x59,0x69,0x11,0x11,0x99,0xA9,0xB9,0xC9,0xD9}
175}; 172};
176 173
177#ifndef PCMCIA_DEBUG 174#ifndef CM4000_DEBUG
178#define xoutb outb 175#define xoutb outb
179#define xinb inb 176#define xinb inb
180#else 177#else
181static inline void xoutb(unsigned char val, unsigned short port) 178static inline void xoutb(unsigned char val, unsigned short port)
182{ 179{
183 if (pc_debug >= 7) 180 pr_debug("outb(val=%.2x,port=%.4x)\n", val, port);
184 printk(KERN_DEBUG "outb(val=%.2x,port=%.4x)\n", val, port);
185 outb(val, port); 181 outb(val, port);
186} 182}
187static inline unsigned char xinb(unsigned short port) 183static inline unsigned char xinb(unsigned short port)
@@ -189,8 +185,7 @@ static inline unsigned char xinb(unsigned short port)
189 unsigned char val; 185 unsigned char val;
190 186
191 val = inb(port); 187 val = inb(port);
192 if (pc_debug >= 7) 188 pr_debug("%.2x=inb(%.4x)\n", val, port);
193 printk(KERN_DEBUG "%.2x=inb(%.4x)\n", val, port);
194 189
195 return val; 190 return val;
196} 191}
@@ -514,12 +509,10 @@ static int set_protocol(struct cm4000_dev *dev, struct ptsreq *ptsreq)
514 for (i = 0; i < 4; i++) { 509 for (i = 0; i < 4; i++) {
515 xoutb(i, REG_BUF_ADDR(iobase)); 510 xoutb(i, REG_BUF_ADDR(iobase));
516 xoutb(dev->pts[i], REG_BUF_DATA(iobase)); /* buf data */ 511 xoutb(dev->pts[i], REG_BUF_DATA(iobase)); /* buf data */
517#ifdef PCMCIA_DEBUG 512#ifdef CM4000_DEBUG
518 if (pc_debug >= 5) 513 pr_debug("0x%.2x ", dev->pts[i]);
519 printk("0x%.2x ", dev->pts[i]);
520 } 514 }
521 if (pc_debug >= 5) 515 pr_debug("\n");
522 printk("\n");
523#else 516#else
524 } 517 }
525#endif 518#endif
@@ -579,14 +572,13 @@ static int set_protocol(struct cm4000_dev *dev, struct ptsreq *ptsreq)
579 pts_reply[i] = inb(REG_BUF_DATA(iobase)); 572 pts_reply[i] = inb(REG_BUF_DATA(iobase));
580 } 573 }
581 574
582#ifdef PCMCIA_DEBUG 575#ifdef CM4000_DEBUG
583 DEBUGP(2, dev, "PTSreply: "); 576 DEBUGP(2, dev, "PTSreply: ");
584 for (i = 0; i < num_bytes_read; i++) { 577 for (i = 0; i < num_bytes_read; i++) {
585 if (pc_debug >= 5) 578 pr_debug("0x%.2x ", pts_reply[i]);
586 printk("0x%.2x ", pts_reply[i]);
587 } 579 }
588 printk("\n"); 580 pr_debug("\n");
589#endif /* PCMCIA_DEBUG */ 581#endif /* CM4000_DEBUG */
590 582
591 DEBUGP(5, dev, "Clear Tactive in Flags1\n"); 583 DEBUGP(5, dev, "Clear Tactive in Flags1\n");
592 xoutb(0x20, REG_FLAGS1(iobase)); 584 xoutb(0x20, REG_FLAGS1(iobase));
@@ -655,7 +647,7 @@ static void terminate_monitor(struct cm4000_dev *dev)
655 647
656 DEBUGP(5, dev, "Delete timer\n"); 648 DEBUGP(5, dev, "Delete timer\n");
657 del_timer_sync(&dev->timer); 649 del_timer_sync(&dev->timer);
658#ifdef PCMCIA_DEBUG 650#ifdef CM4000_DEBUG
659 dev->monitor_running = 0; 651 dev->monitor_running = 0;
660#endif 652#endif
661 653
@@ -898,7 +890,7 @@ static void monitor_card(unsigned long p)
898 DEBUGP(4, dev, "ATR checksum (0x%.2x, should " 890 DEBUGP(4, dev, "ATR checksum (0x%.2x, should "
899 "be zero) failed\n", dev->atr_csum); 891 "be zero) failed\n", dev->atr_csum);
900 } 892 }
901#ifdef PCMCIA_DEBUG 893#ifdef CM4000_DEBUG
902 else if (test_bit(IS_BAD_LENGTH, &dev->flags)) { 894 else if (test_bit(IS_BAD_LENGTH, &dev->flags)) {
903 DEBUGP(4, dev, "ATR length error\n"); 895 DEBUGP(4, dev, "ATR length error\n");
904 } else { 896 } else {
@@ -1415,7 +1407,7 @@ static long cmm_ioctl(struct file *filp, unsigned int cmd, unsigned long arg)
1415 int size; 1407 int size;
1416 int rc; 1408 int rc;
1417 void __user *argp = (void __user *)arg; 1409 void __user *argp = (void __user *)arg;
1418#ifdef PCMCIA_DEBUG 1410#ifdef CM4000_DEBUG
1419 char *ioctl_names[CM_IOC_MAXNR + 1] = { 1411 char *ioctl_names[CM_IOC_MAXNR + 1] = {
1420 [_IOC_NR(CM_IOCGSTATUS)] "CM_IOCGSTATUS", 1412 [_IOC_NR(CM_IOCGSTATUS)] "CM_IOCGSTATUS",
1421 [_IOC_NR(CM_IOCGATR)] "CM_IOCGATR", 1413 [_IOC_NR(CM_IOCGATR)] "CM_IOCGATR",
@@ -1423,9 +1415,9 @@ static long cmm_ioctl(struct file *filp, unsigned int cmd, unsigned long arg)
1423 [_IOC_NR(CM_IOCSPTS)] "CM_IOCSPTS", 1415 [_IOC_NR(CM_IOCSPTS)] "CM_IOCSPTS",
1424 [_IOC_NR(CM_IOSDBGLVL)] "CM4000_DBGLVL", 1416 [_IOC_NR(CM_IOSDBGLVL)] "CM4000_DBGLVL",
1425 }; 1417 };
1426#endif
1427 DEBUGP(3, dev, "cmm_ioctl(device=%d.%d) %s\n", imajor(inode), 1418 DEBUGP(3, dev, "cmm_ioctl(device=%d.%d) %s\n", imajor(inode),
1428 iminor(inode), ioctl_names[_IOC_NR(cmd)]); 1419 iminor(inode), ioctl_names[_IOC_NR(cmd)]);
1420#endif
1429 1421
1430 lock_kernel(); 1422 lock_kernel();
1431 rc = -ENODEV; 1423 rc = -ENODEV;
@@ -1523,7 +1515,7 @@ static long cmm_ioctl(struct file *filp, unsigned int cmd, unsigned long arg)
1523 } 1515 }
1524 case CM_IOCARDOFF: 1516 case CM_IOCARDOFF:
1525 1517
1526#ifdef PCMCIA_DEBUG 1518#ifdef CM4000_DEBUG
1527 DEBUGP(4, dev, "... in CM_IOCARDOFF\n"); 1519 DEBUGP(4, dev, "... in CM_IOCARDOFF\n");
1528 if (dev->flags0 & 0x01) { 1520 if (dev->flags0 & 0x01) {
1529 DEBUGP(4, dev, " Card inserted\n"); 1521 DEBUGP(4, dev, " Card inserted\n");
@@ -1625,18 +1617,9 @@ static long cmm_ioctl(struct file *filp, unsigned int cmd, unsigned long arg)
1625 1617
1626 } 1618 }
1627 break; 1619 break;
1628#ifdef PCMCIA_DEBUG 1620#ifdef CM4000_DEBUG
1629 case CM_IOSDBGLVL: /* set debug log level */ 1621 case CM_IOSDBGLVL:
1630 { 1622 rc = -ENOTTY;
1631 int old_pc_debug = 0;
1632
1633 old_pc_debug = pc_debug;
1634 if (copy_from_user(&pc_debug, argp, sizeof(int)))
1635 rc = -EFAULT;
1636 else if (old_pc_debug != pc_debug)
1637 DEBUGP(0, dev, "Changed debug log level "
1638 "to %i\n", pc_debug);
1639 }
1640 break; 1623 break;
1641#endif 1624#endif
1642 default: 1625 default:
diff --git a/drivers/char/pcmcia/cm4040_cs.c b/drivers/char/pcmcia/cm4040_cs.c
index 4f0723b07974..a6a70e476bea 100644
--- a/drivers/char/pcmcia/cm4040_cs.c
+++ b/drivers/char/pcmcia/cm4040_cs.c
@@ -17,8 +17,6 @@
17 * All rights reserved, Dual BSD/GPL Licensed. 17 * All rights reserved, Dual BSD/GPL Licensed.
18 */ 18 */
19 19
20/* #define PCMCIA_DEBUG 6 */
21
22#include <linux/kernel.h> 20#include <linux/kernel.h>
23#include <linux/module.h> 21#include <linux/module.h>
24#include <linux/slab.h> 22#include <linux/slab.h>
@@ -41,18 +39,16 @@
41#include "cm4040_cs.h" 39#include "cm4040_cs.h"
42 40
43 41
44#ifdef PCMCIA_DEBUG 42#define reader_to_dev(x) (&x->p_dev->dev)
45#define reader_to_dev(x) (&handle_to_dev(x->p_dev)) 43
46static int pc_debug = PCMCIA_DEBUG; 44/* n (debug level) is ignored */
47module_param(pc_debug, int, 0600); 45/* additional debug output may be enabled by re-compiling with
48#define DEBUGP(n, rdr, x, args...) do { \ 46 * CM4040_DEBUG set */
49 if (pc_debug >= (n)) \ 47/* #define CM4040_DEBUG */
50 dev_printk(KERN_DEBUG, reader_to_dev(rdr), "%s:" x, \ 48#define DEBUGP(n, rdr, x, args...) do { \
51 __func__ , ##args); \ 49 dev_dbg(reader_to_dev(rdr), "%s:" x, \
50 __func__ , ## args); \
52 } while (0) 51 } while (0)
53#else
54#define DEBUGP(n, rdr, x, args...)
55#endif
56 52
57static char *version = 53static char *version =
58"OMNIKEY CardMan 4040 v1.1.0gm5 - All bugs added by Harald Welte"; 54"OMNIKEY CardMan 4040 v1.1.0gm5 - All bugs added by Harald Welte";
@@ -90,14 +86,13 @@ struct reader_dev {
90 86
91static struct pcmcia_device *dev_table[CM_MAX_DEV]; 87static struct pcmcia_device *dev_table[CM_MAX_DEV];
92 88
93#ifndef PCMCIA_DEBUG 89#ifndef CM4040_DEBUG
94#define xoutb outb 90#define xoutb outb
95#define xinb inb 91#define xinb inb
96#else 92#else
97static inline void xoutb(unsigned char val, unsigned short port) 93static inline void xoutb(unsigned char val, unsigned short port)
98{ 94{
99 if (pc_debug >= 7) 95 pr_debug("outb(val=%.2x,port=%.4x)\n", val, port);
100 printk(KERN_DEBUG "outb(val=%.2x,port=%.4x)\n", val, port);
101 outb(val, port); 96 outb(val, port);
102} 97}
103 98
@@ -106,8 +101,7 @@ static inline unsigned char xinb(unsigned short port)
106 unsigned char val; 101 unsigned char val;
107 102
108 val = inb(port); 103 val = inb(port);
109 if (pc_debug >= 7) 104 pr_debug("%.2x=inb(%.4x)\n", val, port);
110 printk(KERN_DEBUG "%.2x=inb(%.4x)\n", val, port);
111 return val; 105 return val;
112} 106}
113#endif 107#endif
@@ -260,23 +254,22 @@ static ssize_t cm4040_read(struct file *filp, char __user *buf,
260 return -EIO; 254 return -EIO;
261 } 255 }
262 dev->r_buf[i] = xinb(iobase + REG_OFFSET_BULK_IN); 256 dev->r_buf[i] = xinb(iobase + REG_OFFSET_BULK_IN);
263#ifdef PCMCIA_DEBUG 257#ifdef CM4040_DEBUG
264 if (pc_debug >= 6) 258 pr_debug("%lu:%2x ", i, dev->r_buf[i]);
265 printk(KERN_DEBUG "%lu:%2x ", i, dev->r_buf[i]);
266 } 259 }
267 printk("\n"); 260 pr_debug("\n");
268#else 261#else
269 } 262 }
270#endif 263#endif
271 264
272 bytes_to_read = 5 + le32_to_cpu(*(__le32 *)&dev->r_buf[1]); 265 bytes_to_read = 5 + le32_to_cpu(*(__le32 *)&dev->r_buf[1]);
273 266
274 DEBUGP(6, dev, "BytesToRead=%lu\n", bytes_to_read); 267 DEBUGP(6, dev, "BytesToRead=%zu\n", bytes_to_read);
275 268
276 min_bytes_to_read = min(count, bytes_to_read + 5); 269 min_bytes_to_read = min(count, bytes_to_read + 5);
277 min_bytes_to_read = min_t(size_t, min_bytes_to_read, READ_WRITE_BUFFER_SIZE); 270 min_bytes_to_read = min_t(size_t, min_bytes_to_read, READ_WRITE_BUFFER_SIZE);
278 271
279 DEBUGP(6, dev, "Min=%lu\n", min_bytes_to_read); 272 DEBUGP(6, dev, "Min=%zu\n", min_bytes_to_read);
280 273
281 for (i = 0; i < (min_bytes_to_read-5); i++) { 274 for (i = 0; i < (min_bytes_to_read-5); i++) {
282 rc = wait_for_bulk_in_ready(dev); 275 rc = wait_for_bulk_in_ready(dev);
@@ -288,11 +281,10 @@ static ssize_t cm4040_read(struct file *filp, char __user *buf,
288 return -EIO; 281 return -EIO;
289 } 282 }
290 dev->r_buf[i+5] = xinb(iobase + REG_OFFSET_BULK_IN); 283 dev->r_buf[i+5] = xinb(iobase + REG_OFFSET_BULK_IN);
291#ifdef PCMCIA_DEBUG 284#ifdef CM4040_DEBUG
292 if (pc_debug >= 6) 285 pr_debug("%lu:%2x ", i, dev->r_buf[i]);
293 printk(KERN_DEBUG "%lu:%2x ", i, dev->r_buf[i]);
294 } 286 }
295 printk("\n"); 287 pr_debug("\n");
296#else 288#else
297 } 289 }
298#endif 290#endif
@@ -547,7 +539,7 @@ static int cm4040_config_check(struct pcmcia_device *p_dev,
547 p_dev->io.IOAddrLines = cfg->io.flags & CISTPL_IO_LINES_MASK; 539 p_dev->io.IOAddrLines = cfg->io.flags & CISTPL_IO_LINES_MASK;
548 540
549 rc = pcmcia_request_io(p_dev, &p_dev->io); 541 rc = pcmcia_request_io(p_dev, &p_dev->io);
550 dev_printk(KERN_INFO, &handle_to_dev(p_dev), 542 dev_printk(KERN_INFO, &p_dev->dev,
551 "pcmcia_request_io returned 0x%x\n", rc); 543 "pcmcia_request_io returned 0x%x\n", rc);
552 return rc; 544 return rc;
553} 545}
@@ -569,7 +561,7 @@ static int reader_config(struct pcmcia_device *link, int devno)
569 561
570 fail_rc = pcmcia_request_configuration(link, &link->conf); 562 fail_rc = pcmcia_request_configuration(link, &link->conf);
571 if (fail_rc != 0) { 563 if (fail_rc != 0) {
572 dev_printk(KERN_INFO, &handle_to_dev(link), 564 dev_printk(KERN_INFO, &link->dev,
573 "pcmcia_request_configuration failed 0x%x\n", 565 "pcmcia_request_configuration failed 0x%x\n",
574 fail_rc); 566 fail_rc);
575 goto cs_release; 567 goto cs_release;
diff --git a/drivers/char/pcmcia/ipwireless/hardware.c b/drivers/char/pcmcia/ipwireless/hardware.c
index 4c1820cad712..99cffdab1056 100644
--- a/drivers/char/pcmcia/ipwireless/hardware.c
+++ b/drivers/char/pcmcia/ipwireless/hardware.c
@@ -1213,12 +1213,12 @@ static irqreturn_t ipwireless_handle_v2_v3_interrupt(int irq,
1213 1213
1214irqreturn_t ipwireless_interrupt(int irq, void *dev_id) 1214irqreturn_t ipwireless_interrupt(int irq, void *dev_id)
1215{ 1215{
1216 struct ipw_hardware *hw = dev_id; 1216 struct ipw_dev *ipw = dev_id;
1217 1217
1218 if (hw->hw_version == HW_VERSION_1) 1218 if (ipw->hardware->hw_version == HW_VERSION_1)
1219 return ipwireless_handle_v1_interrupt(irq, hw); 1219 return ipwireless_handle_v1_interrupt(irq, ipw->hardware);
1220 else 1220 else
1221 return ipwireless_handle_v2_v3_interrupt(irq, hw); 1221 return ipwireless_handle_v2_v3_interrupt(irq, ipw->hardware);
1222} 1222}
1223 1223
1224static void flush_packets_to_hw(struct ipw_hardware *hw) 1224static void flush_packets_to_hw(struct ipw_hardware *hw)
diff --git a/drivers/char/pcmcia/ipwireless/main.c b/drivers/char/pcmcia/ipwireless/main.c
index 5216fce0c62d..dff24dae1485 100644
--- a/drivers/char/pcmcia/ipwireless/main.c
+++ b/drivers/char/pcmcia/ipwireless/main.c
@@ -65,10 +65,7 @@ static void signalled_reboot_work(struct work_struct *work_reboot)
65 struct ipw_dev *ipw = container_of(work_reboot, struct ipw_dev, 65 struct ipw_dev *ipw = container_of(work_reboot, struct ipw_dev,
66 work_reboot); 66 work_reboot);
67 struct pcmcia_device *link = ipw->link; 67 struct pcmcia_device *link = ipw->link;
68 int ret = pcmcia_reset_card(link->socket); 68 pcmcia_reset_card(link->socket);
69
70 if (ret != 0)
71 cs_error(link, ResetCard, ret);
72} 69}
73 70
74static void signalled_reboot_callback(void *callback_data) 71static void signalled_reboot_callback(void *callback_data)
@@ -79,208 +76,127 @@ static void signalled_reboot_callback(void *callback_data)
79 schedule_work(&ipw->work_reboot); 76 schedule_work(&ipw->work_reboot);
80} 77}
81 78
82static int config_ipwireless(struct ipw_dev *ipw) 79static int ipwireless_probe(struct pcmcia_device *p_dev,
80 cistpl_cftable_entry_t *cfg,
81 cistpl_cftable_entry_t *dflt,
82 unsigned int vcc,
83 void *priv_data)
83{ 84{
84 struct pcmcia_device *link = ipw->link; 85 struct ipw_dev *ipw = priv_data;
85 int ret; 86 struct resource *io_resource;
86 tuple_t tuple;
87 unsigned short buf[64];
88 cisparse_t parse;
89 unsigned short cor_value;
90 memreq_t memreq_attr_memory; 87 memreq_t memreq_attr_memory;
91 memreq_t memreq_common_memory; 88 memreq_t memreq_common_memory;
89 int ret;
92 90
93 ipw->is_v2_card = 0; 91 p_dev->io.Attributes1 = IO_DATA_PATH_WIDTH_AUTO;
94 92 p_dev->io.BasePort1 = cfg->io.win[0].base;
95 tuple.Attributes = 0; 93 p_dev->io.NumPorts1 = cfg->io.win[0].len;
96 tuple.TupleData = (cisdata_t *) buf; 94 p_dev->io.IOAddrLines = 16;
97 tuple.TupleDataMax = sizeof(buf);
98 tuple.TupleOffset = 0;
99
100 tuple.DesiredTuple = RETURN_FIRST_TUPLE;
101
102 ret = pcmcia_get_first_tuple(link, &tuple);
103
104 while (ret == 0) {
105 ret = pcmcia_get_tuple_data(link, &tuple);
106
107 if (ret != 0) {
108 cs_error(link, GetTupleData, ret);
109 goto exit0;
110 }
111 ret = pcmcia_get_next_tuple(link, &tuple);
112 }
113
114 tuple.DesiredTuple = CISTPL_CFTABLE_ENTRY;
115
116 ret = pcmcia_get_first_tuple(link, &tuple);
117
118 if (ret != 0) {
119 cs_error(link, GetFirstTuple, ret);
120 goto exit0;
121 }
122
123 ret = pcmcia_get_tuple_data(link, &tuple);
124
125 if (ret != 0) {
126 cs_error(link, GetTupleData, ret);
127 goto exit0;
128 }
129
130 ret = pcmcia_parse_tuple(&tuple, &parse);
131
132 if (ret != 0) {
133 cs_error(link, ParseTuple, ret);
134 goto exit0;
135 }
136
137 link->io.Attributes1 = IO_DATA_PATH_WIDTH_AUTO;
138 link->io.BasePort1 = parse.cftable_entry.io.win[0].base;
139 link->io.NumPorts1 = parse.cftable_entry.io.win[0].len;
140 link->io.IOAddrLines = 16;
141
142 link->irq.IRQInfo1 = parse.cftable_entry.irq.IRQInfo1;
143 95
144 /* 0x40 causes it to generate level mode interrupts. */ 96 /* 0x40 causes it to generate level mode interrupts. */
145 /* 0x04 enables IREQ pin. */ 97 /* 0x04 enables IREQ pin. */
146 cor_value = parse.cftable_entry.index | 0x44; 98 p_dev->conf.ConfigIndex = cfg->index | 0x44;
147 link->conf.ConfigIndex = cor_value; 99 ret = pcmcia_request_io(p_dev, &p_dev->io);
100 if (ret)
101 return ret;
148 102
149 /* IRQ and I/O settings */ 103 io_resource = request_region(p_dev->io.BasePort1, p_dev->io.NumPorts1,
150 tuple.DesiredTuple = CISTPL_CONFIG; 104 IPWIRELESS_PCCARD_NAME);
151 105
152 ret = pcmcia_get_first_tuple(link, &tuple); 106 if (cfg->mem.nwin == 0)
107 return 0;
153 108
154 if (ret != 0) { 109 ipw->request_common_memory.Attributes =
155 cs_error(link, GetFirstTuple, ret); 110 WIN_DATA_WIDTH_16 | WIN_MEMORY_TYPE_CM | WIN_ENABLE;
156 goto exit0; 111 ipw->request_common_memory.Base = cfg->mem.win[0].host_addr;
157 } 112 ipw->request_common_memory.Size = cfg->mem.win[0].len;
113 if (ipw->request_common_memory.Size < 0x1000)
114 ipw->request_common_memory.Size = 0x1000;
115 ipw->request_common_memory.AccessSpeed = 0;
158 116
159 ret = pcmcia_get_tuple_data(link, &tuple); 117 ret = pcmcia_request_window(p_dev, &ipw->request_common_memory,
160 118 &ipw->handle_common_memory);
161 if (ret != 0) {
162 cs_error(link, GetTupleData, ret);
163 goto exit0;
164 }
165 119
166 ret = pcmcia_parse_tuple(&tuple, &parse); 120 if (ret != 0)
121 goto exit1;
167 122
168 if (ret != 0) { 123 memreq_common_memory.CardOffset = cfg->mem.win[0].card_addr;
169 cs_error(link, GetTupleData, ret); 124 memreq_common_memory.Page = 0;
170 goto exit0;
171 }
172 link->conf.Attributes = CONF_ENABLE_IRQ;
173 link->conf.ConfigBase = parse.config.base;
174 link->conf.Present = parse.config.rmask[0];
175 link->conf.IntType = INT_MEMORY_AND_IO;
176 125
177 link->irq.Attributes = IRQ_TYPE_DYNAMIC_SHARING | IRQ_HANDLE_PRESENT; 126 ret = pcmcia_map_mem_page(p_dev, ipw->handle_common_memory,
178 link->irq.Handler = ipwireless_interrupt; 127 &memreq_common_memory);
179 link->irq.Instance = ipw->hardware;
180 128
181 ret = pcmcia_request_io(link, &link->io); 129 if (ret != 0)
130 goto exit2;
182 131
183 if (ret != 0) { 132 ipw->is_v2_card = cfg->mem.win[0].len == 0x100;
184 cs_error(link, RequestIO, ret);
185 goto exit0;
186 }
187 133
188 request_region(link->io.BasePort1, link->io.NumPorts1, 134 ipw->common_memory = ioremap(ipw->request_common_memory.Base,
135 ipw->request_common_memory.Size);
136 request_mem_region(ipw->request_common_memory.Base,
137 ipw->request_common_memory.Size,
189 IPWIRELESS_PCCARD_NAME); 138 IPWIRELESS_PCCARD_NAME);
190 139
191 /* memory settings */ 140 ipw->request_attr_memory.Attributes =
192 141 WIN_DATA_WIDTH_16 | WIN_MEMORY_TYPE_AM | WIN_ENABLE;
193 tuple.DesiredTuple = CISTPL_CFTABLE_ENTRY; 142 ipw->request_attr_memory.Base = 0;
194 143 ipw->request_attr_memory.Size = 0; /* this used to be 0x1000 */
195 ret = pcmcia_get_first_tuple(link, &tuple); 144 ipw->request_attr_memory.AccessSpeed = 0;
196
197 if (ret != 0) {
198 cs_error(link, GetFirstTuple, ret);
199 goto exit1;
200 }
201
202 ret = pcmcia_get_tuple_data(link, &tuple);
203 145
204 if (ret != 0) { 146 ret = pcmcia_request_window(p_dev, &ipw->request_attr_memory,
205 cs_error(link, GetTupleData, ret); 147 &ipw->handle_attr_memory);
206 goto exit1;
207 }
208
209 ret = pcmcia_parse_tuple(&tuple, &parse);
210
211 if (ret != 0) {
212 cs_error(link, ParseTuple, ret);
213 goto exit1;
214 }
215 148
216 if (parse.cftable_entry.mem.nwin > 0) { 149 if (ret != 0)
217 ipw->request_common_memory.Attributes = 150 goto exit2;
218 WIN_DATA_WIDTH_16 | WIN_MEMORY_TYPE_CM | WIN_ENABLE;
219 ipw->request_common_memory.Base =
220 parse.cftable_entry.mem.win[0].host_addr;
221 ipw->request_common_memory.Size = parse.cftable_entry.mem.win[0].len;
222 if (ipw->request_common_memory.Size < 0x1000)
223 ipw->request_common_memory.Size = 0x1000;
224 ipw->request_common_memory.AccessSpeed = 0;
225
226 ret = pcmcia_request_window(&link, &ipw->request_common_memory,
227 &ipw->handle_common_memory);
228 151
229 if (ret != 0) { 152 memreq_attr_memory.CardOffset = 0;
230 cs_error(link, RequestWindow, ret); 153 memreq_attr_memory.Page = 0;
231 goto exit1;
232 }
233 154
234 memreq_common_memory.CardOffset = 155 ret = pcmcia_map_mem_page(p_dev, ipw->handle_attr_memory,
235 parse.cftable_entry.mem.win[0].card_addr; 156 &memreq_attr_memory);
236 memreq_common_memory.Page = 0;
237 157
238 ret = pcmcia_map_mem_page(ipw->handle_common_memory, 158 if (ret != 0)
239 &memreq_common_memory); 159 goto exit3;
240 160
241 if (ret != 0) { 161 ipw->attr_memory = ioremap(ipw->request_attr_memory.Base,
242 cs_error(link, MapMemPage, ret); 162 ipw->request_attr_memory.Size);
243 goto exit1; 163 request_mem_region(ipw->request_attr_memory.Base,
244 } 164 ipw->request_attr_memory.Size, IPWIRELESS_PCCARD_NAME);
245 165
246 ipw->is_v2_card = 166 return 0;
247 parse.cftable_entry.mem.win[0].len == 0x100;
248 167
249 ipw->common_memory = ioremap(ipw->request_common_memory.Base, 168exit3:
169 pcmcia_release_window(p_dev, ipw->handle_attr_memory);
170exit2:
171 if (ipw->common_memory) {
172 release_mem_region(ipw->request_common_memory.Base,
250 ipw->request_common_memory.Size); 173 ipw->request_common_memory.Size);
251 request_mem_region(ipw->request_common_memory.Base, 174 iounmap(ipw->common_memory);
252 ipw->request_common_memory.Size, IPWIRELESS_PCCARD_NAME); 175 pcmcia_release_window(p_dev, ipw->handle_common_memory);
253 176 } else
254 ipw->request_attr_memory.Attributes = 177 pcmcia_release_window(p_dev, ipw->handle_common_memory);
255 WIN_DATA_WIDTH_16 | WIN_MEMORY_TYPE_AM | WIN_ENABLE; 178exit1:
256 ipw->request_attr_memory.Base = 0; 179 release_resource(io_resource);
257 ipw->request_attr_memory.Size = 0; /* this used to be 0x1000 */ 180 pcmcia_disable_device(p_dev);
258 ipw->request_attr_memory.AccessSpeed = 0; 181 return -1;
259 182}
260 ret = pcmcia_request_window(&link, &ipw->request_attr_memory,
261 &ipw->handle_attr_memory);
262 183
263 if (ret != 0) { 184static int config_ipwireless(struct ipw_dev *ipw)
264 cs_error(link, RequestWindow, ret); 185{
265 goto exit2; 186 struct pcmcia_device *link = ipw->link;
266 } 187 int ret = 0;
267 188
268 memreq_attr_memory.CardOffset = 0; 189 ipw->is_v2_card = 0;
269 memreq_attr_memory.Page = 0;
270 190
271 ret = pcmcia_map_mem_page(ipw->handle_attr_memory, 191 ret = pcmcia_loop_config(link, ipwireless_probe, ipw);
272 &memreq_attr_memory); 192 if (ret != 0)
193 return ret;
273 194
274 if (ret != 0) { 195 link->conf.Attributes = CONF_ENABLE_IRQ;
275 cs_error(link, MapMemPage, ret); 196 link->conf.IntType = INT_MEMORY_AND_IO;
276 goto exit2;
277 }
278 197
279 ipw->attr_memory = ioremap(ipw->request_attr_memory.Base, 198 link->irq.Attributes = IRQ_TYPE_DYNAMIC_SHARING;
280 ipw->request_attr_memory.Size); 199 link->irq.Handler = ipwireless_interrupt;
281 request_mem_region(ipw->request_attr_memory.Base, ipw->request_attr_memory.Size,
282 IPWIRELESS_PCCARD_NAME);
283 }
284 200
285 INIT_WORK(&ipw->work_reboot, signalled_reboot_work); 201 INIT_WORK(&ipw->work_reboot, signalled_reboot_work);
286 202
@@ -291,10 +207,8 @@ static int config_ipwireless(struct ipw_dev *ipw)
291 207
292 ret = pcmcia_request_irq(link, &link->irq); 208 ret = pcmcia_request_irq(link, &link->irq);
293 209
294 if (ret != 0) { 210 if (ret != 0)
295 cs_error(link, RequestIRQ, ret); 211 goto exit;
296 goto exit3;
297 }
298 212
299 printk(KERN_INFO IPWIRELESS_PCCARD_NAME ": Card type %s\n", 213 printk(KERN_INFO IPWIRELESS_PCCARD_NAME ": Card type %s\n",
300 ipw->is_v2_card ? "V2/V3" : "V1"); 214 ipw->is_v2_card ? "V2/V3" : "V1");
@@ -316,12 +230,12 @@ static int config_ipwireless(struct ipw_dev *ipw)
316 230
317 ipw->network = ipwireless_network_create(ipw->hardware); 231 ipw->network = ipwireless_network_create(ipw->hardware);
318 if (!ipw->network) 232 if (!ipw->network)
319 goto exit3; 233 goto exit;
320 234
321 ipw->tty = ipwireless_tty_create(ipw->hardware, ipw->network, 235 ipw->tty = ipwireless_tty_create(ipw->hardware, ipw->network,
322 ipw->nodes); 236 ipw->nodes);
323 if (!ipw->tty) 237 if (!ipw->tty)
324 goto exit3; 238 goto exit;
325 239
326 ipwireless_init_hardware_v2_v3(ipw->hardware); 240 ipwireless_init_hardware_v2_v3(ipw->hardware);
327 241
@@ -331,35 +245,27 @@ static int config_ipwireless(struct ipw_dev *ipw)
331 */ 245 */
332 ret = pcmcia_request_configuration(link, &link->conf); 246 ret = pcmcia_request_configuration(link, &link->conf);
333 247
334 if (ret != 0) { 248 if (ret != 0)
335 cs_error(link, RequestConfiguration, ret); 249 goto exit;
336 goto exit4;
337 }
338 250
339 link->dev_node = &ipw->nodes[0]; 251 link->dev_node = &ipw->nodes[0];
340 252
341 return 0; 253 return 0;
342 254
343exit4: 255exit:
344 pcmcia_disable_device(link);
345exit3:
346 if (ipw->attr_memory) { 256 if (ipw->attr_memory) {
347 release_mem_region(ipw->request_attr_memory.Base, 257 release_mem_region(ipw->request_attr_memory.Base,
348 ipw->request_attr_memory.Size); 258 ipw->request_attr_memory.Size);
349 iounmap(ipw->attr_memory); 259 iounmap(ipw->attr_memory);
350 pcmcia_release_window(ipw->handle_attr_memory); 260 pcmcia_release_window(link, ipw->handle_attr_memory);
351 pcmcia_disable_device(link);
352 } 261 }
353exit2:
354 if (ipw->common_memory) { 262 if (ipw->common_memory) {
355 release_mem_region(ipw->request_common_memory.Base, 263 release_mem_region(ipw->request_common_memory.Base,
356 ipw->request_common_memory.Size); 264 ipw->request_common_memory.Size);
357 iounmap(ipw->common_memory); 265 iounmap(ipw->common_memory);
358 pcmcia_release_window(ipw->handle_common_memory); 266 pcmcia_release_window(link, ipw->handle_common_memory);
359 } 267 }
360exit1:
361 pcmcia_disable_device(link); 268 pcmcia_disable_device(link);
362exit0:
363 return -1; 269 return -1;
364} 270}
365 271
@@ -378,9 +284,9 @@ static void release_ipwireless(struct ipw_dev *ipw)
378 iounmap(ipw->attr_memory); 284 iounmap(ipw->attr_memory);
379 } 285 }
380 if (ipw->common_memory) 286 if (ipw->common_memory)
381 pcmcia_release_window(ipw->handle_common_memory); 287 pcmcia_release_window(ipw->link, ipw->handle_common_memory);
382 if (ipw->attr_memory) 288 if (ipw->attr_memory)
383 pcmcia_release_window(ipw->handle_attr_memory); 289 pcmcia_release_window(ipw->link, ipw->handle_attr_memory);
384 290
385 /* Break the link with Card Services */ 291 /* Break the link with Card Services */
386 pcmcia_disable_device(ipw->link); 292 pcmcia_disable_device(ipw->link);
@@ -406,7 +312,6 @@ static int ipwireless_attach(struct pcmcia_device *link)
406 312
407 ipw->link = link; 313 ipw->link = link;
408 link->priv = ipw; 314 link->priv = ipw;
409 link->irq.Instance = ipw;
410 315
411 /* Link this device into our device list. */ 316 /* Link this device into our device list. */
412 link->dev_node = &ipw->nodes[0]; 317 link->dev_node = &ipw->nodes[0];
@@ -421,7 +326,6 @@ static int ipwireless_attach(struct pcmcia_device *link)
421 ret = config_ipwireless(ipw); 326 ret = config_ipwireless(ipw);
422 327
423 if (ret != 0) { 328 if (ret != 0) {
424 cs_error(link, RegisterClient, ret);
425 ipwireless_detach(link); 329 ipwireless_detach(link);
426 return ret; 330 return ret;
427 } 331 }
diff --git a/drivers/char/pcmcia/synclink_cs.c b/drivers/char/pcmcia/synclink_cs.c
index caf6e4d19469..c31a0d913d37 100644
--- a/drivers/char/pcmcia/synclink_cs.c
+++ b/drivers/char/pcmcia/synclink_cs.c
@@ -554,7 +554,6 @@ static int mgslpc_probe(struct pcmcia_device *link)
554 554
555 /* Interrupt setup */ 555 /* Interrupt setup */
556 link->irq.Attributes = IRQ_TYPE_DYNAMIC_SHARING; 556 link->irq.Attributes = IRQ_TYPE_DYNAMIC_SHARING;
557 link->irq.IRQInfo1 = IRQ_LEVEL_ID;
558 link->irq.Handler = NULL; 557 link->irq.Handler = NULL;
559 558
560 link->conf.Attributes = 0; 559 link->conf.Attributes = 0;
@@ -572,69 +571,51 @@ static int mgslpc_probe(struct pcmcia_device *link)
572/* Card has been inserted. 571/* Card has been inserted.
573 */ 572 */
574 573
575#define CS_CHECK(fn, ret) \ 574static int mgslpc_ioprobe(struct pcmcia_device *p_dev,
576do { last_fn = (fn); if ((last_ret = (ret)) != 0) goto cs_failed; } while (0) 575 cistpl_cftable_entry_t *cfg,
576 cistpl_cftable_entry_t *dflt,
577 unsigned int vcc,
578 void *priv_data)
579{
580 if (cfg->io.nwin > 0) {
581 p_dev->io.Attributes1 = IO_DATA_PATH_WIDTH_AUTO;
582 if (!(cfg->io.flags & CISTPL_IO_8BIT))
583 p_dev->io.Attributes1 = IO_DATA_PATH_WIDTH_16;
584 if (!(cfg->io.flags & CISTPL_IO_16BIT))
585 p_dev->io.Attributes1 = IO_DATA_PATH_WIDTH_8;
586 p_dev->io.IOAddrLines = cfg->io.flags & CISTPL_IO_LINES_MASK;
587 p_dev->io.BasePort1 = cfg->io.win[0].base;
588 p_dev->io.NumPorts1 = cfg->io.win[0].len;
589 return pcmcia_request_io(p_dev, &p_dev->io);
590 }
591 return -ENODEV;
592}
577 593
578static int mgslpc_config(struct pcmcia_device *link) 594static int mgslpc_config(struct pcmcia_device *link)
579{ 595{
580 MGSLPC_INFO *info = link->priv; 596 MGSLPC_INFO *info = link->priv;
581 tuple_t tuple; 597 int ret;
582 cisparse_t parse;
583 int last_fn, last_ret;
584 u_char buf[64];
585 cistpl_cftable_entry_t dflt = { 0 };
586 cistpl_cftable_entry_t *cfg;
587 598
588 if (debug_level >= DEBUG_LEVEL_INFO) 599 if (debug_level >= DEBUG_LEVEL_INFO)
589 printk("mgslpc_config(0x%p)\n", link); 600 printk("mgslpc_config(0x%p)\n", link);
590 601
591 tuple.Attributes = 0; 602 ret = pcmcia_loop_config(link, mgslpc_ioprobe, NULL);
592 tuple.TupleData = buf; 603 if (ret != 0)
593 tuple.TupleDataMax = sizeof(buf); 604 goto failed;
594 tuple.TupleOffset = 0;
595
596 /* get CIS configuration entry */
597
598 tuple.DesiredTuple = CISTPL_CFTABLE_ENTRY;
599 CS_CHECK(GetFirstTuple, pcmcia_get_first_tuple(link, &tuple));
600
601 cfg = &(parse.cftable_entry);
602 CS_CHECK(GetTupleData, pcmcia_get_tuple_data(link, &tuple));
603 CS_CHECK(ParseTuple, pcmcia_parse_tuple(&tuple, &parse));
604
605 if (cfg->flags & CISTPL_CFTABLE_DEFAULT) dflt = *cfg;
606 if (cfg->index == 0)
607 goto cs_failed;
608
609 link->conf.ConfigIndex = cfg->index;
610 link->conf.Attributes |= CONF_ENABLE_IRQ;
611
612 /* IO window settings */
613 link->io.NumPorts1 = 0;
614 if ((cfg->io.nwin > 0) || (dflt.io.nwin > 0)) {
615 cistpl_io_t *io = (cfg->io.nwin) ? &cfg->io : &dflt.io;
616 link->io.Attributes1 = IO_DATA_PATH_WIDTH_AUTO;
617 if (!(io->flags & CISTPL_IO_8BIT))
618 link->io.Attributes1 = IO_DATA_PATH_WIDTH_16;
619 if (!(io->flags & CISTPL_IO_16BIT))
620 link->io.Attributes1 = IO_DATA_PATH_WIDTH_8;
621 link->io.IOAddrLines = io->flags & CISTPL_IO_LINES_MASK;
622 link->io.BasePort1 = io->win[0].base;
623 link->io.NumPorts1 = io->win[0].len;
624 CS_CHECK(RequestIO, pcmcia_request_io(link, &link->io));
625 }
626 605
627 link->conf.Attributes = CONF_ENABLE_IRQ; 606 link->conf.Attributes = CONF_ENABLE_IRQ;
628 link->conf.IntType = INT_MEMORY_AND_IO; 607 link->conf.IntType = INT_MEMORY_AND_IO;
629 link->conf.ConfigIndex = 8; 608 link->conf.ConfigIndex = 8;
630 link->conf.Present = PRESENT_OPTION; 609 link->conf.Present = PRESENT_OPTION;
631 610
632 link->irq.Attributes |= IRQ_HANDLE_PRESENT;
633 link->irq.Handler = mgslpc_isr; 611 link->irq.Handler = mgslpc_isr;
634 link->irq.Instance = info;
635 CS_CHECK(RequestIRQ, pcmcia_request_irq(link, &link->irq));
636 612
637 CS_CHECK(RequestConfiguration, pcmcia_request_configuration(link, &link->conf)); 613 ret = pcmcia_request_irq(link, &link->irq);
614 if (ret)
615 goto failed;
616 ret = pcmcia_request_configuration(link, &link->conf);
617 if (ret)
618 goto failed;
638 619
639 info->io_base = link->io.BasePort1; 620 info->io_base = link->io.BasePort1;
640 info->irq_level = link->irq.AssignedIRQ; 621 info->irq_level = link->irq.AssignedIRQ;
@@ -654,8 +635,7 @@ static int mgslpc_config(struct pcmcia_device *link)
654 printk("\n"); 635 printk("\n");
655 return 0; 636 return 0;
656 637
657cs_failed: 638failed:
658 cs_error(link, last_fn, last_ret);
659 mgslpc_release((u_long)link); 639 mgslpc_release((u_long)link);
660 return -ENODEV; 640 return -ENODEV;
661} 641}
diff --git a/drivers/char/tpm/tpm.c b/drivers/char/tpm/tpm.c
index 47c2d2763456..f06bb37defb1 100644
--- a/drivers/char/tpm/tpm.c
+++ b/drivers/char/tpm/tpm.c
@@ -31,7 +31,7 @@
31 31
32enum tpm_const { 32enum tpm_const {
33 TPM_MINOR = 224, /* officially assigned */ 33 TPM_MINOR = 224, /* officially assigned */
34 TPM_BUFSIZE = 2048, 34 TPM_BUFSIZE = 4096,
35 TPM_NUM_DEVICES = 256, 35 TPM_NUM_DEVICES = 256,
36}; 36};
37 37
diff --git a/drivers/char/tpm/tpm_tis.c b/drivers/char/tpm/tpm_tis.c
index 0b73e4ec1add..2405f17b29dd 100644
--- a/drivers/char/tpm/tpm_tis.c
+++ b/drivers/char/tpm/tpm_tis.c
@@ -257,6 +257,10 @@ out:
257 return size; 257 return size;
258} 258}
259 259
260static int itpm;
261module_param(itpm, bool, 0444);
262MODULE_PARM_DESC(itpm, "Force iTPM workarounds (found on some Lenovo laptops)");
263
260/* 264/*
261 * If interrupts are used (signaled by an irq set in the vendor structure) 265 * If interrupts are used (signaled by an irq set in the vendor structure)
262 * tpm.c can skip polling for the data to be available as the interrupt is 266 * tpm.c can skip polling for the data to be available as the interrupt is
@@ -293,7 +297,7 @@ static int tpm_tis_send(struct tpm_chip *chip, u8 *buf, size_t len)
293 wait_for_stat(chip, TPM_STS_VALID, chip->vendor.timeout_c, 297 wait_for_stat(chip, TPM_STS_VALID, chip->vendor.timeout_c,
294 &chip->vendor.int_queue); 298 &chip->vendor.int_queue);
295 status = tpm_tis_status(chip); 299 status = tpm_tis_status(chip);
296 if ((status & TPM_STS_DATA_EXPECT) == 0) { 300 if (!itpm && (status & TPM_STS_DATA_EXPECT) == 0) {
297 rc = -EIO; 301 rc = -EIO;
298 goto out_err; 302 goto out_err;
299 } 303 }
@@ -467,6 +471,10 @@ static int tpm_tis_init(struct device *dev, resource_size_t start,
467 "1.2 TPM (device-id 0x%X, rev-id %d)\n", 471 "1.2 TPM (device-id 0x%X, rev-id %d)\n",
468 vendor >> 16, ioread8(chip->vendor.iobase + TPM_RID(0))); 472 vendor >> 16, ioread8(chip->vendor.iobase + TPM_RID(0)));
469 473
474 if (itpm)
475 dev_info(dev, "Intel iTPM workaround enabled\n");
476
477
470 /* Figure out the capabilities */ 478 /* Figure out the capabilities */
471 intfcaps = 479 intfcaps =
472 ioread32(chip->vendor.iobase + 480 ioread32(chip->vendor.iobase +
@@ -629,6 +637,7 @@ static struct pnp_device_id tpm_pnp_tbl[] __devinitdata = {
629 {"", 0}, /* User Specified */ 637 {"", 0}, /* User Specified */
630 {"", 0} /* Terminator */ 638 {"", 0} /* Terminator */
631}; 639};
640MODULE_DEVICE_TABLE(pnp, tpm_pnp_tbl);
632 641
633static __devexit void tpm_tis_pnp_remove(struct pnp_dev *dev) 642static __devexit void tpm_tis_pnp_remove(struct pnp_dev *dev)
634{ 643{
diff --git a/drivers/char/tty_port.c b/drivers/char/tty_port.c
index a4bbb28f10be..c63f3d33914a 100644
--- a/drivers/char/tty_port.c
+++ b/drivers/char/tty_port.c
@@ -219,8 +219,14 @@ int tty_port_block_til_ready(struct tty_port *port,
219 219
220 /* if non-blocking mode is set we can pass directly to open unless 220 /* if non-blocking mode is set we can pass directly to open unless
221 the port has just hung up or is in another error state */ 221 the port has just hung up or is in another error state */
222 if ((filp->f_flags & O_NONBLOCK) || 222 if (tty->flags & (1 << TTY_IO_ERROR)) {
223 (tty->flags & (1 << TTY_IO_ERROR))) { 223 port->flags |= ASYNC_NORMAL_ACTIVE;
224 return 0;
225 }
226 if (filp->f_flags & O_NONBLOCK) {
227 /* Indicate we are open */
228 if (tty->termios->c_cflag & CBAUD)
229 tty_port_raise_dtr_rts(port);
224 port->flags |= ASYNC_NORMAL_ACTIVE; 230 port->flags |= ASYNC_NORMAL_ACTIVE;
225 return 0; 231 return 0;
226 } 232 }
diff --git a/drivers/char/vt_ioctl.c b/drivers/char/vt_ioctl.c
index ed86d3bf249a..6aa10284104a 100644
--- a/drivers/char/vt_ioctl.c
+++ b/drivers/char/vt_ioctl.c
@@ -103,8 +103,8 @@ void vt_event_post(unsigned int event, unsigned int old, unsigned int new)
103 ve->event.event = event; 103 ve->event.event = event;
104 /* kernel view is consoles 0..n-1, user space view is 104 /* kernel view is consoles 0..n-1, user space view is
105 console 1..n with 0 meaning current, so we must bias */ 105 console 1..n with 0 meaning current, so we must bias */
106 ve->event.old = old + 1; 106 ve->event.oldev = old + 1;
107 ve->event.new = new + 1; 107 ve->event.newev = new + 1;
108 wake = 1; 108 wake = 1;
109 ve->done = 1; 109 ve->done = 1;
110 } 110 }
@@ -186,7 +186,7 @@ int vt_waitactive(int n)
186 vt_event_wait(&vw); 186 vt_event_wait(&vw);
187 if (vw.done == 0) 187 if (vw.done == 0)
188 return -EINTR; 188 return -EINTR;
189 } while (vw.event.new != n); 189 } while (vw.event.newev != n);
190 return 0; 190 return 0;
191} 191}
192 192
diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c
index 3938c7817095..ff57c40e9b8b 100644
--- a/drivers/cpufreq/cpufreq.c
+++ b/drivers/cpufreq/cpufreq.c
@@ -41,7 +41,7 @@ static struct cpufreq_driver *cpufreq_driver;
41static DEFINE_PER_CPU(struct cpufreq_policy *, cpufreq_cpu_data); 41static DEFINE_PER_CPU(struct cpufreq_policy *, cpufreq_cpu_data);
42#ifdef CONFIG_HOTPLUG_CPU 42#ifdef CONFIG_HOTPLUG_CPU
43/* This one keeps track of the previously set governor of a removed CPU */ 43/* This one keeps track of the previously set governor of a removed CPU */
44static DEFINE_PER_CPU(struct cpufreq_governor *, cpufreq_cpu_governor); 44static DEFINE_PER_CPU(char[CPUFREQ_NAME_LEN], cpufreq_cpu_governor);
45#endif 45#endif
46static DEFINE_SPINLOCK(cpufreq_driver_lock); 46static DEFINE_SPINLOCK(cpufreq_driver_lock);
47 47
@@ -774,10 +774,12 @@ int cpufreq_add_dev_policy(unsigned int cpu, struct cpufreq_policy *policy,
774#ifdef CONFIG_SMP 774#ifdef CONFIG_SMP
775 unsigned long flags; 775 unsigned long flags;
776 unsigned int j; 776 unsigned int j;
777
778#ifdef CONFIG_HOTPLUG_CPU 777#ifdef CONFIG_HOTPLUG_CPU
779 if (per_cpu(cpufreq_cpu_governor, cpu)) { 778 struct cpufreq_governor *gov;
780 policy->governor = per_cpu(cpufreq_cpu_governor, cpu); 779
780 gov = __find_governor(per_cpu(cpufreq_cpu_governor, cpu));
781 if (gov) {
782 policy->governor = gov;
781 dprintk("Restoring governor %s for cpu %d\n", 783 dprintk("Restoring governor %s for cpu %d\n",
782 policy->governor->name, cpu); 784 policy->governor->name, cpu);
783 } 785 }
@@ -949,10 +951,13 @@ err_out_kobj_put:
949static int cpufreq_add_dev(struct sys_device *sys_dev) 951static int cpufreq_add_dev(struct sys_device *sys_dev)
950{ 952{
951 unsigned int cpu = sys_dev->id; 953 unsigned int cpu = sys_dev->id;
952 int ret = 0; 954 int ret = 0, found = 0;
953 struct cpufreq_policy *policy; 955 struct cpufreq_policy *policy;
954 unsigned long flags; 956 unsigned long flags;
955 unsigned int j; 957 unsigned int j;
958#ifdef CONFIG_HOTPLUG_CPU
959 int sibling;
960#endif
956 961
957 if (cpu_is_offline(cpu)) 962 if (cpu_is_offline(cpu))
958 return 0; 963 return 0;
@@ -999,7 +1004,19 @@ static int cpufreq_add_dev(struct sys_device *sys_dev)
999 INIT_WORK(&policy->update, handle_update); 1004 INIT_WORK(&policy->update, handle_update);
1000 1005
1001 /* Set governor before ->init, so that driver could check it */ 1006 /* Set governor before ->init, so that driver could check it */
1002 policy->governor = CPUFREQ_DEFAULT_GOVERNOR; 1007#ifdef CONFIG_HOTPLUG_CPU
1008 for_each_online_cpu(sibling) {
1009 struct cpufreq_policy *cp = per_cpu(cpufreq_cpu_data, sibling);
1010 if (cp && cp->governor &&
1011 (cpumask_test_cpu(cpu, cp->related_cpus))) {
1012 policy->governor = cp->governor;
1013 found = 1;
1014 break;
1015 }
1016 }
1017#endif
1018 if (!found)
1019 policy->governor = CPUFREQ_DEFAULT_GOVERNOR;
1003 /* call driver. From then on the cpufreq must be able 1020 /* call driver. From then on the cpufreq must be able
1004 * to accept all calls to ->verify and ->setpolicy for this CPU 1021 * to accept all calls to ->verify and ->setpolicy for this CPU
1005 */ 1022 */
@@ -1111,7 +1128,8 @@ static int __cpufreq_remove_dev(struct sys_device *sys_dev)
1111#ifdef CONFIG_SMP 1128#ifdef CONFIG_SMP
1112 1129
1113#ifdef CONFIG_HOTPLUG_CPU 1130#ifdef CONFIG_HOTPLUG_CPU
1114 per_cpu(cpufreq_cpu_governor, cpu) = data->governor; 1131 strncpy(per_cpu(cpufreq_cpu_governor, cpu), data->governor->name,
1132 CPUFREQ_NAME_LEN);
1115#endif 1133#endif
1116 1134
1117 /* if we have other CPUs still registered, we need to unlink them, 1135 /* if we have other CPUs still registered, we need to unlink them,
@@ -1135,7 +1153,8 @@ static int __cpufreq_remove_dev(struct sys_device *sys_dev)
1135 continue; 1153 continue;
1136 dprintk("removing link for cpu %u\n", j); 1154 dprintk("removing link for cpu %u\n", j);
1137#ifdef CONFIG_HOTPLUG_CPU 1155#ifdef CONFIG_HOTPLUG_CPU
1138 per_cpu(cpufreq_cpu_governor, j) = data->governor; 1156 strncpy(per_cpu(cpufreq_cpu_governor, j),
1157 data->governor->name, CPUFREQ_NAME_LEN);
1139#endif 1158#endif
1140 cpu_sys_dev = get_cpu_sysdev(j); 1159 cpu_sys_dev = get_cpu_sysdev(j);
1141 sysfs_remove_link(&cpu_sys_dev->kobj, "cpufreq"); 1160 sysfs_remove_link(&cpu_sys_dev->kobj, "cpufreq");
@@ -1606,9 +1625,22 @@ EXPORT_SYMBOL_GPL(cpufreq_register_governor);
1606 1625
1607void cpufreq_unregister_governor(struct cpufreq_governor *governor) 1626void cpufreq_unregister_governor(struct cpufreq_governor *governor)
1608{ 1627{
1628#ifdef CONFIG_HOTPLUG_CPU
1629 int cpu;
1630#endif
1631
1609 if (!governor) 1632 if (!governor)
1610 return; 1633 return;
1611 1634
1635#ifdef CONFIG_HOTPLUG_CPU
1636 for_each_present_cpu(cpu) {
1637 if (cpu_online(cpu))
1638 continue;
1639 if (!strcmp(per_cpu(cpufreq_cpu_governor, cpu), governor->name))
1640 strcpy(per_cpu(cpufreq_cpu_governor, cpu), "\0");
1641 }
1642#endif
1643
1612 mutex_lock(&cpufreq_governor_mutex); 1644 mutex_lock(&cpufreq_governor_mutex);
1613 list_del(&governor->governor_list); 1645 list_del(&governor->governor_list);
1614 mutex_unlock(&cpufreq_governor_mutex); 1646 mutex_unlock(&cpufreq_governor_mutex);
diff --git a/drivers/cpufreq/cpufreq_conservative.c b/drivers/cpufreq/cpufreq_conservative.c
index bc33ddc9c97c..c7b081b839ff 100644
--- a/drivers/cpufreq/cpufreq_conservative.c
+++ b/drivers/cpufreq/cpufreq_conservative.c
@@ -116,9 +116,9 @@ static inline cputime64_t get_cpu_idle_time_jiffy(unsigned int cpu,
116 116
117 idle_time = cputime64_sub(cur_wall_time, busy_time); 117 idle_time = cputime64_sub(cur_wall_time, busy_time);
118 if (wall) 118 if (wall)
119 *wall = cur_wall_time; 119 *wall = (cputime64_t)jiffies_to_usecs(cur_wall_time);
120 120
121 return idle_time; 121 return (cputime64_t)jiffies_to_usecs(idle_time);;
122} 122}
123 123
124static inline cputime64_t get_cpu_idle_time(unsigned int cpu, cputime64_t *wall) 124static inline cputime64_t get_cpu_idle_time(unsigned int cpu, cputime64_t *wall)
diff --git a/drivers/cpufreq/cpufreq_ondemand.c b/drivers/cpufreq/cpufreq_ondemand.c
index 071699de50ee..4b34ade2332b 100644
--- a/drivers/cpufreq/cpufreq_ondemand.c
+++ b/drivers/cpufreq/cpufreq_ondemand.c
@@ -133,9 +133,9 @@ static inline cputime64_t get_cpu_idle_time_jiffy(unsigned int cpu,
133 133
134 idle_time = cputime64_sub(cur_wall_time, busy_time); 134 idle_time = cputime64_sub(cur_wall_time, busy_time);
135 if (wall) 135 if (wall)
136 *wall = cur_wall_time; 136 *wall = (cputime64_t)jiffies_to_usecs(cur_wall_time);
137 137
138 return idle_time; 138 return (cputime64_t)jiffies_to_usecs(idle_time);
139} 139}
140 140
141static inline cputime64_t get_cpu_idle_time(unsigned int cpu, cputime64_t *wall) 141static inline cputime64_t get_cpu_idle_time(unsigned int cpu, cputime64_t *wall)
diff --git a/drivers/crypto/padlock-aes.c b/drivers/crypto/padlock-aes.c
index a9952b1236b0..84c51e177269 100644
--- a/drivers/crypto/padlock-aes.c
+++ b/drivers/crypto/padlock-aes.c
@@ -236,7 +236,7 @@ static inline void ecb_crypt(const u8 *in, u8 *out, u32 *key,
236 /* Padlock in ECB mode fetches at least ecb_fetch_bytes of data. 236 /* Padlock in ECB mode fetches at least ecb_fetch_bytes of data.
237 * We could avoid some copying here but it's probably not worth it. 237 * We could avoid some copying here but it's probably not worth it.
238 */ 238 */
239 if (unlikely(((unsigned long)in & PAGE_SIZE) + ecb_fetch_bytes > PAGE_SIZE)) { 239 if (unlikely(((unsigned long)in & ~PAGE_MASK) + ecb_fetch_bytes > PAGE_SIZE)) {
240 ecb_crypt_copy(in, out, key, cword, count); 240 ecb_crypt_copy(in, out, key, cword, count);
241 return; 241 return;
242 } 242 }
@@ -248,7 +248,7 @@ static inline u8 *cbc_crypt(const u8 *in, u8 *out, u32 *key,
248 u8 *iv, struct cword *cword, int count) 248 u8 *iv, struct cword *cword, int count)
249{ 249{
250 /* Padlock in CBC mode fetches at least cbc_fetch_bytes of data. */ 250 /* Padlock in CBC mode fetches at least cbc_fetch_bytes of data. */
251 if (unlikely(((unsigned long)in & PAGE_SIZE) + cbc_fetch_bytes > PAGE_SIZE)) 251 if (unlikely(((unsigned long)in & ~PAGE_MASK) + cbc_fetch_bytes > PAGE_SIZE))
252 return cbc_crypt_copy(in, out, key, iv, cword, count); 252 return cbc_crypt_copy(in, out, key, iv, cword, count);
253 253
254 return rep_xcrypt_cbc(in, out, key, iv, cword, count); 254 return rep_xcrypt_cbc(in, out, key, iv, cword, count);
diff --git a/drivers/dma/Kconfig b/drivers/dma/Kconfig
index 5903a88351bf..b401dadad4a8 100644
--- a/drivers/dma/Kconfig
+++ b/drivers/dma/Kconfig
@@ -26,6 +26,8 @@ config INTEL_IOATDMA
26 select DMA_ENGINE 26 select DMA_ENGINE
27 select DCA 27 select DCA
28 select ASYNC_TX_DISABLE_CHANNEL_SWITCH 28 select ASYNC_TX_DISABLE_CHANNEL_SWITCH
29 select ASYNC_TX_DISABLE_PQ_VAL_DMA
30 select ASYNC_TX_DISABLE_XOR_VAL_DMA
29 help 31 help
30 Enable support for the Intel(R) I/OAT DMA engine present 32 Enable support for the Intel(R) I/OAT DMA engine present
31 in recent Intel Xeon chipsets. 33 in recent Intel Xeon chipsets.
diff --git a/drivers/dma/dmaengine.c b/drivers/dma/dmaengine.c
index bd0b248de2cf..8f99354082ce 100644
--- a/drivers/dma/dmaengine.c
+++ b/drivers/dma/dmaengine.c
@@ -632,11 +632,21 @@ static bool device_has_all_tx_types(struct dma_device *device)
632 #if defined(CONFIG_ASYNC_XOR) || defined(CONFIG_ASYNC_XOR_MODULE) 632 #if defined(CONFIG_ASYNC_XOR) || defined(CONFIG_ASYNC_XOR_MODULE)
633 if (!dma_has_cap(DMA_XOR, device->cap_mask)) 633 if (!dma_has_cap(DMA_XOR, device->cap_mask))
634 return false; 634 return false;
635
636 #ifndef CONFIG_ASYNC_TX_DISABLE_XOR_VAL_DMA
637 if (!dma_has_cap(DMA_XOR_VAL, device->cap_mask))
638 return false;
639 #endif
635 #endif 640 #endif
636 641
637 #if defined(CONFIG_ASYNC_PQ) || defined(CONFIG_ASYNC_PQ_MODULE) 642 #if defined(CONFIG_ASYNC_PQ) || defined(CONFIG_ASYNC_PQ_MODULE)
638 if (!dma_has_cap(DMA_PQ, device->cap_mask)) 643 if (!dma_has_cap(DMA_PQ, device->cap_mask))
639 return false; 644 return false;
645
646 #ifndef CONFIG_ASYNC_TX_DISABLE_PQ_VAL_DMA
647 if (!dma_has_cap(DMA_PQ_VAL, device->cap_mask))
648 return false;
649 #endif
640 #endif 650 #endif
641 651
642 return true; 652 return true;
diff --git a/drivers/dma/ioat/dca.c b/drivers/dma/ioat/dca.c
index 69d02615c4d6..abd9038e06b1 100644
--- a/drivers/dma/ioat/dca.c
+++ b/drivers/dma/ioat/dca.c
@@ -98,17 +98,17 @@ static int dca_enabled_in_bios(struct pci_dev *pdev)
98 cpuid_level_9 = cpuid_eax(9); 98 cpuid_level_9 = cpuid_eax(9);
99 res = test_bit(0, &cpuid_level_9); 99 res = test_bit(0, &cpuid_level_9);
100 if (!res) 100 if (!res)
101 dev_err(&pdev->dev, "DCA is disabled in BIOS\n"); 101 dev_dbg(&pdev->dev, "DCA is disabled in BIOS\n");
102 102
103 return res; 103 return res;
104} 104}
105 105
106static int system_has_dca_enabled(struct pci_dev *pdev) 106int system_has_dca_enabled(struct pci_dev *pdev)
107{ 107{
108 if (boot_cpu_has(X86_FEATURE_DCA)) 108 if (boot_cpu_has(X86_FEATURE_DCA))
109 return dca_enabled_in_bios(pdev); 109 return dca_enabled_in_bios(pdev);
110 110
111 dev_err(&pdev->dev, "boot cpu doesn't have X86_FEATURE_DCA\n"); 111 dev_dbg(&pdev->dev, "boot cpu doesn't have X86_FEATURE_DCA\n");
112 return 0; 112 return 0;
113} 113}
114 114
diff --git a/drivers/dma/ioat/dma.h b/drivers/dma/ioat/dma.h
index c14fdfeb7f33..45edde996480 100644
--- a/drivers/dma/ioat/dma.h
+++ b/drivers/dma/ioat/dma.h
@@ -297,9 +297,7 @@ static inline bool is_ioat_suspended(unsigned long status)
297/* channel was fatally programmed */ 297/* channel was fatally programmed */
298static inline bool is_ioat_bug(unsigned long err) 298static inline bool is_ioat_bug(unsigned long err)
299{ 299{
300 return !!(err & (IOAT_CHANERR_SRC_ADDR_ERR|IOAT_CHANERR_DEST_ADDR_ERR| 300 return !!err;
301 IOAT_CHANERR_NEXT_ADDR_ERR|IOAT_CHANERR_CONTROL_ERR|
302 IOAT_CHANERR_LENGTH_ERR));
303} 301}
304 302
305static inline void ioat_unmap(struct pci_dev *pdev, dma_addr_t addr, size_t len, 303static inline void ioat_unmap(struct pci_dev *pdev, dma_addr_t addr, size_t len,
diff --git a/drivers/dma/ioat/dma_v2.c b/drivers/dma/ioat/dma_v2.c
index 96ffab7d37a7..8f1f7f05deaa 100644
--- a/drivers/dma/ioat/dma_v2.c
+++ b/drivers/dma/ioat/dma_v2.c
@@ -279,6 +279,8 @@ void ioat2_timer_event(unsigned long data)
279 u32 chanerr; 279 u32 chanerr;
280 280
281 chanerr = readl(chan->reg_base + IOAT_CHANERR_OFFSET); 281 chanerr = readl(chan->reg_base + IOAT_CHANERR_OFFSET);
282 dev_err(to_dev(chan), "%s: Channel halted (%x)\n",
283 __func__, chanerr);
282 BUG_ON(is_ioat_bug(chanerr)); 284 BUG_ON(is_ioat_bug(chanerr));
283 } 285 }
284 286
diff --git a/drivers/dma/ioat/dma_v3.c b/drivers/dma/ioat/dma_v3.c
index 35d1e33afd5b..42f6f10fb0cc 100644
--- a/drivers/dma/ioat/dma_v3.c
+++ b/drivers/dma/ioat/dma_v3.c
@@ -378,6 +378,8 @@ static void ioat3_timer_event(unsigned long data)
378 u32 chanerr; 378 u32 chanerr;
379 379
380 chanerr = readl(chan->reg_base + IOAT_CHANERR_OFFSET); 380 chanerr = readl(chan->reg_base + IOAT_CHANERR_OFFSET);
381 dev_err(to_dev(chan), "%s: Channel halted (%x)\n",
382 __func__, chanerr);
381 BUG_ON(is_ioat_bug(chanerr)); 383 BUG_ON(is_ioat_bug(chanerr));
382 } 384 }
383 385
@@ -569,7 +571,7 @@ __ioat3_prep_xor_lock(struct dma_chan *c, enum sum_check_flags *result,
569 dump_desc_dbg(ioat, compl_desc); 571 dump_desc_dbg(ioat, compl_desc);
570 572
571 /* we leave the channel locked to ensure in order submission */ 573 /* we leave the channel locked to ensure in order submission */
572 return &desc->txd; 574 return &compl_desc->txd;
573} 575}
574 576
575static struct dma_async_tx_descriptor * 577static struct dma_async_tx_descriptor *
@@ -728,7 +730,7 @@ __ioat3_prep_pq_lock(struct dma_chan *c, enum sum_check_flags *result,
728 dump_desc_dbg(ioat, compl_desc); 730 dump_desc_dbg(ioat, compl_desc);
729 731
730 /* we leave the channel locked to ensure in order submission */ 732 /* we leave the channel locked to ensure in order submission */
731 return &desc->txd; 733 return &compl_desc->txd;
732} 734}
733 735
734static struct dma_async_tx_descriptor * 736static struct dma_async_tx_descriptor *
@@ -736,10 +738,16 @@ ioat3_prep_pq(struct dma_chan *chan, dma_addr_t *dst, dma_addr_t *src,
736 unsigned int src_cnt, const unsigned char *scf, size_t len, 738 unsigned int src_cnt, const unsigned char *scf, size_t len,
737 unsigned long flags) 739 unsigned long flags)
738{ 740{
741 /* specify valid address for disabled result */
742 if (flags & DMA_PREP_PQ_DISABLE_P)
743 dst[0] = dst[1];
744 if (flags & DMA_PREP_PQ_DISABLE_Q)
745 dst[1] = dst[0];
746
739 /* handle the single source multiply case from the raid6 747 /* handle the single source multiply case from the raid6
740 * recovery path 748 * recovery path
741 */ 749 */
742 if (unlikely((flags & DMA_PREP_PQ_DISABLE_P) && src_cnt == 1)) { 750 if ((flags & DMA_PREP_PQ_DISABLE_P) && src_cnt == 1) {
743 dma_addr_t single_source[2]; 751 dma_addr_t single_source[2];
744 unsigned char single_source_coef[2]; 752 unsigned char single_source_coef[2];
745 753
@@ -761,6 +769,12 @@ ioat3_prep_pq_val(struct dma_chan *chan, dma_addr_t *pq, dma_addr_t *src,
761 unsigned int src_cnt, const unsigned char *scf, size_t len, 769 unsigned int src_cnt, const unsigned char *scf, size_t len,
762 enum sum_check_flags *pqres, unsigned long flags) 770 enum sum_check_flags *pqres, unsigned long flags)
763{ 771{
772 /* specify valid address for disabled result */
773 if (flags & DMA_PREP_PQ_DISABLE_P)
774 pq[0] = pq[1];
775 if (flags & DMA_PREP_PQ_DISABLE_Q)
776 pq[1] = pq[0];
777
764 /* the cleanup routine only sets bits on validate failure, it 778 /* the cleanup routine only sets bits on validate failure, it
765 * does not clear bits on validate success... so clear it here 779 * does not clear bits on validate success... so clear it here
766 */ 780 */
@@ -778,9 +792,9 @@ ioat3_prep_pqxor(struct dma_chan *chan, dma_addr_t dst, dma_addr_t *src,
778 dma_addr_t pq[2]; 792 dma_addr_t pq[2];
779 793
780 memset(scf, 0, src_cnt); 794 memset(scf, 0, src_cnt);
781 flags |= DMA_PREP_PQ_DISABLE_Q;
782 pq[0] = dst; 795 pq[0] = dst;
783 pq[1] = ~0; 796 flags |= DMA_PREP_PQ_DISABLE_Q;
797 pq[1] = dst; /* specify valid address for disabled result */
784 798
785 return __ioat3_prep_pq_lock(chan, NULL, pq, src, src_cnt, scf, len, 799 return __ioat3_prep_pq_lock(chan, NULL, pq, src, src_cnt, scf, len,
786 flags); 800 flags);
@@ -800,9 +814,9 @@ ioat3_prep_pqxor_val(struct dma_chan *chan, dma_addr_t *src,
800 *result = 0; 814 *result = 0;
801 815
802 memset(scf, 0, src_cnt); 816 memset(scf, 0, src_cnt);
803 flags |= DMA_PREP_PQ_DISABLE_Q;
804 pq[0] = src[0]; 817 pq[0] = src[0];
805 pq[1] = ~0; 818 flags |= DMA_PREP_PQ_DISABLE_Q;
819 pq[1] = pq[0]; /* specify valid address for disabled result */
806 820
807 return __ioat3_prep_pq_lock(chan, result, pq, &src[1], src_cnt - 1, scf, 821 return __ioat3_prep_pq_lock(chan, result, pq, &src[1], src_cnt - 1, scf,
808 len, flags); 822 len, flags);
@@ -1117,6 +1131,7 @@ static int __devinit ioat3_dma_self_test(struct ioatdma_device *device)
1117int __devinit ioat3_dma_probe(struct ioatdma_device *device, int dca) 1131int __devinit ioat3_dma_probe(struct ioatdma_device *device, int dca)
1118{ 1132{
1119 struct pci_dev *pdev = device->pdev; 1133 struct pci_dev *pdev = device->pdev;
1134 int dca_en = system_has_dca_enabled(pdev);
1120 struct dma_device *dma; 1135 struct dma_device *dma;
1121 struct dma_chan *c; 1136 struct dma_chan *c;
1122 struct ioat_chan_common *chan; 1137 struct ioat_chan_common *chan;
@@ -1137,6 +1152,11 @@ int __devinit ioat3_dma_probe(struct ioatdma_device *device, int dca)
1137 dma->device_prep_dma_interrupt = ioat3_prep_interrupt_lock; 1152 dma->device_prep_dma_interrupt = ioat3_prep_interrupt_lock;
1138 1153
1139 cap = readl(device->reg_base + IOAT_DMA_CAP_OFFSET); 1154 cap = readl(device->reg_base + IOAT_DMA_CAP_OFFSET);
1155
1156 /* dca is incompatible with raid operations */
1157 if (dca_en && (cap & (IOAT_CAP_XOR|IOAT_CAP_PQ)))
1158 cap &= ~(IOAT_CAP_XOR|IOAT_CAP_PQ);
1159
1140 if (cap & IOAT_CAP_XOR) { 1160 if (cap & IOAT_CAP_XOR) {
1141 is_raid_device = true; 1161 is_raid_device = true;
1142 dma->max_xor = 8; 1162 dma->max_xor = 8;
@@ -1186,6 +1206,16 @@ int __devinit ioat3_dma_probe(struct ioatdma_device *device, int dca)
1186 device->timer_fn = ioat2_timer_event; 1206 device->timer_fn = ioat2_timer_event;
1187 } 1207 }
1188 1208
1209 #ifdef CONFIG_ASYNC_TX_DISABLE_PQ_VAL_DMA
1210 dma_cap_clear(DMA_PQ_VAL, dma->cap_mask);
1211 dma->device_prep_dma_pq_val = NULL;
1212 #endif
1213
1214 #ifdef CONFIG_ASYNC_TX_DISABLE_XOR_VAL_DMA
1215 dma_cap_clear(DMA_XOR_VAL, dma->cap_mask);
1216 dma->device_prep_dma_xor_val = NULL;
1217 #endif
1218
1189 /* -= IOAT ver.3 workarounds =- */ 1219 /* -= IOAT ver.3 workarounds =- */
1190 /* Write CHANERRMSK_INT with 3E07h to mask out the errors 1220 /* Write CHANERRMSK_INT with 3E07h to mask out the errors
1191 * that can cause stability issues for IOAT ver.3 1221 * that can cause stability issues for IOAT ver.3
diff --git a/drivers/dma/ioat/hw.h b/drivers/dma/ioat/hw.h
index 99afb12bd409..60e675455b6a 100644
--- a/drivers/dma/ioat/hw.h
+++ b/drivers/dma/ioat/hw.h
@@ -39,6 +39,8 @@
39#define IOAT_VER_3_0 0x30 /* Version 3.0 */ 39#define IOAT_VER_3_0 0x30 /* Version 3.0 */
40#define IOAT_VER_3_2 0x32 /* Version 3.2 */ 40#define IOAT_VER_3_2 0x32 /* Version 3.2 */
41 41
42int system_has_dca_enabled(struct pci_dev *pdev);
43
42struct ioat_dma_descriptor { 44struct ioat_dma_descriptor {
43 uint32_t size; 45 uint32_t size;
44 union { 46 union {
diff --git a/drivers/dma/ioat/registers.h b/drivers/dma/ioat/registers.h
index 63038e18ab03..f015ec196700 100644
--- a/drivers/dma/ioat/registers.h
+++ b/drivers/dma/ioat/registers.h
@@ -92,9 +92,7 @@
92#define IOAT_CHANCTRL_ERR_COMPLETION_EN 0x0004 92#define IOAT_CHANCTRL_ERR_COMPLETION_EN 0x0004
93#define IOAT_CHANCTRL_INT_REARM 0x0001 93#define IOAT_CHANCTRL_INT_REARM 0x0001
94#define IOAT_CHANCTRL_RUN (IOAT_CHANCTRL_INT_REARM |\ 94#define IOAT_CHANCTRL_RUN (IOAT_CHANCTRL_INT_REARM |\
95 IOAT_CHANCTRL_ERR_COMPLETION_EN |\ 95 IOAT_CHANCTRL_ANY_ERR_ABORT_EN)
96 IOAT_CHANCTRL_ANY_ERR_ABORT_EN |\
97 IOAT_CHANCTRL_ERR_INT_EN)
98 96
99#define IOAT_DMA_COMP_OFFSET 0x02 /* 16-bit DMA channel compatibility */ 97#define IOAT_DMA_COMP_OFFSET 0x02 /* 16-bit DMA channel compatibility */
100#define IOAT_DMA_COMP_V1 0x0001 /* Compatibility with DMA version 1 */ 98#define IOAT_DMA_COMP_V1 0x0001 /* Compatibility with DMA version 1 */
diff --git a/drivers/dma/shdma.c b/drivers/dma/shdma.c
index b3b065c4e5c1..034ecf0ace03 100644
--- a/drivers/dma/shdma.c
+++ b/drivers/dma/shdma.c
@@ -640,17 +640,16 @@ static int __init sh_dmae_probe(struct platform_device *pdev)
640#endif 640#endif
641 struct sh_dmae_device *shdev; 641 struct sh_dmae_device *shdev;
642 642
643 /* get platform data */
644 if (!pdev->dev.platform_data)
645 return -ENODEV;
646
643 shdev = kzalloc(sizeof(struct sh_dmae_device), GFP_KERNEL); 647 shdev = kzalloc(sizeof(struct sh_dmae_device), GFP_KERNEL);
644 if (!shdev) { 648 if (!shdev) {
645 dev_err(&pdev->dev, "No enough memory\n"); 649 dev_err(&pdev->dev, "No enough memory\n");
646 err = -ENOMEM; 650 return -ENOMEM;
647 goto shdev_err;
648 } 651 }
649 652
650 /* get platform data */
651 if (!pdev->dev.platform_data)
652 goto shdev_err;
653
654 /* platform data */ 653 /* platform data */
655 memcpy(&shdev->pdata, pdev->dev.platform_data, 654 memcpy(&shdev->pdata, pdev->dev.platform_data,
656 sizeof(struct sh_dmae_pdata)); 655 sizeof(struct sh_dmae_pdata));
@@ -722,7 +721,6 @@ eirq_err:
722rst_err: 721rst_err:
723 kfree(shdev); 722 kfree(shdev);
724 723
725shdev_err:
726 return err; 724 return err;
727} 725}
728 726
diff --git a/drivers/edac/amd64_edac.c b/drivers/edac/amd64_edac.c
index d4560d9d5a83..a38831c82649 100644
--- a/drivers/edac/amd64_edac.c
+++ b/drivers/edac/amd64_edac.c
@@ -2254,7 +2254,7 @@ static inline void __amd64_decode_bus_error(struct mem_ctl_info *mci,
2254{ 2254{
2255 u32 ec = ERROR_CODE(info->nbsl); 2255 u32 ec = ERROR_CODE(info->nbsl);
2256 u32 xec = EXT_ERROR_CODE(info->nbsl); 2256 u32 xec = EXT_ERROR_CODE(info->nbsl);
2257 int ecc_type = info->nbsh & (0x3 << 13); 2257 int ecc_type = (info->nbsh >> 13) & 0x3;
2258 2258
2259 /* Bail early out if this was an 'observed' error */ 2259 /* Bail early out if this was an 'observed' error */
2260 if (PP(ec) == K8_NBSL_PP_OBS) 2260 if (PP(ec) == K8_NBSL_PP_OBS)
@@ -3163,7 +3163,7 @@ static int __init amd64_edac_init(void)
3163 opstate_init(); 3163 opstate_init();
3164 3164
3165 if (cache_k8_northbridges() < 0) 3165 if (cache_k8_northbridges() < 0)
3166 goto err_exit; 3166 return err;
3167 3167
3168 err = pci_register_driver(&amd64_pci_driver); 3168 err = pci_register_driver(&amd64_pci_driver);
3169 if (err) 3169 if (err)
@@ -3189,8 +3189,6 @@ static int __init amd64_edac_init(void)
3189 3189
3190err_2nd_stage: 3190err_2nd_stage:
3191 debugf0("2nd stage failed\n"); 3191 debugf0("2nd stage failed\n");
3192
3193err_exit:
3194 pci_unregister_driver(&amd64_pci_driver); 3192 pci_unregister_driver(&amd64_pci_driver);
3195 3193
3196 return err; 3194 return err;
diff --git a/drivers/edac/edac_mce_amd.c b/drivers/edac/edac_mce_amd.c
index 713ed7d37247..689cc6a6214d 100644
--- a/drivers/edac/edac_mce_amd.c
+++ b/drivers/edac/edac_mce_amd.c
@@ -3,7 +3,6 @@
3 3
4static bool report_gart_errors; 4static bool report_gart_errors;
5static void (*nb_bus_decoder)(int node_id, struct err_regs *regs); 5static void (*nb_bus_decoder)(int node_id, struct err_regs *regs);
6static void (*orig_mce_callback)(struct mce *m);
7 6
8void amd_report_gart_errors(bool v) 7void amd_report_gart_errors(bool v)
9{ 8{
@@ -363,8 +362,10 @@ static inline void amd_decode_err_code(unsigned int ec)
363 pr_warning("Huh? Unknown MCE error 0x%x\n", ec); 362 pr_warning("Huh? Unknown MCE error 0x%x\n", ec);
364} 363}
365 364
366static void amd_decode_mce(struct mce *m) 365static int amd_decode_mce(struct notifier_block *nb, unsigned long val,
366 void *data)
367{ 367{
368 struct mce *m = (struct mce *)data;
368 struct err_regs regs; 369 struct err_regs regs;
369 int node, ecc; 370 int node, ecc;
370 371
@@ -420,20 +421,22 @@ static void amd_decode_mce(struct mce *m)
420 } 421 }
421 422
422 amd_decode_err_code(m->status & 0xffff); 423 amd_decode_err_code(m->status & 0xffff);
424
425 return NOTIFY_STOP;
423} 426}
424 427
428static struct notifier_block amd_mce_dec_nb = {
429 .notifier_call = amd_decode_mce,
430};
431
425static int __init mce_amd_init(void) 432static int __init mce_amd_init(void)
426{ 433{
427 /* 434 /*
428 * We can decode MCEs for Opteron and later CPUs: 435 * We can decode MCEs for Opteron and later CPUs:
429 */ 436 */
430 if ((boot_cpu_data.x86_vendor == X86_VENDOR_AMD) && 437 if ((boot_cpu_data.x86_vendor == X86_VENDOR_AMD) &&
431 (boot_cpu_data.x86 >= 0xf)) { 438 (boot_cpu_data.x86 >= 0xf))
432 /* safe the default decode mce callback */ 439 atomic_notifier_chain_register(&x86_mce_decoder_chain, &amd_mce_dec_nb);
433 orig_mce_callback = x86_mce_decode_callback;
434
435 x86_mce_decode_callback = amd_decode_mce;
436 }
437 440
438 return 0; 441 return 0;
439} 442}
@@ -442,7 +445,7 @@ early_initcall(mce_amd_init);
442#ifdef MODULE 445#ifdef MODULE
443static void __exit mce_amd_exit(void) 446static void __exit mce_amd_exit(void)
444{ 447{
445 x86_mce_decode_callback = orig_mce_callback; 448 atomic_notifier_chain_unregister(&x86_mce_decoder_chain, &amd_mce_dec_nb);
446} 449}
447 450
448MODULE_DESCRIPTION("AMD MCE decoder"); 451MODULE_DESCRIPTION("AMD MCE decoder");
diff --git a/drivers/firewire/ohci.c b/drivers/firewire/ohci.c
index 5d524254499e..94260aa76aa3 100644
--- a/drivers/firewire/ohci.c
+++ b/drivers/firewire/ohci.c
@@ -275,7 +275,7 @@ static void log_irqs(u32 evt)
275 !(evt & OHCI1394_busReset)) 275 !(evt & OHCI1394_busReset))
276 return; 276 return;
277 277
278 fw_notify("IRQ %08x%s%s%s%s%s%s%s%s%s%s%s%s%s\n", evt, 278 fw_notify("IRQ %08x%s%s%s%s%s%s%s%s%s%s%s%s%s%s\n", evt,
279 evt & OHCI1394_selfIDComplete ? " selfID" : "", 279 evt & OHCI1394_selfIDComplete ? " selfID" : "",
280 evt & OHCI1394_RQPkt ? " AR_req" : "", 280 evt & OHCI1394_RQPkt ? " AR_req" : "",
281 evt & OHCI1394_RSPkt ? " AR_resp" : "", 281 evt & OHCI1394_RSPkt ? " AR_resp" : "",
@@ -286,6 +286,7 @@ static void log_irqs(u32 evt)
286 evt & OHCI1394_postedWriteErr ? " postedWriteErr" : "", 286 evt & OHCI1394_postedWriteErr ? " postedWriteErr" : "",
287 evt & OHCI1394_cycleTooLong ? " cycleTooLong" : "", 287 evt & OHCI1394_cycleTooLong ? " cycleTooLong" : "",
288 evt & OHCI1394_cycle64Seconds ? " cycle64Seconds" : "", 288 evt & OHCI1394_cycle64Seconds ? " cycle64Seconds" : "",
289 evt & OHCI1394_cycleInconsistent ? " cycleInconsistent" : "",
289 evt & OHCI1394_regAccessFail ? " regAccessFail" : "", 290 evt & OHCI1394_regAccessFail ? " regAccessFail" : "",
290 evt & OHCI1394_busReset ? " busReset" : "", 291 evt & OHCI1394_busReset ? " busReset" : "",
291 evt & ~(OHCI1394_selfIDComplete | OHCI1394_RQPkt | 292 evt & ~(OHCI1394_selfIDComplete | OHCI1394_RQPkt |
@@ -293,6 +294,7 @@ static void log_irqs(u32 evt)
293 OHCI1394_respTxComplete | OHCI1394_isochRx | 294 OHCI1394_respTxComplete | OHCI1394_isochRx |
294 OHCI1394_isochTx | OHCI1394_postedWriteErr | 295 OHCI1394_isochTx | OHCI1394_postedWriteErr |
295 OHCI1394_cycleTooLong | OHCI1394_cycle64Seconds | 296 OHCI1394_cycleTooLong | OHCI1394_cycle64Seconds |
297 OHCI1394_cycleInconsistent |
296 OHCI1394_regAccessFail | OHCI1394_busReset) 298 OHCI1394_regAccessFail | OHCI1394_busReset)
297 ? " ?" : ""); 299 ? " ?" : "");
298} 300}
@@ -1439,6 +1441,17 @@ static irqreturn_t irq_handler(int irq, void *data)
1439 OHCI1394_LinkControl_cycleMaster); 1441 OHCI1394_LinkControl_cycleMaster);
1440 } 1442 }
1441 1443
1444 if (unlikely(event & OHCI1394_cycleInconsistent)) {
1445 /*
1446 * We need to clear this event bit in order to make
1447 * cycleMatch isochronous I/O work. In theory we should
1448 * stop active cycleMatch iso contexts now and restart
1449 * them at least two cycles later. (FIXME?)
1450 */
1451 if (printk_ratelimit())
1452 fw_notify("isochronous cycle inconsistent\n");
1453 }
1454
1442 if (event & OHCI1394_cycle64Seconds) { 1455 if (event & OHCI1394_cycle64Seconds) {
1443 cycle_time = reg_read(ohci, OHCI1394_IsochronousCycleTimer); 1456 cycle_time = reg_read(ohci, OHCI1394_IsochronousCycleTimer);
1444 if ((cycle_time & 0x80000000) == 0) 1457 if ((cycle_time & 0x80000000) == 0)
@@ -1528,6 +1541,7 @@ static int ohci_enable(struct fw_card *card, u32 *config_rom, size_t length)
1528 OHCI1394_reqTxComplete | OHCI1394_respTxComplete | 1541 OHCI1394_reqTxComplete | OHCI1394_respTxComplete |
1529 OHCI1394_isochRx | OHCI1394_isochTx | 1542 OHCI1394_isochRx | OHCI1394_isochTx |
1530 OHCI1394_postedWriteErr | OHCI1394_cycleTooLong | 1543 OHCI1394_postedWriteErr | OHCI1394_cycleTooLong |
1544 OHCI1394_cycleInconsistent |
1531 OHCI1394_cycle64Seconds | OHCI1394_regAccessFail | 1545 OHCI1394_cycle64Seconds | OHCI1394_regAccessFail |
1532 OHCI1394_masterIntEnable); 1546 OHCI1394_masterIntEnable);
1533 if (param_debug & OHCI_PARAM_DEBUG_BUSRESETS) 1547 if (param_debug & OHCI_PARAM_DEBUG_BUSRESETS)
@@ -1890,15 +1904,30 @@ static int handle_it_packet(struct context *context,
1890{ 1904{
1891 struct iso_context *ctx = 1905 struct iso_context *ctx =
1892 container_of(context, struct iso_context, context); 1906 container_of(context, struct iso_context, context);
1907 int i;
1908 struct descriptor *pd;
1893 1909
1894 if (last->transfer_status == 0) 1910 for (pd = d; pd <= last; pd++)
1895 /* This descriptor isn't done yet, stop iteration. */ 1911 if (pd->transfer_status)
1912 break;
1913 if (pd > last)
1914 /* Descriptor(s) not done yet, stop iteration */
1896 return 0; 1915 return 0;
1897 1916
1898 if (le16_to_cpu(last->control) & DESCRIPTOR_IRQ_ALWAYS) 1917 i = ctx->header_length;
1918 if (i + 4 < PAGE_SIZE) {
1919 /* Present this value as big-endian to match the receive code */
1920 *(__be32 *)(ctx->header + i) = cpu_to_be32(
1921 ((u32)le16_to_cpu(pd->transfer_status) << 16) |
1922 le16_to_cpu(pd->res_count));
1923 ctx->header_length += 4;
1924 }
1925 if (le16_to_cpu(last->control) & DESCRIPTOR_IRQ_ALWAYS) {
1899 ctx->base.callback(&ctx->base, le16_to_cpu(last->res_count), 1926 ctx->base.callback(&ctx->base, le16_to_cpu(last->res_count),
1900 0, NULL, ctx->base.callback_data); 1927 ctx->header_length, ctx->header,
1901 1928 ctx->base.callback_data);
1929 ctx->header_length = 0;
1930 }
1902 return 1; 1931 return 1;
1903} 1932}
1904 1933
diff --git a/drivers/gpio/gpiolib.c b/drivers/gpio/gpiolib.c
index 662ed923d9eb..50de0f5750d8 100644
--- a/drivers/gpio/gpiolib.c
+++ b/drivers/gpio/gpiolib.c
@@ -661,7 +661,7 @@ int gpio_export(unsigned gpio, bool direction_may_change)
661 661
662 dev = device_create(&gpio_class, desc->chip->dev, MKDEV(0, 0), 662 dev = device_create(&gpio_class, desc->chip->dev, MKDEV(0, 0),
663 desc, ioname ? ioname : "gpio%d", gpio); 663 desc, ioname ? ioname : "gpio%d", gpio);
664 if (dev) { 664 if (!IS_ERR(dev)) {
665 if (direction_may_change) 665 if (direction_may_change)
666 status = sysfs_create_group(&dev->kobj, 666 status = sysfs_create_group(&dev->kobj,
667 &gpio_attr_group); 667 &gpio_attr_group);
@@ -679,7 +679,7 @@ int gpio_export(unsigned gpio, bool direction_may_change)
679 if (status != 0) 679 if (status != 0)
680 device_unregister(dev); 680 device_unregister(dev);
681 } else 681 } else
682 status = -ENODEV; 682 status = PTR_ERR(dev);
683 if (status == 0) 683 if (status == 0)
684 set_bit(FLAG_EXPORT, &desc->flags); 684 set_bit(FLAG_EXPORT, &desc->flags);
685 } 685 }
@@ -800,11 +800,11 @@ static int gpiochip_export(struct gpio_chip *chip)
800 mutex_lock(&sysfs_lock); 800 mutex_lock(&sysfs_lock);
801 dev = device_create(&gpio_class, chip->dev, MKDEV(0, 0), chip, 801 dev = device_create(&gpio_class, chip->dev, MKDEV(0, 0), chip,
802 "gpiochip%d", chip->base); 802 "gpiochip%d", chip->base);
803 if (dev) { 803 if (!IS_ERR(dev)) {
804 status = sysfs_create_group(&dev->kobj, 804 status = sysfs_create_group(&dev->kobj,
805 &gpiochip_attr_group); 805 &gpiochip_attr_group);
806 } else 806 } else
807 status = -ENODEV; 807 status = PTR_ERR(dev);
808 chip->exported = (status == 0); 808 chip->exported = (status == 0);
809 mutex_unlock(&sysfs_lock); 809 mutex_unlock(&sysfs_lock);
810 810
diff --git a/drivers/gpio/langwell_gpio.c b/drivers/gpio/langwell_gpio.c
index 5711ce5353c6..4baf3d7d0f8e 100644
--- a/drivers/gpio/langwell_gpio.c
+++ b/drivers/gpio/langwell_gpio.c
@@ -144,13 +144,6 @@ static int lnw_irq_type(unsigned irq, unsigned type)
144 144
145static void lnw_irq_unmask(unsigned irq) 145static void lnw_irq_unmask(unsigned irq)
146{ 146{
147 struct lnw_gpio *lnw = get_irq_chip_data(irq);
148 u32 gpio = irq - lnw->irq_base;
149 u8 reg = gpio / 32;
150 void __iomem *gedr;
151
152 gedr = (void __iomem *)(&lnw->reg_base->GEDR[reg]);
153 writel(BIT(gpio % 32), gedr);
154}; 147};
155 148
156static void lnw_irq_mask(unsigned irq) 149static void lnw_irq_mask(unsigned irq)
@@ -183,13 +176,11 @@ static void lnw_irq_handler(unsigned irq, struct irq_desc *desc)
183 gedr_v = readl(gedr); 176 gedr_v = readl(gedr);
184 if (!gedr_v) 177 if (!gedr_v)
185 continue; 178 continue;
186 for (gpio = reg*32; gpio < reg*32+32; gpio++) { 179 for (gpio = reg*32; gpio < reg*32+32; gpio++)
187 gedr_v = readl(gedr);
188 if (gedr_v & BIT(gpio % 32)) { 180 if (gedr_v & BIT(gpio % 32)) {
189 pr_debug("pin %d triggered\n", gpio); 181 pr_debug("pin %d triggered\n", gpio);
190 generic_handle_irq(lnw->irq_base + gpio); 182 generic_handle_irq(lnw->irq_base + gpio);
191 } 183 }
192 }
193 /* clear the edge detect status bit */ 184 /* clear the edge detect status bit */
194 writel(gedr_v, gedr); 185 writel(gedr_v, gedr);
195 } 186 }
diff --git a/drivers/gpu/drm/Kconfig b/drivers/gpu/drm/Kconfig
index f831ea159291..96eddd17e050 100644
--- a/drivers/gpu/drm/Kconfig
+++ b/drivers/gpu/drm/Kconfig
@@ -92,6 +92,7 @@ config DRM_I830
92config DRM_I915 92config DRM_I915
93 tristate "i915 driver" 93 tristate "i915 driver"
94 depends on AGP_INTEL 94 depends on AGP_INTEL
95 select SHMEM
95 select DRM_KMS_HELPER 96 select DRM_KMS_HELPER
96 select FB_CFB_FILLRECT 97 select FB_CFB_FILLRECT
97 select FB_CFB_COPYAREA 98 select FB_CFB_COPYAREA
diff --git a/drivers/gpu/drm/drm_crtc_helper.c b/drivers/gpu/drm/drm_crtc_helper.c
index 1fe4e1d344fd..bbfd110a7168 100644
--- a/drivers/gpu/drm/drm_crtc_helper.c
+++ b/drivers/gpu/drm/drm_crtc_helper.c
@@ -331,6 +331,7 @@ create_mode:
331 cmdline_mode->refresh_specified ? cmdline_mode->refresh : 60, 331 cmdline_mode->refresh_specified ? cmdline_mode->refresh : 60,
332 cmdline_mode->rb, cmdline_mode->interlace, 332 cmdline_mode->rb, cmdline_mode->interlace,
333 cmdline_mode->margins); 333 cmdline_mode->margins);
334 drm_mode_set_crtcinfo(mode, CRTC_INTERLACE_HALVE_V);
334 list_add(&mode->head, &connector->modes); 335 list_add(&mode->head, &connector->modes);
335 return mode; 336 return mode;
336} 337}
diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c
index cea665d86dd3..b54ba63d506e 100644
--- a/drivers/gpu/drm/drm_edid.c
+++ b/drivers/gpu/drm/drm_edid.c
@@ -662,6 +662,12 @@ static struct drm_display_mode *drm_mode_detailed(struct drm_device *dev,
662 return NULL; 662 return NULL;
663 } 663 }
664 664
665 /* Some EDIDs have bogus h/vtotal values */
666 if (mode->hsync_end > mode->htotal)
667 mode->htotal = mode->hsync_end + 1;
668 if (mode->vsync_end > mode->vtotal)
669 mode->vtotal = mode->vsync_end + 1;
670
665 drm_mode_set_name(mode); 671 drm_mode_set_name(mode);
666 672
667 if (pt->misc & DRM_EDID_PT_INTERLACED) 673 if (pt->misc & DRM_EDID_PT_INTERLACED)
diff --git a/drivers/gpu/drm/drm_fb_helper.c b/drivers/gpu/drm/drm_fb_helper.c
index 9c924614c418..65ef011fa8ba 100644
--- a/drivers/gpu/drm/drm_fb_helper.c
+++ b/drivers/gpu/drm/drm_fb_helper.c
@@ -599,7 +599,7 @@ int drm_fb_helper_check_var(struct fb_var_screeninfo *var,
599 struct drm_framebuffer *fb = fb_helper->fb; 599 struct drm_framebuffer *fb = fb_helper->fb;
600 int depth; 600 int depth;
601 601
602 if (var->pixclock == -1 || !var->pixclock) 602 if (var->pixclock != 0)
603 return -EINVAL; 603 return -EINVAL;
604 604
605 /* Need to resize the fb object !!! */ 605 /* Need to resize the fb object !!! */
@@ -691,7 +691,7 @@ int drm_fb_helper_set_par(struct fb_info *info)
691 int ret; 691 int ret;
692 int i; 692 int i;
693 693
694 if (var->pixclock != -1) { 694 if (var->pixclock != 0) {
695 DRM_ERROR("PIXEL CLCOK SET\n"); 695 DRM_ERROR("PIXEL CLCOK SET\n");
696 return -EINVAL; 696 return -EINVAL;
697 } 697 }
@@ -707,7 +707,7 @@ int drm_fb_helper_set_par(struct fb_info *info)
707 707
708 if (crtc->fb == fb_helper->crtc_info[i].mode_set.fb) { 708 if (crtc->fb == fb_helper->crtc_info[i].mode_set.fb) {
709 mutex_lock(&dev->mode_config.mutex); 709 mutex_lock(&dev->mode_config.mutex);
710 ret = crtc->funcs->set_config(&fb_helper->crtc_info->mode_set); 710 ret = crtc->funcs->set_config(&fb_helper->crtc_info[i].mode_set);
711 mutex_unlock(&dev->mode_config.mutex); 711 mutex_unlock(&dev->mode_config.mutex);
712 if (ret) 712 if (ret)
713 return ret; 713 return ret;
@@ -904,7 +904,7 @@ int drm_fb_helper_single_fb_probe(struct drm_device *dev,
904 fb_helper->fb = fb; 904 fb_helper->fb = fb;
905 905
906 if (new_fb) { 906 if (new_fb) {
907 info->var.pixclock = -1; 907 info->var.pixclock = 0;
908 if (register_framebuffer(info) < 0) 908 if (register_framebuffer(info) < 0)
909 return -EINVAL; 909 return -EINVAL;
910 } else { 910 } else {
diff --git a/drivers/gpu/drm/drm_gem.c b/drivers/gpu/drm/drm_gem.c
index 80391995bdec..e9dbb481c469 100644
--- a/drivers/gpu/drm/drm_gem.c
+++ b/drivers/gpu/drm/drm_gem.c
@@ -552,7 +552,7 @@ int drm_gem_mmap(struct file *filp, struct vm_area_struct *vma)
552 vma->vm_flags |= VM_RESERVED | VM_IO | VM_PFNMAP | VM_DONTEXPAND; 552 vma->vm_flags |= VM_RESERVED | VM_IO | VM_PFNMAP | VM_DONTEXPAND;
553 vma->vm_ops = obj->dev->driver->gem_vm_ops; 553 vma->vm_ops = obj->dev->driver->gem_vm_ops;
554 vma->vm_private_data = map->handle; 554 vma->vm_private_data = map->handle;
555 vma->vm_page_prot = pgprot_writecombine(vma->vm_page_prot); 555 vma->vm_page_prot = pgprot_writecombine(vm_get_page_prot(vma->vm_flags));
556 556
557 /* Take a ref for this mapping of the object, so that the fault 557 /* Take a ref for this mapping of the object, so that the fault
558 * handler can dereference the mmap offset's pointer to the object. 558 * handler can dereference the mmap offset's pointer to the object.
diff --git a/drivers/gpu/drm/drm_mm.c b/drivers/gpu/drm/drm_mm.c
index c861d80fd779..97dc5a4f0de4 100644
--- a/drivers/gpu/drm/drm_mm.c
+++ b/drivers/gpu/drm/drm_mm.c
@@ -103,6 +103,11 @@ static struct drm_mm_node *drm_mm_kmalloc(struct drm_mm *mm, int atomic)
103 return child; 103 return child;
104} 104}
105 105
106/* drm_mm_pre_get() - pre allocate drm_mm_node structure
107 * drm_mm: memory manager struct we are pre-allocating for
108 *
109 * Returns 0 on success or -ENOMEM if allocation fails.
110 */
106int drm_mm_pre_get(struct drm_mm *mm) 111int drm_mm_pre_get(struct drm_mm *mm)
107{ 112{
108 struct drm_mm_node *node; 113 struct drm_mm_node *node;
@@ -253,12 +258,14 @@ void drm_mm_put_block(struct drm_mm_node *cur)
253 prev_node->size += next_node->size; 258 prev_node->size += next_node->size;
254 list_del(&next_node->ml_entry); 259 list_del(&next_node->ml_entry);
255 list_del(&next_node->fl_entry); 260 list_del(&next_node->fl_entry);
261 spin_lock(&mm->unused_lock);
256 if (mm->num_unused < MM_UNUSED_TARGET) { 262 if (mm->num_unused < MM_UNUSED_TARGET) {
257 list_add(&next_node->fl_entry, 263 list_add(&next_node->fl_entry,
258 &mm->unused_nodes); 264 &mm->unused_nodes);
259 ++mm->num_unused; 265 ++mm->num_unused;
260 } else 266 } else
261 kfree(next_node); 267 kfree(next_node);
268 spin_unlock(&mm->unused_lock);
262 } else { 269 } else {
263 next_node->size += cur->size; 270 next_node->size += cur->size;
264 next_node->start = cur->start; 271 next_node->start = cur->start;
@@ -271,11 +278,13 @@ void drm_mm_put_block(struct drm_mm_node *cur)
271 list_add(&cur->fl_entry, &mm->fl_entry); 278 list_add(&cur->fl_entry, &mm->fl_entry);
272 } else { 279 } else {
273 list_del(&cur->ml_entry); 280 list_del(&cur->ml_entry);
281 spin_lock(&mm->unused_lock);
274 if (mm->num_unused < MM_UNUSED_TARGET) { 282 if (mm->num_unused < MM_UNUSED_TARGET) {
275 list_add(&cur->fl_entry, &mm->unused_nodes); 283 list_add(&cur->fl_entry, &mm->unused_nodes);
276 ++mm->num_unused; 284 ++mm->num_unused;
277 } else 285 } else
278 kfree(cur); 286 kfree(cur);
287 spin_unlock(&mm->unused_lock);
279 } 288 }
280} 289}
281 290
diff --git a/drivers/gpu/drm/i915/i915_debugfs.c b/drivers/gpu/drm/i915/i915_debugfs.c
index f8ce9a3a420d..26bf0552b3cb 100644
--- a/drivers/gpu/drm/i915/i915_debugfs.c
+++ b/drivers/gpu/drm/i915/i915_debugfs.c
@@ -267,10 +267,10 @@ static void i915_dump_pages(struct seq_file *m, struct page **pages, int page_co
267 uint32_t *mem; 267 uint32_t *mem;
268 268
269 for (page = 0; page < page_count; page++) { 269 for (page = 0; page < page_count; page++) {
270 mem = kmap(pages[page]); 270 mem = kmap_atomic(pages[page], KM_USER0);
271 for (i = 0; i < PAGE_SIZE; i += 4) 271 for (i = 0; i < PAGE_SIZE; i += 4)
272 seq_printf(m, "%08x : %08x\n", i, mem[i / 4]); 272 seq_printf(m, "%08x : %08x\n", i, mem[i / 4]);
273 kunmap(pages[page]); 273 kunmap_atomic(pages[page], KM_USER0);
274 } 274 }
275} 275}
276 276
diff --git a/drivers/gpu/drm/i915/i915_dma.c b/drivers/gpu/drm/i915/i915_dma.c
index 92aeb918e0c0..e5b138be45fa 100644
--- a/drivers/gpu/drm/i915/i915_dma.c
+++ b/drivers/gpu/drm/i915/i915_dma.c
@@ -1227,8 +1227,7 @@ static int i915_load_modeset_init(struct drm_device *dev,
1227 goto out; 1227 goto out;
1228 1228
1229 /* Try to set up FBC with a reasonable compressed buffer size */ 1229 /* Try to set up FBC with a reasonable compressed buffer size */
1230 if (IS_MOBILE(dev) && (IS_I9XX(dev) || IS_I965G(dev) || IS_GM45(dev)) && 1230 if (I915_HAS_FBC(dev) && i915_powersave) {
1231 i915_powersave) {
1232 int cfb_size; 1231 int cfb_size;
1233 1232
1234 /* Try to get an 8M buffer... */ 1233 /* Try to get an 8M buffer... */
diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
index c5df2234418d..a725f6591192 100644
--- a/drivers/gpu/drm/i915/i915_drv.h
+++ b/drivers/gpu/drm/i915/i915_drv.h
@@ -296,6 +296,13 @@ typedef struct drm_i915_private {
296 u32 saveVBLANK_A; 296 u32 saveVBLANK_A;
297 u32 saveVSYNC_A; 297 u32 saveVSYNC_A;
298 u32 saveBCLRPAT_A; 298 u32 saveBCLRPAT_A;
299 u32 saveTRANSACONF;
300 u32 saveTRANS_HTOTAL_A;
301 u32 saveTRANS_HBLANK_A;
302 u32 saveTRANS_HSYNC_A;
303 u32 saveTRANS_VTOTAL_A;
304 u32 saveTRANS_VBLANK_A;
305 u32 saveTRANS_VSYNC_A;
299 u32 savePIPEASTAT; 306 u32 savePIPEASTAT;
300 u32 saveDSPASTRIDE; 307 u32 saveDSPASTRIDE;
301 u32 saveDSPASIZE; 308 u32 saveDSPASIZE;
@@ -304,8 +311,11 @@ typedef struct drm_i915_private {
304 u32 saveDSPASURF; 311 u32 saveDSPASURF;
305 u32 saveDSPATILEOFF; 312 u32 saveDSPATILEOFF;
306 u32 savePFIT_PGM_RATIOS; 313 u32 savePFIT_PGM_RATIOS;
314 u32 saveBLC_HIST_CTL;
307 u32 saveBLC_PWM_CTL; 315 u32 saveBLC_PWM_CTL;
308 u32 saveBLC_PWM_CTL2; 316 u32 saveBLC_PWM_CTL2;
317 u32 saveBLC_CPU_PWM_CTL;
318 u32 saveBLC_CPU_PWM_CTL2;
309 u32 saveFPB0; 319 u32 saveFPB0;
310 u32 saveFPB1; 320 u32 saveFPB1;
311 u32 saveDPLL_B; 321 u32 saveDPLL_B;
@@ -317,6 +327,13 @@ typedef struct drm_i915_private {
317 u32 saveVBLANK_B; 327 u32 saveVBLANK_B;
318 u32 saveVSYNC_B; 328 u32 saveVSYNC_B;
319 u32 saveBCLRPAT_B; 329 u32 saveBCLRPAT_B;
330 u32 saveTRANSBCONF;
331 u32 saveTRANS_HTOTAL_B;
332 u32 saveTRANS_HBLANK_B;
333 u32 saveTRANS_HSYNC_B;
334 u32 saveTRANS_VTOTAL_B;
335 u32 saveTRANS_VBLANK_B;
336 u32 saveTRANS_VSYNC_B;
320 u32 savePIPEBSTAT; 337 u32 savePIPEBSTAT;
321 u32 saveDSPBSTRIDE; 338 u32 saveDSPBSTRIDE;
322 u32 saveDSPBSIZE; 339 u32 saveDSPBSIZE;
@@ -342,6 +359,7 @@ typedef struct drm_i915_private {
342 u32 savePFIT_CONTROL; 359 u32 savePFIT_CONTROL;
343 u32 save_palette_a[256]; 360 u32 save_palette_a[256];
344 u32 save_palette_b[256]; 361 u32 save_palette_b[256];
362 u32 saveDPFC_CB_BASE;
345 u32 saveFBC_CFB_BASE; 363 u32 saveFBC_CFB_BASE;
346 u32 saveFBC_LL_BASE; 364 u32 saveFBC_LL_BASE;
347 u32 saveFBC_CONTROL; 365 u32 saveFBC_CONTROL;
@@ -349,6 +367,12 @@ typedef struct drm_i915_private {
349 u32 saveIER; 367 u32 saveIER;
350 u32 saveIIR; 368 u32 saveIIR;
351 u32 saveIMR; 369 u32 saveIMR;
370 u32 saveDEIER;
371 u32 saveDEIMR;
372 u32 saveGTIER;
373 u32 saveGTIMR;
374 u32 saveFDI_RXA_IMR;
375 u32 saveFDI_RXB_IMR;
352 u32 saveCACHE_MODE_0; 376 u32 saveCACHE_MODE_0;
353 u32 saveD_STATE; 377 u32 saveD_STATE;
354 u32 saveDSPCLK_GATE_D; 378 u32 saveDSPCLK_GATE_D;
@@ -382,6 +406,26 @@ typedef struct drm_i915_private {
382 u32 savePIPEB_DP_LINK_M; 406 u32 savePIPEB_DP_LINK_M;
383 u32 savePIPEA_DP_LINK_N; 407 u32 savePIPEA_DP_LINK_N;
384 u32 savePIPEB_DP_LINK_N; 408 u32 savePIPEB_DP_LINK_N;
409 u32 saveFDI_RXA_CTL;
410 u32 saveFDI_TXA_CTL;
411 u32 saveFDI_RXB_CTL;
412 u32 saveFDI_TXB_CTL;
413 u32 savePFA_CTL_1;
414 u32 savePFB_CTL_1;
415 u32 savePFA_WIN_SZ;
416 u32 savePFB_WIN_SZ;
417 u32 savePFA_WIN_POS;
418 u32 savePFB_WIN_POS;
419 u32 savePCH_DREF_CONTROL;
420 u32 saveDISP_ARB_CTL;
421 u32 savePIPEA_DATA_M1;
422 u32 savePIPEA_DATA_N1;
423 u32 savePIPEA_LINK_M1;
424 u32 savePIPEA_LINK_N1;
425 u32 savePIPEB_DATA_M1;
426 u32 savePIPEB_DATA_N1;
427 u32 savePIPEB_LINK_M1;
428 u32 savePIPEB_LINK_N1;
385 429
386 struct { 430 struct {
387 struct drm_mm gtt_space; 431 struct drm_mm gtt_space;
@@ -492,6 +536,8 @@ typedef struct drm_i915_private {
492 struct drm_i915_gem_phys_object *phys_objs[I915_MAX_PHYS_OBJECT]; 536 struct drm_i915_gem_phys_object *phys_objs[I915_MAX_PHYS_OBJECT];
493 } mm; 537 } mm;
494 struct sdvo_device_mapping sdvo_mappings[2]; 538 struct sdvo_device_mapping sdvo_mappings[2];
539 /* indicate whether the LVDS_BORDER should be enabled or not */
540 unsigned int lvds_border_bits;
495 541
496 /* Reclocking support */ 542 /* Reclocking support */
497 bool render_reclock_avail; 543 bool render_reclock_avail;
@@ -981,7 +1027,10 @@ extern int i915_wait_ring(struct drm_device * dev, int n, const char *caller);
981 1027
982#define HAS_FW_BLC(dev) (IS_I9XX(dev) || IS_G4X(dev) || IS_IGDNG(dev)) 1028#define HAS_FW_BLC(dev) (IS_I9XX(dev) || IS_G4X(dev) || IS_IGDNG(dev))
983#define HAS_PIPE_CXSR(dev) (IS_G4X(dev) || IS_IGDNG(dev)) 1029#define HAS_PIPE_CXSR(dev) (IS_G4X(dev) || IS_IGDNG(dev))
984#define I915_HAS_FBC(dev) (IS_MOBILE(dev) && (IS_I9XX(dev) || IS_I965G(dev))) 1030#define I915_HAS_FBC(dev) (IS_MOBILE(dev) && \
1031 (IS_I9XX(dev) || IS_GM45(dev)) && \
1032 !IS_IGD(dev) && \
1033 !IS_IGDNG(dev))
985 1034
986#define PRIMARY_RINGBUFFER_SIZE (128*1024) 1035#define PRIMARY_RINGBUFFER_SIZE (128*1024)
987 1036
diff --git a/drivers/gpu/drm/i915/i915_irq.c b/drivers/gpu/drm/i915/i915_irq.c
index c3ceffa46ea0..aa7fd82aa6eb 100644
--- a/drivers/gpu/drm/i915/i915_irq.c
+++ b/drivers/gpu/drm/i915/i915_irq.c
@@ -254,10 +254,15 @@ irqreturn_t igdng_irq_handler(struct drm_device *dev)
254{ 254{
255 drm_i915_private_t *dev_priv = (drm_i915_private_t *) dev->dev_private; 255 drm_i915_private_t *dev_priv = (drm_i915_private_t *) dev->dev_private;
256 int ret = IRQ_NONE; 256 int ret = IRQ_NONE;
257 u32 de_iir, gt_iir; 257 u32 de_iir, gt_iir, de_ier;
258 u32 new_de_iir, new_gt_iir; 258 u32 new_de_iir, new_gt_iir;
259 struct drm_i915_master_private *master_priv; 259 struct drm_i915_master_private *master_priv;
260 260
261 /* disable master interrupt before clearing iir */
262 de_ier = I915_READ(DEIER);
263 I915_WRITE(DEIER, de_ier & ~DE_MASTER_IRQ_CONTROL);
264 (void)I915_READ(DEIER);
265
261 de_iir = I915_READ(DEIIR); 266 de_iir = I915_READ(DEIIR);
262 gt_iir = I915_READ(GTIIR); 267 gt_iir = I915_READ(GTIIR);
263 268
@@ -290,6 +295,9 @@ irqreturn_t igdng_irq_handler(struct drm_device *dev)
290 gt_iir = new_gt_iir; 295 gt_iir = new_gt_iir;
291 } 296 }
292 297
298 I915_WRITE(DEIER, de_ier);
299 (void)I915_READ(DEIER);
300
293 return ret; 301 return ret;
294} 302}
295 303
diff --git a/drivers/gpu/drm/i915/i915_reg.h b/drivers/gpu/drm/i915/i915_reg.h
index 0466ddbeba32..1687edf68795 100644
--- a/drivers/gpu/drm/i915/i915_reg.h
+++ b/drivers/gpu/drm/i915/i915_reg.h
@@ -968,6 +968,8 @@
968#define LVDS_PORT_EN (1 << 31) 968#define LVDS_PORT_EN (1 << 31)
969/* Selects pipe B for LVDS data. Must be set on pre-965. */ 969/* Selects pipe B for LVDS data. Must be set on pre-965. */
970#define LVDS_PIPEB_SELECT (1 << 30) 970#define LVDS_PIPEB_SELECT (1 << 30)
971/* Enable border for unscaled (or aspect-scaled) display */
972#define LVDS_BORDER_ENABLE (1 << 15)
971/* 973/*
972 * Enables the A0-A2 data pairs and CLKA, containing 18 bits of color data per 974 * Enables the A0-A2 data pairs and CLKA, containing 18 bits of color data per
973 * pixel. 975 * pixel.
@@ -1078,6 +1080,8 @@
1078#define BACKLIGHT_DUTY_CYCLE_SHIFT (0) 1080#define BACKLIGHT_DUTY_CYCLE_SHIFT (0)
1079#define BACKLIGHT_DUTY_CYCLE_MASK (0xffff) 1081#define BACKLIGHT_DUTY_CYCLE_MASK (0xffff)
1080 1082
1083#define BLC_HIST_CTL 0x61260
1084
1081/* TV port control */ 1085/* TV port control */
1082#define TV_CTL 0x68000 1086#define TV_CTL 0x68000
1083/** Enables the TV encoder */ 1087/** Enables the TV encoder */
@@ -1780,6 +1784,11 @@
1780#define PIPE_START_VBLANK_INTERRUPT_STATUS (1UL<<2) /* 965 or later */ 1784#define PIPE_START_VBLANK_INTERRUPT_STATUS (1UL<<2) /* 965 or later */
1781#define PIPE_VBLANK_INTERRUPT_STATUS (1UL<<1) 1785#define PIPE_VBLANK_INTERRUPT_STATUS (1UL<<1)
1782#define PIPE_OVERLAY_UPDATED_STATUS (1UL<<0) 1786#define PIPE_OVERLAY_UPDATED_STATUS (1UL<<0)
1787#define PIPE_BPC_MASK (7 << 5) /* Ironlake */
1788#define PIPE_8BPC (0 << 5)
1789#define PIPE_10BPC (1 << 5)
1790#define PIPE_6BPC (2 << 5)
1791#define PIPE_12BPC (3 << 5)
1783 1792
1784#define DSPARB 0x70030 1793#define DSPARB 0x70030
1785#define DSPARB_CSTART_MASK (0x7f << 7) 1794#define DSPARB_CSTART_MASK (0x7f << 7)
@@ -1790,17 +1799,29 @@
1790#define DSPARB_AEND_SHIFT 0 1799#define DSPARB_AEND_SHIFT 0
1791 1800
1792#define DSPFW1 0x70034 1801#define DSPFW1 0x70034
1802#define DSPFW_SR_SHIFT 23
1803#define DSPFW_CURSORB_SHIFT 16
1804#define DSPFW_PLANEB_SHIFT 8
1793#define DSPFW2 0x70038 1805#define DSPFW2 0x70038
1806#define DSPFW_CURSORA_MASK 0x00003f00
1807#define DSPFW_CURSORA_SHIFT 16
1794#define DSPFW3 0x7003c 1808#define DSPFW3 0x7003c
1809#define DSPFW_HPLL_SR_EN (1<<31)
1810#define DSPFW_CURSOR_SR_SHIFT 24
1795#define IGD_SELF_REFRESH_EN (1<<30) 1811#define IGD_SELF_REFRESH_EN (1<<30)
1796 1812
1797/* FIFO watermark sizes etc */ 1813/* FIFO watermark sizes etc */
1814#define G4X_FIFO_LINE_SIZE 64
1798#define I915_FIFO_LINE_SIZE 64 1815#define I915_FIFO_LINE_SIZE 64
1799#define I830_FIFO_LINE_SIZE 32 1816#define I830_FIFO_LINE_SIZE 32
1817
1818#define G4X_FIFO_SIZE 127
1800#define I945_FIFO_SIZE 127 /* 945 & 965 */ 1819#define I945_FIFO_SIZE 127 /* 945 & 965 */
1801#define I915_FIFO_SIZE 95 1820#define I915_FIFO_SIZE 95
1802#define I855GM_FIFO_SIZE 127 /* In cachelines */ 1821#define I855GM_FIFO_SIZE 127 /* In cachelines */
1803#define I830_FIFO_SIZE 95 1822#define I830_FIFO_SIZE 95
1823
1824#define G4X_MAX_WM 0x3f
1804#define I915_MAX_WM 0x3f 1825#define I915_MAX_WM 0x3f
1805 1826
1806#define IGD_DISPLAY_FIFO 512 /* in 64byte unit */ 1827#define IGD_DISPLAY_FIFO 512 /* in 64byte unit */
@@ -2030,6 +2051,11 @@
2030#define PFA_CTL_1 0x68080 2051#define PFA_CTL_1 0x68080
2031#define PFB_CTL_1 0x68880 2052#define PFB_CTL_1 0x68880
2032#define PF_ENABLE (1<<31) 2053#define PF_ENABLE (1<<31)
2054#define PF_FILTER_MASK (3<<23)
2055#define PF_FILTER_PROGRAMMED (0<<23)
2056#define PF_FILTER_MED_3x3 (1<<23)
2057#define PF_FILTER_EDGE_ENHANCE (2<<23)
2058#define PF_FILTER_EDGE_SOFTEN (3<<23)
2033#define PFA_WIN_SZ 0x68074 2059#define PFA_WIN_SZ 0x68074
2034#define PFB_WIN_SZ 0x68874 2060#define PFB_WIN_SZ 0x68874
2035#define PFA_WIN_POS 0x68070 2061#define PFA_WIN_POS 0x68070
@@ -2149,11 +2175,11 @@
2149#define DREF_CPU_SOURCE_OUTPUT_MASK (3<<13) 2175#define DREF_CPU_SOURCE_OUTPUT_MASK (3<<13)
2150#define DREF_SSC_SOURCE_DISABLE (0<<11) 2176#define DREF_SSC_SOURCE_DISABLE (0<<11)
2151#define DREF_SSC_SOURCE_ENABLE (2<<11) 2177#define DREF_SSC_SOURCE_ENABLE (2<<11)
2152#define DREF_SSC_SOURCE_MASK (2<<11) 2178#define DREF_SSC_SOURCE_MASK (3<<11)
2153#define DREF_NONSPREAD_SOURCE_DISABLE (0<<9) 2179#define DREF_NONSPREAD_SOURCE_DISABLE (0<<9)
2154#define DREF_NONSPREAD_CK505_ENABLE (1<<9) 2180#define DREF_NONSPREAD_CK505_ENABLE (1<<9)
2155#define DREF_NONSPREAD_SOURCE_ENABLE (2<<9) 2181#define DREF_NONSPREAD_SOURCE_ENABLE (2<<9)
2156#define DREF_NONSPREAD_SOURCE_MASK (2<<9) 2182#define DREF_NONSPREAD_SOURCE_MASK (3<<9)
2157#define DREF_SUPERSPREAD_SOURCE_DISABLE (0<<7) 2183#define DREF_SUPERSPREAD_SOURCE_DISABLE (0<<7)
2158#define DREF_SUPERSPREAD_SOURCE_ENABLE (2<<7) 2184#define DREF_SUPERSPREAD_SOURCE_ENABLE (2<<7)
2159#define DREF_SSC4_DOWNSPREAD (0<<6) 2185#define DREF_SSC4_DOWNSPREAD (0<<6)
diff --git a/drivers/gpu/drm/i915/i915_suspend.c b/drivers/gpu/drm/i915/i915_suspend.c
index bd6d8d91ca9f..6eec8171a44e 100644
--- a/drivers/gpu/drm/i915/i915_suspend.c
+++ b/drivers/gpu/drm/i915/i915_suspend.c
@@ -32,11 +32,15 @@
32static bool i915_pipe_enabled(struct drm_device *dev, enum pipe pipe) 32static bool i915_pipe_enabled(struct drm_device *dev, enum pipe pipe)
33{ 33{
34 struct drm_i915_private *dev_priv = dev->dev_private; 34 struct drm_i915_private *dev_priv = dev->dev_private;
35 u32 dpll_reg;
35 36
36 if (pipe == PIPE_A) 37 if (IS_IGDNG(dev)) {
37 return (I915_READ(DPLL_A) & DPLL_VCO_ENABLE); 38 dpll_reg = (pipe == PIPE_A) ? PCH_DPLL_A: PCH_DPLL_B;
38 else 39 } else {
39 return (I915_READ(DPLL_B) & DPLL_VCO_ENABLE); 40 dpll_reg = (pipe == PIPE_A) ? DPLL_A: DPLL_B;
41 }
42
43 return (I915_READ(dpll_reg) & DPLL_VCO_ENABLE);
40} 44}
41 45
42static void i915_save_palette(struct drm_device *dev, enum pipe pipe) 46static void i915_save_palette(struct drm_device *dev, enum pipe pipe)
@@ -49,6 +53,9 @@ static void i915_save_palette(struct drm_device *dev, enum pipe pipe)
49 if (!i915_pipe_enabled(dev, pipe)) 53 if (!i915_pipe_enabled(dev, pipe))
50 return; 54 return;
51 55
56 if (IS_IGDNG(dev))
57 reg = (pipe == PIPE_A) ? LGC_PALETTE_A : LGC_PALETTE_B;
58
52 if (pipe == PIPE_A) 59 if (pipe == PIPE_A)
53 array = dev_priv->save_palette_a; 60 array = dev_priv->save_palette_a;
54 else 61 else
@@ -68,6 +75,9 @@ static void i915_restore_palette(struct drm_device *dev, enum pipe pipe)
68 if (!i915_pipe_enabled(dev, pipe)) 75 if (!i915_pipe_enabled(dev, pipe))
69 return; 76 return;
70 77
78 if (IS_IGDNG(dev))
79 reg = (pipe == PIPE_A) ? LGC_PALETTE_A : LGC_PALETTE_B;
80
71 if (pipe == PIPE_A) 81 if (pipe == PIPE_A)
72 array = dev_priv->save_palette_a; 82 array = dev_priv->save_palette_a;
73 else 83 else
@@ -229,13 +239,24 @@ static void i915_save_modeset_reg(struct drm_device *dev)
229 if (drm_core_check_feature(dev, DRIVER_MODESET)) 239 if (drm_core_check_feature(dev, DRIVER_MODESET))
230 return; 240 return;
231 241
242 if (IS_IGDNG(dev)) {
243 dev_priv->savePCH_DREF_CONTROL = I915_READ(PCH_DREF_CONTROL);
244 dev_priv->saveDISP_ARB_CTL = I915_READ(DISP_ARB_CTL);
245 }
246
232 /* Pipe & plane A info */ 247 /* Pipe & plane A info */
233 dev_priv->savePIPEACONF = I915_READ(PIPEACONF); 248 dev_priv->savePIPEACONF = I915_READ(PIPEACONF);
234 dev_priv->savePIPEASRC = I915_READ(PIPEASRC); 249 dev_priv->savePIPEASRC = I915_READ(PIPEASRC);
235 dev_priv->saveFPA0 = I915_READ(FPA0); 250 if (IS_IGDNG(dev)) {
236 dev_priv->saveFPA1 = I915_READ(FPA1); 251 dev_priv->saveFPA0 = I915_READ(PCH_FPA0);
237 dev_priv->saveDPLL_A = I915_READ(DPLL_A); 252 dev_priv->saveFPA1 = I915_READ(PCH_FPA1);
238 if (IS_I965G(dev)) 253 dev_priv->saveDPLL_A = I915_READ(PCH_DPLL_A);
254 } else {
255 dev_priv->saveFPA0 = I915_READ(FPA0);
256 dev_priv->saveFPA1 = I915_READ(FPA1);
257 dev_priv->saveDPLL_A = I915_READ(DPLL_A);
258 }
259 if (IS_I965G(dev) && !IS_IGDNG(dev))
239 dev_priv->saveDPLL_A_MD = I915_READ(DPLL_A_MD); 260 dev_priv->saveDPLL_A_MD = I915_READ(DPLL_A_MD);
240 dev_priv->saveHTOTAL_A = I915_READ(HTOTAL_A); 261 dev_priv->saveHTOTAL_A = I915_READ(HTOTAL_A);
241 dev_priv->saveHBLANK_A = I915_READ(HBLANK_A); 262 dev_priv->saveHBLANK_A = I915_READ(HBLANK_A);
@@ -243,7 +264,30 @@ static void i915_save_modeset_reg(struct drm_device *dev)
243 dev_priv->saveVTOTAL_A = I915_READ(VTOTAL_A); 264 dev_priv->saveVTOTAL_A = I915_READ(VTOTAL_A);
244 dev_priv->saveVBLANK_A = I915_READ(VBLANK_A); 265 dev_priv->saveVBLANK_A = I915_READ(VBLANK_A);
245 dev_priv->saveVSYNC_A = I915_READ(VSYNC_A); 266 dev_priv->saveVSYNC_A = I915_READ(VSYNC_A);
246 dev_priv->saveBCLRPAT_A = I915_READ(BCLRPAT_A); 267 if (!IS_IGDNG(dev))
268 dev_priv->saveBCLRPAT_A = I915_READ(BCLRPAT_A);
269
270 if (IS_IGDNG(dev)) {
271 dev_priv->savePIPEA_DATA_M1 = I915_READ(PIPEA_DATA_M1);
272 dev_priv->savePIPEA_DATA_N1 = I915_READ(PIPEA_DATA_N1);
273 dev_priv->savePIPEA_LINK_M1 = I915_READ(PIPEA_LINK_M1);
274 dev_priv->savePIPEA_LINK_N1 = I915_READ(PIPEA_LINK_N1);
275
276 dev_priv->saveFDI_TXA_CTL = I915_READ(FDI_TXA_CTL);
277 dev_priv->saveFDI_RXA_CTL = I915_READ(FDI_RXA_CTL);
278
279 dev_priv->savePFA_CTL_1 = I915_READ(PFA_CTL_1);
280 dev_priv->savePFA_WIN_SZ = I915_READ(PFA_WIN_SZ);
281 dev_priv->savePFA_WIN_POS = I915_READ(PFA_WIN_POS);
282
283 dev_priv->saveTRANSACONF = I915_READ(TRANSACONF);
284 dev_priv->saveTRANS_HTOTAL_A = I915_READ(TRANS_HTOTAL_A);
285 dev_priv->saveTRANS_HBLANK_A = I915_READ(TRANS_HBLANK_A);
286 dev_priv->saveTRANS_HSYNC_A = I915_READ(TRANS_HSYNC_A);
287 dev_priv->saveTRANS_VTOTAL_A = I915_READ(TRANS_VTOTAL_A);
288 dev_priv->saveTRANS_VBLANK_A = I915_READ(TRANS_VBLANK_A);
289 dev_priv->saveTRANS_VSYNC_A = I915_READ(TRANS_VSYNC_A);
290 }
247 291
248 dev_priv->saveDSPACNTR = I915_READ(DSPACNTR); 292 dev_priv->saveDSPACNTR = I915_READ(DSPACNTR);
249 dev_priv->saveDSPASTRIDE = I915_READ(DSPASTRIDE); 293 dev_priv->saveDSPASTRIDE = I915_READ(DSPASTRIDE);
@@ -260,10 +304,16 @@ static void i915_save_modeset_reg(struct drm_device *dev)
260 /* Pipe & plane B info */ 304 /* Pipe & plane B info */
261 dev_priv->savePIPEBCONF = I915_READ(PIPEBCONF); 305 dev_priv->savePIPEBCONF = I915_READ(PIPEBCONF);
262 dev_priv->savePIPEBSRC = I915_READ(PIPEBSRC); 306 dev_priv->savePIPEBSRC = I915_READ(PIPEBSRC);
263 dev_priv->saveFPB0 = I915_READ(FPB0); 307 if (IS_IGDNG(dev)) {
264 dev_priv->saveFPB1 = I915_READ(FPB1); 308 dev_priv->saveFPB0 = I915_READ(PCH_FPB0);
265 dev_priv->saveDPLL_B = I915_READ(DPLL_B); 309 dev_priv->saveFPB1 = I915_READ(PCH_FPB1);
266 if (IS_I965G(dev)) 310 dev_priv->saveDPLL_B = I915_READ(PCH_DPLL_B);
311 } else {
312 dev_priv->saveFPB0 = I915_READ(FPB0);
313 dev_priv->saveFPB1 = I915_READ(FPB1);
314 dev_priv->saveDPLL_B = I915_READ(DPLL_B);
315 }
316 if (IS_I965G(dev) && !IS_IGDNG(dev))
267 dev_priv->saveDPLL_B_MD = I915_READ(DPLL_B_MD); 317 dev_priv->saveDPLL_B_MD = I915_READ(DPLL_B_MD);
268 dev_priv->saveHTOTAL_B = I915_READ(HTOTAL_B); 318 dev_priv->saveHTOTAL_B = I915_READ(HTOTAL_B);
269 dev_priv->saveHBLANK_B = I915_READ(HBLANK_B); 319 dev_priv->saveHBLANK_B = I915_READ(HBLANK_B);
@@ -271,7 +321,30 @@ static void i915_save_modeset_reg(struct drm_device *dev)
271 dev_priv->saveVTOTAL_B = I915_READ(VTOTAL_B); 321 dev_priv->saveVTOTAL_B = I915_READ(VTOTAL_B);
272 dev_priv->saveVBLANK_B = I915_READ(VBLANK_B); 322 dev_priv->saveVBLANK_B = I915_READ(VBLANK_B);
273 dev_priv->saveVSYNC_B = I915_READ(VSYNC_B); 323 dev_priv->saveVSYNC_B = I915_READ(VSYNC_B);
274 dev_priv->saveBCLRPAT_A = I915_READ(BCLRPAT_A); 324 if (!IS_IGDNG(dev))
325 dev_priv->saveBCLRPAT_B = I915_READ(BCLRPAT_B);
326
327 if (IS_IGDNG(dev)) {
328 dev_priv->savePIPEB_DATA_M1 = I915_READ(PIPEB_DATA_M1);
329 dev_priv->savePIPEB_DATA_N1 = I915_READ(PIPEB_DATA_N1);
330 dev_priv->savePIPEB_LINK_M1 = I915_READ(PIPEB_LINK_M1);
331 dev_priv->savePIPEB_LINK_N1 = I915_READ(PIPEB_LINK_N1);
332
333 dev_priv->saveFDI_TXB_CTL = I915_READ(FDI_TXB_CTL);
334 dev_priv->saveFDI_RXB_CTL = I915_READ(FDI_RXB_CTL);
335
336 dev_priv->savePFB_CTL_1 = I915_READ(PFB_CTL_1);
337 dev_priv->savePFB_WIN_SZ = I915_READ(PFB_WIN_SZ);
338 dev_priv->savePFB_WIN_POS = I915_READ(PFB_WIN_POS);
339
340 dev_priv->saveTRANSBCONF = I915_READ(TRANSBCONF);
341 dev_priv->saveTRANS_HTOTAL_B = I915_READ(TRANS_HTOTAL_B);
342 dev_priv->saveTRANS_HBLANK_B = I915_READ(TRANS_HBLANK_B);
343 dev_priv->saveTRANS_HSYNC_B = I915_READ(TRANS_HSYNC_B);
344 dev_priv->saveTRANS_VTOTAL_B = I915_READ(TRANS_VTOTAL_B);
345 dev_priv->saveTRANS_VBLANK_B = I915_READ(TRANS_VBLANK_B);
346 dev_priv->saveTRANS_VSYNC_B = I915_READ(TRANS_VSYNC_B);
347 }
275 348
276 dev_priv->saveDSPBCNTR = I915_READ(DSPBCNTR); 349 dev_priv->saveDSPBCNTR = I915_READ(DSPBCNTR);
277 dev_priv->saveDSPBSTRIDE = I915_READ(DSPBSTRIDE); 350 dev_priv->saveDSPBSTRIDE = I915_READ(DSPBSTRIDE);
@@ -290,23 +363,46 @@ static void i915_save_modeset_reg(struct drm_device *dev)
290static void i915_restore_modeset_reg(struct drm_device *dev) 363static void i915_restore_modeset_reg(struct drm_device *dev)
291{ 364{
292 struct drm_i915_private *dev_priv = dev->dev_private; 365 struct drm_i915_private *dev_priv = dev->dev_private;
366 int dpll_a_reg, fpa0_reg, fpa1_reg;
367 int dpll_b_reg, fpb0_reg, fpb1_reg;
293 368
294 if (drm_core_check_feature(dev, DRIVER_MODESET)) 369 if (drm_core_check_feature(dev, DRIVER_MODESET))
295 return; 370 return;
296 371
372 if (IS_IGDNG(dev)) {
373 dpll_a_reg = PCH_DPLL_A;
374 dpll_b_reg = PCH_DPLL_B;
375 fpa0_reg = PCH_FPA0;
376 fpb0_reg = PCH_FPB0;
377 fpa1_reg = PCH_FPA1;
378 fpb1_reg = PCH_FPB1;
379 } else {
380 dpll_a_reg = DPLL_A;
381 dpll_b_reg = DPLL_B;
382 fpa0_reg = FPA0;
383 fpb0_reg = FPB0;
384 fpa1_reg = FPA1;
385 fpb1_reg = FPB1;
386 }
387
388 if (IS_IGDNG(dev)) {
389 I915_WRITE(PCH_DREF_CONTROL, dev_priv->savePCH_DREF_CONTROL);
390 I915_WRITE(DISP_ARB_CTL, dev_priv->saveDISP_ARB_CTL);
391 }
392
297 /* Pipe & plane A info */ 393 /* Pipe & plane A info */
298 /* Prime the clock */ 394 /* Prime the clock */
299 if (dev_priv->saveDPLL_A & DPLL_VCO_ENABLE) { 395 if (dev_priv->saveDPLL_A & DPLL_VCO_ENABLE) {
300 I915_WRITE(DPLL_A, dev_priv->saveDPLL_A & 396 I915_WRITE(dpll_a_reg, dev_priv->saveDPLL_A &
301 ~DPLL_VCO_ENABLE); 397 ~DPLL_VCO_ENABLE);
302 DRM_UDELAY(150); 398 DRM_UDELAY(150);
303 } 399 }
304 I915_WRITE(FPA0, dev_priv->saveFPA0); 400 I915_WRITE(fpa0_reg, dev_priv->saveFPA0);
305 I915_WRITE(FPA1, dev_priv->saveFPA1); 401 I915_WRITE(fpa1_reg, dev_priv->saveFPA1);
306 /* Actually enable it */ 402 /* Actually enable it */
307 I915_WRITE(DPLL_A, dev_priv->saveDPLL_A); 403 I915_WRITE(dpll_a_reg, dev_priv->saveDPLL_A);
308 DRM_UDELAY(150); 404 DRM_UDELAY(150);
309 if (IS_I965G(dev)) 405 if (IS_I965G(dev) && !IS_IGDNG(dev))
310 I915_WRITE(DPLL_A_MD, dev_priv->saveDPLL_A_MD); 406 I915_WRITE(DPLL_A_MD, dev_priv->saveDPLL_A_MD);
311 DRM_UDELAY(150); 407 DRM_UDELAY(150);
312 408
@@ -317,7 +413,30 @@ static void i915_restore_modeset_reg(struct drm_device *dev)
317 I915_WRITE(VTOTAL_A, dev_priv->saveVTOTAL_A); 413 I915_WRITE(VTOTAL_A, dev_priv->saveVTOTAL_A);
318 I915_WRITE(VBLANK_A, dev_priv->saveVBLANK_A); 414 I915_WRITE(VBLANK_A, dev_priv->saveVBLANK_A);
319 I915_WRITE(VSYNC_A, dev_priv->saveVSYNC_A); 415 I915_WRITE(VSYNC_A, dev_priv->saveVSYNC_A);
320 I915_WRITE(BCLRPAT_A, dev_priv->saveBCLRPAT_A); 416 if (!IS_IGDNG(dev))
417 I915_WRITE(BCLRPAT_A, dev_priv->saveBCLRPAT_A);
418
419 if (IS_IGDNG(dev)) {
420 I915_WRITE(PIPEA_DATA_M1, dev_priv->savePIPEA_DATA_M1);
421 I915_WRITE(PIPEA_DATA_N1, dev_priv->savePIPEA_DATA_N1);
422 I915_WRITE(PIPEA_LINK_M1, dev_priv->savePIPEA_LINK_M1);
423 I915_WRITE(PIPEA_LINK_N1, dev_priv->savePIPEA_LINK_N1);
424
425 I915_WRITE(FDI_RXA_CTL, dev_priv->saveFDI_RXA_CTL);
426 I915_WRITE(FDI_TXA_CTL, dev_priv->saveFDI_TXA_CTL);
427
428 I915_WRITE(PFA_CTL_1, dev_priv->savePFA_CTL_1);
429 I915_WRITE(PFA_WIN_SZ, dev_priv->savePFA_WIN_SZ);
430 I915_WRITE(PFA_WIN_POS, dev_priv->savePFA_WIN_POS);
431
432 I915_WRITE(TRANSACONF, dev_priv->saveTRANSACONF);
433 I915_WRITE(TRANS_HTOTAL_A, dev_priv->saveTRANS_HTOTAL_A);
434 I915_WRITE(TRANS_HBLANK_A, dev_priv->saveTRANS_HBLANK_A);
435 I915_WRITE(TRANS_HSYNC_A, dev_priv->saveTRANS_HSYNC_A);
436 I915_WRITE(TRANS_VTOTAL_A, dev_priv->saveTRANS_VTOTAL_A);
437 I915_WRITE(TRANS_VBLANK_A, dev_priv->saveTRANS_VBLANK_A);
438 I915_WRITE(TRANS_VSYNC_A, dev_priv->saveTRANS_VSYNC_A);
439 }
321 440
322 /* Restore plane info */ 441 /* Restore plane info */
323 I915_WRITE(DSPASIZE, dev_priv->saveDSPASIZE); 442 I915_WRITE(DSPASIZE, dev_priv->saveDSPASIZE);
@@ -339,16 +458,16 @@ static void i915_restore_modeset_reg(struct drm_device *dev)
339 458
340 /* Pipe & plane B info */ 459 /* Pipe & plane B info */
341 if (dev_priv->saveDPLL_B & DPLL_VCO_ENABLE) { 460 if (dev_priv->saveDPLL_B & DPLL_VCO_ENABLE) {
342 I915_WRITE(DPLL_B, dev_priv->saveDPLL_B & 461 I915_WRITE(dpll_b_reg, dev_priv->saveDPLL_B &
343 ~DPLL_VCO_ENABLE); 462 ~DPLL_VCO_ENABLE);
344 DRM_UDELAY(150); 463 DRM_UDELAY(150);
345 } 464 }
346 I915_WRITE(FPB0, dev_priv->saveFPB0); 465 I915_WRITE(fpb0_reg, dev_priv->saveFPB0);
347 I915_WRITE(FPB1, dev_priv->saveFPB1); 466 I915_WRITE(fpb1_reg, dev_priv->saveFPB1);
348 /* Actually enable it */ 467 /* Actually enable it */
349 I915_WRITE(DPLL_B, dev_priv->saveDPLL_B); 468 I915_WRITE(dpll_b_reg, dev_priv->saveDPLL_B);
350 DRM_UDELAY(150); 469 DRM_UDELAY(150);
351 if (IS_I965G(dev)) 470 if (IS_I965G(dev) && !IS_IGDNG(dev))
352 I915_WRITE(DPLL_B_MD, dev_priv->saveDPLL_B_MD); 471 I915_WRITE(DPLL_B_MD, dev_priv->saveDPLL_B_MD);
353 DRM_UDELAY(150); 472 DRM_UDELAY(150);
354 473
@@ -359,7 +478,30 @@ static void i915_restore_modeset_reg(struct drm_device *dev)
359 I915_WRITE(VTOTAL_B, dev_priv->saveVTOTAL_B); 478 I915_WRITE(VTOTAL_B, dev_priv->saveVTOTAL_B);
360 I915_WRITE(VBLANK_B, dev_priv->saveVBLANK_B); 479 I915_WRITE(VBLANK_B, dev_priv->saveVBLANK_B);
361 I915_WRITE(VSYNC_B, dev_priv->saveVSYNC_B); 480 I915_WRITE(VSYNC_B, dev_priv->saveVSYNC_B);
362 I915_WRITE(BCLRPAT_B, dev_priv->saveBCLRPAT_B); 481 if (!IS_IGDNG(dev))
482 I915_WRITE(BCLRPAT_B, dev_priv->saveBCLRPAT_B);
483
484 if (IS_IGDNG(dev)) {
485 I915_WRITE(PIPEB_DATA_M1, dev_priv->savePIPEB_DATA_M1);
486 I915_WRITE(PIPEB_DATA_N1, dev_priv->savePIPEB_DATA_N1);
487 I915_WRITE(PIPEB_LINK_M1, dev_priv->savePIPEB_LINK_M1);
488 I915_WRITE(PIPEB_LINK_N1, dev_priv->savePIPEB_LINK_N1);
489
490 I915_WRITE(FDI_RXB_CTL, dev_priv->saveFDI_RXB_CTL);
491 I915_WRITE(FDI_TXB_CTL, dev_priv->saveFDI_TXB_CTL);
492
493 I915_WRITE(PFB_CTL_1, dev_priv->savePFB_CTL_1);
494 I915_WRITE(PFB_WIN_SZ, dev_priv->savePFB_WIN_SZ);
495 I915_WRITE(PFB_WIN_POS, dev_priv->savePFB_WIN_POS);
496
497 I915_WRITE(TRANSBCONF, dev_priv->saveTRANSBCONF);
498 I915_WRITE(TRANS_HTOTAL_B, dev_priv->saveTRANS_HTOTAL_B);
499 I915_WRITE(TRANS_HBLANK_B, dev_priv->saveTRANS_HBLANK_B);
500 I915_WRITE(TRANS_HSYNC_B, dev_priv->saveTRANS_HSYNC_B);
501 I915_WRITE(TRANS_VTOTAL_B, dev_priv->saveTRANS_VTOTAL_B);
502 I915_WRITE(TRANS_VBLANK_B, dev_priv->saveTRANS_VBLANK_B);
503 I915_WRITE(TRANS_VSYNC_B, dev_priv->saveTRANS_VSYNC_B);
504 }
363 505
364 /* Restore plane info */ 506 /* Restore plane info */
365 I915_WRITE(DSPBSIZE, dev_priv->saveDSPBSIZE); 507 I915_WRITE(DSPBSIZE, dev_priv->saveDSPBSIZE);
@@ -404,21 +546,43 @@ void i915_save_display(struct drm_device *dev)
404 dev_priv->saveCURSIZE = I915_READ(CURSIZE); 546 dev_priv->saveCURSIZE = I915_READ(CURSIZE);
405 547
406 /* CRT state */ 548 /* CRT state */
407 dev_priv->saveADPA = I915_READ(ADPA); 549 if (IS_IGDNG(dev)) {
550 dev_priv->saveADPA = I915_READ(PCH_ADPA);
551 } else {
552 dev_priv->saveADPA = I915_READ(ADPA);
553 }
408 554
409 /* LVDS state */ 555 /* LVDS state */
410 dev_priv->savePP_CONTROL = I915_READ(PP_CONTROL); 556 if (IS_IGDNG(dev)) {
411 dev_priv->savePFIT_PGM_RATIOS = I915_READ(PFIT_PGM_RATIOS); 557 dev_priv->savePP_CONTROL = I915_READ(PCH_PP_CONTROL);
412 dev_priv->saveBLC_PWM_CTL = I915_READ(BLC_PWM_CTL); 558 dev_priv->saveBLC_PWM_CTL = I915_READ(BLC_PWM_PCH_CTL1);
413 if (IS_I965G(dev)) 559 dev_priv->saveBLC_PWM_CTL2 = I915_READ(BLC_PWM_PCH_CTL2);
414 dev_priv->saveBLC_PWM_CTL2 = I915_READ(BLC_PWM_CTL2); 560 dev_priv->saveBLC_CPU_PWM_CTL = I915_READ(BLC_PWM_CPU_CTL);
415 if (IS_MOBILE(dev) && !IS_I830(dev)) 561 dev_priv->saveBLC_CPU_PWM_CTL2 = I915_READ(BLC_PWM_CPU_CTL2);
416 dev_priv->saveLVDS = I915_READ(LVDS); 562 dev_priv->saveLVDS = I915_READ(PCH_LVDS);
417 if (!IS_I830(dev) && !IS_845G(dev)) 563 } else {
564 dev_priv->savePP_CONTROL = I915_READ(PP_CONTROL);
565 dev_priv->savePFIT_PGM_RATIOS = I915_READ(PFIT_PGM_RATIOS);
566 dev_priv->saveBLC_PWM_CTL = I915_READ(BLC_PWM_CTL);
567 dev_priv->saveBLC_HIST_CTL = I915_READ(BLC_HIST_CTL);
568 if (IS_I965G(dev))
569 dev_priv->saveBLC_PWM_CTL2 = I915_READ(BLC_PWM_CTL2);
570 if (IS_MOBILE(dev) && !IS_I830(dev))
571 dev_priv->saveLVDS = I915_READ(LVDS);
572 }
573
574 if (!IS_I830(dev) && !IS_845G(dev) && !IS_IGDNG(dev))
418 dev_priv->savePFIT_CONTROL = I915_READ(PFIT_CONTROL); 575 dev_priv->savePFIT_CONTROL = I915_READ(PFIT_CONTROL);
419 dev_priv->savePP_ON_DELAYS = I915_READ(PP_ON_DELAYS); 576
420 dev_priv->savePP_OFF_DELAYS = I915_READ(PP_OFF_DELAYS); 577 if (IS_IGDNG(dev)) {
421 dev_priv->savePP_DIVISOR = I915_READ(PP_DIVISOR); 578 dev_priv->savePP_ON_DELAYS = I915_READ(PCH_PP_ON_DELAYS);
579 dev_priv->savePP_OFF_DELAYS = I915_READ(PCH_PP_OFF_DELAYS);
580 dev_priv->savePP_DIVISOR = I915_READ(PCH_PP_DIVISOR);
581 } else {
582 dev_priv->savePP_ON_DELAYS = I915_READ(PP_ON_DELAYS);
583 dev_priv->savePP_OFF_DELAYS = I915_READ(PP_OFF_DELAYS);
584 dev_priv->savePP_DIVISOR = I915_READ(PP_DIVISOR);
585 }
422 586
423 /* Display Port state */ 587 /* Display Port state */
424 if (SUPPORTS_INTEGRATED_DP(dev)) { 588 if (SUPPORTS_INTEGRATED_DP(dev)) {
@@ -437,16 +601,23 @@ void i915_save_display(struct drm_device *dev)
437 /* FIXME: save TV & SDVO state */ 601 /* FIXME: save TV & SDVO state */
438 602
439 /* FBC state */ 603 /* FBC state */
440 dev_priv->saveFBC_CFB_BASE = I915_READ(FBC_CFB_BASE); 604 if (IS_GM45(dev)) {
441 dev_priv->saveFBC_LL_BASE = I915_READ(FBC_LL_BASE); 605 dev_priv->saveDPFC_CB_BASE = I915_READ(DPFC_CB_BASE);
442 dev_priv->saveFBC_CONTROL2 = I915_READ(FBC_CONTROL2); 606 } else {
443 dev_priv->saveFBC_CONTROL = I915_READ(FBC_CONTROL); 607 dev_priv->saveFBC_CFB_BASE = I915_READ(FBC_CFB_BASE);
608 dev_priv->saveFBC_LL_BASE = I915_READ(FBC_LL_BASE);
609 dev_priv->saveFBC_CONTROL2 = I915_READ(FBC_CONTROL2);
610 dev_priv->saveFBC_CONTROL = I915_READ(FBC_CONTROL);
611 }
444 612
445 /* VGA state */ 613 /* VGA state */
446 dev_priv->saveVGA0 = I915_READ(VGA0); 614 dev_priv->saveVGA0 = I915_READ(VGA0);
447 dev_priv->saveVGA1 = I915_READ(VGA1); 615 dev_priv->saveVGA1 = I915_READ(VGA1);
448 dev_priv->saveVGA_PD = I915_READ(VGA_PD); 616 dev_priv->saveVGA_PD = I915_READ(VGA_PD);
449 dev_priv->saveVGACNTRL = I915_READ(VGACNTRL); 617 if (IS_IGDNG(dev))
618 dev_priv->saveVGACNTRL = I915_READ(CPU_VGACNTRL);
619 else
620 dev_priv->saveVGACNTRL = I915_READ(VGACNTRL);
450 621
451 i915_save_vga(dev); 622 i915_save_vga(dev);
452} 623}
@@ -485,22 +656,41 @@ void i915_restore_display(struct drm_device *dev)
485 I915_WRITE(CURSIZE, dev_priv->saveCURSIZE); 656 I915_WRITE(CURSIZE, dev_priv->saveCURSIZE);
486 657
487 /* CRT state */ 658 /* CRT state */
488 I915_WRITE(ADPA, dev_priv->saveADPA); 659 if (IS_IGDNG(dev))
660 I915_WRITE(PCH_ADPA, dev_priv->saveADPA);
661 else
662 I915_WRITE(ADPA, dev_priv->saveADPA);
489 663
490 /* LVDS state */ 664 /* LVDS state */
491 if (IS_I965G(dev)) 665 if (IS_I965G(dev) && !IS_IGDNG(dev))
492 I915_WRITE(BLC_PWM_CTL2, dev_priv->saveBLC_PWM_CTL2); 666 I915_WRITE(BLC_PWM_CTL2, dev_priv->saveBLC_PWM_CTL2);
493 if (IS_MOBILE(dev) && !IS_I830(dev)) 667
668 if (IS_IGDNG(dev)) {
669 I915_WRITE(PCH_LVDS, dev_priv->saveLVDS);
670 } else if (IS_MOBILE(dev) && !IS_I830(dev))
494 I915_WRITE(LVDS, dev_priv->saveLVDS); 671 I915_WRITE(LVDS, dev_priv->saveLVDS);
495 if (!IS_I830(dev) && !IS_845G(dev)) 672
673 if (!IS_I830(dev) && !IS_845G(dev) && !IS_IGDNG(dev))
496 I915_WRITE(PFIT_CONTROL, dev_priv->savePFIT_CONTROL); 674 I915_WRITE(PFIT_CONTROL, dev_priv->savePFIT_CONTROL);
497 675
498 I915_WRITE(PFIT_PGM_RATIOS, dev_priv->savePFIT_PGM_RATIOS); 676 if (IS_IGDNG(dev)) {
499 I915_WRITE(BLC_PWM_CTL, dev_priv->saveBLC_PWM_CTL); 677 I915_WRITE(BLC_PWM_PCH_CTL1, dev_priv->saveBLC_PWM_CTL);
500 I915_WRITE(PP_ON_DELAYS, dev_priv->savePP_ON_DELAYS); 678 I915_WRITE(BLC_PWM_PCH_CTL2, dev_priv->saveBLC_PWM_CTL2);
501 I915_WRITE(PP_OFF_DELAYS, dev_priv->savePP_OFF_DELAYS); 679 I915_WRITE(BLC_PWM_CPU_CTL, dev_priv->saveBLC_CPU_PWM_CTL);
502 I915_WRITE(PP_DIVISOR, dev_priv->savePP_DIVISOR); 680 I915_WRITE(BLC_PWM_CPU_CTL2, dev_priv->saveBLC_CPU_PWM_CTL2);
503 I915_WRITE(PP_CONTROL, dev_priv->savePP_CONTROL); 681 I915_WRITE(PCH_PP_ON_DELAYS, dev_priv->savePP_ON_DELAYS);
682 I915_WRITE(PCH_PP_OFF_DELAYS, dev_priv->savePP_OFF_DELAYS);
683 I915_WRITE(PCH_PP_DIVISOR, dev_priv->savePP_DIVISOR);
684 I915_WRITE(PCH_PP_CONTROL, dev_priv->savePP_CONTROL);
685 } else {
686 I915_WRITE(PFIT_PGM_RATIOS, dev_priv->savePFIT_PGM_RATIOS);
687 I915_WRITE(BLC_PWM_CTL, dev_priv->saveBLC_PWM_CTL);
688 I915_WRITE(BLC_HIST_CTL, dev_priv->saveBLC_HIST_CTL);
689 I915_WRITE(PP_ON_DELAYS, dev_priv->savePP_ON_DELAYS);
690 I915_WRITE(PP_OFF_DELAYS, dev_priv->savePP_OFF_DELAYS);
691 I915_WRITE(PP_DIVISOR, dev_priv->savePP_DIVISOR);
692 I915_WRITE(PP_CONTROL, dev_priv->savePP_CONTROL);
693 }
504 694
505 /* Display Port state */ 695 /* Display Port state */
506 if (SUPPORTS_INTEGRATED_DP(dev)) { 696 if (SUPPORTS_INTEGRATED_DP(dev)) {
@@ -511,13 +701,22 @@ void i915_restore_display(struct drm_device *dev)
511 /* FIXME: restore TV & SDVO state */ 701 /* FIXME: restore TV & SDVO state */
512 702
513 /* FBC info */ 703 /* FBC info */
514 I915_WRITE(FBC_CFB_BASE, dev_priv->saveFBC_CFB_BASE); 704 if (IS_GM45(dev)) {
515 I915_WRITE(FBC_LL_BASE, dev_priv->saveFBC_LL_BASE); 705 g4x_disable_fbc(dev);
516 I915_WRITE(FBC_CONTROL2, dev_priv->saveFBC_CONTROL2); 706 I915_WRITE(DPFC_CB_BASE, dev_priv->saveDPFC_CB_BASE);
517 I915_WRITE(FBC_CONTROL, dev_priv->saveFBC_CONTROL); 707 } else {
708 i8xx_disable_fbc(dev);
709 I915_WRITE(FBC_CFB_BASE, dev_priv->saveFBC_CFB_BASE);
710 I915_WRITE(FBC_LL_BASE, dev_priv->saveFBC_LL_BASE);
711 I915_WRITE(FBC_CONTROL2, dev_priv->saveFBC_CONTROL2);
712 I915_WRITE(FBC_CONTROL, dev_priv->saveFBC_CONTROL);
713 }
518 714
519 /* VGA state */ 715 /* VGA state */
520 I915_WRITE(VGACNTRL, dev_priv->saveVGACNTRL); 716 if (IS_IGDNG(dev))
717 I915_WRITE(CPU_VGACNTRL, dev_priv->saveVGACNTRL);
718 else
719 I915_WRITE(VGACNTRL, dev_priv->saveVGACNTRL);
521 I915_WRITE(VGA0, dev_priv->saveVGA0); 720 I915_WRITE(VGA0, dev_priv->saveVGA0);
522 I915_WRITE(VGA1, dev_priv->saveVGA1); 721 I915_WRITE(VGA1, dev_priv->saveVGA1);
523 I915_WRITE(VGA_PD, dev_priv->saveVGA_PD); 722 I915_WRITE(VGA_PD, dev_priv->saveVGA_PD);
@@ -543,8 +742,17 @@ int i915_save_state(struct drm_device *dev)
543 i915_save_display(dev); 742 i915_save_display(dev);
544 743
545 /* Interrupt state */ 744 /* Interrupt state */
546 dev_priv->saveIER = I915_READ(IER); 745 if (IS_IGDNG(dev)) {
547 dev_priv->saveIMR = I915_READ(IMR); 746 dev_priv->saveDEIER = I915_READ(DEIER);
747 dev_priv->saveDEIMR = I915_READ(DEIMR);
748 dev_priv->saveGTIER = I915_READ(GTIER);
749 dev_priv->saveGTIMR = I915_READ(GTIMR);
750 dev_priv->saveFDI_RXA_IMR = I915_READ(FDI_RXA_IMR);
751 dev_priv->saveFDI_RXB_IMR = I915_READ(FDI_RXB_IMR);
752 } else {
753 dev_priv->saveIER = I915_READ(IER);
754 dev_priv->saveIMR = I915_READ(IMR);
755 }
548 756
549 /* Clock gating state */ 757 /* Clock gating state */
550 dev_priv->saveD_STATE = I915_READ(D_STATE); 758 dev_priv->saveD_STATE = I915_READ(D_STATE);
@@ -609,8 +817,17 @@ int i915_restore_state(struct drm_device *dev)
609 i915_restore_display(dev); 817 i915_restore_display(dev);
610 818
611 /* Interrupt state */ 819 /* Interrupt state */
612 I915_WRITE (IER, dev_priv->saveIER); 820 if (IS_IGDNG(dev)) {
613 I915_WRITE (IMR, dev_priv->saveIMR); 821 I915_WRITE(DEIER, dev_priv->saveDEIER);
822 I915_WRITE(DEIMR, dev_priv->saveDEIMR);
823 I915_WRITE(GTIER, dev_priv->saveGTIER);
824 I915_WRITE(GTIMR, dev_priv->saveGTIMR);
825 I915_WRITE(FDI_RXA_IMR, dev_priv->saveFDI_RXA_IMR);
826 I915_WRITE(FDI_RXB_IMR, dev_priv->saveFDI_RXB_IMR);
827 } else {
828 I915_WRITE (IER, dev_priv->saveIER);
829 I915_WRITE (IMR, dev_priv->saveIMR);
830 }
614 831
615 /* Clock gating state */ 832 /* Clock gating state */
616 I915_WRITE (D_STATE, dev_priv->saveD_STATE); 833 I915_WRITE (D_STATE, dev_priv->saveD_STATE);
diff --git a/drivers/gpu/drm/i915/intel_bios.c b/drivers/gpu/drm/i915/intel_bios.c
index 4337414846b6..96cd256e60e6 100644
--- a/drivers/gpu/drm/i915/intel_bios.c
+++ b/drivers/gpu/drm/i915/intel_bios.c
@@ -351,20 +351,18 @@ parse_driver_features(struct drm_i915_private *dev_priv,
351 struct drm_device *dev = dev_priv->dev; 351 struct drm_device *dev = dev_priv->dev;
352 struct bdb_driver_features *driver; 352 struct bdb_driver_features *driver;
353 353
354 /* set default for chips without eDP */
355 if (!SUPPORTS_EDP(dev)) {
356 dev_priv->edp_support = 0;
357 return;
358 }
359
360 driver = find_section(bdb, BDB_DRIVER_FEATURES); 354 driver = find_section(bdb, BDB_DRIVER_FEATURES);
361 if (!driver) 355 if (!driver)
362 return; 356 return;
363 357
364 if (driver->lvds_config == BDB_DRIVER_FEATURE_EDP) 358 if (driver && SUPPORTS_EDP(dev) &&
359 driver->lvds_config == BDB_DRIVER_FEATURE_EDP) {
365 dev_priv->edp_support = 1; 360 dev_priv->edp_support = 1;
361 } else {
362 dev_priv->edp_support = 0;
363 }
366 364
367 if (driver->dual_frequency) 365 if (driver && driver->dual_frequency)
368 dev_priv->render_reclock_avail = true; 366 dev_priv->render_reclock_avail = true;
369} 367}
370 368
diff --git a/drivers/gpu/drm/i915/intel_crt.c b/drivers/gpu/drm/i915/intel_crt.c
index 212e22740fc1..e5051446c48e 100644
--- a/drivers/gpu/drm/i915/intel_crt.c
+++ b/drivers/gpu/drm/i915/intel_crt.c
@@ -262,8 +262,8 @@ static bool intel_crt_detect_hotplug(struct drm_connector *connector)
262 } while (time_after(timeout, jiffies)); 262 } while (time_after(timeout, jiffies));
263 } 263 }
264 264
265 if ((I915_READ(PORT_HOTPLUG_STAT) & CRT_HOTPLUG_MONITOR_MASK) == 265 if ((I915_READ(PORT_HOTPLUG_STAT) & CRT_HOTPLUG_MONITOR_MASK) !=
266 CRT_HOTPLUG_MONITOR_COLOR) 266 CRT_HOTPLUG_MONITOR_NONE)
267 return true; 267 return true;
268 268
269 return false; 269 return false;
diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index 3c14240cc002..099f420de57a 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -863,10 +863,8 @@ intel_igdng_find_best_PLL(const intel_limit_t *limit, struct drm_crtc *crtc,
863 struct drm_device *dev = crtc->dev; 863 struct drm_device *dev = crtc->dev;
864 struct drm_i915_private *dev_priv = dev->dev_private; 864 struct drm_i915_private *dev_priv = dev->dev_private;
865 intel_clock_t clock; 865 intel_clock_t clock;
866 int max_n;
867 bool found;
868 int err_most = 47; 866 int err_most = 47;
869 found = false; 867 int err_min = 10000;
870 868
871 /* eDP has only 2 clock choice, no n/m/p setting */ 869 /* eDP has only 2 clock choice, no n/m/p setting */
872 if (HAS_eDP) 870 if (HAS_eDP)
@@ -890,10 +888,9 @@ intel_igdng_find_best_PLL(const intel_limit_t *limit, struct drm_crtc *crtc,
890 } 888 }
891 889
892 memset(best_clock, 0, sizeof(*best_clock)); 890 memset(best_clock, 0, sizeof(*best_clock));
893 max_n = limit->n.max;
894 for (clock.p1 = limit->p1.max; clock.p1 >= limit->p1.min; clock.p1--) { 891 for (clock.p1 = limit->p1.max; clock.p1 >= limit->p1.min; clock.p1--) {
895 /* based on hardware requriment prefer smaller n to precision */ 892 /* based on hardware requriment prefer smaller n to precision */
896 for (clock.n = limit->n.min; clock.n <= max_n; clock.n++) { 893 for (clock.n = limit->n.min; clock.n <= limit->n.max; clock.n++) {
897 /* based on hardware requirment prefere larger m1,m2 */ 894 /* based on hardware requirment prefere larger m1,m2 */
898 for (clock.m1 = limit->m1.max; 895 for (clock.m1 = limit->m1.max;
899 clock.m1 >= limit->m1.min; clock.m1--) { 896 clock.m1 >= limit->m1.min; clock.m1--) {
@@ -907,18 +904,18 @@ intel_igdng_find_best_PLL(const intel_limit_t *limit, struct drm_crtc *crtc,
907 this_err = abs((10000 - (target*10000/clock.dot))); 904 this_err = abs((10000 - (target*10000/clock.dot)));
908 if (this_err < err_most) { 905 if (this_err < err_most) {
909 *best_clock = clock; 906 *best_clock = clock;
910 err_most = this_err;
911 max_n = clock.n;
912 found = true;
913 /* found on first matching */ 907 /* found on first matching */
914 goto out; 908 goto out;
909 } else if (this_err < err_min) {
910 *best_clock = clock;
911 err_min = this_err;
915 } 912 }
916 } 913 }
917 } 914 }
918 } 915 }
919 } 916 }
920out: 917out:
921 return found; 918 return true;
922} 919}
923 920
924/* DisplayPort has only two frequencies, 162MHz and 270MHz */ 921/* DisplayPort has only two frequencies, 162MHz and 270MHz */
@@ -943,6 +940,7 @@ intel_find_pll_g4x_dp(const intel_limit_t *limit, struct drm_crtc *crtc,
943 clock.m = 5 * (clock.m1 + 2) + (clock.m2 + 2); 940 clock.m = 5 * (clock.m1 + 2) + (clock.m2 + 2);
944 clock.p = (clock.p1 * clock.p2); 941 clock.p = (clock.p1 * clock.p2);
945 clock.dot = 96000 * clock.m / (clock.n + 2) / clock.p; 942 clock.dot = 96000 * clock.m / (clock.n + 2) / clock.p;
943 clock.vco = 0;
946 memcpy(best_clock, &clock, sizeof(intel_clock_t)); 944 memcpy(best_clock, &clock, sizeof(intel_clock_t));
947 return true; 945 return true;
948} 946}
@@ -1260,9 +1258,11 @@ intel_pipe_set_base(struct drm_crtc *crtc, int x, int y,
1260 return ret; 1258 return ret;
1261 } 1259 }
1262 1260
1263 /* Pre-i965 needs to install a fence for tiled scan-out */ 1261 /* Install a fence for tiled scan-out. Pre-i965 always needs a fence,
1264 if (!IS_I965G(dev) && 1262 * whereas 965+ only requires a fence if using framebuffer compression.
1265 obj_priv->fence_reg == I915_FENCE_REG_NONE && 1263 * For simplicity, we always install a fence as the cost is not that onerous.
1264 */
1265 if (obj_priv->fence_reg == I915_FENCE_REG_NONE &&
1266 obj_priv->tiling_mode != I915_TILING_NONE) { 1266 obj_priv->tiling_mode != I915_TILING_NONE) {
1267 ret = i915_gem_object_get_fence_reg(obj); 1267 ret = i915_gem_object_get_fence_reg(obj);
1268 if (ret != 0) { 1268 if (ret != 0) {
@@ -1513,7 +1513,7 @@ static void igdng_crtc_dpms(struct drm_crtc *crtc, int mode)
1513 /* Enable panel fitting for LVDS */ 1513 /* Enable panel fitting for LVDS */
1514 if (intel_pipe_has_type(crtc, INTEL_OUTPUT_LVDS)) { 1514 if (intel_pipe_has_type(crtc, INTEL_OUTPUT_LVDS)) {
1515 temp = I915_READ(pf_ctl_reg); 1515 temp = I915_READ(pf_ctl_reg);
1516 I915_WRITE(pf_ctl_reg, temp | PF_ENABLE); 1516 I915_WRITE(pf_ctl_reg, temp | PF_ENABLE | PF_FILTER_MED_3x3);
1517 1517
1518 /* currently full aspect */ 1518 /* currently full aspect */
1519 I915_WRITE(pf_win_pos, 0); 1519 I915_WRITE(pf_win_pos, 0);
@@ -1801,6 +1801,8 @@ static void i9xx_crtc_dpms(struct drm_crtc *crtc, int mode)
1801 case DRM_MODE_DPMS_ON: 1801 case DRM_MODE_DPMS_ON:
1802 case DRM_MODE_DPMS_STANDBY: 1802 case DRM_MODE_DPMS_STANDBY:
1803 case DRM_MODE_DPMS_SUSPEND: 1803 case DRM_MODE_DPMS_SUSPEND:
1804 intel_update_watermarks(dev);
1805
1804 /* Enable the DPLL */ 1806 /* Enable the DPLL */
1805 temp = I915_READ(dpll_reg); 1807 temp = I915_READ(dpll_reg);
1806 if ((temp & DPLL_VCO_ENABLE) == 0) { 1808 if ((temp & DPLL_VCO_ENABLE) == 0) {
@@ -1838,7 +1840,6 @@ static void i9xx_crtc_dpms(struct drm_crtc *crtc, int mode)
1838 1840
1839 /* Give the overlay scaler a chance to enable if it's on this pipe */ 1841 /* Give the overlay scaler a chance to enable if it's on this pipe */
1840 //intel_crtc_dpms_video(crtc, true); TODO 1842 //intel_crtc_dpms_video(crtc, true); TODO
1841 intel_update_watermarks(dev);
1842 break; 1843 break;
1843 case DRM_MODE_DPMS_OFF: 1844 case DRM_MODE_DPMS_OFF:
1844 intel_update_watermarks(dev); 1845 intel_update_watermarks(dev);
@@ -2082,7 +2083,7 @@ fdi_reduce_ratio(u32 *num, u32 *den)
2082#define LINK_N 0x80000 2083#define LINK_N 0x80000
2083 2084
2084static void 2085static void
2085igdng_compute_m_n(int bytes_per_pixel, int nlanes, 2086igdng_compute_m_n(int bits_per_pixel, int nlanes,
2086 int pixel_clock, int link_clock, 2087 int pixel_clock, int link_clock,
2087 struct fdi_m_n *m_n) 2088 struct fdi_m_n *m_n)
2088{ 2089{
@@ -2092,7 +2093,8 @@ igdng_compute_m_n(int bytes_per_pixel, int nlanes,
2092 2093
2093 temp = (u64) DATA_N * pixel_clock; 2094 temp = (u64) DATA_N * pixel_clock;
2094 temp = div_u64(temp, link_clock); 2095 temp = div_u64(temp, link_clock);
2095 m_n->gmch_m = div_u64(temp * bytes_per_pixel, nlanes); 2096 m_n->gmch_m = div_u64(temp * bits_per_pixel, nlanes);
2097 m_n->gmch_m >>= 3; /* convert to bytes_per_pixel */
2096 m_n->gmch_n = DATA_N; 2098 m_n->gmch_n = DATA_N;
2097 fdi_reduce_ratio(&m_n->gmch_m, &m_n->gmch_n); 2099 fdi_reduce_ratio(&m_n->gmch_m, &m_n->gmch_n);
2098 2100
@@ -2140,6 +2142,13 @@ static struct intel_watermark_params igd_cursor_hplloff_wm = {
2140 IGD_CURSOR_GUARD_WM, 2142 IGD_CURSOR_GUARD_WM,
2141 IGD_FIFO_LINE_SIZE 2143 IGD_FIFO_LINE_SIZE
2142}; 2144};
2145static struct intel_watermark_params g4x_wm_info = {
2146 G4X_FIFO_SIZE,
2147 G4X_MAX_WM,
2148 G4X_MAX_WM,
2149 2,
2150 G4X_FIFO_LINE_SIZE,
2151};
2143static struct intel_watermark_params i945_wm_info = { 2152static struct intel_watermark_params i945_wm_info = {
2144 I945_FIFO_SIZE, 2153 I945_FIFO_SIZE,
2145 I915_MAX_WM, 2154 I915_MAX_WM,
@@ -2430,17 +2439,74 @@ static int i830_get_fifo_size(struct drm_device *dev, int plane)
2430 return size; 2439 return size;
2431} 2440}
2432 2441
2433static void g4x_update_wm(struct drm_device *dev, int unused, int unused2, 2442static void g4x_update_wm(struct drm_device *dev, int planea_clock,
2434 int unused3, int unused4) 2443 int planeb_clock, int sr_hdisplay, int pixel_size)
2435{ 2444{
2436 struct drm_i915_private *dev_priv = dev->dev_private; 2445 struct drm_i915_private *dev_priv = dev->dev_private;
2437 u32 fw_blc_self = I915_READ(FW_BLC_SELF); 2446 int total_size, cacheline_size;
2447 int planea_wm, planeb_wm, cursora_wm, cursorb_wm, cursor_sr;
2448 struct intel_watermark_params planea_params, planeb_params;
2449 unsigned long line_time_us;
2450 int sr_clock, sr_entries = 0, entries_required;
2438 2451
2439 if (i915_powersave) 2452 /* Create copies of the base settings for each pipe */
2440 fw_blc_self |= FW_BLC_SELF_EN; 2453 planea_params = planeb_params = g4x_wm_info;
2441 else 2454
2442 fw_blc_self &= ~FW_BLC_SELF_EN; 2455 /* Grab a couple of global values before we overwrite them */
2443 I915_WRITE(FW_BLC_SELF, fw_blc_self); 2456 total_size = planea_params.fifo_size;
2457 cacheline_size = planea_params.cacheline_size;
2458
2459 /*
2460 * Note: we need to make sure we don't overflow for various clock &
2461 * latency values.
2462 * clocks go from a few thousand to several hundred thousand.
2463 * latency is usually a few thousand
2464 */
2465 entries_required = ((planea_clock / 1000) * pixel_size * latency_ns) /
2466 1000;
2467 entries_required /= G4X_FIFO_LINE_SIZE;
2468 planea_wm = entries_required + planea_params.guard_size;
2469
2470 entries_required = ((planeb_clock / 1000) * pixel_size * latency_ns) /
2471 1000;
2472 entries_required /= G4X_FIFO_LINE_SIZE;
2473 planeb_wm = entries_required + planeb_params.guard_size;
2474
2475 cursora_wm = cursorb_wm = 16;
2476 cursor_sr = 32;
2477
2478 DRM_DEBUG("FIFO watermarks - A: %d, B: %d\n", planea_wm, planeb_wm);
2479
2480 /* Calc sr entries for one plane configs */
2481 if (sr_hdisplay && (!planea_clock || !planeb_clock)) {
2482 /* self-refresh has much higher latency */
2483 const static int sr_latency_ns = 12000;
2484
2485 sr_clock = planea_clock ? planea_clock : planeb_clock;
2486 line_time_us = ((sr_hdisplay * 1000) / sr_clock);
2487
2488 /* Use ns/us then divide to preserve precision */
2489 sr_entries = (((sr_latency_ns / line_time_us) + 1) *
2490 pixel_size * sr_hdisplay) / 1000;
2491 sr_entries = roundup(sr_entries / cacheline_size, 1);
2492 DRM_DEBUG("self-refresh entries: %d\n", sr_entries);
2493 I915_WRITE(FW_BLC_SELF, FW_BLC_SELF_EN);
2494 }
2495
2496 DRM_DEBUG("Setting FIFO watermarks - A: %d, B: %d, SR %d\n",
2497 planea_wm, planeb_wm, sr_entries);
2498
2499 planea_wm &= 0x3f;
2500 planeb_wm &= 0x3f;
2501
2502 I915_WRITE(DSPFW1, (sr_entries << DSPFW_SR_SHIFT) |
2503 (cursorb_wm << DSPFW_CURSORB_SHIFT) |
2504 (planeb_wm << DSPFW_PLANEB_SHIFT) | planea_wm);
2505 I915_WRITE(DSPFW2, (I915_READ(DSPFW2) & DSPFW_CURSORA_MASK) |
2506 (cursora_wm << DSPFW_CURSORA_SHIFT));
2507 /* HPLL off in SR has some issues on G4x... disable it */
2508 I915_WRITE(DSPFW3, (I915_READ(DSPFW3) & ~DSPFW_HPLL_SR_EN) |
2509 (cursor_sr << DSPFW_CURSOR_SR_SHIFT));
2444} 2510}
2445 2511
2446static void i965_update_wm(struct drm_device *dev, int unused, int unused2, 2512static void i965_update_wm(struct drm_device *dev, int unused, int unused2,
@@ -2586,6 +2652,9 @@ static void intel_update_watermarks(struct drm_device *dev)
2586 unsigned long planea_clock = 0, planeb_clock = 0, sr_clock = 0; 2652 unsigned long planea_clock = 0, planeb_clock = 0, sr_clock = 0;
2587 int enabled = 0, pixel_size = 0; 2653 int enabled = 0, pixel_size = 0;
2588 2654
2655 if (!dev_priv->display.update_wm)
2656 return;
2657
2589 /* Get the clock config from both planes */ 2658 /* Get the clock config from both planes */
2590 list_for_each_entry(crtc, &dev->mode_config.crtc_list, head) { 2659 list_for_each_entry(crtc, &dev->mode_config.crtc_list, head) {
2591 intel_crtc = to_intel_crtc(crtc); 2660 intel_crtc = to_intel_crtc(crtc);
@@ -2763,7 +2832,7 @@ static int intel_crtc_mode_set(struct drm_crtc *crtc,
2763 2832
2764 /* FDI link */ 2833 /* FDI link */
2765 if (IS_IGDNG(dev)) { 2834 if (IS_IGDNG(dev)) {
2766 int lane, link_bw; 2835 int lane, link_bw, bpp;
2767 /* eDP doesn't require FDI link, so just set DP M/N 2836 /* eDP doesn't require FDI link, so just set DP M/N
2768 according to current link config */ 2837 according to current link config */
2769 if (is_edp) { 2838 if (is_edp) {
@@ -2782,10 +2851,72 @@ static int intel_crtc_mode_set(struct drm_crtc *crtc,
2782 lane = 4; 2851 lane = 4;
2783 link_bw = 270000; 2852 link_bw = 270000;
2784 } 2853 }
2785 igdng_compute_m_n(3, lane, target_clock, 2854
2855 /* determine panel color depth */
2856 temp = I915_READ(pipeconf_reg);
2857
2858 switch (temp & PIPE_BPC_MASK) {
2859 case PIPE_8BPC:
2860 bpp = 24;
2861 break;
2862 case PIPE_10BPC:
2863 bpp = 30;
2864 break;
2865 case PIPE_6BPC:
2866 bpp = 18;
2867 break;
2868 case PIPE_12BPC:
2869 bpp = 36;
2870 break;
2871 default:
2872 DRM_ERROR("unknown pipe bpc value\n");
2873 bpp = 24;
2874 }
2875
2876 igdng_compute_m_n(bpp, lane, target_clock,
2786 link_bw, &m_n); 2877 link_bw, &m_n);
2787 } 2878 }
2788 2879
2880 /* Ironlake: try to setup display ref clock before DPLL
2881 * enabling. This is only under driver's control after
2882 * PCH B stepping, previous chipset stepping should be
2883 * ignoring this setting.
2884 */
2885 if (IS_IGDNG(dev)) {
2886 temp = I915_READ(PCH_DREF_CONTROL);
2887 /* Always enable nonspread source */
2888 temp &= ~DREF_NONSPREAD_SOURCE_MASK;
2889 temp |= DREF_NONSPREAD_SOURCE_ENABLE;
2890 I915_WRITE(PCH_DREF_CONTROL, temp);
2891 POSTING_READ(PCH_DREF_CONTROL);
2892
2893 temp &= ~DREF_SSC_SOURCE_MASK;
2894 temp |= DREF_SSC_SOURCE_ENABLE;
2895 I915_WRITE(PCH_DREF_CONTROL, temp);
2896 POSTING_READ(PCH_DREF_CONTROL);
2897
2898 udelay(200);
2899
2900 if (is_edp) {
2901 if (dev_priv->lvds_use_ssc) {
2902 temp |= DREF_SSC1_ENABLE;
2903 I915_WRITE(PCH_DREF_CONTROL, temp);
2904 POSTING_READ(PCH_DREF_CONTROL);
2905
2906 udelay(200);
2907
2908 temp &= ~DREF_CPU_SOURCE_OUTPUT_MASK;
2909 temp |= DREF_CPU_SOURCE_OUTPUT_DOWNSPREAD;
2910 I915_WRITE(PCH_DREF_CONTROL, temp);
2911 POSTING_READ(PCH_DREF_CONTROL);
2912 } else {
2913 temp |= DREF_CPU_SOURCE_OUTPUT_NONSPREAD;
2914 I915_WRITE(PCH_DREF_CONTROL, temp);
2915 POSTING_READ(PCH_DREF_CONTROL);
2916 }
2917 }
2918 }
2919
2789 if (IS_IGD(dev)) { 2920 if (IS_IGD(dev)) {
2790 fp = (1 << clock.n) << 16 | clock.m1 << 8 | clock.m2; 2921 fp = (1 << clock.n) << 16 | clock.m1 << 8 | clock.m2;
2791 if (has_reduced_clock) 2922 if (has_reduced_clock)
@@ -2936,6 +3067,8 @@ static int intel_crtc_mode_set(struct drm_crtc *crtc,
2936 3067
2937 lvds = I915_READ(lvds_reg); 3068 lvds = I915_READ(lvds_reg);
2938 lvds |= LVDS_PORT_EN | LVDS_A0A2_CLKA_POWER_UP | LVDS_PIPEB_SELECT; 3069 lvds |= LVDS_PORT_EN | LVDS_A0A2_CLKA_POWER_UP | LVDS_PIPEB_SELECT;
3070 /* set the corresponsding LVDS_BORDER bit */
3071 lvds |= dev_priv->lvds_border_bits;
2939 /* Set the B0-B3 data pairs corresponding to whether we're going to 3072 /* Set the B0-B3 data pairs corresponding to whether we're going to
2940 * set the DPLLs for dual-channel mode or not. 3073 * set the DPLLs for dual-channel mode or not.
2941 */ 3074 */
@@ -4124,7 +4257,9 @@ void intel_init_clock_gating(struct drm_device *dev)
4124 * Disable clock gating reported to work incorrectly according to the 4257 * Disable clock gating reported to work incorrectly according to the
4125 * specs, but enable as much else as we can. 4258 * specs, but enable as much else as we can.
4126 */ 4259 */
4127 if (IS_G4X(dev)) { 4260 if (IS_IGDNG(dev)) {
4261 return;
4262 } else if (IS_G4X(dev)) {
4128 uint32_t dspclk_gate; 4263 uint32_t dspclk_gate;
4129 I915_WRITE(RENCLK_GATE_D1, 0); 4264 I915_WRITE(RENCLK_GATE_D1, 0);
4130 I915_WRITE(RENCLK_GATE_D2, VF_UNIT_CLOCK_GATE_DISABLE | 4265 I915_WRITE(RENCLK_GATE_D2, VF_UNIT_CLOCK_GATE_DISABLE |
@@ -4212,7 +4347,9 @@ static void intel_init_display(struct drm_device *dev)
4212 i830_get_display_clock_speed; 4347 i830_get_display_clock_speed;
4213 4348
4214 /* For FIFO watermark updates */ 4349 /* For FIFO watermark updates */
4215 if (IS_G4X(dev)) 4350 if (IS_IGDNG(dev))
4351 dev_priv->display.update_wm = NULL;
4352 else if (IS_G4X(dev))
4216 dev_priv->display.update_wm = g4x_update_wm; 4353 dev_priv->display.update_wm = g4x_update_wm;
4217 else if (IS_I965G(dev)) 4354 else if (IS_I965G(dev))
4218 dev_priv->display.update_wm = i965_update_wm; 4355 dev_priv->display.update_wm = i965_update_wm;
diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c
index f4856a510476..d83447557f9b 100644
--- a/drivers/gpu/drm/i915/intel_dp.c
+++ b/drivers/gpu/drm/i915/intel_dp.c
@@ -400,7 +400,7 @@ intel_dp_i2c_init(struct intel_output *intel_output, const char *name)
400{ 400{
401 struct intel_dp_priv *dp_priv = intel_output->dev_priv; 401 struct intel_dp_priv *dp_priv = intel_output->dev_priv;
402 402
403 DRM_ERROR("i2c_init %s\n", name); 403 DRM_DEBUG_KMS("i2c_init %s\n", name);
404 dp_priv->algo.running = false; 404 dp_priv->algo.running = false;
405 dp_priv->algo.address = 0; 405 dp_priv->algo.address = 0;
406 dp_priv->algo.aux_ch = intel_dp_i2c_aux_ch; 406 dp_priv->algo.aux_ch = intel_dp_i2c_aux_ch;
diff --git a/drivers/gpu/drm/i915/intel_hdmi.c b/drivers/gpu/drm/i915/intel_hdmi.c
index 663ab6de0b58..c33451aec1bd 100644
--- a/drivers/gpu/drm/i915/intel_hdmi.c
+++ b/drivers/gpu/drm/i915/intel_hdmi.c
@@ -77,14 +77,32 @@ static void intel_hdmi_dpms(struct drm_encoder *encoder, int mode)
77 struct intel_hdmi_priv *hdmi_priv = intel_output->dev_priv; 77 struct intel_hdmi_priv *hdmi_priv = intel_output->dev_priv;
78 u32 temp; 78 u32 temp;
79 79
80 if (mode != DRM_MODE_DPMS_ON) { 80 temp = I915_READ(hdmi_priv->sdvox_reg);
81 temp = I915_READ(hdmi_priv->sdvox_reg); 81
82 /* HW workaround, need to toggle enable bit off and on for 12bpc, but
83 * we do this anyway which shows more stable in testing.
84 */
85 if (IS_IGDNG(dev)) {
82 I915_WRITE(hdmi_priv->sdvox_reg, temp & ~SDVO_ENABLE); 86 I915_WRITE(hdmi_priv->sdvox_reg, temp & ~SDVO_ENABLE);
87 POSTING_READ(hdmi_priv->sdvox_reg);
88 }
89
90 if (mode != DRM_MODE_DPMS_ON) {
91 temp &= ~SDVO_ENABLE;
83 } else { 92 } else {
84 temp = I915_READ(hdmi_priv->sdvox_reg); 93 temp |= SDVO_ENABLE;
85 I915_WRITE(hdmi_priv->sdvox_reg, temp | SDVO_ENABLE);
86 } 94 }
95
96 I915_WRITE(hdmi_priv->sdvox_reg, temp);
87 POSTING_READ(hdmi_priv->sdvox_reg); 97 POSTING_READ(hdmi_priv->sdvox_reg);
98
99 /* HW workaround, need to write this twice for issue that may result
100 * in first write getting masked.
101 */
102 if (IS_IGDNG(dev)) {
103 I915_WRITE(hdmi_priv->sdvox_reg, temp);
104 POSTING_READ(hdmi_priv->sdvox_reg);
105 }
88} 106}
89 107
90static void intel_hdmi_save(struct drm_connector *connector) 108static void intel_hdmi_save(struct drm_connector *connector)
diff --git a/drivers/gpu/drm/i915/intel_lvds.c b/drivers/gpu/drm/i915/intel_lvds.c
index 808bbe412ba8..05598ae10c4b 100644
--- a/drivers/gpu/drm/i915/intel_lvds.c
+++ b/drivers/gpu/drm/i915/intel_lvds.c
@@ -380,7 +380,7 @@ static bool intel_lvds_mode_fixup(struct drm_encoder *encoder,
380 adjusted_mode->crtc_vblank_start + vsync_pos; 380 adjusted_mode->crtc_vblank_start + vsync_pos;
381 /* keep the vsync width constant */ 381 /* keep the vsync width constant */
382 adjusted_mode->crtc_vsync_end = 382 adjusted_mode->crtc_vsync_end =
383 adjusted_mode->crtc_vblank_start + vsync_width; 383 adjusted_mode->crtc_vsync_start + vsync_width;
384 border = 1; 384 border = 1;
385 break; 385 break;
386 case DRM_MODE_SCALE_ASPECT: 386 case DRM_MODE_SCALE_ASPECT:
@@ -526,6 +526,14 @@ out:
526 lvds_priv->pfit_control = pfit_control; 526 lvds_priv->pfit_control = pfit_control;
527 lvds_priv->pfit_pgm_ratios = pfit_pgm_ratios; 527 lvds_priv->pfit_pgm_ratios = pfit_pgm_ratios;
528 /* 528 /*
529 * When there exists the border, it means that the LVDS_BORDR
530 * should be enabled.
531 */
532 if (border)
533 dev_priv->lvds_border_bits |= LVDS_BORDER_ENABLE;
534 else
535 dev_priv->lvds_border_bits &= ~(LVDS_BORDER_ENABLE);
536 /*
529 * XXX: It would be nice to support lower refresh rates on the 537 * XXX: It would be nice to support lower refresh rates on the
530 * panels to reduce power consumption, and perhaps match the 538 * panels to reduce power consumption, and perhaps match the
531 * user's requested refresh rate. 539 * user's requested refresh rate.
diff --git a/drivers/gpu/drm/radeon/Makefile b/drivers/gpu/drm/radeon/Makefile
index 09a28923f46e..b5713eedd6e1 100644
--- a/drivers/gpu/drm/radeon/Makefile
+++ b/drivers/gpu/drm/radeon/Makefile
@@ -49,7 +49,7 @@ radeon-y += radeon_device.o radeon_kms.o \
49 radeon_cs.o radeon_bios.o radeon_benchmark.o r100.o r300.o r420.o \ 49 radeon_cs.o radeon_bios.o radeon_benchmark.o r100.o r300.o r420.o \
50 rs400.o rs600.o rs690.o rv515.o r520.o r600.o rv770.o radeon_test.o \ 50 rs400.o rs600.o rs690.o rv515.o r520.o r600.o rv770.o radeon_test.o \
51 r200.o radeon_legacy_tv.o r600_cs.o r600_blit.o r600_blit_shaders.o \ 51 r200.o radeon_legacy_tv.o r600_cs.o r600_blit.o r600_blit_shaders.o \
52 r600_blit_kms.o 52 r600_blit_kms.o radeon_pm.o
53 53
54radeon-$(CONFIG_COMPAT) += radeon_ioc32.o 54radeon-$(CONFIG_COMPAT) += radeon_ioc32.o
55 55
diff --git a/drivers/gpu/drm/radeon/atom.c b/drivers/gpu/drm/radeon/atom.c
index 901befe03da2..d67c42555ab9 100644
--- a/drivers/gpu/drm/radeon/atom.c
+++ b/drivers/gpu/drm/radeon/atom.c
@@ -107,6 +107,7 @@ static uint32_t atom_iio_execute(struct atom_context *ctx, int base,
107 base += 3; 107 base += 3;
108 break; 108 break;
109 case ATOM_IIO_WRITE: 109 case ATOM_IIO_WRITE:
110 (void)ctx->card->reg_read(ctx->card, CU16(base + 1));
110 ctx->card->reg_write(ctx->card, CU16(base + 1), temp); 111 ctx->card->reg_write(ctx->card, CU16(base + 1), temp);
111 base += 3; 112 base += 3;
112 break; 113 break;
diff --git a/drivers/gpu/drm/radeon/atombios.h b/drivers/gpu/drm/radeon/atombios.h
index 5d402086bc47..c11ddddfb3b6 100644
--- a/drivers/gpu/drm/radeon/atombios.h
+++ b/drivers/gpu/drm/radeon/atombios.h
@@ -2314,7 +2314,7 @@ typedef struct _ATOM_SPREAD_SPECTRUM_ASSIGNMENT {
2314 UCHAR ucSS_Step; 2314 UCHAR ucSS_Step;
2315 UCHAR ucSS_Delay; 2315 UCHAR ucSS_Delay;
2316 UCHAR ucSS_Id; 2316 UCHAR ucSS_Id;
2317 UCHAR ucRecommandedRef_Div; 2317 UCHAR ucRecommendedRef_Div;
2318 UCHAR ucSS_Range; /* it was reserved for V11 */ 2318 UCHAR ucSS_Range; /* it was reserved for V11 */
2319} ATOM_SPREAD_SPECTRUM_ASSIGNMENT; 2319} ATOM_SPREAD_SPECTRUM_ASSIGNMENT;
2320 2320
diff --git a/drivers/gpu/drm/radeon/atombios_crtc.c b/drivers/gpu/drm/radeon/atombios_crtc.c
index 14fa9701aeb3..c15287a590ff 100644
--- a/drivers/gpu/drm/radeon/atombios_crtc.c
+++ b/drivers/gpu/drm/radeon/atombios_crtc.c
@@ -31,10 +31,6 @@
31#include "atom.h" 31#include "atom.h"
32#include "atom-bits.h" 32#include "atom-bits.h"
33 33
34/* evil but including atombios.h is much worse */
35bool radeon_atom_get_tv_timings(struct radeon_device *rdev, int index,
36 SET_CRTC_TIMING_PARAMETERS_PS_ALLOCATION *crtc_timing,
37 int32_t *pixel_clock);
38static void atombios_overscan_setup(struct drm_crtc *crtc, 34static void atombios_overscan_setup(struct drm_crtc *crtc,
39 struct drm_display_mode *mode, 35 struct drm_display_mode *mode,
40 struct drm_display_mode *adjusted_mode) 36 struct drm_display_mode *adjusted_mode)
@@ -248,18 +244,18 @@ void atombios_crtc_dpms(struct drm_crtc *crtc, int mode)
248 244
249 switch (mode) { 245 switch (mode) {
250 case DRM_MODE_DPMS_ON: 246 case DRM_MODE_DPMS_ON:
247 atombios_enable_crtc(crtc, 1);
251 if (ASIC_IS_DCE3(rdev)) 248 if (ASIC_IS_DCE3(rdev))
252 atombios_enable_crtc_memreq(crtc, 1); 249 atombios_enable_crtc_memreq(crtc, 1);
253 atombios_enable_crtc(crtc, 1);
254 atombios_blank_crtc(crtc, 0); 250 atombios_blank_crtc(crtc, 0);
255 break; 251 break;
256 case DRM_MODE_DPMS_STANDBY: 252 case DRM_MODE_DPMS_STANDBY:
257 case DRM_MODE_DPMS_SUSPEND: 253 case DRM_MODE_DPMS_SUSPEND:
258 case DRM_MODE_DPMS_OFF: 254 case DRM_MODE_DPMS_OFF:
259 atombios_blank_crtc(crtc, 1); 255 atombios_blank_crtc(crtc, 1);
260 atombios_enable_crtc(crtc, 0);
261 if (ASIC_IS_DCE3(rdev)) 256 if (ASIC_IS_DCE3(rdev))
262 atombios_enable_crtc_memreq(crtc, 0); 257 atombios_enable_crtc_memreq(crtc, 0);
258 atombios_enable_crtc(crtc, 0);
263 break; 259 break;
264 } 260 }
265 261
@@ -270,59 +266,147 @@ void atombios_crtc_dpms(struct drm_crtc *crtc, int mode)
270 266
271static void 267static void
272atombios_set_crtc_dtd_timing(struct drm_crtc *crtc, 268atombios_set_crtc_dtd_timing(struct drm_crtc *crtc,
273 SET_CRTC_USING_DTD_TIMING_PARAMETERS * crtc_param) 269 struct drm_display_mode *mode)
274{ 270{
271 struct radeon_crtc *radeon_crtc = to_radeon_crtc(crtc);
275 struct drm_device *dev = crtc->dev; 272 struct drm_device *dev = crtc->dev;
276 struct radeon_device *rdev = dev->dev_private; 273 struct radeon_device *rdev = dev->dev_private;
277 SET_CRTC_USING_DTD_TIMING_PARAMETERS conv_param; 274 SET_CRTC_USING_DTD_TIMING_PARAMETERS args;
278 int index = GetIndexIntoMasterTable(COMMAND, SetCRTC_UsingDTDTiming); 275 int index = GetIndexIntoMasterTable(COMMAND, SetCRTC_UsingDTDTiming);
276 u16 misc = 0;
279 277
280 conv_param.usH_Size = cpu_to_le16(crtc_param->usH_Size); 278 memset(&args, 0, sizeof(args));
281 conv_param.usH_Blanking_Time = 279 args.usH_Size = cpu_to_le16(mode->crtc_hdisplay);
282 cpu_to_le16(crtc_param->usH_Blanking_Time); 280 args.usH_Blanking_Time =
283 conv_param.usV_Size = cpu_to_le16(crtc_param->usV_Size); 281 cpu_to_le16(mode->crtc_hblank_end - mode->crtc_hdisplay);
284 conv_param.usV_Blanking_Time = 282 args.usV_Size = cpu_to_le16(mode->crtc_vdisplay);
285 cpu_to_le16(crtc_param->usV_Blanking_Time); 283 args.usV_Blanking_Time =
286 conv_param.usH_SyncOffset = cpu_to_le16(crtc_param->usH_SyncOffset); 284 cpu_to_le16(mode->crtc_vblank_end - mode->crtc_vdisplay);
287 conv_param.usH_SyncWidth = cpu_to_le16(crtc_param->usH_SyncWidth); 285 args.usH_SyncOffset =
288 conv_param.usV_SyncOffset = cpu_to_le16(crtc_param->usV_SyncOffset); 286 cpu_to_le16(mode->crtc_hsync_start - mode->crtc_hdisplay);
289 conv_param.usV_SyncWidth = cpu_to_le16(crtc_param->usV_SyncWidth); 287 args.usH_SyncWidth =
290 conv_param.susModeMiscInfo.usAccess = 288 cpu_to_le16(mode->crtc_hsync_end - mode->crtc_hsync_start);
291 cpu_to_le16(crtc_param->susModeMiscInfo.usAccess); 289 args.usV_SyncOffset =
292 conv_param.ucCRTC = crtc_param->ucCRTC; 290 cpu_to_le16(mode->crtc_vsync_start - mode->crtc_vdisplay);
291 args.usV_SyncWidth =
292 cpu_to_le16(mode->crtc_vsync_end - mode->crtc_vsync_start);
293 /*args.ucH_Border = mode->hborder;*/
294 /*args.ucV_Border = mode->vborder;*/
295
296 if (mode->flags & DRM_MODE_FLAG_NVSYNC)
297 misc |= ATOM_VSYNC_POLARITY;
298 if (mode->flags & DRM_MODE_FLAG_NHSYNC)
299 misc |= ATOM_HSYNC_POLARITY;
300 if (mode->flags & DRM_MODE_FLAG_CSYNC)
301 misc |= ATOM_COMPOSITESYNC;
302 if (mode->flags & DRM_MODE_FLAG_INTERLACE)
303 misc |= ATOM_INTERLACE;
304 if (mode->flags & DRM_MODE_FLAG_DBLSCAN)
305 misc |= ATOM_DOUBLE_CLOCK_MODE;
306
307 args.susModeMiscInfo.usAccess = cpu_to_le16(misc);
308 args.ucCRTC = radeon_crtc->crtc_id;
293 309
294 printk("executing set crtc dtd timing\n"); 310 printk("executing set crtc dtd timing\n");
295 atom_execute_table(rdev->mode_info.atom_context, index, (uint32_t *)&conv_param); 311 atom_execute_table(rdev->mode_info.atom_context, index, (uint32_t *)&args);
296} 312}
297 313
298void atombios_crtc_set_timing(struct drm_crtc *crtc, 314static void atombios_crtc_set_timing(struct drm_crtc *crtc,
299 SET_CRTC_TIMING_PARAMETERS_PS_ALLOCATION * 315 struct drm_display_mode *mode)
300 crtc_param)
301{ 316{
317 struct radeon_crtc *radeon_crtc = to_radeon_crtc(crtc);
302 struct drm_device *dev = crtc->dev; 318 struct drm_device *dev = crtc->dev;
303 struct radeon_device *rdev = dev->dev_private; 319 struct radeon_device *rdev = dev->dev_private;
304 SET_CRTC_TIMING_PARAMETERS_PS_ALLOCATION conv_param; 320 SET_CRTC_TIMING_PARAMETERS_PS_ALLOCATION args;
305 int index = GetIndexIntoMasterTable(COMMAND, SetCRTC_Timing); 321 int index = GetIndexIntoMasterTable(COMMAND, SetCRTC_Timing);
322 u16 misc = 0;
306 323
307 conv_param.usH_Total = cpu_to_le16(crtc_param->usH_Total); 324 memset(&args, 0, sizeof(args));
308 conv_param.usH_Disp = cpu_to_le16(crtc_param->usH_Disp); 325 args.usH_Total = cpu_to_le16(mode->crtc_htotal);
309 conv_param.usH_SyncStart = cpu_to_le16(crtc_param->usH_SyncStart); 326 args.usH_Disp = cpu_to_le16(mode->crtc_hdisplay);
310 conv_param.usH_SyncWidth = cpu_to_le16(crtc_param->usH_SyncWidth); 327 args.usH_SyncStart = cpu_to_le16(mode->crtc_hsync_start);
311 conv_param.usV_Total = cpu_to_le16(crtc_param->usV_Total); 328 args.usH_SyncWidth =
312 conv_param.usV_Disp = cpu_to_le16(crtc_param->usV_Disp); 329 cpu_to_le16(mode->crtc_hsync_end - mode->crtc_hsync_start);
313 conv_param.usV_SyncStart = cpu_to_le16(crtc_param->usV_SyncStart); 330 args.usV_Total = cpu_to_le16(mode->crtc_vtotal);
314 conv_param.usV_SyncWidth = cpu_to_le16(crtc_param->usV_SyncWidth); 331 args.usV_Disp = cpu_to_le16(mode->crtc_vdisplay);
315 conv_param.susModeMiscInfo.usAccess = 332 args.usV_SyncStart = cpu_to_le16(mode->crtc_vsync_start);
316 cpu_to_le16(crtc_param->susModeMiscInfo.usAccess); 333 args.usV_SyncWidth =
317 conv_param.ucCRTC = crtc_param->ucCRTC; 334 cpu_to_le16(mode->crtc_vsync_end - mode->crtc_vsync_start);
318 conv_param.ucOverscanRight = crtc_param->ucOverscanRight; 335
319 conv_param.ucOverscanLeft = crtc_param->ucOverscanLeft; 336 if (mode->flags & DRM_MODE_FLAG_NVSYNC)
320 conv_param.ucOverscanBottom = crtc_param->ucOverscanBottom; 337 misc |= ATOM_VSYNC_POLARITY;
321 conv_param.ucOverscanTop = crtc_param->ucOverscanTop; 338 if (mode->flags & DRM_MODE_FLAG_NHSYNC)
322 conv_param.ucReserved = crtc_param->ucReserved; 339 misc |= ATOM_HSYNC_POLARITY;
340 if (mode->flags & DRM_MODE_FLAG_CSYNC)
341 misc |= ATOM_COMPOSITESYNC;
342 if (mode->flags & DRM_MODE_FLAG_INTERLACE)
343 misc |= ATOM_INTERLACE;
344 if (mode->flags & DRM_MODE_FLAG_DBLSCAN)
345 misc |= ATOM_DOUBLE_CLOCK_MODE;
346
347 args.susModeMiscInfo.usAccess = cpu_to_le16(misc);
348 args.ucCRTC = radeon_crtc->crtc_id;
323 349
324 printk("executing set crtc timing\n"); 350 printk("executing set crtc timing\n");
325 atom_execute_table(rdev->mode_info.atom_context, index, (uint32_t *)&conv_param); 351 atom_execute_table(rdev->mode_info.atom_context, index, (uint32_t *)&args);
352}
353
354static void atombios_set_ss(struct drm_crtc *crtc, int enable)
355{
356 struct radeon_crtc *radeon_crtc = to_radeon_crtc(crtc);
357 struct drm_device *dev = crtc->dev;
358 struct radeon_device *rdev = dev->dev_private;
359 struct drm_encoder *encoder = NULL;
360 struct radeon_encoder *radeon_encoder = NULL;
361 struct radeon_encoder_atom_dig *dig = NULL;
362 int index = GetIndexIntoMasterTable(COMMAND, EnableSpreadSpectrumOnPPLL);
363 ENABLE_SPREAD_SPECTRUM_ON_PPLL_PS_ALLOCATION args;
364 ENABLE_LVDS_SS_PARAMETERS legacy_args;
365 uint16_t percentage = 0;
366 uint8_t type = 0, step = 0, delay = 0, range = 0;
367
368 list_for_each_entry(encoder, &dev->mode_config.encoder_list, head) {
369 if (encoder->crtc == crtc) {
370 radeon_encoder = to_radeon_encoder(encoder);
371 /* only enable spread spectrum on LVDS */
372 if (radeon_encoder->devices & (ATOM_DEVICE_LCD_SUPPORT)) {
373 dig = radeon_encoder->enc_priv;
374 if (dig && dig->ss) {
375 percentage = dig->ss->percentage;
376 type = dig->ss->type;
377 step = dig->ss->step;
378 delay = dig->ss->delay;
379 range = dig->ss->range;
380 } else if (enable)
381 return;
382 } else if (enable)
383 return;
384 break;
385 }
386 }
387
388 if (!radeon_encoder)
389 return;
390
391 if (ASIC_IS_AVIVO(rdev)) {
392 memset(&args, 0, sizeof(args));
393 args.usSpreadSpectrumPercentage = cpu_to_le16(percentage);
394 args.ucSpreadSpectrumType = type;
395 args.ucSpreadSpectrumStep = step;
396 args.ucSpreadSpectrumDelay = delay;
397 args.ucSpreadSpectrumRange = range;
398 args.ucPpll = radeon_crtc->crtc_id ? ATOM_PPLL2 : ATOM_PPLL1;
399 args.ucEnable = enable;
400 atom_execute_table(rdev->mode_info.atom_context, index, (uint32_t *)&args);
401 } else {
402 memset(&legacy_args, 0, sizeof(legacy_args));
403 legacy_args.usSpreadSpectrumPercentage = cpu_to_le16(percentage);
404 legacy_args.ucSpreadSpectrumType = type;
405 legacy_args.ucSpreadSpectrumStepSize_Delay = (step & 3) << 2;
406 legacy_args.ucSpreadSpectrumStepSize_Delay |= (delay & 7) << 4;
407 legacy_args.ucEnable = enable;
408 atom_execute_table(rdev->mode_info.atom_context, index, (uint32_t *)&legacy_args);
409 }
326} 410}
327 411
328void atombios_crtc_set_pll(struct drm_crtc *crtc, struct drm_display_mode *mode) 412void atombios_crtc_set_pll(struct drm_crtc *crtc, struct drm_display_mode *mode)
@@ -333,12 +417,13 @@ void atombios_crtc_set_pll(struct drm_crtc *crtc, struct drm_display_mode *mode)
333 struct drm_encoder *encoder = NULL; 417 struct drm_encoder *encoder = NULL;
334 struct radeon_encoder *radeon_encoder = NULL; 418 struct radeon_encoder *radeon_encoder = NULL;
335 uint8_t frev, crev; 419 uint8_t frev, crev;
336 int index = GetIndexIntoMasterTable(COMMAND, SetPixelClock); 420 int index;
337 SET_PIXEL_CLOCK_PS_ALLOCATION args; 421 SET_PIXEL_CLOCK_PS_ALLOCATION args;
338 PIXEL_CLOCK_PARAMETERS *spc1_ptr; 422 PIXEL_CLOCK_PARAMETERS *spc1_ptr;
339 PIXEL_CLOCK_PARAMETERS_V2 *spc2_ptr; 423 PIXEL_CLOCK_PARAMETERS_V2 *spc2_ptr;
340 PIXEL_CLOCK_PARAMETERS_V3 *spc3_ptr; 424 PIXEL_CLOCK_PARAMETERS_V3 *spc3_ptr;
341 uint32_t sclock = mode->clock; 425 uint32_t pll_clock = mode->clock;
426 uint32_t adjusted_clock;
342 uint32_t ref_div = 0, fb_div = 0, frac_fb_div = 0, post_div = 0; 427 uint32_t ref_div = 0, fb_div = 0, frac_fb_div = 0, post_div = 0;
343 struct radeon_pll *pll; 428 struct radeon_pll *pll;
344 int pll_flags = 0; 429 int pll_flags = 0;
@@ -346,8 +431,6 @@ void atombios_crtc_set_pll(struct drm_crtc *crtc, struct drm_display_mode *mode)
346 memset(&args, 0, sizeof(args)); 431 memset(&args, 0, sizeof(args));
347 432
348 if (ASIC_IS_AVIVO(rdev)) { 433 if (ASIC_IS_AVIVO(rdev)) {
349 uint32_t ss_cntl;
350
351 if ((rdev->family == CHIP_RS600) || 434 if ((rdev->family == CHIP_RS600) ||
352 (rdev->family == CHIP_RS690) || 435 (rdev->family == CHIP_RS690) ||
353 (rdev->family == CHIP_RS740)) 436 (rdev->family == CHIP_RS740))
@@ -358,15 +441,6 @@ void atombios_crtc_set_pll(struct drm_crtc *crtc, struct drm_display_mode *mode)
358 pll_flags |= RADEON_PLL_PREFER_HIGH_FB_DIV; 441 pll_flags |= RADEON_PLL_PREFER_HIGH_FB_DIV;
359 else 442 else
360 pll_flags |= RADEON_PLL_PREFER_LOW_REF_DIV; 443 pll_flags |= RADEON_PLL_PREFER_LOW_REF_DIV;
361
362 /* disable spread spectrum clocking for now -- thanks Hedy Lamarr */
363 if (radeon_crtc->crtc_id == 0) {
364 ss_cntl = RREG32(AVIVO_P1PLL_INT_SS_CNTL);
365 WREG32(AVIVO_P1PLL_INT_SS_CNTL, ss_cntl & ~1);
366 } else {
367 ss_cntl = RREG32(AVIVO_P2PLL_INT_SS_CNTL);
368 WREG32(AVIVO_P2PLL_INT_SS_CNTL, ss_cntl & ~1);
369 }
370 } else { 444 } else {
371 pll_flags |= RADEON_PLL_LEGACY; 445 pll_flags |= RADEON_PLL_LEGACY;
372 446
@@ -393,14 +467,43 @@ void atombios_crtc_set_pll(struct drm_crtc *crtc, struct drm_display_mode *mode)
393 } 467 }
394 } 468 }
395 469
470 /* DCE3+ has an AdjustDisplayPll that will adjust the pixel clock
471 * accordingly based on the encoder/transmitter to work around
472 * special hw requirements.
473 */
474 if (ASIC_IS_DCE3(rdev)) {
475 ADJUST_DISPLAY_PLL_PS_ALLOCATION adjust_pll_args;
476
477 if (!encoder)
478 return;
479
480 memset(&adjust_pll_args, 0, sizeof(adjust_pll_args));
481 adjust_pll_args.usPixelClock = cpu_to_le16(mode->clock / 10);
482 adjust_pll_args.ucTransmitterID = radeon_encoder->encoder_id;
483 adjust_pll_args.ucEncodeMode = atombios_get_encoder_mode(encoder);
484
485 index = GetIndexIntoMasterTable(COMMAND, AdjustDisplayPll);
486 atom_execute_table(rdev->mode_info.atom_context,
487 index, (uint32_t *)&adjust_pll_args);
488 adjusted_clock = le16_to_cpu(adjust_pll_args.usPixelClock) * 10;
489 } else {
490 /* DVO wants 2x pixel clock if the DVO chip is in 12 bit mode */
491 if (ASIC_IS_AVIVO(rdev) &&
492 (radeon_encoder->encoder_id == ENCODER_OBJECT_ID_INTERNAL_KLDSCP_DVO1))
493 adjusted_clock = mode->clock * 2;
494 else
495 adjusted_clock = mode->clock;
496 }
497
396 if (radeon_crtc->crtc_id == 0) 498 if (radeon_crtc->crtc_id == 0)
397 pll = &rdev->clock.p1pll; 499 pll = &rdev->clock.p1pll;
398 else 500 else
399 pll = &rdev->clock.p2pll; 501 pll = &rdev->clock.p2pll;
400 502
401 radeon_compute_pll(pll, mode->clock, &sclock, &fb_div, &frac_fb_div, 503 radeon_compute_pll(pll, adjusted_clock, &pll_clock, &fb_div, &frac_fb_div,
402 &ref_div, &post_div, pll_flags); 504 &ref_div, &post_div, pll_flags);
403 505
506 index = GetIndexIntoMasterTable(COMMAND, SetPixelClock);
404 atom_parse_cmd_header(rdev->mode_info.atom_context, index, &frev, 507 atom_parse_cmd_header(rdev->mode_info.atom_context, index, &frev,
405 &crev); 508 &crev);
406 509
@@ -409,7 +512,7 @@ void atombios_crtc_set_pll(struct drm_crtc *crtc, struct drm_display_mode *mode)
409 switch (crev) { 512 switch (crev) {
410 case 1: 513 case 1:
411 spc1_ptr = (PIXEL_CLOCK_PARAMETERS *) & args.sPCLKInput; 514 spc1_ptr = (PIXEL_CLOCK_PARAMETERS *) & args.sPCLKInput;
412 spc1_ptr->usPixelClock = cpu_to_le16(sclock); 515 spc1_ptr->usPixelClock = cpu_to_le16(mode->clock / 10);
413 spc1_ptr->usRefDiv = cpu_to_le16(ref_div); 516 spc1_ptr->usRefDiv = cpu_to_le16(ref_div);
414 spc1_ptr->usFbDiv = cpu_to_le16(fb_div); 517 spc1_ptr->usFbDiv = cpu_to_le16(fb_div);
415 spc1_ptr->ucFracFbDiv = frac_fb_div; 518 spc1_ptr->ucFracFbDiv = frac_fb_div;
@@ -422,7 +525,7 @@ void atombios_crtc_set_pll(struct drm_crtc *crtc, struct drm_display_mode *mode)
422 case 2: 525 case 2:
423 spc2_ptr = 526 spc2_ptr =
424 (PIXEL_CLOCK_PARAMETERS_V2 *) & args.sPCLKInput; 527 (PIXEL_CLOCK_PARAMETERS_V2 *) & args.sPCLKInput;
425 spc2_ptr->usPixelClock = cpu_to_le16(sclock); 528 spc2_ptr->usPixelClock = cpu_to_le16(mode->clock / 10);
426 spc2_ptr->usRefDiv = cpu_to_le16(ref_div); 529 spc2_ptr->usRefDiv = cpu_to_le16(ref_div);
427 spc2_ptr->usFbDiv = cpu_to_le16(fb_div); 530 spc2_ptr->usFbDiv = cpu_to_le16(fb_div);
428 spc2_ptr->ucFracFbDiv = frac_fb_div; 531 spc2_ptr->ucFracFbDiv = frac_fb_div;
@@ -437,7 +540,7 @@ void atombios_crtc_set_pll(struct drm_crtc *crtc, struct drm_display_mode *mode)
437 return; 540 return;
438 spc3_ptr = 541 spc3_ptr =
439 (PIXEL_CLOCK_PARAMETERS_V3 *) & args.sPCLKInput; 542 (PIXEL_CLOCK_PARAMETERS_V3 *) & args.sPCLKInput;
440 spc3_ptr->usPixelClock = cpu_to_le16(sclock); 543 spc3_ptr->usPixelClock = cpu_to_le16(mode->clock / 10);
441 spc3_ptr->usRefDiv = cpu_to_le16(ref_div); 544 spc3_ptr->usRefDiv = cpu_to_le16(ref_div);
442 spc3_ptr->usFbDiv = cpu_to_le16(fb_div); 545 spc3_ptr->usFbDiv = cpu_to_le16(fb_div);
443 spc3_ptr->ucFracFbDiv = frac_fb_div; 546 spc3_ptr->ucFracFbDiv = frac_fb_div;
@@ -527,6 +630,16 @@ int atombios_crtc_set_base(struct drm_crtc *crtc, int x, int y,
527 WREG32(AVIVO_D1VGA_CONTROL, 0); 630 WREG32(AVIVO_D1VGA_CONTROL, 0);
528 else 631 else
529 WREG32(AVIVO_D2VGA_CONTROL, 0); 632 WREG32(AVIVO_D2VGA_CONTROL, 0);
633
634 if (rdev->family >= CHIP_RV770) {
635 if (radeon_crtc->crtc_id) {
636 WREG32(R700_D2GRPH_PRIMARY_SURFACE_ADDRESS_HIGH, 0);
637 WREG32(R700_D2GRPH_SECONDARY_SURFACE_ADDRESS_HIGH, 0);
638 } else {
639 WREG32(R700_D1GRPH_PRIMARY_SURFACE_ADDRESS_HIGH, 0);
640 WREG32(R700_D1GRPH_SECONDARY_SURFACE_ADDRESS_HIGH, 0);
641 }
642 }
530 WREG32(AVIVO_D1GRPH_PRIMARY_SURFACE_ADDRESS + radeon_crtc->crtc_offset, 643 WREG32(AVIVO_D1GRPH_PRIMARY_SURFACE_ADDRESS + radeon_crtc->crtc_offset,
531 (u32) fb_location); 644 (u32) fb_location);
532 WREG32(AVIVO_D1GRPH_SECONDARY_SURFACE_ADDRESS + 645 WREG32(AVIVO_D1GRPH_SECONDARY_SURFACE_ADDRESS +
@@ -563,6 +676,10 @@ int atombios_crtc_set_base(struct drm_crtc *crtc, int x, int y,
563 radeon_fb = to_radeon_framebuffer(old_fb); 676 radeon_fb = to_radeon_framebuffer(old_fb);
564 radeon_gem_object_unpin(radeon_fb->obj); 677 radeon_gem_object_unpin(radeon_fb->obj);
565 } 678 }
679
680 /* Bytes per pixel may have changed */
681 radeon_bandwidth_update(rdev);
682
566 return 0; 683 return 0;
567} 684}
568 685
@@ -574,134 +691,24 @@ int atombios_crtc_mode_set(struct drm_crtc *crtc,
574 struct radeon_crtc *radeon_crtc = to_radeon_crtc(crtc); 691 struct radeon_crtc *radeon_crtc = to_radeon_crtc(crtc);
575 struct drm_device *dev = crtc->dev; 692 struct drm_device *dev = crtc->dev;
576 struct radeon_device *rdev = dev->dev_private; 693 struct radeon_device *rdev = dev->dev_private;
577 struct drm_encoder *encoder;
578 SET_CRTC_TIMING_PARAMETERS_PS_ALLOCATION crtc_timing;
579 int need_tv_timings = 0;
580 bool ret;
581 694
582 /* TODO color tiling */ 695 /* TODO color tiling */
583 memset(&crtc_timing, 0, sizeof(crtc_timing));
584
585 list_for_each_entry(encoder, &dev->mode_config.encoder_list, head) {
586 /* find tv std */
587 if (encoder->crtc == crtc) {
588 struct radeon_encoder *radeon_encoder = to_radeon_encoder(encoder);
589
590 if (radeon_encoder->active_device & ATOM_DEVICE_TV_SUPPORT) {
591 struct radeon_encoder_atom_dac *tv_dac = radeon_encoder->enc_priv;
592 if (tv_dac) {
593 if (tv_dac->tv_std == TV_STD_NTSC ||
594 tv_dac->tv_std == TV_STD_NTSC_J ||
595 tv_dac->tv_std == TV_STD_PAL_M)
596 need_tv_timings = 1;
597 else
598 need_tv_timings = 2;
599 break;
600 }
601 }
602 }
603 }
604
605 crtc_timing.ucCRTC = radeon_crtc->crtc_id;
606 if (need_tv_timings) {
607 ret = radeon_atom_get_tv_timings(rdev, need_tv_timings - 1,
608 &crtc_timing, &adjusted_mode->clock);
609 if (ret == false)
610 need_tv_timings = 0;
611 }
612
613 if (!need_tv_timings) {
614 crtc_timing.usH_Total = adjusted_mode->crtc_htotal;
615 crtc_timing.usH_Disp = adjusted_mode->crtc_hdisplay;
616 crtc_timing.usH_SyncStart = adjusted_mode->crtc_hsync_start;
617 crtc_timing.usH_SyncWidth =
618 adjusted_mode->crtc_hsync_end - adjusted_mode->crtc_hsync_start;
619
620 crtc_timing.usV_Total = adjusted_mode->crtc_vtotal;
621 crtc_timing.usV_Disp = adjusted_mode->crtc_vdisplay;
622 crtc_timing.usV_SyncStart = adjusted_mode->crtc_vsync_start;
623 crtc_timing.usV_SyncWidth =
624 adjusted_mode->crtc_vsync_end - adjusted_mode->crtc_vsync_start;
625
626 if (adjusted_mode->flags & DRM_MODE_FLAG_NVSYNC)
627 crtc_timing.susModeMiscInfo.usAccess |= ATOM_VSYNC_POLARITY;
628
629 if (adjusted_mode->flags & DRM_MODE_FLAG_NHSYNC)
630 crtc_timing.susModeMiscInfo.usAccess |= ATOM_HSYNC_POLARITY;
631
632 if (adjusted_mode->flags & DRM_MODE_FLAG_CSYNC)
633 crtc_timing.susModeMiscInfo.usAccess |= ATOM_COMPOSITESYNC;
634
635 if (adjusted_mode->flags & DRM_MODE_FLAG_INTERLACE)
636 crtc_timing.susModeMiscInfo.usAccess |= ATOM_INTERLACE;
637
638 if (adjusted_mode->flags & DRM_MODE_FLAG_DBLSCAN)
639 crtc_timing.susModeMiscInfo.usAccess |= ATOM_DOUBLE_CLOCK_MODE;
640 }
641 696
697 atombios_set_ss(crtc, 0);
642 atombios_crtc_set_pll(crtc, adjusted_mode); 698 atombios_crtc_set_pll(crtc, adjusted_mode);
643 atombios_crtc_set_timing(crtc, &crtc_timing); 699 atombios_set_ss(crtc, 1);
700 atombios_crtc_set_timing(crtc, adjusted_mode);
644 701
645 if (ASIC_IS_AVIVO(rdev)) 702 if (ASIC_IS_AVIVO(rdev))
646 atombios_crtc_set_base(crtc, x, y, old_fb); 703 atombios_crtc_set_base(crtc, x, y, old_fb);
647 else { 704 else {
648 if (radeon_crtc->crtc_id == 0) { 705 if (radeon_crtc->crtc_id == 0)
649 SET_CRTC_USING_DTD_TIMING_PARAMETERS crtc_dtd_timing; 706 atombios_set_crtc_dtd_timing(crtc, adjusted_mode);
650 memset(&crtc_dtd_timing, 0, sizeof(crtc_dtd_timing));
651
652 /* setup FP shadow regs on R4xx */
653 crtc_dtd_timing.ucCRTC = radeon_crtc->crtc_id;
654 crtc_dtd_timing.usH_Size = adjusted_mode->crtc_hdisplay;
655 crtc_dtd_timing.usV_Size = adjusted_mode->crtc_vdisplay;
656 crtc_dtd_timing.usH_Blanking_Time =
657 adjusted_mode->crtc_hblank_end -
658 adjusted_mode->crtc_hdisplay;
659 crtc_dtd_timing.usV_Blanking_Time =
660 adjusted_mode->crtc_vblank_end -
661 adjusted_mode->crtc_vdisplay;
662 crtc_dtd_timing.usH_SyncOffset =
663 adjusted_mode->crtc_hsync_start -
664 adjusted_mode->crtc_hdisplay;
665 crtc_dtd_timing.usV_SyncOffset =
666 adjusted_mode->crtc_vsync_start -
667 adjusted_mode->crtc_vdisplay;
668 crtc_dtd_timing.usH_SyncWidth =
669 adjusted_mode->crtc_hsync_end -
670 adjusted_mode->crtc_hsync_start;
671 crtc_dtd_timing.usV_SyncWidth =
672 adjusted_mode->crtc_vsync_end -
673 adjusted_mode->crtc_vsync_start;
674 /* crtc_dtd_timing.ucH_Border = adjusted_mode->crtc_hborder; */
675 /* crtc_dtd_timing.ucV_Border = adjusted_mode->crtc_vborder; */
676
677 if (adjusted_mode->flags & DRM_MODE_FLAG_NVSYNC)
678 crtc_dtd_timing.susModeMiscInfo.usAccess |=
679 ATOM_VSYNC_POLARITY;
680
681 if (adjusted_mode->flags & DRM_MODE_FLAG_NHSYNC)
682 crtc_dtd_timing.susModeMiscInfo.usAccess |=
683 ATOM_HSYNC_POLARITY;
684
685 if (adjusted_mode->flags & DRM_MODE_FLAG_CSYNC)
686 crtc_dtd_timing.susModeMiscInfo.usAccess |=
687 ATOM_COMPOSITESYNC;
688
689 if (adjusted_mode->flags & DRM_MODE_FLAG_INTERLACE)
690 crtc_dtd_timing.susModeMiscInfo.usAccess |=
691 ATOM_INTERLACE;
692
693 if (adjusted_mode->flags & DRM_MODE_FLAG_DBLSCAN)
694 crtc_dtd_timing.susModeMiscInfo.usAccess |=
695 ATOM_DOUBLE_CLOCK_MODE;
696
697 atombios_set_crtc_dtd_timing(crtc, &crtc_dtd_timing);
698 }
699 radeon_crtc_set_base(crtc, x, y, old_fb); 707 radeon_crtc_set_base(crtc, x, y, old_fb);
700 radeon_legacy_atom_set_surface(crtc); 708 radeon_legacy_atom_set_surface(crtc);
701 } 709 }
702 atombios_overscan_setup(crtc, mode, adjusted_mode); 710 atombios_overscan_setup(crtc, mode, adjusted_mode);
703 atombios_scaler_setup(crtc); 711 atombios_scaler_setup(crtc);
704 radeon_bandwidth_update(rdev);
705 return 0; 712 return 0;
706} 713}
707 714
diff --git a/drivers/gpu/drm/radeon/mkregtable.c b/drivers/gpu/drm/radeon/mkregtable.c
index fb211e585dea..0d79577c1576 100644
--- a/drivers/gpu/drm/radeon/mkregtable.c
+++ b/drivers/gpu/drm/radeon/mkregtable.c
@@ -561,7 +561,7 @@ struct table {
561 char *gpu_prefix; 561 char *gpu_prefix;
562}; 562};
563 563
564struct offset *offset_new(unsigned o) 564static struct offset *offset_new(unsigned o)
565{ 565{
566 struct offset *offset; 566 struct offset *offset;
567 567
@@ -573,12 +573,12 @@ struct offset *offset_new(unsigned o)
573 return offset; 573 return offset;
574} 574}
575 575
576void table_offset_add(struct table *t, struct offset *offset) 576static void table_offset_add(struct table *t, struct offset *offset)
577{ 577{
578 list_add_tail(&offset->list, &t->offsets); 578 list_add_tail(&offset->list, &t->offsets);
579} 579}
580 580
581void table_init(struct table *t) 581static void table_init(struct table *t)
582{ 582{
583 INIT_LIST_HEAD(&t->offsets); 583 INIT_LIST_HEAD(&t->offsets);
584 t->offset_max = 0; 584 t->offset_max = 0;
@@ -586,7 +586,7 @@ void table_init(struct table *t)
586 t->table = NULL; 586 t->table = NULL;
587} 587}
588 588
589void table_print(struct table *t) 589static void table_print(struct table *t)
590{ 590{
591 unsigned nlloop, i, j, n, c, id; 591 unsigned nlloop, i, j, n, c, id;
592 592
@@ -611,7 +611,7 @@ void table_print(struct table *t)
611 printf("};\n"); 611 printf("};\n");
612} 612}
613 613
614int table_build(struct table *t) 614static int table_build(struct table *t)
615{ 615{
616 struct offset *offset; 616 struct offset *offset;
617 unsigned i, m; 617 unsigned i, m;
@@ -631,7 +631,7 @@ int table_build(struct table *t)
631} 631}
632 632
633static char gpu_name[10]; 633static char gpu_name[10];
634int parser_auth(struct table *t, const char *filename) 634static int parser_auth(struct table *t, const char *filename)
635{ 635{
636 FILE *file; 636 FILE *file;
637 regex_t mask_rex; 637 regex_t mask_rex;
diff --git a/drivers/gpu/drm/radeon/r100.c b/drivers/gpu/drm/radeon/r100.c
index 161094c07d94..c9e93eabcf16 100644
--- a/drivers/gpu/drm/radeon/r100.c
+++ b/drivers/gpu/drm/radeon/r100.c
@@ -186,7 +186,7 @@ static inline uint32_t r100_irq_ack(struct radeon_device *rdev)
186 186
187int r100_irq_process(struct radeon_device *rdev) 187int r100_irq_process(struct radeon_device *rdev)
188{ 188{
189 uint32_t status; 189 uint32_t status, msi_rearm;
190 190
191 status = r100_irq_ack(rdev); 191 status = r100_irq_ack(rdev);
192 if (!status) { 192 if (!status) {
@@ -209,6 +209,21 @@ int r100_irq_process(struct radeon_device *rdev)
209 } 209 }
210 status = r100_irq_ack(rdev); 210 status = r100_irq_ack(rdev);
211 } 211 }
212 if (rdev->msi_enabled) {
213 switch (rdev->family) {
214 case CHIP_RS400:
215 case CHIP_RS480:
216 msi_rearm = RREG32(RADEON_AIC_CNTL) & ~RS400_MSI_REARM;
217 WREG32(RADEON_AIC_CNTL, msi_rearm);
218 WREG32(RADEON_AIC_CNTL, msi_rearm | RS400_MSI_REARM);
219 break;
220 default:
221 msi_rearm = RREG32(RADEON_MSI_REARM_EN) & ~RV370_MSI_REARM_EN;
222 WREG32(RADEON_MSI_REARM_EN, msi_rearm);
223 WREG32(RADEON_MSI_REARM_EN, msi_rearm | RV370_MSI_REARM_EN);
224 break;
225 }
226 }
212 return IRQ_HANDLED; 227 return IRQ_HANDLED;
213} 228}
214 229
@@ -240,7 +255,7 @@ int r100_wb_init(struct radeon_device *rdev)
240 int r; 255 int r;
241 256
242 if (rdev->wb.wb_obj == NULL) { 257 if (rdev->wb.wb_obj == NULL) {
243 r = radeon_object_create(rdev, NULL, 4096, 258 r = radeon_object_create(rdev, NULL, RADEON_GPU_PAGE_SIZE,
244 true, 259 true,
245 RADEON_GEM_DOMAIN_GTT, 260 RADEON_GEM_DOMAIN_GTT,
246 false, &rdev->wb.wb_obj); 261 false, &rdev->wb.wb_obj);
@@ -563,19 +578,19 @@ int r100_cp_init(struct radeon_device *rdev, unsigned ring_size)
563 indirect1_start = 16; 578 indirect1_start = 16;
564 /* cp setup */ 579 /* cp setup */
565 WREG32(0x718, pre_write_timer | (pre_write_limit << 28)); 580 WREG32(0x718, pre_write_timer | (pre_write_limit << 28));
566 WREG32(RADEON_CP_RB_CNTL, 581 tmp = (REG_SET(RADEON_RB_BUFSZ, rb_bufsz) |
567#ifdef __BIG_ENDIAN
568 RADEON_BUF_SWAP_32BIT |
569#endif
570 REG_SET(RADEON_RB_BUFSZ, rb_bufsz) |
571 REG_SET(RADEON_RB_BLKSZ, rb_blksz) | 582 REG_SET(RADEON_RB_BLKSZ, rb_blksz) |
572 REG_SET(RADEON_MAX_FETCH, max_fetch) | 583 REG_SET(RADEON_MAX_FETCH, max_fetch) |
573 RADEON_RB_NO_UPDATE); 584 RADEON_RB_NO_UPDATE);
585#ifdef __BIG_ENDIAN
586 tmp |= RADEON_BUF_SWAP_32BIT;
587#endif
588 WREG32(RADEON_CP_RB_CNTL, tmp);
589
574 /* Set ring address */ 590 /* Set ring address */
575 DRM_INFO("radeon: ring at 0x%016lX\n", (unsigned long)rdev->cp.gpu_addr); 591 DRM_INFO("radeon: ring at 0x%016lX\n", (unsigned long)rdev->cp.gpu_addr);
576 WREG32(RADEON_CP_RB_BASE, rdev->cp.gpu_addr); 592 WREG32(RADEON_CP_RB_BASE, rdev->cp.gpu_addr);
577 /* Force read & write ptr to 0 */ 593 /* Force read & write ptr to 0 */
578 tmp = RREG32(RADEON_CP_RB_CNTL);
579 WREG32(RADEON_CP_RB_CNTL, tmp | RADEON_RB_RPTR_WR_ENA); 594 WREG32(RADEON_CP_RB_CNTL, tmp | RADEON_RB_RPTR_WR_ENA);
580 WREG32(RADEON_CP_RB_RPTR_WR, 0); 595 WREG32(RADEON_CP_RB_RPTR_WR, 0);
581 WREG32(RADEON_CP_RB_WPTR, 0); 596 WREG32(RADEON_CP_RB_WPTR, 0);
@@ -2364,7 +2379,7 @@ void r100_bandwidth_update(struct radeon_device *rdev)
2364 /* 2379 /*
2365 Find the total latency for the display data. 2380 Find the total latency for the display data.
2366 */ 2381 */
2367 disp_latency_overhead.full = rfixed_const(80); 2382 disp_latency_overhead.full = rfixed_const(8);
2368 disp_latency_overhead.full = rfixed_div(disp_latency_overhead, sclk_ff); 2383 disp_latency_overhead.full = rfixed_div(disp_latency_overhead, sclk_ff);
2369 mc_latency_mclk.full += disp_latency_overhead.full + cur_latency_mclk.full; 2384 mc_latency_mclk.full += disp_latency_overhead.full + cur_latency_mclk.full;
2370 mc_latency_sclk.full += disp_latency_overhead.full + cur_latency_sclk.full; 2385 mc_latency_sclk.full += disp_latency_overhead.full + cur_latency_sclk.full;
@@ -2562,8 +2577,11 @@ void r100_bandwidth_update(struct radeon_device *rdev)
2562static inline void r100_cs_track_texture_print(struct r100_cs_track_texture *t) 2577static inline void r100_cs_track_texture_print(struct r100_cs_track_texture *t)
2563{ 2578{
2564 DRM_ERROR("pitch %d\n", t->pitch); 2579 DRM_ERROR("pitch %d\n", t->pitch);
2580 DRM_ERROR("use_pitch %d\n", t->use_pitch);
2565 DRM_ERROR("width %d\n", t->width); 2581 DRM_ERROR("width %d\n", t->width);
2582 DRM_ERROR("width_11 %d\n", t->width_11);
2566 DRM_ERROR("height %d\n", t->height); 2583 DRM_ERROR("height %d\n", t->height);
2584 DRM_ERROR("height_11 %d\n", t->height_11);
2567 DRM_ERROR("num levels %d\n", t->num_levels); 2585 DRM_ERROR("num levels %d\n", t->num_levels);
2568 DRM_ERROR("depth %d\n", t->txdepth); 2586 DRM_ERROR("depth %d\n", t->txdepth);
2569 DRM_ERROR("bpp %d\n", t->cpp); 2587 DRM_ERROR("bpp %d\n", t->cpp);
@@ -2623,15 +2641,17 @@ static int r100_cs_track_texture_check(struct radeon_device *rdev,
2623 else 2641 else
2624 w = track->textures[u].pitch / (1 << i); 2642 w = track->textures[u].pitch / (1 << i);
2625 } else { 2643 } else {
2626 w = track->textures[u].width / (1 << i); 2644 w = track->textures[u].width;
2627 if (rdev->family >= CHIP_RV515) 2645 if (rdev->family >= CHIP_RV515)
2628 w |= track->textures[u].width_11; 2646 w |= track->textures[u].width_11;
2647 w = w / (1 << i);
2629 if (track->textures[u].roundup_w) 2648 if (track->textures[u].roundup_w)
2630 w = roundup_pow_of_two(w); 2649 w = roundup_pow_of_two(w);
2631 } 2650 }
2632 h = track->textures[u].height / (1 << i); 2651 h = track->textures[u].height;
2633 if (rdev->family >= CHIP_RV515) 2652 if (rdev->family >= CHIP_RV515)
2634 h |= track->textures[u].height_11; 2653 h |= track->textures[u].height_11;
2654 h = h / (1 << i);
2635 if (track->textures[u].roundup_h) 2655 if (track->textures[u].roundup_h)
2636 h = roundup_pow_of_two(h); 2656 h = roundup_pow_of_two(h);
2637 size += w * h; 2657 size += w * h;
diff --git a/drivers/gpu/drm/radeon/r300.c b/drivers/gpu/drm/radeon/r300.c
index e08c4a8974ca..2f43ee8e4048 100644
--- a/drivers/gpu/drm/radeon/r300.c
+++ b/drivers/gpu/drm/radeon/r300.c
@@ -113,7 +113,7 @@ int rv370_pcie_gart_enable(struct radeon_device *rdev)
113 tmp = RADEON_PCIE_TX_GART_UNMAPPED_ACCESS_DISCARD; 113 tmp = RADEON_PCIE_TX_GART_UNMAPPED_ACCESS_DISCARD;
114 WREG32_PCIE(RADEON_PCIE_TX_GART_CNTL, tmp); 114 WREG32_PCIE(RADEON_PCIE_TX_GART_CNTL, tmp);
115 WREG32_PCIE(RADEON_PCIE_TX_GART_START_LO, rdev->mc.gtt_location); 115 WREG32_PCIE(RADEON_PCIE_TX_GART_START_LO, rdev->mc.gtt_location);
116 tmp = rdev->mc.gtt_location + rdev->mc.gtt_size - 4096; 116 tmp = rdev->mc.gtt_location + rdev->mc.gtt_size - RADEON_GPU_PAGE_SIZE;
117 WREG32_PCIE(RADEON_PCIE_TX_GART_END_LO, tmp); 117 WREG32_PCIE(RADEON_PCIE_TX_GART_END_LO, tmp);
118 WREG32_PCIE(RADEON_PCIE_TX_GART_START_HI, 0); 118 WREG32_PCIE(RADEON_PCIE_TX_GART_START_HI, 0);
119 WREG32_PCIE(RADEON_PCIE_TX_GART_END_HI, 0); 119 WREG32_PCIE(RADEON_PCIE_TX_GART_END_HI, 0);
diff --git a/drivers/gpu/drm/radeon/r420.c b/drivers/gpu/drm/radeon/r420.c
index 5c7fe52de30e..1cefdbcc0850 100644
--- a/drivers/gpu/drm/radeon/r420.c
+++ b/drivers/gpu/drm/radeon/r420.c
@@ -311,6 +311,8 @@ int r420_init(struct radeon_device *rdev)
311 } 311 }
312 /* Initialize clocks */ 312 /* Initialize clocks */
313 radeon_get_clock_info(rdev->ddev); 313 radeon_get_clock_info(rdev->ddev);
314 /* Initialize power management */
315 radeon_pm_init(rdev);
314 /* Get vram informations */ 316 /* Get vram informations */
315 r300_vram_info(rdev); 317 r300_vram_info(rdev);
316 /* Initialize memory controller (also test AGP) */ 318 /* Initialize memory controller (also test AGP) */
diff --git a/drivers/gpu/drm/radeon/r500_reg.h b/drivers/gpu/drm/radeon/r500_reg.h
index 868add6e166d..7baa73955563 100644
--- a/drivers/gpu/drm/radeon/r500_reg.h
+++ b/drivers/gpu/drm/radeon/r500_reg.h
@@ -384,9 +384,16 @@
384# define AVIVO_D1GRPH_TILED (1 << 20) 384# define AVIVO_D1GRPH_TILED (1 << 20)
385# define AVIVO_D1GRPH_MACRO_ADDRESS_MODE (1 << 21) 385# define AVIVO_D1GRPH_MACRO_ADDRESS_MODE (1 << 21)
386 386
387/* The R7xx *_HIGH surface regs are backwards; the D1 regs are in the D2
388 * block and vice versa. This applies to GRPH, CUR, etc.
389 */
387#define AVIVO_D1GRPH_LUT_SEL 0x6108 390#define AVIVO_D1GRPH_LUT_SEL 0x6108
388#define AVIVO_D1GRPH_PRIMARY_SURFACE_ADDRESS 0x6110 391#define AVIVO_D1GRPH_PRIMARY_SURFACE_ADDRESS 0x6110
392#define R700_D1GRPH_PRIMARY_SURFACE_ADDRESS_HIGH 0x6914
393#define R700_D2GRPH_PRIMARY_SURFACE_ADDRESS_HIGH 0x6114
389#define AVIVO_D1GRPH_SECONDARY_SURFACE_ADDRESS 0x6118 394#define AVIVO_D1GRPH_SECONDARY_SURFACE_ADDRESS 0x6118
395#define R700_D1GRPH_SECONDARY_SURFACE_ADDRESS_HIGH 0x691c
396#define R700_D2GRPH_SECONDARY_SURFACE_ADDRESS_HIGH 0x611c
390#define AVIVO_D1GRPH_PITCH 0x6120 397#define AVIVO_D1GRPH_PITCH 0x6120
391#define AVIVO_D1GRPH_SURFACE_OFFSET_X 0x6124 398#define AVIVO_D1GRPH_SURFACE_OFFSET_X 0x6124
392#define AVIVO_D1GRPH_SURFACE_OFFSET_Y 0x6128 399#define AVIVO_D1GRPH_SURFACE_OFFSET_Y 0x6128
@@ -404,6 +411,8 @@
404# define AVIVO_D1CURSOR_MODE_MASK (3 << 8) 411# define AVIVO_D1CURSOR_MODE_MASK (3 << 8)
405# define AVIVO_D1CURSOR_MODE_24BPP 2 412# define AVIVO_D1CURSOR_MODE_24BPP 2
406#define AVIVO_D1CUR_SURFACE_ADDRESS 0x6408 413#define AVIVO_D1CUR_SURFACE_ADDRESS 0x6408
414#define R700_D1CUR_SURFACE_ADDRESS_HIGH 0x6c0c
415#define R700_D2CUR_SURFACE_ADDRESS_HIGH 0x640c
407#define AVIVO_D1CUR_SIZE 0x6410 416#define AVIVO_D1CUR_SIZE 0x6410
408#define AVIVO_D1CUR_POSITION 0x6414 417#define AVIVO_D1CUR_POSITION 0x6414
409#define AVIVO_D1CUR_HOT_SPOT 0x6418 418#define AVIVO_D1CUR_HOT_SPOT 0x6418
diff --git a/drivers/gpu/drm/radeon/r520.c b/drivers/gpu/drm/radeon/r520.c
index a555b7b19b48..f7435185c0a6 100644
--- a/drivers/gpu/drm/radeon/r520.c
+++ b/drivers/gpu/drm/radeon/r520.c
@@ -260,6 +260,8 @@ int r520_init(struct radeon_device *rdev)
260 } 260 }
261 /* Initialize clocks */ 261 /* Initialize clocks */
262 radeon_get_clock_info(rdev->ddev); 262 radeon_get_clock_info(rdev->ddev);
263 /* Initialize power management */
264 radeon_pm_init(rdev);
263 /* Get vram informations */ 265 /* Get vram informations */
264 r520_vram_info(rdev); 266 r520_vram_info(rdev);
265 /* Initialize memory controller (also test AGP) */ 267 /* Initialize memory controller (also test AGP) */
diff --git a/drivers/gpu/drm/radeon/r600.c b/drivers/gpu/drm/radeon/r600.c
index 609719490ec2..278f646bc18e 100644
--- a/drivers/gpu/drm/radeon/r600.c
+++ b/drivers/gpu/drm/radeon/r600.c
@@ -339,11 +339,10 @@ int r600_mc_init(struct radeon_device *rdev)
339{ 339{
340 fixed20_12 a; 340 fixed20_12 a;
341 u32 tmp; 341 u32 tmp;
342 int chansize; 342 int chansize, numchan;
343 int r; 343 int r;
344 344
345 /* Get VRAM informations */ 345 /* Get VRAM informations */
346 rdev->mc.vram_width = 128;
347 rdev->mc.vram_is_ddr = true; 346 rdev->mc.vram_is_ddr = true;
348 tmp = RREG32(RAMCFG); 347 tmp = RREG32(RAMCFG);
349 if (tmp & CHANSIZE_OVERRIDE) { 348 if (tmp & CHANSIZE_OVERRIDE) {
@@ -353,17 +352,23 @@ int r600_mc_init(struct radeon_device *rdev)
353 } else { 352 } else {
354 chansize = 32; 353 chansize = 32;
355 } 354 }
356 if (rdev->family == CHIP_R600) { 355 tmp = RREG32(CHMAP);
357 rdev->mc.vram_width = 8 * chansize; 356 switch ((tmp & NOOFCHAN_MASK) >> NOOFCHAN_SHIFT) {
358 } else if (rdev->family == CHIP_RV670) { 357 case 0:
359 rdev->mc.vram_width = 4 * chansize; 358 default:
360 } else if ((rdev->family == CHIP_RV610) || 359 numchan = 1;
361 (rdev->family == CHIP_RV620)) { 360 break;
362 rdev->mc.vram_width = chansize; 361 case 1:
363 } else if ((rdev->family == CHIP_RV630) || 362 numchan = 2;
364 (rdev->family == CHIP_RV635)) { 363 break;
365 rdev->mc.vram_width = 2 * chansize; 364 case 2:
365 numchan = 4;
366 break;
367 case 3:
368 numchan = 8;
369 break;
366 } 370 }
371 rdev->mc.vram_width = numchan * chansize;
367 /* Could aper size report 0 ? */ 372 /* Could aper size report 0 ? */
368 rdev->mc.aper_base = drm_get_resource_start(rdev->ddev, 0); 373 rdev->mc.aper_base = drm_get_resource_start(rdev->ddev, 0);
369 rdev->mc.aper_size = drm_get_resource_len(rdev->ddev, 0); 374 rdev->mc.aper_size = drm_get_resource_len(rdev->ddev, 0);
@@ -404,35 +409,29 @@ int r600_mc_init(struct radeon_device *rdev)
404 rdev->mc.gtt_location = rdev->mc.mc_vram_size; 409 rdev->mc.gtt_location = rdev->mc.mc_vram_size;
405 } 410 }
406 } else { 411 } else {
407 if (rdev->family == CHIP_RS780 || rdev->family == CHIP_RS880) { 412 rdev->mc.gtt_size = radeon_gart_size * 1024 * 1024;
408 rdev->mc.vram_location = (RREG32(MC_VM_FB_LOCATION) & 413 rdev->mc.vram_location = (RREG32(MC_VM_FB_LOCATION) &
409 0xFFFF) << 24; 414 0xFFFF) << 24;
410 rdev->mc.gtt_size = radeon_gart_size * 1024 * 1024; 415 tmp = rdev->mc.vram_location + rdev->mc.mc_vram_size;
411 tmp = rdev->mc.vram_location + rdev->mc.mc_vram_size; 416 if ((0xFFFFFFFFUL - tmp) >= rdev->mc.gtt_size) {
412 if ((0xFFFFFFFFUL - tmp) >= rdev->mc.gtt_size) { 417 /* Enough place after vram */
413 /* Enough place after vram */ 418 rdev->mc.gtt_location = tmp;
414 rdev->mc.gtt_location = tmp; 419 } else if (rdev->mc.vram_location >= rdev->mc.gtt_size) {
415 } else if (rdev->mc.vram_location >= rdev->mc.gtt_size) { 420 /* Enough place before vram */
416 /* Enough place before vram */ 421 rdev->mc.gtt_location = 0;
422 } else {
423 /* Not enough place after or before shrink
424 * gart size
425 */
426 if (rdev->mc.vram_location > (0xFFFFFFFFUL - tmp)) {
417 rdev->mc.gtt_location = 0; 427 rdev->mc.gtt_location = 0;
428 rdev->mc.gtt_size = rdev->mc.vram_location;
418 } else { 429 } else {
419 /* Not enough place after or before shrink 430 rdev->mc.gtt_location = tmp;
420 * gart size 431 rdev->mc.gtt_size = 0xFFFFFFFFUL - tmp;
421 */
422 if (rdev->mc.vram_location > (0xFFFFFFFFUL - tmp)) {
423 rdev->mc.gtt_location = 0;
424 rdev->mc.gtt_size = rdev->mc.vram_location;
425 } else {
426 rdev->mc.gtt_location = tmp;
427 rdev->mc.gtt_size = 0xFFFFFFFFUL - tmp;
428 }
429 } 432 }
430 rdev->mc.gtt_location = rdev->mc.mc_vram_size;
431 } else {
432 rdev->mc.vram_location = 0x00000000UL;
433 rdev->mc.gtt_location = rdev->mc.mc_vram_size;
434 rdev->mc.gtt_size = radeon_gart_size * 1024 * 1024;
435 } 433 }
434 rdev->mc.gtt_location = rdev->mc.mc_vram_size;
436 } 435 }
437 rdev->mc.vram_start = rdev->mc.vram_location; 436 rdev->mc.vram_start = rdev->mc.vram_location;
438 rdev->mc.vram_end = rdev->mc.vram_location + rdev->mc.mc_vram_size - 1; 437 rdev->mc.vram_end = rdev->mc.vram_location + rdev->mc.mc_vram_size - 1;
@@ -859,7 +858,8 @@ void r600_gpu_init(struct radeon_device *rdev)
859 ((rdev->family) == CHIP_RV630) || 858 ((rdev->family) == CHIP_RV630) ||
860 ((rdev->family) == CHIP_RV610) || 859 ((rdev->family) == CHIP_RV610) ||
861 ((rdev->family) == CHIP_RV620) || 860 ((rdev->family) == CHIP_RV620) ||
862 ((rdev->family) == CHIP_RS780)) { 861 ((rdev->family) == CHIP_RS780) ||
862 ((rdev->family) == CHIP_RS880)) {
863 WREG32(DB_DEBUG, PREZ_MUST_WAIT_FOR_POSTZ_DONE); 863 WREG32(DB_DEBUG, PREZ_MUST_WAIT_FOR_POSTZ_DONE);
864 } else { 864 } else {
865 WREG32(DB_DEBUG, 0); 865 WREG32(DB_DEBUG, 0);
@@ -876,7 +876,8 @@ void r600_gpu_init(struct radeon_device *rdev)
876 tmp = RREG32(SQ_MS_FIFO_SIZES); 876 tmp = RREG32(SQ_MS_FIFO_SIZES);
877 if (((rdev->family) == CHIP_RV610) || 877 if (((rdev->family) == CHIP_RV610) ||
878 ((rdev->family) == CHIP_RV620) || 878 ((rdev->family) == CHIP_RV620) ||
879 ((rdev->family) == CHIP_RS780)) { 879 ((rdev->family) == CHIP_RS780) ||
880 ((rdev->family) == CHIP_RS880)) {
880 tmp = (CACHE_FIFO_SIZE(0xa) | 881 tmp = (CACHE_FIFO_SIZE(0xa) |
881 FETCH_FIFO_HIWATER(0xa) | 882 FETCH_FIFO_HIWATER(0xa) |
882 DONE_FIFO_HIWATER(0xe0) | 883 DONE_FIFO_HIWATER(0xe0) |
@@ -919,7 +920,8 @@ void r600_gpu_init(struct radeon_device *rdev)
919 NUM_ES_STACK_ENTRIES(0)); 920 NUM_ES_STACK_ENTRIES(0));
920 } else if (((rdev->family) == CHIP_RV610) || 921 } else if (((rdev->family) == CHIP_RV610) ||
921 ((rdev->family) == CHIP_RV620) || 922 ((rdev->family) == CHIP_RV620) ||
922 ((rdev->family) == CHIP_RS780)) { 923 ((rdev->family) == CHIP_RS780) ||
924 ((rdev->family) == CHIP_RS880)) {
923 /* no vertex cache */ 925 /* no vertex cache */
924 sq_config &= ~VC_ENABLE; 926 sq_config &= ~VC_ENABLE;
925 927
@@ -976,7 +978,8 @@ void r600_gpu_init(struct radeon_device *rdev)
976 978
977 if (((rdev->family) == CHIP_RV610) || 979 if (((rdev->family) == CHIP_RV610) ||
978 ((rdev->family) == CHIP_RV620) || 980 ((rdev->family) == CHIP_RV620) ||
979 ((rdev->family) == CHIP_RS780)) { 981 ((rdev->family) == CHIP_RS780) ||
982 ((rdev->family) == CHIP_RS880)) {
980 WREG32(VGT_CACHE_INVALIDATION, CACHE_INVALIDATION(TC_ONLY)); 983 WREG32(VGT_CACHE_INVALIDATION, CACHE_INVALIDATION(TC_ONLY));
981 } else { 984 } else {
982 WREG32(VGT_CACHE_INVALIDATION, CACHE_INVALIDATION(VC_AND_TC)); 985 WREG32(VGT_CACHE_INVALIDATION, CACHE_INVALIDATION(VC_AND_TC));
@@ -1002,8 +1005,9 @@ void r600_gpu_init(struct radeon_device *rdev)
1002 tmp = rdev->config.r600.max_pipes * 16; 1005 tmp = rdev->config.r600.max_pipes * 16;
1003 switch (rdev->family) { 1006 switch (rdev->family) {
1004 case CHIP_RV610: 1007 case CHIP_RV610:
1005 case CHIP_RS780:
1006 case CHIP_RV620: 1008 case CHIP_RV620:
1009 case CHIP_RS780:
1010 case CHIP_RS880:
1007 tmp += 32; 1011 tmp += 32;
1008 break; 1012 break;
1009 case CHIP_RV670: 1013 case CHIP_RV670:
@@ -1044,8 +1048,9 @@ void r600_gpu_init(struct radeon_device *rdev)
1044 1048
1045 switch (rdev->family) { 1049 switch (rdev->family) {
1046 case CHIP_RV610: 1050 case CHIP_RV610:
1047 case CHIP_RS780:
1048 case CHIP_RV620: 1051 case CHIP_RV620:
1052 case CHIP_RS780:
1053 case CHIP_RS880:
1049 tmp = TC_L2_SIZE(8); 1054 tmp = TC_L2_SIZE(8);
1050 break; 1055 break;
1051 case CHIP_RV630: 1056 case CHIP_RV630:
@@ -1267,19 +1272,17 @@ int r600_cp_resume(struct radeon_device *rdev)
1267 1272
1268 /* Set ring buffer size */ 1273 /* Set ring buffer size */
1269 rb_bufsz = drm_order(rdev->cp.ring_size / 8); 1274 rb_bufsz = drm_order(rdev->cp.ring_size / 8);
1275 tmp = RB_NO_UPDATE | (drm_order(RADEON_GPU_PAGE_SIZE/8) << 8) | rb_bufsz;
1270#ifdef __BIG_ENDIAN 1276#ifdef __BIG_ENDIAN
1271 WREG32(CP_RB_CNTL, BUF_SWAP_32BIT | RB_NO_UPDATE | 1277 tmp |= BUF_SWAP_32BIT;
1272 (drm_order(4096/8) << 8) | rb_bufsz);
1273#else
1274 WREG32(CP_RB_CNTL, RB_NO_UPDATE | (drm_order(4096/8) << 8) | rb_bufsz);
1275#endif 1278#endif
1279 WREG32(CP_RB_CNTL, tmp);
1276 WREG32(CP_SEM_WAIT_TIMER, 0x4); 1280 WREG32(CP_SEM_WAIT_TIMER, 0x4);
1277 1281
1278 /* Set the write pointer delay */ 1282 /* Set the write pointer delay */
1279 WREG32(CP_RB_WPTR_DELAY, 0); 1283 WREG32(CP_RB_WPTR_DELAY, 0);
1280 1284
1281 /* Initialize the ring buffer's read and write pointers */ 1285 /* Initialize the ring buffer's read and write pointers */
1282 tmp = RREG32(CP_RB_CNTL);
1283 WREG32(CP_RB_CNTL, tmp | RB_RPTR_WR_ENA); 1286 WREG32(CP_RB_CNTL, tmp | RB_RPTR_WR_ENA);
1284 WREG32(CP_RB_RPTR_WR, 0); 1287 WREG32(CP_RB_RPTR_WR, 0);
1285 WREG32(CP_RB_WPTR, 0); 1288 WREG32(CP_RB_WPTR, 0);
@@ -1400,7 +1403,7 @@ int r600_wb_enable(struct radeon_device *rdev)
1400 int r; 1403 int r;
1401 1404
1402 if (rdev->wb.wb_obj == NULL) { 1405 if (rdev->wb.wb_obj == NULL) {
1403 r = radeon_object_create(rdev, NULL, 4096, true, 1406 r = radeon_object_create(rdev, NULL, RADEON_GPU_PAGE_SIZE, true,
1404 RADEON_GEM_DOMAIN_GTT, false, &rdev->wb.wb_obj); 1407 RADEON_GEM_DOMAIN_GTT, false, &rdev->wb.wb_obj);
1405 if (r) { 1408 if (r) {
1406 dev_warn(rdev->dev, "failed to create WB buffer (%d).\n", r); 1409 dev_warn(rdev->dev, "failed to create WB buffer (%d).\n", r);
@@ -1450,8 +1453,8 @@ int r600_copy_blit(struct radeon_device *rdev,
1450 uint64_t src_offset, uint64_t dst_offset, 1453 uint64_t src_offset, uint64_t dst_offset,
1451 unsigned num_pages, struct radeon_fence *fence) 1454 unsigned num_pages, struct radeon_fence *fence)
1452{ 1455{
1453 r600_blit_prepare_copy(rdev, num_pages * 4096); 1456 r600_blit_prepare_copy(rdev, num_pages * RADEON_GPU_PAGE_SIZE);
1454 r600_kms_blit_copy(rdev, src_offset, dst_offset, num_pages * 4096); 1457 r600_kms_blit_copy(rdev, src_offset, dst_offset, num_pages * RADEON_GPU_PAGE_SIZE);
1455 r600_blit_done_copy(rdev, fence); 1458 r600_blit_done_copy(rdev, fence);
1456 return 0; 1459 return 0;
1457} 1460}
@@ -1632,10 +1635,13 @@ int r600_init(struct radeon_device *rdev)
1632 r600_scratch_init(rdev); 1635 r600_scratch_init(rdev);
1633 /* Initialize surface registers */ 1636 /* Initialize surface registers */
1634 radeon_surface_init(rdev); 1637 radeon_surface_init(rdev);
1638 /* Initialize clocks */
1635 radeon_get_clock_info(rdev->ddev); 1639 radeon_get_clock_info(rdev->ddev);
1636 r = radeon_clocks_init(rdev); 1640 r = radeon_clocks_init(rdev);
1637 if (r) 1641 if (r)
1638 return r; 1642 return r;
1643 /* Initialize power management */
1644 radeon_pm_init(rdev);
1639 /* Fence driver */ 1645 /* Fence driver */
1640 r = radeon_fence_driver_init(rdev); 1646 r = radeon_fence_driver_init(rdev);
1641 if (r) 1647 if (r)
diff --git a/drivers/gpu/drm/radeon/r600_blit.c b/drivers/gpu/drm/radeon/r600_blit.c
index dec501081608..5ea432347589 100644
--- a/drivers/gpu/drm/radeon/r600_blit.c
+++ b/drivers/gpu/drm/radeon/r600_blit.c
@@ -582,6 +582,8 @@ r600_blit_copy(struct drm_device *dev,
582 u64 vb_addr; 582 u64 vb_addr;
583 u32 *vb; 583 u32 *vb;
584 584
585 vb = r600_nomm_get_vb_ptr(dev);
586
585 if ((size_bytes & 3) || (src_gpu_addr & 3) || (dst_gpu_addr & 3)) { 587 if ((size_bytes & 3) || (src_gpu_addr & 3) || (dst_gpu_addr & 3)) {
586 max_bytes = 8192; 588 max_bytes = 8192;
587 589
@@ -617,8 +619,8 @@ r600_blit_copy(struct drm_device *dev,
617 if (!dev_priv->blit_vb) 619 if (!dev_priv->blit_vb)
618 return; 620 return;
619 set_shaders(dev); 621 set_shaders(dev);
622 vb = r600_nomm_get_vb_ptr(dev);
620 } 623 }
621 vb = r600_nomm_get_vb_ptr(dev);
622 624
623 vb[0] = i2f(dst_x); 625 vb[0] = i2f(dst_x);
624 vb[1] = 0; 626 vb[1] = 0;
@@ -706,8 +708,8 @@ r600_blit_copy(struct drm_device *dev,
706 return; 708 return;
707 709
708 set_shaders(dev); 710 set_shaders(dev);
711 vb = r600_nomm_get_vb_ptr(dev);
709 } 712 }
710 vb = r600_nomm_get_vb_ptr(dev);
711 713
712 vb[0] = i2f(dst_x / 4); 714 vb[0] = i2f(dst_x / 4);
713 vb[1] = 0; 715 vb[1] = 0;
@@ -772,6 +774,7 @@ r600_blit_swap(struct drm_device *dev,
772{ 774{
773 drm_radeon_private_t *dev_priv = dev->dev_private; 775 drm_radeon_private_t *dev_priv = dev->dev_private;
774 int cb_format, tex_format; 776 int cb_format, tex_format;
777 int sx2, sy2, dx2, dy2;
775 u64 vb_addr; 778 u64 vb_addr;
776 u32 *vb; 779 u32 *vb;
777 780
@@ -786,16 +789,10 @@ r600_blit_swap(struct drm_device *dev,
786 } 789 }
787 vb = r600_nomm_get_vb_ptr(dev); 790 vb = r600_nomm_get_vb_ptr(dev);
788 791
789 if (cpp == 4) { 792 sx2 = sx + w;
790 cb_format = COLOR_8_8_8_8; 793 sy2 = sy + h;
791 tex_format = FMT_8_8_8_8; 794 dx2 = dx + w;
792 } else if (cpp == 2) { 795 dy2 = dy + h;
793 cb_format = COLOR_5_6_5;
794 tex_format = FMT_5_6_5;
795 } else {
796 cb_format = COLOR_8;
797 tex_format = FMT_8;
798 }
799 796
800 vb[0] = i2f(dx); 797 vb[0] = i2f(dx);
801 vb[1] = i2f(dy); 798 vb[1] = i2f(dy);
@@ -803,31 +800,46 @@ r600_blit_swap(struct drm_device *dev,
803 vb[3] = i2f(sy); 800 vb[3] = i2f(sy);
804 801
805 vb[4] = i2f(dx); 802 vb[4] = i2f(dx);
806 vb[5] = i2f(dy + h); 803 vb[5] = i2f(dy2);
807 vb[6] = i2f(sx); 804 vb[6] = i2f(sx);
808 vb[7] = i2f(sy + h); 805 vb[7] = i2f(sy2);
806
807 vb[8] = i2f(dx2);
808 vb[9] = i2f(dy2);
809 vb[10] = i2f(sx2);
810 vb[11] = i2f(sy2);
809 811
810 vb[8] = i2f(dx + w); 812 switch(cpp) {
811 vb[9] = i2f(dy + h); 813 case 4:
812 vb[10] = i2f(sx + w); 814 cb_format = COLOR_8_8_8_8;
813 vb[11] = i2f(sy + h); 815 tex_format = FMT_8_8_8_8;
816 break;
817 case 2:
818 cb_format = COLOR_5_6_5;
819 tex_format = FMT_5_6_5;
820 break;
821 default:
822 cb_format = COLOR_8;
823 tex_format = FMT_8;
824 break;
825 }
814 826
815 /* src */ 827 /* src */
816 set_tex_resource(dev_priv, tex_format, 828 set_tex_resource(dev_priv, tex_format,
817 src_pitch / cpp, 829 src_pitch / cpp,
818 sy + h, src_pitch / cpp, 830 sy2, src_pitch / cpp,
819 src_gpu_addr); 831 src_gpu_addr);
820 832
821 cp_set_surface_sync(dev_priv, 833 cp_set_surface_sync(dev_priv,
822 R600_TC_ACTION_ENA, (src_pitch * (sy + h)), src_gpu_addr); 834 R600_TC_ACTION_ENA, src_pitch * sy2, src_gpu_addr);
823 835
824 /* dst */ 836 /* dst */
825 set_render_target(dev_priv, cb_format, 837 set_render_target(dev_priv, cb_format,
826 dst_pitch / cpp, dy + h, 838 dst_pitch / cpp, dy2,
827 dst_gpu_addr); 839 dst_gpu_addr);
828 840
829 /* scissors */ 841 /* scissors */
830 set_scissors(dev_priv, dx, dy, dx + w, dy + h); 842 set_scissors(dev_priv, dx, dy, dx2, dy2);
831 843
832 /* Vertex buffer setup */ 844 /* Vertex buffer setup */
833 vb_addr = dev_priv->gart_buffers_offset + 845 vb_addr = dev_priv->gart_buffers_offset +
@@ -840,7 +852,7 @@ r600_blit_swap(struct drm_device *dev,
840 852
841 cp_set_surface_sync(dev_priv, 853 cp_set_surface_sync(dev_priv,
842 R600_CB_ACTION_ENA | R600_CB0_DEST_BASE_ENA, 854 R600_CB_ACTION_ENA | R600_CB0_DEST_BASE_ENA,
843 dst_pitch * (dy + h), dst_gpu_addr); 855 dst_pitch * dy2, dst_gpu_addr);
844 856
845 dev_priv->blit_vb->used += 12 * 4; 857 dev_priv->blit_vb->used += 12 * 4;
846} 858}
diff --git a/drivers/gpu/drm/radeon/r600_blit_kms.c b/drivers/gpu/drm/radeon/r600_blit_kms.c
index 93108bb31d1d..dbf716e1fbf3 100644
--- a/drivers/gpu/drm/radeon/r600_blit_kms.c
+++ b/drivers/gpu/drm/radeon/r600_blit_kms.c
@@ -368,7 +368,7 @@ set_default_state(struct radeon_device *rdev)
368 if ((rdev->family == CHIP_RV610) || 368 if ((rdev->family == CHIP_RV610) ||
369 (rdev->family == CHIP_RV620) || 369 (rdev->family == CHIP_RV620) ||
370 (rdev->family == CHIP_RS780) || 370 (rdev->family == CHIP_RS780) ||
371 (rdev->family == CHIP_RS780) || 371 (rdev->family == CHIP_RS880) ||
372 (rdev->family == CHIP_RV710)) 372 (rdev->family == CHIP_RV710))
373 sq_config = 0; 373 sq_config = 0;
374 else 374 else
@@ -610,6 +610,7 @@ void r600_kms_blit_copy(struct radeon_device *rdev,
610 610
611 DRM_DEBUG("emitting copy %16llx %16llx %d %d\n", src_gpu_addr, dst_gpu_addr, 611 DRM_DEBUG("emitting copy %16llx %16llx %d %d\n", src_gpu_addr, dst_gpu_addr,
612 size_bytes, rdev->r600_blit.vb_used); 612 size_bytes, rdev->r600_blit.vb_used);
613 vb = (u32 *)(rdev->r600_blit.vb_ib->ptr + rdev->r600_blit.vb_used);
613 if ((size_bytes & 3) || (src_gpu_addr & 3) || (dst_gpu_addr & 3)) { 614 if ((size_bytes & 3) || (src_gpu_addr & 3) || (dst_gpu_addr & 3)) {
614 max_bytes = 8192; 615 max_bytes = 8192;
615 616
@@ -652,7 +653,6 @@ void r600_kms_blit_copy(struct radeon_device *rdev,
652 vb = r600_nomm_get_vb_ptr(dev); 653 vb = r600_nomm_get_vb_ptr(dev);
653#endif 654#endif
654 } 655 }
655 vb = (u32 *)(rdev->r600_blit.vb_ib->ptr + rdev->r600_blit.vb_used);
656 656
657 vb[0] = i2f(dst_x); 657 vb[0] = i2f(dst_x);
658 vb[1] = 0; 658 vb[1] = 0;
@@ -747,7 +747,6 @@ void r600_kms_blit_copy(struct radeon_device *rdev,
747 vb = r600_nomm_get_vb_ptr(dev); 747 vb = r600_nomm_get_vb_ptr(dev);
748 } 748 }
749#endif 749#endif
750 vb = (u32 *)(rdev->r600_blit.vb_ib->ptr + rdev->r600_blit.vb_used);
751 750
752 vb[0] = i2f(dst_x / 4); 751 vb[0] = i2f(dst_x / 4);
753 vb[1] = 0; 752 vb[1] = 0;
diff --git a/drivers/gpu/drm/radeon/r600_cs.c b/drivers/gpu/drm/radeon/r600_cs.c
index 17e42195c632..0d820764f340 100644
--- a/drivers/gpu/drm/radeon/r600_cs.c
+++ b/drivers/gpu/drm/radeon/r600_cs.c
@@ -466,6 +466,23 @@ static int r600_packet3_check(struct radeon_cs_parser *p,
466 for (i = 0; i < pkt->count; i++) { 466 for (i = 0; i < pkt->count; i++) {
467 reg = start_reg + (4 * i); 467 reg = start_reg + (4 * i);
468 switch (reg) { 468 switch (reg) {
469 case SQ_ESGS_RING_BASE:
470 case SQ_GSVS_RING_BASE:
471 case SQ_ESTMP_RING_BASE:
472 case SQ_GSTMP_RING_BASE:
473 case SQ_VSTMP_RING_BASE:
474 case SQ_PSTMP_RING_BASE:
475 case SQ_FBUF_RING_BASE:
476 case SQ_REDUC_RING_BASE:
477 case SX_MEMORY_EXPORT_BASE:
478 r = r600_cs_packet_next_reloc(p, &reloc);
479 if (r) {
480 DRM_ERROR("bad SET_CONFIG_REG "
481 "0x%04X\n", reg);
482 return -EINVAL;
483 }
484 ib[idx+1+i] += (u32)((reloc->lobj.gpu_offset >> 8) & 0xffffffff);
485 break;
469 case CP_COHER_BASE: 486 case CP_COHER_BASE:
470 /* use PACKET3_SURFACE_SYNC */ 487 /* use PACKET3_SURFACE_SYNC */
471 return -EINVAL; 488 return -EINVAL;
@@ -487,6 +504,7 @@ static int r600_packet3_check(struct radeon_cs_parser *p,
487 reg = start_reg + (4 * i); 504 reg = start_reg + (4 * i);
488 switch (reg) { 505 switch (reg) {
489 case DB_DEPTH_BASE: 506 case DB_DEPTH_BASE:
507 case DB_HTILE_DATA_BASE:
490 case CB_COLOR0_BASE: 508 case CB_COLOR0_BASE:
491 case CB_COLOR1_BASE: 509 case CB_COLOR1_BASE:
492 case CB_COLOR2_BASE: 510 case CB_COLOR2_BASE:
diff --git a/drivers/gpu/drm/radeon/r600d.h b/drivers/gpu/drm/radeon/r600d.h
index 9b64d47f1f82..27ab428b149b 100644
--- a/drivers/gpu/drm/radeon/r600d.h
+++ b/drivers/gpu/drm/radeon/r600d.h
@@ -119,6 +119,7 @@
119#define DB_DEBUG 0x9830 119#define DB_DEBUG 0x9830
120#define PREZ_MUST_WAIT_FOR_POSTZ_DONE (1 << 31) 120#define PREZ_MUST_WAIT_FOR_POSTZ_DONE (1 << 31)
121#define DB_DEPTH_BASE 0x2800C 121#define DB_DEPTH_BASE 0x2800C
122#define DB_HTILE_DATA_BASE 0x28014
122#define DB_WATERMARKS 0x9838 123#define DB_WATERMARKS 0x9838
123#define DEPTH_FREE(x) ((x) << 0) 124#define DEPTH_FREE(x) ((x) << 0)
124#define DEPTH_FLUSH(x) ((x) << 5) 125#define DEPTH_FLUSH(x) ((x) << 5)
@@ -171,6 +172,14 @@
171#define SQ_STACK_RESOURCE_MGMT_2 0x8c14 172#define SQ_STACK_RESOURCE_MGMT_2 0x8c14
172# define NUM_GS_STACK_ENTRIES(x) ((x) << 0) 173# define NUM_GS_STACK_ENTRIES(x) ((x) << 0)
173# define NUM_ES_STACK_ENTRIES(x) ((x) << 16) 174# define NUM_ES_STACK_ENTRIES(x) ((x) << 16)
175#define SQ_ESGS_RING_BASE 0x8c40
176#define SQ_GSVS_RING_BASE 0x8c48
177#define SQ_ESTMP_RING_BASE 0x8c50
178#define SQ_GSTMP_RING_BASE 0x8c58
179#define SQ_VSTMP_RING_BASE 0x8c60
180#define SQ_PSTMP_RING_BASE 0x8c68
181#define SQ_FBUF_RING_BASE 0x8c70
182#define SQ_REDUC_RING_BASE 0x8c78
174 183
175#define GRBM_CNTL 0x8000 184#define GRBM_CNTL 0x8000
176# define GRBM_READ_TIMEOUT(x) ((x) << 0) 185# define GRBM_READ_TIMEOUT(x) ((x) << 0)
@@ -271,6 +280,10 @@
271#define PCIE_PORT_INDEX 0x0038 280#define PCIE_PORT_INDEX 0x0038
272#define PCIE_PORT_DATA 0x003C 281#define PCIE_PORT_DATA 0x003C
273 282
283#define CHMAP 0x2004
284#define NOOFCHAN_SHIFT 12
285#define NOOFCHAN_MASK 0x00003000
286
274#define RAMCFG 0x2408 287#define RAMCFG 0x2408
275#define NOOFBANK_SHIFT 0 288#define NOOFBANK_SHIFT 0
276#define NOOFBANK_MASK 0x00000001 289#define NOOFBANK_MASK 0x00000001
@@ -352,6 +365,7 @@
352 365
353 366
354#define SX_MISC 0x28350 367#define SX_MISC 0x28350
368#define SX_MEMORY_EXPORT_BASE 0x9010
355#define SX_DEBUG_1 0x9054 369#define SX_DEBUG_1 0x9054
356#define SMX_EVENT_RELEASE (1 << 0) 370#define SMX_EVENT_RELEASE (1 << 0)
357#define ENABLE_NEW_SMX_ADDRESS (1 << 16) 371#define ENABLE_NEW_SMX_ADDRESS (1 << 16)
diff --git a/drivers/gpu/drm/radeon/radeon.h b/drivers/gpu/drm/radeon/radeon.h
index 5ab35b81c86b..224506a2f7b1 100644
--- a/drivers/gpu/drm/radeon/radeon.h
+++ b/drivers/gpu/drm/radeon/radeon.h
@@ -139,6 +139,10 @@ struct radeon_clock {
139 uint32_t default_sclk; 139 uint32_t default_sclk;
140}; 140};
141 141
142/*
143 * Power management
144 */
145int radeon_pm_init(struct radeon_device *rdev);
142 146
143/* 147/*
144 * Fences. 148 * Fences.
@@ -276,6 +280,8 @@ union radeon_gart_table {
276 struct radeon_gart_table_vram vram; 280 struct radeon_gart_table_vram vram;
277}; 281};
278 282
283#define RADEON_GPU_PAGE_SIZE 4096
284
279struct radeon_gart { 285struct radeon_gart {
280 dma_addr_t table_addr; 286 dma_addr_t table_addr;
281 unsigned num_gpu_pages; 287 unsigned num_gpu_pages;
@@ -513,6 +519,7 @@ typedef int (*radeon_packet3_check_t)(struct radeon_cs_parser *p,
513 * AGP 519 * AGP
514 */ 520 */
515int radeon_agp_init(struct radeon_device *rdev); 521int radeon_agp_init(struct radeon_device *rdev);
522void radeon_agp_resume(struct radeon_device *rdev);
516void radeon_agp_fini(struct radeon_device *rdev); 523void radeon_agp_fini(struct radeon_device *rdev);
517 524
518 525
@@ -621,7 +628,9 @@ struct radeon_asic {
621 uint64_t dst_offset, 628 uint64_t dst_offset,
622 unsigned num_pages, 629 unsigned num_pages,
623 struct radeon_fence *fence); 630 struct radeon_fence *fence);
631 uint32_t (*get_engine_clock)(struct radeon_device *rdev);
624 void (*set_engine_clock)(struct radeon_device *rdev, uint32_t eng_clock); 632 void (*set_engine_clock)(struct radeon_device *rdev, uint32_t eng_clock);
633 uint32_t (*get_memory_clock)(struct radeon_device *rdev);
625 void (*set_memory_clock)(struct radeon_device *rdev, uint32_t mem_clock); 634 void (*set_memory_clock)(struct radeon_device *rdev, uint32_t mem_clock);
626 void (*set_pcie_lanes)(struct radeon_device *rdev, int lanes); 635 void (*set_pcie_lanes)(struct radeon_device *rdev, int lanes);
627 void (*set_clock_gating)(struct radeon_device *rdev, int enable); 636 void (*set_clock_gating)(struct radeon_device *rdev, int enable);
@@ -783,6 +792,7 @@ struct radeon_device {
783 const struct firmware *me_fw; /* all family ME firmware */ 792 const struct firmware *me_fw; /* all family ME firmware */
784 const struct firmware *pfp_fw; /* r6/700 PFP firmware */ 793 const struct firmware *pfp_fw; /* r6/700 PFP firmware */
785 struct r600_blit r600_blit; 794 struct r600_blit r600_blit;
795 int msi_enabled; /* msi enabled */
786}; 796};
787 797
788int radeon_device_init(struct radeon_device *rdev, 798int radeon_device_init(struct radeon_device *rdev,
@@ -952,7 +962,9 @@ static inline void radeon_ring_write(struct radeon_device *rdev, uint32_t v)
952#define radeon_copy_blit(rdev, s, d, np, f) (rdev)->asic->copy_blit((rdev), (s), (d), (np), (f)) 962#define radeon_copy_blit(rdev, s, d, np, f) (rdev)->asic->copy_blit((rdev), (s), (d), (np), (f))
953#define radeon_copy_dma(rdev, s, d, np, f) (rdev)->asic->copy_dma((rdev), (s), (d), (np), (f)) 963#define radeon_copy_dma(rdev, s, d, np, f) (rdev)->asic->copy_dma((rdev), (s), (d), (np), (f))
954#define radeon_copy(rdev, s, d, np, f) (rdev)->asic->copy((rdev), (s), (d), (np), (f)) 964#define radeon_copy(rdev, s, d, np, f) (rdev)->asic->copy((rdev), (s), (d), (np), (f))
965#define radeon_get_engine_clock(rdev) (rdev)->asic->get_engine_clock((rdev))
955#define radeon_set_engine_clock(rdev, e) (rdev)->asic->set_engine_clock((rdev), (e)) 966#define radeon_set_engine_clock(rdev, e) (rdev)->asic->set_engine_clock((rdev), (e))
967#define radeon_get_memory_clock(rdev) (rdev)->asic->get_memory_clock((rdev))
956#define radeon_set_memory_clock(rdev, e) (rdev)->asic->set_engine_clock((rdev), (e)) 968#define radeon_set_memory_clock(rdev, e) (rdev)->asic->set_engine_clock((rdev), (e))
957#define radeon_set_pcie_lanes(rdev, l) (rdev)->asic->set_pcie_lanes((rdev), (l)) 969#define radeon_set_pcie_lanes(rdev, l) (rdev)->asic->set_pcie_lanes((rdev), (l))
958#define radeon_set_clock_gating(rdev, e) (rdev)->asic->set_clock_gating((rdev), (e)) 970#define radeon_set_clock_gating(rdev, e) (rdev)->asic->set_clock_gating((rdev), (e))
diff --git a/drivers/gpu/drm/radeon/radeon_agp.c b/drivers/gpu/drm/radeon/radeon_agp.c
index 23ea9955ac59..54bf49a6d676 100644
--- a/drivers/gpu/drm/radeon/radeon_agp.c
+++ b/drivers/gpu/drm/radeon/radeon_agp.c
@@ -237,6 +237,18 @@ int radeon_agp_init(struct radeon_device *rdev)
237#endif 237#endif
238} 238}
239 239
240void radeon_agp_resume(struct radeon_device *rdev)
241{
242#if __OS_HAS_AGP
243 int r;
244 if (rdev->flags & RADEON_IS_AGP) {
245 r = radeon_agp_init(rdev);
246 if (r)
247 dev_warn(rdev->dev, "radeon AGP reinit failed\n");
248 }
249#endif
250}
251
240void radeon_agp_fini(struct radeon_device *rdev) 252void radeon_agp_fini(struct radeon_device *rdev)
241{ 253{
242#if __OS_HAS_AGP 254#if __OS_HAS_AGP
diff --git a/drivers/gpu/drm/radeon/radeon_asic.h b/drivers/gpu/drm/radeon/radeon_asic.h
index c3532c7a6f3f..c18fbee387d7 100644
--- a/drivers/gpu/drm/radeon/radeon_asic.h
+++ b/drivers/gpu/drm/radeon/radeon_asic.h
@@ -31,10 +31,13 @@
31/* 31/*
32 * common functions 32 * common functions
33 */ 33 */
34uint32_t radeon_legacy_get_engine_clock(struct radeon_device *rdev);
34void radeon_legacy_set_engine_clock(struct radeon_device *rdev, uint32_t eng_clock); 35void radeon_legacy_set_engine_clock(struct radeon_device *rdev, uint32_t eng_clock);
35void radeon_legacy_set_clock_gating(struct radeon_device *rdev, int enable); 36void radeon_legacy_set_clock_gating(struct radeon_device *rdev, int enable);
36 37
38uint32_t radeon_atom_get_engine_clock(struct radeon_device *rdev);
37void radeon_atom_set_engine_clock(struct radeon_device *rdev, uint32_t eng_clock); 39void radeon_atom_set_engine_clock(struct radeon_device *rdev, uint32_t eng_clock);
40uint32_t radeon_atom_get_memory_clock(struct radeon_device *rdev);
38void radeon_atom_set_memory_clock(struct radeon_device *rdev, uint32_t mem_clock); 41void radeon_atom_set_memory_clock(struct radeon_device *rdev, uint32_t mem_clock);
39void radeon_atom_set_clock_gating(struct radeon_device *rdev, int enable); 42void radeon_atom_set_clock_gating(struct radeon_device *rdev, int enable);
40 43
@@ -95,7 +98,9 @@ static struct radeon_asic r100_asic = {
95 .copy_blit = &r100_copy_blit, 98 .copy_blit = &r100_copy_blit,
96 .copy_dma = NULL, 99 .copy_dma = NULL,
97 .copy = &r100_copy_blit, 100 .copy = &r100_copy_blit,
101 .get_engine_clock = &radeon_legacy_get_engine_clock,
98 .set_engine_clock = &radeon_legacy_set_engine_clock, 102 .set_engine_clock = &radeon_legacy_set_engine_clock,
103 .get_memory_clock = NULL,
99 .set_memory_clock = NULL, 104 .set_memory_clock = NULL,
100 .set_pcie_lanes = NULL, 105 .set_pcie_lanes = NULL,
101 .set_clock_gating = &radeon_legacy_set_clock_gating, 106 .set_clock_gating = &radeon_legacy_set_clock_gating,
@@ -148,7 +153,9 @@ static struct radeon_asic r300_asic = {
148 .copy_blit = &r100_copy_blit, 153 .copy_blit = &r100_copy_blit,
149 .copy_dma = &r300_copy_dma, 154 .copy_dma = &r300_copy_dma,
150 .copy = &r100_copy_blit, 155 .copy = &r100_copy_blit,
156 .get_engine_clock = &radeon_legacy_get_engine_clock,
151 .set_engine_clock = &radeon_legacy_set_engine_clock, 157 .set_engine_clock = &radeon_legacy_set_engine_clock,
158 .get_memory_clock = NULL,
152 .set_memory_clock = NULL, 159 .set_memory_clock = NULL,
153 .set_pcie_lanes = &rv370_set_pcie_lanes, 160 .set_pcie_lanes = &rv370_set_pcie_lanes,
154 .set_clock_gating = &radeon_legacy_set_clock_gating, 161 .set_clock_gating = &radeon_legacy_set_clock_gating,
@@ -185,7 +192,9 @@ static struct radeon_asic r420_asic = {
185 .copy_blit = &r100_copy_blit, 192 .copy_blit = &r100_copy_blit,
186 .copy_dma = &r300_copy_dma, 193 .copy_dma = &r300_copy_dma,
187 .copy = &r100_copy_blit, 194 .copy = &r100_copy_blit,
195 .get_engine_clock = &radeon_atom_get_engine_clock,
188 .set_engine_clock = &radeon_atom_set_engine_clock, 196 .set_engine_clock = &radeon_atom_set_engine_clock,
197 .get_memory_clock = &radeon_atom_get_memory_clock,
189 .set_memory_clock = &radeon_atom_set_memory_clock, 198 .set_memory_clock = &radeon_atom_set_memory_clock,
190 .set_pcie_lanes = &rv370_set_pcie_lanes, 199 .set_pcie_lanes = &rv370_set_pcie_lanes,
191 .set_clock_gating = &radeon_atom_set_clock_gating, 200 .set_clock_gating = &radeon_atom_set_clock_gating,
@@ -227,7 +236,9 @@ static struct radeon_asic rs400_asic = {
227 .copy_blit = &r100_copy_blit, 236 .copy_blit = &r100_copy_blit,
228 .copy_dma = &r300_copy_dma, 237 .copy_dma = &r300_copy_dma,
229 .copy = &r100_copy_blit, 238 .copy = &r100_copy_blit,
239 .get_engine_clock = &radeon_legacy_get_engine_clock,
230 .set_engine_clock = &radeon_legacy_set_engine_clock, 240 .set_engine_clock = &radeon_legacy_set_engine_clock,
241 .get_memory_clock = NULL,
231 .set_memory_clock = NULL, 242 .set_memory_clock = NULL,
232 .set_pcie_lanes = NULL, 243 .set_pcie_lanes = NULL,
233 .set_clock_gating = &radeon_legacy_set_clock_gating, 244 .set_clock_gating = &radeon_legacy_set_clock_gating,
@@ -273,7 +284,9 @@ static struct radeon_asic rs600_asic = {
273 .copy_blit = &r100_copy_blit, 284 .copy_blit = &r100_copy_blit,
274 .copy_dma = &r300_copy_dma, 285 .copy_dma = &r300_copy_dma,
275 .copy = &r100_copy_blit, 286 .copy = &r100_copy_blit,
287 .get_engine_clock = &radeon_atom_get_engine_clock,
276 .set_engine_clock = &radeon_atom_set_engine_clock, 288 .set_engine_clock = &radeon_atom_set_engine_clock,
289 .get_memory_clock = &radeon_atom_get_memory_clock,
277 .set_memory_clock = &radeon_atom_set_memory_clock, 290 .set_memory_clock = &radeon_atom_set_memory_clock,
278 .set_pcie_lanes = NULL, 291 .set_pcie_lanes = NULL,
279 .set_clock_gating = &radeon_atom_set_clock_gating, 292 .set_clock_gating = &radeon_atom_set_clock_gating,
@@ -312,7 +325,9 @@ static struct radeon_asic rs690_asic = {
312 .copy_blit = &r100_copy_blit, 325 .copy_blit = &r100_copy_blit,
313 .copy_dma = &r300_copy_dma, 326 .copy_dma = &r300_copy_dma,
314 .copy = &r300_copy_dma, 327 .copy = &r300_copy_dma,
328 .get_engine_clock = &radeon_atom_get_engine_clock,
315 .set_engine_clock = &radeon_atom_set_engine_clock, 329 .set_engine_clock = &radeon_atom_set_engine_clock,
330 .get_memory_clock = &radeon_atom_get_memory_clock,
316 .set_memory_clock = &radeon_atom_set_memory_clock, 331 .set_memory_clock = &radeon_atom_set_memory_clock,
317 .set_pcie_lanes = NULL, 332 .set_pcie_lanes = NULL,
318 .set_clock_gating = &radeon_atom_set_clock_gating, 333 .set_clock_gating = &radeon_atom_set_clock_gating,
@@ -357,7 +372,9 @@ static struct radeon_asic rv515_asic = {
357 .copy_blit = &r100_copy_blit, 372 .copy_blit = &r100_copy_blit,
358 .copy_dma = &r300_copy_dma, 373 .copy_dma = &r300_copy_dma,
359 .copy = &r100_copy_blit, 374 .copy = &r100_copy_blit,
375 .get_engine_clock = &radeon_atom_get_engine_clock,
360 .set_engine_clock = &radeon_atom_set_engine_clock, 376 .set_engine_clock = &radeon_atom_set_engine_clock,
377 .get_memory_clock = &radeon_atom_get_memory_clock,
361 .set_memory_clock = &radeon_atom_set_memory_clock, 378 .set_memory_clock = &radeon_atom_set_memory_clock,
362 .set_pcie_lanes = &rv370_set_pcie_lanes, 379 .set_pcie_lanes = &rv370_set_pcie_lanes,
363 .set_clock_gating = &radeon_atom_set_clock_gating, 380 .set_clock_gating = &radeon_atom_set_clock_gating,
@@ -393,7 +410,9 @@ static struct radeon_asic r520_asic = {
393 .copy_blit = &r100_copy_blit, 410 .copy_blit = &r100_copy_blit,
394 .copy_dma = &r300_copy_dma, 411 .copy_dma = &r300_copy_dma,
395 .copy = &r100_copy_blit, 412 .copy = &r100_copy_blit,
413 .get_engine_clock = &radeon_atom_get_engine_clock,
396 .set_engine_clock = &radeon_atom_set_engine_clock, 414 .set_engine_clock = &radeon_atom_set_engine_clock,
415 .get_memory_clock = &radeon_atom_get_memory_clock,
397 .set_memory_clock = &radeon_atom_set_memory_clock, 416 .set_memory_clock = &radeon_atom_set_memory_clock,
398 .set_pcie_lanes = &rv370_set_pcie_lanes, 417 .set_pcie_lanes = &rv370_set_pcie_lanes,
399 .set_clock_gating = &radeon_atom_set_clock_gating, 418 .set_clock_gating = &radeon_atom_set_clock_gating,
@@ -456,7 +475,9 @@ static struct radeon_asic r600_asic = {
456 .copy_blit = &r600_copy_blit, 475 .copy_blit = &r600_copy_blit,
457 .copy_dma = &r600_copy_blit, 476 .copy_dma = &r600_copy_blit,
458 .copy = &r600_copy_blit, 477 .copy = &r600_copy_blit,
478 .get_engine_clock = &radeon_atom_get_engine_clock,
459 .set_engine_clock = &radeon_atom_set_engine_clock, 479 .set_engine_clock = &radeon_atom_set_engine_clock,
480 .get_memory_clock = &radeon_atom_get_memory_clock,
460 .set_memory_clock = &radeon_atom_set_memory_clock, 481 .set_memory_clock = &radeon_atom_set_memory_clock,
461 .set_pcie_lanes = NULL, 482 .set_pcie_lanes = NULL,
462 .set_clock_gating = &radeon_atom_set_clock_gating, 483 .set_clock_gating = &radeon_atom_set_clock_gating,
@@ -493,7 +514,9 @@ static struct radeon_asic rv770_asic = {
493 .copy_blit = &r600_copy_blit, 514 .copy_blit = &r600_copy_blit,
494 .copy_dma = &r600_copy_blit, 515 .copy_dma = &r600_copy_blit,
495 .copy = &r600_copy_blit, 516 .copy = &r600_copy_blit,
517 .get_engine_clock = &radeon_atom_get_engine_clock,
496 .set_engine_clock = &radeon_atom_set_engine_clock, 518 .set_engine_clock = &radeon_atom_set_engine_clock,
519 .get_memory_clock = &radeon_atom_get_memory_clock,
497 .set_memory_clock = &radeon_atom_set_memory_clock, 520 .set_memory_clock = &radeon_atom_set_memory_clock,
498 .set_pcie_lanes = NULL, 521 .set_pcie_lanes = NULL,
499 .set_clock_gating = &radeon_atom_set_clock_gating, 522 .set_clock_gating = &radeon_atom_set_clock_gating,
diff --git a/drivers/gpu/drm/radeon/radeon_atombios.c b/drivers/gpu/drm/radeon/radeon_atombios.c
index 5b6c08cee40e..2ed88a820935 100644
--- a/drivers/gpu/drm/radeon/radeon_atombios.c
+++ b/drivers/gpu/drm/radeon/radeon_atombios.c
@@ -46,7 +46,8 @@ radeon_add_atom_connector(struct drm_device *dev,
46 uint32_t supported_device, 46 uint32_t supported_device,
47 int connector_type, 47 int connector_type,
48 struct radeon_i2c_bus_rec *i2c_bus, 48 struct radeon_i2c_bus_rec *i2c_bus,
49 bool linkb, uint32_t igp_lane_info); 49 bool linkb, uint32_t igp_lane_info,
50 uint16_t connector_object_id);
50 51
51/* from radeon_legacy_encoder.c */ 52/* from radeon_legacy_encoder.c */
52extern void 53extern void
@@ -193,6 +194,23 @@ const int supported_devices_connector_convert[] = {
193 DRM_MODE_CONNECTOR_DisplayPort 194 DRM_MODE_CONNECTOR_DisplayPort
194}; 195};
195 196
197const uint16_t supported_devices_connector_object_id_convert[] = {
198 CONNECTOR_OBJECT_ID_NONE,
199 CONNECTOR_OBJECT_ID_VGA,
200 CONNECTOR_OBJECT_ID_DUAL_LINK_DVI_I, /* not all boards support DL */
201 CONNECTOR_OBJECT_ID_DUAL_LINK_DVI_D, /* not all boards support DL */
202 CONNECTOR_OBJECT_ID_VGA, /* technically DVI-A */
203 CONNECTOR_OBJECT_ID_COMPOSITE,
204 CONNECTOR_OBJECT_ID_SVIDEO,
205 CONNECTOR_OBJECT_ID_LVDS,
206 CONNECTOR_OBJECT_ID_9PIN_DIN,
207 CONNECTOR_OBJECT_ID_9PIN_DIN,
208 CONNECTOR_OBJECT_ID_DISPLAYPORT,
209 CONNECTOR_OBJECT_ID_HDMI_TYPE_A,
210 CONNECTOR_OBJECT_ID_HDMI_TYPE_B,
211 CONNECTOR_OBJECT_ID_SVIDEO
212};
213
196const int object_connector_convert[] = { 214const int object_connector_convert[] = {
197 DRM_MODE_CONNECTOR_Unknown, 215 DRM_MODE_CONNECTOR_Unknown,
198 DRM_MODE_CONNECTOR_DVII, 216 DRM_MODE_CONNECTOR_DVII,
@@ -229,7 +247,7 @@ bool radeon_get_atom_connector_info_from_object_table(struct drm_device *dev)
229 ATOM_OBJECT_HEADER *obj_header; 247 ATOM_OBJECT_HEADER *obj_header;
230 int i, j, path_size, device_support; 248 int i, j, path_size, device_support;
231 int connector_type; 249 int connector_type;
232 uint16_t igp_lane_info, conn_id; 250 uint16_t igp_lane_info, conn_id, connector_object_id;
233 bool linkb; 251 bool linkb;
234 struct radeon_i2c_bus_rec ddc_bus; 252 struct radeon_i2c_bus_rec ddc_bus;
235 253
@@ -277,7 +295,8 @@ bool radeon_get_atom_connector_info_from_object_table(struct drm_device *dev)
277 ATOM_DEVICE_CV_SUPPORT) 295 ATOM_DEVICE_CV_SUPPORT)
278 continue; 296 continue;
279 297
280 if ((rdev->family == CHIP_RS780) && 298 /* IGP chips */
299 if ((rdev->flags & RADEON_IS_IGP) &&
281 (con_obj_id == 300 (con_obj_id ==
282 CONNECTOR_OBJECT_ID_PCIE_CONNECTOR)) { 301 CONNECTOR_OBJECT_ID_PCIE_CONNECTOR)) {
283 uint16_t igp_offset = 0; 302 uint16_t igp_offset = 0;
@@ -311,6 +330,7 @@ bool radeon_get_atom_connector_info_from_object_table(struct drm_device *dev)
311 connector_type = 330 connector_type =
312 object_connector_convert 331 object_connector_convert
313 [ct]; 332 [ct];
333 connector_object_id = ct;
314 igp_lane_info = 334 igp_lane_info =
315 slot_config & 0xffff; 335 slot_config & 0xffff;
316 } else 336 } else
@@ -321,6 +341,7 @@ bool radeon_get_atom_connector_info_from_object_table(struct drm_device *dev)
321 igp_lane_info = 0; 341 igp_lane_info = 0;
322 connector_type = 342 connector_type =
323 object_connector_convert[con_obj_id]; 343 object_connector_convert[con_obj_id];
344 connector_object_id = con_obj_id;
324 } 345 }
325 346
326 if (connector_type == DRM_MODE_CONNECTOR_Unknown) 347 if (connector_type == DRM_MODE_CONNECTOR_Unknown)
@@ -425,7 +446,8 @@ bool radeon_get_atom_connector_info_from_object_table(struct drm_device *dev)
425 le16_to_cpu(path-> 446 le16_to_cpu(path->
426 usDeviceTag), 447 usDeviceTag),
427 connector_type, &ddc_bus, 448 connector_type, &ddc_bus,
428 linkb, igp_lane_info); 449 linkb, igp_lane_info,
450 connector_object_id);
429 451
430 } 452 }
431 } 453 }
@@ -435,6 +457,45 @@ bool radeon_get_atom_connector_info_from_object_table(struct drm_device *dev)
435 return true; 457 return true;
436} 458}
437 459
460static uint16_t atombios_get_connector_object_id(struct drm_device *dev,
461 int connector_type,
462 uint16_t devices)
463{
464 struct radeon_device *rdev = dev->dev_private;
465
466 if (rdev->flags & RADEON_IS_IGP) {
467 return supported_devices_connector_object_id_convert
468 [connector_type];
469 } else if (((connector_type == DRM_MODE_CONNECTOR_DVII) ||
470 (connector_type == DRM_MODE_CONNECTOR_DVID)) &&
471 (devices & ATOM_DEVICE_DFP2_SUPPORT)) {
472 struct radeon_mode_info *mode_info = &rdev->mode_info;
473 struct atom_context *ctx = mode_info->atom_context;
474 int index = GetIndexIntoMasterTable(DATA, XTMDS_Info);
475 uint16_t size, data_offset;
476 uint8_t frev, crev;
477 ATOM_XTMDS_INFO *xtmds;
478
479 atom_parse_data_header(ctx, index, &size, &frev, &crev, &data_offset);
480 xtmds = (ATOM_XTMDS_INFO *)(ctx->bios + data_offset);
481
482 if (xtmds->ucSupportedLink & ATOM_XTMDS_SUPPORTED_DUALLINK) {
483 if (connector_type == DRM_MODE_CONNECTOR_DVII)
484 return CONNECTOR_OBJECT_ID_DUAL_LINK_DVI_I;
485 else
486 return CONNECTOR_OBJECT_ID_DUAL_LINK_DVI_D;
487 } else {
488 if (connector_type == DRM_MODE_CONNECTOR_DVII)
489 return CONNECTOR_OBJECT_ID_SINGLE_LINK_DVI_I;
490 else
491 return CONNECTOR_OBJECT_ID_SINGLE_LINK_DVI_D;
492 }
493 } else {
494 return supported_devices_connector_object_id_convert
495 [connector_type];
496 }
497}
498
438struct bios_connector { 499struct bios_connector {
439 bool valid; 500 bool valid;
440 uint16_t line_mux; 501 uint16_t line_mux;
@@ -593,14 +654,20 @@ bool radeon_get_atom_connector_info_from_supported_devices_table(struct
593 654
594 /* add the connectors */ 655 /* add the connectors */
595 for (i = 0; i < ATOM_MAX_SUPPORTED_DEVICE; i++) { 656 for (i = 0; i < ATOM_MAX_SUPPORTED_DEVICE; i++) {
596 if (bios_connectors[i].valid) 657 if (bios_connectors[i].valid) {
658 uint16_t connector_object_id =
659 atombios_get_connector_object_id(dev,
660 bios_connectors[i].connector_type,
661 bios_connectors[i].devices);
597 radeon_add_atom_connector(dev, 662 radeon_add_atom_connector(dev,
598 bios_connectors[i].line_mux, 663 bios_connectors[i].line_mux,
599 bios_connectors[i].devices, 664 bios_connectors[i].devices,
600 bios_connectors[i]. 665 bios_connectors[i].
601 connector_type, 666 connector_type,
602 &bios_connectors[i].ddc_bus, 667 &bios_connectors[i].ddc_bus,
603 false, 0); 668 false, 0,
669 connector_object_id);
670 }
604 } 671 }
605 672
606 radeon_link_encoder_connector(dev); 673 radeon_link_encoder_connector(dev);
@@ -641,8 +708,12 @@ bool radeon_atom_get_clock_info(struct drm_device *dev)
641 le16_to_cpu(firmware_info->info.usReferenceClock); 708 le16_to_cpu(firmware_info->info.usReferenceClock);
642 p1pll->reference_div = 0; 709 p1pll->reference_div = 0;
643 710
644 p1pll->pll_out_min = 711 if (crev < 2)
645 le16_to_cpu(firmware_info->info.usMinPixelClockPLL_Output); 712 p1pll->pll_out_min =
713 le16_to_cpu(firmware_info->info.usMinPixelClockPLL_Output);
714 else
715 p1pll->pll_out_min =
716 le32_to_cpu(firmware_info->info_12.ulMinPixelClockPLL_Output);
646 p1pll->pll_out_max = 717 p1pll->pll_out_max =
647 le32_to_cpu(firmware_info->info.ulMaxPixelClockPLL_Output); 718 le32_to_cpu(firmware_info->info.ulMaxPixelClockPLL_Output);
648 719
@@ -651,6 +722,16 @@ bool radeon_atom_get_clock_info(struct drm_device *dev)
651 p1pll->pll_out_min = 64800; 722 p1pll->pll_out_min = 64800;
652 else 723 else
653 p1pll->pll_out_min = 20000; 724 p1pll->pll_out_min = 20000;
725 } else if (p1pll->pll_out_min > 64800) {
726 /* Limiting the pll output range is a good thing generally as
727 * it limits the number of possible pll combinations for a given
728 * frequency presumably to the ones that work best on each card.
729 * However, certain duallink DVI monitors seem to like
730 * pll combinations that would be limited by this at least on
731 * pre-DCE 3.0 r6xx hardware. This might need to be adjusted per
732 * family.
733 */
734 p1pll->pll_out_min = 64800;
654 } 735 }
655 736
656 p1pll->pll_in_min = 737 p1pll->pll_in_min =
@@ -767,6 +848,46 @@ bool radeon_atombios_get_tmds_info(struct radeon_encoder *encoder,
767 return false; 848 return false;
768} 849}
769 850
851static struct radeon_atom_ss *radeon_atombios_get_ss_info(struct
852 radeon_encoder
853 *encoder,
854 int id)
855{
856 struct drm_device *dev = encoder->base.dev;
857 struct radeon_device *rdev = dev->dev_private;
858 struct radeon_mode_info *mode_info = &rdev->mode_info;
859 int index = GetIndexIntoMasterTable(DATA, PPLL_SS_Info);
860 uint16_t data_offset;
861 struct _ATOM_SPREAD_SPECTRUM_INFO *ss_info;
862 uint8_t frev, crev;
863 struct radeon_atom_ss *ss = NULL;
864
865 if (id > ATOM_MAX_SS_ENTRY)
866 return NULL;
867
868 atom_parse_data_header(mode_info->atom_context, index, NULL, &frev,
869 &crev, &data_offset);
870
871 ss_info =
872 (struct _ATOM_SPREAD_SPECTRUM_INFO *)(mode_info->atom_context->bios + data_offset);
873
874 if (ss_info) {
875 ss =
876 kzalloc(sizeof(struct radeon_atom_ss), GFP_KERNEL);
877
878 if (!ss)
879 return NULL;
880
881 ss->percentage = le16_to_cpu(ss_info->asSS_Info[id].usSpreadSpectrumPercentage);
882 ss->type = ss_info->asSS_Info[id].ucSpreadSpectrumType;
883 ss->step = ss_info->asSS_Info[id].ucSS_Step;
884 ss->delay = ss_info->asSS_Info[id].ucSS_Delay;
885 ss->range = ss_info->asSS_Info[id].ucSS_Range;
886 ss->refdiv = ss_info->asSS_Info[id].ucRecommendedRef_Div;
887 }
888 return ss;
889}
890
770union lvds_info { 891union lvds_info {
771 struct _ATOM_LVDS_INFO info; 892 struct _ATOM_LVDS_INFO info;
772 struct _ATOM_LVDS_INFO_V12 info_12; 893 struct _ATOM_LVDS_INFO_V12 info_12;
@@ -798,27 +919,31 @@ struct radeon_encoder_atom_dig *radeon_atombios_get_lvds_info(struct
798 if (!lvds) 919 if (!lvds)
799 return NULL; 920 return NULL;
800 921
801 lvds->native_mode.dotclock = 922 lvds->native_mode.clock =
802 le16_to_cpu(lvds_info->info.sLCDTiming.usPixClk) * 10; 923 le16_to_cpu(lvds_info->info.sLCDTiming.usPixClk) * 10;
803 lvds->native_mode.panel_xres = 924 lvds->native_mode.hdisplay =
804 le16_to_cpu(lvds_info->info.sLCDTiming.usHActive); 925 le16_to_cpu(lvds_info->info.sLCDTiming.usHActive);
805 lvds->native_mode.panel_yres = 926 lvds->native_mode.vdisplay =
806 le16_to_cpu(lvds_info->info.sLCDTiming.usVActive); 927 le16_to_cpu(lvds_info->info.sLCDTiming.usVActive);
807 lvds->native_mode.hblank = 928 lvds->native_mode.htotal = lvds->native_mode.hdisplay +
808 le16_to_cpu(lvds_info->info.sLCDTiming.usHBlanking_Time); 929 le16_to_cpu(lvds_info->info.sLCDTiming.usHBlanking_Time);
809 lvds->native_mode.hoverplus = 930 lvds->native_mode.hsync_start = lvds->native_mode.hdisplay +
810 le16_to_cpu(lvds_info->info.sLCDTiming.usHSyncOffset); 931 le16_to_cpu(lvds_info->info.sLCDTiming.usHSyncOffset);
811 lvds->native_mode.hsync_width = 932 lvds->native_mode.hsync_end = lvds->native_mode.hsync_start +
812 le16_to_cpu(lvds_info->info.sLCDTiming.usHSyncWidth); 933 le16_to_cpu(lvds_info->info.sLCDTiming.usHSyncWidth);
813 lvds->native_mode.vblank = 934 lvds->native_mode.vtotal = lvds->native_mode.vdisplay +
814 le16_to_cpu(lvds_info->info.sLCDTiming.usVBlanking_Time); 935 le16_to_cpu(lvds_info->info.sLCDTiming.usVBlanking_Time);
815 lvds->native_mode.voverplus = 936 lvds->native_mode.vsync_start = lvds->native_mode.vdisplay +
816 le16_to_cpu(lvds_info->info.sLCDTiming.usVSyncOffset); 937 le16_to_cpu(lvds_info->info.sLCDTiming.usVSyncWidth);
817 lvds->native_mode.vsync_width = 938 lvds->native_mode.vsync_end = lvds->native_mode.vsync_start +
818 le16_to_cpu(lvds_info->info.sLCDTiming.usVSyncWidth); 939 le16_to_cpu(lvds_info->info.sLCDTiming.usVSyncWidth);
819 lvds->panel_pwr_delay = 940 lvds->panel_pwr_delay =
820 le16_to_cpu(lvds_info->info.usOffDelayInMs); 941 le16_to_cpu(lvds_info->info.usOffDelayInMs);
821 lvds->lvds_misc = lvds_info->info.ucLVDS_Misc; 942 lvds->lvds_misc = lvds_info->info.ucLVDS_Misc;
943 /* set crtc values */
944 drm_mode_set_crtcinfo(&lvds->native_mode, CRTC_INTERLACE_HALVE_V);
945
946 lvds->ss = radeon_atombios_get_ss_info(encoder, lvds_info->info.ucSS_Id);
822 947
823 encoder->native_mode = lvds->native_mode; 948 encoder->native_mode = lvds->native_mode;
824 } 949 }
@@ -857,8 +982,7 @@ radeon_atombios_get_primary_dac_info(struct radeon_encoder *encoder)
857} 982}
858 983
859bool radeon_atom_get_tv_timings(struct radeon_device *rdev, int index, 984bool radeon_atom_get_tv_timings(struct radeon_device *rdev, int index,
860 SET_CRTC_TIMING_PARAMETERS_PS_ALLOCATION *crtc_timing, 985 struct drm_display_mode *mode)
861 int32_t *pixel_clock)
862{ 986{
863 struct radeon_mode_info *mode_info = &rdev->mode_info; 987 struct radeon_mode_info *mode_info = &rdev->mode_info;
864 ATOM_ANALOG_TV_INFO *tv_info; 988 ATOM_ANALOG_TV_INFO *tv_info;
@@ -866,7 +990,7 @@ bool radeon_atom_get_tv_timings(struct radeon_device *rdev, int index,
866 ATOM_DTD_FORMAT *dtd_timings; 990 ATOM_DTD_FORMAT *dtd_timings;
867 int data_index = GetIndexIntoMasterTable(DATA, AnalogTV_Info); 991 int data_index = GetIndexIntoMasterTable(DATA, AnalogTV_Info);
868 u8 frev, crev; 992 u8 frev, crev;
869 uint16_t data_offset; 993 u16 data_offset, misc;
870 994
871 atom_parse_data_header(mode_info->atom_context, data_index, NULL, &frev, &crev, &data_offset); 995 atom_parse_data_header(mode_info->atom_context, data_index, NULL, &frev, &crev, &data_offset);
872 996
@@ -876,28 +1000,37 @@ bool radeon_atom_get_tv_timings(struct radeon_device *rdev, int index,
876 if (index > MAX_SUPPORTED_TV_TIMING) 1000 if (index > MAX_SUPPORTED_TV_TIMING)
877 return false; 1001 return false;
878 1002
879 crtc_timing->usH_Total = le16_to_cpu(tv_info->aModeTimings[index].usCRTC_H_Total); 1003 mode->crtc_htotal = le16_to_cpu(tv_info->aModeTimings[index].usCRTC_H_Total);
880 crtc_timing->usH_Disp = le16_to_cpu(tv_info->aModeTimings[index].usCRTC_H_Disp); 1004 mode->crtc_hdisplay = le16_to_cpu(tv_info->aModeTimings[index].usCRTC_H_Disp);
881 crtc_timing->usH_SyncStart = le16_to_cpu(tv_info->aModeTimings[index].usCRTC_H_SyncStart); 1005 mode->crtc_hsync_start = le16_to_cpu(tv_info->aModeTimings[index].usCRTC_H_SyncStart);
882 crtc_timing->usH_SyncWidth = le16_to_cpu(tv_info->aModeTimings[index].usCRTC_H_SyncWidth); 1006 mode->crtc_hsync_end = le16_to_cpu(tv_info->aModeTimings[index].usCRTC_H_SyncStart) +
883 1007 le16_to_cpu(tv_info->aModeTimings[index].usCRTC_H_SyncWidth);
884 crtc_timing->usV_Total = le16_to_cpu(tv_info->aModeTimings[index].usCRTC_V_Total); 1008
885 crtc_timing->usV_Disp = le16_to_cpu(tv_info->aModeTimings[index].usCRTC_V_Disp); 1009 mode->crtc_vtotal = le16_to_cpu(tv_info->aModeTimings[index].usCRTC_V_Total);
886 crtc_timing->usV_SyncStart = le16_to_cpu(tv_info->aModeTimings[index].usCRTC_V_SyncStart); 1010 mode->crtc_vdisplay = le16_to_cpu(tv_info->aModeTimings[index].usCRTC_V_Disp);
887 crtc_timing->usV_SyncWidth = le16_to_cpu(tv_info->aModeTimings[index].usCRTC_V_SyncWidth); 1011 mode->crtc_vsync_start = le16_to_cpu(tv_info->aModeTimings[index].usCRTC_V_SyncStart);
888 1012 mode->crtc_vsync_end = le16_to_cpu(tv_info->aModeTimings[index].usCRTC_V_SyncStart) +
889 crtc_timing->susModeMiscInfo = tv_info->aModeTimings[index].susModeMiscInfo; 1013 le16_to_cpu(tv_info->aModeTimings[index].usCRTC_V_SyncWidth);
890 1014
891 crtc_timing->ucOverscanRight = le16_to_cpu(tv_info->aModeTimings[index].usCRTC_OverscanRight); 1015 mode->flags = 0;
892 crtc_timing->ucOverscanLeft = le16_to_cpu(tv_info->aModeTimings[index].usCRTC_OverscanLeft); 1016 misc = le16_to_cpu(tv_info->aModeTimings[index].susModeMiscInfo.usAccess);
893 crtc_timing->ucOverscanBottom = le16_to_cpu(tv_info->aModeTimings[index].usCRTC_OverscanBottom); 1017 if (misc & ATOM_VSYNC_POLARITY)
894 crtc_timing->ucOverscanTop = le16_to_cpu(tv_info->aModeTimings[index].usCRTC_OverscanTop); 1018 mode->flags |= DRM_MODE_FLAG_NVSYNC;
895 *pixel_clock = le16_to_cpu(tv_info->aModeTimings[index].usPixelClock) * 10; 1019 if (misc & ATOM_HSYNC_POLARITY)
1020 mode->flags |= DRM_MODE_FLAG_NHSYNC;
1021 if (misc & ATOM_COMPOSITESYNC)
1022 mode->flags |= DRM_MODE_FLAG_CSYNC;
1023 if (misc & ATOM_INTERLACE)
1024 mode->flags |= DRM_MODE_FLAG_INTERLACE;
1025 if (misc & ATOM_DOUBLE_CLOCK_MODE)
1026 mode->flags |= DRM_MODE_FLAG_DBLSCAN;
1027
1028 mode->clock = le16_to_cpu(tv_info->aModeTimings[index].usPixelClock) * 10;
896 1029
897 if (index == 1) { 1030 if (index == 1) {
898 /* PAL timings appear to have wrong values for totals */ 1031 /* PAL timings appear to have wrong values for totals */
899 crtc_timing->usH_Total -= 1; 1032 mode->crtc_htotal -= 1;
900 crtc_timing->usV_Total -= 1; 1033 mode->crtc_vtotal -= 1;
901 } 1034 }
902 break; 1035 break;
903 case 2: 1036 case 2:
@@ -906,17 +1039,36 @@ bool radeon_atom_get_tv_timings(struct radeon_device *rdev, int index,
906 return false; 1039 return false;
907 1040
908 dtd_timings = &tv_info_v1_2->aModeTimings[index]; 1041 dtd_timings = &tv_info_v1_2->aModeTimings[index];
909 crtc_timing->usH_Total = le16_to_cpu(dtd_timings->usHActive) + le16_to_cpu(dtd_timings->usHBlanking_Time); 1042 mode->crtc_htotal = le16_to_cpu(dtd_timings->usHActive) +
910 crtc_timing->usH_Disp = le16_to_cpu(dtd_timings->usHActive); 1043 le16_to_cpu(dtd_timings->usHBlanking_Time);
911 crtc_timing->usH_SyncStart = le16_to_cpu(dtd_timings->usHActive) + le16_to_cpu(dtd_timings->usHSyncOffset); 1044 mode->crtc_hdisplay = le16_to_cpu(dtd_timings->usHActive);
912 crtc_timing->usH_SyncWidth = le16_to_cpu(dtd_timings->usHSyncWidth); 1045 mode->crtc_hsync_start = le16_to_cpu(dtd_timings->usHActive) +
913 crtc_timing->usV_Total = le16_to_cpu(dtd_timings->usVActive) + le16_to_cpu(dtd_timings->usVBlanking_Time); 1046 le16_to_cpu(dtd_timings->usHSyncOffset);
914 crtc_timing->usV_Disp = le16_to_cpu(dtd_timings->usVActive); 1047 mode->crtc_hsync_end = mode->crtc_hsync_start +
915 crtc_timing->usV_SyncStart = le16_to_cpu(dtd_timings->usVActive) + le16_to_cpu(dtd_timings->usVSyncOffset); 1048 le16_to_cpu(dtd_timings->usHSyncWidth);
916 crtc_timing->usV_SyncWidth = le16_to_cpu(dtd_timings->usVSyncWidth); 1049
917 1050 mode->crtc_vtotal = le16_to_cpu(dtd_timings->usVActive) +
918 crtc_timing->susModeMiscInfo.usAccess = le16_to_cpu(dtd_timings->susModeMiscInfo.usAccess); 1051 le16_to_cpu(dtd_timings->usVBlanking_Time);
919 *pixel_clock = le16_to_cpu(dtd_timings->usPixClk) * 10; 1052 mode->crtc_vdisplay = le16_to_cpu(dtd_timings->usVActive);
1053 mode->crtc_vsync_start = le16_to_cpu(dtd_timings->usVActive) +
1054 le16_to_cpu(dtd_timings->usVSyncOffset);
1055 mode->crtc_vsync_end = mode->crtc_vsync_start +
1056 le16_to_cpu(dtd_timings->usVSyncWidth);
1057
1058 mode->flags = 0;
1059 misc = le16_to_cpu(dtd_timings->susModeMiscInfo.usAccess);
1060 if (misc & ATOM_VSYNC_POLARITY)
1061 mode->flags |= DRM_MODE_FLAG_NVSYNC;
1062 if (misc & ATOM_HSYNC_POLARITY)
1063 mode->flags |= DRM_MODE_FLAG_NHSYNC;
1064 if (misc & ATOM_COMPOSITESYNC)
1065 mode->flags |= DRM_MODE_FLAG_CSYNC;
1066 if (misc & ATOM_INTERLACE)
1067 mode->flags |= DRM_MODE_FLAG_INTERLACE;
1068 if (misc & ATOM_DOUBLE_CLOCK_MODE)
1069 mode->flags |= DRM_MODE_FLAG_DBLSCAN;
1070
1071 mode->clock = le16_to_cpu(dtd_timings->usPixClk) * 10;
920 break; 1072 break;
921 } 1073 }
922 return true; 1074 return true;
@@ -981,6 +1133,24 @@ void radeon_atom_static_pwrmgt_setup(struct radeon_device *rdev, int enable)
981 atom_execute_table(rdev->mode_info.atom_context, index, (uint32_t *)&args); 1133 atom_execute_table(rdev->mode_info.atom_context, index, (uint32_t *)&args);
982} 1134}
983 1135
1136uint32_t radeon_atom_get_engine_clock(struct radeon_device *rdev)
1137{
1138 GET_ENGINE_CLOCK_PS_ALLOCATION args;
1139 int index = GetIndexIntoMasterTable(COMMAND, GetEngineClock);
1140
1141 atom_execute_table(rdev->mode_info.atom_context, index, (uint32_t *)&args);
1142 return args.ulReturnEngineClock;
1143}
1144
1145uint32_t radeon_atom_get_memory_clock(struct radeon_device *rdev)
1146{
1147 GET_MEMORY_CLOCK_PS_ALLOCATION args;
1148 int index = GetIndexIntoMasterTable(COMMAND, GetMemoryClock);
1149
1150 atom_execute_table(rdev->mode_info.atom_context, index, (uint32_t *)&args);
1151 return args.ulReturnMemoryClock;
1152}
1153
984void radeon_atom_set_engine_clock(struct radeon_device *rdev, 1154void radeon_atom_set_engine_clock(struct radeon_device *rdev,
985 uint32_t eng_clock) 1155 uint32_t eng_clock)
986{ 1156{
diff --git a/drivers/gpu/drm/radeon/radeon_benchmark.c b/drivers/gpu/drm/radeon/radeon_benchmark.c
index 2e938f7496fb..10bd50a7db87 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 / 4096, fence); 66 r = radeon_copy_dma(rdev, saddr, daddr, size / RADEON_GPU_PAGE_SIZE, 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 / 4096, fence); 91 r = radeon_copy_blit(rdev, saddr, daddr, size / RADEON_GPU_PAGE_SIZE, 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_bios.c b/drivers/gpu/drm/radeon/radeon_bios.c
index 34a9b9119518..906921740c60 100644
--- a/drivers/gpu/drm/radeon/radeon_bios.c
+++ b/drivers/gpu/drm/radeon/radeon_bios.c
@@ -50,19 +50,16 @@ static bool igp_read_bios_from_vram(struct radeon_device *rdev)
50 vram_base = drm_get_resource_start(rdev->ddev, 0); 50 vram_base = drm_get_resource_start(rdev->ddev, 0);
51 bios = ioremap(vram_base, size); 51 bios = ioremap(vram_base, size);
52 if (!bios) { 52 if (!bios) {
53 DRM_ERROR("Unable to mmap vram\n");
54 return false; 53 return false;
55 } 54 }
56 55
57 if (size == 0 || bios[0] != 0x55 || bios[1] != 0xaa) { 56 if (size == 0 || bios[0] != 0x55 || bios[1] != 0xaa) {
58 iounmap(bios); 57 iounmap(bios);
59 DRM_ERROR("bad rom signature\n");
60 return false; 58 return false;
61 } 59 }
62 rdev->bios = kmalloc(size, GFP_KERNEL); 60 rdev->bios = kmalloc(size, GFP_KERNEL);
63 if (rdev->bios == NULL) { 61 if (rdev->bios == NULL) {
64 iounmap(bios); 62 iounmap(bios);
65 DRM_ERROR("kmalloc failed\n");
66 return false; 63 return false;
67 } 64 }
68 memcpy(rdev->bios, bios, size); 65 memcpy(rdev->bios, bios, size);
diff --git a/drivers/gpu/drm/radeon/radeon_clocks.c b/drivers/gpu/drm/radeon/radeon_clocks.c
index f5c32a766b10..a81354167621 100644
--- a/drivers/gpu/drm/radeon/radeon_clocks.c
+++ b/drivers/gpu/drm/radeon/radeon_clocks.c
@@ -32,7 +32,7 @@
32#include "atom.h" 32#include "atom.h"
33 33
34/* 10 khz */ 34/* 10 khz */
35static uint32_t radeon_legacy_get_engine_clock(struct radeon_device *rdev) 35uint32_t radeon_legacy_get_engine_clock(struct radeon_device *rdev)
36{ 36{
37 struct radeon_pll *spll = &rdev->clock.spll; 37 struct radeon_pll *spll = &rdev->clock.spll;
38 uint32_t fb_div, ref_div, post_div, sclk; 38 uint32_t fb_div, ref_div, post_div, sclk;
diff --git a/drivers/gpu/drm/radeon/radeon_combios.c b/drivers/gpu/drm/radeon/radeon_combios.c
index 748265a105b3..5253cbf6db1f 100644
--- a/drivers/gpu/drm/radeon/radeon_combios.c
+++ b/drivers/gpu/drm/radeon/radeon_combios.c
@@ -49,7 +49,8 @@ radeon_add_legacy_connector(struct drm_device *dev,
49 uint32_t connector_id, 49 uint32_t connector_id,
50 uint32_t supported_device, 50 uint32_t supported_device,
51 int connector_type, 51 int connector_type,
52 struct radeon_i2c_bus_rec *i2c_bus); 52 struct radeon_i2c_bus_rec *i2c_bus,
53 uint16_t connector_object_id);
53 54
54/* from radeon_legacy_encoder.c */ 55/* from radeon_legacy_encoder.c */
55extern void 56extern void
@@ -808,25 +809,25 @@ static struct radeon_encoder_lvds *radeon_legacy_get_lvds_info_from_regs(struct
808 lvds->panel_blon_delay = (lvds_ss_gen_cntl >> RADEON_LVDS_PWRSEQ_DELAY2_SHIFT) & 0xf; 809 lvds->panel_blon_delay = (lvds_ss_gen_cntl >> RADEON_LVDS_PWRSEQ_DELAY2_SHIFT) & 0xf;
809 810
810 if (fp_vert_stretch & RADEON_VERT_STRETCH_ENABLE) 811 if (fp_vert_stretch & RADEON_VERT_STRETCH_ENABLE)
811 lvds->native_mode.panel_yres = 812 lvds->native_mode.vdisplay =
812 ((fp_vert_stretch & RADEON_VERT_PANEL_SIZE) >> 813 ((fp_vert_stretch & RADEON_VERT_PANEL_SIZE) >>
813 RADEON_VERT_PANEL_SHIFT) + 1; 814 RADEON_VERT_PANEL_SHIFT) + 1;
814 else 815 else
815 lvds->native_mode.panel_yres = 816 lvds->native_mode.vdisplay =
816 (RREG32(RADEON_CRTC_V_TOTAL_DISP) >> 16) + 1; 817 (RREG32(RADEON_CRTC_V_TOTAL_DISP) >> 16) + 1;
817 818
818 if (fp_horz_stretch & RADEON_HORZ_STRETCH_ENABLE) 819 if (fp_horz_stretch & RADEON_HORZ_STRETCH_ENABLE)
819 lvds->native_mode.panel_xres = 820 lvds->native_mode.hdisplay =
820 (((fp_horz_stretch & RADEON_HORZ_PANEL_SIZE) >> 821 (((fp_horz_stretch & RADEON_HORZ_PANEL_SIZE) >>
821 RADEON_HORZ_PANEL_SHIFT) + 1) * 8; 822 RADEON_HORZ_PANEL_SHIFT) + 1) * 8;
822 else 823 else
823 lvds->native_mode.panel_xres = 824 lvds->native_mode.hdisplay =
824 ((RREG32(RADEON_CRTC_H_TOTAL_DISP) >> 16) + 1) * 8; 825 ((RREG32(RADEON_CRTC_H_TOTAL_DISP) >> 16) + 1) * 8;
825 826
826 if ((lvds->native_mode.panel_xres < 640) || 827 if ((lvds->native_mode.hdisplay < 640) ||
827 (lvds->native_mode.panel_yres < 480)) { 828 (lvds->native_mode.vdisplay < 480)) {
828 lvds->native_mode.panel_xres = 640; 829 lvds->native_mode.hdisplay = 640;
829 lvds->native_mode.panel_yres = 480; 830 lvds->native_mode.vdisplay = 480;
830 } 831 }
831 832
832 ppll_div_sel = RREG8(RADEON_CLOCK_CNTL_INDEX + 1) & 0x3; 833 ppll_div_sel = RREG8(RADEON_CLOCK_CNTL_INDEX + 1) & 0x3;
@@ -846,8 +847,8 @@ static struct radeon_encoder_lvds *radeon_legacy_get_lvds_info_from_regs(struct
846 lvds->panel_vcc_delay = 200; 847 lvds->panel_vcc_delay = 200;
847 848
848 DRM_INFO("Panel info derived from registers\n"); 849 DRM_INFO("Panel info derived from registers\n");
849 DRM_INFO("Panel Size %dx%d\n", lvds->native_mode.panel_xres, 850 DRM_INFO("Panel Size %dx%d\n", lvds->native_mode.hdisplay,
850 lvds->native_mode.panel_yres); 851 lvds->native_mode.vdisplay);
851 852
852 return lvds; 853 return lvds;
853} 854}
@@ -882,11 +883,11 @@ struct radeon_encoder_lvds *radeon_combios_get_lvds_info(struct radeon_encoder
882 883
883 DRM_INFO("Panel ID String: %s\n", stmp); 884 DRM_INFO("Panel ID String: %s\n", stmp);
884 885
885 lvds->native_mode.panel_xres = RBIOS16(lcd_info + 0x19); 886 lvds->native_mode.hdisplay = RBIOS16(lcd_info + 0x19);
886 lvds->native_mode.panel_yres = RBIOS16(lcd_info + 0x1b); 887 lvds->native_mode.vdisplay = RBIOS16(lcd_info + 0x1b);
887 888
888 DRM_INFO("Panel Size %dx%d\n", lvds->native_mode.panel_xres, 889 DRM_INFO("Panel Size %dx%d\n", lvds->native_mode.hdisplay,
889 lvds->native_mode.panel_yres); 890 lvds->native_mode.vdisplay);
890 891
891 lvds->panel_vcc_delay = RBIOS16(lcd_info + 0x2c); 892 lvds->panel_vcc_delay = RBIOS16(lcd_info + 0x2c);
892 if (lvds->panel_vcc_delay > 2000 || lvds->panel_vcc_delay < 0) 893 if (lvds->panel_vcc_delay > 2000 || lvds->panel_vcc_delay < 0)
@@ -944,27 +945,25 @@ struct radeon_encoder_lvds *radeon_combios_get_lvds_info(struct radeon_encoder
944 if (tmp == 0) 945 if (tmp == 0)
945 break; 946 break;
946 947
947 if ((RBIOS16(tmp) == lvds->native_mode.panel_xres) && 948 if ((RBIOS16(tmp) == lvds->native_mode.hdisplay) &&
948 (RBIOS16(tmp + 2) == 949 (RBIOS16(tmp + 2) ==
949 lvds->native_mode.panel_yres)) { 950 lvds->native_mode.vdisplay)) {
950 lvds->native_mode.hblank = 951 lvds->native_mode.htotal = RBIOS16(tmp + 17) * 8;
951 (RBIOS16(tmp + 17) - RBIOS16(tmp + 19)) * 8; 952 lvds->native_mode.hsync_start = RBIOS16(tmp + 21) * 8;
952 lvds->native_mode.hoverplus = 953 lvds->native_mode.hsync_end = (RBIOS8(tmp + 23) +
953 (RBIOS16(tmp + 21) - RBIOS16(tmp + 19) - 954 RBIOS16(tmp + 21)) * 8;
954 1) * 8; 955
955 lvds->native_mode.hsync_width = 956 lvds->native_mode.vtotal = RBIOS16(tmp + 24);
956 RBIOS8(tmp + 23) * 8; 957 lvds->native_mode.vsync_start = RBIOS16(tmp + 28) & 0x7ff;
957 958 lvds->native_mode.vsync_end =
958 lvds->native_mode.vblank = (RBIOS16(tmp + 24) - 959 ((RBIOS16(tmp + 28) & 0xf800) >> 11) +
959 RBIOS16(tmp + 26)); 960 (RBIOS16(tmp + 28) & 0x7ff);
960 lvds->native_mode.voverplus = 961
961 ((RBIOS16(tmp + 28) & 0x7ff) - 962 lvds->native_mode.clock = RBIOS16(tmp + 9) * 10;
962 RBIOS16(tmp + 26));
963 lvds->native_mode.vsync_width =
964 ((RBIOS16(tmp + 28) & 0xf800) >> 11);
965 lvds->native_mode.dotclock =
966 RBIOS16(tmp + 9) * 10;
967 lvds->native_mode.flags = 0; 963 lvds->native_mode.flags = 0;
964 /* set crtc values */
965 drm_mode_set_crtcinfo(&lvds->native_mode, CRTC_INTERLACE_HALVE_V);
966
968 } 967 }
969 } 968 }
970 } else { 969 } else {
@@ -1178,7 +1177,8 @@ bool radeon_get_legacy_connector_info_from_table(struct drm_device *dev)
1178 radeon_add_legacy_connector(dev, 0, 1177 radeon_add_legacy_connector(dev, 0,
1179 ATOM_DEVICE_CRT1_SUPPORT, 1178 ATOM_DEVICE_CRT1_SUPPORT,
1180 DRM_MODE_CONNECTOR_VGA, 1179 DRM_MODE_CONNECTOR_VGA,
1181 &ddc_i2c); 1180 &ddc_i2c,
1181 CONNECTOR_OBJECT_ID_VGA);
1182 } else if (rdev->flags & RADEON_IS_MOBILITY) { 1182 } else if (rdev->flags & RADEON_IS_MOBILITY) {
1183 /* LVDS */ 1183 /* LVDS */
1184 ddc_i2c = combios_setup_i2c_bus(RADEON_LCD_GPIO_MASK); 1184 ddc_i2c = combios_setup_i2c_bus(RADEON_LCD_GPIO_MASK);
@@ -1190,7 +1190,8 @@ bool radeon_get_legacy_connector_info_from_table(struct drm_device *dev)
1190 radeon_add_legacy_connector(dev, 0, 1190 radeon_add_legacy_connector(dev, 0,
1191 ATOM_DEVICE_LCD1_SUPPORT, 1191 ATOM_DEVICE_LCD1_SUPPORT,
1192 DRM_MODE_CONNECTOR_LVDS, 1192 DRM_MODE_CONNECTOR_LVDS,
1193 &ddc_i2c); 1193 &ddc_i2c,
1194 CONNECTOR_OBJECT_ID_LVDS);
1194 1195
1195 /* VGA - primary dac */ 1196 /* VGA - primary dac */
1196 ddc_i2c = combios_setup_i2c_bus(RADEON_GPIO_VGA_DDC); 1197 ddc_i2c = combios_setup_i2c_bus(RADEON_GPIO_VGA_DDC);
@@ -1202,7 +1203,8 @@ bool radeon_get_legacy_connector_info_from_table(struct drm_device *dev)
1202 radeon_add_legacy_connector(dev, 1, 1203 radeon_add_legacy_connector(dev, 1,
1203 ATOM_DEVICE_CRT1_SUPPORT, 1204 ATOM_DEVICE_CRT1_SUPPORT,
1204 DRM_MODE_CONNECTOR_VGA, 1205 DRM_MODE_CONNECTOR_VGA,
1205 &ddc_i2c); 1206 &ddc_i2c,
1207 CONNECTOR_OBJECT_ID_VGA);
1206 } else { 1208 } else {
1207 /* DVI-I - tv dac, int tmds */ 1209 /* DVI-I - tv dac, int tmds */
1208 ddc_i2c = combios_setup_i2c_bus(RADEON_GPIO_DVI_DDC); 1210 ddc_i2c = combios_setup_i2c_bus(RADEON_GPIO_DVI_DDC);
@@ -1220,7 +1222,8 @@ bool radeon_get_legacy_connector_info_from_table(struct drm_device *dev)
1220 ATOM_DEVICE_DFP1_SUPPORT | 1222 ATOM_DEVICE_DFP1_SUPPORT |
1221 ATOM_DEVICE_CRT2_SUPPORT, 1223 ATOM_DEVICE_CRT2_SUPPORT,
1222 DRM_MODE_CONNECTOR_DVII, 1224 DRM_MODE_CONNECTOR_DVII,
1223 &ddc_i2c); 1225 &ddc_i2c,
1226 CONNECTOR_OBJECT_ID_SINGLE_LINK_DVI_I);
1224 1227
1225 /* VGA - primary dac */ 1228 /* VGA - primary dac */
1226 ddc_i2c = combios_setup_i2c_bus(RADEON_GPIO_VGA_DDC); 1229 ddc_i2c = combios_setup_i2c_bus(RADEON_GPIO_VGA_DDC);
@@ -1232,7 +1235,8 @@ bool radeon_get_legacy_connector_info_from_table(struct drm_device *dev)
1232 radeon_add_legacy_connector(dev, 1, 1235 radeon_add_legacy_connector(dev, 1,
1233 ATOM_DEVICE_CRT1_SUPPORT, 1236 ATOM_DEVICE_CRT1_SUPPORT,
1234 DRM_MODE_CONNECTOR_VGA, 1237 DRM_MODE_CONNECTOR_VGA,
1235 &ddc_i2c); 1238 &ddc_i2c,
1239 CONNECTOR_OBJECT_ID_VGA);
1236 } 1240 }
1237 1241
1238 if (rdev->family != CHIP_R100 && rdev->family != CHIP_R200) { 1242 if (rdev->family != CHIP_R100 && rdev->family != CHIP_R200) {
@@ -1245,7 +1249,8 @@ bool radeon_get_legacy_connector_info_from_table(struct drm_device *dev)
1245 radeon_add_legacy_connector(dev, 2, 1249 radeon_add_legacy_connector(dev, 2,
1246 ATOM_DEVICE_TV1_SUPPORT, 1250 ATOM_DEVICE_TV1_SUPPORT,
1247 DRM_MODE_CONNECTOR_SVIDEO, 1251 DRM_MODE_CONNECTOR_SVIDEO,
1248 &ddc_i2c); 1252 &ddc_i2c,
1253 CONNECTOR_OBJECT_ID_SVIDEO);
1249 } 1254 }
1250 break; 1255 break;
1251 case CT_IBOOK: 1256 case CT_IBOOK:
@@ -1259,7 +1264,8 @@ bool radeon_get_legacy_connector_info_from_table(struct drm_device *dev)
1259 0), 1264 0),
1260 ATOM_DEVICE_LCD1_SUPPORT); 1265 ATOM_DEVICE_LCD1_SUPPORT);
1261 radeon_add_legacy_connector(dev, 0, ATOM_DEVICE_LCD1_SUPPORT, 1266 radeon_add_legacy_connector(dev, 0, ATOM_DEVICE_LCD1_SUPPORT,
1262 DRM_MODE_CONNECTOR_LVDS, &ddc_i2c); 1267 DRM_MODE_CONNECTOR_LVDS, &ddc_i2c,
1268 CONNECTOR_OBJECT_ID_LVDS);
1263 /* VGA - TV DAC */ 1269 /* VGA - TV DAC */
1264 ddc_i2c = combios_setup_i2c_bus(RADEON_GPIO_VGA_DDC); 1270 ddc_i2c = combios_setup_i2c_bus(RADEON_GPIO_VGA_DDC);
1265 radeon_add_legacy_encoder(dev, 1271 radeon_add_legacy_encoder(dev,
@@ -1268,7 +1274,8 @@ bool radeon_get_legacy_connector_info_from_table(struct drm_device *dev)
1268 2), 1274 2),
1269 ATOM_DEVICE_CRT2_SUPPORT); 1275 ATOM_DEVICE_CRT2_SUPPORT);
1270 radeon_add_legacy_connector(dev, 1, ATOM_DEVICE_CRT2_SUPPORT, 1276 radeon_add_legacy_connector(dev, 1, ATOM_DEVICE_CRT2_SUPPORT,
1271 DRM_MODE_CONNECTOR_VGA, &ddc_i2c); 1277 DRM_MODE_CONNECTOR_VGA, &ddc_i2c,
1278 CONNECTOR_OBJECT_ID_VGA);
1272 /* TV - TV DAC */ 1279 /* TV - TV DAC */
1273 radeon_add_legacy_encoder(dev, 1280 radeon_add_legacy_encoder(dev,
1274 radeon_get_encoder_id(dev, 1281 radeon_get_encoder_id(dev,
@@ -1277,7 +1284,8 @@ bool radeon_get_legacy_connector_info_from_table(struct drm_device *dev)
1277 ATOM_DEVICE_TV1_SUPPORT); 1284 ATOM_DEVICE_TV1_SUPPORT);
1278 radeon_add_legacy_connector(dev, 2, ATOM_DEVICE_TV1_SUPPORT, 1285 radeon_add_legacy_connector(dev, 2, ATOM_DEVICE_TV1_SUPPORT,
1279 DRM_MODE_CONNECTOR_SVIDEO, 1286 DRM_MODE_CONNECTOR_SVIDEO,
1280 &ddc_i2c); 1287 &ddc_i2c,
1288 CONNECTOR_OBJECT_ID_SVIDEO);
1281 break; 1289 break;
1282 case CT_POWERBOOK_EXTERNAL: 1290 case CT_POWERBOOK_EXTERNAL:
1283 DRM_INFO("Connector Table: %d (powerbook external tmds)\n", 1291 DRM_INFO("Connector Table: %d (powerbook external tmds)\n",
@@ -1290,7 +1298,8 @@ bool radeon_get_legacy_connector_info_from_table(struct drm_device *dev)
1290 0), 1298 0),
1291 ATOM_DEVICE_LCD1_SUPPORT); 1299 ATOM_DEVICE_LCD1_SUPPORT);
1292 radeon_add_legacy_connector(dev, 0, ATOM_DEVICE_LCD1_SUPPORT, 1300 radeon_add_legacy_connector(dev, 0, ATOM_DEVICE_LCD1_SUPPORT,
1293 DRM_MODE_CONNECTOR_LVDS, &ddc_i2c); 1301 DRM_MODE_CONNECTOR_LVDS, &ddc_i2c,
1302 CONNECTOR_OBJECT_ID_LVDS);
1294 /* DVI-I - primary dac, ext tmds */ 1303 /* DVI-I - primary dac, ext tmds */
1295 ddc_i2c = combios_setup_i2c_bus(RADEON_GPIO_VGA_DDC); 1304 ddc_i2c = combios_setup_i2c_bus(RADEON_GPIO_VGA_DDC);
1296 radeon_add_legacy_encoder(dev, 1305 radeon_add_legacy_encoder(dev,
@@ -1303,10 +1312,12 @@ bool radeon_get_legacy_connector_info_from_table(struct drm_device *dev)
1303 ATOM_DEVICE_CRT1_SUPPORT, 1312 ATOM_DEVICE_CRT1_SUPPORT,
1304 1), 1313 1),
1305 ATOM_DEVICE_CRT1_SUPPORT); 1314 ATOM_DEVICE_CRT1_SUPPORT);
1315 /* XXX some are SL */
1306 radeon_add_legacy_connector(dev, 1, 1316 radeon_add_legacy_connector(dev, 1,
1307 ATOM_DEVICE_DFP2_SUPPORT | 1317 ATOM_DEVICE_DFP2_SUPPORT |
1308 ATOM_DEVICE_CRT1_SUPPORT, 1318 ATOM_DEVICE_CRT1_SUPPORT,
1309 DRM_MODE_CONNECTOR_DVII, &ddc_i2c); 1319 DRM_MODE_CONNECTOR_DVII, &ddc_i2c,
1320 CONNECTOR_OBJECT_ID_DUAL_LINK_DVI_I);
1310 /* TV - TV DAC */ 1321 /* TV - TV DAC */
1311 radeon_add_legacy_encoder(dev, 1322 radeon_add_legacy_encoder(dev,
1312 radeon_get_encoder_id(dev, 1323 radeon_get_encoder_id(dev,
@@ -1315,7 +1326,8 @@ bool radeon_get_legacy_connector_info_from_table(struct drm_device *dev)
1315 ATOM_DEVICE_TV1_SUPPORT); 1326 ATOM_DEVICE_TV1_SUPPORT);
1316 radeon_add_legacy_connector(dev, 2, ATOM_DEVICE_TV1_SUPPORT, 1327 radeon_add_legacy_connector(dev, 2, ATOM_DEVICE_TV1_SUPPORT,
1317 DRM_MODE_CONNECTOR_SVIDEO, 1328 DRM_MODE_CONNECTOR_SVIDEO,
1318 &ddc_i2c); 1329 &ddc_i2c,
1330 CONNECTOR_OBJECT_ID_SVIDEO);
1319 break; 1331 break;
1320 case CT_POWERBOOK_INTERNAL: 1332 case CT_POWERBOOK_INTERNAL:
1321 DRM_INFO("Connector Table: %d (powerbook internal tmds)\n", 1333 DRM_INFO("Connector Table: %d (powerbook internal tmds)\n",
@@ -1328,7 +1340,8 @@ bool radeon_get_legacy_connector_info_from_table(struct drm_device *dev)
1328 0), 1340 0),
1329 ATOM_DEVICE_LCD1_SUPPORT); 1341 ATOM_DEVICE_LCD1_SUPPORT);
1330 radeon_add_legacy_connector(dev, 0, ATOM_DEVICE_LCD1_SUPPORT, 1342 radeon_add_legacy_connector(dev, 0, ATOM_DEVICE_LCD1_SUPPORT,
1331 DRM_MODE_CONNECTOR_LVDS, &ddc_i2c); 1343 DRM_MODE_CONNECTOR_LVDS, &ddc_i2c,
1344 CONNECTOR_OBJECT_ID_LVDS);
1332 /* DVI-I - primary dac, int tmds */ 1345 /* DVI-I - primary dac, int tmds */
1333 ddc_i2c = combios_setup_i2c_bus(RADEON_GPIO_VGA_DDC); 1346 ddc_i2c = combios_setup_i2c_bus(RADEON_GPIO_VGA_DDC);
1334 radeon_add_legacy_encoder(dev, 1347 radeon_add_legacy_encoder(dev,
@@ -1344,7 +1357,8 @@ bool radeon_get_legacy_connector_info_from_table(struct drm_device *dev)
1344 radeon_add_legacy_connector(dev, 1, 1357 radeon_add_legacy_connector(dev, 1,
1345 ATOM_DEVICE_DFP1_SUPPORT | 1358 ATOM_DEVICE_DFP1_SUPPORT |
1346 ATOM_DEVICE_CRT1_SUPPORT, 1359 ATOM_DEVICE_CRT1_SUPPORT,
1347 DRM_MODE_CONNECTOR_DVII, &ddc_i2c); 1360 DRM_MODE_CONNECTOR_DVII, &ddc_i2c,
1361 CONNECTOR_OBJECT_ID_SINGLE_LINK_DVI_I);
1348 /* TV - TV DAC */ 1362 /* TV - TV DAC */
1349 radeon_add_legacy_encoder(dev, 1363 radeon_add_legacy_encoder(dev,
1350 radeon_get_encoder_id(dev, 1364 radeon_get_encoder_id(dev,
@@ -1353,7 +1367,8 @@ bool radeon_get_legacy_connector_info_from_table(struct drm_device *dev)
1353 ATOM_DEVICE_TV1_SUPPORT); 1367 ATOM_DEVICE_TV1_SUPPORT);
1354 radeon_add_legacy_connector(dev, 2, ATOM_DEVICE_TV1_SUPPORT, 1368 radeon_add_legacy_connector(dev, 2, ATOM_DEVICE_TV1_SUPPORT,
1355 DRM_MODE_CONNECTOR_SVIDEO, 1369 DRM_MODE_CONNECTOR_SVIDEO,
1356 &ddc_i2c); 1370 &ddc_i2c,
1371 CONNECTOR_OBJECT_ID_SVIDEO);
1357 break; 1372 break;
1358 case CT_POWERBOOK_VGA: 1373 case CT_POWERBOOK_VGA:
1359 DRM_INFO("Connector Table: %d (powerbook vga)\n", 1374 DRM_INFO("Connector Table: %d (powerbook vga)\n",
@@ -1366,7 +1381,8 @@ bool radeon_get_legacy_connector_info_from_table(struct drm_device *dev)
1366 0), 1381 0),
1367 ATOM_DEVICE_LCD1_SUPPORT); 1382 ATOM_DEVICE_LCD1_SUPPORT);
1368 radeon_add_legacy_connector(dev, 0, ATOM_DEVICE_LCD1_SUPPORT, 1383 radeon_add_legacy_connector(dev, 0, ATOM_DEVICE_LCD1_SUPPORT,
1369 DRM_MODE_CONNECTOR_LVDS, &ddc_i2c); 1384 DRM_MODE_CONNECTOR_LVDS, &ddc_i2c,
1385 CONNECTOR_OBJECT_ID_LVDS);
1370 /* VGA - primary dac */ 1386 /* VGA - primary dac */
1371 ddc_i2c = combios_setup_i2c_bus(RADEON_GPIO_VGA_DDC); 1387 ddc_i2c = combios_setup_i2c_bus(RADEON_GPIO_VGA_DDC);
1372 radeon_add_legacy_encoder(dev, 1388 radeon_add_legacy_encoder(dev,
@@ -1375,7 +1391,8 @@ bool radeon_get_legacy_connector_info_from_table(struct drm_device *dev)
1375 1), 1391 1),
1376 ATOM_DEVICE_CRT1_SUPPORT); 1392 ATOM_DEVICE_CRT1_SUPPORT);
1377 radeon_add_legacy_connector(dev, 1, ATOM_DEVICE_CRT1_SUPPORT, 1393 radeon_add_legacy_connector(dev, 1, ATOM_DEVICE_CRT1_SUPPORT,
1378 DRM_MODE_CONNECTOR_VGA, &ddc_i2c); 1394 DRM_MODE_CONNECTOR_VGA, &ddc_i2c,
1395 CONNECTOR_OBJECT_ID_VGA);
1379 /* TV - TV DAC */ 1396 /* TV - TV DAC */
1380 radeon_add_legacy_encoder(dev, 1397 radeon_add_legacy_encoder(dev,
1381 radeon_get_encoder_id(dev, 1398 radeon_get_encoder_id(dev,
@@ -1384,7 +1401,8 @@ bool radeon_get_legacy_connector_info_from_table(struct drm_device *dev)
1384 ATOM_DEVICE_TV1_SUPPORT); 1401 ATOM_DEVICE_TV1_SUPPORT);
1385 radeon_add_legacy_connector(dev, 2, ATOM_DEVICE_TV1_SUPPORT, 1402 radeon_add_legacy_connector(dev, 2, ATOM_DEVICE_TV1_SUPPORT,
1386 DRM_MODE_CONNECTOR_SVIDEO, 1403 DRM_MODE_CONNECTOR_SVIDEO,
1387 &ddc_i2c); 1404 &ddc_i2c,
1405 CONNECTOR_OBJECT_ID_SVIDEO);
1388 break; 1406 break;
1389 case CT_MINI_EXTERNAL: 1407 case CT_MINI_EXTERNAL:
1390 DRM_INFO("Connector Table: %d (mini external tmds)\n", 1408 DRM_INFO("Connector Table: %d (mini external tmds)\n",
@@ -1401,10 +1419,12 @@ bool radeon_get_legacy_connector_info_from_table(struct drm_device *dev)
1401 ATOM_DEVICE_CRT2_SUPPORT, 1419 ATOM_DEVICE_CRT2_SUPPORT,
1402 2), 1420 2),
1403 ATOM_DEVICE_CRT2_SUPPORT); 1421 ATOM_DEVICE_CRT2_SUPPORT);
1422 /* XXX are any DL? */
1404 radeon_add_legacy_connector(dev, 0, 1423 radeon_add_legacy_connector(dev, 0,
1405 ATOM_DEVICE_DFP2_SUPPORT | 1424 ATOM_DEVICE_DFP2_SUPPORT |
1406 ATOM_DEVICE_CRT2_SUPPORT, 1425 ATOM_DEVICE_CRT2_SUPPORT,
1407 DRM_MODE_CONNECTOR_DVII, &ddc_i2c); 1426 DRM_MODE_CONNECTOR_DVII, &ddc_i2c,
1427 CONNECTOR_OBJECT_ID_SINGLE_LINK_DVI_I);
1408 /* TV - TV DAC */ 1428 /* TV - TV DAC */
1409 radeon_add_legacy_encoder(dev, 1429 radeon_add_legacy_encoder(dev,
1410 radeon_get_encoder_id(dev, 1430 radeon_get_encoder_id(dev,
@@ -1413,7 +1433,8 @@ bool radeon_get_legacy_connector_info_from_table(struct drm_device *dev)
1413 ATOM_DEVICE_TV1_SUPPORT); 1433 ATOM_DEVICE_TV1_SUPPORT);
1414 radeon_add_legacy_connector(dev, 1, ATOM_DEVICE_TV1_SUPPORT, 1434 radeon_add_legacy_connector(dev, 1, ATOM_DEVICE_TV1_SUPPORT,
1415 DRM_MODE_CONNECTOR_SVIDEO, 1435 DRM_MODE_CONNECTOR_SVIDEO,
1416 &ddc_i2c); 1436 &ddc_i2c,
1437 CONNECTOR_OBJECT_ID_SVIDEO);
1417 break; 1438 break;
1418 case CT_MINI_INTERNAL: 1439 case CT_MINI_INTERNAL:
1419 DRM_INFO("Connector Table: %d (mini internal tmds)\n", 1440 DRM_INFO("Connector Table: %d (mini internal tmds)\n",
@@ -1433,7 +1454,8 @@ bool radeon_get_legacy_connector_info_from_table(struct drm_device *dev)
1433 radeon_add_legacy_connector(dev, 0, 1454 radeon_add_legacy_connector(dev, 0,
1434 ATOM_DEVICE_DFP1_SUPPORT | 1455 ATOM_DEVICE_DFP1_SUPPORT |
1435 ATOM_DEVICE_CRT2_SUPPORT, 1456 ATOM_DEVICE_CRT2_SUPPORT,
1436 DRM_MODE_CONNECTOR_DVII, &ddc_i2c); 1457 DRM_MODE_CONNECTOR_DVII, &ddc_i2c,
1458 CONNECTOR_OBJECT_ID_SINGLE_LINK_DVI_I);
1437 /* TV - TV DAC */ 1459 /* TV - TV DAC */
1438 radeon_add_legacy_encoder(dev, 1460 radeon_add_legacy_encoder(dev,
1439 radeon_get_encoder_id(dev, 1461 radeon_get_encoder_id(dev,
@@ -1442,7 +1464,8 @@ bool radeon_get_legacy_connector_info_from_table(struct drm_device *dev)
1442 ATOM_DEVICE_TV1_SUPPORT); 1464 ATOM_DEVICE_TV1_SUPPORT);
1443 radeon_add_legacy_connector(dev, 1, ATOM_DEVICE_TV1_SUPPORT, 1465 radeon_add_legacy_connector(dev, 1, ATOM_DEVICE_TV1_SUPPORT,
1444 DRM_MODE_CONNECTOR_SVIDEO, 1466 DRM_MODE_CONNECTOR_SVIDEO,
1445 &ddc_i2c); 1467 &ddc_i2c,
1468 CONNECTOR_OBJECT_ID_SVIDEO);
1446 break; 1469 break;
1447 case CT_IMAC_G5_ISIGHT: 1470 case CT_IMAC_G5_ISIGHT:
1448 DRM_INFO("Connector Table: %d (imac g5 isight)\n", 1471 DRM_INFO("Connector Table: %d (imac g5 isight)\n",
@@ -1455,7 +1478,8 @@ bool radeon_get_legacy_connector_info_from_table(struct drm_device *dev)
1455 0), 1478 0),
1456 ATOM_DEVICE_DFP1_SUPPORT); 1479 ATOM_DEVICE_DFP1_SUPPORT);
1457 radeon_add_legacy_connector(dev, 0, ATOM_DEVICE_DFP1_SUPPORT, 1480 radeon_add_legacy_connector(dev, 0, ATOM_DEVICE_DFP1_SUPPORT,
1458 DRM_MODE_CONNECTOR_DVID, &ddc_i2c); 1481 DRM_MODE_CONNECTOR_DVID, &ddc_i2c,
1482 CONNECTOR_OBJECT_ID_SINGLE_LINK_DVI_D);
1459 /* VGA - tv dac */ 1483 /* VGA - tv dac */
1460 ddc_i2c = combios_setup_i2c_bus(RADEON_GPIO_DVI_DDC); 1484 ddc_i2c = combios_setup_i2c_bus(RADEON_GPIO_DVI_DDC);
1461 radeon_add_legacy_encoder(dev, 1485 radeon_add_legacy_encoder(dev,
@@ -1464,7 +1488,8 @@ bool radeon_get_legacy_connector_info_from_table(struct drm_device *dev)
1464 2), 1488 2),
1465 ATOM_DEVICE_CRT2_SUPPORT); 1489 ATOM_DEVICE_CRT2_SUPPORT);
1466 radeon_add_legacy_connector(dev, 1, ATOM_DEVICE_CRT2_SUPPORT, 1490 radeon_add_legacy_connector(dev, 1, ATOM_DEVICE_CRT2_SUPPORT,
1467 DRM_MODE_CONNECTOR_VGA, &ddc_i2c); 1491 DRM_MODE_CONNECTOR_VGA, &ddc_i2c,
1492 CONNECTOR_OBJECT_ID_VGA);
1468 /* TV - TV DAC */ 1493 /* TV - TV DAC */
1469 radeon_add_legacy_encoder(dev, 1494 radeon_add_legacy_encoder(dev,
1470 radeon_get_encoder_id(dev, 1495 radeon_get_encoder_id(dev,
@@ -1473,7 +1498,8 @@ bool radeon_get_legacy_connector_info_from_table(struct drm_device *dev)
1473 ATOM_DEVICE_TV1_SUPPORT); 1498 ATOM_DEVICE_TV1_SUPPORT);
1474 radeon_add_legacy_connector(dev, 2, ATOM_DEVICE_TV1_SUPPORT, 1499 radeon_add_legacy_connector(dev, 2, ATOM_DEVICE_TV1_SUPPORT,
1475 DRM_MODE_CONNECTOR_SVIDEO, 1500 DRM_MODE_CONNECTOR_SVIDEO,
1476 &ddc_i2c); 1501 &ddc_i2c,
1502 CONNECTOR_OBJECT_ID_SVIDEO);
1477 break; 1503 break;
1478 case CT_EMAC: 1504 case CT_EMAC:
1479 DRM_INFO("Connector Table: %d (emac)\n", 1505 DRM_INFO("Connector Table: %d (emac)\n",
@@ -1486,7 +1512,8 @@ bool radeon_get_legacy_connector_info_from_table(struct drm_device *dev)
1486 1), 1512 1),
1487 ATOM_DEVICE_CRT1_SUPPORT); 1513 ATOM_DEVICE_CRT1_SUPPORT);
1488 radeon_add_legacy_connector(dev, 0, ATOM_DEVICE_CRT1_SUPPORT, 1514 radeon_add_legacy_connector(dev, 0, ATOM_DEVICE_CRT1_SUPPORT,
1489 DRM_MODE_CONNECTOR_VGA, &ddc_i2c); 1515 DRM_MODE_CONNECTOR_VGA, &ddc_i2c,
1516 CONNECTOR_OBJECT_ID_VGA);
1490 /* VGA - tv dac */ 1517 /* VGA - tv dac */
1491 ddc_i2c = combios_setup_i2c_bus(RADEON_GPIO_CRT2_DDC); 1518 ddc_i2c = combios_setup_i2c_bus(RADEON_GPIO_CRT2_DDC);
1492 radeon_add_legacy_encoder(dev, 1519 radeon_add_legacy_encoder(dev,
@@ -1495,7 +1522,8 @@ bool radeon_get_legacy_connector_info_from_table(struct drm_device *dev)
1495 2), 1522 2),
1496 ATOM_DEVICE_CRT2_SUPPORT); 1523 ATOM_DEVICE_CRT2_SUPPORT);
1497 radeon_add_legacy_connector(dev, 1, ATOM_DEVICE_CRT2_SUPPORT, 1524 radeon_add_legacy_connector(dev, 1, ATOM_DEVICE_CRT2_SUPPORT,
1498 DRM_MODE_CONNECTOR_VGA, &ddc_i2c); 1525 DRM_MODE_CONNECTOR_VGA, &ddc_i2c,
1526 CONNECTOR_OBJECT_ID_VGA);
1499 /* TV - TV DAC */ 1527 /* TV - TV DAC */
1500 radeon_add_legacy_encoder(dev, 1528 radeon_add_legacy_encoder(dev,
1501 radeon_get_encoder_id(dev, 1529 radeon_get_encoder_id(dev,
@@ -1504,7 +1532,8 @@ bool radeon_get_legacy_connector_info_from_table(struct drm_device *dev)
1504 ATOM_DEVICE_TV1_SUPPORT); 1532 ATOM_DEVICE_TV1_SUPPORT);
1505 radeon_add_legacy_connector(dev, 2, ATOM_DEVICE_TV1_SUPPORT, 1533 radeon_add_legacy_connector(dev, 2, ATOM_DEVICE_TV1_SUPPORT,
1506 DRM_MODE_CONNECTOR_SVIDEO, 1534 DRM_MODE_CONNECTOR_SVIDEO,
1507 &ddc_i2c); 1535 &ddc_i2c,
1536 CONNECTOR_OBJECT_ID_SVIDEO);
1508 break; 1537 break;
1509 default: 1538 default:
1510 DRM_INFO("Connector table: %d (invalid)\n", 1539 DRM_INFO("Connector table: %d (invalid)\n",
@@ -1581,11 +1610,63 @@ static bool radeon_apply_legacy_quirks(struct drm_device *dev,
1581 return true; 1610 return true;
1582} 1611}
1583 1612
1613static bool radeon_apply_legacy_tv_quirks(struct drm_device *dev)
1614{
1615 /* Acer 5102 has non-existent TV port */
1616 if (dev->pdev->device == 0x5975 &&
1617 dev->pdev->subsystem_vendor == 0x1025 &&
1618 dev->pdev->subsystem_device == 0x009f)
1619 return false;
1620
1621 /* HP dc5750 has non-existent TV port */
1622 if (dev->pdev->device == 0x5974 &&
1623 dev->pdev->subsystem_vendor == 0x103c &&
1624 dev->pdev->subsystem_device == 0x280a)
1625 return false;
1626
1627 return true;
1628}
1629
1630static uint16_t combios_check_dl_dvi(struct drm_device *dev, int is_dvi_d)
1631{
1632 struct radeon_device *rdev = dev->dev_private;
1633 uint32_t ext_tmds_info;
1634
1635 if (rdev->flags & RADEON_IS_IGP) {
1636 if (is_dvi_d)
1637 return CONNECTOR_OBJECT_ID_SINGLE_LINK_DVI_D;
1638 else
1639 return CONNECTOR_OBJECT_ID_SINGLE_LINK_DVI_I;
1640 }
1641 ext_tmds_info = combios_get_table_offset(dev, COMBIOS_EXT_TMDS_INFO_TABLE);
1642 if (ext_tmds_info) {
1643 uint8_t rev = RBIOS8(ext_tmds_info);
1644 uint8_t flags = RBIOS8(ext_tmds_info + 4 + 5);
1645 if (rev >= 3) {
1646 if (is_dvi_d)
1647 return CONNECTOR_OBJECT_ID_DUAL_LINK_DVI_D;
1648 else
1649 return CONNECTOR_OBJECT_ID_DUAL_LINK_DVI_I;
1650 } else {
1651 if (flags & 1) {
1652 if (is_dvi_d)
1653 return CONNECTOR_OBJECT_ID_DUAL_LINK_DVI_D;
1654 else
1655 return CONNECTOR_OBJECT_ID_DUAL_LINK_DVI_I;
1656 }
1657 }
1658 }
1659 if (is_dvi_d)
1660 return CONNECTOR_OBJECT_ID_SINGLE_LINK_DVI_D;
1661 else
1662 return CONNECTOR_OBJECT_ID_SINGLE_LINK_DVI_I;
1663}
1664
1584bool radeon_get_legacy_connector_info_from_bios(struct drm_device *dev) 1665bool radeon_get_legacy_connector_info_from_bios(struct drm_device *dev)
1585{ 1666{
1586 struct radeon_device *rdev = dev->dev_private; 1667 struct radeon_device *rdev = dev->dev_private;
1587 uint32_t conn_info, entry, devices; 1668 uint32_t conn_info, entry, devices;
1588 uint16_t tmp; 1669 uint16_t tmp, connector_object_id;
1589 enum radeon_combios_ddc ddc_type; 1670 enum radeon_combios_ddc ddc_type;
1590 enum radeon_combios_connector connector; 1671 enum radeon_combios_connector connector;
1591 int i = 0; 1672 int i = 0;
@@ -1628,8 +1709,9 @@ bool radeon_get_legacy_connector_info_from_bios(struct drm_device *dev)
1628 break; 1709 break;
1629 } 1710 }
1630 1711
1631 radeon_apply_legacy_quirks(dev, i, &connector, 1712 if (!radeon_apply_legacy_quirks(dev, i, &connector,
1632 &ddc_i2c); 1713 &ddc_i2c))
1714 continue;
1633 1715
1634 switch (connector) { 1716 switch (connector) {
1635 case CONNECTOR_PROPRIETARY_LEGACY: 1717 case CONNECTOR_PROPRIETARY_LEGACY:
@@ -1644,7 +1726,8 @@ bool radeon_get_legacy_connector_info_from_bios(struct drm_device *dev)
1644 radeon_add_legacy_connector(dev, i, devices, 1726 radeon_add_legacy_connector(dev, i, devices,
1645 legacy_connector_convert 1727 legacy_connector_convert
1646 [connector], 1728 [connector],
1647 &ddc_i2c); 1729 &ddc_i2c,
1730 CONNECTOR_OBJECT_ID_SINGLE_LINK_DVI_D);
1648 break; 1731 break;
1649 case CONNECTOR_CRT_LEGACY: 1732 case CONNECTOR_CRT_LEGACY:
1650 if (tmp & 0x1) { 1733 if (tmp & 0x1) {
@@ -1669,7 +1752,8 @@ bool radeon_get_legacy_connector_info_from_bios(struct drm_device *dev)
1669 devices, 1752 devices,
1670 legacy_connector_convert 1753 legacy_connector_convert
1671 [connector], 1754 [connector],
1672 &ddc_i2c); 1755 &ddc_i2c,
1756 CONNECTOR_OBJECT_ID_VGA);
1673 break; 1757 break;
1674 case CONNECTOR_DVI_I_LEGACY: 1758 case CONNECTOR_DVI_I_LEGACY:
1675 devices = 0; 1759 devices = 0;
@@ -1698,6 +1782,7 @@ bool radeon_get_legacy_connector_info_from_bios(struct drm_device *dev)
1698 ATOM_DEVICE_DFP2_SUPPORT, 1782 ATOM_DEVICE_DFP2_SUPPORT,
1699 0), 1783 0),
1700 ATOM_DEVICE_DFP2_SUPPORT); 1784 ATOM_DEVICE_DFP2_SUPPORT);
1785 connector_object_id = combios_check_dl_dvi(dev, 0);
1701 } else { 1786 } else {
1702 devices |= ATOM_DEVICE_DFP1_SUPPORT; 1787 devices |= ATOM_DEVICE_DFP1_SUPPORT;
1703 radeon_add_legacy_encoder(dev, 1788 radeon_add_legacy_encoder(dev,
@@ -1706,19 +1791,24 @@ bool radeon_get_legacy_connector_info_from_bios(struct drm_device *dev)
1706 ATOM_DEVICE_DFP1_SUPPORT, 1791 ATOM_DEVICE_DFP1_SUPPORT,
1707 0), 1792 0),
1708 ATOM_DEVICE_DFP1_SUPPORT); 1793 ATOM_DEVICE_DFP1_SUPPORT);
1794 connector_object_id = CONNECTOR_OBJECT_ID_SINGLE_LINK_DVI_I;
1709 } 1795 }
1710 radeon_add_legacy_connector(dev, 1796 radeon_add_legacy_connector(dev,
1711 i, 1797 i,
1712 devices, 1798 devices,
1713 legacy_connector_convert 1799 legacy_connector_convert
1714 [connector], 1800 [connector],
1715 &ddc_i2c); 1801 &ddc_i2c,
1802 connector_object_id);
1716 break; 1803 break;
1717 case CONNECTOR_DVI_D_LEGACY: 1804 case CONNECTOR_DVI_D_LEGACY:
1718 if ((tmp >> 4) & 0x1) 1805 if ((tmp >> 4) & 0x1) {
1719 devices = ATOM_DEVICE_DFP2_SUPPORT; 1806 devices = ATOM_DEVICE_DFP2_SUPPORT;
1720 else 1807 connector_object_id = combios_check_dl_dvi(dev, 1);
1808 } else {
1721 devices = ATOM_DEVICE_DFP1_SUPPORT; 1809 devices = ATOM_DEVICE_DFP1_SUPPORT;
1810 connector_object_id = CONNECTOR_OBJECT_ID_SINGLE_LINK_DVI_I;
1811 }
1722 radeon_add_legacy_encoder(dev, 1812 radeon_add_legacy_encoder(dev,
1723 radeon_get_encoder_id 1813 radeon_get_encoder_id
1724 (dev, devices, 0), 1814 (dev, devices, 0),
@@ -1726,7 +1816,8 @@ bool radeon_get_legacy_connector_info_from_bios(struct drm_device *dev)
1726 radeon_add_legacy_connector(dev, i, devices, 1816 radeon_add_legacy_connector(dev, i, devices,
1727 legacy_connector_convert 1817 legacy_connector_convert
1728 [connector], 1818 [connector],
1729 &ddc_i2c); 1819 &ddc_i2c,
1820 connector_object_id);
1730 break; 1821 break;
1731 case CONNECTOR_CTV_LEGACY: 1822 case CONNECTOR_CTV_LEGACY:
1732 case CONNECTOR_STV_LEGACY: 1823 case CONNECTOR_STV_LEGACY:
@@ -1740,7 +1831,8 @@ bool radeon_get_legacy_connector_info_from_bios(struct drm_device *dev)
1740 ATOM_DEVICE_TV1_SUPPORT, 1831 ATOM_DEVICE_TV1_SUPPORT,
1741 legacy_connector_convert 1832 legacy_connector_convert
1742 [connector], 1833 [connector],
1743 &ddc_i2c); 1834 &ddc_i2c,
1835 CONNECTOR_OBJECT_ID_SVIDEO);
1744 break; 1836 break;
1745 default: 1837 default:
1746 DRM_ERROR("Unknown connector type: %d\n", 1838 DRM_ERROR("Unknown connector type: %d\n",
@@ -1772,10 +1864,29 @@ bool radeon_get_legacy_connector_info_from_bios(struct drm_device *dev)
1772 ATOM_DEVICE_CRT1_SUPPORT | 1864 ATOM_DEVICE_CRT1_SUPPORT |
1773 ATOM_DEVICE_DFP1_SUPPORT, 1865 ATOM_DEVICE_DFP1_SUPPORT,
1774 DRM_MODE_CONNECTOR_DVII, 1866 DRM_MODE_CONNECTOR_DVII,
1775 &ddc_i2c); 1867 &ddc_i2c,
1868 CONNECTOR_OBJECT_ID_SINGLE_LINK_DVI_I);
1776 } else { 1869 } else {
1777 DRM_DEBUG("No connector info found\n"); 1870 uint16_t crt_info =
1778 return false; 1871 combios_get_table_offset(dev, COMBIOS_CRT_INFO_TABLE);
1872 DRM_DEBUG("Found CRT table, assuming VGA connector\n");
1873 if (crt_info) {
1874 radeon_add_legacy_encoder(dev,
1875 radeon_get_encoder_id(dev,
1876 ATOM_DEVICE_CRT1_SUPPORT,
1877 1),
1878 ATOM_DEVICE_CRT1_SUPPORT);
1879 ddc_i2c = combios_setup_i2c_bus(RADEON_GPIO_VGA_DDC);
1880 radeon_add_legacy_connector(dev,
1881 0,
1882 ATOM_DEVICE_CRT1_SUPPORT,
1883 DRM_MODE_CONNECTOR_VGA,
1884 &ddc_i2c,
1885 CONNECTOR_OBJECT_ID_VGA);
1886 } else {
1887 DRM_DEBUG("No connector info found\n");
1888 return false;
1889 }
1779 } 1890 }
1780 } 1891 }
1781 1892
@@ -1870,7 +1981,8 @@ bool radeon_get_legacy_connector_info_from_bios(struct drm_device *dev)
1870 5, 1981 5,
1871 ATOM_DEVICE_LCD1_SUPPORT, 1982 ATOM_DEVICE_LCD1_SUPPORT,
1872 DRM_MODE_CONNECTOR_LVDS, 1983 DRM_MODE_CONNECTOR_LVDS,
1873 &ddc_i2c); 1984 &ddc_i2c,
1985 CONNECTOR_OBJECT_ID_LVDS);
1874 } 1986 }
1875 } 1987 }
1876 1988
@@ -1880,16 +1992,19 @@ bool radeon_get_legacy_connector_info_from_bios(struct drm_device *dev)
1880 combios_get_table_offset(dev, COMBIOS_TV_INFO_TABLE); 1992 combios_get_table_offset(dev, COMBIOS_TV_INFO_TABLE);
1881 if (tv_info) { 1993 if (tv_info) {
1882 if (RBIOS8(tv_info + 6) == 'T') { 1994 if (RBIOS8(tv_info + 6) == 'T') {
1883 radeon_add_legacy_encoder(dev, 1995 if (radeon_apply_legacy_tv_quirks(dev)) {
1884 radeon_get_encoder_id 1996 radeon_add_legacy_encoder(dev,
1885 (dev, 1997 radeon_get_encoder_id
1886 ATOM_DEVICE_TV1_SUPPORT, 1998 (dev,
1887 2), 1999 ATOM_DEVICE_TV1_SUPPORT,
1888 ATOM_DEVICE_TV1_SUPPORT); 2000 2),
1889 radeon_add_legacy_connector(dev, 6, 2001 ATOM_DEVICE_TV1_SUPPORT);
1890 ATOM_DEVICE_TV1_SUPPORT, 2002 radeon_add_legacy_connector(dev, 6,
1891 DRM_MODE_CONNECTOR_SVIDEO, 2003 ATOM_DEVICE_TV1_SUPPORT,
1892 &ddc_i2c); 2004 DRM_MODE_CONNECTOR_SVIDEO,
2005 &ddc_i2c,
2006 CONNECTOR_OBJECT_ID_SVIDEO);
2007 }
1893 } 2008 }
1894 } 2009 }
1895 } 2010 }
diff --git a/drivers/gpu/drm/radeon/radeon_connectors.c b/drivers/gpu/drm/radeon/radeon_connectors.c
index e376be47a4a0..29763ceae3af 100644
--- a/drivers/gpu/drm/radeon/radeon_connectors.c
+++ b/drivers/gpu/drm/radeon/radeon_connectors.c
@@ -178,25 +178,12 @@ static struct drm_display_mode *radeon_fp_native_mode(struct drm_encoder *encode
178 struct drm_device *dev = encoder->dev; 178 struct drm_device *dev = encoder->dev;
179 struct radeon_encoder *radeon_encoder = to_radeon_encoder(encoder); 179 struct radeon_encoder *radeon_encoder = to_radeon_encoder(encoder);
180 struct drm_display_mode *mode = NULL; 180 struct drm_display_mode *mode = NULL;
181 struct radeon_native_mode *native_mode = &radeon_encoder->native_mode; 181 struct drm_display_mode *native_mode = &radeon_encoder->native_mode;
182
183 if (native_mode->panel_xres != 0 &&
184 native_mode->panel_yres != 0 &&
185 native_mode->dotclock != 0) {
186 mode = drm_mode_create(dev);
187
188 mode->hdisplay = native_mode->panel_xres;
189 mode->vdisplay = native_mode->panel_yres;
190
191 mode->htotal = mode->hdisplay + native_mode->hblank;
192 mode->hsync_start = mode->hdisplay + native_mode->hoverplus;
193 mode->hsync_end = mode->hsync_start + native_mode->hsync_width;
194 mode->vtotal = mode->vdisplay + native_mode->vblank;
195 mode->vsync_start = mode->vdisplay + native_mode->voverplus;
196 mode->vsync_end = mode->vsync_start + native_mode->vsync_width;
197 mode->clock = native_mode->dotclock;
198 mode->flags = 0;
199 182
183 if (native_mode->hdisplay != 0 &&
184 native_mode->vdisplay != 0 &&
185 native_mode->clock != 0) {
186 mode = drm_mode_duplicate(dev, native_mode);
200 mode->type = DRM_MODE_TYPE_PREFERRED | DRM_MODE_TYPE_DRIVER; 187 mode->type = DRM_MODE_TYPE_PREFERRED | DRM_MODE_TYPE_DRIVER;
201 drm_mode_set_name(mode); 188 drm_mode_set_name(mode);
202 189
@@ -210,7 +197,7 @@ static void radeon_add_common_modes(struct drm_encoder *encoder, struct drm_conn
210 struct drm_device *dev = encoder->dev; 197 struct drm_device *dev = encoder->dev;
211 struct radeon_encoder *radeon_encoder = to_radeon_encoder(encoder); 198 struct radeon_encoder *radeon_encoder = to_radeon_encoder(encoder);
212 struct drm_display_mode *mode = NULL; 199 struct drm_display_mode *mode = NULL;
213 struct radeon_native_mode *native_mode = &radeon_encoder->native_mode; 200 struct drm_display_mode *native_mode = &radeon_encoder->native_mode;
214 int i; 201 int i;
215 struct mode_size { 202 struct mode_size {
216 int w; 203 int w;
@@ -236,11 +223,16 @@ static void radeon_add_common_modes(struct drm_encoder *encoder, struct drm_conn
236 }; 223 };
237 224
238 for (i = 0; i < 17; i++) { 225 for (i = 0; i < 17; i++) {
226 if (radeon_encoder->devices & (ATOM_DEVICE_TV_SUPPORT)) {
227 if (common_modes[i].w > 1024 ||
228 common_modes[i].h > 768)
229 continue;
230 }
239 if (radeon_encoder->devices & (ATOM_DEVICE_LCD_SUPPORT)) { 231 if (radeon_encoder->devices & (ATOM_DEVICE_LCD_SUPPORT)) {
240 if (common_modes[i].w > native_mode->panel_xres || 232 if (common_modes[i].w > native_mode->hdisplay ||
241 common_modes[i].h > native_mode->panel_yres || 233 common_modes[i].h > native_mode->vdisplay ||
242 (common_modes[i].w == native_mode->panel_xres && 234 (common_modes[i].w == native_mode->hdisplay &&
243 common_modes[i].h == native_mode->panel_yres)) 235 common_modes[i].h == native_mode->vdisplay))
244 continue; 236 continue;
245 } 237 }
246 if (common_modes[i].w < 320 || common_modes[i].h < 200) 238 if (common_modes[i].w < 320 || common_modes[i].h < 200)
@@ -344,28 +336,23 @@ static void radeon_fixup_lvds_native_mode(struct drm_encoder *encoder,
344 struct drm_connector *connector) 336 struct drm_connector *connector)
345{ 337{
346 struct radeon_encoder *radeon_encoder = to_radeon_encoder(encoder); 338 struct radeon_encoder *radeon_encoder = to_radeon_encoder(encoder);
347 struct radeon_native_mode *native_mode = &radeon_encoder->native_mode; 339 struct drm_display_mode *native_mode = &radeon_encoder->native_mode;
348 340
349 /* Try to get native mode details from EDID if necessary */ 341 /* Try to get native mode details from EDID if necessary */
350 if (!native_mode->dotclock) { 342 if (!native_mode->clock) {
351 struct drm_display_mode *t, *mode; 343 struct drm_display_mode *t, *mode;
352 344
353 list_for_each_entry_safe(mode, t, &connector->probed_modes, head) { 345 list_for_each_entry_safe(mode, t, &connector->probed_modes, head) {
354 if (mode->hdisplay == native_mode->panel_xres && 346 if (mode->hdisplay == native_mode->hdisplay &&
355 mode->vdisplay == native_mode->panel_yres) { 347 mode->vdisplay == native_mode->vdisplay) {
356 native_mode->hblank = mode->htotal - mode->hdisplay; 348 *native_mode = *mode;
357 native_mode->hoverplus = mode->hsync_start - mode->hdisplay; 349 drm_mode_set_crtcinfo(native_mode, CRTC_INTERLACE_HALVE_V);
358 native_mode->hsync_width = mode->hsync_end - mode->hsync_start;
359 native_mode->vblank = mode->vtotal - mode->vdisplay;
360 native_mode->voverplus = mode->vsync_start - mode->vdisplay;
361 native_mode->vsync_width = mode->vsync_end - mode->vsync_start;
362 native_mode->dotclock = mode->clock;
363 DRM_INFO("Determined LVDS native mode details from EDID\n"); 350 DRM_INFO("Determined LVDS native mode details from EDID\n");
364 break; 351 break;
365 } 352 }
366 } 353 }
367 } 354 }
368 if (!native_mode->dotclock) { 355 if (!native_mode->clock) {
369 DRM_INFO("No LVDS native mode details, disabling RMX\n"); 356 DRM_INFO("No LVDS native mode details, disabling RMX\n");
370 radeon_encoder->rmx_type = RMX_OFF; 357 radeon_encoder->rmx_type = RMX_OFF;
371 } 358 }
@@ -410,13 +397,64 @@ static int radeon_lvds_get_modes(struct drm_connector *connector)
410static int radeon_lvds_mode_valid(struct drm_connector *connector, 397static int radeon_lvds_mode_valid(struct drm_connector *connector,
411 struct drm_display_mode *mode) 398 struct drm_display_mode *mode)
412{ 399{
400 struct drm_encoder *encoder = radeon_best_single_encoder(connector);
401
402 if ((mode->hdisplay < 320) || (mode->vdisplay < 240))
403 return MODE_PANEL;
404
405 if (encoder) {
406 struct radeon_encoder *radeon_encoder = to_radeon_encoder(encoder);
407 struct drm_display_mode *native_mode = &radeon_encoder->native_mode;
408
409 /* AVIVO hardware supports downscaling modes larger than the panel
410 * to the panel size, but I'm not sure this is desirable.
411 */
412 if ((mode->hdisplay > native_mode->hdisplay) ||
413 (mode->vdisplay > native_mode->vdisplay))
414 return MODE_PANEL;
415
416 /* if scaling is disabled, block non-native modes */
417 if (radeon_encoder->rmx_type == RMX_OFF) {
418 if ((mode->hdisplay != native_mode->hdisplay) ||
419 (mode->vdisplay != native_mode->vdisplay))
420 return MODE_PANEL;
421 }
422 }
423
413 return MODE_OK; 424 return MODE_OK;
414} 425}
415 426
416static enum drm_connector_status radeon_lvds_detect(struct drm_connector *connector) 427static enum drm_connector_status radeon_lvds_detect(struct drm_connector *connector)
417{ 428{
418 enum drm_connector_status ret = connector_status_connected; 429 struct radeon_connector *radeon_connector = to_radeon_connector(connector);
430 struct drm_encoder *encoder = radeon_best_single_encoder(connector);
431 enum drm_connector_status ret = connector_status_disconnected;
432
433 if (encoder) {
434 struct radeon_encoder *radeon_encoder = to_radeon_encoder(encoder);
435 struct drm_display_mode *native_mode = &radeon_encoder->native_mode;
436
437 /* check if panel is valid */
438 if (native_mode->hdisplay >= 320 && native_mode->vdisplay >= 240)
439 ret = connector_status_connected;
440
441 }
442
443 /* check for edid as well */
444 if (radeon_connector->edid)
445 ret = connector_status_connected;
446 else {
447 if (radeon_connector->ddc_bus) {
448 radeon_i2c_do_lock(radeon_connector, 1);
449 radeon_connector->edid = drm_get_edid(&radeon_connector->base,
450 &radeon_connector->ddc_bus->adapter);
451 radeon_i2c_do_lock(radeon_connector, 0);
452 if (radeon_connector->edid)
453 ret = connector_status_connected;
454 }
455 }
419 /* check acpi lid status ??? */ 456 /* check acpi lid status ??? */
457
420 radeon_connector_update_scratch_regs(connector, ret); 458 radeon_connector_update_scratch_regs(connector, ret);
421 return ret; 459 return ret;
422} 460}
@@ -427,6 +465,8 @@ static void radeon_connector_destroy(struct drm_connector *connector)
427 465
428 if (radeon_connector->ddc_bus) 466 if (radeon_connector->ddc_bus)
429 radeon_i2c_destroy(radeon_connector->ddc_bus); 467 radeon_i2c_destroy(radeon_connector->ddc_bus);
468 if (radeon_connector->edid)
469 kfree(radeon_connector->edid);
430 kfree(radeon_connector->con_priv); 470 kfree(radeon_connector->con_priv);
431 drm_sysfs_connector_remove(connector); 471 drm_sysfs_connector_remove(connector);
432 drm_connector_cleanup(connector); 472 drm_connector_cleanup(connector);
@@ -496,6 +536,8 @@ static int radeon_vga_get_modes(struct drm_connector *connector)
496static int radeon_vga_mode_valid(struct drm_connector *connector, 536static int radeon_vga_mode_valid(struct drm_connector *connector,
497 struct drm_display_mode *mode) 537 struct drm_display_mode *mode)
498{ 538{
539 /* XXX check mode bandwidth */
540 /* XXX verify against max DAC output frequency */
499 return MODE_OK; 541 return MODE_OK;
500} 542}
501 543
@@ -514,9 +556,33 @@ static enum drm_connector_status radeon_vga_detect(struct drm_connector *connect
514 radeon_i2c_do_lock(radeon_connector, 1); 556 radeon_i2c_do_lock(radeon_connector, 1);
515 dret = radeon_ddc_probe(radeon_connector); 557 dret = radeon_ddc_probe(radeon_connector);
516 radeon_i2c_do_lock(radeon_connector, 0); 558 radeon_i2c_do_lock(radeon_connector, 0);
517 if (dret) 559 if (dret) {
518 ret = connector_status_connected; 560 if (radeon_connector->edid) {
519 else { 561 kfree(radeon_connector->edid);
562 radeon_connector->edid = NULL;
563 }
564 radeon_i2c_do_lock(radeon_connector, 1);
565 radeon_connector->edid = drm_get_edid(&radeon_connector->base, &radeon_connector->ddc_bus->adapter);
566 radeon_i2c_do_lock(radeon_connector, 0);
567
568 if (!radeon_connector->edid) {
569 DRM_ERROR("%s: probed a monitor but no|invalid EDID\n",
570 drm_get_connector_name(connector));
571 ret = connector_status_connected;
572 } else {
573 radeon_connector->use_digital = !!(radeon_connector->edid->input & DRM_EDID_INPUT_DIGITAL);
574
575 /* some oems have boards with separate digital and analog connectors
576 * with a shared ddc line (often vga + hdmi)
577 */
578 if (radeon_connector->use_digital && radeon_connector->shared_ddc) {
579 kfree(radeon_connector->edid);
580 radeon_connector->edid = NULL;
581 ret = connector_status_disconnected;
582 } else
583 ret = connector_status_connected;
584 }
585 } else {
520 if (radeon_connector->dac_load_detect) { 586 if (radeon_connector->dac_load_detect) {
521 encoder_funcs = encoder->helper_private; 587 encoder_funcs = encoder->helper_private;
522 ret = encoder_funcs->detect(encoder, connector); 588 ret = encoder_funcs->detect(encoder, connector);
@@ -570,6 +636,8 @@ static int radeon_tv_get_modes(struct drm_connector *connector)
570static int radeon_tv_mode_valid(struct drm_connector *connector, 636static int radeon_tv_mode_valid(struct drm_connector *connector,
571 struct drm_display_mode *mode) 637 struct drm_display_mode *mode)
572{ 638{
639 if ((mode->hdisplay > 1024) || (mode->vdisplay > 768))
640 return MODE_CLOCK_RANGE;
573 return MODE_OK; 641 return MODE_OK;
574} 642}
575 643
@@ -644,20 +712,29 @@ static enum drm_connector_status radeon_dvi_detect(struct drm_connector *connect
644 dret = radeon_ddc_probe(radeon_connector); 712 dret = radeon_ddc_probe(radeon_connector);
645 radeon_i2c_do_lock(radeon_connector, 0); 713 radeon_i2c_do_lock(radeon_connector, 0);
646 if (dret) { 714 if (dret) {
715 if (radeon_connector->edid) {
716 kfree(radeon_connector->edid);
717 radeon_connector->edid = NULL;
718 }
647 radeon_i2c_do_lock(radeon_connector, 1); 719 radeon_i2c_do_lock(radeon_connector, 1);
648 radeon_connector->edid = drm_get_edid(&radeon_connector->base, &radeon_connector->ddc_bus->adapter); 720 radeon_connector->edid = drm_get_edid(&radeon_connector->base, &radeon_connector->ddc_bus->adapter);
649 radeon_i2c_do_lock(radeon_connector, 0); 721 radeon_i2c_do_lock(radeon_connector, 0);
650 722
651 if (!radeon_connector->edid) { 723 if (!radeon_connector->edid) {
652 DRM_ERROR("DDC responded but not EDID found for %s\n", 724 DRM_ERROR("%s: probed a monitor but no|invalid EDID\n",
653 drm_get_connector_name(connector)); 725 drm_get_connector_name(connector));
654 } else { 726 } else {
655 radeon_connector->use_digital = !!(radeon_connector->edid->input & DRM_EDID_INPUT_DIGITAL); 727 radeon_connector->use_digital = !!(radeon_connector->edid->input & DRM_EDID_INPUT_DIGITAL);
656 728
657 /* if this isn't a digital monitor 729 /* some oems have boards with separate digital and analog connectors
658 then we need to make sure we don't have any 730 * with a shared ddc line (often vga + hdmi)
659 TV conflicts */ 731 */
660 ret = connector_status_connected; 732 if ((!radeon_connector->use_digital) && radeon_connector->shared_ddc) {
733 kfree(radeon_connector->edid);
734 radeon_connector->edid = NULL;
735 ret = connector_status_disconnected;
736 } else
737 ret = connector_status_connected;
661 } 738 }
662 } 739 }
663 740
@@ -753,9 +830,27 @@ static void radeon_dvi_force(struct drm_connector *connector)
753 radeon_connector->use_digital = true; 830 radeon_connector->use_digital = true;
754} 831}
755 832
833static int radeon_dvi_mode_valid(struct drm_connector *connector,
834 struct drm_display_mode *mode)
835{
836 struct radeon_connector *radeon_connector = to_radeon_connector(connector);
837
838 /* XXX check mode bandwidth */
839
840 if (radeon_connector->use_digital && (mode->clock > 165000)) {
841 if ((radeon_connector->connector_object_id == CONNECTOR_OBJECT_ID_DUAL_LINK_DVI_I) ||
842 (radeon_connector->connector_object_id == CONNECTOR_OBJECT_ID_DUAL_LINK_DVI_D) ||
843 (radeon_connector->connector_object_id == CONNECTOR_OBJECT_ID_HDMI_TYPE_B))
844 return MODE_OK;
845 else
846 return MODE_CLOCK_HIGH;
847 }
848 return MODE_OK;
849}
850
756struct drm_connector_helper_funcs radeon_dvi_connector_helper_funcs = { 851struct drm_connector_helper_funcs radeon_dvi_connector_helper_funcs = {
757 .get_modes = radeon_dvi_get_modes, 852 .get_modes = radeon_dvi_get_modes,
758 .mode_valid = radeon_vga_mode_valid, 853 .mode_valid = radeon_dvi_mode_valid,
759 .best_encoder = radeon_dvi_encoder, 854 .best_encoder = radeon_dvi_encoder,
760}; 855};
761 856
@@ -775,13 +870,15 @@ radeon_add_atom_connector(struct drm_device *dev,
775 int connector_type, 870 int connector_type,
776 struct radeon_i2c_bus_rec *i2c_bus, 871 struct radeon_i2c_bus_rec *i2c_bus,
777 bool linkb, 872 bool linkb,
778 uint32_t igp_lane_info) 873 uint32_t igp_lane_info,
874 uint16_t connector_object_id)
779{ 875{
780 struct radeon_device *rdev = dev->dev_private; 876 struct radeon_device *rdev = dev->dev_private;
781 struct drm_connector *connector; 877 struct drm_connector *connector;
782 struct radeon_connector *radeon_connector; 878 struct radeon_connector *radeon_connector;
783 struct radeon_connector_atom_dig *radeon_dig_connector; 879 struct radeon_connector_atom_dig *radeon_dig_connector;
784 uint32_t subpixel_order = SubPixelNone; 880 uint32_t subpixel_order = SubPixelNone;
881 bool shared_ddc = false;
785 int ret; 882 int ret;
786 883
787 /* fixme - tv/cv/din */ 884 /* fixme - tv/cv/din */
@@ -795,6 +892,13 @@ radeon_add_atom_connector(struct drm_device *dev,
795 radeon_connector->devices |= supported_device; 892 radeon_connector->devices |= supported_device;
796 return; 893 return;
797 } 894 }
895 if (radeon_connector->ddc_bus && i2c_bus->valid) {
896 if (memcmp(&radeon_connector->ddc_bus->rec, i2c_bus,
897 sizeof(struct radeon_i2c_bus_rec)) == 0) {
898 radeon_connector->shared_ddc = true;
899 shared_ddc = true;
900 }
901 }
798 } 902 }
799 903
800 radeon_connector = kzalloc(sizeof(struct radeon_connector), GFP_KERNEL); 904 radeon_connector = kzalloc(sizeof(struct radeon_connector), GFP_KERNEL);
@@ -805,6 +909,8 @@ radeon_add_atom_connector(struct drm_device *dev,
805 909
806 radeon_connector->connector_id = connector_id; 910 radeon_connector->connector_id = connector_id;
807 radeon_connector->devices = supported_device; 911 radeon_connector->devices = supported_device;
912 radeon_connector->shared_ddc = shared_ddc;
913 radeon_connector->connector_object_id = connector_object_id;
808 switch (connector_type) { 914 switch (connector_type) {
809 case DRM_MODE_CONNECTOR_VGA: 915 case DRM_MODE_CONNECTOR_VGA:
810 drm_connector_init(dev, &radeon_connector->base, &radeon_vga_connector_funcs, connector_type); 916 drm_connector_init(dev, &radeon_connector->base, &radeon_vga_connector_funcs, connector_type);
@@ -956,7 +1062,8 @@ radeon_add_legacy_connector(struct drm_device *dev,
956 uint32_t connector_id, 1062 uint32_t connector_id,
957 uint32_t supported_device, 1063 uint32_t supported_device,
958 int connector_type, 1064 int connector_type,
959 struct radeon_i2c_bus_rec *i2c_bus) 1065 struct radeon_i2c_bus_rec *i2c_bus,
1066 uint16_t connector_object_id)
960{ 1067{
961 struct radeon_device *rdev = dev->dev_private; 1068 struct radeon_device *rdev = dev->dev_private;
962 struct drm_connector *connector; 1069 struct drm_connector *connector;
@@ -985,6 +1092,7 @@ radeon_add_legacy_connector(struct drm_device *dev,
985 1092
986 radeon_connector->connector_id = connector_id; 1093 radeon_connector->connector_id = connector_id;
987 radeon_connector->devices = supported_device; 1094 radeon_connector->devices = supported_device;
1095 radeon_connector->connector_object_id = connector_object_id;
988 switch (connector_type) { 1096 switch (connector_type) {
989 case DRM_MODE_CONNECTOR_VGA: 1097 case DRM_MODE_CONNECTOR_VGA:
990 drm_connector_init(dev, &radeon_connector->base, &radeon_vga_connector_funcs, connector_type); 1098 drm_connector_init(dev, &radeon_connector->base, &radeon_vga_connector_funcs, connector_type);
@@ -1042,6 +1150,13 @@ radeon_add_legacy_connector(struct drm_device *dev,
1042 if (ret) 1150 if (ret)
1043 goto failed; 1151 goto failed;
1044 radeon_connector->dac_load_detect = true; 1152 radeon_connector->dac_load_detect = true;
1153 /* RS400,RC410,RS480 chipset seems to report a lot
1154 * of false positive on load detect, we haven't yet
1155 * found a way to make load detect reliable on those
1156 * chipset, thus just disable it for TV.
1157 */
1158 if (rdev->family == CHIP_RS400 || rdev->family == CHIP_RS480)
1159 radeon_connector->dac_load_detect = false;
1045 drm_connector_attach_property(&radeon_connector->base, 1160 drm_connector_attach_property(&radeon_connector->base,
1046 rdev->mode_info.load_detect_property, 1161 rdev->mode_info.load_detect_property,
1047 1); 1162 1);
diff --git a/drivers/gpu/drm/radeon/radeon_cursor.c b/drivers/gpu/drm/radeon/radeon_cursor.c
index b13c79e38bc0..28772a37009c 100644
--- a/drivers/gpu/drm/radeon/radeon_cursor.c
+++ b/drivers/gpu/drm/radeon/radeon_cursor.c
@@ -109,9 +109,15 @@ static void radeon_set_cursor(struct drm_crtc *crtc, struct drm_gem_object *obj,
109 struct radeon_crtc *radeon_crtc = to_radeon_crtc(crtc); 109 struct radeon_crtc *radeon_crtc = to_radeon_crtc(crtc);
110 struct radeon_device *rdev = crtc->dev->dev_private; 110 struct radeon_device *rdev = crtc->dev->dev_private;
111 111
112 if (ASIC_IS_AVIVO(rdev)) 112 if (ASIC_IS_AVIVO(rdev)) {
113 if (rdev->family >= CHIP_RV770) {
114 if (radeon_crtc->crtc_id)
115 WREG32(R700_D2CUR_SURFACE_ADDRESS_HIGH, 0);
116 else
117 WREG32(R700_D1CUR_SURFACE_ADDRESS_HIGH, 0);
118 }
113 WREG32(AVIVO_D1CUR_SURFACE_ADDRESS + radeon_crtc->crtc_offset, gpu_addr); 119 WREG32(AVIVO_D1CUR_SURFACE_ADDRESS + radeon_crtc->crtc_offset, gpu_addr);
114 else { 120 } else {
115 radeon_crtc->legacy_cursor_offset = gpu_addr - radeon_crtc->legacy_display_base_addr; 121 radeon_crtc->legacy_cursor_offset = gpu_addr - radeon_crtc->legacy_display_base_addr;
116 /* offset is from DISP(2)_BASE_ADDRESS */ 122 /* offset is from DISP(2)_BASE_ADDRESS */
117 WREG32(RADEON_CUR_OFFSET + radeon_crtc->crtc_offset, radeon_crtc->legacy_cursor_offset); 123 WREG32(RADEON_CUR_OFFSET + radeon_crtc->crtc_offset, radeon_crtc->legacy_cursor_offset);
diff --git a/drivers/gpu/drm/radeon/radeon_device.c b/drivers/gpu/drm/radeon/radeon_device.c
index df988142e6b0..41bb76fbe734 100644
--- a/drivers/gpu/drm/radeon/radeon_device.c
+++ b/drivers/gpu/drm/radeon/radeon_device.c
@@ -444,20 +444,24 @@ static uint32_t cail_reg_read(struct card_info *info, uint32_t reg)
444 return r; 444 return r;
445} 445}
446 446
447static struct card_info atom_card_info = {
448 .dev = NULL,
449 .reg_read = cail_reg_read,
450 .reg_write = cail_reg_write,
451 .mc_read = cail_mc_read,
452 .mc_write = cail_mc_write,
453 .pll_read = cail_pll_read,
454 .pll_write = cail_pll_write,
455};
456
457int radeon_atombios_init(struct radeon_device *rdev) 447int radeon_atombios_init(struct radeon_device *rdev)
458{ 448{
459 atom_card_info.dev = rdev->ddev; 449 struct card_info *atom_card_info =
460 rdev->mode_info.atom_context = atom_parse(&atom_card_info, rdev->bios); 450 kzalloc(sizeof(struct card_info), GFP_KERNEL);
451
452 if (!atom_card_info)
453 return -ENOMEM;
454
455 rdev->mode_info.atom_card_info = atom_card_info;
456 atom_card_info->dev = rdev->ddev;
457 atom_card_info->reg_read = cail_reg_read;
458 atom_card_info->reg_write = cail_reg_write;
459 atom_card_info->mc_read = cail_mc_read;
460 atom_card_info->mc_write = cail_mc_write;
461 atom_card_info->pll_read = cail_pll_read;
462 atom_card_info->pll_write = cail_pll_write;
463
464 rdev->mode_info.atom_context = atom_parse(atom_card_info, rdev->bios);
461 radeon_atom_initialize_bios_scratch_regs(rdev->ddev); 465 radeon_atom_initialize_bios_scratch_regs(rdev->ddev);
462 return 0; 466 return 0;
463} 467}
@@ -465,6 +469,7 @@ int radeon_atombios_init(struct radeon_device *rdev)
465void radeon_atombios_fini(struct radeon_device *rdev) 469void radeon_atombios_fini(struct radeon_device *rdev)
466{ 470{
467 kfree(rdev->mode_info.atom_context); 471 kfree(rdev->mode_info.atom_context);
472 kfree(rdev->mode_info.atom_card_info);
468} 473}
469 474
470int radeon_combios_init(struct radeon_device *rdev) 475int radeon_combios_init(struct radeon_device *rdev)
@@ -683,6 +688,8 @@ int radeon_resume_kms(struct drm_device *dev)
683 return -1; 688 return -1;
684 } 689 }
685 pci_set_master(dev->pdev); 690 pci_set_master(dev->pdev);
691 /* resume AGP if in use */
692 radeon_agp_resume(rdev);
686 radeon_resume(rdev); 693 radeon_resume(rdev);
687 radeon_restore_bios_scratch_regs(rdev); 694 radeon_restore_bios_scratch_regs(rdev);
688 fb_set_suspend(rdev->fbdev_info, 0); 695 fb_set_suspend(rdev->fbdev_info, 0);
diff --git a/drivers/gpu/drm/radeon/radeon_display.c b/drivers/gpu/drm/radeon/radeon_display.c
index 3655d91993a6..c85df4afcb7a 100644
--- a/drivers/gpu/drm/radeon/radeon_display.c
+++ b/drivers/gpu/drm/radeon/radeon_display.c
@@ -137,9 +137,6 @@ static void radeon_crtc_gamma_set(struct drm_crtc *crtc, u16 *red, u16 *green,
137 if (size != 256) { 137 if (size != 256) {
138 return; 138 return;
139 } 139 }
140 if (crtc->fb == NULL) {
141 return;
142 }
143 140
144 /* userspace palettes are always correct as is */ 141 /* userspace palettes are always correct as is */
145 for (i = 0; i < 256; i++) { 142 for (i = 0; i < 256; i++) {
@@ -147,7 +144,6 @@ static void radeon_crtc_gamma_set(struct drm_crtc *crtc, u16 *red, u16 *green,
147 radeon_crtc->lut_g[i] = green[i] >> 6; 144 radeon_crtc->lut_g[i] = green[i] >> 6;
148 radeon_crtc->lut_b[i] = blue[i] >> 6; 145 radeon_crtc->lut_b[i] = blue[i] >> 6;
149 } 146 }
150
151 radeon_crtc_load_lut(crtc); 147 radeon_crtc_load_lut(crtc);
152} 148}
153 149
@@ -338,27 +334,19 @@ static bool radeon_setup_enc_conn(struct drm_device *dev)
338 334
339int radeon_ddc_get_modes(struct radeon_connector *radeon_connector) 335int radeon_ddc_get_modes(struct radeon_connector *radeon_connector)
340{ 336{
341 struct edid *edid;
342 int ret = 0; 337 int ret = 0;
343 338
344 if (!radeon_connector->ddc_bus) 339 if (!radeon_connector->ddc_bus)
345 return -1; 340 return -1;
346 if (!radeon_connector->edid) { 341 if (!radeon_connector->edid) {
347 radeon_i2c_do_lock(radeon_connector, 1); 342 radeon_i2c_do_lock(radeon_connector, 1);
348 edid = drm_get_edid(&radeon_connector->base, &radeon_connector->ddc_bus->adapter); 343 radeon_connector->edid = drm_get_edid(&radeon_connector->base, &radeon_connector->ddc_bus->adapter);
349 radeon_i2c_do_lock(radeon_connector, 0); 344 radeon_i2c_do_lock(radeon_connector, 0);
350 } else 345 }
351 edid = radeon_connector->edid;
352 346
353 if (edid) { 347 if (radeon_connector->edid) {
354 /* update digital bits here */ 348 drm_mode_connector_update_edid_property(&radeon_connector->base, radeon_connector->edid);
355 if (edid->input & DRM_EDID_INPUT_DIGITAL) 349 ret = drm_add_edid_modes(&radeon_connector->base, radeon_connector->edid);
356 radeon_connector->use_digital = 1;
357 else
358 radeon_connector->use_digital = 0;
359 drm_mode_connector_update_edid_property(&radeon_connector->base, edid);
360 ret = drm_add_edid_modes(&radeon_connector->base, edid);
361 kfree(edid);
362 return ret; 350 return ret;
363 } 351 }
364 drm_mode_connector_update_edid_property(&radeon_connector->base, NULL); 352 drm_mode_connector_update_edid_property(&radeon_connector->base, NULL);
@@ -765,7 +753,7 @@ bool radeon_crtc_scaling_mode_fixup(struct drm_crtc *crtc,
765 radeon_crtc->rmx_type = radeon_encoder->rmx_type; 753 radeon_crtc->rmx_type = radeon_encoder->rmx_type;
766 memcpy(&radeon_crtc->native_mode, 754 memcpy(&radeon_crtc->native_mode,
767 &radeon_encoder->native_mode, 755 &radeon_encoder->native_mode,
768 sizeof(struct radeon_native_mode)); 756 sizeof(struct drm_display_mode));
769 first = false; 757 first = false;
770 } else { 758 } else {
771 if (radeon_crtc->rmx_type != radeon_encoder->rmx_type) { 759 if (radeon_crtc->rmx_type != radeon_encoder->rmx_type) {
@@ -783,10 +771,10 @@ bool radeon_crtc_scaling_mode_fixup(struct drm_crtc *crtc,
783 if (radeon_crtc->rmx_type != RMX_OFF) { 771 if (radeon_crtc->rmx_type != RMX_OFF) {
784 fixed20_12 a, b; 772 fixed20_12 a, b;
785 a.full = rfixed_const(crtc->mode.vdisplay); 773 a.full = rfixed_const(crtc->mode.vdisplay);
786 b.full = rfixed_const(radeon_crtc->native_mode.panel_xres); 774 b.full = rfixed_const(radeon_crtc->native_mode.hdisplay);
787 radeon_crtc->vsc.full = rfixed_div(a, b); 775 radeon_crtc->vsc.full = rfixed_div(a, b);
788 a.full = rfixed_const(crtc->mode.hdisplay); 776 a.full = rfixed_const(crtc->mode.hdisplay);
789 b.full = rfixed_const(radeon_crtc->native_mode.panel_yres); 777 b.full = rfixed_const(radeon_crtc->native_mode.vdisplay);
790 radeon_crtc->hsc.full = rfixed_div(a, b); 778 radeon_crtc->hsc.full = rfixed_div(a, b);
791 } else { 779 } else {
792 radeon_crtc->vsc.full = rfixed_const(1); 780 radeon_crtc->vsc.full = rfixed_const(1);
diff --git a/drivers/gpu/drm/radeon/radeon_encoders.c b/drivers/gpu/drm/radeon/radeon_encoders.c
index a65ab1a0dad2..d42bc512d75a 100644
--- a/drivers/gpu/drm/radeon/radeon_encoders.c
+++ b/drivers/gpu/drm/radeon/radeon_encoders.c
@@ -31,6 +31,10 @@
31 31
32extern int atom_debug; 32extern int atom_debug;
33 33
34/* evil but including atombios.h is much worse */
35bool radeon_atom_get_tv_timings(struct radeon_device *rdev, int index,
36 struct drm_display_mode *mode);
37
34uint32_t 38uint32_t
35radeon_get_encoder_id(struct drm_device *dev, uint32_t supported_device, uint8_t dac) 39radeon_get_encoder_id(struct drm_device *dev, uint32_t supported_device, uint8_t dac)
36{ 40{
@@ -167,49 +171,17 @@ void radeon_rmx_mode_fixup(struct drm_encoder *encoder,
167 struct radeon_encoder *radeon_encoder = to_radeon_encoder(encoder); 171 struct radeon_encoder *radeon_encoder = to_radeon_encoder(encoder);
168 struct drm_device *dev = encoder->dev; 172 struct drm_device *dev = encoder->dev;
169 struct radeon_device *rdev = dev->dev_private; 173 struct radeon_device *rdev = dev->dev_private;
170 struct radeon_native_mode *native_mode = &radeon_encoder->native_mode; 174 struct drm_display_mode *native_mode = &radeon_encoder->native_mode;
171 175
172 if (mode->hdisplay < native_mode->panel_xres || 176 if (mode->hdisplay < native_mode->hdisplay ||
173 mode->vdisplay < native_mode->panel_yres) { 177 mode->vdisplay < native_mode->vdisplay) {
174 if (ASIC_IS_AVIVO(rdev)) { 178 int mode_id = adjusted_mode->base.id;
175 adjusted_mode->hdisplay = native_mode->panel_xres; 179 *adjusted_mode = *native_mode;
176 adjusted_mode->vdisplay = native_mode->panel_yres; 180 if (!ASIC_IS_AVIVO(rdev)) {
177 adjusted_mode->htotal = native_mode->panel_xres + native_mode->hblank; 181 adjusted_mode->hdisplay = mode->hdisplay;
178 adjusted_mode->hsync_start = native_mode->panel_xres + native_mode->hoverplus; 182 adjusted_mode->vdisplay = mode->vdisplay;
179 adjusted_mode->hsync_end = adjusted_mode->hsync_start + native_mode->hsync_width;
180 adjusted_mode->vtotal = native_mode->panel_yres + native_mode->vblank;
181 adjusted_mode->vsync_start = native_mode->panel_yres + native_mode->voverplus;
182 adjusted_mode->vsync_end = adjusted_mode->vsync_start + native_mode->vsync_width;
183 /* update crtc values */
184 drm_mode_set_crtcinfo(adjusted_mode, CRTC_INTERLACE_HALVE_V);
185 /* adjust crtc values */
186 adjusted_mode->crtc_hdisplay = native_mode->panel_xres;
187 adjusted_mode->crtc_vdisplay = native_mode->panel_yres;
188 adjusted_mode->crtc_htotal = adjusted_mode->crtc_hdisplay + native_mode->hblank;
189 adjusted_mode->crtc_hsync_start = adjusted_mode->crtc_hdisplay + native_mode->hoverplus;
190 adjusted_mode->crtc_hsync_end = adjusted_mode->crtc_hsync_start + native_mode->hsync_width;
191 adjusted_mode->crtc_vtotal = adjusted_mode->crtc_vdisplay + native_mode->vblank;
192 adjusted_mode->crtc_vsync_start = adjusted_mode->crtc_vdisplay + native_mode->voverplus;
193 adjusted_mode->crtc_vsync_end = adjusted_mode->crtc_vsync_start + native_mode->vsync_width;
194 } else {
195 adjusted_mode->htotal = native_mode->panel_xres + native_mode->hblank;
196 adjusted_mode->hsync_start = native_mode->panel_xres + native_mode->hoverplus;
197 adjusted_mode->hsync_end = adjusted_mode->hsync_start + native_mode->hsync_width;
198 adjusted_mode->vtotal = native_mode->panel_yres + native_mode->vblank;
199 adjusted_mode->vsync_start = native_mode->panel_yres + native_mode->voverplus;
200 adjusted_mode->vsync_end = adjusted_mode->vsync_start + native_mode->vsync_width;
201 /* update crtc values */
202 drm_mode_set_crtcinfo(adjusted_mode, CRTC_INTERLACE_HALVE_V);
203 /* adjust crtc values */
204 adjusted_mode->crtc_htotal = adjusted_mode->crtc_hdisplay + native_mode->hblank;
205 adjusted_mode->crtc_hsync_start = adjusted_mode->crtc_hdisplay + native_mode->hoverplus;
206 adjusted_mode->crtc_hsync_end = adjusted_mode->crtc_hsync_start + native_mode->hsync_width;
207 adjusted_mode->crtc_vtotal = adjusted_mode->crtc_vdisplay + native_mode->vblank;
208 adjusted_mode->crtc_vsync_start = adjusted_mode->crtc_vdisplay + native_mode->voverplus;
209 adjusted_mode->crtc_vsync_end = adjusted_mode->crtc_vsync_start + native_mode->vsync_width;
210 } 183 }
211 adjusted_mode->flags = native_mode->flags; 184 adjusted_mode->base.id = mode_id;
212 adjusted_mode->clock = native_mode->dotclock;
213 } 185 }
214} 186}
215 187
@@ -219,7 +191,11 @@ static bool radeon_atom_mode_fixup(struct drm_encoder *encoder,
219 struct drm_display_mode *adjusted_mode) 191 struct drm_display_mode *adjusted_mode)
220{ 192{
221 struct radeon_encoder *radeon_encoder = to_radeon_encoder(encoder); 193 struct radeon_encoder *radeon_encoder = to_radeon_encoder(encoder);
194 struct drm_device *dev = encoder->dev;
195 struct radeon_device *rdev = dev->dev_private;
222 196
197 /* set the active encoder to connector routing */
198 radeon_encoder_set_active_device(encoder);
223 drm_mode_set_crtcinfo(adjusted_mode, 0); 199 drm_mode_set_crtcinfo(adjusted_mode, 0);
224 200
225 if (radeon_encoder->rmx_type != RMX_OFF) 201 if (radeon_encoder->rmx_type != RMX_OFF)
@@ -230,6 +206,18 @@ static bool radeon_atom_mode_fixup(struct drm_encoder *encoder,
230 && (mode->crtc_vsync_start < (mode->crtc_vdisplay + 2))) 206 && (mode->crtc_vsync_start < (mode->crtc_vdisplay + 2)))
231 adjusted_mode->crtc_vsync_start = adjusted_mode->crtc_vdisplay + 2; 207 adjusted_mode->crtc_vsync_start = adjusted_mode->crtc_vdisplay + 2;
232 208
209 if (radeon_encoder->active_device & (ATOM_DEVICE_TV_SUPPORT)) {
210 struct radeon_encoder_atom_dac *tv_dac = radeon_encoder->enc_priv;
211 if (tv_dac) {
212 if (tv_dac->tv_std == TV_STD_NTSC ||
213 tv_dac->tv_std == TV_STD_NTSC_J ||
214 tv_dac->tv_std == TV_STD_PAL_M)
215 radeon_atom_get_tv_timings(rdev, 0, adjusted_mode);
216 else
217 radeon_atom_get_tv_timings(rdev, 1, adjusted_mode);
218 }
219 }
220
233 return true; 221 return true;
234} 222}
235 223
@@ -461,7 +449,7 @@ atombios_digital_setup(struct drm_encoder *encoder, int action)
461 case 1: 449 case 1:
462 args.v1.ucMisc = 0; 450 args.v1.ucMisc = 0;
463 args.v1.ucAction = action; 451 args.v1.ucAction = action;
464 if (drm_detect_hdmi_monitor((struct edid *)connector->edid_blob_ptr)) 452 if (drm_detect_hdmi_monitor(radeon_connector->edid))
465 args.v1.ucMisc |= PANEL_ENCODER_MISC_HDMI_TYPE; 453 args.v1.ucMisc |= PANEL_ENCODER_MISC_HDMI_TYPE;
466 args.v1.usPixelClock = cpu_to_le16(radeon_encoder->pixel_clock / 10); 454 args.v1.usPixelClock = cpu_to_le16(radeon_encoder->pixel_clock / 10);
467 if (radeon_encoder->devices & (ATOM_DEVICE_LCD_SUPPORT)) { 455 if (radeon_encoder->devices & (ATOM_DEVICE_LCD_SUPPORT)) {
@@ -486,7 +474,7 @@ atombios_digital_setup(struct drm_encoder *encoder, int action)
486 if (dig->coherent_mode) 474 if (dig->coherent_mode)
487 args.v2.ucMisc |= PANEL_ENCODER_MISC_COHERENT; 475 args.v2.ucMisc |= PANEL_ENCODER_MISC_COHERENT;
488 } 476 }
489 if (drm_detect_hdmi_monitor((struct edid *)connector->edid_blob_ptr)) 477 if (drm_detect_hdmi_monitor(radeon_connector->edid))
490 args.v2.ucMisc |= PANEL_ENCODER_MISC_HDMI_TYPE; 478 args.v2.ucMisc |= PANEL_ENCODER_MISC_HDMI_TYPE;
491 args.v2.usPixelClock = cpu_to_le16(radeon_encoder->pixel_clock / 10); 479 args.v2.usPixelClock = cpu_to_le16(radeon_encoder->pixel_clock / 10);
492 args.v2.ucTruncate = 0; 480 args.v2.ucTruncate = 0;
@@ -544,7 +532,7 @@ atombios_get_encoder_mode(struct drm_encoder *encoder)
544 switch (connector->connector_type) { 532 switch (connector->connector_type) {
545 case DRM_MODE_CONNECTOR_DVII: 533 case DRM_MODE_CONNECTOR_DVII:
546 case DRM_MODE_CONNECTOR_HDMIB: /* HDMI-B is basically DL-DVI; analog works fine */ 534 case DRM_MODE_CONNECTOR_HDMIB: /* HDMI-B is basically DL-DVI; analog works fine */
547 if (drm_detect_hdmi_monitor((struct edid *)connector->edid_blob_ptr)) 535 if (drm_detect_hdmi_monitor(radeon_connector->edid))
548 return ATOM_ENCODER_MODE_HDMI; 536 return ATOM_ENCODER_MODE_HDMI;
549 else if (radeon_connector->use_digital) 537 else if (radeon_connector->use_digital)
550 return ATOM_ENCODER_MODE_DVI; 538 return ATOM_ENCODER_MODE_DVI;
@@ -554,7 +542,7 @@ atombios_get_encoder_mode(struct drm_encoder *encoder)
554 case DRM_MODE_CONNECTOR_DVID: 542 case DRM_MODE_CONNECTOR_DVID:
555 case DRM_MODE_CONNECTOR_HDMIA: 543 case DRM_MODE_CONNECTOR_HDMIA:
556 default: 544 default:
557 if (drm_detect_hdmi_monitor((struct edid *)connector->edid_blob_ptr)) 545 if (drm_detect_hdmi_monitor(radeon_connector->edid))
558 return ATOM_ENCODER_MODE_HDMI; 546 return ATOM_ENCODER_MODE_HDMI;
559 else 547 else
560 return ATOM_ENCODER_MODE_DVI; 548 return ATOM_ENCODER_MODE_DVI;
@@ -566,7 +554,7 @@ atombios_get_encoder_mode(struct drm_encoder *encoder)
566 /*if (radeon_output->MonType == MT_DP) 554 /*if (radeon_output->MonType == MT_DP)
567 return ATOM_ENCODER_MODE_DP; 555 return ATOM_ENCODER_MODE_DP;
568 else*/ 556 else*/
569 if (drm_detect_hdmi_monitor((struct edid *)connector->edid_blob_ptr)) 557 if (drm_detect_hdmi_monitor(radeon_connector->edid))
570 return ATOM_ENCODER_MODE_HDMI; 558 return ATOM_ENCODER_MODE_HDMI;
571 else 559 else
572 return ATOM_ENCODER_MODE_DVI; 560 return ATOM_ENCODER_MODE_DVI;
@@ -734,14 +722,17 @@ atombios_dig_transmitter_setup(struct drm_encoder *encoder, int action)
734 atom_parse_cmd_header(rdev->mode_info.atom_context, index, &frev, &crev); 722 atom_parse_cmd_header(rdev->mode_info.atom_context, index, &frev, &crev);
735 723
736 args.v1.ucAction = action; 724 args.v1.ucAction = action;
737 725 if (action == ATOM_TRANSMITTER_ACTION_INIT) {
726 args.v1.usInitInfo = radeon_connector->connector_object_id;
727 } else {
728 if (radeon_encoder->pixel_clock > 165000)
729 args.v1.usPixelClock = cpu_to_le16((radeon_encoder->pixel_clock / 2) / 10);
730 else
731 args.v1.usPixelClock = cpu_to_le16(radeon_encoder->pixel_clock / 10);
732 }
738 if (ASIC_IS_DCE32(rdev)) { 733 if (ASIC_IS_DCE32(rdev)) {
739 if (radeon_encoder->pixel_clock > 165000) { 734 if (radeon_encoder->pixel_clock > 165000)
740 args.v2.usPixelClock = cpu_to_le16((radeon_encoder->pixel_clock * 10 * 2) / 100); 735 args.v2.usPixelClock = cpu_to_le16((radeon_encoder->pixel_clock / 2) / 10);
741 args.v2.acConfig.fDualLinkConnector = 1;
742 } else {
743 args.v2.usPixelClock = cpu_to_le16((radeon_encoder->pixel_clock * 10 * 4) / 100);
744 }
745 if (dig->dig_block) 736 if (dig->dig_block)
746 args.v2.acConfig.ucEncoderSel = 1; 737 args.v2.acConfig.ucEncoderSel = 1;
747 738
@@ -766,7 +757,6 @@ atombios_dig_transmitter_setup(struct drm_encoder *encoder, int action)
766 } 757 }
767 } else { 758 } else {
768 args.v1.ucConfig = ATOM_TRANSMITTER_CONFIG_CLKSRC_PPLL; 759 args.v1.ucConfig = ATOM_TRANSMITTER_CONFIG_CLKSRC_PPLL;
769 args.v1.usPixelClock = cpu_to_le16((radeon_encoder->pixel_clock) / 10);
770 760
771 switch (radeon_encoder->encoder_id) { 761 switch (radeon_encoder->encoder_id) {
772 case ENCODER_OBJECT_ID_INTERNAL_UNIPHY: 762 case ENCODER_OBJECT_ID_INTERNAL_UNIPHY:
@@ -874,16 +864,9 @@ radeon_atom_encoder_dpms(struct drm_encoder *encoder, int mode)
874 DISPLAY_DEVICE_OUTPUT_CONTROL_PS_ALLOCATION args; 864 DISPLAY_DEVICE_OUTPUT_CONTROL_PS_ALLOCATION args;
875 int index = 0; 865 int index = 0;
876 bool is_dig = false; 866 bool is_dig = false;
877 int devices;
878 867
879 memset(&args, 0, sizeof(args)); 868 memset(&args, 0, sizeof(args));
880 869
881 /* on DPMS off we have no idea if active device is meaningful */
882 if (mode != DRM_MODE_DPMS_ON && !radeon_encoder->active_device)
883 devices = radeon_encoder->devices;
884 else
885 devices = radeon_encoder->active_device;
886
887 DRM_DEBUG("encoder dpms %d to mode %d, devices %08x, active_devices %08x\n", 870 DRM_DEBUG("encoder dpms %d to mode %d, devices %08x, active_devices %08x\n",
888 radeon_encoder->encoder_id, mode, radeon_encoder->devices, 871 radeon_encoder->encoder_id, mode, radeon_encoder->devices,
889 radeon_encoder->active_device); 872 radeon_encoder->active_device);
@@ -914,18 +897,18 @@ radeon_atom_encoder_dpms(struct drm_encoder *encoder, int mode)
914 break; 897 break;
915 case ENCODER_OBJECT_ID_INTERNAL_DAC1: 898 case ENCODER_OBJECT_ID_INTERNAL_DAC1:
916 case ENCODER_OBJECT_ID_INTERNAL_KLDSCP_DAC1: 899 case ENCODER_OBJECT_ID_INTERNAL_KLDSCP_DAC1:
917 if (devices & (ATOM_DEVICE_TV_SUPPORT)) 900 if (radeon_encoder->active_device & (ATOM_DEVICE_TV_SUPPORT))
918 index = GetIndexIntoMasterTable(COMMAND, TV1OutputControl); 901 index = GetIndexIntoMasterTable(COMMAND, TV1OutputControl);
919 else if (devices & (ATOM_DEVICE_CV_SUPPORT)) 902 else if (radeon_encoder->active_device & (ATOM_DEVICE_CV_SUPPORT))
920 index = GetIndexIntoMasterTable(COMMAND, CV1OutputControl); 903 index = GetIndexIntoMasterTable(COMMAND, CV1OutputControl);
921 else 904 else
922 index = GetIndexIntoMasterTable(COMMAND, DAC1OutputControl); 905 index = GetIndexIntoMasterTable(COMMAND, DAC1OutputControl);
923 break; 906 break;
924 case ENCODER_OBJECT_ID_INTERNAL_DAC2: 907 case ENCODER_OBJECT_ID_INTERNAL_DAC2:
925 case ENCODER_OBJECT_ID_INTERNAL_KLDSCP_DAC2: 908 case ENCODER_OBJECT_ID_INTERNAL_KLDSCP_DAC2:
926 if (devices & (ATOM_DEVICE_TV_SUPPORT)) 909 if (radeon_encoder->active_device & (ATOM_DEVICE_TV_SUPPORT))
927 index = GetIndexIntoMasterTable(COMMAND, TV1OutputControl); 910 index = GetIndexIntoMasterTable(COMMAND, TV1OutputControl);
928 else if (devices & (ATOM_DEVICE_CV_SUPPORT)) 911 else if (radeon_encoder->active_device & (ATOM_DEVICE_CV_SUPPORT))
929 index = GetIndexIntoMasterTable(COMMAND, CV1OutputControl); 912 index = GetIndexIntoMasterTable(COMMAND, CV1OutputControl);
930 else 913 else
931 index = GetIndexIntoMasterTable(COMMAND, DAC2OutputControl); 914 index = GetIndexIntoMasterTable(COMMAND, DAC2OutputControl);
@@ -1104,8 +1087,11 @@ atombios_apply_encoder_quirks(struct drm_encoder *encoder,
1104 } 1087 }
1105 1088
1106 /* set scaler clears this on some chips */ 1089 /* set scaler clears this on some chips */
1107 if (ASIC_IS_AVIVO(rdev) && (mode->flags & DRM_MODE_FLAG_INTERLACE)) 1090 if (!(radeon_encoder->active_device & (ATOM_DEVICE_TV_SUPPORT))) {
1108 WREG32(AVIVO_D1MODE_DATA_FORMAT + radeon_crtc->crtc_offset, AVIVO_D1MODE_INTERLEAVE_EN); 1091 if (ASIC_IS_AVIVO(rdev) && (mode->flags & DRM_MODE_FLAG_INTERLACE))
1092 WREG32(AVIVO_D1MODE_DATA_FORMAT + radeon_crtc->crtc_offset,
1093 AVIVO_D1MODE_INTERLEAVE_EN);
1094 }
1109} 1095}
1110 1096
1111static void 1097static void
@@ -1153,6 +1139,7 @@ radeon_atom_encoder_mode_set(struct drm_encoder *encoder,
1153 1139
1154 /* setup and enable the encoder and transmitter */ 1140 /* setup and enable the encoder and transmitter */
1155 atombios_dig_encoder_setup(encoder, ATOM_ENABLE); 1141 atombios_dig_encoder_setup(encoder, ATOM_ENABLE);
1142 atombios_dig_transmitter_setup(encoder, ATOM_TRANSMITTER_ACTION_INIT);
1156 atombios_dig_transmitter_setup(encoder, ATOM_TRANSMITTER_ACTION_SETUP); 1143 atombios_dig_transmitter_setup(encoder, ATOM_TRANSMITTER_ACTION_SETUP);
1157 atombios_dig_transmitter_setup(encoder, ATOM_TRANSMITTER_ACTION_ENABLE); 1144 atombios_dig_transmitter_setup(encoder, ATOM_TRANSMITTER_ACTION_ENABLE);
1158 break; 1145 break;
@@ -1268,8 +1255,6 @@ static void radeon_atom_encoder_prepare(struct drm_encoder *encoder)
1268{ 1255{
1269 radeon_atom_output_lock(encoder, true); 1256 radeon_atom_output_lock(encoder, true);
1270 radeon_atom_encoder_dpms(encoder, DRM_MODE_DPMS_OFF); 1257 radeon_atom_encoder_dpms(encoder, DRM_MODE_DPMS_OFF);
1271
1272 radeon_encoder_set_active_device(encoder);
1273} 1258}
1274 1259
1275static void radeon_atom_encoder_commit(struct drm_encoder *encoder) 1260static void radeon_atom_encoder_commit(struct drm_encoder *encoder)
diff --git a/drivers/gpu/drm/radeon/radeon_gart.c b/drivers/gpu/drm/radeon/radeon_gart.c
index a931af065dd4..a68d7566178c 100644
--- a/drivers/gpu/drm/radeon/radeon_gart.c
+++ b/drivers/gpu/drm/radeon/radeon_gart.c
@@ -140,15 +140,15 @@ void radeon_gart_unbind(struct radeon_device *rdev, unsigned offset,
140 WARN(1, "trying to unbind memory to unitialized GART !\n"); 140 WARN(1, "trying to unbind memory to unitialized GART !\n");
141 return; 141 return;
142 } 142 }
143 t = offset / 4096; 143 t = offset / RADEON_GPU_PAGE_SIZE;
144 p = t / (PAGE_SIZE / 4096); 144 p = t / (PAGE_SIZE / RADEON_GPU_PAGE_SIZE);
145 for (i = 0; i < pages; i++, p++) { 145 for (i = 0; i < pages; i++, p++) {
146 if (rdev->gart.pages[p]) { 146 if (rdev->gart.pages[p]) {
147 pci_unmap_page(rdev->pdev, rdev->gart.pages_addr[p], 147 pci_unmap_page(rdev->pdev, rdev->gart.pages_addr[p],
148 PAGE_SIZE, PCI_DMA_BIDIRECTIONAL); 148 PAGE_SIZE, PCI_DMA_BIDIRECTIONAL);
149 rdev->gart.pages[p] = NULL; 149 rdev->gart.pages[p] = NULL;
150 rdev->gart.pages_addr[p] = 0; 150 rdev->gart.pages_addr[p] = 0;
151 for (j = 0; j < (PAGE_SIZE / 4096); j++, t++) { 151 for (j = 0; j < (PAGE_SIZE / RADEON_GPU_PAGE_SIZE); j++, t++) {
152 radeon_gart_set_page(rdev, t, 0); 152 radeon_gart_set_page(rdev, t, 0);
153 } 153 }
154 } 154 }
@@ -169,8 +169,8 @@ int radeon_gart_bind(struct radeon_device *rdev, unsigned offset,
169 DRM_ERROR("trying to bind memory to unitialized GART !\n"); 169 DRM_ERROR("trying to bind memory to unitialized GART !\n");
170 return -EINVAL; 170 return -EINVAL;
171 } 171 }
172 t = offset / 4096; 172 t = offset / RADEON_GPU_PAGE_SIZE;
173 p = t / (PAGE_SIZE / 4096); 173 p = t / (PAGE_SIZE / RADEON_GPU_PAGE_SIZE);
174 174
175 for (i = 0; i < pages; i++, p++) { 175 for (i = 0; i < pages; i++, p++) {
176 /* we need to support large memory configurations */ 176 /* we need to support large memory configurations */
@@ -185,9 +185,9 @@ int radeon_gart_bind(struct radeon_device *rdev, unsigned offset,
185 } 185 }
186 rdev->gart.pages[p] = pagelist[i]; 186 rdev->gart.pages[p] = pagelist[i];
187 page_base = rdev->gart.pages_addr[p]; 187 page_base = rdev->gart.pages_addr[p];
188 for (j = 0; j < (PAGE_SIZE / 4096); j++, t++) { 188 for (j = 0; j < (PAGE_SIZE / RADEON_GPU_PAGE_SIZE); j++, t++) {
189 radeon_gart_set_page(rdev, t, page_base); 189 radeon_gart_set_page(rdev, t, page_base);
190 page_base += 4096; 190 page_base += RADEON_GPU_PAGE_SIZE;
191 } 191 }
192 } 192 }
193 mb(); 193 mb();
@@ -200,14 +200,14 @@ int radeon_gart_init(struct radeon_device *rdev)
200 if (rdev->gart.pages) { 200 if (rdev->gart.pages) {
201 return 0; 201 return 0;
202 } 202 }
203 /* We need PAGE_SIZE >= 4096 */ 203 /* We need PAGE_SIZE >= RADEON_GPU_PAGE_SIZE */
204 if (PAGE_SIZE < 4096) { 204 if (PAGE_SIZE < RADEON_GPU_PAGE_SIZE) {
205 DRM_ERROR("Page size is smaller than GPU page size!\n"); 205 DRM_ERROR("Page size is smaller than GPU page size!\n");
206 return -EINVAL; 206 return -EINVAL;
207 } 207 }
208 /* Compute table size */ 208 /* Compute table size */
209 rdev->gart.num_cpu_pages = rdev->mc.gtt_size / PAGE_SIZE; 209 rdev->gart.num_cpu_pages = rdev->mc.gtt_size / PAGE_SIZE;
210 rdev->gart.num_gpu_pages = rdev->mc.gtt_size / 4096; 210 rdev->gart.num_gpu_pages = rdev->mc.gtt_size / RADEON_GPU_PAGE_SIZE;
211 DRM_INFO("GART: num cpu pages %u, num gpu pages %u\n", 211 DRM_INFO("GART: num cpu pages %u, num gpu pages %u\n",
212 rdev->gart.num_cpu_pages, rdev->gart.num_gpu_pages); 212 rdev->gart.num_cpu_pages, rdev->gart.num_gpu_pages);
213 /* Allocate pages table */ 213 /* Allocate pages table */
diff --git a/drivers/gpu/drm/radeon/radeon_irq_kms.c b/drivers/gpu/drm/radeon/radeon_irq_kms.c
index 8e0a8759e428..a0fe6232dcb6 100644
--- a/drivers/gpu/drm/radeon/radeon_irq_kms.c
+++ b/drivers/gpu/drm/radeon/radeon_irq_kms.c
@@ -92,6 +92,13 @@ int radeon_irq_kms_init(struct radeon_device *rdev)
92 if (r) { 92 if (r) {
93 return r; 93 return r;
94 } 94 }
95 /* enable msi */
96 rdev->msi_enabled = 0;
97 if (rdev->family >= CHIP_RV380) {
98 int ret = pci_enable_msi(rdev->pdev);
99 if (!ret)
100 rdev->msi_enabled = 1;
101 }
95 drm_irq_install(rdev->ddev); 102 drm_irq_install(rdev->ddev);
96 rdev->irq.installed = true; 103 rdev->irq.installed = true;
97 DRM_INFO("radeon: irq initialized.\n"); 104 DRM_INFO("radeon: irq initialized.\n");
@@ -103,5 +110,7 @@ void radeon_irq_kms_fini(struct radeon_device *rdev)
103 if (rdev->irq.installed) { 110 if (rdev->irq.installed) {
104 rdev->irq.installed = false; 111 rdev->irq.installed = false;
105 drm_irq_uninstall(rdev->ddev); 112 drm_irq_uninstall(rdev->ddev);
113 if (rdev->msi_enabled)
114 pci_disable_msi(rdev->pdev);
106 } 115 }
107} 116}
diff --git a/drivers/gpu/drm/radeon/radeon_legacy_crtc.c b/drivers/gpu/drm/radeon/radeon_legacy_crtc.c
index 36410f85d705..8d0b7aa87fa4 100644
--- a/drivers/gpu/drm/radeon/radeon_legacy_crtc.c
+++ b/drivers/gpu/drm/radeon/radeon_legacy_crtc.c
@@ -48,7 +48,7 @@ static void radeon_legacy_rmx_mode_set(struct drm_crtc *crtc,
48 u32 fp_horz_stretch, fp_vert_stretch, fp_horz_vert_active; 48 u32 fp_horz_stretch, fp_vert_stretch, fp_horz_vert_active;
49 u32 fp_h_sync_strt_wid, fp_crtc_h_total_disp; 49 u32 fp_h_sync_strt_wid, fp_crtc_h_total_disp;
50 u32 fp_v_sync_strt_wid, fp_crtc_v_total_disp; 50 u32 fp_v_sync_strt_wid, fp_crtc_v_total_disp;
51 struct radeon_native_mode *native_mode = &radeon_crtc->native_mode; 51 struct drm_display_mode *native_mode = &radeon_crtc->native_mode;
52 52
53 fp_vert_stretch = RREG32(RADEON_FP_VERT_STRETCH) & 53 fp_vert_stretch = RREG32(RADEON_FP_VERT_STRETCH) &
54 (RADEON_VERT_STRETCH_RESERVED | 54 (RADEON_VERT_STRETCH_RESERVED |
@@ -95,19 +95,19 @@ static void radeon_legacy_rmx_mode_set(struct drm_crtc *crtc,
95 95
96 fp_horz_vert_active = 0; 96 fp_horz_vert_active = 0;
97 97
98 if (native_mode->panel_xres == 0 || 98 if (native_mode->hdisplay == 0 ||
99 native_mode->panel_yres == 0) { 99 native_mode->vdisplay == 0) {
100 hscale = false; 100 hscale = false;
101 vscale = false; 101 vscale = false;
102 } else { 102 } else {
103 if (xres > native_mode->panel_xres) 103 if (xres > native_mode->hdisplay)
104 xres = native_mode->panel_xres; 104 xres = native_mode->hdisplay;
105 if (yres > native_mode->panel_yres) 105 if (yres > native_mode->vdisplay)
106 yres = native_mode->panel_yres; 106 yres = native_mode->vdisplay;
107 107
108 if (xres == native_mode->panel_xres) 108 if (xres == native_mode->hdisplay)
109 hscale = false; 109 hscale = false;
110 if (yres == native_mode->panel_yres) 110 if (yres == native_mode->vdisplay)
111 vscale = false; 111 vscale = false;
112 } 112 }
113 113
@@ -119,11 +119,11 @@ static void radeon_legacy_rmx_mode_set(struct drm_crtc *crtc,
119 else { 119 else {
120 inc = (fp_horz_stretch & RADEON_HORZ_AUTO_RATIO_INC) ? 1 : 0; 120 inc = (fp_horz_stretch & RADEON_HORZ_AUTO_RATIO_INC) ? 1 : 0;
121 scale = ((xres + inc) * RADEON_HORZ_STRETCH_RATIO_MAX) 121 scale = ((xres + inc) * RADEON_HORZ_STRETCH_RATIO_MAX)
122 / native_mode->panel_xres + 1; 122 / native_mode->hdisplay + 1;
123 fp_horz_stretch |= (((scale) & RADEON_HORZ_STRETCH_RATIO_MASK) | 123 fp_horz_stretch |= (((scale) & RADEON_HORZ_STRETCH_RATIO_MASK) |
124 RADEON_HORZ_STRETCH_BLEND | 124 RADEON_HORZ_STRETCH_BLEND |
125 RADEON_HORZ_STRETCH_ENABLE | 125 RADEON_HORZ_STRETCH_ENABLE |
126 ((native_mode->panel_xres/8-1) << 16)); 126 ((native_mode->hdisplay/8-1) << 16));
127 } 127 }
128 128
129 if (!vscale) 129 if (!vscale)
@@ -131,11 +131,11 @@ static void radeon_legacy_rmx_mode_set(struct drm_crtc *crtc,
131 else { 131 else {
132 inc = (fp_vert_stretch & RADEON_VERT_AUTO_RATIO_INC) ? 1 : 0; 132 inc = (fp_vert_stretch & RADEON_VERT_AUTO_RATIO_INC) ? 1 : 0;
133 scale = ((yres + inc) * RADEON_VERT_STRETCH_RATIO_MAX) 133 scale = ((yres + inc) * RADEON_VERT_STRETCH_RATIO_MAX)
134 / native_mode->panel_yres + 1; 134 / native_mode->vdisplay + 1;
135 fp_vert_stretch |= (((scale) & RADEON_VERT_STRETCH_RATIO_MASK) | 135 fp_vert_stretch |= (((scale) & RADEON_VERT_STRETCH_RATIO_MASK) |
136 RADEON_VERT_STRETCH_ENABLE | 136 RADEON_VERT_STRETCH_ENABLE |
137 RADEON_VERT_STRETCH_BLEND | 137 RADEON_VERT_STRETCH_BLEND |
138 ((native_mode->panel_yres-1) << 12)); 138 ((native_mode->vdisplay-1) << 12));
139 } 139 }
140 break; 140 break;
141 case RMX_CENTER: 141 case RMX_CENTER:
@@ -175,8 +175,8 @@ static void radeon_legacy_rmx_mode_set(struct drm_crtc *crtc,
175 ? RADEON_CRTC_V_SYNC_POL 175 ? RADEON_CRTC_V_SYNC_POL
176 : 0))); 176 : 0)));
177 177
178 fp_horz_vert_active = (((native_mode->panel_yres) & 0xfff) | 178 fp_horz_vert_active = (((native_mode->vdisplay) & 0xfff) |
179 (((native_mode->panel_xres / 8) & 0x1ff) << 16)); 179 (((native_mode->hdisplay / 8) & 0x1ff) << 16));
180 break; 180 break;
181 case RMX_OFF: 181 case RMX_OFF:
182 default: 182 default:
@@ -532,6 +532,10 @@ int radeon_crtc_set_base(struct drm_crtc *crtc, int x, int y,
532 radeon_fb = to_radeon_framebuffer(old_fb); 532 radeon_fb = to_radeon_framebuffer(old_fb);
533 radeon_gem_object_unpin(radeon_fb->obj); 533 radeon_gem_object_unpin(radeon_fb->obj);
534 } 534 }
535
536 /* Bytes per pixel may have changed */
537 radeon_bandwidth_update(rdev);
538
535 return 0; 539 return 0;
536} 540}
537 541
@@ -664,6 +668,9 @@ static bool radeon_set_crtc_timing(struct drm_crtc *crtc, struct drm_display_mod
664 668
665 WREG32(RADEON_DISP2_MERGE_CNTL, disp2_merge_cntl); 669 WREG32(RADEON_DISP2_MERGE_CNTL, disp2_merge_cntl);
666 WREG32(RADEON_CRTC2_GEN_CNTL, crtc2_gen_cntl); 670 WREG32(RADEON_CRTC2_GEN_CNTL, crtc2_gen_cntl);
671
672 WREG32(RADEON_FP_H2_SYNC_STRT_WID, crtc_h_sync_strt_wid);
673 WREG32(RADEON_FP_V2_SYNC_STRT_WID, crtc_v_sync_strt_wid);
667 } else { 674 } else {
668 uint32_t crtc_gen_cntl; 675 uint32_t crtc_gen_cntl;
669 uint32_t crtc_ext_cntl; 676 uint32_t crtc_ext_cntl;
@@ -1015,14 +1022,11 @@ static int radeon_crtc_mode_set(struct drm_crtc *crtc,
1015 int x, int y, struct drm_framebuffer *old_fb) 1022 int x, int y, struct drm_framebuffer *old_fb)
1016{ 1023{
1017 struct radeon_crtc *radeon_crtc = to_radeon_crtc(crtc); 1024 struct radeon_crtc *radeon_crtc = to_radeon_crtc(crtc);
1018 struct drm_device *dev = crtc->dev;
1019 struct radeon_device *rdev = dev->dev_private;
1020 1025
1021 /* TODO TV */ 1026 /* TODO TV */
1022 radeon_crtc_set_base(crtc, x, y, old_fb); 1027 radeon_crtc_set_base(crtc, x, y, old_fb);
1023 radeon_set_crtc_timing(crtc, adjusted_mode); 1028 radeon_set_crtc_timing(crtc, adjusted_mode);
1024 radeon_set_pll(crtc, adjusted_mode); 1029 radeon_set_pll(crtc, adjusted_mode);
1025 radeon_bandwidth_update(rdev);
1026 if (radeon_crtc->crtc_id == 0) { 1030 if (radeon_crtc->crtc_id == 0) {
1027 radeon_legacy_rmx_mode_set(crtc, mode, adjusted_mode); 1031 radeon_legacy_rmx_mode_set(crtc, mode, adjusted_mode);
1028 } else { 1032 } else {
diff --git a/drivers/gpu/drm/radeon/radeon_legacy_encoders.c b/drivers/gpu/drm/radeon/radeon_legacy_encoders.c
index 6ceb958fd194..00382122869b 100644
--- a/drivers/gpu/drm/radeon/radeon_legacy_encoders.c
+++ b/drivers/gpu/drm/radeon/radeon_legacy_encoders.c
@@ -107,8 +107,6 @@ static void radeon_legacy_lvds_prepare(struct drm_encoder *encoder)
107 else 107 else
108 radeon_combios_output_lock(encoder, true); 108 radeon_combios_output_lock(encoder, true);
109 radeon_legacy_lvds_dpms(encoder, DRM_MODE_DPMS_OFF); 109 radeon_legacy_lvds_dpms(encoder, DRM_MODE_DPMS_OFF);
110
111 radeon_encoder_set_active_device(encoder);
112} 110}
113 111
114static void radeon_legacy_lvds_commit(struct drm_encoder *encoder) 112static void radeon_legacy_lvds_commit(struct drm_encoder *encoder)
@@ -192,6 +190,8 @@ static bool radeon_legacy_lvds_mode_fixup(struct drm_encoder *encoder,
192{ 190{
193 struct radeon_encoder *radeon_encoder = to_radeon_encoder(encoder); 191 struct radeon_encoder *radeon_encoder = to_radeon_encoder(encoder);
194 192
193 /* set the active encoder to connector routing */
194 radeon_encoder_set_active_device(encoder);
195 drm_mode_set_crtcinfo(adjusted_mode, 0); 195 drm_mode_set_crtcinfo(adjusted_mode, 0);
196 196
197 if (radeon_encoder->rmx_type != RMX_OFF) 197 if (radeon_encoder->rmx_type != RMX_OFF)
@@ -218,7 +218,8 @@ static bool radeon_legacy_primary_dac_mode_fixup(struct drm_encoder *encoder,
218 struct drm_display_mode *mode, 218 struct drm_display_mode *mode,
219 struct drm_display_mode *adjusted_mode) 219 struct drm_display_mode *adjusted_mode)
220{ 220{
221 221 /* set the active encoder to connector routing */
222 radeon_encoder_set_active_device(encoder);
222 drm_mode_set_crtcinfo(adjusted_mode, 0); 223 drm_mode_set_crtcinfo(adjusted_mode, 0);
223 224
224 return true; 225 return true;
@@ -272,7 +273,6 @@ static void radeon_legacy_primary_dac_prepare(struct drm_encoder *encoder)
272 else 273 else
273 radeon_combios_output_lock(encoder, true); 274 radeon_combios_output_lock(encoder, true);
274 radeon_legacy_primary_dac_dpms(encoder, DRM_MODE_DPMS_OFF); 275 radeon_legacy_primary_dac_dpms(encoder, DRM_MODE_DPMS_OFF);
275 radeon_encoder_set_active_device(encoder);
276} 276}
277 277
278static void radeon_legacy_primary_dac_commit(struct drm_encoder *encoder) 278static void radeon_legacy_primary_dac_commit(struct drm_encoder *encoder)
@@ -468,7 +468,6 @@ static void radeon_legacy_tmds_int_prepare(struct drm_encoder *encoder)
468 else 468 else
469 radeon_combios_output_lock(encoder, true); 469 radeon_combios_output_lock(encoder, true);
470 radeon_legacy_tmds_int_dpms(encoder, DRM_MODE_DPMS_OFF); 470 radeon_legacy_tmds_int_dpms(encoder, DRM_MODE_DPMS_OFF);
471 radeon_encoder_set_active_device(encoder);
472} 471}
473 472
474static void radeon_legacy_tmds_int_commit(struct drm_encoder *encoder) 473static void radeon_legacy_tmds_int_commit(struct drm_encoder *encoder)
@@ -543,6 +542,14 @@ static void radeon_legacy_tmds_int_mode_set(struct drm_encoder *encoder,
543 542
544 fp_gen_cntl &= ~(RADEON_FP_FPON | RADEON_FP_TMDS_EN); 543 fp_gen_cntl &= ~(RADEON_FP_FPON | RADEON_FP_TMDS_EN);
545 544
545 fp_gen_cntl &= ~(RADEON_FP_RMX_HVSYNC_CONTROL_EN |
546 RADEON_FP_DFP_SYNC_SEL |
547 RADEON_FP_CRT_SYNC_SEL |
548 RADEON_FP_CRTC_LOCK_8DOT |
549 RADEON_FP_USE_SHADOW_EN |
550 RADEON_FP_CRTC_USE_SHADOW_VEND |
551 RADEON_FP_CRT_SYNC_ALT);
552
546 if (1) /* FIXME rgbBits == 8 */ 553 if (1) /* FIXME rgbBits == 8 */
547 fp_gen_cntl |= RADEON_FP_PANEL_FORMAT; /* 24 bit format */ 554 fp_gen_cntl |= RADEON_FP_PANEL_FORMAT; /* 24 bit format */
548 else 555 else
@@ -556,7 +563,7 @@ static void radeon_legacy_tmds_int_mode_set(struct drm_encoder *encoder,
556 else 563 else
557 fp_gen_cntl |= R200_FP_SOURCE_SEL_CRTC1; 564 fp_gen_cntl |= R200_FP_SOURCE_SEL_CRTC1;
558 } else 565 } else
559 fp_gen_cntl |= RADEON_FP_SEL_CRTC1; 566 fp_gen_cntl &= ~RADEON_FP_SEL_CRTC2;
560 } else { 567 } else {
561 if (ASIC_IS_R300(rdev) || rdev->family == CHIP_R200) { 568 if (ASIC_IS_R300(rdev) || rdev->family == CHIP_R200) {
562 fp_gen_cntl &= ~R200_FP_SOURCE_SEL_MASK; 569 fp_gen_cntl &= ~R200_FP_SOURCE_SEL_MASK;
@@ -593,7 +600,8 @@ static bool radeon_legacy_tmds_ext_mode_fixup(struct drm_encoder *encoder,
593 struct drm_display_mode *mode, 600 struct drm_display_mode *mode,
594 struct drm_display_mode *adjusted_mode) 601 struct drm_display_mode *adjusted_mode)
595{ 602{
596 603 /* set the active encoder to connector routing */
604 radeon_encoder_set_active_device(encoder);
597 drm_mode_set_crtcinfo(adjusted_mode, 0); 605 drm_mode_set_crtcinfo(adjusted_mode, 0);
598 606
599 return true; 607 return true;
@@ -636,7 +644,6 @@ static void radeon_legacy_tmds_ext_prepare(struct drm_encoder *encoder)
636 else 644 else
637 radeon_combios_output_lock(encoder, true); 645 radeon_combios_output_lock(encoder, true);
638 radeon_legacy_tmds_ext_dpms(encoder, DRM_MODE_DPMS_OFF); 646 radeon_legacy_tmds_ext_dpms(encoder, DRM_MODE_DPMS_OFF);
639 radeon_encoder_set_active_device(encoder);
640} 647}
641 648
642static void radeon_legacy_tmds_ext_commit(struct drm_encoder *encoder) 649static void radeon_legacy_tmds_ext_commit(struct drm_encoder *encoder)
@@ -735,7 +742,8 @@ static bool radeon_legacy_tv_dac_mode_fixup(struct drm_encoder *encoder,
735 struct drm_display_mode *mode, 742 struct drm_display_mode *mode,
736 struct drm_display_mode *adjusted_mode) 743 struct drm_display_mode *adjusted_mode)
737{ 744{
738 745 /* set the active encoder to connector routing */
746 radeon_encoder_set_active_device(encoder);
739 drm_mode_set_crtcinfo(adjusted_mode, 0); 747 drm_mode_set_crtcinfo(adjusted_mode, 0);
740 748
741 return true; 749 return true;
@@ -839,7 +847,6 @@ static void radeon_legacy_tv_dac_prepare(struct drm_encoder *encoder)
839 else 847 else
840 radeon_combios_output_lock(encoder, true); 848 radeon_combios_output_lock(encoder, true);
841 radeon_legacy_tv_dac_dpms(encoder, DRM_MODE_DPMS_OFF); 849 radeon_legacy_tv_dac_dpms(encoder, DRM_MODE_DPMS_OFF);
842 radeon_encoder_set_active_device(encoder);
843} 850}
844 851
845static void radeon_legacy_tv_dac_commit(struct drm_encoder *encoder) 852static void radeon_legacy_tv_dac_commit(struct drm_encoder *encoder)
diff --git a/drivers/gpu/drm/radeon/radeon_mode.h b/drivers/gpu/drm/radeon/radeon_mode.h
index e61226817ccf..ace726aa0d76 100644
--- a/drivers/gpu/drm/radeon/radeon_mode.h
+++ b/drivers/gpu/drm/radeon/radeon_mode.h
@@ -172,6 +172,7 @@ enum radeon_connector_table {
172 172
173struct radeon_mode_info { 173struct radeon_mode_info {
174 struct atom_context *atom_context; 174 struct atom_context *atom_context;
175 struct card_info *atom_card_info;
175 enum radeon_connector_table connector_table; 176 enum radeon_connector_table connector_table;
176 bool mode_config_initialized; 177 bool mode_config_initialized;
177 struct radeon_crtc *crtcs[2]; 178 struct radeon_crtc *crtcs[2];
@@ -186,17 +187,6 @@ struct radeon_mode_info {
186 187
187}; 188};
188 189
189struct radeon_native_mode {
190 /* preferred mode */
191 uint32_t panel_xres, panel_yres;
192 uint32_t hoverplus, hsync_width;
193 uint32_t hblank;
194 uint32_t voverplus, vsync_width;
195 uint32_t vblank;
196 uint32_t dotclock;
197 uint32_t flags;
198};
199
200#define MAX_H_CODE_TIMING_LEN 32 190#define MAX_H_CODE_TIMING_LEN 32
201#define MAX_V_CODE_TIMING_LEN 32 191#define MAX_V_CODE_TIMING_LEN 32
202 192
@@ -228,7 +218,7 @@ struct radeon_crtc {
228 enum radeon_rmx_type rmx_type; 218 enum radeon_rmx_type rmx_type;
229 fixed20_12 vsc; 219 fixed20_12 vsc;
230 fixed20_12 hsc; 220 fixed20_12 hsc;
231 struct radeon_native_mode native_mode; 221 struct drm_display_mode native_mode;
232}; 222};
233 223
234struct radeon_encoder_primary_dac { 224struct radeon_encoder_primary_dac {
@@ -248,7 +238,7 @@ struct radeon_encoder_lvds {
248 bool use_bios_dividers; 238 bool use_bios_dividers;
249 uint32_t lvds_gen_cntl; 239 uint32_t lvds_gen_cntl;
250 /* panel mode */ 240 /* panel mode */
251 struct radeon_native_mode native_mode; 241 struct drm_display_mode native_mode;
252}; 242};
253 243
254struct radeon_encoder_tv_dac { 244struct radeon_encoder_tv_dac {
@@ -271,6 +261,16 @@ struct radeon_encoder_int_tmds {
271 struct radeon_tmds_pll tmds_pll[4]; 261 struct radeon_tmds_pll tmds_pll[4];
272}; 262};
273 263
264/* spread spectrum */
265struct radeon_atom_ss {
266 uint16_t percentage;
267 uint8_t type;
268 uint8_t step;
269 uint8_t delay;
270 uint8_t range;
271 uint8_t refdiv;
272};
273
274struct radeon_encoder_atom_dig { 274struct radeon_encoder_atom_dig {
275 /* atom dig */ 275 /* atom dig */
276 bool coherent_mode; 276 bool coherent_mode;
@@ -278,8 +278,9 @@ struct radeon_encoder_atom_dig {
278 /* atom lvds */ 278 /* atom lvds */
279 uint32_t lvds_misc; 279 uint32_t lvds_misc;
280 uint16_t panel_pwr_delay; 280 uint16_t panel_pwr_delay;
281 struct radeon_atom_ss *ss;
281 /* panel mode */ 282 /* panel mode */
282 struct radeon_native_mode native_mode; 283 struct drm_display_mode native_mode;
283}; 284};
284 285
285struct radeon_encoder_atom_dac { 286struct radeon_encoder_atom_dac {
@@ -294,7 +295,7 @@ struct radeon_encoder {
294 uint32_t flags; 295 uint32_t flags;
295 uint32_t pixel_clock; 296 uint32_t pixel_clock;
296 enum radeon_rmx_type rmx_type; 297 enum radeon_rmx_type rmx_type;
297 struct radeon_native_mode native_mode; 298 struct drm_display_mode native_mode;
298 void *enc_priv; 299 void *enc_priv;
299}; 300};
300 301
@@ -308,12 +309,15 @@ struct radeon_connector {
308 uint32_t connector_id; 309 uint32_t connector_id;
309 uint32_t devices; 310 uint32_t devices;
310 struct radeon_i2c_chan *ddc_bus; 311 struct radeon_i2c_chan *ddc_bus;
312 /* some systems have a an hdmi and vga port with a shared ddc line */
313 bool shared_ddc;
311 bool use_digital; 314 bool use_digital;
312 /* we need to mind the EDID between detect 315 /* we need to mind the EDID between detect
313 and get modes due to analog/digital/tvencoder */ 316 and get modes due to analog/digital/tvencoder */
314 struct edid *edid; 317 struct edid *edid;
315 void *con_priv; 318 void *con_priv;
316 bool dac_load_detect; 319 bool dac_load_detect;
320 uint16_t connector_object_id;
317}; 321};
318 322
319struct radeon_framebuffer { 323struct radeon_framebuffer {
diff --git a/drivers/gpu/drm/radeon/radeon_pm.c b/drivers/gpu/drm/radeon/radeon_pm.c
new file mode 100644
index 000000000000..46146c6a2a06
--- /dev/null
+++ b/drivers/gpu/drm/radeon/radeon_pm.c
@@ -0,0 +1,65 @@
1/*
2 * Permission is hereby granted, free of charge, to any person obtaining a
3 * copy of this software and associated documentation files (the "Software"),
4 * to deal in the Software without restriction, including without limitation
5 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
6 * and/or sell copies of the Software, and to permit persons to whom the
7 * Software is furnished to do so, subject to the following conditions:
8 *
9 * The above copyright notice and this permission notice shall be included in
10 * all copies or substantial portions of the Software.
11 *
12 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
13 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
14 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
15 * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
16 * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
17 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
18 * OTHER DEALINGS IN THE SOFTWARE.
19 *
20 * Authors: Rafał Miłecki <zajec5@gmail.com>
21 */
22#include "drmP.h"
23#include "radeon.h"
24
25int radeon_debugfs_pm_init(struct radeon_device *rdev);
26
27int radeon_pm_init(struct radeon_device *rdev)
28{
29 if (radeon_debugfs_pm_init(rdev)) {
30 DRM_ERROR("Failed to register debugfs file for CP !\n");
31 }
32
33 return 0;
34}
35
36/*
37 * Debugfs info
38 */
39#if defined(CONFIG_DEBUG_FS)
40
41static int radeon_debugfs_pm_info(struct seq_file *m, void *data)
42{
43 struct drm_info_node *node = (struct drm_info_node *) m->private;
44 struct drm_device *dev = node->minor->dev;
45 struct radeon_device *rdev = dev->dev_private;
46
47 seq_printf(m, "engine clock: %u0 Hz\n", radeon_get_engine_clock(rdev));
48 seq_printf(m, "memory clock: %u0 Hz\n", radeon_get_memory_clock(rdev));
49
50 return 0;
51}
52
53static struct drm_info_list radeon_pm_info_list[] = {
54 {"radeon_pm_info", radeon_debugfs_pm_info, 0, NULL},
55};
56#endif
57
58int radeon_debugfs_pm_init(struct radeon_device *rdev)
59{
60#if defined(CONFIG_DEBUG_FS)
61 return radeon_debugfs_add_files(rdev, radeon_pm_info_list, ARRAY_SIZE(radeon_pm_info_list));
62#else
63 return 0;
64#endif
65}
diff --git a/drivers/gpu/drm/radeon/radeon_reg.h b/drivers/gpu/drm/radeon/radeon_reg.h
index bfa1ab9c93e1..29ab75903ec1 100644
--- a/drivers/gpu/drm/radeon/radeon_reg.h
+++ b/drivers/gpu/drm/radeon/radeon_reg.h
@@ -290,6 +290,8 @@
290#define RADEON_BUS_CNTL 0x0030 290#define RADEON_BUS_CNTL 0x0030
291# define RADEON_BUS_MASTER_DIS (1 << 6) 291# define RADEON_BUS_MASTER_DIS (1 << 6)
292# define RADEON_BUS_BIOS_DIS_ROM (1 << 12) 292# define RADEON_BUS_BIOS_DIS_ROM (1 << 12)
293# define RS600_BUS_MASTER_DIS (1 << 14)
294# define RS600_MSI_REARM (1 << 20) /* rs600/rs690/rs740 */
293# define RADEON_BUS_RD_DISCARD_EN (1 << 24) 295# define RADEON_BUS_RD_DISCARD_EN (1 << 24)
294# define RADEON_BUS_RD_ABORT_EN (1 << 25) 296# define RADEON_BUS_RD_ABORT_EN (1 << 25)
295# define RADEON_BUS_MSTR_DISCONNECT_EN (1 << 28) 297# define RADEON_BUS_MSTR_DISCONNECT_EN (1 << 28)
@@ -297,6 +299,9 @@
297# define RADEON_BUS_READ_BURST (1 << 30) 299# define RADEON_BUS_READ_BURST (1 << 30)
298#define RADEON_BUS_CNTL1 0x0034 300#define RADEON_BUS_CNTL1 0x0034
299# define RADEON_BUS_WAIT_ON_LOCK_EN (1 << 4) 301# define RADEON_BUS_WAIT_ON_LOCK_EN (1 << 4)
302/* rv370/rv380, rv410, r423/r430/r480, r5xx */
303#define RADEON_MSI_REARM_EN 0x0160
304# define RV370_MSI_REARM_EN (1 << 0)
300 305
301/* #define RADEON_PCIE_INDEX 0x0030 */ 306/* #define RADEON_PCIE_INDEX 0x0030 */
302/* #define RADEON_PCIE_DATA 0x0034 */ 307/* #define RADEON_PCIE_DATA 0x0034 */
@@ -3311,6 +3316,7 @@
3311#define RADEON_AIC_CNTL 0x01d0 3316#define RADEON_AIC_CNTL 0x01d0
3312# define RADEON_PCIGART_TRANSLATE_EN (1 << 0) 3317# define RADEON_PCIGART_TRANSLATE_EN (1 << 0)
3313# define RADEON_DIS_OUT_OF_PCI_GART_ACCESS (1 << 1) 3318# define RADEON_DIS_OUT_OF_PCI_GART_ACCESS (1 << 1)
3319# define RS400_MSI_REARM (1 << 3) /* rs400/rs480 */
3314#define RADEON_AIC_LO_ADDR 0x01dc 3320#define RADEON_AIC_LO_ADDR 0x01dc
3315#define RADEON_AIC_PT_BASE 0x01d8 3321#define RADEON_AIC_PT_BASE 0x01d8
3316#define RADEON_AIC_HI_ADDR 0x01e0 3322#define RADEON_AIC_HI_ADDR 0x01e0
diff --git a/drivers/gpu/drm/radeon/radeon_test.c b/drivers/gpu/drm/radeon/radeon_test.c
index 03c33cf4e14c..f8a465d9a1cf 100644
--- a/drivers/gpu/drm/radeon/radeon_test.c
+++ b/drivers/gpu/drm/radeon/radeon_test.c
@@ -42,7 +42,7 @@ void radeon_test_moves(struct radeon_device *rdev)
42 /* Number of tests = 42 /* Number of tests =
43 * (Total GTT - IB pool - writeback page - ring buffer) / test size 43 * (Total GTT - IB pool - writeback page - ring buffer) / test size
44 */ 44 */
45 n = (rdev->mc.gtt_size - RADEON_IB_POOL_SIZE*64*1024 - 4096 - 45 n = (rdev->mc.gtt_size - RADEON_IB_POOL_SIZE*64*1024 - RADEON_GPU_PAGE_SIZE -
46 rdev->cp.ring_size) / size; 46 rdev->cp.ring_size) / size;
47 47
48 gtt_obj = kzalloc(n * sizeof(*gtt_obj), GFP_KERNEL); 48 gtt_obj = kzalloc(n * sizeof(*gtt_obj), GFP_KERNEL);
@@ -102,7 +102,7 @@ void radeon_test_moves(struct radeon_device *rdev)
102 goto out_cleanup; 102 goto out_cleanup;
103 } 103 }
104 104
105 r = radeon_copy(rdev, gtt_addr, vram_addr, size / 4096, fence); 105 r = radeon_copy(rdev, gtt_addr, vram_addr, size / RADEON_GPU_PAGE_SIZE, fence);
106 if (r) { 106 if (r) {
107 DRM_ERROR("Failed GTT->VRAM copy %d\n", i); 107 DRM_ERROR("Failed GTT->VRAM copy %d\n", i);
108 goto out_cleanup; 108 goto out_cleanup;
@@ -145,7 +145,7 @@ void radeon_test_moves(struct radeon_device *rdev)
145 goto out_cleanup; 145 goto out_cleanup;
146 } 146 }
147 147
148 r = radeon_copy(rdev, vram_addr, gtt_addr, size / 4096, fence); 148 r = radeon_copy(rdev, vram_addr, gtt_addr, size / RADEON_GPU_PAGE_SIZE, fence);
149 if (r) { 149 if (r) {
150 DRM_ERROR("Failed VRAM->GTT copy %d\n", i); 150 DRM_ERROR("Failed VRAM->GTT copy %d\n", i);
151 goto out_cleanup; 151 goto out_cleanup;
diff --git a/drivers/gpu/drm/radeon/radeon_ttm.c b/drivers/gpu/drm/radeon/radeon_ttm.c
index 765bd184b6fc..1381e06d6af3 100644
--- a/drivers/gpu/drm/radeon/radeon_ttm.c
+++ b/drivers/gpu/drm/radeon/radeon_ttm.c
@@ -295,6 +295,12 @@ static int radeon_move_vram_ram(struct ttm_buffer_object *bo,
295 if (unlikely(r)) { 295 if (unlikely(r)) {
296 return r; 296 return r;
297 } 297 }
298
299 r = ttm_tt_set_placement_caching(bo->ttm, tmp_mem.placement);
300 if (unlikely(r)) {
301 goto out_cleanup;
302 }
303
298 r = ttm_tt_bind(bo->ttm, &tmp_mem); 304 r = ttm_tt_bind(bo->ttm, &tmp_mem);
299 if (unlikely(r)) { 305 if (unlikely(r)) {
300 goto out_cleanup; 306 goto out_cleanup;
diff --git a/drivers/gpu/drm/radeon/rs400.c b/drivers/gpu/drm/radeon/rs400.c
index a769c296f6a6..ca037160a582 100644
--- a/drivers/gpu/drm/radeon/rs400.c
+++ b/drivers/gpu/drm/radeon/rs400.c
@@ -418,6 +418,8 @@ int rs400_resume(struct radeon_device *rdev)
418 rs400_gart_disable(rdev); 418 rs400_gart_disable(rdev);
419 /* Resume clock before doing reset */ 419 /* Resume clock before doing reset */
420 r300_clock_startup(rdev); 420 r300_clock_startup(rdev);
421 /* setup MC before calling post tables */
422 rs400_mc_program(rdev);
421 /* Reset gpu before posting otherwise ATOM will enter infinite loop */ 423 /* Reset gpu before posting otherwise ATOM will enter infinite loop */
422 if (radeon_gpu_reset(rdev)) { 424 if (radeon_gpu_reset(rdev)) {
423 dev_warn(rdev->dev, "GPU reset failed ! (0xE40=0x%08X, 0x7C0=0x%08X)\n", 425 dev_warn(rdev->dev, "GPU reset failed ! (0xE40=0x%08X, 0x7C0=0x%08X)\n",
diff --git a/drivers/gpu/drm/radeon/rs600.c b/drivers/gpu/drm/radeon/rs600.c
index 10dfa78762da..5f117cd8736a 100644
--- a/drivers/gpu/drm/radeon/rs600.c
+++ b/drivers/gpu/drm/radeon/rs600.c
@@ -242,7 +242,7 @@ void rs600_irq_disable(struct radeon_device *rdev)
242 242
243int rs600_irq_process(struct radeon_device *rdev) 243int rs600_irq_process(struct radeon_device *rdev)
244{ 244{
245 uint32_t status; 245 uint32_t status, msi_rearm;
246 uint32_t r500_disp_int; 246 uint32_t r500_disp_int;
247 247
248 status = rs600_irq_ack(rdev, &r500_disp_int); 248 status = rs600_irq_ack(rdev, &r500_disp_int);
@@ -260,6 +260,22 @@ int rs600_irq_process(struct radeon_device *rdev)
260 drm_handle_vblank(rdev->ddev, 1); 260 drm_handle_vblank(rdev->ddev, 1);
261 status = rs600_irq_ack(rdev, &r500_disp_int); 261 status = rs600_irq_ack(rdev, &r500_disp_int);
262 } 262 }
263 if (rdev->msi_enabled) {
264 switch (rdev->family) {
265 case CHIP_RS600:
266 case CHIP_RS690:
267 case CHIP_RS740:
268 msi_rearm = RREG32(RADEON_BUS_CNTL) & ~RS600_MSI_REARM;
269 WREG32(RADEON_BUS_CNTL, msi_rearm);
270 WREG32(RADEON_BUS_CNTL, msi_rearm | RS600_MSI_REARM);
271 break;
272 default:
273 msi_rearm = RREG32(RADEON_MSI_REARM_EN) & ~RV370_MSI_REARM_EN;
274 WREG32(RADEON_MSI_REARM_EN, msi_rearm);
275 WREG32(RADEON_MSI_REARM_EN, msi_rearm | RV370_MSI_REARM_EN);
276 break;
277 }
278 }
263 return IRQ_HANDLED; 279 return IRQ_HANDLED;
264} 280}
265 281
@@ -472,6 +488,8 @@ int rs600_init(struct radeon_device *rdev)
472 } 488 }
473 /* Initialize clocks */ 489 /* Initialize clocks */
474 radeon_get_clock_info(rdev->ddev); 490 radeon_get_clock_info(rdev->ddev);
491 /* Initialize power management */
492 radeon_pm_init(rdev);
475 /* Get vram informations */ 493 /* Get vram informations */
476 rs600_vram_info(rdev); 494 rs600_vram_info(rdev);
477 /* Initialize memory controller (also test AGP) */ 495 /* Initialize memory controller (also test AGP) */
diff --git a/drivers/gpu/drm/radeon/rs690.c b/drivers/gpu/drm/radeon/rs690.c
index 025e3225346c..27547175cf93 100644
--- a/drivers/gpu/drm/radeon/rs690.c
+++ b/drivers/gpu/drm/radeon/rs690.c
@@ -706,6 +706,8 @@ int rs690_init(struct radeon_device *rdev)
706 } 706 }
707 /* Initialize clocks */ 707 /* Initialize clocks */
708 radeon_get_clock_info(rdev->ddev); 708 radeon_get_clock_info(rdev->ddev);
709 /* Initialize power management */
710 radeon_pm_init(rdev);
709 /* Get vram informations */ 711 /* Get vram informations */
710 rs690_vram_info(rdev); 712 rs690_vram_info(rdev);
711 /* Initialize memory controller (also test AGP) */ 713 /* Initialize memory controller (also test AGP) */
diff --git a/drivers/gpu/drm/radeon/rv515.c b/drivers/gpu/drm/radeon/rv515.c
index 41a34c23e6d8..ba68c9fe90a1 100644
--- a/drivers/gpu/drm/radeon/rv515.c
+++ b/drivers/gpu/drm/radeon/rv515.c
@@ -380,7 +380,6 @@ void rv515_mc_stop(struct radeon_device *rdev, struct rv515_mc_save *save)
380 save->d2crtc_control = RREG32(R_006880_D2CRTC_CONTROL); 380 save->d2crtc_control = RREG32(R_006880_D2CRTC_CONTROL);
381 381
382 /* Stop all video */ 382 /* Stop all video */
383 WREG32(R_000330_D1VGA_CONTROL, 0);
384 WREG32(R_0068E8_D2CRTC_UPDATE_LOCK, 0); 383 WREG32(R_0068E8_D2CRTC_UPDATE_LOCK, 0);
385 WREG32(R_000300_VGA_RENDER_CONTROL, 0); 384 WREG32(R_000300_VGA_RENDER_CONTROL, 0);
386 WREG32(R_0060E8_D1CRTC_UPDATE_LOCK, 1); 385 WREG32(R_0060E8_D1CRTC_UPDATE_LOCK, 1);
@@ -389,6 +388,8 @@ void rv515_mc_stop(struct radeon_device *rdev, struct rv515_mc_save *save)
389 WREG32(R_006880_D2CRTC_CONTROL, 0); 388 WREG32(R_006880_D2CRTC_CONTROL, 0);
390 WREG32(R_0060E8_D1CRTC_UPDATE_LOCK, 0); 389 WREG32(R_0060E8_D1CRTC_UPDATE_LOCK, 0);
391 WREG32(R_0068E8_D2CRTC_UPDATE_LOCK, 0); 390 WREG32(R_0068E8_D2CRTC_UPDATE_LOCK, 0);
391 WREG32(R_000330_D1VGA_CONTROL, 0);
392 WREG32(R_000338_D2VGA_CONTROL, 0);
392} 393}
393 394
394void rv515_mc_resume(struct radeon_device *rdev, struct rv515_mc_save *save) 395void rv515_mc_resume(struct radeon_device *rdev, struct rv515_mc_save *save)
@@ -402,14 +403,14 @@ void rv515_mc_resume(struct radeon_device *rdev, struct rv515_mc_save *save)
402 WREG32(R_000328_VGA_HDP_CONTROL, save->vga_hdp_control); 403 WREG32(R_000328_VGA_HDP_CONTROL, save->vga_hdp_control);
403 mdelay(1); 404 mdelay(1);
404 /* Restore video state */ 405 /* Restore video state */
406 WREG32(R_000330_D1VGA_CONTROL, save->d1vga_control);
407 WREG32(R_000338_D2VGA_CONTROL, save->d2vga_control);
405 WREG32(R_0060E8_D1CRTC_UPDATE_LOCK, 1); 408 WREG32(R_0060E8_D1CRTC_UPDATE_LOCK, 1);
406 WREG32(R_0068E8_D2CRTC_UPDATE_LOCK, 1); 409 WREG32(R_0068E8_D2CRTC_UPDATE_LOCK, 1);
407 WREG32(R_006080_D1CRTC_CONTROL, save->d1crtc_control); 410 WREG32(R_006080_D1CRTC_CONTROL, save->d1crtc_control);
408 WREG32(R_006880_D2CRTC_CONTROL, save->d2crtc_control); 411 WREG32(R_006880_D2CRTC_CONTROL, save->d2crtc_control);
409 WREG32(R_0060E8_D1CRTC_UPDATE_LOCK, 0); 412 WREG32(R_0060E8_D1CRTC_UPDATE_LOCK, 0);
410 WREG32(R_0068E8_D2CRTC_UPDATE_LOCK, 0); 413 WREG32(R_0068E8_D2CRTC_UPDATE_LOCK, 0);
411 WREG32(R_000330_D1VGA_CONTROL, save->d1vga_control);
412 WREG32(R_000338_D2VGA_CONTROL, save->d2vga_control);
413 WREG32(R_000300_VGA_RENDER_CONTROL, save->vga_render_control); 414 WREG32(R_000300_VGA_RENDER_CONTROL, save->vga_render_control);
414} 415}
415 416
@@ -585,6 +586,8 @@ int rv515_init(struct radeon_device *rdev)
585 } 586 }
586 /* Initialize clocks */ 587 /* Initialize clocks */
587 radeon_get_clock_info(rdev->ddev); 588 radeon_get_clock_info(rdev->ddev);
589 /* Initialize power management */
590 radeon_pm_init(rdev);
588 /* Get vram informations */ 591 /* Get vram informations */
589 rv515_vram_info(rdev); 592 rv515_vram_info(rdev);
590 /* Initialize memory controller (also test AGP) */ 593 /* Initialize memory controller (also test AGP) */
diff --git a/drivers/gpu/drm/radeon/rv770.c b/drivers/gpu/drm/radeon/rv770.c
index 595ac638039d..b0efd0ddae7a 100644
--- a/drivers/gpu/drm/radeon/rv770.c
+++ b/drivers/gpu/drm/radeon/rv770.c
@@ -529,11 +529,11 @@ static void rv770_gpu_init(struct radeon_device *rdev)
529 if (rdev->family == CHIP_RV770) 529 if (rdev->family == CHIP_RV770)
530 gb_tiling_config |= BANK_TILING(1); 530 gb_tiling_config |= BANK_TILING(1);
531 else 531 else
532 gb_tiling_config |= BANK_TILING((mc_arb_ramcfg & NOOFBANK_SHIFT) >> NOOFBANK_MASK); 532 gb_tiling_config |= BANK_TILING((mc_arb_ramcfg & NOOFBANK_MASK) >> NOOFBANK_SHIFT);
533 533
534 gb_tiling_config |= GROUP_SIZE(0); 534 gb_tiling_config |= GROUP_SIZE(0);
535 535
536 if (((mc_arb_ramcfg & NOOFROWS_MASK) & NOOFROWS_SHIFT) > 3) { 536 if (((mc_arb_ramcfg & NOOFROWS_MASK) >> NOOFROWS_SHIFT) > 3) {
537 gb_tiling_config |= ROW_TILING(3); 537 gb_tiling_config |= ROW_TILING(3);
538 gb_tiling_config |= SAMPLE_SPLIT(3); 538 gb_tiling_config |= SAMPLE_SPLIT(3);
539 } else { 539 } else {
@@ -579,14 +579,14 @@ static void rv770_gpu_init(struct radeon_device *rdev)
579 579
580 /* set HW defaults for 3D engine */ 580 /* set HW defaults for 3D engine */
581 WREG32(CP_QUEUE_THRESHOLDS, (ROQ_IB1_START(0x16) | 581 WREG32(CP_QUEUE_THRESHOLDS, (ROQ_IB1_START(0x16) |
582 ROQ_IB2_START(0x2b))); 582 ROQ_IB2_START(0x2b)));
583 583
584 WREG32(CP_MEQ_THRESHOLDS, STQ_SPLIT(0x30)); 584 WREG32(CP_MEQ_THRESHOLDS, STQ_SPLIT(0x30));
585 585
586 WREG32(TA_CNTL_AUX, (DISABLE_CUBE_ANISO | 586 WREG32(TA_CNTL_AUX, (DISABLE_CUBE_ANISO |
587 SYNC_GRADIENT | 587 SYNC_GRADIENT |
588 SYNC_WALKER | 588 SYNC_WALKER |
589 SYNC_ALIGNER)); 589 SYNC_ALIGNER));
590 590
591 sx_debug_1 = RREG32(SX_DEBUG_1); 591 sx_debug_1 = RREG32(SX_DEBUG_1);
592 sx_debug_1 |= ENABLE_NEW_SMX_ADDRESS; 592 sx_debug_1 |= ENABLE_NEW_SMX_ADDRESS;
@@ -598,9 +598,9 @@ static void rv770_gpu_init(struct radeon_device *rdev)
598 WREG32(SMX_DC_CTL0, smx_dc_ctl0); 598 WREG32(SMX_DC_CTL0, smx_dc_ctl0);
599 599
600 WREG32(SMX_EVENT_CTL, (ES_FLUSH_CTL(4) | 600 WREG32(SMX_EVENT_CTL, (ES_FLUSH_CTL(4) |
601 GS_FLUSH_CTL(4) | 601 GS_FLUSH_CTL(4) |
602 ACK_FLUSH_CTL(3) | 602 ACK_FLUSH_CTL(3) |
603 SYNC_FLUSH_CTL)); 603 SYNC_FLUSH_CTL));
604 604
605 if (rdev->family == CHIP_RV770) 605 if (rdev->family == CHIP_RV770)
606 WREG32(DB_DEBUG3, DB_CLK_OFF_DELAY(0x1f)); 606 WREG32(DB_DEBUG3, DB_CLK_OFF_DELAY(0x1f));
@@ -611,12 +611,12 @@ static void rv770_gpu_init(struct radeon_device *rdev)
611 } 611 }
612 612
613 WREG32(SX_EXPORT_BUFFER_SIZES, (COLOR_BUFFER_SIZE((rdev->config.rv770.sx_max_export_size / 4) - 1) | 613 WREG32(SX_EXPORT_BUFFER_SIZES, (COLOR_BUFFER_SIZE((rdev->config.rv770.sx_max_export_size / 4) - 1) |
614 POSITION_BUFFER_SIZE((rdev->config.rv770.sx_max_export_pos_size / 4) - 1) | 614 POSITION_BUFFER_SIZE((rdev->config.rv770.sx_max_export_pos_size / 4) - 1) |
615 SMX_BUFFER_SIZE((rdev->config.rv770.sx_max_export_smx_size / 4) - 1))); 615 SMX_BUFFER_SIZE((rdev->config.rv770.sx_max_export_smx_size / 4) - 1)));
616 616
617 WREG32(PA_SC_FIFO_SIZE, (SC_PRIM_FIFO_SIZE(rdev->config.rv770.sc_prim_fifo_size) | 617 WREG32(PA_SC_FIFO_SIZE, (SC_PRIM_FIFO_SIZE(rdev->config.rv770.sc_prim_fifo_size) |
618 SC_HIZ_TILE_FIFO_SIZE(rdev->config.rv770.sc_hiz_tile_fifo_size) | 618 SC_HIZ_TILE_FIFO_SIZE(rdev->config.rv770.sc_hiz_tile_fifo_size) |
619 SC_EARLYZ_TILE_FIFO_SIZE(rdev->config.rv770.sc_earlyz_tile_fifo_fize))); 619 SC_EARLYZ_TILE_FIFO_SIZE(rdev->config.rv770.sc_earlyz_tile_fifo_fize)));
620 620
621 WREG32(PA_SC_MULTI_CHIP_CNTL, 0); 621 WREG32(PA_SC_MULTI_CHIP_CNTL, 0);
622 622
@@ -774,14 +774,36 @@ int rv770_mc_init(struct radeon_device *rdev)
774{ 774{
775 fixed20_12 a; 775 fixed20_12 a;
776 u32 tmp; 776 u32 tmp;
777 int chansize, numchan;
777 int r; 778 int r;
778 779
779 /* Get VRAM informations */ 780 /* Get VRAM informations */
780 /* FIXME: Don't know how to determine vram width, need to check
781 * vram_width usage
782 */
783 rdev->mc.vram_width = 128;
784 rdev->mc.vram_is_ddr = true; 781 rdev->mc.vram_is_ddr = true;
782 tmp = RREG32(MC_ARB_RAMCFG);
783 if (tmp & CHANSIZE_OVERRIDE) {
784 chansize = 16;
785 } else if (tmp & CHANSIZE_MASK) {
786 chansize = 64;
787 } else {
788 chansize = 32;
789 }
790 tmp = RREG32(MC_SHARED_CHMAP);
791 switch ((tmp & NOOFCHAN_MASK) >> NOOFCHAN_SHIFT) {
792 case 0:
793 default:
794 numchan = 1;
795 break;
796 case 1:
797 numchan = 2;
798 break;
799 case 2:
800 numchan = 4;
801 break;
802 case 3:
803 numchan = 8;
804 break;
805 }
806 rdev->mc.vram_width = numchan * chansize;
785 /* Could aper size report 0 ? */ 807 /* Could aper size report 0 ? */
786 rdev->mc.aper_base = drm_get_resource_start(rdev->ddev, 0); 808 rdev->mc.aper_base = drm_get_resource_start(rdev->ddev, 0);
787 rdev->mc.aper_size = drm_get_resource_len(rdev->ddev, 0); 809 rdev->mc.aper_size = drm_get_resource_len(rdev->ddev, 0);
@@ -961,10 +983,13 @@ int rv770_init(struct radeon_device *rdev)
961 r600_scratch_init(rdev); 983 r600_scratch_init(rdev);
962 /* Initialize surface registers */ 984 /* Initialize surface registers */
963 radeon_surface_init(rdev); 985 radeon_surface_init(rdev);
986 /* Initialize clocks */
964 radeon_get_clock_info(rdev->ddev); 987 radeon_get_clock_info(rdev->ddev);
965 r = radeon_clocks_init(rdev); 988 r = radeon_clocks_init(rdev);
966 if (r) 989 if (r)
967 return r; 990 return r;
991 /* Initialize power management */
992 radeon_pm_init(rdev);
968 /* Fence driver */ 993 /* Fence driver */
969 r = radeon_fence_driver_init(rdev); 994 r = radeon_fence_driver_init(rdev);
970 if (r) 995 if (r)
diff --git a/drivers/gpu/drm/radeon/rv770d.h b/drivers/gpu/drm/radeon/rv770d.h
index 4b9c3d6396ff..a1367ab6f261 100644
--- a/drivers/gpu/drm/radeon/rv770d.h
+++ b/drivers/gpu/drm/radeon/rv770d.h
@@ -129,6 +129,10 @@
129#define HDP_REG_COHERENCY_FLUSH_CNTL 0x54A0 129#define HDP_REG_COHERENCY_FLUSH_CNTL 0x54A0
130#define HDP_TILING_CONFIG 0x2F3C 130#define HDP_TILING_CONFIG 0x2F3C
131 131
132#define MC_SHARED_CHMAP 0x2004
133#define NOOFCHAN_SHIFT 12
134#define NOOFCHAN_MASK 0x00003000
135
132#define MC_ARB_RAMCFG 0x2760 136#define MC_ARB_RAMCFG 0x2760
133#define NOOFBANK_SHIFT 0 137#define NOOFBANK_SHIFT 0
134#define NOOFBANK_MASK 0x00000003 138#define NOOFBANK_MASK 0x00000003
@@ -142,6 +146,7 @@
142#define CHANSIZE_MASK 0x00000100 146#define CHANSIZE_MASK 0x00000100
143#define BURSTLENGTH_SHIFT 9 147#define BURSTLENGTH_SHIFT 9
144#define BURSTLENGTH_MASK 0x00000200 148#define BURSTLENGTH_MASK 0x00000200
149#define CHANSIZE_OVERRIDE (1 << 11)
145#define MC_VM_AGP_TOP 0x2028 150#define MC_VM_AGP_TOP 0x2028
146#define MC_VM_AGP_BOT 0x202C 151#define MC_VM_AGP_BOT 0x202C
147#define MC_VM_AGP_BASE 0x2030 152#define MC_VM_AGP_BASE 0x2030
diff --git a/drivers/gpu/drm/ttm/ttm_tt.c b/drivers/gpu/drm/ttm/ttm_tt.c
index a55ee1a56c16..7bcb89f39ce8 100644
--- a/drivers/gpu/drm/ttm/ttm_tt.c
+++ b/drivers/gpu/drm/ttm/ttm_tt.c
@@ -279,6 +279,7 @@ int ttm_tt_set_placement_caching(struct ttm_tt *ttm, uint32_t placement)
279 279
280 return ttm_tt_set_caching(ttm, state); 280 return ttm_tt_set_caching(ttm, state);
281} 281}
282EXPORT_SYMBOL(ttm_tt_set_placement_caching);
282 283
283static void ttm_tt_free_alloced_pages(struct ttm_tt *ttm) 284static void ttm_tt_free_alloced_pages(struct ttm_tt *ttm)
284{ 285{
diff --git a/drivers/hwmon/adt7475.c b/drivers/hwmon/adt7475.c
index d39877a7da63..b5a95193c694 100644
--- a/drivers/hwmon/adt7475.c
+++ b/drivers/hwmon/adt7475.c
@@ -350,8 +350,7 @@ static ssize_t show_temp(struct device *dev, struct device_attribute *attr,
350 350
351 case FAULT: 351 case FAULT:
352 /* Note - only for remote1 and remote2 */ 352 /* Note - only for remote1 and remote2 */
353 out = data->alarms & (sattr->index ? 0x8000 : 0x4000); 353 out = !!(data->alarms & (sattr->index ? 0x8000 : 0x4000));
354 out = out ? 0 : 1;
355 break; 354 break;
356 355
357 default: 356 default:
@@ -863,7 +862,7 @@ static SENSOR_DEVICE_ATTR_2(pwm1_freq, S_IRUGO | S_IWUSR, show_pwmfreq,
863 set_pwmfreq, INPUT, 0); 862 set_pwmfreq, INPUT, 0);
864static SENSOR_DEVICE_ATTR_2(pwm1_enable, S_IRUGO | S_IWUSR, show_pwmctrl, 863static SENSOR_DEVICE_ATTR_2(pwm1_enable, S_IRUGO | S_IWUSR, show_pwmctrl,
865 set_pwmctrl, INPUT, 0); 864 set_pwmctrl, INPUT, 0);
866static SENSOR_DEVICE_ATTR_2(pwm1_auto_channel_temp, S_IRUGO | S_IWUSR, 865static SENSOR_DEVICE_ATTR_2(pwm1_auto_channels_temp, S_IRUGO | S_IWUSR,
867 show_pwmchan, set_pwmchan, INPUT, 0); 866 show_pwmchan, set_pwmchan, INPUT, 0);
868static SENSOR_DEVICE_ATTR_2(pwm1_auto_point1_pwm, S_IRUGO | S_IWUSR, show_pwm, 867static SENSOR_DEVICE_ATTR_2(pwm1_auto_point1_pwm, S_IRUGO | S_IWUSR, show_pwm,
869 set_pwm, MIN, 0); 868 set_pwm, MIN, 0);
@@ -875,7 +874,7 @@ static SENSOR_DEVICE_ATTR_2(pwm2_freq, S_IRUGO | S_IWUSR, show_pwmfreq,
875 set_pwmfreq, INPUT, 1); 874 set_pwmfreq, INPUT, 1);
876static SENSOR_DEVICE_ATTR_2(pwm2_enable, S_IRUGO | S_IWUSR, show_pwmctrl, 875static SENSOR_DEVICE_ATTR_2(pwm2_enable, S_IRUGO | S_IWUSR, show_pwmctrl,
877 set_pwmctrl, INPUT, 1); 876 set_pwmctrl, INPUT, 1);
878static SENSOR_DEVICE_ATTR_2(pwm2_auto_channel_temp, S_IRUGO | S_IWUSR, 877static SENSOR_DEVICE_ATTR_2(pwm2_auto_channels_temp, S_IRUGO | S_IWUSR,
879 show_pwmchan, set_pwmchan, INPUT, 1); 878 show_pwmchan, set_pwmchan, INPUT, 1);
880static SENSOR_DEVICE_ATTR_2(pwm2_auto_point1_pwm, S_IRUGO | S_IWUSR, show_pwm, 879static SENSOR_DEVICE_ATTR_2(pwm2_auto_point1_pwm, S_IRUGO | S_IWUSR, show_pwm,
881 set_pwm, MIN, 1); 880 set_pwm, MIN, 1);
@@ -887,7 +886,7 @@ static SENSOR_DEVICE_ATTR_2(pwm3_freq, S_IRUGO | S_IWUSR, show_pwmfreq,
887 set_pwmfreq, INPUT, 2); 886 set_pwmfreq, INPUT, 2);
888static SENSOR_DEVICE_ATTR_2(pwm3_enable, S_IRUGO | S_IWUSR, show_pwmctrl, 887static SENSOR_DEVICE_ATTR_2(pwm3_enable, S_IRUGO | S_IWUSR, show_pwmctrl,
889 set_pwmctrl, INPUT, 2); 888 set_pwmctrl, INPUT, 2);
890static SENSOR_DEVICE_ATTR_2(pwm3_auto_channel_temp, S_IRUGO | S_IWUSR, 889static SENSOR_DEVICE_ATTR_2(pwm3_auto_channels_temp, S_IRUGO | S_IWUSR,
891 show_pwmchan, set_pwmchan, INPUT, 2); 890 show_pwmchan, set_pwmchan, INPUT, 2);
892static SENSOR_DEVICE_ATTR_2(pwm3_auto_point1_pwm, S_IRUGO | S_IWUSR, show_pwm, 891static SENSOR_DEVICE_ATTR_2(pwm3_auto_point1_pwm, S_IRUGO | S_IWUSR, show_pwm,
893 set_pwm, MIN, 2); 892 set_pwm, MIN, 2);
@@ -947,19 +946,19 @@ static struct attribute *adt7475_attrs[] = {
947 &sensor_dev_attr_pwm1.dev_attr.attr, 946 &sensor_dev_attr_pwm1.dev_attr.attr,
948 &sensor_dev_attr_pwm1_freq.dev_attr.attr, 947 &sensor_dev_attr_pwm1_freq.dev_attr.attr,
949 &sensor_dev_attr_pwm1_enable.dev_attr.attr, 948 &sensor_dev_attr_pwm1_enable.dev_attr.attr,
950 &sensor_dev_attr_pwm1_auto_channel_temp.dev_attr.attr, 949 &sensor_dev_attr_pwm1_auto_channels_temp.dev_attr.attr,
951 &sensor_dev_attr_pwm1_auto_point1_pwm.dev_attr.attr, 950 &sensor_dev_attr_pwm1_auto_point1_pwm.dev_attr.attr,
952 &sensor_dev_attr_pwm1_auto_point2_pwm.dev_attr.attr, 951 &sensor_dev_attr_pwm1_auto_point2_pwm.dev_attr.attr,
953 &sensor_dev_attr_pwm2.dev_attr.attr, 952 &sensor_dev_attr_pwm2.dev_attr.attr,
954 &sensor_dev_attr_pwm2_freq.dev_attr.attr, 953 &sensor_dev_attr_pwm2_freq.dev_attr.attr,
955 &sensor_dev_attr_pwm2_enable.dev_attr.attr, 954 &sensor_dev_attr_pwm2_enable.dev_attr.attr,
956 &sensor_dev_attr_pwm2_auto_channel_temp.dev_attr.attr, 955 &sensor_dev_attr_pwm2_auto_channels_temp.dev_attr.attr,
957 &sensor_dev_attr_pwm2_auto_point1_pwm.dev_attr.attr, 956 &sensor_dev_attr_pwm2_auto_point1_pwm.dev_attr.attr,
958 &sensor_dev_attr_pwm2_auto_point2_pwm.dev_attr.attr, 957 &sensor_dev_attr_pwm2_auto_point2_pwm.dev_attr.attr,
959 &sensor_dev_attr_pwm3.dev_attr.attr, 958 &sensor_dev_attr_pwm3.dev_attr.attr,
960 &sensor_dev_attr_pwm3_freq.dev_attr.attr, 959 &sensor_dev_attr_pwm3_freq.dev_attr.attr,
961 &sensor_dev_attr_pwm3_enable.dev_attr.attr, 960 &sensor_dev_attr_pwm3_enable.dev_attr.attr,
962 &sensor_dev_attr_pwm3_auto_channel_temp.dev_attr.attr, 961 &sensor_dev_attr_pwm3_auto_channels_temp.dev_attr.attr,
963 &sensor_dev_attr_pwm3_auto_point1_pwm.dev_attr.attr, 962 &sensor_dev_attr_pwm3_auto_point1_pwm.dev_attr.attr,
964 &sensor_dev_attr_pwm3_auto_point2_pwm.dev_attr.attr, 963 &sensor_dev_attr_pwm3_auto_point2_pwm.dev_attr.attr,
965 NULL, 964 NULL,
@@ -1152,7 +1151,7 @@ static struct adt7475_data *adt7475_update_device(struct device *dev)
1152 } 1151 }
1153 1152
1154 /* Limits and settings, should never change update every 60 seconds */ 1153 /* Limits and settings, should never change update every 60 seconds */
1155 if (time_after(jiffies, data->limits_updated + HZ * 2) || 1154 if (time_after(jiffies, data->limits_updated + HZ * 60) ||
1156 !data->valid) { 1155 !data->valid) {
1157 data->config5 = adt7475_read(REG_CONFIG5); 1156 data->config5 = adt7475_read(REG_CONFIG5);
1158 1157
diff --git a/drivers/hwmon/s3c-hwmon.c b/drivers/hwmon/s3c-hwmon.c
index 3a524f2fe493..71835412529f 100644
--- a/drivers/hwmon/s3c-hwmon.c
+++ b/drivers/hwmon/s3c-hwmon.c
@@ -323,14 +323,21 @@ static int __devinit s3c_hwmon_probe(struct platform_device *dev)
323 } 323 }
324 324
325 for (i = 0; i < ARRAY_SIZE(pdata->in); i++) { 325 for (i = 0; i < ARRAY_SIZE(pdata->in); i++) {
326 if (!pdata->in[i]) 326 struct s3c24xx_adc_hwmon_incfg *cfg = pdata->in[i];
327
328 if (!cfg)
327 continue; 329 continue;
328 330
329 if (pdata->in[i]->mult >= 0x10000) 331 if (cfg->mult >= 0x10000)
330 dev_warn(&dev->dev, 332 dev_warn(&dev->dev,
331 "channel %d multiplier too large\n", 333 "channel %d multiplier too large\n",
332 i); 334 i);
333 335
336 if (cfg->divider == 0) {
337 dev_err(&dev->dev, "channel %d divider zero\n", i);
338 continue;
339 }
340
334 ret = s3c_hwmon_create_attr(&dev->dev, pdata->in[i], 341 ret = s3c_hwmon_create_attr(&dev->dev, pdata->in[i],
335 &hwmon->attrs[i], i); 342 &hwmon->attrs[i], i);
336 if (ret) { 343 if (ret) {
diff --git a/drivers/i2c/busses/Kconfig b/drivers/i2c/busses/Kconfig
index 737335ff2b21..e8fe7f169e25 100644
--- a/drivers/i2c/busses/Kconfig
+++ b/drivers/i2c/busses/Kconfig
@@ -128,7 +128,7 @@ config I2C_PIIX4
128 ATI SB600 128 ATI SB600
129 ATI SB700 129 ATI SB700
130 ATI SB800 130 ATI SB800
131 AMD SB900 131 AMD Hudson-2
132 Serverworks OSB4 132 Serverworks OSB4
133 Serverworks CSB5 133 Serverworks CSB5
134 Serverworks CSB6 134 Serverworks CSB6
diff --git a/drivers/i2c/busses/i2c-imx.c b/drivers/i2c/busses/i2c-imx.c
index 4afba3ec2a61..e3654d683e15 100644
--- a/drivers/i2c/busses/i2c-imx.c
+++ b/drivers/i2c/busses/i2c-imx.c
@@ -120,19 +120,26 @@ struct imx_i2c_struct {
120 wait_queue_head_t queue; 120 wait_queue_head_t queue;
121 unsigned long i2csr; 121 unsigned long i2csr;
122 unsigned int disable_delay; 122 unsigned int disable_delay;
123 int stopped;
124 unsigned int ifdr; /* IMX_I2C_IFDR */
123}; 125};
124 126
125/** Functions for IMX I2C adapter driver *************************************** 127/** Functions for IMX I2C adapter driver ***************************************
126*******************************************************************************/ 128*******************************************************************************/
127 129
128static int i2c_imx_bus_busy(struct imx_i2c_struct *i2c_imx) 130static int i2c_imx_bus_busy(struct imx_i2c_struct *i2c_imx, int for_busy)
129{ 131{
130 unsigned long orig_jiffies = jiffies; 132 unsigned long orig_jiffies = jiffies;
133 unsigned int temp;
131 134
132 dev_dbg(&i2c_imx->adapter.dev, "<%s>\n", __func__); 135 dev_dbg(&i2c_imx->adapter.dev, "<%s>\n", __func__);
133 136
134 /* wait for bus not busy */ 137 while (1) {
135 while (readb(i2c_imx->base + IMX_I2C_I2SR) & I2SR_IBB) { 138 temp = readb(i2c_imx->base + IMX_I2C_I2SR);
139 if (for_busy && (temp & I2SR_IBB))
140 break;
141 if (!for_busy && !(temp & I2SR_IBB))
142 break;
136 if (signal_pending(current)) { 143 if (signal_pending(current)) {
137 dev_dbg(&i2c_imx->adapter.dev, 144 dev_dbg(&i2c_imx->adapter.dev,
138 "<%s> I2C Interrupted\n", __func__); 145 "<%s> I2C Interrupted\n", __func__);
@@ -179,41 +186,62 @@ static int i2c_imx_acked(struct imx_i2c_struct *i2c_imx)
179 return 0; 186 return 0;
180} 187}
181 188
182static void i2c_imx_start(struct imx_i2c_struct *i2c_imx) 189static int i2c_imx_start(struct imx_i2c_struct *i2c_imx)
183{ 190{
184 unsigned int temp = 0; 191 unsigned int temp = 0;
192 int result;
185 193
186 dev_dbg(&i2c_imx->adapter.dev, "<%s>\n", __func__); 194 dev_dbg(&i2c_imx->adapter.dev, "<%s>\n", __func__);
187 195
196 clk_enable(i2c_imx->clk);
197 writeb(i2c_imx->ifdr, i2c_imx->base + IMX_I2C_IFDR);
188 /* Enable I2C controller */ 198 /* Enable I2C controller */
199 writeb(0, i2c_imx->base + IMX_I2C_I2SR);
189 writeb(I2CR_IEN, i2c_imx->base + IMX_I2C_I2CR); 200 writeb(I2CR_IEN, i2c_imx->base + IMX_I2C_I2CR);
201
202 /* Wait controller to be stable */
203 udelay(50);
204
190 /* Start I2C transaction */ 205 /* Start I2C transaction */
191 temp = readb(i2c_imx->base + IMX_I2C_I2CR); 206 temp = readb(i2c_imx->base + IMX_I2C_I2CR);
192 temp |= I2CR_MSTA; 207 temp |= I2CR_MSTA;
193 writeb(temp, i2c_imx->base + IMX_I2C_I2CR); 208 writeb(temp, i2c_imx->base + IMX_I2C_I2CR);
209 result = i2c_imx_bus_busy(i2c_imx, 1);
210 if (result)
211 return result;
212 i2c_imx->stopped = 0;
213
194 temp |= I2CR_IIEN | I2CR_MTX | I2CR_TXAK; 214 temp |= I2CR_IIEN | I2CR_MTX | I2CR_TXAK;
195 writeb(temp, i2c_imx->base + IMX_I2C_I2CR); 215 writeb(temp, i2c_imx->base + IMX_I2C_I2CR);
216 return result;
196} 217}
197 218
198static void i2c_imx_stop(struct imx_i2c_struct *i2c_imx) 219static void i2c_imx_stop(struct imx_i2c_struct *i2c_imx)
199{ 220{
200 unsigned int temp = 0; 221 unsigned int temp = 0;
201 222
202 /* Stop I2C transaction */ 223 if (!i2c_imx->stopped) {
203 dev_dbg(&i2c_imx->adapter.dev, "<%s>\n", __func__); 224 /* Stop I2C transaction */
204 temp = readb(i2c_imx->base + IMX_I2C_I2CR); 225 dev_dbg(&i2c_imx->adapter.dev, "<%s>\n", __func__);
205 temp &= ~I2CR_MSTA; 226 temp = readb(i2c_imx->base + IMX_I2C_I2CR);
206 writeb(temp, i2c_imx->base + IMX_I2C_I2CR); 227 temp &= ~(I2CR_MSTA | I2CR_MTX);
207 /* setup chip registers to defaults */ 228 writeb(temp, i2c_imx->base + IMX_I2C_I2CR);
208 writeb(I2CR_IEN, i2c_imx->base + IMX_I2C_I2CR); 229 i2c_imx->stopped = 1;
209 writeb(0, i2c_imx->base + IMX_I2C_I2SR); 230 }
210 /* 231 if (cpu_is_mx1()) {
211 * This delay caused by an i.MXL hardware bug. 232 /*
212 * If no (or too short) delay, no "STOP" bit will be generated. 233 * This delay caused by an i.MXL hardware bug.
213 */ 234 * If no (or too short) delay, no "STOP" bit will be generated.
214 udelay(i2c_imx->disable_delay); 235 */
236 udelay(i2c_imx->disable_delay);
237 }
238
239 if (!i2c_imx->stopped)
240 i2c_imx_bus_busy(i2c_imx, 0);
241
215 /* Disable I2C controller */ 242 /* Disable I2C controller */
216 writeb(0, i2c_imx->base + IMX_I2C_I2CR); 243 writeb(0, i2c_imx->base + IMX_I2C_I2CR);
244 clk_disable(i2c_imx->clk);
217} 245}
218 246
219static void __init i2c_imx_set_clk(struct imx_i2c_struct *i2c_imx, 247static void __init i2c_imx_set_clk(struct imx_i2c_struct *i2c_imx,
@@ -233,8 +261,8 @@ static void __init i2c_imx_set_clk(struct imx_i2c_struct *i2c_imx,
233 else 261 else
234 for (i = 0; i2c_clk_div[i][0] < div; i++); 262 for (i = 0; i2c_clk_div[i][0] < div; i++);
235 263
236 /* Write divider value to register */ 264 /* Store divider value */
237 writeb(i2c_clk_div[i][1], i2c_imx->base + IMX_I2C_IFDR); 265 i2c_imx->ifdr = i2c_clk_div[i][1];
238 266
239 /* 267 /*
240 * There dummy delay is calculated. 268 * There dummy delay is calculated.
@@ -341,11 +369,15 @@ static int i2c_imx_read(struct imx_i2c_struct *i2c_imx, struct i2c_msg *msgs)
341 if (result) 369 if (result)
342 return result; 370 return result;
343 if (i == (msgs->len - 1)) { 371 if (i == (msgs->len - 1)) {
372 /* It must generate STOP before read I2DR to prevent
373 controller from generating another clock cycle */
344 dev_dbg(&i2c_imx->adapter.dev, 374 dev_dbg(&i2c_imx->adapter.dev,
345 "<%s> clear MSTA\n", __func__); 375 "<%s> clear MSTA\n", __func__);
346 temp = readb(i2c_imx->base + IMX_I2C_I2CR); 376 temp = readb(i2c_imx->base + IMX_I2C_I2CR);
347 temp &= ~I2CR_MSTA; 377 temp &= ~(I2CR_MSTA | I2CR_MTX);
348 writeb(temp, i2c_imx->base + IMX_I2C_I2CR); 378 writeb(temp, i2c_imx->base + IMX_I2C_I2CR);
379 i2c_imx_bus_busy(i2c_imx, 0);
380 i2c_imx->stopped = 1;
349 } else if (i == (msgs->len - 2)) { 381 } else if (i == (msgs->len - 2)) {
350 dev_dbg(&i2c_imx->adapter.dev, 382 dev_dbg(&i2c_imx->adapter.dev,
351 "<%s> set TXAK\n", __func__); 383 "<%s> set TXAK\n", __func__);
@@ -370,14 +402,11 @@ static int i2c_imx_xfer(struct i2c_adapter *adapter,
370 402
371 dev_dbg(&i2c_imx->adapter.dev, "<%s>\n", __func__); 403 dev_dbg(&i2c_imx->adapter.dev, "<%s>\n", __func__);
372 404
373 /* Check if i2c bus is not busy */ 405 /* Start I2C transfer */
374 result = i2c_imx_bus_busy(i2c_imx); 406 result = i2c_imx_start(i2c_imx);
375 if (result) 407 if (result)
376 goto fail0; 408 goto fail0;
377 409
378 /* Start I2C transfer */
379 i2c_imx_start(i2c_imx);
380
381 /* read/write data */ 410 /* read/write data */
382 for (i = 0; i < num; i++) { 411 for (i = 0; i < num; i++) {
383 if (i) { 412 if (i) {
@@ -386,6 +415,9 @@ static int i2c_imx_xfer(struct i2c_adapter *adapter,
386 temp = readb(i2c_imx->base + IMX_I2C_I2CR); 415 temp = readb(i2c_imx->base + IMX_I2C_I2CR);
387 temp |= I2CR_RSTA; 416 temp |= I2CR_RSTA;
388 writeb(temp, i2c_imx->base + IMX_I2C_I2CR); 417 writeb(temp, i2c_imx->base + IMX_I2C_I2CR);
418 result = i2c_imx_bus_busy(i2c_imx, 1);
419 if (result)
420 goto fail0;
389 } 421 }
390 dev_dbg(&i2c_imx->adapter.dev, 422 dev_dbg(&i2c_imx->adapter.dev,
391 "<%s> transfer message: %d\n", __func__, i); 423 "<%s> transfer message: %d\n", __func__, i);
@@ -500,7 +532,6 @@ static int __init i2c_imx_probe(struct platform_device *pdev)
500 dev_err(&pdev->dev, "can't get I2C clock\n"); 532 dev_err(&pdev->dev, "can't get I2C clock\n");
501 goto fail3; 533 goto fail3;
502 } 534 }
503 clk_enable(i2c_imx->clk);
504 535
505 /* Request IRQ */ 536 /* Request IRQ */
506 ret = request_irq(i2c_imx->irq, i2c_imx_isr, 0, pdev->name, i2c_imx); 537 ret = request_irq(i2c_imx->irq, i2c_imx_isr, 0, pdev->name, i2c_imx);
@@ -549,7 +580,6 @@ static int __init i2c_imx_probe(struct platform_device *pdev)
549fail5: 580fail5:
550 free_irq(i2c_imx->irq, i2c_imx); 581 free_irq(i2c_imx->irq, i2c_imx);
551fail4: 582fail4:
552 clk_disable(i2c_imx->clk);
553 clk_put(i2c_imx->clk); 583 clk_put(i2c_imx->clk);
554fail3: 584fail3:
555 release_mem_region(i2c_imx->res->start, resource_size(res)); 585 release_mem_region(i2c_imx->res->start, resource_size(res));
@@ -586,8 +616,6 @@ static int __exit i2c_imx_remove(struct platform_device *pdev)
586 if (pdata && pdata->exit) 616 if (pdata && pdata->exit)
587 pdata->exit(&pdev->dev); 617 pdata->exit(&pdev->dev);
588 618
589 /* Disable I2C clock */
590 clk_disable(i2c_imx->clk);
591 clk_put(i2c_imx->clk); 619 clk_put(i2c_imx->clk);
592 620
593 release_mem_region(i2c_imx->res->start, resource_size(i2c_imx->res)); 621 release_mem_region(i2c_imx->res->start, resource_size(i2c_imx->res));
diff --git a/drivers/i2c/busses/i2c-mpc.c b/drivers/i2c/busses/i2c-mpc.c
index d325e86e3103..f627001108b8 100644
--- a/drivers/i2c/busses/i2c-mpc.c
+++ b/drivers/i2c/busses/i2c-mpc.c
@@ -365,9 +365,6 @@ static int mpc_write(struct mpc_i2c *i2c, int target,
365 unsigned timeout = i2c->adap.timeout; 365 unsigned timeout = i2c->adap.timeout;
366 u32 flags = restart ? CCR_RSTA : 0; 366 u32 flags = restart ? CCR_RSTA : 0;
367 367
368 /* Start with MEN */
369 if (!restart)
370 writeccr(i2c, CCR_MEN);
371 /* Start as master */ 368 /* Start as master */
372 writeccr(i2c, CCR_MIEN | CCR_MEN | CCR_MSTA | CCR_MTX | flags); 369 writeccr(i2c, CCR_MIEN | CCR_MEN | CCR_MSTA | CCR_MTX | flags);
373 /* Write target byte */ 370 /* Write target byte */
@@ -396,9 +393,6 @@ static int mpc_read(struct mpc_i2c *i2c, int target,
396 int i, result; 393 int i, result;
397 u32 flags = restart ? CCR_RSTA : 0; 394 u32 flags = restart ? CCR_RSTA : 0;
398 395
399 /* Start with MEN */
400 if (!restart)
401 writeccr(i2c, CCR_MEN);
402 /* Switch to read - restart */ 396 /* Switch to read - restart */
403 writeccr(i2c, CCR_MIEN | CCR_MEN | CCR_MSTA | CCR_MTX | flags); 397 writeccr(i2c, CCR_MIEN | CCR_MEN | CCR_MSTA | CCR_MTX | flags);
404 /* Write target address byte - this time with the read flag set */ 398 /* Write target address byte - this time with the read flag set */
@@ -425,9 +419,9 @@ static int mpc_read(struct mpc_i2c *i2c, int target,
425 /* Generate txack on next to last byte */ 419 /* Generate txack on next to last byte */
426 if (i == length - 2) 420 if (i == length - 2)
427 writeccr(i2c, CCR_MIEN | CCR_MEN | CCR_MSTA | CCR_TXAK); 421 writeccr(i2c, CCR_MIEN | CCR_MEN | CCR_MSTA | CCR_TXAK);
428 /* Generate stop on last byte */ 422 /* Do not generate stop on last byte */
429 if (i == length - 1) 423 if (i == length - 1)
430 writeccr(i2c, CCR_MIEN | CCR_MEN | CCR_TXAK); 424 writeccr(i2c, CCR_MIEN | CCR_MEN | CCR_MSTA | CCR_MTX);
431 data[i] = readb(i2c->base + MPC_I2C_DR); 425 data[i] = readb(i2c->base + MPC_I2C_DR);
432 } 426 }
433 427
diff --git a/drivers/i2c/busses/i2c-piix4.c b/drivers/i2c/busses/i2c-piix4.c
index d26a972aacaa..1e245e9cad31 100644
--- a/drivers/i2c/busses/i2c-piix4.c
+++ b/drivers/i2c/busses/i2c-piix4.c
@@ -22,7 +22,7 @@
22 Intel PIIX4, 440MX 22 Intel PIIX4, 440MX
23 Serverworks OSB4, CSB5, CSB6, HT-1000, HT-1100 23 Serverworks OSB4, CSB5, CSB6, HT-1000, HT-1100
24 ATI IXP200, IXP300, IXP400, SB600, SB700, SB800 24 ATI IXP200, IXP300, IXP400, SB600, SB700, SB800
25 AMD SB900 25 AMD Hudson-2
26 SMSC Victory66 26 SMSC Victory66
27 27
28 Note: we assume there can only be one device, with one SMBus interface. 28 Note: we assume there can only be one device, with one SMBus interface.
@@ -233,9 +233,9 @@ static int __devinit piix4_setup_sb800(struct pci_dev *PIIX4_dev,
233 unsigned short smba_idx = 0xcd6; 233 unsigned short smba_idx = 0xcd6;
234 u8 smba_en_lo, smba_en_hi, i2ccfg, i2ccfg_offset = 0x10, smb_en = 0x2c; 234 u8 smba_en_lo, smba_en_hi, i2ccfg, i2ccfg_offset = 0x10, smb_en = 0x2c;
235 235
236 /* SB800 SMBus does not support forcing address */ 236 /* SB800 and later SMBus does not support forcing address */
237 if (force || force_addr) { 237 if (force || force_addr) {
238 dev_err(&PIIX4_dev->dev, "SB800 SMBus does not support " 238 dev_err(&PIIX4_dev->dev, "SMBus does not support "
239 "forcing address!\n"); 239 "forcing address!\n");
240 return -EINVAL; 240 return -EINVAL;
241 } 241 }
@@ -480,7 +480,7 @@ static struct pci_device_id piix4_ids[] = {
480 { PCI_DEVICE(PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_IXP300_SMBUS) }, 480 { PCI_DEVICE(PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_IXP300_SMBUS) },
481 { PCI_DEVICE(PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_IXP400_SMBUS) }, 481 { PCI_DEVICE(PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_IXP400_SMBUS) },
482 { PCI_DEVICE(PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_SBX00_SMBUS) }, 482 { PCI_DEVICE(PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_SBX00_SMBUS) },
483 { PCI_DEVICE(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_SB900_SMBUS) }, 483 { PCI_DEVICE(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_HUDSON2_SMBUS) },
484 { PCI_DEVICE(PCI_VENDOR_ID_SERVERWORKS, 484 { PCI_DEVICE(PCI_VENDOR_ID_SERVERWORKS,
485 PCI_DEVICE_ID_SERVERWORKS_OSB4) }, 485 PCI_DEVICE_ID_SERVERWORKS_OSB4) },
486 { PCI_DEVICE(PCI_VENDOR_ID_SERVERWORKS, 486 { PCI_DEVICE(PCI_VENDOR_ID_SERVERWORKS,
diff --git a/drivers/i2c/busses/i2c-pnx.c b/drivers/i2c/busses/i2c-pnx.c
index 6ff6c20f1e78..fbab6846ae64 100644
--- a/drivers/i2c/busses/i2c-pnx.c
+++ b/drivers/i2c/busses/i2c-pnx.c
@@ -19,7 +19,9 @@
19#include <linux/completion.h> 19#include <linux/completion.h>
20#include <linux/platform_device.h> 20#include <linux/platform_device.h>
21#include <linux/i2c-pnx.h> 21#include <linux/i2c-pnx.h>
22#include <linux/io.h>
22#include <mach/hardware.h> 23#include <mach/hardware.h>
24#include <mach/i2c.h>
23#include <asm/irq.h> 25#include <asm/irq.h>
24#include <asm/uaccess.h> 26#include <asm/uaccess.h>
25 27
@@ -54,6 +56,9 @@ static inline void i2c_pnx_arm_timer(struct i2c_adapter *adap)
54 struct timer_list *timer = &data->mif.timer; 56 struct timer_list *timer = &data->mif.timer;
55 int expires = I2C_PNX_TIMEOUT / (1000 / HZ); 57 int expires = I2C_PNX_TIMEOUT / (1000 / HZ);
56 58
59 if (expires <= 1)
60 expires = 2;
61
57 del_timer_sync(timer); 62 del_timer_sync(timer);
58 63
59 dev_dbg(&adap->dev, "Timer armed at %lu plus %u jiffies.\n", 64 dev_dbg(&adap->dev, "Timer armed at %lu plus %u jiffies.\n",
@@ -645,7 +650,7 @@ static int __devinit i2c_pnx_probe(struct platform_device *pdev)
645 return 0; 650 return 0;
646 651
647out_irq: 652out_irq:
648 free_irq(alg_data->irq, alg_data); 653 free_irq(alg_data->irq, i2c_pnx->adapter);
649out_clock: 654out_clock:
650 i2c_pnx->set_clock_stop(pdev); 655 i2c_pnx->set_clock_stop(pdev);
651out_unmap: 656out_unmap:
@@ -664,7 +669,7 @@ static int __devexit i2c_pnx_remove(struct platform_device *pdev)
664 struct i2c_adapter *adap = i2c_pnx->adapter; 669 struct i2c_adapter *adap = i2c_pnx->adapter;
665 struct i2c_pnx_algo_data *alg_data = adap->algo_data; 670 struct i2c_pnx_algo_data *alg_data = adap->algo_data;
666 671
667 free_irq(alg_data->irq, alg_data); 672 free_irq(alg_data->irq, i2c_pnx->adapter);
668 i2c_del_adapter(adap); 673 i2c_del_adapter(adap);
669 i2c_pnx->set_clock_stop(pdev); 674 i2c_pnx->set_clock_stop(pdev);
670 iounmap((void *)alg_data->ioaddr); 675 iounmap((void *)alg_data->ioaddr);
diff --git a/drivers/i2c/chips/tsl2550.c b/drivers/i2c/chips/tsl2550.c
index aa96bd2d27ea..a0702f36a72f 100644
--- a/drivers/i2c/chips/tsl2550.c
+++ b/drivers/i2c/chips/tsl2550.c
@@ -257,6 +257,7 @@ static DEVICE_ATTR(operating_mode, S_IWUSR | S_IRUGO,
257 257
258static ssize_t __tsl2550_show_lux(struct i2c_client *client, char *buf) 258static ssize_t __tsl2550_show_lux(struct i2c_client *client, char *buf)
259{ 259{
260 struct tsl2550_data *data = i2c_get_clientdata(client);
260 u8 ch0, ch1; 261 u8 ch0, ch1;
261 int ret; 262 int ret;
262 263
@@ -274,6 +275,8 @@ static ssize_t __tsl2550_show_lux(struct i2c_client *client, char *buf)
274 ret = tsl2550_calculate_lux(ch0, ch1); 275 ret = tsl2550_calculate_lux(ch0, ch1);
275 if (ret < 0) 276 if (ret < 0)
276 return ret; 277 return ret;
278 if (data->operating_mode == 1)
279 ret *= 5;
277 280
278 return sprintf(buf, "%d\n", ret); 281 return sprintf(buf, "%d\n", ret);
279} 282}
diff --git a/drivers/i2c/i2c-core.c b/drivers/i2c/i2c-core.c
index 8d80fceca6a4..296504355142 100644
--- a/drivers/i2c/i2c-core.c
+++ b/drivers/i2c/i2c-core.c
@@ -762,6 +762,7 @@ int i2c_del_adapter(struct i2c_adapter *adap)
762{ 762{
763 int res = 0; 763 int res = 0;
764 struct i2c_adapter *found; 764 struct i2c_adapter *found;
765 struct i2c_client *client, *next;
765 766
766 /* First make sure that this adapter was ever added */ 767 /* First make sure that this adapter was ever added */
767 mutex_lock(&core_lock); 768 mutex_lock(&core_lock);
@@ -781,6 +782,16 @@ int i2c_del_adapter(struct i2c_adapter *adap)
781 if (res) 782 if (res)
782 return res; 783 return res;
783 784
785 /* Remove devices instantiated from sysfs */
786 list_for_each_entry_safe(client, next, &userspace_devices, detected) {
787 if (client->adapter == adap) {
788 dev_dbg(&adap->dev, "Removing %s at 0x%x\n",
789 client->name, client->addr);
790 list_del(&client->detected);
791 i2c_unregister_device(client);
792 }
793 }
794
784 /* Detach any active clients. This can't fail, thus we do not 795 /* Detach any active clients. This can't fail, thus we do not
785 checking the returned value. */ 796 checking the returned value. */
786 res = device_for_each_child(&adap->dev, NULL, __unregister_client); 797 res = device_for_each_child(&adap->dev, NULL, __unregister_client);
diff --git a/drivers/ide/ide-cs.c b/drivers/ide/ide-cs.c
index 063b933d864a..dd6396384c25 100644
--- a/drivers/ide/ide-cs.c
+++ b/drivers/ide/ide-cs.c
@@ -60,15 +60,6 @@ MODULE_AUTHOR("David Hinds <dahinds@users.sourceforge.net>");
60MODULE_DESCRIPTION("PCMCIA ATA/IDE card driver"); 60MODULE_DESCRIPTION("PCMCIA ATA/IDE card driver");
61MODULE_LICENSE("Dual MPL/GPL"); 61MODULE_LICENSE("Dual MPL/GPL");
62 62
63#define INT_MODULE_PARM(n, v) static int n = v; module_param(n, int, 0)
64
65#ifdef CONFIG_PCMCIA_DEBUG
66INT_MODULE_PARM(pc_debug, 0);
67#define DEBUG(n, args...) if (pc_debug>(n)) printk(KERN_DEBUG args)
68#else
69#define DEBUG(n, args...)
70#endif
71
72/*====================================================================*/ 63/*====================================================================*/
73 64
74typedef struct ide_info_t { 65typedef struct ide_info_t {
@@ -98,7 +89,7 @@ static int ide_probe(struct pcmcia_device *link)
98{ 89{
99 ide_info_t *info; 90 ide_info_t *info;
100 91
101 DEBUG(0, "ide_attach()\n"); 92 dev_dbg(&link->dev, "ide_attach()\n");
102 93
103 /* Create new ide device */ 94 /* Create new ide device */
104 info = kzalloc(sizeof(*info), GFP_KERNEL); 95 info = kzalloc(sizeof(*info), GFP_KERNEL);
@@ -112,7 +103,6 @@ static int ide_probe(struct pcmcia_device *link)
112 link->io.Attributes2 = IO_DATA_PATH_WIDTH_8; 103 link->io.Attributes2 = IO_DATA_PATH_WIDTH_8;
113 link->io.IOAddrLines = 3; 104 link->io.IOAddrLines = 3;
114 link->irq.Attributes = IRQ_TYPE_DYNAMIC_SHARING; 105 link->irq.Attributes = IRQ_TYPE_DYNAMIC_SHARING;
115 link->irq.IRQInfo1 = IRQ_LEVEL_ID;
116 link->conf.Attributes = CONF_ENABLE_IRQ; 106 link->conf.Attributes = CONF_ENABLE_IRQ;
117 link->conf.IntType = INT_MEMORY_AND_IO; 107 link->conf.IntType = INT_MEMORY_AND_IO;
118 108
@@ -134,7 +124,7 @@ static void ide_detach(struct pcmcia_device *link)
134 ide_hwif_t *hwif = info->host->ports[0]; 124 ide_hwif_t *hwif = info->host->ports[0];
135 unsigned long data_addr, ctl_addr; 125 unsigned long data_addr, ctl_addr;
136 126
137 DEBUG(0, "ide_detach(0x%p)\n", link); 127 dev_dbg(&link->dev, "ide_detach(0x%p)\n", link);
138 128
139 data_addr = hwif->io_ports.data_addr; 129 data_addr = hwif->io_ports.data_addr;
140 ctl_addr = hwif->io_ports.ctl_addr; 130 ctl_addr = hwif->io_ports.ctl_addr;
@@ -217,9 +207,6 @@ out_release:
217 207
218======================================================================*/ 208======================================================================*/
219 209
220#define CS_CHECK(fn, ret) \
221do { last_fn = (fn); if ((last_ret = (ret)) != 0) goto cs_failed; } while (0)
222
223struct pcmcia_config_check { 210struct pcmcia_config_check {
224 unsigned long ctl_base; 211 unsigned long ctl_base;
225 int skip_vcc; 212 int skip_vcc;
@@ -282,11 +269,11 @@ static int ide_config(struct pcmcia_device *link)
282{ 269{
283 ide_info_t *info = link->priv; 270 ide_info_t *info = link->priv;
284 struct pcmcia_config_check *stk = NULL; 271 struct pcmcia_config_check *stk = NULL;
285 int last_ret = 0, last_fn = 0, is_kme = 0; 272 int ret = 0, is_kme = 0;
286 unsigned long io_base, ctl_base; 273 unsigned long io_base, ctl_base;
287 struct ide_host *host; 274 struct ide_host *host;
288 275
289 DEBUG(0, "ide_config(0x%p)\n", link); 276 dev_dbg(&link->dev, "ide_config(0x%p)\n", link);
290 277
291 is_kme = ((link->manf_id == MANFID_KME) && 278 is_kme = ((link->manf_id == MANFID_KME) &&
292 ((link->card_id == PRODID_KME_KXLC005_A) || 279 ((link->card_id == PRODID_KME_KXLC005_A) ||
@@ -306,8 +293,12 @@ static int ide_config(struct pcmcia_device *link)
306 io_base = link->io.BasePort1; 293 io_base = link->io.BasePort1;
307 ctl_base = stk->ctl_base; 294 ctl_base = stk->ctl_base;
308 295
309 CS_CHECK(RequestIRQ, pcmcia_request_irq(link, &link->irq)); 296 ret = pcmcia_request_irq(link, &link->irq);
310 CS_CHECK(RequestConfiguration, pcmcia_request_configuration(link, &link->conf)); 297 if (ret)
298 goto failed;
299 ret = pcmcia_request_configuration(link, &link->conf);
300 if (ret)
301 goto failed;
311 302
312 /* disable drive interrupts during IDE probe */ 303 /* disable drive interrupts during IDE probe */
313 outb(0x02, ctl_base); 304 outb(0x02, ctl_base);
@@ -342,8 +333,6 @@ err_mem:
342 printk(KERN_NOTICE "ide-cs: ide_config failed memory allocation\n"); 333 printk(KERN_NOTICE "ide-cs: ide_config failed memory allocation\n");
343 goto failed; 334 goto failed;
344 335
345cs_failed:
346 cs_error(link, last_fn, last_ret);
347failed: 336failed:
348 kfree(stk); 337 kfree(stk);
349 ide_release(link); 338 ide_release(link);
@@ -363,7 +352,7 @@ static void ide_release(struct pcmcia_device *link)
363 ide_info_t *info = link->priv; 352 ide_info_t *info = link->priv;
364 struct ide_host *host = info->host; 353 struct ide_host *host = info->host;
365 354
366 DEBUG(0, "ide_release(0x%p)\n", link); 355 dev_dbg(&link->dev, "ide_release(0x%p)\n", link);
367 356
368 if (info->ndev) 357 if (info->ndev)
369 /* FIXME: if this fails we need to queue the cleanup somehow 358 /* FIXME: if this fails we need to queue the cleanup somehow
diff --git a/drivers/ide/ide-ioctls.c b/drivers/ide/ide-ioctls.c
index d3440b5010a5..6e7ae2b6cfc6 100644
--- a/drivers/ide/ide-ioctls.c
+++ b/drivers/ide/ide-ioctls.c
@@ -162,7 +162,7 @@ static int ide_cmd_ioctl(ide_drive_t *drive, unsigned long arg)
162 if (tf->command == ATA_CMD_SET_FEATURES && 162 if (tf->command == ATA_CMD_SET_FEATURES &&
163 tf->feature == SETFEATURES_XFER && 163 tf->feature == SETFEATURES_XFER &&
164 tf->nsect >= XFER_SW_DMA_0) { 164 tf->nsect >= XFER_SW_DMA_0) {
165 xfer_rate = ide_find_dma_mode(drive, XFER_UDMA_6); 165 xfer_rate = ide_find_dma_mode(drive, tf->nsect);
166 if (xfer_rate != tf->nsect) { 166 if (xfer_rate != tf->nsect) {
167 err = -EINVAL; 167 err = -EINVAL;
168 goto abort; 168 goto abort;
diff --git a/drivers/ide/ide-probe.c b/drivers/ide/ide-probe.c
index 63c53d65e875..4d76ba473097 100644
--- a/drivers/ide/ide-probe.c
+++ b/drivers/ide/ide-probe.c
@@ -1046,15 +1046,6 @@ static void ide_port_init_devices(ide_hwif_t *hwif)
1046 if (port_ops && port_ops->init_dev) 1046 if (port_ops && port_ops->init_dev)
1047 port_ops->init_dev(drive); 1047 port_ops->init_dev(drive);
1048 } 1048 }
1049
1050 ide_port_for_each_dev(i, drive, hwif) {
1051 /*
1052 * default to PIO Mode 0 before we figure out
1053 * the most suited mode for the attached device
1054 */
1055 if (port_ops && port_ops->set_pio_mode)
1056 port_ops->set_pio_mode(drive, 0);
1057 }
1058} 1049}
1059 1050
1060static void ide_init_port(ide_hwif_t *hwif, unsigned int port, 1051static void ide_init_port(ide_hwif_t *hwif, unsigned int port,
diff --git a/drivers/ieee802154/fakehard.c b/drivers/ieee802154/fakehard.c
index 96a2959ce877..7c544f7c74c4 100644
--- a/drivers/ieee802154/fakehard.c
+++ b/drivers/ieee802154/fakehard.c
@@ -260,15 +260,12 @@ static int ieee802154_fake_close(struct net_device *dev)
260static netdev_tx_t ieee802154_fake_xmit(struct sk_buff *skb, 260static netdev_tx_t ieee802154_fake_xmit(struct sk_buff *skb,
261 struct net_device *dev) 261 struct net_device *dev)
262{ 262{
263 skb->iif = dev->ifindex;
264 skb->dev = dev;
265 dev->stats.tx_packets++; 263 dev->stats.tx_packets++;
266 dev->stats.tx_bytes += skb->len; 264 dev->stats.tx_bytes += skb->len;
267 265
268 dev->trans_start = jiffies;
269
270 /* FIXME: do hardware work here ... */ 266 /* FIXME: do hardware work here ... */
271 267
268 dev_kfree_skb(skb);
272 return NETDEV_TX_OK; 269 return NETDEV_TX_OK;
273} 270}
274 271
diff --git a/drivers/input/ff-core.c b/drivers/input/ff-core.c
index 72c63e5dd630..38df81fcdc3a 100644
--- a/drivers/input/ff-core.c
+++ b/drivers/input/ff-core.c
@@ -337,16 +337,16 @@ int input_ff_create(struct input_dev *dev, int max_effects)
337 dev->ff = ff; 337 dev->ff = ff;
338 dev->flush = flush_effects; 338 dev->flush = flush_effects;
339 dev->event = input_ff_event; 339 dev->event = input_ff_event;
340 set_bit(EV_FF, dev->evbit); 340 __set_bit(EV_FF, dev->evbit);
341 341
342 /* Copy "true" bits into ff device bitmap */ 342 /* Copy "true" bits into ff device bitmap */
343 for (i = 0; i <= FF_MAX; i++) 343 for (i = 0; i <= FF_MAX; i++)
344 if (test_bit(i, dev->ffbit)) 344 if (test_bit(i, dev->ffbit))
345 set_bit(i, ff->ffbit); 345 __set_bit(i, ff->ffbit);
346 346
347 /* we can emulate RUMBLE with periodic effects */ 347 /* we can emulate RUMBLE with periodic effects */
348 if (test_bit(FF_PERIODIC, ff->ffbit)) 348 if (test_bit(FF_PERIODIC, ff->ffbit))
349 set_bit(FF_RUMBLE, dev->ffbit); 349 __set_bit(FF_RUMBLE, dev->ffbit);
350 350
351 return 0; 351 return 0;
352} 352}
@@ -362,12 +362,14 @@ EXPORT_SYMBOL_GPL(input_ff_create);
362 */ 362 */
363void input_ff_destroy(struct input_dev *dev) 363void input_ff_destroy(struct input_dev *dev)
364{ 364{
365 clear_bit(EV_FF, dev->evbit); 365 struct ff_device *ff = dev->ff;
366 if (dev->ff) { 366
367 if (dev->ff->destroy) 367 __clear_bit(EV_FF, dev->evbit);
368 dev->ff->destroy(dev->ff); 368 if (ff) {
369 kfree(dev->ff->private); 369 if (ff->destroy)
370 kfree(dev->ff); 370 ff->destroy(ff);
371 kfree(ff->private);
372 kfree(ff);
371 dev->ff = NULL; 373 dev->ff = NULL;
372 } 374 }
373} 375}
diff --git a/drivers/input/ff-memless.c b/drivers/input/ff-memless.c
index 2d1415e16834..b483b2995fa9 100644
--- a/drivers/input/ff-memless.c
+++ b/drivers/input/ff-memless.c
@@ -61,7 +61,6 @@ struct ml_device {
61 struct ml_effect_state states[FF_MEMLESS_EFFECTS]; 61 struct ml_effect_state states[FF_MEMLESS_EFFECTS];
62 int gain; 62 int gain;
63 struct timer_list timer; 63 struct timer_list timer;
64 spinlock_t timer_lock;
65 struct input_dev *dev; 64 struct input_dev *dev;
66 65
67 int (*play_effect)(struct input_dev *dev, void *data, 66 int (*play_effect)(struct input_dev *dev, void *data,
@@ -368,38 +367,38 @@ static void ml_effect_timer(unsigned long timer_data)
368{ 367{
369 struct input_dev *dev = (struct input_dev *)timer_data; 368 struct input_dev *dev = (struct input_dev *)timer_data;
370 struct ml_device *ml = dev->ff->private; 369 struct ml_device *ml = dev->ff->private;
370 unsigned long flags;
371 371
372 debug("timer: updating effects"); 372 debug("timer: updating effects");
373 373
374 spin_lock(&ml->timer_lock); 374 spin_lock_irqsave(&dev->event_lock, flags);
375 ml_play_effects(ml); 375 ml_play_effects(ml);
376 spin_unlock(&ml->timer_lock); 376 spin_unlock_irqrestore(&dev->event_lock, flags);
377} 377}
378 378
379/*
380 * Sets requested gain for FF effects. Called with dev->event_lock held.
381 */
379static void ml_ff_set_gain(struct input_dev *dev, u16 gain) 382static void ml_ff_set_gain(struct input_dev *dev, u16 gain)
380{ 383{
381 struct ml_device *ml = dev->ff->private; 384 struct ml_device *ml = dev->ff->private;
382 int i; 385 int i;
383 386
384 spin_lock_bh(&ml->timer_lock);
385
386 ml->gain = gain; 387 ml->gain = gain;
387 388
388 for (i = 0; i < FF_MEMLESS_EFFECTS; i++) 389 for (i = 0; i < FF_MEMLESS_EFFECTS; i++)
389 __clear_bit(FF_EFFECT_PLAYING, &ml->states[i].flags); 390 __clear_bit(FF_EFFECT_PLAYING, &ml->states[i].flags);
390 391
391 ml_play_effects(ml); 392 ml_play_effects(ml);
392
393 spin_unlock_bh(&ml->timer_lock);
394} 393}
395 394
395/*
396 * Start/stop specified FF effect. Called with dev->event_lock held.
397 */
396static int ml_ff_playback(struct input_dev *dev, int effect_id, int value) 398static int ml_ff_playback(struct input_dev *dev, int effect_id, int value)
397{ 399{
398 struct ml_device *ml = dev->ff->private; 400 struct ml_device *ml = dev->ff->private;
399 struct ml_effect_state *state = &ml->states[effect_id]; 401 struct ml_effect_state *state = &ml->states[effect_id];
400 unsigned long flags;
401
402 spin_lock_irqsave(&ml->timer_lock, flags);
403 402
404 if (value > 0) { 403 if (value > 0) {
405 debug("initiated play"); 404 debug("initiated play");
@@ -425,8 +424,6 @@ static int ml_ff_playback(struct input_dev *dev, int effect_id, int value)
425 ml_play_effects(ml); 424 ml_play_effects(ml);
426 } 425 }
427 426
428 spin_unlock_irqrestore(&ml->timer_lock, flags);
429
430 return 0; 427 return 0;
431} 428}
432 429
@@ -436,7 +433,7 @@ static int ml_ff_upload(struct input_dev *dev,
436 struct ml_device *ml = dev->ff->private; 433 struct ml_device *ml = dev->ff->private;
437 struct ml_effect_state *state = &ml->states[effect->id]; 434 struct ml_effect_state *state = &ml->states[effect->id];
438 435
439 spin_lock_bh(&ml->timer_lock); 436 spin_lock_irq(&dev->event_lock);
440 437
441 if (test_bit(FF_EFFECT_STARTED, &state->flags)) { 438 if (test_bit(FF_EFFECT_STARTED, &state->flags)) {
442 __clear_bit(FF_EFFECT_PLAYING, &state->flags); 439 __clear_bit(FF_EFFECT_PLAYING, &state->flags);
@@ -448,7 +445,7 @@ static int ml_ff_upload(struct input_dev *dev,
448 ml_schedule_timer(ml); 445 ml_schedule_timer(ml);
449 } 446 }
450 447
451 spin_unlock_bh(&ml->timer_lock); 448 spin_unlock_irq(&dev->event_lock);
452 449
453 return 0; 450 return 0;
454} 451}
@@ -482,7 +479,6 @@ int input_ff_create_memless(struct input_dev *dev, void *data,
482 ml->private = data; 479 ml->private = data;
483 ml->play_effect = play_effect; 480 ml->play_effect = play_effect;
484 ml->gain = 0xffff; 481 ml->gain = 0xffff;
485 spin_lock_init(&ml->timer_lock);
486 setup_timer(&ml->timer, ml_effect_timer, (unsigned long)dev); 482 setup_timer(&ml->timer, ml_effect_timer, (unsigned long)dev);
487 483
488 set_bit(FF_GAIN, dev->ffbit); 484 set_bit(FF_GAIN, dev->ffbit);
diff --git a/drivers/input/input.c b/drivers/input/input.c
index cc763c96fada..2266ecbfbc01 100644
--- a/drivers/input/input.c
+++ b/drivers/input/input.c
@@ -1292,17 +1292,24 @@ static int input_dev_uevent(struct device *device, struct kobj_uevent_env *env)
1292 return 0; 1292 return 0;
1293} 1293}
1294 1294
1295#define INPUT_DO_TOGGLE(dev, type, bits, on) \ 1295#define INPUT_DO_TOGGLE(dev, type, bits, on) \
1296 do { \ 1296 do { \
1297 int i; \ 1297 int i; \
1298 if (!test_bit(EV_##type, dev->evbit)) \ 1298 bool active; \
1299 break; \ 1299 \
1300 for (i = 0; i < type##_MAX; i++) { \ 1300 if (!test_bit(EV_##type, dev->evbit)) \
1301 if (!test_bit(i, dev->bits##bit) || \ 1301 break; \
1302 !test_bit(i, dev->bits)) \ 1302 \
1303 continue; \ 1303 for (i = 0; i < type##_MAX; i++) { \
1304 dev->event(dev, EV_##type, i, on); \ 1304 if (!test_bit(i, dev->bits##bit)) \
1305 } \ 1305 continue; \
1306 \
1307 active = test_bit(i, dev->bits); \
1308 if (!active && !on) \
1309 continue; \
1310 \
1311 dev->event(dev, EV_##type, i, on ? active : 0); \
1312 } \
1306 } while (0) 1313 } while (0)
1307 1314
1308#ifdef CONFIG_PM 1315#ifdef CONFIG_PM
diff --git a/drivers/input/keyboard/atkbd.c b/drivers/input/keyboard/atkbd.c
index a6512372c7a3..28e6110d1ff8 100644
--- a/drivers/input/keyboard/atkbd.c
+++ b/drivers/input/keyboard/atkbd.c
@@ -233,6 +233,7 @@ struct atkbd {
233 */ 233 */
234static void (*atkbd_platform_fixup)(struct atkbd *, const void *data); 234static void (*atkbd_platform_fixup)(struct atkbd *, const void *data);
235static void *atkbd_platform_fixup_data; 235static void *atkbd_platform_fixup_data;
236static unsigned int (*atkbd_platform_scancode_fixup)(struct atkbd *, unsigned int);
236 237
237static ssize_t atkbd_attr_show_helper(struct device *dev, char *buf, 238static ssize_t atkbd_attr_show_helper(struct device *dev, char *buf,
238 ssize_t (*handler)(struct atkbd *, char *)); 239 ssize_t (*handler)(struct atkbd *, char *));
@@ -393,6 +394,9 @@ static irqreturn_t atkbd_interrupt(struct serio *serio, unsigned char data,
393 394
394 input_event(dev, EV_MSC, MSC_RAW, code); 395 input_event(dev, EV_MSC, MSC_RAW, code);
395 396
397 if (atkbd_platform_scancode_fixup)
398 code = atkbd_platform_scancode_fixup(atkbd, code);
399
396 if (atkbd->translated) { 400 if (atkbd->translated) {
397 401
398 if (atkbd->emul || atkbd_need_xlate(atkbd->xl_bit, code)) { 402 if (atkbd->emul || atkbd_need_xlate(atkbd->xl_bit, code)) {
@@ -923,6 +927,22 @@ static unsigned int atkbd_volume_forced_release_keys[] = {
923}; 927};
924 928
925/* 929/*
930 * OQO 01+ multimedia keys (64--66) generate e0 6x upon release whereas
931 * they should be generating e4-e6 (0x80 | code).
932 */
933static unsigned int atkbd_oqo_01plus_scancode_fixup(struct atkbd *atkbd,
934 unsigned int code)
935{
936 if (atkbd->translated && atkbd->emul == 1 &&
937 (code == 0x64 || code == 0x65 || code == 0x66)) {
938 atkbd->emul = 0;
939 code |= 0x80;
940 }
941
942 return code;
943}
944
945/*
926 * atkbd_set_keycode_table() initializes keyboard's keycode table 946 * atkbd_set_keycode_table() initializes keyboard's keycode table
927 * according to the selected scancode set 947 * according to the selected scancode set
928 */ 948 */
@@ -1154,6 +1174,18 @@ static int atkbd_reconnect(struct serio *serio)
1154 return -1; 1174 return -1;
1155 1175
1156 atkbd_activate(atkbd); 1176 atkbd_activate(atkbd);
1177
1178 /*
1179 * Restore LED state and repeat rate. While input core
1180 * will do this for us at resume time reconnect may happen
1181 * because user requested it via sysfs or simply because
1182 * keyboard was unplugged and plugged in again so we need
1183 * to do it ourselves here.
1184 */
1185 atkbd_set_leds(atkbd);
1186 if (!atkbd->softrepeat)
1187 atkbd_set_repeat_rate(atkbd);
1188
1157 } 1189 }
1158 1190
1159 atkbd_enable(atkbd); 1191 atkbd_enable(atkbd);
@@ -1402,6 +1434,7 @@ static ssize_t atkbd_set_set(struct atkbd *atkbd, const char *buf, size_t count)
1402 1434
1403 atkbd->dev = new_dev; 1435 atkbd->dev = new_dev;
1404 atkbd->set = atkbd_select_set(atkbd, value, atkbd->extra); 1436 atkbd->set = atkbd_select_set(atkbd, value, atkbd->extra);
1437 atkbd_reset_state(atkbd);
1405 atkbd_activate(atkbd); 1438 atkbd_activate(atkbd);
1406 atkbd_set_keycode_table(atkbd); 1439 atkbd_set_keycode_table(atkbd);
1407 atkbd_set_device_attrs(atkbd); 1440 atkbd_set_device_attrs(atkbd);
@@ -1527,6 +1560,13 @@ static int __init atkbd_setup_forced_release(const struct dmi_system_id *id)
1527 return 0; 1560 return 0;
1528} 1561}
1529 1562
1563static int __init atkbd_setup_scancode_fixup(const struct dmi_system_id *id)
1564{
1565 atkbd_platform_scancode_fixup = id->driver_data;
1566
1567 return 0;
1568}
1569
1530static struct dmi_system_id atkbd_dmi_quirk_table[] __initdata = { 1570static struct dmi_system_id atkbd_dmi_quirk_table[] __initdata = {
1531 { 1571 {
1532 .ident = "Dell Laptop", 1572 .ident = "Dell Laptop",
@@ -1663,6 +1703,15 @@ static struct dmi_system_id atkbd_dmi_quirk_table[] __initdata = {
1663 .callback = atkbd_setup_forced_release, 1703 .callback = atkbd_setup_forced_release,
1664 .driver_data = atkdb_soltech_ta12_forced_release_keys, 1704 .driver_data = atkdb_soltech_ta12_forced_release_keys,
1665 }, 1705 },
1706 {
1707 .ident = "OQO Model 01+",
1708 .matches = {
1709 DMI_MATCH(DMI_SYS_VENDOR, "OQO"),
1710 DMI_MATCH(DMI_PRODUCT_NAME, "ZEPTO"),
1711 },
1712 .callback = atkbd_setup_scancode_fixup,
1713 .driver_data = atkbd_oqo_01plus_scancode_fixup,
1714 },
1666 { } 1715 { }
1667}; 1716};
1668 1717
diff --git a/drivers/input/keyboard/gpio_keys.c b/drivers/input/keyboard/gpio_keys.c
index a88aff3816a0..77d130914259 100644
--- a/drivers/input/keyboard/gpio_keys.c
+++ b/drivers/input/keyboard/gpio_keys.c
@@ -147,6 +147,7 @@ static int __devinit gpio_keys_probe(struct platform_device *pdev)
147 } 147 }
148 148
149 error = request_irq(irq, gpio_keys_isr, 149 error = request_irq(irq, gpio_keys_isr,
150 IRQF_SHARED |
150 IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING, 151 IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING,
151 button->desc ? button->desc : "gpio_keys", 152 button->desc ? button->desc : "gpio_keys",
152 bdata); 153 bdata);
diff --git a/drivers/input/misc/Kconfig b/drivers/input/misc/Kconfig
index 02f4f8f1db6f..a9bb2544b2de 100644
--- a/drivers/input/misc/Kconfig
+++ b/drivers/input/misc/Kconfig
@@ -227,6 +227,7 @@ config INPUT_WINBOND_CIR
227 depends on X86 && PNP 227 depends on X86 && PNP
228 select NEW_LEDS 228 select NEW_LEDS
229 select LEDS_CLASS 229 select LEDS_CLASS
230 select LEDS_TRIGGERS
230 select BITREVERSE 231 select BITREVERSE
231 help 232 help
232 Say Y here if you want to use the IR remote functionality found 233 Say Y here if you want to use the IR remote functionality found
diff --git a/drivers/input/mouse/lifebook.c b/drivers/input/mouse/lifebook.c
index 5e6308694408..82811558ec33 100644
--- a/drivers/input/mouse/lifebook.c
+++ b/drivers/input/mouse/lifebook.c
@@ -107,8 +107,7 @@ static const struct dmi_system_id lifebook_dmi_table[] = {
107 .matches = { 107 .matches = {
108 DMI_MATCH(DMI_PRODUCT_NAME, "CF-72"), 108 DMI_MATCH(DMI_PRODUCT_NAME, "CF-72"),
109 }, 109 },
110 .callback = lifebook_set_serio_phys, 110 .callback = lifebook_set_6byte_proto,
111 .driver_data = "isa0060/serio3",
112 }, 111 },
113 { 112 {
114 .ident = "Lifebook B142", 113 .ident = "Lifebook B142",
diff --git a/drivers/input/mouse/psmouse-base.c b/drivers/input/mouse/psmouse-base.c
index 690aed905436..07c53798301a 100644
--- a/drivers/input/mouse/psmouse-base.c
+++ b/drivers/input/mouse/psmouse-base.c
@@ -581,7 +581,7 @@ static int cortron_detect(struct psmouse *psmouse, bool set_properties)
581static int psmouse_extensions(struct psmouse *psmouse, 581static int psmouse_extensions(struct psmouse *psmouse,
582 unsigned int max_proto, bool set_properties) 582 unsigned int max_proto, bool set_properties)
583{ 583{
584 bool synaptics_hardware = true; 584 bool synaptics_hardware = false;
585 585
586/* 586/*
587 * We always check for lifebook because it does not disturb mouse 587 * We always check for lifebook because it does not disturb mouse
@@ -1673,7 +1673,7 @@ static int psmouse_get_maxproto(char *buffer, struct kernel_param *kp)
1673{ 1673{
1674 int type = *((unsigned int *)kp->arg); 1674 int type = *((unsigned int *)kp->arg);
1675 1675
1676 return sprintf(buffer, "%s\n", psmouse_protocol_by_type(type)->name); 1676 return sprintf(buffer, "%s", psmouse_protocol_by_type(type)->name);
1677} 1677}
1678 1678
1679static int __init psmouse_init(void) 1679static int __init psmouse_init(void)
diff --git a/drivers/input/serio/i8042-x86ia64io.h b/drivers/input/serio/i8042-x86ia64io.h
index a537925f7651..2bcf1ace27c0 100644
--- a/drivers/input/serio/i8042-x86ia64io.h
+++ b/drivers/input/serio/i8042-x86ia64io.h
@@ -447,6 +447,27 @@ static struct dmi_system_id __initdata i8042_dmi_reset_table[] = {
447 DMI_MATCH(DMI_PRODUCT_NAME, "N10"), 447 DMI_MATCH(DMI_PRODUCT_NAME, "N10"),
448 }, 448 },
449 }, 449 },
450 {
451 .ident = "Dell Vostro 1320",
452 .matches = {
453 DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
454 DMI_MATCH(DMI_PRODUCT_NAME, "Vostro 1320"),
455 },
456 },
457 {
458 .ident = "Dell Vostro 1520",
459 .matches = {
460 DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
461 DMI_MATCH(DMI_PRODUCT_NAME, "Vostro 1520"),
462 },
463 },
464 {
465 .ident = "Dell Vostro 1720",
466 .matches = {
467 DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
468 DMI_MATCH(DMI_PRODUCT_NAME, "Vostro 1720"),
469 },
470 },
450 { } 471 { }
451}; 472};
452 473
diff --git a/drivers/input/serio/i8042.c b/drivers/input/serio/i8042.c
index a31578170ccc..1df02d25aca5 100644
--- a/drivers/input/serio/i8042.c
+++ b/drivers/input/serio/i8042.c
@@ -836,17 +836,32 @@ static int i8042_controller_selftest(void)
836static int i8042_controller_init(void) 836static int i8042_controller_init(void)
837{ 837{
838 unsigned long flags; 838 unsigned long flags;
839 int n = 0;
840 unsigned char ctr[2];
839 841
840/* 842/*
841 * Save the CTR for restoral on unload / reboot. 843 * Save the CTR for restore on unload / reboot.
842 */ 844 */
843 845
844 if (i8042_command(&i8042_ctr, I8042_CMD_CTL_RCTR)) { 846 do {
845 printk(KERN_ERR "i8042.c: Can't read CTR while initializing i8042.\n"); 847 if (n >= 10) {
846 return -EIO; 848 printk(KERN_ERR
847 } 849 "i8042.c: Unable to get stable CTR read.\n");
850 return -EIO;
851 }
852
853 if (n != 0)
854 udelay(50);
855
856 if (i8042_command(&ctr[n++ % 2], I8042_CMD_CTL_RCTR)) {
857 printk(KERN_ERR
858 "i8042.c: Can't read CTR while initializing i8042.\n");
859 return -EIO;
860 }
848 861
849 i8042_initial_ctr = i8042_ctr; 862 } while (n < 2 || ctr[0] != ctr[1]);
863
864 i8042_initial_ctr = i8042_ctr = ctr[0];
850 865
851/* 866/*
852 * Disable the keyboard interface and interrupt. 867 * Disable the keyboard interface and interrupt.
@@ -895,6 +910,12 @@ static int i8042_controller_init(void)
895 return -EIO; 910 return -EIO;
896 } 911 }
897 912
913/*
914 * Flush whatever accumulated while we were disabling keyboard port.
915 */
916
917 i8042_flush();
918
898 return 0; 919 return 0;
899} 920}
900 921
@@ -914,7 +935,7 @@ static void i8042_controller_reset(void)
914 i8042_ctr |= I8042_CTR_KBDDIS | I8042_CTR_AUXDIS; 935 i8042_ctr |= I8042_CTR_KBDDIS | I8042_CTR_AUXDIS;
915 i8042_ctr &= ~(I8042_CTR_KBDINT | I8042_CTR_AUXINT); 936 i8042_ctr &= ~(I8042_CTR_KBDINT | I8042_CTR_AUXINT);
916 937
917 if (i8042_command(&i8042_initial_ctr, I8042_CMD_CTL_WCTR)) 938 if (i8042_command(&i8042_ctr, I8042_CMD_CTL_WCTR))
918 printk(KERN_WARNING "i8042.c: Can't write CTR while resetting.\n"); 939 printk(KERN_WARNING "i8042.c: Can't write CTR while resetting.\n");
919 940
920/* 941/*
diff --git a/drivers/isdn/hardware/avm/avm_cs.c b/drivers/isdn/hardware/avm/avm_cs.c
index c72565520e41..5a6ae646a636 100644
--- a/drivers/isdn/hardware/avm/avm_cs.c
+++ b/drivers/isdn/hardware/avm/avm_cs.c
@@ -111,8 +111,6 @@ static int avmcs_probe(struct pcmcia_device *p_dev)
111 p_dev->irq.Attributes = IRQ_TYPE_EXCLUSIVE; 111 p_dev->irq.Attributes = IRQ_TYPE_EXCLUSIVE;
112 p_dev->irq.Attributes = IRQ_TYPE_DYNAMIC_SHARING|IRQ_FIRST_SHARED; 112 p_dev->irq.Attributes = IRQ_TYPE_DYNAMIC_SHARING|IRQ_FIRST_SHARED;
113 113
114 p_dev->irq.IRQInfo1 = IRQ_LEVEL_ID;
115
116 /* General socket configuration */ 114 /* General socket configuration */
117 p_dev->conf.Attributes = CONF_ENABLE_IRQ; 115 p_dev->conf.Attributes = CONF_ENABLE_IRQ;
118 p_dev->conf.IntType = INT_MEMORY_AND_IO; 116 p_dev->conf.IntType = INT_MEMORY_AND_IO;
@@ -198,7 +196,6 @@ static int avmcs_config(struct pcmcia_device *link)
198 */ 196 */
199 i = pcmcia_request_irq(link, &link->irq); 197 i = pcmcia_request_irq(link, &link->irq);
200 if (i != 0) { 198 if (i != 0) {
201 cs_error(link, RequestIRQ, i);
202 /* undo */ 199 /* undo */
203 pcmcia_disable_device(link); 200 pcmcia_disable_device(link);
204 break; 201 break;
@@ -209,7 +206,6 @@ static int avmcs_config(struct pcmcia_device *link)
209 */ 206 */
210 i = pcmcia_request_configuration(link, &link->conf); 207 i = pcmcia_request_configuration(link, &link->conf);
211 if (i != 0) { 208 if (i != 0) {
212 cs_error(link, RequestConfiguration, i);
213 pcmcia_disable_device(link); 209 pcmcia_disable_device(link);
214 break; 210 break;
215 } 211 }
diff --git a/drivers/isdn/hardware/eicon/maintidi.c b/drivers/isdn/hardware/eicon/maintidi.c
index 23960cb6eaab..41c26e756452 100644
--- a/drivers/isdn/hardware/eicon/maintidi.c
+++ b/drivers/isdn/hardware/eicon/maintidi.c
@@ -959,8 +959,9 @@ static int process_idi_event (diva_strace_context_t* pLib,
959 } 959 }
960 if (!strncmp("State\\Layer2 No1", path, pVar->path_length)) { 960 if (!strncmp("State\\Layer2 No1", path, pVar->path_length)) {
961 char* tmp = &pLib->lines[0].pInterface->Layer2[0]; 961 char* tmp = &pLib->lines[0].pInterface->Layer2[0];
962 dword l2_state; 962 dword l2_state;
963 diva_strace_read_uint (pVar, &l2_state); 963 if (diva_strace_read_uint(pVar, &l2_state))
964 return -1;
964 965
965 switch (l2_state) { 966 switch (l2_state) {
966 case 0: 967 case 0:
diff --git a/drivers/isdn/hardware/eicon/message.c b/drivers/isdn/hardware/eicon/message.c
index 27d5dd68f4fb..ae89fb89da64 100644
--- a/drivers/isdn/hardware/eicon/message.c
+++ b/drivers/isdn/hardware/eicon/message.c
@@ -2692,7 +2692,7 @@ static byte connect_b3_req(dword Id, word Number, DIVA_CAPI_ADAPTER *a,
2692 if (!(fax_control_bits & T30_CONTROL_BIT_MORE_DOCUMENTS) 2692 if (!(fax_control_bits & T30_CONTROL_BIT_MORE_DOCUMENTS)
2693 || (fax_feature_bits & T30_FEATURE_BIT_MORE_DOCUMENTS)) 2693 || (fax_feature_bits & T30_FEATURE_BIT_MORE_DOCUMENTS))
2694 { 2694 {
2695 len = (byte)(&(((T30_INFO *) 0)->universal_6)); 2695 len = offsetof(T30_INFO, universal_6);
2696 fax_info_change = false; 2696 fax_info_change = false;
2697 if (ncpi->length >= 4) 2697 if (ncpi->length >= 4)
2698 { 2698 {
@@ -2754,7 +2754,7 @@ static byte connect_b3_req(dword Id, word Number, DIVA_CAPI_ADAPTER *a,
2754 for (i = 0; i < w; i++) 2754 for (i = 0; i < w; i++)
2755 ((T30_INFO *)(plci->fax_connect_info_buffer))->station_id[i] = fax_parms[4].info[1+i]; 2755 ((T30_INFO *)(plci->fax_connect_info_buffer))->station_id[i] = fax_parms[4].info[1+i];
2756 ((T30_INFO *)(plci->fax_connect_info_buffer))->head_line_len = 0; 2756 ((T30_INFO *)(plci->fax_connect_info_buffer))->head_line_len = 0;
2757 len = (byte)(((T30_INFO *) 0)->station_id + 20); 2757 len = offsetof(T30_INFO, station_id) + 20;
2758 w = fax_parms[5].length; 2758 w = fax_parms[5].length;
2759 if (w > 20) 2759 if (w > 20)
2760 w = 20; 2760 w = 20;
@@ -2788,7 +2788,7 @@ static byte connect_b3_req(dword Id, word Number, DIVA_CAPI_ADAPTER *a,
2788 } 2788 }
2789 else 2789 else
2790 { 2790 {
2791 len = (byte)(&(((T30_INFO *) 0)->universal_6)); 2791 len = offsetof(T30_INFO, universal_6);
2792 } 2792 }
2793 fax_info_change = true; 2793 fax_info_change = true;
2794 2794
@@ -2892,7 +2892,7 @@ static byte connect_b3_res(dword Id, word Number, DIVA_CAPI_ADAPTER *a,
2892 && (plci->nsf_control_bits & T30_NSF_CONTROL_BIT_ENABLE_NSF) 2892 && (plci->nsf_control_bits & T30_NSF_CONTROL_BIT_ENABLE_NSF)
2893 && (plci->nsf_control_bits & T30_NSF_CONTROL_BIT_NEGOTIATE_RESP)) 2893 && (plci->nsf_control_bits & T30_NSF_CONTROL_BIT_NEGOTIATE_RESP))
2894 { 2894 {
2895 len = ((byte)(((T30_INFO *) 0)->station_id + 20)); 2895 len = offsetof(T30_INFO, station_id) + 20;
2896 if (plci->fax_connect_info_length < len) 2896 if (plci->fax_connect_info_length < len)
2897 { 2897 {
2898 ((T30_INFO *)(plci->fax_connect_info_buffer))->station_id_len = 0; 2898 ((T30_INFO *)(plci->fax_connect_info_buffer))->station_id_len = 0;
@@ -3802,7 +3802,7 @@ static byte manufacturer_res(dword Id, word Number, DIVA_CAPI_ADAPTER *a,
3802 break; 3802 break;
3803 } 3803 }
3804 ncpi = &m_parms[1]; 3804 ncpi = &m_parms[1];
3805 len = ((byte)(((T30_INFO *) 0)->station_id + 20)); 3805 len = offsetof(T30_INFO, station_id) + 20;
3806 if (plci->fax_connect_info_length < len) 3806 if (plci->fax_connect_info_length < len)
3807 { 3807 {
3808 ((T30_INFO *)(plci->fax_connect_info_buffer))->station_id_len = 0; 3808 ((T30_INFO *)(plci->fax_connect_info_buffer))->station_id_len = 0;
@@ -6844,7 +6844,7 @@ static void nl_ind(PLCI *plci)
6844 if ((plci->requested_options_conn | plci->requested_options | a->requested_options_table[plci->appl->Id-1]) 6844 if ((plci->requested_options_conn | plci->requested_options | a->requested_options_table[plci->appl->Id-1])
6845 & ((1L << PRIVATE_FAX_SUB_SEP_PWD) | (1L << PRIVATE_FAX_NONSTANDARD))) 6845 & ((1L << PRIVATE_FAX_SUB_SEP_PWD) | (1L << PRIVATE_FAX_NONSTANDARD)))
6846 { 6846 {
6847 i = ((word)(((T30_INFO *) 0)->station_id + 20)) + ((T30_INFO *)plci->NL.RBuffer->P)->head_line_len; 6847 i = offsetof(T30_INFO, station_id) + 20 + ((T30_INFO *)plci->NL.RBuffer->P)->head_line_len;
6848 while (i < plci->NL.RBuffer->length) 6848 while (i < plci->NL.RBuffer->length)
6849 plci->ncpi_buffer[++len] = plci->NL.RBuffer->P[i++]; 6849 plci->ncpi_buffer[++len] = plci->NL.RBuffer->P[i++];
6850 } 6850 }
@@ -7236,7 +7236,7 @@ static void nl_ind(PLCI *plci)
7236 { 7236 {
7237 plci->RData[1].P = plci->RData[0].P; 7237 plci->RData[1].P = plci->RData[0].P;
7238 plci->RData[1].PLength = plci->RData[0].PLength; 7238 plci->RData[1].PLength = plci->RData[0].PLength;
7239 plci->RData[0].P = v120_header_buffer + (-((int) v120_header_buffer) & 3); 7239 plci->RData[0].P = v120_header_buffer + (-((unsigned long)v120_header_buffer) & 3);
7240 if ((plci->NL.RBuffer->P[0] & V120_HEADER_EXTEND_BIT) || (plci->NL.RLength == 1)) 7240 if ((plci->NL.RBuffer->P[0] & V120_HEADER_EXTEND_BIT) || (plci->NL.RLength == 1))
7241 plci->RData[0].PLength = 1; 7241 plci->RData[0].PLength = 1;
7242 else 7242 else
@@ -8473,7 +8473,7 @@ static word add_b23(PLCI *plci, API_PARSE *bp)
8473 fax_control_bits |= T30_CONTROL_BIT_ACCEPT_SEL_POLLING; 8473 fax_control_bits |= T30_CONTROL_BIT_ACCEPT_SEL_POLLING;
8474 } 8474 }
8475 len = nlc[0]; 8475 len = nlc[0];
8476 pos = ((byte)(((T30_INFO *) 0)->station_id + 20)); 8476 pos = offsetof(T30_INFO, station_id) + 20;
8477 if (pos < plci->fax_connect_info_length) 8477 if (pos < plci->fax_connect_info_length)
8478 { 8478 {
8479 for (i = 1 + plci->fax_connect_info_buffer[pos]; i != 0; i--) 8479 for (i = 1 + plci->fax_connect_info_buffer[pos]; i != 0; i--)
@@ -8525,7 +8525,7 @@ static word add_b23(PLCI *plci, API_PARSE *bp)
8525 } 8525 }
8526 8526
8527 PUT_WORD(&(((T30_INFO *)&nlc[1])->control_bits_low), fax_control_bits); 8527 PUT_WORD(&(((T30_INFO *)&nlc[1])->control_bits_low), fax_control_bits);
8528 len = ((byte)(((T30_INFO *) 0)->station_id + 20)); 8528 len = offsetof(T30_INFO, station_id) + 20;
8529 for (i = 0; i < len; i++) 8529 for (i = 0; i < len; i++)
8530 plci->fax_connect_info_buffer[i] = nlc[1+i]; 8530 plci->fax_connect_info_buffer[i] = nlc[1+i];
8531 ((T30_INFO *) plci->fax_connect_info_buffer)->head_line_len = 0; 8531 ((T30_INFO *) plci->fax_connect_info_buffer)->head_line_len = 0;
diff --git a/drivers/isdn/hardware/mISDN/hfcmulti.c b/drivers/isdn/hardware/mISDN/hfcmulti.c
index faed794cf75a..a6624ad252c5 100644
--- a/drivers/isdn/hardware/mISDN/hfcmulti.c
+++ b/drivers/isdn/hardware/mISDN/hfcmulti.c
@@ -5481,7 +5481,7 @@ HFCmulti_init(void)
5481 if (err) { 5481 if (err) {
5482 printk(KERN_ERR "error registering embedded driver: " 5482 printk(KERN_ERR "error registering embedded driver: "
5483 "%x\n", err); 5483 "%x\n", err);
5484 return -err; 5484 return err;
5485 } 5485 }
5486 HFC_cnt++; 5486 HFC_cnt++;
5487 printk(KERN_INFO "%d devices registered\n", HFC_cnt); 5487 printk(KERN_INFO "%d devices registered\n", HFC_cnt);
diff --git a/drivers/isdn/hisax/amd7930_fn.c b/drivers/isdn/hisax/amd7930_fn.c
index bf526a7a63af..d6fdf1f66754 100644
--- a/drivers/isdn/hisax/amd7930_fn.c
+++ b/drivers/isdn/hisax/amd7930_fn.c
@@ -594,6 +594,7 @@ Amd7930_l1hw(struct PStack *st, int pr, void *arg)
594 if (cs->debug & L1_DEB_WARN) 594 if (cs->debug & L1_DEB_WARN)
595 debugl1(cs, "Amd7930: l1hw: l2l1 tx_skb exist this shouldn't happen"); 595 debugl1(cs, "Amd7930: l1hw: l2l1 tx_skb exist this shouldn't happen");
596 skb_queue_tail(&cs->sq, skb); 596 skb_queue_tail(&cs->sq, skb);
597 spin_unlock_irqrestore(&cs->lock, flags);
597 break; 598 break;
598 } 599 }
599 if (cs->debug & DEB_DLOG_HEX) 600 if (cs->debug & DEB_DLOG_HEX)
diff --git a/drivers/isdn/hisax/avma1_cs.c b/drivers/isdn/hisax/avma1_cs.c
index 23560c897ec3..f9bdff39cf4a 100644
--- a/drivers/isdn/hisax/avma1_cs.c
+++ b/drivers/isdn/hisax/avma1_cs.c
@@ -30,22 +30,6 @@ MODULE_DESCRIPTION("ISDN4Linux: PCMCIA client driver for AVM A1/Fritz!PCMCIA car
30MODULE_AUTHOR("Carsten Paeth"); 30MODULE_AUTHOR("Carsten Paeth");
31MODULE_LICENSE("GPL"); 31MODULE_LICENSE("GPL");
32 32
33/*
34 All the PCMCIA modules use PCMCIA_DEBUG to control debugging. If
35 you do not define PCMCIA_DEBUG at all, all the debug code will be
36 left out. If you compile with PCMCIA_DEBUG=0, the debug code will
37 be present but disabled -- but it can then be enabled for specific
38 modules at load time with a 'pc_debug=#' option to insmod.
39*/
40#ifdef PCMCIA_DEBUG
41static int pc_debug = PCMCIA_DEBUG;
42module_param(pc_debug, int, 0);
43#define DEBUG(n, args...) if (pc_debug>(n)) printk(KERN_DEBUG args);
44static char *version =
45"avma1_cs.c 1.00 1998/01/23 10:00:00 (Carsten Paeth)";
46#else
47#define DEBUG(n, args...)
48#endif
49 33
50/*====================================================================*/ 34/*====================================================================*/
51 35
@@ -119,7 +103,7 @@ static int avma1cs_probe(struct pcmcia_device *p_dev)
119{ 103{
120 local_info_t *local; 104 local_info_t *local;
121 105
122 DEBUG(0, "avma1cs_attach()\n"); 106 dev_dbg(&p_dev->dev, "avma1cs_attach()\n");
123 107
124 /* Allocate space for private device-specific data */ 108 /* Allocate space for private device-specific data */
125 local = kzalloc(sizeof(local_info_t), GFP_KERNEL); 109 local = kzalloc(sizeof(local_info_t), GFP_KERNEL);
@@ -139,8 +123,6 @@ static int avma1cs_probe(struct pcmcia_device *p_dev)
139 p_dev->irq.Attributes = IRQ_TYPE_EXCLUSIVE; 123 p_dev->irq.Attributes = IRQ_TYPE_EXCLUSIVE;
140 p_dev->irq.Attributes = IRQ_TYPE_DYNAMIC_SHARING|IRQ_FIRST_SHARED; 124 p_dev->irq.Attributes = IRQ_TYPE_DYNAMIC_SHARING|IRQ_FIRST_SHARED;
141 125
142 p_dev->irq.IRQInfo1 = IRQ_LEVEL_ID;
143
144 /* General socket configuration */ 126 /* General socket configuration */
145 p_dev->conf.Attributes = CONF_ENABLE_IRQ; 127 p_dev->conf.Attributes = CONF_ENABLE_IRQ;
146 p_dev->conf.IntType = INT_MEMORY_AND_IO; 128 p_dev->conf.IntType = INT_MEMORY_AND_IO;
@@ -161,7 +143,7 @@ static int avma1cs_probe(struct pcmcia_device *p_dev)
161 143
162static void avma1cs_detach(struct pcmcia_device *link) 144static void avma1cs_detach(struct pcmcia_device *link)
163{ 145{
164 DEBUG(0, "avma1cs_detach(0x%p)\n", link); 146 dev_dbg(&link->dev, "avma1cs_detach(0x%p)\n", link);
165 avma1cs_release(link); 147 avma1cs_release(link);
166 kfree(link->priv); 148 kfree(link->priv);
167} /* avma1cs_detach */ 149} /* avma1cs_detach */
@@ -203,7 +185,7 @@ static int avma1cs_config(struct pcmcia_device *link)
203 185
204 dev = link->priv; 186 dev = link->priv;
205 187
206 DEBUG(0, "avma1cs_config(0x%p)\n", link); 188 dev_dbg(&link->dev, "avma1cs_config(0x%p)\n", link);
207 189
208 devname[0] = 0; 190 devname[0] = 0;
209 if (link->prod_id[1]) 191 if (link->prod_id[1])
@@ -218,7 +200,6 @@ static int avma1cs_config(struct pcmcia_device *link)
218 */ 200 */
219 i = pcmcia_request_irq(link, &link->irq); 201 i = pcmcia_request_irq(link, &link->irq);
220 if (i != 0) { 202 if (i != 0) {
221 cs_error(link, RequestIRQ, i);
222 /* undo */ 203 /* undo */
223 pcmcia_disable_device(link); 204 pcmcia_disable_device(link);
224 break; 205 break;
@@ -229,7 +210,6 @@ static int avma1cs_config(struct pcmcia_device *link)
229 */ 210 */
230 i = pcmcia_request_configuration(link, &link->conf); 211 i = pcmcia_request_configuration(link, &link->conf);
231 if (i != 0) { 212 if (i != 0) {
232 cs_error(link, RequestConfiguration, i);
233 pcmcia_disable_device(link); 213 pcmcia_disable_device(link);
234 break; 214 break;
235 } 215 }
@@ -281,7 +261,7 @@ static void avma1cs_release(struct pcmcia_device *link)
281{ 261{
282 local_info_t *local = link->priv; 262 local_info_t *local = link->priv;
283 263
284 DEBUG(0, "avma1cs_release(0x%p)\n", link); 264 dev_dbg(&link->dev, "avma1cs_release(0x%p)\n", link);
285 265
286 /* now unregister function with hisax */ 266 /* now unregister function with hisax */
287 HiSax_closecard(local->node.minor); 267 HiSax_closecard(local->node.minor);
diff --git a/drivers/isdn/hisax/diva.c b/drivers/isdn/hisax/diva.c
index 018bd293e580..0b0c2e5d806b 100644
--- a/drivers/isdn/hisax/diva.c
+++ b/drivers/isdn/hisax/diva.c
@@ -382,7 +382,7 @@ MemwaitforXFW(struct IsdnCardState *cs, int hscx)
382{ 382{
383 int to = 50; 383 int to = 50;
384 384
385 while ((!(MemReadHSCX(cs, hscx, HSCX_STAR) & 0x44) == 0x40) && to) { 385 while (((MemReadHSCX(cs, hscx, HSCX_STAR) & 0x44) != 0x40) && to) {
386 udelay(1); 386 udelay(1);
387 to--; 387 to--;
388 } 388 }
diff --git a/drivers/isdn/hisax/elsa_cs.c b/drivers/isdn/hisax/elsa_cs.c
index f4d0fe29bcf8..a2f709f53974 100644
--- a/drivers/isdn/hisax/elsa_cs.c
+++ b/drivers/isdn/hisax/elsa_cs.c
@@ -57,23 +57,6 @@ MODULE_DESCRIPTION("ISDN4Linux: PCMCIA client driver for Elsa PCM cards");
57MODULE_AUTHOR("Klaus Lichtenwalder"); 57MODULE_AUTHOR("Klaus Lichtenwalder");
58MODULE_LICENSE("Dual MPL/GPL"); 58MODULE_LICENSE("Dual MPL/GPL");
59 59
60/*
61 All the PCMCIA modules use PCMCIA_DEBUG to control debugging. If
62 you do not define PCMCIA_DEBUG at all, all the debug code will be
63 left out. If you compile with PCMCIA_DEBUG=0, the debug code will
64 be present but disabled -- but it can then be enabled for specific
65 modules at load time with a 'pc_debug=#' option to insmod.
66*/
67
68#ifdef PCMCIA_DEBUG
69static int pc_debug = PCMCIA_DEBUG;
70module_param(pc_debug, int, 0);
71#define DEBUG(n, args...) if (pc_debug>(n)) printk(KERN_DEBUG args);
72static char *version =
73"elsa_cs.c $Revision: 1.2.2.4 $ $Date: 2004/01/25 15:07:06 $ (K.Lichtenwalder)";
74#else
75#define DEBUG(n, args...)
76#endif
77 60
78/*====================================================================*/ 61/*====================================================================*/
79 62
@@ -142,7 +125,7 @@ static int elsa_cs_probe(struct pcmcia_device *link)
142{ 125{
143 local_info_t *local; 126 local_info_t *local;
144 127
145 DEBUG(0, "elsa_cs_attach()\n"); 128 dev_dbg(&link->dev, "elsa_cs_attach()\n");
146 129
147 /* Allocate space for private device-specific data */ 130 /* Allocate space for private device-specific data */
148 local = kzalloc(sizeof(local_info_t), GFP_KERNEL); 131 local = kzalloc(sizeof(local_info_t), GFP_KERNEL);
@@ -155,7 +138,6 @@ static int elsa_cs_probe(struct pcmcia_device *link)
155 138
156 /* Interrupt setup */ 139 /* Interrupt setup */
157 link->irq.Attributes = IRQ_TYPE_DYNAMIC_SHARING|IRQ_FIRST_SHARED; 140 link->irq.Attributes = IRQ_TYPE_DYNAMIC_SHARING|IRQ_FIRST_SHARED;
158 link->irq.IRQInfo1 = IRQ_LEVEL_ID|IRQ_SHARE_ID;
159 link->irq.Handler = NULL; 141 link->irq.Handler = NULL;
160 142
161 /* 143 /*
@@ -188,7 +170,7 @@ static void elsa_cs_detach(struct pcmcia_device *link)
188{ 170{
189 local_info_t *info = link->priv; 171 local_info_t *info = link->priv;
190 172
191 DEBUG(0, "elsa_cs_detach(0x%p)\n", link); 173 dev_dbg(&link->dev, "elsa_cs_detach(0x%p)\n", link);
192 174
193 info->busy = 1; 175 info->busy = 1;
194 elsa_cs_release(link); 176 elsa_cs_release(link);
@@ -231,30 +213,25 @@ static int elsa_cs_configcheck(struct pcmcia_device *p_dev,
231static int elsa_cs_config(struct pcmcia_device *link) 213static int elsa_cs_config(struct pcmcia_device *link)
232{ 214{
233 local_info_t *dev; 215 local_info_t *dev;
234 int i, last_fn; 216 int i;
235 IsdnCard_t icard; 217 IsdnCard_t icard;
236 218
237 DEBUG(0, "elsa_config(0x%p)\n", link); 219 dev_dbg(&link->dev, "elsa_config(0x%p)\n", link);
238 dev = link->priv; 220 dev = link->priv;
239 221
240 i = pcmcia_loop_config(link, elsa_cs_configcheck, NULL); 222 i = pcmcia_loop_config(link, elsa_cs_configcheck, NULL);
241 if (i != 0) { 223 if (i != 0)
242 last_fn = RequestIO; 224 goto failed;
243 goto cs_failed;
244 }
245 225
246 i = pcmcia_request_irq(link, &link->irq); 226 i = pcmcia_request_irq(link, &link->irq);
247 if (i != 0) { 227 if (i != 0) {
248 link->irq.AssignedIRQ = 0; 228 link->irq.AssignedIRQ = 0;
249 last_fn = RequestIRQ; 229 goto failed;
250 goto cs_failed;
251 } 230 }
252 231
253 i = pcmcia_request_configuration(link, &link->conf); 232 i = pcmcia_request_configuration(link, &link->conf);
254 if (i != 0) { 233 if (i != 0)
255 last_fn = RequestConfiguration; 234 goto failed;
256 goto cs_failed;
257 }
258 235
259 /* At this point, the dev_node_t structure(s) should be 236 /* At this point, the dev_node_t structure(s) should be
260 initialized and arranged in a linked list at link->dev. *//* */ 237 initialized and arranged in a linked list at link->dev. *//* */
@@ -290,8 +267,7 @@ static int elsa_cs_config(struct pcmcia_device *link)
290 ((local_info_t*)link->priv)->cardnr = i; 267 ((local_info_t*)link->priv)->cardnr = i;
291 268
292 return 0; 269 return 0;
293cs_failed: 270failed:
294 cs_error(link, last_fn, i);
295 elsa_cs_release(link); 271 elsa_cs_release(link);
296 return -ENODEV; 272 return -ENODEV;
297} /* elsa_cs_config */ 273} /* elsa_cs_config */
@@ -308,7 +284,7 @@ static void elsa_cs_release(struct pcmcia_device *link)
308{ 284{
309 local_info_t *local = link->priv; 285 local_info_t *local = link->priv;
310 286
311 DEBUG(0, "elsa_cs_release(0x%p)\n", link); 287 dev_dbg(&link->dev, "elsa_cs_release(0x%p)\n", link);
312 288
313 if (local) { 289 if (local) {
314 if (local->cardnr >= 0) { 290 if (local->cardnr >= 0) {
diff --git a/drivers/isdn/hisax/elsa_ser.c b/drivers/isdn/hisax/elsa_ser.c
index f181db464392..1657bba7879e 100644
--- a/drivers/isdn/hisax/elsa_ser.c
+++ b/drivers/isdn/hisax/elsa_ser.c
@@ -477,62 +477,62 @@ static void
477modem_set_init(struct IsdnCardState *cs) { 477modem_set_init(struct IsdnCardState *cs) {
478 int timeout; 478 int timeout;
479 479
480#define RCV_DELAY 20000 480#define RCV_DELAY 20
481 modem_write_cmd(cs, MInit_1, strlen(MInit_1)); 481 modem_write_cmd(cs, MInit_1, strlen(MInit_1));
482 timeout = 1000; 482 timeout = 1000;
483 while(timeout-- && cs->hw.elsa.transcnt) 483 while(timeout-- && cs->hw.elsa.transcnt)
484 udelay(1000); 484 udelay(1000);
485 debugl1(cs, "msi tout=%d", timeout); 485 debugl1(cs, "msi tout=%d", timeout);
486 udelay(RCV_DELAY); 486 mdelay(RCV_DELAY);
487 modem_write_cmd(cs, MInit_2, strlen(MInit_2)); 487 modem_write_cmd(cs, MInit_2, strlen(MInit_2));
488 timeout = 1000; 488 timeout = 1000;
489 while(timeout-- && cs->hw.elsa.transcnt) 489 while(timeout-- && cs->hw.elsa.transcnt)
490 udelay(1000); 490 udelay(1000);
491 debugl1(cs, "msi tout=%d", timeout); 491 debugl1(cs, "msi tout=%d", timeout);
492 udelay(RCV_DELAY); 492 mdelay(RCV_DELAY);
493 modem_write_cmd(cs, MInit_3, strlen(MInit_3)); 493 modem_write_cmd(cs, MInit_3, strlen(MInit_3));
494 timeout = 1000; 494 timeout = 1000;
495 while(timeout-- && cs->hw.elsa.transcnt) 495 while(timeout-- && cs->hw.elsa.transcnt)
496 udelay(1000); 496 udelay(1000);
497 debugl1(cs, "msi tout=%d", timeout); 497 debugl1(cs, "msi tout=%d", timeout);
498 udelay(RCV_DELAY); 498 mdelay(RCV_DELAY);
499 modem_write_cmd(cs, MInit_4, strlen(MInit_4)); 499 modem_write_cmd(cs, MInit_4, strlen(MInit_4));
500 timeout = 1000; 500 timeout = 1000;
501 while(timeout-- && cs->hw.elsa.transcnt) 501 while(timeout-- && cs->hw.elsa.transcnt)
502 udelay(1000); 502 udelay(1000);
503 debugl1(cs, "msi tout=%d", timeout); 503 debugl1(cs, "msi tout=%d", timeout);
504 udelay(RCV_DELAY ); 504 mdelay(RCV_DELAY);
505 modem_write_cmd(cs, MInit_5, strlen(MInit_5)); 505 modem_write_cmd(cs, MInit_5, strlen(MInit_5));
506 timeout = 1000; 506 timeout = 1000;
507 while(timeout-- && cs->hw.elsa.transcnt) 507 while(timeout-- && cs->hw.elsa.transcnt)
508 udelay(1000); 508 udelay(1000);
509 debugl1(cs, "msi tout=%d", timeout); 509 debugl1(cs, "msi tout=%d", timeout);
510 udelay(RCV_DELAY); 510 mdelay(RCV_DELAY);
511 modem_write_cmd(cs, MInit_6, strlen(MInit_6)); 511 modem_write_cmd(cs, MInit_6, strlen(MInit_6));
512 timeout = 1000; 512 timeout = 1000;
513 while(timeout-- && cs->hw.elsa.transcnt) 513 while(timeout-- && cs->hw.elsa.transcnt)
514 udelay(1000); 514 udelay(1000);
515 debugl1(cs, "msi tout=%d", timeout); 515 debugl1(cs, "msi tout=%d", timeout);
516 udelay(RCV_DELAY); 516 mdelay(RCV_DELAY);
517 modem_write_cmd(cs, MInit_7, strlen(MInit_7)); 517 modem_write_cmd(cs, MInit_7, strlen(MInit_7));
518 timeout = 1000; 518 timeout = 1000;
519 while(timeout-- && cs->hw.elsa.transcnt) 519 while(timeout-- && cs->hw.elsa.transcnt)
520 udelay(1000); 520 udelay(1000);
521 debugl1(cs, "msi tout=%d", timeout); 521 debugl1(cs, "msi tout=%d", timeout);
522 udelay(RCV_DELAY); 522 mdelay(RCV_DELAY);
523} 523}
524 524
525static void 525static void
526modem_set_dial(struct IsdnCardState *cs, int outgoing) { 526modem_set_dial(struct IsdnCardState *cs, int outgoing) {
527 int timeout; 527 int timeout;
528#define RCV_DELAY 20000 528#define RCV_DELAY 20
529 529
530 modem_write_cmd(cs, MInit_speed28800, strlen(MInit_speed28800)); 530 modem_write_cmd(cs, MInit_speed28800, strlen(MInit_speed28800));
531 timeout = 1000; 531 timeout = 1000;
532 while(timeout-- && cs->hw.elsa.transcnt) 532 while(timeout-- && cs->hw.elsa.transcnt)
533 udelay(1000); 533 udelay(1000);
534 debugl1(cs, "msi tout=%d", timeout); 534 debugl1(cs, "msi tout=%d", timeout);
535 udelay(RCV_DELAY); 535 mdelay(RCV_DELAY);
536 if (outgoing) 536 if (outgoing)
537 modem_write_cmd(cs, MInit_dialout, strlen(MInit_dialout)); 537 modem_write_cmd(cs, MInit_dialout, strlen(MInit_dialout));
538 else 538 else
@@ -541,7 +541,7 @@ modem_set_dial(struct IsdnCardState *cs, int outgoing) {
541 while(timeout-- && cs->hw.elsa.transcnt) 541 while(timeout-- && cs->hw.elsa.transcnt)
542 udelay(1000); 542 udelay(1000);
543 debugl1(cs, "msi tout=%d", timeout); 543 debugl1(cs, "msi tout=%d", timeout);
544 udelay(RCV_DELAY); 544 mdelay(RCV_DELAY);
545} 545}
546 546
547static void 547static void
diff --git a/drivers/isdn/hisax/hfc_usb.c b/drivers/isdn/hisax/hfc_usb.c
index 9de54202c90c..a420b64472e3 100644
--- a/drivers/isdn/hisax/hfc_usb.c
+++ b/drivers/isdn/hisax/hfc_usb.c
@@ -817,8 +817,8 @@ collect_rx_frame(usb_fifo * fifo, __u8 * data, int len, int finish)
817 } 817 }
818 /* we have a complete hdlc packet */ 818 /* we have a complete hdlc packet */
819 if (finish) { 819 if (finish) {
820 if ((!fifo->skbuff->data[fifo->skbuff->len - 1]) 820 if (fifo->skbuff->len > 3 &&
821 && (fifo->skbuff->len > 3)) { 821 !fifo->skbuff->data[fifo->skbuff->len - 1]) {
822 822
823 if (fifon == HFCUSB_D_RX) { 823 if (fifon == HFCUSB_D_RX) {
824 DBG(HFCUSB_DBG_DCHANNEL, 824 DBG(HFCUSB_DBG_DCHANNEL,
diff --git a/drivers/isdn/hisax/hscx_irq.c b/drivers/isdn/hisax/hscx_irq.c
index 7b1ad5e4ecda..2387d76c721a 100644
--- a/drivers/isdn/hisax/hscx_irq.c
+++ b/drivers/isdn/hisax/hscx_irq.c
@@ -32,7 +32,7 @@ waitforXFW(struct IsdnCardState *cs, int hscx)
32{ 32{
33 int to = 50; 33 int to = 50;
34 34
35 while ((!(READHSCX(cs, hscx, HSCX_STAR) & 0x44) == 0x40) && to) { 35 while (((READHSCX(cs, hscx, HSCX_STAR) & 0x44) != 0x40) && to) {
36 udelay(1); 36 udelay(1);
37 to--; 37 to--;
38 } 38 }
diff --git a/drivers/isdn/hisax/icc.c b/drivers/isdn/hisax/icc.c
index 9aba646ba221..c80cbb8a2ef9 100644
--- a/drivers/isdn/hisax/icc.c
+++ b/drivers/isdn/hisax/icc.c
@@ -468,6 +468,7 @@ ICC_l1hw(struct PStack *st, int pr, void *arg)
468 if (cs->debug & L1_DEB_WARN) 468 if (cs->debug & L1_DEB_WARN)
469 debugl1(cs, " l2l1 tx_skb exist this shouldn't happen"); 469 debugl1(cs, " l2l1 tx_skb exist this shouldn't happen");
470 skb_queue_tail(&cs->sq, skb); 470 skb_queue_tail(&cs->sq, skb);
471 spin_unlock_irqrestore(&cs->lock, flags);
471 break; 472 break;
472 } 473 }
473 if (cs->debug & DEB_DLOG_HEX) 474 if (cs->debug & DEB_DLOG_HEX)
diff --git a/drivers/isdn/hisax/sedlbauer_cs.c b/drivers/isdn/hisax/sedlbauer_cs.c
index 9a3c9f5e4fe8..af5d393cc2d0 100644
--- a/drivers/isdn/hisax/sedlbauer_cs.c
+++ b/drivers/isdn/hisax/sedlbauer_cs.c
@@ -57,24 +57,6 @@ MODULE_DESCRIPTION("ISDN4Linux: PCMCIA client driver for Sedlbauer cards");
57MODULE_AUTHOR("Marcus Niemann"); 57MODULE_AUTHOR("Marcus Niemann");
58MODULE_LICENSE("Dual MPL/GPL"); 58MODULE_LICENSE("Dual MPL/GPL");
59 59
60/*
61 All the PCMCIA modules use PCMCIA_DEBUG to control debugging. If
62 you do not define PCMCIA_DEBUG at all, all the debug code will be
63 left out. If you compile with PCMCIA_DEBUG=0, the debug code will
64 be present but disabled -- but it can then be enabled for specific
65 modules at load time with a 'pc_debug=#' option to insmod.
66*/
67
68#ifdef PCMCIA_DEBUG
69static int pc_debug = PCMCIA_DEBUG;
70module_param(pc_debug, int, 0);
71#define DEBUG(n, args...) if (pc_debug>(n)) printk(KERN_DEBUG args);
72static char *version =
73"sedlbauer_cs.c 1.1a 2001/01/28 15:04:04 (M.Niemann)";
74#else
75#define DEBUG(n, args...)
76#endif
77
78 60
79/*====================================================================*/ 61/*====================================================================*/
80 62
@@ -151,7 +133,7 @@ static int sedlbauer_probe(struct pcmcia_device *link)
151{ 133{
152 local_info_t *local; 134 local_info_t *local;
153 135
154 DEBUG(0, "sedlbauer_attach()\n"); 136 dev_dbg(&link->dev, "sedlbauer_attach()\n");
155 137
156 /* Allocate space for private device-specific data */ 138 /* Allocate space for private device-specific data */
157 local = kzalloc(sizeof(local_info_t), GFP_KERNEL); 139 local = kzalloc(sizeof(local_info_t), GFP_KERNEL);
@@ -163,7 +145,6 @@ static int sedlbauer_probe(struct pcmcia_device *link)
163 145
164 /* Interrupt setup */ 146 /* Interrupt setup */
165 link->irq.Attributes = IRQ_TYPE_DYNAMIC_SHARING|IRQ_FIRST_SHARED; 147 link->irq.Attributes = IRQ_TYPE_DYNAMIC_SHARING|IRQ_FIRST_SHARED;
166 link->irq.IRQInfo1 = IRQ_LEVEL_ID;
167 link->irq.Handler = NULL; 148 link->irq.Handler = NULL;
168 149
169 /* 150 /*
@@ -198,7 +179,7 @@ static int sedlbauer_probe(struct pcmcia_device *link)
198 179
199static void sedlbauer_detach(struct pcmcia_device *link) 180static void sedlbauer_detach(struct pcmcia_device *link)
200{ 181{
201 DEBUG(0, "sedlbauer_detach(0x%p)\n", link); 182 dev_dbg(&link->dev, "sedlbauer_detach(0x%p)\n", link);
202 183
203 ((local_info_t *)link->priv)->stop = 1; 184 ((local_info_t *)link->priv)->stop = 1;
204 sedlbauer_release(link); 185 sedlbauer_release(link);
@@ -214,9 +195,6 @@ static void sedlbauer_detach(struct pcmcia_device *link)
214 device available to the system. 195 device available to the system.
215 196
216======================================================================*/ 197======================================================================*/
217#define CS_CHECK(fn, ret) \
218do { last_fn = (fn); if ((last_ret = (ret)) != 0) goto cs_failed; } while (0)
219
220static int sedlbauer_config_check(struct pcmcia_device *p_dev, 198static int sedlbauer_config_check(struct pcmcia_device *p_dev,
221 cistpl_cftable_entry_t *cfg, 199 cistpl_cftable_entry_t *cfg,
222 cistpl_cftable_entry_t *dflt, 200 cistpl_cftable_entry_t *dflt,
@@ -293,11 +271,11 @@ static int sedlbauer_config_check(struct pcmcia_device *p_dev,
293 req->Base = mem->win[0].host_addr; 271 req->Base = mem->win[0].host_addr;
294 req->Size = mem->win[0].len; 272 req->Size = mem->win[0].len;
295 req->AccessSpeed = 0; 273 req->AccessSpeed = 0;
296 if (pcmcia_request_window(&p_dev, req, &p_dev->win) != 0) 274 if (pcmcia_request_window(p_dev, req, &p_dev->win) != 0)
297 return -ENODEV; 275 return -ENODEV;
298 map.Page = 0; 276 map.Page = 0;
299 map.CardOffset = mem->win[0].card_addr; 277 map.CardOffset = mem->win[0].card_addr;
300 if (pcmcia_map_mem_page(p_dev->win, &map) != 0) 278 if (pcmcia_map_mem_page(p_dev, p_dev->win, &map) != 0)
301 return -ENODEV; 279 return -ENODEV;
302 } 280 }
303 return 0; 281 return 0;
@@ -309,10 +287,10 @@ static int sedlbauer_config(struct pcmcia_device *link)
309{ 287{
310 local_info_t *dev = link->priv; 288 local_info_t *dev = link->priv;
311 win_req_t *req; 289 win_req_t *req;
312 int last_fn, last_ret; 290 int ret;
313 IsdnCard_t icard; 291 IsdnCard_t icard;
314 292
315 DEBUG(0, "sedlbauer_config(0x%p)\n", link); 293 dev_dbg(&link->dev, "sedlbauer_config(0x%p)\n", link);
316 294
317 req = kzalloc(sizeof(win_req_t), GFP_KERNEL); 295 req = kzalloc(sizeof(win_req_t), GFP_KERNEL);
318 if (!req) 296 if (!req)
@@ -330,8 +308,8 @@ static int sedlbauer_config(struct pcmcia_device *link)
330 these things without consulting the CIS, and most client drivers 308 these things without consulting the CIS, and most client drivers
331 will only use the CIS to fill in implementation-defined details. 309 will only use the CIS to fill in implementation-defined details.
332 */ 310 */
333 last_ret = pcmcia_loop_config(link, sedlbauer_config_check, req); 311 ret = pcmcia_loop_config(link, sedlbauer_config_check, req);
334 if (last_ret) 312 if (ret)
335 goto failed; 313 goto failed;
336 314
337 /* 315 /*
@@ -339,15 +317,20 @@ static int sedlbauer_config(struct pcmcia_device *link)
339 handler to the interrupt, unless the 'Handler' member of the 317 handler to the interrupt, unless the 'Handler' member of the
340 irq structure is initialized. 318 irq structure is initialized.
341 */ 319 */
342 if (link->conf.Attributes & CONF_ENABLE_IRQ) 320 if (link->conf.Attributes & CONF_ENABLE_IRQ) {
343 CS_CHECK(RequestIRQ, pcmcia_request_irq(link, &link->irq)); 321 ret = pcmcia_request_irq(link, &link->irq);
322 if (ret)
323 goto failed;
324 }
344 325
345 /* 326 /*
346 This actually configures the PCMCIA socket -- setting up 327 This actually configures the PCMCIA socket -- setting up
347 the I/O windows and the interrupt mapping, and putting the 328 the I/O windows and the interrupt mapping, and putting the
348 card and host interface into "Memory and IO" mode. 329 card and host interface into "Memory and IO" mode.
349 */ 330 */
350 CS_CHECK(RequestConfiguration, pcmcia_request_configuration(link, &link->conf)); 331 ret = pcmcia_request_configuration(link, &link->conf);
332 if (ret)
333 goto failed;
351 334
352 /* 335 /*
353 At this point, the dev_node_t structure(s) need to be 336 At this point, the dev_node_t structure(s) need to be
@@ -380,19 +363,18 @@ static int sedlbauer_config(struct pcmcia_device *link)
380 icard.protocol = protocol; 363 icard.protocol = protocol;
381 icard.typ = ISDN_CTYPE_SEDLBAUER_PCMCIA; 364 icard.typ = ISDN_CTYPE_SEDLBAUER_PCMCIA;
382 365
383 last_ret = hisax_init_pcmcia(link, &(((local_info_t*)link->priv)->stop), &icard); 366 ret = hisax_init_pcmcia(link,
384 if (last_ret < 0) { 367 &(((local_info_t *)link->priv)->stop), &icard);
385 printk(KERN_ERR "sedlbauer_cs: failed to initialize SEDLBAUER PCMCIA %d at i/o %#x\n", 368 if (ret < 0) {
386 last_ret, link->io.BasePort1); 369 printk(KERN_ERR "sedlbauer_cs: failed to initialize SEDLBAUER PCMCIA %d at i/o %#x\n",
370 ret, link->io.BasePort1);
387 sedlbauer_release(link); 371 sedlbauer_release(link);
388 return -ENODEV; 372 return -ENODEV;
389 } else 373 } else
390 ((local_info_t*)link->priv)->cardnr = last_ret; 374 ((local_info_t *)link->priv)->cardnr = ret;
391 375
392 return 0; 376 return 0;
393 377
394cs_failed:
395 cs_error(link, last_fn, last_ret);
396failed: 378failed:
397 sedlbauer_release(link); 379 sedlbauer_release(link);
398 return -ENODEV; 380 return -ENODEV;
@@ -410,7 +392,7 @@ failed:
410static void sedlbauer_release(struct pcmcia_device *link) 392static void sedlbauer_release(struct pcmcia_device *link)
411{ 393{
412 local_info_t *local = link->priv; 394 local_info_t *local = link->priv;
413 DEBUG(0, "sedlbauer_release(0x%p)\n", link); 395 dev_dbg(&link->dev, "sedlbauer_release(0x%p)\n", link);
414 396
415 if (local) { 397 if (local) {
416 if (local->cardnr >= 0) { 398 if (local->cardnr >= 0) {
diff --git a/drivers/isdn/hisax/teles_cs.c b/drivers/isdn/hisax/teles_cs.c
index 623d111544d4..ea705394ce2b 100644
--- a/drivers/isdn/hisax/teles_cs.c
+++ b/drivers/isdn/hisax/teles_cs.c
@@ -38,23 +38,6 @@ MODULE_DESCRIPTION("ISDN4Linux: PCMCIA client driver for Teles PCMCIA cards");
38MODULE_AUTHOR("Christof Petig, christof.petig@wtal.de, Karsten Keil, kkeil@suse.de"); 38MODULE_AUTHOR("Christof Petig, christof.petig@wtal.de, Karsten Keil, kkeil@suse.de");
39MODULE_LICENSE("GPL"); 39MODULE_LICENSE("GPL");
40 40
41/*
42 All the PCMCIA modules use PCMCIA_DEBUG to control debugging. If
43 you do not define PCMCIA_DEBUG at all, all the debug code will be
44 left out. If you compile with PCMCIA_DEBUG=0, the debug code will
45 be present but disabled -- but it can then be enabled for specific
46 modules at load time with a 'pc_debug=#' option to insmod.
47*/
48
49#ifdef PCMCIA_DEBUG
50static int pc_debug = PCMCIA_DEBUG;
51module_param(pc_debug, int, 0);
52#define DEBUG(n, args...) if (pc_debug>(n)) printk(KERN_DEBUG args);
53static char *version =
54"teles_cs.c 2.10 2002/07/30 22:23:34 kkeil";
55#else
56#define DEBUG(n, args...)
57#endif
58 41
59/*====================================================================*/ 42/*====================================================================*/
60 43
@@ -133,7 +116,7 @@ static int teles_probe(struct pcmcia_device *link)
133{ 116{
134 local_info_t *local; 117 local_info_t *local;
135 118
136 DEBUG(0, "teles_attach()\n"); 119 dev_dbg(&link->dev, "teles_attach()\n");
137 120
138 /* Allocate space for private device-specific data */ 121 /* Allocate space for private device-specific data */
139 local = kzalloc(sizeof(local_info_t), GFP_KERNEL); 122 local = kzalloc(sizeof(local_info_t), GFP_KERNEL);
@@ -145,7 +128,6 @@ static int teles_probe(struct pcmcia_device *link)
145 128
146 /* Interrupt setup */ 129 /* Interrupt setup */
147 link->irq.Attributes = IRQ_TYPE_DYNAMIC_SHARING|IRQ_FIRST_SHARED; 130 link->irq.Attributes = IRQ_TYPE_DYNAMIC_SHARING|IRQ_FIRST_SHARED;
148 link->irq.IRQInfo1 = IRQ_LEVEL_ID|IRQ_SHARE_ID;
149 link->irq.Handler = NULL; 131 link->irq.Handler = NULL;
150 132
151 /* 133 /*
@@ -178,7 +160,7 @@ static void teles_detach(struct pcmcia_device *link)
178{ 160{
179 local_info_t *info = link->priv; 161 local_info_t *info = link->priv;
180 162
181 DEBUG(0, "teles_detach(0x%p)\n", link); 163 dev_dbg(&link->dev, "teles_detach(0x%p)\n", link);
182 164
183 info->busy = 1; 165 info->busy = 1;
184 teles_cs_release(link); 166 teles_cs_release(link);
@@ -221,30 +203,25 @@ static int teles_cs_configcheck(struct pcmcia_device *p_dev,
221static int teles_cs_config(struct pcmcia_device *link) 203static int teles_cs_config(struct pcmcia_device *link)
222{ 204{
223 local_info_t *dev; 205 local_info_t *dev;
224 int i, last_fn; 206 int i;
225 IsdnCard_t icard; 207 IsdnCard_t icard;
226 208
227 DEBUG(0, "teles_config(0x%p)\n", link); 209 dev_dbg(&link->dev, "teles_config(0x%p)\n", link);
228 dev = link->priv; 210 dev = link->priv;
229 211
230 i = pcmcia_loop_config(link, teles_cs_configcheck, NULL); 212 i = pcmcia_loop_config(link, teles_cs_configcheck, NULL);
231 if (i != 0) { 213 if (i != 0)
232 last_fn = RequestIO;
233 goto cs_failed; 214 goto cs_failed;
234 }
235 215
236 i = pcmcia_request_irq(link, &link->irq); 216 i = pcmcia_request_irq(link, &link->irq);
237 if (i != 0) { 217 if (i != 0) {
238 link->irq.AssignedIRQ = 0; 218 link->irq.AssignedIRQ = 0;
239 last_fn = RequestIRQ;
240 goto cs_failed; 219 goto cs_failed;
241 } 220 }
242 221
243 i = pcmcia_request_configuration(link, &link->conf); 222 i = pcmcia_request_configuration(link, &link->conf);
244 if (i != 0) { 223 if (i != 0)
245 last_fn = RequestConfiguration;
246 goto cs_failed; 224 goto cs_failed;
247 }
248 225
249 /* At this point, the dev_node_t structure(s) should be 226 /* At this point, the dev_node_t structure(s) should be
250 initialized and arranged in a linked list at link->dev. *//* */ 227 initialized and arranged in a linked list at link->dev. *//* */
@@ -283,7 +260,6 @@ static int teles_cs_config(struct pcmcia_device *link)
283 return 0; 260 return 0;
284 261
285cs_failed: 262cs_failed:
286 cs_error(link, last_fn, i);
287 teles_cs_release(link); 263 teles_cs_release(link);
288 return -ENODEV; 264 return -ENODEV;
289} /* teles_cs_config */ 265} /* teles_cs_config */
@@ -300,7 +276,7 @@ static void teles_cs_release(struct pcmcia_device *link)
300{ 276{
301 local_info_t *local = link->priv; 277 local_info_t *local = link->priv;
302 278
303 DEBUG(0, "teles_cs_release(0x%p)\n", link); 279 dev_dbg(&link->dev, "teles_cs_release(0x%p)\n", link);
304 280
305 if (local) { 281 if (local) {
306 if (local->cardnr >= 0) { 282 if (local->cardnr >= 0) {
diff --git a/drivers/isdn/i4l/isdn_ppp.c b/drivers/isdn/i4l/isdn_ppp.c
index 2d14b64202a3..642d5aaf53ce 100644
--- a/drivers/isdn/i4l/isdn_ppp.c
+++ b/drivers/isdn/i4l/isdn_ppp.c
@@ -1535,10 +1535,8 @@ static int isdn_ppp_mp_bundle_array_init(void)
1535 int sz = ISDN_MAX_CHANNELS*sizeof(ippp_bundle); 1535 int sz = ISDN_MAX_CHANNELS*sizeof(ippp_bundle);
1536 if( (isdn_ppp_bundle_arr = kzalloc(sz, GFP_KERNEL)) == NULL ) 1536 if( (isdn_ppp_bundle_arr = kzalloc(sz, GFP_KERNEL)) == NULL )
1537 return -ENOMEM; 1537 return -ENOMEM;
1538 for (i = 0; i < ISDN_MAX_CHANNELS; i++) { 1538 for( i = 0; i < ISDN_MAX_CHANNELS; i++ )
1539 spin_lock_init(&isdn_ppp_bundle_arr[i].lock); 1539 spin_lock_init(&isdn_ppp_bundle_arr[i].lock);
1540 skb_queue_head_init(&isdn_ppp_bundle_arr[i].frags);
1541 }
1542 return 0; 1540 return 0;
1543} 1541}
1544 1542
@@ -1571,7 +1569,7 @@ static int isdn_ppp_mp_init( isdn_net_local * lp, ippp_bundle * add_to )
1571 if ((lp->netdev->pb = isdn_ppp_mp_bundle_alloc()) == NULL) 1569 if ((lp->netdev->pb = isdn_ppp_mp_bundle_alloc()) == NULL)
1572 return -ENOMEM; 1570 return -ENOMEM;
1573 lp->next = lp->last = lp; /* nobody else in a queue */ 1571 lp->next = lp->last = lp; /* nobody else in a queue */
1574 skb_queue_head_init(&lp->netdev->pb->frags); 1572 lp->netdev->pb->frags = NULL;
1575 lp->netdev->pb->frames = 0; 1573 lp->netdev->pb->frames = 0;
1576 lp->netdev->pb->seq = UINT_MAX; 1574 lp->netdev->pb->seq = UINT_MAX;
1577 } 1575 }
@@ -1583,29 +1581,28 @@ static int isdn_ppp_mp_init( isdn_net_local * lp, ippp_bundle * add_to )
1583 1581
1584static u32 isdn_ppp_mp_get_seq( int short_seq, 1582static u32 isdn_ppp_mp_get_seq( int short_seq,
1585 struct sk_buff * skb, u32 last_seq ); 1583 struct sk_buff * skb, u32 last_seq );
1586static void isdn_ppp_mp_discard(ippp_bundle *mp, struct sk_buff *from, 1584static struct sk_buff * isdn_ppp_mp_discard( ippp_bundle * mp,
1587 struct sk_buff *to); 1585 struct sk_buff * from, struct sk_buff * to );
1588static void isdn_ppp_mp_reassembly(isdn_net_dev *net_dev, isdn_net_local *lp, 1586static void isdn_ppp_mp_reassembly( isdn_net_dev * net_dev, isdn_net_local * lp,
1589 struct sk_buff *from, struct sk_buff *to, 1587 struct sk_buff * from, struct sk_buff * to );
1590 u32 lastseq); 1588static void isdn_ppp_mp_free_skb( ippp_bundle * mp, struct sk_buff * skb );
1591static void isdn_ppp_mp_free_skb(ippp_bundle *mp, struct sk_buff *skb);
1592static void isdn_ppp_mp_print_recv_pkt( int slot, struct sk_buff * skb ); 1589static void isdn_ppp_mp_print_recv_pkt( int slot, struct sk_buff * skb );
1593 1590
1594static void isdn_ppp_mp_receive(isdn_net_dev * net_dev, isdn_net_local * lp, 1591static void isdn_ppp_mp_receive(isdn_net_dev * net_dev, isdn_net_local * lp,
1595 struct sk_buff *skb) 1592 struct sk_buff *skb)
1596{ 1593{
1597 struct sk_buff *newfrag, *frag, *start, *nextf;
1598 u32 newseq, minseq, thisseq;
1599 isdn_mppp_stats *stats;
1600 struct ippp_struct *is; 1594 struct ippp_struct *is;
1595 isdn_net_local * lpq;
1596 ippp_bundle * mp;
1597 isdn_mppp_stats * stats;
1598 struct sk_buff * newfrag, * frag, * start, *nextf;
1599 u32 newseq, minseq, thisseq;
1601 unsigned long flags; 1600 unsigned long flags;
1602 isdn_net_local *lpq;
1603 ippp_bundle *mp;
1604 int slot; 1601 int slot;
1605 1602
1606 spin_lock_irqsave(&net_dev->pb->lock, flags); 1603 spin_lock_irqsave(&net_dev->pb->lock, flags);
1607 mp = net_dev->pb; 1604 mp = net_dev->pb;
1608 stats = &mp->stats; 1605 stats = &mp->stats;
1609 slot = lp->ppp_slot; 1606 slot = lp->ppp_slot;
1610 if (slot < 0 || slot >= ISDN_MAX_CHANNELS) { 1607 if (slot < 0 || slot >= ISDN_MAX_CHANNELS) {
1611 printk(KERN_ERR "%s: lp->ppp_slot(%d)\n", 1608 printk(KERN_ERR "%s: lp->ppp_slot(%d)\n",
@@ -1616,19 +1613,20 @@ static void isdn_ppp_mp_receive(isdn_net_dev * net_dev, isdn_net_local * lp,
1616 return; 1613 return;
1617 } 1614 }
1618 is = ippp_table[slot]; 1615 is = ippp_table[slot];
1619 if (++mp->frames > stats->max_queue_len) 1616 if( ++mp->frames > stats->max_queue_len )
1620 stats->max_queue_len = mp->frames; 1617 stats->max_queue_len = mp->frames;
1621 1618
1622 if (is->debug & 0x8) 1619 if (is->debug & 0x8)
1623 isdn_ppp_mp_print_recv_pkt(lp->ppp_slot, skb); 1620 isdn_ppp_mp_print_recv_pkt(lp->ppp_slot, skb);
1624 1621
1625 newseq = isdn_ppp_mp_get_seq(is->mpppcfg & SC_IN_SHORT_SEQ, 1622 newseq = isdn_ppp_mp_get_seq(is->mpppcfg & SC_IN_SHORT_SEQ,
1626 skb, is->last_link_seqno); 1623 skb, is->last_link_seqno);
1624
1627 1625
1628 /* if this packet seq # is less than last already processed one, 1626 /* if this packet seq # is less than last already processed one,
1629 * toss it right away, but check for sequence start case first 1627 * toss it right away, but check for sequence start case first
1630 */ 1628 */
1631 if (mp->seq > MP_LONGSEQ_MAX && (newseq & MP_LONGSEQ_MAXBIT)) { 1629 if( mp->seq > MP_LONGSEQ_MAX && (newseq & MP_LONGSEQ_MAXBIT) ) {
1632 mp->seq = newseq; /* the first packet: required for 1630 mp->seq = newseq; /* the first packet: required for
1633 * rfc1990 non-compliant clients -- 1631 * rfc1990 non-compliant clients --
1634 * prevents constant packet toss */ 1632 * prevents constant packet toss */
@@ -1638,7 +1636,7 @@ static void isdn_ppp_mp_receive(isdn_net_dev * net_dev, isdn_net_local * lp,
1638 spin_unlock_irqrestore(&mp->lock, flags); 1636 spin_unlock_irqrestore(&mp->lock, flags);
1639 return; 1637 return;
1640 } 1638 }
1641 1639
1642 /* find the minimum received sequence number over all links */ 1640 /* find the minimum received sequence number over all links */
1643 is->last_link_seqno = minseq = newseq; 1641 is->last_link_seqno = minseq = newseq;
1644 for (lpq = net_dev->queue;;) { 1642 for (lpq = net_dev->queue;;) {
@@ -1659,31 +1657,22 @@ static void isdn_ppp_mp_receive(isdn_net_dev * net_dev, isdn_net_local * lp,
1659 * packets */ 1657 * packets */
1660 newfrag = skb; 1658 newfrag = skb;
1661 1659
1662 /* Insert new fragment into the proper sequence slot. */ 1660 /* if this new fragment is before the first one, then enqueue it now. */
1663 skb_queue_walk(&mp->frags, frag) { 1661 if ((frag = mp->frags) == NULL || MP_LT(newseq, MP_SEQ(frag))) {
1664 if (MP_SEQ(frag) == newseq) { 1662 newfrag->next = frag;
1665 isdn_ppp_mp_free_skb(mp, newfrag); 1663 mp->frags = frag = newfrag;
1666 newfrag = NULL; 1664 newfrag = NULL;
1667 break; 1665 }
1668 }
1669 if (MP_LT(newseq, MP_SEQ(frag))) {
1670 __skb_queue_before(&mp->frags, frag, newfrag);
1671 newfrag = NULL;
1672 break;
1673 }
1674 }
1675 if (newfrag)
1676 __skb_queue_tail(&mp->frags, newfrag);
1677 1666
1678 frag = skb_peek(&mp->frags); 1667 start = MP_FLAGS(frag) & MP_BEGIN_FRAG &&
1679 start = ((MP_FLAGS(frag) & MP_BEGIN_FRAG) && 1668 MP_SEQ(frag) == mp->seq ? frag : NULL;
1680 (MP_SEQ(frag) == mp->seq)) ? frag : NULL;
1681 if (!start)
1682 goto check_overflow;
1683 1669
1684 /* main fragment traversing loop 1670 /*
1671 * main fragment traversing loop
1685 * 1672 *
1686 * try to accomplish several tasks: 1673 * try to accomplish several tasks:
1674 * - insert new fragment into the proper sequence slot (once that's done
1675 * newfrag will be set to NULL)
1687 * - reassemble any complete fragment sequence (non-null 'start' 1676 * - reassemble any complete fragment sequence (non-null 'start'
1688 * indicates there is a continguous sequence present) 1677 * indicates there is a continguous sequence present)
1689 * - discard any incomplete sequences that are below minseq -- due 1678 * - discard any incomplete sequences that are below minseq -- due
@@ -1692,46 +1681,71 @@ static void isdn_ppp_mp_receive(isdn_net_dev * net_dev, isdn_net_local * lp,
1692 * come to complete such sequence and it should be discarded 1681 * come to complete such sequence and it should be discarded
1693 * 1682 *
1694 * loop completes when we accomplished the following tasks: 1683 * loop completes when we accomplished the following tasks:
1684 * - new fragment is inserted in the proper sequence ('newfrag' is
1685 * set to NULL)
1695 * - we hit a gap in the sequence, so no reassembly/processing is 1686 * - we hit a gap in the sequence, so no reassembly/processing is
1696 * possible ('start' would be set to NULL) 1687 * possible ('start' would be set to NULL)
1697 * 1688 *
1698 * algorithm for this code is derived from code in the book 1689 * algorithm for this code is derived from code in the book
1699 * 'PPP Design And Debugging' by James Carlson (Addison-Wesley) 1690 * 'PPP Design And Debugging' by James Carlson (Addison-Wesley)
1700 */ 1691 */
1701 skb_queue_walk_safe(&mp->frags, frag, nextf) { 1692 while (start != NULL || newfrag != NULL) {
1702 thisseq = MP_SEQ(frag); 1693
1703 1694 thisseq = MP_SEQ(frag);
1704 /* check for misplaced start */ 1695 nextf = frag->next;
1705 if (start != frag && (MP_FLAGS(frag) & MP_BEGIN_FRAG)) { 1696
1706 printk(KERN_WARNING"isdn_mppp(seq %d): new " 1697 /* drop any duplicate fragments */
1707 "BEGIN flag with no prior END", thisseq); 1698 if (newfrag != NULL && thisseq == newseq) {
1708 stats->seqerrs++; 1699 isdn_ppp_mp_free_skb(mp, newfrag);
1709 stats->frame_drops++; 1700 newfrag = NULL;
1710 isdn_ppp_mp_discard(mp, start, frag); 1701 }
1711 start = frag; 1702
1712 } else if (MP_LE(thisseq, minseq)) { 1703 /* insert new fragment before next element if possible. */
1713 if (MP_FLAGS(frag) & MP_BEGIN_FRAG) 1704 if (newfrag != NULL && (nextf == NULL ||
1705 MP_LT(newseq, MP_SEQ(nextf)))) {
1706 newfrag->next = nextf;
1707 frag->next = nextf = newfrag;
1708 newfrag = NULL;
1709 }
1710
1711 if (start != NULL) {
1712 /* check for misplaced start */
1713 if (start != frag && (MP_FLAGS(frag) & MP_BEGIN_FRAG)) {
1714 printk(KERN_WARNING"isdn_mppp(seq %d): new "
1715 "BEGIN flag with no prior END", thisseq);
1716 stats->seqerrs++;
1717 stats->frame_drops++;
1718 start = isdn_ppp_mp_discard(mp, start,frag);
1719 nextf = frag->next;
1720 }
1721 } else if (MP_LE(thisseq, minseq)) {
1722 if (MP_FLAGS(frag) & MP_BEGIN_FRAG)
1714 start = frag; 1723 start = frag;
1715 else { 1724 else {
1716 if (MP_FLAGS(frag) & MP_END_FRAG) 1725 if (MP_FLAGS(frag) & MP_END_FRAG)
1717 stats->frame_drops++; 1726 stats->frame_drops++;
1718 __skb_unlink(skb, &mp->frags); 1727 if( mp->frags == frag )
1728 mp->frags = nextf;
1719 isdn_ppp_mp_free_skb(mp, frag); 1729 isdn_ppp_mp_free_skb(mp, frag);
1730 frag = nextf;
1720 continue; 1731 continue;
1721 } 1732 }
1722 } 1733 }
1723 1734
1724 /* if we have end fragment, then we have full reassembly 1735 /* if start is non-null and we have end fragment, then
1725 * sequence -- reassemble and process packet now 1736 * we have full reassembly sequence -- reassemble
1737 * and process packet now
1726 */ 1738 */
1727 if (MP_FLAGS(frag) & MP_END_FRAG) { 1739 if (start != NULL && (MP_FLAGS(frag) & MP_END_FRAG)) {
1728 minseq = mp->seq = (thisseq+1) & MP_LONGSEQ_MASK; 1740 minseq = mp->seq = (thisseq+1) & MP_LONGSEQ_MASK;
1729 /* Reassemble the packet then dispatch it */ 1741 /* Reassemble the packet then dispatch it */
1730 isdn_ppp_mp_reassembly(net_dev, lp, start, frag, thisseq); 1742 isdn_ppp_mp_reassembly(net_dev, lp, start, nextf);
1743
1744 start = NULL;
1745 frag = NULL;
1731 1746
1732 start = NULL; 1747 mp->frags = nextf;
1733 frag = NULL; 1748 }
1734 }
1735 1749
1736 /* check if need to update start pointer: if we just 1750 /* check if need to update start pointer: if we just
1737 * reassembled the packet and sequence is contiguous 1751 * reassembled the packet and sequence is contiguous
@@ -1742,25 +1756,26 @@ static void isdn_ppp_mp_receive(isdn_net_dev * net_dev, isdn_net_local * lp,
1742 * below low watermark and set start to the next frag or 1756 * below low watermark and set start to the next frag or
1743 * clear start ptr. 1757 * clear start ptr.
1744 */ 1758 */
1745 if (nextf != (struct sk_buff *)&mp->frags && 1759 if (nextf != NULL &&
1746 ((thisseq+1) & MP_LONGSEQ_MASK) == MP_SEQ(nextf)) { 1760 ((thisseq+1) & MP_LONGSEQ_MASK) == MP_SEQ(nextf)) {
1747 /* if we just reassembled and the next one is here, 1761 /* if we just reassembled and the next one is here,
1748 * then start another reassembly. 1762 * then start another reassembly. */
1749 */ 1763
1750 if (frag == NULL) { 1764 if (frag == NULL) {
1751 if (MP_FLAGS(nextf) & MP_BEGIN_FRAG) 1765 if (MP_FLAGS(nextf) & MP_BEGIN_FRAG)
1752 start = nextf; 1766 start = nextf;
1753 else { 1767 else
1754 printk(KERN_WARNING"isdn_mppp(seq %d):" 1768 {
1755 " END flag with no following " 1769 printk(KERN_WARNING"isdn_mppp(seq %d):"
1756 "BEGIN", thisseq); 1770 " END flag with no following "
1771 "BEGIN", thisseq);
1757 stats->seqerrs++; 1772 stats->seqerrs++;
1758 } 1773 }
1759 } 1774 }
1760 } else { 1775
1761 if (nextf != (struct sk_buff *)&mp->frags && 1776 } else {
1762 frag != NULL && 1777 if ( nextf != NULL && frag != NULL &&
1763 MP_LT(thisseq, minseq)) { 1778 MP_LT(thisseq, minseq)) {
1764 /* we've got a break in the sequence 1779 /* we've got a break in the sequence
1765 * and we not at the end yet 1780 * and we not at the end yet
1766 * and we did not just reassembled 1781 * and we did not just reassembled
@@ -1769,39 +1784,41 @@ static void isdn_ppp_mp_receive(isdn_net_dev * net_dev, isdn_net_local * lp,
1769 * discard all the frames below low watermark 1784 * discard all the frames below low watermark
1770 * and start over */ 1785 * and start over */
1771 stats->frame_drops++; 1786 stats->frame_drops++;
1772 isdn_ppp_mp_discard(mp, start, nextf); 1787 mp->frags = isdn_ppp_mp_discard(mp,start,nextf);
1773 } 1788 }
1774 /* break in the sequence, no reassembly */ 1789 /* break in the sequence, no reassembly */
1775 start = NULL; 1790 start = NULL;
1776 } 1791 }
1777 if (!start) 1792
1778 break; 1793 frag = nextf;
1779 } 1794 } /* while -- main loop */
1780 1795
1781check_overflow: 1796 if (mp->frags == NULL)
1797 mp->frags = frag;
1798
1782 /* rather straighforward way to deal with (not very) possible 1799 /* rather straighforward way to deal with (not very) possible
1783 * queue overflow 1800 * queue overflow */
1784 */
1785 if (mp->frames > MP_MAX_QUEUE_LEN) { 1801 if (mp->frames > MP_MAX_QUEUE_LEN) {
1786 stats->overflows++; 1802 stats->overflows++;
1787 skb_queue_walk_safe(&mp->frags, frag, nextf) { 1803 while (mp->frames > MP_MAX_QUEUE_LEN) {
1788 if (mp->frames <= MP_MAX_QUEUE_LEN) 1804 frag = mp->frags->next;
1789 break; 1805 isdn_ppp_mp_free_skb(mp, mp->frags);
1790 __skb_unlink(frag, &mp->frags); 1806 mp->frags = frag;
1791 isdn_ppp_mp_free_skb(mp, frag);
1792 } 1807 }
1793 } 1808 }
1794 spin_unlock_irqrestore(&mp->lock, flags); 1809 spin_unlock_irqrestore(&mp->lock, flags);
1795} 1810}
1796 1811
1797static void isdn_ppp_mp_cleanup(isdn_net_local *lp) 1812static void isdn_ppp_mp_cleanup( isdn_net_local * lp )
1798{ 1813{
1799 struct sk_buff *skb, *tmp; 1814 struct sk_buff * frag = lp->netdev->pb->frags;
1800 1815 struct sk_buff * nextfrag;
1801 skb_queue_walk_safe(&lp->netdev->pb->frags, skb, tmp) { 1816 while( frag ) {
1802 __skb_unlink(skb, &lp->netdev->pb->frags); 1817 nextfrag = frag->next;
1803 isdn_ppp_mp_free_skb(lp->netdev->pb, skb); 1818 isdn_ppp_mp_free_skb(lp->netdev->pb, frag);
1804 } 1819 frag = nextfrag;
1820 }
1821 lp->netdev->pb->frags = NULL;
1805} 1822}
1806 1823
1807static u32 isdn_ppp_mp_get_seq( int short_seq, 1824static u32 isdn_ppp_mp_get_seq( int short_seq,
@@ -1838,115 +1855,72 @@ static u32 isdn_ppp_mp_get_seq( int short_seq,
1838 return seq; 1855 return seq;
1839} 1856}
1840 1857
1841static void isdn_ppp_mp_discard(ippp_bundle *mp, struct sk_buff *from, 1858struct sk_buff * isdn_ppp_mp_discard( ippp_bundle * mp,
1842 struct sk_buff *to) 1859 struct sk_buff * from, struct sk_buff * to )
1843{ 1860{
1844 if (from) { 1861 if( from )
1845 struct sk_buff *skb, *tmp; 1862 while (from != to) {
1846 int freeing = 0; 1863 struct sk_buff * next = from->next;
1847 1864 isdn_ppp_mp_free_skb(mp, from);
1848 skb_queue_walk_safe(&mp->frags, skb, tmp) { 1865 from = next;
1849 if (skb == to)
1850 break;
1851 if (skb == from)
1852 freeing = 1;
1853 if (!freeing)
1854 continue;
1855 __skb_unlink(skb, &mp->frags);
1856 isdn_ppp_mp_free_skb(mp, skb);
1857 } 1866 }
1858 } 1867 return from;
1859}
1860
1861static unsigned int calc_tot_len(struct sk_buff_head *queue,
1862 struct sk_buff *from, struct sk_buff *to)
1863{
1864 unsigned int tot_len = 0;
1865 struct sk_buff *skb;
1866 int found_start = 0;
1867
1868 skb_queue_walk(queue, skb) {
1869 if (skb == from)
1870 found_start = 1;
1871 if (!found_start)
1872 continue;
1873 tot_len += skb->len - MP_HEADER_LEN;
1874 if (skb == to)
1875 break;
1876 }
1877 return tot_len;
1878} 1868}
1879 1869
1880/* Reassemble packet using fragments in the reassembly queue from 1870void isdn_ppp_mp_reassembly( isdn_net_dev * net_dev, isdn_net_local * lp,
1881 * 'from' until 'to', inclusive. 1871 struct sk_buff * from, struct sk_buff * to )
1882 */
1883static void isdn_ppp_mp_reassembly(isdn_net_dev *net_dev, isdn_net_local *lp,
1884 struct sk_buff *from, struct sk_buff *to,
1885 u32 lastseq)
1886{ 1872{
1887 ippp_bundle *mp = net_dev->pb; 1873 ippp_bundle * mp = net_dev->pb;
1888 unsigned int tot_len;
1889 struct sk_buff *skb;
1890 int proto; 1874 int proto;
1875 struct sk_buff * skb;
1876 unsigned int tot_len;
1891 1877
1892 if (lp->ppp_slot < 0 || lp->ppp_slot >= ISDN_MAX_CHANNELS) { 1878 if (lp->ppp_slot < 0 || lp->ppp_slot >= ISDN_MAX_CHANNELS) {
1893 printk(KERN_ERR "%s: lp->ppp_slot(%d) out of range\n", 1879 printk(KERN_ERR "%s: lp->ppp_slot(%d) out of range\n",
1894 __func__, lp->ppp_slot); 1880 __func__, lp->ppp_slot);
1895 return; 1881 return;
1896 } 1882 }
1897 1883 if( MP_FLAGS(from) == (MP_BEGIN_FRAG | MP_END_FRAG) ) {
1898 tot_len = calc_tot_len(&mp->frags, from, to); 1884 if( ippp_table[lp->ppp_slot]->debug & 0x40 )
1899
1900 if (MP_FLAGS(from) == (MP_BEGIN_FRAG | MP_END_FRAG)) {
1901 if (ippp_table[lp->ppp_slot]->debug & 0x40)
1902 printk(KERN_DEBUG "isdn_mppp: reassembly: frame %d, " 1885 printk(KERN_DEBUG "isdn_mppp: reassembly: frame %d, "
1903 "len %d\n", MP_SEQ(from), from->len); 1886 "len %d\n", MP_SEQ(from), from->len );
1904 skb = from; 1887 skb = from;
1905 skb_pull(skb, MP_HEADER_LEN); 1888 skb_pull(skb, MP_HEADER_LEN);
1906 __skb_unlink(skb, &mp->frags);
1907 mp->frames--; 1889 mp->frames--;
1908 } else { 1890 } else {
1909 struct sk_buff *walk, *tmp; 1891 struct sk_buff * frag;
1910 int found_start = 0; 1892 int n;
1911 1893
1912 if (ippp_table[lp->ppp_slot]->debug & 0x40) 1894 for(tot_len=n=0, frag=from; frag != to; frag=frag->next, n++)
1913 printk(KERN_DEBUG"isdn_mppp: reassembling frames %d " 1895 tot_len += frag->len - MP_HEADER_LEN;
1914 "to %d, len %d\n", MP_SEQ(from), lastseq,
1915 tot_len);
1916 1896
1917 skb = dev_alloc_skb(tot_len); 1897 if( ippp_table[lp->ppp_slot]->debug & 0x40 )
1918 if (!skb) 1898 printk(KERN_DEBUG"isdn_mppp: reassembling frames %d "
1899 "to %d, len %d\n", MP_SEQ(from),
1900 (MP_SEQ(from)+n-1) & MP_LONGSEQ_MASK, tot_len );
1901 if( (skb = dev_alloc_skb(tot_len)) == NULL ) {
1919 printk(KERN_ERR "isdn_mppp: cannot allocate sk buff " 1902 printk(KERN_ERR "isdn_mppp: cannot allocate sk buff "
1920 "of size %d\n", tot_len); 1903 "of size %d\n", tot_len);
1921 1904 isdn_ppp_mp_discard(mp, from, to);
1922 found_start = 0; 1905 return;
1923 skb_queue_walk_safe(&mp->frags, walk, tmp) { 1906 }
1924 if (walk == from)
1925 found_start = 1;
1926 if (!found_start)
1927 continue;
1928 1907
1929 if (skb) { 1908 while( from != to ) {
1930 unsigned int len = walk->len - MP_HEADER_LEN; 1909 unsigned int len = from->len - MP_HEADER_LEN;
1931 skb_copy_from_linear_data_offset(walk, MP_HEADER_LEN,
1932 skb_put(skb, len),
1933 len);
1934 }
1935 __skb_unlink(walk, &mp->frags);
1936 isdn_ppp_mp_free_skb(mp, walk);
1937 1910
1938 if (walk == to) 1911 skb_copy_from_linear_data_offset(from, MP_HEADER_LEN,
1939 break; 1912 skb_put(skb,len),
1913 len);
1914 frag = from->next;
1915 isdn_ppp_mp_free_skb(mp, from);
1916 from = frag;
1940 } 1917 }
1941 } 1918 }
1942 if (!skb)
1943 return;
1944
1945 proto = isdn_ppp_strip_proto(skb); 1919 proto = isdn_ppp_strip_proto(skb);
1946 isdn_ppp_push_higher(net_dev, lp, skb, proto); 1920 isdn_ppp_push_higher(net_dev, lp, skb, proto);
1947} 1921}
1948 1922
1949static void isdn_ppp_mp_free_skb(ippp_bundle *mp, struct sk_buff *skb) 1923static void isdn_ppp_mp_free_skb(ippp_bundle * mp, struct sk_buff * skb)
1950{ 1924{
1951 dev_kfree_skb(skb); 1925 dev_kfree_skb(skb);
1952 mp->frames--; 1926 mp->frames--;
diff --git a/drivers/isdn/mISDN/stack.c b/drivers/isdn/mISDN/stack.c
index 3e1532a180ff..0d05ec43012c 100644
--- a/drivers/isdn/mISDN/stack.c
+++ b/drivers/isdn/mISDN/stack.c
@@ -364,7 +364,7 @@ add_layer2(struct mISDNchannel *ch, struct mISDNstack *st)
364static int 364static int
365st_own_ctrl(struct mISDNchannel *ch, u_int cmd, void *arg) 365st_own_ctrl(struct mISDNchannel *ch, u_int cmd, void *arg)
366{ 366{
367 if (!ch->st || ch->st->layer1) 367 if (!ch->st || !ch->st->layer1)
368 return -EINVAL; 368 return -EINVAL;
369 return ch->st->layer1->ctrl(ch->st->layer1, cmd, arg); 369 return ch->st->layer1->ctrl(ch->st->layer1, cmd, arg);
370} 370}
diff --git a/drivers/leds/leds-gpio.c b/drivers/leds/leds-gpio.c
index 7467980b8cf9..e5225d28f392 100644
--- a/drivers/leds/leds-gpio.c
+++ b/drivers/leds/leds-gpio.c
@@ -78,6 +78,8 @@ static int __devinit create_gpio_led(const struct gpio_led *template,
78{ 78{
79 int ret, state; 79 int ret, state;
80 80
81 led_dat->gpio = -1;
82
81 /* skip leds that aren't available */ 83 /* skip leds that aren't available */
82 if (!gpio_is_valid(template->gpio)) { 84 if (!gpio_is_valid(template->gpio)) {
83 printk(KERN_INFO "Skipping unavailable LED gpio %d (%s)\n", 85 printk(KERN_INFO "Skipping unavailable LED gpio %d (%s)\n",
diff --git a/drivers/md/md.c b/drivers/md/md.c
index 10eb1fce975e..b182f86a19dd 100644
--- a/drivers/md/md.c
+++ b/drivers/md/md.c
@@ -944,6 +944,14 @@ static int super_90_validate(mddev_t *mddev, mdk_rdev_t *rdev)
944 desc->raid_disk < mddev->raid_disks */) { 944 desc->raid_disk < mddev->raid_disks */) {
945 set_bit(In_sync, &rdev->flags); 945 set_bit(In_sync, &rdev->flags);
946 rdev->raid_disk = desc->raid_disk; 946 rdev->raid_disk = desc->raid_disk;
947 } else if (desc->state & (1<<MD_DISK_ACTIVE)) {
948 /* active but not in sync implies recovery up to
949 * reshape position. We don't know exactly where
950 * that is, so set to zero for now */
951 if (mddev->minor_version >= 91) {
952 rdev->recovery_offset = 0;
953 rdev->raid_disk = desc->raid_disk;
954 }
947 } 955 }
948 if (desc->state & (1<<MD_DISK_WRITEMOSTLY)) 956 if (desc->state & (1<<MD_DISK_WRITEMOSTLY))
949 set_bit(WriteMostly, &rdev->flags); 957 set_bit(WriteMostly, &rdev->flags);
@@ -1032,8 +1040,19 @@ static void super_90_sync(mddev_t *mddev, mdk_rdev_t *rdev)
1032 list_for_each_entry(rdev2, &mddev->disks, same_set) { 1040 list_for_each_entry(rdev2, &mddev->disks, same_set) {
1033 mdp_disk_t *d; 1041 mdp_disk_t *d;
1034 int desc_nr; 1042 int desc_nr;
1035 if (rdev2->raid_disk >= 0 && test_bit(In_sync, &rdev2->flags) 1043 int is_active = test_bit(In_sync, &rdev2->flags);
1036 && !test_bit(Faulty, &rdev2->flags)) 1044
1045 if (rdev2->raid_disk >= 0 &&
1046 sb->minor_version >= 91)
1047 /* we have nowhere to store the recovery_offset,
1048 * but if it is not below the reshape_position,
1049 * we can piggy-back on that.
1050 */
1051 is_active = 1;
1052 if (rdev2->raid_disk < 0 ||
1053 test_bit(Faulty, &rdev2->flags))
1054 is_active = 0;
1055 if (is_active)
1037 desc_nr = rdev2->raid_disk; 1056 desc_nr = rdev2->raid_disk;
1038 else 1057 else
1039 desc_nr = next_spare++; 1058 desc_nr = next_spare++;
@@ -1043,16 +1062,16 @@ static void super_90_sync(mddev_t *mddev, mdk_rdev_t *rdev)
1043 d->number = rdev2->desc_nr; 1062 d->number = rdev2->desc_nr;
1044 d->major = MAJOR(rdev2->bdev->bd_dev); 1063 d->major = MAJOR(rdev2->bdev->bd_dev);
1045 d->minor = MINOR(rdev2->bdev->bd_dev); 1064 d->minor = MINOR(rdev2->bdev->bd_dev);
1046 if (rdev2->raid_disk >= 0 && test_bit(In_sync, &rdev2->flags) 1065 if (is_active)
1047 && !test_bit(Faulty, &rdev2->flags))
1048 d->raid_disk = rdev2->raid_disk; 1066 d->raid_disk = rdev2->raid_disk;
1049 else 1067 else
1050 d->raid_disk = rdev2->desc_nr; /* compatibility */ 1068 d->raid_disk = rdev2->desc_nr; /* compatibility */
1051 if (test_bit(Faulty, &rdev2->flags)) 1069 if (test_bit(Faulty, &rdev2->flags))
1052 d->state = (1<<MD_DISK_FAULTY); 1070 d->state = (1<<MD_DISK_FAULTY);
1053 else if (test_bit(In_sync, &rdev2->flags)) { 1071 else if (is_active) {
1054 d->state = (1<<MD_DISK_ACTIVE); 1072 d->state = (1<<MD_DISK_ACTIVE);
1055 d->state |= (1<<MD_DISK_SYNC); 1073 if (test_bit(In_sync, &rdev2->flags))
1074 d->state |= (1<<MD_DISK_SYNC);
1056 active++; 1075 active++;
1057 working++; 1076 working++;
1058 } else { 1077 } else {
@@ -1382,8 +1401,6 @@ static void super_1_sync(mddev_t *mddev, mdk_rdev_t *rdev)
1382 1401
1383 if (rdev->raid_disk >= 0 && 1402 if (rdev->raid_disk >= 0 &&
1384 !test_bit(In_sync, &rdev->flags)) { 1403 !test_bit(In_sync, &rdev->flags)) {
1385 if (mddev->curr_resync_completed > rdev->recovery_offset)
1386 rdev->recovery_offset = mddev->curr_resync_completed;
1387 if (rdev->recovery_offset > 0) { 1404 if (rdev->recovery_offset > 0) {
1388 sb->feature_map |= 1405 sb->feature_map |=
1389 cpu_to_le32(MD_FEATURE_RECOVERY_OFFSET); 1406 cpu_to_le32(MD_FEATURE_RECOVERY_OFFSET);
@@ -1917,6 +1934,14 @@ static void sync_sbs(mddev_t * mddev, int nospares)
1917 */ 1934 */
1918 mdk_rdev_t *rdev; 1935 mdk_rdev_t *rdev;
1919 1936
1937 /* First make sure individual recovery_offsets are correct */
1938 list_for_each_entry(rdev, &mddev->disks, same_set) {
1939 if (rdev->raid_disk >= 0 &&
1940 !test_bit(In_sync, &rdev->flags) &&
1941 mddev->curr_resync_completed > rdev->recovery_offset)
1942 rdev->recovery_offset = mddev->curr_resync_completed;
1943
1944 }
1920 list_for_each_entry(rdev, &mddev->disks, same_set) { 1945 list_for_each_entry(rdev, &mddev->disks, same_set) {
1921 if (rdev->sb_events == mddev->events || 1946 if (rdev->sb_events == mddev->events ||
1922 (nospares && 1947 (nospares &&
@@ -6504,8 +6529,9 @@ void md_do_sync(mddev_t *mddev)
6504 skip: 6529 skip:
6505 mddev->curr_resync = 0; 6530 mddev->curr_resync = 0;
6506 mddev->curr_resync_completed = 0; 6531 mddev->curr_resync_completed = 0;
6507 mddev->resync_min = 0; 6532 if (!test_bit(MD_RECOVERY_INTR, &mddev->recovery))
6508 mddev->resync_max = MaxSector; 6533 /* We completed so max setting can be forgotten. */
6534 mddev->resync_max = MaxSector;
6509 sysfs_notify(&mddev->kobj, NULL, "sync_completed"); 6535 sysfs_notify(&mddev->kobj, NULL, "sync_completed");
6510 wake_up(&resync_wait); 6536 wake_up(&resync_wait);
6511 set_bit(MD_RECOVERY_DONE, &mddev->recovery); 6537 set_bit(MD_RECOVERY_DONE, &mddev->recovery);
diff --git a/drivers/md/raid1.c b/drivers/md/raid1.c
index a053423785c9..e07ce2e033a9 100644
--- a/drivers/md/raid1.c
+++ b/drivers/md/raid1.c
@@ -1650,11 +1650,12 @@ static void raid1d(mddev_t *mddev)
1650 r1_bio->sector, 1650 r1_bio->sector,
1651 r1_bio->sectors); 1651 r1_bio->sectors);
1652 unfreeze_array(conf); 1652 unfreeze_array(conf);
1653 } 1653 } else
1654 md_error(mddev,
1655 conf->mirrors[r1_bio->read_disk].rdev);
1654 1656
1655 bio = r1_bio->bios[r1_bio->read_disk]; 1657 bio = r1_bio->bios[r1_bio->read_disk];
1656 if ((disk=read_balance(conf, r1_bio)) == -1 || 1658 if ((disk=read_balance(conf, r1_bio)) == -1) {
1657 disk == r1_bio->read_disk) {
1658 printk(KERN_ALERT "raid1: %s: unrecoverable I/O" 1659 printk(KERN_ALERT "raid1: %s: unrecoverable I/O"
1659 " read error for block %llu\n", 1660 " read error for block %llu\n",
1660 bdevname(bio->bi_bdev,b), 1661 bdevname(bio->bi_bdev,b),
diff --git a/drivers/md/raid5.c b/drivers/md/raid5.c
index 81abefc172d9..d29215d966da 100644
--- a/drivers/md/raid5.c
+++ b/drivers/md/raid5.c
@@ -4049,6 +4049,8 @@ static sector_t reshape_request(mddev_t *mddev, sector_t sector_nr, int *skipped
4049 sector_nr = conf->reshape_progress; 4049 sector_nr = conf->reshape_progress;
4050 sector_div(sector_nr, new_data_disks); 4050 sector_div(sector_nr, new_data_disks);
4051 if (sector_nr) { 4051 if (sector_nr) {
4052 mddev->curr_resync_completed = sector_nr;
4053 sysfs_notify(&mddev->kobj, NULL, "sync_completed");
4052 *skipped = 1; 4054 *skipped = 1;
4053 return sector_nr; 4055 return sector_nr;
4054 } 4056 }
@@ -4821,11 +4823,40 @@ static raid5_conf_t *setup_conf(mddev_t *mddev)
4821 return ERR_PTR(-ENOMEM); 4823 return ERR_PTR(-ENOMEM);
4822} 4824}
4823 4825
4826
4827static int only_parity(int raid_disk, int algo, int raid_disks, int max_degraded)
4828{
4829 switch (algo) {
4830 case ALGORITHM_PARITY_0:
4831 if (raid_disk < max_degraded)
4832 return 1;
4833 break;
4834 case ALGORITHM_PARITY_N:
4835 if (raid_disk >= raid_disks - max_degraded)
4836 return 1;
4837 break;
4838 case ALGORITHM_PARITY_0_6:
4839 if (raid_disk == 0 ||
4840 raid_disk == raid_disks - 1)
4841 return 1;
4842 break;
4843 case ALGORITHM_LEFT_ASYMMETRIC_6:
4844 case ALGORITHM_RIGHT_ASYMMETRIC_6:
4845 case ALGORITHM_LEFT_SYMMETRIC_6:
4846 case ALGORITHM_RIGHT_SYMMETRIC_6:
4847 if (raid_disk == raid_disks - 1)
4848 return 1;
4849 }
4850 return 0;
4851}
4852
4824static int run(mddev_t *mddev) 4853static int run(mddev_t *mddev)
4825{ 4854{
4826 raid5_conf_t *conf; 4855 raid5_conf_t *conf;
4827 int working_disks = 0, chunk_size; 4856 int working_disks = 0, chunk_size;
4857 int dirty_parity_disks = 0;
4828 mdk_rdev_t *rdev; 4858 mdk_rdev_t *rdev;
4859 sector_t reshape_offset = 0;
4829 4860
4830 if (mddev->recovery_cp != MaxSector) 4861 if (mddev->recovery_cp != MaxSector)
4831 printk(KERN_NOTICE "raid5: %s is not clean" 4862 printk(KERN_NOTICE "raid5: %s is not clean"
@@ -4859,6 +4890,7 @@ static int run(mddev_t *mddev)
4859 "on a stripe boundary\n"); 4890 "on a stripe boundary\n");
4860 return -EINVAL; 4891 return -EINVAL;
4861 } 4892 }
4893 reshape_offset = here_new * mddev->new_chunk_sectors;
4862 /* here_new is the stripe we will write to */ 4894 /* here_new is the stripe we will write to */
4863 here_old = mddev->reshape_position; 4895 here_old = mddev->reshape_position;
4864 sector_div(here_old, mddev->chunk_sectors * 4896 sector_div(here_old, mddev->chunk_sectors *
@@ -4914,10 +4946,51 @@ static int run(mddev_t *mddev)
4914 /* 4946 /*
4915 * 0 for a fully functional array, 1 or 2 for a degraded array. 4947 * 0 for a fully functional array, 1 or 2 for a degraded array.
4916 */ 4948 */
4917 list_for_each_entry(rdev, &mddev->disks, same_set) 4949 list_for_each_entry(rdev, &mddev->disks, same_set) {
4918 if (rdev->raid_disk >= 0 && 4950 if (rdev->raid_disk < 0)
4919 test_bit(In_sync, &rdev->flags)) 4951 continue;
4952 if (test_bit(In_sync, &rdev->flags))
4920 working_disks++; 4953 working_disks++;
4954 /* This disc is not fully in-sync. However if it
4955 * just stored parity (beyond the recovery_offset),
4956 * when we don't need to be concerned about the
4957 * array being dirty.
4958 * When reshape goes 'backwards', we never have
4959 * partially completed devices, so we only need
4960 * to worry about reshape going forwards.
4961 */
4962 /* Hack because v0.91 doesn't store recovery_offset properly. */
4963 if (mddev->major_version == 0 &&
4964 mddev->minor_version > 90)
4965 rdev->recovery_offset = reshape_offset;
4966
4967 printk("%d: w=%d pa=%d pr=%d m=%d a=%d r=%d op1=%d op2=%d\n",
4968 rdev->raid_disk, working_disks, conf->prev_algo,
4969 conf->previous_raid_disks, conf->max_degraded,
4970 conf->algorithm, conf->raid_disks,
4971 only_parity(rdev->raid_disk,
4972 conf->prev_algo,
4973 conf->previous_raid_disks,
4974 conf->max_degraded),
4975 only_parity(rdev->raid_disk,
4976 conf->algorithm,
4977 conf->raid_disks,
4978 conf->max_degraded));
4979 if (rdev->recovery_offset < reshape_offset) {
4980 /* We need to check old and new layout */
4981 if (!only_parity(rdev->raid_disk,
4982 conf->algorithm,
4983 conf->raid_disks,
4984 conf->max_degraded))
4985 continue;
4986 }
4987 if (!only_parity(rdev->raid_disk,
4988 conf->prev_algo,
4989 conf->previous_raid_disks,
4990 conf->max_degraded))
4991 continue;
4992 dirty_parity_disks++;
4993 }
4921 4994
4922 mddev->degraded = (max(conf->raid_disks, conf->previous_raid_disks) 4995 mddev->degraded = (max(conf->raid_disks, conf->previous_raid_disks)
4923 - working_disks); 4996 - working_disks);
@@ -4933,7 +5006,7 @@ static int run(mddev_t *mddev)
4933 mddev->dev_sectors &= ~(mddev->chunk_sectors - 1); 5006 mddev->dev_sectors &= ~(mddev->chunk_sectors - 1);
4934 mddev->resync_max_sectors = mddev->dev_sectors; 5007 mddev->resync_max_sectors = mddev->dev_sectors;
4935 5008
4936 if (mddev->degraded > 0 && 5009 if (mddev->degraded > dirty_parity_disks &&
4937 mddev->recovery_cp != MaxSector) { 5010 mddev->recovery_cp != MaxSector) {
4938 if (mddev->ok_start_degraded) 5011 if (mddev->ok_start_degraded)
4939 printk(KERN_WARNING 5012 printk(KERN_WARNING
@@ -5359,9 +5432,11 @@ static int raid5_start_reshape(mddev_t *mddev)
5359 !test_bit(Faulty, &rdev->flags)) { 5432 !test_bit(Faulty, &rdev->flags)) {
5360 if (raid5_add_disk(mddev, rdev) == 0) { 5433 if (raid5_add_disk(mddev, rdev) == 0) {
5361 char nm[20]; 5434 char nm[20];
5362 set_bit(In_sync, &rdev->flags); 5435 if (rdev->raid_disk >= conf->previous_raid_disks)
5436 set_bit(In_sync, &rdev->flags);
5437 else
5438 rdev->recovery_offset = 0;
5363 added_devices++; 5439 added_devices++;
5364 rdev->recovery_offset = 0;
5365 sprintf(nm, "rd%d", rdev->raid_disk); 5440 sprintf(nm, "rd%d", rdev->raid_disk);
5366 if (sysfs_create_link(&mddev->kobj, 5441 if (sysfs_create_link(&mddev->kobj,
5367 &rdev->kobj, nm)) 5442 &rdev->kobj, nm))
diff --git a/drivers/media/common/ir-functions.c b/drivers/media/common/ir-functions.c
index 655474b29e21..abd4791acb0e 100644
--- a/drivers/media/common/ir-functions.c
+++ b/drivers/media/common/ir-functions.c
@@ -64,7 +64,7 @@ void ir_input_init(struct input_dev *dev, struct ir_input_state *ir,
64 64
65 ir->ir_type = ir_type; 65 ir->ir_type = ir_type;
66 66
67 memset(ir->ir_codes, sizeof(ir->ir_codes), 0); 67 memset(ir->ir_codes, 0, sizeof(ir->ir_codes));
68 68
69 /* 69 /*
70 * FIXME: This is a temporary workaround to use the new IR tables 70 * FIXME: This is a temporary workaround to use the new IR tables
diff --git a/drivers/media/common/tuners/tda18271-fe.c b/drivers/media/common/tuners/tda18271-fe.c
index 64595112000d..3a50ce96fcb9 100644
--- a/drivers/media/common/tuners/tda18271-fe.c
+++ b/drivers/media/common/tuners/tda18271-fe.c
@@ -616,13 +616,13 @@ static int tda18271_rf_tracking_filters_init(struct dvb_frontend *fe, u32 freq)
616 case RF2: 616 case RF2:
617 map[i].rf_a1 = (prog_cal[RF2] - prog_tab[RF2] - 617 map[i].rf_a1 = (prog_cal[RF2] - prog_tab[RF2] -
618 prog_cal[RF1] + prog_tab[RF1]) / 618 prog_cal[RF1] + prog_tab[RF1]) /
619 ((rf_freq[RF2] - rf_freq[RF1]) / 1000); 619 (s32)((rf_freq[RF2] - rf_freq[RF1]) / 1000);
620 map[i].rf2 = rf_freq[RF2] / 1000; 620 map[i].rf2 = rf_freq[RF2] / 1000;
621 break; 621 break;
622 case RF3: 622 case RF3:
623 map[i].rf_a2 = (prog_cal[RF3] - prog_tab[RF3] - 623 map[i].rf_a2 = (prog_cal[RF3] - prog_tab[RF3] -
624 prog_cal[RF2] + prog_tab[RF2]) / 624 prog_cal[RF2] + prog_tab[RF2]) /
625 ((rf_freq[RF3] - rf_freq[RF2]) / 1000); 625 (s32)((rf_freq[RF3] - rf_freq[RF2]) / 1000);
626 map[i].rf_b2 = prog_cal[RF2] - prog_tab[RF2]; 626 map[i].rf_b2 = prog_cal[RF2] - prog_tab[RF2];
627 map[i].rf3 = rf_freq[RF3] / 1000; 627 map[i].rf3 = rf_freq[RF3] / 1000;
628 break; 628 break;
@@ -1000,12 +1000,12 @@ static int tda18271_set_analog_params(struct dvb_frontend *fe,
1000 struct tda18271_std_map_item *map; 1000 struct tda18271_std_map_item *map;
1001 char *mode; 1001 char *mode;
1002 int ret; 1002 int ret;
1003 u32 freq = params->frequency * 62500; 1003 u32 freq = params->frequency * 125 *
1004 ((params->mode == V4L2_TUNER_RADIO) ? 1 : 1000) / 2;
1004 1005
1005 priv->mode = TDA18271_ANALOG; 1006 priv->mode = TDA18271_ANALOG;
1006 1007
1007 if (params->mode == V4L2_TUNER_RADIO) { 1008 if (params->mode == V4L2_TUNER_RADIO) {
1008 freq = freq / 1000;
1009 map = &std_map->fm_radio; 1009 map = &std_map->fm_radio;
1010 mode = "fm"; 1010 mode = "fm";
1011 } else if (params->std & V4L2_STD_MN) { 1011 } else if (params->std & V4L2_STD_MN) {
diff --git a/drivers/media/dvb/dvb-core/dvb_frontend.c b/drivers/media/dvb/dvb-core/dvb_frontend.c
index ddf639ed2fd8..98082416aa52 100644
--- a/drivers/media/dvb/dvb-core/dvb_frontend.c
+++ b/drivers/media/dvb/dvb-core/dvb_frontend.c
@@ -31,6 +31,7 @@
31#include <linux/wait.h> 31#include <linux/wait.h>
32#include <linux/slab.h> 32#include <linux/slab.h>
33#include <linux/poll.h> 33#include <linux/poll.h>
34#include <linux/semaphore.h>
34#include <linux/module.h> 35#include <linux/module.h>
35#include <linux/list.h> 36#include <linux/list.h>
36#include <linux/freezer.h> 37#include <linux/freezer.h>
diff --git a/drivers/media/dvb/dvb-usb/Kconfig b/drivers/media/dvb/dvb-usb/Kconfig
index 9744b0692417..0e4b97fba384 100644
--- a/drivers/media/dvb/dvb-usb/Kconfig
+++ b/drivers/media/dvb/dvb-usb/Kconfig
@@ -75,7 +75,7 @@ config DVB_USB_DIB0700
75 select DVB_DIB3000MC if !DVB_FE_CUSTOMISE 75 select DVB_DIB3000MC if !DVB_FE_CUSTOMISE
76 select DVB_S5H1411 if !DVB_FE_CUSTOMISE 76 select DVB_S5H1411 if !DVB_FE_CUSTOMISE
77 select DVB_LGDT3305 if !DVB_FE_CUSTOMISE 77 select DVB_LGDT3305 if !DVB_FE_CUSTOMISE
78 select DVB_TUNER_DIB0070 78 select DVB_TUNER_DIB0070 if !DVB_FE_CUSTOMISE
79 select MEDIA_TUNER_MT2060 if !MEDIA_TUNER_CUSTOMISE 79 select MEDIA_TUNER_MT2060 if !MEDIA_TUNER_CUSTOMISE
80 select MEDIA_TUNER_MT2266 if !MEDIA_TUNER_CUSTOMISE 80 select MEDIA_TUNER_MT2266 if !MEDIA_TUNER_CUSTOMISE
81 select MEDIA_TUNER_XC2028 if !MEDIA_TUNER_CUSTOMISE 81 select MEDIA_TUNER_XC2028 if !MEDIA_TUNER_CUSTOMISE
diff --git a/drivers/media/dvb/dvb-usb/ce6230.c b/drivers/media/dvb/dvb-usb/ce6230.c
index 0737c6377892..3df2045b7d2d 100644
--- a/drivers/media/dvb/dvb-usb/ce6230.c
+++ b/drivers/media/dvb/dvb-usb/ce6230.c
@@ -105,7 +105,7 @@ static int ce6230_i2c_xfer(struct i2c_adapter *adap, struct i2c_msg msg[],
105 int i = 0; 105 int i = 0;
106 struct req_t req; 106 struct req_t req;
107 int ret = 0; 107 int ret = 0;
108 memset(&req, 0, sizeof(&req)); 108 memset(&req, 0, sizeof(req));
109 109
110 if (num > 2) 110 if (num > 2)
111 return -EINVAL; 111 return -EINVAL;
diff --git a/drivers/media/dvb/dvb-usb/cxusb.c b/drivers/media/dvb/dvb-usb/cxusb.c
index f65591fb7cec..2a53dd096eef 100644
--- a/drivers/media/dvb/dvb-usb/cxusb.c
+++ b/drivers/media/dvb/dvb-usb/cxusb.c
@@ -663,6 +663,14 @@ static struct zl10353_config cxusb_zl10353_xc3028_config = {
663 .parallel_ts = 1, 663 .parallel_ts = 1,
664}; 664};
665 665
666static struct zl10353_config cxusb_zl10353_xc3028_config_no_i2c_gate = {
667 .demod_address = 0x0f,
668 .if2 = 45600,
669 .no_tuner = 1,
670 .parallel_ts = 1,
671 .disable_i2c_gate_ctrl = 1,
672};
673
666static struct mt352_config cxusb_mt352_xc3028_config = { 674static struct mt352_config cxusb_mt352_xc3028_config = {
667 .demod_address = 0x0f, 675 .demod_address = 0x0f,
668 .if2 = 4560, 676 .if2 = 4560,
@@ -894,7 +902,7 @@ static int cxusb_dualdig4_frontend_attach(struct dvb_usb_adapter *adap)
894 cxusb_bluebird_gpio_pulse(adap->dev, 0x02, 1); 902 cxusb_bluebird_gpio_pulse(adap->dev, 0x02, 1);
895 903
896 if ((adap->fe = dvb_attach(zl10353_attach, 904 if ((adap->fe = dvb_attach(zl10353_attach,
897 &cxusb_zl10353_xc3028_config, 905 &cxusb_zl10353_xc3028_config_no_i2c_gate,
898 &adap->dev->i2c_adap)) == NULL) 906 &adap->dev->i2c_adap)) == NULL)
899 return -EIO; 907 return -EIO;
900 908
diff --git a/drivers/media/dvb/dvb-usb/dib0700_devices.c b/drivers/media/dvb/dvb-usb/dib0700_devices.c
index 0b2812aa30a4..6bd8951ea02b 100644
--- a/drivers/media/dvb/dvb-usb/dib0700_devices.c
+++ b/drivers/media/dvb/dvb-usb/dib0700_devices.c
@@ -1925,7 +1925,7 @@ struct dvb_usb_device_properties dib0700_devices[] = {
1925 { NULL }, 1925 { NULL },
1926 }, 1926 },
1927 { "Leadtek Winfast DTV Dongle (STK7700P based)", 1927 { "Leadtek Winfast DTV Dongle (STK7700P based)",
1928 { &dib0700_usb_id_table[8] }, 1928 { &dib0700_usb_id_table[8], &dib0700_usb_id_table[34] },
1929 { NULL }, 1929 { NULL },
1930 }, 1930 },
1931 { "AVerMedia AVerTV DVB-T Express", 1931 { "AVerMedia AVerTV DVB-T Express",
@@ -2064,7 +2064,7 @@ struct dvb_usb_device_properties dib0700_devices[] = {
2064 }, 2064 },
2065 }, 2065 },
2066 2066
2067 .num_device_descs = 12, 2067 .num_device_descs = 11,
2068 .devices = { 2068 .devices = {
2069 { "DiBcom STK7070P reference design", 2069 { "DiBcom STK7070P reference design",
2070 { &dib0700_usb_id_table[15], NULL }, 2070 { &dib0700_usb_id_table[15], NULL },
@@ -2098,11 +2098,6 @@ struct dvb_usb_device_properties dib0700_devices[] = {
2098 { &dib0700_usb_id_table[30], NULL }, 2098 { &dib0700_usb_id_table[30], NULL },
2099 { NULL }, 2099 { NULL },
2100 }, 2100 },
2101 { "Terratec Cinergy T USB XXS/ T3",
2102 { &dib0700_usb_id_table[33],
2103 &dib0700_usb_id_table[52], NULL },
2104 { NULL },
2105 },
2106 { "Elgato EyeTV DTT", 2101 { "Elgato EyeTV DTT",
2107 { &dib0700_usb_id_table[49], NULL }, 2102 { &dib0700_usb_id_table[49], NULL },
2108 { NULL }, 2103 { NULL },
@@ -2343,8 +2338,10 @@ struct dvb_usb_device_properties dib0700_devices[] = {
2343 { &dib0700_usb_id_table[59], NULL }, 2338 { &dib0700_usb_id_table[59], NULL },
2344 { NULL }, 2339 { NULL },
2345 }, 2340 },
2346 { "Terratec Cinergy T USB XXS (HD)", 2341 { "Terratec Cinergy T USB XXS (HD)/ T3",
2347 { &dib0700_usb_id_table[34], &dib0700_usb_id_table[60] }, 2342 { &dib0700_usb_id_table[33],
2343 &dib0700_usb_id_table[52],
2344 &dib0700_usb_id_table[60], NULL},
2348 { NULL }, 2345 { NULL },
2349 }, 2346 },
2350 }, 2347 },
diff --git a/drivers/media/dvb/firewire/firedtv-avc.c b/drivers/media/dvb/firewire/firedtv-avc.c
index d1b67fe0f011..485d061319ab 100644
--- a/drivers/media/dvb/firewire/firedtv-avc.c
+++ b/drivers/media/dvb/firewire/firedtv-avc.c
@@ -1050,28 +1050,28 @@ int avc_ca_pmt(struct firedtv *fdtv, char *msg, int length)
1050 c->operand[4] = 0; /* slot */ 1050 c->operand[4] = 0; /* slot */
1051 c->operand[5] = SFE_VENDOR_TAG_CA_PMT; /* ca tag */ 1051 c->operand[5] = SFE_VENDOR_TAG_CA_PMT; /* ca tag */
1052 c->operand[6] = 0; /* more/last */ 1052 c->operand[6] = 0; /* more/last */
1053 /* c->operand[7] = XXXprogram_info_length + 17; */ /* length */ 1053 /* Use three bytes for length field in case length > 127 */
1054 c->operand[8] = list_management; 1054 c->operand[10] = list_management;
1055 c->operand[9] = 0x01; /* pmt_cmd=OK_descramble */ 1055 c->operand[11] = 0x01; /* pmt_cmd=OK_descramble */
1056 1056
1057 /* TS program map table */ 1057 /* TS program map table */
1058 1058
1059 c->operand[10] = 0x02; /* Table id=2 */ 1059 c->operand[12] = 0x02; /* Table id=2 */
1060 c->operand[11] = 0x80; /* Section syntax + length */ 1060 c->operand[13] = 0x80; /* Section syntax + length */
1061 /* c->operand[12] = XXXprogram_info_length + 12; */ 1061 /* c->operand[14] = XXXprogram_info_length + 12; */
1062 c->operand[13] = msg[1]; /* Program number */ 1062 c->operand[15] = msg[1]; /* Program number */
1063 c->operand[14] = msg[2]; 1063 c->operand[16] = msg[2];
1064 c->operand[15] = 0x01; /* Version number=0 + current/next=1 */ 1064 c->operand[17] = 0x01; /* Version number=0 + current/next=1 */
1065 c->operand[16] = 0x00; /* Section number=0 */ 1065 c->operand[18] = 0x00; /* Section number=0 */
1066 c->operand[17] = 0x00; /* Last section number=0 */ 1066 c->operand[19] = 0x00; /* Last section number=0 */
1067 c->operand[18] = 0x1f; /* PCR_PID=1FFF */ 1067 c->operand[20] = 0x1f; /* PCR_PID=1FFF */
1068 c->operand[19] = 0xff; 1068 c->operand[21] = 0xff;
1069 c->operand[20] = (program_info_length >> 8); /* Program info length */ 1069 c->operand[22] = (program_info_length >> 8); /* Program info length */
1070 c->operand[21] = (program_info_length & 0xff); 1070 c->operand[23] = (program_info_length & 0xff);
1071 1071
1072 /* CA descriptors at programme level */ 1072 /* CA descriptors at programme level */
1073 read_pos = 6; 1073 read_pos = 6;
1074 write_pos = 22; 1074 write_pos = 24;
1075 if (program_info_length > 0) { 1075 if (program_info_length > 0) {
1076 pmt_cmd_id = msg[read_pos++]; 1076 pmt_cmd_id = msg[read_pos++];
1077 if (pmt_cmd_id != 1 && pmt_cmd_id != 4) 1077 if (pmt_cmd_id != 1 && pmt_cmd_id != 4)
@@ -1113,8 +1113,10 @@ int avc_ca_pmt(struct firedtv *fdtv, char *msg, int length)
1113 c->operand[write_pos++] = 0x00; 1113 c->operand[write_pos++] = 0x00;
1114 c->operand[write_pos++] = 0x00; 1114 c->operand[write_pos++] = 0x00;
1115 1115
1116 c->operand[7] = write_pos - 8; 1116 c->operand[7] = 0x82;
1117 c->operand[12] = write_pos - 13; 1117 c->operand[8] = (write_pos - 10) >> 8;
1118 c->operand[9] = (write_pos - 10) & 0xff;
1119 c->operand[14] = write_pos - 15;
1118 1120
1119 crc32_csum = crc32_be(0, &c->operand[10], c->operand[12] - 1); 1121 crc32_csum = crc32_be(0, &c->operand[10], c->operand[12] - 1);
1120 c->operand[write_pos - 4] = (crc32_csum >> 24) & 0xff; 1122 c->operand[write_pos - 4] = (crc32_csum >> 24) & 0xff;
diff --git a/drivers/media/dvb/firewire/firedtv-fe.c b/drivers/media/dvb/firewire/firedtv-fe.c
index 7ba43630a25d..e49cdc88b0c7 100644
--- a/drivers/media/dvb/firewire/firedtv-fe.c
+++ b/drivers/media/dvb/firewire/firedtv-fe.c
@@ -141,18 +141,12 @@ static int fdtv_read_uncorrected_blocks(struct dvb_frontend *fe, u32 *ucblocks)
141 return -EOPNOTSUPP; 141 return -EOPNOTSUPP;
142} 142}
143 143
144#define ACCEPTED 0x9
145
146static int fdtv_set_frontend(struct dvb_frontend *fe, 144static int fdtv_set_frontend(struct dvb_frontend *fe,
147 struct dvb_frontend_parameters *params) 145 struct dvb_frontend_parameters *params)
148{ 146{
149 struct firedtv *fdtv = fe->sec_priv; 147 struct firedtv *fdtv = fe->sec_priv;
150 148
151 /* FIXME: avc_tuner_dsd never returns ACCEPTED. Check status? */ 149 return avc_tuner_dsd(fdtv, params);
152 if (avc_tuner_dsd(fdtv, params) != ACCEPTED)
153 return -EINVAL;
154 else
155 return 0; /* not sure of this... */
156} 150}
157 151
158static int fdtv_get_frontend(struct dvb_frontend *fe, 152static int fdtv_get_frontend(struct dvb_frontend *fe,
diff --git a/drivers/media/dvb/frontends/dib0070.h b/drivers/media/dvb/frontends/dib0070.h
index 8a2e1e710adb..eec9e52ffa75 100644
--- a/drivers/media/dvb/frontends/dib0070.h
+++ b/drivers/media/dvb/frontends/dib0070.h
@@ -51,6 +51,7 @@ struct dib0070_config {
51#if defined(CONFIG_DVB_TUNER_DIB0070) || (defined(CONFIG_DVB_TUNER_DIB0070_MODULE) && defined(MODULE)) 51#if defined(CONFIG_DVB_TUNER_DIB0070) || (defined(CONFIG_DVB_TUNER_DIB0070_MODULE) && defined(MODULE))
52extern struct dvb_frontend *dib0070_attach(struct dvb_frontend *fe, struct i2c_adapter *i2c, struct dib0070_config *cfg); 52extern struct dvb_frontend *dib0070_attach(struct dvb_frontend *fe, struct i2c_adapter *i2c, struct dib0070_config *cfg);
53extern u16 dib0070_wbd_offset(struct dvb_frontend *); 53extern u16 dib0070_wbd_offset(struct dvb_frontend *);
54extern void dib0070_ctrl_agc_filter(struct dvb_frontend *, u8 open);
54#else 55#else
55static inline struct dvb_frontend *dib0070_attach(struct dvb_frontend *fe, struct i2c_adapter *i2c, struct dib0070_config *cfg) 56static inline struct dvb_frontend *dib0070_attach(struct dvb_frontend *fe, struct i2c_adapter *i2c, struct dib0070_config *cfg)
56{ 57{
@@ -63,7 +64,11 @@ static inline u16 dib0070_wbd_offset(struct dvb_frontend *fe)
63 printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __func__); 64 printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __func__);
64 return -ENODEV; 65 return -ENODEV;
65} 66}
67
68static inline void dib0070_ctrl_agc_filter(struct dvb_frontend *fe, u8 open)
69{
70 printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __func__);
71}
66#endif 72#endif
67extern void dib0070_ctrl_agc_filter(struct dvb_frontend *, u8 open);
68 73
69#endif 74#endif
diff --git a/drivers/media/dvb/frontends/dib7000p.c b/drivers/media/dvb/frontends/dib7000p.c
index 55ef6eeb0769..0781f94e05d2 100644
--- a/drivers/media/dvb/frontends/dib7000p.c
+++ b/drivers/media/dvb/frontends/dib7000p.c
@@ -1375,6 +1375,11 @@ struct dvb_frontend * dib7000p_attach(struct i2c_adapter *i2c_adap, u8 i2c_addr,
1375 if (dib7000p_identify(st) != 0) 1375 if (dib7000p_identify(st) != 0)
1376 goto error; 1376 goto error;
1377 1377
1378 /* FIXME: make sure the dev.parent field is initialized, or else
1379 request_firmware() will hit an OOPS (this should be moved somewhere
1380 more common) */
1381 st->i2c_master.gated_tuner_i2c_adap.dev.parent = i2c_adap->dev.parent;
1382
1378 dibx000_init_i2c_master(&st->i2c_master, DIB7000P, st->i2c_adap, st->i2c_addr); 1383 dibx000_init_i2c_master(&st->i2c_master, DIB7000P, st->i2c_adap, st->i2c_addr);
1379 1384
1380 dib7000p_demod_reset(st); 1385 dib7000p_demod_reset(st);
diff --git a/drivers/media/dvb/pt1/pt1.c b/drivers/media/dvb/pt1/pt1.c
index 81e623a90f09..1fd8306371e2 100644
--- a/drivers/media/dvb/pt1/pt1.c
+++ b/drivers/media/dvb/pt1/pt1.c
@@ -27,6 +27,7 @@
27#include <linux/pci.h> 27#include <linux/pci.h>
28#include <linux/kthread.h> 28#include <linux/kthread.h>
29#include <linux/freezer.h> 29#include <linux/freezer.h>
30#include <linux/vmalloc.h>
30 31
31#include "dvbdev.h" 32#include "dvbdev.h"
32#include "dvb_demux.h" 33#include "dvb_demux.h"
diff --git a/drivers/media/dvb/siano/Kconfig b/drivers/media/dvb/siano/Kconfig
index 8c1aed77ea30..85a222c4eaa0 100644
--- a/drivers/media/dvb/siano/Kconfig
+++ b/drivers/media/dvb/siano/Kconfig
@@ -4,7 +4,7 @@
4 4
5config SMS_SIANO_MDTV 5config SMS_SIANO_MDTV
6 tristate "Siano SMS1xxx based MDTV receiver" 6 tristate "Siano SMS1xxx based MDTV receiver"
7 depends on DVB_CORE && INPUT 7 depends on DVB_CORE && INPUT && HAS_DMA
8 ---help--- 8 ---help---
9 Choose Y or M here if you have MDTV receiver with a Siano chipset. 9 Choose Y or M here if you have MDTV receiver with a Siano chipset.
10 10
diff --git a/drivers/media/dvb/siano/smsusb.c b/drivers/media/dvb/siano/smsusb.c
index cb8a358b7310..8f88a586b0dd 100644
--- a/drivers/media/dvb/siano/smsusb.c
+++ b/drivers/media/dvb/siano/smsusb.c
@@ -529,6 +529,12 @@ struct usb_device_id smsusb_id_table[] = {
529 .driver_info = SMS1XXX_BOARD_SIANO_NICE }, 529 .driver_info = SMS1XXX_BOARD_SIANO_NICE },
530 { USB_DEVICE(0x187f, 0x0301), 530 { USB_DEVICE(0x187f, 0x0301),
531 .driver_info = SMS1XXX_BOARD_SIANO_VENICE }, 531 .driver_info = SMS1XXX_BOARD_SIANO_VENICE },
532 { USB_DEVICE(0x2040, 0xb900),
533 .driver_info = SMS1XXX_BOARD_HAUPPAUGE_WINDHAM },
534 { USB_DEVICE(0x2040, 0xb910),
535 .driver_info = SMS1XXX_BOARD_HAUPPAUGE_WINDHAM },
536 { USB_DEVICE(0x2040, 0xc000),
537 .driver_info = SMS1XXX_BOARD_HAUPPAUGE_WINDHAM },
532 { } /* Terminating entry */ 538 { } /* Terminating entry */
533 }; 539 };
534 540
diff --git a/drivers/media/radio/radio-gemtek-pci.c b/drivers/media/radio/radio-gemtek-pci.c
index c3f579de6e71..c6cf11661868 100644
--- a/drivers/media/radio/radio-gemtek-pci.c
+++ b/drivers/media/radio/radio-gemtek-pci.c
@@ -181,12 +181,10 @@ static void gemtek_pci_mute(struct gemtek_pci *card)
181 181
182static void gemtek_pci_unmute(struct gemtek_pci *card) 182static void gemtek_pci_unmute(struct gemtek_pci *card)
183{ 183{
184 mutex_lock(&card->lock);
185 if (card->mute) { 184 if (card->mute) {
186 gemtek_pci_setfrequency(card, card->current_frequency); 185 gemtek_pci_setfrequency(card, card->current_frequency);
187 card->mute = false; 186 card->mute = false;
188 } 187 }
189 mutex_unlock(&card->lock);
190} 188}
191 189
192static int gemtek_pci_getsignal(struct gemtek_pci *card) 190static int gemtek_pci_getsignal(struct gemtek_pci *card)
diff --git a/drivers/media/video/bt8xx/bttv-driver.c b/drivers/media/video/bt8xx/bttv-driver.c
index 939d1e512974..a6724019c66f 100644
--- a/drivers/media/video/bt8xx/bttv-driver.c
+++ b/drivers/media/video/bt8xx/bttv-driver.c
@@ -1299,7 +1299,7 @@ set_tvnorm(struct bttv *btv, unsigned int norm)
1299 1299
1300 tvnorm = &bttv_tvnorms[norm]; 1300 tvnorm = &bttv_tvnorms[norm];
1301 1301
1302 if (!memcmp(&bttv_tvnorms[btv->tvnorm].cropcap, &tvnorm->cropcap, 1302 if (memcmp(&bttv_tvnorms[btv->tvnorm].cropcap, &tvnorm->cropcap,
1303 sizeof (tvnorm->cropcap))) { 1303 sizeof (tvnorm->cropcap))) {
1304 bttv_crop_reset(&btv->crop[0], norm); 1304 bttv_crop_reset(&btv->crop[0], norm);
1305 btv->crop[1] = btv->crop[0]; /* current = default */ 1305 btv->crop[1] = btv->crop[0]; /* current = default */
@@ -3800,11 +3800,34 @@ bttv_irq_next_video(struct bttv *btv, struct bttv_buffer_set *set)
3800 if (!V4L2_FIELD_HAS_BOTH(item->vb.field) && 3800 if (!V4L2_FIELD_HAS_BOTH(item->vb.field) &&
3801 (item->vb.queue.next != &btv->capture)) { 3801 (item->vb.queue.next != &btv->capture)) {
3802 item = list_entry(item->vb.queue.next, struct bttv_buffer, vb.queue); 3802 item = list_entry(item->vb.queue.next, struct bttv_buffer, vb.queue);
3803 /* Mike Isely <isely@pobox.com> - Only check
3804 * and set up the bottom field in the logic
3805 * below. Don't ever do the top field. This
3806 * of course means that if we set up the
3807 * bottom field in the above code that we'll
3808 * actually skip a field. But that's OK.
3809 * Having processed only a single buffer this
3810 * time, then the next time around the first
3811 * available buffer should be for a top field.
3812 * That will then cause us here to set up a
3813 * top then a bottom field in the normal way.
3814 * The alternative to this understanding is
3815 * that we set up the second available buffer
3816 * as a top field, but that's out of order
3817 * since this driver always processes the top
3818 * field first - the effect will be the two
3819 * buffers being returned in the wrong order,
3820 * with the second buffer also being delayed
3821 * by one field time (owing to the fifo nature
3822 * of videobuf). Worse still, we'll be stuck
3823 * doing fields out of order now every time
3824 * until something else causes a field to be
3825 * dropped. By effectively forcing a field to
3826 * drop this way then we always get back into
3827 * sync within a single frame time. (Out of
3828 * order fields can screw up deinterlacing
3829 * algorithms.) */
3803 if (!V4L2_FIELD_HAS_BOTH(item->vb.field)) { 3830 if (!V4L2_FIELD_HAS_BOTH(item->vb.field)) {
3804 if (NULL == set->top &&
3805 V4L2_FIELD_TOP == item->vb.field) {
3806 set->top = item;
3807 }
3808 if (NULL == set->bottom && 3831 if (NULL == set->bottom &&
3809 V4L2_FIELD_BOTTOM == item->vb.field) { 3832 V4L2_FIELD_BOTTOM == item->vb.field) {
3810 set->bottom = item; 3833 set->bottom = item;
diff --git a/drivers/media/video/davinci/vpif_display.c b/drivers/media/video/davinci/vpif_display.c
index c015da813dda..d14cfb200ed0 100644
--- a/drivers/media/video/davinci/vpif_display.c
+++ b/drivers/media/video/davinci/vpif_display.c
@@ -1426,7 +1426,6 @@ static __init int vpif_probe(struct platform_device *pdev)
1426 struct vpif_display_config *config; 1426 struct vpif_display_config *config;
1427 int i, j = 0, k, q, m, err = 0; 1427 int i, j = 0, k, q, m, err = 0;
1428 struct i2c_adapter *i2c_adap; 1428 struct i2c_adapter *i2c_adap;
1429 struct vpif_config *config;
1430 struct common_obj *common; 1429 struct common_obj *common;
1431 struct channel_obj *ch; 1430 struct channel_obj *ch;
1432 struct video_device *vfd; 1431 struct video_device *vfd;
diff --git a/drivers/media/video/em28xx/em28xx-audio.c b/drivers/media/video/em28xx/em28xx-audio.c
index 7bd8a70f0a0b..ac947aecb9c3 100644
--- a/drivers/media/video/em28xx/em28xx-audio.c
+++ b/drivers/media/video/em28xx/em28xx-audio.c
@@ -383,6 +383,11 @@ static int snd_em28xx_hw_capture_free(struct snd_pcm_substream *substream)
383 383
384static int snd_em28xx_prepare(struct snd_pcm_substream *substream) 384static int snd_em28xx_prepare(struct snd_pcm_substream *substream)
385{ 385{
386 struct em28xx *dev = snd_pcm_substream_chip(substream);
387
388 dev->adev.hwptr_done_capture = 0;
389 dev->adev.capture_transfer_done = 0;
390
386 return 0; 391 return 0;
387} 392}
388 393
diff --git a/drivers/media/video/em28xx/em28xx-cards.c b/drivers/media/video/em28xx/em28xx-cards.c
index bdb249bd9d5d..c0fd5c6feeac 100644
--- a/drivers/media/video/em28xx/em28xx-cards.c
+++ b/drivers/media/video/em28xx/em28xx-cards.c
@@ -1584,8 +1584,8 @@ struct em28xx_board em28xx_boards[] = {
1584 [EM2870_BOARD_REDDO_DVB_C_USB_BOX] = { 1584 [EM2870_BOARD_REDDO_DVB_C_USB_BOX] = {
1585 .name = "Reddo DVB-C USB TV Box", 1585 .name = "Reddo DVB-C USB TV Box",
1586 .tuner_type = TUNER_ABSENT, 1586 .tuner_type = TUNER_ABSENT,
1587 .tuner_gpio = reddo_dvb_c_usb_box,
1587 .has_dvb = 1, 1588 .has_dvb = 1,
1588 .dvb_gpio = reddo_dvb_c_usb_box,
1589 }, 1589 },
1590}; 1590};
1591const unsigned int em28xx_bcount = ARRAY_SIZE(em28xx_boards); 1591const unsigned int em28xx_bcount = ARRAY_SIZE(em28xx_boards);
diff --git a/drivers/media/video/gspca/m5602/m5602_s5k4aa.c b/drivers/media/video/gspca/m5602/m5602_s5k4aa.c
index 59400e858965..a27afeb6f39b 100644
--- a/drivers/media/video/gspca/m5602/m5602_s5k4aa.c
+++ b/drivers/media/video/gspca/m5602/m5602_s5k4aa.c
@@ -35,12 +35,25 @@ static
35 const 35 const
36 struct dmi_system_id s5k4aa_vflip_dmi_table[] = { 36 struct dmi_system_id s5k4aa_vflip_dmi_table[] = {
37 { 37 {
38 .ident = "BRUNEINIT",
39 .matches = {
40 DMI_MATCH(DMI_SYS_VENDOR, "BRUNENIT"),
41 DMI_MATCH(DMI_PRODUCT_NAME, "BRUNENIT"),
42 DMI_MATCH(DMI_BOARD_VERSION, "00030D0000000001")
43 }
44 }, {
38 .ident = "Fujitsu-Siemens Amilo Xa 2528", 45 .ident = "Fujitsu-Siemens Amilo Xa 2528",
39 .matches = { 46 .matches = {
40 DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU SIEMENS"), 47 DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU SIEMENS"),
41 DMI_MATCH(DMI_PRODUCT_NAME, "AMILO Xa 2528") 48 DMI_MATCH(DMI_PRODUCT_NAME, "AMILO Xa 2528")
42 } 49 }
43 }, { 50 }, {
51 .ident = "Fujitsu-Siemens Amilo Xi 2528",
52 .matches = {
53 DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU SIEMENS"),
54 DMI_MATCH(DMI_PRODUCT_NAME, "AMILO Xi 2528")
55 }
56 }, {
44 .ident = "Fujitsu-Siemens Amilo Xi 2550", 57 .ident = "Fujitsu-Siemens Amilo Xi 2550",
45 .matches = { 58 .matches = {
46 DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU SIEMENS"), 59 DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU SIEMENS"),
@@ -57,6 +70,13 @@ static
57 .matches = { 70 .matches = {
58 DMI_MATCH(DMI_SYS_VENDOR, "Micro-Star International"), 71 DMI_MATCH(DMI_SYS_VENDOR, "Micro-Star International"),
59 DMI_MATCH(DMI_PRODUCT_NAME, "GX700"), 72 DMI_MATCH(DMI_PRODUCT_NAME, "GX700"),
73 DMI_MATCH(DMI_BIOS_DATE, "12/02/2008")
74 }
75 }, {
76 .ident = "MSI GX700",
77 .matches = {
78 DMI_MATCH(DMI_SYS_VENDOR, "Micro-Star International"),
79 DMI_MATCH(DMI_PRODUCT_NAME, "GX700"),
60 DMI_MATCH(DMI_BIOS_DATE, "07/26/2007") 80 DMI_MATCH(DMI_BIOS_DATE, "07/26/2007")
61 } 81 }
62 }, { 82 }, {
diff --git a/drivers/media/video/gspca/mr97310a.c b/drivers/media/video/gspca/mr97310a.c
index 140c8f320e47..f8328b9efae5 100644
--- a/drivers/media/video/gspca/mr97310a.c
+++ b/drivers/media/video/gspca/mr97310a.c
@@ -483,7 +483,7 @@ static int start_cif_cam(struct gspca_dev *gspca_dev)
483 data[3] = 0x2c; /* reg 2, H size/8 */ 483 data[3] = 0x2c; /* reg 2, H size/8 */
484 data[4] = 0x48; /* reg 3, V size/4 */ 484 data[4] = 0x48; /* reg 3, V size/4 */
485 data[6] = 0x06; /* reg 5, H start */ 485 data[6] = 0x06; /* reg 5, H start */
486 data[8] = 0x06 + sd->sensor_type; /* reg 7, V start */ 486 data[8] = 0x06 - sd->sensor_type; /* reg 7, V start */
487 break; 487 break;
488 } 488 }
489 err_code = mr_write(gspca_dev, 11); 489 err_code = mr_write(gspca_dev, 11);
diff --git a/drivers/media/video/gspca/ov519.c b/drivers/media/video/gspca/ov519.c
index 2f6e135d94bc..a5c190e93799 100644
--- a/drivers/media/video/gspca/ov519.c
+++ b/drivers/media/video/gspca/ov519.c
@@ -2919,7 +2919,7 @@ static void ov518_pkt_scan(struct gspca_dev *gspca_dev,
2919 /* A false positive here is likely, until OVT gives me 2919 /* A false positive here is likely, until OVT gives me
2920 * the definitive SOF/EOF format */ 2920 * the definitive SOF/EOF format */
2921 if ((!(data[0] | data[1] | data[2] | data[3] | data[5])) && data[6]) { 2921 if ((!(data[0] | data[1] | data[2] | data[3] | data[5])) && data[6]) {
2922 gspca_frame_add(gspca_dev, LAST_PACKET, frame, data, 0); 2922 frame = gspca_frame_add(gspca_dev, LAST_PACKET, frame, data, 0);
2923 gspca_frame_add(gspca_dev, FIRST_PACKET, frame, data, 0); 2923 gspca_frame_add(gspca_dev, FIRST_PACKET, frame, data, 0);
2924 sd->packet_nr = 0; 2924 sd->packet_nr = 0;
2925 } 2925 }
diff --git a/drivers/media/video/gspca/stv06xx/stv06xx.c b/drivers/media/video/gspca/stv06xx/stv06xx.c
index 65489d6b0d89..bfae63f5584c 100644
--- a/drivers/media/video/gspca/stv06xx/stv06xx.c
+++ b/drivers/media/video/gspca/stv06xx/stv06xx.c
@@ -394,7 +394,8 @@ frame_data:
394 PDEBUG(D_PACK, "End of frame detected"); 394 PDEBUG(D_PACK, "End of frame detected");
395 395
396 /* Complete the last frame (if any) */ 396 /* Complete the last frame (if any) */
397 gspca_frame_add(gspca_dev, LAST_PACKET, frame, data, 0); 397 frame = gspca_frame_add(gspca_dev, LAST_PACKET,
398 frame, data, 0);
398 399
399 if (chunk_len) 400 if (chunk_len)
400 PDEBUG(D_ERR, "Chunk length is " 401 PDEBUG(D_ERR, "Chunk length is "
diff --git a/drivers/media/video/mx1_camera.c b/drivers/media/video/mx1_camera.c
index 5f37952c75cf..72802291e812 100644
--- a/drivers/media/video/mx1_camera.c
+++ b/drivers/media/video/mx1_camera.c
@@ -28,6 +28,7 @@
28#include <linux/moduleparam.h> 28#include <linux/moduleparam.h>
29#include <linux/mutex.h> 29#include <linux/mutex.h>
30#include <linux/platform_device.h> 30#include <linux/platform_device.h>
31#include <linux/sched.h>
31#include <linux/time.h> 32#include <linux/time.h>
32#include <linux/version.h> 33#include <linux/version.h>
33#include <linux/videodev2.h> 34#include <linux/videodev2.h>
diff --git a/drivers/media/video/mx3_camera.c b/drivers/media/video/mx3_camera.c
index dff2e5e2d8c6..7db82bdf6f31 100644
--- a/drivers/media/video/mx3_camera.c
+++ b/drivers/media/video/mx3_camera.c
@@ -17,6 +17,7 @@
17#include <linux/clk.h> 17#include <linux/clk.h>
18#include <linux/vmalloc.h> 18#include <linux/vmalloc.h>
19#include <linux/interrupt.h> 19#include <linux/interrupt.h>
20#include <linux/sched.h>
20 21
21#include <media/v4l2-common.h> 22#include <media/v4l2-common.h>
22#include <media/v4l2-dev.h> 23#include <media/v4l2-dev.h>
diff --git a/drivers/media/video/pxa_camera.c b/drivers/media/video/pxa_camera.c
index 6952e9602d5d..51b683c63b70 100644
--- a/drivers/media/video/pxa_camera.c
+++ b/drivers/media/video/pxa_camera.c
@@ -26,6 +26,7 @@
26#include <linux/device.h> 26#include <linux/device.h>
27#include <linux/platform_device.h> 27#include <linux/platform_device.h>
28#include <linux/clk.h> 28#include <linux/clk.h>
29#include <linux/sched.h>
29 30
30#include <media/v4l2-common.h> 31#include <media/v4l2-common.h>
31#include <media/v4l2-dev.h> 32#include <media/v4l2-dev.h>
@@ -1432,7 +1433,9 @@ static int pxa_camera_set_fmt(struct soc_camera_device *icd,
1432 icd->sense = &sense; 1433 icd->sense = &sense;
1433 1434
1434 cam_f.fmt.pix.pixelformat = cam_fmt->fourcc; 1435 cam_f.fmt.pix.pixelformat = cam_fmt->fourcc;
1435 ret = v4l2_subdev_call(sd, video, s_fmt, f); 1436 ret = v4l2_subdev_call(sd, video, s_fmt, &cam_f);
1437 cam_f.fmt.pix.pixelformat = pix->pixelformat;
1438 *pix = cam_f.fmt.pix;
1436 1439
1437 icd->sense = NULL; 1440 icd->sense = NULL;
1438 1441
diff --git a/drivers/media/video/s2255drv.c b/drivers/media/video/s2255drv.c
index 9e3262c0ba37..2c0bb06cab3b 100644
--- a/drivers/media/video/s2255drv.c
+++ b/drivers/media/video/s2255drv.c
@@ -598,11 +598,6 @@ static int s2255_got_frame(struct s2255_dev *dev, int chn, int jpgsize)
598 buf = list_entry(dma_q->active.next, 598 buf = list_entry(dma_q->active.next,
599 struct s2255_buffer, vb.queue); 599 struct s2255_buffer, vb.queue);
600 600
601 if (!waitqueue_active(&buf->vb.done)) {
602 /* no one active */
603 rc = -1;
604 goto unlock;
605 }
606 list_del(&buf->vb.queue); 601 list_del(&buf->vb.queue);
607 do_gettimeofday(&buf->vb.ts); 602 do_gettimeofday(&buf->vb.ts);
608 dprintk(100, "[%p/%d] wakeup\n", buf, buf->vb.i); 603 dprintk(100, "[%p/%d] wakeup\n", buf, buf->vb.i);
diff --git a/drivers/media/video/saa7134/saa7134-cards.c b/drivers/media/video/saa7134/saa7134-cards.c
index 71145bff94fa..09013229d4aa 100644
--- a/drivers/media/video/saa7134/saa7134-cards.c
+++ b/drivers/media/video/saa7134/saa7134-cards.c
@@ -3428,6 +3428,7 @@ struct saa7134_board saa7134_boards[] = {
3428 .tuner_config = 3, 3428 .tuner_config = 3,
3429 .mpeg = SAA7134_MPEG_DVB, 3429 .mpeg = SAA7134_MPEG_DVB,
3430 .ts_type = SAA7134_MPEG_TS_SERIAL, 3430 .ts_type = SAA7134_MPEG_TS_SERIAL,
3431 .ts_force_val = 1,
3431 .gpiomask = 0x0800100, /* GPIO 21 is an INPUT */ 3432 .gpiomask = 0x0800100, /* GPIO 21 is an INPUT */
3432 .inputs = {{ 3433 .inputs = {{
3433 .name = name_tv, 3434 .name = name_tv,
diff --git a/drivers/media/video/saa7134/saa7134-ts.c b/drivers/media/video/saa7134/saa7134-ts.c
index 3fa652279ac0..03488ba4c99c 100644
--- a/drivers/media/video/saa7134/saa7134-ts.c
+++ b/drivers/media/video/saa7134/saa7134-ts.c
@@ -262,11 +262,13 @@ int saa7134_ts_start(struct saa7134_dev *dev)
262 switch (saa7134_boards[dev->board].ts_type) { 262 switch (saa7134_boards[dev->board].ts_type) {
263 case SAA7134_MPEG_TS_PARALLEL: 263 case SAA7134_MPEG_TS_PARALLEL:
264 saa_writeb(SAA7134_TS_SERIAL0, 0x40); 264 saa_writeb(SAA7134_TS_SERIAL0, 0x40);
265 saa_writeb(SAA7134_TS_PARALLEL, 0xec); 265 saa_writeb(SAA7134_TS_PARALLEL, 0xec |
266 (saa7134_boards[dev->board].ts_force_val << 4));
266 break; 267 break;
267 case SAA7134_MPEG_TS_SERIAL: 268 case SAA7134_MPEG_TS_SERIAL:
268 saa_writeb(SAA7134_TS_SERIAL0, 0xd8); 269 saa_writeb(SAA7134_TS_SERIAL0, 0xd8);
269 saa_writeb(SAA7134_TS_PARALLEL, 0x6c); 270 saa_writeb(SAA7134_TS_PARALLEL, 0x6c |
271 (saa7134_boards[dev->board].ts_force_val << 4));
270 saa_writeb(SAA7134_TS_PARALLEL_SERIAL, 0xbc); 272 saa_writeb(SAA7134_TS_PARALLEL_SERIAL, 0xbc);
271 saa_writeb(SAA7134_TS_SERIAL1, 0x02); 273 saa_writeb(SAA7134_TS_SERIAL1, 0x02);
272 break; 274 break;
diff --git a/drivers/media/video/saa7134/saa7134.h b/drivers/media/video/saa7134/saa7134.h
index 6ee3e9b7769e..f8697d46ff5f 100644
--- a/drivers/media/video/saa7134/saa7134.h
+++ b/drivers/media/video/saa7134/saa7134.h
@@ -360,6 +360,7 @@ struct saa7134_board {
360 enum saa7134_mpeg_type mpeg; 360 enum saa7134_mpeg_type mpeg;
361 enum saa7134_mpeg_ts_type ts_type; 361 enum saa7134_mpeg_ts_type ts_type;
362 unsigned int vid_port_opts; 362 unsigned int vid_port_opts;
363 unsigned int ts_force_val:1;
363}; 364};
364 365
365#define card_has_radio(dev) (NULL != saa7134_boards[dev->board].radio.name) 366#define card_has_radio(dev) (NULL != saa7134_boards[dev->board].radio.name)
diff --git a/drivers/media/video/saa7164/saa7164-cmd.c b/drivers/media/video/saa7164/saa7164-cmd.c
index c45966edc0cf..9c1d3ac43869 100644
--- a/drivers/media/video/saa7164/saa7164-cmd.c
+++ b/drivers/media/video/saa7164/saa7164-cmd.c
@@ -347,7 +347,7 @@ int saa7164_cmd_send(struct saa7164_dev *dev, u8 id, tmComResCmd_t command,
347 347
348 /* Prepare some basic command/response structures */ 348 /* Prepare some basic command/response structures */
349 memset(&command_t, 0, sizeof(command_t)); 349 memset(&command_t, 0, sizeof(command_t));
350 memset(&response_t, 0, sizeof(&response_t)); 350 memset(&response_t, 0, sizeof(response_t));
351 pcommand_t = &command_t; 351 pcommand_t = &command_t;
352 presponse_t = &response_t; 352 presponse_t = &response_t;
353 command_t.id = id; 353 command_t.id = id;
diff --git a/drivers/media/video/sh_mobile_ceu_camera.c b/drivers/media/video/sh_mobile_ceu_camera.c
index 65ac474c517a..9c8b7c7b89ee 100644
--- a/drivers/media/video/sh_mobile_ceu_camera.c
+++ b/drivers/media/video/sh_mobile_ceu_camera.c
@@ -31,6 +31,7 @@
31#include <linux/platform_device.h> 31#include <linux/platform_device.h>
32#include <linux/videodev2.h> 32#include <linux/videodev2.h>
33#include <linux/pm_runtime.h> 33#include <linux/pm_runtime.h>
34#include <linux/sched.h>
34 35
35#include <media/v4l2-common.h> 36#include <media/v4l2-common.h>
36#include <media/v4l2-dev.h> 37#include <media/v4l2-dev.h>
@@ -1173,8 +1174,8 @@ static int get_scales(struct soc_camera_device *icd,
1173 width_in = scale_up(cam->ceu_rect.width, *scale_h); 1174 width_in = scale_up(cam->ceu_rect.width, *scale_h);
1174 height_in = scale_up(cam->ceu_rect.height, *scale_v); 1175 height_in = scale_up(cam->ceu_rect.height, *scale_v);
1175 1176
1176 *scale_h = calc_generic_scale(cam->ceu_rect.width, icd->user_width); 1177 *scale_h = calc_generic_scale(width_in, icd->user_width);
1177 *scale_v = calc_generic_scale(cam->ceu_rect.height, icd->user_height); 1178 *scale_v = calc_generic_scale(height_in, icd->user_height);
1178 1179
1179 return 0; 1180 return 0;
1180} 1181}
@@ -1723,11 +1724,12 @@ static int __devinit sh_mobile_ceu_probe(struct platform_device *pdev)
1723 1724
1724 err = soc_camera_host_register(&pcdev->ici); 1725 err = soc_camera_host_register(&pcdev->ici);
1725 if (err) 1726 if (err)
1726 goto exit_free_irq; 1727 goto exit_free_clk;
1727 1728
1728 return 0; 1729 return 0;
1729 1730
1730exit_free_irq: 1731exit_free_clk:
1732 pm_runtime_disable(&pdev->dev);
1731 free_irq(pcdev->irq, pcdev); 1733 free_irq(pcdev->irq, pcdev);
1732exit_release_mem: 1734exit_release_mem:
1733 if (platform_get_resource(pdev, IORESOURCE_MEM, 1)) 1735 if (platform_get_resource(pdev, IORESOURCE_MEM, 1))
@@ -1747,6 +1749,7 @@ static int __devexit sh_mobile_ceu_remove(struct platform_device *pdev)
1747 struct sh_mobile_ceu_dev, ici); 1749 struct sh_mobile_ceu_dev, ici);
1748 1750
1749 soc_camera_host_unregister(soc_host); 1751 soc_camera_host_unregister(soc_host);
1752 pm_runtime_disable(&pdev->dev);
1750 free_irq(pcdev->irq, pcdev); 1753 free_irq(pcdev->irq, pcdev);
1751 if (platform_get_resource(pdev, IORESOURCE_MEM, 1)) 1754 if (platform_get_resource(pdev, IORESOURCE_MEM, 1))
1752 dma_release_declared_memory(&pdev->dev); 1755 dma_release_declared_memory(&pdev->dev);
diff --git a/drivers/media/video/soc_camera.c b/drivers/media/video/soc_camera.c
index 59aa7a3694c2..95fdeb23c2c1 100644
--- a/drivers/media/video/soc_camera.c
+++ b/drivers/media/video/soc_camera.c
@@ -1097,6 +1097,13 @@ static int default_s_crop(struct soc_camera_device *icd, struct v4l2_crop *a)
1097 return v4l2_subdev_call(sd, video, s_crop, a); 1097 return v4l2_subdev_call(sd, video, s_crop, a);
1098} 1098}
1099 1099
1100static void soc_camera_device_init(struct device *dev, void *pdata)
1101{
1102 dev->platform_data = pdata;
1103 dev->bus = &soc_camera_bus_type;
1104 dev->release = dummy_release;
1105}
1106
1100int soc_camera_host_register(struct soc_camera_host *ici) 1107int soc_camera_host_register(struct soc_camera_host *ici)
1101{ 1108{
1102 struct soc_camera_host *ix; 1109 struct soc_camera_host *ix;
@@ -1158,15 +1165,19 @@ void soc_camera_host_unregister(struct soc_camera_host *ici)
1158 1165
1159 list_for_each_entry(icd, &devices, list) { 1166 list_for_each_entry(icd, &devices, list) {
1160 if (icd->iface == ici->nr) { 1167 if (icd->iface == ici->nr) {
1168 void *pdata = icd->dev.platform_data;
1161 /* The bus->remove will be called */ 1169 /* The bus->remove will be called */
1162 device_unregister(&icd->dev); 1170 device_unregister(&icd->dev);
1163 /* Not before device_unregister(), .remove 1171 /*
1164 * needs parent to call ici->ops->remove() */ 1172 * Not before device_unregister(), .remove
1165 icd->dev.parent = NULL; 1173 * needs parent to call ici->ops->remove().
1166 1174 * If the host module is loaded again, device_register()
1167 /* If the host module is loaded again, device_register() 1175 * would complain "already initialised," since 2.6.32
1168 * would complain "already initialised" */ 1176 * this is also needed to prevent use-after-free of the
1169 memset(&icd->dev.kobj, 0, sizeof(icd->dev.kobj)); 1177 * device private data.
1178 */
1179 memset(&icd->dev, 0, sizeof(icd->dev));
1180 soc_camera_device_init(&icd->dev, pdata);
1170 } 1181 }
1171 } 1182 }
1172 1183
@@ -1198,10 +1209,7 @@ static int soc_camera_device_register(struct soc_camera_device *icd)
1198 * man, stay reasonable... */ 1209 * man, stay reasonable... */
1199 return -ENOMEM; 1210 return -ENOMEM;
1200 1211
1201 icd->devnum = num; 1212 icd->devnum = num;
1202 icd->dev.bus = &soc_camera_bus_type;
1203
1204 icd->dev.release = dummy_release;
1205 icd->use_count = 0; 1213 icd->use_count = 0;
1206 icd->host_priv = NULL; 1214 icd->host_priv = NULL;
1207 mutex_init(&icd->video_lock); 1215 mutex_init(&icd->video_lock);
@@ -1309,12 +1317,13 @@ static int __devinit soc_camera_pdrv_probe(struct platform_device *pdev)
1309 icd->iface = icl->bus_id; 1317 icd->iface = icl->bus_id;
1310 icd->pdev = &pdev->dev; 1318 icd->pdev = &pdev->dev;
1311 platform_set_drvdata(pdev, icd); 1319 platform_set_drvdata(pdev, icd);
1312 icd->dev.platform_data = icl;
1313 1320
1314 ret = soc_camera_device_register(icd); 1321 ret = soc_camera_device_register(icd);
1315 if (ret < 0) 1322 if (ret < 0)
1316 goto escdevreg; 1323 goto escdevreg;
1317 1324
1325 soc_camera_device_init(&icd->dev, icl);
1326
1318 icd->user_width = DEFAULT_WIDTH; 1327 icd->user_width = DEFAULT_WIDTH;
1319 icd->user_height = DEFAULT_HEIGHT; 1328 icd->user_height = DEFAULT_HEIGHT;
1320 1329
diff --git a/drivers/media/video/uvc/uvc_ctrl.c b/drivers/media/video/uvc/uvc_ctrl.c
index c3225a561748..1b89735e62fd 100644
--- a/drivers/media/video/uvc/uvc_ctrl.c
+++ b/drivers/media/video/uvc/uvc_ctrl.c
@@ -348,7 +348,7 @@ static void uvc_ctrl_set_zoom(struct uvc_control_mapping *mapping,
348 __s32 value, __u8 *data) 348 __s32 value, __u8 *data)
349{ 349{
350 data[0] = value == 0 ? 0 : (value > 0) ? 1 : 0xff; 350 data[0] = value == 0 ? 0 : (value > 0) ? 1 : 0xff;
351 data[2] = min(abs(value), 0xff); 351 data[2] = min((int)abs(value), 0xff);
352} 352}
353 353
354static struct uvc_control_mapping uvc_ctrl_mappings[] = { 354static struct uvc_control_mapping uvc_ctrl_mappings[] = {
diff --git a/drivers/media/video/uvc/uvc_video.c b/drivers/media/video/uvc/uvc_video.c
index f960e8ea4f17..a6e41d12b221 100644
--- a/drivers/media/video/uvc/uvc_video.c
+++ b/drivers/media/video/uvc/uvc_video.c
@@ -90,7 +90,8 @@ static void uvc_fixup_video_ctrl(struct uvc_streaming *stream,
90 ctrl->dwMaxVideoFrameSize = 90 ctrl->dwMaxVideoFrameSize =
91 frame->dwMaxVideoFrameBufferSize; 91 frame->dwMaxVideoFrameBufferSize;
92 92
93 if (stream->dev->quirks & UVC_QUIRK_FIX_BANDWIDTH && 93 if (!(format->flags & UVC_FMT_FLAG_COMPRESSED) &&
94 stream->dev->quirks & UVC_QUIRK_FIX_BANDWIDTH &&
94 stream->intf->num_altsetting > 1) { 95 stream->intf->num_altsetting > 1) {
95 u32 interval; 96 u32 interval;
96 u32 bandwidth; 97 u32 bandwidth;
diff --git a/drivers/media/video/videobuf-dma-contig.c b/drivers/media/video/videobuf-dma-contig.c
index 635ffc7b0391..c3065c4bcba9 100644
--- a/drivers/media/video/videobuf-dma-contig.c
+++ b/drivers/media/video/videobuf-dma-contig.c
@@ -19,6 +19,7 @@
19#include <linux/mm.h> 19#include <linux/mm.h>
20#include <linux/pagemap.h> 20#include <linux/pagemap.h>
21#include <linux/dma-mapping.h> 21#include <linux/dma-mapping.h>
22#include <linux/sched.h>
22#include <media/videobuf-dma-contig.h> 23#include <media/videobuf-dma-contig.h>
23 24
24struct videobuf_dma_contig_memory { 25struct videobuf_dma_contig_memory {
diff --git a/drivers/mfd/wm831x-core.c b/drivers/mfd/wm831x-core.c
index 49b7885c2702..7f27576ca046 100644
--- a/drivers/mfd/wm831x-core.c
+++ b/drivers/mfd/wm831x-core.c
@@ -29,7 +29,7 @@
29/* Current settings - values are 2*2^(reg_val/4) microamps. These are 29/* Current settings - values are 2*2^(reg_val/4) microamps. These are
30 * exported since they are used by multiple drivers. 30 * exported since they are used by multiple drivers.
31 */ 31 */
32int wm831x_isinkv_values[WM831X_ISINK_MAX_ISEL] = { 32int wm831x_isinkv_values[WM831X_ISINK_MAX_ISEL + 1] = {
33 2, 33 2,
34 2, 34 2,
35 3, 35 3,
diff --git a/drivers/misc/eeprom/at24.c b/drivers/misc/eeprom/at24.c
index db39f4a52f53..2cb2736d65aa 100644
--- a/drivers/misc/eeprom/at24.c
+++ b/drivers/misc/eeprom/at24.c
@@ -158,6 +158,7 @@ static ssize_t at24_eeprom_read(struct at24_data *at24, char *buf,
158 struct i2c_msg msg[2]; 158 struct i2c_msg msg[2];
159 u8 msgbuf[2]; 159 u8 msgbuf[2];
160 struct i2c_client *client; 160 struct i2c_client *client;
161 unsigned long timeout, read_time;
161 int status, i; 162 int status, i;
162 163
163 memset(msg, 0, sizeof(msg)); 164 memset(msg, 0, sizeof(msg));
@@ -183,47 +184,60 @@ static ssize_t at24_eeprom_read(struct at24_data *at24, char *buf,
183 if (count > io_limit) 184 if (count > io_limit)
184 count = io_limit; 185 count = io_limit;
185 186
186 /* Smaller eeproms can work given some SMBus extension calls */
187 if (at24->use_smbus) { 187 if (at24->use_smbus) {
188 /* Smaller eeproms can work given some SMBus extension calls */
188 if (count > I2C_SMBUS_BLOCK_MAX) 189 if (count > I2C_SMBUS_BLOCK_MAX)
189 count = I2C_SMBUS_BLOCK_MAX; 190 count = I2C_SMBUS_BLOCK_MAX;
190 status = i2c_smbus_read_i2c_block_data(client, offset, 191 } else {
191 count, buf); 192 /*
192 dev_dbg(&client->dev, "smbus read %zu@%d --> %d\n", 193 * When we have a better choice than SMBus calls, use a
193 count, offset, status); 194 * combined I2C message. Write address; then read up to
194 return (status < 0) ? -EIO : status; 195 * io_limit data bytes. Note that read page rollover helps us
196 * here (unlike writes). msgbuf is u8 and will cast to our
197 * needs.
198 */
199 i = 0;
200 if (at24->chip.flags & AT24_FLAG_ADDR16)
201 msgbuf[i++] = offset >> 8;
202 msgbuf[i++] = offset;
203
204 msg[0].addr = client->addr;
205 msg[0].buf = msgbuf;
206 msg[0].len = i;
207
208 msg[1].addr = client->addr;
209 msg[1].flags = I2C_M_RD;
210 msg[1].buf = buf;
211 msg[1].len = count;
195 } 212 }
196 213
197 /* 214 /*
198 * When we have a better choice than SMBus calls, use a combined 215 * Reads fail if the previous write didn't complete yet. We may
199 * I2C message. Write address; then read up to io_limit data bytes. 216 * loop a few times until this one succeeds, waiting at least
200 * Note that read page rollover helps us here (unlike writes). 217 * long enough for one entire page write to work.
201 * msgbuf is u8 and will cast to our needs.
202 */ 218 */
203 i = 0; 219 timeout = jiffies + msecs_to_jiffies(write_timeout);
204 if (at24->chip.flags & AT24_FLAG_ADDR16) 220 do {
205 msgbuf[i++] = offset >> 8; 221 read_time = jiffies;
206 msgbuf[i++] = offset; 222 if (at24->use_smbus) {
207 223 status = i2c_smbus_read_i2c_block_data(client, offset,
208 msg[0].addr = client->addr; 224 count, buf);
209 msg[0].buf = msgbuf; 225 } else {
210 msg[0].len = i; 226 status = i2c_transfer(client->adapter, msg, 2);
227 if (status == 2)
228 status = count;
229 }
230 dev_dbg(&client->dev, "read %zu@%d --> %d (%ld)\n",
231 count, offset, status, jiffies);
211 232
212 msg[1].addr = client->addr; 233 if (status == count)
213 msg[1].flags = I2C_M_RD; 234 return count;
214 msg[1].buf = buf;
215 msg[1].len = count;
216 235
217 status = i2c_transfer(client->adapter, msg, 2); 236 /* REVISIT: at HZ=100, this is sloooow */
218 dev_dbg(&client->dev, "i2c read %zu@%d --> %d\n", 237 msleep(1);
219 count, offset, status); 238 } while (time_before(read_time, timeout));
220 239
221 if (status == 2) 240 return -ETIMEDOUT;
222 return count;
223 else if (status >= 0)
224 return -EIO;
225 else
226 return status;
227} 241}
228 242
229static ssize_t at24_read(struct at24_data *at24, 243static ssize_t at24_read(struct at24_data *at24,
diff --git a/drivers/misc/sgi-gru/gruprocfs.c b/drivers/misc/sgi-gru/gruprocfs.c
index ccd4408a26c7..3f2375c5ba5b 100644
--- a/drivers/misc/sgi-gru/gruprocfs.c
+++ b/drivers/misc/sgi-gru/gruprocfs.c
@@ -161,14 +161,15 @@ static int options_show(struct seq_file *s, void *p)
161static ssize_t options_write(struct file *file, const char __user *userbuf, 161static ssize_t options_write(struct file *file, const char __user *userbuf,
162 size_t count, loff_t *data) 162 size_t count, loff_t *data)
163{ 163{
164 unsigned long val; 164 char buf[20];
165 char buf[80];
166 165
167 if (strncpy_from_user(buf, userbuf, sizeof(buf) - 1) < 0) 166 if (count >= sizeof(buf))
167 return -EINVAL;
168 if (copy_from_user(buf, userbuf, count))
168 return -EFAULT; 169 return -EFAULT;
169 buf[count - 1] = '\0'; 170 buf[count] = '\0';
170 if (!strict_strtoul(buf, 10, &val)) 171 if (strict_strtoul(buf, 0, &gru_options))
171 gru_options = val; 172 return -EINVAL;
172 173
173 return count; 174 return count;
174} 175}
diff --git a/drivers/misc/sgi-xp/xpc_uv.c b/drivers/misc/sgi-xp/xpc_uv.c
index c76677afda1b..b5bbe59f9c57 100644
--- a/drivers/misc/sgi-xp/xpc_uv.c
+++ b/drivers/misc/sgi-xp/xpc_uv.c
@@ -106,7 +106,8 @@ xpc_get_gru_mq_irq_uv(struct xpc_gru_mq_uv *mq, int cpu, char *irq_name)
106 int mmr_pnode = uv_blade_to_pnode(mq->mmr_blade); 106 int mmr_pnode = uv_blade_to_pnode(mq->mmr_blade);
107 107
108#if defined CONFIG_X86_64 108#if defined CONFIG_X86_64
109 mq->irq = uv_setup_irq(irq_name, cpu, mq->mmr_blade, mq->mmr_offset); 109 mq->irq = uv_setup_irq(irq_name, cpu, mq->mmr_blade, mq->mmr_offset,
110 UV_AFFINITY_CPU);
110 if (mq->irq < 0) { 111 if (mq->irq < 0) {
111 dev_err(xpc_part, "uv_setup_irq() returned error=%d\n", 112 dev_err(xpc_part, "uv_setup_irq() returned error=%d\n",
112 -mq->irq); 113 -mq->irq);
@@ -136,7 +137,7 @@ static void
136xpc_release_gru_mq_irq_uv(struct xpc_gru_mq_uv *mq) 137xpc_release_gru_mq_irq_uv(struct xpc_gru_mq_uv *mq)
137{ 138{
138#if defined CONFIG_X86_64 139#if defined CONFIG_X86_64
139 uv_teardown_irq(mq->irq, mq->mmr_blade, mq->mmr_offset); 140 uv_teardown_irq(mq->irq);
140 141
141#elif defined CONFIG_IA64_GENERIC || defined CONFIG_IA64_SGI_UV 142#elif defined CONFIG_IA64_GENERIC || defined CONFIG_IA64_SGI_UV
142 int mmr_pnode; 143 int mmr_pnode;
diff --git a/drivers/mmc/host/omap.c b/drivers/mmc/host/omap.c
index e7a331de5733..b8fd7af1ceeb 100644
--- a/drivers/mmc/host/omap.c
+++ b/drivers/mmc/host/omap.c
@@ -1529,6 +1529,7 @@ static int mmc_omap_remove(struct platform_device *pdev)
1529 host->pdata->cleanup(&pdev->dev); 1529 host->pdata->cleanup(&pdev->dev);
1530 1530
1531 mmc_omap_fclk_enable(host, 0); 1531 mmc_omap_fclk_enable(host, 0);
1532 free_irq(host->irq, host);
1532 clk_put(host->fclk); 1533 clk_put(host->fclk);
1533 clk_disable(host->iclk); 1534 clk_disable(host->iclk);
1534 clk_put(host->iclk); 1535 clk_put(host->iclk);
diff --git a/drivers/mmc/host/pxamci.c b/drivers/mmc/host/pxamci.c
index b00d67319058..9fb480bb0e0a 100644
--- a/drivers/mmc/host/pxamci.c
+++ b/drivers/mmc/host/pxamci.c
@@ -760,6 +760,8 @@ static int pxamci_remove(struct platform_device *pdev)
760 if (mmc) { 760 if (mmc) {
761 struct pxamci_host *host = mmc_priv(mmc); 761 struct pxamci_host *host = mmc_priv(mmc);
762 762
763 mmc_remove_host(mmc);
764
763 if (host->pdata) { 765 if (host->pdata) {
764 gpio_cd = host->pdata->gpio_card_detect; 766 gpio_cd = host->pdata->gpio_card_detect;
765 gpio_ro = host->pdata->gpio_card_ro; 767 gpio_ro = host->pdata->gpio_card_ro;
@@ -779,8 +781,6 @@ static int pxamci_remove(struct platform_device *pdev)
779 if (host->pdata && host->pdata->exit) 781 if (host->pdata && host->pdata->exit)
780 host->pdata->exit(&pdev->dev, mmc); 782 host->pdata->exit(&pdev->dev, mmc);
781 783
782 mmc_remove_host(mmc);
783
784 pxamci_stop_clock(host); 784 pxamci_stop_clock(host);
785 writel(TXFIFO_WR_REQ|RXFIFO_RD_REQ|CLK_IS_OFF|STOP_CMD| 785 writel(TXFIFO_WR_REQ|RXFIFO_RD_REQ|CLK_IS_OFF|STOP_CMD|
786 END_CMD_RES|PRG_DONE|DATA_TRAN_DONE, 786 END_CMD_RES|PRG_DONE|DATA_TRAN_DONE,
diff --git a/drivers/mtd/maps/Kconfig b/drivers/mtd/maps/Kconfig
index 841e085ab74a..14be0755d7cd 100644
--- a/drivers/mtd/maps/Kconfig
+++ b/drivers/mtd/maps/Kconfig
@@ -486,6 +486,7 @@ config MTD_BFIN_ASYNC
486 486
487config MTD_GPIO_ADDR 487config MTD_GPIO_ADDR
488 tristate "GPIO-assisted Flash Chip Support" 488 tristate "GPIO-assisted Flash Chip Support"
489 depends on GENERIC_GPIO || GPIOLIB
489 depends on MTD_COMPLEX_MAPPINGS 490 depends on MTD_COMPLEX_MAPPINGS
490 select MTD_PARTITIONS 491 select MTD_PARTITIONS
491 help 492 help
diff --git a/drivers/mtd/maps/Makefile b/drivers/mtd/maps/Makefile
index 1d5cf8636723..ae2f6dbe43c3 100644
--- a/drivers/mtd/maps/Makefile
+++ b/drivers/mtd/maps/Makefile
@@ -58,4 +58,6 @@ obj-$(CONFIG_MTD_PLATRAM) += plat-ram.o
58obj-$(CONFIG_MTD_OMAP_NOR) += omap_nor.o 58obj-$(CONFIG_MTD_OMAP_NOR) += omap_nor.o
59obj-$(CONFIG_MTD_INTEL_VR_NOR) += intel_vr_nor.o 59obj-$(CONFIG_MTD_INTEL_VR_NOR) += intel_vr_nor.o
60obj-$(CONFIG_MTD_BFIN_ASYNC) += bfin-async-flash.o 60obj-$(CONFIG_MTD_BFIN_ASYNC) += bfin-async-flash.o
61obj-$(CONFIG_MTD_RBTX4939) += rbtx4939-flash.o
62obj-$(CONFIG_MTD_VMU) += vmu-flash.o
61obj-$(CONFIG_MTD_GPIO_ADDR) += gpio-addr-flash.o 63obj-$(CONFIG_MTD_GPIO_ADDR) += gpio-addr-flash.o
diff --git a/drivers/mtd/maps/gpio-addr-flash.c b/drivers/mtd/maps/gpio-addr-flash.c
index 44ef9a49a860..1ad5caf9fe69 100644
--- a/drivers/mtd/maps/gpio-addr-flash.c
+++ b/drivers/mtd/maps/gpio-addr-flash.c
@@ -13,7 +13,9 @@
13 * Licensed under the GPL-2 or later. 13 * Licensed under the GPL-2 or later.
14 */ 14 */
15 15
16#include <linux/gpio.h>
16#include <linux/init.h> 17#include <linux/init.h>
18#include <linux/io.h>
17#include <linux/kernel.h> 19#include <linux/kernel.h>
18#include <linux/module.h> 20#include <linux/module.h>
19#include <linux/mtd/mtd.h> 21#include <linux/mtd/mtd.h>
@@ -23,9 +25,6 @@
23#include <linux/platform_device.h> 25#include <linux/platform_device.h>
24#include <linux/types.h> 26#include <linux/types.h>
25 27
26#include <asm/gpio.h>
27#include <asm/io.h>
28
29#define pr_devinit(fmt, args...) ({ static const __devinitconst char __fmt[] = fmt; printk(__fmt, ## args); }) 28#define pr_devinit(fmt, args...) ({ static const __devinitconst char __fmt[] = fmt; printk(__fmt, ## args); })
30 29
31#define DRIVER_NAME "gpio-addr-flash" 30#define DRIVER_NAME "gpio-addr-flash"
diff --git a/drivers/mtd/maps/pcmciamtd.c b/drivers/mtd/maps/pcmciamtd.c
index d600c2deff73..689d6a79ffc0 100644
--- a/drivers/mtd/maps/pcmciamtd.c
+++ b/drivers/mtd/maps/pcmciamtd.c
@@ -118,11 +118,9 @@ static caddr_t remap_window(struct map_info *map, unsigned long to)
118 DEBUG(2, "Remapping window from 0x%8.8x to 0x%8.8x", 118 DEBUG(2, "Remapping window from 0x%8.8x to 0x%8.8x",
119 dev->offset, mrq.CardOffset); 119 dev->offset, mrq.CardOffset);
120 mrq.Page = 0; 120 mrq.Page = 0;
121 ret = pcmcia_map_mem_page(win, &mrq); 121 ret = pcmcia_map_mem_page(dev->p_dev, win, &mrq);
122 if (ret != 0) { 122 if (ret != 0)
123 cs_error(dev->p_dev, MapMemPage, ret);
124 return NULL; 123 return NULL;
125 }
126 dev->offset = mrq.CardOffset; 124 dev->offset = mrq.CardOffset;
127 } 125 }
128 return dev->win_base + (to & (dev->win_size-1)); 126 return dev->win_base + (to & (dev->win_size-1));
@@ -327,8 +325,6 @@ static void pcmciamtd_set_vpp(struct map_info *map, int on)
327 325
328 DEBUG(2, "dev = %p on = %d vpp = %d\n", dev, on, dev->vpp); 326 DEBUG(2, "dev = %p on = %d vpp = %d\n", dev, on, dev->vpp);
329 ret = pcmcia_modify_configuration(link, &mod); 327 ret = pcmcia_modify_configuration(link, &mod);
330 if (ret != 0)
331 cs_error(link, ModifyConfiguration, ret);
332} 328}
333 329
334 330
@@ -348,107 +344,116 @@ static void pcmciamtd_release(struct pcmcia_device *link)
348 iounmap(dev->win_base); 344 iounmap(dev->win_base);
349 dev->win_base = NULL; 345 dev->win_base = NULL;
350 } 346 }
351 pcmcia_release_window(link->win); 347 pcmcia_release_window(link, link->win);
352 } 348 }
353 pcmcia_disable_device(link); 349 pcmcia_disable_device(link);
354} 350}
355 351
356 352
357static void card_settings(struct pcmciamtd_dev *dev, struct pcmcia_device *link, int *new_name) 353#ifdef CONFIG_MTD_DEBUG
354static int pcmciamtd_cistpl_format(struct pcmcia_device *p_dev,
355 tuple_t *tuple,
356 void *priv_data)
358{ 357{
359 int rc;
360 tuple_t tuple;
361 cisparse_t parse; 358 cisparse_t parse;
362 u_char buf[64];
363
364 tuple.Attributes = 0;
365 tuple.TupleData = (cisdata_t *)buf;
366 tuple.TupleDataMax = sizeof(buf);
367 tuple.TupleOffset = 0;
368 tuple.DesiredTuple = RETURN_FIRST_TUPLE;
369
370 rc = pcmcia_get_first_tuple(link, &tuple);
371 while (rc == 0) {
372 rc = pcmcia_get_tuple_data(link, &tuple);
373 if (rc != 0) {
374 cs_error(link, GetTupleData, rc);
375 break;
376 }
377 rc = pcmcia_parse_tuple(&tuple, &parse);
378 if (rc != 0) {
379 cs_error(link, ParseTuple, rc);
380 break;
381 }
382 359
383 switch(tuple.TupleCode) { 360 if (!pcmcia_parse_tuple(tuple, &parse)) {
384 case CISTPL_FORMAT: { 361 cistpl_format_t *t = &parse.format;
385 cistpl_format_t *t = &parse.format; 362 (void)t; /* Shut up, gcc */
386 (void)t; /* Shut up, gcc */ 363 DEBUG(2, "Format type: %u, Error Detection: %u, offset = %u, length =%u",
387 DEBUG(2, "Format type: %u, Error Detection: %u, offset = %u, length =%u", 364 t->type, t->edc, t->offset, t->length);
388 t->type, t->edc, t->offset, t->length); 365 }
389 break; 366 return -ENOSPC;
367}
390 368
391 } 369static int pcmciamtd_cistpl_jedec(struct pcmcia_device *p_dev,
370 tuple_t *tuple,
371 void *priv_data)
372{
373 cisparse_t parse;
374 int i;
392 375
393 case CISTPL_DEVICE: { 376 if (!pcmcia_parse_tuple(tuple, &parse)) {
394 cistpl_device_t *t = &parse.device; 377 cistpl_jedec_t *t = &parse.jedec;
395 int i; 378 for (i = 0; i < t->nid; i++)
396 DEBUG(2, "Common memory:"); 379 DEBUG(2, "JEDEC: 0x%02x 0x%02x", t->id[i].mfr, t->id[i].info);
397 dev->pcmcia_map.size = t->dev[0].size; 380 }
398 for(i = 0; i < t->ndev; i++) { 381 return -ENOSPC;
399 DEBUG(2, "Region %d, type = %u", i, t->dev[i].type); 382}
400 DEBUG(2, "Region %d, wp = %u", i, t->dev[i].wp); 383#endif
401 DEBUG(2, "Region %d, speed = %u ns", i, t->dev[i].speed);
402 DEBUG(2, "Region %d, size = %u bytes", i, t->dev[i].size);
403 }
404 break;
405 }
406 384
407 case CISTPL_VERS_1: { 385static int pcmciamtd_cistpl_device(struct pcmcia_device *p_dev,
408 cistpl_vers_1_t *t = &parse.version_1; 386 tuple_t *tuple,
409 int i; 387 void *priv_data)
410 if(t->ns) { 388{
411 dev->mtd_name[0] = '\0'; 389 struct pcmciamtd_dev *dev = priv_data;
412 for(i = 0; i < t->ns; i++) { 390 cisparse_t parse;
413 if(i) 391 cistpl_device_t *t = &parse.device;
414 strcat(dev->mtd_name, " "); 392 int i;
415 strcat(dev->mtd_name, t->str+t->ofs[i]);
416 }
417 }
418 DEBUG(2, "Found name: %s", dev->mtd_name);
419 break;
420 }
421 393
422 case CISTPL_JEDEC_C: { 394 if (pcmcia_parse_tuple(tuple, &parse))
423 cistpl_jedec_t *t = &parse.jedec; 395 return -EINVAL;
424 int i; 396
425 for(i = 0; i < t->nid; i++) { 397 DEBUG(2, "Common memory:");
426 DEBUG(2, "JEDEC: 0x%02x 0x%02x", t->id[i].mfr, t->id[i].info); 398 dev->pcmcia_map.size = t->dev[0].size;
427 } 399 /* from here on: DEBUG only */
428 break; 400 for (i = 0; i < t->ndev; i++) {
429 } 401 DEBUG(2, "Region %d, type = %u", i, t->dev[i].type);
402 DEBUG(2, "Region %d, wp = %u", i, t->dev[i].wp);
403 DEBUG(2, "Region %d, speed = %u ns", i, t->dev[i].speed);
404 DEBUG(2, "Region %d, size = %u bytes", i, t->dev[i].size);
405 }
406 return 0;
407}
430 408
431 case CISTPL_DEVICE_GEO: { 409static int pcmciamtd_cistpl_geo(struct pcmcia_device *p_dev,
432 cistpl_device_geo_t *t = &parse.device_geo; 410 tuple_t *tuple,
433 int i; 411 void *priv_data)
434 dev->pcmcia_map.bankwidth = t->geo[0].buswidth; 412{
435 for(i = 0; i < t->ngeo; i++) { 413 struct pcmciamtd_dev *dev = priv_data;
436 DEBUG(2, "region: %d bankwidth = %u", i, t->geo[i].buswidth); 414 cisparse_t parse;
437 DEBUG(2, "region: %d erase_block = %u", i, t->geo[i].erase_block); 415 cistpl_device_geo_t *t = &parse.device_geo;
438 DEBUG(2, "region: %d read_block = %u", i, t->geo[i].read_block); 416 int i;
439 DEBUG(2, "region: %d write_block = %u", i, t->geo[i].write_block);
440 DEBUG(2, "region: %d partition = %u", i, t->geo[i].partition);
441 DEBUG(2, "region: %d interleave = %u", i, t->geo[i].interleave);
442 }
443 break;
444 }
445 417
446 default: 418 if (pcmcia_parse_tuple(tuple, &parse))
447 DEBUG(2, "Unknown tuple code %d", tuple.TupleCode); 419 return -EINVAL;
448 } 420
421 dev->pcmcia_map.bankwidth = t->geo[0].buswidth;
422 /* from here on: DEBUG only */
423 for (i = 0; i < t->ngeo; i++) {
424 DEBUG(2, "region: %d bankwidth = %u", i, t->geo[i].buswidth);
425 DEBUG(2, "region: %d erase_block = %u", i, t->geo[i].erase_block);
426 DEBUG(2, "region: %d read_block = %u", i, t->geo[i].read_block);
427 DEBUG(2, "region: %d write_block = %u", i, t->geo[i].write_block);
428 DEBUG(2, "region: %d partition = %u", i, t->geo[i].partition);
429 DEBUG(2, "region: %d interleave = %u", i, t->geo[i].interleave);
430 }
431 return 0;
432}
433
434
435static void card_settings(struct pcmciamtd_dev *dev, struct pcmcia_device *link, int *new_name)
436{
437 int i;
449 438
450 rc = pcmcia_get_next_tuple(link, &tuple); 439 if (p_dev->prod_id[0]) {
440 dev->mtd_name[0] = '\0';
441 for (i = 0; i < 4; i++) {
442 if (i)
443 strcat(dev->mtd_name, " ");
444 if (p_dev->prod_id[i])
445 strcat(dev->mtd_name, p_dev->prod_id[i]);
446 }
447 DEBUG(2, "Found name: %s", dev->mtd_name);
451 } 448 }
449
450#ifdef CONFIG_MTD_DEBUG
451 pcmcia_loop_tuple(p_dev, CISTPL_FORMAT, pcmciamtd_cistpl_format, NULL);
452 pcmcia_loop_tuple(p_dev, CISTPL_JEDEC_C, pcmciamtd_cistpl_jedec, NULL);
453#endif
454 pcmcia_loop_tuple(p_dev, CISTPL_DEVICE, pcmciamtd_cistpl_device, dev);
455 pcmcia_loop_tuple(p_dev, CISTPL_DEVICE_GEO, pcmciamtd_cistpl_geo, dev);
456
452 if(!dev->pcmcia_map.size) 457 if(!dev->pcmcia_map.size)
453 dev->pcmcia_map.size = MAX_PCMCIA_ADDR; 458 dev->pcmcia_map.size = MAX_PCMCIA_ADDR;
454 459
@@ -481,16 +486,12 @@ static void card_settings(struct pcmciamtd_dev *dev, struct pcmcia_device *link,
481 * MTD device available to the system. 486 * MTD device available to the system.
482 */ 487 */
483 488
484#define CS_CHECK(fn, ret) \
485do { last_fn = (fn); if ((last_ret = (ret)) != 0) goto cs_failed; } while (0)
486
487static int pcmciamtd_config(struct pcmcia_device *link) 489static int pcmciamtd_config(struct pcmcia_device *link)
488{ 490{
489 struct pcmciamtd_dev *dev = link->priv; 491 struct pcmciamtd_dev *dev = link->priv;
490 struct mtd_info *mtd = NULL; 492 struct mtd_info *mtd = NULL;
491 cs_status_t status; 493 cs_status_t status;
492 win_req_t req; 494 win_req_t req;
493 int last_ret = 0, last_fn = 0;
494 int ret; 495 int ret;
495 int i; 496 int i;
496 static char *probes[] = { "jedec_probe", "cfi_probe" }; 497 static char *probes[] = { "jedec_probe", "cfi_probe" };
@@ -529,7 +530,7 @@ static int pcmciamtd_config(struct pcmcia_device *link)
529 int ret; 530 int ret;
530 DEBUG(2, "requesting window with size = %dKiB memspeed = %d", 531 DEBUG(2, "requesting window with size = %dKiB memspeed = %d",
531 req.Size >> 10, req.AccessSpeed); 532 req.Size >> 10, req.AccessSpeed);
532 ret = pcmcia_request_window(&link, &req, &link->win); 533 ret = pcmcia_request_window(link, &req, &link->win);
533 DEBUG(2, "ret = %d dev->win_size = %d", ret, dev->win_size); 534 DEBUG(2, "ret = %d dev->win_size = %d", ret, dev->win_size);
534 if(ret) { 535 if(ret) {
535 req.Size >>= 1; 536 req.Size >>= 1;
@@ -577,7 +578,6 @@ static int pcmciamtd_config(struct pcmcia_device *link)
577 DEBUG(2, "Setting Configuration"); 578 DEBUG(2, "Setting Configuration");
578 ret = pcmcia_request_configuration(link, &link->conf); 579 ret = pcmcia_request_configuration(link, &link->conf);
579 if (ret != 0) { 580 if (ret != 0) {
580 cs_error(link, RequestConfiguration, ret);
581 if (dev->win_base) { 581 if (dev->win_base) {
582 iounmap(dev->win_base); 582 iounmap(dev->win_base);
583 dev->win_base = NULL; 583 dev->win_base = NULL;
@@ -652,8 +652,7 @@ static int pcmciamtd_config(struct pcmcia_device *link)
652 link->dev_node = &dev->node; 652 link->dev_node = &dev->node;
653 return 0; 653 return 0;
654 654
655 cs_failed: 655 failed:
656 cs_error(link, last_fn, last_ret);
657 err("CS Error, exiting"); 656 err("CS Error, exiting");
658 pcmciamtd_release(link); 657 pcmciamtd_release(link);
659 return -ENODEV; 658 return -ENODEV;
diff --git a/drivers/mtd/maps/sa1100-flash.c b/drivers/mtd/maps/sa1100-flash.c
index fdb97f3d30e9..d7a47574d21e 100644
--- a/drivers/mtd/maps/sa1100-flash.c
+++ b/drivers/mtd/maps/sa1100-flash.c
@@ -209,8 +209,8 @@ static int sa1100_probe_subdev(struct sa_subdev_info *subdev, struct resource *r
209 } 209 }
210 subdev->mtd->owner = THIS_MODULE; 210 subdev->mtd->owner = THIS_MODULE;
211 211
212 printk(KERN_INFO "SA1100 flash: CFI device at 0x%08lx, %dMiB, " 212 printk(KERN_INFO "SA1100 flash: CFI device at 0x%08lx, %uMiB, %d-bit\n",
213 "%d-bit\n", phys, subdev->mtd->size >> 20, 213 phys, (unsigned)(subdev->mtd->size >> 20),
214 subdev->map.bankwidth * 8); 214 subdev->map.bankwidth * 8);
215 215
216 return 0; 216 return 0;
diff --git a/drivers/mtd/nand/nand_base.c b/drivers/mtd/nand/nand_base.c
index 22113865438b..2957cc70da3d 100644
--- a/drivers/mtd/nand/nand_base.c
+++ b/drivers/mtd/nand/nand_base.c
@@ -761,6 +761,7 @@ static int nand_wait(struct mtd_info *mtd, struct nand_chip *chip)
761 * @mtd: mtd info structure 761 * @mtd: mtd info structure
762 * @chip: nand chip info structure 762 * @chip: nand chip info structure
763 * @buf: buffer to store read data 763 * @buf: buffer to store read data
764 * @page: page number to read
764 * 765 *
765 * Not for syndrome calculating ecc controllers, which use a special oob layout 766 * Not for syndrome calculating ecc controllers, which use a special oob layout
766 */ 767 */
@@ -777,6 +778,7 @@ static int nand_read_page_raw(struct mtd_info *mtd, struct nand_chip *chip,
777 * @mtd: mtd info structure 778 * @mtd: mtd info structure
778 * @chip: nand chip info structure 779 * @chip: nand chip info structure
779 * @buf: buffer to store read data 780 * @buf: buffer to store read data
781 * @page: page number to read
780 * 782 *
781 * We need a special oob layout and handling even when OOB isn't used. 783 * We need a special oob layout and handling even when OOB isn't used.
782 */ 784 */
@@ -818,6 +820,7 @@ static int nand_read_page_raw_syndrome(struct mtd_info *mtd, struct nand_chip *c
818 * @mtd: mtd info structure 820 * @mtd: mtd info structure
819 * @chip: nand chip info structure 821 * @chip: nand chip info structure
820 * @buf: buffer to store read data 822 * @buf: buffer to store read data
823 * @page: page number to read
821 */ 824 */
822static int nand_read_page_swecc(struct mtd_info *mtd, struct nand_chip *chip, 825static int nand_read_page_swecc(struct mtd_info *mtd, struct nand_chip *chip,
823 uint8_t *buf, int page) 826 uint8_t *buf, int page)
@@ -939,6 +942,7 @@ static int nand_read_subpage(struct mtd_info *mtd, struct nand_chip *chip, uint3
939 * @mtd: mtd info structure 942 * @mtd: mtd info structure
940 * @chip: nand chip info structure 943 * @chip: nand chip info structure
941 * @buf: buffer to store read data 944 * @buf: buffer to store read data
945 * @page: page number to read
942 * 946 *
943 * Not for syndrome calculating ecc controllers which need a special oob layout 947 * Not for syndrome calculating ecc controllers which need a special oob layout
944 */ 948 */
@@ -983,6 +987,7 @@ static int nand_read_page_hwecc(struct mtd_info *mtd, struct nand_chip *chip,
983 * @mtd: mtd info structure 987 * @mtd: mtd info structure
984 * @chip: nand chip info structure 988 * @chip: nand chip info structure
985 * @buf: buffer to store read data 989 * @buf: buffer to store read data
990 * @page: page number to read
986 * 991 *
987 * Hardware ECC for large page chips, require OOB to be read first. 992 * Hardware ECC for large page chips, require OOB to be read first.
988 * For this ECC mode, the write_page method is re-used from ECC_HW. 993 * For this ECC mode, the write_page method is re-used from ECC_HW.
@@ -1031,6 +1036,7 @@ static int nand_read_page_hwecc_oob_first(struct mtd_info *mtd,
1031 * @mtd: mtd info structure 1036 * @mtd: mtd info structure
1032 * @chip: nand chip info structure 1037 * @chip: nand chip info structure
1033 * @buf: buffer to store read data 1038 * @buf: buffer to store read data
1039 * @page: page number to read
1034 * 1040 *
1035 * The hw generator calculates the error syndrome automatically. Therefor 1041 * The hw generator calculates the error syndrome automatically. Therefor
1036 * we need a special oob layout and handling. 1042 * we need a special oob layout and handling.
diff --git a/drivers/net/Kconfig b/drivers/net/Kconfig
index e19ca4bb7510..b2f71f79baaf 100644
--- a/drivers/net/Kconfig
+++ b/drivers/net/Kconfig
@@ -975,7 +975,7 @@ config ENC28J60_WRITEVERIFY
975 975
976config ETHOC 976config ETHOC
977 tristate "OpenCores 10/100 Mbps Ethernet MAC support" 977 tristate "OpenCores 10/100 Mbps Ethernet MAC support"
978 depends on NET_ETHERNET && HAS_IOMEM 978 depends on NET_ETHERNET && HAS_IOMEM && HAS_DMA
979 select MII 979 select MII
980 select PHYLIB 980 select PHYLIB
981 select CRC32 981 select CRC32
diff --git a/drivers/net/arm/ep93xx_eth.c b/drivers/net/arm/ep93xx_eth.c
index 2be49c817995..b25467ac895c 100644
--- a/drivers/net/arm/ep93xx_eth.c
+++ b/drivers/net/arm/ep93xx_eth.c
@@ -628,15 +628,6 @@ static int ep93xx_open(struct net_device *dev)
628 if (ep93xx_alloc_buffers(ep)) 628 if (ep93xx_alloc_buffers(ep))
629 return -ENOMEM; 629 return -ENOMEM;
630 630
631 if (is_zero_ether_addr(dev->dev_addr)) {
632 random_ether_addr(dev->dev_addr);
633 printk(KERN_INFO "%s: generated random MAC address "
634 "%.2x:%.2x:%.2x:%.2x:%.2x:%.2x.\n", dev->name,
635 dev->dev_addr[0], dev->dev_addr[1],
636 dev->dev_addr[2], dev->dev_addr[3],
637 dev->dev_addr[4], dev->dev_addr[5]);
638 }
639
640 napi_enable(&ep->napi); 631 napi_enable(&ep->napi);
641 632
642 if (ep93xx_start_hw(dev)) { 633 if (ep93xx_start_hw(dev)) {
@@ -877,6 +868,9 @@ static int ep93xx_eth_probe(struct platform_device *pdev)
877 ep->mii.mdio_write = ep93xx_mdio_write; 868 ep->mii.mdio_write = ep93xx_mdio_write;
878 ep->mdc_divisor = 40; /* Max HCLK 100 MHz, min MDIO clk 2.5 MHz. */ 869 ep->mdc_divisor = 40; /* Max HCLK 100 MHz, min MDIO clk 2.5 MHz. */
879 870
871 if (is_zero_ether_addr(dev->dev_addr))
872 random_ether_addr(dev->dev_addr);
873
880 err = register_netdev(dev); 874 err = register_netdev(dev);
881 if (err) { 875 if (err) {
882 dev_err(&pdev->dev, "Failed to register netdev\n"); 876 dev_err(&pdev->dev, "Failed to register netdev\n");
diff --git a/drivers/net/au1000_eth.c b/drivers/net/au1000_eth.c
index ce6f1ac25df8..3f4b4300f533 100644
--- a/drivers/net/au1000_eth.c
+++ b/drivers/net/au1000_eth.c
@@ -1088,7 +1088,14 @@ static struct net_device * au1000_probe(int port_num)
1088 return NULL; 1088 return NULL;
1089 } 1089 }
1090 1090
1091 if ((err = register_netdev(dev)) != 0) { 1091 dev->base_addr = base;
1092 dev->irq = irq;
1093 dev->netdev_ops = &au1000_netdev_ops;
1094 SET_ETHTOOL_OPS(dev, &au1000_ethtool_ops);
1095 dev->watchdog_timeo = ETH_TX_TIMEOUT;
1096
1097 err = register_netdev(dev);
1098 if (err != 0) {
1092 printk(KERN_ERR "%s: Cannot register net device, error %d\n", 1099 printk(KERN_ERR "%s: Cannot register net device, error %d\n",
1093 DRV_NAME, err); 1100 DRV_NAME, err);
1094 free_netdev(dev); 1101 free_netdev(dev);
@@ -1209,12 +1216,6 @@ static struct net_device * au1000_probe(int port_num)
1209 aup->tx_db_inuse[i] = pDB; 1216 aup->tx_db_inuse[i] = pDB;
1210 } 1217 }
1211 1218
1212 dev->base_addr = base;
1213 dev->irq = irq;
1214 dev->netdev_ops = &au1000_netdev_ops;
1215 SET_ETHTOOL_OPS(dev, &au1000_ethtool_ops);
1216 dev->watchdog_timeo = ETH_TX_TIMEOUT;
1217
1218 /* 1219 /*
1219 * The boot code uses the ethernet controller, so reset it to start 1220 * The boot code uses the ethernet controller, so reset it to start
1220 * fresh. au1000_init() expects that the device is in reset state. 1221 * fresh. au1000_init() expects that the device is in reset state.
diff --git a/drivers/net/b44.c b/drivers/net/b44.c
index e046943ef29d..2a9132343b66 100644
--- a/drivers/net/b44.c
+++ b/drivers/net/b44.c
@@ -912,9 +912,6 @@ static irqreturn_t b44_interrupt(int irq, void *dev_id)
912 bp->istat = istat; 912 bp->istat = istat;
913 __b44_disable_ints(bp); 913 __b44_disable_ints(bp);
914 __napi_schedule(&bp->napi); 914 __napi_schedule(&bp->napi);
915 } else {
916 printk(KERN_ERR PFX "%s: Error, poll already scheduled\n",
917 dev->name);
918 } 915 }
919 916
920irq_ack: 917irq_ack:
diff --git a/drivers/net/benet/be.h b/drivers/net/benet/be.h
index a80da0e14a52..3b79a225628a 100644
--- a/drivers/net/benet/be.h
+++ b/drivers/net/benet/be.h
@@ -259,6 +259,8 @@ struct be_adapter {
259 u32 port_num; 259 u32 port_num;
260 bool promiscuous; 260 bool promiscuous;
261 u32 cap; 261 u32 cap;
262 u32 rx_fc; /* Rx flow control */
263 u32 tx_fc; /* Tx flow control */
262}; 264};
263 265
264extern const struct ethtool_ops be_ethtool_ops; 266extern const struct ethtool_ops be_ethtool_ops;
diff --git a/drivers/net/benet/be_cmds.h b/drivers/net/benet/be_cmds.h
index 49953787e41c..e5f9676cf1bc 100644
--- a/drivers/net/benet/be_cmds.h
+++ b/drivers/net/benet/be_cmds.h
@@ -68,7 +68,7 @@ enum {
68#define CQE_STATUS_COMPL_MASK 0xFFFF 68#define CQE_STATUS_COMPL_MASK 0xFFFF
69#define CQE_STATUS_COMPL_SHIFT 0 /* bits 0 - 15 */ 69#define CQE_STATUS_COMPL_SHIFT 0 /* bits 0 - 15 */
70#define CQE_STATUS_EXTD_MASK 0xFFFF 70#define CQE_STATUS_EXTD_MASK 0xFFFF
71#define CQE_STATUS_EXTD_SHIFT 0 /* bits 0 - 15 */ 71#define CQE_STATUS_EXTD_SHIFT 16 /* bits 16 - 31 */
72 72
73struct be_mcc_compl { 73struct be_mcc_compl {
74 u32 status; /* dword 0 */ 74 u32 status; /* dword 0 */
diff --git a/drivers/net/benet/be_ethtool.c b/drivers/net/benet/be_ethtool.c
index cda5bf2fc50a..f0fd95b43c07 100644
--- a/drivers/net/benet/be_ethtool.c
+++ b/drivers/net/benet/be_ethtool.c
@@ -323,10 +323,12 @@ be_set_pauseparam(struct net_device *netdev, struct ethtool_pauseparam *ecmd)
323 323
324 if (ecmd->autoneg != 0) 324 if (ecmd->autoneg != 0)
325 return -EINVAL; 325 return -EINVAL;
326 adapter->tx_fc = ecmd->tx_pause;
327 adapter->rx_fc = ecmd->rx_pause;
326 328
327 status = be_cmd_set_flow_control(adapter, ecmd->tx_pause, 329 status = be_cmd_set_flow_control(adapter,
328 ecmd->rx_pause); 330 adapter->tx_fc, adapter->rx_fc);
329 if (!status) 331 if (status)
330 dev_warn(&adapter->pdev->dev, "Pause param set failed.\n"); 332 dev_warn(&adapter->pdev->dev, "Pause param set failed.\n");
331 333
332 return status; 334 return status;
diff --git a/drivers/net/benet/be_main.c b/drivers/net/benet/be_main.c
index 1f941f027718..876b357101fa 100644
--- a/drivers/net/benet/be_main.c
+++ b/drivers/net/benet/be_main.c
@@ -1610,11 +1610,21 @@ static int be_open(struct net_device *netdev)
1610 1610
1611 status = be_cmd_link_status_query(adapter, &link_up); 1611 status = be_cmd_link_status_query(adapter, &link_up);
1612 if (status) 1612 if (status)
1613 return status; 1613 goto ret_sts;
1614 be_link_status_update(adapter, link_up); 1614 be_link_status_update(adapter, link_up);
1615 1615
1616 status = be_vid_config(adapter);
1617 if (status)
1618 goto ret_sts;
1619
1620 status = be_cmd_set_flow_control(adapter,
1621 adapter->tx_fc, adapter->rx_fc);
1622 if (status)
1623 goto ret_sts;
1624
1616 schedule_delayed_work(&adapter->work, msecs_to_jiffies(100)); 1625 schedule_delayed_work(&adapter->work, msecs_to_jiffies(100));
1617 return 0; 1626ret_sts:
1627 return status;
1618} 1628}
1619 1629
1620static int be_setup(struct be_adapter *adapter) 1630static int be_setup(struct be_adapter *adapter)
@@ -1648,17 +1658,8 @@ static int be_setup(struct be_adapter *adapter)
1648 if (status != 0) 1658 if (status != 0)
1649 goto rx_qs_destroy; 1659 goto rx_qs_destroy;
1650 1660
1651 status = be_vid_config(adapter);
1652 if (status != 0)
1653 goto mccqs_destroy;
1654
1655 status = be_cmd_set_flow_control(adapter, true, true);
1656 if (status != 0)
1657 goto mccqs_destroy;
1658 return 0; 1661 return 0;
1659 1662
1660mccqs_destroy:
1661 be_mcc_queues_destroy(adapter);
1662rx_qs_destroy: 1663rx_qs_destroy:
1663 be_rx_queues_destroy(adapter); 1664 be_rx_queues_destroy(adapter);
1664tx_qs_destroy: 1665tx_qs_destroy:
@@ -1909,6 +1910,10 @@ static void be_netdev_init(struct net_device *netdev)
1909 1910
1910 adapter->rx_csum = true; 1911 adapter->rx_csum = true;
1911 1912
1913 /* Default settings for Rx and Tx flow control */
1914 adapter->rx_fc = true;
1915 adapter->tx_fc = true;
1916
1912 netif_set_gso_max_size(netdev, 65535); 1917 netif_set_gso_max_size(netdev, 65535);
1913 1918
1914 BE_SET_NETDEV_OPS(netdev, &be_netdev_ops); 1919 BE_SET_NETDEV_OPS(netdev, &be_netdev_ops);
@@ -2171,6 +2176,7 @@ static int be_suspend(struct pci_dev *pdev, pm_message_t state)
2171 be_close(netdev); 2176 be_close(netdev);
2172 rtnl_unlock(); 2177 rtnl_unlock();
2173 } 2178 }
2179 be_cmd_get_flow_control(adapter, &adapter->tx_fc, &adapter->rx_fc);
2174 be_clear(adapter); 2180 be_clear(adapter);
2175 2181
2176 pci_save_state(pdev); 2182 pci_save_state(pdev);
diff --git a/drivers/net/can/Kconfig b/drivers/net/can/Kconfig
index df32c109b7ac..772f6d2489ce 100644
--- a/drivers/net/can/Kconfig
+++ b/drivers/net/can/Kconfig
@@ -35,66 +35,16 @@ config CAN_CALC_BITTIMING
35 arguments "tq", "prop_seg", "phase_seg1", "phase_seg2" and "sjw". 35 arguments "tq", "prop_seg", "phase_seg1", "phase_seg2" and "sjw".
36 If unsure, say Y. 36 If unsure, say Y.
37 37
38config CAN_SJA1000
39 depends on CAN_DEV && HAS_IOMEM
40 tristate "Philips SJA1000"
41 ---help---
42 Driver for the SJA1000 CAN controllers from Philips or NXP
43
44config CAN_SJA1000_ISA
45 depends on CAN_SJA1000 && ISA
46 tristate "ISA Bus based legacy SJA1000 driver"
47 ---help---
48 This driver adds legacy support for SJA1000 chips connected to
49 the ISA bus using I/O port, memory mapped or indirect access.
50
51config CAN_SJA1000_PLATFORM
52 depends on CAN_SJA1000
53 tristate "Generic Platform Bus based SJA1000 driver"
54 ---help---
55 This driver adds support for the SJA1000 chips connected to
56 the "platform bus" (Linux abstraction for directly to the
57 processor attached devices). Which can be found on various
58 boards from Phytec (http://www.phytec.de) like the PCM027,
59 PCM038.
60
61config CAN_SJA1000_OF_PLATFORM
62 depends on CAN_SJA1000 && PPC_OF
63 tristate "Generic OF Platform Bus based SJA1000 driver"
64 ---help---
65 This driver adds support for the SJA1000 chips connected to
66 the OpenFirmware "platform bus" found on embedded systems with
67 OpenFirmware bindings, e.g. if you have a PowerPC based system
68 you may want to enable this option.
69
70config CAN_EMS_PCI
71 tristate "EMS CPC-PCI, CPC-PCIe and CPC-104P Card"
72 depends on PCI && CAN_SJA1000
73 ---help---
74 This driver is for the one, two or four channel CPC-PCI,
75 CPC-PCIe and CPC-104P cards from EMS Dr. Thomas Wuensche
76 (http://www.ems-wuensche.de).
77
78config CAN_EMS_USB
79 tristate "EMS CPC-USB/ARM7 CAN/USB interface"
80 depends on USB && CAN_DEV
81 ---help---
82 This driver is for the one channel CPC-USB/ARM7 CAN/USB interface
83 from from EMS Dr. Thomas Wuensche (http://www.ems-wuensche.de).
84
85config CAN_KVASER_PCI
86 tristate "Kvaser PCIcanx and Kvaser PCIcan PCI Cards"
87 depends on PCI && CAN_SJA1000
88 ---help---
89 This driver is for the the PCIcanx and PCIcan cards (1, 2 or
90 4 channel) from Kvaser (http://www.kvaser.com).
91
92config CAN_AT91 38config CAN_AT91
93 tristate "Atmel AT91 onchip CAN controller" 39 tristate "Atmel AT91 onchip CAN controller"
94 depends on CAN && CAN_DEV && ARCH_AT91SAM9263 40 depends on CAN_DEV && ARCH_AT91SAM9263
95 ---help--- 41 ---help---
96 This is a driver for the SoC CAN controller in Atmel's AT91SAM9263. 42 This is a driver for the SoC CAN controller in Atmel's AT91SAM9263.
97 43
44source "drivers/net/can/sja1000/Kconfig"
45
46source "drivers/net/can/usb/Kconfig"
47
98config CAN_DEBUG_DEVICES 48config CAN_DEBUG_DEVICES
99 bool "CAN devices debugging messages" 49 bool "CAN devices debugging messages"
100 depends on CAN 50 depends on CAN
diff --git a/drivers/net/can/dev.c b/drivers/net/can/dev.c
index f0b9a1e1db46..2868fe842a41 100644
--- a/drivers/net/can/dev.c
+++ b/drivers/net/can/dev.c
@@ -589,6 +589,22 @@ static int can_changelink(struct net_device *dev,
589 return 0; 589 return 0;
590} 590}
591 591
592static size_t can_get_size(const struct net_device *dev)
593{
594 struct can_priv *priv = netdev_priv(dev);
595 size_t size;
596
597 size = nla_total_size(sizeof(u32)); /* IFLA_CAN_STATE */
598 size += sizeof(struct can_ctrlmode); /* IFLA_CAN_CTRLMODE */
599 size += nla_total_size(sizeof(u32)); /* IFLA_CAN_RESTART_MS */
600 size += sizeof(struct can_bittiming); /* IFLA_CAN_BITTIMING */
601 size += sizeof(struct can_clock); /* IFLA_CAN_CLOCK */
602 if (priv->bittiming_const) /* IFLA_CAN_BITTIMING_CONST */
603 size += sizeof(struct can_bittiming_const);
604
605 return size;
606}
607
592static int can_fill_info(struct sk_buff *skb, const struct net_device *dev) 608static int can_fill_info(struct sk_buff *skb, const struct net_device *dev)
593{ 609{
594 struct can_priv *priv = netdev_priv(dev); 610 struct can_priv *priv = netdev_priv(dev);
@@ -613,6 +629,11 @@ nla_put_failure:
613 return -EMSGSIZE; 629 return -EMSGSIZE;
614} 630}
615 631
632static size_t can_get_xstats_size(const struct net_device *dev)
633{
634 return sizeof(struct can_device_stats);
635}
636
616static int can_fill_xstats(struct sk_buff *skb, const struct net_device *dev) 637static int can_fill_xstats(struct sk_buff *skb, const struct net_device *dev)
617{ 638{
618 struct can_priv *priv = netdev_priv(dev); 639 struct can_priv *priv = netdev_priv(dev);
@@ -639,7 +660,9 @@ static struct rtnl_link_ops can_link_ops __read_mostly = {
639 .setup = can_setup, 660 .setup = can_setup,
640 .newlink = can_newlink, 661 .newlink = can_newlink,
641 .changelink = can_changelink, 662 .changelink = can_changelink,
663 .get_size = can_get_size,
642 .fill_info = can_fill_info, 664 .fill_info = can_fill_info,
665 .get_xstats_size = can_get_xstats_size,
643 .fill_xstats = can_fill_xstats, 666 .fill_xstats = can_fill_xstats,
644}; 667};
645 668
diff --git a/drivers/net/can/sja1000/Kconfig b/drivers/net/can/sja1000/Kconfig
new file mode 100644
index 000000000000..4c674927f247
--- /dev/null
+++ b/drivers/net/can/sja1000/Kconfig
@@ -0,0 +1,47 @@
1menuconfig CAN_SJA1000
2 tristate "Philips/NXP SJA1000 devices"
3 depends on CAN_DEV && HAS_IOMEM
4
5if CAN_SJA1000
6
7config CAN_SJA1000_ISA
8 tristate "ISA Bus based legacy SJA1000 driver"
9 depends on ISA
10 ---help---
11 This driver adds legacy support for SJA1000 chips connected to
12 the ISA bus using I/O port, memory mapped or indirect access.
13
14config CAN_SJA1000_PLATFORM
15 tristate "Generic Platform Bus based SJA1000 driver"
16 ---help---
17 This driver adds support for the SJA1000 chips connected to
18 the "platform bus" (Linux abstraction for directly to the
19 processor attached devices). Which can be found on various
20 boards from Phytec (http://www.phytec.de) like the PCM027,
21 PCM038.
22
23config CAN_SJA1000_OF_PLATFORM
24 tristate "Generic OF Platform Bus based SJA1000 driver"
25 depends on PPC_OF
26 ---help---
27 This driver adds support for the SJA1000 chips connected to
28 the OpenFirmware "platform bus" found on embedded systems with
29 OpenFirmware bindings, e.g. if you have a PowerPC based system
30 you may want to enable this option.
31
32config CAN_EMS_PCI
33 tristate "EMS CPC-PCI, CPC-PCIe and CPC-104P Card"
34 depends on PCI
35 ---help---
36 This driver is for the one, two or four channel CPC-PCI,
37 CPC-PCIe and CPC-104P cards from EMS Dr. Thomas Wuensche
38 (http://www.ems-wuensche.de).
39
40config CAN_KVASER_PCI
41 tristate "Kvaser PCIcanx and Kvaser PCIcan PCI Cards"
42 depends on PCI
43 ---help---
44 This driver is for the the PCIcanx and PCIcan cards (1, 2 or
45 4 channel) from Kvaser (http://www.kvaser.com).
46
47endif
diff --git a/drivers/net/can/usb/Kconfig b/drivers/net/can/usb/Kconfig
new file mode 100644
index 000000000000..bbc78e0b8a15
--- /dev/null
+++ b/drivers/net/can/usb/Kconfig
@@ -0,0 +1,10 @@
1menu "CAN USB interfaces"
2 depends on USB && CAN_DEV
3
4config CAN_EMS_USB
5 tristate "EMS CPC-USB/ARM7 CAN/USB interface"
6 ---help---
7 This driver is for the one channel CPC-USB/ARM7 CAN/USB interface
8 from from EMS Dr. Thomas Wuensche (http://www.ems-wuensche.de).
9
10endmenu
diff --git a/drivers/net/can/usb/Makefile b/drivers/net/can/usb/Makefile
index c3f75ba701b1..0afd51d4c7a5 100644
--- a/drivers/net/can/usb/Makefile
+++ b/drivers/net/can/usb/Makefile
@@ -3,3 +3,5 @@
3# 3#
4 4
5obj-$(CONFIG_CAN_EMS_USB) += ems_usb.o 5obj-$(CONFIG_CAN_EMS_USB) += ems_usb.o
6
7ccflags-$(CONFIG_CAN_DEBUG_DEVICES) := -DDEBUG
diff --git a/drivers/net/can/usb/ems_usb.c b/drivers/net/can/usb/ems_usb.c
index 9012e0abc626..abdbd9c2b788 100644
--- a/drivers/net/can/usb/ems_usb.c
+++ b/drivers/net/can/usb/ems_usb.c
@@ -319,7 +319,7 @@ static void ems_usb_rx_can_msg(struct ems_usb *dev, struct ems_cpc_msg *msg)
319 319
320 cf = (struct can_frame *)skb_put(skb, sizeof(struct can_frame)); 320 cf = (struct can_frame *)skb_put(skb, sizeof(struct can_frame));
321 321
322 cf->can_id = msg->msg.can_msg.id; 322 cf->can_id = le32_to_cpu(msg->msg.can_msg.id);
323 cf->can_dlc = min_t(u8, msg->msg.can_msg.length, 8); 323 cf->can_dlc = min_t(u8, msg->msg.can_msg.length, 8);
324 324
325 if (msg->type == CPC_MSG_TYPE_EXT_CAN_FRAME 325 if (msg->type == CPC_MSG_TYPE_EXT_CAN_FRAME
@@ -813,6 +813,9 @@ static netdev_tx_t ems_usb_start_xmit(struct sk_buff *skb, struct net_device *ne
813 msg->length = CPC_CAN_MSG_MIN_SIZE + cf->can_dlc; 813 msg->length = CPC_CAN_MSG_MIN_SIZE + cf->can_dlc;
814 } 814 }
815 815
816 /* Respect byte order */
817 msg->msg.can_msg.id = cpu_to_le32(msg->msg.can_msg.id);
818
816 for (i = 0; i < MAX_TX_URBS; i++) { 819 for (i = 0; i < MAX_TX_URBS; i++) {
817 if (dev->tx_contexts[i].echo_index == MAX_TX_URBS) { 820 if (dev->tx_contexts[i].echo_index == MAX_TX_URBS) {
818 context = &dev->tx_contexts[i]; 821 context = &dev->tx_contexts[i];
diff --git a/drivers/net/cassini.c b/drivers/net/cassini.c
index 05916aafa4f1..f857afe8e488 100644
--- a/drivers/net/cassini.c
+++ b/drivers/net/cassini.c
@@ -4342,11 +4342,11 @@ static int cas_open(struct net_device *dev)
4342 cas_unlock_all_restore(cp, flags); 4342 cas_unlock_all_restore(cp, flags);
4343 } 4343 }
4344 4344
4345 err = -ENOMEM;
4345 if (cas_tx_tiny_alloc(cp) < 0) 4346 if (cas_tx_tiny_alloc(cp) < 0)
4346 return -ENOMEM; 4347 goto err_unlock;
4347 4348
4348 /* alloc rx descriptors */ 4349 /* alloc rx descriptors */
4349 err = -ENOMEM;
4350 if (cas_alloc_rxds(cp) < 0) 4350 if (cas_alloc_rxds(cp) < 0)
4351 goto err_tx_tiny; 4351 goto err_tx_tiny;
4352 4352
@@ -4386,6 +4386,7 @@ err_spare:
4386 cas_free_rxds(cp); 4386 cas_free_rxds(cp);
4387err_tx_tiny: 4387err_tx_tiny:
4388 cas_tx_tiny_free(cp); 4388 cas_tx_tiny_free(cp);
4389err_unlock:
4389 mutex_unlock(&cp->pm_mutex); 4390 mutex_unlock(&cp->pm_mutex);
4390 return err; 4391 return err;
4391} 4392}
diff --git a/drivers/net/cxgb3/sge.c b/drivers/net/cxgb3/sge.c
index f86612857a73..6366061712f4 100644
--- a/drivers/net/cxgb3/sge.c
+++ b/drivers/net/cxgb3/sge.c
@@ -879,7 +879,7 @@ recycle:
879 pci_dma_sync_single_for_cpu(adap->pdev, dma_addr, len, 879 pci_dma_sync_single_for_cpu(adap->pdev, dma_addr, len,
880 PCI_DMA_FROMDEVICE); 880 PCI_DMA_FROMDEVICE);
881 (*sd->pg_chunk.p_cnt)--; 881 (*sd->pg_chunk.p_cnt)--;
882 if (!*sd->pg_chunk.p_cnt) 882 if (!*sd->pg_chunk.p_cnt && sd->pg_chunk.page != fl->pg_chunk.page)
883 pci_unmap_page(adap->pdev, 883 pci_unmap_page(adap->pdev,
884 sd->pg_chunk.mapping, 884 sd->pg_chunk.mapping,
885 fl->alloc_size, 885 fl->alloc_size,
@@ -2088,7 +2088,7 @@ static void lro_add_page(struct adapter *adap, struct sge_qset *qs,
2088 PCI_DMA_FROMDEVICE); 2088 PCI_DMA_FROMDEVICE);
2089 2089
2090 (*sd->pg_chunk.p_cnt)--; 2090 (*sd->pg_chunk.p_cnt)--;
2091 if (!*sd->pg_chunk.p_cnt) 2091 if (!*sd->pg_chunk.p_cnt && sd->pg_chunk.page != fl->pg_chunk.page)
2092 pci_unmap_page(adap->pdev, 2092 pci_unmap_page(adap->pdev,
2093 sd->pg_chunk.mapping, 2093 sd->pg_chunk.mapping,
2094 fl->alloc_size, 2094 fl->alloc_size,
diff --git a/drivers/net/davinci_emac.c b/drivers/net/davinci_emac.c
index f72c56dec33c..e3478314c002 100644
--- a/drivers/net/davinci_emac.c
+++ b/drivers/net/davinci_emac.c
@@ -164,16 +164,14 @@ static const char emac_version_string[] = "TI DaVinci EMAC Linux v6.1";
164# define EMAC_MBP_MCASTCHAN(ch) ((ch) & 0x7) 164# define EMAC_MBP_MCASTCHAN(ch) ((ch) & 0x7)
165 165
166/* EMAC mac_control register */ 166/* EMAC mac_control register */
167#define EMAC_MACCONTROL_TXPTYPE (0x200) 167#define EMAC_MACCONTROL_TXPTYPE BIT(9)
168#define EMAC_MACCONTROL_TXPACEEN (0x40) 168#define EMAC_MACCONTROL_TXPACEEN BIT(6)
169#define EMAC_MACCONTROL_MIIEN (0x20) 169#define EMAC_MACCONTROL_GMIIEN BIT(5)
170#define EMAC_MACCONTROL_GIGABITEN (0x80) 170#define EMAC_MACCONTROL_GIGABITEN BIT(7)
171#define EMAC_MACCONTROL_GIGABITEN_SHIFT (7) 171#define EMAC_MACCONTROL_FULLDUPLEXEN BIT(0)
172#define EMAC_MACCONTROL_FULLDUPLEXEN (0x1)
173#define EMAC_MACCONTROL_RMIISPEED_MASK BIT(15) 172#define EMAC_MACCONTROL_RMIISPEED_MASK BIT(15)
174 173
175/* GIGABIT MODE related bits */ 174/* GIGABIT MODE related bits */
176#define EMAC_DM646X_MACCONTORL_GMIIEN BIT(5)
177#define EMAC_DM646X_MACCONTORL_GIG BIT(7) 175#define EMAC_DM646X_MACCONTORL_GIG BIT(7)
178#define EMAC_DM646X_MACCONTORL_GIGFORCE BIT(17) 176#define EMAC_DM646X_MACCONTORL_GIGFORCE BIT(17)
179 177
@@ -192,10 +190,10 @@ static const char emac_version_string[] = "TI DaVinci EMAC Linux v6.1";
192#define EMAC_RX_BUFFER_OFFSET_MASK (0xFFFF) 190#define EMAC_RX_BUFFER_OFFSET_MASK (0xFFFF)
193 191
194/* MAC_IN_VECTOR (0x180) register bit fields */ 192/* MAC_IN_VECTOR (0x180) register bit fields */
195#define EMAC_DM644X_MAC_IN_VECTOR_HOST_INT (0x20000) 193#define EMAC_DM644X_MAC_IN_VECTOR_HOST_INT BIT(17)
196#define EMAC_DM644X_MAC_IN_VECTOR_STATPEND_INT (0x10000) 194#define EMAC_DM644X_MAC_IN_VECTOR_STATPEND_INT BIT(16)
197#define EMAC_DM644X_MAC_IN_VECTOR_RX_INT_VEC (0x0100) 195#define EMAC_DM644X_MAC_IN_VECTOR_RX_INT_VEC BIT(8)
198#define EMAC_DM644X_MAC_IN_VECTOR_TX_INT_VEC (0x01) 196#define EMAC_DM644X_MAC_IN_VECTOR_TX_INT_VEC BIT(0)
199 197
200/** NOTE:: For DM646x the IN_VECTOR has changed */ 198/** NOTE:: For DM646x the IN_VECTOR has changed */
201#define EMAC_DM646X_MAC_IN_VECTOR_RX_INT_VEC BIT(EMAC_DEF_RX_CH) 199#define EMAC_DM646X_MAC_IN_VECTOR_RX_INT_VEC BIT(EMAC_DEF_RX_CH)
@@ -203,7 +201,6 @@ static const char emac_version_string[] = "TI DaVinci EMAC Linux v6.1";
203#define EMAC_DM646X_MAC_IN_VECTOR_HOST_INT BIT(26) 201#define EMAC_DM646X_MAC_IN_VECTOR_HOST_INT BIT(26)
204#define EMAC_DM646X_MAC_IN_VECTOR_STATPEND_INT BIT(27) 202#define EMAC_DM646X_MAC_IN_VECTOR_STATPEND_INT BIT(27)
205 203
206
207/* CPPI bit positions */ 204/* CPPI bit positions */
208#define EMAC_CPPI_SOP_BIT BIT(31) 205#define EMAC_CPPI_SOP_BIT BIT(31)
209#define EMAC_CPPI_EOP_BIT BIT(30) 206#define EMAC_CPPI_EOP_BIT BIT(30)
@@ -750,8 +747,7 @@ static void emac_update_phystatus(struct emac_priv *priv)
750 747
751 if (priv->speed == SPEED_1000 && (priv->version == EMAC_VERSION_2)) { 748 if (priv->speed == SPEED_1000 && (priv->version == EMAC_VERSION_2)) {
752 mac_control = emac_read(EMAC_MACCONTROL); 749 mac_control = emac_read(EMAC_MACCONTROL);
753 mac_control |= (EMAC_DM646X_MACCONTORL_GMIIEN | 750 mac_control |= (EMAC_DM646X_MACCONTORL_GIG |
754 EMAC_DM646X_MACCONTORL_GIG |
755 EMAC_DM646X_MACCONTORL_GIGFORCE); 751 EMAC_DM646X_MACCONTORL_GIGFORCE);
756 } else { 752 } else {
757 /* Clear the GIG bit and GIGFORCE bit */ 753 /* Clear the GIG bit and GIGFORCE bit */
@@ -2108,7 +2104,7 @@ static int emac_hw_enable(struct emac_priv *priv)
2108 2104
2109 /* Enable MII */ 2105 /* Enable MII */
2110 val = emac_read(EMAC_MACCONTROL); 2106 val = emac_read(EMAC_MACCONTROL);
2111 val |= (EMAC_MACCONTROL_MIIEN); 2107 val |= (EMAC_MACCONTROL_GMIIEN);
2112 emac_write(EMAC_MACCONTROL, val); 2108 emac_write(EMAC_MACCONTROL, val);
2113 2109
2114 /* Enable NAPI and interrupts */ 2110 /* Enable NAPI and interrupts */
@@ -2140,9 +2136,6 @@ static int emac_poll(struct napi_struct *napi, int budget)
2140 u32 status = 0; 2136 u32 status = 0;
2141 u32 num_pkts = 0; 2137 u32 num_pkts = 0;
2142 2138
2143 if (!netif_running(ndev))
2144 return 0;
2145
2146 /* Check interrupt vectors and call packet processing */ 2139 /* Check interrupt vectors and call packet processing */
2147 status = emac_read(EMAC_MACINVECTOR); 2140 status = emac_read(EMAC_MACINVECTOR);
2148 2141
@@ -2221,7 +2214,7 @@ void emac_poll_controller(struct net_device *ndev)
2221 struct emac_priv *priv = netdev_priv(ndev); 2214 struct emac_priv *priv = netdev_priv(ndev);
2222 2215
2223 emac_int_disable(priv); 2216 emac_int_disable(priv);
2224 emac_irq(ndev->irq, priv); 2217 emac_irq(ndev->irq, ndev);
2225 emac_int_enable(priv); 2218 emac_int_enable(priv);
2226} 2219}
2227#endif 2220#endif
diff --git a/drivers/net/e100.c b/drivers/net/e100.c
index 5d2f48f02251..d269a68ce354 100644
--- a/drivers/net/e100.c
+++ b/drivers/net/e100.c
@@ -157,6 +157,7 @@
157#include <linux/init.h> 157#include <linux/init.h>
158#include <linux/pci.h> 158#include <linux/pci.h>
159#include <linux/dma-mapping.h> 159#include <linux/dma-mapping.h>
160#include <linux/dmapool.h>
160#include <linux/netdevice.h> 161#include <linux/netdevice.h>
161#include <linux/etherdevice.h> 162#include <linux/etherdevice.h>
162#include <linux/mii.h> 163#include <linux/mii.h>
@@ -602,6 +603,7 @@ struct nic {
602 struct mem *mem; 603 struct mem *mem;
603 dma_addr_t dma_addr; 604 dma_addr_t dma_addr;
604 605
606 struct pci_pool *cbs_pool;
605 dma_addr_t cbs_dma_addr; 607 dma_addr_t cbs_dma_addr;
606 u8 adaptive_ifs; 608 u8 adaptive_ifs;
607 u8 tx_threshold; 609 u8 tx_threshold;
@@ -1427,19 +1429,31 @@ static int e100_phy_init(struct nic *nic)
1427 } else 1429 } else
1428 DPRINTK(HW, DEBUG, "phy_addr = %d\n", nic->mii.phy_id); 1430 DPRINTK(HW, DEBUG, "phy_addr = %d\n", nic->mii.phy_id);
1429 1431
1430 /* Isolate all the PHY ids */
1431 for (addr = 0; addr < 32; addr++)
1432 mdio_write(netdev, addr, MII_BMCR, BMCR_ISOLATE);
1433 /* Select the discovered PHY */
1434 bmcr &= ~BMCR_ISOLATE;
1435 mdio_write(netdev, nic->mii.phy_id, MII_BMCR, bmcr);
1436
1437 /* Get phy ID */ 1432 /* Get phy ID */
1438 id_lo = mdio_read(netdev, nic->mii.phy_id, MII_PHYSID1); 1433 id_lo = mdio_read(netdev, nic->mii.phy_id, MII_PHYSID1);
1439 id_hi = mdio_read(netdev, nic->mii.phy_id, MII_PHYSID2); 1434 id_hi = mdio_read(netdev, nic->mii.phy_id, MII_PHYSID2);
1440 nic->phy = (u32)id_hi << 16 | (u32)id_lo; 1435 nic->phy = (u32)id_hi << 16 | (u32)id_lo;
1441 DPRINTK(HW, DEBUG, "phy ID = 0x%08X\n", nic->phy); 1436 DPRINTK(HW, DEBUG, "phy ID = 0x%08X\n", nic->phy);
1442 1437
1438 /* Select the phy and isolate the rest */
1439 for (addr = 0; addr < 32; addr++) {
1440 if (addr != nic->mii.phy_id) {
1441 mdio_write(netdev, addr, MII_BMCR, BMCR_ISOLATE);
1442 } else if (nic->phy != phy_82552_v) {
1443 bmcr = mdio_read(netdev, addr, MII_BMCR);
1444 mdio_write(netdev, addr, MII_BMCR,
1445 bmcr & ~BMCR_ISOLATE);
1446 }
1447 }
1448 /*
1449 * Workaround for 82552:
1450 * Clear the ISOLATE bit on selected phy_id last (mirrored on all
1451 * other phy_id's) using bmcr value from addr discovery loop above.
1452 */
1453 if (nic->phy == phy_82552_v)
1454 mdio_write(netdev, nic->mii.phy_id, MII_BMCR,
1455 bmcr & ~BMCR_ISOLATE);
1456
1443 /* Handle National tx phys */ 1457 /* Handle National tx phys */
1444#define NCS_PHY_MODEL_MASK 0xFFF0FFFF 1458#define NCS_PHY_MODEL_MASK 0xFFF0FFFF
1445 if ((nic->phy & NCS_PHY_MODEL_MASK) == phy_nsc_tx) { 1459 if ((nic->phy & NCS_PHY_MODEL_MASK) == phy_nsc_tx) {
@@ -1781,9 +1795,7 @@ static void e100_clean_cbs(struct nic *nic)
1781 nic->cb_to_clean = nic->cb_to_clean->next; 1795 nic->cb_to_clean = nic->cb_to_clean->next;
1782 nic->cbs_avail++; 1796 nic->cbs_avail++;
1783 } 1797 }
1784 pci_free_consistent(nic->pdev, 1798 pci_pool_free(nic->cbs_pool, nic->cbs, nic->cbs_dma_addr);
1785 sizeof(struct cb) * nic->params.cbs.count,
1786 nic->cbs, nic->cbs_dma_addr);
1787 nic->cbs = NULL; 1799 nic->cbs = NULL;
1788 nic->cbs_avail = 0; 1800 nic->cbs_avail = 0;
1789 } 1801 }
@@ -1801,8 +1813,8 @@ static int e100_alloc_cbs(struct nic *nic)
1801 nic->cb_to_use = nic->cb_to_send = nic->cb_to_clean = NULL; 1813 nic->cb_to_use = nic->cb_to_send = nic->cb_to_clean = NULL;
1802 nic->cbs_avail = 0; 1814 nic->cbs_avail = 0;
1803 1815
1804 nic->cbs = pci_alloc_consistent(nic->pdev, 1816 nic->cbs = pci_pool_alloc(nic->cbs_pool, GFP_KERNEL,
1805 sizeof(struct cb) * count, &nic->cbs_dma_addr); 1817 &nic->cbs_dma_addr);
1806 if (!nic->cbs) 1818 if (!nic->cbs)
1807 return -ENOMEM; 1819 return -ENOMEM;
1808 1820
@@ -2829,7 +2841,11 @@ static int __devinit e100_probe(struct pci_dev *pdev,
2829 DPRINTK(PROBE, ERR, "Cannot register net device, aborting.\n"); 2841 DPRINTK(PROBE, ERR, "Cannot register net device, aborting.\n");
2830 goto err_out_free; 2842 goto err_out_free;
2831 } 2843 }
2832 2844 nic->cbs_pool = pci_pool_create(netdev->name,
2845 nic->pdev,
2846 nic->params.cbs.count * sizeof(struct cb),
2847 sizeof(u32),
2848 0);
2833 DPRINTK(PROBE, INFO, "addr 0x%llx, irq %d, MAC addr %pM\n", 2849 DPRINTK(PROBE, INFO, "addr 0x%llx, irq %d, MAC addr %pM\n",
2834 (unsigned long long)pci_resource_start(pdev, use_io ? 1 : 0), 2850 (unsigned long long)pci_resource_start(pdev, use_io ? 1 : 0),
2835 pdev->irq, netdev->dev_addr); 2851 pdev->irq, netdev->dev_addr);
@@ -2859,6 +2875,7 @@ static void __devexit e100_remove(struct pci_dev *pdev)
2859 unregister_netdev(netdev); 2875 unregister_netdev(netdev);
2860 e100_free(nic); 2876 e100_free(nic);
2861 pci_iounmap(pdev, nic->csr); 2877 pci_iounmap(pdev, nic->csr);
2878 pci_pool_destroy(nic->cbs_pool);
2862 free_netdev(netdev); 2879 free_netdev(netdev);
2863 pci_release_regions(pdev); 2880 pci_release_regions(pdev);
2864 pci_disable_device(pdev); 2881 pci_disable_device(pdev);
diff --git a/drivers/net/e1000e/defines.h b/drivers/net/e1000e/defines.h
index c0f185beb8bc..1190167a8b3d 100644
--- a/drivers/net/e1000e/defines.h
+++ b/drivers/net/e1000e/defines.h
@@ -76,6 +76,7 @@
76/* Extended Device Control */ 76/* Extended Device Control */
77#define E1000_CTRL_EXT_SDP7_DATA 0x00000080 /* Value of SW Definable Pin 7 */ 77#define E1000_CTRL_EXT_SDP7_DATA 0x00000080 /* Value of SW Definable Pin 7 */
78#define E1000_CTRL_EXT_EE_RST 0x00002000 /* Reinitialize from EEPROM */ 78#define E1000_CTRL_EXT_EE_RST 0x00002000 /* Reinitialize from EEPROM */
79#define E1000_CTRL_EXT_SPD_BYPS 0x00008000 /* Speed Select Bypass */
79#define E1000_CTRL_EXT_RO_DIS 0x00020000 /* Relaxed Ordering disable */ 80#define E1000_CTRL_EXT_RO_DIS 0x00020000 /* Relaxed Ordering disable */
80#define E1000_CTRL_EXT_DMA_DYN_CLK_EN 0x00080000 /* DMA Dynamic Clock Gating */ 81#define E1000_CTRL_EXT_DMA_DYN_CLK_EN 0x00080000 /* DMA Dynamic Clock Gating */
81#define E1000_CTRL_EXT_LINK_MODE_MASK 0x00C00000 82#define E1000_CTRL_EXT_LINK_MODE_MASK 0x00C00000
@@ -347,6 +348,7 @@
347/* Extended Configuration Control and Size */ 348/* Extended Configuration Control and Size */
348#define E1000_EXTCNF_CTRL_MDIO_SW_OWNERSHIP 0x00000020 349#define E1000_EXTCNF_CTRL_MDIO_SW_OWNERSHIP 0x00000020
349#define E1000_EXTCNF_CTRL_LCD_WRITE_ENABLE 0x00000001 350#define E1000_EXTCNF_CTRL_LCD_WRITE_ENABLE 0x00000001
351#define E1000_EXTCNF_CTRL_OEM_WRITE_ENABLE 0x00000008
350#define E1000_EXTCNF_CTRL_SWFLAG 0x00000020 352#define E1000_EXTCNF_CTRL_SWFLAG 0x00000020
351#define E1000_EXTCNF_SIZE_EXT_PCIE_LENGTH_MASK 0x00FF0000 353#define E1000_EXTCNF_SIZE_EXT_PCIE_LENGTH_MASK 0x00FF0000
352#define E1000_EXTCNF_SIZE_EXT_PCIE_LENGTH_SHIFT 16 354#define E1000_EXTCNF_SIZE_EXT_PCIE_LENGTH_SHIFT 16
diff --git a/drivers/net/e1000e/e1000.h b/drivers/net/e1000e/e1000.h
index 405a144ebcad..3e187b0e4203 100644
--- a/drivers/net/e1000e/e1000.h
+++ b/drivers/net/e1000e/e1000.h
@@ -141,6 +141,22 @@ struct e1000_info;
141#define HV_TNCRS_UPPER PHY_REG(778, 29) /* Transmit with no CRS */ 141#define HV_TNCRS_UPPER PHY_REG(778, 29) /* Transmit with no CRS */
142#define HV_TNCRS_LOWER PHY_REG(778, 30) 142#define HV_TNCRS_LOWER PHY_REG(778, 30)
143 143
144#define E1000_FCRTV_PCH 0x05F40 /* PCH Flow Control Refresh Timer Value */
145
146/* BM PHY Copper Specific Status */
147#define BM_CS_STATUS 17
148#define BM_CS_STATUS_LINK_UP 0x0400
149#define BM_CS_STATUS_RESOLVED 0x0800
150#define BM_CS_STATUS_SPEED_MASK 0xC000
151#define BM_CS_STATUS_SPEED_1000 0x8000
152
153/* 82577 Mobile Phy Status Register */
154#define HV_M_STATUS 26
155#define HV_M_STATUS_AUTONEG_COMPLETE 0x1000
156#define HV_M_STATUS_SPEED_MASK 0x0300
157#define HV_M_STATUS_SPEED_1000 0x0200
158#define HV_M_STATUS_LINK_UP 0x0040
159
144enum e1000_boards { 160enum e1000_boards {
145 board_82571, 161 board_82571,
146 board_82572, 162 board_82572,
diff --git a/drivers/net/e1000e/ethtool.c b/drivers/net/e1000e/ethtool.c
index 1bf4d2a5d34f..e82638ecae88 100644
--- a/drivers/net/e1000e/ethtool.c
+++ b/drivers/net/e1000e/ethtool.c
@@ -327,10 +327,18 @@ static int e1000_set_pauseparam(struct net_device *netdev,
327 327
328 hw->fc.current_mode = hw->fc.requested_mode; 328 hw->fc.current_mode = hw->fc.requested_mode;
329 329
330 retval = ((hw->phy.media_type == e1000_media_type_fiber) ? 330 if (hw->phy.media_type == e1000_media_type_fiber) {
331 hw->mac.ops.setup_link(hw) : e1000e_force_mac_fc(hw)); 331 retval = hw->mac.ops.setup_link(hw);
332 /* implicit goto out */
333 } else {
334 retval = e1000e_force_mac_fc(hw);
335 if (retval)
336 goto out;
337 e1000e_set_fc_watermarks(hw);
338 }
332 } 339 }
333 340
341out:
334 clear_bit(__E1000_RESETTING, &adapter->state); 342 clear_bit(__E1000_RESETTING, &adapter->state);
335 return retval; 343 return retval;
336} 344}
diff --git a/drivers/net/e1000e/hw.h b/drivers/net/e1000e/hw.h
index 7b05cf47f7f5..aaea41ef794d 100644
--- a/drivers/net/e1000e/hw.h
+++ b/drivers/net/e1000e/hw.h
@@ -903,6 +903,7 @@ struct e1000_shadow_ram {
903struct e1000_dev_spec_ich8lan { 903struct e1000_dev_spec_ich8lan {
904 bool kmrn_lock_loss_workaround_enabled; 904 bool kmrn_lock_loss_workaround_enabled;
905 struct e1000_shadow_ram shadow_ram[E1000_ICH8_SHADOW_RAM_WORDS]; 905 struct e1000_shadow_ram shadow_ram[E1000_ICH8_SHADOW_RAM_WORDS];
906 bool nvm_k1_enabled;
906}; 907};
907 908
908struct e1000_hw { 909struct e1000_hw {
diff --git a/drivers/net/e1000e/ich8lan.c b/drivers/net/e1000e/ich8lan.c
index b6388b9535fd..eff3f4783655 100644
--- a/drivers/net/e1000e/ich8lan.c
+++ b/drivers/net/e1000e/ich8lan.c
@@ -124,11 +124,25 @@
124 124
125#define SW_FLAG_TIMEOUT 1000 /* SW Semaphore flag timeout in milliseconds */ 125#define SW_FLAG_TIMEOUT 1000 /* SW Semaphore flag timeout in milliseconds */
126 126
127/* SMBus Address Phy Register */
128#define HV_SMB_ADDR PHY_REG(768, 26)
129#define HV_SMB_ADDR_PEC_EN 0x0200
130#define HV_SMB_ADDR_VALID 0x0080
131
132/* Strapping Option Register - RO */
133#define E1000_STRAP 0x0000C
134#define E1000_STRAP_SMBUS_ADDRESS_MASK 0x00FE0000
135#define E1000_STRAP_SMBUS_ADDRESS_SHIFT 17
136
127/* OEM Bits Phy Register */ 137/* OEM Bits Phy Register */
128#define HV_OEM_BITS PHY_REG(768, 25) 138#define HV_OEM_BITS PHY_REG(768, 25)
129#define HV_OEM_BITS_LPLU 0x0004 /* Low Power Link Up */ 139#define HV_OEM_BITS_LPLU 0x0004 /* Low Power Link Up */
140#define HV_OEM_BITS_GBE_DIS 0x0040 /* Gigabit Disable */
130#define HV_OEM_BITS_RESTART_AN 0x0400 /* Restart Auto-negotiation */ 141#define HV_OEM_BITS_RESTART_AN 0x0400 /* Restart Auto-negotiation */
131 142
143#define E1000_NVM_K1_CONFIG 0x1B /* NVM K1 Config Word */
144#define E1000_NVM_K1_ENABLE 0x1 /* NVM Enable K1 bit */
145
132/* ICH GbE Flash Hardware Sequencing Flash Status Register bit breakdown */ 146/* ICH GbE Flash Hardware Sequencing Flash Status Register bit breakdown */
133/* Offset 04h HSFSTS */ 147/* Offset 04h HSFSTS */
134union ich8_hws_flash_status { 148union ich8_hws_flash_status {
@@ -208,6 +222,9 @@ static s32 e1000_cleanup_led_pchlan(struct e1000_hw *hw);
208static s32 e1000_led_on_pchlan(struct e1000_hw *hw); 222static s32 e1000_led_on_pchlan(struct e1000_hw *hw);
209static s32 e1000_led_off_pchlan(struct e1000_hw *hw); 223static s32 e1000_led_off_pchlan(struct e1000_hw *hw);
210static s32 e1000_set_lplu_state_pchlan(struct e1000_hw *hw, bool active); 224static s32 e1000_set_lplu_state_pchlan(struct e1000_hw *hw, bool active);
225static void e1000_lan_init_done_ich8lan(struct e1000_hw *hw);
226static s32 e1000_k1_gig_workaround_hv(struct e1000_hw *hw, bool link);
227static s32 e1000_configure_k1_ich8lan(struct e1000_hw *hw, bool k1_enable);
211 228
212static inline u16 __er16flash(struct e1000_hw *hw, unsigned long reg) 229static inline u16 __er16flash(struct e1000_hw *hw, unsigned long reg)
213{ 230{
@@ -483,14 +500,6 @@ static s32 e1000_check_for_copper_link_ich8lan(struct e1000_hw *hw)
483 goto out; 500 goto out;
484 } 501 }
485 502
486 if (hw->mac.type == e1000_pchlan) {
487 ret_val = e1000e_write_kmrn_reg(hw,
488 E1000_KMRNCTRLSTA_K1_CONFIG,
489 E1000_KMRNCTRLSTA_K1_ENABLE);
490 if (ret_val)
491 goto out;
492 }
493
494 /* 503 /*
495 * First we want to see if the MII Status Register reports 504 * First we want to see if the MII Status Register reports
496 * link. If so, then we want to get the current speed/duplex 505 * link. If so, then we want to get the current speed/duplex
@@ -500,6 +509,12 @@ static s32 e1000_check_for_copper_link_ich8lan(struct e1000_hw *hw)
500 if (ret_val) 509 if (ret_val)
501 goto out; 510 goto out;
502 511
512 if (hw->mac.type == e1000_pchlan) {
513 ret_val = e1000_k1_gig_workaround_hv(hw, link);
514 if (ret_val)
515 goto out;
516 }
517
503 if (!link) 518 if (!link)
504 goto out; /* No link detected */ 519 goto out; /* No link detected */
505 520
@@ -794,6 +809,327 @@ static s32 e1000_phy_force_speed_duplex_ich8lan(struct e1000_hw *hw)
794} 809}
795 810
796/** 811/**
812 * e1000_sw_lcd_config_ich8lan - SW-based LCD Configuration
813 * @hw: pointer to the HW structure
814 *
815 * SW should configure the LCD from the NVM extended configuration region
816 * as a workaround for certain parts.
817 **/
818static s32 e1000_sw_lcd_config_ich8lan(struct e1000_hw *hw)
819{
820 struct e1000_phy_info *phy = &hw->phy;
821 u32 i, data, cnf_size, cnf_base_addr, sw_cfg_mask;
822 s32 ret_val;
823 u16 word_addr, reg_data, reg_addr, phy_page = 0;
824
825 ret_val = hw->phy.ops.acquire_phy(hw);
826 if (ret_val)
827 return ret_val;
828
829 /*
830 * Initialize the PHY from the NVM on ICH platforms. This
831 * is needed due to an issue where the NVM configuration is
832 * not properly autoloaded after power transitions.
833 * Therefore, after each PHY reset, we will load the
834 * configuration data out of the NVM manually.
835 */
836 if ((hw->mac.type == e1000_ich8lan && phy->type == e1000_phy_igp_3) ||
837 (hw->mac.type == e1000_pchlan)) {
838 struct e1000_adapter *adapter = hw->adapter;
839
840 /* Check if SW needs to configure the PHY */
841 if ((adapter->pdev->device == E1000_DEV_ID_ICH8_IGP_M_AMT) ||
842 (adapter->pdev->device == E1000_DEV_ID_ICH8_IGP_M) ||
843 (hw->mac.type == e1000_pchlan))
844 sw_cfg_mask = E1000_FEXTNVM_SW_CONFIG_ICH8M;
845 else
846 sw_cfg_mask = E1000_FEXTNVM_SW_CONFIG;
847
848 data = er32(FEXTNVM);
849 if (!(data & sw_cfg_mask))
850 goto out;
851
852 /* Wait for basic configuration completes before proceeding */
853 e1000_lan_init_done_ich8lan(hw);
854
855 /*
856 * Make sure HW does not configure LCD from PHY
857 * extended configuration before SW configuration
858 */
859 data = er32(EXTCNF_CTRL);
860 if (data & E1000_EXTCNF_CTRL_LCD_WRITE_ENABLE)
861 goto out;
862
863 cnf_size = er32(EXTCNF_SIZE);
864 cnf_size &= E1000_EXTCNF_SIZE_EXT_PCIE_LENGTH_MASK;
865 cnf_size >>= E1000_EXTCNF_SIZE_EXT_PCIE_LENGTH_SHIFT;
866 if (!cnf_size)
867 goto out;
868
869 cnf_base_addr = data & E1000_EXTCNF_CTRL_EXT_CNF_POINTER_MASK;
870 cnf_base_addr >>= E1000_EXTCNF_CTRL_EXT_CNF_POINTER_SHIFT;
871
872 if (!(data & E1000_EXTCNF_CTRL_OEM_WRITE_ENABLE) &&
873 (hw->mac.type == e1000_pchlan)) {
874 /*
875 * HW configures the SMBus address and LEDs when the
876 * OEM and LCD Write Enable bits are set in the NVM.
877 * When both NVM bits are cleared, SW will configure
878 * them instead.
879 */
880 data = er32(STRAP);
881 data &= E1000_STRAP_SMBUS_ADDRESS_MASK;
882 reg_data = data >> E1000_STRAP_SMBUS_ADDRESS_SHIFT;
883 reg_data |= HV_SMB_ADDR_PEC_EN | HV_SMB_ADDR_VALID;
884 ret_val = e1000_write_phy_reg_hv_locked(hw, HV_SMB_ADDR,
885 reg_data);
886 if (ret_val)
887 goto out;
888
889 data = er32(LEDCTL);
890 ret_val = e1000_write_phy_reg_hv_locked(hw,
891 HV_LED_CONFIG,
892 (u16)data);
893 if (ret_val)
894 goto out;
895 }
896 /* Configure LCD from extended configuration region. */
897
898 /* cnf_base_addr is in DWORD */
899 word_addr = (u16)(cnf_base_addr << 1);
900
901 for (i = 0; i < cnf_size; i++) {
902 ret_val = e1000_read_nvm(hw, (word_addr + i * 2), 1,
903 &reg_data);
904 if (ret_val)
905 goto out;
906
907 ret_val = e1000_read_nvm(hw, (word_addr + i * 2 + 1),
908 1, &reg_addr);
909 if (ret_val)
910 goto out;
911
912 /* Save off the PHY page for future writes. */
913 if (reg_addr == IGP01E1000_PHY_PAGE_SELECT) {
914 phy_page = reg_data;
915 continue;
916 }
917
918 reg_addr &= PHY_REG_MASK;
919 reg_addr |= phy_page;
920
921 ret_val = phy->ops.write_phy_reg_locked(hw,
922 (u32)reg_addr,
923 reg_data);
924 if (ret_val)
925 goto out;
926 }
927 }
928
929out:
930 hw->phy.ops.release_phy(hw);
931 return ret_val;
932}
933
934/**
935 * e1000_k1_gig_workaround_hv - K1 Si workaround
936 * @hw: pointer to the HW structure
937 * @link: link up bool flag
938 *
939 * If K1 is enabled for 1Gbps, the MAC might stall when transitioning
940 * from a lower speed. This workaround disables K1 whenever link is at 1Gig
941 * If link is down, the function will restore the default K1 setting located
942 * in the NVM.
943 **/
944static s32 e1000_k1_gig_workaround_hv(struct e1000_hw *hw, bool link)
945{
946 s32 ret_val = 0;
947 u16 status_reg = 0;
948 bool k1_enable = hw->dev_spec.ich8lan.nvm_k1_enabled;
949
950 if (hw->mac.type != e1000_pchlan)
951 goto out;
952
953 /* Wrap the whole flow with the sw flag */
954 ret_val = hw->phy.ops.acquire_phy(hw);
955 if (ret_val)
956 goto out;
957
958 /* Disable K1 when link is 1Gbps, otherwise use the NVM setting */
959 if (link) {
960 if (hw->phy.type == e1000_phy_82578) {
961 ret_val = hw->phy.ops.read_phy_reg_locked(hw,
962 BM_CS_STATUS,
963 &status_reg);
964 if (ret_val)
965 goto release;
966
967 status_reg &= BM_CS_STATUS_LINK_UP |
968 BM_CS_STATUS_RESOLVED |
969 BM_CS_STATUS_SPEED_MASK;
970
971 if (status_reg == (BM_CS_STATUS_LINK_UP |
972 BM_CS_STATUS_RESOLVED |
973 BM_CS_STATUS_SPEED_1000))
974 k1_enable = false;
975 }
976
977 if (hw->phy.type == e1000_phy_82577) {
978 ret_val = hw->phy.ops.read_phy_reg_locked(hw,
979 HV_M_STATUS,
980 &status_reg);
981 if (ret_val)
982 goto release;
983
984 status_reg &= HV_M_STATUS_LINK_UP |
985 HV_M_STATUS_AUTONEG_COMPLETE |
986 HV_M_STATUS_SPEED_MASK;
987
988 if (status_reg == (HV_M_STATUS_LINK_UP |
989 HV_M_STATUS_AUTONEG_COMPLETE |
990 HV_M_STATUS_SPEED_1000))
991 k1_enable = false;
992 }
993
994 /* Link stall fix for link up */
995 ret_val = hw->phy.ops.write_phy_reg_locked(hw, PHY_REG(770, 19),
996 0x0100);
997 if (ret_val)
998 goto release;
999
1000 } else {
1001 /* Link stall fix for link down */
1002 ret_val = hw->phy.ops.write_phy_reg_locked(hw, PHY_REG(770, 19),
1003 0x4100);
1004 if (ret_val)
1005 goto release;
1006 }
1007
1008 ret_val = e1000_configure_k1_ich8lan(hw, k1_enable);
1009
1010release:
1011 hw->phy.ops.release_phy(hw);
1012out:
1013 return ret_val;
1014}
1015
1016/**
1017 * e1000_configure_k1_ich8lan - Configure K1 power state
1018 * @hw: pointer to the HW structure
1019 * @enable: K1 state to configure
1020 *
1021 * Configure the K1 power state based on the provided parameter.
1022 * Assumes semaphore already acquired.
1023 *
1024 * Success returns 0, Failure returns -E1000_ERR_PHY (-2)
1025 **/
1026static s32 e1000_configure_k1_ich8lan(struct e1000_hw *hw, bool k1_enable)
1027{
1028 s32 ret_val = 0;
1029 u32 ctrl_reg = 0;
1030 u32 ctrl_ext = 0;
1031 u32 reg = 0;
1032 u16 kmrn_reg = 0;
1033
1034 ret_val = e1000e_read_kmrn_reg_locked(hw,
1035 E1000_KMRNCTRLSTA_K1_CONFIG,
1036 &kmrn_reg);
1037 if (ret_val)
1038 goto out;
1039
1040 if (k1_enable)
1041 kmrn_reg |= E1000_KMRNCTRLSTA_K1_ENABLE;
1042 else
1043 kmrn_reg &= ~E1000_KMRNCTRLSTA_K1_ENABLE;
1044
1045 ret_val = e1000e_write_kmrn_reg_locked(hw,
1046 E1000_KMRNCTRLSTA_K1_CONFIG,
1047 kmrn_reg);
1048 if (ret_val)
1049 goto out;
1050
1051 udelay(20);
1052 ctrl_ext = er32(CTRL_EXT);
1053 ctrl_reg = er32(CTRL);
1054
1055 reg = ctrl_reg & ~(E1000_CTRL_SPD_1000 | E1000_CTRL_SPD_100);
1056 reg |= E1000_CTRL_FRCSPD;
1057 ew32(CTRL, reg);
1058
1059 ew32(CTRL_EXT, ctrl_ext | E1000_CTRL_EXT_SPD_BYPS);
1060 udelay(20);
1061 ew32(CTRL, ctrl_reg);
1062 ew32(CTRL_EXT, ctrl_ext);
1063 udelay(20);
1064
1065out:
1066 return ret_val;
1067}
1068
1069/**
1070 * e1000_oem_bits_config_ich8lan - SW-based LCD Configuration
1071 * @hw: pointer to the HW structure
1072 * @d0_state: boolean if entering d0 or d3 device state
1073 *
1074 * SW will configure Gbe Disable and LPLU based on the NVM. The four bits are
1075 * collectively called OEM bits. The OEM Write Enable bit and SW Config bit
1076 * in NVM determines whether HW should configure LPLU and Gbe Disable.
1077 **/
1078static s32 e1000_oem_bits_config_ich8lan(struct e1000_hw *hw, bool d0_state)
1079{
1080 s32 ret_val = 0;
1081 u32 mac_reg;
1082 u16 oem_reg;
1083
1084 if (hw->mac.type != e1000_pchlan)
1085 return ret_val;
1086
1087 ret_val = hw->phy.ops.acquire_phy(hw);
1088 if (ret_val)
1089 return ret_val;
1090
1091 mac_reg = er32(EXTCNF_CTRL);
1092 if (mac_reg & E1000_EXTCNF_CTRL_OEM_WRITE_ENABLE)
1093 goto out;
1094
1095 mac_reg = er32(FEXTNVM);
1096 if (!(mac_reg & E1000_FEXTNVM_SW_CONFIG_ICH8M))
1097 goto out;
1098
1099 mac_reg = er32(PHY_CTRL);
1100
1101 ret_val = hw->phy.ops.read_phy_reg_locked(hw, HV_OEM_BITS, &oem_reg);
1102 if (ret_val)
1103 goto out;
1104
1105 oem_reg &= ~(HV_OEM_BITS_GBE_DIS | HV_OEM_BITS_LPLU);
1106
1107 if (d0_state) {
1108 if (mac_reg & E1000_PHY_CTRL_GBE_DISABLE)
1109 oem_reg |= HV_OEM_BITS_GBE_DIS;
1110
1111 if (mac_reg & E1000_PHY_CTRL_D0A_LPLU)
1112 oem_reg |= HV_OEM_BITS_LPLU;
1113 } else {
1114 if (mac_reg & E1000_PHY_CTRL_NOND0A_GBE_DISABLE)
1115 oem_reg |= HV_OEM_BITS_GBE_DIS;
1116
1117 if (mac_reg & E1000_PHY_CTRL_NOND0A_LPLU)
1118 oem_reg |= HV_OEM_BITS_LPLU;
1119 }
1120 /* Restart auto-neg to activate the bits */
1121 if (!e1000_check_reset_block(hw))
1122 oem_reg |= HV_OEM_BITS_RESTART_AN;
1123 ret_val = hw->phy.ops.write_phy_reg_locked(hw, HV_OEM_BITS, oem_reg);
1124
1125out:
1126 hw->phy.ops.release_phy(hw);
1127
1128 return ret_val;
1129}
1130
1131
1132/**
797 * e1000_hv_phy_workarounds_ich8lan - A series of Phy workarounds to be 1133 * e1000_hv_phy_workarounds_ich8lan - A series of Phy workarounds to be
798 * done after every PHY reset. 1134 * done after every PHY reset.
799 **/ 1135 **/
@@ -833,10 +1169,20 @@ static s32 e1000_hv_phy_workarounds_ich8lan(struct e1000_hw *hw)
833 ret_val = hw->phy.ops.acquire_phy(hw); 1169 ret_val = hw->phy.ops.acquire_phy(hw);
834 if (ret_val) 1170 if (ret_val)
835 return ret_val; 1171 return ret_val;
1172
836 hw->phy.addr = 1; 1173 hw->phy.addr = 1;
837 e1000e_write_phy_reg_mdic(hw, IGP01E1000_PHY_PAGE_SELECT, 0); 1174 ret_val = e1000e_write_phy_reg_mdic(hw, IGP01E1000_PHY_PAGE_SELECT, 0);
1175 if (ret_val)
1176 goto out;
838 hw->phy.ops.release_phy(hw); 1177 hw->phy.ops.release_phy(hw);
839 1178
1179 /*
1180 * Configure the K1 Si workaround during phy reset assuming there is
1181 * link so that it disables K1 if link is in 1Gbps.
1182 */
1183 ret_val = e1000_k1_gig_workaround_hv(hw, true);
1184
1185out:
840 return ret_val; 1186 return ret_val;
841} 1187}
842 1188
@@ -882,11 +1228,8 @@ static void e1000_lan_init_done_ich8lan(struct e1000_hw *hw)
882 **/ 1228 **/
883static s32 e1000_phy_hw_reset_ich8lan(struct e1000_hw *hw) 1229static s32 e1000_phy_hw_reset_ich8lan(struct e1000_hw *hw)
884{ 1230{
885 struct e1000_phy_info *phy = &hw->phy; 1231 s32 ret_val = 0;
886 u32 i; 1232 u16 reg;
887 u32 data, cnf_size, cnf_base_addr, sw_cfg_mask;
888 s32 ret_val;
889 u16 reg, word_addr, reg_data, reg_addr, phy_page = 0;
890 1233
891 ret_val = e1000e_phy_hw_reset_generic(hw); 1234 ret_val = e1000e_phy_hw_reset_generic(hw);
892 if (ret_val) 1235 if (ret_val)
@@ -905,81 +1248,16 @@ static s32 e1000_phy_hw_reset_ich8lan(struct e1000_hw *hw)
905 if (hw->mac.type == e1000_pchlan) 1248 if (hw->mac.type == e1000_pchlan)
906 e1e_rphy(hw, BM_WUC, &reg); 1249 e1e_rphy(hw, BM_WUC, &reg);
907 1250
908 /* 1251 /* Configure the LCD with the extended configuration region in NVM */
909 * Initialize the PHY from the NVM on ICH platforms. This 1252 ret_val = e1000_sw_lcd_config_ich8lan(hw);
910 * is needed due to an issue where the NVM configuration is 1253 if (ret_val)
911 * not properly autoloaded after power transitions. 1254 goto out;
912 * Therefore, after each PHY reset, we will load the
913 * configuration data out of the NVM manually.
914 */
915 if (hw->mac.type == e1000_ich8lan && phy->type == e1000_phy_igp_3) {
916 struct e1000_adapter *adapter = hw->adapter;
917
918 /* Check if SW needs configure the PHY */
919 if ((adapter->pdev->device == E1000_DEV_ID_ICH8_IGP_M_AMT) ||
920 (adapter->pdev->device == E1000_DEV_ID_ICH8_IGP_M))
921 sw_cfg_mask = E1000_FEXTNVM_SW_CONFIG_ICH8M;
922 else
923 sw_cfg_mask = E1000_FEXTNVM_SW_CONFIG;
924
925 data = er32(FEXTNVM);
926 if (!(data & sw_cfg_mask))
927 return 0;
928
929 /* Wait for basic configuration completes before proceeding */
930 e1000_lan_init_done_ich8lan(hw);
931
932 /*
933 * Make sure HW does not configure LCD from PHY
934 * extended configuration before SW configuration
935 */
936 data = er32(EXTCNF_CTRL);
937 if (data & E1000_EXTCNF_CTRL_LCD_WRITE_ENABLE)
938 return 0;
939
940 cnf_size = er32(EXTCNF_SIZE);
941 cnf_size &= E1000_EXTCNF_SIZE_EXT_PCIE_LENGTH_MASK;
942 cnf_size >>= E1000_EXTCNF_SIZE_EXT_PCIE_LENGTH_SHIFT;
943 if (!cnf_size)
944 return 0;
945
946 cnf_base_addr = data & E1000_EXTCNF_CTRL_EXT_CNF_POINTER_MASK;
947 cnf_base_addr >>= E1000_EXTCNF_CTRL_EXT_CNF_POINTER_SHIFT;
948
949 /* Configure LCD from extended configuration region. */
950
951 /* cnf_base_addr is in DWORD */
952 word_addr = (u16)(cnf_base_addr << 1);
953
954 for (i = 0; i < cnf_size; i++) {
955 ret_val = e1000_read_nvm(hw,
956 (word_addr + i * 2),
957 1,
958 &reg_data);
959 if (ret_val)
960 return ret_val;
961
962 ret_val = e1000_read_nvm(hw,
963 (word_addr + i * 2 + 1),
964 1,
965 &reg_addr);
966 if (ret_val)
967 return ret_val;
968
969 /* Save off the PHY page for future writes. */
970 if (reg_addr == IGP01E1000_PHY_PAGE_SELECT) {
971 phy_page = reg_data;
972 continue;
973 }
974
975 reg_addr |= phy_page;
976 1255
977 ret_val = e1e_wphy(hw, (u32)reg_addr, reg_data); 1256 /* Configure the LCD with the OEM bits in NVM */
978 if (ret_val) 1257 if (hw->mac.type == e1000_pchlan)
979 return ret_val; 1258 ret_val = e1000_oem_bits_config_ich8lan(hw, true);
980 }
981 }
982 1259
1260out:
983 return 0; 1261 return 0;
984} 1262}
985 1263
@@ -2306,6 +2584,7 @@ static s32 e1000_get_bus_info_ich8lan(struct e1000_hw *hw)
2306 **/ 2584 **/
2307static s32 e1000_reset_hw_ich8lan(struct e1000_hw *hw) 2585static s32 e1000_reset_hw_ich8lan(struct e1000_hw *hw)
2308{ 2586{
2587 struct e1000_dev_spec_ich8lan *dev_spec = &hw->dev_spec.ich8lan;
2309 u16 reg; 2588 u16 reg;
2310 u32 ctrl, icr, kab; 2589 u32 ctrl, icr, kab;
2311 s32 ret_val; 2590 s32 ret_val;
@@ -2341,6 +2620,18 @@ static s32 e1000_reset_hw_ich8lan(struct e1000_hw *hw)
2341 ew32(PBS, E1000_PBS_16K); 2620 ew32(PBS, E1000_PBS_16K);
2342 } 2621 }
2343 2622
2623 if (hw->mac.type == e1000_pchlan) {
2624 /* Save the NVM K1 bit setting*/
2625 ret_val = e1000_read_nvm(hw, E1000_NVM_K1_CONFIG, 1, &reg);
2626 if (ret_val)
2627 return ret_val;
2628
2629 if (reg & E1000_NVM_K1_ENABLE)
2630 dev_spec->nvm_k1_enabled = true;
2631 else
2632 dev_spec->nvm_k1_enabled = false;
2633 }
2634
2344 ctrl = er32(CTRL); 2635 ctrl = er32(CTRL);
2345 2636
2346 if (!e1000_check_reset_block(hw)) { 2637 if (!e1000_check_reset_block(hw)) {
@@ -2386,6 +2677,15 @@ static s32 e1000_reset_hw_ich8lan(struct e1000_hw *hw)
2386 if (hw->mac.type == e1000_pchlan) 2677 if (hw->mac.type == e1000_pchlan)
2387 e1e_rphy(hw, BM_WUC, &reg); 2678 e1e_rphy(hw, BM_WUC, &reg);
2388 2679
2680 ret_val = e1000_sw_lcd_config_ich8lan(hw);
2681 if (ret_val)
2682 goto out;
2683
2684 if (hw->mac.type == e1000_pchlan) {
2685 ret_val = e1000_oem_bits_config_ich8lan(hw, true);
2686 if (ret_val)
2687 goto out;
2688 }
2389 /* 2689 /*
2390 * For PCH, this write will make sure that any noise 2690 * For PCH, this write will make sure that any noise
2391 * will be detected as a CRC error and be dropped rather than show up 2691 * will be detected as a CRC error and be dropped rather than show up
@@ -2404,6 +2704,7 @@ static s32 e1000_reset_hw_ich8lan(struct e1000_hw *hw)
2404 if (hw->mac.type == e1000_pchlan) 2704 if (hw->mac.type == e1000_pchlan)
2405 ret_val = e1000_hv_phy_workarounds_ich8lan(hw); 2705 ret_val = e1000_hv_phy_workarounds_ich8lan(hw);
2406 2706
2707out:
2407 return ret_val; 2708 return ret_val;
2408} 2709}
2409 2710
@@ -2708,14 +3009,6 @@ static s32 e1000_get_link_up_info_ich8lan(struct e1000_hw *hw, u16 *speed,
2708 if (ret_val) 3009 if (ret_val)
2709 return ret_val; 3010 return ret_val;
2710 3011
2711 if ((hw->mac.type == e1000_pchlan) && (*speed == SPEED_1000)) {
2712 ret_val = e1000e_write_kmrn_reg(hw,
2713 E1000_KMRNCTRLSTA_K1_CONFIG,
2714 E1000_KMRNCTRLSTA_K1_DISABLE);
2715 if (ret_val)
2716 return ret_val;
2717 }
2718
2719 if ((hw->mac.type == e1000_ich8lan) && 3012 if ((hw->mac.type == e1000_ich8lan) &&
2720 (hw->phy.type == e1000_phy_igp_3) && 3013 (hw->phy.type == e1000_phy_igp_3) &&
2721 (*speed == SPEED_1000)) { 3014 (*speed == SPEED_1000)) {
@@ -3266,6 +3559,7 @@ struct e1000_info e1000_pch_info = {
3266 | FLAG_HAS_AMT 3559 | FLAG_HAS_AMT
3267 | FLAG_HAS_FLASH 3560 | FLAG_HAS_FLASH
3268 | FLAG_HAS_JUMBO_FRAMES 3561 | FLAG_HAS_JUMBO_FRAMES
3562 | FLAG_DISABLE_FC_PAUSE_TIME /* errata */
3269 | FLAG_APME_IN_WUC, 3563 | FLAG_APME_IN_WUC,
3270 .pba = 26, 3564 .pba = 26,
3271 .max_hw_frame_size = 4096, 3565 .max_hw_frame_size = 4096,
diff --git a/drivers/net/e1000e/netdev.c b/drivers/net/e1000e/netdev.c
index 0687c6aa4e46..fad8f9ea0043 100644
--- a/drivers/net/e1000e/netdev.c
+++ b/drivers/net/e1000e/netdev.c
@@ -2769,25 +2769,38 @@ void e1000e_reset(struct e1000_adapter *adapter)
2769 /* 2769 /*
2770 * flow control settings 2770 * flow control settings
2771 * 2771 *
2772 * The high water mark must be low enough to fit two full frame 2772 * The high water mark must be low enough to fit one full frame
2773 * (or the size used for early receive) above it in the Rx FIFO. 2773 * (or the size used for early receive) above it in the Rx FIFO.
2774 * Set it to the lower of: 2774 * Set it to the lower of:
2775 * - 90% of the Rx FIFO size, and 2775 * - 90% of the Rx FIFO size, and
2776 * - the full Rx FIFO size minus the early receive size (for parts 2776 * - the full Rx FIFO size minus the early receive size (for parts
2777 * with ERT support assuming ERT set to E1000_ERT_2048), or 2777 * with ERT support assuming ERT set to E1000_ERT_2048), or
2778 * - the full Rx FIFO size minus two full frames 2778 * - the full Rx FIFO size minus one full frame
2779 */ 2779 */
2780 if ((adapter->flags & FLAG_HAS_ERT) && 2780 if (hw->mac.type == e1000_pchlan) {
2781 (adapter->netdev->mtu > ETH_DATA_LEN)) 2781 /*
2782 hwm = min(((pba << 10) * 9 / 10), 2782 * Workaround PCH LOM adapter hangs with certain network
2783 ((pba << 10) - (E1000_ERT_2048 << 3))); 2783 * loads. If hangs persist, try disabling Tx flow control.
2784 else 2784 */
2785 hwm = min(((pba << 10) * 9 / 10), 2785 if (adapter->netdev->mtu > ETH_DATA_LEN) {
2786 ((pba << 10) - (2 * adapter->max_frame_size))); 2786 fc->high_water = 0x3500;
2787 fc->low_water = 0x1500;
2788 } else {
2789 fc->high_water = 0x5000;
2790 fc->low_water = 0x3000;
2791 }
2792 } else {
2793 if ((adapter->flags & FLAG_HAS_ERT) &&
2794 (adapter->netdev->mtu > ETH_DATA_LEN))
2795 hwm = min(((pba << 10) * 9 / 10),
2796 ((pba << 10) - (E1000_ERT_2048 << 3)));
2797 else
2798 hwm = min(((pba << 10) * 9 / 10),
2799 ((pba << 10) - adapter->max_frame_size));
2787 2800
2788 fc->high_water = hwm & E1000_FCRTH_RTH; /* 8-byte granularity */ 2801 fc->high_water = hwm & E1000_FCRTH_RTH; /* 8-byte granularity */
2789 fc->low_water = (fc->high_water - (2 * adapter->max_frame_size)); 2802 fc->low_water = fc->high_water - 8;
2790 fc->low_water &= E1000_FCRTL_RTL; /* 8-byte granularity */ 2803 }
2791 2804
2792 if (adapter->flags & FLAG_DISABLE_FC_PAUSE_TIME) 2805 if (adapter->flags & FLAG_DISABLE_FC_PAUSE_TIME)
2793 fc->pause_time = 0xFFFF; 2806 fc->pause_time = 0xFFFF;
@@ -2813,6 +2826,10 @@ void e1000e_reset(struct e1000_adapter *adapter)
2813 if (mac->ops.init_hw(hw)) 2826 if (mac->ops.init_hw(hw))
2814 e_err("Hardware Error\n"); 2827 e_err("Hardware Error\n");
2815 2828
2829 /* additional part of the flow-control workaround above */
2830 if (hw->mac.type == e1000_pchlan)
2831 ew32(FCRTV_PCH, 0x1000);
2832
2816 e1000_update_mng_vlan(adapter); 2833 e1000_update_mng_vlan(adapter);
2817 2834
2818 /* Enable h/w to recognize an 802.1Q VLAN Ethernet packet */ 2835 /* Enable h/w to recognize an 802.1Q VLAN Ethernet packet */
@@ -3610,7 +3627,7 @@ static void e1000_watchdog_task(struct work_struct *work)
3610 case SPEED_100: 3627 case SPEED_100:
3611 txb2b = 0; 3628 txb2b = 0;
3612 netdev->tx_queue_len = 100; 3629 netdev->tx_queue_len = 100;
3613 /* maybe add some timeout factor ? */ 3630 adapter->tx_timeout_factor = 10;
3614 break; 3631 break;
3615 } 3632 }
3616 3633
@@ -4288,8 +4305,10 @@ static int e1000_change_mtu(struct net_device *netdev, int new_mtu)
4288 4305
4289 while (test_and_set_bit(__E1000_RESETTING, &adapter->state)) 4306 while (test_and_set_bit(__E1000_RESETTING, &adapter->state))
4290 msleep(1); 4307 msleep(1);
4291 /* e1000e_down has a dependency on max_frame_size */ 4308 /* e1000e_down -> e1000e_reset dependent on max_frame_size & mtu */
4292 adapter->max_frame_size = max_frame; 4309 adapter->max_frame_size = max_frame;
4310 e_info("changing MTU from %d to %d\n", netdev->mtu, new_mtu);
4311 netdev->mtu = new_mtu;
4293 if (netif_running(netdev)) 4312 if (netif_running(netdev))
4294 e1000e_down(adapter); 4313 e1000e_down(adapter);
4295 4314
@@ -4319,9 +4338,6 @@ static int e1000_change_mtu(struct net_device *netdev, int new_mtu)
4319 adapter->rx_buffer_len = ETH_FRAME_LEN + VLAN_HLEN 4338 adapter->rx_buffer_len = ETH_FRAME_LEN + VLAN_HLEN
4320 + ETH_FCS_LEN; 4339 + ETH_FCS_LEN;
4321 4340
4322 e_info("changing MTU from %d to %d\n", netdev->mtu, new_mtu);
4323 netdev->mtu = new_mtu;
4324
4325 if (netif_running(netdev)) 4341 if (netif_running(netdev))
4326 e1000e_up(adapter); 4342 e1000e_up(adapter);
4327 else 4343 else
diff --git a/drivers/net/e1000e/phy.c b/drivers/net/e1000e/phy.c
index f9d33ab05e97..85f955f70417 100644
--- a/drivers/net/e1000e/phy.c
+++ b/drivers/net/e1000e/phy.c
@@ -71,7 +71,6 @@ static const u16 e1000_igp_2_cable_length_table[] =
71#define I82577_CFG_ASSERT_CRS_ON_TX (1 << 15) 71#define I82577_CFG_ASSERT_CRS_ON_TX (1 << 15)
72#define I82577_CFG_ENABLE_DOWNSHIFT (3 << 10) /* auto downshift 100/10 */ 72#define I82577_CFG_ENABLE_DOWNSHIFT (3 << 10) /* auto downshift 100/10 */
73#define I82577_CTRL_REG 23 73#define I82577_CTRL_REG 23
74#define I82577_CTRL_DOWNSHIFT_MASK (7 << 10)
75 74
76/* 82577 specific PHY registers */ 75/* 82577 specific PHY registers */
77#define I82577_PHY_CTRL_2 18 76#define I82577_PHY_CTRL_2 18
@@ -95,13 +94,6 @@ static const u16 e1000_igp_2_cable_length_table[] =
95/* BM PHY Copper Specific Control 1 */ 94/* BM PHY Copper Specific Control 1 */
96#define BM_CS_CTRL1 16 95#define BM_CS_CTRL1 16
97 96
98/* BM PHY Copper Specific Status */
99#define BM_CS_STATUS 17
100#define BM_CS_STATUS_LINK_UP 0x0400
101#define BM_CS_STATUS_RESOLVED 0x0800
102#define BM_CS_STATUS_SPEED_MASK 0xC000
103#define BM_CS_STATUS_SPEED_1000 0x8000
104
105#define HV_MUX_DATA_CTRL PHY_REG(776, 16) 97#define HV_MUX_DATA_CTRL PHY_REG(776, 16)
106#define HV_MUX_DATA_CTRL_GEN_TO_MAC 0x0400 98#define HV_MUX_DATA_CTRL_GEN_TO_MAC 0x0400
107#define HV_MUX_DATA_CTRL_FORCE_SPEED 0x0004 99#define HV_MUX_DATA_CTRL_FORCE_SPEED 0x0004
@@ -563,7 +555,7 @@ s32 e1000e_read_kmrn_reg(struct e1000_hw *hw, u32 offset, u16 *data)
563} 555}
564 556
565/** 557/**
566 * e1000_read_kmrn_reg_locked - Read kumeran register 558 * e1000e_read_kmrn_reg_locked - Read kumeran register
567 * @hw: pointer to the HW structure 559 * @hw: pointer to the HW structure
568 * @offset: register offset to be read 560 * @offset: register offset to be read
569 * @data: pointer to the read data 561 * @data: pointer to the read data
@@ -572,7 +564,7 @@ s32 e1000e_read_kmrn_reg(struct e1000_hw *hw, u32 offset, u16 *data)
572 * information retrieved is stored in data. 564 * information retrieved is stored in data.
573 * Assumes semaphore already acquired. 565 * Assumes semaphore already acquired.
574 **/ 566 **/
575s32 e1000_read_kmrn_reg_locked(struct e1000_hw *hw, u32 offset, u16 *data) 567s32 e1000e_read_kmrn_reg_locked(struct e1000_hw *hw, u32 offset, u16 *data)
576{ 568{
577 return __e1000_read_kmrn_reg(hw, offset, data, true); 569 return __e1000_read_kmrn_reg(hw, offset, data, true);
578} 570}
@@ -631,7 +623,7 @@ s32 e1000e_write_kmrn_reg(struct e1000_hw *hw, u32 offset, u16 data)
631} 623}
632 624
633/** 625/**
634 * e1000_write_kmrn_reg_locked - Write kumeran register 626 * e1000e_write_kmrn_reg_locked - Write kumeran register
635 * @hw: pointer to the HW structure 627 * @hw: pointer to the HW structure
636 * @offset: register offset to write to 628 * @offset: register offset to write to
637 * @data: data to write at register offset 629 * @data: data to write at register offset
@@ -639,7 +631,7 @@ s32 e1000e_write_kmrn_reg(struct e1000_hw *hw, u32 offset, u16 data)
639 * Write the data to PHY register at the offset using the kumeran interface. 631 * Write the data to PHY register at the offset using the kumeran interface.
640 * Assumes semaphore already acquired. 632 * Assumes semaphore already acquired.
641 **/ 633 **/
642s32 e1000_write_kmrn_reg_locked(struct e1000_hw *hw, u32 offset, u16 data) 634s32 e1000e_write_kmrn_reg_locked(struct e1000_hw *hw, u32 offset, u16 data)
643{ 635{
644 return __e1000_write_kmrn_reg(hw, offset, data, true); 636 return __e1000_write_kmrn_reg(hw, offset, data, true);
645} 637}
@@ -667,15 +659,6 @@ s32 e1000_copper_link_setup_82577(struct e1000_hw *hw)
667 phy_data |= I82577_CFG_ENABLE_DOWNSHIFT; 659 phy_data |= I82577_CFG_ENABLE_DOWNSHIFT;
668 660
669 ret_val = phy->ops.write_phy_reg(hw, I82577_CFG_REG, phy_data); 661 ret_val = phy->ops.write_phy_reg(hw, I82577_CFG_REG, phy_data);
670 if (ret_val)
671 goto out;
672
673 /* Set number of link attempts before downshift */
674 ret_val = phy->ops.read_phy_reg(hw, I82577_CTRL_REG, &phy_data);
675 if (ret_val)
676 goto out;
677 phy_data &= ~I82577_CTRL_DOWNSHIFT_MASK;
678 ret_val = phy->ops.write_phy_reg(hw, I82577_CTRL_REG, phy_data);
679 662
680out: 663out:
681 return ret_val; 664 return ret_val;
@@ -2665,19 +2648,18 @@ static s32 __e1000_read_phy_reg_hv(struct e1000_hw *hw, u32 offset, u16 *data,
2665 page = 0; 2648 page = 0;
2666 2649
2667 if (reg > MAX_PHY_MULTI_PAGE_REG) { 2650 if (reg > MAX_PHY_MULTI_PAGE_REG) {
2668 if ((hw->phy.type != e1000_phy_82578) || 2651 u32 phy_addr = hw->phy.addr;
2669 ((reg != I82578_ADDR_REG) &&
2670 (reg != I82578_ADDR_REG + 1))) {
2671 u32 phy_addr = hw->phy.addr;
2672 2652
2673 hw->phy.addr = 1; 2653 hw->phy.addr = 1;
2674 2654
2675 /* Page is shifted left, PHY expects (page x 32) */ 2655 /* Page is shifted left, PHY expects (page x 32) */
2676 ret_val = e1000e_write_phy_reg_mdic(hw, 2656 ret_val = e1000e_write_phy_reg_mdic(hw,
2677 IGP01E1000_PHY_PAGE_SELECT, 2657 IGP01E1000_PHY_PAGE_SELECT,
2678 (page << IGP_PAGE_SHIFT)); 2658 (page << IGP_PAGE_SHIFT));
2679 hw->phy.addr = phy_addr; 2659 hw->phy.addr = phy_addr;
2680 } 2660
2661 if (ret_val)
2662 goto out;
2681 } 2663 }
2682 2664
2683 ret_val = e1000e_read_phy_reg_mdic(hw, MAX_PHY_REG_ADDRESS & reg, 2665 ret_val = e1000e_read_phy_reg_mdic(hw, MAX_PHY_REG_ADDRESS & reg,
@@ -2685,7 +2667,7 @@ static s32 __e1000_read_phy_reg_hv(struct e1000_hw *hw, u32 offset, u16 *data,
2685out: 2667out:
2686 /* Revert to MDIO fast mode, if applicable */ 2668 /* Revert to MDIO fast mode, if applicable */
2687 if ((hw->phy.type == e1000_phy_82577) && in_slow_mode) 2669 if ((hw->phy.type == e1000_phy_82577) && in_slow_mode)
2688 ret_val = e1000_set_mdio_slow_mode_hv(hw, false); 2670 ret_val |= e1000_set_mdio_slow_mode_hv(hw, false);
2689 2671
2690 if (!locked) 2672 if (!locked)
2691 hw->phy.ops.release_phy(hw); 2673 hw->phy.ops.release_phy(hw);
@@ -2791,19 +2773,18 @@ static s32 __e1000_write_phy_reg_hv(struct e1000_hw *hw, u32 offset, u16 data,
2791 } 2773 }
2792 2774
2793 if (reg > MAX_PHY_MULTI_PAGE_REG) { 2775 if (reg > MAX_PHY_MULTI_PAGE_REG) {
2794 if ((hw->phy.type != e1000_phy_82578) || 2776 u32 phy_addr = hw->phy.addr;
2795 ((reg != I82578_ADDR_REG) &&
2796 (reg != I82578_ADDR_REG + 1))) {
2797 u32 phy_addr = hw->phy.addr;
2798 2777
2799 hw->phy.addr = 1; 2778 hw->phy.addr = 1;
2800 2779
2801 /* Page is shifted left, PHY expects (page x 32) */ 2780 /* Page is shifted left, PHY expects (page x 32) */
2802 ret_val = e1000e_write_phy_reg_mdic(hw, 2781 ret_val = e1000e_write_phy_reg_mdic(hw,
2803 IGP01E1000_PHY_PAGE_SELECT, 2782 IGP01E1000_PHY_PAGE_SELECT,
2804 (page << IGP_PAGE_SHIFT)); 2783 (page << IGP_PAGE_SHIFT));
2805 hw->phy.addr = phy_addr; 2784 hw->phy.addr = phy_addr;
2806 } 2785
2786 if (ret_val)
2787 goto out;
2807 } 2788 }
2808 2789
2809 ret_val = e1000e_write_phy_reg_mdic(hw, MAX_PHY_REG_ADDRESS & reg, 2790 ret_val = e1000e_write_phy_reg_mdic(hw, MAX_PHY_REG_ADDRESS & reg,
@@ -2812,7 +2793,7 @@ static s32 __e1000_write_phy_reg_hv(struct e1000_hw *hw, u32 offset, u16 data,
2812out: 2793out:
2813 /* Revert to MDIO fast mode, if applicable */ 2794 /* Revert to MDIO fast mode, if applicable */
2814 if ((hw->phy.type == e1000_phy_82577) && in_slow_mode) 2795 if ((hw->phy.type == e1000_phy_82577) && in_slow_mode)
2815 ret_val = e1000_set_mdio_slow_mode_hv(hw, false); 2796 ret_val |= e1000_set_mdio_slow_mode_hv(hw, false);
2816 2797
2817 if (!locked) 2798 if (!locked)
2818 hw->phy.ops.release_phy(hw); 2799 hw->phy.ops.release_phy(hw);
diff --git a/drivers/net/forcedeth.c b/drivers/net/forcedeth.c
index e1da4666f204..3116601dbfea 100644
--- a/drivers/net/forcedeth.c
+++ b/drivers/net/forcedeth.c
@@ -5821,10 +5821,7 @@ static int __devinit nv_probe(struct pci_dev *pci_dev, const struct pci_device_i
5821 dev->dev_addr); 5821 dev->dev_addr);
5822 dev_printk(KERN_ERR, &pci_dev->dev, 5822 dev_printk(KERN_ERR, &pci_dev->dev,
5823 "Please complain to your hardware vendor. Switching to a random MAC.\n"); 5823 "Please complain to your hardware vendor. Switching to a random MAC.\n");
5824 dev->dev_addr[0] = 0x00; 5824 random_ether_addr(dev->dev_addr);
5825 dev->dev_addr[1] = 0x00;
5826 dev->dev_addr[2] = 0x6c;
5827 get_random_bytes(&dev->dev_addr[3], 3);
5828 } 5825 }
5829 5826
5830 dprintk(KERN_DEBUG "%s: MAC Address %pM\n", 5827 dprintk(KERN_DEBUG "%s: MAC Address %pM\n",
diff --git a/drivers/net/fsl_pq_mdio.c b/drivers/net/fsl_pq_mdio.c
index 6ac464866972..efbf67689eca 100644
--- a/drivers/net/fsl_pq_mdio.c
+++ b/drivers/net/fsl_pq_mdio.c
@@ -427,3 +427,4 @@ void fsl_pq_mdio_exit(void)
427 of_unregister_platform_driver(&fsl_pq_mdio_driver); 427 of_unregister_platform_driver(&fsl_pq_mdio_driver);
428} 428}
429module_exit(fsl_pq_mdio_exit); 429module_exit(fsl_pq_mdio_exit);
430MODULE_LICENSE("GPL");
diff --git a/drivers/net/ibm_newemac/emac.h b/drivers/net/ibm_newemac/emac.h
index d34adf99fc6a..8a61b597a169 100644
--- a/drivers/net/ibm_newemac/emac.h
+++ b/drivers/net/ibm_newemac/emac.h
@@ -263,8 +263,8 @@ struct emac_regs {
263 263
264 264
265/* EMACx_TRTR */ 265/* EMACx_TRTR */
266#define EMAC_TRTR_SHIFT_EMAC4 27 266#define EMAC_TRTR_SHIFT_EMAC4 24
267#define EMAC_TRTR_SHIFT 24 267#define EMAC_TRTR_SHIFT 27
268 268
269/* EMAC specific TX descriptor control fields (write access) */ 269/* EMAC specific TX descriptor control fields (write access) */
270#define EMAC_TX_CTRL_GFCS 0x0200 270#define EMAC_TX_CTRL_GFCS 0x0200
diff --git a/drivers/net/ixgbe/ixgbe_main.c b/drivers/net/ixgbe/ixgbe_main.c
index cbb143ca1eb8..a456578b8578 100644
--- a/drivers/net/ixgbe/ixgbe_main.c
+++ b/drivers/net/ixgbe/ixgbe_main.c
@@ -44,6 +44,7 @@
44 44
45#include "ixgbe.h" 45#include "ixgbe.h"
46#include "ixgbe_common.h" 46#include "ixgbe_common.h"
47#include "ixgbe_dcb_82599.h"
47 48
48char ixgbe_driver_name[] = "ixgbe"; 49char ixgbe_driver_name[] = "ixgbe";
49static const char ixgbe_driver_string[] = 50static const char ixgbe_driver_string[] =
@@ -226,6 +227,56 @@ static void ixgbe_unmap_and_free_tx_resource(struct ixgbe_adapter *adapter,
226 /* tx_buffer_info must be completely set up in the transmit path */ 227 /* tx_buffer_info must be completely set up in the transmit path */
227} 228}
228 229
230/**
231 * ixgbe_tx_is_paused - check if the tx ring is paused
232 * @adapter: the ixgbe adapter
233 * @tx_ring: the corresponding tx_ring
234 *
235 * If not in DCB mode, checks TFCS.TXOFF, otherwise, find out the
236 * corresponding TC of this tx_ring when checking TFCS.
237 *
238 * Returns : true if paused
239 */
240static inline bool ixgbe_tx_is_paused(struct ixgbe_adapter *adapter,
241 struct ixgbe_ring *tx_ring)
242{
243 u32 txoff = IXGBE_TFCS_TXOFF;
244
245#ifdef CONFIG_IXGBE_DCB
246 if (adapter->flags & IXGBE_FLAG_DCB_ENABLED) {
247 int tc;
248 int reg_idx = tx_ring->reg_idx;
249 int dcb_i = adapter->ring_feature[RING_F_DCB].indices;
250
251 if (adapter->hw.mac.type == ixgbe_mac_82598EB) {
252 tc = reg_idx >> 2;
253 txoff = IXGBE_TFCS_TXOFF0;
254 } else if (adapter->hw.mac.type == ixgbe_mac_82599EB) {
255 tc = 0;
256 txoff = IXGBE_TFCS_TXOFF;
257 if (dcb_i == 8) {
258 /* TC0, TC1 */
259 tc = reg_idx >> 5;
260 if (tc == 2) /* TC2, TC3 */
261 tc += (reg_idx - 64) >> 4;
262 else if (tc == 3) /* TC4, TC5, TC6, TC7 */
263 tc += 1 + ((reg_idx - 96) >> 3);
264 } else if (dcb_i == 4) {
265 /* TC0, TC1 */
266 tc = reg_idx >> 6;
267 if (tc == 1) {
268 tc += (reg_idx - 64) >> 5;
269 if (tc == 2) /* TC2, TC3 */
270 tc += (reg_idx - 96) >> 4;
271 }
272 }
273 }
274 txoff <<= tc;
275 }
276#endif
277 return IXGBE_READ_REG(&adapter->hw, IXGBE_TFCS) & txoff;
278}
279
229static inline bool ixgbe_check_tx_hang(struct ixgbe_adapter *adapter, 280static inline bool ixgbe_check_tx_hang(struct ixgbe_adapter *adapter,
230 struct ixgbe_ring *tx_ring, 281 struct ixgbe_ring *tx_ring,
231 unsigned int eop) 282 unsigned int eop)
@@ -237,7 +288,7 @@ static inline bool ixgbe_check_tx_hang(struct ixgbe_adapter *adapter,
237 adapter->detect_tx_hung = false; 288 adapter->detect_tx_hung = false;
238 if (tx_ring->tx_buffer_info[eop].time_stamp && 289 if (tx_ring->tx_buffer_info[eop].time_stamp &&
239 time_after(jiffies, tx_ring->tx_buffer_info[eop].time_stamp + HZ) && 290 time_after(jiffies, tx_ring->tx_buffer_info[eop].time_stamp + HZ) &&
240 !(IXGBE_READ_REG(&adapter->hw, IXGBE_TFCS) & IXGBE_TFCS_TXOFF)) { 291 !ixgbe_tx_is_paused(adapter, tx_ring)) {
241 /* detected Tx unit hang */ 292 /* detected Tx unit hang */
242 union ixgbe_adv_tx_desc *tx_desc; 293 union ixgbe_adv_tx_desc *tx_desc;
243 tx_desc = IXGBE_TX_DESC_ADV(*tx_ring, eop); 294 tx_desc = IXGBE_TX_DESC_ADV(*tx_ring, eop);
@@ -412,19 +463,23 @@ static void ixgbe_update_tx_dca(struct ixgbe_adapter *adapter,
412 u32 txctrl; 463 u32 txctrl;
413 int cpu = get_cpu(); 464 int cpu = get_cpu();
414 int q = tx_ring - adapter->tx_ring; 465 int q = tx_ring - adapter->tx_ring;
466 struct ixgbe_hw *hw = &adapter->hw;
415 467
416 if (tx_ring->cpu != cpu) { 468 if (tx_ring->cpu != cpu) {
417 txctrl = IXGBE_READ_REG(&adapter->hw, IXGBE_DCA_TXCTRL(q));
418 if (adapter->hw.mac.type == ixgbe_mac_82598EB) { 469 if (adapter->hw.mac.type == ixgbe_mac_82598EB) {
470 txctrl = IXGBE_READ_REG(hw, IXGBE_DCA_TXCTRL(q));
419 txctrl &= ~IXGBE_DCA_TXCTRL_CPUID_MASK; 471 txctrl &= ~IXGBE_DCA_TXCTRL_CPUID_MASK;
420 txctrl |= dca3_get_tag(&adapter->pdev->dev, cpu); 472 txctrl |= dca3_get_tag(&adapter->pdev->dev, cpu);
473 txctrl |= IXGBE_DCA_TXCTRL_DESC_DCA_EN;
474 IXGBE_WRITE_REG(hw, IXGBE_DCA_TXCTRL(q), txctrl);
421 } else if (adapter->hw.mac.type == ixgbe_mac_82599EB) { 475 } else if (adapter->hw.mac.type == ixgbe_mac_82599EB) {
476 txctrl = IXGBE_READ_REG(hw, IXGBE_DCA_TXCTRL_82599(q));
422 txctrl &= ~IXGBE_DCA_TXCTRL_CPUID_MASK_82599; 477 txctrl &= ~IXGBE_DCA_TXCTRL_CPUID_MASK_82599;
423 txctrl |= (dca3_get_tag(&adapter->pdev->dev, cpu) << 478 txctrl |= (dca3_get_tag(&adapter->pdev->dev, cpu) <<
424 IXGBE_DCA_TXCTRL_CPUID_SHIFT_82599); 479 IXGBE_DCA_TXCTRL_CPUID_SHIFT_82599);
480 txctrl |= IXGBE_DCA_TXCTRL_DESC_DCA_EN;
481 IXGBE_WRITE_REG(hw, IXGBE_DCA_TXCTRL_82599(q), txctrl);
425 } 482 }
426 txctrl |= IXGBE_DCA_TXCTRL_DESC_DCA_EN;
427 IXGBE_WRITE_REG(&adapter->hw, IXGBE_DCA_TXCTRL(q), txctrl);
428 tx_ring->cpu = cpu; 483 tx_ring->cpu = cpu;
429 } 484 }
430 put_cpu(); 485 put_cpu();
@@ -1913,11 +1968,25 @@ static void ixgbe_configure_tx(struct ixgbe_adapter *adapter)
1913 break; 1968 break;
1914 } 1969 }
1915 } 1970 }
1971
1916 if (hw->mac.type == ixgbe_mac_82599EB) { 1972 if (hw->mac.type == ixgbe_mac_82599EB) {
1973 u32 rttdcs;
1974
1975 /* disable the arbiter while setting MTQC */
1976 rttdcs = IXGBE_READ_REG(hw, IXGBE_RTTDCS);
1977 rttdcs |= IXGBE_RTTDCS_ARBDIS;
1978 IXGBE_WRITE_REG(hw, IXGBE_RTTDCS, rttdcs);
1979
1917 /* We enable 8 traffic classes, DCB only */ 1980 /* We enable 8 traffic classes, DCB only */
1918 if (adapter->flags & IXGBE_FLAG_DCB_ENABLED) 1981 if (adapter->flags & IXGBE_FLAG_DCB_ENABLED)
1919 IXGBE_WRITE_REG(hw, IXGBE_MTQC, (IXGBE_MTQC_RT_ENA | 1982 IXGBE_WRITE_REG(hw, IXGBE_MTQC, (IXGBE_MTQC_RT_ENA |
1920 IXGBE_MTQC_8TC_8TQ)); 1983 IXGBE_MTQC_8TC_8TQ));
1984 else
1985 IXGBE_WRITE_REG(hw, IXGBE_MTQC, IXGBE_MTQC_64Q_1PB);
1986
1987 /* re-eable the arbiter */
1988 rttdcs &= ~IXGBE_RTTDCS_ARBDIS;
1989 IXGBE_WRITE_REG(hw, IXGBE_RTTDCS, rttdcs);
1921 } 1990 }
1922} 1991}
1923 1992
@@ -2471,7 +2540,10 @@ static void ixgbe_configure(struct ixgbe_adapter *adapter)
2471 ixgbe_restore_vlan(adapter); 2540 ixgbe_restore_vlan(adapter);
2472#ifdef CONFIG_IXGBE_DCB 2541#ifdef CONFIG_IXGBE_DCB
2473 if (adapter->flags & IXGBE_FLAG_DCB_ENABLED) { 2542 if (adapter->flags & IXGBE_FLAG_DCB_ENABLED) {
2474 netif_set_gso_max_size(netdev, 32768); 2543 if (hw->mac.type == ixgbe_mac_82598EB)
2544 netif_set_gso_max_size(netdev, 32768);
2545 else
2546 netif_set_gso_max_size(netdev, 65536);
2475 ixgbe_configure_dcb(adapter); 2547 ixgbe_configure_dcb(adapter);
2476 } else { 2548 } else {
2477 netif_set_gso_max_size(netdev, 65536); 2549 netif_set_gso_max_size(netdev, 65536);
@@ -5922,6 +5994,7 @@ static pci_ers_result_t ixgbe_io_slot_reset(struct pci_dev *pdev)
5922 } else { 5994 } else {
5923 pci_set_master(pdev); 5995 pci_set_master(pdev);
5924 pci_restore_state(pdev); 5996 pci_restore_state(pdev);
5997 pci_save_state(pdev);
5925 5998
5926 pci_wake_from_d3(pdev, false); 5999 pci_wake_from_d3(pdev, false);
5927 6000
diff --git a/drivers/net/ks8851_mll.c b/drivers/net/ks8851_mll.c
index 0be14d702beb..c146304d8d6c 100644
--- a/drivers/net/ks8851_mll.c
+++ b/drivers/net/ks8851_mll.c
@@ -568,6 +568,16 @@ static inline void ks_outblk(struct ks_net *ks, u16 *wptr, u32 len)
568 iowrite16(*wptr++, ks->hw_addr); 568 iowrite16(*wptr++, ks->hw_addr);
569} 569}
570 570
571static void ks_disable_int(struct ks_net *ks)
572{
573 ks_wrreg16(ks, KS_IER, 0x0000);
574} /* ks_disable_int */
575
576static void ks_enable_int(struct ks_net *ks)
577{
578 ks_wrreg16(ks, KS_IER, ks->rc_ier);
579} /* ks_enable_int */
580
571/** 581/**
572 * ks_tx_fifo_space - return the available hardware buffer size. 582 * ks_tx_fifo_space - return the available hardware buffer size.
573 * @ks: The chip information 583 * @ks: The chip information
@@ -681,6 +691,47 @@ static void ks_soft_reset(struct ks_net *ks, unsigned op)
681} 691}
682 692
683 693
694void ks_enable_qmu(struct ks_net *ks)
695{
696 u16 w;
697
698 w = ks_rdreg16(ks, KS_TXCR);
699 /* Enables QMU Transmit (TXCR). */
700 ks_wrreg16(ks, KS_TXCR, w | TXCR_TXE);
701
702 /*
703 * RX Frame Count Threshold Enable and Auto-Dequeue RXQ Frame
704 * Enable
705 */
706
707 w = ks_rdreg16(ks, KS_RXQCR);
708 ks_wrreg16(ks, KS_RXQCR, w | RXQCR_RXFCTE);
709
710 /* Enables QMU Receive (RXCR1). */
711 w = ks_rdreg16(ks, KS_RXCR1);
712 ks_wrreg16(ks, KS_RXCR1, w | RXCR1_RXE);
713 ks->enabled = true;
714} /* ks_enable_qmu */
715
716static void ks_disable_qmu(struct ks_net *ks)
717{
718 u16 w;
719
720 w = ks_rdreg16(ks, KS_TXCR);
721
722 /* Disables QMU Transmit (TXCR). */
723 w &= ~TXCR_TXE;
724 ks_wrreg16(ks, KS_TXCR, w);
725
726 /* Disables QMU Receive (RXCR1). */
727 w = ks_rdreg16(ks, KS_RXCR1);
728 w &= ~RXCR1_RXE ;
729 ks_wrreg16(ks, KS_RXCR1, w);
730
731 ks->enabled = false;
732
733} /* ks_disable_qmu */
734
684/** 735/**
685 * ks_read_qmu - read 1 pkt data from the QMU. 736 * ks_read_qmu - read 1 pkt data from the QMU.
686 * @ks: The chip information 737 * @ks: The chip information
@@ -752,7 +803,7 @@ static void ks_rcv(struct ks_net *ks, struct net_device *netdev)
752 (frame_hdr->len < RX_BUF_SIZE) && frame_hdr->len)) { 803 (frame_hdr->len < RX_BUF_SIZE) && frame_hdr->len)) {
753 skb_reserve(skb, 2); 804 skb_reserve(skb, 2);
754 /* read data block including CRC 4 bytes */ 805 /* read data block including CRC 4 bytes */
755 ks_read_qmu(ks, (u16 *)skb->data, frame_hdr->len + 4); 806 ks_read_qmu(ks, (u16 *)skb->data, frame_hdr->len);
756 skb_put(skb, frame_hdr->len); 807 skb_put(skb, frame_hdr->len);
757 skb->dev = netdev; 808 skb->dev = netdev;
758 skb->protocol = eth_type_trans(skb, netdev); 809 skb->protocol = eth_type_trans(skb, netdev);
@@ -861,7 +912,7 @@ static int ks_net_open(struct net_device *netdev)
861 ks_dbg(ks, "%s - entry\n", __func__); 912 ks_dbg(ks, "%s - entry\n", __func__);
862 913
863 /* reset the HW */ 914 /* reset the HW */
864 err = request_irq(ks->irq, ks_irq, KS_INT_FLAGS, DRV_NAME, ks); 915 err = request_irq(ks->irq, ks_irq, KS_INT_FLAGS, DRV_NAME, netdev);
865 916
866 if (err) { 917 if (err) {
867 printk(KERN_ERR "Failed to request IRQ: %d: %d\n", 918 printk(KERN_ERR "Failed to request IRQ: %d: %d\n",
@@ -869,6 +920,15 @@ static int ks_net_open(struct net_device *netdev)
869 return err; 920 return err;
870 } 921 }
871 922
923 /* wake up powermode to normal mode */
924 ks_set_powermode(ks, PMECR_PM_NORMAL);
925 mdelay(1); /* wait for normal mode to take effect */
926
927 ks_wrreg16(ks, KS_ISR, 0xffff);
928 ks_enable_int(ks);
929 ks_enable_qmu(ks);
930 netif_start_queue(ks->netdev);
931
872 if (netif_msg_ifup(ks)) 932 if (netif_msg_ifup(ks))
873 ks_dbg(ks, "network device %s up\n", netdev->name); 933 ks_dbg(ks, "network device %s up\n", netdev->name);
874 934
@@ -892,19 +952,14 @@ static int ks_net_stop(struct net_device *netdev)
892 952
893 netif_stop_queue(netdev); 953 netif_stop_queue(netdev);
894 954
895 kfree(ks->frame_head_info);
896
897 mutex_lock(&ks->lock); 955 mutex_lock(&ks->lock);
898 956
899 /* turn off the IRQs and ack any outstanding */ 957 /* turn off the IRQs and ack any outstanding */
900 ks_wrreg16(ks, KS_IER, 0x0000); 958 ks_wrreg16(ks, KS_IER, 0x0000);
901 ks_wrreg16(ks, KS_ISR, 0xffff); 959 ks_wrreg16(ks, KS_ISR, 0xffff);
902 960
903 /* shutdown RX process */ 961 /* shutdown RX/TX QMU */
904 ks_wrreg16(ks, KS_RXCR1, 0x0000); 962 ks_disable_qmu(ks);
905
906 /* shutdown TX process */
907 ks_wrreg16(ks, KS_TXCR, 0x0000);
908 963
909 /* set powermode to soft power down to save power */ 964 /* set powermode to soft power down to save power */
910 ks_set_powermode(ks, PMECR_PM_SOFTDOWN); 965 ks_set_powermode(ks, PMECR_PM_SOFTDOWN);
@@ -929,17 +984,8 @@ static int ks_net_stop(struct net_device *netdev)
929 */ 984 */
930static void ks_write_qmu(struct ks_net *ks, u8 *pdata, u16 len) 985static void ks_write_qmu(struct ks_net *ks, u8 *pdata, u16 len)
931{ 986{
932 unsigned fid = ks->fid;
933
934 fid = ks->fid;
935 ks->fid = (ks->fid + 1) & TXFR_TXFID_MASK;
936
937 /* reduce the tx interrupt occurrances. */
938 if (!fid)
939 fid |= TXFR_TXIC; /* irq on completion */
940
941 /* start header at txb[0] to align txw entries */ 987 /* start header at txb[0] to align txw entries */
942 ks->txh.txw[0] = cpu_to_le16(fid); 988 ks->txh.txw[0] = 0;
943 ks->txh.txw[1] = cpu_to_le16(len); 989 ks->txh.txw[1] = cpu_to_le16(len);
944 990
945 /* 1. set sudo-DMA mode */ 991 /* 1. set sudo-DMA mode */
@@ -957,16 +1003,6 @@ static void ks_write_qmu(struct ks_net *ks, u8 *pdata, u16 len)
957 ; 1003 ;
958} 1004}
959 1005
960static void ks_disable_int(struct ks_net *ks)
961{
962 ks_wrreg16(ks, KS_IER, 0x0000);
963} /* ks_disable_int */
964
965static void ks_enable_int(struct ks_net *ks)
966{
967 ks_wrreg16(ks, KS_IER, ks->rc_ier);
968} /* ks_enable_int */
969
970/** 1006/**
971 * ks_start_xmit - transmit packet 1007 * ks_start_xmit - transmit packet
972 * @skb : The buffer to transmit 1008 * @skb : The buffer to transmit
@@ -1410,25 +1446,6 @@ static int ks_read_selftest(struct ks_net *ks)
1410 return ret; 1446 return ret;
1411} 1447}
1412 1448
1413static void ks_disable(struct ks_net *ks)
1414{
1415 u16 w;
1416
1417 w = ks_rdreg16(ks, KS_TXCR);
1418
1419 /* Disables QMU Transmit (TXCR). */
1420 w &= ~TXCR_TXE;
1421 ks_wrreg16(ks, KS_TXCR, w);
1422
1423 /* Disables QMU Receive (RXCR1). */
1424 w = ks_rdreg16(ks, KS_RXCR1);
1425 w &= ~RXCR1_RXE ;
1426 ks_wrreg16(ks, KS_RXCR1, w);
1427
1428 ks->enabled = false;
1429
1430} /* ks_disable */
1431
1432static void ks_setup(struct ks_net *ks) 1449static void ks_setup(struct ks_net *ks)
1433{ 1450{
1434 u16 w; 1451 u16 w;
@@ -1463,7 +1480,7 @@ static void ks_setup(struct ks_net *ks)
1463 w = TXCR_TXFCE | TXCR_TXPE | TXCR_TXCRC | TXCR_TCGIP; 1480 w = TXCR_TXFCE | TXCR_TXPE | TXCR_TXCRC | TXCR_TCGIP;
1464 ks_wrreg16(ks, KS_TXCR, w); 1481 ks_wrreg16(ks, KS_TXCR, w);
1465 1482
1466 w = RXCR1_RXFCE | RXCR1_RXBE | RXCR1_RXUE; 1483 w = RXCR1_RXFCE | RXCR1_RXBE | RXCR1_RXUE | RXCR1_RXME | RXCR1_RXIPFCC;
1467 1484
1468 if (ks->promiscuous) /* bPromiscuous */ 1485 if (ks->promiscuous) /* bPromiscuous */
1469 w |= (RXCR1_RXAE | RXCR1_RXINVF); 1486 w |= (RXCR1_RXAE | RXCR1_RXINVF);
@@ -1486,28 +1503,6 @@ static void ks_setup_int(struct ks_net *ks)
1486 ks->rc_ier = (IRQ_LCI | IRQ_TXI | IRQ_RXI); 1503 ks->rc_ier = (IRQ_LCI | IRQ_TXI | IRQ_RXI);
1487} /* ks_setup_int */ 1504} /* ks_setup_int */
1488 1505
1489void ks_enable(struct ks_net *ks)
1490{
1491 u16 w;
1492
1493 w = ks_rdreg16(ks, KS_TXCR);
1494 /* Enables QMU Transmit (TXCR). */
1495 ks_wrreg16(ks, KS_TXCR, w | TXCR_TXE);
1496
1497 /*
1498 * RX Frame Count Threshold Enable and Auto-Dequeue RXQ Frame
1499 * Enable
1500 */
1501
1502 w = ks_rdreg16(ks, KS_RXQCR);
1503 ks_wrreg16(ks, KS_RXQCR, w | RXQCR_RXFCTE);
1504
1505 /* Enables QMU Receive (RXCR1). */
1506 w = ks_rdreg16(ks, KS_RXCR1);
1507 ks_wrreg16(ks, KS_RXCR1, w | RXCR1_RXE);
1508 ks->enabled = true;
1509} /* ks_enable */
1510
1511static int ks_hw_init(struct ks_net *ks) 1506static int ks_hw_init(struct ks_net *ks)
1512{ 1507{
1513#define MHEADER_SIZE (sizeof(struct type_frame_head) * MAX_RECV_FRAMES) 1508#define MHEADER_SIZE (sizeof(struct type_frame_head) * MAX_RECV_FRAMES)
@@ -1612,11 +1607,9 @@ static int __devinit ks8851_probe(struct platform_device *pdev)
1612 1607
1613 ks_soft_reset(ks, GRR_GSR); 1608 ks_soft_reset(ks, GRR_GSR);
1614 ks_hw_init(ks); 1609 ks_hw_init(ks);
1615 ks_disable(ks); 1610 ks_disable_qmu(ks);
1616 ks_setup(ks); 1611 ks_setup(ks);
1617 ks_setup_int(ks); 1612 ks_setup_int(ks);
1618 ks_enable_int(ks);
1619 ks_enable(ks);
1620 memcpy(netdev->dev_addr, ks->mac_addr, 6); 1613 memcpy(netdev->dev_addr, ks->mac_addr, 6);
1621 1614
1622 data = ks_rdreg16(ks, KS_OBCR); 1615 data = ks_rdreg16(ks, KS_OBCR);
@@ -1658,6 +1651,7 @@ static int __devexit ks8851_remove(struct platform_device *pdev)
1658 struct ks_net *ks = netdev_priv(netdev); 1651 struct ks_net *ks = netdev_priv(netdev);
1659 struct resource *iomem = platform_get_resource(pdev, IORESOURCE_MEM, 0); 1652 struct resource *iomem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
1660 1653
1654 kfree(ks->frame_head_info);
1661 unregister_netdev(netdev); 1655 unregister_netdev(netdev);
1662 iounmap(ks->hw_addr); 1656 iounmap(ks->hw_addr);
1663 free_netdev(netdev); 1657 free_netdev(netdev);
diff --git a/drivers/net/macsonic.c b/drivers/net/macsonic.c
index 61eabcac734c..b3d7d8d77f46 100644
--- a/drivers/net/macsonic.c
+++ b/drivers/net/macsonic.c
@@ -223,69 +223,73 @@ static int __devinit macsonic_init(struct net_device *dev)
223 return 0; 223 return 0;
224} 224}
225 225
226static int __devinit mac_onboard_sonic_ethernet_addr(struct net_device *dev) 226#define INVALID_MAC(mac) (memcmp(mac, "\x08\x00\x07", 3) && \
227 memcmp(mac, "\x00\xA0\x40", 3) && \
228 memcmp(mac, "\x00\x80\x19", 3) && \
229 memcmp(mac, "\x00\x05\x02", 3))
230
231static void __devinit mac_onboard_sonic_ethernet_addr(struct net_device *dev)
227{ 232{
228 struct sonic_local *lp = netdev_priv(dev); 233 struct sonic_local *lp = netdev_priv(dev);
229 const int prom_addr = ONBOARD_SONIC_PROM_BASE; 234 const int prom_addr = ONBOARD_SONIC_PROM_BASE;
230 int i; 235 unsigned short val;
231 236
232 /* On NuBus boards we can sometimes look in the ROM resources. 237 /*
233 No such luck for comm-slot/onboard. */ 238 * On NuBus boards we can sometimes look in the ROM resources.
234 for(i = 0; i < 6; i++) 239 * No such luck for comm-slot/onboard.
235 dev->dev_addr[i] = SONIC_READ_PROM(i); 240 * On the PowerBook 520, the PROM base address is a mystery.
241 */
242 if (hwreg_present((void *)prom_addr)) {
243 int i;
244
245 for (i = 0; i < 6; i++)
246 dev->dev_addr[i] = SONIC_READ_PROM(i);
247 if (!INVALID_MAC(dev->dev_addr))
248 return;
236 249
237 /* Most of the time, the address is bit-reversed. The NetBSD 250 /*
238 source has a rather long and detailed historical account of 251 * Most of the time, the address is bit-reversed. The NetBSD
239 why this is so. */ 252 * source has a rather long and detailed historical account of
240 if (memcmp(dev->dev_addr, "\x08\x00\x07", 3) && 253 * why this is so.
241 memcmp(dev->dev_addr, "\x00\xA0\x40", 3) && 254 */
242 memcmp(dev->dev_addr, "\x00\x80\x19", 3) &&
243 memcmp(dev->dev_addr, "\x00\x05\x02", 3))
244 bit_reverse_addr(dev->dev_addr); 255 bit_reverse_addr(dev->dev_addr);
245 else 256 if (!INVALID_MAC(dev->dev_addr))
246 return 0; 257 return;
247 258
248 /* If we still have what seems to be a bogus address, we'll
249 look in the CAM. The top entry should be ours. */
250 /* Danger! This only works if MacOS has already initialized
251 the card... */
252 if (memcmp(dev->dev_addr, "\x08\x00\x07", 3) &&
253 memcmp(dev->dev_addr, "\x00\xA0\x40", 3) &&
254 memcmp(dev->dev_addr, "\x00\x80\x19", 3) &&
255 memcmp(dev->dev_addr, "\x00\x05\x02", 3))
256 {
257 unsigned short val;
258
259 printk(KERN_INFO "macsonic: PROM seems to be wrong, trying CAM entry 15\n");
260
261 SONIC_WRITE(SONIC_CMD, SONIC_CR_RST);
262 SONIC_WRITE(SONIC_CEP, 15);
263
264 val = SONIC_READ(SONIC_CAP2);
265 dev->dev_addr[5] = val >> 8;
266 dev->dev_addr[4] = val & 0xff;
267 val = SONIC_READ(SONIC_CAP1);
268 dev->dev_addr[3] = val >> 8;
269 dev->dev_addr[2] = val & 0xff;
270 val = SONIC_READ(SONIC_CAP0);
271 dev->dev_addr[1] = val >> 8;
272 dev->dev_addr[0] = val & 0xff;
273
274 printk(KERN_INFO "HW Address from CAM 15: %pM\n",
275 dev->dev_addr);
276 } else return 0;
277
278 if (memcmp(dev->dev_addr, "\x08\x00\x07", 3) &&
279 memcmp(dev->dev_addr, "\x00\xA0\x40", 3) &&
280 memcmp(dev->dev_addr, "\x00\x80\x19", 3) &&
281 memcmp(dev->dev_addr, "\x00\x05\x02", 3))
282 {
283 /* 259 /*
284 * Still nonsense ... messed up someplace! 260 * If we still have what seems to be a bogus address, we'll
261 * look in the CAM. The top entry should be ours.
285 */ 262 */
286 printk(KERN_ERR "macsonic: ERROR (INVALID MAC)\n"); 263 printk(KERN_WARNING "macsonic: MAC address in PROM seems "
287 return -EIO; 264 "to be invalid, trying CAM\n");
288 } else return 0; 265 } else {
266 printk(KERN_WARNING "macsonic: cannot read MAC address from "
267 "PROM, trying CAM\n");
268 }
269
270 /* This only works if MacOS has already initialized the card. */
271
272 SONIC_WRITE(SONIC_CMD, SONIC_CR_RST);
273 SONIC_WRITE(SONIC_CEP, 15);
274
275 val = SONIC_READ(SONIC_CAP2);
276 dev->dev_addr[5] = val >> 8;
277 dev->dev_addr[4] = val & 0xff;
278 val = SONIC_READ(SONIC_CAP1);
279 dev->dev_addr[3] = val >> 8;
280 dev->dev_addr[2] = val & 0xff;
281 val = SONIC_READ(SONIC_CAP0);
282 dev->dev_addr[1] = val >> 8;
283 dev->dev_addr[0] = val & 0xff;
284
285 if (!INVALID_MAC(dev->dev_addr))
286 return;
287
288 /* Still nonsense ... messed up someplace! */
289
290 printk(KERN_WARNING "macsonic: MAC address in CAM entry 15 "
291 "seems invalid, will use a random MAC\n");
292 random_ether_addr(dev->dev_addr);
289} 293}
290 294
291static int __devinit mac_onboard_sonic_probe(struct net_device *dev) 295static int __devinit mac_onboard_sonic_probe(struct net_device *dev)
@@ -402,8 +406,7 @@ static int __devinit mac_onboard_sonic_probe(struct net_device *dev)
402 SONIC_WRITE(SONIC_ISR, 0x7fff); 406 SONIC_WRITE(SONIC_ISR, 0x7fff);
403 407
404 /* Now look for the MAC address. */ 408 /* Now look for the MAC address. */
405 if (mac_onboard_sonic_ethernet_addr(dev) != 0) 409 mac_onboard_sonic_ethernet_addr(dev);
406 return -ENODEV;
407 410
408 /* Shared init code */ 411 /* Shared init code */
409 return macsonic_init(dev); 412 return macsonic_init(dev);
diff --git a/drivers/net/macvlan.c b/drivers/net/macvlan.c
index 3aabfd9dd212..2490aa39804c 100644
--- a/drivers/net/macvlan.c
+++ b/drivers/net/macvlan.c
@@ -360,6 +360,7 @@ static int macvlan_init(struct net_device *dev)
360 dev->state = (dev->state & ~MACVLAN_STATE_MASK) | 360 dev->state = (dev->state & ~MACVLAN_STATE_MASK) |
361 (lowerdev->state & MACVLAN_STATE_MASK); 361 (lowerdev->state & MACVLAN_STATE_MASK);
362 dev->features = lowerdev->features & MACVLAN_FEATURES; 362 dev->features = lowerdev->features & MACVLAN_FEATURES;
363 dev->gso_max_size = lowerdev->gso_max_size;
363 dev->iflink = lowerdev->ifindex; 364 dev->iflink = lowerdev->ifindex;
364 dev->hard_header_len = lowerdev->hard_header_len; 365 dev->hard_header_len = lowerdev->hard_header_len;
365 366
@@ -596,6 +597,7 @@ static int macvlan_device_event(struct notifier_block *unused,
596 case NETDEV_FEAT_CHANGE: 597 case NETDEV_FEAT_CHANGE:
597 list_for_each_entry(vlan, &port->vlans, list) { 598 list_for_each_entry(vlan, &port->vlans, list) {
598 vlan->dev->features = dev->features & MACVLAN_FEATURES; 599 vlan->dev->features = dev->features & MACVLAN_FEATURES;
600 vlan->dev->gso_max_size = dev->gso_max_size;
599 netdev_features_change(vlan->dev); 601 netdev_features_change(vlan->dev);
600 } 602 }
601 break; 603 break;
diff --git a/drivers/net/netxen/netxen_nic.h b/drivers/net/netxen/netxen_nic.h
index 7384f59df615..e1237b802872 100644
--- a/drivers/net/netxen/netxen_nic.h
+++ b/drivers/net/netxen/netxen_nic.h
@@ -1163,6 +1163,8 @@ struct netxen_adapter {
1163 u32 int_vec_bit; 1163 u32 int_vec_bit;
1164 u32 heartbit; 1164 u32 heartbit;
1165 1165
1166 u8 mac_addr[ETH_ALEN];
1167
1166 struct netxen_adapter_stats stats; 1168 struct netxen_adapter_stats stats;
1167 1169
1168 struct netxen_recv_context recv_ctx; 1170 struct netxen_recv_context recv_ctx;
diff --git a/drivers/net/netxen/netxen_nic_hdr.h b/drivers/net/netxen/netxen_nic_hdr.h
index 1c46da632125..17bb3818d84e 100644
--- a/drivers/net/netxen/netxen_nic_hdr.h
+++ b/drivers/net/netxen/netxen_nic_hdr.h
@@ -545,6 +545,8 @@ enum {
545#define NETXEN_NIU_TEST_MUX_CTL (NETXEN_CRB_NIU + 0x00094) 545#define NETXEN_NIU_TEST_MUX_CTL (NETXEN_CRB_NIU + 0x00094)
546#define NETXEN_NIU_XG_PAUSE_CTL (NETXEN_CRB_NIU + 0x00098) 546#define NETXEN_NIU_XG_PAUSE_CTL (NETXEN_CRB_NIU + 0x00098)
547#define NETXEN_NIU_XG_PAUSE_LEVEL (NETXEN_CRB_NIU + 0x000dc) 547#define NETXEN_NIU_XG_PAUSE_LEVEL (NETXEN_CRB_NIU + 0x000dc)
548#define NETXEN_NIU_FRAME_COUNT_SELECT (NETXEN_CRB_NIU + 0x000ac)
549#define NETXEN_NIU_FRAME_COUNT (NETXEN_CRB_NIU + 0x000b0)
548#define NETXEN_NIU_XG_SEL (NETXEN_CRB_NIU + 0x00128) 550#define NETXEN_NIU_XG_SEL (NETXEN_CRB_NIU + 0x00128)
549#define NETXEN_NIU_GB_PAUSE_CTL (NETXEN_CRB_NIU + 0x0030c) 551#define NETXEN_NIU_GB_PAUSE_CTL (NETXEN_CRB_NIU + 0x0030c)
550 552
diff --git a/drivers/net/netxen/netxen_nic_hw.c b/drivers/net/netxen/netxen_nic_hw.c
index 3185a98b0917..52a3798d8d94 100644
--- a/drivers/net/netxen/netxen_nic_hw.c
+++ b/drivers/net/netxen/netxen_nic_hw.c
@@ -383,24 +383,51 @@ int netxen_niu_disable_xg_port(struct netxen_adapter *adapter)
383 383
384int netxen_p2_nic_set_promisc(struct netxen_adapter *adapter, u32 mode) 384int netxen_p2_nic_set_promisc(struct netxen_adapter *adapter, u32 mode)
385{ 385{
386 __u32 reg; 386 u32 mac_cfg;
387 u32 cnt = 0;
388 __u32 reg = 0x0200;
387 u32 port = adapter->physical_port; 389 u32 port = adapter->physical_port;
390 u16 board_type = adapter->ahw.board_type;
388 391
389 if (port > NETXEN_NIU_MAX_XG_PORTS) 392 if (port > NETXEN_NIU_MAX_XG_PORTS)
390 return -EINVAL; 393 return -EINVAL;
391 394
392 reg = NXRD32(adapter, NETXEN_NIU_XGE_CONFIG_1 + (0x10000 * port)); 395 mac_cfg = NXRD32(adapter, NETXEN_NIU_XGE_CONFIG_0 + (0x10000 * port));
393 if (mode == NETXEN_NIU_PROMISC_MODE) 396 mac_cfg &= ~0x4;
394 reg = (reg | 0x2000UL); 397 NXWR32(adapter, NETXEN_NIU_XGE_CONFIG_0 + (0x10000 * port), mac_cfg);
395 else
396 reg = (reg & ~0x2000UL);
397 398
398 if (mode == NETXEN_NIU_ALLMULTI_MODE) 399 if ((board_type == NETXEN_BRDTYPE_P2_SB31_10G_IMEZ) ||
399 reg = (reg | 0x1000UL); 400 (board_type == NETXEN_BRDTYPE_P2_SB31_10G_HMEZ))
400 else 401 reg = (0x20 << port);
401 reg = (reg & ~0x1000UL); 402
403 NXWR32(adapter, NETXEN_NIU_FRAME_COUNT_SELECT, reg);
404
405 mdelay(10);
406
407 while (NXRD32(adapter, NETXEN_NIU_FRAME_COUNT) && ++cnt < 20)
408 mdelay(10);
409
410 if (cnt < 20) {
411
412 reg = NXRD32(adapter,
413 NETXEN_NIU_XGE_CONFIG_1 + (0x10000 * port));
414
415 if (mode == NETXEN_NIU_PROMISC_MODE)
416 reg = (reg | 0x2000UL);
417 else
418 reg = (reg & ~0x2000UL);
419
420 if (mode == NETXEN_NIU_ALLMULTI_MODE)
421 reg = (reg | 0x1000UL);
422 else
423 reg = (reg & ~0x1000UL);
424
425 NXWR32(adapter,
426 NETXEN_NIU_XGE_CONFIG_1 + (0x10000 * port), reg);
427 }
402 428
403 NXWR32(adapter, NETXEN_NIU_XGE_CONFIG_1 + (0x10000 * port), reg); 429 mac_cfg |= 0x4;
430 NXWR32(adapter, NETXEN_NIU_XGE_CONFIG_0 + (0x10000 * port), mac_cfg);
404 431
405 return 0; 432 return 0;
406} 433}
@@ -436,7 +463,7 @@ netxen_nic_enable_mcast_filter(struct netxen_adapter *adapter)
436{ 463{
437 u32 val = 0; 464 u32 val = 0;
438 u16 port = adapter->physical_port; 465 u16 port = adapter->physical_port;
439 u8 *addr = adapter->netdev->dev_addr; 466 u8 *addr = adapter->mac_addr;
440 467
441 if (adapter->mc_enabled) 468 if (adapter->mc_enabled)
442 return 0; 469 return 0;
@@ -465,7 +492,7 @@ netxen_nic_disable_mcast_filter(struct netxen_adapter *adapter)
465{ 492{
466 u32 val = 0; 493 u32 val = 0;
467 u16 port = adapter->physical_port; 494 u16 port = adapter->physical_port;
468 u8 *addr = adapter->netdev->dev_addr; 495 u8 *addr = adapter->mac_addr;
469 496
470 if (!adapter->mc_enabled) 497 if (!adapter->mc_enabled)
471 return 0; 498 return 0;
@@ -660,7 +687,7 @@ void netxen_p3_nic_set_multi(struct net_device *netdev)
660 687
661 list_splice_tail_init(&adapter->mac_list, &del_list); 688 list_splice_tail_init(&adapter->mac_list, &del_list);
662 689
663 nx_p3_nic_add_mac(adapter, netdev->dev_addr, &del_list); 690 nx_p3_nic_add_mac(adapter, adapter->mac_addr, &del_list);
664 nx_p3_nic_add_mac(adapter, bcast_addr, &del_list); 691 nx_p3_nic_add_mac(adapter, bcast_addr, &del_list);
665 692
666 if (netdev->flags & IFF_PROMISC) { 693 if (netdev->flags & IFF_PROMISC) {
diff --git a/drivers/net/netxen/netxen_nic_init.c b/drivers/net/netxen/netxen_nic_init.c
index e40b914d6faf..8a0904368e08 100644
--- a/drivers/net/netxen/netxen_nic_init.c
+++ b/drivers/net/netxen/netxen_nic_init.c
@@ -544,6 +544,8 @@ int netxen_pinit_from_rom(struct netxen_adapter *adapter, int verbose)
544 continue; 544 continue;
545 if (off == (ROMUSB_GLB + 0x1c)) /* MS clock */ 545 if (off == (ROMUSB_GLB + 0x1c)) /* MS clock */
546 continue; 546 continue;
547 if ((off & 0x0ff00000) == NETXEN_CRB_DDR_NET)
548 continue;
547 if (off == (NETXEN_CRB_PEG_NET_1 + 0x18)) 549 if (off == (NETXEN_CRB_PEG_NET_1 + 0x18))
548 buf[i].data = 0x1020; 550 buf[i].data = 0x1020;
549 /* skip the function enable register */ 551 /* skip the function enable register */
diff --git a/drivers/net/netxen/netxen_nic_main.c b/drivers/net/netxen/netxen_nic_main.c
index 0b4a56a8c8d5..3bf78dbfbf0f 100644
--- a/drivers/net/netxen/netxen_nic_main.c
+++ b/drivers/net/netxen/netxen_nic_main.c
@@ -437,6 +437,7 @@ netxen_read_mac_addr(struct netxen_adapter *adapter)
437 netdev->dev_addr[i] = *(p + 5 - i); 437 netdev->dev_addr[i] = *(p + 5 - i);
438 438
439 memcpy(netdev->perm_addr, netdev->dev_addr, netdev->addr_len); 439 memcpy(netdev->perm_addr, netdev->dev_addr, netdev->addr_len);
440 memcpy(adapter->mac_addr, netdev->dev_addr, netdev->addr_len);
440 441
441 /* set station address */ 442 /* set station address */
442 443
@@ -459,6 +460,7 @@ int netxen_nic_set_mac(struct net_device *netdev, void *p)
459 netxen_napi_disable(adapter); 460 netxen_napi_disable(adapter);
460 } 461 }
461 462
463 memcpy(adapter->mac_addr, addr->sa_data, netdev->addr_len);
462 memcpy(netdev->dev_addr, addr->sa_data, netdev->addr_len); 464 memcpy(netdev->dev_addr, addr->sa_data, netdev->addr_len);
463 adapter->macaddr_set(adapter, addr->sa_data); 465 adapter->macaddr_set(adapter, addr->sa_data);
464 466
@@ -956,7 +958,7 @@ netxen_nic_up(struct netxen_adapter *adapter, struct net_device *netdev)
956 return err; 958 return err;
957 } 959 }
958 if (NX_IS_REVISION_P2(adapter->ahw.revision_id)) 960 if (NX_IS_REVISION_P2(adapter->ahw.revision_id))
959 adapter->macaddr_set(adapter, netdev->dev_addr); 961 adapter->macaddr_set(adapter, adapter->mac_addr);
960 962
961 adapter->set_multi(netdev); 963 adapter->set_multi(netdev);
962 adapter->set_mtu(adapter, netdev->mtu); 964 adapter->set_mtu(adapter, netdev->mtu);
diff --git a/drivers/net/pcmcia/3c574_cs.c b/drivers/net/pcmcia/3c574_cs.c
index b58965a2b3ae..17a27225cc98 100644
--- a/drivers/net/pcmcia/3c574_cs.c
+++ b/drivers/net/pcmcia/3c574_cs.c
@@ -118,14 +118,6 @@ INT_MODULE_PARM(full_duplex, 0);
118/* Autodetect link polarity reversal? */ 118/* Autodetect link polarity reversal? */
119INT_MODULE_PARM(auto_polarity, 1); 119INT_MODULE_PARM(auto_polarity, 1);
120 120
121#ifdef PCMCIA_DEBUG
122INT_MODULE_PARM(pc_debug, PCMCIA_DEBUG);
123#define DEBUG(n, args...) if (pc_debug>(n)) printk(KERN_DEBUG args)
124static char *version =
125"3c574_cs.c 1.65ac1 2003/04/07 Donald Becker/David Hinds, becker@scyld.com.\n";
126#else
127#define DEBUG(n, args...)
128#endif
129 121
130/*====================================================================*/ 122/*====================================================================*/
131 123
@@ -278,7 +270,7 @@ static int tc574_probe(struct pcmcia_device *link)
278 struct el3_private *lp; 270 struct el3_private *lp;
279 struct net_device *dev; 271 struct net_device *dev;
280 272
281 DEBUG(0, "3c574_attach()\n"); 273 dev_dbg(&link->dev, "3c574_attach()\n");
282 274
283 /* Create the PC card device object. */ 275 /* Create the PC card device object. */
284 dev = alloc_etherdev(sizeof(struct el3_private)); 276 dev = alloc_etherdev(sizeof(struct el3_private));
@@ -291,10 +283,8 @@ static int tc574_probe(struct pcmcia_device *link)
291 spin_lock_init(&lp->window_lock); 283 spin_lock_init(&lp->window_lock);
292 link->io.NumPorts1 = 32; 284 link->io.NumPorts1 = 32;
293 link->io.Attributes1 = IO_DATA_PATH_WIDTH_16; 285 link->io.Attributes1 = IO_DATA_PATH_WIDTH_16;
294 link->irq.Attributes = IRQ_TYPE_DYNAMIC_SHARING|IRQ_HANDLE_PRESENT; 286 link->irq.Attributes = IRQ_TYPE_DYNAMIC_SHARING;
295 link->irq.IRQInfo1 = IRQ_LEVEL_ID;
296 link->irq.Handler = &el3_interrupt; 287 link->irq.Handler = &el3_interrupt;
297 link->irq.Instance = dev;
298 link->conf.Attributes = CONF_ENABLE_IRQ; 288 link->conf.Attributes = CONF_ENABLE_IRQ;
299 link->conf.IntType = INT_MEMORY_AND_IO; 289 link->conf.IntType = INT_MEMORY_AND_IO;
300 link->conf.ConfigIndex = 1; 290 link->conf.ConfigIndex = 1;
@@ -319,7 +309,7 @@ static void tc574_detach(struct pcmcia_device *link)
319{ 309{
320 struct net_device *dev = link->priv; 310 struct net_device *dev = link->priv;
321 311
322 DEBUG(0, "3c574_detach(0x%p)\n", link); 312 dev_dbg(&link->dev, "3c574_detach()\n");
323 313
324 if (link->dev_node) 314 if (link->dev_node)
325 unregister_netdev(dev); 315 unregister_netdev(dev);
@@ -335,26 +325,23 @@ static void tc574_detach(struct pcmcia_device *link)
335 ethernet device available to the system. 325 ethernet device available to the system.
336*/ 326*/
337 327
338#define CS_CHECK(fn, ret) \
339 do { last_fn = (fn); if ((last_ret = (ret)) != 0) goto cs_failed; } while (0)
340
341static const char *ram_split[] = {"5:3", "3:1", "1:1", "3:5"}; 328static const char *ram_split[] = {"5:3", "3:1", "1:1", "3:5"};
342 329
343static int tc574_config(struct pcmcia_device *link) 330static int tc574_config(struct pcmcia_device *link)
344{ 331{
345 struct net_device *dev = link->priv; 332 struct net_device *dev = link->priv;
346 struct el3_private *lp = netdev_priv(dev); 333 struct el3_private *lp = netdev_priv(dev);
347 tuple_t tuple; 334 int ret, i, j;
348 __le16 buf[32];
349 int last_fn, last_ret, i, j;
350 unsigned int ioaddr; 335 unsigned int ioaddr;
351 __be16 *phys_addr; 336 __be16 *phys_addr;
352 char *cardname; 337 char *cardname;
353 __u32 config; 338 __u32 config;
339 u8 *buf;
340 size_t len;
354 341
355 phys_addr = (__be16 *)dev->dev_addr; 342 phys_addr = (__be16 *)dev->dev_addr;
356 343
357 DEBUG(0, "3c574_config(0x%p)\n", link); 344 dev_dbg(&link->dev, "3c574_config()\n");
358 345
359 link->io.IOAddrLines = 16; 346 link->io.IOAddrLines = 16;
360 for (i = j = 0; j < 0x400; j += 0x20) { 347 for (i = j = 0; j < 0x400; j += 0x20) {
@@ -363,12 +350,16 @@ static int tc574_config(struct pcmcia_device *link)
363 if (i == 0) 350 if (i == 0)
364 break; 351 break;
365 } 352 }
366 if (i != 0) { 353 if (i != 0)
367 cs_error(link, RequestIO, i); 354 goto failed;
355
356 ret = pcmcia_request_irq(link, &link->irq);
357 if (ret)
358 goto failed;
359
360 ret = pcmcia_request_configuration(link, &link->conf);
361 if (ret)
368 goto failed; 362 goto failed;
369 }
370 CS_CHECK(RequestIRQ, pcmcia_request_irq(link, &link->irq));
371 CS_CHECK(RequestConfiguration, pcmcia_request_configuration(link, &link->conf));
372 363
373 dev->irq = link->irq.AssignedIRQ; 364 dev->irq = link->irq.AssignedIRQ;
374 dev->base_addr = link->io.BasePort1; 365 dev->base_addr = link->io.BasePort1;
@@ -378,16 +369,14 @@ static int tc574_config(struct pcmcia_device *link)
378 /* The 3c574 normally uses an EEPROM for configuration info, including 369 /* The 3c574 normally uses an EEPROM for configuration info, including
379 the hardware address. The future products may include a modem chip 370 the hardware address. The future products may include a modem chip
380 and put the address in the CIS. */ 371 and put the address in the CIS. */
381 tuple.Attributes = 0; 372
382 tuple.TupleData = (cisdata_t *)buf; 373 len = pcmcia_get_tuple(link, 0x88, &buf);
383 tuple.TupleDataMax = 64; 374 if (buf && len >= 6) {
384 tuple.TupleOffset = 0;
385 tuple.DesiredTuple = 0x88;
386 if (pcmcia_get_first_tuple(link, &tuple) == 0) {
387 pcmcia_get_tuple_data(link, &tuple);
388 for (i = 0; i < 3; i++) 375 for (i = 0; i < 3; i++)
389 phys_addr[i] = htons(le16_to_cpu(buf[i])); 376 phys_addr[i] = htons(le16_to_cpu(buf[i * 2]));
377 kfree(buf);
390 } else { 378 } else {
379 kfree(buf); /* 0 < len < 6 */
391 EL3WINDOW(0); 380 EL3WINDOW(0);
392 for (i = 0; i < 3; i++) 381 for (i = 0; i < 3; i++)
393 phys_addr[i] = htons(read_eeprom(ioaddr, i + 10)); 382 phys_addr[i] = htons(read_eeprom(ioaddr, i + 10));
@@ -435,7 +424,8 @@ static int tc574_config(struct pcmcia_device *link)
435 mii_status = mdio_read(ioaddr, phy & 0x1f, 1); 424 mii_status = mdio_read(ioaddr, phy & 0x1f, 1);
436 if (mii_status != 0xffff) { 425 if (mii_status != 0xffff) {
437 lp->phys = phy & 0x1f; 426 lp->phys = phy & 0x1f;
438 DEBUG(0, " MII transceiver at index %d, status %x.\n", 427 dev_dbg(&link->dev, " MII transceiver at "
428 "index %d, status %x.\n",
439 phy, mii_status); 429 phy, mii_status);
440 if ((mii_status & 0x0040) == 0) 430 if ((mii_status & 0x0040) == 0)
441 mii_preamble_required = 1; 431 mii_preamble_required = 1;
@@ -457,7 +447,7 @@ static int tc574_config(struct pcmcia_device *link)
457 } 447 }
458 448
459 link->dev_node = &lp->node; 449 link->dev_node = &lp->node;
460 SET_NETDEV_DEV(dev, &handle_to_dev(link)); 450 SET_NETDEV_DEV(dev, &link->dev);
461 451
462 if (register_netdev(dev) != 0) { 452 if (register_netdev(dev) != 0) {
463 printk(KERN_NOTICE "3c574_cs: register_netdev() failed\n"); 453 printk(KERN_NOTICE "3c574_cs: register_netdev() failed\n");
@@ -478,8 +468,6 @@ static int tc574_config(struct pcmcia_device *link)
478 468
479 return 0; 469 return 0;
480 470
481cs_failed:
482 cs_error(link, last_fn, last_ret);
483failed: 471failed:
484 tc574_release(link); 472 tc574_release(link);
485 return -ENODEV; 473 return -ENODEV;
@@ -738,7 +726,7 @@ static int el3_open(struct net_device *dev)
738 lp->media.expires = jiffies + HZ; 726 lp->media.expires = jiffies + HZ;
739 add_timer(&lp->media); 727 add_timer(&lp->media);
740 728
741 DEBUG(2, "%s: opened, status %4.4x.\n", 729 dev_dbg(&link->dev, "%s: opened, status %4.4x.\n",
742 dev->name, inw(dev->base_addr + EL3_STATUS)); 730 dev->name, inw(dev->base_addr + EL3_STATUS));
743 731
744 return 0; 732 return 0;
@@ -772,7 +760,7 @@ static void pop_tx_status(struct net_device *dev)
772 if (tx_status & 0x30) 760 if (tx_status & 0x30)
773 tc574_wait_for_completion(dev, TxReset); 761 tc574_wait_for_completion(dev, TxReset);
774 if (tx_status & 0x38) { 762 if (tx_status & 0x38) {
775 DEBUG(1, "%s: transmit error: status 0x%02x\n", 763 pr_debug("%s: transmit error: status 0x%02x\n",
776 dev->name, tx_status); 764 dev->name, tx_status);
777 outw(TxEnable, ioaddr + EL3_CMD); 765 outw(TxEnable, ioaddr + EL3_CMD);
778 dev->stats.tx_aborted_errors++; 766 dev->stats.tx_aborted_errors++;
@@ -788,7 +776,7 @@ static netdev_tx_t el3_start_xmit(struct sk_buff *skb,
788 struct el3_private *lp = netdev_priv(dev); 776 struct el3_private *lp = netdev_priv(dev);
789 unsigned long flags; 777 unsigned long flags;
790 778
791 DEBUG(3, "%s: el3_start_xmit(length = %ld) called, " 779 pr_debug("%s: el3_start_xmit(length = %ld) called, "
792 "status %4.4x.\n", dev->name, (long)skb->len, 780 "status %4.4x.\n", dev->name, (long)skb->len,
793 inw(ioaddr + EL3_STATUS)); 781 inw(ioaddr + EL3_STATUS));
794 782
@@ -827,7 +815,7 @@ static irqreturn_t el3_interrupt(int irq, void *dev_id)
827 return IRQ_NONE; 815 return IRQ_NONE;
828 ioaddr = dev->base_addr; 816 ioaddr = dev->base_addr;
829 817
830 DEBUG(3, "%s: interrupt, status %4.4x.\n", 818 pr_debug("%s: interrupt, status %4.4x.\n",
831 dev->name, inw(ioaddr + EL3_STATUS)); 819 dev->name, inw(ioaddr + EL3_STATUS));
832 820
833 spin_lock(&lp->window_lock); 821 spin_lock(&lp->window_lock);
@@ -836,7 +824,7 @@ static irqreturn_t el3_interrupt(int irq, void *dev_id)
836 (IntLatch | RxComplete | RxEarly | StatsFull)) { 824 (IntLatch | RxComplete | RxEarly | StatsFull)) {
837 if (!netif_device_present(dev) || 825 if (!netif_device_present(dev) ||
838 ((status & 0xe000) != 0x2000)) { 826 ((status & 0xe000) != 0x2000)) {
839 DEBUG(1, "%s: Interrupt from dead card\n", dev->name); 827 pr_debug("%s: Interrupt from dead card\n", dev->name);
840 break; 828 break;
841 } 829 }
842 830
@@ -846,7 +834,7 @@ static irqreturn_t el3_interrupt(int irq, void *dev_id)
846 work_budget = el3_rx(dev, work_budget); 834 work_budget = el3_rx(dev, work_budget);
847 835
848 if (status & TxAvailable) { 836 if (status & TxAvailable) {
849 DEBUG(3, " TX room bit was handled.\n"); 837 pr_debug(" TX room bit was handled.\n");
850 /* There's room in the FIFO for a full-sized packet. */ 838 /* There's room in the FIFO for a full-sized packet. */
851 outw(AckIntr | TxAvailable, ioaddr + EL3_CMD); 839 outw(AckIntr | TxAvailable, ioaddr + EL3_CMD);
852 netif_wake_queue(dev); 840 netif_wake_queue(dev);
@@ -886,7 +874,7 @@ static irqreturn_t el3_interrupt(int irq, void *dev_id)
886 } 874 }
887 875
888 if (--work_budget < 0) { 876 if (--work_budget < 0) {
889 DEBUG(0, "%s: Too much work in interrupt, " 877 pr_debug("%s: Too much work in interrupt, "
890 "status %4.4x.\n", dev->name, status); 878 "status %4.4x.\n", dev->name, status);
891 /* Clear all interrupts */ 879 /* Clear all interrupts */
892 outw(AckIntr | 0xFF, ioaddr + EL3_CMD); 880 outw(AckIntr | 0xFF, ioaddr + EL3_CMD);
@@ -896,7 +884,7 @@ static irqreturn_t el3_interrupt(int irq, void *dev_id)
896 outw(AckIntr | IntReq | IntLatch, ioaddr + EL3_CMD); 884 outw(AckIntr | IntReq | IntLatch, ioaddr + EL3_CMD);
897 } 885 }
898 886
899 DEBUG(3, "%s: exiting interrupt, status %4.4x.\n", 887 pr_debug("%s: exiting interrupt, status %4.4x.\n",
900 dev->name, inw(ioaddr + EL3_STATUS)); 888 dev->name, inw(ioaddr + EL3_STATUS));
901 889
902 spin_unlock(&lp->window_lock); 890 spin_unlock(&lp->window_lock);
@@ -1003,7 +991,7 @@ static void update_stats(struct net_device *dev)
1003 unsigned int ioaddr = dev->base_addr; 991 unsigned int ioaddr = dev->base_addr;
1004 u8 rx, tx, up; 992 u8 rx, tx, up;
1005 993
1006 DEBUG(2, "%s: updating the statistics.\n", dev->name); 994 pr_debug("%s: updating the statistics.\n", dev->name);
1007 995
1008 if (inw(ioaddr+EL3_STATUS) == 0xffff) /* No card. */ 996 if (inw(ioaddr+EL3_STATUS) == 0xffff) /* No card. */
1009 return; 997 return;
@@ -1039,7 +1027,7 @@ static int el3_rx(struct net_device *dev, int worklimit)
1039 unsigned int ioaddr = dev->base_addr; 1027 unsigned int ioaddr = dev->base_addr;
1040 short rx_status; 1028 short rx_status;
1041 1029
1042 DEBUG(3, "%s: in rx_packet(), status %4.4x, rx_status %4.4x.\n", 1030 pr_debug("%s: in rx_packet(), status %4.4x, rx_status %4.4x.\n",
1043 dev->name, inw(ioaddr+EL3_STATUS), inw(ioaddr+RxStatus)); 1031 dev->name, inw(ioaddr+EL3_STATUS), inw(ioaddr+RxStatus));
1044 while (!((rx_status = inw(ioaddr + RxStatus)) & 0x8000) && 1032 while (!((rx_status = inw(ioaddr + RxStatus)) & 0x8000) &&
1045 worklimit > 0) { 1033 worklimit > 0) {
@@ -1061,7 +1049,7 @@ static int el3_rx(struct net_device *dev, int worklimit)
1061 1049
1062 skb = dev_alloc_skb(pkt_len+5); 1050 skb = dev_alloc_skb(pkt_len+5);
1063 1051
1064 DEBUG(3, " Receiving packet size %d status %4.4x.\n", 1052 pr_debug(" Receiving packet size %d status %4.4x.\n",
1065 pkt_len, rx_status); 1053 pkt_len, rx_status);
1066 if (skb != NULL) { 1054 if (skb != NULL) {
1067 skb_reserve(skb, 2); 1055 skb_reserve(skb, 2);
@@ -1072,7 +1060,7 @@ static int el3_rx(struct net_device *dev, int worklimit)
1072 dev->stats.rx_packets++; 1060 dev->stats.rx_packets++;
1073 dev->stats.rx_bytes += pkt_len; 1061 dev->stats.rx_bytes += pkt_len;
1074 } else { 1062 } else {
1075 DEBUG(1, "%s: couldn't allocate a sk_buff of" 1063 pr_debug("%s: couldn't allocate a sk_buff of"
1076 " size %d.\n", dev->name, pkt_len); 1064 " size %d.\n", dev->name, pkt_len);
1077 dev->stats.rx_dropped++; 1065 dev->stats.rx_dropped++;
1078 } 1066 }
@@ -1101,7 +1089,7 @@ static int el3_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)
1101 struct mii_ioctl_data *data = if_mii(rq); 1089 struct mii_ioctl_data *data = if_mii(rq);
1102 int phy = lp->phys & 0x1f; 1090 int phy = lp->phys & 0x1f;
1103 1091
1104 DEBUG(2, "%s: In ioct(%-.6s, %#4.4x) %4.4x %4.4x %4.4x %4.4x.\n", 1092 pr_debug("%s: In ioct(%-.6s, %#4.4x) %4.4x %4.4x %4.4x %4.4x.\n",
1105 dev->name, rq->ifr_ifrn.ifrn_name, cmd, 1093 dev->name, rq->ifr_ifrn.ifrn_name, cmd,
1106 data->phy_id, data->reg_num, data->val_in, data->val_out); 1094 data->phy_id, data->reg_num, data->val_in, data->val_out);
1107 1095
@@ -1178,7 +1166,7 @@ static int el3_close(struct net_device *dev)
1178 struct el3_private *lp = netdev_priv(dev); 1166 struct el3_private *lp = netdev_priv(dev);
1179 struct pcmcia_device *link = lp->p_dev; 1167 struct pcmcia_device *link = lp->p_dev;
1180 1168
1181 DEBUG(2, "%s: shutting down ethercard.\n", dev->name); 1169 dev_dbg(&link->dev, "%s: shutting down ethercard.\n", dev->name);
1182 1170
1183 if (pcmcia_dev_present(link)) { 1171 if (pcmcia_dev_present(link)) {
1184 unsigned long flags; 1172 unsigned long flags;
diff --git a/drivers/net/pcmcia/3c589_cs.c b/drivers/net/pcmcia/3c589_cs.c
index 569fb06793cf..6f8d7e2e5922 100644
--- a/drivers/net/pcmcia/3c589_cs.c
+++ b/drivers/net/pcmcia/3c589_cs.c
@@ -130,14 +130,6 @@ MODULE_LICENSE("GPL");
130/* Special hook for setting if_port when module is loaded */ 130/* Special hook for setting if_port when module is loaded */
131INT_MODULE_PARM(if_port, 0); 131INT_MODULE_PARM(if_port, 0);
132 132
133#ifdef PCMCIA_DEBUG
134INT_MODULE_PARM(pc_debug, PCMCIA_DEBUG);
135#define DEBUG(n, args...) if (pc_debug>(n)) printk(KERN_DEBUG args)
136static char *version =
137DRV_NAME ".c " DRV_VERSION " 2001/10/13 00:08:50 (David Hinds)";
138#else
139#define DEBUG(n, args...)
140#endif
141 133
142/*====================================================================*/ 134/*====================================================================*/
143 135
@@ -189,7 +181,7 @@ static int tc589_probe(struct pcmcia_device *link)
189 struct el3_private *lp; 181 struct el3_private *lp;
190 struct net_device *dev; 182 struct net_device *dev;
191 183
192 DEBUG(0, "3c589_attach()\n"); 184 dev_dbg(&link->dev, "3c589_attach()\n");
193 185
194 /* Create new ethernet device */ 186 /* Create new ethernet device */
195 dev = alloc_etherdev(sizeof(struct el3_private)); 187 dev = alloc_etherdev(sizeof(struct el3_private));
@@ -202,10 +194,8 @@ static int tc589_probe(struct pcmcia_device *link)
202 spin_lock_init(&lp->lock); 194 spin_lock_init(&lp->lock);
203 link->io.NumPorts1 = 16; 195 link->io.NumPorts1 = 16;
204 link->io.Attributes1 = IO_DATA_PATH_WIDTH_16; 196 link->io.Attributes1 = IO_DATA_PATH_WIDTH_16;
205 link->irq.Attributes = IRQ_TYPE_DYNAMIC_SHARING|IRQ_HANDLE_PRESENT; 197 link->irq.Attributes = IRQ_TYPE_DYNAMIC_SHARING;
206 link->irq.IRQInfo1 = IRQ_LEVEL_ID;
207 link->irq.Handler = &el3_interrupt; 198 link->irq.Handler = &el3_interrupt;
208 link->irq.Instance = dev;
209 link->conf.Attributes = CONF_ENABLE_IRQ; 199 link->conf.Attributes = CONF_ENABLE_IRQ;
210 link->conf.IntType = INT_MEMORY_AND_IO; 200 link->conf.IntType = INT_MEMORY_AND_IO;
211 link->conf.ConfigIndex = 1; 201 link->conf.ConfigIndex = 1;
@@ -231,7 +221,7 @@ static void tc589_detach(struct pcmcia_device *link)
231{ 221{
232 struct net_device *dev = link->priv; 222 struct net_device *dev = link->priv;
233 223
234 DEBUG(0, "3c589_detach(0x%p)\n", link); 224 dev_dbg(&link->dev, "3c589_detach\n");
235 225
236 if (link->dev_node) 226 if (link->dev_node)
237 unregister_netdev(dev); 227 unregister_netdev(dev);
@@ -249,29 +239,20 @@ static void tc589_detach(struct pcmcia_device *link)
249 239
250======================================================================*/ 240======================================================================*/
251 241
252#define CS_CHECK(fn, ret) \
253do { last_fn = (fn); if ((last_ret = (ret)) != 0) goto cs_failed; } while (0)
254
255static int tc589_config(struct pcmcia_device *link) 242static int tc589_config(struct pcmcia_device *link)
256{ 243{
257 struct net_device *dev = link->priv; 244 struct net_device *dev = link->priv;
258 struct el3_private *lp = netdev_priv(dev); 245 struct el3_private *lp = netdev_priv(dev);
259 tuple_t tuple;
260 __le16 buf[32];
261 __be16 *phys_addr; 246 __be16 *phys_addr;
262 int last_fn, last_ret, i, j, multi = 0, fifo; 247 int ret, i, j, multi = 0, fifo;
263 unsigned int ioaddr; 248 unsigned int ioaddr;
264 char *ram_split[] = {"5:3", "3:1", "1:1", "3:5"}; 249 char *ram_split[] = {"5:3", "3:1", "1:1", "3:5"};
250 u8 *buf;
251 size_t len;
265 252
266 DEBUG(0, "3c589_config(0x%p)\n", link); 253 dev_dbg(&link->dev, "3c589_config\n");
267 254
268 phys_addr = (__be16 *)dev->dev_addr; 255 phys_addr = (__be16 *)dev->dev_addr;
269 tuple.Attributes = 0;
270 tuple.TupleData = (cisdata_t *)buf;
271 tuple.TupleDataMax = sizeof(buf);
272 tuple.TupleOffset = 0;
273 tuple.Attributes = TUPLE_RETURN_COMMON;
274
275 /* Is this a 3c562? */ 256 /* Is this a 3c562? */
276 if (link->manf_id != MANFID_3COM) 257 if (link->manf_id != MANFID_3COM)
277 printk(KERN_INFO "3c589_cs: hmmm, is this really a " 258 printk(KERN_INFO "3c589_cs: hmmm, is this really a "
@@ -287,12 +268,16 @@ static int tc589_config(struct pcmcia_device *link)
287 if (i == 0) 268 if (i == 0)
288 break; 269 break;
289 } 270 }
290 if (i != 0) { 271 if (i != 0)
291 cs_error(link, RequestIO, i);
292 goto failed; 272 goto failed;
293 } 273
294 CS_CHECK(RequestIRQ, pcmcia_request_irq(link, &link->irq)); 274 ret = pcmcia_request_irq(link, &link->irq);
295 CS_CHECK(RequestConfiguration, pcmcia_request_configuration(link, &link->conf)); 275 if (ret)
276 goto failed;
277
278 ret = pcmcia_request_configuration(link, &link->conf);
279 if (ret)
280 goto failed;
296 281
297 dev->irq = link->irq.AssignedIRQ; 282 dev->irq = link->irq.AssignedIRQ;
298 dev->base_addr = link->io.BasePort1; 283 dev->base_addr = link->io.BasePort1;
@@ -301,12 +286,13 @@ static int tc589_config(struct pcmcia_device *link)
301 286
302 /* The 3c589 has an extra EEPROM for configuration info, including 287 /* The 3c589 has an extra EEPROM for configuration info, including
303 the hardware address. The 3c562 puts the address in the CIS. */ 288 the hardware address. The 3c562 puts the address in the CIS. */
304 tuple.DesiredTuple = 0x88; 289 len = pcmcia_get_tuple(link, 0x88, &buf);
305 if (pcmcia_get_first_tuple(link, &tuple) == 0) { 290 if (buf && len >= 6) {
306 pcmcia_get_tuple_data(link, &tuple); 291 for (i = 0; i < 3; i++)
307 for (i = 0; i < 3; i++) 292 phys_addr[i] = htons(le16_to_cpu(buf[i*2]));
308 phys_addr[i] = htons(le16_to_cpu(buf[i])); 293 kfree(buf);
309 } else { 294 } else {
295 kfree(buf); /* 0 < len < 6 */
310 for (i = 0; i < 3; i++) 296 for (i = 0; i < 3; i++)
311 phys_addr[i] = htons(read_eeprom(ioaddr, i)); 297 phys_addr[i] = htons(read_eeprom(ioaddr, i));
312 if (phys_addr[0] == htons(0x6060)) { 298 if (phys_addr[0] == htons(0x6060)) {
@@ -328,7 +314,7 @@ static int tc589_config(struct pcmcia_device *link)
328 printk(KERN_ERR "3c589_cs: invalid if_port requested\n"); 314 printk(KERN_ERR "3c589_cs: invalid if_port requested\n");
329 315
330 link->dev_node = &lp->node; 316 link->dev_node = &lp->node;
331 SET_NETDEV_DEV(dev, &handle_to_dev(link)); 317 SET_NETDEV_DEV(dev, &link->dev);
332 318
333 if (register_netdev(dev) != 0) { 319 if (register_netdev(dev) != 0) {
334 printk(KERN_ERR "3c589_cs: register_netdev() failed\n"); 320 printk(KERN_ERR "3c589_cs: register_netdev() failed\n");
@@ -347,8 +333,6 @@ static int tc589_config(struct pcmcia_device *link)
347 if_names[dev->if_port]); 333 if_names[dev->if_port]);
348 return 0; 334 return 0;
349 335
350cs_failed:
351 cs_error(link, last_fn, last_ret);
352failed: 336failed:
353 tc589_release(link); 337 tc589_release(link);
354 return -ENODEV; 338 return -ENODEV;
@@ -511,24 +495,8 @@ static void netdev_get_drvinfo(struct net_device *dev,
511 sprintf(info->bus_info, "PCMCIA 0x%lx", dev->base_addr); 495 sprintf(info->bus_info, "PCMCIA 0x%lx", dev->base_addr);
512} 496}
513 497
514#ifdef PCMCIA_DEBUG
515static u32 netdev_get_msglevel(struct net_device *dev)
516{
517 return pc_debug;
518}
519
520static void netdev_set_msglevel(struct net_device *dev, u32 level)
521{
522 pc_debug = level;
523}
524#endif /* PCMCIA_DEBUG */
525
526static const struct ethtool_ops netdev_ethtool_ops = { 498static const struct ethtool_ops netdev_ethtool_ops = {
527 .get_drvinfo = netdev_get_drvinfo, 499 .get_drvinfo = netdev_get_drvinfo,
528#ifdef PCMCIA_DEBUG
529 .get_msglevel = netdev_get_msglevel,
530 .set_msglevel = netdev_set_msglevel,
531#endif /* PCMCIA_DEBUG */
532}; 500};
533 501
534static int el3_config(struct net_device *dev, struct ifmap *map) 502static int el3_config(struct net_device *dev, struct ifmap *map)
@@ -563,7 +531,7 @@ static int el3_open(struct net_device *dev)
563 lp->media.expires = jiffies + HZ; 531 lp->media.expires = jiffies + HZ;
564 add_timer(&lp->media); 532 add_timer(&lp->media);
565 533
566 DEBUG(1, "%s: opened, status %4.4x.\n", 534 dev_dbg(&link->dev, "%s: opened, status %4.4x.\n",
567 dev->name, inw(dev->base_addr + EL3_STATUS)); 535 dev->name, inw(dev->base_addr + EL3_STATUS));
568 536
569 return 0; 537 return 0;
@@ -596,7 +564,7 @@ static void pop_tx_status(struct net_device *dev)
596 if (tx_status & 0x30) 564 if (tx_status & 0x30)
597 tc589_wait_for_completion(dev, TxReset); 565 tc589_wait_for_completion(dev, TxReset);
598 if (tx_status & 0x38) { 566 if (tx_status & 0x38) {
599 DEBUG(1, "%s: transmit error: status 0x%02x\n", 567 pr_debug("%s: transmit error: status 0x%02x\n",
600 dev->name, tx_status); 568 dev->name, tx_status);
601 outw(TxEnable, ioaddr + EL3_CMD); 569 outw(TxEnable, ioaddr + EL3_CMD);
602 dev->stats.tx_aborted_errors++; 570 dev->stats.tx_aborted_errors++;
@@ -612,7 +580,7 @@ static netdev_tx_t el3_start_xmit(struct sk_buff *skb,
612 struct el3_private *priv = netdev_priv(dev); 580 struct el3_private *priv = netdev_priv(dev);
613 unsigned long flags; 581 unsigned long flags;
614 582
615 DEBUG(3, "%s: el3_start_xmit(length = %ld) called, " 583 pr_debug("%s: el3_start_xmit(length = %ld) called, "
616 "status %4.4x.\n", dev->name, (long)skb->len, 584 "status %4.4x.\n", dev->name, (long)skb->len,
617 inw(ioaddr + EL3_STATUS)); 585 inw(ioaddr + EL3_STATUS));
618 586
@@ -654,14 +622,14 @@ static irqreturn_t el3_interrupt(int irq, void *dev_id)
654 622
655 ioaddr = dev->base_addr; 623 ioaddr = dev->base_addr;
656 624
657 DEBUG(3, "%s: interrupt, status %4.4x.\n", 625 pr_debug("%s: interrupt, status %4.4x.\n",
658 dev->name, inw(ioaddr + EL3_STATUS)); 626 dev->name, inw(ioaddr + EL3_STATUS));
659 627
660 spin_lock(&lp->lock); 628 spin_lock(&lp->lock);
661 while ((status = inw(ioaddr + EL3_STATUS)) & 629 while ((status = inw(ioaddr + EL3_STATUS)) &
662 (IntLatch | RxComplete | StatsFull)) { 630 (IntLatch | RxComplete | StatsFull)) {
663 if ((status & 0xe000) != 0x2000) { 631 if ((status & 0xe000) != 0x2000) {
664 DEBUG(1, "%s: interrupt from dead card\n", dev->name); 632 pr_debug("%s: interrupt from dead card\n", dev->name);
665 handled = 0; 633 handled = 0;
666 break; 634 break;
667 } 635 }
@@ -670,7 +638,7 @@ static irqreturn_t el3_interrupt(int irq, void *dev_id)
670 el3_rx(dev); 638 el3_rx(dev);
671 639
672 if (status & TxAvailable) { 640 if (status & TxAvailable) {
673 DEBUG(3, " TX room bit was handled.\n"); 641 pr_debug(" TX room bit was handled.\n");
674 /* There's room in the FIFO for a full-sized packet. */ 642 /* There's room in the FIFO for a full-sized packet. */
675 outw(AckIntr | TxAvailable, ioaddr + EL3_CMD); 643 outw(AckIntr | TxAvailable, ioaddr + EL3_CMD);
676 netif_wake_queue(dev); 644 netif_wake_queue(dev);
@@ -722,7 +690,7 @@ static irqreturn_t el3_interrupt(int irq, void *dev_id)
722 690
723 lp->last_irq = jiffies; 691 lp->last_irq = jiffies;
724 spin_unlock(&lp->lock); 692 spin_unlock(&lp->lock);
725 DEBUG(3, "%s: exiting interrupt, status %4.4x.\n", 693 pr_debug("%s: exiting interrupt, status %4.4x.\n",
726 dev->name, inw(ioaddr + EL3_STATUS)); 694 dev->name, inw(ioaddr + EL3_STATUS));
727 return IRQ_RETVAL(handled); 695 return IRQ_RETVAL(handled);
728} 696}
@@ -833,7 +801,7 @@ static void update_stats(struct net_device *dev)
833{ 801{
834 unsigned int ioaddr = dev->base_addr; 802 unsigned int ioaddr = dev->base_addr;
835 803
836 DEBUG(2, "%s: updating the statistics.\n", dev->name); 804 pr_debug("%s: updating the statistics.\n", dev->name);
837 /* Turn off statistics updates while reading. */ 805 /* Turn off statistics updates while reading. */
838 outw(StatsDisable, ioaddr + EL3_CMD); 806 outw(StatsDisable, ioaddr + EL3_CMD);
839 /* Switch to the stats window, and read everything. */ 807 /* Switch to the stats window, and read everything. */
@@ -861,7 +829,7 @@ static int el3_rx(struct net_device *dev)
861 int worklimit = 32; 829 int worklimit = 32;
862 short rx_status; 830 short rx_status;
863 831
864 DEBUG(3, "%s: in rx_packet(), status %4.4x, rx_status %4.4x.\n", 832 pr_debug("%s: in rx_packet(), status %4.4x, rx_status %4.4x.\n",
865 dev->name, inw(ioaddr+EL3_STATUS), inw(ioaddr+RX_STATUS)); 833 dev->name, inw(ioaddr+EL3_STATUS), inw(ioaddr+RX_STATUS));
866 while (!((rx_status = inw(ioaddr + RX_STATUS)) & 0x8000) && 834 while (!((rx_status = inw(ioaddr + RX_STATUS)) & 0x8000) &&
867 worklimit > 0) { 835 worklimit > 0) {
@@ -883,7 +851,7 @@ static int el3_rx(struct net_device *dev)
883 851
884 skb = dev_alloc_skb(pkt_len+5); 852 skb = dev_alloc_skb(pkt_len+5);
885 853
886 DEBUG(3, " Receiving packet size %d status %4.4x.\n", 854 pr_debug(" Receiving packet size %d status %4.4x.\n",
887 pkt_len, rx_status); 855 pkt_len, rx_status);
888 if (skb != NULL) { 856 if (skb != NULL) {
889 skb_reserve(skb, 2); 857 skb_reserve(skb, 2);
@@ -894,7 +862,7 @@ static int el3_rx(struct net_device *dev)
894 dev->stats.rx_packets++; 862 dev->stats.rx_packets++;
895 dev->stats.rx_bytes += pkt_len; 863 dev->stats.rx_bytes += pkt_len;
896 } else { 864 } else {
897 DEBUG(1, "%s: couldn't allocate a sk_buff of" 865 pr_debug("%s: couldn't allocate a sk_buff of"
898 " size %d.\n", dev->name, pkt_len); 866 " size %d.\n", dev->name, pkt_len);
899 dev->stats.rx_dropped++; 867 dev->stats.rx_dropped++;
900 } 868 }
@@ -935,7 +903,7 @@ static int el3_close(struct net_device *dev)
935 struct pcmcia_device *link = lp->p_dev; 903 struct pcmcia_device *link = lp->p_dev;
936 unsigned int ioaddr = dev->base_addr; 904 unsigned int ioaddr = dev->base_addr;
937 905
938 DEBUG(1, "%s: shutting down ethercard.\n", dev->name); 906 dev_dbg(&link->dev, "%s: shutting down ethercard.\n", dev->name);
939 907
940 if (pcmcia_dev_present(link)) { 908 if (pcmcia_dev_present(link)) {
941 /* Turn off statistics ASAP. We update dev->stats below. */ 909 /* Turn off statistics ASAP. We update dev->stats below. */
diff --git a/drivers/net/pcmcia/axnet_cs.c b/drivers/net/pcmcia/axnet_cs.c
index 3131a59a8d32..800597b82d18 100644
--- a/drivers/net/pcmcia/axnet_cs.c
+++ b/drivers/net/pcmcia/axnet_cs.c
@@ -75,16 +75,6 @@ MODULE_AUTHOR("David Hinds <dahinds@users.sourceforge.net>");
75MODULE_DESCRIPTION("Asix AX88190 PCMCIA ethernet driver"); 75MODULE_DESCRIPTION("Asix AX88190 PCMCIA ethernet driver");
76MODULE_LICENSE("GPL"); 76MODULE_LICENSE("GPL");
77 77
78#ifdef PCMCIA_DEBUG
79#define INT_MODULE_PARM(n, v) static int n = v; module_param(n, int, 0)
80
81INT_MODULE_PARM(pc_debug, PCMCIA_DEBUG);
82#define DEBUG(n, args...) if (pc_debug>(n)) printk(KERN_DEBUG args)
83static char *version =
84"axnet_cs.c 1.28 2002/06/29 06:27:37 (David Hinds)";
85#else
86#define DEBUG(n, args...)
87#endif
88 78
89/*====================================================================*/ 79/*====================================================================*/
90 80
@@ -167,7 +157,7 @@ static int axnet_probe(struct pcmcia_device *link)
167 struct net_device *dev; 157 struct net_device *dev;
168 struct ei_device *ei_local; 158 struct ei_device *ei_local;
169 159
170 DEBUG(0, "axnet_attach()\n"); 160 dev_dbg(&link->dev, "axnet_attach()\n");
171 161
172 dev = alloc_etherdev(sizeof(struct ei_device) + sizeof(axnet_dev_t)); 162 dev = alloc_etherdev(sizeof(struct ei_device) + sizeof(axnet_dev_t));
173 if (!dev) 163 if (!dev)
@@ -180,7 +170,6 @@ static int axnet_probe(struct pcmcia_device *link)
180 info->p_dev = link; 170 info->p_dev = link;
181 link->priv = dev; 171 link->priv = dev;
182 link->irq.Attributes = IRQ_TYPE_DYNAMIC_SHARING; 172 link->irq.Attributes = IRQ_TYPE_DYNAMIC_SHARING;
183 link->irq.IRQInfo1 = IRQ_LEVEL_ID;
184 link->conf.Attributes = CONF_ENABLE_IRQ; 173 link->conf.Attributes = CONF_ENABLE_IRQ;
185 link->conf.IntType = INT_MEMORY_AND_IO; 174 link->conf.IntType = INT_MEMORY_AND_IO;
186 175
@@ -205,7 +194,7 @@ static void axnet_detach(struct pcmcia_device *link)
205{ 194{
206 struct net_device *dev = link->priv; 195 struct net_device *dev = link->priv;
207 196
208 DEBUG(0, "axnet_detach(0x%p)\n", link); 197 dev_dbg(&link->dev, "axnet_detach(0x%p)\n", link);
209 198
210 if (link->dev_node) 199 if (link->dev_node)
211 unregister_netdev(dev); 200 unregister_netdev(dev);
@@ -272,9 +261,6 @@ static int get_prom(struct pcmcia_device *link)
272 261
273======================================================================*/ 262======================================================================*/
274 263
275#define CS_CHECK(fn, ret) \
276do { last_fn = (fn); if ((last_ret = (ret)) != 0) goto cs_failed; } while (0)
277
278static int try_io_port(struct pcmcia_device *link) 264static int try_io_port(struct pcmcia_device *link)
279{ 265{
280 int j, ret; 266 int j, ret;
@@ -341,26 +327,29 @@ static int axnet_config(struct pcmcia_device *link)
341{ 327{
342 struct net_device *dev = link->priv; 328 struct net_device *dev = link->priv;
343 axnet_dev_t *info = PRIV(dev); 329 axnet_dev_t *info = PRIV(dev);
344 int i, j, j2, last_ret, last_fn; 330 int i, j, j2, ret;
345 331
346 DEBUG(0, "axnet_config(0x%p)\n", link); 332 dev_dbg(&link->dev, "axnet_config(0x%p)\n", link);
347 333
348 /* don't trust the CIS on this; Linksys got it wrong */ 334 /* don't trust the CIS on this; Linksys got it wrong */
349 link->conf.Present = 0x63; 335 link->conf.Present = 0x63;
350 last_ret = pcmcia_loop_config(link, axnet_configcheck, NULL); 336 ret = pcmcia_loop_config(link, axnet_configcheck, NULL);
351 if (last_ret != 0) { 337 if (ret != 0)
352 cs_error(link, RequestIO, last_ret);
353 goto failed; 338 goto failed;
354 }
355 339
356 CS_CHECK(RequestIRQ, pcmcia_request_irq(link, &link->irq)); 340 ret = pcmcia_request_irq(link, &link->irq);
341 if (ret)
342 goto failed;
357 343
358 if (link->io.NumPorts2 == 8) { 344 if (link->io.NumPorts2 == 8) {
359 link->conf.Attributes |= CONF_ENABLE_SPKR; 345 link->conf.Attributes |= CONF_ENABLE_SPKR;
360 link->conf.Status = CCSR_AUDIO_ENA; 346 link->conf.Status = CCSR_AUDIO_ENA;
361 } 347 }
362 348
363 CS_CHECK(RequestConfiguration, pcmcia_request_configuration(link, &link->conf)); 349 ret = pcmcia_request_configuration(link, &link->conf);
350 if (ret)
351 goto failed;
352
364 dev->irq = link->irq.AssignedIRQ; 353 dev->irq = link->irq.AssignedIRQ;
365 dev->base_addr = link->io.BasePort1; 354 dev->base_addr = link->io.BasePort1;
366 355
@@ -410,7 +399,7 @@ static int axnet_config(struct pcmcia_device *link)
410 399
411 info->phy_id = (i < 32) ? i : -1; 400 info->phy_id = (i < 32) ? i : -1;
412 link->dev_node = &info->node; 401 link->dev_node = &info->node;
413 SET_NETDEV_DEV(dev, &handle_to_dev(link)); 402 SET_NETDEV_DEV(dev, &link->dev);
414 403
415 if (register_netdev(dev) != 0) { 404 if (register_netdev(dev) != 0) {
416 printk(KERN_NOTICE "axnet_cs: register_netdev() failed\n"); 405 printk(KERN_NOTICE "axnet_cs: register_netdev() failed\n");
@@ -426,14 +415,12 @@ static int axnet_config(struct pcmcia_device *link)
426 dev->base_addr, dev->irq, 415 dev->base_addr, dev->irq,
427 dev->dev_addr); 416 dev->dev_addr);
428 if (info->phy_id != -1) { 417 if (info->phy_id != -1) {
429 DEBUG(0, " MII transceiver at index %d, status %x.\n", info->phy_id, j); 418 dev_dbg(&link->dev, " MII transceiver at index %d, status %x.\n", info->phy_id, j);
430 } else { 419 } else {
431 printk(KERN_NOTICE " No MII transceivers found!\n"); 420 printk(KERN_NOTICE " No MII transceivers found!\n");
432 } 421 }
433 return 0; 422 return 0;
434 423
435cs_failed:
436 cs_error(link, last_fn, last_ret);
437failed: 424failed:
438 axnet_release(link); 425 axnet_release(link);
439 return -ENODEV; 426 return -ENODEV;
@@ -543,7 +530,7 @@ static int axnet_open(struct net_device *dev)
543 struct pcmcia_device *link = info->p_dev; 530 struct pcmcia_device *link = info->p_dev;
544 unsigned int nic_base = dev->base_addr; 531 unsigned int nic_base = dev->base_addr;
545 532
546 DEBUG(2, "axnet_open('%s')\n", dev->name); 533 dev_dbg(&link->dev, "axnet_open('%s')\n", dev->name);
547 534
548 if (!pcmcia_dev_present(link)) 535 if (!pcmcia_dev_present(link))
549 return -ENODEV; 536 return -ENODEV;
@@ -572,7 +559,7 @@ static int axnet_close(struct net_device *dev)
572 axnet_dev_t *info = PRIV(dev); 559 axnet_dev_t *info = PRIV(dev);
573 struct pcmcia_device *link = info->p_dev; 560 struct pcmcia_device *link = info->p_dev;
574 561
575 DEBUG(2, "axnet_close('%s')\n", dev->name); 562 dev_dbg(&link->dev, "axnet_close('%s')\n", dev->name);
576 563
577 ax_close(dev); 564 ax_close(dev);
578 free_irq(dev->irq, dev); 565 free_irq(dev->irq, dev);
@@ -741,10 +728,8 @@ static void block_input(struct net_device *dev, int count,
741 int xfer_count = count; 728 int xfer_count = count;
742 char *buf = skb->data; 729 char *buf = skb->data;
743 730
744#ifdef PCMCIA_DEBUG
745 if ((ei_debug > 4) && (count != 4)) 731 if ((ei_debug > 4) && (count != 4))
746 printk(KERN_DEBUG "%s: [bi=%d]\n", dev->name, count+4); 732 pr_debug("%s: [bi=%d]\n", dev->name, count+4);
747#endif
748 outb_p(ring_offset & 0xff, nic_base + EN0_RSARLO); 733 outb_p(ring_offset & 0xff, nic_base + EN0_RSARLO);
749 outb_p(ring_offset >> 8, nic_base + EN0_RSARHI); 734 outb_p(ring_offset >> 8, nic_base + EN0_RSARHI);
750 outb_p(E8390_RREAD+E8390_START, nic_base + AXNET_CMD); 735 outb_p(E8390_RREAD+E8390_START, nic_base + AXNET_CMD);
@@ -762,10 +747,7 @@ static void block_output(struct net_device *dev, int count,
762{ 747{
763 unsigned int nic_base = dev->base_addr; 748 unsigned int nic_base = dev->base_addr;
764 749
765#ifdef PCMCIA_DEBUG 750 pr_debug("%s: [bo=%d]\n", dev->name, count);
766 if (ei_debug > 4)
767 printk(KERN_DEBUG "%s: [bo=%d]\n", dev->name, count);
768#endif
769 751
770 /* Round the count up for word writes. Do we need to do this? 752 /* Round the count up for word writes. Do we need to do this?
771 What effect will an odd byte count have on the 8390? 753 What effect will an odd byte count have on the 8390?
diff --git a/drivers/net/pcmcia/com20020_cs.c b/drivers/net/pcmcia/com20020_cs.c
index 7b5c77b7bd27..21d9c9d815d1 100644
--- a/drivers/net/pcmcia/com20020_cs.c
+++ b/drivers/net/pcmcia/com20020_cs.c
@@ -53,11 +53,7 @@
53 53
54#define VERSION "arcnet: COM20020 PCMCIA support loaded.\n" 54#define VERSION "arcnet: COM20020 PCMCIA support loaded.\n"
55 55
56#ifdef PCMCIA_DEBUG 56#ifdef DEBUG
57
58static int pc_debug = PCMCIA_DEBUG;
59module_param(pc_debug, int, 0);
60#define DEBUG(n, args...) if (pc_debug>(n)) printk(KERN_DEBUG args)
61 57
62static void regdump(struct net_device *dev) 58static void regdump(struct net_device *dev)
63{ 59{
@@ -92,7 +88,6 @@ static void regdump(struct net_device *dev)
92 88
93#else 89#else
94 90
95#define DEBUG(n, args...) do { } while (0)
96static inline void regdump(struct net_device *dev) { } 91static inline void regdump(struct net_device *dev) { }
97 92
98#endif 93#endif
@@ -144,7 +139,7 @@ static int com20020_probe(struct pcmcia_device *p_dev)
144 struct net_device *dev; 139 struct net_device *dev;
145 struct arcnet_local *lp; 140 struct arcnet_local *lp;
146 141
147 DEBUG(0, "com20020_attach()\n"); 142 dev_dbg(&p_dev->dev, "com20020_attach()\n");
148 143
149 /* Create new network device */ 144 /* Create new network device */
150 info = kzalloc(sizeof(struct com20020_dev_t), GFP_KERNEL); 145 info = kzalloc(sizeof(struct com20020_dev_t), GFP_KERNEL);
@@ -169,11 +164,10 @@ static int com20020_probe(struct pcmcia_device *p_dev)
169 p_dev->io.NumPorts1 = 16; 164 p_dev->io.NumPorts1 = 16;
170 p_dev->io.IOAddrLines = 16; 165 p_dev->io.IOAddrLines = 16;
171 p_dev->irq.Attributes = IRQ_TYPE_EXCLUSIVE; 166 p_dev->irq.Attributes = IRQ_TYPE_EXCLUSIVE;
172 p_dev->irq.IRQInfo1 = IRQ_LEVEL_ID;
173 p_dev->conf.Attributes = CONF_ENABLE_IRQ; 167 p_dev->conf.Attributes = CONF_ENABLE_IRQ;
174 p_dev->conf.IntType = INT_MEMORY_AND_IO; 168 p_dev->conf.IntType = INT_MEMORY_AND_IO;
175 169
176 p_dev->irq.Instance = info->dev = dev; 170 info->dev = dev;
177 p_dev->priv = info; 171 p_dev->priv = info;
178 172
179 return com20020_config(p_dev); 173 return com20020_config(p_dev);
@@ -198,12 +192,12 @@ static void com20020_detach(struct pcmcia_device *link)
198 struct com20020_dev_t *info = link->priv; 192 struct com20020_dev_t *info = link->priv;
199 struct net_device *dev = info->dev; 193 struct net_device *dev = info->dev;
200 194
201 DEBUG(1,"detach...\n"); 195 dev_dbg(&link->dev, "detach...\n");
202 196
203 DEBUG(0, "com20020_detach(0x%p)\n", link); 197 dev_dbg(&link->dev, "com20020_detach\n");
204 198
205 if (link->dev_node) { 199 if (link->dev_node) {
206 DEBUG(1,"unregister...\n"); 200 dev_dbg(&link->dev, "unregister...\n");
207 201
208 unregister_netdev(dev); 202 unregister_netdev(dev);
209 203
@@ -218,16 +212,16 @@ static void com20020_detach(struct pcmcia_device *link)
218 com20020_release(link); 212 com20020_release(link);
219 213
220 /* Unlink device structure, free bits */ 214 /* Unlink device structure, free bits */
221 DEBUG(1,"unlinking...\n"); 215 dev_dbg(&link->dev, "unlinking...\n");
222 if (link->priv) 216 if (link->priv)
223 { 217 {
224 dev = info->dev; 218 dev = info->dev;
225 if (dev) 219 if (dev)
226 { 220 {
227 DEBUG(1,"kfree...\n"); 221 dev_dbg(&link->dev, "kfree...\n");
228 free_netdev(dev); 222 free_netdev(dev);
229 } 223 }
230 DEBUG(1,"kfree2...\n"); 224 dev_dbg(&link->dev, "kfree2...\n");
231 kfree(info); 225 kfree(info);
232 } 226 }
233 227
@@ -241,25 +235,22 @@ static void com20020_detach(struct pcmcia_device *link)
241 235
242======================================================================*/ 236======================================================================*/
243 237
244#define CS_CHECK(fn, ret) \
245do { last_fn = (fn); if ((last_ret = (ret)) != 0) goto cs_failed; } while (0)
246
247static int com20020_config(struct pcmcia_device *link) 238static int com20020_config(struct pcmcia_device *link)
248{ 239{
249 struct arcnet_local *lp; 240 struct arcnet_local *lp;
250 com20020_dev_t *info; 241 com20020_dev_t *info;
251 struct net_device *dev; 242 struct net_device *dev;
252 int i, last_ret, last_fn; 243 int i, ret;
253 int ioaddr; 244 int ioaddr;
254 245
255 info = link->priv; 246 info = link->priv;
256 dev = info->dev; 247 dev = info->dev;
257 248
258 DEBUG(1,"config...\n"); 249 dev_dbg(&link->dev, "config...\n");
259 250
260 DEBUG(0, "com20020_config(0x%p)\n", link); 251 dev_dbg(&link->dev, "com20020_config\n");
261 252
262 DEBUG(1,"arcnet: baseport1 is %Xh\n", link->io.BasePort1); 253 dev_dbg(&link->dev, "baseport1 is %Xh\n", link->io.BasePort1);
263 i = -ENODEV; 254 i = -ENODEV;
264 if (!link->io.BasePort1) 255 if (!link->io.BasePort1)
265 { 256 {
@@ -276,26 +267,27 @@ static int com20020_config(struct pcmcia_device *link)
276 267
277 if (i != 0) 268 if (i != 0)
278 { 269 {
279 DEBUG(1,"arcnet: requestIO failed totally!\n"); 270 dev_dbg(&link->dev, "requestIO failed totally!\n");
280 goto failed; 271 goto failed;
281 } 272 }
282 273
283 ioaddr = dev->base_addr = link->io.BasePort1; 274 ioaddr = dev->base_addr = link->io.BasePort1;
284 DEBUG(1,"arcnet: got ioaddr %Xh\n", ioaddr); 275 dev_dbg(&link->dev, "got ioaddr %Xh\n", ioaddr);
285 276
286 DEBUG(1,"arcnet: request IRQ %d (%Xh/%Xh)\n", 277 dev_dbg(&link->dev, "request IRQ %d\n",
287 link->irq.AssignedIRQ, 278 link->irq.AssignedIRQ);
288 link->irq.IRQInfo1, link->irq.IRQInfo2);
289 i = pcmcia_request_irq(link, &link->irq); 279 i = pcmcia_request_irq(link, &link->irq);
290 if (i != 0) 280 if (i != 0)
291 { 281 {
292 DEBUG(1,"arcnet: requestIRQ failed totally!\n"); 282 dev_dbg(&link->dev, "requestIRQ failed totally!\n");
293 goto failed; 283 goto failed;
294 } 284 }
295 285
296 dev->irq = link->irq.AssignedIRQ; 286 dev->irq = link->irq.AssignedIRQ;
297 287
298 CS_CHECK(RequestConfiguration, pcmcia_request_configuration(link, &link->conf)); 288 ret = pcmcia_request_configuration(link, &link->conf);
289 if (ret)
290 goto failed;
299 291
300 if (com20020_check(dev)) 292 if (com20020_check(dev))
301 { 293 {
@@ -308,26 +300,25 @@ static int com20020_config(struct pcmcia_device *link)
308 lp->card_flags = ARC_CAN_10MBIT; /* pretend all of them can 10Mbit */ 300 lp->card_flags = ARC_CAN_10MBIT; /* pretend all of them can 10Mbit */
309 301
310 link->dev_node = &info->node; 302 link->dev_node = &info->node;
311 SET_NETDEV_DEV(dev, &handle_to_dev(link)); 303 SET_NETDEV_DEV(dev, &link->dev);
312 304
313 i = com20020_found(dev, 0); /* calls register_netdev */ 305 i = com20020_found(dev, 0); /* calls register_netdev */
314 306
315 if (i != 0) { 307 if (i != 0) {
316 DEBUG(1,KERN_NOTICE "com20020_cs: com20020_found() failed\n"); 308 dev_printk(KERN_NOTICE, &link->dev,
309 "com20020_cs: com20020_found() failed\n");
317 link->dev_node = NULL; 310 link->dev_node = NULL;
318 goto failed; 311 goto failed;
319 } 312 }
320 313
321 strcpy(info->node.dev_name, dev->name); 314 strcpy(info->node.dev_name, dev->name);
322 315
323 DEBUG(1,KERN_INFO "%s: port %#3lx, irq %d\n", 316 dev_dbg(&link->dev,KERN_INFO "%s: port %#3lx, irq %d\n",
324 dev->name, dev->base_addr, dev->irq); 317 dev->name, dev->base_addr, dev->irq);
325 return 0; 318 return 0;
326 319
327cs_failed:
328 cs_error(link, last_fn, last_ret);
329failed: 320failed:
330 DEBUG(1,"com20020_config failed...\n"); 321 dev_dbg(&link->dev, "com20020_config failed...\n");
331 com20020_release(link); 322 com20020_release(link);
332 return -ENODEV; 323 return -ENODEV;
333} /* com20020_config */ 324} /* com20020_config */
@@ -342,7 +333,7 @@ failed:
342 333
343static void com20020_release(struct pcmcia_device *link) 334static void com20020_release(struct pcmcia_device *link)
344{ 335{
345 DEBUG(0, "com20020_release(0x%p)\n", link); 336 dev_dbg(&link->dev, "com20020_release\n");
346 pcmcia_disable_device(link); 337 pcmcia_disable_device(link);
347} 338}
348 339
diff --git a/drivers/net/pcmcia/fmvj18x_cs.c b/drivers/net/pcmcia/fmvj18x_cs.c
index 7e01fbdb87e0..6e3e1ced6db4 100644
--- a/drivers/net/pcmcia/fmvj18x_cs.c
+++ b/drivers/net/pcmcia/fmvj18x_cs.c
@@ -72,13 +72,6 @@ MODULE_LICENSE("GPL");
72/* 0:4KB*2 TX buffer else:8KB*2 TX buffer */ 72/* 0:4KB*2 TX buffer else:8KB*2 TX buffer */
73INT_MODULE_PARM(sram_config, 0); 73INT_MODULE_PARM(sram_config, 0);
74 74
75#ifdef PCMCIA_DEBUG
76INT_MODULE_PARM(pc_debug, PCMCIA_DEBUG);
77#define DEBUG(n, args...) if (pc_debug>(n)) printk(KERN_DEBUG args)
78static char *version = DRV_NAME ".c " DRV_VERSION " 2002/03/23";
79#else
80#define DEBUG(n, args...)
81#endif
82 75
83/*====================================================================*/ 76/*====================================================================*/
84/* 77/*
@@ -245,7 +238,7 @@ static int fmvj18x_probe(struct pcmcia_device *link)
245 local_info_t *lp; 238 local_info_t *lp;
246 struct net_device *dev; 239 struct net_device *dev;
247 240
248 DEBUG(0, "fmvj18x_attach()\n"); 241 dev_dbg(&link->dev, "fmvj18x_attach()\n");
249 242
250 /* Make up a FMVJ18x specific data structure */ 243 /* Make up a FMVJ18x specific data structure */
251 dev = alloc_etherdev(sizeof(local_info_t)); 244 dev = alloc_etherdev(sizeof(local_info_t));
@@ -262,10 +255,8 @@ static int fmvj18x_probe(struct pcmcia_device *link)
262 link->io.IOAddrLines = 5; 255 link->io.IOAddrLines = 5;
263 256
264 /* Interrupt setup */ 257 /* Interrupt setup */
265 link->irq.Attributes = IRQ_TYPE_DYNAMIC_SHARING|IRQ_HANDLE_PRESENT; 258 link->irq.Attributes = IRQ_TYPE_DYNAMIC_SHARING;
266 link->irq.IRQInfo1 = IRQ_LEVEL_ID;
267 link->irq.Handler = &fjn_interrupt; 259 link->irq.Handler = &fjn_interrupt;
268 link->irq.Instance = dev;
269 260
270 /* General socket configuration */ 261 /* General socket configuration */
271 link->conf.Attributes = CONF_ENABLE_IRQ; 262 link->conf.Attributes = CONF_ENABLE_IRQ;
@@ -285,7 +276,7 @@ static void fmvj18x_detach(struct pcmcia_device *link)
285{ 276{
286 struct net_device *dev = link->priv; 277 struct net_device *dev = link->priv;
287 278
288 DEBUG(0, "fmvj18x_detach(0x%p)\n", link); 279 dev_dbg(&link->dev, "fmvj18x_detach\n");
289 280
290 if (link->dev_node) 281 if (link->dev_node)
291 unregister_netdev(dev); 282 unregister_netdev(dev);
@@ -297,9 +288,6 @@ static void fmvj18x_detach(struct pcmcia_device *link)
297 288
298/*====================================================================*/ 289/*====================================================================*/
299 290
300#define CS_CHECK(fn, ret) \
301do { last_fn = (fn); if ((last_ret = (ret)) != 0) goto cs_failed; } while (0)
302
303static int mfc_try_io_port(struct pcmcia_device *link) 291static int mfc_try_io_port(struct pcmcia_device *link)
304{ 292{
305 int i, ret; 293 int i, ret;
@@ -341,33 +329,38 @@ static int ungermann_try_io_port(struct pcmcia_device *link)
341 return ret; /* RequestIO failed */ 329 return ret; /* RequestIO failed */
342} 330}
343 331
332static int fmvj18x_ioprobe(struct pcmcia_device *p_dev,
333 cistpl_cftable_entry_t *cfg,
334 cistpl_cftable_entry_t *dflt,
335 unsigned int vcc,
336 void *priv_data)
337{
338 return 0; /* strange, but that's what the code did already before... */
339}
340
344static int fmvj18x_config(struct pcmcia_device *link) 341static int fmvj18x_config(struct pcmcia_device *link)
345{ 342{
346 struct net_device *dev = link->priv; 343 struct net_device *dev = link->priv;
347 local_info_t *lp = netdev_priv(dev); 344 local_info_t *lp = netdev_priv(dev);
348 tuple_t tuple; 345 int i, ret;
349 cisparse_t parse;
350 u_short buf[32];
351 int i, last_fn = 0, last_ret = 0, ret;
352 unsigned int ioaddr; 346 unsigned int ioaddr;
353 cardtype_t cardtype; 347 cardtype_t cardtype;
354 char *card_name = "unknown"; 348 char *card_name = "unknown";
355 u_char *node_id; 349 u8 *buf;
350 size_t len;
351 u_char buggybuf[32];
352
353 dev_dbg(&link->dev, "fmvj18x_config\n");
356 354
357 DEBUG(0, "fmvj18x_config(0x%p)\n", link); 355 len = pcmcia_get_tuple(link, CISTPL_FUNCE, &buf);
356 kfree(buf);
358 357
359 tuple.TupleData = (u_char *)buf; 358 if (len) {
360 tuple.TupleDataMax = 64;
361 tuple.TupleOffset = 0;
362 tuple.DesiredTuple = CISTPL_FUNCE;
363 tuple.TupleOffset = 0;
364 if (pcmcia_get_first_tuple(link, &tuple) == 0) {
365 /* Yes, I have CISTPL_FUNCE. Let's check CISTPL_MANFID */ 359 /* Yes, I have CISTPL_FUNCE. Let's check CISTPL_MANFID */
366 tuple.DesiredTuple = CISTPL_CFTABLE_ENTRY; 360 ret = pcmcia_loop_config(link, fmvj18x_ioprobe, NULL);
367 CS_CHECK(GetFirstTuple, pcmcia_get_first_tuple(link, &tuple)); 361 if (ret != 0)
368 CS_CHECK(GetTupleData, pcmcia_get_tuple_data(link, &tuple)); 362 goto failed;
369 CS_CHECK(ParseTuple, pcmcia_parse_tuple(&tuple, &parse)); 363
370 link->conf.ConfigIndex = parse.cftable_entry.index;
371 switch (link->manf_id) { 364 switch (link->manf_id) {
372 case MANFID_TDK: 365 case MANFID_TDK:
373 cardtype = TDK; 366 cardtype = TDK;
@@ -433,17 +426,24 @@ static int fmvj18x_config(struct pcmcia_device *link)
433 426
434 if (link->io.NumPorts2 != 0) { 427 if (link->io.NumPorts2 != 0) {
435 link->irq.Attributes = 428 link->irq.Attributes =
436 IRQ_TYPE_DYNAMIC_SHARING|IRQ_FIRST_SHARED|IRQ_HANDLE_PRESENT; 429 IRQ_TYPE_DYNAMIC_SHARING|IRQ_FIRST_SHARED;
437 ret = mfc_try_io_port(link); 430 ret = mfc_try_io_port(link);
438 if (ret != 0) goto cs_failed; 431 if (ret != 0) goto failed;
439 } else if (cardtype == UNGERMANN) { 432 } else if (cardtype == UNGERMANN) {
440 ret = ungermann_try_io_port(link); 433 ret = ungermann_try_io_port(link);
441 if (ret != 0) goto cs_failed; 434 if (ret != 0) goto failed;
442 } else { 435 } else {
443 CS_CHECK(RequestIO, pcmcia_request_io(link, &link->io)); 436 ret = pcmcia_request_io(link, &link->io);
437 if (ret)
438 goto failed;
444 } 439 }
445 CS_CHECK(RequestIRQ, pcmcia_request_irq(link, &link->irq)); 440 ret = pcmcia_request_irq(link, &link->irq);
446 CS_CHECK(RequestConfiguration, pcmcia_request_configuration(link, &link->conf)); 441 if (ret)
442 goto failed;
443 ret = pcmcia_request_configuration(link, &link->conf);
444 if (ret)
445 goto failed;
446
447 dev->irq = link->irq.AssignedIRQ; 447 dev->irq = link->irq.AssignedIRQ;
448 dev->base_addr = link->io.BasePort1; 448 dev->base_addr = link->io.BasePort1;
449 449
@@ -474,21 +474,21 @@ static int fmvj18x_config(struct pcmcia_device *link)
474 case CONTEC: 474 case CONTEC:
475 case NEC: 475 case NEC:
476 case KME: 476 case KME:
477 tuple.DesiredTuple = CISTPL_FUNCE;
478 tuple.TupleOffset = 0;
479 CS_CHECK(GetFirstTuple, pcmcia_get_first_tuple(link, &tuple));
480 tuple.TupleOffset = 0;
481 CS_CHECK(GetTupleData, pcmcia_get_tuple_data(link, &tuple));
482 if (cardtype == MBH10304) { 477 if (cardtype == MBH10304) {
483 /* MBH10304's CIS_FUNCE is corrupted */
484 node_id = &(tuple.TupleData[5]);
485 card_name = "FMV-J182"; 478 card_name = "FMV-J182";
486 } else { 479
487 while (tuple.TupleData[0] != CISTPL_FUNCE_LAN_NODE_ID ) { 480 len = pcmcia_get_tuple(link, CISTPL_FUNCE, &buf);
488 CS_CHECK(GetNextTuple, pcmcia_get_next_tuple(link, &tuple)); 481 if (len < 11) {
489 CS_CHECK(GetTupleData, pcmcia_get_tuple_data(link, &tuple)); 482 kfree(buf);
483 goto failed;
490 } 484 }
491 node_id = &(tuple.TupleData[2]); 485 /* Read MACID from CIS */
486 for (i = 5; i < 11; i++)
487 dev->dev_addr[i] = buf[i];
488 kfree(buf);
489 } else {
490 if (pcmcia_get_mac_from_cis(link, dev))
491 goto failed;
492 if( cardtype == TDK ) { 492 if( cardtype == TDK ) {
493 card_name = "TDK LAK-CD021"; 493 card_name = "TDK LAK-CD021";
494 } else if( cardtype == LA501 ) { 494 } else if( cardtype == LA501 ) {
@@ -501,9 +501,6 @@ static int fmvj18x_config(struct pcmcia_device *link)
501 card_name = "C-NET(PC)C"; 501 card_name = "C-NET(PC)C";
502 } 502 }
503 } 503 }
504 /* Read MACID from CIS */
505 for (i = 0; i < 6; i++)
506 dev->dev_addr[i] = node_id[i];
507 break; 504 break;
508 case UNGERMANN: 505 case UNGERMANN:
509 /* Read MACID from register */ 506 /* Read MACID from register */
@@ -513,12 +510,12 @@ static int fmvj18x_config(struct pcmcia_device *link)
513 break; 510 break;
514 case XXX10304: 511 case XXX10304:
515 /* Read MACID from Buggy CIS */ 512 /* Read MACID from Buggy CIS */
516 if (fmvj18x_get_hwinfo(link, tuple.TupleData) == -1) { 513 if (fmvj18x_get_hwinfo(link, buggybuf) == -1) {
517 printk(KERN_NOTICE "fmvj18x_cs: unable to read hardware net address.\n"); 514 printk(KERN_NOTICE "fmvj18x_cs: unable to read hardware net address.\n");
518 goto failed; 515 goto failed;
519 } 516 }
520 for (i = 0 ; i < 6; i++) { 517 for (i = 0 ; i < 6; i++) {
521 dev->dev_addr[i] = tuple.TupleData[i]; 518 dev->dev_addr[i] = buggybuf[i];
522 } 519 }
523 card_name = "FMV-J182"; 520 card_name = "FMV-J182";
524 break; 521 break;
@@ -533,7 +530,7 @@ static int fmvj18x_config(struct pcmcia_device *link)
533 530
534 lp->cardtype = cardtype; 531 lp->cardtype = cardtype;
535 link->dev_node = &lp->node; 532 link->dev_node = &lp->node;
536 SET_NETDEV_DEV(dev, &handle_to_dev(link)); 533 SET_NETDEV_DEV(dev, &link->dev);
537 534
538 if (register_netdev(dev) != 0) { 535 if (register_netdev(dev) != 0) {
539 printk(KERN_NOTICE "fmvj18x_cs: register_netdev() failed\n"); 536 printk(KERN_NOTICE "fmvj18x_cs: register_netdev() failed\n");
@@ -551,9 +548,6 @@ static int fmvj18x_config(struct pcmcia_device *link)
551 548
552 return 0; 549 return 0;
553 550
554cs_failed:
555 /* All Card Services errors end up here */
556 cs_error(link, last_fn, last_ret);
557failed: 551failed:
558 fmvj18x_release(link); 552 fmvj18x_release(link);
559 return -ENODEV; 553 return -ENODEV;
@@ -571,16 +565,14 @@ static int fmvj18x_get_hwinfo(struct pcmcia_device *link, u_char *node_id)
571 req.Attributes = WIN_DATA_WIDTH_8|WIN_MEMORY_TYPE_AM|WIN_ENABLE; 565 req.Attributes = WIN_DATA_WIDTH_8|WIN_MEMORY_TYPE_AM|WIN_ENABLE;
572 req.Base = 0; req.Size = 0; 566 req.Base = 0; req.Size = 0;
573 req.AccessSpeed = 0; 567 req.AccessSpeed = 0;
574 i = pcmcia_request_window(&link, &req, &link->win); 568 i = pcmcia_request_window(link, &req, &link->win);
575 if (i != 0) { 569 if (i != 0)
576 cs_error(link, RequestWindow, i);
577 return -1; 570 return -1;
578 }
579 571
580 base = ioremap(req.Base, req.Size); 572 base = ioremap(req.Base, req.Size);
581 mem.Page = 0; 573 mem.Page = 0;
582 mem.CardOffset = 0; 574 mem.CardOffset = 0;
583 pcmcia_map_mem_page(link->win, &mem); 575 pcmcia_map_mem_page(link, link->win, &mem);
584 576
585 /* 577 /*
586 * MBH10304 CISTPL_FUNCE_LAN_NODE_ID format 578 * MBH10304 CISTPL_FUNCE_LAN_NODE_ID format
@@ -605,9 +597,7 @@ static int fmvj18x_get_hwinfo(struct pcmcia_device *link, u_char *node_id)
605 } 597 }
606 598
607 iounmap(base); 599 iounmap(base);
608 j = pcmcia_release_window(link->win); 600 j = pcmcia_release_window(link, link->win);
609 if (j != 0)
610 cs_error(link, ReleaseWindow, j);
611 return (i != 0x200) ? 0 : -1; 601 return (i != 0x200) ? 0 : -1;
612 602
613} /* fmvj18x_get_hwinfo */ 603} /* fmvj18x_get_hwinfo */
@@ -626,11 +616,9 @@ static int fmvj18x_setup_mfc(struct pcmcia_device *link)
626 req.Attributes = WIN_DATA_WIDTH_8|WIN_MEMORY_TYPE_AM|WIN_ENABLE; 616 req.Attributes = WIN_DATA_WIDTH_8|WIN_MEMORY_TYPE_AM|WIN_ENABLE;
627 req.Base = 0; req.Size = 0; 617 req.Base = 0; req.Size = 0;
628 req.AccessSpeed = 0; 618 req.AccessSpeed = 0;
629 i = pcmcia_request_window(&link, &req, &link->win); 619 i = pcmcia_request_window(link, &req, &link->win);
630 if (i != 0) { 620 if (i != 0)
631 cs_error(link, RequestWindow, i);
632 return -1; 621 return -1;
633 }
634 622
635 lp->base = ioremap(req.Base, req.Size); 623 lp->base = ioremap(req.Base, req.Size);
636 if (lp->base == NULL) { 624 if (lp->base == NULL) {
@@ -640,11 +628,10 @@ static int fmvj18x_setup_mfc(struct pcmcia_device *link)
640 628
641 mem.Page = 0; 629 mem.Page = 0;
642 mem.CardOffset = 0; 630 mem.CardOffset = 0;
643 i = pcmcia_map_mem_page(link->win, &mem); 631 i = pcmcia_map_mem_page(link, link->win, &mem);
644 if (i != 0) { 632 if (i != 0) {
645 iounmap(lp->base); 633 iounmap(lp->base);
646 lp->base = NULL; 634 lp->base = NULL;
647 cs_error(link, MapMemPage, i);
648 return -1; 635 return -1;
649 } 636 }
650 637
@@ -671,15 +658,13 @@ static void fmvj18x_release(struct pcmcia_device *link)
671 u_char __iomem *tmp; 658 u_char __iomem *tmp;
672 int j; 659 int j;
673 660
674 DEBUG(0, "fmvj18x_release(0x%p)\n", link); 661 dev_dbg(&link->dev, "fmvj18x_release\n");
675 662
676 if (lp->base != NULL) { 663 if (lp->base != NULL) {
677 tmp = lp->base; 664 tmp = lp->base;
678 lp->base = NULL; /* set NULL before iounmap */ 665 lp->base = NULL; /* set NULL before iounmap */
679 iounmap(tmp); 666 iounmap(tmp);
680 j = pcmcia_release_window(link->win); 667 j = pcmcia_release_window(link, link->win);
681 if (j != 0)
682 cs_error(link, ReleaseWindow, j);
683 } 668 }
684 669
685 pcmcia_disable_device(link); 670 pcmcia_disable_device(link);
@@ -788,8 +773,8 @@ static irqreturn_t fjn_interrupt(int dummy, void *dev_id)
788 outb(tx_stat, ioaddr + TX_STATUS); 773 outb(tx_stat, ioaddr + TX_STATUS);
789 outb(rx_stat, ioaddr + RX_STATUS); 774 outb(rx_stat, ioaddr + RX_STATUS);
790 775
791 DEBUG(4, "%s: interrupt, rx_status %02x.\n", dev->name, rx_stat); 776 pr_debug("%s: interrupt, rx_status %02x.\n", dev->name, rx_stat);
792 DEBUG(4, " tx_status %02x.\n", tx_stat); 777 pr_debug(" tx_status %02x.\n", tx_stat);
793 778
794 if (rx_stat || (inb(ioaddr + RX_MODE) & F_BUF_EMP) == 0) { 779 if (rx_stat || (inb(ioaddr + RX_MODE) & F_BUF_EMP) == 0) {
795 /* there is packet(s) in rx buffer */ 780 /* there is packet(s) in rx buffer */
@@ -809,8 +794,8 @@ static irqreturn_t fjn_interrupt(int dummy, void *dev_id)
809 } 794 }
810 netif_wake_queue(dev); 795 netif_wake_queue(dev);
811 } 796 }
812 DEBUG(4, "%s: exiting interrupt,\n", dev->name); 797 pr_debug("%s: exiting interrupt,\n", dev->name);
813 DEBUG(4, " tx_status %02x, rx_status %02x.\n", tx_stat, rx_stat); 798 pr_debug(" tx_status %02x, rx_status %02x.\n", tx_stat, rx_stat);
814 799
815 outb(D_TX_INTR, ioaddr + TX_INTR); 800 outb(D_TX_INTR, ioaddr + TX_INTR);
816 outb(D_RX_INTR, ioaddr + RX_INTR); 801 outb(D_RX_INTR, ioaddr + RX_INTR);
@@ -882,7 +867,7 @@ static netdev_tx_t fjn_start_xmit(struct sk_buff *skb,
882 return NETDEV_TX_BUSY; 867 return NETDEV_TX_BUSY;
883 } 868 }
884 869
885 DEBUG(4, "%s: Transmitting a packet of length %lu.\n", 870 pr_debug("%s: Transmitting a packet of length %lu.\n",
886 dev->name, (unsigned long)skb->len); 871 dev->name, (unsigned long)skb->len);
887 dev->stats.tx_bytes += skb->len; 872 dev->stats.tx_bytes += skb->len;
888 873
@@ -937,7 +922,7 @@ static void fjn_reset(struct net_device *dev)
937 unsigned int ioaddr = dev->base_addr; 922 unsigned int ioaddr = dev->base_addr;
938 int i; 923 int i;
939 924
940 DEBUG(4, "fjn_reset(%s) called.\n",dev->name); 925 pr_debug("fjn_reset(%s) called.\n",dev->name);
941 926
942 /* Reset controller */ 927 /* Reset controller */
943 if( sram_config == 0 ) 928 if( sram_config == 0 )
@@ -1015,13 +1000,13 @@ static void fjn_rx(struct net_device *dev)
1015 unsigned int ioaddr = dev->base_addr; 1000 unsigned int ioaddr = dev->base_addr;
1016 int boguscount = 10; /* 5 -> 10: by agy 19940922 */ 1001 int boguscount = 10; /* 5 -> 10: by agy 19940922 */
1017 1002
1018 DEBUG(4, "%s: in rx_packet(), rx_status %02x.\n", 1003 pr_debug("%s: in rx_packet(), rx_status %02x.\n",
1019 dev->name, inb(ioaddr + RX_STATUS)); 1004 dev->name, inb(ioaddr + RX_STATUS));
1020 1005
1021 while ((inb(ioaddr + RX_MODE) & F_BUF_EMP) == 0) { 1006 while ((inb(ioaddr + RX_MODE) & F_BUF_EMP) == 0) {
1022 u_short status = inw(ioaddr + DATAPORT); 1007 u_short status = inw(ioaddr + DATAPORT);
1023 1008
1024 DEBUG(4, "%s: Rxing packet mode %02x status %04x.\n", 1009 pr_debug("%s: Rxing packet mode %02x status %04x.\n",
1025 dev->name, inb(ioaddr + RX_MODE), status); 1010 dev->name, inb(ioaddr + RX_MODE), status);
1026#ifndef final_version 1011#ifndef final_version
1027 if (status == 0) { 1012 if (status == 0) {
@@ -1061,16 +1046,14 @@ static void fjn_rx(struct net_device *dev)
1061 (pkt_len + 1) >> 1); 1046 (pkt_len + 1) >> 1);
1062 skb->protocol = eth_type_trans(skb, dev); 1047 skb->protocol = eth_type_trans(skb, dev);
1063 1048
1064#ifdef PCMCIA_DEBUG 1049 {
1065 if (pc_debug > 5) {
1066 int i; 1050 int i;
1067 printk(KERN_DEBUG "%s: Rxed packet of length %d: ", 1051 pr_debug("%s: Rxed packet of length %d: ",
1068 dev->name, pkt_len); 1052 dev->name, pkt_len);
1069 for (i = 0; i < 14; i++) 1053 for (i = 0; i < 14; i++)
1070 printk(" %02x", skb->data[i]); 1054 pr_debug(" %02x", skb->data[i]);
1071 printk(".\n"); 1055 pr_debug(".\n");
1072 } 1056 }
1073#endif
1074 1057
1075 netif_rx(skb); 1058 netif_rx(skb);
1076 dev->stats.rx_packets++; 1059 dev->stats.rx_packets++;
@@ -1094,7 +1077,7 @@ static void fjn_rx(struct net_device *dev)
1094 } 1077 }
1095 1078
1096 if (i > 0) 1079 if (i > 0)
1097 DEBUG(5, "%s: Exint Rx packet with mode %02x after " 1080 pr_debug("%s: Exint Rx packet with mode %02x after "
1098 "%d ticks.\n", dev->name, inb(ioaddr + RX_MODE), i); 1081 "%d ticks.\n", dev->name, inb(ioaddr + RX_MODE), i);
1099 } 1082 }
1100*/ 1083*/
@@ -1112,24 +1095,8 @@ static void netdev_get_drvinfo(struct net_device *dev,
1112 sprintf(info->bus_info, "PCMCIA 0x%lx", dev->base_addr); 1095 sprintf(info->bus_info, "PCMCIA 0x%lx", dev->base_addr);
1113} 1096}
1114 1097
1115#ifdef PCMCIA_DEBUG
1116static u32 netdev_get_msglevel(struct net_device *dev)
1117{
1118 return pc_debug;
1119}
1120
1121static void netdev_set_msglevel(struct net_device *dev, u32 level)
1122{
1123 pc_debug = level;
1124}
1125#endif /* PCMCIA_DEBUG */
1126
1127static const struct ethtool_ops netdev_ethtool_ops = { 1098static const struct ethtool_ops netdev_ethtool_ops = {
1128 .get_drvinfo = netdev_get_drvinfo, 1099 .get_drvinfo = netdev_get_drvinfo,
1129#ifdef PCMCIA_DEBUG
1130 .get_msglevel = netdev_get_msglevel,
1131 .set_msglevel = netdev_set_msglevel,
1132#endif /* PCMCIA_DEBUG */
1133}; 1100};
1134 1101
1135static int fjn_config(struct net_device *dev, struct ifmap *map){ 1102static int fjn_config(struct net_device *dev, struct ifmap *map){
@@ -1141,7 +1108,7 @@ static int fjn_open(struct net_device *dev)
1141 struct local_info_t *lp = netdev_priv(dev); 1108 struct local_info_t *lp = netdev_priv(dev);
1142 struct pcmcia_device *link = lp->p_dev; 1109 struct pcmcia_device *link = lp->p_dev;
1143 1110
1144 DEBUG(4, "fjn_open('%s').\n", dev->name); 1111 pr_debug("fjn_open('%s').\n", dev->name);
1145 1112
1146 if (!pcmcia_dev_present(link)) 1113 if (!pcmcia_dev_present(link))
1147 return -ENODEV; 1114 return -ENODEV;
@@ -1167,7 +1134,7 @@ static int fjn_close(struct net_device *dev)
1167 struct pcmcia_device *link = lp->p_dev; 1134 struct pcmcia_device *link = lp->p_dev;
1168 unsigned int ioaddr = dev->base_addr; 1135 unsigned int ioaddr = dev->base_addr;
1169 1136
1170 DEBUG(4, "fjn_close('%s').\n", dev->name); 1137 pr_debug("fjn_close('%s').\n", dev->name);
1171 1138
1172 lp->open_time = 0; 1139 lp->open_time = 0;
1173 netif_stop_queue(dev); 1140 netif_stop_queue(dev);
diff --git a/drivers/net/pcmcia/ibmtr_cs.c b/drivers/net/pcmcia/ibmtr_cs.c
index 06618af1a468..37f4a6fdc3ef 100644
--- a/drivers/net/pcmcia/ibmtr_cs.c
+++ b/drivers/net/pcmcia/ibmtr_cs.c
@@ -69,17 +69,6 @@
69#define PCMCIA 69#define PCMCIA
70#include "../tokenring/ibmtr.c" 70#include "../tokenring/ibmtr.c"
71 71
72#ifdef PCMCIA_DEBUG
73static int pc_debug = PCMCIA_DEBUG;
74module_param(pc_debug, int, 0);
75#define DEBUG(n, args...) if (pc_debug>(n)) printk(KERN_DEBUG args)
76static char *version =
77"ibmtr_cs.c 1.10 1996/01/06 05:19:00 (Steve Kipisz)\n"
78" 2.2.7 1999/05/03 12:00:00 (Mike Phillips)\n"
79" 2.4.2 2001/30/28 Midnight (Burt Silverman)\n";
80#else
81#define DEBUG(n, args...)
82#endif
83 72
84/*====================================================================*/ 73/*====================================================================*/
85 74
@@ -130,6 +119,12 @@ static const struct ethtool_ops netdev_ethtool_ops = {
130 .get_drvinfo = netdev_get_drvinfo, 119 .get_drvinfo = netdev_get_drvinfo,
131}; 120};
132 121
122static irqreturn_t ibmtr_interrupt(int irq, void *dev_id) {
123 ibmtr_dev_t *info = dev_id;
124 struct net_device *dev = info->dev;
125 return tok_interrupt(irq, dev);
126};
127
133/*====================================================================== 128/*======================================================================
134 129
135 ibmtr_attach() creates an "instance" of the driver, allocating 130 ibmtr_attach() creates an "instance" of the driver, allocating
@@ -143,7 +138,7 @@ static int __devinit ibmtr_attach(struct pcmcia_device *link)
143 ibmtr_dev_t *info; 138 ibmtr_dev_t *info;
144 struct net_device *dev; 139 struct net_device *dev;
145 140
146 DEBUG(0, "ibmtr_attach()\n"); 141 dev_dbg(&link->dev, "ibmtr_attach()\n");
147 142
148 /* Create new token-ring device */ 143 /* Create new token-ring device */
149 info = kzalloc(sizeof(*info), GFP_KERNEL); 144 info = kzalloc(sizeof(*info), GFP_KERNEL);
@@ -161,14 +156,13 @@ static int __devinit ibmtr_attach(struct pcmcia_device *link)
161 link->io.Attributes1 = IO_DATA_PATH_WIDTH_8; 156 link->io.Attributes1 = IO_DATA_PATH_WIDTH_8;
162 link->io.NumPorts1 = 4; 157 link->io.NumPorts1 = 4;
163 link->io.IOAddrLines = 16; 158 link->io.IOAddrLines = 16;
164 link->irq.Attributes = IRQ_TYPE_EXCLUSIVE | IRQ_HANDLE_PRESENT; 159 link->irq.Attributes = IRQ_TYPE_EXCLUSIVE;
165 link->irq.IRQInfo1 = IRQ_LEVEL_ID; 160 link->irq.Handler = ibmtr_interrupt;
166 link->irq.Handler = &tok_interrupt;
167 link->conf.Attributes = CONF_ENABLE_IRQ; 161 link->conf.Attributes = CONF_ENABLE_IRQ;
168 link->conf.IntType = INT_MEMORY_AND_IO; 162 link->conf.IntType = INT_MEMORY_AND_IO;
169 link->conf.Present = PRESENT_OPTION; 163 link->conf.Present = PRESENT_OPTION;
170 164
171 link->irq.Instance = info->dev = dev; 165 info->dev = dev;
172 166
173 SET_ETHTOOL_OPS(dev, &netdev_ethtool_ops); 167 SET_ETHTOOL_OPS(dev, &netdev_ethtool_ops);
174 168
@@ -190,7 +184,7 @@ static void ibmtr_detach(struct pcmcia_device *link)
190 struct net_device *dev = info->dev; 184 struct net_device *dev = info->dev;
191 struct tok_info *ti = netdev_priv(dev); 185 struct tok_info *ti = netdev_priv(dev);
192 186
193 DEBUG(0, "ibmtr_detach(0x%p)\n", link); 187 dev_dbg(&link->dev, "ibmtr_detach\n");
194 188
195 /* 189 /*
196 * When the card removal interrupt hits tok_interrupt(), 190 * When the card removal interrupt hits tok_interrupt(),
@@ -217,9 +211,6 @@ static void ibmtr_detach(struct pcmcia_device *link)
217 211
218======================================================================*/ 212======================================================================*/
219 213
220#define CS_CHECK(fn, ret) \
221do { last_fn = (fn); if ((last_ret = (ret)) != 0) goto cs_failed; } while (0)
222
223static int __devinit ibmtr_config(struct pcmcia_device *link) 214static int __devinit ibmtr_config(struct pcmcia_device *link)
224{ 215{
225 ibmtr_dev_t *info = link->priv; 216 ibmtr_dev_t *info = link->priv;
@@ -227,9 +218,9 @@ static int __devinit ibmtr_config(struct pcmcia_device *link)
227 struct tok_info *ti = netdev_priv(dev); 218 struct tok_info *ti = netdev_priv(dev);
228 win_req_t req; 219 win_req_t req;
229 memreq_t mem; 220 memreq_t mem;
230 int i, last_ret, last_fn; 221 int i, ret;
231 222
232 DEBUG(0, "ibmtr_config(0x%p)\n", link); 223 dev_dbg(&link->dev, "ibmtr_config\n");
233 224
234 link->conf.ConfigIndex = 0x61; 225 link->conf.ConfigIndex = 0x61;
235 226
@@ -241,11 +232,15 @@ static int __devinit ibmtr_config(struct pcmcia_device *link)
241 if (i != 0) { 232 if (i != 0) {
242 /* Couldn't get 0xA20-0xA23. Try ALTERNATE at 0xA24-0xA27. */ 233 /* Couldn't get 0xA20-0xA23. Try ALTERNATE at 0xA24-0xA27. */
243 link->io.BasePort1 = 0xA24; 234 link->io.BasePort1 = 0xA24;
244 CS_CHECK(RequestIO, pcmcia_request_io(link, &link->io)); 235 ret = pcmcia_request_io(link, &link->io);
236 if (ret)
237 goto failed;
245 } 238 }
246 dev->base_addr = link->io.BasePort1; 239 dev->base_addr = link->io.BasePort1;
247 240
248 CS_CHECK(RequestIRQ, pcmcia_request_irq(link, &link->irq)); 241 ret = pcmcia_request_irq(link, &link->irq);
242 if (ret)
243 goto failed;
249 dev->irq = link->irq.AssignedIRQ; 244 dev->irq = link->irq.AssignedIRQ;
250 ti->irq = link->irq.AssignedIRQ; 245 ti->irq = link->irq.AssignedIRQ;
251 ti->global_int_enable=GLOBAL_INT_ENABLE+((dev->irq==9) ? 2 : dev->irq); 246 ti->global_int_enable=GLOBAL_INT_ENABLE+((dev->irq==9) ? 2 : dev->irq);
@@ -256,11 +251,15 @@ static int __devinit ibmtr_config(struct pcmcia_device *link)
256 req.Base = 0; 251 req.Base = 0;
257 req.Size = 0x2000; 252 req.Size = 0x2000;
258 req.AccessSpeed = 250; 253 req.AccessSpeed = 250;
259 CS_CHECK(RequestWindow, pcmcia_request_window(&link, &req, &link->win)); 254 ret = pcmcia_request_window(link, &req, &link->win);
255 if (ret)
256 goto failed;
260 257
261 mem.CardOffset = mmiobase; 258 mem.CardOffset = mmiobase;
262 mem.Page = 0; 259 mem.Page = 0;
263 CS_CHECK(MapMemPage, pcmcia_map_mem_page(link->win, &mem)); 260 ret = pcmcia_map_mem_page(link, link->win, &mem);
261 if (ret)
262 goto failed;
264 ti->mmio = ioremap(req.Base, req.Size); 263 ti->mmio = ioremap(req.Base, req.Size);
265 264
266 /* Allocate the SRAM memory window */ 265 /* Allocate the SRAM memory window */
@@ -269,17 +268,23 @@ static int __devinit ibmtr_config(struct pcmcia_device *link)
269 req.Base = 0; 268 req.Base = 0;
270 req.Size = sramsize * 1024; 269 req.Size = sramsize * 1024;
271 req.AccessSpeed = 250; 270 req.AccessSpeed = 250;
272 CS_CHECK(RequestWindow, pcmcia_request_window(&link, &req, &info->sram_win_handle)); 271 ret = pcmcia_request_window(link, &req, &info->sram_win_handle);
272 if (ret)
273 goto failed;
273 274
274 mem.CardOffset = srambase; 275 mem.CardOffset = srambase;
275 mem.Page = 0; 276 mem.Page = 0;
276 CS_CHECK(MapMemPage, pcmcia_map_mem_page(info->sram_win_handle, &mem)); 277 ret = pcmcia_map_mem_page(link, info->sram_win_handle, &mem);
278 if (ret)
279 goto failed;
277 280
278 ti->sram_base = mem.CardOffset >> 12; 281 ti->sram_base = mem.CardOffset >> 12;
279 ti->sram_virt = ioremap(req.Base, req.Size); 282 ti->sram_virt = ioremap(req.Base, req.Size);
280 ti->sram_phys = req.Base; 283 ti->sram_phys = req.Base;
281 284
282 CS_CHECK(RequestConfiguration, pcmcia_request_configuration(link, &link->conf)); 285 ret = pcmcia_request_configuration(link, &link->conf);
286 if (ret)
287 goto failed;
283 288
284 /* Set up the Token-Ring Controller Configuration Register and 289 /* Set up the Token-Ring Controller Configuration Register and
285 turn on the card. Check the "Local Area Network Credit Card 290 turn on the card. Check the "Local Area Network Credit Card
@@ -287,7 +292,7 @@ static int __devinit ibmtr_config(struct pcmcia_device *link)
287 ibmtr_hw_setup(dev, mmiobase); 292 ibmtr_hw_setup(dev, mmiobase);
288 293
289 link->dev_node = &info->node; 294 link->dev_node = &info->node;
290 SET_NETDEV_DEV(dev, &handle_to_dev(link)); 295 SET_NETDEV_DEV(dev, &link->dev);
291 296
292 i = ibmtr_probe_card(dev); 297 i = ibmtr_probe_card(dev);
293 if (i != 0) { 298 if (i != 0) {
@@ -305,8 +310,6 @@ static int __devinit ibmtr_config(struct pcmcia_device *link)
305 dev->dev_addr); 310 dev->dev_addr);
306 return 0; 311 return 0;
307 312
308cs_failed:
309 cs_error(link, last_fn, last_ret);
310failed: 313failed:
311 ibmtr_release(link); 314 ibmtr_release(link);
312 return -ENODEV; 315 return -ENODEV;
@@ -325,12 +328,12 @@ static void ibmtr_release(struct pcmcia_device *link)
325 ibmtr_dev_t *info = link->priv; 328 ibmtr_dev_t *info = link->priv;
326 struct net_device *dev = info->dev; 329 struct net_device *dev = info->dev;
327 330
328 DEBUG(0, "ibmtr_release(0x%p)\n", link); 331 dev_dbg(&link->dev, "ibmtr_release\n");
329 332
330 if (link->win) { 333 if (link->win) {
331 struct tok_info *ti = netdev_priv(dev); 334 struct tok_info *ti = netdev_priv(dev);
332 iounmap(ti->mmio); 335 iounmap(ti->mmio);
333 pcmcia_release_window(info->sram_win_handle); 336 pcmcia_release_window(link, info->sram_win_handle);
334 } 337 }
335 pcmcia_disable_device(link); 338 pcmcia_disable_device(link);
336} 339}
diff --git a/drivers/net/pcmcia/nmclan_cs.c b/drivers/net/pcmcia/nmclan_cs.c
index 5ed6339c52bc..dae5ef6b2609 100644
--- a/drivers/net/pcmcia/nmclan_cs.c
+++ b/drivers/net/pcmcia/nmclan_cs.c
@@ -381,13 +381,6 @@ typedef struct _mace_private {
381Private Global Variables 381Private Global Variables
382---------------------------------------------------------------------------- */ 382---------------------------------------------------------------------------- */
383 383
384#ifdef PCMCIA_DEBUG
385static char rcsid[] =
386"nmclan_cs.c,v 0.16 1995/07/01 06:42:17 rpao Exp rpao";
387static char *version =
388DRV_NAME " " DRV_VERSION " (Roger C. Pao)";
389#endif
390
391static const char *if_names[]={ 384static const char *if_names[]={
392 "Auto", "10baseT", "BNC", 385 "Auto", "10baseT", "BNC",
393}; 386};
@@ -406,12 +399,6 @@ MODULE_LICENSE("GPL");
406/* 0=auto, 1=10baseT, 2 = 10base2, default=auto */ 399/* 0=auto, 1=10baseT, 2 = 10base2, default=auto */
407INT_MODULE_PARM(if_port, 0); 400INT_MODULE_PARM(if_port, 0);
408 401
409#ifdef PCMCIA_DEBUG
410INT_MODULE_PARM(pc_debug, PCMCIA_DEBUG);
411#define DEBUG(n, args...) if (pc_debug>(n)) printk(KERN_DEBUG args)
412#else
413#define DEBUG(n, args...)
414#endif
415 402
416/* ---------------------------------------------------------------------------- 403/* ----------------------------------------------------------------------------
417Function Prototypes 404Function Prototypes
@@ -462,8 +449,7 @@ static int nmclan_probe(struct pcmcia_device *link)
462 mace_private *lp; 449 mace_private *lp;
463 struct net_device *dev; 450 struct net_device *dev;
464 451
465 DEBUG(0, "nmclan_attach()\n"); 452 dev_dbg(&link->dev, "nmclan_attach()\n");
466 DEBUG(1, "%s\n", rcsid);
467 453
468 /* Create new ethernet device */ 454 /* Create new ethernet device */
469 dev = alloc_etherdev(sizeof(mace_private)); 455 dev = alloc_etherdev(sizeof(mace_private));
@@ -477,10 +463,8 @@ static int nmclan_probe(struct pcmcia_device *link)
477 link->io.NumPorts1 = 32; 463 link->io.NumPorts1 = 32;
478 link->io.Attributes1 = IO_DATA_PATH_WIDTH_AUTO; 464 link->io.Attributes1 = IO_DATA_PATH_WIDTH_AUTO;
479 link->io.IOAddrLines = 5; 465 link->io.IOAddrLines = 5;
480 link->irq.Attributes = IRQ_TYPE_EXCLUSIVE | IRQ_HANDLE_PRESENT; 466 link->irq.Attributes = IRQ_TYPE_EXCLUSIVE;
481 link->irq.IRQInfo1 = IRQ_LEVEL_ID;
482 link->irq.Handler = &mace_interrupt; 467 link->irq.Handler = &mace_interrupt;
483 link->irq.Instance = dev;
484 link->conf.Attributes = CONF_ENABLE_IRQ; 468 link->conf.Attributes = CONF_ENABLE_IRQ;
485 link->conf.IntType = INT_MEMORY_AND_IO; 469 link->conf.IntType = INT_MEMORY_AND_IO;
486 link->conf.ConfigIndex = 1; 470 link->conf.ConfigIndex = 1;
@@ -507,7 +491,7 @@ static void nmclan_detach(struct pcmcia_device *link)
507{ 491{
508 struct net_device *dev = link->priv; 492 struct net_device *dev = link->priv;
509 493
510 DEBUG(0, "nmclan_detach(0x%p)\n", link); 494 dev_dbg(&link->dev, "nmclan_detach\n");
511 495
512 if (link->dev_node) 496 if (link->dev_node)
513 unregister_netdev(dev); 497 unregister_netdev(dev);
@@ -654,37 +638,40 @@ nmclan_config
654 ethernet device available to the system. 638 ethernet device available to the system.
655---------------------------------------------------------------------------- */ 639---------------------------------------------------------------------------- */
656 640
657#define CS_CHECK(fn, ret) \
658 do { last_fn = (fn); if ((last_ret = (ret)) != 0) goto cs_failed; } while (0)
659
660static int nmclan_config(struct pcmcia_device *link) 641static int nmclan_config(struct pcmcia_device *link)
661{ 642{
662 struct net_device *dev = link->priv; 643 struct net_device *dev = link->priv;
663 mace_private *lp = netdev_priv(dev); 644 mace_private *lp = netdev_priv(dev);
664 tuple_t tuple; 645 u8 *buf;
665 u_char buf[64]; 646 size_t len;
666 int i, last_ret, last_fn; 647 int i, ret;
667 unsigned int ioaddr; 648 unsigned int ioaddr;
668 649
669 DEBUG(0, "nmclan_config(0x%p)\n", link); 650 dev_dbg(&link->dev, "nmclan_config\n");
651
652 ret = pcmcia_request_io(link, &link->io);
653 if (ret)
654 goto failed;
655 ret = pcmcia_request_irq(link, &link->irq);
656 if (ret)
657 goto failed;
658 ret = pcmcia_request_configuration(link, &link->conf);
659 if (ret)
660 goto failed;
670 661
671 CS_CHECK(RequestIO, pcmcia_request_io(link, &link->io));
672 CS_CHECK(RequestIRQ, pcmcia_request_irq(link, &link->irq));
673 CS_CHECK(RequestConfiguration, pcmcia_request_configuration(link, &link->conf));
674 dev->irq = link->irq.AssignedIRQ; 662 dev->irq = link->irq.AssignedIRQ;
675 dev->base_addr = link->io.BasePort1; 663 dev->base_addr = link->io.BasePort1;
676 664
677 ioaddr = dev->base_addr; 665 ioaddr = dev->base_addr;
678 666
679 /* Read the ethernet address from the CIS. */ 667 /* Read the ethernet address from the CIS. */
680 tuple.DesiredTuple = 0x80 /* CISTPL_CFTABLE_ENTRY_MISC */; 668 len = pcmcia_get_tuple(link, 0x80, &buf);
681 tuple.TupleData = buf; 669 if (!buf || len < ETHER_ADDR_LEN) {
682 tuple.TupleDataMax = 64; 670 kfree(buf);
683 tuple.TupleOffset = 0; 671 goto failed;
684 tuple.Attributes = 0; 672 }
685 CS_CHECK(GetFirstTuple, pcmcia_get_first_tuple(link, &tuple)); 673 memcpy(dev->dev_addr, buf, ETHER_ADDR_LEN);
686 CS_CHECK(GetTupleData, pcmcia_get_tuple_data(link, &tuple)); 674 kfree(buf);
687 memcpy(dev->dev_addr, tuple.TupleData, ETHER_ADDR_LEN);
688 675
689 /* Verify configuration by reading the MACE ID. */ 676 /* Verify configuration by reading the MACE ID. */
690 { 677 {
@@ -693,7 +680,7 @@ static int nmclan_config(struct pcmcia_device *link)
693 sig[0] = mace_read(lp, ioaddr, MACE_CHIPIDL); 680 sig[0] = mace_read(lp, ioaddr, MACE_CHIPIDL);
694 sig[1] = mace_read(lp, ioaddr, MACE_CHIPIDH); 681 sig[1] = mace_read(lp, ioaddr, MACE_CHIPIDH);
695 if ((sig[0] == 0x40) && ((sig[1] & 0x0F) == 0x09)) { 682 if ((sig[0] == 0x40) && ((sig[1] & 0x0F) == 0x09)) {
696 DEBUG(0, "nmclan_cs configured: mace id=%x %x\n", 683 dev_dbg(&link->dev, "nmclan_cs configured: mace id=%x %x\n",
697 sig[0], sig[1]); 684 sig[0], sig[1]);
698 } else { 685 } else {
699 printk(KERN_NOTICE "nmclan_cs: mace id not found: %x %x should" 686 printk(KERN_NOTICE "nmclan_cs: mace id not found: %x %x should"
@@ -712,7 +699,7 @@ static int nmclan_config(struct pcmcia_device *link)
712 printk(KERN_NOTICE "nmclan_cs: invalid if_port requested\n"); 699 printk(KERN_NOTICE "nmclan_cs: invalid if_port requested\n");
713 700
714 link->dev_node = &lp->node; 701 link->dev_node = &lp->node;
715 SET_NETDEV_DEV(dev, &handle_to_dev(link)); 702 SET_NETDEV_DEV(dev, &link->dev);
716 703
717 i = register_netdev(dev); 704 i = register_netdev(dev);
718 if (i != 0) { 705 if (i != 0) {
@@ -729,8 +716,6 @@ static int nmclan_config(struct pcmcia_device *link)
729 dev->dev_addr); 716 dev->dev_addr);
730 return 0; 717 return 0;
731 718
732cs_failed:
733 cs_error(link, last_fn, last_ret);
734failed: 719failed:
735 nmclan_release(link); 720 nmclan_release(link);
736 return -ENODEV; 721 return -ENODEV;
@@ -744,7 +729,7 @@ nmclan_release
744---------------------------------------------------------------------------- */ 729---------------------------------------------------------------------------- */
745static void nmclan_release(struct pcmcia_device *link) 730static void nmclan_release(struct pcmcia_device *link)
746{ 731{
747 DEBUG(0, "nmclan_release(0x%p)\n", link); 732 dev_dbg(&link->dev, "nmclan_release\n");
748 pcmcia_disable_device(link); 733 pcmcia_disable_device(link);
749} 734}
750 735
@@ -795,7 +780,7 @@ static void nmclan_reset(struct net_device *dev)
795 /* Reset Xilinx */ 780 /* Reset Xilinx */
796 reg.Action = CS_WRITE; 781 reg.Action = CS_WRITE;
797 reg.Offset = CISREG_COR; 782 reg.Offset = CISREG_COR;
798 DEBUG(1, "nmclan_reset: OrigCorValue=0x%lX, resetting...\n", 783 dev_dbg(&link->dev, "nmclan_reset: OrigCorValue=0x%lX, resetting...\n",
799 OrigCorValue); 784 OrigCorValue);
800 reg.Value = COR_SOFT_RESET; 785 reg.Value = COR_SOFT_RESET;
801 pcmcia_access_configuration_register(link, &reg); 786 pcmcia_access_configuration_register(link, &reg);
@@ -872,7 +857,7 @@ static int mace_close(struct net_device *dev)
872 mace_private *lp = netdev_priv(dev); 857 mace_private *lp = netdev_priv(dev);
873 struct pcmcia_device *link = lp->p_dev; 858 struct pcmcia_device *link = lp->p_dev;
874 859
875 DEBUG(2, "%s: shutting down ethercard.\n", dev->name); 860 dev_dbg(&link->dev, "%s: shutting down ethercard.\n", dev->name);
876 861
877 /* Mask off all interrupts from the MACE chip. */ 862 /* Mask off all interrupts from the MACE chip. */
878 outb(0xFF, ioaddr + AM2150_MACE_BASE + MACE_IMR); 863 outb(0xFF, ioaddr + AM2150_MACE_BASE + MACE_IMR);
@@ -891,24 +876,8 @@ static void netdev_get_drvinfo(struct net_device *dev,
891 sprintf(info->bus_info, "PCMCIA 0x%lx", dev->base_addr); 876 sprintf(info->bus_info, "PCMCIA 0x%lx", dev->base_addr);
892} 877}
893 878
894#ifdef PCMCIA_DEBUG
895static u32 netdev_get_msglevel(struct net_device *dev)
896{
897 return pc_debug;
898}
899
900static void netdev_set_msglevel(struct net_device *dev, u32 level)
901{
902 pc_debug = level;
903}
904#endif /* PCMCIA_DEBUG */
905
906static const struct ethtool_ops netdev_ethtool_ops = { 879static const struct ethtool_ops netdev_ethtool_ops = {
907 .get_drvinfo = netdev_get_drvinfo, 880 .get_drvinfo = netdev_get_drvinfo,
908#ifdef PCMCIA_DEBUG
909 .get_msglevel = netdev_get_msglevel,
910 .set_msglevel = netdev_set_msglevel,
911#endif /* PCMCIA_DEBUG */
912}; 881};
913 882
914/* ---------------------------------------------------------------------------- 883/* ----------------------------------------------------------------------------
@@ -946,7 +915,7 @@ static netdev_tx_t mace_start_xmit(struct sk_buff *skb,
946 915
947 netif_stop_queue(dev); 916 netif_stop_queue(dev);
948 917
949 DEBUG(3, "%s: mace_start_xmit(length = %ld) called.\n", 918 pr_debug("%s: mace_start_xmit(length = %ld) called.\n",
950 dev->name, (long)skb->len); 919 dev->name, (long)skb->len);
951 920
952#if (!TX_INTERRUPTABLE) 921#if (!TX_INTERRUPTABLE)
@@ -1008,7 +977,7 @@ static irqreturn_t mace_interrupt(int irq, void *dev_id)
1008 int IntrCnt = MACE_MAX_IR_ITERATIONS; 977 int IntrCnt = MACE_MAX_IR_ITERATIONS;
1009 978
1010 if (dev == NULL) { 979 if (dev == NULL) {
1011 DEBUG(2, "mace_interrupt(): irq 0x%X for unknown device.\n", 980 pr_debug("mace_interrupt(): irq 0x%X for unknown device.\n",
1012 irq); 981 irq);
1013 return IRQ_NONE; 982 return IRQ_NONE;
1014 } 983 }
@@ -1031,7 +1000,7 @@ static irqreturn_t mace_interrupt(int irq, void *dev_id)
1031 } 1000 }
1032 1001
1033 if (!netif_device_present(dev)) { 1002 if (!netif_device_present(dev)) {
1034 DEBUG(2, "%s: interrupt from dead card\n", dev->name); 1003 pr_debug("%s: interrupt from dead card\n", dev->name);
1035 return IRQ_NONE; 1004 return IRQ_NONE;
1036 } 1005 }
1037 1006
@@ -1039,7 +1008,7 @@ static irqreturn_t mace_interrupt(int irq, void *dev_id)
1039 /* WARNING: MACE_IR is a READ/CLEAR port! */ 1008 /* WARNING: MACE_IR is a READ/CLEAR port! */
1040 status = inb(ioaddr + AM2150_MACE_BASE + MACE_IR); 1009 status = inb(ioaddr + AM2150_MACE_BASE + MACE_IR);
1041 1010
1042 DEBUG(3, "mace_interrupt: irq 0x%X status 0x%X.\n", irq, status); 1011 pr_debug("mace_interrupt: irq 0x%X status 0x%X.\n", irq, status);
1043 1012
1044 if (status & MACE_IR_RCVINT) { 1013 if (status & MACE_IR_RCVINT) {
1045 mace_rx(dev, MACE_MAX_RX_ITERATIONS); 1014 mace_rx(dev, MACE_MAX_RX_ITERATIONS);
@@ -1158,7 +1127,7 @@ static int mace_rx(struct net_device *dev, unsigned char RxCnt)
1158 ) { 1127 ) {
1159 rx_status = inw(ioaddr + AM2150_RCV); 1128 rx_status = inw(ioaddr + AM2150_RCV);
1160 1129
1161 DEBUG(3, "%s: in mace_rx(), framecnt 0x%X, rx_status" 1130 pr_debug("%s: in mace_rx(), framecnt 0x%X, rx_status"
1162 " 0x%X.\n", dev->name, rx_framecnt, rx_status); 1131 " 0x%X.\n", dev->name, rx_framecnt, rx_status);
1163 1132
1164 if (rx_status & MACE_RCVFS_RCVSTS) { /* Error, update stats. */ 1133 if (rx_status & MACE_RCVFS_RCVSTS) { /* Error, update stats. */
@@ -1185,7 +1154,7 @@ static int mace_rx(struct net_device *dev, unsigned char RxCnt)
1185 lp->mace_stats.rfs_rcvcc += inb(ioaddr + AM2150_RCV); 1154 lp->mace_stats.rfs_rcvcc += inb(ioaddr + AM2150_RCV);
1186 /* rcv collision count */ 1155 /* rcv collision count */
1187 1156
1188 DEBUG(3, " receiving packet size 0x%X rx_status" 1157 pr_debug(" receiving packet size 0x%X rx_status"
1189 " 0x%X.\n", pkt_len, rx_status); 1158 " 0x%X.\n", pkt_len, rx_status);
1190 1159
1191 skb = dev_alloc_skb(pkt_len+2); 1160 skb = dev_alloc_skb(pkt_len+2);
@@ -1204,7 +1173,7 @@ static int mace_rx(struct net_device *dev, unsigned char RxCnt)
1204 outb(0xFF, ioaddr + AM2150_RCV_NEXT); /* skip to next frame */ 1173 outb(0xFF, ioaddr + AM2150_RCV_NEXT); /* skip to next frame */
1205 continue; 1174 continue;
1206 } else { 1175 } else {
1207 DEBUG(1, "%s: couldn't allocate a sk_buff of size" 1176 pr_debug("%s: couldn't allocate a sk_buff of size"
1208 " %d.\n", dev->name, pkt_len); 1177 " %d.\n", dev->name, pkt_len);
1209 lp->linux_stats.rx_dropped++; 1178 lp->linux_stats.rx_dropped++;
1210 } 1179 }
@@ -1220,28 +1189,28 @@ pr_linux_stats
1220---------------------------------------------------------------------------- */ 1189---------------------------------------------------------------------------- */
1221static void pr_linux_stats(struct net_device_stats *pstats) 1190static void pr_linux_stats(struct net_device_stats *pstats)
1222{ 1191{
1223 DEBUG(2, "pr_linux_stats\n"); 1192 pr_debug("pr_linux_stats\n");
1224 DEBUG(2, " rx_packets=%-7ld tx_packets=%ld\n", 1193 pr_debug(" rx_packets=%-7ld tx_packets=%ld\n",
1225 (long)pstats->rx_packets, (long)pstats->tx_packets); 1194 (long)pstats->rx_packets, (long)pstats->tx_packets);
1226 DEBUG(2, " rx_errors=%-7ld tx_errors=%ld\n", 1195 pr_debug(" rx_errors=%-7ld tx_errors=%ld\n",
1227 (long)pstats->rx_errors, (long)pstats->tx_errors); 1196 (long)pstats->rx_errors, (long)pstats->tx_errors);
1228 DEBUG(2, " rx_dropped=%-7ld tx_dropped=%ld\n", 1197 pr_debug(" rx_dropped=%-7ld tx_dropped=%ld\n",
1229 (long)pstats->rx_dropped, (long)pstats->tx_dropped); 1198 (long)pstats->rx_dropped, (long)pstats->tx_dropped);
1230 DEBUG(2, " multicast=%-7ld collisions=%ld\n", 1199 pr_debug(" multicast=%-7ld collisions=%ld\n",
1231 (long)pstats->multicast, (long)pstats->collisions); 1200 (long)pstats->multicast, (long)pstats->collisions);
1232 1201
1233 DEBUG(2, " rx_length_errors=%-7ld rx_over_errors=%ld\n", 1202 pr_debug(" rx_length_errors=%-7ld rx_over_errors=%ld\n",
1234 (long)pstats->rx_length_errors, (long)pstats->rx_over_errors); 1203 (long)pstats->rx_length_errors, (long)pstats->rx_over_errors);
1235 DEBUG(2, " rx_crc_errors=%-7ld rx_frame_errors=%ld\n", 1204 pr_debug(" rx_crc_errors=%-7ld rx_frame_errors=%ld\n",
1236 (long)pstats->rx_crc_errors, (long)pstats->rx_frame_errors); 1205 (long)pstats->rx_crc_errors, (long)pstats->rx_frame_errors);
1237 DEBUG(2, " rx_fifo_errors=%-7ld rx_missed_errors=%ld\n", 1206 pr_debug(" rx_fifo_errors=%-7ld rx_missed_errors=%ld\n",
1238 (long)pstats->rx_fifo_errors, (long)pstats->rx_missed_errors); 1207 (long)pstats->rx_fifo_errors, (long)pstats->rx_missed_errors);
1239 1208
1240 DEBUG(2, " tx_aborted_errors=%-7ld tx_carrier_errors=%ld\n", 1209 pr_debug(" tx_aborted_errors=%-7ld tx_carrier_errors=%ld\n",
1241 (long)pstats->tx_aborted_errors, (long)pstats->tx_carrier_errors); 1210 (long)pstats->tx_aborted_errors, (long)pstats->tx_carrier_errors);
1242 DEBUG(2, " tx_fifo_errors=%-7ld tx_heartbeat_errors=%ld\n", 1211 pr_debug(" tx_fifo_errors=%-7ld tx_heartbeat_errors=%ld\n",
1243 (long)pstats->tx_fifo_errors, (long)pstats->tx_heartbeat_errors); 1212 (long)pstats->tx_fifo_errors, (long)pstats->tx_heartbeat_errors);
1244 DEBUG(2, " tx_window_errors=%ld\n", 1213 pr_debug(" tx_window_errors=%ld\n",
1245 (long)pstats->tx_window_errors); 1214 (long)pstats->tx_window_errors);
1246} /* pr_linux_stats */ 1215} /* pr_linux_stats */
1247 1216
@@ -1250,48 +1219,48 @@ pr_mace_stats
1250---------------------------------------------------------------------------- */ 1219---------------------------------------------------------------------------- */
1251static void pr_mace_stats(mace_statistics *pstats) 1220static void pr_mace_stats(mace_statistics *pstats)
1252{ 1221{
1253 DEBUG(2, "pr_mace_stats\n"); 1222 pr_debug("pr_mace_stats\n");
1254 1223
1255 DEBUG(2, " xmtsv=%-7d uflo=%d\n", 1224 pr_debug(" xmtsv=%-7d uflo=%d\n",
1256 pstats->xmtsv, pstats->uflo); 1225 pstats->xmtsv, pstats->uflo);
1257 DEBUG(2, " lcol=%-7d more=%d\n", 1226 pr_debug(" lcol=%-7d more=%d\n",
1258 pstats->lcol, pstats->more); 1227 pstats->lcol, pstats->more);
1259 DEBUG(2, " one=%-7d defer=%d\n", 1228 pr_debug(" one=%-7d defer=%d\n",
1260 pstats->one, pstats->defer); 1229 pstats->one, pstats->defer);
1261 DEBUG(2, " lcar=%-7d rtry=%d\n", 1230 pr_debug(" lcar=%-7d rtry=%d\n",
1262 pstats->lcar, pstats->rtry); 1231 pstats->lcar, pstats->rtry);
1263 1232
1264 /* MACE_XMTRC */ 1233 /* MACE_XMTRC */
1265 DEBUG(2, " exdef=%-7d xmtrc=%d\n", 1234 pr_debug(" exdef=%-7d xmtrc=%d\n",
1266 pstats->exdef, pstats->xmtrc); 1235 pstats->exdef, pstats->xmtrc);
1267 1236
1268 /* RFS1--Receive Status (RCVSTS) */ 1237 /* RFS1--Receive Status (RCVSTS) */
1269 DEBUG(2, " oflo=%-7d clsn=%d\n", 1238 pr_debug(" oflo=%-7d clsn=%d\n",
1270 pstats->oflo, pstats->clsn); 1239 pstats->oflo, pstats->clsn);
1271 DEBUG(2, " fram=%-7d fcs=%d\n", 1240 pr_debug(" fram=%-7d fcs=%d\n",
1272 pstats->fram, pstats->fcs); 1241 pstats->fram, pstats->fcs);
1273 1242
1274 /* RFS2--Runt Packet Count (RNTPC) */ 1243 /* RFS2--Runt Packet Count (RNTPC) */
1275 /* RFS3--Receive Collision Count (RCVCC) */ 1244 /* RFS3--Receive Collision Count (RCVCC) */
1276 DEBUG(2, " rfs_rntpc=%-7d rfs_rcvcc=%d\n", 1245 pr_debug(" rfs_rntpc=%-7d rfs_rcvcc=%d\n",
1277 pstats->rfs_rntpc, pstats->rfs_rcvcc); 1246 pstats->rfs_rntpc, pstats->rfs_rcvcc);
1278 1247
1279 /* MACE_IR */ 1248 /* MACE_IR */
1280 DEBUG(2, " jab=%-7d babl=%d\n", 1249 pr_debug(" jab=%-7d babl=%d\n",
1281 pstats->jab, pstats->babl); 1250 pstats->jab, pstats->babl);
1282 DEBUG(2, " cerr=%-7d rcvcco=%d\n", 1251 pr_debug(" cerr=%-7d rcvcco=%d\n",
1283 pstats->cerr, pstats->rcvcco); 1252 pstats->cerr, pstats->rcvcco);
1284 DEBUG(2, " rntpco=%-7d mpco=%d\n", 1253 pr_debug(" rntpco=%-7d mpco=%d\n",
1285 pstats->rntpco, pstats->mpco); 1254 pstats->rntpco, pstats->mpco);
1286 1255
1287 /* MACE_MPC */ 1256 /* MACE_MPC */
1288 DEBUG(2, " mpc=%d\n", pstats->mpc); 1257 pr_debug(" mpc=%d\n", pstats->mpc);
1289 1258
1290 /* MACE_RNTPC */ 1259 /* MACE_RNTPC */
1291 DEBUG(2, " rntpc=%d\n", pstats->rntpc); 1260 pr_debug(" rntpc=%d\n", pstats->rntpc);
1292 1261
1293 /* MACE_RCVCC */ 1262 /* MACE_RCVCC */
1294 DEBUG(2, " rcvcc=%d\n", pstats->rcvcc); 1263 pr_debug(" rcvcc=%d\n", pstats->rcvcc);
1295 1264
1296} /* pr_mace_stats */ 1265} /* pr_mace_stats */
1297 1266
@@ -1360,7 +1329,7 @@ static struct net_device_stats *mace_get_stats(struct net_device *dev)
1360 1329
1361 update_stats(dev->base_addr, dev); 1330 update_stats(dev->base_addr, dev);
1362 1331
1363 DEBUG(1, "%s: updating the statistics.\n", dev->name); 1332 pr_debug("%s: updating the statistics.\n", dev->name);
1364 pr_linux_stats(&lp->linux_stats); 1333 pr_linux_stats(&lp->linux_stats);
1365 pr_mace_stats(&lp->mace_stats); 1334 pr_mace_stats(&lp->mace_stats);
1366 1335
@@ -1427,7 +1396,7 @@ static void BuildLAF(int *ladrf, int *adr)
1427 ladrf[byte] |= (1 << (hashcode & 7)); 1396 ladrf[byte] |= (1 << (hashcode & 7));
1428 1397
1429#ifdef PCMCIA_DEBUG 1398#ifdef PCMCIA_DEBUG
1430 if (pc_debug > 2) 1399 if (0)
1431 printk(KERN_DEBUG " adr =%pM\n", adr); 1400 printk(KERN_DEBUG " adr =%pM\n", adr);
1432 printk(KERN_DEBUG " hashcode = %d(decimal), ladrf[0:63] =", hashcode); 1401 printk(KERN_DEBUG " hashcode = %d(decimal), ladrf[0:63] =", hashcode);
1433 for (i = 0; i < 8; i++) 1402 for (i = 0; i < 8; i++)
@@ -1454,12 +1423,12 @@ static void restore_multicast_list(struct net_device *dev)
1454 unsigned int ioaddr = dev->base_addr; 1423 unsigned int ioaddr = dev->base_addr;
1455 int i; 1424 int i;
1456 1425
1457 DEBUG(2, "%s: restoring Rx mode to %d addresses.\n", 1426 pr_debug("%s: restoring Rx mode to %d addresses.\n",
1458 dev->name, num_addrs); 1427 dev->name, num_addrs);
1459 1428
1460 if (num_addrs > 0) { 1429 if (num_addrs > 0) {
1461 1430
1462 DEBUG(1, "Attempt to restore multicast list detected.\n"); 1431 pr_debug("Attempt to restore multicast list detected.\n");
1463 1432
1464 mace_write(lp, ioaddr, MACE_IAC, MACE_IAC_ADDRCHG | MACE_IAC_LOGADDR); 1433 mace_write(lp, ioaddr, MACE_IAC, MACE_IAC_ADDRCHG | MACE_IAC_LOGADDR);
1465 /* Poll ADDRCHG bit */ 1434 /* Poll ADDRCHG bit */
@@ -1511,11 +1480,11 @@ static void set_multicast_list(struct net_device *dev)
1511 struct dev_mc_list *dmi = dev->mc_list; 1480 struct dev_mc_list *dmi = dev->mc_list;
1512 1481
1513#ifdef PCMCIA_DEBUG 1482#ifdef PCMCIA_DEBUG
1514 if (pc_debug > 1) { 1483 {
1515 static int old; 1484 static int old;
1516 if (dev->mc_count != old) { 1485 if (dev->mc_count != old) {
1517 old = dev->mc_count; 1486 old = dev->mc_count;
1518 DEBUG(0, "%s: setting Rx mode to %d addresses.\n", 1487 pr_debug("%s: setting Rx mode to %d addresses.\n",
1519 dev->name, old); 1488 dev->name, old);
1520 } 1489 }
1521 } 1490 }
@@ -1546,7 +1515,7 @@ static void restore_multicast_list(struct net_device *dev)
1546 unsigned int ioaddr = dev->base_addr; 1515 unsigned int ioaddr = dev->base_addr;
1547 mace_private *lp = netdev_priv(dev); 1516 mace_private *lp = netdev_priv(dev);
1548 1517
1549 DEBUG(2, "%s: restoring Rx mode to %d addresses.\n", dev->name, 1518 pr_debug("%s: restoring Rx mode to %d addresses.\n", dev->name,
1550 lp->multicast_num_addrs); 1519 lp->multicast_num_addrs);
1551 1520
1552 if (dev->flags & IFF_PROMISC) { 1521 if (dev->flags & IFF_PROMISC) {
@@ -1567,11 +1536,11 @@ static void set_multicast_list(struct net_device *dev)
1567 mace_private *lp = netdev_priv(dev); 1536 mace_private *lp = netdev_priv(dev);
1568 1537
1569#ifdef PCMCIA_DEBUG 1538#ifdef PCMCIA_DEBUG
1570 if (pc_debug > 1) { 1539 {
1571 static int old; 1540 static int old;
1572 if (dev->mc_count != old) { 1541 if (dev->mc_count != old) {
1573 old = dev->mc_count; 1542 old = dev->mc_count;
1574 DEBUG(0, "%s: setting Rx mode to %d addresses.\n", 1543 pr_debug("%s: setting Rx mode to %d addresses.\n",
1575 dev->name, old); 1544 dev->name, old);
1576 } 1545 }
1577 } 1546 }
diff --git a/drivers/net/pcmcia/pcnet_cs.c b/drivers/net/pcmcia/pcnet_cs.c
index bd3447f04902..cbe462ed221f 100644
--- a/drivers/net/pcmcia/pcnet_cs.c
+++ b/drivers/net/pcmcia/pcnet_cs.c
@@ -71,15 +71,6 @@
71 71
72static const char *if_names[] = { "auto", "10baseT", "10base2"}; 72static const char *if_names[] = { "auto", "10baseT", "10base2"};
73 73
74#ifdef PCMCIA_DEBUG
75static int pc_debug = PCMCIA_DEBUG;
76module_param(pc_debug, int, 0);
77#define DEBUG(n, args...) if (pc_debug>(n)) printk(KERN_DEBUG args)
78static char *version =
79"pcnet_cs.c 1.153 2003/11/09 18:53:09 (David Hinds)";
80#else
81#define DEBUG(n, args...)
82#endif
83 74
84/*====================================================================*/ 75/*====================================================================*/
85 76
@@ -265,7 +256,7 @@ static int pcnet_probe(struct pcmcia_device *link)
265 pcnet_dev_t *info; 256 pcnet_dev_t *info;
266 struct net_device *dev; 257 struct net_device *dev;
267 258
268 DEBUG(0, "pcnet_attach()\n"); 259 dev_dbg(&link->dev, "pcnet_attach()\n");
269 260
270 /* Create new ethernet device */ 261 /* Create new ethernet device */
271 dev = __alloc_ei_netdev(sizeof(pcnet_dev_t)); 262 dev = __alloc_ei_netdev(sizeof(pcnet_dev_t));
@@ -275,7 +266,6 @@ static int pcnet_probe(struct pcmcia_device *link)
275 link->priv = dev; 266 link->priv = dev;
276 267
277 link->irq.Attributes = IRQ_TYPE_DYNAMIC_SHARING; 268 link->irq.Attributes = IRQ_TYPE_DYNAMIC_SHARING;
278 link->irq.IRQInfo1 = IRQ_LEVEL_ID;
279 link->conf.Attributes = CONF_ENABLE_IRQ; 269 link->conf.Attributes = CONF_ENABLE_IRQ;
280 link->conf.IntType = INT_MEMORY_AND_IO; 270 link->conf.IntType = INT_MEMORY_AND_IO;
281 271
@@ -297,7 +287,7 @@ static void pcnet_detach(struct pcmcia_device *link)
297{ 287{
298 struct net_device *dev = link->priv; 288 struct net_device *dev = link->priv;
299 289
300 DEBUG(0, "pcnet_detach(0x%p)\n", link); 290 dev_dbg(&link->dev, "pcnet_detach\n");
301 291
302 if (link->dev_node) 292 if (link->dev_node)
303 unregister_netdev(dev); 293 unregister_netdev(dev);
@@ -326,17 +316,15 @@ static hw_info_t *get_hwinfo(struct pcmcia_device *link)
326 req.Attributes = WIN_DATA_WIDTH_8|WIN_MEMORY_TYPE_AM|WIN_ENABLE; 316 req.Attributes = WIN_DATA_WIDTH_8|WIN_MEMORY_TYPE_AM|WIN_ENABLE;
327 req.Base = 0; req.Size = 0; 317 req.Base = 0; req.Size = 0;
328 req.AccessSpeed = 0; 318 req.AccessSpeed = 0;
329 i = pcmcia_request_window(&link, &req, &link->win); 319 i = pcmcia_request_window(link, &req, &link->win);
330 if (i != 0) { 320 if (i != 0)
331 cs_error(link, RequestWindow, i);
332 return NULL; 321 return NULL;
333 }
334 322
335 virt = ioremap(req.Base, req.Size); 323 virt = ioremap(req.Base, req.Size);
336 mem.Page = 0; 324 mem.Page = 0;
337 for (i = 0; i < NR_INFO; i++) { 325 for (i = 0; i < NR_INFO; i++) {
338 mem.CardOffset = hw_info[i].offset & ~(req.Size-1); 326 mem.CardOffset = hw_info[i].offset & ~(req.Size-1);
339 pcmcia_map_mem_page(link->win, &mem); 327 pcmcia_map_mem_page(link, link->win, &mem);
340 base = &virt[hw_info[i].offset & (req.Size-1)]; 328 base = &virt[hw_info[i].offset & (req.Size-1)];
341 if ((readb(base+0) == hw_info[i].a0) && 329 if ((readb(base+0) == hw_info[i].a0) &&
342 (readb(base+2) == hw_info[i].a1) && 330 (readb(base+2) == hw_info[i].a1) &&
@@ -348,9 +336,7 @@ static hw_info_t *get_hwinfo(struct pcmcia_device *link)
348 } 336 }
349 337
350 iounmap(virt); 338 iounmap(virt);
351 j = pcmcia_release_window(link->win); 339 j = pcmcia_release_window(link, link->win);
352 if (j != 0)
353 cs_error(link, ReleaseWindow, j);
354 return (i < NR_INFO) ? hw_info+i : NULL; 340 return (i < NR_INFO) ? hw_info+i : NULL;
355} /* get_hwinfo */ 341} /* get_hwinfo */
356 342
@@ -495,9 +481,6 @@ static hw_info_t *get_hwired(struct pcmcia_device *link)
495 481
496======================================================================*/ 482======================================================================*/
497 483
498#define CS_CHECK(fn, ret) \
499do { last_fn = (fn); if ((last_ret = (ret)) != 0) goto cs_failed; } while (0)
500
501static int try_io_port(struct pcmcia_device *link) 484static int try_io_port(struct pcmcia_device *link)
502{ 485{
503 int j, ret; 486 int j, ret;
@@ -567,19 +550,19 @@ static int pcnet_config(struct pcmcia_device *link)
567{ 550{
568 struct net_device *dev = link->priv; 551 struct net_device *dev = link->priv;
569 pcnet_dev_t *info = PRIV(dev); 552 pcnet_dev_t *info = PRIV(dev);
570 int last_ret, last_fn, start_pg, stop_pg, cm_offset; 553 int ret, start_pg, stop_pg, cm_offset;
571 int has_shmem = 0; 554 int has_shmem = 0;
572 hw_info_t *local_hw_info; 555 hw_info_t *local_hw_info;
573 556
574 DEBUG(0, "pcnet_config(0x%p)\n", link); 557 dev_dbg(&link->dev, "pcnet_config\n");
575 558
576 last_ret = pcmcia_loop_config(link, pcnet_confcheck, &has_shmem); 559 ret = pcmcia_loop_config(link, pcnet_confcheck, &has_shmem);
577 if (last_ret) { 560 if (ret)
578 cs_error(link, RequestIO, last_ret);
579 goto failed; 561 goto failed;
580 }
581 562
582 CS_CHECK(RequestIRQ, pcmcia_request_irq(link, &link->irq)); 563 ret = pcmcia_request_irq(link, &link->irq);
564 if (ret)
565 goto failed;
583 566
584 if (link->io.NumPorts2 == 8) { 567 if (link->io.NumPorts2 == 8) {
585 link->conf.Attributes |= CONF_ENABLE_SPKR; 568 link->conf.Attributes |= CONF_ENABLE_SPKR;
@@ -589,7 +572,9 @@ static int pcnet_config(struct pcmcia_device *link)
589 (link->card_id == PRODID_IBM_HOME_AND_AWAY)) 572 (link->card_id == PRODID_IBM_HOME_AND_AWAY))
590 link->conf.ConfigIndex |= 0x10; 573 link->conf.ConfigIndex |= 0x10;
591 574
592 CS_CHECK(RequestConfiguration, pcmcia_request_configuration(link, &link->conf)); 575 ret = pcmcia_request_configuration(link, &link->conf);
576 if (ret)
577 goto failed;
593 dev->irq = link->irq.AssignedIRQ; 578 dev->irq = link->irq.AssignedIRQ;
594 dev->base_addr = link->io.BasePort1; 579 dev->base_addr = link->io.BasePort1;
595 if (info->flags & HAS_MISC_REG) { 580 if (info->flags & HAS_MISC_REG) {
@@ -660,7 +645,7 @@ static int pcnet_config(struct pcmcia_device *link)
660 mii_phy_probe(dev); 645 mii_phy_probe(dev);
661 646
662 link->dev_node = &info->node; 647 link->dev_node = &info->node;
663 SET_NETDEV_DEV(dev, &handle_to_dev(link)); 648 SET_NETDEV_DEV(dev, &link->dev);
664 649
665 if (register_netdev(dev) != 0) { 650 if (register_netdev(dev) != 0) {
666 printk(KERN_NOTICE "pcnet_cs: register_netdev() failed\n"); 651 printk(KERN_NOTICE "pcnet_cs: register_netdev() failed\n");
@@ -687,8 +672,6 @@ static int pcnet_config(struct pcmcia_device *link)
687 printk(" hw_addr %pM\n", dev->dev_addr); 672 printk(" hw_addr %pM\n", dev->dev_addr);
688 return 0; 673 return 0;
689 674
690cs_failed:
691 cs_error(link, last_fn, last_ret);
692failed: 675failed:
693 pcnet_release(link); 676 pcnet_release(link);
694 return -ENODEV; 677 return -ENODEV;
@@ -706,7 +689,7 @@ static void pcnet_release(struct pcmcia_device *link)
706{ 689{
707 pcnet_dev_t *info = PRIV(link->priv); 690 pcnet_dev_t *info = PRIV(link->priv);
708 691
709 DEBUG(0, "pcnet_release(0x%p)\n", link); 692 dev_dbg(&link->dev, "pcnet_release\n");
710 693
711 if (info->flags & USE_SHMEM) 694 if (info->flags & USE_SHMEM)
712 iounmap(info->base); 695 iounmap(info->base);
@@ -960,7 +943,7 @@ static void mii_phy_probe(struct net_device *dev)
960 phyid = tmp << 16; 943 phyid = tmp << 16;
961 phyid |= mdio_read(mii_addr, i, MII_PHYID_REG2); 944 phyid |= mdio_read(mii_addr, i, MII_PHYID_REG2);
962 phyid &= MII_PHYID_REV_MASK; 945 phyid &= MII_PHYID_REV_MASK;
963 DEBUG(0, "%s: MII at %d is 0x%08x\n", dev->name, i, phyid); 946 pr_debug("%s: MII at %d is 0x%08x\n", dev->name, i, phyid);
964 if (phyid == AM79C9XX_HOME_PHY) { 947 if (phyid == AM79C9XX_HOME_PHY) {
965 info->pna_phy = i; 948 info->pna_phy = i;
966 } else if (phyid != AM79C9XX_ETH_PHY) { 949 } else if (phyid != AM79C9XX_ETH_PHY) {
@@ -976,7 +959,7 @@ static int pcnet_open(struct net_device *dev)
976 struct pcmcia_device *link = info->p_dev; 959 struct pcmcia_device *link = info->p_dev;
977 unsigned int nic_base = dev->base_addr; 960 unsigned int nic_base = dev->base_addr;
978 961
979 DEBUG(2, "pcnet_open('%s')\n", dev->name); 962 dev_dbg(&link->dev, "pcnet_open('%s')\n", dev->name);
980 963
981 if (!pcmcia_dev_present(link)) 964 if (!pcmcia_dev_present(link))
982 return -ENODEV; 965 return -ENODEV;
@@ -1008,7 +991,7 @@ static int pcnet_close(struct net_device *dev)
1008 pcnet_dev_t *info = PRIV(dev); 991 pcnet_dev_t *info = PRIV(dev);
1009 struct pcmcia_device *link = info->p_dev; 992 struct pcmcia_device *link = info->p_dev;
1010 993
1011 DEBUG(2, "pcnet_close('%s')\n", dev->name); 994 dev_dbg(&link->dev, "pcnet_close('%s')\n", dev->name);
1012 995
1013 ei_close(dev); 996 ei_close(dev);
1014 free_irq(dev->irq, dev); 997 free_irq(dev->irq, dev);
@@ -1251,10 +1234,8 @@ static void dma_block_input(struct net_device *dev, int count,
1251 int xfer_count = count; 1234 int xfer_count = count;
1252 char *buf = skb->data; 1235 char *buf = skb->data;
1253 1236
1254#ifdef PCMCIA_DEBUG
1255 if ((ei_debug > 4) && (count != 4)) 1237 if ((ei_debug > 4) && (count != 4))
1256 printk(KERN_DEBUG "%s: [bi=%d]\n", dev->name, count+4); 1238 pr_debug("%s: [bi=%d]\n", dev->name, count+4);
1257#endif
1258 if (ei_status.dmaing) { 1239 if (ei_status.dmaing) {
1259 printk(KERN_NOTICE "%s: DMAing conflict in dma_block_input." 1240 printk(KERN_NOTICE "%s: DMAing conflict in dma_block_input."
1260 "[DMAstat:%1x][irqlock:%1x]\n", 1241 "[DMAstat:%1x][irqlock:%1x]\n",
@@ -1495,7 +1476,7 @@ static int setup_shmem_window(struct pcmcia_device *link, int start_pg,
1495 pcnet_dev_t *info = PRIV(dev); 1476 pcnet_dev_t *info = PRIV(dev);
1496 win_req_t req; 1477 win_req_t req;
1497 memreq_t mem; 1478 memreq_t mem;
1498 int i, window_size, offset, last_ret, last_fn; 1479 int i, window_size, offset, ret;
1499 1480
1500 window_size = (stop_pg - start_pg) << 8; 1481 window_size = (stop_pg - start_pg) << 8;
1501 if (window_size > 32 * 1024) 1482 if (window_size > 32 * 1024)
@@ -1509,13 +1490,17 @@ static int setup_shmem_window(struct pcmcia_device *link, int start_pg,
1509 req.Attributes |= WIN_USE_WAIT; 1490 req.Attributes |= WIN_USE_WAIT;
1510 req.Base = 0; req.Size = window_size; 1491 req.Base = 0; req.Size = window_size;
1511 req.AccessSpeed = mem_speed; 1492 req.AccessSpeed = mem_speed;
1512 CS_CHECK(RequestWindow, pcmcia_request_window(&link, &req, &link->win)); 1493 ret = pcmcia_request_window(link, &req, &link->win);
1494 if (ret)
1495 goto failed;
1513 1496
1514 mem.CardOffset = (start_pg << 8) + cm_offset; 1497 mem.CardOffset = (start_pg << 8) + cm_offset;
1515 offset = mem.CardOffset % window_size; 1498 offset = mem.CardOffset % window_size;
1516 mem.CardOffset -= offset; 1499 mem.CardOffset -= offset;
1517 mem.Page = 0; 1500 mem.Page = 0;
1518 CS_CHECK(MapMemPage, pcmcia_map_mem_page(link->win, &mem)); 1501 ret = pcmcia_map_mem_page(link, link->win, &mem);
1502 if (ret)
1503 goto failed;
1519 1504
1520 /* Try scribbling on the buffer */ 1505 /* Try scribbling on the buffer */
1521 info->base = ioremap(req.Base, window_size); 1506 info->base = ioremap(req.Base, window_size);
@@ -1527,8 +1512,8 @@ static int setup_shmem_window(struct pcmcia_device *link, int start_pg,
1527 pcnet_reset_8390(dev); 1512 pcnet_reset_8390(dev);
1528 if (i != (TX_PAGES<<8)) { 1513 if (i != (TX_PAGES<<8)) {
1529 iounmap(info->base); 1514 iounmap(info->base);
1530 pcmcia_release_window(link->win); 1515 pcmcia_release_window(link, link->win);
1531 info->base = NULL; link->win = NULL; 1516 info->base = NULL; link->win = 0;
1532 goto failed; 1517 goto failed;
1533 } 1518 }
1534 1519
@@ -1549,8 +1534,6 @@ static int setup_shmem_window(struct pcmcia_device *link, int start_pg,
1549 info->flags |= USE_SHMEM; 1534 info->flags |= USE_SHMEM;
1550 return 0; 1535 return 0;
1551 1536
1552cs_failed:
1553 cs_error(link, last_fn, last_ret);
1554failed: 1537failed:
1555 return 1; 1538 return 1;
1556} 1539}
@@ -1760,7 +1743,7 @@ static struct pcmcia_device_id pcnet_ids[] = {
1760 PCMCIA_DEVICE_CIS_MANF_CARD(0xc00f, 0x0002, "cis/LA-PCM.cis"), 1743 PCMCIA_DEVICE_CIS_MANF_CARD(0xc00f, 0x0002, "cis/LA-PCM.cis"),
1761 PCMCIA_DEVICE_CIS_PROD_ID12("KTI", "PE520 PLUS", 0xad180345, 0x9d58d392, "PE520.cis"), 1744 PCMCIA_DEVICE_CIS_PROD_ID12("KTI", "PE520 PLUS", 0xad180345, 0x9d58d392, "PE520.cis"),
1762 PCMCIA_DEVICE_CIS_PROD_ID12("NDC", "Ethernet", 0x01c43ae1, 0x00b2e941, "cis/NE2K.cis"), 1745 PCMCIA_DEVICE_CIS_PROD_ID12("NDC", "Ethernet", 0x01c43ae1, 0x00b2e941, "cis/NE2K.cis"),
1763 PCMCIA_DEVICE_CIS_PROD_ID12("PMX ", "PE-200", 0x34f3f1c8, 0x10b59f8c, "PE-200.cis"), 1746 PCMCIA_DEVICE_CIS_PROD_ID12("PMX ", "PE-200", 0x34f3f1c8, 0x10b59f8c, "cis/PE-200.cis"),
1764 PCMCIA_DEVICE_CIS_PROD_ID12("TAMARACK", "Ethernet", 0xcf434fba, 0x00b2e941, "cis/tamarack.cis"), 1747 PCMCIA_DEVICE_CIS_PROD_ID12("TAMARACK", "Ethernet", 0xcf434fba, 0x00b2e941, "cis/tamarack.cis"),
1765 PCMCIA_DEVICE_PROD_ID12("Ethernet", "CF Size PC Card", 0x00b2e941, 0x43ac239b), 1748 PCMCIA_DEVICE_PROD_ID12("Ethernet", "CF Size PC Card", 0x00b2e941, 0x43ac239b),
1766 PCMCIA_DEVICE_PROD_ID123("Fast Ethernet", "CF Size PC Card", "1.0", 1749 PCMCIA_DEVICE_PROD_ID123("Fast Ethernet", "CF Size PC Card", "1.0",
@@ -1788,7 +1771,6 @@ static int __init init_pcnet_cs(void)
1788 1771
1789static void __exit exit_pcnet_cs(void) 1772static void __exit exit_pcnet_cs(void)
1790{ 1773{
1791 DEBUG(0, "pcnet_cs: unloading\n");
1792 pcmcia_unregister_driver(&pcnet_driver); 1774 pcmcia_unregister_driver(&pcnet_driver);
1793} 1775}
1794 1776
diff --git a/drivers/net/pcmcia/smc91c92_cs.c b/drivers/net/pcmcia/smc91c92_cs.c
index 7bde2cd34c7e..9e0da370912e 100644
--- a/drivers/net/pcmcia/smc91c92_cs.c
+++ b/drivers/net/pcmcia/smc91c92_cs.c
@@ -79,14 +79,6 @@ MODULE_FIRMWARE(FIRMWARE_NAME);
79*/ 79*/
80INT_MODULE_PARM(if_port, 0); 80INT_MODULE_PARM(if_port, 0);
81 81
82#ifdef PCMCIA_DEBUG
83INT_MODULE_PARM(pc_debug, PCMCIA_DEBUG);
84static const char *version =
85"smc91c92_cs.c 1.123 2006/11/09 Donald Becker, becker@scyld.com.\n";
86#define DEBUG(n, args...) if (pc_debug>(n)) printk(KERN_DEBUG args)
87#else
88#define DEBUG(n, args...)
89#endif
90 82
91#define DRV_NAME "smc91c92_cs" 83#define DRV_NAME "smc91c92_cs"
92#define DRV_VERSION "1.123" 84#define DRV_VERSION "1.123"
@@ -126,12 +118,6 @@ struct smc_private {
126 int rx_ovrn; 118 int rx_ovrn;
127}; 119};
128 120
129struct smc_cfg_mem {
130 tuple_t tuple;
131 cisparse_t parse;
132 u_char buf[255];
133};
134
135/* Special definitions for Megahertz multifunction cards */ 121/* Special definitions for Megahertz multifunction cards */
136#define MEGAHERTZ_ISR 0x0380 122#define MEGAHERTZ_ISR 0x0380
137 123
@@ -329,7 +315,7 @@ static int smc91c92_probe(struct pcmcia_device *link)
329 struct smc_private *smc; 315 struct smc_private *smc;
330 struct net_device *dev; 316 struct net_device *dev;
331 317
332 DEBUG(0, "smc91c92_attach()\n"); 318 dev_dbg(&link->dev, "smc91c92_attach()\n");
333 319
334 /* Create new ethernet device */ 320 /* Create new ethernet device */
335 dev = alloc_etherdev(sizeof(struct smc_private)); 321 dev = alloc_etherdev(sizeof(struct smc_private));
@@ -343,10 +329,8 @@ static int smc91c92_probe(struct pcmcia_device *link)
343 link->io.NumPorts1 = 16; 329 link->io.NumPorts1 = 16;
344 link->io.Attributes1 = IO_DATA_PATH_WIDTH_AUTO; 330 link->io.Attributes1 = IO_DATA_PATH_WIDTH_AUTO;
345 link->io.IOAddrLines = 4; 331 link->io.IOAddrLines = 4;
346 link->irq.Attributes = IRQ_TYPE_DYNAMIC_SHARING|IRQ_HANDLE_PRESENT; 332 link->irq.Attributes = IRQ_TYPE_DYNAMIC_SHARING;
347 link->irq.IRQInfo1 = IRQ_LEVEL_ID;
348 link->irq.Handler = &smc_interrupt; 333 link->irq.Handler = &smc_interrupt;
349 link->irq.Instance = dev;
350 link->conf.Attributes = CONF_ENABLE_IRQ; 334 link->conf.Attributes = CONF_ENABLE_IRQ;
351 link->conf.IntType = INT_MEMORY_AND_IO; 335 link->conf.IntType = INT_MEMORY_AND_IO;
352 336
@@ -377,7 +361,7 @@ static void smc91c92_detach(struct pcmcia_device *link)
377{ 361{
378 struct net_device *dev = link->priv; 362 struct net_device *dev = link->priv;
379 363
380 DEBUG(0, "smc91c92_detach(0x%p)\n", link); 364 dev_dbg(&link->dev, "smc91c92_detach\n");
381 365
382 if (link->dev_node) 366 if (link->dev_node)
383 unregister_netdev(dev); 367 unregister_netdev(dev);
@@ -408,34 +392,7 @@ static int cvt_ascii_address(struct net_device *dev, char *s)
408 return 0; 392 return 0;
409} 393}
410 394
411/*====================================================================*/ 395/*====================================================================
412
413static int first_tuple(struct pcmcia_device *handle, tuple_t *tuple,
414 cisparse_t *parse)
415{
416 int i;
417
418 i = pcmcia_get_first_tuple(handle, tuple);
419 if (i != 0)
420 return i;
421 i = pcmcia_get_tuple_data(handle, tuple);
422 if (i != 0)
423 return i;
424 return pcmcia_parse_tuple(tuple, parse);
425}
426
427static int next_tuple(struct pcmcia_device *handle, tuple_t *tuple,
428 cisparse_t *parse)
429{
430 int i;
431
432 if ((i = pcmcia_get_next_tuple(handle, tuple)) != 0 ||
433 (i = pcmcia_get_tuple_data(handle, tuple)) != 0)
434 return i;
435 return pcmcia_parse_tuple(tuple, parse);
436}
437
438/*======================================================================
439 396
440 Configuration stuff for Megahertz cards 397 Configuration stuff for Megahertz cards
441 398
@@ -490,19 +447,14 @@ static int mhz_mfc_config(struct pcmcia_device *link)
490{ 447{
491 struct net_device *dev = link->priv; 448 struct net_device *dev = link->priv;
492 struct smc_private *smc = netdev_priv(dev); 449 struct smc_private *smc = netdev_priv(dev);
493 struct smc_cfg_mem *cfg_mem;
494 win_req_t req; 450 win_req_t req;
495 memreq_t mem; 451 memreq_t mem;
496 int i; 452 int i;
497 453
498 cfg_mem = kmalloc(sizeof(struct smc_cfg_mem), GFP_KERNEL);
499 if (!cfg_mem)
500 return -ENOMEM;
501
502 link->conf.Attributes |= CONF_ENABLE_SPKR; 454 link->conf.Attributes |= CONF_ENABLE_SPKR;
503 link->conf.Status = CCSR_AUDIO_ENA; 455 link->conf.Status = CCSR_AUDIO_ENA;
504 link->irq.Attributes = 456 link->irq.Attributes =
505 IRQ_TYPE_DYNAMIC_SHARING|IRQ_FIRST_SHARED|IRQ_HANDLE_PRESENT; 457 IRQ_TYPE_DYNAMIC_SHARING|IRQ_FIRST_SHARED;
506 link->io.IOAddrLines = 16; 458 link->io.IOAddrLines = 16;
507 link->io.Attributes2 = IO_DATA_PATH_WIDTH_8; 459 link->io.Attributes2 = IO_DATA_PATH_WIDTH_8;
508 link->io.NumPorts2 = 8; 460 link->io.NumPorts2 = 8;
@@ -510,91 +462,80 @@ static int mhz_mfc_config(struct pcmcia_device *link)
510 /* The Megahertz combo cards have modem-like CIS entries, so 462 /* The Megahertz combo cards have modem-like CIS entries, so
511 we have to explicitly try a bunch of port combinations. */ 463 we have to explicitly try a bunch of port combinations. */
512 if (pcmcia_loop_config(link, mhz_mfc_config_check, NULL)) 464 if (pcmcia_loop_config(link, mhz_mfc_config_check, NULL))
513 goto free_cfg_mem; 465 return -ENODEV;
466
514 dev->base_addr = link->io.BasePort1; 467 dev->base_addr = link->io.BasePort1;
515 468
516 /* Allocate a memory window, for accessing the ISR */ 469 /* Allocate a memory window, for accessing the ISR */
517 req.Attributes = WIN_DATA_WIDTH_8|WIN_MEMORY_TYPE_AM|WIN_ENABLE; 470 req.Attributes = WIN_DATA_WIDTH_8|WIN_MEMORY_TYPE_AM|WIN_ENABLE;
518 req.Base = req.Size = 0; 471 req.Base = req.Size = 0;
519 req.AccessSpeed = 0; 472 req.AccessSpeed = 0;
520 i = pcmcia_request_window(&link, &req, &link->win); 473 i = pcmcia_request_window(link, &req, &link->win);
521 if (i != 0) 474 if (i != 0)
522 goto free_cfg_mem; 475 return -ENODEV;
476
523 smc->base = ioremap(req.Base, req.Size); 477 smc->base = ioremap(req.Base, req.Size);
524 mem.CardOffset = mem.Page = 0; 478 mem.CardOffset = mem.Page = 0;
525 if (smc->manfid == MANFID_MOTOROLA) 479 if (smc->manfid == MANFID_MOTOROLA)
526 mem.CardOffset = link->conf.ConfigBase; 480 mem.CardOffset = link->conf.ConfigBase;
527 i = pcmcia_map_mem_page(link->win, &mem); 481 i = pcmcia_map_mem_page(link, link->win, &mem);
528 482
529 if ((i == 0) 483 if ((i == 0)
530 && (smc->manfid == MANFID_MEGAHERTZ) 484 && (smc->manfid == MANFID_MEGAHERTZ)
531 && (smc->cardid == PRODID_MEGAHERTZ_EM3288)) 485 && (smc->cardid == PRODID_MEGAHERTZ_EM3288))
532 mhz_3288_power(link); 486 mhz_3288_power(link);
533 487
534free_cfg_mem: 488 return 0;
535 kfree(cfg_mem);
536 return -ENODEV;
537} 489}
538 490
539static int mhz_setup(struct pcmcia_device *link) 491static int pcmcia_get_versmac(struct pcmcia_device *p_dev,
492 tuple_t *tuple,
493 void *priv)
540{ 494{
541 struct net_device *dev = link->priv; 495 struct net_device *dev = priv;
542 struct smc_cfg_mem *cfg_mem; 496 cisparse_t parse;
543 tuple_t *tuple;
544 cisparse_t *parse;
545 u_char *buf, *station_addr;
546 int rc;
547 497
548 cfg_mem = kmalloc(sizeof(struct smc_cfg_mem), GFP_KERNEL); 498 if (pcmcia_parse_tuple(tuple, &parse))
549 if (!cfg_mem) 499 return -EINVAL;
550 return -1;
551 500
552 tuple = &cfg_mem->tuple; 501 if ((parse.version_1.ns > 3) &&
553 parse = &cfg_mem->parse; 502 (cvt_ascii_address(dev,
554 buf = cfg_mem->buf; 503 (parse.version_1.str + parse.version_1.ofs[3]))))
504 return 0;
555 505
556 tuple->Attributes = tuple->TupleOffset = 0; 506 return -EINVAL;
557 tuple->TupleData = (cisdata_t *)buf; 507};
558 tuple->TupleDataMax = 255; 508
509static int mhz_setup(struct pcmcia_device *link)
510{
511 struct net_device *dev = link->priv;
512 size_t len;
513 u8 *buf;
514 int rc;
559 515
560 /* Read the station address from the CIS. It is stored as the last 516 /* Read the station address from the CIS. It is stored as the last
561 (fourth) string in the Version 1 Version/ID tuple. */ 517 (fourth) string in the Version 1 Version/ID tuple. */
562 tuple->DesiredTuple = CISTPL_VERS_1; 518 if ((link->prod_id[3]) &&
563 if (first_tuple(link, tuple, parse) != 0) { 519 (cvt_ascii_address(dev, link->prod_id[3]) == 0))
564 rc = -1; 520 return 0;
565 goto free_cfg_mem; 521
566 } 522 /* Workarounds for broken cards start here. */
567 /* Ugh -- the EM1144 card has two VERS_1 tuples!?! */ 523 /* Ugh -- the EM1144 card has two VERS_1 tuples!?! */
568 if (next_tuple(link, tuple, parse) != 0) 524 if (!pcmcia_loop_tuple(link, CISTPL_VERS_1, pcmcia_get_versmac, dev))
569 first_tuple(link, tuple, parse); 525 return 0;
570 if (parse->version_1.ns > 3) {
571 station_addr = parse->version_1.str + parse->version_1.ofs[3];
572 if (cvt_ascii_address(dev, station_addr) == 0) {
573 rc = 0;
574 goto free_cfg_mem;
575 }
576 }
577 526
578 /* Another possibility: for the EM3288, in a special tuple */ 527 /* Another possibility: for the EM3288, in a special tuple */
579 tuple->DesiredTuple = 0x81;
580 if (pcmcia_get_first_tuple(link, tuple) != 0) {
581 rc = -1;
582 goto free_cfg_mem;
583 }
584 if (pcmcia_get_tuple_data(link, tuple) != 0) {
585 rc = -1;
586 goto free_cfg_mem;
587 }
588 buf[12] = '\0';
589 if (cvt_ascii_address(dev, buf) == 0) {
590 rc = 0;
591 goto free_cfg_mem;
592 }
593 rc = -1; 528 rc = -1;
594free_cfg_mem: 529 len = pcmcia_get_tuple(link, 0x81, &buf);
595 kfree(cfg_mem); 530 if (buf && len >= 13) {
596 return rc; 531 buf[12] = '\0';
597} 532 if (cvt_ascii_address(dev, buf))
533 rc = 0;
534 }
535 kfree(buf);
536
537 return rc;
538};
598 539
599/*====================================================================== 540/*======================================================================
600 541
@@ -684,58 +625,21 @@ static int smc_config(struct pcmcia_device *link)
684 return i; 625 return i;
685} 626}
686 627
628
687static int smc_setup(struct pcmcia_device *link) 629static int smc_setup(struct pcmcia_device *link)
688{ 630{
689 struct net_device *dev = link->priv; 631 struct net_device *dev = link->priv;
690 struct smc_cfg_mem *cfg_mem;
691 tuple_t *tuple;
692 cisparse_t *parse;
693 cistpl_lan_node_id_t *node_id;
694 u_char *buf, *station_addr;
695 int i, rc;
696
697 cfg_mem = kmalloc(sizeof(struct smc_cfg_mem), GFP_KERNEL);
698 if (!cfg_mem)
699 return -ENOMEM;
700
701 tuple = &cfg_mem->tuple;
702 parse = &cfg_mem->parse;
703 buf = cfg_mem->buf;
704
705 tuple->Attributes = tuple->TupleOffset = 0;
706 tuple->TupleData = (cisdata_t *)buf;
707 tuple->TupleDataMax = 255;
708 632
709 /* Check for a LAN function extension tuple */ 633 /* Check for a LAN function extension tuple */
710 tuple->DesiredTuple = CISTPL_FUNCE; 634 if (!pcmcia_get_mac_from_cis(link, dev))
711 i = first_tuple(link, tuple, parse); 635 return 0;
712 while (i == 0) { 636
713 if (parse->funce.type == CISTPL_FUNCE_LAN_NODE_ID)
714 break;
715 i = next_tuple(link, tuple, parse);
716 }
717 if (i == 0) {
718 node_id = (cistpl_lan_node_id_t *)parse->funce.data;
719 if (node_id->nb == 6) {
720 for (i = 0; i < 6; i++)
721 dev->dev_addr[i] = node_id->id[i];
722 rc = 0;
723 goto free_cfg_mem;
724 }
725 }
726 /* Try the third string in the Version 1 Version/ID tuple. */ 637 /* Try the third string in the Version 1 Version/ID tuple. */
727 if (link->prod_id[2]) { 638 if (link->prod_id[2]) {
728 station_addr = link->prod_id[2]; 639 if (cvt_ascii_address(dev, link->prod_id[2]) == 0)
729 if (cvt_ascii_address(dev, station_addr) == 0) { 640 return 0;
730 rc = 0;
731 goto free_cfg_mem;
732 }
733 } 641 }
734 642 return -1;
735 rc = -1;
736free_cfg_mem:
737 kfree(cfg_mem);
738 return rc;
739} 643}
740 644
741/*====================================================================*/ 645/*====================================================================*/
@@ -749,7 +653,7 @@ static int osi_config(struct pcmcia_device *link)
749 link->conf.Attributes |= CONF_ENABLE_SPKR; 653 link->conf.Attributes |= CONF_ENABLE_SPKR;
750 link->conf.Status = CCSR_AUDIO_ENA; 654 link->conf.Status = CCSR_AUDIO_ENA;
751 link->irq.Attributes = 655 link->irq.Attributes =
752 IRQ_TYPE_DYNAMIC_SHARING|IRQ_FIRST_SHARED|IRQ_HANDLE_PRESENT; 656 IRQ_TYPE_DYNAMIC_SHARING|IRQ_FIRST_SHARED;
753 link->io.NumPorts1 = 64; 657 link->io.NumPorts1 = 64;
754 link->io.Attributes2 = IO_DATA_PATH_WIDTH_8; 658 link->io.Attributes2 = IO_DATA_PATH_WIDTH_8;
755 link->io.NumPorts2 = 8; 659 link->io.NumPorts2 = 8;
@@ -794,41 +698,31 @@ static int osi_load_firmware(struct pcmcia_device *link)
794 return err; 698 return err;
795} 699}
796 700
797static int osi_setup(struct pcmcia_device *link, u_short manfid, u_short cardid) 701static int pcmcia_osi_mac(struct pcmcia_device *p_dev,
702 tuple_t *tuple,
703 void *priv)
798{ 704{
799 struct net_device *dev = link->priv; 705 struct net_device *dev = priv;
800 struct smc_cfg_mem *cfg_mem; 706 int i;
801 tuple_t *tuple;
802 u_char *buf;
803 int i, rc;
804 707
805 cfg_mem = kmalloc(sizeof(struct smc_cfg_mem), GFP_KERNEL); 708 if (tuple->TupleDataLen < 8)
806 if (!cfg_mem) 709 return -EINVAL;
807 return -1; 710 if (tuple->TupleData[0] != 0x04)
711 return -EINVAL;
712 for (i = 0; i < 6; i++)
713 dev->dev_addr[i] = tuple->TupleData[i+2];
714 return 0;
715};
808 716
809 tuple = &cfg_mem->tuple;
810 buf = cfg_mem->buf;
811 717
812 tuple->Attributes = TUPLE_RETURN_COMMON; 718static int osi_setup(struct pcmcia_device *link, u_short manfid, u_short cardid)
813 tuple->TupleData = (cisdata_t *)buf; 719{
814 tuple->TupleDataMax = 255; 720 struct net_device *dev = link->priv;
815 tuple->TupleOffset = 0; 721 int rc;
816 722
817 /* Read the station address from tuple 0x90, subtuple 0x04 */ 723 /* Read the station address from tuple 0x90, subtuple 0x04 */
818 tuple->DesiredTuple = 0x90; 724 if (pcmcia_loop_tuple(link, 0x90, pcmcia_osi_mac, dev))
819 i = pcmcia_get_first_tuple(link, tuple); 725 return -1;
820 while (i == 0) {
821 i = pcmcia_get_tuple_data(link, tuple);
822 if ((i != 0) || (buf[0] == 0x04))
823 break;
824 i = pcmcia_get_next_tuple(link, tuple);
825 }
826 if (i != 0) {
827 rc = -1;
828 goto free_cfg_mem;
829 }
830 for (i = 0; i < 6; i++)
831 dev->dev_addr[i] = buf[i+2];
832 726
833 if (((manfid == MANFID_OSITECH) && 727 if (((manfid == MANFID_OSITECH) &&
834 (cardid == PRODID_OSITECH_SEVEN)) || 728 (cardid == PRODID_OSITECH_SEVEN)) ||
@@ -836,20 +730,17 @@ static int osi_setup(struct pcmcia_device *link, u_short manfid, u_short cardid)
836 (cardid == PRODID_PSION_NET100))) { 730 (cardid == PRODID_PSION_NET100))) {
837 rc = osi_load_firmware(link); 731 rc = osi_load_firmware(link);
838 if (rc) 732 if (rc)
839 goto free_cfg_mem; 733 return rc;
840 } else if (manfid == MANFID_OSITECH) { 734 } else if (manfid == MANFID_OSITECH) {
841 /* Make sure both functions are powered up */ 735 /* Make sure both functions are powered up */
842 set_bits(0x300, link->io.BasePort1 + OSITECH_AUI_PWR); 736 set_bits(0x300, link->io.BasePort1 + OSITECH_AUI_PWR);
843 /* Now, turn on the interrupt for both card functions */ 737 /* Now, turn on the interrupt for both card functions */
844 set_bits(0x300, link->io.BasePort1 + OSITECH_RESET_ISR); 738 set_bits(0x300, link->io.BasePort1 + OSITECH_RESET_ISR);
845 DEBUG(2, "AUI/PWR: %4.4x RESET/ISR: %4.4x\n", 739 dev_dbg(&link->dev, "AUI/PWR: %4.4x RESET/ISR: %4.4x\n",
846 inw(link->io.BasePort1 + OSITECH_AUI_PWR), 740 inw(link->io.BasePort1 + OSITECH_AUI_PWR),
847 inw(link->io.BasePort1 + OSITECH_RESET_ISR)); 741 inw(link->io.BasePort1 + OSITECH_RESET_ISR));
848 } 742 }
849 rc = 0; 743 return 0;
850free_cfg_mem:
851 kfree(cfg_mem);
852 return rc;
853} 744}
854 745
855static int smc91c92_suspend(struct pcmcia_device *link) 746static int smc91c92_suspend(struct pcmcia_device *link)
@@ -959,12 +850,6 @@ static int check_sig(struct pcmcia_device *link)
959 850
960======================================================================*/ 851======================================================================*/
961 852
962#define CS_EXIT_TEST(ret, svc, label) \
963if (ret != 0) { \
964 cs_error(link, svc, ret); \
965 goto label; \
966}
967
968static int smc91c92_config(struct pcmcia_device *link) 853static int smc91c92_config(struct pcmcia_device *link)
969{ 854{
970 struct net_device *dev = link->priv; 855 struct net_device *dev = link->priv;
@@ -974,7 +859,7 @@ static int smc91c92_config(struct pcmcia_device *link)
974 unsigned int ioaddr; 859 unsigned int ioaddr;
975 u_long mir; 860 u_long mir;
976 861
977 DEBUG(0, "smc91c92_config(0x%p)\n", link); 862 dev_dbg(&link->dev, "smc91c92_config\n");
978 863
979 smc->manfid = link->manf_id; 864 smc->manfid = link->manf_id;
980 smc->cardid = link->card_id; 865 smc->cardid = link->card_id;
@@ -990,12 +875,15 @@ static int smc91c92_config(struct pcmcia_device *link)
990 } else { 875 } else {
991 i = smc_config(link); 876 i = smc_config(link);
992 } 877 }
993 CS_EXIT_TEST(i, RequestIO, config_failed); 878 if (i)
879 goto config_failed;
994 880
995 i = pcmcia_request_irq(link, &link->irq); 881 i = pcmcia_request_irq(link, &link->irq);
996 CS_EXIT_TEST(i, RequestIRQ, config_failed); 882 if (i)
883 goto config_failed;
997 i = pcmcia_request_configuration(link, &link->conf); 884 i = pcmcia_request_configuration(link, &link->conf);
998 CS_EXIT_TEST(i, RequestConfiguration, config_failed); 885 if (i)
886 goto config_failed;
999 887
1000 if (smc->manfid == MANFID_MOTOROLA) 888 if (smc->manfid == MANFID_MOTOROLA)
1001 mot_config(link); 889 mot_config(link);
@@ -1074,7 +962,7 @@ static int smc91c92_config(struct pcmcia_device *link)
1074 } 962 }
1075 963
1076 link->dev_node = &smc->node; 964 link->dev_node = &smc->node;
1077 SET_NETDEV_DEV(dev, &handle_to_dev(link)); 965 SET_NETDEV_DEV(dev, &link->dev);
1078 966
1079 if (register_netdev(dev) != 0) { 967 if (register_netdev(dev) != 0) {
1080 printk(KERN_ERR "smc91c92_cs: register_netdev() failed\n"); 968 printk(KERN_ERR "smc91c92_cs: register_netdev() failed\n");
@@ -1100,7 +988,7 @@ static int smc91c92_config(struct pcmcia_device *link)
1100 988
1101 if (smc->cfg & CFG_MII_SELECT) { 989 if (smc->cfg & CFG_MII_SELECT) {
1102 if (smc->mii_if.phy_id != -1) { 990 if (smc->mii_if.phy_id != -1) {
1103 DEBUG(0, " MII transceiver at index %d, status %x.\n", 991 dev_dbg(&link->dev, " MII transceiver at index %d, status %x.\n",
1104 smc->mii_if.phy_id, j); 992 smc->mii_if.phy_id, j);
1105 } else { 993 } else {
1106 printk(KERN_NOTICE " No MII transceivers found!\n"); 994 printk(KERN_NOTICE " No MII transceivers found!\n");
@@ -1110,7 +998,7 @@ static int smc91c92_config(struct pcmcia_device *link)
1110 998
1111config_undo: 999config_undo:
1112 unregister_netdev(dev); 1000 unregister_netdev(dev);
1113config_failed: /* CS_EXIT_TEST() calls jump to here... */ 1001config_failed:
1114 smc91c92_release(link); 1002 smc91c92_release(link);
1115 return -ENODEV; 1003 return -ENODEV;
1116} /* smc91c92_config */ 1004} /* smc91c92_config */
@@ -1125,7 +1013,7 @@ config_failed: /* CS_EXIT_TEST() calls jump to here... */
1125 1013
1126static void smc91c92_release(struct pcmcia_device *link) 1014static void smc91c92_release(struct pcmcia_device *link)
1127{ 1015{
1128 DEBUG(0, "smc91c92_release(0x%p)\n", link); 1016 dev_dbg(&link->dev, "smc91c92_release\n");
1129 if (link->win) { 1017 if (link->win) {
1130 struct net_device *dev = link->priv; 1018 struct net_device *dev = link->priv;
1131 struct smc_private *smc = netdev_priv(dev); 1019 struct smc_private *smc = netdev_priv(dev);
@@ -1222,10 +1110,10 @@ static int smc_open(struct net_device *dev)
1222 struct smc_private *smc = netdev_priv(dev); 1110 struct smc_private *smc = netdev_priv(dev);
1223 struct pcmcia_device *link = smc->p_dev; 1111 struct pcmcia_device *link = smc->p_dev;
1224 1112
1225#ifdef PCMCIA_DEBUG 1113 dev_dbg(&link->dev, "%s: smc_open(%p), ID/Window %4.4x.\n",
1226 DEBUG(0, "%s: smc_open(%p), ID/Window %4.4x.\n",
1227 dev->name, dev, inw(dev->base_addr + BANK_SELECT)); 1114 dev->name, dev, inw(dev->base_addr + BANK_SELECT));
1228 if (pc_debug > 1) smc_dump(dev); 1115#ifdef PCMCIA_DEBUG
1116 smc_dump(dev);
1229#endif 1117#endif
1230 1118
1231 /* Check that the PCMCIA card is still here. */ 1119 /* Check that the PCMCIA card is still here. */
@@ -1260,7 +1148,7 @@ static int smc_close(struct net_device *dev)
1260 struct pcmcia_device *link = smc->p_dev; 1148 struct pcmcia_device *link = smc->p_dev;
1261 unsigned int ioaddr = dev->base_addr; 1149 unsigned int ioaddr = dev->base_addr;
1262 1150
1263 DEBUG(0, "%s: smc_close(), status %4.4x.\n", 1151 dev_dbg(&link->dev, "%s: smc_close(), status %4.4x.\n",
1264 dev->name, inw(ioaddr + BANK_SELECT)); 1152 dev->name, inw(ioaddr + BANK_SELECT));
1265 1153
1266 netif_stop_queue(dev); 1154 netif_stop_queue(dev);
@@ -1327,7 +1215,7 @@ static void smc_hardware_send_packet(struct net_device * dev)
1327 u_char *buf = skb->data; 1215 u_char *buf = skb->data;
1328 u_int length = skb->len; /* The chip will pad to ethernet min. */ 1216 u_int length = skb->len; /* The chip will pad to ethernet min. */
1329 1217
1330 DEBUG(2, "%s: Trying to xmit packet of length %d.\n", 1218 pr_debug("%s: Trying to xmit packet of length %d.\n",
1331 dev->name, length); 1219 dev->name, length);
1332 1220
1333 /* send the packet length: +6 for status word, length, and ctl */ 1221 /* send the packet length: +6 for status word, length, and ctl */
@@ -1382,7 +1270,7 @@ static netdev_tx_t smc_start_xmit(struct sk_buff *skb,
1382 1270
1383 netif_stop_queue(dev); 1271 netif_stop_queue(dev);
1384 1272
1385 DEBUG(2, "%s: smc_start_xmit(length = %d) called," 1273 pr_debug("%s: smc_start_xmit(length = %d) called,"
1386 " status %4.4x.\n", dev->name, skb->len, inw(ioaddr + 2)); 1274 " status %4.4x.\n", dev->name, skb->len, inw(ioaddr + 2));
1387 1275
1388 if (smc->saved_skb) { 1276 if (smc->saved_skb) {
@@ -1429,7 +1317,7 @@ static netdev_tx_t smc_start_xmit(struct sk_buff *skb,
1429 } 1317 }
1430 1318
1431 /* Otherwise defer until the Tx-space-allocated interrupt. */ 1319 /* Otherwise defer until the Tx-space-allocated interrupt. */
1432 DEBUG(2, "%s: memory allocation deferred.\n", dev->name); 1320 pr_debug("%s: memory allocation deferred.\n", dev->name);
1433 outw((IM_ALLOC_INT << 8) | (ir & 0xff00), ioaddr + INTERRUPT); 1321 outw((IM_ALLOC_INT << 8) | (ir & 0xff00), ioaddr + INTERRUPT);
1434 spin_unlock_irqrestore(&smc->lock, flags); 1322 spin_unlock_irqrestore(&smc->lock, flags);
1435 1323
@@ -1494,7 +1382,7 @@ static void smc_eph_irq(struct net_device *dev)
1494 1382
1495 SMC_SELECT_BANK(0); 1383 SMC_SELECT_BANK(0);
1496 ephs = inw(ioaddr + EPH); 1384 ephs = inw(ioaddr + EPH);
1497 DEBUG(2, "%s: Ethernet protocol handler interrupt, status" 1385 pr_debug("%s: Ethernet protocol handler interrupt, status"
1498 " %4.4x.\n", dev->name, ephs); 1386 " %4.4x.\n", dev->name, ephs);
1499 /* Could be a counter roll-over warning: update stats. */ 1387 /* Could be a counter roll-over warning: update stats. */
1500 card_stats = inw(ioaddr + COUNTER); 1388 card_stats = inw(ioaddr + COUNTER);
@@ -1534,7 +1422,7 @@ static irqreturn_t smc_interrupt(int irq, void *dev_id)
1534 1422
1535 ioaddr = dev->base_addr; 1423 ioaddr = dev->base_addr;
1536 1424
1537 DEBUG(3, "%s: SMC91c92 interrupt %d at %#x.\n", dev->name, 1425 pr_debug("%s: SMC91c92 interrupt %d at %#x.\n", dev->name,
1538 irq, ioaddr); 1426 irq, ioaddr);
1539 1427
1540 spin_lock(&smc->lock); 1428 spin_lock(&smc->lock);
@@ -1543,7 +1431,7 @@ static irqreturn_t smc_interrupt(int irq, void *dev_id)
1543 if ((saved_bank & 0xff00) != 0x3300) { 1431 if ((saved_bank & 0xff00) != 0x3300) {
1544 /* The device does not exist -- the card could be off-line, or 1432 /* The device does not exist -- the card could be off-line, or
1545 maybe it has been ejected. */ 1433 maybe it has been ejected. */
1546 DEBUG(1, "%s: SMC91c92 interrupt %d for non-existent" 1434 pr_debug("%s: SMC91c92 interrupt %d for non-existent"
1547 "/ejected device.\n", dev->name, irq); 1435 "/ejected device.\n", dev->name, irq);
1548 handled = 0; 1436 handled = 0;
1549 goto irq_done; 1437 goto irq_done;
@@ -1557,7 +1445,7 @@ static irqreturn_t smc_interrupt(int irq, void *dev_id)
1557 1445
1558 do { /* read the status flag, and mask it */ 1446 do { /* read the status flag, and mask it */
1559 status = inw(ioaddr + INTERRUPT) & 0xff; 1447 status = inw(ioaddr + INTERRUPT) & 0xff;
1560 DEBUG(3, "%s: Status is %#2.2x (mask %#2.2x).\n", dev->name, 1448 pr_debug("%s: Status is %#2.2x (mask %#2.2x).\n", dev->name,
1561 status, mask); 1449 status, mask);
1562 if ((status & mask) == 0) { 1450 if ((status & mask) == 0) {
1563 if (bogus_cnt == INTR_WORK) 1451 if (bogus_cnt == INTR_WORK)
@@ -1602,7 +1490,7 @@ static irqreturn_t smc_interrupt(int irq, void *dev_id)
1602 smc_eph_irq(dev); 1490 smc_eph_irq(dev);
1603 } while (--bogus_cnt); 1491 } while (--bogus_cnt);
1604 1492
1605 DEBUG(3, " Restoring saved registers mask %2.2x bank %4.4x" 1493 pr_debug(" Restoring saved registers mask %2.2x bank %4.4x"
1606 " pointer %4.4x.\n", mask, saved_bank, saved_pointer); 1494 " pointer %4.4x.\n", mask, saved_bank, saved_pointer);
1607 1495
1608 /* restore state register */ 1496 /* restore state register */
@@ -1610,7 +1498,7 @@ static irqreturn_t smc_interrupt(int irq, void *dev_id)
1610 outw(saved_pointer, ioaddr + POINTER); 1498 outw(saved_pointer, ioaddr + POINTER);
1611 SMC_SELECT_BANK(saved_bank); 1499 SMC_SELECT_BANK(saved_bank);
1612 1500
1613 DEBUG(3, "%s: Exiting interrupt IRQ%d.\n", dev->name, irq); 1501 pr_debug("%s: Exiting interrupt IRQ%d.\n", dev->name, irq);
1614 1502
1615irq_done: 1503irq_done:
1616 1504
@@ -1661,7 +1549,7 @@ static void smc_rx(struct net_device *dev)
1661 rx_status = inw(ioaddr + DATA_1); 1549 rx_status = inw(ioaddr + DATA_1);
1662 packet_length = inw(ioaddr + DATA_1) & 0x07ff; 1550 packet_length = inw(ioaddr + DATA_1) & 0x07ff;
1663 1551
1664 DEBUG(2, "%s: Receive status %4.4x length %d.\n", 1552 pr_debug("%s: Receive status %4.4x length %d.\n",
1665 dev->name, rx_status, packet_length); 1553 dev->name, rx_status, packet_length);
1666 1554
1667 if (!(rx_status & RS_ERRORS)) { 1555 if (!(rx_status & RS_ERRORS)) {
@@ -1672,7 +1560,7 @@ static void smc_rx(struct net_device *dev)
1672 skb = dev_alloc_skb(packet_length+2); 1560 skb = dev_alloc_skb(packet_length+2);
1673 1561
1674 if (skb == NULL) { 1562 if (skb == NULL) {
1675 DEBUG(1, "%s: Low memory, packet dropped.\n", dev->name); 1563 pr_debug("%s: Low memory, packet dropped.\n", dev->name);
1676 dev->stats.rx_dropped++; 1564 dev->stats.rx_dropped++;
1677 outw(MC_RELEASE, ioaddr + MMU_CMD); 1565 outw(MC_RELEASE, ioaddr + MMU_CMD);
1678 return; 1566 return;
@@ -1832,7 +1720,7 @@ static void smc_reset(struct net_device *dev)
1832 struct smc_private *smc = netdev_priv(dev); 1720 struct smc_private *smc = netdev_priv(dev);
1833 int i; 1721 int i;
1834 1722
1835 DEBUG(0, "%s: smc91c92 reset called.\n", dev->name); 1723 pr_debug("%s: smc91c92 reset called.\n", dev->name);
1836 1724
1837 /* The first interaction must be a write to bring the chip out 1725 /* The first interaction must be a write to bring the chip out
1838 of sleep mode. */ 1726 of sleep mode. */
@@ -2149,18 +2037,6 @@ static u32 smc_get_link(struct net_device *dev)
2149 return ret; 2037 return ret;
2150} 2038}
2151 2039
2152#ifdef PCMCIA_DEBUG
2153static u32 smc_get_msglevel(struct net_device *dev)
2154{
2155 return pc_debug;
2156}
2157
2158static void smc_set_msglevel(struct net_device *dev, u32 val)
2159{
2160 pc_debug = val;
2161}
2162#endif
2163
2164static int smc_nway_reset(struct net_device *dev) 2040static int smc_nway_reset(struct net_device *dev)
2165{ 2041{
2166 struct smc_private *smc = netdev_priv(dev); 2042 struct smc_private *smc = netdev_priv(dev);
@@ -2184,10 +2060,6 @@ static const struct ethtool_ops ethtool_ops = {
2184 .get_settings = smc_get_settings, 2060 .get_settings = smc_get_settings,
2185 .set_settings = smc_set_settings, 2061 .set_settings = smc_set_settings,
2186 .get_link = smc_get_link, 2062 .get_link = smc_get_link,
2187#ifdef PCMCIA_DEBUG
2188 .get_msglevel = smc_get_msglevel,
2189 .set_msglevel = smc_set_msglevel,
2190#endif
2191 .nway_reset = smc_nway_reset, 2063 .nway_reset = smc_nway_reset,
2192}; 2064};
2193 2065
diff --git a/drivers/net/pcmcia/xirc2ps_cs.c b/drivers/net/pcmcia/xirc2ps_cs.c
index cf8423102538..fe504b7f369f 100644
--- a/drivers/net/pcmcia/xirc2ps_cs.c
+++ b/drivers/net/pcmcia/xirc2ps_cs.c
@@ -211,20 +211,6 @@ enum xirc_cmd { /* Commands */
211 211
212static const char *if_names[] = { "Auto", "10BaseT", "10Base2", "AUI", "100BaseT" }; 212static const char *if_names[] = { "Auto", "10BaseT", "10Base2", "AUI", "100BaseT" };
213 213
214/****************
215 * All the PCMCIA modules use PCMCIA_DEBUG to control debugging. If
216 * you do not define PCMCIA_DEBUG at all, all the debug code will be
217 * left out. If you compile with PCMCIA_DEBUG=0, the debug code will
218 * be present but disabled -- but it can then be enabled for specific
219 * modules at load time with a 'pc_debug=#' option to insmod.
220 */
221#ifdef PCMCIA_DEBUG
222static int pc_debug = PCMCIA_DEBUG;
223module_param(pc_debug, int, 0);
224#define DEBUG(n, args...) if (pc_debug>(n)) printk(KDBG_XIRC args)
225#else
226#define DEBUG(n, args...)
227#endif
228 214
229#define KDBG_XIRC KERN_DEBUG "xirc2ps_cs: " 215#define KDBG_XIRC KERN_DEBUG "xirc2ps_cs: "
230#define KERR_XIRC KERN_ERR "xirc2ps_cs: " 216#define KERR_XIRC KERN_ERR "xirc2ps_cs: "
@@ -359,7 +345,7 @@ static void xirc_tx_timeout(struct net_device *dev);
359static void xirc2ps_tx_timeout_task(struct work_struct *work); 345static void xirc2ps_tx_timeout_task(struct work_struct *work);
360static void set_addresses(struct net_device *dev); 346static void set_addresses(struct net_device *dev);
361static void set_multicast_list(struct net_device *dev); 347static void set_multicast_list(struct net_device *dev);
362static int set_card_type(struct pcmcia_device *link, const void *s); 348static int set_card_type(struct pcmcia_device *link);
363static int do_config(struct net_device *dev, struct ifmap *map); 349static int do_config(struct net_device *dev, struct ifmap *map);
364static int do_open(struct net_device *dev); 350static int do_open(struct net_device *dev);
365static int do_ioctl(struct net_device *dev, struct ifreq *rq, int cmd); 351static int do_ioctl(struct net_device *dev, struct ifreq *rq, int cmd);
@@ -371,28 +357,6 @@ static void do_powerdown(struct net_device *dev);
371static int do_stop(struct net_device *dev); 357static int do_stop(struct net_device *dev);
372 358
373/*=============== Helper functions =========================*/ 359/*=============== Helper functions =========================*/
374static int
375first_tuple(struct pcmcia_device *handle, tuple_t *tuple, cisparse_t *parse)
376{
377 int err;
378
379 if ((err = pcmcia_get_first_tuple(handle, tuple)) == 0 &&
380 (err = pcmcia_get_tuple_data(handle, tuple)) == 0)
381 err = pcmcia_parse_tuple(tuple, parse);
382 return err;
383}
384
385static int
386next_tuple(struct pcmcia_device *handle, tuple_t *tuple, cisparse_t *parse)
387{
388 int err;
389
390 if ((err = pcmcia_get_next_tuple(handle, tuple)) == 0 &&
391 (err = pcmcia_get_tuple_data(handle, tuple)) == 0)
392 err = pcmcia_parse_tuple(tuple, parse);
393 return err;
394}
395
396#define SelectPage(pgnr) outb((pgnr), ioaddr + XIRCREG_PR) 360#define SelectPage(pgnr) outb((pgnr), ioaddr + XIRCREG_PR)
397#define GetByte(reg) ((unsigned)inb(ioaddr + (reg))) 361#define GetByte(reg) ((unsigned)inb(ioaddr + (reg)))
398#define GetWord(reg) ((unsigned)inw(ioaddr + (reg))) 362#define GetWord(reg) ((unsigned)inw(ioaddr + (reg)))
@@ -400,7 +364,7 @@ next_tuple(struct pcmcia_device *handle, tuple_t *tuple, cisparse_t *parse)
400#define PutWord(reg,value) outw((value), ioaddr+(reg)) 364#define PutWord(reg,value) outw((value), ioaddr+(reg))
401 365
402/*====== Functions used for debugging =================================*/ 366/*====== Functions used for debugging =================================*/
403#if defined(PCMCIA_DEBUG) && 0 /* reading regs may change system status */ 367#if 0 /* reading regs may change system status */
404static void 368static void
405PrintRegisters(struct net_device *dev) 369PrintRegisters(struct net_device *dev)
406{ 370{
@@ -432,7 +396,7 @@ PrintRegisters(struct net_device *dev)
432 } 396 }
433 } 397 }
434} 398}
435#endif /* PCMCIA_DEBUG */ 399#endif /* 0 */
436 400
437/*============== MII Management functions ===============*/ 401/*============== MII Management functions ===============*/
438 402
@@ -576,7 +540,7 @@ xirc2ps_probe(struct pcmcia_device *link)
576 struct net_device *dev; 540 struct net_device *dev;
577 local_info_t *local; 541 local_info_t *local;
578 542
579 DEBUG(0, "attach()\n"); 543 dev_dbg(&link->dev, "attach()\n");
580 544
581 /* Allocate the device structure */ 545 /* Allocate the device structure */
582 dev = alloc_etherdev(sizeof(local_info_t)); 546 dev = alloc_etherdev(sizeof(local_info_t));
@@ -592,7 +556,6 @@ xirc2ps_probe(struct pcmcia_device *link)
592 link->conf.IntType = INT_MEMORY_AND_IO; 556 link->conf.IntType = INT_MEMORY_AND_IO;
593 link->conf.ConfigIndex = 1; 557 link->conf.ConfigIndex = 1;
594 link->irq.Handler = xirc2ps_interrupt; 558 link->irq.Handler = xirc2ps_interrupt;
595 link->irq.Instance = dev;
596 559
597 /* Fill in card specific entries */ 560 /* Fill in card specific entries */
598 dev->netdev_ops = &netdev_ops; 561 dev->netdev_ops = &netdev_ops;
@@ -615,7 +578,7 @@ xirc2ps_detach(struct pcmcia_device *link)
615{ 578{
616 struct net_device *dev = link->priv; 579 struct net_device *dev = link->priv;
617 580
618 DEBUG(0, "detach(0x%p)\n", link); 581 dev_dbg(&link->dev, "detach\n");
619 582
620 if (link->dev_node) 583 if (link->dev_node)
621 unregister_netdev(dev); 584 unregister_netdev(dev);
@@ -644,17 +607,25 @@ xirc2ps_detach(struct pcmcia_device *link)
644 * 607 *
645 */ 608 */
646static int 609static int
647set_card_type(struct pcmcia_device *link, const void *s) 610set_card_type(struct pcmcia_device *link)
648{ 611{
649 struct net_device *dev = link->priv; 612 struct net_device *dev = link->priv;
650 local_info_t *local = netdev_priv(dev); 613 local_info_t *local = netdev_priv(dev);
651 #ifdef PCMCIA_DEBUG 614 u8 *buf;
652 unsigned cisrev = ((const unsigned char *)s)[2]; 615 unsigned int cisrev, mediaid, prodid;
653 #endif 616 size_t len;
654 unsigned mediaid= ((const unsigned char *)s)[3]; 617
655 unsigned prodid = ((const unsigned char *)s)[4]; 618 len = pcmcia_get_tuple(link, CISTPL_MANFID, &buf);
619 if (len < 5) {
620 dev_err(&link->dev, "invalid CIS -- sorry\n");
621 return 0;
622 }
656 623
657 DEBUG(0, "cisrev=%02x mediaid=%02x prodid=%02x\n", 624 cisrev = buf[2];
625 mediaid = buf[3];
626 prodid = buf[4];
627
628 dev_dbg(&link->dev, "cisrev=%02x mediaid=%02x prodid=%02x\n",
658 cisrev, mediaid, prodid); 629 cisrev, mediaid, prodid);
659 630
660 local->mohawk = 0; 631 local->mohawk = 0;
@@ -761,6 +732,26 @@ xirc2ps_config_check(struct pcmcia_device *p_dev,
761 732
762} 733}
763 734
735
736static int pcmcia_get_mac_ce(struct pcmcia_device *p_dev,
737 tuple_t *tuple,
738 void *priv)
739{
740 struct net_device *dev = priv;
741 int i;
742
743 if (tuple->TupleDataLen != 13)
744 return -EINVAL;
745 if ((tuple->TupleData[0] != 2) || (tuple->TupleData[1] != 1) ||
746 (tuple->TupleData[2] != 6))
747 return -EINVAL;
748 /* another try (James Lehmer's CE2 version 4.1)*/
749 for (i = 2; i < 6; i++)
750 dev->dev_addr[i] = tuple->TupleData[i+2];
751 return 0;
752};
753
754
764/**************** 755/****************
765 * xirc2ps_config() is scheduled to run after a CARD_INSERTION event 756 * xirc2ps_config() is scheduled to run after a CARD_INSERTION event
766 * is received, to configure the PCMCIA socket, and to make the 757 * is received, to configure the PCMCIA socket, and to make the
@@ -772,33 +763,21 @@ xirc2ps_config(struct pcmcia_device * link)
772 struct net_device *dev = link->priv; 763 struct net_device *dev = link->priv;
773 local_info_t *local = netdev_priv(dev); 764 local_info_t *local = netdev_priv(dev);
774 unsigned int ioaddr; 765 unsigned int ioaddr;
775 tuple_t tuple; 766 int err;
776 cisparse_t parse; 767 u8 *buf;
777 int err, i; 768 size_t len;
778 u_char buf[64];
779 cistpl_lan_node_id_t *node_id = (cistpl_lan_node_id_t*)parse.funce.data;
780 769
781 local->dingo_ccr = NULL; 770 local->dingo_ccr = NULL;
782 771
783 DEBUG(0, "config(0x%p)\n", link); 772 dev_dbg(&link->dev, "config\n");
784
785 /*
786 * This reads the card's CONFIG tuple to find its configuration
787 * registers.
788 */
789 tuple.Attributes = 0;
790 tuple.TupleData = buf;
791 tuple.TupleDataMax = 64;
792 tuple.TupleOffset = 0;
793 773
794 /* Is this a valid card */ 774 /* Is this a valid card */
795 tuple.DesiredTuple = CISTPL_MANFID; 775 if (link->has_manf_id == 0) {
796 if ((err=first_tuple(link, &tuple, &parse))) {
797 printk(KNOT_XIRC "manfid not found in CIS\n"); 776 printk(KNOT_XIRC "manfid not found in CIS\n");
798 goto failure; 777 goto failure;
799 } 778 }
800 779
801 switch(parse.manfid.manf) { 780 switch (link->manf_id) {
802 case MANFID_XIRCOM: 781 case MANFID_XIRCOM:
803 local->manf_str = "Xircom"; 782 local->manf_str = "Xircom";
804 break; 783 break;
@@ -817,65 +796,44 @@ xirc2ps_config(struct pcmcia_device * link)
817 break; 796 break;
818 default: 797 default:
819 printk(KNOT_XIRC "Unknown Card Manufacturer ID: 0x%04x\n", 798 printk(KNOT_XIRC "Unknown Card Manufacturer ID: 0x%04x\n",
820 (unsigned)parse.manfid.manf); 799 (unsigned)link->manf_id);
821 goto failure; 800 goto failure;
822 } 801 }
823 DEBUG(0, "found %s card\n", local->manf_str); 802 dev_dbg(&link->dev, "found %s card\n", local->manf_str);
824 803
825 if (!set_card_type(link, buf)) { 804 if (!set_card_type(link)) {
826 printk(KNOT_XIRC "this card is not supported\n"); 805 printk(KNOT_XIRC "this card is not supported\n");
827 goto failure; 806 goto failure;
828 } 807 }
829 808
830 /* get the ethernet address from the CIS */ 809 /* get the ethernet address from the CIS */
831 tuple.DesiredTuple = CISTPL_FUNCE; 810 err = pcmcia_get_mac_from_cis(link, dev);
832 for (err = first_tuple(link, &tuple, &parse); !err; 811
833 err = next_tuple(link, &tuple, &parse)) { 812 /* not found: try to get the node-id from tuple 0x89 */
834 /* Once I saw two CISTPL_FUNCE_LAN_NODE_ID entries: 813 if (err) {
835 * the first one with a length of zero the second correct - 814 len = pcmcia_get_tuple(link, 0x89, &buf);
836 * so I skip all entries with length 0 */ 815 /* data layout looks like tuple 0x22 */
837 if (parse.funce.type == CISTPL_FUNCE_LAN_NODE_ID 816 if (buf && len == 8) {
838 && ((cistpl_lan_node_id_t *)parse.funce.data)->nb) 817 if (*buf == CISTPL_FUNCE_LAN_NODE_ID) {
839 break; 818 int i;
840 } 819 for (i = 2; i < 6; i++)
841 if (err) { /* not found: try to get the node-id from tuple 0x89 */ 820 dev->dev_addr[i] = buf[i+2];
842 tuple.DesiredTuple = 0x89; /* data layout looks like tuple 0x22 */ 821 } else
843 if ((err = pcmcia_get_first_tuple(link, &tuple)) == 0 && 822 err = -1;
844 (err = pcmcia_get_tuple_data(link, &tuple)) == 0) {
845 if (tuple.TupleDataLen == 8 && *buf == CISTPL_FUNCE_LAN_NODE_ID)
846 memcpy(&parse, buf, 8);
847 else
848 err = -1;
849 }
850 }
851 if (err) { /* another try (James Lehmer's CE2 version 4.1)*/
852 tuple.DesiredTuple = CISTPL_FUNCE;
853 for (err = first_tuple(link, &tuple, &parse); !err;
854 err = next_tuple(link, &tuple, &parse)) {
855 if (parse.funce.type == 0x02 && parse.funce.data[0] == 1
856 && parse.funce.data[1] == 6 && tuple.TupleDataLen == 13) {
857 buf[1] = 4;
858 memcpy(&parse, buf+1, 8);
859 break;
860 } 823 }
861 } 824 kfree(buf);
862 } 825 }
826
827 if (err)
828 err = pcmcia_loop_tuple(link, CISTPL_FUNCE, pcmcia_get_mac_ce, dev);
829
863 if (err) { 830 if (err) {
864 printk(KNOT_XIRC "node-id not found in CIS\n"); 831 printk(KNOT_XIRC "node-id not found in CIS\n");
865 goto failure; 832 goto failure;
866 } 833 }
867 node_id = (cistpl_lan_node_id_t *)parse.funce.data;
868 if (node_id->nb != 6) {
869 printk(KNOT_XIRC "malformed node-id in CIS\n");
870 goto failure;
871 }
872 for (i=0; i < 6; i++)
873 dev->dev_addr[i] = node_id->id[i];
874 834
875 link->io.IOAddrLines =10; 835 link->io.IOAddrLines =10;
876 link->io.Attributes1 = IO_DATA_PATH_WIDTH_16; 836 link->io.Attributes1 = IO_DATA_PATH_WIDTH_16;
877 link->irq.Attributes = IRQ_HANDLE_PRESENT;
878 link->irq.IRQInfo1 = IRQ_LEVEL_ID;
879 if (local->modem) { 837 if (local->modem) {
880 int pass; 838 int pass;
881 839
@@ -916,10 +874,8 @@ xirc2ps_config(struct pcmcia_device * link)
916 goto port_found; 874 goto port_found;
917 } 875 }
918 link->io.BasePort1 = 0; /* let CS decide */ 876 link->io.BasePort1 = 0; /* let CS decide */
919 if ((err=pcmcia_request_io(link, &link->io))) { 877 if ((err=pcmcia_request_io(link, &link->io)))
920 cs_error(link, RequestIO, err);
921 goto config_error; 878 goto config_error;
922 }
923 } 879 }
924 port_found: 880 port_found:
925 if (err) 881 if (err)
@@ -929,19 +885,15 @@ xirc2ps_config(struct pcmcia_device * link)
929 * Now allocate an interrupt line. Note that this does not 885 * Now allocate an interrupt line. Note that this does not
930 * actually assign a handler to the interrupt. 886 * actually assign a handler to the interrupt.
931 */ 887 */
932 if ((err=pcmcia_request_irq(link, &link->irq))) { 888 if ((err=pcmcia_request_irq(link, &link->irq)))
933 cs_error(link, RequestIRQ, err);
934 goto config_error; 889 goto config_error;
935 }
936 890
937 /**************** 891 /****************
938 * This actually configures the PCMCIA socket -- setting up 892 * This actually configures the PCMCIA socket -- setting up
939 * the I/O windows and the interrupt mapping. 893 * the I/O windows and the interrupt mapping.
940 */ 894 */
941 if ((err=pcmcia_request_configuration(link, &link->conf))) { 895 if ((err=pcmcia_request_configuration(link, &link->conf)))
942 cs_error(link, RequestConfiguration, err);
943 goto config_error; 896 goto config_error;
944 }
945 897
946 if (local->dingo) { 898 if (local->dingo) {
947 conf_reg_t reg; 899 conf_reg_t reg;
@@ -956,17 +908,13 @@ xirc2ps_config(struct pcmcia_device * link)
956 reg.Action = CS_WRITE; 908 reg.Action = CS_WRITE;
957 reg.Offset = CISREG_IOBASE_0; 909 reg.Offset = CISREG_IOBASE_0;
958 reg.Value = link->io.BasePort2 & 0xff; 910 reg.Value = link->io.BasePort2 & 0xff;
959 if ((err = pcmcia_access_configuration_register(link, &reg))) { 911 if ((err = pcmcia_access_configuration_register(link, &reg)))
960 cs_error(link, AccessConfigurationRegister, err);
961 goto config_error; 912 goto config_error;
962 }
963 reg.Action = CS_WRITE; 913 reg.Action = CS_WRITE;
964 reg.Offset = CISREG_IOBASE_1; 914 reg.Offset = CISREG_IOBASE_1;
965 reg.Value = (link->io.BasePort2 >> 8) & 0xff; 915 reg.Value = (link->io.BasePort2 >> 8) & 0xff;
966 if ((err = pcmcia_access_configuration_register(link, &reg))) { 916 if ((err = pcmcia_access_configuration_register(link, &reg)))
967 cs_error(link, AccessConfigurationRegister, err);
968 goto config_error; 917 goto config_error;
969 }
970 918
971 /* There is no config entry for the Ethernet part which 919 /* There is no config entry for the Ethernet part which
972 * is at 0x0800. So we allocate a window into the attribute 920 * is at 0x0800. So we allocate a window into the attribute
@@ -975,17 +923,14 @@ xirc2ps_config(struct pcmcia_device * link)
975 req.Attributes = WIN_DATA_WIDTH_8|WIN_MEMORY_TYPE_AM|WIN_ENABLE; 923 req.Attributes = WIN_DATA_WIDTH_8|WIN_MEMORY_TYPE_AM|WIN_ENABLE;
976 req.Base = req.Size = 0; 924 req.Base = req.Size = 0;
977 req.AccessSpeed = 0; 925 req.AccessSpeed = 0;
978 if ((err = pcmcia_request_window(&link, &req, &link->win))) { 926 if ((err = pcmcia_request_window(link, &req, &link->win)))
979 cs_error(link, RequestWindow, err);
980 goto config_error; 927 goto config_error;
981 } 928
982 local->dingo_ccr = ioremap(req.Base,0x1000) + 0x0800; 929 local->dingo_ccr = ioremap(req.Base,0x1000) + 0x0800;
983 mem.CardOffset = 0x0; 930 mem.CardOffset = 0x0;
984 mem.Page = 0; 931 mem.Page = 0;
985 if ((err = pcmcia_map_mem_page(link->win, &mem))) { 932 if ((err = pcmcia_map_mem_page(link, link->win, &mem)))
986 cs_error(link, MapMemPage, err);
987 goto config_error; 933 goto config_error;
988 }
989 934
990 /* Setup the CCRs; there are no infos in the CIS about the Ethernet 935 /* Setup the CCRs; there are no infos in the CIS about the Ethernet
991 * part. 936 * part.
@@ -1044,7 +989,7 @@ xirc2ps_config(struct pcmcia_device * link)
1044 do_reset(dev, 1); /* a kludge to make the cem56 work */ 989 do_reset(dev, 1); /* a kludge to make the cem56 work */
1045 990
1046 link->dev_node = &local->node; 991 link->dev_node = &local->node;
1047 SET_NETDEV_DEV(dev, &handle_to_dev(link)); 992 SET_NETDEV_DEV(dev, &link->dev);
1048 993
1049 if ((err=register_netdev(dev))) { 994 if ((err=register_netdev(dev))) {
1050 printk(KNOT_XIRC "register_netdev() failed\n"); 995 printk(KNOT_XIRC "register_netdev() failed\n");
@@ -1077,7 +1022,7 @@ xirc2ps_config(struct pcmcia_device * link)
1077static void 1022static void
1078xirc2ps_release(struct pcmcia_device *link) 1023xirc2ps_release(struct pcmcia_device *link)
1079{ 1024{
1080 DEBUG(0, "release(0x%p)\n", link); 1025 dev_dbg(&link->dev, "release\n");
1081 1026
1082 if (link->win) { 1027 if (link->win) {
1083 struct net_device *dev = link->priv; 1028 struct net_device *dev = link->priv;
@@ -1144,7 +1089,7 @@ xirc2ps_interrupt(int irq, void *dev_id)
1144 PutByte(XIRCREG_CR, 0); 1089 PutByte(XIRCREG_CR, 0);
1145 } 1090 }
1146 1091
1147 DEBUG(6, "%s: interrupt %d at %#x.\n", dev->name, irq, ioaddr); 1092 pr_debug("%s: interrupt %d at %#x.\n", dev->name, irq, ioaddr);
1148 1093
1149 saved_page = GetByte(XIRCREG_PR); 1094 saved_page = GetByte(XIRCREG_PR);
1150 /* Read the ISR to see whats the cause for the interrupt. 1095 /* Read the ISR to see whats the cause for the interrupt.
@@ -1154,7 +1099,7 @@ xirc2ps_interrupt(int irq, void *dev_id)
1154 bytes_rcvd = 0; 1099 bytes_rcvd = 0;
1155 loop_entry: 1100 loop_entry:
1156 if (int_status == 0xff) { /* card may be ejected */ 1101 if (int_status == 0xff) { /* card may be ejected */
1157 DEBUG(3, "%s: interrupt %d for dead card\n", dev->name, irq); 1102 pr_debug("%s: interrupt %d for dead card\n", dev->name, irq);
1158 goto leave; 1103 goto leave;
1159 } 1104 }
1160 eth_status = GetByte(XIRCREG_ESR); 1105 eth_status = GetByte(XIRCREG_ESR);
@@ -1167,7 +1112,7 @@ xirc2ps_interrupt(int irq, void *dev_id)
1167 PutByte(XIRCREG40_TXST0, 0); 1112 PutByte(XIRCREG40_TXST0, 0);
1168 PutByte(XIRCREG40_TXST1, 0); 1113 PutByte(XIRCREG40_TXST1, 0);
1169 1114
1170 DEBUG(3, "%s: ISR=%#2.2x ESR=%#2.2x RSR=%#2.2x TSR=%#4.4x\n", 1115 pr_debug("%s: ISR=%#2.2x ESR=%#2.2x RSR=%#2.2x TSR=%#4.4x\n",
1171 dev->name, int_status, eth_status, rx_status, tx_status); 1116 dev->name, int_status, eth_status, rx_status, tx_status);
1172 1117
1173 /***** receive section ******/ 1118 /***** receive section ******/
@@ -1178,14 +1123,14 @@ xirc2ps_interrupt(int irq, void *dev_id)
1178 /* too many bytes received during this int, drop the rest of the 1123 /* too many bytes received during this int, drop the rest of the
1179 * packets */ 1124 * packets */
1180 dev->stats.rx_dropped++; 1125 dev->stats.rx_dropped++;
1181 DEBUG(2, "%s: RX drop, too much done\n", dev->name); 1126 pr_debug("%s: RX drop, too much done\n", dev->name);
1182 } else if (rsr & PktRxOk) { 1127 } else if (rsr & PktRxOk) {
1183 struct sk_buff *skb; 1128 struct sk_buff *skb;
1184 1129
1185 pktlen = GetWord(XIRCREG0_RBC); 1130 pktlen = GetWord(XIRCREG0_RBC);
1186 bytes_rcvd += pktlen; 1131 bytes_rcvd += pktlen;
1187 1132
1188 DEBUG(5, "rsr=%#02x packet_length=%u\n", rsr, pktlen); 1133 pr_debug("rsr=%#02x packet_length=%u\n", rsr, pktlen);
1189 1134
1190 skb = dev_alloc_skb(pktlen+3); /* 1 extra so we can use insw */ 1135 skb = dev_alloc_skb(pktlen+3); /* 1 extra so we can use insw */
1191 if (!skb) { 1136 if (!skb) {
@@ -1253,19 +1198,19 @@ xirc2ps_interrupt(int irq, void *dev_id)
1253 dev->stats.multicast++; 1198 dev->stats.multicast++;
1254 } 1199 }
1255 } else { /* bad packet */ 1200 } else { /* bad packet */
1256 DEBUG(5, "rsr=%#02x\n", rsr); 1201 pr_debug("rsr=%#02x\n", rsr);
1257 } 1202 }
1258 if (rsr & PktTooLong) { 1203 if (rsr & PktTooLong) {
1259 dev->stats.rx_frame_errors++; 1204 dev->stats.rx_frame_errors++;
1260 DEBUG(3, "%s: Packet too long\n", dev->name); 1205 pr_debug("%s: Packet too long\n", dev->name);
1261 } 1206 }
1262 if (rsr & CRCErr) { 1207 if (rsr & CRCErr) {
1263 dev->stats.rx_crc_errors++; 1208 dev->stats.rx_crc_errors++;
1264 DEBUG(3, "%s: CRC error\n", dev->name); 1209 pr_debug("%s: CRC error\n", dev->name);
1265 } 1210 }
1266 if (rsr & AlignErr) { 1211 if (rsr & AlignErr) {
1267 dev->stats.rx_fifo_errors++; /* okay ? */ 1212 dev->stats.rx_fifo_errors++; /* okay ? */
1268 DEBUG(3, "%s: Alignment error\n", dev->name); 1213 pr_debug("%s: Alignment error\n", dev->name);
1269 } 1214 }
1270 1215
1271 /* clear the received/dropped/error packet */ 1216 /* clear the received/dropped/error packet */
@@ -1277,7 +1222,7 @@ xirc2ps_interrupt(int irq, void *dev_id)
1277 if (rx_status & 0x10) { /* Receive overrun */ 1222 if (rx_status & 0x10) { /* Receive overrun */
1278 dev->stats.rx_over_errors++; 1223 dev->stats.rx_over_errors++;
1279 PutByte(XIRCREG_CR, ClearRxOvrun); 1224 PutByte(XIRCREG_CR, ClearRxOvrun);
1280 DEBUG(3, "receive overrun cleared\n"); 1225 pr_debug("receive overrun cleared\n");
1281 } 1226 }
1282 1227
1283 /***** transmit section ******/ 1228 /***** transmit section ******/
@@ -1290,13 +1235,13 @@ xirc2ps_interrupt(int irq, void *dev_id)
1290 if (nn < n) /* rollover */ 1235 if (nn < n) /* rollover */
1291 dev->stats.tx_packets += 256 - n; 1236 dev->stats.tx_packets += 256 - n;
1292 else if (n == nn) { /* happens sometimes - don't know why */ 1237 else if (n == nn) { /* happens sometimes - don't know why */
1293 DEBUG(0, "PTR not changed?\n"); 1238 pr_debug("PTR not changed?\n");
1294 } else 1239 } else
1295 dev->stats.tx_packets += lp->last_ptr_value - n; 1240 dev->stats.tx_packets += lp->last_ptr_value - n;
1296 netif_wake_queue(dev); 1241 netif_wake_queue(dev);
1297 } 1242 }
1298 if (tx_status & 0x0002) { /* Execessive collissions */ 1243 if (tx_status & 0x0002) { /* Execessive collissions */
1299 DEBUG(0, "tx restarted due to execssive collissions\n"); 1244 pr_debug("tx restarted due to execssive collissions\n");
1300 PutByte(XIRCREG_CR, RestartTx); /* restart transmitter process */ 1245 PutByte(XIRCREG_CR, RestartTx); /* restart transmitter process */
1301 } 1246 }
1302 if (tx_status & 0x0040) 1247 if (tx_status & 0x0040)
@@ -1315,14 +1260,14 @@ xirc2ps_interrupt(int irq, void *dev_id)
1315 maxrx_bytes = 2000; 1260 maxrx_bytes = 2000;
1316 else if (maxrx_bytes > 22000) 1261 else if (maxrx_bytes > 22000)
1317 maxrx_bytes = 22000; 1262 maxrx_bytes = 22000;
1318 DEBUG(1, "set maxrx=%u (rcvd=%u ticks=%lu)\n", 1263 pr_debug("set maxrx=%u (rcvd=%u ticks=%lu)\n",
1319 maxrx_bytes, bytes_rcvd, duration); 1264 maxrx_bytes, bytes_rcvd, duration);
1320 } else if (!duration && maxrx_bytes < 22000) { 1265 } else if (!duration && maxrx_bytes < 22000) {
1321 /* now much faster */ 1266 /* now much faster */
1322 maxrx_bytes += 2000; 1267 maxrx_bytes += 2000;
1323 if (maxrx_bytes > 22000) 1268 if (maxrx_bytes > 22000)
1324 maxrx_bytes = 22000; 1269 maxrx_bytes = 22000;
1325 DEBUG(1, "set maxrx=%u\n", maxrx_bytes); 1270 pr_debug("set maxrx=%u\n", maxrx_bytes);
1326 } 1271 }
1327 } 1272 }
1328 1273
@@ -1372,7 +1317,7 @@ do_start_xmit(struct sk_buff *skb, struct net_device *dev)
1372 unsigned freespace; 1317 unsigned freespace;
1373 unsigned pktlen = skb->len; 1318 unsigned pktlen = skb->len;
1374 1319
1375 DEBUG(1, "do_start_xmit(skb=%p, dev=%p) len=%u\n", 1320 pr_debug("do_start_xmit(skb=%p, dev=%p) len=%u\n",
1376 skb, dev, pktlen); 1321 skb, dev, pktlen);
1377 1322
1378 1323
@@ -1398,7 +1343,7 @@ do_start_xmit(struct sk_buff *skb, struct net_device *dev)
1398 freespace &= 0x7fff; 1343 freespace &= 0x7fff;
1399 /* TRS doesn't work - (indeed it is eliminated with sil-rev 1) */ 1344 /* TRS doesn't work - (indeed it is eliminated with sil-rev 1) */
1400 okay = pktlen +2 < freespace; 1345 okay = pktlen +2 < freespace;
1401 DEBUG(2 + (okay ? 2 : 0), "%s: avail. tx space=%u%s\n", 1346 pr_debug("%s: avail. tx space=%u%s\n",
1402 dev->name, freespace, okay ? " (okay)":" (not enough)"); 1347 dev->name, freespace, okay ? " (okay)":" (not enough)");
1403 if (!okay) { /* not enough space */ 1348 if (!okay) { /* not enough space */
1404 return NETDEV_TX_BUSY; /* upper layer may decide to requeue this packet */ 1349 return NETDEV_TX_BUSY; /* upper layer may decide to requeue this packet */
@@ -1500,7 +1445,7 @@ do_config(struct net_device *dev, struct ifmap *map)
1500{ 1445{
1501 local_info_t *local = netdev_priv(dev); 1446 local_info_t *local = netdev_priv(dev);
1502 1447
1503 DEBUG(0, "do_config(%p)\n", dev); 1448 pr_debug("do_config(%p)\n", dev);
1504 if (map->port != 255 && map->port != dev->if_port) { 1449 if (map->port != 255 && map->port != dev->if_port) {
1505 if (map->port > 4) 1450 if (map->port > 4)
1506 return -EINVAL; 1451 return -EINVAL;
@@ -1527,7 +1472,7 @@ do_open(struct net_device *dev)
1527 local_info_t *lp = netdev_priv(dev); 1472 local_info_t *lp = netdev_priv(dev);
1528 struct pcmcia_device *link = lp->p_dev; 1473 struct pcmcia_device *link = lp->p_dev;
1529 1474
1530 DEBUG(0, "do_open(%p)\n", dev); 1475 dev_dbg(&link->dev, "do_open(%p)\n", dev);
1531 1476
1532 /* Check that the PCMCIA card is still here. */ 1477 /* Check that the PCMCIA card is still here. */
1533 /* Physical device present signature. */ 1478 /* Physical device present signature. */
@@ -1561,7 +1506,7 @@ do_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)
1561 unsigned int ioaddr = dev->base_addr; 1506 unsigned int ioaddr = dev->base_addr;
1562 struct mii_ioctl_data *data = if_mii(rq); 1507 struct mii_ioctl_data *data = if_mii(rq);
1563 1508
1564 DEBUG(1, "%s: ioctl(%-.6s, %#04x) %04x %04x %04x %04x\n", 1509 pr_debug("%s: ioctl(%-.6s, %#04x) %04x %04x %04x %04x\n",
1565 dev->name, rq->ifr_ifrn.ifrn_name, cmd, 1510 dev->name, rq->ifr_ifrn.ifrn_name, cmd,
1566 data->phy_id, data->reg_num, data->val_in, data->val_out); 1511 data->phy_id, data->reg_num, data->val_in, data->val_out);
1567 1512
@@ -1610,7 +1555,7 @@ do_reset(struct net_device *dev, int full)
1610 unsigned int ioaddr = dev->base_addr; 1555 unsigned int ioaddr = dev->base_addr;
1611 unsigned value; 1556 unsigned value;
1612 1557
1613 DEBUG(0, "%s: do_reset(%p,%d)\n", dev? dev->name:"eth?", dev, full); 1558 pr_debug("%s: do_reset(%p,%d)\n", dev? dev->name:"eth?", dev, full);
1614 1559
1615 hardreset(dev); 1560 hardreset(dev);
1616 PutByte(XIRCREG_CR, SoftReset); /* set */ 1561 PutByte(XIRCREG_CR, SoftReset); /* set */
@@ -1648,8 +1593,8 @@ do_reset(struct net_device *dev, int full)
1648 } 1593 }
1649 msleep(40); /* wait 40 msec to let it complete */ 1594 msleep(40); /* wait 40 msec to let it complete */
1650 1595
1651 #ifdef PCMCIA_DEBUG 1596 #if 0
1652 if (pc_debug) { 1597 {
1653 SelectPage(0); 1598 SelectPage(0);
1654 value = GetByte(XIRCREG_ESR); /* read the ESR */ 1599 value = GetByte(XIRCREG_ESR); /* read the ESR */
1655 printk(KERN_DEBUG "%s: ESR is: %#02x\n", dev->name, value); 1600 printk(KERN_DEBUG "%s: ESR is: %#02x\n", dev->name, value);
@@ -1666,7 +1611,7 @@ do_reset(struct net_device *dev, int full)
1666 value |= DisableLinkPulse; 1611 value |= DisableLinkPulse;
1667 PutByte(XIRCREG1_ECR, value); 1612 PutByte(XIRCREG1_ECR, value);
1668 #endif 1613 #endif
1669 DEBUG(0, "%s: ECR is: %#02x\n", dev->name, value); 1614 pr_debug("%s: ECR is: %#02x\n", dev->name, value);
1670 1615
1671 SelectPage(0x42); 1616 SelectPage(0x42);
1672 PutByte(XIRCREG42_SWC0, 0x20); /* disable source insertion */ 1617 PutByte(XIRCREG42_SWC0, 0x20); /* disable source insertion */
@@ -1844,7 +1789,7 @@ do_powerdown(struct net_device *dev)
1844 1789
1845 unsigned int ioaddr = dev->base_addr; 1790 unsigned int ioaddr = dev->base_addr;
1846 1791
1847 DEBUG(0, "do_powerdown(%p)\n", dev); 1792 pr_debug("do_powerdown(%p)\n", dev);
1848 1793
1849 SelectPage(4); 1794 SelectPage(4);
1850 PutByte(XIRCREG4_GPR1, 0); /* clear bit 0: power down */ 1795 PutByte(XIRCREG4_GPR1, 0); /* clear bit 0: power down */
@@ -1858,7 +1803,7 @@ do_stop(struct net_device *dev)
1858 local_info_t *lp = netdev_priv(dev); 1803 local_info_t *lp = netdev_priv(dev);
1859 struct pcmcia_device *link = lp->p_dev; 1804 struct pcmcia_device *link = lp->p_dev;
1860 1805
1861 DEBUG(0, "do_stop(%p)\n", dev); 1806 dev_dbg(&link->dev, "do_stop(%p)\n", dev);
1862 1807
1863 if (!link) 1808 if (!link)
1864 return -ENODEV; 1809 return -ENODEV;
diff --git a/drivers/net/phy/mdio-gpio.c b/drivers/net/phy/mdio-gpio.c
index 8659d341e769..35897134a5dd 100644
--- a/drivers/net/phy/mdio-gpio.c
+++ b/drivers/net/phy/mdio-gpio.c
@@ -139,7 +139,7 @@ out:
139 return NULL; 139 return NULL;
140} 140}
141 141
142static void __devinit mdio_gpio_bus_deinit(struct device *dev) 142static void mdio_gpio_bus_deinit(struct device *dev)
143{ 143{
144 struct mii_bus *bus = dev_get_drvdata(dev); 144 struct mii_bus *bus = dev_get_drvdata(dev);
145 struct mdio_gpio_info *bitbang = bus->priv; 145 struct mdio_gpio_info *bitbang = bus->priv;
diff --git a/drivers/net/ppp_generic.c b/drivers/net/ppp_generic.c
index 9bf2a6be9031..965adb6174c3 100644
--- a/drivers/net/ppp_generic.c
+++ b/drivers/net/ppp_generic.c
@@ -1944,8 +1944,15 @@ ppp_receive_mp_frame(struct ppp *ppp, struct sk_buff *skb, struct channel *pch)
1944 } 1944 }
1945 1945
1946 /* Pull completed packets off the queue and receive them. */ 1946 /* Pull completed packets off the queue and receive them. */
1947 while ((skb = ppp_mp_reconstruct(ppp))) 1947 while ((skb = ppp_mp_reconstruct(ppp))) {
1948 ppp_receive_nonmp_frame(ppp, skb); 1948 if (pskb_may_pull(skb, 2))
1949 ppp_receive_nonmp_frame(ppp, skb);
1950 else {
1951 ++ppp->dev->stats.rx_length_errors;
1952 kfree_skb(skb);
1953 ppp_receive_error(ppp);
1954 }
1955 }
1949 1956
1950 return; 1957 return;
1951 1958
diff --git a/drivers/net/qlge/qlge_main.c b/drivers/net/qlge/qlge_main.c
index cea7531f4f40..a2fc70a0d0cc 100644
--- a/drivers/net/qlge/qlge_main.c
+++ b/drivers/net/qlge/qlge_main.c
@@ -3916,6 +3916,8 @@ static int __devinit ql_init_device(struct pci_dev *pdev,
3916 goto err_out; 3916 goto err_out;
3917 } 3917 }
3918 3918
3919 /* Set PCIe reset type for EEH to fundamental. */
3920 pdev->needs_freset = 1;
3919 pci_save_state(pdev); 3921 pci_save_state(pdev);
3920 qdev->reg_base = 3922 qdev->reg_base =
3921 ioremap_nocache(pci_resource_start(pdev, 1), 3923 ioremap_nocache(pci_resource_start(pdev, 1),
diff --git a/drivers/net/qlge/qlge_mpi.c b/drivers/net/qlge/qlge_mpi.c
index bcf13c96f73f..aec05f266107 100644
--- a/drivers/net/qlge/qlge_mpi.c
+++ b/drivers/net/qlge/qlge_mpi.c
@@ -499,7 +499,7 @@ static int ql_mailbox_command(struct ql_adapter *qdev, struct mbox_params *mbcp)
499 /* Wait for the interrupt to come in. */ 499 /* Wait for the interrupt to come in. */
500 status = ql_wait_mbx_cmd_cmplt(qdev); 500 status = ql_wait_mbx_cmd_cmplt(qdev);
501 if (status) 501 if (status)
502 goto end; 502 continue;
503 503
504 /* Process the event. If it's an AEN, it 504 /* Process the event. If it's an AEN, it
505 * will be handled in-line or a worker 505 * will be handled in-line or a worker
diff --git a/drivers/net/r6040.c b/drivers/net/r6040.c
index 7dfcb58b0eb4..8b14c6eda7c3 100644
--- a/drivers/net/r6040.c
+++ b/drivers/net/r6040.c
@@ -1085,7 +1085,7 @@ static int __devinit r6040_init_one(struct pci_dev *pdev,
1085 int bar = 0; 1085 int bar = 0;
1086 u16 *adrp; 1086 u16 *adrp;
1087 1087
1088 printk(KERN_INFO "%s\n", version); 1088 printk("%s\n", version);
1089 1089
1090 err = pci_enable_device(pdev); 1090 err = pci_enable_device(pdev);
1091 if (err) 1091 if (err)
diff --git a/drivers/net/r8169.c b/drivers/net/r8169.c
index f98ef523f525..0fe2fc90f207 100644
--- a/drivers/net/r8169.c
+++ b/drivers/net/r8169.c
@@ -3235,6 +3235,10 @@ static void __devexit rtl8169_remove_one(struct pci_dev *pdev)
3235 flush_scheduled_work(); 3235 flush_scheduled_work();
3236 3236
3237 unregister_netdev(dev); 3237 unregister_netdev(dev);
3238
3239 /* restore original MAC address */
3240 rtl_rar_set(tp, dev->perm_addr);
3241
3238 rtl_disable_msi(pdev, tp); 3242 rtl_disable_msi(pdev, tp);
3239 rtl8169_release_board(pdev, dev, tp->mmio_addr); 3243 rtl8169_release_board(pdev, dev, tp->mmio_addr);
3240 pci_set_drvdata(pdev, NULL); 3244 pci_set_drvdata(pdev, NULL);
@@ -3243,9 +3247,9 @@ static void __devexit rtl8169_remove_one(struct pci_dev *pdev)
3243static void rtl8169_set_rxbufsize(struct rtl8169_private *tp, 3247static void rtl8169_set_rxbufsize(struct rtl8169_private *tp,
3244 struct net_device *dev) 3248 struct net_device *dev)
3245{ 3249{
3246 unsigned int mtu = dev->mtu; 3250 unsigned int max_frame = dev->mtu + VLAN_ETH_HLEN + ETH_FCS_LEN;
3247 3251
3248 tp->rx_buf_sz = (mtu > RX_BUF_SIZE) ? mtu + ETH_HLEN + 8 : RX_BUF_SIZE; 3252 tp->rx_buf_sz = (max_frame > RX_BUF_SIZE) ? max_frame : RX_BUF_SIZE;
3249} 3253}
3250 3254
3251static int rtl8169_open(struct net_device *dev) 3255static int rtl8169_open(struct net_device *dev)
@@ -3379,7 +3383,7 @@ static u16 rtl_rw_cpluscmd(void __iomem *ioaddr)
3379static void rtl_set_rx_max_size(void __iomem *ioaddr, unsigned int rx_buf_sz) 3383static void rtl_set_rx_max_size(void __iomem *ioaddr, unsigned int rx_buf_sz)
3380{ 3384{
3381 /* Low hurts. Let's disable the filtering. */ 3385 /* Low hurts. Let's disable the filtering. */
3382 RTL_W16(RxMaxSize, rx_buf_sz); 3386 RTL_W16(RxMaxSize, rx_buf_sz + 1);
3383} 3387}
3384 3388
3385static void rtl8169_set_magic_reg(void __iomem *ioaddr, unsigned mac_version) 3389static void rtl8169_set_magic_reg(void __iomem *ioaddr, unsigned mac_version)
@@ -4881,6 +4885,9 @@ static void rtl_shutdown(struct pci_dev *pdev)
4881 4885
4882 rtl8169_net_suspend(dev); 4886 rtl8169_net_suspend(dev);
4883 4887
4888 /* restore original MAC address */
4889 rtl_rar_set(tp, dev->perm_addr);
4890
4884 spin_lock_irq(&tp->lock); 4891 spin_lock_irq(&tp->lock);
4885 4892
4886 rtl8169_asic_down(ioaddr); 4893 rtl8169_asic_down(ioaddr);
diff --git a/drivers/net/s2io.c b/drivers/net/s2io.c
index ddccf5fa56b6..0dd7839322bc 100644
--- a/drivers/net/s2io.c
+++ b/drivers/net/s2io.c
@@ -3494,6 +3494,7 @@ static void s2io_reset(struct s2io_nic *sp)
3494 3494
3495 /* Restore the PCI state saved during initialization. */ 3495 /* Restore the PCI state saved during initialization. */
3496 pci_restore_state(sp->pdev); 3496 pci_restore_state(sp->pdev);
3497 pci_save_state(sp->pdev);
3497 pci_read_config_word(sp->pdev, 0x2, &val16); 3498 pci_read_config_word(sp->pdev, 0x2, &val16);
3498 if (check_pci_device_id(val16) != (u16)PCI_ANY_ID) 3499 if (check_pci_device_id(val16) != (u16)PCI_ANY_ID)
3499 break; 3500 break;
diff --git a/drivers/net/sfc/sfe4001.c b/drivers/net/sfc/sfe4001.c
index cee00ad49b57..49eb91b5f50c 100644
--- a/drivers/net/sfc/sfe4001.c
+++ b/drivers/net/sfc/sfe4001.c
@@ -188,7 +188,7 @@ static int sfn4111t_reset(struct efx_nic *efx)
188 efx_oword_t reg; 188 efx_oword_t reg;
189 189
190 /* GPIO 3 and the GPIO register are shared with I2C, so block that */ 190 /* GPIO 3 and the GPIO register are shared with I2C, so block that */
191 mutex_lock(&efx->i2c_adap.bus_lock); 191 i2c_lock_adapter(&efx->i2c_adap);
192 192
193 /* Pull RST_N (GPIO 2) low then let it up again, setting the 193 /* Pull RST_N (GPIO 2) low then let it up again, setting the
194 * FLASH_CFG_1 strap (GPIO 3) appropriately. Only change the 194 * FLASH_CFG_1 strap (GPIO 3) appropriately. Only change the
@@ -204,7 +204,7 @@ static int sfn4111t_reset(struct efx_nic *efx)
204 falcon_write(efx, &reg, GPIO_CTL_REG_KER); 204 falcon_write(efx, &reg, GPIO_CTL_REG_KER);
205 msleep(1); 205 msleep(1);
206 206
207 mutex_unlock(&efx->i2c_adap.bus_lock); 207 i2c_unlock_adapter(&efx->i2c_adap);
208 208
209 ssleep(1); 209 ssleep(1);
210 return 0; 210 return 0;
diff --git a/drivers/net/sky2.c b/drivers/net/sky2.c
index 2ab5c39f33ca..6a10d7ba5877 100644
--- a/drivers/net/sky2.c
+++ b/drivers/net/sky2.c
@@ -4538,6 +4538,8 @@ static int __devinit sky2_probe(struct pci_dev *pdev,
4538 goto err_out_free_netdev; 4538 goto err_out_free_netdev;
4539 } 4539 }
4540 4540
4541 netif_carrier_off(dev);
4542
4541 netif_napi_add(dev, &hw->napi, sky2_poll, NAPI_WEIGHT); 4543 netif_napi_add(dev, &hw->napi, sky2_poll, NAPI_WEIGHT);
4542 4544
4543 err = request_irq(pdev->irq, sky2_intr, 4545 err = request_irq(pdev->irq, sky2_intr,
diff --git a/drivers/net/smc91x.c b/drivers/net/smc91x.c
index 05c91ee6921e..f12206bdbb75 100644
--- a/drivers/net/smc91x.c
+++ b/drivers/net/smc91x.c
@@ -2283,7 +2283,7 @@ static int __devinit smc_drv_probe(struct platform_device *pdev)
2283 2283
2284 ndev->irq = ires->start; 2284 ndev->irq = ires->start;
2285 2285
2286 if (ires->flags & IRQF_TRIGGER_MASK) 2286 if (irq_flags == -1 || ires->flags & IRQF_TRIGGER_MASK)
2287 irq_flags = ires->flags & IRQF_TRIGGER_MASK; 2287 irq_flags = ires->flags & IRQF_TRIGGER_MASK;
2288 2288
2289 ret = smc_request_attrib(pdev, ndev); 2289 ret = smc_request_attrib(pdev, ndev);
diff --git a/drivers/net/smsc911x.c b/drivers/net/smsc911x.c
index ccdd196f5297..f9cdcbcb77d4 100644
--- a/drivers/net/smsc911x.c
+++ b/drivers/net/smsc911x.c
@@ -986,7 +986,7 @@ static int smsc911x_poll(struct napi_struct *napi, int budget)
986 struct net_device *dev = pdata->dev; 986 struct net_device *dev = pdata->dev;
987 int npackets = 0; 987 int npackets = 0;
988 988
989 while (likely(netif_running(dev)) && (npackets < budget)) { 989 while (npackets < budget) {
990 unsigned int pktlength; 990 unsigned int pktlength;
991 unsigned int pktwords; 991 unsigned int pktwords;
992 struct sk_buff *skb; 992 struct sk_buff *skb;
diff --git a/drivers/net/smsc9420.c b/drivers/net/smsc9420.c
index b4909a2dec66..0f7909276237 100644
--- a/drivers/net/smsc9420.c
+++ b/drivers/net/smsc9420.c
@@ -252,6 +252,9 @@ static int smsc9420_ethtool_get_settings(struct net_device *dev,
252{ 252{
253 struct smsc9420_pdata *pd = netdev_priv(dev); 253 struct smsc9420_pdata *pd = netdev_priv(dev);
254 254
255 if (!pd->phy_dev)
256 return -ENODEV;
257
255 cmd->maxtxpkt = 1; 258 cmd->maxtxpkt = 1;
256 cmd->maxrxpkt = 1; 259 cmd->maxrxpkt = 1;
257 return phy_ethtool_gset(pd->phy_dev, cmd); 260 return phy_ethtool_gset(pd->phy_dev, cmd);
@@ -262,6 +265,9 @@ static int smsc9420_ethtool_set_settings(struct net_device *dev,
262{ 265{
263 struct smsc9420_pdata *pd = netdev_priv(dev); 266 struct smsc9420_pdata *pd = netdev_priv(dev);
264 267
268 if (!pd->phy_dev)
269 return -ENODEV;
270
265 return phy_ethtool_sset(pd->phy_dev, cmd); 271 return phy_ethtool_sset(pd->phy_dev, cmd);
266} 272}
267 273
@@ -290,6 +296,10 @@ static void smsc9420_ethtool_set_msglevel(struct net_device *netdev, u32 data)
290static int smsc9420_ethtool_nway_reset(struct net_device *netdev) 296static int smsc9420_ethtool_nway_reset(struct net_device *netdev)
291{ 297{
292 struct smsc9420_pdata *pd = netdev_priv(netdev); 298 struct smsc9420_pdata *pd = netdev_priv(netdev);
299
300 if (!pd->phy_dev)
301 return -ENODEV;
302
293 return phy_start_aneg(pd->phy_dev); 303 return phy_start_aneg(pd->phy_dev);
294} 304}
295 305
@@ -312,6 +322,10 @@ smsc9420_ethtool_getregs(struct net_device *dev, struct ethtool_regs *regs,
312 for (i = 0; i < 0x100; i += (sizeof(u32))) 322 for (i = 0; i < 0x100; i += (sizeof(u32)))
313 data[j++] = smsc9420_reg_read(pd, i); 323 data[j++] = smsc9420_reg_read(pd, i);
314 324
325 // cannot read phy registers if the net device is down
326 if (!phy_dev)
327 return;
328
315 for (i = 0; i <= 31; i++) 329 for (i = 0; i <= 31; i++)
316 data[j++] = smsc9420_mii_read(phy_dev->bus, phy_dev->addr, i); 330 data[j++] = smsc9420_mii_read(phy_dev->bus, phy_dev->addr, i);
317} 331}
diff --git a/drivers/net/stmmac/stmmac_main.c b/drivers/net/stmmac/stmmac_main.c
index c2f14dc9ba28..9542995ba667 100644
--- a/drivers/net/stmmac/stmmac_main.c
+++ b/drivers/net/stmmac/stmmac_main.c
@@ -416,13 +416,8 @@ static void init_dma_desc_rings(struct net_device *dev)
416 unsigned int txsize = priv->dma_tx_size; 416 unsigned int txsize = priv->dma_tx_size;
417 unsigned int rxsize = priv->dma_rx_size; 417 unsigned int rxsize = priv->dma_rx_size;
418 unsigned int bfsize = priv->dma_buf_sz; 418 unsigned int bfsize = priv->dma_buf_sz;
419 int buff2_needed = 0; 419 int buff2_needed = 0, dis_ic = 0;
420 int dis_ic = 0;
421 420
422#ifdef CONFIG_STMMAC_TIMER
423 /* Using Timers disable interrupts on completion for the reception */
424 dis_ic = 1;
425#endif
426 /* Set the Buffer size according to the MTU; 421 /* Set the Buffer size according to the MTU;
427 * indeed, in case of jumbo we need to bump-up the buffer sizes. 422 * indeed, in case of jumbo we need to bump-up the buffer sizes.
428 */ 423 */
@@ -437,6 +432,11 @@ static void init_dma_desc_rings(struct net_device *dev)
437 else 432 else
438 bfsize = DMA_BUFFER_SIZE; 433 bfsize = DMA_BUFFER_SIZE;
439 434
435#ifdef CONFIG_STMMAC_TIMER
436 /* Disable interrupts on completion for the reception if timer is on */
437 if (likely(priv->tm->enable))
438 dis_ic = 1;
439#endif
440 /* If the MTU exceeds 8k so use the second buffer in the chain */ 440 /* If the MTU exceeds 8k so use the second buffer in the chain */
441 if (bfsize >= BUF_SIZE_8KiB) 441 if (bfsize >= BUF_SIZE_8KiB)
442 buff2_needed = 1; 442 buff2_needed = 1;
@@ -809,20 +809,22 @@ static void stmmac_tx(struct stmmac_priv *priv)
809 809
810static inline void stmmac_enable_irq(struct stmmac_priv *priv) 810static inline void stmmac_enable_irq(struct stmmac_priv *priv)
811{ 811{
812#ifndef CONFIG_STMMAC_TIMER 812#ifdef CONFIG_STMMAC_TIMER
813 writel(DMA_INTR_DEFAULT_MASK, priv->dev->base_addr + DMA_INTR_ENA); 813 if (likely(priv->tm->enable))
814#else 814 priv->tm->timer_start(tmrate);
815 priv->tm->timer_start(tmrate); 815 else
816#endif 816#endif
817 writel(DMA_INTR_DEFAULT_MASK, priv->dev->base_addr + DMA_INTR_ENA);
817} 818}
818 819
819static inline void stmmac_disable_irq(struct stmmac_priv *priv) 820static inline void stmmac_disable_irq(struct stmmac_priv *priv)
820{ 821{
821#ifndef CONFIG_STMMAC_TIMER 822#ifdef CONFIG_STMMAC_TIMER
822 writel(0, priv->dev->base_addr + DMA_INTR_ENA); 823 if (likely(priv->tm->enable))
823#else 824 priv->tm->timer_stop();
824 priv->tm->timer_stop(); 825 else
825#endif 826#endif
827 writel(0, priv->dev->base_addr + DMA_INTR_ENA);
826} 828}
827 829
828static int stmmac_has_work(struct stmmac_priv *priv) 830static int stmmac_has_work(struct stmmac_priv *priv)
@@ -1031,22 +1033,23 @@ static int stmmac_open(struct net_device *dev)
1031 } 1033 }
1032 1034
1033#ifdef CONFIG_STMMAC_TIMER 1035#ifdef CONFIG_STMMAC_TIMER
1034 priv->tm = kmalloc(sizeof(struct stmmac_timer *), GFP_KERNEL); 1036 priv->tm = kzalloc(sizeof(struct stmmac_timer *), GFP_KERNEL);
1035 if (unlikely(priv->tm == NULL)) { 1037 if (unlikely(priv->tm == NULL)) {
1036 pr_err("%s: ERROR: timer memory alloc failed \n", __func__); 1038 pr_err("%s: ERROR: timer memory alloc failed \n", __func__);
1037 return -ENOMEM; 1039 return -ENOMEM;
1038 } 1040 }
1039 priv->tm->freq = tmrate; 1041 priv->tm->freq = tmrate;
1040 1042
1041 /* Test if the HW timer can be actually used. 1043 /* Test if the external timer can be actually used.
1042 * In case of failure continue with no timer. */ 1044 * In case of failure continue without timer. */
1043 if (unlikely((stmmac_open_ext_timer(dev, priv->tm)) < 0)) { 1045 if (unlikely((stmmac_open_ext_timer(dev, priv->tm)) < 0)) {
1044 pr_warning("stmmaceth: cannot attach the HW timer\n"); 1046 pr_warning("stmmaceth: cannot attach the external timer.\n");
1045 tmrate = 0; 1047 tmrate = 0;
1046 priv->tm->freq = 0; 1048 priv->tm->freq = 0;
1047 priv->tm->timer_start = stmmac_no_timer_started; 1049 priv->tm->timer_start = stmmac_no_timer_started;
1048 priv->tm->timer_stop = stmmac_no_timer_stopped; 1050 priv->tm->timer_stop = stmmac_no_timer_stopped;
1049 } 1051 } else
1052 priv->tm->enable = 1;
1050#endif 1053#endif
1051 1054
1052 /* Create and initialize the TX/RX descriptors chains. */ 1055 /* Create and initialize the TX/RX descriptors chains. */
@@ -1322,9 +1325,11 @@ static netdev_tx_t stmmac_xmit(struct sk_buff *skb, struct net_device *dev)
1322 1325
1323 /* Interrupt on completition only for the latest segment */ 1326 /* Interrupt on completition only for the latest segment */
1324 priv->mac_type->ops->close_tx_desc(desc); 1327 priv->mac_type->ops->close_tx_desc(desc);
1328
1325#ifdef CONFIG_STMMAC_TIMER 1329#ifdef CONFIG_STMMAC_TIMER
1326 /* Clean IC while using timers */ 1330 /* Clean IC while using timer */
1327 priv->mac_type->ops->clear_tx_ic(desc); 1331 if (likely(priv->tm->enable))
1332 priv->mac_type->ops->clear_tx_ic(desc);
1328#endif 1333#endif
1329 /* To avoid raise condition */ 1334 /* To avoid raise condition */
1330 priv->mac_type->ops->set_tx_owner(first); 1335 priv->mac_type->ops->set_tx_owner(first);
@@ -2028,7 +2033,8 @@ static int stmmac_suspend(struct platform_device *pdev, pm_message_t state)
2028 2033
2029#ifdef CONFIG_STMMAC_TIMER 2034#ifdef CONFIG_STMMAC_TIMER
2030 priv->tm->timer_stop(); 2035 priv->tm->timer_stop();
2031 dis_ic = 1; 2036 if (likely(priv->tm->enable))
2037 dis_ic = 1;
2032#endif 2038#endif
2033 napi_disable(&priv->napi); 2039 napi_disable(&priv->napi);
2034 2040
diff --git a/drivers/net/stmmac/stmmac_timer.c b/drivers/net/stmmac/stmmac_timer.c
index b838c6582077..679f61ffb1f8 100644
--- a/drivers/net/stmmac/stmmac_timer.c
+++ b/drivers/net/stmmac/stmmac_timer.c
@@ -63,7 +63,7 @@ int stmmac_open_ext_timer(struct net_device *dev, struct stmmac_timer *tm)
63 63
64 stmmac_rtc = rtc_class_open(CONFIG_RTC_HCTOSYS_DEVICE); 64 stmmac_rtc = rtc_class_open(CONFIG_RTC_HCTOSYS_DEVICE);
65 if (stmmac_rtc == NULL) { 65 if (stmmac_rtc == NULL) {
66 pr_error("open rtc device failed\n"); 66 pr_err("open rtc device failed\n");
67 return -ENODEV; 67 return -ENODEV;
68 } 68 }
69 69
@@ -71,7 +71,7 @@ int stmmac_open_ext_timer(struct net_device *dev, struct stmmac_timer *tm)
71 71
72 /* Periodic mode is not supported */ 72 /* Periodic mode is not supported */
73 if ((rtc_irq_set_freq(stmmac_rtc, &stmmac_task, tm->freq) < 0)) { 73 if ((rtc_irq_set_freq(stmmac_rtc, &stmmac_task, tm->freq) < 0)) {
74 pr_error("set periodic failed\n"); 74 pr_err("set periodic failed\n");
75 rtc_irq_unregister(stmmac_rtc, &stmmac_task); 75 rtc_irq_unregister(stmmac_rtc, &stmmac_task);
76 rtc_class_close(stmmac_rtc); 76 rtc_class_close(stmmac_rtc);
77 return -1; 77 return -1;
diff --git a/drivers/net/stmmac/stmmac_timer.h b/drivers/net/stmmac/stmmac_timer.h
index f795cae33725..6863590d184b 100644
--- a/drivers/net/stmmac/stmmac_timer.h
+++ b/drivers/net/stmmac/stmmac_timer.h
@@ -26,6 +26,7 @@ struct stmmac_timer {
26 void (*timer_start) (unsigned int new_freq); 26 void (*timer_start) (unsigned int new_freq);
27 void (*timer_stop) (void); 27 void (*timer_stop) (void);
28 unsigned int freq; 28 unsigned int freq;
29 unsigned int enable;
29}; 30};
30 31
31/* Open the HW timer device and return 0 in case of success */ 32/* Open the HW timer device and return 0 in case of success */
diff --git a/drivers/net/sungem.c b/drivers/net/sungem.c
index 7019a0d1a82b..61640b99b705 100644
--- a/drivers/net/sungem.c
+++ b/drivers/net/sungem.c
@@ -2063,7 +2063,15 @@ static int gem_check_invariants(struct gem *gp)
2063 mif_cfg &= ~MIF_CFG_PSELECT; 2063 mif_cfg &= ~MIF_CFG_PSELECT;
2064 writel(mif_cfg, gp->regs + MIF_CFG); 2064 writel(mif_cfg, gp->regs + MIF_CFG);
2065 } else { 2065 } else {
2066 gp->phy_type = phy_serialink; 2066#ifdef CONFIG_SPARC
2067 const char *p;
2068
2069 p = of_get_property(gp->of_node, "shared-pins", NULL);
2070 if (p && !strcmp(p, "serdes"))
2071 gp->phy_type = phy_serdes;
2072 else
2073#endif
2074 gp->phy_type = phy_serialink;
2067 } 2075 }
2068 if (gp->phy_type == phy_mii_mdio1 || 2076 if (gp->phy_type == phy_mii_mdio1 ||
2069 gp->phy_type == phy_mii_mdio0) { 2077 gp->phy_type == phy_mii_mdio0) {
diff --git a/drivers/net/tokenring/ibmtr.c b/drivers/net/tokenring/ibmtr.c
index 36cb2423bcf1..75fa32e34fd0 100644
--- a/drivers/net/tokenring/ibmtr.c
+++ b/drivers/net/tokenring/ibmtr.c
@@ -1144,9 +1144,16 @@ static void dir_open_adapter (struct net_device *dev)
1144 } else { 1144 } else {
1145 char **prphase = printphase; 1145 char **prphase = printphase;
1146 char **prerror = printerror; 1146 char **prerror = printerror;
1147 int pnr = err / 16 - 1;
1148 int enr = err % 16 - 1;
1147 DPRINTK("TR Adapter misc open failure, error code = "); 1149 DPRINTK("TR Adapter misc open failure, error code = ");
1148 printk("0x%x, Phase: %s, Error: %s\n", 1150 if (pnr < 0 || pnr >= ARRAY_SIZE(printphase) ||
1149 err, prphase[err/16 -1], prerror[err%16 -1]); 1151 enr < 0 ||
1152 enr >= ARRAY_SIZE(printerror))
1153 printk("0x%x, invalid Phase/Error.", err);
1154 else
1155 printk("0x%x, Phase: %s, Error: %s\n", err,
1156 prphase[pnr], prerror[enr]);
1150 printk(" retrying after %ds delay...\n", 1157 printk(" retrying after %ds delay...\n",
1151 TR_RETRY_INTERVAL/HZ); 1158 TR_RETRY_INTERVAL/HZ);
1152 } 1159 }
diff --git a/drivers/net/usb/Kconfig b/drivers/net/usb/Kconfig
index c47237c2d638..32d93564a74d 100644
--- a/drivers/net/usb/Kconfig
+++ b/drivers/net/usb/Kconfig
@@ -174,7 +174,7 @@ config USB_NET_CDCETHER
174 * Ericsson Mobile Broadband Module (all variants) 174 * Ericsson Mobile Broadband Module (all variants)
175 * Motorola (DM100 and SB4100) 175 * Motorola (DM100 and SB4100)
176 * Broadcom Cable Modem (reference design) 176 * Broadcom Cable Modem (reference design)
177 * Toshiba (PCX1100U and F3507g) 177 * Toshiba (PCX1100U and F3507g/F3607gw)
178 * ... 178 * ...
179 179
180 This driver creates an interface named "ethX", where X depends on 180 This driver creates an interface named "ethX", where X depends on
diff --git a/drivers/net/usb/cdc_ether.c b/drivers/net/usb/cdc_ether.c
index 4a6aff579403..21e1ba160008 100644
--- a/drivers/net/usb/cdc_ether.c
+++ b/drivers/net/usb/cdc_ether.c
@@ -544,20 +544,60 @@ static const struct usb_device_id products [] = {
544 USB_CDC_SUBCLASS_MDLM, USB_CDC_PROTO_NONE), 544 USB_CDC_SUBCLASS_MDLM, USB_CDC_PROTO_NONE),
545 .driver_info = (unsigned long) &cdc_info, 545 .driver_info = (unsigned long) &cdc_info,
546}, { 546}, {
547 /* Ericsson F3307 */ 547 /* Ericsson F3607gw ver 2 */
548 USB_DEVICE_AND_INTERFACE_INFO(0x0bdb, 0x1905, USB_CLASS_COMM,
549 USB_CDC_SUBCLASS_MDLM, USB_CDC_PROTO_NONE),
550 .driver_info = (unsigned long) &cdc_info,
551}, {
552 /* Ericsson F3607gw ver 3 */
548 USB_DEVICE_AND_INTERFACE_INFO(0x0bdb, 0x1906, USB_CLASS_COMM, 553 USB_DEVICE_AND_INTERFACE_INFO(0x0bdb, 0x1906, USB_CLASS_COMM,
549 USB_CDC_SUBCLASS_MDLM, USB_CDC_PROTO_NONE), 554 USB_CDC_SUBCLASS_MDLM, USB_CDC_PROTO_NONE),
550 .driver_info = (unsigned long) &cdc_info, 555 .driver_info = (unsigned long) &cdc_info,
551}, { 556}, {
557 /* Ericsson F3307 */
558 USB_DEVICE_AND_INTERFACE_INFO(0x0bdb, 0x190a, USB_CLASS_COMM,
559 USB_CDC_SUBCLASS_MDLM, USB_CDC_PROTO_NONE),
560 .driver_info = (unsigned long) &cdc_info,
561}, {
562 /* Ericsson F3307 ver 2 */
563 USB_DEVICE_AND_INTERFACE_INFO(0x0bdb, 0x1909, USB_CLASS_COMM,
564 USB_CDC_SUBCLASS_MDLM, USB_CDC_PROTO_NONE),
565 .driver_info = (unsigned long) &cdc_info,
566}, {
567 /* Ericsson C3607w */
568 USB_DEVICE_AND_INTERFACE_INFO(0x0bdb, 0x1049, USB_CLASS_COMM,
569 USB_CDC_SUBCLASS_MDLM, USB_CDC_PROTO_NONE),
570 .driver_info = (unsigned long) &cdc_info,
571}, {
552 /* Toshiba F3507g */ 572 /* Toshiba F3507g */
553 USB_DEVICE_AND_INTERFACE_INFO(0x0930, 0x130b, USB_CLASS_COMM, 573 USB_DEVICE_AND_INTERFACE_INFO(0x0930, 0x130b, USB_CLASS_COMM,
554 USB_CDC_SUBCLASS_MDLM, USB_CDC_PROTO_NONE), 574 USB_CDC_SUBCLASS_MDLM, USB_CDC_PROTO_NONE),
555 .driver_info = (unsigned long) &cdc_info, 575 .driver_info = (unsigned long) &cdc_info,
556}, { 576}, {
577 /* Toshiba F3607gw */
578 USB_DEVICE_AND_INTERFACE_INFO(0x0930, 0x130c, USB_CLASS_COMM,
579 USB_CDC_SUBCLASS_MDLM, USB_CDC_PROTO_NONE),
580 .driver_info = (unsigned long) &cdc_info,
581}, {
582 /* Toshiba F3607gw ver 2 */
583 USB_DEVICE_AND_INTERFACE_INFO(0x0930, 0x1311, USB_CLASS_COMM,
584 USB_CDC_SUBCLASS_MDLM, USB_CDC_PROTO_NONE),
585 .driver_info = (unsigned long) &cdc_info,
586}, {
557 /* Dell F3507g */ 587 /* Dell F3507g */
558 USB_DEVICE_AND_INTERFACE_INFO(0x413c, 0x8147, USB_CLASS_COMM, 588 USB_DEVICE_AND_INTERFACE_INFO(0x413c, 0x8147, USB_CLASS_COMM,
559 USB_CDC_SUBCLASS_MDLM, USB_CDC_PROTO_NONE), 589 USB_CDC_SUBCLASS_MDLM, USB_CDC_PROTO_NONE),
560 .driver_info = (unsigned long) &cdc_info, 590 .driver_info = (unsigned long) &cdc_info,
591}, {
592 /* Dell F3607gw */
593 USB_DEVICE_AND_INTERFACE_INFO(0x413c, 0x8183, USB_CLASS_COMM,
594 USB_CDC_SUBCLASS_MDLM, USB_CDC_PROTO_NONE),
595 .driver_info = (unsigned long) &cdc_info,
596}, {
597 /* Dell F3607gw ver 2 */
598 USB_DEVICE_AND_INTERFACE_INFO(0x413c, 0x8184, USB_CLASS_COMM,
599 USB_CDC_SUBCLASS_MDLM, USB_CDC_PROTO_NONE),
600 .driver_info = (unsigned long) &cdc_info,
561}, 601},
562 { }, // END 602 { }, // END
563}; 603};
diff --git a/drivers/net/usb/hso.c b/drivers/net/usb/hso.c
index fa4e58196c21..43bc3fcc0d85 100644
--- a/drivers/net/usb/hso.c
+++ b/drivers/net/usb/hso.c
@@ -378,7 +378,7 @@ static void dbg_dump(int line_count, const char *func_name, unsigned char *buf,
378} 378}
379 379
380#define DUMP(buf_, len_) \ 380#define DUMP(buf_, len_) \
381 dbg_dump(__LINE__, __func__, buf_, len_) 381 dbg_dump(__LINE__, __func__, (unsigned char *)buf_, len_)
382 382
383#define DUMP1(buf_, len_) \ 383#define DUMP1(buf_, len_) \
384 do { \ 384 do { \
@@ -1363,7 +1363,7 @@ static void hso_serial_close(struct tty_struct *tty, struct file *filp)
1363 /* reset the rts and dtr */ 1363 /* reset the rts and dtr */
1364 /* do the actual close */ 1364 /* do the actual close */
1365 serial->open_count--; 1365 serial->open_count--;
1366 kref_put(&serial->parent->ref, hso_serial_ref_free); 1366
1367 if (serial->open_count <= 0) { 1367 if (serial->open_count <= 0) {
1368 serial->open_count = 0; 1368 serial->open_count = 0;
1369 spin_lock_irq(&serial->serial_lock); 1369 spin_lock_irq(&serial->serial_lock);
@@ -1383,6 +1383,8 @@ static void hso_serial_close(struct tty_struct *tty, struct file *filp)
1383 usb_autopm_put_interface(serial->parent->interface); 1383 usb_autopm_put_interface(serial->parent->interface);
1384 1384
1385 mutex_unlock(&serial->parent->mutex); 1385 mutex_unlock(&serial->parent->mutex);
1386
1387 kref_put(&serial->parent->ref, hso_serial_ref_free);
1386} 1388}
1387 1389
1388/* close the requested serial port */ 1390/* close the requested serial port */
@@ -1527,7 +1529,7 @@ static void tiocmget_intr_callback(struct urb *urb)
1527 dev_warn(&usb->dev, 1529 dev_warn(&usb->dev,
1528 "hso received invalid serial state notification\n"); 1530 "hso received invalid serial state notification\n");
1529 DUMP(serial_state_notification, 1531 DUMP(serial_state_notification,
1530 sizeof(hso_serial_state_notifation)) 1532 sizeof(struct hso_serial_state_notification));
1531 } else { 1533 } else {
1532 1534
1533 UART_state_bitmap = le16_to_cpu(serial_state_notification-> 1535 UART_state_bitmap = le16_to_cpu(serial_state_notification->
diff --git a/drivers/net/veth.c b/drivers/net/veth.c
index ade5b344f75d..52af5017c46b 100644
--- a/drivers/net/veth.c
+++ b/drivers/net/veth.c
@@ -210,32 +210,29 @@ rx_drop:
210static struct net_device_stats *veth_get_stats(struct net_device *dev) 210static struct net_device_stats *veth_get_stats(struct net_device *dev)
211{ 211{
212 struct veth_priv *priv; 212 struct veth_priv *priv;
213 struct net_device_stats *dev_stats;
214 int cpu; 213 int cpu;
215 struct veth_net_stats *stats; 214 struct veth_net_stats *stats, total = {0};
216 215
217 priv = netdev_priv(dev); 216 priv = netdev_priv(dev);
218 dev_stats = &dev->stats;
219
220 dev_stats->rx_packets = 0;
221 dev_stats->tx_packets = 0;
222 dev_stats->rx_bytes = 0;
223 dev_stats->tx_bytes = 0;
224 dev_stats->tx_dropped = 0;
225 dev_stats->rx_dropped = 0;
226 217
227 for_each_online_cpu(cpu) { 218 for_each_possible_cpu(cpu) {
228 stats = per_cpu_ptr(priv->stats, cpu); 219 stats = per_cpu_ptr(priv->stats, cpu);
229 220
230 dev_stats->rx_packets += stats->rx_packets; 221 total.rx_packets += stats->rx_packets;
231 dev_stats->tx_packets += stats->tx_packets; 222 total.tx_packets += stats->tx_packets;
232 dev_stats->rx_bytes += stats->rx_bytes; 223 total.rx_bytes += stats->rx_bytes;
233 dev_stats->tx_bytes += stats->tx_bytes; 224 total.tx_bytes += stats->tx_bytes;
234 dev_stats->tx_dropped += stats->tx_dropped; 225 total.tx_dropped += stats->tx_dropped;
235 dev_stats->rx_dropped += stats->rx_dropped; 226 total.rx_dropped += stats->rx_dropped;
236 } 227 }
237 228 dev->stats.rx_packets = total.rx_packets;
238 return dev_stats; 229 dev->stats.tx_packets = total.tx_packets;
230 dev->stats.rx_bytes = total.rx_bytes;
231 dev->stats.tx_bytes = total.tx_bytes;
232 dev->stats.tx_dropped = total.tx_dropped;
233 dev->stats.rx_dropped = total.rx_dropped;
234
235 return &dev->stats;
239} 236}
240 237
241static int veth_open(struct net_device *dev) 238static int veth_open(struct net_device *dev)
diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c
index 05630f2f6930..b9e002fccbca 100644
--- a/drivers/net/virtio_net.c
+++ b/drivers/net/virtio_net.c
@@ -998,7 +998,7 @@ static unsigned int features[] = {
998 VIRTIO_NET_F_CTRL_RX, VIRTIO_NET_F_CTRL_VLAN, 998 VIRTIO_NET_F_CTRL_RX, VIRTIO_NET_F_CTRL_VLAN,
999}; 999};
1000 1000
1001static struct virtio_driver virtio_net = { 1001static struct virtio_driver virtio_net_driver = {
1002 .feature_table = features, 1002 .feature_table = features,
1003 .feature_table_size = ARRAY_SIZE(features), 1003 .feature_table_size = ARRAY_SIZE(features),
1004 .driver.name = KBUILD_MODNAME, 1004 .driver.name = KBUILD_MODNAME,
@@ -1011,12 +1011,12 @@ static struct virtio_driver virtio_net = {
1011 1011
1012static int __init init(void) 1012static int __init init(void)
1013{ 1013{
1014 return register_virtio_driver(&virtio_net); 1014 return register_virtio_driver(&virtio_net_driver);
1015} 1015}
1016 1016
1017static void __exit fini(void) 1017static void __exit fini(void)
1018{ 1018{
1019 unregister_virtio_driver(&virtio_net); 1019 unregister_virtio_driver(&virtio_net_driver);
1020} 1020}
1021module_init(init); 1021module_init(init);
1022module_exit(fini); 1022module_exit(fini);
diff --git a/drivers/net/wan/cosa.c b/drivers/net/wan/cosa.c
index e2c33c06190b..8e25ca7080c7 100644
--- a/drivers/net/wan/cosa.c
+++ b/drivers/net/wan/cosa.c
@@ -907,6 +907,7 @@ static ssize_t cosa_write(struct file *file,
907 current->state = TASK_RUNNING; 907 current->state = TASK_RUNNING;
908 chan->tx_status = 1; 908 chan->tx_status = 1;
909 spin_unlock_irqrestore(&cosa->lock, flags); 909 spin_unlock_irqrestore(&cosa->lock, flags);
910 up(&chan->wsem);
910 return -ERESTARTSYS; 911 return -ERESTARTSYS;
911 } 912 }
912 } 913 }
diff --git a/drivers/net/wireless/airo_cs.c b/drivers/net/wireless/airo_cs.c
index d0593ed9170e..f6036fb42319 100644
--- a/drivers/net/wireless/airo_cs.c
+++ b/drivers/net/wireless/airo_cs.c
@@ -43,21 +43,6 @@
43 43
44#include "airo.h" 44#include "airo.h"
45 45
46/*
47 All the PCMCIA modules use PCMCIA_DEBUG to control debugging. If
48 you do not define PCMCIA_DEBUG at all, all the debug code will be
49 left out. If you compile with PCMCIA_DEBUG=0, the debug code will
50 be present but disabled -- but it can then be enabled for specific
51 modules at load time with a 'pc_debug=#' option to insmod.
52*/
53#ifdef PCMCIA_DEBUG
54static int pc_debug = PCMCIA_DEBUG;
55module_param(pc_debug, int, 0);
56static char *version = "$Revision: 1.2 $";
57#define DEBUG(n, args...) if (pc_debug > (n)) printk(KERN_DEBUG args);
58#else
59#define DEBUG(n, args...)
60#endif
61 46
62/*====================================================================*/ 47/*====================================================================*/
63 48
@@ -145,11 +130,10 @@ static int airo_probe(struct pcmcia_device *p_dev)
145{ 130{
146 local_info_t *local; 131 local_info_t *local;
147 132
148 DEBUG(0, "airo_attach()\n"); 133 dev_dbg(&p_dev->dev, "airo_attach()\n");
149 134
150 /* Interrupt setup */ 135 /* Interrupt setup */
151 p_dev->irq.Attributes = IRQ_TYPE_DYNAMIC_SHARING; 136 p_dev->irq.Attributes = IRQ_TYPE_DYNAMIC_SHARING;
152 p_dev->irq.IRQInfo1 = IRQ_LEVEL_ID;
153 p_dev->irq.Handler = NULL; 137 p_dev->irq.Handler = NULL;
154 138
155 /* 139 /*
@@ -184,7 +168,7 @@ static int airo_probe(struct pcmcia_device *p_dev)
184 168
185static void airo_detach(struct pcmcia_device *link) 169static void airo_detach(struct pcmcia_device *link)
186{ 170{
187 DEBUG(0, "airo_detach(0x%p)\n", link); 171 dev_dbg(&link->dev, "airo_detach\n");
188 172
189 airo_release(link); 173 airo_release(link);
190 174
@@ -204,9 +188,6 @@ static void airo_detach(struct pcmcia_device *link)
204 188
205 ======================================================================*/ 189 ======================================================================*/
206 190
207#define CS_CHECK(fn, ret) \
208do { last_fn = (fn); if ((last_ret = (ret)) != 0) goto cs_failed; } while (0)
209
210static int airo_cs_config_check(struct pcmcia_device *p_dev, 191static int airo_cs_config_check(struct pcmcia_device *p_dev,
211 cistpl_cftable_entry_t *cfg, 192 cistpl_cftable_entry_t *cfg,
212 cistpl_cftable_entry_t *dflt, 193 cistpl_cftable_entry_t *dflt,
@@ -275,11 +256,11 @@ static int airo_cs_config_check(struct pcmcia_device *p_dev,
275 req->Base = mem->win[0].host_addr; 256 req->Base = mem->win[0].host_addr;
276 req->Size = mem->win[0].len; 257 req->Size = mem->win[0].len;
277 req->AccessSpeed = 0; 258 req->AccessSpeed = 0;
278 if (pcmcia_request_window(&p_dev, req, &p_dev->win) != 0) 259 if (pcmcia_request_window(p_dev, req, &p_dev->win) != 0)
279 return -ENODEV; 260 return -ENODEV;
280 map.Page = 0; 261 map.Page = 0;
281 map.CardOffset = mem->win[0].card_addr; 262 map.CardOffset = mem->win[0].card_addr;
282 if (pcmcia_map_mem_page(p_dev->win, &map) != 0) 263 if (pcmcia_map_mem_page(p_dev, p_dev->win, &map) != 0)
283 return -ENODEV; 264 return -ENODEV;
284 } 265 }
285 /* If we got this far, we're cool! */ 266 /* If we got this far, we're cool! */
@@ -291,11 +272,11 @@ static int airo_config(struct pcmcia_device *link)
291{ 272{
292 local_info_t *dev; 273 local_info_t *dev;
293 win_req_t *req; 274 win_req_t *req;
294 int last_fn, last_ret; 275 int ret;
295 276
296 dev = link->priv; 277 dev = link->priv;
297 278
298 DEBUG(0, "airo_config(0x%p)\n", link); 279 dev_dbg(&link->dev, "airo_config\n");
299 280
300 req = kzalloc(sizeof(win_req_t), GFP_KERNEL); 281 req = kzalloc(sizeof(win_req_t), GFP_KERNEL);
301 if (!req) 282 if (!req)
@@ -315,8 +296,8 @@ static int airo_config(struct pcmcia_device *link)
315 * and most client drivers will only use the CIS to fill in 296 * and most client drivers will only use the CIS to fill in
316 * implementation-defined details. 297 * implementation-defined details.
317 */ 298 */
318 last_ret = pcmcia_loop_config(link, airo_cs_config_check, req); 299 ret = pcmcia_loop_config(link, airo_cs_config_check, req);
319 if (last_ret) 300 if (ret)
320 goto failed; 301 goto failed;
321 302
322 /* 303 /*
@@ -324,21 +305,25 @@ static int airo_config(struct pcmcia_device *link)
324 handler to the interrupt, unless the 'Handler' member of the 305 handler to the interrupt, unless the 'Handler' member of the
325 irq structure is initialized. 306 irq structure is initialized.
326 */ 307 */
327 if (link->conf.Attributes & CONF_ENABLE_IRQ) 308 if (link->conf.Attributes & CONF_ENABLE_IRQ) {
328 CS_CHECK(RequestIRQ, pcmcia_request_irq(link, &link->irq)); 309 ret = pcmcia_request_irq(link, &link->irq);
310 if (ret)
311 goto failed;
312 }
329 313
330 /* 314 /*
331 This actually configures the PCMCIA socket -- setting up 315 This actually configures the PCMCIA socket -- setting up
332 the I/O windows and the interrupt mapping, and putting the 316 the I/O windows and the interrupt mapping, and putting the
333 card and host interface into "Memory and IO" mode. 317 card and host interface into "Memory and IO" mode.
334 */ 318 */
335 CS_CHECK(RequestConfiguration, 319 ret = pcmcia_request_configuration(link, &link->conf);
336 pcmcia_request_configuration(link, &link->conf)); 320 if (ret)
321 goto failed;
337 ((local_info_t *)link->priv)->eth_dev = 322 ((local_info_t *)link->priv)->eth_dev =
338 init_airo_card(link->irq.AssignedIRQ, 323 init_airo_card(link->irq.AssignedIRQ,
339 link->io.BasePort1, 1, &handle_to_dev(link)); 324 link->io.BasePort1, 1, &link->dev);
340 if (!((local_info_t *)link->priv)->eth_dev) 325 if (!((local_info_t *)link->priv)->eth_dev)
341 goto cs_failed; 326 goto failed;
342 327
343 /* 328 /*
344 At this point, the dev_node_t structure(s) need to be 329 At this point, the dev_node_t structure(s) need to be
@@ -368,8 +353,6 @@ static int airo_config(struct pcmcia_device *link)
368 kfree(req); 353 kfree(req);
369 return 0; 354 return 0;
370 355
371 cs_failed:
372 cs_error(link, last_fn, last_ret);
373 failed: 356 failed:
374 airo_release(link); 357 airo_release(link);
375 kfree(req); 358 kfree(req);
@@ -386,7 +369,7 @@ static int airo_config(struct pcmcia_device *link)
386 369
387static void airo_release(struct pcmcia_device *link) 370static void airo_release(struct pcmcia_device *link)
388{ 371{
389 DEBUG(0, "airo_release(0x%p)\n", link); 372 dev_dbg(&link->dev, "airo_release\n");
390 pcmcia_disable_device(link); 373 pcmcia_disable_device(link);
391} 374}
392 375
diff --git a/drivers/net/wireless/ath/ath5k/base.c b/drivers/net/wireless/ath/ath5k/base.c
index 9c6ab5378f6e..95a8e232b58f 100644
--- a/drivers/net/wireless/ath/ath5k/base.c
+++ b/drivers/net/wireless/ath/ath5k/base.c
@@ -1125,7 +1125,6 @@ ath5k_mode_setup(struct ath5k_softc *sc)
1125 /* configure operational mode */ 1125 /* configure operational mode */
1126 ath5k_hw_set_opmode(ah); 1126 ath5k_hw_set_opmode(ah);
1127 1127
1128 ath5k_hw_set_mcast_filter(ah, 0, 0);
1129 ATH5K_DBG(sc, ATH5K_DEBUG_MODE, "RX filter 0x%x\n", rfilt); 1128 ATH5K_DBG(sc, ATH5K_DEBUG_MODE, "RX filter 0x%x\n", rfilt);
1130} 1129}
1131 1130
diff --git a/drivers/net/wireless/ath/ath5k/led.c b/drivers/net/wireless/ath/ath5k/led.c
index b767c3b67b24..b548c8eaaae1 100644
--- a/drivers/net/wireless/ath/ath5k/led.c
+++ b/drivers/net/wireless/ath/ath5k/led.c
@@ -63,12 +63,16 @@ static const struct pci_device_id ath5k_led_devices[] = {
63 { ATH_SDEVICE(PCI_VENDOR_ID_AMBIT, 0x0422), ATH_LED(1, 1) }, 63 { ATH_SDEVICE(PCI_VENDOR_ID_AMBIT, 0x0422), ATH_LED(1, 1) },
64 /* E-machines E510 (tuliom@gmail.com) */ 64 /* E-machines E510 (tuliom@gmail.com) */
65 { ATH_SDEVICE(PCI_VENDOR_ID_AMBIT, 0x0428), ATH_LED(3, 0) }, 65 { ATH_SDEVICE(PCI_VENDOR_ID_AMBIT, 0x0428), ATH_LED(3, 0) },
66 /* BenQ Joybook R55v (nowymarluk@wp.pl) */
67 { ATH_SDEVICE(PCI_VENDOR_ID_QMI, 0x0100), ATH_LED(1, 0) },
66 /* Acer Extensa 5620z (nekoreeve@gmail.com) */ 68 /* Acer Extensa 5620z (nekoreeve@gmail.com) */
67 { ATH_SDEVICE(PCI_VENDOR_ID_QMI, 0x0105), ATH_LED(3, 0) }, 69 { ATH_SDEVICE(PCI_VENDOR_ID_QMI, 0x0105), ATH_LED(3, 0) },
68 /* Fukato Datacask Jupiter 1014a (mrb74@gmx.at) */ 70 /* Fukato Datacask Jupiter 1014a (mrb74@gmx.at) */
69 { ATH_SDEVICE(PCI_VENDOR_ID_AZWAVE, 0x1026), ATH_LED(3, 0) }, 71 { ATH_SDEVICE(PCI_VENDOR_ID_AZWAVE, 0x1026), ATH_LED(3, 0) },
70 /* IBM ThinkPad AR5BXB6 (legovini@spiro.fisica.unipd.it) */ 72 /* IBM ThinkPad AR5BXB6 (legovini@spiro.fisica.unipd.it) */
71 { ATH_SDEVICE(PCI_VENDOR_ID_IBM, 0x058a), ATH_LED(1, 0) }, 73 { ATH_SDEVICE(PCI_VENDOR_ID_IBM, 0x058a), ATH_LED(1, 0) },
74 /* HP Compaq CQ60-206US (ddreggors@jumptv.com) */
75 { ATH_SDEVICE(PCI_VENDOR_ID_HP, 0x0137a), ATH_LED(3, 1) },
72 /* HP Compaq C700 (nitrousnrg@gmail.com) */ 76 /* HP Compaq C700 (nitrousnrg@gmail.com) */
73 { ATH_SDEVICE(PCI_VENDOR_ID_HP, 0x0137b), ATH_LED(3, 1) }, 77 { ATH_SDEVICE(PCI_VENDOR_ID_HP, 0x0137b), ATH_LED(3, 1) },
74 /* IBM-specific AR5212 (all others) */ 78 /* IBM-specific AR5212 (all others) */
diff --git a/drivers/net/wireless/ath/ath9k/main.c b/drivers/net/wireless/ath/ath9k/main.c
index 52bed89063d4..43d2be9867fc 100644
--- a/drivers/net/wireless/ath/ath9k/main.c
+++ b/drivers/net/wireless/ath/ath9k/main.c
@@ -1555,6 +1555,8 @@ void ath_set_hw_capab(struct ath_softc *sc, struct ieee80211_hw *hw)
1555 BIT(NL80211_IFTYPE_ADHOC) | 1555 BIT(NL80211_IFTYPE_ADHOC) |
1556 BIT(NL80211_IFTYPE_MESH_POINT); 1556 BIT(NL80211_IFTYPE_MESH_POINT);
1557 1557
1558 hw->wiphy->ps_default = false;
1559
1558 hw->queues = 4; 1560 hw->queues = 4;
1559 hw->max_rates = 4; 1561 hw->max_rates = 4;
1560 hw->channel_change_time = 5000; 1562 hw->channel_change_time = 5000;
diff --git a/drivers/net/wireless/ath/ath9k/rc.c b/drivers/net/wireless/ath/ath9k/rc.c
index 16a271787b85..1895d63aad0a 100644
--- a/drivers/net/wireless/ath/ath9k/rc.c
+++ b/drivers/net/wireless/ath/ath9k/rc.c
@@ -679,7 +679,7 @@ static u8 ath_rc_get_highest_rix(struct ath_softc *sc,
679 return rate; 679 return rate;
680 680
681 if (rate_table->info[rate].valid_single_stream && 681 if (rate_table->info[rate].valid_single_stream &&
682 !(ath_rc_priv->ht_cap & WLAN_RC_DS_FLAG)); 682 !(ath_rc_priv->ht_cap & WLAN_RC_DS_FLAG))
683 return rate; 683 return rate;
684 684
685 /* This should not happen */ 685 /* This should not happen */
diff --git a/drivers/net/wireless/atmel_cs.c b/drivers/net/wireless/atmel_cs.c
index ddaa859c3491..32407911842f 100644
--- a/drivers/net/wireless/atmel_cs.c
+++ b/drivers/net/wireless/atmel_cs.c
@@ -55,22 +55,6 @@
55 55
56#include "atmel.h" 56#include "atmel.h"
57 57
58/*
59 All the PCMCIA modules use PCMCIA_DEBUG to control debugging. If
60 you do not define PCMCIA_DEBUG at all, all the debug code will be
61 left out. If you compile with PCMCIA_DEBUG=0, the debug code will
62 be present but disabled -- but it can then be enabled for specific
63 modules at load time with a 'pc_debug=#' option to insmod.
64*/
65
66#ifdef PCMCIA_DEBUG
67static int pc_debug = PCMCIA_DEBUG;
68module_param(pc_debug, int, 0);
69static char *version = "$Revision: 1.2 $";
70#define DEBUG(n, args...) if (pc_debug>(n)) printk(KERN_DEBUG args);
71#else
72#define DEBUG(n, args...)
73#endif
74 58
75/*====================================================================*/ 59/*====================================================================*/
76 60
@@ -155,11 +139,10 @@ static int atmel_probe(struct pcmcia_device *p_dev)
155{ 139{
156 local_info_t *local; 140 local_info_t *local;
157 141
158 DEBUG(0, "atmel_attach()\n"); 142 dev_dbg(&p_dev->dev, "atmel_attach()\n");
159 143
160 /* Interrupt setup */ 144 /* Interrupt setup */
161 p_dev->irq.Attributes = IRQ_TYPE_DYNAMIC_SHARING; 145 p_dev->irq.Attributes = IRQ_TYPE_DYNAMIC_SHARING;
162 p_dev->irq.IRQInfo1 = IRQ_LEVEL_ID;
163 p_dev->irq.Handler = NULL; 146 p_dev->irq.Handler = NULL;
164 147
165 /* 148 /*
@@ -194,7 +177,7 @@ static int atmel_probe(struct pcmcia_device *p_dev)
194 177
195static void atmel_detach(struct pcmcia_device *link) 178static void atmel_detach(struct pcmcia_device *link)
196{ 179{
197 DEBUG(0, "atmel_detach(0x%p)\n", link); 180 dev_dbg(&link->dev, "atmel_detach\n");
198 181
199 atmel_release(link); 182 atmel_release(link);
200 183
@@ -209,9 +192,6 @@ static void atmel_detach(struct pcmcia_device *link)
209 192
210 ======================================================================*/ 193 ======================================================================*/
211 194
212#define CS_CHECK(fn, ret) \
213do { last_fn = (fn); if ((last_ret = (ret)) != 0) goto cs_failed; } while (0)
214
215/* Call-back function to interrogate PCMCIA-specific information 195/* Call-back function to interrogate PCMCIA-specific information
216 about the current existance of the card */ 196 about the current existance of the card */
217static int card_present(void *arg) 197static int card_present(void *arg)
@@ -275,13 +255,13 @@ static int atmel_config_check(struct pcmcia_device *p_dev,
275static int atmel_config(struct pcmcia_device *link) 255static int atmel_config(struct pcmcia_device *link)
276{ 256{
277 local_info_t *dev; 257 local_info_t *dev;
278 int last_fn, last_ret; 258 int ret;
279 struct pcmcia_device_id *did; 259 struct pcmcia_device_id *did;
280 260
281 dev = link->priv; 261 dev = link->priv;
282 did = dev_get_drvdata(&handle_to_dev(link)); 262 did = dev_get_drvdata(&link->dev);
283 263
284 DEBUG(0, "atmel_config(0x%p)\n", link); 264 dev_dbg(&link->dev, "atmel_config\n");
285 265
286 /* 266 /*
287 In this loop, we scan the CIS for configuration table entries, 267 In this loop, we scan the CIS for configuration table entries,
@@ -303,31 +283,36 @@ static int atmel_config(struct pcmcia_device *link)
303 handler to the interrupt, unless the 'Handler' member of the 283 handler to the interrupt, unless the 'Handler' member of the
304 irq structure is initialized. 284 irq structure is initialized.
305 */ 285 */
306 if (link->conf.Attributes & CONF_ENABLE_IRQ) 286 if (link->conf.Attributes & CONF_ENABLE_IRQ) {
307 CS_CHECK(RequestIRQ, pcmcia_request_irq(link, &link->irq)); 287 ret = pcmcia_request_irq(link, &link->irq);
288 if (ret)
289 goto failed;
290 }
308 291
309 /* 292 /*
310 This actually configures the PCMCIA socket -- setting up 293 This actually configures the PCMCIA socket -- setting up
311 the I/O windows and the interrupt mapping, and putting the 294 the I/O windows and the interrupt mapping, and putting the
312 card and host interface into "Memory and IO" mode. 295 card and host interface into "Memory and IO" mode.
313 */ 296 */
314 CS_CHECK(RequestConfiguration, pcmcia_request_configuration(link, &link->conf)); 297 ret = pcmcia_request_configuration(link, &link->conf);
298 if (ret)
299 goto failed;
315 300
316 if (link->irq.AssignedIRQ == 0) { 301 if (link->irq.AssignedIRQ == 0) {
317 printk(KERN_ALERT 302 printk(KERN_ALERT
318 "atmel: cannot assign IRQ: check that CONFIG_ISA is set in kernel config."); 303 "atmel: cannot assign IRQ: check that CONFIG_ISA is set in kernel config.");
319 goto cs_failed; 304 goto failed;
320 } 305 }
321 306
322 ((local_info_t*)link->priv)->eth_dev = 307 ((local_info_t*)link->priv)->eth_dev =
323 init_atmel_card(link->irq.AssignedIRQ, 308 init_atmel_card(link->irq.AssignedIRQ,
324 link->io.BasePort1, 309 link->io.BasePort1,
325 did ? did->driver_info : ATMEL_FW_TYPE_NONE, 310 did ? did->driver_info : ATMEL_FW_TYPE_NONE,
326 &handle_to_dev(link), 311 &link->dev,
327 card_present, 312 card_present,
328 link); 313 link);
329 if (!((local_info_t*)link->priv)->eth_dev) 314 if (!((local_info_t*)link->priv)->eth_dev)
330 goto cs_failed; 315 goto failed;
331 316
332 317
333 /* 318 /*
@@ -340,8 +325,6 @@ static int atmel_config(struct pcmcia_device *link)
340 325
341 return 0; 326 return 0;
342 327
343 cs_failed:
344 cs_error(link, last_fn, last_ret);
345 failed: 328 failed:
346 atmel_release(link); 329 atmel_release(link);
347 return -ENODEV; 330 return -ENODEV;
@@ -359,7 +342,7 @@ static void atmel_release(struct pcmcia_device *link)
359{ 342{
360 struct net_device *dev = ((local_info_t*)link->priv)->eth_dev; 343 struct net_device *dev = ((local_info_t*)link->priv)->eth_dev;
361 344
362 DEBUG(0, "atmel_release(0x%p)\n", link); 345 dev_dbg(&link->dev, "atmel_release\n");
363 346
364 if (dev) 347 if (dev)
365 stop_atmel_card(dev); 348 stop_atmel_card(dev);
diff --git a/drivers/net/wireless/b43/dma.c b/drivers/net/wireless/b43/dma.c
index 8701034569fa..de4e804bedf0 100644
--- a/drivers/net/wireless/b43/dma.c
+++ b/drivers/net/wireless/b43/dma.c
@@ -1157,8 +1157,9 @@ struct b43_dmaring *parse_cookie(struct b43_wldev *dev, u16 cookie, int *slot)
1157} 1157}
1158 1158
1159static int dma_tx_fragment(struct b43_dmaring *ring, 1159static int dma_tx_fragment(struct b43_dmaring *ring,
1160 struct sk_buff *skb) 1160 struct sk_buff **in_skb)
1161{ 1161{
1162 struct sk_buff *skb = *in_skb;
1162 const struct b43_dma_ops *ops = ring->ops; 1163 const struct b43_dma_ops *ops = ring->ops;
1163 struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb); 1164 struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb);
1164 u8 *header; 1165 u8 *header;
@@ -1224,8 +1225,14 @@ static int dma_tx_fragment(struct b43_dmaring *ring,
1224 } 1225 }
1225 1226
1226 memcpy(skb_put(bounce_skb, skb->len), skb->data, skb->len); 1227 memcpy(skb_put(bounce_skb, skb->len), skb->data, skb->len);
1228 memcpy(bounce_skb->cb, skb->cb, sizeof(skb->cb));
1229 bounce_skb->dev = skb->dev;
1230 skb_set_queue_mapping(bounce_skb, skb_get_queue_mapping(skb));
1231 info = IEEE80211_SKB_CB(bounce_skb);
1232
1227 dev_kfree_skb_any(skb); 1233 dev_kfree_skb_any(skb);
1228 skb = bounce_skb; 1234 skb = bounce_skb;
1235 *in_skb = bounce_skb;
1229 meta->skb = skb; 1236 meta->skb = skb;
1230 meta->dmaaddr = map_descbuffer(ring, skb->data, skb->len, 1); 1237 meta->dmaaddr = map_descbuffer(ring, skb->data, skb->len, 1);
1231 if (b43_dma_mapping_error(ring, meta->dmaaddr, skb->len, 1)) { 1238 if (b43_dma_mapping_error(ring, meta->dmaaddr, skb->len, 1)) {
@@ -1355,7 +1362,11 @@ int b43_dma_tx(struct b43_wldev *dev, struct sk_buff *skb)
1355 * static, so we don't need to store it per frame. */ 1362 * static, so we don't need to store it per frame. */
1356 ring->queue_prio = skb_get_queue_mapping(skb); 1363 ring->queue_prio = skb_get_queue_mapping(skb);
1357 1364
1358 err = dma_tx_fragment(ring, skb); 1365 /* dma_tx_fragment might reallocate the skb, so invalidate pointers pointing
1366 * into the skb data or cb now. */
1367 hdr = NULL;
1368 info = NULL;
1369 err = dma_tx_fragment(ring, &skb);
1359 if (unlikely(err == -ENOKEY)) { 1370 if (unlikely(err == -ENOKEY)) {
1360 /* Drop this packet, as we don't have the encryption key 1371 /* Drop this packet, as we don't have the encryption key
1361 * anymore and must not transmit it unencrypted. */ 1372 * anymore and must not transmit it unencrypted. */
diff --git a/drivers/net/wireless/b43/main.c b/drivers/net/wireless/b43/main.c
index 86f35827f008..098dda1a67c1 100644
--- a/drivers/net/wireless/b43/main.c
+++ b/drivers/net/wireless/b43/main.c
@@ -4521,9 +4521,8 @@ static int b43_op_beacon_set_tim(struct ieee80211_hw *hw,
4521{ 4521{
4522 struct b43_wl *wl = hw_to_b43_wl(hw); 4522 struct b43_wl *wl = hw_to_b43_wl(hw);
4523 4523
4524 mutex_lock(&wl->mutex); 4524 /* FIXME: add locking */
4525 b43_update_templates(wl); 4525 b43_update_templates(wl);
4526 mutex_unlock(&wl->mutex);
4527 4526
4528 return 0; 4527 return 0;
4529} 4528}
diff --git a/drivers/net/wireless/b43/pcmcia.c b/drivers/net/wireless/b43/pcmcia.c
index 6c3a74964ab8..984174bc7b0f 100644
--- a/drivers/net/wireless/b43/pcmcia.c
+++ b/drivers/net/wireless/b43/pcmcia.c
@@ -65,35 +65,15 @@ static int __devinit b43_pcmcia_probe(struct pcmcia_device *dev)
65 struct ssb_bus *ssb; 65 struct ssb_bus *ssb;
66 win_req_t win; 66 win_req_t win;
67 memreq_t mem; 67 memreq_t mem;
68 tuple_t tuple;
69 cisparse_t parse;
70 int err = -ENOMEM; 68 int err = -ENOMEM;
71 int res = 0; 69 int res = 0;
72 unsigned char buf[64];
73 70
74 ssb = kzalloc(sizeof(*ssb), GFP_KERNEL); 71 ssb = kzalloc(sizeof(*ssb), GFP_KERNEL);
75 if (!ssb) 72 if (!ssb)
76 goto out_error; 73 goto out_error;
77 74
78 err = -ENODEV; 75 err = -ENODEV;
79 tuple.DesiredTuple = CISTPL_CONFIG;
80 tuple.Attributes = 0;
81 tuple.TupleData = buf;
82 tuple.TupleDataMax = sizeof(buf);
83 tuple.TupleOffset = 0;
84 76
85 res = pcmcia_get_first_tuple(dev, &tuple);
86 if (res != 0)
87 goto err_kfree_ssb;
88 res = pcmcia_get_tuple_data(dev, &tuple);
89 if (res != 0)
90 goto err_kfree_ssb;
91 res = pcmcia_parse_tuple(&tuple, &parse);
92 if (res != 0)
93 goto err_kfree_ssb;
94
95 dev->conf.ConfigBase = parse.config.base;
96 dev->conf.Present = parse.config.rmask[0];
97 dev->conf.Attributes = CONF_ENABLE_IRQ; 77 dev->conf.Attributes = CONF_ENABLE_IRQ;
98 dev->conf.IntType = INT_MEMORY_AND_IO; 78 dev->conf.IntType = INT_MEMORY_AND_IO;
99 79
@@ -107,20 +87,18 @@ static int __devinit b43_pcmcia_probe(struct pcmcia_device *dev)
107 win.Base = 0; 87 win.Base = 0;
108 win.Size = SSB_CORE_SIZE; 88 win.Size = SSB_CORE_SIZE;
109 win.AccessSpeed = 250; 89 win.AccessSpeed = 250;
110 res = pcmcia_request_window(&dev, &win, &dev->win); 90 res = pcmcia_request_window(dev, &win, &dev->win);
111 if (res != 0) 91 if (res != 0)
112 goto err_kfree_ssb; 92 goto err_kfree_ssb;
113 93
114 mem.CardOffset = 0; 94 mem.CardOffset = 0;
115 mem.Page = 0; 95 mem.Page = 0;
116 res = pcmcia_map_mem_page(dev->win, &mem); 96 res = pcmcia_map_mem_page(dev, dev->win, &mem);
117 if (res != 0) 97 if (res != 0)
118 goto err_disable; 98 goto err_disable;
119 99
120 dev->irq.Attributes = IRQ_TYPE_DYNAMIC_SHARING; 100 dev->irq.Attributes = IRQ_TYPE_DYNAMIC_SHARING;
121 dev->irq.IRQInfo1 = IRQ_LEVEL_ID;
122 dev->irq.Handler = NULL; /* The handler is registered later. */ 101 dev->irq.Handler = NULL; /* The handler is registered later. */
123 dev->irq.Instance = NULL;
124 res = pcmcia_request_irq(dev, &dev->irq); 102 res = pcmcia_request_irq(dev, &dev->irq);
125 if (res != 0) 103 if (res != 0)
126 goto err_disable; 104 goto err_disable;
diff --git a/drivers/net/wireless/hostap/hostap_cs.c b/drivers/net/wireless/hostap/hostap_cs.c
index ad8eab4a639b..c9640a3e02c9 100644
--- a/drivers/net/wireless/hostap/hostap_cs.c
+++ b/drivers/net/wireless/hostap/hostap_cs.c
@@ -274,9 +274,6 @@ static int sandisk_enable_wireless(struct net_device *dev)
274 conf_reg_t reg; 274 conf_reg_t reg;
275 struct hostap_interface *iface = netdev_priv(dev); 275 struct hostap_interface *iface = netdev_priv(dev);
276 local_info_t *local = iface->local; 276 local_info_t *local = iface->local;
277 tuple_t tuple;
278 cisparse_t *parse = NULL;
279 u_char buf[64];
280 struct hostap_cs_priv *hw_priv = local->hw_priv; 277 struct hostap_cs_priv *hw_priv = local->hw_priv;
281 278
282 if (hw_priv->link->io.NumPorts1 < 0x42) { 279 if (hw_priv->link->io.NumPorts1 < 0x42) {
@@ -285,28 +282,13 @@ static int sandisk_enable_wireless(struct net_device *dev)
285 goto done; 282 goto done;
286 } 283 }
287 284
288 parse = kmalloc(sizeof(cisparse_t), GFP_KERNEL);
289 if (parse == NULL) {
290 ret = -ENOMEM;
291 goto done;
292 }
293
294 tuple.Attributes = TUPLE_RETURN_COMMON;
295 tuple.TupleData = buf;
296 tuple.TupleDataMax = sizeof(buf);
297 tuple.TupleOffset = 0;
298
299 if (hw_priv->link->manf_id != 0xd601 || hw_priv->link->card_id != 0x0101) { 285 if (hw_priv->link->manf_id != 0xd601 || hw_priv->link->card_id != 0x0101) {
300 /* No SanDisk manfid found */ 286 /* No SanDisk manfid found */
301 ret = -ENODEV; 287 ret = -ENODEV;
302 goto done; 288 goto done;
303 } 289 }
304 290
305 tuple.DesiredTuple = CISTPL_LONGLINK_MFC; 291 if (hw_priv->link->socket->functions < 2) {
306 if (pcmcia_get_first_tuple(hw_priv->link, &tuple) ||
307 pcmcia_get_tuple_data(hw_priv->link, &tuple) ||
308 pcmcia_parse_tuple(&tuple, parse) ||
309 parse->longlink_mfc.nfn < 2) {
310 /* No multi-function links found */ 292 /* No multi-function links found */
311 ret = -ENODEV; 293 ret = -ENODEV;
312 goto done; 294 goto done;
@@ -354,7 +336,6 @@ static int sandisk_enable_wireless(struct net_device *dev)
354 udelay(10); 336 udelay(10);
355 337
356done: 338done:
357 kfree(parse);
358 return ret; 339 return ret;
359} 340}
360 341
@@ -529,10 +510,6 @@ static void prism2_detach(struct pcmcia_device *link)
529} 510}
530 511
531 512
532#define CS_CHECK(fn, ret) \
533do { last_fn = (fn); if ((last_ret = (ret)) != 0) goto cs_failed; } while (0)
534
535
536/* run after a CARD_INSERTION event is received to configure the PCMCIA 513/* run after a CARD_INSERTION event is received to configure the PCMCIA
537 * socket and make the device available to the system */ 514 * socket and make the device available to the system */
538 515
@@ -624,7 +601,6 @@ static int prism2_config(struct pcmcia_device *link)
624 struct hostap_interface *iface; 601 struct hostap_interface *iface;
625 local_info_t *local; 602 local_info_t *local;
626 int ret = 1; 603 int ret = 1;
627 int last_fn, last_ret;
628 struct hostap_cs_priv *hw_priv; 604 struct hostap_cs_priv *hw_priv;
629 605
630 PDEBUG(DEBUG_FLOW, "prism2_config()\n"); 606 PDEBUG(DEBUG_FLOW, "prism2_config()\n");
@@ -636,19 +612,18 @@ static int prism2_config(struct pcmcia_device *link)
636 } 612 }
637 613
638 /* Look for an appropriate configuration table entry in the CIS */ 614 /* Look for an appropriate configuration table entry in the CIS */
639 last_ret = pcmcia_loop_config(link, prism2_config_check, NULL); 615 ret = pcmcia_loop_config(link, prism2_config_check, NULL);
640 if (last_ret) { 616 if (ret) {
641 if (!ignore_cis_vcc) 617 if (!ignore_cis_vcc)
642 printk(KERN_ERR "GetNextTuple(): No matching " 618 printk(KERN_ERR "GetNextTuple(): No matching "
643 "CIS configuration. Maybe you need the " 619 "CIS configuration. Maybe you need the "
644 "ignore_cis_vcc=1 parameter.\n"); 620 "ignore_cis_vcc=1 parameter.\n");
645 cs_error(link, RequestIO, last_ret);
646 goto failed; 621 goto failed;
647 } 622 }
648 623
649 /* Need to allocate net_device before requesting IRQ handler */ 624 /* Need to allocate net_device before requesting IRQ handler */
650 dev = prism2_init_local_data(&prism2_pccard_funcs, 0, 625 dev = prism2_init_local_data(&prism2_pccard_funcs, 0,
651 &handle_to_dev(link)); 626 &link->dev);
652 if (dev == NULL) 627 if (dev == NULL)
653 goto failed; 628 goto failed;
654 link->priv = dev; 629 link->priv = dev;
@@ -666,13 +641,11 @@ static int prism2_config(struct pcmcia_device *link)
666 * irq structure is initialized. 641 * irq structure is initialized.
667 */ 642 */
668 if (link->conf.Attributes & CONF_ENABLE_IRQ) { 643 if (link->conf.Attributes & CONF_ENABLE_IRQ) {
669 link->irq.Attributes = IRQ_TYPE_DYNAMIC_SHARING | 644 link->irq.Attributes = IRQ_TYPE_DYNAMIC_SHARING;
670 IRQ_HANDLE_PRESENT;
671 link->irq.IRQInfo1 = IRQ_LEVEL_ID;
672 link->irq.Handler = prism2_interrupt; 645 link->irq.Handler = prism2_interrupt;
673 link->irq.Instance = dev; 646 ret = pcmcia_request_irq(link, &link->irq);
674 CS_CHECK(RequestIRQ, 647 if (ret)
675 pcmcia_request_irq(link, &link->irq)); 648 goto failed;
676 } 649 }
677 650
678 /* 651 /*
@@ -680,8 +653,9 @@ static int prism2_config(struct pcmcia_device *link)
680 * the I/O windows and the interrupt mapping, and putting the 653 * the I/O windows and the interrupt mapping, and putting the
681 * card and host interface into "Memory and IO" mode. 654 * card and host interface into "Memory and IO" mode.
682 */ 655 */
683 CS_CHECK(RequestConfiguration, 656 ret = pcmcia_request_configuration(link, &link->conf);
684 pcmcia_request_configuration(link, &link->conf)); 657 if (ret)
658 goto failed;
685 659
686 dev->irq = link->irq.AssignedIRQ; 660 dev->irq = link->irq.AssignedIRQ;
687 dev->base_addr = link->io.BasePort1; 661 dev->base_addr = link->io.BasePort1;
@@ -714,9 +688,6 @@ static int prism2_config(struct pcmcia_device *link)
714 } 688 }
715 return ret; 689 return ret;
716 690
717 cs_failed:
718 cs_error(link, last_fn, last_ret);
719
720 failed: 691 failed:
721 kfree(hw_priv); 692 kfree(hw_priv);
722 prism2_release((u_long)link); 693 prism2_release((u_long)link);
diff --git a/drivers/net/wireless/ipw2x00/ipw2100.c b/drivers/net/wireless/ipw2x00/ipw2100.c
index 240cff1e6979..6e2fc0cb6f8a 100644
--- a/drivers/net/wireless/ipw2x00/ipw2100.c
+++ b/drivers/net/wireless/ipw2x00/ipw2100.c
@@ -6029,7 +6029,7 @@ static struct net_device *ipw2100_alloc_device(struct pci_dev *pci_dev,
6029 struct ipw2100_priv *priv; 6029 struct ipw2100_priv *priv;
6030 struct net_device *dev; 6030 struct net_device *dev;
6031 6031
6032 dev = alloc_ieee80211(sizeof(struct ipw2100_priv), 0); 6032 dev = alloc_ieee80211(sizeof(struct ipw2100_priv));
6033 if (!dev) 6033 if (!dev)
6034 return NULL; 6034 return NULL;
6035 priv = libipw_priv(dev); 6035 priv = libipw_priv(dev);
@@ -6342,7 +6342,7 @@ static int ipw2100_pci_init_one(struct pci_dev *pci_dev,
6342 sysfs_remove_group(&pci_dev->dev.kobj, 6342 sysfs_remove_group(&pci_dev->dev.kobj,
6343 &ipw2100_attribute_group); 6343 &ipw2100_attribute_group);
6344 6344
6345 free_ieee80211(dev, 0); 6345 free_ieee80211(dev);
6346 pci_set_drvdata(pci_dev, NULL); 6346 pci_set_drvdata(pci_dev, NULL);
6347 } 6347 }
6348 6348
@@ -6400,7 +6400,7 @@ static void __devexit ipw2100_pci_remove_one(struct pci_dev *pci_dev)
6400 if (dev->base_addr) 6400 if (dev->base_addr)
6401 iounmap((void __iomem *)dev->base_addr); 6401 iounmap((void __iomem *)dev->base_addr);
6402 6402
6403 free_ieee80211(dev, 0); 6403 free_ieee80211(dev);
6404 } 6404 }
6405 6405
6406 pci_release_regions(pci_dev); 6406 pci_release_regions(pci_dev);
diff --git a/drivers/net/wireless/ipw2x00/ipw2200.c b/drivers/net/wireless/ipw2x00/ipw2200.c
index 827824d45de9..a6ca536e44f8 100644
--- a/drivers/net/wireless/ipw2x00/ipw2200.c
+++ b/drivers/net/wireless/ipw2x00/ipw2200.c
@@ -104,25 +104,6 @@ static int antenna = CFG_SYS_ANTENNA_BOTH;
104static int rtap_iface = 0; /* def: 0 -- do not create rtap interface */ 104static int rtap_iface = 0; /* def: 0 -- do not create rtap interface */
105#endif 105#endif
106 106
107static struct ieee80211_rate ipw2200_rates[] = {
108 { .bitrate = 10 },
109 { .bitrate = 20, .flags = IEEE80211_RATE_SHORT_PREAMBLE },
110 { .bitrate = 55, .flags = IEEE80211_RATE_SHORT_PREAMBLE },
111 { .bitrate = 110, .flags = IEEE80211_RATE_SHORT_PREAMBLE },
112 { .bitrate = 60 },
113 { .bitrate = 90 },
114 { .bitrate = 120 },
115 { .bitrate = 180 },
116 { .bitrate = 240 },
117 { .bitrate = 360 },
118 { .bitrate = 480 },
119 { .bitrate = 540 }
120};
121
122#define ipw2200_a_rates (ipw2200_rates + 4)
123#define ipw2200_num_a_rates 8
124#define ipw2200_bg_rates (ipw2200_rates + 0)
125#define ipw2200_num_bg_rates 12
126 107
127#ifdef CONFIG_IPW2200_QOS 108#ifdef CONFIG_IPW2200_QOS
128static int qos_enable = 0; 109static int qos_enable = 0;
@@ -8674,6 +8655,24 @@ static int ipw_sw_reset(struct ipw_priv *priv, int option)
8674 * 8655 *
8675 */ 8656 */
8676 8657
8658static int ipw_wx_get_name(struct net_device *dev,
8659 struct iw_request_info *info,
8660 union iwreq_data *wrqu, char *extra)
8661{
8662 struct ipw_priv *priv = libipw_priv(dev);
8663 mutex_lock(&priv->mutex);
8664 if (priv->status & STATUS_RF_KILL_MASK)
8665 strcpy(wrqu->name, "radio off");
8666 else if (!(priv->status & STATUS_ASSOCIATED))
8667 strcpy(wrqu->name, "unassociated");
8668 else
8669 snprintf(wrqu->name, IFNAMSIZ, "IEEE 802.11%c",
8670 ipw_modes[priv->assoc_request.ieee_mode]);
8671 IPW_DEBUG_WX("Name: %s\n", wrqu->name);
8672 mutex_unlock(&priv->mutex);
8673 return 0;
8674}
8675
8677static int ipw_set_channel(struct ipw_priv *priv, u8 channel) 8676static int ipw_set_channel(struct ipw_priv *priv, u8 channel)
8678{ 8677{
8679 if (channel == 0) { 8678 if (channel == 0) {
@@ -9973,7 +9972,7 @@ static int ipw_wx_sw_reset(struct net_device *dev,
9973/* Rebase the WE IOCTLs to zero for the handler array */ 9972/* Rebase the WE IOCTLs to zero for the handler array */
9974#define IW_IOCTL(x) [(x)-SIOCSIWCOMMIT] 9973#define IW_IOCTL(x) [(x)-SIOCSIWCOMMIT]
9975static iw_handler ipw_wx_handlers[] = { 9974static iw_handler ipw_wx_handlers[] = {
9976 IW_IOCTL(SIOCGIWNAME) = (iw_handler) cfg80211_wext_giwname, 9975 IW_IOCTL(SIOCGIWNAME) = ipw_wx_get_name,
9977 IW_IOCTL(SIOCSIWFREQ) = ipw_wx_set_freq, 9976 IW_IOCTL(SIOCSIWFREQ) = ipw_wx_set_freq,
9978 IW_IOCTL(SIOCGIWFREQ) = ipw_wx_get_freq, 9977 IW_IOCTL(SIOCGIWFREQ) = ipw_wx_get_freq,
9979 IW_IOCTL(SIOCSIWMODE) = ipw_wx_set_mode, 9978 IW_IOCTL(SIOCSIWMODE) = ipw_wx_set_mode,
@@ -11417,100 +11416,16 @@ static void ipw_bg_down(struct work_struct *work)
11417/* Called by register_netdev() */ 11416/* Called by register_netdev() */
11418static int ipw_net_init(struct net_device *dev) 11417static int ipw_net_init(struct net_device *dev)
11419{ 11418{
11420 int i, rc = 0;
11421 struct ipw_priv *priv = libipw_priv(dev); 11419 struct ipw_priv *priv = libipw_priv(dev);
11422 const struct libipw_geo *geo = libipw_get_geo(priv->ieee);
11423 struct wireless_dev *wdev = &priv->ieee->wdev;
11424 mutex_lock(&priv->mutex); 11420 mutex_lock(&priv->mutex);
11425 11421
11426 if (ipw_up(priv)) { 11422 if (ipw_up(priv)) {
11427 rc = -EIO; 11423 mutex_unlock(&priv->mutex);
11428 goto out; 11424 return -EIO;
11429 }
11430
11431 memcpy(wdev->wiphy->perm_addr, priv->mac_addr, ETH_ALEN);
11432
11433 /* fill-out priv->ieee->bg_band */
11434 if (geo->bg_channels) {
11435 struct ieee80211_supported_band *bg_band = &priv->ieee->bg_band;
11436
11437 bg_band->band = IEEE80211_BAND_2GHZ;
11438 bg_band->n_channels = geo->bg_channels;
11439 bg_band->channels =
11440 kzalloc(geo->bg_channels *
11441 sizeof(struct ieee80211_channel), GFP_KERNEL);
11442 /* translate geo->bg to bg_band.channels */
11443 for (i = 0; i < geo->bg_channels; i++) {
11444 bg_band->channels[i].band = IEEE80211_BAND_2GHZ;
11445 bg_band->channels[i].center_freq = geo->bg[i].freq;
11446 bg_band->channels[i].hw_value = geo->bg[i].channel;
11447 bg_band->channels[i].max_power = geo->bg[i].max_power;
11448 if (geo->bg[i].flags & LIBIPW_CH_PASSIVE_ONLY)
11449 bg_band->channels[i].flags |=
11450 IEEE80211_CHAN_PASSIVE_SCAN;
11451 if (geo->bg[i].flags & LIBIPW_CH_NO_IBSS)
11452 bg_band->channels[i].flags |=
11453 IEEE80211_CHAN_NO_IBSS;
11454 if (geo->bg[i].flags & LIBIPW_CH_RADAR_DETECT)
11455 bg_band->channels[i].flags |=
11456 IEEE80211_CHAN_RADAR;
11457 /* No equivalent for LIBIPW_CH_80211H_RULES,
11458 LIBIPW_CH_UNIFORM_SPREADING, or
11459 LIBIPW_CH_B_ONLY... */
11460 }
11461 /* point at bitrate info */
11462 bg_band->bitrates = ipw2200_bg_rates;
11463 bg_band->n_bitrates = ipw2200_num_bg_rates;
11464
11465 wdev->wiphy->bands[IEEE80211_BAND_2GHZ] = bg_band;
11466 }
11467
11468 /* fill-out priv->ieee->a_band */
11469 if (geo->a_channels) {
11470 struct ieee80211_supported_band *a_band = &priv->ieee->a_band;
11471
11472 a_band->band = IEEE80211_BAND_5GHZ;
11473 a_band->n_channels = geo->a_channels;
11474 a_band->channels =
11475 kzalloc(geo->a_channels *
11476 sizeof(struct ieee80211_channel), GFP_KERNEL);
11477 /* translate geo->bg to a_band.channels */
11478 for (i = 0; i < geo->a_channels; i++) {
11479 a_band->channels[i].band = IEEE80211_BAND_2GHZ;
11480 a_band->channels[i].center_freq = geo->a[i].freq;
11481 a_band->channels[i].hw_value = geo->a[i].channel;
11482 a_band->channels[i].max_power = geo->a[i].max_power;
11483 if (geo->a[i].flags & LIBIPW_CH_PASSIVE_ONLY)
11484 a_band->channels[i].flags |=
11485 IEEE80211_CHAN_PASSIVE_SCAN;
11486 if (geo->a[i].flags & LIBIPW_CH_NO_IBSS)
11487 a_band->channels[i].flags |=
11488 IEEE80211_CHAN_NO_IBSS;
11489 if (geo->a[i].flags & LIBIPW_CH_RADAR_DETECT)
11490 a_band->channels[i].flags |=
11491 IEEE80211_CHAN_RADAR;
11492 /* No equivalent for LIBIPW_CH_80211H_RULES,
11493 LIBIPW_CH_UNIFORM_SPREADING, or
11494 LIBIPW_CH_B_ONLY... */
11495 }
11496 /* point at bitrate info */
11497 a_band->bitrates = ipw2200_a_rates;
11498 a_band->n_bitrates = ipw2200_num_a_rates;
11499
11500 wdev->wiphy->bands[IEEE80211_BAND_5GHZ] = a_band;
11501 }
11502
11503 set_wiphy_dev(wdev->wiphy, &priv->pci_dev->dev);
11504
11505 /* With that information in place, we can now register the wiphy... */
11506 if (wiphy_register(wdev->wiphy)) {
11507 rc = -EIO;
11508 goto out;
11509 } 11425 }
11510 11426
11511out:
11512 mutex_unlock(&priv->mutex); 11427 mutex_unlock(&priv->mutex);
11513 return rc; 11428 return 0;
11514} 11429}
11515 11430
11516/* PCI driver stuff */ 11431/* PCI driver stuff */
@@ -11641,7 +11556,7 @@ static int ipw_prom_alloc(struct ipw_priv *priv)
11641 if (priv->prom_net_dev) 11556 if (priv->prom_net_dev)
11642 return -EPERM; 11557 return -EPERM;
11643 11558
11644 priv->prom_net_dev = alloc_ieee80211(sizeof(struct ipw_prom_priv), 1); 11559 priv->prom_net_dev = alloc_ieee80211(sizeof(struct ipw_prom_priv));
11645 if (priv->prom_net_dev == NULL) 11560 if (priv->prom_net_dev == NULL)
11646 return -ENOMEM; 11561 return -ENOMEM;
11647 11562
@@ -11660,7 +11575,7 @@ static int ipw_prom_alloc(struct ipw_priv *priv)
11660 11575
11661 rc = register_netdev(priv->prom_net_dev); 11576 rc = register_netdev(priv->prom_net_dev);
11662 if (rc) { 11577 if (rc) {
11663 free_ieee80211(priv->prom_net_dev, 1); 11578 free_ieee80211(priv->prom_net_dev);
11664 priv->prom_net_dev = NULL; 11579 priv->prom_net_dev = NULL;
11665 return rc; 11580 return rc;
11666 } 11581 }
@@ -11674,7 +11589,7 @@ static void ipw_prom_free(struct ipw_priv *priv)
11674 return; 11589 return;
11675 11590
11676 unregister_netdev(priv->prom_net_dev); 11591 unregister_netdev(priv->prom_net_dev);
11677 free_ieee80211(priv->prom_net_dev, 1); 11592 free_ieee80211(priv->prom_net_dev);
11678 11593
11679 priv->prom_net_dev = NULL; 11594 priv->prom_net_dev = NULL;
11680} 11595}
@@ -11702,7 +11617,7 @@ static int __devinit ipw_pci_probe(struct pci_dev *pdev,
11702 struct ipw_priv *priv; 11617 struct ipw_priv *priv;
11703 int i; 11618 int i;
11704 11619
11705 net_dev = alloc_ieee80211(sizeof(struct ipw_priv), 0); 11620 net_dev = alloc_ieee80211(sizeof(struct ipw_priv));
11706 if (net_dev == NULL) { 11621 if (net_dev == NULL) {
11707 err = -ENOMEM; 11622 err = -ENOMEM;
11708 goto out; 11623 goto out;
@@ -11850,7 +11765,7 @@ static int __devinit ipw_pci_probe(struct pci_dev *pdev,
11850 pci_disable_device(pdev); 11765 pci_disable_device(pdev);
11851 pci_set_drvdata(pdev, NULL); 11766 pci_set_drvdata(pdev, NULL);
11852 out_free_ieee80211: 11767 out_free_ieee80211:
11853 free_ieee80211(priv->net_dev, 0); 11768 free_ieee80211(priv->net_dev);
11854 out: 11769 out:
11855 return err; 11770 return err;
11856} 11771}
@@ -11917,7 +11832,7 @@ static void __devexit ipw_pci_remove(struct pci_dev *pdev)
11917 pci_release_regions(pdev); 11832 pci_release_regions(pdev);
11918 pci_disable_device(pdev); 11833 pci_disable_device(pdev);
11919 pci_set_drvdata(pdev, NULL); 11834 pci_set_drvdata(pdev, NULL);
11920 free_ieee80211(priv->net_dev, 0); 11835 free_ieee80211(priv->net_dev);
11921 free_firmware(); 11836 free_firmware();
11922} 11837}
11923 11838
diff --git a/drivers/net/wireless/ipw2x00/libipw.h b/drivers/net/wireless/ipw2x00/libipw.h
index bf45391172f3..1e334ff6bd52 100644
--- a/drivers/net/wireless/ipw2x00/libipw.h
+++ b/drivers/net/wireless/ipw2x00/libipw.h
@@ -31,7 +31,6 @@
31#include <linux/ieee80211.h> 31#include <linux/ieee80211.h>
32 32
33#include <net/lib80211.h> 33#include <net/lib80211.h>
34#include <net/cfg80211.h>
35 34
36#define LIBIPW_VERSION "git-1.1.13" 35#define LIBIPW_VERSION "git-1.1.13"
37 36
@@ -784,15 +783,12 @@ struct libipw_geo {
784 783
785struct libipw_device { 784struct libipw_device {
786 struct net_device *dev; 785 struct net_device *dev;
787 struct wireless_dev wdev;
788 struct libipw_security sec; 786 struct libipw_security sec;
789 787
790 /* Bookkeeping structures */ 788 /* Bookkeeping structures */
791 struct libipw_stats ieee_stats; 789 struct libipw_stats ieee_stats;
792 790
793 struct libipw_geo geo; 791 struct libipw_geo geo;
794 struct ieee80211_supported_band bg_band;
795 struct ieee80211_supported_band a_band;
796 792
797 /* Probe / Beacon management */ 793 /* Probe / Beacon management */
798 struct list_head network_free_list; 794 struct list_head network_free_list;
@@ -1018,8 +1014,8 @@ static inline int libipw_is_cck_rate(u8 rate)
1018} 1014}
1019 1015
1020/* ieee80211.c */ 1016/* ieee80211.c */
1021extern void free_ieee80211(struct net_device *dev, int monitor); 1017extern void free_ieee80211(struct net_device *dev);
1022extern struct net_device *alloc_ieee80211(int sizeof_priv, int monitor); 1018extern struct net_device *alloc_ieee80211(int sizeof_priv);
1023extern int libipw_change_mtu(struct net_device *dev, int new_mtu); 1019extern int libipw_change_mtu(struct net_device *dev, int new_mtu);
1024 1020
1025extern void libipw_networks_age(struct libipw_device *ieee, 1021extern void libipw_networks_age(struct libipw_device *ieee,
diff --git a/drivers/net/wireless/ipw2x00/libipw_module.c b/drivers/net/wireless/ipw2x00/libipw_module.c
index a0e9f6aed7da..eb2b60834c17 100644
--- a/drivers/net/wireless/ipw2x00/libipw_module.c
+++ b/drivers/net/wireless/ipw2x00/libipw_module.c
@@ -62,9 +62,6 @@ MODULE_DESCRIPTION(DRV_DESCRIPTION);
62MODULE_AUTHOR(DRV_COPYRIGHT); 62MODULE_AUTHOR(DRV_COPYRIGHT);
63MODULE_LICENSE("GPL"); 63MODULE_LICENSE("GPL");
64 64
65struct cfg80211_ops libipw_config_ops = { };
66void *libipw_wiphy_privid = &libipw_wiphy_privid;
67
68static int libipw_networks_allocate(struct libipw_device *ieee) 65static int libipw_networks_allocate(struct libipw_device *ieee)
69{ 66{
70 if (ieee->networks) 67 if (ieee->networks)
@@ -143,7 +140,7 @@ int libipw_change_mtu(struct net_device *dev, int new_mtu)
143} 140}
144EXPORT_SYMBOL(libipw_change_mtu); 141EXPORT_SYMBOL(libipw_change_mtu);
145 142
146struct net_device *alloc_ieee80211(int sizeof_priv, int monitor) 143struct net_device *alloc_ieee80211(int sizeof_priv)
147{ 144{
148 struct libipw_device *ieee; 145 struct libipw_device *ieee;
149 struct net_device *dev; 146 struct net_device *dev;
@@ -160,31 +157,10 @@ struct net_device *alloc_ieee80211(int sizeof_priv, int monitor)
160 157
161 ieee->dev = dev; 158 ieee->dev = dev;
162 159
163 if (!monitor) {
164 ieee->wdev.wiphy = wiphy_new(&libipw_config_ops, 0);
165 if (!ieee->wdev.wiphy) {
166 LIBIPW_ERROR("Unable to allocate wiphy.\n");
167 goto failed_free_netdev;
168 }
169
170 ieee->dev->ieee80211_ptr = &ieee->wdev;
171 ieee->wdev.iftype = NL80211_IFTYPE_STATION;
172
173 /* Fill-out wiphy structure bits we know... Not enough info
174 here to call set_wiphy_dev or set MAC address or channel info
175 -- have to do that in ->ndo_init... */
176 ieee->wdev.wiphy->privid = libipw_wiphy_privid;
177
178 ieee->wdev.wiphy->max_scan_ssids = 1;
179 ieee->wdev.wiphy->max_scan_ie_len = 0;
180 ieee->wdev.wiphy->interface_modes = BIT(NL80211_IFTYPE_STATION)
181 | BIT(NL80211_IFTYPE_ADHOC);
182 }
183
184 err = libipw_networks_allocate(ieee); 160 err = libipw_networks_allocate(ieee);
185 if (err) { 161 if (err) {
186 LIBIPW_ERROR("Unable to allocate beacon storage: %d\n", err); 162 LIBIPW_ERROR("Unable to allocate beacon storage: %d\n", err);
187 goto failed_free_wiphy; 163 goto failed_free_netdev;
188 } 164 }
189 libipw_networks_initialize(ieee); 165 libipw_networks_initialize(ieee);
190 166
@@ -217,31 +193,19 @@ struct net_device *alloc_ieee80211(int sizeof_priv, int monitor)
217 193
218 return dev; 194 return dev;
219 195
220failed_free_wiphy:
221 if (!monitor)
222 wiphy_free(ieee->wdev.wiphy);
223failed_free_netdev: 196failed_free_netdev:
224 free_netdev(dev); 197 free_netdev(dev);
225failed: 198failed:
226 return NULL; 199 return NULL;
227} 200}
228 201
229void free_ieee80211(struct net_device *dev, int monitor) 202void free_ieee80211(struct net_device *dev)
230{ 203{
231 struct libipw_device *ieee = netdev_priv(dev); 204 struct libipw_device *ieee = netdev_priv(dev);
232 205
233 lib80211_crypt_info_free(&ieee->crypt_info); 206 lib80211_crypt_info_free(&ieee->crypt_info);
234 207
235 libipw_networks_free(ieee); 208 libipw_networks_free(ieee);
236
237 /* free cfg80211 resources */
238 if (!monitor) {
239 wiphy_unregister(ieee->wdev.wiphy);
240 kfree(ieee->a_band.channels);
241 kfree(ieee->bg_band.channels);
242 wiphy_free(ieee->wdev.wiphy);
243 }
244
245 free_netdev(dev); 209 free_netdev(dev);
246} 210}
247 211
diff --git a/drivers/net/wireless/iwlwifi/iwl-1000.c b/drivers/net/wireless/iwlwifi/iwl-1000.c
index 2716b91ba9fa..950267ab556a 100644
--- a/drivers/net/wireless/iwlwifi/iwl-1000.c
+++ b/drivers/net/wireless/iwlwifi/iwl-1000.c
@@ -161,5 +161,6 @@ struct iwl_cfg iwl1000_bgn_cfg = {
161 .max_ll_items = OTP_MAX_LL_ITEMS_1000, 161 .max_ll_items = OTP_MAX_LL_ITEMS_1000,
162 .shadow_ram_support = false, 162 .shadow_ram_support = false,
163 .ht_greenfield_support = true, 163 .ht_greenfield_support = true,
164 .use_rts_for_ht = true, /* use rts/cts protection */
164}; 165};
165 166
diff --git a/drivers/net/wireless/iwlwifi/iwl-6000.c b/drivers/net/wireless/iwlwifi/iwl-6000.c
index c295b8ee9228..1473452ba22f 100644
--- a/drivers/net/wireless/iwlwifi/iwl-6000.c
+++ b/drivers/net/wireless/iwlwifi/iwl-6000.c
@@ -175,6 +175,7 @@ struct iwl_cfg iwl6000h_2agn_cfg = {
175 .max_ll_items = OTP_MAX_LL_ITEMS_6x00, 175 .max_ll_items = OTP_MAX_LL_ITEMS_6x00,
176 .shadow_ram_support = true, 176 .shadow_ram_support = true,
177 .ht_greenfield_support = true, 177 .ht_greenfield_support = true,
178 .use_rts_for_ht = true, /* use rts/cts protection */
178}; 179};
179 180
180/* 181/*
@@ -198,6 +199,7 @@ struct iwl_cfg iwl6000i_2agn_cfg = {
198 .max_ll_items = OTP_MAX_LL_ITEMS_6x00, 199 .max_ll_items = OTP_MAX_LL_ITEMS_6x00,
199 .shadow_ram_support = true, 200 .shadow_ram_support = true,
200 .ht_greenfield_support = true, 201 .ht_greenfield_support = true,
202 .use_rts_for_ht = true, /* use rts/cts protection */
201}; 203};
202 204
203struct iwl_cfg iwl6050_2agn_cfg = { 205struct iwl_cfg iwl6050_2agn_cfg = {
@@ -218,6 +220,7 @@ struct iwl_cfg iwl6050_2agn_cfg = {
218 .max_ll_items = OTP_MAX_LL_ITEMS_6x00, 220 .max_ll_items = OTP_MAX_LL_ITEMS_6x00,
219 .shadow_ram_support = true, 221 .shadow_ram_support = true,
220 .ht_greenfield_support = true, 222 .ht_greenfield_support = true,
223 .use_rts_for_ht = true, /* use rts/cts protection */
221}; 224};
222 225
223struct iwl_cfg iwl6000_3agn_cfg = { 226struct iwl_cfg iwl6000_3agn_cfg = {
@@ -238,6 +241,7 @@ struct iwl_cfg iwl6000_3agn_cfg = {
238 .max_ll_items = OTP_MAX_LL_ITEMS_6x00, 241 .max_ll_items = OTP_MAX_LL_ITEMS_6x00,
239 .shadow_ram_support = true, 242 .shadow_ram_support = true,
240 .ht_greenfield_support = true, 243 .ht_greenfield_support = true,
244 .use_rts_for_ht = true, /* use rts/cts protection */
241}; 245};
242 246
243struct iwl_cfg iwl6050_3agn_cfg = { 247struct iwl_cfg iwl6050_3agn_cfg = {
@@ -258,6 +262,7 @@ struct iwl_cfg iwl6050_3agn_cfg = {
258 .max_ll_items = OTP_MAX_LL_ITEMS_6x00, 262 .max_ll_items = OTP_MAX_LL_ITEMS_6x00,
259 .shadow_ram_support = true, 263 .shadow_ram_support = true,
260 .ht_greenfield_support = true, 264 .ht_greenfield_support = true,
265 .use_rts_for_ht = true, /* use rts/cts protection */
261}; 266};
262 267
263MODULE_FIRMWARE(IWL6000_MODULE_FIRMWARE(IWL6000_UCODE_API_MAX)); 268MODULE_FIRMWARE(IWL6000_MODULE_FIRMWARE(IWL6000_UCODE_API_MAX));
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn-rs.c b/drivers/net/wireless/iwlwifi/iwl-agn-rs.c
index 346dc06fa7b7..81726ee32858 100644
--- a/drivers/net/wireless/iwlwifi/iwl-agn-rs.c
+++ b/drivers/net/wireless/iwlwifi/iwl-agn-rs.c
@@ -418,6 +418,15 @@ static void rs_tl_turn_on_agg(struct iwl_priv *priv, u8 tid,
418 else if (tid == IWL_AGG_ALL_TID) 418 else if (tid == IWL_AGG_ALL_TID)
419 for (tid = 0; tid < TID_MAX_LOAD_COUNT; tid++) 419 for (tid = 0; tid < TID_MAX_LOAD_COUNT; tid++)
420 rs_tl_turn_on_agg_for_tid(priv, lq_data, tid, sta); 420 rs_tl_turn_on_agg_for_tid(priv, lq_data, tid, sta);
421 if (priv->cfg->use_rts_for_ht) {
422 /*
423 * switch to RTS/CTS if it is the prefer protection method
424 * for HT traffic
425 */
426 IWL_DEBUG_HT(priv, "use RTS/CTS protection for HT\n");
427 priv->staging_rxon.flags &= ~RXON_FLG_SELF_CTS_EN;
428 iwlcore_commit_rxon(priv);
429 }
421} 430}
422 431
423static inline int get_num_of_ant_from_rate(u32 rate_n_flags) 432static inline int get_num_of_ant_from_rate(u32 rate_n_flags)
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn.c b/drivers/net/wireless/iwlwifi/iwl-agn.c
index eaafae091f5b..921dc4a26fe2 100644
--- a/drivers/net/wireless/iwlwifi/iwl-agn.c
+++ b/drivers/net/wireless/iwlwifi/iwl-agn.c
@@ -116,9 +116,6 @@ int iwl_commit_rxon(struct iwl_priv *priv)
116 116
117 /* always get timestamp with Rx frame */ 117 /* always get timestamp with Rx frame */
118 priv->staging_rxon.flags |= RXON_FLG_TSF2HOST_MSK; 118 priv->staging_rxon.flags |= RXON_FLG_TSF2HOST_MSK;
119 /* allow CTS-to-self if possible. this is relevant only for
120 * 5000, but will not damage 4965 */
121 priv->staging_rxon.flags |= RXON_FLG_SELF_CTS_EN;
122 119
123 ret = iwl_check_rxon_cmd(priv); 120 ret = iwl_check_rxon_cmd(priv);
124 if (ret) { 121 if (ret) {
@@ -218,6 +215,13 @@ int iwl_commit_rxon(struct iwl_priv *priv)
218 "Could not send WEP static key.\n"); 215 "Could not send WEP static key.\n");
219 } 216 }
220 217
218 /*
219 * allow CTS-to-self if possible for new association.
220 * this is relevant only for 5000 series and up,
221 * but will not damage 4965
222 */
223 priv->staging_rxon.flags |= RXON_FLG_SELF_CTS_EN;
224
221 /* Apply the new configuration 225 /* Apply the new configuration
222 * RXON assoc doesn't clear the station table in uCode, 226 * RXON assoc doesn't clear the station table in uCode,
223 */ 227 */
diff --git a/drivers/net/wireless/iwlwifi/iwl-core.h b/drivers/net/wireless/iwlwifi/iwl-core.h
index e50103a956b1..7754538c2194 100644
--- a/drivers/net/wireless/iwlwifi/iwl-core.h
+++ b/drivers/net/wireless/iwlwifi/iwl-core.h
@@ -213,6 +213,7 @@ struct iwl_mod_params {
213 * @pa_type: used by 6000 series only to identify the type of Power Amplifier 213 * @pa_type: used by 6000 series only to identify the type of Power Amplifier
214 * @max_ll_items: max number of OTP blocks 214 * @max_ll_items: max number of OTP blocks
215 * @shadow_ram_support: shadow support for OTP memory 215 * @shadow_ram_support: shadow support for OTP memory
216 * @use_rts_for_ht: use rts/cts protection for HT traffic
216 * 217 *
217 * We enable the driver to be backward compatible wrt API version. The 218 * We enable the driver to be backward compatible wrt API version. The
218 * driver specifies which APIs it supports (with @ucode_api_max being the 219 * driver specifies which APIs it supports (with @ucode_api_max being the
@@ -255,6 +256,7 @@ struct iwl_cfg {
255 const bool shadow_ram_support; 256 const bool shadow_ram_support;
256 const bool ht_greenfield_support; 257 const bool ht_greenfield_support;
257 const bool broken_powersave; 258 const bool broken_powersave;
259 bool use_rts_for_ht;
258}; 260};
259 261
260/*************************** 262/***************************
diff --git a/drivers/net/wireless/iwlwifi/iwl-tx.c b/drivers/net/wireless/iwlwifi/iwl-tx.c
index fb9bcfa6d947..b7e196e3c8d3 100644
--- a/drivers/net/wireless/iwlwifi/iwl-tx.c
+++ b/drivers/net/wireless/iwlwifi/iwl-tx.c
@@ -1277,8 +1277,16 @@ int iwl_tx_agg_stop(struct iwl_priv *priv , const u8 *ra, u16 tid)
1277 return -ENXIO; 1277 return -ENXIO;
1278 } 1278 }
1279 1279
1280 if (priv->stations[sta_id].tid[tid].agg.state ==
1281 IWL_EMPTYING_HW_QUEUE_ADDBA) {
1282 IWL_DEBUG_HT(priv, "AGG stop before setup done\n");
1283 ieee80211_stop_tx_ba_cb_irqsafe(priv->hw, ra, tid);
1284 priv->stations[sta_id].tid[tid].agg.state = IWL_AGG_OFF;
1285 return 0;
1286 }
1287
1280 if (priv->stations[sta_id].tid[tid].agg.state != IWL_AGG_ON) 1288 if (priv->stations[sta_id].tid[tid].agg.state != IWL_AGG_ON)
1281 IWL_WARN(priv, "Stopping AGG while state not IWL_AGG_ON\n"); 1289 IWL_WARN(priv, "Stopping AGG while state not ON or starting\n");
1282 1290
1283 tid_data = &priv->stations[sta_id].tid[tid]; 1291 tid_data = &priv->stations[sta_id].tid[tid];
1284 ssn = (tid_data->seq_number & IEEE80211_SCTL_SEQ) >> 4; 1292 ssn = (tid_data->seq_number & IEEE80211_SCTL_SEQ) >> 4;
diff --git a/drivers/net/wireless/libertas/ethtool.c b/drivers/net/wireless/libertas/ethtool.c
index 039b555e4d76..53d56ab83c03 100644
--- a/drivers/net/wireless/libertas/ethtool.c
+++ b/drivers/net/wireless/libertas/ethtool.c
@@ -169,16 +169,19 @@ static int lbs_ethtool_set_wol(struct net_device *dev,
169 struct lbs_private *priv = dev->ml_priv; 169 struct lbs_private *priv = dev->ml_priv;
170 uint32_t criteria = 0; 170 uint32_t criteria = 0;
171 171
172 if (priv->wol_criteria == 0xffffffff && wol->wolopts)
173 return -EOPNOTSUPP;
174
175 if (wol->wolopts & ~(WAKE_UCAST|WAKE_MCAST|WAKE_BCAST|WAKE_PHY)) 172 if (wol->wolopts & ~(WAKE_UCAST|WAKE_MCAST|WAKE_BCAST|WAKE_PHY))
176 return -EOPNOTSUPP; 173 return -EOPNOTSUPP;
177 174
178 if (wol->wolopts & WAKE_UCAST) criteria |= EHS_WAKE_ON_UNICAST_DATA; 175 if (wol->wolopts & WAKE_UCAST)
179 if (wol->wolopts & WAKE_MCAST) criteria |= EHS_WAKE_ON_MULTICAST_DATA; 176 criteria |= EHS_WAKE_ON_UNICAST_DATA;
180 if (wol->wolopts & WAKE_BCAST) criteria |= EHS_WAKE_ON_BROADCAST_DATA; 177 if (wol->wolopts & WAKE_MCAST)
181 if (wol->wolopts & WAKE_PHY) criteria |= EHS_WAKE_ON_MAC_EVENT; 178 criteria |= EHS_WAKE_ON_MULTICAST_DATA;
179 if (wol->wolopts & WAKE_BCAST)
180 criteria |= EHS_WAKE_ON_BROADCAST_DATA;
181 if (wol->wolopts & WAKE_PHY)
182 criteria |= EHS_WAKE_ON_MAC_EVENT;
183 if (wol->wolopts == 0)
184 criteria |= EHS_REMOVE_WAKEUP;
182 185
183 return lbs_host_sleep_cfg(priv, criteria, (struct wol_config *)NULL); 186 return lbs_host_sleep_cfg(priv, criteria, (struct wol_config *)NULL);
184} 187}
diff --git a/drivers/net/wireless/libertas/if_cs.c b/drivers/net/wireless/libertas/if_cs.c
index 62381768f2d5..b1d84592b959 100644
--- a/drivers/net/wireless/libertas/if_cs.c
+++ b/drivers/net/wireless/libertas/if_cs.c
@@ -590,7 +590,7 @@ static int if_cs_prog_helper(struct if_cs_card *card)
590 590
591 /* TODO: make firmware file configurable */ 591 /* TODO: make firmware file configurable */
592 ret = request_firmware(&fw, "libertas_cs_helper.fw", 592 ret = request_firmware(&fw, "libertas_cs_helper.fw",
593 &handle_to_dev(card->p_dev)); 593 &card->p_dev->dev);
594 if (ret) { 594 if (ret) {
595 lbs_pr_err("can't load helper firmware\n"); 595 lbs_pr_err("can't load helper firmware\n");
596 ret = -ENODEV; 596 ret = -ENODEV;
@@ -663,7 +663,7 @@ static int if_cs_prog_real(struct if_cs_card *card)
663 663
664 /* TODO: make firmware file configurable */ 664 /* TODO: make firmware file configurable */
665 ret = request_firmware(&fw, "libertas_cs.fw", 665 ret = request_firmware(&fw, "libertas_cs.fw",
666 &handle_to_dev(card->p_dev)); 666 &card->p_dev->dev);
667 if (ret) { 667 if (ret) {
668 lbs_pr_err("can't load firmware\n"); 668 lbs_pr_err("can't load firmware\n");
669 ret = -ENODEV; 669 ret = -ENODEV;
@@ -793,18 +793,37 @@ static void if_cs_release(struct pcmcia_device *p_dev)
793 * configure the card at this point -- we wait until we receive a card 793 * configure the card at this point -- we wait until we receive a card
794 * insertion event. 794 * insertion event.
795 */ 795 */
796
797static int if_cs_ioprobe(struct pcmcia_device *p_dev,
798 cistpl_cftable_entry_t *cfg,
799 cistpl_cftable_entry_t *dflt,
800 unsigned int vcc,
801 void *priv_data)
802{
803 p_dev->io.Attributes1 = IO_DATA_PATH_WIDTH_AUTO;
804 p_dev->io.BasePort1 = cfg->io.win[0].base;
805 p_dev->io.NumPorts1 = cfg->io.win[0].len;
806
807 /* Do we need to allocate an interrupt? */
808 if (cfg->irq.IRQInfo1)
809 p_dev->conf.Attributes |= CONF_ENABLE_IRQ;
810
811 /* IO window settings */
812 if (cfg->io.nwin != 1) {
813 lbs_pr_err("wrong CIS (check number of IO windows)\n");
814 return -ENODEV;
815 }
816
817 /* This reserves IO space but doesn't actually enable it */
818 return pcmcia_request_io(p_dev, &p_dev->io);
819}
820
796static int if_cs_probe(struct pcmcia_device *p_dev) 821static int if_cs_probe(struct pcmcia_device *p_dev)
797{ 822{
798 int ret = -ENOMEM; 823 int ret = -ENOMEM;
799 unsigned int prod_id; 824 unsigned int prod_id;
800 struct lbs_private *priv; 825 struct lbs_private *priv;
801 struct if_cs_card *card; 826 struct if_cs_card *card;
802 /* CIS parsing */
803 tuple_t tuple;
804 cisparse_t parse;
805 cistpl_cftable_entry_t *cfg = &parse.cftable_entry;
806 cistpl_io_t *io = &cfg->io;
807 u_char buf[64];
808 827
809 lbs_deb_enter(LBS_DEB_CS); 828 lbs_deb_enter(LBS_DEB_CS);
810 829
@@ -818,48 +837,15 @@ static int if_cs_probe(struct pcmcia_device *p_dev)
818 837
819 p_dev->irq.Attributes = IRQ_TYPE_DYNAMIC_SHARING; 838 p_dev->irq.Attributes = IRQ_TYPE_DYNAMIC_SHARING;
820 p_dev->irq.Handler = NULL; 839 p_dev->irq.Handler = NULL;
821 p_dev->irq.IRQInfo1 = IRQ_INFO2_VALID | IRQ_LEVEL_ID;
822 840
823 p_dev->conf.Attributes = 0; 841 p_dev->conf.Attributes = 0;
824 p_dev->conf.IntType = INT_MEMORY_AND_IO; 842 p_dev->conf.IntType = INT_MEMORY_AND_IO;
825 843
826 tuple.Attributes = 0; 844 if (pcmcia_loop_config(p_dev, if_cs_ioprobe, NULL)) {
827 tuple.TupleData = buf; 845 lbs_pr_err("error in pcmcia_loop_config\n");
828 tuple.TupleDataMax = sizeof(buf);
829 tuple.TupleOffset = 0;
830
831 tuple.DesiredTuple = CISTPL_CFTABLE_ENTRY;
832 if ((ret = pcmcia_get_first_tuple(p_dev, &tuple)) != 0 ||
833 (ret = pcmcia_get_tuple_data(p_dev, &tuple)) != 0 ||
834 (ret = pcmcia_parse_tuple(&tuple, &parse)) != 0)
835 {
836 lbs_pr_err("error in pcmcia_get_first_tuple etc\n");
837 goto out1;
838 }
839
840 p_dev->conf.ConfigIndex = cfg->index;
841
842 /* Do we need to allocate an interrupt? */
843 if (cfg->irq.IRQInfo1) {
844 p_dev->conf.Attributes |= CONF_ENABLE_IRQ;
845 }
846
847 /* IO window settings */
848 if (cfg->io.nwin != 1) {
849 lbs_pr_err("wrong CIS (check number of IO windows)\n");
850 ret = -ENODEV;
851 goto out1; 846 goto out1;
852 } 847 }
853 p_dev->io.Attributes1 = IO_DATA_PATH_WIDTH_AUTO;
854 p_dev->io.BasePort1 = io->win[0].base;
855 p_dev->io.NumPorts1 = io->win[0].len;
856 848
857 /* This reserves IO space but doesn't actually enable it */
858 ret = pcmcia_request_io(p_dev, &p_dev->io);
859 if (ret) {
860 lbs_pr_err("error in pcmcia_request_io\n");
861 goto out1;
862 }
863 849
864 /* 850 /*
865 * Allocate an interrupt line. Note that this does not assign 851 * Allocate an interrupt line. Note that this does not assign
diff --git a/drivers/net/wireless/libertas/if_usb.c b/drivers/net/wireless/libertas/if_usb.c
index 92bc8c5f1ca2..3fac4efa5ac8 100644
--- a/drivers/net/wireless/libertas/if_usb.c
+++ b/drivers/net/wireless/libertas/if_usb.c
@@ -508,7 +508,7 @@ static int __if_usb_submit_rx_urb(struct if_usb_card *cardp,
508 /* Fill the receive configuration URB and initialise the Rx call back */ 508 /* Fill the receive configuration URB and initialise the Rx call back */
509 usb_fill_bulk_urb(cardp->rx_urb, cardp->udev, 509 usb_fill_bulk_urb(cardp->rx_urb, cardp->udev,
510 usb_rcvbulkpipe(cardp->udev, cardp->ep_in), 510 usb_rcvbulkpipe(cardp->udev, cardp->ep_in),
511 (void *) (skb->tail + (size_t) IPFIELD_ALIGN_OFFSET), 511 skb->data + IPFIELD_ALIGN_OFFSET,
512 MRVDRV_ETH_RX_PACKET_BUFFER_SIZE, callbackfn, 512 MRVDRV_ETH_RX_PACKET_BUFFER_SIZE, callbackfn,
513 cardp); 513 cardp);
514 514
diff --git a/drivers/net/wireless/netwave_cs.c b/drivers/net/wireless/netwave_cs.c
index 9498b46c99a4..e61e6b9440ab 100644
--- a/drivers/net/wireless/netwave_cs.c
+++ b/drivers/net/wireless/netwave_cs.c
@@ -145,23 +145,6 @@ static const unsigned int txConfEUD = 0x10; /* Enable Uni-Data packets */
145static const unsigned int txConfKey = 0x02; /* Scramble data packets */ 145static const unsigned int txConfKey = 0x02; /* Scramble data packets */
146static const unsigned int txConfLoop = 0x01; /* Loopback mode */ 146static const unsigned int txConfLoop = 0x01; /* Loopback mode */
147 147
148/*
149 All the PCMCIA modules use PCMCIA_DEBUG to control debugging. If
150 you do not define PCMCIA_DEBUG at all, all the debug code will be
151 left out. If you compile with PCMCIA_DEBUG=0, the debug code will
152 be present but disabled -- but it can then be enabled for specific
153 modules at load time with a 'pc_debug=#' option to insmod.
154*/
155
156#ifdef PCMCIA_DEBUG
157static int pc_debug = PCMCIA_DEBUG;
158module_param(pc_debug, int, 0);
159#define DEBUG(n, args...) if (pc_debug>(n)) printk(KERN_DEBUG args)
160static char *version =
161"netwave_cs.c 0.3.0 Thu Jul 17 14:36:02 1997 (John Markus Bjørndalen)\n";
162#else
163#define DEBUG(n, args...)
164#endif
165 148
166/*====================================================================*/ 149/*====================================================================*/
167 150
@@ -383,7 +366,7 @@ static int netwave_probe(struct pcmcia_device *link)
383 struct net_device *dev; 366 struct net_device *dev;
384 netwave_private *priv; 367 netwave_private *priv;
385 368
386 DEBUG(0, "netwave_attach()\n"); 369 dev_dbg(&link->dev, "netwave_attach()\n");
387 370
388 /* Initialize the struct pcmcia_device structure */ 371 /* Initialize the struct pcmcia_device structure */
389 dev = alloc_etherdev(sizeof(netwave_private)); 372 dev = alloc_etherdev(sizeof(netwave_private));
@@ -401,8 +384,7 @@ static int netwave_probe(struct pcmcia_device *link)
401 link->io.IOAddrLines = 5; 384 link->io.IOAddrLines = 5;
402 385
403 /* Interrupt setup */ 386 /* Interrupt setup */
404 link->irq.Attributes = IRQ_TYPE_DYNAMIC_SHARING | IRQ_HANDLE_PRESENT; 387 link->irq.Attributes = IRQ_TYPE_DYNAMIC_SHARING;
405 link->irq.IRQInfo1 = IRQ_LEVEL_ID;
406 link->irq.Handler = &netwave_interrupt; 388 link->irq.Handler = &netwave_interrupt;
407 389
408 /* General socket configuration */ 390 /* General socket configuration */
@@ -421,8 +403,6 @@ static int netwave_probe(struct pcmcia_device *link)
421 403
422 dev->watchdog_timeo = TX_TIMEOUT; 404 dev->watchdog_timeo = TX_TIMEOUT;
423 405
424 link->irq.Instance = dev;
425
426 return netwave_pcmcia_config( link); 406 return netwave_pcmcia_config( link);
427} /* netwave_attach */ 407} /* netwave_attach */
428 408
@@ -438,7 +418,7 @@ static void netwave_detach(struct pcmcia_device *link)
438{ 418{
439 struct net_device *dev = link->priv; 419 struct net_device *dev = link->priv;
440 420
441 DEBUG(0, "netwave_detach(0x%p)\n", link); 421 dev_dbg(&link->dev, "netwave_detach\n");
442 422
443 netwave_release(link); 423 netwave_release(link);
444 424
@@ -725,18 +705,15 @@ static const struct iw_handler_def netwave_handler_def =
725 * 705 *
726 */ 706 */
727 707
728#define CS_CHECK(fn, ret) \
729do { last_fn = (fn); if ((last_ret = (ret)) != 0) goto cs_failed; } while (0)
730
731static int netwave_pcmcia_config(struct pcmcia_device *link) { 708static int netwave_pcmcia_config(struct pcmcia_device *link) {
732 struct net_device *dev = link->priv; 709 struct net_device *dev = link->priv;
733 netwave_private *priv = netdev_priv(dev); 710 netwave_private *priv = netdev_priv(dev);
734 int i, j, last_ret, last_fn; 711 int i, j, ret;
735 win_req_t req; 712 win_req_t req;
736 memreq_t mem; 713 memreq_t mem;
737 u_char __iomem *ramBase = NULL; 714 u_char __iomem *ramBase = NULL;
738 715
739 DEBUG(0, "netwave_pcmcia_config(0x%p)\n", link); 716 dev_dbg(&link->dev, "netwave_pcmcia_config\n");
740 717
741 /* 718 /*
742 * Try allocating IO ports. This tries a few fixed addresses. 719 * Try allocating IO ports. This tries a few fixed addresses.
@@ -749,22 +726,24 @@ static int netwave_pcmcia_config(struct pcmcia_device *link) {
749 if (i == 0) 726 if (i == 0)
750 break; 727 break;
751 } 728 }
752 if (i != 0) { 729 if (i != 0)
753 cs_error(link, RequestIO, i);
754 goto failed; 730 goto failed;
755 }
756 731
757 /* 732 /*
758 * Now allocate an interrupt line. Note that this does not 733 * Now allocate an interrupt line. Note that this does not
759 * actually assign a handler to the interrupt. 734 * actually assign a handler to the interrupt.
760 */ 735 */
761 CS_CHECK(RequestIRQ, pcmcia_request_irq(link, &link->irq)); 736 ret = pcmcia_request_irq(link, &link->irq);
737 if (ret)
738 goto failed;
762 739
763 /* 740 /*
764 * This actually configures the PCMCIA socket -- setting up 741 * This actually configures the PCMCIA socket -- setting up
765 * the I/O windows and the interrupt mapping. 742 * the I/O windows and the interrupt mapping.
766 */ 743 */
767 CS_CHECK(RequestConfiguration, pcmcia_request_configuration(link, &link->conf)); 744 ret = pcmcia_request_configuration(link, &link->conf);
745 if (ret)
746 goto failed;
768 747
769 /* 748 /*
770 * Allocate a 32K memory window. Note that the struct pcmcia_device 749 * Allocate a 32K memory window. Note that the struct pcmcia_device
@@ -772,14 +751,18 @@ static int netwave_pcmcia_config(struct pcmcia_device *link) {
772 * device needs several windows, you'll need to keep track of 751 * device needs several windows, you'll need to keep track of
773 * the handles in your private data structure, dev->priv. 752 * the handles in your private data structure, dev->priv.
774 */ 753 */
775 DEBUG(1, "Setting mem speed of %d\n", mem_speed); 754 dev_dbg(&link->dev, "Setting mem speed of %d\n", mem_speed);
776 755
777 req.Attributes = WIN_DATA_WIDTH_8|WIN_MEMORY_TYPE_CM|WIN_ENABLE; 756 req.Attributes = WIN_DATA_WIDTH_8|WIN_MEMORY_TYPE_CM|WIN_ENABLE;
778 req.Base = 0; req.Size = 0x8000; 757 req.Base = 0; req.Size = 0x8000;
779 req.AccessSpeed = mem_speed; 758 req.AccessSpeed = mem_speed;
780 CS_CHECK(RequestWindow, pcmcia_request_window(&link, &req, &link->win)); 759 ret = pcmcia_request_window(link, &req, &link->win);
760 if (ret)
761 goto failed;
781 mem.CardOffset = 0x20000; mem.Page = 0; 762 mem.CardOffset = 0x20000; mem.Page = 0;
782 CS_CHECK(MapMemPage, pcmcia_map_mem_page(link->win, &mem)); 763 ret = pcmcia_map_mem_page(link, link->win, &mem);
764 if (ret)
765 goto failed;
783 766
784 /* Store base address of the common window frame */ 767 /* Store base address of the common window frame */
785 ramBase = ioremap(req.Base, 0x8000); 768 ramBase = ioremap(req.Base, 0x8000);
@@ -787,7 +770,7 @@ static int netwave_pcmcia_config(struct pcmcia_device *link) {
787 770
788 dev->irq = link->irq.AssignedIRQ; 771 dev->irq = link->irq.AssignedIRQ;
789 dev->base_addr = link->io.BasePort1; 772 dev->base_addr = link->io.BasePort1;
790 SET_NETDEV_DEV(dev, &handle_to_dev(link)); 773 SET_NETDEV_DEV(dev, &link->dev);
791 774
792 if (register_netdev(dev) != 0) { 775 if (register_netdev(dev) != 0) {
793 printk(KERN_DEBUG "netwave_cs: register_netdev() failed\n"); 776 printk(KERN_DEBUG "netwave_cs: register_netdev() failed\n");
@@ -818,8 +801,6 @@ static int netwave_pcmcia_config(struct pcmcia_device *link) {
818 get_uint16(ramBase + NETWAVE_EREG_ARW+2)); 801 get_uint16(ramBase + NETWAVE_EREG_ARW+2));
819 return 0; 802 return 0;
820 803
821cs_failed:
822 cs_error(link, last_fn, last_ret);
823failed: 804failed:
824 netwave_release(link); 805 netwave_release(link);
825 return -ENODEV; 806 return -ENODEV;
@@ -837,7 +818,7 @@ static void netwave_release(struct pcmcia_device *link)
837 struct net_device *dev = link->priv; 818 struct net_device *dev = link->priv;
838 netwave_private *priv = netdev_priv(dev); 819 netwave_private *priv = netdev_priv(dev);
839 820
840 DEBUG(0, "netwave_release(0x%p)\n", link); 821 dev_dbg(&link->dev, "netwave_release\n");
841 822
842 pcmcia_disable_device(link); 823 pcmcia_disable_device(link);
843 if (link->win) 824 if (link->win)
@@ -892,7 +873,7 @@ static void netwave_reset(struct net_device *dev) {
892 u_char __iomem *ramBase = priv->ramBase; 873 u_char __iomem *ramBase = priv->ramBase;
893 unsigned int iobase = dev->base_addr; 874 unsigned int iobase = dev->base_addr;
894 875
895 DEBUG(0, "netwave_reset: Done with hardware reset\n"); 876 pr_debug("netwave_reset: Done with hardware reset\n");
896 877
897 priv->timeoutCounter = 0; 878 priv->timeoutCounter = 0;
898 879
@@ -988,7 +969,7 @@ static int netwave_hw_xmit(unsigned char* data, int len,
988 969
989 dev->stats.tx_bytes += len; 970 dev->stats.tx_bytes += len;
990 971
991 DEBUG(3, "Transmitting with SPCQ %x SPU %x LIF %x ISPLQ %x\n", 972 pr_debug("Transmitting with SPCQ %x SPU %x LIF %x ISPLQ %x\n",
992 readb(ramBase + NETWAVE_EREG_SPCQ), 973 readb(ramBase + NETWAVE_EREG_SPCQ),
993 readb(ramBase + NETWAVE_EREG_SPU), 974 readb(ramBase + NETWAVE_EREG_SPU),
994 readb(ramBase + NETWAVE_EREG_LIF), 975 readb(ramBase + NETWAVE_EREG_LIF),
@@ -1000,7 +981,7 @@ static int netwave_hw_xmit(unsigned char* data, int len,
1000 MaxData = get_uint16(ramBase + NETWAVE_EREG_TDP+2); 981 MaxData = get_uint16(ramBase + NETWAVE_EREG_TDP+2);
1001 DataOffset = get_uint16(ramBase + NETWAVE_EREG_TDP+4); 982 DataOffset = get_uint16(ramBase + NETWAVE_EREG_TDP+4);
1002 983
1003 DEBUG(3, "TxFreeList %x, MaxData %x, DataOffset %x\n", 984 pr_debug("TxFreeList %x, MaxData %x, DataOffset %x\n",
1004 TxFreeList, MaxData, DataOffset); 985 TxFreeList, MaxData, DataOffset);
1005 986
1006 /* Copy packet to the adapter fragment buffers */ 987 /* Copy packet to the adapter fragment buffers */
@@ -1088,7 +1069,7 @@ static irqreturn_t netwave_interrupt(int irq, void* dev_id)
1088 status = inb(iobase + NETWAVE_REG_ASR); 1069 status = inb(iobase + NETWAVE_REG_ASR);
1089 1070
1090 if (!pcmcia_dev_present(link)) { 1071 if (!pcmcia_dev_present(link)) {
1091 DEBUG(1, "netwave_interrupt: Interrupt with status 0x%x " 1072 pr_debug("netwave_interrupt: Interrupt with status 0x%x "
1092 "from removed or suspended card!\n", status); 1073 "from removed or suspended card!\n", status);
1093 break; 1074 break;
1094 } 1075 }
@@ -1132,7 +1113,7 @@ static irqreturn_t netwave_interrupt(int irq, void* dev_id)
1132 int txStatus; 1113 int txStatus;
1133 1114
1134 txStatus = readb(ramBase + NETWAVE_EREG_TSER); 1115 txStatus = readb(ramBase + NETWAVE_EREG_TSER);
1135 DEBUG(3, "Transmit done. TSER = %x id %x\n", 1116 pr_debug("Transmit done. TSER = %x id %x\n",
1136 txStatus, readb(ramBase + NETWAVE_EREG_TSER + 1)); 1117 txStatus, readb(ramBase + NETWAVE_EREG_TSER + 1));
1137 1118
1138 if (txStatus & 0x20) { 1119 if (txStatus & 0x20) {
@@ -1156,7 +1137,7 @@ static irqreturn_t netwave_interrupt(int irq, void* dev_id)
1156 * TxGU and TxNOAP is set. (Those are the only ones 1137 * TxGU and TxNOAP is set. (Those are the only ones
1157 * to set TxErr). 1138 * to set TxErr).
1158 */ 1139 */
1159 DEBUG(3, "netwave_interrupt: TxDN with error status %x\n", 1140 pr_debug("netwave_interrupt: TxDN with error status %x\n",
1160 txStatus); 1141 txStatus);
1161 1142
1162 /* Clear out TxGU, TxNOAP, TxErr and TxTrys */ 1143 /* Clear out TxGU, TxNOAP, TxErr and TxTrys */
@@ -1164,7 +1145,7 @@ static irqreturn_t netwave_interrupt(int irq, void* dev_id)
1164 writeb(0xdf & txStatus, ramBase+NETWAVE_EREG_TSER+4); 1145 writeb(0xdf & txStatus, ramBase+NETWAVE_EREG_TSER+4);
1165 ++dev->stats.tx_errors; 1146 ++dev->stats.tx_errors;
1166 } 1147 }
1167 DEBUG(3, "New status is TSER %x ASR %x\n", 1148 pr_debug("New status is TSER %x ASR %x\n",
1168 readb(ramBase + NETWAVE_EREG_TSER), 1149 readb(ramBase + NETWAVE_EREG_TSER),
1169 inb(iobase + NETWAVE_REG_ASR)); 1150 inb(iobase + NETWAVE_REG_ASR));
1170 1151
@@ -1172,7 +1153,7 @@ static irqreturn_t netwave_interrupt(int irq, void* dev_id)
1172 } 1153 }
1173 /* TxBA, this would trigger on all error packets received */ 1154 /* TxBA, this would trigger on all error packets received */
1174 /* if (status & 0x01) { 1155 /* if (status & 0x01) {
1175 DEBUG(4, "Transmit buffers available, %x\n", status); 1156 pr_debug("Transmit buffers available, %x\n", status);
1176 } 1157 }
1177 */ 1158 */
1178 } 1159 }
@@ -1190,7 +1171,7 @@ static irqreturn_t netwave_interrupt(int irq, void* dev_id)
1190 */ 1171 */
1191static void netwave_watchdog(struct net_device *dev) { 1172static void netwave_watchdog(struct net_device *dev) {
1192 1173
1193 DEBUG(1, "%s: netwave_watchdog: watchdog timer expired\n", dev->name); 1174 pr_debug("%s: netwave_watchdog: watchdog timer expired\n", dev->name);
1194 netwave_reset(dev); 1175 netwave_reset(dev);
1195 dev->trans_start = jiffies; 1176 dev->trans_start = jiffies;
1196 netif_wake_queue(dev); 1177 netif_wake_queue(dev);
@@ -1211,7 +1192,7 @@ static int netwave_rx(struct net_device *dev)
1211 int i; 1192 int i;
1212 u_char *ptr; 1193 u_char *ptr;
1213 1194
1214 DEBUG(3, "xinw_rx: Receiving ... \n"); 1195 pr_debug("xinw_rx: Receiving ... \n");
1215 1196
1216 /* Receive max 10 packets for now. */ 1197 /* Receive max 10 packets for now. */
1217 for (i = 0; i < 10; i++) { 1198 for (i = 0; i < 10; i++) {
@@ -1237,7 +1218,7 @@ static int netwave_rx(struct net_device *dev)
1237 1218
1238 skb = dev_alloc_skb(rcvLen+5); 1219 skb = dev_alloc_skb(rcvLen+5);
1239 if (skb == NULL) { 1220 if (skb == NULL) {
1240 DEBUG(1, "netwave_rx: Could not allocate an sk_buff of " 1221 pr_debug("netwave_rx: Could not allocate an sk_buff of "
1241 "length %d\n", rcvLen); 1222 "length %d\n", rcvLen);
1242 ++dev->stats.rx_dropped; 1223 ++dev->stats.rx_dropped;
1243 /* Tell the adapter to skip the packet */ 1224 /* Tell the adapter to skip the packet */
@@ -1279,7 +1260,7 @@ static int netwave_rx(struct net_device *dev)
1279 wait_WOC(iobase); 1260 wait_WOC(iobase);
1280 writeb(NETWAVE_CMD_SRP, ramBase + NETWAVE_EREG_CB + 0); 1261 writeb(NETWAVE_CMD_SRP, ramBase + NETWAVE_EREG_CB + 0);
1281 writeb(NETWAVE_CMD_EOC, ramBase + NETWAVE_EREG_CB + 1); 1262 writeb(NETWAVE_CMD_EOC, ramBase + NETWAVE_EREG_CB + 1);
1282 DEBUG(3, "Packet reception ok\n"); 1263 pr_debug("Packet reception ok\n");
1283 } 1264 }
1284 return 0; 1265 return 0;
1285} 1266}
@@ -1288,7 +1269,7 @@ static int netwave_open(struct net_device *dev) {
1288 netwave_private *priv = netdev_priv(dev); 1269 netwave_private *priv = netdev_priv(dev);
1289 struct pcmcia_device *link = priv->p_dev; 1270 struct pcmcia_device *link = priv->p_dev;
1290 1271
1291 DEBUG(1, "netwave_open: starting.\n"); 1272 dev_dbg(&link->dev, "netwave_open: starting.\n");
1292 1273
1293 if (!pcmcia_dev_present(link)) 1274 if (!pcmcia_dev_present(link))
1294 return -ENODEV; 1275 return -ENODEV;
@@ -1305,7 +1286,7 @@ static int netwave_close(struct net_device *dev) {
1305 netwave_private *priv = netdev_priv(dev); 1286 netwave_private *priv = netdev_priv(dev);
1306 struct pcmcia_device *link = priv->p_dev; 1287 struct pcmcia_device *link = priv->p_dev;
1307 1288
1308 DEBUG(1, "netwave_close: finishing.\n"); 1289 dev_dbg(&link->dev, "netwave_close: finishing.\n");
1309 1290
1310 link->open--; 1291 link->open--;
1311 netif_stop_queue(dev); 1292 netif_stop_queue(dev);
@@ -1358,11 +1339,11 @@ static void set_multicast_list(struct net_device *dev)
1358 u_char rcvMode = 0; 1339 u_char rcvMode = 0;
1359 1340
1360#ifdef PCMCIA_DEBUG 1341#ifdef PCMCIA_DEBUG
1361 if (pc_debug > 2) { 1342 {
1362 static int old; 1343 xstatic int old;
1363 if (old != dev->mc_count) { 1344 if (old != dev->mc_count) {
1364 old = dev->mc_count; 1345 old = dev->mc_count;
1365 DEBUG(0, "%s: setting Rx mode to %d addresses.\n", 1346 pr_debug("%s: setting Rx mode to %d addresses.\n",
1366 dev->name, dev->mc_count); 1347 dev->name, dev->mc_count);
1367 } 1348 }
1368 } 1349 }
diff --git a/drivers/net/wireless/orinoco/orinoco_cs.c b/drivers/net/wireless/orinoco/orinoco_cs.c
index 38c1c9d2abb8..f27bb8367c98 100644
--- a/drivers/net/wireless/orinoco/orinoco_cs.c
+++ b/drivers/net/wireless/orinoco/orinoco_cs.c
@@ -109,7 +109,7 @@ orinoco_cs_probe(struct pcmcia_device *link)
109 struct orinoco_private *priv; 109 struct orinoco_private *priv;
110 struct orinoco_pccard *card; 110 struct orinoco_pccard *card;
111 111
112 priv = alloc_orinocodev(sizeof(*card), &handle_to_dev(link), 112 priv = alloc_orinocodev(sizeof(*card), &link->dev,
113 orinoco_cs_hard_reset, NULL); 113 orinoco_cs_hard_reset, NULL);
114 if (!priv) 114 if (!priv)
115 return -ENOMEM; 115 return -ENOMEM;
@@ -120,10 +120,8 @@ orinoco_cs_probe(struct pcmcia_device *link)
120 link->priv = priv; 120 link->priv = priv;
121 121
122 /* Interrupt setup */ 122 /* Interrupt setup */
123 link->irq.Attributes = IRQ_TYPE_DYNAMIC_SHARING | IRQ_HANDLE_PRESENT; 123 link->irq.Attributes = IRQ_TYPE_DYNAMIC_SHARING;
124 link->irq.IRQInfo1 = IRQ_LEVEL_ID;
125 link->irq.Handler = orinoco_interrupt; 124 link->irq.Handler = orinoco_interrupt;
126 link->irq.Instance = priv;
127 125
128 /* General socket configuration defaults can go here. In this 126 /* General socket configuration defaults can go here. In this
129 * client, we assume very little, and rely on the CIS for 127 * client, we assume very little, and rely on the CIS for
@@ -160,12 +158,6 @@ static void orinoco_cs_detach(struct pcmcia_device *link)
160 * device available to the system. 158 * device available to the system.
161 */ 159 */
162 160
163#define CS_CHECK(fn, ret) do { \
164 last_fn = (fn); \
165 if ((last_ret = (ret)) != 0) \
166 goto cs_failed; \
167} while (0)
168
169static int orinoco_cs_config_check(struct pcmcia_device *p_dev, 161static int orinoco_cs_config_check(struct pcmcia_device *p_dev,
170 cistpl_cftable_entry_t *cfg, 162 cistpl_cftable_entry_t *cfg,
171 cistpl_cftable_entry_t *dflt, 163 cistpl_cftable_entry_t *dflt,
@@ -240,7 +232,7 @@ orinoco_cs_config(struct pcmcia_device *link)
240 struct orinoco_private *priv = link->priv; 232 struct orinoco_private *priv = link->priv;
241 struct orinoco_pccard *card = priv->card; 233 struct orinoco_pccard *card = priv->card;
242 hermes_t *hw = &priv->hw; 234 hermes_t *hw = &priv->hw;
243 int last_fn, last_ret; 235 int ret;
244 void __iomem *mem; 236 void __iomem *mem;
245 237
246 /* 238 /*
@@ -257,13 +249,12 @@ orinoco_cs_config(struct pcmcia_device *link)
257 * and most client drivers will only use the CIS to fill in 249 * and most client drivers will only use the CIS to fill in
258 * implementation-defined details. 250 * implementation-defined details.
259 */ 251 */
260 last_ret = pcmcia_loop_config(link, orinoco_cs_config_check, NULL); 252 ret = pcmcia_loop_config(link, orinoco_cs_config_check, NULL);
261 if (last_ret) { 253 if (ret) {
262 if (!ignore_cis_vcc) 254 if (!ignore_cis_vcc)
263 printk(KERN_ERR PFX "GetNextTuple(): No matching " 255 printk(KERN_ERR PFX "GetNextTuple(): No matching "
264 "CIS configuration. Maybe you need the " 256 "CIS configuration. Maybe you need the "
265 "ignore_cis_vcc=1 parameter.\n"); 257 "ignore_cis_vcc=1 parameter.\n");
266 cs_error(link, RequestIO, last_ret);
267 goto failed; 258 goto failed;
268 } 259 }
269 260
@@ -272,14 +263,16 @@ orinoco_cs_config(struct pcmcia_device *link)
272 * a handler to the interrupt, unless the 'Handler' member of 263 * a handler to the interrupt, unless the 'Handler' member of
273 * the irq structure is initialized. 264 * the irq structure is initialized.
274 */ 265 */
275 CS_CHECK(RequestIRQ, pcmcia_request_irq(link, &link->irq)); 266 ret = pcmcia_request_irq(link, &link->irq);
267 if (ret)
268 goto failed;
276 269
277 /* We initialize the hermes structure before completing PCMCIA 270 /* We initialize the hermes structure before completing PCMCIA
278 * configuration just in case the interrupt handler gets 271 * configuration just in case the interrupt handler gets
279 * called. */ 272 * called. */
280 mem = ioport_map(link->io.BasePort1, link->io.NumPorts1); 273 mem = ioport_map(link->io.BasePort1, link->io.NumPorts1);
281 if (!mem) 274 if (!mem)
282 goto cs_failed; 275 goto failed;
283 276
284 hermes_struct_init(hw, mem, HERMES_16BIT_REGSPACING); 277 hermes_struct_init(hw, mem, HERMES_16BIT_REGSPACING);
285 278
@@ -288,8 +281,9 @@ orinoco_cs_config(struct pcmcia_device *link)
288 * the I/O windows and the interrupt mapping, and putting the 281 * the I/O windows and the interrupt mapping, and putting the
289 * card and host interface into "Memory and IO" mode. 282 * card and host interface into "Memory and IO" mode.
290 */ 283 */
291 CS_CHECK(RequestConfiguration, 284 ret = pcmcia_request_configuration(link, &link->conf);
292 pcmcia_request_configuration(link, &link->conf)); 285 if (ret)
286 goto failed;
293 287
294 /* Ok, we have the configuration, prepare to register the netdev */ 288 /* Ok, we have the configuration, prepare to register the netdev */
295 card->node.major = card->node.minor = 0; 289 card->node.major = card->node.minor = 0;
@@ -315,9 +309,6 @@ orinoco_cs_config(struct pcmcia_device *link)
315 * net_device has been registered */ 309 * net_device has been registered */
316 return 0; 310 return 0;
317 311
318 cs_failed:
319 cs_error(link, last_fn, last_ret);
320
321 failed: 312 failed:
322 orinoco_cs_release(link); 313 orinoco_cs_release(link);
323 return -ENODEV; 314 return -ENODEV;
diff --git a/drivers/net/wireless/orinoco/spectrum_cs.c b/drivers/net/wireless/orinoco/spectrum_cs.c
index c361310b885d..59bda240fdc2 100644
--- a/drivers/net/wireless/orinoco/spectrum_cs.c
+++ b/drivers/net/wireless/orinoco/spectrum_cs.c
@@ -73,9 +73,6 @@ static void spectrum_cs_release(struct pcmcia_device *link);
73#define HCR_MEM16 0x10 /* memory width bit, should be preserved */ 73#define HCR_MEM16 0x10 /* memory width bit, should be preserved */
74 74
75 75
76#define CS_CHECK(fn, ret) \
77 do { last_fn = (fn); if ((last_ret = (ret)) != 0) goto cs_failed; } while (0)
78
79/* 76/*
80 * Reset the card using configuration registers COR and CCSR. 77 * Reset the card using configuration registers COR and CCSR.
81 * If IDLE is 1, stop the firmware, so that it can be safely rewritten. 78 * If IDLE is 1, stop the firmware, so that it can be safely rewritten.
@@ -83,7 +80,7 @@ static void spectrum_cs_release(struct pcmcia_device *link);
83static int 80static int
84spectrum_reset(struct pcmcia_device *link, int idle) 81spectrum_reset(struct pcmcia_device *link, int idle)
85{ 82{
86 int last_ret, last_fn; 83 int ret;
87 conf_reg_t reg; 84 conf_reg_t reg;
88 u_int save_cor; 85 u_int save_cor;
89 86
@@ -95,23 +92,26 @@ spectrum_reset(struct pcmcia_device *link, int idle)
95 reg.Function = 0; 92 reg.Function = 0;
96 reg.Action = CS_READ; 93 reg.Action = CS_READ;
97 reg.Offset = CISREG_COR; 94 reg.Offset = CISREG_COR;
98 CS_CHECK(AccessConfigurationRegister, 95 ret = pcmcia_access_configuration_register(link, &reg);
99 pcmcia_access_configuration_register(link, &reg)); 96 if (ret)
97 goto failed;
100 save_cor = reg.Value; 98 save_cor = reg.Value;
101 99
102 /* Soft-Reset card */ 100 /* Soft-Reset card */
103 reg.Action = CS_WRITE; 101 reg.Action = CS_WRITE;
104 reg.Offset = CISREG_COR; 102 reg.Offset = CISREG_COR;
105 reg.Value = (save_cor | COR_SOFT_RESET); 103 reg.Value = (save_cor | COR_SOFT_RESET);
106 CS_CHECK(AccessConfigurationRegister, 104 ret = pcmcia_access_configuration_register(link, &reg);
107 pcmcia_access_configuration_register(link, &reg)); 105 if (ret)
106 goto failed;
108 udelay(1000); 107 udelay(1000);
109 108
110 /* Read CCSR */ 109 /* Read CCSR */
111 reg.Action = CS_READ; 110 reg.Action = CS_READ;
112 reg.Offset = CISREG_CCSR; 111 reg.Offset = CISREG_CCSR;
113 CS_CHECK(AccessConfigurationRegister, 112 ret = pcmcia_access_configuration_register(link, &reg);
114 pcmcia_access_configuration_register(link, &reg)); 113 if (ret)
114 goto failed;
115 115
116 /* 116 /*
117 * Start or stop the firmware. Memory width bit should be 117 * Start or stop the firmware. Memory width bit should be
@@ -120,21 +120,22 @@ spectrum_reset(struct pcmcia_device *link, int idle)
120 reg.Action = CS_WRITE; 120 reg.Action = CS_WRITE;
121 reg.Offset = CISREG_CCSR; 121 reg.Offset = CISREG_CCSR;
122 reg.Value = (idle ? HCR_IDLE : HCR_RUN) | (reg.Value & HCR_MEM16); 122 reg.Value = (idle ? HCR_IDLE : HCR_RUN) | (reg.Value & HCR_MEM16);
123 CS_CHECK(AccessConfigurationRegister, 123 ret = pcmcia_access_configuration_register(link, &reg);
124 pcmcia_access_configuration_register(link, &reg)); 124 if (ret)
125 goto failed;
125 udelay(1000); 126 udelay(1000);
126 127
127 /* Restore original COR configuration index */ 128 /* Restore original COR configuration index */
128 reg.Action = CS_WRITE; 129 reg.Action = CS_WRITE;
129 reg.Offset = CISREG_COR; 130 reg.Offset = CISREG_COR;
130 reg.Value = (save_cor & ~COR_SOFT_RESET); 131 reg.Value = (save_cor & ~COR_SOFT_RESET);
131 CS_CHECK(AccessConfigurationRegister, 132 ret = pcmcia_access_configuration_register(link, &reg);
132 pcmcia_access_configuration_register(link, &reg)); 133 if (ret)
134 goto failed;
133 udelay(1000); 135 udelay(1000);
134 return 0; 136 return 0;
135 137
136cs_failed: 138failed:
137 cs_error(link, last_fn, last_ret);
138 return -ENODEV; 139 return -ENODEV;
139} 140}
140 141
@@ -181,7 +182,7 @@ spectrum_cs_probe(struct pcmcia_device *link)
181 struct orinoco_private *priv; 182 struct orinoco_private *priv;
182 struct orinoco_pccard *card; 183 struct orinoco_pccard *card;
183 184
184 priv = alloc_orinocodev(sizeof(*card), &handle_to_dev(link), 185 priv = alloc_orinocodev(sizeof(*card), &link->dev,
185 spectrum_cs_hard_reset, 186 spectrum_cs_hard_reset,
186 spectrum_cs_stop_firmware); 187 spectrum_cs_stop_firmware);
187 if (!priv) 188 if (!priv)
@@ -193,10 +194,8 @@ spectrum_cs_probe(struct pcmcia_device *link)
193 link->priv = priv; 194 link->priv = priv;
194 195
195 /* Interrupt setup */ 196 /* Interrupt setup */
196 link->irq.Attributes = IRQ_TYPE_DYNAMIC_SHARING | IRQ_HANDLE_PRESENT; 197 link->irq.Attributes = IRQ_TYPE_DYNAMIC_SHARING;
197 link->irq.IRQInfo1 = IRQ_LEVEL_ID;
198 link->irq.Handler = orinoco_interrupt; 198 link->irq.Handler = orinoco_interrupt;
199 link->irq.Instance = priv;
200 199
201 /* General socket configuration defaults can go here. In this 200 /* General socket configuration defaults can go here. In this
202 * client, we assume very little, and rely on the CIS for 201 * client, we assume very little, and rely on the CIS for
@@ -307,7 +306,7 @@ spectrum_cs_config(struct pcmcia_device *link)
307 struct orinoco_private *priv = link->priv; 306 struct orinoco_private *priv = link->priv;
308 struct orinoco_pccard *card = priv->card; 307 struct orinoco_pccard *card = priv->card;
309 hermes_t *hw = &priv->hw; 308 hermes_t *hw = &priv->hw;
310 int last_fn, last_ret; 309 int ret;
311 void __iomem *mem; 310 void __iomem *mem;
312 311
313 /* 312 /*
@@ -324,13 +323,12 @@ spectrum_cs_config(struct pcmcia_device *link)
324 * and most client drivers will only use the CIS to fill in 323 * and most client drivers will only use the CIS to fill in
325 * implementation-defined details. 324 * implementation-defined details.
326 */ 325 */
327 last_ret = pcmcia_loop_config(link, spectrum_cs_config_check, NULL); 326 ret = pcmcia_loop_config(link, spectrum_cs_config_check, NULL);
328 if (last_ret) { 327 if (ret) {
329 if (!ignore_cis_vcc) 328 if (!ignore_cis_vcc)
330 printk(KERN_ERR PFX "GetNextTuple(): No matching " 329 printk(KERN_ERR PFX "GetNextTuple(): No matching "
331 "CIS configuration. Maybe you need the " 330 "CIS configuration. Maybe you need the "
332 "ignore_cis_vcc=1 parameter.\n"); 331 "ignore_cis_vcc=1 parameter.\n");
333 cs_error(link, RequestIO, last_ret);
334 goto failed; 332 goto failed;
335 } 333 }
336 334
@@ -339,14 +337,16 @@ spectrum_cs_config(struct pcmcia_device *link)
339 * a handler to the interrupt, unless the 'Handler' member of 337 * a handler to the interrupt, unless the 'Handler' member of
340 * the irq structure is initialized. 338 * the irq structure is initialized.
341 */ 339 */
342 CS_CHECK(RequestIRQ, pcmcia_request_irq(link, &link->irq)); 340 ret = pcmcia_request_irq(link, &link->irq);
341 if (ret)
342 goto failed;
343 343
344 /* We initialize the hermes structure before completing PCMCIA 344 /* We initialize the hermes structure before completing PCMCIA
345 * configuration just in case the interrupt handler gets 345 * configuration just in case the interrupt handler gets
346 * called. */ 346 * called. */
347 mem = ioport_map(link->io.BasePort1, link->io.NumPorts1); 347 mem = ioport_map(link->io.BasePort1, link->io.NumPorts1);
348 if (!mem) 348 if (!mem)
349 goto cs_failed; 349 goto failed;
350 350
351 hermes_struct_init(hw, mem, HERMES_16BIT_REGSPACING); 351 hermes_struct_init(hw, mem, HERMES_16BIT_REGSPACING);
352 352
@@ -355,8 +355,9 @@ spectrum_cs_config(struct pcmcia_device *link)
355 * the I/O windows and the interrupt mapping, and putting the 355 * the I/O windows and the interrupt mapping, and putting the
356 * card and host interface into "Memory and IO" mode. 356 * card and host interface into "Memory and IO" mode.
357 */ 357 */
358 CS_CHECK(RequestConfiguration, 358 ret = pcmcia_request_configuration(link, &link->conf);
359 pcmcia_request_configuration(link, &link->conf)); 359 if (ret)
360 goto failed;
360 361
361 /* Ok, we have the configuration, prepare to register the netdev */ 362 /* Ok, we have the configuration, prepare to register the netdev */
362 card->node.major = card->node.minor = 0; 363 card->node.major = card->node.minor = 0;
@@ -386,9 +387,6 @@ spectrum_cs_config(struct pcmcia_device *link)
386 * net_device has been registered */ 387 * net_device has been registered */
387 return 0; 388 return 0;
388 389
389 cs_failed:
390 cs_error(link, last_fn, last_ret);
391
392 failed: 390 failed:
393 spectrum_cs_release(link); 391 spectrum_cs_release(link);
394 return -ENODEV; 392 return -ENODEV;
diff --git a/drivers/net/wireless/p54/p54usb.c b/drivers/net/wireless/p54/p54usb.c
index 17e199546eeb..92af9b96bb7a 100644
--- a/drivers/net/wireless/p54/p54usb.c
+++ b/drivers/net/wireless/p54/p54usb.c
@@ -426,12 +426,16 @@ static const char p54u_romboot_3887[] = "~~~~";
426static int p54u_firmware_reset_3887(struct ieee80211_hw *dev) 426static int p54u_firmware_reset_3887(struct ieee80211_hw *dev)
427{ 427{
428 struct p54u_priv *priv = dev->priv; 428 struct p54u_priv *priv = dev->priv;
429 u8 buf[4]; 429 u8 *buf;
430 int ret; 430 int ret;
431 431
432 memcpy(&buf, p54u_romboot_3887, sizeof(buf)); 432 buf = kmalloc(4, GFP_KERNEL);
433 if (!buf)
434 return -ENOMEM;
435 memcpy(buf, p54u_romboot_3887, 4);
433 ret = p54u_bulk_msg(priv, P54U_PIPE_DATA, 436 ret = p54u_bulk_msg(priv, P54U_PIPE_DATA,
434 buf, sizeof(buf)); 437 buf, 4);
438 kfree(buf);
435 if (ret) 439 if (ret)
436 dev_err(&priv->udev->dev, "(p54usb) unable to jump to " 440 dev_err(&priv->udev->dev, "(p54usb) unable to jump to "
437 "boot ROM (%d)!\n", ret); 441 "boot ROM (%d)!\n", ret);
diff --git a/drivers/net/wireless/ray_cs.c b/drivers/net/wireless/ray_cs.c
index 1c88c2ea59aa..5b8e3e4cdd9f 100644
--- a/drivers/net/wireless/ray_cs.c
+++ b/drivers/net/wireless/ray_cs.c
@@ -71,25 +71,7 @@ typedef u_char mac_addr[ETH_ALEN]; /* Hardware address */
71#include "rayctl.h" 71#include "rayctl.h"
72#include "ray_cs.h" 72#include "ray_cs.h"
73 73
74/* All the PCMCIA modules use PCMCIA_DEBUG to control debugging. If
75 you do not define PCMCIA_DEBUG at all, all the debug code will be
76 left out. If you compile with PCMCIA_DEBUG=0, the debug code will
77 be present but disabled -- but it can then be enabled for specific
78 modules at load time with a 'pc_debug=#' option to insmod.
79*/
80 74
81#ifdef RAYLINK_DEBUG
82#define PCMCIA_DEBUG RAYLINK_DEBUG
83#endif
84#ifdef PCMCIA_DEBUG
85static int ray_debug;
86static int pc_debug = PCMCIA_DEBUG;
87module_param(pc_debug, int, 0);
88/* #define DEBUG(n, args...) if (pc_debug>(n)) printk(KERN_DEBUG args); */
89#define DEBUG(n, args...) if (pc_debug > (n)) printk(args);
90#else
91#define DEBUG(n, args...)
92#endif
93/** Prototypes based on PCMCIA skeleton driver *******************************/ 75/** Prototypes based on PCMCIA skeleton driver *******************************/
94static int ray_config(struct pcmcia_device *link); 76static int ray_config(struct pcmcia_device *link);
95static void ray_release(struct pcmcia_device *link); 77static void ray_release(struct pcmcia_device *link);
@@ -325,7 +307,7 @@ static int ray_probe(struct pcmcia_device *p_dev)
325 ray_dev_t *local; 307 ray_dev_t *local;
326 struct net_device *dev; 308 struct net_device *dev;
327 309
328 DEBUG(1, "ray_attach()\n"); 310 dev_dbg(&p_dev->dev, "ray_attach()\n");
329 311
330 /* Allocate space for private device-specific data */ 312 /* Allocate space for private device-specific data */
331 dev = alloc_etherdev(sizeof(ray_dev_t)); 313 dev = alloc_etherdev(sizeof(ray_dev_t));
@@ -341,8 +323,7 @@ static int ray_probe(struct pcmcia_device *p_dev)
341 p_dev->io.IOAddrLines = 5; 323 p_dev->io.IOAddrLines = 5;
342 324
343 /* Interrupt setup. For PCMCIA, driver takes what's given */ 325 /* Interrupt setup. For PCMCIA, driver takes what's given */
344 p_dev->irq.Attributes = IRQ_TYPE_DYNAMIC_SHARING | IRQ_HANDLE_PRESENT; 326 p_dev->irq.Attributes = IRQ_TYPE_DYNAMIC_SHARING;
345 p_dev->irq.IRQInfo1 = IRQ_LEVEL_ID;
346 p_dev->irq.Handler = &ray_interrupt; 327 p_dev->irq.Handler = &ray_interrupt;
347 328
348 /* General socket configuration */ 329 /* General socket configuration */
@@ -351,13 +332,12 @@ static int ray_probe(struct pcmcia_device *p_dev)
351 p_dev->conf.ConfigIndex = 1; 332 p_dev->conf.ConfigIndex = 1;
352 333
353 p_dev->priv = dev; 334 p_dev->priv = dev;
354 p_dev->irq.Instance = dev;
355 335
356 local->finder = p_dev; 336 local->finder = p_dev;
357 local->card_status = CARD_INSERTED; 337 local->card_status = CARD_INSERTED;
358 local->authentication_state = UNAUTHENTICATED; 338 local->authentication_state = UNAUTHENTICATED;
359 local->num_multi = 0; 339 local->num_multi = 0;
360 DEBUG(2, "ray_attach p_dev = %p, dev = %p, local = %p, intr = %p\n", 340 dev_dbg(&p_dev->dev, "ray_attach p_dev = %p, dev = %p, local = %p, intr = %p\n",
361 p_dev, dev, local, &ray_interrupt); 341 p_dev, dev, local, &ray_interrupt);
362 342
363 /* Raylink entries in the device structure */ 343 /* Raylink entries in the device structure */
@@ -370,7 +350,7 @@ static int ray_probe(struct pcmcia_device *p_dev)
370#endif /* WIRELESS_SPY */ 350#endif /* WIRELESS_SPY */
371 351
372 352
373 DEBUG(2, "ray_cs ray_attach calling ether_setup.)\n"); 353 dev_dbg(&p_dev->dev, "ray_cs ray_attach calling ether_setup.)\n");
374 netif_stop_queue(dev); 354 netif_stop_queue(dev);
375 355
376 init_timer(&local->timer); 356 init_timer(&local->timer);
@@ -393,7 +373,7 @@ static void ray_detach(struct pcmcia_device *link)
393 struct net_device *dev; 373 struct net_device *dev;
394 ray_dev_t *local; 374 ray_dev_t *local;
395 375
396 DEBUG(1, "ray_detach(0x%p)\n", link); 376 dev_dbg(&link->dev, "ray_detach\n");
397 377
398 this_device = NULL; 378 this_device = NULL;
399 dev = link->priv; 379 dev = link->priv;
@@ -408,7 +388,7 @@ static void ray_detach(struct pcmcia_device *link)
408 unregister_netdev(dev); 388 unregister_netdev(dev);
409 free_netdev(dev); 389 free_netdev(dev);
410 } 390 }
411 DEBUG(2, "ray_cs ray_detach ending\n"); 391 dev_dbg(&link->dev, "ray_cs ray_detach ending\n");
412} /* ray_detach */ 392} /* ray_detach */
413 393
414/*============================================================================= 394/*=============================================================================
@@ -416,19 +396,17 @@ static void ray_detach(struct pcmcia_device *link)
416 is received, to configure the PCMCIA socket, and to make the 396 is received, to configure the PCMCIA socket, and to make the
417 ethernet device available to the system. 397 ethernet device available to the system.
418=============================================================================*/ 398=============================================================================*/
419#define CS_CHECK(fn, ret) \
420do { last_fn = (fn); if ((last_ret = (ret)) != 0) goto cs_failed; } while (0)
421#define MAX_TUPLE_SIZE 128 399#define MAX_TUPLE_SIZE 128
422static int ray_config(struct pcmcia_device *link) 400static int ray_config(struct pcmcia_device *link)
423{ 401{
424 int last_fn = 0, last_ret = 0; 402 int ret = 0;
425 int i; 403 int i;
426 win_req_t req; 404 win_req_t req;
427 memreq_t mem; 405 memreq_t mem;
428 struct net_device *dev = (struct net_device *)link->priv; 406 struct net_device *dev = (struct net_device *)link->priv;
429 ray_dev_t *local = netdev_priv(dev); 407 ray_dev_t *local = netdev_priv(dev);
430 408
431 DEBUG(1, "ray_config(0x%p)\n", link); 409 dev_dbg(&link->dev, "ray_config\n");
432 410
433 /* Determine card type and firmware version */ 411 /* Determine card type and firmware version */
434 printk(KERN_INFO "ray_cs Detected: %s%s%s%s\n", 412 printk(KERN_INFO "ray_cs Detected: %s%s%s%s\n",
@@ -440,14 +418,17 @@ static int ray_config(struct pcmcia_device *link)
440 /* Now allocate an interrupt line. Note that this does not 418 /* Now allocate an interrupt line. Note that this does not
441 actually assign a handler to the interrupt. 419 actually assign a handler to the interrupt.
442 */ 420 */
443 CS_CHECK(RequestIRQ, pcmcia_request_irq(link, &link->irq)); 421 ret = pcmcia_request_irq(link, &link->irq);
422 if (ret)
423 goto failed;
444 dev->irq = link->irq.AssignedIRQ; 424 dev->irq = link->irq.AssignedIRQ;
445 425
446 /* This actually configures the PCMCIA socket -- setting up 426 /* This actually configures the PCMCIA socket -- setting up
447 the I/O windows and the interrupt mapping. 427 the I/O windows and the interrupt mapping.
448 */ 428 */
449 CS_CHECK(RequestConfiguration, 429 ret = pcmcia_request_configuration(link, &link->conf);
450 pcmcia_request_configuration(link, &link->conf)); 430 if (ret)
431 goto failed;
451 432
452/*** Set up 32k window for shared memory (transmit and control) ************/ 433/*** Set up 32k window for shared memory (transmit and control) ************/
453 req.Attributes = 434 req.Attributes =
@@ -455,10 +436,14 @@ static int ray_config(struct pcmcia_device *link)
455 req.Base = 0; 436 req.Base = 0;
456 req.Size = 0x8000; 437 req.Size = 0x8000;
457 req.AccessSpeed = ray_mem_speed; 438 req.AccessSpeed = ray_mem_speed;
458 CS_CHECK(RequestWindow, pcmcia_request_window(&link, &req, &link->win)); 439 ret = pcmcia_request_window(link, &req, &link->win);
440 if (ret)
441 goto failed;
459 mem.CardOffset = 0x0000; 442 mem.CardOffset = 0x0000;
460 mem.Page = 0; 443 mem.Page = 0;
461 CS_CHECK(MapMemPage, pcmcia_map_mem_page(link->win, &mem)); 444 ret = pcmcia_map_mem_page(link, link->win, &mem);
445 if (ret)
446 goto failed;
462 local->sram = ioremap(req.Base, req.Size); 447 local->sram = ioremap(req.Base, req.Size);
463 448
464/*** Set up 16k window for shared memory (receive buffer) ***************/ 449/*** Set up 16k window for shared memory (receive buffer) ***************/
@@ -467,11 +452,14 @@ static int ray_config(struct pcmcia_device *link)
467 req.Base = 0; 452 req.Base = 0;
468 req.Size = 0x4000; 453 req.Size = 0x4000;
469 req.AccessSpeed = ray_mem_speed; 454 req.AccessSpeed = ray_mem_speed;
470 CS_CHECK(RequestWindow, 455 ret = pcmcia_request_window(link, &req, &local->rmem_handle);
471 pcmcia_request_window(&link, &req, &local->rmem_handle)); 456 if (ret)
457 goto failed;
472 mem.CardOffset = 0x8000; 458 mem.CardOffset = 0x8000;
473 mem.Page = 0; 459 mem.Page = 0;
474 CS_CHECK(MapMemPage, pcmcia_map_mem_page(local->rmem_handle, &mem)); 460 ret = pcmcia_map_mem_page(link, local->rmem_handle, &mem);
461 if (ret)
462 goto failed;
475 local->rmem = ioremap(req.Base, req.Size); 463 local->rmem = ioremap(req.Base, req.Size);
476 464
477/*** Set up window for attribute memory ***********************************/ 465/*** Set up window for attribute memory ***********************************/
@@ -480,22 +468,25 @@ static int ray_config(struct pcmcia_device *link)
480 req.Base = 0; 468 req.Base = 0;
481 req.Size = 0x1000; 469 req.Size = 0x1000;
482 req.AccessSpeed = ray_mem_speed; 470 req.AccessSpeed = ray_mem_speed;
483 CS_CHECK(RequestWindow, 471 ret = pcmcia_request_window(link, &req, &local->amem_handle);
484 pcmcia_request_window(&link, &req, &local->amem_handle)); 472 if (ret)
473 goto failed;
485 mem.CardOffset = 0x0000; 474 mem.CardOffset = 0x0000;
486 mem.Page = 0; 475 mem.Page = 0;
487 CS_CHECK(MapMemPage, pcmcia_map_mem_page(local->amem_handle, &mem)); 476 ret = pcmcia_map_mem_page(link, local->amem_handle, &mem);
477 if (ret)
478 goto failed;
488 local->amem = ioremap(req.Base, req.Size); 479 local->amem = ioremap(req.Base, req.Size);
489 480
490 DEBUG(3, "ray_config sram=%p\n", local->sram); 481 dev_dbg(&link->dev, "ray_config sram=%p\n", local->sram);
491 DEBUG(3, "ray_config rmem=%p\n", local->rmem); 482 dev_dbg(&link->dev, "ray_config rmem=%p\n", local->rmem);
492 DEBUG(3, "ray_config amem=%p\n", local->amem); 483 dev_dbg(&link->dev, "ray_config amem=%p\n", local->amem);
493 if (ray_init(dev) < 0) { 484 if (ray_init(dev) < 0) {
494 ray_release(link); 485 ray_release(link);
495 return -ENODEV; 486 return -ENODEV;
496 } 487 }
497 488
498 SET_NETDEV_DEV(dev, &handle_to_dev(link)); 489 SET_NETDEV_DEV(dev, &link->dev);
499 i = register_netdev(dev); 490 i = register_netdev(dev);
500 if (i != 0) { 491 if (i != 0) {
501 printk("ray_config register_netdev() failed\n"); 492 printk("ray_config register_netdev() failed\n");
@@ -511,9 +502,7 @@ static int ray_config(struct pcmcia_device *link)
511 502
512 return 0; 503 return 0;
513 504
514cs_failed: 505failed:
515 cs_error(link, last_fn, last_ret);
516
517 ray_release(link); 506 ray_release(link);
518 return -ENODEV; 507 return -ENODEV;
519} /* ray_config */ 508} /* ray_config */
@@ -543,9 +532,9 @@ static int ray_init(struct net_device *dev)
543 struct ccs __iomem *pccs; 532 struct ccs __iomem *pccs;
544 ray_dev_t *local = netdev_priv(dev); 533 ray_dev_t *local = netdev_priv(dev);
545 struct pcmcia_device *link = local->finder; 534 struct pcmcia_device *link = local->finder;
546 DEBUG(1, "ray_init(0x%p)\n", dev); 535 dev_dbg(&link->dev, "ray_init(0x%p)\n", dev);
547 if (!(pcmcia_dev_present(link))) { 536 if (!(pcmcia_dev_present(link))) {
548 DEBUG(0, "ray_init - device not present\n"); 537 dev_dbg(&link->dev, "ray_init - device not present\n");
549 return -1; 538 return -1;
550 } 539 }
551 540
@@ -567,13 +556,13 @@ static int ray_init(struct net_device *dev)
567 local->fw_ver = local->startup_res.firmware_version[0]; 556 local->fw_ver = local->startup_res.firmware_version[0];
568 local->fw_bld = local->startup_res.firmware_version[1]; 557 local->fw_bld = local->startup_res.firmware_version[1];
569 local->fw_var = local->startup_res.firmware_version[2]; 558 local->fw_var = local->startup_res.firmware_version[2];
570 DEBUG(1, "ray_init firmware version %d.%d \n", local->fw_ver, 559 dev_dbg(&link->dev, "ray_init firmware version %d.%d \n", local->fw_ver,
571 local->fw_bld); 560 local->fw_bld);
572 561
573 local->tib_length = 0x20; 562 local->tib_length = 0x20;
574 if ((local->fw_ver == 5) && (local->fw_bld >= 30)) 563 if ((local->fw_ver == 5) && (local->fw_bld >= 30))
575 local->tib_length = local->startup_res.tib_length; 564 local->tib_length = local->startup_res.tib_length;
576 DEBUG(2, "ray_init tib_length = 0x%02x\n", local->tib_length); 565 dev_dbg(&link->dev, "ray_init tib_length = 0x%02x\n", local->tib_length);
577 /* Initialize CCS's to buffer free state */ 566 /* Initialize CCS's to buffer free state */
578 pccs = ccs_base(local); 567 pccs = ccs_base(local);
579 for (i = 0; i < NUMBER_OF_CCS; i++) { 568 for (i = 0; i < NUMBER_OF_CCS; i++) {
@@ -592,7 +581,7 @@ static int ray_init(struct net_device *dev)
592 581
593 clear_interrupt(local); /* Clear any interrupt from the card */ 582 clear_interrupt(local); /* Clear any interrupt from the card */
594 local->card_status = CARD_AWAITING_PARAM; 583 local->card_status = CARD_AWAITING_PARAM;
595 DEBUG(2, "ray_init ending\n"); 584 dev_dbg(&link->dev, "ray_init ending\n");
596 return 0; 585 return 0;
597} /* ray_init */ 586} /* ray_init */
598 587
@@ -605,9 +594,9 @@ static int dl_startup_params(struct net_device *dev)
605 struct ccs __iomem *pccs; 594 struct ccs __iomem *pccs;
606 struct pcmcia_device *link = local->finder; 595 struct pcmcia_device *link = local->finder;
607 596
608 DEBUG(1, "dl_startup_params entered\n"); 597 dev_dbg(&link->dev, "dl_startup_params entered\n");
609 if (!(pcmcia_dev_present(link))) { 598 if (!(pcmcia_dev_present(link))) {
610 DEBUG(2, "ray_cs dl_startup_params - device not present\n"); 599 dev_dbg(&link->dev, "ray_cs dl_startup_params - device not present\n");
611 return -1; 600 return -1;
612 } 601 }
613 602
@@ -625,7 +614,7 @@ static int dl_startup_params(struct net_device *dev)
625 local->dl_param_ccs = ccsindex; 614 local->dl_param_ccs = ccsindex;
626 pccs = ccs_base(local) + ccsindex; 615 pccs = ccs_base(local) + ccsindex;
627 writeb(CCS_DOWNLOAD_STARTUP_PARAMS, &pccs->cmd); 616 writeb(CCS_DOWNLOAD_STARTUP_PARAMS, &pccs->cmd);
628 DEBUG(2, "dl_startup_params start ccsindex = %d\n", 617 dev_dbg(&link->dev, "dl_startup_params start ccsindex = %d\n",
629 local->dl_param_ccs); 618 local->dl_param_ccs);
630 /* Interrupt the firmware to process the command */ 619 /* Interrupt the firmware to process the command */
631 if (interrupt_ecf(local, ccsindex)) { 620 if (interrupt_ecf(local, ccsindex)) {
@@ -641,7 +630,7 @@ static int dl_startup_params(struct net_device *dev)
641 local->timer.data = (long)local; 630 local->timer.data = (long)local;
642 local->timer.function = &verify_dl_startup; 631 local->timer.function = &verify_dl_startup;
643 add_timer(&local->timer); 632 add_timer(&local->timer);
644 DEBUG(2, 633 dev_dbg(&link->dev,
645 "ray_cs dl_startup_params started timer for verify_dl_startup\n"); 634 "ray_cs dl_startup_params started timer for verify_dl_startup\n");
646 return 0; 635 return 0;
647} /* dl_startup_params */ 636} /* dl_startup_params */
@@ -717,11 +706,11 @@ static void verify_dl_startup(u_long data)
717 struct pcmcia_device *link = local->finder; 706 struct pcmcia_device *link = local->finder;
718 707
719 if (!(pcmcia_dev_present(link))) { 708 if (!(pcmcia_dev_present(link))) {
720 DEBUG(2, "ray_cs verify_dl_startup - device not present\n"); 709 dev_dbg(&link->dev, "ray_cs verify_dl_startup - device not present\n");
721 return; 710 return;
722 } 711 }
723#ifdef PCMCIA_DEBUG 712#if 0
724 if (pc_debug > 2) { 713 {
725 int i; 714 int i;
726 printk(KERN_DEBUG 715 printk(KERN_DEBUG
727 "verify_dl_startup parameters sent via ccs %d:\n", 716 "verify_dl_startup parameters sent via ccs %d:\n",
@@ -760,7 +749,7 @@ static void start_net(u_long data)
760 int ccsindex; 749 int ccsindex;
761 struct pcmcia_device *link = local->finder; 750 struct pcmcia_device *link = local->finder;
762 if (!(pcmcia_dev_present(link))) { 751 if (!(pcmcia_dev_present(link))) {
763 DEBUG(2, "ray_cs start_net - device not present\n"); 752 dev_dbg(&link->dev, "ray_cs start_net - device not present\n");
764 return; 753 return;
765 } 754 }
766 /* Fill in the CCS fields for the ECF */ 755 /* Fill in the CCS fields for the ECF */
@@ -771,7 +760,7 @@ static void start_net(u_long data)
771 writeb(0, &pccs->var.start_network.update_param); 760 writeb(0, &pccs->var.start_network.update_param);
772 /* Interrupt the firmware to process the command */ 761 /* Interrupt the firmware to process the command */
773 if (interrupt_ecf(local, ccsindex)) { 762 if (interrupt_ecf(local, ccsindex)) {
774 DEBUG(1, "ray start net failed - card not ready for intr\n"); 763 dev_dbg(&link->dev, "ray start net failed - card not ready for intr\n");
775 writeb(CCS_BUFFER_FREE, &(pccs++)->buffer_status); 764 writeb(CCS_BUFFER_FREE, &(pccs++)->buffer_status);
776 return; 765 return;
777 } 766 }
@@ -790,7 +779,7 @@ static void join_net(u_long data)
790 struct pcmcia_device *link = local->finder; 779 struct pcmcia_device *link = local->finder;
791 780
792 if (!(pcmcia_dev_present(link))) { 781 if (!(pcmcia_dev_present(link))) {
793 DEBUG(2, "ray_cs join_net - device not present\n"); 782 dev_dbg(&link->dev, "ray_cs join_net - device not present\n");
794 return; 783 return;
795 } 784 }
796 /* Fill in the CCS fields for the ECF */ 785 /* Fill in the CCS fields for the ECF */
@@ -802,7 +791,7 @@ static void join_net(u_long data)
802 writeb(0, &pccs->var.join_network.net_initiated); 791 writeb(0, &pccs->var.join_network.net_initiated);
803 /* Interrupt the firmware to process the command */ 792 /* Interrupt the firmware to process the command */
804 if (interrupt_ecf(local, ccsindex)) { 793 if (interrupt_ecf(local, ccsindex)) {
805 DEBUG(1, "ray join net failed - card not ready for intr\n"); 794 dev_dbg(&link->dev, "ray join net failed - card not ready for intr\n");
806 writeb(CCS_BUFFER_FREE, &(pccs++)->buffer_status); 795 writeb(CCS_BUFFER_FREE, &(pccs++)->buffer_status);
807 return; 796 return;
808 } 797 }
@@ -821,7 +810,7 @@ static void ray_release(struct pcmcia_device *link)
821 ray_dev_t *local = netdev_priv(dev); 810 ray_dev_t *local = netdev_priv(dev);
822 int i; 811 int i;
823 812
824 DEBUG(1, "ray_release(0x%p)\n", link); 813 dev_dbg(&link->dev, "ray_release\n");
825 814
826 del_timer(&local->timer); 815 del_timer(&local->timer);
827 816
@@ -829,15 +818,15 @@ static void ray_release(struct pcmcia_device *link)
829 iounmap(local->rmem); 818 iounmap(local->rmem);
830 iounmap(local->amem); 819 iounmap(local->amem);
831 /* Do bother checking to see if these succeed or not */ 820 /* Do bother checking to see if these succeed or not */
832 i = pcmcia_release_window(local->amem_handle); 821 i = pcmcia_release_window(link, local->amem_handle);
833 if (i != 0) 822 if (i != 0)
834 DEBUG(0, "ReleaseWindow(local->amem) ret = %x\n", i); 823 dev_dbg(&link->dev, "ReleaseWindow(local->amem) ret = %x\n", i);
835 i = pcmcia_release_window(local->rmem_handle); 824 i = pcmcia_release_window(link, local->rmem_handle);
836 if (i != 0) 825 if (i != 0)
837 DEBUG(0, "ReleaseWindow(local->rmem) ret = %x\n", i); 826 dev_dbg(&link->dev, "ReleaseWindow(local->rmem) ret = %x\n", i);
838 pcmcia_disable_device(link); 827 pcmcia_disable_device(link);
839 828
840 DEBUG(2, "ray_release ending\n"); 829 dev_dbg(&link->dev, "ray_release ending\n");
841} 830}
842 831
843static int ray_suspend(struct pcmcia_device *link) 832static int ray_suspend(struct pcmcia_device *link)
@@ -871,9 +860,9 @@ static int ray_dev_init(struct net_device *dev)
871 ray_dev_t *local = netdev_priv(dev); 860 ray_dev_t *local = netdev_priv(dev);
872 struct pcmcia_device *link = local->finder; 861 struct pcmcia_device *link = local->finder;
873 862
874 DEBUG(1, "ray_dev_init(dev=%p)\n", dev); 863 dev_dbg(&link->dev, "ray_dev_init(dev=%p)\n", dev);
875 if (!(pcmcia_dev_present(link))) { 864 if (!(pcmcia_dev_present(link))) {
876 DEBUG(2, "ray_dev_init - device not present\n"); 865 dev_dbg(&link->dev, "ray_dev_init - device not present\n");
877 return -1; 866 return -1;
878 } 867 }
879#ifdef RAY_IMMEDIATE_INIT 868#ifdef RAY_IMMEDIATE_INIT
@@ -887,7 +876,7 @@ static int ray_dev_init(struct net_device *dev)
887 /* Postpone the card init so that we can still configure the card, 876 /* Postpone the card init so that we can still configure the card,
888 * for example using the Wireless Extensions. The init will happen 877 * for example using the Wireless Extensions. The init will happen
889 * in ray_open() - Jean II */ 878 * in ray_open() - Jean II */
890 DEBUG(1, 879 dev_dbg(&link->dev,
891 "ray_dev_init: postponing card init to ray_open() ; Status = %d\n", 880 "ray_dev_init: postponing card init to ray_open() ; Status = %d\n",
892 local->card_status); 881 local->card_status);
893#endif /* RAY_IMMEDIATE_INIT */ 882#endif /* RAY_IMMEDIATE_INIT */
@@ -896,7 +885,7 @@ static int ray_dev_init(struct net_device *dev)
896 memcpy(dev->dev_addr, &local->sparm.b4.a_mac_addr, ADDRLEN); 885 memcpy(dev->dev_addr, &local->sparm.b4.a_mac_addr, ADDRLEN);
897 memset(dev->broadcast, 0xff, ETH_ALEN); 886 memset(dev->broadcast, 0xff, ETH_ALEN);
898 887
899 DEBUG(2, "ray_dev_init ending\n"); 888 dev_dbg(&link->dev, "ray_dev_init ending\n");
900 return 0; 889 return 0;
901} 890}
902 891
@@ -906,9 +895,9 @@ static int ray_dev_config(struct net_device *dev, struct ifmap *map)
906 ray_dev_t *local = netdev_priv(dev); 895 ray_dev_t *local = netdev_priv(dev);
907 struct pcmcia_device *link = local->finder; 896 struct pcmcia_device *link = local->finder;
908 /* Dummy routine to satisfy device structure */ 897 /* Dummy routine to satisfy device structure */
909 DEBUG(1, "ray_dev_config(dev=%p,ifmap=%p)\n", dev, map); 898 dev_dbg(&link->dev, "ray_dev_config(dev=%p,ifmap=%p)\n", dev, map);
910 if (!(pcmcia_dev_present(link))) { 899 if (!(pcmcia_dev_present(link))) {
911 DEBUG(2, "ray_dev_config - device not present\n"); 900 dev_dbg(&link->dev, "ray_dev_config - device not present\n");
912 return -1; 901 return -1;
913 } 902 }
914 903
@@ -924,14 +913,14 @@ static netdev_tx_t ray_dev_start_xmit(struct sk_buff *skb,
924 short length = skb->len; 913 short length = skb->len;
925 914
926 if (!pcmcia_dev_present(link)) { 915 if (!pcmcia_dev_present(link)) {
927 DEBUG(2, "ray_dev_start_xmit - device not present\n"); 916 dev_dbg(&link->dev, "ray_dev_start_xmit - device not present\n");
928 dev_kfree_skb(skb); 917 dev_kfree_skb(skb);
929 return NETDEV_TX_OK; 918 return NETDEV_TX_OK;
930 } 919 }
931 920
932 DEBUG(3, "ray_dev_start_xmit(skb=%p, dev=%p)\n", skb, dev); 921 dev_dbg(&link->dev, "ray_dev_start_xmit(skb=%p, dev=%p)\n", skb, dev);
933 if (local->authentication_state == NEED_TO_AUTH) { 922 if (local->authentication_state == NEED_TO_AUTH) {
934 DEBUG(0, "ray_cs Sending authentication request.\n"); 923 dev_dbg(&link->dev, "ray_cs Sending authentication request.\n");
935 if (!build_auth_frame(local, local->auth_id, OPEN_AUTH_REQUEST)) { 924 if (!build_auth_frame(local, local->auth_id, OPEN_AUTH_REQUEST)) {
936 local->authentication_state = AUTHENTICATED; 925 local->authentication_state = AUTHENTICATED;
937 netif_stop_queue(dev); 926 netif_stop_queue(dev);
@@ -971,7 +960,7 @@ static int ray_hw_xmit(unsigned char *data, int len, struct net_device *dev,
971 struct tx_msg __iomem *ptx; /* Address of xmit buffer in PC space */ 960 struct tx_msg __iomem *ptx; /* Address of xmit buffer in PC space */
972 short int addr; /* Address of xmit buffer in card space */ 961 short int addr; /* Address of xmit buffer in card space */
973 962
974 DEBUG(3, "ray_hw_xmit(data=%p, len=%d, dev=%p)\n", data, len, dev); 963 pr_debug("ray_hw_xmit(data=%p, len=%d, dev=%p)\n", data, len, dev);
975 if (len + TX_HEADER_LENGTH > TX_BUF_SIZE) { 964 if (len + TX_HEADER_LENGTH > TX_BUF_SIZE) {
976 printk(KERN_INFO "ray_hw_xmit packet too large: %d bytes\n", 965 printk(KERN_INFO "ray_hw_xmit packet too large: %d bytes\n",
977 len); 966 len);
@@ -979,9 +968,9 @@ static int ray_hw_xmit(unsigned char *data, int len, struct net_device *dev,
979 } 968 }
980 switch (ccsindex = get_free_tx_ccs(local)) { 969 switch (ccsindex = get_free_tx_ccs(local)) {
981 case ECCSBUSY: 970 case ECCSBUSY:
982 DEBUG(2, "ray_hw_xmit tx_ccs table busy\n"); 971 pr_debug("ray_hw_xmit tx_ccs table busy\n");
983 case ECCSFULL: 972 case ECCSFULL:
984 DEBUG(2, "ray_hw_xmit No free tx ccs\n"); 973 pr_debug("ray_hw_xmit No free tx ccs\n");
985 case ECARDGONE: 974 case ECARDGONE:
986 netif_stop_queue(dev); 975 netif_stop_queue(dev);
987 return XMIT_NO_CCS; 976 return XMIT_NO_CCS;
@@ -1018,12 +1007,12 @@ static int ray_hw_xmit(unsigned char *data, int len, struct net_device *dev,
1018 writeb(PSM_CAM, &pccs->var.tx_request.pow_sav_mode); 1007 writeb(PSM_CAM, &pccs->var.tx_request.pow_sav_mode);
1019 writeb(local->net_default_tx_rate, &pccs->var.tx_request.tx_rate); 1008 writeb(local->net_default_tx_rate, &pccs->var.tx_request.tx_rate);
1020 writeb(0, &pccs->var.tx_request.antenna); 1009 writeb(0, &pccs->var.tx_request.antenna);
1021 DEBUG(3, "ray_hw_xmit default_tx_rate = 0x%x\n", 1010 pr_debug("ray_hw_xmit default_tx_rate = 0x%x\n",
1022 local->net_default_tx_rate); 1011 local->net_default_tx_rate);
1023 1012
1024 /* Interrupt the firmware to process the command */ 1013 /* Interrupt the firmware to process the command */
1025 if (interrupt_ecf(local, ccsindex)) { 1014 if (interrupt_ecf(local, ccsindex)) {
1026 DEBUG(2, "ray_hw_xmit failed - ECF not ready for intr\n"); 1015 pr_debug("ray_hw_xmit failed - ECF not ready for intr\n");
1027/* TBD very inefficient to copy packet to buffer, and then not 1016/* TBD very inefficient to copy packet to buffer, and then not
1028 send it, but the alternative is to queue the messages and that 1017 send it, but the alternative is to queue the messages and that
1029 won't be done for a while. Maybe set tbusy until a CCS is free? 1018 won't be done for a while. Maybe set tbusy until a CCS is free?
@@ -1040,7 +1029,7 @@ static int translate_frame(ray_dev_t *local, struct tx_msg __iomem *ptx,
1040{ 1029{
1041 __be16 proto = ((struct ethhdr *)data)->h_proto; 1030 __be16 proto = ((struct ethhdr *)data)->h_proto;
1042 if (ntohs(proto) >= 1536) { /* DIX II ethernet frame */ 1031 if (ntohs(proto) >= 1536) { /* DIX II ethernet frame */
1043 DEBUG(3, "ray_cs translate_frame DIX II\n"); 1032 pr_debug("ray_cs translate_frame DIX II\n");
1044 /* Copy LLC header to card buffer */ 1033 /* Copy LLC header to card buffer */
1045 memcpy_toio(&ptx->var, eth2_llc, sizeof(eth2_llc)); 1034 memcpy_toio(&ptx->var, eth2_llc, sizeof(eth2_llc));
1046 memcpy_toio(((void __iomem *)&ptx->var) + sizeof(eth2_llc), 1035 memcpy_toio(((void __iomem *)&ptx->var) + sizeof(eth2_llc),
@@ -1056,9 +1045,9 @@ static int translate_frame(ray_dev_t *local, struct tx_msg __iomem *ptx,
1056 len - ETH_HLEN); 1045 len - ETH_HLEN);
1057 return (int)sizeof(struct snaphdr_t) - ETH_HLEN; 1046 return (int)sizeof(struct snaphdr_t) - ETH_HLEN;
1058 } else { /* already 802 type, and proto is length */ 1047 } else { /* already 802 type, and proto is length */
1059 DEBUG(3, "ray_cs translate_frame 802\n"); 1048 pr_debug("ray_cs translate_frame 802\n");
1060 if (proto == htons(0xffff)) { /* evil netware IPX 802.3 without LLC */ 1049 if (proto == htons(0xffff)) { /* evil netware IPX 802.3 without LLC */
1061 DEBUG(3, "ray_cs translate_frame evil IPX\n"); 1050 pr_debug("ray_cs translate_frame evil IPX\n");
1062 memcpy_toio(&ptx->var, data + ETH_HLEN, len - ETH_HLEN); 1051 memcpy_toio(&ptx->var, data + ETH_HLEN, len - ETH_HLEN);
1063 return 0 - ETH_HLEN; 1052 return 0 - ETH_HLEN;
1064 } 1053 }
@@ -1603,7 +1592,7 @@ static int ray_open(struct net_device *dev)
1603 struct pcmcia_device *link; 1592 struct pcmcia_device *link;
1604 link = local->finder; 1593 link = local->finder;
1605 1594
1606 DEBUG(1, "ray_open('%s')\n", dev->name); 1595 dev_dbg(&link->dev, "ray_open('%s')\n", dev->name);
1607 1596
1608 if (link->open == 0) 1597 if (link->open == 0)
1609 local->num_multi = 0; 1598 local->num_multi = 0;
@@ -1613,7 +1602,7 @@ static int ray_open(struct net_device *dev)
1613 if (local->card_status == CARD_AWAITING_PARAM) { 1602 if (local->card_status == CARD_AWAITING_PARAM) {
1614 int i; 1603 int i;
1615 1604
1616 DEBUG(1, "ray_open: doing init now !\n"); 1605 dev_dbg(&link->dev, "ray_open: doing init now !\n");
1617 1606
1618 /* Download startup parameters */ 1607 /* Download startup parameters */
1619 if ((i = dl_startup_params(dev)) < 0) { 1608 if ((i = dl_startup_params(dev)) < 0) {
@@ -1629,7 +1618,7 @@ static int ray_open(struct net_device *dev)
1629 else 1618 else
1630 netif_start_queue(dev); 1619 netif_start_queue(dev);
1631 1620
1632 DEBUG(2, "ray_open ending\n"); 1621 dev_dbg(&link->dev, "ray_open ending\n");
1633 return 0; 1622 return 0;
1634} /* end ray_open */ 1623} /* end ray_open */
1635 1624
@@ -1640,7 +1629,7 @@ static int ray_dev_close(struct net_device *dev)
1640 struct pcmcia_device *link; 1629 struct pcmcia_device *link;
1641 link = local->finder; 1630 link = local->finder;
1642 1631
1643 DEBUG(1, "ray_dev_close('%s')\n", dev->name); 1632 dev_dbg(&link->dev, "ray_dev_close('%s')\n", dev->name);
1644 1633
1645 link->open--; 1634 link->open--;
1646 netif_stop_queue(dev); 1635 netif_stop_queue(dev);
@@ -1656,7 +1645,7 @@ static int ray_dev_close(struct net_device *dev)
1656/*===========================================================================*/ 1645/*===========================================================================*/
1657static void ray_reset(struct net_device *dev) 1646static void ray_reset(struct net_device *dev)
1658{ 1647{
1659 DEBUG(1, "ray_reset entered\n"); 1648 pr_debug("ray_reset entered\n");
1660 return; 1649 return;
1661} 1650}
1662 1651
@@ -1669,17 +1658,17 @@ static int interrupt_ecf(ray_dev_t *local, int ccs)
1669 struct pcmcia_device *link = local->finder; 1658 struct pcmcia_device *link = local->finder;
1670 1659
1671 if (!(pcmcia_dev_present(link))) { 1660 if (!(pcmcia_dev_present(link))) {
1672 DEBUG(2, "ray_cs interrupt_ecf - device not present\n"); 1661 dev_dbg(&link->dev, "ray_cs interrupt_ecf - device not present\n");
1673 return -1; 1662 return -1;
1674 } 1663 }
1675 DEBUG(2, "interrupt_ecf(local=%p, ccs = 0x%x\n", local, ccs); 1664 dev_dbg(&link->dev, "interrupt_ecf(local=%p, ccs = 0x%x\n", local, ccs);
1676 1665
1677 while (i && 1666 while (i &&
1678 (readb(local->amem + CIS_OFFSET + ECF_INTR_OFFSET) & 1667 (readb(local->amem + CIS_OFFSET + ECF_INTR_OFFSET) &
1679 ECF_INTR_SET)) 1668 ECF_INTR_SET))
1680 i--; 1669 i--;
1681 if (i == 0) { 1670 if (i == 0) {
1682 DEBUG(2, "ray_cs interrupt_ecf card not ready for interrupt\n"); 1671 dev_dbg(&link->dev, "ray_cs interrupt_ecf card not ready for interrupt\n");
1683 return -1; 1672 return -1;
1684 } 1673 }
1685 /* Fill the mailbox, then kick the card */ 1674 /* Fill the mailbox, then kick the card */
@@ -1698,12 +1687,12 @@ static int get_free_tx_ccs(ray_dev_t *local)
1698 struct pcmcia_device *link = local->finder; 1687 struct pcmcia_device *link = local->finder;
1699 1688
1700 if (!(pcmcia_dev_present(link))) { 1689 if (!(pcmcia_dev_present(link))) {
1701 DEBUG(2, "ray_cs get_free_tx_ccs - device not present\n"); 1690 dev_dbg(&link->dev, "ray_cs get_free_tx_ccs - device not present\n");
1702 return ECARDGONE; 1691 return ECARDGONE;
1703 } 1692 }
1704 1693
1705 if (test_and_set_bit(0, &local->tx_ccs_lock)) { 1694 if (test_and_set_bit(0, &local->tx_ccs_lock)) {
1706 DEBUG(1, "ray_cs tx_ccs_lock busy\n"); 1695 dev_dbg(&link->dev, "ray_cs tx_ccs_lock busy\n");
1707 return ECCSBUSY; 1696 return ECCSBUSY;
1708 } 1697 }
1709 1698
@@ -1716,7 +1705,7 @@ static int get_free_tx_ccs(ray_dev_t *local)
1716 } 1705 }
1717 } 1706 }
1718 local->tx_ccs_lock = 0; 1707 local->tx_ccs_lock = 0;
1719 DEBUG(2, "ray_cs ERROR no free tx CCS for raylink card\n"); 1708 dev_dbg(&link->dev, "ray_cs ERROR no free tx CCS for raylink card\n");
1720 return ECCSFULL; 1709 return ECCSFULL;
1721} /* get_free_tx_ccs */ 1710} /* get_free_tx_ccs */
1722 1711
@@ -1730,11 +1719,11 @@ static int get_free_ccs(ray_dev_t *local)
1730 struct pcmcia_device *link = local->finder; 1719 struct pcmcia_device *link = local->finder;
1731 1720
1732 if (!(pcmcia_dev_present(link))) { 1721 if (!(pcmcia_dev_present(link))) {
1733 DEBUG(2, "ray_cs get_free_ccs - device not present\n"); 1722 dev_dbg(&link->dev, "ray_cs get_free_ccs - device not present\n");
1734 return ECARDGONE; 1723 return ECARDGONE;
1735 } 1724 }
1736 if (test_and_set_bit(0, &local->ccs_lock)) { 1725 if (test_and_set_bit(0, &local->ccs_lock)) {
1737 DEBUG(1, "ray_cs ccs_lock busy\n"); 1726 dev_dbg(&link->dev, "ray_cs ccs_lock busy\n");
1738 return ECCSBUSY; 1727 return ECCSBUSY;
1739 } 1728 }
1740 1729
@@ -1747,7 +1736,7 @@ static int get_free_ccs(ray_dev_t *local)
1747 } 1736 }
1748 } 1737 }
1749 local->ccs_lock = 0; 1738 local->ccs_lock = 0;
1750 DEBUG(1, "ray_cs ERROR no free CCS for raylink card\n"); 1739 dev_dbg(&link->dev, "ray_cs ERROR no free CCS for raylink card\n");
1751 return ECCSFULL; 1740 return ECCSFULL;
1752} /* get_free_ccs */ 1741} /* get_free_ccs */
1753 1742
@@ -1823,7 +1812,7 @@ static struct net_device_stats *ray_get_stats(struct net_device *dev)
1823 struct pcmcia_device *link = local->finder; 1812 struct pcmcia_device *link = local->finder;
1824 struct status __iomem *p = local->sram + STATUS_BASE; 1813 struct status __iomem *p = local->sram + STATUS_BASE;
1825 if (!(pcmcia_dev_present(link))) { 1814 if (!(pcmcia_dev_present(link))) {
1826 DEBUG(2, "ray_cs net_device_stats - device not present\n"); 1815 dev_dbg(&link->dev, "ray_cs net_device_stats - device not present\n");
1827 return &local->stats; 1816 return &local->stats;
1828 } 1817 }
1829 if (readb(&p->mrx_overflow_for_host)) { 1818 if (readb(&p->mrx_overflow_for_host)) {
@@ -1856,12 +1845,12 @@ static void ray_update_parm(struct net_device *dev, UCHAR objid, UCHAR *value,
1856 struct ccs __iomem *pccs; 1845 struct ccs __iomem *pccs;
1857 1846
1858 if (!(pcmcia_dev_present(link))) { 1847 if (!(pcmcia_dev_present(link))) {
1859 DEBUG(2, "ray_update_parm - device not present\n"); 1848 dev_dbg(&link->dev, "ray_update_parm - device not present\n");
1860 return; 1849 return;
1861 } 1850 }
1862 1851
1863 if ((ccsindex = get_free_ccs(local)) < 0) { 1852 if ((ccsindex = get_free_ccs(local)) < 0) {
1864 DEBUG(0, "ray_update_parm - No free ccs\n"); 1853 dev_dbg(&link->dev, "ray_update_parm - No free ccs\n");
1865 return; 1854 return;
1866 } 1855 }
1867 pccs = ccs_base(local) + ccsindex; 1856 pccs = ccs_base(local) + ccsindex;
@@ -1874,7 +1863,7 @@ static void ray_update_parm(struct net_device *dev, UCHAR objid, UCHAR *value,
1874 } 1863 }
1875 /* Interrupt the firmware to process the command */ 1864 /* Interrupt the firmware to process the command */
1876 if (interrupt_ecf(local, ccsindex)) { 1865 if (interrupt_ecf(local, ccsindex)) {
1877 DEBUG(0, "ray_cs associate failed - ECF not ready for intr\n"); 1866 dev_dbg(&link->dev, "ray_cs associate failed - ECF not ready for intr\n");
1878 writeb(CCS_BUFFER_FREE, &(pccs++)->buffer_status); 1867 writeb(CCS_BUFFER_FREE, &(pccs++)->buffer_status);
1879 } 1868 }
1880} 1869}
@@ -1891,12 +1880,12 @@ static void ray_update_multi_list(struct net_device *dev, int all)
1891 void __iomem *p = local->sram + HOST_TO_ECF_BASE; 1880 void __iomem *p = local->sram + HOST_TO_ECF_BASE;
1892 1881
1893 if (!(pcmcia_dev_present(link))) { 1882 if (!(pcmcia_dev_present(link))) {
1894 DEBUG(2, "ray_update_multi_list - device not present\n"); 1883 dev_dbg(&link->dev, "ray_update_multi_list - device not present\n");
1895 return; 1884 return;
1896 } else 1885 } else
1897 DEBUG(2, "ray_update_multi_list(%p)\n", dev); 1886 dev_dbg(&link->dev, "ray_update_multi_list(%p)\n", dev);
1898 if ((ccsindex = get_free_ccs(local)) < 0) { 1887 if ((ccsindex = get_free_ccs(local)) < 0) {
1899 DEBUG(1, "ray_update_multi - No free ccs\n"); 1888 dev_dbg(&link->dev, "ray_update_multi - No free ccs\n");
1900 return; 1889 return;
1901 } 1890 }
1902 pccs = ccs_base(local) + ccsindex; 1891 pccs = ccs_base(local) + ccsindex;
@@ -1910,7 +1899,7 @@ static void ray_update_multi_list(struct net_device *dev, int all)
1910 for (dmip = &dev->mc_list; (dmi = *dmip) != NULL; 1899 for (dmip = &dev->mc_list; (dmi = *dmip) != NULL;
1911 dmip = &dmi->next) { 1900 dmip = &dmi->next) {
1912 memcpy_toio(p, dmi->dmi_addr, ETH_ALEN); 1901 memcpy_toio(p, dmi->dmi_addr, ETH_ALEN);
1913 DEBUG(1, 1902 dev_dbg(&link->dev,
1914 "ray_update_multi add addr %02x%02x%02x%02x%02x%02x\n", 1903 "ray_update_multi add addr %02x%02x%02x%02x%02x%02x\n",
1915 dmi->dmi_addr[0], dmi->dmi_addr[1], 1904 dmi->dmi_addr[0], dmi->dmi_addr[1],
1916 dmi->dmi_addr[2], dmi->dmi_addr[3], 1905 dmi->dmi_addr[2], dmi->dmi_addr[3],
@@ -1921,12 +1910,12 @@ static void ray_update_multi_list(struct net_device *dev, int all)
1921 if (i > 256 / ADDRLEN) 1910 if (i > 256 / ADDRLEN)
1922 i = 256 / ADDRLEN; 1911 i = 256 / ADDRLEN;
1923 writeb((UCHAR) i, &pccs->var); 1912 writeb((UCHAR) i, &pccs->var);
1924 DEBUG(1, "ray_cs update_multi %d addresses in list\n", i); 1913 dev_dbg(&link->dev, "ray_cs update_multi %d addresses in list\n", i);
1925 /* Interrupt the firmware to process the command */ 1914 /* Interrupt the firmware to process the command */
1926 local->num_multi = i; 1915 local->num_multi = i;
1927 } 1916 }
1928 if (interrupt_ecf(local, ccsindex)) { 1917 if (interrupt_ecf(local, ccsindex)) {
1929 DEBUG(1, 1918 dev_dbg(&link->dev,
1930 "ray_cs update_multi failed - ECF not ready for intr\n"); 1919 "ray_cs update_multi failed - ECF not ready for intr\n");
1931 writeb(CCS_BUFFER_FREE, &(pccs++)->buffer_status); 1920 writeb(CCS_BUFFER_FREE, &(pccs++)->buffer_status);
1932 } 1921 }
@@ -1938,11 +1927,11 @@ static void set_multicast_list(struct net_device *dev)
1938 ray_dev_t *local = netdev_priv(dev); 1927 ray_dev_t *local = netdev_priv(dev);
1939 UCHAR promisc; 1928 UCHAR promisc;
1940 1929
1941 DEBUG(2, "ray_cs set_multicast_list(%p)\n", dev); 1930 pr_debug("ray_cs set_multicast_list(%p)\n", dev);
1942 1931
1943 if (dev->flags & IFF_PROMISC) { 1932 if (dev->flags & IFF_PROMISC) {
1944 if (local->sparm.b5.a_promiscuous_mode == 0) { 1933 if (local->sparm.b5.a_promiscuous_mode == 0) {
1945 DEBUG(1, "ray_cs set_multicast_list promisc on\n"); 1934 pr_debug("ray_cs set_multicast_list promisc on\n");
1946 local->sparm.b5.a_promiscuous_mode = 1; 1935 local->sparm.b5.a_promiscuous_mode = 1;
1947 promisc = 1; 1936 promisc = 1;
1948 ray_update_parm(dev, OBJID_promiscuous_mode, 1937 ray_update_parm(dev, OBJID_promiscuous_mode,
@@ -1950,7 +1939,7 @@ static void set_multicast_list(struct net_device *dev)
1950 } 1939 }
1951 } else { 1940 } else {
1952 if (local->sparm.b5.a_promiscuous_mode == 1) { 1941 if (local->sparm.b5.a_promiscuous_mode == 1) {
1953 DEBUG(1, "ray_cs set_multicast_list promisc off\n"); 1942 pr_debug("ray_cs set_multicast_list promisc off\n");
1954 local->sparm.b5.a_promiscuous_mode = 0; 1943 local->sparm.b5.a_promiscuous_mode = 0;
1955 promisc = 0; 1944 promisc = 0;
1956 ray_update_parm(dev, OBJID_promiscuous_mode, 1945 ray_update_parm(dev, OBJID_promiscuous_mode,
@@ -1984,19 +1973,19 @@ static irqreturn_t ray_interrupt(int irq, void *dev_id)
1984 if (dev == NULL) /* Note that we want interrupts with dev->start == 0 */ 1973 if (dev == NULL) /* Note that we want interrupts with dev->start == 0 */
1985 return IRQ_NONE; 1974 return IRQ_NONE;
1986 1975
1987 DEBUG(4, "ray_cs: interrupt for *dev=%p\n", dev); 1976 pr_debug("ray_cs: interrupt for *dev=%p\n", dev);
1988 1977
1989 local = netdev_priv(dev); 1978 local = netdev_priv(dev);
1990 link = (struct pcmcia_device *)local->finder; 1979 link = (struct pcmcia_device *)local->finder;
1991 if (!pcmcia_dev_present(link)) { 1980 if (!pcmcia_dev_present(link)) {
1992 DEBUG(2, 1981 pr_debug(
1993 "ray_cs interrupt from device not present or suspended.\n"); 1982 "ray_cs interrupt from device not present or suspended.\n");
1994 return IRQ_NONE; 1983 return IRQ_NONE;
1995 } 1984 }
1996 rcsindex = readb(&((struct scb __iomem *)(local->sram))->rcs_index); 1985 rcsindex = readb(&((struct scb __iomem *)(local->sram))->rcs_index);
1997 1986
1998 if (rcsindex >= (NUMBER_OF_CCS + NUMBER_OF_RCS)) { 1987 if (rcsindex >= (NUMBER_OF_CCS + NUMBER_OF_RCS)) {
1999 DEBUG(1, "ray_cs interrupt bad rcsindex = 0x%x\n", rcsindex); 1988 dev_dbg(&link->dev, "ray_cs interrupt bad rcsindex = 0x%x\n", rcsindex);
2000 clear_interrupt(local); 1989 clear_interrupt(local);
2001 return IRQ_HANDLED; 1990 return IRQ_HANDLED;
2002 } 1991 }
@@ -2008,33 +1997,33 @@ static irqreturn_t ray_interrupt(int irq, void *dev_id)
2008 case CCS_DOWNLOAD_STARTUP_PARAMS: /* Happens in firmware someday */ 1997 case CCS_DOWNLOAD_STARTUP_PARAMS: /* Happens in firmware someday */
2009 del_timer(&local->timer); 1998 del_timer(&local->timer);
2010 if (status == CCS_COMMAND_COMPLETE) { 1999 if (status == CCS_COMMAND_COMPLETE) {
2011 DEBUG(1, 2000 dev_dbg(&link->dev,
2012 "ray_cs interrupt download_startup_parameters OK\n"); 2001 "ray_cs interrupt download_startup_parameters OK\n");
2013 } else { 2002 } else {
2014 DEBUG(1, 2003 dev_dbg(&link->dev,
2015 "ray_cs interrupt download_startup_parameters fail\n"); 2004 "ray_cs interrupt download_startup_parameters fail\n");
2016 } 2005 }
2017 break; 2006 break;
2018 case CCS_UPDATE_PARAMS: 2007 case CCS_UPDATE_PARAMS:
2019 DEBUG(1, "ray_cs interrupt update params done\n"); 2008 dev_dbg(&link->dev, "ray_cs interrupt update params done\n");
2020 if (status != CCS_COMMAND_COMPLETE) { 2009 if (status != CCS_COMMAND_COMPLETE) {
2021 tmp = 2010 tmp =
2022 readb(&pccs->var.update_param. 2011 readb(&pccs->var.update_param.
2023 failure_cause); 2012 failure_cause);
2024 DEBUG(0, 2013 dev_dbg(&link->dev,
2025 "ray_cs interrupt update params failed - reason %d\n", 2014 "ray_cs interrupt update params failed - reason %d\n",
2026 tmp); 2015 tmp);
2027 } 2016 }
2028 break; 2017 break;
2029 case CCS_REPORT_PARAMS: 2018 case CCS_REPORT_PARAMS:
2030 DEBUG(1, "ray_cs interrupt report params done\n"); 2019 dev_dbg(&link->dev, "ray_cs interrupt report params done\n");
2031 break; 2020 break;
2032 case CCS_UPDATE_MULTICAST_LIST: /* Note that this CCS isn't returned */ 2021 case CCS_UPDATE_MULTICAST_LIST: /* Note that this CCS isn't returned */
2033 DEBUG(1, 2022 dev_dbg(&link->dev,
2034 "ray_cs interrupt CCS Update Multicast List done\n"); 2023 "ray_cs interrupt CCS Update Multicast List done\n");
2035 break; 2024 break;
2036 case CCS_UPDATE_POWER_SAVINGS_MODE: 2025 case CCS_UPDATE_POWER_SAVINGS_MODE:
2037 DEBUG(1, 2026 dev_dbg(&link->dev,
2038 "ray_cs interrupt update power save mode done\n"); 2027 "ray_cs interrupt update power save mode done\n");
2039 break; 2028 break;
2040 case CCS_START_NETWORK: 2029 case CCS_START_NETWORK:
@@ -2043,11 +2032,11 @@ static irqreturn_t ray_interrupt(int irq, void *dev_id)
2043 if (readb 2032 if (readb
2044 (&pccs->var.start_network.net_initiated) == 2033 (&pccs->var.start_network.net_initiated) ==
2045 1) { 2034 1) {
2046 DEBUG(0, 2035 dev_dbg(&link->dev,
2047 "ray_cs interrupt network \"%s\" started\n", 2036 "ray_cs interrupt network \"%s\" started\n",
2048 local->sparm.b4.a_current_ess_id); 2037 local->sparm.b4.a_current_ess_id);
2049 } else { 2038 } else {
2050 DEBUG(0, 2039 dev_dbg(&link->dev,
2051 "ray_cs interrupt network \"%s\" joined\n", 2040 "ray_cs interrupt network \"%s\" joined\n",
2052 local->sparm.b4.a_current_ess_id); 2041 local->sparm.b4.a_current_ess_id);
2053 } 2042 }
@@ -2075,12 +2064,12 @@ static irqreturn_t ray_interrupt(int irq, void *dev_id)
2075 local->timer.expires = jiffies + HZ * 5; 2064 local->timer.expires = jiffies + HZ * 5;
2076 local->timer.data = (long)local; 2065 local->timer.data = (long)local;
2077 if (status == CCS_START_NETWORK) { 2066 if (status == CCS_START_NETWORK) {
2078 DEBUG(0, 2067 dev_dbg(&link->dev,
2079 "ray_cs interrupt network \"%s\" start failed\n", 2068 "ray_cs interrupt network \"%s\" start failed\n",
2080 local->sparm.b4.a_current_ess_id); 2069 local->sparm.b4.a_current_ess_id);
2081 local->timer.function = &start_net; 2070 local->timer.function = &start_net;
2082 } else { 2071 } else {
2083 DEBUG(0, 2072 dev_dbg(&link->dev,
2084 "ray_cs interrupt network \"%s\" join failed\n", 2073 "ray_cs interrupt network \"%s\" join failed\n",
2085 local->sparm.b4.a_current_ess_id); 2074 local->sparm.b4.a_current_ess_id);
2086 local->timer.function = &join_net; 2075 local->timer.function = &join_net;
@@ -2091,19 +2080,19 @@ static irqreturn_t ray_interrupt(int irq, void *dev_id)
2091 case CCS_START_ASSOCIATION: 2080 case CCS_START_ASSOCIATION:
2092 if (status == CCS_COMMAND_COMPLETE) { 2081 if (status == CCS_COMMAND_COMPLETE) {
2093 local->card_status = CARD_ASSOC_COMPLETE; 2082 local->card_status = CARD_ASSOC_COMPLETE;
2094 DEBUG(0, "ray_cs association successful\n"); 2083 dev_dbg(&link->dev, "ray_cs association successful\n");
2095 } else { 2084 } else {
2096 DEBUG(0, "ray_cs association failed,\n"); 2085 dev_dbg(&link->dev, "ray_cs association failed,\n");
2097 local->card_status = CARD_ASSOC_FAILED; 2086 local->card_status = CARD_ASSOC_FAILED;
2098 join_net((u_long) local); 2087 join_net((u_long) local);
2099 } 2088 }
2100 break; 2089 break;
2101 case CCS_TX_REQUEST: 2090 case CCS_TX_REQUEST:
2102 if (status == CCS_COMMAND_COMPLETE) { 2091 if (status == CCS_COMMAND_COMPLETE) {
2103 DEBUG(3, 2092 dev_dbg(&link->dev,
2104 "ray_cs interrupt tx request complete\n"); 2093 "ray_cs interrupt tx request complete\n");
2105 } else { 2094 } else {
2106 DEBUG(1, 2095 dev_dbg(&link->dev,
2107 "ray_cs interrupt tx request failed\n"); 2096 "ray_cs interrupt tx request failed\n");
2108 } 2097 }
2109 if (!sniffer) 2098 if (!sniffer)
@@ -2111,21 +2100,21 @@ static irqreturn_t ray_interrupt(int irq, void *dev_id)
2111 netif_wake_queue(dev); 2100 netif_wake_queue(dev);
2112 break; 2101 break;
2113 case CCS_TEST_MEMORY: 2102 case CCS_TEST_MEMORY:
2114 DEBUG(1, "ray_cs interrupt mem test done\n"); 2103 dev_dbg(&link->dev, "ray_cs interrupt mem test done\n");
2115 break; 2104 break;
2116 case CCS_SHUTDOWN: 2105 case CCS_SHUTDOWN:
2117 DEBUG(1, 2106 dev_dbg(&link->dev,
2118 "ray_cs interrupt Unexpected CCS returned - Shutdown\n"); 2107 "ray_cs interrupt Unexpected CCS returned - Shutdown\n");
2119 break; 2108 break;
2120 case CCS_DUMP_MEMORY: 2109 case CCS_DUMP_MEMORY:
2121 DEBUG(1, "ray_cs interrupt dump memory done\n"); 2110 dev_dbg(&link->dev, "ray_cs interrupt dump memory done\n");
2122 break; 2111 break;
2123 case CCS_START_TIMER: 2112 case CCS_START_TIMER:
2124 DEBUG(2, 2113 dev_dbg(&link->dev,
2125 "ray_cs interrupt DING - raylink timer expired\n"); 2114 "ray_cs interrupt DING - raylink timer expired\n");
2126 break; 2115 break;
2127 default: 2116 default:
2128 DEBUG(1, 2117 dev_dbg(&link->dev,
2129 "ray_cs interrupt Unexpected CCS 0x%x returned 0x%x\n", 2118 "ray_cs interrupt Unexpected CCS 0x%x returned 0x%x\n",
2130 rcsindex, cmd); 2119 rcsindex, cmd);
2131 } 2120 }
@@ -2139,7 +2128,7 @@ static irqreturn_t ray_interrupt(int irq, void *dev_id)
2139 ray_rx(dev, local, prcs); 2128 ray_rx(dev, local, prcs);
2140 break; 2129 break;
2141 case REJOIN_NET_COMPLETE: 2130 case REJOIN_NET_COMPLETE:
2142 DEBUG(1, "ray_cs interrupt rejoin net complete\n"); 2131 dev_dbg(&link->dev, "ray_cs interrupt rejoin net complete\n");
2143 local->card_status = CARD_ACQ_COMPLETE; 2132 local->card_status = CARD_ACQ_COMPLETE;
2144 /* do we need to clear tx buffers CCS's? */ 2133 /* do we need to clear tx buffers CCS's? */
2145 if (local->sparm.b4.a_network_type == ADHOC) { 2134 if (local->sparm.b4.a_network_type == ADHOC) {
@@ -2149,7 +2138,7 @@ static irqreturn_t ray_interrupt(int irq, void *dev_id)
2149 memcpy_fromio(&local->bss_id, 2138 memcpy_fromio(&local->bss_id,
2150 prcs->var.rejoin_net_complete. 2139 prcs->var.rejoin_net_complete.
2151 bssid, ADDRLEN); 2140 bssid, ADDRLEN);
2152 DEBUG(1, 2141 dev_dbg(&link->dev,
2153 "ray_cs new BSSID = %02x%02x%02x%02x%02x%02x\n", 2142 "ray_cs new BSSID = %02x%02x%02x%02x%02x%02x\n",
2154 local->bss_id[0], local->bss_id[1], 2143 local->bss_id[0], local->bss_id[1],
2155 local->bss_id[2], local->bss_id[3], 2144 local->bss_id[2], local->bss_id[3],
@@ -2159,15 +2148,15 @@ static irqreturn_t ray_interrupt(int irq, void *dev_id)
2159 } 2148 }
2160 break; 2149 break;
2161 case ROAMING_INITIATED: 2150 case ROAMING_INITIATED:
2162 DEBUG(1, "ray_cs interrupt roaming initiated\n"); 2151 dev_dbg(&link->dev, "ray_cs interrupt roaming initiated\n");
2163 netif_stop_queue(dev); 2152 netif_stop_queue(dev);
2164 local->card_status = CARD_DOING_ACQ; 2153 local->card_status = CARD_DOING_ACQ;
2165 break; 2154 break;
2166 case JAPAN_CALL_SIGN_RXD: 2155 case JAPAN_CALL_SIGN_RXD:
2167 DEBUG(1, "ray_cs interrupt japan call sign rx\n"); 2156 dev_dbg(&link->dev, "ray_cs interrupt japan call sign rx\n");
2168 break; 2157 break;
2169 default: 2158 default:
2170 DEBUG(1, 2159 dev_dbg(&link->dev,
2171 "ray_cs Unexpected interrupt for RCS 0x%x cmd = 0x%x\n", 2160 "ray_cs Unexpected interrupt for RCS 0x%x cmd = 0x%x\n",
2172 rcsindex, 2161 rcsindex,
2173 (unsigned int)readb(&prcs->interrupt_id)); 2162 (unsigned int)readb(&prcs->interrupt_id));
@@ -2186,7 +2175,7 @@ static void ray_rx(struct net_device *dev, ray_dev_t *local,
2186 int rx_len; 2175 int rx_len;
2187 unsigned int pkt_addr; 2176 unsigned int pkt_addr;
2188 void __iomem *pmsg; 2177 void __iomem *pmsg;
2189 DEBUG(4, "ray_rx process rx packet\n"); 2178 pr_debug("ray_rx process rx packet\n");
2190 2179
2191 /* Calculate address of packet within Rx buffer */ 2180 /* Calculate address of packet within Rx buffer */
2192 pkt_addr = ((readb(&prcs->var.rx_packet.rx_data_ptr[0]) << 8) 2181 pkt_addr = ((readb(&prcs->var.rx_packet.rx_data_ptr[0]) << 8)
@@ -2199,28 +2188,28 @@ static void ray_rx(struct net_device *dev, ray_dev_t *local,
2199 pmsg = local->rmem + pkt_addr; 2188 pmsg = local->rmem + pkt_addr;
2200 switch (readb(pmsg)) { 2189 switch (readb(pmsg)) {
2201 case DATA_TYPE: 2190 case DATA_TYPE:
2202 DEBUG(4, "ray_rx data type\n"); 2191 pr_debug("ray_rx data type\n");
2203 rx_data(dev, prcs, pkt_addr, rx_len); 2192 rx_data(dev, prcs, pkt_addr, rx_len);
2204 break; 2193 break;
2205 case AUTHENTIC_TYPE: 2194 case AUTHENTIC_TYPE:
2206 DEBUG(4, "ray_rx authentic type\n"); 2195 pr_debug("ray_rx authentic type\n");
2207 if (sniffer) 2196 if (sniffer)
2208 rx_data(dev, prcs, pkt_addr, rx_len); 2197 rx_data(dev, prcs, pkt_addr, rx_len);
2209 else 2198 else
2210 rx_authenticate(local, prcs, pkt_addr, rx_len); 2199 rx_authenticate(local, prcs, pkt_addr, rx_len);
2211 break; 2200 break;
2212 case DEAUTHENTIC_TYPE: 2201 case DEAUTHENTIC_TYPE:
2213 DEBUG(4, "ray_rx deauth type\n"); 2202 pr_debug("ray_rx deauth type\n");
2214 if (sniffer) 2203 if (sniffer)
2215 rx_data(dev, prcs, pkt_addr, rx_len); 2204 rx_data(dev, prcs, pkt_addr, rx_len);
2216 else 2205 else
2217 rx_deauthenticate(local, prcs, pkt_addr, rx_len); 2206 rx_deauthenticate(local, prcs, pkt_addr, rx_len);
2218 break; 2207 break;
2219 case NULL_MSG_TYPE: 2208 case NULL_MSG_TYPE:
2220 DEBUG(3, "ray_cs rx NULL msg\n"); 2209 pr_debug("ray_cs rx NULL msg\n");
2221 break; 2210 break;
2222 case BEACON_TYPE: 2211 case BEACON_TYPE:
2223 DEBUG(4, "ray_rx beacon type\n"); 2212 pr_debug("ray_rx beacon type\n");
2224 if (sniffer) 2213 if (sniffer)
2225 rx_data(dev, prcs, pkt_addr, rx_len); 2214 rx_data(dev, prcs, pkt_addr, rx_len);
2226 2215
@@ -2233,7 +2222,7 @@ static void ray_rx(struct net_device *dev, ray_dev_t *local,
2233 ray_get_stats(dev); 2222 ray_get_stats(dev);
2234 break; 2223 break;
2235 default: 2224 default:
2236 DEBUG(0, "ray_cs unknown pkt type %2x\n", 2225 pr_debug("ray_cs unknown pkt type %2x\n",
2237 (unsigned int)readb(pmsg)); 2226 (unsigned int)readb(pmsg));
2238 break; 2227 break;
2239 } 2228 }
@@ -2262,7 +2251,7 @@ static void rx_data(struct net_device *dev, struct rcs __iomem *prcs,
2262 rx_len > 2251 rx_len >
2263 (dev->mtu + RX_MAC_HEADER_LENGTH + ETH_HLEN + 2252 (dev->mtu + RX_MAC_HEADER_LENGTH + ETH_HLEN +
2264 FCS_LEN)) { 2253 FCS_LEN)) {
2265 DEBUG(0, 2254 pr_debug(
2266 "ray_cs invalid packet length %d received \n", 2255 "ray_cs invalid packet length %d received \n",
2267 rx_len); 2256 rx_len);
2268 return; 2257 return;
@@ -2273,17 +2262,17 @@ static void rx_data(struct net_device *dev, struct rcs __iomem *prcs,
2273 rx_len > 2262 rx_len >
2274 (dev->mtu + RX_MAC_HEADER_LENGTH + ETH_HLEN + 2263 (dev->mtu + RX_MAC_HEADER_LENGTH + ETH_HLEN +
2275 FCS_LEN)) { 2264 FCS_LEN)) {
2276 DEBUG(0, 2265 pr_debug(
2277 "ray_cs invalid packet length %d received \n", 2266 "ray_cs invalid packet length %d received \n",
2278 rx_len); 2267 rx_len);
2279 return; 2268 return;
2280 } 2269 }
2281 } 2270 }
2282 } 2271 }
2283 DEBUG(4, "ray_cs rx_data packet\n"); 2272 pr_debug("ray_cs rx_data packet\n");
2284 /* If fragmented packet, verify sizes of fragments add up */ 2273 /* If fragmented packet, verify sizes of fragments add up */
2285 if (readb(&prcs->var.rx_packet.next_frag_rcs_index) != 0xFF) { 2274 if (readb(&prcs->var.rx_packet.next_frag_rcs_index) != 0xFF) {
2286 DEBUG(1, "ray_cs rx'ed fragment\n"); 2275 pr_debug("ray_cs rx'ed fragment\n");
2287 tmp = (readb(&prcs->var.rx_packet.totalpacketlength[0]) << 8) 2276 tmp = (readb(&prcs->var.rx_packet.totalpacketlength[0]) << 8)
2288 + readb(&prcs->var.rx_packet.totalpacketlength[1]); 2277 + readb(&prcs->var.rx_packet.totalpacketlength[1]);
2289 total_len = tmp; 2278 total_len = tmp;
@@ -2301,7 +2290,7 @@ static void rx_data(struct net_device *dev, struct rcs __iomem *prcs,
2301 } while (1); 2290 } while (1);
2302 2291
2303 if (tmp < 0) { 2292 if (tmp < 0) {
2304 DEBUG(0, 2293 pr_debug(
2305 "ray_cs rx_data fragment lengths don't add up\n"); 2294 "ray_cs rx_data fragment lengths don't add up\n");
2306 local->stats.rx_dropped++; 2295 local->stats.rx_dropped++;
2307 release_frag_chain(local, prcs); 2296 release_frag_chain(local, prcs);
@@ -2313,7 +2302,7 @@ static void rx_data(struct net_device *dev, struct rcs __iomem *prcs,
2313 2302
2314 skb = dev_alloc_skb(total_len + 5); 2303 skb = dev_alloc_skb(total_len + 5);
2315 if (skb == NULL) { 2304 if (skb == NULL) {
2316 DEBUG(0, "ray_cs rx_data could not allocate skb\n"); 2305 pr_debug("ray_cs rx_data could not allocate skb\n");
2317 local->stats.rx_dropped++; 2306 local->stats.rx_dropped++;
2318 if (readb(&prcs->var.rx_packet.next_frag_rcs_index) != 0xFF) 2307 if (readb(&prcs->var.rx_packet.next_frag_rcs_index) != 0xFF)
2319 release_frag_chain(local, prcs); 2308 release_frag_chain(local, prcs);
@@ -2321,7 +2310,7 @@ static void rx_data(struct net_device *dev, struct rcs __iomem *prcs,
2321 } 2310 }
2322 skb_reserve(skb, 2); /* Align IP on 16 byte (TBD check this) */ 2311 skb_reserve(skb, 2); /* Align IP on 16 byte (TBD check this) */
2323 2312
2324 DEBUG(4, "ray_cs rx_data total_len = %x, rx_len = %x\n", total_len, 2313 pr_debug("ray_cs rx_data total_len = %x, rx_len = %x\n", total_len,
2325 rx_len); 2314 rx_len);
2326 2315
2327/************************/ 2316/************************/
@@ -2354,7 +2343,7 @@ static void rx_data(struct net_device *dev, struct rcs __iomem *prcs,
2354 tmp = 17; 2343 tmp = 17;
2355 if (readb(&prcs->var.rx_packet.next_frag_rcs_index) != 0xFF) { 2344 if (readb(&prcs->var.rx_packet.next_frag_rcs_index) != 0xFF) {
2356 prcslink = prcs; 2345 prcslink = prcs;
2357 DEBUG(1, "ray_cs rx_data in fragment loop\n"); 2346 pr_debug("ray_cs rx_data in fragment loop\n");
2358 do { 2347 do {
2359 prcslink = rcs_base(local) 2348 prcslink = rcs_base(local)
2360 + 2349 +
@@ -2426,8 +2415,8 @@ static void untranslate(ray_dev_t *local, struct sk_buff *skb, int len)
2426 memcpy(destaddr, ieee80211_get_DA(pmac), ADDRLEN); 2415 memcpy(destaddr, ieee80211_get_DA(pmac), ADDRLEN);
2427 memcpy(srcaddr, ieee80211_get_SA(pmac), ADDRLEN); 2416 memcpy(srcaddr, ieee80211_get_SA(pmac), ADDRLEN);
2428 2417
2429#ifdef PCMCIA_DEBUG 2418#if 0
2430 if (pc_debug > 3) { 2419 if {
2431 print_hex_dump(KERN_DEBUG, "skb->data before untranslate: ", 2420 print_hex_dump(KERN_DEBUG, "skb->data before untranslate: ",
2432 DUMP_PREFIX_NONE, 16, 1, 2421 DUMP_PREFIX_NONE, 16, 1,
2433 skb->data, 64, true); 2422 skb->data, 64, true);
@@ -2441,7 +2430,7 @@ static void untranslate(ray_dev_t *local, struct sk_buff *skb, int len)
2441 2430
2442 if (psnap->dsap != 0xaa || psnap->ssap != 0xaa || psnap->ctrl != 3) { 2431 if (psnap->dsap != 0xaa || psnap->ssap != 0xaa || psnap->ctrl != 3) {
2443 /* not a snap type so leave it alone */ 2432 /* not a snap type so leave it alone */
2444 DEBUG(3, "ray_cs untranslate NOT SNAP %02x %02x %02x\n", 2433 pr_debug("ray_cs untranslate NOT SNAP %02x %02x %02x\n",
2445 psnap->dsap, psnap->ssap, psnap->ctrl); 2434 psnap->dsap, psnap->ssap, psnap->ctrl);
2446 2435
2447 delta = RX_MAC_HEADER_LENGTH - ETH_HLEN; 2436 delta = RX_MAC_HEADER_LENGTH - ETH_HLEN;
@@ -2450,7 +2439,7 @@ static void untranslate(ray_dev_t *local, struct sk_buff *skb, int len)
2450 } else { /* Its a SNAP */ 2439 } else { /* Its a SNAP */
2451 if (memcmp(psnap->org, org_bridge, 3) == 0) { 2440 if (memcmp(psnap->org, org_bridge, 3) == 0) {
2452 /* EtherII and nuke the LLC */ 2441 /* EtherII and nuke the LLC */
2453 DEBUG(3, "ray_cs untranslate Bridge encap\n"); 2442 pr_debug("ray_cs untranslate Bridge encap\n");
2454 delta = RX_MAC_HEADER_LENGTH 2443 delta = RX_MAC_HEADER_LENGTH
2455 + sizeof(struct snaphdr_t) - ETH_HLEN; 2444 + sizeof(struct snaphdr_t) - ETH_HLEN;
2456 peth = (struct ethhdr *)(skb->data + delta); 2445 peth = (struct ethhdr *)(skb->data + delta);
@@ -2459,14 +2448,14 @@ static void untranslate(ray_dev_t *local, struct sk_buff *skb, int len)
2459 switch (ntohs(type)) { 2448 switch (ntohs(type)) {
2460 case ETH_P_IPX: 2449 case ETH_P_IPX:
2461 case ETH_P_AARP: 2450 case ETH_P_AARP:
2462 DEBUG(3, "ray_cs untranslate RFC IPX/AARP\n"); 2451 pr_debug("ray_cs untranslate RFC IPX/AARP\n");
2463 delta = RX_MAC_HEADER_LENGTH - ETH_HLEN; 2452 delta = RX_MAC_HEADER_LENGTH - ETH_HLEN;
2464 peth = (struct ethhdr *)(skb->data + delta); 2453 peth = (struct ethhdr *)(skb->data + delta);
2465 peth->h_proto = 2454 peth->h_proto =
2466 htons(len - RX_MAC_HEADER_LENGTH); 2455 htons(len - RX_MAC_HEADER_LENGTH);
2467 break; 2456 break;
2468 default: 2457 default:
2469 DEBUG(3, "ray_cs untranslate RFC default\n"); 2458 pr_debug("ray_cs untranslate RFC default\n");
2470 delta = RX_MAC_HEADER_LENGTH + 2459 delta = RX_MAC_HEADER_LENGTH +
2471 sizeof(struct snaphdr_t) - ETH_HLEN; 2460 sizeof(struct snaphdr_t) - ETH_HLEN;
2472 peth = (struct ethhdr *)(skb->data + delta); 2461 peth = (struct ethhdr *)(skb->data + delta);
@@ -2482,12 +2471,12 @@ static void untranslate(ray_dev_t *local, struct sk_buff *skb, int len)
2482 } 2471 }
2483/* TBD reserve skb_reserve(skb, delta); */ 2472/* TBD reserve skb_reserve(skb, delta); */
2484 skb_pull(skb, delta); 2473 skb_pull(skb, delta);
2485 DEBUG(3, "untranslate after skb_pull(%d), skb->data = %p\n", delta, 2474 pr_debug("untranslate after skb_pull(%d), skb->data = %p\n", delta,
2486 skb->data); 2475 skb->data);
2487 memcpy(peth->h_dest, destaddr, ADDRLEN); 2476 memcpy(peth->h_dest, destaddr, ADDRLEN);
2488 memcpy(peth->h_source, srcaddr, ADDRLEN); 2477 memcpy(peth->h_source, srcaddr, ADDRLEN);
2489#ifdef PCMCIA_DEBUG 2478#if 0
2490 if (pc_debug > 3) { 2479 {
2491 int i; 2480 int i;
2492 printk(KERN_DEBUG "skb->data after untranslate:"); 2481 printk(KERN_DEBUG "skb->data after untranslate:");
2493 for (i = 0; i < 64; i++) 2482 for (i = 0; i < 64; i++)
@@ -2529,7 +2518,7 @@ static void release_frag_chain(ray_dev_t *local, struct rcs __iomem *prcs)
2529 while (tmp--) { 2518 while (tmp--) {
2530 writeb(CCS_BUFFER_FREE, &prcslink->buffer_status); 2519 writeb(CCS_BUFFER_FREE, &prcslink->buffer_status);
2531 if (rcsindex >= (NUMBER_OF_CCS + NUMBER_OF_RCS)) { 2520 if (rcsindex >= (NUMBER_OF_CCS + NUMBER_OF_RCS)) {
2532 DEBUG(1, "ray_cs interrupt bad rcsindex = 0x%x\n", 2521 pr_debug("ray_cs interrupt bad rcsindex = 0x%x\n",
2533 rcsindex); 2522 rcsindex);
2534 break; 2523 break;
2535 } 2524 }
@@ -2543,9 +2532,9 @@ static void release_frag_chain(ray_dev_t *local, struct rcs __iomem *prcs)
2543static void authenticate(ray_dev_t *local) 2532static void authenticate(ray_dev_t *local)
2544{ 2533{
2545 struct pcmcia_device *link = local->finder; 2534 struct pcmcia_device *link = local->finder;
2546 DEBUG(0, "ray_cs Starting authentication.\n"); 2535 dev_dbg(&link->dev, "ray_cs Starting authentication.\n");
2547 if (!(pcmcia_dev_present(link))) { 2536 if (!(pcmcia_dev_present(link))) {
2548 DEBUG(2, "ray_cs authenticate - device not present\n"); 2537 dev_dbg(&link->dev, "ray_cs authenticate - device not present\n");
2549 return; 2538 return;
2550 } 2539 }
2551 2540
@@ -2573,11 +2562,11 @@ static void rx_authenticate(ray_dev_t *local, struct rcs __iomem *prcs,
2573 copy_from_rx_buff(local, buff, pkt_addr, rx_len & 0xff); 2562 copy_from_rx_buff(local, buff, pkt_addr, rx_len & 0xff);
2574 /* if we are trying to get authenticated */ 2563 /* if we are trying to get authenticated */
2575 if (local->sparm.b4.a_network_type == ADHOC) { 2564 if (local->sparm.b4.a_network_type == ADHOC) {
2576 DEBUG(1, "ray_cs rx_auth var= %02x %02x %02x %02x %02x %02x\n", 2565 pr_debug("ray_cs rx_auth var= %02x %02x %02x %02x %02x %02x\n",
2577 msg->var[0], msg->var[1], msg->var[2], msg->var[3], 2566 msg->var[0], msg->var[1], msg->var[2], msg->var[3],
2578 msg->var[4], msg->var[5]); 2567 msg->var[4], msg->var[5]);
2579 if (msg->var[2] == 1) { 2568 if (msg->var[2] == 1) {
2580 DEBUG(0, "ray_cs Sending authentication response.\n"); 2569 pr_debug("ray_cs Sending authentication response.\n");
2581 if (!build_auth_frame 2570 if (!build_auth_frame
2582 (local, msg->mac.addr_2, OPEN_AUTH_RESPONSE)) { 2571 (local, msg->mac.addr_2, OPEN_AUTH_RESPONSE)) {
2583 local->authentication_state = NEED_TO_AUTH; 2572 local->authentication_state = NEED_TO_AUTH;
@@ -2591,13 +2580,13 @@ static void rx_authenticate(ray_dev_t *local, struct rcs __iomem *prcs,
2591 /* Verify authentication sequence #2 and success */ 2580 /* Verify authentication sequence #2 and success */
2592 if (msg->var[2] == 2) { 2581 if (msg->var[2] == 2) {
2593 if ((msg->var[3] | msg->var[4]) == 0) { 2582 if ((msg->var[3] | msg->var[4]) == 0) {
2594 DEBUG(1, "Authentication successful\n"); 2583 pr_debug("Authentication successful\n");
2595 local->card_status = CARD_AUTH_COMPLETE; 2584 local->card_status = CARD_AUTH_COMPLETE;
2596 associate(local); 2585 associate(local);
2597 local->authentication_state = 2586 local->authentication_state =
2598 AUTHENTICATED; 2587 AUTHENTICATED;
2599 } else { 2588 } else {
2600 DEBUG(0, "Authentication refused\n"); 2589 pr_debug("Authentication refused\n");
2601 local->card_status = CARD_AUTH_REFUSED; 2590 local->card_status = CARD_AUTH_REFUSED;
2602 join_net((u_long) local); 2591 join_net((u_long) local);
2603 local->authentication_state = 2592 local->authentication_state =
@@ -2617,22 +2606,22 @@ static void associate(ray_dev_t *local)
2617 struct net_device *dev = link->priv; 2606 struct net_device *dev = link->priv;
2618 int ccsindex; 2607 int ccsindex;
2619 if (!(pcmcia_dev_present(link))) { 2608 if (!(pcmcia_dev_present(link))) {
2620 DEBUG(2, "ray_cs associate - device not present\n"); 2609 dev_dbg(&link->dev, "ray_cs associate - device not present\n");
2621 return; 2610 return;
2622 } 2611 }
2623 /* If no tx buffers available, return */ 2612 /* If no tx buffers available, return */
2624 if ((ccsindex = get_free_ccs(local)) < 0) { 2613 if ((ccsindex = get_free_ccs(local)) < 0) {
2625/* TBD should never be here but... what if we are? */ 2614/* TBD should never be here but... what if we are? */
2626 DEBUG(1, "ray_cs associate - No free ccs\n"); 2615 dev_dbg(&link->dev, "ray_cs associate - No free ccs\n");
2627 return; 2616 return;
2628 } 2617 }
2629 DEBUG(1, "ray_cs Starting association with access point\n"); 2618 dev_dbg(&link->dev, "ray_cs Starting association with access point\n");
2630 pccs = ccs_base(local) + ccsindex; 2619 pccs = ccs_base(local) + ccsindex;
2631 /* fill in the CCS */ 2620 /* fill in the CCS */
2632 writeb(CCS_START_ASSOCIATION, &pccs->cmd); 2621 writeb(CCS_START_ASSOCIATION, &pccs->cmd);
2633 /* Interrupt the firmware to process the command */ 2622 /* Interrupt the firmware to process the command */
2634 if (interrupt_ecf(local, ccsindex)) { 2623 if (interrupt_ecf(local, ccsindex)) {
2635 DEBUG(1, "ray_cs associate failed - ECF not ready for intr\n"); 2624 dev_dbg(&link->dev, "ray_cs associate failed - ECF not ready for intr\n");
2636 writeb(CCS_BUFFER_FREE, &(pccs++)->buffer_status); 2625 writeb(CCS_BUFFER_FREE, &(pccs++)->buffer_status);
2637 2626
2638 del_timer(&local->timer); 2627 del_timer(&local->timer);
@@ -2655,7 +2644,7 @@ static void rx_deauthenticate(ray_dev_t *local, struct rcs __iomem *prcs,
2655/* UCHAR buff[256]; 2644/* UCHAR buff[256];
2656 struct rx_msg *msg = (struct rx_msg *)buff; 2645 struct rx_msg *msg = (struct rx_msg *)buff;
2657*/ 2646*/
2658 DEBUG(0, "Deauthentication frame received\n"); 2647 pr_debug("Deauthentication frame received\n");
2659 local->authentication_state = UNAUTHENTICATED; 2648 local->authentication_state = UNAUTHENTICATED;
2660 /* Need to reauthenticate or rejoin depending on reason code */ 2649 /* Need to reauthenticate or rejoin depending on reason code */
2661/* copy_from_rx_buff(local, buff, pkt_addr, rx_len & 0xff); 2650/* copy_from_rx_buff(local, buff, pkt_addr, rx_len & 0xff);
@@ -2823,7 +2812,7 @@ static int build_auth_frame(ray_dev_t *local, UCHAR *dest, int auth_type)
2823 2812
2824 /* If no tx buffers available, return */ 2813 /* If no tx buffers available, return */
2825 if ((ccsindex = get_free_tx_ccs(local)) < 0) { 2814 if ((ccsindex = get_free_tx_ccs(local)) < 0) {
2826 DEBUG(1, "ray_cs send authenticate - No free tx ccs\n"); 2815 pr_debug("ray_cs send authenticate - No free tx ccs\n");
2827 return -1; 2816 return -1;
2828 } 2817 }
2829 2818
@@ -2855,7 +2844,7 @@ static int build_auth_frame(ray_dev_t *local, UCHAR *dest, int auth_type)
2855 2844
2856 /* Interrupt the firmware to process the command */ 2845 /* Interrupt the firmware to process the command */
2857 if (interrupt_ecf(local, ccsindex)) { 2846 if (interrupt_ecf(local, ccsindex)) {
2858 DEBUG(1, 2847 pr_debug(
2859 "ray_cs send authentication request failed - ECF not ready for intr\n"); 2848 "ray_cs send authentication request failed - ECF not ready for intr\n");
2860 writeb(CCS_BUFFER_FREE, &(pccs++)->buffer_status); 2849 writeb(CCS_BUFFER_FREE, &(pccs++)->buffer_status);
2861 return -1; 2850 return -1;
@@ -2942,9 +2931,9 @@ static int __init init_ray_cs(void)
2942{ 2931{
2943 int rc; 2932 int rc;
2944 2933
2945 DEBUG(1, "%s\n", rcsid); 2934 pr_debug("%s\n", rcsid);
2946 rc = pcmcia_register_driver(&ray_driver); 2935 rc = pcmcia_register_driver(&ray_driver);
2947 DEBUG(1, "raylink init_module register_pcmcia_driver returns 0x%x\n", 2936 pr_debug("raylink init_module register_pcmcia_driver returns 0x%x\n",
2948 rc); 2937 rc);
2949 2938
2950#ifdef CONFIG_PROC_FS 2939#ifdef CONFIG_PROC_FS
@@ -2964,7 +2953,7 @@ static int __init init_ray_cs(void)
2964 2953
2965static void __exit exit_ray_cs(void) 2954static void __exit exit_ray_cs(void)
2966{ 2955{
2967 DEBUG(0, "ray_cs: cleanup_module\n"); 2956 pr_debug("ray_cs: cleanup_module\n");
2968 2957
2969#ifdef CONFIG_PROC_FS 2958#ifdef CONFIG_PROC_FS
2970 remove_proc_entry("driver/ray_cs/ray_cs", NULL); 2959 remove_proc_entry("driver/ray_cs/ray_cs", NULL);
diff --git a/drivers/net/wireless/rt2x00/rt2x00dev.c b/drivers/net/wireless/rt2x00/rt2x00dev.c
index 71761b343839..73bbec58341e 100644
--- a/drivers/net/wireless/rt2x00/rt2x00dev.c
+++ b/drivers/net/wireless/rt2x00/rt2x00dev.c
@@ -815,6 +815,8 @@ int rt2x00lib_probe_dev(struct rt2x00_dev *rt2x00dev)
815 815
816 mutex_init(&rt2x00dev->csr_mutex); 816 mutex_init(&rt2x00dev->csr_mutex);
817 817
818 set_bit(DEVICE_STATE_PRESENT, &rt2x00dev->flags);
819
818 /* 820 /*
819 * Make room for rt2x00_intf inside the per-interface 821 * Make room for rt2x00_intf inside the per-interface
820 * structure ieee80211_vif. 822 * structure ieee80211_vif.
@@ -871,8 +873,6 @@ int rt2x00lib_probe_dev(struct rt2x00_dev *rt2x00dev)
871 rt2x00leds_register(rt2x00dev); 873 rt2x00leds_register(rt2x00dev);
872 rt2x00debug_register(rt2x00dev); 874 rt2x00debug_register(rt2x00dev);
873 875
874 set_bit(DEVICE_STATE_PRESENT, &rt2x00dev->flags);
875
876 return 0; 876 return 0;
877 877
878exit: 878exit:
diff --git a/drivers/net/wireless/rt2x00/rt2x00link.c b/drivers/net/wireless/rt2x00/rt2x00link.c
index c64db0ba7f40..c708d0be9155 100644
--- a/drivers/net/wireless/rt2x00/rt2x00link.c
+++ b/drivers/net/wireless/rt2x00/rt2x00link.c
@@ -362,8 +362,9 @@ void rt2x00link_start_tuner(struct rt2x00_dev *rt2x00dev)
362 362
363 rt2x00link_reset_tuner(rt2x00dev, false); 363 rt2x00link_reset_tuner(rt2x00dev, false);
364 364
365 ieee80211_queue_delayed_work(rt2x00dev->hw, 365 if (test_bit(DEVICE_STATE_PRESENT, &rt2x00dev->flags))
366 &link->work, LINK_TUNE_INTERVAL); 366 ieee80211_queue_delayed_work(rt2x00dev->hw,
367 &link->work, LINK_TUNE_INTERVAL);
367} 368}
368 369
369void rt2x00link_stop_tuner(struct rt2x00_dev *rt2x00dev) 370void rt2x00link_stop_tuner(struct rt2x00_dev *rt2x00dev)
@@ -469,8 +470,10 @@ static void rt2x00link_tuner(struct work_struct *work)
469 * Increase tuner counter, and reschedule the next link tuner run. 470 * Increase tuner counter, and reschedule the next link tuner run.
470 */ 471 */
471 link->count++; 472 link->count++;
472 ieee80211_queue_delayed_work(rt2x00dev->hw, 473
473 &link->work, LINK_TUNE_INTERVAL); 474 if (test_bit(DEVICE_STATE_PRESENT, &rt2x00dev->flags))
475 ieee80211_queue_delayed_work(rt2x00dev->hw,
476 &link->work, LINK_TUNE_INTERVAL);
474} 477}
475 478
476void rt2x00link_register(struct rt2x00_dev *rt2x00dev) 479void rt2x00link_register(struct rt2x00_dev *rt2x00dev)
diff --git a/drivers/net/wireless/rt2x00/rt2x00usb.c b/drivers/net/wireless/rt2x00/rt2x00usb.c
index 501544882c2c..f02b48a90593 100644
--- a/drivers/net/wireless/rt2x00/rt2x00usb.c
+++ b/drivers/net/wireless/rt2x00/rt2x00usb.c
@@ -47,6 +47,8 @@ int rt2x00usb_vendor_request(struct rt2x00_dev *rt2x00dev,
47 (requesttype == USB_VENDOR_REQUEST_IN) ? 47 (requesttype == USB_VENDOR_REQUEST_IN) ?
48 usb_rcvctrlpipe(usb_dev, 0) : usb_sndctrlpipe(usb_dev, 0); 48 usb_rcvctrlpipe(usb_dev, 0) : usb_sndctrlpipe(usb_dev, 0);
49 49
50 if (!test_bit(DEVICE_STATE_PRESENT, &rt2x00dev->flags))
51 return -ENODEV;
50 52
51 for (i = 0; i < REGISTER_BUSY_COUNT; i++) { 53 for (i = 0; i < REGISTER_BUSY_COUNT; i++) {
52 status = usb_control_msg(usb_dev, pipe, request, requesttype, 54 status = usb_control_msg(usb_dev, pipe, request, requesttype,
@@ -60,8 +62,10 @@ int rt2x00usb_vendor_request(struct rt2x00_dev *rt2x00dev,
60 * -ENODEV: Device has disappeared, no point continuing. 62 * -ENODEV: Device has disappeared, no point continuing.
61 * All other errors: Try again. 63 * All other errors: Try again.
62 */ 64 */
63 else if (status == -ENODEV) 65 else if (status == -ENODEV) {
66 clear_bit(DEVICE_STATE_PRESENT, &rt2x00dev->flags);
64 break; 67 break;
68 }
65 } 69 }
66 70
67 ERROR(rt2x00dev, 71 ERROR(rt2x00dev,
@@ -161,6 +165,9 @@ int rt2x00usb_regbusy_read(struct rt2x00_dev *rt2x00dev,
161{ 165{
162 unsigned int i; 166 unsigned int i;
163 167
168 if (!test_bit(DEVICE_STATE_PRESENT, &rt2x00dev->flags))
169 return -ENODEV;
170
164 for (i = 0; i < REGISTER_BUSY_COUNT; i++) { 171 for (i = 0; i < REGISTER_BUSY_COUNT; i++) {
165 rt2x00usb_register_read_lock(rt2x00dev, offset, reg); 172 rt2x00usb_register_read_lock(rt2x00dev, offset, reg);
166 if (!rt2x00_get_field32(*reg, field)) 173 if (!rt2x00_get_field32(*reg, field))
diff --git a/drivers/net/wireless/rt2x00/rt73usb.c b/drivers/net/wireless/rt2x00/rt73usb.c
index b8f5ee33445e..14e7bb210075 100644
--- a/drivers/net/wireless/rt2x00/rt73usb.c
+++ b/drivers/net/wireless/rt2x00/rt73usb.c
@@ -2389,10 +2389,13 @@ static struct usb_device_id rt73usb_device_table[] = {
2389 { USB_DEVICE(0x13b1, 0x0023), USB_DEVICE_DATA(&rt73usb_ops) }, 2389 { USB_DEVICE(0x13b1, 0x0023), USB_DEVICE_DATA(&rt73usb_ops) },
2390 { USB_DEVICE(0x13b1, 0x0028), USB_DEVICE_DATA(&rt73usb_ops) }, 2390 { USB_DEVICE(0x13b1, 0x0028), USB_DEVICE_DATA(&rt73usb_ops) },
2391 /* MSI */ 2391 /* MSI */
2392 { USB_DEVICE(0x0db0, 0x4600), USB_DEVICE_DATA(&rt73usb_ops) },
2392 { USB_DEVICE(0x0db0, 0x6877), USB_DEVICE_DATA(&rt73usb_ops) }, 2393 { USB_DEVICE(0x0db0, 0x6877), USB_DEVICE_DATA(&rt73usb_ops) },
2393 { USB_DEVICE(0x0db0, 0x6874), USB_DEVICE_DATA(&rt73usb_ops) }, 2394 { USB_DEVICE(0x0db0, 0x6874), USB_DEVICE_DATA(&rt73usb_ops) },
2394 { USB_DEVICE(0x0db0, 0xa861), USB_DEVICE_DATA(&rt73usb_ops) }, 2395 { USB_DEVICE(0x0db0, 0xa861), USB_DEVICE_DATA(&rt73usb_ops) },
2395 { USB_DEVICE(0x0db0, 0xa874), USB_DEVICE_DATA(&rt73usb_ops) }, 2396 { USB_DEVICE(0x0db0, 0xa874), USB_DEVICE_DATA(&rt73usb_ops) },
2397 /* Ovislink */
2398 { USB_DEVICE(0x1b75, 0x7318), USB_DEVICE_DATA(&rt73usb_ops) },
2396 /* Ralink */ 2399 /* Ralink */
2397 { USB_DEVICE(0x04bb, 0x093d), USB_DEVICE_DATA(&rt73usb_ops) }, 2400 { USB_DEVICE(0x04bb, 0x093d), USB_DEVICE_DATA(&rt73usb_ops) },
2398 { USB_DEVICE(0x148f, 0x2573), USB_DEVICE_DATA(&rt73usb_ops) }, 2401 { USB_DEVICE(0x148f, 0x2573), USB_DEVICE_DATA(&rt73usb_ops) },
@@ -2420,6 +2423,8 @@ static struct usb_device_id rt73usb_device_table[] = {
2420 /* Planex */ 2423 /* Planex */
2421 { USB_DEVICE(0x2019, 0xab01), USB_DEVICE_DATA(&rt73usb_ops) }, 2424 { USB_DEVICE(0x2019, 0xab01), USB_DEVICE_DATA(&rt73usb_ops) },
2422 { USB_DEVICE(0x2019, 0xab50), USB_DEVICE_DATA(&rt73usb_ops) }, 2425 { USB_DEVICE(0x2019, 0xab50), USB_DEVICE_DATA(&rt73usb_ops) },
2426 /* WideTell */
2427 { USB_DEVICE(0x7167, 0x3840), USB_DEVICE_DATA(&rt73usb_ops) },
2423 /* Zcom */ 2428 /* Zcom */
2424 { USB_DEVICE(0x0cde, 0x001c), USB_DEVICE_DATA(&rt73usb_ops) }, 2429 { USB_DEVICE(0x0cde, 0x001c), USB_DEVICE_DATA(&rt73usb_ops) },
2425 /* ZyXEL */ 2430 /* ZyXEL */
diff --git a/drivers/net/wireless/rtl818x/rtl8187_leds.c b/drivers/net/wireless/rtl818x/rtl8187_leds.c
index a1c670fc1552..cf8a4a40fdf6 100644
--- a/drivers/net/wireless/rtl818x/rtl8187_leds.c
+++ b/drivers/net/wireless/rtl818x/rtl8187_leds.c
@@ -210,10 +210,10 @@ void rtl8187_leds_exit(struct ieee80211_hw *dev)
210 210
211 /* turn the LED off before exiting */ 211 /* turn the LED off before exiting */
212 ieee80211_queue_delayed_work(dev, &priv->led_off, 0); 212 ieee80211_queue_delayed_work(dev, &priv->led_off, 0);
213 cancel_delayed_work_sync(&priv->led_off);
214 cancel_delayed_work_sync(&priv->led_on);
215 rtl8187_unregister_led(&priv->led_rx); 213 rtl8187_unregister_led(&priv->led_rx);
216 rtl8187_unregister_led(&priv->led_tx); 214 rtl8187_unregister_led(&priv->led_tx);
215 cancel_delayed_work_sync(&priv->led_off);
216 cancel_delayed_work_sync(&priv->led_on);
217} 217}
218#endif /* def CONFIG_RTL8187_LED */ 218#endif /* def CONFIG_RTL8187_LED */
219 219
diff --git a/drivers/net/wireless/rtl818x/rtl8187_rfkill.c b/drivers/net/wireless/rtl818x/rtl8187_rfkill.c
index 9fab13e4004e..cad8037ab2af 100644
--- a/drivers/net/wireless/rtl818x/rtl8187_rfkill.c
+++ b/drivers/net/wireless/rtl818x/rtl8187_rfkill.c
@@ -18,6 +18,7 @@
18#include <net/mac80211.h> 18#include <net/mac80211.h>
19 19
20#include "rtl8187.h" 20#include "rtl8187.h"
21#include "rtl8187_rfkill.h"
21 22
22static bool rtl8187_is_radio_enabled(struct rtl8187_priv *priv) 23static bool rtl8187_is_radio_enabled(struct rtl8187_priv *priv)
23{ 24{
diff --git a/drivers/net/wireless/wavelan_cs.c b/drivers/net/wireless/wavelan_cs.c
index 431a20ec6db6..33918fd5b231 100644
--- a/drivers/net/wireless/wavelan_cs.c
+++ b/drivers/net/wireless/wavelan_cs.c
@@ -3656,10 +3656,7 @@ wv_pcmcia_reset(struct net_device * dev)
3656 3656
3657 i = pcmcia_access_configuration_register(link, &reg); 3657 i = pcmcia_access_configuration_register(link, &reg);
3658 if (i != 0) 3658 if (i != 0)
3659 {
3660 cs_error(link, AccessConfigurationRegister, i);
3661 return FALSE; 3659 return FALSE;
3662 }
3663 3660
3664#ifdef DEBUG_CONFIG_INFO 3661#ifdef DEBUG_CONFIG_INFO
3665 printk(KERN_DEBUG "%s: wavelan_pcmcia_reset(): Config reg is 0x%x\n", 3662 printk(KERN_DEBUG "%s: wavelan_pcmcia_reset(): Config reg is 0x%x\n",
@@ -3670,19 +3667,13 @@ wv_pcmcia_reset(struct net_device * dev)
3670 reg.Value = reg.Value | COR_SW_RESET; 3667 reg.Value = reg.Value | COR_SW_RESET;
3671 i = pcmcia_access_configuration_register(link, &reg); 3668 i = pcmcia_access_configuration_register(link, &reg);
3672 if (i != 0) 3669 if (i != 0)
3673 {
3674 cs_error(link, AccessConfigurationRegister, i);
3675 return FALSE; 3670 return FALSE;
3676 }
3677 3671
3678 reg.Action = CS_WRITE; 3672 reg.Action = CS_WRITE;
3679 reg.Value = COR_LEVEL_IRQ | COR_CONFIG; 3673 reg.Value = COR_LEVEL_IRQ | COR_CONFIG;
3680 i = pcmcia_access_configuration_register(link, &reg); 3674 i = pcmcia_access_configuration_register(link, &reg);
3681 if (i != 0) 3675 if (i != 0)
3682 {
3683 cs_error(link, AccessConfigurationRegister, i);
3684 return FALSE; 3676 return FALSE;
3685 }
3686 3677
3687#ifdef DEBUG_CONFIG_TRACE 3678#ifdef DEBUG_CONFIG_TRACE
3688 printk(KERN_DEBUG "%s: <-wv_pcmcia_reset()\n", dev->name); 3679 printk(KERN_DEBUG "%s: <-wv_pcmcia_reset()\n", dev->name);
@@ -3857,10 +3848,7 @@ wv_pcmcia_config(struct pcmcia_device * link)
3857 { 3848 {
3858 i = pcmcia_request_io(link, &link->io); 3849 i = pcmcia_request_io(link, &link->io);
3859 if (i != 0) 3850 if (i != 0)
3860 {
3861 cs_error(link, RequestIO, i);
3862 break; 3851 break;
3863 }
3864 3852
3865 /* 3853 /*
3866 * Now allocate an interrupt line. Note that this does not 3854 * Now allocate an interrupt line. Note that this does not
@@ -3868,10 +3856,7 @@ wv_pcmcia_config(struct pcmcia_device * link)
3868 */ 3856 */
3869 i = pcmcia_request_irq(link, &link->irq); 3857 i = pcmcia_request_irq(link, &link->irq);
3870 if (i != 0) 3858 if (i != 0)
3871 {
3872 cs_error(link, RequestIRQ, i);
3873 break; 3859 break;
3874 }
3875 3860
3876 /* 3861 /*
3877 * This actually configures the PCMCIA socket -- setting up 3862 * This actually configures the PCMCIA socket -- setting up
@@ -3880,10 +3865,7 @@ wv_pcmcia_config(struct pcmcia_device * link)
3880 link->conf.ConfigIndex = 1; 3865 link->conf.ConfigIndex = 1;
3881 i = pcmcia_request_configuration(link, &link->conf); 3866 i = pcmcia_request_configuration(link, &link->conf);
3882 if (i != 0) 3867 if (i != 0)
3883 {
3884 cs_error(link, RequestConfiguration, i);
3885 break; 3868 break;
3886 }
3887 3869
3888 /* 3870 /*
3889 * Allocate a small memory window. Note that the struct pcmcia_device 3871 * Allocate a small memory window. Note that the struct pcmcia_device
@@ -3894,24 +3876,18 @@ wv_pcmcia_config(struct pcmcia_device * link)
3894 req.Attributes = WIN_DATA_WIDTH_8|WIN_MEMORY_TYPE_AM|WIN_ENABLE; 3876 req.Attributes = WIN_DATA_WIDTH_8|WIN_MEMORY_TYPE_AM|WIN_ENABLE;
3895 req.Base = req.Size = 0; 3877 req.Base = req.Size = 0;
3896 req.AccessSpeed = mem_speed; 3878 req.AccessSpeed = mem_speed;
3897 i = pcmcia_request_window(&link, &req, &link->win); 3879 i = pcmcia_request_window(link, &req, &link->win);
3898 if (i != 0) 3880 if (i != 0)
3899 {
3900 cs_error(link, RequestWindow, i);
3901 break; 3881 break;
3902 }
3903 3882
3904 lp->mem = ioremap(req.Base, req.Size); 3883 lp->mem = ioremap(req.Base, req.Size);
3905 dev->mem_start = (u_long)lp->mem; 3884 dev->mem_start = (u_long)lp->mem;
3906 dev->mem_end = dev->mem_start + req.Size; 3885 dev->mem_end = dev->mem_start + req.Size;
3907 3886
3908 mem.CardOffset = 0; mem.Page = 0; 3887 mem.CardOffset = 0; mem.Page = 0;
3909 i = pcmcia_map_mem_page(link->win, &mem); 3888 i = pcmcia_map_mem_page(link, link->win, &mem);
3910 if (i != 0) 3889 if (i != 0)
3911 {
3912 cs_error(link, MapMemPage, i);
3913 break; 3890 break;
3914 }
3915 3891
3916 /* Feed device with this info... */ 3892 /* Feed device with this info... */
3917 dev->irq = link->irq.AssignedIRQ; 3893 dev->irq = link->irq.AssignedIRQ;
@@ -3923,7 +3899,7 @@ wv_pcmcia_config(struct pcmcia_device * link)
3923 lp->mem, dev->irq, (u_int) dev->base_addr); 3899 lp->mem, dev->irq, (u_int) dev->base_addr);
3924#endif 3900#endif
3925 3901
3926 SET_NETDEV_DEV(dev, &handle_to_dev(link)); 3902 SET_NETDEV_DEV(dev, &link->dev);
3927 i = register_netdev(dev); 3903 i = register_netdev(dev);
3928 if(i != 0) 3904 if(i != 0)
3929 { 3905 {
@@ -4462,8 +4438,7 @@ wavelan_probe(struct pcmcia_device *p_dev)
4462 p_dev->io.IOAddrLines = 3; 4438 p_dev->io.IOAddrLines = 3;
4463 4439
4464 /* Interrupt setup */ 4440 /* Interrupt setup */
4465 p_dev->irq.Attributes = IRQ_TYPE_DYNAMIC_SHARING | IRQ_HANDLE_PRESENT; 4441 p_dev->irq.Attributes = IRQ_TYPE_DYNAMIC_SHARING;
4466 p_dev->irq.IRQInfo1 = IRQ_LEVEL_ID;
4467 p_dev->irq.Handler = wavelan_interrupt; 4442 p_dev->irq.Handler = wavelan_interrupt;
4468 4443
4469 /* General socket configuration */ 4444 /* General socket configuration */
@@ -4475,7 +4450,7 @@ wavelan_probe(struct pcmcia_device *p_dev)
4475 if (!dev) 4450 if (!dev)
4476 return -ENOMEM; 4451 return -ENOMEM;
4477 4452
4478 p_dev->priv = p_dev->irq.Instance = dev; 4453 p_dev->priv = dev;
4479 4454
4480 lp = netdev_priv(dev); 4455 lp = netdev_priv(dev);
4481 4456
diff --git a/drivers/net/wireless/wl3501_cs.c b/drivers/net/wireless/wl3501_cs.c
index 4f1e0cfe609b..5f0401a52cff 100644
--- a/drivers/net/wireless/wl3501_cs.c
+++ b/drivers/net/wireless/wl3501_cs.c
@@ -67,23 +67,7 @@
67/* For rough constant delay */ 67/* For rough constant delay */
68#define WL3501_NOPLOOP(n) { int x = 0; while (x++ < n) slow_down_io(); } 68#define WL3501_NOPLOOP(n) { int x = 0; while (x++ < n) slow_down_io(); }
69 69
70/* 70
71 * All the PCMCIA modules use PCMCIA_DEBUG to control debugging. If you do not
72 * define PCMCIA_DEBUG at all, all the debug code will be left out. If you
73 * compile with PCMCIA_DEBUG=0, the debug code will be present but disabled --
74 * but it can then be enabled for specific modules at load time with a
75 * 'pc_debug=#' option to insmod.
76 */
77#define PCMCIA_DEBUG 0
78#ifdef PCMCIA_DEBUG
79static int pc_debug = PCMCIA_DEBUG;
80module_param(pc_debug, int, 0);
81#define dprintk(n, format, args...) \
82 { if (pc_debug > (n)) \
83 printk(KERN_INFO "%s: " format "\n", __func__ , ##args); }
84#else
85#define dprintk(n, format, args...)
86#endif
87 71
88#define wl3501_outb(a, b) { outb(a, b); slow_down_io(); } 72#define wl3501_outb(a, b) { outb(a, b); slow_down_io(); }
89#define wl3501_outb_p(a, b) { outb_p(a, b); slow_down_io(); } 73#define wl3501_outb_p(a, b) { outb_p(a, b); slow_down_io(); }
@@ -684,10 +668,10 @@ static void wl3501_mgmt_scan_confirm(struct wl3501_card *this, u16 addr)
684 int matchflag = 0; 668 int matchflag = 0;
685 struct wl3501_scan_confirm sig; 669 struct wl3501_scan_confirm sig;
686 670
687 dprintk(3, "entry"); 671 pr_debug("entry");
688 wl3501_get_from_wla(this, addr, &sig, sizeof(sig)); 672 wl3501_get_from_wla(this, addr, &sig, sizeof(sig));
689 if (sig.status == WL3501_STATUS_SUCCESS) { 673 if (sig.status == WL3501_STATUS_SUCCESS) {
690 dprintk(3, "success"); 674 pr_debug("success");
691 if ((this->net_type == IW_MODE_INFRA && 675 if ((this->net_type == IW_MODE_INFRA &&
692 (sig.cap_info & WL3501_MGMT_CAPABILITY_ESS)) || 676 (sig.cap_info & WL3501_MGMT_CAPABILITY_ESS)) ||
693 (this->net_type == IW_MODE_ADHOC && 677 (this->net_type == IW_MODE_ADHOC &&
@@ -722,7 +706,7 @@ static void wl3501_mgmt_scan_confirm(struct wl3501_card *this, u16 addr)
722 } 706 }
723 } 707 }
724 } else if (sig.status == WL3501_STATUS_TIMEOUT) { 708 } else if (sig.status == WL3501_STATUS_TIMEOUT) {
725 dprintk(3, "timeout"); 709 pr_debug("timeout");
726 this->join_sta_bss = 0; 710 this->join_sta_bss = 0;
727 for (i = this->join_sta_bss; i < this->bss_cnt; i++) 711 for (i = this->join_sta_bss; i < this->bss_cnt; i++)
728 if (!wl3501_mgmt_join(this, i)) 712 if (!wl3501_mgmt_join(this, i))
@@ -879,7 +863,7 @@ static int wl3501_mgmt_auth(struct wl3501_card *this)
879 .timeout = 1000, 863 .timeout = 1000,
880 }; 864 };
881 865
882 dprintk(3, "entry"); 866 pr_debug("entry");
883 memcpy(sig.mac_addr, this->bssid, ETH_ALEN); 867 memcpy(sig.mac_addr, this->bssid, ETH_ALEN);
884 return wl3501_esbq_exec(this, &sig, sizeof(sig)); 868 return wl3501_esbq_exec(this, &sig, sizeof(sig));
885} 869}
@@ -893,7 +877,7 @@ static int wl3501_mgmt_association(struct wl3501_card *this)
893 .cap_info = this->cap_info, 877 .cap_info = this->cap_info,
894 }; 878 };
895 879
896 dprintk(3, "entry"); 880 pr_debug("entry");
897 memcpy(sig.mac_addr, this->bssid, ETH_ALEN); 881 memcpy(sig.mac_addr, this->bssid, ETH_ALEN);
898 return wl3501_esbq_exec(this, &sig, sizeof(sig)); 882 return wl3501_esbq_exec(this, &sig, sizeof(sig));
899} 883}
@@ -903,7 +887,7 @@ static void wl3501_mgmt_join_confirm(struct net_device *dev, u16 addr)
903 struct wl3501_card *this = netdev_priv(dev); 887 struct wl3501_card *this = netdev_priv(dev);
904 struct wl3501_join_confirm sig; 888 struct wl3501_join_confirm sig;
905 889
906 dprintk(3, "entry"); 890 pr_debug("entry");
907 wl3501_get_from_wla(this, addr, &sig, sizeof(sig)); 891 wl3501_get_from_wla(this, addr, &sig, sizeof(sig));
908 if (sig.status == WL3501_STATUS_SUCCESS) { 892 if (sig.status == WL3501_STATUS_SUCCESS) {
909 if (this->net_type == IW_MODE_INFRA) { 893 if (this->net_type == IW_MODE_INFRA) {
@@ -962,7 +946,7 @@ static inline void wl3501_md_confirm_interrupt(struct net_device *dev,
962{ 946{
963 struct wl3501_md_confirm sig; 947 struct wl3501_md_confirm sig;
964 948
965 dprintk(3, "entry"); 949 pr_debug("entry");
966 wl3501_get_from_wla(this, addr, &sig, sizeof(sig)); 950 wl3501_get_from_wla(this, addr, &sig, sizeof(sig));
967 wl3501_free_tx_buffer(this, sig.data); 951 wl3501_free_tx_buffer(this, sig.data);
968 if (netif_queue_stopped(dev)) 952 if (netif_queue_stopped(dev))
@@ -1017,7 +1001,7 @@ static inline void wl3501_md_ind_interrupt(struct net_device *dev,
1017static inline void wl3501_get_confirm_interrupt(struct wl3501_card *this, 1001static inline void wl3501_get_confirm_interrupt(struct wl3501_card *this,
1018 u16 addr, void *sig, int size) 1002 u16 addr, void *sig, int size)
1019{ 1003{
1020 dprintk(3, "entry"); 1004 pr_debug("entry");
1021 wl3501_get_from_wla(this, addr, &this->sig_get_confirm, 1005 wl3501_get_from_wla(this, addr, &this->sig_get_confirm,
1022 sizeof(this->sig_get_confirm)); 1006 sizeof(this->sig_get_confirm));
1023 wake_up(&this->wait); 1007 wake_up(&this->wait);
@@ -1029,7 +1013,7 @@ static inline void wl3501_start_confirm_interrupt(struct net_device *dev,
1029{ 1013{
1030 struct wl3501_start_confirm sig; 1014 struct wl3501_start_confirm sig;
1031 1015
1032 dprintk(3, "entry"); 1016 pr_debug("entry");
1033 wl3501_get_from_wla(this, addr, &sig, sizeof(sig)); 1017 wl3501_get_from_wla(this, addr, &sig, sizeof(sig));
1034 if (sig.status == WL3501_STATUS_SUCCESS) 1018 if (sig.status == WL3501_STATUS_SUCCESS)
1035 netif_wake_queue(dev); 1019 netif_wake_queue(dev);
@@ -1041,7 +1025,7 @@ static inline void wl3501_assoc_confirm_interrupt(struct net_device *dev,
1041 struct wl3501_card *this = netdev_priv(dev); 1025 struct wl3501_card *this = netdev_priv(dev);
1042 struct wl3501_assoc_confirm sig; 1026 struct wl3501_assoc_confirm sig;
1043 1027
1044 dprintk(3, "entry"); 1028 pr_debug("entry");
1045 wl3501_get_from_wla(this, addr, &sig, sizeof(sig)); 1029 wl3501_get_from_wla(this, addr, &sig, sizeof(sig));
1046 1030
1047 if (sig.status == WL3501_STATUS_SUCCESS) 1031 if (sig.status == WL3501_STATUS_SUCCESS)
@@ -1053,7 +1037,7 @@ static inline void wl3501_auth_confirm_interrupt(struct wl3501_card *this,
1053{ 1037{
1054 struct wl3501_auth_confirm sig; 1038 struct wl3501_auth_confirm sig;
1055 1039
1056 dprintk(3, "entry"); 1040 pr_debug("entry");
1057 wl3501_get_from_wla(this, addr, &sig, sizeof(sig)); 1041 wl3501_get_from_wla(this, addr, &sig, sizeof(sig));
1058 1042
1059 if (sig.status == WL3501_STATUS_SUCCESS) 1043 if (sig.status == WL3501_STATUS_SUCCESS)
@@ -1069,7 +1053,7 @@ static inline void wl3501_rx_interrupt(struct net_device *dev)
1069 u8 sig_id; 1053 u8 sig_id;
1070 struct wl3501_card *this = netdev_priv(dev); 1054 struct wl3501_card *this = netdev_priv(dev);
1071 1055
1072 dprintk(3, "entry"); 1056 pr_debug("entry");
1073loop: 1057loop:
1074 morepkts = 0; 1058 morepkts = 0;
1075 if (!wl3501_esbq_confirm(this)) 1059 if (!wl3501_esbq_confirm(this))
@@ -1302,7 +1286,7 @@ static int wl3501_reset(struct net_device *dev)
1302 wl3501_ack_interrupt(this); 1286 wl3501_ack_interrupt(this);
1303 wl3501_unblock_interrupt(this); 1287 wl3501_unblock_interrupt(this);
1304 wl3501_mgmt_scan(this, 100); 1288 wl3501_mgmt_scan(this, 100);
1305 dprintk(1, "%s: device reset", dev->name); 1289 pr_debug("%s: device reset", dev->name);
1306 rc = 0; 1290 rc = 0;
1307out: 1291out:
1308 return rc; 1292 return rc;
@@ -1376,7 +1360,7 @@ static int wl3501_open(struct net_device *dev)
1376 link->open++; 1360 link->open++;
1377 1361
1378 /* Initial WL3501 firmware */ 1362 /* Initial WL3501 firmware */
1379 dprintk(1, "%s: Initialize WL3501 firmware...", dev->name); 1363 pr_debug("%s: Initialize WL3501 firmware...", dev->name);
1380 if (wl3501_init_firmware(this)) 1364 if (wl3501_init_firmware(this))
1381 goto fail; 1365 goto fail;
1382 /* Initial device variables */ 1366 /* Initial device variables */
@@ -1388,7 +1372,7 @@ static int wl3501_open(struct net_device *dev)
1388 wl3501_unblock_interrupt(this); 1372 wl3501_unblock_interrupt(this);
1389 wl3501_mgmt_scan(this, 100); 1373 wl3501_mgmt_scan(this, 100);
1390 rc = 0; 1374 rc = 0;
1391 dprintk(1, "%s: WL3501 opened", dev->name); 1375 pr_debug("%s: WL3501 opened", dev->name);
1392 printk(KERN_INFO "%s: Card Name: %s\n" 1376 printk(KERN_INFO "%s: Card Name: %s\n"
1393 "%s: Firmware Date: %s\n", 1377 "%s: Firmware Date: %s\n",
1394 dev->name, this->card_name, 1378 dev->name, this->card_name,
@@ -1914,8 +1898,7 @@ static int wl3501_probe(struct pcmcia_device *p_dev)
1914 p_dev->io.IOAddrLines = 5; 1898 p_dev->io.IOAddrLines = 5;
1915 1899
1916 /* Interrupt setup */ 1900 /* Interrupt setup */
1917 p_dev->irq.Attributes = IRQ_TYPE_DYNAMIC_SHARING | IRQ_HANDLE_PRESENT; 1901 p_dev->irq.Attributes = IRQ_TYPE_DYNAMIC_SHARING;
1918 p_dev->irq.IRQInfo1 = IRQ_LEVEL_ID;
1919 p_dev->irq.Handler = wl3501_interrupt; 1902 p_dev->irq.Handler = wl3501_interrupt;
1920 1903
1921 /* General socket configuration */ 1904 /* General socket configuration */
@@ -1938,16 +1921,13 @@ static int wl3501_probe(struct pcmcia_device *p_dev)
1938 dev->wireless_handlers = &wl3501_handler_def; 1921 dev->wireless_handlers = &wl3501_handler_def;
1939 SET_ETHTOOL_OPS(dev, &ops); 1922 SET_ETHTOOL_OPS(dev, &ops);
1940 netif_stop_queue(dev); 1923 netif_stop_queue(dev);
1941 p_dev->priv = p_dev->irq.Instance = dev; 1924 p_dev->priv = dev;
1942 1925
1943 return wl3501_config(p_dev); 1926 return wl3501_config(p_dev);
1944out_link: 1927out_link:
1945 return -ENOMEM; 1928 return -ENOMEM;
1946} 1929}
1947 1930
1948#define CS_CHECK(fn, ret) \
1949do { last_fn = (fn); if ((last_ret = (ret)) != 0) goto cs_failed; } while (0)
1950
1951/** 1931/**
1952 * wl3501_config - configure the PCMCIA socket and make eth device available 1932 * wl3501_config - configure the PCMCIA socket and make eth device available
1953 * @link - FILL_IN 1933 * @link - FILL_IN
@@ -1959,7 +1939,7 @@ do { last_fn = (fn); if ((last_ret = (ret)) != 0) goto cs_failed; } while (0)
1959static int wl3501_config(struct pcmcia_device *link) 1939static int wl3501_config(struct pcmcia_device *link)
1960{ 1940{
1961 struct net_device *dev = link->priv; 1941 struct net_device *dev = link->priv;
1962 int i = 0, j, last_fn, last_ret; 1942 int i = 0, j, ret;
1963 struct wl3501_card *this; 1943 struct wl3501_card *this;
1964 1944
1965 /* Try allocating IO ports. This tries a few fixed addresses. If you 1945 /* Try allocating IO ports. This tries a few fixed addresses. If you
@@ -1975,24 +1955,26 @@ static int wl3501_config(struct pcmcia_device *link)
1975 if (i == 0) 1955 if (i == 0)
1976 break; 1956 break;
1977 } 1957 }
1978 if (i != 0) { 1958 if (i != 0)
1979 cs_error(link, RequestIO, i);
1980 goto failed; 1959 goto failed;
1981 }
1982 1960
1983 /* Now allocate an interrupt line. Note that this does not actually 1961 /* Now allocate an interrupt line. Note that this does not actually
1984 * assign a handler to the interrupt. */ 1962 * assign a handler to the interrupt. */
1985 1963
1986 CS_CHECK(RequestIRQ, pcmcia_request_irq(link, &link->irq)); 1964 ret = pcmcia_request_irq(link, &link->irq);
1965 if (ret)
1966 goto failed;
1987 1967
1988 /* This actually configures the PCMCIA socket -- setting up the I/O 1968 /* This actually configures the PCMCIA socket -- setting up the I/O
1989 * windows and the interrupt mapping. */ 1969 * windows and the interrupt mapping. */
1990 1970
1991 CS_CHECK(RequestConfiguration, pcmcia_request_configuration(link, &link->conf)); 1971 ret = pcmcia_request_configuration(link, &link->conf);
1972 if (ret)
1973 goto failed;
1992 1974
1993 dev->irq = link->irq.AssignedIRQ; 1975 dev->irq = link->irq.AssignedIRQ;
1994 dev->base_addr = link->io.BasePort1; 1976 dev->base_addr = link->io.BasePort1;
1995 SET_NETDEV_DEV(dev, &handle_to_dev(link)); 1977 SET_NETDEV_DEV(dev, &link->dev);
1996 if (register_netdev(dev)) { 1978 if (register_netdev(dev)) {
1997 printk(KERN_NOTICE "wl3501_cs: register_netdev() failed\n"); 1979 printk(KERN_NOTICE "wl3501_cs: register_netdev() failed\n");
1998 goto failed; 1980 goto failed;
@@ -2041,8 +2023,6 @@ static int wl3501_config(struct pcmcia_device *link)
2041 netif_start_queue(dev); 2023 netif_start_queue(dev);
2042 return 0; 2024 return 0;
2043 2025
2044cs_failed:
2045 cs_error(link, last_fn, last_ret);
2046failed: 2026failed:
2047 wl3501_release(link); 2027 wl3501_release(link);
2048 return -ENODEV; 2028 return -ENODEV;
diff --git a/drivers/parport/parport_cs.c b/drivers/parport/parport_cs.c
index 8fdfa4f537a6..7dd370fa3439 100644
--- a/drivers/parport/parport_cs.c
+++ b/drivers/parport/parport_cs.c
@@ -67,14 +67,6 @@ MODULE_LICENSE("Dual MPL/GPL");
67 67
68INT_MODULE_PARM(epp_mode, 1); 68INT_MODULE_PARM(epp_mode, 1);
69 69
70#ifdef PCMCIA_DEBUG
71INT_MODULE_PARM(pc_debug, PCMCIA_DEBUG);
72#define DEBUG(n, args...) if (pc_debug>(n)) printk(KERN_DEBUG args)
73static char *version =
74"parport_cs.c 1.29 2002/10/11 06:57:41 (David Hinds)";
75#else
76#define DEBUG(n, args...)
77#endif
78 70
79/*====================================================================*/ 71/*====================================================================*/
80 72
@@ -103,7 +95,7 @@ static int parport_probe(struct pcmcia_device *link)
103{ 95{
104 parport_info_t *info; 96 parport_info_t *info;
105 97
106 DEBUG(0, "parport_attach()\n"); 98 dev_dbg(&link->dev, "parport_attach()\n");
107 99
108 /* Create new parport device */ 100 /* Create new parport device */
109 info = kzalloc(sizeof(*info), GFP_KERNEL); 101 info = kzalloc(sizeof(*info), GFP_KERNEL);
@@ -114,7 +106,6 @@ static int parport_probe(struct pcmcia_device *link)
114 link->io.Attributes1 = IO_DATA_PATH_WIDTH_8; 106 link->io.Attributes1 = IO_DATA_PATH_WIDTH_8;
115 link->io.Attributes2 = IO_DATA_PATH_WIDTH_8; 107 link->io.Attributes2 = IO_DATA_PATH_WIDTH_8;
116 link->irq.Attributes = IRQ_TYPE_DYNAMIC_SHARING; 108 link->irq.Attributes = IRQ_TYPE_DYNAMIC_SHARING;
117 link->irq.IRQInfo1 = IRQ_LEVEL_ID;
118 link->conf.Attributes = CONF_ENABLE_IRQ; 109 link->conf.Attributes = CONF_ENABLE_IRQ;
119 link->conf.IntType = INT_MEMORY_AND_IO; 110 link->conf.IntType = INT_MEMORY_AND_IO;
120 111
@@ -132,7 +123,7 @@ static int parport_probe(struct pcmcia_device *link)
132 123
133static void parport_detach(struct pcmcia_device *link) 124static void parport_detach(struct pcmcia_device *link)
134{ 125{
135 DEBUG(0, "parport_detach(0x%p)\n", link); 126 dev_dbg(&link->dev, "parport_detach\n");
136 127
137 parport_cs_release(link); 128 parport_cs_release(link);
138 129
@@ -147,9 +138,6 @@ static void parport_detach(struct pcmcia_device *link)
147 138
148======================================================================*/ 139======================================================================*/
149 140
150#define CS_CHECK(fn, ret) \
151do { last_fn = (fn); if ((last_ret = (ret)) != 0) goto cs_failed; } while (0)
152
153static int parport_config_check(struct pcmcia_device *p_dev, 141static int parport_config_check(struct pcmcia_device *p_dev,
154 cistpl_cftable_entry_t *cfg, 142 cistpl_cftable_entry_t *cfg,
155 cistpl_cftable_entry_t *dflt, 143 cistpl_cftable_entry_t *dflt,
@@ -178,18 +166,20 @@ static int parport_config(struct pcmcia_device *link)
178{ 166{
179 parport_info_t *info = link->priv; 167 parport_info_t *info = link->priv;
180 struct parport *p; 168 struct parport *p;
181 int last_ret, last_fn; 169 int ret;
182 170
183 DEBUG(0, "parport_config(0x%p)\n", link); 171 dev_dbg(&link->dev, "parport_config\n");
184 172
185 last_ret = pcmcia_loop_config(link, parport_config_check, NULL); 173 ret = pcmcia_loop_config(link, parport_config_check, NULL);
186 if (last_ret) { 174 if (ret)
187 cs_error(link, RequestIO, last_ret);
188 goto failed; 175 goto failed;
189 }
190 176
191 CS_CHECK(RequestIRQ, pcmcia_request_irq(link, &link->irq)); 177 ret = pcmcia_request_irq(link, &link->irq);
192 CS_CHECK(RequestConfiguration, pcmcia_request_configuration(link, &link->conf)); 178 if (ret)
179 goto failed;
180 ret = pcmcia_request_configuration(link, &link->conf);
181 if (ret)
182 goto failed;
193 183
194 p = parport_pc_probe_port(link->io.BasePort1, link->io.BasePort2, 184 p = parport_pc_probe_port(link->io.BasePort1, link->io.BasePort2,
195 link->irq.AssignedIRQ, PARPORT_DMA_NONE, 185 link->irq.AssignedIRQ, PARPORT_DMA_NONE,
@@ -213,8 +203,6 @@ static int parport_config(struct pcmcia_device *link)
213 203
214 return 0; 204 return 0;
215 205
216cs_failed:
217 cs_error(link, last_fn, last_ret);
218failed: 206failed:
219 parport_cs_release(link); 207 parport_cs_release(link);
220 return -ENODEV; 208 return -ENODEV;
@@ -232,7 +220,7 @@ static void parport_cs_release(struct pcmcia_device *link)
232{ 220{
233 parport_info_t *info = link->priv; 221 parport_info_t *info = link->priv;
234 222
235 DEBUG(0, "parport_release(0x%p)\n", link); 223 dev_dbg(&link->dev, "parport_release\n");
236 224
237 if (info->ndev) { 225 if (info->ndev) {
238 struct parport *p = info->port; 226 struct parport *p = info->port;
diff --git a/drivers/pci/dmar.c b/drivers/pci/dmar.c
index 22b02c6df854..416f6ac65b76 100644
--- a/drivers/pci/dmar.c
+++ b/drivers/pci/dmar.c
@@ -175,15 +175,6 @@ dmar_parse_one_drhd(struct acpi_dmar_header *header)
175 int ret = 0; 175 int ret = 0;
176 176
177 drhd = (struct acpi_dmar_hardware_unit *)header; 177 drhd = (struct acpi_dmar_hardware_unit *)header;
178 if (!drhd->address) {
179 /* Promote an attitude of violence to a BIOS engineer today */
180 WARN(1, "Your BIOS is broken; DMAR reported at address zero!\n"
181 "BIOS vendor: %s; Ver: %s; Product Version: %s\n",
182 dmi_get_system_info(DMI_BIOS_VENDOR),
183 dmi_get_system_info(DMI_BIOS_VERSION),
184 dmi_get_system_info(DMI_PRODUCT_VERSION));
185 return -ENODEV;
186 }
187 dmaru = kzalloc(sizeof(*dmaru), GFP_KERNEL); 178 dmaru = kzalloc(sizeof(*dmaru), GFP_KERNEL);
188 if (!dmaru) 179 if (!dmaru)
189 return -ENOMEM; 180 return -ENOMEM;
@@ -591,12 +582,53 @@ int __init dmar_table_init(void)
591 return 0; 582 return 0;
592} 583}
593 584
585int __init check_zero_address(void)
586{
587 struct acpi_table_dmar *dmar;
588 struct acpi_dmar_header *entry_header;
589 struct acpi_dmar_hardware_unit *drhd;
590
591 dmar = (struct acpi_table_dmar *)dmar_tbl;
592 entry_header = (struct acpi_dmar_header *)(dmar + 1);
593
594 while (((unsigned long)entry_header) <
595 (((unsigned long)dmar) + dmar_tbl->length)) {
596 /* Avoid looping forever on bad ACPI tables */
597 if (entry_header->length == 0) {
598 printk(KERN_WARNING PREFIX
599 "Invalid 0-length structure\n");
600 return 0;
601 }
602
603 if (entry_header->type == ACPI_DMAR_TYPE_HARDWARE_UNIT) {
604 drhd = (void *)entry_header;
605 if (!drhd->address) {
606 /* Promote an attitude of violence to a BIOS engineer today */
607 WARN(1, "Your BIOS is broken; DMAR reported at address zero!\n"
608 "BIOS vendor: %s; Ver: %s; Product Version: %s\n",
609 dmi_get_system_info(DMI_BIOS_VENDOR),
610 dmi_get_system_info(DMI_BIOS_VERSION),
611 dmi_get_system_info(DMI_PRODUCT_VERSION));
612#ifdef CONFIG_DMAR
613 dmar_disabled = 1;
614#endif
615 return 0;
616 }
617 break;
618 }
619
620 entry_header = ((void *)entry_header + entry_header->length);
621 }
622 return 1;
623}
624
594void __init detect_intel_iommu(void) 625void __init detect_intel_iommu(void)
595{ 626{
596 int ret; 627 int ret;
597 628
598 ret = dmar_table_detect(); 629 ret = dmar_table_detect();
599 630 if (ret)
631 ret = check_zero_address();
600 { 632 {
601#ifdef CONFIG_INTR_REMAP 633#ifdef CONFIG_INTR_REMAP
602 struct acpi_table_dmar *dmar; 634 struct acpi_table_dmar *dmar;
@@ -613,10 +645,13 @@ void __init detect_intel_iommu(void)
613 "x2apic and Intr-remapping.\n"); 645 "x2apic and Intr-remapping.\n");
614#endif 646#endif
615#ifdef CONFIG_DMAR 647#ifdef CONFIG_DMAR
616 if (ret && !no_iommu && !iommu_detected && !swiotlb && 648 if (ret && !no_iommu && !iommu_detected && !dmar_disabled)
617 !dmar_disabled)
618 iommu_detected = 1; 649 iommu_detected = 1;
619#endif 650#endif
651#ifdef CONFIG_X86
652 if (ret)
653 x86_init.iommu.iommu_init = intel_iommu_init;
654#endif
620 } 655 }
621 early_acpi_os_unmap_memory(dmar_tbl, dmar_tbl_size); 656 early_acpi_os_unmap_memory(dmar_tbl, dmar_tbl_size);
622 dmar_tbl = NULL; 657 dmar_tbl = NULL;
diff --git a/drivers/pci/intel-iommu.c b/drivers/pci/intel-iommu.c
index b1e97e682500..9261327b49f3 100644
--- a/drivers/pci/intel-iommu.c
+++ b/drivers/pci/intel-iommu.c
@@ -2767,7 +2767,15 @@ static void *intel_alloc_coherent(struct device *hwdev, size_t size,
2767 2767
2768 size = PAGE_ALIGN(size); 2768 size = PAGE_ALIGN(size);
2769 order = get_order(size); 2769 order = get_order(size);
2770 flags &= ~(GFP_DMA | GFP_DMA32); 2770
2771 if (!iommu_no_mapping(hwdev))
2772 flags &= ~(GFP_DMA | GFP_DMA32);
2773 else if (hwdev->coherent_dma_mask < dma_get_required_mask(hwdev)) {
2774 if (hwdev->coherent_dma_mask < DMA_BIT_MASK(32))
2775 flags |= GFP_DMA;
2776 else
2777 flags |= GFP_DMA32;
2778 }
2771 2779
2772 vaddr = (void *)__get_free_pages(flags, order); 2780 vaddr = (void *)__get_free_pages(flags, order);
2773 if (!vaddr) 2781 if (!vaddr)
@@ -3207,6 +3215,33 @@ static int __init init_iommu_sysfs(void)
3207} 3215}
3208#endif /* CONFIG_PM */ 3216#endif /* CONFIG_PM */
3209 3217
3218/*
3219 * Here we only respond to action of unbound device from driver.
3220 *
3221 * Added device is not attached to its DMAR domain here yet. That will happen
3222 * when mapping the device to iova.
3223 */
3224static int device_notifier(struct notifier_block *nb,
3225 unsigned long action, void *data)
3226{
3227 struct device *dev = data;
3228 struct pci_dev *pdev = to_pci_dev(dev);
3229 struct dmar_domain *domain;
3230
3231 domain = find_domain(pdev);
3232 if (!domain)
3233 return 0;
3234
3235 if (action == BUS_NOTIFY_UNBOUND_DRIVER && !iommu_pass_through)
3236 domain_remove_one_dev_info(domain, pdev);
3237
3238 return 0;
3239}
3240
3241static struct notifier_block device_nb = {
3242 .notifier_call = device_notifier,
3243};
3244
3210int __init intel_iommu_init(void) 3245int __init intel_iommu_init(void)
3211{ 3246{
3212 int ret = 0; 3247 int ret = 0;
@@ -3231,7 +3266,7 @@ int __init intel_iommu_init(void)
3231 * Check the need for DMA-remapping initialization now. 3266 * Check the need for DMA-remapping initialization now.
3232 * Above initialization will also be used by Interrupt-remapping. 3267 * Above initialization will also be used by Interrupt-remapping.
3233 */ 3268 */
3234 if (no_iommu || swiotlb || dmar_disabled) 3269 if (no_iommu || dmar_disabled)
3235 return -ENODEV; 3270 return -ENODEV;
3236 3271
3237 iommu_init_mempool(); 3272 iommu_init_mempool();
@@ -3252,13 +3287,17 @@ int __init intel_iommu_init(void)
3252 "PCI-DMA: Intel(R) Virtualization Technology for Directed I/O\n"); 3287 "PCI-DMA: Intel(R) Virtualization Technology for Directed I/O\n");
3253 3288
3254 init_timer(&unmap_timer); 3289 init_timer(&unmap_timer);
3255 force_iommu = 1; 3290#ifdef CONFIG_SWIOTLB
3291 swiotlb = 0;
3292#endif
3256 dma_ops = &intel_dma_ops; 3293 dma_ops = &intel_dma_ops;
3257 3294
3258 init_iommu_sysfs(); 3295 init_iommu_sysfs();
3259 3296
3260 register_iommu(&intel_iommu_ops); 3297 register_iommu(&intel_iommu_ops);
3261 3298
3299 bus_register_notifier(&pci_bus_type, &device_nb);
3300
3262 return 0; 3301 return 0;
3263} 3302}
3264 3303
diff --git a/drivers/pci/pcie/aspm.c b/drivers/pci/pcie/aspm.c
index 745402e8e498..5b7056cec00c 100644
--- a/drivers/pci/pcie/aspm.c
+++ b/drivers/pci/pcie/aspm.c
@@ -656,8 +656,10 @@ void pcie_aspm_exit_link_state(struct pci_dev *pdev)
656 free_link_state(link); 656 free_link_state(link);
657 657
658 /* Recheck latencies and configure upstream links */ 658 /* Recheck latencies and configure upstream links */
659 pcie_update_aspm_capable(root); 659 if (parent_link) {
660 pcie_config_aspm_path(parent_link); 660 pcie_update_aspm_capable(root);
661 pcie_config_aspm_path(parent_link);
662 }
661out: 663out:
662 mutex_unlock(&aspm_lock); 664 mutex_unlock(&aspm_lock);
663 up_read(&pci_bus_sem); 665 up_read(&pci_bus_sem);
diff --git a/drivers/pcmcia/Kconfig b/drivers/pcmcia/Kconfig
index 17f38a781d47..f3ccbccf5f21 100644
--- a/drivers/pcmcia/Kconfig
+++ b/drivers/pcmcia/Kconfig
@@ -17,24 +17,6 @@ menuconfig PCCARD
17 17
18if PCCARD 18if PCCARD
19 19
20config PCMCIA_DEBUG
21 bool "Enable PCCARD debugging"
22 help
23 Say Y here to enable PCMCIA subsystem debugging. You
24 will need to choose the debugging level either via the
25 kernel command line, or module options depending whether
26 you build the PCMCIA as modules.
27
28 The kernel command line options are:
29 pcmcia_core.pc_debug=N
30 pcmcia.pc_debug=N
31 sa11xx_core.pc_debug=N
32
33 The module option is called pc_debug=N
34
35 In all the above examples, N is the debugging verbosity
36 level.
37
38config PCMCIA 20config PCMCIA
39 tristate "16-bit PCMCIA support" 21 tristate "16-bit PCMCIA support"
40 select CRC32 22 select CRC32
@@ -196,9 +178,13 @@ config PCMCIA_BCM63XX
196 tristate "bcm63xx pcmcia support" 178 tristate "bcm63xx pcmcia support"
197 depends on BCM63XX && PCMCIA 179 depends on BCM63XX && PCMCIA
198 180
181config PCMCIA_SOC_COMMON
182 bool
183
199config PCMCIA_SA1100 184config PCMCIA_SA1100
200 tristate "SA1100 support" 185 tristate "SA1100 support"
201 depends on ARM && ARCH_SA1100 && PCMCIA 186 depends on ARM && ARCH_SA1100 && PCMCIA
187 select PCMCIA_SOC_COMMON
202 help 188 help
203 Say Y here to include support for SA11x0-based PCMCIA or CF 189 Say Y here to include support for SA11x0-based PCMCIA or CF
204 sockets, found on HP iPAQs, Yopy, and other StrongARM(R)/ 190 sockets, found on HP iPAQs, Yopy, and other StrongARM(R)/
@@ -209,6 +195,7 @@ config PCMCIA_SA1100
209config PCMCIA_SA1111 195config PCMCIA_SA1111
210 tristate "SA1111 support" 196 tristate "SA1111 support"
211 depends on ARM && ARCH_SA1100 && SA1111 && PCMCIA 197 depends on ARM && ARCH_SA1100 && SA1111 && PCMCIA
198 select PCMCIA_SOC_COMMON
212 help 199 help
213 Say Y here to include support for SA1111-based PCMCIA or CF 200 Say Y here to include support for SA1111-based PCMCIA or CF
214 sockets, found on the Jornada 720, Graphicsmaster and other 201 sockets, found on the Jornada 720, Graphicsmaster and other
@@ -222,9 +209,28 @@ config PCMCIA_PXA2XX
222 depends on (ARCH_LUBBOCK || MACH_MAINSTONE || PXA_SHARPSL \ 209 depends on (ARCH_LUBBOCK || MACH_MAINSTONE || PXA_SHARPSL \
223 || MACH_ARMCORE || ARCH_PXA_PALM || TRIZEPS_PCMCIA \ 210 || MACH_ARMCORE || ARCH_PXA_PALM || TRIZEPS_PCMCIA \
224 || ARCH_VIPER || ARCH_PXA_ESERIES || MACH_STARGATE2) 211 || ARCH_VIPER || ARCH_PXA_ESERIES || MACH_STARGATE2)
212 select PCMCIA_SOC_COMMON
225 help 213 help
226 Say Y here to include support for the PXA2xx PCMCIA controller 214 Say Y here to include support for the PXA2xx PCMCIA controller
227 215
216config PCMCIA_DEBUG
217 bool "Enable debugging"
218 depends on (PCMCIA_SA1111 || PCMCIA_SA1100 || PCMCIA_PXA2XX)
219 help
220 Say Y here to enable debugging for the SoC PCMCIA layer.
221 You will need to choose the debugging level either via the
222 kernel command line, or module options depending whether
223 you build the drivers as modules.
224
225 The kernel command line options are:
226 sa11xx_core.pc_debug=N
227 pxa2xx_core.pc_debug=N
228
229 The module option is called pc_debug=N
230
231 In all the above examples, N is the debugging verbosity
232 level.
233
228config PCMCIA_PROBE 234config PCMCIA_PROBE
229 bool 235 bool
230 default y if ISA && !ARCH_SA1100 && !ARCH_CLPS711X && !PARISC 236 default y if ISA && !ARCH_SA1100 && !ARCH_CLPS711X && !PARISC
diff --git a/drivers/pcmcia/Makefile b/drivers/pcmcia/Makefile
index a03a38acd77d..382938313991 100644
--- a/drivers/pcmcia/Makefile
+++ b/drivers/pcmcia/Makefile
@@ -22,8 +22,9 @@ obj-$(CONFIG_I82365) += i82365.o
22obj-$(CONFIG_I82092) += i82092.o 22obj-$(CONFIG_I82092) += i82092.o
23obj-$(CONFIG_TCIC) += tcic.o 23obj-$(CONFIG_TCIC) += tcic.o
24obj-$(CONFIG_PCMCIA_M8XX) += m8xx_pcmcia.o 24obj-$(CONFIG_PCMCIA_M8XX) += m8xx_pcmcia.o
25obj-$(CONFIG_PCMCIA_SA1100) += sa11xx_core.o sa1100_cs.o 25obj-$(CONFIG_PCMCIA_SOC_COMMON) += soc_common.o
26obj-$(CONFIG_PCMCIA_SA1111) += sa11xx_core.o sa1111_cs.o 26obj-$(CONFIG_PCMCIA_SA1100) += sa11xx_base.o sa1100_cs.o
27obj-$(CONFIG_PCMCIA_SA1111) += sa11xx_base.o sa1111_cs.o
27obj-$(CONFIG_M32R_PCC) += m32r_pcc.o 28obj-$(CONFIG_M32R_PCC) += m32r_pcc.o
28obj-$(CONFIG_M32R_CFC) += m32r_cfc.o 29obj-$(CONFIG_M32R_CFC) += m32r_cfc.o
29obj-$(CONFIG_PCMCIA_AU1X00) += au1x00_ss.o 30obj-$(CONFIG_PCMCIA_AU1X00) += au1x00_ss.o
@@ -35,9 +36,6 @@ obj-$(CONFIG_BFIN_CFPCMCIA) += bfin_cf_pcmcia.o
35obj-$(CONFIG_AT91_CF) += at91_cf.o 36obj-$(CONFIG_AT91_CF) += at91_cf.o
36obj-$(CONFIG_ELECTRA_CF) += electra_cf.o 37obj-$(CONFIG_ELECTRA_CF) += electra_cf.o
37 38
38sa11xx_core-y += soc_common.o sa11xx_base.o
39pxa2xx_core-y += soc_common.o pxa2xx_base.o
40
41au1x00_ss-y += au1000_generic.o 39au1x00_ss-y += au1000_generic.o
42au1x00_ss-$(CONFIG_MIPS_PB1000) += au1000_pb1x00.o 40au1x00_ss-$(CONFIG_MIPS_PB1000) += au1000_pb1x00.o
43au1x00_ss-$(CONFIG_MIPS_PB1100) += au1000_pb1x00.o 41au1x00_ss-$(CONFIG_MIPS_PB1100) += au1000_pb1x00.o
@@ -77,4 +75,4 @@ pxa2xx-obj-$(CONFIG_MACH_PALMLD) += pxa2xx_palmld.o
77pxa2xx-obj-$(CONFIG_MACH_E740) += pxa2xx_e740.o 75pxa2xx-obj-$(CONFIG_MACH_E740) += pxa2xx_e740.o
78pxa2xx-obj-$(CONFIG_MACH_STARGATE2) += pxa2xx_stargate2.o 76pxa2xx-obj-$(CONFIG_MACH_STARGATE2) += pxa2xx_stargate2.o
79 77
80obj-$(CONFIG_PCMCIA_PXA2XX) += pxa2xx_core.o $(pxa2xx-obj-y) 78obj-$(CONFIG_PCMCIA_PXA2XX) += pxa2xx_base.o $(pxa2xx-obj-y)
diff --git a/drivers/pcmcia/cardbus.c b/drivers/pcmcia/cardbus.c
index db77e1f3309a..4cd70d056810 100644
--- a/drivers/pcmcia/cardbus.c
+++ b/drivers/pcmcia/cardbus.c
@@ -91,7 +91,7 @@ static u_int xlate_rom_addr(void __iomem *b, u_int addr)
91static void cb_release_cis_mem(struct pcmcia_socket * s) 91static void cb_release_cis_mem(struct pcmcia_socket * s)
92{ 92{
93 if (s->cb_cis_virt) { 93 if (s->cb_cis_virt) {
94 cs_dbg(s, 1, "cb_release_cis_mem()\n"); 94 dev_dbg(&s->dev, "cb_release_cis_mem()\n");
95 iounmap(s->cb_cis_virt); 95 iounmap(s->cb_cis_virt);
96 s->cb_cis_virt = NULL; 96 s->cb_cis_virt = NULL;
97 s->cb_cis_res = NULL; 97 s->cb_cis_res = NULL;
@@ -132,7 +132,7 @@ int read_cb_mem(struct pcmcia_socket * s, int space, u_int addr, u_int len, void
132 struct pci_dev *dev; 132 struct pci_dev *dev;
133 struct resource *res; 133 struct resource *res;
134 134
135 cs_dbg(s, 3, "read_cb_mem(%d, %#x, %u)\n", space, addr, len); 135 dev_dbg(&s->dev, "read_cb_mem(%d, %#x, %u)\n", space, addr, len);
136 136
137 dev = pci_get_slot(s->cb_dev->subordinate, 0); 137 dev = pci_get_slot(s->cb_dev->subordinate, 0);
138 if (!dev) 138 if (!dev)
diff --git a/drivers/pcmcia/cirrus.h b/drivers/pcmcia/cirrus.h
index ecd4fc7f666f..446a4576e73e 100644
--- a/drivers/pcmcia/cirrus.h
+++ b/drivers/pcmcia/cirrus.h
@@ -30,16 +30,6 @@
30#ifndef _LINUX_CIRRUS_H 30#ifndef _LINUX_CIRRUS_H
31#define _LINUX_CIRRUS_H 31#define _LINUX_CIRRUS_H
32 32
33#ifndef PCI_VENDOR_ID_CIRRUS
34#define PCI_VENDOR_ID_CIRRUS 0x1013
35#endif
36#ifndef PCI_DEVICE_ID_CIRRUS_6729
37#define PCI_DEVICE_ID_CIRRUS_6729 0x1100
38#endif
39#ifndef PCI_DEVICE_ID_CIRRUS_6832
40#define PCI_DEVICE_ID_CIRRUS_6832 0x1110
41#endif
42
43#define PD67_MISC_CTL_1 0x16 /* Misc control 1 */ 33#define PD67_MISC_CTL_1 0x16 /* Misc control 1 */
44#define PD67_FIFO_CTL 0x17 /* FIFO control */ 34#define PD67_FIFO_CTL 0x17 /* FIFO control */
45#define PD67_MISC_CTL_2 0x1E /* Misc control 2 */ 35#define PD67_MISC_CTL_2 0x1E /* Misc control 2 */
diff --git a/drivers/pcmcia/cistpl.c b/drivers/pcmcia/cistpl.c
index 6c4a4fc83630..8c1b73cf021b 100644
--- a/drivers/pcmcia/cistpl.c
+++ b/drivers/pcmcia/cistpl.c
@@ -138,7 +138,7 @@ int pcmcia_read_cis_mem(struct pcmcia_socket *s, int attr, u_int addr,
138 void __iomem *sys, *end; 138 void __iomem *sys, *end;
139 unsigned char *buf = ptr; 139 unsigned char *buf = ptr;
140 140
141 cs_dbg(s, 3, "pcmcia_read_cis_mem(%d, %#x, %u)\n", attr, addr, len); 141 dev_dbg(&s->dev, "pcmcia_read_cis_mem(%d, %#x, %u)\n", attr, addr, len);
142 142
143 if (attr & IS_INDIRECT) { 143 if (attr & IS_INDIRECT) {
144 /* Indirect accesses use a bunch of special registers at fixed 144 /* Indirect accesses use a bunch of special registers at fixed
@@ -190,7 +190,7 @@ int pcmcia_read_cis_mem(struct pcmcia_socket *s, int attr, u_int addr,
190 addr = 0; 190 addr = 0;
191 } 191 }
192 } 192 }
193 cs_dbg(s, 3, " %#2.2x %#2.2x %#2.2x %#2.2x ...\n", 193 dev_dbg(&s->dev, " %#2.2x %#2.2x %#2.2x %#2.2x ...\n",
194 *(u_char *)(ptr+0), *(u_char *)(ptr+1), 194 *(u_char *)(ptr+0), *(u_char *)(ptr+1),
195 *(u_char *)(ptr+2), *(u_char *)(ptr+3)); 195 *(u_char *)(ptr+2), *(u_char *)(ptr+3));
196 return 0; 196 return 0;
@@ -204,7 +204,7 @@ void pcmcia_write_cis_mem(struct pcmcia_socket *s, int attr, u_int addr,
204 void __iomem *sys, *end; 204 void __iomem *sys, *end;
205 unsigned char *buf = ptr; 205 unsigned char *buf = ptr;
206 206
207 cs_dbg(s, 3, "pcmcia_write_cis_mem(%d, %#x, %u)\n", attr, addr, len); 207 dev_dbg(&s->dev, "pcmcia_write_cis_mem(%d, %#x, %u)\n", attr, addr, len);
208 208
209 if (attr & IS_INDIRECT) { 209 if (attr & IS_INDIRECT) {
210 /* Indirect accesses use a bunch of special registers at fixed 210 /* Indirect accesses use a bunch of special registers at fixed
@@ -584,7 +584,7 @@ int pccard_get_next_tuple(struct pcmcia_socket *s, unsigned int function, tuple_
584 ofs += link[1] + 2; 584 ofs += link[1] + 2;
585 } 585 }
586 if (i == MAX_TUPLES) { 586 if (i == MAX_TUPLES) {
587 cs_dbg(s, 1, "cs: overrun in pcmcia_get_next_tuple\n"); 587 dev_dbg(&s->dev, "cs: overrun in pcmcia_get_next_tuple\n");
588 return -ENOSPC; 588 return -ENOSPC;
589 } 589 }
590 590
@@ -1440,7 +1440,7 @@ int pcmcia_parse_tuple(tuple_t *tuple, cisparse_t *parse)
1440 break; 1440 break;
1441 } 1441 }
1442 if (ret) 1442 if (ret)
1443 __cs_dbg(0, "parse_tuple failed %d\n", ret); 1443 pr_debug("parse_tuple failed %d\n", ret);
1444 return ret; 1444 return ret;
1445} 1445}
1446EXPORT_SYMBOL(pcmcia_parse_tuple); 1446EXPORT_SYMBOL(pcmcia_parse_tuple);
@@ -1482,6 +1482,67 @@ done:
1482} 1482}
1483EXPORT_SYMBOL(pccard_read_tuple); 1483EXPORT_SYMBOL(pccard_read_tuple);
1484 1484
1485
1486/**
1487 * pccard_loop_tuple() - loop over tuples in the CIS
1488 * @s: the struct pcmcia_socket where the card is inserted
1489 * @function: the device function we loop for
1490 * @code: which CIS code shall we look for?
1491 * @parse: buffer where the tuple shall be parsed (or NULL, if no parse)
1492 * @priv_data: private data to be passed to the loop_tuple function.
1493 * @loop_tuple: function to call for each CIS entry of type @function. IT
1494 * gets passed the raw tuple, the paresed tuple (if @parse is
1495 * set) and @priv_data.
1496 *
1497 * pccard_loop_tuple() loops over all CIS entries of type @function, and
1498 * calls the @loop_tuple function for each entry. If the call to @loop_tuple
1499 * returns 0, the loop exits. Returns 0 on success or errorcode otherwise.
1500 */
1501int pccard_loop_tuple(struct pcmcia_socket *s, unsigned int function,
1502 cisdata_t code, cisparse_t *parse, void *priv_data,
1503 int (*loop_tuple) (tuple_t *tuple,
1504 cisparse_t *parse,
1505 void *priv_data))
1506{
1507 tuple_t tuple;
1508 cisdata_t *buf;
1509 int ret;
1510
1511 buf = kzalloc(256, GFP_KERNEL);
1512 if (buf == NULL) {
1513 dev_printk(KERN_WARNING, &s->dev, "no memory to read tuple\n");
1514 return -ENOMEM;
1515 }
1516
1517 tuple.TupleData = buf;
1518 tuple.TupleDataMax = 255;
1519 tuple.TupleOffset = 0;
1520 tuple.DesiredTuple = code;
1521 tuple.Attributes = 0;
1522
1523 ret = pccard_get_first_tuple(s, function, &tuple);
1524 while (!ret) {
1525 if (pccard_get_tuple_data(s, &tuple))
1526 goto next_entry;
1527
1528 if (parse)
1529 if (pcmcia_parse_tuple(&tuple, parse))
1530 goto next_entry;
1531
1532 ret = loop_tuple(&tuple, parse, priv_data);
1533 if (!ret)
1534 break;
1535
1536next_entry:
1537 ret = pccard_get_next_tuple(s, function, &tuple);
1538 }
1539
1540 kfree(buf);
1541 return ret;
1542}
1543EXPORT_SYMBOL(pccard_loop_tuple);
1544
1545
1485/*====================================================================== 1546/*======================================================================
1486 1547
1487 This tries to determine if a card has a sensible CIS. It returns 1548 This tries to determine if a card has a sensible CIS. It returns
diff --git a/drivers/pcmcia/cs.c b/drivers/pcmcia/cs.c
index 934d4bee39a0..790af87a922f 100644
--- a/drivers/pcmcia/cs.c
+++ b/drivers/pcmcia/cs.c
@@ -61,17 +61,6 @@ INT_MODULE_PARM(unreset_limit, 30); /* unreset_check's */
61/* Access speed for attribute memory windows */ 61/* Access speed for attribute memory windows */
62INT_MODULE_PARM(cis_speed, 300); /* ns */ 62INT_MODULE_PARM(cis_speed, 300); /* ns */
63 63
64#ifdef CONFIG_PCMCIA_DEBUG
65static int pc_debug;
66
67module_param(pc_debug, int, 0644);
68
69int cs_debug_level(int level)
70{
71 return pc_debug > level;
72}
73#endif
74
75 64
76socket_state_t dead_socket = { 65socket_state_t dead_socket = {
77 .csc_mask = SS_DETECT, 66 .csc_mask = SS_DETECT,
@@ -98,10 +87,13 @@ EXPORT_SYMBOL(pcmcia_socket_list_rwsem);
98 * These functions check for the appropriate struct pcmcia_soket arrays, 87 * These functions check for the appropriate struct pcmcia_soket arrays,
99 * and pass them to the low-level functions pcmcia_{suspend,resume}_socket 88 * and pass them to the low-level functions pcmcia_{suspend,resume}_socket
100 */ 89 */
90static int socket_early_resume(struct pcmcia_socket *skt);
91static int socket_late_resume(struct pcmcia_socket *skt);
101static int socket_resume(struct pcmcia_socket *skt); 92static int socket_resume(struct pcmcia_socket *skt);
102static int socket_suspend(struct pcmcia_socket *skt); 93static int socket_suspend(struct pcmcia_socket *skt);
103 94
104int pcmcia_socket_dev_suspend(struct device *dev) 95static void pcmcia_socket_dev_run(struct device *dev,
96 int (*cb)(struct pcmcia_socket *))
105{ 97{
106 struct pcmcia_socket *socket; 98 struct pcmcia_socket *socket;
107 99
@@ -110,29 +102,34 @@ int pcmcia_socket_dev_suspend(struct device *dev)
110 if (socket->dev.parent != dev) 102 if (socket->dev.parent != dev)
111 continue; 103 continue;
112 mutex_lock(&socket->skt_mutex); 104 mutex_lock(&socket->skt_mutex);
113 socket_suspend(socket); 105 cb(socket);
114 mutex_unlock(&socket->skt_mutex); 106 mutex_unlock(&socket->skt_mutex);
115 } 107 }
116 up_read(&pcmcia_socket_list_rwsem); 108 up_read(&pcmcia_socket_list_rwsem);
109}
117 110
111int pcmcia_socket_dev_suspend(struct device *dev)
112{
113 pcmcia_socket_dev_run(dev, socket_suspend);
118 return 0; 114 return 0;
119} 115}
120EXPORT_SYMBOL(pcmcia_socket_dev_suspend); 116EXPORT_SYMBOL(pcmcia_socket_dev_suspend);
121 117
122int pcmcia_socket_dev_resume(struct device *dev) 118void pcmcia_socket_dev_early_resume(struct device *dev)
123{ 119{
124 struct pcmcia_socket *socket; 120 pcmcia_socket_dev_run(dev, socket_early_resume);
121}
122EXPORT_SYMBOL(pcmcia_socket_dev_early_resume);
125 123
126 down_read(&pcmcia_socket_list_rwsem); 124void pcmcia_socket_dev_late_resume(struct device *dev)
127 list_for_each_entry(socket, &pcmcia_socket_list, socket_list) { 125{
128 if (socket->dev.parent != dev) 126 pcmcia_socket_dev_run(dev, socket_late_resume);
129 continue; 127}
130 mutex_lock(&socket->skt_mutex); 128EXPORT_SYMBOL(pcmcia_socket_dev_late_resume);
131 socket_resume(socket);
132 mutex_unlock(&socket->skt_mutex);
133 }
134 up_read(&pcmcia_socket_list_rwsem);
135 129
130int pcmcia_socket_dev_resume(struct device *dev)
131{
132 pcmcia_socket_dev_run(dev, socket_resume);
136 return 0; 133 return 0;
137} 134}
138EXPORT_SYMBOL(pcmcia_socket_dev_resume); 135EXPORT_SYMBOL(pcmcia_socket_dev_resume);
@@ -182,7 +179,7 @@ int pcmcia_register_socket(struct pcmcia_socket *socket)
182 if (!socket || !socket->ops || !socket->dev.parent || !socket->resource_ops) 179 if (!socket || !socket->ops || !socket->dev.parent || !socket->resource_ops)
183 return -EINVAL; 180 return -EINVAL;
184 181
185 cs_dbg(socket, 0, "pcmcia_register_socket(0x%p)\n", socket->ops); 182 dev_dbg(&socket->dev, "pcmcia_register_socket(0x%p)\n", socket->ops);
186 183
187 spin_lock_init(&socket->lock); 184 spin_lock_init(&socket->lock);
188 185
@@ -254,6 +251,13 @@ int pcmcia_register_socket(struct pcmcia_socket *socket)
254 251
255 pcmcia_parse_events(socket, SS_DETECT); 252 pcmcia_parse_events(socket, SS_DETECT);
256 253
254 /*
255 * Let's try to get the PCMCIA module for 16-bit PCMCIA support.
256 * If it fails, it doesn't matter -- we still have 32-bit CardBus
257 * support to offer, so this is not a failure mode.
258 */
259 request_module_nowait("pcmcia");
260
257 return 0; 261 return 0;
258 262
259 err: 263 err:
@@ -274,7 +278,7 @@ void pcmcia_unregister_socket(struct pcmcia_socket *socket)
274 if (!socket) 278 if (!socket)
275 return; 279 return;
276 280
277 cs_dbg(socket, 0, "pcmcia_unregister_socket(0x%p)\n", socket->ops); 281 dev_dbg(&socket->dev, "pcmcia_unregister_socket(0x%p)\n", socket->ops);
278 282
279 if (socket->thread) 283 if (socket->thread)
280 kthread_stop(socket->thread); 284 kthread_stop(socket->thread);
@@ -327,7 +331,7 @@ static int send_event(struct pcmcia_socket *s, event_t event, int priority)
327 if (s->state & SOCKET_CARDBUS) 331 if (s->state & SOCKET_CARDBUS)
328 return 0; 332 return 0;
329 333
330 cs_dbg(s, 1, "send_event(event %d, pri %d, callback 0x%p)\n", 334 dev_dbg(&s->dev, "send_event(event %d, pri %d, callback 0x%p)\n",
331 event, priority, s->callback); 335 event, priority, s->callback);
332 336
333 if (!s->callback) 337 if (!s->callback)
@@ -344,7 +348,7 @@ static int send_event(struct pcmcia_socket *s, event_t event, int priority)
344 348
345static void socket_remove_drivers(struct pcmcia_socket *skt) 349static void socket_remove_drivers(struct pcmcia_socket *skt)
346{ 350{
347 cs_dbg(skt, 4, "remove_drivers\n"); 351 dev_dbg(&skt->dev, "remove_drivers\n");
348 352
349 send_event(skt, CS_EVENT_CARD_REMOVAL, CS_EVENT_PRI_HIGH); 353 send_event(skt, CS_EVENT_CARD_REMOVAL, CS_EVENT_PRI_HIGH);
350} 354}
@@ -353,7 +357,7 @@ static int socket_reset(struct pcmcia_socket *skt)
353{ 357{
354 int status, i; 358 int status, i;
355 359
356 cs_dbg(skt, 4, "reset\n"); 360 dev_dbg(&skt->dev, "reset\n");
357 361
358 skt->socket.flags |= SS_OUTPUT_ENA | SS_RESET; 362 skt->socket.flags |= SS_OUTPUT_ENA | SS_RESET;
359 skt->ops->set_socket(skt, &skt->socket); 363 skt->ops->set_socket(skt, &skt->socket);
@@ -375,7 +379,7 @@ static int socket_reset(struct pcmcia_socket *skt)
375 msleep(unreset_check * 10); 379 msleep(unreset_check * 10);
376 } 380 }
377 381
378 cs_err(skt, "time out after reset.\n"); 382 dev_printk(KERN_ERR, &skt->dev, "time out after reset.\n");
379 return -ETIMEDOUT; 383 return -ETIMEDOUT;
380} 384}
381 385
@@ -389,7 +393,7 @@ static void socket_shutdown(struct pcmcia_socket *s)
389{ 393{
390 int status; 394 int status;
391 395
392 cs_dbg(s, 4, "shutdown\n"); 396 dev_dbg(&s->dev, "shutdown\n");
393 397
394 socket_remove_drivers(s); 398 socket_remove_drivers(s);
395 s->state &= SOCKET_INUSE | SOCKET_PRESENT; 399 s->state &= SOCKET_INUSE | SOCKET_PRESENT;
@@ -424,7 +428,7 @@ static int socket_setup(struct pcmcia_socket *skt, int initial_delay)
424{ 428{
425 int status, i; 429 int status, i;
426 430
427 cs_dbg(skt, 4, "setup\n"); 431 dev_dbg(&skt->dev, "setup\n");
428 432
429 skt->ops->get_status(skt, &status); 433 skt->ops->get_status(skt, &status);
430 if (!(status & SS_DETECT)) 434 if (!(status & SS_DETECT))
@@ -444,13 +448,15 @@ static int socket_setup(struct pcmcia_socket *skt, int initial_delay)
444 } 448 }
445 449
446 if (status & SS_PENDING) { 450 if (status & SS_PENDING) {
447 cs_err(skt, "voltage interrogation timed out.\n"); 451 dev_printk(KERN_ERR, &skt->dev,
452 "voltage interrogation timed out.\n");
448 return -ETIMEDOUT; 453 return -ETIMEDOUT;
449 } 454 }
450 455
451 if (status & SS_CARDBUS) { 456 if (status & SS_CARDBUS) {
452 if (!(skt->features & SS_CAP_CARDBUS)) { 457 if (!(skt->features & SS_CAP_CARDBUS)) {
453 cs_err(skt, "cardbus cards are not supported.\n"); 458 dev_printk(KERN_ERR, &skt->dev,
459 "cardbus cards are not supported.\n");
454 return -EINVAL; 460 return -EINVAL;
455 } 461 }
456 skt->state |= SOCKET_CARDBUS; 462 skt->state |= SOCKET_CARDBUS;
@@ -464,7 +470,7 @@ static int socket_setup(struct pcmcia_socket *skt, int initial_delay)
464 else if (!(status & SS_XVCARD)) 470 else if (!(status & SS_XVCARD))
465 skt->socket.Vcc = skt->socket.Vpp = 50; 471 skt->socket.Vcc = skt->socket.Vpp = 50;
466 else { 472 else {
467 cs_err(skt, "unsupported voltage key.\n"); 473 dev_printk(KERN_ERR, &skt->dev, "unsupported voltage key.\n");
468 return -EIO; 474 return -EIO;
469 } 475 }
470 476
@@ -481,7 +487,7 @@ static int socket_setup(struct pcmcia_socket *skt, int initial_delay)
481 487
482 skt->ops->get_status(skt, &status); 488 skt->ops->get_status(skt, &status);
483 if (!(status & SS_POWERON)) { 489 if (!(status & SS_POWERON)) {
484 cs_err(skt, "unable to apply power.\n"); 490 dev_printk(KERN_ERR, &skt->dev, "unable to apply power.\n");
485 return -EIO; 491 return -EIO;
486 } 492 }
487 493
@@ -501,7 +507,7 @@ static int socket_insert(struct pcmcia_socket *skt)
501{ 507{
502 int ret; 508 int ret;
503 509
504 cs_dbg(skt, 4, "insert\n"); 510 dev_dbg(&skt->dev, "insert\n");
505 511
506 if (!cs_socket_get(skt)) 512 if (!cs_socket_get(skt))
507 return -ENODEV; 513 return -ENODEV;
@@ -521,7 +527,7 @@ static int socket_insert(struct pcmcia_socket *skt)
521 skt->state |= SOCKET_CARDBUS_CONFIG; 527 skt->state |= SOCKET_CARDBUS_CONFIG;
522 } 528 }
523#endif 529#endif
524 cs_dbg(skt, 4, "insert done\n"); 530 dev_dbg(&skt->dev, "insert done\n");
525 531
526 send_event(skt, CS_EVENT_CARD_INSERTION, CS_EVENT_PRI_LOW); 532 send_event(skt, CS_EVENT_CARD_INSERTION, CS_EVENT_PRI_LOW);
527 } else { 533 } else {
@@ -546,34 +552,29 @@ static int socket_suspend(struct pcmcia_socket *skt)
546 return 0; 552 return 0;
547} 553}
548 554
549/* 555static int socket_early_resume(struct pcmcia_socket *skt)
550 * Resume a socket. If a card is present, verify its CIS against
551 * our cached copy. If they are different, the card has been
552 * replaced, and we need to tell the drivers.
553 */
554static int socket_resume(struct pcmcia_socket *skt)
555{ 556{
556 int ret;
557
558 if (!(skt->state & SOCKET_SUSPEND))
559 return -EBUSY;
560
561 skt->socket = dead_socket; 557 skt->socket = dead_socket;
562 skt->ops->init(skt); 558 skt->ops->init(skt);
563 skt->ops->set_socket(skt, &skt->socket); 559 skt->ops->set_socket(skt, &skt->socket);
560 if (skt->state & SOCKET_PRESENT)
561 skt->resume_status = socket_setup(skt, resume_delay);
562 return 0;
563}
564 564
565static int socket_late_resume(struct pcmcia_socket *skt)
566{
565 if (!(skt->state & SOCKET_PRESENT)) { 567 if (!(skt->state & SOCKET_PRESENT)) {
566 skt->state &= ~SOCKET_SUSPEND; 568 skt->state &= ~SOCKET_SUSPEND;
567 return socket_insert(skt); 569 return socket_insert(skt);
568 } 570 }
569 571
570 ret = socket_setup(skt, resume_delay); 572 if (skt->resume_status == 0) {
571 if (ret == 0) {
572 /* 573 /*
573 * FIXME: need a better check here for cardbus cards. 574 * FIXME: need a better check here for cardbus cards.
574 */ 575 */
575 if (verify_cis_cache(skt) != 0) { 576 if (verify_cis_cache(skt) != 0) {
576 cs_dbg(skt, 4, "cis mismatch - different card\n"); 577 dev_dbg(&skt->dev, "cis mismatch - different card\n");
577 socket_remove_drivers(skt); 578 socket_remove_drivers(skt);
578 destroy_cis_cache(skt); 579 destroy_cis_cache(skt);
579 /* 580 /*
@@ -584,7 +585,7 @@ static int socket_resume(struct pcmcia_socket *skt)
584 msleep(200); 585 msleep(200);
585 send_event(skt, CS_EVENT_CARD_INSERTION, CS_EVENT_PRI_LOW); 586 send_event(skt, CS_EVENT_CARD_INSERTION, CS_EVENT_PRI_LOW);
586 } else { 587 } else {
587 cs_dbg(skt, 4, "cis matches cache\n"); 588 dev_dbg(&skt->dev, "cis matches cache\n");
588 send_event(skt, CS_EVENT_PM_RESUME, CS_EVENT_PRI_LOW); 589 send_event(skt, CS_EVENT_PM_RESUME, CS_EVENT_PRI_LOW);
589 } 590 }
590 } else { 591 } else {
@@ -596,6 +597,20 @@ static int socket_resume(struct pcmcia_socket *skt)
596 return 0; 597 return 0;
597} 598}
598 599
600/*
601 * Resume a socket. If a card is present, verify its CIS against
602 * our cached copy. If they are different, the card has been
603 * replaced, and we need to tell the drivers.
604 */
605static int socket_resume(struct pcmcia_socket *skt)
606{
607 if (!(skt->state & SOCKET_SUSPEND))
608 return -EBUSY;
609
610 socket_early_resume(skt);
611 return socket_late_resume(skt);
612}
613
599static void socket_remove(struct pcmcia_socket *skt) 614static void socket_remove(struct pcmcia_socket *skt)
600{ 615{
601 dev_printk(KERN_NOTICE, &skt->dev, 616 dev_printk(KERN_NOTICE, &skt->dev,
@@ -706,7 +721,7 @@ static int pccardd(void *__skt)
706void pcmcia_parse_events(struct pcmcia_socket *s, u_int events) 721void pcmcia_parse_events(struct pcmcia_socket *s, u_int events)
707{ 722{
708 unsigned long flags; 723 unsigned long flags;
709 cs_dbg(s, 4, "parse_events: events %08x\n", events); 724 dev_dbg(&s->dev, "parse_events: events %08x\n", events);
710 if (s->thread) { 725 if (s->thread) {
711 spin_lock_irqsave(&s->thread_lock, flags); 726 spin_lock_irqsave(&s->thread_lock, flags);
712 s->thread_events |= events; 727 s->thread_events |= events;
@@ -756,19 +771,22 @@ int pcmcia_reset_card(struct pcmcia_socket *skt)
756{ 771{
757 int ret; 772 int ret;
758 773
759 cs_dbg(skt, 1, "resetting socket\n"); 774 dev_dbg(&skt->dev, "resetting socket\n");
760 775
761 mutex_lock(&skt->skt_mutex); 776 mutex_lock(&skt->skt_mutex);
762 do { 777 do {
763 if (!(skt->state & SOCKET_PRESENT)) { 778 if (!(skt->state & SOCKET_PRESENT)) {
779 dev_dbg(&skt->dev, "can't reset, not present\n");
764 ret = -ENODEV; 780 ret = -ENODEV;
765 break; 781 break;
766 } 782 }
767 if (skt->state & SOCKET_SUSPEND) { 783 if (skt->state & SOCKET_SUSPEND) {
784 dev_dbg(&skt->dev, "can't reset, suspended\n");
768 ret = -EBUSY; 785 ret = -EBUSY;
769 break; 786 break;
770 } 787 }
771 if (skt->state & SOCKET_CARDBUS) { 788 if (skt->state & SOCKET_CARDBUS) {
789 dev_dbg(&skt->dev, "can't reset, is cardbus\n");
772 ret = -EPERM; 790 ret = -EPERM;
773 break; 791 break;
774 } 792 }
@@ -801,7 +819,7 @@ int pcmcia_suspend_card(struct pcmcia_socket *skt)
801{ 819{
802 int ret; 820 int ret;
803 821
804 cs_dbg(skt, 1, "suspending socket\n"); 822 dev_dbg(&skt->dev, "suspending socket\n");
805 823
806 mutex_lock(&skt->skt_mutex); 824 mutex_lock(&skt->skt_mutex);
807 do { 825 do {
@@ -831,7 +849,7 @@ int pcmcia_resume_card(struct pcmcia_socket *skt)
831{ 849{
832 int ret; 850 int ret;
833 851
834 cs_dbg(skt, 1, "waking up socket\n"); 852 dev_dbg(&skt->dev, "waking up socket\n");
835 853
836 mutex_lock(&skt->skt_mutex); 854 mutex_lock(&skt->skt_mutex);
837 do { 855 do {
@@ -859,7 +877,7 @@ int pcmcia_eject_card(struct pcmcia_socket *skt)
859{ 877{
860 int ret; 878 int ret;
861 879
862 cs_dbg(skt, 1, "user eject request\n"); 880 dev_dbg(&skt->dev, "user eject request\n");
863 881
864 mutex_lock(&skt->skt_mutex); 882 mutex_lock(&skt->skt_mutex);
865 do { 883 do {
@@ -888,7 +906,7 @@ int pcmcia_insert_card(struct pcmcia_socket *skt)
888{ 906{
889 int ret; 907 int ret;
890 908
891 cs_dbg(skt, 1, "user insert request\n"); 909 dev_dbg(&skt->dev, "user insert request\n");
892 910
893 mutex_lock(&skt->skt_mutex); 911 mutex_lock(&skt->skt_mutex);
894 do { 912 do {
diff --git a/drivers/pcmcia/cs_internal.h b/drivers/pcmcia/cs_internal.h
index 1f4098f1354d..3bc02d53a3a3 100644
--- a/drivers/pcmcia/cs_internal.h
+++ b/drivers/pcmcia/cs_internal.h
@@ -107,28 +107,6 @@ static inline void cs_socket_put(struct pcmcia_socket *skt)
107 } 107 }
108} 108}
109 109
110#ifdef CONFIG_PCMCIA_DEBUG
111extern int cs_debug_level(int);
112
113#define cs_dbg(skt, lvl, fmt, arg...) do { \
114 if (cs_debug_level(lvl)) \
115 dev_printk(KERN_DEBUG, &skt->dev, \
116 "cs: " fmt, ## arg); \
117} while (0)
118#define __cs_dbg(lvl, fmt, arg...) do { \
119 if (cs_debug_level(lvl)) \
120 printk(KERN_DEBUG \
121 "cs: " fmt, ## arg); \
122} while (0)
123
124#else
125#define cs_dbg(skt, lvl, fmt, arg...) do { } while (0)
126#define __cs_dbg(lvl, fmt, arg...) do { } while (0)
127#endif
128
129#define cs_err(skt, fmt, arg...) \
130 dev_printk(KERN_ERR, &skt->dev, "cs: " fmt, ## arg)
131
132 110
133/* 111/*
134 * Stuff internal to module "pcmcia_core": 112 * Stuff internal to module "pcmcia_core":
@@ -170,10 +148,6 @@ extern struct rw_semaphore pcmcia_socket_list_rwsem;
170extern struct list_head pcmcia_socket_list; 148extern struct list_head pcmcia_socket_list;
171extern struct class pcmcia_socket_class; 149extern struct class pcmcia_socket_class;
172 150
173int pcmcia_get_window(struct pcmcia_socket *s,
174 window_handle_t *handle,
175 int idx,
176 win_req_t *req);
177int pccard_register_pcmcia(struct pcmcia_socket *s, struct pcmcia_callback *c); 151int pccard_register_pcmcia(struct pcmcia_socket *s, struct pcmcia_callback *c);
178struct pcmcia_socket *pcmcia_get_socket_by_nr(unsigned int nr); 152struct pcmcia_socket *pcmcia_get_socket_by_nr(unsigned int nr);
179 153
@@ -199,6 +173,22 @@ int pcmcia_replace_cis(struct pcmcia_socket *s,
199 const u8 *data, const size_t len); 173 const u8 *data, const size_t len);
200int pccard_validate_cis(struct pcmcia_socket *s, unsigned int *count); 174int pccard_validate_cis(struct pcmcia_socket *s, unsigned int *count);
201 175
176/* loop over CIS entries */
177int pccard_loop_tuple(struct pcmcia_socket *s, unsigned int function,
178 cisdata_t code, cisparse_t *parse, void *priv_data,
179 int (*loop_tuple) (tuple_t *tuple,
180 cisparse_t *parse,
181 void *priv_data));
182
183int pccard_get_first_tuple(struct pcmcia_socket *s, unsigned int function,
184 tuple_t *tuple);
185
186int pccard_get_next_tuple(struct pcmcia_socket *s, unsigned int function,
187 tuple_t *tuple);
188
189int pccard_get_tuple_data(struct pcmcia_socket *s, tuple_t *tuple);
190
191
202/* rsrc_mgr.c */ 192/* rsrc_mgr.c */
203int pcmcia_validate_mem(struct pcmcia_socket *s); 193int pcmcia_validate_mem(struct pcmcia_socket *s);
204struct resource *pcmcia_find_io_region(unsigned long base, 194struct resource *pcmcia_find_io_region(unsigned long base,
diff --git a/drivers/pcmcia/ds.c b/drivers/pcmcia/ds.c
index f5b7079f13d3..05893d41dd41 100644
--- a/drivers/pcmcia/ds.c
+++ b/drivers/pcmcia/ds.c
@@ -41,129 +41,11 @@ MODULE_AUTHOR("David Hinds <dahinds@users.sourceforge.net>");
41MODULE_DESCRIPTION("PCMCIA Driver Services"); 41MODULE_DESCRIPTION("PCMCIA Driver Services");
42MODULE_LICENSE("GPL"); 42MODULE_LICENSE("GPL");
43 43
44#ifdef CONFIG_PCMCIA_DEBUG
45int ds_pc_debug;
46
47module_param_named(pc_debug, ds_pc_debug, int, 0644);
48
49#define ds_dbg(lvl, fmt, arg...) do { \
50 if (ds_pc_debug > (lvl)) \
51 printk(KERN_DEBUG "ds: " fmt , ## arg); \
52} while (0)
53#define ds_dev_dbg(lvl, dev, fmt, arg...) do { \
54 if (ds_pc_debug > (lvl)) \
55 dev_printk(KERN_DEBUG, dev, "ds: " fmt , ## arg); \
56} while (0)
57#else
58#define ds_dbg(lvl, fmt, arg...) do { } while (0)
59#define ds_dev_dbg(lvl, dev, fmt, arg...) do { } while (0)
60#endif
61 44
62spinlock_t pcmcia_dev_list_lock; 45spinlock_t pcmcia_dev_list_lock;
63 46
64/*====================================================================*/ 47/*====================================================================*/
65 48
66/* code which was in cs.c before */
67
68/* String tables for error messages */
69
70typedef struct lookup_t {
71 const int key;
72 const char *msg;
73} lookup_t;
74
75static const lookup_t error_table[] = {
76 { 0, "Operation succeeded" },
77 { -EIO, "Input/Output error" },
78 { -ENODEV, "No card present" },
79 { -EINVAL, "Bad parameter" },
80 { -EACCES, "Configuration locked" },
81 { -EBUSY, "Resource in use" },
82 { -ENOSPC, "No more items" },
83 { -ENOMEM, "Out of resource" },
84};
85
86
87static const lookup_t service_table[] = {
88 { AccessConfigurationRegister, "AccessConfigurationRegister" },
89 { AddSocketServices, "AddSocketServices" },
90 { AdjustResourceInfo, "AdjustResourceInfo" },
91 { CheckEraseQueue, "CheckEraseQueue" },
92 { CloseMemory, "CloseMemory" },
93 { DeregisterClient, "DeregisterClient" },
94 { DeregisterEraseQueue, "DeregisterEraseQueue" },
95 { GetCardServicesInfo, "GetCardServicesInfo" },
96 { GetClientInfo, "GetClientInfo" },
97 { GetConfigurationInfo, "GetConfigurationInfo" },
98 { GetEventMask, "GetEventMask" },
99 { GetFirstClient, "GetFirstClient" },
100 { GetFirstRegion, "GetFirstRegion" },
101 { GetFirstTuple, "GetFirstTuple" },
102 { GetNextClient, "GetNextClient" },
103 { GetNextRegion, "GetNextRegion" },
104 { GetNextTuple, "GetNextTuple" },
105 { GetStatus, "GetStatus" },
106 { GetTupleData, "GetTupleData" },
107 { MapMemPage, "MapMemPage" },
108 { ModifyConfiguration, "ModifyConfiguration" },
109 { ModifyWindow, "ModifyWindow" },
110 { OpenMemory, "OpenMemory" },
111 { ParseTuple, "ParseTuple" },
112 { ReadMemory, "ReadMemory" },
113 { RegisterClient, "RegisterClient" },
114 { RegisterEraseQueue, "RegisterEraseQueue" },
115 { RegisterMTD, "RegisterMTD" },
116 { ReleaseConfiguration, "ReleaseConfiguration" },
117 { ReleaseIO, "ReleaseIO" },
118 { ReleaseIRQ, "ReleaseIRQ" },
119 { ReleaseWindow, "ReleaseWindow" },
120 { RequestConfiguration, "RequestConfiguration" },
121 { RequestIO, "RequestIO" },
122 { RequestIRQ, "RequestIRQ" },
123 { RequestSocketMask, "RequestSocketMask" },
124 { RequestWindow, "RequestWindow" },
125 { ResetCard, "ResetCard" },
126 { SetEventMask, "SetEventMask" },
127 { ValidateCIS, "ValidateCIS" },
128 { WriteMemory, "WriteMemory" },
129 { BindDevice, "BindDevice" },
130 { BindMTD, "BindMTD" },
131 { ReportError, "ReportError" },
132 { SuspendCard, "SuspendCard" },
133 { ResumeCard, "ResumeCard" },
134 { EjectCard, "EjectCard" },
135 { InsertCard, "InsertCard" },
136 { ReplaceCIS, "ReplaceCIS" }
137};
138
139const char *pcmcia_error_func(int func)
140{
141 int i;
142
143 for (i = 0; i < ARRAY_SIZE(service_table); i++)
144 if (service_table[i].key == func)
145 return service_table[i].msg;
146
147 return "Unknown service number";
148}
149EXPORT_SYMBOL(pcmcia_error_func);
150
151const char *pcmcia_error_ret(int ret)
152{
153 int i;
154
155 for (i = 0; i < ARRAY_SIZE(error_table); i++)
156 if (error_table[i].key == ret)
157 return error_table[i].msg;
158
159 return "unknown";
160}
161EXPORT_SYMBOL(pcmcia_error_ret);
162
163/*======================================================================*/
164
165
166
167static void pcmcia_check_driver(struct pcmcia_driver *p_drv) 49static void pcmcia_check_driver(struct pcmcia_driver *p_drv)
168{ 50{
169 struct pcmcia_device_id *did = p_drv->id_table; 51 struct pcmcia_device_id *did = p_drv->id_table;
@@ -303,7 +185,7 @@ int pcmcia_register_driver(struct pcmcia_driver *driver)
303 spin_lock_init(&driver->dynids.lock); 185 spin_lock_init(&driver->dynids.lock);
304 INIT_LIST_HEAD(&driver->dynids.list); 186 INIT_LIST_HEAD(&driver->dynids.list);
305 187
306 ds_dbg(3, "registering driver %s\n", driver->drv.name); 188 pr_debug("registering driver %s\n", driver->drv.name);
307 189
308 error = driver_register(&driver->drv); 190 error = driver_register(&driver->drv);
309 if (error < 0) 191 if (error < 0)
@@ -323,7 +205,7 @@ EXPORT_SYMBOL(pcmcia_register_driver);
323 */ 205 */
324void pcmcia_unregister_driver(struct pcmcia_driver *driver) 206void pcmcia_unregister_driver(struct pcmcia_driver *driver)
325{ 207{
326 ds_dbg(3, "unregistering driver %s\n", driver->drv.name); 208 pr_debug("unregistering driver %s\n", driver->drv.name);
327 driver_unregister(&driver->drv); 209 driver_unregister(&driver->drv);
328 pcmcia_free_dynids(driver); 210 pcmcia_free_dynids(driver);
329} 211}
@@ -350,14 +232,14 @@ void pcmcia_put_dev(struct pcmcia_device *p_dev)
350static void pcmcia_release_function(struct kref *ref) 232static void pcmcia_release_function(struct kref *ref)
351{ 233{
352 struct config_t *c = container_of(ref, struct config_t, ref); 234 struct config_t *c = container_of(ref, struct config_t, ref);
353 ds_dbg(1, "releasing config_t\n"); 235 pr_debug("releasing config_t\n");
354 kfree(c); 236 kfree(c);
355} 237}
356 238
357static void pcmcia_release_dev(struct device *dev) 239static void pcmcia_release_dev(struct device *dev)
358{ 240{
359 struct pcmcia_device *p_dev = to_pcmcia_dev(dev); 241 struct pcmcia_device *p_dev = to_pcmcia_dev(dev);
360 ds_dev_dbg(1, dev, "releasing device\n"); 242 dev_dbg(dev, "releasing device\n");
361 pcmcia_put_socket(p_dev->socket); 243 pcmcia_put_socket(p_dev->socket);
362 kfree(p_dev->devname); 244 kfree(p_dev->devname);
363 kref_put(&p_dev->function_config->ref, pcmcia_release_function); 245 kref_put(&p_dev->function_config->ref, pcmcia_release_function);
@@ -367,7 +249,7 @@ static void pcmcia_release_dev(struct device *dev)
367static void pcmcia_add_device_later(struct pcmcia_socket *s, int mfc) 249static void pcmcia_add_device_later(struct pcmcia_socket *s, int mfc)
368{ 250{
369 if (!s->pcmcia_state.device_add_pending) { 251 if (!s->pcmcia_state.device_add_pending) {
370 ds_dev_dbg(1, &s->dev, "scheduling to add %s secondary" 252 dev_dbg(&s->dev, "scheduling to add %s secondary"
371 " device to %d\n", mfc ? "mfc" : "pfc", s->sock); 253 " device to %d\n", mfc ? "mfc" : "pfc", s->sock);
372 s->pcmcia_state.device_add_pending = 1; 254 s->pcmcia_state.device_add_pending = 1;
373 s->pcmcia_state.mfc_pfc = mfc; 255 s->pcmcia_state.mfc_pfc = mfc;
@@ -405,7 +287,7 @@ static int pcmcia_device_probe(struct device * dev)
405 */ 287 */
406 did = dev_get_drvdata(&p_dev->dev); 288 did = dev_get_drvdata(&p_dev->dev);
407 289
408 ds_dev_dbg(1, dev, "trying to bind to %s\n", p_drv->drv.name); 290 dev_dbg(dev, "trying to bind to %s\n", p_drv->drv.name);
409 291
410 if ((!p_drv->probe) || (!p_dev->function_config) || 292 if ((!p_drv->probe) || (!p_dev->function_config) ||
411 (!try_module_get(p_drv->owner))) { 293 (!try_module_get(p_drv->owner))) {
@@ -428,7 +310,7 @@ static int pcmcia_device_probe(struct device * dev)
428 310
429 ret = p_drv->probe(p_dev); 311 ret = p_drv->probe(p_dev);
430 if (ret) { 312 if (ret) {
431 ds_dev_dbg(1, dev, "binding to %s failed with %d\n", 313 dev_dbg(dev, "binding to %s failed with %d\n",
432 p_drv->drv.name, ret); 314 p_drv->drv.name, ret);
433 goto put_module; 315 goto put_module;
434 } 316 }
@@ -456,7 +338,7 @@ static void pcmcia_card_remove(struct pcmcia_socket *s, struct pcmcia_device *le
456 struct pcmcia_device *tmp; 338 struct pcmcia_device *tmp;
457 unsigned long flags; 339 unsigned long flags;
458 340
459 ds_dev_dbg(2, leftover ? &leftover->dev : &s->dev, 341 dev_dbg(leftover ? &leftover->dev : &s->dev,
460 "pcmcia_card_remove(%d) %s\n", s->sock, 342 "pcmcia_card_remove(%d) %s\n", s->sock,
461 leftover ? leftover->devname : ""); 343 leftover ? leftover->devname : "");
462 344
@@ -475,7 +357,7 @@ static void pcmcia_card_remove(struct pcmcia_socket *s, struct pcmcia_device *le
475 p_dev->_removed=1; 357 p_dev->_removed=1;
476 spin_unlock_irqrestore(&pcmcia_dev_list_lock, flags); 358 spin_unlock_irqrestore(&pcmcia_dev_list_lock, flags);
477 359
478 ds_dev_dbg(2, &p_dev->dev, "unregistering device\n"); 360 dev_dbg(&p_dev->dev, "unregistering device\n");
479 device_unregister(&p_dev->dev); 361 device_unregister(&p_dev->dev);
480 } 362 }
481 363
@@ -492,7 +374,7 @@ static int pcmcia_device_remove(struct device * dev)
492 p_dev = to_pcmcia_dev(dev); 374 p_dev = to_pcmcia_dev(dev);
493 p_drv = to_pcmcia_drv(dev->driver); 375 p_drv = to_pcmcia_drv(dev->driver);
494 376
495 ds_dev_dbg(1, dev, "removing device\n"); 377 dev_dbg(dev, "removing device\n");
496 378
497 /* If we're removing the primary module driving a 379 /* If we're removing the primary module driving a
498 * pseudo multi-function card, we need to unbind 380 * pseudo multi-function card, we need to unbind
@@ -572,7 +454,7 @@ static int pcmcia_device_query(struct pcmcia_device *p_dev)
572 } 454 }
573 if (!pccard_read_tuple(p_dev->socket, p_dev->func, 455 if (!pccard_read_tuple(p_dev->socket, p_dev->func,
574 CISTPL_DEVICE_GEO, devgeo)) { 456 CISTPL_DEVICE_GEO, devgeo)) {
575 ds_dev_dbg(0, &p_dev->dev, 457 dev_dbg(&p_dev->dev,
576 "mem device geometry probably means " 458 "mem device geometry probably means "
577 "FUNCID_MEMORY\n"); 459 "FUNCID_MEMORY\n");
578 p_dev->func_id = CISTPL_FUNCID_MEMORY; 460 p_dev->func_id = CISTPL_FUNCID_MEMORY;
@@ -628,7 +510,7 @@ struct pcmcia_device * pcmcia_device_add(struct pcmcia_socket *s, unsigned int f
628 510
629 mutex_lock(&device_add_lock); 511 mutex_lock(&device_add_lock);
630 512
631 ds_dbg(3, "adding device to %d, function %d\n", s->sock, function); 513 pr_debug("adding device to %d, function %d\n", s->sock, function);
632 514
633 /* max of 4 devices per card */ 515 /* max of 4 devices per card */
634 if (s->device_count == 4) 516 if (s->device_count == 4)
@@ -654,7 +536,7 @@ struct pcmcia_device * pcmcia_device_add(struct pcmcia_socket *s, unsigned int f
654 p_dev->devname = kasprintf(GFP_KERNEL, "pcmcia%s", dev_name(&p_dev->dev)); 536 p_dev->devname = kasprintf(GFP_KERNEL, "pcmcia%s", dev_name(&p_dev->dev));
655 if (!p_dev->devname) 537 if (!p_dev->devname)
656 goto err_free; 538 goto err_free;
657 ds_dev_dbg(3, &p_dev->dev, "devname is %s\n", p_dev->devname); 539 dev_dbg(&p_dev->dev, "devname is %s\n", p_dev->devname);
658 540
659 spin_lock_irqsave(&pcmcia_dev_list_lock, flags); 541 spin_lock_irqsave(&pcmcia_dev_list_lock, flags);
660 542
@@ -677,7 +559,7 @@ struct pcmcia_device * pcmcia_device_add(struct pcmcia_socket *s, unsigned int f
677 spin_unlock_irqrestore(&pcmcia_dev_list_lock, flags); 559 spin_unlock_irqrestore(&pcmcia_dev_list_lock, flags);
678 560
679 if (!p_dev->function_config) { 561 if (!p_dev->function_config) {
680 ds_dev_dbg(3, &p_dev->dev, "creating config_t\n"); 562 dev_dbg(&p_dev->dev, "creating config_t\n");
681 p_dev->function_config = kzalloc(sizeof(struct config_t), 563 p_dev->function_config = kzalloc(sizeof(struct config_t),
682 GFP_KERNEL); 564 GFP_KERNEL);
683 if (!p_dev->function_config) 565 if (!p_dev->function_config)
@@ -722,20 +604,20 @@ static int pcmcia_card_add(struct pcmcia_socket *s)
722 int ret = 0; 604 int ret = 0;
723 605
724 if (!(s->resource_setup_done)) { 606 if (!(s->resource_setup_done)) {
725 ds_dev_dbg(3, &s->dev, 607 dev_dbg(&s->dev,
726 "no resources available, delaying card_add\n"); 608 "no resources available, delaying card_add\n");
727 return -EAGAIN; /* try again, but later... */ 609 return -EAGAIN; /* try again, but later... */
728 } 610 }
729 611
730 if (pcmcia_validate_mem(s)) { 612 if (pcmcia_validate_mem(s)) {
731 ds_dev_dbg(3, &s->dev, "validating mem resources failed, " 613 dev_dbg(&s->dev, "validating mem resources failed, "
732 "delaying card_add\n"); 614 "delaying card_add\n");
733 return -EAGAIN; /* try again, but later... */ 615 return -EAGAIN; /* try again, but later... */
734 } 616 }
735 617
736 ret = pccard_validate_cis(s, &no_chains); 618 ret = pccard_validate_cis(s, &no_chains);
737 if (ret || !no_chains) { 619 if (ret || !no_chains) {
738 ds_dev_dbg(0, &s->dev, "invalid CIS or invalid resources\n"); 620 dev_dbg(&s->dev, "invalid CIS or invalid resources\n");
739 return -ENODEV; 621 return -ENODEV;
740 } 622 }
741 623
@@ -756,7 +638,7 @@ static void pcmcia_delayed_add_device(struct work_struct *work)
756{ 638{
757 struct pcmcia_socket *s = 639 struct pcmcia_socket *s =
758 container_of(work, struct pcmcia_socket, device_add); 640 container_of(work, struct pcmcia_socket, device_add);
759 ds_dev_dbg(1, &s->dev, "adding additional device to %d\n", s->sock); 641 dev_dbg(&s->dev, "adding additional device to %d\n", s->sock);
760 pcmcia_device_add(s, s->pcmcia_state.mfc_pfc); 642 pcmcia_device_add(s, s->pcmcia_state.mfc_pfc);
761 s->pcmcia_state.device_add_pending = 0; 643 s->pcmcia_state.device_add_pending = 0;
762 s->pcmcia_state.mfc_pfc = 0; 644 s->pcmcia_state.mfc_pfc = 0;
@@ -766,7 +648,7 @@ static int pcmcia_requery(struct device *dev, void * _data)
766{ 648{
767 struct pcmcia_device *p_dev = to_pcmcia_dev(dev); 649 struct pcmcia_device *p_dev = to_pcmcia_dev(dev);
768 if (!p_dev->dev.driver) { 650 if (!p_dev->dev.driver) {
769 ds_dev_dbg(1, dev, "update device information\n"); 651 dev_dbg(dev, "update device information\n");
770 pcmcia_device_query(p_dev); 652 pcmcia_device_query(p_dev);
771 } 653 }
772 654
@@ -780,7 +662,7 @@ static void pcmcia_bus_rescan(struct pcmcia_socket *skt, int new_cis)
780 unsigned long flags; 662 unsigned long flags;
781 663
782 /* must be called with skt_mutex held */ 664 /* must be called with skt_mutex held */
783 ds_dev_dbg(0, &skt->dev, "re-scanning socket %d\n", skt->sock); 665 dev_dbg(&skt->dev, "re-scanning socket %d\n", skt->sock);
784 666
785 spin_lock_irqsave(&pcmcia_dev_list_lock, flags); 667 spin_lock_irqsave(&pcmcia_dev_list_lock, flags);
786 if (list_empty(&skt->devices_list)) 668 if (list_empty(&skt->devices_list))
@@ -835,7 +717,7 @@ static int pcmcia_load_firmware(struct pcmcia_device *dev, char * filename)
835 if (!filename) 717 if (!filename)
836 return -EINVAL; 718 return -EINVAL;
837 719
838 ds_dev_dbg(1, &dev->dev, "trying to load CIS file %s\n", filename); 720 dev_dbg(&dev->dev, "trying to load CIS file %s\n", filename);
839 721
840 if (request_firmware(&fw, filename, &dev->dev) == 0) { 722 if (request_firmware(&fw, filename, &dev->dev) == 0) {
841 if (fw->size >= CISTPL_MAX_CIS_SIZE) { 723 if (fw->size >= CISTPL_MAX_CIS_SIZE) {
@@ -953,14 +835,14 @@ static inline int pcmcia_devmatch(struct pcmcia_device *dev,
953 * after it has re-checked that there is no possible module 835 * after it has re-checked that there is no possible module
954 * with a prod_id/manf_id/card_id match. 836 * with a prod_id/manf_id/card_id match.
955 */ 837 */
956 ds_dev_dbg(0, &dev->dev, 838 dev_dbg(&dev->dev,
957 "skipping FUNC_ID match until userspace interaction\n"); 839 "skipping FUNC_ID match until userspace interaction\n");
958 if (!dev->allow_func_id_match) 840 if (!dev->allow_func_id_match)
959 return 0; 841 return 0;
960 } 842 }
961 843
962 if (did->match_flags & PCMCIA_DEV_ID_MATCH_FAKE_CIS) { 844 if (did->match_flags & PCMCIA_DEV_ID_MATCH_FAKE_CIS) {
963 ds_dev_dbg(0, &dev->dev, "device needs a fake CIS\n"); 845 dev_dbg(&dev->dev, "device needs a fake CIS\n");
964 if (!dev->socket->fake_cis) 846 if (!dev->socket->fake_cis)
965 pcmcia_load_firmware(dev, did->cisfile); 847 pcmcia_load_firmware(dev, did->cisfile);
966 848
@@ -992,9 +874,9 @@ static int pcmcia_bus_match(struct device * dev, struct device_driver * drv) {
992 /* match dynamic devices first */ 874 /* match dynamic devices first */
993 spin_lock(&p_drv->dynids.lock); 875 spin_lock(&p_drv->dynids.lock);
994 list_for_each_entry(dynid, &p_drv->dynids.list, node) { 876 list_for_each_entry(dynid, &p_drv->dynids.list, node) {
995 ds_dev_dbg(3, dev, "trying to match to %s\n", drv->name); 877 dev_dbg(dev, "trying to match to %s\n", drv->name);
996 if (pcmcia_devmatch(p_dev, &dynid->id)) { 878 if (pcmcia_devmatch(p_dev, &dynid->id)) {
997 ds_dev_dbg(0, dev, "matched to %s\n", drv->name); 879 dev_dbg(dev, "matched to %s\n", drv->name);
998 spin_unlock(&p_drv->dynids.lock); 880 spin_unlock(&p_drv->dynids.lock);
999 return 1; 881 return 1;
1000 } 882 }
@@ -1004,15 +886,15 @@ static int pcmcia_bus_match(struct device * dev, struct device_driver * drv) {
1004#ifdef CONFIG_PCMCIA_IOCTL 886#ifdef CONFIG_PCMCIA_IOCTL
1005 /* matching by cardmgr */ 887 /* matching by cardmgr */
1006 if (p_dev->cardmgr == p_drv) { 888 if (p_dev->cardmgr == p_drv) {
1007 ds_dev_dbg(0, dev, "cardmgr matched to %s\n", drv->name); 889 dev_dbg(dev, "cardmgr matched to %s\n", drv->name);
1008 return 1; 890 return 1;
1009 } 891 }
1010#endif 892#endif
1011 893
1012 while (did && did->match_flags) { 894 while (did && did->match_flags) {
1013 ds_dev_dbg(3, dev, "trying to match to %s\n", drv->name); 895 dev_dbg(dev, "trying to match to %s\n", drv->name);
1014 if (pcmcia_devmatch(p_dev, did)) { 896 if (pcmcia_devmatch(p_dev, did)) {
1015 ds_dev_dbg(0, dev, "matched to %s\n", drv->name); 897 dev_dbg(dev, "matched to %s\n", drv->name);
1016 return 1; 898 return 1;
1017 } 899 }
1018 did++; 900 did++;
@@ -1218,7 +1100,7 @@ static int pcmcia_dev_suspend(struct device * dev, pm_message_t state)
1218 if (p_dev->suspended) 1100 if (p_dev->suspended)
1219 return 0; 1101 return 0;
1220 1102
1221 ds_dev_dbg(2, dev, "suspending\n"); 1103 dev_dbg(dev, "suspending\n");
1222 1104
1223 if (dev->driver) 1105 if (dev->driver)
1224 p_drv = to_pcmcia_drv(dev->driver); 1106 p_drv = to_pcmcia_drv(dev->driver);
@@ -1238,7 +1120,7 @@ static int pcmcia_dev_suspend(struct device * dev, pm_message_t state)
1238 } 1120 }
1239 1121
1240 if (p_dev->device_no == p_dev->func) { 1122 if (p_dev->device_no == p_dev->func) {
1241 ds_dev_dbg(2, dev, "releasing configuration\n"); 1123 dev_dbg(dev, "releasing configuration\n");
1242 pcmcia_release_configuration(p_dev); 1124 pcmcia_release_configuration(p_dev);
1243 } 1125 }
1244 1126
@@ -1258,7 +1140,7 @@ static int pcmcia_dev_resume(struct device * dev)
1258 if (!p_dev->suspended) 1140 if (!p_dev->suspended)
1259 return 0; 1141 return 0;
1260 1142
1261 ds_dev_dbg(2, dev, "resuming\n"); 1143 dev_dbg(dev, "resuming\n");
1262 1144
1263 if (dev->driver) 1145 if (dev->driver)
1264 p_drv = to_pcmcia_drv(dev->driver); 1146 p_drv = to_pcmcia_drv(dev->driver);
@@ -1267,7 +1149,7 @@ static int pcmcia_dev_resume(struct device * dev)
1267 goto out; 1149 goto out;
1268 1150
1269 if (p_dev->device_no == p_dev->func) { 1151 if (p_dev->device_no == p_dev->func) {
1270 ds_dev_dbg(2, dev, "requesting configuration\n"); 1152 dev_dbg(dev, "requesting configuration\n");
1271 ret = pcmcia_request_configuration(p_dev, &p_dev->conf); 1153 ret = pcmcia_request_configuration(p_dev, &p_dev->conf);
1272 if (ret) 1154 if (ret)
1273 goto out; 1155 goto out;
@@ -1309,14 +1191,14 @@ static int pcmcia_bus_resume_callback(struct device *dev, void * _data)
1309 1191
1310static int pcmcia_bus_resume(struct pcmcia_socket *skt) 1192static int pcmcia_bus_resume(struct pcmcia_socket *skt)
1311{ 1193{
1312 ds_dev_dbg(2, &skt->dev, "resuming socket %d\n", skt->sock); 1194 dev_dbg(&skt->dev, "resuming socket %d\n", skt->sock);
1313 bus_for_each_dev(&pcmcia_bus_type, NULL, skt, pcmcia_bus_resume_callback); 1195 bus_for_each_dev(&pcmcia_bus_type, NULL, skt, pcmcia_bus_resume_callback);
1314 return 0; 1196 return 0;
1315} 1197}
1316 1198
1317static int pcmcia_bus_suspend(struct pcmcia_socket *skt) 1199static int pcmcia_bus_suspend(struct pcmcia_socket *skt)
1318{ 1200{
1319 ds_dev_dbg(2, &skt->dev, "suspending socket %d\n", skt->sock); 1201 dev_dbg(&skt->dev, "suspending socket %d\n", skt->sock);
1320 if (bus_for_each_dev(&pcmcia_bus_type, NULL, skt, 1202 if (bus_for_each_dev(&pcmcia_bus_type, NULL, skt,
1321 pcmcia_bus_suspend_callback)) { 1203 pcmcia_bus_suspend_callback)) {
1322 pcmcia_bus_resume(skt); 1204 pcmcia_bus_resume(skt);
@@ -1348,7 +1230,7 @@ static int ds_event(struct pcmcia_socket *skt, event_t event, int priority)
1348 return -ENODEV; 1230 return -ENODEV;
1349 } 1231 }
1350 1232
1351 ds_dev_dbg(1, &skt->dev, "ds_event(0x%06x, %d, 0x%p)\n", 1233 dev_dbg(&skt->dev, "ds_event(0x%06x, %d, 0x%p)\n",
1352 event, priority, skt); 1234 event, priority, skt);
1353 1235
1354 switch (event) { 1236 switch (event) {
diff --git a/drivers/pcmcia/i82365.c b/drivers/pcmcia/i82365.c
index a4aacb830b80..c13fd9360511 100644
--- a/drivers/pcmcia/i82365.c
+++ b/drivers/pcmcia/i82365.c
@@ -63,21 +63,6 @@
63#include "vg468.h" 63#include "vg468.h"
64#include "ricoh.h" 64#include "ricoh.h"
65 65
66#ifdef CONFIG_PCMCIA_DEBUG
67static const char version[] =
68"i82365.c 1.265 1999/11/10 18:36:21 (David Hinds)";
69
70static int pc_debug;
71
72module_param(pc_debug, int, 0644);
73
74#define debug(lvl, fmt, arg...) do { \
75 if (pc_debug > (lvl)) \
76 printk(KERN_DEBUG "i82365: " fmt , ## arg); \
77} while (0)
78#else
79#define debug(lvl, fmt, arg...) do { } while (0)
80#endif
81 66
82static irqreturn_t i365_count_irq(int, void *); 67static irqreturn_t i365_count_irq(int, void *);
83static inline int _check_irq(int irq, int flags) 68static inline int _check_irq(int irq, int flags)
@@ -501,13 +486,13 @@ static irqreturn_t i365_count_irq(int irq, void *dev)
501{ 486{
502 i365_get(irq_sock, I365_CSC); 487 i365_get(irq_sock, I365_CSC);
503 irq_hits++; 488 irq_hits++;
504 debug(2, "-> hit on irq %d\n", irq); 489 pr_debug("i82365: -> hit on irq %d\n", irq);
505 return IRQ_HANDLED; 490 return IRQ_HANDLED;
506} 491}
507 492
508static u_int __init test_irq(u_short sock, int irq) 493static u_int __init test_irq(u_short sock, int irq)
509{ 494{
510 debug(2, " testing ISA irq %d\n", irq); 495 pr_debug("i82365: testing ISA irq %d\n", irq);
511 if (request_irq(irq, i365_count_irq, IRQF_PROBE_SHARED, "scan", 496 if (request_irq(irq, i365_count_irq, IRQF_PROBE_SHARED, "scan",
512 i365_count_irq) != 0) 497 i365_count_irq) != 0)
513 return 1; 498 return 1;
@@ -515,7 +500,7 @@ static u_int __init test_irq(u_short sock, int irq)
515 msleep(10); 500 msleep(10);
516 if (irq_hits) { 501 if (irq_hits) {
517 free_irq(irq, i365_count_irq); 502 free_irq(irq, i365_count_irq);
518 debug(2, " spurious hit!\n"); 503 pr_debug("i82365: spurious hit!\n");
519 return 1; 504 return 1;
520 } 505 }
521 506
@@ -528,7 +513,7 @@ static u_int __init test_irq(u_short sock, int irq)
528 513
529 /* mask all interrupts */ 514 /* mask all interrupts */
530 i365_set(sock, I365_CSCINT, 0); 515 i365_set(sock, I365_CSCINT, 0);
531 debug(2, " hits = %d\n", irq_hits); 516 pr_debug("i82365: hits = %d\n", irq_hits);
532 517
533 return (irq_hits != 1); 518 return (irq_hits != 1);
534} 519}
@@ -854,7 +839,7 @@ static irqreturn_t pcic_interrupt(int irq, void *dev)
854 u_long flags = 0; 839 u_long flags = 0;
855 int handled = 0; 840 int handled = 0;
856 841
857 debug(4, "pcic_interrupt(%d)\n", irq); 842 pr_debug("pcic_interrupt(%d)\n", irq);
858 843
859 for (j = 0; j < 20; j++) { 844 for (j = 0; j < 20; j++) {
860 active = 0; 845 active = 0;
@@ -878,7 +863,7 @@ static irqreturn_t pcic_interrupt(int irq, void *dev)
878 events |= (csc & I365_CSC_READY) ? SS_READY : 0; 863 events |= (csc & I365_CSC_READY) ? SS_READY : 0;
879 } 864 }
880 ISA_UNLOCK(i, flags); 865 ISA_UNLOCK(i, flags);
881 debug(2, "socket %d event 0x%02x\n", i, events); 866 pr_debug("socket %d event 0x%02x\n", i, events);
882 867
883 if (events) 868 if (events)
884 pcmcia_parse_events(&socket[i].socket, events); 869 pcmcia_parse_events(&socket[i].socket, events);
@@ -890,7 +875,7 @@ static irqreturn_t pcic_interrupt(int irq, void *dev)
890 if (j == 20) 875 if (j == 20)
891 printk(KERN_NOTICE "i82365: infinite loop in interrupt handler\n"); 876 printk(KERN_NOTICE "i82365: infinite loop in interrupt handler\n");
892 877
893 debug(4, "interrupt done\n"); 878 pr_debug("pcic_interrupt done\n");
894 return IRQ_RETVAL(handled); 879 return IRQ_RETVAL(handled);
895} /* pcic_interrupt */ 880} /* pcic_interrupt */
896 881
@@ -932,7 +917,7 @@ static int i365_get_status(u_short sock, u_int *value)
932 } 917 }
933 } 918 }
934 919
935 debug(1, "GetStatus(%d) = %#4.4x\n", sock, *value); 920 pr_debug("GetStatus(%d) = %#4.4x\n", sock, *value);
936 return 0; 921 return 0;
937} /* i365_get_status */ 922} /* i365_get_status */
938 923
@@ -943,7 +928,7 @@ static int i365_set_socket(u_short sock, socket_state_t *state)
943 struct i82365_socket *t = &socket[sock]; 928 struct i82365_socket *t = &socket[sock];
944 u_char reg; 929 u_char reg;
945 930
946 debug(1, "SetSocket(%d, flags %#3.3x, Vcc %d, Vpp %d, " 931 pr_debug("SetSocket(%d, flags %#3.3x, Vcc %d, Vpp %d, "
947 "io_irq %d, csc_mask %#2.2x)\n", sock, state->flags, 932 "io_irq %d, csc_mask %#2.2x)\n", sock, state->flags,
948 state->Vcc, state->Vpp, state->io_irq, state->csc_mask); 933 state->Vcc, state->Vpp, state->io_irq, state->csc_mask);
949 934
@@ -1052,7 +1037,7 @@ static int i365_set_io_map(u_short sock, struct pccard_io_map *io)
1052{ 1037{
1053 u_char map, ioctl; 1038 u_char map, ioctl;
1054 1039
1055 debug(1, "SetIOMap(%d, %d, %#2.2x, %d ns, " 1040 pr_debug("SetIOMap(%d, %d, %#2.2x, %d ns, "
1056 "%#llx-%#llx)\n", sock, io->map, io->flags, io->speed, 1041 "%#llx-%#llx)\n", sock, io->map, io->flags, io->speed,
1057 (unsigned long long)io->start, (unsigned long long)io->stop); 1042 (unsigned long long)io->start, (unsigned long long)io->stop);
1058 map = io->map; 1043 map = io->map;
@@ -1082,7 +1067,7 @@ static int i365_set_mem_map(u_short sock, struct pccard_mem_map *mem)
1082 u_short base, i; 1067 u_short base, i;
1083 u_char map; 1068 u_char map;
1084 1069
1085 debug(1, "SetMemMap(%d, %d, %#2.2x, %d ns, %#llx-%#llx, " 1070 pr_debug("SetMemMap(%d, %d, %#2.2x, %d ns, %#llx-%#llx, "
1086 "%#x)\n", sock, mem->map, mem->flags, mem->speed, 1071 "%#x)\n", sock, mem->map, mem->flags, mem->speed,
1087 (unsigned long long)mem->res->start, 1072 (unsigned long long)mem->res->start,
1088 (unsigned long long)mem->res->end, mem->card_start); 1073 (unsigned long long)mem->res->end, mem->card_start);
diff --git a/drivers/pcmcia/m32r_cfc.c b/drivers/pcmcia/m32r_cfc.c
index 7dfbee1dcd76..26a621c9e2fc 100644
--- a/drivers/pcmcia/m32r_cfc.c
+++ b/drivers/pcmcia/m32r_cfc.c
@@ -38,17 +38,6 @@
38 38
39#include "m32r_cfc.h" 39#include "m32r_cfc.h"
40 40
41#ifdef CONFIG_PCMCIA_DEBUG
42static int m32r_cfc_debug;
43module_param(m32r_cfc_debug, int, 0644);
44#define debug(lvl, fmt, arg...) do { \
45 if (m32r_cfc_debug > (lvl)) \
46 printk(KERN_DEBUG "m32r_cfc: " fmt , ## arg); \
47} while (0)
48#else
49#define debug(n, args...) do { } while (0)
50#endif
51
52/* Poll status interval -- 0 means default to interrupt */ 41/* Poll status interval -- 0 means default to interrupt */
53static int poll_interval = 0; 42static int poll_interval = 0;
54 43
@@ -123,7 +112,7 @@ void pcc_ioread_byte(int sock, unsigned long port, void *buf, size_t size,
123 unsigned char *bp = (unsigned char *)buf; 112 unsigned char *bp = (unsigned char *)buf;
124 unsigned long flags; 113 unsigned long flags;
125 114
126 debug(3, "m32r_cfc: pcc_ioread_byte: sock=%d, port=%#lx, buf=%p, " 115 pr_debug("m32r_cfc: pcc_ioread_byte: sock=%d, port=%#lx, buf=%p, "
127 "size=%u, nmemb=%d, flag=%d\n", 116 "size=%u, nmemb=%d, flag=%d\n",
128 sock, port, buf, size, nmemb, flag); 117 sock, port, buf, size, nmemb, flag);
129 118
@@ -132,7 +121,7 @@ void pcc_ioread_byte(int sock, unsigned long port, void *buf, size_t size,
132 printk("m32r_cfc:ioread_byte null port :%#lx\n",port); 121 printk("m32r_cfc:ioread_byte null port :%#lx\n",port);
133 return; 122 return;
134 } 123 }
135 debug(3, "m32r_cfc: pcc_ioread_byte: addr=%#lx\n", addr); 124 pr_debug("m32r_cfc: pcc_ioread_byte: addr=%#lx\n", addr);
136 125
137 spin_lock_irqsave(&pcc_lock, flags); 126 spin_lock_irqsave(&pcc_lock, flags);
138 /* read Byte */ 127 /* read Byte */
@@ -148,7 +137,7 @@ void pcc_ioread_word(int sock, unsigned long port, void *buf, size_t size,
148 unsigned short *bp = (unsigned short *)buf; 137 unsigned short *bp = (unsigned short *)buf;
149 unsigned long flags; 138 unsigned long flags;
150 139
151 debug(3, "m32r_cfc: pcc_ioread_word: sock=%d, port=%#lx, " 140 pr_debug("m32r_cfc: pcc_ioread_word: sock=%d, port=%#lx, "
152 "buf=%p, size=%u, nmemb=%d, flag=%d\n", 141 "buf=%p, size=%u, nmemb=%d, flag=%d\n",
153 sock, port, buf, size, nmemb, flag); 142 sock, port, buf, size, nmemb, flag);
154 143
@@ -163,7 +152,7 @@ void pcc_ioread_word(int sock, unsigned long port, void *buf, size_t size,
163 printk("m32r_cfc:ioread_word null port :%#lx\n",port); 152 printk("m32r_cfc:ioread_word null port :%#lx\n",port);
164 return; 153 return;
165 } 154 }
166 debug(3, "m32r_cfc: pcc_ioread_word: addr=%#lx\n", addr); 155 pr_debug("m32r_cfc: pcc_ioread_word: addr=%#lx\n", addr);
167 156
168 spin_lock_irqsave(&pcc_lock, flags); 157 spin_lock_irqsave(&pcc_lock, flags);
169 /* read Word */ 158 /* read Word */
@@ -179,7 +168,7 @@ void pcc_iowrite_byte(int sock, unsigned long port, void *buf, size_t size,
179 unsigned char *bp = (unsigned char *)buf; 168 unsigned char *bp = (unsigned char *)buf;
180 unsigned long flags; 169 unsigned long flags;
181 170
182 debug(3, "m32r_cfc: pcc_iowrite_byte: sock=%d, port=%#lx, " 171 pr_debug("m32r_cfc: pcc_iowrite_byte: sock=%d, port=%#lx, "
183 "buf=%p, size=%u, nmemb=%d, flag=%d\n", 172 "buf=%p, size=%u, nmemb=%d, flag=%d\n",
184 sock, port, buf, size, nmemb, flag); 173 sock, port, buf, size, nmemb, flag);
185 174
@@ -189,7 +178,7 @@ void pcc_iowrite_byte(int sock, unsigned long port, void *buf, size_t size,
189 printk("m32r_cfc:iowrite_byte null port:%#lx\n",port); 178 printk("m32r_cfc:iowrite_byte null port:%#lx\n",port);
190 return; 179 return;
191 } 180 }
192 debug(3, "m32r_cfc: pcc_iowrite_byte: addr=%#lx\n", addr); 181 pr_debug("m32r_cfc: pcc_iowrite_byte: addr=%#lx\n", addr);
193 182
194 spin_lock_irqsave(&pcc_lock, flags); 183 spin_lock_irqsave(&pcc_lock, flags);
195 while (nmemb--) 184 while (nmemb--)
@@ -204,7 +193,7 @@ void pcc_iowrite_word(int sock, unsigned long port, void *buf, size_t size,
204 unsigned short *bp = (unsigned short *)buf; 193 unsigned short *bp = (unsigned short *)buf;
205 unsigned long flags; 194 unsigned long flags;
206 195
207 debug(3, "m32r_cfc: pcc_iowrite_word: sock=%d, port=%#lx, " 196 pr_debug("m32r_cfc: pcc_iowrite_word: sock=%d, port=%#lx, "
208 "buf=%p, size=%u, nmemb=%d, flag=%d\n", 197 "buf=%p, size=%u, nmemb=%d, flag=%d\n",
209 sock, port, buf, size, nmemb, flag); 198 sock, port, buf, size, nmemb, flag);
210 199
@@ -226,7 +215,7 @@ void pcc_iowrite_word(int sock, unsigned long port, void *buf, size_t size,
226 return; 215 return;
227 } 216 }
228#endif 217#endif
229 debug(3, "m32r_cfc: pcc_iowrite_word: addr=%#lx\n", addr); 218 pr_debug("m32r_cfc: pcc_iowrite_word: addr=%#lx\n", addr);
230 219
231 spin_lock_irqsave(&pcc_lock, flags); 220 spin_lock_irqsave(&pcc_lock, flags);
232 while (nmemb--) 221 while (nmemb--)
@@ -262,7 +251,7 @@ static struct timer_list poll_timer;
262static unsigned int pcc_get(u_short sock, unsigned int reg) 251static unsigned int pcc_get(u_short sock, unsigned int reg)
263{ 252{
264 unsigned int val = inw(reg); 253 unsigned int val = inw(reg);
265 debug(3, "m32r_cfc: pcc_get: reg(0x%08x)=0x%04x\n", reg, val); 254 pr_debug("m32r_cfc: pcc_get: reg(0x%08x)=0x%04x\n", reg, val);
266 return val; 255 return val;
267} 256}
268 257
@@ -270,7 +259,7 @@ static unsigned int pcc_get(u_short sock, unsigned int reg)
270static void pcc_set(u_short sock, unsigned int reg, unsigned int data) 259static void pcc_set(u_short sock, unsigned int reg, unsigned int data)
271{ 260{
272 outw(data, reg); 261 outw(data, reg);
273 debug(3, "m32r_cfc: pcc_set: reg(0x%08x)=0x%04x\n", reg, data); 262 pr_debug("m32r_cfc: pcc_set: reg(0x%08x)=0x%04x\n", reg, data);
274} 263}
275 264
276/*====================================================================== 265/*======================================================================
@@ -286,14 +275,14 @@ static int __init is_alive(u_short sock)
286{ 275{
287 unsigned int stat; 276 unsigned int stat;
288 277
289 debug(3, "m32r_cfc: is_alive:\n"); 278 pr_debug("m32r_cfc: is_alive:\n");
290 279
291 printk("CF: "); 280 printk("CF: ");
292 stat = pcc_get(sock, (unsigned int)PLD_CFSTS); 281 stat = pcc_get(sock, (unsigned int)PLD_CFSTS);
293 if (!stat) 282 if (!stat)
294 printk("No "); 283 printk("No ");
295 printk("Card is detected at socket %d : stat = 0x%08x\n", sock, stat); 284 printk("Card is detected at socket %d : stat = 0x%08x\n", sock, stat);
296 debug(3, "m32r_cfc: is_alive: sock stat is 0x%04x\n", stat); 285 pr_debug("m32r_cfc: is_alive: sock stat is 0x%04x\n", stat);
297 286
298 return 0; 287 return 0;
299} 288}
@@ -303,7 +292,7 @@ static void add_pcc_socket(ulong base, int irq, ulong mapaddr,
303{ 292{
304 pcc_socket_t *t = &socket[pcc_sockets]; 293 pcc_socket_t *t = &socket[pcc_sockets];
305 294
306 debug(3, "m32r_cfc: add_pcc_socket: base=%#lx, irq=%d, " 295 pr_debug("m32r_cfc: add_pcc_socket: base=%#lx, irq=%d, "
307 "mapaddr=%#lx, ioaddr=%08x\n", 296 "mapaddr=%#lx, ioaddr=%08x\n",
308 base, irq, mapaddr, ioaddr); 297 base, irq, mapaddr, ioaddr);
309 298
@@ -358,7 +347,7 @@ static void add_pcc_socket(ulong base, int irq, ulong mapaddr,
358 /* eject interrupt */ 347 /* eject interrupt */
359 request_irq(irq+1, pcc_interrupt, 0, "m32r_cfc", pcc_interrupt); 348 request_irq(irq+1, pcc_interrupt, 0, "m32r_cfc", pcc_interrupt);
360#endif 349#endif
361 debug(3, "m32r_cfc: enable CFMSK, RDYSEL\n"); 350 pr_debug("m32r_cfc: enable CFMSK, RDYSEL\n");
362 pcc_set(pcc_sockets, (unsigned int)PLD_CFIMASK, 0x01); 351 pcc_set(pcc_sockets, (unsigned int)PLD_CFIMASK, 0x01);
363#endif /* CONFIG_PLAT_USRV */ 352#endif /* CONFIG_PLAT_USRV */
364#if defined(CONFIG_PLAT_M32700UT) || defined(CONFIG_PLAT_USRV) || defined(CONFIG_PLAT_OPSPUT) 353#if defined(CONFIG_PLAT_M32700UT) || defined(CONFIG_PLAT_USRV) || defined(CONFIG_PLAT_OPSPUT)
@@ -378,26 +367,26 @@ static irqreturn_t pcc_interrupt(int irq, void *dev)
378 u_int events = 0; 367 u_int events = 0;
379 int handled = 0; 368 int handled = 0;
380 369
381 debug(3, "m32r_cfc: pcc_interrupt: irq=%d, dev=%p\n", irq, dev); 370 pr_debug("m32r_cfc: pcc_interrupt: irq=%d, dev=%p\n", irq, dev);
382 for (i = 0; i < pcc_sockets; i++) { 371 for (i = 0; i < pcc_sockets; i++) {
383 if (socket[i].cs_irq1 != irq && socket[i].cs_irq2 != irq) 372 if (socket[i].cs_irq1 != irq && socket[i].cs_irq2 != irq)
384 continue; 373 continue;
385 374
386 handled = 1; 375 handled = 1;
387 debug(3, "m32r_cfc: pcc_interrupt: socket %d irq 0x%02x ", 376 pr_debug("m32r_cfc: pcc_interrupt: socket %d irq 0x%02x ",
388 i, irq); 377 i, irq);
389 events |= SS_DETECT; /* insert or eject */ 378 events |= SS_DETECT; /* insert or eject */
390 if (events) 379 if (events)
391 pcmcia_parse_events(&socket[i].socket, events); 380 pcmcia_parse_events(&socket[i].socket, events);
392 } 381 }
393 debug(3, "m32r_cfc: pcc_interrupt: done\n"); 382 pr_debug("m32r_cfc: pcc_interrupt: done\n");
394 383
395 return IRQ_RETVAL(handled); 384 return IRQ_RETVAL(handled);
396} /* pcc_interrupt */ 385} /* pcc_interrupt */
397 386
398static void pcc_interrupt_wrapper(u_long data) 387static void pcc_interrupt_wrapper(u_long data)
399{ 388{
400 debug(3, "m32r_cfc: pcc_interrupt_wrapper:\n"); 389 pr_debug("m32r_cfc: pcc_interrupt_wrapper:\n");
401 pcc_interrupt(0, NULL); 390 pcc_interrupt(0, NULL);
402 init_timer(&poll_timer); 391 init_timer(&poll_timer);
403 poll_timer.expires = jiffies + poll_interval; 392 poll_timer.expires = jiffies + poll_interval;
@@ -410,17 +399,17 @@ static int _pcc_get_status(u_short sock, u_int *value)
410{ 399{
411 u_int status; 400 u_int status;
412 401
413 debug(3, "m32r_cfc: _pcc_get_status:\n"); 402 pr_debug("m32r_cfc: _pcc_get_status:\n");
414 status = pcc_get(sock, (unsigned int)PLD_CFSTS); 403 status = pcc_get(sock, (unsigned int)PLD_CFSTS);
415 *value = (status) ? SS_DETECT : 0; 404 *value = (status) ? SS_DETECT : 0;
416 debug(3, "m32r_cfc: _pcc_get_status: status=0x%08x\n", status); 405 pr_debug("m32r_cfc: _pcc_get_status: status=0x%08x\n", status);
417 406
418#if defined(CONFIG_PLAT_M32700UT) || defined(CONFIG_PLAT_USRV) || defined(CONFIG_PLAT_OPSPUT) 407#if defined(CONFIG_PLAT_M32700UT) || defined(CONFIG_PLAT_USRV) || defined(CONFIG_PLAT_OPSPUT)
419 if ( status ) { 408 if ( status ) {
420 /* enable CF power */ 409 /* enable CF power */
421 status = inw((unsigned int)PLD_CPCR); 410 status = inw((unsigned int)PLD_CPCR);
422 if (!(status & PLD_CPCR_CF)) { 411 if (!(status & PLD_CPCR_CF)) {
423 debug(3, "m32r_cfc: _pcc_get_status: " 412 pr_debug("m32r_cfc: _pcc_get_status: "
424 "power on (CPCR=0x%08x)\n", status); 413 "power on (CPCR=0x%08x)\n", status);
425 status |= PLD_CPCR_CF; 414 status |= PLD_CPCR_CF;
426 outw(status, (unsigned int)PLD_CPCR); 415 outw(status, (unsigned int)PLD_CPCR);
@@ -439,7 +428,7 @@ static int _pcc_get_status(u_short sock, u_int *value)
439 status &= ~PLD_CPCR_CF; 428 status &= ~PLD_CPCR_CF;
440 outw(status, (unsigned int)PLD_CPCR); 429 outw(status, (unsigned int)PLD_CPCR);
441 udelay(100); 430 udelay(100);
442 debug(3, "m32r_cfc: _pcc_get_status: " 431 pr_debug("m32r_cfc: _pcc_get_status: "
443 "power off (CPCR=0x%08x)\n", status); 432 "power off (CPCR=0x%08x)\n", status);
444 } 433 }
445#elif defined(CONFIG_PLAT_MAPPI2) || defined(CONFIG_PLAT_MAPPI3) 434#elif defined(CONFIG_PLAT_MAPPI2) || defined(CONFIG_PLAT_MAPPI3)
@@ -465,13 +454,13 @@ static int _pcc_get_status(u_short sock, u_int *value)
465 /* disable CF power */ 454 /* disable CF power */
466 pcc_set(sock, (unsigned int)PLD_CPCR, 0); 455 pcc_set(sock, (unsigned int)PLD_CPCR, 0);
467 udelay(100); 456 udelay(100);
468 debug(3, "m32r_cfc: _pcc_get_status: " 457 pr_debug("m32r_cfc: _pcc_get_status: "
469 "power off (CPCR=0x%08x)\n", status); 458 "power off (CPCR=0x%08x)\n", status);
470 } 459 }
471#else 460#else
472#error no platform configuration 461#error no platform configuration
473#endif 462#endif
474 debug(3, "m32r_cfc: _pcc_get_status: GetStatus(%d) = %#4.4x\n", 463 pr_debug("m32r_cfc: _pcc_get_status: GetStatus(%d) = %#4.4x\n",
475 sock, *value); 464 sock, *value);
476 return 0; 465 return 0;
477} /* _get_status */ 466} /* _get_status */
@@ -480,7 +469,7 @@ static int _pcc_get_status(u_short sock, u_int *value)
480 469
481static int _pcc_set_socket(u_short sock, socket_state_t *state) 470static int _pcc_set_socket(u_short sock, socket_state_t *state)
482{ 471{
483 debug(3, "m32r_cfc: SetSocket(%d, flags %#3.3x, Vcc %d, Vpp %d, " 472 pr_debug("m32r_cfc: SetSocket(%d, flags %#3.3x, Vcc %d, Vpp %d, "
484 "io_irq %d, csc_mask %#2.2x)\n", sock, state->flags, 473 "io_irq %d, csc_mask %#2.2x)\n", sock, state->flags,
485 state->Vcc, state->Vpp, state->io_irq, state->csc_mask); 474 state->Vcc, state->Vpp, state->io_irq, state->csc_mask);
486 475
@@ -492,41 +481,39 @@ static int _pcc_set_socket(u_short sock, socket_state_t *state)
492 } 481 }
493#endif 482#endif
494 if (state->flags & SS_RESET) { 483 if (state->flags & SS_RESET) {
495 debug(3, ":RESET\n"); 484 pr_debug(":RESET\n");
496 pcc_set(sock,(unsigned int)PLD_CFRSTCR,0x101); 485 pcc_set(sock,(unsigned int)PLD_CFRSTCR,0x101);
497 }else{ 486 }else{
498 pcc_set(sock,(unsigned int)PLD_CFRSTCR,0x100); 487 pcc_set(sock,(unsigned int)PLD_CFRSTCR,0x100);
499 } 488 }
500 if (state->flags & SS_OUTPUT_ENA){ 489 if (state->flags & SS_OUTPUT_ENA){
501 debug(3, ":OUTPUT_ENA\n"); 490 pr_debug(":OUTPUT_ENA\n");
502 /* bit clear */ 491 /* bit clear */
503 pcc_set(sock,(unsigned int)PLD_CFBUFCR,0); 492 pcc_set(sock,(unsigned int)PLD_CFBUFCR,0);
504 } else { 493 } else {
505 pcc_set(sock,(unsigned int)PLD_CFBUFCR,1); 494 pcc_set(sock,(unsigned int)PLD_CFBUFCR,1);
506 } 495 }
507 496
508#ifdef CONFIG_PCMCIA_DEBUG
509 if(state->flags & SS_IOCARD){ 497 if(state->flags & SS_IOCARD){
510 debug(3, ":IOCARD"); 498 pr_debug(":IOCARD");
511 } 499 }
512 if (state->flags & SS_PWR_AUTO) { 500 if (state->flags & SS_PWR_AUTO) {
513 debug(3, ":PWR_AUTO"); 501 pr_debug(":PWR_AUTO");
514 } 502 }
515 if (state->csc_mask & SS_DETECT) 503 if (state->csc_mask & SS_DETECT)
516 debug(3, ":csc-SS_DETECT"); 504 pr_debug(":csc-SS_DETECT");
517 if (state->flags & SS_IOCARD) { 505 if (state->flags & SS_IOCARD) {
518 if (state->csc_mask & SS_STSCHG) 506 if (state->csc_mask & SS_STSCHG)
519 debug(3, ":STSCHG"); 507 pr_debug(":STSCHG");
520 } else { 508 } else {
521 if (state->csc_mask & SS_BATDEAD) 509 if (state->csc_mask & SS_BATDEAD)
522 debug(3, ":BATDEAD"); 510 pr_debug(":BATDEAD");
523 if (state->csc_mask & SS_BATWARN) 511 if (state->csc_mask & SS_BATWARN)
524 debug(3, ":BATWARN"); 512 pr_debug(":BATWARN");
525 if (state->csc_mask & SS_READY) 513 if (state->csc_mask & SS_READY)
526 debug(3, ":READY"); 514 pr_debug(":READY");
527 } 515 }
528 debug(3, "\n"); 516 pr_debug("\n");
529#endif
530 return 0; 517 return 0;
531} /* _set_socket */ 518} /* _set_socket */
532 519
@@ -536,7 +523,7 @@ static int _pcc_set_io_map(u_short sock, struct pccard_io_map *io)
536{ 523{
537 u_char map; 524 u_char map;
538 525
539 debug(3, "m32r_cfc: SetIOMap(%d, %d, %#2.2x, %d ns, " 526 pr_debug("m32r_cfc: SetIOMap(%d, %d, %#2.2x, %d ns, "
540 "%#llx-%#llx)\n", sock, io->map, io->flags, 527 "%#llx-%#llx)\n", sock, io->map, io->flags,
541 io->speed, (unsigned long long)io->start, 528 io->speed, (unsigned long long)io->start,
542 (unsigned long long)io->stop); 529 (unsigned long long)io->stop);
@@ -554,7 +541,7 @@ static int _pcc_set_mem_map(u_short sock, struct pccard_mem_map *mem)
554 u_long addr; 541 u_long addr;
555 pcc_socket_t *t = &socket[sock]; 542 pcc_socket_t *t = &socket[sock];
556 543
557 debug(3, "m32r_cfc: SetMemMap(%d, %d, %#2.2x, %d ns, " 544 pr_debug("m32r_cfc: SetMemMap(%d, %d, %#2.2x, %d ns, "
558 "%#llx, %#x)\n", sock, map, mem->flags, 545 "%#llx, %#x)\n", sock, map, mem->flags,
559 mem->speed, (unsigned long long)mem->static_start, 546 mem->speed, (unsigned long long)mem->static_start,
560 mem->card_start); 547 mem->card_start);
@@ -640,11 +627,11 @@ static int pcc_get_status(struct pcmcia_socket *s, u_int *value)
640 unsigned int sock = container_of(s, struct pcc_socket, socket)->number; 627 unsigned int sock = container_of(s, struct pcc_socket, socket)->number;
641 628
642 if (socket[sock].flags & IS_ALIVE) { 629 if (socket[sock].flags & IS_ALIVE) {
643 debug(3, "m32r_cfc: pcc_get_status: sock(%d) -EINVAL\n", sock); 630 dev_dbg(&s->dev, "pcc_get_status: sock(%d) -EINVAL\n", sock);
644 *value = 0; 631 *value = 0;
645 return -EINVAL; 632 return -EINVAL;
646 } 633 }
647 debug(3, "m32r_cfc: pcc_get_status: sock(%d)\n", sock); 634 dev_dbg(&s->dev, "pcc_get_status: sock(%d)\n", sock);
648 LOCKED(_pcc_get_status(sock, value)); 635 LOCKED(_pcc_get_status(sock, value));
649} 636}
650 637
@@ -653,10 +640,10 @@ static int pcc_set_socket(struct pcmcia_socket *s, socket_state_t *state)
653 unsigned int sock = container_of(s, struct pcc_socket, socket)->number; 640 unsigned int sock = container_of(s, struct pcc_socket, socket)->number;
654 641
655 if (socket[sock].flags & IS_ALIVE) { 642 if (socket[sock].flags & IS_ALIVE) {
656 debug(3, "m32r_cfc: pcc_set_socket: sock(%d) -EINVAL\n", sock); 643 dev_dbg(&s->dev, "pcc_set_socket: sock(%d) -EINVAL\n", sock);
657 return -EINVAL; 644 return -EINVAL;
658 } 645 }
659 debug(3, "m32r_cfc: pcc_set_socket: sock(%d)\n", sock); 646 dev_dbg(&s->dev, "pcc_set_socket: sock(%d)\n", sock);
660 LOCKED(_pcc_set_socket(sock, state)); 647 LOCKED(_pcc_set_socket(sock, state));
661} 648}
662 649
@@ -665,10 +652,10 @@ static int pcc_set_io_map(struct pcmcia_socket *s, struct pccard_io_map *io)
665 unsigned int sock = container_of(s, struct pcc_socket, socket)->number; 652 unsigned int sock = container_of(s, struct pcc_socket, socket)->number;
666 653
667 if (socket[sock].flags & IS_ALIVE) { 654 if (socket[sock].flags & IS_ALIVE) {
668 debug(3, "m32r_cfc: pcc_set_io_map: sock(%d) -EINVAL\n", sock); 655 dev_dbg(&s->dev, "pcc_set_io_map: sock(%d) -EINVAL\n", sock);
669 return -EINVAL; 656 return -EINVAL;
670 } 657 }
671 debug(3, "m32r_cfc: pcc_set_io_map: sock(%d)\n", sock); 658 dev_dbg(&s->dev, "pcc_set_io_map: sock(%d)\n", sock);
672 LOCKED(_pcc_set_io_map(sock, io)); 659 LOCKED(_pcc_set_io_map(sock, io));
673} 660}
674 661
@@ -677,16 +664,16 @@ static int pcc_set_mem_map(struct pcmcia_socket *s, struct pccard_mem_map *mem)
677 unsigned int sock = container_of(s, struct pcc_socket, socket)->number; 664 unsigned int sock = container_of(s, struct pcc_socket, socket)->number;
678 665
679 if (socket[sock].flags & IS_ALIVE) { 666 if (socket[sock].flags & IS_ALIVE) {
680 debug(3, "m32r_cfc: pcc_set_mem_map: sock(%d) -EINVAL\n", sock); 667 dev_dbg(&s->dev, "pcc_set_mem_map: sock(%d) -EINVAL\n", sock);
681 return -EINVAL; 668 return -EINVAL;
682 } 669 }
683 debug(3, "m32r_cfc: pcc_set_mem_map: sock(%d)\n", sock); 670 dev_dbg(&s->dev, "pcc_set_mem_map: sock(%d)\n", sock);
684 LOCKED(_pcc_set_mem_map(sock, mem)); 671 LOCKED(_pcc_set_mem_map(sock, mem));
685} 672}
686 673
687static int pcc_init(struct pcmcia_socket *s) 674static int pcc_init(struct pcmcia_socket *s)
688{ 675{
689 debug(3, "m32r_cfc: pcc_init()\n"); 676 dev_dbg(&s->dev, "pcc_init()\n");
690 return 0; 677 return 0;
691} 678}
692 679
diff --git a/drivers/pcmcia/m32r_pcc.c b/drivers/pcmcia/m32r_pcc.c
index c6524f99ccc3..72844c5a6d05 100644
--- a/drivers/pcmcia/m32r_pcc.c
+++ b/drivers/pcmcia/m32r_pcc.c
@@ -45,16 +45,6 @@
45 45
46#define PCC_DEBUG_DBEX 46#define PCC_DEBUG_DBEX
47 47
48#ifdef CONFIG_PCMCIA_DEBUG
49static int m32r_pcc_debug;
50module_param(m32r_pcc_debug, int, 0644);
51#define debug(lvl, fmt, arg...) do { \
52 if (m32r_pcc_debug > (lvl)) \
53 printk(KERN_DEBUG "m32r_pcc: " fmt , ## arg); \
54} while (0)
55#else
56#define debug(n, args...) do { } while (0)
57#endif
58 48
59/* Poll status interval -- 0 means default to interrupt */ 49/* Poll status interval -- 0 means default to interrupt */
60static int poll_interval = 0; 50static int poll_interval = 0;
@@ -358,7 +348,7 @@ static irqreturn_t pcc_interrupt(int irq, void *dev)
358 u_int events, active; 348 u_int events, active;
359 int handled = 0; 349 int handled = 0;
360 350
361 debug(4, "m32r: pcc_interrupt(%d)\n", irq); 351 pr_debug("m32r_pcc: pcc_interrupt(%d)\n", irq);
362 352
363 for (j = 0; j < 20; j++) { 353 for (j = 0; j < 20; j++) {
364 active = 0; 354 active = 0;
@@ -369,13 +359,14 @@ static irqreturn_t pcc_interrupt(int irq, void *dev)
369 handled = 1; 359 handled = 1;
370 irc = pcc_get(i, PCIRC); 360 irc = pcc_get(i, PCIRC);
371 irc >>=16; 361 irc >>=16;
372 debug(2, "m32r-pcc:interrupt: socket %d pcirc 0x%02x ", i, irc); 362 pr_debug("m32r_pcc: interrupt: socket %d pcirc 0x%02x ",
363 i, irc);
373 if (!irc) 364 if (!irc)
374 continue; 365 continue;
375 366
376 events = (irc) ? SS_DETECT : 0; 367 events = (irc) ? SS_DETECT : 0;
377 events |= (pcc_get(i,PCCR) & PCCR_PCEN) ? SS_READY : 0; 368 events |= (pcc_get(i,PCCR) & PCCR_PCEN) ? SS_READY : 0;
378 debug(2, " event 0x%02x\n", events); 369 pr_debug("m32r_pcc: event 0x%02x\n", events);
379 370
380 if (events) 371 if (events)
381 pcmcia_parse_events(&socket[i].socket, events); 372 pcmcia_parse_events(&socket[i].socket, events);
@@ -388,7 +379,7 @@ static irqreturn_t pcc_interrupt(int irq, void *dev)
388 if (j == 20) 379 if (j == 20)
389 printk(KERN_NOTICE "m32r-pcc: infinite loop in interrupt handler\n"); 380 printk(KERN_NOTICE "m32r-pcc: infinite loop in interrupt handler\n");
390 381
391 debug(4, "m32r-pcc: interrupt done\n"); 382 pr_debug("m32r_pcc: interrupt done\n");
392 383
393 return IRQ_RETVAL(handled); 384 return IRQ_RETVAL(handled);
394} /* pcc_interrupt */ 385} /* pcc_interrupt */
@@ -422,7 +413,7 @@ static int _pcc_get_status(u_short sock, u_int *value)
422 status = pcc_get(sock,PCCSIGCR); 413 status = pcc_get(sock,PCCSIGCR);
423 *value |= (status & PCCSIGCR_VEN) ? SS_POWERON : 0; 414 *value |= (status & PCCSIGCR_VEN) ? SS_POWERON : 0;
424 415
425 debug(3, "m32r-pcc: GetStatus(%d) = %#4.4x\n", sock, *value); 416 pr_debug("m32r_pcc: GetStatus(%d) = %#4.4x\n", sock, *value);
426 return 0; 417 return 0;
427} /* _get_status */ 418} /* _get_status */
428 419
@@ -432,7 +423,7 @@ static int _pcc_set_socket(u_short sock, socket_state_t *state)
432{ 423{
433 u_long reg = 0; 424 u_long reg = 0;
434 425
435 debug(3, "m32r-pcc: SetSocket(%d, flags %#3.3x, Vcc %d, Vpp %d, " 426 pr_debug("m32r_pcc: SetSocket(%d, flags %#3.3x, Vcc %d, Vpp %d, "
436 "io_irq %d, csc_mask %#2.2x)", sock, state->flags, 427 "io_irq %d, csc_mask %#2.2x)", sock, state->flags,
437 state->Vcc, state->Vpp, state->io_irq, state->csc_mask); 428 state->Vcc, state->Vpp, state->io_irq, state->csc_mask);
438 429
@@ -448,11 +439,11 @@ static int _pcc_set_socket(u_short sock, socket_state_t *state)
448 } 439 }
449 440
450 if (state->flags & SS_RESET) { 441 if (state->flags & SS_RESET) {
451 debug(3, ":RESET\n"); 442 pr_debug("m32r_pcc: :RESET\n");
452 reg |= PCCSIGCR_CRST; 443 reg |= PCCSIGCR_CRST;
453 } 444 }
454 if (state->flags & SS_OUTPUT_ENA){ 445 if (state->flags & SS_OUTPUT_ENA){
455 debug(3, ":OUTPUT_ENA\n"); 446 pr_debug("m32r_pcc: :OUTPUT_ENA\n");
456 /* bit clear */ 447 /* bit clear */
457 } else { 448 } else {
458 reg |= PCCSIGCR_SEN; 449 reg |= PCCSIGCR_SEN;
@@ -460,28 +451,26 @@ static int _pcc_set_socket(u_short sock, socket_state_t *state)
460 451
461 pcc_set(sock,PCCSIGCR,reg); 452 pcc_set(sock,PCCSIGCR,reg);
462 453
463#ifdef CONFIG_PCMCIA_DEBUG
464 if(state->flags & SS_IOCARD){ 454 if(state->flags & SS_IOCARD){
465 debug(3, ":IOCARD"); 455 pr_debug("m32r_pcc: :IOCARD");
466 } 456 }
467 if (state->flags & SS_PWR_AUTO) { 457 if (state->flags & SS_PWR_AUTO) {
468 debug(3, ":PWR_AUTO"); 458 pr_debug("m32r_pcc: :PWR_AUTO");
469 } 459 }
470 if (state->csc_mask & SS_DETECT) 460 if (state->csc_mask & SS_DETECT)
471 debug(3, ":csc-SS_DETECT"); 461 pr_debug("m32r_pcc: :csc-SS_DETECT");
472 if (state->flags & SS_IOCARD) { 462 if (state->flags & SS_IOCARD) {
473 if (state->csc_mask & SS_STSCHG) 463 if (state->csc_mask & SS_STSCHG)
474 debug(3, ":STSCHG"); 464 pr_debug("m32r_pcc: :STSCHG");
475 } else { 465 } else {
476 if (state->csc_mask & SS_BATDEAD) 466 if (state->csc_mask & SS_BATDEAD)
477 debug(3, ":BATDEAD"); 467 pr_debug("m32r_pcc: :BATDEAD");
478 if (state->csc_mask & SS_BATWARN) 468 if (state->csc_mask & SS_BATWARN)
479 debug(3, ":BATWARN"); 469 pr_debug("m32r_pcc: :BATWARN");
480 if (state->csc_mask & SS_READY) 470 if (state->csc_mask & SS_READY)
481 debug(3, ":READY"); 471 pr_debug("m32r_pcc: :READY");
482 } 472 }
483 debug(3, "\n"); 473 pr_debug("m32r_pcc: \n");
484#endif
485 return 0; 474 return 0;
486} /* _set_socket */ 475} /* _set_socket */
487 476
@@ -491,7 +480,7 @@ static int _pcc_set_io_map(u_short sock, struct pccard_io_map *io)
491{ 480{
492 u_char map; 481 u_char map;
493 482
494 debug(3, "m32r-pcc: SetIOMap(%d, %d, %#2.2x, %d ns, " 483 pr_debug("m32r_pcc: SetIOMap(%d, %d, %#2.2x, %d ns, "
495 "%#llx-%#llx)\n", sock, io->map, io->flags, 484 "%#llx-%#llx)\n", sock, io->map, io->flags,
496 io->speed, (unsigned long long)io->start, 485 io->speed, (unsigned long long)io->start,
497 (unsigned long long)io->stop); 486 (unsigned long long)io->stop);
@@ -515,7 +504,7 @@ static int _pcc_set_mem_map(u_short sock, struct pccard_mem_map *mem)
515#endif 504#endif
516#endif 505#endif
517 506
518 debug(3, "m32r-pcc: SetMemMap(%d, %d, %#2.2x, %d ns, " 507 pr_debug("m32r_pcc: SetMemMap(%d, %d, %#2.2x, %d ns, "
519 "%#llx, %#x)\n", sock, map, mem->flags, 508 "%#llx, %#x)\n", sock, map, mem->flags,
520 mem->speed, (unsigned long long)mem->static_start, 509 mem->speed, (unsigned long long)mem->static_start,
521 mem->card_start); 510 mem->card_start);
@@ -662,7 +651,7 @@ static int pcc_set_mem_map(struct pcmcia_socket *s, struct pccard_mem_map *mem)
662 651
663static int pcc_init(struct pcmcia_socket *s) 652static int pcc_init(struct pcmcia_socket *s)
664{ 653{
665 debug(4, "m32r-pcc: init call\n"); 654 pr_debug("m32r_pcc: init call\n");
666 return 0; 655 return 0;
667} 656}
668 657
diff --git a/drivers/pcmcia/m8xx_pcmcia.c b/drivers/pcmcia/m8xx_pcmcia.c
index 403559ba49dd..7f79c4e169ae 100644
--- a/drivers/pcmcia/m8xx_pcmcia.c
+++ b/drivers/pcmcia/m8xx_pcmcia.c
@@ -64,14 +64,6 @@
64#include <pcmcia/cs.h> 64#include <pcmcia/cs.h>
65#include <pcmcia/ss.h> 65#include <pcmcia/ss.h>
66 66
67#ifdef CONFIG_PCMCIA_DEBUG
68static int pc_debug;
69module_param(pc_debug, int, 0);
70#define dprintk(args...) printk(KERN_DEBUG "m8xx_pcmcia: " args);
71#else
72#define dprintk(args...)
73#endif
74
75#define pcmcia_info(args...) printk(KERN_INFO "m8xx_pcmcia: "args) 67#define pcmcia_info(args...) printk(KERN_INFO "m8xx_pcmcia: "args)
76#define pcmcia_error(args...) printk(KERN_ERR "m8xx_pcmcia: "args) 68#define pcmcia_error(args...) printk(KERN_ERR "m8xx_pcmcia: "args)
77 69
@@ -565,7 +557,7 @@ static irqreturn_t m8xx_interrupt(int irq, void *dev)
565 unsigned int i, events, pscr, pipr, per; 557 unsigned int i, events, pscr, pipr, per;
566 pcmconf8xx_t *pcmcia = socket[0].pcmcia; 558 pcmconf8xx_t *pcmcia = socket[0].pcmcia;
567 559
568 dprintk("Interrupt!\n"); 560 pr_debug("m8xx_pcmcia: Interrupt!\n");
569 /* get interrupt sources */ 561 /* get interrupt sources */
570 562
571 pscr = in_be32(&pcmcia->pcmc_pscr); 563 pscr = in_be32(&pcmcia->pcmc_pscr);
@@ -614,7 +606,7 @@ static irqreturn_t m8xx_interrupt(int irq, void *dev)
614 606
615 /* call the handler */ 607 /* call the handler */
616 608
617 dprintk("slot %u: events = 0x%02x, pscr = 0x%08x, " 609 pr_debug("m8xx_pcmcia: slot %u: events = 0x%02x, pscr = 0x%08x, "
618 "pipr = 0x%08x\n", i, events, pscr, pipr); 610 "pipr = 0x%08x\n", i, events, pscr, pipr);
619 611
620 if (events) { 612 if (events) {
@@ -641,7 +633,7 @@ static irqreturn_t m8xx_interrupt(int irq, void *dev)
641 /* clear the interrupt sources */ 633 /* clear the interrupt sources */
642 out_be32(&pcmcia->pcmc_pscr, pscr); 634 out_be32(&pcmcia->pcmc_pscr, pscr);
643 635
644 dprintk("Interrupt done.\n"); 636 pr_debug("m8xx_pcmcia: Interrupt done.\n");
645 637
646 return IRQ_HANDLED; 638 return IRQ_HANDLED;
647} 639}
@@ -815,7 +807,7 @@ static int m8xx_get_status(struct pcmcia_socket *sock, unsigned int *value)
815 }; 807 };
816 } 808 }
817 809
818 dprintk("GetStatus(%d) = %#2.2x\n", lsock, *value); 810 pr_debug("m8xx_pcmcia: GetStatus(%d) = %#2.2x\n", lsock, *value);
819 return 0; 811 return 0;
820} 812}
821 813
@@ -828,7 +820,7 @@ static int m8xx_set_socket(struct pcmcia_socket *sock, socket_state_t * state)
828 unsigned long flags; 820 unsigned long flags;
829 pcmconf8xx_t *pcmcia = socket[0].pcmcia; 821 pcmconf8xx_t *pcmcia = socket[0].pcmcia;
830 822
831 dprintk("SetSocket(%d, flags %#3.3x, Vcc %d, Vpp %d, " 823 pr_debug("m8xx_pcmcia: SetSocket(%d, flags %#3.3x, Vcc %d, Vpp %d, "
832 "io_irq %d, csc_mask %#2.2x)\n", lsock, state->flags, 824 "io_irq %d, csc_mask %#2.2x)\n", lsock, state->flags,
833 state->Vcc, state->Vpp, state->io_irq, state->csc_mask); 825 state->Vcc, state->Vpp, state->io_irq, state->csc_mask);
834 826
@@ -974,7 +966,7 @@ static int m8xx_set_io_map(struct pcmcia_socket *sock, struct pccard_io_map *io)
974#define M8XX_SIZE (io->stop - io->start + 1) 966#define M8XX_SIZE (io->stop - io->start + 1)
975#define M8XX_BASE (PCMCIA_IO_WIN_BASE + io->start) 967#define M8XX_BASE (PCMCIA_IO_WIN_BASE + io->start)
976 968
977 dprintk("SetIOMap(%d, %d, %#2.2x, %d ns, " 969 pr_debug("m8xx_pcmcia: SetIOMap(%d, %d, %#2.2x, %d ns, "
978 "%#4.4llx-%#4.4llx)\n", lsock, io->map, io->flags, 970 "%#4.4llx-%#4.4llx)\n", lsock, io->map, io->flags,
979 io->speed, (unsigned long long)io->start, 971 io->speed, (unsigned long long)io->start,
980 (unsigned long long)io->stop); 972 (unsigned long long)io->stop);
@@ -988,7 +980,7 @@ static int m8xx_set_io_map(struct pcmcia_socket *sock, struct pccard_io_map *io)
988 980
989 if (io->flags & MAP_ACTIVE) { 981 if (io->flags & MAP_ACTIVE) {
990 982
991 dprintk("io->flags & MAP_ACTIVE\n"); 983 pr_debug("m8xx_pcmcia: io->flags & MAP_ACTIVE\n");
992 984
993 winnr = (PCMCIA_MEM_WIN_NO * PCMCIA_SOCKETS_NO) 985 winnr = (PCMCIA_MEM_WIN_NO * PCMCIA_SOCKETS_NO)
994 + (lsock * PCMCIA_IO_WIN_NO) + io->map; 986 + (lsock * PCMCIA_IO_WIN_NO) + io->map;
@@ -1018,8 +1010,8 @@ static int m8xx_set_io_map(struct pcmcia_socket *sock, struct pccard_io_map *io)
1018 1010
1019 out_be32(&w->or, reg); 1011 out_be32(&w->or, reg);
1020 1012
1021 dprintk("Socket %u: Mapped io window %u at %#8.8x, " 1013 pr_debug("m8xx_pcmcia: Socket %u: Mapped io window %u at "
1022 "OR = %#8.8x.\n", lsock, io->map, w->br, w->or); 1014 "%#8.8x, OR = %#8.8x.\n", lsock, io->map, w->br, w->or);
1023 } else { 1015 } else {
1024 /* shutdown IO window */ 1016 /* shutdown IO window */
1025 winnr = (PCMCIA_MEM_WIN_NO * PCMCIA_SOCKETS_NO) 1017 winnr = (PCMCIA_MEM_WIN_NO * PCMCIA_SOCKETS_NO)
@@ -1033,14 +1025,14 @@ static int m8xx_set_io_map(struct pcmcia_socket *sock, struct pccard_io_map *io)
1033 out_be32(&w->or, 0); /* turn off window */ 1025 out_be32(&w->or, 0); /* turn off window */
1034 out_be32(&w->br, 0); /* turn off base address */ 1026 out_be32(&w->br, 0); /* turn off base address */
1035 1027
1036 dprintk("Socket %u: Unmapped io window %u at %#8.8x, " 1028 pr_debug("m8xx_pcmcia: Socket %u: Unmapped io window %u at "
1037 "OR = %#8.8x.\n", lsock, io->map, w->br, w->or); 1029 "%#8.8x, OR = %#8.8x.\n", lsock, io->map, w->br, w->or);
1038 } 1030 }
1039 1031
1040 /* copy the struct and modify the copy */ 1032 /* copy the struct and modify the copy */
1041 s->io_win[io->map] = *io; 1033 s->io_win[io->map] = *io;
1042 s->io_win[io->map].flags &= (MAP_WRPROT | MAP_16BIT | MAP_ACTIVE); 1034 s->io_win[io->map].flags &= (MAP_WRPROT | MAP_16BIT | MAP_ACTIVE);
1043 dprintk("SetIOMap exit\n"); 1035 pr_debug("m8xx_pcmcia: SetIOMap exit\n");
1044 1036
1045 return 0; 1037 return 0;
1046} 1038}
@@ -1055,7 +1047,7 @@ static int m8xx_set_mem_map(struct pcmcia_socket *sock,
1055 unsigned int reg, winnr; 1047 unsigned int reg, winnr;
1056 pcmconf8xx_t *pcmcia = s->pcmcia; 1048 pcmconf8xx_t *pcmcia = s->pcmcia;
1057 1049
1058 dprintk("SetMemMap(%d, %d, %#2.2x, %d ns, " 1050 pr_debug("m8xx_pcmcia: SetMemMap(%d, %d, %#2.2x, %d ns, "
1059 "%#5.5llx, %#5.5x)\n", lsock, mem->map, mem->flags, 1051 "%#5.5llx, %#5.5x)\n", lsock, mem->map, mem->flags,
1060 mem->speed, (unsigned long long)mem->static_start, 1052 mem->speed, (unsigned long long)mem->static_start,
1061 mem->card_start); 1053 mem->card_start);
@@ -1098,7 +1090,7 @@ static int m8xx_set_mem_map(struct pcmcia_socket *sock,
1098 1090
1099 out_be32(&w->or, reg); 1091 out_be32(&w->or, reg);
1100 1092
1101 dprintk("Socket %u: Mapped memory window %u at %#8.8x, " 1093 pr_debug("m8xx_pcmcia: Socket %u: Mapped memory window %u at %#8.8x, "
1102 "OR = %#8.8x.\n", lsock, mem->map, w->br, w->or); 1094 "OR = %#8.8x.\n", lsock, mem->map, w->br, w->or);
1103 1095
1104 if (mem->flags & MAP_ACTIVE) { 1096 if (mem->flags & MAP_ACTIVE) {
@@ -1108,7 +1100,7 @@ static int m8xx_set_mem_map(struct pcmcia_socket *sock,
1108 + mem->card_start; 1100 + mem->card_start;
1109 } 1101 }
1110 1102
1111 dprintk("SetMemMap(%d, %d, %#2.2x, %d ns, " 1103 pr_debug("m8xx_pcmcia: SetMemMap(%d, %d, %#2.2x, %d ns, "
1112 "%#5.5llx, %#5.5x)\n", lsock, mem->map, mem->flags, 1104 "%#5.5llx, %#5.5x)\n", lsock, mem->map, mem->flags,
1113 mem->speed, (unsigned long long)mem->static_start, 1105 mem->speed, (unsigned long long)mem->static_start,
1114 mem->card_start); 1106 mem->card_start);
@@ -1129,7 +1121,7 @@ static int m8xx_sock_init(struct pcmcia_socket *sock)
1129 pccard_io_map io = { 0, 0, 0, 0, 1 }; 1121 pccard_io_map io = { 0, 0, 0, 0, 1 };
1130 pccard_mem_map mem = { 0, 0, 0, 0, 0, 0 }; 1122 pccard_mem_map mem = { 0, 0, 0, 0, 0, 0 };
1131 1123
1132 dprintk("sock_init(%d)\n", s); 1124 pr_debug("m8xx_pcmcia: sock_init(%d)\n", s);
1133 1125
1134 m8xx_set_socket(sock, &dead_socket); 1126 m8xx_set_socket(sock, &dead_socket);
1135 for (i = 0; i < PCMCIA_IO_WIN_NO; i++) { 1127 for (i = 0; i < PCMCIA_IO_WIN_NO; i++) {
diff --git a/drivers/pcmcia/o2micro.h b/drivers/pcmcia/o2micro.h
index 72188c462c9c..624442fc0d35 100644
--- a/drivers/pcmcia/o2micro.h
+++ b/drivers/pcmcia/o2micro.h
@@ -30,28 +30,6 @@
30#ifndef _LINUX_O2MICRO_H 30#ifndef _LINUX_O2MICRO_H
31#define _LINUX_O2MICRO_H 31#define _LINUX_O2MICRO_H
32 32
33#ifndef PCI_VENDOR_ID_O2
34#define PCI_VENDOR_ID_O2 0x1217
35#endif
36#ifndef PCI_DEVICE_ID_O2_6729
37#define PCI_DEVICE_ID_O2_6729 0x6729
38#endif
39#ifndef PCI_DEVICE_ID_O2_6730
40#define PCI_DEVICE_ID_O2_6730 0x673a
41#endif
42#ifndef PCI_DEVICE_ID_O2_6832
43#define PCI_DEVICE_ID_O2_6832 0x6832
44#endif
45#ifndef PCI_DEVICE_ID_O2_6836
46#define PCI_DEVICE_ID_O2_6836 0x6836
47#endif
48#ifndef PCI_DEVICE_ID_O2_6812
49#define PCI_DEVICE_ID_O2_6812 0x6872
50#endif
51#ifndef PCI_DEVICE_ID_O2_6933
52#define PCI_DEVICE_ID_O2_6933 0x6933
53#endif
54
55/* Additional PCI configuration registers */ 33/* Additional PCI configuration registers */
56 34
57#define O2_MUX_CONTROL 0x90 /* 32 bit */ 35#define O2_MUX_CONTROL 0x90 /* 32 bit */
diff --git a/drivers/pcmcia/pcmcia_ioctl.c b/drivers/pcmcia/pcmcia_ioctl.c
index 30cf71d2ee23..c4d7908fa37f 100644
--- a/drivers/pcmcia/pcmcia_ioctl.c
+++ b/drivers/pcmcia/pcmcia_ioctl.c
@@ -58,17 +58,6 @@ typedef struct user_info_t {
58} user_info_t; 58} user_info_t;
59 59
60 60
61#ifdef CONFIG_PCMCIA_DEBUG
62extern int ds_pc_debug;
63
64#define ds_dbg(lvl, fmt, arg...) do { \
65 if (ds_pc_debug >= lvl) \
66 printk(KERN_DEBUG "ds: " fmt , ## arg); \
67} while (0)
68#else
69#define ds_dbg(lvl, fmt, arg...) do { } while (0)
70#endif
71
72static struct pcmcia_device *get_pcmcia_device(struct pcmcia_socket *s, 61static struct pcmcia_device *get_pcmcia_device(struct pcmcia_socket *s,
73 unsigned int function) 62 unsigned int function)
74{ 63{
@@ -229,6 +218,61 @@ static int pcmcia_adjust_resource_info(adjust_t *adj)
229 return (ret); 218 return (ret);
230} 219}
231 220
221
222/** pcmcia_get_window
223 */
224static int pcmcia_get_window(struct pcmcia_socket *s, window_handle_t *wh_out,
225 window_handle_t wh, win_req_t *req)
226{
227 pccard_mem_map *win;
228 window_handle_t w;
229
230 wh--;
231 if (!s || !(s->state & SOCKET_PRESENT))
232 return -ENODEV;
233 if (wh >= MAX_WIN)
234 return -EINVAL;
235 for (w = wh; w < MAX_WIN; w++)
236 if (s->state & SOCKET_WIN_REQ(w))
237 break;
238 if (w == MAX_WIN)
239 return -EINVAL;
240 win = &s->win[w];
241 req->Base = win->res->start;
242 req->Size = win->res->end - win->res->start + 1;
243 req->AccessSpeed = win->speed;
244 req->Attributes = 0;
245 if (win->flags & MAP_ATTRIB)
246 req->Attributes |= WIN_MEMORY_TYPE_AM;
247 if (win->flags & MAP_ACTIVE)
248 req->Attributes |= WIN_ENABLE;
249 if (win->flags & MAP_16BIT)
250 req->Attributes |= WIN_DATA_WIDTH_16;
251 if (win->flags & MAP_USE_WAIT)
252 req->Attributes |= WIN_USE_WAIT;
253
254 *wh_out = w + 1;
255 return 0;
256} /* pcmcia_get_window */
257
258
259/** pcmcia_get_mem_page
260 *
261 * Change the card address of an already open memory window.
262 */
263static int pcmcia_get_mem_page(struct pcmcia_socket *skt, window_handle_t wh,
264 memreq_t *req)
265{
266 wh--;
267 if (wh >= MAX_WIN)
268 return -EINVAL;
269
270 req->Page = 0;
271 req->CardOffset = skt->win[wh].card_start;
272 return 0;
273} /* pcmcia_get_mem_page */
274
275
232/** pccard_get_status 276/** pccard_get_status
233 * 277 *
234 * Get the current socket state bits. We don't support the latched 278 * Get the current socket state bits. We don't support the latched
@@ -431,7 +475,7 @@ static int bind_request(struct pcmcia_socket *s, bind_info_t *bind_info)
431 if (!s) 475 if (!s)
432 return -EINVAL; 476 return -EINVAL;
433 477
434 ds_dbg(2, "bind_request(%d, '%s')\n", s->sock, 478 pr_debug("bind_request(%d, '%s')\n", s->sock,
435 (char *)bind_info->dev_info); 479 (char *)bind_info->dev_info);
436 480
437 p_drv = get_pcmcia_driver(&bind_info->dev_info); 481 p_drv = get_pcmcia_driver(&bind_info->dev_info);
@@ -623,7 +667,7 @@ static int ds_open(struct inode *inode, struct file *file)
623 static int warning_printed = 0; 667 static int warning_printed = 0;
624 int ret = 0; 668 int ret = 0;
625 669
626 ds_dbg(0, "ds_open(socket %d)\n", i); 670 pr_debug("ds_open(socket %d)\n", i);
627 671
628 lock_kernel(); 672 lock_kernel();
629 s = pcmcia_get_socket_by_nr(i); 673 s = pcmcia_get_socket_by_nr(i);
@@ -685,7 +729,7 @@ static int ds_release(struct inode *inode, struct file *file)
685 struct pcmcia_socket *s; 729 struct pcmcia_socket *s;
686 user_info_t *user, **link; 730 user_info_t *user, **link;
687 731
688 ds_dbg(0, "ds_release(socket %d)\n", iminor(inode)); 732 pr_debug("ds_release(socket %d)\n", iminor(inode));
689 733
690 user = file->private_data; 734 user = file->private_data;
691 if (CHECK_USER(user)) 735 if (CHECK_USER(user))
@@ -719,7 +763,7 @@ static ssize_t ds_read(struct file *file, char __user *buf,
719 user_info_t *user; 763 user_info_t *user;
720 int ret; 764 int ret;
721 765
722 ds_dbg(2, "ds_read(socket %d)\n", iminor(file->f_path.dentry->d_inode)); 766 pr_debug("ds_read(socket %d)\n", iminor(file->f_path.dentry->d_inode));
723 767
724 if (count < 4) 768 if (count < 4)
725 return -EINVAL; 769 return -EINVAL;
@@ -744,7 +788,7 @@ static ssize_t ds_read(struct file *file, char __user *buf,
744static ssize_t ds_write(struct file *file, const char __user *buf, 788static ssize_t ds_write(struct file *file, const char __user *buf,
745 size_t count, loff_t *ppos) 789 size_t count, loff_t *ppos)
746{ 790{
747 ds_dbg(2, "ds_write(socket %d)\n", iminor(file->f_path.dentry->d_inode)); 791 pr_debug("ds_write(socket %d)\n", iminor(file->f_path.dentry->d_inode));
748 792
749 if (count != 4) 793 if (count != 4)
750 return -EINVAL; 794 return -EINVAL;
@@ -762,7 +806,7 @@ static u_int ds_poll(struct file *file, poll_table *wait)
762 struct pcmcia_socket *s; 806 struct pcmcia_socket *s;
763 user_info_t *user; 807 user_info_t *user;
764 808
765 ds_dbg(2, "ds_poll(socket %d)\n", iminor(file->f_path.dentry->d_inode)); 809 pr_debug("ds_poll(socket %d)\n", iminor(file->f_path.dentry->d_inode));
766 810
767 user = file->private_data; 811 user = file->private_data;
768 if (CHECK_USER(user)) 812 if (CHECK_USER(user))
@@ -790,7 +834,7 @@ static int ds_ioctl(struct inode * inode, struct file * file,
790 ds_ioctl_arg_t *buf; 834 ds_ioctl_arg_t *buf;
791 user_info_t *user; 835 user_info_t *user;
792 836
793 ds_dbg(2, "ds_ioctl(socket %d, %#x, %#lx)\n", iminor(inode), cmd, arg); 837 pr_debug("ds_ioctl(socket %d, %#x, %#lx)\n", iminor(inode), cmd, arg);
794 838
795 user = file->private_data; 839 user = file->private_data;
796 if (CHECK_USER(user)) 840 if (CHECK_USER(user))
@@ -809,13 +853,13 @@ static int ds_ioctl(struct inode * inode, struct file * file,
809 853
810 if (cmd & IOC_IN) { 854 if (cmd & IOC_IN) {
811 if (!access_ok(VERIFY_READ, uarg, size)) { 855 if (!access_ok(VERIFY_READ, uarg, size)) {
812 ds_dbg(3, "ds_ioctl(): verify_read = %d\n", -EFAULT); 856 pr_debug("ds_ioctl(): verify_read = %d\n", -EFAULT);
813 return -EFAULT; 857 return -EFAULT;
814 } 858 }
815 } 859 }
816 if (cmd & IOC_OUT) { 860 if (cmd & IOC_OUT) {
817 if (!access_ok(VERIFY_WRITE, uarg, size)) { 861 if (!access_ok(VERIFY_WRITE, uarg, size)) {
818 ds_dbg(3, "ds_ioctl(): verify_write = %d\n", -EFAULT); 862 pr_debug("ds_ioctl(): verify_write = %d\n", -EFAULT);
819 return -EFAULT; 863 return -EFAULT;
820 } 864 }
821 } 865 }
@@ -927,15 +971,15 @@ static int ds_ioctl(struct inode * inode, struct file * file,
927 goto free_out; 971 goto free_out;
928 break; 972 break;
929 case DS_GET_FIRST_WINDOW: 973 case DS_GET_FIRST_WINDOW:
930 ret = pcmcia_get_window(s, &buf->win_info.handle, 0, 974 ret = pcmcia_get_window(s, &buf->win_info.handle, 1,
931 &buf->win_info.window); 975 &buf->win_info.window);
932 break; 976 break;
933 case DS_GET_NEXT_WINDOW: 977 case DS_GET_NEXT_WINDOW:
934 ret = pcmcia_get_window(s, &buf->win_info.handle, 978 ret = pcmcia_get_window(s, &buf->win_info.handle,
935 buf->win_info.handle->index + 1, &buf->win_info.window); 979 buf->win_info.handle + 1, &buf->win_info.window);
936 break; 980 break;
937 case DS_GET_MEM_PAGE: 981 case DS_GET_MEM_PAGE:
938 ret = pcmcia_get_mem_page(buf->win_info.handle, 982 ret = pcmcia_get_mem_page(s, buf->win_info.handle,
939 &buf->win_info.map); 983 &buf->win_info.map);
940 break; 984 break;
941 case DS_REPLACE_CIS: 985 case DS_REPLACE_CIS:
@@ -962,7 +1006,7 @@ static int ds_ioctl(struct inode * inode, struct file * file,
962 } 1006 }
963 1007
964 if ((err == 0) && (ret != 0)) { 1008 if ((err == 0) && (ret != 0)) {
965 ds_dbg(2, "ds_ioctl: ret = %d\n", ret); 1009 pr_debug("ds_ioctl: ret = %d\n", ret);
966 switch (ret) { 1010 switch (ret) {
967 case -ENODEV: 1011 case -ENODEV:
968 case -EINVAL: 1012 case -EINVAL:
diff --git a/drivers/pcmcia/pcmcia_resource.c b/drivers/pcmcia/pcmcia_resource.c
index d919e96c0afd..a8bf8c1b45ed 100644
--- a/drivers/pcmcia/pcmcia_resource.c
+++ b/drivers/pcmcia/pcmcia_resource.c
@@ -20,6 +20,7 @@
20#include <linux/delay.h> 20#include <linux/delay.h>
21#include <linux/pci.h> 21#include <linux/pci.h>
22#include <linux/device.h> 22#include <linux/device.h>
23#include <linux/netdevice.h>
23 24
24#include <pcmcia/cs_types.h> 25#include <pcmcia/cs_types.h>
25#include <pcmcia/ss.h> 26#include <pcmcia/ss.h>
@@ -43,21 +44,6 @@ static u8 pcmcia_used_irq[NR_IRQS];
43#endif 44#endif
44 45
45 46
46#ifdef CONFIG_PCMCIA_DEBUG
47extern int ds_pc_debug;
48
49#define ds_dbg(skt, lvl, fmt, arg...) do { \
50 if (ds_pc_debug >= lvl) \
51 dev_printk(KERN_DEBUG, &skt->dev, \
52 "pcmcia_resource: " fmt, \
53 ## arg); \
54} while (0)
55#else
56#define ds_dbg(skt, lvl, fmt, arg...) do { } while (0)
57#endif
58
59
60
61/** alloc_io_space 47/** alloc_io_space
62 * 48 *
63 * Special stuff for managing IO windows, because they are scarce 49 * Special stuff for managing IO windows, because they are scarce
@@ -72,14 +58,14 @@ static int alloc_io_space(struct pcmcia_socket *s, u_int attr,
72 align = (*base) ? (lines ? 1<<lines : 0) : 1; 58 align = (*base) ? (lines ? 1<<lines : 0) : 1;
73 if (align && (align < num)) { 59 if (align && (align < num)) {
74 if (*base) { 60 if (*base) {
75 ds_dbg(s, 0, "odd IO request: num %#x align %#x\n", 61 dev_dbg(&s->dev, "odd IO request: num %#x align %#x\n",
76 num, align); 62 num, align);
77 align = 0; 63 align = 0;
78 } else 64 } else
79 while (align && (align < num)) align <<= 1; 65 while (align && (align < num)) align <<= 1;
80 } 66 }
81 if (*base & ~(align-1)) { 67 if (*base & ~(align-1)) {
82 ds_dbg(s, 0, "odd IO request: base %#x align %#x\n", 68 dev_dbg(&s->dev, "odd IO request: base %#x align %#x\n",
83 *base, align); 69 *base, align);
84 align = 0; 70 align = 0;
85 } 71 }
@@ -173,8 +159,10 @@ int pcmcia_access_configuration_register(struct pcmcia_device *p_dev,
173 s = p_dev->socket; 159 s = p_dev->socket;
174 c = p_dev->function_config; 160 c = p_dev->function_config;
175 161
176 if (!(c->state & CONFIG_LOCKED)) 162 if (!(c->state & CONFIG_LOCKED)) {
163 dev_dbg(&s->dev, "Configuration isnt't locked\n");
177 return -EACCES; 164 return -EACCES;
165 }
178 166
179 addr = (c->ConfigBase + reg->Offset) >> 1; 167 addr = (c->ConfigBase + reg->Offset) >> 1;
180 168
@@ -188,6 +176,7 @@ int pcmcia_access_configuration_register(struct pcmcia_device *p_dev,
188 pcmcia_write_cis_mem(s, 1, addr, 1, &val); 176 pcmcia_write_cis_mem(s, 1, addr, 1, &val);
189 break; 177 break;
190 default: 178 default:
179 dev_dbg(&s->dev, "Invalid conf register request\n");
191 return -EINVAL; 180 return -EINVAL;
192 break; 181 break;
193 } 182 }
@@ -196,68 +185,21 @@ int pcmcia_access_configuration_register(struct pcmcia_device *p_dev,
196EXPORT_SYMBOL(pcmcia_access_configuration_register); 185EXPORT_SYMBOL(pcmcia_access_configuration_register);
197 186
198 187
199/** pcmcia_get_window 188int pcmcia_map_mem_page(struct pcmcia_device *p_dev, window_handle_t wh,
200 */ 189 memreq_t *req)
201int pcmcia_get_window(struct pcmcia_socket *s, window_handle_t *handle,
202 int idx, win_req_t *req)
203{
204 window_t *win;
205 int w;
206
207 if (!s || !(s->state & SOCKET_PRESENT))
208 return -ENODEV;
209 for (w = idx; w < MAX_WIN; w++)
210 if (s->state & SOCKET_WIN_REQ(w))
211 break;
212 if (w == MAX_WIN)
213 return -EINVAL;
214 win = &s->win[w];
215 req->Base = win->ctl.res->start;
216 req->Size = win->ctl.res->end - win->ctl.res->start + 1;
217 req->AccessSpeed = win->ctl.speed;
218 req->Attributes = 0;
219 if (win->ctl.flags & MAP_ATTRIB)
220 req->Attributes |= WIN_MEMORY_TYPE_AM;
221 if (win->ctl.flags & MAP_ACTIVE)
222 req->Attributes |= WIN_ENABLE;
223 if (win->ctl.flags & MAP_16BIT)
224 req->Attributes |= WIN_DATA_WIDTH_16;
225 if (win->ctl.flags & MAP_USE_WAIT)
226 req->Attributes |= WIN_USE_WAIT;
227 *handle = win;
228 return 0;
229} /* pcmcia_get_window */
230EXPORT_SYMBOL(pcmcia_get_window);
231
232
233/** pcmcia_get_mem_page
234 *
235 * Change the card address of an already open memory window.
236 */
237int pcmcia_get_mem_page(window_handle_t win, memreq_t *req)
238{ 190{
239 if ((win == NULL) || (win->magic != WINDOW_MAGIC)) 191 struct pcmcia_socket *s = p_dev->socket;
240 return -EINVAL;
241 req->Page = 0;
242 req->CardOffset = win->ctl.card_start;
243 return 0;
244} /* pcmcia_get_mem_page */
245EXPORT_SYMBOL(pcmcia_get_mem_page);
246
247 192
248int pcmcia_map_mem_page(window_handle_t win, memreq_t *req) 193 wh--;
249{ 194 if (wh >= MAX_WIN)
250 struct pcmcia_socket *s;
251 if ((win == NULL) || (win->magic != WINDOW_MAGIC))
252 return -EINVAL; 195 return -EINVAL;
253 s = win->sock;
254 if (req->Page != 0) { 196 if (req->Page != 0) {
255 ds_dbg(s, 0, "failure: requested page is zero\n"); 197 dev_dbg(&s->dev, "failure: requested page is zero\n");
256 return -EINVAL; 198 return -EINVAL;
257 } 199 }
258 win->ctl.card_start = req->CardOffset; 200 s->win[wh].card_start = req->CardOffset;
259 if (s->ops->set_mem_map(s, &win->ctl) != 0) { 201 if (s->ops->set_mem_map(s, &s->win[wh]) != 0) {
260 ds_dbg(s, 0, "failed to set_mem_map\n"); 202 dev_dbg(&s->dev, "failed to set_mem_map\n");
261 return -EIO; 203 return -EIO;
262 } 204 }
263 return 0; 205 return 0;
@@ -278,10 +220,14 @@ int pcmcia_modify_configuration(struct pcmcia_device *p_dev,
278 s = p_dev->socket; 220 s = p_dev->socket;
279 c = p_dev->function_config; 221 c = p_dev->function_config;
280 222
281 if (!(s->state & SOCKET_PRESENT)) 223 if (!(s->state & SOCKET_PRESENT)) {
224 dev_dbg(&s->dev, "No card present\n");
282 return -ENODEV; 225 return -ENODEV;
283 if (!(c->state & CONFIG_LOCKED)) 226 }
227 if (!(c->state & CONFIG_LOCKED)) {
228 dev_dbg(&s->dev, "Configuration isnt't locked\n");
284 return -EACCES; 229 return -EACCES;
230 }
285 231
286 if (mod->Attributes & CONF_IRQ_CHANGE_VALID) { 232 if (mod->Attributes & CONF_IRQ_CHANGE_VALID) {
287 if (mod->Attributes & CONF_ENABLE_IRQ) { 233 if (mod->Attributes & CONF_ENABLE_IRQ) {
@@ -295,7 +241,7 @@ int pcmcia_modify_configuration(struct pcmcia_device *p_dev,
295 } 241 }
296 242
297 if (mod->Attributes & CONF_VCC_CHANGE_VALID) { 243 if (mod->Attributes & CONF_VCC_CHANGE_VALID) {
298 ds_dbg(s, 0, "changing Vcc is not allowed at this time\n"); 244 dev_dbg(&s->dev, "changing Vcc is not allowed at this time\n");
299 return -EINVAL; 245 return -EINVAL;
300 } 246 }
301 247
@@ -303,7 +249,7 @@ int pcmcia_modify_configuration(struct pcmcia_device *p_dev,
303 if ((mod->Attributes & CONF_VPP1_CHANGE_VALID) && 249 if ((mod->Attributes & CONF_VPP1_CHANGE_VALID) &&
304 (mod->Attributes & CONF_VPP2_CHANGE_VALID)) { 250 (mod->Attributes & CONF_VPP2_CHANGE_VALID)) {
305 if (mod->Vpp1 != mod->Vpp2) { 251 if (mod->Vpp1 != mod->Vpp2) {
306 ds_dbg(s, 0, "Vpp1 and Vpp2 must be the same\n"); 252 dev_dbg(&s->dev, "Vpp1 and Vpp2 must be the same\n");
307 return -EINVAL; 253 return -EINVAL;
308 } 254 }
309 s->socket.Vpp = mod->Vpp1; 255 s->socket.Vpp = mod->Vpp1;
@@ -314,7 +260,7 @@ int pcmcia_modify_configuration(struct pcmcia_device *p_dev,
314 } 260 }
315 } else if ((mod->Attributes & CONF_VPP1_CHANGE_VALID) || 261 } else if ((mod->Attributes & CONF_VPP1_CHANGE_VALID) ||
316 (mod->Attributes & CONF_VPP2_CHANGE_VALID)) { 262 (mod->Attributes & CONF_VPP2_CHANGE_VALID)) {
317 ds_dbg(s, 0, "changing Vcc is not allowed at this time\n"); 263 dev_dbg(&s->dev, "changing Vcc is not allowed at this time\n");
318 return -EINVAL; 264 return -EINVAL;
319 } 265 }
320 266
@@ -425,11 +371,11 @@ static int pcmcia_release_irq(struct pcmcia_device *p_dev, irq_req_t *req)
425 if (c->state & CONFIG_LOCKED) 371 if (c->state & CONFIG_LOCKED)
426 return -EACCES; 372 return -EACCES;
427 if (c->irq.Attributes != req->Attributes) { 373 if (c->irq.Attributes != req->Attributes) {
428 ds_dbg(s, 0, "IRQ attributes must match assigned ones\n"); 374 dev_dbg(&s->dev, "IRQ attributes must match assigned ones\n");
429 return -EINVAL; 375 return -EINVAL;
430 } 376 }
431 if (s->irq.AssignedIRQ != req->AssignedIRQ) { 377 if (s->irq.AssignedIRQ != req->AssignedIRQ) {
432 ds_dbg(s, 0, "IRQ must match assigned one\n"); 378 dev_dbg(&s->dev, "IRQ must match assigned one\n");
433 return -EINVAL; 379 return -EINVAL;
434 } 380 }
435 if (--s->irq.Config == 0) { 381 if (--s->irq.Config == 0) {
@@ -437,8 +383,8 @@ static int pcmcia_release_irq(struct pcmcia_device *p_dev, irq_req_t *req)
437 s->irq.AssignedIRQ = 0; 383 s->irq.AssignedIRQ = 0;
438 } 384 }
439 385
440 if (req->Attributes & IRQ_HANDLE_PRESENT) { 386 if (req->Handler) {
441 free_irq(req->AssignedIRQ, req->Instance); 387 free_irq(req->AssignedIRQ, p_dev->priv);
442 } 388 }
443 389
444#ifdef CONFIG_PCMCIA_PROBE 390#ifdef CONFIG_PCMCIA_PROBE
@@ -449,30 +395,34 @@ static int pcmcia_release_irq(struct pcmcia_device *p_dev, irq_req_t *req)
449} /* pcmcia_release_irq */ 395} /* pcmcia_release_irq */
450 396
451 397
452int pcmcia_release_window(window_handle_t win) 398int pcmcia_release_window(struct pcmcia_device *p_dev, window_handle_t wh)
453{ 399{
454 struct pcmcia_socket *s; 400 struct pcmcia_socket *s = p_dev->socket;
401 pccard_mem_map *win;
455 402
456 if ((win == NULL) || (win->magic != WINDOW_MAGIC)) 403 wh--;
404 if (wh >= MAX_WIN)
457 return -EINVAL; 405 return -EINVAL;
458 s = win->sock; 406
459 if (!(win->handle->_win & CLIENT_WIN_REQ(win->index))) 407 win = &s->win[wh];
408
409 if (!(p_dev->_win & CLIENT_WIN_REQ(wh))) {
410 dev_dbg(&s->dev, "not releasing unknown window\n");
460 return -EINVAL; 411 return -EINVAL;
412 }
461 413
462 /* Shut down memory window */ 414 /* Shut down memory window */
463 win->ctl.flags &= ~MAP_ACTIVE; 415 win->flags &= ~MAP_ACTIVE;
464 s->ops->set_mem_map(s, &win->ctl); 416 s->ops->set_mem_map(s, win);
465 s->state &= ~SOCKET_WIN_REQ(win->index); 417 s->state &= ~SOCKET_WIN_REQ(wh);
466 418
467 /* Release system memory */ 419 /* Release system memory */
468 if (win->ctl.res) { 420 if (win->res) {
469 release_resource(win->ctl.res); 421 release_resource(win->res);
470 kfree(win->ctl.res); 422 kfree(win->res);
471 win->ctl.res = NULL; 423 win->res = NULL;
472 } 424 }
473 win->handle->_win &= ~CLIENT_WIN_REQ(win->index); 425 p_dev->_win &= ~CLIENT_WIN_REQ(wh);
474
475 win->magic = 0;
476 426
477 return 0; 427 return 0;
478} /* pcmcia_release_window */ 428} /* pcmcia_release_window */
@@ -492,12 +442,14 @@ int pcmcia_request_configuration(struct pcmcia_device *p_dev,
492 return -ENODEV; 442 return -ENODEV;
493 443
494 if (req->IntType & INT_CARDBUS) { 444 if (req->IntType & INT_CARDBUS) {
495 ds_dbg(p_dev->socket, 0, "IntType may not be INT_CARDBUS\n"); 445 dev_dbg(&s->dev, "IntType may not be INT_CARDBUS\n");
496 return -EINVAL; 446 return -EINVAL;
497 } 447 }
498 c = p_dev->function_config; 448 c = p_dev->function_config;
499 if (c->state & CONFIG_LOCKED) 449 if (c->state & CONFIG_LOCKED) {
450 dev_dbg(&s->dev, "Configuration is locked\n");
500 return -EACCES; 451 return -EACCES;
452 }
501 453
502 /* Do power control. We don't allow changes in Vcc. */ 454 /* Do power control. We don't allow changes in Vcc. */
503 s->socket.Vpp = req->Vpp; 455 s->socket.Vpp = req->Vpp;
@@ -609,40 +561,44 @@ int pcmcia_request_io(struct pcmcia_device *p_dev, io_req_t *req)
609 struct pcmcia_socket *s = p_dev->socket; 561 struct pcmcia_socket *s = p_dev->socket;
610 config_t *c; 562 config_t *c;
611 563
612 if (!(s->state & SOCKET_PRESENT)) 564 if (!(s->state & SOCKET_PRESENT)) {
565 dev_dbg(&s->dev, "No card present\n");
613 return -ENODEV; 566 return -ENODEV;
567 }
614 568
615 if (!req) 569 if (!req)
616 return -EINVAL; 570 return -EINVAL;
617 c = p_dev->function_config; 571 c = p_dev->function_config;
618 if (c->state & CONFIG_LOCKED) 572 if (c->state & CONFIG_LOCKED) {
573 dev_dbg(&s->dev, "Configuration is locked\n");
619 return -EACCES; 574 return -EACCES;
575 }
620 if (c->state & CONFIG_IO_REQ) { 576 if (c->state & CONFIG_IO_REQ) {
621 ds_dbg(s, 0, "IO already configured\n"); 577 dev_dbg(&s->dev, "IO already configured\n");
622 return -EBUSY; 578 return -EBUSY;
623 } 579 }
624 if (req->Attributes1 & (IO_SHARED | IO_FORCE_ALIAS_ACCESS)) { 580 if (req->Attributes1 & (IO_SHARED | IO_FORCE_ALIAS_ACCESS)) {
625 ds_dbg(s, 0, "bad attribute setting for IO region 1\n"); 581 dev_dbg(&s->dev, "bad attribute setting for IO region 1\n");
626 return -EINVAL; 582 return -EINVAL;
627 } 583 }
628 if ((req->NumPorts2 > 0) && 584 if ((req->NumPorts2 > 0) &&
629 (req->Attributes2 & (IO_SHARED | IO_FORCE_ALIAS_ACCESS))) { 585 (req->Attributes2 & (IO_SHARED | IO_FORCE_ALIAS_ACCESS))) {
630 ds_dbg(s, 0, "bad attribute setting for IO region 2\n"); 586 dev_dbg(&s->dev, "bad attribute setting for IO region 2\n");
631 return -EINVAL; 587 return -EINVAL;
632 } 588 }
633 589
634 ds_dbg(s, 1, "trying to allocate resource 1\n"); 590 dev_dbg(&s->dev, "trying to allocate resource 1\n");
635 if (alloc_io_space(s, req->Attributes1, &req->BasePort1, 591 if (alloc_io_space(s, req->Attributes1, &req->BasePort1,
636 req->NumPorts1, req->IOAddrLines)) { 592 req->NumPorts1, req->IOAddrLines)) {
637 ds_dbg(s, 0, "allocation of resource 1 failed\n"); 593 dev_dbg(&s->dev, "allocation of resource 1 failed\n");
638 return -EBUSY; 594 return -EBUSY;
639 } 595 }
640 596
641 if (req->NumPorts2) { 597 if (req->NumPorts2) {
642 ds_dbg(s, 1, "trying to allocate resource 2\n"); 598 dev_dbg(&s->dev, "trying to allocate resource 2\n");
643 if (alloc_io_space(s, req->Attributes2, &req->BasePort2, 599 if (alloc_io_space(s, req->Attributes2, &req->BasePort2,
644 req->NumPorts2, req->IOAddrLines)) { 600 req->NumPorts2, req->IOAddrLines)) {
645 ds_dbg(s, 0, "allocation of resource 2 failed\n"); 601 dev_dbg(&s->dev, "allocation of resource 2 failed\n");
646 release_io_space(s, req->BasePort1, req->NumPorts1); 602 release_io_space(s, req->BasePort1, req->NumPorts1);
647 return -EBUSY; 603 return -EBUSY;
648 } 604 }
@@ -680,13 +636,17 @@ int pcmcia_request_irq(struct pcmcia_device *p_dev, irq_req_t *req)
680 int ret = -EINVAL, irq = 0; 636 int ret = -EINVAL, irq = 0;
681 int type; 637 int type;
682 638
683 if (!(s->state & SOCKET_PRESENT)) 639 if (!(s->state & SOCKET_PRESENT)) {
640 dev_dbg(&s->dev, "No card present\n");
684 return -ENODEV; 641 return -ENODEV;
642 }
685 c = p_dev->function_config; 643 c = p_dev->function_config;
686 if (c->state & CONFIG_LOCKED) 644 if (c->state & CONFIG_LOCKED) {
645 dev_dbg(&s->dev, "Configuration is locked\n");
687 return -EACCES; 646 return -EACCES;
647 }
688 if (c->state & CONFIG_IRQ_REQ) { 648 if (c->state & CONFIG_IRQ_REQ) {
689 ds_dbg(s, 0, "IRQ already configured\n"); 649 dev_dbg(&s->dev, "IRQ already configured\n");
690 return -EBUSY; 650 return -EBUSY;
691 } 651 }
692 652
@@ -704,7 +664,7 @@ int pcmcia_request_irq(struct pcmcia_device *p_dev, irq_req_t *req)
704 /* if the underlying IRQ infrastructure allows for it, only allocate 664 /* if the underlying IRQ infrastructure allows for it, only allocate
705 * the IRQ, but do not enable it 665 * the IRQ, but do not enable it
706 */ 666 */
707 if (!(req->Attributes & IRQ_HANDLE_PRESENT)) 667 if (!(req->Handler))
708 type |= IRQ_NOAUTOEN; 668 type |= IRQ_NOAUTOEN;
709#endif /* IRQ_NOAUTOEN */ 669#endif /* IRQ_NOAUTOEN */
710 670
@@ -714,7 +674,7 @@ int pcmcia_request_irq(struct pcmcia_device *p_dev, irq_req_t *req)
714 } else { 674 } else {
715 int try; 675 int try;
716 u32 mask = s->irq_mask; 676 u32 mask = s->irq_mask;
717 void *data = &p_dev->dev.driver; /* something unique to this device */ 677 void *data = p_dev; /* something unique to this device */
718 678
719 for (try = 0; try < 64; try++) { 679 for (try = 0; try < 64; try++) {
720 irq = try % 32; 680 irq = try % 32;
@@ -731,12 +691,12 @@ int pcmcia_request_irq(struct pcmcia_device *p_dev, irq_req_t *req)
731 * registering a dummy handle works, i.e. if the IRQ isn't 691 * registering a dummy handle works, i.e. if the IRQ isn't
732 * marked as used by the kernel resource management core */ 692 * marked as used by the kernel resource management core */
733 ret = request_irq(irq, 693 ret = request_irq(irq,
734 (req->Attributes & IRQ_HANDLE_PRESENT) ? req->Handler : test_action, 694 (req->Handler) ? req->Handler : test_action,
735 type, 695 type,
736 p_dev->devname, 696 p_dev->devname,
737 (req->Attributes & IRQ_HANDLE_PRESENT) ? req->Instance : data); 697 (req->Handler) ? p_dev->priv : data);
738 if (!ret) { 698 if (!ret) {
739 if (!(req->Attributes & IRQ_HANDLE_PRESENT)) 699 if (!req->Handler)
740 free_irq(irq, data); 700 free_irq(irq, data);
741 break; 701 break;
742 } 702 }
@@ -745,17 +705,22 @@ int pcmcia_request_irq(struct pcmcia_device *p_dev, irq_req_t *req)
745#endif 705#endif
746 /* only assign PCI irq if no IRQ already assigned */ 706 /* only assign PCI irq if no IRQ already assigned */
747 if (ret && !s->irq.AssignedIRQ) { 707 if (ret && !s->irq.AssignedIRQ) {
748 if (!s->pci_irq) 708 if (!s->pci_irq) {
709 dev_printk(KERN_INFO, &s->dev, "no IRQ found\n");
749 return ret; 710 return ret;
711 }
750 type = IRQF_SHARED; 712 type = IRQF_SHARED;
751 irq = s->pci_irq; 713 irq = s->pci_irq;
752 } 714 }
753 715
754 if (ret && (req->Attributes & IRQ_HANDLE_PRESENT)) { 716 if (ret && req->Handler) {
755 ret = request_irq(irq, req->Handler, type, 717 ret = request_irq(irq, req->Handler, type,
756 p_dev->devname, req->Instance); 718 p_dev->devname, p_dev->priv);
757 if (ret) 719 if (ret) {
720 dev_printk(KERN_INFO, &s->dev,
721 "request_irq() failed\n");
758 return ret; 722 return ret;
723 }
759 } 724 }
760 725
761 /* Make sure the fact the request type was overridden is passed back */ 726 /* Make sure the fact the request type was overridden is passed back */
@@ -787,17 +752,19 @@ EXPORT_SYMBOL(pcmcia_request_irq);
787 * Request_window() establishes a mapping between card memory space 752 * Request_window() establishes a mapping between card memory space
788 * and system memory space. 753 * and system memory space.
789 */ 754 */
790int pcmcia_request_window(struct pcmcia_device **p_dev, win_req_t *req, window_handle_t *wh) 755int pcmcia_request_window(struct pcmcia_device *p_dev, win_req_t *req, window_handle_t *wh)
791{ 756{
792 struct pcmcia_socket *s = (*p_dev)->socket; 757 struct pcmcia_socket *s = p_dev->socket;
793 window_t *win; 758 pccard_mem_map *win;
794 u_long align; 759 u_long align;
795 int w; 760 int w;
796 761
797 if (!(s->state & SOCKET_PRESENT)) 762 if (!(s->state & SOCKET_PRESENT)) {
763 dev_dbg(&s->dev, "No card present\n");
798 return -ENODEV; 764 return -ENODEV;
765 }
799 if (req->Attributes & (WIN_PAGED | WIN_SHARED)) { 766 if (req->Attributes & (WIN_PAGED | WIN_SHARED)) {
800 ds_dbg(s, 0, "bad attribute setting for iomem region\n"); 767 dev_dbg(&s->dev, "bad attribute setting for iomem region\n");
801 return -EINVAL; 768 return -EINVAL;
802 } 769 }
803 770
@@ -808,12 +775,12 @@ int pcmcia_request_window(struct pcmcia_device **p_dev, win_req_t *req, window_h
808 (req->Attributes & WIN_STRICT_ALIGN)) ? 775 (req->Attributes & WIN_STRICT_ALIGN)) ?
809 req->Size : s->map_size); 776 req->Size : s->map_size);
810 if (req->Size & (s->map_size-1)) { 777 if (req->Size & (s->map_size-1)) {
811 ds_dbg(s, 0, "invalid map size\n"); 778 dev_dbg(&s->dev, "invalid map size\n");
812 return -EINVAL; 779 return -EINVAL;
813 } 780 }
814 if ((req->Base && (s->features & SS_CAP_STATIC_MAP)) || 781 if ((req->Base && (s->features & SS_CAP_STATIC_MAP)) ||
815 (req->Base & (align-1))) { 782 (req->Base & (align-1))) {
816 ds_dbg(s, 0, "invalid base address\n"); 783 dev_dbg(&s->dev, "invalid base address\n");
817 return -EINVAL; 784 return -EINVAL;
818 } 785 }
819 if (req->Base) 786 if (req->Base)
@@ -823,52 +790,48 @@ int pcmcia_request_window(struct pcmcia_device **p_dev, win_req_t *req, window_h
823 for (w = 0; w < MAX_WIN; w++) 790 for (w = 0; w < MAX_WIN; w++)
824 if (!(s->state & SOCKET_WIN_REQ(w))) break; 791 if (!(s->state & SOCKET_WIN_REQ(w))) break;
825 if (w == MAX_WIN) { 792 if (w == MAX_WIN) {
826 ds_dbg(s, 0, "all windows are used already\n"); 793 dev_dbg(&s->dev, "all windows are used already\n");
827 return -EINVAL; 794 return -EINVAL;
828 } 795 }
829 796
830 win = &s->win[w]; 797 win = &s->win[w];
831 win->magic = WINDOW_MAGIC;
832 win->index = w;
833 win->handle = *p_dev;
834 win->sock = s;
835 798
836 if (!(s->features & SS_CAP_STATIC_MAP)) { 799 if (!(s->features & SS_CAP_STATIC_MAP)) {
837 win->ctl.res = pcmcia_find_mem_region(req->Base, req->Size, align, 800 win->res = pcmcia_find_mem_region(req->Base, req->Size, align,
838 (req->Attributes & WIN_MAP_BELOW_1MB), s); 801 (req->Attributes & WIN_MAP_BELOW_1MB), s);
839 if (!win->ctl.res) { 802 if (!win->res) {
840 ds_dbg(s, 0, "allocating mem region failed\n"); 803 dev_dbg(&s->dev, "allocating mem region failed\n");
841 return -EINVAL; 804 return -EINVAL;
842 } 805 }
843 } 806 }
844 (*p_dev)->_win |= CLIENT_WIN_REQ(w); 807 p_dev->_win |= CLIENT_WIN_REQ(w);
845 808
846 /* Configure the socket controller */ 809 /* Configure the socket controller */
847 win->ctl.map = w+1; 810 win->map = w+1;
848 win->ctl.flags = 0; 811 win->flags = 0;
849 win->ctl.speed = req->AccessSpeed; 812 win->speed = req->AccessSpeed;
850 if (req->Attributes & WIN_MEMORY_TYPE) 813 if (req->Attributes & WIN_MEMORY_TYPE)
851 win->ctl.flags |= MAP_ATTRIB; 814 win->flags |= MAP_ATTRIB;
852 if (req->Attributes & WIN_ENABLE) 815 if (req->Attributes & WIN_ENABLE)
853 win->ctl.flags |= MAP_ACTIVE; 816 win->flags |= MAP_ACTIVE;
854 if (req->Attributes & WIN_DATA_WIDTH_16) 817 if (req->Attributes & WIN_DATA_WIDTH_16)
855 win->ctl.flags |= MAP_16BIT; 818 win->flags |= MAP_16BIT;
856 if (req->Attributes & WIN_USE_WAIT) 819 if (req->Attributes & WIN_USE_WAIT)
857 win->ctl.flags |= MAP_USE_WAIT; 820 win->flags |= MAP_USE_WAIT;
858 win->ctl.card_start = 0; 821 win->card_start = 0;
859 if (s->ops->set_mem_map(s, &win->ctl) != 0) { 822 if (s->ops->set_mem_map(s, win) != 0) {
860 ds_dbg(s, 0, "failed to set memory mapping\n"); 823 dev_dbg(&s->dev, "failed to set memory mapping\n");
861 return -EIO; 824 return -EIO;
862 } 825 }
863 s->state |= SOCKET_WIN_REQ(w); 826 s->state |= SOCKET_WIN_REQ(w);
864 827
865 /* Return window handle */ 828 /* Return window handle */
866 if (s->features & SS_CAP_STATIC_MAP) { 829 if (s->features & SS_CAP_STATIC_MAP) {
867 req->Base = win->ctl.static_start; 830 req->Base = win->static_start;
868 } else { 831 } else {
869 req->Base = win->ctl.res->start; 832 req->Base = win->res->start;
870 } 833 }
871 *wh = win; 834 *wh = w + 1;
872 835
873 return 0; 836 return 0;
874} /* pcmcia_request_window */ 837} /* pcmcia_request_window */
@@ -879,19 +842,46 @@ void pcmcia_disable_device(struct pcmcia_device *p_dev) {
879 pcmcia_release_io(p_dev, &p_dev->io); 842 pcmcia_release_io(p_dev, &p_dev->io);
880 pcmcia_release_irq(p_dev, &p_dev->irq); 843 pcmcia_release_irq(p_dev, &p_dev->irq);
881 if (p_dev->win) 844 if (p_dev->win)
882 pcmcia_release_window(p_dev->win); 845 pcmcia_release_window(p_dev, p_dev->win);
883} 846}
884EXPORT_SYMBOL(pcmcia_disable_device); 847EXPORT_SYMBOL(pcmcia_disable_device);
885 848
886 849
887struct pcmcia_cfg_mem { 850struct pcmcia_cfg_mem {
888 tuple_t tuple; 851 struct pcmcia_device *p_dev;
852 void *priv_data;
853 int (*conf_check) (struct pcmcia_device *p_dev,
854 cistpl_cftable_entry_t *cfg,
855 cistpl_cftable_entry_t *dflt,
856 unsigned int vcc,
857 void *priv_data);
889 cisparse_t parse; 858 cisparse_t parse;
890 u8 buf[256];
891 cistpl_cftable_entry_t dflt; 859 cistpl_cftable_entry_t dflt;
892}; 860};
893 861
894/** 862/**
863 * pcmcia_do_loop_config() - internal helper for pcmcia_loop_config()
864 *
865 * pcmcia_do_loop_config() is the internal callback for the call from
866 * pcmcia_loop_config() to pccard_loop_tuple(). Data is transferred
867 * by a struct pcmcia_cfg_mem.
868 */
869static int pcmcia_do_loop_config(tuple_t *tuple, cisparse_t *parse, void *priv)
870{
871 cistpl_cftable_entry_t *cfg = &parse->cftable_entry;
872 struct pcmcia_cfg_mem *cfg_mem = priv;
873
874 /* default values */
875 cfg_mem->p_dev->conf.ConfigIndex = cfg->index;
876 if (cfg->flags & CISTPL_CFTABLE_DEFAULT)
877 cfg_mem->dflt = *cfg;
878
879 return cfg_mem->conf_check(cfg_mem->p_dev, cfg, &cfg_mem->dflt,
880 cfg_mem->p_dev->socket->socket.Vcc,
881 cfg_mem->priv_data);
882}
883
884/**
895 * pcmcia_loop_config() - loop over configuration options 885 * pcmcia_loop_config() - loop over configuration options
896 * @p_dev: the struct pcmcia_device which we need to loop for. 886 * @p_dev: the struct pcmcia_device which we need to loop for.
897 * @conf_check: function to call for each configuration option. 887 * @conf_check: function to call for each configuration option.
@@ -913,48 +903,174 @@ int pcmcia_loop_config(struct pcmcia_device *p_dev,
913 void *priv_data) 903 void *priv_data)
914{ 904{
915 struct pcmcia_cfg_mem *cfg_mem; 905 struct pcmcia_cfg_mem *cfg_mem;
916
917 tuple_t *tuple;
918 int ret; 906 int ret;
919 unsigned int vcc;
920 907
921 cfg_mem = kzalloc(sizeof(struct pcmcia_cfg_mem), GFP_KERNEL); 908 cfg_mem = kzalloc(sizeof(struct pcmcia_cfg_mem), GFP_KERNEL);
922 if (cfg_mem == NULL) 909 if (cfg_mem == NULL)
923 return -ENOMEM; 910 return -ENOMEM;
924 911
925 /* get the current Vcc setting */ 912 cfg_mem->p_dev = p_dev;
926 vcc = p_dev->socket->socket.Vcc; 913 cfg_mem->conf_check = conf_check;
914 cfg_mem->priv_data = priv_data;
927 915
928 tuple = &cfg_mem->tuple; 916 ret = pccard_loop_tuple(p_dev->socket, p_dev->func,
929 tuple->TupleData = cfg_mem->buf; 917 CISTPL_CFTABLE_ENTRY, &cfg_mem->parse,
930 tuple->TupleDataMax = 255; 918 cfg_mem, pcmcia_do_loop_config);
931 tuple->TupleOffset = 0;
932 tuple->DesiredTuple = CISTPL_CFTABLE_ENTRY;
933 tuple->Attributes = 0;
934 919
935 ret = pcmcia_get_first_tuple(p_dev, tuple); 920 kfree(cfg_mem);
936 while (!ret) { 921 return ret;
937 cistpl_cftable_entry_t *cfg = &cfg_mem->parse.cftable_entry; 922}
923EXPORT_SYMBOL(pcmcia_loop_config);
924
925
926struct pcmcia_loop_mem {
927 struct pcmcia_device *p_dev;
928 void *priv_data;
929 int (*loop_tuple) (struct pcmcia_device *p_dev,
930 tuple_t *tuple,
931 void *priv_data);
932};
933
934/**
935 * pcmcia_do_loop_tuple() - internal helper for pcmcia_loop_config()
936 *
937 * pcmcia_do_loop_tuple() is the internal callback for the call from
938 * pcmcia_loop_tuple() to pccard_loop_tuple(). Data is transferred
939 * by a struct pcmcia_cfg_mem.
940 */
941static int pcmcia_do_loop_tuple(tuple_t *tuple, cisparse_t *parse, void *priv)
942{
943 struct pcmcia_loop_mem *loop = priv;
944
945 return loop->loop_tuple(loop->p_dev, tuple, loop->priv_data);
946};
947
948/**
949 * pcmcia_loop_tuple() - loop over tuples in the CIS
950 * @p_dev: the struct pcmcia_device which we need to loop for.
951 * @code: which CIS code shall we look for?
952 * @priv_data: private data to be passed to the loop_tuple function.
953 * @loop_tuple: function to call for each CIS entry of type @function. IT
954 * gets passed the raw tuple and @priv_data.
955 *
956 * pcmcia_loop_tuple() loops over all CIS entries of type @function, and
957 * calls the @loop_tuple function for each entry. If the call to @loop_tuple
958 * returns 0, the loop exits. Returns 0 on success or errorcode otherwise.
959 */
960int pcmcia_loop_tuple(struct pcmcia_device *p_dev, cisdata_t code,
961 int (*loop_tuple) (struct pcmcia_device *p_dev,
962 tuple_t *tuple,
963 void *priv_data),
964 void *priv_data)
965{
966 struct pcmcia_loop_mem loop = {
967 .p_dev = p_dev,
968 .loop_tuple = loop_tuple,
969 .priv_data = priv_data};
938 970
939 if (pcmcia_get_tuple_data(p_dev, tuple)) 971 return pccard_loop_tuple(p_dev->socket, p_dev->func, code, NULL,
940 goto next_entry; 972 &loop, pcmcia_do_loop_tuple);
973};
974EXPORT_SYMBOL(pcmcia_loop_tuple);
941 975
942 if (pcmcia_parse_tuple(tuple, &cfg_mem->parse))
943 goto next_entry;
944 976
945 /* default values */ 977struct pcmcia_loop_get {
946 p_dev->conf.ConfigIndex = cfg->index; 978 size_t len;
947 if (cfg->flags & CISTPL_CFTABLE_DEFAULT) 979 cisdata_t **buf;
948 cfg_mem->dflt = *cfg; 980};
949 981
950 ret = conf_check(p_dev, cfg, &cfg_mem->dflt, vcc, priv_data); 982/**
951 if (!ret) 983 * pcmcia_do_get_tuple() - internal helper for pcmcia_get_tuple()
952 break; 984 *
985 * pcmcia_do_get_tuple() is the internal callback for the call from
986 * pcmcia_get_tuple() to pcmcia_loop_tuple(). As we're only interested in
987 * the first tuple, return 0 unconditionally. Create a memory buffer large
988 * enough to hold the content of the tuple, and fill it with the tuple data.
989 * The caller is responsible to free the buffer.
990 */
991static int pcmcia_do_get_tuple(struct pcmcia_device *p_dev, tuple_t *tuple,
992 void *priv)
993{
994 struct pcmcia_loop_get *get = priv;
995
996 *get->buf = kzalloc(tuple->TupleDataLen, GFP_KERNEL);
997 if (*get->buf) {
998 get->len = tuple->TupleDataLen;
999 memcpy(*get->buf, tuple->TupleData, tuple->TupleDataLen);
1000 } else
1001 dev_dbg(&p_dev->dev, "do_get_tuple: out of memory\n");
1002 return 0;
1003};
953 1004
954next_entry: 1005/**
955 ret = pcmcia_get_next_tuple(p_dev, tuple); 1006 * pcmcia_get_tuple() - get first tuple from CIS
1007 * @p_dev: the struct pcmcia_device which we need to loop for.
1008 * @code: which CIS code shall we look for?
1009 * @buf: pointer to store the buffer to.
1010 *
1011 * pcmcia_get_tuple() gets the content of the first CIS entry of type @code.
1012 * It returns the buffer length (or zero). The caller is responsible to free
1013 * the buffer passed in @buf.
1014 */
1015size_t pcmcia_get_tuple(struct pcmcia_device *p_dev, cisdata_t code,
1016 unsigned char **buf)
1017{
1018 struct pcmcia_loop_get get = {
1019 .len = 0,
1020 .buf = buf,
1021 };
1022
1023 *get.buf = NULL;
1024 pcmcia_loop_tuple(p_dev, code, pcmcia_do_get_tuple, &get);
1025
1026 return get.len;
1027};
1028EXPORT_SYMBOL(pcmcia_get_tuple);
1029
1030
1031/**
1032 * pcmcia_do_get_mac() - internal helper for pcmcia_get_mac_from_cis()
1033 *
1034 * pcmcia_do_get_mac() is the internal callback for the call from
1035 * pcmcia_get_mac_from_cis() to pcmcia_loop_tuple(). We check whether the
1036 * tuple contains a proper LAN_NODE_ID of length 6, and copy the data
1037 * to struct net_device->dev_addr[i].
1038 */
1039static int pcmcia_do_get_mac(struct pcmcia_device *p_dev, tuple_t *tuple,
1040 void *priv)
1041{
1042 struct net_device *dev = priv;
1043 int i;
1044
1045 if (tuple->TupleData[0] != CISTPL_FUNCE_LAN_NODE_ID)
1046 return -EINVAL;
1047 if (tuple->TupleDataLen < ETH_ALEN + 2) {
1048 dev_warn(&p_dev->dev, "Invalid CIS tuple length for "
1049 "LAN_NODE_ID\n");
1050 return -EINVAL;
956 } 1051 }
957 1052
958 return ret; 1053 if (tuple->TupleData[1] != ETH_ALEN) {
959} 1054 dev_warn(&p_dev->dev, "Invalid header for LAN_NODE_ID\n");
960EXPORT_SYMBOL(pcmcia_loop_config); 1055 return -EINVAL;
1056 }
1057 for (i = 0; i < 6; i++)
1058 dev->dev_addr[i] = tuple->TupleData[i+2];
1059 return 0;
1060};
1061
1062/**
1063 * pcmcia_get_mac_from_cis() - read out MAC address from CISTPL_FUNCE
1064 * @p_dev: the struct pcmcia_device for which we want the address.
1065 * @dev: a properly prepared struct net_device to store the info to.
1066 *
1067 * pcmcia_get_mac_from_cis() reads out the hardware MAC address from
1068 * CISTPL_FUNCE and stores it into struct net_device *dev->dev_addr which
1069 * must be set up properly by the driver (see examples!).
1070 */
1071int pcmcia_get_mac_from_cis(struct pcmcia_device *p_dev, struct net_device *dev)
1072{
1073 return pcmcia_loop_tuple(p_dev, CISTPL_FUNCE, pcmcia_do_get_mac, dev);
1074};
1075EXPORT_SYMBOL(pcmcia_get_mac_from_cis);
1076
diff --git a/drivers/pcmcia/pd6729.c b/drivers/pcmcia/pd6729.c
index 70a33468bcd0..e1741cd875aa 100644
--- a/drivers/pcmcia/pd6729.c
+++ b/drivers/pcmcia/pd6729.c
@@ -213,7 +213,8 @@ static irqreturn_t pd6729_interrupt(int irq, void *dev)
213 213
214 if (csc & I365_CSC_DETECT) { 214 if (csc & I365_CSC_DETECT) {
215 events |= SS_DETECT; 215 events |= SS_DETECT;
216 dprintk("Card detected in socket %i!\n", i); 216 dev_vdbg(&socket[i].socket.dev,
217 "Card detected in socket %i!\n", i);
217 } 218 }
218 219
219 if (indirect_read(&socket[i], I365_INTCTL) 220 if (indirect_read(&socket[i], I365_INTCTL)
@@ -331,11 +332,11 @@ static int pd6729_set_socket(struct pcmcia_socket *sock, socket_state_t *state)
331 reg = I365_PWR_NORESET; /* default: disable resetdrv on resume */ 332 reg = I365_PWR_NORESET; /* default: disable resetdrv on resume */
332 333
333 if (state->flags & SS_PWR_AUTO) { 334 if (state->flags & SS_PWR_AUTO) {
334 dprintk("Auto power\n"); 335 dev_dbg(&sock->dev, "Auto power\n");
335 reg |= I365_PWR_AUTO; /* automatic power mngmnt */ 336 reg |= I365_PWR_AUTO; /* automatic power mngmnt */
336 } 337 }
337 if (state->flags & SS_OUTPUT_ENA) { 338 if (state->flags & SS_OUTPUT_ENA) {
338 dprintk("Power Enabled\n"); 339 dev_dbg(&sock->dev, "Power Enabled\n");
339 reg |= I365_PWR_OUT; /* enable power */ 340 reg |= I365_PWR_OUT; /* enable power */
340 } 341 }
341 342
@@ -343,40 +344,44 @@ static int pd6729_set_socket(struct pcmcia_socket *sock, socket_state_t *state)
343 case 0: 344 case 0:
344 break; 345 break;
345 case 33: 346 case 33:
346 dprintk("setting voltage to Vcc to 3.3V on socket %i\n", 347 dev_dbg(&sock->dev,
348 "setting voltage to Vcc to 3.3V on socket %i\n",
347 socket->number); 349 socket->number);
348 reg |= I365_VCC_5V; 350 reg |= I365_VCC_5V;
349 indirect_setbit(socket, PD67_MISC_CTL_1, PD67_MC1_VCC_3V); 351 indirect_setbit(socket, PD67_MISC_CTL_1, PD67_MC1_VCC_3V);
350 break; 352 break;
351 case 50: 353 case 50:
352 dprintk("setting voltage to Vcc to 5V on socket %i\n", 354 dev_dbg(&sock->dev,
355 "setting voltage to Vcc to 5V on socket %i\n",
353 socket->number); 356 socket->number);
354 reg |= I365_VCC_5V; 357 reg |= I365_VCC_5V;
355 indirect_resetbit(socket, PD67_MISC_CTL_1, PD67_MC1_VCC_3V); 358 indirect_resetbit(socket, PD67_MISC_CTL_1, PD67_MC1_VCC_3V);
356 break; 359 break;
357 default: 360 default:
358 dprintk("pd6729: pd6729_set_socket called with " 361 dev_dbg(&sock->dev,
359 "invalid VCC power value: %i\n", 362 "pd6729_set_socket called with invalid VCC power "
360 state->Vcc); 363 "value: %i\n", state->Vcc);
361 return -EINVAL; 364 return -EINVAL;
362 } 365 }
363 366
364 switch (state->Vpp) { 367 switch (state->Vpp) {
365 case 0: 368 case 0:
366 dprintk("not setting Vpp on socket %i\n", socket->number); 369 dev_dbg(&sock->dev, "not setting Vpp on socket %i\n",
370 socket->number);
367 break; 371 break;
368 case 33: 372 case 33:
369 case 50: 373 case 50:
370 dprintk("setting Vpp to Vcc for socket %i\n", socket->number); 374 dev_dbg(&sock->dev, "setting Vpp to Vcc for socket %i\n",
375 socket->number);
371 reg |= I365_VPP1_5V; 376 reg |= I365_VPP1_5V;
372 break; 377 break;
373 case 120: 378 case 120:
374 dprintk("setting Vpp to 12.0\n"); 379 dev_dbg(&sock->dev, "setting Vpp to 12.0\n");
375 reg |= I365_VPP1_12V; 380 reg |= I365_VPP1_12V;
376 break; 381 break;
377 default: 382 default:
378 dprintk("pd6729: pd6729_set_socket called with invalid VPP power value: %i\n", 383 dev_dbg(&sock->dev, "pd6729: pd6729_set_socket called with "
379 state->Vpp); 384 "invalid VPP power value: %i\n", state->Vpp);
380 return -EINVAL; 385 return -EINVAL;
381 } 386 }
382 387
@@ -438,7 +443,7 @@ static int pd6729_set_io_map(struct pcmcia_socket *sock,
438 443
439 /* Check error conditions */ 444 /* Check error conditions */
440 if (map > 1) { 445 if (map > 1) {
441 dprintk("pd6729_set_io_map with invalid map"); 446 dev_dbg(&sock->dev, "pd6729_set_io_map with invalid map\n");
442 return -EINVAL; 447 return -EINVAL;
443 } 448 }
444 449
@@ -446,7 +451,7 @@ static int pd6729_set_io_map(struct pcmcia_socket *sock,
446 if (indirect_read(socket, I365_ADDRWIN) & I365_ENA_IO(map)) 451 if (indirect_read(socket, I365_ADDRWIN) & I365_ENA_IO(map))
447 indirect_resetbit(socket, I365_ADDRWIN, I365_ENA_IO(map)); 452 indirect_resetbit(socket, I365_ADDRWIN, I365_ENA_IO(map));
448 453
449 /* dprintk("set_io_map: Setting range to %x - %x\n", 454 /* dev_dbg(&sock->dev, "set_io_map: Setting range to %x - %x\n",
450 io->start, io->stop);*/ 455 io->start, io->stop);*/
451 456
452 /* write the new values */ 457 /* write the new values */
@@ -478,12 +483,12 @@ static int pd6729_set_mem_map(struct pcmcia_socket *sock,
478 483
479 map = mem->map; 484 map = mem->map;
480 if (map > 4) { 485 if (map > 4) {
481 printk("pd6729_set_mem_map: invalid map"); 486 dev_warn(&sock->dev, "invalid map requested\n");
482 return -EINVAL; 487 return -EINVAL;
483 } 488 }
484 489
485 if ((mem->res->start > mem->res->end) || (mem->speed > 1000)) { 490 if ((mem->res->start > mem->res->end) || (mem->speed > 1000)) {
486 printk("pd6729_set_mem_map: invalid address / speed"); 491 dev_warn(&sock->dev, "invalid invalid address / speed\n");
487 return -EINVAL; 492 return -EINVAL;
488 } 493 }
489 494
@@ -529,12 +534,12 @@ static int pd6729_set_mem_map(struct pcmcia_socket *sock,
529 if (mem->flags & MAP_WRPROT) 534 if (mem->flags & MAP_WRPROT)
530 i |= I365_MEM_WRPROT; 535 i |= I365_MEM_WRPROT;
531 if (mem->flags & MAP_ATTRIB) { 536 if (mem->flags & MAP_ATTRIB) {
532 /* dprintk("requesting attribute memory for socket %i\n", 537 /* dev_dbg(&sock->dev, "requesting attribute memory for "
533 socket->number);*/ 538 "socket %i\n", socket->number);*/
534 i |= I365_MEM_REG; 539 i |= I365_MEM_REG;
535 } else { 540 } else {
536 /* dprintk("requesting normal memory for socket %i\n", 541 /* dev_dbg(&sock->dev, "requesting normal memory for "
537 socket->number);*/ 542 "socket %i\n", socket->number);*/
538 } 543 }
539 indirect_write16(socket, base + I365_W_OFF, i); 544 indirect_write16(socket, base + I365_W_OFF, i);
540 545
@@ -577,7 +582,7 @@ static struct pccard_operations pd6729_operations = {
577 582
578static irqreturn_t pd6729_test(int irq, void *dev) 583static irqreturn_t pd6729_test(int irq, void *dev)
579{ 584{
580 dprintk("-> hit on irq %d\n", irq); 585 pr_devel("-> hit on irq %d\n", irq);
581 return IRQ_HANDLED; 586 return IRQ_HANDLED;
582} 587}
583 588
@@ -642,13 +647,13 @@ static int __devinit pd6729_pci_probe(struct pci_dev *dev,
642 goto err_out_free_mem; 647 goto err_out_free_mem;
643 648
644 if (!pci_resource_start(dev, 0)) { 649 if (!pci_resource_start(dev, 0)) {
645 printk(KERN_INFO "pd6729: refusing to load the driver " 650 dev_warn(&dev->dev, "refusing to load the driver as the "
646 "as the io_base is 0.\n"); 651 "io_base is NULL.\n");
647 goto err_out_free_mem; 652 goto err_out_free_mem;
648 } 653 }
649 654
650 printk(KERN_INFO "pd6729: Cirrus PD6729 PCI to PCMCIA Bridge " 655 dev_info(&dev->dev, "Cirrus PD6729 PCI to PCMCIA Bridge at 0x%llx "
651 "at 0x%llx on irq %d\n", 656 "on irq %d\n",
652 (unsigned long long)pci_resource_start(dev, 0), dev->irq); 657 (unsigned long long)pci_resource_start(dev, 0), dev->irq);
653 /* 658 /*
654 * Since we have no memory BARs some firmware may not 659 * Since we have no memory BARs some firmware may not
@@ -656,14 +661,14 @@ static int __devinit pd6729_pci_probe(struct pci_dev *dev,
656 */ 661 */
657 pci_read_config_byte(dev, PCI_COMMAND, &configbyte); 662 pci_read_config_byte(dev, PCI_COMMAND, &configbyte);
658 if (!(configbyte & PCI_COMMAND_MEMORY)) { 663 if (!(configbyte & PCI_COMMAND_MEMORY)) {
659 printk(KERN_DEBUG "pd6729: Enabling PCI_COMMAND_MEMORY.\n"); 664 dev_dbg(&dev->dev, "pd6729: Enabling PCI_COMMAND_MEMORY.\n");
660 configbyte |= PCI_COMMAND_MEMORY; 665 configbyte |= PCI_COMMAND_MEMORY;
661 pci_write_config_byte(dev, PCI_COMMAND, configbyte); 666 pci_write_config_byte(dev, PCI_COMMAND, configbyte);
662 } 667 }
663 668
664 ret = pci_request_regions(dev, "pd6729"); 669 ret = pci_request_regions(dev, "pd6729");
665 if (ret) { 670 if (ret) {
666 printk(KERN_INFO "pd6729: pci request region failed.\n"); 671 dev_warn(&dev->dev, "pci request region failed.\n");
667 goto err_out_disable; 672 goto err_out_disable;
668 } 673 }
669 674
@@ -672,7 +677,7 @@ static int __devinit pd6729_pci_probe(struct pci_dev *dev,
672 677
673 mask = pd6729_isa_scan(); 678 mask = pd6729_isa_scan();
674 if (irq_mode == 0 && mask == 0) { 679 if (irq_mode == 0 && mask == 0) {
675 printk(KERN_INFO "pd6729: no ISA interrupt is available.\n"); 680 dev_warn(&dev->dev, "no ISA interrupt is available.\n");
676 goto err_out_free_res; 681 goto err_out_free_res;
677 } 682 }
678 683
@@ -697,8 +702,8 @@ static int __devinit pd6729_pci_probe(struct pci_dev *dev,
697 /* Register the interrupt handler */ 702 /* Register the interrupt handler */
698 if ((ret = request_irq(dev->irq, pd6729_interrupt, IRQF_SHARED, 703 if ((ret = request_irq(dev->irq, pd6729_interrupt, IRQF_SHARED,
699 "pd6729", socket))) { 704 "pd6729", socket))) {
700 printk(KERN_ERR "pd6729: Failed to register irq %d, " 705 dev_err(&dev->dev, "Failed to register irq %d\n",
701 "aborting\n", dev->irq); 706 dev->irq);
702 goto err_out_free_res; 707 goto err_out_free_res;
703 } 708 }
704 } else { 709 } else {
@@ -713,8 +718,7 @@ static int __devinit pd6729_pci_probe(struct pci_dev *dev,
713 for (i = 0; i < MAX_SOCKETS; i++) { 718 for (i = 0; i < MAX_SOCKETS; i++) {
714 ret = pcmcia_register_socket(&socket[i].socket); 719 ret = pcmcia_register_socket(&socket[i].socket);
715 if (ret) { 720 if (ret) {
716 printk(KERN_INFO "pd6729: pcmcia_register_socket " 721 dev_warn(&dev->dev, "pcmcia_register_socket failed.\n");
717 "failed.\n");
718 for (j = 0; j < i ; j++) 722 for (j = 0; j < i ; j++)
719 pcmcia_unregister_socket(&socket[j].socket); 723 pcmcia_unregister_socket(&socket[j].socket);
720 goto err_out_free_res2; 724 goto err_out_free_res2;
diff --git a/drivers/pcmcia/pd6729.h b/drivers/pcmcia/pd6729.h
index f392e458cdfd..41418d394c55 100644
--- a/drivers/pcmcia/pd6729.h
+++ b/drivers/pcmcia/pd6729.h
@@ -1,13 +1,6 @@
1#ifndef _INCLUDE_GUARD_PD6729_H_ 1#ifndef _INCLUDE_GUARD_PD6729_H_
2#define _INCLUDE_GUARD_PD6729_H_ 2#define _INCLUDE_GUARD_PD6729_H_
3 3
4/* Debuging defines */
5#ifdef NOTRACE
6#define dprintk(fmt, args...) printk(fmt , ## args)
7#else
8#define dprintk(fmt, args...) do {} while (0)
9#endif
10
11/* Flags for I365_GENCTL */ 4/* Flags for I365_GENCTL */
12#define I365_DF_VS1 0x40 /* DF-step Voltage Sense */ 5#define I365_DF_VS1 0x40 /* DF-step Voltage Sense */
13#define I365_DF_VS2 0x80 6#define I365_DF_VS2 0x80
diff --git a/drivers/pcmcia/pxa2xx_base.c b/drivers/pcmcia/pxa2xx_base.c
index 0e35acb1366b..84dde7768ad5 100644
--- a/drivers/pcmcia/pxa2xx_base.c
+++ b/drivers/pcmcia/pxa2xx_base.c
@@ -228,9 +228,43 @@ static const char *skt_names[] = {
228#define SKT_DEV_INFO_SIZE(n) \ 228#define SKT_DEV_INFO_SIZE(n) \
229 (sizeof(struct skt_dev_info) + (n)*sizeof(struct soc_pcmcia_socket)) 229 (sizeof(struct skt_dev_info) + (n)*sizeof(struct soc_pcmcia_socket))
230 230
231int pxa2xx_drv_pcmcia_add_one(struct soc_pcmcia_socket *skt)
232{
233 skt->res_skt.start = _PCMCIA(skt->nr);
234 skt->res_skt.end = _PCMCIA(skt->nr) + PCMCIASp - 1;
235 skt->res_skt.name = skt_names[skt->nr];
236 skt->res_skt.flags = IORESOURCE_MEM;
237
238 skt->res_io.start = _PCMCIAIO(skt->nr);
239 skt->res_io.end = _PCMCIAIO(skt->nr) + PCMCIAIOSp - 1;
240 skt->res_io.name = "io";
241 skt->res_io.flags = IORESOURCE_MEM | IORESOURCE_BUSY;
242
243 skt->res_mem.start = _PCMCIAMem(skt->nr);
244 skt->res_mem.end = _PCMCIAMem(skt->nr) + PCMCIAMemSp - 1;
245 skt->res_mem.name = "memory";
246 skt->res_mem.flags = IORESOURCE_MEM;
247
248 skt->res_attr.start = _PCMCIAAttr(skt->nr);
249 skt->res_attr.end = _PCMCIAAttr(skt->nr) + PCMCIAAttrSp - 1;
250 skt->res_attr.name = "attribute";
251 skt->res_attr.flags = IORESOURCE_MEM;
252
253 return soc_pcmcia_add_one(skt);
254}
255
256void pxa2xx_drv_pcmcia_ops(struct pcmcia_low_level *ops)
257{
258 /* Provide our PXA2xx specific timing routines. */
259 ops->set_timing = pxa2xx_pcmcia_set_timing;
260#ifdef CONFIG_CPU_FREQ
261 ops->frequency_change = pxa2xx_pcmcia_frequency_change;
262#endif
263}
264
231int __pxa2xx_drv_pcmcia_probe(struct device *dev) 265int __pxa2xx_drv_pcmcia_probe(struct device *dev)
232{ 266{
233 int i, ret; 267 int i, ret = 0;
234 struct pcmcia_low_level *ops; 268 struct pcmcia_low_level *ops;
235 struct skt_dev_info *sinfo; 269 struct skt_dev_info *sinfo;
236 struct soc_pcmcia_socket *skt; 270 struct soc_pcmcia_socket *skt;
@@ -240,6 +274,8 @@ int __pxa2xx_drv_pcmcia_probe(struct device *dev)
240 274
241 ops = (struct pcmcia_low_level *)dev->platform_data; 275 ops = (struct pcmcia_low_level *)dev->platform_data;
242 276
277 pxa2xx_drv_pcmcia_ops(ops);
278
243 sinfo = kzalloc(SKT_DEV_INFO_SIZE(ops->nr), GFP_KERNEL); 279 sinfo = kzalloc(SKT_DEV_INFO_SIZE(ops->nr), GFP_KERNEL);
244 if (!sinfo) 280 if (!sinfo)
245 return -ENOMEM; 281 return -ENOMEM;
@@ -250,40 +286,25 @@ int __pxa2xx_drv_pcmcia_probe(struct device *dev)
250 for (i = 0; i < ops->nr; i++) { 286 for (i = 0; i < ops->nr; i++) {
251 skt = &sinfo->skt[i]; 287 skt = &sinfo->skt[i];
252 288
253 skt->nr = ops->first + i; 289 skt->nr = ops->first + i;
254 skt->irq = NO_IRQ; 290 skt->ops = ops;
255 291 skt->socket.owner = ops->owner;
256 skt->res_skt.start = _PCMCIA(skt->nr); 292 skt->socket.dev.parent = dev;
257 skt->res_skt.end = _PCMCIA(skt->nr) + PCMCIASp - 1; 293 skt->socket.pci_irq = NO_IRQ;
258 skt->res_skt.name = skt_names[skt->nr];
259 skt->res_skt.flags = IORESOURCE_MEM;
260
261 skt->res_io.start = _PCMCIAIO(skt->nr);
262 skt->res_io.end = _PCMCIAIO(skt->nr) + PCMCIAIOSp - 1;
263 skt->res_io.name = "io";
264 skt->res_io.flags = IORESOURCE_MEM | IORESOURCE_BUSY;
265 294
266 skt->res_mem.start = _PCMCIAMem(skt->nr); 295 ret = pxa2xx_drv_pcmcia_add_one(skt);
267 skt->res_mem.end = _PCMCIAMem(skt->nr) + PCMCIAMemSp - 1; 296 if (ret)
268 skt->res_mem.name = "memory"; 297 break;
269 skt->res_mem.flags = IORESOURCE_MEM;
270
271 skt->res_attr.start = _PCMCIAAttr(skt->nr);
272 skt->res_attr.end = _PCMCIAAttr(skt->nr) + PCMCIAAttrSp - 1;
273 skt->res_attr.name = "attribute";
274 skt->res_attr.flags = IORESOURCE_MEM;
275 } 298 }
276 299
277 /* Provide our PXA2xx specific timing routines. */ 300 if (ret) {
278 ops->set_timing = pxa2xx_pcmcia_set_timing; 301 while (--i >= 0)
279#ifdef CONFIG_CPU_FREQ 302 soc_pcmcia_remove_one(&sinfo->skt[i]);
280 ops->frequency_change = pxa2xx_pcmcia_frequency_change; 303 kfree(sinfo);
281#endif 304 } else {
282
283 ret = soc_common_drv_pcmcia_probe(dev, ops, sinfo);
284
285 if (!ret)
286 pxa2xx_configure_sockets(dev); 305 pxa2xx_configure_sockets(dev);
306 dev_set_drvdata(dev, sinfo);
307 }
287 308
288 return ret; 309 return ret;
289} 310}
@@ -297,7 +318,16 @@ static int pxa2xx_drv_pcmcia_probe(struct platform_device *dev)
297 318
298static int pxa2xx_drv_pcmcia_remove(struct platform_device *dev) 319static int pxa2xx_drv_pcmcia_remove(struct platform_device *dev)
299{ 320{
300 return soc_common_drv_pcmcia_remove(&dev->dev); 321 struct skt_dev_info *sinfo = platform_get_drvdata(dev);
322 int i;
323
324 platform_set_drvdata(dev, NULL);
325
326 for (i = 0; i < sinfo->nskt; i++)
327 soc_pcmcia_remove_one(&sinfo->skt[i]);
328
329 kfree(sinfo);
330 return 0;
301} 331}
302 332
303static int pxa2xx_drv_pcmcia_suspend(struct device *dev) 333static int pxa2xx_drv_pcmcia_suspend(struct device *dev)
diff --git a/drivers/pcmcia/pxa2xx_base.h b/drivers/pcmcia/pxa2xx_base.h
index 235d681652c3..cb5efaec886f 100644
--- a/drivers/pcmcia/pxa2xx_base.h
+++ b/drivers/pcmcia/pxa2xx_base.h
@@ -1,3 +1,6 @@
1/* temporary measure */ 1/* temporary measure */
2extern int __pxa2xx_drv_pcmcia_probe(struct device *); 2extern int __pxa2xx_drv_pcmcia_probe(struct device *);
3 3
4int pxa2xx_drv_pcmcia_add_one(struct soc_pcmcia_socket *skt);
5void pxa2xx_drv_pcmcia_ops(struct pcmcia_low_level *ops);
6
diff --git a/drivers/pcmcia/pxa2xx_cm_x255.c b/drivers/pcmcia/pxa2xx_cm_x255.c
index 5143a760153b..05913d0bbdbe 100644
--- a/drivers/pcmcia/pxa2xx_cm_x255.c
+++ b/drivers/pcmcia/pxa2xx_cm_x255.c
@@ -44,7 +44,7 @@ static int cmx255_pcmcia_hw_init(struct soc_pcmcia_socket *skt)
44 return ret; 44 return ret;
45 gpio_direction_output(GPIO_PCMCIA_RESET, 0); 45 gpio_direction_output(GPIO_PCMCIA_RESET, 0);
46 46
47 skt->irq = skt->nr == 0 ? PCMCIA_S0_RDYINT : PCMCIA_S1_RDYINT; 47 skt->socket.pci_irq = skt->nr == 0 ? PCMCIA_S0_RDYINT : PCMCIA_S1_RDYINT;
48 ret = soc_pcmcia_request_irqs(skt, irqs, ARRAY_SIZE(irqs)); 48 ret = soc_pcmcia_request_irqs(skt, irqs, ARRAY_SIZE(irqs));
49 if (!ret) 49 if (!ret)
50 gpio_free(GPIO_PCMCIA_RESET); 50 gpio_free(GPIO_PCMCIA_RESET);
diff --git a/drivers/pcmcia/pxa2xx_cm_x270.c b/drivers/pcmcia/pxa2xx_cm_x270.c
index a7b943d01e34..5662646b84da 100644
--- a/drivers/pcmcia/pxa2xx_cm_x270.c
+++ b/drivers/pcmcia/pxa2xx_cm_x270.c
@@ -38,7 +38,7 @@ static int cmx270_pcmcia_hw_init(struct soc_pcmcia_socket *skt)
38 return ret; 38 return ret;
39 gpio_direction_output(GPIO_PCMCIA_RESET, 0); 39 gpio_direction_output(GPIO_PCMCIA_RESET, 0);
40 40
41 skt->irq = PCMCIA_S0_RDYINT; 41 skt->socket.pci_irq = PCMCIA_S0_RDYINT;
42 ret = soc_pcmcia_request_irqs(skt, irqs, ARRAY_SIZE(irqs)); 42 ret = soc_pcmcia_request_irqs(skt, irqs, ARRAY_SIZE(irqs));
43 if (!ret) 43 if (!ret)
44 gpio_free(GPIO_PCMCIA_RESET); 44 gpio_free(GPIO_PCMCIA_RESET);
diff --git a/drivers/pcmcia/pxa2xx_e740.c b/drivers/pcmcia/pxa2xx_e740.c
index d09c0dc4a31a..8bfbd4dca131 100644
--- a/drivers/pcmcia/pxa2xx_e740.c
+++ b/drivers/pcmcia/pxa2xx_e740.c
@@ -38,7 +38,7 @@ static struct pcmcia_irqs cd_irqs[] = {
38 38
39static int e740_pcmcia_hw_init(struct soc_pcmcia_socket *skt) 39static int e740_pcmcia_hw_init(struct soc_pcmcia_socket *skt)
40{ 40{
41 skt->irq = skt->nr == 0 ? IRQ_GPIO(GPIO_E740_PCMCIA_RDY0) : 41 skt->socket.pci_irq = skt->nr == 0 ? IRQ_GPIO(GPIO_E740_PCMCIA_RDY0) :
42 IRQ_GPIO(GPIO_E740_PCMCIA_RDY1); 42 IRQ_GPIO(GPIO_E740_PCMCIA_RDY1);
43 43
44 return soc_pcmcia_request_irqs(skt, &cd_irqs[skt->nr], 1); 44 return soc_pcmcia_request_irqs(skt, &cd_irqs[skt->nr], 1);
diff --git a/drivers/pcmcia/pxa2xx_lubbock.c b/drivers/pcmcia/pxa2xx_lubbock.c
index 6cbb1b1f7cfd..b9f8c8fb42bd 100644
--- a/drivers/pcmcia/pxa2xx_lubbock.c
+++ b/drivers/pcmcia/pxa2xx_lubbock.c
@@ -32,6 +32,7 @@ static int
32lubbock_pcmcia_configure_socket(struct soc_pcmcia_socket *skt, 32lubbock_pcmcia_configure_socket(struct soc_pcmcia_socket *skt,
33 const socket_state_t *state) 33 const socket_state_t *state)
34{ 34{
35 struct sa1111_pcmcia_socket *s = to_skt(skt);
35 unsigned int pa_dwr_mask, pa_dwr_set, misc_mask, misc_set; 36 unsigned int pa_dwr_mask, pa_dwr_set, misc_mask, misc_set;
36 int ret = 0; 37 int ret = 0;
37 38
@@ -149,7 +150,7 @@ lubbock_pcmcia_configure_socket(struct soc_pcmcia_socket *skt,
149 150
150 if (ret == 0) { 151 if (ret == 0) {
151 lubbock_set_misc_wr(misc_mask, misc_set); 152 lubbock_set_misc_wr(misc_mask, misc_set);
152 sa1111_set_io(SA1111_DEV(skt->dev), pa_dwr_mask, pa_dwr_set); 153 sa1111_set_io(s->dev, pa_dwr_mask, pa_dwr_set);
153 } 154 }
154 155
155#if 1 156#if 1
@@ -175,7 +176,7 @@ lubbock_pcmcia_configure_socket(struct soc_pcmcia_socket *skt,
175 * Switch to 5V, Configure socket with 5V voltage 176 * Switch to 5V, Configure socket with 5V voltage
176 */ 177 */
177 lubbock_set_misc_wr(misc_mask, 0); 178 lubbock_set_misc_wr(misc_mask, 0);
178 sa1111_set_io(SA1111_DEV(skt->dev), pa_dwr_mask, 0); 179 sa1111_set_io(s->dev, pa_dwr_mask, 0);
179 180
180 /* 181 /*
181 * It takes about 100ms to turn off Vcc. 182 * It takes about 100ms to turn off Vcc.
@@ -200,12 +201,8 @@ lubbock_pcmcia_configure_socket(struct soc_pcmcia_socket *skt,
200 201
201static struct pcmcia_low_level lubbock_pcmcia_ops = { 202static struct pcmcia_low_level lubbock_pcmcia_ops = {
202 .owner = THIS_MODULE, 203 .owner = THIS_MODULE,
203 .hw_init = sa1111_pcmcia_hw_init,
204 .hw_shutdown = sa1111_pcmcia_hw_shutdown,
205 .socket_state = sa1111_pcmcia_socket_state,
206 .configure_socket = lubbock_pcmcia_configure_socket, 204 .configure_socket = lubbock_pcmcia_configure_socket,
207 .socket_init = sa1111_pcmcia_socket_init, 205 .socket_init = sa1111_pcmcia_socket_init,
208 .socket_suspend = sa1111_pcmcia_socket_suspend,
209 .first = 0, 206 .first = 0,
210 .nr = 2, 207 .nr = 2,
211}; 208};
@@ -228,8 +225,9 @@ int pcmcia_lubbock_init(struct sa1111_dev *sadev)
228 /* Set CF Socket 1 power to standby mode. */ 225 /* Set CF Socket 1 power to standby mode. */
229 lubbock_set_misc_wr((1 << 15) | (1 << 14), 0); 226 lubbock_set_misc_wr((1 << 15) | (1 << 14), 0);
230 227
231 sadev->dev.platform_data = &lubbock_pcmcia_ops; 228 pxa2xx_drv_pcmcia_ops(&lubbock_pcmcia_ops);
232 ret = __pxa2xx_drv_pcmcia_probe(&sadev->dev); 229 ret = sa1111_pcmcia_add(sadev, &lubbock_pcmcia_ops,
230 pxa2xx_drv_pcmcia_add_one);
233 } 231 }
234 232
235 return ret; 233 return ret;
diff --git a/drivers/pcmcia/pxa2xx_mainstone.c b/drivers/pcmcia/pxa2xx_mainstone.c
index 1138551ba8f6..92016fe932b4 100644
--- a/drivers/pcmcia/pxa2xx_mainstone.c
+++ b/drivers/pcmcia/pxa2xx_mainstone.c
@@ -44,7 +44,7 @@ static int mst_pcmcia_hw_init(struct soc_pcmcia_socket *skt)
44 * before we enable them as outputs. 44 * before we enable them as outputs.
45 */ 45 */
46 46
47 skt->irq = (skt->nr == 0) ? MAINSTONE_S0_IRQ : MAINSTONE_S1_IRQ; 47 skt->socket.pci_irq = (skt->nr == 0) ? MAINSTONE_S0_IRQ : MAINSTONE_S1_IRQ;
48 return soc_pcmcia_request_irqs(skt, irqs, ARRAY_SIZE(irqs)); 48 return soc_pcmcia_request_irqs(skt, irqs, ARRAY_SIZE(irqs));
49} 49}
50 50
diff --git a/drivers/pcmcia/pxa2xx_palmld.c b/drivers/pcmcia/pxa2xx_palmld.c
index 5ba9b3664a00..6fb6f7f0672e 100644
--- a/drivers/pcmcia/pxa2xx_palmld.c
+++ b/drivers/pcmcia/pxa2xx_palmld.c
@@ -45,7 +45,7 @@ static int palmld_pcmcia_hw_init(struct soc_pcmcia_socket *skt)
45 if (ret) 45 if (ret)
46 goto err4; 46 goto err4;
47 47
48 skt->irq = IRQ_GPIO(GPIO_NR_PALMLD_PCMCIA_READY); 48 skt->socket.pci_irq = IRQ_GPIO(GPIO_NR_PALMLD_PCMCIA_READY);
49 return 0; 49 return 0;
50 50
51err4: 51err4:
diff --git a/drivers/pcmcia/pxa2xx_palmtx.c b/drivers/pcmcia/pxa2xx_palmtx.c
index e07b5c51ec5b..b07b247a399f 100644
--- a/drivers/pcmcia/pxa2xx_palmtx.c
+++ b/drivers/pcmcia/pxa2xx_palmtx.c
@@ -53,7 +53,7 @@ static int palmtx_pcmcia_hw_init(struct soc_pcmcia_socket *skt)
53 if (ret) 53 if (ret)
54 goto err5; 54 goto err5;
55 55
56 skt->irq = gpio_to_irq(GPIO_NR_PALMTX_PCMCIA_READY); 56 skt->socket.pci_irq = gpio_to_irq(GPIO_NR_PALMTX_PCMCIA_READY);
57 return 0; 57 return 0;
58 58
59err5: 59err5:
diff --git a/drivers/pcmcia/pxa2xx_sharpsl.c b/drivers/pcmcia/pxa2xx_sharpsl.c
index bc43f78f6f0b..0ea3b29440e6 100644
--- a/drivers/pcmcia/pxa2xx_sharpsl.c
+++ b/drivers/pcmcia/pxa2xx_sharpsl.c
@@ -66,7 +66,7 @@ static int sharpsl_pcmcia_hw_init(struct soc_pcmcia_socket *skt)
66 } 66 }
67 } 67 }
68 68
69 skt->irq = SCOOP_DEV[skt->nr].irq; 69 skt->socket.pci_irq = SCOOP_DEV[skt->nr].irq;
70 70
71 return 0; 71 return 0;
72} 72}
diff --git a/drivers/pcmcia/pxa2xx_trizeps4.c b/drivers/pcmcia/pxa2xx_trizeps4.c
index e0e5cb339b4a..b7e596620db1 100644
--- a/drivers/pcmcia/pxa2xx_trizeps4.c
+++ b/drivers/pcmcia/pxa2xx_trizeps4.c
@@ -53,7 +53,7 @@ static int trizeps_pcmcia_hw_init(struct soc_pcmcia_socket *skt)
53 gpio_free(GPIO_PRDY); 53 gpio_free(GPIO_PRDY);
54 return -EINVAL; 54 return -EINVAL;
55 } 55 }
56 skt->irq = IRQ_GPIO(GPIO_PRDY); 56 skt->socket.pci_irq = IRQ_GPIO(GPIO_PRDY);
57 break; 57 break;
58 58
59#ifndef CONFIG_MACH_TRIZEPS_CONXS 59#ifndef CONFIG_MACH_TRIZEPS_CONXS
@@ -63,7 +63,7 @@ static int trizeps_pcmcia_hw_init(struct soc_pcmcia_socket *skt)
63 break; 63 break;
64 } 64 }
65 /* release the reset of this card */ 65 /* release the reset of this card */
66 pr_debug("%s: sock %d irq %d\n", __func__, skt->nr, skt->irq); 66 pr_debug("%s: sock %d irq %d\n", __func__, skt->nr, skt->socket.pci_irq);
67 67
68 /* supplementory irqs for the socket */ 68 /* supplementory irqs for the socket */
69 for (i = 0; i < ARRAY_SIZE(irqs); i++) { 69 for (i = 0; i < ARRAY_SIZE(irqs); i++) {
diff --git a/drivers/pcmcia/pxa2xx_viper.c b/drivers/pcmcia/pxa2xx_viper.c
index 17871360fe99..27be2e154df2 100644
--- a/drivers/pcmcia/pxa2xx_viper.c
+++ b/drivers/pcmcia/pxa2xx_viper.c
@@ -40,7 +40,7 @@ static int viper_pcmcia_hw_init(struct soc_pcmcia_socket *skt)
40{ 40{
41 unsigned long flags; 41 unsigned long flags;
42 42
43 skt->irq = gpio_to_irq(VIPER_CF_RDY_GPIO); 43 skt->socket.pci_irq = gpio_to_irq(VIPER_CF_RDY_GPIO);
44 44
45 if (gpio_request(VIPER_CF_CD_GPIO, "CF detect")) 45 if (gpio_request(VIPER_CF_CD_GPIO, "CF detect"))
46 goto err_request_cd; 46 goto err_request_cd;
diff --git a/drivers/pcmcia/rsrc_mgr.c b/drivers/pcmcia/rsrc_mgr.c
index e592e0e0d7ed..de0e770ce6a3 100644
--- a/drivers/pcmcia/rsrc_mgr.c
+++ b/drivers/pcmcia/rsrc_mgr.c
@@ -18,6 +18,7 @@
18#include <pcmcia/cs_types.h> 18#include <pcmcia/cs_types.h>
19#include <pcmcia/ss.h> 19#include <pcmcia/ss.h>
20#include <pcmcia/cs.h> 20#include <pcmcia/cs.h>
21#include <pcmcia/cistpl.h>
21#include "cs_internal.h" 22#include "cs_internal.h"
22 23
23 24
diff --git a/drivers/pcmcia/sa1100_assabet.c b/drivers/pcmcia/sa1100_assabet.c
index ac8aa09ba0da..fd013a1ef47a 100644
--- a/drivers/pcmcia/sa1100_assabet.c
+++ b/drivers/pcmcia/sa1100_assabet.c
@@ -27,7 +27,7 @@ static struct pcmcia_irqs irqs[] = {
27 27
28static int assabet_pcmcia_hw_init(struct soc_pcmcia_socket *skt) 28static int assabet_pcmcia_hw_init(struct soc_pcmcia_socket *skt)
29{ 29{
30 skt->irq = ASSABET_IRQ_GPIO_CF_IRQ; 30 skt->socket.pci_irq = ASSABET_IRQ_GPIO_CF_IRQ;
31 31
32 return soc_pcmcia_request_irqs(skt, irqs, ARRAY_SIZE(irqs)); 32 return soc_pcmcia_request_irqs(skt, irqs, ARRAY_SIZE(irqs));
33} 33}
diff --git a/drivers/pcmcia/sa1100_badge4.c b/drivers/pcmcia/sa1100_badge4.c
index 1ca9737ea79e..1ce53f493bef 100644
--- a/drivers/pcmcia/sa1100_badge4.c
+++ b/drivers/pcmcia/sa1100_badge4.c
@@ -127,13 +127,10 @@ badge4_pcmcia_configure_socket(struct soc_pcmcia_socket *skt, const socket_state
127 127
128static struct pcmcia_low_level badge4_pcmcia_ops = { 128static struct pcmcia_low_level badge4_pcmcia_ops = {
129 .owner = THIS_MODULE, 129 .owner = THIS_MODULE,
130 .hw_init = sa1111_pcmcia_hw_init,
131 .hw_shutdown = sa1111_pcmcia_hw_shutdown,
132 .socket_state = sa1111_pcmcia_socket_state,
133 .configure_socket = badge4_pcmcia_configure_socket, 130 .configure_socket = badge4_pcmcia_configure_socket,
134
135 .socket_init = sa1111_pcmcia_socket_init, 131 .socket_init = sa1111_pcmcia_socket_init,
136 .socket_suspend = sa1111_pcmcia_socket_suspend, 132 .first = 0,
133 .nr = 2,
137}; 134};
138 135
139int pcmcia_badge4_init(struct device *dev) 136int pcmcia_badge4_init(struct device *dev)
@@ -146,7 +143,9 @@ int pcmcia_badge4_init(struct device *dev)
146 __func__, 143 __func__,
147 badge4_pcmvcc, badge4_pcmvpp, badge4_cfvcc); 144 badge4_pcmvcc, badge4_pcmvpp, badge4_cfvcc);
148 145
149 ret = sa11xx_drv_pcmcia_probe(dev, &badge4_pcmcia_ops, 0, 2); 146 sa11xx_drv_pcmcia_ops(&badge4_pcmcia_ops);
147 ret = sa1111_pcmcia_add(dev, &badge4_pcmcia_ops,
148 sa11xx_drv_pcmcia_add_one);
150 } 149 }
151 150
152 return ret; 151 return ret;
diff --git a/drivers/pcmcia/sa1100_cerf.c b/drivers/pcmcia/sa1100_cerf.c
index 63e6bc431a0d..9bf088b17275 100644
--- a/drivers/pcmcia/sa1100_cerf.c
+++ b/drivers/pcmcia/sa1100_cerf.c
@@ -27,7 +27,7 @@ static struct pcmcia_irqs irqs[] = {
27 27
28static int cerf_pcmcia_hw_init(struct soc_pcmcia_socket *skt) 28static int cerf_pcmcia_hw_init(struct soc_pcmcia_socket *skt)
29{ 29{
30 skt->irq = CERF_IRQ_GPIO_CF_IRQ; 30 skt->socket.pci_irq = CERF_IRQ_GPIO_CF_IRQ;
31 31
32 return soc_pcmcia_request_irqs(skt, irqs, ARRAY_SIZE(irqs)); 32 return soc_pcmcia_request_irqs(skt, irqs, ARRAY_SIZE(irqs));
33} 33}
diff --git a/drivers/pcmcia/sa1100_generic.c b/drivers/pcmcia/sa1100_generic.c
index 2d0e99751530..11cc3ba1260a 100644
--- a/drivers/pcmcia/sa1100_generic.c
+++ b/drivers/pcmcia/sa1100_generic.c
@@ -83,7 +83,16 @@ static int sa11x0_drv_pcmcia_probe(struct platform_device *dev)
83 83
84static int sa11x0_drv_pcmcia_remove(struct platform_device *dev) 84static int sa11x0_drv_pcmcia_remove(struct platform_device *dev)
85{ 85{
86 return soc_common_drv_pcmcia_remove(&dev->dev); 86 struct skt_dev_info *sinfo = platform_get_drvdata(dev);
87 int i;
88
89 platform_set_drvdata(dev, NULL);
90
91 for (i = 0; i < sinfo->nskt; i++)
92 soc_pcmcia_remove_one(&sinfo->skt[i]);
93
94 kfree(sinfo);
95 return 0;
87} 96}
88 97
89static int sa11x0_drv_pcmcia_suspend(struct platform_device *dev, 98static int sa11x0_drv_pcmcia_suspend(struct platform_device *dev,
diff --git a/drivers/pcmcia/sa1100_h3600.c b/drivers/pcmcia/sa1100_h3600.c
index 0cc3748f3758..3a121ac697d6 100644
--- a/drivers/pcmcia/sa1100_h3600.c
+++ b/drivers/pcmcia/sa1100_h3600.c
@@ -25,8 +25,8 @@ static struct pcmcia_irqs irqs[] = {
25 25
26static int h3600_pcmcia_hw_init(struct soc_pcmcia_socket *skt) 26static int h3600_pcmcia_hw_init(struct soc_pcmcia_socket *skt)
27{ 27{
28 skt->irq = skt->nr ? IRQ_GPIO_H3600_PCMCIA_IRQ1 28 skt->socket.pci_irq = skt->nr ? IRQ_GPIO_H3600_PCMCIA_IRQ1
29 : IRQ_GPIO_H3600_PCMCIA_IRQ0; 29 : IRQ_GPIO_H3600_PCMCIA_IRQ0;
30 30
31 31
32 return soc_pcmcia_request_irqs(skt, irqs, ARRAY_SIZE(irqs)); 32 return soc_pcmcia_request_irqs(skt, irqs, ARRAY_SIZE(irqs));
diff --git a/drivers/pcmcia/sa1100_jornada720.c b/drivers/pcmcia/sa1100_jornada720.c
index 7eedb42f800c..6bcabee6bde4 100644
--- a/drivers/pcmcia/sa1100_jornada720.c
+++ b/drivers/pcmcia/sa1100_jornada720.c
@@ -22,25 +22,10 @@
22#define SOCKET1_POWER (GPIO_GPIO1 | GPIO_GPIO3) 22#define SOCKET1_POWER (GPIO_GPIO1 | GPIO_GPIO3)
23#define SOCKET1_3V GPIO_GPIO3 23#define SOCKET1_3V GPIO_GPIO3
24 24
25static int jornada720_pcmcia_hw_init(struct soc_pcmcia_socket *skt)
26{
27 unsigned int pin = GPIO_A0 | GPIO_A1 | GPIO_A2 | GPIO_A3;
28
29 /*
30 * What is all this crap for?
31 */
32 GRER |= 0x00000002;
33 /* Set GPIO_A<3:1> to be outputs for PCMCIA/CF power controller: */
34 sa1111_set_io_dir(SA1111_DEV(skt->dev), pin, 0, 0);
35 sa1111_set_io(SA1111_DEV(skt->dev), pin, 0);
36 sa1111_set_sleep_io(SA1111_DEV(skt->dev), pin, 0);
37
38 return sa1111_pcmcia_hw_init(skt);
39}
40
41static int 25static int
42jornada720_pcmcia_configure_socket(struct soc_pcmcia_socket *skt, const socket_state_t *state) 26jornada720_pcmcia_configure_socket(struct soc_pcmcia_socket *skt, const socket_state_t *state)
43{ 27{
28 struct sa1111_pcmcia_socket *s = to_skt(skt);
44 unsigned int pa_dwr_mask, pa_dwr_set; 29 unsigned int pa_dwr_mask, pa_dwr_set;
45 int ret; 30 int ret;
46 31
@@ -97,7 +82,7 @@ jornada720_pcmcia_configure_socket(struct soc_pcmcia_socket *skt, const socket_s
97 unsigned long flags; 82 unsigned long flags;
98 83
99 local_irq_save(flags); 84 local_irq_save(flags);
100 sa1111_set_io(SA1111_DEV(skt->dev), pa_dwr_mask, pa_dwr_set); 85 sa1111_set_io(s->dev, pa_dwr_mask, pa_dwr_set);
101 local_irq_restore(flags); 86 local_irq_restore(flags);
102 } 87 }
103 88
@@ -106,21 +91,30 @@ jornada720_pcmcia_configure_socket(struct soc_pcmcia_socket *skt, const socket_s
106 91
107static struct pcmcia_low_level jornada720_pcmcia_ops = { 92static struct pcmcia_low_level jornada720_pcmcia_ops = {
108 .owner = THIS_MODULE, 93 .owner = THIS_MODULE,
109 .hw_init = jornada720_pcmcia_hw_init,
110 .hw_shutdown = sa1111_pcmcia_hw_shutdown,
111 .socket_state = sa1111_pcmcia_socket_state,
112 .configure_socket = jornada720_pcmcia_configure_socket, 94 .configure_socket = jornada720_pcmcia_configure_socket,
113
114 .socket_init = sa1111_pcmcia_socket_init, 95 .socket_init = sa1111_pcmcia_socket_init,
115 .socket_suspend = sa1111_pcmcia_socket_suspend, 96 .first = 0,
97 .nr = 2,
116}; 98};
117 99
118int __devinit pcmcia_jornada720_init(struct device *dev) 100int __devinit pcmcia_jornada720_init(struct device *dev)
119{ 101{
120 int ret = -ENODEV; 102 int ret = -ENODEV;
121 103
122 if (machine_is_jornada720()) 104 if (machine_is_jornada720()) {
123 ret = sa11xx_drv_pcmcia_probe(dev, &jornada720_pcmcia_ops, 0, 2); 105 unsigned int pin = GPIO_A0 | GPIO_A1 | GPIO_A2 | GPIO_A3;
106
107 GRER |= 0x00000002;
108
109 /* Set GPIO_A<3:1> to be outputs for PCMCIA/CF power controller: */
110 sa1111_set_io_dir(dev, pin, 0, 0);
111 sa1111_set_io(dev, pin, 0);
112 sa1111_set_sleep_io(dev, pin, 0);
113
114 sa11xx_drv_pcmcia_ops(&jornada720_pcmcia_ops);
115 ret = sa1111_pcmcia_add(dev, &jornada720_pcmcia_ops,
116 sa11xx_drv_pcmcia_add_one);
117 }
124 118
125 return ret; 119 return ret;
126} 120}
diff --git a/drivers/pcmcia/sa1100_neponset.c b/drivers/pcmcia/sa1100_neponset.c
index 0c76d337815b..c95639b5f2a0 100644
--- a/drivers/pcmcia/sa1100_neponset.c
+++ b/drivers/pcmcia/sa1100_neponset.c
@@ -43,6 +43,7 @@
43static int 43static int
44neponset_pcmcia_configure_socket(struct soc_pcmcia_socket *skt, const socket_state_t *state) 44neponset_pcmcia_configure_socket(struct soc_pcmcia_socket *skt, const socket_state_t *state)
45{ 45{
46 struct sa1111_pcmcia_socket *s = to_skt(skt);
46 unsigned int ncr_mask, ncr_set, pa_dwr_mask, pa_dwr_set; 47 unsigned int ncr_mask, ncr_set, pa_dwr_mask, pa_dwr_set;
47 int ret; 48 int ret;
48 49
@@ -99,7 +100,7 @@ neponset_pcmcia_configure_socket(struct soc_pcmcia_socket *skt, const socket_sta
99 NCR_0 = (NCR_0 & ~ncr_mask) | ncr_set; 100 NCR_0 = (NCR_0 & ~ncr_mask) | ncr_set;
100 101
101 local_irq_restore(flags); 102 local_irq_restore(flags);
102 sa1111_set_io(SA1111_DEV(skt->dev), pa_dwr_mask, pa_dwr_set); 103 sa1111_set_io(s->dev, pa_dwr_mask, pa_dwr_set);
103 } 104 }
104 105
105 return 0; 106 return 0;
@@ -115,12 +116,10 @@ static void neponset_pcmcia_socket_init(struct soc_pcmcia_socket *skt)
115 116
116static struct pcmcia_low_level neponset_pcmcia_ops = { 117static struct pcmcia_low_level neponset_pcmcia_ops = {
117 .owner = THIS_MODULE, 118 .owner = THIS_MODULE,
118 .hw_init = sa1111_pcmcia_hw_init,
119 .hw_shutdown = sa1111_pcmcia_hw_shutdown,
120 .socket_state = sa1111_pcmcia_socket_state,
121 .configure_socket = neponset_pcmcia_configure_socket, 119 .configure_socket = neponset_pcmcia_configure_socket,
122 .socket_init = neponset_pcmcia_socket_init, 120 .socket_init = neponset_pcmcia_socket_init,
123 .socket_suspend = sa1111_pcmcia_socket_suspend, 121 .first = 0,
122 .nr = 2,
124}; 123};
125 124
126int pcmcia_neponset_init(struct sa1111_dev *sadev) 125int pcmcia_neponset_init(struct sa1111_dev *sadev)
@@ -135,7 +134,9 @@ int pcmcia_neponset_init(struct sa1111_dev *sadev)
135 sa1111_set_io_dir(sadev, GPIO_A0|GPIO_A1|GPIO_A2|GPIO_A3, 0, 0); 134 sa1111_set_io_dir(sadev, GPIO_A0|GPIO_A1|GPIO_A2|GPIO_A3, 0, 0);
136 sa1111_set_io(sadev, GPIO_A0|GPIO_A1|GPIO_A2|GPIO_A3, 0); 135 sa1111_set_io(sadev, GPIO_A0|GPIO_A1|GPIO_A2|GPIO_A3, 0);
137 sa1111_set_sleep_io(sadev, GPIO_A0|GPIO_A1|GPIO_A2|GPIO_A3, 0); 136 sa1111_set_sleep_io(sadev, GPIO_A0|GPIO_A1|GPIO_A2|GPIO_A3, 0);
138 ret = sa11xx_drv_pcmcia_probe(&sadev->dev, &neponset_pcmcia_ops, 0, 2); 137 sa11xx_drv_pcmcia_ops(&neponset_pcmcia_ops);
138 ret = sa1111_pcmcia_add(sadev, &neponset_pcmcia_ops,
139 sa11xx_drv_pcmcia_add_one);
139 } 140 }
140 141
141 return ret; 142 return ret;
diff --git a/drivers/pcmcia/sa1100_shannon.c b/drivers/pcmcia/sa1100_shannon.c
index 46d8c1977c2a..c4d51867a050 100644
--- a/drivers/pcmcia/sa1100_shannon.c
+++ b/drivers/pcmcia/sa1100_shannon.c
@@ -28,7 +28,7 @@ static int shannon_pcmcia_hw_init(struct soc_pcmcia_socket *skt)
28 GAFR &= ~(SHANNON_GPIO_EJECT_0 | SHANNON_GPIO_EJECT_1 | 28 GAFR &= ~(SHANNON_GPIO_EJECT_0 | SHANNON_GPIO_EJECT_1 |
29 SHANNON_GPIO_RDY_0 | SHANNON_GPIO_RDY_1); 29 SHANNON_GPIO_RDY_0 | SHANNON_GPIO_RDY_1);
30 30
31 skt->irq = skt->nr ? SHANNON_IRQ_GPIO_RDY_1 : SHANNON_IRQ_GPIO_RDY_0; 31 skt->socket.pci_irq = skt->nr ? SHANNON_IRQ_GPIO_RDY_1 : SHANNON_IRQ_GPIO_RDY_0;
32 32
33 return soc_pcmcia_request_irqs(skt, irqs, ARRAY_SIZE(irqs)); 33 return soc_pcmcia_request_irqs(skt, irqs, ARRAY_SIZE(irqs));
34} 34}
diff --git a/drivers/pcmcia/sa1100_simpad.c b/drivers/pcmcia/sa1100_simpad.c
index 33a08ae09fdf..05bd504e6f18 100644
--- a/drivers/pcmcia/sa1100_simpad.c
+++ b/drivers/pcmcia/sa1100_simpad.c
@@ -28,7 +28,7 @@ static int simpad_pcmcia_hw_init(struct soc_pcmcia_socket *skt)
28 28
29 clear_cs3_bit(VCC_3V_EN|VCC_5V_EN|EN0|EN1); 29 clear_cs3_bit(VCC_3V_EN|VCC_5V_EN|EN0|EN1);
30 30
31 skt->irq = IRQ_GPIO_CF_IRQ; 31 skt->socket.pci_irq = IRQ_GPIO_CF_IRQ;
32 32
33 return soc_pcmcia_request_irqs(skt, irqs, ARRAY_SIZE(irqs)); 33 return soc_pcmcia_request_irqs(skt, irqs, ARRAY_SIZE(irqs));
34} 34}
diff --git a/drivers/pcmcia/sa1111_generic.c b/drivers/pcmcia/sa1111_generic.c
index 4be4e172ffa1..de6bc333d299 100644
--- a/drivers/pcmcia/sa1111_generic.c
+++ b/drivers/pcmcia/sa1111_generic.c
@@ -28,23 +28,20 @@ static struct pcmcia_irqs irqs[] = {
28 { 1, IRQ_S1_BVD1_STSCHG, "SA1111 CF BVD1" }, 28 { 1, IRQ_S1_BVD1_STSCHG, "SA1111 CF BVD1" },
29}; 29};
30 30
31int sa1111_pcmcia_hw_init(struct soc_pcmcia_socket *skt) 31static int sa1111_pcmcia_hw_init(struct soc_pcmcia_socket *skt)
32{ 32{
33 if (skt->irq == NO_IRQ)
34 skt->irq = skt->nr ? IRQ_S1_READY_NINT : IRQ_S0_READY_NINT;
35
36 return soc_pcmcia_request_irqs(skt, irqs, ARRAY_SIZE(irqs)); 33 return soc_pcmcia_request_irqs(skt, irqs, ARRAY_SIZE(irqs));
37} 34}
38 35
39void sa1111_pcmcia_hw_shutdown(struct soc_pcmcia_socket *skt) 36static void sa1111_pcmcia_hw_shutdown(struct soc_pcmcia_socket *skt)
40{ 37{
41 soc_pcmcia_free_irqs(skt, irqs, ARRAY_SIZE(irqs)); 38 soc_pcmcia_free_irqs(skt, irqs, ARRAY_SIZE(irqs));
42} 39}
43 40
44void sa1111_pcmcia_socket_state(struct soc_pcmcia_socket *skt, struct pcmcia_state *state) 41void sa1111_pcmcia_socket_state(struct soc_pcmcia_socket *skt, struct pcmcia_state *state)
45{ 42{
46 struct sa1111_dev *sadev = SA1111_DEV(skt->dev); 43 struct sa1111_pcmcia_socket *s = to_skt(skt);
47 unsigned long status = sa1111_readl(sadev->mapbase + SA1111_PCSR); 44 unsigned long status = sa1111_readl(s->dev->mapbase + SA1111_PCSR);
48 45
49 switch (skt->nr) { 46 switch (skt->nr) {
50 case 0: 47 case 0:
@@ -71,7 +68,7 @@ void sa1111_pcmcia_socket_state(struct soc_pcmcia_socket *skt, struct pcmcia_sta
71 68
72int sa1111_pcmcia_configure_socket(struct soc_pcmcia_socket *skt, const socket_state_t *state) 69int sa1111_pcmcia_configure_socket(struct soc_pcmcia_socket *skt, const socket_state_t *state)
73{ 70{
74 struct sa1111_dev *sadev = SA1111_DEV(skt->dev); 71 struct sa1111_pcmcia_socket *s = to_skt(skt);
75 unsigned int pccr_skt_mask, pccr_set_mask, val; 72 unsigned int pccr_skt_mask, pccr_set_mask, val;
76 unsigned long flags; 73 unsigned long flags;
77 74
@@ -100,10 +97,10 @@ int sa1111_pcmcia_configure_socket(struct soc_pcmcia_socket *skt, const socket_s
100 pccr_set_mask |= PCCR_S0_FLT|PCCR_S1_FLT; 97 pccr_set_mask |= PCCR_S0_FLT|PCCR_S1_FLT;
101 98
102 local_irq_save(flags); 99 local_irq_save(flags);
103 val = sa1111_readl(sadev->mapbase + SA1111_PCCR); 100 val = sa1111_readl(s->dev->mapbase + SA1111_PCCR);
104 val &= ~pccr_skt_mask; 101 val &= ~pccr_skt_mask;
105 val |= pccr_set_mask & pccr_skt_mask; 102 val |= pccr_set_mask & pccr_skt_mask;
106 sa1111_writel(val, sadev->mapbase + SA1111_PCCR); 103 sa1111_writel(val, s->dev->mapbase + SA1111_PCCR);
107 local_irq_restore(flags); 104 local_irq_restore(flags);
108 105
109 return 0; 106 return 0;
@@ -114,15 +111,51 @@ void sa1111_pcmcia_socket_init(struct soc_pcmcia_socket *skt)
114 soc_pcmcia_enable_irqs(skt, irqs, ARRAY_SIZE(irqs)); 111 soc_pcmcia_enable_irqs(skt, irqs, ARRAY_SIZE(irqs));
115} 112}
116 113
117void sa1111_pcmcia_socket_suspend(struct soc_pcmcia_socket *skt) 114static void sa1111_pcmcia_socket_suspend(struct soc_pcmcia_socket *skt)
118{ 115{
119 soc_pcmcia_disable_irqs(skt, irqs, ARRAY_SIZE(irqs)); 116 soc_pcmcia_disable_irqs(skt, irqs, ARRAY_SIZE(irqs));
120} 117}
121 118
119int sa1111_pcmcia_add(struct sa1111_dev *dev, struct pcmcia_low_level *ops,
120 int (*add)(struct soc_pcmcia_socket *))
121{
122 struct sa1111_pcmcia_socket *s;
123 int i, ret = 0;
124
125 ops->hw_init = sa1111_pcmcia_hw_init;
126 ops->hw_shutdown = sa1111_pcmcia_hw_shutdown;
127 ops->socket_state = sa1111_pcmcia_socket_state;
128 ops->socket_suspend = sa1111_pcmcia_socket_suspend;
129
130 for (i = 0; i < ops->nr; i++) {
131 s = kzalloc(sizeof(*s), GFP_KERNEL);
132 if (!s)
133 return -ENOMEM;
134
135 s->soc.nr = ops->first + i;
136 s->soc.ops = ops;
137 s->soc.socket.owner = ops->owner;
138 s->soc.socket.dev.parent = &dev->dev;
139 s->soc.socket.pci_irq = s->soc.nr ? IRQ_S1_READY_NINT : IRQ_S0_READY_NINT;
140 s->dev = dev;
141
142 ret = add(&s->soc);
143 if (ret == 0) {
144 s->next = dev_get_drvdata(&dev->dev);
145 dev_set_drvdata(&dev->dev, s);
146 } else
147 kfree(s);
148 }
149
150 return ret;
151}
152
122static int pcmcia_probe(struct sa1111_dev *dev) 153static int pcmcia_probe(struct sa1111_dev *dev)
123{ 154{
124 void __iomem *base; 155 void __iomem *base;
125 156
157 dev_set_drvdata(&dev->dev, NULL);
158
126 if (!request_mem_region(dev->res.start, 512, 159 if (!request_mem_region(dev->res.start, 512,
127 SA1111_DRIVER_NAME(dev))) 160 SA1111_DRIVER_NAME(dev)))
128 return -EBUSY; 161 return -EBUSY;
@@ -152,7 +185,15 @@ static int pcmcia_probe(struct sa1111_dev *dev)
152 185
153static int __devexit pcmcia_remove(struct sa1111_dev *dev) 186static int __devexit pcmcia_remove(struct sa1111_dev *dev)
154{ 187{
155 soc_common_drv_pcmcia_remove(&dev->dev); 188 struct sa1111_pcmcia_socket *next, *s = dev_get_drvdata(&dev->dev);
189
190 dev_set_drvdata(&dev->dev, NULL);
191
192 for (; next = s->next, s; s = next) {
193 soc_pcmcia_remove_one(&s->soc);
194 kfree(s);
195 }
196
156 release_mem_region(dev->res.start, 512); 197 release_mem_region(dev->res.start, 512);
157 return 0; 198 return 0;
158} 199}
diff --git a/drivers/pcmcia/sa1111_generic.h b/drivers/pcmcia/sa1111_generic.h
index 10ced4a210d7..02dc8577cdaf 100644
--- a/drivers/pcmcia/sa1111_generic.h
+++ b/drivers/pcmcia/sa1111_generic.h
@@ -1,12 +1,23 @@
1#include "soc_common.h" 1#include "soc_common.h"
2#include "sa11xx_base.h" 2#include "sa11xx_base.h"
3 3
4extern int sa1111_pcmcia_hw_init(struct soc_pcmcia_socket *); 4struct sa1111_pcmcia_socket {
5extern void sa1111_pcmcia_hw_shutdown(struct soc_pcmcia_socket *); 5 struct soc_pcmcia_socket soc;
6 struct sa1111_dev *dev;
7 struct sa1111_pcmcia_socket *next;
8};
9
10static inline struct sa1111_pcmcia_socket *to_skt(struct soc_pcmcia_socket *s)
11{
12 return container_of(s, struct sa1111_pcmcia_socket, soc);
13}
14
15int sa1111_pcmcia_add(struct sa1111_dev *dev, struct pcmcia_low_level *ops,
16 int (*add)(struct soc_pcmcia_socket *));
17
6extern void sa1111_pcmcia_socket_state(struct soc_pcmcia_socket *, struct pcmcia_state *); 18extern void sa1111_pcmcia_socket_state(struct soc_pcmcia_socket *, struct pcmcia_state *);
7extern int sa1111_pcmcia_configure_socket(struct soc_pcmcia_socket *, const socket_state_t *); 19extern int sa1111_pcmcia_configure_socket(struct soc_pcmcia_socket *, const socket_state_t *);
8extern void sa1111_pcmcia_socket_init(struct soc_pcmcia_socket *); 20extern void sa1111_pcmcia_socket_init(struct soc_pcmcia_socket *);
9extern void sa1111_pcmcia_socket_suspend(struct soc_pcmcia_socket *);
10 21
11extern int pcmcia_badge4_init(struct device *); 22extern int pcmcia_badge4_init(struct device *);
12extern int pcmcia_jornada720_init(struct device *); 23extern int pcmcia_jornada720_init(struct device *);
diff --git a/drivers/pcmcia/sa11xx_base.c b/drivers/pcmcia/sa11xx_base.c
index e15d59f2d8a9..fc9a6527019b 100644
--- a/drivers/pcmcia/sa11xx_base.c
+++ b/drivers/pcmcia/sa11xx_base.c
@@ -171,12 +171,58 @@ static const char *skt_names[] = {
171#define SKT_DEV_INFO_SIZE(n) \ 171#define SKT_DEV_INFO_SIZE(n) \
172 (sizeof(struct skt_dev_info) + (n)*sizeof(struct soc_pcmcia_socket)) 172 (sizeof(struct skt_dev_info) + (n)*sizeof(struct soc_pcmcia_socket))
173 173
174int sa11xx_drv_pcmcia_add_one(struct soc_pcmcia_socket *skt)
175{
176 skt->res_skt.start = _PCMCIA(skt->nr);
177 skt->res_skt.end = _PCMCIA(skt->nr) + PCMCIASp - 1;
178 skt->res_skt.name = skt_names[skt->nr];
179 skt->res_skt.flags = IORESOURCE_MEM;
180
181 skt->res_io.start = _PCMCIAIO(skt->nr);
182 skt->res_io.end = _PCMCIAIO(skt->nr) + PCMCIAIOSp - 1;
183 skt->res_io.name = "io";
184 skt->res_io.flags = IORESOURCE_MEM | IORESOURCE_BUSY;
185
186 skt->res_mem.start = _PCMCIAMem(skt->nr);
187 skt->res_mem.end = _PCMCIAMem(skt->nr) + PCMCIAMemSp - 1;
188 skt->res_mem.name = "memory";
189 skt->res_mem.flags = IORESOURCE_MEM;
190
191 skt->res_attr.start = _PCMCIAAttr(skt->nr);
192 skt->res_attr.end = _PCMCIAAttr(skt->nr) + PCMCIAAttrSp - 1;
193 skt->res_attr.name = "attribute";
194 skt->res_attr.flags = IORESOURCE_MEM;
195
196 return soc_pcmcia_add_one(skt);
197}
198EXPORT_SYMBOL(sa11xx_drv_pcmcia_add_one);
199
200void sa11xx_drv_pcmcia_ops(struct pcmcia_low_level *ops)
201{
202 /*
203 * set default MECR calculation if the board specific
204 * code did not specify one...
205 */
206 if (!ops->get_timing)
207 ops->get_timing = sa1100_pcmcia_default_mecr_timing;
208
209 /* Provide our SA11x0 specific timing routines. */
210 ops->set_timing = sa1100_pcmcia_set_timing;
211 ops->show_timing = sa1100_pcmcia_show_timing;
212#ifdef CONFIG_CPU_FREQ
213 ops->frequency_change = sa1100_pcmcia_frequency_change;
214#endif
215}
216EXPORT_SYMBOL(sa11xx_drv_pcmcia_ops);
217
174int sa11xx_drv_pcmcia_probe(struct device *dev, struct pcmcia_low_level *ops, 218int sa11xx_drv_pcmcia_probe(struct device *dev, struct pcmcia_low_level *ops,
175 int first, int nr) 219 int first, int nr)
176{ 220{
177 struct skt_dev_info *sinfo; 221 struct skt_dev_info *sinfo;
178 struct soc_pcmcia_socket *skt; 222 struct soc_pcmcia_socket *skt;
179 int i; 223 int i, ret = 0;
224
225 sa11xx_drv_pcmcia_ops(ops);
180 226
181 sinfo = kzalloc(SKT_DEV_INFO_SIZE(nr), GFP_KERNEL); 227 sinfo = kzalloc(SKT_DEV_INFO_SIZE(nr), GFP_KERNEL);
182 if (!sinfo) 228 if (!sinfo)
@@ -188,45 +234,26 @@ int sa11xx_drv_pcmcia_probe(struct device *dev, struct pcmcia_low_level *ops,
188 for (i = 0; i < nr; i++) { 234 for (i = 0; i < nr; i++) {
189 skt = &sinfo->skt[i]; 235 skt = &sinfo->skt[i];
190 236
191 skt->nr = first + i; 237 skt->nr = first + i;
192 skt->irq = NO_IRQ; 238 skt->ops = ops;
193 239 skt->socket.owner = ops->owner;
194 skt->res_skt.start = _PCMCIA(skt->nr); 240 skt->socket.dev.parent = dev;
195 skt->res_skt.end = _PCMCIA(skt->nr) + PCMCIASp - 1; 241 skt->socket.pci_irq = NO_IRQ;
196 skt->res_skt.name = skt_names[skt->nr];
197 skt->res_skt.flags = IORESOURCE_MEM;
198
199 skt->res_io.start = _PCMCIAIO(skt->nr);
200 skt->res_io.end = _PCMCIAIO(skt->nr) + PCMCIAIOSp - 1;
201 skt->res_io.name = "io";
202 skt->res_io.flags = IORESOURCE_MEM | IORESOURCE_BUSY;
203 242
204 skt->res_mem.start = _PCMCIAMem(skt->nr); 243 ret = sa11xx_drv_pcmcia_add_one(skt);
205 skt->res_mem.end = _PCMCIAMem(skt->nr) + PCMCIAMemSp - 1; 244 if (ret)
206 skt->res_mem.name = "memory"; 245 break;
207 skt->res_mem.flags = IORESOURCE_MEM;
208
209 skt->res_attr.start = _PCMCIAAttr(skt->nr);
210 skt->res_attr.end = _PCMCIAAttr(skt->nr) + PCMCIAAttrSp - 1;
211 skt->res_attr.name = "attribute";
212 skt->res_attr.flags = IORESOURCE_MEM;
213 } 246 }
214 247
215 /* 248 if (ret) {
216 * set default MECR calculation if the board specific 249 while (--i >= 0)
217 * code did not specify one... 250 soc_pcmcia_remove_one(&sinfo->skt[i]);
218 */ 251 kfree(sinfo);
219 if (!ops->get_timing) 252 } else {
220 ops->get_timing = sa1100_pcmcia_default_mecr_timing; 253 dev_set_drvdata(dev, sinfo);
221 254 }
222 /* Provide our SA11x0 specific timing routines. */
223 ops->set_timing = sa1100_pcmcia_set_timing;
224 ops->show_timing = sa1100_pcmcia_show_timing;
225#ifdef CONFIG_CPU_FREQ
226 ops->frequency_change = sa1100_pcmcia_frequency_change;
227#endif
228 255
229 return soc_common_drv_pcmcia_probe(dev, ops, sinfo); 256 return ret;
230} 257}
231EXPORT_SYMBOL(sa11xx_drv_pcmcia_probe); 258EXPORT_SYMBOL(sa11xx_drv_pcmcia_probe);
232 259
diff --git a/drivers/pcmcia/sa11xx_base.h b/drivers/pcmcia/sa11xx_base.h
index 7bc208280527..3d76d720f463 100644
--- a/drivers/pcmcia/sa11xx_base.h
+++ b/drivers/pcmcia/sa11xx_base.h
@@ -118,6 +118,8 @@ static inline unsigned int sa1100_pcmcia_cmd_time(unsigned int cpu_clock_khz,
118} 118}
119 119
120 120
121int sa11xx_drv_pcmcia_add_one(struct soc_pcmcia_socket *skt);
122void sa11xx_drv_pcmcia_ops(struct pcmcia_low_level *ops);
121extern int sa11xx_drv_pcmcia_probe(struct device *dev, struct pcmcia_low_level *ops, int first, int nr); 123extern int sa11xx_drv_pcmcia_probe(struct device *dev, struct pcmcia_low_level *ops, int first, int nr);
122 124
123#endif /* !defined(_PCMCIA_SA1100_H) */ 125#endif /* !defined(_PCMCIA_SA1100_H) */
diff --git a/drivers/pcmcia/soc_common.c b/drivers/pcmcia/soc_common.c
index ef7e9e58782b..6f1a86b43c60 100644
--- a/drivers/pcmcia/soc_common.c
+++ b/drivers/pcmcia/soc_common.c
@@ -144,10 +144,10 @@ soc_common_pcmcia_config_skt(struct soc_pcmcia_socket *skt, socket_state_t *stat
144 */ 144 */
145 if (skt->irq_state != 1 && state->io_irq) { 145 if (skt->irq_state != 1 && state->io_irq) {
146 skt->irq_state = 1; 146 skt->irq_state = 1;
147 set_irq_type(skt->irq, IRQ_TYPE_EDGE_FALLING); 147 set_irq_type(skt->socket.pci_irq, IRQ_TYPE_EDGE_FALLING);
148 } else if (skt->irq_state == 1 && state->io_irq == 0) { 148 } else if (skt->irq_state == 1 && state->io_irq == 0) {
149 skt->irq_state = 0; 149 skt->irq_state = 0;
150 set_irq_type(skt->irq, IRQ_TYPE_NONE); 150 set_irq_type(skt->socket.pci_irq, IRQ_TYPE_NONE);
151 } 151 }
152 152
153 skt->cs_state = *state; 153 skt->cs_state = *state;
@@ -492,7 +492,8 @@ static ssize_t show_status(struct device *dev, struct device_attribute *attr, ch
492 492
493 p+=sprintf(p, "Vcc : %d\n", skt->cs_state.Vcc); 493 p+=sprintf(p, "Vcc : %d\n", skt->cs_state.Vcc);
494 p+=sprintf(p, "Vpp : %d\n", skt->cs_state.Vpp); 494 p+=sprintf(p, "Vpp : %d\n", skt->cs_state.Vpp);
495 p+=sprintf(p, "IRQ : %d (%d)\n", skt->cs_state.io_irq, skt->irq); 495 p+=sprintf(p, "IRQ : %d (%d)\n", skt->cs_state.io_irq,
496 skt->socket.pci_irq);
496 if (skt->ops->show_timing) 497 if (skt->ops->show_timing)
497 p+=skt->ops->show_timing(skt, p); 498 p+=skt->ops->show_timing(skt, p);
498 499
@@ -574,7 +575,7 @@ void soc_pcmcia_enable_irqs(struct soc_pcmcia_socket *skt,
574EXPORT_SYMBOL(soc_pcmcia_enable_irqs); 575EXPORT_SYMBOL(soc_pcmcia_enable_irqs);
575 576
576 577
577LIST_HEAD(soc_pcmcia_sockets); 578static LIST_HEAD(soc_pcmcia_sockets);
578static DEFINE_MUTEX(soc_pcmcia_sockets_lock); 579static DEFINE_MUTEX(soc_pcmcia_sockets_lock);
579 580
580#ifdef CONFIG_CPU_FREQ 581#ifdef CONFIG_CPU_FREQ
@@ -609,177 +610,137 @@ static int soc_pcmcia_cpufreq_register(void)
609 "notifier for PCMCIA (%d)\n", ret); 610 "notifier for PCMCIA (%d)\n", ret);
610 return ret; 611 return ret;
611} 612}
613fs_initcall(soc_pcmcia_cpufreq_register);
612 614
613static void soc_pcmcia_cpufreq_unregister(void) 615static void soc_pcmcia_cpufreq_unregister(void)
614{ 616{
615 cpufreq_unregister_notifier(&soc_pcmcia_notifier_block, CPUFREQ_TRANSITION_NOTIFIER); 617 cpufreq_unregister_notifier(&soc_pcmcia_notifier_block, CPUFREQ_TRANSITION_NOTIFIER);
616} 618}
619module_exit(soc_pcmcia_cpufreq_unregister);
617 620
618#else
619static int soc_pcmcia_cpufreq_register(void) { return 0; }
620static void soc_pcmcia_cpufreq_unregister(void) {}
621#endif 621#endif
622 622
623int soc_common_drv_pcmcia_probe(struct device *dev, struct pcmcia_low_level *ops, 623void soc_pcmcia_remove_one(struct soc_pcmcia_socket *skt)
624 struct skt_dev_info *sinfo)
625{ 624{
626 struct soc_pcmcia_socket *skt;
627 int ret, i;
628
629 mutex_lock(&soc_pcmcia_sockets_lock); 625 mutex_lock(&soc_pcmcia_sockets_lock);
626 del_timer_sync(&skt->poll_timer);
630 627
631 /* 628 pcmcia_unregister_socket(&skt->socket);
632 * Initialise the per-socket structure.
633 */
634 for (i = 0; i < sinfo->nskt; i++) {
635 skt = &sinfo->skt[i];
636 629
637 skt->socket.ops = &soc_common_pcmcia_operations; 630 flush_scheduled_work();
638 skt->socket.owner = ops->owner;
639 skt->socket.dev.parent = dev;
640 631
641 init_timer(&skt->poll_timer); 632 skt->ops->hw_shutdown(skt);
642 skt->poll_timer.function = soc_common_pcmcia_poll_event;
643 skt->poll_timer.data = (unsigned long)skt;
644 skt->poll_timer.expires = jiffies + SOC_PCMCIA_POLL_PERIOD;
645 633
646 skt->dev = dev; 634 soc_common_pcmcia_config_skt(skt, &dead_socket);
647 skt->ops = ops;
648 635
649 ret = request_resource(&iomem_resource, &skt->res_skt); 636 list_del(&skt->node);
650 if (ret) 637 mutex_unlock(&soc_pcmcia_sockets_lock);
651 goto out_err_1;
652 638
653 ret = request_resource(&skt->res_skt, &skt->res_io); 639 iounmap(skt->virt_io);
654 if (ret) 640 skt->virt_io = NULL;
655 goto out_err_2; 641 release_resource(&skt->res_attr);
642 release_resource(&skt->res_mem);
643 release_resource(&skt->res_io);
644 release_resource(&skt->res_skt);
645}
646EXPORT_SYMBOL(soc_pcmcia_remove_one);
656 647
657 ret = request_resource(&skt->res_skt, &skt->res_mem); 648int soc_pcmcia_add_one(struct soc_pcmcia_socket *skt)
658 if (ret) 649{
659 goto out_err_3; 650 int ret;
660 651
661 ret = request_resource(&skt->res_skt, &skt->res_attr); 652 init_timer(&skt->poll_timer);
662 if (ret) 653 skt->poll_timer.function = soc_common_pcmcia_poll_event;
663 goto out_err_4; 654 skt->poll_timer.data = (unsigned long)skt;
655 skt->poll_timer.expires = jiffies + SOC_PCMCIA_POLL_PERIOD;
664 656
665 skt->virt_io = ioremap(skt->res_io.start, 0x10000); 657 ret = request_resource(&iomem_resource, &skt->res_skt);
666 if (skt->virt_io == NULL) { 658 if (ret)
667 ret = -ENOMEM; 659 goto out_err_1;
668 goto out_err_5;
669 }
670 660
671 if (list_empty(&soc_pcmcia_sockets)) 661 ret = request_resource(&skt->res_skt, &skt->res_io);
672 soc_pcmcia_cpufreq_register(); 662 if (ret)
663 goto out_err_2;
673 664
674 list_add(&skt->node, &soc_pcmcia_sockets); 665 ret = request_resource(&skt->res_skt, &skt->res_mem);
666 if (ret)
667 goto out_err_3;
675 668
676 /* 669 ret = request_resource(&skt->res_skt, &skt->res_attr);
677 * We initialize default socket timing here, because 670 if (ret)
678 * we are not guaranteed to see a SetIOMap operation at 671 goto out_err_4;
679 * runtime.
680 */
681 ops->set_timing(skt);
682 672
683 ret = ops->hw_init(skt); 673 skt->virt_io = ioremap(skt->res_io.start, 0x10000);
684 if (ret) 674 if (skt->virt_io == NULL) {
685 goto out_err_6; 675 ret = -ENOMEM;
676 goto out_err_5;
677 }
686 678
687 skt->socket.features = SS_CAP_STATIC_MAP|SS_CAP_PCCARD; 679 mutex_lock(&soc_pcmcia_sockets_lock);
688 skt->socket.resource_ops = &pccard_static_ops;
689 skt->socket.irq_mask = 0;
690 skt->socket.map_size = PAGE_SIZE;
691 skt->socket.pci_irq = skt->irq;
692 skt->socket.io_offset = (unsigned long)skt->virt_io;
693 680
694 skt->status = soc_common_pcmcia_skt_state(skt); 681 list_add(&skt->node, &soc_pcmcia_sockets);
695 682
696 ret = pcmcia_register_socket(&skt->socket); 683 /*
697 if (ret) 684 * We initialize default socket timing here, because
698 goto out_err_7; 685 * we are not guaranteed to see a SetIOMap operation at
686 * runtime.
687 */
688 skt->ops->set_timing(skt);
699 689
700 WARN_ON(skt->socket.sock != i); 690 ret = skt->ops->hw_init(skt);
691 if (ret)
692 goto out_err_6;
701 693
702 add_timer(&skt->poll_timer); 694 skt->socket.ops = &soc_common_pcmcia_operations;
695 skt->socket.features = SS_CAP_STATIC_MAP|SS_CAP_PCCARD;
696 skt->socket.resource_ops = &pccard_static_ops;
697 skt->socket.irq_mask = 0;
698 skt->socket.map_size = PAGE_SIZE;
699 skt->socket.io_offset = (unsigned long)skt->virt_io;
703 700
704 ret = device_create_file(&skt->socket.dev, &dev_attr_status); 701 skt->status = soc_common_pcmcia_skt_state(skt);
705 if (ret)
706 goto out_err_8;
707 }
708 702
709 dev_set_drvdata(dev, sinfo); 703 ret = pcmcia_register_socket(&skt->socket);
710 ret = 0; 704 if (ret)
711 goto out; 705 goto out_err_7;
712 706
713 do { 707 add_timer(&skt->poll_timer);
714 skt = &sinfo->skt[i]; 708
709 mutex_unlock(&soc_pcmcia_sockets_lock);
710
711 ret = device_create_file(&skt->socket.dev, &dev_attr_status);
712 if (ret)
713 goto out_err_8;
714
715 return ret;
715 716
716 device_remove_file(&skt->socket.dev, &dev_attr_status);
717 out_err_8: 717 out_err_8:
718 del_timer_sync(&skt->poll_timer); 718 mutex_lock(&soc_pcmcia_sockets_lock);
719 pcmcia_unregister_socket(&skt->socket); 719 del_timer_sync(&skt->poll_timer);
720 pcmcia_unregister_socket(&skt->socket);
720 721
721 out_err_7: 722 out_err_7:
722 flush_scheduled_work(); 723 flush_scheduled_work();
723 724
724 ops->hw_shutdown(skt); 725 skt->ops->hw_shutdown(skt);
725 out_err_6: 726 out_err_6:
726 list_del(&skt->node); 727 list_del(&skt->node);
727 iounmap(skt->virt_io); 728 mutex_unlock(&soc_pcmcia_sockets_lock);
729 iounmap(skt->virt_io);
728 out_err_5: 730 out_err_5:
729 release_resource(&skt->res_attr); 731 release_resource(&skt->res_attr);
730 out_err_4: 732 out_err_4:
731 release_resource(&skt->res_mem); 733 release_resource(&skt->res_mem);
732 out_err_3: 734 out_err_3:
733 release_resource(&skt->res_io); 735 release_resource(&skt->res_io);
734 out_err_2: 736 out_err_2:
735 release_resource(&skt->res_skt); 737 release_resource(&skt->res_skt);
736 out_err_1: 738 out_err_1:
737 i--;
738 } while (i > 0);
739 739
740 kfree(sinfo);
741
742 out:
743 mutex_unlock(&soc_pcmcia_sockets_lock);
744 return ret; 740 return ret;
745} 741}
742EXPORT_SYMBOL(soc_pcmcia_add_one);
746 743
747int soc_common_drv_pcmcia_remove(struct device *dev) 744MODULE_AUTHOR("John Dorsey <john+@cs.cmu.edu>");
748{ 745MODULE_DESCRIPTION("Linux PCMCIA Card Services: Common SoC support");
749 struct skt_dev_info *sinfo = dev_get_drvdata(dev); 746MODULE_LICENSE("Dual MPL/GPL");
750 int i;
751
752 dev_set_drvdata(dev, NULL);
753
754 mutex_lock(&soc_pcmcia_sockets_lock);
755 for (i = 0; i < sinfo->nskt; i++) {
756 struct soc_pcmcia_socket *skt = &sinfo->skt[i];
757
758 del_timer_sync(&skt->poll_timer);
759
760 pcmcia_unregister_socket(&skt->socket);
761
762 flush_scheduled_work();
763
764 skt->ops->hw_shutdown(skt);
765
766 soc_common_pcmcia_config_skt(skt, &dead_socket);
767
768 list_del(&skt->node);
769 iounmap(skt->virt_io);
770 skt->virt_io = NULL;
771 release_resource(&skt->res_attr);
772 release_resource(&skt->res_mem);
773 release_resource(&skt->res_io);
774 release_resource(&skt->res_skt);
775 }
776 if (list_empty(&soc_pcmcia_sockets))
777 soc_pcmcia_cpufreq_unregister();
778
779 mutex_unlock(&soc_pcmcia_sockets_lock);
780
781 kfree(sinfo);
782
783 return 0;
784}
785EXPORT_SYMBOL(soc_common_drv_pcmcia_remove);
diff --git a/drivers/pcmcia/soc_common.h b/drivers/pcmcia/soc_common.h
index 290e143839ee..e40824ce6b0b 100644
--- a/drivers/pcmcia/soc_common.h
+++ b/drivers/pcmcia/soc_common.h
@@ -30,14 +30,12 @@ struct soc_pcmcia_socket {
30 /* 30 /*
31 * Info from low level handler 31 * Info from low level handler
32 */ 32 */
33 struct device *dev;
34 unsigned int nr; 33 unsigned int nr;
35 unsigned int irq;
36 34
37 /* 35 /*
38 * Core PCMCIA state 36 * Core PCMCIA state
39 */ 37 */
40 struct pcmcia_low_level *ops; 38 const struct pcmcia_low_level *ops;
41 39
42 unsigned int status; 40 unsigned int status;
43 socket_state_t cs_state; 41 socket_state_t cs_state;
@@ -135,10 +133,8 @@ extern void soc_pcmcia_enable_irqs(struct soc_pcmcia_socket *skt, struct pcmcia_
135extern void soc_common_pcmcia_get_timing(struct soc_pcmcia_socket *, struct soc_pcmcia_timing *); 133extern void soc_common_pcmcia_get_timing(struct soc_pcmcia_socket *, struct soc_pcmcia_timing *);
136 134
137 135
138extern struct list_head soc_pcmcia_sockets; 136void soc_pcmcia_remove_one(struct soc_pcmcia_socket *skt);
139 137int soc_pcmcia_add_one(struct soc_pcmcia_socket *skt);
140extern int soc_common_drv_pcmcia_probe(struct device *dev, struct pcmcia_low_level *ops, struct skt_dev_info *sinfo);
141extern int soc_common_drv_pcmcia_remove(struct device *dev);
142 138
143 139
144#ifdef CONFIG_PCMCIA_DEBUG 140#ifdef CONFIG_PCMCIA_DEBUG
diff --git a/drivers/pcmcia/tcic.c b/drivers/pcmcia/tcic.c
index 6918849d511e..12c49ee135e1 100644
--- a/drivers/pcmcia/tcic.c
+++ b/drivers/pcmcia/tcic.c
@@ -55,21 +55,6 @@
55#include <pcmcia/ss.h> 55#include <pcmcia/ss.h>
56#include "tcic.h" 56#include "tcic.h"
57 57
58#ifdef CONFIG_PCMCIA_DEBUG
59static int pc_debug;
60
61module_param(pc_debug, int, 0644);
62static const char version[] =
63"tcic.c 1.111 2000/02/15 04:13:12 (David Hinds)";
64
65#define debug(lvl, fmt, arg...) do { \
66 if (pc_debug > (lvl)) \
67 printk(KERN_DEBUG "tcic: " fmt , ## arg); \
68} while (0)
69#else
70#define debug(lvl, fmt, arg...) do { } while (0)
71#endif
72
73MODULE_AUTHOR("David Hinds <dahinds@users.sourceforge.net>"); 58MODULE_AUTHOR("David Hinds <dahinds@users.sourceforge.net>");
74MODULE_DESCRIPTION("Databook TCIC-2 PCMCIA socket driver"); 59MODULE_DESCRIPTION("Databook TCIC-2 PCMCIA socket driver");
75MODULE_LICENSE("Dual MPL/GPL"); 60MODULE_LICENSE("Dual MPL/GPL");
@@ -574,7 +559,7 @@ static irqreturn_t tcic_interrupt(int irq, void *dev)
574 } else 559 } else
575 active = 1; 560 active = 1;
576 561
577 debug(2, "tcic_interrupt()\n"); 562 pr_debug("tcic_interrupt()\n");
578 563
579 for (i = 0; i < sockets; i++) { 564 for (i = 0; i < sockets; i++) {
580 psock = socket_table[i].psock; 565 psock = socket_table[i].psock;
@@ -611,13 +596,13 @@ static irqreturn_t tcic_interrupt(int irq, void *dev)
611 } 596 }
612 active = 0; 597 active = 0;
613 598
614 debug(2, "interrupt done\n"); 599 pr_debug("interrupt done\n");
615 return IRQ_HANDLED; 600 return IRQ_HANDLED;
616} /* tcic_interrupt */ 601} /* tcic_interrupt */
617 602
618static void tcic_timer(u_long data) 603static void tcic_timer(u_long data)
619{ 604{
620 debug(2, "tcic_timer()\n"); 605 pr_debug("tcic_timer()\n");
621 tcic_timer_pending = 0; 606 tcic_timer_pending = 0;
622 tcic_interrupt(0, NULL); 607 tcic_interrupt(0, NULL);
623} /* tcic_timer */ 608} /* tcic_timer */
@@ -644,7 +629,7 @@ static int tcic_get_status(struct pcmcia_socket *sock, u_int *value)
644 reg = tcic_getb(TCIC_PWR); 629 reg = tcic_getb(TCIC_PWR);
645 if (reg & (TCIC_PWR_VCC(psock)|TCIC_PWR_VPP(psock))) 630 if (reg & (TCIC_PWR_VCC(psock)|TCIC_PWR_VPP(psock)))
646 *value |= SS_POWERON; 631 *value |= SS_POWERON;
647 debug(1, "GetStatus(%d) = %#2.2x\n", psock, *value); 632 dev_dbg(&sock->dev, "GetStatus(%d) = %#2.2x\n", psock, *value);
648 return 0; 633 return 0;
649} /* tcic_get_status */ 634} /* tcic_get_status */
650 635
@@ -656,7 +641,7 @@ static int tcic_set_socket(struct pcmcia_socket *sock, socket_state_t *state)
656 u_char reg; 641 u_char reg;
657 u_short scf1, scf2; 642 u_short scf1, scf2;
658 643
659 debug(1, "SetSocket(%d, flags %#3.3x, Vcc %d, Vpp %d, " 644 dev_dbg(&sock->dev, "SetSocket(%d, flags %#3.3x, Vcc %d, Vpp %d, "
660 "io_irq %d, csc_mask %#2.2x)\n", psock, state->flags, 645 "io_irq %d, csc_mask %#2.2x)\n", psock, state->flags,
661 state->Vcc, state->Vpp, state->io_irq, state->csc_mask); 646 state->Vcc, state->Vpp, state->io_irq, state->csc_mask);
662 tcic_setw(TCIC_ADDR+2, (psock << TCIC_SS_SHFT) | TCIC_ADR2_INDREG); 647 tcic_setw(TCIC_ADDR+2, (psock << TCIC_SS_SHFT) | TCIC_ADR2_INDREG);
@@ -731,7 +716,7 @@ static int tcic_set_io_map(struct pcmcia_socket *sock, struct pccard_io_map *io)
731 u_int addr; 716 u_int addr;
732 u_short base, len, ioctl; 717 u_short base, len, ioctl;
733 718
734 debug(1, "SetIOMap(%d, %d, %#2.2x, %d ns, " 719 dev_dbg(&sock->dev, "SetIOMap(%d, %d, %#2.2x, %d ns, "
735 "%#llx-%#llx)\n", psock, io->map, io->flags, io->speed, 720 "%#llx-%#llx)\n", psock, io->map, io->flags, io->speed,
736 (unsigned long long)io->start, (unsigned long long)io->stop); 721 (unsigned long long)io->start, (unsigned long long)io->stop);
737 if ((io->map > 1) || (io->start > 0xffff) || (io->stop > 0xffff) || 722 if ((io->map > 1) || (io->start > 0xffff) || (io->stop > 0xffff) ||
@@ -768,7 +753,7 @@ static int tcic_set_mem_map(struct pcmcia_socket *sock, struct pccard_mem_map *m
768 u_short addr, ctl; 753 u_short addr, ctl;
769 u_long base, len, mmap; 754 u_long base, len, mmap;
770 755
771 debug(1, "SetMemMap(%d, %d, %#2.2x, %d ns, " 756 dev_dbg(&sock->dev, "SetMemMap(%d, %d, %#2.2x, %d ns, "
772 "%#llx-%#llx, %#x)\n", psock, mem->map, mem->flags, 757 "%#llx-%#llx, %#x)\n", psock, mem->map, mem->flags,
773 mem->speed, (unsigned long long)mem->res->start, 758 mem->speed, (unsigned long long)mem->res->start,
774 (unsigned long long)mem->res->end, mem->card_start); 759 (unsigned long long)mem->res->end, mem->card_start);
diff --git a/drivers/pcmcia/topic.h b/drivers/pcmcia/topic.h
index edccfa5bb400..615a45a8fe86 100644
--- a/drivers/pcmcia/topic.h
+++ b/drivers/pcmcia/topic.h
@@ -114,22 +114,17 @@ static void topic97_zoom_video(struct pcmcia_socket *sock, int onoff)
114 reg_zv |= TOPIC97_ZV_CONTROL_ENABLE; 114 reg_zv |= TOPIC97_ZV_CONTROL_ENABLE;
115 config_writeb(socket, TOPIC97_ZOOM_VIDEO_CONTROL, reg_zv); 115 config_writeb(socket, TOPIC97_ZOOM_VIDEO_CONTROL, reg_zv);
116 116
117 reg = config_readb(socket, TOPIC97_MISC2);
118 reg |= TOPIC97_MISC2_ZV_ENABLE;
119 config_writeb(socket, TOPIC97_MISC2, reg);
120
121 /* not sure this is needed, doc is unclear */
122#if 0
123 reg = config_readb(socket, TOPIC97_AUDIO_VIDEO_SWITCH); 117 reg = config_readb(socket, TOPIC97_AUDIO_VIDEO_SWITCH);
124 reg |= TOPIC97_AVS_AUDIO_CONTROL | TOPIC97_AVS_VIDEO_CONTROL; 118 reg |= TOPIC97_AVS_AUDIO_CONTROL | TOPIC97_AVS_VIDEO_CONTROL;
125 config_writeb(socket, TOPIC97_AUDIO_VIDEO_SWITCH, reg); 119 config_writeb(socket, TOPIC97_AUDIO_VIDEO_SWITCH, reg);
126#endif 120 } else {
127 }
128 else {
129 reg_zv &= ~TOPIC97_ZV_CONTROL_ENABLE; 121 reg_zv &= ~TOPIC97_ZV_CONTROL_ENABLE;
130 config_writeb(socket, TOPIC97_ZOOM_VIDEO_CONTROL, reg_zv); 122 config_writeb(socket, TOPIC97_ZOOM_VIDEO_CONTROL, reg_zv);
131 }
132 123
124 reg = config_readb(socket, TOPIC97_AUDIO_VIDEO_SWITCH);
125 reg &= ~(TOPIC97_AVS_AUDIO_CONTROL | TOPIC97_AVS_VIDEO_CONTROL);
126 config_writeb(socket, TOPIC97_AUDIO_VIDEO_SWITCH, reg);
127 }
133} 128}
134 129
135static int topic97_override(struct yenta_socket *socket) 130static int topic97_override(struct yenta_socket *socket)
diff --git a/drivers/pcmcia/yenta_socket.c b/drivers/pcmcia/yenta_socket.c
index abe0e44c6e9e..8be4cc447a17 100644
--- a/drivers/pcmcia/yenta_socket.c
+++ b/drivers/pcmcia/yenta_socket.c
@@ -1275,16 +1275,26 @@ static int yenta_dev_resume_noirq(struct device *dev)
1275 if (socket->type && socket->type->restore_state) 1275 if (socket->type && socket->type->restore_state)
1276 socket->type->restore_state(socket); 1276 socket->type->restore_state(socket);
1277 1277
1278 return pcmcia_socket_dev_resume(dev); 1278 pcmcia_socket_dev_early_resume(dev);
1279 return 0;
1280}
1281
1282static int yenta_dev_resume(struct device *dev)
1283{
1284 pcmcia_socket_dev_late_resume(dev);
1285 return 0;
1279} 1286}
1280 1287
1281static struct dev_pm_ops yenta_pm_ops = { 1288static struct dev_pm_ops yenta_pm_ops = {
1282 .suspend_noirq = yenta_dev_suspend_noirq, 1289 .suspend_noirq = yenta_dev_suspend_noirq,
1283 .resume_noirq = yenta_dev_resume_noirq, 1290 .resume_noirq = yenta_dev_resume_noirq,
1291 .resume = yenta_dev_resume,
1284 .freeze_noirq = yenta_dev_suspend_noirq, 1292 .freeze_noirq = yenta_dev_suspend_noirq,
1285 .thaw_noirq = yenta_dev_resume_noirq, 1293 .thaw_noirq = yenta_dev_resume_noirq,
1294 .thaw = yenta_dev_resume,
1286 .poweroff_noirq = yenta_dev_suspend_noirq, 1295 .poweroff_noirq = yenta_dev_suspend_noirq,
1287 .restore_noirq = yenta_dev_resume_noirq, 1296 .restore_noirq = yenta_dev_resume_noirq,
1297 .restore = yenta_dev_resume,
1288}; 1298};
1289 1299
1290#define YENTA_PM_OPS (&yenta_pm_ops) 1300#define YENTA_PM_OPS (&yenta_pm_ops)
diff --git a/drivers/platform/x86/acerhdf.c b/drivers/platform/x86/acerhdf.c
index 0a8f735f6c4a..ab64522aaa64 100644
--- a/drivers/platform/x86/acerhdf.c
+++ b/drivers/platform/x86/acerhdf.c
@@ -52,7 +52,7 @@
52 */ 52 */
53#undef START_IN_KERNEL_MODE 53#undef START_IN_KERNEL_MODE
54 54
55#define DRV_VER "0.5.17" 55#define DRV_VER "0.5.18"
56 56
57/* 57/*
58 * According to the Atom N270 datasheet, 58 * According to the Atom N270 datasheet,
@@ -61,7 +61,7 @@
61 * measured by the on-die thermal monitor are within 0 <= Tj <= 90. So, 61 * measured by the on-die thermal monitor are within 0 <= Tj <= 90. So,
62 * assume 89°C is critical temperature. 62 * assume 89°C is critical temperature.
63 */ 63 */
64#define ACERHDF_TEMP_CRIT 89 64#define ACERHDF_TEMP_CRIT 89000
65#define ACERHDF_FAN_OFF 0 65#define ACERHDF_FAN_OFF 0
66#define ACERHDF_FAN_AUTO 1 66#define ACERHDF_FAN_AUTO 1
67 67
@@ -69,7 +69,7 @@
69 * No matter what value the user puts into the fanon variable, turn on the fan 69 * No matter what value the user puts into the fanon variable, turn on the fan
70 * at 80 degree Celsius to prevent hardware damage 70 * at 80 degree Celsius to prevent hardware damage
71 */ 71 */
72#define ACERHDF_MAX_FANON 80 72#define ACERHDF_MAX_FANON 80000
73 73
74/* 74/*
75 * Maximum interval between two temperature checks is 15 seconds, as the die 75 * Maximum interval between two temperature checks is 15 seconds, as the die
@@ -85,8 +85,8 @@ static int kernelmode;
85#endif 85#endif
86 86
87static unsigned int interval = 10; 87static unsigned int interval = 10;
88static unsigned int fanon = 63; 88static unsigned int fanon = 63000;
89static unsigned int fanoff = 58; 89static unsigned int fanoff = 58000;
90static unsigned int verbose; 90static unsigned int verbose;
91static unsigned int fanstate = ACERHDF_FAN_AUTO; 91static unsigned int fanstate = ACERHDF_FAN_AUTO;
92static char force_bios[16]; 92static char force_bios[16];
@@ -171,7 +171,7 @@ static int acerhdf_get_temp(int *temp)
171 if (ec_read(bios_cfg->tempreg, &read_temp)) 171 if (ec_read(bios_cfg->tempreg, &read_temp))
172 return -EINVAL; 172 return -EINVAL;
173 173
174 *temp = read_temp; 174 *temp = read_temp * 1000;
175 175
176 return 0; 176 return 0;
177} 177}
diff --git a/drivers/platform/x86/eeepc-laptop.c b/drivers/platform/x86/eeepc-laptop.c
index d379e74a05d0..4226e5352738 100644
--- a/drivers/platform/x86/eeepc-laptop.c
+++ b/drivers/platform/x86/eeepc-laptop.c
@@ -150,8 +150,6 @@ struct eeepc_hotk {
150/* The actual device the driver binds to */ 150/* The actual device the driver binds to */
151static struct eeepc_hotk *ehotk; 151static struct eeepc_hotk *ehotk;
152 152
153static void eeepc_rfkill_hotplug(bool real);
154
155/* Platform device/driver */ 153/* Platform device/driver */
156static int eeepc_hotk_thaw(struct device *device); 154static int eeepc_hotk_thaw(struct device *device);
157static int eeepc_hotk_restore(struct device *device); 155static int eeepc_hotk_restore(struct device *device);
@@ -345,16 +343,7 @@ static bool eeepc_wlan_rfkill_blocked(void)
345static int eeepc_rfkill_set(void *data, bool blocked) 343static int eeepc_rfkill_set(void *data, bool blocked)
346{ 344{
347 unsigned long asl = (unsigned long)data; 345 unsigned long asl = (unsigned long)data;
348 int ret; 346 return set_acpi(asl, !blocked);
349
350 if (asl != CM_ASL_WLAN)
351 return set_acpi(asl, !blocked);
352
353 /* hack to avoid panic with rt2860sta */
354 if (blocked)
355 eeepc_rfkill_hotplug(false);
356 ret = set_acpi(asl, !blocked);
357 return ret;
358} 347}
359 348
360static const struct rfkill_ops eeepc_rfkill_ops = { 349static const struct rfkill_ops eeepc_rfkill_ops = {
@@ -367,7 +356,8 @@ static void __devinit eeepc_enable_camera(void)
367 * If the following call to set_acpi() fails, it's because there's no 356 * If the following call to set_acpi() fails, it's because there's no
368 * camera so we can ignore the error. 357 * camera so we can ignore the error.
369 */ 358 */
370 set_acpi(CM_ASL_CAMERA, 1); 359 if (get_acpi(CM_ASL_CAMERA) == 0)
360 set_acpi(CM_ASL_CAMERA, 1);
371} 361}
372 362
373/* 363/*
@@ -654,13 +644,13 @@ static int eeepc_get_adapter_status(struct hotplug_slot *hotplug_slot,
654 return 0; 644 return 0;
655} 645}
656 646
657static void eeepc_rfkill_hotplug(bool real) 647static void eeepc_rfkill_hotplug(void)
658{ 648{
659 struct pci_dev *dev; 649 struct pci_dev *dev;
660 struct pci_bus *bus; 650 struct pci_bus *bus;
661 bool blocked = real ? eeepc_wlan_rfkill_blocked() : true; 651 bool blocked = eeepc_wlan_rfkill_blocked();
662 652
663 if (real && ehotk->wlan_rfkill) 653 if (ehotk->wlan_rfkill)
664 rfkill_set_sw_state(ehotk->wlan_rfkill, blocked); 654 rfkill_set_sw_state(ehotk->wlan_rfkill, blocked);
665 655
666 mutex_lock(&ehotk->hotplug_lock); 656 mutex_lock(&ehotk->hotplug_lock);
@@ -703,7 +693,7 @@ static void eeepc_rfkill_notify(acpi_handle handle, u32 event, void *data)
703 if (event != ACPI_NOTIFY_BUS_CHECK) 693 if (event != ACPI_NOTIFY_BUS_CHECK)
704 return; 694 return;
705 695
706 eeepc_rfkill_hotplug(true); 696 eeepc_rfkill_hotplug();
707} 697}
708 698
709static void eeepc_hotk_notify(struct acpi_device *device, u32 event) 699static void eeepc_hotk_notify(struct acpi_device *device, u32 event)
@@ -861,7 +851,7 @@ static int eeepc_hotk_restore(struct device *device)
861{ 851{
862 /* Refresh both wlan rfkill state and pci hotplug */ 852 /* Refresh both wlan rfkill state and pci hotplug */
863 if (ehotk->wlan_rfkill) 853 if (ehotk->wlan_rfkill)
864 eeepc_rfkill_hotplug(true); 854 eeepc_rfkill_hotplug();
865 855
866 if (ehotk->bluetooth_rfkill) 856 if (ehotk->bluetooth_rfkill)
867 rfkill_set_sw_state(ehotk->bluetooth_rfkill, 857 rfkill_set_sw_state(ehotk->bluetooth_rfkill,
@@ -1004,7 +994,7 @@ static void eeepc_rfkill_exit(void)
1004 * Refresh pci hotplug in case the rfkill state was changed after 994 * Refresh pci hotplug in case the rfkill state was changed after
1005 * eeepc_unregister_rfkill_notifier() 995 * eeepc_unregister_rfkill_notifier()
1006 */ 996 */
1007 eeepc_rfkill_hotplug(true); 997 eeepc_rfkill_hotplug();
1008 if (ehotk->hotplug_slot) 998 if (ehotk->hotplug_slot)
1009 pci_hp_deregister(ehotk->hotplug_slot); 999 pci_hp_deregister(ehotk->hotplug_slot);
1010 1000
@@ -1120,7 +1110,7 @@ static int eeepc_rfkill_init(struct device *dev)
1120 * Refresh pci hotplug in case the rfkill state was changed during 1110 * Refresh pci hotplug in case the rfkill state was changed during
1121 * setup. 1111 * setup.
1122 */ 1112 */
1123 eeepc_rfkill_hotplug(true); 1113 eeepc_rfkill_hotplug();
1124 1114
1125exit: 1115exit:
1126 if (result && result != -ENODEV) 1116 if (result && result != -ENODEV)
diff --git a/drivers/platform/x86/thinkpad_acpi.c b/drivers/platform/x86/thinkpad_acpi.c
index d93108d148fc..a848c7e20aeb 100644
--- a/drivers/platform/x86/thinkpad_acpi.c
+++ b/drivers/platform/x86/thinkpad_acpi.c
@@ -1680,36 +1680,48 @@ static void tpacpi_remove_driver_attributes(struct device_driver *drv)
1680 | (__bv1) << 8 | (__bv2) } 1680 | (__bv1) << 8 | (__bv2) }
1681 1681
1682#define TPV_Q_X(__v, __bid1, __bid2, __bv1, __bv2, \ 1682#define TPV_Q_X(__v, __bid1, __bid2, __bv1, __bv2, \
1683 __eid1, __eid2, __ev1, __ev2) \ 1683 __eid, __ev1, __ev2) \
1684 { .vendor = (__v), \ 1684 { .vendor = (__v), \
1685 .bios = TPID(__bid1, __bid2), \ 1685 .bios = TPID(__bid1, __bid2), \
1686 .ec = TPID(__eid1, __eid2), \ 1686 .ec = __eid, \
1687 .quirks = (__ev1) << 24 | (__ev2) << 16 \ 1687 .quirks = (__ev1) << 24 | (__ev2) << 16 \
1688 | (__bv1) << 8 | (__bv2) } 1688 | (__bv1) << 8 | (__bv2) }
1689 1689
1690#define TPV_QI0(__id1, __id2, __bv1, __bv2) \ 1690#define TPV_QI0(__id1, __id2, __bv1, __bv2) \
1691 TPV_Q(PCI_VENDOR_ID_IBM, __id1, __id2, __bv1, __bv2) 1691 TPV_Q(PCI_VENDOR_ID_IBM, __id1, __id2, __bv1, __bv2)
1692 1692
1693/* Outdated IBM BIOSes often lack the EC id string */
1693#define TPV_QI1(__id1, __id2, __bv1, __bv2, __ev1, __ev2) \ 1694#define TPV_QI1(__id1, __id2, __bv1, __bv2, __ev1, __ev2) \
1694 TPV_Q_X(PCI_VENDOR_ID_IBM, __id1, __id2, \ 1695 TPV_Q_X(PCI_VENDOR_ID_IBM, __id1, __id2, \
1695 __bv1, __bv2, __id1, __id2, __ev1, __ev2) 1696 __bv1, __bv2, TPID(__id1, __id2), \
1697 __ev1, __ev2), \
1698 TPV_Q_X(PCI_VENDOR_ID_IBM, __id1, __id2, \
1699 __bv1, __bv2, TPACPI_MATCH_UNKNOWN, \
1700 __ev1, __ev2)
1696 1701
1702/* Outdated IBM BIOSes often lack the EC id string */
1697#define TPV_QI2(__bid1, __bid2, __bv1, __bv2, \ 1703#define TPV_QI2(__bid1, __bid2, __bv1, __bv2, \
1698 __eid1, __eid2, __ev1, __ev2) \ 1704 __eid1, __eid2, __ev1, __ev2) \
1699 TPV_Q_X(PCI_VENDOR_ID_IBM, __bid1, __bid2, \ 1705 TPV_Q_X(PCI_VENDOR_ID_IBM, __bid1, __bid2, \
1700 __bv1, __bv2, __eid1, __eid2, __ev1, __ev2) 1706 __bv1, __bv2, TPID(__eid1, __eid2), \
1707 __ev1, __ev2), \
1708 TPV_Q_X(PCI_VENDOR_ID_IBM, __bid1, __bid2, \
1709 __bv1, __bv2, TPACPI_MATCH_UNKNOWN, \
1710 __ev1, __ev2)
1701 1711
1702#define TPV_QL0(__id1, __id2, __bv1, __bv2) \ 1712#define TPV_QL0(__id1, __id2, __bv1, __bv2) \
1703 TPV_Q(PCI_VENDOR_ID_LENOVO, __id1, __id2, __bv1, __bv2) 1713 TPV_Q(PCI_VENDOR_ID_LENOVO, __id1, __id2, __bv1, __bv2)
1704 1714
1705#define TPV_QL1(__id1, __id2, __bv1, __bv2, __ev1, __ev2) \ 1715#define TPV_QL1(__id1, __id2, __bv1, __bv2, __ev1, __ev2) \
1706 TPV_Q_X(PCI_VENDOR_ID_LENOVO, __id1, __id2, \ 1716 TPV_Q_X(PCI_VENDOR_ID_LENOVO, __id1, __id2, \
1707 __bv1, __bv2, __id1, __id2, __ev1, __ev2) 1717 __bv1, __bv2, TPID(__id1, __id2), \
1718 __ev1, __ev2)
1708 1719
1709#define TPV_QL2(__bid1, __bid2, __bv1, __bv2, \ 1720#define TPV_QL2(__bid1, __bid2, __bv1, __bv2, \
1710 __eid1, __eid2, __ev1, __ev2) \ 1721 __eid1, __eid2, __ev1, __ev2) \
1711 TPV_Q_X(PCI_VENDOR_ID_LENOVO, __bid1, __bid2, \ 1722 TPV_Q_X(PCI_VENDOR_ID_LENOVO, __bid1, __bid2, \
1712 __bv1, __bv2, __eid1, __eid2, __ev1, __ev2) 1723 __bv1, __bv2, TPID(__eid1, __eid2), \
1724 __ev1, __ev2)
1713 1725
1714static const struct tpacpi_quirk tpacpi_bios_version_qtable[] __initconst = { 1726static const struct tpacpi_quirk tpacpi_bios_version_qtable[] __initconst = {
1715 /* Numeric models ------------------ */ 1727 /* Numeric models ------------------ */
@@ -6313,7 +6325,7 @@ static int brightness_write(char *buf)
6313 * Doing it this way makes the syscall restartable in case of EINTR 6325 * Doing it this way makes the syscall restartable in case of EINTR
6314 */ 6326 */
6315 rc = brightness_set(level); 6327 rc = brightness_set(level);
6316 return (rc == -EINTR)? ERESTARTSYS : rc; 6328 return (rc == -EINTR)? -ERESTARTSYS : rc;
6317} 6329}
6318 6330
6319static struct ibm_struct brightness_driver_data = { 6331static struct ibm_struct brightness_driver_data = {
diff --git a/drivers/pps/kapi.c b/drivers/pps/kapi.c
index 35a0b192d768..2d414e23d390 100644
--- a/drivers/pps/kapi.c
+++ b/drivers/pps/kapi.c
@@ -271,6 +271,7 @@ void pps_event(int source, struct pps_ktime *ts, int event, void *data)
271{ 271{
272 struct pps_device *pps; 272 struct pps_device *pps;
273 unsigned long flags; 273 unsigned long flags;
274 int captured = 0;
274 275
275 if ((event & (PPS_CAPTUREASSERT | PPS_CAPTURECLEAR)) == 0) { 276 if ((event & (PPS_CAPTUREASSERT | PPS_CAPTURECLEAR)) == 0) {
276 printk(KERN_ERR "pps: unknown event (%x) for source %d\n", 277 printk(KERN_ERR "pps: unknown event (%x) for source %d\n",
@@ -293,7 +294,8 @@ void pps_event(int source, struct pps_ktime *ts, int event, void *data)
293 294
294 /* Check the event */ 295 /* Check the event */
295 pps->current_mode = pps->params.mode; 296 pps->current_mode = pps->params.mode;
296 if (event & PPS_CAPTUREASSERT) { 297 if ((event & PPS_CAPTUREASSERT) &
298 (pps->params.mode & PPS_CAPTUREASSERT)) {
297 /* We have to add an offset? */ 299 /* We have to add an offset? */
298 if (pps->params.mode & PPS_OFFSETASSERT) 300 if (pps->params.mode & PPS_OFFSETASSERT)
299 pps_add_offset(ts, &pps->params.assert_off_tu); 301 pps_add_offset(ts, &pps->params.assert_off_tu);
@@ -303,8 +305,11 @@ void pps_event(int source, struct pps_ktime *ts, int event, void *data)
303 pps->assert_sequence++; 305 pps->assert_sequence++;
304 pr_debug("capture assert seq #%u for source %d\n", 306 pr_debug("capture assert seq #%u for source %d\n",
305 pps->assert_sequence, source); 307 pps->assert_sequence, source);
308
309 captured = ~0;
306 } 310 }
307 if (event & PPS_CAPTURECLEAR) { 311 if ((event & PPS_CAPTURECLEAR) &
312 (pps->params.mode & PPS_CAPTURECLEAR)) {
308 /* We have to add an offset? */ 313 /* We have to add an offset? */
309 if (pps->params.mode & PPS_OFFSETCLEAR) 314 if (pps->params.mode & PPS_OFFSETCLEAR)
310 pps_add_offset(ts, &pps->params.clear_off_tu); 315 pps_add_offset(ts, &pps->params.clear_off_tu);
@@ -314,12 +319,17 @@ void pps_event(int source, struct pps_ktime *ts, int event, void *data)
314 pps->clear_sequence++; 319 pps->clear_sequence++;
315 pr_debug("capture clear seq #%u for source %d\n", 320 pr_debug("capture clear seq #%u for source %d\n",
316 pps->clear_sequence, source); 321 pps->clear_sequence, source);
322
323 captured = ~0;
317 } 324 }
318 325
319 pps->go = ~0; 326 /* Wake up iif captured somthing */
320 wake_up_interruptible(&pps->queue); 327 if (captured) {
328 pps->go = ~0;
329 wake_up_interruptible(&pps->queue);
321 330
322 kill_fasync(&pps->async_queue, SIGIO, POLL_IN); 331 kill_fasync(&pps->async_queue, SIGIO, POLL_IN);
332 }
323 333
324 spin_unlock_irqrestore(&pps->lock, flags); 334 spin_unlock_irqrestore(&pps->lock, flags);
325 335
diff --git a/drivers/pps/pps.c b/drivers/pps/pps.c
index fea17e7805e9..ca5183bdad85 100644
--- a/drivers/pps/pps.c
+++ b/drivers/pps/pps.c
@@ -71,9 +71,14 @@ static long pps_cdev_ioctl(struct file *file,
71 case PPS_GETPARAMS: 71 case PPS_GETPARAMS:
72 pr_debug("PPS_GETPARAMS: source %d\n", pps->id); 72 pr_debug("PPS_GETPARAMS: source %d\n", pps->id);
73 73
74 /* Return current parameters */ 74 spin_lock_irq(&pps->lock);
75 err = copy_to_user(uarg, &pps->params, 75
76 sizeof(struct pps_kparams)); 76 /* Get the current parameters */
77 params = pps->params;
78
79 spin_unlock_irq(&pps->lock);
80
81 err = copy_to_user(uarg, &params, sizeof(struct pps_kparams));
77 if (err) 82 if (err)
78 return -EFAULT; 83 return -EFAULT;
79 84
diff --git a/drivers/regulator/core.c b/drivers/regulator/core.c
index 744ea1d0b59b..efe568deda12 100644
--- a/drivers/regulator/core.c
+++ b/drivers/regulator/core.c
@@ -1283,7 +1283,8 @@ static int _regulator_disable(struct regulator_dev *rdev)
1283 return -EIO; 1283 return -EIO;
1284 1284
1285 /* are we the last user and permitted to disable ? */ 1285 /* are we the last user and permitted to disable ? */
1286 if (rdev->use_count == 1 && !rdev->constraints->always_on) { 1286 if (rdev->use_count == 1 &&
1287 (rdev->constraints && !rdev->constraints->always_on)) {
1287 1288
1288 /* we are last user */ 1289 /* we are last user */
1289 if (_regulator_can_change_status(rdev) && 1290 if (_regulator_can_change_status(rdev) &&
diff --git a/drivers/regulator/fixed.c b/drivers/regulator/fixed.c
index f8b295700d7d..f9f516a3028a 100644
--- a/drivers/regulator/fixed.c
+++ b/drivers/regulator/fixed.c
@@ -196,11 +196,10 @@ static int regulator_fixed_voltage_remove(struct platform_device *pdev)
196 struct fixed_voltage_data *drvdata = platform_get_drvdata(pdev); 196 struct fixed_voltage_data *drvdata = platform_get_drvdata(pdev);
197 197
198 regulator_unregister(drvdata->dev); 198 regulator_unregister(drvdata->dev);
199 kfree(drvdata->desc.name);
200 kfree(drvdata);
201
202 if (gpio_is_valid(drvdata->gpio)) 199 if (gpio_is_valid(drvdata->gpio))
203 gpio_free(drvdata->gpio); 200 gpio_free(drvdata->gpio);
201 kfree(drvdata->desc.name);
202 kfree(drvdata);
204 203
205 return 0; 204 return 0;
206} 205}
diff --git a/drivers/regulator/wm831x-isink.c b/drivers/regulator/wm831x-isink.c
index 1d8d9879d3a1..48857008758c 100644
--- a/drivers/regulator/wm831x-isink.c
+++ b/drivers/regulator/wm831x-isink.c
@@ -167,6 +167,8 @@ static __devinit int wm831x_isink_probe(struct platform_device *pdev)
167 return -ENOMEM; 167 return -ENOMEM;
168 } 168 }
169 169
170 isink->wm831x = wm831x;
171
170 res = platform_get_resource(pdev, IORESOURCE_IO, 0); 172 res = platform_get_resource(pdev, IORESOURCE_IO, 0);
171 if (res == NULL) { 173 if (res == NULL) {
172 dev_err(&pdev->dev, "No I/O resource\n"); 174 dev_err(&pdev->dev, "No I/O resource\n");
diff --git a/drivers/regulator/wm831x-ldo.c b/drivers/regulator/wm831x-ldo.c
index bb61aede4801..902db56ce099 100644
--- a/drivers/regulator/wm831x-ldo.c
+++ b/drivers/regulator/wm831x-ldo.c
@@ -175,18 +175,18 @@ static unsigned int wm831x_gp_ldo_get_mode(struct regulator_dev *rdev)
175 struct wm831x *wm831x = ldo->wm831x; 175 struct wm831x *wm831x = ldo->wm831x;
176 int ctrl_reg = ldo->base + WM831X_LDO_CONTROL; 176 int ctrl_reg = ldo->base + WM831X_LDO_CONTROL;
177 int on_reg = ldo->base + WM831X_LDO_ON_CONTROL; 177 int on_reg = ldo->base + WM831X_LDO_ON_CONTROL;
178 unsigned int ret; 178 int ret;
179 179
180 ret = wm831x_reg_read(wm831x, on_reg); 180 ret = wm831x_reg_read(wm831x, on_reg);
181 if (ret < 0) 181 if (ret < 0)
182 return 0; 182 return ret;
183 183
184 if (!(ret & WM831X_LDO1_ON_MODE)) 184 if (!(ret & WM831X_LDO1_ON_MODE))
185 return REGULATOR_MODE_NORMAL; 185 return REGULATOR_MODE_NORMAL;
186 186
187 ret = wm831x_reg_read(wm831x, ctrl_reg); 187 ret = wm831x_reg_read(wm831x, ctrl_reg);
188 if (ret < 0) 188 if (ret < 0)
189 return 0; 189 return ret;
190 190
191 if (ret & WM831X_LDO1_LP_MODE) 191 if (ret & WM831X_LDO1_LP_MODE)
192 return REGULATOR_MODE_STANDBY; 192 return REGULATOR_MODE_STANDBY;
diff --git a/drivers/rtc/rtc-coh901331.c b/drivers/rtc/rtc-coh901331.c
index 7fe1fa26c52c..03ea530981d1 100644
--- a/drivers/rtc/rtc-coh901331.c
+++ b/drivers/rtc/rtc-coh901331.c
@@ -58,7 +58,16 @@ static irqreturn_t coh901331_interrupt(int irq, void *data)
58 clk_enable(rtap->clk); 58 clk_enable(rtap->clk);
59 /* Ack IRQ */ 59 /* Ack IRQ */
60 writel(1, rtap->virtbase + COH901331_IRQ_EVENT); 60 writel(1, rtap->virtbase + COH901331_IRQ_EVENT);
61 /*
62 * Disable the interrupt. This is necessary because
63 * the RTC lives on a lower-clocked line and will
64 * not release the IRQ line until after a few (slower)
65 * clock cycles. The interrupt will be re-enabled when
66 * a new alarm is set anyway.
67 */
68 writel(0, rtap->virtbase + COH901331_IRQ_MASK);
61 clk_disable(rtap->clk); 69 clk_disable(rtap->clk);
70
62 /* Set alarm flag */ 71 /* Set alarm flag */
63 rtc_update_irq(rtap->rtc, 1, RTC_AF); 72 rtc_update_irq(rtap->rtc, 1, RTC_AF);
64 73
@@ -128,6 +137,8 @@ static int coh901331_alarm_irq_enable(struct device *dev, unsigned int enabled)
128 else 137 else
129 writel(0, rtap->virtbase + COH901331_IRQ_MASK); 138 writel(0, rtap->virtbase + COH901331_IRQ_MASK);
130 clk_disable(rtap->clk); 139 clk_disable(rtap->clk);
140
141 return 0;
131} 142}
132 143
133static struct rtc_class_ops coh901331_ops = { 144static struct rtc_class_ops coh901331_ops = {
diff --git a/drivers/rtc/rtc-pcf50633.c b/drivers/rtc/rtc-pcf50633.c
index f4dd87e29075..4c5d5d0c4cfc 100644
--- a/drivers/rtc/rtc-pcf50633.c
+++ b/drivers/rtc/rtc-pcf50633.c
@@ -70,7 +70,7 @@ static void pcf2rtc_time(struct rtc_time *rtc, struct pcf50633_time *pcf)
70 rtc->tm_hour = bcd2bin(pcf->time[PCF50633_TI_HOUR]); 70 rtc->tm_hour = bcd2bin(pcf->time[PCF50633_TI_HOUR]);
71 rtc->tm_wday = bcd2bin(pcf->time[PCF50633_TI_WKDAY]); 71 rtc->tm_wday = bcd2bin(pcf->time[PCF50633_TI_WKDAY]);
72 rtc->tm_mday = bcd2bin(pcf->time[PCF50633_TI_DAY]); 72 rtc->tm_mday = bcd2bin(pcf->time[PCF50633_TI_DAY]);
73 rtc->tm_mon = bcd2bin(pcf->time[PCF50633_TI_MONTH]); 73 rtc->tm_mon = bcd2bin(pcf->time[PCF50633_TI_MONTH]) - 1;
74 rtc->tm_year = bcd2bin(pcf->time[PCF50633_TI_YEAR]) + 100; 74 rtc->tm_year = bcd2bin(pcf->time[PCF50633_TI_YEAR]) + 100;
75} 75}
76 76
@@ -81,7 +81,7 @@ static void rtc2pcf_time(struct pcf50633_time *pcf, struct rtc_time *rtc)
81 pcf->time[PCF50633_TI_HOUR] = bin2bcd(rtc->tm_hour); 81 pcf->time[PCF50633_TI_HOUR] = bin2bcd(rtc->tm_hour);
82 pcf->time[PCF50633_TI_WKDAY] = bin2bcd(rtc->tm_wday); 82 pcf->time[PCF50633_TI_WKDAY] = bin2bcd(rtc->tm_wday);
83 pcf->time[PCF50633_TI_DAY] = bin2bcd(rtc->tm_mday); 83 pcf->time[PCF50633_TI_DAY] = bin2bcd(rtc->tm_mday);
84 pcf->time[PCF50633_TI_MONTH] = bin2bcd(rtc->tm_mon); 84 pcf->time[PCF50633_TI_MONTH] = bin2bcd(rtc->tm_mon + 1);
85 pcf->time[PCF50633_TI_YEAR] = bin2bcd(rtc->tm_year % 100); 85 pcf->time[PCF50633_TI_YEAR] = bin2bcd(rtc->tm_year % 100);
86} 86}
87 87
@@ -245,8 +245,9 @@ static int pcf50633_rtc_set_alarm(struct device *dev, struct rtc_wkalrm *alrm)
245 ret = pcf50633_write_block(rtc->pcf, PCF50633_REG_RTCSCA, 245 ret = pcf50633_write_block(rtc->pcf, PCF50633_REG_RTCSCA,
246 PCF50633_TI_EXTENT, &pcf_tm.time[0]); 246 PCF50633_TI_EXTENT, &pcf_tm.time[0]);
247 247
248 if (!alarm_masked) 248 if (!alarm_masked || alrm->enabled)
249 pcf50633_irq_unmask(rtc->pcf, PCF50633_IRQ_ALARM); 249 pcf50633_irq_unmask(rtc->pcf, PCF50633_IRQ_ALARM);
250 rtc->alarm_enabled = alrm->enabled;
250 251
251 return ret; 252 return ret;
252} 253}
@@ -291,8 +292,9 @@ static int __devinit pcf50633_rtc_probe(struct platform_device *pdev)
291 &pcf50633_rtc_ops, THIS_MODULE); 292 &pcf50633_rtc_ops, THIS_MODULE);
292 293
293 if (IS_ERR(rtc->rtc_dev)) { 294 if (IS_ERR(rtc->rtc_dev)) {
295 int ret = PTR_ERR(rtc->rtc_dev);
294 kfree(rtc); 296 kfree(rtc);
295 return PTR_ERR(rtc->rtc_dev); 297 return ret;
296 } 298 }
297 299
298 pcf50633_register_irq(rtc->pcf, PCF50633_IRQ_ALARM, 300 pcf50633_register_irq(rtc->pcf, PCF50633_IRQ_ALARM,
diff --git a/drivers/rtc/rtc-v3020.c b/drivers/rtc/rtc-v3020.c
index ad164056feb6..423cd5a30b10 100644
--- a/drivers/rtc/rtc-v3020.c
+++ b/drivers/rtc/rtc-v3020.c
@@ -96,7 +96,7 @@ static void v3020_mmio_write_bit(struct v3020 *chip, unsigned char bit)
96 96
97static unsigned char v3020_mmio_read_bit(struct v3020 *chip) 97static unsigned char v3020_mmio_read_bit(struct v3020 *chip)
98{ 98{
99 return readl(chip->ioaddress) & (1 << chip->leftshift); 99 return !!(readl(chip->ioaddress) & (1 << chip->leftshift));
100} 100}
101 101
102static struct v3020_chip_ops v3020_mmio_ops = { 102static struct v3020_chip_ops v3020_mmio_ops = {
diff --git a/drivers/rtc/rtc-vr41xx.c b/drivers/rtc/rtc-vr41xx.c
index 2c839d0d21bd..fadddac1e5a4 100644
--- a/drivers/rtc/rtc-vr41xx.c
+++ b/drivers/rtc/rtc-vr41xx.c
@@ -209,19 +209,18 @@ static int vr41xx_rtc_set_alarm(struct device *dev, struct rtc_wkalrm *wkalrm)
209 209
210static int vr41xx_rtc_irq_set_freq(struct device *dev, int freq) 210static int vr41xx_rtc_irq_set_freq(struct device *dev, int freq)
211{ 211{
212 unsigned long count; 212 u64 count;
213 213
214 if (!is_power_of_2(freq)) 214 if (!is_power_of_2(freq))
215 return -EINVAL; 215 return -EINVAL;
216 count = RTC_FREQUENCY; 216 count = RTC_FREQUENCY;
217 do_div(count, freq); 217 do_div(count, freq);
218 218
219 periodic_count = count;
220
221 spin_lock_irq(&rtc_lock); 219 spin_lock_irq(&rtc_lock);
222 220
223 rtc1_write(RTCL1LREG, count); 221 periodic_count = count;
224 rtc1_write(RTCL1HREG, count >> 16); 222 rtc1_write(RTCL1LREG, periodic_count);
223 rtc1_write(RTCL1HREG, periodic_count >> 16);
225 224
226 spin_unlock_irq(&rtc_lock); 225 spin_unlock_irq(&rtc_lock);
227 226
diff --git a/drivers/rtc/rtc-x1205.c b/drivers/rtc/rtc-x1205.c
index 310c10795e9a..6583c1a8b070 100644
--- a/drivers/rtc/rtc-x1205.c
+++ b/drivers/rtc/rtc-x1205.c
@@ -195,7 +195,7 @@ static int x1205_set_datetime(struct i2c_client *client, struct rtc_time *tm,
195 /* year, since the rtc epoch*/ 195 /* year, since the rtc epoch*/
196 buf[CCR_YEAR] = bin2bcd(tm->tm_year % 100); 196 buf[CCR_YEAR] = bin2bcd(tm->tm_year % 100);
197 buf[CCR_WDAY] = tm->tm_wday & 0x07; 197 buf[CCR_WDAY] = tm->tm_wday & 0x07;
198 buf[CCR_Y2K] = bin2bcd(tm->tm_year / 100); 198 buf[CCR_Y2K] = bin2bcd((tm->tm_year + 1900) / 100);
199 } 199 }
200 200
201 /* If writing alarm registers, set compare bits on registers 0-4 */ 201 /* If writing alarm registers, set compare bits on registers 0-4 */
@@ -280,9 +280,9 @@ static int x1205_fix_osc(struct i2c_client *client)
280 int err; 280 int err;
281 struct rtc_time tm; 281 struct rtc_time tm;
282 282
283 tm.tm_hour = tm.tm_min = tm.tm_sec = 0; 283 memset(&tm, 0, sizeof(tm));
284 284
285 err = x1205_set_datetime(client, &tm, 0, X1205_CCR_BASE, 0); 285 err = x1205_set_datetime(client, &tm, 1, X1205_CCR_BASE, 0);
286 if (err < 0) 286 if (err < 0)
287 dev_err(&client->dev, "unable to restart the oscillator\n"); 287 dev_err(&client->dev, "unable to restart the oscillator\n");
288 288
diff --git a/drivers/s390/char/monreader.c b/drivers/s390/char/monreader.c
index 89ece1c235aa..66e21dd23154 100644
--- a/drivers/s390/char/monreader.c
+++ b/drivers/s390/char/monreader.c
@@ -357,6 +357,7 @@ static int mon_close(struct inode *inode, struct file *filp)
357 atomic_set(&monpriv->msglim_count, 0); 357 atomic_set(&monpriv->msglim_count, 0);
358 monpriv->write_index = 0; 358 monpriv->write_index = 0;
359 monpriv->read_index = 0; 359 monpriv->read_index = 0;
360 dev_set_drvdata(monreader_device, NULL);
360 361
361 for (i = 0; i < MON_MSGLIM; i++) 362 for (i = 0; i < MON_MSGLIM; i++)
362 kfree(monpriv->msg_array[i]); 363 kfree(monpriv->msg_array[i]);
diff --git a/drivers/s390/char/sclp_quiesce.c b/drivers/s390/char/sclp_quiesce.c
index 84c191c1cd62..05909a7df8b3 100644
--- a/drivers/s390/char/sclp_quiesce.c
+++ b/drivers/s390/char/sclp_quiesce.c
@@ -20,9 +20,12 @@
20 20
21#include "sclp.h" 21#include "sclp.h"
22 22
23static void (*old_machine_restart)(char *);
24static void (*old_machine_halt)(void);
25static void (*old_machine_power_off)(void);
26
23/* Shutdown handler. Signal completion of shutdown by loading special PSW. */ 27/* Shutdown handler. Signal completion of shutdown by loading special PSW. */
24static void 28static void do_machine_quiesce(void)
25do_machine_quiesce(void)
26{ 29{
27 psw_t quiesce_psw; 30 psw_t quiesce_psw;
28 31
@@ -33,23 +36,48 @@ do_machine_quiesce(void)
33} 36}
34 37
35/* Handler for quiesce event. Start shutdown procedure. */ 38/* Handler for quiesce event. Start shutdown procedure. */
36static void 39static void sclp_quiesce_handler(struct evbuf_header *evbuf)
37sclp_quiesce_handler(struct evbuf_header *evbuf)
38{ 40{
39 _machine_restart = (void *) do_machine_quiesce; 41 if (_machine_restart != (void *) do_machine_quiesce) {
40 _machine_halt = do_machine_quiesce; 42 old_machine_restart = _machine_restart;
41 _machine_power_off = do_machine_quiesce; 43 old_machine_halt = _machine_halt;
44 old_machine_power_off = _machine_power_off;
45 _machine_restart = (void *) do_machine_quiesce;
46 _machine_halt = do_machine_quiesce;
47 _machine_power_off = do_machine_quiesce;
48 }
42 ctrl_alt_del(); 49 ctrl_alt_del();
43} 50}
44 51
52/* Undo machine restart/halt/power_off modification on resume */
53static void sclp_quiesce_pm_event(struct sclp_register *reg,
54 enum sclp_pm_event sclp_pm_event)
55{
56 switch (sclp_pm_event) {
57 case SCLP_PM_EVENT_RESTORE:
58 if (old_machine_restart) {
59 _machine_restart = old_machine_restart;
60 _machine_halt = old_machine_halt;
61 _machine_power_off = old_machine_power_off;
62 old_machine_restart = NULL;
63 old_machine_halt = NULL;
64 old_machine_power_off = NULL;
65 }
66 break;
67 case SCLP_PM_EVENT_FREEZE:
68 case SCLP_PM_EVENT_THAW:
69 break;
70 }
71}
72
45static struct sclp_register sclp_quiesce_event = { 73static struct sclp_register sclp_quiesce_event = {
46 .receive_mask = EVTYP_SIGQUIESCE_MASK, 74 .receive_mask = EVTYP_SIGQUIESCE_MASK,
47 .receiver_fn = sclp_quiesce_handler 75 .receiver_fn = sclp_quiesce_handler,
76 .pm_event_fn = sclp_quiesce_pm_event
48}; 77};
49 78
50/* Initialize quiesce driver. */ 79/* Initialize quiesce driver. */
51static int __init 80static int __init sclp_quiesce_init(void)
52sclp_quiesce_init(void)
53{ 81{
54 return sclp_register(&sclp_quiesce_event); 82 return sclp_register(&sclp_quiesce_event);
55} 83}
diff --git a/drivers/scsi/bfa/bfad_fwimg.c b/drivers/scsi/bfa/bfad_fwimg.c
index b2f6949bc8d3..bd34b0db2d6b 100644
--- a/drivers/scsi/bfa/bfad_fwimg.c
+++ b/drivers/scsi/bfa/bfad_fwimg.c
@@ -41,6 +41,8 @@ u32 *bfi_image_cb;
41 41
42#define BFAD_FW_FILE_CT "ctfw.bin" 42#define BFAD_FW_FILE_CT "ctfw.bin"
43#define BFAD_FW_FILE_CB "cbfw.bin" 43#define BFAD_FW_FILE_CB "cbfw.bin"
44MODULE_FIRMWARE(BFAD_FW_FILE_CT);
45MODULE_FIRMWARE(BFAD_FW_FILE_CB);
44 46
45u32 * 47u32 *
46bfad_read_firmware(struct pci_dev *pdev, u32 **bfi_image, 48bfad_read_firmware(struct pci_dev *pdev, u32 **bfi_image,
diff --git a/drivers/scsi/bfa/bfad_im.c b/drivers/scsi/bfa/bfad_im.c
index 158c99243c08..55d012a9a668 100644
--- a/drivers/scsi/bfa/bfad_im.c
+++ b/drivers/scsi/bfa/bfad_im.c
@@ -948,7 +948,7 @@ bfad_os_fc_host_init(struct bfad_im_port_s *im_port)
948 if (bfad_supported_fc4s & (BFA_PORT_ROLE_FCP_IM | BFA_PORT_ROLE_FCP_TM)) 948 if (bfad_supported_fc4s & (BFA_PORT_ROLE_FCP_IM | BFA_PORT_ROLE_FCP_TM))
949 /* For FCP type 0x08 */ 949 /* For FCP type 0x08 */
950 fc_host_supported_fc4s(host)[2] = 1; 950 fc_host_supported_fc4s(host)[2] = 1;
951 if (bfad_supported_fc4s | BFA_PORT_ROLE_FCP_IPFC) 951 if (bfad_supported_fc4s & BFA_PORT_ROLE_FCP_IPFC)
952 /* For LLC/SNAP type 0x05 */ 952 /* For LLC/SNAP type 0x05 */
953 fc_host_supported_fc4s(host)[3] = 0x20; 953 fc_host_supported_fc4s(host)[3] = 0x20;
954 /* For fibre channel services type 0x20 */ 954 /* For fibre channel services type 0x20 */
diff --git a/drivers/scsi/gdth.c b/drivers/scsi/gdth.c
index 185e6bc4dd40..9e8fce0f0c1b 100644
--- a/drivers/scsi/gdth.c
+++ b/drivers/scsi/gdth.c
@@ -2900,7 +2900,7 @@ static int gdth_read_event(gdth_ha_str *ha, int handle, gdth_evt_str *estr)
2900 eindex = handle; 2900 eindex = handle;
2901 estr->event_source = 0; 2901 estr->event_source = 0;
2902 2902
2903 if (eindex >= MAX_EVENTS) { 2903 if (eindex < 0 || eindex >= MAX_EVENTS) {
2904 spin_unlock_irqrestore(&ha->smp_lock, flags); 2904 spin_unlock_irqrestore(&ha->smp_lock, flags);
2905 return eindex; 2905 return eindex;
2906 } 2906 }
diff --git a/drivers/scsi/hosts.c b/drivers/scsi/hosts.c
index 5fd2da494d08..c968cc31cd86 100644
--- a/drivers/scsi/hosts.c
+++ b/drivers/scsi/hosts.c
@@ -164,8 +164,8 @@ void scsi_remove_host(struct Scsi_Host *shost)
164 return; 164 return;
165 } 165 }
166 spin_unlock_irqrestore(shost->host_lock, flags); 166 spin_unlock_irqrestore(shost->host_lock, flags);
167 mutex_unlock(&shost->scan_mutex);
168 scsi_forget_host(shost); 167 scsi_forget_host(shost);
168 mutex_unlock(&shost->scan_mutex);
169 scsi_proc_host_rm(shost); 169 scsi_proc_host_rm(shost);
170 170
171 spin_lock_irqsave(shost->host_lock, flags); 171 spin_lock_irqsave(shost->host_lock, flags);
diff --git a/drivers/scsi/ipr.c b/drivers/scsi/ipr.c
index 5f045505a1f4..76d294fc7846 100644
--- a/drivers/scsi/ipr.c
+++ b/drivers/scsi/ipr.c
@@ -4189,6 +4189,25 @@ static irqreturn_t ipr_handle_other_interrupt(struct ipr_ioa_cfg *ioa_cfg,
4189} 4189}
4190 4190
4191/** 4191/**
4192 * ipr_isr_eh - Interrupt service routine error handler
4193 * @ioa_cfg: ioa config struct
4194 * @msg: message to log
4195 *
4196 * Return value:
4197 * none
4198 **/
4199static void ipr_isr_eh(struct ipr_ioa_cfg *ioa_cfg, char *msg)
4200{
4201 ioa_cfg->errors_logged++;
4202 dev_err(&ioa_cfg->pdev->dev, "%s\n", msg);
4203
4204 if (WAIT_FOR_DUMP == ioa_cfg->sdt_state)
4205 ioa_cfg->sdt_state = GET_DUMP;
4206
4207 ipr_initiate_ioa_reset(ioa_cfg, IPR_SHUTDOWN_NONE);
4208}
4209
4210/**
4192 * ipr_isr - Interrupt service routine 4211 * ipr_isr - Interrupt service routine
4193 * @irq: irq number 4212 * @irq: irq number
4194 * @devp: pointer to ioa config struct 4213 * @devp: pointer to ioa config struct
@@ -4203,6 +4222,7 @@ static irqreturn_t ipr_isr(int irq, void *devp)
4203 volatile u32 int_reg, int_mask_reg; 4222 volatile u32 int_reg, int_mask_reg;
4204 u32 ioasc; 4223 u32 ioasc;
4205 u16 cmd_index; 4224 u16 cmd_index;
4225 int num_hrrq = 0;
4206 struct ipr_cmnd *ipr_cmd; 4226 struct ipr_cmnd *ipr_cmd;
4207 irqreturn_t rc = IRQ_NONE; 4227 irqreturn_t rc = IRQ_NONE;
4208 4228
@@ -4233,13 +4253,7 @@ static irqreturn_t ipr_isr(int irq, void *devp)
4233 IPR_HRRQ_REQ_RESP_HANDLE_MASK) >> IPR_HRRQ_REQ_RESP_HANDLE_SHIFT; 4253 IPR_HRRQ_REQ_RESP_HANDLE_MASK) >> IPR_HRRQ_REQ_RESP_HANDLE_SHIFT;
4234 4254
4235 if (unlikely(cmd_index >= IPR_NUM_CMD_BLKS)) { 4255 if (unlikely(cmd_index >= IPR_NUM_CMD_BLKS)) {
4236 ioa_cfg->errors_logged++; 4256 ipr_isr_eh(ioa_cfg, "Invalid response handle from IOA");
4237 dev_err(&ioa_cfg->pdev->dev, "Invalid response handle from IOA\n");
4238
4239 if (WAIT_FOR_DUMP == ioa_cfg->sdt_state)
4240 ioa_cfg->sdt_state = GET_DUMP;
4241
4242 ipr_initiate_ioa_reset(ioa_cfg, IPR_SHUTDOWN_NONE);
4243 spin_unlock_irqrestore(ioa_cfg->host->host_lock, lock_flags); 4257 spin_unlock_irqrestore(ioa_cfg->host->host_lock, lock_flags);
4244 return IRQ_HANDLED; 4258 return IRQ_HANDLED;
4245 } 4259 }
@@ -4266,8 +4280,18 @@ static irqreturn_t ipr_isr(int irq, void *devp)
4266 4280
4267 if (ipr_cmd != NULL) { 4281 if (ipr_cmd != NULL) {
4268 /* Clear the PCI interrupt */ 4282 /* Clear the PCI interrupt */
4269 writel(IPR_PCII_HRRQ_UPDATED, ioa_cfg->regs.clr_interrupt_reg); 4283 do {
4270 int_reg = readl(ioa_cfg->regs.sense_interrupt_reg) & ~int_mask_reg; 4284 writel(IPR_PCII_HRRQ_UPDATED, ioa_cfg->regs.clr_interrupt_reg);
4285 int_reg = readl(ioa_cfg->regs.sense_interrupt_reg) & ~int_mask_reg;
4286 } while (int_reg & IPR_PCII_HRRQ_UPDATED &&
4287 num_hrrq++ < IPR_MAX_HRRQ_RETRIES);
4288
4289 if (int_reg & IPR_PCII_HRRQ_UPDATED) {
4290 ipr_isr_eh(ioa_cfg, "Error clearing HRRQ");
4291 spin_unlock_irqrestore(ioa_cfg->host->host_lock, lock_flags);
4292 return IRQ_HANDLED;
4293 }
4294
4271 } else 4295 } else
4272 break; 4296 break;
4273 } 4297 }
diff --git a/drivers/scsi/ipr.h b/drivers/scsi/ipr.h
index 163245a1c3e5..19bbcf39f0c9 100644
--- a/drivers/scsi/ipr.h
+++ b/drivers/scsi/ipr.h
@@ -144,6 +144,7 @@
144#define IPR_IOA_MAX_SECTORS 32767 144#define IPR_IOA_MAX_SECTORS 32767
145#define IPR_VSET_MAX_SECTORS 512 145#define IPR_VSET_MAX_SECTORS 512
146#define IPR_MAX_CDB_LEN 16 146#define IPR_MAX_CDB_LEN 16
147#define IPR_MAX_HRRQ_RETRIES 3
147 148
148#define IPR_DEFAULT_BUS_WIDTH 16 149#define IPR_DEFAULT_BUS_WIDTH 16
149#define IPR_80MBs_SCSI_RATE ((80 * 10) / (IPR_DEFAULT_BUS_WIDTH / 8)) 150#define IPR_80MBs_SCSI_RATE ((80 * 10) / (IPR_DEFAULT_BUS_WIDTH / 8))
diff --git a/drivers/scsi/libsas/sas_expander.c b/drivers/scsi/libsas/sas_expander.c
index b3381959acce..33cf988c8c8a 100644
--- a/drivers/scsi/libsas/sas_expander.c
+++ b/drivers/scsi/libsas/sas_expander.c
@@ -960,7 +960,6 @@ static int sas_ex_discover_dev(struct domain_device *dev, int phy_id)
960 960
961 } 961 }
962 } 962 }
963 res = 0;
964 } 963 }
965 964
966 return res; 965 return res;
diff --git a/drivers/scsi/pcmcia/aha152x_stub.c b/drivers/scsi/pcmcia/aha152x_stub.c
index 67cde0138061..528733b4a392 100644
--- a/drivers/scsi/pcmcia/aha152x_stub.c
+++ b/drivers/scsi/pcmcia/aha152x_stub.c
@@ -54,15 +54,6 @@
54#include <pcmcia/cistpl.h> 54#include <pcmcia/cistpl.h>
55#include <pcmcia/ds.h> 55#include <pcmcia/ds.h>
56 56
57#ifdef PCMCIA_DEBUG
58static int pc_debug = PCMCIA_DEBUG;
59module_param(pc_debug, int, 0644);
60#define DEBUG(n, args...) if (pc_debug>(n)) printk(KERN_DEBUG args)
61static char *version =
62"aha152x_cs.c 1.54 2000/06/12 21:27:25 (David Hinds)";
63#else
64#define DEBUG(n, args...)
65#endif
66 57
67/*====================================================================*/ 58/*====================================================================*/
68 59
@@ -103,7 +94,7 @@ static int aha152x_probe(struct pcmcia_device *link)
103{ 94{
104 scsi_info_t *info; 95 scsi_info_t *info;
105 96
106 DEBUG(0, "aha152x_attach()\n"); 97 dev_dbg(&link->dev, "aha152x_attach()\n");
107 98
108 /* Create new SCSI device */ 99 /* Create new SCSI device */
109 info = kzalloc(sizeof(*info), GFP_KERNEL); 100 info = kzalloc(sizeof(*info), GFP_KERNEL);
@@ -115,7 +106,6 @@ static int aha152x_probe(struct pcmcia_device *link)
115 link->io.Attributes1 = IO_DATA_PATH_WIDTH_AUTO; 106 link->io.Attributes1 = IO_DATA_PATH_WIDTH_AUTO;
116 link->io.IOAddrLines = 10; 107 link->io.IOAddrLines = 10;
117 link->irq.Attributes = IRQ_TYPE_DYNAMIC_SHARING; 108 link->irq.Attributes = IRQ_TYPE_DYNAMIC_SHARING;
118 link->irq.IRQInfo1 = IRQ_LEVEL_ID;
119 link->conf.Attributes = CONF_ENABLE_IRQ; 109 link->conf.Attributes = CONF_ENABLE_IRQ;
120 link->conf.IntType = INT_MEMORY_AND_IO; 110 link->conf.IntType = INT_MEMORY_AND_IO;
121 link->conf.Present = PRESENT_OPTION; 111 link->conf.Present = PRESENT_OPTION;
@@ -127,7 +117,7 @@ static int aha152x_probe(struct pcmcia_device *link)
127 117
128static void aha152x_detach(struct pcmcia_device *link) 118static void aha152x_detach(struct pcmcia_device *link)
129{ 119{
130 DEBUG(0, "aha152x_detach(0x%p)\n", link); 120 dev_dbg(&link->dev, "aha152x_detach\n");
131 121
132 aha152x_release_cs(link); 122 aha152x_release_cs(link);
133 123
@@ -137,9 +127,6 @@ static void aha152x_detach(struct pcmcia_device *link)
137 127
138/*====================================================================*/ 128/*====================================================================*/
139 129
140#define CS_CHECK(fn, ret) \
141do { last_fn = (fn); if ((last_ret = (ret)) != 0) goto cs_failed; } while (0)
142
143static int aha152x_config_check(struct pcmcia_device *p_dev, 130static int aha152x_config_check(struct pcmcia_device *p_dev,
144 cistpl_cftable_entry_t *cfg, 131 cistpl_cftable_entry_t *cfg,
145 cistpl_cftable_entry_t *dflt, 132 cistpl_cftable_entry_t *dflt,
@@ -164,19 +151,22 @@ static int aha152x_config_cs(struct pcmcia_device *link)
164{ 151{
165 scsi_info_t *info = link->priv; 152 scsi_info_t *info = link->priv;
166 struct aha152x_setup s; 153 struct aha152x_setup s;
167 int last_ret, last_fn; 154 int ret;
168 struct Scsi_Host *host; 155 struct Scsi_Host *host;
169 156
170 DEBUG(0, "aha152x_config(0x%p)\n", link); 157 dev_dbg(&link->dev, "aha152x_config\n");
171 158
172 last_ret = pcmcia_loop_config(link, aha152x_config_check, NULL); 159 ret = pcmcia_loop_config(link, aha152x_config_check, NULL);
173 if (last_ret) { 160 if (ret)
174 cs_error(link, RequestIO, last_ret); 161 goto failed;
175 goto failed;
176 }
177 162
178 CS_CHECK(RequestIRQ, pcmcia_request_irq(link, &link->irq)); 163 ret = pcmcia_request_irq(link, &link->irq);
179 CS_CHECK(RequestConfiguration, pcmcia_request_configuration(link, &link->conf)); 164 if (ret)
165 goto failed;
166
167 ret = pcmcia_request_configuration(link, &link->conf);
168 if (ret)
169 goto failed;
180 170
181 /* Set configuration options for the aha152x driver */ 171 /* Set configuration options for the aha152x driver */
182 memset(&s, 0, sizeof(s)); 172 memset(&s, 0, sizeof(s));
@@ -194,7 +184,7 @@ static int aha152x_config_cs(struct pcmcia_device *link)
194 host = aha152x_probe_one(&s); 184 host = aha152x_probe_one(&s);
195 if (host == NULL) { 185 if (host == NULL) {
196 printk(KERN_INFO "aha152x_cs: no SCSI devices found\n"); 186 printk(KERN_INFO "aha152x_cs: no SCSI devices found\n");
197 goto cs_failed; 187 goto failed;
198 } 188 }
199 189
200 sprintf(info->node.dev_name, "scsi%d", host->host_no); 190 sprintf(info->node.dev_name, "scsi%d", host->host_no);
@@ -203,8 +193,6 @@ static int aha152x_config_cs(struct pcmcia_device *link)
203 193
204 return 0; 194 return 0;
205 195
206cs_failed:
207 cs_error(link, last_fn, last_ret);
208failed: 196failed:
209 aha152x_release_cs(link); 197 aha152x_release_cs(link);
210 return -ENODEV; 198 return -ENODEV;
diff --git a/drivers/scsi/pcmcia/fdomain_stub.c b/drivers/scsi/pcmcia/fdomain_stub.c
index 06254f46a0dd..914040684079 100644
--- a/drivers/scsi/pcmcia/fdomain_stub.c
+++ b/drivers/scsi/pcmcia/fdomain_stub.c
@@ -59,16 +59,6 @@ MODULE_AUTHOR("David Hinds <dahinds@users.sourceforge.net>");
59MODULE_DESCRIPTION("Future Domain PCMCIA SCSI driver"); 59MODULE_DESCRIPTION("Future Domain PCMCIA SCSI driver");
60MODULE_LICENSE("Dual MPL/GPL"); 60MODULE_LICENSE("Dual MPL/GPL");
61 61
62#ifdef PCMCIA_DEBUG
63static int pc_debug = PCMCIA_DEBUG;
64module_param(pc_debug, int, 0);
65#define DEBUG(n, args...) if (pc_debug>(n)) printk(KERN_DEBUG args)
66static char *version =
67"fdomain_cs.c 1.47 2001/10/13 00:08:52 (David Hinds)";
68#else
69#define DEBUG(n, args...)
70#endif
71
72/*====================================================================*/ 62/*====================================================================*/
73 63
74typedef struct scsi_info_t { 64typedef struct scsi_info_t {
@@ -86,7 +76,7 @@ static int fdomain_probe(struct pcmcia_device *link)
86{ 76{
87 scsi_info_t *info; 77 scsi_info_t *info;
88 78
89 DEBUG(0, "fdomain_attach()\n"); 79 dev_dbg(&link->dev, "fdomain_attach()\n");
90 80
91 /* Create new SCSI device */ 81 /* Create new SCSI device */
92 info = kzalloc(sizeof(*info), GFP_KERNEL); 82 info = kzalloc(sizeof(*info), GFP_KERNEL);
@@ -99,7 +89,6 @@ static int fdomain_probe(struct pcmcia_device *link)
99 link->io.Attributes1 = IO_DATA_PATH_WIDTH_AUTO; 89 link->io.Attributes1 = IO_DATA_PATH_WIDTH_AUTO;
100 link->io.IOAddrLines = 10; 90 link->io.IOAddrLines = 10;
101 link->irq.Attributes = IRQ_TYPE_EXCLUSIVE; 91 link->irq.Attributes = IRQ_TYPE_EXCLUSIVE;
102 link->irq.IRQInfo1 = IRQ_LEVEL_ID;
103 link->conf.Attributes = CONF_ENABLE_IRQ; 92 link->conf.Attributes = CONF_ENABLE_IRQ;
104 link->conf.IntType = INT_MEMORY_AND_IO; 93 link->conf.IntType = INT_MEMORY_AND_IO;
105 link->conf.Present = PRESENT_OPTION; 94 link->conf.Present = PRESENT_OPTION;
@@ -111,7 +100,7 @@ static int fdomain_probe(struct pcmcia_device *link)
111 100
112static void fdomain_detach(struct pcmcia_device *link) 101static void fdomain_detach(struct pcmcia_device *link)
113{ 102{
114 DEBUG(0, "fdomain_detach(0x%p)\n", link); 103 dev_dbg(&link->dev, "fdomain_detach\n");
115 104
116 fdomain_release(link); 105 fdomain_release(link);
117 106
@@ -120,9 +109,6 @@ static void fdomain_detach(struct pcmcia_device *link)
120 109
121/*====================================================================*/ 110/*====================================================================*/
122 111
123#define CS_CHECK(fn, ret) \
124do { last_fn = (fn); if ((last_ret = (ret)) != 0) goto cs_failed; } while (0)
125
126static int fdomain_config_check(struct pcmcia_device *p_dev, 112static int fdomain_config_check(struct pcmcia_device *p_dev,
127 cistpl_cftable_entry_t *cfg, 113 cistpl_cftable_entry_t *cfg,
128 cistpl_cftable_entry_t *dflt, 114 cistpl_cftable_entry_t *dflt,
@@ -137,20 +123,22 @@ static int fdomain_config_check(struct pcmcia_device *p_dev,
137static int fdomain_config(struct pcmcia_device *link) 123static int fdomain_config(struct pcmcia_device *link)
138{ 124{
139 scsi_info_t *info = link->priv; 125 scsi_info_t *info = link->priv;
140 int last_ret, last_fn; 126 int ret;
141 char str[22]; 127 char str[22];
142 struct Scsi_Host *host; 128 struct Scsi_Host *host;
143 129
144 DEBUG(0, "fdomain_config(0x%p)\n", link); 130 dev_dbg(&link->dev, "fdomain_config\n");
145 131
146 last_ret = pcmcia_loop_config(link, fdomain_config_check, NULL); 132 ret = pcmcia_loop_config(link, fdomain_config_check, NULL);
147 if (last_ret) { 133 if (ret)
148 cs_error(link, RequestIO, last_ret);
149 goto failed; 134 goto failed;
150 }
151 135
152 CS_CHECK(RequestIRQ, pcmcia_request_irq(link, &link->irq)); 136 ret = pcmcia_request_irq(link, &link->irq);
153 CS_CHECK(RequestConfiguration, pcmcia_request_configuration(link, &link->conf)); 137 if (ret)
138 goto failed;
139 ret = pcmcia_request_configuration(link, &link->conf);
140 if (ret)
141 goto failed;
154 142
155 /* A bad hack... */ 143 /* A bad hack... */
156 release_region(link->io.BasePort1, link->io.NumPorts1); 144 release_region(link->io.BasePort1, link->io.NumPorts1);
@@ -162,11 +150,11 @@ static int fdomain_config(struct pcmcia_device *link)
162 host = __fdomain_16x0_detect(&fdomain_driver_template); 150 host = __fdomain_16x0_detect(&fdomain_driver_template);
163 if (!host) { 151 if (!host) {
164 printk(KERN_INFO "fdomain_cs: no SCSI devices found\n"); 152 printk(KERN_INFO "fdomain_cs: no SCSI devices found\n");
165 goto cs_failed; 153 goto failed;
166 } 154 }
167 155
168 if (scsi_add_host(host, NULL)) 156 if (scsi_add_host(host, NULL))
169 goto cs_failed; 157 goto failed;
170 scsi_scan_host(host); 158 scsi_scan_host(host);
171 159
172 sprintf(info->node.dev_name, "scsi%d", host->host_no); 160 sprintf(info->node.dev_name, "scsi%d", host->host_no);
@@ -175,8 +163,6 @@ static int fdomain_config(struct pcmcia_device *link)
175 163
176 return 0; 164 return 0;
177 165
178cs_failed:
179 cs_error(link, last_fn, last_ret);
180failed: 166failed:
181 fdomain_release(link); 167 fdomain_release(link);
182 return -ENODEV; 168 return -ENODEV;
@@ -188,7 +174,7 @@ static void fdomain_release(struct pcmcia_device *link)
188{ 174{
189 scsi_info_t *info = link->priv; 175 scsi_info_t *info = link->priv;
190 176
191 DEBUG(0, "fdomain_release(0x%p)\n", link); 177 dev_dbg(&link->dev, "fdomain_release\n");
192 178
193 scsi_remove_host(info->host); 179 scsi_remove_host(info->host);
194 pcmcia_disable_device(link); 180 pcmcia_disable_device(link);
diff --git a/drivers/scsi/pcmcia/nsp_cs.c b/drivers/scsi/pcmcia/nsp_cs.c
index e32c344d7ad8..c2341af587a3 100644
--- a/drivers/scsi/pcmcia/nsp_cs.c
+++ b/drivers/scsi/pcmcia/nsp_cs.c
@@ -1564,12 +1564,10 @@ static int nsp_cs_probe(struct pcmcia_device *link)
1564 link->io.IOAddrLines = 10; /* not used */ 1564 link->io.IOAddrLines = 10; /* not used */
1565 1565
1566 /* Interrupt setup */ 1566 /* Interrupt setup */
1567 link->irq.Attributes = IRQ_TYPE_EXCLUSIVE | IRQ_HANDLE_PRESENT; 1567 link->irq.Attributes = IRQ_TYPE_EXCLUSIVE;
1568 link->irq.IRQInfo1 = IRQ_LEVEL_ID;
1569 1568
1570 /* Interrupt handler */ 1569 /* Interrupt handler */
1571 link->irq.Handler = &nspintr; 1570 link->irq.Handler = &nspintr;
1572 link->irq.Instance = info;
1573 link->irq.Attributes |= IRQF_SHARED; 1571 link->irq.Attributes |= IRQF_SHARED;
1574 1572
1575 /* General socket configuration */ 1573 /* General socket configuration */
@@ -1684,10 +1682,10 @@ static int nsp_cs_config_check(struct pcmcia_device *p_dev,
1684 if (cfg_mem->req.Size < 0x1000) 1682 if (cfg_mem->req.Size < 0x1000)
1685 cfg_mem->req.Size = 0x1000; 1683 cfg_mem->req.Size = 0x1000;
1686 cfg_mem->req.AccessSpeed = 0; 1684 cfg_mem->req.AccessSpeed = 0;
1687 if (pcmcia_request_window(&p_dev, &cfg_mem->req, &p_dev->win) != 0) 1685 if (pcmcia_request_window(p_dev, &cfg_mem->req, &p_dev->win) != 0)
1688 goto next_entry; 1686 goto next_entry;
1689 map.Page = 0; map.CardOffset = mem->win[0].card_addr; 1687 map.Page = 0; map.CardOffset = mem->win[0].card_addr;
1690 if (pcmcia_map_mem_page(p_dev->win, &map) != 0) 1688 if (pcmcia_map_mem_page(p_dev, p_dev->win, &map) != 0)
1691 goto next_entry; 1689 goto next_entry;
1692 1690
1693 cfg_mem->data->MmioAddress = (unsigned long) ioremap_nocache(cfg_mem->req.Base, cfg_mem->req.Size); 1691 cfg_mem->data->MmioAddress = (unsigned long) ioremap_nocache(cfg_mem->req.Base, cfg_mem->req.Size);
diff --git a/drivers/scsi/pcmcia/qlogic_stub.c b/drivers/scsi/pcmcia/qlogic_stub.c
index 20c3e5e6d88a..f85f094870b4 100644
--- a/drivers/scsi/pcmcia/qlogic_stub.c
+++ b/drivers/scsi/pcmcia/qlogic_stub.c
@@ -62,15 +62,6 @@
62 62
63static char qlogic_name[] = "qlogic_cs"; 63static char qlogic_name[] = "qlogic_cs";
64 64
65#ifdef PCMCIA_DEBUG
66static int pc_debug = PCMCIA_DEBUG;
67module_param(pc_debug, int, 0644);
68#define DEBUG(n, args...) if (pc_debug>(n)) printk(KERN_DEBUG args)
69static char *version = "qlogic_cs.c 1.79-ac 2002/10/26 (David Hinds)";
70#else
71#define DEBUG(n, args...)
72#endif
73
74static struct scsi_host_template qlogicfas_driver_template = { 65static struct scsi_host_template qlogicfas_driver_template = {
75 .module = THIS_MODULE, 66 .module = THIS_MODULE,
76 .name = qlogic_name, 67 .name = qlogic_name,
@@ -159,7 +150,7 @@ static int qlogic_probe(struct pcmcia_device *link)
159{ 150{
160 scsi_info_t *info; 151 scsi_info_t *info;
161 152
162 DEBUG(0, "qlogic_attach()\n"); 153 dev_dbg(&link->dev, "qlogic_attach()\n");
163 154
164 /* Create new SCSI device */ 155 /* Create new SCSI device */
165 info = kzalloc(sizeof(*info), GFP_KERNEL); 156 info = kzalloc(sizeof(*info), GFP_KERNEL);
@@ -171,7 +162,6 @@ static int qlogic_probe(struct pcmcia_device *link)
171 link->io.Attributes1 = IO_DATA_PATH_WIDTH_AUTO; 162 link->io.Attributes1 = IO_DATA_PATH_WIDTH_AUTO;
172 link->io.IOAddrLines = 10; 163 link->io.IOAddrLines = 10;
173 link->irq.Attributes = IRQ_TYPE_EXCLUSIVE; 164 link->irq.Attributes = IRQ_TYPE_EXCLUSIVE;
174 link->irq.IRQInfo1 = IRQ_LEVEL_ID;
175 link->conf.Attributes = CONF_ENABLE_IRQ; 165 link->conf.Attributes = CONF_ENABLE_IRQ;
176 link->conf.IntType = INT_MEMORY_AND_IO; 166 link->conf.IntType = INT_MEMORY_AND_IO;
177 link->conf.Present = PRESENT_OPTION; 167 link->conf.Present = PRESENT_OPTION;
@@ -183,7 +173,7 @@ static int qlogic_probe(struct pcmcia_device *link)
183 173
184static void qlogic_detach(struct pcmcia_device *link) 174static void qlogic_detach(struct pcmcia_device *link)
185{ 175{
186 DEBUG(0, "qlogic_detach(0x%p)\n", link); 176 dev_dbg(&link->dev, "qlogic_detach\n");
187 177
188 qlogic_release(link); 178 qlogic_release(link);
189 kfree(link->priv); 179 kfree(link->priv);
@@ -192,9 +182,6 @@ static void qlogic_detach(struct pcmcia_device *link)
192 182
193/*====================================================================*/ 183/*====================================================================*/
194 184
195#define CS_CHECK(fn, ret) \
196do { last_fn = (fn); if ((last_ret = (ret)) != 0) goto cs_failed; } while (0)
197
198static int qlogic_config_check(struct pcmcia_device *p_dev, 185static int qlogic_config_check(struct pcmcia_device *p_dev,
199 cistpl_cftable_entry_t *cfg, 186 cistpl_cftable_entry_t *cfg,
200 cistpl_cftable_entry_t *dflt, 187 cistpl_cftable_entry_t *dflt,
@@ -213,19 +200,22 @@ static int qlogic_config_check(struct pcmcia_device *p_dev,
213static int qlogic_config(struct pcmcia_device * link) 200static int qlogic_config(struct pcmcia_device * link)
214{ 201{
215 scsi_info_t *info = link->priv; 202 scsi_info_t *info = link->priv;
216 int last_ret, last_fn; 203 int ret;
217 struct Scsi_Host *host; 204 struct Scsi_Host *host;
218 205
219 DEBUG(0, "qlogic_config(0x%p)\n", link); 206 dev_dbg(&link->dev, "qlogic_config\n");
220 207
221 last_ret = pcmcia_loop_config(link, qlogic_config_check, NULL); 208 ret = pcmcia_loop_config(link, qlogic_config_check, NULL);
222 if (last_ret) { 209 if (ret)
223 cs_error(link, RequestIO, last_ret); 210 goto failed;
211
212 ret = pcmcia_request_irq(link, &link->irq);
213 if (ret)
224 goto failed; 214 goto failed;
225 }
226 215
227 CS_CHECK(RequestIRQ, pcmcia_request_irq(link, &link->irq)); 216 ret = pcmcia_request_configuration(link, &link->conf);
228 CS_CHECK(RequestConfiguration, pcmcia_request_configuration(link, &link->conf)); 217 if (ret)
218 goto failed;
229 219
230 if ((info->manf_id == MANFID_MACNICA) || (info->manf_id == MANFID_PIONEER) || (info->manf_id == 0x0098)) { 220 if ((info->manf_id == MANFID_MACNICA) || (info->manf_id == MANFID_PIONEER) || (info->manf_id == 0x0098)) {
231 /* set ATAcmd */ 221 /* set ATAcmd */
@@ -244,7 +234,7 @@ static int qlogic_config(struct pcmcia_device * link)
244 234
245 if (!host) { 235 if (!host) {
246 printk(KERN_INFO "%s: no SCSI devices found\n", qlogic_name); 236 printk(KERN_INFO "%s: no SCSI devices found\n", qlogic_name);
247 goto cs_failed; 237 goto failed;
248 } 238 }
249 239
250 sprintf(info->node.dev_name, "scsi%d", host->host_no); 240 sprintf(info->node.dev_name, "scsi%d", host->host_no);
@@ -253,12 +243,9 @@ static int qlogic_config(struct pcmcia_device * link)
253 243
254 return 0; 244 return 0;
255 245
256cs_failed:
257 cs_error(link, last_fn, last_ret);
258 pcmcia_disable_device(link);
259failed: 246failed:
247 pcmcia_disable_device(link);
260 return -ENODEV; 248 return -ENODEV;
261
262} /* qlogic_config */ 249} /* qlogic_config */
263 250
264/*====================================================================*/ 251/*====================================================================*/
@@ -267,7 +254,7 @@ static void qlogic_release(struct pcmcia_device *link)
267{ 254{
268 scsi_info_t *info = link->priv; 255 scsi_info_t *info = link->priv;
269 256
270 DEBUG(0, "qlogic_release(0x%p)\n", link); 257 dev_dbg(&link->dev, "qlogic_release\n");
271 258
272 scsi_remove_host(info->host); 259 scsi_remove_host(info->host);
273 260
diff --git a/drivers/scsi/pcmcia/sym53c500_cs.c b/drivers/scsi/pcmcia/sym53c500_cs.c
index b330c11a1752..e7564d8f0cbf 100644
--- a/drivers/scsi/pcmcia/sym53c500_cs.c
+++ b/drivers/scsi/pcmcia/sym53c500_cs.c
@@ -77,17 +77,6 @@
77#include <pcmcia/ds.h> 77#include <pcmcia/ds.h>
78#include <pcmcia/ciscode.h> 78#include <pcmcia/ciscode.h>
79 79
80/* ================================================================== */
81
82#ifdef PCMCIA_DEBUG
83static int pc_debug = PCMCIA_DEBUG;
84module_param(pc_debug, int, 0);
85#define DEBUG(n, args...) if (pc_debug>(n)) printk(KERN_DEBUG args)
86static char *version =
87"sym53c500_cs.c 0.9c 2004/10/27 (Bob Tracy)";
88#else
89#define DEBUG(n, args...)
90#endif
91 80
92/* ================================================================== */ 81/* ================================================================== */
93 82
@@ -525,7 +514,7 @@ SYM53C500_release(struct pcmcia_device *link)
525 struct scsi_info_t *info = link->priv; 514 struct scsi_info_t *info = link->priv;
526 struct Scsi_Host *shost = info->host; 515 struct Scsi_Host *shost = info->host;
527 516
528 DEBUG(0, "SYM53C500_release(0x%p)\n", link); 517 dev_dbg(&link->dev, "SYM53C500_release\n");
529 518
530 /* 519 /*
531 * Do this before releasing/freeing resources. 520 * Do this before releasing/freeing resources.
@@ -697,9 +686,6 @@ static struct scsi_host_template sym53c500_driver_template = {
697 .shost_attrs = SYM53C500_shost_attrs 686 .shost_attrs = SYM53C500_shost_attrs
698}; 687};
699 688
700#define CS_CHECK(fn, ret) \
701do { last_fn = (fn); if ((last_ret = (ret)) != 0) goto cs_failed; } while (0)
702
703static int SYM53C500_config_check(struct pcmcia_device *p_dev, 689static int SYM53C500_config_check(struct pcmcia_device *p_dev,
704 cistpl_cftable_entry_t *cfg, 690 cistpl_cftable_entry_t *cfg,
705 cistpl_cftable_entry_t *dflt, 691 cistpl_cftable_entry_t *dflt,
@@ -719,24 +705,27 @@ static int
719SYM53C500_config(struct pcmcia_device *link) 705SYM53C500_config(struct pcmcia_device *link)
720{ 706{
721 struct scsi_info_t *info = link->priv; 707 struct scsi_info_t *info = link->priv;
722 int last_ret, last_fn; 708 int ret;
723 int irq_level, port_base; 709 int irq_level, port_base;
724 struct Scsi_Host *host; 710 struct Scsi_Host *host;
725 struct scsi_host_template *tpnt = &sym53c500_driver_template; 711 struct scsi_host_template *tpnt = &sym53c500_driver_template;
726 struct sym53c500_data *data; 712 struct sym53c500_data *data;
727 713
728 DEBUG(0, "SYM53C500_config(0x%p)\n", link); 714 dev_dbg(&link->dev, "SYM53C500_config\n");
729 715
730 info->manf_id = link->manf_id; 716 info->manf_id = link->manf_id;
731 717
732 last_ret = pcmcia_loop_config(link, SYM53C500_config_check, NULL); 718 ret = pcmcia_loop_config(link, SYM53C500_config_check, NULL);
733 if (last_ret) { 719 if (ret)
734 cs_error(link, RequestIO, last_ret); 720 goto failed;
721
722 ret = pcmcia_request_irq(link, &link->irq);
723 if (ret)
735 goto failed; 724 goto failed;
736 }
737 725
738 CS_CHECK(RequestIRQ, pcmcia_request_irq(link, &link->irq)); 726 ret = pcmcia_request_configuration(link, &link->conf);
739 CS_CHECK(RequestConfiguration, pcmcia_request_configuration(link, &link->conf)); 727 if (ret)
728 goto failed;
740 729
741 /* 730 /*
742 * That's the trouble with copying liberally from another driver. 731 * That's the trouble with copying liberally from another driver.
@@ -824,8 +813,6 @@ err_release:
824 printk(KERN_INFO "sym53c500_cs: no SCSI devices found\n"); 813 printk(KERN_INFO "sym53c500_cs: no SCSI devices found\n");
825 return -ENODEV; 814 return -ENODEV;
826 815
827cs_failed:
828 cs_error(link, last_fn, last_ret);
829failed: 816failed:
830 SYM53C500_release(link); 817 SYM53C500_release(link);
831 return -ENODEV; 818 return -ENODEV;
@@ -855,7 +842,7 @@ static int sym53c500_resume(struct pcmcia_device *link)
855static void 842static void
856SYM53C500_detach(struct pcmcia_device *link) 843SYM53C500_detach(struct pcmcia_device *link)
857{ 844{
858 DEBUG(0, "SYM53C500_detach(0x%p)\n", link); 845 dev_dbg(&link->dev, "SYM53C500_detach\n");
859 846
860 SYM53C500_release(link); 847 SYM53C500_release(link);
861 848
@@ -868,7 +855,7 @@ SYM53C500_probe(struct pcmcia_device *link)
868{ 855{
869 struct scsi_info_t *info; 856 struct scsi_info_t *info;
870 857
871 DEBUG(0, "SYM53C500_attach()\n"); 858 dev_dbg(&link->dev, "SYM53C500_attach()\n");
872 859
873 /* Create new SCSI device */ 860 /* Create new SCSI device */
874 info = kzalloc(sizeof(*info), GFP_KERNEL); 861 info = kzalloc(sizeof(*info), GFP_KERNEL);
@@ -880,7 +867,6 @@ SYM53C500_probe(struct pcmcia_device *link)
880 link->io.Attributes1 = IO_DATA_PATH_WIDTH_AUTO; 867 link->io.Attributes1 = IO_DATA_PATH_WIDTH_AUTO;
881 link->io.IOAddrLines = 10; 868 link->io.IOAddrLines = 10;
882 link->irq.Attributes = IRQ_TYPE_EXCLUSIVE; 869 link->irq.Attributes = IRQ_TYPE_EXCLUSIVE;
883 link->irq.IRQInfo1 = IRQ_LEVEL_ID;
884 link->conf.Attributes = CONF_ENABLE_IRQ; 870 link->conf.Attributes = CONF_ENABLE_IRQ;
885 link->conf.IntType = INT_MEMORY_AND_IO; 871 link->conf.IntType = INT_MEMORY_AND_IO;
886 872
diff --git a/drivers/scsi/pmcraid.c b/drivers/scsi/pmcraid.c
index f7c70e2a8224..0a97bc9074bb 100644
--- a/drivers/scsi/pmcraid.c
+++ b/drivers/scsi/pmcraid.c
@@ -1071,7 +1071,7 @@ static struct pmcraid_cmd *pmcraid_init_hcam
1071 1071
1072 ioarcb->data_transfer_length = cpu_to_le32(rcb_size); 1072 ioarcb->data_transfer_length = cpu_to_le32(rcb_size);
1073 1073
1074 ioadl[0].flags |= cpu_to_le32(IOADL_FLAGS_READ_LAST); 1074 ioadl[0].flags |= IOADL_FLAGS_READ_LAST;
1075 ioadl[0].data_len = cpu_to_le32(rcb_size); 1075 ioadl[0].data_len = cpu_to_le32(rcb_size);
1076 ioadl[0].address = cpu_to_le32(dma); 1076 ioadl[0].address = cpu_to_le32(dma);
1077 1077
@@ -2251,7 +2251,7 @@ static void pmcraid_request_sense(struct pmcraid_cmd *cmd)
2251 2251
2252 ioadl->address = cpu_to_le64(cmd->sense_buffer_dma); 2252 ioadl->address = cpu_to_le64(cmd->sense_buffer_dma);
2253 ioadl->data_len = cpu_to_le32(SCSI_SENSE_BUFFERSIZE); 2253 ioadl->data_len = cpu_to_le32(SCSI_SENSE_BUFFERSIZE);
2254 ioadl->flags = cpu_to_le32(IOADL_FLAGS_LAST_DESC); 2254 ioadl->flags = IOADL_FLAGS_LAST_DESC;
2255 2255
2256 /* request sense might be called as part of error response processing 2256 /* request sense might be called as part of error response processing
2257 * which runs in tasklets context. It is possible that mid-layer might 2257 * which runs in tasklets context. It is possible that mid-layer might
@@ -3017,7 +3017,7 @@ static int pmcraid_build_ioadl(
3017 ioadl[i].flags = 0; 3017 ioadl[i].flags = 0;
3018 } 3018 }
3019 /* setup last descriptor */ 3019 /* setup last descriptor */
3020 ioadl[i - 1].flags = cpu_to_le32(IOADL_FLAGS_LAST_DESC); 3020 ioadl[i - 1].flags = IOADL_FLAGS_LAST_DESC;
3021 3021
3022 return 0; 3022 return 0;
3023} 3023}
@@ -3387,7 +3387,7 @@ static int pmcraid_build_passthrough_ioadls(
3387 } 3387 }
3388 3388
3389 /* setup the last descriptor */ 3389 /* setup the last descriptor */
3390 ioadl[i - 1].flags = cpu_to_le32(IOADL_FLAGS_LAST_DESC); 3390 ioadl[i - 1].flags = IOADL_FLAGS_LAST_DESC;
3391 3391
3392 return 0; 3392 return 0;
3393} 3393}
@@ -5314,7 +5314,7 @@ static void pmcraid_querycfg(struct pmcraid_cmd *cmd)
5314 cpu_to_le32(sizeof(struct pmcraid_config_table)); 5314 cpu_to_le32(sizeof(struct pmcraid_config_table));
5315 5315
5316 ioadl = &(ioarcb->add_data.u.ioadl[0]); 5316 ioadl = &(ioarcb->add_data.u.ioadl[0]);
5317 ioadl->flags = cpu_to_le32(IOADL_FLAGS_LAST_DESC); 5317 ioadl->flags = IOADL_FLAGS_LAST_DESC;
5318 ioadl->address = cpu_to_le64(pinstance->cfg_table_bus_addr); 5318 ioadl->address = cpu_to_le64(pinstance->cfg_table_bus_addr);
5319 ioadl->data_len = cpu_to_le32(sizeof(struct pmcraid_config_table)); 5319 ioadl->data_len = cpu_to_le32(sizeof(struct pmcraid_config_table));
5320 5320
diff --git a/drivers/scsi/scsi_scan.c b/drivers/scsi/scsi_scan.c
index 0547a7f44d42..47291bcff0d5 100644
--- a/drivers/scsi/scsi_scan.c
+++ b/drivers/scsi/scsi_scan.c
@@ -952,16 +952,6 @@ static int scsi_add_lun(struct scsi_device *sdev, unsigned char *inq_result,
952 return SCSI_SCAN_LUN_PRESENT; 952 return SCSI_SCAN_LUN_PRESENT;
953} 953}
954 954
955static inline void scsi_destroy_sdev(struct scsi_device *sdev)
956{
957 scsi_device_set_state(sdev, SDEV_DEL);
958 if (sdev->host->hostt->slave_destroy)
959 sdev->host->hostt->slave_destroy(sdev);
960 transport_destroy_device(&sdev->sdev_gendev);
961 put_device(&sdev->sdev_dev);
962 put_device(&sdev->sdev_gendev);
963}
964
965#ifdef CONFIG_SCSI_LOGGING 955#ifdef CONFIG_SCSI_LOGGING
966/** 956/**
967 * scsi_inq_str - print INQUIRY data from min to max index, strip trailing whitespace 957 * scsi_inq_str - print INQUIRY data from min to max index, strip trailing whitespace
@@ -1139,7 +1129,7 @@ static int scsi_probe_and_add_lun(struct scsi_target *starget,
1139 } 1129 }
1140 } 1130 }
1141 } else 1131 } else
1142 scsi_destroy_sdev(sdev); 1132 __scsi_remove_device(sdev);
1143 out: 1133 out:
1144 return res; 1134 return res;
1145} 1135}
@@ -1500,7 +1490,7 @@ static int scsi_report_lun_scan(struct scsi_target *starget, int bflags,
1500 /* 1490 /*
1501 * the sdev we used didn't appear in the report luns scan 1491 * the sdev we used didn't appear in the report luns scan
1502 */ 1492 */
1503 scsi_destroy_sdev(sdev); 1493 __scsi_remove_device(sdev);
1504 return ret; 1494 return ret;
1505} 1495}
1506 1496
@@ -1710,7 +1700,7 @@ static void scsi_sysfs_add_devices(struct Scsi_Host *shost)
1710 shost_for_each_device(sdev, shost) { 1700 shost_for_each_device(sdev, shost) {
1711 if (!scsi_host_scan_allowed(shost) || 1701 if (!scsi_host_scan_allowed(shost) ||
1712 scsi_sysfs_add_sdev(sdev) != 0) 1702 scsi_sysfs_add_sdev(sdev) != 0)
1713 scsi_destroy_sdev(sdev); 1703 __scsi_remove_device(sdev);
1714 } 1704 }
1715} 1705}
1716 1706
@@ -1943,7 +1933,7 @@ void scsi_free_host_dev(struct scsi_device *sdev)
1943{ 1933{
1944 BUG_ON(sdev->id != sdev->host->this_id); 1934 BUG_ON(sdev->id != sdev->host->this_id);
1945 1935
1946 scsi_destroy_sdev(sdev); 1936 __scsi_remove_device(sdev);
1947} 1937}
1948EXPORT_SYMBOL(scsi_free_host_dev); 1938EXPORT_SYMBOL(scsi_free_host_dev);
1949 1939
diff --git a/drivers/scsi/scsi_sysfs.c b/drivers/scsi/scsi_sysfs.c
index 5c7eb63a19d1..392d8db33905 100644
--- a/drivers/scsi/scsi_sysfs.c
+++ b/drivers/scsi/scsi_sysfs.c
@@ -854,82 +854,73 @@ int scsi_sysfs_add_sdev(struct scsi_device *sdev)
854 transport_configure_device(&starget->dev); 854 transport_configure_device(&starget->dev);
855 error = device_add(&sdev->sdev_gendev); 855 error = device_add(&sdev->sdev_gendev);
856 if (error) { 856 if (error) {
857 put_device(sdev->sdev_gendev.parent);
858 printk(KERN_INFO "error 1\n"); 857 printk(KERN_INFO "error 1\n");
859 return error; 858 goto out_remove;
860 } 859 }
861 error = device_add(&sdev->sdev_dev); 860 error = device_add(&sdev->sdev_dev);
862 if (error) { 861 if (error) {
863 printk(KERN_INFO "error 2\n"); 862 printk(KERN_INFO "error 2\n");
864 goto clean_device; 863 device_del(&sdev->sdev_gendev);
864 goto out_remove;
865 } 865 }
866 transport_add_device(&sdev->sdev_gendev);
867 sdev->is_visible = 1;
866 868
867 /* create queue files, which may be writable, depending on the host */ 869 /* create queue files, which may be writable, depending on the host */
868 if (sdev->host->hostt->change_queue_depth) 870 if (sdev->host->hostt->change_queue_depth)
869 error = device_create_file(&sdev->sdev_gendev, &sdev_attr_queue_depth_rw); 871 error = device_create_file(&sdev->sdev_gendev, &sdev_attr_queue_depth_rw);
870 else 872 else
871 error = device_create_file(&sdev->sdev_gendev, &dev_attr_queue_depth); 873 error = device_create_file(&sdev->sdev_gendev, &dev_attr_queue_depth);
872 if (error) { 874 if (error)
873 __scsi_remove_device(sdev); 875 goto out_remove;
874 goto out; 876
875 }
876 if (sdev->host->hostt->change_queue_type) 877 if (sdev->host->hostt->change_queue_type)
877 error = device_create_file(&sdev->sdev_gendev, &sdev_attr_queue_type_rw); 878 error = device_create_file(&sdev->sdev_gendev, &sdev_attr_queue_type_rw);
878 else 879 else
879 error = device_create_file(&sdev->sdev_gendev, &dev_attr_queue_type); 880 error = device_create_file(&sdev->sdev_gendev, &dev_attr_queue_type);
880 if (error) { 881 if (error)
881 __scsi_remove_device(sdev); 882 goto out_remove;
882 goto out;
883 }
884 883
885 error = bsg_register_queue(rq, &sdev->sdev_gendev, NULL, NULL); 884 error = bsg_register_queue(rq, &sdev->sdev_gendev, NULL, NULL);
886 885
887 if (error) 886 if (error)
887 /* we're treating error on bsg register as non-fatal,
888 * so pretend nothing went wrong */
888 sdev_printk(KERN_INFO, sdev, 889 sdev_printk(KERN_INFO, sdev,
889 "Failed to register bsg queue, errno=%d\n", error); 890 "Failed to register bsg queue, errno=%d\n", error);
890 891
891 /* we're treating error on bsg register as non-fatal, so pretend
892 * nothing went wrong */
893 error = 0;
894
895 /* add additional host specific attributes */ 892 /* add additional host specific attributes */
896 if (sdev->host->hostt->sdev_attrs) { 893 if (sdev->host->hostt->sdev_attrs) {
897 for (i = 0; sdev->host->hostt->sdev_attrs[i]; i++) { 894 for (i = 0; sdev->host->hostt->sdev_attrs[i]; i++) {
898 error = device_create_file(&sdev->sdev_gendev, 895 error = device_create_file(&sdev->sdev_gendev,
899 sdev->host->hostt->sdev_attrs[i]); 896 sdev->host->hostt->sdev_attrs[i]);
900 if (error) { 897 if (error)
901 __scsi_remove_device(sdev); 898 goto out_remove;
902 goto out;
903 }
904 } 899 }
905 } 900 }
906 901
907 transport_add_device(&sdev->sdev_gendev); 902 return 0;
908 out:
909 return error;
910
911 clean_device:
912 scsi_device_set_state(sdev, SDEV_CANCEL);
913
914 device_del(&sdev->sdev_gendev);
915 transport_destroy_device(&sdev->sdev_gendev);
916 put_device(&sdev->sdev_dev);
917 put_device(&sdev->sdev_gendev);
918 903
904 out_remove:
905 __scsi_remove_device(sdev);
919 return error; 906 return error;
907
920} 908}
921 909
922void __scsi_remove_device(struct scsi_device *sdev) 910void __scsi_remove_device(struct scsi_device *sdev)
923{ 911{
924 struct device *dev = &sdev->sdev_gendev; 912 struct device *dev = &sdev->sdev_gendev;
925 913
926 if (scsi_device_set_state(sdev, SDEV_CANCEL) != 0) 914 if (sdev->is_visible) {
927 return; 915 if (scsi_device_set_state(sdev, SDEV_CANCEL) != 0)
916 return;
928 917
929 bsg_unregister_queue(sdev->request_queue); 918 bsg_unregister_queue(sdev->request_queue);
930 device_unregister(&sdev->sdev_dev); 919 device_unregister(&sdev->sdev_dev);
931 transport_remove_device(dev); 920 transport_remove_device(dev);
932 device_del(dev); 921 device_del(dev);
922 } else
923 put_device(&sdev->sdev_dev);
933 scsi_device_set_state(sdev, SDEV_DEL); 924 scsi_device_set_state(sdev, SDEV_DEL);
934 if (sdev->host->hostt->slave_destroy) 925 if (sdev->host->hostt->slave_destroy)
935 sdev->host->hostt->slave_destroy(sdev); 926 sdev->host->hostt->slave_destroy(sdev);
diff --git a/drivers/scsi/scsi_transport_fc.c b/drivers/scsi/scsi_transport_fc.c
index a67fed10598a..c6f70dae9b2e 100644
--- a/drivers/scsi/scsi_transport_fc.c
+++ b/drivers/scsi/scsi_transport_fc.c
@@ -3656,6 +3656,7 @@ fc_bsg_host_dispatch(struct request_queue *q, struct Scsi_Host *shost,
3656fail_host_msg: 3656fail_host_msg:
3657 /* return the errno failure code as the only status */ 3657 /* return the errno failure code as the only status */
3658 BUG_ON(job->reply_len < sizeof(uint32_t)); 3658 BUG_ON(job->reply_len < sizeof(uint32_t));
3659 job->reply->reply_payload_rcv_len = 0;
3659 job->reply->result = ret; 3660 job->reply->result = ret;
3660 job->reply_len = sizeof(uint32_t); 3661 job->reply_len = sizeof(uint32_t);
3661 fc_bsg_jobdone(job); 3662 fc_bsg_jobdone(job);
@@ -3741,6 +3742,7 @@ check_bidi:
3741fail_rport_msg: 3742fail_rport_msg:
3742 /* return the errno failure code as the only status */ 3743 /* return the errno failure code as the only status */
3743 BUG_ON(job->reply_len < sizeof(uint32_t)); 3744 BUG_ON(job->reply_len < sizeof(uint32_t));
3745 job->reply->reply_payload_rcv_len = 0;
3744 job->reply->result = ret; 3746 job->reply->result = ret;
3745 job->reply_len = sizeof(uint32_t); 3747 job->reply_len = sizeof(uint32_t);
3746 fc_bsg_jobdone(job); 3748 fc_bsg_jobdone(job);
@@ -3797,6 +3799,7 @@ fc_bsg_request_handler(struct request_queue *q, struct Scsi_Host *shost,
3797 /* check if we have the msgcode value at least */ 3799 /* check if we have the msgcode value at least */
3798 if (job->request_len < sizeof(uint32_t)) { 3800 if (job->request_len < sizeof(uint32_t)) {
3799 BUG_ON(job->reply_len < sizeof(uint32_t)); 3801 BUG_ON(job->reply_len < sizeof(uint32_t));
3802 job->reply->reply_payload_rcv_len = 0;
3800 job->reply->result = -ENOMSG; 3803 job->reply->result = -ENOMSG;
3801 job->reply_len = sizeof(uint32_t); 3804 job->reply_len = sizeof(uint32_t);
3802 fc_bsg_jobdone(job); 3805 fc_bsg_jobdone(job);
diff --git a/drivers/scsi/sd_dif.c b/drivers/scsi/sd_dif.c
index 88da97745710..84be62149c6c 100644
--- a/drivers/scsi/sd_dif.c
+++ b/drivers/scsi/sd_dif.c
@@ -418,7 +418,7 @@ error:
418 __func__, virt, phys, be32_to_cpu(sdt->ref_tag), 418 __func__, virt, phys, be32_to_cpu(sdt->ref_tag),
419 be16_to_cpu(sdt->app_tag)); 419 be16_to_cpu(sdt->app_tag));
420 420
421 return -EIO; 421 return -EILSEQ;
422} 422}
423 423
424/* 424/*
diff --git a/drivers/serial/8250.c b/drivers/serial/8250.c
index b1ae774016f1..737b4c960971 100644
--- a/drivers/serial/8250.c
+++ b/drivers/serial/8250.c
@@ -1089,7 +1089,7 @@ static void autoconfig(struct uart_8250_port *up, unsigned int probeflags)
1089 if (!up->port.iobase && !up->port.mapbase && !up->port.membase) 1089 if (!up->port.iobase && !up->port.mapbase && !up->port.membase)
1090 return; 1090 return;
1091 1091
1092 DEBUG_AUTOCONF("ttyS%d: autoconf (0x%04x, 0x%p): ", 1092 DEBUG_AUTOCONF("ttyS%d: autoconf (0x%04lx, 0x%p): ",
1093 serial_index(&up->port), up->port.iobase, up->port.membase); 1093 serial_index(&up->port), up->port.iobase, up->port.membase);
1094 1094
1095 /* 1095 /*
diff --git a/drivers/serial/8250_pci.c b/drivers/serial/8250_pci.c
index 42e8550cd2b6..b28af13c45a1 100644
--- a/drivers/serial/8250_pci.c
+++ b/drivers/serial/8250_pci.c
@@ -2383,7 +2383,7 @@ pciserial_init_ports(struct pci_dev *dev, const struct pciserial_board *board)
2383 break; 2383 break;
2384 2384
2385#ifdef SERIAL_DEBUG_PCI 2385#ifdef SERIAL_DEBUG_PCI
2386 printk(KERN_DEBUG "Setup PCI port: port %x, irq %d, type %d\n", 2386 printk(KERN_DEBUG "Setup PCI port: port %lx, irq %d, type %d\n",
2387 serial_port.iobase, serial_port.irq, serial_port.iotype); 2387 serial_port.iobase, serial_port.irq, serial_port.iotype);
2388#endif 2388#endif
2389 2389
@@ -3139,6 +3139,12 @@ static struct pci_device_id serial_pci_tbl[] = {
3139 { PCI_VENDOR_ID_LAVA, PCI_DEVICE_ID_LAVA_QUATRO_B, 3139 { PCI_VENDOR_ID_LAVA, PCI_DEVICE_ID_LAVA_QUATRO_B,
3140 PCI_ANY_ID, PCI_ANY_ID, 0, 0, 3140 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
3141 pbn_b0_bt_2_115200 }, 3141 pbn_b0_bt_2_115200 },
3142 { PCI_VENDOR_ID_LAVA, PCI_DEVICE_ID_LAVA_QUATTRO_A,
3143 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
3144 pbn_b0_bt_2_115200 },
3145 { PCI_VENDOR_ID_LAVA, PCI_DEVICE_ID_LAVA_QUATTRO_B,
3146 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
3147 pbn_b0_bt_2_115200 },
3142 { PCI_VENDOR_ID_LAVA, PCI_DEVICE_ID_LAVA_OCTO_A, 3148 { PCI_VENDOR_ID_LAVA, PCI_DEVICE_ID_LAVA_OCTO_A,
3143 PCI_ANY_ID, PCI_ANY_ID, 0, 0, 3149 PCI_ANY_ID, PCI_ANY_ID, 0, 0,
3144 pbn_b0_bt_4_460800 }, 3150 pbn_b0_bt_4_460800 },
diff --git a/drivers/serial/bcm63xx_uart.c b/drivers/serial/bcm63xx_uart.c
index beddaa6e9069..37ad0c449937 100644
--- a/drivers/serial/bcm63xx_uart.c
+++ b/drivers/serial/bcm63xx_uart.c
@@ -242,7 +242,7 @@ static void bcm_uart_do_rx(struct uart_port *port)
242 * higher than fifo size anyway since we're much faster than 242 * higher than fifo size anyway since we're much faster than
243 * serial port */ 243 * serial port */
244 max_count = 32; 244 max_count = 32;
245 tty = port->info->port.tty; 245 tty = port->state->port.tty;
246 do { 246 do {
247 unsigned int iestat, c, cstat; 247 unsigned int iestat, c, cstat;
248 char flag; 248 char flag;
@@ -318,7 +318,7 @@ static void bcm_uart_do_tx(struct uart_port *port)
318 return; 318 return;
319 } 319 }
320 320
321 xmit = &port->info->xmit; 321 xmit = &port->state->xmit;
322 if (uart_circ_empty(xmit)) 322 if (uart_circ_empty(xmit))
323 goto txq_empty; 323 goto txq_empty;
324 324
diff --git a/drivers/serial/of_serial.c b/drivers/serial/of_serial.c
index 02406ba6da1c..cdf172eda2e3 100644
--- a/drivers/serial/of_serial.c
+++ b/drivers/serial/of_serial.c
@@ -161,6 +161,7 @@ static int of_platform_serial_remove(struct of_device *ofdev)
161static struct of_device_id __devinitdata of_platform_serial_table[] = { 161static struct of_device_id __devinitdata of_platform_serial_table[] = {
162 { .type = "serial", .compatible = "ns8250", .data = (void *)PORT_8250, }, 162 { .type = "serial", .compatible = "ns8250", .data = (void *)PORT_8250, },
163 { .type = "serial", .compatible = "ns16450", .data = (void *)PORT_16450, }, 163 { .type = "serial", .compatible = "ns16450", .data = (void *)PORT_16450, },
164 { .type = "serial", .compatible = "ns16550a", .data = (void *)PORT_16550A, },
164 { .type = "serial", .compatible = "ns16550", .data = (void *)PORT_16550, }, 165 { .type = "serial", .compatible = "ns16550", .data = (void *)PORT_16550, },
165 { .type = "serial", .compatible = "ns16750", .data = (void *)PORT_16750, }, 166 { .type = "serial", .compatible = "ns16750", .data = (void *)PORT_16750, },
166 { .type = "serial", .compatible = "ns16850", .data = (void *)PORT_16850, }, 167 { .type = "serial", .compatible = "ns16850", .data = (void *)PORT_16850, },
diff --git a/drivers/serial/serial_cs.c b/drivers/serial/serial_cs.c
index ff4617e21426..fc413f0f8dd2 100644
--- a/drivers/serial/serial_cs.c
+++ b/drivers/serial/serial_cs.c
@@ -54,14 +54,6 @@
54 54
55#include "8250.h" 55#include "8250.h"
56 56
57#ifdef PCMCIA_DEBUG
58static int pc_debug = PCMCIA_DEBUG;
59module_param(pc_debug, int, 0644);
60#define DEBUG(n, args...) if (pc_debug>(n)) printk(KERN_DEBUG args)
61static char *version = "serial_cs.c 1.134 2002/05/04 05:48:53 (David Hinds)";
62#else
63#define DEBUG(n, args...)
64#endif
65 57
66/*====================================================================*/ 58/*====================================================================*/
67 59
@@ -121,24 +113,20 @@ static void quirk_setup_brainboxes_0104(struct pcmcia_device *link, struct uart_
121static int quirk_post_ibm(struct pcmcia_device *link) 113static int quirk_post_ibm(struct pcmcia_device *link)
122{ 114{
123 conf_reg_t reg = { 0, CS_READ, 0x800, 0 }; 115 conf_reg_t reg = { 0, CS_READ, 0x800, 0 };
124 int last_ret, last_fn; 116 int ret;
117
118 ret = pcmcia_access_configuration_register(link, &reg);
119 if (ret)
120 goto failed;
125 121
126 last_ret = pcmcia_access_configuration_register(link, &reg);
127 if (last_ret) {
128 last_fn = AccessConfigurationRegister;
129 goto cs_failed;
130 }
131 reg.Action = CS_WRITE; 122 reg.Action = CS_WRITE;
132 reg.Value = reg.Value | 1; 123 reg.Value = reg.Value | 1;
133 last_ret = pcmcia_access_configuration_register(link, &reg); 124 ret = pcmcia_access_configuration_register(link, &reg);
134 if (last_ret) { 125 if (ret)
135 last_fn = AccessConfigurationRegister; 126 goto failed;
136 goto cs_failed;
137 }
138 return 0; 127 return 0;
139 128
140 cs_failed: 129 failed:
141 cs_error(link, last_fn, last_ret);
142 return -ENODEV; 130 return -ENODEV;
143} 131}
144 132
@@ -283,7 +271,7 @@ static void serial_remove(struct pcmcia_device *link)
283 struct serial_info *info = link->priv; 271 struct serial_info *info = link->priv;
284 int i; 272 int i;
285 273
286 DEBUG(0, "serial_release(0x%p)\n", link); 274 dev_dbg(&link->dev, "serial_release\n");
287 275
288 /* 276 /*
289 * Recheck to see if the device is still configured. 277 * Recheck to see if the device is still configured.
@@ -334,7 +322,7 @@ static int serial_probe(struct pcmcia_device *link)
334{ 322{
335 struct serial_info *info; 323 struct serial_info *info;
336 324
337 DEBUG(0, "serial_attach()\n"); 325 dev_dbg(&link->dev, "serial_attach()\n");
338 326
339 /* Create new serial device */ 327 /* Create new serial device */
340 info = kzalloc(sizeof (*info), GFP_KERNEL); 328 info = kzalloc(sizeof (*info), GFP_KERNEL);
@@ -346,7 +334,6 @@ static int serial_probe(struct pcmcia_device *link)
346 link->io.Attributes1 = IO_DATA_PATH_WIDTH_8; 334 link->io.Attributes1 = IO_DATA_PATH_WIDTH_8;
347 link->io.NumPorts1 = 8; 335 link->io.NumPorts1 = 8;
348 link->irq.Attributes = IRQ_TYPE_DYNAMIC_SHARING; 336 link->irq.Attributes = IRQ_TYPE_DYNAMIC_SHARING;
349 link->irq.IRQInfo1 = IRQ_LEVEL_ID;
350 link->conf.Attributes = CONF_ENABLE_IRQ; 337 link->conf.Attributes = CONF_ENABLE_IRQ;
351 if (do_sound) { 338 if (do_sound) {
352 link->conf.Attributes |= CONF_ENABLE_SPKR; 339 link->conf.Attributes |= CONF_ENABLE_SPKR;
@@ -370,7 +357,7 @@ static void serial_detach(struct pcmcia_device *link)
370{ 357{
371 struct serial_info *info = link->priv; 358 struct serial_info *info = link->priv;
372 359
373 DEBUG(0, "serial_detach(0x%p)\n", link); 360 dev_dbg(&link->dev, "serial_detach\n");
374 361
375 /* 362 /*
376 * Ensure any outstanding scheduled tasks are completed. 363 * Ensure any outstanding scheduled tasks are completed.
@@ -399,7 +386,7 @@ static int setup_serial(struct pcmcia_device *handle, struct serial_info * info,
399 port.irq = irq; 386 port.irq = irq;
400 port.flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST | UPF_SHARE_IRQ; 387 port.flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST | UPF_SHARE_IRQ;
401 port.uartclk = 1843200; 388 port.uartclk = 1843200;
402 port.dev = &handle_to_dev(handle); 389 port.dev = &handle->dev;
403 if (buggy_uart) 390 if (buggy_uart)
404 port.flags |= UPF_BUGGY_UART; 391 port.flags |= UPF_BUGGY_UART;
405 392
@@ -426,21 +413,6 @@ static int setup_serial(struct pcmcia_device *handle, struct serial_info * info,
426 413
427/*====================================================================*/ 414/*====================================================================*/
428 415
429static int
430first_tuple(struct pcmcia_device *handle, tuple_t * tuple, cisparse_t * parse)
431{
432 int i;
433 i = pcmcia_get_first_tuple(handle, tuple);
434 if (i != 0)
435 return i;
436 i = pcmcia_get_tuple_data(handle, tuple);
437 if (i != 0)
438 return i;
439 return pcmcia_parse_tuple(tuple, parse);
440}
441
442/*====================================================================*/
443
444static int simple_config_check(struct pcmcia_device *p_dev, 416static int simple_config_check(struct pcmcia_device *p_dev,
445 cistpl_cftable_entry_t *cf, 417 cistpl_cftable_entry_t *cf,
446 cistpl_cftable_entry_t *dflt, 418 cistpl_cftable_entry_t *dflt,
@@ -522,15 +494,13 @@ static int simple_config(struct pcmcia_device *link)
522 494
523 printk(KERN_NOTICE 495 printk(KERN_NOTICE
524 "serial_cs: no usable port range found, giving up\n"); 496 "serial_cs: no usable port range found, giving up\n");
525 cs_error(link, RequestIO, i);
526 return -1; 497 return -1;
527 498
528found_port: 499found_port:
529 i = pcmcia_request_irq(link, &link->irq); 500 i = pcmcia_request_irq(link, &link->irq);
530 if (i != 0) { 501 if (i != 0)
531 cs_error(link, RequestIRQ, i);
532 link->irq.AssignedIRQ = 0; 502 link->irq.AssignedIRQ = 0;
533 } 503
534 if (info->multi && (info->manfid == MANFID_3COM)) 504 if (info->multi && (info->manfid == MANFID_3COM))
535 link->conf.ConfigIndex &= ~(0x08); 505 link->conf.ConfigIndex &= ~(0x08);
536 506
@@ -541,10 +511,8 @@ found_port:
541 info->quirk->config(link); 511 info->quirk->config(link);
542 512
543 i = pcmcia_request_configuration(link, &link->conf); 513 i = pcmcia_request_configuration(link, &link->conf);
544 if (i != 0) { 514 if (i != 0)
545 cs_error(link, RequestConfiguration, i);
546 return -1; 515 return -1;
547 }
548 return setup_serial(link, info, link->io.BasePort1, link->irq.AssignedIRQ); 516 return setup_serial(link, info, link->io.BasePort1, link->irq.AssignedIRQ);
549} 517}
550 518
@@ -613,7 +581,6 @@ static int multi_config(struct pcmcia_device *link)
613 /* FIXME: comment does not fit, error handling does not fit */ 581 /* FIXME: comment does not fit, error handling does not fit */
614 printk(KERN_NOTICE 582 printk(KERN_NOTICE
615 "serial_cs: no usable port range found, giving up\n"); 583 "serial_cs: no usable port range found, giving up\n");
616 cs_error(link, RequestIRQ, i);
617 link->irq.AssignedIRQ = 0; 584 link->irq.AssignedIRQ = 0;
618 } 585 }
619 586
@@ -624,10 +591,8 @@ static int multi_config(struct pcmcia_device *link)
624 info->quirk->config(link); 591 info->quirk->config(link);
625 592
626 i = pcmcia_request_configuration(link, &link->conf); 593 i = pcmcia_request_configuration(link, &link->conf);
627 if (i != 0) { 594 if (i != 0)
628 cs_error(link, RequestConfiguration, i);
629 return -ENODEV; 595 return -ENODEV;
630 }
631 596
632 /* The Oxford Semiconductor OXCF950 cards are in fact single-port: 597 /* The Oxford Semiconductor OXCF950 cards are in fact single-port:
633 * 8 registers are for the UART, the others are extra registers. 598 * 8 registers are for the UART, the others are extra registers.
@@ -665,6 +630,25 @@ static int multi_config(struct pcmcia_device *link)
665 return 0; 630 return 0;
666} 631}
667 632
633static int serial_check_for_multi(struct pcmcia_device *p_dev,
634 cistpl_cftable_entry_t *cf,
635 cistpl_cftable_entry_t *dflt,
636 unsigned int vcc,
637 void *priv_data)
638{
639 struct serial_info *info = p_dev->priv;
640
641 if ((cf->io.nwin == 1) && (cf->io.win[0].len % 8 == 0))
642 info->multi = cf->io.win[0].len >> 3;
643
644 if ((cf->io.nwin == 2) && (cf->io.win[0].len == 8) &&
645 (cf->io.win[1].len == 8))
646 info->multi = 2;
647
648 return 0; /* break */
649}
650
651
668/*====================================================================== 652/*======================================================================
669 653
670 serial_config() is scheduled to run after a CARD_INSERTION event 654 serial_config() is scheduled to run after a CARD_INSERTION event
@@ -676,46 +660,14 @@ static int multi_config(struct pcmcia_device *link)
676static int serial_config(struct pcmcia_device * link) 660static int serial_config(struct pcmcia_device * link)
677{ 661{
678 struct serial_info *info = link->priv; 662 struct serial_info *info = link->priv;
679 struct serial_cfg_mem *cfg_mem; 663 int i;
680 tuple_t *tuple;
681 u_char *buf;
682 cisparse_t *parse;
683 cistpl_cftable_entry_t *cf;
684 int i, last_ret, last_fn;
685
686 DEBUG(0, "serial_config(0x%p)\n", link);
687
688 cfg_mem = kmalloc(sizeof(struct serial_cfg_mem), GFP_KERNEL);
689 if (!cfg_mem)
690 goto failed;
691 664
692 tuple = &cfg_mem->tuple; 665 dev_dbg(&link->dev, "serial_config\n");
693 parse = &cfg_mem->parse;
694 cf = &parse->cftable_entry;
695 buf = cfg_mem->buf;
696
697 tuple->TupleData = (cisdata_t *) buf;
698 tuple->TupleOffset = 0;
699 tuple->TupleDataMax = 255;
700 tuple->Attributes = 0;
701
702 /* Get configuration register information */
703 tuple->DesiredTuple = CISTPL_CONFIG;
704 last_ret = first_tuple(link, tuple, parse);
705 if (last_ret != 0) {
706 last_fn = ParseTuple;
707 goto cs_failed;
708 }
709 link->conf.ConfigBase = parse->config.base;
710 link->conf.Present = parse->config.rmask[0];
711 666
712 /* Is this a compliant multifunction card? */ 667 /* Is this a compliant multifunction card? */
713 tuple->DesiredTuple = CISTPL_LONGLINK_MFC; 668 info->multi = (link->socket->functions > 1);
714 tuple->Attributes = TUPLE_RETURN_COMMON | TUPLE_RETURN_LINK;
715 info->multi = (first_tuple(link, tuple, parse) == 0);
716 669
717 /* Is this a multiport card? */ 670 /* Is this a multiport card? */
718 tuple->DesiredTuple = CISTPL_MANFID;
719 info->manfid = link->manf_id; 671 info->manfid = link->manf_id;
720 info->prodid = link->card_id; 672 info->prodid = link->card_id;
721 673
@@ -730,20 +682,11 @@ static int serial_config(struct pcmcia_device * link)
730 682
731 /* Another check for dual-serial cards: look for either serial or 683 /* Another check for dual-serial cards: look for either serial or
732 multifunction cards that ask for appropriate IO port ranges */ 684 multifunction cards that ask for appropriate IO port ranges */
733 tuple->DesiredTuple = CISTPL_FUNCID;
734 if ((info->multi == 0) && 685 if ((info->multi == 0) &&
735 (link->has_func_id) && 686 (link->has_func_id) &&
736 ((link->func_id == CISTPL_FUNCID_MULTI) || 687 ((link->func_id == CISTPL_FUNCID_MULTI) ||
737 (link->func_id == CISTPL_FUNCID_SERIAL))) { 688 (link->func_id == CISTPL_FUNCID_SERIAL)))
738 tuple->DesiredTuple = CISTPL_CFTABLE_ENTRY; 689 pcmcia_loop_config(link, serial_check_for_multi, info);
739 if (first_tuple(link, tuple, parse) == 0) {
740 if ((cf->io.nwin == 1) && (cf->io.win[0].len % 8 == 0))
741 info->multi = cf->io.win[0].len >> 3;
742 if ((cf->io.nwin == 2) && (cf->io.win[0].len == 8) &&
743 (cf->io.win[1].len == 8))
744 info->multi = 2;
745 }
746 }
747 690
748 /* 691 /*
749 * Apply any multi-port quirk. 692 * Apply any multi-port quirk.
@@ -768,14 +711,10 @@ static int serial_config(struct pcmcia_device * link)
768 goto failed; 711 goto failed;
769 712
770 link->dev_node = &info->node[0]; 713 link->dev_node = &info->node[0];
771 kfree(cfg_mem);
772 return 0; 714 return 0;
773 715
774cs_failed:
775 cs_error(link, last_fn, last_ret);
776failed: 716failed:
777 serial_remove(link); 717 serial_remove(link);
778 kfree(cfg_mem);
779 return -ENODEV; 718 return -ENODEV;
780} 719}
781 720
@@ -879,10 +818,10 @@ static struct pcmcia_device_id serial_ids[] = {
879 PCMCIA_MFC_DEVICE_CIS_MANF_CARD(1, 0x0175, 0x0000, "cis/DP83903.cis"), 818 PCMCIA_MFC_DEVICE_CIS_MANF_CARD(1, 0x0175, 0x0000, "cis/DP83903.cis"),
880 PCMCIA_MFC_DEVICE_CIS_MANF_CARD(1, 0x0101, 0x0035, "cis/3CXEM556.cis"), 819 PCMCIA_MFC_DEVICE_CIS_MANF_CARD(1, 0x0101, 0x0035, "cis/3CXEM556.cis"),
881 PCMCIA_MFC_DEVICE_CIS_MANF_CARD(1, 0x0101, 0x003d, "cis/3CXEM556.cis"), 820 PCMCIA_MFC_DEVICE_CIS_MANF_CARD(1, 0x0101, 0x003d, "cis/3CXEM556.cis"),
882 PCMCIA_DEVICE_CIS_PROD_ID12("Sierra Wireless", "AC850", 0xd85f6206, 0x42a2c018, "SW_8xx_SER.cis"), /* Sierra Wireless AC850 3G Network Adapter R1 */ 821 PCMCIA_DEVICE_CIS_PROD_ID12("Sierra Wireless", "AC850", 0xd85f6206, 0x42a2c018, "cis/SW_8xx_SER.cis"), /* Sierra Wireless AC850 3G Network Adapter R1 */
883 PCMCIA_DEVICE_CIS_MANF_CARD(0x0192, 0x0710, "SW_7xx_SER.cis"), /* Sierra Wireless AC710/AC750 GPRS Network Adapter R1 */ 822 PCMCIA_DEVICE_CIS_PROD_ID12("Sierra Wireless", "AC710/AC750", 0xd85f6206, 0x761b11e0, "cis/SW_7xx_SER.cis"), /* Sierra Wireless AC710/AC750 GPRS Network Adapter R1 */
884 PCMCIA_DEVICE_CIS_MANF_CARD(0x0192, 0xa555, "SW_555_SER.cis"), /* Sierra Aircard 555 CDMA 1xrtt Modem -- pre update */ 823 PCMCIA_DEVICE_CIS_MANF_CARD(0x0192, 0xa555, "cis/SW_555_SER.cis"), /* Sierra Aircard 555 CDMA 1xrtt Modem -- pre update */
885 PCMCIA_DEVICE_CIS_MANF_CARD(0x013f, 0xa555, "SW_555_SER.cis"), /* Sierra Aircard 555 CDMA 1xrtt Modem -- post update */ 824 PCMCIA_DEVICE_CIS_MANF_CARD(0x013f, 0xa555, "cis/SW_555_SER.cis"), /* Sierra Aircard 555 CDMA 1xrtt Modem -- post update */
886 PCMCIA_DEVICE_CIS_PROD_ID12("MultiTech", "PCMCIA 56K DataFax", 0x842047ee, 0xc2efcf03, "cis/MT5634ZLX.cis"), 825 PCMCIA_DEVICE_CIS_PROD_ID12("MultiTech", "PCMCIA 56K DataFax", 0x842047ee, 0xc2efcf03, "cis/MT5634ZLX.cis"),
887 PCMCIA_DEVICE_CIS_PROD_ID12("ADVANTECH", "COMpad-32/85B-2", 0x96913a85, 0x27ab5437, "cis/COMpad2.cis"), 826 PCMCIA_DEVICE_CIS_PROD_ID12("ADVANTECH", "COMpad-32/85B-2", 0x96913a85, 0x27ab5437, "cis/COMpad2.cis"),
888 PCMCIA_DEVICE_CIS_PROD_ID12("ADVANTECH", "COMpad-32/85B-4", 0x96913a85, 0xcec8f102, "cis/COMpad4.cis"), 827 PCMCIA_DEVICE_CIS_PROD_ID12("ADVANTECH", "COMpad-32/85B-4", 0x96913a85, 0xcec8f102, "cis/COMpad4.cis"),
diff --git a/drivers/serial/sh-sci.c b/drivers/serial/sh-sci.c
index 85119fb7cb50..6498bd1fb6dd 100644
--- a/drivers/serial/sh-sci.c
+++ b/drivers/serial/sh-sci.c
@@ -1143,7 +1143,7 @@ static void serial_console_write(struct console *co, const char *s,
1143 while ((sci_in(port, SCxSR) & bits) != bits) 1143 while ((sci_in(port, SCxSR) & bits) != bits)
1144 cpu_relax(); 1144 cpu_relax();
1145 1145
1146 if (sci_port->disable); 1146 if (sci_port->disable)
1147 sci_port->disable(port); 1147 sci_port->disable(port);
1148} 1148}
1149 1149
diff --git a/drivers/serial/suncore.c b/drivers/serial/suncore.c
index a2d4a19550ab..ed7d958b0a01 100644
--- a/drivers/serial/suncore.c
+++ b/drivers/serial/suncore.c
@@ -53,20 +53,21 @@ void sunserial_unregister_minors(struct uart_driver *drv, int count)
53EXPORT_SYMBOL(sunserial_unregister_minors); 53EXPORT_SYMBOL(sunserial_unregister_minors);
54 54
55int sunserial_console_match(struct console *con, struct device_node *dp, 55int sunserial_console_match(struct console *con, struct device_node *dp,
56 struct uart_driver *drv, int line) 56 struct uart_driver *drv, int line, bool ignore_line)
57{ 57{
58 int off;
59
60 if (!con || of_console_device != dp) 58 if (!con || of_console_device != dp)
61 return 0; 59 return 0;
62 60
63 off = 0; 61 if (!ignore_line) {
64 if (of_console_options && 62 int off = 0;
65 *of_console_options == 'b')
66 off = 1;
67 63
68 if ((line & 1) != off) 64 if (of_console_options &&
69 return 0; 65 *of_console_options == 'b')
66 off = 1;
67
68 if ((line & 1) != off)
69 return 0;
70 }
70 71
71 con->index = line; 72 con->index = line;
72 drv->cons = con; 73 drv->cons = con;
@@ -76,23 +77,24 @@ int sunserial_console_match(struct console *con, struct device_node *dp,
76} 77}
77EXPORT_SYMBOL(sunserial_console_match); 78EXPORT_SYMBOL(sunserial_console_match);
78 79
79void 80void sunserial_console_termios(struct console *con, struct device_node *uart_dp)
80sunserial_console_termios(struct console *con)
81{ 81{
82 struct device_node *dp; 82 const char *mode, *s;
83 const char *od, *mode, *s;
84 char mode_prop[] = "ttyX-mode"; 83 char mode_prop[] = "ttyX-mode";
85 int baud, bits, stop, cflag; 84 int baud, bits, stop, cflag;
86 char parity; 85 char parity;
87 86
88 dp = of_find_node_by_path("/options"); 87 if (!strcmp(uart_dp->name, "rsc") ||
89 od = of_get_property(dp, "output-device", NULL); 88 !strcmp(uart_dp->name, "rsc-console") ||
90 if (!strcmp(od, "rsc")) { 89 !strcmp(uart_dp->name, "rsc-control")) {
91 mode = of_get_property(of_console_device, 90 mode = of_get_property(uart_dp,
92 "ssp-console-modes", NULL); 91 "ssp-console-modes", NULL);
93 if (!mode) 92 if (!mode)
94 mode = "115200,8,n,1,-"; 93 mode = "115200,8,n,1,-";
94 } else if (!strcmp(uart_dp->name, "lom-console")) {
95 mode = "9600,8,n,1,-";
95 } else { 96 } else {
97 struct device_node *dp;
96 char c; 98 char c;
97 99
98 c = 'a'; 100 c = 'a';
@@ -101,6 +103,7 @@ sunserial_console_termios(struct console *con)
101 103
102 mode_prop[3] = c; 104 mode_prop[3] = c;
103 105
106 dp = of_find_node_by_path("/options");
104 mode = of_get_property(dp, mode_prop, NULL); 107 mode = of_get_property(dp, mode_prop, NULL);
105 if (!mode) 108 if (!mode)
106 mode = "9600,8,n,1,-"; 109 mode = "9600,8,n,1,-";
diff --git a/drivers/serial/suncore.h b/drivers/serial/suncore.h
index 042668aa602e..db2057936c31 100644
--- a/drivers/serial/suncore.h
+++ b/drivers/serial/suncore.h
@@ -26,7 +26,8 @@ extern int sunserial_register_minors(struct uart_driver *, int);
26extern void sunserial_unregister_minors(struct uart_driver *, int); 26extern void sunserial_unregister_minors(struct uart_driver *, int);
27 27
28extern int sunserial_console_match(struct console *, struct device_node *, 28extern int sunserial_console_match(struct console *, struct device_node *,
29 struct uart_driver *, int); 29 struct uart_driver *, int, bool);
30extern void sunserial_console_termios(struct console *); 30extern void sunserial_console_termios(struct console *,
31 struct device_node *);
31 32
32#endif /* !(_SERIAL_SUN_H) */ 33#endif /* !(_SERIAL_SUN_H) */
diff --git a/drivers/serial/sunhv.c b/drivers/serial/sunhv.c
index d548652dee50..d14cca7fb88d 100644
--- a/drivers/serial/sunhv.c
+++ b/drivers/serial/sunhv.c
@@ -566,7 +566,7 @@ static int __devinit hv_probe(struct of_device *op, const struct of_device_id *m
566 goto out_free_con_read_page; 566 goto out_free_con_read_page;
567 567
568 sunserial_console_match(&sunhv_console, op->node, 568 sunserial_console_match(&sunhv_console, op->node,
569 &sunhv_reg, port->line); 569 &sunhv_reg, port->line, false);
570 570
571 err = uart_add_one_port(&sunhv_reg, port); 571 err = uart_add_one_port(&sunhv_reg, port);
572 if (err) 572 if (err)
diff --git a/drivers/serial/sunsab.c b/drivers/serial/sunsab.c
index d1ad34128635..d514e28d0755 100644
--- a/drivers/serial/sunsab.c
+++ b/drivers/serial/sunsab.c
@@ -883,7 +883,7 @@ static int sunsab_console_setup(struct console *con, char *options)
883 printk("Console: ttyS%d (SAB82532)\n", 883 printk("Console: ttyS%d (SAB82532)\n",
884 (sunsab_reg.minor - 64) + con->index); 884 (sunsab_reg.minor - 64) + con->index);
885 885
886 sunserial_console_termios(con); 886 sunserial_console_termios(con, to_of_device(up->port.dev)->node);
887 887
888 switch (con->cflag & CBAUD) { 888 switch (con->cflag & CBAUD) {
889 case B150: baud = 150; break; 889 case B150: baud = 150; break;
@@ -1027,10 +1027,12 @@ static int __devinit sab_probe(struct of_device *op, const struct of_device_id *
1027 goto out1; 1027 goto out1;
1028 1028
1029 sunserial_console_match(SUNSAB_CONSOLE(), op->node, 1029 sunserial_console_match(SUNSAB_CONSOLE(), op->node,
1030 &sunsab_reg, up[0].port.line); 1030 &sunsab_reg, up[0].port.line,
1031 false);
1031 1032
1032 sunserial_console_match(SUNSAB_CONSOLE(), op->node, 1033 sunserial_console_match(SUNSAB_CONSOLE(), op->node,
1033 &sunsab_reg, up[1].port.line); 1034 &sunsab_reg, up[1].port.line,
1035 false);
1034 1036
1035 err = uart_add_one_port(&sunsab_reg, &up[0].port); 1037 err = uart_add_one_port(&sunsab_reg, &up[0].port);
1036 if (err) 1038 if (err)
@@ -1116,7 +1118,6 @@ static int __init sunsab_init(void)
1116 if (!sunsab_ports) 1118 if (!sunsab_ports)
1117 return -ENOMEM; 1119 return -ENOMEM;
1118 1120
1119 sunsab_reg.cons = SUNSAB_CONSOLE();
1120 err = sunserial_register_minors(&sunsab_reg, num_channels); 1121 err = sunserial_register_minors(&sunsab_reg, num_channels);
1121 if (err) { 1122 if (err) {
1122 kfree(sunsab_ports); 1123 kfree(sunsab_ports);
diff --git a/drivers/serial/sunsu.c b/drivers/serial/sunsu.c
index 68d262b15749..170d3d68c8f0 100644
--- a/drivers/serial/sunsu.c
+++ b/drivers/serial/sunsu.c
@@ -1329,11 +1329,9 @@ static void sunsu_console_write(struct console *co, const char *s,
1329 */ 1329 */
1330static int __init sunsu_console_setup(struct console *co, char *options) 1330static int __init sunsu_console_setup(struct console *co, char *options)
1331{ 1331{
1332 static struct ktermios dummy;
1333 struct ktermios termios;
1332 struct uart_port *port; 1334 struct uart_port *port;
1333 int baud = 9600;
1334 int bits = 8;
1335 int parity = 'n';
1336 int flow = 'n';
1337 1335
1338 printk("Console: ttyS%d (SU)\n", 1336 printk("Console: ttyS%d (SU)\n",
1339 (sunsu_reg.minor - 64) + co->index); 1337 (sunsu_reg.minor - 64) + co->index);
@@ -1352,10 +1350,15 @@ static int __init sunsu_console_setup(struct console *co, char *options)
1352 */ 1350 */
1353 spin_lock_init(&port->lock); 1351 spin_lock_init(&port->lock);
1354 1352
1355 if (options) 1353 /* Get firmware console settings. */
1356 uart_parse_options(options, &baud, &parity, &bits, &flow); 1354 sunserial_console_termios(co, to_of_device(port->dev)->node);
1357 1355
1358 return uart_set_options(port, co, baud, parity, bits, flow); 1356 memset(&termios, 0, sizeof(struct ktermios));
1357 termios.c_cflag = co->cflag;
1358 port->mctrl |= TIOCM_DTR;
1359 port->ops->set_termios(port, &termios, &dummy);
1360
1361 return 0;
1359} 1362}
1360 1363
1361static struct console sunsu_console = { 1364static struct console sunsu_console = {
@@ -1409,6 +1412,7 @@ static int __devinit su_probe(struct of_device *op, const struct of_device_id *m
1409 struct uart_sunsu_port *up; 1412 struct uart_sunsu_port *up;
1410 struct resource *rp; 1413 struct resource *rp;
1411 enum su_type type; 1414 enum su_type type;
1415 bool ignore_line;
1412 int err; 1416 int err;
1413 1417
1414 type = su_get_type(dp); 1418 type = su_get_type(dp);
@@ -1467,8 +1471,14 @@ static int __devinit su_probe(struct of_device *op, const struct of_device_id *m
1467 1471
1468 up->port.ops = &sunsu_pops; 1472 up->port.ops = &sunsu_pops;
1469 1473
1474 ignore_line = false;
1475 if (!strcmp(dp->name, "rsc-console") ||
1476 !strcmp(dp->name, "lom-console"))
1477 ignore_line = true;
1478
1470 sunserial_console_match(SUNSU_CONSOLE(), dp, 1479 sunserial_console_match(SUNSU_CONSOLE(), dp,
1471 &sunsu_reg, up->port.line); 1480 &sunsu_reg, up->port.line,
1481 ignore_line);
1472 err = uart_add_one_port(&sunsu_reg, &up->port); 1482 err = uart_add_one_port(&sunsu_reg, &up->port);
1473 if (err) 1483 if (err)
1474 goto out_unmap; 1484 goto out_unmap;
@@ -1517,6 +1527,10 @@ static const struct of_device_id su_match[] = {
1517 .name = "serial", 1527 .name = "serial",
1518 .compatible = "su", 1528 .compatible = "su",
1519 }, 1529 },
1530 {
1531 .type = "serial",
1532 .compatible = "su",
1533 },
1520 {}, 1534 {},
1521}; 1535};
1522MODULE_DEVICE_TABLE(of, su_match); 1536MODULE_DEVICE_TABLE(of, su_match);
@@ -1548,6 +1562,12 @@ static int __init sunsu_init(void)
1548 num_uart++; 1562 num_uart++;
1549 } 1563 }
1550 } 1564 }
1565 for_each_node_by_type(dp, "serial") {
1566 if (of_device_is_compatible(dp, "su")) {
1567 if (su_get_type(dp) == SU_PORT_PORT)
1568 num_uart++;
1569 }
1570 }
1551 1571
1552 if (num_uart) { 1572 if (num_uart) {
1553 err = sunserial_register_minors(&sunsu_reg, num_uart); 1573 err = sunserial_register_minors(&sunsu_reg, num_uart);
diff --git a/drivers/serial/sunzilog.c b/drivers/serial/sunzilog.c
index ef693ae22e7f..2c7a66af4f52 100644
--- a/drivers/serial/sunzilog.c
+++ b/drivers/serial/sunzilog.c
@@ -1180,7 +1180,7 @@ static int __init sunzilog_console_setup(struct console *con, char *options)
1180 (sunzilog_reg.minor - 64) + con->index, con->index); 1180 (sunzilog_reg.minor - 64) + con->index, con->index);
1181 1181
1182 /* Get firmware console settings. */ 1182 /* Get firmware console settings. */
1183 sunserial_console_termios(con); 1183 sunserial_console_termios(con, to_of_device(up->port.dev)->node);
1184 1184
1185 /* Firmware console speed is limited to 150-->38400 baud so 1185 /* Firmware console speed is limited to 150-->38400 baud so
1186 * this hackish cflag thing is OK. 1186 * this hackish cflag thing is OK.
@@ -1416,7 +1416,8 @@ static int __devinit zs_probe(struct of_device *op, const struct of_device_id *m
1416 1416
1417 if (!keyboard_mouse) { 1417 if (!keyboard_mouse) {
1418 if (sunserial_console_match(SUNZILOG_CONSOLE(), op->node, 1418 if (sunserial_console_match(SUNZILOG_CONSOLE(), op->node,
1419 &sunzilog_reg, up[0].port.line)) 1419 &sunzilog_reg, up[0].port.line,
1420 false))
1420 up->flags |= SUNZILOG_FLAG_IS_CONS; 1421 up->flags |= SUNZILOG_FLAG_IS_CONS;
1421 err = uart_add_one_port(&sunzilog_reg, &up[0].port); 1422 err = uart_add_one_port(&sunzilog_reg, &up[0].port);
1422 if (err) { 1423 if (err) {
@@ -1425,7 +1426,8 @@ static int __devinit zs_probe(struct of_device *op, const struct of_device_id *m
1425 return err; 1426 return err;
1426 } 1427 }
1427 if (sunserial_console_match(SUNZILOG_CONSOLE(), op->node, 1428 if (sunserial_console_match(SUNZILOG_CONSOLE(), op->node,
1428 &sunzilog_reg, up[1].port.line)) 1429 &sunzilog_reg, up[1].port.line,
1430 false))
1429 up->flags |= SUNZILOG_FLAG_IS_CONS; 1431 up->flags |= SUNZILOG_FLAG_IS_CONS;
1430 err = uart_add_one_port(&sunzilog_reg, &up[1].port); 1432 err = uart_add_one_port(&sunzilog_reg, &up[1].port);
1431 if (err) { 1433 if (err) {
diff --git a/drivers/spi/spi_stmp.c b/drivers/spi/spi_stmp.c
index d871dc23909c..2552bb364005 100644
--- a/drivers/spi/spi_stmp.c
+++ b/drivers/spi/spi_stmp.c
@@ -242,7 +242,7 @@ static int stmp_spi_txrx_dma(struct stmp_spi *ss, int cs,
242 wait_for_completion(&ss->done); 242 wait_for_completion(&ss->done);
243 243
244 if (!busy_wait(readl(ss->regs + HW_SSP_CTRL0) & BM_SSP_CTRL0_RUN)) 244 if (!busy_wait(readl(ss->regs + HW_SSP_CTRL0) & BM_SSP_CTRL0_RUN))
245 status = ETIMEDOUT; 245 status = -ETIMEDOUT;
246 246
247 if (!dma_buf) 247 if (!dma_buf)
248 dma_unmap_single(ss->master_dev, spi_buf_dma, len, dir); 248 dma_unmap_single(ss->master_dev, spi_buf_dma, len, dir);
diff --git a/drivers/spi/spi_txx9.c b/drivers/spi/spi_txx9.c
index 96057de133ad..19f75627c3de 100644
--- a/drivers/spi/spi_txx9.c
+++ b/drivers/spi/spi_txx9.c
@@ -29,6 +29,8 @@
29 29
30 30
31#define SPI_FIFO_SIZE 4 31#define SPI_FIFO_SIZE 4
32#define SPI_MAX_DIVIDER 0xff /* Max. value for SPCR1.SER */
33#define SPI_MIN_DIVIDER 1 /* Min. value for SPCR1.SER */
32 34
33#define TXx9_SPMCR 0x00 35#define TXx9_SPMCR 0x00
34#define TXx9_SPCR0 0x04 36#define TXx9_SPCR0 0x04
@@ -193,11 +195,8 @@ static void txx9spi_work_one(struct txx9spi *c, struct spi_message *m)
193 195
194 if (prev_speed_hz != speed_hz 196 if (prev_speed_hz != speed_hz
195 || prev_bits_per_word != bits_per_word) { 197 || prev_bits_per_word != bits_per_word) {
196 u32 n = (c->baseclk + speed_hz - 1) / speed_hz; 198 int n = DIV_ROUND_UP(c->baseclk, speed_hz) - 1;
197 if (n < 1) 199 n = clamp(n, SPI_MIN_DIVIDER, SPI_MAX_DIVIDER);
198 n = 1;
199 else if (n > 0xff)
200 n = 0xff;
201 /* enter config mode */ 200 /* enter config mode */
202 txx9spi_wr(c, mcr | TXx9_SPMCR_CONFIG | TXx9_SPMCR_BCLR, 201 txx9spi_wr(c, mcr | TXx9_SPMCR_CONFIG | TXx9_SPMCR_BCLR,
203 TXx9_SPMCR); 202 TXx9_SPMCR);
@@ -370,8 +369,8 @@ static int __init txx9spi_probe(struct platform_device *dev)
370 goto exit; 369 goto exit;
371 } 370 }
372 c->baseclk = clk_get_rate(c->clk); 371 c->baseclk = clk_get_rate(c->clk);
373 c->min_speed_hz = (c->baseclk + 0xff - 1) / 0xff; 372 c->min_speed_hz = DIV_ROUND_UP(c->baseclk, SPI_MAX_DIVIDER + 1);
374 c->max_speed_hz = c->baseclk; 373 c->max_speed_hz = c->baseclk / (SPI_MIN_DIVIDER + 1);
375 374
376 res = platform_get_resource(dev, IORESOURCE_MEM, 0); 375 res = platform_get_resource(dev, IORESOURCE_MEM, 0);
377 if (!res) 376 if (!res)
diff --git a/drivers/ssb/pcmcia.c b/drivers/ssb/pcmcia.c
index 100e7a5c5ea1..e72f4046a5e0 100644
--- a/drivers/ssb/pcmcia.c
+++ b/drivers/ssb/pcmcia.c
@@ -617,136 +617,140 @@ static int ssb_pcmcia_sprom_check_crc(const u16 *sprom, size_t size)
617 } \ 617 } \
618 } while (0) 618 } while (0)
619 619
620int ssb_pcmcia_get_invariants(struct ssb_bus *bus, 620static int ssb_pcmcia_get_mac(struct pcmcia_device *p_dev,
621 struct ssb_init_invariants *iv) 621 tuple_t *tuple,
622 void *priv)
622{ 623{
623 tuple_t tuple; 624 struct ssb_sprom *sprom = priv;
624 int res; 625
625 unsigned char buf[32]; 626 if (tuple->TupleData[0] != CISTPL_FUNCE_LAN_NODE_ID)
627 return -EINVAL;
628 if (tuple->TupleDataLen != ETH_ALEN + 2)
629 return -EINVAL;
630 if (tuple->TupleData[1] != ETH_ALEN)
631 return -EINVAL;
632 memcpy(sprom->il0mac, &tuple->TupleData[2], ETH_ALEN);
633 return 0;
634};
635
636static int ssb_pcmcia_do_get_invariants(struct pcmcia_device *p_dev,
637 tuple_t *tuple,
638 void *priv)
639{
640 struct ssb_init_invariants *iv = priv;
626 struct ssb_sprom *sprom = &iv->sprom; 641 struct ssb_sprom *sprom = &iv->sprom;
627 struct ssb_boardinfo *bi = &iv->boardinfo; 642 struct ssb_boardinfo *bi = &iv->boardinfo;
628 const char *error_description; 643 const char *error_description;
629 644
645 GOTO_ERROR_ON(tuple->TupleDataLen < 1, "VEN tpl < 1");
646 switch (tuple->TupleData[0]) {
647 case SSB_PCMCIA_CIS_ID:
648 GOTO_ERROR_ON((tuple->TupleDataLen != 5) &&
649 (tuple->TupleDataLen != 7),
650 "id tpl size");
651 bi->vendor = tuple->TupleData[1] |
652 ((u16)tuple->TupleData[2] << 8);
653 break;
654 case SSB_PCMCIA_CIS_BOARDREV:
655 GOTO_ERROR_ON(tuple->TupleDataLen != 2,
656 "boardrev tpl size");
657 sprom->board_rev = tuple->TupleData[1];
658 break;
659 case SSB_PCMCIA_CIS_PA:
660 GOTO_ERROR_ON((tuple->TupleDataLen != 9) &&
661 (tuple->TupleDataLen != 10),
662 "pa tpl size");
663 sprom->pa0b0 = tuple->TupleData[1] |
664 ((u16)tuple->TupleData[2] << 8);
665 sprom->pa0b1 = tuple->TupleData[3] |
666 ((u16)tuple->TupleData[4] << 8);
667 sprom->pa0b2 = tuple->TupleData[5] |
668 ((u16)tuple->TupleData[6] << 8);
669 sprom->itssi_a = tuple->TupleData[7];
670 sprom->itssi_bg = tuple->TupleData[7];
671 sprom->maxpwr_a = tuple->TupleData[8];
672 sprom->maxpwr_bg = tuple->TupleData[8];
673 break;
674 case SSB_PCMCIA_CIS_OEMNAME:
675 /* We ignore this. */
676 break;
677 case SSB_PCMCIA_CIS_CCODE:
678 GOTO_ERROR_ON(tuple->TupleDataLen != 2,
679 "ccode tpl size");
680 sprom->country_code = tuple->TupleData[1];
681 break;
682 case SSB_PCMCIA_CIS_ANTENNA:
683 GOTO_ERROR_ON(tuple->TupleDataLen != 2,
684 "ant tpl size");
685 sprom->ant_available_a = tuple->TupleData[1];
686 sprom->ant_available_bg = tuple->TupleData[1];
687 break;
688 case SSB_PCMCIA_CIS_ANTGAIN:
689 GOTO_ERROR_ON(tuple->TupleDataLen != 2,
690 "antg tpl size");
691 sprom->antenna_gain.ghz24.a0 = tuple->TupleData[1];
692 sprom->antenna_gain.ghz24.a1 = tuple->TupleData[1];
693 sprom->antenna_gain.ghz24.a2 = tuple->TupleData[1];
694 sprom->antenna_gain.ghz24.a3 = tuple->TupleData[1];
695 sprom->antenna_gain.ghz5.a0 = tuple->TupleData[1];
696 sprom->antenna_gain.ghz5.a1 = tuple->TupleData[1];
697 sprom->antenna_gain.ghz5.a2 = tuple->TupleData[1];
698 sprom->antenna_gain.ghz5.a3 = tuple->TupleData[1];
699 break;
700 case SSB_PCMCIA_CIS_BFLAGS:
701 GOTO_ERROR_ON((tuple->TupleDataLen != 3) &&
702 (tuple->TupleDataLen != 5),
703 "bfl tpl size");
704 sprom->boardflags_lo = tuple->TupleData[1] |
705 ((u16)tuple->TupleData[2] << 8);
706 break;
707 case SSB_PCMCIA_CIS_LEDS:
708 GOTO_ERROR_ON(tuple->TupleDataLen != 5,
709 "leds tpl size");
710 sprom->gpio0 = tuple->TupleData[1];
711 sprom->gpio1 = tuple->TupleData[2];
712 sprom->gpio2 = tuple->TupleData[3];
713 sprom->gpio3 = tuple->TupleData[4];
714 break;
715 }
716 return -ENOSPC; /* continue with next entry */
717
718error:
719 ssb_printk(KERN_ERR PFX
720 "PCMCIA: Failed to fetch device invariants: %s\n",
721 error_description);
722 return -ENODEV;
723}
724
725
726int ssb_pcmcia_get_invariants(struct ssb_bus *bus,
727 struct ssb_init_invariants *iv)
728{
729 struct ssb_sprom *sprom = &iv->sprom;
730 int res;
731
630 memset(sprom, 0xFF, sizeof(*sprom)); 732 memset(sprom, 0xFF, sizeof(*sprom));
631 sprom->revision = 1; 733 sprom->revision = 1;
632 sprom->boardflags_lo = 0; 734 sprom->boardflags_lo = 0;
633 sprom->boardflags_hi = 0; 735 sprom->boardflags_hi = 0;
634 736
635 /* First fetch the MAC address. */ 737 /* First fetch the MAC address. */
636 memset(&tuple, 0, sizeof(tuple)); 738 res = pcmcia_loop_tuple(bus->host_pcmcia, CISTPL_FUNCE,
637 tuple.DesiredTuple = CISTPL_FUNCE; 739 ssb_pcmcia_get_mac, sprom);
638 tuple.TupleData = buf; 740 if (res != 0) {
639 tuple.TupleDataMax = sizeof(buf); 741 ssb_printk(KERN_ERR PFX
640 res = pcmcia_get_first_tuple(bus->host_pcmcia, &tuple); 742 "PCMCIA: Failed to fetch MAC address\n");
641 GOTO_ERROR_ON(res != 0, "MAC first tpl"); 743 return -ENODEV;
642 res = pcmcia_get_tuple_data(bus->host_pcmcia, &tuple);
643 GOTO_ERROR_ON(res != 0, "MAC first tpl data");
644 while (1) {
645 GOTO_ERROR_ON(tuple.TupleDataLen < 1, "MAC tpl < 1");
646 if (tuple.TupleData[0] == CISTPL_FUNCE_LAN_NODE_ID)
647 break;
648 res = pcmcia_get_next_tuple(bus->host_pcmcia, &tuple);
649 GOTO_ERROR_ON(res != 0, "MAC next tpl");
650 res = pcmcia_get_tuple_data(bus->host_pcmcia, &tuple);
651 GOTO_ERROR_ON(res != 0, "MAC next tpl data");
652 } 744 }
653 GOTO_ERROR_ON(tuple.TupleDataLen != ETH_ALEN + 2, "MAC tpl size");
654 memcpy(sprom->il0mac, &tuple.TupleData[2], ETH_ALEN);
655 745
656 /* Fetch the vendor specific tuples. */ 746 /* Fetch the vendor specific tuples. */
657 memset(&tuple, 0, sizeof(tuple)); 747 res = pcmcia_loop_tuple(bus->host_pcmcia, SSB_PCMCIA_CIS,
658 tuple.DesiredTuple = SSB_PCMCIA_CIS; 748 ssb_pcmcia_do_get_invariants, sprom);
659 tuple.TupleData = buf; 749 if ((res == 0) || (res == -ENOSPC))
660 tuple.TupleDataMax = sizeof(buf); 750 return 0;
661 res = pcmcia_get_first_tuple(bus->host_pcmcia, &tuple);
662 GOTO_ERROR_ON(res != 0, "VEN first tpl");
663 res = pcmcia_get_tuple_data(bus->host_pcmcia, &tuple);
664 GOTO_ERROR_ON(res != 0, "VEN first tpl data");
665 while (1) {
666 GOTO_ERROR_ON(tuple.TupleDataLen < 1, "VEN tpl < 1");
667 switch (tuple.TupleData[0]) {
668 case SSB_PCMCIA_CIS_ID:
669 GOTO_ERROR_ON((tuple.TupleDataLen != 5) &&
670 (tuple.TupleDataLen != 7),
671 "id tpl size");
672 bi->vendor = tuple.TupleData[1] |
673 ((u16)tuple.TupleData[2] << 8);
674 break;
675 case SSB_PCMCIA_CIS_BOARDREV:
676 GOTO_ERROR_ON(tuple.TupleDataLen != 2,
677 "boardrev tpl size");
678 sprom->board_rev = tuple.TupleData[1];
679 break;
680 case SSB_PCMCIA_CIS_PA:
681 GOTO_ERROR_ON((tuple.TupleDataLen != 9) &&
682 (tuple.TupleDataLen != 10),
683 "pa tpl size");
684 sprom->pa0b0 = tuple.TupleData[1] |
685 ((u16)tuple.TupleData[2] << 8);
686 sprom->pa0b1 = tuple.TupleData[3] |
687 ((u16)tuple.TupleData[4] << 8);
688 sprom->pa0b2 = tuple.TupleData[5] |
689 ((u16)tuple.TupleData[6] << 8);
690 sprom->itssi_a = tuple.TupleData[7];
691 sprom->itssi_bg = tuple.TupleData[7];
692 sprom->maxpwr_a = tuple.TupleData[8];
693 sprom->maxpwr_bg = tuple.TupleData[8];
694 break;
695 case SSB_PCMCIA_CIS_OEMNAME:
696 /* We ignore this. */
697 break;
698 case SSB_PCMCIA_CIS_CCODE:
699 GOTO_ERROR_ON(tuple.TupleDataLen != 2,
700 "ccode tpl size");
701 sprom->country_code = tuple.TupleData[1];
702 break;
703 case SSB_PCMCIA_CIS_ANTENNA:
704 GOTO_ERROR_ON(tuple.TupleDataLen != 2,
705 "ant tpl size");
706 sprom->ant_available_a = tuple.TupleData[1];
707 sprom->ant_available_bg = tuple.TupleData[1];
708 break;
709 case SSB_PCMCIA_CIS_ANTGAIN:
710 GOTO_ERROR_ON(tuple.TupleDataLen != 2,
711 "antg tpl size");
712 sprom->antenna_gain.ghz24.a0 = tuple.TupleData[1];
713 sprom->antenna_gain.ghz24.a1 = tuple.TupleData[1];
714 sprom->antenna_gain.ghz24.a2 = tuple.TupleData[1];
715 sprom->antenna_gain.ghz24.a3 = tuple.TupleData[1];
716 sprom->antenna_gain.ghz5.a0 = tuple.TupleData[1];
717 sprom->antenna_gain.ghz5.a1 = tuple.TupleData[1];
718 sprom->antenna_gain.ghz5.a2 = tuple.TupleData[1];
719 sprom->antenna_gain.ghz5.a3 = tuple.TupleData[1];
720 break;
721 case SSB_PCMCIA_CIS_BFLAGS:
722 GOTO_ERROR_ON((tuple.TupleDataLen != 3) &&
723 (tuple.TupleDataLen != 5),
724 "bfl tpl size");
725 sprom->boardflags_lo = tuple.TupleData[1] |
726 ((u16)tuple.TupleData[2] << 8);
727 break;
728 case SSB_PCMCIA_CIS_LEDS:
729 GOTO_ERROR_ON(tuple.TupleDataLen != 5,
730 "leds tpl size");
731 sprom->gpio0 = tuple.TupleData[1];
732 sprom->gpio1 = tuple.TupleData[2];
733 sprom->gpio2 = tuple.TupleData[3];
734 sprom->gpio3 = tuple.TupleData[4];
735 break;
736 }
737 res = pcmcia_get_next_tuple(bus->host_pcmcia, &tuple);
738 if (res == -ENOSPC)
739 break;
740 GOTO_ERROR_ON(res != 0, "VEN next tpl");
741 res = pcmcia_get_tuple_data(bus->host_pcmcia, &tuple);
742 GOTO_ERROR_ON(res != 0, "VEN next tpl data");
743 }
744 751
745 return 0;
746error:
747 ssb_printk(KERN_ERR PFX 752 ssb_printk(KERN_ERR PFX
748 "PCMCIA: Failed to fetch device invariants: %s\n", 753 "PCMCIA: Failed to fetch device invariants\n");
749 error_description);
750 return -ENODEV; 754 return -ENODEV;
751} 755}
752 756
diff --git a/drivers/ssb/scan.c b/drivers/ssb/scan.c
index b74212d698c7..e8b89e8ac9bd 100644
--- a/drivers/ssb/scan.c
+++ b/drivers/ssb/scan.c
@@ -162,6 +162,8 @@ static u8 chipid_to_nrcores(u16 chipid)
162static u32 scan_read32(struct ssb_bus *bus, u8 current_coreidx, 162static u32 scan_read32(struct ssb_bus *bus, u8 current_coreidx,
163 u16 offset) 163 u16 offset)
164{ 164{
165 u32 lo, hi;
166
165 switch (bus->bustype) { 167 switch (bus->bustype) {
166 case SSB_BUSTYPE_SSB: 168 case SSB_BUSTYPE_SSB:
167 offset += current_coreidx * SSB_CORE_SIZE; 169 offset += current_coreidx * SSB_CORE_SIZE;
@@ -174,7 +176,9 @@ static u32 scan_read32(struct ssb_bus *bus, u8 current_coreidx,
174 offset -= 0x800; 176 offset -= 0x800;
175 } else 177 } else
176 ssb_pcmcia_switch_segment(bus, 0); 178 ssb_pcmcia_switch_segment(bus, 0);
177 break; 179 lo = readw(bus->mmio + offset);
180 hi = readw(bus->mmio + offset + 2);
181 return lo | (hi << 16);
178 case SSB_BUSTYPE_SDIO: 182 case SSB_BUSTYPE_SDIO:
179 offset += current_coreidx * SSB_CORE_SIZE; 183 offset += current_coreidx * SSB_CORE_SIZE;
180 return ssb_sdio_scan_read32(bus, offset); 184 return ssb_sdio_scan_read32(bus, offset);
diff --git a/drivers/staging/comedi/drivers/cb_das16_cs.c b/drivers/staging/comedi/drivers/cb_das16_cs.c
index 80c0df8656f3..39923cb388be 100644
--- a/drivers/staging/comedi/drivers/cb_das16_cs.c
+++ b/drivers/staging/comedi/drivers/cb_das16_cs.c
@@ -141,37 +141,14 @@ static int das16cs_timer_insn_config(struct comedi_device *dev,
141 struct comedi_insn *insn, 141 struct comedi_insn *insn,
142 unsigned int *data); 142 unsigned int *data);
143 143
144static int get_prodid(struct comedi_device *dev, struct pcmcia_device *link)
145{
146 tuple_t tuple;
147 u_short buf[128];
148 int prodid = 0;
149
150 tuple.TupleData = (cisdata_t *) buf;
151 tuple.TupleOffset = 0;
152 tuple.TupleDataMax = 255;
153 tuple.DesiredTuple = CISTPL_MANFID;
154 tuple.Attributes = TUPLE_RETURN_COMMON;
155 if ((pcmcia_get_first_tuple(link, &tuple) == 0) &&
156 (pcmcia_get_tuple_data(link, &tuple) == 0)) {
157 prodid = le16_to_cpu(buf[1]);
158 }
159
160 return prodid;
161}
162
163static const struct das16cs_board *das16cs_probe(struct comedi_device *dev, 144static const struct das16cs_board *das16cs_probe(struct comedi_device *dev,
164 struct pcmcia_device *link) 145 struct pcmcia_device *link)
165{ 146{
166 int id;
167 int i; 147 int i;
168 148
169 id = get_prodid(dev, link);
170
171 for (i = 0; i < n_boards; i++) { 149 for (i = 0; i < n_boards; i++) {
172 if (das16cs_boards[i].device_id == id) { 150 if (das16cs_boards[i].device_id == link->card_id)
173 return das16cs_boards + i; 151 return das16cs_boards + i;
174 }
175 } 152 }
176 153
177 printk("unknown board!\n"); 154 printk("unknown board!\n");
@@ -660,27 +637,8 @@ static int das16cs_timer_insn_config(struct comedi_device *dev,
660 637
661======================================================================*/ 638======================================================================*/
662 639
663/*
664 All the PCMCIA modules use PCMCIA_DEBUG to control debugging. If
665 you do not define PCMCIA_DEBUG at all, all the debug code will be
666 left out. If you compile with PCMCIA_DEBUG=0, the debug code will
667 be present but disabled -- but it can then be enabled for specific
668 modules at load time with a 'pc_debug=#' option to insmod.
669*/
670#if defined(CONFIG_PCMCIA) || defined(CONFIG_PCMCIA_MODULE) 640#if defined(CONFIG_PCMCIA) || defined(CONFIG_PCMCIA_MODULE)
671 641
672#ifdef PCMCIA_DEBUG
673static int pc_debug = PCMCIA_DEBUG;
674module_param(pc_debug, int, 0644);
675#define DEBUG(n, args...) if (pc_debug>(n)) printk(KERN_DEBUG args)
676static char *version =
677 "cb_das16_cs.c pcmcia code (David Schleef), modified from dummy_cs.c 1.31 2001/08/24 12:13:13 (David Hinds)";
678#else
679#define DEBUG(n, args...)
680#endif
681
682/*====================================================================*/
683
684static void das16cs_pcmcia_config(struct pcmcia_device *link); 642static void das16cs_pcmcia_config(struct pcmcia_device *link);
685static void das16cs_pcmcia_release(struct pcmcia_device *link); 643static void das16cs_pcmcia_release(struct pcmcia_device *link);
686static int das16cs_pcmcia_suspend(struct pcmcia_device *p_dev); 644static int das16cs_pcmcia_suspend(struct pcmcia_device *p_dev);
@@ -733,7 +691,7 @@ static int das16cs_pcmcia_attach(struct pcmcia_device *link)
733{ 691{
734 struct local_info_t *local; 692 struct local_info_t *local;
735 693
736 DEBUG(0, "das16cs_pcmcia_attach()\n"); 694 dev_dbg(&link->dev, "das16cs_pcmcia_attach()\n");
737 695
738 /* Allocate space for private device-specific data */ 696 /* Allocate space for private device-specific data */
739 local = kzalloc(sizeof(struct local_info_t), GFP_KERNEL); 697 local = kzalloc(sizeof(struct local_info_t), GFP_KERNEL);
@@ -745,7 +703,6 @@ static int das16cs_pcmcia_attach(struct pcmcia_device *link)
745 /* Initialize the pcmcia_device structure */ 703 /* Initialize the pcmcia_device structure */
746 /* Interrupt setup */ 704 /* Interrupt setup */
747 link->irq.Attributes = IRQ_TYPE_DYNAMIC_SHARING; 705 link->irq.Attributes = IRQ_TYPE_DYNAMIC_SHARING;
748 link->irq.IRQInfo1 = IRQ_LEVEL_ID;
749 link->irq.Handler = NULL; 706 link->irq.Handler = NULL;
750 707
751 link->conf.Attributes = 0; 708 link->conf.Attributes = 0;
@@ -760,7 +717,7 @@ static int das16cs_pcmcia_attach(struct pcmcia_device *link)
760 717
761static void das16cs_pcmcia_detach(struct pcmcia_device *link) 718static void das16cs_pcmcia_detach(struct pcmcia_device *link)
762{ 719{
763 DEBUG(0, "das16cs_pcmcia_detach(0x%p)\n", link); 720 dev_dbg(&link->dev, "das16cs_pcmcia_detach\n");
764 721
765 if (link->dev_node) { 722 if (link->dev_node) {
766 ((struct local_info_t *)link->priv)->stop = 1; 723 ((struct local_info_t *)link->priv)->stop = 1;
@@ -771,118 +728,55 @@ static void das16cs_pcmcia_detach(struct pcmcia_device *link)
771 kfree(link->priv); 728 kfree(link->priv);
772} /* das16cs_pcmcia_detach */ 729} /* das16cs_pcmcia_detach */
773 730
774static void das16cs_pcmcia_config(struct pcmcia_device *link)
775{
776 struct local_info_t *dev = link->priv;
777 tuple_t tuple;
778 cisparse_t parse;
779 int last_fn, last_ret;
780 u_char buf[64];
781 cistpl_cftable_entry_t dflt = { 0 };
782 731
783 DEBUG(0, "das16cs_pcmcia_config(0x%p)\n", link); 732static int das16cs_pcmcia_config_loop(struct pcmcia_device *p_dev,
784 733 cistpl_cftable_entry_t *cfg,
785 /* 734 cistpl_cftable_entry_t *dflt,
786 This reads the card's CONFIG tuple to find its configuration 735 unsigned int vcc,
787 registers. 736 void *priv_data)
788 */ 737{
789 tuple.DesiredTuple = CISTPL_CONFIG; 738 if (cfg->index == 0)
790 tuple.Attributes = 0; 739 return -EINVAL;
791 tuple.TupleData = buf;
792 tuple.TupleDataMax = sizeof(buf);
793 tuple.TupleOffset = 0;
794
795 last_fn = GetFirstTuple;
796 last_ret = pcmcia_get_first_tuple(link, &tuple);
797 if (last_ret != 0)
798 goto cs_failed;
799
800 last_fn = GetTupleData;
801 last_ret = pcmcia_get_tuple_data(link, &tuple);
802 if (last_ret != 0)
803 goto cs_failed;
804
805 last_fn = ParseTuple;
806 last_ret = pcmcia_parse_tuple(&tuple, &parse);
807 if (last_ret != 0)
808 goto cs_failed;
809
810 link->conf.ConfigBase = parse.config.base;
811 link->conf.Present = parse.config.rmask[0];
812 740
813 /* 741 /* Do we need to allocate an interrupt? */
814 In this loop, we scan the CIS for configuration table entries, 742 if (cfg->irq.IRQInfo1 || dflt->irq.IRQInfo1)
815 each of which describes a valid card configuration, including 743 p_dev->conf.Attributes |= CONF_ENABLE_IRQ;
816 voltage, IO window, memory window, and interrupt settings. 744
817 745 /* IO window settings */
818 We make no assumptions about the card to be configured: we use 746 p_dev->io.NumPorts1 = p_dev->io.NumPorts2 = 0;
819 just the information available in the CIS. In an ideal world, 747 if ((cfg->io.nwin > 0) || (dflt->io.nwin > 0)) {
820 this would work for any PCMCIA card, but it requires a complete 748 cistpl_io_t *io = (cfg->io.nwin) ? &cfg->io : &dflt->io;
821 and accurate CIS. In practice, a driver usually "knows" most of 749 p_dev->io.Attributes1 = IO_DATA_PATH_WIDTH_AUTO;
822 these things without consulting the CIS, and most client drivers 750 if (!(io->flags & CISTPL_IO_8BIT))
823 will only use the CIS to fill in implementation-defined details. 751 p_dev->io.Attributes1 = IO_DATA_PATH_WIDTH_16;
824 */ 752 if (!(io->flags & CISTPL_IO_16BIT))
825 tuple.DesiredTuple = CISTPL_CFTABLE_ENTRY; 753 p_dev->io.Attributes1 = IO_DATA_PATH_WIDTH_8;
826 last_fn = GetFirstTuple; 754 p_dev->io.IOAddrLines = io->flags & CISTPL_IO_LINES_MASK;
827 755 p_dev->io.BasePort1 = io->win[0].base;
828 last_ret = pcmcia_get_first_tuple(link, &tuple); 756 p_dev->io.NumPorts1 = io->win[0].len;
829 if (last_ret) 757 if (io->nwin > 1) {
830 goto cs_failed; 758 p_dev->io.Attributes2 = p_dev->io.Attributes1;
831 759 p_dev->io.BasePort2 = io->win[1].base;
832 while (1) { 760 p_dev->io.NumPorts2 = io->win[1].len;
833 cistpl_cftable_entry_t *cfg = &(parse.cftable_entry);
834 if (pcmcia_get_tuple_data(link, &tuple))
835 goto next_entry;
836 if (pcmcia_parse_tuple(&tuple, &parse))
837 goto next_entry;
838
839 if (cfg->flags & CISTPL_CFTABLE_DEFAULT)
840 dflt = *cfg;
841 if (cfg->index == 0)
842 goto next_entry;
843 link->conf.ConfigIndex = cfg->index;
844
845 /* Does this card need audio output? */
846/* if (cfg->flags & CISTPL_CFTABLE_AUDIO) {
847 link->conf.Attributes |= CONF_ENABLE_SPKR;
848 link->conf.Status = CCSR_AUDIO_ENA;
849 }
850*/
851 /* Do we need to allocate an interrupt? */
852 if (cfg->irq.IRQInfo1 || dflt.irq.IRQInfo1)
853 link->conf.Attributes |= CONF_ENABLE_IRQ;
854
855 /* IO window settings */
856 link->io.NumPorts1 = link->io.NumPorts2 = 0;
857 if ((cfg->io.nwin > 0) || (dflt.io.nwin > 0)) {
858 cistpl_io_t *io = (cfg->io.nwin) ? &cfg->io : &dflt.io;
859 link->io.Attributes1 = IO_DATA_PATH_WIDTH_AUTO;
860 if (!(io->flags & CISTPL_IO_8BIT))
861 link->io.Attributes1 = IO_DATA_PATH_WIDTH_16;
862 if (!(io->flags & CISTPL_IO_16BIT))
863 link->io.Attributes1 = IO_DATA_PATH_WIDTH_8;
864 link->io.IOAddrLines = io->flags & CISTPL_IO_LINES_MASK;
865 link->io.BasePort1 = io->win[0].base;
866 link->io.NumPorts1 = io->win[0].len;
867 if (io->nwin > 1) {
868 link->io.Attributes2 = link->io.Attributes1;
869 link->io.BasePort2 = io->win[1].base;
870 link->io.NumPorts2 = io->win[1].len;
871 }
872 /* This reserves IO space but doesn't actually enable it */
873 if (pcmcia_request_io(link, &link->io))
874 goto next_entry;
875 } 761 }
762 /* This reserves IO space but doesn't actually enable it */
763 return pcmcia_request_io(p_dev, &p_dev->io);
764 }
876 765
877 /* If we got this far, we're cool! */ 766 return 0;
878 break; 767}
768
769static void das16cs_pcmcia_config(struct pcmcia_device *link)
770{
771 struct local_info_t *dev = link->priv;
772 int ret;
879 773
880next_entry: 774 dev_dbg(&link->dev, "das16cs_pcmcia_config\n");
881 last_fn = GetNextTuple;
882 775
883 last_ret = pcmcia_get_next_tuple(link, &tuple); 776 ret = pcmcia_loop_config(link, das16cs_pcmcia_config_loop, NULL);
884 if (last_ret) 777 if (ret) {
885 goto cs_failed; 778 dev_warn(&link->dev, "no configuration found\n");
779 goto failed;
886 } 780 }
887 781
888 /* 782 /*
@@ -891,21 +785,18 @@ next_entry:
891 irq structure is initialized. 785 irq structure is initialized.
892 */ 786 */
893 if (link->conf.Attributes & CONF_ENABLE_IRQ) { 787 if (link->conf.Attributes & CONF_ENABLE_IRQ) {
894 last_fn = RequestIRQ; 788 ret = pcmcia_request_irq(link, &link->irq);
895 789 if (ret)
896 last_ret = pcmcia_request_irq(link, &link->irq); 790 goto failed;
897 if (last_ret)
898 goto cs_failed;
899 } 791 }
900 /* 792 /*
901 This actually configures the PCMCIA socket -- setting up 793 This actually configures the PCMCIA socket -- setting up
902 the I/O windows and the interrupt mapping, and putting the 794 the I/O windows and the interrupt mapping, and putting the
903 card and host interface into "Memory and IO" mode. 795 card and host interface into "Memory and IO" mode.
904 */ 796 */
905 last_fn = RequestConfiguration; 797 ret = pcmcia_request_configuration(link, &link->conf);
906 last_ret = pcmcia_request_configuration(link, &link->conf); 798 if (ret)
907 if (last_ret) 799 goto failed;
908 goto cs_failed;
909 800
910 /* 801 /*
911 At this point, the dev_node_t structure(s) need to be 802 At this point, the dev_node_t structure(s) need to be
@@ -930,14 +821,13 @@ next_entry:
930 821
931 return; 822 return;
932 823
933cs_failed: 824failed:
934 cs_error(link, last_fn, last_ret);
935 das16cs_pcmcia_release(link); 825 das16cs_pcmcia_release(link);
936} /* das16cs_pcmcia_config */ 826} /* das16cs_pcmcia_config */
937 827
938static void das16cs_pcmcia_release(struct pcmcia_device *link) 828static void das16cs_pcmcia_release(struct pcmcia_device *link)
939{ 829{
940 DEBUG(0, "das16cs_pcmcia_release(0x%p)\n", link); 830 dev_dbg(&link->dev, "das16cs_pcmcia_release\n");
941 pcmcia_disable_device(link); 831 pcmcia_disable_device(link);
942} /* das16cs_pcmcia_release */ 832} /* das16cs_pcmcia_release */
943 833
@@ -983,14 +873,13 @@ struct pcmcia_driver das16cs_driver = {
983 873
984static int __init init_das16cs_pcmcia_cs(void) 874static int __init init_das16cs_pcmcia_cs(void)
985{ 875{
986 DEBUG(0, "%s\n", version);
987 pcmcia_register_driver(&das16cs_driver); 876 pcmcia_register_driver(&das16cs_driver);
988 return 0; 877 return 0;
989} 878}
990 879
991static void __exit exit_das16cs_pcmcia_cs(void) 880static void __exit exit_das16cs_pcmcia_cs(void)
992{ 881{
993 DEBUG(0, "das16cs_pcmcia_cs: unloading\n"); 882 pr_debug("das16cs_pcmcia_cs: unloading\n");
994 pcmcia_unregister_driver(&das16cs_driver); 883 pcmcia_unregister_driver(&das16cs_driver);
995} 884}
996 885
diff --git a/drivers/staging/comedi/drivers/das08_cs.c b/drivers/staging/comedi/drivers/das08_cs.c
index 9cab21eaaa18..9b945e5fdd32 100644
--- a/drivers/staging/comedi/drivers/das08_cs.c
+++ b/drivers/staging/comedi/drivers/das08_cs.c
@@ -110,25 +110,6 @@ static int das08_cs_attach(struct comedi_device *dev,
110 110
111======================================================================*/ 111======================================================================*/
112 112
113/*
114 All the PCMCIA modules use PCMCIA_DEBUG to control debugging. If
115 you do not define PCMCIA_DEBUG at all, all the debug code will be
116 left out. If you compile with PCMCIA_DEBUG=0, the debug code will
117 be present but disabled -- but it can then be enabled for specific
118 modules at load time with a 'pc_debug=#' option to insmod.
119*/
120
121#ifdef PCMCIA_DEBUG
122static int pc_debug = PCMCIA_DEBUG;
123module_param(pc_debug, int, 0644);
124#define DEBUG(n, args...) if (pc_debug>(n)) printk(KERN_DEBUG args)
125static const char *version =
126 "das08.c pcmcia code (Frank Hess), modified from dummy_cs.c 1.31 2001/08/24 12:13:13 (David Hinds)";
127#else
128#define DEBUG(n, args...)
129#endif
130
131/*====================================================================*/
132static void das08_pcmcia_config(struct pcmcia_device *link); 113static void das08_pcmcia_config(struct pcmcia_device *link);
133static void das08_pcmcia_release(struct pcmcia_device *link); 114static void das08_pcmcia_release(struct pcmcia_device *link);
134static int das08_pcmcia_suspend(struct pcmcia_device *p_dev); 115static int das08_pcmcia_suspend(struct pcmcia_device *p_dev);
@@ -181,7 +162,7 @@ static int das08_pcmcia_attach(struct pcmcia_device *link)
181{ 162{
182 struct local_info_t *local; 163 struct local_info_t *local;
183 164
184 DEBUG(0, "das08_pcmcia_attach()\n"); 165 dev_dbg(&link->dev, "das08_pcmcia_attach()\n");
185 166
186 /* Allocate space for private device-specific data */ 167 /* Allocate space for private device-specific data */
187 local = kzalloc(sizeof(struct local_info_t), GFP_KERNEL); 168 local = kzalloc(sizeof(struct local_info_t), GFP_KERNEL);
@@ -192,7 +173,6 @@ static int das08_pcmcia_attach(struct pcmcia_device *link)
192 173
193 /* Interrupt setup */ 174 /* Interrupt setup */
194 link->irq.Attributes = IRQ_TYPE_EXCLUSIVE; 175 link->irq.Attributes = IRQ_TYPE_EXCLUSIVE;
195 link->irq.IRQInfo1 = IRQ_LEVEL_ID;
196 link->irq.Handler = NULL; 176 link->irq.Handler = NULL;
197 177
198 /* 178 /*
@@ -224,7 +204,7 @@ static int das08_pcmcia_attach(struct pcmcia_device *link)
224static void das08_pcmcia_detach(struct pcmcia_device *link) 204static void das08_pcmcia_detach(struct pcmcia_device *link)
225{ 205{
226 206
227 DEBUG(0, "das08_pcmcia_detach(0x%p)\n", link); 207 dev_dbg(&link->dev, "das08_pcmcia_detach\n");
228 208
229 if (link->dev_node) { 209 if (link->dev_node) {
230 ((struct local_info_t *)link->priv)->stop = 1; 210 ((struct local_info_t *)link->priv)->stop = 1;
@@ -237,6 +217,44 @@ static void das08_pcmcia_detach(struct pcmcia_device *link)
237 217
238} /* das08_pcmcia_detach */ 218} /* das08_pcmcia_detach */
239 219
220
221static int das08_pcmcia_config_loop(struct pcmcia_device *p_dev,
222 cistpl_cftable_entry_t *cfg,
223 cistpl_cftable_entry_t *dflt,
224 unsigned int vcc,
225 void *priv_data)
226{
227 if (cfg->index == 0)
228 return -ENODEV;
229
230 /* Do we need to allocate an interrupt? */
231 if (cfg->irq.IRQInfo1 || dflt->irq.IRQInfo1)
232 p_dev->conf.Attributes |= CONF_ENABLE_IRQ;
233
234 /* IO window settings */
235 p_dev->io.NumPorts1 = p_dev->io.NumPorts2 = 0;
236 if ((cfg->io.nwin > 0) || (dflt->io.nwin > 0)) {
237 cistpl_io_t *io = (cfg->io.nwin) ? &cfg->io : &dflt->io;
238 p_dev->io.Attributes1 = IO_DATA_PATH_WIDTH_AUTO;
239 if (!(io->flags & CISTPL_IO_8BIT))
240 p_dev->io.Attributes1 = IO_DATA_PATH_WIDTH_16;
241 if (!(io->flags & CISTPL_IO_16BIT))
242 p_dev->io.Attributes1 = IO_DATA_PATH_WIDTH_8;
243 p_dev->io.IOAddrLines = io->flags & CISTPL_IO_LINES_MASK;
244 p_dev->io.BasePort1 = io->win[0].base;
245 p_dev->io.NumPorts1 = io->win[0].len;
246 if (io->nwin > 1) {
247 p_dev->io.Attributes2 = p_dev->io.Attributes1;
248 p_dev->io.BasePort2 = io->win[1].base;
249 p_dev->io.NumPorts2 = io->win[1].len;
250 }
251 /* This reserves IO space but doesn't actually enable it */
252 return pcmcia_request_io(p_dev, &p_dev->io);
253 }
254 return 0;
255}
256
257
240/*====================================================================== 258/*======================================================================
241 259
242 das08_pcmcia_config() is scheduled to run after a CARD_INSERTION event 260 das08_pcmcia_config() is scheduled to run after a CARD_INSERTION event
@@ -248,128 +266,20 @@ static void das08_pcmcia_detach(struct pcmcia_device *link)
248static void das08_pcmcia_config(struct pcmcia_device *link) 266static void das08_pcmcia_config(struct pcmcia_device *link)
249{ 267{
250 struct local_info_t *dev = link->priv; 268 struct local_info_t *dev = link->priv;
251 tuple_t tuple; 269 int ret;
252 cisparse_t parse;
253 int last_fn, last_ret;
254 u_char buf[64];
255 cistpl_cftable_entry_t dflt = { 0 };
256
257 DEBUG(0, "das08_pcmcia_config(0x%p)\n", link);
258
259 /*
260 This reads the card's CONFIG tuple to find its configuration
261 registers.
262 */
263 tuple.DesiredTuple = CISTPL_CONFIG;
264 tuple.Attributes = 0;
265 tuple.TupleData = buf;
266 tuple.TupleDataMax = sizeof(buf);
267 tuple.TupleOffset = 0;
268 last_fn = GetFirstTuple;
269
270 last_ret = pcmcia_get_first_tuple(link, &tuple);
271 if (last_ret)
272 goto cs_failed;
273
274 last_fn = GetTupleData;
275
276 last_ret = pcmcia_get_tuple_data(link, &tuple);
277 if (last_ret)
278 goto cs_failed;
279
280 last_fn = ParseTuple;
281
282 last_ret = pcmcia_parse_tuple(&tuple, &parse);
283 if (last_ret)
284 goto cs_failed;
285
286 link->conf.ConfigBase = parse.config.base;
287 link->conf.Present = parse.config.rmask[0];
288
289 /*
290 In this loop, we scan the CIS for configuration table entries,
291 each of which describes a valid card configuration, including
292 voltage, IO window, memory window, and interrupt settings.
293
294 We make no assumptions about the card to be configured: we use
295 just the information available in the CIS. In an ideal world,
296 this would work for any PCMCIA card, but it requires a complete
297 and accurate CIS. In practice, a driver usually "knows" most of
298 these things without consulting the CIS, and most client drivers
299 will only use the CIS to fill in implementation-defined details.
300 */
301 tuple.DesiredTuple = CISTPL_CFTABLE_ENTRY;
302 last_fn = GetFirstTuple;
303
304 last_ret = pcmcia_get_first_tuple(link, &tuple);
305 if (last_ret)
306 goto cs_failed;
307
308 while (1) {
309 cistpl_cftable_entry_t *cfg = &(parse.cftable_entry);
310
311 last_ret = pcmcia_get_tuple_data(link, &tuple);
312 if (last_ret)
313 goto next_entry;
314
315 last_ret = pcmcia_parse_tuple(&tuple, &parse);
316 if (last_ret)
317 goto next_entry;
318
319 if (cfg->flags & CISTPL_CFTABLE_DEFAULT)
320 dflt = *cfg;
321 if (cfg->index == 0)
322 goto next_entry;
323 link->conf.ConfigIndex = cfg->index;
324
325 /* Does this card need audio output? */
326/* if (cfg->flags & CISTPL_CFTABLE_AUDIO) {
327 link->conf.Attributes |= CONF_ENABLE_SPKR;
328 link->conf.Status = CCSR_AUDIO_ENA;
329 }
330*/
331 /* Do we need to allocate an interrupt? */
332 if (cfg->irq.IRQInfo1 || dflt.irq.IRQInfo1)
333 link->conf.Attributes |= CONF_ENABLE_IRQ;
334
335 /* IO window settings */
336 link->io.NumPorts1 = link->io.NumPorts2 = 0;
337 if ((cfg->io.nwin > 0) || (dflt.io.nwin > 0)) {
338 cistpl_io_t *io = (cfg->io.nwin) ? &cfg->io : &dflt.io;
339 link->io.Attributes1 = IO_DATA_PATH_WIDTH_AUTO;
340 if (!(io->flags & CISTPL_IO_8BIT))
341 link->io.Attributes1 = IO_DATA_PATH_WIDTH_16;
342 if (!(io->flags & CISTPL_IO_16BIT))
343 link->io.Attributes1 = IO_DATA_PATH_WIDTH_8;
344 link->io.IOAddrLines = io->flags & CISTPL_IO_LINES_MASK;
345 link->io.BasePort1 = io->win[0].base;
346 link->io.NumPorts1 = io->win[0].len;
347 if (io->nwin > 1) {
348 link->io.Attributes2 = link->io.Attributes1;
349 link->io.BasePort2 = io->win[1].base;
350 link->io.NumPorts2 = io->win[1].len;
351 }
352 /* This reserves IO space but doesn't actually enable it */
353 if (pcmcia_request_io(link, &link->io) != 0)
354 goto next_entry;
355 }
356
357 /* If we got this far, we're cool! */
358 break;
359 270
360next_entry: 271 dev_dbg(&link->dev, "das08_pcmcia_config\n");
361 last_fn = GetNextTuple;
362 272
363 last_ret = pcmcia_get_next_tuple(link, &tuple); 273 ret = pcmcia_loop_config(link, das08_pcmcia_config_loop, NULL);
364 if (last_ret) 274 if (ret) {
365 goto cs_failed; 275 dev_warn(&link->dev, "no configuration found\n");
276 goto failed;
366 } 277 }
367 278
368 if (link->conf.Attributes & CONF_ENABLE_IRQ) { 279 if (link->conf.Attributes & CONF_ENABLE_IRQ) {
369 last_fn = RequestIRQ; 280 ret = pcmcia_request_irq(link, &link->irq);
370 last_ret = pcmcia_request_irq(link, &link->irq); 281 if (ret)
371 if (last_ret) 282 goto failed;
372 goto cs_failed;
373 } 283 }
374 284
375 /* 285 /*
@@ -377,10 +287,9 @@ next_entry:
377 the I/O windows and the interrupt mapping, and putting the 287 the I/O windows and the interrupt mapping, and putting the
378 card and host interface into "Memory and IO" mode. 288 card and host interface into "Memory and IO" mode.
379 */ 289 */
380 last_fn = RequestConfiguration; 290 ret = pcmcia_request_configuration(link, &link->conf);
381 last_ret = pcmcia_request_configuration(link, &link->conf); 291 if (ret)
382 if (last_ret) 292 goto failed;
383 goto cs_failed;
384 293
385 /* 294 /*
386 At this point, the dev_node_t structure(s) need to be 295 At this point, the dev_node_t structure(s) need to be
@@ -405,8 +314,7 @@ next_entry:
405 314
406 return; 315 return;
407 316
408cs_failed: 317failed:
409 cs_error(link, last_fn, last_ret);
410 das08_pcmcia_release(link); 318 das08_pcmcia_release(link);
411 319
412} /* das08_pcmcia_config */ 320} /* das08_pcmcia_config */
@@ -421,7 +329,7 @@ cs_failed:
421 329
422static void das08_pcmcia_release(struct pcmcia_device *link) 330static void das08_pcmcia_release(struct pcmcia_device *link)
423{ 331{
424 DEBUG(0, "das08_pcmcia_release(0x%p)\n", link); 332 dev_dbg(&link->dev, "das08_pcmcia_release\n");
425 pcmcia_disable_device(link); 333 pcmcia_disable_device(link);
426} /* das08_pcmcia_release */ 334} /* das08_pcmcia_release */
427 335
@@ -477,14 +385,13 @@ struct pcmcia_driver das08_cs_driver = {
477 385
478static int __init init_das08_pcmcia_cs(void) 386static int __init init_das08_pcmcia_cs(void)
479{ 387{
480 DEBUG(0, "%s\n", version);
481 pcmcia_register_driver(&das08_cs_driver); 388 pcmcia_register_driver(&das08_cs_driver);
482 return 0; 389 return 0;
483} 390}
484 391
485static void __exit exit_das08_pcmcia_cs(void) 392static void __exit exit_das08_pcmcia_cs(void)
486{ 393{
487 DEBUG(0, "das08_pcmcia_cs: unloading\n"); 394 pr_debug("das08_pcmcia_cs: unloading\n");
488 pcmcia_unregister_driver(&das08_cs_driver); 395 pcmcia_unregister_driver(&das08_cs_driver);
489} 396}
490 397
diff --git a/drivers/staging/comedi/drivers/ni_daq_700.c b/drivers/staging/comedi/drivers/ni_daq_700.c
index ec31a3970664..ef5e1183d47d 100644
--- a/drivers/staging/comedi/drivers/ni_daq_700.c
+++ b/drivers/staging/comedi/drivers/ni_daq_700.c
@@ -436,25 +436,7 @@ static int dio700_detach(struct comedi_device *dev)
436 return 0; 436 return 0;
437}; 437};
438 438
439/* PCMCIA crap */ 439/* PCMCIA crap -- watch your words, please! */
440
441/*
442 All the PCMCIA modules use PCMCIA_DEBUG to control debugging. If
443 you do not define PCMCIA_DEBUG at all, all the debug code will be
444 left out. If you compile with PCMCIA_DEBUG=0, the debug code will
445 be present but disabled -- but it can then be enabled for specific
446 modules at load time with a 'pc_debug=#' option to insmod.
447*/
448#ifdef PCMCIA_DEBUG
449static int pc_debug = PCMCIA_DEBUG;
450module_param(pc_debug, int, 0644);
451#define DEBUG(n, args...) if (pc_debug>(n)) printk(KERN_DEBUG args)
452static char *version = "ni_daq_700.c, based on dummy_cs.c";
453#else
454#define DEBUG(n, args...)
455#endif
456
457/*====================================================================*/
458 440
459static void dio700_config(struct pcmcia_device *link); 441static void dio700_config(struct pcmcia_device *link);
460static void dio700_release(struct pcmcia_device *link); 442static void dio700_release(struct pcmcia_device *link);
@@ -510,7 +492,7 @@ static int dio700_cs_attach(struct pcmcia_device *link)
510 492
511 printk(KERN_INFO "ni_daq_700: cs-attach\n"); 493 printk(KERN_INFO "ni_daq_700: cs-attach\n");
512 494
513 DEBUG(0, "dio700_cs_attach()\n"); 495 dev_dbg(&link->dev, "dio700_cs_attach()\n");
514 496
515 /* Allocate space for private device-specific data */ 497 /* Allocate space for private device-specific data */
516 local = kzalloc(sizeof(struct local_info_t), GFP_KERNEL); 498 local = kzalloc(sizeof(struct local_info_t), GFP_KERNEL);
@@ -521,7 +503,6 @@ static int dio700_cs_attach(struct pcmcia_device *link)
521 503
522 /* Interrupt setup */ 504 /* Interrupt setup */
523 link->irq.Attributes = IRQ_TYPE_DYNAMIC_SHARING; 505 link->irq.Attributes = IRQ_TYPE_DYNAMIC_SHARING;
524 link->irq.IRQInfo1 = IRQ_LEVEL_ID;
525 link->irq.Handler = NULL; 506 link->irq.Handler = NULL;
526 507
527 /* 508 /*
@@ -555,7 +536,7 @@ static void dio700_cs_detach(struct pcmcia_device *link)
555 536
556 printk(KERN_INFO "ni_daq_700: cs-detach!\n"); 537 printk(KERN_INFO "ni_daq_700: cs-detach!\n");
557 538
558 DEBUG(0, "dio700_cs_detach(0x%p)\n", link); 539 dev_dbg(&link->dev, "dio700_cs_detach\n");
559 540
560 if (link->dev_node) { 541 if (link->dev_node) {
561 ((struct local_info_t *)link->priv)->stop = 1; 542 ((struct local_info_t *)link->priv)->stop = 1;
@@ -576,141 +557,85 @@ static void dio700_cs_detach(struct pcmcia_device *link)
576 557
577======================================================================*/ 558======================================================================*/
578 559
579static void dio700_config(struct pcmcia_device *link) 560static int dio700_pcmcia_config_loop(struct pcmcia_device *p_dev,
561 cistpl_cftable_entry_t *cfg,
562 cistpl_cftable_entry_t *dflt,
563 unsigned int vcc,
564 void *priv_data)
580{ 565{
581 struct local_info_t *dev = link->priv; 566 win_req_t *req = priv_data;
582 tuple_t tuple;
583 cisparse_t parse;
584 int last_ret;
585 u_char buf[64];
586 win_req_t req;
587 memreq_t map; 567 memreq_t map;
588 cistpl_cftable_entry_t dflt = { 0 };
589 568
590 printk(KERN_INFO "ni_daq_700: cs-config\n"); 569 if (cfg->index == 0)
591 570 return -ENODEV;
592 DEBUG(0, "dio700_config(0x%p)\n", link);
593 571
594 /* 572 /* Does this card need audio output? */
595 This reads the card's CONFIG tuple to find its configuration 573 if (cfg->flags & CISTPL_CFTABLE_AUDIO) {
596 registers. 574 p_dev->conf.Attributes |= CONF_ENABLE_SPKR;
597 */ 575 p_dev->conf.Status = CCSR_AUDIO_ENA;
598 tuple.DesiredTuple = CISTPL_CONFIG;
599 tuple.Attributes = 0;
600 tuple.TupleData = buf;
601 tuple.TupleDataMax = sizeof(buf);
602 tuple.TupleOffset = 0;
603
604 last_ret = pcmcia_get_first_tuple(link, &tuple);
605 if (last_ret) {
606 cs_error(link, GetFirstTuple, last_ret);
607 goto cs_failed;
608 } 576 }
609 577
610 last_ret = pcmcia_get_tuple_data(link, &tuple); 578 /* Do we need to allocate an interrupt? */
611 if (last_ret) { 579 if (cfg->irq.IRQInfo1 || dflt->irq.IRQInfo1)
612 cs_error(link, GetTupleData, last_ret); 580 p_dev->conf.Attributes |= CONF_ENABLE_IRQ;
613 goto cs_failed; 581
582 /* IO window settings */
583 p_dev->io.NumPorts1 = p_dev->io.NumPorts2 = 0;
584 if ((cfg->io.nwin > 0) || (dflt->io.nwin > 0)) {
585 cistpl_io_t *io = (cfg->io.nwin) ? &cfg->io : &dflt->io;
586 p_dev->io.Attributes1 = IO_DATA_PATH_WIDTH_AUTO;
587 if (!(io->flags & CISTPL_IO_8BIT))
588 p_dev->io.Attributes1 = IO_DATA_PATH_WIDTH_16;
589 if (!(io->flags & CISTPL_IO_16BIT))
590 p_dev->io.Attributes1 = IO_DATA_PATH_WIDTH_8;
591 p_dev->io.IOAddrLines = io->flags & CISTPL_IO_LINES_MASK;
592 p_dev->io.BasePort1 = io->win[0].base;
593 p_dev->io.NumPorts1 = io->win[0].len;
594 if (io->nwin > 1) {
595 p_dev->io.Attributes2 = p_dev->io.Attributes1;
596 p_dev->io.BasePort2 = io->win[1].base;
597 p_dev->io.NumPorts2 = io->win[1].len;
598 }
599 /* This reserves IO space but doesn't actually enable it */
600 if (pcmcia_request_io(p_dev, &p_dev->io) != 0)
601 return -ENODEV;
614 } 602 }
615 603
616 last_ret = pcmcia_parse_tuple(&tuple, &parse); 604 if ((cfg->mem.nwin > 0) || (dflt->mem.nwin > 0)) {
617 if (last_ret) { 605 cistpl_mem_t *mem =
618 cs_error(link, ParseTuple, last_ret); 606 (cfg->mem.nwin) ? &cfg->mem : &dflt->mem;
619 goto cs_failed; 607 req->Attributes = WIN_DATA_WIDTH_16 | WIN_MEMORY_TYPE_CM;
608 req->Attributes |= WIN_ENABLE;
609 req->Base = mem->win[0].host_addr;
610 req->Size = mem->win[0].len;
611 if (req->Size < 0x1000)
612 req->Size = 0x1000;
613 req->AccessSpeed = 0;
614 if (pcmcia_request_window(p_dev, req, &p_dev->win))
615 return -ENODEV;
616 map.Page = 0;
617 map.CardOffset = mem->win[0].card_addr;
618 if (pcmcia_map_mem_page(p_dev, p_dev->win, &map))
619 return -ENODEV;
620 } 620 }
621 link->conf.ConfigBase = parse.config.base; 621 /* If we got this far, we're cool! */
622 link->conf.Present = parse.config.rmask[0]; 622 return 0;
623 623}
624 /*
625 In this loop, we scan the CIS for configuration table entries,
626 each of which describes a valid card configuration, including
627 voltage, IO window, memory window, and interrupt settings.
628
629 We make no assumptions about the card to be configured: we use
630 just the information available in the CIS. In an ideal world,
631 this would work for any PCMCIA card, but it requires a complete
632 and accurate CIS. In practice, a driver usually "knows" most of
633 these things without consulting the CIS, and most client drivers
634 will only use the CIS to fill in implementation-defined details.
635 */
636 tuple.DesiredTuple = CISTPL_CFTABLE_ENTRY;
637 last_ret = pcmcia_get_first_tuple(link, &tuple);
638 if (last_ret != 0) {
639 cs_error(link, GetFirstTuple, last_ret);
640 goto cs_failed;
641 }
642 while (1) {
643 cistpl_cftable_entry_t *cfg = &(parse.cftable_entry);
644 if (pcmcia_get_tuple_data(link, &tuple) != 0)
645 goto next_entry;
646 if (pcmcia_parse_tuple(&tuple, &parse) != 0)
647 goto next_entry;
648
649 if (cfg->flags & CISTPL_CFTABLE_DEFAULT)
650 dflt = *cfg;
651 if (cfg->index == 0)
652 goto next_entry;
653 link->conf.ConfigIndex = cfg->index;
654
655 /* Does this card need audio output? */
656 if (cfg->flags & CISTPL_CFTABLE_AUDIO) {
657 link->conf.Attributes |= CONF_ENABLE_SPKR;
658 link->conf.Status = CCSR_AUDIO_ENA;
659 }
660 624
661 /* Do we need to allocate an interrupt? */ 625static void dio700_config(struct pcmcia_device *link)
662 if (cfg->irq.IRQInfo1 || dflt.irq.IRQInfo1) 626{
663 link->conf.Attributes |= CONF_ENABLE_IRQ; 627 struct local_info_t *dev = link->priv;
664 628 win_req_t req;
665 /* IO window settings */ 629 int ret;
666 link->io.NumPorts1 = link->io.NumPorts2 = 0;
667 if ((cfg->io.nwin > 0) || (dflt.io.nwin > 0)) {
668 cistpl_io_t *io = (cfg->io.nwin) ? &cfg->io : &dflt.io;
669 link->io.Attributes1 = IO_DATA_PATH_WIDTH_AUTO;
670 if (!(io->flags & CISTPL_IO_8BIT))
671 link->io.Attributes1 = IO_DATA_PATH_WIDTH_16;
672 if (!(io->flags & CISTPL_IO_16BIT))
673 link->io.Attributes1 = IO_DATA_PATH_WIDTH_8;
674 link->io.IOAddrLines = io->flags & CISTPL_IO_LINES_MASK;
675 link->io.BasePort1 = io->win[0].base;
676 link->io.NumPorts1 = io->win[0].len;
677 if (io->nwin > 1) {
678 link->io.Attributes2 = link->io.Attributes1;
679 link->io.BasePort2 = io->win[1].base;
680 link->io.NumPorts2 = io->win[1].len;
681 }
682 /* This reserves IO space but doesn't actually enable it */
683 if (pcmcia_request_io(link, &link->io) != 0)
684 goto next_entry;
685 }
686 630
687 if ((cfg->mem.nwin > 0) || (dflt.mem.nwin > 0)) { 631 printk(KERN_INFO "ni_daq_700: cs-config\n");
688 cistpl_mem_t *mem =
689 (cfg->mem.nwin) ? &cfg->mem : &dflt.mem;
690 req.Attributes = WIN_DATA_WIDTH_16 | WIN_MEMORY_TYPE_CM;
691 req.Attributes |= WIN_ENABLE;
692 req.Base = mem->win[0].host_addr;
693 req.Size = mem->win[0].len;
694 if (req.Size < 0x1000)
695 req.Size = 0x1000;
696 req.AccessSpeed = 0;
697 if (pcmcia_request_window(&link, &req, &link->win))
698 goto next_entry;
699 map.Page = 0;
700 map.CardOffset = mem->win[0].card_addr;
701 if (pcmcia_map_mem_page(link->win, &map))
702 goto next_entry;
703 }
704 /* If we got this far, we're cool! */
705 break;
706 632
707next_entry: 633 dev_dbg(&link->dev, "dio700_config\n");
708 634
709 last_ret = pcmcia_get_next_tuple(link, &tuple); 635 ret = pcmcia_loop_config(link, dio700_pcmcia_config_loop, &req);
710 if (last_ret) { 636 if (ret) {
711 cs_error(link, GetNextTuple, last_ret); 637 dev_warn(&link->dev, "no configuration found\n");
712 goto cs_failed; 638 goto failed;
713 }
714 } 639 }
715 640
716 /* 641 /*
@@ -719,11 +644,9 @@ next_entry:
719 irq structure is initialized. 644 irq structure is initialized.
720 */ 645 */
721 if (link->conf.Attributes & CONF_ENABLE_IRQ) { 646 if (link->conf.Attributes & CONF_ENABLE_IRQ) {
722 last_ret = pcmcia_request_irq(link, &link->irq); 647 ret = pcmcia_request_irq(link, &link->irq);
723 if (last_ret) { 648 if (ret)
724 cs_error(link, RequestIRQ, last_ret); 649 goto failed;
725 goto cs_failed;
726 }
727 } 650 }
728 651
729 /* 652 /*
@@ -731,11 +654,9 @@ next_entry:
731 the I/O windows and the interrupt mapping, and putting the 654 the I/O windows and the interrupt mapping, and putting the
732 card and host interface into "Memory and IO" mode. 655 card and host interface into "Memory and IO" mode.
733 */ 656 */
734 last_ret = pcmcia_request_configuration(link, &link->conf); 657 ret = pcmcia_request_configuration(link, &link->conf);
735 if (last_ret != 0) { 658 if (ret != 0)
736 cs_error(link, RequestConfiguration, last_ret); 659 goto failed;
737 goto cs_failed;
738 }
739 660
740 /* 661 /*
741 At this point, the dev_node_t structure(s) need to be 662 At this point, the dev_node_t structure(s) need to be
@@ -763,7 +684,7 @@ next_entry:
763 684
764 return; 685 return;
765 686
766cs_failed: 687failed:
767 printk(KERN_INFO "ni_daq_700 cs failed"); 688 printk(KERN_INFO "ni_daq_700 cs failed");
768 dio700_release(link); 689 dio700_release(link);
769 690
@@ -771,7 +692,7 @@ cs_failed:
771 692
772static void dio700_release(struct pcmcia_device *link) 693static void dio700_release(struct pcmcia_device *link)
773{ 694{
774 DEBUG(0, "dio700_release(0x%p)\n", link); 695 dev_dbg(&link->dev, "dio700_release\n");
775 696
776 pcmcia_disable_device(link); 697 pcmcia_disable_device(link);
777} /* dio700_release */ 698} /* dio700_release */
@@ -830,15 +751,13 @@ struct pcmcia_driver dio700_cs_driver = {
830 751
831static int __init init_dio700_cs(void) 752static int __init init_dio700_cs(void)
832{ 753{
833 printk("ni_daq_700: cs-init \n");
834 DEBUG(0, "%s\n", version);
835 pcmcia_register_driver(&dio700_cs_driver); 754 pcmcia_register_driver(&dio700_cs_driver);
836 return 0; 755 return 0;
837} 756}
838 757
839static void __exit exit_dio700_cs(void) 758static void __exit exit_dio700_cs(void)
840{ 759{
841 DEBUG(0, "ni_daq_700: unloading\n"); 760 pr_debug("ni_daq_700: unloading\n");
842 pcmcia_unregister_driver(&dio700_cs_driver); 761 pcmcia_unregister_driver(&dio700_cs_driver);
843} 762}
844 763
diff --git a/drivers/staging/comedi/drivers/ni_daq_dio24.c b/drivers/staging/comedi/drivers/ni_daq_dio24.c
index 0700a8bddd1e..9017be3a92f1 100644
--- a/drivers/staging/comedi/drivers/ni_daq_dio24.c
+++ b/drivers/staging/comedi/drivers/ni_daq_dio24.c
@@ -187,25 +187,7 @@ static int dio24_detach(struct comedi_device *dev)
187 return 0; 187 return 0;
188}; 188};
189 189
190/* PCMCIA crap */ 190/* PCMCIA crap -- watch your words! */
191
192/*
193 All the PCMCIA modules use PCMCIA_DEBUG to control debugging. If
194 you do not define PCMCIA_DEBUG at all, all the debug code will be
195 left out. If you compile with PCMCIA_DEBUG=0, the debug code will
196 be present but disabled -- but it can then be enabled for specific
197 modules at load time with a 'pc_debug=#' option to insmod.
198*/
199#ifdef PCMCIA_DEBUG
200static int pc_debug = PCMCIA_DEBUG;
201module_param(pc_debug, int, 0644);
202#define DEBUG(n, args...) if (pc_debug>(n)) printk(KERN_DEBUG args)
203static char *version = "ni_daq_dio24.c, based on dummy_cs.c";
204#else
205#define DEBUG(n, args...)
206#endif
207
208/*====================================================================*/
209 191
210static void dio24_config(struct pcmcia_device *link); 192static void dio24_config(struct pcmcia_device *link);
211static void dio24_release(struct pcmcia_device *link); 193static void dio24_release(struct pcmcia_device *link);
@@ -261,7 +243,7 @@ static int dio24_cs_attach(struct pcmcia_device *link)
261 243
262 printk(KERN_INFO "ni_daq_dio24: HOLA SOY YO - CS-attach!\n"); 244 printk(KERN_INFO "ni_daq_dio24: HOLA SOY YO - CS-attach!\n");
263 245
264 DEBUG(0, "dio24_cs_attach()\n"); 246 dev_dbg(&link->dev, "dio24_cs_attach()\n");
265 247
266 /* Allocate space for private device-specific data */ 248 /* Allocate space for private device-specific data */
267 local = kzalloc(sizeof(struct local_info_t), GFP_KERNEL); 249 local = kzalloc(sizeof(struct local_info_t), GFP_KERNEL);
@@ -272,7 +254,6 @@ static int dio24_cs_attach(struct pcmcia_device *link)
272 254
273 /* Interrupt setup */ 255 /* Interrupt setup */
274 link->irq.Attributes = IRQ_TYPE_DYNAMIC_SHARING; 256 link->irq.Attributes = IRQ_TYPE_DYNAMIC_SHARING;
275 link->irq.IRQInfo1 = IRQ_LEVEL_ID;
276 link->irq.Handler = NULL; 257 link->irq.Handler = NULL;
277 258
278 /* 259 /*
@@ -306,7 +287,7 @@ static void dio24_cs_detach(struct pcmcia_device *link)
306 287
307 printk(KERN_INFO "ni_daq_dio24: HOLA SOY YO - cs-detach!\n"); 288 printk(KERN_INFO "ni_daq_dio24: HOLA SOY YO - cs-detach!\n");
308 289
309 DEBUG(0, "dio24_cs_detach(0x%p)\n", link); 290 dev_dbg(&link->dev, "dio24_cs_detach\n");
310 291
311 if (link->dev_node) { 292 if (link->dev_node) {
312 ((struct local_info_t *)link->priv)->stop = 1; 293 ((struct local_info_t *)link->priv)->stop = 1;
@@ -327,142 +308,85 @@ static void dio24_cs_detach(struct pcmcia_device *link)
327 308
328======================================================================*/ 309======================================================================*/
329 310
330static void dio24_config(struct pcmcia_device *link) 311static int dio24_pcmcia_config_loop(struct pcmcia_device *p_dev,
312 cistpl_cftable_entry_t *cfg,
313 cistpl_cftable_entry_t *dflt,
314 unsigned int vcc,
315 void *priv_data)
331{ 316{
332 struct local_info_t *dev = link->priv; 317 win_req_t *req = priv_data;
333 tuple_t tuple;
334 cisparse_t parse;
335 int last_ret;
336 u_char buf[64];
337 win_req_t req;
338 memreq_t map; 318 memreq_t map;
339 cistpl_cftable_entry_t dflt = { 0 };
340 319
341 printk(KERN_INFO "ni_daq_dio24: HOLA SOY YO! - config\n"); 320 if (cfg->index == 0)
342 321 return -ENODEV;
343 DEBUG(0, "dio24_config(0x%p)\n", link);
344
345 /*
346 This reads the card's CONFIG tuple to find its configuration
347 registers.
348 */
349 tuple.DesiredTuple = CISTPL_CONFIG;
350 tuple.Attributes = 0;
351 tuple.TupleData = buf;
352 tuple.TupleDataMax = sizeof(buf);
353 tuple.TupleOffset = 0;
354
355 last_ret = pcmcia_get_first_tuple(link, &tuple);
356 if (last_ret) {
357 cs_error(link, GetFirstTuple, last_ret);
358 goto cs_failed;
359 }
360 322
361 last_ret = pcmcia_get_tuple_data(link, &tuple); 323 /* Does this card need audio output? */
362 if (last_ret) { 324 if (cfg->flags & CISTPL_CFTABLE_AUDIO) {
363 cs_error(link, GetTupleData, last_ret); 325 p_dev->conf.Attributes |= CONF_ENABLE_SPKR;
364 goto cs_failed; 326 p_dev->conf.Status = CCSR_AUDIO_ENA;
365 } 327 }
366 328
367 last_ret = pcmcia_parse_tuple(&tuple, &parse); 329 /* Do we need to allocate an interrupt? */
368 if (last_ret) { 330 if (cfg->irq.IRQInfo1 || dflt->irq.IRQInfo1)
369 cs_error(link, ParseTuple, last_ret); 331 p_dev->conf.Attributes |= CONF_ENABLE_IRQ;
370 goto cs_failed; 332
333 /* IO window settings */
334 p_dev->io.NumPorts1 = p_dev->io.NumPorts2 = 0;
335 if ((cfg->io.nwin > 0) || (dflt->io.nwin > 0)) {
336 cistpl_io_t *io = (cfg->io.nwin) ? &cfg->io : &dflt->io;
337 p_dev->io.Attributes1 = IO_DATA_PATH_WIDTH_AUTO;
338 if (!(io->flags & CISTPL_IO_8BIT))
339 p_dev->io.Attributes1 = IO_DATA_PATH_WIDTH_16;
340 if (!(io->flags & CISTPL_IO_16BIT))
341 p_dev->io.Attributes1 = IO_DATA_PATH_WIDTH_8;
342 p_dev->io.IOAddrLines = io->flags & CISTPL_IO_LINES_MASK;
343 p_dev->io.BasePort1 = io->win[0].base;
344 p_dev->io.NumPorts1 = io->win[0].len;
345 if (io->nwin > 1) {
346 p_dev->io.Attributes2 = p_dev->io.Attributes1;
347 p_dev->io.BasePort2 = io->win[1].base;
348 p_dev->io.NumPorts2 = io->win[1].len;
349 }
350 /* This reserves IO space but doesn't actually enable it */
351 if (pcmcia_request_io(p_dev, &p_dev->io) != 0)
352 return -ENODEV;
371 } 353 }
372 link->conf.ConfigBase = parse.config.base;
373 link->conf.Present = parse.config.rmask[0];
374
375 /*
376 In this loop, we scan the CIS for configuration table entries,
377 each of which describes a valid card configuration, including
378 voltage, IO window, memory window, and interrupt settings.
379
380 We make no assumptions about the card to be configured: we use
381 just the information available in the CIS. In an ideal world,
382 this would work for any PCMCIA card, but it requires a complete
383 and accurate CIS. In practice, a driver usually "knows" most of
384 these things without consulting the CIS, and most client drivers
385 will only use the CIS to fill in implementation-defined details.
386 */
387 tuple.DesiredTuple = CISTPL_CFTABLE_ENTRY;
388 354
389 last_ret = pcmcia_get_first_tuple(link, &tuple); 355 if ((cfg->mem.nwin > 0) || (dflt->mem.nwin > 0)) {
390 if (last_ret) { 356 cistpl_mem_t *mem =
391 cs_error(link, GetFirstTuple, last_ret); 357 (cfg->mem.nwin) ? &cfg->mem : &dflt->mem;
392 goto cs_failed; 358 req->Attributes = WIN_DATA_WIDTH_16 | WIN_MEMORY_TYPE_CM;
359 req->Attributes |= WIN_ENABLE;
360 req->Base = mem->win[0].host_addr;
361 req->Size = mem->win[0].len;
362 if (req->Size < 0x1000)
363 req->Size = 0x1000;
364 req->AccessSpeed = 0;
365 if (pcmcia_request_window(p_dev, req, &p_dev->win))
366 return -ENODEV;
367 map.Page = 0;
368 map.CardOffset = mem->win[0].card_addr;
369 if (pcmcia_map_mem_page(p_dev, p_dev->win, &map))
370 return -ENODEV;
393 } 371 }
394 while (1) { 372 /* If we got this far, we're cool! */
395 cistpl_cftable_entry_t *cfg = &(parse.cftable_entry); 373 return 0;
396 if (pcmcia_get_tuple_data(link, &tuple) != 0) 374}
397 goto next_entry;
398 if (pcmcia_parse_tuple(&tuple, &parse) != 0)
399 goto next_entry;
400
401 if (cfg->flags & CISTPL_CFTABLE_DEFAULT)
402 dflt = *cfg;
403 if (cfg->index == 0)
404 goto next_entry;
405 link->conf.ConfigIndex = cfg->index;
406
407 /* Does this card need audio output? */
408 if (cfg->flags & CISTPL_CFTABLE_AUDIO) {
409 link->conf.Attributes |= CONF_ENABLE_SPKR;
410 link->conf.Status = CCSR_AUDIO_ENA;
411 }
412 375
413 /* Do we need to allocate an interrupt? */ 376static void dio24_config(struct pcmcia_device *link)
414 if (cfg->irq.IRQInfo1 || dflt.irq.IRQInfo1) 377{
415 link->conf.Attributes |= CONF_ENABLE_IRQ; 378 struct local_info_t *dev = link->priv;
416 379 int ret;
417 /* IO window settings */ 380 win_req_t req;
418 link->io.NumPorts1 = link->io.NumPorts2 = 0;
419 if ((cfg->io.nwin > 0) || (dflt.io.nwin > 0)) {
420 cistpl_io_t *io = (cfg->io.nwin) ? &cfg->io : &dflt.io;
421 link->io.Attributes1 = IO_DATA_PATH_WIDTH_AUTO;
422 if (!(io->flags & CISTPL_IO_8BIT))
423 link->io.Attributes1 = IO_DATA_PATH_WIDTH_16;
424 if (!(io->flags & CISTPL_IO_16BIT))
425 link->io.Attributes1 = IO_DATA_PATH_WIDTH_8;
426 link->io.IOAddrLines = io->flags & CISTPL_IO_LINES_MASK;
427 link->io.BasePort1 = io->win[0].base;
428 link->io.NumPorts1 = io->win[0].len;
429 if (io->nwin > 1) {
430 link->io.Attributes2 = link->io.Attributes1;
431 link->io.BasePort2 = io->win[1].base;
432 link->io.NumPorts2 = io->win[1].len;
433 }
434 /* This reserves IO space but doesn't actually enable it */
435 if (pcmcia_request_io(link, &link->io) != 0)
436 goto next_entry;
437 }
438 381
439 if ((cfg->mem.nwin > 0) || (dflt.mem.nwin > 0)) { 382 printk(KERN_INFO "ni_daq_dio24: HOLA SOY YO! - config\n");
440 cistpl_mem_t *mem =
441 (cfg->mem.nwin) ? &cfg->mem : &dflt.mem;
442 req.Attributes = WIN_DATA_WIDTH_16 | WIN_MEMORY_TYPE_CM;
443 req.Attributes |= WIN_ENABLE;
444 req.Base = mem->win[0].host_addr;
445 req.Size = mem->win[0].len;
446 if (req.Size < 0x1000)
447 req.Size = 0x1000;
448 req.AccessSpeed = 0;
449 if (pcmcia_request_window(&link, &req, &link->win))
450 goto next_entry;
451 map.Page = 0;
452 map.CardOffset = mem->win[0].card_addr;
453 if (pcmcia_map_mem_page(link->win, &map))
454 goto next_entry;
455 }
456 /* If we got this far, we're cool! */
457 break;
458 383
459next_entry: 384 dev_dbg(&link->dev, "dio24_config\n");
460 385
461 last_ret = pcmcia_get_next_tuple(link, &tuple); 386 ret = pcmcia_loop_config(link, dio24_pcmcia_config_loop, &req);
462 if (last_ret) { 387 if (ret) {
463 cs_error(link, GetNextTuple, last_ret); 388 dev_warn(&link->dev, "no configuration found\n");
464 goto cs_failed; 389 goto failed;
465 }
466 } 390 }
467 391
468 /* 392 /*
@@ -471,11 +395,9 @@ next_entry:
471 irq structure is initialized. 395 irq structure is initialized.
472 */ 396 */
473 if (link->conf.Attributes & CONF_ENABLE_IRQ) { 397 if (link->conf.Attributes & CONF_ENABLE_IRQ) {
474 last_ret = pcmcia_request_irq(link, &link->irq); 398 ret = pcmcia_request_irq(link, &link->irq);
475 if (last_ret) { 399 if (ret)
476 cs_error(link, RequestIRQ, last_ret); 400 goto failed;
477 goto cs_failed;
478 }
479 } 401 }
480 402
481 /* 403 /*
@@ -483,11 +405,9 @@ next_entry:
483 the I/O windows and the interrupt mapping, and putting the 405 the I/O windows and the interrupt mapping, and putting the
484 card and host interface into "Memory and IO" mode. 406 card and host interface into "Memory and IO" mode.
485 */ 407 */
486 last_ret = pcmcia_request_configuration(link, &link->conf); 408 ret = pcmcia_request_configuration(link, &link->conf);
487 if (last_ret) { 409 if (ret)
488 cs_error(link, RequestConfiguration, last_ret); 410 goto failed;
489 goto cs_failed;
490 }
491 411
492 /* 412 /*
493 At this point, the dev_node_t structure(s) need to be 413 At this point, the dev_node_t structure(s) need to be
@@ -515,7 +435,7 @@ next_entry:
515 435
516 return; 436 return;
517 437
518cs_failed: 438failed:
519 printk(KERN_INFO "Fallo"); 439 printk(KERN_INFO "Fallo");
520 dio24_release(link); 440 dio24_release(link);
521 441
@@ -523,7 +443,7 @@ cs_failed:
523 443
524static void dio24_release(struct pcmcia_device *link) 444static void dio24_release(struct pcmcia_device *link)
525{ 445{
526 DEBUG(0, "dio24_release(0x%p)\n", link); 446 dev_dbg(&link->dev, "dio24_release\n");
527 447
528 pcmcia_disable_device(link); 448 pcmcia_disable_device(link);
529} /* dio24_release */ 449} /* dio24_release */
@@ -582,14 +502,12 @@ struct pcmcia_driver dio24_cs_driver = {
582static int __init init_dio24_cs(void) 502static int __init init_dio24_cs(void)
583{ 503{
584 printk("ni_daq_dio24: HOLA SOY YO!\n"); 504 printk("ni_daq_dio24: HOLA SOY YO!\n");
585 DEBUG(0, "%s\n", version);
586 pcmcia_register_driver(&dio24_cs_driver); 505 pcmcia_register_driver(&dio24_cs_driver);
587 return 0; 506 return 0;
588} 507}
589 508
590static void __exit exit_dio24_cs(void) 509static void __exit exit_dio24_cs(void)
591{ 510{
592 DEBUG(0, "ni_dio24: unloading\n");
593 pcmcia_unregister_driver(&dio24_cs_driver); 511 pcmcia_unregister_driver(&dio24_cs_driver);
594} 512}
595 513
diff --git a/drivers/staging/comedi/drivers/ni_labpc_cs.c b/drivers/staging/comedi/drivers/ni_labpc_cs.c
index a3053b8da1c6..7d514b3ee754 100644
--- a/drivers/staging/comedi/drivers/ni_labpc_cs.c
+++ b/drivers/staging/comedi/drivers/ni_labpc_cs.c
@@ -153,23 +153,6 @@ static int labpc_attach(struct comedi_device *dev, struct comedi_devconfig *it)
153 return labpc_common_attach(dev, iobase, irq, 0); 153 return labpc_common_attach(dev, iobase, irq, 0);
154} 154}
155 155
156/*
157 All the PCMCIA modules use PCMCIA_DEBUG to control debugging. If
158 you do not define PCMCIA_DEBUG at all, all the debug code will be
159 left out. If you compile with PCMCIA_DEBUG=0, the debug code will
160 be present but disabled -- but it can then be enabled for specific
161 modules at load time with a 'pc_debug=#' option to insmod.
162*/
163#ifdef PCMCIA_DEBUG
164static int pc_debug = PCMCIA_DEBUG;
165module_param(pc_debug, int, 0644);
166#define DEBUG(n, args...) if (pc_debug>(n)) printk(KERN_DEBUG args)
167static const char *version =
168 "ni_labpc.c, based on dummy_cs.c 1.31 2001/08/24 12:13:13";
169#else
170#define DEBUG(n, args...)
171#endif
172
173/*====================================================================*/ 156/*====================================================================*/
174 157
175/* 158/*
@@ -236,7 +219,7 @@ static int labpc_cs_attach(struct pcmcia_device *link)
236{ 219{
237 struct local_info_t *local; 220 struct local_info_t *local;
238 221
239 DEBUG(0, "labpc_cs_attach()\n"); 222 dev_dbg(&link->dev, "labpc_cs_attach()\n");
240 223
241 /* Allocate space for private device-specific data */ 224 /* Allocate space for private device-specific data */
242 local = kzalloc(sizeof(struct local_info_t), GFP_KERNEL); 225 local = kzalloc(sizeof(struct local_info_t), GFP_KERNEL);
@@ -247,7 +230,6 @@ static int labpc_cs_attach(struct pcmcia_device *link)
247 230
248 /* Interrupt setup */ 231 /* Interrupt setup */
249 link->irq.Attributes = IRQ_TYPE_DYNAMIC_SHARING | IRQ_FORCED_PULSE; 232 link->irq.Attributes = IRQ_TYPE_DYNAMIC_SHARING | IRQ_FORCED_PULSE;
250 link->irq.IRQInfo1 = IRQ_INFO2_VALID | IRQ_PULSE_ID;
251 link->irq.Handler = NULL; 233 link->irq.Handler = NULL;
252 234
253 /* 235 /*
@@ -278,7 +260,7 @@ static int labpc_cs_attach(struct pcmcia_device *link)
278 260
279static void labpc_cs_detach(struct pcmcia_device *link) 261static void labpc_cs_detach(struct pcmcia_device *link)
280{ 262{
281 DEBUG(0, "labpc_cs_detach(0x%p)\n", link); 263 dev_dbg(&link->dev, "labpc_cs_detach\n");
282 264
283 /* 265 /*
284 If the device is currently configured and active, we won't 266 If the device is currently configured and active, we won't
@@ -305,135 +287,84 @@ static void labpc_cs_detach(struct pcmcia_device *link)
305 287
306======================================================================*/ 288======================================================================*/
307 289
308static void labpc_config(struct pcmcia_device *link) 290static int labpc_pcmcia_config_loop(struct pcmcia_device *p_dev,
291 cistpl_cftable_entry_t *cfg,
292 cistpl_cftable_entry_t *dflt,
293 unsigned int vcc,
294 void *priv_data)
309{ 295{
310 struct local_info_t *dev = link->priv; 296 win_req_t *req = priv_data;
311 tuple_t tuple;
312 cisparse_t parse;
313 int last_ret;
314 u_char buf[64];
315 win_req_t req;
316 memreq_t map; 297 memreq_t map;
317 cistpl_cftable_entry_t dflt = { 0 };
318 298
319 DEBUG(0, "labpc_config(0x%p)\n", link); 299 if (cfg->index == 0)
300 return -ENODEV;
320 301
321 /* 302 /* Does this card need audio output? */
322 This reads the card's CONFIG tuple to find its configuration 303 if (cfg->flags & CISTPL_CFTABLE_AUDIO) {
323 registers. 304 p_dev->conf.Attributes |= CONF_ENABLE_SPKR;
324 */ 305 p_dev->conf.Status = CCSR_AUDIO_ENA;
325 tuple.DesiredTuple = CISTPL_CONFIG;
326 tuple.Attributes = 0;
327 tuple.TupleData = buf;
328 tuple.TupleDataMax = sizeof(buf);
329 tuple.TupleOffset = 0;
330
331 last_ret = pcmcia_get_first_tuple(link, &tuple);
332 if (last_ret) {
333 cs_error(link, GetFirstTuple, last_ret);
334 goto cs_failed;
335 } 306 }
336 307
337 last_ret = pcmcia_get_tuple_data(link, &tuple); 308 /* Do we need to allocate an interrupt? */
338 if (last_ret) { 309 if (cfg->irq.IRQInfo1 || dflt->irq.IRQInfo1)
339 cs_error(link, GetTupleData, last_ret); 310 p_dev->conf.Attributes |= CONF_ENABLE_IRQ;
340 goto cs_failed; 311
312 /* IO window settings */
313 p_dev->io.NumPorts1 = p_dev->io.NumPorts2 = 0;
314 if ((cfg->io.nwin > 0) || (dflt->io.nwin > 0)) {
315 cistpl_io_t *io = (cfg->io.nwin) ? &cfg->io : &dflt->io;
316 p_dev->io.Attributes1 = IO_DATA_PATH_WIDTH_AUTO;
317 if (!(io->flags & CISTPL_IO_8BIT))
318 p_dev->io.Attributes1 = IO_DATA_PATH_WIDTH_16;
319 if (!(io->flags & CISTPL_IO_16BIT))
320 p_dev->io.Attributes1 = IO_DATA_PATH_WIDTH_8;
321 p_dev->io.IOAddrLines = io->flags & CISTPL_IO_LINES_MASK;
322 p_dev->io.BasePort1 = io->win[0].base;
323 p_dev->io.NumPorts1 = io->win[0].len;
324 if (io->nwin > 1) {
325 p_dev->io.Attributes2 = p_dev->io.Attributes1;
326 p_dev->io.BasePort2 = io->win[1].base;
327 p_dev->io.NumPorts2 = io->win[1].len;
328 }
329 /* This reserves IO space but doesn't actually enable it */
330 if (pcmcia_request_io(p_dev, &p_dev->io) != 0)
331 return -ENODEV;
341 } 332 }
342 333
343 last_ret = pcmcia_parse_tuple(&tuple, &parse); 334 if ((cfg->mem.nwin > 0) || (dflt->mem.nwin > 0)) {
344 if (last_ret) { 335 cistpl_mem_t *mem =
345 cs_error(link, ParseTuple, last_ret); 336 (cfg->mem.nwin) ? &cfg->mem : &dflt->mem;
346 goto cs_failed; 337 req->Attributes = WIN_DATA_WIDTH_16 | WIN_MEMORY_TYPE_CM;
338 req->Attributes |= WIN_ENABLE;
339 req->Base = mem->win[0].host_addr;
340 req->Size = mem->win[0].len;
341 if (req->Size < 0x1000)
342 req->Size = 0x1000;
343 req->AccessSpeed = 0;
344 if (pcmcia_request_window(p_dev, req, &p_dev->win))
345 return -ENODEV;
346 map.Page = 0;
347 map.CardOffset = mem->win[0].card_addr;
348 if (pcmcia_map_mem_page(p_dev, p_dev->win, &map))
349 return -ENODEV;
347 } 350 }
348 link->conf.ConfigBase = parse.config.base; 351 /* If we got this far, we're cool! */
349 link->conf.Present = parse.config.rmask[0]; 352 return 0;
353}
350 354
351 /*
352 In this loop, we scan the CIS for configuration table entries,
353 each of which describes a valid card configuration, including
354 voltage, IO window, memory window, and interrupt settings.
355
356 We make no assumptions about the card to be configured: we use
357 just the information available in the CIS. In an ideal world,
358 this would work for any PCMCIA card, but it requires a complete
359 and accurate CIS. In practice, a driver usually "knows" most of
360 these things without consulting the CIS, and most client drivers
361 will only use the CIS to fill in implementation-defined details.
362 */
363 tuple.DesiredTuple = CISTPL_CFTABLE_ENTRY;
364 last_ret = pcmcia_get_first_tuple(link, &tuple);
365 if (last_ret) {
366 cs_error(link, GetFirstTuple, last_ret);
367 goto cs_failed;
368 }
369 while (1) {
370 cistpl_cftable_entry_t *cfg = &(parse.cftable_entry);
371 if (pcmcia_get_tuple_data(link, &tuple))
372 goto next_entry;
373 if (pcmcia_parse_tuple(&tuple, &parse))
374 goto next_entry;
375
376 if (cfg->flags & CISTPL_CFTABLE_DEFAULT)
377 dflt = *cfg;
378 if (cfg->index == 0)
379 goto next_entry;
380 link->conf.ConfigIndex = cfg->index;
381
382 /* Does this card need audio output? */
383 if (cfg->flags & CISTPL_CFTABLE_AUDIO) {
384 link->conf.Attributes |= CONF_ENABLE_SPKR;
385 link->conf.Status = CCSR_AUDIO_ENA;
386 }
387 355
388 /* Do we need to allocate an interrupt? */ 356static void labpc_config(struct pcmcia_device *link)
389 if (cfg->irq.IRQInfo1 || dflt.irq.IRQInfo1) 357{
390 link->conf.Attributes |= CONF_ENABLE_IRQ; 358 struct local_info_t *dev = link->priv;
391 359 int ret;
392 /* IO window settings */ 360 win_req_t req;
393 link->io.NumPorts1 = link->io.NumPorts2 = 0;
394 if ((cfg->io.nwin > 0) || (dflt.io.nwin > 0)) {
395 cistpl_io_t *io = (cfg->io.nwin) ? &cfg->io : &dflt.io;
396 link->io.Attributes1 = IO_DATA_PATH_WIDTH_8;
397 link->io.IOAddrLines = io->flags & CISTPL_IO_LINES_MASK;
398 link->io.BasePort1 = io->win[0].base;
399 link->io.NumPorts1 = io->win[0].len;
400 if (io->nwin > 1) {
401 link->io.Attributes2 = link->io.Attributes1;
402 link->io.BasePort2 = io->win[1].base;
403 link->io.NumPorts2 = io->win[1].len;
404 }
405 /* This reserves IO space but doesn't actually enable it */
406 if (pcmcia_request_io(link, &link->io))
407 goto next_entry;
408 }
409 361
410 if ((cfg->mem.nwin > 0) || (dflt.mem.nwin > 0)) { 362 dev_dbg(&link->dev, "labpc_config\n");
411 cistpl_mem_t *mem =
412 (cfg->mem.nwin) ? &cfg->mem : &dflt.mem;
413 req.Attributes = WIN_DATA_WIDTH_16 | WIN_MEMORY_TYPE_CM;
414 req.Attributes |= WIN_ENABLE;
415 req.Base = mem->win[0].host_addr;
416 req.Size = mem->win[0].len;
417 if (req.Size < 0x1000)
418 req.Size = 0x1000;
419 req.AccessSpeed = 0;
420 link->win = (window_handle_t) link;
421 if (pcmcia_request_window(&link, &req, &link->win))
422 goto next_entry;
423 map.Page = 0;
424 map.CardOffset = mem->win[0].card_addr;
425 if (pcmcia_map_mem_page(link->win, &map))
426 goto next_entry;
427 }
428 /* If we got this far, we're cool! */
429 break;
430 363
431next_entry: 364 ret = pcmcia_loop_config(link, labpc_pcmcia_config_loop, &req);
432 last_ret = pcmcia_get_next_tuple(link, &tuple); 365 if (ret) {
433 if (last_ret) { 366 dev_warn(&link->dev, "no configuration found\n");
434 cs_error(link, GetNextTuple, last_ret); 367 goto failed;
435 goto cs_failed;
436 }
437 } 368 }
438 369
439 /* 370 /*
@@ -442,11 +373,9 @@ next_entry:
442 irq structure is initialized. 373 irq structure is initialized.
443 */ 374 */
444 if (link->conf.Attributes & CONF_ENABLE_IRQ) { 375 if (link->conf.Attributes & CONF_ENABLE_IRQ) {
445 last_ret = pcmcia_request_irq(link, &link->irq); 376 ret = pcmcia_request_irq(link, &link->irq);
446 if (last_ret) { 377 if (ret)
447 cs_error(link, RequestIRQ, last_ret); 378 goto failed;
448 goto cs_failed;
449 }
450 } 379 }
451 380
452 /* 381 /*
@@ -454,11 +383,9 @@ next_entry:
454 the I/O windows and the interrupt mapping, and putting the 383 the I/O windows and the interrupt mapping, and putting the
455 card and host interface into "Memory and IO" mode. 384 card and host interface into "Memory and IO" mode.
456 */ 385 */
457 last_ret = pcmcia_request_configuration(link, &link->conf); 386 ret = pcmcia_request_configuration(link, &link->conf);
458 if (last_ret) { 387 if (ret)
459 cs_error(link, RequestConfiguration, last_ret); 388 goto failed;
460 goto cs_failed;
461 }
462 389
463 /* 390 /*
464 At this point, the dev_node_t structure(s) need to be 391 At this point, the dev_node_t structure(s) need to be
@@ -486,14 +413,14 @@ next_entry:
486 413
487 return; 414 return;
488 415
489cs_failed: 416failed:
490 labpc_release(link); 417 labpc_release(link);
491 418
492} /* labpc_config */ 419} /* labpc_config */
493 420
494static void labpc_release(struct pcmcia_device *link) 421static void labpc_release(struct pcmcia_device *link)
495{ 422{
496 DEBUG(0, "labpc_release(0x%p)\n", link); 423 dev_dbg(&link->dev, "labpc_release\n");
497 424
498 pcmcia_disable_device(link); 425 pcmcia_disable_device(link);
499} /* labpc_release */ 426} /* labpc_release */
@@ -551,14 +478,12 @@ struct pcmcia_driver labpc_cs_driver = {
551 478
552static int __init init_labpc_cs(void) 479static int __init init_labpc_cs(void)
553{ 480{
554 DEBUG(0, "%s\n", version);
555 pcmcia_register_driver(&labpc_cs_driver); 481 pcmcia_register_driver(&labpc_cs_driver);
556 return 0; 482 return 0;
557} 483}
558 484
559static void __exit exit_labpc_cs(void) 485static void __exit exit_labpc_cs(void)
560{ 486{
561 DEBUG(0, "ni_labpc: unloading\n");
562 pcmcia_unregister_driver(&labpc_cs_driver); 487 pcmcia_unregister_driver(&labpc_cs_driver);
563} 488}
564 489
diff --git a/drivers/staging/comedi/drivers/ni_mio_cs.c b/drivers/staging/comedi/drivers/ni_mio_cs.c
index 9aef87fc81dc..d692f4bb47ea 100644
--- a/drivers/staging/comedi/drivers/ni_mio_cs.c
+++ b/drivers/staging/comedi/drivers/ni_mio_cs.c
@@ -274,7 +274,6 @@ static int cs_attach(struct pcmcia_device *link)
274 link->io.Attributes1 = IO_DATA_PATH_WIDTH_16; 274 link->io.Attributes1 = IO_DATA_PATH_WIDTH_16;
275 link->io.NumPorts1 = 16; 275 link->io.NumPorts1 = 16;
276 link->irq.Attributes = IRQ_TYPE_DYNAMIC_SHARING; 276 link->irq.Attributes = IRQ_TYPE_DYNAMIC_SHARING;
277 link->irq.IRQInfo1 = IRQ_LEVEL_ID;
278 link->conf.Attributes = CONF_ENABLE_IRQ; 277 link->conf.Attributes = CONF_ENABLE_IRQ;
279 link->conf.IntType = INT_MEMORY_AND_IO; 278 link->conf.IntType = INT_MEMORY_AND_IO;
280 279
@@ -312,96 +311,47 @@ static int mio_cs_resume(struct pcmcia_device *link)
312 return 0; 311 return 0;
313} 312}
314 313
315static void mio_cs_config(struct pcmcia_device *link)
316{
317 tuple_t tuple;
318 u_short buf[128];
319 cisparse_t parse;
320 int manfid = 0, prodid = 0;
321 int ret;
322
323 DPRINTK("mio_cs_config(link=%p)\n", link);
324 314
325 tuple.TupleData = (cisdata_t *) buf; 315static int mio_pcmcia_config_loop(struct pcmcia_device *p_dev,
326 tuple.TupleOffset = 0; 316 cistpl_cftable_entry_t *cfg,
327 tuple.TupleDataMax = 255; 317 cistpl_cftable_entry_t *dflt,
328 tuple.Attributes = 0; 318 unsigned int vcc,
319 void *priv_data)
320{
321 int base, ret;
329 322
330 tuple.DesiredTuple = CISTPL_CONFIG; 323 p_dev->io.NumPorts1 = cfg->io.win[0].len;
331 ret = pcmcia_get_first_tuple(link, &tuple); 324 p_dev->io.IOAddrLines = cfg->io.flags & CISTPL_IO_LINES_MASK;
332 ret = pcmcia_get_tuple_data(link, &tuple); 325 p_dev->io.NumPorts2 = 0;
333 ret = pcmcia_parse_tuple(&tuple, &parse);
334 link->conf.ConfigBase = parse.config.base;
335 link->conf.Present = parse.config.rmask[0];
336 326
337#if 0 327 for (base = 0x000; base < 0x400; base += 0x20) {
338 tuple.DesiredTuple = CISTPL_LONGLINK_MFC; 328 p_dev->io.BasePort1 = base;
339 tuple.Attributes = TUPLE_RETURN_COMMON | TUPLE_RETURN_LINK; 329 ret = pcmcia_request_io(p_dev, &p_dev->io);
340 info->multi(first_tuple(link, &tuple, &parse) == 0); 330 if (!ret)
341#endif 331 return 0;
342
343 tuple.DesiredTuple = CISTPL_MANFID;
344 tuple.Attributes = TUPLE_RETURN_COMMON;
345 if ((pcmcia_get_first_tuple(link, &tuple) == 0) &&
346 (pcmcia_get_tuple_data(link, &tuple) == 0)) {
347 manfid = le16_to_cpu(buf[0]);
348 prodid = le16_to_cpu(buf[1]);
349 } 332 }
350 /* printk("manfid = 0x%04x, 0x%04x\n",manfid,prodid); */ 333 return -ENODEV;
334}
351 335
352 tuple.DesiredTuple = CISTPL_CFTABLE_ENTRY;
353 tuple.Attributes = 0;
354 ret = pcmcia_get_first_tuple(link, &tuple);
355 ret = pcmcia_get_tuple_data(link, &tuple);
356 ret = pcmcia_parse_tuple(&tuple, &parse);
357 336
358#if 0 337static void mio_cs_config(struct pcmcia_device *link)
359 printk(" index: 0x%x\n", parse.cftable_entry.index); 338{
360 printk(" flags: 0x%x\n", parse.cftable_entry.flags); 339 int ret;
361 printk(" io flags: 0x%x\n", parse.cftable_entry.io.flags);
362 printk(" io nwin: 0x%x\n", parse.cftable_entry.io.nwin);
363 printk(" io base: 0x%x\n", parse.cftable_entry.io.win[0].base);
364 printk(" io len: 0x%x\n", parse.cftable_entry.io.win[0].len);
365 printk(" irq1: 0x%x\n", parse.cftable_entry.irq.IRQInfo1);
366 printk(" irq2: 0x%x\n", parse.cftable_entry.irq.IRQInfo2);
367 printk(" mem flags: 0x%x\n", parse.cftable_entry.mem.flags);
368 printk(" mem nwin: 0x%x\n", parse.cftable_entry.mem.nwin);
369 printk(" subtuples: 0x%x\n", parse.cftable_entry.subtuples);
370#endif
371 340
372#if 0 341 DPRINTK("mio_cs_config(link=%p)\n", link);
373 link->io.NumPorts1 = 0x20;
374 link->io.IOAddrLines = 5;
375 link->io.Attributes1 = IO_DATA_PATH_WIDTH_AUTO;
376#endif
377 link->io.NumPorts1 = parse.cftable_entry.io.win[0].len;
378 link->io.IOAddrLines =
379 parse.cftable_entry.io.flags & CISTPL_IO_LINES_MASK;
380 link->io.NumPorts2 = 0;
381 342
382 { 343 ret = pcmcia_loop_config(link, mio_pcmcia_config_loop, NULL);
383 int base; 344 if (ret) {
384 for (base = 0x000; base < 0x400; base += 0x20) { 345 dev_warn(&link->dev, "no configuration found\n");
385 link->io.BasePort1 = base; 346 return;
386 ret = pcmcia_request_io(link, &link->io);
387 /* printk("RequestIO 0x%02x\n",ret); */
388 if (!ret)
389 break;
390 }
391 } 347 }
392 348
393 link->irq.IRQInfo1 = parse.cftable_entry.irq.IRQInfo1;
394 link->irq.IRQInfo2 = parse.cftable_entry.irq.IRQInfo2;
395 ret = pcmcia_request_irq(link, &link->irq); 349 ret = pcmcia_request_irq(link, &link->irq);
396 if (ret) { 350 if (ret) {
397 printk("pcmcia_request_irq() returned error: %i\n", ret); 351 printk("pcmcia_request_irq() returned error: %i\n", ret);
398 } 352 }
399 /* printk("RequestIRQ 0x%02x\n",ret); */
400
401 link->conf.ConfigIndex = 1;
402 353
403 ret = pcmcia_request_configuration(link, &link->conf); 354 ret = pcmcia_request_configuration(link, &link->conf);
404 /* printk("RequestConfiguration %d\n",ret); */
405 355
406 link->dev_node = &dev_node; 356 link->dev_node = &dev_node;
407} 357}
@@ -475,40 +425,17 @@ static int mio_cs_attach(struct comedi_device *dev, struct comedi_devconfig *it)
475 return 0; 425 return 0;
476} 426}
477 427
478static int get_prodid(struct comedi_device *dev, struct pcmcia_device *link)
479{
480 tuple_t tuple;
481 u_short buf[128];
482 int prodid = 0;
483
484 tuple.TupleData = (cisdata_t *) buf;
485 tuple.TupleOffset = 0;
486 tuple.TupleDataMax = 255;
487 tuple.DesiredTuple = CISTPL_MANFID;
488 tuple.Attributes = TUPLE_RETURN_COMMON;
489 if ((pcmcia_get_first_tuple(link, &tuple) == 0) &&
490 (pcmcia_get_tuple_data(link, &tuple) == 0)) {
491 prodid = le16_to_cpu(buf[1]);
492 }
493
494 return prodid;
495}
496
497static int ni_getboardtype(struct comedi_device *dev, 428static int ni_getboardtype(struct comedi_device *dev,
498 struct pcmcia_device *link) 429 struct pcmcia_device *link)
499{ 430{
500 int id;
501 int i; 431 int i;
502 432
503 id = get_prodid(dev, link);
504
505 for (i = 0; i < n_ni_boards; i++) { 433 for (i = 0; i < n_ni_boards; i++) {
506 if (ni_boards[i].device_id == id) { 434 if (ni_boards[i].device_id == link->card_id)
507 return i; 435 return i;
508 }
509 } 436 }
510 437
511 printk("unknown board 0x%04x -- pretend it is a ", id); 438 printk("unknown board 0x%04x -- pretend it is a ", link->card_id);
512 439
513 return 0; 440 return 0;
514} 441}
diff --git a/drivers/staging/comedi/drivers/quatech_daqp_cs.c b/drivers/staging/comedi/drivers/quatech_daqp_cs.c
index 344b82353e08..5256fd933162 100644
--- a/drivers/staging/comedi/drivers/quatech_daqp_cs.c
+++ b/drivers/staging/comedi/drivers/quatech_daqp_cs.c
@@ -55,23 +55,6 @@ Devices: [Quatech] DAQP-208 (daqp), DAQP-308
55#include <pcmcia/cisreg.h> 55#include <pcmcia/cisreg.h>
56#include <pcmcia/ds.h> 56#include <pcmcia/ds.h>
57 57
58/*
59 All the PCMCIA modules use PCMCIA_DEBUG to control debugging. If
60 you do not define PCMCIA_DEBUG at all, all the debug code will be
61 left out. If you compile with PCMCIA_DEBUG=0, the debug code will
62 be present but disabled -- but it can then be enabled for specific
63 modules at load time with a 'pc_debug=#' option to insmod.
64*/
65
66#ifdef PCMCIA_DEBUG
67static int pc_debug = PCMCIA_DEBUG;
68module_param(pc_debug, int, 0644);
69#define DEBUG(n, args...) if (pc_debug>(n)) printk(KERN_DEBUG args)
70static char *version = "quatech_daqp_cs.c 1.10 2003/04/21 (Brent Baccala)";
71#else
72#define DEBUG(n, args...)
73#endif
74
75/* Maximum number of separate DAQP devices we'll allow */ 58/* Maximum number of separate DAQP devices we'll allow */
76#define MAX_DEV 4 59#define MAX_DEV 4
77 60
@@ -863,8 +846,6 @@ static int daqp_attach(struct comedi_device *dev, struct comedi_devconfig *it)
863{ 846{
864 int ret; 847 int ret;
865 struct local_info_t *local = dev_table[it->options[0]]; 848 struct local_info_t *local = dev_table[it->options[0]];
866 tuple_t tuple;
867 int i;
868 struct comedi_subdevice *s; 849 struct comedi_subdevice *s;
869 850
870 if (it->options[0] < 0 || it->options[0] >= MAX_DEV || !local) { 851 if (it->options[0] < 0 || it->options[0] >= MAX_DEV || !local) {
@@ -883,29 +864,10 @@ static int daqp_attach(struct comedi_device *dev, struct comedi_devconfig *it)
883 864
884 strcpy(local->board_name, "DAQP"); 865 strcpy(local->board_name, "DAQP");
885 dev->board_name = local->board_name; 866 dev->board_name = local->board_name;
886 867 if (local->link->prod_id[2]) {
887 tuple.DesiredTuple = CISTPL_VERS_1; 868 if (strncmp(local->link->prod_id[2], "DAQP", 4) == 0) {
888 if (pcmcia_get_first_tuple(local->link, &tuple) == 0) { 869 strncpy(local->board_name, local->link->prod_id[2],
889 u_char buf[128]; 870 sizeof(local->board_name));
890
891 buf[0] = buf[sizeof(buf) - 1] = 0;
892 tuple.TupleData = buf;
893 tuple.TupleDataMax = sizeof(buf);
894 tuple.TupleOffset = 2;
895 if (pcmcia_get_tuple_data(local->link, &tuple) == 0) {
896
897 for (i = 0; i < tuple.TupleDataLen - 4; i++)
898 if (buf[i] == 0)
899 break;
900 for (i++; i < tuple.TupleDataLen - 4; i++)
901 if (buf[i] == 0)
902 break;
903 i++;
904 if ((i < tuple.TupleDataLen - 4)
905 && (strncmp(buf + i, "DAQP", 4) == 0)) {
906 strncpy(local->board_name, buf + i,
907 sizeof(local->board_name));
908 }
909 } 871 }
910 } 872 }
911 873
@@ -1058,7 +1020,7 @@ static int daqp_cs_attach(struct pcmcia_device *link)
1058 struct local_info_t *local; 1020 struct local_info_t *local;
1059 int i; 1021 int i;
1060 1022
1061 DEBUG(0, "daqp_cs_attach()\n"); 1023 dev_dbg(&link->dev, "daqp_cs_attach()\n");
1062 1024
1063 for (i = 0; i < MAX_DEV; i++) 1025 for (i = 0; i < MAX_DEV; i++)
1064 if (dev_table[i] == NULL) 1026 if (dev_table[i] == NULL)
@@ -1079,10 +1041,8 @@ static int daqp_cs_attach(struct pcmcia_device *link)
1079 link->priv = local; 1041 link->priv = local;
1080 1042
1081 /* Interrupt setup */ 1043 /* Interrupt setup */
1082 link->irq.Attributes = IRQ_TYPE_DYNAMIC_SHARING | IRQ_HANDLE_PRESENT; 1044 link->irq.Attributes = IRQ_TYPE_DYNAMIC_SHARING;
1083 link->irq.IRQInfo1 = IRQ_LEVEL_ID;
1084 link->irq.Handler = daqp_interrupt; 1045 link->irq.Handler = daqp_interrupt;
1085 link->irq.Instance = local;
1086 1046
1087 /* 1047 /*
1088 General socket configuration defaults can go here. In this 1048 General socket configuration defaults can go here. In this
@@ -1112,7 +1072,7 @@ static void daqp_cs_detach(struct pcmcia_device *link)
1112{ 1072{
1113 struct local_info_t *dev = link->priv; 1073 struct local_info_t *dev = link->priv;
1114 1074
1115 DEBUG(0, "daqp_cs_detach(0x%p)\n", link); 1075 dev_dbg(&link->dev, "daqp_cs_detach\n");
1116 1076
1117 if (link->dev_node) { 1077 if (link->dev_node) {
1118 dev->stop = 1; 1078 dev->stop = 1;
@@ -1134,115 +1094,54 @@ static void daqp_cs_detach(struct pcmcia_device *link)
1134 1094
1135======================================================================*/ 1095======================================================================*/
1136 1096
1137static void daqp_cs_config(struct pcmcia_device *link)
1138{
1139 struct local_info_t *dev = link->priv;
1140 tuple_t tuple;
1141 cisparse_t parse;
1142 int last_ret;
1143 u_char buf[64];
1144
1145 DEBUG(0, "daqp_cs_config(0x%p)\n", link);
1146
1147 /*
1148 This reads the card's CONFIG tuple to find its configuration
1149 registers.
1150 */
1151 tuple.DesiredTuple = CISTPL_CONFIG;
1152 tuple.Attributes = 0;
1153 tuple.TupleData = buf;
1154 tuple.TupleDataMax = sizeof(buf);
1155 tuple.TupleOffset = 0;
1156
1157 last_ret = pcmcia_get_first_tuple(link, &tuple);
1158 if (last_ret) {
1159 cs_error(link, GetFirstTuple, last_ret);
1160 goto cs_failed;
1161 }
1162 1097
1163 last_ret = pcmcia_get_tuple_data(link, &tuple); 1098static int daqp_pcmcia_config_loop(struct pcmcia_device *p_dev,
1164 if (last_ret) { 1099 cistpl_cftable_entry_t *cfg,
1165 cs_error(link, GetTupleData, last_ret); 1100 cistpl_cftable_entry_t *dflt,
1166 goto cs_failed; 1101 unsigned int vcc,
1167 } 1102 void *priv_data)
1168 1103{
1169 last_ret = pcmcia_parse_tuple(&tuple, &parse); 1104 if (cfg->index == 0)
1170 if (last_ret) { 1105 return -ENODEV;
1171 cs_error(link, ParseTuple, last_ret);
1172 goto cs_failed;
1173 }
1174 link->conf.ConfigBase = parse.config.base;
1175 link->conf.Present = parse.config.rmask[0];
1176 1106
1177 /* 1107 /* Do we need to allocate an interrupt? */
1178 In this loop, we scan the CIS for configuration table entries, 1108 if (cfg->irq.IRQInfo1 || dflt->irq.IRQInfo1)
1179 each of which describes a valid card configuration, including 1109 p_dev->conf.Attributes |= CONF_ENABLE_IRQ;
1180 voltage, IO window, memory window, and interrupt settings. 1110
1181 1111 /* IO window settings */
1182 We make no assumptions about the card to be configured: we use 1112 p_dev->io.NumPorts1 = p_dev->io.NumPorts2 = 0;
1183 just the information available in the CIS. In an ideal world, 1113 if ((cfg->io.nwin > 0) || (dflt->io.nwin > 0)) {
1184 this would work for any PCMCIA card, but it requires a complete 1114 cistpl_io_t *io = (cfg->io.nwin) ? &cfg->io : &dflt->io;
1185 and accurate CIS. In practice, a driver usually "knows" most of 1115 p_dev->io.Attributes1 = IO_DATA_PATH_WIDTH_AUTO;
1186 these things without consulting the CIS, and most client drivers 1116 if (!(io->flags & CISTPL_IO_8BIT))
1187 will only use the CIS to fill in implementation-defined details. 1117 p_dev->io.Attributes1 = IO_DATA_PATH_WIDTH_16;
1188 */ 1118 if (!(io->flags & CISTPL_IO_16BIT))
1189 tuple.DesiredTuple = CISTPL_CFTABLE_ENTRY; 1119 p_dev->io.Attributes1 = IO_DATA_PATH_WIDTH_8;
1190 last_ret = pcmcia_get_first_tuple(link, &tuple); 1120 p_dev->io.IOAddrLines = io->flags & CISTPL_IO_LINES_MASK;
1191 if (last_ret) { 1121 p_dev->io.BasePort1 = io->win[0].base;
1192 cs_error(link, GetFirstTuple, last_ret); 1122 p_dev->io.NumPorts1 = io->win[0].len;
1193 goto cs_failed; 1123 if (io->nwin > 1) {
1124 p_dev->io.Attributes2 = p_dev->io.Attributes1;
1125 p_dev->io.BasePort2 = io->win[1].base;
1126 p_dev->io.NumPorts2 = io->win[1].len;
1127 }
1194 } 1128 }
1195 1129
1196 while (1) { 1130 /* This reserves IO space but doesn't actually enable it */
1197 cistpl_cftable_entry_t dflt = { 0 }; 1131 return pcmcia_request_io(p_dev, &p_dev->io);
1198 cistpl_cftable_entry_t *cfg = &(parse.cftable_entry); 1132}
1199 if (pcmcia_get_tuple_data(link, &tuple))
1200 goto next_entry;
1201 if (pcmcia_parse_tuple(&tuple, &parse))
1202 goto next_entry;
1203
1204 if (cfg->flags & CISTPL_CFTABLE_DEFAULT)
1205 dflt = *cfg;
1206 if (cfg->index == 0)
1207 goto next_entry;
1208 link->conf.ConfigIndex = cfg->index;
1209
1210 /* Do we need to allocate an interrupt? */
1211 if (cfg->irq.IRQInfo1 || dflt.irq.IRQInfo1)
1212 link->conf.Attributes |= CONF_ENABLE_IRQ;
1213
1214 /* IO window settings */
1215 link->io.NumPorts1 = link->io.NumPorts2 = 0;
1216 if ((cfg->io.nwin > 0) || (dflt.io.nwin > 0)) {
1217 cistpl_io_t *io = (cfg->io.nwin) ? &cfg->io : &dflt.io;
1218 link->io.Attributes1 = IO_DATA_PATH_WIDTH_AUTO;
1219 if (!(io->flags & CISTPL_IO_8BIT))
1220 link->io.Attributes1 = IO_DATA_PATH_WIDTH_16;
1221 if (!(io->flags & CISTPL_IO_16BIT))
1222 link->io.Attributes1 = IO_DATA_PATH_WIDTH_8;
1223 link->io.IOAddrLines = io->flags & CISTPL_IO_LINES_MASK;
1224 link->io.BasePort1 = io->win[0].base;
1225 link->io.NumPorts1 = io->win[0].len;
1226 if (io->nwin > 1) {
1227 link->io.Attributes2 = link->io.Attributes1;
1228 link->io.BasePort2 = io->win[1].base;
1229 link->io.NumPorts2 = io->win[1].len;
1230 }
1231 }
1232 1133
1233 /* This reserves IO space but doesn't actually enable it */ 1134static void daqp_cs_config(struct pcmcia_device *link)
1234 if (pcmcia_request_io(link, &link->io)) 1135{
1235 goto next_entry; 1136 struct local_info_t *dev = link->priv;
1137 int ret;
1236 1138
1237 /* If we got this far, we're cool! */ 1139 dev_dbg(&link->dev, "daqp_cs_config\n");
1238 break;
1239 1140
1240next_entry: 1141 ret = pcmcia_loop_config(link, daqp_pcmcia_config_loop, NULL);
1241 last_ret = pcmcia_get_next_tuple(link, &tuple); 1142 if (ret) {
1242 if (last_ret) { 1143 dev_warn(&link->dev, "no configuration found\n");
1243 cs_error(link, GetNextTuple, last_ret); 1144 goto failed;
1244 goto cs_failed;
1245 }
1246 } 1145 }
1247 1146
1248 /* 1147 /*
@@ -1251,11 +1150,9 @@ next_entry:
1251 irq structure is initialized. 1150 irq structure is initialized.
1252 */ 1151 */
1253 if (link->conf.Attributes & CONF_ENABLE_IRQ) { 1152 if (link->conf.Attributes & CONF_ENABLE_IRQ) {
1254 last_ret = pcmcia_request_irq(link, &link->irq); 1153 ret = pcmcia_request_irq(link, &link->irq);
1255 if (last_ret) { 1154 if (ret)
1256 cs_error(link, RequestIRQ, last_ret); 1155 goto failed;
1257 goto cs_failed;
1258 }
1259 } 1156 }
1260 1157
1261 /* 1158 /*
@@ -1263,11 +1160,9 @@ next_entry:
1263 the I/O windows and the interrupt mapping, and putting the 1160 the I/O windows and the interrupt mapping, and putting the
1264 card and host interface into "Memory and IO" mode. 1161 card and host interface into "Memory and IO" mode.
1265 */ 1162 */
1266 last_ret = pcmcia_request_configuration(link, &link->conf); 1163 ret = pcmcia_request_configuration(link, &link->conf);
1267 if (last_ret) { 1164 if (ret)
1268 cs_error(link, RequestConfiguration, last_ret); 1165 goto failed;
1269 goto cs_failed;
1270 }
1271 1166
1272 /* 1167 /*
1273 At this point, the dev_node_t structure(s) need to be 1168 At this point, the dev_node_t structure(s) need to be
@@ -1296,14 +1191,14 @@ next_entry:
1296 1191
1297 return; 1192 return;
1298 1193
1299cs_failed: 1194failed:
1300 daqp_cs_release(link); 1195 daqp_cs_release(link);
1301 1196
1302} /* daqp_cs_config */ 1197} /* daqp_cs_config */
1303 1198
1304static void daqp_cs_release(struct pcmcia_device *link) 1199static void daqp_cs_release(struct pcmcia_device *link)
1305{ 1200{
1306 DEBUG(0, "daqp_cs_release(0x%p)\n", link); 1201 dev_dbg(&link->dev, "daqp_cs_release\n");
1307 1202
1308 pcmcia_disable_device(link); 1203 pcmcia_disable_device(link);
1309} /* daqp_cs_release */ 1204} /* daqp_cs_release */
@@ -1363,7 +1258,6 @@ struct pcmcia_driver daqp_cs_driver = {
1363 1258
1364int __init init_module(void) 1259int __init init_module(void)
1365{ 1260{
1366 DEBUG(0, "%s\n", version);
1367 pcmcia_register_driver(&daqp_cs_driver); 1261 pcmcia_register_driver(&daqp_cs_driver);
1368 comedi_driver_register(&driver_daqp); 1262 comedi_driver_register(&driver_daqp);
1369 return 0; 1263 return 0;
@@ -1371,7 +1265,6 @@ int __init init_module(void)
1371 1265
1372void __exit cleanup_module(void) 1266void __exit cleanup_module(void)
1373{ 1267{
1374 DEBUG(0, "daqp_cs: unloading\n");
1375 comedi_driver_unregister(&driver_daqp); 1268 comedi_driver_unregister(&driver_daqp);
1376 pcmcia_unregister_driver(&daqp_cs_driver); 1269 pcmcia_unregister_driver(&daqp_cs_driver);
1377} 1270}
diff --git a/drivers/staging/go7007/s2250-board.c b/drivers/staging/go7007/s2250-board.c
index 8c85a9c3665a..f4a6541c3e60 100644
--- a/drivers/staging/go7007/s2250-board.c
+++ b/drivers/staging/go7007/s2250-board.c
@@ -261,7 +261,7 @@ static int read_reg_fp(struct i2c_client *client, u16 addr, u16 *val)
261 261
262 memset(buf, 0xcd, 6); 262 memset(buf, 0xcd, 6);
263 usb = go->hpi_context; 263 usb = go->hpi_context;
264 if (down_interruptible(&usb->i2c_lock) != 0) { 264 if (mutex_lock_interruptible(&usb->i2c_lock) != 0) {
265 printk(KERN_INFO "i2c lock failed\n"); 265 printk(KERN_INFO "i2c lock failed\n");
266 kfree(buf); 266 kfree(buf);
267 return -EINTR; 267 return -EINTR;
@@ -270,7 +270,7 @@ static int read_reg_fp(struct i2c_client *client, u16 addr, u16 *val)
270 kfree(buf); 270 kfree(buf);
271 return -EFAULT; 271 return -EFAULT;
272 } 272 }
273 up(&usb->i2c_lock); 273 mutex_unlock(&usb->i2c_lock);
274 274
275 *val = (buf[0] << 8) | buf[1]; 275 *val = (buf[0] << 8) | buf[1];
276 kfree(buf); 276 kfree(buf);
diff --git a/drivers/staging/go7007/s2250-loader.h b/drivers/staging/go7007/s2250-loader.h
new file mode 100644
index 000000000000..b7c301af16cc
--- /dev/null
+++ b/drivers/staging/go7007/s2250-loader.h
@@ -0,0 +1,24 @@
1/*
2 * Copyright (C) 2005-2006 Micronas USA Inc.
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 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program; if not, write to the Free Software Foundation,
15 * Inc., 59 Temple Place - Suite 330, Boston MA 02111-1307, USA.
16 */
17
18#ifndef _S2250_LOADER_H_
19#define _S2250_LOADER_H_
20
21extern int s2250loader_init(void);
22extern void s2250loader_cleanup(void);
23
24#endif
diff --git a/drivers/staging/hv/BlkVsc.c b/drivers/staging/hv/BlkVsc.c
index 51aa861292fc..a48ee3a12646 100644
--- a/drivers/staging/hv/BlkVsc.c
+++ b/drivers/staging/hv/BlkVsc.c
@@ -16,6 +16,7 @@
16 * Place - Suite 330, Boston, MA 02111-1307 USA. 16 * Place - Suite 330, Boston, MA 02111-1307 USA.
17 * 17 *
18 * Authors: 18 * Authors:
19 * Haiyang Zhang <haiyangz@microsoft.com>
19 * Hank Janssen <hjanssen@microsoft.com> 20 * Hank Janssen <hjanssen@microsoft.com>
20 * 21 *
21 */ 22 */
diff --git a/drivers/staging/hv/Channel.c b/drivers/staging/hv/Channel.c
index d649ee169d95..746370e82115 100644
--- a/drivers/staging/hv/Channel.c
+++ b/drivers/staging/hv/Channel.c
@@ -611,7 +611,7 @@ void VmbusChannelClose(struct vmbus_channel *Channel)
611 611
612 /* Stop callback and cancel the timer asap */ 612 /* Stop callback and cancel the timer asap */
613 Channel->OnChannelCallback = NULL; 613 Channel->OnChannelCallback = NULL;
614 del_timer(&Channel->poll_timer); 614 del_timer_sync(&Channel->poll_timer);
615 615
616 /* Send a closing message */ 616 /* Send a closing message */
617 info = kmalloc(sizeof(*info) + 617 info = kmalloc(sizeof(*info) +
@@ -978,14 +978,10 @@ void VmbusChannelOnChannelEvent(struct vmbus_channel *Channel)
978{ 978{
979 DumpVmbusChannel(Channel); 979 DumpVmbusChannel(Channel);
980 ASSERT(Channel->OnChannelCallback); 980 ASSERT(Channel->OnChannelCallback);
981#ifdef ENABLE_POLLING 981
982 del_timer(&Channel->poll_timer);
983 Channel->OnChannelCallback(Channel->ChannelCallbackContext);
984 channel->poll_timer.expires(jiffies + usecs_to_jiffies(100);
985 add_timer(&channel->poll_timer);
986#else
987 Channel->OnChannelCallback(Channel->ChannelCallbackContext); 982 Channel->OnChannelCallback(Channel->ChannelCallbackContext);
988#endif 983
984 mod_timer(&Channel->poll_timer, jiffies + usecs_to_jiffies(100));
989} 985}
990 986
991/** 987/**
@@ -997,10 +993,6 @@ void VmbusChannelOnTimer(unsigned long data)
997 993
998 if (channel->OnChannelCallback) { 994 if (channel->OnChannelCallback) {
999 channel->OnChannelCallback(channel->ChannelCallbackContext); 995 channel->OnChannelCallback(channel->ChannelCallbackContext);
1000#ifdef ENABLE_POLLING
1001 channel->poll_timer.expires(jiffies + usecs_to_jiffies(100);
1002 add_timer(&channel->poll_timer);
1003#endif
1004 } 996 }
1005} 997}
1006 998
diff --git a/drivers/staging/hv/ChannelMgmt.c b/drivers/staging/hv/ChannelMgmt.c
index 3db62caedcff..ef38467ed4e2 100644
--- a/drivers/staging/hv/ChannelMgmt.c
+++ b/drivers/staging/hv/ChannelMgmt.c
@@ -119,7 +119,7 @@ static inline void ReleaseVmbusChannel(void *context)
119 */ 119 */
120void FreeVmbusChannel(struct vmbus_channel *Channel) 120void FreeVmbusChannel(struct vmbus_channel *Channel)
121{ 121{
122 del_timer(&Channel->poll_timer); 122 del_timer_sync(&Channel->poll_timer);
123 123
124 /* 124 /*
125 * We have to release the channel's workqueue/thread in the vmbus's 125 * We have to release the channel's workqueue/thread in the vmbus's
diff --git a/drivers/staging/hv/NetVsc.c b/drivers/staging/hv/NetVsc.c
index d384c0ddf069..1c717f9a554e 100644
--- a/drivers/staging/hv/NetVsc.c
+++ b/drivers/staging/hv/NetVsc.c
@@ -15,6 +15,7 @@
15 * Place - Suite 330, Boston, MA 02111-1307 USA. 15 * Place - Suite 330, Boston, MA 02111-1307 USA.
16 * 16 *
17 * Authors: 17 * Authors:
18 * Haiyang Zhang <haiyangz@microsoft.com>
18 * Hank Janssen <hjanssen@microsoft.com> 19 * Hank Janssen <hjanssen@microsoft.com>
19 */ 20 */
20#include <linux/kernel.h> 21#include <linux/kernel.h>
diff --git a/drivers/staging/hv/NetVsc.h b/drivers/staging/hv/NetVsc.h
index 3e7112f7c755..6e0e03494126 100644
--- a/drivers/staging/hv/NetVsc.h
+++ b/drivers/staging/hv/NetVsc.h
@@ -16,6 +16,7 @@
16 * Place - Suite 330, Boston, MA 02111-1307 USA. 16 * Place - Suite 330, Boston, MA 02111-1307 USA.
17 * 17 *
18 * Authors: 18 * Authors:
19 * Haiyang Zhang <haiyangz@microsoft.com>
19 * Hank Janssen <hjanssen@microsoft.com> 20 * Hank Janssen <hjanssen@microsoft.com>
20 * 21 *
21 */ 22 */
diff --git a/drivers/staging/hv/StorVsc.c b/drivers/staging/hv/StorVsc.c
index 14015c927940..2f7c425896f7 100644
--- a/drivers/staging/hv/StorVsc.c
+++ b/drivers/staging/hv/StorVsc.c
@@ -196,7 +196,7 @@ static int StorVscChannelInit(struct hv_device *Device)
196 * Now, initiate the vsc/vsp initialization protocol on the open 196 * Now, initiate the vsc/vsp initialization protocol on the open
197 * channel 197 * channel
198 */ 198 */
199 memset(request, sizeof(struct storvsc_request_extension), 0); 199 memset(request, 0, sizeof(struct storvsc_request_extension));
200 request->WaitEvent = osd_WaitEventCreate(); 200 request->WaitEvent = osd_WaitEventCreate();
201 201
202 vstorPacket->Operation = VStorOperationBeginInitialization; 202 vstorPacket->Operation = VStorOperationBeginInitialization;
@@ -233,7 +233,7 @@ static int StorVscChannelInit(struct hv_device *Device)
233 DPRINT_INFO(STORVSC, "QUERY_PROTOCOL_VERSION_OPERATION..."); 233 DPRINT_INFO(STORVSC, "QUERY_PROTOCOL_VERSION_OPERATION...");
234 234
235 /* reuse the packet for version range supported */ 235 /* reuse the packet for version range supported */
236 memset(vstorPacket, sizeof(struct vstor_packet), 0); 236 memset(vstorPacket, 0, sizeof(struct vstor_packet));
237 vstorPacket->Operation = VStorOperationQueryProtocolVersion; 237 vstorPacket->Operation = VStorOperationQueryProtocolVersion;
238 vstorPacket->Flags = REQUEST_COMPLETION_FLAG; 238 vstorPacket->Flags = REQUEST_COMPLETION_FLAG;
239 239
@@ -266,7 +266,7 @@ static int StorVscChannelInit(struct hv_device *Device)
266 /* Query channel properties */ 266 /* Query channel properties */
267 DPRINT_INFO(STORVSC, "QUERY_PROPERTIES_OPERATION..."); 267 DPRINT_INFO(STORVSC, "QUERY_PROPERTIES_OPERATION...");
268 268
269 memset(vstorPacket, sizeof(struct vstor_packet), 0); 269 memset(vstorPacket, 0, sizeof(struct vstor_packet));
270 vstorPacket->Operation = VStorOperationQueryProperties; 270 vstorPacket->Operation = VStorOperationQueryProperties;
271 vstorPacket->Flags = REQUEST_COMPLETION_FLAG; 271 vstorPacket->Flags = REQUEST_COMPLETION_FLAG;
272 vstorPacket->StorageChannelProperties.PortNumber = 272 vstorPacket->StorageChannelProperties.PortNumber =
@@ -305,7 +305,7 @@ static int StorVscChannelInit(struct hv_device *Device)
305 305
306 DPRINT_INFO(STORVSC, "END_INITIALIZATION_OPERATION..."); 306 DPRINT_INFO(STORVSC, "END_INITIALIZATION_OPERATION...");
307 307
308 memset(vstorPacket, sizeof(struct vstor_packet), 0); 308 memset(vstorPacket, 0, sizeof(struct vstor_packet));
309 vstorPacket->Operation = VStorOperationEndInitialization; 309 vstorPacket->Operation = VStorOperationEndInitialization;
310 vstorPacket->Flags = REQUEST_COMPLETION_FLAG; 310 vstorPacket->Flags = REQUEST_COMPLETION_FLAG;
311 311
@@ -508,7 +508,7 @@ static int StorVscConnectToVsp(struct hv_device *Device)
508 int ret; 508 int ret;
509 509
510 storDriver = (struct storvsc_driver_object *)Device->Driver; 510 storDriver = (struct storvsc_driver_object *)Device->Driver;
511 memset(&props, sizeof(struct vmstorage_channel_properties), 0); 511 memset(&props, 0, sizeof(struct vmstorage_channel_properties));
512 512
513 /* Open the channel */ 513 /* Open the channel */
514 ret = Device->Driver->VmbusChannelInterface.Open(Device, 514 ret = Device->Driver->VmbusChannelInterface.Open(Device,
diff --git a/drivers/staging/hv/blkvsc_drv.c b/drivers/staging/hv/blkvsc_drv.c
index 99c49261a8b4..62b282844a53 100644
--- a/drivers/staging/hv/blkvsc_drv.c
+++ b/drivers/staging/hv/blkvsc_drv.c
@@ -15,6 +15,7 @@
15 * Place - Suite 330, Boston, MA 02111-1307 USA. 15 * Place - Suite 330, Boston, MA 02111-1307 USA.
16 * 16 *
17 * Authors: 17 * Authors:
18 * Haiyang Zhang <haiyangz@microsoft.com>
18 * Hank Janssen <hjanssen@microsoft.com> 19 * Hank Janssen <hjanssen@microsoft.com>
19 */ 20 */
20#include <linux/init.h> 21#include <linux/init.h>
diff --git a/drivers/staging/hv/netvsc_drv.c b/drivers/staging/hv/netvsc_drv.c
index 3192d50f7251..0d7459e2d036 100644
--- a/drivers/staging/hv/netvsc_drv.c
+++ b/drivers/staging/hv/netvsc_drv.c
@@ -15,6 +15,7 @@
15 * Place - Suite 330, Boston, MA 02111-1307 USA. 15 * Place - Suite 330, Boston, MA 02111-1307 USA.
16 * 16 *
17 * Authors: 17 * Authors:
18 * Haiyang Zhang <haiyangz@microsoft.com>
18 * Hank Janssen <hjanssen@microsoft.com> 19 * Hank Janssen <hjanssen@microsoft.com>
19 */ 20 */
20#include <linux/init.h> 21#include <linux/init.h>
diff --git a/drivers/staging/octeon/ethernet-mdio.c b/drivers/staging/octeon/ethernet-mdio.c
index 42230e62a222..31a58e508924 100644
--- a/drivers/staging/octeon/ethernet-mdio.c
+++ b/drivers/staging/octeon/ethernet-mdio.c
@@ -170,7 +170,7 @@ static u32 cvm_oct_get_link(struct net_device *dev)
170 return ret; 170 return ret;
171} 171}
172 172
173struct const ethtool_ops cvm_oct_ethtool_ops = { 173const struct ethtool_ops cvm_oct_ethtool_ops = {
174 .get_drvinfo = cvm_oct_get_drvinfo, 174 .get_drvinfo = cvm_oct_get_drvinfo,
175 .get_settings = cvm_oct_get_settings, 175 .get_settings = cvm_oct_get_settings,
176 .set_settings = cvm_oct_set_settings, 176 .set_settings = cvm_oct_set_settings,
diff --git a/drivers/staging/octeon/ethernet-spi.c b/drivers/staging/octeon/ethernet-spi.c
index 66190b0cb68f..00dc0f4bad19 100644
--- a/drivers/staging/octeon/ethernet-spi.c
+++ b/drivers/staging/octeon/ethernet-spi.c
@@ -317,6 +317,6 @@ void cvm_oct_spi_uninit(struct net_device *dev)
317 cvmx_write_csr(CVMX_SPXX_INT_MSK(interface), 0); 317 cvmx_write_csr(CVMX_SPXX_INT_MSK(interface), 0);
318 cvmx_write_csr(CVMX_STXX_INT_MSK(interface), 0); 318 cvmx_write_csr(CVMX_STXX_INT_MSK(interface), 0);
319 } 319 }
320 free_irq(8 + 46, &number_spi_ports); 320 free_irq(OCTEON_IRQ_RML, &number_spi_ports);
321 } 321 }
322} 322}
diff --git a/drivers/staging/octeon/ethernet.c b/drivers/staging/octeon/ethernet.c
index b8479517dce2..492c5029992d 100644
--- a/drivers/staging/octeon/ethernet.c
+++ b/drivers/staging/octeon/ethernet.c
@@ -111,6 +111,16 @@ MODULE_PARM_DESC(disable_core_queueing, "\n"
111 "\tallows packets to be sent without lock contention in the packet\n" 111 "\tallows packets to be sent without lock contention in the packet\n"
112 "\tscheduler resulting in some cases in improved throughput.\n"); 112 "\tscheduler resulting in some cases in improved throughput.\n");
113 113
114
115/*
116 * The offset from mac_addr_base that should be used for the next port
117 * that is configured. By convention, if any mgmt ports exist on the
118 * chip, they get the first mac addresses, The ports controlled by
119 * this driver are numbered sequencially following any mgmt addresses
120 * that may exist.
121 */
122static unsigned int cvm_oct_mac_addr_offset;
123
114/** 124/**
115 * Periodic timer to check auto negotiation 125 * Periodic timer to check auto negotiation
116 */ 126 */
@@ -474,16 +484,30 @@ static int cvm_oct_common_set_mac_address(struct net_device *dev, void *addr)
474 */ 484 */
475int cvm_oct_common_init(struct net_device *dev) 485int cvm_oct_common_init(struct net_device *dev)
476{ 486{
477 static int count;
478 char mac[8] = { 0x00, 0x00,
479 octeon_bootinfo->mac_addr_base[0],
480 octeon_bootinfo->mac_addr_base[1],
481 octeon_bootinfo->mac_addr_base[2],
482 octeon_bootinfo->mac_addr_base[3],
483 octeon_bootinfo->mac_addr_base[4],
484 octeon_bootinfo->mac_addr_base[5] + count
485 };
486 struct octeon_ethernet *priv = netdev_priv(dev); 487 struct octeon_ethernet *priv = netdev_priv(dev);
488 struct sockaddr sa;
489 u64 mac = ((u64)(octeon_bootinfo->mac_addr_base[0] & 0xff) << 40) |
490 ((u64)(octeon_bootinfo->mac_addr_base[1] & 0xff) << 32) |
491 ((u64)(octeon_bootinfo->mac_addr_base[2] & 0xff) << 24) |
492 ((u64)(octeon_bootinfo->mac_addr_base[3] & 0xff) << 16) |
493 ((u64)(octeon_bootinfo->mac_addr_base[4] & 0xff) << 8) |
494 (u64)(octeon_bootinfo->mac_addr_base[5] & 0xff);
495
496 mac += cvm_oct_mac_addr_offset;
497 sa.sa_data[0] = (mac >> 40) & 0xff;
498 sa.sa_data[1] = (mac >> 32) & 0xff;
499 sa.sa_data[2] = (mac >> 24) & 0xff;
500 sa.sa_data[3] = (mac >> 16) & 0xff;
501 sa.sa_data[4] = (mac >> 8) & 0xff;
502 sa.sa_data[5] = mac & 0xff;
503
504 if (cvm_oct_mac_addr_offset >= octeon_bootinfo->mac_addr_count)
505 printk(KERN_DEBUG "%s: Using MAC outside of the assigned range:"
506 " %02x:%02x:%02x:%02x:%02x:%02x\n", dev->name,
507 sa.sa_data[0] & 0xff, sa.sa_data[1] & 0xff,
508 sa.sa_data[2] & 0xff, sa.sa_data[3] & 0xff,
509 sa.sa_data[4] & 0xff, sa.sa_data[5] & 0xff);
510 cvm_oct_mac_addr_offset++;
487 511
488 /* 512 /*
489 * Force the interface to use the POW send if always_use_pow 513 * Force the interface to use the POW send if always_use_pow
@@ -496,14 +520,12 @@ int cvm_oct_common_init(struct net_device *dev)
496 if (priv->queue != -1 && USE_HW_TCPUDP_CHECKSUM) 520 if (priv->queue != -1 && USE_HW_TCPUDP_CHECKSUM)
497 dev->features |= NETIF_F_IP_CSUM; 521 dev->features |= NETIF_F_IP_CSUM;
498 522
499 count++;
500
501 /* We do our own locking, Linux doesn't need to */ 523 /* We do our own locking, Linux doesn't need to */
502 dev->features |= NETIF_F_LLTX; 524 dev->features |= NETIF_F_LLTX;
503 SET_ETHTOOL_OPS(dev, &cvm_oct_ethtool_ops); 525 SET_ETHTOOL_OPS(dev, &cvm_oct_ethtool_ops);
504 526
505 cvm_oct_mdio_setup_device(dev); 527 cvm_oct_mdio_setup_device(dev);
506 dev->netdev_ops->ndo_set_mac_address(dev, mac); 528 dev->netdev_ops->ndo_set_mac_address(dev, &sa);
507 dev->netdev_ops->ndo_change_mtu(dev, dev->mtu); 529 dev->netdev_ops->ndo_change_mtu(dev, dev->mtu);
508 530
509 /* 531 /*
@@ -620,6 +642,13 @@ static int __init cvm_oct_init_module(void)
620 642
621 pr_notice("cavium-ethernet %s\n", OCTEON_ETHERNET_VERSION); 643 pr_notice("cavium-ethernet %s\n", OCTEON_ETHERNET_VERSION);
622 644
645 if (OCTEON_IS_MODEL(OCTEON_CN52XX))
646 cvm_oct_mac_addr_offset = 2; /* First two are the mgmt ports. */
647 else if (OCTEON_IS_MODEL(OCTEON_CN56XX))
648 cvm_oct_mac_addr_offset = 1; /* First one is the mgmt port. */
649 else
650 cvm_oct_mac_addr_offset = 0;
651
623 cvm_oct_proc_initialize(); 652 cvm_oct_proc_initialize();
624 cvm_oct_rx_initialize(); 653 cvm_oct_rx_initialize();
625 cvm_oct_configure_common_hw(); 654 cvm_oct_configure_common_hw();
diff --git a/drivers/staging/rtl8187se/TODO b/drivers/staging/rtl8187se/TODO
index c09a9160739d..a762e79873e9 100644
--- a/drivers/staging/rtl8187se/TODO
+++ b/drivers/staging/rtl8187se/TODO
@@ -11,5 +11,4 @@ TODO:
11- sparse fixes 11- sparse fixes
12- integrate with drivers/net/wireless/rtl818x 12- integrate with drivers/net/wireless/rtl818x
13 13
14Please send any patches to Greg Kroah-Hartman <greg@kroah.com> and 14Please send any patches to Greg Kroah-Hartman <greg@kroah.com>.
15Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>.
diff --git a/drivers/staging/rtl8192su/TODO b/drivers/staging/rtl8192su/TODO
index b13be9edb278..f11eec700030 100644
--- a/drivers/staging/rtl8192su/TODO
+++ b/drivers/staging/rtl8192su/TODO
@@ -14,5 +14,4 @@ TODO:
14- sparse fixes 14- sparse fixes
15- integrate with drivers/net/wireless/rtl818x 15- integrate with drivers/net/wireless/rtl818x
16 16
17Please send any patches to Greg Kroah-Hartman <greg@kroah.com> and 17Please send any patches to Greg Kroah-Hartman <greg@kroah.com>.
18Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>.
diff --git a/drivers/staging/vt6655/TODO b/drivers/staging/vt6655/TODO
index 8462cd17eb61..cb04aaafc46f 100644
--- a/drivers/staging/vt6655/TODO
+++ b/drivers/staging/vt6655/TODO
@@ -16,6 +16,5 @@ TODO:
16- sparse fixes 16- sparse fixes
17- integrate with drivers/net/wireless 17- integrate with drivers/net/wireless
18 18
19Please send any patches to Greg Kroah-Hartman <greg@kroah.com>, 19Please send any patches to Greg Kroah-Hartman <greg@kroah.com>
20Forest Bond <forest@alittletooquiet.net> and Bartlomiej Zolnierkiewicz 20and Forest Bond <forest@alittletooquiet.net>.
21<bzolnier@gmail.com>.
diff --git a/drivers/staging/vt6656/TODO b/drivers/staging/vt6656/TODO
index 17cf50c6735e..a318995ba07f 100644
--- a/drivers/staging/vt6656/TODO
+++ b/drivers/staging/vt6656/TODO
@@ -15,6 +15,5 @@ TODO:
15- sparse fixes 15- sparse fixes
16- integrate with drivers/net/wireless 16- integrate with drivers/net/wireless
17 17
18Please send any patches to Greg Kroah-Hartman <greg@kroah.com>, 18Please send any patches to Greg Kroah-Hartman <greg@kroah.com>
19Forest Bond <forest@alittletooquiet.net> and Bartlomiej Zolnierkiewicz 19and Forest Bond <forest@alittletooquiet.net>.
20<bzolnier@gmail.com>.
diff --git a/drivers/telephony/ixj_pcmcia.c b/drivers/telephony/ixj_pcmcia.c
index 347c3ed1d9f1..d442fd35620a 100644
--- a/drivers/telephony/ixj_pcmcia.c
+++ b/drivers/telephony/ixj_pcmcia.c
@@ -19,13 +19,6 @@
19 * PCMCIA service support for Quicknet cards 19 * PCMCIA service support for Quicknet cards
20 */ 20 */
21 21
22#ifdef PCMCIA_DEBUG
23static int pc_debug = PCMCIA_DEBUG;
24module_param(pc_debug, int, 0644);
25#define DEBUG(n, args...) if (pc_debug>(n)) printk(KERN_DEBUG args)
26#else
27#define DEBUG(n, args...)
28#endif
29 22
30typedef struct ixj_info_t { 23typedef struct ixj_info_t {
31 int ndev; 24 int ndev;
@@ -39,7 +32,7 @@ static void ixj_cs_release(struct pcmcia_device * link);
39 32
40static int ixj_probe(struct pcmcia_device *p_dev) 33static int ixj_probe(struct pcmcia_device *p_dev)
41{ 34{
42 DEBUG(0, "ixj_attach()\n"); 35 dev_dbg(&p_dev->dev, "ixj_attach()\n");
43 /* Create new ixj device */ 36 /* Create new ixj device */
44 p_dev->io.Attributes1 = IO_DATA_PATH_WIDTH_8; 37 p_dev->io.Attributes1 = IO_DATA_PATH_WIDTH_8;
45 p_dev->io.Attributes2 = IO_DATA_PATH_WIDTH_8; 38 p_dev->io.Attributes2 = IO_DATA_PATH_WIDTH_8;
@@ -55,33 +48,30 @@ static int ixj_probe(struct pcmcia_device *p_dev)
55 48
56static void ixj_detach(struct pcmcia_device *link) 49static void ixj_detach(struct pcmcia_device *link)
57{ 50{
58 DEBUG(0, "ixj_detach(0x%p)\n", link); 51 dev_dbg(&link->dev, "ixj_detach\n");
59 52
60 ixj_cs_release(link); 53 ixj_cs_release(link);
61 54
62 kfree(link->priv); 55 kfree(link->priv);
63} 56}
64 57
65#define CS_CHECK(fn, ret) \
66do { last_fn = (fn); if ((last_ret = (ret)) != 0) goto cs_failed; } while (0)
67
68static void ixj_get_serial(struct pcmcia_device * link, IXJ * j) 58static void ixj_get_serial(struct pcmcia_device * link, IXJ * j)
69{ 59{
70 char *str; 60 char *str;
71 int i, place; 61 int i, place;
72 DEBUG(0, "ixj_get_serial(0x%p)\n", link); 62 dev_dbg(&link->dev, "ixj_get_serial\n");
73 63
74 str = link->prod_id[0]; 64 str = link->prod_id[0];
75 if (!str) 65 if (!str)
76 goto cs_failed; 66 goto failed;
77 printk("%s", str); 67 printk("%s", str);
78 str = link->prod_id[1]; 68 str = link->prod_id[1];
79 if (!str) 69 if (!str)
80 goto cs_failed; 70 goto failed;
81 printk(" %s", str); 71 printk(" %s", str);
82 str = link->prod_id[2]; 72 str = link->prod_id[2];
83 if (!str) 73 if (!str)
84 goto cs_failed; 74 goto failed;
85 place = 1; 75 place = 1;
86 for (i = strlen(str) - 1; i >= 0; i--) { 76 for (i = strlen(str) - 1; i >= 0; i--) {
87 switch (str[i]) { 77 switch (str[i]) {
@@ -118,9 +108,9 @@ static void ixj_get_serial(struct pcmcia_device * link, IXJ * j)
118 } 108 }
119 str = link->prod_id[3]; 109 str = link->prod_id[3];
120 if (!str) 110 if (!str)
121 goto cs_failed; 111 goto failed;
122 printk(" version %s\n", str); 112 printk(" version %s\n", str);
123 cs_failed: 113failed:
124 return; 114 return;
125} 115}
126 116
@@ -151,13 +141,13 @@ static int ixj_config(struct pcmcia_device * link)
151 cistpl_cftable_entry_t dflt = { 0 }; 141 cistpl_cftable_entry_t dflt = { 0 };
152 142
153 info = link->priv; 143 info = link->priv;
154 DEBUG(0, "ixj_config(0x%p)\n", link); 144 dev_dbg(&link->dev, "ixj_config\n");
155 145
156 if (pcmcia_loop_config(link, ixj_config_check, &dflt)) 146 if (pcmcia_loop_config(link, ixj_config_check, &dflt))
157 goto cs_failed; 147 goto failed;
158 148
159 if (pcmcia_request_configuration(link, &link->conf)) 149 if (pcmcia_request_configuration(link, &link->conf))
160 goto cs_failed; 150 goto failed;
161 151
162 /* 152 /*
163 * Register the card with the core. 153 * Register the card with the core.
@@ -170,7 +160,7 @@ static int ixj_config(struct pcmcia_device * link)
170 ixj_get_serial(link, j); 160 ixj_get_serial(link, j);
171 return 0; 161 return 0;
172 162
173 cs_failed: 163failed:
174 ixj_cs_release(link); 164 ixj_cs_release(link);
175 return -ENODEV; 165 return -ENODEV;
176} 166}
@@ -178,7 +168,7 @@ static int ixj_config(struct pcmcia_device * link)
178static void ixj_cs_release(struct pcmcia_device *link) 168static void ixj_cs_release(struct pcmcia_device *link)
179{ 169{
180 ixj_info_t *info = link->priv; 170 ixj_info_t *info = link->priv;
181 DEBUG(0, "ixj_cs_release(0x%p)\n", link); 171 dev_dbg(&link->dev, "ixj_cs_release\n");
182 info->ndev = 0; 172 info->ndev = 0;
183 pcmcia_disable_device(link); 173 pcmcia_disable_device(link);
184} 174}
diff --git a/drivers/thermal/thermal_sys.c b/drivers/thermal/thermal_sys.c
index 4e83c297ec9e..6f8d8f971212 100644
--- a/drivers/thermal/thermal_sys.c
+++ b/drivers/thermal/thermal_sys.c
@@ -180,15 +180,15 @@ trip_point_type_show(struct device *dev, struct device_attribute *attr,
180 180
181 switch (type) { 181 switch (type) {
182 case THERMAL_TRIP_CRITICAL: 182 case THERMAL_TRIP_CRITICAL:
183 return sprintf(buf, "critical"); 183 return sprintf(buf, "critical\n");
184 case THERMAL_TRIP_HOT: 184 case THERMAL_TRIP_HOT:
185 return sprintf(buf, "hot"); 185 return sprintf(buf, "hot\n");
186 case THERMAL_TRIP_PASSIVE: 186 case THERMAL_TRIP_PASSIVE:
187 return sprintf(buf, "passive"); 187 return sprintf(buf, "passive\n");
188 case THERMAL_TRIP_ACTIVE: 188 case THERMAL_TRIP_ACTIVE:
189 return sprintf(buf, "active"); 189 return sprintf(buf, "active\n");
190 default: 190 default:
191 return sprintf(buf, "unknown"); 191 return sprintf(buf, "unknown\n");
192 } 192 }
193} 193}
194 194
diff --git a/drivers/uio/uio_pdrv_genirq.c b/drivers/uio/uio_pdrv_genirq.c
index 02347c57357d..aa53db9f2e88 100644
--- a/drivers/uio/uio_pdrv_genirq.c
+++ b/drivers/uio/uio_pdrv_genirq.c
@@ -178,6 +178,7 @@ static int uio_pdrv_genirq_probe(struct platform_device *pdev)
178 return 0; 178 return 0;
179 bad1: 179 bad1:
180 kfree(priv); 180 kfree(priv);
181 pm_runtime_disable(&pdev->dev);
181 bad0: 182 bad0:
182 return ret; 183 return ret;
183} 184}
diff --git a/drivers/usb/class/cdc-acm.c b/drivers/usb/class/cdc-acm.c
index e3861b21e776..e4eca7810bcf 100644
--- a/drivers/usb/class/cdc-acm.c
+++ b/drivers/usb/class/cdc-acm.c
@@ -609,9 +609,9 @@ static int acm_tty_open(struct tty_struct *tty, struct file *filp)
609 609
610 acm->throttle = 0; 610 acm->throttle = 0;
611 611
612 tasklet_schedule(&acm->urb_task);
613 set_bit(ASYNCB_INITIALIZED, &acm->port.flags); 612 set_bit(ASYNCB_INITIALIZED, &acm->port.flags);
614 rv = tty_port_block_til_ready(&acm->port, tty, filp); 613 rv = tty_port_block_til_ready(&acm->port, tty, filp);
614 tasklet_schedule(&acm->urb_task);
615done: 615done:
616 mutex_unlock(&acm->mutex); 616 mutex_unlock(&acm->mutex);
617err_out: 617err_out:
@@ -686,15 +686,21 @@ static void acm_tty_close(struct tty_struct *tty, struct file *filp)
686 686
687 /* Perform the closing process and see if we need to do the hardware 687 /* Perform the closing process and see if we need to do the hardware
688 shutdown */ 688 shutdown */
689 if (!acm || tty_port_close_start(&acm->port, tty, filp) == 0) 689 if (!acm)
690 return;
691 if (tty_port_close_start(&acm->port, tty, filp) == 0) {
692 mutex_lock(&open_mutex);
693 if (!acm->dev) {
694 tty_port_tty_set(&acm->port, NULL);
695 acm_tty_unregister(acm);
696 tty->driver_data = NULL;
697 }
698 mutex_unlock(&open_mutex);
690 return; 699 return;
700 }
691 acm_port_down(acm, 0); 701 acm_port_down(acm, 0);
692 tty_port_close_end(&acm->port, tty); 702 tty_port_close_end(&acm->port, tty);
693 mutex_lock(&open_mutex);
694 tty_port_tty_set(&acm->port, NULL); 703 tty_port_tty_set(&acm->port, NULL);
695 if (!acm->dev)
696 acm_tty_unregister(acm);
697 mutex_unlock(&open_mutex);
698} 704}
699 705
700static int acm_tty_write(struct tty_struct *tty, 706static int acm_tty_write(struct tty_struct *tty,
diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c
index 5ce839137ad6..0f857e645058 100644
--- a/drivers/usb/core/hub.c
+++ b/drivers/usb/core/hub.c
@@ -444,7 +444,7 @@ resubmit:
444static inline int 444static inline int
445hub_clear_tt_buffer (struct usb_device *hdev, u16 devinfo, u16 tt) 445hub_clear_tt_buffer (struct usb_device *hdev, u16 devinfo, u16 tt)
446{ 446{
447 return usb_control_msg(hdev, usb_rcvctrlpipe(hdev, 0), 447 return usb_control_msg(hdev, usb_sndctrlpipe(hdev, 0),
448 HUB_CLEAR_TT_BUFFER, USB_RT_PORT, devinfo, 448 HUB_CLEAR_TT_BUFFER, USB_RT_PORT, devinfo,
449 tt, NULL, 0, 1000); 449 tt, NULL, 0, 1000);
450} 450}
diff --git a/drivers/usb/gadget/amd5536udc.c b/drivers/usb/gadget/amd5536udc.c
index d5b65962dd36..731150d4b1d9 100644
--- a/drivers/usb/gadget/amd5536udc.c
+++ b/drivers/usb/gadget/amd5536udc.c
@@ -1213,7 +1213,12 @@ udc_queue(struct usb_ep *usbep, struct usb_request *usbreq, gfp_t gfp)
1213 tmp &= AMD_UNMASK_BIT(ep->num); 1213 tmp &= AMD_UNMASK_BIT(ep->num);
1214 writel(tmp, &dev->regs->ep_irqmsk); 1214 writel(tmp, &dev->regs->ep_irqmsk);
1215 } 1215 }
1216 } 1216 } else if (ep->in) {
1217 /* enable ep irq */
1218 tmp = readl(&dev->regs->ep_irqmsk);
1219 tmp &= AMD_UNMASK_BIT(ep->num);
1220 writel(tmp, &dev->regs->ep_irqmsk);
1221 }
1217 1222
1218 } else if (ep->dma) { 1223 } else if (ep->dma) {
1219 1224
@@ -2005,18 +2010,17 @@ __acquires(dev->lock)
2005{ 2010{
2006 int tmp; 2011 int tmp;
2007 2012
2008 /* empty queues and init hardware */
2009 udc_basic_init(dev);
2010 for (tmp = 0; tmp < UDC_EP_NUM; tmp++) {
2011 empty_req_queue(&dev->ep[tmp]);
2012 }
2013
2014 if (dev->gadget.speed != USB_SPEED_UNKNOWN) { 2013 if (dev->gadget.speed != USB_SPEED_UNKNOWN) {
2015 spin_unlock(&dev->lock); 2014 spin_unlock(&dev->lock);
2016 driver->disconnect(&dev->gadget); 2015 driver->disconnect(&dev->gadget);
2017 spin_lock(&dev->lock); 2016 spin_lock(&dev->lock);
2018 } 2017 }
2019 /* init */ 2018
2019 /* empty queues and init hardware */
2020 udc_basic_init(dev);
2021 for (tmp = 0; tmp < UDC_EP_NUM; tmp++)
2022 empty_req_queue(&dev->ep[tmp]);
2023
2020 udc_setup_endpoints(dev); 2024 udc_setup_endpoints(dev);
2021} 2025}
2022 2026
@@ -2472,6 +2476,13 @@ static irqreturn_t udc_data_in_isr(struct udc *dev, int ep_ix)
2472 } 2476 }
2473 } 2477 }
2474 2478
2479 } else if (!use_dma && ep->in) {
2480 /* disable interrupt */
2481 tmp = readl(
2482 &dev->regs->ep_irqmsk);
2483 tmp |= AMD_BIT(ep->num);
2484 writel(tmp,
2485 &dev->regs->ep_irqmsk);
2475 } 2486 }
2476 } 2487 }
2477 /* clear status bits */ 2488 /* clear status bits */
@@ -3279,6 +3290,17 @@ static int udc_pci_probe(
3279 goto finished; 3290 goto finished;
3280 } 3291 }
3281 3292
3293 spin_lock_init(&dev->lock);
3294 /* udc csr registers base */
3295 dev->csr = dev->virt_addr + UDC_CSR_ADDR;
3296 /* dev registers base */
3297 dev->regs = dev->virt_addr + UDC_DEVCFG_ADDR;
3298 /* ep registers base */
3299 dev->ep_regs = dev->virt_addr + UDC_EPREGS_ADDR;
3300 /* fifo's base */
3301 dev->rxfifo = (u32 __iomem *)(dev->virt_addr + UDC_RXFIFO_ADDR);
3302 dev->txfifo = (u32 __iomem *)(dev->virt_addr + UDC_TXFIFO_ADDR);
3303
3282 if (request_irq(pdev->irq, udc_irq, IRQF_SHARED, name, dev) != 0) { 3304 if (request_irq(pdev->irq, udc_irq, IRQF_SHARED, name, dev) != 0) {
3283 dev_dbg(&dev->pdev->dev, "request_irq(%d) fail\n", pdev->irq); 3305 dev_dbg(&dev->pdev->dev, "request_irq(%d) fail\n", pdev->irq);
3284 kfree(dev); 3306 kfree(dev);
@@ -3331,7 +3353,6 @@ static int udc_probe(struct udc *dev)
3331 udc_pollstall_timer.data = 0; 3353 udc_pollstall_timer.data = 0;
3332 3354
3333 /* device struct setup */ 3355 /* device struct setup */
3334 spin_lock_init(&dev->lock);
3335 dev->gadget.ops = &udc_ops; 3356 dev->gadget.ops = &udc_ops;
3336 3357
3337 dev_set_name(&dev->gadget.dev, "gadget"); 3358 dev_set_name(&dev->gadget.dev, "gadget");
@@ -3340,16 +3361,6 @@ static int udc_probe(struct udc *dev)
3340 dev->gadget.name = name; 3361 dev->gadget.name = name;
3341 dev->gadget.is_dualspeed = 1; 3362 dev->gadget.is_dualspeed = 1;
3342 3363
3343 /* udc csr registers base */
3344 dev->csr = dev->virt_addr + UDC_CSR_ADDR;
3345 /* dev registers base */
3346 dev->regs = dev->virt_addr + UDC_DEVCFG_ADDR;
3347 /* ep registers base */
3348 dev->ep_regs = dev->virt_addr + UDC_EPREGS_ADDR;
3349 /* fifo's base */
3350 dev->rxfifo = (u32 __iomem *)(dev->virt_addr + UDC_RXFIFO_ADDR);
3351 dev->txfifo = (u32 __iomem *)(dev->virt_addr + UDC_TXFIFO_ADDR);
3352
3353 /* init registers, interrupts, ... */ 3364 /* init registers, interrupts, ... */
3354 startup_registers(dev); 3365 startup_registers(dev);
3355 3366
diff --git a/drivers/usb/host/ehci-hcd.c b/drivers/usb/host/ehci-hcd.c
index 9835e0713943..f5f5601701c9 100644
--- a/drivers/usb/host/ehci-hcd.c
+++ b/drivers/usb/host/ehci-hcd.c
@@ -28,6 +28,7 @@
28#include <linux/errno.h> 28#include <linux/errno.h>
29#include <linux/init.h> 29#include <linux/init.h>
30#include <linux/timer.h> 30#include <linux/timer.h>
31#include <linux/ktime.h>
31#include <linux/list.h> 32#include <linux/list.h>
32#include <linux/interrupt.h> 33#include <linux/interrupt.h>
33#include <linux/usb.h> 34#include <linux/usb.h>
@@ -676,6 +677,7 @@ static int ehci_run (struct usb_hcd *hcd)
676 ehci_readl(ehci, &ehci->regs->command); /* unblock posted writes */ 677 ehci_readl(ehci, &ehci->regs->command); /* unblock posted writes */
677 msleep(5); 678 msleep(5);
678 up_write(&ehci_cf_port_reset_rwsem); 679 up_write(&ehci_cf_port_reset_rwsem);
680 ehci->last_periodic_enable = ktime_get_real();
679 681
680 temp = HC_VERSION(ehci_readl(ehci, &ehci->caps->hc_capbase)); 682 temp = HC_VERSION(ehci_readl(ehci, &ehci->caps->hc_capbase));
681 ehci_info (ehci, 683 ehci_info (ehci,
diff --git a/drivers/usb/host/ehci-pci.c b/drivers/usb/host/ehci-pci.c
index 378861b9d79a..ead5f4f2aa5a 100644
--- a/drivers/usb/host/ehci-pci.c
+++ b/drivers/usb/host/ehci-pci.c
@@ -111,6 +111,10 @@ static int ehci_pci_setup(struct usb_hcd *hcd)
111 switch (pdev->vendor) { 111 switch (pdev->vendor) {
112 case PCI_VENDOR_ID_INTEL: 112 case PCI_VENDOR_ID_INTEL:
113 ehci->need_io_watchdog = 0; 113 ehci->need_io_watchdog = 0;
114 if (pdev->device == 0x27cc) {
115 ehci->broken_periodic = 1;
116 ehci_info(ehci, "using broken periodic workaround\n");
117 }
114 break; 118 break;
115 case PCI_VENDOR_ID_TDI: 119 case PCI_VENDOR_ID_TDI:
116 if (pdev->device == PCI_DEVICE_ID_TDI_EHCI) { 120 if (pdev->device == PCI_DEVICE_ID_TDI_EHCI) {
diff --git a/drivers/usb/host/ehci-q.c b/drivers/usb/host/ehci-q.c
index 00ad9ce392ed..139a2cc3f641 100644
--- a/drivers/usb/host/ehci-q.c
+++ b/drivers/usb/host/ehci-q.c
@@ -487,8 +487,20 @@ halt:
487 * we must clear the TT buffer (11.17.5). 487 * we must clear the TT buffer (11.17.5).
488 */ 488 */
489 if (unlikely(last_status != -EINPROGRESS && 489 if (unlikely(last_status != -EINPROGRESS &&
490 last_status != -EREMOTEIO)) 490 last_status != -EREMOTEIO)) {
491 ehci_clear_tt_buffer(ehci, qh, urb, token); 491 /* The TT's in some hubs malfunction when they
492 * receive this request following a STALL (they
493 * stop sending isochronous packets). Since a
494 * STALL can't leave the TT buffer in a busy
495 * state (if you believe Figures 11-48 - 11-51
496 * in the USB 2.0 spec), we won't clear the TT
497 * buffer in this case. Strictly speaking this
498 * is a violation of the spec.
499 */
500 if (last_status != -EPIPE)
501 ehci_clear_tt_buffer(ehci, qh, urb,
502 token);
503 }
492 } 504 }
493 505
494 /* if we're removing something not at the queue head, 506 /* if we're removing something not at the queue head,
diff --git a/drivers/usb/host/ehci-sched.c b/drivers/usb/host/ehci-sched.c
index b25cdea93a1f..a5535b5e3fe2 100644
--- a/drivers/usb/host/ehci-sched.c
+++ b/drivers/usb/host/ehci-sched.c
@@ -475,6 +475,8 @@ static int enable_periodic (struct ehci_hcd *ehci)
475 /* make sure ehci_work scans these */ 475 /* make sure ehci_work scans these */
476 ehci->next_uframe = ehci_readl(ehci, &ehci->regs->frame_index) 476 ehci->next_uframe = ehci_readl(ehci, &ehci->regs->frame_index)
477 % (ehci->periodic_size << 3); 477 % (ehci->periodic_size << 3);
478 if (unlikely(ehci->broken_periodic))
479 ehci->last_periodic_enable = ktime_get_real();
478 return 0; 480 return 0;
479} 481}
480 482
@@ -486,6 +488,16 @@ static int disable_periodic (struct ehci_hcd *ehci)
486 if (--ehci->periodic_sched) 488 if (--ehci->periodic_sched)
487 return 0; 489 return 0;
488 490
491 if (unlikely(ehci->broken_periodic)) {
492 /* delay experimentally determined */
493 ktime_t safe = ktime_add_us(ehci->last_periodic_enable, 1000);
494 ktime_t now = ktime_get_real();
495 s64 delay = ktime_us_delta(safe, now);
496
497 if (unlikely(delay > 0))
498 udelay(delay);
499 }
500
489 /* did setting PSE not take effect yet? 501 /* did setting PSE not take effect yet?
490 * takes effect only at frame boundaries... 502 * takes effect only at frame boundaries...
491 */ 503 */
diff --git a/drivers/usb/host/ehci.h b/drivers/usb/host/ehci.h
index 064e76821ff5..2d85e21ff282 100644
--- a/drivers/usb/host/ehci.h
+++ b/drivers/usb/host/ehci.h
@@ -118,6 +118,7 @@ struct ehci_hcd { /* one per controller */
118 unsigned stamp; 118 unsigned stamp;
119 unsigned random_frame; 119 unsigned random_frame;
120 unsigned long next_statechange; 120 unsigned long next_statechange;
121 ktime_t last_periodic_enable;
121 u32 command; 122 u32 command;
122 123
123 /* SILICON QUIRKS */ 124 /* SILICON QUIRKS */
@@ -127,6 +128,7 @@ struct ehci_hcd { /* one per controller */
127 unsigned big_endian_desc:1; 128 unsigned big_endian_desc:1;
128 unsigned has_amcc_usb23:1; 129 unsigned has_amcc_usb23:1;
129 unsigned need_io_watchdog:1; 130 unsigned need_io_watchdog:1;
131 unsigned broken_periodic:1;
130 132
131 /* required for usb32 quirk */ 133 /* required for usb32 quirk */
132 #define OHCI_CTRL_HCFS (3 << 6) 134 #define OHCI_CTRL_HCFS (3 << 6)
diff --git a/drivers/usb/host/ohci-hcd.c b/drivers/usb/host/ohci-hcd.c
index 78bb7710f36d..24eb74781919 100644
--- a/drivers/usb/host/ohci-hcd.c
+++ b/drivers/usb/host/ohci-hcd.c
@@ -87,6 +87,7 @@ static int ohci_restart (struct ohci_hcd *ohci);
87#ifdef CONFIG_PCI 87#ifdef CONFIG_PCI
88static void quirk_amd_pll(int state); 88static void quirk_amd_pll(int state);
89static void amd_iso_dev_put(void); 89static void amd_iso_dev_put(void);
90static void sb800_prefetch(struct ohci_hcd *ohci, int on);
90#else 91#else
91static inline void quirk_amd_pll(int state) 92static inline void quirk_amd_pll(int state)
92{ 93{
@@ -96,6 +97,10 @@ static inline void amd_iso_dev_put(void)
96{ 97{
97 return; 98 return;
98} 99}
100static inline void sb800_prefetch(struct ohci_hcd *ohci, int on)
101{
102 return;
103}
99#endif 104#endif
100 105
101 106
diff --git a/drivers/usb/host/ohci-pci.c b/drivers/usb/host/ohci-pci.c
index d2ba04dd785e..b8a1148f248e 100644
--- a/drivers/usb/host/ohci-pci.c
+++ b/drivers/usb/host/ohci-pci.c
@@ -177,6 +177,13 @@ static int ohci_quirk_amd700(struct usb_hcd *hcd)
177 return 0; 177 return 0;
178 178
179 pci_read_config_byte(amd_smbus_dev, PCI_REVISION_ID, &rev); 179 pci_read_config_byte(amd_smbus_dev, PCI_REVISION_ID, &rev);
180
181 /* SB800 needs pre-fetch fix */
182 if ((rev >= 0x40) && (rev <= 0x4f)) {
183 ohci->flags |= OHCI_QUIRK_AMD_PREFETCH;
184 ohci_dbg(ohci, "enabled AMD prefetch quirk\n");
185 }
186
180 if ((rev > 0x3b) || (rev < 0x30)) { 187 if ((rev > 0x3b) || (rev < 0x30)) {
181 pci_dev_put(amd_smbus_dev); 188 pci_dev_put(amd_smbus_dev);
182 amd_smbus_dev = NULL; 189 amd_smbus_dev = NULL;
@@ -262,6 +269,19 @@ static void amd_iso_dev_put(void)
262 269
263} 270}
264 271
272static void sb800_prefetch(struct ohci_hcd *ohci, int on)
273{
274 struct pci_dev *pdev;
275 u16 misc;
276
277 pdev = to_pci_dev(ohci_to_hcd(ohci)->self.controller);
278 pci_read_config_word(pdev, 0x50, &misc);
279 if (on == 0)
280 pci_write_config_word(pdev, 0x50, misc & 0xfcff);
281 else
282 pci_write_config_word(pdev, 0x50, misc | 0x0300);
283}
284
265/* List of quirks for OHCI */ 285/* List of quirks for OHCI */
266static const struct pci_device_id ohci_pci_quirks[] = { 286static const struct pci_device_id ohci_pci_quirks[] = {
267 { 287 {
diff --git a/drivers/usb/host/ohci-q.c b/drivers/usb/host/ohci-q.c
index 16fecb8ecc39..35288bcae0db 100644
--- a/drivers/usb/host/ohci-q.c
+++ b/drivers/usb/host/ohci-q.c
@@ -49,9 +49,12 @@ __acquires(ohci->lock)
49 switch (usb_pipetype (urb->pipe)) { 49 switch (usb_pipetype (urb->pipe)) {
50 case PIPE_ISOCHRONOUS: 50 case PIPE_ISOCHRONOUS:
51 ohci_to_hcd(ohci)->self.bandwidth_isoc_reqs--; 51 ohci_to_hcd(ohci)->self.bandwidth_isoc_reqs--;
52 if (ohci_to_hcd(ohci)->self.bandwidth_isoc_reqs == 0 52 if (ohci_to_hcd(ohci)->self.bandwidth_isoc_reqs == 0) {
53 && quirk_amdiso(ohci)) 53 if (quirk_amdiso(ohci))
54 quirk_amd_pll(1); 54 quirk_amd_pll(1);
55 if (quirk_amdprefetch(ohci))
56 sb800_prefetch(ohci, 0);
57 }
55 break; 58 break;
56 case PIPE_INTERRUPT: 59 case PIPE_INTERRUPT:
57 ohci_to_hcd(ohci)->self.bandwidth_int_reqs--; 60 ohci_to_hcd(ohci)->self.bandwidth_int_reqs--;
@@ -680,9 +683,12 @@ static void td_submit_urb (
680 data + urb->iso_frame_desc [cnt].offset, 683 data + urb->iso_frame_desc [cnt].offset,
681 urb->iso_frame_desc [cnt].length, urb, cnt); 684 urb->iso_frame_desc [cnt].length, urb, cnt);
682 } 685 }
683 if (ohci_to_hcd(ohci)->self.bandwidth_isoc_reqs == 0 686 if (ohci_to_hcd(ohci)->self.bandwidth_isoc_reqs == 0) {
684 && quirk_amdiso(ohci)) 687 if (quirk_amdiso(ohci))
685 quirk_amd_pll(0); 688 quirk_amd_pll(0);
689 if (quirk_amdprefetch(ohci))
690 sb800_prefetch(ohci, 1);
691 }
686 periodic = ohci_to_hcd(ohci)->self.bandwidth_isoc_reqs++ == 0 692 periodic = ohci_to_hcd(ohci)->self.bandwidth_isoc_reqs++ == 0
687 && ohci_to_hcd(ohci)->self.bandwidth_int_reqs == 0; 693 && ohci_to_hcd(ohci)->self.bandwidth_int_reqs == 0;
688 break; 694 break;
diff --git a/drivers/usb/host/ohci.h b/drivers/usb/host/ohci.h
index 222011f6172c..5bf15fed0d9f 100644
--- a/drivers/usb/host/ohci.h
+++ b/drivers/usb/host/ohci.h
@@ -402,6 +402,7 @@ struct ohci_hcd {
402#define OHCI_QUIRK_FRAME_NO 0x80 /* no big endian frame_no shift */ 402#define OHCI_QUIRK_FRAME_NO 0x80 /* no big endian frame_no shift */
403#define OHCI_QUIRK_HUB_POWER 0x100 /* distrust firmware power/oc setup */ 403#define OHCI_QUIRK_HUB_POWER 0x100 /* distrust firmware power/oc setup */
404#define OHCI_QUIRK_AMD_ISO 0x200 /* ISO transfers*/ 404#define OHCI_QUIRK_AMD_ISO 0x200 /* ISO transfers*/
405#define OHCI_QUIRK_AMD_PREFETCH 0x400 /* pre-fetch for ISO transfer */
405 // there are also chip quirks/bugs in init logic 406 // there are also chip quirks/bugs in init logic
406 407
407 struct work_struct nec_work; /* Worker for NEC quirk */ 408 struct work_struct nec_work; /* Worker for NEC quirk */
@@ -433,6 +434,10 @@ static inline int quirk_amdiso(struct ohci_hcd *ohci)
433{ 434{
434 return ohci->flags & OHCI_QUIRK_AMD_ISO; 435 return ohci->flags & OHCI_QUIRK_AMD_ISO;
435} 436}
437static inline int quirk_amdprefetch(struct ohci_hcd *ohci)
438{
439 return ohci->flags & OHCI_QUIRK_AMD_PREFETCH;
440}
436#else 441#else
437static inline int quirk_nec(struct ohci_hcd *ohci) 442static inline int quirk_nec(struct ohci_hcd *ohci)
438{ 443{
@@ -446,6 +451,10 @@ static inline int quirk_amdiso(struct ohci_hcd *ohci)
446{ 451{
447 return 0; 452 return 0;
448} 453}
454static inline int quirk_amdprefetch(struct ohci_hcd *ohci)
455{
456 return 0;
457}
449#endif 458#endif
450 459
451/* convert between an hcd pointer and the corresponding ohci_hcd */ 460/* convert between an hcd pointer and the corresponding ohci_hcd */
diff --git a/drivers/usb/host/sl811_cs.c b/drivers/usb/host/sl811_cs.c
index 516848dd9b48..39d253e841f6 100644
--- a/drivers/usb/host/sl811_cs.c
+++ b/drivers/usb/host/sl811_cs.c
@@ -37,28 +37,8 @@ MODULE_LICENSE("GPL");
37/* MACROS */ 37/* MACROS */
38/*====================================================================*/ 38/*====================================================================*/
39 39
40#if defined(DEBUG) || defined(PCMCIA_DEBUG)
41
42static int pc_debug = 0;
43module_param(pc_debug, int, 0644);
44
45#define DBG(n, args...) if (pc_debug>(n)) printk(KERN_DEBUG "sl811_cs: " args)
46
47#else
48#define DBG(n, args...) do{}while(0)
49#endif /* no debugging */
50
51#define INFO(args...) printk(KERN_INFO "sl811_cs: " args) 40#define INFO(args...) printk(KERN_INFO "sl811_cs: " args)
52 41
53#define INT_MODULE_PARM(n, v) static int n = v; module_param(n, int, 0444)
54
55#define CS_CHECK(fn, ret) \
56 do { \
57 last_fn = (fn); \
58 if ((last_ret = (ret)) != 0) \
59 goto cs_failed; \
60 } while (0)
61
62/*====================================================================*/ 42/*====================================================================*/
63/* VARIABLES */ 43/* VARIABLES */
64/*====================================================================*/ 44/*====================================================================*/
@@ -76,7 +56,7 @@ static void sl811_cs_release(struct pcmcia_device * link);
76 56
77static void release_platform_dev(struct device * dev) 57static void release_platform_dev(struct device * dev)
78{ 58{
79 DBG(0, "sl811_cs platform_dev release\n"); 59 dev_dbg(dev, "sl811_cs platform_dev release\n");
80 dev->parent = NULL; 60 dev->parent = NULL;
81} 61}
82 62
@@ -140,7 +120,7 @@ static int sl811_hc_init(struct device *parent, resource_size_t base_addr,
140 120
141static void sl811_cs_detach(struct pcmcia_device *link) 121static void sl811_cs_detach(struct pcmcia_device *link)
142{ 122{
143 DBG(0, "sl811_cs_detach(0x%p)\n", link); 123 dev_dbg(&link->dev, "sl811_cs_detach\n");
144 124
145 sl811_cs_release(link); 125 sl811_cs_release(link);
146 126
@@ -150,7 +130,7 @@ static void sl811_cs_detach(struct pcmcia_device *link)
150 130
151static void sl811_cs_release(struct pcmcia_device * link) 131static void sl811_cs_release(struct pcmcia_device * link)
152{ 132{
153 DBG(0, "sl811_cs_release(0x%p)\n", link); 133 dev_dbg(&link->dev, "sl811_cs_release\n");
154 134
155 pcmcia_disable_device(link); 135 pcmcia_disable_device(link);
156 platform_device_unregister(&platform_dev); 136 platform_device_unregister(&platform_dev);
@@ -205,11 +185,11 @@ static int sl811_cs_config_check(struct pcmcia_device *p_dev,
205 185
206static int sl811_cs_config(struct pcmcia_device *link) 186static int sl811_cs_config(struct pcmcia_device *link)
207{ 187{
208 struct device *parent = &handle_to_dev(link); 188 struct device *parent = &link->dev;
209 local_info_t *dev = link->priv; 189 local_info_t *dev = link->priv;
210 int last_fn, last_ret; 190 int ret;
211 191
212 DBG(0, "sl811_cs_config(0x%p)\n", link); 192 dev_dbg(&link->dev, "sl811_cs_config\n");
213 193
214 if (pcmcia_loop_config(link, sl811_cs_config_check, NULL)) 194 if (pcmcia_loop_config(link, sl811_cs_config_check, NULL))
215 goto failed; 195 goto failed;
@@ -217,14 +197,16 @@ static int sl811_cs_config(struct pcmcia_device *link)
217 /* require an IRQ and two registers */ 197 /* require an IRQ and two registers */
218 if (!link->io.NumPorts1 || link->io.NumPorts1 < 2) 198 if (!link->io.NumPorts1 || link->io.NumPorts1 < 2)
219 goto failed; 199 goto failed;
220 if (link->conf.Attributes & CONF_ENABLE_IRQ) 200 if (link->conf.Attributes & CONF_ENABLE_IRQ) {
221 CS_CHECK(RequestIRQ, 201 ret = pcmcia_request_irq(link, &link->irq);
222 pcmcia_request_irq(link, &link->irq)); 202 if (ret)
223 else 203 goto failed;
204 } else
224 goto failed; 205 goto failed;
225 206
226 CS_CHECK(RequestConfiguration, 207 ret = pcmcia_request_configuration(link, &link->conf);
227 pcmcia_request_configuration(link, &link->conf)); 208 if (ret)
209 goto failed;
228 210
229 sprintf(dev->node.dev_name, driver_name); 211 sprintf(dev->node.dev_name, driver_name);
230 dev->node.major = dev->node.minor = 0; 212 dev->node.major = dev->node.minor = 0;
@@ -241,8 +223,6 @@ static int sl811_cs_config(struct pcmcia_device *link)
241 223
242 if (sl811_hc_init(parent, link->io.BasePort1, link->irq.AssignedIRQ) 224 if (sl811_hc_init(parent, link->io.BasePort1, link->irq.AssignedIRQ)
243 < 0) { 225 < 0) {
244cs_failed:
245 cs_error(link, last_fn, last_ret);
246failed: 226failed:
247 printk(KERN_WARNING "sl811_cs_config failed\n"); 227 printk(KERN_WARNING "sl811_cs_config failed\n");
248 sl811_cs_release(link); 228 sl811_cs_release(link);
@@ -263,7 +243,6 @@ static int sl811_cs_probe(struct pcmcia_device *link)
263 243
264 /* Initialize */ 244 /* Initialize */
265 link->irq.Attributes = IRQ_TYPE_EXCLUSIVE; 245 link->irq.Attributes = IRQ_TYPE_EXCLUSIVE;
266 link->irq.IRQInfo1 = IRQ_INFO2_VALID|IRQ_LEVEL_ID;
267 link->irq.Handler = NULL; 246 link->irq.Handler = NULL;
268 247
269 link->conf.Attributes = 0; 248 link->conf.Attributes = 0;
diff --git a/drivers/usb/host/xhci-mem.c b/drivers/usb/host/xhci-mem.c
index 1db4fea8c170..b8fd270a8b0d 100644
--- a/drivers/usb/host/xhci-mem.c
+++ b/drivers/usb/host/xhci-mem.c
@@ -802,9 +802,11 @@ void xhci_mem_cleanup(struct xhci_hcd *xhci)
802 int i; 802 int i;
803 803
804 /* Free the Event Ring Segment Table and the actual Event Ring */ 804 /* Free the Event Ring Segment Table and the actual Event Ring */
805 xhci_writel(xhci, 0, &xhci->ir_set->erst_size); 805 if (xhci->ir_set) {
806 xhci_write_64(xhci, 0, &xhci->ir_set->erst_base); 806 xhci_writel(xhci, 0, &xhci->ir_set->erst_size);
807 xhci_write_64(xhci, 0, &xhci->ir_set->erst_dequeue); 807 xhci_write_64(xhci, 0, &xhci->ir_set->erst_base);
808 xhci_write_64(xhci, 0, &xhci->ir_set->erst_dequeue);
809 }
808 size = sizeof(struct xhci_erst_entry)*(xhci->erst.num_entries); 810 size = sizeof(struct xhci_erst_entry)*(xhci->erst.num_entries);
809 if (xhci->erst.entries) 811 if (xhci->erst.entries)
810 pci_free_consistent(pdev, size, 812 pci_free_consistent(pdev, size,
@@ -841,9 +843,9 @@ void xhci_mem_cleanup(struct xhci_hcd *xhci)
841 xhci->dcbaa, xhci->dcbaa->dma); 843 xhci->dcbaa, xhci->dcbaa->dma);
842 xhci->dcbaa = NULL; 844 xhci->dcbaa = NULL;
843 845
846 scratchpad_free(xhci);
844 xhci->page_size = 0; 847 xhci->page_size = 0;
845 xhci->page_shift = 0; 848 xhci->page_shift = 0;
846 scratchpad_free(xhci);
847} 849}
848 850
849int xhci_mem_init(struct xhci_hcd *xhci, gfp_t flags) 851int xhci_mem_init(struct xhci_hcd *xhci, gfp_t flags)
diff --git a/drivers/usb/host/xhci-ring.c b/drivers/usb/host/xhci-ring.c
index 173c39c76489..821b7b4709de 100644
--- a/drivers/usb/host/xhci-ring.c
+++ b/drivers/usb/host/xhci-ring.c
@@ -864,9 +864,11 @@ static struct xhci_segment *trb_in_td(
864 cur_seg = start_seg; 864 cur_seg = start_seg;
865 865
866 do { 866 do {
867 if (start_dma == 0)
868 return 0;
867 /* We may get an event for a Link TRB in the middle of a TD */ 869 /* We may get an event for a Link TRB in the middle of a TD */
868 end_seg_dma = xhci_trb_virt_to_dma(cur_seg, 870 end_seg_dma = xhci_trb_virt_to_dma(cur_seg,
869 &start_seg->trbs[TRBS_PER_SEGMENT - 1]); 871 &cur_seg->trbs[TRBS_PER_SEGMENT - 1]);
870 /* If the end TRB isn't in this segment, this is set to 0 */ 872 /* If the end TRB isn't in this segment, this is set to 0 */
871 end_trb_dma = xhci_trb_virt_to_dma(cur_seg, end_trb); 873 end_trb_dma = xhci_trb_virt_to_dma(cur_seg, end_trb);
872 874
@@ -893,8 +895,9 @@ static struct xhci_segment *trb_in_td(
893 } 895 }
894 cur_seg = cur_seg->next; 896 cur_seg = cur_seg->next;
895 start_dma = xhci_trb_virt_to_dma(cur_seg, &cur_seg->trbs[0]); 897 start_dma = xhci_trb_virt_to_dma(cur_seg, &cur_seg->trbs[0]);
896 } while (1); 898 } while (cur_seg != start_seg);
897 899
900 return 0;
898} 901}
899 902
900/* 903/*
diff --git a/drivers/usb/mon/mon_bin.c b/drivers/usb/mon/mon_bin.c
index 9ed3e741bee1..10f3205798e8 100644
--- a/drivers/usb/mon/mon_bin.c
+++ b/drivers/usb/mon/mon_bin.c
@@ -348,12 +348,12 @@ static unsigned int mon_buff_area_alloc_contiguous(struct mon_reader_bin *rp,
348 348
349/* 349/*
350 * Return a few (kilo-)bytes to the head of the buffer. 350 * Return a few (kilo-)bytes to the head of the buffer.
351 * This is used if a DMA fetch fails. 351 * This is used if a data fetch fails.
352 */ 352 */
353static void mon_buff_area_shrink(struct mon_reader_bin *rp, unsigned int size) 353static void mon_buff_area_shrink(struct mon_reader_bin *rp, unsigned int size)
354{ 354{
355 355
356 size = (size + PKT_ALIGN-1) & ~(PKT_ALIGN-1); 356 /* size &= ~(PKT_ALIGN-1); -- we're called with aligned size */
357 rp->b_cnt -= size; 357 rp->b_cnt -= size;
358 if (rp->b_in < size) 358 if (rp->b_in < size)
359 rp->b_in += rp->b_size; 359 rp->b_in += rp->b_size;
@@ -433,6 +433,7 @@ static void mon_bin_event(struct mon_reader_bin *rp, struct urb *urb,
433 unsigned int urb_length; 433 unsigned int urb_length;
434 unsigned int offset; 434 unsigned int offset;
435 unsigned int length; 435 unsigned int length;
436 unsigned int delta;
436 unsigned int ndesc, lendesc; 437 unsigned int ndesc, lendesc;
437 unsigned char dir; 438 unsigned char dir;
438 struct mon_bin_hdr *ep; 439 struct mon_bin_hdr *ep;
@@ -537,8 +538,10 @@ static void mon_bin_event(struct mon_reader_bin *rp, struct urb *urb,
537 if (length != 0) { 538 if (length != 0) {
538 ep->flag_data = mon_bin_get_data(rp, offset, urb, length); 539 ep->flag_data = mon_bin_get_data(rp, offset, urb, length);
539 if (ep->flag_data != 0) { /* Yes, it's 0x00, not '0' */ 540 if (ep->flag_data != 0) { /* Yes, it's 0x00, not '0' */
540 ep->len_cap = 0; 541 delta = (ep->len_cap + PKT_ALIGN-1) & ~(PKT_ALIGN-1);
541 mon_buff_area_shrink(rp, length); 542 ep->len_cap -= length;
543 delta -= (ep->len_cap + PKT_ALIGN-1) & ~(PKT_ALIGN-1);
544 mon_buff_area_shrink(rp, delta);
542 } 545 }
543 } else { 546 } else {
544 ep->flag_data = data_tag; 547 ep->flag_data = data_tag;
diff --git a/drivers/usb/musb/cppi_dma.c b/drivers/usb/musb/cppi_dma.c
index c3577bbbae6c..ef2332a9941d 100644
--- a/drivers/usb/musb/cppi_dma.c
+++ b/drivers/usb/musb/cppi_dma.c
@@ -1442,11 +1442,6 @@ static int cppi_channel_abort(struct dma_channel *channel)
1442 musb_writew(regs, MUSB_TXCSR, value); 1442 musb_writew(regs, MUSB_TXCSR, value);
1443 musb_writew(regs, MUSB_TXCSR, value); 1443 musb_writew(regs, MUSB_TXCSR, value);
1444 1444
1445 /* re-enable interrupt */
1446 if (enabled)
1447 musb_writel(tibase, DAVINCI_TXCPPI_INTENAB_REG,
1448 (1 << cppi_ch->index));
1449
1450 /* While we scrub the TX state RAM, ensure that we clean 1445 /* While we scrub the TX state RAM, ensure that we clean
1451 * up any interrupt that's currently asserted: 1446 * up any interrupt that's currently asserted:
1452 * 1. Write to completion Ptr value 0x1(bit 0 set) 1447 * 1. Write to completion Ptr value 0x1(bit 0 set)
@@ -1459,6 +1454,11 @@ static int cppi_channel_abort(struct dma_channel *channel)
1459 cppi_reset_tx(tx_ram, 1); 1454 cppi_reset_tx(tx_ram, 1);
1460 musb_writel(&tx_ram->tx_complete, 0, 0); 1455 musb_writel(&tx_ram->tx_complete, 0, 0);
1461 1456
1457 /* re-enable interrupt */
1458 if (enabled)
1459 musb_writel(tibase, DAVINCI_TXCPPI_INTENAB_REG,
1460 (1 << cppi_ch->index));
1461
1462 cppi_dump_tx(5, cppi_ch, " (done teardown)"); 1462 cppi_dump_tx(5, cppi_ch, " (done teardown)");
1463 1463
1464 /* REVISIT tx side _should_ clean up the same way 1464 /* REVISIT tx side _should_ clean up the same way
diff --git a/drivers/usb/musb/musb_core.c b/drivers/usb/musb/musb_core.c
index 3a61ddb62bd2..547e0e390726 100644
--- a/drivers/usb/musb/musb_core.c
+++ b/drivers/usb/musb/musb_core.c
@@ -1450,7 +1450,7 @@ static int __init musb_core_init(u16 musb_type, struct musb *musb)
1450#endif 1450#endif
1451 1451
1452 if (hw_ep->max_packet_sz_tx) { 1452 if (hw_ep->max_packet_sz_tx) {
1453 printk(KERN_DEBUG 1453 DBG(1,
1454 "%s: hw_ep %d%s, %smax %d\n", 1454 "%s: hw_ep %d%s, %smax %d\n",
1455 musb_driver_name, i, 1455 musb_driver_name, i,
1456 hw_ep->is_shared_fifo ? "shared" : "tx", 1456 hw_ep->is_shared_fifo ? "shared" : "tx",
@@ -1459,7 +1459,7 @@ static int __init musb_core_init(u16 musb_type, struct musb *musb)
1459 hw_ep->max_packet_sz_tx); 1459 hw_ep->max_packet_sz_tx);
1460 } 1460 }
1461 if (hw_ep->max_packet_sz_rx && !hw_ep->is_shared_fifo) { 1461 if (hw_ep->max_packet_sz_rx && !hw_ep->is_shared_fifo) {
1462 printk(KERN_DEBUG 1462 DBG(1,
1463 "%s: hw_ep %d%s, %smax %d\n", 1463 "%s: hw_ep %d%s, %smax %d\n",
1464 musb_driver_name, i, 1464 musb_driver_name, i,
1465 "rx", 1465 "rx",
diff --git a/drivers/usb/musb/musb_gadget.c b/drivers/usb/musb/musb_gadget.c
index 8b3c4e2ed7b8..74073f9a43f0 100644
--- a/drivers/usb/musb/musb_gadget.c
+++ b/drivers/usb/musb/musb_gadget.c
@@ -4,6 +4,7 @@
4 * Copyright 2005 Mentor Graphics Corporation 4 * Copyright 2005 Mentor Graphics Corporation
5 * Copyright (C) 2005-2006 by Texas Instruments 5 * Copyright (C) 2005-2006 by Texas Instruments
6 * Copyright (C) 2006-2007 Nokia Corporation 6 * Copyright (C) 2006-2007 Nokia Corporation
7 * Copyright (C) 2009 MontaVista Software, Inc. <source@mvista.com>
7 * 8 *
8 * This program is free software; you can redistribute it and/or 9 * This program is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU General Public License 10 * modify it under the terms of the GNU General Public License
@@ -436,14 +437,6 @@ void musb_g_tx(struct musb *musb, u8 epnum)
436 csr |= MUSB_TXCSR_P_WZC_BITS; 437 csr |= MUSB_TXCSR_P_WZC_BITS;
437 csr &= ~MUSB_TXCSR_P_SENTSTALL; 438 csr &= ~MUSB_TXCSR_P_SENTSTALL;
438 musb_writew(epio, MUSB_TXCSR, csr); 439 musb_writew(epio, MUSB_TXCSR, csr);
439 if (dma_channel_status(dma) == MUSB_DMA_STATUS_BUSY) {
440 dma->status = MUSB_DMA_STATUS_CORE_ABORT;
441 musb->dma_controller->channel_abort(dma);
442 }
443
444 if (request)
445 musb_g_giveback(musb_ep, request, -EPIPE);
446
447 break; 440 break;
448 } 441 }
449 442
@@ -582,15 +575,25 @@ void musb_g_tx(struct musb *musb, u8 epnum)
582 */ 575 */
583static void rxstate(struct musb *musb, struct musb_request *req) 576static void rxstate(struct musb *musb, struct musb_request *req)
584{ 577{
585 u16 csr = 0;
586 const u8 epnum = req->epnum; 578 const u8 epnum = req->epnum;
587 struct usb_request *request = &req->request; 579 struct usb_request *request = &req->request;
588 struct musb_ep *musb_ep = &musb->endpoints[epnum].ep_out; 580 struct musb_ep *musb_ep = &musb->endpoints[epnum].ep_out;
589 void __iomem *epio = musb->endpoints[epnum].regs; 581 void __iomem *epio = musb->endpoints[epnum].regs;
590 unsigned fifo_count = 0; 582 unsigned fifo_count = 0;
591 u16 len = musb_ep->packet_sz; 583 u16 len = musb_ep->packet_sz;
584 u16 csr = musb_readw(epio, MUSB_RXCSR);
592 585
593 csr = musb_readw(epio, MUSB_RXCSR); 586 /* We shouldn't get here while DMA is active, but we do... */
587 if (dma_channel_status(musb_ep->dma) == MUSB_DMA_STATUS_BUSY) {
588 DBG(4, "DMA pending...\n");
589 return;
590 }
591
592 if (csr & MUSB_RXCSR_P_SENDSTALL) {
593 DBG(5, "%s stalling, RXCSR %04x\n",
594 musb_ep->end_point.name, csr);
595 return;
596 }
594 597
595 if (is_cppi_enabled() && musb_ep->dma) { 598 if (is_cppi_enabled() && musb_ep->dma) {
596 struct dma_controller *c = musb->dma_controller; 599 struct dma_controller *c = musb->dma_controller;
@@ -761,19 +764,10 @@ void musb_g_rx(struct musb *musb, u8 epnum)
761 csr, dma ? " (dma)" : "", request); 764 csr, dma ? " (dma)" : "", request);
762 765
763 if (csr & MUSB_RXCSR_P_SENTSTALL) { 766 if (csr & MUSB_RXCSR_P_SENTSTALL) {
764 if (dma_channel_status(dma) == MUSB_DMA_STATUS_BUSY) {
765 dma->status = MUSB_DMA_STATUS_CORE_ABORT;
766 (void) musb->dma_controller->channel_abort(dma);
767 request->actual += musb_ep->dma->actual_len;
768 }
769
770 csr |= MUSB_RXCSR_P_WZC_BITS; 767 csr |= MUSB_RXCSR_P_WZC_BITS;
771 csr &= ~MUSB_RXCSR_P_SENTSTALL; 768 csr &= ~MUSB_RXCSR_P_SENTSTALL;
772 musb_writew(epio, MUSB_RXCSR, csr); 769 musb_writew(epio, MUSB_RXCSR, csr);
773 770 return;
774 if (request)
775 musb_g_giveback(musb_ep, request, -EPIPE);
776 goto done;
777 } 771 }
778 772
779 if (csr & MUSB_RXCSR_P_OVERRUN) { 773 if (csr & MUSB_RXCSR_P_OVERRUN) {
@@ -795,7 +789,7 @@ void musb_g_rx(struct musb *musb, u8 epnum)
795 DBG((csr & MUSB_RXCSR_DMAENAB) ? 4 : 1, 789 DBG((csr & MUSB_RXCSR_DMAENAB) ? 4 : 1,
796 "%s busy, csr %04x\n", 790 "%s busy, csr %04x\n",
797 musb_ep->end_point.name, csr); 791 musb_ep->end_point.name, csr);
798 goto done; 792 return;
799 } 793 }
800 794
801 if (dma && (csr & MUSB_RXCSR_DMAENAB)) { 795 if (dma && (csr & MUSB_RXCSR_DMAENAB)) {
@@ -826,22 +820,15 @@ void musb_g_rx(struct musb *musb, u8 epnum)
826 if ((request->actual < request->length) 820 if ((request->actual < request->length)
827 && (musb_ep->dma->actual_len 821 && (musb_ep->dma->actual_len
828 == musb_ep->packet_sz)) 822 == musb_ep->packet_sz))
829 goto done; 823 return;
830#endif 824#endif
831 musb_g_giveback(musb_ep, request, 0); 825 musb_g_giveback(musb_ep, request, 0);
832 826
833 request = next_request(musb_ep); 827 request = next_request(musb_ep);
834 if (!request) 828 if (!request)
835 goto done; 829 return;
836
837 /* don't start more i/o till the stall clears */
838 musb_ep_select(mbase, epnum);
839 csr = musb_readw(epio, MUSB_RXCSR);
840 if (csr & MUSB_RXCSR_P_SENDSTALL)
841 goto done;
842 } 830 }
843 831
844
845 /* analyze request if the ep is hot */ 832 /* analyze request if the ep is hot */
846 if (request) 833 if (request)
847 rxstate(musb, to_musb_request(request)); 834 rxstate(musb, to_musb_request(request));
@@ -849,8 +836,6 @@ void musb_g_rx(struct musb *musb, u8 epnum)
849 DBG(3, "packet waiting for %s%s request\n", 836 DBG(3, "packet waiting for %s%s request\n",
850 musb_ep->desc ? "" : "inactive ", 837 musb_ep->desc ? "" : "inactive ",
851 musb_ep->end_point.name); 838 musb_ep->end_point.name);
852
853done:
854 return; 839 return;
855} 840}
856 841
@@ -1244,7 +1229,7 @@ int musb_gadget_set_halt(struct usb_ep *ep, int value)
1244 void __iomem *mbase; 1229 void __iomem *mbase;
1245 unsigned long flags; 1230 unsigned long flags;
1246 u16 csr; 1231 u16 csr;
1247 struct musb_request *request = NULL; 1232 struct musb_request *request;
1248 int status = 0; 1233 int status = 0;
1249 1234
1250 if (!ep) 1235 if (!ep)
@@ -1260,24 +1245,29 @@ int musb_gadget_set_halt(struct usb_ep *ep, int value)
1260 1245
1261 musb_ep_select(mbase, epnum); 1246 musb_ep_select(mbase, epnum);
1262 1247
1263 /* cannot portably stall with non-empty FIFO */
1264 request = to_musb_request(next_request(musb_ep)); 1248 request = to_musb_request(next_request(musb_ep));
1265 if (value && musb_ep->is_in) { 1249 if (value) {
1266 csr = musb_readw(epio, MUSB_TXCSR); 1250 if (request) {
1267 if (csr & MUSB_TXCSR_FIFONOTEMPTY) { 1251 DBG(3, "request in progress, cannot halt %s\n",
1268 DBG(3, "%s fifo busy, cannot halt\n", ep->name); 1252 ep->name);
1269 spin_unlock_irqrestore(&musb->lock, flags); 1253 status = -EAGAIN;
1270 return -EAGAIN; 1254 goto done;
1255 }
1256 /* Cannot portably stall with non-empty FIFO */
1257 if (musb_ep->is_in) {
1258 csr = musb_readw(epio, MUSB_TXCSR);
1259 if (csr & MUSB_TXCSR_FIFONOTEMPTY) {
1260 DBG(3, "FIFO busy, cannot halt %s\n", ep->name);
1261 status = -EAGAIN;
1262 goto done;
1263 }
1271 } 1264 }
1272
1273 } 1265 }
1274 1266
1275 /* set/clear the stall and toggle bits */ 1267 /* set/clear the stall and toggle bits */
1276 DBG(2, "%s: %s stall\n", ep->name, value ? "set" : "clear"); 1268 DBG(2, "%s: %s stall\n", ep->name, value ? "set" : "clear");
1277 if (musb_ep->is_in) { 1269 if (musb_ep->is_in) {
1278 csr = musb_readw(epio, MUSB_TXCSR); 1270 csr = musb_readw(epio, MUSB_TXCSR);
1279 if (csr & MUSB_TXCSR_FIFONOTEMPTY)
1280 csr |= MUSB_TXCSR_FLUSHFIFO;
1281 csr |= MUSB_TXCSR_P_WZC_BITS 1271 csr |= MUSB_TXCSR_P_WZC_BITS
1282 | MUSB_TXCSR_CLRDATATOG; 1272 | MUSB_TXCSR_CLRDATATOG;
1283 if (value) 1273 if (value)
@@ -1300,14 +1290,13 @@ int musb_gadget_set_halt(struct usb_ep *ep, int value)
1300 musb_writew(epio, MUSB_RXCSR, csr); 1290 musb_writew(epio, MUSB_RXCSR, csr);
1301 } 1291 }
1302 1292
1303done:
1304
1305 /* maybe start the first request in the queue */ 1293 /* maybe start the first request in the queue */
1306 if (!musb_ep->busy && !value && request) { 1294 if (!musb_ep->busy && !value && request) {
1307 DBG(3, "restarting the request\n"); 1295 DBG(3, "restarting the request\n");
1308 musb_ep_restart(musb, request); 1296 musb_ep_restart(musb, request);
1309 } 1297 }
1310 1298
1299done:
1311 spin_unlock_irqrestore(&musb->lock, flags); 1300 spin_unlock_irqrestore(&musb->lock, flags);
1312 return status; 1301 return status;
1313} 1302}
diff --git a/drivers/usb/musb/musb_gadget_ep0.c b/drivers/usb/musb/musb_gadget_ep0.c
index 7a6778675ad3..522efb31b56b 100644
--- a/drivers/usb/musb/musb_gadget_ep0.c
+++ b/drivers/usb/musb/musb_gadget_ep0.c
@@ -511,7 +511,8 @@ static void ep0_txstate(struct musb *musb)
511 511
512 /* update the flags */ 512 /* update the flags */
513 if (fifo_count < MUSB_MAX_END0_PACKET 513 if (fifo_count < MUSB_MAX_END0_PACKET
514 || request->actual == request->length) { 514 || (request->actual == request->length
515 && !request->zero)) {
515 musb->ep0_state = MUSB_EP0_STAGE_STATUSOUT; 516 musb->ep0_state = MUSB_EP0_STAGE_STATUSOUT;
516 csr |= MUSB_CSR0_P_DATAEND; 517 csr |= MUSB_CSR0_P_DATAEND;
517 } else 518 } else
diff --git a/drivers/usb/musb/musb_host.c b/drivers/usb/musb/musb_host.c
index cf94511485f2..e3ab40a966eb 100644
--- a/drivers/usb/musb/musb_host.c
+++ b/drivers/usb/musb/musb_host.c
@@ -1301,8 +1301,11 @@ void musb_host_tx(struct musb *musb, u8 epnum)
1301 return; 1301 return;
1302 } else if (usb_pipeisoc(pipe) && dma) { 1302 } else if (usb_pipeisoc(pipe) && dma) {
1303 if (musb_tx_dma_program(musb->dma_controller, hw_ep, qh, urb, 1303 if (musb_tx_dma_program(musb->dma_controller, hw_ep, qh, urb,
1304 offset, length)) 1304 offset, length)) {
1305 if (is_cppi_enabled() || tusb_dma_omap())
1306 musb_h_tx_dma_start(hw_ep);
1305 return; 1307 return;
1308 }
1306 } else if (tx_csr & MUSB_TXCSR_DMAENAB) { 1309 } else if (tx_csr & MUSB_TXCSR_DMAENAB) {
1307 DBG(1, "not complete, but DMA enabled?\n"); 1310 DBG(1, "not complete, but DMA enabled?\n");
1308 return; 1311 return;
diff --git a/drivers/usb/serial/cp210x.c b/drivers/usb/serial/cp210x.c
index 698252a4dc5d..bd254ec97d14 100644
--- a/drivers/usb/serial/cp210x.c
+++ b/drivers/usb/serial/cp210x.c
@@ -50,6 +50,8 @@ static int cp210x_tiocmset_port(struct usb_serial_port *port, struct file *,
50static void cp210x_break_ctl(struct tty_struct *, int); 50static void cp210x_break_ctl(struct tty_struct *, int);
51static int cp210x_startup(struct usb_serial *); 51static int cp210x_startup(struct usb_serial *);
52static void cp210x_disconnect(struct usb_serial *); 52static void cp210x_disconnect(struct usb_serial *);
53static void cp210x_dtr_rts(struct usb_serial_port *p, int on);
54static int cp210x_carrier_raised(struct usb_serial_port *p);
53 55
54static int debug; 56static int debug;
55 57
@@ -143,6 +145,8 @@ static struct usb_serial_driver cp210x_device = {
143 .tiocmset = cp210x_tiocmset, 145 .tiocmset = cp210x_tiocmset,
144 .attach = cp210x_startup, 146 .attach = cp210x_startup,
145 .disconnect = cp210x_disconnect, 147 .disconnect = cp210x_disconnect,
148 .dtr_rts = cp210x_dtr_rts,
149 .carrier_raised = cp210x_carrier_raised
146}; 150};
147 151
148/* Config request types */ 152/* Config request types */
@@ -746,6 +750,14 @@ static int cp210x_tiocmset_port(struct usb_serial_port *port, struct file *file,
746 return cp210x_set_config(port, CP210X_SET_MHS, &control, 2); 750 return cp210x_set_config(port, CP210X_SET_MHS, &control, 2);
747} 751}
748 752
753static void cp210x_dtr_rts(struct usb_serial_port *p, int on)
754{
755 if (on)
756 cp210x_tiocmset_port(p, NULL, TIOCM_DTR|TIOCM_RTS, 0);
757 else
758 cp210x_tiocmset_port(p, NULL, 0, TIOCM_DTR|TIOCM_RTS);
759}
760
749static int cp210x_tiocmget (struct tty_struct *tty, struct file *file) 761static int cp210x_tiocmget (struct tty_struct *tty, struct file *file)
750{ 762{
751 struct usb_serial_port *port = tty->driver_data; 763 struct usb_serial_port *port = tty->driver_data;
@@ -768,6 +780,15 @@ static int cp210x_tiocmget (struct tty_struct *tty, struct file *file)
768 return result; 780 return result;
769} 781}
770 782
783static int cp210x_carrier_raised(struct usb_serial_port *p)
784{
785 unsigned int control;
786 cp210x_get_config(p, CP210X_GET_MDMSTS, &control, 1);
787 if (control & CONTROL_DCD)
788 return 1;
789 return 0;
790}
791
771static void cp210x_break_ctl (struct tty_struct *tty, int break_state) 792static void cp210x_break_ctl (struct tty_struct *tty, int break_state)
772{ 793{
773 struct usb_serial_port *port = tty->driver_data; 794 struct usb_serial_port *port = tty->driver_data;
diff --git a/drivers/usb/serial/ftdi_sio.c b/drivers/usb/serial/ftdi_sio.c
index 9c60d6d4908a..ebcc6d0e2e91 100644
--- a/drivers/usb/serial/ftdi_sio.c
+++ b/drivers/usb/serial/ftdi_sio.c
@@ -1937,7 +1937,7 @@ static void ftdi_write_bulk_callback(struct urb *urb)
1937 return; 1937 return;
1938 } 1938 }
1939 /* account for transferred data */ 1939 /* account for transferred data */
1940 countback = urb->actual_length; 1940 countback = urb->transfer_buffer_length;
1941 data_offset = priv->write_offset; 1941 data_offset = priv->write_offset;
1942 if (data_offset > 0) { 1942 if (data_offset > 0) {
1943 /* Subtract the control bytes */ 1943 /* Subtract the control bytes */
@@ -1950,7 +1950,6 @@ static void ftdi_write_bulk_callback(struct urb *urb)
1950 1950
1951 if (status) { 1951 if (status) {
1952 dbg("nonzero write bulk status received: %d", status); 1952 dbg("nonzero write bulk status received: %d", status);
1953 return;
1954 } 1953 }
1955 1954
1956 usb_serial_port_softint(port); 1955 usb_serial_port_softint(port);
diff --git a/drivers/usb/serial/option.c b/drivers/usb/serial/option.c
index cd44c68954df..0577e4b61114 100644
--- a/drivers/usb/serial/option.c
+++ b/drivers/usb/serial/option.c
@@ -308,6 +308,7 @@ static int option_resume(struct usb_serial *serial);
308 308
309#define DLINK_VENDOR_ID 0x1186 309#define DLINK_VENDOR_ID 0x1186
310#define DLINK_PRODUCT_DWM_652 0x3e04 310#define DLINK_PRODUCT_DWM_652 0x3e04
311#define DLINK_PRODUCT_DWM_652_U5 0xce16
311 312
312#define QISDA_VENDOR_ID 0x1da5 313#define QISDA_VENDOR_ID 0x1da5
313#define QISDA_PRODUCT_H21_4512 0x4512 314#define QISDA_PRODUCT_H21_4512 0x4512
@@ -335,6 +336,10 @@ static int option_resume(struct usb_serial *serial);
335#define AIRPLUS_VENDOR_ID 0x1011 336#define AIRPLUS_VENDOR_ID 0x1011
336#define AIRPLUS_PRODUCT_MCD650 0x3198 337#define AIRPLUS_PRODUCT_MCD650 0x3198
337 338
339/* 4G Systems products */
340#define FOUR_G_SYSTEMS_VENDOR_ID 0x1c9e
341#define FOUR_G_SYSTEMS_PRODUCT_W14 0x9603
342
338static struct usb_device_id option_ids[] = { 343static struct usb_device_id option_ids[] = {
339 { USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_COLT) }, 344 { USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_COLT) },
340 { USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_RICOLA) }, 345 { USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_RICOLA) },
@@ -586,6 +591,7 @@ static struct usb_device_id option_ids[] = {
586 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, ZTE_PRODUCT_AC2726, 0xff, 0xff, 0xff) }, 591 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, ZTE_PRODUCT_AC2726, 0xff, 0xff, 0xff) },
587 { USB_DEVICE(BENQ_VENDOR_ID, BENQ_PRODUCT_H10) }, 592 { USB_DEVICE(BENQ_VENDOR_ID, BENQ_PRODUCT_H10) },
588 { USB_DEVICE(DLINK_VENDOR_ID, DLINK_PRODUCT_DWM_652) }, 593 { USB_DEVICE(DLINK_VENDOR_ID, DLINK_PRODUCT_DWM_652) },
594 { USB_DEVICE(ALINK_VENDOR_ID, DLINK_PRODUCT_DWM_652_U5) }, /* Yes, ALINK_VENDOR_ID */
589 { USB_DEVICE(QISDA_VENDOR_ID, QISDA_PRODUCT_H21_4512) }, 595 { USB_DEVICE(QISDA_VENDOR_ID, QISDA_PRODUCT_H21_4512) },
590 { USB_DEVICE(QISDA_VENDOR_ID, QISDA_PRODUCT_H21_4523) }, 596 { USB_DEVICE(QISDA_VENDOR_ID, QISDA_PRODUCT_H21_4523) },
591 { USB_DEVICE(QISDA_VENDOR_ID, QISDA_PRODUCT_H20_4515) }, 597 { USB_DEVICE(QISDA_VENDOR_ID, QISDA_PRODUCT_H20_4515) },
@@ -597,6 +603,7 @@ static struct usb_device_id option_ids[] = {
597 { USB_DEVICE(ALCATEL_VENDOR_ID, ALCATEL_PRODUCT_X060S) }, 603 { USB_DEVICE(ALCATEL_VENDOR_ID, ALCATEL_PRODUCT_X060S) },
598 { USB_DEVICE(AIRPLUS_VENDOR_ID, AIRPLUS_PRODUCT_MCD650) }, 604 { USB_DEVICE(AIRPLUS_VENDOR_ID, AIRPLUS_PRODUCT_MCD650) },
599 { USB_DEVICE(TLAYTECH_VENDOR_ID, TLAYTECH_PRODUCT_TEU800) }, 605 { USB_DEVICE(TLAYTECH_VENDOR_ID, TLAYTECH_PRODUCT_TEU800) },
606 { USB_DEVICE(FOUR_G_SYSTEMS_VENDOR_ID, FOUR_G_SYSTEMS_PRODUCT_W14) },
600 { } /* Terminating entry */ 607 { } /* Terminating entry */
601}; 608};
602MODULE_DEVICE_TABLE(usb, option_ids); 609MODULE_DEVICE_TABLE(usb, option_ids);
diff --git a/drivers/video/Kconfig b/drivers/video/Kconfig
index 9bbb2855ea91..188e1ba3b69f 100644
--- a/drivers/video/Kconfig
+++ b/drivers/video/Kconfig
@@ -2121,7 +2121,7 @@ config FB_EP93XX
2121 2121
2122config FB_PRE_INIT_FB 2122config FB_PRE_INIT_FB
2123 bool "Don't reinitialize, use bootloader's GDC/Display configuration" 2123 bool "Don't reinitialize, use bootloader's GDC/Display configuration"
2124 depends on FB_MB862XX_LIME 2124 depends on FB && FB_MB862XX_LIME
2125 ---help--- 2125 ---help---
2126 Select this option if display contents should be inherited as set by 2126 Select this option if display contents should be inherited as set by
2127 the bootloader. 2127 the bootloader.
diff --git a/drivers/video/atafb.c b/drivers/video/atafb.c
index 8cd279be74e5..37624f74e88b 100644
--- a/drivers/video/atafb.c
+++ b/drivers/video/atafb.c
@@ -329,12 +329,6 @@ extern unsigned char fontdata_8x16[];
329 * 329 *
330 * * perform fb specific mmap * 330 * * perform fb specific mmap *
331 * int (*fb_mmap)(struct fb_info *info, struct vm_area_struct *vma); 331 * int (*fb_mmap)(struct fb_info *info, struct vm_area_struct *vma);
332 *
333 * * save current hardware state *
334 * void (*fb_save_state)(struct fb_info *info);
335 *
336 * * restore saved state *
337 * void (*fb_restore_state)(struct fb_info *info);
338 * } ; 332 * } ;
339 */ 333 */
340 334
diff --git a/drivers/video/atmel_lcdfb.c b/drivers/video/atmel_lcdfb.c
index 2830ffd72976..d5e801076d33 100644
--- a/drivers/video/atmel_lcdfb.c
+++ b/drivers/video/atmel_lcdfb.c
@@ -484,6 +484,7 @@ static int atmel_lcdfb_set_par(struct fb_info *info)
484 unsigned long value; 484 unsigned long value;
485 unsigned long clk_value_khz; 485 unsigned long clk_value_khz;
486 unsigned long bits_per_line; 486 unsigned long bits_per_line;
487 unsigned long pix_factor = 2;
487 488
488 might_sleep(); 489 might_sleep();
489 490
@@ -516,20 +517,24 @@ static int atmel_lcdfb_set_par(struct fb_info *info)
516 /* Now, the LCDC core... */ 517 /* Now, the LCDC core... */
517 518
518 /* Set pixel clock */ 519 /* Set pixel clock */
520 if (cpu_is_at91sam9g45() && !cpu_is_at91sam9g45es())
521 pix_factor = 1;
522
519 clk_value_khz = clk_get_rate(sinfo->lcdc_clk) / 1000; 523 clk_value_khz = clk_get_rate(sinfo->lcdc_clk) / 1000;
520 524
521 value = DIV_ROUND_UP(clk_value_khz, PICOS2KHZ(info->var.pixclock)); 525 value = DIV_ROUND_UP(clk_value_khz, PICOS2KHZ(info->var.pixclock));
522 526
523 if (value < 2) { 527 if (value < pix_factor) {
524 dev_notice(info->device, "Bypassing pixel clock divider\n"); 528 dev_notice(info->device, "Bypassing pixel clock divider\n");
525 lcdc_writel(sinfo, ATMEL_LCDC_LCDCON1, ATMEL_LCDC_BYPASS); 529 lcdc_writel(sinfo, ATMEL_LCDC_LCDCON1, ATMEL_LCDC_BYPASS);
526 } else { 530 } else {
527 value = (value / 2) - 1; 531 value = (value / pix_factor) - 1;
528 dev_dbg(info->device, " * programming CLKVAL = 0x%08lx\n", 532 dev_dbg(info->device, " * programming CLKVAL = 0x%08lx\n",
529 value); 533 value);
530 lcdc_writel(sinfo, ATMEL_LCDC_LCDCON1, 534 lcdc_writel(sinfo, ATMEL_LCDC_LCDCON1,
531 value << ATMEL_LCDC_CLKVAL_OFFSET); 535 value << ATMEL_LCDC_CLKVAL_OFFSET);
532 info->var.pixclock = KHZ2PICOS(clk_value_khz / (2 * (value + 1))); 536 info->var.pixclock =
537 KHZ2PICOS(clk_value_khz / (pix_factor * (value + 1)));
533 dev_dbg(info->device, " updated pixclk: %lu KHz\n", 538 dev_dbg(info->device, " updated pixclk: %lu KHz\n",
534 PICOS2KHZ(info->var.pixclock)); 539 PICOS2KHZ(info->var.pixclock));
535 } 540 }
diff --git a/drivers/video/backlight/corgi_lcd.c b/drivers/video/backlight/corgi_lcd.c
index 2211a852af9c..96774949cd30 100644
--- a/drivers/video/backlight/corgi_lcd.c
+++ b/drivers/video/backlight/corgi_lcd.c
@@ -433,8 +433,9 @@ static int corgi_bl_update_status(struct backlight_device *bd)
433 433
434 if (corgibl_flags & CORGIBL_SUSPENDED) 434 if (corgibl_flags & CORGIBL_SUSPENDED)
435 intensity = 0; 435 intensity = 0;
436 if (corgibl_flags & CORGIBL_BATTLOW) 436
437 intensity &= lcd->limit_mask; 437 if ((corgibl_flags & CORGIBL_BATTLOW) && intensity > lcd->limit_mask)
438 intensity = lcd->limit_mask;
438 439
439 return corgi_bl_set_intensity(lcd, intensity); 440 return corgi_bl_set_intensity(lcd, intensity);
440} 441}
diff --git a/drivers/video/backlight/lcd.c b/drivers/video/backlight/lcd.c
index b6449470106c..a482dd7b0311 100644
--- a/drivers/video/backlight/lcd.c
+++ b/drivers/video/backlight/lcd.c
@@ -56,7 +56,7 @@ static int fb_notifier_callback(struct notifier_block *self,
56 56
57static int lcd_register_fb(struct lcd_device *ld) 57static int lcd_register_fb(struct lcd_device *ld)
58{ 58{
59 memset(&ld->fb_notif, 0, sizeof(&ld->fb_notif)); 59 memset(&ld->fb_notif, 0, sizeof(ld->fb_notif));
60 ld->fb_notif.notifier_call = fb_notifier_callback; 60 ld->fb_notif.notifier_call = fb_notifier_callback;
61 return fb_register_client(&ld->fb_notif); 61 return fb_register_client(&ld->fb_notif);
62} 62}
diff --git a/drivers/video/console/fbcon.c b/drivers/video/console/fbcon.c
index 5a686cea23f4..3681c6a88212 100644
--- a/drivers/video/console/fbcon.c
+++ b/drivers/video/console/fbcon.c
@@ -2311,14 +2311,11 @@ static int fbcon_blank(struct vc_data *vc, int blank, int mode_switch)
2311 ops->graphics = 1; 2311 ops->graphics = 1;
2312 2312
2313 if (!blank) { 2313 if (!blank) {
2314 if (info->fbops->fb_save_state)
2315 info->fbops->fb_save_state(info);
2316 var.activate = FB_ACTIVATE_NOW | FB_ACTIVATE_FORCE; 2314 var.activate = FB_ACTIVATE_NOW | FB_ACTIVATE_FORCE;
2317 fb_set_var(info, &var); 2315 fb_set_var(info, &var);
2318 ops->graphics = 0; 2316 ops->graphics = 0;
2319 ops->var = info->var; 2317 ops->var = info->var;
2320 } else if (info->fbops->fb_restore_state) 2318 }
2321 info->fbops->fb_restore_state(info);
2322 } 2319 }
2323 2320
2324 if (!fbcon_is_inactive(vc, info)) { 2321 if (!fbcon_is_inactive(vc, info)) {
diff --git a/drivers/video/da8xx-fb.c b/drivers/video/da8xx-fb.c
index d065894ce38f..ea1fd3f47511 100644
--- a/drivers/video/da8xx-fb.c
+++ b/drivers/video/da8xx-fb.c
@@ -554,11 +554,11 @@ static int fb_check_var(struct fb_var_screeninfo *var,
554 var->transp.length = 0; 554 var->transp.length = 0;
555 break; 555 break;
556 case 16: /* RGB 565 */ 556 case 16: /* RGB 565 */
557 var->red.offset = 0; 557 var->red.offset = 11;
558 var->red.length = 5; 558 var->red.length = 5;
559 var->green.offset = 5; 559 var->green.offset = 5;
560 var->green.length = 6; 560 var->green.length = 6;
561 var->blue.offset = 11; 561 var->blue.offset = 0;
562 var->blue.length = 5; 562 var->blue.length = 5;
563 var->transp.offset = 0; 563 var->transp.offset = 0;
564 var->transp.length = 0; 564 var->transp.length = 0;
@@ -591,7 +591,7 @@ static int __devexit fb_remove(struct platform_device *dev)
591 unregister_framebuffer(info); 591 unregister_framebuffer(info);
592 fb_dealloc_cmap(&info->cmap); 592 fb_dealloc_cmap(&info->cmap);
593 dma_free_coherent(NULL, par->databuf_sz + PAGE_SIZE, 593 dma_free_coherent(NULL, par->databuf_sz + PAGE_SIZE,
594 info->screen_base, 594 info->screen_base - PAGE_SIZE,
595 info->fix.smem_start); 595 info->fix.smem_start);
596 free_irq(par->irq, par); 596 free_irq(par->irq, par);
597 clk_disable(par->lcdc_clk); 597 clk_disable(par->lcdc_clk);
@@ -704,7 +704,7 @@ static int __init fb_probe(struct platform_device *device)
704 704
705 if (i == ARRAY_SIZE(known_lcd_panels)) { 705 if (i == ARRAY_SIZE(known_lcd_panels)) {
706 dev_err(&device->dev, "GLCD: No valid panel found\n"); 706 dev_err(&device->dev, "GLCD: No valid panel found\n");
707 ret = ENODEV; 707 ret = -ENODEV;
708 goto err_clk_disable; 708 goto err_clk_disable;
709 } else 709 } else
710 dev_info(&device->dev, "GLCD: Found %s panel\n", 710 dev_info(&device->dev, "GLCD: Found %s panel\n",
@@ -749,6 +749,7 @@ static int __init fb_probe(struct platform_device *device)
749 (PAGE_SIZE - par->palette_sz); 749 (PAGE_SIZE - par->palette_sz);
750 750
751 /* the rest of the frame buffer is pixel data */ 751 /* the rest of the frame buffer is pixel data */
752 da8xx_fb_info->screen_base = par->v_palette_base + par->palette_sz;
752 da8xx_fb_fix.smem_start = par->p_palette_base + par->palette_sz; 753 da8xx_fb_fix.smem_start = par->p_palette_base + par->palette_sz;
753 da8xx_fb_fix.smem_len = par->databuf_sz - par->palette_sz; 754 da8xx_fb_fix.smem_len = par->databuf_sz - par->palette_sz;
754 da8xx_fb_fix.line_length = (lcdc_info->width * lcd_cfg->bpp) / 8; 755 da8xx_fb_fix.line_length = (lcdc_info->width * lcd_cfg->bpp) / 8;
@@ -787,6 +788,8 @@ static int __init fb_probe(struct platform_device *device)
787 da8xx_fb_info->var = da8xx_fb_var; 788 da8xx_fb_info->var = da8xx_fb_var;
788 da8xx_fb_info->fbops = &da8xx_fb_ops; 789 da8xx_fb_info->fbops = &da8xx_fb_ops;
789 da8xx_fb_info->pseudo_palette = par->pseudo_palette; 790 da8xx_fb_info->pseudo_palette = par->pseudo_palette;
791 da8xx_fb_info->fix.visual = (da8xx_fb_info->var.bits_per_pixel <= 8) ?
792 FB_VISUAL_PSEUDOCOLOR : FB_VISUAL_TRUECOLOR;
790 793
791 ret = fb_alloc_cmap(&da8xx_fb_info->cmap, PALETTE_SIZE, 0); 794 ret = fb_alloc_cmap(&da8xx_fb_info->cmap, PALETTE_SIZE, 0);
792 if (ret) 795 if (ret)
@@ -825,7 +828,7 @@ err_free_irq:
825 828
826err_release_fb_mem: 829err_release_fb_mem:
827 dma_free_coherent(NULL, par->databuf_sz + PAGE_SIZE, 830 dma_free_coherent(NULL, par->databuf_sz + PAGE_SIZE,
828 da8xx_fb_info->screen_base, 831 da8xx_fb_info->screen_base - PAGE_SIZE,
829 da8xx_fb_info->fix.smem_start); 832 da8xx_fb_info->fix.smem_start);
830 833
831err_release_fb: 834err_release_fb:
diff --git a/drivers/video/gbefb.c b/drivers/video/gbefb.c
index 1a83709f9611..f67db4268374 100644
--- a/drivers/video/gbefb.c
+++ b/drivers/video/gbefb.c
@@ -1147,7 +1147,7 @@ static int __init gbefb_probe(struct platform_device *p_dev)
1147 gbefb_setup(options); 1147 gbefb_setup(options);
1148#endif 1148#endif
1149 1149
1150 if (!request_region(GBE_BASE, sizeof(struct sgi_gbe), "GBE")) { 1150 if (!request_mem_region(GBE_BASE, sizeof(struct sgi_gbe), "GBE")) {
1151 printk(KERN_ERR "gbefb: couldn't reserve mmio region\n"); 1151 printk(KERN_ERR "gbefb: couldn't reserve mmio region\n");
1152 ret = -EBUSY; 1152 ret = -EBUSY;
1153 goto out_release_framebuffer; 1153 goto out_release_framebuffer;
diff --git a/drivers/video/msm/mddi.c b/drivers/video/msm/mddi.c
index 5c5a1ad1d397..474421fe79a6 100644
--- a/drivers/video/msm/mddi.c
+++ b/drivers/video/msm/mddi.c
@@ -24,6 +24,7 @@
24#include <linux/spinlock.h> 24#include <linux/spinlock.h>
25#include <linux/clk.h> 25#include <linux/clk.h>
26#include <linux/io.h> 26#include <linux/io.h>
27#include <linux/sched.h>
27#include <mach/msm_iomap.h> 28#include <mach/msm_iomap.h>
28#include <mach/irqs.h> 29#include <mach/irqs.h>
29#include <mach/board.h> 30#include <mach/board.h>
diff --git a/drivers/video/msm/mddi_client_nt35399.c b/drivers/video/msm/mddi_client_nt35399.c
index 9c78050ac799..c9e9349451cb 100644
--- a/drivers/video/msm/mddi_client_nt35399.c
+++ b/drivers/video/msm/mddi_client_nt35399.c
@@ -19,6 +19,7 @@
19#include <linux/kernel.h> 19#include <linux/kernel.h>
20#include <linux/platform_device.h> 20#include <linux/platform_device.h>
21#include <linux/interrupt.h> 21#include <linux/interrupt.h>
22#include <linux/sched.h>
22#include <linux/gpio.h> 23#include <linux/gpio.h>
23#include <mach/msm_fb.h> 24#include <mach/msm_fb.h>
24 25
diff --git a/drivers/video/msm/mddi_client_toshiba.c b/drivers/video/msm/mddi_client_toshiba.c
index 80d0f5fdf0b1..71048e78f7f0 100644
--- a/drivers/video/msm/mddi_client_toshiba.c
+++ b/drivers/video/msm/mddi_client_toshiba.c
@@ -20,6 +20,7 @@
20#include <linux/platform_device.h> 20#include <linux/platform_device.h>
21#include <linux/interrupt.h> 21#include <linux/interrupt.h>
22#include <linux/gpio.h> 22#include <linux/gpio.h>
23#include <linux/sched.h>
23#include <mach/msm_fb.h> 24#include <mach/msm_fb.h>
24 25
25 26
diff --git a/drivers/video/msm/mdp.c b/drivers/video/msm/mdp.c
index 99636a2b20f2..6c519e2fa2b7 100644
--- a/drivers/video/msm/mdp.c
+++ b/drivers/video/msm/mdp.c
@@ -22,9 +22,6 @@
22#include <linux/wait.h> 22#include <linux/wait.h>
23#include <linux/clk.h> 23#include <linux/clk.h>
24#include <linux/file.h> 24#include <linux/file.h>
25#ifdef CONFIG_ANDROID_PMEM
26#include <linux/android_pmem.h>
27#endif
28#include <linux/major.h> 25#include <linux/major.h>
29 26
30#include <mach/msm_iomap.h> 27#include <mach/msm_iomap.h>
@@ -262,11 +259,6 @@ int get_img(struct mdp_img *img, struct fb_info *info,
262 struct file *file; 259 struct file *file;
263 unsigned long vstart; 260 unsigned long vstart;
264 261
265#ifdef CONFIG_ANDROID_PMEM
266 if (!get_pmem_file(img->memory_id, start, &vstart, len, filep))
267 return 0;
268#endif
269
270 file = fget_light(img->memory_id, &put_needed); 262 file = fget_light(img->memory_id, &put_needed);
271 if (file == NULL) 263 if (file == NULL)
272 return -1; 264 return -1;
@@ -283,12 +275,6 @@ int get_img(struct mdp_img *img, struct fb_info *info,
283 275
284void put_img(struct file *src_file, struct file *dst_file) 276void put_img(struct file *src_file, struct file *dst_file)
285{ 277{
286#ifdef CONFIG_ANDROID_PMEM
287 if (src_file)
288 put_pmem_file(src_file);
289 if (dst_file)
290 put_pmem_file(dst_file);
291#endif
292} 278}
293 279
294int mdp_blit(struct mdp_device *mdp_dev, struct fb_info *fb, 280int mdp_blit(struct mdp_device *mdp_dev, struct fb_info *fb,
@@ -320,9 +306,6 @@ int mdp_blit(struct mdp_device *mdp_dev, struct fb_info *fb,
320 if (unlikely(get_img(&req->dst, fb, &dst_start, &dst_len, &dst_file))) { 306 if (unlikely(get_img(&req->dst, fb, &dst_start, &dst_len, &dst_file))) {
321 printk(KERN_ERR "mpd_ppp: could not retrieve dst image from " 307 printk(KERN_ERR "mpd_ppp: could not retrieve dst image from "
322 "memory\n"); 308 "memory\n");
323#ifdef CONFIG_ANDROID_PMEM
324 put_pmem_file(src_file);
325#endif
326 return -EINVAL; 309 return -EINVAL;
327 } 310 }
328 mutex_lock(&mdp_mutex); 311 mutex_lock(&mdp_mutex);
@@ -499,7 +482,6 @@ int mdp_probe(struct platform_device *pdev)
499 /* register mdp device */ 482 /* register mdp device */
500 mdp->mdp_dev.dev.parent = &pdev->dev; 483 mdp->mdp_dev.dev.parent = &pdev->dev;
501 mdp->mdp_dev.dev.class = mdp_class; 484 mdp->mdp_dev.dev.class = mdp_class;
502 snprintf(mdp->mdp_dev.dev.bus_id, BUS_ID_SIZE, "mdp%d", pdev->id);
503 485
504 /* if you can remove the platform device you'd have to implement 486 /* if you can remove the platform device you'd have to implement
505 * this: 487 * this:
diff --git a/drivers/video/msm/mdp_ppp.c b/drivers/video/msm/mdp_ppp.c
index ba2c4673b648..4ff001f4cbbd 100644
--- a/drivers/video/msm/mdp_ppp.c
+++ b/drivers/video/msm/mdp_ppp.c
@@ -16,7 +16,6 @@
16#include <linux/file.h> 16#include <linux/file.h>
17#include <linux/delay.h> 17#include <linux/delay.h>
18#include <linux/msm_mdp.h> 18#include <linux/msm_mdp.h>
19#include <linux/android_pmem.h>
20#include <mach/msm_fb.h> 19#include <mach/msm_fb.h>
21 20
22#include "mdp_hw.h" 21#include "mdp_hw.h"
@@ -579,25 +578,6 @@ static int valid_src_dst(unsigned long src_start, unsigned long src_len,
579static void flush_imgs(struct mdp_blit_req *req, struct mdp_regs *regs, 578static void flush_imgs(struct mdp_blit_req *req, struct mdp_regs *regs,
580 struct file *src_file, struct file *dst_file) 579 struct file *src_file, struct file *dst_file)
581{ 580{
582#ifdef CONFIG_ANDROID_PMEM
583 uint32_t src0_len, src1_len, dst0_len, dst1_len;
584
585 /* flush src images to memory before dma to mdp */
586 get_len(&req->src, &req->src_rect, regs->src_bpp, &src0_len,
587 &src1_len);
588 flush_pmem_file(src_file, req->src.offset, src0_len);
589 if (IS_PSEUDOPLNR(req->src.format))
590 flush_pmem_file(src_file, req->src.offset + src0_len,
591 src1_len);
592
593 /* flush dst images */
594 get_len(&req->dst, &req->dst_rect, regs->dst_bpp, &dst0_len,
595 &dst1_len);
596 flush_pmem_file(dst_file, req->dst.offset, dst0_len);
597 if (IS_PSEUDOPLNR(req->dst.format))
598 flush_pmem_file(dst_file, req->dst.offset + dst0_len,
599 dst1_len);
600#endif
601} 581}
602 582
603static void get_chroma_addr(struct mdp_img *img, struct mdp_rect *rect, 583static void get_chroma_addr(struct mdp_img *img, struct mdp_rect *rect,
diff --git a/drivers/video/savage/savagefb_driver.c b/drivers/video/savage/savagefb_driver.c
index 37b135d5d12e..842d157e1025 100644
--- a/drivers/video/savage/savagefb_driver.c
+++ b/drivers/video/savage/savagefb_driver.c
@@ -1565,7 +1565,7 @@ static int savagefb_blank(int blank, struct fb_info *info)
1565 vga_out8(0x3c5, sr8, par); 1565 vga_out8(0x3c5, sr8, par);
1566 vga_out8(0x3c4, 0x0d, par); 1566 vga_out8(0x3c4, 0x0d, par);
1567 srd = vga_in8(0x3c5, par); 1567 srd = vga_in8(0x3c5, par);
1568 srd &= 0x03; 1568 srd &= 0x50;
1569 1569
1570 switch (blank) { 1570 switch (blank) {
1571 case FB_BLANK_UNBLANK: 1571 case FB_BLANK_UNBLANK:
@@ -1606,22 +1606,6 @@ static int savagefb_blank(int blank, struct fb_info *info)
1606 return (blank == FB_BLANK_NORMAL) ? 1 : 0; 1606 return (blank == FB_BLANK_NORMAL) ? 1 : 0;
1607} 1607}
1608 1608
1609static void savagefb_save_state(struct fb_info *info)
1610{
1611 struct savagefb_par *par = info->par;
1612
1613 savage_get_default_par(par, &par->save);
1614}
1615
1616static void savagefb_restore_state(struct fb_info *info)
1617{
1618 struct savagefb_par *par = info->par;
1619
1620 savagefb_blank(FB_BLANK_POWERDOWN, info);
1621 savage_set_default_par(par, &par->save);
1622 savagefb_blank(FB_BLANK_UNBLANK, info);
1623}
1624
1625static int savagefb_open(struct fb_info *info, int user) 1609static int savagefb_open(struct fb_info *info, int user)
1626{ 1610{
1627 struct savagefb_par *par = info->par; 1611 struct savagefb_par *par = info->par;
@@ -1667,8 +1651,6 @@ static struct fb_ops savagefb_ops = {
1667 .fb_setcolreg = savagefb_setcolreg, 1651 .fb_setcolreg = savagefb_setcolreg,
1668 .fb_pan_display = savagefb_pan_display, 1652 .fb_pan_display = savagefb_pan_display,
1669 .fb_blank = savagefb_blank, 1653 .fb_blank = savagefb_blank,
1670 .fb_save_state = savagefb_save_state,
1671 .fb_restore_state = savagefb_restore_state,
1672#if defined(CONFIG_FB_SAVAGE_ACCEL) 1654#if defined(CONFIG_FB_SAVAGE_ACCEL)
1673 .fb_fillrect = savagefb_fillrect, 1655 .fb_fillrect = savagefb_fillrect,
1674 .fb_copyarea = savagefb_copyarea, 1656 .fb_copyarea = savagefb_copyarea,
diff --git a/drivers/video/uvesafb.c b/drivers/video/uvesafb.c
index e35232a18571..54fbb2995a5f 100644
--- a/drivers/video/uvesafb.c
+++ b/drivers/video/uvesafb.c
@@ -1411,23 +1411,6 @@ static int uvesafb_check_var(struct fb_var_screeninfo *var,
1411 return 0; 1411 return 0;
1412} 1412}
1413 1413
1414static void uvesafb_save_state(struct fb_info *info)
1415{
1416 struct uvesafb_par *par = info->par;
1417
1418 if (par->vbe_state_saved)
1419 kfree(par->vbe_state_saved);
1420
1421 par->vbe_state_saved = uvesafb_vbe_state_save(par);
1422}
1423
1424static void uvesafb_restore_state(struct fb_info *info)
1425{
1426 struct uvesafb_par *par = info->par;
1427
1428 uvesafb_vbe_state_restore(par, par->vbe_state_saved);
1429}
1430
1431static struct fb_ops uvesafb_ops = { 1414static struct fb_ops uvesafb_ops = {
1432 .owner = THIS_MODULE, 1415 .owner = THIS_MODULE,
1433 .fb_open = uvesafb_open, 1416 .fb_open = uvesafb_open,
@@ -1441,8 +1424,6 @@ static struct fb_ops uvesafb_ops = {
1441 .fb_imageblit = cfb_imageblit, 1424 .fb_imageblit = cfb_imageblit,
1442 .fb_check_var = uvesafb_check_var, 1425 .fb_check_var = uvesafb_check_var,
1443 .fb_set_par = uvesafb_set_par, 1426 .fb_set_par = uvesafb_set_par,
1444 .fb_save_state = uvesafb_save_state,
1445 .fb_restore_state = uvesafb_restore_state,
1446}; 1427};
1447 1428
1448static void __devinit uvesafb_init_info(struct fb_info *info, 1429static void __devinit uvesafb_init_info(struct fb_info *info,
@@ -1459,15 +1440,6 @@ static void __devinit uvesafb_init_info(struct fb_info *info,
1459 info->fix.ypanstep = par->ypan ? 1 : 0; 1440 info->fix.ypanstep = par->ypan ? 1 : 0;
1460 info->fix.ywrapstep = (par->ypan > 1) ? 1 : 0; 1441 info->fix.ywrapstep = (par->ypan > 1) ? 1 : 0;
1461 1442
1462 /*
1463 * If we were unable to get the state buffer size, disable
1464 * functions for saving and restoring the hardware state.
1465 */
1466 if (par->vbe_state_size == 0) {
1467 info->fbops->fb_save_state = NULL;
1468 info->fbops->fb_restore_state = NULL;
1469 }
1470
1471 /* Disable blanking if the user requested so. */ 1443 /* Disable blanking if the user requested so. */
1472 if (!blank) 1444 if (!blank)
1473 info->fbops->fb_blank = NULL; 1445 info->fbops->fb_blank = NULL;
diff --git a/drivers/watchdog/pnx4008_wdt.c b/drivers/watchdog/pnx4008_wdt.c
index f24d04132eda..4d227b152001 100644
--- a/drivers/watchdog/pnx4008_wdt.c
+++ b/drivers/watchdog/pnx4008_wdt.c
@@ -317,7 +317,7 @@ static int __devexit pnx4008_wdt_remove(struct platform_device *pdev)
317 317
318static struct platform_driver platform_wdt_driver = { 318static struct platform_driver platform_wdt_driver = {
319 .driver = { 319 .driver = {
320 .name = "watchdog", 320 .name = "pnx4008-watchdog",
321 .owner = THIS_MODULE, 321 .owner = THIS_MODULE,
322 }, 322 },
323 .probe = pnx4008_wdt_probe, 323 .probe = pnx4008_wdt_probe,
@@ -352,4 +352,4 @@ MODULE_PARM_DESC(nowayout,
352 352
353MODULE_LICENSE("GPL"); 353MODULE_LICENSE("GPL");
354MODULE_ALIAS_MISCDEV(WATCHDOG_MINOR); 354MODULE_ALIAS_MISCDEV(WATCHDOG_MINOR);
355MODULE_ALIAS("platform:watchdog"); 355MODULE_ALIAS("platform:pnx4008-watchdog");
diff --git a/drivers/watchdog/rc32434_wdt.c b/drivers/watchdog/rc32434_wdt.c
index f6cccc9df022..bf12d06b5877 100644
--- a/drivers/watchdog/rc32434_wdt.c
+++ b/drivers/watchdog/rc32434_wdt.c
@@ -62,7 +62,7 @@ extern unsigned int idt_cpu_freq;
62static int timeout = WATCHDOG_TIMEOUT; 62static int timeout = WATCHDOG_TIMEOUT;
63module_param(timeout, int, 0); 63module_param(timeout, int, 0);
64MODULE_PARM_DESC(timeout, "Watchdog timeout value, in seconds (default=" 64MODULE_PARM_DESC(timeout, "Watchdog timeout value, in seconds (default="
65 WATCHDOG_TIMEOUT ")"); 65 __MODULE_STRING(WATCHDOG_TIMEOUT) ")");
66 66
67static int nowayout = WATCHDOG_NOWAYOUT; 67static int nowayout = WATCHDOG_NOWAYOUT;
68module_param(nowayout, int, 0); 68module_param(nowayout, int, 0);
@@ -276,7 +276,7 @@ static int __devinit rc32434_wdt_probe(struct platform_device *pdev)
276 return -ENODEV; 276 return -ENODEV;
277 } 277 }
278 278
279 wdt_reg = ioremap_nocache(r->start, r->end - r->start); 279 wdt_reg = ioremap_nocache(r->start, resource_size(r));
280 if (!wdt_reg) { 280 if (!wdt_reg) {
281 printk(KERN_ERR PFX "failed to remap I/O resources\n"); 281 printk(KERN_ERR PFX "failed to remap I/O resources\n");
282 return -ENXIO; 282 return -ENXIO;
diff --git a/drivers/watchdog/sbc_fitpc2_wdt.c b/drivers/watchdog/sbc_fitpc2_wdt.c
index 852ca1977917..91430a89107c 100644
--- a/drivers/watchdog/sbc_fitpc2_wdt.c
+++ b/drivers/watchdog/sbc_fitpc2_wdt.c
@@ -227,7 +227,7 @@ static int __init fitpc2_wdt_init(void)
227 } 227 }
228 228
229 err = misc_register(&fitpc2_wdt_miscdev); 229 err = misc_register(&fitpc2_wdt_miscdev);
230 if (!err) { 230 if (err) {
231 pr_err("cannot register miscdev on minor=%d (err=%d)\n", 231 pr_err("cannot register miscdev on minor=%d (err=%d)\n",
232 WATCHDOG_MINOR, err); 232 WATCHDOG_MINOR, err);
233 goto err_margin; 233 goto err_margin;
diff --git a/firmware/Makefile b/firmware/Makefile
index a6c7c3e47e42..f4ca0c7eb51c 100644
--- a/firmware/Makefile
+++ b/firmware/Makefile
@@ -69,11 +69,13 @@ fw-shipped-$(CONFIG_E100) += e100/d101m_ucode.bin e100/d101s_ucode.bin \
69fw-shipped-$(CONFIG_MYRI_SBUS) += myricom/lanai.bin 69fw-shipped-$(CONFIG_MYRI_SBUS) += myricom/lanai.bin
70fw-shipped-$(CONFIG_PCMCIA_PCNET) += cis/LA-PCM.cis cis/PCMLM28.cis \ 70fw-shipped-$(CONFIG_PCMCIA_PCNET) += cis/LA-PCM.cis cis/PCMLM28.cis \
71 cis/DP83903.cis cis/NE2K.cis \ 71 cis/DP83903.cis cis/NE2K.cis \
72 cis/tamarack.cis 72 cis/tamarack.cis cis/PE-200.cis
73fw-shipped-$(CONFIG_PCMCIA_3C589) += cis/3CXEM556.cis 73fw-shipped-$(CONFIG_PCMCIA_3C589) += cis/3CXEM556.cis
74fw-shipped-$(CONFIG_PCMCIA_3C574) += cis/3CCFEM556.cis 74fw-shipped-$(CONFIG_PCMCIA_3C574) += cis/3CCFEM556.cis
75fw-shipped-$(CONFIG_SERIAL_8250_CS) += cis/MT5634ZLX.cis cis/RS-COM-2P.cis \ 75fw-shipped-$(CONFIG_SERIAL_8250_CS) += cis/MT5634ZLX.cis cis/RS-COM-2P.cis \
76 cis/COMpad2.cis cis/COMpad4.cis 76 cis/COMpad2.cis cis/COMpad4.cis \
77 cis/SW_555_SER.cis cis/SW_7xx_SER.cis \
78 cis/SW_8xx_SER.cis
77fw-shipped-$(CONFIG_PCMCIA_SMC91C92) += ositech/Xilinx7OD.bin 79fw-shipped-$(CONFIG_PCMCIA_SMC91C92) += ositech/Xilinx7OD.bin
78fw-shipped-$(CONFIG_SCSI_ADVANSYS) += advansys/mcode.bin advansys/38C1600.bin \ 80fw-shipped-$(CONFIG_SCSI_ADVANSYS) += advansys/mcode.bin advansys/38C1600.bin \
79 advansys/3550.bin advansys/38C0800.bin 81 advansys/3550.bin advansys/38C0800.bin
diff --git a/firmware/WHENCE b/firmware/WHENCE
index c437e14f0b11..7a8adc06eb34 100644
--- a/firmware/WHENCE
+++ b/firmware/WHENCE
@@ -600,6 +600,7 @@ File: cis/LA-PCM.cis
600 cis/DP83903.cis 600 cis/DP83903.cis
601 cis/NE2K.cis 601 cis/NE2K.cis
602 cis/tamarack.cis 602 cis/tamarack.cis
603 cis/PE-200.cis
603 604
604Licence: GPL 605Licence: GPL
605 606
@@ -633,6 +634,9 @@ File: cis/MT5634ZLX.cis
633 cis/RS-COM-2P.cis 634 cis/RS-COM-2P.cis
634 cis/COMpad2.cis 635 cis/COMpad2.cis
635 cis/COMpad4.cis 636 cis/COMpad4.cis
637 cis/SW_555_SER.cis
638 cis/SW_7xx_SER.cis
639 cis/SW_8xx_SER.cis
636 640
637Licence: GPL 641Licence: GPL
638 642
diff --git a/firmware/cis/PE-200.cis.ihex b/firmware/cis/PE-200.cis.ihex
new file mode 100644
index 000000000000..e6dbdab6eb79
--- /dev/null
+++ b/firmware/cis/PE-200.cis.ihex
@@ -0,0 +1,9 @@
1:1000000001030000FF151E0401504D582020200060
2:1000100050452D3230300045544845524E4554002D
3:1000200052303100FF210206031A050101000101CF
4:100030001B0EC181190155E051000F100F30FFFF59
5:040040001400FF00A9
6:00000001FF
7#
8# Replacement CIS for PE-200 ethernet card
9#
diff --git a/firmware/cis/SW_555_SER.cis.ihex b/firmware/cis/SW_555_SER.cis.ihex
new file mode 100644
index 000000000000..9b9348acee7b
--- /dev/null
+++ b/firmware/cis/SW_555_SER.cis.ihex
@@ -0,0 +1,12 @@
1:100000000101FF17034100FF20043F0110072102F7
2:100010000200152A070053696572726120576972E0
3:10002000656C657373004169724361726420353594
4:1000300035004135353500526576203100FF1A050F
5:1000400001030007731B0BE00118A360F8030730DE
6:10005000BC3F1B08A10108A360F802071B08A2010E
7:1000600008A360E803071B08A30108A360E80207D0
8:0A0070001B04A40108231400FF0084
9:00000001FF
10#
11# Replacement CIS for AC555 provided by Sierra Wireless
12#
diff --git a/firmware/cis/SW_7xx_SER.cis.ihex b/firmware/cis/SW_7xx_SER.cis.ihex
new file mode 100644
index 000000000000..11e44ad86437
--- /dev/null
+++ b/firmware/cis/SW_7xx_SER.cis.ihex
@@ -0,0 +1,13 @@
1:100000000101FF17034100FF2004920110072102A4
2:1000100002001537070053696572726120576972D3
3:10002000656C6573730041433731302F4143373579
4:10003000300047505253204E6574776F726B2041E9
5:1000400064617074657200523100FF1A050103008B
6:1000500007731B10E00119784D555D25A360F80367
7:100060000730BC861B08A10108A360F802071B0823
8:10007000A20108A360E803071B08A30108A360E826
9:0C00800002071B04A40108231400FF0069
10:00000001FF
11#
12# Replacement CIS for AC7xx provided by Sierra Wireless
13#
diff --git a/firmware/cis/SW_8xx_SER.cis.ihex b/firmware/cis/SW_8xx_SER.cis.ihex
new file mode 100644
index 000000000000..bbcfe6348328
--- /dev/null
+++ b/firmware/cis/SW_8xx_SER.cis.ihex
@@ -0,0 +1,13 @@
1:100000000101FF17034100FF2004920110072102A4
2:100010000200152F070053696572726120576972DB
3:10002000656C657373004143383530003347204EAB
4:100030006574776F726B20416461707465720052F1
5:100040003100FF1A0501030007731B10E001197846
6:100050004D555D25A360F8480730BC861B08A101FB
7:1000600008A360F847071B08A20108A360E8480737
8:100070001B08A30108A360E847071B04A401082389
9:040080001400FF0069
10:00000001FF
11#
12# Replacement CIS for AC8xx provided by Sierra Wireless
13#
diff --git a/fs/9p/cache.c b/fs/9p/cache.c
index 51c94e26a346..e777961939f3 100644
--- a/fs/9p/cache.c
+++ b/fs/9p/cache.c
@@ -343,18 +343,7 @@ int __v9fs_fscache_release_page(struct page *page, gfp_t gfp)
343 343
344 BUG_ON(!vcookie->fscache); 344 BUG_ON(!vcookie->fscache);
345 345
346 if (PageFsCache(page)) { 346 return fscache_maybe_release_page(vcookie->fscache, page, gfp);
347 if (fscache_check_page_write(vcookie->fscache, page)) {
348 if (!(gfp & __GFP_WAIT))
349 return 0;
350 fscache_wait_on_page_write(vcookie->fscache, page);
351 }
352
353 fscache_uncache_page(vcookie->fscache, page);
354 ClearPageFsCache(page);
355 }
356
357 return 1;
358} 347}
359 348
360void __v9fs_fscache_invalidate_page(struct page *page) 349void __v9fs_fscache_invalidate_page(struct page *page)
@@ -368,7 +357,6 @@ void __v9fs_fscache_invalidate_page(struct page *page)
368 fscache_wait_on_page_write(vcookie->fscache, page); 357 fscache_wait_on_page_write(vcookie->fscache, page);
369 BUG_ON(!PageLocked(page)); 358 BUG_ON(!PageLocked(page));
370 fscache_uncache_page(vcookie->fscache, page); 359 fscache_uncache_page(vcookie->fscache, page);
371 ClearPageFsCache(page);
372 } 360 }
373} 361}
374 362
diff --git a/fs/Kconfig b/fs/Kconfig
index 2126078a38ed..64d44efad7a5 100644
--- a/fs/Kconfig
+++ b/fs/Kconfig
@@ -135,7 +135,7 @@ config TMPFS_POSIX_ACL
135 135
136config HUGETLBFS 136config HUGETLBFS
137 bool "HugeTLB file system support" 137 bool "HugeTLB file system support"
138 depends on X86 || IA64 || PPC_BOOK3S_64 || SPARC64 || (S390 && 64BIT) || \ 138 depends on X86 || IA64 || SPARC64 || (S390 && 64BIT) || \
139 SYS_SUPPORTS_HUGETLBFS || BROKEN 139 SYS_SUPPORTS_HUGETLBFS || BROKEN
140 help 140 help
141 hugetlbfs is a filesystem backing for HugeTLB pages, based on 141 hugetlbfs is a filesystem backing for HugeTLB pages, based on
diff --git a/fs/afs/file.c b/fs/afs/file.c
index 681c2a7b013f..39b301662f22 100644
--- a/fs/afs/file.c
+++ b/fs/afs/file.c
@@ -315,7 +315,6 @@ static void afs_invalidatepage(struct page *page, unsigned long offset)
315 struct afs_vnode *vnode = AFS_FS_I(page->mapping->host); 315 struct afs_vnode *vnode = AFS_FS_I(page->mapping->host);
316 fscache_wait_on_page_write(vnode->cache, page); 316 fscache_wait_on_page_write(vnode->cache, page);
317 fscache_uncache_page(vnode->cache, page); 317 fscache_uncache_page(vnode->cache, page);
318 ClearPageFsCache(page);
319 } 318 }
320#endif 319#endif
321 320
@@ -349,17 +348,9 @@ static int afs_releasepage(struct page *page, gfp_t gfp_flags)
349 /* deny if page is being written to the cache and the caller hasn't 348 /* deny if page is being written to the cache and the caller hasn't
350 * elected to wait */ 349 * elected to wait */
351#ifdef CONFIG_AFS_FSCACHE 350#ifdef CONFIG_AFS_FSCACHE
352 if (PageFsCache(page)) { 351 if (!fscache_maybe_release_page(vnode->cache, page, gfp_flags)) {
353 if (fscache_check_page_write(vnode->cache, page)) { 352 _leave(" = F [cache busy]");
354 if (!(gfp_flags & __GFP_WAIT)) { 353 return 0;
355 _leave(" = F [cache busy]");
356 return 0;
357 }
358 fscache_wait_on_page_write(vnode->cache, page);
359 }
360
361 fscache_uncache_page(vnode->cache, page);
362 ClearPageFsCache(page);
363 } 354 }
364#endif 355#endif
365 356
diff --git a/fs/bio.c b/fs/bio.c
index 402cb84a92a1..12da5db8682c 100644
--- a/fs/bio.c
+++ b/fs/bio.c
@@ -325,8 +325,16 @@ static void bio_fs_destructor(struct bio *bio)
325 * @gfp_mask: allocation mask to use 325 * @gfp_mask: allocation mask to use
326 * @nr_iovecs: number of iovecs 326 * @nr_iovecs: number of iovecs
327 * 327 *
328 * Allocate a new bio with @nr_iovecs bvecs. If @gfp_mask 328 * bio_alloc will allocate a bio and associated bio_vec array that can hold
329 * contains __GFP_WAIT, the allocation is guaranteed to succeed. 329 * at least @nr_iovecs entries. Allocations will be done from the
330 * fs_bio_set. Also see @bio_alloc_bioset and @bio_kmalloc.
331 *
332 * If %__GFP_WAIT is set, then bio_alloc will always be able to allocate
333 * a bio. This is due to the mempool guarantees. To make this work, callers
334 * must never allocate more than 1 bio at a time from this pool. Callers
335 * that need to allocate more than 1 bio must always submit the previously
336 * allocated bio for IO before attempting to allocate a new one. Failure to
337 * do so can cause livelocks under memory pressure.
330 * 338 *
331 * RETURNS: 339 * RETURNS:
332 * Pointer to new bio on success, NULL on failure. 340 * Pointer to new bio on success, NULL on failure.
@@ -350,21 +358,13 @@ static void bio_kmalloc_destructor(struct bio *bio)
350} 358}
351 359
352/** 360/**
353 * bio_alloc - allocate a bio for I/O 361 * bio_kmalloc - allocate a bio for I/O using kmalloc()
354 * @gfp_mask: the GFP_ mask given to the slab allocator 362 * @gfp_mask: the GFP_ mask given to the slab allocator
355 * @nr_iovecs: number of iovecs to pre-allocate 363 * @nr_iovecs: number of iovecs to pre-allocate
356 * 364 *
357 * Description: 365 * Description:
358 * bio_alloc will allocate a bio and associated bio_vec array that can hold 366 * Allocate a new bio with @nr_iovecs bvecs. If @gfp_mask contains
359 * at least @nr_iovecs entries. Allocations will be done from the 367 * %__GFP_WAIT, the allocation is guaranteed to succeed.
360 * fs_bio_set. Also see @bio_alloc_bioset.
361 *
362 * If %__GFP_WAIT is set, then bio_alloc will always be able to allocate
363 * a bio. This is due to the mempool guarantees. To make this work, callers
364 * must never allocate more than 1 bio at a time from this pool. Callers
365 * that need to allocate more than 1 bio must always submit the previously
366 * allocated bio for IO before attempting to allocate a new one. Failure to
367 * do so can cause livelocks under memory pressure.
368 * 368 *
369 **/ 369 **/
370struct bio *bio_kmalloc(gfp_t gfp_mask, int nr_iovecs) 370struct bio *bio_kmalloc(gfp_t gfp_mask, int nr_iovecs)
@@ -407,7 +407,7 @@ EXPORT_SYMBOL(zero_fill_bio);
407 * 407 *
408 * Description: 408 * Description:
409 * Put a reference to a &struct bio, either one you have gotten with 409 * Put a reference to a &struct bio, either one you have gotten with
410 * bio_alloc or bio_get. The last put of a bio will free it. 410 * bio_alloc, bio_get or bio_clone. The last put of a bio will free it.
411 **/ 411 **/
412void bio_put(struct bio *bio) 412void bio_put(struct bio *bio)
413{ 413{
diff --git a/fs/btrfs/extent-tree.c b/fs/btrfs/extent-tree.c
index e238a0cdac67..94627c4cc193 100644
--- a/fs/btrfs/extent-tree.c
+++ b/fs/btrfs/extent-tree.c
@@ -2977,10 +2977,10 @@ static int maybe_allocate_chunk(struct btrfs_root *root,
2977 2977
2978 free_space = btrfs_super_total_bytes(disk_super); 2978 free_space = btrfs_super_total_bytes(disk_super);
2979 /* 2979 /*
2980 * we allow the metadata to grow to a max of either 5gb or 5% of the 2980 * we allow the metadata to grow to a max of either 10gb or 5% of the
2981 * space in the volume. 2981 * space in the volume.
2982 */ 2982 */
2983 min_metadata = min((u64)5 * 1024 * 1024 * 1024, 2983 min_metadata = min((u64)10 * 1024 * 1024 * 1024,
2984 div64_u64(free_space * 5, 100)); 2984 div64_u64(free_space * 5, 100));
2985 if (info->total_bytes >= min_metadata) { 2985 if (info->total_bytes >= min_metadata) {
2986 spin_unlock(&info->lock); 2986 spin_unlock(&info->lock);
@@ -4102,7 +4102,7 @@ wait_block_group_cache_done(struct btrfs_block_group_cache *cache)
4102} 4102}
4103 4103
4104enum btrfs_loop_type { 4104enum btrfs_loop_type {
4105 LOOP_CACHED_ONLY = 0, 4105 LOOP_FIND_IDEAL = 0,
4106 LOOP_CACHING_NOWAIT = 1, 4106 LOOP_CACHING_NOWAIT = 1,
4107 LOOP_CACHING_WAIT = 2, 4107 LOOP_CACHING_WAIT = 2,
4108 LOOP_ALLOC_CHUNK = 3, 4108 LOOP_ALLOC_CHUNK = 3,
@@ -4131,12 +4131,15 @@ static noinline int find_free_extent(struct btrfs_trans_handle *trans,
4131 struct btrfs_block_group_cache *block_group = NULL; 4131 struct btrfs_block_group_cache *block_group = NULL;
4132 int empty_cluster = 2 * 1024 * 1024; 4132 int empty_cluster = 2 * 1024 * 1024;
4133 int allowed_chunk_alloc = 0; 4133 int allowed_chunk_alloc = 0;
4134 int done_chunk_alloc = 0;
4134 struct btrfs_space_info *space_info; 4135 struct btrfs_space_info *space_info;
4135 int last_ptr_loop = 0; 4136 int last_ptr_loop = 0;
4136 int loop = 0; 4137 int loop = 0;
4137 bool found_uncached_bg = false; 4138 bool found_uncached_bg = false;
4138 bool failed_cluster_refill = false; 4139 bool failed_cluster_refill = false;
4139 bool failed_alloc = false; 4140 bool failed_alloc = false;
4141 u64 ideal_cache_percent = 0;
4142 u64 ideal_cache_offset = 0;
4140 4143
4141 WARN_ON(num_bytes < root->sectorsize); 4144 WARN_ON(num_bytes < root->sectorsize);
4142 btrfs_set_key_type(ins, BTRFS_EXTENT_ITEM_KEY); 4145 btrfs_set_key_type(ins, BTRFS_EXTENT_ITEM_KEY);
@@ -4172,14 +4175,19 @@ static noinline int find_free_extent(struct btrfs_trans_handle *trans,
4172 empty_cluster = 0; 4175 empty_cluster = 0;
4173 4176
4174 if (search_start == hint_byte) { 4177 if (search_start == hint_byte) {
4178ideal_cache:
4175 block_group = btrfs_lookup_block_group(root->fs_info, 4179 block_group = btrfs_lookup_block_group(root->fs_info,
4176 search_start); 4180 search_start);
4177 /* 4181 /*
4178 * we don't want to use the block group if it doesn't match our 4182 * we don't want to use the block group if it doesn't match our
4179 * allocation bits, or if its not cached. 4183 * allocation bits, or if its not cached.
4184 *
4185 * However if we are re-searching with an ideal block group
4186 * picked out then we don't care that the block group is cached.
4180 */ 4187 */
4181 if (block_group && block_group_bits(block_group, data) && 4188 if (block_group && block_group_bits(block_group, data) &&
4182 block_group_cache_done(block_group)) { 4189 (block_group->cached != BTRFS_CACHE_NO ||
4190 search_start == ideal_cache_offset)) {
4183 down_read(&space_info->groups_sem); 4191 down_read(&space_info->groups_sem);
4184 if (list_empty(&block_group->list) || 4192 if (list_empty(&block_group->list) ||
4185 block_group->ro) { 4193 block_group->ro) {
@@ -4191,13 +4199,13 @@ static noinline int find_free_extent(struct btrfs_trans_handle *trans,
4191 */ 4199 */
4192 btrfs_put_block_group(block_group); 4200 btrfs_put_block_group(block_group);
4193 up_read(&space_info->groups_sem); 4201 up_read(&space_info->groups_sem);
4194 } else 4202 } else {
4195 goto have_block_group; 4203 goto have_block_group;
4204 }
4196 } else if (block_group) { 4205 } else if (block_group) {
4197 btrfs_put_block_group(block_group); 4206 btrfs_put_block_group(block_group);
4198 } 4207 }
4199 } 4208 }
4200
4201search: 4209search:
4202 down_read(&space_info->groups_sem); 4210 down_read(&space_info->groups_sem);
4203 list_for_each_entry(block_group, &space_info->block_groups, list) { 4211 list_for_each_entry(block_group, &space_info->block_groups, list) {
@@ -4209,28 +4217,45 @@ search:
4209 4217
4210have_block_group: 4218have_block_group:
4211 if (unlikely(block_group->cached == BTRFS_CACHE_NO)) { 4219 if (unlikely(block_group->cached == BTRFS_CACHE_NO)) {
4220 u64 free_percent;
4221
4222 free_percent = btrfs_block_group_used(&block_group->item);
4223 free_percent *= 100;
4224 free_percent = div64_u64(free_percent,
4225 block_group->key.offset);
4226 free_percent = 100 - free_percent;
4227 if (free_percent > ideal_cache_percent &&
4228 likely(!block_group->ro)) {
4229 ideal_cache_offset = block_group->key.objectid;
4230 ideal_cache_percent = free_percent;
4231 }
4232
4212 /* 4233 /*
4213 * we want to start caching kthreads, but not too many 4234 * We only want to start kthread caching if we are at
4214 * right off the bat so we don't overwhelm the system, 4235 * the point where we will wait for caching to make
4215 * so only start them if there are less than 2 and we're 4236 * progress, or if our ideal search is over and we've
4216 * in the initial allocation phase. 4237 * found somebody to start caching.
4217 */ 4238 */
4218 if (loop > LOOP_CACHING_NOWAIT || 4239 if (loop > LOOP_CACHING_NOWAIT ||
4219 atomic_read(&space_info->caching_threads) < 2) { 4240 (loop > LOOP_FIND_IDEAL &&
4241 atomic_read(&space_info->caching_threads) < 2)) {
4220 ret = cache_block_group(block_group); 4242 ret = cache_block_group(block_group);
4221 BUG_ON(ret); 4243 BUG_ON(ret);
4222 } 4244 }
4223 }
4224
4225 cached = block_group_cache_done(block_group);
4226 if (unlikely(!cached)) {
4227 found_uncached_bg = true; 4245 found_uncached_bg = true;
4228 4246
4229 /* if we only want cached bgs, loop */ 4247 /*
4230 if (loop == LOOP_CACHED_ONLY) 4248 * If loop is set for cached only, try the next block
4249 * group.
4250 */
4251 if (loop == LOOP_FIND_IDEAL)
4231 goto loop; 4252 goto loop;
4232 } 4253 }
4233 4254
4255 cached = block_group_cache_done(block_group);
4256 if (unlikely(!cached))
4257 found_uncached_bg = true;
4258
4234 if (unlikely(block_group->ro)) 4259 if (unlikely(block_group->ro))
4235 goto loop; 4260 goto loop;
4236 4261
@@ -4410,9 +4435,11 @@ loop:
4410 } 4435 }
4411 up_read(&space_info->groups_sem); 4436 up_read(&space_info->groups_sem);
4412 4437
4413 /* LOOP_CACHED_ONLY, only search fully cached block groups 4438 /* LOOP_FIND_IDEAL, only search caching/cached bg's, and don't wait for
4414 * LOOP_CACHING_NOWAIT, search partially cached block groups, but 4439 * for them to make caching progress. Also
4415 * dont wait foR them to finish caching 4440 * determine the best possible bg to cache
4441 * LOOP_CACHING_NOWAIT, search partially cached block groups, kicking
4442 * caching kthreads as we move along
4416 * LOOP_CACHING_WAIT, search everything, and wait if our bg is caching 4443 * LOOP_CACHING_WAIT, search everything, and wait if our bg is caching
4417 * LOOP_ALLOC_CHUNK, force a chunk allocation and try again 4444 * LOOP_ALLOC_CHUNK, force a chunk allocation and try again
4418 * LOOP_NO_EMPTY_SIZE, set empty_size and empty_cluster to 0 and try 4445 * LOOP_NO_EMPTY_SIZE, set empty_size and empty_cluster to 0 and try
@@ -4421,12 +4448,47 @@ loop:
4421 if (!ins->objectid && loop < LOOP_NO_EMPTY_SIZE && 4448 if (!ins->objectid && loop < LOOP_NO_EMPTY_SIZE &&
4422 (found_uncached_bg || empty_size || empty_cluster || 4449 (found_uncached_bg || empty_size || empty_cluster ||
4423 allowed_chunk_alloc)) { 4450 allowed_chunk_alloc)) {
4424 if (found_uncached_bg) { 4451 if (loop == LOOP_FIND_IDEAL && found_uncached_bg) {
4425 found_uncached_bg = false; 4452 found_uncached_bg = false;
4426 if (loop < LOOP_CACHING_WAIT) { 4453 loop++;
4427 loop++; 4454 if (!ideal_cache_percent &&
4455 atomic_read(&space_info->caching_threads))
4428 goto search; 4456 goto search;
4429 } 4457
4458 /*
4459 * 1 of the following 2 things have happened so far
4460 *
4461 * 1) We found an ideal block group for caching that
4462 * is mostly full and will cache quickly, so we might
4463 * as well wait for it.
4464 *
4465 * 2) We searched for cached only and we didn't find
4466 * anything, and we didn't start any caching kthreads
4467 * either, so chances are we will loop through and
4468 * start a couple caching kthreads, and then come back
4469 * around and just wait for them. This will be slower
4470 * because we will have 2 caching kthreads reading at
4471 * the same time when we could have just started one
4472 * and waited for it to get far enough to give us an
4473 * allocation, so go ahead and go to the wait caching
4474 * loop.
4475 */
4476 loop = LOOP_CACHING_WAIT;
4477 search_start = ideal_cache_offset;
4478 ideal_cache_percent = 0;
4479 goto ideal_cache;
4480 } else if (loop == LOOP_FIND_IDEAL) {
4481 /*
4482 * Didn't find a uncached bg, wait on anything we find
4483 * next.
4484 */
4485 loop = LOOP_CACHING_WAIT;
4486 goto search;
4487 }
4488
4489 if (loop < LOOP_CACHING_WAIT) {
4490 loop++;
4491 goto search;
4430 } 4492 }
4431 4493
4432 if (loop == LOOP_ALLOC_CHUNK) { 4494 if (loop == LOOP_ALLOC_CHUNK) {
@@ -4438,7 +4500,8 @@ loop:
4438 ret = do_chunk_alloc(trans, root, num_bytes + 4500 ret = do_chunk_alloc(trans, root, num_bytes +
4439 2 * 1024 * 1024, data, 1); 4501 2 * 1024 * 1024, data, 1);
4440 allowed_chunk_alloc = 0; 4502 allowed_chunk_alloc = 0;
4441 } else { 4503 done_chunk_alloc = 1;
4504 } else if (!done_chunk_alloc) {
4442 space_info->force_alloc = 1; 4505 space_info->force_alloc = 1;
4443 } 4506 }
4444 4507
diff --git a/fs/btrfs/extent_map.c b/fs/btrfs/extent_map.c
index 2c726b7b9faa..ccbdcb54ec5d 100644
--- a/fs/btrfs/extent_map.c
+++ b/fs/btrfs/extent_map.c
@@ -208,7 +208,7 @@ int unpin_extent_cache(struct extent_map_tree *tree, u64 start, u64 len)
208 write_lock(&tree->lock); 208 write_lock(&tree->lock);
209 em = lookup_extent_mapping(tree, start, len); 209 em = lookup_extent_mapping(tree, start, len);
210 210
211 WARN_ON(em->start != start || !em); 211 WARN_ON(!em || em->start != start);
212 212
213 if (!em) 213 if (!em)
214 goto out; 214 goto out;
diff --git a/fs/btrfs/free-space-cache.c b/fs/btrfs/free-space-cache.c
index 5c2caad76212..cb2849f03251 100644
--- a/fs/btrfs/free-space-cache.c
+++ b/fs/btrfs/free-space-cache.c
@@ -1296,7 +1296,7 @@ again:
1296 window_start = entry->offset; 1296 window_start = entry->offset;
1297 window_free = entry->bytes; 1297 window_free = entry->bytes;
1298 last = entry; 1298 last = entry;
1299 max_extent = 0; 1299 max_extent = entry->bytes;
1300 } else { 1300 } else {
1301 last = next; 1301 last = next;
1302 window_free += next->bytes; 1302 window_free += next->bytes;
diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c
index dae12dc7e159..b3ad168a0bfc 100644
--- a/fs/btrfs/inode.c
+++ b/fs/btrfs/inode.c
@@ -538,7 +538,7 @@ static noinline int submit_compressed_extents(struct inode *inode,
538 struct btrfs_root *root = BTRFS_I(inode)->root; 538 struct btrfs_root *root = BTRFS_I(inode)->root;
539 struct extent_map_tree *em_tree = &BTRFS_I(inode)->extent_tree; 539 struct extent_map_tree *em_tree = &BTRFS_I(inode)->extent_tree;
540 struct extent_io_tree *io_tree; 540 struct extent_io_tree *io_tree;
541 int ret; 541 int ret = 0;
542 542
543 if (list_empty(&async_cow->extents)) 543 if (list_empty(&async_cow->extents))
544 return 0; 544 return 0;
@@ -552,6 +552,7 @@ static noinline int submit_compressed_extents(struct inode *inode,
552 552
553 io_tree = &BTRFS_I(inode)->io_tree; 553 io_tree = &BTRFS_I(inode)->io_tree;
554 554
555retry:
555 /* did the compression code fall back to uncompressed IO? */ 556 /* did the compression code fall back to uncompressed IO? */
556 if (!async_extent->pages) { 557 if (!async_extent->pages) {
557 int page_started = 0; 558 int page_started = 0;
@@ -562,11 +563,11 @@ static noinline int submit_compressed_extents(struct inode *inode,
562 async_extent->ram_size - 1, GFP_NOFS); 563 async_extent->ram_size - 1, GFP_NOFS);
563 564
564 /* allocate blocks */ 565 /* allocate blocks */
565 cow_file_range(inode, async_cow->locked_page, 566 ret = cow_file_range(inode, async_cow->locked_page,
566 async_extent->start, 567 async_extent->start,
567 async_extent->start + 568 async_extent->start +
568 async_extent->ram_size - 1, 569 async_extent->ram_size - 1,
569 &page_started, &nr_written, 0); 570 &page_started, &nr_written, 0);
570 571
571 /* 572 /*
572 * if page_started, cow_file_range inserted an 573 * if page_started, cow_file_range inserted an
@@ -574,7 +575,7 @@ static noinline int submit_compressed_extents(struct inode *inode,
574 * and IO for us. Otherwise, we need to submit 575 * and IO for us. Otherwise, we need to submit
575 * all those pages down to the drive. 576 * all those pages down to the drive.
576 */ 577 */
577 if (!page_started) 578 if (!page_started && !ret)
578 extent_write_locked_range(io_tree, 579 extent_write_locked_range(io_tree,
579 inode, async_extent->start, 580 inode, async_extent->start,
580 async_extent->start + 581 async_extent->start +
@@ -602,7 +603,21 @@ static noinline int submit_compressed_extents(struct inode *inode,
602 async_extent->compressed_size, 603 async_extent->compressed_size,
603 0, alloc_hint, 604 0, alloc_hint,
604 (u64)-1, &ins, 1); 605 (u64)-1, &ins, 1);
605 BUG_ON(ret); 606 if (ret) {
607 int i;
608 for (i = 0; i < async_extent->nr_pages; i++) {
609 WARN_ON(async_extent->pages[i]->mapping);
610 page_cache_release(async_extent->pages[i]);
611 }
612 kfree(async_extent->pages);
613 async_extent->nr_pages = 0;
614 async_extent->pages = NULL;
615 unlock_extent(io_tree, async_extent->start,
616 async_extent->start +
617 async_extent->ram_size - 1, GFP_NOFS);
618 goto retry;
619 }
620
606 em = alloc_extent_map(GFP_NOFS); 621 em = alloc_extent_map(GFP_NOFS);
607 em->start = async_extent->start; 622 em->start = async_extent->start;
608 em->len = async_extent->ram_size; 623 em->len = async_extent->ram_size;
@@ -743,8 +758,22 @@ static noinline int cow_file_range(struct inode *inode,
743 em = search_extent_mapping(&BTRFS_I(inode)->extent_tree, 758 em = search_extent_mapping(&BTRFS_I(inode)->extent_tree,
744 start, num_bytes); 759 start, num_bytes);
745 if (em) { 760 if (em) {
746 alloc_hint = em->block_start; 761 /*
747 free_extent_map(em); 762 * if block start isn't an actual block number then find the
763 * first block in this inode and use that as a hint. If that
764 * block is also bogus then just don't worry about it.
765 */
766 if (em->block_start >= EXTENT_MAP_LAST_BYTE) {
767 free_extent_map(em);
768 em = search_extent_mapping(em_tree, 0, 0);
769 if (em && em->block_start < EXTENT_MAP_LAST_BYTE)
770 alloc_hint = em->block_start;
771 if (em)
772 free_extent_map(em);
773 } else {
774 alloc_hint = em->block_start;
775 free_extent_map(em);
776 }
748 } 777 }
749 read_unlock(&BTRFS_I(inode)->extent_tree.lock); 778 read_unlock(&BTRFS_I(inode)->extent_tree.lock);
750 btrfs_drop_extent_cache(inode, start, start + num_bytes - 1, 0); 779 btrfs_drop_extent_cache(inode, start, start + num_bytes - 1, 0);
@@ -2474,7 +2503,19 @@ static int btrfs_unlink(struct inode *dir, struct dentry *dentry)
2474 2503
2475 root = BTRFS_I(dir)->root; 2504 root = BTRFS_I(dir)->root;
2476 2505
2506 /*
2507 * 5 items for unlink inode
2508 * 1 for orphan
2509 */
2510 ret = btrfs_reserve_metadata_space(root, 6);
2511 if (ret)
2512 return ret;
2513
2477 trans = btrfs_start_transaction(root, 1); 2514 trans = btrfs_start_transaction(root, 1);
2515 if (IS_ERR(trans)) {
2516 btrfs_unreserve_metadata_space(root, 6);
2517 return PTR_ERR(trans);
2518 }
2478 2519
2479 btrfs_set_trans_block_group(trans, dir); 2520 btrfs_set_trans_block_group(trans, dir);
2480 2521
@@ -2489,6 +2530,7 @@ static int btrfs_unlink(struct inode *dir, struct dentry *dentry)
2489 nr = trans->blocks_used; 2530 nr = trans->blocks_used;
2490 2531
2491 btrfs_end_transaction_throttle(trans, root); 2532 btrfs_end_transaction_throttle(trans, root);
2533 btrfs_unreserve_metadata_space(root, 6);
2492 btrfs_btree_balance_dirty(root, nr); 2534 btrfs_btree_balance_dirty(root, nr);
2493 return ret; 2535 return ret;
2494} 2536}
@@ -2569,7 +2611,16 @@ static int btrfs_rmdir(struct inode *dir, struct dentry *dentry)
2569 inode->i_ino == BTRFS_FIRST_FREE_OBJECTID) 2611 inode->i_ino == BTRFS_FIRST_FREE_OBJECTID)
2570 return -ENOTEMPTY; 2612 return -ENOTEMPTY;
2571 2613
2614 ret = btrfs_reserve_metadata_space(root, 5);
2615 if (ret)
2616 return ret;
2617
2572 trans = btrfs_start_transaction(root, 1); 2618 trans = btrfs_start_transaction(root, 1);
2619 if (IS_ERR(trans)) {
2620 btrfs_unreserve_metadata_space(root, 5);
2621 return PTR_ERR(trans);
2622 }
2623
2573 btrfs_set_trans_block_group(trans, dir); 2624 btrfs_set_trans_block_group(trans, dir);
2574 2625
2575 if (unlikely(inode->i_ino == BTRFS_EMPTY_SUBVOL_DIR_OBJECTID)) { 2626 if (unlikely(inode->i_ino == BTRFS_EMPTY_SUBVOL_DIR_OBJECTID)) {
@@ -2592,6 +2643,7 @@ static int btrfs_rmdir(struct inode *dir, struct dentry *dentry)
2592out: 2643out:
2593 nr = trans->blocks_used; 2644 nr = trans->blocks_used;
2594 ret = btrfs_end_transaction_throttle(trans, root); 2645 ret = btrfs_end_transaction_throttle(trans, root);
2646 btrfs_unreserve_metadata_space(root, 5);
2595 btrfs_btree_balance_dirty(root, nr); 2647 btrfs_btree_balance_dirty(root, nr);
2596 2648
2597 if (ret && !err) 2649 if (ret && !err)
@@ -5128,6 +5180,7 @@ struct inode *btrfs_alloc_inode(struct super_block *sb)
5128 ei->logged_trans = 0; 5180 ei->logged_trans = 0;
5129 ei->outstanding_extents = 0; 5181 ei->outstanding_extents = 0;
5130 ei->reserved_extents = 0; 5182 ei->reserved_extents = 0;
5183 ei->root = NULL;
5131 spin_lock_init(&ei->accounting_lock); 5184 spin_lock_init(&ei->accounting_lock);
5132 btrfs_ordered_inode_tree_init(&ei->ordered_tree); 5185 btrfs_ordered_inode_tree_init(&ei->ordered_tree);
5133 INIT_LIST_HEAD(&ei->i_orphan); 5186 INIT_LIST_HEAD(&ei->i_orphan);
@@ -5144,6 +5197,14 @@ void btrfs_destroy_inode(struct inode *inode)
5144 WARN_ON(inode->i_data.nrpages); 5197 WARN_ON(inode->i_data.nrpages);
5145 5198
5146 /* 5199 /*
5200 * This can happen where we create an inode, but somebody else also
5201 * created the same inode and we need to destroy the one we already
5202 * created.
5203 */
5204 if (!root)
5205 goto free;
5206
5207 /*
5147 * Make sure we're properly removed from the ordered operation 5208 * Make sure we're properly removed from the ordered operation
5148 * lists. 5209 * lists.
5149 */ 5210 */
@@ -5178,6 +5239,7 @@ void btrfs_destroy_inode(struct inode *inode)
5178 } 5239 }
5179 inode_tree_del(inode); 5240 inode_tree_del(inode);
5180 btrfs_drop_extent_cache(inode, 0, (u64)-1, 0); 5241 btrfs_drop_extent_cache(inode, 0, (u64)-1, 0);
5242free:
5181 kmem_cache_free(btrfs_inode_cachep, BTRFS_I(inode)); 5243 kmem_cache_free(btrfs_inode_cachep, BTRFS_I(inode));
5182} 5244}
5183 5245
@@ -5283,11 +5345,14 @@ static int btrfs_rename(struct inode *old_dir, struct dentry *old_dentry,
5283 return -ENOTEMPTY; 5345 return -ENOTEMPTY;
5284 5346
5285 /* 5347 /*
5286 * 2 items for dir items 5348 * We want to reserve the absolute worst case amount of items. So if
5287 * 1 item for orphan entry 5349 * both inodes are subvols and we need to unlink them then that would
5288 * 1 item for ref 5350 * require 4 item modifications, but if they are both normal inodes it
5351 * would require 5 item modifications, so we'll assume their normal
5352 * inodes. So 5 * 2 is 10, plus 1 for the new link, so 11 total items
5353 * should cover the worst case number of items we'll modify.
5289 */ 5354 */
5290 ret = btrfs_reserve_metadata_space(root, 4); 5355 ret = btrfs_reserve_metadata_space(root, 11);
5291 if (ret) 5356 if (ret)
5292 return ret; 5357 return ret;
5293 5358
@@ -5403,7 +5468,7 @@ out_fail:
5403 if (old_inode->i_ino == BTRFS_FIRST_FREE_OBJECTID) 5468 if (old_inode->i_ino == BTRFS_FIRST_FREE_OBJECTID)
5404 up_read(&root->fs_info->subvol_sem); 5469 up_read(&root->fs_info->subvol_sem);
5405 5470
5406 btrfs_unreserve_metadata_space(root, 4); 5471 btrfs_unreserve_metadata_space(root, 11);
5407 return ret; 5472 return ret;
5408} 5473}
5409 5474
diff --git a/fs/btrfs/root-tree.c b/fs/btrfs/root-tree.c
index 9351428f30e2..67fa2d29d663 100644
--- a/fs/btrfs/root-tree.c
+++ b/fs/btrfs/root-tree.c
@@ -159,7 +159,6 @@ int btrfs_update_root(struct btrfs_trans_handle *trans, struct btrfs_root
159 write_extent_buffer(l, item, ptr, sizeof(*item)); 159 write_extent_buffer(l, item, ptr, sizeof(*item));
160 btrfs_mark_buffer_dirty(path->nodes[0]); 160 btrfs_mark_buffer_dirty(path->nodes[0]);
161out: 161out:
162 btrfs_release_path(root, path);
163 btrfs_free_path(path); 162 btrfs_free_path(path);
164 return ret; 163 return ret;
165} 164}
@@ -332,7 +331,6 @@ int btrfs_del_root(struct btrfs_trans_handle *trans, struct btrfs_root *root,
332 BUG_ON(refs != 0); 331 BUG_ON(refs != 0);
333 ret = btrfs_del_item(trans, root, path); 332 ret = btrfs_del_item(trans, root, path);
334out: 333out:
335 btrfs_release_path(root, path);
336 btrfs_free_path(path); 334 btrfs_free_path(path);
337 return ret; 335 return ret;
338} 336}
diff --git a/fs/btrfs/transaction.c b/fs/btrfs/transaction.c
index bca82a4ca8e6..c207e8c32c9b 100644
--- a/fs/btrfs/transaction.c
+++ b/fs/btrfs/transaction.c
@@ -163,8 +163,14 @@ static void wait_current_trans(struct btrfs_root *root)
163 } 163 }
164} 164}
165 165
166enum btrfs_trans_type {
167 TRANS_START,
168 TRANS_JOIN,
169 TRANS_USERSPACE,
170};
171
166static struct btrfs_trans_handle *start_transaction(struct btrfs_root *root, 172static struct btrfs_trans_handle *start_transaction(struct btrfs_root *root,
167 int num_blocks, int wait) 173 int num_blocks, int type)
168{ 174{
169 struct btrfs_trans_handle *h = 175 struct btrfs_trans_handle *h =
170 kmem_cache_alloc(btrfs_trans_handle_cachep, GFP_NOFS); 176 kmem_cache_alloc(btrfs_trans_handle_cachep, GFP_NOFS);
@@ -172,7 +178,8 @@ static struct btrfs_trans_handle *start_transaction(struct btrfs_root *root,
172 178
173 mutex_lock(&root->fs_info->trans_mutex); 179 mutex_lock(&root->fs_info->trans_mutex);
174 if (!root->fs_info->log_root_recovering && 180 if (!root->fs_info->log_root_recovering &&
175 ((wait == 1 && !root->fs_info->open_ioctl_trans) || wait == 2)) 181 ((type == TRANS_START && !root->fs_info->open_ioctl_trans) ||
182 type == TRANS_USERSPACE))
176 wait_current_trans(root); 183 wait_current_trans(root);
177 ret = join_transaction(root); 184 ret = join_transaction(root);
178 BUG_ON(ret); 185 BUG_ON(ret);
@@ -186,7 +193,7 @@ static struct btrfs_trans_handle *start_transaction(struct btrfs_root *root,
186 h->alloc_exclude_start = 0; 193 h->alloc_exclude_start = 0;
187 h->delayed_ref_updates = 0; 194 h->delayed_ref_updates = 0;
188 195
189 if (!current->journal_info) 196 if (!current->journal_info && type != TRANS_USERSPACE)
190 current->journal_info = h; 197 current->journal_info = h;
191 198
192 root->fs_info->running_transaction->use_count++; 199 root->fs_info->running_transaction->use_count++;
@@ -198,18 +205,18 @@ static struct btrfs_trans_handle *start_transaction(struct btrfs_root *root,
198struct btrfs_trans_handle *btrfs_start_transaction(struct btrfs_root *root, 205struct btrfs_trans_handle *btrfs_start_transaction(struct btrfs_root *root,
199 int num_blocks) 206 int num_blocks)
200{ 207{
201 return start_transaction(root, num_blocks, 1); 208 return start_transaction(root, num_blocks, TRANS_START);
202} 209}
203struct btrfs_trans_handle *btrfs_join_transaction(struct btrfs_root *root, 210struct btrfs_trans_handle *btrfs_join_transaction(struct btrfs_root *root,
204 int num_blocks) 211 int num_blocks)
205{ 212{
206 return start_transaction(root, num_blocks, 0); 213 return start_transaction(root, num_blocks, TRANS_JOIN);
207} 214}
208 215
209struct btrfs_trans_handle *btrfs_start_ioctl_transaction(struct btrfs_root *r, 216struct btrfs_trans_handle *btrfs_start_ioctl_transaction(struct btrfs_root *r,
210 int num_blocks) 217 int num_blocks)
211{ 218{
212 return start_transaction(r, num_blocks, 2); 219 return start_transaction(r, num_blocks, TRANS_USERSPACE);
213} 220}
214 221
215/* wait for a transaction commit to be fully complete */ 222/* wait for a transaction commit to be fully complete */
diff --git a/fs/cachefiles/interface.c b/fs/cachefiles/interface.c
index 431accd475a7..27089311fbea 100644
--- a/fs/cachefiles/interface.c
+++ b/fs/cachefiles/interface.c
@@ -114,8 +114,9 @@ nomem_lookup_data:
114 114
115/* 115/*
116 * attempt to look up the nominated node in this cache 116 * attempt to look up the nominated node in this cache
117 * - return -ETIMEDOUT to be scheduled again
117 */ 118 */
118static void cachefiles_lookup_object(struct fscache_object *_object) 119static int cachefiles_lookup_object(struct fscache_object *_object)
119{ 120{
120 struct cachefiles_lookup_data *lookup_data; 121 struct cachefiles_lookup_data *lookup_data;
121 struct cachefiles_object *parent, *object; 122 struct cachefiles_object *parent, *object;
@@ -145,13 +146,15 @@ static void cachefiles_lookup_object(struct fscache_object *_object)
145 object->fscache.cookie->def->type != FSCACHE_COOKIE_TYPE_INDEX) 146 object->fscache.cookie->def->type != FSCACHE_COOKIE_TYPE_INDEX)
146 cachefiles_attr_changed(&object->fscache); 147 cachefiles_attr_changed(&object->fscache);
147 148
148 if (ret < 0) { 149 if (ret < 0 && ret != -ETIMEDOUT) {
149 printk(KERN_WARNING "CacheFiles: Lookup failed error %d\n", 150 if (ret != -ENOBUFS)
150 ret); 151 printk(KERN_WARNING
152 "CacheFiles: Lookup failed error %d\n", ret);
151 fscache_object_lookup_error(&object->fscache); 153 fscache_object_lookup_error(&object->fscache);
152 } 154 }
153 155
154 _leave(" [%d]", ret); 156 _leave(" [%d]", ret);
157 return ret;
155} 158}
156 159
157/* 160/*
@@ -331,6 +334,7 @@ static void cachefiles_put_object(struct fscache_object *_object)
331 } 334 }
332 335
333 cache = object->fscache.cache; 336 cache = object->fscache.cache;
337 fscache_object_destroy(&object->fscache);
334 kmem_cache_free(cachefiles_object_jar, object); 338 kmem_cache_free(cachefiles_object_jar, object);
335 fscache_object_destroyed(cache); 339 fscache_object_destroyed(cache);
336 } 340 }
@@ -403,12 +407,26 @@ static int cachefiles_attr_changed(struct fscache_object *_object)
403 if (oi_size == ni_size) 407 if (oi_size == ni_size)
404 return 0; 408 return 0;
405 409
406 newattrs.ia_size = ni_size;
407 newattrs.ia_valid = ATTR_SIZE;
408
409 cachefiles_begin_secure(cache, &saved_cred); 410 cachefiles_begin_secure(cache, &saved_cred);
410 mutex_lock(&object->backer->d_inode->i_mutex); 411 mutex_lock(&object->backer->d_inode->i_mutex);
412
413 /* if there's an extension to a partial page at the end of the backing
414 * file, we need to discard the partial page so that we pick up new
415 * data after it */
416 if (oi_size & ~PAGE_MASK && ni_size > oi_size) {
417 _debug("discard tail %llx", oi_size);
418 newattrs.ia_valid = ATTR_SIZE;
419 newattrs.ia_size = oi_size & PAGE_MASK;
420 ret = notify_change(object->backer, &newattrs);
421 if (ret < 0)
422 goto truncate_failed;
423 }
424
425 newattrs.ia_valid = ATTR_SIZE;
426 newattrs.ia_size = ni_size;
411 ret = notify_change(object->backer, &newattrs); 427 ret = notify_change(object->backer, &newattrs);
428
429truncate_failed:
412 mutex_unlock(&object->backer->d_inode->i_mutex); 430 mutex_unlock(&object->backer->d_inode->i_mutex);
413 cachefiles_end_secure(cache, saved_cred); 431 cachefiles_end_secure(cache, saved_cred);
414 432
diff --git a/fs/cachefiles/namei.c b/fs/cachefiles/namei.c
index 4ce818ae39ea..14ac4806e291 100644
--- a/fs/cachefiles/namei.c
+++ b/fs/cachefiles/namei.c
@@ -21,17 +21,81 @@
21#include <linux/security.h> 21#include <linux/security.h>
22#include "internal.h" 22#include "internal.h"
23 23
24static int cachefiles_wait_bit(void *flags) 24#define CACHEFILES_KEYBUF_SIZE 512
25
26/*
27 * dump debugging info about an object
28 */
29static noinline
30void __cachefiles_printk_object(struct cachefiles_object *object,
31 const char *prefix,
32 u8 *keybuf)
25{ 33{
26 schedule(); 34 struct fscache_cookie *cookie;
27 return 0; 35 unsigned keylen, loop;
36
37 printk(KERN_ERR "%sobject: OBJ%x\n",
38 prefix, object->fscache.debug_id);
39 printk(KERN_ERR "%sobjstate=%s fl=%lx swfl=%lx ev=%lx[%lx]\n",
40 prefix, fscache_object_states[object->fscache.state],
41 object->fscache.flags, object->fscache.work.flags,
42 object->fscache.events,
43 object->fscache.event_mask & FSCACHE_OBJECT_EVENTS_MASK);
44 printk(KERN_ERR "%sops=%u inp=%u exc=%u\n",
45 prefix, object->fscache.n_ops, object->fscache.n_in_progress,
46 object->fscache.n_exclusive);
47 printk(KERN_ERR "%sparent=%p\n",
48 prefix, object->fscache.parent);
49
50 spin_lock(&object->fscache.lock);
51 cookie = object->fscache.cookie;
52 if (cookie) {
53 printk(KERN_ERR "%scookie=%p [pr=%p nd=%p fl=%lx]\n",
54 prefix,
55 object->fscache.cookie,
56 object->fscache.cookie->parent,
57 object->fscache.cookie->netfs_data,
58 object->fscache.cookie->flags);
59 if (keybuf)
60 keylen = cookie->def->get_key(cookie->netfs_data, keybuf,
61 CACHEFILES_KEYBUF_SIZE);
62 else
63 keylen = 0;
64 } else {
65 printk(KERN_ERR "%scookie=NULL\n", prefix);
66 keylen = 0;
67 }
68 spin_unlock(&object->fscache.lock);
69
70 if (keylen) {
71 printk(KERN_ERR "%skey=[%u] '", prefix, keylen);
72 for (loop = 0; loop < keylen; loop++)
73 printk("%02x", keybuf[loop]);
74 printk("'\n");
75 }
76}
77
78/*
79 * dump debugging info about a pair of objects
80 */
81static noinline void cachefiles_printk_object(struct cachefiles_object *object,
82 struct cachefiles_object *xobject)
83{
84 u8 *keybuf;
85
86 keybuf = kmalloc(CACHEFILES_KEYBUF_SIZE, GFP_NOIO);
87 if (object)
88 __cachefiles_printk_object(object, "", keybuf);
89 if (xobject)
90 __cachefiles_printk_object(xobject, "x", keybuf);
91 kfree(keybuf);
28} 92}
29 93
30/* 94/*
31 * record the fact that an object is now active 95 * record the fact that an object is now active
32 */ 96 */
33static void cachefiles_mark_object_active(struct cachefiles_cache *cache, 97static int cachefiles_mark_object_active(struct cachefiles_cache *cache,
34 struct cachefiles_object *object) 98 struct cachefiles_object *object)
35{ 99{
36 struct cachefiles_object *xobject; 100 struct cachefiles_object *xobject;
37 struct rb_node **_p, *_parent = NULL; 101 struct rb_node **_p, *_parent = NULL;
@@ -42,8 +106,11 @@ static void cachefiles_mark_object_active(struct cachefiles_cache *cache,
42try_again: 106try_again:
43 write_lock(&cache->active_lock); 107 write_lock(&cache->active_lock);
44 108
45 if (test_and_set_bit(CACHEFILES_OBJECT_ACTIVE, &object->flags)) 109 if (test_and_set_bit(CACHEFILES_OBJECT_ACTIVE, &object->flags)) {
110 printk(KERN_ERR "CacheFiles: Error: Object already active\n");
111 cachefiles_printk_object(object, NULL);
46 BUG(); 112 BUG();
113 }
47 114
48 dentry = object->dentry; 115 dentry = object->dentry;
49 _p = &cache->active_nodes.rb_node; 116 _p = &cache->active_nodes.rb_node;
@@ -66,8 +133,8 @@ try_again:
66 rb_insert_color(&object->active_node, &cache->active_nodes); 133 rb_insert_color(&object->active_node, &cache->active_nodes);
67 134
68 write_unlock(&cache->active_lock); 135 write_unlock(&cache->active_lock);
69 _leave(""); 136 _leave(" = 0");
70 return; 137 return 0;
71 138
72 /* an old object from a previous incarnation is hogging the slot - we 139 /* an old object from a previous incarnation is hogging the slot - we
73 * need to wait for it to be destroyed */ 140 * need to wait for it to be destroyed */
@@ -76,44 +143,70 @@ wait_for_old_object:
76 printk(KERN_ERR "\n"); 143 printk(KERN_ERR "\n");
77 printk(KERN_ERR "CacheFiles: Error:" 144 printk(KERN_ERR "CacheFiles: Error:"
78 " Unexpected object collision\n"); 145 " Unexpected object collision\n");
79 printk(KERN_ERR "xobject: OBJ%x\n", 146 cachefiles_printk_object(object, xobject);
80 xobject->fscache.debug_id);
81 printk(KERN_ERR "xobjstate=%s\n",
82 fscache_object_states[xobject->fscache.state]);
83 printk(KERN_ERR "xobjflags=%lx\n", xobject->fscache.flags);
84 printk(KERN_ERR "xobjevent=%lx [%lx]\n",
85 xobject->fscache.events, xobject->fscache.event_mask);
86 printk(KERN_ERR "xops=%u inp=%u exc=%u\n",
87 xobject->fscache.n_ops, xobject->fscache.n_in_progress,
88 xobject->fscache.n_exclusive);
89 printk(KERN_ERR "xcookie=%p [pr=%p nd=%p fl=%lx]\n",
90 xobject->fscache.cookie,
91 xobject->fscache.cookie->parent,
92 xobject->fscache.cookie->netfs_data,
93 xobject->fscache.cookie->flags);
94 printk(KERN_ERR "xparent=%p\n",
95 xobject->fscache.parent);
96 printk(KERN_ERR "object: OBJ%x\n",
97 object->fscache.debug_id);
98 printk(KERN_ERR "cookie=%p [pr=%p nd=%p fl=%lx]\n",
99 object->fscache.cookie,
100 object->fscache.cookie->parent,
101 object->fscache.cookie->netfs_data,
102 object->fscache.cookie->flags);
103 printk(KERN_ERR "parent=%p\n",
104 object->fscache.parent);
105 BUG(); 147 BUG();
106 } 148 }
107 atomic_inc(&xobject->usage); 149 atomic_inc(&xobject->usage);
108 write_unlock(&cache->active_lock); 150 write_unlock(&cache->active_lock);
109 151
110 _debug(">>> wait"); 152 if (test_bit(CACHEFILES_OBJECT_ACTIVE, &xobject->flags)) {
111 wait_on_bit(&xobject->flags, CACHEFILES_OBJECT_ACTIVE, 153 wait_queue_head_t *wq;
112 cachefiles_wait_bit, TASK_UNINTERRUPTIBLE); 154
113 _debug("<<< waited"); 155 signed long timeout = 60 * HZ;
156 wait_queue_t wait;
157 bool requeue;
158
159 /* if the object we're waiting for is queued for processing,
160 * then just put ourselves on the queue behind it */
161 if (slow_work_is_queued(&xobject->fscache.work)) {
162 _debug("queue OBJ%x behind OBJ%x immediately",
163 object->fscache.debug_id,
164 xobject->fscache.debug_id);
165 goto requeue;
166 }
167
168 /* otherwise we sleep until either the object we're waiting for
169 * is done, or the slow-work facility wants the thread back to
170 * do other work */
171 wq = bit_waitqueue(&xobject->flags, CACHEFILES_OBJECT_ACTIVE);
172 init_wait(&wait);
173 requeue = false;
174 do {
175 prepare_to_wait(wq, &wait, TASK_UNINTERRUPTIBLE);
176 if (!test_bit(CACHEFILES_OBJECT_ACTIVE, &xobject->flags))
177 break;
178 requeue = slow_work_sleep_till_thread_needed(
179 &object->fscache.work, &timeout);
180 } while (timeout > 0 && !requeue);
181 finish_wait(wq, &wait);
182
183 if (requeue &&
184 test_bit(CACHEFILES_OBJECT_ACTIVE, &xobject->flags)) {
185 _debug("queue OBJ%x behind OBJ%x after wait",
186 object->fscache.debug_id,
187 xobject->fscache.debug_id);
188 goto requeue;
189 }
190
191 if (timeout <= 0) {
192 printk(KERN_ERR "\n");
193 printk(KERN_ERR "CacheFiles: Error: Overlong"
194 " wait for old active object to go away\n");
195 cachefiles_printk_object(object, xobject);
196 goto requeue;
197 }
198 }
199
200 ASSERT(!test_bit(CACHEFILES_OBJECT_ACTIVE, &xobject->flags));
114 201
115 cache->cache.ops->put_object(&xobject->fscache); 202 cache->cache.ops->put_object(&xobject->fscache);
116 goto try_again; 203 goto try_again;
204
205requeue:
206 clear_bit(CACHEFILES_OBJECT_ACTIVE, &object->flags);
207 cache->cache.ops->put_object(&xobject->fscache);
208 _leave(" = -ETIMEDOUT");
209 return -ETIMEDOUT;
117} 210}
118 211
119/* 212/*
@@ -254,7 +347,7 @@ int cachefiles_delete_object(struct cachefiles_cache *cache,
254 347
255 dir = dget_parent(object->dentry); 348 dir = dget_parent(object->dentry);
256 349
257 mutex_lock(&dir->d_inode->i_mutex); 350 mutex_lock_nested(&dir->d_inode->i_mutex, I_MUTEX_PARENT);
258 ret = cachefiles_bury_object(cache, dir, object->dentry); 351 ret = cachefiles_bury_object(cache, dir, object->dentry);
259 352
260 dput(dir); 353 dput(dir);
@@ -307,7 +400,7 @@ lookup_again:
307 /* search the current directory for the element name */ 400 /* search the current directory for the element name */
308 _debug("lookup '%s'", name); 401 _debug("lookup '%s'", name);
309 402
310 mutex_lock(&dir->d_inode->i_mutex); 403 mutex_lock_nested(&dir->d_inode->i_mutex, I_MUTEX_PARENT);
311 404
312 start = jiffies; 405 start = jiffies;
313 next = lookup_one_len(name, dir, nlen); 406 next = lookup_one_len(name, dir, nlen);
@@ -418,12 +511,15 @@ lookup_again:
418 } 511 }
419 512
420 /* note that we're now using this object */ 513 /* note that we're now using this object */
421 cachefiles_mark_object_active(cache, object); 514 ret = cachefiles_mark_object_active(cache, object);
422 515
423 mutex_unlock(&dir->d_inode->i_mutex); 516 mutex_unlock(&dir->d_inode->i_mutex);
424 dput(dir); 517 dput(dir);
425 dir = NULL; 518 dir = NULL;
426 519
520 if (ret == -ETIMEDOUT)
521 goto mark_active_timed_out;
522
427 _debug("=== OBTAINED_OBJECT ==="); 523 _debug("=== OBTAINED_OBJECT ===");
428 524
429 if (object->new) { 525 if (object->new) {
@@ -467,6 +563,10 @@ create_error:
467 cachefiles_io_error(cache, "Create/mkdir failed"); 563 cachefiles_io_error(cache, "Create/mkdir failed");
468 goto error; 564 goto error;
469 565
566mark_active_timed_out:
567 _debug("mark active timed out");
568 goto release_dentry;
569
470check_error: 570check_error:
471 _debug("check error %d", ret); 571 _debug("check error %d", ret);
472 write_lock(&cache->active_lock); 572 write_lock(&cache->active_lock);
@@ -474,7 +574,7 @@ check_error:
474 clear_bit(CACHEFILES_OBJECT_ACTIVE, &object->flags); 574 clear_bit(CACHEFILES_OBJECT_ACTIVE, &object->flags);
475 wake_up_bit(&object->flags, CACHEFILES_OBJECT_ACTIVE); 575 wake_up_bit(&object->flags, CACHEFILES_OBJECT_ACTIVE);
476 write_unlock(&cache->active_lock); 576 write_unlock(&cache->active_lock);
477 577release_dentry:
478 dput(object->dentry); 578 dput(object->dentry);
479 object->dentry = NULL; 579 object->dentry = NULL;
480 goto error_out; 580 goto error_out;
@@ -495,9 +595,6 @@ error:
495error_out2: 595error_out2:
496 dput(dir); 596 dput(dir);
497error_out: 597error_out:
498 if (ret == -ENOSPC)
499 ret = -ENOBUFS;
500
501 _leave(" = error %d", -ret); 598 _leave(" = error %d", -ret);
502 return ret; 599 return ret;
503} 600}
diff --git a/fs/cachefiles/rdwr.c b/fs/cachefiles/rdwr.c
index a69787e7dd96..a6c8c6fe8df9 100644
--- a/fs/cachefiles/rdwr.c
+++ b/fs/cachefiles/rdwr.c
@@ -11,6 +11,7 @@
11 11
12#include <linux/mount.h> 12#include <linux/mount.h>
13#include <linux/file.h> 13#include <linux/file.h>
14#include <linux/ima.h>
14#include "internal.h" 15#include "internal.h"
15 16
16/* 17/*
@@ -40,8 +41,10 @@ static int cachefiles_read_waiter(wait_queue_t *wait, unsigned mode,
40 41
41 _debug("--- monitor %p %lx ---", page, page->flags); 42 _debug("--- monitor %p %lx ---", page, page->flags);
42 43
43 if (!PageUptodate(page) && !PageError(page)) 44 if (!PageUptodate(page) && !PageError(page)) {
44 dump_stack(); 45 /* unlocked, not uptodate and not erronous? */
46 _debug("page probably truncated");
47 }
45 48
46 /* remove from the waitqueue */ 49 /* remove from the waitqueue */
47 list_del(&wait->task_list); 50 list_del(&wait->task_list);
@@ -61,6 +64,84 @@ static int cachefiles_read_waiter(wait_queue_t *wait, unsigned mode,
61} 64}
62 65
63/* 66/*
67 * handle a probably truncated page
68 * - check to see if the page is still relevant and reissue the read if
69 * possible
70 * - return -EIO on error, -ENODATA if the page is gone, -EINPROGRESS if we
71 * must wait again and 0 if successful
72 */
73static int cachefiles_read_reissue(struct cachefiles_object *object,
74 struct cachefiles_one_read *monitor)
75{
76 struct address_space *bmapping = object->backer->d_inode->i_mapping;
77 struct page *backpage = monitor->back_page, *backpage2;
78 int ret;
79
80 kenter("{ino=%lx},{%lx,%lx}",
81 object->backer->d_inode->i_ino,
82 backpage->index, backpage->flags);
83
84 /* skip if the page was truncated away completely */
85 if (backpage->mapping != bmapping) {
86 kleave(" = -ENODATA [mapping]");
87 return -ENODATA;
88 }
89
90 backpage2 = find_get_page(bmapping, backpage->index);
91 if (!backpage2) {
92 kleave(" = -ENODATA [gone]");
93 return -ENODATA;
94 }
95
96 if (backpage != backpage2) {
97 put_page(backpage2);
98 kleave(" = -ENODATA [different]");
99 return -ENODATA;
100 }
101
102 /* the page is still there and we already have a ref on it, so we don't
103 * need a second */
104 put_page(backpage2);
105
106 INIT_LIST_HEAD(&monitor->op_link);
107 add_page_wait_queue(backpage, &monitor->monitor);
108
109 if (trylock_page(backpage)) {
110 ret = -EIO;
111 if (PageError(backpage))
112 goto unlock_discard;
113 ret = 0;
114 if (PageUptodate(backpage))
115 goto unlock_discard;
116
117 kdebug("reissue read");
118 ret = bmapping->a_ops->readpage(NULL, backpage);
119 if (ret < 0)
120 goto unlock_discard;
121 }
122
123 /* but the page may have been read before the monitor was installed, so
124 * the monitor may miss the event - so we have to ensure that we do get
125 * one in such a case */
126 if (trylock_page(backpage)) {
127 _debug("jumpstart %p {%lx}", backpage, backpage->flags);
128 unlock_page(backpage);
129 }
130
131 /* it'll reappear on the todo list */
132 kleave(" = -EINPROGRESS");
133 return -EINPROGRESS;
134
135unlock_discard:
136 unlock_page(backpage);
137 spin_lock_irq(&object->work_lock);
138 list_del(&monitor->op_link);
139 spin_unlock_irq(&object->work_lock);
140 kleave(" = %d", ret);
141 return ret;
142}
143
144/*
64 * copy data from backing pages to netfs pages to complete a read operation 145 * copy data from backing pages to netfs pages to complete a read operation
65 * - driven by FS-Cache's thread pool 146 * - driven by FS-Cache's thread pool
66 */ 147 */
@@ -92,20 +173,26 @@ static void cachefiles_read_copier(struct fscache_operation *_op)
92 173
93 _debug("- copy {%lu}", monitor->back_page->index); 174 _debug("- copy {%lu}", monitor->back_page->index);
94 175
95 error = -EIO; 176 recheck:
96 if (PageUptodate(monitor->back_page)) { 177 if (PageUptodate(monitor->back_page)) {
97 copy_highpage(monitor->netfs_page, monitor->back_page); 178 copy_highpage(monitor->netfs_page, monitor->back_page);
98 179
99 pagevec_add(&pagevec, monitor->netfs_page); 180 pagevec_add(&pagevec, monitor->netfs_page);
100 fscache_mark_pages_cached(monitor->op, &pagevec); 181 fscache_mark_pages_cached(monitor->op, &pagevec);
101 error = 0; 182 error = 0;
102 } 183 } else if (!PageError(monitor->back_page)) {
103 184 /* the page has probably been truncated */
104 if (error) 185 error = cachefiles_read_reissue(object, monitor);
186 if (error == -EINPROGRESS)
187 goto next;
188 goto recheck;
189 } else {
105 cachefiles_io_error_obj( 190 cachefiles_io_error_obj(
106 object, 191 object,
107 "Readpage failed on backing file %lx", 192 "Readpage failed on backing file %lx",
108 (unsigned long) monitor->back_page->flags); 193 (unsigned long) monitor->back_page->flags);
194 error = -EIO;
195 }
109 196
110 page_cache_release(monitor->back_page); 197 page_cache_release(monitor->back_page);
111 198
@@ -114,6 +201,7 @@ static void cachefiles_read_copier(struct fscache_operation *_op)
114 fscache_put_retrieval(op); 201 fscache_put_retrieval(op);
115 kfree(monitor); 202 kfree(monitor);
116 203
204 next:
117 /* let the thread pool have some air occasionally */ 205 /* let the thread pool have some air occasionally */
118 max--; 206 max--;
119 if (max < 0 || need_resched()) { 207 if (max < 0 || need_resched()) {
@@ -333,7 +421,8 @@ int cachefiles_read_or_alloc_page(struct fscache_retrieval *op,
333 421
334 shift = PAGE_SHIFT - inode->i_sb->s_blocksize_bits; 422 shift = PAGE_SHIFT - inode->i_sb->s_blocksize_bits;
335 423
336 op->op.flags = FSCACHE_OP_FAST; 424 op->op.flags &= FSCACHE_OP_KEEP_FLAGS;
425 op->op.flags |= FSCACHE_OP_FAST;
337 op->op.processor = cachefiles_read_copier; 426 op->op.processor = cachefiles_read_copier;
338 427
339 pagevec_init(&pagevec, 0); 428 pagevec_init(&pagevec, 0);
@@ -639,7 +728,8 @@ int cachefiles_read_or_alloc_pages(struct fscache_retrieval *op,
639 728
640 pagevec_init(&pagevec, 0); 729 pagevec_init(&pagevec, 0);
641 730
642 op->op.flags = FSCACHE_OP_FAST; 731 op->op.flags &= FSCACHE_OP_KEEP_FLAGS;
732 op->op.flags |= FSCACHE_OP_FAST;
643 op->op.processor = cachefiles_read_copier; 733 op->op.processor = cachefiles_read_copier;
644 734
645 INIT_LIST_HEAD(&backpages); 735 INIT_LIST_HEAD(&backpages);
@@ -801,7 +891,8 @@ int cachefiles_write_page(struct fscache_storage *op, struct page *page)
801 struct cachefiles_cache *cache; 891 struct cachefiles_cache *cache;
802 mm_segment_t old_fs; 892 mm_segment_t old_fs;
803 struct file *file; 893 struct file *file;
804 loff_t pos; 894 loff_t pos, eof;
895 size_t len;
805 void *data; 896 void *data;
806 int ret; 897 int ret;
807 898
@@ -832,18 +923,33 @@ int cachefiles_write_page(struct fscache_storage *op, struct page *page)
832 if (IS_ERR(file)) { 923 if (IS_ERR(file)) {
833 ret = PTR_ERR(file); 924 ret = PTR_ERR(file);
834 } else { 925 } else {
926 ima_counts_get(file);
835 ret = -EIO; 927 ret = -EIO;
836 if (file->f_op->write) { 928 if (file->f_op->write) {
837 pos = (loff_t) page->index << PAGE_SHIFT; 929 pos = (loff_t) page->index << PAGE_SHIFT;
930
931 /* we mustn't write more data than we have, so we have
932 * to beware of a partial page at EOF */
933 eof = object->fscache.store_limit_l;
934 len = PAGE_SIZE;
935 if (eof & ~PAGE_MASK) {
936 ASSERTCMP(pos, <, eof);
937 if (eof - pos < PAGE_SIZE) {
938 _debug("cut short %llx to %llx",
939 pos, eof);
940 len = eof - pos;
941 ASSERTCMP(pos + len, ==, eof);
942 }
943 }
944
838 data = kmap(page); 945 data = kmap(page);
839 old_fs = get_fs(); 946 old_fs = get_fs();
840 set_fs(KERNEL_DS); 947 set_fs(KERNEL_DS);
841 ret = file->f_op->write( 948 ret = file->f_op->write(
842 file, (const void __user *) data, PAGE_SIZE, 949 file, (const void __user *) data, len, &pos);
843 &pos);
844 set_fs(old_fs); 950 set_fs(old_fs);
845 kunmap(page); 951 kunmap(page);
846 if (ret != PAGE_SIZE) 952 if (ret != len)
847 ret = -EIO; 953 ret = -EIO;
848 } 954 }
849 fput(file); 955 fput(file);
diff --git a/fs/cifs/CHANGES b/fs/cifs/CHANGES
index 145540a316ab..094ea65afc85 100644
--- a/fs/cifs/CHANGES
+++ b/fs/cifs/CHANGES
@@ -1,3 +1,12 @@
1Version 1.61
2------------
3Fix append problem to Samba servers (files opened with O_APPEND could
4have duplicated data). Fix oops in cifs_lookup. Workaround problem
5mounting to OS/400 Netserve. Fix oops in cifs_get_tcp_session.
6Disable use of server inode numbers when server only
7partially supports them (e.g. for one server querying inode numbers on
8FindFirst fails but QPathInfo queries works).
9
1Version 1.60 10Version 1.60
2------------- 11-------------
3Fix memory leak in reconnect. Fix oops in DFS mount error path. 12Fix memory leak in reconnect. Fix oops in DFS mount error path.
diff --git a/fs/cifs/cifsfs.c b/fs/cifs/cifsfs.c
index 9a5e4f5f3122..29f1da761bbf 100644
--- a/fs/cifs/cifsfs.c
+++ b/fs/cifs/cifsfs.c
@@ -1037,7 +1037,7 @@ init_cifs(void)
1037 if (rc) 1037 if (rc)
1038 goto out_unregister_key_type; 1038 goto out_unregister_key_type;
1039#endif 1039#endif
1040 rc = slow_work_register_user(); 1040 rc = slow_work_register_user(THIS_MODULE);
1041 if (rc) 1041 if (rc)
1042 goto out_unregister_resolver_key; 1042 goto out_unregister_resolver_key;
1043 1043
diff --git a/fs/cifs/cifsproto.h b/fs/cifs/cifsproto.h
index 6928c24d1d42..5646727e33f5 100644
--- a/fs/cifs/cifsproto.h
+++ b/fs/cifs/cifsproto.h
@@ -388,4 +388,5 @@ extern int CIFSSMBSetPosixACL(const int xid, struct cifsTconInfo *tcon,
388 const struct nls_table *nls_codepage, int remap_special_chars); 388 const struct nls_table *nls_codepage, int remap_special_chars);
389extern int CIFSGetExtAttr(const int xid, struct cifsTconInfo *tcon, 389extern int CIFSGetExtAttr(const int xid, struct cifsTconInfo *tcon,
390 const int netfid, __u64 *pExtAttrBits, __u64 *pMask); 390 const int netfid, __u64 *pExtAttrBits, __u64 *pMask);
391extern void cifs_autodisable_serverino(struct cifs_sb_info *cifs_sb);
391#endif /* _CIFSPROTO_H */ 392#endif /* _CIFSPROTO_H */
diff --git a/fs/cifs/connect.c b/fs/cifs/connect.c
index b09098079916..63ea83ff687f 100644
--- a/fs/cifs/connect.c
+++ b/fs/cifs/connect.c
@@ -2220,16 +2220,8 @@ is_path_accessible(int xid, struct cifsTconInfo *tcon,
2220 struct cifs_sb_info *cifs_sb, const char *full_path) 2220 struct cifs_sb_info *cifs_sb, const char *full_path)
2221{ 2221{
2222 int rc; 2222 int rc;
2223 __u64 inode_num;
2224 FILE_ALL_INFO *pfile_info; 2223 FILE_ALL_INFO *pfile_info;
2225 2224
2226 rc = CIFSGetSrvInodeNumber(xid, tcon, full_path, &inode_num,
2227 cifs_sb->local_nls,
2228 cifs_sb->mnt_cifs_flags &
2229 CIFS_MOUNT_MAP_SPECIAL_CHR);
2230 if (rc != -EOPNOTSUPP)
2231 return rc;
2232
2233 pfile_info = kmalloc(sizeof(FILE_ALL_INFO), GFP_KERNEL); 2225 pfile_info = kmalloc(sizeof(FILE_ALL_INFO), GFP_KERNEL);
2234 if (pfile_info == NULL) 2226 if (pfile_info == NULL)
2235 return -ENOMEM; 2227 return -ENOMEM;
diff --git a/fs/cifs/dir.c b/fs/cifs/dir.c
index 627a60a6c1b1..1f42f772865a 100644
--- a/fs/cifs/dir.c
+++ b/fs/cifs/dir.c
@@ -214,8 +214,6 @@ int cifs_posix_open(char *full_path, struct inode **pinode,
214 posix_flags |= SMB_O_EXCL; 214 posix_flags |= SMB_O_EXCL;
215 if (oflags & O_TRUNC) 215 if (oflags & O_TRUNC)
216 posix_flags |= SMB_O_TRUNC; 216 posix_flags |= SMB_O_TRUNC;
217 if (oflags & O_APPEND)
218 posix_flags |= SMB_O_APPEND;
219 if (oflags & O_SYNC) 217 if (oflags & O_SYNC)
220 posix_flags |= SMB_O_SYNC; 218 posix_flags |= SMB_O_SYNC;
221 if (oflags & O_DIRECTORY) 219 if (oflags & O_DIRECTORY)
@@ -643,9 +641,9 @@ cifs_lookup(struct inode *parent_dir_inode, struct dentry *direntry,
643 * O_EXCL: optimize away the lookup, but don't hash the dentry. Let 641 * O_EXCL: optimize away the lookup, but don't hash the dentry. Let
644 * the VFS handle the create. 642 * the VFS handle the create.
645 */ 643 */
646 if (nd->flags & LOOKUP_EXCL) { 644 if (nd && (nd->flags & LOOKUP_EXCL)) {
647 d_instantiate(direntry, NULL); 645 d_instantiate(direntry, NULL);
648 return 0; 646 return NULL;
649 } 647 }
650 648
651 /* can not grab the rename sem here since it would 649 /* can not grab the rename sem here since it would
@@ -675,7 +673,7 @@ cifs_lookup(struct inode *parent_dir_inode, struct dentry *direntry,
675 * reduction in network traffic in the other paths. 673 * reduction in network traffic in the other paths.
676 */ 674 */
677 if (pTcon->unix_ext) { 675 if (pTcon->unix_ext) {
678 if (!(nd->flags & (LOOKUP_PARENT | LOOKUP_DIRECTORY)) && 676 if (nd && !(nd->flags & (LOOKUP_PARENT | LOOKUP_DIRECTORY)) &&
679 (nd->flags & LOOKUP_OPEN) && !pTcon->broken_posix_open && 677 (nd->flags & LOOKUP_OPEN) && !pTcon->broken_posix_open &&
680 (nd->intent.open.flags & O_CREAT)) { 678 (nd->intent.open.flags & O_CREAT)) {
681 rc = cifs_posix_open(full_path, &newInode, nd->path.mnt, 679 rc = cifs_posix_open(full_path, &newInode, nd->path.mnt,
diff --git a/fs/cifs/inode.c b/fs/cifs/inode.c
index 5e2492535daa..cababd8a52df 100644
--- a/fs/cifs/inode.c
+++ b/fs/cifs/inode.c
@@ -512,13 +512,10 @@ int cifs_get_inode_info(struct inode **pinode,
512 cifs_sb->local_nls, 512 cifs_sb->local_nls,
513 cifs_sb->mnt_cifs_flags & 513 cifs_sb->mnt_cifs_flags &
514 CIFS_MOUNT_MAP_SPECIAL_CHR); 514 CIFS_MOUNT_MAP_SPECIAL_CHR);
515 if (rc1) { 515 if (rc1 || !fattr.cf_uniqueid) {
516 cFYI(1, ("GetSrvInodeNum rc %d", rc1)); 516 cFYI(1, ("GetSrvInodeNum rc %d", rc1));
517 fattr.cf_uniqueid = iunique(sb, ROOT_I); 517 fattr.cf_uniqueid = iunique(sb, ROOT_I);
518 /* disable serverino if call not supported */ 518 cifs_autodisable_serverino(cifs_sb);
519 if (rc1 == -EINVAL)
520 cifs_sb->mnt_cifs_flags &=
521 ~CIFS_MOUNT_SERVER_INUM;
522 } 519 }
523 } else { 520 } else {
524 fattr.cf_uniqueid = iunique(sb, ROOT_I); 521 fattr.cf_uniqueid = iunique(sb, ROOT_I);
diff --git a/fs/cifs/misc.c b/fs/cifs/misc.c
index 0241b25ac33f..d27d4ec6579b 100644
--- a/fs/cifs/misc.c
+++ b/fs/cifs/misc.c
@@ -715,3 +715,17 @@ cifsConvertToUCS(__le16 *target, const char *source, int maxlen,
715ctoUCS_out: 715ctoUCS_out:
716 return i; 716 return i;
717} 717}
718
719void
720cifs_autodisable_serverino(struct cifs_sb_info *cifs_sb)
721{
722 if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_SERVER_INUM) {
723 cifs_sb->mnt_cifs_flags &= ~CIFS_MOUNT_SERVER_INUM;
724 cERROR(1, ("Autodisabling the use of server inode numbers on "
725 "%s. This server doesn't seem to support them "
726 "properly. Hardlinks will not be recognized on this "
727 "mount. Consider mounting with the \"noserverino\" "
728 "option to silence this message.",
729 cifs_sb->tcon->treeName));
730 }
731}
diff --git a/fs/cifs/readdir.c b/fs/cifs/readdir.c
index 1f098ca71636..f84062f9a985 100644
--- a/fs/cifs/readdir.c
+++ b/fs/cifs/readdir.c
@@ -727,11 +727,12 @@ static int cifs_filldir(char *pfindEntry, struct file *file, filldir_t filldir,
727 cifs_dir_info_to_fattr(&fattr, (FILE_DIRECTORY_INFO *) 727 cifs_dir_info_to_fattr(&fattr, (FILE_DIRECTORY_INFO *)
728 pfindEntry, cifs_sb); 728 pfindEntry, cifs_sb);
729 729
730 /* FIXME: make _to_fattr functions fill this out */ 730 if (inum && (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_SERVER_INUM)) {
731 if (pCifsF->srch_inf.info_level == SMB_FIND_FILE_ID_FULL_DIR_INFO)
732 fattr.cf_uniqueid = inum; 731 fattr.cf_uniqueid = inum;
733 else 732 } else {
734 fattr.cf_uniqueid = iunique(sb, ROOT_I); 733 fattr.cf_uniqueid = iunique(sb, ROOT_I);
734 cifs_autodisable_serverino(cifs_sb);
735 }
735 736
736 ino = cifs_uniqueid_to_ino_t(fattr.cf_uniqueid); 737 ino = cifs_uniqueid_to_ino_t(fattr.cf_uniqueid);
737 tmp_dentry = cifs_readdir_lookup(file->f_dentry, &qstring, &fattr); 738 tmp_dentry = cifs_readdir_lookup(file->f_dentry, &qstring, &fattr);
diff --git a/fs/compat.c b/fs/compat.c
index d576b552e8e2..6c19040ffeef 100644
--- a/fs/compat.c
+++ b/fs/compat.c
@@ -1532,6 +1532,8 @@ int compat_do_execve(char * filename,
1532 if (retval < 0) 1532 if (retval < 0)
1533 goto out; 1533 goto out;
1534 1534
1535 current->stack_start = current->mm->start_stack;
1536
1535 /* execve succeeded */ 1537 /* execve succeeded */
1536 current->fs->in_exec = 0; 1538 current->fs->in_exec = 0;
1537 current->in_execve = 0; 1539 current->in_execve = 0;
diff --git a/fs/compat_ioctl.c b/fs/compat_ioctl.c
index f91fd51b32e3..d84e7058c298 100644
--- a/fs/compat_ioctl.c
+++ b/fs/compat_ioctl.c
@@ -1800,7 +1800,7 @@ struct space_resv_32 {
1800/* just account for different alignment */ 1800/* just account for different alignment */
1801static int compat_ioctl_preallocate(struct file *file, unsigned long arg) 1801static int compat_ioctl_preallocate(struct file *file, unsigned long arg)
1802{ 1802{
1803 struct space_resv_32 __user *p32 = (void __user *)arg; 1803 struct space_resv_32 __user *p32 = compat_ptr(arg);
1804 struct space_resv __user *p = compat_alloc_user_space(sizeof(*p)); 1804 struct space_resv __user *p = compat_alloc_user_space(sizeof(*p));
1805 1805
1806 if (copy_in_user(&p->l_type, &p32->l_type, sizeof(s16)) || 1806 if (copy_in_user(&p->l_type, &p32->l_type, sizeof(s16)) ||
@@ -2802,7 +2802,7 @@ asmlinkage long compat_sys_ioctl(unsigned int fd, unsigned int cmd,
2802#else 2802#else
2803 case FS_IOC_RESVSP: 2803 case FS_IOC_RESVSP:
2804 case FS_IOC_RESVSP64: 2804 case FS_IOC_RESVSP64:
2805 error = ioctl_preallocate(filp, (void __user *)arg); 2805 error = ioctl_preallocate(filp, compat_ptr(arg));
2806 goto out_fput; 2806 goto out_fput;
2807#endif 2807#endif
2808 2808
diff --git a/fs/exec.c b/fs/exec.c
index d49be6bc1793..c0c636e34f60 100644
--- a/fs/exec.c
+++ b/fs/exec.c
@@ -46,7 +46,6 @@
46#include <linux/proc_fs.h> 46#include <linux/proc_fs.h>
47#include <linux/mount.h> 47#include <linux/mount.h>
48#include <linux/security.h> 48#include <linux/security.h>
49#include <linux/ima.h>
50#include <linux/syscalls.h> 49#include <linux/syscalls.h>
51#include <linux/tsacct_kern.h> 50#include <linux/tsacct_kern.h>
52#include <linux/cn_proc.h> 51#include <linux/cn_proc.h>
@@ -624,10 +623,8 @@ int setup_arg_pages(struct linux_binprm *bprm,
624 /* Move stack pages down in memory. */ 623 /* Move stack pages down in memory. */
625 if (stack_shift) { 624 if (stack_shift) {
626 ret = shift_arg_pages(vma, stack_shift); 625 ret = shift_arg_pages(vma, stack_shift);
627 if (ret) { 626 if (ret)
628 up_write(&mm->mmap_sem); 627 goto out_unlock;
629 return ret;
630 }
631 } 628 }
632 629
633#ifdef CONFIG_STACK_GROWSUP 630#ifdef CONFIG_STACK_GROWSUP
@@ -641,7 +638,7 @@ int setup_arg_pages(struct linux_binprm *bprm,
641 638
642out_unlock: 639out_unlock:
643 up_write(&mm->mmap_sem); 640 up_write(&mm->mmap_sem);
644 return 0; 641 return ret;
645} 642}
646EXPORT_SYMBOL(setup_arg_pages); 643EXPORT_SYMBOL(setup_arg_pages);
647 644
@@ -1211,9 +1208,6 @@ int search_binary_handler(struct linux_binprm *bprm,struct pt_regs *regs)
1211 retval = security_bprm_check(bprm); 1208 retval = security_bprm_check(bprm);
1212 if (retval) 1209 if (retval)
1213 return retval; 1210 return retval;
1214 retval = ima_bprm_check(bprm);
1215 if (retval)
1216 return retval;
1217 1211
1218 /* kernel module loader fixup */ 1212 /* kernel module loader fixup */
1219 /* so we don't try to load run modprobe in kernel space. */ 1213 /* so we don't try to load run modprobe in kernel space. */
diff --git a/fs/ext3/fsync.c b/fs/ext3/fsync.c
index 451d166bbe93..8209f266e9ad 100644
--- a/fs/ext3/fsync.c
+++ b/fs/ext3/fsync.c
@@ -46,19 +46,21 @@
46int ext3_sync_file(struct file * file, struct dentry *dentry, int datasync) 46int ext3_sync_file(struct file * file, struct dentry *dentry, int datasync)
47{ 47{
48 struct inode *inode = dentry->d_inode; 48 struct inode *inode = dentry->d_inode;
49 struct ext3_inode_info *ei = EXT3_I(inode);
50 journal_t *journal = EXT3_SB(inode->i_sb)->s_journal;
49 int ret = 0; 51 int ret = 0;
52 tid_t commit_tid;
53
54 if (inode->i_sb->s_flags & MS_RDONLY)
55 return 0;
50 56
51 J_ASSERT(ext3_journal_current_handle() == NULL); 57 J_ASSERT(ext3_journal_current_handle() == NULL);
52 58
53 /* 59 /*
54 * data=writeback: 60 * data=writeback,ordered:
55 * The caller's filemap_fdatawrite()/wait will sync the data. 61 * The caller's filemap_fdatawrite()/wait will sync the data.
56 * sync_inode() will sync the metadata 62 * Metadata is in the journal, we wait for a proper transaction
57 * 63 * to commit here.
58 * data=ordered:
59 * The caller's filemap_fdatawrite() will write the data and
60 * sync_inode() will write the inode if it is dirty. Then the caller's
61 * filemap_fdatawait() will wait on the pages.
62 * 64 *
63 * data=journal: 65 * data=journal:
64 * filemap_fdatawrite won't do anything (the buffers are clean). 66 * filemap_fdatawrite won't do anything (the buffers are clean).
@@ -73,22 +75,16 @@ int ext3_sync_file(struct file * file, struct dentry *dentry, int datasync)
73 goto out; 75 goto out;
74 } 76 }
75 77
76 if (datasync && !(inode->i_state & I_DIRTY_DATASYNC)) 78 if (datasync)
77 goto flush; 79 commit_tid = atomic_read(&ei->i_datasync_tid);
80 else
81 commit_tid = atomic_read(&ei->i_sync_tid);
78 82
79 /* 83 if (log_start_commit(journal, commit_tid)) {
80 * The VFS has written the file data. If the inode is unaltered 84 log_wait_commit(journal, commit_tid);
81 * then we need not start a commit.
82 */
83 if (inode->i_state & (I_DIRTY_SYNC|I_DIRTY_DATASYNC)) {
84 struct writeback_control wbc = {
85 .sync_mode = WB_SYNC_ALL,
86 .nr_to_write = 0, /* sys_fsync did this */
87 };
88 ret = sync_inode(inode, &wbc);
89 goto out; 85 goto out;
90 } 86 }
91flush: 87
92 /* 88 /*
93 * In case we didn't commit a transaction, we have to flush 89 * In case we didn't commit a transaction, we have to flush
94 * disk caches manually so that data really is on persistent 90 * disk caches manually so that data really is on persistent
diff --git a/fs/ext3/inode.c b/fs/ext3/inode.c
index acf1b1423327..354ed3b47b30 100644
--- a/fs/ext3/inode.c
+++ b/fs/ext3/inode.c
@@ -699,8 +699,9 @@ static int ext3_splice_branch(handle_t *handle, struct inode *inode,
699 int err = 0; 699 int err = 0;
700 struct ext3_block_alloc_info *block_i; 700 struct ext3_block_alloc_info *block_i;
701 ext3_fsblk_t current_block; 701 ext3_fsblk_t current_block;
702 struct ext3_inode_info *ei = EXT3_I(inode);
702 703
703 block_i = EXT3_I(inode)->i_block_alloc_info; 704 block_i = ei->i_block_alloc_info;
704 /* 705 /*
705 * If we're splicing into a [td]indirect block (as opposed to the 706 * If we're splicing into a [td]indirect block (as opposed to the
706 * inode) then we need to get write access to the [td]indirect block 707 * inode) then we need to get write access to the [td]indirect block
@@ -741,6 +742,8 @@ static int ext3_splice_branch(handle_t *handle, struct inode *inode,
741 742
742 inode->i_ctime = CURRENT_TIME_SEC; 743 inode->i_ctime = CURRENT_TIME_SEC;
743 ext3_mark_inode_dirty(handle, inode); 744 ext3_mark_inode_dirty(handle, inode);
745 /* ext3_mark_inode_dirty already updated i_sync_tid */
746 atomic_set(&ei->i_datasync_tid, handle->h_transaction->t_tid);
744 747
745 /* had we spliced it onto indirect block? */ 748 /* had we spliced it onto indirect block? */
746 if (where->bh) { 749 if (where->bh) {
@@ -1735,6 +1738,7 @@ static ssize_t ext3_direct_IO(int rw, struct kiocb *iocb,
1735 ssize_t ret; 1738 ssize_t ret;
1736 int orphan = 0; 1739 int orphan = 0;
1737 size_t count = iov_length(iov, nr_segs); 1740 size_t count = iov_length(iov, nr_segs);
1741 int retries = 0;
1738 1742
1739 if (rw == WRITE) { 1743 if (rw == WRITE) {
1740 loff_t final_size = offset + count; 1744 loff_t final_size = offset + count;
@@ -1757,9 +1761,12 @@ static ssize_t ext3_direct_IO(int rw, struct kiocb *iocb,
1757 } 1761 }
1758 } 1762 }
1759 1763
1764retry:
1760 ret = blockdev_direct_IO(rw, iocb, inode, inode->i_sb->s_bdev, iov, 1765 ret = blockdev_direct_IO(rw, iocb, inode, inode->i_sb->s_bdev, iov,
1761 offset, nr_segs, 1766 offset, nr_segs,
1762 ext3_get_block, NULL); 1767 ext3_get_block, NULL);
1768 if (ret == -ENOSPC && ext3_should_retry_alloc(inode->i_sb, &retries))
1769 goto retry;
1763 1770
1764 if (orphan) { 1771 if (orphan) {
1765 int err; 1772 int err;
@@ -2750,6 +2757,8 @@ struct inode *ext3_iget(struct super_block *sb, unsigned long ino)
2750 struct ext3_inode_info *ei; 2757 struct ext3_inode_info *ei;
2751 struct buffer_head *bh; 2758 struct buffer_head *bh;
2752 struct inode *inode; 2759 struct inode *inode;
2760 journal_t *journal = EXT3_SB(sb)->s_journal;
2761 transaction_t *transaction;
2753 long ret; 2762 long ret;
2754 int block; 2763 int block;
2755 2764
@@ -2827,6 +2836,30 @@ struct inode *ext3_iget(struct super_block *sb, unsigned long ino)
2827 ei->i_data[block] = raw_inode->i_block[block]; 2836 ei->i_data[block] = raw_inode->i_block[block];
2828 INIT_LIST_HEAD(&ei->i_orphan); 2837 INIT_LIST_HEAD(&ei->i_orphan);
2829 2838
2839 /*
2840 * Set transaction id's of transactions that have to be committed
2841 * to finish f[data]sync. We set them to currently running transaction
2842 * as we cannot be sure that the inode or some of its metadata isn't
2843 * part of the transaction - the inode could have been reclaimed and
2844 * now it is reread from disk.
2845 */
2846 if (journal) {
2847 tid_t tid;
2848
2849 spin_lock(&journal->j_state_lock);
2850 if (journal->j_running_transaction)
2851 transaction = journal->j_running_transaction;
2852 else
2853 transaction = journal->j_committing_transaction;
2854 if (transaction)
2855 tid = transaction->t_tid;
2856 else
2857 tid = journal->j_commit_sequence;
2858 spin_unlock(&journal->j_state_lock);
2859 atomic_set(&ei->i_sync_tid, tid);
2860 atomic_set(&ei->i_datasync_tid, tid);
2861 }
2862
2830 if (inode->i_ino >= EXT3_FIRST_INO(inode->i_sb) + 1 && 2863 if (inode->i_ino >= EXT3_FIRST_INO(inode->i_sb) + 1 &&
2831 EXT3_INODE_SIZE(inode->i_sb) > EXT3_GOOD_OLD_INODE_SIZE) { 2864 EXT3_INODE_SIZE(inode->i_sb) > EXT3_GOOD_OLD_INODE_SIZE) {
2832 /* 2865 /*
@@ -3011,6 +3044,7 @@ again:
3011 err = rc; 3044 err = rc;
3012 ei->i_state &= ~EXT3_STATE_NEW; 3045 ei->i_state &= ~EXT3_STATE_NEW;
3013 3046
3047 atomic_set(&ei->i_sync_tid, handle->h_transaction->t_tid);
3014out_brelse: 3048out_brelse:
3015 brelse (bh); 3049 brelse (bh);
3016 ext3_std_error(inode->i_sb, err); 3050 ext3_std_error(inode->i_sb, err);
diff --git a/fs/ext3/super.c b/fs/ext3/super.c
index 7a520a862f49..427496c4767c 100644
--- a/fs/ext3/super.c
+++ b/fs/ext3/super.c
@@ -466,6 +466,8 @@ static struct inode *ext3_alloc_inode(struct super_block *sb)
466 return NULL; 466 return NULL;
467 ei->i_block_alloc_info = NULL; 467 ei->i_block_alloc_info = NULL;
468 ei->vfs_inode.i_version = 1; 468 ei->vfs_inode.i_version = 1;
469 atomic_set(&ei->i_datasync_tid, 0);
470 atomic_set(&ei->i_sync_tid, 0);
469 return &ei->vfs_inode; 471 return &ei->vfs_inode;
470} 472}
471 473
diff --git a/fs/ext4/ext4.h b/fs/ext4/ext4.h
index 00d153f2f261..8825515eeddd 100644
--- a/fs/ext4/ext4.h
+++ b/fs/ext4/ext4.h
@@ -322,6 +322,7 @@ static inline __u32 ext4_mask_flags(umode_t mode, __u32 flags)
322#define EXT4_STATE_NO_EXPAND 0x00000008 /* No space for expansion */ 322#define EXT4_STATE_NO_EXPAND 0x00000008 /* No space for expansion */
323#define EXT4_STATE_DA_ALLOC_CLOSE 0x00000010 /* Alloc DA blks on close */ 323#define EXT4_STATE_DA_ALLOC_CLOSE 0x00000010 /* Alloc DA blks on close */
324#define EXT4_STATE_EXT_MIGRATE 0x00000020 /* Inode is migrating */ 324#define EXT4_STATE_EXT_MIGRATE 0x00000020 /* Inode is migrating */
325#define EXT4_STATE_DIO_UNWRITTEN 0x00000040 /* need convert on dio done*/
325 326
326/* Used to pass group descriptor data when online resize is done */ 327/* Used to pass group descriptor data when online resize is done */
327struct ext4_new_group_input { 328struct ext4_new_group_input {
diff --git a/fs/ext4/extents.c b/fs/ext4/extents.c
index 10539e364283..715264b4bae4 100644
--- a/fs/ext4/extents.c
+++ b/fs/ext4/extents.c
@@ -2807,6 +2807,8 @@ fix_extent_len:
2807 * into three uninitialized extent(at most). After IO complete, the part 2807 * into three uninitialized extent(at most). After IO complete, the part
2808 * being filled will be convert to initialized by the end_io callback function 2808 * being filled will be convert to initialized by the end_io callback function
2809 * via ext4_convert_unwritten_extents(). 2809 * via ext4_convert_unwritten_extents().
2810 *
2811 * Returns the size of uninitialized extent to be written on success.
2810 */ 2812 */
2811static int ext4_split_unwritten_extents(handle_t *handle, 2813static int ext4_split_unwritten_extents(handle_t *handle,
2812 struct inode *inode, 2814 struct inode *inode,
@@ -2824,7 +2826,6 @@ static int ext4_split_unwritten_extents(handle_t *handle,
2824 unsigned int allocated, ee_len, depth; 2826 unsigned int allocated, ee_len, depth;
2825 ext4_fsblk_t newblock; 2827 ext4_fsblk_t newblock;
2826 int err = 0; 2828 int err = 0;
2827 int ret = 0;
2828 2829
2829 ext_debug("ext4_split_unwritten_extents: inode %lu," 2830 ext_debug("ext4_split_unwritten_extents: inode %lu,"
2830 "iblock %llu, max_blocks %u\n", inode->i_ino, 2831 "iblock %llu, max_blocks %u\n", inode->i_ino,
@@ -2842,12 +2843,12 @@ static int ext4_split_unwritten_extents(handle_t *handle,
2842 ext4_ext_store_pblock(&orig_ex, ext_pblock(ex)); 2843 ext4_ext_store_pblock(&orig_ex, ext_pblock(ex));
2843 2844
2844 /* 2845 /*
2845 * if the entire unintialized extent length less than 2846 * If the uninitialized extent begins at the same logical
2846 * the size of extent to write, there is no need to split 2847 * block where the write begins, and the write completely
2847 * uninitialized extent 2848 * covers the extent, then we don't need to split it.
2848 */ 2849 */
2849 if (allocated <= max_blocks) 2850 if ((iblock == ee_block) && (allocated <= max_blocks))
2850 return ret; 2851 return allocated;
2851 2852
2852 err = ext4_ext_get_access(handle, inode, path + depth); 2853 err = ext4_ext_get_access(handle, inode, path + depth);
2853 if (err) 2854 if (err)
@@ -3048,12 +3049,18 @@ ext4_ext_handle_uninitialized_extents(handle_t *handle, struct inode *inode,
3048 ret = ext4_split_unwritten_extents(handle, 3049 ret = ext4_split_unwritten_extents(handle,
3049 inode, path, iblock, 3050 inode, path, iblock,
3050 max_blocks, flags); 3051 max_blocks, flags);
3051 /* flag the io_end struct that we need convert when IO done */ 3052 /*
3053 * Flag the inode(non aio case) or end_io struct (aio case)
3054 * that this IO needs to convertion to written when IO is
3055 * completed
3056 */
3052 if (io) 3057 if (io)
3053 io->flag = DIO_AIO_UNWRITTEN; 3058 io->flag = DIO_AIO_UNWRITTEN;
3059 else
3060 EXT4_I(inode)->i_state |= EXT4_STATE_DIO_UNWRITTEN;
3054 goto out; 3061 goto out;
3055 } 3062 }
3056 /* DIO end_io complete, convert the filled extent to written */ 3063 /* async DIO end_io complete, convert the filled extent to written */
3057 if (flags == EXT4_GET_BLOCKS_DIO_CONVERT_EXT) { 3064 if (flags == EXT4_GET_BLOCKS_DIO_CONVERT_EXT) {
3058 ret = ext4_convert_unwritten_extents_dio(handle, inode, 3065 ret = ext4_convert_unwritten_extents_dio(handle, inode,
3059 path); 3066 path);
@@ -3295,10 +3302,16 @@ int ext4_ext_get_blocks(handle_t *handle, struct inode *inode,
3295 * To avoid unecessary convertion for every aio dio rewrite 3302 * To avoid unecessary convertion for every aio dio rewrite
3296 * to the mid of file, here we flag the IO that is really 3303 * to the mid of file, here we flag the IO that is really
3297 * need the convertion. 3304 * need the convertion.
3298 * 3305 * For non asycn direct IO case, flag the inode state
3306 * that we need to perform convertion when IO is done.
3299 */ 3307 */
3300 if (io && flags == EXT4_GET_BLOCKS_DIO_CREATE_EXT) 3308 if (flags == EXT4_GET_BLOCKS_DIO_CREATE_EXT) {
3301 io->flag = DIO_AIO_UNWRITTEN; 3309 if (io)
3310 io->flag = DIO_AIO_UNWRITTEN;
3311 else
3312 EXT4_I(inode)->i_state |=
3313 EXT4_STATE_DIO_UNWRITTEN;;
3314 }
3302 } 3315 }
3303 err = ext4_ext_insert_extent(handle, inode, path, &newex, flags); 3316 err = ext4_ext_insert_extent(handle, inode, path, &newex, flags);
3304 if (err) { 3317 if (err) {
@@ -3519,6 +3532,7 @@ retry:
3519 * 3532 *
3520 * This function is called from the direct IO end io call back 3533 * This function is called from the direct IO end io call back
3521 * function, to convert the fallocated extents after IO is completed. 3534 * function, to convert the fallocated extents after IO is completed.
3535 * Returns 0 on success.
3522 */ 3536 */
3523int ext4_convert_unwritten_extents(struct inode *inode, loff_t offset, 3537int ext4_convert_unwritten_extents(struct inode *inode, loff_t offset,
3524 loff_t len) 3538 loff_t len)
diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c
index 5c5bc5dafff8..2c8caa51addb 100644
--- a/fs/ext4/inode.c
+++ b/fs/ext4/inode.c
@@ -193,7 +193,7 @@ static int try_to_extend_transaction(handle_t *handle, struct inode *inode)
193 * so before we call here everything must be consistently dirtied against 193 * so before we call here everything must be consistently dirtied against
194 * this transaction. 194 * this transaction.
195 */ 195 */
196 int ext4_truncate_restart_trans(handle_t *handle, struct inode *inode, 196int ext4_truncate_restart_trans(handle_t *handle, struct inode *inode,
197 int nblocks) 197 int nblocks)
198{ 198{
199 int ret; 199 int ret;
@@ -209,6 +209,7 @@ static int try_to_extend_transaction(handle_t *handle, struct inode *inode)
209 up_write(&EXT4_I(inode)->i_data_sem); 209 up_write(&EXT4_I(inode)->i_data_sem);
210 ret = ext4_journal_restart(handle, blocks_for_truncate(inode)); 210 ret = ext4_journal_restart(handle, blocks_for_truncate(inode));
211 down_write(&EXT4_I(inode)->i_data_sem); 211 down_write(&EXT4_I(inode)->i_data_sem);
212 ext4_discard_preallocations(inode);
212 213
213 return ret; 214 return ret;
214} 215}
@@ -3445,8 +3446,6 @@ out:
3445 return ret; 3446 return ret;
3446} 3447}
3447 3448
3448/* Maximum number of blocks we map for direct IO at once. */
3449
3450static int ext4_get_block_dio_write(struct inode *inode, sector_t iblock, 3449static int ext4_get_block_dio_write(struct inode *inode, sector_t iblock,
3451 struct buffer_head *bh_result, int create) 3450 struct buffer_head *bh_result, int create)
3452{ 3451{
@@ -3654,13 +3653,14 @@ static void ext4_end_io_dio(struct kiocb *iocb, loff_t offset,
3654 ext4_io_end_t *io_end = iocb->private; 3653 ext4_io_end_t *io_end = iocb->private;
3655 struct workqueue_struct *wq; 3654 struct workqueue_struct *wq;
3656 3655
3656 /* if not async direct IO or dio with 0 bytes write, just return */
3657 if (!io_end || !size)
3658 return;
3659
3657 ext_debug("ext4_end_io_dio(): io_end 0x%p" 3660 ext_debug("ext4_end_io_dio(): io_end 0x%p"
3658 "for inode %lu, iocb 0x%p, offset %llu, size %llu\n", 3661 "for inode %lu, iocb 0x%p, offset %llu, size %llu\n",
3659 iocb->private, io_end->inode->i_ino, iocb, offset, 3662 iocb->private, io_end->inode->i_ino, iocb, offset,
3660 size); 3663 size);
3661 /* if not async direct IO or dio with 0 bytes write, just return */
3662 if (!io_end || !size)
3663 return;
3664 3664
3665 /* if not aio dio with unwritten extents, just free io and return */ 3665 /* if not aio dio with unwritten extents, just free io and return */
3666 if (io_end->flag != DIO_AIO_UNWRITTEN){ 3666 if (io_end->flag != DIO_AIO_UNWRITTEN){
@@ -3771,13 +3771,19 @@ static ssize_t ext4_ext_direct_IO(int rw, struct kiocb *iocb,
3771 if (ret != -EIOCBQUEUED && ret <= 0 && iocb->private) { 3771 if (ret != -EIOCBQUEUED && ret <= 0 && iocb->private) {
3772 ext4_free_io_end(iocb->private); 3772 ext4_free_io_end(iocb->private);
3773 iocb->private = NULL; 3773 iocb->private = NULL;
3774 } else if (ret > 0) 3774 } else if (ret > 0 && (EXT4_I(inode)->i_state &
3775 EXT4_STATE_DIO_UNWRITTEN)) {
3776 int err;
3775 /* 3777 /*
3776 * for non AIO case, since the IO is already 3778 * for non AIO case, since the IO is already
3777 * completed, we could do the convertion right here 3779 * completed, we could do the convertion right here
3778 */ 3780 */
3779 ret = ext4_convert_unwritten_extents(inode, 3781 err = ext4_convert_unwritten_extents(inode,
3780 offset, ret); 3782 offset, ret);
3783 if (err < 0)
3784 ret = err;
3785 EXT4_I(inode)->i_state &= ~EXT4_STATE_DIO_UNWRITTEN;
3786 }
3781 return ret; 3787 return ret;
3782 } 3788 }
3783 3789
diff --git a/fs/ext4/namei.c b/fs/ext4/namei.c
index 7c8fe80bacdd..6d2c1b897fc7 100644
--- a/fs/ext4/namei.c
+++ b/fs/ext4/namei.c
@@ -1518,12 +1518,8 @@ static int ext4_add_entry(handle_t *handle, struct dentry *dentry,
1518 return retval; 1518 return retval;
1519 1519
1520 if (blocks == 1 && !dx_fallback && 1520 if (blocks == 1 && !dx_fallback &&
1521 EXT4_HAS_COMPAT_FEATURE(sb, EXT4_FEATURE_COMPAT_DIR_INDEX)) { 1521 EXT4_HAS_COMPAT_FEATURE(sb, EXT4_FEATURE_COMPAT_DIR_INDEX))
1522 retval = make_indexed_dir(handle, dentry, inode, bh); 1522 return make_indexed_dir(handle, dentry, inode, bh);
1523 if (retval == -ENOSPC)
1524 brelse(bh);
1525 return retval;
1526 }
1527 brelse(bh); 1523 brelse(bh);
1528 } 1524 }
1529 bh = ext4_append(handle, dir, &block, &retval); 1525 bh = ext4_append(handle, dir, &block, &retval);
@@ -1532,10 +1528,7 @@ static int ext4_add_entry(handle_t *handle, struct dentry *dentry,
1532 de = (struct ext4_dir_entry_2 *) bh->b_data; 1528 de = (struct ext4_dir_entry_2 *) bh->b_data;
1533 de->inode = 0; 1529 de->inode = 0;
1534 de->rec_len = ext4_rec_len_to_disk(blocksize, blocksize); 1530 de->rec_len = ext4_rec_len_to_disk(blocksize, blocksize);
1535 retval = add_dirent_to_buf(handle, dentry, inode, de, bh); 1531 return add_dirent_to_buf(handle, dentry, inode, de, bh);
1536 if (retval == -ENOSPC)
1537 brelse(bh);
1538 return retval;
1539} 1532}
1540 1533
1541/* 1534/*
@@ -1664,8 +1657,7 @@ static int ext4_dx_add_entry(handle_t *handle, struct dentry *dentry,
1664 if (!de) 1657 if (!de)
1665 goto cleanup; 1658 goto cleanup;
1666 err = add_dirent_to_buf(handle, dentry, inode, de, bh); 1659 err = add_dirent_to_buf(handle, dentry, inode, de, bh);
1667 if (err != -ENOSPC) 1660 bh = NULL;
1668 bh = NULL;
1669 goto cleanup; 1661 goto cleanup;
1670 1662
1671journal_error: 1663journal_error:
diff --git a/fs/fcntl.c b/fs/fcntl.c
index fc089f2f7f56..2cf93ec40a67 100644
--- a/fs/fcntl.c
+++ b/fs/fcntl.c
@@ -284,7 +284,7 @@ static int f_setown_ex(struct file *filp, unsigned long arg)
284 type = PIDTYPE_PID; 284 type = PIDTYPE_PID;
285 break; 285 break;
286 286
287 case F_OWNER_GID: 287 case F_OWNER_PGRP:
288 type = PIDTYPE_PGID; 288 type = PIDTYPE_PGID;
289 break; 289 break;
290 290
@@ -321,7 +321,7 @@ static int f_getown_ex(struct file *filp, unsigned long arg)
321 break; 321 break;
322 322
323 case PIDTYPE_PGID: 323 case PIDTYPE_PGID:
324 owner.type = F_OWNER_GID; 324 owner.type = F_OWNER_PGRP;
325 break; 325 break;
326 326
327 default: 327 default:
diff --git a/fs/file_table.c b/fs/file_table.c
index 8eb44042e009..4bef4c01ec6f 100644
--- a/fs/file_table.c
+++ b/fs/file_table.c
@@ -13,7 +13,6 @@
13#include <linux/module.h> 13#include <linux/module.h>
14#include <linux/fs.h> 14#include <linux/fs.h>
15#include <linux/security.h> 15#include <linux/security.h>
16#include <linux/ima.h>
17#include <linux/eventpoll.h> 16#include <linux/eventpoll.h>
18#include <linux/rcupdate.h> 17#include <linux/rcupdate.h>
19#include <linux/mount.h> 18#include <linux/mount.h>
@@ -280,7 +279,6 @@ void __fput(struct file *file)
280 if (file->f_op && file->f_op->release) 279 if (file->f_op && file->f_op->release)
281 file->f_op->release(inode, file); 280 file->f_op->release(inode, file);
282 security_file_free(file); 281 security_file_free(file);
283 ima_file_free(file);
284 if (unlikely(S_ISCHR(inode->i_mode) && inode->i_cdev != NULL)) 282 if (unlikely(S_ISCHR(inode->i_mode) && inode->i_cdev != NULL))
285 cdev_put(inode->i_cdev); 283 cdev_put(inode->i_cdev);
286 fops_put(file->f_op); 284 fops_put(file->f_op);
diff --git a/fs/fscache/Kconfig b/fs/fscache/Kconfig
index 9bbb8ce7bea0..864dac20a242 100644
--- a/fs/fscache/Kconfig
+++ b/fs/fscache/Kconfig
@@ -54,3 +54,10 @@ config FSCACHE_DEBUG
54 enabled by setting bits in /sys/modules/fscache/parameter/debug. 54 enabled by setting bits in /sys/modules/fscache/parameter/debug.
55 55
56 See Documentation/filesystems/caching/fscache.txt for more information. 56 See Documentation/filesystems/caching/fscache.txt for more information.
57
58config FSCACHE_OBJECT_LIST
59 bool "Maintain global object list for debugging purposes"
60 depends on FSCACHE && PROC_FS
61 help
62 Maintain a global list of active fscache objects that can be
63 retrieved through /proc/fs/fscache/objects for debugging purposes
diff --git a/fs/fscache/Makefile b/fs/fscache/Makefile
index 91571b95aacc..6d561531cb36 100644
--- a/fs/fscache/Makefile
+++ b/fs/fscache/Makefile
@@ -15,5 +15,6 @@ fscache-y := \
15fscache-$(CONFIG_PROC_FS) += proc.o 15fscache-$(CONFIG_PROC_FS) += proc.o
16fscache-$(CONFIG_FSCACHE_STATS) += stats.o 16fscache-$(CONFIG_FSCACHE_STATS) += stats.o
17fscache-$(CONFIG_FSCACHE_HISTOGRAM) += histogram.o 17fscache-$(CONFIG_FSCACHE_HISTOGRAM) += histogram.o
18fscache-$(CONFIG_FSCACHE_OBJECT_LIST) += object-list.o
18 19
19obj-$(CONFIG_FSCACHE) := fscache.o 20obj-$(CONFIG_FSCACHE) := fscache.o
diff --git a/fs/fscache/cache.c b/fs/fscache/cache.c
index e21985bbb1fb..6a3c48abd677 100644
--- a/fs/fscache/cache.c
+++ b/fs/fscache/cache.c
@@ -263,6 +263,7 @@ int fscache_add_cache(struct fscache_cache *cache,
263 spin_lock(&cache->object_list_lock); 263 spin_lock(&cache->object_list_lock);
264 list_add_tail(&ifsdef->cache_link, &cache->object_list); 264 list_add_tail(&ifsdef->cache_link, &cache->object_list);
265 spin_unlock(&cache->object_list_lock); 265 spin_unlock(&cache->object_list_lock);
266 fscache_objlist_add(ifsdef);
266 267
267 /* add the cache's netfs definition index object to the top level index 268 /* add the cache's netfs definition index object to the top level index
268 * cookie as a known backing object */ 269 * cookie as a known backing object */
@@ -380,11 +381,15 @@ void fscache_withdraw_cache(struct fscache_cache *cache)
380 381
381 /* make sure all pages pinned by operations on behalf of the netfs are 382 /* make sure all pages pinned by operations on behalf of the netfs are
382 * written to disk */ 383 * written to disk */
384 fscache_stat(&fscache_n_cop_sync_cache);
383 cache->ops->sync_cache(cache); 385 cache->ops->sync_cache(cache);
386 fscache_stat_d(&fscache_n_cop_sync_cache);
384 387
385 /* dissociate all the netfs pages backed by this cache from the block 388 /* dissociate all the netfs pages backed by this cache from the block
386 * mappings in the cache */ 389 * mappings in the cache */
390 fscache_stat(&fscache_n_cop_dissociate_pages);
387 cache->ops->dissociate_pages(cache); 391 cache->ops->dissociate_pages(cache);
392 fscache_stat_d(&fscache_n_cop_dissociate_pages);
388 393
389 /* we now have to destroy all the active objects pertaining to this 394 /* we now have to destroy all the active objects pertaining to this
390 * cache - which we do by passing them off to thread pool to be 395 * cache - which we do by passing them off to thread pool to be
diff --git a/fs/fscache/cookie.c b/fs/fscache/cookie.c
index 72fd18f6c71f..990535071a8a 100644
--- a/fs/fscache/cookie.c
+++ b/fs/fscache/cookie.c
@@ -36,6 +36,7 @@ void fscache_cookie_init_once(void *_cookie)
36 36
37 memset(cookie, 0, sizeof(*cookie)); 37 memset(cookie, 0, sizeof(*cookie));
38 spin_lock_init(&cookie->lock); 38 spin_lock_init(&cookie->lock);
39 spin_lock_init(&cookie->stores_lock);
39 INIT_HLIST_HEAD(&cookie->backing_objects); 40 INIT_HLIST_HEAD(&cookie->backing_objects);
40} 41}
41 42
@@ -102,7 +103,9 @@ struct fscache_cookie *__fscache_acquire_cookie(
102 cookie->netfs_data = netfs_data; 103 cookie->netfs_data = netfs_data;
103 cookie->flags = 0; 104 cookie->flags = 0;
104 105
105 INIT_RADIX_TREE(&cookie->stores, GFP_NOFS); 106 /* radix tree insertion won't use the preallocation pool unless it's
107 * told it may not wait */
108 INIT_RADIX_TREE(&cookie->stores, GFP_NOFS & ~__GFP_WAIT);
106 109
107 switch (cookie->def->type) { 110 switch (cookie->def->type) {
108 case FSCACHE_COOKIE_TYPE_INDEX: 111 case FSCACHE_COOKIE_TYPE_INDEX:
@@ -249,7 +252,9 @@ static int fscache_alloc_object(struct fscache_cache *cache,
249 252
250 /* ask the cache to allocate an object (we may end up with duplicate 253 /* ask the cache to allocate an object (we may end up with duplicate
251 * objects at this stage, but we sort that out later) */ 254 * objects at this stage, but we sort that out later) */
255 fscache_stat(&fscache_n_cop_alloc_object);
252 object = cache->ops->alloc_object(cache, cookie); 256 object = cache->ops->alloc_object(cache, cookie);
257 fscache_stat_d(&fscache_n_cop_alloc_object);
253 if (IS_ERR(object)) { 258 if (IS_ERR(object)) {
254 fscache_stat(&fscache_n_object_no_alloc); 259 fscache_stat(&fscache_n_object_no_alloc);
255 ret = PTR_ERR(object); 260 ret = PTR_ERR(object);
@@ -270,8 +275,11 @@ static int fscache_alloc_object(struct fscache_cache *cache,
270 /* only attach if we managed to allocate all we needed, otherwise 275 /* only attach if we managed to allocate all we needed, otherwise
271 * discard the object we just allocated and instead use the one 276 * discard the object we just allocated and instead use the one
272 * attached to the cookie */ 277 * attached to the cookie */
273 if (fscache_attach_object(cookie, object) < 0) 278 if (fscache_attach_object(cookie, object) < 0) {
279 fscache_stat(&fscache_n_cop_put_object);
274 cache->ops->put_object(object); 280 cache->ops->put_object(object);
281 fscache_stat_d(&fscache_n_cop_put_object);
282 }
275 283
276 _leave(" = 0"); 284 _leave(" = 0");
277 return 0; 285 return 0;
@@ -287,7 +295,9 @@ object_already_extant:
287 return 0; 295 return 0;
288 296
289error_put: 297error_put:
298 fscache_stat(&fscache_n_cop_put_object);
290 cache->ops->put_object(object); 299 cache->ops->put_object(object);
300 fscache_stat_d(&fscache_n_cop_put_object);
291error: 301error:
292 _leave(" = %d", ret); 302 _leave(" = %d", ret);
293 return ret; 303 return ret;
@@ -349,6 +359,8 @@ static int fscache_attach_object(struct fscache_cookie *cookie,
349 object->cookie = cookie; 359 object->cookie = cookie;
350 atomic_inc(&cookie->usage); 360 atomic_inc(&cookie->usage);
351 hlist_add_head(&object->cookie_link, &cookie->backing_objects); 361 hlist_add_head(&object->cookie_link, &cookie->backing_objects);
362
363 fscache_objlist_add(object);
352 ret = 0; 364 ret = 0;
353 365
354cant_attach_object: 366cant_attach_object:
@@ -403,6 +415,8 @@ void __fscache_relinquish_cookie(struct fscache_cookie *cookie, int retire)
403 unsigned long event; 415 unsigned long event;
404 416
405 fscache_stat(&fscache_n_relinquishes); 417 fscache_stat(&fscache_n_relinquishes);
418 if (retire)
419 fscache_stat(&fscache_n_relinquishes_retire);
406 420
407 if (!cookie) { 421 if (!cookie) {
408 fscache_stat(&fscache_n_relinquishes_null); 422 fscache_stat(&fscache_n_relinquishes_null);
@@ -428,12 +442,8 @@ void __fscache_relinquish_cookie(struct fscache_cookie *cookie, int retire)
428 442
429 event = retire ? FSCACHE_OBJECT_EV_RETIRE : FSCACHE_OBJECT_EV_RELEASE; 443 event = retire ? FSCACHE_OBJECT_EV_RETIRE : FSCACHE_OBJECT_EV_RELEASE;
430 444
431 /* detach pointers back to the netfs */
432 spin_lock(&cookie->lock); 445 spin_lock(&cookie->lock);
433 446
434 cookie->netfs_data = NULL;
435 cookie->def = NULL;
436
437 /* break links with all the active objects */ 447 /* break links with all the active objects */
438 while (!hlist_empty(&cookie->backing_objects)) { 448 while (!hlist_empty(&cookie->backing_objects)) {
439 object = hlist_entry(cookie->backing_objects.first, 449 object = hlist_entry(cookie->backing_objects.first,
@@ -456,6 +466,10 @@ void __fscache_relinquish_cookie(struct fscache_cookie *cookie, int retire)
456 BUG(); 466 BUG();
457 } 467 }
458 468
469 /* detach pointers back to the netfs */
470 cookie->netfs_data = NULL;
471 cookie->def = NULL;
472
459 spin_unlock(&cookie->lock); 473 spin_unlock(&cookie->lock);
460 474
461 if (cookie->parent) { 475 if (cookie->parent) {
diff --git a/fs/fscache/internal.h b/fs/fscache/internal.h
index 1c341304621f..edd7434ab6e5 100644
--- a/fs/fscache/internal.h
+++ b/fs/fscache/internal.h
@@ -17,6 +17,7 @@
17 * - cache->object_list_lock 17 * - cache->object_list_lock
18 * - object->lock 18 * - object->lock
19 * - object->parent->lock 19 * - object->parent->lock
20 * - cookie->stores_lock
20 * - fscache_thread_lock 21 * - fscache_thread_lock
21 * 22 *
22 */ 23 */
@@ -88,17 +89,31 @@ extern int fscache_wait_bit_interruptible(void *);
88/* 89/*
89 * object.c 90 * object.c
90 */ 91 */
92extern const char fscache_object_states_short[FSCACHE_OBJECT__NSTATES][5];
93
91extern void fscache_withdrawing_object(struct fscache_cache *, 94extern void fscache_withdrawing_object(struct fscache_cache *,
92 struct fscache_object *); 95 struct fscache_object *);
93extern void fscache_enqueue_object(struct fscache_object *); 96extern void fscache_enqueue_object(struct fscache_object *);
94 97
95/* 98/*
99 * object-list.c
100 */
101#ifdef CONFIG_FSCACHE_OBJECT_LIST
102extern const struct file_operations fscache_objlist_fops;
103
104extern void fscache_objlist_add(struct fscache_object *);
105#else
106#define fscache_objlist_add(object) do {} while(0)
107#endif
108
109/*
96 * operation.c 110 * operation.c
97 */ 111 */
98extern int fscache_submit_exclusive_op(struct fscache_object *, 112extern int fscache_submit_exclusive_op(struct fscache_object *,
99 struct fscache_operation *); 113 struct fscache_operation *);
100extern int fscache_submit_op(struct fscache_object *, 114extern int fscache_submit_op(struct fscache_object *,
101 struct fscache_operation *); 115 struct fscache_operation *);
116extern int fscache_cancel_op(struct fscache_operation *);
102extern void fscache_abort_object(struct fscache_object *); 117extern void fscache_abort_object(struct fscache_object *);
103extern void fscache_start_operations(struct fscache_object *); 118extern void fscache_start_operations(struct fscache_object *);
104extern void fscache_operation_gc(struct work_struct *); 119extern void fscache_operation_gc(struct work_struct *);
@@ -127,6 +142,8 @@ extern atomic_t fscache_n_op_enqueue;
127extern atomic_t fscache_n_op_deferred_release; 142extern atomic_t fscache_n_op_deferred_release;
128extern atomic_t fscache_n_op_release; 143extern atomic_t fscache_n_op_release;
129extern atomic_t fscache_n_op_gc; 144extern atomic_t fscache_n_op_gc;
145extern atomic_t fscache_n_op_cancelled;
146extern atomic_t fscache_n_op_rejected;
130 147
131extern atomic_t fscache_n_attr_changed; 148extern atomic_t fscache_n_attr_changed;
132extern atomic_t fscache_n_attr_changed_ok; 149extern atomic_t fscache_n_attr_changed_ok;
@@ -138,6 +155,8 @@ extern atomic_t fscache_n_allocs;
138extern atomic_t fscache_n_allocs_ok; 155extern atomic_t fscache_n_allocs_ok;
139extern atomic_t fscache_n_allocs_wait; 156extern atomic_t fscache_n_allocs_wait;
140extern atomic_t fscache_n_allocs_nobufs; 157extern atomic_t fscache_n_allocs_nobufs;
158extern atomic_t fscache_n_allocs_intr;
159extern atomic_t fscache_n_allocs_object_dead;
141extern atomic_t fscache_n_alloc_ops; 160extern atomic_t fscache_n_alloc_ops;
142extern atomic_t fscache_n_alloc_op_waits; 161extern atomic_t fscache_n_alloc_op_waits;
143 162
@@ -148,6 +167,7 @@ extern atomic_t fscache_n_retrievals_nodata;
148extern atomic_t fscache_n_retrievals_nobufs; 167extern atomic_t fscache_n_retrievals_nobufs;
149extern atomic_t fscache_n_retrievals_intr; 168extern atomic_t fscache_n_retrievals_intr;
150extern atomic_t fscache_n_retrievals_nomem; 169extern atomic_t fscache_n_retrievals_nomem;
170extern atomic_t fscache_n_retrievals_object_dead;
151extern atomic_t fscache_n_retrieval_ops; 171extern atomic_t fscache_n_retrieval_ops;
152extern atomic_t fscache_n_retrieval_op_waits; 172extern atomic_t fscache_n_retrieval_op_waits;
153 173
@@ -158,6 +178,14 @@ extern atomic_t fscache_n_stores_nobufs;
158extern atomic_t fscache_n_stores_oom; 178extern atomic_t fscache_n_stores_oom;
159extern atomic_t fscache_n_store_ops; 179extern atomic_t fscache_n_store_ops;
160extern atomic_t fscache_n_store_calls; 180extern atomic_t fscache_n_store_calls;
181extern atomic_t fscache_n_store_pages;
182extern atomic_t fscache_n_store_radix_deletes;
183extern atomic_t fscache_n_store_pages_over_limit;
184
185extern atomic_t fscache_n_store_vmscan_not_storing;
186extern atomic_t fscache_n_store_vmscan_gone;
187extern atomic_t fscache_n_store_vmscan_busy;
188extern atomic_t fscache_n_store_vmscan_cancelled;
161 189
162extern atomic_t fscache_n_marks; 190extern atomic_t fscache_n_marks;
163extern atomic_t fscache_n_uncaches; 191extern atomic_t fscache_n_uncaches;
@@ -176,6 +204,7 @@ extern atomic_t fscache_n_updates_run;
176extern atomic_t fscache_n_relinquishes; 204extern atomic_t fscache_n_relinquishes;
177extern atomic_t fscache_n_relinquishes_null; 205extern atomic_t fscache_n_relinquishes_null;
178extern atomic_t fscache_n_relinquishes_waitcrt; 206extern atomic_t fscache_n_relinquishes_waitcrt;
207extern atomic_t fscache_n_relinquishes_retire;
179 208
180extern atomic_t fscache_n_cookie_index; 209extern atomic_t fscache_n_cookie_index;
181extern atomic_t fscache_n_cookie_data; 210extern atomic_t fscache_n_cookie_data;
@@ -186,6 +215,7 @@ extern atomic_t fscache_n_object_no_alloc;
186extern atomic_t fscache_n_object_lookups; 215extern atomic_t fscache_n_object_lookups;
187extern atomic_t fscache_n_object_lookups_negative; 216extern atomic_t fscache_n_object_lookups_negative;
188extern atomic_t fscache_n_object_lookups_positive; 217extern atomic_t fscache_n_object_lookups_positive;
218extern atomic_t fscache_n_object_lookups_timed_out;
189extern atomic_t fscache_n_object_created; 219extern atomic_t fscache_n_object_created;
190extern atomic_t fscache_n_object_avail; 220extern atomic_t fscache_n_object_avail;
191extern atomic_t fscache_n_object_dead; 221extern atomic_t fscache_n_object_dead;
@@ -195,15 +225,41 @@ extern atomic_t fscache_n_checkaux_okay;
195extern atomic_t fscache_n_checkaux_update; 225extern atomic_t fscache_n_checkaux_update;
196extern atomic_t fscache_n_checkaux_obsolete; 226extern atomic_t fscache_n_checkaux_obsolete;
197 227
228extern atomic_t fscache_n_cop_alloc_object;
229extern atomic_t fscache_n_cop_lookup_object;
230extern atomic_t fscache_n_cop_lookup_complete;
231extern atomic_t fscache_n_cop_grab_object;
232extern atomic_t fscache_n_cop_update_object;
233extern atomic_t fscache_n_cop_drop_object;
234extern atomic_t fscache_n_cop_put_object;
235extern atomic_t fscache_n_cop_sync_cache;
236extern atomic_t fscache_n_cop_attr_changed;
237extern atomic_t fscache_n_cop_read_or_alloc_page;
238extern atomic_t fscache_n_cop_read_or_alloc_pages;
239extern atomic_t fscache_n_cop_allocate_page;
240extern atomic_t fscache_n_cop_allocate_pages;
241extern atomic_t fscache_n_cop_write_page;
242extern atomic_t fscache_n_cop_uncache_page;
243extern atomic_t fscache_n_cop_dissociate_pages;
244
198static inline void fscache_stat(atomic_t *stat) 245static inline void fscache_stat(atomic_t *stat)
199{ 246{
200 atomic_inc(stat); 247 atomic_inc(stat);
201} 248}
202 249
250static inline void fscache_stat_d(atomic_t *stat)
251{
252 atomic_dec(stat);
253}
254
255#define __fscache_stat(stat) (stat)
256
203extern const struct file_operations fscache_stats_fops; 257extern const struct file_operations fscache_stats_fops;
204#else 258#else
205 259
260#define __fscache_stat(stat) (NULL)
206#define fscache_stat(stat) do {} while (0) 261#define fscache_stat(stat) do {} while (0)
262#define fscache_stat_d(stat) do {} while (0)
207#endif 263#endif
208 264
209/* 265/*
diff --git a/fs/fscache/main.c b/fs/fscache/main.c
index 4de41b597499..add6bdb53f04 100644
--- a/fs/fscache/main.c
+++ b/fs/fscache/main.c
@@ -48,7 +48,7 @@ static int __init fscache_init(void)
48{ 48{
49 int ret; 49 int ret;
50 50
51 ret = slow_work_register_user(); 51 ret = slow_work_register_user(THIS_MODULE);
52 if (ret < 0) 52 if (ret < 0)
53 goto error_slow_work; 53 goto error_slow_work;
54 54
@@ -80,7 +80,7 @@ error_kobj:
80error_cookie_jar: 80error_cookie_jar:
81 fscache_proc_cleanup(); 81 fscache_proc_cleanup();
82error_proc: 82error_proc:
83 slow_work_unregister_user(); 83 slow_work_unregister_user(THIS_MODULE);
84error_slow_work: 84error_slow_work:
85 return ret; 85 return ret;
86} 86}
@@ -97,7 +97,7 @@ static void __exit fscache_exit(void)
97 kobject_put(fscache_root); 97 kobject_put(fscache_root);
98 kmem_cache_destroy(fscache_cookie_jar); 98 kmem_cache_destroy(fscache_cookie_jar);
99 fscache_proc_cleanup(); 99 fscache_proc_cleanup();
100 slow_work_unregister_user(); 100 slow_work_unregister_user(THIS_MODULE);
101 printk(KERN_NOTICE "FS-Cache: Unloaded\n"); 101 printk(KERN_NOTICE "FS-Cache: Unloaded\n");
102} 102}
103 103
diff --git a/fs/fscache/object-list.c b/fs/fscache/object-list.c
new file mode 100644
index 000000000000..e590242fa41a
--- /dev/null
+++ b/fs/fscache/object-list.c
@@ -0,0 +1,432 @@
1/* Global fscache object list maintainer and viewer
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#define FSCACHE_DEBUG_LEVEL COOKIE
13#include <linux/module.h>
14#include <linux/seq_file.h>
15#include <linux/key.h>
16#include <keys/user-type.h>
17#include "internal.h"
18
19static struct rb_root fscache_object_list;
20static DEFINE_RWLOCK(fscache_object_list_lock);
21
22struct fscache_objlist_data {
23 unsigned long config; /* display configuration */
24#define FSCACHE_OBJLIST_CONFIG_KEY 0x00000001 /* show object keys */
25#define FSCACHE_OBJLIST_CONFIG_AUX 0x00000002 /* show object auxdata */
26#define FSCACHE_OBJLIST_CONFIG_COOKIE 0x00000004 /* show objects with cookies */
27#define FSCACHE_OBJLIST_CONFIG_NOCOOKIE 0x00000008 /* show objects without cookies */
28#define FSCACHE_OBJLIST_CONFIG_BUSY 0x00000010 /* show busy objects */
29#define FSCACHE_OBJLIST_CONFIG_IDLE 0x00000020 /* show idle objects */
30#define FSCACHE_OBJLIST_CONFIG_PENDWR 0x00000040 /* show objects with pending writes */
31#define FSCACHE_OBJLIST_CONFIG_NOPENDWR 0x00000080 /* show objects without pending writes */
32#define FSCACHE_OBJLIST_CONFIG_READS 0x00000100 /* show objects with active reads */
33#define FSCACHE_OBJLIST_CONFIG_NOREADS 0x00000200 /* show objects without active reads */
34#define FSCACHE_OBJLIST_CONFIG_EVENTS 0x00000400 /* show objects with events */
35#define FSCACHE_OBJLIST_CONFIG_NOEVENTS 0x00000800 /* show objects without no events */
36#define FSCACHE_OBJLIST_CONFIG_WORK 0x00001000 /* show objects with slow work */
37#define FSCACHE_OBJLIST_CONFIG_NOWORK 0x00002000 /* show objects without slow work */
38
39 u8 buf[512]; /* key and aux data buffer */
40};
41
42/*
43 * Add an object to the object list
44 * - we use the address of the fscache_object structure as the key into the
45 * tree
46 */
47void fscache_objlist_add(struct fscache_object *obj)
48{
49 struct fscache_object *xobj;
50 struct rb_node **p = &fscache_object_list.rb_node, *parent = NULL;
51
52 write_lock(&fscache_object_list_lock);
53
54 while (*p) {
55 parent = *p;
56 xobj = rb_entry(parent, struct fscache_object, objlist_link);
57
58 if (obj < xobj)
59 p = &(*p)->rb_left;
60 else if (obj > xobj)
61 p = &(*p)->rb_right;
62 else
63 BUG();
64 }
65
66 rb_link_node(&obj->objlist_link, parent, p);
67 rb_insert_color(&obj->objlist_link, &fscache_object_list);
68
69 write_unlock(&fscache_object_list_lock);
70}
71
72/**
73 * fscache_object_destroy - Note that a cache object is about to be destroyed
74 * @object: The object to be destroyed
75 *
76 * Note the imminent destruction and deallocation of a cache object record.
77 */
78void fscache_object_destroy(struct fscache_object *obj)
79{
80 write_lock(&fscache_object_list_lock);
81
82 BUG_ON(RB_EMPTY_ROOT(&fscache_object_list));
83 rb_erase(&obj->objlist_link, &fscache_object_list);
84
85 write_unlock(&fscache_object_list_lock);
86}
87EXPORT_SYMBOL(fscache_object_destroy);
88
89/*
90 * find the object in the tree on or after the specified index
91 */
92static struct fscache_object *fscache_objlist_lookup(loff_t *_pos)
93{
94 struct fscache_object *pobj, *obj, *minobj = NULL;
95 struct rb_node *p;
96 unsigned long pos;
97
98 if (*_pos >= (unsigned long) ERR_PTR(-ENOENT))
99 return NULL;
100 pos = *_pos;
101
102 /* banners (can't represent line 0 by pos 0 as that would involve
103 * returning a NULL pointer) */
104 if (pos == 0)
105 return (struct fscache_object *) ++(*_pos);
106 if (pos < 3)
107 return (struct fscache_object *)pos;
108
109 pobj = (struct fscache_object *)pos;
110 p = fscache_object_list.rb_node;
111 while (p) {
112 obj = rb_entry(p, struct fscache_object, objlist_link);
113 if (pobj < obj) {
114 if (!minobj || minobj > obj)
115 minobj = obj;
116 p = p->rb_left;
117 } else if (pobj > obj) {
118 p = p->rb_right;
119 } else {
120 minobj = obj;
121 break;
122 }
123 obj = NULL;
124 }
125
126 if (!minobj)
127 *_pos = (unsigned long) ERR_PTR(-ENOENT);
128 else if (minobj != obj)
129 *_pos = (unsigned long) minobj;
130 return minobj;
131}
132
133/*
134 * set up the iterator to start reading from the first line
135 */
136static void *fscache_objlist_start(struct seq_file *m, loff_t *_pos)
137 __acquires(&fscache_object_list_lock)
138{
139 read_lock(&fscache_object_list_lock);
140 return fscache_objlist_lookup(_pos);
141}
142
143/*
144 * move to the next line
145 */
146static void *fscache_objlist_next(struct seq_file *m, void *v, loff_t *_pos)
147{
148 (*_pos)++;
149 return fscache_objlist_lookup(_pos);
150}
151
152/*
153 * clean up after reading
154 */
155static void fscache_objlist_stop(struct seq_file *m, void *v)
156 __releases(&fscache_object_list_lock)
157{
158 read_unlock(&fscache_object_list_lock);
159}
160
161/*
162 * display an object
163 */
164static int fscache_objlist_show(struct seq_file *m, void *v)
165{
166 struct fscache_objlist_data *data = m->private;
167 struct fscache_object *obj = v;
168 unsigned long config = data->config;
169 uint16_t keylen, auxlen;
170 char _type[3], *type;
171 bool no_cookie;
172 u8 *buf = data->buf, *p;
173
174 if ((unsigned long) v == 1) {
175 seq_puts(m, "OBJECT PARENT STAT CHLDN OPS OOP IPR EX READS"
176 " EM EV F S"
177 " | NETFS_COOKIE_DEF TY FL NETFS_DATA");
178 if (config & (FSCACHE_OBJLIST_CONFIG_KEY |
179 FSCACHE_OBJLIST_CONFIG_AUX))
180 seq_puts(m, " ");
181 if (config & FSCACHE_OBJLIST_CONFIG_KEY)
182 seq_puts(m, "OBJECT_KEY");
183 if ((config & (FSCACHE_OBJLIST_CONFIG_KEY |
184 FSCACHE_OBJLIST_CONFIG_AUX)) ==
185 (FSCACHE_OBJLIST_CONFIG_KEY | FSCACHE_OBJLIST_CONFIG_AUX))
186 seq_puts(m, ", ");
187 if (config & FSCACHE_OBJLIST_CONFIG_AUX)
188 seq_puts(m, "AUX_DATA");
189 seq_puts(m, "\n");
190 return 0;
191 }
192
193 if ((unsigned long) v == 2) {
194 seq_puts(m, "======== ======== ==== ===== === === === == ====="
195 " == == = ="
196 " | ================ == == ================");
197 if (config & (FSCACHE_OBJLIST_CONFIG_KEY |
198 FSCACHE_OBJLIST_CONFIG_AUX))
199 seq_puts(m, " ================");
200 seq_puts(m, "\n");
201 return 0;
202 }
203
204 /* filter out any unwanted objects */
205#define FILTER(criterion, _yes, _no) \
206 do { \
207 unsigned long yes = FSCACHE_OBJLIST_CONFIG_##_yes; \
208 unsigned long no = FSCACHE_OBJLIST_CONFIG_##_no; \
209 if (criterion) { \
210 if (!(config & yes)) \
211 return 0; \
212 } else { \
213 if (!(config & no)) \
214 return 0; \
215 } \
216 } while(0)
217
218 if (~config) {
219 FILTER(obj->cookie,
220 COOKIE, NOCOOKIE);
221 FILTER(obj->state != FSCACHE_OBJECT_ACTIVE ||
222 obj->n_ops != 0 ||
223 obj->n_obj_ops != 0 ||
224 obj->flags ||
225 !list_empty(&obj->dependents),
226 BUSY, IDLE);
227 FILTER(test_bit(FSCACHE_OBJECT_PENDING_WRITE, &obj->flags),
228 PENDWR, NOPENDWR);
229 FILTER(atomic_read(&obj->n_reads),
230 READS, NOREADS);
231 FILTER(obj->events & obj->event_mask,
232 EVENTS, NOEVENTS);
233 FILTER(obj->work.flags & ~(1UL << SLOW_WORK_VERY_SLOW),
234 WORK, NOWORK);
235 }
236
237 seq_printf(m,
238 "%8x %8x %s %5u %3u %3u %3u %2u %5u %2lx %2lx %1lx %1lx | ",
239 obj->debug_id,
240 obj->parent ? obj->parent->debug_id : -1,
241 fscache_object_states_short[obj->state],
242 obj->n_children,
243 obj->n_ops,
244 obj->n_obj_ops,
245 obj->n_in_progress,
246 obj->n_exclusive,
247 atomic_read(&obj->n_reads),
248 obj->event_mask & FSCACHE_OBJECT_EVENTS_MASK,
249 obj->events,
250 obj->flags,
251 obj->work.flags);
252
253 no_cookie = true;
254 keylen = auxlen = 0;
255 if (obj->cookie) {
256 spin_lock(&obj->lock);
257 if (obj->cookie) {
258 switch (obj->cookie->def->type) {
259 case 0:
260 type = "IX";
261 break;
262 case 1:
263 type = "DT";
264 break;
265 default:
266 sprintf(_type, "%02u",
267 obj->cookie->def->type);
268 type = _type;
269 break;
270 }
271
272 seq_printf(m, "%-16s %s %2lx %16p",
273 obj->cookie->def->name,
274 type,
275 obj->cookie->flags,
276 obj->cookie->netfs_data);
277
278 if (obj->cookie->def->get_key &&
279 config & FSCACHE_OBJLIST_CONFIG_KEY)
280 keylen = obj->cookie->def->get_key(
281 obj->cookie->netfs_data,
282 buf, 400);
283
284 if (obj->cookie->def->get_aux &&
285 config & FSCACHE_OBJLIST_CONFIG_AUX)
286 auxlen = obj->cookie->def->get_aux(
287 obj->cookie->netfs_data,
288 buf + keylen, 512 - keylen);
289
290 no_cookie = false;
291 }
292 spin_unlock(&obj->lock);
293
294 if (!no_cookie && (keylen > 0 || auxlen > 0)) {
295 seq_printf(m, " ");
296 for (p = buf; keylen > 0; keylen--)
297 seq_printf(m, "%02x", *p++);
298 if (auxlen > 0) {
299 if (config & FSCACHE_OBJLIST_CONFIG_KEY)
300 seq_printf(m, ", ");
301 for (; auxlen > 0; auxlen--)
302 seq_printf(m, "%02x", *p++);
303 }
304 }
305 }
306
307 if (no_cookie)
308 seq_printf(m, "<no_cookie>\n");
309 else
310 seq_printf(m, "\n");
311 return 0;
312}
313
314static const struct seq_operations fscache_objlist_ops = {
315 .start = fscache_objlist_start,
316 .stop = fscache_objlist_stop,
317 .next = fscache_objlist_next,
318 .show = fscache_objlist_show,
319};
320
321/*
322 * get the configuration for filtering the list
323 */
324static void fscache_objlist_config(struct fscache_objlist_data *data)
325{
326#ifdef CONFIG_KEYS
327 struct user_key_payload *confkey;
328 unsigned long config;
329 struct key *key;
330 const char *buf;
331 int len;
332
333 key = request_key(&key_type_user, "fscache:objlist", NULL);
334 if (IS_ERR(key))
335 goto no_config;
336
337 config = 0;
338 rcu_read_lock();
339
340 confkey = key->payload.data;
341 buf = confkey->data;
342
343 for (len = confkey->datalen - 1; len >= 0; len--) {
344 switch (buf[len]) {
345 case 'K': config |= FSCACHE_OBJLIST_CONFIG_KEY; break;
346 case 'A': config |= FSCACHE_OBJLIST_CONFIG_AUX; break;
347 case 'C': config |= FSCACHE_OBJLIST_CONFIG_COOKIE; break;
348 case 'c': config |= FSCACHE_OBJLIST_CONFIG_NOCOOKIE; break;
349 case 'B': config |= FSCACHE_OBJLIST_CONFIG_BUSY; break;
350 case 'b': config |= FSCACHE_OBJLIST_CONFIG_IDLE; break;
351 case 'W': config |= FSCACHE_OBJLIST_CONFIG_PENDWR; break;
352 case 'w': config |= FSCACHE_OBJLIST_CONFIG_NOPENDWR; break;
353 case 'R': config |= FSCACHE_OBJLIST_CONFIG_READS; break;
354 case 'r': config |= FSCACHE_OBJLIST_CONFIG_NOREADS; break;
355 case 'S': config |= FSCACHE_OBJLIST_CONFIG_WORK; break;
356 case 's': config |= FSCACHE_OBJLIST_CONFIG_NOWORK; break;
357 }
358 }
359
360 rcu_read_unlock();
361 key_put(key);
362
363 if (!(config & (FSCACHE_OBJLIST_CONFIG_COOKIE | FSCACHE_OBJLIST_CONFIG_NOCOOKIE)))
364 config |= FSCACHE_OBJLIST_CONFIG_COOKIE | FSCACHE_OBJLIST_CONFIG_NOCOOKIE;
365 if (!(config & (FSCACHE_OBJLIST_CONFIG_BUSY | FSCACHE_OBJLIST_CONFIG_IDLE)))
366 config |= FSCACHE_OBJLIST_CONFIG_BUSY | FSCACHE_OBJLIST_CONFIG_IDLE;
367 if (!(config & (FSCACHE_OBJLIST_CONFIG_PENDWR | FSCACHE_OBJLIST_CONFIG_NOPENDWR)))
368 config |= FSCACHE_OBJLIST_CONFIG_PENDWR | FSCACHE_OBJLIST_CONFIG_NOPENDWR;
369 if (!(config & (FSCACHE_OBJLIST_CONFIG_READS | FSCACHE_OBJLIST_CONFIG_NOREADS)))
370 config |= FSCACHE_OBJLIST_CONFIG_READS | FSCACHE_OBJLIST_CONFIG_NOREADS;
371 if (!(config & (FSCACHE_OBJLIST_CONFIG_EVENTS | FSCACHE_OBJLIST_CONFIG_NOEVENTS)))
372 config |= FSCACHE_OBJLIST_CONFIG_EVENTS | FSCACHE_OBJLIST_CONFIG_NOEVENTS;
373 if (!(config & (FSCACHE_OBJLIST_CONFIG_WORK | FSCACHE_OBJLIST_CONFIG_NOWORK)))
374 config |= FSCACHE_OBJLIST_CONFIG_WORK | FSCACHE_OBJLIST_CONFIG_NOWORK;
375
376 data->config = config;
377 return;
378
379no_config:
380#endif
381 data->config = ULONG_MAX;
382}
383
384/*
385 * open "/proc/fs/fscache/objects" to provide a list of active objects
386 * - can be configured by a user-defined key added to the caller's keyrings
387 */
388static int fscache_objlist_open(struct inode *inode, struct file *file)
389{
390 struct fscache_objlist_data *data;
391 struct seq_file *m;
392 int ret;
393
394 ret = seq_open(file, &fscache_objlist_ops);
395 if (ret < 0)
396 return ret;
397
398 m = file->private_data;
399
400 /* buffer for key extraction */
401 data = kmalloc(sizeof(struct fscache_objlist_data), GFP_KERNEL);
402 if (!data) {
403 seq_release(inode, file);
404 return -ENOMEM;
405 }
406
407 /* get the configuration key */
408 fscache_objlist_config(data);
409
410 m->private = data;
411 return 0;
412}
413
414/*
415 * clean up on close
416 */
417static int fscache_objlist_release(struct inode *inode, struct file *file)
418{
419 struct seq_file *m = file->private_data;
420
421 kfree(m->private);
422 m->private = NULL;
423 return seq_release(inode, file);
424}
425
426const struct file_operations fscache_objlist_fops = {
427 .owner = THIS_MODULE,
428 .open = fscache_objlist_open,
429 .read = seq_read,
430 .llseek = seq_lseek,
431 .release = fscache_objlist_release,
432};
diff --git a/fs/fscache/object.c b/fs/fscache/object.c
index 392a41b1b79d..e513ac599c8e 100644
--- a/fs/fscache/object.c
+++ b/fs/fscache/object.c
@@ -14,9 +14,10 @@
14 14
15#define FSCACHE_DEBUG_LEVEL COOKIE 15#define FSCACHE_DEBUG_LEVEL COOKIE
16#include <linux/module.h> 16#include <linux/module.h>
17#include <linux/seq_file.h>
17#include "internal.h" 18#include "internal.h"
18 19
19const char *fscache_object_states[] = { 20const char *fscache_object_states[FSCACHE_OBJECT__NSTATES] = {
20 [FSCACHE_OBJECT_INIT] = "OBJECT_INIT", 21 [FSCACHE_OBJECT_INIT] = "OBJECT_INIT",
21 [FSCACHE_OBJECT_LOOKING_UP] = "OBJECT_LOOKING_UP", 22 [FSCACHE_OBJECT_LOOKING_UP] = "OBJECT_LOOKING_UP",
22 [FSCACHE_OBJECT_CREATING] = "OBJECT_CREATING", 23 [FSCACHE_OBJECT_CREATING] = "OBJECT_CREATING",
@@ -33,9 +34,28 @@ const char *fscache_object_states[] = {
33}; 34};
34EXPORT_SYMBOL(fscache_object_states); 35EXPORT_SYMBOL(fscache_object_states);
35 36
37const char fscache_object_states_short[FSCACHE_OBJECT__NSTATES][5] = {
38 [FSCACHE_OBJECT_INIT] = "INIT",
39 [FSCACHE_OBJECT_LOOKING_UP] = "LOOK",
40 [FSCACHE_OBJECT_CREATING] = "CRTN",
41 [FSCACHE_OBJECT_AVAILABLE] = "AVBL",
42 [FSCACHE_OBJECT_ACTIVE] = "ACTV",
43 [FSCACHE_OBJECT_UPDATING] = "UPDT",
44 [FSCACHE_OBJECT_DYING] = "DYNG",
45 [FSCACHE_OBJECT_LC_DYING] = "LCDY",
46 [FSCACHE_OBJECT_ABORT_INIT] = "ABTI",
47 [FSCACHE_OBJECT_RELEASING] = "RELS",
48 [FSCACHE_OBJECT_RECYCLING] = "RCYC",
49 [FSCACHE_OBJECT_WITHDRAWING] = "WTHD",
50 [FSCACHE_OBJECT_DEAD] = "DEAD",
51};
52
36static void fscache_object_slow_work_put_ref(struct slow_work *); 53static void fscache_object_slow_work_put_ref(struct slow_work *);
37static int fscache_object_slow_work_get_ref(struct slow_work *); 54static int fscache_object_slow_work_get_ref(struct slow_work *);
38static void fscache_object_slow_work_execute(struct slow_work *); 55static void fscache_object_slow_work_execute(struct slow_work *);
56#ifdef CONFIG_SLOW_WORK_PROC
57static void fscache_object_slow_work_desc(struct slow_work *, struct seq_file *);
58#endif
39static void fscache_initialise_object(struct fscache_object *); 59static void fscache_initialise_object(struct fscache_object *);
40static void fscache_lookup_object(struct fscache_object *); 60static void fscache_lookup_object(struct fscache_object *);
41static void fscache_object_available(struct fscache_object *); 61static void fscache_object_available(struct fscache_object *);
@@ -45,9 +65,13 @@ static void fscache_enqueue_dependents(struct fscache_object *);
45static void fscache_dequeue_object(struct fscache_object *); 65static void fscache_dequeue_object(struct fscache_object *);
46 66
47const struct slow_work_ops fscache_object_slow_work_ops = { 67const struct slow_work_ops fscache_object_slow_work_ops = {
68 .owner = THIS_MODULE,
48 .get_ref = fscache_object_slow_work_get_ref, 69 .get_ref = fscache_object_slow_work_get_ref,
49 .put_ref = fscache_object_slow_work_put_ref, 70 .put_ref = fscache_object_slow_work_put_ref,
50 .execute = fscache_object_slow_work_execute, 71 .execute = fscache_object_slow_work_execute,
72#ifdef CONFIG_SLOW_WORK_PROC
73 .desc = fscache_object_slow_work_desc,
74#endif
51}; 75};
52EXPORT_SYMBOL(fscache_object_slow_work_ops); 76EXPORT_SYMBOL(fscache_object_slow_work_ops);
53 77
@@ -81,6 +105,7 @@ static inline void fscache_done_parent_op(struct fscache_object *object)
81static void fscache_object_state_machine(struct fscache_object *object) 105static void fscache_object_state_machine(struct fscache_object *object)
82{ 106{
83 enum fscache_object_state new_state; 107 enum fscache_object_state new_state;
108 struct fscache_cookie *cookie;
84 109
85 ASSERT(object != NULL); 110 ASSERT(object != NULL);
86 111
@@ -120,20 +145,31 @@ static void fscache_object_state_machine(struct fscache_object *object)
120 case FSCACHE_OBJECT_UPDATING: 145 case FSCACHE_OBJECT_UPDATING:
121 clear_bit(FSCACHE_OBJECT_EV_UPDATE, &object->events); 146 clear_bit(FSCACHE_OBJECT_EV_UPDATE, &object->events);
122 fscache_stat(&fscache_n_updates_run); 147 fscache_stat(&fscache_n_updates_run);
148 fscache_stat(&fscache_n_cop_update_object);
123 object->cache->ops->update_object(object); 149 object->cache->ops->update_object(object);
150 fscache_stat_d(&fscache_n_cop_update_object);
124 goto active_transit; 151 goto active_transit;
125 152
126 /* handle an object dying during lookup or creation */ 153 /* handle an object dying during lookup or creation */
127 case FSCACHE_OBJECT_LC_DYING: 154 case FSCACHE_OBJECT_LC_DYING:
128 object->event_mask &= ~(1 << FSCACHE_OBJECT_EV_UPDATE); 155 object->event_mask &= ~(1 << FSCACHE_OBJECT_EV_UPDATE);
156 fscache_stat(&fscache_n_cop_lookup_complete);
129 object->cache->ops->lookup_complete(object); 157 object->cache->ops->lookup_complete(object);
158 fscache_stat_d(&fscache_n_cop_lookup_complete);
130 159
131 spin_lock(&object->lock); 160 spin_lock(&object->lock);
132 object->state = FSCACHE_OBJECT_DYING; 161 object->state = FSCACHE_OBJECT_DYING;
133 if (test_and_clear_bit(FSCACHE_COOKIE_CREATING, 162 cookie = object->cookie;
134 &object->cookie->flags)) 163 if (cookie) {
135 wake_up_bit(&object->cookie->flags, 164 if (test_and_clear_bit(FSCACHE_COOKIE_LOOKING_UP,
136 FSCACHE_COOKIE_CREATING); 165 &cookie->flags))
166 wake_up_bit(&cookie->flags,
167 FSCACHE_COOKIE_LOOKING_UP);
168 if (test_and_clear_bit(FSCACHE_COOKIE_CREATING,
169 &cookie->flags))
170 wake_up_bit(&cookie->flags,
171 FSCACHE_COOKIE_CREATING);
172 }
137 spin_unlock(&object->lock); 173 spin_unlock(&object->lock);
138 174
139 fscache_done_parent_op(object); 175 fscache_done_parent_op(object);
@@ -165,6 +201,7 @@ static void fscache_object_state_machine(struct fscache_object *object)
165 } 201 }
166 spin_unlock(&object->lock); 202 spin_unlock(&object->lock);
167 fscache_enqueue_dependents(object); 203 fscache_enqueue_dependents(object);
204 fscache_start_operations(object);
168 goto terminal_transit; 205 goto terminal_transit;
169 206
170 /* handle an abort during initialisation */ 207 /* handle an abort during initialisation */
@@ -316,14 +353,29 @@ static void fscache_object_slow_work_execute(struct slow_work *work)
316 353
317 _enter("{OBJ%x}", object->debug_id); 354 _enter("{OBJ%x}", object->debug_id);
318 355
319 clear_bit(FSCACHE_OBJECT_EV_REQUEUE, &object->events);
320
321 start = jiffies; 356 start = jiffies;
322 fscache_object_state_machine(object); 357 fscache_object_state_machine(object);
323 fscache_hist(fscache_objs_histogram, start); 358 fscache_hist(fscache_objs_histogram, start);
324 if (object->events & object->event_mask) 359 if (object->events & object->event_mask)
325 fscache_enqueue_object(object); 360 fscache_enqueue_object(object);
361 clear_bit(FSCACHE_OBJECT_EV_REQUEUE, &object->events);
362}
363
364/*
365 * describe an object for slow-work debugging
366 */
367#ifdef CONFIG_SLOW_WORK_PROC
368static void fscache_object_slow_work_desc(struct slow_work *work,
369 struct seq_file *m)
370{
371 struct fscache_object *object =
372 container_of(work, struct fscache_object, work);
373
374 seq_printf(m, "FSC: OBJ%x: %s",
375 object->debug_id,
376 fscache_object_states_short[object->state]);
326} 377}
378#endif
327 379
328/* 380/*
329 * initialise an object 381 * initialise an object
@@ -376,7 +428,9 @@ static void fscache_initialise_object(struct fscache_object *object)
376 * binding on to us, so we need to make sure we don't 428 * binding on to us, so we need to make sure we don't
377 * add ourself to the list multiple times */ 429 * add ourself to the list multiple times */
378 if (list_empty(&object->dep_link)) { 430 if (list_empty(&object->dep_link)) {
431 fscache_stat(&fscache_n_cop_grab_object);
379 object->cache->ops->grab_object(object); 432 object->cache->ops->grab_object(object);
433 fscache_stat_d(&fscache_n_cop_grab_object);
380 list_add(&object->dep_link, 434 list_add(&object->dep_link,
381 &parent->dependents); 435 &parent->dependents);
382 436
@@ -414,6 +468,7 @@ static void fscache_lookup_object(struct fscache_object *object)
414{ 468{
415 struct fscache_cookie *cookie = object->cookie; 469 struct fscache_cookie *cookie = object->cookie;
416 struct fscache_object *parent; 470 struct fscache_object *parent;
471 int ret;
417 472
418 _enter(""); 473 _enter("");
419 474
@@ -438,11 +493,20 @@ static void fscache_lookup_object(struct fscache_object *object)
438 object->cache->tag->name); 493 object->cache->tag->name);
439 494
440 fscache_stat(&fscache_n_object_lookups); 495 fscache_stat(&fscache_n_object_lookups);
441 object->cache->ops->lookup_object(object); 496 fscache_stat(&fscache_n_cop_lookup_object);
497 ret = object->cache->ops->lookup_object(object);
498 fscache_stat_d(&fscache_n_cop_lookup_object);
442 499
443 if (test_bit(FSCACHE_OBJECT_EV_ERROR, &object->events)) 500 if (test_bit(FSCACHE_OBJECT_EV_ERROR, &object->events))
444 set_bit(FSCACHE_COOKIE_UNAVAILABLE, &cookie->flags); 501 set_bit(FSCACHE_COOKIE_UNAVAILABLE, &cookie->flags);
445 502
503 if (ret == -ETIMEDOUT) {
504 /* probably stuck behind another object, so move this one to
505 * the back of the queue */
506 fscache_stat(&fscache_n_object_lookups_timed_out);
507 set_bit(FSCACHE_OBJECT_EV_REQUEUE, &object->events);
508 }
509
446 _leave(""); 510 _leave("");
447} 511}
448 512
@@ -546,7 +610,8 @@ static void fscache_object_available(struct fscache_object *object)
546 610
547 spin_lock(&object->lock); 611 spin_lock(&object->lock);
548 612
549 if (test_and_clear_bit(FSCACHE_COOKIE_CREATING, &object->cookie->flags)) 613 if (object->cookie &&
614 test_and_clear_bit(FSCACHE_COOKIE_CREATING, &object->cookie->flags))
550 wake_up_bit(&object->cookie->flags, FSCACHE_COOKIE_CREATING); 615 wake_up_bit(&object->cookie->flags, FSCACHE_COOKIE_CREATING);
551 616
552 fscache_done_parent_op(object); 617 fscache_done_parent_op(object);
@@ -562,7 +627,9 @@ static void fscache_object_available(struct fscache_object *object)
562 } 627 }
563 spin_unlock(&object->lock); 628 spin_unlock(&object->lock);
564 629
630 fscache_stat(&fscache_n_cop_lookup_complete);
565 object->cache->ops->lookup_complete(object); 631 object->cache->ops->lookup_complete(object);
632 fscache_stat_d(&fscache_n_cop_lookup_complete);
566 fscache_enqueue_dependents(object); 633 fscache_enqueue_dependents(object);
567 634
568 fscache_hist(fscache_obj_instantiate_histogram, object->lookup_jif); 635 fscache_hist(fscache_obj_instantiate_histogram, object->lookup_jif);
@@ -581,11 +648,16 @@ static void fscache_drop_object(struct fscache_object *object)
581 648
582 _enter("{OBJ%x,%d}", object->debug_id, object->n_children); 649 _enter("{OBJ%x,%d}", object->debug_id, object->n_children);
583 650
651 ASSERTCMP(object->cookie, ==, NULL);
652 ASSERT(hlist_unhashed(&object->cookie_link));
653
584 spin_lock(&cache->object_list_lock); 654 spin_lock(&cache->object_list_lock);
585 list_del_init(&object->cache_link); 655 list_del_init(&object->cache_link);
586 spin_unlock(&cache->object_list_lock); 656 spin_unlock(&cache->object_list_lock);
587 657
658 fscache_stat(&fscache_n_cop_drop_object);
588 cache->ops->drop_object(object); 659 cache->ops->drop_object(object);
660 fscache_stat_d(&fscache_n_cop_drop_object);
589 661
590 if (parent) { 662 if (parent) {
591 _debug("release parent OBJ%x {%d}", 663 _debug("release parent OBJ%x {%d}",
@@ -600,7 +672,9 @@ static void fscache_drop_object(struct fscache_object *object)
600 } 672 }
601 673
602 /* this just shifts the object release to the slow work processor */ 674 /* this just shifts the object release to the slow work processor */
675 fscache_stat(&fscache_n_cop_put_object);
603 object->cache->ops->put_object(object); 676 object->cache->ops->put_object(object);
677 fscache_stat_d(&fscache_n_cop_put_object);
604 678
605 _leave(""); 679 _leave("");
606} 680}
@@ -690,8 +764,12 @@ static int fscache_object_slow_work_get_ref(struct slow_work *work)
690{ 764{
691 struct fscache_object *object = 765 struct fscache_object *object =
692 container_of(work, struct fscache_object, work); 766 container_of(work, struct fscache_object, work);
767 int ret;
693 768
694 return object->cache->ops->grab_object(object) ? 0 : -EAGAIN; 769 fscache_stat(&fscache_n_cop_grab_object);
770 ret = object->cache->ops->grab_object(object) ? 0 : -EAGAIN;
771 fscache_stat_d(&fscache_n_cop_grab_object);
772 return ret;
695} 773}
696 774
697/* 775/*
@@ -702,7 +780,9 @@ static void fscache_object_slow_work_put_ref(struct slow_work *work)
702 struct fscache_object *object = 780 struct fscache_object *object =
703 container_of(work, struct fscache_object, work); 781 container_of(work, struct fscache_object, work);
704 782
705 return object->cache->ops->put_object(object); 783 fscache_stat(&fscache_n_cop_put_object);
784 object->cache->ops->put_object(object);
785 fscache_stat_d(&fscache_n_cop_put_object);
706} 786}
707 787
708/* 788/*
@@ -739,7 +819,9 @@ static void fscache_enqueue_dependents(struct fscache_object *object)
739 819
740 /* sort onto appropriate lists */ 820 /* sort onto appropriate lists */
741 fscache_enqueue_object(dep); 821 fscache_enqueue_object(dep);
822 fscache_stat(&fscache_n_cop_put_object);
742 dep->cache->ops->put_object(dep); 823 dep->cache->ops->put_object(dep);
824 fscache_stat_d(&fscache_n_cop_put_object);
743 825
744 if (!list_empty(&object->dependents)) 826 if (!list_empty(&object->dependents))
745 cond_resched_lock(&object->lock); 827 cond_resched_lock(&object->lock);
diff --git a/fs/fscache/operation.c b/fs/fscache/operation.c
index e7f8d53b8b6b..313e79a14266 100644
--- a/fs/fscache/operation.c
+++ b/fs/fscache/operation.c
@@ -13,6 +13,7 @@
13 13
14#define FSCACHE_DEBUG_LEVEL OPERATION 14#define FSCACHE_DEBUG_LEVEL OPERATION
15#include <linux/module.h> 15#include <linux/module.h>
16#include <linux/seq_file.h>
16#include "internal.h" 17#include "internal.h"
17 18
18atomic_t fscache_op_debug_id; 19atomic_t fscache_op_debug_id;
@@ -31,32 +32,33 @@ void fscache_enqueue_operation(struct fscache_operation *op)
31 _enter("{OBJ%x OP%x,%u}", 32 _enter("{OBJ%x OP%x,%u}",
32 op->object->debug_id, op->debug_id, atomic_read(&op->usage)); 33 op->object->debug_id, op->debug_id, atomic_read(&op->usage));
33 34
35 fscache_set_op_state(op, "EnQ");
36
37 ASSERT(list_empty(&op->pend_link));
34 ASSERT(op->processor != NULL); 38 ASSERT(op->processor != NULL);
35 ASSERTCMP(op->object->state, >=, FSCACHE_OBJECT_AVAILABLE); 39 ASSERTCMP(op->object->state, >=, FSCACHE_OBJECT_AVAILABLE);
36 ASSERTCMP(atomic_read(&op->usage), >, 0); 40 ASSERTCMP(atomic_read(&op->usage), >, 0);
37 41
38 if (list_empty(&op->pend_link)) { 42 fscache_stat(&fscache_n_op_enqueue);
39 switch (op->flags & FSCACHE_OP_TYPE) { 43 switch (op->flags & FSCACHE_OP_TYPE) {
40 case FSCACHE_OP_FAST: 44 case FSCACHE_OP_FAST:
41 _debug("queue fast"); 45 _debug("queue fast");
42 atomic_inc(&op->usage); 46 atomic_inc(&op->usage);
43 if (!schedule_work(&op->fast_work)) 47 if (!schedule_work(&op->fast_work))
44 fscache_put_operation(op); 48 fscache_put_operation(op);
45 break; 49 break;
46 case FSCACHE_OP_SLOW: 50 case FSCACHE_OP_SLOW:
47 _debug("queue slow"); 51 _debug("queue slow");
48 slow_work_enqueue(&op->slow_work); 52 slow_work_enqueue(&op->slow_work);
49 break; 53 break;
50 case FSCACHE_OP_MYTHREAD: 54 case FSCACHE_OP_MYTHREAD:
51 _debug("queue for caller's attention"); 55 _debug("queue for caller's attention");
52 break; 56 break;
53 default: 57 default:
54 printk(KERN_ERR "FS-Cache: Unexpected op type %lx", 58 printk(KERN_ERR "FS-Cache: Unexpected op type %lx",
55 op->flags); 59 op->flags);
56 BUG(); 60 BUG();
57 break; 61 break;
58 }
59 fscache_stat(&fscache_n_op_enqueue);
60 } 62 }
61} 63}
62EXPORT_SYMBOL(fscache_enqueue_operation); 64EXPORT_SYMBOL(fscache_enqueue_operation);
@@ -67,6 +69,8 @@ EXPORT_SYMBOL(fscache_enqueue_operation);
67static void fscache_run_op(struct fscache_object *object, 69static void fscache_run_op(struct fscache_object *object,
68 struct fscache_operation *op) 70 struct fscache_operation *op)
69{ 71{
72 fscache_set_op_state(op, "Run");
73
70 object->n_in_progress++; 74 object->n_in_progress++;
71 if (test_and_clear_bit(FSCACHE_OP_WAITING, &op->flags)) 75 if (test_and_clear_bit(FSCACHE_OP_WAITING, &op->flags))
72 wake_up_bit(&op->flags, FSCACHE_OP_WAITING); 76 wake_up_bit(&op->flags, FSCACHE_OP_WAITING);
@@ -87,9 +91,12 @@ int fscache_submit_exclusive_op(struct fscache_object *object,
87 91
88 _enter("{OBJ%x OP%x},", object->debug_id, op->debug_id); 92 _enter("{OBJ%x OP%x},", object->debug_id, op->debug_id);
89 93
94 fscache_set_op_state(op, "SubmitX");
95
90 spin_lock(&object->lock); 96 spin_lock(&object->lock);
91 ASSERTCMP(object->n_ops, >=, object->n_in_progress); 97 ASSERTCMP(object->n_ops, >=, object->n_in_progress);
92 ASSERTCMP(object->n_ops, >=, object->n_exclusive); 98 ASSERTCMP(object->n_ops, >=, object->n_exclusive);
99 ASSERT(list_empty(&op->pend_link));
93 100
94 ret = -ENOBUFS; 101 ret = -ENOBUFS;
95 if (fscache_object_is_active(object)) { 102 if (fscache_object_is_active(object)) {
@@ -190,9 +197,12 @@ int fscache_submit_op(struct fscache_object *object,
190 197
191 ASSERTCMP(atomic_read(&op->usage), >, 0); 198 ASSERTCMP(atomic_read(&op->usage), >, 0);
192 199
200 fscache_set_op_state(op, "Submit");
201
193 spin_lock(&object->lock); 202 spin_lock(&object->lock);
194 ASSERTCMP(object->n_ops, >=, object->n_in_progress); 203 ASSERTCMP(object->n_ops, >=, object->n_in_progress);
195 ASSERTCMP(object->n_ops, >=, object->n_exclusive); 204 ASSERTCMP(object->n_ops, >=, object->n_exclusive);
205 ASSERT(list_empty(&op->pend_link));
196 206
197 ostate = object->state; 207 ostate = object->state;
198 smp_rmb(); 208 smp_rmb();
@@ -222,6 +232,11 @@ int fscache_submit_op(struct fscache_object *object,
222 list_add_tail(&op->pend_link, &object->pending_ops); 232 list_add_tail(&op->pend_link, &object->pending_ops);
223 fscache_stat(&fscache_n_op_pend); 233 fscache_stat(&fscache_n_op_pend);
224 ret = 0; 234 ret = 0;
235 } else if (object->state == FSCACHE_OBJECT_DYING ||
236 object->state == FSCACHE_OBJECT_LC_DYING ||
237 object->state == FSCACHE_OBJECT_WITHDRAWING) {
238 fscache_stat(&fscache_n_op_rejected);
239 ret = -ENOBUFS;
225 } else if (!test_bit(FSCACHE_IOERROR, &object->cache->flags)) { 240 } else if (!test_bit(FSCACHE_IOERROR, &object->cache->flags)) {
226 fscache_report_unexpected_submission(object, op, ostate); 241 fscache_report_unexpected_submission(object, op, ostate);
227 ASSERT(!fscache_object_is_active(object)); 242 ASSERT(!fscache_object_is_active(object));
@@ -264,12 +279,7 @@ void fscache_start_operations(struct fscache_object *object)
264 stop = true; 279 stop = true;
265 } 280 }
266 list_del_init(&op->pend_link); 281 list_del_init(&op->pend_link);
267 object->n_in_progress++; 282 fscache_run_op(object, op);
268
269 if (test_and_clear_bit(FSCACHE_OP_WAITING, &op->flags))
270 wake_up_bit(&op->flags, FSCACHE_OP_WAITING);
271 if (op->processor)
272 fscache_enqueue_operation(op);
273 283
274 /* the pending queue was holding a ref on the object */ 284 /* the pending queue was holding a ref on the object */
275 fscache_put_operation(op); 285 fscache_put_operation(op);
@@ -282,6 +292,36 @@ void fscache_start_operations(struct fscache_object *object)
282} 292}
283 293
284/* 294/*
295 * cancel an operation that's pending on an object
296 */
297int fscache_cancel_op(struct fscache_operation *op)
298{
299 struct fscache_object *object = op->object;
300 int ret;
301
302 _enter("OBJ%x OP%x}", op->object->debug_id, op->debug_id);
303
304 spin_lock(&object->lock);
305
306 ret = -EBUSY;
307 if (!list_empty(&op->pend_link)) {
308 fscache_stat(&fscache_n_op_cancelled);
309 list_del_init(&op->pend_link);
310 object->n_ops--;
311 if (test_bit(FSCACHE_OP_EXCLUSIVE, &op->flags))
312 object->n_exclusive--;
313 if (test_and_clear_bit(FSCACHE_OP_WAITING, &op->flags))
314 wake_up_bit(&op->flags, FSCACHE_OP_WAITING);
315 fscache_put_operation(op);
316 ret = 0;
317 }
318
319 spin_unlock(&object->lock);
320 _leave(" = %d", ret);
321 return ret;
322}
323
324/*
285 * release an operation 325 * release an operation
286 * - queues pending ops if this is the last in-progress op 326 * - queues pending ops if this is the last in-progress op
287 */ 327 */
@@ -298,6 +338,8 @@ void fscache_put_operation(struct fscache_operation *op)
298 if (!atomic_dec_and_test(&op->usage)) 338 if (!atomic_dec_and_test(&op->usage))
299 return; 339 return;
300 340
341 fscache_set_op_state(op, "Put");
342
301 _debug("PUT OP"); 343 _debug("PUT OP");
302 if (test_and_set_bit(FSCACHE_OP_DEAD, &op->flags)) 344 if (test_and_set_bit(FSCACHE_OP_DEAD, &op->flags))
303 BUG(); 345 BUG();
@@ -311,6 +353,9 @@ void fscache_put_operation(struct fscache_operation *op)
311 353
312 object = op->object; 354 object = op->object;
313 355
356 if (test_bit(FSCACHE_OP_DEC_READ_CNT, &op->flags))
357 atomic_dec(&object->n_reads);
358
314 /* now... we may get called with the object spinlock held, so we 359 /* now... we may get called with the object spinlock held, so we
315 * complete the cleanup here only if we can immediately acquire the 360 * complete the cleanup here only if we can immediately acquire the
316 * lock, and defer it otherwise */ 361 * lock, and defer it otherwise */
@@ -452,8 +497,27 @@ static void fscache_op_execute(struct slow_work *work)
452 _leave(""); 497 _leave("");
453} 498}
454 499
500/*
501 * describe an operation for slow-work debugging
502 */
503#ifdef CONFIG_SLOW_WORK_PROC
504static void fscache_op_desc(struct slow_work *work, struct seq_file *m)
505{
506 struct fscache_operation *op =
507 container_of(work, struct fscache_operation, slow_work);
508
509 seq_printf(m, "FSC: OBJ%x OP%x: %s/%s fl=%lx",
510 op->object->debug_id, op->debug_id,
511 op->name, op->state, op->flags);
512}
513#endif
514
455const struct slow_work_ops fscache_op_slow_work_ops = { 515const struct slow_work_ops fscache_op_slow_work_ops = {
516 .owner = THIS_MODULE,
456 .get_ref = fscache_op_get_ref, 517 .get_ref = fscache_op_get_ref,
457 .put_ref = fscache_op_put_ref, 518 .put_ref = fscache_op_put_ref,
458 .execute = fscache_op_execute, 519 .execute = fscache_op_execute,
520#ifdef CONFIG_SLOW_WORK_PROC
521 .desc = fscache_op_desc,
522#endif
459}; 523};
diff --git a/fs/fscache/page.c b/fs/fscache/page.c
index 2568e0eb644f..c598ea4c4e7d 100644
--- a/fs/fscache/page.c
+++ b/fs/fscache/page.c
@@ -43,18 +43,102 @@ void __fscache_wait_on_page_write(struct fscache_cookie *cookie, struct page *pa
43EXPORT_SYMBOL(__fscache_wait_on_page_write); 43EXPORT_SYMBOL(__fscache_wait_on_page_write);
44 44
45/* 45/*
46 * note that a page has finished being written to the cache 46 * decide whether a page can be released, possibly by cancelling a store to it
47 * - we're allowed to sleep if __GFP_WAIT is flagged
47 */ 48 */
48static void fscache_end_page_write(struct fscache_cookie *cookie, struct page *page) 49bool __fscache_maybe_release_page(struct fscache_cookie *cookie,
50 struct page *page,
51 gfp_t gfp)
49{ 52{
50 struct page *xpage; 53 struct page *xpage;
54 void *val;
55
56 _enter("%p,%p,%x", cookie, page, gfp);
57
58 rcu_read_lock();
59 val = radix_tree_lookup(&cookie->stores, page->index);
60 if (!val) {
61 rcu_read_unlock();
62 fscache_stat(&fscache_n_store_vmscan_not_storing);
63 __fscache_uncache_page(cookie, page);
64 return true;
65 }
66
67 /* see if the page is actually undergoing storage - if so we can't get
68 * rid of it till the cache has finished with it */
69 if (radix_tree_tag_get(&cookie->stores, page->index,
70 FSCACHE_COOKIE_STORING_TAG)) {
71 rcu_read_unlock();
72 goto page_busy;
73 }
74
75 /* the page is pending storage, so we attempt to cancel the store and
76 * discard the store request so that the page can be reclaimed */
77 spin_lock(&cookie->stores_lock);
78 rcu_read_unlock();
79
80 if (radix_tree_tag_get(&cookie->stores, page->index,
81 FSCACHE_COOKIE_STORING_TAG)) {
82 /* the page started to undergo storage whilst we were looking,
83 * so now we can only wait or return */
84 spin_unlock(&cookie->stores_lock);
85 goto page_busy;
86 }
51 87
52 spin_lock(&cookie->lock);
53 xpage = radix_tree_delete(&cookie->stores, page->index); 88 xpage = radix_tree_delete(&cookie->stores, page->index);
54 spin_unlock(&cookie->lock); 89 spin_unlock(&cookie->stores_lock);
55 ASSERT(xpage != NULL); 90
91 if (xpage) {
92 fscache_stat(&fscache_n_store_vmscan_cancelled);
93 fscache_stat(&fscache_n_store_radix_deletes);
94 ASSERTCMP(xpage, ==, page);
95 } else {
96 fscache_stat(&fscache_n_store_vmscan_gone);
97 }
56 98
57 wake_up_bit(&cookie->flags, 0); 99 wake_up_bit(&cookie->flags, 0);
100 if (xpage)
101 page_cache_release(xpage);
102 __fscache_uncache_page(cookie, page);
103 return true;
104
105page_busy:
106 /* we might want to wait here, but that could deadlock the allocator as
107 * the slow-work threads writing to the cache may all end up sleeping
108 * on memory allocation */
109 fscache_stat(&fscache_n_store_vmscan_busy);
110 return false;
111}
112EXPORT_SYMBOL(__fscache_maybe_release_page);
113
114/*
115 * note that a page has finished being written to the cache
116 */
117static void fscache_end_page_write(struct fscache_object *object,
118 struct page *page)
119{
120 struct fscache_cookie *cookie;
121 struct page *xpage = NULL;
122
123 spin_lock(&object->lock);
124 cookie = object->cookie;
125 if (cookie) {
126 /* delete the page from the tree if it is now no longer
127 * pending */
128 spin_lock(&cookie->stores_lock);
129 radix_tree_tag_clear(&cookie->stores, page->index,
130 FSCACHE_COOKIE_STORING_TAG);
131 if (!radix_tree_tag_get(&cookie->stores, page->index,
132 FSCACHE_COOKIE_PENDING_TAG)) {
133 fscache_stat(&fscache_n_store_radix_deletes);
134 xpage = radix_tree_delete(&cookie->stores, page->index);
135 }
136 spin_unlock(&cookie->stores_lock);
137 wake_up_bit(&cookie->flags, 0);
138 }
139 spin_unlock(&object->lock);
140 if (xpage)
141 page_cache_release(xpage);
58} 142}
59 143
60/* 144/*
@@ -63,14 +147,21 @@ static void fscache_end_page_write(struct fscache_cookie *cookie, struct page *p
63static void fscache_attr_changed_op(struct fscache_operation *op) 147static void fscache_attr_changed_op(struct fscache_operation *op)
64{ 148{
65 struct fscache_object *object = op->object; 149 struct fscache_object *object = op->object;
150 int ret;
66 151
67 _enter("{OBJ%x OP%x}", object->debug_id, op->debug_id); 152 _enter("{OBJ%x OP%x}", object->debug_id, op->debug_id);
68 153
69 fscache_stat(&fscache_n_attr_changed_calls); 154 fscache_stat(&fscache_n_attr_changed_calls);
70 155
71 if (fscache_object_is_active(object) && 156 if (fscache_object_is_active(object)) {
72 object->cache->ops->attr_changed(object) < 0) 157 fscache_set_op_state(op, "CallFS");
73 fscache_abort_object(object); 158 fscache_stat(&fscache_n_cop_attr_changed);
159 ret = object->cache->ops->attr_changed(object);
160 fscache_stat_d(&fscache_n_cop_attr_changed);
161 fscache_set_op_state(op, "Done");
162 if (ret < 0)
163 fscache_abort_object(object);
164 }
74 165
75 _leave(""); 166 _leave("");
76} 167}
@@ -99,6 +190,7 @@ int __fscache_attr_changed(struct fscache_cookie *cookie)
99 fscache_operation_init(op, NULL); 190 fscache_operation_init(op, NULL);
100 fscache_operation_init_slow(op, fscache_attr_changed_op); 191 fscache_operation_init_slow(op, fscache_attr_changed_op);
101 op->flags = FSCACHE_OP_SLOW | (1 << FSCACHE_OP_EXCLUSIVE); 192 op->flags = FSCACHE_OP_SLOW | (1 << FSCACHE_OP_EXCLUSIVE);
193 fscache_set_op_name(op, "Attr");
102 194
103 spin_lock(&cookie->lock); 195 spin_lock(&cookie->lock);
104 196
@@ -184,6 +276,7 @@ static struct fscache_retrieval *fscache_alloc_retrieval(
184 op->start_time = jiffies; 276 op->start_time = jiffies;
185 INIT_WORK(&op->op.fast_work, fscache_retrieval_work); 277 INIT_WORK(&op->op.fast_work, fscache_retrieval_work);
186 INIT_LIST_HEAD(&op->to_do); 278 INIT_LIST_HEAD(&op->to_do);
279 fscache_set_op_name(&op->op, "Retr");
187 return op; 280 return op;
188} 281}
189 282
@@ -221,6 +314,43 @@ static int fscache_wait_for_deferred_lookup(struct fscache_cookie *cookie)
221} 314}
222 315
223/* 316/*
317 * wait for an object to become active (or dead)
318 */
319static int fscache_wait_for_retrieval_activation(struct fscache_object *object,
320 struct fscache_retrieval *op,
321 atomic_t *stat_op_waits,
322 atomic_t *stat_object_dead)
323{
324 int ret;
325
326 if (!test_bit(FSCACHE_OP_WAITING, &op->op.flags))
327 goto check_if_dead;
328
329 _debug(">>> WT");
330 fscache_stat(stat_op_waits);
331 if (wait_on_bit(&op->op.flags, FSCACHE_OP_WAITING,
332 fscache_wait_bit_interruptible,
333 TASK_INTERRUPTIBLE) < 0) {
334 ret = fscache_cancel_op(&op->op);
335 if (ret == 0)
336 return -ERESTARTSYS;
337
338 /* it's been removed from the pending queue by another party,
339 * so we should get to run shortly */
340 wait_on_bit(&op->op.flags, FSCACHE_OP_WAITING,
341 fscache_wait_bit, TASK_UNINTERRUPTIBLE);
342 }
343 _debug("<<< GO");
344
345check_if_dead:
346 if (unlikely(fscache_object_is_dead(object))) {
347 fscache_stat(stat_object_dead);
348 return -ENOBUFS;
349 }
350 return 0;
351}
352
353/*
224 * read a page from the cache or allocate a block in which to store it 354 * read a page from the cache or allocate a block in which to store it
225 * - we return: 355 * - we return:
226 * -ENOMEM - out of memory, nothing done 356 * -ENOMEM - out of memory, nothing done
@@ -257,6 +387,7 @@ int __fscache_read_or_alloc_page(struct fscache_cookie *cookie,
257 _leave(" = -ENOMEM"); 387 _leave(" = -ENOMEM");
258 return -ENOMEM; 388 return -ENOMEM;
259 } 389 }
390 fscache_set_op_name(&op->op, "RetrRA1");
260 391
261 spin_lock(&cookie->lock); 392 spin_lock(&cookie->lock);
262 393
@@ -267,6 +398,9 @@ int __fscache_read_or_alloc_page(struct fscache_cookie *cookie,
267 398
268 ASSERTCMP(object->state, >, FSCACHE_OBJECT_LOOKING_UP); 399 ASSERTCMP(object->state, >, FSCACHE_OBJECT_LOOKING_UP);
269 400
401 atomic_inc(&object->n_reads);
402 set_bit(FSCACHE_OP_DEC_READ_CNT, &op->op.flags);
403
270 if (fscache_submit_op(object, &op->op) < 0) 404 if (fscache_submit_op(object, &op->op) < 0)
271 goto nobufs_unlock; 405 goto nobufs_unlock;
272 spin_unlock(&cookie->lock); 406 spin_unlock(&cookie->lock);
@@ -279,23 +413,27 @@ int __fscache_read_or_alloc_page(struct fscache_cookie *cookie,
279 413
280 /* we wait for the operation to become active, and then process it 414 /* we wait for the operation to become active, and then process it
281 * *here*, in this thread, and not in the thread pool */ 415 * *here*, in this thread, and not in the thread pool */
282 if (test_bit(FSCACHE_OP_WAITING, &op->op.flags)) { 416 ret = fscache_wait_for_retrieval_activation(
283 _debug(">>> WT"); 417 object, op,
284 fscache_stat(&fscache_n_retrieval_op_waits); 418 __fscache_stat(&fscache_n_retrieval_op_waits),
285 wait_on_bit(&op->op.flags, FSCACHE_OP_WAITING, 419 __fscache_stat(&fscache_n_retrievals_object_dead));
286 fscache_wait_bit, TASK_UNINTERRUPTIBLE); 420 if (ret < 0)
287 _debug("<<< GO"); 421 goto error;
288 }
289 422
290 /* ask the cache to honour the operation */ 423 /* ask the cache to honour the operation */
291 if (test_bit(FSCACHE_COOKIE_NO_DATA_YET, &object->cookie->flags)) { 424 if (test_bit(FSCACHE_COOKIE_NO_DATA_YET, &object->cookie->flags)) {
425 fscache_stat(&fscache_n_cop_allocate_page);
292 ret = object->cache->ops->allocate_page(op, page, gfp); 426 ret = object->cache->ops->allocate_page(op, page, gfp);
427 fscache_stat_d(&fscache_n_cop_allocate_page);
293 if (ret == 0) 428 if (ret == 0)
294 ret = -ENODATA; 429 ret = -ENODATA;
295 } else { 430 } else {
431 fscache_stat(&fscache_n_cop_read_or_alloc_page);
296 ret = object->cache->ops->read_or_alloc_page(op, page, gfp); 432 ret = object->cache->ops->read_or_alloc_page(op, page, gfp);
433 fscache_stat_d(&fscache_n_cop_read_or_alloc_page);
297 } 434 }
298 435
436error:
299 if (ret == -ENOMEM) 437 if (ret == -ENOMEM)
300 fscache_stat(&fscache_n_retrievals_nomem); 438 fscache_stat(&fscache_n_retrievals_nomem);
301 else if (ret == -ERESTARTSYS) 439 else if (ret == -ERESTARTSYS)
@@ -347,7 +485,6 @@ int __fscache_read_or_alloc_pages(struct fscache_cookie *cookie,
347 void *context, 485 void *context,
348 gfp_t gfp) 486 gfp_t gfp)
349{ 487{
350 fscache_pages_retrieval_func_t func;
351 struct fscache_retrieval *op; 488 struct fscache_retrieval *op;
352 struct fscache_object *object; 489 struct fscache_object *object;
353 int ret; 490 int ret;
@@ -369,6 +506,7 @@ int __fscache_read_or_alloc_pages(struct fscache_cookie *cookie,
369 op = fscache_alloc_retrieval(mapping, end_io_func, context); 506 op = fscache_alloc_retrieval(mapping, end_io_func, context);
370 if (!op) 507 if (!op)
371 return -ENOMEM; 508 return -ENOMEM;
509 fscache_set_op_name(&op->op, "RetrRAN");
372 510
373 spin_lock(&cookie->lock); 511 spin_lock(&cookie->lock);
374 512
@@ -377,6 +515,9 @@ int __fscache_read_or_alloc_pages(struct fscache_cookie *cookie,
377 object = hlist_entry(cookie->backing_objects.first, 515 object = hlist_entry(cookie->backing_objects.first,
378 struct fscache_object, cookie_link); 516 struct fscache_object, cookie_link);
379 517
518 atomic_inc(&object->n_reads);
519 set_bit(FSCACHE_OP_DEC_READ_CNT, &op->op.flags);
520
380 if (fscache_submit_op(object, &op->op) < 0) 521 if (fscache_submit_op(object, &op->op) < 0)
381 goto nobufs_unlock; 522 goto nobufs_unlock;
382 spin_unlock(&cookie->lock); 523 spin_unlock(&cookie->lock);
@@ -389,21 +530,27 @@ int __fscache_read_or_alloc_pages(struct fscache_cookie *cookie,
389 530
390 /* we wait for the operation to become active, and then process it 531 /* we wait for the operation to become active, and then process it
391 * *here*, in this thread, and not in the thread pool */ 532 * *here*, in this thread, and not in the thread pool */
392 if (test_bit(FSCACHE_OP_WAITING, &op->op.flags)) { 533 ret = fscache_wait_for_retrieval_activation(
393 _debug(">>> WT"); 534 object, op,
394 fscache_stat(&fscache_n_retrieval_op_waits); 535 __fscache_stat(&fscache_n_retrieval_op_waits),
395 wait_on_bit(&op->op.flags, FSCACHE_OP_WAITING, 536 __fscache_stat(&fscache_n_retrievals_object_dead));
396 fscache_wait_bit, TASK_UNINTERRUPTIBLE); 537 if (ret < 0)
397 _debug("<<< GO"); 538 goto error;
398 }
399 539
400 /* ask the cache to honour the operation */ 540 /* ask the cache to honour the operation */
401 if (test_bit(FSCACHE_COOKIE_NO_DATA_YET, &object->cookie->flags)) 541 if (test_bit(FSCACHE_COOKIE_NO_DATA_YET, &object->cookie->flags)) {
402 func = object->cache->ops->allocate_pages; 542 fscache_stat(&fscache_n_cop_allocate_pages);
403 else 543 ret = object->cache->ops->allocate_pages(
404 func = object->cache->ops->read_or_alloc_pages; 544 op, pages, nr_pages, gfp);
405 ret = func(op, pages, nr_pages, gfp); 545 fscache_stat_d(&fscache_n_cop_allocate_pages);
546 } else {
547 fscache_stat(&fscache_n_cop_read_or_alloc_pages);
548 ret = object->cache->ops->read_or_alloc_pages(
549 op, pages, nr_pages, gfp);
550 fscache_stat_d(&fscache_n_cop_read_or_alloc_pages);
551 }
406 552
553error:
407 if (ret == -ENOMEM) 554 if (ret == -ENOMEM)
408 fscache_stat(&fscache_n_retrievals_nomem); 555 fscache_stat(&fscache_n_retrievals_nomem);
409 else if (ret == -ERESTARTSYS) 556 else if (ret == -ERESTARTSYS)
@@ -461,6 +608,7 @@ int __fscache_alloc_page(struct fscache_cookie *cookie,
461 op = fscache_alloc_retrieval(page->mapping, NULL, NULL); 608 op = fscache_alloc_retrieval(page->mapping, NULL, NULL);
462 if (!op) 609 if (!op)
463 return -ENOMEM; 610 return -ENOMEM;
611 fscache_set_op_name(&op->op, "RetrAL1");
464 612
465 spin_lock(&cookie->lock); 613 spin_lock(&cookie->lock);
466 614
@@ -475,18 +623,22 @@ int __fscache_alloc_page(struct fscache_cookie *cookie,
475 623
476 fscache_stat(&fscache_n_alloc_ops); 624 fscache_stat(&fscache_n_alloc_ops);
477 625
478 if (test_bit(FSCACHE_OP_WAITING, &op->op.flags)) { 626 ret = fscache_wait_for_retrieval_activation(
479 _debug(">>> WT"); 627 object, op,
480 fscache_stat(&fscache_n_alloc_op_waits); 628 __fscache_stat(&fscache_n_alloc_op_waits),
481 wait_on_bit(&op->op.flags, FSCACHE_OP_WAITING, 629 __fscache_stat(&fscache_n_allocs_object_dead));
482 fscache_wait_bit, TASK_UNINTERRUPTIBLE); 630 if (ret < 0)
483 _debug("<<< GO"); 631 goto error;
484 }
485 632
486 /* ask the cache to honour the operation */ 633 /* ask the cache to honour the operation */
634 fscache_stat(&fscache_n_cop_allocate_page);
487 ret = object->cache->ops->allocate_page(op, page, gfp); 635 ret = object->cache->ops->allocate_page(op, page, gfp);
636 fscache_stat_d(&fscache_n_cop_allocate_page);
488 637
489 if (ret < 0) 638error:
639 if (ret == -ERESTARTSYS)
640 fscache_stat(&fscache_n_allocs_intr);
641 else if (ret < 0)
490 fscache_stat(&fscache_n_allocs_nobufs); 642 fscache_stat(&fscache_n_allocs_nobufs);
491 else 643 else
492 fscache_stat(&fscache_n_allocs_ok); 644 fscache_stat(&fscache_n_allocs_ok);
@@ -521,7 +673,7 @@ static void fscache_write_op(struct fscache_operation *_op)
521 struct fscache_storage *op = 673 struct fscache_storage *op =
522 container_of(_op, struct fscache_storage, op); 674 container_of(_op, struct fscache_storage, op);
523 struct fscache_object *object = op->op.object; 675 struct fscache_object *object = op->op.object;
524 struct fscache_cookie *cookie = object->cookie; 676 struct fscache_cookie *cookie;
525 struct page *page; 677 struct page *page;
526 unsigned n; 678 unsigned n;
527 void *results[1]; 679 void *results[1];
@@ -529,16 +681,19 @@ static void fscache_write_op(struct fscache_operation *_op)
529 681
530 _enter("{OP%x,%d}", op->op.debug_id, atomic_read(&op->op.usage)); 682 _enter("{OP%x,%d}", op->op.debug_id, atomic_read(&op->op.usage));
531 683
532 spin_lock(&cookie->lock); 684 fscache_set_op_state(&op->op, "GetPage");
685
533 spin_lock(&object->lock); 686 spin_lock(&object->lock);
687 cookie = object->cookie;
534 688
535 if (!fscache_object_is_active(object)) { 689 if (!fscache_object_is_active(object) || !cookie) {
536 spin_unlock(&object->lock); 690 spin_unlock(&object->lock);
537 spin_unlock(&cookie->lock);
538 _leave(""); 691 _leave("");
539 return; 692 return;
540 } 693 }
541 694
695 spin_lock(&cookie->stores_lock);
696
542 fscache_stat(&fscache_n_store_calls); 697 fscache_stat(&fscache_n_store_calls);
543 698
544 /* find a page to store */ 699 /* find a page to store */
@@ -549,23 +704,35 @@ static void fscache_write_op(struct fscache_operation *_op)
549 goto superseded; 704 goto superseded;
550 page = results[0]; 705 page = results[0];
551 _debug("gang %d [%lx]", n, page->index); 706 _debug("gang %d [%lx]", n, page->index);
552 if (page->index > op->store_limit) 707 if (page->index > op->store_limit) {
708 fscache_stat(&fscache_n_store_pages_over_limit);
553 goto superseded; 709 goto superseded;
710 }
554 711
555 radix_tree_tag_clear(&cookie->stores, page->index, 712 if (page) {
556 FSCACHE_COOKIE_PENDING_TAG); 713 radix_tree_tag_set(&cookie->stores, page->index,
714 FSCACHE_COOKIE_STORING_TAG);
715 radix_tree_tag_clear(&cookie->stores, page->index,
716 FSCACHE_COOKIE_PENDING_TAG);
717 }
557 718
719 spin_unlock(&cookie->stores_lock);
558 spin_unlock(&object->lock); 720 spin_unlock(&object->lock);
559 spin_unlock(&cookie->lock);
560 721
561 if (page) { 722 if (page) {
723 fscache_set_op_state(&op->op, "Store");
724 fscache_stat(&fscache_n_store_pages);
725 fscache_stat(&fscache_n_cop_write_page);
562 ret = object->cache->ops->write_page(op, page); 726 ret = object->cache->ops->write_page(op, page);
563 fscache_end_page_write(cookie, page); 727 fscache_stat_d(&fscache_n_cop_write_page);
564 page_cache_release(page); 728 fscache_set_op_state(&op->op, "EndWrite");
565 if (ret < 0) 729 fscache_end_page_write(object, page);
730 if (ret < 0) {
731 fscache_set_op_state(&op->op, "Abort");
566 fscache_abort_object(object); 732 fscache_abort_object(object);
567 else 733 } else {
568 fscache_enqueue_operation(&op->op); 734 fscache_enqueue_operation(&op->op);
735 }
569 } 736 }
570 737
571 _leave(""); 738 _leave("");
@@ -575,9 +742,9 @@ superseded:
575 /* this writer is going away and there aren't any more things to 742 /* this writer is going away and there aren't any more things to
576 * write */ 743 * write */
577 _debug("cease"); 744 _debug("cease");
745 spin_unlock(&cookie->stores_lock);
578 clear_bit(FSCACHE_OBJECT_PENDING_WRITE, &object->flags); 746 clear_bit(FSCACHE_OBJECT_PENDING_WRITE, &object->flags);
579 spin_unlock(&object->lock); 747 spin_unlock(&object->lock);
580 spin_unlock(&cookie->lock);
581 _leave(""); 748 _leave("");
582} 749}
583 750
@@ -634,6 +801,7 @@ int __fscache_write_page(struct fscache_cookie *cookie,
634 fscache_operation_init(&op->op, fscache_release_write_op); 801 fscache_operation_init(&op->op, fscache_release_write_op);
635 fscache_operation_init_slow(&op->op, fscache_write_op); 802 fscache_operation_init_slow(&op->op, fscache_write_op);
636 op->op.flags = FSCACHE_OP_SLOW | (1 << FSCACHE_OP_WAITING); 803 op->op.flags = FSCACHE_OP_SLOW | (1 << FSCACHE_OP_WAITING);
804 fscache_set_op_name(&op->op, "Write1");
637 805
638 ret = radix_tree_preload(gfp & ~__GFP_HIGHMEM); 806 ret = radix_tree_preload(gfp & ~__GFP_HIGHMEM);
639 if (ret < 0) 807 if (ret < 0)
@@ -652,6 +820,7 @@ int __fscache_write_page(struct fscache_cookie *cookie,
652 /* add the page to the pending-storage radix tree on the backing 820 /* add the page to the pending-storage radix tree on the backing
653 * object */ 821 * object */
654 spin_lock(&object->lock); 822 spin_lock(&object->lock);
823 spin_lock(&cookie->stores_lock);
655 824
656 _debug("store limit %llx", (unsigned long long) object->store_limit); 825 _debug("store limit %llx", (unsigned long long) object->store_limit);
657 826
@@ -672,6 +841,7 @@ int __fscache_write_page(struct fscache_cookie *cookie,
672 if (test_and_set_bit(FSCACHE_OBJECT_PENDING_WRITE, &object->flags)) 841 if (test_and_set_bit(FSCACHE_OBJECT_PENDING_WRITE, &object->flags))
673 goto already_pending; 842 goto already_pending;
674 843
844 spin_unlock(&cookie->stores_lock);
675 spin_unlock(&object->lock); 845 spin_unlock(&object->lock);
676 846
677 op->op.debug_id = atomic_inc_return(&fscache_op_debug_id); 847 op->op.debug_id = atomic_inc_return(&fscache_op_debug_id);
@@ -693,6 +863,7 @@ int __fscache_write_page(struct fscache_cookie *cookie,
693already_queued: 863already_queued:
694 fscache_stat(&fscache_n_stores_again); 864 fscache_stat(&fscache_n_stores_again);
695already_pending: 865already_pending:
866 spin_unlock(&cookie->stores_lock);
696 spin_unlock(&object->lock); 867 spin_unlock(&object->lock);
697 spin_unlock(&cookie->lock); 868 spin_unlock(&cookie->lock);
698 radix_tree_preload_end(); 869 radix_tree_preload_end();
@@ -702,7 +873,9 @@ already_pending:
702 return 0; 873 return 0;
703 874
704submit_failed: 875submit_failed:
876 spin_lock(&cookie->stores_lock);
705 radix_tree_delete(&cookie->stores, page->index); 877 radix_tree_delete(&cookie->stores, page->index);
878 spin_unlock(&cookie->stores_lock);
706 page_cache_release(page); 879 page_cache_release(page);
707 ret = -ENOBUFS; 880 ret = -ENOBUFS;
708 goto nobufs; 881 goto nobufs;
@@ -763,7 +936,9 @@ void __fscache_uncache_page(struct fscache_cookie *cookie, struct page *page)
763 if (TestClearPageFsCache(page) && 936 if (TestClearPageFsCache(page) &&
764 object->cache->ops->uncache_page) { 937 object->cache->ops->uncache_page) {
765 /* the cache backend releases the cookie lock */ 938 /* the cache backend releases the cookie lock */
939 fscache_stat(&fscache_n_cop_uncache_page);
766 object->cache->ops->uncache_page(object, page); 940 object->cache->ops->uncache_page(object, page);
941 fscache_stat_d(&fscache_n_cop_uncache_page);
767 goto done; 942 goto done;
768 } 943 }
769 944
diff --git a/fs/fscache/proc.c b/fs/fscache/proc.c
index beeab44bc31a..1d9e4951a597 100644
--- a/fs/fscache/proc.c
+++ b/fs/fscache/proc.c
@@ -37,10 +37,20 @@ int __init fscache_proc_init(void)
37 goto error_histogram; 37 goto error_histogram;
38#endif 38#endif
39 39
40#ifdef CONFIG_FSCACHE_OBJECT_LIST
41 if (!proc_create("fs/fscache/objects", S_IFREG | 0444, NULL,
42 &fscache_objlist_fops))
43 goto error_objects;
44#endif
45
40 _leave(" = 0"); 46 _leave(" = 0");
41 return 0; 47 return 0;
42 48
49#ifdef CONFIG_FSCACHE_OBJECT_LIST
50error_objects:
51#endif
43#ifdef CONFIG_FSCACHE_HISTOGRAM 52#ifdef CONFIG_FSCACHE_HISTOGRAM
53 remove_proc_entry("fs/fscache/histogram", NULL);
44error_histogram: 54error_histogram:
45#endif 55#endif
46#ifdef CONFIG_FSCACHE_STATS 56#ifdef CONFIG_FSCACHE_STATS
@@ -58,6 +68,9 @@ error_dir:
58 */ 68 */
59void fscache_proc_cleanup(void) 69void fscache_proc_cleanup(void)
60{ 70{
71#ifdef CONFIG_FSCACHE_OBJECT_LIST
72 remove_proc_entry("fs/fscache/objects", NULL);
73#endif
61#ifdef CONFIG_FSCACHE_HISTOGRAM 74#ifdef CONFIG_FSCACHE_HISTOGRAM
62 remove_proc_entry("fs/fscache/histogram", NULL); 75 remove_proc_entry("fs/fscache/histogram", NULL);
63#endif 76#endif
diff --git a/fs/fscache/stats.c b/fs/fscache/stats.c
index 65deb99e756b..46435f3aae68 100644
--- a/fs/fscache/stats.c
+++ b/fs/fscache/stats.c
@@ -25,6 +25,8 @@ atomic_t fscache_n_op_requeue;
25atomic_t fscache_n_op_deferred_release; 25atomic_t fscache_n_op_deferred_release;
26atomic_t fscache_n_op_release; 26atomic_t fscache_n_op_release;
27atomic_t fscache_n_op_gc; 27atomic_t fscache_n_op_gc;
28atomic_t fscache_n_op_cancelled;
29atomic_t fscache_n_op_rejected;
28 30
29atomic_t fscache_n_attr_changed; 31atomic_t fscache_n_attr_changed;
30atomic_t fscache_n_attr_changed_ok; 32atomic_t fscache_n_attr_changed_ok;
@@ -36,6 +38,8 @@ atomic_t fscache_n_allocs;
36atomic_t fscache_n_allocs_ok; 38atomic_t fscache_n_allocs_ok;
37atomic_t fscache_n_allocs_wait; 39atomic_t fscache_n_allocs_wait;
38atomic_t fscache_n_allocs_nobufs; 40atomic_t fscache_n_allocs_nobufs;
41atomic_t fscache_n_allocs_intr;
42atomic_t fscache_n_allocs_object_dead;
39atomic_t fscache_n_alloc_ops; 43atomic_t fscache_n_alloc_ops;
40atomic_t fscache_n_alloc_op_waits; 44atomic_t fscache_n_alloc_op_waits;
41 45
@@ -46,6 +50,7 @@ atomic_t fscache_n_retrievals_nodata;
46atomic_t fscache_n_retrievals_nobufs; 50atomic_t fscache_n_retrievals_nobufs;
47atomic_t fscache_n_retrievals_intr; 51atomic_t fscache_n_retrievals_intr;
48atomic_t fscache_n_retrievals_nomem; 52atomic_t fscache_n_retrievals_nomem;
53atomic_t fscache_n_retrievals_object_dead;
49atomic_t fscache_n_retrieval_ops; 54atomic_t fscache_n_retrieval_ops;
50atomic_t fscache_n_retrieval_op_waits; 55atomic_t fscache_n_retrieval_op_waits;
51 56
@@ -56,6 +61,14 @@ atomic_t fscache_n_stores_nobufs;
56atomic_t fscache_n_stores_oom; 61atomic_t fscache_n_stores_oom;
57atomic_t fscache_n_store_ops; 62atomic_t fscache_n_store_ops;
58atomic_t fscache_n_store_calls; 63atomic_t fscache_n_store_calls;
64atomic_t fscache_n_store_pages;
65atomic_t fscache_n_store_radix_deletes;
66atomic_t fscache_n_store_pages_over_limit;
67
68atomic_t fscache_n_store_vmscan_not_storing;
69atomic_t fscache_n_store_vmscan_gone;
70atomic_t fscache_n_store_vmscan_busy;
71atomic_t fscache_n_store_vmscan_cancelled;
59 72
60atomic_t fscache_n_marks; 73atomic_t fscache_n_marks;
61atomic_t fscache_n_uncaches; 74atomic_t fscache_n_uncaches;
@@ -74,6 +87,7 @@ atomic_t fscache_n_updates_run;
74atomic_t fscache_n_relinquishes; 87atomic_t fscache_n_relinquishes;
75atomic_t fscache_n_relinquishes_null; 88atomic_t fscache_n_relinquishes_null;
76atomic_t fscache_n_relinquishes_waitcrt; 89atomic_t fscache_n_relinquishes_waitcrt;
90atomic_t fscache_n_relinquishes_retire;
77 91
78atomic_t fscache_n_cookie_index; 92atomic_t fscache_n_cookie_index;
79atomic_t fscache_n_cookie_data; 93atomic_t fscache_n_cookie_data;
@@ -84,6 +98,7 @@ atomic_t fscache_n_object_no_alloc;
84atomic_t fscache_n_object_lookups; 98atomic_t fscache_n_object_lookups;
85atomic_t fscache_n_object_lookups_negative; 99atomic_t fscache_n_object_lookups_negative;
86atomic_t fscache_n_object_lookups_positive; 100atomic_t fscache_n_object_lookups_positive;
101atomic_t fscache_n_object_lookups_timed_out;
87atomic_t fscache_n_object_created; 102atomic_t fscache_n_object_created;
88atomic_t fscache_n_object_avail; 103atomic_t fscache_n_object_avail;
89atomic_t fscache_n_object_dead; 104atomic_t fscache_n_object_dead;
@@ -93,6 +108,23 @@ atomic_t fscache_n_checkaux_okay;
93atomic_t fscache_n_checkaux_update; 108atomic_t fscache_n_checkaux_update;
94atomic_t fscache_n_checkaux_obsolete; 109atomic_t fscache_n_checkaux_obsolete;
95 110
111atomic_t fscache_n_cop_alloc_object;
112atomic_t fscache_n_cop_lookup_object;
113atomic_t fscache_n_cop_lookup_complete;
114atomic_t fscache_n_cop_grab_object;
115atomic_t fscache_n_cop_update_object;
116atomic_t fscache_n_cop_drop_object;
117atomic_t fscache_n_cop_put_object;
118atomic_t fscache_n_cop_sync_cache;
119atomic_t fscache_n_cop_attr_changed;
120atomic_t fscache_n_cop_read_or_alloc_page;
121atomic_t fscache_n_cop_read_or_alloc_pages;
122atomic_t fscache_n_cop_allocate_page;
123atomic_t fscache_n_cop_allocate_pages;
124atomic_t fscache_n_cop_write_page;
125atomic_t fscache_n_cop_uncache_page;
126atomic_t fscache_n_cop_dissociate_pages;
127
96/* 128/*
97 * display the general statistics 129 * display the general statistics
98 */ 130 */
@@ -129,10 +161,11 @@ static int fscache_stats_show(struct seq_file *m, void *v)
129 atomic_read(&fscache_n_acquires_nobufs), 161 atomic_read(&fscache_n_acquires_nobufs),
130 atomic_read(&fscache_n_acquires_oom)); 162 atomic_read(&fscache_n_acquires_oom));
131 163
132 seq_printf(m, "Lookups: n=%u neg=%u pos=%u crt=%u\n", 164 seq_printf(m, "Lookups: n=%u neg=%u pos=%u crt=%u tmo=%u\n",
133 atomic_read(&fscache_n_object_lookups), 165 atomic_read(&fscache_n_object_lookups),
134 atomic_read(&fscache_n_object_lookups_negative), 166 atomic_read(&fscache_n_object_lookups_negative),
135 atomic_read(&fscache_n_object_lookups_positive), 167 atomic_read(&fscache_n_object_lookups_positive),
168 atomic_read(&fscache_n_object_lookups_timed_out),
136 atomic_read(&fscache_n_object_created)); 169 atomic_read(&fscache_n_object_created));
137 170
138 seq_printf(m, "Updates: n=%u nul=%u run=%u\n", 171 seq_printf(m, "Updates: n=%u nul=%u run=%u\n",
@@ -140,10 +173,11 @@ static int fscache_stats_show(struct seq_file *m, void *v)
140 atomic_read(&fscache_n_updates_null), 173 atomic_read(&fscache_n_updates_null),
141 atomic_read(&fscache_n_updates_run)); 174 atomic_read(&fscache_n_updates_run));
142 175
143 seq_printf(m, "Relinqs: n=%u nul=%u wcr=%u\n", 176 seq_printf(m, "Relinqs: n=%u nul=%u wcr=%u rtr=%u\n",
144 atomic_read(&fscache_n_relinquishes), 177 atomic_read(&fscache_n_relinquishes),
145 atomic_read(&fscache_n_relinquishes_null), 178 atomic_read(&fscache_n_relinquishes_null),
146 atomic_read(&fscache_n_relinquishes_waitcrt)); 179 atomic_read(&fscache_n_relinquishes_waitcrt),
180 atomic_read(&fscache_n_relinquishes_retire));
147 181
148 seq_printf(m, "AttrChg: n=%u ok=%u nbf=%u oom=%u run=%u\n", 182 seq_printf(m, "AttrChg: n=%u ok=%u nbf=%u oom=%u run=%u\n",
149 atomic_read(&fscache_n_attr_changed), 183 atomic_read(&fscache_n_attr_changed),
@@ -152,14 +186,16 @@ static int fscache_stats_show(struct seq_file *m, void *v)
152 atomic_read(&fscache_n_attr_changed_nomem), 186 atomic_read(&fscache_n_attr_changed_nomem),
153 atomic_read(&fscache_n_attr_changed_calls)); 187 atomic_read(&fscache_n_attr_changed_calls));
154 188
155 seq_printf(m, "Allocs : n=%u ok=%u wt=%u nbf=%u\n", 189 seq_printf(m, "Allocs : n=%u ok=%u wt=%u nbf=%u int=%u\n",
156 atomic_read(&fscache_n_allocs), 190 atomic_read(&fscache_n_allocs),
157 atomic_read(&fscache_n_allocs_ok), 191 atomic_read(&fscache_n_allocs_ok),
158 atomic_read(&fscache_n_allocs_wait), 192 atomic_read(&fscache_n_allocs_wait),
159 atomic_read(&fscache_n_allocs_nobufs)); 193 atomic_read(&fscache_n_allocs_nobufs),
160 seq_printf(m, "Allocs : ops=%u owt=%u\n", 194 atomic_read(&fscache_n_allocs_intr));
195 seq_printf(m, "Allocs : ops=%u owt=%u abt=%u\n",
161 atomic_read(&fscache_n_alloc_ops), 196 atomic_read(&fscache_n_alloc_ops),
162 atomic_read(&fscache_n_alloc_op_waits)); 197 atomic_read(&fscache_n_alloc_op_waits),
198 atomic_read(&fscache_n_allocs_object_dead));
163 199
164 seq_printf(m, "Retrvls: n=%u ok=%u wt=%u nod=%u nbf=%u" 200 seq_printf(m, "Retrvls: n=%u ok=%u wt=%u nod=%u nbf=%u"
165 " int=%u oom=%u\n", 201 " int=%u oom=%u\n",
@@ -170,9 +206,10 @@ static int fscache_stats_show(struct seq_file *m, void *v)
170 atomic_read(&fscache_n_retrievals_nobufs), 206 atomic_read(&fscache_n_retrievals_nobufs),
171 atomic_read(&fscache_n_retrievals_intr), 207 atomic_read(&fscache_n_retrievals_intr),
172 atomic_read(&fscache_n_retrievals_nomem)); 208 atomic_read(&fscache_n_retrievals_nomem));
173 seq_printf(m, "Retrvls: ops=%u owt=%u\n", 209 seq_printf(m, "Retrvls: ops=%u owt=%u abt=%u\n",
174 atomic_read(&fscache_n_retrieval_ops), 210 atomic_read(&fscache_n_retrieval_ops),
175 atomic_read(&fscache_n_retrieval_op_waits)); 211 atomic_read(&fscache_n_retrieval_op_waits),
212 atomic_read(&fscache_n_retrievals_object_dead));
176 213
177 seq_printf(m, "Stores : n=%u ok=%u agn=%u nbf=%u oom=%u\n", 214 seq_printf(m, "Stores : n=%u ok=%u agn=%u nbf=%u oom=%u\n",
178 atomic_read(&fscache_n_stores), 215 atomic_read(&fscache_n_stores),
@@ -180,18 +217,49 @@ static int fscache_stats_show(struct seq_file *m, void *v)
180 atomic_read(&fscache_n_stores_again), 217 atomic_read(&fscache_n_stores_again),
181 atomic_read(&fscache_n_stores_nobufs), 218 atomic_read(&fscache_n_stores_nobufs),
182 atomic_read(&fscache_n_stores_oom)); 219 atomic_read(&fscache_n_stores_oom));
183 seq_printf(m, "Stores : ops=%u run=%u\n", 220 seq_printf(m, "Stores : ops=%u run=%u pgs=%u rxd=%u olm=%u\n",
184 atomic_read(&fscache_n_store_ops), 221 atomic_read(&fscache_n_store_ops),
185 atomic_read(&fscache_n_store_calls)); 222 atomic_read(&fscache_n_store_calls),
223 atomic_read(&fscache_n_store_pages),
224 atomic_read(&fscache_n_store_radix_deletes),
225 atomic_read(&fscache_n_store_pages_over_limit));
186 226
187 seq_printf(m, "Ops : pend=%u run=%u enq=%u\n", 227 seq_printf(m, "VmScan : nos=%u gon=%u bsy=%u can=%u\n",
228 atomic_read(&fscache_n_store_vmscan_not_storing),
229 atomic_read(&fscache_n_store_vmscan_gone),
230 atomic_read(&fscache_n_store_vmscan_busy),
231 atomic_read(&fscache_n_store_vmscan_cancelled));
232
233 seq_printf(m, "Ops : pend=%u run=%u enq=%u can=%u rej=%u\n",
188 atomic_read(&fscache_n_op_pend), 234 atomic_read(&fscache_n_op_pend),
189 atomic_read(&fscache_n_op_run), 235 atomic_read(&fscache_n_op_run),
190 atomic_read(&fscache_n_op_enqueue)); 236 atomic_read(&fscache_n_op_enqueue),
237 atomic_read(&fscache_n_op_cancelled),
238 atomic_read(&fscache_n_op_rejected));
191 seq_printf(m, "Ops : dfr=%u rel=%u gc=%u\n", 239 seq_printf(m, "Ops : dfr=%u rel=%u gc=%u\n",
192 atomic_read(&fscache_n_op_deferred_release), 240 atomic_read(&fscache_n_op_deferred_release),
193 atomic_read(&fscache_n_op_release), 241 atomic_read(&fscache_n_op_release),
194 atomic_read(&fscache_n_op_gc)); 242 atomic_read(&fscache_n_op_gc));
243
244 seq_printf(m, "CacheOp: alo=%d luo=%d luc=%d gro=%d\n",
245 atomic_read(&fscache_n_cop_alloc_object),
246 atomic_read(&fscache_n_cop_lookup_object),
247 atomic_read(&fscache_n_cop_lookup_complete),
248 atomic_read(&fscache_n_cop_grab_object));
249 seq_printf(m, "CacheOp: upo=%d dro=%d pto=%d atc=%d syn=%d\n",
250 atomic_read(&fscache_n_cop_update_object),
251 atomic_read(&fscache_n_cop_drop_object),
252 atomic_read(&fscache_n_cop_put_object),
253 atomic_read(&fscache_n_cop_attr_changed),
254 atomic_read(&fscache_n_cop_sync_cache));
255 seq_printf(m, "CacheOp: rap=%d ras=%d alp=%d als=%d wrp=%d ucp=%d dsp=%d\n",
256 atomic_read(&fscache_n_cop_read_or_alloc_page),
257 atomic_read(&fscache_n_cop_read_or_alloc_pages),
258 atomic_read(&fscache_n_cop_allocate_page),
259 atomic_read(&fscache_n_cop_allocate_pages),
260 atomic_read(&fscache_n_cop_write_page),
261 atomic_read(&fscache_n_cop_uncache_page),
262 atomic_read(&fscache_n_cop_dissociate_pages));
195 return 0; 263 return 0;
196} 264}
197 265
diff --git a/fs/fuse/dir.c b/fs/fuse/dir.c
index 992f6c9410bb..4787ae6c5c1c 100644
--- a/fs/fuse/dir.c
+++ b/fs/fuse/dir.c
@@ -385,6 +385,9 @@ static int fuse_create_open(struct inode *dir, struct dentry *entry, int mode,
385 if (fc->no_create) 385 if (fc->no_create)
386 return -ENOSYS; 386 return -ENOSYS;
387 387
388 if (flags & O_DIRECT)
389 return -EINVAL;
390
388 forget_req = fuse_get_req(fc); 391 forget_req = fuse_get_req(fc);
389 if (IS_ERR(forget_req)) 392 if (IS_ERR(forget_req))
390 return PTR_ERR(forget_req); 393 return PTR_ERR(forget_req);
@@ -712,8 +715,10 @@ static int fuse_rename(struct inode *olddir, struct dentry *oldent,
712 fuse_invalidate_attr(newdir); 715 fuse_invalidate_attr(newdir);
713 716
714 /* newent will end up negative */ 717 /* newent will end up negative */
715 if (newent->d_inode) 718 if (newent->d_inode) {
719 fuse_invalidate_attr(newent->d_inode);
716 fuse_invalidate_entry_cache(newent); 720 fuse_invalidate_entry_cache(newent);
721 }
717 } else if (err == -EINTR) { 722 } else if (err == -EINTR) {
718 /* If request was interrupted, DEITY only knows if the 723 /* If request was interrupted, DEITY only knows if the
719 rename actually took place. If the invalidation 724 rename actually took place. If the invalidation
diff --git a/fs/fuse/file.c b/fs/fuse/file.c
index a3492f7d207c..c18913a777ae 100644
--- a/fs/fuse/file.c
+++ b/fs/fuse/file.c
@@ -1063,7 +1063,8 @@ ssize_t fuse_direct_io(struct file *file, const char __user *buf,
1063 break; 1063 break;
1064 } 1064 }
1065 } 1065 }
1066 fuse_put_request(fc, req); 1066 if (!IS_ERR(req))
1067 fuse_put_request(fc, req);
1067 if (res > 0) 1068 if (res > 0)
1068 *ppos = pos; 1069 *ppos = pos;
1069 1070
@@ -1599,7 +1600,7 @@ static int fuse_ioctl_copy_user(struct page **pages, struct iovec *iov,
1599 kaddr += copy; 1600 kaddr += copy;
1600 } 1601 }
1601 1602
1602 kunmap(map); 1603 kunmap(page);
1603 } 1604 }
1604 1605
1605 return 0; 1606 return 0;
diff --git a/fs/gfs2/Kconfig b/fs/gfs2/Kconfig
index 5971359d2090..4dcddf83326f 100644
--- a/fs/gfs2/Kconfig
+++ b/fs/gfs2/Kconfig
@@ -8,6 +8,8 @@ config GFS2_FS
8 select FS_POSIX_ACL 8 select FS_POSIX_ACL
9 select CRC32 9 select CRC32
10 select SLOW_WORK 10 select SLOW_WORK
11 select QUOTA
12 select QUOTACTL
11 help 13 help
12 A cluster filesystem. 14 A cluster filesystem.
13 15
diff --git a/fs/gfs2/acl.c b/fs/gfs2/acl.c
index 3fc4e3ac7d84..3eb1ea846173 100644
--- a/fs/gfs2/acl.c
+++ b/fs/gfs2/acl.c
@@ -12,6 +12,7 @@
12#include <linux/spinlock.h> 12#include <linux/spinlock.h>
13#include <linux/completion.h> 13#include <linux/completion.h>
14#include <linux/buffer_head.h> 14#include <linux/buffer_head.h>
15#include <linux/xattr.h>
15#include <linux/posix_acl.h> 16#include <linux/posix_acl.h>
16#include <linux/posix_acl_xattr.h> 17#include <linux/posix_acl_xattr.h>
17#include <linux/gfs2_ondisk.h> 18#include <linux/gfs2_ondisk.h>
@@ -26,108 +27,44 @@
26#include "trans.h" 27#include "trans.h"
27#include "util.h" 28#include "util.h"
28 29
29#define ACL_ACCESS 1 30static const char *gfs2_acl_name(int type)
30#define ACL_DEFAULT 0
31
32int gfs2_acl_validate_set(struct gfs2_inode *ip, int access,
33 struct gfs2_ea_request *er, int *remove, mode_t *mode)
34{ 31{
35 struct posix_acl *acl; 32 switch (type) {
36 int error; 33 case ACL_TYPE_ACCESS:
37 34 return GFS2_POSIX_ACL_ACCESS;
38 error = gfs2_acl_validate_remove(ip, access); 35 case ACL_TYPE_DEFAULT:
39 if (error) 36 return GFS2_POSIX_ACL_DEFAULT;
40 return error;
41
42 if (!er->er_data)
43 return -EINVAL;
44
45 acl = posix_acl_from_xattr(er->er_data, er->er_data_len);
46 if (IS_ERR(acl))
47 return PTR_ERR(acl);
48 if (!acl) {
49 *remove = 1;
50 return 0;
51 }
52
53 error = posix_acl_valid(acl);
54 if (error)
55 goto out;
56
57 if (access) {
58 error = posix_acl_equiv_mode(acl, mode);
59 if (!error)
60 *remove = 1;
61 else if (error > 0)
62 error = 0;
63 } 37 }
64 38 return NULL;
65out:
66 posix_acl_release(acl);
67 return error;
68}
69
70int gfs2_acl_validate_remove(struct gfs2_inode *ip, int access)
71{
72 if (!GFS2_SB(&ip->i_inode)->sd_args.ar_posix_acl)
73 return -EOPNOTSUPP;
74 if (!is_owner_or_cap(&ip->i_inode))
75 return -EPERM;
76 if (S_ISLNK(ip->i_inode.i_mode))
77 return -EOPNOTSUPP;
78 if (!access && !S_ISDIR(ip->i_inode.i_mode))
79 return -EACCES;
80
81 return 0;
82} 39}
83 40
84static int acl_get(struct gfs2_inode *ip, const char *name, 41static struct posix_acl *gfs2_acl_get(struct gfs2_inode *ip, int type)
85 struct posix_acl **acl, struct gfs2_ea_location *el,
86 char **datap, unsigned int *lenp)
87{ 42{
43 struct posix_acl *acl;
44 const char *name;
88 char *data; 45 char *data;
89 unsigned int len; 46 int len;
90 int error;
91
92 el->el_bh = NULL;
93 47
94 if (!ip->i_eattr) 48 if (!ip->i_eattr)
95 return 0; 49 return NULL;
96
97 error = gfs2_ea_find(ip, GFS2_EATYPE_SYS, name, el);
98 if (error)
99 return error;
100 if (!el->el_ea)
101 return 0;
102 if (!GFS2_EA_DATA_LEN(el->el_ea))
103 goto out;
104 50
105 len = GFS2_EA_DATA_LEN(el->el_ea); 51 acl = get_cached_acl(&ip->i_inode, type);
106 data = kmalloc(len, GFP_NOFS); 52 if (acl != ACL_NOT_CACHED)
107 error = -ENOMEM; 53 return acl;
108 if (!data)
109 goto out;
110 54
111 error = gfs2_ea_get_copy(ip, el, data, len); 55 name = gfs2_acl_name(type);
112 if (error < 0) 56 if (name == NULL)
113 goto out_kfree; 57 return ERR_PTR(-EINVAL);
114 error = 0;
115 58
116 if (acl) { 59 len = gfs2_xattr_acl_get(ip, name, &data);
117 *acl = posix_acl_from_xattr(data, len); 60 if (len < 0)
118 if (IS_ERR(*acl)) 61 return ERR_PTR(len);
119 error = PTR_ERR(*acl); 62 if (len == 0)
120 } 63 return NULL;
121 64
122out_kfree: 65 acl = posix_acl_from_xattr(data, len);
123 if (error || !datap) { 66 kfree(data);
124 kfree(data); 67 return acl;
125 } else {
126 *datap = data;
127 *lenp = len;
128 }
129out:
130 return error;
131} 68}
132 69
133/** 70/**
@@ -140,14 +77,12 @@ out:
140 77
141int gfs2_check_acl(struct inode *inode, int mask) 78int gfs2_check_acl(struct inode *inode, int mask)
142{ 79{
143 struct gfs2_ea_location el; 80 struct posix_acl *acl;
144 struct posix_acl *acl = NULL;
145 int error; 81 int error;
146 82
147 error = acl_get(GFS2_I(inode), GFS2_POSIX_ACL_ACCESS, &acl, &el, NULL, NULL); 83 acl = gfs2_acl_get(GFS2_I(inode), ACL_TYPE_ACCESS);
148 brelse(el.el_bh); 84 if (IS_ERR(acl))
149 if (error) 85 return PTR_ERR(acl);
150 return error;
151 86
152 if (acl) { 87 if (acl) {
153 error = posix_acl_permission(inode, acl, mask); 88 error = posix_acl_permission(inode, acl, mask);
@@ -158,57 +93,75 @@ int gfs2_check_acl(struct inode *inode, int mask)
158 return -EAGAIN; 93 return -EAGAIN;
159} 94}
160 95
161static int munge_mode(struct gfs2_inode *ip, mode_t mode) 96static int gfs2_set_mode(struct inode *inode, mode_t mode)
162{ 97{
163 struct gfs2_sbd *sdp = GFS2_SB(&ip->i_inode); 98 int error = 0;
164 struct buffer_head *dibh;
165 int error;
166 99
167 error = gfs2_trans_begin(sdp, RES_DINODE, 0); 100 if (mode != inode->i_mode) {
168 if (error) 101 struct iattr iattr;
169 return error;
170 102
171 error = gfs2_meta_inode_buffer(ip, &dibh); 103 iattr.ia_valid = ATTR_MODE;
172 if (!error) { 104 iattr.ia_mode = mode;
173 gfs2_assert_withdraw(sdp, 105
174 (ip->i_inode.i_mode & S_IFMT) == (mode & S_IFMT)); 106 error = gfs2_setattr_simple(GFS2_I(inode), &iattr);
175 ip->i_inode.i_mode = mode;
176 gfs2_trans_add_bh(ip->i_gl, dibh, 1);
177 gfs2_dinode_out(ip, dibh->b_data);
178 brelse(dibh);
179 } 107 }
180 108
181 gfs2_trans_end(sdp); 109 return error;
110}
111
112static int gfs2_acl_set(struct inode *inode, int type, struct posix_acl *acl)
113{
114 int error;
115 int len;
116 char *data;
117 const char *name = gfs2_acl_name(type);
182 118
183 return 0; 119 BUG_ON(name == NULL);
120 len = posix_acl_to_xattr(acl, NULL, 0);
121 if (len == 0)
122 return 0;
123 data = kmalloc(len, GFP_NOFS);
124 if (data == NULL)
125 return -ENOMEM;
126 error = posix_acl_to_xattr(acl, data, len);
127 if (error < 0)
128 goto out;
129 error = gfs2_xattr_set(inode, GFS2_EATYPE_SYS, name, data, len, 0);
130 if (!error)
131 set_cached_acl(inode, type, acl);
132out:
133 kfree(data);
134 return error;
184} 135}
185 136
186int gfs2_acl_create(struct gfs2_inode *dip, struct gfs2_inode *ip) 137int gfs2_acl_create(struct gfs2_inode *dip, struct inode *inode)
187{ 138{
188 struct gfs2_ea_location el;
189 struct gfs2_sbd *sdp = GFS2_SB(&dip->i_inode); 139 struct gfs2_sbd *sdp = GFS2_SB(&dip->i_inode);
190 struct posix_acl *acl = NULL, *clone; 140 struct posix_acl *acl, *clone;
191 mode_t mode = ip->i_inode.i_mode; 141 mode_t mode = inode->i_mode;
192 char *data = NULL; 142 int error = 0;
193 unsigned int len;
194 int error;
195 143
196 if (!sdp->sd_args.ar_posix_acl) 144 if (!sdp->sd_args.ar_posix_acl)
197 return 0; 145 return 0;
198 if (S_ISLNK(ip->i_inode.i_mode)) 146 if (S_ISLNK(inode->i_mode))
199 return 0; 147 return 0;
200 148
201 error = acl_get(dip, GFS2_POSIX_ACL_DEFAULT, &acl, &el, &data, &len); 149 acl = gfs2_acl_get(dip, ACL_TYPE_DEFAULT);
202 brelse(el.el_bh); 150 if (IS_ERR(acl))
203 if (error) 151 return PTR_ERR(acl);
204 return error;
205 if (!acl) { 152 if (!acl) {
206 mode &= ~current_umask(); 153 mode &= ~current_umask();
207 if (mode != ip->i_inode.i_mode) 154 if (mode != inode->i_mode)
208 error = munge_mode(ip, mode); 155 error = gfs2_set_mode(inode, mode);
209 return error; 156 return error;
210 } 157 }
211 158
159 if (S_ISDIR(inode->i_mode)) {
160 error = gfs2_acl_set(inode, ACL_TYPE_DEFAULT, acl);
161 if (error)
162 goto out;
163 }
164
212 clone = posix_acl_clone(acl, GFP_NOFS); 165 clone = posix_acl_clone(acl, GFP_NOFS);
213 error = -ENOMEM; 166 error = -ENOMEM;
214 if (!clone) 167 if (!clone)
@@ -216,43 +169,32 @@ int gfs2_acl_create(struct gfs2_inode *dip, struct gfs2_inode *ip)
216 posix_acl_release(acl); 169 posix_acl_release(acl);
217 acl = clone; 170 acl = clone;
218 171
219 if (S_ISDIR(ip->i_inode.i_mode)) {
220 error = gfs2_xattr_set(&ip->i_inode, GFS2_EATYPE_SYS,
221 GFS2_POSIX_ACL_DEFAULT, data, len, 0);
222 if (error)
223 goto out;
224 }
225
226 error = posix_acl_create_masq(acl, &mode); 172 error = posix_acl_create_masq(acl, &mode);
227 if (error < 0) 173 if (error < 0)
228 goto out; 174 goto out;
229 if (error == 0) 175 if (error == 0)
230 goto munge; 176 goto munge;
231 177
232 posix_acl_to_xattr(acl, data, len); 178 error = gfs2_acl_set(inode, ACL_TYPE_ACCESS, acl);
233 error = gfs2_xattr_set(&ip->i_inode, GFS2_EATYPE_SYS,
234 GFS2_POSIX_ACL_ACCESS, data, len, 0);
235 if (error) 179 if (error)
236 goto out; 180 goto out;
237munge: 181munge:
238 error = munge_mode(ip, mode); 182 error = gfs2_set_mode(inode, mode);
239out: 183out:
240 posix_acl_release(acl); 184 posix_acl_release(acl);
241 kfree(data);
242 return error; 185 return error;
243} 186}
244 187
245int gfs2_acl_chmod(struct gfs2_inode *ip, struct iattr *attr) 188int gfs2_acl_chmod(struct gfs2_inode *ip, struct iattr *attr)
246{ 189{
247 struct posix_acl *acl = NULL, *clone; 190 struct posix_acl *acl, *clone;
248 struct gfs2_ea_location el;
249 char *data; 191 char *data;
250 unsigned int len; 192 unsigned int len;
251 int error; 193 int error;
252 194
253 error = acl_get(ip, GFS2_POSIX_ACL_ACCESS, &acl, &el, &data, &len); 195 acl = gfs2_acl_get(ip, ACL_TYPE_ACCESS);
254 if (error) 196 if (IS_ERR(acl))
255 goto out_brelse; 197 return PTR_ERR(acl);
256 if (!acl) 198 if (!acl)
257 return gfs2_setattr_simple(ip, attr); 199 return gfs2_setattr_simple(ip, attr);
258 200
@@ -265,15 +207,134 @@ int gfs2_acl_chmod(struct gfs2_inode *ip, struct iattr *attr)
265 207
266 error = posix_acl_chmod_masq(acl, attr->ia_mode); 208 error = posix_acl_chmod_masq(acl, attr->ia_mode);
267 if (!error) { 209 if (!error) {
210 len = posix_acl_to_xattr(acl, NULL, 0);
211 data = kmalloc(len, GFP_NOFS);
212 error = -ENOMEM;
213 if (data == NULL)
214 goto out;
268 posix_acl_to_xattr(acl, data, len); 215 posix_acl_to_xattr(acl, data, len);
269 error = gfs2_ea_acl_chmod(ip, &el, attr, data); 216 error = gfs2_xattr_acl_chmod(ip, attr, data);
217 kfree(data);
218 set_cached_acl(&ip->i_inode, ACL_TYPE_ACCESS, acl);
270 } 219 }
271 220
272out: 221out:
273 posix_acl_release(acl); 222 posix_acl_release(acl);
274 kfree(data);
275out_brelse:
276 brelse(el.el_bh);
277 return error; 223 return error;
278} 224}
279 225
226static int gfs2_acl_type(const char *name)
227{
228 if (strcmp(name, GFS2_POSIX_ACL_ACCESS) == 0)
229 return ACL_TYPE_ACCESS;
230 if (strcmp(name, GFS2_POSIX_ACL_DEFAULT) == 0)
231 return ACL_TYPE_DEFAULT;
232 return -EINVAL;
233}
234
235static int gfs2_xattr_system_get(struct inode *inode, const char *name,
236 void *buffer, size_t size)
237{
238 struct posix_acl *acl;
239 int type;
240 int error;
241
242 type = gfs2_acl_type(name);
243 if (type < 0)
244 return type;
245
246 acl = gfs2_acl_get(GFS2_I(inode), type);
247 if (IS_ERR(acl))
248 return PTR_ERR(acl);
249 if (acl == NULL)
250 return -ENODATA;
251
252 error = posix_acl_to_xattr(acl, buffer, size);
253 posix_acl_release(acl);
254
255 return error;
256}
257
258static int gfs2_xattr_system_set(struct inode *inode, const char *name,
259 const void *value, size_t size, int flags)
260{
261 struct gfs2_sbd *sdp = GFS2_SB(inode);
262 struct posix_acl *acl = NULL;
263 int error = 0, type;
264
265 if (!sdp->sd_args.ar_posix_acl)
266 return -EOPNOTSUPP;
267
268 type = gfs2_acl_type(name);
269 if (type < 0)
270 return type;
271 if (flags & XATTR_CREATE)
272 return -EINVAL;
273 if (type == ACL_TYPE_DEFAULT && !S_ISDIR(inode->i_mode))
274 return value ? -EACCES : 0;
275 if ((current_fsuid() != inode->i_uid) && !capable(CAP_FOWNER))
276 return -EPERM;
277 if (S_ISLNK(inode->i_mode))
278 return -EOPNOTSUPP;
279
280 if (!value)
281 goto set_acl;
282
283 acl = posix_acl_from_xattr(value, size);
284 if (!acl) {
285 /*
286 * acl_set_file(3) may request that we set default ACLs with
287 * zero length -- defend (gracefully) against that here.
288 */
289 goto out;
290 }
291 if (IS_ERR(acl)) {
292 error = PTR_ERR(acl);
293 goto out;
294 }
295
296 error = posix_acl_valid(acl);
297 if (error)
298 goto out_release;
299
300 error = -EINVAL;
301 if (acl->a_count > GFS2_ACL_MAX_ENTRIES)
302 goto out_release;
303
304 if (type == ACL_TYPE_ACCESS) {
305 mode_t mode = inode->i_mode;
306 error = posix_acl_equiv_mode(acl, &mode);
307
308 if (error <= 0) {
309 posix_acl_release(acl);
310 acl = NULL;
311
312 if (error < 0)
313 return error;
314 }
315
316 error = gfs2_set_mode(inode, mode);
317 if (error)
318 goto out_release;
319 }
320
321set_acl:
322 error = gfs2_xattr_set(inode, GFS2_EATYPE_SYS, name, value, size, 0);
323 if (!error) {
324 if (acl)
325 set_cached_acl(inode, type, acl);
326 else
327 forget_cached_acl(inode, type);
328 }
329out_release:
330 posix_acl_release(acl);
331out:
332 return error;
333}
334
335struct xattr_handler gfs2_xattr_system_handler = {
336 .prefix = XATTR_SYSTEM_PREFIX,
337 .get = gfs2_xattr_system_get,
338 .set = gfs2_xattr_system_set,
339};
340
diff --git a/fs/gfs2/acl.h b/fs/gfs2/acl.h
index 6751930bfb64..9306a2e6620c 100644
--- a/fs/gfs2/acl.h
+++ b/fs/gfs2/acl.h
@@ -13,26 +13,12 @@
13#include "incore.h" 13#include "incore.h"
14 14
15#define GFS2_POSIX_ACL_ACCESS "posix_acl_access" 15#define GFS2_POSIX_ACL_ACCESS "posix_acl_access"
16#define GFS2_POSIX_ACL_ACCESS_LEN 16
17#define GFS2_POSIX_ACL_DEFAULT "posix_acl_default" 16#define GFS2_POSIX_ACL_DEFAULT "posix_acl_default"
18#define GFS2_POSIX_ACL_DEFAULT_LEN 17 17#define GFS2_ACL_MAX_ENTRIES 25
19 18
20#define GFS2_ACL_IS_ACCESS(name, len) \ 19extern int gfs2_check_acl(struct inode *inode, int mask);
21 ((len) == GFS2_POSIX_ACL_ACCESS_LEN && \ 20extern int gfs2_acl_create(struct gfs2_inode *dip, struct inode *inode);
22 !memcmp(GFS2_POSIX_ACL_ACCESS, (name), (len))) 21extern int gfs2_acl_chmod(struct gfs2_inode *ip, struct iattr *attr);
23 22extern struct xattr_handler gfs2_xattr_system_handler;
24#define GFS2_ACL_IS_DEFAULT(name, len) \
25 ((len) == GFS2_POSIX_ACL_DEFAULT_LEN && \
26 !memcmp(GFS2_POSIX_ACL_DEFAULT, (name), (len)))
27
28struct gfs2_ea_request;
29
30int gfs2_acl_validate_set(struct gfs2_inode *ip, int access,
31 struct gfs2_ea_request *er,
32 int *remove, mode_t *mode);
33int gfs2_acl_validate_remove(struct gfs2_inode *ip, int access);
34int gfs2_check_acl(struct inode *inode, int mask);
35int gfs2_acl_create(struct gfs2_inode *dip, struct gfs2_inode *ip);
36int gfs2_acl_chmod(struct gfs2_inode *ip, struct iattr *attr);
37 23
38#endif /* __ACL_DOT_H__ */ 24#endif /* __ACL_DOT_H__ */
diff --git a/fs/gfs2/aops.c b/fs/gfs2/aops.c
index 694b5d48f036..7b8da9415267 100644
--- a/fs/gfs2/aops.c
+++ b/fs/gfs2/aops.c
@@ -269,7 +269,6 @@ static int gfs2_write_jdata_pagevec(struct address_space *mapping,
269 pgoff_t end_index = i_size >> PAGE_CACHE_SHIFT; 269 pgoff_t end_index = i_size >> PAGE_CACHE_SHIFT;
270 unsigned offset = i_size & (PAGE_CACHE_SIZE-1); 270 unsigned offset = i_size & (PAGE_CACHE_SIZE-1);
271 unsigned nrblocks = nr_pages * (PAGE_CACHE_SIZE/inode->i_sb->s_blocksize); 271 unsigned nrblocks = nr_pages * (PAGE_CACHE_SIZE/inode->i_sb->s_blocksize);
272 struct backing_dev_info *bdi = mapping->backing_dev_info;
273 int i; 272 int i;
274 int ret; 273 int ret;
275 274
@@ -313,11 +312,6 @@ static int gfs2_write_jdata_pagevec(struct address_space *mapping,
313 312
314 if (ret || (--(wbc->nr_to_write) <= 0)) 313 if (ret || (--(wbc->nr_to_write) <= 0))
315 ret = 1; 314 ret = 1;
316 if (wbc->nonblocking && bdi_write_congested(bdi)) {
317 wbc->encountered_congestion = 1;
318 ret = 1;
319 }
320
321 } 315 }
322 gfs2_trans_end(sdp); 316 gfs2_trans_end(sdp);
323 return ret; 317 return ret;
@@ -338,7 +332,6 @@ static int gfs2_write_jdata_pagevec(struct address_space *mapping,
338static int gfs2_write_cache_jdata(struct address_space *mapping, 332static int gfs2_write_cache_jdata(struct address_space *mapping,
339 struct writeback_control *wbc) 333 struct writeback_control *wbc)
340{ 334{
341 struct backing_dev_info *bdi = mapping->backing_dev_info;
342 int ret = 0; 335 int ret = 0;
343 int done = 0; 336 int done = 0;
344 struct pagevec pvec; 337 struct pagevec pvec;
@@ -348,11 +341,6 @@ static int gfs2_write_cache_jdata(struct address_space *mapping,
348 int scanned = 0; 341 int scanned = 0;
349 int range_whole = 0; 342 int range_whole = 0;
350 343
351 if (wbc->nonblocking && bdi_write_congested(bdi)) {
352 wbc->encountered_congestion = 1;
353 return 0;
354 }
355
356 pagevec_init(&pvec, 0); 344 pagevec_init(&pvec, 0);
357 if (wbc->range_cyclic) { 345 if (wbc->range_cyclic) {
358 index = mapping->writeback_index; /* Start from prev offset */ 346 index = mapping->writeback_index; /* Start from prev offset */
@@ -819,8 +807,10 @@ static int gfs2_stuffed_write_end(struct inode *inode, struct buffer_head *dibh,
819 mark_inode_dirty(inode); 807 mark_inode_dirty(inode);
820 } 808 }
821 809
822 if (inode == sdp->sd_rindex) 810 if (inode == sdp->sd_rindex) {
823 adjust_fs_space(inode); 811 adjust_fs_space(inode);
812 ip->i_gh.gh_flags |= GL_NOCACHE;
813 }
824 814
825 brelse(dibh); 815 brelse(dibh);
826 gfs2_trans_end(sdp); 816 gfs2_trans_end(sdp);
@@ -889,8 +879,10 @@ static int gfs2_write_end(struct file *file, struct address_space *mapping,
889 mark_inode_dirty(inode); 879 mark_inode_dirty(inode);
890 } 880 }
891 881
892 if (inode == sdp->sd_rindex) 882 if (inode == sdp->sd_rindex) {
893 adjust_fs_space(inode); 883 adjust_fs_space(inode);
884 ip->i_gh.gh_flags |= GL_NOCACHE;
885 }
894 886
895 brelse(dibh); 887 brelse(dibh);
896 gfs2_trans_end(sdp); 888 gfs2_trans_end(sdp);
diff --git a/fs/gfs2/dir.c b/fs/gfs2/dir.c
index 297d7e5cebad..25fddc100f18 100644
--- a/fs/gfs2/dir.c
+++ b/fs/gfs2/dir.c
@@ -525,38 +525,6 @@ consist_inode:
525 return ERR_PTR(-EIO); 525 return ERR_PTR(-EIO);
526} 526}
527 527
528
529/**
530 * dirent_first - Return the first dirent
531 * @dip: the directory
532 * @bh: The buffer
533 * @dent: Pointer to list of dirents
534 *
535 * return first dirent whether bh points to leaf or stuffed dinode
536 *
537 * Returns: IS_LEAF, IS_DINODE, or -errno
538 */
539
540static int dirent_first(struct gfs2_inode *dip, struct buffer_head *bh,
541 struct gfs2_dirent **dent)
542{
543 struct gfs2_meta_header *h = (struct gfs2_meta_header *)bh->b_data;
544
545 if (be32_to_cpu(h->mh_type) == GFS2_METATYPE_LF) {
546 if (gfs2_meta_check(GFS2_SB(&dip->i_inode), bh))
547 return -EIO;
548 *dent = (struct gfs2_dirent *)(bh->b_data +
549 sizeof(struct gfs2_leaf));
550 return IS_LEAF;
551 } else {
552 if (gfs2_metatype_check(GFS2_SB(&dip->i_inode), bh, GFS2_METATYPE_DI))
553 return -EIO;
554 *dent = (struct gfs2_dirent *)(bh->b_data +
555 sizeof(struct gfs2_dinode));
556 return IS_DINODE;
557 }
558}
559
560static int dirent_check_reclen(struct gfs2_inode *dip, 528static int dirent_check_reclen(struct gfs2_inode *dip,
561 const struct gfs2_dirent *d, const void *end_p) 529 const struct gfs2_dirent *d, const void *end_p)
562{ 530{
@@ -1006,7 +974,7 @@ static int dir_split_leaf(struct inode *inode, const struct qstr *name)
1006 divider = (start + half_len) << (32 - dip->i_depth); 974 divider = (start + half_len) << (32 - dip->i_depth);
1007 975
1008 /* Copy the entries */ 976 /* Copy the entries */
1009 dirent_first(dip, obh, &dent); 977 dent = (struct gfs2_dirent *)(obh->b_data + sizeof(struct gfs2_leaf));
1010 978
1011 do { 979 do {
1012 next = dent; 980 next = dent;
diff --git a/fs/gfs2/glock.c b/fs/gfs2/glock.c
index 8b674b1f3a55..f455a03a09e2 100644
--- a/fs/gfs2/glock.c
+++ b/fs/gfs2/glock.c
@@ -241,15 +241,14 @@ int gfs2_glock_put(struct gfs2_glock *gl)
241 int rv = 0; 241 int rv = 0;
242 242
243 write_lock(gl_lock_addr(gl->gl_hash)); 243 write_lock(gl_lock_addr(gl->gl_hash));
244 if (atomic_dec_and_test(&gl->gl_ref)) { 244 if (atomic_dec_and_lock(&gl->gl_ref, &lru_lock)) {
245 hlist_del(&gl->gl_list); 245 hlist_del(&gl->gl_list);
246 write_unlock(gl_lock_addr(gl->gl_hash));
247 spin_lock(&lru_lock);
248 if (!list_empty(&gl->gl_lru)) { 246 if (!list_empty(&gl->gl_lru)) {
249 list_del_init(&gl->gl_lru); 247 list_del_init(&gl->gl_lru);
250 atomic_dec(&lru_count); 248 atomic_dec(&lru_count);
251 } 249 }
252 spin_unlock(&lru_lock); 250 spin_unlock(&lru_lock);
251 write_unlock(gl_lock_addr(gl->gl_hash));
253 GLOCK_BUG_ON(gl, !list_empty(&gl->gl_holders)); 252 GLOCK_BUG_ON(gl, !list_empty(&gl->gl_holders));
254 glock_free(gl); 253 glock_free(gl);
255 rv = 1; 254 rv = 1;
@@ -513,7 +512,6 @@ retry:
513 GLOCK_BUG_ON(gl, 1); 512 GLOCK_BUG_ON(gl, 1);
514 } 513 }
515 spin_unlock(&gl->gl_spin); 514 spin_unlock(&gl->gl_spin);
516 gfs2_glock_put(gl);
517 return; 515 return;
518 } 516 }
519 517
@@ -524,8 +522,6 @@ retry:
524 if (glops->go_xmote_bh) { 522 if (glops->go_xmote_bh) {
525 spin_unlock(&gl->gl_spin); 523 spin_unlock(&gl->gl_spin);
526 rv = glops->go_xmote_bh(gl, gh); 524 rv = glops->go_xmote_bh(gl, gh);
527 if (rv == -EAGAIN)
528 return;
529 spin_lock(&gl->gl_spin); 525 spin_lock(&gl->gl_spin);
530 if (rv) { 526 if (rv) {
531 do_error(gl, rv); 527 do_error(gl, rv);
@@ -540,7 +536,6 @@ out:
540 clear_bit(GLF_LOCK, &gl->gl_flags); 536 clear_bit(GLF_LOCK, &gl->gl_flags);
541out_locked: 537out_locked:
542 spin_unlock(&gl->gl_spin); 538 spin_unlock(&gl->gl_spin);
543 gfs2_glock_put(gl);
544} 539}
545 540
546static unsigned int gfs2_lm_lock(struct gfs2_sbd *sdp, void *lock, 541static unsigned int gfs2_lm_lock(struct gfs2_sbd *sdp, void *lock,
@@ -600,7 +595,6 @@ __acquires(&gl->gl_spin)
600 595
601 if (!(ret & LM_OUT_ASYNC)) { 596 if (!(ret & LM_OUT_ASYNC)) {
602 finish_xmote(gl, ret); 597 finish_xmote(gl, ret);
603 gfs2_glock_hold(gl);
604 if (queue_delayed_work(glock_workqueue, &gl->gl_work, 0) == 0) 598 if (queue_delayed_work(glock_workqueue, &gl->gl_work, 0) == 0)
605 gfs2_glock_put(gl); 599 gfs2_glock_put(gl);
606 } else { 600 } else {
@@ -672,12 +666,17 @@ out:
672 return; 666 return;
673 667
674out_sched: 668out_sched:
669 clear_bit(GLF_LOCK, &gl->gl_flags);
670 smp_mb__after_clear_bit();
675 gfs2_glock_hold(gl); 671 gfs2_glock_hold(gl);
676 if (queue_delayed_work(glock_workqueue, &gl->gl_work, 0) == 0) 672 if (queue_delayed_work(glock_workqueue, &gl->gl_work, 0) == 0)
677 gfs2_glock_put_nolock(gl); 673 gfs2_glock_put_nolock(gl);
674 return;
675
678out_unlock: 676out_unlock:
679 clear_bit(GLF_LOCK, &gl->gl_flags); 677 clear_bit(GLF_LOCK, &gl->gl_flags);
680 goto out; 678 smp_mb__after_clear_bit();
679 return;
681} 680}
682 681
683static void delete_work_func(struct work_struct *work) 682static void delete_work_func(struct work_struct *work)
@@ -707,9 +706,12 @@ static void glock_work_func(struct work_struct *work)
707{ 706{
708 unsigned long delay = 0; 707 unsigned long delay = 0;
709 struct gfs2_glock *gl = container_of(work, struct gfs2_glock, gl_work.work); 708 struct gfs2_glock *gl = container_of(work, struct gfs2_glock, gl_work.work);
709 int drop_ref = 0;
710 710
711 if (test_and_clear_bit(GLF_REPLY_PENDING, &gl->gl_flags)) 711 if (test_and_clear_bit(GLF_REPLY_PENDING, &gl->gl_flags)) {
712 finish_xmote(gl, gl->gl_reply); 712 finish_xmote(gl, gl->gl_reply);
713 drop_ref = 1;
714 }
713 down_read(&gfs2_umount_flush_sem); 715 down_read(&gfs2_umount_flush_sem);
714 spin_lock(&gl->gl_spin); 716 spin_lock(&gl->gl_spin);
715 if (test_and_clear_bit(GLF_PENDING_DEMOTE, &gl->gl_flags) && 717 if (test_and_clear_bit(GLF_PENDING_DEMOTE, &gl->gl_flags) &&
@@ -727,6 +729,8 @@ static void glock_work_func(struct work_struct *work)
727 if (!delay || 729 if (!delay ||
728 queue_delayed_work(glock_workqueue, &gl->gl_work, delay) == 0) 730 queue_delayed_work(glock_workqueue, &gl->gl_work, delay) == 0)
729 gfs2_glock_put(gl); 731 gfs2_glock_put(gl);
732 if (drop_ref)
733 gfs2_glock_put(gl);
730} 734}
731 735
732/** 736/**
@@ -1361,10 +1365,6 @@ static int gfs2_shrink_glock_memory(int nr, gfp_t gfp_mask)
1361 list_del_init(&gl->gl_lru); 1365 list_del_init(&gl->gl_lru);
1362 atomic_dec(&lru_count); 1366 atomic_dec(&lru_count);
1363 1367
1364 /* Check if glock is about to be freed */
1365 if (atomic_read(&gl->gl_ref) == 0)
1366 continue;
1367
1368 /* Test for being demotable */ 1368 /* Test for being demotable */
1369 if (!test_and_set_bit(GLF_LOCK, &gl->gl_flags)) { 1369 if (!test_and_set_bit(GLF_LOCK, &gl->gl_flags)) {
1370 gfs2_glock_hold(gl); 1370 gfs2_glock_hold(gl);
@@ -1375,10 +1375,11 @@ static int gfs2_shrink_glock_memory(int nr, gfp_t gfp_mask)
1375 handle_callback(gl, LM_ST_UNLOCKED, 0); 1375 handle_callback(gl, LM_ST_UNLOCKED, 0);
1376 nr--; 1376 nr--;
1377 } 1377 }
1378 clear_bit(GLF_LOCK, &gl->gl_flags);
1379 smp_mb__after_clear_bit();
1378 if (queue_delayed_work(glock_workqueue, &gl->gl_work, 0) == 0) 1380 if (queue_delayed_work(glock_workqueue, &gl->gl_work, 0) == 0)
1379 gfs2_glock_put_nolock(gl); 1381 gfs2_glock_put_nolock(gl);
1380 spin_unlock(&gl->gl_spin); 1382 spin_unlock(&gl->gl_spin);
1381 clear_bit(GLF_LOCK, &gl->gl_flags);
1382 spin_lock(&lru_lock); 1383 spin_lock(&lru_lock);
1383 continue; 1384 continue;
1384 } 1385 }
diff --git a/fs/gfs2/glock.h b/fs/gfs2/glock.h
index c609894ec0d0..13f0bd228132 100644
--- a/fs/gfs2/glock.h
+++ b/fs/gfs2/glock.h
@@ -180,15 +180,6 @@ static inline int gfs2_glock_is_held_shrd(struct gfs2_glock *gl)
180 return gl->gl_state == LM_ST_SHARED; 180 return gl->gl_state == LM_ST_SHARED;
181} 181}
182 182
183static inline int gfs2_glock_is_blocking(struct gfs2_glock *gl)
184{
185 int ret;
186 spin_lock(&gl->gl_spin);
187 ret = test_bit(GLF_DEMOTE, &gl->gl_flags);
188 spin_unlock(&gl->gl_spin);
189 return ret;
190}
191
192int gfs2_glock_get(struct gfs2_sbd *sdp, 183int gfs2_glock_get(struct gfs2_sbd *sdp,
193 u64 number, const struct gfs2_glock_operations *glops, 184 u64 number, const struct gfs2_glock_operations *glops,
194 int create, struct gfs2_glock **glp); 185 int create, struct gfs2_glock **glp);
diff --git a/fs/gfs2/glops.c b/fs/gfs2/glops.c
index 6985eef06c39..78554acc0605 100644
--- a/fs/gfs2/glops.c
+++ b/fs/gfs2/glops.c
@@ -13,6 +13,7 @@
13#include <linux/buffer_head.h> 13#include <linux/buffer_head.h>
14#include <linux/gfs2_ondisk.h> 14#include <linux/gfs2_ondisk.h>
15#include <linux/bio.h> 15#include <linux/bio.h>
16#include <linux/posix_acl.h>
16 17
17#include "gfs2.h" 18#include "gfs2.h"
18#include "incore.h" 19#include "incore.h"
@@ -184,8 +185,10 @@ static void inode_go_inval(struct gfs2_glock *gl, int flags)
184 if (flags & DIO_METADATA) { 185 if (flags & DIO_METADATA) {
185 struct address_space *mapping = gl->gl_aspace->i_mapping; 186 struct address_space *mapping = gl->gl_aspace->i_mapping;
186 truncate_inode_pages(mapping, 0); 187 truncate_inode_pages(mapping, 0);
187 if (ip) 188 if (ip) {
188 set_bit(GIF_INVALID, &ip->i_flags); 189 set_bit(GIF_INVALID, &ip->i_flags);
190 forget_all_cached_acls(&ip->i_inode);
191 }
189 } 192 }
190 193
191 if (ip == GFS2_I(gl->gl_sbd->sd_rindex)) 194 if (ip == GFS2_I(gl->gl_sbd->sd_rindex))
diff --git a/fs/gfs2/incore.h b/fs/gfs2/incore.h
index 6edb423f90b3..4792200978c8 100644
--- a/fs/gfs2/incore.h
+++ b/fs/gfs2/incore.h
@@ -429,7 +429,11 @@ struct gfs2_args {
429 unsigned int ar_meta:1; /* mount metafs */ 429 unsigned int ar_meta:1; /* mount metafs */
430 unsigned int ar_discard:1; /* discard requests */ 430 unsigned int ar_discard:1; /* discard requests */
431 unsigned int ar_errors:2; /* errors=withdraw | panic */ 431 unsigned int ar_errors:2; /* errors=withdraw | panic */
432 unsigned int ar_nobarrier:1; /* do not send barriers */
432 int ar_commit; /* Commit interval */ 433 int ar_commit; /* Commit interval */
434 int ar_statfs_quantum; /* The fast statfs interval */
435 int ar_quota_quantum; /* The quota interval */
436 int ar_statfs_percent; /* The % change to force sync */
433}; 437};
434 438
435struct gfs2_tune { 439struct gfs2_tune {
@@ -558,6 +562,7 @@ struct gfs2_sbd {
558 spinlock_t sd_statfs_spin; 562 spinlock_t sd_statfs_spin;
559 struct gfs2_statfs_change_host sd_statfs_master; 563 struct gfs2_statfs_change_host sd_statfs_master;
560 struct gfs2_statfs_change_host sd_statfs_local; 564 struct gfs2_statfs_change_host sd_statfs_local;
565 int sd_statfs_force_sync;
561 566
562 /* Resource group stuff */ 567 /* Resource group stuff */
563 568
diff --git a/fs/gfs2/inode.c b/fs/gfs2/inode.c
index fb15d3b1f409..26ba2a4c4a2d 100644
--- a/fs/gfs2/inode.c
+++ b/fs/gfs2/inode.c
@@ -871,7 +871,7 @@ struct inode *gfs2_createi(struct gfs2_holder *ghs, const struct qstr *name,
871 if (error) 871 if (error)
872 goto fail_gunlock2; 872 goto fail_gunlock2;
873 873
874 error = gfs2_acl_create(dip, GFS2_I(inode)); 874 error = gfs2_acl_create(dip, inode);
875 if (error) 875 if (error)
876 goto fail_gunlock2; 876 goto fail_gunlock2;
877 877
@@ -947,9 +947,7 @@ void gfs2_dinode_out(const struct gfs2_inode *ip, void *buf)
947 947
948 str->di_header.mh_magic = cpu_to_be32(GFS2_MAGIC); 948 str->di_header.mh_magic = cpu_to_be32(GFS2_MAGIC);
949 str->di_header.mh_type = cpu_to_be32(GFS2_METATYPE_DI); 949 str->di_header.mh_type = cpu_to_be32(GFS2_METATYPE_DI);
950 str->di_header.__pad0 = 0;
951 str->di_header.mh_format = cpu_to_be32(GFS2_FORMAT_DI); 950 str->di_header.mh_format = cpu_to_be32(GFS2_FORMAT_DI);
952 str->di_header.__pad1 = 0;
953 str->di_num.no_addr = cpu_to_be64(ip->i_no_addr); 951 str->di_num.no_addr = cpu_to_be64(ip->i_no_addr);
954 str->di_num.no_formal_ino = cpu_to_be64(ip->i_no_formal_ino); 952 str->di_num.no_formal_ino = cpu_to_be64(ip->i_no_formal_ino);
955 str->di_mode = cpu_to_be32(ip->i_inode.i_mode); 953 str->di_mode = cpu_to_be32(ip->i_inode.i_mode);
diff --git a/fs/gfs2/log.c b/fs/gfs2/log.c
index 13c6237c5f67..4511b08fc451 100644
--- a/fs/gfs2/log.c
+++ b/fs/gfs2/log.c
@@ -596,7 +596,9 @@ static void log_write_header(struct gfs2_sbd *sdp, u32 flags, int pull)
596 memset(lh, 0, sizeof(struct gfs2_log_header)); 596 memset(lh, 0, sizeof(struct gfs2_log_header));
597 lh->lh_header.mh_magic = cpu_to_be32(GFS2_MAGIC); 597 lh->lh_header.mh_magic = cpu_to_be32(GFS2_MAGIC);
598 lh->lh_header.mh_type = cpu_to_be32(GFS2_METATYPE_LH); 598 lh->lh_header.mh_type = cpu_to_be32(GFS2_METATYPE_LH);
599 lh->lh_header.__pad0 = cpu_to_be64(0);
599 lh->lh_header.mh_format = cpu_to_be32(GFS2_FORMAT_LH); 600 lh->lh_header.mh_format = cpu_to_be32(GFS2_FORMAT_LH);
601 lh->lh_header.mh_jid = cpu_to_be32(sdp->sd_jdesc->jd_jid);
600 lh->lh_sequence = cpu_to_be64(sdp->sd_log_sequence++); 602 lh->lh_sequence = cpu_to_be64(sdp->sd_log_sequence++);
601 lh->lh_flags = cpu_to_be32(flags); 603 lh->lh_flags = cpu_to_be32(flags);
602 lh->lh_tail = cpu_to_be32(tail); 604 lh->lh_tail = cpu_to_be32(tail);
diff --git a/fs/gfs2/lops.c b/fs/gfs2/lops.c
index 9969ff062c5b..de97632ba32f 100644
--- a/fs/gfs2/lops.c
+++ b/fs/gfs2/lops.c
@@ -132,6 +132,7 @@ static struct buffer_head *gfs2_get_log_desc(struct gfs2_sbd *sdp, u32 ld_type)
132static void buf_lo_add(struct gfs2_sbd *sdp, struct gfs2_log_element *le) 132static void buf_lo_add(struct gfs2_sbd *sdp, struct gfs2_log_element *le)
133{ 133{
134 struct gfs2_bufdata *bd = container_of(le, struct gfs2_bufdata, bd_le); 134 struct gfs2_bufdata *bd = container_of(le, struct gfs2_bufdata, bd_le);
135 struct gfs2_meta_header *mh;
135 struct gfs2_trans *tr; 136 struct gfs2_trans *tr;
136 137
137 lock_buffer(bd->bd_bh); 138 lock_buffer(bd->bd_bh);
@@ -148,6 +149,9 @@ static void buf_lo_add(struct gfs2_sbd *sdp, struct gfs2_log_element *le)
148 set_bit(GLF_DIRTY, &bd->bd_gl->gl_flags); 149 set_bit(GLF_DIRTY, &bd->bd_gl->gl_flags);
149 gfs2_meta_check(sdp, bd->bd_bh); 150 gfs2_meta_check(sdp, bd->bd_bh);
150 gfs2_pin(sdp, bd->bd_bh); 151 gfs2_pin(sdp, bd->bd_bh);
152 mh = (struct gfs2_meta_header *)bd->bd_bh->b_data;
153 mh->__pad0 = cpu_to_be64(0);
154 mh->mh_jid = cpu_to_be32(sdp->sd_jdesc->jd_jid);
151 sdp->sd_log_num_buf++; 155 sdp->sd_log_num_buf++;
152 list_add(&le->le_list, &sdp->sd_log_le_buf); 156 list_add(&le->le_list, &sdp->sd_log_le_buf);
153 tr->tr_num_buf_new++; 157 tr->tr_num_buf_new++;
diff --git a/fs/gfs2/main.c b/fs/gfs2/main.c
index eacd78a5d082..5b31f7741a8f 100644
--- a/fs/gfs2/main.c
+++ b/fs/gfs2/main.c
@@ -114,7 +114,7 @@ static int __init init_gfs2_fs(void)
114 if (error) 114 if (error)
115 goto fail_unregister; 115 goto fail_unregister;
116 116
117 error = slow_work_register_user(); 117 error = slow_work_register_user(THIS_MODULE);
118 if (error) 118 if (error)
119 goto fail_slow; 119 goto fail_slow;
120 120
@@ -163,7 +163,7 @@ static void __exit exit_gfs2_fs(void)
163 gfs2_unregister_debugfs(); 163 gfs2_unregister_debugfs();
164 unregister_filesystem(&gfs2_fs_type); 164 unregister_filesystem(&gfs2_fs_type);
165 unregister_filesystem(&gfs2meta_fs_type); 165 unregister_filesystem(&gfs2meta_fs_type);
166 slow_work_unregister_user(); 166 slow_work_unregister_user(THIS_MODULE);
167 167
168 kmem_cache_destroy(gfs2_quotad_cachep); 168 kmem_cache_destroy(gfs2_quotad_cachep);
169 kmem_cache_destroy(gfs2_rgrpd_cachep); 169 kmem_cache_destroy(gfs2_rgrpd_cachep);
diff --git a/fs/gfs2/ops_fstype.c b/fs/gfs2/ops_fstype.c
index 52fb6c048981..edfee24f3636 100644
--- a/fs/gfs2/ops_fstype.c
+++ b/fs/gfs2/ops_fstype.c
@@ -18,6 +18,7 @@
18#include <linux/mount.h> 18#include <linux/mount.h>
19#include <linux/gfs2_ondisk.h> 19#include <linux/gfs2_ondisk.h>
20#include <linux/slow-work.h> 20#include <linux/slow-work.h>
21#include <linux/quotaops.h>
21 22
22#include "gfs2.h" 23#include "gfs2.h"
23#include "incore.h" 24#include "incore.h"
@@ -62,13 +63,10 @@ static void gfs2_tune_init(struct gfs2_tune *gt)
62 gt->gt_quota_warn_period = 10; 63 gt->gt_quota_warn_period = 10;
63 gt->gt_quota_scale_num = 1; 64 gt->gt_quota_scale_num = 1;
64 gt->gt_quota_scale_den = 1; 65 gt->gt_quota_scale_den = 1;
65 gt->gt_quota_quantum = 60;
66 gt->gt_new_files_jdata = 0; 66 gt->gt_new_files_jdata = 0;
67 gt->gt_max_readahead = 1 << 18; 67 gt->gt_max_readahead = 1 << 18;
68 gt->gt_stall_secs = 600; 68 gt->gt_stall_secs = 600;
69 gt->gt_complain_secs = 10; 69 gt->gt_complain_secs = 10;
70 gt->gt_statfs_quantum = 30;
71 gt->gt_statfs_slow = 0;
72} 70}
73 71
74static struct gfs2_sbd *init_sbd(struct super_block *sb) 72static struct gfs2_sbd *init_sbd(struct super_block *sb)
@@ -1114,7 +1112,7 @@ void gfs2_online_uevent(struct gfs2_sbd *sdp)
1114 * Returns: errno 1112 * Returns: errno
1115 */ 1113 */
1116 1114
1117static int fill_super(struct super_block *sb, void *data, int silent) 1115static int fill_super(struct super_block *sb, struct gfs2_args *args, int silent)
1118{ 1116{
1119 struct gfs2_sbd *sdp; 1117 struct gfs2_sbd *sdp;
1120 struct gfs2_holder mount_gh; 1118 struct gfs2_holder mount_gh;
@@ -1125,17 +1123,7 @@ static int fill_super(struct super_block *sb, void *data, int silent)
1125 printk(KERN_WARNING "GFS2: can't alloc struct gfs2_sbd\n"); 1123 printk(KERN_WARNING "GFS2: can't alloc struct gfs2_sbd\n");
1126 return -ENOMEM; 1124 return -ENOMEM;
1127 } 1125 }
1128 1126 sdp->sd_args = *args;
1129 sdp->sd_args.ar_quota = GFS2_QUOTA_DEFAULT;
1130 sdp->sd_args.ar_data = GFS2_DATA_DEFAULT;
1131 sdp->sd_args.ar_commit = 60;
1132 sdp->sd_args.ar_errors = GFS2_ERRORS_DEFAULT;
1133
1134 error = gfs2_mount_args(sdp, &sdp->sd_args, data);
1135 if (error) {
1136 printk(KERN_WARNING "GFS2: can't parse mount arguments\n");
1137 goto fail;
1138 }
1139 1127
1140 if (sdp->sd_args.ar_spectator) { 1128 if (sdp->sd_args.ar_spectator) {
1141 sb->s_flags |= MS_RDONLY; 1129 sb->s_flags |= MS_RDONLY;
@@ -1143,11 +1131,15 @@ static int fill_super(struct super_block *sb, void *data, int silent)
1143 } 1131 }
1144 if (sdp->sd_args.ar_posix_acl) 1132 if (sdp->sd_args.ar_posix_acl)
1145 sb->s_flags |= MS_POSIXACL; 1133 sb->s_flags |= MS_POSIXACL;
1134 if (sdp->sd_args.ar_nobarrier)
1135 set_bit(SDF_NOBARRIERS, &sdp->sd_flags);
1146 1136
1147 sb->s_magic = GFS2_MAGIC; 1137 sb->s_magic = GFS2_MAGIC;
1148 sb->s_op = &gfs2_super_ops; 1138 sb->s_op = &gfs2_super_ops;
1149 sb->s_export_op = &gfs2_export_ops; 1139 sb->s_export_op = &gfs2_export_ops;
1150 sb->s_xattr = gfs2_xattr_handlers; 1140 sb->s_xattr = gfs2_xattr_handlers;
1141 sb->s_qcop = &gfs2_quotactl_ops;
1142 sb_dqopt(sb)->flags |= DQUOT_QUOTA_SYS_FILE;
1151 sb->s_time_gran = 1; 1143 sb->s_time_gran = 1;
1152 sb->s_maxbytes = MAX_LFS_FILESIZE; 1144 sb->s_maxbytes = MAX_LFS_FILESIZE;
1153 1145
@@ -1160,6 +1152,15 @@ static int fill_super(struct super_block *sb, void *data, int silent)
1160 sdp->sd_fsb2bb = 1 << sdp->sd_fsb2bb_shift; 1152 sdp->sd_fsb2bb = 1 << sdp->sd_fsb2bb_shift;
1161 1153
1162 sdp->sd_tune.gt_log_flush_secs = sdp->sd_args.ar_commit; 1154 sdp->sd_tune.gt_log_flush_secs = sdp->sd_args.ar_commit;
1155 sdp->sd_tune.gt_quota_quantum = sdp->sd_args.ar_quota_quantum;
1156 if (sdp->sd_args.ar_statfs_quantum) {
1157 sdp->sd_tune.gt_statfs_slow = 0;
1158 sdp->sd_tune.gt_statfs_quantum = sdp->sd_args.ar_statfs_quantum;
1159 }
1160 else {
1161 sdp->sd_tune.gt_statfs_slow = 1;
1162 sdp->sd_tune.gt_statfs_quantum = 30;
1163 }
1163 1164
1164 error = init_names(sdp, silent); 1165 error = init_names(sdp, silent);
1165 if (error) 1166 if (error)
@@ -1243,18 +1244,127 @@ fail:
1243 return error; 1244 return error;
1244} 1245}
1245 1246
1246static int gfs2_get_sb(struct file_system_type *fs_type, int flags, 1247static int set_gfs2_super(struct super_block *s, void *data)
1247 const char *dev_name, void *data, struct vfsmount *mnt)
1248{ 1248{
1249 return get_sb_bdev(fs_type, flags, dev_name, data, fill_super, mnt); 1249 s->s_bdev = data;
1250 s->s_dev = s->s_bdev->bd_dev;
1251
1252 /*
1253 * We set the bdi here to the queue backing, file systems can
1254 * overwrite this in ->fill_super()
1255 */
1256 s->s_bdi = &bdev_get_queue(s->s_bdev)->backing_dev_info;
1257 return 0;
1250} 1258}
1251 1259
1252static int test_meta_super(struct super_block *s, void *ptr) 1260static int test_gfs2_super(struct super_block *s, void *ptr)
1253{ 1261{
1254 struct block_device *bdev = ptr; 1262 struct block_device *bdev = ptr;
1255 return (bdev == s->s_bdev); 1263 return (bdev == s->s_bdev);
1256} 1264}
1257 1265
1266/**
1267 * gfs2_get_sb - Get the GFS2 superblock
1268 * @fs_type: The GFS2 filesystem type
1269 * @flags: Mount flags
1270 * @dev_name: The name of the device
1271 * @data: The mount arguments
1272 * @mnt: The vfsmnt for this mount
1273 *
1274 * Q. Why not use get_sb_bdev() ?
1275 * A. We need to select one of two root directories to mount, independent
1276 * of whether this is the initial, or subsequent, mount of this sb
1277 *
1278 * Returns: 0 or -ve on error
1279 */
1280
1281static int gfs2_get_sb(struct file_system_type *fs_type, int flags,
1282 const char *dev_name, void *data, struct vfsmount *mnt)
1283{
1284 struct block_device *bdev;
1285 struct super_block *s;
1286 fmode_t mode = FMODE_READ;
1287 int error;
1288 struct gfs2_args args;
1289 struct gfs2_sbd *sdp;
1290
1291 if (!(flags & MS_RDONLY))
1292 mode |= FMODE_WRITE;
1293
1294 bdev = open_bdev_exclusive(dev_name, mode, fs_type);
1295 if (IS_ERR(bdev))
1296 return PTR_ERR(bdev);
1297
1298 /*
1299 * once the super is inserted into the list by sget, s_umount
1300 * will protect the lockfs code from trying to start a snapshot
1301 * while we are mounting
1302 */
1303 mutex_lock(&bdev->bd_fsfreeze_mutex);
1304 if (bdev->bd_fsfreeze_count > 0) {
1305 mutex_unlock(&bdev->bd_fsfreeze_mutex);
1306 error = -EBUSY;
1307 goto error_bdev;
1308 }
1309 s = sget(fs_type, test_gfs2_super, set_gfs2_super, bdev);
1310 mutex_unlock(&bdev->bd_fsfreeze_mutex);
1311 error = PTR_ERR(s);
1312 if (IS_ERR(s))
1313 goto error_bdev;
1314
1315 memset(&args, 0, sizeof(args));
1316 args.ar_quota = GFS2_QUOTA_DEFAULT;
1317 args.ar_data = GFS2_DATA_DEFAULT;
1318 args.ar_commit = 60;
1319 args.ar_statfs_quantum = 30;
1320 args.ar_quota_quantum = 60;
1321 args.ar_errors = GFS2_ERRORS_DEFAULT;
1322
1323 error = gfs2_mount_args(&args, data);
1324 if (error) {
1325 printk(KERN_WARNING "GFS2: can't parse mount arguments\n");
1326 if (s->s_root)
1327 goto error_super;
1328 deactivate_locked_super(s);
1329 return error;
1330 }
1331
1332 if (s->s_root) {
1333 error = -EBUSY;
1334 if ((flags ^ s->s_flags) & MS_RDONLY)
1335 goto error_super;
1336 close_bdev_exclusive(bdev, mode);
1337 } else {
1338 char b[BDEVNAME_SIZE];
1339
1340 s->s_flags = flags;
1341 s->s_mode = mode;
1342 strlcpy(s->s_id, bdevname(bdev, b), sizeof(s->s_id));
1343 sb_set_blocksize(s, block_size(bdev));
1344 error = fill_super(s, &args, flags & MS_SILENT ? 1 : 0);
1345 if (error) {
1346 deactivate_locked_super(s);
1347 return error;
1348 }
1349 s->s_flags |= MS_ACTIVE;
1350 bdev->bd_super = s;
1351 }
1352
1353 sdp = s->s_fs_info;
1354 mnt->mnt_sb = s;
1355 if (args.ar_meta)
1356 mnt->mnt_root = dget(sdp->sd_master_dir);
1357 else
1358 mnt->mnt_root = dget(sdp->sd_root_dir);
1359 return 0;
1360
1361error_super:
1362 deactivate_locked_super(s);
1363error_bdev:
1364 close_bdev_exclusive(bdev, mode);
1365 return error;
1366}
1367
1258static int set_meta_super(struct super_block *s, void *ptr) 1368static int set_meta_super(struct super_block *s, void *ptr)
1259{ 1369{
1260 return -EINVAL; 1370 return -EINVAL;
@@ -1274,13 +1384,17 @@ static int gfs2_get_sb_meta(struct file_system_type *fs_type, int flags,
1274 dev_name, error); 1384 dev_name, error);
1275 return error; 1385 return error;
1276 } 1386 }
1277 s = sget(&gfs2_fs_type, test_meta_super, set_meta_super, 1387 s = sget(&gfs2_fs_type, test_gfs2_super, set_meta_super,
1278 path.dentry->d_inode->i_sb->s_bdev); 1388 path.dentry->d_inode->i_sb->s_bdev);
1279 path_put(&path); 1389 path_put(&path);
1280 if (IS_ERR(s)) { 1390 if (IS_ERR(s)) {
1281 printk(KERN_WARNING "GFS2: gfs2 mount does not exist\n"); 1391 printk(KERN_WARNING "GFS2: gfs2 mount does not exist\n");
1282 return PTR_ERR(s); 1392 return PTR_ERR(s);
1283 } 1393 }
1394 if ((flags ^ s->s_flags) & MS_RDONLY) {
1395 deactivate_locked_super(s);
1396 return -EBUSY;
1397 }
1284 sdp = s->s_fs_info; 1398 sdp = s->s_fs_info;
1285 mnt->mnt_sb = s; 1399 mnt->mnt_sb = s;
1286 mnt->mnt_root = dget(sdp->sd_master_dir); 1400 mnt->mnt_root = dget(sdp->sd_master_dir);
diff --git a/fs/gfs2/quota.c b/fs/gfs2/quota.c
index 2e9b9326bfc9..e3bf6eab8750 100644
--- a/fs/gfs2/quota.c
+++ b/fs/gfs2/quota.c
@@ -15,7 +15,7 @@
15 * fuzziness in the current usage value of IDs that are being used on different 15 * fuzziness in the current usage value of IDs that are being used on different
16 * nodes in the cluster simultaneously. So, it is possible for a user on 16 * nodes in the cluster simultaneously. So, it is possible for a user on
17 * multiple nodes to overrun their quota, but that overrun is controlable. 17 * multiple nodes to overrun their quota, but that overrun is controlable.
18 * Since quota tags are part of transactions, there is no need to a quota check 18 * Since quota tags are part of transactions, there is no need for a quota check
19 * program to be run on node crashes or anything like that. 19 * program to be run on node crashes or anything like that.
20 * 20 *
21 * There are couple of knobs that let the administrator manage the quota 21 * There are couple of knobs that let the administrator manage the quota
@@ -47,6 +47,8 @@
47#include <linux/gfs2_ondisk.h> 47#include <linux/gfs2_ondisk.h>
48#include <linux/kthread.h> 48#include <linux/kthread.h>
49#include <linux/freezer.h> 49#include <linux/freezer.h>
50#include <linux/quota.h>
51#include <linux/dqblk_xfs.h>
50 52
51#include "gfs2.h" 53#include "gfs2.h"
52#include "incore.h" 54#include "incore.h"
@@ -65,13 +67,6 @@
65#define QUOTA_USER 1 67#define QUOTA_USER 1
66#define QUOTA_GROUP 0 68#define QUOTA_GROUP 0
67 69
68struct gfs2_quota_host {
69 u64 qu_limit;
70 u64 qu_warn;
71 s64 qu_value;
72 u32 qu_ll_next;
73};
74
75struct gfs2_quota_change_host { 70struct gfs2_quota_change_host {
76 u64 qc_change; 71 u64 qc_change;
77 u32 qc_flags; /* GFS2_QCF_... */ 72 u32 qc_flags; /* GFS2_QCF_... */
@@ -164,7 +159,7 @@ fail:
164 return error; 159 return error;
165} 160}
166 161
167static int qd_get(struct gfs2_sbd *sdp, int user, u32 id, int create, 162static int qd_get(struct gfs2_sbd *sdp, int user, u32 id,
168 struct gfs2_quota_data **qdp) 163 struct gfs2_quota_data **qdp)
169{ 164{
170 struct gfs2_quota_data *qd = NULL, *new_qd = NULL; 165 struct gfs2_quota_data *qd = NULL, *new_qd = NULL;
@@ -202,7 +197,7 @@ static int qd_get(struct gfs2_sbd *sdp, int user, u32 id, int create,
202 197
203 spin_unlock(&qd_lru_lock); 198 spin_unlock(&qd_lru_lock);
204 199
205 if (qd || !create) { 200 if (qd) {
206 if (new_qd) { 201 if (new_qd) {
207 gfs2_glock_put(new_qd->qd_gl); 202 gfs2_glock_put(new_qd->qd_gl);
208 kmem_cache_free(gfs2_quotad_cachep, new_qd); 203 kmem_cache_free(gfs2_quotad_cachep, new_qd);
@@ -461,12 +456,12 @@ static void qd_unlock(struct gfs2_quota_data *qd)
461 qd_put(qd); 456 qd_put(qd);
462} 457}
463 458
464static int qdsb_get(struct gfs2_sbd *sdp, int user, u32 id, int create, 459static int qdsb_get(struct gfs2_sbd *sdp, int user, u32 id,
465 struct gfs2_quota_data **qdp) 460 struct gfs2_quota_data **qdp)
466{ 461{
467 int error; 462 int error;
468 463
469 error = qd_get(sdp, user, id, create, qdp); 464 error = qd_get(sdp, user, id, qdp);
470 if (error) 465 if (error)
471 return error; 466 return error;
472 467
@@ -508,20 +503,20 @@ int gfs2_quota_hold(struct gfs2_inode *ip, u32 uid, u32 gid)
508 if (sdp->sd_args.ar_quota == GFS2_QUOTA_OFF) 503 if (sdp->sd_args.ar_quota == GFS2_QUOTA_OFF)
509 return 0; 504 return 0;
510 505
511 error = qdsb_get(sdp, QUOTA_USER, ip->i_inode.i_uid, CREATE, qd); 506 error = qdsb_get(sdp, QUOTA_USER, ip->i_inode.i_uid, qd);
512 if (error) 507 if (error)
513 goto out; 508 goto out;
514 al->al_qd_num++; 509 al->al_qd_num++;
515 qd++; 510 qd++;
516 511
517 error = qdsb_get(sdp, QUOTA_GROUP, ip->i_inode.i_gid, CREATE, qd); 512 error = qdsb_get(sdp, QUOTA_GROUP, ip->i_inode.i_gid, qd);
518 if (error) 513 if (error)
519 goto out; 514 goto out;
520 al->al_qd_num++; 515 al->al_qd_num++;
521 qd++; 516 qd++;
522 517
523 if (uid != NO_QUOTA_CHANGE && uid != ip->i_inode.i_uid) { 518 if (uid != NO_QUOTA_CHANGE && uid != ip->i_inode.i_uid) {
524 error = qdsb_get(sdp, QUOTA_USER, uid, CREATE, qd); 519 error = qdsb_get(sdp, QUOTA_USER, uid, qd);
525 if (error) 520 if (error)
526 goto out; 521 goto out;
527 al->al_qd_num++; 522 al->al_qd_num++;
@@ -529,7 +524,7 @@ int gfs2_quota_hold(struct gfs2_inode *ip, u32 uid, u32 gid)
529 } 524 }
530 525
531 if (gid != NO_QUOTA_CHANGE && gid != ip->i_inode.i_gid) { 526 if (gid != NO_QUOTA_CHANGE && gid != ip->i_inode.i_gid) {
532 error = qdsb_get(sdp, QUOTA_GROUP, gid, CREATE, qd); 527 error = qdsb_get(sdp, QUOTA_GROUP, gid, qd);
533 if (error) 528 if (error)
534 goto out; 529 goto out;
535 al->al_qd_num++; 530 al->al_qd_num++;
@@ -617,48 +612,36 @@ static void do_qc(struct gfs2_quota_data *qd, s64 change)
617 mutex_unlock(&sdp->sd_quota_mutex); 612 mutex_unlock(&sdp->sd_quota_mutex);
618} 613}
619 614
620static void gfs2_quota_in(struct gfs2_quota_host *qu, const void *buf)
621{
622 const struct gfs2_quota *str = buf;
623
624 qu->qu_limit = be64_to_cpu(str->qu_limit);
625 qu->qu_warn = be64_to_cpu(str->qu_warn);
626 qu->qu_value = be64_to_cpu(str->qu_value);
627 qu->qu_ll_next = be32_to_cpu(str->qu_ll_next);
628}
629
630static void gfs2_quota_out(const struct gfs2_quota_host *qu, void *buf)
631{
632 struct gfs2_quota *str = buf;
633
634 str->qu_limit = cpu_to_be64(qu->qu_limit);
635 str->qu_warn = cpu_to_be64(qu->qu_warn);
636 str->qu_value = cpu_to_be64(qu->qu_value);
637 str->qu_ll_next = cpu_to_be32(qu->qu_ll_next);
638 memset(&str->qu_reserved, 0, sizeof(str->qu_reserved));
639}
640
641/** 615/**
642 * gfs2_adjust_quota 616 * gfs2_adjust_quota - adjust record of current block usage
617 * @ip: The quota inode
618 * @loc: Offset of the entry in the quota file
619 * @change: The amount of usage change to record
620 * @qd: The quota data
621 * @fdq: The updated limits to record
643 * 622 *
644 * This function was mostly borrowed from gfs2_block_truncate_page which was 623 * This function was mostly borrowed from gfs2_block_truncate_page which was
645 * in turn mostly borrowed from ext3 624 * in turn mostly borrowed from ext3
625 *
626 * Returns: 0 or -ve on error
646 */ 627 */
628
647static int gfs2_adjust_quota(struct gfs2_inode *ip, loff_t loc, 629static int gfs2_adjust_quota(struct gfs2_inode *ip, loff_t loc,
648 s64 change, struct gfs2_quota_data *qd) 630 s64 change, struct gfs2_quota_data *qd,
631 struct fs_disk_quota *fdq)
649{ 632{
650 struct inode *inode = &ip->i_inode; 633 struct inode *inode = &ip->i_inode;
651 struct address_space *mapping = inode->i_mapping; 634 struct address_space *mapping = inode->i_mapping;
652 unsigned long index = loc >> PAGE_CACHE_SHIFT; 635 unsigned long index = loc >> PAGE_CACHE_SHIFT;
653 unsigned offset = loc & (PAGE_CACHE_SIZE - 1); 636 unsigned offset = loc & (PAGE_CACHE_SIZE - 1);
654 unsigned blocksize, iblock, pos; 637 unsigned blocksize, iblock, pos;
655 struct buffer_head *bh; 638 struct buffer_head *bh, *dibh;
656 struct page *page; 639 struct page *page;
657 void *kaddr; 640 void *kaddr;
658 char *ptr; 641 struct gfs2_quota *qp;
659 struct gfs2_quota_host qp;
660 s64 value; 642 s64 value;
661 int err = -EIO; 643 int err = -EIO;
644 u64 size;
662 645
663 if (gfs2_is_stuffed(ip)) 646 if (gfs2_is_stuffed(ip))
664 gfs2_unstuff_dinode(ip, NULL); 647 gfs2_unstuff_dinode(ip, NULL);
@@ -700,18 +683,38 @@ static int gfs2_adjust_quota(struct gfs2_inode *ip, loff_t loc,
700 gfs2_trans_add_bh(ip->i_gl, bh, 0); 683 gfs2_trans_add_bh(ip->i_gl, bh, 0);
701 684
702 kaddr = kmap_atomic(page, KM_USER0); 685 kaddr = kmap_atomic(page, KM_USER0);
703 ptr = kaddr + offset; 686 qp = kaddr + offset;
704 gfs2_quota_in(&qp, ptr); 687 value = (s64)be64_to_cpu(qp->qu_value) + change;
705 qp.qu_value += change; 688 qp->qu_value = cpu_to_be64(value);
706 value = qp.qu_value; 689 qd->qd_qb.qb_value = qp->qu_value;
707 gfs2_quota_out(&qp, ptr); 690 if (fdq) {
691 if (fdq->d_fieldmask & FS_DQ_BSOFT) {
692 qp->qu_warn = cpu_to_be64(fdq->d_blk_softlimit);
693 qd->qd_qb.qb_warn = qp->qu_warn;
694 }
695 if (fdq->d_fieldmask & FS_DQ_BHARD) {
696 qp->qu_limit = cpu_to_be64(fdq->d_blk_hardlimit);
697 qd->qd_qb.qb_limit = qp->qu_limit;
698 }
699 }
708 flush_dcache_page(page); 700 flush_dcache_page(page);
709 kunmap_atomic(kaddr, KM_USER0); 701 kunmap_atomic(kaddr, KM_USER0);
710 err = 0; 702
711 qd->qd_qb.qb_magic = cpu_to_be32(GFS2_MAGIC); 703 err = gfs2_meta_inode_buffer(ip, &dibh);
712 qd->qd_qb.qb_value = cpu_to_be64(value); 704 if (err)
713 ((struct gfs2_quota_lvb*)(qd->qd_gl->gl_lvb))->qb_magic = cpu_to_be32(GFS2_MAGIC); 705 goto unlock;
714 ((struct gfs2_quota_lvb*)(qd->qd_gl->gl_lvb))->qb_value = cpu_to_be64(value); 706
707 size = loc + sizeof(struct gfs2_quota);
708 if (size > inode->i_size) {
709 ip->i_disksize = size;
710 i_size_write(inode, size);
711 }
712 inode->i_mtime = inode->i_atime = CURRENT_TIME;
713 gfs2_trans_add_bh(ip->i_gl, dibh, 1);
714 gfs2_dinode_out(ip, dibh->b_data);
715 brelse(dibh);
716 mark_inode_dirty(inode);
717
715unlock: 718unlock:
716 unlock_page(page); 719 unlock_page(page);
717 page_cache_release(page); 720 page_cache_release(page);
@@ -739,9 +742,9 @@ static int do_sync(unsigned int num_qd, struct gfs2_quota_data **qda)
739 return -ENOMEM; 742 return -ENOMEM;
740 743
741 sort(qda, num_qd, sizeof(struct gfs2_quota_data *), sort_qd, NULL); 744 sort(qda, num_qd, sizeof(struct gfs2_quota_data *), sort_qd, NULL);
745 mutex_lock_nested(&ip->i_inode.i_mutex, I_MUTEX_QUOTA);
742 for (qx = 0; qx < num_qd; qx++) { 746 for (qx = 0; qx < num_qd; qx++) {
743 error = gfs2_glock_nq_init(qda[qx]->qd_gl, 747 error = gfs2_glock_nq_init(qda[qx]->qd_gl, LM_ST_EXCLUSIVE,
744 LM_ST_EXCLUSIVE,
745 GL_NOCACHE, &ghs[qx]); 748 GL_NOCACHE, &ghs[qx]);
746 if (error) 749 if (error)
747 goto out; 750 goto out;
@@ -795,9 +798,7 @@ static int do_sync(unsigned int num_qd, struct gfs2_quota_data **qda)
795 for (x = 0; x < num_qd; x++) { 798 for (x = 0; x < num_qd; x++) {
796 qd = qda[x]; 799 qd = qda[x];
797 offset = qd2offset(qd); 800 offset = qd2offset(qd);
798 error = gfs2_adjust_quota(ip, offset, qd->qd_change_sync, 801 error = gfs2_adjust_quota(ip, offset, qd->qd_change_sync, qd, NULL);
799 (struct gfs2_quota_data *)
800 qd);
801 if (error) 802 if (error)
802 goto out_end_trans; 803 goto out_end_trans;
803 804
@@ -817,21 +818,44 @@ out_gunlock:
817out: 818out:
818 while (qx--) 819 while (qx--)
819 gfs2_glock_dq_uninit(&ghs[qx]); 820 gfs2_glock_dq_uninit(&ghs[qx]);
821 mutex_unlock(&ip->i_inode.i_mutex);
820 kfree(ghs); 822 kfree(ghs);
821 gfs2_log_flush(ip->i_gl->gl_sbd, ip->i_gl); 823 gfs2_log_flush(ip->i_gl->gl_sbd, ip->i_gl);
822 return error; 824 return error;
823} 825}
824 826
827static int update_qd(struct gfs2_sbd *sdp, struct gfs2_quota_data *qd)
828{
829 struct gfs2_inode *ip = GFS2_I(sdp->sd_quota_inode);
830 struct gfs2_quota q;
831 struct gfs2_quota_lvb *qlvb;
832 loff_t pos;
833 int error;
834
835 memset(&q, 0, sizeof(struct gfs2_quota));
836 pos = qd2offset(qd);
837 error = gfs2_internal_read(ip, NULL, (char *)&q, &pos, sizeof(q));
838 if (error < 0)
839 return error;
840
841 qlvb = (struct gfs2_quota_lvb *)qd->qd_gl->gl_lvb;
842 qlvb->qb_magic = cpu_to_be32(GFS2_MAGIC);
843 qlvb->__pad = 0;
844 qlvb->qb_limit = q.qu_limit;
845 qlvb->qb_warn = q.qu_warn;
846 qlvb->qb_value = q.qu_value;
847 qd->qd_qb = *qlvb;
848
849 return 0;
850}
851
825static int do_glock(struct gfs2_quota_data *qd, int force_refresh, 852static int do_glock(struct gfs2_quota_data *qd, int force_refresh,
826 struct gfs2_holder *q_gh) 853 struct gfs2_holder *q_gh)
827{ 854{
828 struct gfs2_sbd *sdp = qd->qd_gl->gl_sbd; 855 struct gfs2_sbd *sdp = qd->qd_gl->gl_sbd;
829 struct gfs2_inode *ip = GFS2_I(sdp->sd_quota_inode); 856 struct gfs2_inode *ip = GFS2_I(sdp->sd_quota_inode);
830 struct gfs2_holder i_gh; 857 struct gfs2_holder i_gh;
831 struct gfs2_quota_host q;
832 char buf[sizeof(struct gfs2_quota)];
833 int error; 858 int error;
834 struct gfs2_quota_lvb *qlvb;
835 859
836restart: 860restart:
837 error = gfs2_glock_nq_init(qd->qd_gl, LM_ST_SHARED, 0, q_gh); 861 error = gfs2_glock_nq_init(qd->qd_gl, LM_ST_SHARED, 0, q_gh);
@@ -841,11 +865,9 @@ restart:
841 qd->qd_qb = *(struct gfs2_quota_lvb *)qd->qd_gl->gl_lvb; 865 qd->qd_qb = *(struct gfs2_quota_lvb *)qd->qd_gl->gl_lvb;
842 866
843 if (force_refresh || qd->qd_qb.qb_magic != cpu_to_be32(GFS2_MAGIC)) { 867 if (force_refresh || qd->qd_qb.qb_magic != cpu_to_be32(GFS2_MAGIC)) {
844 loff_t pos;
845 gfs2_glock_dq_uninit(q_gh); 868 gfs2_glock_dq_uninit(q_gh);
846 error = gfs2_glock_nq_init(qd->qd_gl, 869 error = gfs2_glock_nq_init(qd->qd_gl, LM_ST_EXCLUSIVE,
847 LM_ST_EXCLUSIVE, GL_NOCACHE, 870 GL_NOCACHE, q_gh);
848 q_gh);
849 if (error) 871 if (error)
850 return error; 872 return error;
851 873
@@ -853,29 +875,14 @@ restart:
853 if (error) 875 if (error)
854 goto fail; 876 goto fail;
855 877
856 memset(buf, 0, sizeof(struct gfs2_quota)); 878 error = update_qd(sdp, qd);
857 pos = qd2offset(qd); 879 if (error)
858 error = gfs2_internal_read(ip, NULL, buf, &pos,
859 sizeof(struct gfs2_quota));
860 if (error < 0)
861 goto fail_gunlock; 880 goto fail_gunlock;
862 881
863 gfs2_glock_dq_uninit(&i_gh); 882 gfs2_glock_dq_uninit(&i_gh);
864 883 gfs2_glock_dq_uninit(q_gh);
865 gfs2_quota_in(&q, buf); 884 force_refresh = 0;
866 qlvb = (struct gfs2_quota_lvb *)qd->qd_gl->gl_lvb; 885 goto restart;
867 qlvb->qb_magic = cpu_to_be32(GFS2_MAGIC);
868 qlvb->__pad = 0;
869 qlvb->qb_limit = cpu_to_be64(q.qu_limit);
870 qlvb->qb_warn = cpu_to_be64(q.qu_warn);
871 qlvb->qb_value = cpu_to_be64(q.qu_value);
872 qd->qd_qb = *qlvb;
873
874 if (gfs2_glock_is_blocking(qd->qd_gl)) {
875 gfs2_glock_dq_uninit(q_gh);
876 force_refresh = 0;
877 goto restart;
878 }
879 } 886 }
880 887
881 return 0; 888 return 0;
@@ -995,7 +1002,7 @@ static int print_message(struct gfs2_quota_data *qd, char *type)
995{ 1002{
996 struct gfs2_sbd *sdp = qd->qd_gl->gl_sbd; 1003 struct gfs2_sbd *sdp = qd->qd_gl->gl_sbd;
997 1004
998 printk(KERN_INFO "GFS2: fsid=%s: quota %s for %s %u\r\n", 1005 printk(KERN_INFO "GFS2: fsid=%s: quota %s for %s %u\n",
999 sdp->sd_fsname, type, 1006 sdp->sd_fsname, type,
1000 (test_bit(QDF_USER, &qd->qd_flags)) ? "user" : "group", 1007 (test_bit(QDF_USER, &qd->qd_flags)) ? "user" : "group",
1001 qd->qd_id); 1008 qd->qd_id);
@@ -1032,6 +1039,10 @@ int gfs2_quota_check(struct gfs2_inode *ip, u32 uid, u32 gid)
1032 1039
1033 if (be64_to_cpu(qd->qd_qb.qb_limit) && (s64)be64_to_cpu(qd->qd_qb.qb_limit) < value) { 1040 if (be64_to_cpu(qd->qd_qb.qb_limit) && (s64)be64_to_cpu(qd->qd_qb.qb_limit) < value) {
1034 print_message(qd, "exceeded"); 1041 print_message(qd, "exceeded");
1042 quota_send_warning(test_bit(QDF_USER, &qd->qd_flags) ?
1043 USRQUOTA : GRPQUOTA, qd->qd_id,
1044 sdp->sd_vfs->s_dev, QUOTA_NL_BHARDWARN);
1045
1035 error = -EDQUOT; 1046 error = -EDQUOT;
1036 break; 1047 break;
1037 } else if (be64_to_cpu(qd->qd_qb.qb_warn) && 1048 } else if (be64_to_cpu(qd->qd_qb.qb_warn) &&
@@ -1039,6 +1050,9 @@ int gfs2_quota_check(struct gfs2_inode *ip, u32 uid, u32 gid)
1039 time_after_eq(jiffies, qd->qd_last_warn + 1050 time_after_eq(jiffies, qd->qd_last_warn +
1040 gfs2_tune_get(sdp, 1051 gfs2_tune_get(sdp,
1041 gt_quota_warn_period) * HZ)) { 1052 gt_quota_warn_period) * HZ)) {
1053 quota_send_warning(test_bit(QDF_USER, &qd->qd_flags) ?
1054 USRQUOTA : GRPQUOTA, qd->qd_id,
1055 sdp->sd_vfs->s_dev, QUOTA_NL_BSOFTWARN);
1042 error = print_message(qd, "warning"); 1056 error = print_message(qd, "warning");
1043 qd->qd_last_warn = jiffies; 1057 qd->qd_last_warn = jiffies;
1044 } 1058 }
@@ -1069,8 +1083,9 @@ void gfs2_quota_change(struct gfs2_inode *ip, s64 change,
1069 } 1083 }
1070} 1084}
1071 1085
1072int gfs2_quota_sync(struct gfs2_sbd *sdp) 1086int gfs2_quota_sync(struct super_block *sb, int type)
1073{ 1087{
1088 struct gfs2_sbd *sdp = sb->s_fs_info;
1074 struct gfs2_quota_data **qda; 1089 struct gfs2_quota_data **qda;
1075 unsigned int max_qd = gfs2_tune_get(sdp, gt_quota_simul_sync); 1090 unsigned int max_qd = gfs2_tune_get(sdp, gt_quota_simul_sync);
1076 unsigned int num_qd; 1091 unsigned int num_qd;
@@ -1118,7 +1133,7 @@ int gfs2_quota_refresh(struct gfs2_sbd *sdp, int user, u32 id)
1118 struct gfs2_holder q_gh; 1133 struct gfs2_holder q_gh;
1119 int error; 1134 int error;
1120 1135
1121 error = qd_get(sdp, user, id, CREATE, &qd); 1136 error = qd_get(sdp, user, id, &qd);
1122 if (error) 1137 if (error)
1123 return error; 1138 return error;
1124 1139
@@ -1127,7 +1142,6 @@ int gfs2_quota_refresh(struct gfs2_sbd *sdp, int user, u32 id)
1127 gfs2_glock_dq_uninit(&q_gh); 1142 gfs2_glock_dq_uninit(&q_gh);
1128 1143
1129 qd_put(qd); 1144 qd_put(qd);
1130
1131 return error; 1145 return error;
1132} 1146}
1133 1147
@@ -1298,12 +1312,12 @@ static void quotad_error(struct gfs2_sbd *sdp, const char *msg, int error)
1298} 1312}
1299 1313
1300static void quotad_check_timeo(struct gfs2_sbd *sdp, const char *msg, 1314static void quotad_check_timeo(struct gfs2_sbd *sdp, const char *msg,
1301 int (*fxn)(struct gfs2_sbd *sdp), 1315 int (*fxn)(struct super_block *sb, int type),
1302 unsigned long t, unsigned long *timeo, 1316 unsigned long t, unsigned long *timeo,
1303 unsigned int *new_timeo) 1317 unsigned int *new_timeo)
1304{ 1318{
1305 if (t >= *timeo) { 1319 if (t >= *timeo) {
1306 int error = fxn(sdp); 1320 int error = fxn(sdp->sd_vfs, 0);
1307 quotad_error(sdp, msg, error); 1321 quotad_error(sdp, msg, error);
1308 *timeo = gfs2_tune_get_i(&sdp->sd_tune, new_timeo) * HZ; 1322 *timeo = gfs2_tune_get_i(&sdp->sd_tune, new_timeo) * HZ;
1309 } else { 1323 } else {
@@ -1330,6 +1344,14 @@ static void quotad_check_trunc_list(struct gfs2_sbd *sdp)
1330 } 1344 }
1331} 1345}
1332 1346
1347void gfs2_wake_up_statfs(struct gfs2_sbd *sdp) {
1348 if (!sdp->sd_statfs_force_sync) {
1349 sdp->sd_statfs_force_sync = 1;
1350 wake_up(&sdp->sd_quota_wait);
1351 }
1352}
1353
1354
1333/** 1355/**
1334 * gfs2_quotad - Write cached quota changes into the quota file 1356 * gfs2_quotad - Write cached quota changes into the quota file
1335 * @sdp: Pointer to GFS2 superblock 1357 * @sdp: Pointer to GFS2 superblock
@@ -1349,8 +1371,15 @@ int gfs2_quotad(void *data)
1349 while (!kthread_should_stop()) { 1371 while (!kthread_should_stop()) {
1350 1372
1351 /* Update the master statfs file */ 1373 /* Update the master statfs file */
1352 quotad_check_timeo(sdp, "statfs", gfs2_statfs_sync, t, 1374 if (sdp->sd_statfs_force_sync) {
1353 &statfs_timeo, &tune->gt_statfs_quantum); 1375 int error = gfs2_statfs_sync(sdp->sd_vfs, 0);
1376 quotad_error(sdp, "statfs", error);
1377 statfs_timeo = gfs2_tune_get(sdp, gt_statfs_quantum) * HZ;
1378 }
1379 else
1380 quotad_check_timeo(sdp, "statfs", gfs2_statfs_sync, t,
1381 &statfs_timeo,
1382 &tune->gt_statfs_quantum);
1354 1383
1355 /* Update quota file */ 1384 /* Update quota file */
1356 quotad_check_timeo(sdp, "sync", gfs2_quota_sync, t, 1385 quotad_check_timeo(sdp, "sync", gfs2_quota_sync, t,
@@ -1367,7 +1396,7 @@ int gfs2_quotad(void *data)
1367 spin_lock(&sdp->sd_trunc_lock); 1396 spin_lock(&sdp->sd_trunc_lock);
1368 empty = list_empty(&sdp->sd_trunc_list); 1397 empty = list_empty(&sdp->sd_trunc_list);
1369 spin_unlock(&sdp->sd_trunc_lock); 1398 spin_unlock(&sdp->sd_trunc_lock);
1370 if (empty) 1399 if (empty && !sdp->sd_statfs_force_sync)
1371 t -= schedule_timeout(t); 1400 t -= schedule_timeout(t);
1372 else 1401 else
1373 t = 0; 1402 t = 0;
@@ -1377,3 +1406,181 @@ int gfs2_quotad(void *data)
1377 return 0; 1406 return 0;
1378} 1407}
1379 1408
1409static int gfs2_quota_get_xstate(struct super_block *sb,
1410 struct fs_quota_stat *fqs)
1411{
1412 struct gfs2_sbd *sdp = sb->s_fs_info;
1413
1414 memset(fqs, 0, sizeof(struct fs_quota_stat));
1415 fqs->qs_version = FS_QSTAT_VERSION;
1416 if (sdp->sd_args.ar_quota == GFS2_QUOTA_ON)
1417 fqs->qs_flags = (XFS_QUOTA_UDQ_ENFD | XFS_QUOTA_GDQ_ENFD);
1418 else if (sdp->sd_args.ar_quota == GFS2_QUOTA_ACCOUNT)
1419 fqs->qs_flags = (XFS_QUOTA_UDQ_ACCT | XFS_QUOTA_GDQ_ACCT);
1420 if (sdp->sd_quota_inode) {
1421 fqs->qs_uquota.qfs_ino = GFS2_I(sdp->sd_quota_inode)->i_no_addr;
1422 fqs->qs_uquota.qfs_nblks = sdp->sd_quota_inode->i_blocks;
1423 }
1424 fqs->qs_uquota.qfs_nextents = 1; /* unsupported */
1425 fqs->qs_gquota = fqs->qs_uquota; /* its the same inode in both cases */
1426 fqs->qs_incoredqs = atomic_read(&qd_lru_count);
1427 return 0;
1428}
1429
1430static int gfs2_xquota_get(struct super_block *sb, int type, qid_t id,
1431 struct fs_disk_quota *fdq)
1432{
1433 struct gfs2_sbd *sdp = sb->s_fs_info;
1434 struct gfs2_quota_lvb *qlvb;
1435 struct gfs2_quota_data *qd;
1436 struct gfs2_holder q_gh;
1437 int error;
1438
1439 memset(fdq, 0, sizeof(struct fs_disk_quota));
1440
1441 if (sdp->sd_args.ar_quota == GFS2_QUOTA_OFF)
1442 return -ESRCH; /* Crazy XFS error code */
1443
1444 if (type == USRQUOTA)
1445 type = QUOTA_USER;
1446 else if (type == GRPQUOTA)
1447 type = QUOTA_GROUP;
1448 else
1449 return -EINVAL;
1450
1451 error = qd_get(sdp, type, id, &qd);
1452 if (error)
1453 return error;
1454 error = do_glock(qd, FORCE, &q_gh);
1455 if (error)
1456 goto out;
1457
1458 qlvb = (struct gfs2_quota_lvb *)qd->qd_gl->gl_lvb;
1459 fdq->d_version = FS_DQUOT_VERSION;
1460 fdq->d_flags = (type == QUOTA_USER) ? XFS_USER_QUOTA : XFS_GROUP_QUOTA;
1461 fdq->d_id = id;
1462 fdq->d_blk_hardlimit = be64_to_cpu(qlvb->qb_limit);
1463 fdq->d_blk_softlimit = be64_to_cpu(qlvb->qb_warn);
1464 fdq->d_bcount = be64_to_cpu(qlvb->qb_value);
1465
1466 gfs2_glock_dq_uninit(&q_gh);
1467out:
1468 qd_put(qd);
1469 return error;
1470}
1471
1472/* GFS2 only supports a subset of the XFS fields */
1473#define GFS2_FIELDMASK (FS_DQ_BSOFT|FS_DQ_BHARD)
1474
1475static int gfs2_xquota_set(struct super_block *sb, int type, qid_t id,
1476 struct fs_disk_quota *fdq)
1477{
1478 struct gfs2_sbd *sdp = sb->s_fs_info;
1479 struct gfs2_inode *ip = GFS2_I(sdp->sd_quota_inode);
1480 struct gfs2_quota_data *qd;
1481 struct gfs2_holder q_gh, i_gh;
1482 unsigned int data_blocks, ind_blocks;
1483 unsigned int blocks = 0;
1484 int alloc_required;
1485 struct gfs2_alloc *al;
1486 loff_t offset;
1487 int error;
1488
1489 if (sdp->sd_args.ar_quota == GFS2_QUOTA_OFF)
1490 return -ESRCH; /* Crazy XFS error code */
1491
1492 switch(type) {
1493 case USRQUOTA:
1494 type = QUOTA_USER;
1495 if (fdq->d_flags != XFS_USER_QUOTA)
1496 return -EINVAL;
1497 break;
1498 case GRPQUOTA:
1499 type = QUOTA_GROUP;
1500 if (fdq->d_flags != XFS_GROUP_QUOTA)
1501 return -EINVAL;
1502 break;
1503 default:
1504 return -EINVAL;
1505 }
1506
1507 if (fdq->d_fieldmask & ~GFS2_FIELDMASK)
1508 return -EINVAL;
1509 if (fdq->d_id != id)
1510 return -EINVAL;
1511
1512 error = qd_get(sdp, type, id, &qd);
1513 if (error)
1514 return error;
1515
1516 mutex_lock(&ip->i_inode.i_mutex);
1517 error = gfs2_glock_nq_init(qd->qd_gl, LM_ST_EXCLUSIVE, 0, &q_gh);
1518 if (error)
1519 goto out_put;
1520 error = gfs2_glock_nq_init(ip->i_gl, LM_ST_EXCLUSIVE, 0, &i_gh);
1521 if (error)
1522 goto out_q;
1523
1524 /* Check for existing entry, if none then alloc new blocks */
1525 error = update_qd(sdp, qd);
1526 if (error)
1527 goto out_i;
1528
1529 /* If nothing has changed, this is a no-op */
1530 if ((fdq->d_fieldmask & FS_DQ_BSOFT) &&
1531 (fdq->d_blk_softlimit == be64_to_cpu(qd->qd_qb.qb_warn)))
1532 fdq->d_fieldmask ^= FS_DQ_BSOFT;
1533 if ((fdq->d_fieldmask & FS_DQ_BHARD) &&
1534 (fdq->d_blk_hardlimit == be64_to_cpu(qd->qd_qb.qb_limit)))
1535 fdq->d_fieldmask ^= FS_DQ_BHARD;
1536 if (fdq->d_fieldmask == 0)
1537 goto out_i;
1538
1539 offset = qd2offset(qd);
1540 error = gfs2_write_alloc_required(ip, offset, sizeof(struct gfs2_quota),
1541 &alloc_required);
1542 if (error)
1543 goto out_i;
1544 if (alloc_required) {
1545 al = gfs2_alloc_get(ip);
1546 if (al == NULL)
1547 goto out_i;
1548 gfs2_write_calc_reserv(ip, sizeof(struct gfs2_quota),
1549 &data_blocks, &ind_blocks);
1550 blocks = al->al_requested = 1 + data_blocks + ind_blocks;
1551 error = gfs2_inplace_reserve(ip);
1552 if (error)
1553 goto out_alloc;
1554 }
1555
1556 error = gfs2_trans_begin(sdp, blocks + RES_DINODE + 1, 0);
1557 if (error)
1558 goto out_release;
1559
1560 /* Apply changes */
1561 error = gfs2_adjust_quota(ip, offset, 0, qd, fdq);
1562
1563 gfs2_trans_end(sdp);
1564out_release:
1565 if (alloc_required) {
1566 gfs2_inplace_release(ip);
1567out_alloc:
1568 gfs2_alloc_put(ip);
1569 }
1570out_i:
1571 gfs2_glock_dq_uninit(&i_gh);
1572out_q:
1573 gfs2_glock_dq_uninit(&q_gh);
1574out_put:
1575 mutex_unlock(&ip->i_inode.i_mutex);
1576 qd_put(qd);
1577 return error;
1578}
1579
1580const struct quotactl_ops gfs2_quotactl_ops = {
1581 .quota_sync = gfs2_quota_sync,
1582 .get_xstate = gfs2_quota_get_xstate,
1583 .get_xquota = gfs2_xquota_get,
1584 .set_xquota = gfs2_xquota_set,
1585};
1586
diff --git a/fs/gfs2/quota.h b/fs/gfs2/quota.h
index 0fa5fa63d0e8..e271fa07ad02 100644
--- a/fs/gfs2/quota.h
+++ b/fs/gfs2/quota.h
@@ -25,13 +25,15 @@ extern int gfs2_quota_check(struct gfs2_inode *ip, u32 uid, u32 gid);
25extern void gfs2_quota_change(struct gfs2_inode *ip, s64 change, 25extern void gfs2_quota_change(struct gfs2_inode *ip, s64 change,
26 u32 uid, u32 gid); 26 u32 uid, u32 gid);
27 27
28extern int gfs2_quota_sync(struct gfs2_sbd *sdp); 28extern int gfs2_quota_sync(struct super_block *sb, int type);
29extern int gfs2_quota_refresh(struct gfs2_sbd *sdp, int user, u32 id); 29extern int gfs2_quota_refresh(struct gfs2_sbd *sdp, int user, u32 id);
30 30
31extern int gfs2_quota_init(struct gfs2_sbd *sdp); 31extern int gfs2_quota_init(struct gfs2_sbd *sdp);
32extern void gfs2_quota_cleanup(struct gfs2_sbd *sdp); 32extern void gfs2_quota_cleanup(struct gfs2_sbd *sdp);
33extern int gfs2_quotad(void *data); 33extern int gfs2_quotad(void *data);
34 34
35extern void gfs2_wake_up_statfs(struct gfs2_sbd *sdp);
36
35static inline int gfs2_quota_lock_check(struct gfs2_inode *ip) 37static inline int gfs2_quota_lock_check(struct gfs2_inode *ip)
36{ 38{
37 struct gfs2_sbd *sdp = GFS2_SB(&ip->i_inode); 39 struct gfs2_sbd *sdp = GFS2_SB(&ip->i_inode);
@@ -50,5 +52,6 @@ static inline int gfs2_quota_lock_check(struct gfs2_inode *ip)
50} 52}
51 53
52extern int gfs2_shrink_qd_memory(int nr, gfp_t gfp_mask); 54extern int gfs2_shrink_qd_memory(int nr, gfp_t gfp_mask);
55extern const struct quotactl_ops gfs2_quotactl_ops;
53 56
54#endif /* __QUOTA_DOT_H__ */ 57#endif /* __QUOTA_DOT_H__ */
diff --git a/fs/gfs2/recovery.c b/fs/gfs2/recovery.c
index 59d2695509d3..4b9bece3d437 100644
--- a/fs/gfs2/recovery.c
+++ b/fs/gfs2/recovery.c
@@ -7,6 +7,7 @@
7 * of the GNU General Public License version 2. 7 * of the GNU General Public License version 2.
8 */ 8 */
9 9
10#include <linux/module.h>
10#include <linux/slab.h> 11#include <linux/slab.h>
11#include <linux/spinlock.h> 12#include <linux/spinlock.h>
12#include <linux/completion.h> 13#include <linux/completion.h>
@@ -409,7 +410,9 @@ static int clean_journal(struct gfs2_jdesc *jd, struct gfs2_log_header_host *hea
409 memset(lh, 0, sizeof(struct gfs2_log_header)); 410 memset(lh, 0, sizeof(struct gfs2_log_header));
410 lh->lh_header.mh_magic = cpu_to_be32(GFS2_MAGIC); 411 lh->lh_header.mh_magic = cpu_to_be32(GFS2_MAGIC);
411 lh->lh_header.mh_type = cpu_to_be32(GFS2_METATYPE_LH); 412 lh->lh_header.mh_type = cpu_to_be32(GFS2_METATYPE_LH);
413 lh->lh_header.__pad0 = cpu_to_be64(0);
412 lh->lh_header.mh_format = cpu_to_be32(GFS2_FORMAT_LH); 414 lh->lh_header.mh_format = cpu_to_be32(GFS2_FORMAT_LH);
415 lh->lh_header.mh_jid = cpu_to_be32(sdp->sd_jdesc->jd_jid);
413 lh->lh_sequence = cpu_to_be64(head->lh_sequence + 1); 416 lh->lh_sequence = cpu_to_be64(head->lh_sequence + 1);
414 lh->lh_flags = cpu_to_be32(GFS2_LOG_HEAD_UNMOUNT); 417 lh->lh_flags = cpu_to_be32(GFS2_LOG_HEAD_UNMOUNT);
415 lh->lh_blkno = cpu_to_be32(lblock); 418 lh->lh_blkno = cpu_to_be32(lblock);
@@ -593,6 +596,7 @@ fail:
593} 596}
594 597
595struct slow_work_ops gfs2_recover_ops = { 598struct slow_work_ops gfs2_recover_ops = {
599 .owner = THIS_MODULE,
596 .get_ref = gfs2_recover_get_ref, 600 .get_ref = gfs2_recover_get_ref,
597 .put_ref = gfs2_recover_put_ref, 601 .put_ref = gfs2_recover_put_ref,
598 .execute = gfs2_recover_work, 602 .execute = gfs2_recover_work,
diff --git a/fs/gfs2/rgrp.c b/fs/gfs2/rgrp.c
index 8f1cfb02a6cb..0608f490c295 100644
--- a/fs/gfs2/rgrp.c
+++ b/fs/gfs2/rgrp.c
@@ -1710,11 +1710,16 @@ int gfs2_check_blk_type(struct gfs2_sbd *sdp, u64 no_addr, unsigned int type)
1710{ 1710{
1711 struct gfs2_rgrpd *rgd; 1711 struct gfs2_rgrpd *rgd;
1712 struct gfs2_holder ri_gh, rgd_gh; 1712 struct gfs2_holder ri_gh, rgd_gh;
1713 struct gfs2_inode *ip = GFS2_I(sdp->sd_rindex);
1714 int ri_locked = 0;
1713 int error; 1715 int error;
1714 1716
1715 error = gfs2_rindex_hold(sdp, &ri_gh); 1717 if (!gfs2_glock_is_locked_by_me(ip->i_gl)) {
1716 if (error) 1718 error = gfs2_rindex_hold(sdp, &ri_gh);
1717 goto fail; 1719 if (error)
1720 goto fail;
1721 ri_locked = 1;
1722 }
1718 1723
1719 error = -EINVAL; 1724 error = -EINVAL;
1720 rgd = gfs2_blk2rgrpd(sdp, no_addr); 1725 rgd = gfs2_blk2rgrpd(sdp, no_addr);
@@ -1730,7 +1735,8 @@ int gfs2_check_blk_type(struct gfs2_sbd *sdp, u64 no_addr, unsigned int type)
1730 1735
1731 gfs2_glock_dq_uninit(&rgd_gh); 1736 gfs2_glock_dq_uninit(&rgd_gh);
1732fail_rindex: 1737fail_rindex:
1733 gfs2_glock_dq_uninit(&ri_gh); 1738 if (ri_locked)
1739 gfs2_glock_dq_uninit(&ri_gh);
1734fail: 1740fail:
1735 return error; 1741 return error;
1736} 1742}
diff --git a/fs/gfs2/super.c b/fs/gfs2/super.c
index 0ec3ec672de1..c282ad41f3d1 100644
--- a/fs/gfs2/super.c
+++ b/fs/gfs2/super.c
@@ -70,6 +70,11 @@ enum {
70 Opt_commit, 70 Opt_commit,
71 Opt_err_withdraw, 71 Opt_err_withdraw,
72 Opt_err_panic, 72 Opt_err_panic,
73 Opt_statfs_quantum,
74 Opt_statfs_percent,
75 Opt_quota_quantum,
76 Opt_barrier,
77 Opt_nobarrier,
73 Opt_error, 78 Opt_error,
74}; 79};
75 80
@@ -101,18 +106,23 @@ static const match_table_t tokens = {
101 {Opt_commit, "commit=%d"}, 106 {Opt_commit, "commit=%d"},
102 {Opt_err_withdraw, "errors=withdraw"}, 107 {Opt_err_withdraw, "errors=withdraw"},
103 {Opt_err_panic, "errors=panic"}, 108 {Opt_err_panic, "errors=panic"},
109 {Opt_statfs_quantum, "statfs_quantum=%d"},
110 {Opt_statfs_percent, "statfs_percent=%d"},
111 {Opt_quota_quantum, "quota_quantum=%d"},
112 {Opt_barrier, "barrier"},
113 {Opt_nobarrier, "nobarrier"},
104 {Opt_error, NULL} 114 {Opt_error, NULL}
105}; 115};
106 116
107/** 117/**
108 * gfs2_mount_args - Parse mount options 118 * gfs2_mount_args - Parse mount options
109 * @sdp: 119 * @args: The structure into which the parsed options will be written
110 * @data: 120 * @options: The options to parse
111 * 121 *
112 * Return: errno 122 * Return: errno
113 */ 123 */
114 124
115int gfs2_mount_args(struct gfs2_sbd *sdp, struct gfs2_args *args, char *options) 125int gfs2_mount_args(struct gfs2_args *args, char *options)
116{ 126{
117 char *o; 127 char *o;
118 int token; 128 int token;
@@ -157,7 +167,7 @@ int gfs2_mount_args(struct gfs2_sbd *sdp, struct gfs2_args *args, char *options)
157 break; 167 break;
158 case Opt_debug: 168 case Opt_debug:
159 if (args->ar_errors == GFS2_ERRORS_PANIC) { 169 if (args->ar_errors == GFS2_ERRORS_PANIC) {
160 fs_info(sdp, "-o debug and -o errors=panic " 170 printk(KERN_WARNING "GFS2: -o debug and -o errors=panic "
161 "are mutually exclusive.\n"); 171 "are mutually exclusive.\n");
162 return -EINVAL; 172 return -EINVAL;
163 } 173 }
@@ -210,7 +220,29 @@ int gfs2_mount_args(struct gfs2_sbd *sdp, struct gfs2_args *args, char *options)
210 case Opt_commit: 220 case Opt_commit:
211 rv = match_int(&tmp[0], &args->ar_commit); 221 rv = match_int(&tmp[0], &args->ar_commit);
212 if (rv || args->ar_commit <= 0) { 222 if (rv || args->ar_commit <= 0) {
213 fs_info(sdp, "commit mount option requires a positive numeric argument\n"); 223 printk(KERN_WARNING "GFS2: commit mount option requires a positive numeric argument\n");
224 return rv ? rv : -EINVAL;
225 }
226 break;
227 case Opt_statfs_quantum:
228 rv = match_int(&tmp[0], &args->ar_statfs_quantum);
229 if (rv || args->ar_statfs_quantum < 0) {
230 printk(KERN_WARNING "GFS2: statfs_quantum mount option requires a non-negative numeric argument\n");
231 return rv ? rv : -EINVAL;
232 }
233 break;
234 case Opt_quota_quantum:
235 rv = match_int(&tmp[0], &args->ar_quota_quantum);
236 if (rv || args->ar_quota_quantum <= 0) {
237 printk(KERN_WARNING "GFS2: quota_quantum mount option requires a positive numeric argument\n");
238 return rv ? rv : -EINVAL;
239 }
240 break;
241 case Opt_statfs_percent:
242 rv = match_int(&tmp[0], &args->ar_statfs_percent);
243 if (rv || args->ar_statfs_percent < 0 ||
244 args->ar_statfs_percent > 100) {
245 printk(KERN_WARNING "statfs_percent mount option requires a numeric argument between 0 and 100\n");
214 return rv ? rv : -EINVAL; 246 return rv ? rv : -EINVAL;
215 } 247 }
216 break; 248 break;
@@ -219,15 +251,21 @@ int gfs2_mount_args(struct gfs2_sbd *sdp, struct gfs2_args *args, char *options)
219 break; 251 break;
220 case Opt_err_panic: 252 case Opt_err_panic:
221 if (args->ar_debug) { 253 if (args->ar_debug) {
222 fs_info(sdp, "-o debug and -o errors=panic " 254 printk(KERN_WARNING "GFS2: -o debug and -o errors=panic "
223 "are mutually exclusive.\n"); 255 "are mutually exclusive.\n");
224 return -EINVAL; 256 return -EINVAL;
225 } 257 }
226 args->ar_errors = GFS2_ERRORS_PANIC; 258 args->ar_errors = GFS2_ERRORS_PANIC;
227 break; 259 break;
260 case Opt_barrier:
261 args->ar_nobarrier = 0;
262 break;
263 case Opt_nobarrier:
264 args->ar_nobarrier = 1;
265 break;
228 case Opt_error: 266 case Opt_error:
229 default: 267 default:
230 fs_info(sdp, "invalid mount option: %s\n", o); 268 printk(KERN_WARNING "GFS2: invalid mount option: %s\n", o);
231 return -EINVAL; 269 return -EINVAL;
232 } 270 }
233 } 271 }
@@ -442,7 +480,10 @@ void gfs2_statfs_change(struct gfs2_sbd *sdp, s64 total, s64 free,
442{ 480{
443 struct gfs2_inode *l_ip = GFS2_I(sdp->sd_sc_inode); 481 struct gfs2_inode *l_ip = GFS2_I(sdp->sd_sc_inode);
444 struct gfs2_statfs_change_host *l_sc = &sdp->sd_statfs_local; 482 struct gfs2_statfs_change_host *l_sc = &sdp->sd_statfs_local;
483 struct gfs2_statfs_change_host *m_sc = &sdp->sd_statfs_master;
445 struct buffer_head *l_bh; 484 struct buffer_head *l_bh;
485 s64 x, y;
486 int need_sync = 0;
446 int error; 487 int error;
447 488
448 error = gfs2_meta_inode_buffer(l_ip, &l_bh); 489 error = gfs2_meta_inode_buffer(l_ip, &l_bh);
@@ -456,9 +497,17 @@ void gfs2_statfs_change(struct gfs2_sbd *sdp, s64 total, s64 free,
456 l_sc->sc_free += free; 497 l_sc->sc_free += free;
457 l_sc->sc_dinodes += dinodes; 498 l_sc->sc_dinodes += dinodes;
458 gfs2_statfs_change_out(l_sc, l_bh->b_data + sizeof(struct gfs2_dinode)); 499 gfs2_statfs_change_out(l_sc, l_bh->b_data + sizeof(struct gfs2_dinode));
500 if (sdp->sd_args.ar_statfs_percent) {
501 x = 100 * l_sc->sc_free;
502 y = m_sc->sc_free * sdp->sd_args.ar_statfs_percent;
503 if (x >= y || x <= -y)
504 need_sync = 1;
505 }
459 spin_unlock(&sdp->sd_statfs_spin); 506 spin_unlock(&sdp->sd_statfs_spin);
460 507
461 brelse(l_bh); 508 brelse(l_bh);
509 if (need_sync)
510 gfs2_wake_up_statfs(sdp);
462} 511}
463 512
464void update_statfs(struct gfs2_sbd *sdp, struct buffer_head *m_bh, 513void update_statfs(struct gfs2_sbd *sdp, struct buffer_head *m_bh,
@@ -484,8 +533,9 @@ void update_statfs(struct gfs2_sbd *sdp, struct buffer_head *m_bh,
484 gfs2_statfs_change_out(m_sc, m_bh->b_data + sizeof(struct gfs2_dinode)); 533 gfs2_statfs_change_out(m_sc, m_bh->b_data + sizeof(struct gfs2_dinode));
485} 534}
486 535
487int gfs2_statfs_sync(struct gfs2_sbd *sdp) 536int gfs2_statfs_sync(struct super_block *sb, int type)
488{ 537{
538 struct gfs2_sbd *sdp = sb->s_fs_info;
489 struct gfs2_inode *m_ip = GFS2_I(sdp->sd_statfs_inode); 539 struct gfs2_inode *m_ip = GFS2_I(sdp->sd_statfs_inode);
490 struct gfs2_inode *l_ip = GFS2_I(sdp->sd_sc_inode); 540 struct gfs2_inode *l_ip = GFS2_I(sdp->sd_sc_inode);
491 struct gfs2_statfs_change_host *m_sc = &sdp->sd_statfs_master; 541 struct gfs2_statfs_change_host *m_sc = &sdp->sd_statfs_master;
@@ -521,6 +571,7 @@ int gfs2_statfs_sync(struct gfs2_sbd *sdp)
521 goto out_bh2; 571 goto out_bh2;
522 572
523 update_statfs(sdp, m_bh, l_bh); 573 update_statfs(sdp, m_bh, l_bh);
574 sdp->sd_statfs_force_sync = 0;
524 575
525 gfs2_trans_end(sdp); 576 gfs2_trans_end(sdp);
526 577
@@ -712,8 +763,8 @@ static int gfs2_make_fs_ro(struct gfs2_sbd *sdp)
712 int error; 763 int error;
713 764
714 flush_workqueue(gfs2_delete_workqueue); 765 flush_workqueue(gfs2_delete_workqueue);
715 gfs2_quota_sync(sdp); 766 gfs2_quota_sync(sdp->sd_vfs, 0);
716 gfs2_statfs_sync(sdp); 767 gfs2_statfs_sync(sdp->sd_vfs, 0);
717 768
718 error = gfs2_glock_nq_init(sdp->sd_trans_gl, LM_ST_SHARED, GL_NOCACHE, 769 error = gfs2_glock_nq_init(sdp->sd_trans_gl, LM_ST_SHARED, GL_NOCACHE,
719 &t_gh); 770 &t_gh);
@@ -1061,8 +1112,13 @@ static int gfs2_remount_fs(struct super_block *sb, int *flags, char *data)
1061 1112
1062 spin_lock(&gt->gt_spin); 1113 spin_lock(&gt->gt_spin);
1063 args.ar_commit = gt->gt_log_flush_secs; 1114 args.ar_commit = gt->gt_log_flush_secs;
1115 args.ar_quota_quantum = gt->gt_quota_quantum;
1116 if (gt->gt_statfs_slow)
1117 args.ar_statfs_quantum = 0;
1118 else
1119 args.ar_statfs_quantum = gt->gt_statfs_quantum;
1064 spin_unlock(&gt->gt_spin); 1120 spin_unlock(&gt->gt_spin);
1065 error = gfs2_mount_args(sdp, &args, data); 1121 error = gfs2_mount_args(&args, data);
1066 if (error) 1122 if (error)
1067 return error; 1123 return error;
1068 1124
@@ -1097,8 +1153,21 @@ static int gfs2_remount_fs(struct super_block *sb, int *flags, char *data)
1097 sb->s_flags |= MS_POSIXACL; 1153 sb->s_flags |= MS_POSIXACL;
1098 else 1154 else
1099 sb->s_flags &= ~MS_POSIXACL; 1155 sb->s_flags &= ~MS_POSIXACL;
1156 if (sdp->sd_args.ar_nobarrier)
1157 set_bit(SDF_NOBARRIERS, &sdp->sd_flags);
1158 else
1159 clear_bit(SDF_NOBARRIERS, &sdp->sd_flags);
1100 spin_lock(&gt->gt_spin); 1160 spin_lock(&gt->gt_spin);
1101 gt->gt_log_flush_secs = args.ar_commit; 1161 gt->gt_log_flush_secs = args.ar_commit;
1162 gt->gt_quota_quantum = args.ar_quota_quantum;
1163 if (args.ar_statfs_quantum) {
1164 gt->gt_statfs_slow = 0;
1165 gt->gt_statfs_quantum = args.ar_statfs_quantum;
1166 }
1167 else {
1168 gt->gt_statfs_slow = 1;
1169 gt->gt_statfs_quantum = 30;
1170 }
1102 spin_unlock(&gt->gt_spin); 1171 spin_unlock(&gt->gt_spin);
1103 1172
1104 gfs2_online_uevent(sdp); 1173 gfs2_online_uevent(sdp);
@@ -1179,7 +1248,7 @@ static int gfs2_show_options(struct seq_file *s, struct vfsmount *mnt)
1179{ 1248{
1180 struct gfs2_sbd *sdp = mnt->mnt_sb->s_fs_info; 1249 struct gfs2_sbd *sdp = mnt->mnt_sb->s_fs_info;
1181 struct gfs2_args *args = &sdp->sd_args; 1250 struct gfs2_args *args = &sdp->sd_args;
1182 int lfsecs; 1251 int val;
1183 1252
1184 if (is_ancestor(mnt->mnt_root, sdp->sd_master_dir)) 1253 if (is_ancestor(mnt->mnt_root, sdp->sd_master_dir))
1185 seq_printf(s, ",meta"); 1254 seq_printf(s, ",meta");
@@ -1240,9 +1309,17 @@ static int gfs2_show_options(struct seq_file *s, struct vfsmount *mnt)
1240 } 1309 }
1241 if (args->ar_discard) 1310 if (args->ar_discard)
1242 seq_printf(s, ",discard"); 1311 seq_printf(s, ",discard");
1243 lfsecs = sdp->sd_tune.gt_log_flush_secs; 1312 val = sdp->sd_tune.gt_log_flush_secs;
1244 if (lfsecs != 60) 1313 if (val != 60)
1245 seq_printf(s, ",commit=%d", lfsecs); 1314 seq_printf(s, ",commit=%d", val);
1315 val = sdp->sd_tune.gt_statfs_quantum;
1316 if (val != 30)
1317 seq_printf(s, ",statfs_quantum=%d", val);
1318 val = sdp->sd_tune.gt_quota_quantum;
1319 if (val != 60)
1320 seq_printf(s, ",quota_quantum=%d", val);
1321 if (args->ar_statfs_percent)
1322 seq_printf(s, ",statfs_percent=%d", args->ar_statfs_percent);
1246 if (args->ar_errors != GFS2_ERRORS_DEFAULT) { 1323 if (args->ar_errors != GFS2_ERRORS_DEFAULT) {
1247 const char *state; 1324 const char *state;
1248 1325
@@ -1259,6 +1336,9 @@ static int gfs2_show_options(struct seq_file *s, struct vfsmount *mnt)
1259 } 1336 }
1260 seq_printf(s, ",errors=%s", state); 1337 seq_printf(s, ",errors=%s", state);
1261 } 1338 }
1339 if (test_bit(SDF_NOBARRIERS, &sdp->sd_flags))
1340 seq_printf(s, ",nobarrier");
1341
1262 return 0; 1342 return 0;
1263} 1343}
1264 1344
diff --git a/fs/gfs2/super.h b/fs/gfs2/super.h
index 235db3682885..3df60f2d84e3 100644
--- a/fs/gfs2/super.h
+++ b/fs/gfs2/super.h
@@ -27,7 +27,7 @@ static inline unsigned int gfs2_jindex_size(struct gfs2_sbd *sdp)
27 27
28extern void gfs2_jindex_free(struct gfs2_sbd *sdp); 28extern void gfs2_jindex_free(struct gfs2_sbd *sdp);
29 29
30extern int gfs2_mount_args(struct gfs2_sbd *sdp, struct gfs2_args *args, char *data); 30extern int gfs2_mount_args(struct gfs2_args *args, char *data);
31 31
32extern struct gfs2_jdesc *gfs2_jdesc_find(struct gfs2_sbd *sdp, unsigned int jid); 32extern struct gfs2_jdesc *gfs2_jdesc_find(struct gfs2_sbd *sdp, unsigned int jid);
33extern int gfs2_jdesc_check(struct gfs2_jdesc *jd); 33extern int gfs2_jdesc_check(struct gfs2_jdesc *jd);
@@ -44,7 +44,7 @@ extern void gfs2_statfs_change_in(struct gfs2_statfs_change_host *sc,
44 const void *buf); 44 const void *buf);
45extern void update_statfs(struct gfs2_sbd *sdp, struct buffer_head *m_bh, 45extern void update_statfs(struct gfs2_sbd *sdp, struct buffer_head *m_bh,
46 struct buffer_head *l_bh); 46 struct buffer_head *l_bh);
47extern int gfs2_statfs_sync(struct gfs2_sbd *sdp); 47extern int gfs2_statfs_sync(struct super_block *sb, int type);
48 48
49extern int gfs2_freeze_fs(struct gfs2_sbd *sdp); 49extern int gfs2_freeze_fs(struct gfs2_sbd *sdp);
50extern void gfs2_unfreeze_fs(struct gfs2_sbd *sdp); 50extern void gfs2_unfreeze_fs(struct gfs2_sbd *sdp);
diff --git a/fs/gfs2/sys.c b/fs/gfs2/sys.c
index 446329728d52..c5dad1eb7b91 100644
--- a/fs/gfs2/sys.c
+++ b/fs/gfs2/sys.c
@@ -158,7 +158,7 @@ static ssize_t statfs_sync_store(struct gfs2_sbd *sdp, const char *buf,
158 if (simple_strtol(buf, NULL, 0) != 1) 158 if (simple_strtol(buf, NULL, 0) != 1)
159 return -EINVAL; 159 return -EINVAL;
160 160
161 gfs2_statfs_sync(sdp); 161 gfs2_statfs_sync(sdp->sd_vfs, 0);
162 return len; 162 return len;
163} 163}
164 164
@@ -171,13 +171,14 @@ static ssize_t quota_sync_store(struct gfs2_sbd *sdp, const char *buf,
171 if (simple_strtol(buf, NULL, 0) != 1) 171 if (simple_strtol(buf, NULL, 0) != 1)
172 return -EINVAL; 172 return -EINVAL;
173 173
174 gfs2_quota_sync(sdp); 174 gfs2_quota_sync(sdp->sd_vfs, 0);
175 return len; 175 return len;
176} 176}
177 177
178static ssize_t quota_refresh_user_store(struct gfs2_sbd *sdp, const char *buf, 178static ssize_t quota_refresh_user_store(struct gfs2_sbd *sdp, const char *buf,
179 size_t len) 179 size_t len)
180{ 180{
181 int error;
181 u32 id; 182 u32 id;
182 183
183 if (!capable(CAP_SYS_ADMIN)) 184 if (!capable(CAP_SYS_ADMIN))
@@ -185,13 +186,14 @@ static ssize_t quota_refresh_user_store(struct gfs2_sbd *sdp, const char *buf,
185 186
186 id = simple_strtoul(buf, NULL, 0); 187 id = simple_strtoul(buf, NULL, 0);
187 188
188 gfs2_quota_refresh(sdp, 1, id); 189 error = gfs2_quota_refresh(sdp, 1, id);
189 return len; 190 return error ? error : len;
190} 191}
191 192
192static ssize_t quota_refresh_group_store(struct gfs2_sbd *sdp, const char *buf, 193static ssize_t quota_refresh_group_store(struct gfs2_sbd *sdp, const char *buf,
193 size_t len) 194 size_t len)
194{ 195{
196 int error;
195 u32 id; 197 u32 id;
196 198
197 if (!capable(CAP_SYS_ADMIN)) 199 if (!capable(CAP_SYS_ADMIN))
@@ -199,8 +201,8 @@ static ssize_t quota_refresh_group_store(struct gfs2_sbd *sdp, const char *buf,
199 201
200 id = simple_strtoul(buf, NULL, 0); 202 id = simple_strtoul(buf, NULL, 0);
201 203
202 gfs2_quota_refresh(sdp, 0, id); 204 error = gfs2_quota_refresh(sdp, 0, id);
203 return len; 205 return error ? error : len;
204} 206}
205 207
206static ssize_t demote_rq_store(struct gfs2_sbd *sdp, const char *buf, size_t len) 208static ssize_t demote_rq_store(struct gfs2_sbd *sdp, const char *buf, size_t len)
diff --git a/fs/gfs2/xattr.c b/fs/gfs2/xattr.c
index 8a0f8ef6ee27..912f5cbc4740 100644
--- a/fs/gfs2/xattr.c
+++ b/fs/gfs2/xattr.c
@@ -186,8 +186,8 @@ static int ea_find_i(struct gfs2_inode *ip, struct buffer_head *bh,
186 return 0; 186 return 0;
187} 187}
188 188
189int gfs2_ea_find(struct gfs2_inode *ip, int type, const char *name, 189static int gfs2_ea_find(struct gfs2_inode *ip, int type, const char *name,
190 struct gfs2_ea_location *el) 190 struct gfs2_ea_location *el)
191{ 191{
192 struct ea_find ef; 192 struct ea_find ef;
193 int error; 193 int error;
@@ -516,8 +516,8 @@ out:
516 return error; 516 return error;
517} 517}
518 518
519int gfs2_ea_get_copy(struct gfs2_inode *ip, struct gfs2_ea_location *el, 519static int gfs2_ea_get_copy(struct gfs2_inode *ip, struct gfs2_ea_location *el,
520 char *data, size_t size) 520 char *data, size_t size)
521{ 521{
522 int ret; 522 int ret;
523 size_t len = GFS2_EA_DATA_LEN(el->el_ea); 523 size_t len = GFS2_EA_DATA_LEN(el->el_ea);
@@ -534,6 +534,36 @@ int gfs2_ea_get_copy(struct gfs2_inode *ip, struct gfs2_ea_location *el,
534 return len; 534 return len;
535} 535}
536 536
537int gfs2_xattr_acl_get(struct gfs2_inode *ip, const char *name, char **ppdata)
538{
539 struct gfs2_ea_location el;
540 int error;
541 int len;
542 char *data;
543
544 error = gfs2_ea_find(ip, GFS2_EATYPE_SYS, name, &el);
545 if (error)
546 return error;
547 if (!el.el_ea)
548 goto out;
549 if (!GFS2_EA_DATA_LEN(el.el_ea))
550 goto out;
551
552 len = GFS2_EA_DATA_LEN(el.el_ea);
553 data = kmalloc(len, GFP_NOFS);
554 error = -ENOMEM;
555 if (data == NULL)
556 goto out;
557
558 error = gfs2_ea_get_copy(ip, &el, data, len);
559 if (error == 0)
560 error = len;
561 *ppdata = data;
562out:
563 brelse(el.el_bh);
564 return error;
565}
566
537/** 567/**
538 * gfs2_xattr_get - Get a GFS2 extended attribute 568 * gfs2_xattr_get - Get a GFS2 extended attribute
539 * @inode: The inode 569 * @inode: The inode
@@ -1259,22 +1289,26 @@ fail:
1259 return error; 1289 return error;
1260} 1290}
1261 1291
1262int gfs2_ea_acl_chmod(struct gfs2_inode *ip, struct gfs2_ea_location *el, 1292int gfs2_xattr_acl_chmod(struct gfs2_inode *ip, struct iattr *attr, char *data)
1263 struct iattr *attr, char *data)
1264{ 1293{
1294 struct gfs2_ea_location el;
1265 struct buffer_head *dibh; 1295 struct buffer_head *dibh;
1266 int error; 1296 int error;
1267 1297
1268 if (GFS2_EA_IS_STUFFED(el->el_ea)) { 1298 error = gfs2_ea_find(ip, GFS2_EATYPE_SYS, GFS2_POSIX_ACL_ACCESS, &el);
1299 if (error)
1300 return error;
1301
1302 if (GFS2_EA_IS_STUFFED(el.el_ea)) {
1269 error = gfs2_trans_begin(GFS2_SB(&ip->i_inode), RES_DINODE + RES_EATTR, 0); 1303 error = gfs2_trans_begin(GFS2_SB(&ip->i_inode), RES_DINODE + RES_EATTR, 0);
1270 if (error) 1304 if (error)
1271 return error; 1305 return error;
1272 1306
1273 gfs2_trans_add_bh(ip->i_gl, el->el_bh, 1); 1307 gfs2_trans_add_bh(ip->i_gl, el.el_bh, 1);
1274 memcpy(GFS2_EA2DATA(el->el_ea), data, 1308 memcpy(GFS2_EA2DATA(el.el_ea), data,
1275 GFS2_EA_DATA_LEN(el->el_ea)); 1309 GFS2_EA_DATA_LEN(el.el_ea));
1276 } else 1310 } else
1277 error = ea_acl_chmod_unstuffed(ip, el->el_ea, data); 1311 error = ea_acl_chmod_unstuffed(ip, el.el_ea, data);
1278 1312
1279 if (error) 1313 if (error)
1280 return error; 1314 return error;
@@ -1507,18 +1541,6 @@ static int gfs2_xattr_user_set(struct inode *inode, const char *name,
1507 return gfs2_xattr_set(inode, GFS2_EATYPE_USR, name, value, size, flags); 1541 return gfs2_xattr_set(inode, GFS2_EATYPE_USR, name, value, size, flags);
1508} 1542}
1509 1543
1510static int gfs2_xattr_system_get(struct inode *inode, const char *name,
1511 void *buffer, size_t size)
1512{
1513 return gfs2_xattr_get(inode, GFS2_EATYPE_SYS, name, buffer, size);
1514}
1515
1516static int gfs2_xattr_system_set(struct inode *inode, const char *name,
1517 const void *value, size_t size, int flags)
1518{
1519 return gfs2_xattr_set(inode, GFS2_EATYPE_SYS, name, value, size, flags);
1520}
1521
1522static int gfs2_xattr_security_get(struct inode *inode, const char *name, 1544static int gfs2_xattr_security_get(struct inode *inode, const char *name,
1523 void *buffer, size_t size) 1545 void *buffer, size_t size)
1524{ 1546{
@@ -1543,12 +1565,6 @@ static struct xattr_handler gfs2_xattr_security_handler = {
1543 .set = gfs2_xattr_security_set, 1565 .set = gfs2_xattr_security_set,
1544}; 1566};
1545 1567
1546static struct xattr_handler gfs2_xattr_system_handler = {
1547 .prefix = XATTR_SYSTEM_PREFIX,
1548 .get = gfs2_xattr_system_get,
1549 .set = gfs2_xattr_system_set,
1550};
1551
1552struct xattr_handler *gfs2_xattr_handlers[] = { 1568struct xattr_handler *gfs2_xattr_handlers[] = {
1553 &gfs2_xattr_user_handler, 1569 &gfs2_xattr_user_handler,
1554 &gfs2_xattr_security_handler, 1570 &gfs2_xattr_security_handler,
diff --git a/fs/gfs2/xattr.h b/fs/gfs2/xattr.h
index cbdfd7743733..8d6ae5813c4d 100644
--- a/fs/gfs2/xattr.h
+++ b/fs/gfs2/xattr.h
@@ -62,11 +62,7 @@ extern int gfs2_ea_dealloc(struct gfs2_inode *ip);
62 62
63/* Exported to acl.c */ 63/* Exported to acl.c */
64 64
65extern int gfs2_ea_find(struct gfs2_inode *ip, int type, const char *name, 65extern int gfs2_xattr_acl_get(struct gfs2_inode *ip, const char *name, char **data);
66 struct gfs2_ea_location *el); 66extern int gfs2_xattr_acl_chmod(struct gfs2_inode *ip, struct iattr *attr, char *data);
67extern int gfs2_ea_get_copy(struct gfs2_inode *ip, struct gfs2_ea_location *el,
68 char *data, size_t size);
69extern int gfs2_ea_acl_chmod(struct gfs2_inode *ip, struct gfs2_ea_location *el,
70 struct iattr *attr, char *data);
71 67
72#endif /* __EATTR_DOT_H__ */ 68#endif /* __EATTR_DOT_H__ */
diff --git a/fs/inode.c b/fs/inode.c
index 4d8e3be55976..06c1f02de611 100644
--- a/fs/inode.c
+++ b/fs/inode.c
@@ -18,7 +18,6 @@
18#include <linux/hash.h> 18#include <linux/hash.h>
19#include <linux/swap.h> 19#include <linux/swap.h>
20#include <linux/security.h> 20#include <linux/security.h>
21#include <linux/ima.h>
22#include <linux/pagemap.h> 21#include <linux/pagemap.h>
23#include <linux/cdev.h> 22#include <linux/cdev.h>
24#include <linux/bootmem.h> 23#include <linux/bootmem.h>
@@ -157,11 +156,6 @@ int inode_init_always(struct super_block *sb, struct inode *inode)
157 156
158 if (security_inode_alloc(inode)) 157 if (security_inode_alloc(inode))
159 goto out; 158 goto out;
160
161 /* allocate and initialize an i_integrity */
162 if (ima_inode_alloc(inode))
163 goto out_free_security;
164
165 spin_lock_init(&inode->i_lock); 159 spin_lock_init(&inode->i_lock);
166 lockdep_set_class(&inode->i_lock, &sb->s_type->i_lock_key); 160 lockdep_set_class(&inode->i_lock, &sb->s_type->i_lock_key);
167 161
@@ -201,9 +195,6 @@ int inode_init_always(struct super_block *sb, struct inode *inode)
201#endif 195#endif
202 196
203 return 0; 197 return 0;
204
205out_free_security:
206 security_inode_free(inode);
207out: 198out:
208 return -ENOMEM; 199 return -ENOMEM;
209} 200}
@@ -235,7 +226,6 @@ static struct inode *alloc_inode(struct super_block *sb)
235void __destroy_inode(struct inode *inode) 226void __destroy_inode(struct inode *inode)
236{ 227{
237 BUG_ON(inode_has_buffers(inode)); 228 BUG_ON(inode_has_buffers(inode));
238 ima_inode_free(inode);
239 security_inode_free(inode); 229 security_inode_free(inode);
240 fsnotify_inode_delete(inode); 230 fsnotify_inode_delete(inode);
241#ifdef CONFIG_FS_POSIX_ACL 231#ifdef CONFIG_FS_POSIX_ACL
diff --git a/fs/ioctl.c b/fs/ioctl.c
index 7b17a14396ff..6c751106c2e5 100644
--- a/fs/ioctl.c
+++ b/fs/ioctl.c
@@ -254,7 +254,7 @@ int __generic_block_fiemap(struct inode *inode,
254 u64 len, get_block_t *get_block) 254 u64 len, get_block_t *get_block)
255{ 255{
256 struct buffer_head tmp; 256 struct buffer_head tmp;
257 unsigned int start_blk; 257 unsigned long long start_blk;
258 long long length = 0, map_len = 0; 258 long long length = 0, map_len = 0;
259 u64 logical = 0, phys = 0, size = 0; 259 u64 logical = 0, phys = 0, size = 0;
260 u32 flags = FIEMAP_EXTENT_MERGED; 260 u32 flags = FIEMAP_EXTENT_MERGED;
diff --git a/fs/jbd/journal.c b/fs/jbd/journal.c
index bd3c073b485d..4160afad6d00 100644
--- a/fs/jbd/journal.c
+++ b/fs/jbd/journal.c
@@ -73,6 +73,7 @@ EXPORT_SYMBOL(journal_errno);
73EXPORT_SYMBOL(journal_ack_err); 73EXPORT_SYMBOL(journal_ack_err);
74EXPORT_SYMBOL(journal_clear_err); 74EXPORT_SYMBOL(journal_clear_err);
75EXPORT_SYMBOL(log_wait_commit); 75EXPORT_SYMBOL(log_wait_commit);
76EXPORT_SYMBOL(log_start_commit);
76EXPORT_SYMBOL(journal_start_commit); 77EXPORT_SYMBOL(journal_start_commit);
77EXPORT_SYMBOL(journal_force_commit_nested); 78EXPORT_SYMBOL(journal_force_commit_nested);
78EXPORT_SYMBOL(journal_wipe); 79EXPORT_SYMBOL(journal_wipe);
@@ -756,6 +757,7 @@ journal_t * journal_init_dev(struct block_device *bdev,
756 757
757 return journal; 758 return journal;
758out_err: 759out_err:
760 kfree(journal->j_wbuf);
759 kfree(journal); 761 kfree(journal);
760 return NULL; 762 return NULL;
761} 763}
@@ -820,6 +822,7 @@ journal_t * journal_init_inode (struct inode *inode)
820 822
821 return journal; 823 return journal;
822out_err: 824out_err:
825 kfree(journal->j_wbuf);
823 kfree(journal); 826 kfree(journal);
824 return NULL; 827 return NULL;
825} 828}
diff --git a/fs/jbd2/journal.c b/fs/jbd2/journal.c
index b0ab5219becb..fed85388ee86 100644
--- a/fs/jbd2/journal.c
+++ b/fs/jbd2/journal.c
@@ -913,6 +913,7 @@ journal_t * jbd2_journal_init_dev(struct block_device *bdev,
913 913
914 return journal; 914 return journal;
915out_err: 915out_err:
916 kfree(journal->j_wbuf);
916 jbd2_stats_proc_exit(journal); 917 jbd2_stats_proc_exit(journal);
917 kfree(journal); 918 kfree(journal);
918 return NULL; 919 return NULL;
@@ -986,6 +987,7 @@ journal_t * jbd2_journal_init_inode (struct inode *inode)
986 987
987 return journal; 988 return journal;
988out_err: 989out_err:
990 kfree(journal->j_wbuf);
989 jbd2_stats_proc_exit(journal); 991 jbd2_stats_proc_exit(journal);
990 kfree(journal); 992 kfree(journal);
991 return NULL; 993 return NULL;
diff --git a/fs/jffs2/read.c b/fs/jffs2/read.c
index cfe05c1966a5..3f39be1b0455 100644
--- a/fs/jffs2/read.c
+++ b/fs/jffs2/read.c
@@ -164,12 +164,15 @@ int jffs2_read_inode_range(struct jffs2_sb_info *c, struct jffs2_inode_info *f,
164 164
165 /* XXX FIXME: Where a single physical node actually shows up in two 165 /* XXX FIXME: Where a single physical node actually shows up in two
166 frags, we read it twice. Don't do that. */ 166 frags, we read it twice. Don't do that. */
167 /* Now we're pointing at the first frag which overlaps our page */ 167 /* Now we're pointing at the first frag which overlaps our page
168 * (or perhaps is before it, if we've been asked to read off the
169 * end of the file). */
168 while(offset < end) { 170 while(offset < end) {
169 D2(printk(KERN_DEBUG "jffs2_read_inode_range: offset %d, end %d\n", offset, end)); 171 D2(printk(KERN_DEBUG "jffs2_read_inode_range: offset %d, end %d\n", offset, end));
170 if (unlikely(!frag || frag->ofs > offset)) { 172 if (unlikely(!frag || frag->ofs > offset ||
173 frag->ofs + frag->size <= offset)) {
171 uint32_t holesize = end - offset; 174 uint32_t holesize = end - offset;
172 if (frag) { 175 if (frag && frag->ofs > offset) {
173 D1(printk(KERN_NOTICE "Eep. Hole in ino #%u fraglist. frag->ofs = 0x%08x, offset = 0x%08x\n", f->inocache->ino, frag->ofs, offset)); 176 D1(printk(KERN_NOTICE "Eep. Hole in ino #%u fraglist. frag->ofs = 0x%08x, offset = 0x%08x\n", f->inocache->ino, frag->ofs, offset));
174 holesize = min(holesize, frag->ofs - offset); 177 holesize = min(holesize, frag->ofs - offset);
175 } 178 }
diff --git a/fs/namespace.c b/fs/namespace.c
index bdc3cb4fd222..7d70d63ceb29 100644
--- a/fs/namespace.c
+++ b/fs/namespace.c
@@ -1921,6 +1921,16 @@ long do_mount(char *dev_name, char *dir_name, char *type_page,
1921 if (data_page) 1921 if (data_page)
1922 ((char *)data_page)[PAGE_SIZE - 1] = 0; 1922 ((char *)data_page)[PAGE_SIZE - 1] = 0;
1923 1923
1924 /* ... and get the mountpoint */
1925 retval = kern_path(dir_name, LOOKUP_FOLLOW, &path);
1926 if (retval)
1927 return retval;
1928
1929 retval = security_sb_mount(dev_name, &path,
1930 type_page, flags, data_page);
1931 if (retval)
1932 goto dput_out;
1933
1924 /* Default to relatime unless overriden */ 1934 /* Default to relatime unless overriden */
1925 if (!(flags & MS_NOATIME)) 1935 if (!(flags & MS_NOATIME))
1926 mnt_flags |= MNT_RELATIME; 1936 mnt_flags |= MNT_RELATIME;
@@ -1945,16 +1955,6 @@ long do_mount(char *dev_name, char *dir_name, char *type_page,
1945 MS_NOATIME | MS_NODIRATIME | MS_RELATIME| MS_KERNMOUNT | 1955 MS_NOATIME | MS_NODIRATIME | MS_RELATIME| MS_KERNMOUNT |
1946 MS_STRICTATIME); 1956 MS_STRICTATIME);
1947 1957
1948 /* ... and get the mountpoint */
1949 retval = kern_path(dir_name, LOOKUP_FOLLOW, &path);
1950 if (retval)
1951 return retval;
1952
1953 retval = security_sb_mount(dev_name, &path,
1954 type_page, flags, data_page);
1955 if (retval)
1956 goto dput_out;
1957
1958 if (flags & MS_REMOUNT) 1958 if (flags & MS_REMOUNT)
1959 retval = do_remount(&path, flags & ~MS_REMOUNT, mnt_flags, 1959 retval = do_remount(&path, flags & ~MS_REMOUNT, mnt_flags,
1960 data_page); 1960 data_page);
diff --git a/fs/nfs/fscache.c b/fs/nfs/fscache.c
index 70fad69eb959..fa588006588d 100644
--- a/fs/nfs/fscache.c
+++ b/fs/nfs/fscache.c
@@ -359,17 +359,13 @@ int nfs_fscache_release_page(struct page *page, gfp_t gfp)
359 359
360 BUG_ON(!cookie); 360 BUG_ON(!cookie);
361 361
362 if (fscache_check_page_write(cookie, page)) {
363 if (!(gfp & __GFP_WAIT))
364 return 0;
365 fscache_wait_on_page_write(cookie, page);
366 }
367
368 if (PageFsCache(page)) { 362 if (PageFsCache(page)) {
369 dfprintk(FSCACHE, "NFS: fscache releasepage (0x%p/0x%p/0x%p)\n", 363 dfprintk(FSCACHE, "NFS: fscache releasepage (0x%p/0x%p/0x%p)\n",
370 cookie, page, nfsi); 364 cookie, page, nfsi);
371 365
372 fscache_uncache_page(cookie, page); 366 if (!fscache_maybe_release_page(cookie, page, gfp))
367 return 0;
368
373 nfs_add_fscache_stats(page->mapping->host, 369 nfs_add_fscache_stats(page->mapping->host,
374 NFSIOS_FSCACHE_PAGES_UNCACHED, 1); 370 NFSIOS_FSCACHE_PAGES_UNCACHED, 1);
375 } 371 }
diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c
index ff37454fa783..741a562177fc 100644
--- a/fs/nfs/nfs4proc.c
+++ b/fs/nfs/nfs4proc.c
@@ -2767,7 +2767,7 @@ static int _nfs4_proc_readdir(struct dentry *dentry, struct rpc_cred *cred,
2767 .pages = &page, 2767 .pages = &page,
2768 .pgbase = 0, 2768 .pgbase = 0,
2769 .count = count, 2769 .count = count,
2770 .bitmask = NFS_SERVER(dentry->d_inode)->cache_consistency_bitmask, 2770 .bitmask = NFS_SERVER(dentry->d_inode)->attr_bitmask,
2771 }; 2771 };
2772 struct nfs4_readdir_res res; 2772 struct nfs4_readdir_res res;
2773 struct rpc_message msg = { 2773 struct rpc_message msg = {
diff --git a/fs/nfsd/nfs3xdr.c b/fs/nfsd/nfs3xdr.c
index edf926e1062f..d0a2ce1b4324 100644
--- a/fs/nfsd/nfs3xdr.c
+++ b/fs/nfsd/nfs3xdr.c
@@ -958,7 +958,7 @@ encode_entry(struct readdir_cd *ccd, const char *name, int namlen,
958 p1 = encode_entry_baggage(cd, p1, name, namlen, ino); 958 p1 = encode_entry_baggage(cd, p1, name, namlen, ino);
959 959
960 if (plus) 960 if (plus)
961 p = encode_entryplus_baggage(cd, p1, name, namlen); 961 p1 = encode_entryplus_baggage(cd, p1, name, namlen);
962 962
963 /* determine entry word length and lengths to go in pages */ 963 /* determine entry word length and lengths to go in pages */
964 num_entry_words = p1 - tmp; 964 num_entry_words = p1 - tmp;
diff --git a/fs/nilfs2/btnode.c b/fs/nilfs2/btnode.c
index 5941958f1e47..84c25382f8e3 100644
--- a/fs/nilfs2/btnode.c
+++ b/fs/nilfs2/btnode.c
@@ -87,6 +87,7 @@ int nilfs_btnode_submit_block(struct address_space *btnc, __u64 blocknr,
87 brelse(bh); 87 brelse(bh);
88 BUG(); 88 BUG();
89 } 89 }
90 memset(bh->b_data, 0, 1 << inode->i_blkbits);
90 bh->b_bdev = NILFS_I_NILFS(inode)->ns_bdev; 91 bh->b_bdev = NILFS_I_NILFS(inode)->ns_bdev;
91 bh->b_blocknr = blocknr; 92 bh->b_blocknr = blocknr;
92 set_buffer_mapped(bh); 93 set_buffer_mapped(bh);
@@ -276,8 +277,7 @@ void nilfs_btnode_commit_change_key(struct address_space *btnc,
276 "invalid oldkey %lld (newkey=%lld)", 277 "invalid oldkey %lld (newkey=%lld)",
277 (unsigned long long)oldkey, 278 (unsigned long long)oldkey,
278 (unsigned long long)newkey); 279 (unsigned long long)newkey);
279 if (!test_set_buffer_dirty(obh) && TestSetPageDirty(opage)) 280 nilfs_btnode_mark_dirty(obh);
280 BUG();
281 281
282 spin_lock_irq(&btnc->tree_lock); 282 spin_lock_irq(&btnc->tree_lock);
283 radix_tree_delete(&btnc->page_tree, oldkey); 283 radix_tree_delete(&btnc->page_tree, oldkey);
diff --git a/fs/nilfs2/cpfile.c b/fs/nilfs2/cpfile.c
index 1c6cfb59128d..3f5d5d06f53c 100644
--- a/fs/nilfs2/cpfile.c
+++ b/fs/nilfs2/cpfile.c
@@ -871,7 +871,6 @@ int nilfs_cpfile_change_cpmode(struct inode *cpfile, __u64 cno, int mode)
871 * exclusive with a new mount job. Though it doesn't cover 871 * exclusive with a new mount job. Though it doesn't cover
872 * umount, it's enough for the purpose. 872 * umount, it's enough for the purpose.
873 */ 873 */
874 mutex_lock(&nilfs->ns_mount_mutex);
875 if (nilfs_checkpoint_is_mounted(nilfs, cno, 1)) { 874 if (nilfs_checkpoint_is_mounted(nilfs, cno, 1)) {
876 /* Current implementation does not have to protect 875 /* Current implementation does not have to protect
877 plain read-only mounts since they are exclusive 876 plain read-only mounts since they are exclusive
@@ -880,7 +879,6 @@ int nilfs_cpfile_change_cpmode(struct inode *cpfile, __u64 cno, int mode)
880 ret = -EBUSY; 879 ret = -EBUSY;
881 } else 880 } else
882 ret = nilfs_cpfile_clear_snapshot(cpfile, cno); 881 ret = nilfs_cpfile_clear_snapshot(cpfile, cno);
883 mutex_unlock(&nilfs->ns_mount_mutex);
884 return ret; 882 return ret;
885 case NILFS_SNAPSHOT: 883 case NILFS_SNAPSHOT:
886 return nilfs_cpfile_set_snapshot(cpfile, cno); 884 return nilfs_cpfile_set_snapshot(cpfile, cno);
diff --git a/fs/nilfs2/inode.c b/fs/nilfs2/inode.c
index 5040220c3732..2a0a5a3ac134 100644
--- a/fs/nilfs2/inode.c
+++ b/fs/nilfs2/inode.c
@@ -664,7 +664,6 @@ int nilfs_load_inode_block(struct nilfs_sb_info *sbi, struct inode *inode,
664 int err; 664 int err;
665 665
666 spin_lock(&sbi->s_inode_lock); 666 spin_lock(&sbi->s_inode_lock);
667 /* Caller of this function MUST lock s_inode_lock */
668 if (ii->i_bh == NULL) { 667 if (ii->i_bh == NULL) {
669 spin_unlock(&sbi->s_inode_lock); 668 spin_unlock(&sbi->s_inode_lock);
670 err = nilfs_ifile_get_inode_block(sbi->s_ifile, inode->i_ino, 669 err = nilfs_ifile_get_inode_block(sbi->s_ifile, inode->i_ino,
diff --git a/fs/nilfs2/ioctl.c b/fs/nilfs2/ioctl.c
index 6572ea4bc4df..f6af76042d80 100644
--- a/fs/nilfs2/ioctl.c
+++ b/fs/nilfs2/ioctl.c
@@ -99,7 +99,8 @@ static int nilfs_ioctl_wrap_copy(struct the_nilfs *nilfs,
99static int nilfs_ioctl_change_cpmode(struct inode *inode, struct file *filp, 99static int nilfs_ioctl_change_cpmode(struct inode *inode, struct file *filp,
100 unsigned int cmd, void __user *argp) 100 unsigned int cmd, void __user *argp)
101{ 101{
102 struct inode *cpfile = NILFS_SB(inode->i_sb)->s_nilfs->ns_cpfile; 102 struct the_nilfs *nilfs = NILFS_SB(inode->i_sb)->s_nilfs;
103 struct inode *cpfile = nilfs->ns_cpfile;
103 struct nilfs_transaction_info ti; 104 struct nilfs_transaction_info ti;
104 struct nilfs_cpmode cpmode; 105 struct nilfs_cpmode cpmode;
105 int ret; 106 int ret;
@@ -109,14 +110,17 @@ static int nilfs_ioctl_change_cpmode(struct inode *inode, struct file *filp,
109 if (copy_from_user(&cpmode, argp, sizeof(cpmode))) 110 if (copy_from_user(&cpmode, argp, sizeof(cpmode)))
110 return -EFAULT; 111 return -EFAULT;
111 112
113 mutex_lock(&nilfs->ns_mount_mutex);
112 nilfs_transaction_begin(inode->i_sb, &ti, 0); 114 nilfs_transaction_begin(inode->i_sb, &ti, 0);
113 ret = nilfs_cpfile_change_cpmode( 115 ret = nilfs_cpfile_change_cpmode(
114 cpfile, cpmode.cm_cno, cpmode.cm_mode); 116 cpfile, cpmode.cm_cno, cpmode.cm_mode);
115 if (unlikely(ret < 0)) { 117 if (unlikely(ret < 0)) {
116 nilfs_transaction_abort(inode->i_sb); 118 nilfs_transaction_abort(inode->i_sb);
119 mutex_unlock(&nilfs->ns_mount_mutex);
117 return ret; 120 return ret;
118 } 121 }
119 nilfs_transaction_commit(inode->i_sb); /* never fails */ 122 nilfs_transaction_commit(inode->i_sb); /* never fails */
123 mutex_unlock(&nilfs->ns_mount_mutex);
120 return ret; 124 return ret;
121} 125}
122 126
@@ -297,7 +301,18 @@ static int nilfs_ioctl_move_inode_block(struct inode *inode,
297 (unsigned long long)vdesc->vd_vblocknr); 301 (unsigned long long)vdesc->vd_vblocknr);
298 return ret; 302 return ret;
299 } 303 }
300 bh->b_private = vdesc; 304 if (unlikely(!list_empty(&bh->b_assoc_buffers))) {
305 printk(KERN_CRIT "%s: conflicting %s buffer: ino=%llu, "
306 "cno=%llu, offset=%llu, blocknr=%llu, vblocknr=%llu\n",
307 __func__, vdesc->vd_flags ? "node" : "data",
308 (unsigned long long)vdesc->vd_ino,
309 (unsigned long long)vdesc->vd_cno,
310 (unsigned long long)vdesc->vd_offset,
311 (unsigned long long)vdesc->vd_blocknr,
312 (unsigned long long)vdesc->vd_vblocknr);
313 brelse(bh);
314 return -EEXIST;
315 }
301 list_add_tail(&bh->b_assoc_buffers, buffers); 316 list_add_tail(&bh->b_assoc_buffers, buffers);
302 return 0; 317 return 0;
303} 318}
@@ -335,24 +350,10 @@ static int nilfs_ioctl_move_blocks(struct the_nilfs *nilfs,
335 list_for_each_entry_safe(bh, n, &buffers, b_assoc_buffers) { 350 list_for_each_entry_safe(bh, n, &buffers, b_assoc_buffers) {
336 ret = nilfs_gccache_wait_and_mark_dirty(bh); 351 ret = nilfs_gccache_wait_and_mark_dirty(bh);
337 if (unlikely(ret < 0)) { 352 if (unlikely(ret < 0)) {
338 if (ret == -EEXIST) { 353 WARN_ON(ret == -EEXIST);
339 vdesc = bh->b_private;
340 printk(KERN_CRIT
341 "%s: conflicting %s buffer: "
342 "ino=%llu, cno=%llu, offset=%llu, "
343 "blocknr=%llu, vblocknr=%llu\n",
344 __func__,
345 vdesc->vd_flags ? "node" : "data",
346 (unsigned long long)vdesc->vd_ino,
347 (unsigned long long)vdesc->vd_cno,
348 (unsigned long long)vdesc->vd_offset,
349 (unsigned long long)vdesc->vd_blocknr,
350 (unsigned long long)vdesc->vd_vblocknr);
351 }
352 goto failed; 354 goto failed;
353 } 355 }
354 list_del_init(&bh->b_assoc_buffers); 356 list_del_init(&bh->b_assoc_buffers);
355 bh->b_private = NULL;
356 brelse(bh); 357 brelse(bh);
357 } 358 }
358 return nmembs; 359 return nmembs;
@@ -360,7 +361,6 @@ static int nilfs_ioctl_move_blocks(struct the_nilfs *nilfs,
360 failed: 361 failed:
361 list_for_each_entry_safe(bh, n, &buffers, b_assoc_buffers) { 362 list_for_each_entry_safe(bh, n, &buffers, b_assoc_buffers) {
362 list_del_init(&bh->b_assoc_buffers); 363 list_del_init(&bh->b_assoc_buffers);
363 bh->b_private = NULL;
364 brelse(bh); 364 brelse(bh);
365 } 365 }
366 return ret; 366 return ret;
@@ -471,7 +471,6 @@ int nilfs_ioctl_prepare_clean_segments(struct the_nilfs *nilfs,
471 return 0; 471 return 0;
472 472
473 failed: 473 failed:
474 nilfs_remove_all_gcinode(nilfs);
475 printk(KERN_ERR "NILFS: GC failed during preparation: %s: err=%d\n", 474 printk(KERN_ERR "NILFS: GC failed during preparation: %s: err=%d\n",
476 msg, ret); 475 msg, ret);
477 return ret; 476 return ret;
@@ -560,6 +559,8 @@ static int nilfs_ioctl_clean_segments(struct inode *inode, struct file *filp,
560 else 559 else
561 ret = nilfs_clean_segments(inode->i_sb, argv, kbufs); 560 ret = nilfs_clean_segments(inode->i_sb, argv, kbufs);
562 561
562 if (ret < 0)
563 nilfs_remove_all_gcinode(nilfs);
563 clear_nilfs_gc_running(nilfs); 564 clear_nilfs_gc_running(nilfs);
564 565
565 out_free: 566 out_free:
diff --git a/fs/nilfs2/segment.c b/fs/nilfs2/segment.c
index 683df89dbae5..6eff66a070d5 100644
--- a/fs/nilfs2/segment.c
+++ b/fs/nilfs2/segment.c
@@ -2468,17 +2468,22 @@ static void nilfs_segctor_notify(struct nilfs_sc_info *sci,
2468 /* Clear requests (even when the construction failed) */ 2468 /* Clear requests (even when the construction failed) */
2469 spin_lock(&sci->sc_state_lock); 2469 spin_lock(&sci->sc_state_lock);
2470 2470
2471 sci->sc_state &= ~NILFS_SEGCTOR_COMMIT;
2472
2473 if (req->mode == SC_LSEG_SR) { 2471 if (req->mode == SC_LSEG_SR) {
2472 sci->sc_state &= ~NILFS_SEGCTOR_COMMIT;
2474 sci->sc_seq_done = req->seq_accepted; 2473 sci->sc_seq_done = req->seq_accepted;
2475 nilfs_segctor_wakeup(sci, req->sc_err ? : req->sb_err); 2474 nilfs_segctor_wakeup(sci, req->sc_err ? : req->sb_err);
2476 sci->sc_flush_request = 0; 2475 sci->sc_flush_request = 0;
2477 } else if (req->mode == SC_FLUSH_FILE) 2476 } else {
2478 sci->sc_flush_request &= ~FLUSH_FILE_BIT; 2477 if (req->mode == SC_FLUSH_FILE)
2479 else if (req->mode == SC_FLUSH_DAT) 2478 sci->sc_flush_request &= ~FLUSH_FILE_BIT;
2480 sci->sc_flush_request &= ~FLUSH_DAT_BIT; 2479 else if (req->mode == SC_FLUSH_DAT)
2480 sci->sc_flush_request &= ~FLUSH_DAT_BIT;
2481 2481
2482 /* re-enable timer if checkpoint creation was not done */
2483 if (sci->sc_timer && (sci->sc_state & NILFS_SEGCTOR_COMMIT) &&
2484 time_before(jiffies, sci->sc_timer->expires))
2485 add_timer(sci->sc_timer);
2486 }
2482 spin_unlock(&sci->sc_state_lock); 2487 spin_unlock(&sci->sc_state_lock);
2483} 2488}
2484 2489
diff --git a/fs/ocfs2/file.c b/fs/ocfs2/file.c
index 89fc8ee1f5a5..de059f490586 100644
--- a/fs/ocfs2/file.c
+++ b/fs/ocfs2/file.c
@@ -1712,7 +1712,8 @@ int ocfs2_check_range_for_refcount(struct inode *inode, loff_t pos,
1712 struct super_block *sb = inode->i_sb; 1712 struct super_block *sb = inode->i_sb;
1713 1713
1714 if (!ocfs2_refcount_tree(OCFS2_SB(inode->i_sb)) || 1714 if (!ocfs2_refcount_tree(OCFS2_SB(inode->i_sb)) ||
1715 !(OCFS2_I(inode)->ip_dyn_features & OCFS2_HAS_REFCOUNT_FL)) 1715 !(OCFS2_I(inode)->ip_dyn_features & OCFS2_HAS_REFCOUNT_FL) ||
1716 OCFS2_I(inode)->ip_dyn_features & OCFS2_INLINE_DATA_FL)
1716 return 0; 1717 return 0;
1717 1718
1718 cpos = pos >> OCFS2_SB(sb)->s_clustersize_bits; 1719 cpos = pos >> OCFS2_SB(sb)->s_clustersize_bits;
diff --git a/fs/ocfs2/ocfs2.h b/fs/ocfs2/ocfs2.h
index eae404602424..d963d8638709 100644
--- a/fs/ocfs2/ocfs2.h
+++ b/fs/ocfs2/ocfs2.h
@@ -35,12 +35,7 @@
35#include <linux/kref.h> 35#include <linux/kref.h>
36#include <linux/mutex.h> 36#include <linux/mutex.h>
37#include <linux/lockdep.h> 37#include <linux/lockdep.h>
38#ifndef CONFIG_OCFS2_COMPAT_JBD 38#include <linux/jbd2.h>
39# include <linux/jbd2.h>
40#else
41# include <linux/jbd.h>
42# include "ocfs2_jbd_compat.h"
43#endif
44 39
45/* For union ocfs2_dlm_lksb */ 40/* For union ocfs2_dlm_lksb */
46#include "stackglue.h" 41#include "stackglue.h"
diff --git a/fs/ocfs2/refcounttree.c b/fs/ocfs2/refcounttree.c
index 60287fc56bcb..3a0df7a1b810 100644
--- a/fs/ocfs2/refcounttree.c
+++ b/fs/ocfs2/refcounttree.c
@@ -3743,6 +3743,9 @@ static int ocfs2_attach_refcount_tree(struct inode *inode,
3743 goto out; 3743 goto out;
3744 } 3744 }
3745 3745
3746 if (oi->ip_dyn_features & OCFS2_INLINE_DATA_FL)
3747 goto attach_xattr;
3748
3746 ocfs2_init_dinode_extent_tree(&di_et, INODE_CACHE(inode), di_bh); 3749 ocfs2_init_dinode_extent_tree(&di_et, INODE_CACHE(inode), di_bh);
3747 3750
3748 size = i_size_read(inode); 3751 size = i_size_read(inode);
@@ -3769,6 +3772,7 @@ static int ocfs2_attach_refcount_tree(struct inode *inode,
3769 cpos += num_clusters; 3772 cpos += num_clusters;
3770 } 3773 }
3771 3774
3775attach_xattr:
3772 if (oi->ip_dyn_features & OCFS2_HAS_XATTR_FL) { 3776 if (oi->ip_dyn_features & OCFS2_HAS_XATTR_FL) {
3773 ret = ocfs2_xattr_attach_refcount_tree(inode, di_bh, 3777 ret = ocfs2_xattr_attach_refcount_tree(inode, di_bh,
3774 &ref_tree->rf_ci, 3778 &ref_tree->rf_ci,
@@ -3858,6 +3862,49 @@ out:
3858 return ret; 3862 return ret;
3859} 3863}
3860 3864
3865static int ocfs2_duplicate_inline_data(struct inode *s_inode,
3866 struct buffer_head *s_bh,
3867 struct inode *t_inode,
3868 struct buffer_head *t_bh)
3869{
3870 int ret;
3871 handle_t *handle;
3872 struct ocfs2_super *osb = OCFS2_SB(s_inode->i_sb);
3873 struct ocfs2_dinode *s_di = (struct ocfs2_dinode *)s_bh->b_data;
3874 struct ocfs2_dinode *t_di = (struct ocfs2_dinode *)t_bh->b_data;
3875
3876 BUG_ON(!(OCFS2_I(s_inode)->ip_dyn_features & OCFS2_INLINE_DATA_FL));
3877
3878 handle = ocfs2_start_trans(osb, OCFS2_INODE_UPDATE_CREDITS);
3879 if (IS_ERR(handle)) {
3880 ret = PTR_ERR(handle);
3881 mlog_errno(ret);
3882 goto out;
3883 }
3884
3885 ret = ocfs2_journal_access_di(handle, INODE_CACHE(t_inode), t_bh,
3886 OCFS2_JOURNAL_ACCESS_WRITE);
3887 if (ret) {
3888 mlog_errno(ret);
3889 goto out_commit;
3890 }
3891
3892 t_di->id2.i_data.id_count = s_di->id2.i_data.id_count;
3893 memcpy(t_di->id2.i_data.id_data, s_di->id2.i_data.id_data,
3894 le16_to_cpu(s_di->id2.i_data.id_count));
3895 spin_lock(&OCFS2_I(t_inode)->ip_lock);
3896 OCFS2_I(t_inode)->ip_dyn_features |= OCFS2_INLINE_DATA_FL;
3897 t_di->i_dyn_features = cpu_to_le16(OCFS2_I(t_inode)->ip_dyn_features);
3898 spin_unlock(&OCFS2_I(t_inode)->ip_lock);
3899
3900 ocfs2_journal_dirty(handle, t_bh);
3901
3902out_commit:
3903 ocfs2_commit_trans(osb, handle);
3904out:
3905 return ret;
3906}
3907
3861static int ocfs2_duplicate_extent_list(struct inode *s_inode, 3908static int ocfs2_duplicate_extent_list(struct inode *s_inode,
3862 struct inode *t_inode, 3909 struct inode *t_inode,
3863 struct buffer_head *t_bh, 3910 struct buffer_head *t_bh,
@@ -3997,6 +4044,14 @@ static int ocfs2_create_reflink_node(struct inode *s_inode,
3997 goto out; 4044 goto out;
3998 } 4045 }
3999 4046
4047 if (OCFS2_I(s_inode)->ip_dyn_features & OCFS2_INLINE_DATA_FL) {
4048 ret = ocfs2_duplicate_inline_data(s_inode, s_bh,
4049 t_inode, t_bh);
4050 if (ret)
4051 mlog_errno(ret);
4052 goto out;
4053 }
4054
4000 ret = ocfs2_lock_refcount_tree(osb, le64_to_cpu(di->i_refcount_loc), 4055 ret = ocfs2_lock_refcount_tree(osb, le64_to_cpu(di->i_refcount_loc),
4001 1, &ref_tree, &ref_root_bh); 4056 1, &ref_tree, &ref_root_bh);
4002 if (ret) { 4057 if (ret) {
@@ -4013,10 +4068,6 @@ static int ocfs2_create_reflink_node(struct inode *s_inode,
4013 goto out_unlock_refcount; 4068 goto out_unlock_refcount;
4014 } 4069 }
4015 4070
4016 ret = ocfs2_complete_reflink(s_inode, s_bh, t_inode, t_bh, preserve);
4017 if (ret)
4018 mlog_errno(ret);
4019
4020out_unlock_refcount: 4071out_unlock_refcount:
4021 ocfs2_unlock_refcount_tree(osb, ref_tree, 1); 4072 ocfs2_unlock_refcount_tree(osb, ref_tree, 1);
4022 brelse(ref_root_bh); 4073 brelse(ref_root_bh);
@@ -4068,9 +4119,17 @@ static int __ocfs2_reflink(struct dentry *old_dentry,
4068 ret = ocfs2_reflink_xattrs(inode, old_bh, 4119 ret = ocfs2_reflink_xattrs(inode, old_bh,
4069 new_inode, new_bh, 4120 new_inode, new_bh,
4070 preserve); 4121 preserve);
4071 if (ret) 4122 if (ret) {
4072 mlog_errno(ret); 4123 mlog_errno(ret);
4124 goto inode_unlock;
4125 }
4073 } 4126 }
4127
4128 ret = ocfs2_complete_reflink(inode, old_bh,
4129 new_inode, new_bh, preserve);
4130 if (ret)
4131 mlog_errno(ret);
4132
4074inode_unlock: 4133inode_unlock:
4075 ocfs2_inode_unlock(new_inode, 1); 4134 ocfs2_inode_unlock(new_inode, 1);
4076 brelse(new_bh); 4135 brelse(new_bh);
diff --git a/fs/ocfs2/super.c b/fs/ocfs2/super.c
index c0e48aeebb1c..14f47d2bfe02 100644
--- a/fs/ocfs2/super.c
+++ b/fs/ocfs2/super.c
@@ -773,18 +773,20 @@ static int ocfs2_sb_probe(struct super_block *sb,
773 if (tmpstat < 0) { 773 if (tmpstat < 0) {
774 status = tmpstat; 774 status = tmpstat;
775 mlog_errno(status); 775 mlog_errno(status);
776 goto bail; 776 break;
777 } 777 }
778 di = (struct ocfs2_dinode *) (*bh)->b_data; 778 di = (struct ocfs2_dinode *) (*bh)->b_data;
779 memset(stats, 0, sizeof(struct ocfs2_blockcheck_stats)); 779 memset(stats, 0, sizeof(struct ocfs2_blockcheck_stats));
780 spin_lock_init(&stats->b_lock); 780 spin_lock_init(&stats->b_lock);
781 status = ocfs2_verify_volume(di, *bh, blksize, stats); 781 tmpstat = ocfs2_verify_volume(di, *bh, blksize, stats);
782 if (status >= 0) 782 if (tmpstat < 0) {
783 goto bail; 783 brelse(*bh);
784 brelse(*bh); 784 *bh = NULL;
785 *bh = NULL; 785 }
786 if (status != -EAGAIN) 786 if (tmpstat != -EAGAIN) {
787 status = tmpstat;
787 break; 788 break;
789 }
788 } 790 }
789 791
790bail: 792bail:
@@ -1645,6 +1647,10 @@ static int ocfs2_statfs(struct dentry *dentry, struct kstatfs *buf)
1645 buf->f_bavail = buf->f_bfree; 1647 buf->f_bavail = buf->f_bfree;
1646 buf->f_files = numbits; 1648 buf->f_files = numbits;
1647 buf->f_ffree = freebits; 1649 buf->f_ffree = freebits;
1650 buf->f_fsid.val[0] = crc32_le(0, osb->uuid_str, OCFS2_VOL_UUID_LEN)
1651 & 0xFFFFFFFFUL;
1652 buf->f_fsid.val[1] = crc32_le(0, osb->uuid_str + OCFS2_VOL_UUID_LEN,
1653 OCFS2_VOL_UUID_LEN) & 0xFFFFFFFFUL;
1648 1654
1649 brelse(bh); 1655 brelse(bh);
1650 1656
diff --git a/fs/ocfs2/uptodate.c b/fs/ocfs2/uptodate.c
index b6284f235d2f..c61369342a27 100644
--- a/fs/ocfs2/uptodate.c
+++ b/fs/ocfs2/uptodate.c
@@ -53,11 +53,6 @@
53#include <linux/highmem.h> 53#include <linux/highmem.h>
54#include <linux/buffer_head.h> 54#include <linux/buffer_head.h>
55#include <linux/rbtree.h> 55#include <linux/rbtree.h>
56#ifndef CONFIG_OCFS2_COMPAT_JBD
57# include <linux/jbd2.h>
58#else
59# include <linux/jbd.h>
60#endif
61 56
62#define MLOG_MASK_PREFIX ML_UPTODATE 57#define MLOG_MASK_PREFIX ML_UPTODATE
63 58
diff --git a/fs/open.c b/fs/open.c
index 4f01e06227c6..b4b31d277f3a 100644
--- a/fs/open.c
+++ b/fs/open.c
@@ -587,6 +587,9 @@ SYSCALL_DEFINE1(chroot, const char __user *, filename)
587 error = -EPERM; 587 error = -EPERM;
588 if (!capable(CAP_SYS_CHROOT)) 588 if (!capable(CAP_SYS_CHROOT))
589 goto dput_and_out; 589 goto dput_and_out;
590 error = security_path_chroot(&path);
591 if (error)
592 goto dput_and_out;
590 593
591 set_fs_root(current->fs, &path); 594 set_fs_root(current->fs, &path);
592 error = 0; 595 error = 0;
@@ -617,11 +620,15 @@ SYSCALL_DEFINE2(fchmod, unsigned int, fd, mode_t, mode)
617 if (err) 620 if (err)
618 goto out_putf; 621 goto out_putf;
619 mutex_lock(&inode->i_mutex); 622 mutex_lock(&inode->i_mutex);
623 err = security_path_chmod(dentry, file->f_vfsmnt, mode);
624 if (err)
625 goto out_unlock;
620 if (mode == (mode_t) -1) 626 if (mode == (mode_t) -1)
621 mode = inode->i_mode; 627 mode = inode->i_mode;
622 newattrs.ia_mode = (mode & S_IALLUGO) | (inode->i_mode & ~S_IALLUGO); 628 newattrs.ia_mode = (mode & S_IALLUGO) | (inode->i_mode & ~S_IALLUGO);
623 newattrs.ia_valid = ATTR_MODE | ATTR_CTIME; 629 newattrs.ia_valid = ATTR_MODE | ATTR_CTIME;
624 err = notify_change(dentry, &newattrs); 630 err = notify_change(dentry, &newattrs);
631out_unlock:
625 mutex_unlock(&inode->i_mutex); 632 mutex_unlock(&inode->i_mutex);
626 mnt_drop_write(file->f_path.mnt); 633 mnt_drop_write(file->f_path.mnt);
627out_putf: 634out_putf:
@@ -646,11 +653,15 @@ SYSCALL_DEFINE3(fchmodat, int, dfd, const char __user *, filename, mode_t, mode)
646 if (error) 653 if (error)
647 goto dput_and_out; 654 goto dput_and_out;
648 mutex_lock(&inode->i_mutex); 655 mutex_lock(&inode->i_mutex);
656 error = security_path_chmod(path.dentry, path.mnt, mode);
657 if (error)
658 goto out_unlock;
649 if (mode == (mode_t) -1) 659 if (mode == (mode_t) -1)
650 mode = inode->i_mode; 660 mode = inode->i_mode;
651 newattrs.ia_mode = (mode & S_IALLUGO) | (inode->i_mode & ~S_IALLUGO); 661 newattrs.ia_mode = (mode & S_IALLUGO) | (inode->i_mode & ~S_IALLUGO);
652 newattrs.ia_valid = ATTR_MODE | ATTR_CTIME; 662 newattrs.ia_valid = ATTR_MODE | ATTR_CTIME;
653 error = notify_change(path.dentry, &newattrs); 663 error = notify_change(path.dentry, &newattrs);
664out_unlock:
654 mutex_unlock(&inode->i_mutex); 665 mutex_unlock(&inode->i_mutex);
655 mnt_drop_write(path.mnt); 666 mnt_drop_write(path.mnt);
656dput_and_out: 667dput_and_out:
@@ -664,9 +675,9 @@ SYSCALL_DEFINE2(chmod, const char __user *, filename, mode_t, mode)
664 return sys_fchmodat(AT_FDCWD, filename, mode); 675 return sys_fchmodat(AT_FDCWD, filename, mode);
665} 676}
666 677
667static int chown_common(struct dentry * dentry, uid_t user, gid_t group) 678static int chown_common(struct path *path, uid_t user, gid_t group)
668{ 679{
669 struct inode *inode = dentry->d_inode; 680 struct inode *inode = path->dentry->d_inode;
670 int error; 681 int error;
671 struct iattr newattrs; 682 struct iattr newattrs;
672 683
@@ -683,7 +694,9 @@ static int chown_common(struct dentry * dentry, uid_t user, gid_t group)
683 newattrs.ia_valid |= 694 newattrs.ia_valid |=
684 ATTR_KILL_SUID | ATTR_KILL_SGID | ATTR_KILL_PRIV; 695 ATTR_KILL_SUID | ATTR_KILL_SGID | ATTR_KILL_PRIV;
685 mutex_lock(&inode->i_mutex); 696 mutex_lock(&inode->i_mutex);
686 error = notify_change(dentry, &newattrs); 697 error = security_path_chown(path, user, group);
698 if (!error)
699 error = notify_change(path->dentry, &newattrs);
687 mutex_unlock(&inode->i_mutex); 700 mutex_unlock(&inode->i_mutex);
688 701
689 return error; 702 return error;
@@ -700,7 +713,7 @@ SYSCALL_DEFINE3(chown, const char __user *, filename, uid_t, user, gid_t, group)
700 error = mnt_want_write(path.mnt); 713 error = mnt_want_write(path.mnt);
701 if (error) 714 if (error)
702 goto out_release; 715 goto out_release;
703 error = chown_common(path.dentry, user, group); 716 error = chown_common(&path, user, group);
704 mnt_drop_write(path.mnt); 717 mnt_drop_write(path.mnt);
705out_release: 718out_release:
706 path_put(&path); 719 path_put(&path);
@@ -725,7 +738,7 @@ SYSCALL_DEFINE5(fchownat, int, dfd, const char __user *, filename, uid_t, user,
725 error = mnt_want_write(path.mnt); 738 error = mnt_want_write(path.mnt);
726 if (error) 739 if (error)
727 goto out_release; 740 goto out_release;
728 error = chown_common(path.dentry, user, group); 741 error = chown_common(&path, user, group);
729 mnt_drop_write(path.mnt); 742 mnt_drop_write(path.mnt);
730out_release: 743out_release:
731 path_put(&path); 744 path_put(&path);
@@ -744,7 +757,7 @@ SYSCALL_DEFINE3(lchown, const char __user *, filename, uid_t, user, gid_t, group
744 error = mnt_want_write(path.mnt); 757 error = mnt_want_write(path.mnt);
745 if (error) 758 if (error)
746 goto out_release; 759 goto out_release;
747 error = chown_common(path.dentry, user, group); 760 error = chown_common(&path, user, group);
748 mnt_drop_write(path.mnt); 761 mnt_drop_write(path.mnt);
749out_release: 762out_release:
750 path_put(&path); 763 path_put(&path);
@@ -767,7 +780,7 @@ SYSCALL_DEFINE3(fchown, unsigned int, fd, uid_t, user, gid_t, group)
767 goto out_fput; 780 goto out_fput;
768 dentry = file->f_path.dentry; 781 dentry = file->f_path.dentry;
769 audit_inode(NULL, dentry); 782 audit_inode(NULL, dentry);
770 error = chown_common(dentry, user, group); 783 error = chown_common(&file->f_path, user, group);
771 mnt_drop_write(file->f_path.mnt); 784 mnt_drop_write(file->f_path.mnt);
772out_fput: 785out_fput:
773 fput(file); 786 fput(file);
diff --git a/fs/proc/array.c b/fs/proc/array.c
index 07f77a7945c3..4badde179b18 100644
--- a/fs/proc/array.c
+++ b/fs/proc/array.c
@@ -410,6 +410,16 @@ static void task_show_stack_usage(struct seq_file *m, struct task_struct *task)
410} 410}
411#endif /* CONFIG_MMU */ 411#endif /* CONFIG_MMU */
412 412
413static void task_cpus_allowed(struct seq_file *m, struct task_struct *task)
414{
415 seq_printf(m, "Cpus_allowed:\t");
416 seq_cpumask(m, &task->cpus_allowed);
417 seq_printf(m, "\n");
418 seq_printf(m, "Cpus_allowed_list:\t");
419 seq_cpumask_list(m, &task->cpus_allowed);
420 seq_printf(m, "\n");
421}
422
413int proc_pid_status(struct seq_file *m, struct pid_namespace *ns, 423int proc_pid_status(struct seq_file *m, struct pid_namespace *ns,
414 struct pid *pid, struct task_struct *task) 424 struct pid *pid, struct task_struct *task)
415{ 425{
@@ -424,6 +434,7 @@ int proc_pid_status(struct seq_file *m, struct pid_namespace *ns,
424 } 434 }
425 task_sig(m, task); 435 task_sig(m, task);
426 task_cap(m, task); 436 task_cap(m, task);
437 task_cpus_allowed(m, task);
427 cpuset_task_status_allowed(m, task); 438 cpuset_task_status_allowed(m, task);
428#if defined(CONFIG_S390) 439#if defined(CONFIG_S390)
429 task_show_regs(m, task); 440 task_show_regs(m, task);
@@ -495,20 +506,17 @@ static int do_task_stat(struct seq_file *m, struct pid_namespace *ns,
495 506
496 /* add up live thread stats at the group level */ 507 /* add up live thread stats at the group level */
497 if (whole) { 508 if (whole) {
498 struct task_cputime cputime;
499 struct task_struct *t = task; 509 struct task_struct *t = task;
500 do { 510 do {
501 min_flt += t->min_flt; 511 min_flt += t->min_flt;
502 maj_flt += t->maj_flt; 512 maj_flt += t->maj_flt;
503 gtime = cputime_add(gtime, task_gtime(t)); 513 gtime = cputime_add(gtime, t->gtime);
504 t = next_thread(t); 514 t = next_thread(t);
505 } while (t != task); 515 } while (t != task);
506 516
507 min_flt += sig->min_flt; 517 min_flt += sig->min_flt;
508 maj_flt += sig->maj_flt; 518 maj_flt += sig->maj_flt;
509 thread_group_cputime(task, &cputime); 519 thread_group_times(task, &utime, &stime);
510 utime = cputime.utime;
511 stime = cputime.stime;
512 gtime = cputime_add(gtime, sig->gtime); 520 gtime = cputime_add(gtime, sig->gtime);
513 } 521 }
514 522
@@ -524,9 +532,8 @@ static int do_task_stat(struct seq_file *m, struct pid_namespace *ns,
524 if (!whole) { 532 if (!whole) {
525 min_flt = task->min_flt; 533 min_flt = task->min_flt;
526 maj_flt = task->maj_flt; 534 maj_flt = task->maj_flt;
527 utime = task_utime(task); 535 task_times(task, &utime, &stime);
528 stime = task_stime(task); 536 gtime = task->gtime;
529 gtime = task_gtime(task);
530 } 537 }
531 538
532 /* scale priority and nice values from timeslices to -20..20 */ 539 /* scale priority and nice values from timeslices to -20..20 */
@@ -571,7 +578,7 @@ static int do_task_stat(struct seq_file *m, struct pid_namespace *ns,
571 rsslim, 578 rsslim,
572 mm ? mm->start_code : 0, 579 mm ? mm->start_code : 0,
573 mm ? mm->end_code : 0, 580 mm ? mm->end_code : 0,
574 (permitted) ? task->stack_start : 0, 581 (permitted && mm) ? task->stack_start : 0,
575 esp, 582 esp,
576 eip, 583 eip,
577 /* The signal information here is obsolete. 584 /* The signal information here is obsolete.
diff --git a/fs/proc/base.c b/fs/proc/base.c
index 837469a96598..af643b5aefe8 100644
--- a/fs/proc/base.c
+++ b/fs/proc/base.c
@@ -2597,8 +2597,7 @@ static void proc_flush_task_mnt(struct vfsmount *mnt, pid_t pid, pid_t tgid)
2597 name.len = snprintf(buf, sizeof(buf), "%d", pid); 2597 name.len = snprintf(buf, sizeof(buf), "%d", pid);
2598 dentry = d_hash_and_lookup(mnt->mnt_root, &name); 2598 dentry = d_hash_and_lookup(mnt->mnt_root, &name);
2599 if (dentry) { 2599 if (dentry) {
2600 if (!(current->flags & PF_EXITING)) 2600 shrink_dcache_parent(dentry);
2601 shrink_dcache_parent(dentry);
2602 d_drop(dentry); 2601 d_drop(dentry);
2603 dput(dentry); 2602 dput(dentry);
2604 } 2603 }
diff --git a/fs/proc/stat.c b/fs/proc/stat.c
index 7cc726c6d70a..b9b7aad2003d 100644
--- a/fs/proc/stat.c
+++ b/fs/proc/stat.c
@@ -27,7 +27,7 @@ static int show_stat(struct seq_file *p, void *v)
27 int i, j; 27 int i, j;
28 unsigned long jif; 28 unsigned long jif;
29 cputime64_t user, nice, system, idle, iowait, irq, softirq, steal; 29 cputime64_t user, nice, system, idle, iowait, irq, softirq, steal;
30 cputime64_t guest; 30 cputime64_t guest, guest_nice;
31 u64 sum = 0; 31 u64 sum = 0;
32 u64 sum_softirq = 0; 32 u64 sum_softirq = 0;
33 unsigned int per_softirq_sums[NR_SOFTIRQS] = {0}; 33 unsigned int per_softirq_sums[NR_SOFTIRQS] = {0};
@@ -36,7 +36,7 @@ static int show_stat(struct seq_file *p, void *v)
36 36
37 user = nice = system = idle = iowait = 37 user = nice = system = idle = iowait =
38 irq = softirq = steal = cputime64_zero; 38 irq = softirq = steal = cputime64_zero;
39 guest = cputime64_zero; 39 guest = guest_nice = cputime64_zero;
40 getboottime(&boottime); 40 getboottime(&boottime);
41 jif = boottime.tv_sec; 41 jif = boottime.tv_sec;
42 42
@@ -51,6 +51,8 @@ static int show_stat(struct seq_file *p, void *v)
51 softirq = cputime64_add(softirq, kstat_cpu(i).cpustat.softirq); 51 softirq = cputime64_add(softirq, kstat_cpu(i).cpustat.softirq);
52 steal = cputime64_add(steal, kstat_cpu(i).cpustat.steal); 52 steal = cputime64_add(steal, kstat_cpu(i).cpustat.steal);
53 guest = cputime64_add(guest, kstat_cpu(i).cpustat.guest); 53 guest = cputime64_add(guest, kstat_cpu(i).cpustat.guest);
54 guest_nice = cputime64_add(guest_nice,
55 kstat_cpu(i).cpustat.guest_nice);
54 for_each_irq_nr(j) { 56 for_each_irq_nr(j) {
55 sum += kstat_irqs_cpu(j, i); 57 sum += kstat_irqs_cpu(j, i);
56 } 58 }
@@ -65,7 +67,8 @@ static int show_stat(struct seq_file *p, void *v)
65 } 67 }
66 sum += arch_irq_stat(); 68 sum += arch_irq_stat();
67 69
68 seq_printf(p, "cpu %llu %llu %llu %llu %llu %llu %llu %llu %llu\n", 70 seq_printf(p, "cpu %llu %llu %llu %llu %llu %llu %llu %llu %llu "
71 "%llu\n",
69 (unsigned long long)cputime64_to_clock_t(user), 72 (unsigned long long)cputime64_to_clock_t(user),
70 (unsigned long long)cputime64_to_clock_t(nice), 73 (unsigned long long)cputime64_to_clock_t(nice),
71 (unsigned long long)cputime64_to_clock_t(system), 74 (unsigned long long)cputime64_to_clock_t(system),
@@ -74,7 +77,8 @@ static int show_stat(struct seq_file *p, void *v)
74 (unsigned long long)cputime64_to_clock_t(irq), 77 (unsigned long long)cputime64_to_clock_t(irq),
75 (unsigned long long)cputime64_to_clock_t(softirq), 78 (unsigned long long)cputime64_to_clock_t(softirq),
76 (unsigned long long)cputime64_to_clock_t(steal), 79 (unsigned long long)cputime64_to_clock_t(steal),
77 (unsigned long long)cputime64_to_clock_t(guest)); 80 (unsigned long long)cputime64_to_clock_t(guest),
81 (unsigned long long)cputime64_to_clock_t(guest_nice));
78 for_each_online_cpu(i) { 82 for_each_online_cpu(i) {
79 83
80 /* Copy values here to work around gcc-2.95.3, gcc-2.96 */ 84 /* Copy values here to work around gcc-2.95.3, gcc-2.96 */
@@ -88,8 +92,10 @@ static int show_stat(struct seq_file *p, void *v)
88 softirq = kstat_cpu(i).cpustat.softirq; 92 softirq = kstat_cpu(i).cpustat.softirq;
89 steal = kstat_cpu(i).cpustat.steal; 93 steal = kstat_cpu(i).cpustat.steal;
90 guest = kstat_cpu(i).cpustat.guest; 94 guest = kstat_cpu(i).cpustat.guest;
95 guest_nice = kstat_cpu(i).cpustat.guest_nice;
91 seq_printf(p, 96 seq_printf(p,
92 "cpu%d %llu %llu %llu %llu %llu %llu %llu %llu %llu\n", 97 "cpu%d %llu %llu %llu %llu %llu %llu %llu %llu %llu "
98 "%llu\n",
93 i, 99 i,
94 (unsigned long long)cputime64_to_clock_t(user), 100 (unsigned long long)cputime64_to_clock_t(user),
95 (unsigned long long)cputime64_to_clock_t(nice), 101 (unsigned long long)cputime64_to_clock_t(nice),
@@ -99,7 +105,8 @@ static int show_stat(struct seq_file *p, void *v)
99 (unsigned long long)cputime64_to_clock_t(irq), 105 (unsigned long long)cputime64_to_clock_t(irq),
100 (unsigned long long)cputime64_to_clock_t(softirq), 106 (unsigned long long)cputime64_to_clock_t(softirq),
101 (unsigned long long)cputime64_to_clock_t(steal), 107 (unsigned long long)cputime64_to_clock_t(steal),
102 (unsigned long long)cputime64_to_clock_t(guest)); 108 (unsigned long long)cputime64_to_clock_t(guest),
109 (unsigned long long)cputime64_to_clock_t(guest_nice));
103 } 110 }
104 seq_printf(p, "intr %llu", (unsigned long long)sum); 111 seq_printf(p, "intr %llu", (unsigned long long)sum);
105 112
diff --git a/fs/quota/Kconfig b/fs/quota/Kconfig
index 8047e01ef46b..353e78a9ebee 100644
--- a/fs/quota/Kconfig
+++ b/fs/quota/Kconfig
@@ -17,7 +17,7 @@ config QUOTA
17 17
18config QUOTA_NETLINK_INTERFACE 18config QUOTA_NETLINK_INTERFACE
19 bool "Report quota messages through netlink interface" 19 bool "Report quota messages through netlink interface"
20 depends on QUOTA && NET 20 depends on QUOTACTL && NET
21 help 21 help
22 If you say Y here, quota warnings (about exceeding softlimit, reaching 22 If you say Y here, quota warnings (about exceeding softlimit, reaching
23 hardlimit, etc.) will be reported through netlink interface. If unsure, 23 hardlimit, etc.) will be reported through netlink interface. If unsure,
diff --git a/fs/quota/dquot.c b/fs/quota/dquot.c
index 39b49c42a7ed..9b6ad908dcb2 100644
--- a/fs/quota/dquot.c
+++ b/fs/quota/dquot.c
@@ -77,10 +77,6 @@
77#include <linux/capability.h> 77#include <linux/capability.h>
78#include <linux/quotaops.h> 78#include <linux/quotaops.h>
79#include <linux/writeback.h> /* for inode_lock, oddly enough.. */ 79#include <linux/writeback.h> /* for inode_lock, oddly enough.. */
80#ifdef CONFIG_QUOTA_NETLINK_INTERFACE
81#include <net/netlink.h>
82#include <net/genetlink.h>
83#endif
84 80
85#include <asm/uaccess.h> 81#include <asm/uaccess.h>
86 82
@@ -1071,73 +1067,6 @@ static void print_warning(struct dquot *dquot, const int warntype)
1071} 1067}
1072#endif 1068#endif
1073 1069
1074#ifdef CONFIG_QUOTA_NETLINK_INTERFACE
1075
1076/* Netlink family structure for quota */
1077static struct genl_family quota_genl_family = {
1078 .id = GENL_ID_GENERATE,
1079 .hdrsize = 0,
1080 .name = "VFS_DQUOT",
1081 .version = 1,
1082 .maxattr = QUOTA_NL_A_MAX,
1083};
1084
1085/* Send warning to userspace about user which exceeded quota */
1086static void send_warning(const struct dquot *dquot, const char warntype)
1087{
1088 static atomic_t seq;
1089 struct sk_buff *skb;
1090 void *msg_head;
1091 int ret;
1092 int msg_size = 4 * nla_total_size(sizeof(u32)) +
1093 2 * nla_total_size(sizeof(u64));
1094
1095 /* We have to allocate using GFP_NOFS as we are called from a
1096 * filesystem performing write and thus further recursion into
1097 * the fs to free some data could cause deadlocks. */
1098 skb = genlmsg_new(msg_size, GFP_NOFS);
1099 if (!skb) {
1100 printk(KERN_ERR
1101 "VFS: Not enough memory to send quota warning.\n");
1102 return;
1103 }
1104 msg_head = genlmsg_put(skb, 0, atomic_add_return(1, &seq),
1105 &quota_genl_family, 0, QUOTA_NL_C_WARNING);
1106 if (!msg_head) {
1107 printk(KERN_ERR
1108 "VFS: Cannot store netlink header in quota warning.\n");
1109 goto err_out;
1110 }
1111 ret = nla_put_u32(skb, QUOTA_NL_A_QTYPE, dquot->dq_type);
1112 if (ret)
1113 goto attr_err_out;
1114 ret = nla_put_u64(skb, QUOTA_NL_A_EXCESS_ID, dquot->dq_id);
1115 if (ret)
1116 goto attr_err_out;
1117 ret = nla_put_u32(skb, QUOTA_NL_A_WARNING, warntype);
1118 if (ret)
1119 goto attr_err_out;
1120 ret = nla_put_u32(skb, QUOTA_NL_A_DEV_MAJOR,
1121 MAJOR(dquot->dq_sb->s_dev));
1122 if (ret)
1123 goto attr_err_out;
1124 ret = nla_put_u32(skb, QUOTA_NL_A_DEV_MINOR,
1125 MINOR(dquot->dq_sb->s_dev));
1126 if (ret)
1127 goto attr_err_out;
1128 ret = nla_put_u64(skb, QUOTA_NL_A_CAUSED_ID, current_uid());
1129 if (ret)
1130 goto attr_err_out;
1131 genlmsg_end(skb, msg_head);
1132
1133 genlmsg_multicast(skb, 0, quota_genl_family.id, GFP_NOFS);
1134 return;
1135attr_err_out:
1136 printk(KERN_ERR "VFS: Not enough space to compose quota message!\n");
1137err_out:
1138 kfree_skb(skb);
1139}
1140#endif
1141/* 1070/*
1142 * Write warnings to the console and send warning messages over netlink. 1071 * Write warnings to the console and send warning messages over netlink.
1143 * 1072 *
@@ -1145,18 +1074,20 @@ err_out:
1145 */ 1074 */
1146static void flush_warnings(struct dquot *const *dquots, char *warntype) 1075static void flush_warnings(struct dquot *const *dquots, char *warntype)
1147{ 1076{
1077 struct dquot *dq;
1148 int i; 1078 int i;
1149 1079
1150 for (i = 0; i < MAXQUOTAS; i++) 1080 for (i = 0; i < MAXQUOTAS; i++) {
1151 if (dquots[i] && warntype[i] != QUOTA_NL_NOWARN && 1081 dq = dquots[i];
1152 !warning_issued(dquots[i], warntype[i])) { 1082 if (dq && warntype[i] != QUOTA_NL_NOWARN &&
1083 !warning_issued(dq, warntype[i])) {
1153#ifdef CONFIG_PRINT_QUOTA_WARNING 1084#ifdef CONFIG_PRINT_QUOTA_WARNING
1154 print_warning(dquots[i], warntype[i]); 1085 print_warning(dq, warntype[i]);
1155#endif
1156#ifdef CONFIG_QUOTA_NETLINK_INTERFACE
1157 send_warning(dquots[i], warntype[i]);
1158#endif 1086#endif
1087 quota_send_warning(dq->dq_type, dq->dq_id,
1088 dq->dq_sb->s_dev, warntype[i]);
1159 } 1089 }
1090 }
1160} 1091}
1161 1092
1162static int ignore_hardlimit(struct dquot *dquot) 1093static int ignore_hardlimit(struct dquot *dquot)
@@ -2607,12 +2538,6 @@ static int __init dquot_init(void)
2607 2538
2608 register_shrinker(&dqcache_shrinker); 2539 register_shrinker(&dqcache_shrinker);
2609 2540
2610#ifdef CONFIG_QUOTA_NETLINK_INTERFACE
2611 if (genl_register_family(&quota_genl_family) != 0)
2612 printk(KERN_ERR
2613 "VFS: Failed to create quota netlink interface.\n");
2614#endif
2615
2616 return 0; 2541 return 0;
2617} 2542}
2618module_init(dquot_init); 2543module_init(dquot_init);
diff --git a/fs/quota/quota.c b/fs/quota/quota.c
index 95c5b42384b2..ee91e2756950 100644
--- a/fs/quota/quota.c
+++ b/fs/quota/quota.c
@@ -18,6 +18,8 @@
18#include <linux/capability.h> 18#include <linux/capability.h>
19#include <linux/quotaops.h> 19#include <linux/quotaops.h>
20#include <linux/types.h> 20#include <linux/types.h>
21#include <net/netlink.h>
22#include <net/genetlink.h>
21 23
22/* Check validity of generic quotactl commands */ 24/* Check validity of generic quotactl commands */
23static int generic_quotactl_valid(struct super_block *sb, int type, int cmd, 25static int generic_quotactl_valid(struct super_block *sb, int type, int cmd,
@@ -525,3 +527,94 @@ asmlinkage long sys32_quotactl(unsigned int cmd, const char __user *special,
525 return ret; 527 return ret;
526} 528}
527#endif 529#endif
530
531
532#ifdef CONFIG_QUOTA_NETLINK_INTERFACE
533
534/* Netlink family structure for quota */
535static struct genl_family quota_genl_family = {
536 .id = GENL_ID_GENERATE,
537 .hdrsize = 0,
538 .name = "VFS_DQUOT",
539 .version = 1,
540 .maxattr = QUOTA_NL_A_MAX,
541};
542
543/**
544 * quota_send_warning - Send warning to userspace about exceeded quota
545 * @type: The quota type: USRQQUOTA, GRPQUOTA,...
546 * @id: The user or group id of the quota that was exceeded
547 * @dev: The device on which the fs is mounted (sb->s_dev)
548 * @warntype: The type of the warning: QUOTA_NL_...
549 *
550 * This can be used by filesystems (including those which don't use
551 * dquot) to send a message to userspace relating to quota limits.
552 *
553 */
554
555void quota_send_warning(short type, unsigned int id, dev_t dev,
556 const char warntype)
557{
558 static atomic_t seq;
559 struct sk_buff *skb;
560 void *msg_head;
561 int ret;
562 int msg_size = 4 * nla_total_size(sizeof(u32)) +
563 2 * nla_total_size(sizeof(u64));
564
565 /* We have to allocate using GFP_NOFS as we are called from a
566 * filesystem performing write and thus further recursion into
567 * the fs to free some data could cause deadlocks. */
568 skb = genlmsg_new(msg_size, GFP_NOFS);
569 if (!skb) {
570 printk(KERN_ERR
571 "VFS: Not enough memory to send quota warning.\n");
572 return;
573 }
574 msg_head = genlmsg_put(skb, 0, atomic_add_return(1, &seq),
575 &quota_genl_family, 0, QUOTA_NL_C_WARNING);
576 if (!msg_head) {
577 printk(KERN_ERR
578 "VFS: Cannot store netlink header in quota warning.\n");
579 goto err_out;
580 }
581 ret = nla_put_u32(skb, QUOTA_NL_A_QTYPE, type);
582 if (ret)
583 goto attr_err_out;
584 ret = nla_put_u64(skb, QUOTA_NL_A_EXCESS_ID, id);
585 if (ret)
586 goto attr_err_out;
587 ret = nla_put_u32(skb, QUOTA_NL_A_WARNING, warntype);
588 if (ret)
589 goto attr_err_out;
590 ret = nla_put_u32(skb, QUOTA_NL_A_DEV_MAJOR, MAJOR(dev));
591 if (ret)
592 goto attr_err_out;
593 ret = nla_put_u32(skb, QUOTA_NL_A_DEV_MINOR, MINOR(dev));
594 if (ret)
595 goto attr_err_out;
596 ret = nla_put_u64(skb, QUOTA_NL_A_CAUSED_ID, current_uid());
597 if (ret)
598 goto attr_err_out;
599 genlmsg_end(skb, msg_head);
600
601 genlmsg_multicast(skb, 0, quota_genl_family.id, GFP_NOFS);
602 return;
603attr_err_out:
604 printk(KERN_ERR "VFS: Not enough space to compose quota message!\n");
605err_out:
606 kfree_skb(skb);
607}
608EXPORT_SYMBOL(quota_send_warning);
609
610static int __init quota_init(void)
611{
612 if (genl_register_family(&quota_genl_family) != 0)
613 printk(KERN_ERR
614 "VFS: Failed to create quota netlink interface.\n");
615 return 0;
616};
617
618module_init(quota_init);
619#endif
620
diff --git a/fs/sysfs/dir.c b/fs/sysfs/dir.c
index 5fad489ce5bc..e0201837d244 100644
--- a/fs/sysfs/dir.c
+++ b/fs/sysfs/dir.c
@@ -21,6 +21,7 @@
21#include <linux/completion.h> 21#include <linux/completion.h>
22#include <linux/mutex.h> 22#include <linux/mutex.h>
23#include <linux/slab.h> 23#include <linux/slab.h>
24#include <linux/security.h>
24#include "sysfs.h" 25#include "sysfs.h"
25 26
26DEFINE_MUTEX(sysfs_mutex); 27DEFINE_MUTEX(sysfs_mutex);
@@ -285,6 +286,9 @@ void release_sysfs_dirent(struct sysfs_dirent * sd)
285 sysfs_put(sd->s_symlink.target_sd); 286 sysfs_put(sd->s_symlink.target_sd);
286 if (sysfs_type(sd) & SYSFS_COPY_NAME) 287 if (sysfs_type(sd) & SYSFS_COPY_NAME)
287 kfree(sd->s_name); 288 kfree(sd->s_name);
289 if (sd->s_iattr && sd->s_iattr->ia_secdata)
290 security_release_secctx(sd->s_iattr->ia_secdata,
291 sd->s_iattr->ia_secdata_len);
288 kfree(sd->s_iattr); 292 kfree(sd->s_iattr);
289 sysfs_free_ino(sd->s_ino); 293 sysfs_free_ino(sd->s_ino);
290 kmem_cache_free(sysfs_dir_cachep, sd); 294 kmem_cache_free(sysfs_dir_cachep, sd);
diff --git a/fs/xattr_acl.c b/fs/xattr_acl.c
index c6ad7c7e3ee9..05ac0fe9c4d3 100644
--- a/fs/xattr_acl.c
+++ b/fs/xattr_acl.c
@@ -36,7 +36,7 @@ posix_acl_from_xattr(const void *value, size_t size)
36 if (count == 0) 36 if (count == 0)
37 return NULL; 37 return NULL;
38 38
39 acl = posix_acl_alloc(count, GFP_KERNEL); 39 acl = posix_acl_alloc(count, GFP_NOFS);
40 if (!acl) 40 if (!acl)
41 return ERR_PTR(-ENOMEM); 41 return ERR_PTR(-ENOMEM);
42 acl_e = acl->a_entries; 42 acl_e = acl->a_entries;
diff --git a/fs/xfs/xfs_log_recover.c b/fs/xfs/xfs_log_recover.c
index 1099395d7d6c..fb17f8226b09 100644
--- a/fs/xfs/xfs_log_recover.c
+++ b/fs/xfs/xfs_log_recover.c
@@ -1980,7 +1980,7 @@ xlog_recover_do_reg_buffer(
1980 "XFS: NULL dquot in %s.", __func__); 1980 "XFS: NULL dquot in %s.", __func__);
1981 goto next; 1981 goto next;
1982 } 1982 }
1983 if (item->ri_buf[i].i_len < sizeof(xfs_dqblk_t)) { 1983 if (item->ri_buf[i].i_len < sizeof(xfs_disk_dquot_t)) {
1984 cmn_err(CE_ALERT, 1984 cmn_err(CE_ALERT,
1985 "XFS: dquot too small (%d) in %s.", 1985 "XFS: dquot too small (%d) in %s.",
1986 item->ri_buf[i].i_len, __func__); 1986 item->ri_buf[i].i_len, __func__);
@@ -2635,7 +2635,7 @@ xlog_recover_do_dquot_trans(
2635 "XFS: NULL dquot in %s.", __func__); 2635 "XFS: NULL dquot in %s.", __func__);
2636 return XFS_ERROR(EIO); 2636 return XFS_ERROR(EIO);
2637 } 2637 }
2638 if (item->ri_buf[1].i_len < sizeof(xfs_dqblk_t)) { 2638 if (item->ri_buf[1].i_len < sizeof(xfs_disk_dquot_t)) {
2639 cmn_err(CE_ALERT, 2639 cmn_err(CE_ALERT,
2640 "XFS: dquot too small (%d) in %s.", 2640 "XFS: dquot too small (%d) in %s.",
2641 item->ri_buf[1].i_len, __func__); 2641 item->ri_buf[1].i_len, __func__);
diff --git a/fs/xfs/xfs_trans_ail.c b/fs/xfs/xfs_trans_ail.c
index f31271c30de9..2ffc570679be 100644
--- a/fs/xfs/xfs_trans_ail.c
+++ b/fs/xfs/xfs_trans_ail.c
@@ -467,6 +467,7 @@ xfs_trans_ail_update(
467{ 467{
468 xfs_log_item_t *dlip = NULL; 468 xfs_log_item_t *dlip = NULL;
469 xfs_log_item_t *mlip; /* ptr to minimum lip */ 469 xfs_log_item_t *mlip; /* ptr to minimum lip */
470 xfs_lsn_t tail_lsn;
470 471
471 mlip = xfs_ail_min(ailp); 472 mlip = xfs_ail_min(ailp);
472 473
@@ -483,8 +484,16 @@ xfs_trans_ail_update(
483 484
484 if (mlip == dlip) { 485 if (mlip == dlip) {
485 mlip = xfs_ail_min(ailp); 486 mlip = xfs_ail_min(ailp);
487 /*
488 * It is not safe to access mlip after the AIL lock is
489 * dropped, so we must get a copy of li_lsn before we do
490 * so. This is especially important on 32-bit platforms
491 * where accessing and updating 64-bit values like li_lsn
492 * is not atomic.
493 */
494 tail_lsn = mlip->li_lsn;
486 spin_unlock(&ailp->xa_lock); 495 spin_unlock(&ailp->xa_lock);
487 xfs_log_move_tail(ailp->xa_mount, mlip->li_lsn); 496 xfs_log_move_tail(ailp->xa_mount, tail_lsn);
488 } else { 497 } else {
489 spin_unlock(&ailp->xa_lock); 498 spin_unlock(&ailp->xa_lock);
490 } 499 }
@@ -514,6 +523,7 @@ xfs_trans_ail_delete(
514{ 523{
515 xfs_log_item_t *dlip; 524 xfs_log_item_t *dlip;
516 xfs_log_item_t *mlip; 525 xfs_log_item_t *mlip;
526 xfs_lsn_t tail_lsn;
517 527
518 if (lip->li_flags & XFS_LI_IN_AIL) { 528 if (lip->li_flags & XFS_LI_IN_AIL) {
519 mlip = xfs_ail_min(ailp); 529 mlip = xfs_ail_min(ailp);
@@ -527,9 +537,16 @@ xfs_trans_ail_delete(
527 537
528 if (mlip == dlip) { 538 if (mlip == dlip) {
529 mlip = xfs_ail_min(ailp); 539 mlip = xfs_ail_min(ailp);
540 /*
541 * It is not safe to access mlip after the AIL lock
542 * is dropped, so we must get a copy of li_lsn
543 * before we do so. This is especially important
544 * on 32-bit platforms where accessing and updating
545 * 64-bit values like li_lsn is not atomic.
546 */
547 tail_lsn = mlip ? mlip->li_lsn : 0;
530 spin_unlock(&ailp->xa_lock); 548 spin_unlock(&ailp->xa_lock);
531 xfs_log_move_tail(ailp->xa_mount, 549 xfs_log_move_tail(ailp->xa_mount, tail_lsn);
532 (mlip ? mlip->li_lsn : 0));
533 } else { 550 } else {
534 spin_unlock(&ailp->xa_lock); 551 spin_unlock(&ailp->xa_lock);
535 } 552 }
diff --git a/include/asm-generic/fcntl.h b/include/asm-generic/fcntl.h
index 0c3dd8603927..495dc8af4044 100644
--- a/include/asm-generic/fcntl.h
+++ b/include/asm-generic/fcntl.h
@@ -73,14 +73,23 @@
73#define F_SETSIG 10 /* for sockets. */ 73#define F_SETSIG 10 /* for sockets. */
74#define F_GETSIG 11 /* for sockets. */ 74#define F_GETSIG 11 /* for sockets. */
75#endif 75#endif
76
77#ifndef CONFIG_64BIT
78#ifndef F_GETLK64
79#define F_GETLK64 12 /* using 'struct flock64' */
80#define F_SETLK64 13
81#define F_SETLKW64 14
82#endif
83#endif
84
76#ifndef F_SETOWN_EX 85#ifndef F_SETOWN_EX
77#define F_SETOWN_EX 12 86#define F_SETOWN_EX 15
78#define F_GETOWN_EX 13 87#define F_GETOWN_EX 16
79#endif 88#endif
80 89
81#define F_OWNER_TID 0 90#define F_OWNER_TID 0
82#define F_OWNER_PID 1 91#define F_OWNER_PID 1
83#define F_OWNER_GID 2 92#define F_OWNER_PGRP 2
84 93
85struct f_owner_ex { 94struct f_owner_ex {
86 int type; 95 int type;
@@ -139,12 +148,6 @@ struct flock {
139 148
140#ifndef CONFIG_64BIT 149#ifndef CONFIG_64BIT
141 150
142#ifndef F_GETLK64
143#define F_GETLK64 12 /* using 'struct flock64' */
144#define F_SETLK64 13
145#define F_SETLKW64 14
146#endif
147
148#ifndef HAVE_ARCH_STRUCT_FLOCK64 151#ifndef HAVE_ARCH_STRUCT_FLOCK64
149#ifndef __ARCH_FLOCK64_PAD 152#ifndef __ARCH_FLOCK64_PAD
150#define __ARCH_FLOCK64_PAD 153#define __ARCH_FLOCK64_PAD
diff --git a/include/linux/Kbuild b/include/linux/Kbuild
index 1feed71551c9..5a5385749e16 100644
--- a/include/linux/Kbuild
+++ b/include/linux/Kbuild
@@ -330,6 +330,7 @@ unifdef-y += scc.h
330unifdef-y += sched.h 330unifdef-y += sched.h
331unifdef-y += screen_info.h 331unifdef-y += screen_info.h
332unifdef-y += sdla.h 332unifdef-y += sdla.h
333unifdef-y += securebits.h
333unifdef-y += selinux_netlink.h 334unifdef-y += selinux_netlink.h
334unifdef-y += sem.h 335unifdef-y += sem.h
335unifdef-y += serial_core.h 336unifdef-y += serial_core.h
diff --git a/include/linux/bootmem.h b/include/linux/bootmem.h
index dd97fb8408a8..b10ec49ee2dd 100644
--- a/include/linux/bootmem.h
+++ b/include/linux/bootmem.h
@@ -53,6 +53,7 @@ extern void free_bootmem_node(pg_data_t *pgdat,
53 unsigned long addr, 53 unsigned long addr,
54 unsigned long size); 54 unsigned long size);
55extern void free_bootmem(unsigned long addr, unsigned long size); 55extern void free_bootmem(unsigned long addr, unsigned long size);
56extern void free_bootmem_late(unsigned long addr, unsigned long size);
56 57
57/* 58/*
58 * Flags for reserve_bootmem (also if CONFIG_HAVE_ARCH_BOOTMEM_NODE, 59 * Flags for reserve_bootmem (also if CONFIG_HAVE_ARCH_BOOTMEM_NODE,
diff --git a/include/linux/capability.h b/include/linux/capability.h
index c8f2a5f70ed5..39e5ff512fbe 100644
--- a/include/linux/capability.h
+++ b/include/linux/capability.h
@@ -92,9 +92,7 @@ struct vfs_cap_data {
92#define _KERNEL_CAPABILITY_VERSION _LINUX_CAPABILITY_VERSION_3 92#define _KERNEL_CAPABILITY_VERSION _LINUX_CAPABILITY_VERSION_3
93#define _KERNEL_CAPABILITY_U32S _LINUX_CAPABILITY_U32S_3 93#define _KERNEL_CAPABILITY_U32S _LINUX_CAPABILITY_U32S_3
94 94
95#ifdef CONFIG_SECURITY_FILE_CAPABILITIES
96extern int file_caps_enabled; 95extern int file_caps_enabled;
97#endif
98 96
99typedef struct kernel_cap_struct { 97typedef struct kernel_cap_struct {
100 __u32 cap[_KERNEL_CAPABILITY_U32S]; 98 __u32 cap[_KERNEL_CAPABILITY_U32S];
diff --git a/include/linux/compiler-gcc.h b/include/linux/compiler-gcc.h
index a3ed7cb8ca34..73dcf804bc94 100644
--- a/include/linux/compiler-gcc.h
+++ b/include/linux/compiler-gcc.h
@@ -79,6 +79,7 @@
79#define noinline __attribute__((noinline)) 79#define noinline __attribute__((noinline))
80#define __attribute_const__ __attribute__((__const__)) 80#define __attribute_const__ __attribute__((__const__))
81#define __maybe_unused __attribute__((unused)) 81#define __maybe_unused __attribute__((unused))
82#define __always_unused __attribute__((unused))
82 83
83#define __gcc_header(x) #x 84#define __gcc_header(x) #x
84#define _gcc_header(x) __gcc_header(linux/compiler-gcc##x.h) 85#define _gcc_header(x) __gcc_header(linux/compiler-gcc##x.h)
diff --git a/include/linux/compiler-gcc4.h b/include/linux/compiler-gcc4.h
index 450fa597c94d..94dea3ffbfa1 100644
--- a/include/linux/compiler-gcc4.h
+++ b/include/linux/compiler-gcc4.h
@@ -36,4 +36,26 @@
36 the kernel context */ 36 the kernel context */
37#define __cold __attribute__((__cold__)) 37#define __cold __attribute__((__cold__))
38 38
39
40#if __GNUC_MINOR__ >= 5
41/*
42 * Mark a position in code as unreachable. This can be used to
43 * suppress control flow warnings after asm blocks that transfer
44 * control elsewhere.
45 *
46 * Early snapshots of gcc 4.5 don't support this and we can't detect
47 * this in the preprocessor, but we can live with this because they're
48 * unreleased. Really, we need to have autoconf for the kernel.
49 */
50#define unreachable() __builtin_unreachable()
51#endif
52
53#endif
54
55#if __GNUC_MINOR__ > 0
56#define __compiletime_object_size(obj) __builtin_object_size(obj, 0)
57#endif
58#if __GNUC_MINOR__ >= 4
59#define __compiletime_warning(message) __attribute__((warning(message)))
60#define __compiletime_error(message) __attribute__((error(message)))
39#endif 61#endif
diff --git a/include/linux/compiler.h b/include/linux/compiler.h
index 04fb5135b4e1..5be3dab4a695 100644
--- a/include/linux/compiler.h
+++ b/include/linux/compiler.h
@@ -144,6 +144,11 @@ void ftrace_likely_update(struct ftrace_branch_data *f, int val, int expect);
144# define barrier() __memory_barrier() 144# define barrier() __memory_barrier()
145#endif 145#endif
146 146
147/* Unreachable code */
148#ifndef unreachable
149# define unreachable() do { } while (1)
150#endif
151
147#ifndef RELOC_HIDE 152#ifndef RELOC_HIDE
148# define RELOC_HIDE(ptr, off) \ 153# define RELOC_HIDE(ptr, off) \
149 ({ unsigned long __ptr; \ 154 ({ unsigned long __ptr; \
@@ -213,6 +218,10 @@ void ftrace_likely_update(struct ftrace_branch_data *f, int val, int expect);
213# define __maybe_unused /* unimplemented */ 218# define __maybe_unused /* unimplemented */
214#endif 219#endif
215 220
221#ifndef __always_unused
222# define __always_unused /* unimplemented */
223#endif
224
216#ifndef noinline 225#ifndef noinline
217#define noinline 226#define noinline
218#endif 227#endif
@@ -266,6 +275,17 @@ void ftrace_likely_update(struct ftrace_branch_data *f, int val, int expect);
266# define __same_type(a, b) __builtin_types_compatible_p(typeof(a), typeof(b)) 275# define __same_type(a, b) __builtin_types_compatible_p(typeof(a), typeof(b))
267#endif 276#endif
268 277
278/* Compile time object size, -1 for unknown */
279#ifndef __compiletime_object_size
280# define __compiletime_object_size(obj) -1
281#endif
282#ifndef __compiletime_warning
283# define __compiletime_warning(message)
284#endif
285#ifndef __compiletime_error
286# define __compiletime_error(message)
287#endif
288
269/* 289/*
270 * Prevent the compiler from merging or refetching accesses. The compiler 290 * Prevent the compiler from merging or refetching accesses. The compiler
271 * is also forbidden from reordering successive instances of ACCESS_ONCE(), 291 * is also forbidden from reordering successive instances of ACCESS_ONCE(),
diff --git a/include/linux/dmar.h b/include/linux/dmar.h
index 4a2b162c256a..5de4c9e5856d 100644
--- a/include/linux/dmar.h
+++ b/include/linux/dmar.h
@@ -208,16 +208,9 @@ struct dmar_atsr_unit {
208 u8 include_all:1; /* include all ports */ 208 u8 include_all:1; /* include all ports */
209}; 209};
210 210
211/* Intel DMAR initialization functions */
212extern int intel_iommu_init(void); 211extern int intel_iommu_init(void);
213#else 212#else /* !CONFIG_DMAR: */
214static inline int intel_iommu_init(void) 213static inline int intel_iommu_init(void) { return -ENODEV; }
215{ 214#endif /* CONFIG_DMAR */
216#ifdef CONFIG_INTR_REMAP 215
217 return dmar_dev_scope_init();
218#else
219 return -ENODEV;
220#endif
221}
222#endif /* !CONFIG_DMAR */
223#endif /* __DMAR_H__ */ 216#endif /* __DMAR_H__ */
diff --git a/include/linux/ext3_fs_i.h b/include/linux/ext3_fs_i.h
index ca1bfe90004f..93e7428156ba 100644
--- a/include/linux/ext3_fs_i.h
+++ b/include/linux/ext3_fs_i.h
@@ -137,6 +137,14 @@ struct ext3_inode_info {
137 * by other means, so we have truncate_mutex. 137 * by other means, so we have truncate_mutex.
138 */ 138 */
139 struct mutex truncate_mutex; 139 struct mutex truncate_mutex;
140
141 /*
142 * Transactions that contain inode's metadata needed to complete
143 * fsync and fdatasync, respectively.
144 */
145 atomic_t i_sync_tid;
146 atomic_t i_datasync_tid;
147
140 struct inode vfs_inode; 148 struct inode vfs_inode;
141}; 149};
142 150
diff --git a/include/linux/fb.h b/include/linux/fb.h
index a34bdf5a9d23..de9c722e7b90 100644
--- a/include/linux/fb.h
+++ b/include/linux/fb.h
@@ -669,12 +669,6 @@ struct fb_ops {
669 /* perform fb specific mmap */ 669 /* perform fb specific mmap */
670 int (*fb_mmap)(struct fb_info *info, struct vm_area_struct *vma); 670 int (*fb_mmap)(struct fb_info *info, struct vm_area_struct *vma);
671 671
672 /* save current hardware state */
673 void (*fb_save_state)(struct fb_info *info);
674
675 /* restore saved state */
676 void (*fb_restore_state)(struct fb_info *info);
677
678 /* get capability given var */ 672 /* get capability given var */
679 void (*fb_get_caps)(struct fb_info *info, struct fb_blit_caps *caps, 673 void (*fb_get_caps)(struct fb_info *info, struct fb_blit_caps *caps,
680 struct fb_var_screeninfo *var); 674 struct fb_var_screeninfo *var);
diff --git a/include/linux/fscache-cache.h b/include/linux/fscache-cache.h
index 84d3532dd3ea..7be0c6fbe880 100644
--- a/include/linux/fscache-cache.h
+++ b/include/linux/fscache-cache.h
@@ -91,6 +91,8 @@ struct fscache_operation {
91#define FSCACHE_OP_WAITING 4 /* cleared when op is woken */ 91#define FSCACHE_OP_WAITING 4 /* cleared when op is woken */
92#define FSCACHE_OP_EXCLUSIVE 5 /* exclusive op, other ops must wait */ 92#define FSCACHE_OP_EXCLUSIVE 5 /* exclusive op, other ops must wait */
93#define FSCACHE_OP_DEAD 6 /* op is now dead */ 93#define FSCACHE_OP_DEAD 6 /* op is now dead */
94#define FSCACHE_OP_DEC_READ_CNT 7 /* decrement object->n_reads on destruction */
95#define FSCACHE_OP_KEEP_FLAGS 0xc0 /* flags to keep when repurposing an op */
94 96
95 atomic_t usage; 97 atomic_t usage;
96 unsigned debug_id; /* debugging ID */ 98 unsigned debug_id; /* debugging ID */
@@ -102,6 +104,16 @@ struct fscache_operation {
102 104
103 /* operation releaser */ 105 /* operation releaser */
104 fscache_operation_release_t release; 106 fscache_operation_release_t release;
107
108#ifdef CONFIG_SLOW_WORK_PROC
109 const char *name; /* operation name */
110 const char *state; /* operation state */
111#define fscache_set_op_name(OP, N) do { (OP)->name = (N); } while(0)
112#define fscache_set_op_state(OP, S) do { (OP)->state = (S); } while(0)
113#else
114#define fscache_set_op_name(OP, N) do { } while(0)
115#define fscache_set_op_state(OP, S) do { } while(0)
116#endif
105}; 117};
106 118
107extern atomic_t fscache_op_debug_id; 119extern atomic_t fscache_op_debug_id;
@@ -125,6 +137,7 @@ static inline void fscache_operation_init(struct fscache_operation *op,
125 op->debug_id = atomic_inc_return(&fscache_op_debug_id); 137 op->debug_id = atomic_inc_return(&fscache_op_debug_id);
126 op->release = release; 138 op->release = release;
127 INIT_LIST_HEAD(&op->pend_link); 139 INIT_LIST_HEAD(&op->pend_link);
140 fscache_set_op_state(op, "Init");
128} 141}
129 142
130/** 143/**
@@ -221,8 +234,10 @@ struct fscache_cache_ops {
221 struct fscache_object *(*alloc_object)(struct fscache_cache *cache, 234 struct fscache_object *(*alloc_object)(struct fscache_cache *cache,
222 struct fscache_cookie *cookie); 235 struct fscache_cookie *cookie);
223 236
224 /* look up the object for a cookie */ 237 /* look up the object for a cookie
225 void (*lookup_object)(struct fscache_object *object); 238 * - return -ETIMEDOUT to be requeued
239 */
240 int (*lookup_object)(struct fscache_object *object);
226 241
227 /* finished looking up */ 242 /* finished looking up */
228 void (*lookup_complete)(struct fscache_object *object); 243 void (*lookup_complete)(struct fscache_object *object);
@@ -297,12 +312,14 @@ struct fscache_cookie {
297 atomic_t usage; /* number of users of this cookie */ 312 atomic_t usage; /* number of users of this cookie */
298 atomic_t n_children; /* number of children of this cookie */ 313 atomic_t n_children; /* number of children of this cookie */
299 spinlock_t lock; 314 spinlock_t lock;
315 spinlock_t stores_lock; /* lock on page store tree */
300 struct hlist_head backing_objects; /* object(s) backing this file/index */ 316 struct hlist_head backing_objects; /* object(s) backing this file/index */
301 const struct fscache_cookie_def *def; /* definition */ 317 const struct fscache_cookie_def *def; /* definition */
302 struct fscache_cookie *parent; /* parent of this entry */ 318 struct fscache_cookie *parent; /* parent of this entry */
303 void *netfs_data; /* back pointer to netfs */ 319 void *netfs_data; /* back pointer to netfs */
304 struct radix_tree_root stores; /* pages to be stored on this cookie */ 320 struct radix_tree_root stores; /* pages to be stored on this cookie */
305#define FSCACHE_COOKIE_PENDING_TAG 0 /* pages tag: pending write to cache */ 321#define FSCACHE_COOKIE_PENDING_TAG 0 /* pages tag: pending write to cache */
322#define FSCACHE_COOKIE_STORING_TAG 1 /* pages tag: writing to cache */
306 323
307 unsigned long flags; 324 unsigned long flags;
308#define FSCACHE_COOKIE_LOOKING_UP 0 /* T if non-index cookie being looked up still */ 325#define FSCACHE_COOKIE_LOOKING_UP 0 /* T if non-index cookie being looked up still */
@@ -337,6 +354,7 @@ struct fscache_object {
337 FSCACHE_OBJECT_RECYCLING, /* retiring object */ 354 FSCACHE_OBJECT_RECYCLING, /* retiring object */
338 FSCACHE_OBJECT_WITHDRAWING, /* withdrawing object */ 355 FSCACHE_OBJECT_WITHDRAWING, /* withdrawing object */
339 FSCACHE_OBJECT_DEAD, /* object is now dead */ 356 FSCACHE_OBJECT_DEAD, /* object is now dead */
357 FSCACHE_OBJECT__NSTATES
340 } state; 358 } state;
341 359
342 int debug_id; /* debugging ID */ 360 int debug_id; /* debugging ID */
@@ -345,6 +363,7 @@ struct fscache_object {
345 int n_obj_ops; /* number of object ops outstanding on object */ 363 int n_obj_ops; /* number of object ops outstanding on object */
346 int n_in_progress; /* number of ops in progress */ 364 int n_in_progress; /* number of ops in progress */
347 int n_exclusive; /* number of exclusive ops queued */ 365 int n_exclusive; /* number of exclusive ops queued */
366 atomic_t n_reads; /* number of read ops in progress */
348 spinlock_t lock; /* state and operations lock */ 367 spinlock_t lock; /* state and operations lock */
349 368
350 unsigned long lookup_jif; /* time at which lookup started */ 369 unsigned long lookup_jif; /* time at which lookup started */
@@ -358,6 +377,7 @@ struct fscache_object {
358#define FSCACHE_OBJECT_EV_RELEASE 4 /* T if netfs requested object release */ 377#define FSCACHE_OBJECT_EV_RELEASE 4 /* T if netfs requested object release */
359#define FSCACHE_OBJECT_EV_RETIRE 5 /* T if netfs requested object retirement */ 378#define FSCACHE_OBJECT_EV_RETIRE 5 /* T if netfs requested object retirement */
360#define FSCACHE_OBJECT_EV_WITHDRAW 6 /* T if cache requested object withdrawal */ 379#define FSCACHE_OBJECT_EV_WITHDRAW 6 /* T if cache requested object withdrawal */
380#define FSCACHE_OBJECT_EVENTS_MASK 0x7f /* mask of all events*/
361 381
362 unsigned long flags; 382 unsigned long flags;
363#define FSCACHE_OBJECT_LOCK 0 /* T if object is busy being processed */ 383#define FSCACHE_OBJECT_LOCK 0 /* T if object is busy being processed */
@@ -373,7 +393,11 @@ struct fscache_object {
373 struct list_head dependents; /* FIFO of dependent objects */ 393 struct list_head dependents; /* FIFO of dependent objects */
374 struct list_head dep_link; /* link in parent's dependents list */ 394 struct list_head dep_link; /* link in parent's dependents list */
375 struct list_head pending_ops; /* unstarted operations on this object */ 395 struct list_head pending_ops; /* unstarted operations on this object */
396#ifdef CONFIG_FSCACHE_OBJECT_LIST
397 struct rb_node objlist_link; /* link in global object list */
398#endif
376 pgoff_t store_limit; /* current storage limit */ 399 pgoff_t store_limit; /* current storage limit */
400 loff_t store_limit_l; /* current storage limit */
377}; 401};
378 402
379extern const char *fscache_object_states[]; 403extern const char *fscache_object_states[];
@@ -383,6 +407,10 @@ extern const char *fscache_object_states[];
383 (obj)->state >= FSCACHE_OBJECT_AVAILABLE && \ 407 (obj)->state >= FSCACHE_OBJECT_AVAILABLE && \
384 (obj)->state < FSCACHE_OBJECT_DYING) 408 (obj)->state < FSCACHE_OBJECT_DYING)
385 409
410#define fscache_object_is_dead(obj) \
411 (test_bit(FSCACHE_IOERROR, &(obj)->cache->flags) && \
412 (obj)->state >= FSCACHE_OBJECT_DYING)
413
386extern const struct slow_work_ops fscache_object_slow_work_ops; 414extern const struct slow_work_ops fscache_object_slow_work_ops;
387 415
388/** 416/**
@@ -414,6 +442,7 @@ void fscache_object_init(struct fscache_object *object,
414 object->events = object->event_mask = 0; 442 object->events = object->event_mask = 0;
415 object->flags = 0; 443 object->flags = 0;
416 object->store_limit = 0; 444 object->store_limit = 0;
445 object->store_limit_l = 0;
417 object->cache = cache; 446 object->cache = cache;
418 object->cookie = cookie; 447 object->cookie = cookie;
419 object->parent = NULL; 448 object->parent = NULL;
@@ -422,6 +451,12 @@ void fscache_object_init(struct fscache_object *object,
422extern void fscache_object_lookup_negative(struct fscache_object *object); 451extern void fscache_object_lookup_negative(struct fscache_object *object);
423extern void fscache_obtained_object(struct fscache_object *object); 452extern void fscache_obtained_object(struct fscache_object *object);
424 453
454#ifdef CONFIG_FSCACHE_OBJECT_LIST
455extern void fscache_object_destroy(struct fscache_object *object);
456#else
457#define fscache_object_destroy(object) do {} while(0)
458#endif
459
425/** 460/**
426 * fscache_object_destroyed - Note destruction of an object in a cache 461 * fscache_object_destroyed - Note destruction of an object in a cache
427 * @cache: The cache from which the object came 462 * @cache: The cache from which the object came
@@ -460,6 +495,7 @@ static inline void fscache_object_lookup_error(struct fscache_object *object)
460static inline 495static inline
461void fscache_set_store_limit(struct fscache_object *object, loff_t i_size) 496void fscache_set_store_limit(struct fscache_object *object, loff_t i_size)
462{ 497{
498 object->store_limit_l = i_size;
463 object->store_limit = i_size >> PAGE_SHIFT; 499 object->store_limit = i_size >> PAGE_SHIFT;
464 if (i_size & ~PAGE_MASK) 500 if (i_size & ~PAGE_MASK)
465 object->store_limit++; 501 object->store_limit++;
diff --git a/include/linux/fscache.h b/include/linux/fscache.h
index 6d8ee466e0a0..595ce49288b7 100644
--- a/include/linux/fscache.h
+++ b/include/linux/fscache.h
@@ -202,6 +202,8 @@ extern int __fscache_write_page(struct fscache_cookie *, struct page *, gfp_t);
202extern void __fscache_uncache_page(struct fscache_cookie *, struct page *); 202extern void __fscache_uncache_page(struct fscache_cookie *, struct page *);
203extern bool __fscache_check_page_write(struct fscache_cookie *, struct page *); 203extern bool __fscache_check_page_write(struct fscache_cookie *, struct page *);
204extern void __fscache_wait_on_page_write(struct fscache_cookie *, struct page *); 204extern void __fscache_wait_on_page_write(struct fscache_cookie *, struct page *);
205extern bool __fscache_maybe_release_page(struct fscache_cookie *, struct page *,
206 gfp_t);
205 207
206/** 208/**
207 * fscache_register_netfs - Register a filesystem as desiring caching services 209 * fscache_register_netfs - Register a filesystem as desiring caching services
@@ -615,4 +617,29 @@ void fscache_wait_on_page_write(struct fscache_cookie *cookie,
615 __fscache_wait_on_page_write(cookie, page); 617 __fscache_wait_on_page_write(cookie, page);
616} 618}
617 619
620/**
621 * fscache_maybe_release_page - Consider releasing a page, cancelling a store
622 * @cookie: The cookie representing the cache object
623 * @page: The netfs page that is being cached.
624 * @gfp: The gfp flags passed to releasepage()
625 *
626 * Consider releasing a page for the vmscan algorithm, on behalf of the netfs's
627 * releasepage() call. A storage request on the page may cancelled if it is
628 * not currently being processed.
629 *
630 * The function returns true if the page no longer has a storage request on it,
631 * and false if a storage request is left in place. If true is returned, the
632 * page will have been passed to fscache_uncache_page(). If false is returned
633 * the page cannot be freed yet.
634 */
635static inline
636bool fscache_maybe_release_page(struct fscache_cookie *cookie,
637 struct page *page,
638 gfp_t gfp)
639{
640 if (fscache_cookie_valid(cookie) && PageFsCache(page))
641 return __fscache_maybe_release_page(cookie, page, gfp);
642 return false;
643}
644
618#endif /* _LINUX_FSCACHE_H */ 645#endif /* _LINUX_FSCACHE_H */
diff --git a/include/linux/ftrace_event.h b/include/linux/ftrace_event.h
index 4ec5e67e18cf..47bbdf9c38d0 100644
--- a/include/linux/ftrace_event.h
+++ b/include/linux/ftrace_event.h
@@ -117,12 +117,12 @@ struct ftrace_event_call {
117 struct dentry *dir; 117 struct dentry *dir;
118 struct trace_event *event; 118 struct trace_event *event;
119 int enabled; 119 int enabled;
120 int (*regfunc)(void *); 120 int (*regfunc)(struct ftrace_event_call *);
121 void (*unregfunc)(void *); 121 void (*unregfunc)(struct ftrace_event_call *);
122 int id; 122 int id;
123 int (*raw_init)(void); 123 int (*raw_init)(struct ftrace_event_call *);
124 int (*show_format)(struct ftrace_event_call *call, 124 int (*show_format)(struct ftrace_event_call *,
125 struct trace_seq *s); 125 struct trace_seq *);
126 int (*define_fields)(struct ftrace_event_call *); 126 int (*define_fields)(struct ftrace_event_call *);
127 struct list_head fields; 127 struct list_head fields;
128 int filter_active; 128 int filter_active;
@@ -131,20 +131,20 @@ struct ftrace_event_call {
131 void *data; 131 void *data;
132 132
133 atomic_t profile_count; 133 atomic_t profile_count;
134 int (*profile_enable)(void); 134 int (*profile_enable)(struct ftrace_event_call *);
135 void (*profile_disable)(void); 135 void (*profile_disable)(struct ftrace_event_call *);
136}; 136};
137 137
138#define FTRACE_MAX_PROFILE_SIZE 2048 138#define FTRACE_MAX_PROFILE_SIZE 2048
139 139
140extern char *trace_profile_buf; 140extern char *perf_trace_buf;
141extern char *trace_profile_buf_nmi; 141extern char *perf_trace_buf_nmi;
142 142
143#define MAX_FILTER_PRED 32 143#define MAX_FILTER_PRED 32
144#define MAX_FILTER_STR_VAL 256 /* Should handle KSYM_SYMBOL_LEN */ 144#define MAX_FILTER_STR_VAL 256 /* Should handle KSYM_SYMBOL_LEN */
145 145
146extern void destroy_preds(struct ftrace_event_call *call); 146extern void destroy_preds(struct ftrace_event_call *call);
147extern int filter_match_preds(struct ftrace_event_call *call, void *rec); 147extern int filter_match_preds(struct event_filter *filter, void *rec);
148extern int filter_current_check_discard(struct ring_buffer *buffer, 148extern int filter_current_check_discard(struct ring_buffer *buffer,
149 struct ftrace_event_call *call, 149 struct ftrace_event_call *call,
150 void *rec, 150 void *rec,
@@ -157,11 +157,12 @@ enum {
157 FILTER_PTR_STRING, 157 FILTER_PTR_STRING,
158}; 158};
159 159
160extern int trace_define_field(struct ftrace_event_call *call,
161 const char *type, const char *name,
162 int offset, int size, int is_signed,
163 int filter_type);
164extern int trace_define_common_fields(struct ftrace_event_call *call); 160extern int trace_define_common_fields(struct ftrace_event_call *call);
161extern int trace_define_field(struct ftrace_event_call *call, const char *type,
162 const char *name, int offset, int size,
163 int is_signed, int filter_type);
164extern int trace_add_event_call(struct ftrace_event_call *call);
165extern void trace_remove_event_call(struct ftrace_event_call *call);
165 166
166#define is_signed_type(type) (((type)(-1)) < 0) 167#define is_signed_type(type) (((type)(-1)) < 0)
167 168
@@ -186,4 +187,13 @@ do { \
186 __trace_printk(ip, fmt, ##args); \ 187 __trace_printk(ip, fmt, ##args); \
187} while (0) 188} while (0)
188 189
190#ifdef CONFIG_EVENT_PROFILE
191struct perf_event;
192extern int ftrace_profile_enable(int event_id);
193extern void ftrace_profile_disable(int event_id);
194extern int ftrace_profile_set_filter(struct perf_event *event, int event_id,
195 char *filter_str);
196extern void ftrace_profile_free_filter(struct perf_event *event);
197#endif
198
189#endif /* _LINUX_FTRACE_EVENT_H */ 199#endif /* _LINUX_FTRACE_EVENT_H */
diff --git a/include/linux/gfs2_ondisk.h b/include/linux/gfs2_ondisk.h
index b80c88dedbbb..81f90a59cda6 100644
--- a/include/linux/gfs2_ondisk.h
+++ b/include/linux/gfs2_ondisk.h
@@ -81,7 +81,11 @@ struct gfs2_meta_header {
81 __be32 mh_type; 81 __be32 mh_type;
82 __be64 __pad0; /* Was generation number in gfs1 */ 82 __be64 __pad0; /* Was generation number in gfs1 */
83 __be32 mh_format; 83 __be32 mh_format;
84 __be32 __pad1; /* Was incarnation number in gfs1 */ 84 /* This union is to keep userspace happy */
85 union {
86 __be32 mh_jid; /* Was incarnation number in gfs1 */
87 __be32 __pad1;
88 };
85}; 89};
86 90
87/* 91/*
diff --git a/include/linux/hardirq.h b/include/linux/hardirq.h
index 6d527ee82b2b..d5b387669dab 100644
--- a/include/linux/hardirq.h
+++ b/include/linux/hardirq.h
@@ -139,10 +139,34 @@ static inline void account_system_vtime(struct task_struct *tsk)
139#endif 139#endif
140 140
141#if defined(CONFIG_NO_HZ) 141#if defined(CONFIG_NO_HZ)
142#if defined(CONFIG_TINY_RCU)
143extern void rcu_enter_nohz(void);
144extern void rcu_exit_nohz(void);
145
146static inline void rcu_irq_enter(void)
147{
148 rcu_exit_nohz();
149}
150
151static inline void rcu_irq_exit(void)
152{
153 rcu_enter_nohz();
154}
155
156static inline void rcu_nmi_enter(void)
157{
158}
159
160static inline void rcu_nmi_exit(void)
161{
162}
163
164#else
142extern void rcu_irq_enter(void); 165extern void rcu_irq_enter(void);
143extern void rcu_irq_exit(void); 166extern void rcu_irq_exit(void);
144extern void rcu_nmi_enter(void); 167extern void rcu_nmi_enter(void);
145extern void rcu_nmi_exit(void); 168extern void rcu_nmi_exit(void);
169#endif
146#else 170#else
147# define rcu_irq_enter() do { } while (0) 171# define rcu_irq_enter() do { } while (0)
148# define rcu_irq_exit() do { } while (0) 172# define rcu_irq_exit() do { } while (0)
diff --git a/include/linux/hw_breakpoint.h b/include/linux/hw_breakpoint.h
new file mode 100644
index 000000000000..a03daed08c59
--- /dev/null
+++ b/include/linux/hw_breakpoint.h
@@ -0,0 +1,131 @@
1#ifndef _LINUX_HW_BREAKPOINT_H
2#define _LINUX_HW_BREAKPOINT_H
3
4enum {
5 HW_BREAKPOINT_LEN_1 = 1,
6 HW_BREAKPOINT_LEN_2 = 2,
7 HW_BREAKPOINT_LEN_4 = 4,
8 HW_BREAKPOINT_LEN_8 = 8,
9};
10
11enum {
12 HW_BREAKPOINT_R = 1,
13 HW_BREAKPOINT_W = 2,
14 HW_BREAKPOINT_X = 4,
15};
16
17#ifdef __KERNEL__
18
19#include <linux/perf_event.h>
20
21#ifdef CONFIG_HAVE_HW_BREAKPOINT
22
23/* As it's for in-kernel or ptrace use, we want it to be pinned */
24#define DEFINE_BREAKPOINT_ATTR(name) \
25struct perf_event_attr name = { \
26 .type = PERF_TYPE_BREAKPOINT, \
27 .size = sizeof(name), \
28 .pinned = 1, \
29};
30
31static inline void hw_breakpoint_init(struct perf_event_attr *attr)
32{
33 attr->type = PERF_TYPE_BREAKPOINT;
34 attr->size = sizeof(*attr);
35 attr->pinned = 1;
36}
37
38static inline unsigned long hw_breakpoint_addr(struct perf_event *bp)
39{
40 return bp->attr.bp_addr;
41}
42
43static inline int hw_breakpoint_type(struct perf_event *bp)
44{
45 return bp->attr.bp_type;
46}
47
48static inline int hw_breakpoint_len(struct perf_event *bp)
49{
50 return bp->attr.bp_len;
51}
52
53extern struct perf_event *
54register_user_hw_breakpoint(struct perf_event_attr *attr,
55 perf_callback_t triggered,
56 struct task_struct *tsk);
57
58/* FIXME: only change from the attr, and don't unregister */
59extern struct perf_event *
60modify_user_hw_breakpoint(struct perf_event *bp,
61 struct perf_event_attr *attr,
62 perf_callback_t triggered,
63 struct task_struct *tsk);
64
65/*
66 * Kernel breakpoints are not associated with any particular thread.
67 */
68extern struct perf_event *
69register_wide_hw_breakpoint_cpu(struct perf_event_attr *attr,
70 perf_callback_t triggered,
71 int cpu);
72
73extern struct perf_event **
74register_wide_hw_breakpoint(struct perf_event_attr *attr,
75 perf_callback_t triggered);
76
77extern int register_perf_hw_breakpoint(struct perf_event *bp);
78extern int __register_perf_hw_breakpoint(struct perf_event *bp);
79extern void unregister_hw_breakpoint(struct perf_event *bp);
80extern void unregister_wide_hw_breakpoint(struct perf_event **cpu_events);
81
82extern int reserve_bp_slot(struct perf_event *bp);
83extern void release_bp_slot(struct perf_event *bp);
84
85extern void flush_ptrace_hw_breakpoint(struct task_struct *tsk);
86
87static inline struct arch_hw_breakpoint *counter_arch_bp(struct perf_event *bp)
88{
89 return &bp->hw.info;
90}
91
92#else /* !CONFIG_HAVE_HW_BREAKPOINT */
93
94static inline struct perf_event *
95register_user_hw_breakpoint(struct perf_event_attr *attr,
96 perf_callback_t triggered,
97 struct task_struct *tsk) { return NULL; }
98static inline struct perf_event *
99modify_user_hw_breakpoint(struct perf_event *bp,
100 struct perf_event_attr *attr,
101 perf_callback_t triggered,
102 struct task_struct *tsk) { return NULL; }
103static inline struct perf_event *
104register_wide_hw_breakpoint_cpu(struct perf_event_attr *attr,
105 perf_callback_t triggered,
106 int cpu) { return NULL; }
107static inline struct perf_event **
108register_wide_hw_breakpoint(struct perf_event_attr *attr,
109 perf_callback_t triggered) { return NULL; }
110static inline int
111register_perf_hw_breakpoint(struct perf_event *bp) { return -ENOSYS; }
112static inline int
113__register_perf_hw_breakpoint(struct perf_event *bp) { return -ENOSYS; }
114static inline void unregister_hw_breakpoint(struct perf_event *bp) { }
115static inline void
116unregister_wide_hw_breakpoint(struct perf_event **cpu_events) { }
117static inline int
118reserve_bp_slot(struct perf_event *bp) {return -ENOSYS; }
119static inline void release_bp_slot(struct perf_event *bp) { }
120
121static inline void flush_ptrace_hw_breakpoint(struct task_struct *tsk) { }
122
123static inline struct arch_hw_breakpoint *counter_arch_bp(struct perf_event *bp)
124{
125 return NULL;
126}
127
128#endif /* CONFIG_HAVE_HW_BREAKPOINT */
129#endif /* __KERNEL__ */
130
131#endif /* _LINUX_HW_BREAKPOINT_H */
diff --git a/include/linux/i2c-pnx.h b/include/linux/i2c-pnx.h
index f13255e06406..9eb07bbc6522 100644
--- a/include/linux/i2c-pnx.h
+++ b/include/linux/i2c-pnx.h
@@ -21,7 +21,7 @@ struct i2c_pnx_mif {
21 int mode; /* Interface mode */ 21 int mode; /* Interface mode */
22 struct completion complete; /* I/O completion */ 22 struct completion complete; /* I/O completion */
23 struct timer_list timer; /* Timeout */ 23 struct timer_list timer; /* Timeout */
24 char * buf; /* Data buffer */ 24 u8 * buf; /* Data buffer */
25 int len; /* Length of data buffer */ 25 int len; /* Length of data buffer */
26}; 26};
27 27
diff --git a/include/linux/i2c.h b/include/linux/i2c.h
index 57d41b0abce2..7b40cda57a70 100644
--- a/include/linux/i2c.h
+++ b/include/linux/i2c.h
@@ -361,6 +361,24 @@ static inline void i2c_set_adapdata(struct i2c_adapter *dev, void *data)
361 dev_set_drvdata(&dev->dev, data); 361 dev_set_drvdata(&dev->dev, data);
362} 362}
363 363
364/**
365 * i2c_lock_adapter - Prevent access to an I2C bus segment
366 * @adapter: Target I2C bus segment
367 */
368static inline void i2c_lock_adapter(struct i2c_adapter *adapter)
369{
370 mutex_lock(&adapter->bus_lock);
371}
372
373/**
374 * i2c_unlock_adapter - Reauthorize access to an I2C bus segment
375 * @adapter: Target I2C bus segment
376 */
377static inline void i2c_unlock_adapter(struct i2c_adapter *adapter)
378{
379 mutex_unlock(&adapter->bus_lock);
380}
381
364/*flags for the client struct: */ 382/*flags for the client struct: */
365#define I2C_CLIENT_PEC 0x04 /* Use Packet Error Checking */ 383#define I2C_CLIENT_PEC 0x04 /* Use Packet Error Checking */
366#define I2C_CLIENT_TEN 0x10 /* we have a ten bit chip address */ 384#define I2C_CLIENT_TEN 0x10 /* we have a ten bit chip address */
diff --git a/include/linux/init_task.h b/include/linux/init_task.h
index 21a6f5d9af22..8d10aa7fd4c9 100644
--- a/include/linux/init_task.h
+++ b/include/linux/init_task.h
@@ -83,16 +83,12 @@ extern struct group_info init_groups;
83#define INIT_IDS 83#define INIT_IDS
84#endif 84#endif
85 85
86#ifdef CONFIG_SECURITY_FILE_CAPABILITIES
87/* 86/*
88 * Because of the reduced scope of CAP_SETPCAP when filesystem 87 * Because of the reduced scope of CAP_SETPCAP when filesystem
89 * capabilities are in effect, it is safe to allow CAP_SETPCAP to 88 * capabilities are in effect, it is safe to allow CAP_SETPCAP to
90 * be available in the default configuration. 89 * be available in the default configuration.
91 */ 90 */
92# define CAP_INIT_BSET CAP_FULL_SET 91# define CAP_INIT_BSET CAP_FULL_SET
93#else
94# define CAP_INIT_BSET CAP_INIT_EFF_SET
95#endif
96 92
97#ifdef CONFIG_TREE_PREEMPT_RCU 93#ifdef CONFIG_TREE_PREEMPT_RCU
98#define INIT_TASK_RCU_PREEMPT(tsk) \ 94#define INIT_TASK_RCU_PREEMPT(tsk) \
diff --git a/include/linux/input.h b/include/linux/input.h
index 0ccfc30cd40f..c2b1a7d244d9 100644
--- a/include/linux/input.h
+++ b/include/linux/input.h
@@ -1377,6 +1377,10 @@ extern struct class input_class;
1377 * methods; erase() is optional. set_gain() and set_autocenter() need 1377 * methods; erase() is optional. set_gain() and set_autocenter() need
1378 * only be implemented if driver sets up FF_GAIN and FF_AUTOCENTER 1378 * only be implemented if driver sets up FF_GAIN and FF_AUTOCENTER
1379 * bits. 1379 * bits.
1380 *
1381 * Note that playback(), set_gain() and set_autocenter() are called with
1382 * dev->event_lock spinlock held and interrupts off and thus may not
1383 * sleep.
1380 */ 1384 */
1381struct ff_device { 1385struct ff_device {
1382 int (*upload)(struct input_dev *dev, struct ff_effect *effect, 1386 int (*upload)(struct input_dev *dev, struct ff_effect *effect,
diff --git a/include/linux/interrupt.h b/include/linux/interrupt.h
index 7ca72b74eec7..75f3f00ac1e5 100644
--- a/include/linux/interrupt.h
+++ b/include/linux/interrupt.h
@@ -603,12 +603,6 @@ static inline void init_irq_proc(void)
603} 603}
604#endif 604#endif
605 605
606#if defined(CONFIG_GENERIC_HARDIRQS) && defined(CONFIG_DEBUG_SHIRQ)
607extern void debug_poll_all_shared_irqs(void);
608#else
609static inline void debug_poll_all_shared_irqs(void) { }
610#endif
611
612struct seq_file; 606struct seq_file;
613int show_interrupts(struct seq_file *p, void *v); 607int show_interrupts(struct seq_file *p, void *v);
614 608
diff --git a/include/linux/irqflags.h b/include/linux/irqflags.h
index b02a3f1d46a0..006bf45eae30 100644
--- a/include/linux/irqflags.h
+++ b/include/linux/irqflags.h
@@ -124,6 +124,6 @@
124 typecheck(unsigned long, flags); \ 124 typecheck(unsigned long, flags); \
125 raw_irqs_disabled_flags(flags); \ 125 raw_irqs_disabled_flags(flags); \
126}) 126})
127#endif /* CONFIG_X86 */ 127#endif /* CONFIG_TRACE_IRQFLAGS_SUPPORT */
128 128
129#endif 129#endif
diff --git a/include/linux/isdn_ppp.h b/include/linux/isdn_ppp.h
index 4c218ee7587a..8687a7dc0632 100644
--- a/include/linux/isdn_ppp.h
+++ b/include/linux/isdn_ppp.h
@@ -157,7 +157,7 @@ typedef struct {
157 157
158typedef struct { 158typedef struct {
159 int mp_mrru; /* unused */ 159 int mp_mrru; /* unused */
160 struct sk_buff_head frags; /* fragments sl list */ 160 struct sk_buff * frags; /* fragments sl list -- use skb->next */
161 long frames; /* number of frames in the frame list */ 161 long frames; /* number of frames in the frame list */
162 unsigned int seq; /* last processed packet seq #: any packets 162 unsigned int seq; /* last processed packet seq #: any packets
163 * with smaller seq # will be dropped 163 * with smaller seq # will be dropped
diff --git a/include/linux/jiffies.h b/include/linux/jiffies.h
index 1a9cf78bfce5..6811f4bfc6e7 100644
--- a/include/linux/jiffies.h
+++ b/include/linux/jiffies.h
@@ -307,6 +307,7 @@ extern clock_t jiffies_to_clock_t(long x);
307extern unsigned long clock_t_to_jiffies(unsigned long x); 307extern unsigned long clock_t_to_jiffies(unsigned long x);
308extern u64 jiffies_64_to_clock_t(u64 x); 308extern u64 jiffies_64_to_clock_t(u64 x);
309extern u64 nsec_to_clock_t(u64 x); 309extern u64 nsec_to_clock_t(u64 x);
310extern unsigned long nsecs_to_jiffies(u64 n);
310 311
311#define TIMESTAMP_SIZE 30 312#define TIMESTAMP_SIZE 30
312 313
diff --git a/include/linux/kernel.h b/include/linux/kernel.h
index f4e3184fa054..3fa4c590cf12 100644
--- a/include/linux/kernel.h
+++ b/include/linux/kernel.h
@@ -15,7 +15,6 @@
15#include <linux/bitops.h> 15#include <linux/bitops.h>
16#include <linux/log2.h> 16#include <linux/log2.h>
17#include <linux/typecheck.h> 17#include <linux/typecheck.h>
18#include <linux/ratelimit.h>
19#include <linux/dynamic_debug.h> 18#include <linux/dynamic_debug.h>
20#include <asm/byteorder.h> 19#include <asm/byteorder.h>
21#include <asm/bug.h> 20#include <asm/bug.h>
@@ -241,8 +240,8 @@ asmlinkage int vprintk(const char *fmt, va_list args)
241asmlinkage int printk(const char * fmt, ...) 240asmlinkage int printk(const char * fmt, ...)
242 __attribute__ ((format (printf, 1, 2))) __cold; 241 __attribute__ ((format (printf, 1, 2))) __cold;
243 242
244extern struct ratelimit_state printk_ratelimit_state; 243extern int __printk_ratelimit(const char *func);
245extern int printk_ratelimit(void); 244#define printk_ratelimit() __printk_ratelimit(__func__)
246extern bool printk_timed_ratelimit(unsigned long *caller_jiffies, 245extern bool printk_timed_ratelimit(unsigned long *caller_jiffies,
247 unsigned int interval_msec); 246 unsigned int interval_msec);
248 247
diff --git a/include/linux/kernel_stat.h b/include/linux/kernel_stat.h
index 348fa8874b52..c059044bc6dc 100644
--- a/include/linux/kernel_stat.h
+++ b/include/linux/kernel_stat.h
@@ -25,6 +25,7 @@ struct cpu_usage_stat {
25 cputime64_t iowait; 25 cputime64_t iowait;
26 cputime64_t steal; 26 cputime64_t steal;
27 cputime64_t guest; 27 cputime64_t guest;
28 cputime64_t guest_nice;
28}; 29};
29 30
30struct kernel_stat { 31struct kernel_stat {
diff --git a/include/linux/kprobes.h b/include/linux/kprobes.h
index 3a46b7b7abb2..1b672f74a32f 100644
--- a/include/linux/kprobes.h
+++ b/include/linux/kprobes.h
@@ -296,6 +296,8 @@ void recycle_rp_inst(struct kretprobe_instance *ri, struct hlist_head *head);
296int disable_kprobe(struct kprobe *kp); 296int disable_kprobe(struct kprobe *kp);
297int enable_kprobe(struct kprobe *kp); 297int enable_kprobe(struct kprobe *kp);
298 298
299void dump_kprobe(struct kprobe *kp);
300
299#else /* !CONFIG_KPROBES: */ 301#else /* !CONFIG_KPROBES: */
300 302
301static inline int kprobes_built_in(void) 303static inline int kprobes_built_in(void)
diff --git a/include/linux/lsm_audit.h b/include/linux/lsm_audit.h
index 190c37854870..f78f83d7663f 100644
--- a/include/linux/lsm_audit.h
+++ b/include/linux/lsm_audit.h
@@ -26,14 +26,15 @@
26 26
27/* Auxiliary data to use in generating the audit record. */ 27/* Auxiliary data to use in generating the audit record. */
28struct common_audit_data { 28struct common_audit_data {
29 char type; 29 char type;
30#define LSM_AUDIT_DATA_FS 1 30#define LSM_AUDIT_DATA_FS 1
31#define LSM_AUDIT_DATA_NET 2 31#define LSM_AUDIT_DATA_NET 2
32#define LSM_AUDIT_DATA_CAP 3 32#define LSM_AUDIT_DATA_CAP 3
33#define LSM_AUDIT_DATA_IPC 4 33#define LSM_AUDIT_DATA_IPC 4
34#define LSM_AUDIT_DATA_TASK 5 34#define LSM_AUDIT_DATA_TASK 5
35#define LSM_AUDIT_DATA_KEY 6 35#define LSM_AUDIT_DATA_KEY 6
36#define LSM_AUDIT_NO_AUDIT 7 36#define LSM_AUDIT_NO_AUDIT 7
37#define LSM_AUDIT_DATA_KMOD 8
37 struct task_struct *tsk; 38 struct task_struct *tsk;
38 union { 39 union {
39 struct { 40 struct {
@@ -66,6 +67,7 @@ struct common_audit_data {
66 char *key_desc; 67 char *key_desc;
67 } key_struct; 68 } key_struct;
68#endif 69#endif
70 char *kmod_name;
69 } u; 71 } u;
70 /* this union contains LSM specific data */ 72 /* this union contains LSM specific data */
71 union { 73 union {
diff --git a/include/linux/mfd/wm831x/regulator.h b/include/linux/mfd/wm831x/regulator.h
index f95466343fb2..955d30fc6a27 100644
--- a/include/linux/mfd/wm831x/regulator.h
+++ b/include/linux/mfd/wm831x/regulator.h
@@ -1212,7 +1212,7 @@
1212#define WM831X_LDO1_OK_SHIFT 0 /* LDO1_OK */ 1212#define WM831X_LDO1_OK_SHIFT 0 /* LDO1_OK */
1213#define WM831X_LDO1_OK_WIDTH 1 /* LDO1_OK */ 1213#define WM831X_LDO1_OK_WIDTH 1 /* LDO1_OK */
1214 1214
1215#define WM831X_ISINK_MAX_ISEL 56 1215#define WM831X_ISINK_MAX_ISEL 55
1216extern int wm831x_isinkv_values[WM831X_ISINK_MAX_ISEL]; 1216extern int wm831x_isinkv_values[WM831X_ISINK_MAX_ISEL + 1];
1217 1217
1218#endif 1218#endif
diff --git a/include/linux/net.h b/include/linux/net.h
index 529a0931711d..d7e26e30c8c2 100644
--- a/include/linux/net.h
+++ b/include/linux/net.h
@@ -358,6 +358,7 @@ static const struct proto_ops name##_ops = { \
358 358
359#ifdef CONFIG_SYSCTL 359#ifdef CONFIG_SYSCTL
360#include <linux/sysctl.h> 360#include <linux/sysctl.h>
361#include <linux/ratelimit.h>
361extern struct ratelimit_state net_ratelimit_state; 362extern struct ratelimit_state net_ratelimit_state;
362#endif 363#endif
363 364
diff --git a/include/linux/nilfs2_fs.h b/include/linux/nilfs2_fs.h
index 79fec6af3f9f..ce520402e840 100644
--- a/include/linux/nilfs2_fs.h
+++ b/include/linux/nilfs2_fs.h
@@ -425,15 +425,6 @@ struct nilfs_dat_entry {
425}; 425};
426 426
427/** 427/**
428 * struct nilfs_dat_group_desc - block group descriptor
429 * @dg_nfrees: number of free virtual block numbers in block group
430 */
431struct nilfs_dat_group_desc {
432 __le32 dg_nfrees;
433};
434
435
436/**
437 * struct nilfs_snapshot_list - snapshot list 428 * struct nilfs_snapshot_list - snapshot list
438 * @ssl_next: next checkpoint number on snapshot list 429 * @ssl_next: next checkpoint number on snapshot list
439 * @ssl_prev: previous checkpoint number on snapshot list 430 * @ssl_prev: previous checkpoint number on snapshot list
diff --git a/include/linux/pci_ids.h b/include/linux/pci_ids.h
index b0f0f3851cd4..daecca3c8300 100644
--- a/include/linux/pci_ids.h
+++ b/include/linux/pci_ids.h
@@ -543,7 +543,7 @@
543#define PCI_DEVICE_ID_AMD_8131_BRIDGE 0x7450 543#define PCI_DEVICE_ID_AMD_8131_BRIDGE 0x7450
544#define PCI_DEVICE_ID_AMD_8131_APIC 0x7451 544#define PCI_DEVICE_ID_AMD_8131_APIC 0x7451
545#define PCI_DEVICE_ID_AMD_8132_BRIDGE 0x7458 545#define PCI_DEVICE_ID_AMD_8132_BRIDGE 0x7458
546#define PCI_DEVICE_ID_AMD_SB900_SMBUS 0x780b 546#define PCI_DEVICE_ID_AMD_HUDSON2_SMBUS 0x780b
547#define PCI_DEVICE_ID_AMD_CS5535_IDE 0x208F 547#define PCI_DEVICE_ID_AMD_CS5535_IDE 0x208F
548#define PCI_DEVICE_ID_AMD_CS5536_ISA 0x2090 548#define PCI_DEVICE_ID_AMD_CS5536_ISA 0x2090
549#define PCI_DEVICE_ID_AMD_CS5536_FLASH 0x2091 549#define PCI_DEVICE_ID_AMD_CS5536_FLASH 0x2091
@@ -1633,6 +1633,8 @@
1633#define PCI_DEVICE_ID_O2_6730 0x673a 1633#define PCI_DEVICE_ID_O2_6730 0x673a
1634#define PCI_DEVICE_ID_O2_6832 0x6832 1634#define PCI_DEVICE_ID_O2_6832 0x6832
1635#define PCI_DEVICE_ID_O2_6836 0x6836 1635#define PCI_DEVICE_ID_O2_6836 0x6836
1636#define PCI_DEVICE_ID_O2_6812 0x6872
1637#define PCI_DEVICE_ID_O2_6933 0x6933
1636 1638
1637#define PCI_VENDOR_ID_3DFX 0x121a 1639#define PCI_VENDOR_ID_3DFX 0x121a
1638#define PCI_DEVICE_ID_3DFX_VOODOO 0x0001 1640#define PCI_DEVICE_ID_3DFX_VOODOO 0x0001
@@ -1956,6 +1958,8 @@
1956#define PCI_DEVICE_ID_LAVA_DSERIAL 0x0100 /* 2x 16550 */ 1958#define PCI_DEVICE_ID_LAVA_DSERIAL 0x0100 /* 2x 16550 */
1957#define PCI_DEVICE_ID_LAVA_QUATRO_A 0x0101 /* 2x 16550, half of 4 port */ 1959#define PCI_DEVICE_ID_LAVA_QUATRO_A 0x0101 /* 2x 16550, half of 4 port */
1958#define PCI_DEVICE_ID_LAVA_QUATRO_B 0x0102 /* 2x 16550, half of 4 port */ 1960#define PCI_DEVICE_ID_LAVA_QUATRO_B 0x0102 /* 2x 16550, half of 4 port */
1961#define PCI_DEVICE_ID_LAVA_QUATTRO_A 0x0120 /* 2x 16550A, half of 4 port */
1962#define PCI_DEVICE_ID_LAVA_QUATTRO_B 0x0121 /* 2x 16550A, half of 4 port */
1959#define PCI_DEVICE_ID_LAVA_OCTO_A 0x0180 /* 4x 16550A, half of 8 port */ 1963#define PCI_DEVICE_ID_LAVA_OCTO_A 0x0180 /* 4x 16550A, half of 8 port */
1960#define PCI_DEVICE_ID_LAVA_OCTO_B 0x0181 /* 4x 16550A, half of 8 port */ 1964#define PCI_DEVICE_ID_LAVA_OCTO_B 0x0181 /* 4x 16550A, half of 8 port */
1961#define PCI_DEVICE_ID_LAVA_PORT_PLUS 0x0200 /* 2x 16650 */ 1965#define PCI_DEVICE_ID_LAVA_PORT_PLUS 0x0200 /* 2x 16650 */
diff --git a/include/linux/perf_counter.h b/include/linux/perf_counter.h
index 7b7fbf433cff..e3fb25606706 100644
--- a/include/linux/perf_counter.h
+++ b/include/linux/perf_counter.h
@@ -106,6 +106,8 @@ enum perf_sw_ids {
106 PERF_COUNT_SW_CPU_MIGRATIONS = 4, 106 PERF_COUNT_SW_CPU_MIGRATIONS = 4,
107 PERF_COUNT_SW_PAGE_FAULTS_MIN = 5, 107 PERF_COUNT_SW_PAGE_FAULTS_MIN = 5,
108 PERF_COUNT_SW_PAGE_FAULTS_MAJ = 6, 108 PERF_COUNT_SW_PAGE_FAULTS_MAJ = 6,
109 PERF_COUNT_SW_ALIGNMENT_FAULTS = 7,
110 PERF_COUNT_SW_EMULATION_FAULTS = 8,
109 111
110 PERF_COUNT_SW_MAX, /* non-ABI */ 112 PERF_COUNT_SW_MAX, /* non-ABI */
111}; 113};
@@ -225,6 +227,7 @@ struct perf_counter_attr {
225#define PERF_COUNTER_IOC_RESET _IO ('$', 3) 227#define PERF_COUNTER_IOC_RESET _IO ('$', 3)
226#define PERF_COUNTER_IOC_PERIOD _IOW('$', 4, u64) 228#define PERF_COUNTER_IOC_PERIOD _IOW('$', 4, u64)
227#define PERF_COUNTER_IOC_SET_OUTPUT _IO ('$', 5) 229#define PERF_COUNTER_IOC_SET_OUTPUT _IO ('$', 5)
230#define PERF_COUNTER_IOC_SET_FILTER _IOW('$', 6, char *)
228 231
229enum perf_counter_ioc_flags { 232enum perf_counter_ioc_flags {
230 PERF_IOC_FLAG_GROUP = 1U << 0, 233 PERF_IOC_FLAG_GROUP = 1U << 0,
diff --git a/include/linux/perf_event.h b/include/linux/perf_event.h
index 9e7012689a84..43adbd7f0010 100644
--- a/include/linux/perf_event.h
+++ b/include/linux/perf_event.h
@@ -18,6 +18,10 @@
18#include <linux/ioctl.h> 18#include <linux/ioctl.h>
19#include <asm/byteorder.h> 19#include <asm/byteorder.h>
20 20
21#ifdef CONFIG_HAVE_HW_BREAKPOINT
22#include <asm/hw_breakpoint.h>
23#endif
24
21/* 25/*
22 * User-space ABI bits: 26 * User-space ABI bits:
23 */ 27 */
@@ -31,6 +35,7 @@ enum perf_type_id {
31 PERF_TYPE_TRACEPOINT = 2, 35 PERF_TYPE_TRACEPOINT = 2,
32 PERF_TYPE_HW_CACHE = 3, 36 PERF_TYPE_HW_CACHE = 3,
33 PERF_TYPE_RAW = 4, 37 PERF_TYPE_RAW = 4,
38 PERF_TYPE_BREAKPOINT = 5,
34 39
35 PERF_TYPE_MAX, /* non-ABI */ 40 PERF_TYPE_MAX, /* non-ABI */
36}; 41};
@@ -102,6 +107,8 @@ enum perf_sw_ids {
102 PERF_COUNT_SW_CPU_MIGRATIONS = 4, 107 PERF_COUNT_SW_CPU_MIGRATIONS = 4,
103 PERF_COUNT_SW_PAGE_FAULTS_MIN = 5, 108 PERF_COUNT_SW_PAGE_FAULTS_MIN = 5,
104 PERF_COUNT_SW_PAGE_FAULTS_MAJ = 6, 109 PERF_COUNT_SW_PAGE_FAULTS_MAJ = 6,
110 PERF_COUNT_SW_ALIGNMENT_FAULTS = 7,
111 PERF_COUNT_SW_EMULATION_FAULTS = 8,
105 112
106 PERF_COUNT_SW_MAX, /* non-ABI */ 113 PERF_COUNT_SW_MAX, /* non-ABI */
107}; 114};
@@ -207,6 +214,15 @@ struct perf_event_attr {
207 __u32 wakeup_events; /* wakeup every n events */ 214 __u32 wakeup_events; /* wakeup every n events */
208 __u32 wakeup_watermark; /* bytes before wakeup */ 215 __u32 wakeup_watermark; /* bytes before wakeup */
209 }; 216 };
217
218 union {
219 struct { /* Hardware breakpoint info */
220 __u64 bp_addr;
221 __u32 bp_type;
222 __u32 bp_len;
223 };
224 };
225
210 __u32 __reserved_2; 226 __u32 __reserved_2;
211 227
212 __u64 __reserved_3; 228 __u64 __reserved_3;
@@ -219,8 +235,9 @@ struct perf_event_attr {
219#define PERF_EVENT_IOC_DISABLE _IO ('$', 1) 235#define PERF_EVENT_IOC_DISABLE _IO ('$', 1)
220#define PERF_EVENT_IOC_REFRESH _IO ('$', 2) 236#define PERF_EVENT_IOC_REFRESH _IO ('$', 2)
221#define PERF_EVENT_IOC_RESET _IO ('$', 3) 237#define PERF_EVENT_IOC_RESET _IO ('$', 3)
222#define PERF_EVENT_IOC_PERIOD _IOW('$', 4, u64) 238#define PERF_EVENT_IOC_PERIOD _IOW('$', 4, __u64)
223#define PERF_EVENT_IOC_SET_OUTPUT _IO ('$', 5) 239#define PERF_EVENT_IOC_SET_OUTPUT _IO ('$', 5)
240#define PERF_EVENT_IOC_SET_FILTER _IOW('$', 6, char *)
224 241
225enum perf_event_ioc_flags { 242enum perf_event_ioc_flags {
226 PERF_IOC_FLAG_GROUP = 1U << 0, 243 PERF_IOC_FLAG_GROUP = 1U << 0,
@@ -475,6 +492,11 @@ struct hw_perf_event {
475 s64 remaining; 492 s64 remaining;
476 struct hrtimer hrtimer; 493 struct hrtimer hrtimer;
477 }; 494 };
495#ifdef CONFIG_HAVE_HW_BREAKPOINT
496 union { /* breakpoint */
497 struct arch_hw_breakpoint info;
498 };
499#endif
478 }; 500 };
479 atomic64_t prev_count; 501 atomic64_t prev_count;
480 u64 sample_period; 502 u64 sample_period;
@@ -543,6 +565,10 @@ struct perf_pending_entry {
543 void (*func)(struct perf_pending_entry *); 565 void (*func)(struct perf_pending_entry *);
544}; 566};
545 567
568typedef void (*perf_callback_t)(struct perf_event *, void *);
569
570struct perf_sample_data;
571
546/** 572/**
547 * struct perf_event - performance event kernel representation: 573 * struct perf_event - performance event kernel representation:
548 */ 574 */
@@ -585,7 +611,7 @@ struct perf_event {
585 u64 tstamp_running; 611 u64 tstamp_running;
586 u64 tstamp_stopped; 612 u64 tstamp_stopped;
587 613
588 struct perf_event_attr attr; 614 struct perf_event_attr attr;
589 struct hw_perf_event hw; 615 struct hw_perf_event hw;
590 616
591 struct perf_event_context *ctx; 617 struct perf_event_context *ctx;
@@ -633,7 +659,20 @@ struct perf_event {
633 659
634 struct pid_namespace *ns; 660 struct pid_namespace *ns;
635 u64 id; 661 u64 id;
662
663 void (*overflow_handler)(struct perf_event *event,
664 int nmi, struct perf_sample_data *data,
665 struct pt_regs *regs);
666
667#ifdef CONFIG_EVENT_PROFILE
668 struct event_filter *filter;
636#endif 669#endif
670
671 perf_callback_t callback;
672
673 perf_callback_t event_callback;
674
675#endif /* CONFIG_PERF_EVENTS */
637}; 676};
638 677
639/** 678/**
@@ -706,7 +745,6 @@ struct perf_output_handle {
706 int nmi; 745 int nmi;
707 int sample; 746 int sample;
708 int locked; 747 int locked;
709 unsigned long flags;
710}; 748};
711 749
712#ifdef CONFIG_PERF_EVENTS 750#ifdef CONFIG_PERF_EVENTS
@@ -738,6 +776,14 @@ extern int hw_perf_group_sched_in(struct perf_event *group_leader,
738 struct perf_cpu_context *cpuctx, 776 struct perf_cpu_context *cpuctx,
739 struct perf_event_context *ctx, int cpu); 777 struct perf_event_context *ctx, int cpu);
740extern void perf_event_update_userpage(struct perf_event *event); 778extern void perf_event_update_userpage(struct perf_event *event);
779extern int perf_event_release_kernel(struct perf_event *event);
780extern struct perf_event *
781perf_event_create_kernel_counter(struct perf_event_attr *attr,
782 int cpu,
783 pid_t pid,
784 perf_callback_t callback);
785extern u64 perf_event_read_value(struct perf_event *event,
786 u64 *enabled, u64 *running);
741 787
742struct perf_sample_data { 788struct perf_sample_data {
743 u64 type; 789 u64 type;
@@ -814,6 +860,7 @@ extern int sysctl_perf_event_sample_rate;
814extern void perf_event_init(void); 860extern void perf_event_init(void);
815extern void perf_tp_event(int event_id, u64 addr, u64 count, 861extern void perf_tp_event(int event_id, u64 addr, u64 count,
816 void *record, int entry_size); 862 void *record, int entry_size);
863extern void perf_bp_event(struct perf_event *event, void *data);
817 864
818#ifndef perf_misc_flags 865#ifndef perf_misc_flags
819#define perf_misc_flags(regs) (user_mode(regs) ? PERF_RECORD_MISC_USER : \ 866#define perf_misc_flags(regs) (user_mode(regs) ? PERF_RECORD_MISC_USER : \
@@ -827,6 +874,8 @@ extern int perf_output_begin(struct perf_output_handle *handle,
827extern void perf_output_end(struct perf_output_handle *handle); 874extern void perf_output_end(struct perf_output_handle *handle);
828extern void perf_output_copy(struct perf_output_handle *handle, 875extern void perf_output_copy(struct perf_output_handle *handle,
829 const void *buf, unsigned int len); 876 const void *buf, unsigned int len);
877extern int perf_swevent_get_recursion_context(void);
878extern void perf_swevent_put_recursion_context(int rctx);
830#else 879#else
831static inline void 880static inline void
832perf_event_task_sched_in(struct task_struct *task, int cpu) { } 881perf_event_task_sched_in(struct task_struct *task, int cpu) { }
@@ -848,11 +897,15 @@ static inline int perf_event_task_enable(void) { return -EINVAL; }
848static inline void 897static inline void
849perf_sw_event(u32 event_id, u64 nr, int nmi, 898perf_sw_event(u32 event_id, u64 nr, int nmi,
850 struct pt_regs *regs, u64 addr) { } 899 struct pt_regs *regs, u64 addr) { }
900static inline void
901perf_bp_event(struct perf_event *event, void *data) { }
851 902
852static inline void perf_event_mmap(struct vm_area_struct *vma) { } 903static inline void perf_event_mmap(struct vm_area_struct *vma) { }
853static inline void perf_event_comm(struct task_struct *tsk) { } 904static inline void perf_event_comm(struct task_struct *tsk) { }
854static inline void perf_event_fork(struct task_struct *tsk) { } 905static inline void perf_event_fork(struct task_struct *tsk) { }
855static inline void perf_event_init(void) { } 906static inline void perf_event_init(void) { }
907static inline int perf_swevent_get_recursion_context(void) { return -1; }
908static inline void perf_swevent_put_recursion_context(int rctx) { }
856 909
857#endif 910#endif
858 911
diff --git a/include/linux/posix_acl.h b/include/linux/posix_acl.h
index 065a3652a3ea..67608161df6b 100644
--- a/include/linux/posix_acl.h
+++ b/include/linux/posix_acl.h
@@ -147,6 +147,20 @@ static inline void forget_cached_acl(struct inode *inode, int type)
147 if (old != ACL_NOT_CACHED) 147 if (old != ACL_NOT_CACHED)
148 posix_acl_release(old); 148 posix_acl_release(old);
149} 149}
150
151static inline void forget_all_cached_acls(struct inode *inode)
152{
153 struct posix_acl *old_access, *old_default;
154 spin_lock(&inode->i_lock);
155 old_access = inode->i_acl;
156 old_default = inode->i_default_acl;
157 inode->i_acl = inode->i_default_acl = ACL_NOT_CACHED;
158 spin_unlock(&inode->i_lock);
159 if (old_access != ACL_NOT_CACHED)
160 posix_acl_release(old_access);
161 if (old_default != ACL_NOT_CACHED)
162 posix_acl_release(old_default);
163}
150#endif 164#endif
151 165
152static inline void cache_no_acl(struct inode *inode) 166static inline void cache_no_acl(struct inode *inode)
diff --git a/include/linux/preempt.h b/include/linux/preempt.h
index 72b1a10a59b6..2e681d9555bd 100644
--- a/include/linux/preempt.h
+++ b/include/linux/preempt.h
@@ -105,6 +105,11 @@ struct preempt_notifier;
105 * @sched_out: we've just been preempted 105 * @sched_out: we've just been preempted
106 * notifier: struct preempt_notifier for the task being preempted 106 * notifier: struct preempt_notifier for the task being preempted
107 * next: the task that's kicking us out 107 * next: the task that's kicking us out
108 *
109 * Please note that sched_in and out are called under different
110 * contexts. sched_out is called with rq lock held and irq disabled
111 * while sched_in is called without rq lock and irq enabled. This
112 * difference is intentional and depended upon by its users.
108 */ 113 */
109struct preempt_ops { 114struct preempt_ops {
110 void (*sched_in)(struct preempt_notifier *notifier, int cpu); 115 void (*sched_in)(struct preempt_notifier *notifier, int cpu);
diff --git a/include/linux/quota.h b/include/linux/quota.h
index 78c48895b12a..ce9a9b2e5cd4 100644
--- a/include/linux/quota.h
+++ b/include/linux/quota.h
@@ -376,6 +376,17 @@ static inline unsigned int dquot_generic_flag(unsigned int flags, int type)
376 return flags >> _DQUOT_STATE_FLAGS; 376 return flags >> _DQUOT_STATE_FLAGS;
377} 377}
378 378
379#ifdef CONFIG_QUOTA_NETLINK_INTERFACE
380extern void quota_send_warning(short type, unsigned int id, dev_t dev,
381 const char warntype);
382#else
383static inline void quota_send_warning(short type, unsigned int id, dev_t dev,
384 const char warntype)
385{
386 return;
387}
388#endif /* CONFIG_QUOTA_NETLINK_INTERFACE */
389
379struct quota_info { 390struct quota_info {
380 unsigned int flags; /* Flags for diskquotas on this device */ 391 unsigned int flags; /* Flags for diskquotas on this device */
381 struct mutex dqio_mutex; /* lock device while I/O in progress */ 392 struct mutex dqio_mutex; /* lock device while I/O in progress */
diff --git a/include/linux/ratelimit.h b/include/linux/ratelimit.h
index 00044b856453..668cf1bef030 100644
--- a/include/linux/ratelimit.h
+++ b/include/linux/ratelimit.h
@@ -1,20 +1,31 @@
1#ifndef _LINUX_RATELIMIT_H 1#ifndef _LINUX_RATELIMIT_H
2#define _LINUX_RATELIMIT_H 2#define _LINUX_RATELIMIT_H
3
3#include <linux/param.h> 4#include <linux/param.h>
5#include <linux/spinlock_types.h>
4 6
5#define DEFAULT_RATELIMIT_INTERVAL (5 * HZ) 7#define DEFAULT_RATELIMIT_INTERVAL (5 * HZ)
6#define DEFAULT_RATELIMIT_BURST 10 8#define DEFAULT_RATELIMIT_BURST 10
7 9
8struct ratelimit_state { 10struct ratelimit_state {
9 int interval; 11 spinlock_t lock; /* protect the state */
10 int burst; 12
11 int printed; 13 int interval;
12 int missed; 14 int burst;
13 unsigned long begin; 15 int printed;
16 int missed;
17 unsigned long begin;
14}; 18};
15 19
16#define DEFINE_RATELIMIT_STATE(name, interval, burst) \ 20#define DEFINE_RATELIMIT_STATE(name, interval_init, burst_init) \
17 struct ratelimit_state name = {interval, burst,} 21 \
22 struct ratelimit_state name = { \
23 .lock = __SPIN_LOCK_UNLOCKED(name.lock), \
24 .interval = interval_init, \
25 .burst = burst_init, \
26 }
27
28extern int ___ratelimit(struct ratelimit_state *rs, const char *func);
29#define __ratelimit(state) ___ratelimit(state, __func__)
18 30
19extern int __ratelimit(struct ratelimit_state *rs); 31#endif /* _LINUX_RATELIMIT_H */
20#endif
diff --git a/include/linux/rcupdate.h b/include/linux/rcupdate.h
index 3ebd0b7bcb08..24440f4bf476 100644
--- a/include/linux/rcupdate.h
+++ b/include/linux/rcupdate.h
@@ -52,11 +52,6 @@ struct rcu_head {
52}; 52};
53 53
54/* Exported common interfaces */ 54/* Exported common interfaces */
55#ifdef CONFIG_TREE_PREEMPT_RCU
56extern void synchronize_rcu(void);
57#else /* #ifdef CONFIG_TREE_PREEMPT_RCU */
58#define synchronize_rcu synchronize_sched
59#endif /* #else #ifdef CONFIG_TREE_PREEMPT_RCU */
60extern void synchronize_rcu_bh(void); 55extern void synchronize_rcu_bh(void);
61extern void synchronize_sched(void); 56extern void synchronize_sched(void);
62extern void rcu_barrier(void); 57extern void rcu_barrier(void);
@@ -67,12 +62,11 @@ extern int sched_expedited_torture_stats(char *page);
67 62
68/* Internal to kernel */ 63/* Internal to kernel */
69extern void rcu_init(void); 64extern void rcu_init(void);
70extern void rcu_scheduler_starting(void);
71extern int rcu_needs_cpu(int cpu);
72extern int rcu_scheduler_active;
73 65
74#if defined(CONFIG_TREE_RCU) || defined(CONFIG_TREE_PREEMPT_RCU) 66#if defined(CONFIG_TREE_RCU) || defined(CONFIG_TREE_PREEMPT_RCU)
75#include <linux/rcutree.h> 67#include <linux/rcutree.h>
68#elif defined(CONFIG_TINY_RCU)
69#include <linux/rcutiny.h>
76#else 70#else
77#error "Unknown RCU implementation specified to kernel configuration" 71#error "Unknown RCU implementation specified to kernel configuration"
78#endif 72#endif
diff --git a/include/linux/rcutiny.h b/include/linux/rcutiny.h
new file mode 100644
index 000000000000..c4ba9a78721e
--- /dev/null
+++ b/include/linux/rcutiny.h
@@ -0,0 +1,104 @@
1/*
2 * Read-Copy Update mechanism for mutual exclusion, the Bloatwatch edition.
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, 2008
19 *
20 * Author: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
21 *
22 * For detailed explanation of Read-Copy Update mechanism see -
23 * Documentation/RCU
24 */
25#ifndef __LINUX_TINY_H
26#define __LINUX_TINY_H
27
28#include <linux/cache.h>
29
30void rcu_sched_qs(int cpu);
31void rcu_bh_qs(int cpu);
32
33#define __rcu_read_lock() preempt_disable()
34#define __rcu_read_unlock() preempt_enable()
35#define __rcu_read_lock_bh() local_bh_disable()
36#define __rcu_read_unlock_bh() local_bh_enable()
37#define call_rcu_sched call_rcu
38
39#define rcu_init_sched() do { } while (0)
40extern void rcu_check_callbacks(int cpu, int user);
41
42static inline int rcu_needs_cpu(int cpu)
43{
44 return 0;
45}
46
47/*
48 * Return the number of grace periods.
49 */
50static inline long rcu_batches_completed(void)
51{
52 return 0;
53}
54
55/*
56 * Return the number of bottom-half grace periods.
57 */
58static inline long rcu_batches_completed_bh(void)
59{
60 return 0;
61}
62
63extern int rcu_expedited_torture_stats(char *page);
64
65#define synchronize_rcu synchronize_sched
66
67static inline void synchronize_rcu_expedited(void)
68{
69 synchronize_sched();
70}
71
72static inline void synchronize_rcu_bh_expedited(void)
73{
74 synchronize_sched();
75}
76
77struct notifier_block;
78
79#ifdef CONFIG_NO_HZ
80
81extern void rcu_enter_nohz(void);
82extern void rcu_exit_nohz(void);
83
84#else /* #ifdef CONFIG_NO_HZ */
85
86static inline void rcu_enter_nohz(void)
87{
88}
89
90static inline void rcu_exit_nohz(void)
91{
92}
93
94#endif /* #else #ifdef CONFIG_NO_HZ */
95
96static inline void rcu_scheduler_starting(void)
97{
98}
99
100static inline void exit_rcu(void)
101{
102}
103
104#endif /* __LINUX_RCUTINY_H */
diff --git a/include/linux/rcutree.h b/include/linux/rcutree.h
index 9642c6bcb399..c93eee5911b0 100644
--- a/include/linux/rcutree.h
+++ b/include/linux/rcutree.h
@@ -34,15 +34,15 @@ struct notifier_block;
34 34
35extern void rcu_sched_qs(int cpu); 35extern void rcu_sched_qs(int cpu);
36extern void rcu_bh_qs(int cpu); 36extern void rcu_bh_qs(int cpu);
37extern int rcu_cpu_notify(struct notifier_block *self,
38 unsigned long action, void *hcpu);
39extern int rcu_needs_cpu(int cpu); 37extern int rcu_needs_cpu(int cpu);
38extern void rcu_scheduler_starting(void);
40extern int rcu_expedited_torture_stats(char *page); 39extern int rcu_expedited_torture_stats(char *page);
41 40
42#ifdef CONFIG_TREE_PREEMPT_RCU 41#ifdef CONFIG_TREE_PREEMPT_RCU
43 42
44extern void __rcu_read_lock(void); 43extern void __rcu_read_lock(void);
45extern void __rcu_read_unlock(void); 44extern void __rcu_read_unlock(void);
45extern void synchronize_rcu(void);
46extern void exit_rcu(void); 46extern void exit_rcu(void);
47 47
48#else /* #ifdef CONFIG_TREE_PREEMPT_RCU */ 48#else /* #ifdef CONFIG_TREE_PREEMPT_RCU */
@@ -57,7 +57,7 @@ static inline void __rcu_read_unlock(void)
57 preempt_enable(); 57 preempt_enable();
58} 58}
59 59
60#define __synchronize_sched() synchronize_rcu() 60#define synchronize_rcu synchronize_sched
61 61
62static inline void exit_rcu(void) 62static inline void exit_rcu(void)
63{ 63{
@@ -83,7 +83,6 @@ static inline void synchronize_rcu_bh_expedited(void)
83 synchronize_sched_expedited(); 83 synchronize_sched_expedited();
84} 84}
85 85
86extern void __rcu_init(void);
87extern void rcu_check_callbacks(int cpu, int user); 86extern void rcu_check_callbacks(int cpu, int user);
88 87
89extern long rcu_batches_completed(void); 88extern long rcu_batches_completed(void);
diff --git a/include/linux/sched.h b/include/linux/sched.h
index 75e6e60bf583..89115ec7d43f 100644
--- a/include/linux/sched.h
+++ b/include/linux/sched.h
@@ -145,7 +145,6 @@ extern unsigned long this_cpu_load(void);
145 145
146 146
147extern void calc_global_load(void); 147extern void calc_global_load(void);
148extern u64 cpu_nr_migrations(int cpu);
149 148
150extern unsigned long get_parent_ip(unsigned long addr); 149extern unsigned long get_parent_ip(unsigned long addr);
151 150
@@ -171,8 +170,6 @@ print_cfs_rq(struct seq_file *m, int cpu, struct cfs_rq *cfs_rq)
171} 170}
172#endif 171#endif
173 172
174extern unsigned long long time_sync_thresh;
175
176/* 173/*
177 * Task state bitmask. NOTE! These bits are also 174 * Task state bitmask. NOTE! These bits are also
178 * encoded in fs/proc/array.c: get_task_state(). 175 * encoded in fs/proc/array.c: get_task_state().
@@ -349,7 +346,6 @@ extern signed long schedule_timeout(signed long timeout);
349extern signed long schedule_timeout_interruptible(signed long timeout); 346extern signed long schedule_timeout_interruptible(signed long timeout);
350extern signed long schedule_timeout_killable(signed long timeout); 347extern signed long schedule_timeout_killable(signed long timeout);
351extern signed long schedule_timeout_uninterruptible(signed long timeout); 348extern signed long schedule_timeout_uninterruptible(signed long timeout);
352asmlinkage void __schedule(void);
353asmlinkage void schedule(void); 349asmlinkage void schedule(void);
354extern int mutex_spin_on_owner(struct mutex *lock, struct thread_info *owner); 350extern int mutex_spin_on_owner(struct mutex *lock, struct thread_info *owner);
355 351
@@ -628,6 +624,9 @@ struct signal_struct {
628 cputime_t utime, stime, cutime, cstime; 624 cputime_t utime, stime, cutime, cstime;
629 cputime_t gtime; 625 cputime_t gtime;
630 cputime_t cgtime; 626 cputime_t cgtime;
627#ifndef CONFIG_VIRT_CPU_ACCOUNTING
628 cputime_t prev_utime, prev_stime;
629#endif
631 unsigned long nvcsw, nivcsw, cnvcsw, cnivcsw; 630 unsigned long nvcsw, nivcsw, cnvcsw, cnivcsw;
632 unsigned long min_flt, maj_flt, cmin_flt, cmaj_flt; 631 unsigned long min_flt, maj_flt, cmin_flt, cmaj_flt;
633 unsigned long inblock, oublock, cinblock, coublock; 632 unsigned long inblock, oublock, cinblock, coublock;
@@ -1013,9 +1012,13 @@ static inline struct cpumask *sched_domain_span(struct sched_domain *sd)
1013 return to_cpumask(sd->span); 1012 return to_cpumask(sd->span);
1014} 1013}
1015 1014
1016extern void partition_sched_domains(int ndoms_new, struct cpumask *doms_new, 1015extern void partition_sched_domains(int ndoms_new, cpumask_var_t doms_new[],
1017 struct sched_domain_attr *dattr_new); 1016 struct sched_domain_attr *dattr_new);
1018 1017
1018/* Allocate an array of sched domains, for partition_sched_domains(). */
1019cpumask_var_t *alloc_sched_domains(unsigned int ndoms);
1020void free_sched_domains(cpumask_var_t doms[], unsigned int ndoms);
1021
1019/* Test a flag in parent sched domain */ 1022/* Test a flag in parent sched domain */
1020static inline int test_sd_parent(struct sched_domain *sd, int flag) 1023static inline int test_sd_parent(struct sched_domain *sd, int flag)
1021{ 1024{
@@ -1033,7 +1036,7 @@ unsigned long default_scale_smt_power(struct sched_domain *sd, int cpu);
1033struct sched_domain_attr; 1036struct sched_domain_attr;
1034 1037
1035static inline void 1038static inline void
1036partition_sched_domains(int ndoms_new, struct cpumask *doms_new, 1039partition_sched_domains(int ndoms_new, cpumask_var_t doms_new[],
1037 struct sched_domain_attr *dattr_new) 1040 struct sched_domain_attr *dattr_new)
1038{ 1041{
1039} 1042}
@@ -1331,7 +1334,9 @@ struct task_struct {
1331 1334
1332 cputime_t utime, stime, utimescaled, stimescaled; 1335 cputime_t utime, stime, utimescaled, stimescaled;
1333 cputime_t gtime; 1336 cputime_t gtime;
1337#ifndef CONFIG_VIRT_CPU_ACCOUNTING
1334 cputime_t prev_utime, prev_stime; 1338 cputime_t prev_utime, prev_stime;
1339#endif
1335 unsigned long nvcsw, nivcsw; /* context switch counts */ 1340 unsigned long nvcsw, nivcsw; /* context switch counts */
1336 struct timespec start_time; /* monotonic time */ 1341 struct timespec start_time; /* monotonic time */
1337 struct timespec real_start_time; /* boot based time */ 1342 struct timespec real_start_time; /* boot based time */
@@ -1421,17 +1426,17 @@ struct task_struct {
1421#endif 1426#endif
1422#ifdef CONFIG_TRACE_IRQFLAGS 1427#ifdef CONFIG_TRACE_IRQFLAGS
1423 unsigned int irq_events; 1428 unsigned int irq_events;
1424 int hardirqs_enabled;
1425 unsigned long hardirq_enable_ip; 1429 unsigned long hardirq_enable_ip;
1426 unsigned int hardirq_enable_event;
1427 unsigned long hardirq_disable_ip; 1430 unsigned long hardirq_disable_ip;
1431 unsigned int hardirq_enable_event;
1428 unsigned int hardirq_disable_event; 1432 unsigned int hardirq_disable_event;
1429 int softirqs_enabled; 1433 int hardirqs_enabled;
1434 int hardirq_context;
1430 unsigned long softirq_disable_ip; 1435 unsigned long softirq_disable_ip;
1431 unsigned int softirq_disable_event;
1432 unsigned long softirq_enable_ip; 1436 unsigned long softirq_enable_ip;
1437 unsigned int softirq_disable_event;
1433 unsigned int softirq_enable_event; 1438 unsigned int softirq_enable_event;
1434 int hardirq_context; 1439 int softirqs_enabled;
1435 int softirq_context; 1440 int softirq_context;
1436#endif 1441#endif
1437#ifdef CONFIG_LOCKDEP 1442#ifdef CONFIG_LOCKDEP
@@ -1720,9 +1725,8 @@ static inline void put_task_struct(struct task_struct *t)
1720 __put_task_struct(t); 1725 __put_task_struct(t);
1721} 1726}
1722 1727
1723extern cputime_t task_utime(struct task_struct *p); 1728extern void task_times(struct task_struct *p, cputime_t *ut, cputime_t *st);
1724extern cputime_t task_stime(struct task_struct *p); 1729extern void thread_group_times(struct task_struct *p, cputime_t *ut, cputime_t *st);
1725extern cputime_t task_gtime(struct task_struct *p);
1726 1730
1727/* 1731/*
1728 * Per process flags 1732 * Per process flags
@@ -2086,11 +2090,18 @@ static inline int is_si_special(const struct siginfo *info)
2086 return info <= SEND_SIG_FORCED; 2090 return info <= SEND_SIG_FORCED;
2087} 2091}
2088 2092
2089/* True if we are on the alternate signal stack. */ 2093/*
2090 2094 * True if we are on the alternate signal stack.
2095 */
2091static inline int on_sig_stack(unsigned long sp) 2096static inline int on_sig_stack(unsigned long sp)
2092{ 2097{
2093 return (sp - current->sas_ss_sp < current->sas_ss_size); 2098#ifdef CONFIG_STACK_GROWSUP
2099 return sp >= current->sas_ss_sp &&
2100 sp - current->sas_ss_sp < current->sas_ss_size;
2101#else
2102 return sp > current->sas_ss_sp &&
2103 sp - current->sas_ss_sp <= current->sas_ss_size;
2104#endif
2094} 2105}
2095 2106
2096static inline int sas_ss_flags(unsigned long sp) 2107static inline int sas_ss_flags(unsigned long sp)
diff --git a/include/linux/securebits.h b/include/linux/securebits.h
index d2c5ed845bcc..33406174cbe8 100644
--- a/include/linux/securebits.h
+++ b/include/linux/securebits.h
@@ -1,6 +1,15 @@
1#ifndef _LINUX_SECUREBITS_H 1#ifndef _LINUX_SECUREBITS_H
2#define _LINUX_SECUREBITS_H 1 2#define _LINUX_SECUREBITS_H 1
3 3
4/* Each securesetting is implemented using two bits. One bit specifies
5 whether the setting is on or off. The other bit specify whether the
6 setting is locked or not. A setting which is locked cannot be
7 changed from user-level. */
8#define issecure_mask(X) (1 << (X))
9#ifdef __KERNEL__
10#define issecure(X) (issecure_mask(X) & current_cred_xxx(securebits))
11#endif
12
4#define SECUREBITS_DEFAULT 0x00000000 13#define SECUREBITS_DEFAULT 0x00000000
5 14
6/* When set UID 0 has no special privileges. When unset, we support 15/* When set UID 0 has no special privileges. When unset, we support
@@ -12,6 +21,9 @@
12#define SECURE_NOROOT 0 21#define SECURE_NOROOT 0
13#define SECURE_NOROOT_LOCKED 1 /* make bit-0 immutable */ 22#define SECURE_NOROOT_LOCKED 1 /* make bit-0 immutable */
14 23
24#define SECBIT_NOROOT (issecure_mask(SECURE_NOROOT))
25#define SECBIT_NOROOT_LOCKED (issecure_mask(SECURE_NOROOT_LOCKED))
26
15/* When set, setuid to/from uid 0 does not trigger capability-"fixup". 27/* When set, setuid to/from uid 0 does not trigger capability-"fixup".
16 When unset, to provide compatiblility with old programs relying on 28 When unset, to provide compatiblility with old programs relying on
17 set*uid to gain/lose privilege, transitions to/from uid 0 cause 29 set*uid to gain/lose privilege, transitions to/from uid 0 cause
@@ -19,6 +31,10 @@
19#define SECURE_NO_SETUID_FIXUP 2 31#define SECURE_NO_SETUID_FIXUP 2
20#define SECURE_NO_SETUID_FIXUP_LOCKED 3 /* make bit-2 immutable */ 32#define SECURE_NO_SETUID_FIXUP_LOCKED 3 /* make bit-2 immutable */
21 33
34#define SECBIT_NO_SETUID_FIXUP (issecure_mask(SECURE_NO_SETUID_FIXUP))
35#define SECBIT_NO_SETUID_FIXUP_LOCKED \
36 (issecure_mask(SECURE_NO_SETUID_FIXUP_LOCKED))
37
22/* When set, a process can retain its capabilities even after 38/* When set, a process can retain its capabilities even after
23 transitioning to a non-root user (the set-uid fixup suppressed by 39 transitioning to a non-root user (the set-uid fixup suppressed by
24 bit 2). Bit-4 is cleared when a process calls exec(); setting both 40 bit 2). Bit-4 is cleared when a process calls exec(); setting both
@@ -27,12 +43,8 @@
27#define SECURE_KEEP_CAPS 4 43#define SECURE_KEEP_CAPS 4
28#define SECURE_KEEP_CAPS_LOCKED 5 /* make bit-4 immutable */ 44#define SECURE_KEEP_CAPS_LOCKED 5 /* make bit-4 immutable */
29 45
30/* Each securesetting is implemented using two bits. One bit specifies 46#define SECBIT_KEEP_CAPS (issecure_mask(SECURE_KEEP_CAPS))
31 whether the setting is on or off. The other bit specify whether the 47#define SECBIT_KEEP_CAPS_LOCKED (issecure_mask(SECURE_KEEP_CAPS_LOCKED))
32 setting is locked or not. A setting which is locked cannot be
33 changed from user-level. */
34#define issecure_mask(X) (1 << (X))
35#define issecure(X) (issecure_mask(X) & current_cred_xxx(securebits))
36 48
37#define SECURE_ALL_BITS (issecure_mask(SECURE_NOROOT) | \ 49#define SECURE_ALL_BITS (issecure_mask(SECURE_NOROOT) | \
38 issecure_mask(SECURE_NO_SETUID_FIXUP) | \ 50 issecure_mask(SECURE_NO_SETUID_FIXUP) | \
diff --git a/include/linux/security.h b/include/linux/security.h
index 239e40d0450b..466cbadbd1ef 100644
--- a/include/linux/security.h
+++ b/include/linux/security.h
@@ -447,6 +447,22 @@ static inline void security_free_mnt_opts(struct security_mnt_opts *opts)
447 * @new_dir contains the path structure for parent of the new link. 447 * @new_dir contains the path structure for parent of the new link.
448 * @new_dentry contains the dentry structure of the new link. 448 * @new_dentry contains the dentry structure of the new link.
449 * Return 0 if permission is granted. 449 * Return 0 if permission is granted.
450 * @path_chmod:
451 * Check for permission to change DAC's permission of a file or directory.
452 * @dentry contains the dentry structure.
453 * @mnt contains the vfsmnt structure.
454 * @mode contains DAC's mode.
455 * Return 0 if permission is granted.
456 * @path_chown:
457 * Check for permission to change owner/group of a file or directory.
458 * @path contains the path structure.
459 * @uid contains new owner's ID.
460 * @gid contains new group's ID.
461 * Return 0 if permission is granted.
462 * @path_chroot:
463 * Check for permission to change root directory.
464 * @path contains the path structure.
465 * Return 0 if permission is granted.
450 * @inode_readlink: 466 * @inode_readlink:
451 * Check the permission to read the symbolic link. 467 * Check the permission to read the symbolic link.
452 * @dentry contains the dentry structure for the file link. 468 * @dentry contains the dentry structure for the file link.
@@ -690,6 +706,7 @@ static inline void security_free_mnt_opts(struct security_mnt_opts *opts)
690 * @kernel_module_request: 706 * @kernel_module_request:
691 * Ability to trigger the kernel to automatically upcall to userspace for 707 * Ability to trigger the kernel to automatically upcall to userspace for
692 * userspace to load a kernel module with the given name. 708 * userspace to load a kernel module with the given name.
709 * @kmod_name name of the module requested by the kernel
693 * Return 0 if successful. 710 * Return 0 if successful.
694 * @task_setuid: 711 * @task_setuid:
695 * Check permission before setting one or more of the user identity 712 * Check permission before setting one or more of the user identity
@@ -1488,6 +1505,10 @@ struct security_operations {
1488 struct dentry *new_dentry); 1505 struct dentry *new_dentry);
1489 int (*path_rename) (struct path *old_dir, struct dentry *old_dentry, 1506 int (*path_rename) (struct path *old_dir, struct dentry *old_dentry,
1490 struct path *new_dir, struct dentry *new_dentry); 1507 struct path *new_dir, struct dentry *new_dentry);
1508 int (*path_chmod) (struct dentry *dentry, struct vfsmount *mnt,
1509 mode_t mode);
1510 int (*path_chown) (struct path *path, uid_t uid, gid_t gid);
1511 int (*path_chroot) (struct path *path);
1491#endif 1512#endif
1492 1513
1493 int (*inode_alloc_security) (struct inode *inode); 1514 int (*inode_alloc_security) (struct inode *inode);
@@ -1557,7 +1578,7 @@ struct security_operations {
1557 void (*cred_transfer)(struct cred *new, const struct cred *old); 1578 void (*cred_transfer)(struct cred *new, const struct cred *old);
1558 int (*kernel_act_as)(struct cred *new, u32 secid); 1579 int (*kernel_act_as)(struct cred *new, u32 secid);
1559 int (*kernel_create_files_as)(struct cred *new, struct inode *inode); 1580 int (*kernel_create_files_as)(struct cred *new, struct inode *inode);
1560 int (*kernel_module_request)(void); 1581 int (*kernel_module_request)(char *kmod_name);
1561 int (*task_setuid) (uid_t id0, uid_t id1, uid_t id2, int flags); 1582 int (*task_setuid) (uid_t id0, uid_t id1, uid_t id2, int flags);
1562 int (*task_fix_setuid) (struct cred *new, const struct cred *old, 1583 int (*task_fix_setuid) (struct cred *new, const struct cred *old,
1563 int flags); 1584 int flags);
@@ -1822,7 +1843,7 @@ void security_commit_creds(struct cred *new, const struct cred *old);
1822void security_transfer_creds(struct cred *new, const struct cred *old); 1843void security_transfer_creds(struct cred *new, const struct cred *old);
1823int security_kernel_act_as(struct cred *new, u32 secid); 1844int security_kernel_act_as(struct cred *new, u32 secid);
1824int security_kernel_create_files_as(struct cred *new, struct inode *inode); 1845int security_kernel_create_files_as(struct cred *new, struct inode *inode);
1825int security_kernel_module_request(void); 1846int security_kernel_module_request(char *kmod_name);
1826int security_task_setuid(uid_t id0, uid_t id1, uid_t id2, int flags); 1847int security_task_setuid(uid_t id0, uid_t id1, uid_t id2, int flags);
1827int security_task_fix_setuid(struct cred *new, const struct cred *old, 1848int security_task_fix_setuid(struct cred *new, const struct cred *old,
1828 int flags); 1849 int flags);
@@ -2387,7 +2408,7 @@ static inline int security_kernel_create_files_as(struct cred *cred,
2387 return 0; 2408 return 0;
2388} 2409}
2389 2410
2390static inline int security_kernel_module_request(void) 2411static inline int security_kernel_module_request(char *kmod_name)
2391{ 2412{
2392 return 0; 2413 return 0;
2393} 2414}
@@ -2952,6 +2973,10 @@ int security_path_link(struct dentry *old_dentry, struct path *new_dir,
2952 struct dentry *new_dentry); 2973 struct dentry *new_dentry);
2953int security_path_rename(struct path *old_dir, struct dentry *old_dentry, 2974int security_path_rename(struct path *old_dir, struct dentry *old_dentry,
2954 struct path *new_dir, struct dentry *new_dentry); 2975 struct path *new_dir, struct dentry *new_dentry);
2976int security_path_chmod(struct dentry *dentry, struct vfsmount *mnt,
2977 mode_t mode);
2978int security_path_chown(struct path *path, uid_t uid, gid_t gid);
2979int security_path_chroot(struct path *path);
2955#else /* CONFIG_SECURITY_PATH */ 2980#else /* CONFIG_SECURITY_PATH */
2956static inline int security_path_unlink(struct path *dir, struct dentry *dentry) 2981static inline int security_path_unlink(struct path *dir, struct dentry *dentry)
2957{ 2982{
@@ -3001,6 +3026,23 @@ static inline int security_path_rename(struct path *old_dir,
3001{ 3026{
3002 return 0; 3027 return 0;
3003} 3028}
3029
3030static inline int security_path_chmod(struct dentry *dentry,
3031 struct vfsmount *mnt,
3032 mode_t mode)
3033{
3034 return 0;
3035}
3036
3037static inline int security_path_chown(struct path *path, uid_t uid, gid_t gid)
3038{
3039 return 0;
3040}
3041
3042static inline int security_path_chroot(struct path *path)
3043{
3044 return 0;
3045}
3004#endif /* CONFIG_SECURITY_PATH */ 3046#endif /* CONFIG_SECURITY_PATH */
3005 3047
3006#ifdef CONFIG_KEYS 3048#ifdef CONFIG_KEYS
diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h
index df7b23ac66e6..bcdd6606f468 100644
--- a/include/linux/skbuff.h
+++ b/include/linux/skbuff.h
@@ -354,8 +354,8 @@ struct sk_buff {
354 ipvs_property:1, 354 ipvs_property:1,
355 peeked:1, 355 peeked:1,
356 nf_trace:1; 356 nf_trace:1;
357 __be16 protocol:16;
357 kmemcheck_bitfield_end(flags1); 358 kmemcheck_bitfield_end(flags1);
358 __be16 protocol;
359 359
360 void (*destructor)(struct sk_buff *skb); 360 void (*destructor)(struct sk_buff *skb);
361#if defined(CONFIG_NF_CONNTRACK) || defined(CONFIG_NF_CONNTRACK_MODULE) 361#if defined(CONFIG_NF_CONNTRACK) || defined(CONFIG_NF_CONNTRACK_MODULE)
@@ -367,7 +367,6 @@ struct sk_buff {
367#endif 367#endif
368 368
369 int iif; 369 int iif;
370 __u16 queue_mapping;
371#ifdef CONFIG_NET_SCHED 370#ifdef CONFIG_NET_SCHED
372 __u16 tc_index; /* traffic control index */ 371 __u16 tc_index; /* traffic control index */
373#ifdef CONFIG_NET_CLS_ACT 372#ifdef CONFIG_NET_CLS_ACT
@@ -376,6 +375,7 @@ struct sk_buff {
376#endif 375#endif
377 376
378 kmemcheck_bitfield_begin(flags2); 377 kmemcheck_bitfield_begin(flags2);
378 __u16 queue_mapping:16;
379#ifdef CONFIG_IPV6_NDISC_NODETYPE 379#ifdef CONFIG_IPV6_NDISC_NODETYPE
380 __u8 ndisc_nodetype:2; 380 __u8 ndisc_nodetype:2;
381#endif 381#endif
@@ -1757,6 +1757,8 @@ extern int skb_copy_datagram_const_iovec(const struct sk_buff *from,
1757 int to_offset, 1757 int to_offset,
1758 int size); 1758 int size);
1759extern void skb_free_datagram(struct sock *sk, struct sk_buff *skb); 1759extern void skb_free_datagram(struct sock *sk, struct sk_buff *skb);
1760extern void skb_free_datagram_locked(struct sock *sk,
1761 struct sk_buff *skb);
1760extern int skb_kill_datagram(struct sock *sk, struct sk_buff *skb, 1762extern int skb_kill_datagram(struct sock *sk, struct sk_buff *skb,
1761 unsigned int flags); 1763 unsigned int flags);
1762extern __wsum skb_checksum(const struct sk_buff *skb, int offset, 1764extern __wsum skb_checksum(const struct sk_buff *skb, int offset,
diff --git a/include/linux/slow-work.h b/include/linux/slow-work.h
index b65c8881f07a..13337bf6c3f5 100644
--- a/include/linux/slow-work.h
+++ b/include/linux/slow-work.h
@@ -17,13 +17,20 @@
17#ifdef CONFIG_SLOW_WORK 17#ifdef CONFIG_SLOW_WORK
18 18
19#include <linux/sysctl.h> 19#include <linux/sysctl.h>
20#include <linux/timer.h>
20 21
21struct slow_work; 22struct slow_work;
23#ifdef CONFIG_SLOW_WORK_DEBUG
24struct seq_file;
25#endif
22 26
23/* 27/*
24 * The operations used to support slow work items 28 * The operations used to support slow work items
25 */ 29 */
26struct slow_work_ops { 30struct slow_work_ops {
31 /* owner */
32 struct module *owner;
33
27 /* get a ref on a work item 34 /* get a ref on a work item
28 * - return 0 if successful, -ve if not 35 * - return 0 if successful, -ve if not
29 */ 36 */
@@ -34,6 +41,11 @@ struct slow_work_ops {
34 41
35 /* execute a work item */ 42 /* execute a work item */
36 void (*execute)(struct slow_work *work); 43 void (*execute)(struct slow_work *work);
44
45#ifdef CONFIG_SLOW_WORK_DEBUG
46 /* describe a work item for debugfs */
47 void (*desc)(struct slow_work *work, struct seq_file *m);
48#endif
37}; 49};
38 50
39/* 51/*
@@ -42,13 +54,24 @@ struct slow_work_ops {
42 * queued 54 * queued
43 */ 55 */
44struct slow_work { 56struct slow_work {
57 struct module *owner; /* the owning module */
45 unsigned long flags; 58 unsigned long flags;
46#define SLOW_WORK_PENDING 0 /* item pending (further) execution */ 59#define SLOW_WORK_PENDING 0 /* item pending (further) execution */
47#define SLOW_WORK_EXECUTING 1 /* item currently executing */ 60#define SLOW_WORK_EXECUTING 1 /* item currently executing */
48#define SLOW_WORK_ENQ_DEFERRED 2 /* item enqueue deferred */ 61#define SLOW_WORK_ENQ_DEFERRED 2 /* item enqueue deferred */
49#define SLOW_WORK_VERY_SLOW 3 /* item is very slow */ 62#define SLOW_WORK_VERY_SLOW 3 /* item is very slow */
63#define SLOW_WORK_CANCELLING 4 /* item is being cancelled, don't enqueue */
64#define SLOW_WORK_DELAYED 5 /* item is struct delayed_slow_work with active timer */
50 const struct slow_work_ops *ops; /* operations table for this item */ 65 const struct slow_work_ops *ops; /* operations table for this item */
51 struct list_head link; /* link in queue */ 66 struct list_head link; /* link in queue */
67#ifdef CONFIG_SLOW_WORK_DEBUG
68 struct timespec mark; /* jiffies at which queued or exec begun */
69#endif
70};
71
72struct delayed_slow_work {
73 struct slow_work work;
74 struct timer_list timer;
52}; 75};
53 76
54/** 77/**
@@ -67,6 +90,20 @@ static inline void slow_work_init(struct slow_work *work,
67} 90}
68 91
69/** 92/**
93 * slow_work_init - Initialise a delayed slow work item
94 * @work: The work item to initialise
95 * @ops: The operations to use to handle the slow work item
96 *
97 * Initialise a delayed slow work item.
98 */
99static inline void delayed_slow_work_init(struct delayed_slow_work *dwork,
100 const struct slow_work_ops *ops)
101{
102 init_timer(&dwork->timer);
103 slow_work_init(&dwork->work, ops);
104}
105
106/**
70 * vslow_work_init - Initialise a very slow work item 107 * vslow_work_init - Initialise a very slow work item
71 * @work: The work item to initialise 108 * @work: The work item to initialise
72 * @ops: The operations to use to handle the slow work item 109 * @ops: The operations to use to handle the slow work item
@@ -83,9 +120,40 @@ static inline void vslow_work_init(struct slow_work *work,
83 INIT_LIST_HEAD(&work->link); 120 INIT_LIST_HEAD(&work->link);
84} 121}
85 122
123/**
124 * slow_work_is_queued - Determine if a slow work item is on the work queue
125 * work: The work item to test
126 *
127 * Determine if the specified slow-work item is on the work queue. This
128 * returns true if it is actually on the queue.
129 *
130 * If the item is executing and has been marked for requeue when execution
131 * finishes, then false will be returned.
132 *
133 * Anyone wishing to wait for completion of execution can wait on the
134 * SLOW_WORK_EXECUTING bit.
135 */
136static inline bool slow_work_is_queued(struct slow_work *work)
137{
138 unsigned long flags = work->flags;
139 return flags & SLOW_WORK_PENDING && !(flags & SLOW_WORK_EXECUTING);
140}
141
86extern int slow_work_enqueue(struct slow_work *work); 142extern int slow_work_enqueue(struct slow_work *work);
87extern int slow_work_register_user(void); 143extern void slow_work_cancel(struct slow_work *work);
88extern void slow_work_unregister_user(void); 144extern int slow_work_register_user(struct module *owner);
145extern void slow_work_unregister_user(struct module *owner);
146
147extern int delayed_slow_work_enqueue(struct delayed_slow_work *dwork,
148 unsigned long delay);
149
150static inline void delayed_slow_work_cancel(struct delayed_slow_work *dwork)
151{
152 slow_work_cancel(&dwork->work);
153}
154
155extern bool slow_work_sleep_till_thread_needed(struct slow_work *work,
156 signed long *_timeout);
89 157
90#ifdef CONFIG_SYSCTL 158#ifdef CONFIG_SYSCTL
91extern ctl_table slow_work_sysctls[]; 159extern ctl_table slow_work_sysctls[];
diff --git a/include/linux/smp.h b/include/linux/smp.h
index 39c64bae776d..7a0570e6a596 100644
--- a/include/linux/smp.h
+++ b/include/linux/smp.h
@@ -76,6 +76,9 @@ void smp_call_function_many(const struct cpumask *mask,
76void __smp_call_function_single(int cpuid, struct call_single_data *data, 76void __smp_call_function_single(int cpuid, struct call_single_data *data,
77 int wait); 77 int wait);
78 78
79int smp_call_function_any(const struct cpumask *mask,
80 void (*func)(void *info), void *info, int wait);
81
79/* 82/*
80 * Generic and arch helpers 83 * Generic and arch helpers
81 */ 84 */
@@ -137,9 +140,15 @@ static inline void smp_send_reschedule(int cpu) { }
137#define smp_prepare_boot_cpu() do {} while (0) 140#define smp_prepare_boot_cpu() do {} while (0)
138#define smp_call_function_many(mask, func, info, wait) \ 141#define smp_call_function_many(mask, func, info, wait) \
139 (up_smp_call_function(func, info)) 142 (up_smp_call_function(func, info))
140static inline void init_call_single_data(void) 143static inline void init_call_single_data(void) { }
144
145static inline int
146smp_call_function_any(const struct cpumask *mask, void (*func)(void *info),
147 void *info, int wait)
141{ 148{
149 return smp_call_function_single(0, func, info, wait);
142} 150}
151
143#endif /* !SMP */ 152#endif /* !SMP */
144 153
145/* 154/*
diff --git a/include/linux/smp_lock.h b/include/linux/smp_lock.h
index 813be59bf345..2ea1dd1ba21c 100644
--- a/include/linux/smp_lock.h
+++ b/include/linux/smp_lock.h
@@ -24,8 +24,21 @@ static inline int reacquire_kernel_lock(struct task_struct *task)
24 return 0; 24 return 0;
25} 25}
26 26
27extern void __lockfunc lock_kernel(void) __acquires(kernel_lock); 27extern void __lockfunc
28extern void __lockfunc unlock_kernel(void) __releases(kernel_lock); 28_lock_kernel(const char *func, const char *file, int line)
29__acquires(kernel_lock);
30
31extern void __lockfunc
32_unlock_kernel(const char *func, const char *file, int line)
33__releases(kernel_lock);
34
35#define lock_kernel() do { \
36 _lock_kernel(__func__, __FILE__, __LINE__); \
37} while (0)
38
39#define unlock_kernel() do { \
40 _unlock_kernel(__func__, __FILE__, __LINE__); \
41} while (0)
29 42
30/* 43/*
31 * Various legacy drivers don't really need the BKL in a specific 44 * Various legacy drivers don't really need the BKL in a specific
@@ -41,8 +54,8 @@ static inline void cycle_kernel_lock(void)
41 54
42#else 55#else
43 56
44#define lock_kernel() do { } while(0) 57#define lock_kernel()
45#define unlock_kernel() do { } while(0) 58#define unlock_kernel()
46#define release_kernel_lock(task) do { } while(0) 59#define release_kernel_lock(task) do { } while(0)
47#define cycle_kernel_lock() do { } while(0) 60#define cycle_kernel_lock() do { } while(0)
48#define reacquire_kernel_lock(task) 0 61#define reacquire_kernel_lock(task) 0
diff --git a/include/linux/spinlock.h b/include/linux/spinlock.h
index f0ca7a7a1757..71dccfeb0d88 100644
--- a/include/linux/spinlock.h
+++ b/include/linux/spinlock.h
@@ -79,8 +79,6 @@
79 */ 79 */
80#include <linux/spinlock_types.h> 80#include <linux/spinlock_types.h>
81 81
82extern int __lockfunc generic__raw_read_trylock(raw_rwlock_t *lock);
83
84/* 82/*
85 * Pull the __raw*() functions/declarations (UP-nondebug doesnt need them): 83 * Pull the __raw*() functions/declarations (UP-nondebug doesnt need them):
86 */ 84 */
@@ -102,7 +100,7 @@ do { \
102 100
103#else 101#else
104# define spin_lock_init(lock) \ 102# define spin_lock_init(lock) \
105 do { *(lock) = SPIN_LOCK_UNLOCKED; } while (0) 103 do { *(lock) = __SPIN_LOCK_UNLOCKED(lock); } while (0)
106#endif 104#endif
107 105
108#ifdef CONFIG_DEBUG_SPINLOCK 106#ifdef CONFIG_DEBUG_SPINLOCK
@@ -116,7 +114,7 @@ do { \
116} while (0) 114} while (0)
117#else 115#else
118# define rwlock_init(lock) \ 116# define rwlock_init(lock) \
119 do { *(lock) = RW_LOCK_UNLOCKED; } while (0) 117 do { *(lock) = __RW_LOCK_UNLOCKED(lock); } while (0)
120#endif 118#endif
121 119
122#define spin_is_locked(lock) __raw_spin_is_locked(&(lock)->raw_lock) 120#define spin_is_locked(lock) __raw_spin_is_locked(&(lock)->raw_lock)
diff --git a/include/linux/spinlock_api_smp.h b/include/linux/spinlock_api_smp.h
index 7a7e18fc2415..8264a7f459bc 100644
--- a/include/linux/spinlock_api_smp.h
+++ b/include/linux/spinlock_api_smp.h
@@ -60,137 +60,118 @@ void __lockfunc _read_unlock_irqrestore(rwlock_t *lock, unsigned long flags)
60void __lockfunc _write_unlock_irqrestore(rwlock_t *lock, unsigned long flags) 60void __lockfunc _write_unlock_irqrestore(rwlock_t *lock, unsigned long flags)
61 __releases(lock); 61 __releases(lock);
62 62
63/* 63#ifdef CONFIG_INLINE_SPIN_LOCK
64 * We inline the unlock functions in the nondebug case:
65 */
66#if !defined(CONFIG_DEBUG_SPINLOCK) && !defined(CONFIG_PREEMPT)
67#define __always_inline__spin_unlock
68#define __always_inline__read_unlock
69#define __always_inline__write_unlock
70#define __always_inline__spin_unlock_irq
71#define __always_inline__read_unlock_irq
72#define __always_inline__write_unlock_irq
73#endif
74
75#ifndef CONFIG_DEBUG_SPINLOCK
76#ifndef CONFIG_GENERIC_LOCKBREAK
77
78#ifdef __always_inline__spin_lock
79#define _spin_lock(lock) __spin_lock(lock) 64#define _spin_lock(lock) __spin_lock(lock)
80#endif 65#endif
81 66
82#ifdef __always_inline__read_lock 67#ifdef CONFIG_INLINE_READ_LOCK
83#define _read_lock(lock) __read_lock(lock) 68#define _read_lock(lock) __read_lock(lock)
84#endif 69#endif
85 70
86#ifdef __always_inline__write_lock 71#ifdef CONFIG_INLINE_WRITE_LOCK
87#define _write_lock(lock) __write_lock(lock) 72#define _write_lock(lock) __write_lock(lock)
88#endif 73#endif
89 74
90#ifdef __always_inline__spin_lock_bh 75#ifdef CONFIG_INLINE_SPIN_LOCK_BH
91#define _spin_lock_bh(lock) __spin_lock_bh(lock) 76#define _spin_lock_bh(lock) __spin_lock_bh(lock)
92#endif 77#endif
93 78
94#ifdef __always_inline__read_lock_bh 79#ifdef CONFIG_INLINE_READ_LOCK_BH
95#define _read_lock_bh(lock) __read_lock_bh(lock) 80#define _read_lock_bh(lock) __read_lock_bh(lock)
96#endif 81#endif
97 82
98#ifdef __always_inline__write_lock_bh 83#ifdef CONFIG_INLINE_WRITE_LOCK_BH
99#define _write_lock_bh(lock) __write_lock_bh(lock) 84#define _write_lock_bh(lock) __write_lock_bh(lock)
100#endif 85#endif
101 86
102#ifdef __always_inline__spin_lock_irq 87#ifdef CONFIG_INLINE_SPIN_LOCK_IRQ
103#define _spin_lock_irq(lock) __spin_lock_irq(lock) 88#define _spin_lock_irq(lock) __spin_lock_irq(lock)
104#endif 89#endif
105 90
106#ifdef __always_inline__read_lock_irq 91#ifdef CONFIG_INLINE_READ_LOCK_IRQ
107#define _read_lock_irq(lock) __read_lock_irq(lock) 92#define _read_lock_irq(lock) __read_lock_irq(lock)
108#endif 93#endif
109 94
110#ifdef __always_inline__write_lock_irq 95#ifdef CONFIG_INLINE_WRITE_LOCK_IRQ
111#define _write_lock_irq(lock) __write_lock_irq(lock) 96#define _write_lock_irq(lock) __write_lock_irq(lock)
112#endif 97#endif
113 98
114#ifdef __always_inline__spin_lock_irqsave 99#ifdef CONFIG_INLINE_SPIN_LOCK_IRQSAVE
115#define _spin_lock_irqsave(lock) __spin_lock_irqsave(lock) 100#define _spin_lock_irqsave(lock) __spin_lock_irqsave(lock)
116#endif 101#endif
117 102
118#ifdef __always_inline__read_lock_irqsave 103#ifdef CONFIG_INLINE_READ_LOCK_IRQSAVE
119#define _read_lock_irqsave(lock) __read_lock_irqsave(lock) 104#define _read_lock_irqsave(lock) __read_lock_irqsave(lock)
120#endif 105#endif
121 106
122#ifdef __always_inline__write_lock_irqsave 107#ifdef CONFIG_INLINE_WRITE_LOCK_IRQSAVE
123#define _write_lock_irqsave(lock) __write_lock_irqsave(lock) 108#define _write_lock_irqsave(lock) __write_lock_irqsave(lock)
124#endif 109#endif
125 110
126#endif /* !CONFIG_GENERIC_LOCKBREAK */ 111#ifdef CONFIG_INLINE_SPIN_TRYLOCK
127
128#ifdef __always_inline__spin_trylock
129#define _spin_trylock(lock) __spin_trylock(lock) 112#define _spin_trylock(lock) __spin_trylock(lock)
130#endif 113#endif
131 114
132#ifdef __always_inline__read_trylock 115#ifdef CONFIG_INLINE_READ_TRYLOCK
133#define _read_trylock(lock) __read_trylock(lock) 116#define _read_trylock(lock) __read_trylock(lock)
134#endif 117#endif
135 118
136#ifdef __always_inline__write_trylock 119#ifdef CONFIG_INLINE_WRITE_TRYLOCK
137#define _write_trylock(lock) __write_trylock(lock) 120#define _write_trylock(lock) __write_trylock(lock)
138#endif 121#endif
139 122
140#ifdef __always_inline__spin_trylock_bh 123#ifdef CONFIG_INLINE_SPIN_TRYLOCK_BH
141#define _spin_trylock_bh(lock) __spin_trylock_bh(lock) 124#define _spin_trylock_bh(lock) __spin_trylock_bh(lock)
142#endif 125#endif
143 126
144#ifdef __always_inline__spin_unlock 127#ifdef CONFIG_INLINE_SPIN_UNLOCK
145#define _spin_unlock(lock) __spin_unlock(lock) 128#define _spin_unlock(lock) __spin_unlock(lock)
146#endif 129#endif
147 130
148#ifdef __always_inline__read_unlock 131#ifdef CONFIG_INLINE_READ_UNLOCK
149#define _read_unlock(lock) __read_unlock(lock) 132#define _read_unlock(lock) __read_unlock(lock)
150#endif 133#endif
151 134
152#ifdef __always_inline__write_unlock 135#ifdef CONFIG_INLINE_WRITE_UNLOCK
153#define _write_unlock(lock) __write_unlock(lock) 136#define _write_unlock(lock) __write_unlock(lock)
154#endif 137#endif
155 138
156#ifdef __always_inline__spin_unlock_bh 139#ifdef CONFIG_INLINE_SPIN_UNLOCK_BH
157#define _spin_unlock_bh(lock) __spin_unlock_bh(lock) 140#define _spin_unlock_bh(lock) __spin_unlock_bh(lock)
158#endif 141#endif
159 142
160#ifdef __always_inline__read_unlock_bh 143#ifdef CONFIG_INLINE_READ_UNLOCK_BH
161#define _read_unlock_bh(lock) __read_unlock_bh(lock) 144#define _read_unlock_bh(lock) __read_unlock_bh(lock)
162#endif 145#endif
163 146
164#ifdef __always_inline__write_unlock_bh 147#ifdef CONFIG_INLINE_WRITE_UNLOCK_BH
165#define _write_unlock_bh(lock) __write_unlock_bh(lock) 148#define _write_unlock_bh(lock) __write_unlock_bh(lock)
166#endif 149#endif
167 150
168#ifdef __always_inline__spin_unlock_irq 151#ifdef CONFIG_INLINE_SPIN_UNLOCK_IRQ
169#define _spin_unlock_irq(lock) __spin_unlock_irq(lock) 152#define _spin_unlock_irq(lock) __spin_unlock_irq(lock)
170#endif 153#endif
171 154
172#ifdef __always_inline__read_unlock_irq 155#ifdef CONFIG_INLINE_READ_UNLOCK_IRQ
173#define _read_unlock_irq(lock) __read_unlock_irq(lock) 156#define _read_unlock_irq(lock) __read_unlock_irq(lock)
174#endif 157#endif
175 158
176#ifdef __always_inline__write_unlock_irq 159#ifdef CONFIG_INLINE_WRITE_UNLOCK_IRQ
177#define _write_unlock_irq(lock) __write_unlock_irq(lock) 160#define _write_unlock_irq(lock) __write_unlock_irq(lock)
178#endif 161#endif
179 162
180#ifdef __always_inline__spin_unlock_irqrestore 163#ifdef CONFIG_INLINE_SPIN_UNLOCK_IRQRESTORE
181#define _spin_unlock_irqrestore(lock, flags) __spin_unlock_irqrestore(lock, flags) 164#define _spin_unlock_irqrestore(lock, flags) __spin_unlock_irqrestore(lock, flags)
182#endif 165#endif
183 166
184#ifdef __always_inline__read_unlock_irqrestore 167#ifdef CONFIG_INLINE_READ_UNLOCK_IRQRESTORE
185#define _read_unlock_irqrestore(lock, flags) __read_unlock_irqrestore(lock, flags) 168#define _read_unlock_irqrestore(lock, flags) __read_unlock_irqrestore(lock, flags)
186#endif 169#endif
187 170
188#ifdef __always_inline__write_unlock_irqrestore 171#ifdef CONFIG_INLINE_WRITE_UNLOCK_IRQRESTORE
189#define _write_unlock_irqrestore(lock, flags) __write_unlock_irqrestore(lock, flags) 172#define _write_unlock_irqrestore(lock, flags) __write_unlock_irqrestore(lock, flags)
190#endif 173#endif
191 174
192#endif /* CONFIG_DEBUG_SPINLOCK */
193
194static inline int __spin_trylock(spinlock_t *lock) 175static inline int __spin_trylock(spinlock_t *lock)
195{ 176{
196 preempt_disable(); 177 preempt_disable();
diff --git a/include/linux/srcu.h b/include/linux/srcu.h
index aca0eee53930..4765d97dcafb 100644
--- a/include/linux/srcu.h
+++ b/include/linux/srcu.h
@@ -48,6 +48,7 @@ void cleanup_srcu_struct(struct srcu_struct *sp);
48int srcu_read_lock(struct srcu_struct *sp) __acquires(sp); 48int srcu_read_lock(struct srcu_struct *sp) __acquires(sp);
49void srcu_read_unlock(struct srcu_struct *sp, int idx) __releases(sp); 49void srcu_read_unlock(struct srcu_struct *sp, int idx) __releases(sp);
50void synchronize_srcu(struct srcu_struct *sp); 50void synchronize_srcu(struct srcu_struct *sp);
51void synchronize_srcu_expedited(struct srcu_struct *sp);
51long srcu_batches_completed(struct srcu_struct *sp); 52long srcu_batches_completed(struct srcu_struct *sp);
52 53
53#endif 54#endif
diff --git a/include/linux/suspend.h b/include/linux/suspend.h
index cd15df6c63cd..5e781d824e6d 100644
--- a/include/linux/suspend.h
+++ b/include/linux/suspend.h
@@ -301,6 +301,8 @@ static inline int unregister_pm_notifier(struct notifier_block *nb)
301#define pm_notifier(fn, pri) do { (void)(fn); } while (0) 301#define pm_notifier(fn, pri) do { (void)(fn); } while (0)
302#endif /* !CONFIG_PM_SLEEP */ 302#endif /* !CONFIG_PM_SLEEP */
303 303
304extern struct mutex pm_mutex;
305
304#ifndef CONFIG_HIBERNATION 306#ifndef CONFIG_HIBERNATION
305static inline void register_nosave_region(unsigned long b, unsigned long e) 307static inline void register_nosave_region(unsigned long b, unsigned long e)
306{ 308{
@@ -308,8 +310,23 @@ static inline void register_nosave_region(unsigned long b, unsigned long e)
308static inline void register_nosave_region_late(unsigned long b, unsigned long e) 310static inline void register_nosave_region_late(unsigned long b, unsigned long e)
309{ 311{
310} 312}
311#endif
312 313
313extern struct mutex pm_mutex; 314static inline void lock_system_sleep(void) {}
315static inline void unlock_system_sleep(void) {}
316
317#else
318
319/* Let some subsystems like memory hotadd exclude hibernation */
320
321static inline void lock_system_sleep(void)
322{
323 mutex_lock(&pm_mutex);
324}
325
326static inline void unlock_system_sleep(void)
327{
328 mutex_unlock(&pm_mutex);
329}
330#endif
314 331
315#endif /* _LINUX_SUSPEND_H */ 332#endif /* _LINUX_SUSPEND_H */
diff --git a/include/linux/swiotlb.h b/include/linux/swiotlb.h
index 73b1f1cec423..febedcf67c7e 100644
--- a/include/linux/swiotlb.h
+++ b/include/linux/swiotlb.h
@@ -7,6 +7,8 @@ struct device;
7struct dma_attrs; 7struct dma_attrs;
8struct scatterlist; 8struct scatterlist;
9 9
10extern int swiotlb_force;
11
10/* 12/*
11 * Maximum allowable number of contiguous slabs to map, 13 * Maximum allowable number of contiguous slabs to map,
12 * must be a power of 2. What is the appropriate value ? 14 * must be a power of 2. What is the appropriate value ?
@@ -20,8 +22,7 @@ struct scatterlist;
20 */ 22 */
21#define IO_TLB_SHIFT 11 23#define IO_TLB_SHIFT 11
22 24
23extern void 25extern void swiotlb_init(int verbose);
24swiotlb_init(void);
25 26
26extern void 27extern void
27*swiotlb_alloc_coherent(struct device *hwdev, size_t size, 28*swiotlb_alloc_coherent(struct device *hwdev, size_t size,
@@ -88,4 +89,11 @@ swiotlb_dma_mapping_error(struct device *hwdev, dma_addr_t dma_addr);
88extern int 89extern int
89swiotlb_dma_supported(struct device *hwdev, u64 mask); 90swiotlb_dma_supported(struct device *hwdev, u64 mask);
90 91
92#ifdef CONFIG_SWIOTLB
93extern void __init swiotlb_free(void);
94#else
95static inline void swiotlb_free(void) { }
96#endif
97
98extern void swiotlb_print_info(void);
91#endif /* __LINUX_SWIOTLB_H */ 99#endif /* __LINUX_SWIOTLB_H */
diff --git a/include/linux/syscalls.h b/include/linux/syscalls.h
index a990ace1a838..e79e2f3ccc51 100644
--- a/include/linux/syscalls.h
+++ b/include/linux/syscalls.h
@@ -99,37 +99,16 @@ struct perf_event_attr;
99#define __SC_TEST6(t6, a6, ...) __SC_TEST(t6); __SC_TEST5(__VA_ARGS__) 99#define __SC_TEST6(t6, a6, ...) __SC_TEST(t6); __SC_TEST5(__VA_ARGS__)
100 100
101#ifdef CONFIG_EVENT_PROFILE 101#ifdef CONFIG_EVENT_PROFILE
102#define TRACE_SYS_ENTER_PROFILE(sname) \
103static int prof_sysenter_enable_##sname(void) \
104{ \
105 return reg_prof_syscall_enter("sys"#sname); \
106} \
107 \
108static void prof_sysenter_disable_##sname(void) \
109{ \
110 unreg_prof_syscall_enter("sys"#sname); \
111}
112
113#define TRACE_SYS_EXIT_PROFILE(sname) \
114static int prof_sysexit_enable_##sname(void) \
115{ \
116 return reg_prof_syscall_exit("sys"#sname); \
117} \
118 \
119static void prof_sysexit_disable_##sname(void) \
120{ \
121 unreg_prof_syscall_exit("sys"#sname); \
122}
123 102
124#define TRACE_SYS_ENTER_PROFILE_INIT(sname) \ 103#define TRACE_SYS_ENTER_PROFILE_INIT(sname) \
125 .profile_count = ATOMIC_INIT(-1), \ 104 .profile_count = ATOMIC_INIT(-1), \
126 .profile_enable = prof_sysenter_enable_##sname, \ 105 .profile_enable = prof_sysenter_enable, \
127 .profile_disable = prof_sysenter_disable_##sname, 106 .profile_disable = prof_sysenter_disable,
128 107
129#define TRACE_SYS_EXIT_PROFILE_INIT(sname) \ 108#define TRACE_SYS_EXIT_PROFILE_INIT(sname) \
130 .profile_count = ATOMIC_INIT(-1), \ 109 .profile_count = ATOMIC_INIT(-1), \
131 .profile_enable = prof_sysexit_enable_##sname, \ 110 .profile_enable = prof_sysexit_enable, \
132 .profile_disable = prof_sysexit_disable_##sname, 111 .profile_disable = prof_sysexit_disable,
133#else 112#else
134#define TRACE_SYS_ENTER_PROFILE(sname) 113#define TRACE_SYS_ENTER_PROFILE(sname)
135#define TRACE_SYS_ENTER_PROFILE_INIT(sname) 114#define TRACE_SYS_ENTER_PROFILE_INIT(sname)
@@ -153,74 +132,46 @@ static void prof_sysexit_disable_##sname(void) \
153#define __SC_STR_TDECL6(t, a, ...) #t, __SC_STR_TDECL5(__VA_ARGS__) 132#define __SC_STR_TDECL6(t, a, ...) #t, __SC_STR_TDECL5(__VA_ARGS__)
154 133
155#define SYSCALL_TRACE_ENTER_EVENT(sname) \ 134#define SYSCALL_TRACE_ENTER_EVENT(sname) \
135 static const struct syscall_metadata __syscall_meta_##sname; \
156 static struct ftrace_event_call event_enter_##sname; \ 136 static struct ftrace_event_call event_enter_##sname; \
157 struct trace_event enter_syscall_print_##sname = { \ 137 static struct trace_event enter_syscall_print_##sname = { \
158 .trace = print_syscall_enter, \ 138 .trace = print_syscall_enter, \
159 }; \ 139 }; \
160 static int init_enter_##sname(void) \
161 { \
162 int num, id; \
163 num = syscall_name_to_nr("sys"#sname); \
164 if (num < 0) \
165 return -ENOSYS; \
166 id = register_ftrace_event(&enter_syscall_print_##sname);\
167 if (!id) \
168 return -ENODEV; \
169 event_enter_##sname.id = id; \
170 set_syscall_enter_id(num, id); \
171 INIT_LIST_HEAD(&event_enter_##sname.fields); \
172 return 0; \
173 } \
174 TRACE_SYS_ENTER_PROFILE(sname); \
175 static struct ftrace_event_call __used \ 140 static struct ftrace_event_call __used \
176 __attribute__((__aligned__(4))) \ 141 __attribute__((__aligned__(4))) \
177 __attribute__((section("_ftrace_events"))) \ 142 __attribute__((section("_ftrace_events"))) \
178 event_enter_##sname = { \ 143 event_enter_##sname = { \
179 .name = "sys_enter"#sname, \ 144 .name = "sys_enter"#sname, \
180 .system = "syscalls", \ 145 .system = "syscalls", \
181 .event = &event_syscall_enter, \ 146 .event = &enter_syscall_print_##sname, \
182 .raw_init = init_enter_##sname, \ 147 .raw_init = init_syscall_trace, \
183 .show_format = syscall_enter_format, \ 148 .show_format = syscall_enter_format, \
184 .define_fields = syscall_enter_define_fields, \ 149 .define_fields = syscall_enter_define_fields, \
185 .regfunc = reg_event_syscall_enter, \ 150 .regfunc = reg_event_syscall_enter, \
186 .unregfunc = unreg_event_syscall_enter, \ 151 .unregfunc = unreg_event_syscall_enter, \
187 .data = "sys"#sname, \ 152 .data = (void *)&__syscall_meta_##sname,\
188 TRACE_SYS_ENTER_PROFILE_INIT(sname) \ 153 TRACE_SYS_ENTER_PROFILE_INIT(sname) \
189 } 154 }
190 155
191#define SYSCALL_TRACE_EXIT_EVENT(sname) \ 156#define SYSCALL_TRACE_EXIT_EVENT(sname) \
157 static const struct syscall_metadata __syscall_meta_##sname; \
192 static struct ftrace_event_call event_exit_##sname; \ 158 static struct ftrace_event_call event_exit_##sname; \
193 struct trace_event exit_syscall_print_##sname = { \ 159 static struct trace_event exit_syscall_print_##sname = { \
194 .trace = print_syscall_exit, \ 160 .trace = print_syscall_exit, \
195 }; \ 161 }; \
196 static int init_exit_##sname(void) \
197 { \
198 int num, id; \
199 num = syscall_name_to_nr("sys"#sname); \
200 if (num < 0) \
201 return -ENOSYS; \
202 id = register_ftrace_event(&exit_syscall_print_##sname);\
203 if (!id) \
204 return -ENODEV; \
205 event_exit_##sname.id = id; \
206 set_syscall_exit_id(num, id); \
207 INIT_LIST_HEAD(&event_exit_##sname.fields); \
208 return 0; \
209 } \
210 TRACE_SYS_EXIT_PROFILE(sname); \
211 static struct ftrace_event_call __used \ 162 static struct ftrace_event_call __used \
212 __attribute__((__aligned__(4))) \ 163 __attribute__((__aligned__(4))) \
213 __attribute__((section("_ftrace_events"))) \ 164 __attribute__((section("_ftrace_events"))) \
214 event_exit_##sname = { \ 165 event_exit_##sname = { \
215 .name = "sys_exit"#sname, \ 166 .name = "sys_exit"#sname, \
216 .system = "syscalls", \ 167 .system = "syscalls", \
217 .event = &event_syscall_exit, \ 168 .event = &exit_syscall_print_##sname, \
218 .raw_init = init_exit_##sname, \ 169 .raw_init = init_syscall_trace, \
219 .show_format = syscall_exit_format, \ 170 .show_format = syscall_exit_format, \
220 .define_fields = syscall_exit_define_fields, \ 171 .define_fields = syscall_exit_define_fields, \
221 .regfunc = reg_event_syscall_exit, \ 172 .regfunc = reg_event_syscall_exit, \
222 .unregfunc = unreg_event_syscall_exit, \ 173 .unregfunc = unreg_event_syscall_exit, \
223 .data = "sys"#sname, \ 174 .data = (void *)&__syscall_meta_##sname,\
224 TRACE_SYS_EXIT_PROFILE_INIT(sname) \ 175 TRACE_SYS_EXIT_PROFILE_INIT(sname) \
225 } 176 }
226 177
diff --git a/include/linux/tpm.h b/include/linux/tpm.h
index 3338b3f5c21a..ac5d1c1285d9 100644
--- a/include/linux/tpm.h
+++ b/include/linux/tpm.h
@@ -27,9 +27,16 @@
27 */ 27 */
28#define TPM_ANY_NUM 0xFFFF 28#define TPM_ANY_NUM 0xFFFF
29 29
30#if defined(CONFIG_TCG_TPM) 30#if defined(CONFIG_TCG_TPM) || defined(CONFIG_TCG_TPM_MODULE)
31 31
32extern int tpm_pcr_read(u32 chip_num, int pcr_idx, u8 *res_buf); 32extern int tpm_pcr_read(u32 chip_num, int pcr_idx, u8 *res_buf);
33extern int tpm_pcr_extend(u32 chip_num, int pcr_idx, const u8 *hash); 33extern int tpm_pcr_extend(u32 chip_num, int pcr_idx, const u8 *hash);
34#else
35static inline int tpm_pcr_read(u32 chip_num, int pcr_idx, u8 *res_buf) {
36 return -ENODEV;
37}
38static inline int tpm_pcr_extend(u32 chip_num, int pcr_idx, const u8 *hash) {
39 return -ENODEV;
40}
34#endif 41#endif
35#endif 42#endif
diff --git a/include/linux/tracepoint.h b/include/linux/tracepoint.h
index 2aac8a83e89b..f59604ed0ec6 100644
--- a/include/linux/tracepoint.h
+++ b/include/linux/tracepoint.h
@@ -280,6 +280,12 @@ static inline void tracepoint_synchronize_unregister(void)
280 * TRACE_EVENT_FN to perform any (un)registration work. 280 * TRACE_EVENT_FN to perform any (un)registration work.
281 */ 281 */
282 282
283#define DECLARE_EVENT_CLASS(name, proto, args, tstruct, assign, print)
284#define DEFINE_EVENT(template, name, proto, args) \
285 DECLARE_TRACE(name, PARAMS(proto), PARAMS(args))
286#define DEFINE_EVENT_PRINT(template, name, proto, args, print) \
287 DECLARE_TRACE(name, PARAMS(proto), PARAMS(args))
288
283#define TRACE_EVENT(name, proto, args, struct, assign, print) \ 289#define TRACE_EVENT(name, proto, args, struct, assign, print) \
284 DECLARE_TRACE(name, PARAMS(proto), PARAMS(args)) 290 DECLARE_TRACE(name, PARAMS(proto), PARAMS(args))
285#define TRACE_EVENT_FN(name, proto, args, struct, \ 291#define TRACE_EVENT_FN(name, proto, args, struct, \
diff --git a/include/linux/vt.h b/include/linux/vt.h
index 7afca0d72139..7ffa11f06232 100644
--- a/include/linux/vt.h
+++ b/include/linux/vt.h
@@ -70,8 +70,8 @@ struct vt_event {
70#define VT_EVENT_UNBLANK 0x0004 /* Screen unblank */ 70#define VT_EVENT_UNBLANK 0x0004 /* Screen unblank */
71#define VT_EVENT_RESIZE 0x0008 /* Resize display */ 71#define VT_EVENT_RESIZE 0x0008 /* Resize display */
72#define VT_MAX_EVENT 0x000F 72#define VT_MAX_EVENT 0x000F
73 unsigned int old; /* Old console */ 73 unsigned int oldev; /* Old console */
74 unsigned int new; /* New console (if changing) */ 74 unsigned int newev; /* New console (if changing) */
75 unsigned int pad[4]; /* Padding for expansion */ 75 unsigned int pad[4]; /* Padding for expansion */
76}; 76};
77 77
diff --git a/include/net/ip_fib.h b/include/net/ip_fib.h
index ef91fe924ba4..4d22fabc7719 100644
--- a/include/net/ip_fib.h
+++ b/include/net/ip_fib.h
@@ -210,7 +210,8 @@ extern struct fib_table *fib_get_table(struct net *net, u32 id);
210extern const struct nla_policy rtm_ipv4_policy[]; 210extern const struct nla_policy rtm_ipv4_policy[];
211extern void ip_fib_init(void); 211extern void ip_fib_init(void);
212extern int fib_validate_source(__be32 src, __be32 dst, u8 tos, int oif, 212extern int fib_validate_source(__be32 src, __be32 dst, u8 tos, int oif,
213 struct net_device *dev, __be32 *spec_dst, u32 *itag); 213 struct net_device *dev, __be32 *spec_dst,
214 u32 *itag, u32 mark);
214extern void fib_select_default(struct net *net, const struct flowi *flp, 215extern void fib_select_default(struct net *net, const struct flowi *flp,
215 struct fib_result *res); 216 struct fib_result *res);
216 217
diff --git a/include/net/mac80211.h b/include/net/mac80211.h
index c75b960c8ac8..998c30fc8981 100644
--- a/include/net/mac80211.h
+++ b/include/net/mac80211.h
@@ -1283,6 +1283,12 @@ enum ieee80211_filter_flags {
1283 * 1283 *
1284 * These flags are used with the ampdu_action() callback in 1284 * These flags are used with the ampdu_action() callback in
1285 * &struct ieee80211_ops to indicate which action is needed. 1285 * &struct ieee80211_ops to indicate which action is needed.
1286 *
1287 * Note that drivers MUST be able to deal with a TX aggregation
1288 * session being stopped even before they OK'ed starting it by
1289 * calling ieee80211_start_tx_ba_cb(_irqsafe), because the peer
1290 * might receive the addBA frame and send a delBA right away!
1291 *
1286 * @IEEE80211_AMPDU_RX_START: start Rx aggregation 1292 * @IEEE80211_AMPDU_RX_START: start Rx aggregation
1287 * @IEEE80211_AMPDU_RX_STOP: stop Rx aggregation 1293 * @IEEE80211_AMPDU_RX_STOP: stop Rx aggregation
1288 * @IEEE80211_AMPDU_TX_START: start Tx aggregation 1294 * @IEEE80211_AMPDU_TX_START: start Tx aggregation
diff --git a/include/net/netfilter/nf_conntrack.h b/include/net/netfilter/nf_conntrack.h
index cbdd6284996d..5cf7270e3ffc 100644
--- a/include/net/netfilter/nf_conntrack.h
+++ b/include/net/netfilter/nf_conntrack.h
@@ -255,11 +255,9 @@ static inline bool nf_ct_kill(struct nf_conn *ct)
255} 255}
256 256
257/* These are for NAT. Icky. */ 257/* These are for NAT. Icky. */
258/* Update TCP window tracking data when NAT mangles the packet */ 258extern s16 (*nf_ct_nat_offset)(const struct nf_conn *ct,
259extern void nf_conntrack_tcp_update(const struct sk_buff *skb, 259 enum ip_conntrack_dir dir,
260 unsigned int dataoff, 260 u32 seq);
261 struct nf_conn *ct, int dir,
262 s16 offset);
263 261
264/* Fake conntrack entry for untracked connections */ 262/* Fake conntrack entry for untracked connections */
265extern struct nf_conn nf_conntrack_untracked; 263extern struct nf_conn nf_conntrack_untracked;
diff --git a/include/net/netfilter/nf_nat_helper.h b/include/net/netfilter/nf_nat_helper.h
index 237a961f40e1..4222220920a5 100644
--- a/include/net/netfilter/nf_nat_helper.h
+++ b/include/net/netfilter/nf_nat_helper.h
@@ -32,4 +32,8 @@ extern int (*nf_nat_seq_adjust_hook)(struct sk_buff *skb,
32 * to port ct->master->saved_proto. */ 32 * to port ct->master->saved_proto. */
33extern void nf_nat_follow_master(struct nf_conn *ct, 33extern void nf_nat_follow_master(struct nf_conn *ct,
34 struct nf_conntrack_expect *this); 34 struct nf_conntrack_expect *this);
35
36extern s16 nf_nat_get_offset(const struct nf_conn *ct,
37 enum ip_conntrack_dir dir,
38 u32 seq);
35#endif 39#endif
diff --git a/include/net/sctp/structs.h b/include/net/sctp/structs.h
index 6e5f0e0c7967..0a474568b003 100644
--- a/include/net/sctp/structs.h
+++ b/include/net/sctp/structs.h
@@ -893,7 +893,6 @@ struct sctp_transport {
893 */ 893 */
894 /* RTO : The current retransmission timeout value. */ 894 /* RTO : The current retransmission timeout value. */
895 unsigned long rto; 895 unsigned long rto;
896 unsigned long last_rto;
897 896
898 __u32 rtt; /* This is the most recent RTT. */ 897 __u32 rtt; /* This is the most recent RTT. */
899 898
@@ -1980,7 +1979,7 @@ void sctp_assoc_set_primary(struct sctp_association *,
1980void sctp_assoc_del_nonprimary_peers(struct sctp_association *, 1979void sctp_assoc_del_nonprimary_peers(struct sctp_association *,
1981 struct sctp_transport *); 1980 struct sctp_transport *);
1982int sctp_assoc_set_bind_addr_from_ep(struct sctp_association *, 1981int sctp_assoc_set_bind_addr_from_ep(struct sctp_association *,
1983 gfp_t); 1982 sctp_scope_t, gfp_t);
1984int sctp_assoc_set_bind_addr_from_cookie(struct sctp_association *, 1983int sctp_assoc_set_bind_addr_from_cookie(struct sctp_association *,
1985 struct sctp_cookie*, 1984 struct sctp_cookie*,
1986 gfp_t gfp); 1985 gfp_t gfp);
diff --git a/include/pcmcia/cs.h b/include/pcmcia/cs.h
index 904468a191ef..afc2bfb9e917 100644
--- a/include/pcmcia/cs.h
+++ b/include/pcmcia/cs.h
@@ -15,6 +15,10 @@
15#ifndef _LINUX_CS_H 15#ifndef _LINUX_CS_H
16#define _LINUX_CS_H 16#define _LINUX_CS_H
17 17
18#ifdef __KERNEL__
19#include <linux/interrupt.h>
20#endif
21
18/* For AccessConfigurationRegister */ 22/* For AccessConfigurationRegister */
19typedef struct conf_reg_t { 23typedef struct conf_reg_t {
20 u_char Function; 24 u_char Function;
@@ -111,11 +115,9 @@ typedef struct io_req_t {
111 115
112/* For RequestIRQ and ReleaseIRQ */ 116/* For RequestIRQ and ReleaseIRQ */
113typedef struct irq_req_t { 117typedef struct irq_req_t {
114 u_int Attributes; 118 u_int Attributes;
115 u_int AssignedIRQ; 119 u_int AssignedIRQ;
116 u_int IRQInfo1, IRQInfo2; /* IRQInfo2 is ignored */ 120 irq_handler_t Handler;
117 void *Handler;
118 void *Instance;
119} irq_req_t; 121} irq_req_t;
120 122
121/* Attributes for RequestIRQ and ReleaseIRQ */ 123/* Attributes for RequestIRQ and ReleaseIRQ */
@@ -125,7 +127,7 @@ typedef struct irq_req_t {
125#define IRQ_TYPE_DYNAMIC_SHARING 0x02 127#define IRQ_TYPE_DYNAMIC_SHARING 0x02
126#define IRQ_FORCED_PULSE 0x04 128#define IRQ_FORCED_PULSE 0x04
127#define IRQ_FIRST_SHARED 0x08 129#define IRQ_FIRST_SHARED 0x08
128#define IRQ_HANDLE_PRESENT 0x10 130//#define IRQ_HANDLE_PRESENT 0x10
129#define IRQ_PULSE_ALLOCATED 0x100 131#define IRQ_PULSE_ALLOCATED 0x100
130 132
131/* Bits in IRQInfo1 field */ 133/* Bits in IRQInfo1 field */
diff --git a/include/pcmcia/cs_types.h b/include/pcmcia/cs_types.h
index 315965a37930..f5e3b8386c8f 100644
--- a/include/pcmcia/cs_types.h
+++ b/include/pcmcia/cs_types.h
@@ -26,8 +26,7 @@ typedef u_int event_t;
26typedef u_char cisdata_t; 26typedef u_char cisdata_t;
27typedef u_short page_t; 27typedef u_short page_t;
28 28
29struct window_t; 29typedef unsigned long window_handle_t;
30typedef struct window_t *window_handle_t;
31 30
32struct region_t; 31struct region_t;
33typedef struct region_t *memory_handle_t; 32typedef struct region_t *memory_handle_t;
diff --git a/include/pcmcia/ds.h b/include/pcmcia/ds.h
index a2be80b9a095..d403c12f7978 100644
--- a/include/pcmcia/ds.h
+++ b/include/pcmcia/ds.h
@@ -34,6 +34,7 @@
34struct pcmcia_socket; 34struct pcmcia_socket;
35struct pcmcia_device; 35struct pcmcia_device;
36struct config_t; 36struct config_t;
37struct net_device;
37 38
38/* dynamic device IDs for PCMCIA device drivers. See 39/* dynamic device IDs for PCMCIA device drivers. See
39 * Documentation/pcmcia/driver.txt for details. 40 * Documentation/pcmcia/driver.txt for details.
@@ -137,65 +138,39 @@ struct pcmcia_device {
137#define to_pcmcia_dev(n) container_of(n, struct pcmcia_device, dev) 138#define to_pcmcia_dev(n) container_of(n, struct pcmcia_device, dev)
138#define to_pcmcia_drv(n) container_of(n, struct pcmcia_driver, drv) 139#define to_pcmcia_drv(n) container_of(n, struct pcmcia_driver, drv)
139 140
140/* deprecated -- don't use! */
141#define handle_to_dev(handle) (handle->dev)
142 141
143 142/*
144/* (deprecated) error reporting by PCMCIA devices. Use dev_printk() 143 * CIS access.
145 * or dev_dbg() directly in the driver, without referring to pcmcia_error_func() 144 *
146 * and/or pcmcia_error_ret() for those functions will go away soon. 145 * Please use the following functions to access CIS tuples:
147 */ 146 * - pcmcia_get_tuple()
148enum service { 147 * - pcmcia_loop_tuple()
149 AccessConfigurationRegister, AddSocketServices, 148 * - pcmcia_get_mac_from_cis()
150 AdjustResourceInfo, CheckEraseQueue, CloseMemory, CopyMemory, 149 *
151 DeregisterClient, DeregisterEraseQueue, GetCardServicesInfo, 150 * To parse a tuple_t, pcmcia_parse_tuple() exists. Its interface
152 GetClientInfo, GetConfigurationInfo, GetEventMask, 151 * might change in future.
153 GetFirstClient, GetFirstPartion, GetFirstRegion, GetFirstTuple,
154 GetNextClient, GetNextPartition, GetNextRegion, GetNextTuple,
155 GetStatus, GetTupleData, MapLogSocket, MapLogWindow, MapMemPage,
156 MapPhySocket, MapPhyWindow, ModifyConfiguration, ModifyWindow,
157 OpenMemory, ParseTuple, ReadMemory, RegisterClient,
158 RegisterEraseQueue, RegisterMTD, RegisterTimer,
159 ReleaseConfiguration, ReleaseExclusive, ReleaseIO, ReleaseIRQ,
160 ReleaseSocketMask, ReleaseWindow, ReplaceSocketServices,
161 RequestConfiguration, RequestExclusive, RequestIO, RequestIRQ,
162 RequestSocketMask, RequestWindow, ResetCard, ReturnSSEntry,
163 SetEventMask, SetRegion, ValidateCIS, VendorSpecific,
164 WriteMemory, BindDevice, BindMTD, ReportError,
165 SuspendCard, ResumeCard, EjectCard, InsertCard, ReplaceCIS,
166 GetFirstWindow, GetNextWindow, GetMemPage
167};
168const char *pcmcia_error_func(int func);
169const char *pcmcia_error_ret(int ret);
170
171#define cs_error(p_dev, func, ret) \
172 { \
173 dev_printk(KERN_NOTICE, &p_dev->dev, \
174 "%s : %s\n", \
175 pcmcia_error_func(func), \
176 pcmcia_error_ret(ret)); \
177 }
178
179/* CIS access.
180 * Use the pcmcia_* versions in PCMCIA drivers
181 */ 152 */
182int pcmcia_parse_tuple(tuple_t *tuple, cisparse_t *parse);
183 153
184int pccard_get_first_tuple(struct pcmcia_socket *s, unsigned int function, 154/* get the very first CIS entry of type @code. Note that buf is pointer
185 tuple_t *tuple); 155 * to u8 *buf; and that you need to kfree(buf) afterwards. */
186#define pcmcia_get_first_tuple(p_dev, tuple) \ 156size_t pcmcia_get_tuple(struct pcmcia_device *p_dev, cisdata_t code,
187 pccard_get_first_tuple(p_dev->socket, p_dev->func, tuple) 157 u8 **buf);
188 158
189int pccard_get_next_tuple(struct pcmcia_socket *s, unsigned int function, 159/* loop over CIS entries */
190 tuple_t *tuple); 160int pcmcia_loop_tuple(struct pcmcia_device *p_dev, cisdata_t code,
191#define pcmcia_get_next_tuple(p_dev, tuple) \ 161 int (*loop_tuple) (struct pcmcia_device *p_dev,
192 pccard_get_next_tuple(p_dev->socket, p_dev->func, tuple) 162 tuple_t *tuple,
163 void *priv_data),
164 void *priv_data);
193 165
194int pccard_get_tuple_data(struct pcmcia_socket *s, tuple_t *tuple); 166/* get the MAC address from CISTPL_FUNCE */
195#define pcmcia_get_tuple_data(p_dev, tuple) \ 167int pcmcia_get_mac_from_cis(struct pcmcia_device *p_dev,
196 pccard_get_tuple_data(p_dev->socket, tuple) 168 struct net_device *dev);
197 169
198 170
171/* parse a tuple_t */
172int pcmcia_parse_tuple(tuple_t *tuple, cisparse_t *parse);
173
199/* loop CIS entries for valid configuration */ 174/* loop CIS entries for valid configuration */
200int pcmcia_loop_config(struct pcmcia_device *p_dev, 175int pcmcia_loop_config(struct pcmcia_device *p_dev,
201 int (*conf_check) (struct pcmcia_device *p_dev, 176 int (*conf_check) (struct pcmcia_device *p_dev,
@@ -221,12 +196,11 @@ int pcmcia_request_irq(struct pcmcia_device *p_dev, irq_req_t *req);
221int pcmcia_request_configuration(struct pcmcia_device *p_dev, 196int pcmcia_request_configuration(struct pcmcia_device *p_dev,
222 config_req_t *req); 197 config_req_t *req);
223 198
224int pcmcia_request_window(struct pcmcia_device **p_dev, win_req_t *req, 199int pcmcia_request_window(struct pcmcia_device *p_dev, win_req_t *req,
225 window_handle_t *wh); 200 window_handle_t *wh);
226int pcmcia_release_window(window_handle_t win); 201int pcmcia_release_window(struct pcmcia_device *p_dev, window_handle_t win);
227 202int pcmcia_map_mem_page(struct pcmcia_device *p_dev, window_handle_t win,
228int pcmcia_get_mem_page(window_handle_t win, memreq_t *req); 203 memreq_t *req);
229int pcmcia_map_mem_page(window_handle_t win, memreq_t *req);
230 204
231int pcmcia_modify_configuration(struct pcmcia_device *p_dev, modconf_t *mod); 205int pcmcia_modify_configuration(struct pcmcia_device *p_dev, modconf_t *mod);
232void pcmcia_disable_device(struct pcmcia_device *p_dev); 206void pcmcia_disable_device(struct pcmcia_device *p_dev);
diff --git a/include/pcmcia/ss.h b/include/pcmcia/ss.h
index d696a692d94a..7c23be706f12 100644
--- a/include/pcmcia/ss.h
+++ b/include/pcmcia/ss.h
@@ -107,15 +107,6 @@ typedef struct io_window_t {
107 struct resource *res; 107 struct resource *res;
108} io_window_t; 108} io_window_t;
109 109
110#define WINDOW_MAGIC 0xB35C
111typedef struct window_t {
112 u_short magic;
113 u_short index;
114 struct pcmcia_device *handle;
115 struct pcmcia_socket *sock;
116 pccard_mem_map ctl;
117} window_t;
118
119/* Maximum number of IO windows per socket */ 110/* Maximum number of IO windows per socket */
120#define MAX_IO_WIN 2 111#define MAX_IO_WIN 2
121 112
@@ -155,7 +146,7 @@ struct pcmcia_socket {
155 u_int Config; 146 u_int Config;
156 } irq; 147 } irq;
157 io_window_t io[MAX_IO_WIN]; 148 io_window_t io[MAX_IO_WIN];
158 window_t win[MAX_WIN]; 149 pccard_mem_map win[MAX_WIN];
159 struct list_head cis_cache; 150 struct list_head cis_cache;
160 size_t fake_cis_len; 151 size_t fake_cis_len;
161 u8 *fake_cis; 152 u8 *fake_cis;
@@ -172,7 +163,7 @@ struct pcmcia_socket {
172 u_int irq_mask; 163 u_int irq_mask;
173 u_int map_size; 164 u_int map_size;
174 u_int io_offset; 165 u_int io_offset;
175 u_char pci_irq; 166 u_int pci_irq;
176 struct pci_dev * cb_dev; 167 struct pci_dev * cb_dev;
177 168
178 169
@@ -262,6 +253,8 @@ struct pcmcia_socket {
262 struct device dev; 253 struct device dev;
263 /* data internal to the socket driver */ 254 /* data internal to the socket driver */
264 void *driver_data; 255 void *driver_data;
256 /* status of the card during resume from a system sleep state */
257 int resume_status;
265}; 258};
266 259
267 260
@@ -280,6 +273,8 @@ extern struct pccard_resource_ops pccard_nonstatic_ops;
280 273
281/* socket drivers are expected to use these callbacks in their .drv struct */ 274/* socket drivers are expected to use these callbacks in their .drv struct */
282extern int pcmcia_socket_dev_suspend(struct device *dev); 275extern int pcmcia_socket_dev_suspend(struct device *dev);
276extern void pcmcia_socket_dev_early_resume(struct device *dev);
277extern void pcmcia_socket_dev_late_resume(struct device *dev);
283extern int pcmcia_socket_dev_resume(struct device *dev); 278extern int pcmcia_socket_dev_resume(struct device *dev);
284 279
285/* socket drivers use this callback in their IRQ handler */ 280/* socket drivers use this callback in their IRQ handler */
diff --git a/include/scsi/scsi_device.h b/include/scsi/scsi_device.h
index 9af48cbf0036..f097ae340bc1 100644
--- a/include/scsi/scsi_device.h
+++ b/include/scsi/scsi_device.h
@@ -145,6 +145,7 @@ struct scsi_device {
145 unsigned retry_hwerror:1; /* Retry HARDWARE_ERROR */ 145 unsigned retry_hwerror:1; /* Retry HARDWARE_ERROR */
146 unsigned last_sector_bug:1; /* do not use multisector accesses on 146 unsigned last_sector_bug:1; /* do not use multisector accesses on
147 SD_LAST_BUGGY_SECTORS */ 147 SD_LAST_BUGGY_SECTORS */
148 unsigned is_visible:1; /* is the device visible in sysfs */
148 149
149 DECLARE_BITMAP(supported_events, SDEV_EVT_MAXBITS); /* supported events */ 150 DECLARE_BITMAP(supported_events, SDEV_EVT_MAXBITS); /* supported events */
150 struct list_head event_list; /* asserted events */ 151 struct list_head event_list; /* asserted events */
diff --git a/include/scsi/scsi_host.h b/include/scsi/scsi_host.h
index 6e728b176904..47941fc5aba7 100644
--- a/include/scsi/scsi_host.h
+++ b/include/scsi/scsi_host.h
@@ -797,30 +797,23 @@ static inline unsigned int scsi_host_get_prot(struct Scsi_Host *shost)
797 797
798static inline unsigned int scsi_host_dif_capable(struct Scsi_Host *shost, unsigned int target_type) 798static inline unsigned int scsi_host_dif_capable(struct Scsi_Host *shost, unsigned int target_type)
799{ 799{
800 switch (target_type) { 800 static unsigned char cap[] = { 0,
801 case 1: 801 SHOST_DIF_TYPE1_PROTECTION,
802 if (shost->prot_capabilities & SHOST_DIF_TYPE1_PROTECTION) 802 SHOST_DIF_TYPE2_PROTECTION,
803 return target_type; 803 SHOST_DIF_TYPE3_PROTECTION };
804 case 2:
805 if (shost->prot_capabilities & SHOST_DIF_TYPE2_PROTECTION)
806 return target_type;
807 case 3:
808 if (shost->prot_capabilities & SHOST_DIF_TYPE3_PROTECTION)
809 return target_type;
810 }
811 804
812 return 0; 805 return shost->prot_capabilities & cap[target_type] ? target_type : 0;
813} 806}
814 807
815static inline unsigned int scsi_host_dix_capable(struct Scsi_Host *shost, unsigned int target_type) 808static inline unsigned int scsi_host_dix_capable(struct Scsi_Host *shost, unsigned int target_type)
816{ 809{
817#if defined(CONFIG_BLK_DEV_INTEGRITY) 810#if defined(CONFIG_BLK_DEV_INTEGRITY)
818 switch (target_type) { 811 static unsigned char cap[] = { SHOST_DIX_TYPE0_PROTECTION,
819 case 0: return shost->prot_capabilities & SHOST_DIX_TYPE0_PROTECTION; 812 SHOST_DIX_TYPE1_PROTECTION,
820 case 1: return shost->prot_capabilities & SHOST_DIX_TYPE1_PROTECTION; 813 SHOST_DIX_TYPE2_PROTECTION,
821 case 2: return shost->prot_capabilities & SHOST_DIX_TYPE2_PROTECTION; 814 SHOST_DIX_TYPE3_PROTECTION };
822 case 3: return shost->prot_capabilities & SHOST_DIX_TYPE3_PROTECTION; 815
823 } 816 return shost->prot_capabilities & cap[target_type];
824#endif 817#endif
825 return 0; 818 return 0;
826} 819}
diff --git a/include/trace/define_trace.h b/include/trace/define_trace.h
index 2a4b3bf74033..5acfb1eb4df9 100644
--- a/include/trace/define_trace.h
+++ b/include/trace/define_trace.h
@@ -31,6 +31,14 @@
31 assign, print, reg, unreg) \ 31 assign, print, reg, unreg) \
32 DEFINE_TRACE_FN(name, reg, unreg) 32 DEFINE_TRACE_FN(name, reg, unreg)
33 33
34#undef DEFINE_EVENT
35#define DEFINE_EVENT(template, name, proto, args) \
36 DEFINE_TRACE(name)
37
38#undef DEFINE_EVENT_PRINT
39#define DEFINE_EVENT_PRINT(template, name, proto, args, print) \
40 DEFINE_TRACE(name)
41
34#undef DECLARE_TRACE 42#undef DECLARE_TRACE
35#define DECLARE_TRACE(name, proto, args) \ 43#define DECLARE_TRACE(name, proto, args) \
36 DEFINE_TRACE(name) 44 DEFINE_TRACE(name)
@@ -63,6 +71,9 @@
63 71
64#undef TRACE_EVENT 72#undef TRACE_EVENT
65#undef TRACE_EVENT_FN 73#undef TRACE_EVENT_FN
74#undef DECLARE_EVENT_CLASS
75#undef DEFINE_EVENT
76#undef DEFINE_EVENT_PRINT
66#undef TRACE_HEADER_MULTI_READ 77#undef TRACE_HEADER_MULTI_READ
67 78
68/* Only undef what we defined in this file */ 79/* Only undef what we defined in this file */
diff --git a/include/trace/events/bkl.h b/include/trace/events/bkl.h
new file mode 100644
index 000000000000..1af72dc24278
--- /dev/null
+++ b/include/trace/events/bkl.h
@@ -0,0 +1,61 @@
1#undef TRACE_SYSTEM
2#define TRACE_SYSTEM bkl
3
4#if !defined(_TRACE_BKL_H) || defined(TRACE_HEADER_MULTI_READ)
5#define _TRACE_BKL_H
6
7#include <linux/tracepoint.h>
8
9TRACE_EVENT(lock_kernel,
10
11 TP_PROTO(const char *func, const char *file, int line),
12
13 TP_ARGS(func, file, line),
14
15 TP_STRUCT__entry(
16 __field( int, depth )
17 __field_ext( const char *, func, FILTER_PTR_STRING )
18 __field_ext( const char *, file, FILTER_PTR_STRING )
19 __field( int, line )
20 ),
21
22 TP_fast_assign(
23 /* We want to record the lock_depth after lock is acquired */
24 __entry->depth = current->lock_depth + 1;
25 __entry->func = func;
26 __entry->file = file;
27 __entry->line = line;
28 ),
29
30 TP_printk("depth=%d file:line=%s:%d func=%s()", __entry->depth,
31 __entry->file, __entry->line, __entry->func)
32);
33
34TRACE_EVENT(unlock_kernel,
35
36 TP_PROTO(const char *func, const char *file, int line),
37
38 TP_ARGS(func, file, line),
39
40 TP_STRUCT__entry(
41 __field(int, depth )
42 __field(const char *, func )
43 __field(const char *, file )
44 __field(int, line )
45 ),
46
47 TP_fast_assign(
48 __entry->depth = current->lock_depth;
49 __entry->func = func;
50 __entry->file = file;
51 __entry->line = line;
52 ),
53
54 TP_printk("depth=%d file:line=%s:%d func=%s()", __entry->depth,
55 __entry->file, __entry->line, __entry->func)
56);
57
58#endif /* _TRACE_BKL_H */
59
60/* This part must be outside protection */
61#include <trace/define_trace.h>
diff --git a/include/trace/events/block.h b/include/trace/events/block.h
index 00405b5f624a..5fb72733331e 100644
--- a/include/trace/events/block.h
+++ b/include/trace/events/block.h
@@ -8,7 +8,7 @@
8#include <linux/blkdev.h> 8#include <linux/blkdev.h>
9#include <linux/tracepoint.h> 9#include <linux/tracepoint.h>
10 10
11TRACE_EVENT(block_rq_abort, 11DECLARE_EVENT_CLASS(block_rq_with_error,
12 12
13 TP_PROTO(struct request_queue *q, struct request *rq), 13 TP_PROTO(struct request_queue *q, struct request *rq),
14 14
@@ -40,41 +40,28 @@ TRACE_EVENT(block_rq_abort,
40 __entry->nr_sector, __entry->errors) 40 __entry->nr_sector, __entry->errors)
41); 41);
42 42
43TRACE_EVENT(block_rq_insert, 43DEFINE_EVENT(block_rq_with_error, block_rq_abort,
44 44
45 TP_PROTO(struct request_queue *q, struct request *rq), 45 TP_PROTO(struct request_queue *q, struct request *rq),
46 46
47 TP_ARGS(q, rq), 47 TP_ARGS(q, rq)
48);
48 49
49 TP_STRUCT__entry( 50DEFINE_EVENT(block_rq_with_error, block_rq_requeue,
50 __field( dev_t, dev )
51 __field( sector_t, sector )
52 __field( unsigned int, nr_sector )
53 __field( unsigned int, bytes )
54 __array( char, rwbs, 6 )
55 __array( char, comm, TASK_COMM_LEN )
56 __dynamic_array( char, cmd, blk_cmd_buf_len(rq) )
57 ),
58 51
59 TP_fast_assign( 52 TP_PROTO(struct request_queue *q, struct request *rq),
60 __entry->dev = rq->rq_disk ? disk_devt(rq->rq_disk) : 0;
61 __entry->sector = blk_pc_request(rq) ? 0 : blk_rq_pos(rq);
62 __entry->nr_sector = blk_pc_request(rq) ? 0 : blk_rq_sectors(rq);
63 __entry->bytes = blk_pc_request(rq) ? blk_rq_bytes(rq) : 0;
64 53
65 blk_fill_rwbs_rq(__entry->rwbs, rq); 54 TP_ARGS(q, rq)
66 blk_dump_cmd(__get_str(cmd), rq); 55);
67 memcpy(__entry->comm, current->comm, TASK_COMM_LEN);
68 ),
69 56
70 TP_printk("%d,%d %s %u (%s) %llu + %u [%s]", 57DEFINE_EVENT(block_rq_with_error, block_rq_complete,
71 MAJOR(__entry->dev), MINOR(__entry->dev), 58
72 __entry->rwbs, __entry->bytes, __get_str(cmd), 59 TP_PROTO(struct request_queue *q, struct request *rq),
73 (unsigned long long)__entry->sector, 60
74 __entry->nr_sector, __entry->comm) 61 TP_ARGS(q, rq)
75); 62);
76 63
77TRACE_EVENT(block_rq_issue, 64DECLARE_EVENT_CLASS(block_rq,
78 65
79 TP_PROTO(struct request_queue *q, struct request *rq), 66 TP_PROTO(struct request_queue *q, struct request *rq),
80 67
@@ -86,7 +73,7 @@ TRACE_EVENT(block_rq_issue,
86 __field( unsigned int, nr_sector ) 73 __field( unsigned int, nr_sector )
87 __field( unsigned int, bytes ) 74 __field( unsigned int, bytes )
88 __array( char, rwbs, 6 ) 75 __array( char, rwbs, 6 )
89 __array( char, comm, TASK_COMM_LEN ) 76 __array( char, comm, TASK_COMM_LEN )
90 __dynamic_array( char, cmd, blk_cmd_buf_len(rq) ) 77 __dynamic_array( char, cmd, blk_cmd_buf_len(rq) )
91 ), 78 ),
92 79
@@ -108,68 +95,18 @@ TRACE_EVENT(block_rq_issue,
108 __entry->nr_sector, __entry->comm) 95 __entry->nr_sector, __entry->comm)
109); 96);
110 97
111TRACE_EVENT(block_rq_requeue, 98DEFINE_EVENT(block_rq, block_rq_insert,
112 99
113 TP_PROTO(struct request_queue *q, struct request *rq), 100 TP_PROTO(struct request_queue *q, struct request *rq),
114 101
115 TP_ARGS(q, rq), 102 TP_ARGS(q, rq)
116
117 TP_STRUCT__entry(
118 __field( dev_t, dev )
119 __field( sector_t, sector )
120 __field( unsigned int, nr_sector )
121 __field( int, errors )
122 __array( char, rwbs, 6 )
123 __dynamic_array( char, cmd, blk_cmd_buf_len(rq) )
124 ),
125
126 TP_fast_assign(
127 __entry->dev = rq->rq_disk ? disk_devt(rq->rq_disk) : 0;
128 __entry->sector = blk_pc_request(rq) ? 0 : blk_rq_pos(rq);
129 __entry->nr_sector = blk_pc_request(rq) ? 0 : blk_rq_sectors(rq);
130 __entry->errors = rq->errors;
131
132 blk_fill_rwbs_rq(__entry->rwbs, rq);
133 blk_dump_cmd(__get_str(cmd), rq);
134 ),
135
136 TP_printk("%d,%d %s (%s) %llu + %u [%d]",
137 MAJOR(__entry->dev), MINOR(__entry->dev),
138 __entry->rwbs, __get_str(cmd),
139 (unsigned long long)__entry->sector,
140 __entry->nr_sector, __entry->errors)
141); 103);
142 104
143TRACE_EVENT(block_rq_complete, 105DEFINE_EVENT(block_rq, block_rq_issue,
144 106
145 TP_PROTO(struct request_queue *q, struct request *rq), 107 TP_PROTO(struct request_queue *q, struct request *rq),
146 108
147 TP_ARGS(q, rq), 109 TP_ARGS(q, rq)
148
149 TP_STRUCT__entry(
150 __field( dev_t, dev )
151 __field( sector_t, sector )
152 __field( unsigned int, nr_sector )
153 __field( int, errors )
154 __array( char, rwbs, 6 )
155 __dynamic_array( char, cmd, blk_cmd_buf_len(rq) )
156 ),
157
158 TP_fast_assign(
159 __entry->dev = rq->rq_disk ? disk_devt(rq->rq_disk) : 0;
160 __entry->sector = blk_pc_request(rq) ? 0 : blk_rq_pos(rq);
161 __entry->nr_sector = blk_pc_request(rq) ? 0 : blk_rq_sectors(rq);
162 __entry->errors = rq->errors;
163
164 blk_fill_rwbs_rq(__entry->rwbs, rq);
165 blk_dump_cmd(__get_str(cmd), rq);
166 ),
167
168 TP_printk("%d,%d %s (%s) %llu + %u [%d]",
169 MAJOR(__entry->dev), MINOR(__entry->dev),
170 __entry->rwbs, __get_str(cmd),
171 (unsigned long long)__entry->sector,
172 __entry->nr_sector, __entry->errors)
173); 110);
174 111
175TRACE_EVENT(block_bio_bounce, 112TRACE_EVENT(block_bio_bounce,
@@ -228,7 +165,7 @@ TRACE_EVENT(block_bio_complete,
228 __entry->nr_sector, __entry->error) 165 __entry->nr_sector, __entry->error)
229); 166);
230 167
231TRACE_EVENT(block_bio_backmerge, 168DECLARE_EVENT_CLASS(block_bio,
232 169
233 TP_PROTO(struct request_queue *q, struct bio *bio), 170 TP_PROTO(struct request_queue *q, struct bio *bio),
234 171
@@ -256,63 +193,28 @@ TRACE_EVENT(block_bio_backmerge,
256 __entry->nr_sector, __entry->comm) 193 __entry->nr_sector, __entry->comm)
257); 194);
258 195
259TRACE_EVENT(block_bio_frontmerge, 196DEFINE_EVENT(block_bio, block_bio_backmerge,
260 197
261 TP_PROTO(struct request_queue *q, struct bio *bio), 198 TP_PROTO(struct request_queue *q, struct bio *bio),
262 199
263 TP_ARGS(q, bio), 200 TP_ARGS(q, bio)
264
265 TP_STRUCT__entry(
266 __field( dev_t, dev )
267 __field( sector_t, sector )
268 __field( unsigned, nr_sector )
269 __array( char, rwbs, 6 )
270 __array( char, comm, TASK_COMM_LEN )
271 ),
272
273 TP_fast_assign(
274 __entry->dev = bio->bi_bdev->bd_dev;
275 __entry->sector = bio->bi_sector;
276 __entry->nr_sector = bio->bi_size >> 9;
277 blk_fill_rwbs(__entry->rwbs, bio->bi_rw, bio->bi_size);
278 memcpy(__entry->comm, current->comm, TASK_COMM_LEN);
279 ),
280
281 TP_printk("%d,%d %s %llu + %u [%s]",
282 MAJOR(__entry->dev), MINOR(__entry->dev), __entry->rwbs,
283 (unsigned long long)__entry->sector,
284 __entry->nr_sector, __entry->comm)
285); 201);
286 202
287TRACE_EVENT(block_bio_queue, 203DEFINE_EVENT(block_bio, block_bio_frontmerge,
288 204
289 TP_PROTO(struct request_queue *q, struct bio *bio), 205 TP_PROTO(struct request_queue *q, struct bio *bio),
290 206
291 TP_ARGS(q, bio), 207 TP_ARGS(q, bio)
208);
292 209
293 TP_STRUCT__entry( 210DEFINE_EVENT(block_bio, block_bio_queue,
294 __field( dev_t, dev )
295 __field( sector_t, sector )
296 __field( unsigned int, nr_sector )
297 __array( char, rwbs, 6 )
298 __array( char, comm, TASK_COMM_LEN )
299 ),
300 211
301 TP_fast_assign( 212 TP_PROTO(struct request_queue *q, struct bio *bio),
302 __entry->dev = bio->bi_bdev->bd_dev;
303 __entry->sector = bio->bi_sector;
304 __entry->nr_sector = bio->bi_size >> 9;
305 blk_fill_rwbs(__entry->rwbs, bio->bi_rw, bio->bi_size);
306 memcpy(__entry->comm, current->comm, TASK_COMM_LEN);
307 ),
308 213
309 TP_printk("%d,%d %s %llu + %u [%s]", 214 TP_ARGS(q, bio)
310 MAJOR(__entry->dev), MINOR(__entry->dev), __entry->rwbs,
311 (unsigned long long)__entry->sector,
312 __entry->nr_sector, __entry->comm)
313); 215);
314 216
315TRACE_EVENT(block_getrq, 217DECLARE_EVENT_CLASS(block_get_rq,
316 218
317 TP_PROTO(struct request_queue *q, struct bio *bio, int rw), 219 TP_PROTO(struct request_queue *q, struct bio *bio, int rw),
318 220
@@ -341,33 +243,18 @@ TRACE_EVENT(block_getrq,
341 __entry->nr_sector, __entry->comm) 243 __entry->nr_sector, __entry->comm)
342); 244);
343 245
344TRACE_EVENT(block_sleeprq, 246DEFINE_EVENT(block_get_rq, block_getrq,
345 247
346 TP_PROTO(struct request_queue *q, struct bio *bio, int rw), 248 TP_PROTO(struct request_queue *q, struct bio *bio, int rw),
347 249
348 TP_ARGS(q, bio, rw), 250 TP_ARGS(q, bio, rw)
251);
349 252
350 TP_STRUCT__entry( 253DEFINE_EVENT(block_get_rq, block_sleeprq,
351 __field( dev_t, dev )
352 __field( sector_t, sector )
353 __field( unsigned int, nr_sector )
354 __array( char, rwbs, 6 )
355 __array( char, comm, TASK_COMM_LEN )
356 ),
357 254
358 TP_fast_assign( 255 TP_PROTO(struct request_queue *q, struct bio *bio, int rw),
359 __entry->dev = bio ? bio->bi_bdev->bd_dev : 0;
360 __entry->sector = bio ? bio->bi_sector : 0;
361 __entry->nr_sector = bio ? bio->bi_size >> 9 : 0;
362 blk_fill_rwbs(__entry->rwbs,
363 bio ? bio->bi_rw : 0, __entry->nr_sector);
364 memcpy(__entry->comm, current->comm, TASK_COMM_LEN);
365 ),
366 256
367 TP_printk("%d,%d %s %llu + %u [%s]", 257 TP_ARGS(q, bio, rw)
368 MAJOR(__entry->dev), MINOR(__entry->dev), __entry->rwbs,
369 (unsigned long long)__entry->sector,
370 __entry->nr_sector, __entry->comm)
371); 258);
372 259
373TRACE_EVENT(block_plug, 260TRACE_EVENT(block_plug,
@@ -387,7 +274,7 @@ TRACE_EVENT(block_plug,
387 TP_printk("[%s]", __entry->comm) 274 TP_printk("[%s]", __entry->comm)
388); 275);
389 276
390TRACE_EVENT(block_unplug_timer, 277DECLARE_EVENT_CLASS(block_unplug,
391 278
392 TP_PROTO(struct request_queue *q), 279 TP_PROTO(struct request_queue *q),
393 280
@@ -406,23 +293,18 @@ TRACE_EVENT(block_unplug_timer,
406 TP_printk("[%s] %d", __entry->comm, __entry->nr_rq) 293 TP_printk("[%s] %d", __entry->comm, __entry->nr_rq)
407); 294);
408 295
409TRACE_EVENT(block_unplug_io, 296DEFINE_EVENT(block_unplug, block_unplug_timer,
410 297
411 TP_PROTO(struct request_queue *q), 298 TP_PROTO(struct request_queue *q),
412 299
413 TP_ARGS(q), 300 TP_ARGS(q)
301);
414 302
415 TP_STRUCT__entry( 303DEFINE_EVENT(block_unplug, block_unplug_io,
416 __field( int, nr_rq )
417 __array( char, comm, TASK_COMM_LEN )
418 ),
419 304
420 TP_fast_assign( 305 TP_PROTO(struct request_queue *q),
421 __entry->nr_rq = q->rq.count[READ] + q->rq.count[WRITE];
422 memcpy(__entry->comm, current->comm, TASK_COMM_LEN);
423 ),
424 306
425 TP_printk("[%s] %d", __entry->comm, __entry->nr_rq) 307 TP_ARGS(q)
426); 308);
427 309
428TRACE_EVENT(block_split, 310TRACE_EVENT(block_split,
diff --git a/include/trace/events/ext4.h b/include/trace/events/ext4.h
index d09550bf3f95..318f76535bd4 100644
--- a/include/trace/events/ext4.h
+++ b/include/trace/events/ext4.h
@@ -90,7 +90,7 @@ TRACE_EVENT(ext4_allocate_inode,
90 (unsigned long) __entry->dir, __entry->mode) 90 (unsigned long) __entry->dir, __entry->mode)
91); 91);
92 92
93TRACE_EVENT(ext4_write_begin, 93DECLARE_EVENT_CLASS(ext4__write_begin,
94 94
95 TP_PROTO(struct inode *inode, loff_t pos, unsigned int len, 95 TP_PROTO(struct inode *inode, loff_t pos, unsigned int len,
96 unsigned int flags), 96 unsigned int flags),
@@ -118,7 +118,23 @@ TRACE_EVENT(ext4_write_begin,
118 __entry->pos, __entry->len, __entry->flags) 118 __entry->pos, __entry->len, __entry->flags)
119); 119);
120 120
121TRACE_EVENT(ext4_ordered_write_end, 121DEFINE_EVENT(ext4__write_begin, ext4_write_begin,
122
123 TP_PROTO(struct inode *inode, loff_t pos, unsigned int len,
124 unsigned int flags),
125
126 TP_ARGS(inode, pos, len, flags)
127);
128
129DEFINE_EVENT(ext4__write_begin, ext4_da_write_begin,
130
131 TP_PROTO(struct inode *inode, loff_t pos, unsigned int len,
132 unsigned int flags),
133
134 TP_ARGS(inode, pos, len, flags)
135);
136
137DECLARE_EVENT_CLASS(ext4__write_end,
122 TP_PROTO(struct inode *inode, loff_t pos, unsigned int len, 138 TP_PROTO(struct inode *inode, loff_t pos, unsigned int len,
123 unsigned int copied), 139 unsigned int copied),
124 140
@@ -145,57 +161,36 @@ TRACE_EVENT(ext4_ordered_write_end,
145 __entry->pos, __entry->len, __entry->copied) 161 __entry->pos, __entry->len, __entry->copied)
146); 162);
147 163
148TRACE_EVENT(ext4_writeback_write_end, 164DEFINE_EVENT(ext4__write_end, ext4_ordered_write_end,
165
149 TP_PROTO(struct inode *inode, loff_t pos, unsigned int len, 166 TP_PROTO(struct inode *inode, loff_t pos, unsigned int len,
150 unsigned int copied), 167 unsigned int copied),
151 168
152 TP_ARGS(inode, pos, len, copied), 169 TP_ARGS(inode, pos, len, copied)
170);
153 171
154 TP_STRUCT__entry( 172DEFINE_EVENT(ext4__write_end, ext4_writeback_write_end,
155 __field( dev_t, dev )
156 __field( ino_t, ino )
157 __field( loff_t, pos )
158 __field( unsigned int, len )
159 __field( unsigned int, copied )
160 ),
161 173
162 TP_fast_assign( 174 TP_PROTO(struct inode *inode, loff_t pos, unsigned int len,
163 __entry->dev = inode->i_sb->s_dev; 175 unsigned int copied),
164 __entry->ino = inode->i_ino;
165 __entry->pos = pos;
166 __entry->len = len;
167 __entry->copied = copied;
168 ),
169 176
170 TP_printk("dev %s ino %lu pos %llu len %u copied %u", 177 TP_ARGS(inode, pos, len, copied)
171 jbd2_dev_to_name(__entry->dev), (unsigned long) __entry->ino,
172 __entry->pos, __entry->len, __entry->copied)
173); 178);
174 179
175TRACE_EVENT(ext4_journalled_write_end, 180DEFINE_EVENT(ext4__write_end, ext4_journalled_write_end,
181
176 TP_PROTO(struct inode *inode, loff_t pos, unsigned int len, 182 TP_PROTO(struct inode *inode, loff_t pos, unsigned int len,
177 unsigned int copied), 183 unsigned int copied),
178 TP_ARGS(inode, pos, len, copied),
179 184
180 TP_STRUCT__entry( 185 TP_ARGS(inode, pos, len, copied)
181 __field( dev_t, dev ) 186);
182 __field( ino_t, ino )
183 __field( loff_t, pos )
184 __field( unsigned int, len )
185 __field( unsigned int, copied )
186 ),
187 187
188 TP_fast_assign( 188DEFINE_EVENT(ext4__write_end, ext4_da_write_end,
189 __entry->dev = inode->i_sb->s_dev;
190 __entry->ino = inode->i_ino;
191 __entry->pos = pos;
192 __entry->len = len;
193 __entry->copied = copied;
194 ),
195 189
196 TP_printk("dev %s ino %lu pos %llu len %u copied %u", 190 TP_PROTO(struct inode *inode, loff_t pos, unsigned int len,
197 jbd2_dev_to_name(__entry->dev), (unsigned long) __entry->ino, 191 unsigned int copied),
198 __entry->pos, __entry->len, __entry->copied) 192
193 TP_ARGS(inode, pos, len, copied)
199); 194);
200 195
201TRACE_EVENT(ext4_writepage, 196TRACE_EVENT(ext4_writepage,
@@ -337,60 +332,6 @@ TRACE_EVENT(ext4_da_writepages_result,
337 (unsigned long) __entry->writeback_index) 332 (unsigned long) __entry->writeback_index)
338); 333);
339 334
340TRACE_EVENT(ext4_da_write_begin,
341 TP_PROTO(struct inode *inode, loff_t pos, unsigned int len,
342 unsigned int flags),
343
344 TP_ARGS(inode, pos, len, flags),
345
346 TP_STRUCT__entry(
347 __field( dev_t, dev )
348 __field( ino_t, ino )
349 __field( loff_t, pos )
350 __field( unsigned int, len )
351 __field( unsigned int, flags )
352 ),
353
354 TP_fast_assign(
355 __entry->dev = inode->i_sb->s_dev;
356 __entry->ino = inode->i_ino;
357 __entry->pos = pos;
358 __entry->len = len;
359 __entry->flags = flags;
360 ),
361
362 TP_printk("dev %s ino %lu pos %llu len %u flags %u",
363 jbd2_dev_to_name(__entry->dev), (unsigned long) __entry->ino,
364 __entry->pos, __entry->len, __entry->flags)
365);
366
367TRACE_EVENT(ext4_da_write_end,
368 TP_PROTO(struct inode *inode, loff_t pos, unsigned int len,
369 unsigned int copied),
370
371 TP_ARGS(inode, pos, len, copied),
372
373 TP_STRUCT__entry(
374 __field( dev_t, dev )
375 __field( ino_t, ino )
376 __field( loff_t, pos )
377 __field( unsigned int, len )
378 __field( unsigned int, copied )
379 ),
380
381 TP_fast_assign(
382 __entry->dev = inode->i_sb->s_dev;
383 __entry->ino = inode->i_ino;
384 __entry->pos = pos;
385 __entry->len = len;
386 __entry->copied = copied;
387 ),
388
389 TP_printk("dev %s ino %lu pos %llu len %u copied %u",
390 jbd2_dev_to_name(__entry->dev), (unsigned long) __entry->ino,
391 __entry->pos, __entry->len, __entry->copied)
392);
393
394TRACE_EVENT(ext4_discard_blocks, 335TRACE_EVENT(ext4_discard_blocks,
395 TP_PROTO(struct super_block *sb, unsigned long long blk, 336 TP_PROTO(struct super_block *sb, unsigned long long blk,
396 unsigned long long count), 337 unsigned long long count),
diff --git a/include/trace/events/irq.h b/include/trace/events/irq.h
index b89f9db4a404..0e4cfb694fe7 100644
--- a/include/trace/events/irq.h
+++ b/include/trace/events/irq.h
@@ -48,7 +48,7 @@ TRACE_EVENT(irq_handler_entry,
48 __assign_str(name, action->name); 48 __assign_str(name, action->name);
49 ), 49 ),
50 50
51 TP_printk("irq=%d handler=%s", __entry->irq, __get_str(name)) 51 TP_printk("irq=%d name=%s", __entry->irq, __get_str(name))
52); 52);
53 53
54/** 54/**
@@ -78,22 +78,11 @@ TRACE_EVENT(irq_handler_exit,
78 __entry->ret = ret; 78 __entry->ret = ret;
79 ), 79 ),
80 80
81 TP_printk("irq=%d return=%s", 81 TP_printk("irq=%d ret=%s",
82 __entry->irq, __entry->ret ? "handled" : "unhandled") 82 __entry->irq, __entry->ret ? "handled" : "unhandled")
83); 83);
84 84
85/** 85DECLARE_EVENT_CLASS(softirq,
86 * softirq_entry - called immediately before the softirq handler
87 * @h: pointer to struct softirq_action
88 * @vec: pointer to first struct softirq_action in softirq_vec array
89 *
90 * The @h parameter, contains a pointer to the struct softirq_action
91 * which has a pointer to the action handler that is called. By subtracting
92 * the @vec pointer from the @h pointer, we can determine the softirq
93 * number. Also, when used in combination with the softirq_exit tracepoint
94 * we can determine the softirq latency.
95 */
96TRACE_EVENT(softirq_entry,
97 86
98 TP_PROTO(struct softirq_action *h, struct softirq_action *vec), 87 TP_PROTO(struct softirq_action *h, struct softirq_action *vec),
99 88
@@ -107,11 +96,29 @@ TRACE_EVENT(softirq_entry,
107 __entry->vec = (int)(h - vec); 96 __entry->vec = (int)(h - vec);
108 ), 97 ),
109 98
110 TP_printk("softirq=%d action=%s", __entry->vec, 99 TP_printk("vec=%d [action=%s]", __entry->vec,
111 show_softirq_name(__entry->vec)) 100 show_softirq_name(__entry->vec))
112); 101);
113 102
114/** 103/**
104 * softirq_entry - called immediately before the softirq handler
105 * @h: pointer to struct softirq_action
106 * @vec: pointer to first struct softirq_action in softirq_vec array
107 *
108 * The @h parameter, contains a pointer to the struct softirq_action
109 * which has a pointer to the action handler that is called. By subtracting
110 * the @vec pointer from the @h pointer, we can determine the softirq
111 * number. Also, when used in combination with the softirq_exit tracepoint
112 * we can determine the softirq latency.
113 */
114DEFINE_EVENT(softirq, softirq_entry,
115
116 TP_PROTO(struct softirq_action *h, struct softirq_action *vec),
117
118 TP_ARGS(h, vec)
119);
120
121/**
115 * softirq_exit - called immediately after the softirq handler returns 122 * softirq_exit - called immediately after the softirq handler returns
116 * @h: pointer to struct softirq_action 123 * @h: pointer to struct softirq_action
117 * @vec: pointer to first struct softirq_action in softirq_vec array 124 * @vec: pointer to first struct softirq_action in softirq_vec array
@@ -122,22 +129,11 @@ TRACE_EVENT(softirq_entry,
122 * combination with the softirq_entry tracepoint we can determine the softirq 129 * combination with the softirq_entry tracepoint we can determine the softirq
123 * latency. 130 * latency.
124 */ 131 */
125TRACE_EVENT(softirq_exit, 132DEFINE_EVENT(softirq, softirq_exit,
126 133
127 TP_PROTO(struct softirq_action *h, struct softirq_action *vec), 134 TP_PROTO(struct softirq_action *h, struct softirq_action *vec),
128 135
129 TP_ARGS(h, vec), 136 TP_ARGS(h, vec)
130
131 TP_STRUCT__entry(
132 __field( int, vec )
133 ),
134
135 TP_fast_assign(
136 __entry->vec = (int)(h - vec);
137 ),
138
139 TP_printk("softirq=%d action=%s", __entry->vec,
140 show_softirq_name(__entry->vec))
141); 137);
142 138
143#endif /* _TRACE_IRQ_H */ 139#endif /* _TRACE_IRQ_H */
diff --git a/include/trace/events/jbd2.h b/include/trace/events/jbd2.h
index 3c60b75adb9e..96b370a050de 100644
--- a/include/trace/events/jbd2.h
+++ b/include/trace/events/jbd2.h
@@ -30,7 +30,7 @@ TRACE_EVENT(jbd2_checkpoint,
30 jbd2_dev_to_name(__entry->dev), __entry->result) 30 jbd2_dev_to_name(__entry->dev), __entry->result)
31); 31);
32 32
33TRACE_EVENT(jbd2_start_commit, 33DECLARE_EVENT_CLASS(jbd2_commit,
34 34
35 TP_PROTO(journal_t *journal, transaction_t *commit_transaction), 35 TP_PROTO(journal_t *journal, transaction_t *commit_transaction),
36 36
@@ -53,73 +53,32 @@ TRACE_EVENT(jbd2_start_commit,
53 __entry->sync_commit) 53 __entry->sync_commit)
54); 54);
55 55
56TRACE_EVENT(jbd2_commit_locking, 56DEFINE_EVENT(jbd2_commit, jbd2_start_commit,
57 57
58 TP_PROTO(journal_t *journal, transaction_t *commit_transaction), 58 TP_PROTO(journal_t *journal, transaction_t *commit_transaction),
59 59
60 TP_ARGS(journal, commit_transaction), 60 TP_ARGS(journal, commit_transaction)
61
62 TP_STRUCT__entry(
63 __field( dev_t, dev )
64 __field( char, sync_commit )
65 __field( int, transaction )
66 ),
67
68 TP_fast_assign(
69 __entry->dev = journal->j_fs_dev->bd_dev;
70 __entry->sync_commit = commit_transaction->t_synchronous_commit;
71 __entry->transaction = commit_transaction->t_tid;
72 ),
73
74 TP_printk("dev %s transaction %d sync %d",
75 jbd2_dev_to_name(__entry->dev), __entry->transaction,
76 __entry->sync_commit)
77); 61);
78 62
79TRACE_EVENT(jbd2_commit_flushing, 63DEFINE_EVENT(jbd2_commit, jbd2_commit_locking,
80 64
81 TP_PROTO(journal_t *journal, transaction_t *commit_transaction), 65 TP_PROTO(journal_t *journal, transaction_t *commit_transaction),
82 66
83 TP_ARGS(journal, commit_transaction), 67 TP_ARGS(journal, commit_transaction)
84
85 TP_STRUCT__entry(
86 __field( dev_t, dev )
87 __field( char, sync_commit )
88 __field( int, transaction )
89 ),
90
91 TP_fast_assign(
92 __entry->dev = journal->j_fs_dev->bd_dev;
93 __entry->sync_commit = commit_transaction->t_synchronous_commit;
94 __entry->transaction = commit_transaction->t_tid;
95 ),
96
97 TP_printk("dev %s transaction %d sync %d",
98 jbd2_dev_to_name(__entry->dev), __entry->transaction,
99 __entry->sync_commit)
100); 68);
101 69
102TRACE_EVENT(jbd2_commit_logging, 70DEFINE_EVENT(jbd2_commit, jbd2_commit_flushing,
103 71
104 TP_PROTO(journal_t *journal, transaction_t *commit_transaction), 72 TP_PROTO(journal_t *journal, transaction_t *commit_transaction),
105 73
106 TP_ARGS(journal, commit_transaction), 74 TP_ARGS(journal, commit_transaction)
75);
107 76
108 TP_STRUCT__entry( 77DEFINE_EVENT(jbd2_commit, jbd2_commit_logging,
109 __field( dev_t, dev )
110 __field( char, sync_commit )
111 __field( int, transaction )
112 ),
113 78
114 TP_fast_assign( 79 TP_PROTO(journal_t *journal, transaction_t *commit_transaction),
115 __entry->dev = journal->j_fs_dev->bd_dev;
116 __entry->sync_commit = commit_transaction->t_synchronous_commit;
117 __entry->transaction = commit_transaction->t_tid;
118 ),
119 80
120 TP_printk("dev %s transaction %d sync %d", 81 TP_ARGS(journal, commit_transaction)
121 jbd2_dev_to_name(__entry->dev), __entry->transaction,
122 __entry->sync_commit)
123); 82);
124 83
125TRACE_EVENT(jbd2_end_commit, 84TRACE_EVENT(jbd2_end_commit,
diff --git a/include/trace/events/kmem.h b/include/trace/events/kmem.h
index eaf46bdd18a5..3adca0ca9dbe 100644
--- a/include/trace/events/kmem.h
+++ b/include/trace/events/kmem.h
@@ -44,7 +44,7 @@
44 {(unsigned long)__GFP_MOVABLE, "GFP_MOVABLE"} \ 44 {(unsigned long)__GFP_MOVABLE, "GFP_MOVABLE"} \
45 ) : "GFP_NOWAIT" 45 ) : "GFP_NOWAIT"
46 46
47TRACE_EVENT(kmalloc, 47DECLARE_EVENT_CLASS(kmem_alloc,
48 48
49 TP_PROTO(unsigned long call_site, 49 TP_PROTO(unsigned long call_site,
50 const void *ptr, 50 const void *ptr,
@@ -78,41 +78,23 @@ TRACE_EVENT(kmalloc,
78 show_gfp_flags(__entry->gfp_flags)) 78 show_gfp_flags(__entry->gfp_flags))
79); 79);
80 80
81TRACE_EVENT(kmem_cache_alloc, 81DEFINE_EVENT(kmem_alloc, kmalloc,
82 82
83 TP_PROTO(unsigned long call_site, 83 TP_PROTO(unsigned long call_site, const void *ptr,
84 const void *ptr, 84 size_t bytes_req, size_t bytes_alloc, gfp_t gfp_flags),
85 size_t bytes_req,
86 size_t bytes_alloc,
87 gfp_t gfp_flags),
88 85
89 TP_ARGS(call_site, ptr, bytes_req, bytes_alloc, gfp_flags), 86 TP_ARGS(call_site, ptr, bytes_req, bytes_alloc, gfp_flags)
87);
90 88
91 TP_STRUCT__entry( 89DEFINE_EVENT(kmem_alloc, kmem_cache_alloc,
92 __field( unsigned long, call_site )
93 __field( const void *, ptr )
94 __field( size_t, bytes_req )
95 __field( size_t, bytes_alloc )
96 __field( gfp_t, gfp_flags )
97 ),
98 90
99 TP_fast_assign( 91 TP_PROTO(unsigned long call_site, const void *ptr,
100 __entry->call_site = call_site; 92 size_t bytes_req, size_t bytes_alloc, gfp_t gfp_flags),
101 __entry->ptr = ptr;
102 __entry->bytes_req = bytes_req;
103 __entry->bytes_alloc = bytes_alloc;
104 __entry->gfp_flags = gfp_flags;
105 ),
106 93
107 TP_printk("call_site=%lx ptr=%p bytes_req=%zu bytes_alloc=%zu gfp_flags=%s", 94 TP_ARGS(call_site, ptr, bytes_req, bytes_alloc, gfp_flags)
108 __entry->call_site,
109 __entry->ptr,
110 __entry->bytes_req,
111 __entry->bytes_alloc,
112 show_gfp_flags(__entry->gfp_flags))
113); 95);
114 96
115TRACE_EVENT(kmalloc_node, 97DECLARE_EVENT_CLASS(kmem_alloc_node,
116 98
117 TP_PROTO(unsigned long call_site, 99 TP_PROTO(unsigned long call_site,
118 const void *ptr, 100 const void *ptr,
@@ -150,45 +132,25 @@ TRACE_EVENT(kmalloc_node,
150 __entry->node) 132 __entry->node)
151); 133);
152 134
153TRACE_EVENT(kmem_cache_alloc_node, 135DEFINE_EVENT(kmem_alloc_node, kmalloc_node,
154 136
155 TP_PROTO(unsigned long call_site, 137 TP_PROTO(unsigned long call_site, const void *ptr,
156 const void *ptr, 138 size_t bytes_req, size_t bytes_alloc,
157 size_t bytes_req, 139 gfp_t gfp_flags, int node),
158 size_t bytes_alloc,
159 gfp_t gfp_flags,
160 int node),
161 140
162 TP_ARGS(call_site, ptr, bytes_req, bytes_alloc, gfp_flags, node), 141 TP_ARGS(call_site, ptr, bytes_req, bytes_alloc, gfp_flags, node)
142);
163 143
164 TP_STRUCT__entry( 144DEFINE_EVENT(kmem_alloc_node, kmem_cache_alloc_node,
165 __field( unsigned long, call_site )
166 __field( const void *, ptr )
167 __field( size_t, bytes_req )
168 __field( size_t, bytes_alloc )
169 __field( gfp_t, gfp_flags )
170 __field( int, node )
171 ),
172 145
173 TP_fast_assign( 146 TP_PROTO(unsigned long call_site, const void *ptr,
174 __entry->call_site = call_site; 147 size_t bytes_req, size_t bytes_alloc,
175 __entry->ptr = ptr; 148 gfp_t gfp_flags, int node),
176 __entry->bytes_req = bytes_req;
177 __entry->bytes_alloc = bytes_alloc;
178 __entry->gfp_flags = gfp_flags;
179 __entry->node = node;
180 ),
181 149
182 TP_printk("call_site=%lx ptr=%p bytes_req=%zu bytes_alloc=%zu gfp_flags=%s node=%d", 150 TP_ARGS(call_site, ptr, bytes_req, bytes_alloc, gfp_flags, node)
183 __entry->call_site,
184 __entry->ptr,
185 __entry->bytes_req,
186 __entry->bytes_alloc,
187 show_gfp_flags(__entry->gfp_flags),
188 __entry->node)
189); 151);
190 152
191TRACE_EVENT(kfree, 153DECLARE_EVENT_CLASS(kmem_free,
192 154
193 TP_PROTO(unsigned long call_site, const void *ptr), 155 TP_PROTO(unsigned long call_site, const void *ptr),
194 156
@@ -207,23 +169,18 @@ TRACE_EVENT(kfree,
207 TP_printk("call_site=%lx ptr=%p", __entry->call_site, __entry->ptr) 169 TP_printk("call_site=%lx ptr=%p", __entry->call_site, __entry->ptr)
208); 170);
209 171
210TRACE_EVENT(kmem_cache_free, 172DEFINE_EVENT(kmem_free, kfree,
211 173
212 TP_PROTO(unsigned long call_site, const void *ptr), 174 TP_PROTO(unsigned long call_site, const void *ptr),
213 175
214 TP_ARGS(call_site, ptr), 176 TP_ARGS(call_site, ptr)
177);
215 178
216 TP_STRUCT__entry( 179DEFINE_EVENT(kmem_free, kmem_cache_free,
217 __field( unsigned long, call_site )
218 __field( const void *, ptr )
219 ),
220 180
221 TP_fast_assign( 181 TP_PROTO(unsigned long call_site, const void *ptr),
222 __entry->call_site = call_site;
223 __entry->ptr = ptr;
224 ),
225 182
226 TP_printk("call_site=%lx ptr=%p", __entry->call_site, __entry->ptr) 183 TP_ARGS(call_site, ptr)
227); 184);
228 185
229TRACE_EVENT(mm_page_free_direct, 186TRACE_EVENT(mm_page_free_direct,
@@ -299,7 +256,7 @@ TRACE_EVENT(mm_page_alloc,
299 show_gfp_flags(__entry->gfp_flags)) 256 show_gfp_flags(__entry->gfp_flags))
300); 257);
301 258
302TRACE_EVENT(mm_page_alloc_zone_locked, 259DECLARE_EVENT_CLASS(mm_page,
303 260
304 TP_PROTO(struct page *page, unsigned int order, int migratetype), 261 TP_PROTO(struct page *page, unsigned int order, int migratetype),
305 262
@@ -325,29 +282,22 @@ TRACE_EVENT(mm_page_alloc_zone_locked,
325 __entry->order == 0) 282 __entry->order == 0)
326); 283);
327 284
328TRACE_EVENT(mm_page_pcpu_drain, 285DEFINE_EVENT(mm_page, mm_page_alloc_zone_locked,
329 286
330 TP_PROTO(struct page *page, int order, int migratetype), 287 TP_PROTO(struct page *page, unsigned int order, int migratetype),
331 288
332 TP_ARGS(page, order, migratetype), 289 TP_ARGS(page, order, migratetype)
290);
333 291
334 TP_STRUCT__entry( 292DEFINE_EVENT_PRINT(mm_page, mm_page_pcpu_drain,
335 __field( struct page *, page )
336 __field( int, order )
337 __field( int, migratetype )
338 ),
339 293
340 TP_fast_assign( 294 TP_PROTO(struct page *page, unsigned int order, int migratetype),
341 __entry->page = page; 295
342 __entry->order = order; 296 TP_ARGS(page, order, migratetype),
343 __entry->migratetype = migratetype;
344 ),
345 297
346 TP_printk("page=%p pfn=%lu order=%d migratetype=%d", 298 TP_printk("page=%p pfn=%lu order=%d migratetype=%d",
347 __entry->page, 299 __entry->page, page_to_pfn(__entry->page),
348 page_to_pfn(__entry->page), 300 __entry->order, __entry->migratetype)
349 __entry->order,
350 __entry->migratetype)
351); 301);
352 302
353TRACE_EVENT(mm_page_alloc_extfrag, 303TRACE_EVENT(mm_page_alloc_extfrag,
diff --git a/include/trace/events/lockdep.h b/include/trace/events/lock.h
index bcf1d209a00d..a870ba125aa8 100644
--- a/include/trace/events/lockdep.h
+++ b/include/trace/events/lock.h
@@ -1,8 +1,8 @@
1#undef TRACE_SYSTEM 1#undef TRACE_SYSTEM
2#define TRACE_SYSTEM lockdep 2#define TRACE_SYSTEM lock
3 3
4#if !defined(_TRACE_LOCKDEP_H) || defined(TRACE_HEADER_MULTI_READ) 4#if !defined(_TRACE_LOCK_H) || defined(TRACE_HEADER_MULTI_READ)
5#define _TRACE_LOCKDEP_H 5#define _TRACE_LOCK_H
6 6
7#include <linux/lockdep.h> 7#include <linux/lockdep.h>
8#include <linux/tracepoint.h> 8#include <linux/tracepoint.h>
@@ -90,7 +90,7 @@ TRACE_EVENT(lock_acquired,
90#endif 90#endif
91#endif 91#endif
92 92
93#endif /* _TRACE_LOCKDEP_H */ 93#endif /* _TRACE_LOCK_H */
94 94
95/* This part must be outside protection */ 95/* This part must be outside protection */
96#include <trace/define_trace.h> 96#include <trace/define_trace.h>
diff --git a/include/trace/events/mce.h b/include/trace/events/mce.h
new file mode 100644
index 000000000000..7eee77895cb3
--- /dev/null
+++ b/include/trace/events/mce.h
@@ -0,0 +1,69 @@
1#undef TRACE_SYSTEM
2#define TRACE_SYSTEM mce
3
4#if !defined(_TRACE_MCE_H) || defined(TRACE_HEADER_MULTI_READ)
5#define _TRACE_MCE_H
6
7#include <linux/ktime.h>
8#include <linux/tracepoint.h>
9#include <asm/mce.h>
10
11TRACE_EVENT(mce_record,
12
13 TP_PROTO(struct mce *m),
14
15 TP_ARGS(m),
16
17 TP_STRUCT__entry(
18 __field( u64, mcgcap )
19 __field( u64, mcgstatus )
20 __field( u8, bank )
21 __field( u64, status )
22 __field( u64, addr )
23 __field( u64, misc )
24 __field( u64, ip )
25 __field( u8, cs )
26 __field( u64, tsc )
27 __field( u64, walltime )
28 __field( u32, cpu )
29 __field( u32, cpuid )
30 __field( u32, apicid )
31 __field( u32, socketid )
32 __field( u8, cpuvendor )
33 ),
34
35 TP_fast_assign(
36 __entry->mcgcap = m->mcgcap;
37 __entry->mcgstatus = m->mcgstatus;
38 __entry->bank = m->bank;
39 __entry->status = m->status;
40 __entry->addr = m->addr;
41 __entry->misc = m->misc;
42 __entry->ip = m->ip;
43 __entry->cs = m->cs;
44 __entry->tsc = m->tsc;
45 __entry->walltime = m->time;
46 __entry->cpu = m->extcpu;
47 __entry->cpuid = m->cpuid;
48 __entry->apicid = m->apicid;
49 __entry->socketid = m->socketid;
50 __entry->cpuvendor = m->cpuvendor;
51 ),
52
53 TP_printk("CPU: %d, MCGc/s: %llx/%llx, MC%d: %016Lx, ADDR/MISC: %016Lx/%016Lx, RIP: %02x:<%016Lx>, TSC: %llx, PROCESSOR: %u:%x, TIME: %llu, SOCKET: %u, APIC: %x",
54 __entry->cpu,
55 __entry->mcgcap, __entry->mcgstatus,
56 __entry->bank, __entry->status,
57 __entry->addr, __entry->misc,
58 __entry->cs, __entry->ip,
59 __entry->tsc,
60 __entry->cpuvendor, __entry->cpuid,
61 __entry->walltime,
62 __entry->socketid,
63 __entry->apicid)
64);
65
66#endif /* _TRACE_MCE_H */
67
68/* This part must be outside protection */
69#include <trace/define_trace.h>
diff --git a/include/trace/events/module.h b/include/trace/events/module.h
index 84160fb18478..4b0f48ba16a6 100644
--- a/include/trace/events/module.h
+++ b/include/trace/events/module.h
@@ -51,7 +51,7 @@ TRACE_EVENT(module_free,
51 TP_printk("%s", __get_str(name)) 51 TP_printk("%s", __get_str(name))
52); 52);
53 53
54TRACE_EVENT(module_get, 54DECLARE_EVENT_CLASS(module_refcnt,
55 55
56 TP_PROTO(struct module *mod, unsigned long ip, int refcnt), 56 TP_PROTO(struct module *mod, unsigned long ip, int refcnt),
57 57
@@ -73,26 +73,18 @@ TRACE_EVENT(module_get,
73 __get_str(name), (void *)__entry->ip, __entry->refcnt) 73 __get_str(name), (void *)__entry->ip, __entry->refcnt)
74); 74);
75 75
76TRACE_EVENT(module_put, 76DEFINE_EVENT(module_refcnt, module_get,
77 77
78 TP_PROTO(struct module *mod, unsigned long ip, int refcnt), 78 TP_PROTO(struct module *mod, unsigned long ip, int refcnt),
79 79
80 TP_ARGS(mod, ip, refcnt), 80 TP_ARGS(mod, ip, refcnt)
81);
81 82
82 TP_STRUCT__entry( 83DEFINE_EVENT(module_refcnt, module_put,
83 __field( unsigned long, ip )
84 __field( int, refcnt )
85 __string( name, mod->name )
86 ),
87 84
88 TP_fast_assign( 85 TP_PROTO(struct module *mod, unsigned long ip, int refcnt),
89 __entry->ip = ip;
90 __entry->refcnt = refcnt;
91 __assign_str(name, mod->name);
92 ),
93 86
94 TP_printk("%s call_site=%pf refcnt=%d", 87 TP_ARGS(mod, ip, refcnt)
95 __get_str(name), (void *)__entry->ip, __entry->refcnt)
96); 88);
97 89
98TRACE_EVENT(module_request, 90TRACE_EVENT(module_request,
diff --git a/include/trace/events/power.h b/include/trace/events/power.h
index ea6d579261ad..c4efe9b8280d 100644
--- a/include/trace/events/power.h
+++ b/include/trace/events/power.h
@@ -16,9 +16,7 @@ enum {
16}; 16};
17#endif 17#endif
18 18
19 19DECLARE_EVENT_CLASS(power,
20
21TRACE_EVENT(power_start,
22 20
23 TP_PROTO(unsigned int type, unsigned int state), 21 TP_PROTO(unsigned int type, unsigned int state),
24 22
@@ -37,42 +35,36 @@ TRACE_EVENT(power_start,
37 TP_printk("type=%lu state=%lu", (unsigned long)__entry->type, (unsigned long)__entry->state) 35 TP_printk("type=%lu state=%lu", (unsigned long)__entry->type, (unsigned long)__entry->state)
38); 36);
39 37
40TRACE_EVENT(power_end, 38DEFINE_EVENT(power, power_start,
41
42 TP_PROTO(int dummy),
43 39
44 TP_ARGS(dummy), 40 TP_PROTO(unsigned int type, unsigned int state),
45 41
46 TP_STRUCT__entry( 42 TP_ARGS(type, state)
47 __field( u64, dummy ) 43);
48 ),
49 44
50 TP_fast_assign( 45DEFINE_EVENT(power, power_frequency,
51 __entry->dummy = 0xffff;
52 ),
53 46
54 TP_printk("dummy=%lu", (unsigned long)__entry->dummy) 47 TP_PROTO(unsigned int type, unsigned int state),
55 48
49 TP_ARGS(type, state)
56); 50);
57 51
52TRACE_EVENT(power_end,
58 53
59TRACE_EVENT(power_frequency, 54 TP_PROTO(int dummy),
60
61 TP_PROTO(unsigned int type, unsigned int state),
62 55
63 TP_ARGS(type, state), 56 TP_ARGS(dummy),
64 57
65 TP_STRUCT__entry( 58 TP_STRUCT__entry(
66 __field( u64, type ) 59 __field( u64, dummy )
67 __field( u64, state )
68 ), 60 ),
69 61
70 TP_fast_assign( 62 TP_fast_assign(
71 __entry->type = type; 63 __entry->dummy = 0xffff;
72 __entry->state = state;
73 ), 64 ),
74 65
75 TP_printk("type=%lu state=%lu", (unsigned long)__entry->type, (unsigned long) __entry->state) 66 TP_printk("dummy=%lu", (unsigned long)__entry->dummy)
67
76); 68);
77 69
78#endif /* _TRACE_POWER_H */ 70#endif /* _TRACE_POWER_H */
diff --git a/include/trace/events/sched.h b/include/trace/events/sched.h
index 4069c43f4187..cfceb0b73e20 100644
--- a/include/trace/events/sched.h
+++ b/include/trace/events/sched.h
@@ -26,7 +26,7 @@ TRACE_EVENT(sched_kthread_stop,
26 __entry->pid = t->pid; 26 __entry->pid = t->pid;
27 ), 27 ),
28 28
29 TP_printk("task %s:%d", __entry->comm, __entry->pid) 29 TP_printk("comm=%s pid=%d", __entry->comm, __entry->pid)
30); 30);
31 31
32/* 32/*
@@ -46,7 +46,7 @@ TRACE_EVENT(sched_kthread_stop_ret,
46 __entry->ret = ret; 46 __entry->ret = ret;
47 ), 47 ),
48 48
49 TP_printk("ret %d", __entry->ret) 49 TP_printk("ret=%d", __entry->ret)
50); 50);
51 51
52/* 52/*
@@ -73,7 +73,7 @@ TRACE_EVENT(sched_wait_task,
73 __entry->prio = p->prio; 73 __entry->prio = p->prio;
74 ), 74 ),
75 75
76 TP_printk("task %s:%d [%d]", 76 TP_printk("comm=%s pid=%d prio=%d",
77 __entry->comm, __entry->pid, __entry->prio) 77 __entry->comm, __entry->pid, __entry->prio)
78); 78);
79 79
@@ -83,7 +83,7 @@ TRACE_EVENT(sched_wait_task,
83 * (NOTE: the 'rq' argument is not used by generic trace events, 83 * (NOTE: the 'rq' argument is not used by generic trace events,
84 * but used by the latency tracer plugin. ) 84 * but used by the latency tracer plugin. )
85 */ 85 */
86TRACE_EVENT(sched_wakeup, 86DECLARE_EVENT_CLASS(sched_wakeup_template,
87 87
88 TP_PROTO(struct rq *rq, struct task_struct *p, int success), 88 TP_PROTO(struct rq *rq, struct task_struct *p, int success),
89 89
@@ -94,7 +94,7 @@ TRACE_EVENT(sched_wakeup,
94 __field( pid_t, pid ) 94 __field( pid_t, pid )
95 __field( int, prio ) 95 __field( int, prio )
96 __field( int, success ) 96 __field( int, success )
97 __field( int, cpu ) 97 __field( int, target_cpu )
98 ), 98 ),
99 99
100 TP_fast_assign( 100 TP_fast_assign(
@@ -102,46 +102,27 @@ TRACE_EVENT(sched_wakeup,
102 __entry->pid = p->pid; 102 __entry->pid = p->pid;
103 __entry->prio = p->prio; 103 __entry->prio = p->prio;
104 __entry->success = success; 104 __entry->success = success;
105 __entry->cpu = task_cpu(p); 105 __entry->target_cpu = task_cpu(p);
106 ), 106 ),
107 107
108 TP_printk("task %s:%d [%d] success=%d [%03d]", 108 TP_printk("comm=%s pid=%d prio=%d success=%d target_cpu=%03d",
109 __entry->comm, __entry->pid, __entry->prio, 109 __entry->comm, __entry->pid, __entry->prio,
110 __entry->success, __entry->cpu) 110 __entry->success, __entry->target_cpu)
111); 111);
112 112
113DEFINE_EVENT(sched_wakeup_template, sched_wakeup,
114 TP_PROTO(struct rq *rq, struct task_struct *p, int success),
115 TP_ARGS(rq, p, success));
116
113/* 117/*
114 * Tracepoint for waking up a new task: 118 * Tracepoint for waking up a new task:
115 * 119 *
116 * (NOTE: the 'rq' argument is not used by generic trace events, 120 * (NOTE: the 'rq' argument is not used by generic trace events,
117 * but used by the latency tracer plugin. ) 121 * but used by the latency tracer plugin. )
118 */ 122 */
119TRACE_EVENT(sched_wakeup_new, 123DEFINE_EVENT(sched_wakeup_template, sched_wakeup_new,
120 124 TP_PROTO(struct rq *rq, struct task_struct *p, int success),
121 TP_PROTO(struct rq *rq, struct task_struct *p, int success), 125 TP_ARGS(rq, p, success));
122
123 TP_ARGS(rq, p, success),
124
125 TP_STRUCT__entry(
126 __array( char, comm, TASK_COMM_LEN )
127 __field( pid_t, pid )
128 __field( int, prio )
129 __field( int, success )
130 __field( int, cpu )
131 ),
132
133 TP_fast_assign(
134 memcpy(__entry->comm, p->comm, TASK_COMM_LEN);
135 __entry->pid = p->pid;
136 __entry->prio = p->prio;
137 __entry->success = success;
138 __entry->cpu = task_cpu(p);
139 ),
140
141 TP_printk("task %s:%d [%d] success=%d [%03d]",
142 __entry->comm, __entry->pid, __entry->prio,
143 __entry->success, __entry->cpu)
144);
145 126
146/* 127/*
147 * Tracepoint for task switches, performed by the scheduler: 128 * Tracepoint for task switches, performed by the scheduler:
@@ -176,7 +157,7 @@ TRACE_EVENT(sched_switch,
176 __entry->next_prio = next->prio; 157 __entry->next_prio = next->prio;
177 ), 158 ),
178 159
179 TP_printk("task %s:%d [%d] (%s) ==> %s:%d [%d]", 160 TP_printk("prev_comm=%s prev_pid=%d prev_prio=%d prev_state=%s ==> next_comm=%s next_pid=%d next_prio=%d",
180 __entry->prev_comm, __entry->prev_pid, __entry->prev_prio, 161 __entry->prev_comm, __entry->prev_pid, __entry->prev_prio,
181 __entry->prev_state ? 162 __entry->prev_state ?
182 __print_flags(__entry->prev_state, "|", 163 __print_flags(__entry->prev_state, "|",
@@ -211,15 +192,12 @@ TRACE_EVENT(sched_migrate_task,
211 __entry->dest_cpu = dest_cpu; 192 __entry->dest_cpu = dest_cpu;
212 ), 193 ),
213 194
214 TP_printk("task %s:%d [%d] from: %d to: %d", 195 TP_printk("comm=%s pid=%d prio=%d orig_cpu=%d dest_cpu=%d",
215 __entry->comm, __entry->pid, __entry->prio, 196 __entry->comm, __entry->pid, __entry->prio,
216 __entry->orig_cpu, __entry->dest_cpu) 197 __entry->orig_cpu, __entry->dest_cpu)
217); 198);
218 199
219/* 200DECLARE_EVENT_CLASS(sched_process_template,
220 * Tracepoint for freeing a task:
221 */
222TRACE_EVENT(sched_process_free,
223 201
224 TP_PROTO(struct task_struct *p), 202 TP_PROTO(struct task_struct *p),
225 203
@@ -237,34 +215,24 @@ TRACE_EVENT(sched_process_free,
237 __entry->prio = p->prio; 215 __entry->prio = p->prio;
238 ), 216 ),
239 217
240 TP_printk("task %s:%d [%d]", 218 TP_printk("comm=%s pid=%d prio=%d",
241 __entry->comm, __entry->pid, __entry->prio) 219 __entry->comm, __entry->pid, __entry->prio)
242); 220);
243 221
244/* 222/*
245 * Tracepoint for a task exiting: 223 * Tracepoint for freeing a task:
246 */ 224 */
247TRACE_EVENT(sched_process_exit, 225DEFINE_EVENT(sched_process_template, sched_process_free,
226 TP_PROTO(struct task_struct *p),
227 TP_ARGS(p));
228
248 229
249 TP_PROTO(struct task_struct *p), 230/*
250 231 * Tracepoint for a task exiting:
251 TP_ARGS(p), 232 */
252 233DEFINE_EVENT(sched_process_template, sched_process_exit,
253 TP_STRUCT__entry( 234 TP_PROTO(struct task_struct *p),
254 __array( char, comm, TASK_COMM_LEN ) 235 TP_ARGS(p));
255 __field( pid_t, pid )
256 __field( int, prio )
257 ),
258
259 TP_fast_assign(
260 memcpy(__entry->comm, p->comm, TASK_COMM_LEN);
261 __entry->pid = p->pid;
262 __entry->prio = p->prio;
263 ),
264
265 TP_printk("task %s:%d [%d]",
266 __entry->comm, __entry->pid, __entry->prio)
267);
268 236
269/* 237/*
270 * Tracepoint for a waiting task: 238 * Tracepoint for a waiting task:
@@ -287,7 +255,7 @@ TRACE_EVENT(sched_process_wait,
287 __entry->prio = current->prio; 255 __entry->prio = current->prio;
288 ), 256 ),
289 257
290 TP_printk("task %s:%d [%d]", 258 TP_printk("comm=%s pid=%d prio=%d",
291 __entry->comm, __entry->pid, __entry->prio) 259 __entry->comm, __entry->pid, __entry->prio)
292); 260);
293 261
@@ -314,46 +282,16 @@ TRACE_EVENT(sched_process_fork,
314 __entry->child_pid = child->pid; 282 __entry->child_pid = child->pid;
315 ), 283 ),
316 284
317 TP_printk("parent %s:%d child %s:%d", 285 TP_printk("comm=%s pid=%d child_comm=%s child_pid=%d",
318 __entry->parent_comm, __entry->parent_pid, 286 __entry->parent_comm, __entry->parent_pid,
319 __entry->child_comm, __entry->child_pid) 287 __entry->child_comm, __entry->child_pid)
320); 288);
321 289
322/* 290/*
323 * Tracepoint for sending a signal:
324 */
325TRACE_EVENT(sched_signal_send,
326
327 TP_PROTO(int sig, struct task_struct *p),
328
329 TP_ARGS(sig, p),
330
331 TP_STRUCT__entry(
332 __field( int, sig )
333 __array( char, comm, TASK_COMM_LEN )
334 __field( pid_t, pid )
335 ),
336
337 TP_fast_assign(
338 memcpy(__entry->comm, p->comm, TASK_COMM_LEN);
339 __entry->pid = p->pid;
340 __entry->sig = sig;
341 ),
342
343 TP_printk("sig: %d task %s:%d",
344 __entry->sig, __entry->comm, __entry->pid)
345);
346
347/*
348 * XXX the below sched_stat tracepoints only apply to SCHED_OTHER/BATCH/IDLE 291 * XXX the below sched_stat tracepoints only apply to SCHED_OTHER/BATCH/IDLE
349 * adding sched_stat support to SCHED_FIFO/RR would be welcome. 292 * adding sched_stat support to SCHED_FIFO/RR would be welcome.
350 */ 293 */
351 294DECLARE_EVENT_CLASS(sched_stat_template,
352/*
353 * Tracepoint for accounting wait time (time the task is runnable
354 * but not actually running due to scheduler contention).
355 */
356TRACE_EVENT(sched_stat_wait,
357 295
358 TP_PROTO(struct task_struct *tsk, u64 delay), 296 TP_PROTO(struct task_struct *tsk, u64 delay),
359 297
@@ -374,11 +312,36 @@ TRACE_EVENT(sched_stat_wait,
374 __perf_count(delay); 312 __perf_count(delay);
375 ), 313 ),
376 314
377 TP_printk("task: %s:%d wait: %Lu [ns]", 315 TP_printk("comm=%s pid=%d delay=%Lu [ns]",
378 __entry->comm, __entry->pid, 316 __entry->comm, __entry->pid,
379 (unsigned long long)__entry->delay) 317 (unsigned long long)__entry->delay)
380); 318);
381 319
320
321/*
322 * Tracepoint for accounting wait time (time the task is runnable
323 * but not actually running due to scheduler contention).
324 */
325DEFINE_EVENT(sched_stat_template, sched_stat_wait,
326 TP_PROTO(struct task_struct *tsk, u64 delay),
327 TP_ARGS(tsk, delay));
328
329/*
330 * Tracepoint for accounting sleep time (time the task is not runnable,
331 * including iowait, see below).
332 */
333DEFINE_EVENT(sched_stat_template, sched_stat_sleep,
334 TP_PROTO(struct task_struct *tsk, u64 delay),
335 TP_ARGS(tsk, delay));
336
337/*
338 * Tracepoint for accounting iowait time (time the task is not runnable
339 * due to waiting on IO to complete).
340 */
341DEFINE_EVENT(sched_stat_template, sched_stat_iowait,
342 TP_PROTO(struct task_struct *tsk, u64 delay),
343 TP_ARGS(tsk, delay));
344
382/* 345/*
383 * Tracepoint for accounting runtime (time the task is executing 346 * Tracepoint for accounting runtime (time the task is executing
384 * on a CPU). 347 * on a CPU).
@@ -406,72 +369,12 @@ TRACE_EVENT(sched_stat_runtime,
406 __perf_count(runtime); 369 __perf_count(runtime);
407 ), 370 ),
408 371
409 TP_printk("task: %s:%d runtime: %Lu [ns], vruntime: %Lu [ns]", 372 TP_printk("comm=%s pid=%d runtime=%Lu [ns] vruntime=%Lu [ns]",
410 __entry->comm, __entry->pid, 373 __entry->comm, __entry->pid,
411 (unsigned long long)__entry->runtime, 374 (unsigned long long)__entry->runtime,
412 (unsigned long long)__entry->vruntime) 375 (unsigned long long)__entry->vruntime)
413); 376);
414 377
415/*
416 * Tracepoint for accounting sleep time (time the task is not runnable,
417 * including iowait, see below).
418 */
419TRACE_EVENT(sched_stat_sleep,
420
421 TP_PROTO(struct task_struct *tsk, u64 delay),
422
423 TP_ARGS(tsk, delay),
424
425 TP_STRUCT__entry(
426 __array( char, comm, TASK_COMM_LEN )
427 __field( pid_t, pid )
428 __field( u64, delay )
429 ),
430
431 TP_fast_assign(
432 memcpy(__entry->comm, tsk->comm, TASK_COMM_LEN);
433 __entry->pid = tsk->pid;
434 __entry->delay = delay;
435 )
436 TP_perf_assign(
437 __perf_count(delay);
438 ),
439
440 TP_printk("task: %s:%d sleep: %Lu [ns]",
441 __entry->comm, __entry->pid,
442 (unsigned long long)__entry->delay)
443);
444
445/*
446 * Tracepoint for accounting iowait time (time the task is not runnable
447 * due to waiting on IO to complete).
448 */
449TRACE_EVENT(sched_stat_iowait,
450
451 TP_PROTO(struct task_struct *tsk, u64 delay),
452
453 TP_ARGS(tsk, delay),
454
455 TP_STRUCT__entry(
456 __array( char, comm, TASK_COMM_LEN )
457 __field( pid_t, pid )
458 __field( u64, delay )
459 ),
460
461 TP_fast_assign(
462 memcpy(__entry->comm, tsk->comm, TASK_COMM_LEN);
463 __entry->pid = tsk->pid;
464 __entry->delay = delay;
465 )
466 TP_perf_assign(
467 __perf_count(delay);
468 ),
469
470 TP_printk("task: %s:%d iowait: %Lu [ns]",
471 __entry->comm, __entry->pid,
472 (unsigned long long)__entry->delay)
473);
474
475#endif /* _TRACE_SCHED_H */ 378#endif /* _TRACE_SCHED_H */
476 379
477/* This part must be outside protection */ 380/* This part must be outside protection */
diff --git a/include/trace/events/signal.h b/include/trace/events/signal.h
new file mode 100644
index 000000000000..a510b75ac304
--- /dev/null
+++ b/include/trace/events/signal.h
@@ -0,0 +1,173 @@
1#undef TRACE_SYSTEM
2#define TRACE_SYSTEM signal
3
4#if !defined(_TRACE_SIGNAL_H) || defined(TRACE_HEADER_MULTI_READ)
5#define _TRACE_SIGNAL_H
6
7#include <linux/signal.h>
8#include <linux/sched.h>
9#include <linux/tracepoint.h>
10
11#define TP_STORE_SIGINFO(__entry, info) \
12 do { \
13 if (info == SEND_SIG_NOINFO) { \
14 __entry->errno = 0; \
15 __entry->code = SI_USER; \
16 } else if (info == SEND_SIG_PRIV) { \
17 __entry->errno = 0; \
18 __entry->code = SI_KERNEL; \
19 } else { \
20 __entry->errno = info->si_errno; \
21 __entry->code = info->si_code; \
22 } \
23 } while (0)
24
25/**
26 * signal_generate - called when a signal is generated
27 * @sig: signal number
28 * @info: pointer to struct siginfo
29 * @task: pointer to struct task_struct
30 *
31 * Current process sends a 'sig' signal to 'task' process with
32 * 'info' siginfo. If 'info' is SEND_SIG_NOINFO or SEND_SIG_PRIV,
33 * 'info' is not a pointer and you can't access its field. Instead,
34 * SEND_SIG_NOINFO means that si_code is SI_USER, and SEND_SIG_PRIV
35 * means that si_code is SI_KERNEL.
36 */
37TRACE_EVENT(signal_generate,
38
39 TP_PROTO(int sig, struct siginfo *info, struct task_struct *task),
40
41 TP_ARGS(sig, info, task),
42
43 TP_STRUCT__entry(
44 __field( int, sig )
45 __field( int, errno )
46 __field( int, code )
47 __array( char, comm, TASK_COMM_LEN )
48 __field( pid_t, pid )
49 ),
50
51 TP_fast_assign(
52 __entry->sig = sig;
53 TP_STORE_SIGINFO(__entry, info);
54 memcpy(__entry->comm, task->comm, TASK_COMM_LEN);
55 __entry->pid = task->pid;
56 ),
57
58 TP_printk("sig=%d errno=%d code=%d comm=%s pid=%d",
59 __entry->sig, __entry->errno, __entry->code,
60 __entry->comm, __entry->pid)
61);
62
63/**
64 * signal_deliver - called when a signal is delivered
65 * @sig: signal number
66 * @info: pointer to struct siginfo
67 * @ka: pointer to struct k_sigaction
68 *
69 * A 'sig' signal is delivered to current process with 'info' siginfo,
70 * and it will be handled by 'ka'. ka->sa.sa_handler can be SIG_IGN or
71 * SIG_DFL.
72 * Note that some signals reported by signal_generate tracepoint can be
73 * lost, ignored or modified (by debugger) before hitting this tracepoint.
74 * This means, this can show which signals are actually delivered, but
75 * matching generated signals and delivered signals may not be correct.
76 */
77TRACE_EVENT(signal_deliver,
78
79 TP_PROTO(int sig, struct siginfo *info, struct k_sigaction *ka),
80
81 TP_ARGS(sig, info, ka),
82
83 TP_STRUCT__entry(
84 __field( int, sig )
85 __field( int, errno )
86 __field( int, code )
87 __field( unsigned long, sa_handler )
88 __field( unsigned long, sa_flags )
89 ),
90
91 TP_fast_assign(
92 __entry->sig = sig;
93 TP_STORE_SIGINFO(__entry, info);
94 __entry->sa_handler = (unsigned long)ka->sa.sa_handler;
95 __entry->sa_flags = ka->sa.sa_flags;
96 ),
97
98 TP_printk("sig=%d errno=%d code=%d sa_handler=%lx sa_flags=%lx",
99 __entry->sig, __entry->errno, __entry->code,
100 __entry->sa_handler, __entry->sa_flags)
101);
102
103/**
104 * signal_overflow_fail - called when signal queue is overflow
105 * @sig: signal number
106 * @group: signal to process group or not (bool)
107 * @info: pointer to struct siginfo
108 *
109 * Kernel fails to generate 'sig' signal with 'info' siginfo, because
110 * siginfo queue is overflow, and the signal is dropped.
111 * 'group' is not 0 if the signal will be sent to a process group.
112 * 'sig' is always one of RT signals.
113 */
114TRACE_EVENT(signal_overflow_fail,
115
116 TP_PROTO(int sig, int group, struct siginfo *info),
117
118 TP_ARGS(sig, group, info),
119
120 TP_STRUCT__entry(
121 __field( int, sig )
122 __field( int, group )
123 __field( int, errno )
124 __field( int, code )
125 ),
126
127 TP_fast_assign(
128 __entry->sig = sig;
129 __entry->group = group;
130 TP_STORE_SIGINFO(__entry, info);
131 ),
132
133 TP_printk("sig=%d group=%d errno=%d code=%d",
134 __entry->sig, __entry->group, __entry->errno, __entry->code)
135);
136
137/**
138 * signal_lose_info - called when siginfo is lost
139 * @sig: signal number
140 * @group: signal to process group or not (bool)
141 * @info: pointer to struct siginfo
142 *
143 * Kernel generates 'sig' signal but loses 'info' siginfo, because siginfo
144 * queue is overflow.
145 * 'group' is not 0 if the signal will be sent to a process group.
146 * 'sig' is always one of non-RT signals.
147 */
148TRACE_EVENT(signal_lose_info,
149
150 TP_PROTO(int sig, int group, struct siginfo *info),
151
152 TP_ARGS(sig, group, info),
153
154 TP_STRUCT__entry(
155 __field( int, sig )
156 __field( int, group )
157 __field( int, errno )
158 __field( int, code )
159 ),
160
161 TP_fast_assign(
162 __entry->sig = sig;
163 __entry->group = group;
164 TP_STORE_SIGINFO(__entry, info);
165 ),
166
167 TP_printk("sig=%d group=%d errno=%d code=%d",
168 __entry->sig, __entry->group, __entry->errno, __entry->code)
169);
170#endif /* _TRACE_SIGNAL_H */
171
172/* This part must be outside protection */
173#include <trace/define_trace.h>
diff --git a/include/trace/events/syscalls.h b/include/trace/events/syscalls.h
index 397dff2dbd5a..fb726ac7caee 100644
--- a/include/trace/events/syscalls.h
+++ b/include/trace/events/syscalls.h
@@ -1,5 +1,6 @@
1#undef TRACE_SYSTEM 1#undef TRACE_SYSTEM
2#define TRACE_SYSTEM syscalls 2#define TRACE_SYSTEM raw_syscalls
3#define TRACE_INCLUDE_FILE syscalls
3 4
4#if !defined(_TRACE_EVENTS_SYSCALLS_H) || defined(TRACE_HEADER_MULTI_READ) 5#if !defined(_TRACE_EVENTS_SYSCALLS_H) || defined(TRACE_HEADER_MULTI_READ)
5#define _TRACE_EVENTS_SYSCALLS_H 6#define _TRACE_EVENTS_SYSCALLS_H
diff --git a/include/trace/events/timer.h b/include/trace/events/timer.h
index 1844c48d640e..e5ce87a0498d 100644
--- a/include/trace/events/timer.h
+++ b/include/trace/events/timer.h
@@ -26,7 +26,7 @@ TRACE_EVENT(timer_init,
26 __entry->timer = timer; 26 __entry->timer = timer;
27 ), 27 ),
28 28
29 TP_printk("timer %p", __entry->timer) 29 TP_printk("timer=%p", __entry->timer)
30); 30);
31 31
32/** 32/**
@@ -54,7 +54,7 @@ TRACE_EVENT(timer_start,
54 __entry->now = jiffies; 54 __entry->now = jiffies;
55 ), 55 ),
56 56
57 TP_printk("timer %p: func %pf, expires %lu, timeout %ld", 57 TP_printk("timer=%p function=%pf expires=%lu [timeout=%ld]",
58 __entry->timer, __entry->function, __entry->expires, 58 __entry->timer, __entry->function, __entry->expires,
59 (long)__entry->expires - __entry->now) 59 (long)__entry->expires - __entry->now)
60); 60);
@@ -81,7 +81,7 @@ TRACE_EVENT(timer_expire_entry,
81 __entry->now = jiffies; 81 __entry->now = jiffies;
82 ), 82 ),
83 83
84 TP_printk("timer %p: now %lu", __entry->timer, __entry->now) 84 TP_printk("timer=%p now=%lu", __entry->timer, __entry->now)
85); 85);
86 86
87/** 87/**
@@ -108,7 +108,7 @@ TRACE_EVENT(timer_expire_exit,
108 __entry->timer = timer; 108 __entry->timer = timer;
109 ), 109 ),
110 110
111 TP_printk("timer %p", __entry->timer) 111 TP_printk("timer=%p", __entry->timer)
112); 112);
113 113
114/** 114/**
@@ -129,7 +129,7 @@ TRACE_EVENT(timer_cancel,
129 __entry->timer = timer; 129 __entry->timer = timer;
130 ), 130 ),
131 131
132 TP_printk("timer %p", __entry->timer) 132 TP_printk("timer=%p", __entry->timer)
133); 133);
134 134
135/** 135/**
@@ -140,24 +140,24 @@ TRACE_EVENT(timer_cancel,
140 */ 140 */
141TRACE_EVENT(hrtimer_init, 141TRACE_EVENT(hrtimer_init,
142 142
143 TP_PROTO(struct hrtimer *timer, clockid_t clockid, 143 TP_PROTO(struct hrtimer *hrtimer, clockid_t clockid,
144 enum hrtimer_mode mode), 144 enum hrtimer_mode mode),
145 145
146 TP_ARGS(timer, clockid, mode), 146 TP_ARGS(hrtimer, clockid, mode),
147 147
148 TP_STRUCT__entry( 148 TP_STRUCT__entry(
149 __field( void *, timer ) 149 __field( void *, hrtimer )
150 __field( clockid_t, clockid ) 150 __field( clockid_t, clockid )
151 __field( enum hrtimer_mode, mode ) 151 __field( enum hrtimer_mode, mode )
152 ), 152 ),
153 153
154 TP_fast_assign( 154 TP_fast_assign(
155 __entry->timer = timer; 155 __entry->hrtimer = hrtimer;
156 __entry->clockid = clockid; 156 __entry->clockid = clockid;
157 __entry->mode = mode; 157 __entry->mode = mode;
158 ), 158 ),
159 159
160 TP_printk("hrtimer %p, clockid %s, mode %s", __entry->timer, 160 TP_printk("hrtimer=%p clockid=%s mode=%s", __entry->hrtimer,
161 __entry->clockid == CLOCK_REALTIME ? 161 __entry->clockid == CLOCK_REALTIME ?
162 "CLOCK_REALTIME" : "CLOCK_MONOTONIC", 162 "CLOCK_REALTIME" : "CLOCK_MONOTONIC",
163 __entry->mode == HRTIMER_MODE_ABS ? 163 __entry->mode == HRTIMER_MODE_ABS ?
@@ -170,26 +170,26 @@ TRACE_EVENT(hrtimer_init,
170 */ 170 */
171TRACE_EVENT(hrtimer_start, 171TRACE_EVENT(hrtimer_start,
172 172
173 TP_PROTO(struct hrtimer *timer), 173 TP_PROTO(struct hrtimer *hrtimer),
174 174
175 TP_ARGS(timer), 175 TP_ARGS(hrtimer),
176 176
177 TP_STRUCT__entry( 177 TP_STRUCT__entry(
178 __field( void *, timer ) 178 __field( void *, hrtimer )
179 __field( void *, function ) 179 __field( void *, function )
180 __field( s64, expires ) 180 __field( s64, expires )
181 __field( s64, softexpires ) 181 __field( s64, softexpires )
182 ), 182 ),
183 183
184 TP_fast_assign( 184 TP_fast_assign(
185 __entry->timer = timer; 185 __entry->hrtimer = hrtimer;
186 __entry->function = timer->function; 186 __entry->function = hrtimer->function;
187 __entry->expires = hrtimer_get_expires(timer).tv64; 187 __entry->expires = hrtimer_get_expires(hrtimer).tv64;
188 __entry->softexpires = hrtimer_get_softexpires(timer).tv64; 188 __entry->softexpires = hrtimer_get_softexpires(hrtimer).tv64;
189 ), 189 ),
190 190
191 TP_printk("hrtimer %p, func %pf, expires %llu, softexpires %llu", 191 TP_printk("hrtimer=%p function=%pf expires=%llu softexpires=%llu",
192 __entry->timer, __entry->function, 192 __entry->hrtimer, __entry->function,
193 (unsigned long long)ktime_to_ns((ktime_t) { 193 (unsigned long long)ktime_to_ns((ktime_t) {
194 .tv64 = __entry->expires }), 194 .tv64 = __entry->expires }),
195 (unsigned long long)ktime_to_ns((ktime_t) { 195 (unsigned long long)ktime_to_ns((ktime_t) {
@@ -206,23 +206,22 @@ TRACE_EVENT(hrtimer_start,
206 */ 206 */
207TRACE_EVENT(hrtimer_expire_entry, 207TRACE_EVENT(hrtimer_expire_entry,
208 208
209 TP_PROTO(struct hrtimer *timer, ktime_t *now), 209 TP_PROTO(struct hrtimer *hrtimer, ktime_t *now),
210 210
211 TP_ARGS(timer, now), 211 TP_ARGS(hrtimer, now),
212 212
213 TP_STRUCT__entry( 213 TP_STRUCT__entry(
214 __field( void *, timer ) 214 __field( void *, hrtimer )
215 __field( s64, now ) 215 __field( s64, now )
216 ), 216 ),
217 217
218 TP_fast_assign( 218 TP_fast_assign(
219 __entry->timer = timer; 219 __entry->hrtimer = hrtimer;
220 __entry->now = now->tv64; 220 __entry->now = now->tv64;
221 ), 221 ),
222 222
223 TP_printk("hrtimer %p, now %llu", __entry->timer, 223 TP_printk("hrtimer=%p now=%llu", __entry->hrtimer,
224 (unsigned long long)ktime_to_ns((ktime_t) { 224 (unsigned long long)ktime_to_ns((ktime_t) { .tv64 = __entry->now }))
225 .tv64 = __entry->now }))
226 ); 225 );
227 226
228/** 227/**
@@ -234,40 +233,40 @@ TRACE_EVENT(hrtimer_expire_entry,
234 */ 233 */
235TRACE_EVENT(hrtimer_expire_exit, 234TRACE_EVENT(hrtimer_expire_exit,
236 235
237 TP_PROTO(struct hrtimer *timer), 236 TP_PROTO(struct hrtimer *hrtimer),
238 237
239 TP_ARGS(timer), 238 TP_ARGS(hrtimer),
240 239
241 TP_STRUCT__entry( 240 TP_STRUCT__entry(
242 __field( void *, timer ) 241 __field( void *, hrtimer )
243 ), 242 ),
244 243
245 TP_fast_assign( 244 TP_fast_assign(
246 __entry->timer = timer; 245 __entry->hrtimer = hrtimer;
247 ), 246 ),
248 247
249 TP_printk("hrtimer %p", __entry->timer) 248 TP_printk("hrtimer=%p", __entry->hrtimer)
250); 249);
251 250
252/** 251/**
253 * hrtimer_cancel - called when the hrtimer is canceled 252 * hrtimer_cancel - called when the hrtimer is canceled
254 * @timer: pointer to struct hrtimer 253 * @hrtimer: pointer to struct hrtimer
255 */ 254 */
256TRACE_EVENT(hrtimer_cancel, 255TRACE_EVENT(hrtimer_cancel,
257 256
258 TP_PROTO(struct hrtimer *timer), 257 TP_PROTO(struct hrtimer *hrtimer),
259 258
260 TP_ARGS(timer), 259 TP_ARGS(hrtimer),
261 260
262 TP_STRUCT__entry( 261 TP_STRUCT__entry(
263 __field( void *, timer ) 262 __field( void *, hrtimer )
264 ), 263 ),
265 264
266 TP_fast_assign( 265 TP_fast_assign(
267 __entry->timer = timer; 266 __entry->hrtimer = hrtimer;
268 ), 267 ),
269 268
270 TP_printk("hrtimer %p", __entry->timer) 269 TP_printk("hrtimer=%p", __entry->hrtimer)
271); 270);
272 271
273/** 272/**
@@ -302,7 +301,7 @@ TRACE_EVENT(itimer_state,
302 __entry->interval_usec = value->it_interval.tv_usec; 301 __entry->interval_usec = value->it_interval.tv_usec;
303 ), 302 ),
304 303
305 TP_printk("which %d, expires %lu, it_value %lu.%lu, it_interval %lu.%lu", 304 TP_printk("which=%d expires=%lu it_value=%lu.%lu it_interval=%lu.%lu",
306 __entry->which, __entry->expires, 305 __entry->which, __entry->expires,
307 __entry->value_sec, __entry->value_usec, 306 __entry->value_sec, __entry->value_usec,
308 __entry->interval_sec, __entry->interval_usec) 307 __entry->interval_sec, __entry->interval_usec)
@@ -332,7 +331,7 @@ TRACE_EVENT(itimer_expire,
332 __entry->pid = pid_nr(pid); 331 __entry->pid = pid_nr(pid);
333 ), 332 ),
334 333
335 TP_printk("which %d, pid %d, now %lu", __entry->which, 334 TP_printk("which=%d pid=%d now=%lu", __entry->which,
336 (int) __entry->pid, __entry->now) 335 (int) __entry->pid, __entry->now)
337); 336);
338 337
diff --git a/include/trace/events/workqueue.h b/include/trace/events/workqueue.h
index e4612dbd7ba6..d6c974474e70 100644
--- a/include/trace/events/workqueue.h
+++ b/include/trace/events/workqueue.h
@@ -8,7 +8,7 @@
8#include <linux/sched.h> 8#include <linux/sched.h>
9#include <linux/tracepoint.h> 9#include <linux/tracepoint.h>
10 10
11TRACE_EVENT(workqueue_insertion, 11DECLARE_EVENT_CLASS(workqueue,
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),
14 14
@@ -30,26 +30,18 @@ TRACE_EVENT(workqueue_insertion,
30 __entry->thread_pid, __entry->func) 30 __entry->thread_pid, __entry->func)
31); 31);
32 32
33TRACE_EVENT(workqueue_execution, 33DEFINE_EVENT(workqueue, workqueue_insertion,
34 34
35 TP_PROTO(struct task_struct *wq_thread, struct work_struct *work), 35 TP_PROTO(struct task_struct *wq_thread, struct work_struct *work),
36 36
37 TP_ARGS(wq_thread, work), 37 TP_ARGS(wq_thread, work)
38);
38 39
39 TP_STRUCT__entry( 40DEFINE_EVENT(workqueue, workqueue_execution,
40 __array(char, thread_comm, TASK_COMM_LEN)
41 __field(pid_t, thread_pid)
42 __field(work_func_t, func)
43 ),
44 41
45 TP_fast_assign( 42 TP_PROTO(struct task_struct *wq_thread, struct work_struct *work),
46 memcpy(__entry->thread_comm, wq_thread->comm, TASK_COMM_LEN);
47 __entry->thread_pid = wq_thread->pid;
48 __entry->func = work->func;
49 ),
50 43
51 TP_printk("thread=%s:%d func=%pf", __entry->thread_comm, 44 TP_ARGS(wq_thread, work)
52 __entry->thread_pid, __entry->func)
53); 45);
54 46
55/* Trace the creation of one workqueue thread on a cpu */ 47/* Trace the creation of one workqueue thread on a cpu */
diff --git a/include/trace/ftrace.h b/include/trace/ftrace.h
index cc0d9667e182..d1b3de9c1a71 100644
--- a/include/trace/ftrace.h
+++ b/include/trace/ftrace.h
@@ -18,6 +18,26 @@
18 18
19#include <linux/ftrace_event.h> 19#include <linux/ftrace_event.h>
20 20
21/*
22 * DECLARE_EVENT_CLASS can be used to add a generic function
23 * handlers for events. That is, if all events have the same
24 * parameters and just have distinct trace points.
25 * Each tracepoint can be defined with DEFINE_EVENT and that
26 * will map the DECLARE_EVENT_CLASS to the tracepoint.
27 *
28 * TRACE_EVENT is a one to one mapping between tracepoint and template.
29 */
30#undef TRACE_EVENT
31#define TRACE_EVENT(name, proto, args, tstruct, assign, print) \
32 DECLARE_EVENT_CLASS(name, \
33 PARAMS(proto), \
34 PARAMS(args), \
35 PARAMS(tstruct), \
36 PARAMS(assign), \
37 PARAMS(print)); \
38 DEFINE_EVENT(name, name, PARAMS(proto), PARAMS(args));
39
40
21#undef __field 41#undef __field
22#define __field(type, item) type item; 42#define __field(type, item) type item;
23 43
@@ -36,15 +56,21 @@
36#undef TP_STRUCT__entry 56#undef TP_STRUCT__entry
37#define TP_STRUCT__entry(args...) args 57#define TP_STRUCT__entry(args...) args
38 58
39#undef TRACE_EVENT 59#undef DECLARE_EVENT_CLASS
40#define TRACE_EVENT(name, proto, args, tstruct, assign, print) \ 60#define DECLARE_EVENT_CLASS(name, proto, args, tstruct, assign, print) \
41 struct ftrace_raw_##name { \ 61 struct ftrace_raw_##name { \
42 struct trace_entry ent; \ 62 struct trace_entry ent; \
43 tstruct \ 63 tstruct \
44 char __data[0]; \ 64 char __data[0]; \
45 }; \ 65 };
66#undef DEFINE_EVENT
67#define DEFINE_EVENT(template, name, proto, args) \
46 static struct ftrace_event_call event_##name 68 static struct ftrace_event_call event_##name
47 69
70#undef DEFINE_EVENT_PRINT
71#define DEFINE_EVENT_PRINT(template, name, proto, args, print) \
72 DEFINE_EVENT(template, name, PARAMS(proto), PARAMS(args))
73
48#undef __cpparg 74#undef __cpparg
49#define __cpparg(arg...) arg 75#define __cpparg(arg...) arg
50 76
@@ -89,12 +115,19 @@
89#undef __string 115#undef __string
90#define __string(item, src) __dynamic_array(char, item, -1) 116#define __string(item, src) __dynamic_array(char, item, -1)
91 117
92#undef TRACE_EVENT 118#undef DECLARE_EVENT_CLASS
93#define TRACE_EVENT(call, proto, args, tstruct, assign, print) \ 119#define DECLARE_EVENT_CLASS(call, proto, args, tstruct, assign, print) \
94 struct ftrace_data_offsets_##call { \ 120 struct ftrace_data_offsets_##call { \
95 tstruct; \ 121 tstruct; \
96 }; 122 };
97 123
124#undef DEFINE_EVENT
125#define DEFINE_EVENT(template, name, proto, args)
126
127#undef DEFINE_EVENT_PRINT
128#define DEFINE_EVENT_PRINT(template, name, proto, args, print) \
129 DEFINE_EVENT(template, name, PARAMS(proto), PARAMS(args))
130
98#include TRACE_INCLUDE(TRACE_INCLUDE_FILE) 131#include TRACE_INCLUDE(TRACE_INCLUDE_FILE)
99 132
100/* 133/*
@@ -120,9 +153,10 @@
120#undef __field 153#undef __field
121#define __field(type, item) \ 154#define __field(type, item) \
122 ret = trace_seq_printf(s, "\tfield:" #type " " #item ";\t" \ 155 ret = trace_seq_printf(s, "\tfield:" #type " " #item ";\t" \
123 "offset:%u;\tsize:%u;\n", \ 156 "offset:%u;\tsize:%u;\tsigned:%u;\n", \
124 (unsigned int)offsetof(typeof(field), item), \ 157 (unsigned int)offsetof(typeof(field), item), \
125 (unsigned int)sizeof(field.item)); \ 158 (unsigned int)sizeof(field.item), \
159 (unsigned int)is_signed_type(type)); \
126 if (!ret) \ 160 if (!ret) \
127 return 0; 161 return 0;
128 162
@@ -132,19 +166,21 @@
132#undef __array 166#undef __array
133#define __array(type, item, len) \ 167#define __array(type, item, len) \
134 ret = trace_seq_printf(s, "\tfield:" #type " " #item "[" #len "];\t" \ 168 ret = trace_seq_printf(s, "\tfield:" #type " " #item "[" #len "];\t" \
135 "offset:%u;\tsize:%u;\n", \ 169 "offset:%u;\tsize:%u;\tsigned:%u;\n", \
136 (unsigned int)offsetof(typeof(field), item), \ 170 (unsigned int)offsetof(typeof(field), item), \
137 (unsigned int)sizeof(field.item)); \ 171 (unsigned int)sizeof(field.item), \
172 (unsigned int)is_signed_type(type)); \
138 if (!ret) \ 173 if (!ret) \
139 return 0; 174 return 0;
140 175
141#undef __dynamic_array 176#undef __dynamic_array
142#define __dynamic_array(type, item, len) \ 177#define __dynamic_array(type, item, len) \
143 ret = trace_seq_printf(s, "\tfield:__data_loc " #type "[] " #item ";\t"\ 178 ret = trace_seq_printf(s, "\tfield:__data_loc " #type "[] " #item ";\t"\
144 "offset:%u;\tsize:%u;\n", \ 179 "offset:%u;\tsize:%u;\tsigned:%u;\n", \
145 (unsigned int)offsetof(typeof(field), \ 180 (unsigned int)offsetof(typeof(field), \
146 __data_loc_##item), \ 181 __data_loc_##item), \
147 (unsigned int)sizeof(field.__data_loc_##item)); \ 182 (unsigned int)sizeof(field.__data_loc_##item), \
183 (unsigned int)is_signed_type(type)); \
148 if (!ret) \ 184 if (!ret) \
149 return 0; 185 return 0;
150 186
@@ -159,7 +195,7 @@
159#undef __get_str 195#undef __get_str
160 196
161#undef TP_printk 197#undef TP_printk
162#define TP_printk(fmt, args...) "%s, %s\n", #fmt, __stringify(args) 198#define TP_printk(fmt, args...) "\"%s\", %s\n", fmt, __stringify(args)
163 199
164#undef TP_fast_assign 200#undef TP_fast_assign
165#define TP_fast_assign(args...) args 201#define TP_fast_assign(args...) args
@@ -167,17 +203,50 @@
167#undef TP_perf_assign 203#undef TP_perf_assign
168#define TP_perf_assign(args...) 204#define TP_perf_assign(args...)
169 205
170#undef TRACE_EVENT 206#undef DECLARE_EVENT_CLASS
171#define TRACE_EVENT(call, proto, args, tstruct, func, print) \ 207#define DECLARE_EVENT_CLASS(call, proto, args, tstruct, func, print) \
172static int \ 208static int \
173ftrace_format_##call(struct ftrace_event_call *unused, \ 209ftrace_format_setup_##call(struct ftrace_event_call *unused, \
174 struct trace_seq *s) \ 210 struct trace_seq *s) \
175{ \ 211{ \
176 struct ftrace_raw_##call field __attribute__((unused)); \ 212 struct ftrace_raw_##call field __attribute__((unused)); \
177 int ret = 0; \ 213 int ret = 0; \
178 \ 214 \
179 tstruct; \ 215 tstruct; \
180 \ 216 \
217 return ret; \
218} \
219 \
220static int \
221ftrace_format_##call(struct ftrace_event_call *unused, \
222 struct trace_seq *s) \
223{ \
224 int ret = 0; \
225 \
226 ret = ftrace_format_setup_##call(unused, s); \
227 if (!ret) \
228 return ret; \
229 \
230 ret = trace_seq_printf(s, "\nprint fmt: " print); \
231 \
232 return ret; \
233}
234
235#undef DEFINE_EVENT
236#define DEFINE_EVENT(template, name, proto, args)
237
238#undef DEFINE_EVENT_PRINT
239#define DEFINE_EVENT_PRINT(template, name, proto, args, print) \
240static int \
241ftrace_format_##name(struct ftrace_event_call *unused, \
242 struct trace_seq *s) \
243{ \
244 int ret = 0; \
245 \
246 ret = ftrace_format_setup_##template(unused, s); \
247 if (!ret) \
248 return ret; \
249 \
181 trace_seq_printf(s, "\nprint fmt: " print); \ 250 trace_seq_printf(s, "\nprint fmt: " print); \
182 \ 251 \
183 return ret; \ 252 return ret; \
@@ -252,10 +321,11 @@ ftrace_format_##call(struct ftrace_event_call *unused, \
252 ftrace_print_symbols_seq(p, value, symbols); \ 321 ftrace_print_symbols_seq(p, value, symbols); \
253 }) 322 })
254 323
255#undef TRACE_EVENT 324#undef DECLARE_EVENT_CLASS
256#define TRACE_EVENT(call, proto, args, tstruct, assign, print) \ 325#define DECLARE_EVENT_CLASS(call, proto, args, tstruct, assign, print) \
257static enum print_line_t \ 326static enum print_line_t \
258ftrace_raw_output_##call(struct trace_iterator *iter, int flags) \ 327ftrace_raw_output_id_##call(int event_id, const char *name, \
328 struct trace_iterator *iter, int flags) \
259{ \ 329{ \
260 struct trace_seq *s = &iter->seq; \ 330 struct trace_seq *s = &iter->seq; \
261 struct ftrace_raw_##call *field; \ 331 struct ftrace_raw_##call *field; \
@@ -265,6 +335,47 @@ ftrace_raw_output_##call(struct trace_iterator *iter, int flags) \
265 \ 335 \
266 entry = iter->ent; \ 336 entry = iter->ent; \
267 \ 337 \
338 if (entry->type != event_id) { \
339 WARN_ON_ONCE(1); \
340 return TRACE_TYPE_UNHANDLED; \
341 } \
342 \
343 field = (typeof(field))entry; \
344 \
345 p = &get_cpu_var(ftrace_event_seq); \
346 trace_seq_init(p); \
347 ret = trace_seq_printf(s, "%s: ", name); \
348 if (ret) \
349 ret = trace_seq_printf(s, print); \
350 put_cpu(); \
351 if (!ret) \
352 return TRACE_TYPE_PARTIAL_LINE; \
353 \
354 return TRACE_TYPE_HANDLED; \
355}
356
357#undef DEFINE_EVENT
358#define DEFINE_EVENT(template, name, proto, args) \
359static enum print_line_t \
360ftrace_raw_output_##name(struct trace_iterator *iter, int flags) \
361{ \
362 return ftrace_raw_output_id_##template(event_##name.id, \
363 #name, iter, flags); \
364}
365
366#undef DEFINE_EVENT_PRINT
367#define DEFINE_EVENT_PRINT(template, call, proto, args, print) \
368static enum print_line_t \
369ftrace_raw_output_##call(struct trace_iterator *iter, int flags) \
370{ \
371 struct trace_seq *s = &iter->seq; \
372 struct ftrace_raw_##template *field; \
373 struct trace_entry *entry; \
374 struct trace_seq *p; \
375 int ret; \
376 \
377 entry = iter->ent; \
378 \
268 if (entry->type != event_##call.id) { \ 379 if (entry->type != event_##call.id) { \
269 WARN_ON_ONCE(1); \ 380 WARN_ON_ONCE(1); \
270 return TRACE_TYPE_UNHANDLED; \ 381 return TRACE_TYPE_UNHANDLED; \
@@ -274,14 +385,16 @@ ftrace_raw_output_##call(struct trace_iterator *iter, int flags) \
274 \ 385 \
275 p = &get_cpu_var(ftrace_event_seq); \ 386 p = &get_cpu_var(ftrace_event_seq); \
276 trace_seq_init(p); \ 387 trace_seq_init(p); \
277 ret = trace_seq_printf(s, #call ": " print); \ 388 ret = trace_seq_printf(s, "%s: ", #call); \
389 if (ret) \
390 ret = trace_seq_printf(s, print); \
278 put_cpu(); \ 391 put_cpu(); \
279 if (!ret) \ 392 if (!ret) \
280 return TRACE_TYPE_PARTIAL_LINE; \ 393 return TRACE_TYPE_PARTIAL_LINE; \
281 \ 394 \
282 return TRACE_TYPE_HANDLED; \ 395 return TRACE_TYPE_HANDLED; \
283} 396}
284 397
285#include TRACE_INCLUDE(TRACE_INCLUDE_FILE) 398#include TRACE_INCLUDE(TRACE_INCLUDE_FILE)
286 399
287#undef __field_ext 400#undef __field_ext
@@ -315,8 +428,8 @@ ftrace_raw_output_##call(struct trace_iterator *iter, int flags) \
315#undef __string 428#undef __string
316#define __string(item, src) __dynamic_array(char, item, -1) 429#define __string(item, src) __dynamic_array(char, item, -1)
317 430
318#undef TRACE_EVENT 431#undef DECLARE_EVENT_CLASS
319#define TRACE_EVENT(call, proto, args, tstruct, func, print) \ 432#define DECLARE_EVENT_CLASS(call, proto, args, tstruct, func, print) \
320static int \ 433static int \
321ftrace_define_fields_##call(struct ftrace_event_call *event_call) \ 434ftrace_define_fields_##call(struct ftrace_event_call *event_call) \
322{ \ 435{ \
@@ -332,6 +445,13 @@ ftrace_define_fields_##call(struct ftrace_event_call *event_call) \
332 return ret; \ 445 return ret; \
333} 446}
334 447
448#undef DEFINE_EVENT
449#define DEFINE_EVENT(template, name, proto, args)
450
451#undef DEFINE_EVENT_PRINT
452#define DEFINE_EVENT_PRINT(template, name, proto, args, print) \
453 DEFINE_EVENT(template, name, PARAMS(proto), PARAMS(args))
454
335#include TRACE_INCLUDE(TRACE_INCLUDE_FILE) 455#include TRACE_INCLUDE(TRACE_INCLUDE_FILE)
336 456
337/* 457/*
@@ -358,10 +478,10 @@ ftrace_define_fields_##call(struct ftrace_event_call *event_call) \
358 __data_size += (len) * sizeof(type); 478 __data_size += (len) * sizeof(type);
359 479
360#undef __string 480#undef __string
361#define __string(item, src) __dynamic_array(char, item, strlen(src) + 1) \ 481#define __string(item, src) __dynamic_array(char, item, strlen(src) + 1)
362 482
363#undef TRACE_EVENT 483#undef DECLARE_EVENT_CLASS
364#define TRACE_EVENT(call, proto, args, tstruct, assign, print) \ 484#define DECLARE_EVENT_CLASS(call, proto, args, tstruct, assign, print) \
365static inline int ftrace_get_offsets_##call( \ 485static inline int ftrace_get_offsets_##call( \
366 struct ftrace_data_offsets_##call *__data_offsets, proto) \ 486 struct ftrace_data_offsets_##call *__data_offsets, proto) \
367{ \ 487{ \
@@ -373,6 +493,13 @@ static inline int ftrace_get_offsets_##call( \
373 return __data_size; \ 493 return __data_size; \
374} 494}
375 495
496#undef DEFINE_EVENT
497#define DEFINE_EVENT(template, name, proto, args)
498
499#undef DEFINE_EVENT_PRINT
500#define DEFINE_EVENT_PRINT(template, name, proto, args, print) \
501 DEFINE_EVENT(template, name, PARAMS(proto), PARAMS(args))
502
376#include TRACE_INCLUDE(TRACE_INCLUDE_FILE) 503#include TRACE_INCLUDE(TRACE_INCLUDE_FILE)
377 504
378#ifdef CONFIG_EVENT_PROFILE 505#ifdef CONFIG_EVENT_PROFILE
@@ -394,21 +521,28 @@ static inline int ftrace_get_offsets_##call( \
394 * 521 *
395 */ 522 */
396 523
397#undef TRACE_EVENT 524#undef DECLARE_EVENT_CLASS
398#define TRACE_EVENT(call, proto, args, tstruct, assign, print) \ 525#define DECLARE_EVENT_CLASS(call, proto, args, tstruct, assign, print)
526
527#undef DEFINE_EVENT
528#define DEFINE_EVENT(template, name, proto, args) \
399 \ 529 \
400static void ftrace_profile_##call(proto); \ 530static void ftrace_profile_##name(proto); \
401 \ 531 \
402static int ftrace_profile_enable_##call(void) \ 532static int ftrace_profile_enable_##name(struct ftrace_event_call *unused)\
403{ \ 533{ \
404 return register_trace_##call(ftrace_profile_##call); \ 534 return register_trace_##name(ftrace_profile_##name); \
405} \ 535} \
406 \ 536 \
407static void ftrace_profile_disable_##call(void) \ 537static void ftrace_profile_disable_##name(struct ftrace_event_call *unused)\
408{ \ 538{ \
409 unregister_trace_##call(ftrace_profile_##call); \ 539 unregister_trace_##name(ftrace_profile_##name); \
410} 540}
411 541
542#undef DEFINE_EVENT_PRINT
543#define DEFINE_EVENT_PRINT(template, name, proto, args, print) \
544 DEFINE_EVENT(template, name, PARAMS(proto), PARAMS(args))
545
412#include TRACE_INCLUDE(TRACE_INCLUDE_FILE) 546#include TRACE_INCLUDE(TRACE_INCLUDE_FILE)
413 547
414#endif 548#endif
@@ -423,7 +557,7 @@ static void ftrace_profile_disable_##call(void) \
423 * event_trace_printk(_RET_IP_, "<call>: " <fmt>); 557 * event_trace_printk(_RET_IP_, "<call>: " <fmt>);
424 * } 558 * }
425 * 559 *
426 * static int ftrace_reg_event_<call>(void) 560 * static int ftrace_reg_event_<call>(struct ftrace_event_call *unused)
427 * { 561 * {
428 * int ret; 562 * int ret;
429 * 563 *
@@ -434,7 +568,7 @@ static void ftrace_profile_disable_##call(void) \
434 * return ret; 568 * return ret;
435 * } 569 * }
436 * 570 *
437 * static void ftrace_unreg_event_<call>(void) 571 * static void ftrace_unreg_event_<call>(struct ftrace_event_call *unused)
438 * { 572 * {
439 * unregister_trace_<call>(ftrace_event_<call>); 573 * unregister_trace_<call>(ftrace_event_<call>);
440 * } 574 * }
@@ -469,7 +603,7 @@ static void ftrace_profile_disable_##call(void) \
469 * trace_current_buffer_unlock_commit(buffer, event, irq_flags, pc); 603 * trace_current_buffer_unlock_commit(buffer, event, irq_flags, pc);
470 * } 604 * }
471 * 605 *
472 * static int ftrace_raw_reg_event_<call>(void) 606 * static int ftrace_raw_reg_event_<call>(struct ftrace_event_call *unused)
473 * { 607 * {
474 * int ret; 608 * int ret;
475 * 609 *
@@ -480,7 +614,7 @@ static void ftrace_profile_disable_##call(void) \
480 * return ret; 614 * return ret;
481 * } 615 * }
482 * 616 *
483 * static void ftrace_unreg_event_<call>(void) 617 * static void ftrace_unreg_event_<call>(struct ftrace_event_call *unused)
484 * { 618 * {
485 * unregister_trace_<call>(ftrace_raw_event_<call>); 619 * unregister_trace_<call>(ftrace_raw_event_<call>);
486 * } 620 * }
@@ -489,7 +623,7 @@ static void ftrace_profile_disable_##call(void) \
489 * .trace = ftrace_raw_output_<call>, <-- stage 2 623 * .trace = ftrace_raw_output_<call>, <-- stage 2
490 * }; 624 * };
491 * 625 *
492 * static int ftrace_raw_init_event_<call>(void) 626 * static int ftrace_raw_init_event_<call>(struct ftrace_event_call *unused)
493 * { 627 * {
494 * int id; 628 * int id;
495 * 629 *
@@ -547,15 +681,13 @@ static void ftrace_profile_disable_##call(void) \
547#define __assign_str(dst, src) \ 681#define __assign_str(dst, src) \
548 strcpy(__get_str(dst), src); 682 strcpy(__get_str(dst), src);
549 683
550#undef TRACE_EVENT 684#undef DECLARE_EVENT_CLASS
551#define TRACE_EVENT(call, proto, args, tstruct, assign, print) \ 685#define DECLARE_EVENT_CLASS(call, proto, args, tstruct, assign, print) \
552 \ 686 \
553static struct ftrace_event_call event_##call; \ 687static void ftrace_raw_event_id_##call(struct ftrace_event_call *event_call, \
554 \ 688 proto) \
555static void ftrace_raw_event_##call(proto) \
556{ \ 689{ \
557 struct ftrace_data_offsets_##call __maybe_unused __data_offsets;\ 690 struct ftrace_data_offsets_##call __maybe_unused __data_offsets;\
558 struct ftrace_event_call *event_call = &event_##call; \
559 struct ring_buffer_event *event; \ 691 struct ring_buffer_event *event; \
560 struct ftrace_raw_##call *entry; \ 692 struct ftrace_raw_##call *entry; \
561 struct ring_buffer *buffer; \ 693 struct ring_buffer *buffer; \
@@ -569,7 +701,7 @@ static void ftrace_raw_event_##call(proto) \
569 __data_size = ftrace_get_offsets_##call(&__data_offsets, args); \ 701 __data_size = ftrace_get_offsets_##call(&__data_offsets, args); \
570 \ 702 \
571 event = trace_current_buffer_lock_reserve(&buffer, \ 703 event = trace_current_buffer_lock_reserve(&buffer, \
572 event_##call.id, \ 704 event_call->id, \
573 sizeof(*entry) + __data_size, \ 705 sizeof(*entry) + __data_size, \
574 irq_flags, pc); \ 706 irq_flags, pc); \
575 if (!event) \ 707 if (!event) \
@@ -584,9 +716,17 @@ static void ftrace_raw_event_##call(proto) \
584 if (!filter_current_check_discard(buffer, event_call, entry, event)) \ 716 if (!filter_current_check_discard(buffer, event_call, entry, event)) \
585 trace_nowake_buffer_unlock_commit(buffer, \ 717 trace_nowake_buffer_unlock_commit(buffer, \
586 event, irq_flags, pc); \ 718 event, irq_flags, pc); \
719}
720
721#undef DEFINE_EVENT
722#define DEFINE_EVENT(template, call, proto, args) \
723 \
724static void ftrace_raw_event_##call(proto) \
725{ \
726 ftrace_raw_event_id_##template(&event_##call, args); \
587} \ 727} \
588 \ 728 \
589static int ftrace_raw_reg_event_##call(void *ptr) \ 729static int ftrace_raw_reg_event_##call(struct ftrace_event_call *unused)\
590{ \ 730{ \
591 int ret; \ 731 int ret; \
592 \ 732 \
@@ -597,7 +737,7 @@ static int ftrace_raw_reg_event_##call(void *ptr) \
597 return ret; \ 737 return ret; \
598} \ 738} \
599 \ 739 \
600static void ftrace_raw_unreg_event_##call(void *ptr) \ 740static void ftrace_raw_unreg_event_##call(struct ftrace_event_call *unused)\
601{ \ 741{ \
602 unregister_trace_##call(ftrace_raw_event_##call); \ 742 unregister_trace_##call(ftrace_raw_event_##call); \
603} \ 743} \
@@ -606,7 +746,7 @@ static struct trace_event ftrace_event_type_##call = { \
606 .trace = ftrace_raw_output_##call, \ 746 .trace = ftrace_raw_output_##call, \
607}; \ 747}; \
608 \ 748 \
609static int ftrace_raw_init_event_##call(void) \ 749static int ftrace_raw_init_event_##call(struct ftrace_event_call *unused)\
610{ \ 750{ \
611 int id; \ 751 int id; \
612 \ 752 \
@@ -616,7 +756,36 @@ static int ftrace_raw_init_event_##call(void) \
616 event_##call.id = id; \ 756 event_##call.id = id; \
617 INIT_LIST_HEAD(&event_##call.fields); \ 757 INIT_LIST_HEAD(&event_##call.fields); \
618 return 0; \ 758 return 0; \
619} \ 759}
760
761#undef DEFINE_EVENT_PRINT
762#define DEFINE_EVENT_PRINT(template, name, proto, args, print) \
763 DEFINE_EVENT(template, name, PARAMS(proto), PARAMS(args))
764
765#include TRACE_INCLUDE(TRACE_INCLUDE_FILE)
766
767#undef DECLARE_EVENT_CLASS
768#define DECLARE_EVENT_CLASS(call, proto, args, tstruct, assign, print)
769
770#undef DEFINE_EVENT
771#define DEFINE_EVENT(template, call, proto, args) \
772 \
773static struct ftrace_event_call __used \
774__attribute__((__aligned__(4))) \
775__attribute__((section("_ftrace_events"))) event_##call = { \
776 .name = #call, \
777 .system = __stringify(TRACE_SYSTEM), \
778 .event = &ftrace_event_type_##call, \
779 .raw_init = ftrace_raw_init_event_##call, \
780 .regfunc = ftrace_raw_reg_event_##call, \
781 .unregfunc = ftrace_raw_unreg_event_##call, \
782 .show_format = ftrace_format_##template, \
783 .define_fields = ftrace_define_fields_##template, \
784 _TRACE_PROFILE_INIT(call) \
785}
786
787#undef DEFINE_EVENT_PRINT
788#define DEFINE_EVENT_PRINT(template, call, proto, args, print) \
620 \ 789 \
621static struct ftrace_event_call __used \ 790static struct ftrace_event_call __used \
622__attribute__((__aligned__(4))) \ 791__attribute__((__aligned__(4))) \
@@ -628,7 +797,7 @@ __attribute__((section("_ftrace_events"))) event_##call = { \
628 .regfunc = ftrace_raw_reg_event_##call, \ 797 .regfunc = ftrace_raw_reg_event_##call, \
629 .unregfunc = ftrace_raw_unreg_event_##call, \ 798 .unregfunc = ftrace_raw_unreg_event_##call, \
630 .show_format = ftrace_format_##call, \ 799 .show_format = ftrace_format_##call, \
631 .define_fields = ftrace_define_fields_##call, \ 800 .define_fields = ftrace_define_fields_##template, \
632 _TRACE_PROFILE_INIT(call) \ 801 _TRACE_PROFILE_INIT(call) \
633} 802}
634 803
@@ -646,6 +815,7 @@ __attribute__((section("_ftrace_events"))) event_##call = { \
646 * struct ftrace_event_call *event_call = &event_<call>; 815 * struct ftrace_event_call *event_call = &event_<call>;
647 * extern void perf_tp_event(int, u64, u64, void *, int); 816 * extern void perf_tp_event(int, u64, u64, void *, int);
648 * struct ftrace_raw_##call *entry; 817 * struct ftrace_raw_##call *entry;
818 * struct perf_trace_buf *trace_buf;
649 * u64 __addr = 0, __count = 1; 819 * u64 __addr = 0, __count = 1;
650 * unsigned long irq_flags; 820 * unsigned long irq_flags;
651 * struct trace_entry *ent; 821 * struct trace_entry *ent;
@@ -670,14 +840,25 @@ __attribute__((section("_ftrace_events"))) event_##call = { \
670 * __cpu = smp_processor_id(); 840 * __cpu = smp_processor_id();
671 * 841 *
672 * if (in_nmi()) 842 * if (in_nmi())
673 * raw_data = rcu_dereference(trace_profile_buf_nmi); 843 * trace_buf = rcu_dereference(perf_trace_buf_nmi);
674 * else 844 * else
675 * raw_data = rcu_dereference(trace_profile_buf); 845 * trace_buf = rcu_dereference(perf_trace_buf);
676 * 846 *
677 * if (!raw_data) 847 * if (!trace_buf)
678 * goto end; 848 * goto end;
679 * 849 *
680 * raw_data = per_cpu_ptr(raw_data, __cpu); 850 * trace_buf = per_cpu_ptr(trace_buf, __cpu);
851 *
852 * // Avoid recursion from perf that could mess up the buffer
853 * if (trace_buf->recursion++)
854 * goto end_recursion;
855 *
856 * raw_data = trace_buf->buf;
857 *
858 * // Make recursion update visible before entering perf_tp_event
859 * // so that we protect from perf recursions.
860 *
861 * barrier();
681 * 862 *
682 * //zero dead bytes from alignment to avoid stack leak to userspace: 863 * //zero dead bytes from alignment to avoid stack leak to userspace:
683 * *(u64 *)(&raw_data[__entry_size - sizeof(u64)]) = 0ULL; 864 * *(u64 *)(&raw_data[__entry_size - sizeof(u64)]) = 0ULL;
@@ -704,21 +885,26 @@ __attribute__((section("_ftrace_events"))) event_##call = { \
704#undef __perf_count 885#undef __perf_count
705#define __perf_count(c) __count = (c) 886#define __perf_count(c) __count = (c)
706 887
707#undef TRACE_EVENT 888#undef DECLARE_EVENT_CLASS
708#define TRACE_EVENT(call, proto, args, tstruct, assign, print) \ 889#define DECLARE_EVENT_CLASS(call, proto, args, tstruct, assign, print) \
709static void ftrace_profile_##call(proto) \ 890static void \
891ftrace_profile_templ_##call(struct ftrace_event_call *event_call, \
892 proto) \
710{ \ 893{ \
711 struct ftrace_data_offsets_##call __maybe_unused __data_offsets;\ 894 struct ftrace_data_offsets_##call __maybe_unused __data_offsets;\
712 struct ftrace_event_call *event_call = &event_##call; \ 895 extern int perf_swevent_get_recursion_context(void); \
713 extern void perf_tp_event(int, u64, u64, void *, int); \ 896 extern void perf_swevent_put_recursion_context(int rctx); \
897 extern void perf_tp_event(int, u64, u64, void *, int); \
714 struct ftrace_raw_##call *entry; \ 898 struct ftrace_raw_##call *entry; \
715 u64 __addr = 0, __count = 1; \ 899 u64 __addr = 0, __count = 1; \
716 unsigned long irq_flags; \ 900 unsigned long irq_flags; \
717 struct trace_entry *ent; \ 901 struct trace_entry *ent; \
718 int __entry_size; \ 902 int __entry_size; \
719 int __data_size; \ 903 int __data_size; \
904 char *trace_buf; \
720 char *raw_data; \ 905 char *raw_data; \
721 int __cpu; \ 906 int __cpu; \
907 int rctx; \
722 int pc; \ 908 int pc; \
723 \ 909 \
724 pc = preempt_count(); \ 910 pc = preempt_count(); \
@@ -733,17 +919,22 @@ static void ftrace_profile_##call(proto) \
733 return; \ 919 return; \
734 \ 920 \
735 local_irq_save(irq_flags); \ 921 local_irq_save(irq_flags); \
922 \
923 rctx = perf_swevent_get_recursion_context(); \
924 if (rctx < 0) \
925 goto end_recursion; \
926 \
736 __cpu = smp_processor_id(); \ 927 __cpu = smp_processor_id(); \
737 \ 928 \
738 if (in_nmi()) \ 929 if (in_nmi()) \
739 raw_data = rcu_dereference(trace_profile_buf_nmi); \ 930 trace_buf = rcu_dereference(perf_trace_buf_nmi); \
740 else \ 931 else \
741 raw_data = rcu_dereference(trace_profile_buf); \ 932 trace_buf = rcu_dereference(perf_trace_buf); \
742 \ 933 \
743 if (!raw_data) \ 934 if (!trace_buf) \
744 goto end; \ 935 goto end; \
745 \ 936 \
746 raw_data = per_cpu_ptr(raw_data, __cpu); \ 937 raw_data = per_cpu_ptr(trace_buf, __cpu); \
747 \ 938 \
748 *(u64 *)(&raw_data[__entry_size - sizeof(u64)]) = 0ULL; \ 939 *(u64 *)(&raw_data[__entry_size - sizeof(u64)]) = 0ULL; \
749 entry = (struct ftrace_raw_##call *)raw_data; \ 940 entry = (struct ftrace_raw_##call *)raw_data; \
@@ -759,10 +950,25 @@ static void ftrace_profile_##call(proto) \
759 __entry_size); \ 950 __entry_size); \
760 \ 951 \
761end: \ 952end: \
953 perf_swevent_put_recursion_context(rctx); \
954end_recursion: \
762 local_irq_restore(irq_flags); \ 955 local_irq_restore(irq_flags); \
763 \ 956 \
764} 957}
765 958
959#undef DEFINE_EVENT
960#define DEFINE_EVENT(template, call, proto, args) \
961static void ftrace_profile_##call(proto) \
962{ \
963 struct ftrace_event_call *event_call = &event_##call; \
964 \
965 ftrace_profile_templ_##template(event_call, args); \
966}
967
968#undef DEFINE_EVENT_PRINT
969#define DEFINE_EVENT_PRINT(template, name, proto, args, print) \
970 DEFINE_EVENT(template, name, PARAMS(proto), PARAMS(args))
971
766#include TRACE_INCLUDE(TRACE_INCLUDE_FILE) 972#include TRACE_INCLUDE(TRACE_INCLUDE_FILE)
767#endif /* CONFIG_EVENT_PROFILE */ 973#endif /* CONFIG_EVENT_PROFILE */
768 974
diff --git a/include/trace/power.h b/include/trace/power.h
deleted file mode 100644
index ef204666e983..000000000000
--- a/include/trace/power.h
+++ /dev/null
@@ -1,32 +0,0 @@
1#ifndef _TRACE_POWER_H
2#define _TRACE_POWER_H
3
4#include <linux/ktime.h>
5#include <linux/tracepoint.h>
6
7enum {
8 POWER_NONE = 0,
9 POWER_CSTATE = 1,
10 POWER_PSTATE = 2,
11};
12
13struct power_trace {
14 ktime_t stamp;
15 ktime_t end;
16 int type;
17 int state;
18};
19
20DECLARE_TRACE(power_start,
21 TP_PROTO(struct power_trace *it, unsigned int type, unsigned int state),
22 TP_ARGS(it, type, state));
23
24DECLARE_TRACE(power_mark,
25 TP_PROTO(struct power_trace *it, unsigned int type, unsigned int state),
26 TP_ARGS(it, type, state));
27
28DECLARE_TRACE(power_end,
29 TP_PROTO(struct power_trace *it),
30 TP_ARGS(it));
31
32#endif /* _TRACE_POWER_H */
diff --git a/include/trace/syscall.h b/include/trace/syscall.h
index 5dc283ba5ae0..961fda3556bb 100644
--- a/include/trace/syscall.h
+++ b/include/trace/syscall.h
@@ -12,51 +12,48 @@
12 * A syscall entry in the ftrace syscalls array. 12 * A syscall entry in the ftrace syscalls array.
13 * 13 *
14 * @name: name of the syscall 14 * @name: name of the syscall
15 * @syscall_nr: number of the syscall
15 * @nb_args: number of parameters it takes 16 * @nb_args: number of parameters it takes
16 * @types: list of types as strings 17 * @types: list of types as strings
17 * @args: list of args as strings (args[i] matches types[i]) 18 * @args: list of args as strings (args[i] matches types[i])
18 * @enter_id: associated ftrace enter event id
19 * @exit_id: associated ftrace exit event id
20 * @enter_event: associated syscall_enter trace event 19 * @enter_event: associated syscall_enter trace event
21 * @exit_event: associated syscall_exit trace event 20 * @exit_event: associated syscall_exit trace event
22 */ 21 */
23struct syscall_metadata { 22struct syscall_metadata {
24 const char *name; 23 const char *name;
24 int syscall_nr;
25 int nb_args; 25 int nb_args;
26 const char **types; 26 const char **types;
27 const char **args; 27 const char **args;
28 int enter_id;
29 int exit_id;
30 28
31 struct ftrace_event_call *enter_event; 29 struct ftrace_event_call *enter_event;
32 struct ftrace_event_call *exit_event; 30 struct ftrace_event_call *exit_event;
33}; 31};
34 32
35#ifdef CONFIG_FTRACE_SYSCALLS 33#ifdef CONFIG_FTRACE_SYSCALLS
36extern struct syscall_metadata *syscall_nr_to_meta(int nr); 34extern unsigned long arch_syscall_addr(int nr);
37extern int syscall_name_to_nr(char *name); 35extern int init_syscall_trace(struct ftrace_event_call *call);
38void set_syscall_enter_id(int num, int id); 36
39void set_syscall_exit_id(int num, int id);
40extern struct trace_event event_syscall_enter;
41extern struct trace_event event_syscall_exit;
42extern int reg_event_syscall_enter(void *ptr);
43extern void unreg_event_syscall_enter(void *ptr);
44extern int reg_event_syscall_exit(void *ptr);
45extern void unreg_event_syscall_exit(void *ptr);
46extern int syscall_enter_format(struct ftrace_event_call *call, 37extern int syscall_enter_format(struct ftrace_event_call *call,
47 struct trace_seq *s); 38 struct trace_seq *s);
48extern int syscall_exit_format(struct ftrace_event_call *call, 39extern int syscall_exit_format(struct ftrace_event_call *call,
49 struct trace_seq *s); 40 struct trace_seq *s);
50extern int syscall_enter_define_fields(struct ftrace_event_call *call); 41extern int syscall_enter_define_fields(struct ftrace_event_call *call);
51extern int syscall_exit_define_fields(struct ftrace_event_call *call); 42extern int syscall_exit_define_fields(struct ftrace_event_call *call);
43extern int reg_event_syscall_enter(struct ftrace_event_call *call);
44extern void unreg_event_syscall_enter(struct ftrace_event_call *call);
45extern int reg_event_syscall_exit(struct ftrace_event_call *call);
46extern void unreg_event_syscall_exit(struct ftrace_event_call *call);
47extern int
48ftrace_format_syscall(struct ftrace_event_call *call, struct trace_seq *s);
52enum print_line_t print_syscall_enter(struct trace_iterator *iter, int flags); 49enum print_line_t print_syscall_enter(struct trace_iterator *iter, int flags);
53enum print_line_t print_syscall_exit(struct trace_iterator *iter, int flags); 50enum print_line_t print_syscall_exit(struct trace_iterator *iter, int flags);
54#endif 51#endif
55#ifdef CONFIG_EVENT_PROFILE 52#ifdef CONFIG_EVENT_PROFILE
56int reg_prof_syscall_enter(char *name); 53int prof_sysenter_enable(struct ftrace_event_call *call);
57void unreg_prof_syscall_enter(char *name); 54void prof_sysenter_disable(struct ftrace_event_call *call);
58int reg_prof_syscall_exit(char *name); 55int prof_sysexit_enable(struct ftrace_event_call *call);
59void unreg_prof_syscall_exit(char *name); 56void prof_sysexit_disable(struct ftrace_event_call *call);
60 57
61#endif 58#endif
62 59
diff --git a/init/Kconfig b/init/Kconfig
index f51586406d62..9ee778294756 100644
--- a/init/Kconfig
+++ b/init/Kconfig
@@ -334,6 +334,15 @@ config TREE_PREEMPT_RCU
334 is also required. It also scales down nicely to 334 is also required. It also scales down nicely to
335 smaller systems. 335 smaller systems.
336 336
337config TINY_RCU
338 bool "UP-only small-memory-footprint RCU"
339 depends on !SMP
340 help
341 This option selects the RCU implementation that is
342 designed for UP systems from which real-time response
343 is not required. This option greatly reduces the
344 memory footprint of RCU.
345
337endchoice 346endchoice
338 347
339config RCU_TRACE 348config RCU_TRACE
@@ -606,7 +615,7 @@ config SYSFS_DEPRECATED
606 bool 615 bool
607 616
608config SYSFS_DEPRECATED_V2 617config SYSFS_DEPRECATED_V2
609 bool "remove sysfs features which may confuse old userspace tools" 618 bool "enable deprecated sysfs features which may confuse old userspace tools"
610 depends on SYSFS 619 depends on SYSFS
611 default n 620 default n
612 select SYSFS_DEPRECATED 621 select SYSFS_DEPRECATED
@@ -937,7 +946,7 @@ config PERF_EVENTS
937 Enable kernel support for various performance events provided 946 Enable kernel support for various performance events provided
938 by software and hardware. 947 by software and hardware.
939 948
940 Software events are supported either build-in or via the 949 Software events are supported either built-in or via the
941 use of generic tracepoints. 950 use of generic tracepoints.
942 951
943 Most modern CPUs support performance events via performance 952 Most modern CPUs support performance events via performance
@@ -949,7 +958,7 @@ config PERF_EVENTS
949 used to profile the code that runs on that CPU. 958 used to profile the code that runs on that CPU.
950 959
951 The Linux Performance Event subsystem provides an abstraction of 960 The Linux Performance Event subsystem provides an abstraction of
952 these software and hardware cevent apabilities, available via a 961 these software and hardware event capabilities, available via a
953 system call and used by the "perf" utility in tools/perf/. It 962 system call and used by the "perf" utility in tools/perf/. It
954 provides per task and per CPU counters, and it provides event 963 provides per task and per CPU counters, and it provides event
955 capabilities on top of those. 964 capabilities on top of those.
@@ -1098,6 +1107,16 @@ config SLOW_WORK
1098 1107
1099 See Documentation/slow-work.txt. 1108 See Documentation/slow-work.txt.
1100 1109
1110config SLOW_WORK_DEBUG
1111 bool "Slow work debugging through debugfs"
1112 default n
1113 depends on SLOW_WORK && DEBUG_FS
1114 help
1115 Display the contents of the slow work run queue through debugfs,
1116 including items currently executing.
1117
1118 See Documentation/slow-work.txt.
1119
1101endmenu # General setup 1120endmenu # General setup
1102 1121
1103config HAVE_GENERIC_DMA_COHERENT 1122config HAVE_GENERIC_DMA_COHERENT
@@ -1210,3 +1229,4 @@ source "block/Kconfig"
1210config PREEMPT_NOTIFIERS 1229config PREEMPT_NOTIFIERS
1211 bool 1230 bool
1212 1231
1232source "kernel/Kconfig.locks"
diff --git a/init/main.c b/init/main.c
index 5988debfc505..4051d75dd2d6 100644
--- a/init/main.c
+++ b/init/main.c
@@ -251,7 +251,7 @@ early_param("loglevel", loglevel);
251 251
252/* 252/*
253 * Unknown boot options get handed to init, unless they look like 253 * Unknown boot options get handed to init, unless they look like
254 * failed parameters 254 * unused parameters (modprobe will find them in /proc/cmdline).
255 */ 255 */
256static int __init unknown_bootoption(char *param, char *val) 256static int __init unknown_bootoption(char *param, char *val)
257{ 257{
@@ -272,14 +272,9 @@ static int __init unknown_bootoption(char *param, char *val)
272 if (obsolete_checksetup(param)) 272 if (obsolete_checksetup(param))
273 return 0; 273 return 0;
274 274
275 /* 275 /* Unused module parameter. */
276 * Preemptive maintenance for "why didn't my misspelled command 276 if (strchr(param, '.') && (!val || strchr(param, '.') < val))
277 * line work?"
278 */
279 if (strchr(param, '.') && (!val || strchr(param, '.') < val)) {
280 printk(KERN_ERR "Unknown boot option `%s': ignoring\n", param);
281 return 0; 277 return 0;
282 }
283 278
284 if (panic_later) 279 if (panic_later)
285 return 0; 280 return 0;
diff --git a/kernel/Kconfig.locks b/kernel/Kconfig.locks
new file mode 100644
index 000000000000..88c92fb44618
--- /dev/null
+++ b/kernel/Kconfig.locks
@@ -0,0 +1,202 @@
1#
2# The ARCH_INLINE foo is necessary because select ignores "depends on"
3#
4config ARCH_INLINE_SPIN_TRYLOCK
5 bool
6
7config ARCH_INLINE_SPIN_TRYLOCK_BH
8 bool
9
10config ARCH_INLINE_SPIN_LOCK
11 bool
12
13config ARCH_INLINE_SPIN_LOCK_BH
14 bool
15
16config ARCH_INLINE_SPIN_LOCK_IRQ
17 bool
18
19config ARCH_INLINE_SPIN_LOCK_IRQSAVE
20 bool
21
22config ARCH_INLINE_SPIN_UNLOCK
23 bool
24
25config ARCH_INLINE_SPIN_UNLOCK_BH
26 bool
27
28config ARCH_INLINE_SPIN_UNLOCK_IRQ
29 bool
30
31config ARCH_INLINE_SPIN_UNLOCK_IRQRESTORE
32 bool
33
34
35config ARCH_INLINE_READ_TRYLOCK
36 bool
37
38config ARCH_INLINE_READ_LOCK
39 bool
40
41config ARCH_INLINE_READ_LOCK_BH
42 bool
43
44config ARCH_INLINE_READ_LOCK_IRQ
45 bool
46
47config ARCH_INLINE_READ_LOCK_IRQSAVE
48 bool
49
50config ARCH_INLINE_READ_UNLOCK
51 bool
52
53config ARCH_INLINE_READ_UNLOCK_BH
54 bool
55
56config ARCH_INLINE_READ_UNLOCK_IRQ
57 bool
58
59config ARCH_INLINE_READ_UNLOCK_IRQRESTORE
60 bool
61
62
63config ARCH_INLINE_WRITE_TRYLOCK
64 bool
65
66config ARCH_INLINE_WRITE_LOCK
67 bool
68
69config ARCH_INLINE_WRITE_LOCK_BH
70 bool
71
72config ARCH_INLINE_WRITE_LOCK_IRQ
73 bool
74
75config ARCH_INLINE_WRITE_LOCK_IRQSAVE
76 bool
77
78config ARCH_INLINE_WRITE_UNLOCK
79 bool
80
81config ARCH_INLINE_WRITE_UNLOCK_BH
82 bool
83
84config ARCH_INLINE_WRITE_UNLOCK_IRQ
85 bool
86
87config ARCH_INLINE_WRITE_UNLOCK_IRQRESTORE
88 bool
89
90#
91# lock_* functions are inlined when:
92# - DEBUG_SPINLOCK=n and GENERIC_LOCKBREAK=n and ARCH_INLINE_*LOCK=y
93#
94# trylock_* functions are inlined when:
95# - DEBUG_SPINLOCK=n and ARCH_INLINE_*LOCK=y
96#
97# unlock and unlock_irq functions are inlined when:
98# - DEBUG_SPINLOCK=n and ARCH_INLINE_*LOCK=y
99# or
100# - DEBUG_SPINLOCK=n and PREEMPT=n
101#
102# unlock_bh and unlock_irqrestore functions are inlined when:
103# - DEBUG_SPINLOCK=n and ARCH_INLINE_*LOCK=y
104#
105
106config INLINE_SPIN_TRYLOCK
107 def_bool !DEBUG_SPINLOCK && ARCH_INLINE_SPIN_TRYLOCK
108
109config INLINE_SPIN_TRYLOCK_BH
110 def_bool !DEBUG_SPINLOCK && ARCH_INLINE_SPIN_TRYLOCK_BH
111
112config INLINE_SPIN_LOCK
113 def_bool !DEBUG_SPINLOCK && !GENERIC_LOCKBREAK && ARCH_INLINE_SPIN_LOCK
114
115config INLINE_SPIN_LOCK_BH
116 def_bool !DEBUG_SPINLOCK && !GENERIC_LOCKBREAK && \
117 ARCH_INLINE_SPIN_LOCK_BH
118
119config INLINE_SPIN_LOCK_IRQ
120 def_bool !DEBUG_SPINLOCK && !GENERIC_LOCKBREAK && \
121 ARCH_INLINE_SPIN_LOCK_IRQ
122
123config INLINE_SPIN_LOCK_IRQSAVE
124 def_bool !DEBUG_SPINLOCK && !GENERIC_LOCKBREAK && \
125 ARCH_INLINE_SPIN_LOCK_IRQSAVE
126
127config INLINE_SPIN_UNLOCK
128 def_bool !DEBUG_SPINLOCK && (!PREEMPT || ARCH_INLINE_SPIN_UNLOCK)
129
130config INLINE_SPIN_UNLOCK_BH
131 def_bool !DEBUG_SPINLOCK && ARCH_INLINE_SPIN_UNLOCK_BH
132
133config INLINE_SPIN_UNLOCK_IRQ
134 def_bool !DEBUG_SPINLOCK && (!PREEMPT || ARCH_INLINE_SPIN_UNLOCK_BH)
135
136config INLINE_SPIN_UNLOCK_IRQRESTORE
137 def_bool !DEBUG_SPINLOCK && ARCH_INLINE_SPIN_UNLOCK_IRQRESTORE
138
139
140config INLINE_READ_TRYLOCK
141 def_bool !DEBUG_SPINLOCK && ARCH_INLINE_READ_TRYLOCK
142
143config INLINE_READ_LOCK
144 def_bool !DEBUG_SPINLOCK && !GENERIC_LOCKBREAK && ARCH_INLINE_READ_LOCK
145
146config INLINE_READ_LOCK_BH
147 def_bool !DEBUG_SPINLOCK && !GENERIC_LOCKBREAK && \
148 ARCH_INLINE_READ_LOCK_BH
149
150config INLINE_READ_LOCK_IRQ
151 def_bool !DEBUG_SPINLOCK && !GENERIC_LOCKBREAK && \
152 ARCH_INLINE_READ_LOCK_IRQ
153
154config INLINE_READ_LOCK_IRQSAVE
155 def_bool !DEBUG_SPINLOCK && !GENERIC_LOCKBREAK && \
156 ARCH_INLINE_READ_LOCK_IRQSAVE
157
158config INLINE_READ_UNLOCK
159 def_bool !DEBUG_SPINLOCK && (!PREEMPT || ARCH_INLINE_READ_UNLOCK)
160
161config INLINE_READ_UNLOCK_BH
162 def_bool !DEBUG_SPINLOCK && ARCH_INLINE_READ_UNLOCK_BH
163
164config INLINE_READ_UNLOCK_IRQ
165 def_bool !DEBUG_SPINLOCK && (!PREEMPT || ARCH_INLINE_READ_UNLOCK_BH)
166
167config INLINE_READ_UNLOCK_IRQRESTORE
168 def_bool !DEBUG_SPINLOCK && ARCH_INLINE_READ_UNLOCK_IRQRESTORE
169
170
171config INLINE_WRITE_TRYLOCK
172 def_bool !DEBUG_SPINLOCK && ARCH_INLINE_WRITE_TRYLOCK
173
174config INLINE_WRITE_LOCK
175 def_bool !DEBUG_SPINLOCK && !GENERIC_LOCKBREAK && ARCH_INLINE_WRITE_LOCK
176
177config INLINE_WRITE_LOCK_BH
178 def_bool !DEBUG_SPINLOCK && !GENERIC_LOCKBREAK && \
179 ARCH_INLINE_WRITE_LOCK_BH
180
181config INLINE_WRITE_LOCK_IRQ
182 def_bool !DEBUG_SPINLOCK && !GENERIC_LOCKBREAK && \
183 ARCH_INLINE_WRITE_LOCK_IRQ
184
185config INLINE_WRITE_LOCK_IRQSAVE
186 def_bool !DEBUG_SPINLOCK && !GENERIC_LOCKBREAK && \
187 ARCH_INLINE_WRITE_LOCK_IRQSAVE
188
189config INLINE_WRITE_UNLOCK
190 def_bool !DEBUG_SPINLOCK && (!PREEMPT || ARCH_INLINE_WRITE_UNLOCK)
191
192config INLINE_WRITE_UNLOCK_BH
193 def_bool !DEBUG_SPINLOCK && ARCH_INLINE_WRITE_UNLOCK_BH
194
195config INLINE_WRITE_UNLOCK_IRQ
196 def_bool !DEBUG_SPINLOCK && (!PREEMPT || ARCH_INLINE_WRITE_UNLOCK_BH)
197
198config INLINE_WRITE_UNLOCK_IRQRESTORE
199 def_bool !DEBUG_SPINLOCK && ARCH_INLINE_WRITE_UNLOCK_IRQRESTORE
200
201config MUTEX_SPIN_ON_OWNER
202 def_bool SMP && !DEBUG_MUTEXES && !HAVE_DEFAULT_NO_SPIN_MUTEXES
diff --git a/kernel/Makefile b/kernel/Makefile
index b8d4cd8ac0b9..982c50e2ce53 100644
--- a/kernel/Makefile
+++ b/kernel/Makefile
@@ -21,6 +21,7 @@ CFLAGS_REMOVE_mutex-debug.o = -pg
21CFLAGS_REMOVE_rtmutex-debug.o = -pg 21CFLAGS_REMOVE_rtmutex-debug.o = -pg
22CFLAGS_REMOVE_cgroup-debug.o = -pg 22CFLAGS_REMOVE_cgroup-debug.o = -pg
23CFLAGS_REMOVE_sched_clock.o = -pg 23CFLAGS_REMOVE_sched_clock.o = -pg
24CFLAGS_REMOVE_perf_event.o = -pg
24endif 25endif
25 26
26obj-$(CONFIG_FREEZER) += freezer.o 27obj-$(CONFIG_FREEZER) += freezer.o
@@ -82,6 +83,7 @@ obj-$(CONFIG_RCU_TORTURE_TEST) += rcutorture.o
82obj-$(CONFIG_TREE_RCU) += rcutree.o 83obj-$(CONFIG_TREE_RCU) += rcutree.o
83obj-$(CONFIG_TREE_PREEMPT_RCU) += rcutree.o 84obj-$(CONFIG_TREE_PREEMPT_RCU) += rcutree.o
84obj-$(CONFIG_TREE_RCU_TRACE) += rcutree_trace.o 85obj-$(CONFIG_TREE_RCU_TRACE) += rcutree_trace.o
86obj-$(CONFIG_TINY_RCU) += rcutiny.o
85obj-$(CONFIG_RELAY) += relay.o 87obj-$(CONFIG_RELAY) += relay.o
86obj-$(CONFIG_SYSCTL) += utsname_sysctl.o 88obj-$(CONFIG_SYSCTL) += utsname_sysctl.o
87obj-$(CONFIG_TASK_DELAY_ACCT) += delayacct.o 89obj-$(CONFIG_TASK_DELAY_ACCT) += delayacct.o
@@ -94,7 +96,9 @@ obj-$(CONFIG_X86_DS) += trace/
94obj-$(CONFIG_RING_BUFFER) += trace/ 96obj-$(CONFIG_RING_BUFFER) += trace/
95obj-$(CONFIG_SMP) += sched_cpupri.o 97obj-$(CONFIG_SMP) += sched_cpupri.o
96obj-$(CONFIG_SLOW_WORK) += slow-work.o 98obj-$(CONFIG_SLOW_WORK) += slow-work.o
99obj-$(CONFIG_SLOW_WORK_DEBUG) += slow-work-debugfs.o
97obj-$(CONFIG_PERF_EVENTS) += perf_event.o 100obj-$(CONFIG_PERF_EVENTS) += perf_event.o
101obj-$(CONFIG_HAVE_HW_BREAKPOINT) += hw_breakpoint.o
98 102
99ifneq ($(CONFIG_SCHED_OMIT_FRAME_POINTER),y) 103ifneq ($(CONFIG_SCHED_OMIT_FRAME_POINTER),y)
100# According to Alan Modra <alan@linuxcare.com.au>, the -fno-omit-frame-pointer is 104# According to Alan Modra <alan@linuxcare.com.au>, the -fno-omit-frame-pointer is
diff --git a/kernel/capability.c b/kernel/capability.c
index 4e17041963f5..7f876e60521f 100644
--- a/kernel/capability.c
+++ b/kernel/capability.c
@@ -29,7 +29,6 @@ EXPORT_SYMBOL(__cap_empty_set);
29EXPORT_SYMBOL(__cap_full_set); 29EXPORT_SYMBOL(__cap_full_set);
30EXPORT_SYMBOL(__cap_init_eff_set); 30EXPORT_SYMBOL(__cap_init_eff_set);
31 31
32#ifdef CONFIG_SECURITY_FILE_CAPABILITIES
33int file_caps_enabled = 1; 32int file_caps_enabled = 1;
34 33
35static int __init file_caps_disable(char *str) 34static int __init file_caps_disable(char *str)
@@ -38,7 +37,6 @@ static int __init file_caps_disable(char *str)
38 return 1; 37 return 1;
39} 38}
40__setup("no_file_caps", file_caps_disable); 39__setup("no_file_caps", file_caps_disable);
41#endif
42 40
43/* 41/*
44 * More recent versions of libcap are available from: 42 * More recent versions of libcap are available from:
@@ -169,8 +167,8 @@ SYSCALL_DEFINE2(capget, cap_user_header_t, header, cap_user_data_t, dataptr)
169 kernel_cap_t pE, pI, pP; 167 kernel_cap_t pE, pI, pP;
170 168
171 ret = cap_validate_magic(header, &tocopy); 169 ret = cap_validate_magic(header, &tocopy);
172 if (ret != 0) 170 if ((dataptr == NULL) || (ret != 0))
173 return ret; 171 return ((dataptr == NULL) && (ret == -EINVAL)) ? 0 : ret;
174 172
175 if (get_user(pid, &header->pid)) 173 if (get_user(pid, &header->pid))
176 return -EFAULT; 174 return -EFAULT;
@@ -238,7 +236,7 @@ SYSCALL_DEFINE2(capget, cap_user_header_t, header, cap_user_data_t, dataptr)
238SYSCALL_DEFINE2(capset, cap_user_header_t, header, const cap_user_data_t, data) 236SYSCALL_DEFINE2(capset, cap_user_header_t, header, const cap_user_data_t, data)
239{ 237{
240 struct __user_cap_data_struct kdata[_KERNEL_CAPABILITY_U32S]; 238 struct __user_cap_data_struct kdata[_KERNEL_CAPABILITY_U32S];
241 unsigned i, tocopy; 239 unsigned i, tocopy, copybytes;
242 kernel_cap_t inheritable, permitted, effective; 240 kernel_cap_t inheritable, permitted, effective;
243 struct cred *new; 241 struct cred *new;
244 int ret; 242 int ret;
@@ -255,8 +253,11 @@ SYSCALL_DEFINE2(capset, cap_user_header_t, header, const cap_user_data_t, data)
255 if (pid != 0 && pid != task_pid_vnr(current)) 253 if (pid != 0 && pid != task_pid_vnr(current))
256 return -EPERM; 254 return -EPERM;
257 255
258 if (copy_from_user(&kdata, data, 256 copybytes = tocopy * sizeof(struct __user_cap_data_struct);
259 tocopy * sizeof(struct __user_cap_data_struct))) 257 if (copybytes > sizeof(kdata))
258 return -EFAULT;
259
260 if (copy_from_user(&kdata, data, copybytes))
260 return -EFAULT; 261 return -EFAULT;
261 262
262 for (i = 0; i < tocopy; i++) { 263 for (i = 0; i < tocopy; i++) {
diff --git a/kernel/cpuset.c b/kernel/cpuset.c
index b5cb469d2545..3cf2183b472d 100644
--- a/kernel/cpuset.c
+++ b/kernel/cpuset.c
@@ -537,8 +537,7 @@ update_domain_attr_tree(struct sched_domain_attr *dattr, struct cpuset *c)
537 * element of the partition (one sched domain) to be passed to 537 * element of the partition (one sched domain) to be passed to
538 * partition_sched_domains(). 538 * partition_sched_domains().
539 */ 539 */
540/* FIXME: see the FIXME in partition_sched_domains() */ 540static int generate_sched_domains(cpumask_var_t **domains,
541static int generate_sched_domains(struct cpumask **domains,
542 struct sched_domain_attr **attributes) 541 struct sched_domain_attr **attributes)
543{ 542{
544 LIST_HEAD(q); /* queue of cpusets to be scanned */ 543 LIST_HEAD(q); /* queue of cpusets to be scanned */
@@ -546,7 +545,7 @@ static int generate_sched_domains(struct cpumask **domains,
546 struct cpuset **csa; /* array of all cpuset ptrs */ 545 struct cpuset **csa; /* array of all cpuset ptrs */
547 int csn; /* how many cpuset ptrs in csa so far */ 546 int csn; /* how many cpuset ptrs in csa so far */
548 int i, j, k; /* indices for partition finding loops */ 547 int i, j, k; /* indices for partition finding loops */
549 struct cpumask *doms; /* resulting partition; i.e. sched domains */ 548 cpumask_var_t *doms; /* resulting partition; i.e. sched domains */
550 struct sched_domain_attr *dattr; /* attributes for custom domains */ 549 struct sched_domain_attr *dattr; /* attributes for custom domains */
551 int ndoms = 0; /* number of sched domains in result */ 550 int ndoms = 0; /* number of sched domains in result */
552 int nslot; /* next empty doms[] struct cpumask slot */ 551 int nslot; /* next empty doms[] struct cpumask slot */
@@ -557,7 +556,8 @@ static int generate_sched_domains(struct cpumask **domains,
557 556
558 /* Special case for the 99% of systems with one, full, sched domain */ 557 /* Special case for the 99% of systems with one, full, sched domain */
559 if (is_sched_load_balance(&top_cpuset)) { 558 if (is_sched_load_balance(&top_cpuset)) {
560 doms = kmalloc(cpumask_size(), GFP_KERNEL); 559 ndoms = 1;
560 doms = alloc_sched_domains(ndoms);
561 if (!doms) 561 if (!doms)
562 goto done; 562 goto done;
563 563
@@ -566,9 +566,8 @@ static int generate_sched_domains(struct cpumask **domains,
566 *dattr = SD_ATTR_INIT; 566 *dattr = SD_ATTR_INIT;
567 update_domain_attr_tree(dattr, &top_cpuset); 567 update_domain_attr_tree(dattr, &top_cpuset);
568 } 568 }
569 cpumask_copy(doms, top_cpuset.cpus_allowed); 569 cpumask_copy(doms[0], top_cpuset.cpus_allowed);
570 570
571 ndoms = 1;
572 goto done; 571 goto done;
573 } 572 }
574 573
@@ -636,7 +635,7 @@ restart:
636 * Now we know how many domains to create. 635 * Now we know how many domains to create.
637 * Convert <csn, csa> to <ndoms, doms> and populate cpu masks. 636 * Convert <csn, csa> to <ndoms, doms> and populate cpu masks.
638 */ 637 */
639 doms = kmalloc(ndoms * cpumask_size(), GFP_KERNEL); 638 doms = alloc_sched_domains(ndoms);
640 if (!doms) 639 if (!doms)
641 goto done; 640 goto done;
642 641
@@ -656,7 +655,7 @@ restart:
656 continue; 655 continue;
657 } 656 }
658 657
659 dp = doms + nslot; 658 dp = doms[nslot];
660 659
661 if (nslot == ndoms) { 660 if (nslot == ndoms) {
662 static int warnings = 10; 661 static int warnings = 10;
@@ -718,7 +717,7 @@ done:
718static void do_rebuild_sched_domains(struct work_struct *unused) 717static void do_rebuild_sched_domains(struct work_struct *unused)
719{ 718{
720 struct sched_domain_attr *attr; 719 struct sched_domain_attr *attr;
721 struct cpumask *doms; 720 cpumask_var_t *doms;
722 int ndoms; 721 int ndoms;
723 722
724 get_online_cpus(); 723 get_online_cpus();
@@ -2052,7 +2051,7 @@ static int cpuset_track_online_cpus(struct notifier_block *unused_nb,
2052 unsigned long phase, void *unused_cpu) 2051 unsigned long phase, void *unused_cpu)
2053{ 2052{
2054 struct sched_domain_attr *attr; 2053 struct sched_domain_attr *attr;
2055 struct cpumask *doms; 2054 cpumask_var_t *doms;
2056 int ndoms; 2055 int ndoms;
2057 2056
2058 switch (phase) { 2057 switch (phase) {
@@ -2537,15 +2536,9 @@ const struct file_operations proc_cpuset_operations = {
2537}; 2536};
2538#endif /* CONFIG_PROC_PID_CPUSET */ 2537#endif /* CONFIG_PROC_PID_CPUSET */
2539 2538
2540/* Display task cpus_allowed, mems_allowed in /proc/<pid>/status file. */ 2539/* Display task mems_allowed in /proc/<pid>/status file. */
2541void cpuset_task_status_allowed(struct seq_file *m, struct task_struct *task) 2540void cpuset_task_status_allowed(struct seq_file *m, struct task_struct *task)
2542{ 2541{
2543 seq_printf(m, "Cpus_allowed:\t");
2544 seq_cpumask(m, &task->cpus_allowed);
2545 seq_printf(m, "\n");
2546 seq_printf(m, "Cpus_allowed_list:\t");
2547 seq_cpumask_list(m, &task->cpus_allowed);
2548 seq_printf(m, "\n");
2549 seq_printf(m, "Mems_allowed:\t"); 2542 seq_printf(m, "Mems_allowed:\t");
2550 seq_nodemask(m, &task->mems_allowed); 2543 seq_nodemask(m, &task->mems_allowed);
2551 seq_printf(m, "\n"); 2544 seq_printf(m, "\n");
diff --git a/kernel/exit.c b/kernel/exit.c
index f7864ac2ecc1..80ae941cfd2e 100644
--- a/kernel/exit.c
+++ b/kernel/exit.c
@@ -49,6 +49,7 @@
49#include <linux/init_task.h> 49#include <linux/init_task.h>
50#include <linux/perf_event.h> 50#include <linux/perf_event.h>
51#include <trace/events/sched.h> 51#include <trace/events/sched.h>
52#include <linux/hw_breakpoint.h>
52 53
53#include <asm/uaccess.h> 54#include <asm/uaccess.h>
54#include <asm/unistd.h> 55#include <asm/unistd.h>
@@ -110,9 +111,9 @@ static void __exit_signal(struct task_struct *tsk)
110 * We won't ever get here for the group leader, since it 111 * We won't ever get here for the group leader, since it
111 * will have been the last reference on the signal_struct. 112 * will have been the last reference on the signal_struct.
112 */ 113 */
113 sig->utime = cputime_add(sig->utime, task_utime(tsk)); 114 sig->utime = cputime_add(sig->utime, tsk->utime);
114 sig->stime = cputime_add(sig->stime, task_stime(tsk)); 115 sig->stime = cputime_add(sig->stime, tsk->stime);
115 sig->gtime = cputime_add(sig->gtime, task_gtime(tsk)); 116 sig->gtime = cputime_add(sig->gtime, tsk->gtime);
116 sig->min_flt += tsk->min_flt; 117 sig->min_flt += tsk->min_flt;
117 sig->maj_flt += tsk->maj_flt; 118 sig->maj_flt += tsk->maj_flt;
118 sig->nvcsw += tsk->nvcsw; 119 sig->nvcsw += tsk->nvcsw;
@@ -978,6 +979,10 @@ NORET_TYPE void do_exit(long code)
978 proc_exit_connector(tsk); 979 proc_exit_connector(tsk);
979 980
980 /* 981 /*
982 * FIXME: do that only when needed, using sched_exit tracepoint
983 */
984 flush_ptrace_hw_breakpoint(tsk);
985 /*
981 * Flush inherited counters to the parent - before the parent 986 * Flush inherited counters to the parent - before the parent
982 * gets woken up by child-exit notifications. 987 * gets woken up by child-exit notifications.
983 */ 988 */
@@ -1205,6 +1210,7 @@ static int wait_task_zombie(struct wait_opts *wo, struct task_struct *p)
1205 struct signal_struct *psig; 1210 struct signal_struct *psig;
1206 struct signal_struct *sig; 1211 struct signal_struct *sig;
1207 unsigned long maxrss; 1212 unsigned long maxrss;
1213 cputime_t tgutime, tgstime;
1208 1214
1209 /* 1215 /*
1210 * The resource counters for the group leader are in its 1216 * The resource counters for the group leader are in its
@@ -1220,20 +1226,23 @@ static int wait_task_zombie(struct wait_opts *wo, struct task_struct *p)
1220 * need to protect the access to parent->signal fields, 1226 * need to protect the access to parent->signal fields,
1221 * as other threads in the parent group can be right 1227 * as other threads in the parent group can be right
1222 * here reaping other children at the same time. 1228 * here reaping other children at the same time.
1229 *
1230 * We use thread_group_times() to get times for the thread
1231 * group, which consolidates times for all threads in the
1232 * group including the group leader.
1223 */ 1233 */
1234 thread_group_times(p, &tgutime, &tgstime);
1224 spin_lock_irq(&p->real_parent->sighand->siglock); 1235 spin_lock_irq(&p->real_parent->sighand->siglock);
1225 psig = p->real_parent->signal; 1236 psig = p->real_parent->signal;
1226 sig = p->signal; 1237 sig = p->signal;
1227 psig->cutime = 1238 psig->cutime =
1228 cputime_add(psig->cutime, 1239 cputime_add(psig->cutime,
1229 cputime_add(p->utime, 1240 cputime_add(tgutime,
1230 cputime_add(sig->utime, 1241 sig->cutime));
1231 sig->cutime)));
1232 psig->cstime = 1242 psig->cstime =
1233 cputime_add(psig->cstime, 1243 cputime_add(psig->cstime,
1234 cputime_add(p->stime, 1244 cputime_add(tgstime,
1235 cputime_add(sig->stime, 1245 sig->cstime));
1236 sig->cstime)));
1237 psig->cgtime = 1246 psig->cgtime =
1238 cputime_add(psig->cgtime, 1247 cputime_add(psig->cgtime,
1239 cputime_add(p->gtime, 1248 cputime_add(p->gtime,
diff --git a/kernel/fork.c b/kernel/fork.c
index 4c20fff8c13a..3d6f121bbe8a 100644
--- a/kernel/fork.c
+++ b/kernel/fork.c
@@ -91,7 +91,7 @@ int nr_processes(void)
91 int cpu; 91 int cpu;
92 int total = 0; 92 int total = 0;
93 93
94 for_each_online_cpu(cpu) 94 for_each_possible_cpu(cpu)
95 total += per_cpu(process_counts, cpu); 95 total += per_cpu(process_counts, cpu);
96 96
97 return total; 97 return total;
@@ -884,6 +884,9 @@ static int copy_signal(unsigned long clone_flags, struct task_struct *tsk)
884 sig->utime = sig->stime = sig->cutime = sig->cstime = cputime_zero; 884 sig->utime = sig->stime = sig->cutime = sig->cstime = cputime_zero;
885 sig->gtime = cputime_zero; 885 sig->gtime = cputime_zero;
886 sig->cgtime = cputime_zero; 886 sig->cgtime = cputime_zero;
887#ifndef CONFIG_VIRT_CPU_ACCOUNTING
888 sig->prev_utime = sig->prev_stime = cputime_zero;
889#endif
887 sig->nvcsw = sig->nivcsw = sig->cnvcsw = sig->cnivcsw = 0; 890 sig->nvcsw = sig->nivcsw = sig->cnvcsw = sig->cnivcsw = 0;
888 sig->min_flt = sig->maj_flt = sig->cmin_flt = sig->cmaj_flt = 0; 891 sig->min_flt = sig->maj_flt = sig->cmin_flt = sig->cmaj_flt = 0;
889 sig->inblock = sig->oublock = sig->cinblock = sig->coublock = 0; 892 sig->inblock = sig->oublock = sig->cinblock = sig->coublock = 0;
@@ -1066,8 +1069,10 @@ static struct task_struct *copy_process(unsigned long clone_flags,
1066 p->gtime = cputime_zero; 1069 p->gtime = cputime_zero;
1067 p->utimescaled = cputime_zero; 1070 p->utimescaled = cputime_zero;
1068 p->stimescaled = cputime_zero; 1071 p->stimescaled = cputime_zero;
1072#ifndef CONFIG_VIRT_CPU_ACCOUNTING
1069 p->prev_utime = cputime_zero; 1073 p->prev_utime = cputime_zero;
1070 p->prev_stime = cputime_zero; 1074 p->prev_stime = cputime_zero;
1075#endif
1071 1076
1072 p->default_timer_slack_ns = current->timer_slack_ns; 1077 p->default_timer_slack_ns = current->timer_slack_ns;
1073 1078
diff --git a/kernel/hung_task.c b/kernel/hung_task.c
index d4e841747400..0c642d51aac2 100644
--- a/kernel/hung_task.c
+++ b/kernel/hung_task.c
@@ -144,7 +144,7 @@ static void check_hung_uninterruptible_tasks(unsigned long timeout)
144 144
145 rcu_read_lock(); 145 rcu_read_lock();
146 do_each_thread(g, t) { 146 do_each_thread(g, t) {
147 if (!--max_count) 147 if (!max_count--)
148 goto unlock; 148 goto unlock;
149 if (!--batch_count) { 149 if (!--batch_count) {
150 batch_count = HUNG_TASK_BATCHING; 150 batch_count = HUNG_TASK_BATCHING;
diff --git a/kernel/hw_breakpoint.c b/kernel/hw_breakpoint.c
new file mode 100644
index 000000000000..cf5ee1628411
--- /dev/null
+++ b/kernel/hw_breakpoint.c
@@ -0,0 +1,423 @@
1/*
2 * This program is free software; you can redistribute it and/or modify
3 * it under the terms of the GNU General Public License as published by
4 * the Free Software Foundation; either version 2 of the License, or
5 * (at your option) any later version.
6 *
7 * This program is distributed in the hope that it will be useful,
8 * but WITHOUT ANY WARRANTY; without even the implied warranty of
9 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10 * GNU General Public License for more details.
11 *
12 * You should have received a copy of the GNU General Public License
13 * along with this program; if not, write to the Free Software
14 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
15 *
16 * Copyright (C) 2007 Alan Stern
17 * Copyright (C) IBM Corporation, 2009
18 * Copyright (C) 2009, Frederic Weisbecker <fweisbec@gmail.com>
19 *
20 * Thanks to Ingo Molnar for his many suggestions.
21 *
22 * Authors: Alan Stern <stern@rowland.harvard.edu>
23 * K.Prasad <prasad@linux.vnet.ibm.com>
24 * Frederic Weisbecker <fweisbec@gmail.com>
25 */
26
27/*
28 * HW_breakpoint: a unified kernel/user-space hardware breakpoint facility,
29 * using the CPU's debug registers.
30 * This file contains the arch-independent routines.
31 */
32
33#include <linux/irqflags.h>
34#include <linux/kallsyms.h>
35#include <linux/notifier.h>
36#include <linux/kprobes.h>
37#include <linux/kdebug.h>
38#include <linux/kernel.h>
39#include <linux/module.h>
40#include <linux/percpu.h>
41#include <linux/sched.h>
42#include <linux/init.h>
43#include <linux/smp.h>
44
45#include <linux/hw_breakpoint.h>
46
47/*
48 * Constraints data
49 */
50
51/* Number of pinned cpu breakpoints in a cpu */
52static DEFINE_PER_CPU(unsigned int, nr_cpu_bp_pinned);
53
54/* Number of pinned task breakpoints in a cpu */
55static DEFINE_PER_CPU(unsigned int, task_bp_pinned[HBP_NUM]);
56
57/* Number of non-pinned cpu/task breakpoints in a cpu */
58static DEFINE_PER_CPU(unsigned int, nr_bp_flexible);
59
60/* Gather the number of total pinned and un-pinned bp in a cpuset */
61struct bp_busy_slots {
62 unsigned int pinned;
63 unsigned int flexible;
64};
65
66/* Serialize accesses to the above constraints */
67static DEFINE_MUTEX(nr_bp_mutex);
68
69/*
70 * Report the maximum number of pinned breakpoints a task
71 * have in this cpu
72 */
73static unsigned int max_task_bp_pinned(int cpu)
74{
75 int i;
76 unsigned int *tsk_pinned = per_cpu(task_bp_pinned, cpu);
77
78 for (i = HBP_NUM -1; i >= 0; i--) {
79 if (tsk_pinned[i] > 0)
80 return i + 1;
81 }
82
83 return 0;
84}
85
86/*
87 * Report the number of pinned/un-pinned breakpoints we have in
88 * a given cpu (cpu > -1) or in all of them (cpu = -1).
89 */
90static void fetch_bp_busy_slots(struct bp_busy_slots *slots, int cpu)
91{
92 if (cpu >= 0) {
93 slots->pinned = per_cpu(nr_cpu_bp_pinned, cpu);
94 slots->pinned += max_task_bp_pinned(cpu);
95 slots->flexible = per_cpu(nr_bp_flexible, cpu);
96
97 return;
98 }
99
100 for_each_online_cpu(cpu) {
101 unsigned int nr;
102
103 nr = per_cpu(nr_cpu_bp_pinned, cpu);
104 nr += max_task_bp_pinned(cpu);
105
106 if (nr > slots->pinned)
107 slots->pinned = nr;
108
109 nr = per_cpu(nr_bp_flexible, cpu);
110
111 if (nr > slots->flexible)
112 slots->flexible = nr;
113 }
114}
115
116/*
117 * Add a pinned breakpoint for the given task in our constraint table
118 */
119static void toggle_bp_task_slot(struct task_struct *tsk, int cpu, bool enable)
120{
121 int count = 0;
122 struct perf_event *bp;
123 struct perf_event_context *ctx = tsk->perf_event_ctxp;
124 unsigned int *tsk_pinned;
125 struct list_head *list;
126 unsigned long flags;
127
128 if (WARN_ONCE(!ctx, "No perf context for this task"))
129 return;
130
131 list = &ctx->event_list;
132
133 spin_lock_irqsave(&ctx->lock, flags);
134
135 /*
136 * The current breakpoint counter is not included in the list
137 * at the open() callback time
138 */
139 list_for_each_entry(bp, list, event_entry) {
140 if (bp->attr.type == PERF_TYPE_BREAKPOINT)
141 count++;
142 }
143
144 spin_unlock_irqrestore(&ctx->lock, flags);
145
146 if (WARN_ONCE(count < 0, "No breakpoint counter found in the counter list"))
147 return;
148
149 tsk_pinned = per_cpu(task_bp_pinned, cpu);
150 if (enable) {
151 tsk_pinned[count]++;
152 if (count > 0)
153 tsk_pinned[count-1]--;
154 } else {
155 tsk_pinned[count]--;
156 if (count > 0)
157 tsk_pinned[count-1]++;
158 }
159}
160
161/*
162 * Add/remove the given breakpoint in our constraint table
163 */
164static void toggle_bp_slot(struct perf_event *bp, bool enable)
165{
166 int cpu = bp->cpu;
167 struct task_struct *tsk = bp->ctx->task;
168
169 /* Pinned counter task profiling */
170 if (tsk) {
171 if (cpu >= 0) {
172 toggle_bp_task_slot(tsk, cpu, enable);
173 return;
174 }
175
176 for_each_online_cpu(cpu)
177 toggle_bp_task_slot(tsk, cpu, enable);
178 return;
179 }
180
181 /* Pinned counter cpu profiling */
182 if (enable)
183 per_cpu(nr_cpu_bp_pinned, bp->cpu)++;
184 else
185 per_cpu(nr_cpu_bp_pinned, bp->cpu)--;
186}
187
188/*
189 * Contraints to check before allowing this new breakpoint counter:
190 *
191 * == Non-pinned counter == (Considered as pinned for now)
192 *
193 * - If attached to a single cpu, check:
194 *
195 * (per_cpu(nr_bp_flexible, cpu) || (per_cpu(nr_cpu_bp_pinned, cpu)
196 * + max(per_cpu(task_bp_pinned, cpu)))) < HBP_NUM
197 *
198 * -> If there are already non-pinned counters in this cpu, it means
199 * there is already a free slot for them.
200 * Otherwise, we check that the maximum number of per task
201 * breakpoints (for this cpu) plus the number of per cpu breakpoint
202 * (for this cpu) doesn't cover every registers.
203 *
204 * - If attached to every cpus, check:
205 *
206 * (per_cpu(nr_bp_flexible, *) || (max(per_cpu(nr_cpu_bp_pinned, *))
207 * + max(per_cpu(task_bp_pinned, *)))) < HBP_NUM
208 *
209 * -> This is roughly the same, except we check the number of per cpu
210 * bp for every cpu and we keep the max one. Same for the per tasks
211 * breakpoints.
212 *
213 *
214 * == Pinned counter ==
215 *
216 * - If attached to a single cpu, check:
217 *
218 * ((per_cpu(nr_bp_flexible, cpu) > 1) + per_cpu(nr_cpu_bp_pinned, cpu)
219 * + max(per_cpu(task_bp_pinned, cpu))) < HBP_NUM
220 *
221 * -> Same checks as before. But now the nr_bp_flexible, if any, must keep
222 * one register at least (or they will never be fed).
223 *
224 * - If attached to every cpus, check:
225 *
226 * ((per_cpu(nr_bp_flexible, *) > 1) + max(per_cpu(nr_cpu_bp_pinned, *))
227 * + max(per_cpu(task_bp_pinned, *))) < HBP_NUM
228 */
229int reserve_bp_slot(struct perf_event *bp)
230{
231 struct bp_busy_slots slots = {0};
232 int ret = 0;
233
234 mutex_lock(&nr_bp_mutex);
235
236 fetch_bp_busy_slots(&slots, bp->cpu);
237
238 /* Flexible counters need to keep at least one slot */
239 if (slots.pinned + (!!slots.flexible) == HBP_NUM) {
240 ret = -ENOSPC;
241 goto end;
242 }
243
244 toggle_bp_slot(bp, true);
245
246end:
247 mutex_unlock(&nr_bp_mutex);
248
249 return ret;
250}
251
252void release_bp_slot(struct perf_event *bp)
253{
254 mutex_lock(&nr_bp_mutex);
255
256 toggle_bp_slot(bp, false);
257
258 mutex_unlock(&nr_bp_mutex);
259}
260
261
262int __register_perf_hw_breakpoint(struct perf_event *bp)
263{
264 int ret;
265
266 ret = reserve_bp_slot(bp);
267 if (ret)
268 return ret;
269
270 /*
271 * Ptrace breakpoints can be temporary perf events only
272 * meant to reserve a slot. In this case, it is created disabled and
273 * we don't want to check the params right now (as we put a null addr)
274 * But perf tools create events as disabled and we want to check
275 * the params for them.
276 * This is a quick hack that will be removed soon, once we remove
277 * the tmp breakpoints from ptrace
278 */
279 if (!bp->attr.disabled || bp->callback == perf_bp_event)
280 ret = arch_validate_hwbkpt_settings(bp, bp->ctx->task);
281
282 return ret;
283}
284
285int register_perf_hw_breakpoint(struct perf_event *bp)
286{
287 bp->callback = perf_bp_event;
288
289 return __register_perf_hw_breakpoint(bp);
290}
291
292/**
293 * register_user_hw_breakpoint - register a hardware breakpoint for user space
294 * @attr: breakpoint attributes
295 * @triggered: callback to trigger when we hit the breakpoint
296 * @tsk: pointer to 'task_struct' of the process to which the address belongs
297 */
298struct perf_event *
299register_user_hw_breakpoint(struct perf_event_attr *attr,
300 perf_callback_t triggered,
301 struct task_struct *tsk)
302{
303 return perf_event_create_kernel_counter(attr, -1, tsk->pid, triggered);
304}
305EXPORT_SYMBOL_GPL(register_user_hw_breakpoint);
306
307/**
308 * modify_user_hw_breakpoint - modify a user-space hardware breakpoint
309 * @bp: the breakpoint structure to modify
310 * @attr: new breakpoint attributes
311 * @triggered: callback to trigger when we hit the breakpoint
312 * @tsk: pointer to 'task_struct' of the process to which the address belongs
313 */
314struct perf_event *
315modify_user_hw_breakpoint(struct perf_event *bp, struct perf_event_attr *attr,
316 perf_callback_t triggered,
317 struct task_struct *tsk)
318{
319 /*
320 * FIXME: do it without unregistering
321 * - We don't want to lose our slot
322 * - If the new bp is incorrect, don't lose the older one
323 */
324 unregister_hw_breakpoint(bp);
325
326 return perf_event_create_kernel_counter(attr, -1, tsk->pid, triggered);
327}
328EXPORT_SYMBOL_GPL(modify_user_hw_breakpoint);
329
330/**
331 * unregister_hw_breakpoint - unregister a user-space hardware breakpoint
332 * @bp: the breakpoint structure to unregister
333 */
334void unregister_hw_breakpoint(struct perf_event *bp)
335{
336 if (!bp)
337 return;
338 perf_event_release_kernel(bp);
339}
340EXPORT_SYMBOL_GPL(unregister_hw_breakpoint);
341
342/**
343 * register_wide_hw_breakpoint - register a wide breakpoint in the kernel
344 * @attr: breakpoint attributes
345 * @triggered: callback to trigger when we hit the breakpoint
346 *
347 * @return a set of per_cpu pointers to perf events
348 */
349struct perf_event **
350register_wide_hw_breakpoint(struct perf_event_attr *attr,
351 perf_callback_t triggered)
352{
353 struct perf_event **cpu_events, **pevent, *bp;
354 long err;
355 int cpu;
356
357 cpu_events = alloc_percpu(typeof(*cpu_events));
358 if (!cpu_events)
359 return ERR_PTR(-ENOMEM);
360
361 for_each_possible_cpu(cpu) {
362 pevent = per_cpu_ptr(cpu_events, cpu);
363 bp = perf_event_create_kernel_counter(attr, cpu, -1, triggered);
364
365 *pevent = bp;
366
367 if (IS_ERR(bp)) {
368 err = PTR_ERR(bp);
369 goto fail;
370 }
371 }
372
373 return cpu_events;
374
375fail:
376 for_each_possible_cpu(cpu) {
377 pevent = per_cpu_ptr(cpu_events, cpu);
378 if (IS_ERR(*pevent))
379 break;
380 unregister_hw_breakpoint(*pevent);
381 }
382 free_percpu(cpu_events);
383 /* return the error if any */
384 return ERR_PTR(err);
385}
386EXPORT_SYMBOL_GPL(register_wide_hw_breakpoint);
387
388/**
389 * unregister_wide_hw_breakpoint - unregister a wide breakpoint in the kernel
390 * @cpu_events: the per cpu set of events to unregister
391 */
392void unregister_wide_hw_breakpoint(struct perf_event **cpu_events)
393{
394 int cpu;
395 struct perf_event **pevent;
396
397 for_each_possible_cpu(cpu) {
398 pevent = per_cpu_ptr(cpu_events, cpu);
399 unregister_hw_breakpoint(*pevent);
400 }
401 free_percpu(cpu_events);
402}
403EXPORT_SYMBOL_GPL(unregister_wide_hw_breakpoint);
404
405static struct notifier_block hw_breakpoint_exceptions_nb = {
406 .notifier_call = hw_breakpoint_exceptions_notify,
407 /* we need to be notified first */
408 .priority = 0x7fffffff
409};
410
411static int __init init_hw_breakpoint(void)
412{
413 return register_die_notifier(&hw_breakpoint_exceptions_nb);
414}
415core_initcall(init_hw_breakpoint);
416
417
418struct pmu perf_ops_bp = {
419 .enable = arch_install_hw_breakpoint,
420 .disable = arch_uninstall_hw_breakpoint,
421 .read = hw_breakpoint_pmu_read,
422 .unthrottle = hw_breakpoint_pmu_unthrottle
423};
diff --git a/kernel/irq/chip.c b/kernel/irq/chip.c
index c1660194d115..ba566c261adc 100644
--- a/kernel/irq/chip.c
+++ b/kernel/irq/chip.c
@@ -166,11 +166,11 @@ int set_irq_data(unsigned int irq, void *data)
166EXPORT_SYMBOL(set_irq_data); 166EXPORT_SYMBOL(set_irq_data);
167 167
168/** 168/**
169 * set_irq_data - set irq type data for an irq 169 * set_irq_msi - set MSI descriptor data for an irq
170 * @irq: Interrupt number 170 * @irq: Interrupt number
171 * @entry: Pointer to MSI descriptor data 171 * @entry: Pointer to MSI descriptor data
172 * 172 *
173 * Set the hardware irq controller data for an irq 173 * Set the MSI descriptor entry for an irq
174 */ 174 */
175int set_irq_msi(unsigned int irq, struct msi_desc *entry) 175int set_irq_msi(unsigned int irq, struct msi_desc *entry)
176{ 176{
@@ -590,7 +590,7 @@ out_unlock:
590} 590}
591 591
592/** 592/**
593 * handle_percpu_IRQ - Per CPU local irq handler 593 * handle_percpu_irq - Per CPU local irq handler
594 * @irq: the interrupt number 594 * @irq: the interrupt number
595 * @desc: the interrupt description structure for this irq 595 * @desc: the interrupt description structure for this irq
596 * 596 *
diff --git a/kernel/irq/proc.c b/kernel/irq/proc.c
index 692363dd591f..0832145fea97 100644
--- a/kernel/irq/proc.c
+++ b/kernel/irq/proc.c
@@ -136,7 +136,7 @@ out:
136 136
137static int default_affinity_open(struct inode *inode, struct file *file) 137static int default_affinity_open(struct inode *inode, struct file *file)
138{ 138{
139 return single_open(file, default_affinity_show, NULL); 139 return single_open(file, default_affinity_show, PDE(inode)->data);
140} 140}
141 141
142static const struct file_operations default_affinity_proc_fops = { 142static const struct file_operations default_affinity_proc_fops = {
@@ -148,18 +148,28 @@ static const struct file_operations default_affinity_proc_fops = {
148}; 148};
149#endif 149#endif
150 150
151static int irq_spurious_read(char *page, char **start, off_t off, 151static int irq_spurious_proc_show(struct seq_file *m, void *v)
152 int count, int *eof, void *data)
153{ 152{
154 struct irq_desc *desc = irq_to_desc((long) data); 153 struct irq_desc *desc = irq_to_desc((long) m->private);
155 return sprintf(page, "count %u\n" 154
156 "unhandled %u\n" 155 seq_printf(m, "count %u\n" "unhandled %u\n" "last_unhandled %u ms\n",
157 "last_unhandled %u ms\n", 156 desc->irq_count, desc->irqs_unhandled,
158 desc->irq_count, 157 jiffies_to_msecs(desc->last_unhandled));
159 desc->irqs_unhandled, 158 return 0;
160 jiffies_to_msecs(desc->last_unhandled)); 159}
160
161static int irq_spurious_proc_open(struct inode *inode, struct file *file)
162{
163 return single_open(file, irq_spurious_proc_show, NULL);
161} 164}
162 165
166static const struct file_operations irq_spurious_proc_fops = {
167 .open = irq_spurious_proc_open,
168 .read = seq_read,
169 .llseek = seq_lseek,
170 .release = single_release,
171};
172
163#define MAX_NAMELEN 128 173#define MAX_NAMELEN 128
164 174
165static int name_unique(unsigned int irq, struct irqaction *new_action) 175static int name_unique(unsigned int irq, struct irqaction *new_action)
@@ -204,7 +214,6 @@ void register_handler_proc(unsigned int irq, struct irqaction *action)
204void register_irq_proc(unsigned int irq, struct irq_desc *desc) 214void register_irq_proc(unsigned int irq, struct irq_desc *desc)
205{ 215{
206 char name [MAX_NAMELEN]; 216 char name [MAX_NAMELEN];
207 struct proc_dir_entry *entry;
208 217
209 if (!root_irq_dir || (desc->chip == &no_irq_chip) || desc->dir) 218 if (!root_irq_dir || (desc->chip == &no_irq_chip) || desc->dir)
210 return; 219 return;
@@ -214,6 +223,8 @@ void register_irq_proc(unsigned int irq, struct irq_desc *desc)
214 223
215 /* create /proc/irq/1234 */ 224 /* create /proc/irq/1234 */
216 desc->dir = proc_mkdir(name, root_irq_dir); 225 desc->dir = proc_mkdir(name, root_irq_dir);
226 if (!desc->dir)
227 return;
217 228
218#ifdef CONFIG_SMP 229#ifdef CONFIG_SMP
219 /* create /proc/irq/<irq>/smp_affinity */ 230 /* create /proc/irq/<irq>/smp_affinity */
@@ -221,11 +232,8 @@ void register_irq_proc(unsigned int irq, struct irq_desc *desc)
221 &irq_affinity_proc_fops, (void *)(long)irq); 232 &irq_affinity_proc_fops, (void *)(long)irq);
222#endif 233#endif
223 234
224 entry = create_proc_entry("spurious", 0444, desc->dir); 235 proc_create_data("spurious", 0444, desc->dir,
225 if (entry) { 236 &irq_spurious_proc_fops, (void *)(long)irq);
226 entry->data = (void *)(long)irq;
227 entry->read_proc = irq_spurious_read;
228 }
229} 237}
230 238
231#undef MAX_NAMELEN 239#undef MAX_NAMELEN
diff --git a/kernel/irq/spurious.c b/kernel/irq/spurious.c
index 114e704760fe..22b0a6eedf24 100644
--- a/kernel/irq/spurious.c
+++ b/kernel/irq/spurious.c
@@ -104,7 +104,7 @@ static int misrouted_irq(int irq)
104 return ok; 104 return ok;
105} 105}
106 106
107static void poll_all_shared_irqs(void) 107static void poll_spurious_irqs(unsigned long dummy)
108{ 108{
109 struct irq_desc *desc; 109 struct irq_desc *desc;
110 int i; 110 int i;
@@ -121,25 +121,15 @@ static void poll_all_shared_irqs(void)
121 if (!(status & IRQ_SPURIOUS_DISABLED)) 121 if (!(status & IRQ_SPURIOUS_DISABLED))
122 continue; 122 continue;
123 123
124 local_irq_disable();
124 try_one_irq(i, desc); 125 try_one_irq(i, desc);
126 local_irq_enable();
125 } 127 }
126}
127
128static void poll_spurious_irqs(unsigned long dummy)
129{
130 poll_all_shared_irqs();
131 128
132 mod_timer(&poll_spurious_irq_timer, 129 mod_timer(&poll_spurious_irq_timer,
133 jiffies + POLL_SPURIOUS_IRQ_INTERVAL); 130 jiffies + POLL_SPURIOUS_IRQ_INTERVAL);
134} 131}
135 132
136#ifdef CONFIG_DEBUG_SHIRQ
137void debug_poll_all_shared_irqs(void)
138{
139 poll_all_shared_irqs();
140}
141#endif
142
143/* 133/*
144 * If 99,900 of the previous 100,000 interrupts have not been handled 134 * If 99,900 of the previous 100,000 interrupts have not been handled
145 * then assume that the IRQ is stuck in some manner. Drop a diagnostic 135 * then assume that the IRQ is stuck in some manner. Drop a diagnostic
diff --git a/kernel/kallsyms.c b/kernel/kallsyms.c
index 8b6b8b697c68..8e5288a8a355 100644
--- a/kernel/kallsyms.c
+++ b/kernel/kallsyms.c
@@ -181,6 +181,7 @@ unsigned long kallsyms_lookup_name(const char *name)
181 } 181 }
182 return module_kallsyms_lookup_name(name); 182 return module_kallsyms_lookup_name(name);
183} 183}
184EXPORT_SYMBOL_GPL(kallsyms_lookup_name);
184 185
185int kallsyms_on_each_symbol(int (*fn)(void *, const char *, struct module *, 186int kallsyms_on_each_symbol(int (*fn)(void *, const char *, struct module *,
186 unsigned long), 187 unsigned long),
diff --git a/kernel/kgdb.c b/kernel/kgdb.c
index 9147a3190c9d..7d7014634022 100644
--- a/kernel/kgdb.c
+++ b/kernel/kgdb.c
@@ -870,7 +870,7 @@ static void gdb_cmd_getregs(struct kgdb_state *ks)
870 870
871 /* 871 /*
872 * All threads that don't have debuggerinfo should be 872 * All threads that don't have debuggerinfo should be
873 * in __schedule() sleeping, since all other CPUs 873 * in schedule() sleeping, since all other CPUs
874 * are in kgdb_wait, and thus have debuggerinfo. 874 * are in kgdb_wait, and thus have debuggerinfo.
875 */ 875 */
876 if (local_debuggerinfo) { 876 if (local_debuggerinfo) {
diff --git a/kernel/kmod.c b/kernel/kmod.c
index 9fcb53a11f87..25b103190364 100644
--- a/kernel/kmod.c
+++ b/kernel/kmod.c
@@ -80,16 +80,16 @@ int __request_module(bool wait, const char *fmt, ...)
80#define MAX_KMOD_CONCURRENT 50 /* Completely arbitrary value - KAO */ 80#define MAX_KMOD_CONCURRENT 50 /* Completely arbitrary value - KAO */
81 static int kmod_loop_msg; 81 static int kmod_loop_msg;
82 82
83 ret = security_kernel_module_request();
84 if (ret)
85 return ret;
86
87 va_start(args, fmt); 83 va_start(args, fmt);
88 ret = vsnprintf(module_name, MODULE_NAME_LEN, fmt, args); 84 ret = vsnprintf(module_name, MODULE_NAME_LEN, fmt, args);
89 va_end(args); 85 va_end(args);
90 if (ret >= MODULE_NAME_LEN) 86 if (ret >= MODULE_NAME_LEN)
91 return -ENAMETOOLONG; 87 return -ENAMETOOLONG;
92 88
89 ret = security_kernel_module_request(module_name);
90 if (ret)
91 return ret;
92
93 /* If modprobe needs a service that is in a module, we get a recursive 93 /* If modprobe needs a service that is in a module, we get a recursive
94 * loop. Limit the number of running kmod threads to max_threads/2 or 94 * loop. Limit the number of running kmod threads to max_threads/2 or
95 * MAX_KMOD_CONCURRENT, whichever is the smaller. A cleaner method 95 * MAX_KMOD_CONCURRENT, whichever is the smaller. A cleaner method
diff --git a/kernel/kprobes.c b/kernel/kprobes.c
index 5240d75f4c60..e5342a344c43 100644
--- a/kernel/kprobes.c
+++ b/kernel/kprobes.c
@@ -90,6 +90,9 @@ static spinlock_t *kretprobe_table_lock_ptr(unsigned long hash)
90 */ 90 */
91static struct kprobe_blackpoint kprobe_blacklist[] = { 91static struct kprobe_blackpoint kprobe_blacklist[] = {
92 {"preempt_schedule",}, 92 {"preempt_schedule",},
93 {"native_get_debugreg",},
94 {"irq_entries_start",},
95 {"common_interrupt",},
93 {NULL} /* Terminator */ 96 {NULL} /* Terminator */
94}; 97};
95 98
@@ -673,6 +676,40 @@ static kprobe_opcode_t __kprobes *kprobe_addr(struct kprobe *p)
673 return (kprobe_opcode_t *)(((char *)addr) + p->offset); 676 return (kprobe_opcode_t *)(((char *)addr) + p->offset);
674} 677}
675 678
679/* Check passed kprobe is valid and return kprobe in kprobe_table. */
680static struct kprobe * __kprobes __get_valid_kprobe(struct kprobe *p)
681{
682 struct kprobe *old_p, *list_p;
683
684 old_p = get_kprobe(p->addr);
685 if (unlikely(!old_p))
686 return NULL;
687
688 if (p != old_p) {
689 list_for_each_entry_rcu(list_p, &old_p->list, list)
690 if (list_p == p)
691 /* kprobe p is a valid probe */
692 goto valid;
693 return NULL;
694 }
695valid:
696 return old_p;
697}
698
699/* Return error if the kprobe is being re-registered */
700static inline int check_kprobe_rereg(struct kprobe *p)
701{
702 int ret = 0;
703 struct kprobe *old_p;
704
705 mutex_lock(&kprobe_mutex);
706 old_p = __get_valid_kprobe(p);
707 if (old_p)
708 ret = -EINVAL;
709 mutex_unlock(&kprobe_mutex);
710 return ret;
711}
712
676int __kprobes register_kprobe(struct kprobe *p) 713int __kprobes register_kprobe(struct kprobe *p)
677{ 714{
678 int ret = 0; 715 int ret = 0;
@@ -685,6 +722,10 @@ int __kprobes register_kprobe(struct kprobe *p)
685 return -EINVAL; 722 return -EINVAL;
686 p->addr = addr; 723 p->addr = addr;
687 724
725 ret = check_kprobe_rereg(p);
726 if (ret)
727 return ret;
728
688 preempt_disable(); 729 preempt_disable();
689 if (!kernel_text_address((unsigned long) p->addr) || 730 if (!kernel_text_address((unsigned long) p->addr) ||
690 in_kprobes_functions((unsigned long) p->addr)) { 731 in_kprobes_functions((unsigned long) p->addr)) {
@@ -754,26 +795,6 @@ out:
754} 795}
755EXPORT_SYMBOL_GPL(register_kprobe); 796EXPORT_SYMBOL_GPL(register_kprobe);
756 797
757/* Check passed kprobe is valid and return kprobe in kprobe_table. */
758static struct kprobe * __kprobes __get_valid_kprobe(struct kprobe *p)
759{
760 struct kprobe *old_p, *list_p;
761
762 old_p = get_kprobe(p->addr);
763 if (unlikely(!old_p))
764 return NULL;
765
766 if (p != old_p) {
767 list_for_each_entry_rcu(list_p, &old_p->list, list)
768 if (list_p == p)
769 /* kprobe p is a valid probe */
770 goto valid;
771 return NULL;
772 }
773valid:
774 return old_p;
775}
776
777/* 798/*
778 * Unregister a kprobe without a scheduler synchronization. 799 * Unregister a kprobe without a scheduler synchronization.
779 */ 800 */
@@ -1014,9 +1035,9 @@ int __kprobes register_kretprobe(struct kretprobe *rp)
1014 /* Pre-allocate memory for max kretprobe instances */ 1035 /* Pre-allocate memory for max kretprobe instances */
1015 if (rp->maxactive <= 0) { 1036 if (rp->maxactive <= 0) {
1016#ifdef CONFIG_PREEMPT 1037#ifdef CONFIG_PREEMPT
1017 rp->maxactive = max(10, 2 * NR_CPUS); 1038 rp->maxactive = max(10, 2 * num_possible_cpus());
1018#else 1039#else
1019 rp->maxactive = NR_CPUS; 1040 rp->maxactive = num_possible_cpus();
1020#endif 1041#endif
1021 } 1042 }
1022 spin_lock_init(&rp->lock); 1043 spin_lock_init(&rp->lock);
@@ -1141,6 +1162,13 @@ static void __kprobes kill_kprobe(struct kprobe *p)
1141 arch_remove_kprobe(p); 1162 arch_remove_kprobe(p);
1142} 1163}
1143 1164
1165void __kprobes dump_kprobe(struct kprobe *kp)
1166{
1167 printk(KERN_WARNING "Dumping kprobe:\n");
1168 printk(KERN_WARNING "Name: %s\nAddress: %p\nOffset: %x\n",
1169 kp->symbol_name, kp->addr, kp->offset);
1170}
1171
1144/* Module notifier call back, checking kprobes on the module */ 1172/* Module notifier call back, checking kprobes on the module */
1145static int __kprobes kprobes_module_callback(struct notifier_block *nb, 1173static int __kprobes kprobes_module_callback(struct notifier_block *nb,
1146 unsigned long val, void *data) 1174 unsigned long val, void *data)
diff --git a/kernel/kthread.c b/kernel/kthread.c
index 5fe709982caa..ab7ae57773e1 100644
--- a/kernel/kthread.c
+++ b/kernel/kthread.c
@@ -150,29 +150,6 @@ struct task_struct *kthread_create(int (*threadfn)(void *data),
150EXPORT_SYMBOL(kthread_create); 150EXPORT_SYMBOL(kthread_create);
151 151
152/** 152/**
153 * kthread_bind - bind a just-created kthread to a cpu.
154 * @k: thread created by kthread_create().
155 * @cpu: cpu (might not be online, must be possible) for @k to run on.
156 *
157 * Description: This function is equivalent to set_cpus_allowed(),
158 * except that @cpu doesn't need to be online, and the thread must be
159 * stopped (i.e., just returned from kthread_create()).
160 */
161void kthread_bind(struct task_struct *k, unsigned int cpu)
162{
163 /* Must have done schedule() in kthread() before we set_task_cpu */
164 if (!wait_task_inactive(k, TASK_UNINTERRUPTIBLE)) {
165 WARN_ON(1);
166 return;
167 }
168 set_task_cpu(k, cpu);
169 k->cpus_allowed = cpumask_of_cpu(cpu);
170 k->rt.nr_cpus_allowed = 1;
171 k->flags |= PF_THREAD_BOUND;
172}
173EXPORT_SYMBOL(kthread_bind);
174
175/**
176 * kthread_stop - stop a thread created by kthread_create(). 153 * kthread_stop - stop a thread created by kthread_create().
177 * @k: thread created by kthread_create(). 154 * @k: thread created by kthread_create().
178 * 155 *
diff --git a/kernel/lockdep.c b/kernel/lockdep.c
index 9af56723c096..f5dcd36d3151 100644
--- a/kernel/lockdep.c
+++ b/kernel/lockdep.c
@@ -49,7 +49,7 @@
49#include "lockdep_internals.h" 49#include "lockdep_internals.h"
50 50
51#define CREATE_TRACE_POINTS 51#define CREATE_TRACE_POINTS
52#include <trace/events/lockdep.h> 52#include <trace/events/lock.h>
53 53
54#ifdef CONFIG_PROVE_LOCKING 54#ifdef CONFIG_PROVE_LOCKING
55int prove_locking = 1; 55int prove_locking = 1;
diff --git a/kernel/module.c b/kernel/module.c
index 8b7d8805819d..5842a71cf052 100644
--- a/kernel/module.c
+++ b/kernel/module.c
@@ -1187,7 +1187,8 @@ static void add_sect_attrs(struct module *mod, unsigned int nsect,
1187 1187
1188 /* Count loaded sections and allocate structures */ 1188 /* Count loaded sections and allocate structures */
1189 for (i = 0; i < nsect; i++) 1189 for (i = 0; i < nsect; i++)
1190 if (sechdrs[i].sh_flags & SHF_ALLOC) 1190 if (sechdrs[i].sh_flags & SHF_ALLOC
1191 && sechdrs[i].sh_size)
1191 nloaded++; 1192 nloaded++;
1192 size[0] = ALIGN(sizeof(*sect_attrs) 1193 size[0] = ALIGN(sizeof(*sect_attrs)
1193 + nloaded * sizeof(sect_attrs->attrs[0]), 1194 + nloaded * sizeof(sect_attrs->attrs[0]),
@@ -1207,6 +1208,8 @@ static void add_sect_attrs(struct module *mod, unsigned int nsect,
1207 for (i = 0; i < nsect; i++) { 1208 for (i = 0; i < nsect; i++) {
1208 if (! (sechdrs[i].sh_flags & SHF_ALLOC)) 1209 if (! (sechdrs[i].sh_flags & SHF_ALLOC))
1209 continue; 1210 continue;
1211 if (!sechdrs[i].sh_size)
1212 continue;
1210 sattr->address = sechdrs[i].sh_addr; 1213 sattr->address = sechdrs[i].sh_addr;
1211 sattr->name = kstrdup(secstrings + sechdrs[i].sh_name, 1214 sattr->name = kstrdup(secstrings + sechdrs[i].sh_name,
1212 GFP_KERNEL); 1215 GFP_KERNEL);
diff --git a/kernel/mutex.c b/kernel/mutex.c
index 947b3ad551f8..632f04c57d82 100644
--- a/kernel/mutex.c
+++ b/kernel/mutex.c
@@ -148,8 +148,8 @@ __mutex_lock_common(struct mutex *lock, long state, unsigned int subclass,
148 148
149 preempt_disable(); 149 preempt_disable();
150 mutex_acquire(&lock->dep_map, subclass, 0, ip); 150 mutex_acquire(&lock->dep_map, subclass, 0, ip);
151#if defined(CONFIG_SMP) && !defined(CONFIG_DEBUG_MUTEXES) && \ 151
152 !defined(CONFIG_HAVE_DEFAULT_NO_SPIN_MUTEXES) 152#ifdef CONFIG_MUTEX_SPIN_ON_OWNER
153 /* 153 /*
154 * Optimistic spinning. 154 * Optimistic spinning.
155 * 155 *
diff --git a/kernel/notifier.c b/kernel/notifier.c
index 61d5aa5eced3..acd24e7643eb 100644
--- a/kernel/notifier.c
+++ b/kernel/notifier.c
@@ -558,7 +558,7 @@ EXPORT_SYMBOL(unregister_reboot_notifier);
558 558
559static ATOMIC_NOTIFIER_HEAD(die_chain); 559static ATOMIC_NOTIFIER_HEAD(die_chain);
560 560
561int notrace notify_die(enum die_val val, const char *str, 561int notrace __kprobes notify_die(enum die_val val, const char *str,
562 struct pt_regs *regs, long err, int trap, int sig) 562 struct pt_regs *regs, long err, int trap, int sig)
563{ 563{
564 struct die_args args = { 564 struct die_args args = {
diff --git a/kernel/perf_event.c b/kernel/perf_event.c
index 7f29643c8985..6b7ddba1dd64 100644
--- a/kernel/perf_event.c
+++ b/kernel/perf_event.c
@@ -28,6 +28,8 @@
28#include <linux/anon_inodes.h> 28#include <linux/anon_inodes.h>
29#include <linux/kernel_stat.h> 29#include <linux/kernel_stat.h>
30#include <linux/perf_event.h> 30#include <linux/perf_event.h>
31#include <linux/ftrace_event.h>
32#include <linux/hw_breakpoint.h>
31 33
32#include <asm/irq_regs.h> 34#include <asm/irq_regs.h>
33 35
@@ -244,6 +246,49 @@ static void perf_unpin_context(struct perf_event_context *ctx)
244 put_ctx(ctx); 246 put_ctx(ctx);
245} 247}
246 248
249static inline u64 perf_clock(void)
250{
251 return cpu_clock(smp_processor_id());
252}
253
254/*
255 * Update the record of the current time in a context.
256 */
257static void update_context_time(struct perf_event_context *ctx)
258{
259 u64 now = perf_clock();
260
261 ctx->time += now - ctx->timestamp;
262 ctx->timestamp = now;
263}
264
265/*
266 * Update the total_time_enabled and total_time_running fields for a event.
267 */
268static void update_event_times(struct perf_event *event)
269{
270 struct perf_event_context *ctx = event->ctx;
271 u64 run_end;
272
273 if (event->state < PERF_EVENT_STATE_INACTIVE ||
274 event->group_leader->state < PERF_EVENT_STATE_INACTIVE)
275 return;
276
277 if (ctx->is_active)
278 run_end = ctx->time;
279 else
280 run_end = event->tstamp_stopped;
281
282 event->total_time_enabled = run_end - event->tstamp_enabled;
283
284 if (event->state == PERF_EVENT_STATE_INACTIVE)
285 run_end = event->tstamp_stopped;
286 else
287 run_end = ctx->time;
288
289 event->total_time_running = run_end - event->tstamp_running;
290}
291
247/* 292/*
248 * Add a event from the lists for its context. 293 * Add a event from the lists for its context.
249 * Must be called with ctx->mutex and ctx->lock held. 294 * Must be called with ctx->mutex and ctx->lock held.
@@ -292,6 +337,18 @@ list_del_event(struct perf_event *event, struct perf_event_context *ctx)
292 if (event->group_leader != event) 337 if (event->group_leader != event)
293 event->group_leader->nr_siblings--; 338 event->group_leader->nr_siblings--;
294 339
340 update_event_times(event);
341
342 /*
343 * If event was in error state, then keep it
344 * that way, otherwise bogus counts will be
345 * returned on read(). The only way to get out
346 * of error state is by explicit re-enabling
347 * of the event
348 */
349 if (event->state > PERF_EVENT_STATE_OFF)
350 event->state = PERF_EVENT_STATE_OFF;
351
295 /* 352 /*
296 * If this was a group event with sibling events then 353 * If this was a group event with sibling events then
297 * upgrade the siblings to singleton events by adding them 354 * upgrade the siblings to singleton events by adding them
@@ -445,50 +502,11 @@ retry:
445 * can remove the event safely, if the call above did not 502 * can remove the event safely, if the call above did not
446 * succeed. 503 * succeed.
447 */ 504 */
448 if (!list_empty(&event->group_entry)) { 505 if (!list_empty(&event->group_entry))
449 list_del_event(event, ctx); 506 list_del_event(event, ctx);
450 }
451 spin_unlock_irq(&ctx->lock); 507 spin_unlock_irq(&ctx->lock);
452} 508}
453 509
454static inline u64 perf_clock(void)
455{
456 return cpu_clock(smp_processor_id());
457}
458
459/*
460 * Update the record of the current time in a context.
461 */
462static void update_context_time(struct perf_event_context *ctx)
463{
464 u64 now = perf_clock();
465
466 ctx->time += now - ctx->timestamp;
467 ctx->timestamp = now;
468}
469
470/*
471 * Update the total_time_enabled and total_time_running fields for a event.
472 */
473static void update_event_times(struct perf_event *event)
474{
475 struct perf_event_context *ctx = event->ctx;
476 u64 run_end;
477
478 if (event->state < PERF_EVENT_STATE_INACTIVE ||
479 event->group_leader->state < PERF_EVENT_STATE_INACTIVE)
480 return;
481
482 event->total_time_enabled = ctx->time - event->tstamp_enabled;
483
484 if (event->state == PERF_EVENT_STATE_INACTIVE)
485 run_end = event->tstamp_stopped;
486 else
487 run_end = ctx->time;
488
489 event->total_time_running = run_end - event->tstamp_running;
490}
491
492/* 510/*
493 * Update total_time_enabled and total_time_running for all events in a group. 511 * Update total_time_enabled and total_time_running for all events in a group.
494 */ 512 */
@@ -1031,10 +1049,10 @@ void __perf_event_sched_out(struct perf_event_context *ctx,
1031 update_context_time(ctx); 1049 update_context_time(ctx);
1032 1050
1033 perf_disable(); 1051 perf_disable();
1034 if (ctx->nr_active) 1052 if (ctx->nr_active) {
1035 list_for_each_entry(event, &ctx->group_list, group_entry) 1053 list_for_each_entry(event, &ctx->group_list, group_entry)
1036 group_sched_out(event, cpuctx, ctx); 1054 group_sched_out(event, cpuctx, ctx);
1037 1055 }
1038 perf_enable(); 1056 perf_enable();
1039 out: 1057 out:
1040 spin_unlock(&ctx->lock); 1058 spin_unlock(&ctx->lock);
@@ -1059,8 +1077,6 @@ static int context_equiv(struct perf_event_context *ctx1,
1059 && !ctx1->pin_count && !ctx2->pin_count; 1077 && !ctx1->pin_count && !ctx2->pin_count;
1060} 1078}
1061 1079
1062static void __perf_event_read(void *event);
1063
1064static void __perf_event_sync_stat(struct perf_event *event, 1080static void __perf_event_sync_stat(struct perf_event *event,
1065 struct perf_event *next_event) 1081 struct perf_event *next_event)
1066{ 1082{
@@ -1078,8 +1094,8 @@ static void __perf_event_sync_stat(struct perf_event *event,
1078 */ 1094 */
1079 switch (event->state) { 1095 switch (event->state) {
1080 case PERF_EVENT_STATE_ACTIVE: 1096 case PERF_EVENT_STATE_ACTIVE:
1081 __perf_event_read(event); 1097 event->pmu->read(event);
1082 break; 1098 /* fall-through */
1083 1099
1084 case PERF_EVENT_STATE_INACTIVE: 1100 case PERF_EVENT_STATE_INACTIVE:
1085 update_event_times(event); 1101 update_event_times(event);
@@ -1118,6 +1134,8 @@ static void perf_event_sync_stat(struct perf_event_context *ctx,
1118 if (!ctx->nr_stat) 1134 if (!ctx->nr_stat)
1119 return; 1135 return;
1120 1136
1137 update_context_time(ctx);
1138
1121 event = list_first_entry(&ctx->event_list, 1139 event = list_first_entry(&ctx->event_list,
1122 struct perf_event, event_entry); 1140 struct perf_event, event_entry);
1123 1141
@@ -1161,8 +1179,6 @@ void perf_event_task_sched_out(struct task_struct *task,
1161 if (likely(!ctx || !cpuctx->task_ctx)) 1179 if (likely(!ctx || !cpuctx->task_ctx))
1162 return; 1180 return;
1163 1181
1164 update_context_time(ctx);
1165
1166 rcu_read_lock(); 1182 rcu_read_lock();
1167 parent = rcu_dereference(ctx->parent_ctx); 1183 parent = rcu_dereference(ctx->parent_ctx);
1168 next_ctx = next->perf_event_ctxp; 1184 next_ctx = next->perf_event_ctxp;
@@ -1515,7 +1531,6 @@ static void __perf_event_read(void *info)
1515 struct perf_cpu_context *cpuctx = &__get_cpu_var(perf_cpu_context); 1531 struct perf_cpu_context *cpuctx = &__get_cpu_var(perf_cpu_context);
1516 struct perf_event *event = info; 1532 struct perf_event *event = info;
1517 struct perf_event_context *ctx = event->ctx; 1533 struct perf_event_context *ctx = event->ctx;
1518 unsigned long flags;
1519 1534
1520 /* 1535 /*
1521 * If this is a task context, we need to check whether it is 1536 * If this is a task context, we need to check whether it is
@@ -1527,12 +1542,12 @@ static void __perf_event_read(void *info)
1527 if (ctx->task && cpuctx->task_ctx != ctx) 1542 if (ctx->task && cpuctx->task_ctx != ctx)
1528 return; 1543 return;
1529 1544
1530 local_irq_save(flags); 1545 spin_lock(&ctx->lock);
1531 if (ctx->is_active) 1546 update_context_time(ctx);
1532 update_context_time(ctx);
1533 event->pmu->read(event);
1534 update_event_times(event); 1547 update_event_times(event);
1535 local_irq_restore(flags); 1548 spin_unlock(&ctx->lock);
1549
1550 event->pmu->read(event);
1536} 1551}
1537 1552
1538static u64 perf_event_read(struct perf_event *event) 1553static u64 perf_event_read(struct perf_event *event)
@@ -1545,7 +1560,13 @@ static u64 perf_event_read(struct perf_event *event)
1545 smp_call_function_single(event->oncpu, 1560 smp_call_function_single(event->oncpu,
1546 __perf_event_read, event, 1); 1561 __perf_event_read, event, 1);
1547 } else if (event->state == PERF_EVENT_STATE_INACTIVE) { 1562 } else if (event->state == PERF_EVENT_STATE_INACTIVE) {
1563 struct perf_event_context *ctx = event->ctx;
1564 unsigned long flags;
1565
1566 spin_lock_irqsave(&ctx->lock, flags);
1567 update_context_time(ctx);
1548 update_event_times(event); 1568 update_event_times(event);
1569 spin_unlock_irqrestore(&ctx->lock, flags);
1549 } 1570 }
1550 1571
1551 return atomic64_read(&event->count); 1572 return atomic64_read(&event->count);
@@ -1658,6 +1679,8 @@ static struct perf_event_context *find_get_context(pid_t pid, int cpu)
1658 return ERR_PTR(err); 1679 return ERR_PTR(err);
1659} 1680}
1660 1681
1682static void perf_event_free_filter(struct perf_event *event);
1683
1661static void free_event_rcu(struct rcu_head *head) 1684static void free_event_rcu(struct rcu_head *head)
1662{ 1685{
1663 struct perf_event *event; 1686 struct perf_event *event;
@@ -1665,6 +1688,7 @@ static void free_event_rcu(struct rcu_head *head)
1665 event = container_of(head, struct perf_event, rcu_head); 1688 event = container_of(head, struct perf_event, rcu_head);
1666 if (event->ns) 1689 if (event->ns)
1667 put_pid_ns(event->ns); 1690 put_pid_ns(event->ns);
1691 perf_event_free_filter(event);
1668 kfree(event); 1692 kfree(event);
1669} 1693}
1670 1694
@@ -1696,16 +1720,10 @@ static void free_event(struct perf_event *event)
1696 call_rcu(&event->rcu_head, free_event_rcu); 1720 call_rcu(&event->rcu_head, free_event_rcu);
1697} 1721}
1698 1722
1699/* 1723int perf_event_release_kernel(struct perf_event *event)
1700 * Called when the last reference to the file is gone.
1701 */
1702static int perf_release(struct inode *inode, struct file *file)
1703{ 1724{
1704 struct perf_event *event = file->private_data;
1705 struct perf_event_context *ctx = event->ctx; 1725 struct perf_event_context *ctx = event->ctx;
1706 1726
1707 file->private_data = NULL;
1708
1709 WARN_ON_ONCE(ctx->parent_ctx); 1727 WARN_ON_ONCE(ctx->parent_ctx);
1710 mutex_lock(&ctx->mutex); 1728 mutex_lock(&ctx->mutex);
1711 perf_event_remove_from_context(event); 1729 perf_event_remove_from_context(event);
@@ -1720,6 +1738,19 @@ static int perf_release(struct inode *inode, struct file *file)
1720 1738
1721 return 0; 1739 return 0;
1722} 1740}
1741EXPORT_SYMBOL_GPL(perf_event_release_kernel);
1742
1743/*
1744 * Called when the last reference to the file is gone.
1745 */
1746static int perf_release(struct inode *inode, struct file *file)
1747{
1748 struct perf_event *event = file->private_data;
1749
1750 file->private_data = NULL;
1751
1752 return perf_event_release_kernel(event);
1753}
1723 1754
1724static int perf_event_read_size(struct perf_event *event) 1755static int perf_event_read_size(struct perf_event *event)
1725{ 1756{
@@ -1746,91 +1777,94 @@ static int perf_event_read_size(struct perf_event *event)
1746 return size; 1777 return size;
1747} 1778}
1748 1779
1749static u64 perf_event_read_value(struct perf_event *event) 1780u64 perf_event_read_value(struct perf_event *event, u64 *enabled, u64 *running)
1750{ 1781{
1751 struct perf_event *child; 1782 struct perf_event *child;
1752 u64 total = 0; 1783 u64 total = 0;
1753 1784
1785 *enabled = 0;
1786 *running = 0;
1787
1788 mutex_lock(&event->child_mutex);
1754 total += perf_event_read(event); 1789 total += perf_event_read(event);
1755 list_for_each_entry(child, &event->child_list, child_list) 1790 *enabled += event->total_time_enabled +
1791 atomic64_read(&event->child_total_time_enabled);
1792 *running += event->total_time_running +
1793 atomic64_read(&event->child_total_time_running);
1794
1795 list_for_each_entry(child, &event->child_list, child_list) {
1756 total += perf_event_read(child); 1796 total += perf_event_read(child);
1797 *enabled += child->total_time_enabled;
1798 *running += child->total_time_running;
1799 }
1800 mutex_unlock(&event->child_mutex);
1757 1801
1758 return total; 1802 return total;
1759} 1803}
1760 1804EXPORT_SYMBOL_GPL(perf_event_read_value);
1761static int perf_event_read_entry(struct perf_event *event,
1762 u64 read_format, char __user *buf)
1763{
1764 int n = 0, count = 0;
1765 u64 values[2];
1766
1767 values[n++] = perf_event_read_value(event);
1768 if (read_format & PERF_FORMAT_ID)
1769 values[n++] = primary_event_id(event);
1770
1771 count = n * sizeof(u64);
1772
1773 if (copy_to_user(buf, values, count))
1774 return -EFAULT;
1775
1776 return count;
1777}
1778 1805
1779static int perf_event_read_group(struct perf_event *event, 1806static int perf_event_read_group(struct perf_event *event,
1780 u64 read_format, char __user *buf) 1807 u64 read_format, char __user *buf)
1781{ 1808{
1782 struct perf_event *leader = event->group_leader, *sub; 1809 struct perf_event *leader = event->group_leader, *sub;
1783 int n = 0, size = 0, err = -EFAULT; 1810 int n = 0, size = 0, ret = -EFAULT;
1784 u64 values[3]; 1811 struct perf_event_context *ctx = leader->ctx;
1812 u64 values[5];
1813 u64 count, enabled, running;
1814
1815 mutex_lock(&ctx->mutex);
1816 count = perf_event_read_value(leader, &enabled, &running);
1785 1817
1786 values[n++] = 1 + leader->nr_siblings; 1818 values[n++] = 1 + leader->nr_siblings;
1787 if (read_format & PERF_FORMAT_TOTAL_TIME_ENABLED) { 1819 if (read_format & PERF_FORMAT_TOTAL_TIME_ENABLED)
1788 values[n++] = leader->total_time_enabled + 1820 values[n++] = enabled;
1789 atomic64_read(&leader->child_total_time_enabled); 1821 if (read_format & PERF_FORMAT_TOTAL_TIME_RUNNING)
1790 } 1822 values[n++] = running;
1791 if (read_format & PERF_FORMAT_TOTAL_TIME_RUNNING) { 1823 values[n++] = count;
1792 values[n++] = leader->total_time_running + 1824 if (read_format & PERF_FORMAT_ID)
1793 atomic64_read(&leader->child_total_time_running); 1825 values[n++] = primary_event_id(leader);
1794 }
1795 1826
1796 size = n * sizeof(u64); 1827 size = n * sizeof(u64);
1797 1828
1798 if (copy_to_user(buf, values, size)) 1829 if (copy_to_user(buf, values, size))
1799 return -EFAULT; 1830 goto unlock;
1800
1801 err = perf_event_read_entry(leader, read_format, buf + size);
1802 if (err < 0)
1803 return err;
1804 1831
1805 size += err; 1832 ret = size;
1806 1833
1807 list_for_each_entry(sub, &leader->sibling_list, group_entry) { 1834 list_for_each_entry(sub, &leader->sibling_list, group_entry) {
1808 err = perf_event_read_entry(sub, read_format, 1835 n = 0;
1809 buf + size); 1836
1810 if (err < 0) 1837 values[n++] = perf_event_read_value(sub, &enabled, &running);
1811 return err; 1838 if (read_format & PERF_FORMAT_ID)
1839 values[n++] = primary_event_id(sub);
1840
1841 size = n * sizeof(u64);
1812 1842
1813 size += err; 1843 if (copy_to_user(buf + ret, values, size)) {
1844 ret = -EFAULT;
1845 goto unlock;
1846 }
1847
1848 ret += size;
1814 } 1849 }
1850unlock:
1851 mutex_unlock(&ctx->mutex);
1815 1852
1816 return size; 1853 return ret;
1817} 1854}
1818 1855
1819static int perf_event_read_one(struct perf_event *event, 1856static int perf_event_read_one(struct perf_event *event,
1820 u64 read_format, char __user *buf) 1857 u64 read_format, char __user *buf)
1821{ 1858{
1859 u64 enabled, running;
1822 u64 values[4]; 1860 u64 values[4];
1823 int n = 0; 1861 int n = 0;
1824 1862
1825 values[n++] = perf_event_read_value(event); 1863 values[n++] = perf_event_read_value(event, &enabled, &running);
1826 if (read_format & PERF_FORMAT_TOTAL_TIME_ENABLED) { 1864 if (read_format & PERF_FORMAT_TOTAL_TIME_ENABLED)
1827 values[n++] = event->total_time_enabled + 1865 values[n++] = enabled;
1828 atomic64_read(&event->child_total_time_enabled); 1866 if (read_format & PERF_FORMAT_TOTAL_TIME_RUNNING)
1829 } 1867 values[n++] = running;
1830 if (read_format & PERF_FORMAT_TOTAL_TIME_RUNNING) {
1831 values[n++] = event->total_time_running +
1832 atomic64_read(&event->child_total_time_running);
1833 }
1834 if (read_format & PERF_FORMAT_ID) 1868 if (read_format & PERF_FORMAT_ID)
1835 values[n++] = primary_event_id(event); 1869 values[n++] = primary_event_id(event);
1836 1870
@@ -1861,12 +1895,10 @@ perf_read_hw(struct perf_event *event, char __user *buf, size_t count)
1861 return -ENOSPC; 1895 return -ENOSPC;
1862 1896
1863 WARN_ON_ONCE(event->ctx->parent_ctx); 1897 WARN_ON_ONCE(event->ctx->parent_ctx);
1864 mutex_lock(&event->child_mutex);
1865 if (read_format & PERF_FORMAT_GROUP) 1898 if (read_format & PERF_FORMAT_GROUP)
1866 ret = perf_event_read_group(event, read_format, buf); 1899 ret = perf_event_read_group(event, read_format, buf);
1867 else 1900 else
1868 ret = perf_event_read_one(event, read_format, buf); 1901 ret = perf_event_read_one(event, read_format, buf);
1869 mutex_unlock(&event->child_mutex);
1870 1902
1871 return ret; 1903 return ret;
1872} 1904}
@@ -1974,7 +2006,8 @@ unlock:
1974 return ret; 2006 return ret;
1975} 2007}
1976 2008
1977int perf_event_set_output(struct perf_event *event, int output_fd); 2009static int perf_event_set_output(struct perf_event *event, int output_fd);
2010static int perf_event_set_filter(struct perf_event *event, void __user *arg);
1978 2011
1979static long perf_ioctl(struct file *file, unsigned int cmd, unsigned long arg) 2012static long perf_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
1980{ 2013{
@@ -2002,6 +2035,9 @@ static long perf_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
2002 case PERF_EVENT_IOC_SET_OUTPUT: 2035 case PERF_EVENT_IOC_SET_OUTPUT:
2003 return perf_event_set_output(event, arg); 2036 return perf_event_set_output(event, arg);
2004 2037
2038 case PERF_EVENT_IOC_SET_FILTER:
2039 return perf_event_set_filter(event, (void __user *)arg);
2040
2005 default: 2041 default:
2006 return -ENOTTY; 2042 return -ENOTTY;
2007 } 2043 }
@@ -2174,6 +2210,7 @@ static void perf_mmap_data_free(struct perf_mmap_data *data)
2174 perf_mmap_free_page((unsigned long)data->user_page); 2210 perf_mmap_free_page((unsigned long)data->user_page);
2175 for (i = 0; i < data->nr_pages; i++) 2211 for (i = 0; i < data->nr_pages; i++)
2176 perf_mmap_free_page((unsigned long)data->data_pages[i]); 2212 perf_mmap_free_page((unsigned long)data->data_pages[i]);
2213 kfree(data);
2177} 2214}
2178 2215
2179#else 2216#else
@@ -2214,6 +2251,7 @@ static void perf_mmap_data_free_work(struct work_struct *work)
2214 perf_mmap_unmark_page(base + (i * PAGE_SIZE)); 2251 perf_mmap_unmark_page(base + (i * PAGE_SIZE));
2215 2252
2216 vfree(base); 2253 vfree(base);
2254 kfree(data);
2217} 2255}
2218 2256
2219static void perf_mmap_data_free(struct perf_mmap_data *data) 2257static void perf_mmap_data_free(struct perf_mmap_data *data)
@@ -2307,7 +2345,7 @@ perf_mmap_data_init(struct perf_event *event, struct perf_mmap_data *data)
2307 } 2345 }
2308 2346
2309 if (!data->watermark) 2347 if (!data->watermark)
2310 data->watermark = max_t(long, PAGE_SIZE, max_size / 2); 2348 data->watermark = max_size / 2;
2311 2349
2312 2350
2313 rcu_assign_pointer(event->data, data); 2351 rcu_assign_pointer(event->data, data);
@@ -2319,7 +2357,6 @@ static void perf_mmap_data_free_rcu(struct rcu_head *rcu_head)
2319 2357
2320 data = container_of(rcu_head, struct perf_mmap_data, rcu_head); 2358 data = container_of(rcu_head, struct perf_mmap_data, rcu_head);
2321 perf_mmap_data_free(data); 2359 perf_mmap_data_free(data);
2322 kfree(data);
2323} 2360}
2324 2361
2325static void perf_mmap_data_release(struct perf_event *event) 2362static void perf_mmap_data_release(struct perf_event *event)
@@ -2666,20 +2703,21 @@ static void perf_output_wakeup(struct perf_output_handle *handle)
2666static void perf_output_lock(struct perf_output_handle *handle) 2703static void perf_output_lock(struct perf_output_handle *handle)
2667{ 2704{
2668 struct perf_mmap_data *data = handle->data; 2705 struct perf_mmap_data *data = handle->data;
2669 int cpu; 2706 int cur, cpu = get_cpu();
2670 2707
2671 handle->locked = 0; 2708 handle->locked = 0;
2672 2709
2673 local_irq_save(handle->flags); 2710 for (;;) {
2674 cpu = smp_processor_id(); 2711 cur = atomic_cmpxchg(&data->lock, -1, cpu);
2675 2712 if (cur == -1) {
2676 if (in_nmi() && atomic_read(&data->lock) == cpu) 2713 handle->locked = 1;
2677 return; 2714 break;
2715 }
2716 if (cur == cpu)
2717 break;
2678 2718
2679 while (atomic_cmpxchg(&data->lock, -1, cpu) != -1)
2680 cpu_relax(); 2719 cpu_relax();
2681 2720 }
2682 handle->locked = 1;
2683} 2721}
2684 2722
2685static void perf_output_unlock(struct perf_output_handle *handle) 2723static void perf_output_unlock(struct perf_output_handle *handle)
@@ -2725,7 +2763,7 @@ again:
2725 if (atomic_xchg(&data->wakeup, 0)) 2763 if (atomic_xchg(&data->wakeup, 0))
2726 perf_output_wakeup(handle); 2764 perf_output_wakeup(handle);
2727out: 2765out:
2728 local_irq_restore(handle->flags); 2766 put_cpu();
2729} 2767}
2730 2768
2731void perf_output_copy(struct perf_output_handle *handle, 2769void perf_output_copy(struct perf_output_handle *handle,
@@ -3236,15 +3274,10 @@ static void perf_event_task_ctx(struct perf_event_context *ctx,
3236{ 3274{
3237 struct perf_event *event; 3275 struct perf_event *event;
3238 3276
3239 if (system_state != SYSTEM_RUNNING || list_empty(&ctx->event_list))
3240 return;
3241
3242 rcu_read_lock();
3243 list_for_each_entry_rcu(event, &ctx->event_list, event_entry) { 3277 list_for_each_entry_rcu(event, &ctx->event_list, event_entry) {
3244 if (perf_event_task_match(event)) 3278 if (perf_event_task_match(event))
3245 perf_event_task_output(event, task_event); 3279 perf_event_task_output(event, task_event);
3246 } 3280 }
3247 rcu_read_unlock();
3248} 3281}
3249 3282
3250static void perf_event_task_event(struct perf_task_event *task_event) 3283static void perf_event_task_event(struct perf_task_event *task_event)
@@ -3252,11 +3285,11 @@ static void perf_event_task_event(struct perf_task_event *task_event)
3252 struct perf_cpu_context *cpuctx; 3285 struct perf_cpu_context *cpuctx;
3253 struct perf_event_context *ctx = task_event->task_ctx; 3286 struct perf_event_context *ctx = task_event->task_ctx;
3254 3287
3288 rcu_read_lock();
3255 cpuctx = &get_cpu_var(perf_cpu_context); 3289 cpuctx = &get_cpu_var(perf_cpu_context);
3256 perf_event_task_ctx(&cpuctx->ctx, task_event); 3290 perf_event_task_ctx(&cpuctx->ctx, task_event);
3257 put_cpu_var(perf_cpu_context); 3291 put_cpu_var(perf_cpu_context);
3258 3292
3259 rcu_read_lock();
3260 if (!ctx) 3293 if (!ctx)
3261 ctx = rcu_dereference(task_event->task->perf_event_ctxp); 3294 ctx = rcu_dereference(task_event->task->perf_event_ctxp);
3262 if (ctx) 3295 if (ctx)
@@ -3348,15 +3381,10 @@ static void perf_event_comm_ctx(struct perf_event_context *ctx,
3348{ 3381{
3349 struct perf_event *event; 3382 struct perf_event *event;
3350 3383
3351 if (system_state != SYSTEM_RUNNING || list_empty(&ctx->event_list))
3352 return;
3353
3354 rcu_read_lock();
3355 list_for_each_entry_rcu(event, &ctx->event_list, event_entry) { 3384 list_for_each_entry_rcu(event, &ctx->event_list, event_entry) {
3356 if (perf_event_comm_match(event)) 3385 if (perf_event_comm_match(event))
3357 perf_event_comm_output(event, comm_event); 3386 perf_event_comm_output(event, comm_event);
3358 } 3387 }
3359 rcu_read_unlock();
3360} 3388}
3361 3389
3362static void perf_event_comm_event(struct perf_comm_event *comm_event) 3390static void perf_event_comm_event(struct perf_comm_event *comm_event)
@@ -3367,7 +3395,7 @@ static void perf_event_comm_event(struct perf_comm_event *comm_event)
3367 char comm[TASK_COMM_LEN]; 3395 char comm[TASK_COMM_LEN];
3368 3396
3369 memset(comm, 0, sizeof(comm)); 3397 memset(comm, 0, sizeof(comm));
3370 strncpy(comm, comm_event->task->comm, sizeof(comm)); 3398 strlcpy(comm, comm_event->task->comm, sizeof(comm));
3371 size = ALIGN(strlen(comm)+1, sizeof(u64)); 3399 size = ALIGN(strlen(comm)+1, sizeof(u64));
3372 3400
3373 comm_event->comm = comm; 3401 comm_event->comm = comm;
@@ -3375,11 +3403,11 @@ static void perf_event_comm_event(struct perf_comm_event *comm_event)
3375 3403
3376 comm_event->event_id.header.size = sizeof(comm_event->event_id) + size; 3404 comm_event->event_id.header.size = sizeof(comm_event->event_id) + size;
3377 3405
3406 rcu_read_lock();
3378 cpuctx = &get_cpu_var(perf_cpu_context); 3407 cpuctx = &get_cpu_var(perf_cpu_context);
3379 perf_event_comm_ctx(&cpuctx->ctx, comm_event); 3408 perf_event_comm_ctx(&cpuctx->ctx, comm_event);
3380 put_cpu_var(perf_cpu_context); 3409 put_cpu_var(perf_cpu_context);
3381 3410
3382 rcu_read_lock();
3383 /* 3411 /*
3384 * doesn't really matter which of the child contexts the 3412 * doesn't really matter which of the child contexts the
3385 * events ends up in. 3413 * events ends up in.
@@ -3472,15 +3500,10 @@ static void perf_event_mmap_ctx(struct perf_event_context *ctx,
3472{ 3500{
3473 struct perf_event *event; 3501 struct perf_event *event;
3474 3502
3475 if (system_state != SYSTEM_RUNNING || list_empty(&ctx->event_list))
3476 return;
3477
3478 rcu_read_lock();
3479 list_for_each_entry_rcu(event, &ctx->event_list, event_entry) { 3503 list_for_each_entry_rcu(event, &ctx->event_list, event_entry) {
3480 if (perf_event_mmap_match(event, mmap_event)) 3504 if (perf_event_mmap_match(event, mmap_event))
3481 perf_event_mmap_output(event, mmap_event); 3505 perf_event_mmap_output(event, mmap_event);
3482 } 3506 }
3483 rcu_read_unlock();
3484} 3507}
3485 3508
3486static void perf_event_mmap_event(struct perf_mmap_event *mmap_event) 3509static void perf_event_mmap_event(struct perf_mmap_event *mmap_event)
@@ -3536,11 +3559,11 @@ got_name:
3536 3559
3537 mmap_event->event_id.header.size = sizeof(mmap_event->event_id) + size; 3560 mmap_event->event_id.header.size = sizeof(mmap_event->event_id) + size;
3538 3561
3562 rcu_read_lock();
3539 cpuctx = &get_cpu_var(perf_cpu_context); 3563 cpuctx = &get_cpu_var(perf_cpu_context);
3540 perf_event_mmap_ctx(&cpuctx->ctx, mmap_event); 3564 perf_event_mmap_ctx(&cpuctx->ctx, mmap_event);
3541 put_cpu_var(perf_cpu_context); 3565 put_cpu_var(perf_cpu_context);
3542 3566
3543 rcu_read_lock();
3544 /* 3567 /*
3545 * doesn't really matter which of the child contexts the 3568 * doesn't really matter which of the child contexts the
3546 * events ends up in. 3569 * events ends up in.
@@ -3679,7 +3702,11 @@ static int __perf_event_overflow(struct perf_event *event, int nmi,
3679 perf_event_disable(event); 3702 perf_event_disable(event);
3680 } 3703 }
3681 3704
3682 perf_event_output(event, nmi, data, regs); 3705 if (event->overflow_handler)
3706 event->overflow_handler(event, nmi, data, regs);
3707 else
3708 perf_event_output(event, nmi, data, regs);
3709
3683 return ret; 3710 return ret;
3684} 3711}
3685 3712
@@ -3724,16 +3751,16 @@ again:
3724 return nr; 3751 return nr;
3725} 3752}
3726 3753
3727static void perf_swevent_overflow(struct perf_event *event, 3754static void perf_swevent_overflow(struct perf_event *event, u64 overflow,
3728 int nmi, struct perf_sample_data *data, 3755 int nmi, struct perf_sample_data *data,
3729 struct pt_regs *regs) 3756 struct pt_regs *regs)
3730{ 3757{
3731 struct hw_perf_event *hwc = &event->hw; 3758 struct hw_perf_event *hwc = &event->hw;
3732 int throttle = 0; 3759 int throttle = 0;
3733 u64 overflow;
3734 3760
3735 data->period = event->hw.last_period; 3761 data->period = event->hw.last_period;
3736 overflow = perf_swevent_set_period(event); 3762 if (!overflow)
3763 overflow = perf_swevent_set_period(event);
3737 3764
3738 if (hwc->interrupts == MAX_INTERRUPTS) 3765 if (hwc->interrupts == MAX_INTERRUPTS)
3739 return; 3766 return;
@@ -3766,14 +3793,19 @@ static void perf_swevent_add(struct perf_event *event, u64 nr,
3766 3793
3767 atomic64_add(nr, &event->count); 3794 atomic64_add(nr, &event->count);
3768 3795
3796 if (!regs)
3797 return;
3798
3769 if (!hwc->sample_period) 3799 if (!hwc->sample_period)
3770 return; 3800 return;
3771 3801
3772 if (!regs) 3802 if (nr == 1 && hwc->sample_period == 1 && !event->attr.freq)
3803 return perf_swevent_overflow(event, 1, nmi, data, regs);
3804
3805 if (atomic64_add_negative(nr, &hwc->period_left))
3773 return; 3806 return;
3774 3807
3775 if (!atomic64_add_negative(nr, &hwc->period_left)) 3808 perf_swevent_overflow(event, 0, nmi, data, regs);
3776 perf_swevent_overflow(event, nmi, data, regs);
3777} 3809}
3778 3810
3779static int perf_swevent_is_counting(struct perf_event *event) 3811static int perf_swevent_is_counting(struct perf_event *event)
@@ -3806,25 +3838,44 @@ static int perf_swevent_is_counting(struct perf_event *event)
3806 return 1; 3838 return 1;
3807} 3839}
3808 3840
3841static int perf_tp_event_match(struct perf_event *event,
3842 struct perf_sample_data *data);
3843
3844static int perf_exclude_event(struct perf_event *event,
3845 struct pt_regs *regs)
3846{
3847 if (regs) {
3848 if (event->attr.exclude_user && user_mode(regs))
3849 return 1;
3850
3851 if (event->attr.exclude_kernel && !user_mode(regs))
3852 return 1;
3853 }
3854
3855 return 0;
3856}
3857
3809static int perf_swevent_match(struct perf_event *event, 3858static int perf_swevent_match(struct perf_event *event,
3810 enum perf_type_id type, 3859 enum perf_type_id type,
3811 u32 event_id, struct pt_regs *regs) 3860 u32 event_id,
3861 struct perf_sample_data *data,
3862 struct pt_regs *regs)
3812{ 3863{
3813 if (!perf_swevent_is_counting(event)) 3864 if (!perf_swevent_is_counting(event))
3814 return 0; 3865 return 0;
3815 3866
3816 if (event->attr.type != type) 3867 if (event->attr.type != type)
3817 return 0; 3868 return 0;
3869
3818 if (event->attr.config != event_id) 3870 if (event->attr.config != event_id)
3819 return 0; 3871 return 0;
3820 3872
3821 if (regs) { 3873 if (perf_exclude_event(event, regs))
3822 if (event->attr.exclude_user && user_mode(regs)) 3874 return 0;
3823 return 0;
3824 3875
3825 if (event->attr.exclude_kernel && !user_mode(regs)) 3876 if (event->attr.type == PERF_TYPE_TRACEPOINT &&
3826 return 0; 3877 !perf_tp_event_match(event, data))
3827 } 3878 return 0;
3828 3879
3829 return 1; 3880 return 1;
3830} 3881}
@@ -3837,49 +3888,59 @@ static void perf_swevent_ctx_event(struct perf_event_context *ctx,
3837{ 3888{
3838 struct perf_event *event; 3889 struct perf_event *event;
3839 3890
3840 if (system_state != SYSTEM_RUNNING || list_empty(&ctx->event_list))
3841 return;
3842
3843 rcu_read_lock();
3844 list_for_each_entry_rcu(event, &ctx->event_list, event_entry) { 3891 list_for_each_entry_rcu(event, &ctx->event_list, event_entry) {
3845 if (perf_swevent_match(event, type, event_id, regs)) 3892 if (perf_swevent_match(event, type, event_id, data, regs))
3846 perf_swevent_add(event, nr, nmi, data, regs); 3893 perf_swevent_add(event, nr, nmi, data, regs);
3847 } 3894 }
3848 rcu_read_unlock();
3849} 3895}
3850 3896
3851static int *perf_swevent_recursion_context(struct perf_cpu_context *cpuctx) 3897int perf_swevent_get_recursion_context(void)
3852{ 3898{
3899 struct perf_cpu_context *cpuctx = &get_cpu_var(perf_cpu_context);
3900 int rctx;
3901
3853 if (in_nmi()) 3902 if (in_nmi())
3854 return &cpuctx->recursion[3]; 3903 rctx = 3;
3904 else if (in_irq())
3905 rctx = 2;
3906 else if (in_softirq())
3907 rctx = 1;
3908 else
3909 rctx = 0;
3910
3911 if (cpuctx->recursion[rctx]) {
3912 put_cpu_var(perf_cpu_context);
3913 return -1;
3914 }
3855 3915
3856 if (in_irq()) 3916 cpuctx->recursion[rctx]++;
3857 return &cpuctx->recursion[2]; 3917 barrier();
3858 3918
3859 if (in_softirq()) 3919 return rctx;
3860 return &cpuctx->recursion[1]; 3920}
3921EXPORT_SYMBOL_GPL(perf_swevent_get_recursion_context);
3861 3922
3862 return &cpuctx->recursion[0]; 3923void perf_swevent_put_recursion_context(int rctx)
3924{
3925 struct perf_cpu_context *cpuctx = &__get_cpu_var(perf_cpu_context);
3926 barrier();
3927 cpuctx->recursion[rctx]--;
3928 put_cpu_var(perf_cpu_context);
3863} 3929}
3930EXPORT_SYMBOL_GPL(perf_swevent_put_recursion_context);
3864 3931
3865static void do_perf_sw_event(enum perf_type_id type, u32 event_id, 3932static void do_perf_sw_event(enum perf_type_id type, u32 event_id,
3866 u64 nr, int nmi, 3933 u64 nr, int nmi,
3867 struct perf_sample_data *data, 3934 struct perf_sample_data *data,
3868 struct pt_regs *regs) 3935 struct pt_regs *regs)
3869{ 3936{
3870 struct perf_cpu_context *cpuctx = &get_cpu_var(perf_cpu_context); 3937 struct perf_cpu_context *cpuctx;
3871 int *recursion = perf_swevent_recursion_context(cpuctx);
3872 struct perf_event_context *ctx; 3938 struct perf_event_context *ctx;
3873 3939
3874 if (*recursion) 3940 cpuctx = &__get_cpu_var(perf_cpu_context);
3875 goto out; 3941 rcu_read_lock();
3876
3877 (*recursion)++;
3878 barrier();
3879
3880 perf_swevent_ctx_event(&cpuctx->ctx, type, event_id, 3942 perf_swevent_ctx_event(&cpuctx->ctx, type, event_id,
3881 nr, nmi, data, regs); 3943 nr, nmi, data, regs);
3882 rcu_read_lock();
3883 /* 3944 /*
3884 * doesn't really matter which of the child contexts the 3945 * doesn't really matter which of the child contexts the
3885 * events ends up in. 3946 * events ends up in.
@@ -3888,23 +3949,24 @@ static void do_perf_sw_event(enum perf_type_id type, u32 event_id,
3888 if (ctx) 3949 if (ctx)
3889 perf_swevent_ctx_event(ctx, type, event_id, nr, nmi, data, regs); 3950 perf_swevent_ctx_event(ctx, type, event_id, nr, nmi, data, regs);
3890 rcu_read_unlock(); 3951 rcu_read_unlock();
3891
3892 barrier();
3893 (*recursion)--;
3894
3895out:
3896 put_cpu_var(perf_cpu_context);
3897} 3952}
3898 3953
3899void __perf_sw_event(u32 event_id, u64 nr, int nmi, 3954void __perf_sw_event(u32 event_id, u64 nr, int nmi,
3900 struct pt_regs *regs, u64 addr) 3955 struct pt_regs *regs, u64 addr)
3901{ 3956{
3902 struct perf_sample_data data = { 3957 struct perf_sample_data data;
3903 .addr = addr, 3958 int rctx;
3904 };
3905 3959
3906 do_perf_sw_event(PERF_TYPE_SOFTWARE, event_id, nr, nmi, 3960 rctx = perf_swevent_get_recursion_context();
3907 &data, regs); 3961 if (rctx < 0)
3962 return;
3963
3964 data.addr = addr;
3965 data.raw = NULL;
3966
3967 do_perf_sw_event(PERF_TYPE_SOFTWARE, event_id, nr, nmi, &data, regs);
3968
3969 perf_swevent_put_recursion_context(rctx);
3908} 3970}
3909 3971
3910static void perf_swevent_read(struct perf_event *event) 3972static void perf_swevent_read(struct perf_event *event)
@@ -3949,6 +4011,7 @@ static enum hrtimer_restart perf_swevent_hrtimer(struct hrtimer *hrtimer)
3949 event->pmu->read(event); 4011 event->pmu->read(event);
3950 4012
3951 data.addr = 0; 4013 data.addr = 0;
4014 data.period = event->hw.last_period;
3952 regs = get_irq_regs(); 4015 regs = get_irq_regs();
3953 /* 4016 /*
3954 * In case we exclude kernel IPs or are somehow not in interrupt 4017 * In case we exclude kernel IPs or are somehow not in interrupt
@@ -4108,6 +4171,7 @@ static const struct pmu perf_ops_task_clock = {
4108}; 4171};
4109 4172
4110#ifdef CONFIG_EVENT_PROFILE 4173#ifdef CONFIG_EVENT_PROFILE
4174
4111void perf_tp_event(int event_id, u64 addr, u64 count, void *record, 4175void perf_tp_event(int event_id, u64 addr, u64 count, void *record,
4112 int entry_size) 4176 int entry_size)
4113{ 4177{
@@ -4126,13 +4190,21 @@ void perf_tp_event(int event_id, u64 addr, u64 count, void *record,
4126 if (!regs) 4190 if (!regs)
4127 regs = task_pt_regs(current); 4191 regs = task_pt_regs(current);
4128 4192
4193 /* Trace events already protected against recursion */
4129 do_perf_sw_event(PERF_TYPE_TRACEPOINT, event_id, count, 1, 4194 do_perf_sw_event(PERF_TYPE_TRACEPOINT, event_id, count, 1,
4130 &data, regs); 4195 &data, regs);
4131} 4196}
4132EXPORT_SYMBOL_GPL(perf_tp_event); 4197EXPORT_SYMBOL_GPL(perf_tp_event);
4133 4198
4134extern int ftrace_profile_enable(int); 4199static int perf_tp_event_match(struct perf_event *event,
4135extern void ftrace_profile_disable(int); 4200 struct perf_sample_data *data)
4201{
4202 void *record = data->raw->data;
4203
4204 if (likely(!event->filter) || filter_match_preds(event->filter, record))
4205 return 1;
4206 return 0;
4207}
4136 4208
4137static void tp_perf_event_destroy(struct perf_event *event) 4209static void tp_perf_event_destroy(struct perf_event *event)
4138{ 4210{
@@ -4157,11 +4229,99 @@ static const struct pmu *tp_perf_event_init(struct perf_event *event)
4157 4229
4158 return &perf_ops_generic; 4230 return &perf_ops_generic;
4159} 4231}
4232
4233static int perf_event_set_filter(struct perf_event *event, void __user *arg)
4234{
4235 char *filter_str;
4236 int ret;
4237
4238 if (event->attr.type != PERF_TYPE_TRACEPOINT)
4239 return -EINVAL;
4240
4241 filter_str = strndup_user(arg, PAGE_SIZE);
4242 if (IS_ERR(filter_str))
4243 return PTR_ERR(filter_str);
4244
4245 ret = ftrace_profile_set_filter(event, event->attr.config, filter_str);
4246
4247 kfree(filter_str);
4248 return ret;
4249}
4250
4251static void perf_event_free_filter(struct perf_event *event)
4252{
4253 ftrace_profile_free_filter(event);
4254}
4255
4160#else 4256#else
4257
4258static int perf_tp_event_match(struct perf_event *event,
4259 struct perf_sample_data *data)
4260{
4261 return 1;
4262}
4263
4161static const struct pmu *tp_perf_event_init(struct perf_event *event) 4264static const struct pmu *tp_perf_event_init(struct perf_event *event)
4162{ 4265{
4163 return NULL; 4266 return NULL;
4164} 4267}
4268
4269static int perf_event_set_filter(struct perf_event *event, void __user *arg)
4270{
4271 return -ENOENT;
4272}
4273
4274static void perf_event_free_filter(struct perf_event *event)
4275{
4276}
4277
4278#endif /* CONFIG_EVENT_PROFILE */
4279
4280#ifdef CONFIG_HAVE_HW_BREAKPOINT
4281static void bp_perf_event_destroy(struct perf_event *event)
4282{
4283 release_bp_slot(event);
4284}
4285
4286static const struct pmu *bp_perf_event_init(struct perf_event *bp)
4287{
4288 int err;
4289 /*
4290 * The breakpoint is already filled if we haven't created the counter
4291 * through perf syscall
4292 * FIXME: manage to get trigerred to NULL if it comes from syscalls
4293 */
4294 if (!bp->callback)
4295 err = register_perf_hw_breakpoint(bp);
4296 else
4297 err = __register_perf_hw_breakpoint(bp);
4298 if (err)
4299 return ERR_PTR(err);
4300
4301 bp->destroy = bp_perf_event_destroy;
4302
4303 return &perf_ops_bp;
4304}
4305
4306void perf_bp_event(struct perf_event *bp, void *data)
4307{
4308 struct perf_sample_data sample;
4309 struct pt_regs *regs = data;
4310
4311 sample.addr = bp->attr.bp_addr;
4312
4313 if (!perf_exclude_event(bp, regs))
4314 perf_swevent_add(bp, 1, 1, &sample, regs);
4315}
4316#else
4317static const struct pmu *bp_perf_event_init(struct perf_event *bp)
4318{
4319 return NULL;
4320}
4321
4322void perf_bp_event(struct perf_event *bp, void *regs)
4323{
4324}
4165#endif 4325#endif
4166 4326
4167atomic_t perf_swevent_enabled[PERF_COUNT_SW_MAX]; 4327atomic_t perf_swevent_enabled[PERF_COUNT_SW_MAX];
@@ -4208,6 +4368,8 @@ static const struct pmu *sw_perf_event_init(struct perf_event *event)
4208 case PERF_COUNT_SW_PAGE_FAULTS_MAJ: 4368 case PERF_COUNT_SW_PAGE_FAULTS_MAJ:
4209 case PERF_COUNT_SW_CONTEXT_SWITCHES: 4369 case PERF_COUNT_SW_CONTEXT_SWITCHES:
4210 case PERF_COUNT_SW_CPU_MIGRATIONS: 4370 case PERF_COUNT_SW_CPU_MIGRATIONS:
4371 case PERF_COUNT_SW_ALIGNMENT_FAULTS:
4372 case PERF_COUNT_SW_EMULATION_FAULTS:
4211 if (!event->parent) { 4373 if (!event->parent) {
4212 atomic_inc(&perf_swevent_enabled[event_id]); 4374 atomic_inc(&perf_swevent_enabled[event_id]);
4213 event->destroy = sw_perf_event_destroy; 4375 event->destroy = sw_perf_event_destroy;
@@ -4228,6 +4390,7 @@ perf_event_alloc(struct perf_event_attr *attr,
4228 struct perf_event_context *ctx, 4390 struct perf_event_context *ctx,
4229 struct perf_event *group_leader, 4391 struct perf_event *group_leader,
4230 struct perf_event *parent_event, 4392 struct perf_event *parent_event,
4393 perf_callback_t callback,
4231 gfp_t gfpflags) 4394 gfp_t gfpflags)
4232{ 4395{
4233 const struct pmu *pmu; 4396 const struct pmu *pmu;
@@ -4270,6 +4433,11 @@ perf_event_alloc(struct perf_event_attr *attr,
4270 4433
4271 event->state = PERF_EVENT_STATE_INACTIVE; 4434 event->state = PERF_EVENT_STATE_INACTIVE;
4272 4435
4436 if (!callback && parent_event)
4437 callback = parent_event->callback;
4438
4439 event->callback = callback;
4440
4273 if (attr->disabled) 4441 if (attr->disabled)
4274 event->state = PERF_EVENT_STATE_OFF; 4442 event->state = PERF_EVENT_STATE_OFF;
4275 4443
@@ -4304,6 +4472,11 @@ perf_event_alloc(struct perf_event_attr *attr,
4304 pmu = tp_perf_event_init(event); 4472 pmu = tp_perf_event_init(event);
4305 break; 4473 break;
4306 4474
4475 case PERF_TYPE_BREAKPOINT:
4476 pmu = bp_perf_event_init(event);
4477 break;
4478
4479
4307 default: 4480 default:
4308 break; 4481 break;
4309 } 4482 }
@@ -4416,7 +4589,7 @@ err_size:
4416 goto out; 4589 goto out;
4417} 4590}
4418 4591
4419int perf_event_set_output(struct perf_event *event, int output_fd) 4592static int perf_event_set_output(struct perf_event *event, int output_fd)
4420{ 4593{
4421 struct perf_event *output_event = NULL; 4594 struct perf_event *output_event = NULL;
4422 struct file *output_file = NULL; 4595 struct file *output_file = NULL;
@@ -4546,7 +4719,7 @@ SYSCALL_DEFINE5(perf_event_open,
4546 } 4719 }
4547 4720
4548 event = perf_event_alloc(&attr, cpu, ctx, group_leader, 4721 event = perf_event_alloc(&attr, cpu, ctx, group_leader,
4549 NULL, GFP_KERNEL); 4722 NULL, NULL, GFP_KERNEL);
4550 err = PTR_ERR(event); 4723 err = PTR_ERR(event);
4551 if (IS_ERR(event)) 4724 if (IS_ERR(event))
4552 goto err_put_context; 4725 goto err_put_context;
@@ -4594,6 +4767,60 @@ err_put_context:
4594 return err; 4767 return err;
4595} 4768}
4596 4769
4770/**
4771 * perf_event_create_kernel_counter
4772 *
4773 * @attr: attributes of the counter to create
4774 * @cpu: cpu in which the counter is bound
4775 * @pid: task to profile
4776 */
4777struct perf_event *
4778perf_event_create_kernel_counter(struct perf_event_attr *attr, int cpu,
4779 pid_t pid, perf_callback_t callback)
4780{
4781 struct perf_event *event;
4782 struct perf_event_context *ctx;
4783 int err;
4784
4785 /*
4786 * Get the target context (task or percpu):
4787 */
4788
4789 ctx = find_get_context(pid, cpu);
4790 if (IS_ERR(ctx)) {
4791 err = PTR_ERR(ctx);
4792 goto err_exit;
4793 }
4794
4795 event = perf_event_alloc(attr, cpu, ctx, NULL,
4796 NULL, callback, GFP_KERNEL);
4797 if (IS_ERR(event)) {
4798 err = PTR_ERR(event);
4799 goto err_put_context;
4800 }
4801
4802 event->filp = NULL;
4803 WARN_ON_ONCE(ctx->parent_ctx);
4804 mutex_lock(&ctx->mutex);
4805 perf_install_in_context(ctx, event, cpu);
4806 ++ctx->generation;
4807 mutex_unlock(&ctx->mutex);
4808
4809 event->owner = current;
4810 get_task_struct(current);
4811 mutex_lock(&current->perf_event_mutex);
4812 list_add_tail(&event->owner_entry, &current->perf_event_list);
4813 mutex_unlock(&current->perf_event_mutex);
4814
4815 return event;
4816
4817 err_put_context:
4818 put_ctx(ctx);
4819 err_exit:
4820 return ERR_PTR(err);
4821}
4822EXPORT_SYMBOL_GPL(perf_event_create_kernel_counter);
4823
4597/* 4824/*
4598 * inherit a event from parent task to child task: 4825 * inherit a event from parent task to child task:
4599 */ 4826 */
@@ -4619,7 +4846,7 @@ inherit_event(struct perf_event *parent_event,
4619 child_event = perf_event_alloc(&parent_event->attr, 4846 child_event = perf_event_alloc(&parent_event->attr,
4620 parent_event->cpu, child_ctx, 4847 parent_event->cpu, child_ctx,
4621 group_leader, parent_event, 4848 group_leader, parent_event,
4622 GFP_KERNEL); 4849 NULL, GFP_KERNEL);
4623 if (IS_ERR(child_event)) 4850 if (IS_ERR(child_event))
4624 return child_event; 4851 return child_event;
4625 get_ctx(child_ctx); 4852 get_ctx(child_ctx);
@@ -4637,6 +4864,8 @@ inherit_event(struct perf_event *parent_event,
4637 if (parent_event->attr.freq) 4864 if (parent_event->attr.freq)
4638 child_event->hw.sample_period = parent_event->hw.sample_period; 4865 child_event->hw.sample_period = parent_event->hw.sample_period;
4639 4866
4867 child_event->overflow_handler = parent_event->overflow_handler;
4868
4640 /* 4869 /*
4641 * Link it up in the child's context: 4870 * Link it up in the child's context:
4642 */ 4871 */
@@ -4726,7 +4955,6 @@ __perf_event_exit_task(struct perf_event *child_event,
4726{ 4955{
4727 struct perf_event *parent_event; 4956 struct perf_event *parent_event;
4728 4957
4729 update_event_times(child_event);
4730 perf_event_remove_from_context(child_event); 4958 perf_event_remove_from_context(child_event);
4731 4959
4732 parent_event = child_event->parent; 4960 parent_event = child_event->parent;
@@ -4778,6 +5006,7 @@ void perf_event_exit_task(struct task_struct *child)
4778 * the events from it. 5006 * the events from it.
4779 */ 5007 */
4780 unclone_ctx(child_ctx); 5008 unclone_ctx(child_ctx);
5009 update_context_time(child_ctx);
4781 spin_unlock_irqrestore(&child_ctx->lock, flags); 5010 spin_unlock_irqrestore(&child_ctx->lock, flags);
4782 5011
4783 /* 5012 /*
diff --git a/kernel/power/hibernate.c b/kernel/power/hibernate.c
index 04b3a83d686f..04a9e90d248f 100644
--- a/kernel/power/hibernate.c
+++ b/kernel/power/hibernate.c
@@ -693,21 +693,22 @@ static int software_resume(void)
693 /* The snapshot device should not be opened while we're running */ 693 /* The snapshot device should not be opened while we're running */
694 if (!atomic_add_unless(&snapshot_device_available, -1, 0)) { 694 if (!atomic_add_unless(&snapshot_device_available, -1, 0)) {
695 error = -EBUSY; 695 error = -EBUSY;
696 swsusp_close(FMODE_READ);
696 goto Unlock; 697 goto Unlock;
697 } 698 }
698 699
699 pm_prepare_console(); 700 pm_prepare_console();
700 error = pm_notifier_call_chain(PM_RESTORE_PREPARE); 701 error = pm_notifier_call_chain(PM_RESTORE_PREPARE);
701 if (error) 702 if (error)
702 goto Finish; 703 goto close_finish;
703 704
704 error = usermodehelper_disable(); 705 error = usermodehelper_disable();
705 if (error) 706 if (error)
706 goto Finish; 707 goto close_finish;
707 708
708 error = create_basic_memory_bitmaps(); 709 error = create_basic_memory_bitmaps();
709 if (error) 710 if (error)
710 goto Finish; 711 goto close_finish;
711 712
712 pr_debug("PM: Preparing processes for restore.\n"); 713 pr_debug("PM: Preparing processes for restore.\n");
713 error = prepare_processes(); 714 error = prepare_processes();
@@ -719,6 +720,7 @@ static int software_resume(void)
719 pr_debug("PM: Reading hibernation image.\n"); 720 pr_debug("PM: Reading hibernation image.\n");
720 721
721 error = swsusp_read(&flags); 722 error = swsusp_read(&flags);
723 swsusp_close(FMODE_READ);
722 if (!error) 724 if (!error)
723 hibernation_restore(flags & SF_PLATFORM_MODE); 725 hibernation_restore(flags & SF_PLATFORM_MODE);
724 726
@@ -737,6 +739,9 @@ static int software_resume(void)
737 mutex_unlock(&pm_mutex); 739 mutex_unlock(&pm_mutex);
738 pr_debug("PM: Resume from disk failed.\n"); 740 pr_debug("PM: Resume from disk failed.\n");
739 return error; 741 return error;
742close_finish:
743 swsusp_close(FMODE_READ);
744 goto Finish;
740} 745}
741 746
742late_initcall(software_resume); 747late_initcall(software_resume);
diff --git a/kernel/power/swap.c b/kernel/power/swap.c
index b101cdc4df3f..890f6b11b1d3 100644
--- a/kernel/power/swap.c
+++ b/kernel/power/swap.c
@@ -314,7 +314,6 @@ static int save_image(struct swap_map_handle *handle,
314{ 314{
315 unsigned int m; 315 unsigned int m;
316 int ret; 316 int ret;
317 int error = 0;
318 int nr_pages; 317 int nr_pages;
319 int err2; 318 int err2;
320 struct bio *bio; 319 struct bio *bio;
@@ -329,26 +328,27 @@ static int save_image(struct swap_map_handle *handle,
329 nr_pages = 0; 328 nr_pages = 0;
330 bio = NULL; 329 bio = NULL;
331 do_gettimeofday(&start); 330 do_gettimeofday(&start);
332 do { 331 while (1) {
333 ret = snapshot_read_next(snapshot, PAGE_SIZE); 332 ret = snapshot_read_next(snapshot, PAGE_SIZE);
334 if (ret > 0) { 333 if (ret <= 0)
335 error = swap_write_page(handle, data_of(*snapshot), 334 break;
336 &bio); 335 ret = swap_write_page(handle, data_of(*snapshot), &bio);
337 if (error) 336 if (ret)
338 break; 337 break;
339 if (!(nr_pages % m)) 338 if (!(nr_pages % m))
340 printk("\b\b\b\b%3d%%", nr_pages / m); 339 printk("\b\b\b\b%3d%%", nr_pages / m);
341 nr_pages++; 340 nr_pages++;
342 } 341 }
343 } while (ret > 0);
344 err2 = wait_on_bio_chain(&bio); 342 err2 = wait_on_bio_chain(&bio);
345 do_gettimeofday(&stop); 343 do_gettimeofday(&stop);
346 if (!error) 344 if (!ret)
347 error = err2; 345 ret = err2;
348 if (!error) 346 if (!ret)
349 printk("\b\b\b\bdone\n"); 347 printk("\b\b\b\bdone\n");
348 else
349 printk("\n");
350 swsusp_show_speed(&start, &stop, nr_to_write, "Wrote"); 350 swsusp_show_speed(&start, &stop, nr_to_write, "Wrote");
351 return error; 351 return ret;
352} 352}
353 353
354/** 354/**
@@ -536,7 +536,8 @@ static int load_image(struct swap_map_handle *handle,
536 snapshot_write_finalize(snapshot); 536 snapshot_write_finalize(snapshot);
537 if (!snapshot_image_loaded(snapshot)) 537 if (!snapshot_image_loaded(snapshot))
538 error = -ENODATA; 538 error = -ENODATA;
539 } 539 } else
540 printk("\n");
540 swsusp_show_speed(&start, &stop, nr_to_read, "Read"); 541 swsusp_show_speed(&start, &stop, nr_to_read, "Read");
541 return error; 542 return error;
542} 543}
@@ -572,8 +573,6 @@ int swsusp_read(unsigned int *flags_p)
572 error = load_image(&handle, &snapshot, header->pages - 1); 573 error = load_image(&handle, &snapshot, header->pages - 1);
573 release_swap_reader(&handle); 574 release_swap_reader(&handle);
574 575
575 blkdev_put(resume_bdev, FMODE_READ);
576
577 if (!error) 576 if (!error)
578 pr_debug("PM: Image successfully loaded\n"); 577 pr_debug("PM: Image successfully loaded\n");
579 else 578 else
@@ -596,7 +595,7 @@ int swsusp_check(void)
596 error = bio_read_page(swsusp_resume_block, 595 error = bio_read_page(swsusp_resume_block,
597 swsusp_header, NULL); 596 swsusp_header, NULL);
598 if (error) 597 if (error)
599 return error; 598 goto put;
600 599
601 if (!memcmp(SWSUSP_SIG, swsusp_header->sig, 10)) { 600 if (!memcmp(SWSUSP_SIG, swsusp_header->sig, 10)) {
602 memcpy(swsusp_header->sig, swsusp_header->orig_sig, 10); 601 memcpy(swsusp_header->sig, swsusp_header->orig_sig, 10);
@@ -604,8 +603,10 @@ int swsusp_check(void)
604 error = bio_write_page(swsusp_resume_block, 603 error = bio_write_page(swsusp_resume_block,
605 swsusp_header, NULL); 604 swsusp_header, NULL);
606 } else { 605 } else {
607 return -EINVAL; 606 error = -EINVAL;
608 } 607 }
608
609put:
609 if (error) 610 if (error)
610 blkdev_put(resume_bdev, FMODE_READ); 611 blkdev_put(resume_bdev, FMODE_READ);
611 else 612 else
diff --git a/kernel/printk.c b/kernel/printk.c
index f38b07f78a4e..b5ac4d99c667 100644
--- a/kernel/printk.c
+++ b/kernel/printk.c
@@ -33,6 +33,7 @@
33#include <linux/bootmem.h> 33#include <linux/bootmem.h>
34#include <linux/syscalls.h> 34#include <linux/syscalls.h>
35#include <linux/kexec.h> 35#include <linux/kexec.h>
36#include <linux/ratelimit.h>
36 37
37#include <asm/uaccess.h> 38#include <asm/uaccess.h>
38 39
@@ -1376,11 +1377,11 @@ late_initcall(disable_boot_consoles);
1376 */ 1377 */
1377DEFINE_RATELIMIT_STATE(printk_ratelimit_state, 5 * HZ, 10); 1378DEFINE_RATELIMIT_STATE(printk_ratelimit_state, 5 * HZ, 10);
1378 1379
1379int printk_ratelimit(void) 1380int __printk_ratelimit(const char *func)
1380{ 1381{
1381 return __ratelimit(&printk_ratelimit_state); 1382 return ___ratelimit(&printk_ratelimit_state, func);
1382} 1383}
1383EXPORT_SYMBOL(printk_ratelimit); 1384EXPORT_SYMBOL(__printk_ratelimit);
1384 1385
1385/** 1386/**
1386 * printk_timed_ratelimit - caller-controlled printk ratelimiting 1387 * printk_timed_ratelimit - caller-controlled printk ratelimiting
diff --git a/kernel/rcupdate.c b/kernel/rcupdate.c
index 400183346ad2..9b7fd4723878 100644
--- a/kernel/rcupdate.c
+++ b/kernel/rcupdate.c
@@ -44,7 +44,6 @@
44#include <linux/cpu.h> 44#include <linux/cpu.h>
45#include <linux/mutex.h> 45#include <linux/mutex.h>
46#include <linux/module.h> 46#include <linux/module.h>
47#include <linux/kernel_stat.h>
48 47
49#ifdef CONFIG_DEBUG_LOCK_ALLOC 48#ifdef CONFIG_DEBUG_LOCK_ALLOC
50static struct lock_class_key rcu_lock_key; 49static struct lock_class_key rcu_lock_key;
@@ -53,8 +52,6 @@ struct lockdep_map rcu_lock_map =
53EXPORT_SYMBOL_GPL(rcu_lock_map); 52EXPORT_SYMBOL_GPL(rcu_lock_map);
54#endif 53#endif
55 54
56int rcu_scheduler_active __read_mostly;
57
58/* 55/*
59 * Awaken the corresponding synchronize_rcu() instance now that a 56 * Awaken the corresponding synchronize_rcu() instance now that a
60 * grace period has elapsed. 57 * grace period has elapsed.
@@ -66,122 +63,3 @@ void wakeme_after_rcu(struct rcu_head *head)
66 rcu = container_of(head, struct rcu_synchronize, head); 63 rcu = container_of(head, struct rcu_synchronize, head);
67 complete(&rcu->completion); 64 complete(&rcu->completion);
68} 65}
69
70#ifdef CONFIG_TREE_PREEMPT_RCU
71
72/**
73 * synchronize_rcu - wait until a grace period has elapsed.
74 *
75 * Control will return to the caller some time after a full grace
76 * period has elapsed, in other words after all currently executing RCU
77 * read-side critical sections have completed. RCU read-side critical
78 * sections are delimited by rcu_read_lock() and rcu_read_unlock(),
79 * and may be nested.
80 */
81void synchronize_rcu(void)
82{
83 struct rcu_synchronize rcu;
84
85 if (!rcu_scheduler_active)
86 return;
87
88 init_completion(&rcu.completion);
89 /* Will wake me after RCU finished. */
90 call_rcu(&rcu.head, wakeme_after_rcu);
91 /* Wait for it. */
92 wait_for_completion(&rcu.completion);
93}
94EXPORT_SYMBOL_GPL(synchronize_rcu);
95
96#endif /* #ifdef CONFIG_TREE_PREEMPT_RCU */
97
98/**
99 * synchronize_sched - wait until an rcu-sched grace period has elapsed.
100 *
101 * Control will return to the caller some time after a full rcu-sched
102 * grace period has elapsed, in other words after all currently executing
103 * rcu-sched read-side critical sections have completed. These read-side
104 * critical sections are delimited by rcu_read_lock_sched() and
105 * rcu_read_unlock_sched(), and may be nested. Note that preempt_disable(),
106 * local_irq_disable(), and so on may be used in place of
107 * rcu_read_lock_sched().
108 *
109 * This means that all preempt_disable code sequences, including NMI and
110 * hardware-interrupt handlers, in progress on entry will have completed
111 * before this primitive returns. However, this does not guarantee that
112 * softirq handlers will have completed, since in some kernels, these
113 * handlers can run in process context, and can block.
114 *
115 * This primitive provides the guarantees made by the (now removed)
116 * synchronize_kernel() API. In contrast, synchronize_rcu() only
117 * guarantees that rcu_read_lock() sections will have completed.
118 * In "classic RCU", these two guarantees happen to be one and
119 * the same, but can differ in realtime RCU implementations.
120 */
121void synchronize_sched(void)
122{
123 struct rcu_synchronize rcu;
124
125 if (rcu_blocking_is_gp())
126 return;
127
128 init_completion(&rcu.completion);
129 /* Will wake me after RCU finished. */
130 call_rcu_sched(&rcu.head, wakeme_after_rcu);
131 /* Wait for it. */
132 wait_for_completion(&rcu.completion);
133}
134EXPORT_SYMBOL_GPL(synchronize_sched);
135
136/**
137 * synchronize_rcu_bh - wait until an rcu_bh grace period has elapsed.
138 *
139 * Control will return to the caller some time after a full rcu_bh grace
140 * period has elapsed, in other words after all currently executing rcu_bh
141 * read-side critical sections have completed. RCU read-side critical
142 * sections are delimited by rcu_read_lock_bh() and rcu_read_unlock_bh(),
143 * and may be nested.
144 */
145void synchronize_rcu_bh(void)
146{
147 struct rcu_synchronize rcu;
148
149 if (rcu_blocking_is_gp())
150 return;
151
152 init_completion(&rcu.completion);
153 /* Will wake me after RCU finished. */
154 call_rcu_bh(&rcu.head, wakeme_after_rcu);
155 /* Wait for it. */
156 wait_for_completion(&rcu.completion);
157}
158EXPORT_SYMBOL_GPL(synchronize_rcu_bh);
159
160static int __cpuinit rcu_barrier_cpu_hotplug(struct notifier_block *self,
161 unsigned long action, void *hcpu)
162{
163 return rcu_cpu_notify(self, action, hcpu);
164}
165
166void __init rcu_init(void)
167{
168 int i;
169
170 __rcu_init();
171 cpu_notifier(rcu_barrier_cpu_hotplug, 0);
172
173 /*
174 * We don't need protection against CPU-hotplug here because
175 * this is called early in boot, before either interrupts
176 * or the scheduler are operational.
177 */
178 for_each_online_cpu(i)
179 rcu_barrier_cpu_hotplug(NULL, CPU_UP_PREPARE, (void *)(long)i);
180}
181
182void rcu_scheduler_starting(void)
183{
184 WARN_ON(num_online_cpus() != 1);
185 WARN_ON(nr_context_switches() > 0);
186 rcu_scheduler_active = 1;
187}
diff --git a/kernel/rcutiny.c b/kernel/rcutiny.c
new file mode 100644
index 000000000000..9f6d9ff2572c
--- /dev/null
+++ b/kernel/rcutiny.c
@@ -0,0 +1,282 @@
1/*
2 * Read-Copy Update mechanism for mutual exclusion, the Bloatwatch edition.
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, 2008
19 *
20 * Author: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
21 *
22 * For detailed explanation of Read-Copy Update mechanism see -
23 * Documentation/RCU
24 */
25#include <linux/moduleparam.h>
26#include <linux/completion.h>
27#include <linux/interrupt.h>
28#include <linux/notifier.h>
29#include <linux/rcupdate.h>
30#include <linux/kernel.h>
31#include <linux/module.h>
32#include <linux/mutex.h>
33#include <linux/sched.h>
34#include <linux/types.h>
35#include <linux/init.h>
36#include <linux/time.h>
37#include <linux/cpu.h>
38
39/* Global control variables for rcupdate callback mechanism. */
40struct rcu_ctrlblk {
41 struct rcu_head *rcucblist; /* List of pending callbacks (CBs). */
42 struct rcu_head **donetail; /* ->next pointer of last "done" CB. */
43 struct rcu_head **curtail; /* ->next pointer of last CB. */
44};
45
46/* Definition for rcupdate control block. */
47static struct rcu_ctrlblk rcu_ctrlblk = {
48 .donetail = &rcu_ctrlblk.rcucblist,
49 .curtail = &rcu_ctrlblk.rcucblist,
50};
51
52static struct rcu_ctrlblk rcu_bh_ctrlblk = {
53 .donetail = &rcu_bh_ctrlblk.rcucblist,
54 .curtail = &rcu_bh_ctrlblk.rcucblist,
55};
56
57#ifdef CONFIG_NO_HZ
58
59static long rcu_dynticks_nesting = 1;
60
61/*
62 * Enter dynticks-idle mode, which is an extended quiescent state
63 * if we have fully entered that mode (i.e., if the new value of
64 * dynticks_nesting is zero).
65 */
66void rcu_enter_nohz(void)
67{
68 if (--rcu_dynticks_nesting == 0)
69 rcu_sched_qs(0); /* implies rcu_bh_qsctr_inc(0) */
70}
71
72/*
73 * Exit dynticks-idle mode, so that we are no longer in an extended
74 * quiescent state.
75 */
76void rcu_exit_nohz(void)
77{
78 rcu_dynticks_nesting++;
79}
80
81#endif /* #ifdef CONFIG_NO_HZ */
82
83/*
84 * Helper function for rcu_qsctr_inc() and rcu_bh_qsctr_inc().
85 * Also disable irqs to avoid confusion due to interrupt handlers
86 * invoking call_rcu().
87 */
88static int rcu_qsctr_help(struct rcu_ctrlblk *rcp)
89{
90 unsigned long flags;
91
92 local_irq_save(flags);
93 if (rcp->rcucblist != NULL &&
94 rcp->donetail != rcp->curtail) {
95 rcp->donetail = rcp->curtail;
96 local_irq_restore(flags);
97 return 1;
98 }
99 local_irq_restore(flags);
100
101 return 0;
102}
103
104/*
105 * Record an rcu quiescent state. And an rcu_bh quiescent state while we
106 * are at it, given that any rcu quiescent state is also an rcu_bh
107 * quiescent state. Use "+" instead of "||" to defeat short circuiting.
108 */
109void rcu_sched_qs(int cpu)
110{
111 if (rcu_qsctr_help(&rcu_ctrlblk) + rcu_qsctr_help(&rcu_bh_ctrlblk))
112 raise_softirq(RCU_SOFTIRQ);
113}
114
115/*
116 * Record an rcu_bh quiescent state.
117 */
118void rcu_bh_qs(int cpu)
119{
120 if (rcu_qsctr_help(&rcu_bh_ctrlblk))
121 raise_softirq(RCU_SOFTIRQ);
122}
123
124/*
125 * Check to see if the scheduling-clock interrupt came from an extended
126 * quiescent state, and, if so, tell RCU about it.
127 */
128void rcu_check_callbacks(int cpu, int user)
129{
130 if (user ||
131 (idle_cpu(cpu) &&
132 !in_softirq() &&
133 hardirq_count() <= (1 << HARDIRQ_SHIFT)))
134 rcu_sched_qs(cpu);
135 else if (!in_softirq())
136 rcu_bh_qs(cpu);
137}
138
139/*
140 * Helper function for rcu_process_callbacks() that operates on the
141 * specified rcu_ctrlkblk structure.
142 */
143static void __rcu_process_callbacks(struct rcu_ctrlblk *rcp)
144{
145 struct rcu_head *next, *list;
146 unsigned long flags;
147
148 /* If no RCU callbacks ready to invoke, just return. */
149 if (&rcp->rcucblist == rcp->donetail)
150 return;
151
152 /* Move the ready-to-invoke callbacks to a local list. */
153 local_irq_save(flags);
154 list = rcp->rcucblist;
155 rcp->rcucblist = *rcp->donetail;
156 *rcp->donetail = NULL;
157 if (rcp->curtail == rcp->donetail)
158 rcp->curtail = &rcp->rcucblist;
159 rcp->donetail = &rcp->rcucblist;
160 local_irq_restore(flags);
161
162 /* Invoke the callbacks on the local list. */
163 while (list) {
164 next = list->next;
165 prefetch(next);
166 list->func(list);
167 list = next;
168 }
169}
170
171/*
172 * Invoke any callbacks whose grace period has completed.
173 */
174static void rcu_process_callbacks(struct softirq_action *unused)
175{
176 __rcu_process_callbacks(&rcu_ctrlblk);
177 __rcu_process_callbacks(&rcu_bh_ctrlblk);
178}
179
180/*
181 * Wait for a grace period to elapse. But it is illegal to invoke
182 * synchronize_sched() from within an RCU read-side critical section.
183 * Therefore, any legal call to synchronize_sched() is a quiescent
184 * state, and so on a UP system, synchronize_sched() need do nothing.
185 * Ditto for synchronize_rcu_bh(). (But Lai Jiangshan points out the
186 * benefits of doing might_sleep() to reduce latency.)
187 *
188 * Cool, huh? (Due to Josh Triplett.)
189 *
190 * But we want to make this a static inline later.
191 */
192void synchronize_sched(void)
193{
194 cond_resched();
195}
196EXPORT_SYMBOL_GPL(synchronize_sched);
197
198void synchronize_rcu_bh(void)
199{
200 synchronize_sched();
201}
202EXPORT_SYMBOL_GPL(synchronize_rcu_bh);
203
204/*
205 * Helper function for call_rcu() and call_rcu_bh().
206 */
207static void __call_rcu(struct rcu_head *head,
208 void (*func)(struct rcu_head *rcu),
209 struct rcu_ctrlblk *rcp)
210{
211 unsigned long flags;
212
213 head->func = func;
214 head->next = NULL;
215
216 local_irq_save(flags);
217 *rcp->curtail = head;
218 rcp->curtail = &head->next;
219 local_irq_restore(flags);
220}
221
222/*
223 * Post an RCU callback to be invoked after the end of an RCU grace
224 * period. But since we have but one CPU, that would be after any
225 * quiescent state.
226 */
227void call_rcu(struct rcu_head *head, void (*func)(struct rcu_head *rcu))
228{
229 __call_rcu(head, func, &rcu_ctrlblk);
230}
231EXPORT_SYMBOL_GPL(call_rcu);
232
233/*
234 * Post an RCU bottom-half callback to be invoked after any subsequent
235 * quiescent state.
236 */
237void call_rcu_bh(struct rcu_head *head, void (*func)(struct rcu_head *rcu))
238{
239 __call_rcu(head, func, &rcu_bh_ctrlblk);
240}
241EXPORT_SYMBOL_GPL(call_rcu_bh);
242
243void rcu_barrier(void)
244{
245 struct rcu_synchronize rcu;
246
247 init_completion(&rcu.completion);
248 /* Will wake me after RCU finished. */
249 call_rcu(&rcu.head, wakeme_after_rcu);
250 /* Wait for it. */
251 wait_for_completion(&rcu.completion);
252}
253EXPORT_SYMBOL_GPL(rcu_barrier);
254
255void rcu_barrier_bh(void)
256{
257 struct rcu_synchronize rcu;
258
259 init_completion(&rcu.completion);
260 /* Will wake me after RCU finished. */
261 call_rcu_bh(&rcu.head, wakeme_after_rcu);
262 /* Wait for it. */
263 wait_for_completion(&rcu.completion);
264}
265EXPORT_SYMBOL_GPL(rcu_barrier_bh);
266
267void rcu_barrier_sched(void)
268{
269 struct rcu_synchronize rcu;
270
271 init_completion(&rcu.completion);
272 /* Will wake me after RCU finished. */
273 call_rcu_sched(&rcu.head, wakeme_after_rcu);
274 /* Wait for it. */
275 wait_for_completion(&rcu.completion);
276}
277EXPORT_SYMBOL_GPL(rcu_barrier_sched);
278
279void __init rcu_init(void)
280{
281 open_softirq(RCU_SOFTIRQ, rcu_process_callbacks);
282}
diff --git a/kernel/rcutorture.c b/kernel/rcutorture.c
index 697c0a0229d4..a621a67ef4e3 100644
--- a/kernel/rcutorture.c
+++ b/kernel/rcutorture.c
@@ -327,6 +327,11 @@ rcu_torture_cb(struct rcu_head *p)
327 cur_ops->deferred_free(rp); 327 cur_ops->deferred_free(rp);
328} 328}
329 329
330static int rcu_no_completed(void)
331{
332 return 0;
333}
334
330static void rcu_torture_deferred_free(struct rcu_torture *p) 335static void rcu_torture_deferred_free(struct rcu_torture *p)
331{ 336{
332 call_rcu(&p->rtort_rcu, rcu_torture_cb); 337 call_rcu(&p->rtort_rcu, rcu_torture_cb);
@@ -388,6 +393,21 @@ static struct rcu_torture_ops rcu_sync_ops = {
388 .name = "rcu_sync" 393 .name = "rcu_sync"
389}; 394};
390 395
396static struct rcu_torture_ops rcu_expedited_ops = {
397 .init = rcu_sync_torture_init,
398 .cleanup = NULL,
399 .readlock = rcu_torture_read_lock,
400 .read_delay = rcu_read_delay, /* just reuse rcu's version. */
401 .readunlock = rcu_torture_read_unlock,
402 .completed = rcu_no_completed,
403 .deferred_free = rcu_sync_torture_deferred_free,
404 .sync = synchronize_rcu_expedited,
405 .cb_barrier = NULL,
406 .stats = NULL,
407 .irq_capable = 1,
408 .name = "rcu_expedited"
409};
410
391/* 411/*
392 * Definitions for rcu_bh torture testing. 412 * Definitions for rcu_bh torture testing.
393 */ 413 */
@@ -547,6 +567,25 @@ static struct rcu_torture_ops srcu_ops = {
547 .name = "srcu" 567 .name = "srcu"
548}; 568};
549 569
570static void srcu_torture_synchronize_expedited(void)
571{
572 synchronize_srcu_expedited(&srcu_ctl);
573}
574
575static struct rcu_torture_ops srcu_expedited_ops = {
576 .init = srcu_torture_init,
577 .cleanup = srcu_torture_cleanup,
578 .readlock = srcu_torture_read_lock,
579 .read_delay = srcu_read_delay,
580 .readunlock = srcu_torture_read_unlock,
581 .completed = srcu_torture_completed,
582 .deferred_free = rcu_sync_torture_deferred_free,
583 .sync = srcu_torture_synchronize_expedited,
584 .cb_barrier = NULL,
585 .stats = srcu_torture_stats,
586 .name = "srcu_expedited"
587};
588
550/* 589/*
551 * Definitions for sched torture testing. 590 * Definitions for sched torture testing.
552 */ 591 */
@@ -562,11 +601,6 @@ static void sched_torture_read_unlock(int idx)
562 preempt_enable(); 601 preempt_enable();
563} 602}
564 603
565static int sched_torture_completed(void)
566{
567 return 0;
568}
569
570static void rcu_sched_torture_deferred_free(struct rcu_torture *p) 604static void rcu_sched_torture_deferred_free(struct rcu_torture *p)
571{ 605{
572 call_rcu_sched(&p->rtort_rcu, rcu_torture_cb); 606 call_rcu_sched(&p->rtort_rcu, rcu_torture_cb);
@@ -583,7 +617,7 @@ static struct rcu_torture_ops sched_ops = {
583 .readlock = sched_torture_read_lock, 617 .readlock = sched_torture_read_lock,
584 .read_delay = rcu_read_delay, /* just reuse rcu's version. */ 618 .read_delay = rcu_read_delay, /* just reuse rcu's version. */
585 .readunlock = sched_torture_read_unlock, 619 .readunlock = sched_torture_read_unlock,
586 .completed = sched_torture_completed, 620 .completed = rcu_no_completed,
587 .deferred_free = rcu_sched_torture_deferred_free, 621 .deferred_free = rcu_sched_torture_deferred_free,
588 .sync = sched_torture_synchronize, 622 .sync = sched_torture_synchronize,
589 .cb_barrier = rcu_barrier_sched, 623 .cb_barrier = rcu_barrier_sched,
@@ -592,13 +626,13 @@ static struct rcu_torture_ops sched_ops = {
592 .name = "sched" 626 .name = "sched"
593}; 627};
594 628
595static struct rcu_torture_ops sched_ops_sync = { 629static struct rcu_torture_ops sched_sync_ops = {
596 .init = rcu_sync_torture_init, 630 .init = rcu_sync_torture_init,
597 .cleanup = NULL, 631 .cleanup = NULL,
598 .readlock = sched_torture_read_lock, 632 .readlock = sched_torture_read_lock,
599 .read_delay = rcu_read_delay, /* just reuse rcu's version. */ 633 .read_delay = rcu_read_delay, /* just reuse rcu's version. */
600 .readunlock = sched_torture_read_unlock, 634 .readunlock = sched_torture_read_unlock,
601 .completed = sched_torture_completed, 635 .completed = rcu_no_completed,
602 .deferred_free = rcu_sync_torture_deferred_free, 636 .deferred_free = rcu_sync_torture_deferred_free,
603 .sync = sched_torture_synchronize, 637 .sync = sched_torture_synchronize,
604 .cb_barrier = NULL, 638 .cb_barrier = NULL,
@@ -612,7 +646,7 @@ static struct rcu_torture_ops sched_expedited_ops = {
612 .readlock = sched_torture_read_lock, 646 .readlock = sched_torture_read_lock,
613 .read_delay = rcu_read_delay, /* just reuse rcu's version. */ 647 .read_delay = rcu_read_delay, /* just reuse rcu's version. */
614 .readunlock = sched_torture_read_unlock, 648 .readunlock = sched_torture_read_unlock,
615 .completed = sched_torture_completed, 649 .completed = rcu_no_completed,
616 .deferred_free = rcu_sync_torture_deferred_free, 650 .deferred_free = rcu_sync_torture_deferred_free,
617 .sync = synchronize_sched_expedited, 651 .sync = synchronize_sched_expedited,
618 .cb_barrier = NULL, 652 .cb_barrier = NULL,
@@ -1097,9 +1131,10 @@ rcu_torture_init(void)
1097 int cpu; 1131 int cpu;
1098 int firsterr = 0; 1132 int firsterr = 0;
1099 static struct rcu_torture_ops *torture_ops[] = 1133 static struct rcu_torture_ops *torture_ops[] =
1100 { &rcu_ops, &rcu_sync_ops, &rcu_bh_ops, &rcu_bh_sync_ops, 1134 { &rcu_ops, &rcu_sync_ops, &rcu_expedited_ops,
1101 &sched_expedited_ops, 1135 &rcu_bh_ops, &rcu_bh_sync_ops,
1102 &srcu_ops, &sched_ops, &sched_ops_sync, }; 1136 &srcu_ops, &srcu_expedited_ops,
1137 &sched_ops, &sched_sync_ops, &sched_expedited_ops, };
1103 1138
1104 mutex_lock(&fullstop_mutex); 1139 mutex_lock(&fullstop_mutex);
1105 1140
@@ -1110,8 +1145,12 @@ rcu_torture_init(void)
1110 break; 1145 break;
1111 } 1146 }
1112 if (i == ARRAY_SIZE(torture_ops)) { 1147 if (i == ARRAY_SIZE(torture_ops)) {
1113 printk(KERN_ALERT "rcutorture: invalid torture type: \"%s\"\n", 1148 printk(KERN_ALERT "rcu-torture: invalid torture type: \"%s\"\n",
1114 torture_type); 1149 torture_type);
1150 printk(KERN_ALERT "rcu-torture types:");
1151 for (i = 0; i < ARRAY_SIZE(torture_ops); i++)
1152 printk(KERN_ALERT " %s", torture_ops[i]->name);
1153 printk(KERN_ALERT "\n");
1115 mutex_unlock(&fullstop_mutex); 1154 mutex_unlock(&fullstop_mutex);
1116 return -EINVAL; 1155 return -EINVAL;
1117 } 1156 }
diff --git a/kernel/rcutree.c b/kernel/rcutree.c
index 0536125b0497..53ae9598f798 100644
--- a/kernel/rcutree.c
+++ b/kernel/rcutree.c
@@ -46,20 +46,24 @@
46#include <linux/cpu.h> 46#include <linux/cpu.h>
47#include <linux/mutex.h> 47#include <linux/mutex.h>
48#include <linux/time.h> 48#include <linux/time.h>
49#include <linux/kernel_stat.h>
49 50
50#include "rcutree.h" 51#include "rcutree.h"
51 52
52/* Data structures. */ 53/* Data structures. */
53 54
55static struct lock_class_key rcu_node_class[NUM_RCU_LVLS];
56
54#define RCU_STATE_INITIALIZER(name) { \ 57#define RCU_STATE_INITIALIZER(name) { \
55 .level = { &name.node[0] }, \ 58 .level = { &name.node[0] }, \
56 .levelcnt = { \ 59 .levelcnt = { \
57 NUM_RCU_LVL_0, /* root of hierarchy. */ \ 60 NUM_RCU_LVL_0, /* root of hierarchy. */ \
58 NUM_RCU_LVL_1, \ 61 NUM_RCU_LVL_1, \
59 NUM_RCU_LVL_2, \ 62 NUM_RCU_LVL_2, \
60 NUM_RCU_LVL_3, /* == MAX_RCU_LVLS */ \ 63 NUM_RCU_LVL_3, \
64 NUM_RCU_LVL_4, /* == MAX_RCU_LVLS */ \
61 }, \ 65 }, \
62 .signaled = RCU_SIGNAL_INIT, \ 66 .signaled = RCU_GP_IDLE, \
63 .gpnum = -300, \ 67 .gpnum = -300, \
64 .completed = -300, \ 68 .completed = -300, \
65 .onofflock = __SPIN_LOCK_UNLOCKED(&name.onofflock), \ 69 .onofflock = __SPIN_LOCK_UNLOCKED(&name.onofflock), \
@@ -77,6 +81,8 @@ DEFINE_PER_CPU(struct rcu_data, rcu_sched_data);
77struct rcu_state rcu_bh_state = RCU_STATE_INITIALIZER(rcu_bh_state); 81struct rcu_state rcu_bh_state = RCU_STATE_INITIALIZER(rcu_bh_state);
78DEFINE_PER_CPU(struct rcu_data, rcu_bh_data); 82DEFINE_PER_CPU(struct rcu_data, rcu_bh_data);
79 83
84static int rcu_scheduler_active __read_mostly;
85
80 86
81/* 87/*
82 * Return true if an RCU grace period is in progress. The ACCESS_ONCE()s 88 * Return true if an RCU grace period is in progress. The ACCESS_ONCE()s
@@ -98,7 +104,7 @@ void rcu_sched_qs(int cpu)
98 struct rcu_data *rdp; 104 struct rcu_data *rdp;
99 105
100 rdp = &per_cpu(rcu_sched_data, cpu); 106 rdp = &per_cpu(rcu_sched_data, cpu);
101 rdp->passed_quiesc_completed = rdp->completed; 107 rdp->passed_quiesc_completed = rdp->gpnum - 1;
102 barrier(); 108 barrier();
103 rdp->passed_quiesc = 1; 109 rdp->passed_quiesc = 1;
104 rcu_preempt_note_context_switch(cpu); 110 rcu_preempt_note_context_switch(cpu);
@@ -109,7 +115,7 @@ void rcu_bh_qs(int cpu)
109 struct rcu_data *rdp; 115 struct rcu_data *rdp;
110 116
111 rdp = &per_cpu(rcu_bh_data, cpu); 117 rdp = &per_cpu(rcu_bh_data, cpu);
112 rdp->passed_quiesc_completed = rdp->completed; 118 rdp->passed_quiesc_completed = rdp->gpnum - 1;
113 barrier(); 119 barrier();
114 rdp->passed_quiesc = 1; 120 rdp->passed_quiesc = 1;
115} 121}
@@ -335,28 +341,9 @@ void rcu_irq_exit(void)
335 set_need_resched(); 341 set_need_resched();
336} 342}
337 343
338/*
339 * Record the specified "completed" value, which is later used to validate
340 * dynticks counter manipulations. Specify "rsp->completed - 1" to
341 * unconditionally invalidate any future dynticks manipulations (which is
342 * useful at the beginning of a grace period).
343 */
344static void dyntick_record_completed(struct rcu_state *rsp, long comp)
345{
346 rsp->dynticks_completed = comp;
347}
348
349#ifdef CONFIG_SMP 344#ifdef CONFIG_SMP
350 345
351/* 346/*
352 * Recall the previously recorded value of the completion for dynticks.
353 */
354static long dyntick_recall_completed(struct rcu_state *rsp)
355{
356 return rsp->dynticks_completed;
357}
358
359/*
360 * Snapshot the specified CPU's dynticks counter so that we can later 347 * Snapshot the specified CPU's dynticks counter so that we can later
361 * credit them with an implicit quiescent state. Return 1 if this CPU 348 * credit them with an implicit quiescent state. Return 1 if this CPU
362 * is in dynticks idle mode, which is an extended quiescent state. 349 * is in dynticks idle mode, which is an extended quiescent state.
@@ -419,24 +406,8 @@ static int rcu_implicit_dynticks_qs(struct rcu_data *rdp)
419 406
420#else /* #ifdef CONFIG_NO_HZ */ 407#else /* #ifdef CONFIG_NO_HZ */
421 408
422static void dyntick_record_completed(struct rcu_state *rsp, long comp)
423{
424}
425
426#ifdef CONFIG_SMP 409#ifdef CONFIG_SMP
427 410
428/*
429 * If there are no dynticks, then the only way that a CPU can passively
430 * be in a quiescent state is to be offline. Unlike dynticks idle, which
431 * is a point in time during the prior (already finished) grace period,
432 * an offline CPU is always in a quiescent state, and thus can be
433 * unconditionally applied. So just return the current value of completed.
434 */
435static long dyntick_recall_completed(struct rcu_state *rsp)
436{
437 return rsp->completed;
438}
439
440static int dyntick_save_progress_counter(struct rcu_data *rdp) 411static int dyntick_save_progress_counter(struct rcu_data *rdp)
441{ 412{
442 return 0; 413 return 0;
@@ -553,13 +524,33 @@ static void check_cpu_stall(struct rcu_state *rsp, struct rcu_data *rdp)
553/* 524/*
554 * Update CPU-local rcu_data state to record the newly noticed grace period. 525 * Update CPU-local rcu_data state to record the newly noticed grace period.
555 * This is used both when we started the grace period and when we notice 526 * This is used both when we started the grace period and when we notice
556 * that someone else started the grace period. 527 * that someone else started the grace period. The caller must hold the
528 * ->lock of the leaf rcu_node structure corresponding to the current CPU,
529 * and must have irqs disabled.
557 */ 530 */
531static void __note_new_gpnum(struct rcu_state *rsp, struct rcu_node *rnp, struct rcu_data *rdp)
532{
533 if (rdp->gpnum != rnp->gpnum) {
534 rdp->qs_pending = 1;
535 rdp->passed_quiesc = 0;
536 rdp->gpnum = rnp->gpnum;
537 }
538}
539
558static void note_new_gpnum(struct rcu_state *rsp, struct rcu_data *rdp) 540static void note_new_gpnum(struct rcu_state *rsp, struct rcu_data *rdp)
559{ 541{
560 rdp->qs_pending = 1; 542 unsigned long flags;
561 rdp->passed_quiesc = 0; 543 struct rcu_node *rnp;
562 rdp->gpnum = rsp->gpnum; 544
545 local_irq_save(flags);
546 rnp = rdp->mynode;
547 if (rdp->gpnum == ACCESS_ONCE(rnp->gpnum) || /* outside lock. */
548 !spin_trylock(&rnp->lock)) { /* irqs already off, retry later. */
549 local_irq_restore(flags);
550 return;
551 }
552 __note_new_gpnum(rsp, rnp, rdp);
553 spin_unlock_irqrestore(&rnp->lock, flags);
563} 554}
564 555
565/* 556/*
@@ -583,6 +574,79 @@ check_for_new_grace_period(struct rcu_state *rsp, struct rcu_data *rdp)
583} 574}
584 575
585/* 576/*
577 * Advance this CPU's callbacks, but only if the current grace period
578 * has ended. This may be called only from the CPU to whom the rdp
579 * belongs. In addition, the corresponding leaf rcu_node structure's
580 * ->lock must be held by the caller, with irqs disabled.
581 */
582static void
583__rcu_process_gp_end(struct rcu_state *rsp, struct rcu_node *rnp, struct rcu_data *rdp)
584{
585 /* Did another grace period end? */
586 if (rdp->completed != rnp->completed) {
587
588 /* Advance callbacks. No harm if list empty. */
589 rdp->nxttail[RCU_DONE_TAIL] = rdp->nxttail[RCU_WAIT_TAIL];
590 rdp->nxttail[RCU_WAIT_TAIL] = rdp->nxttail[RCU_NEXT_READY_TAIL];
591 rdp->nxttail[RCU_NEXT_READY_TAIL] = rdp->nxttail[RCU_NEXT_TAIL];
592
593 /* Remember that we saw this grace-period completion. */
594 rdp->completed = rnp->completed;
595 }
596}
597
598/*
599 * Advance this CPU's callbacks, but only if the current grace period
600 * has ended. This may be called only from the CPU to whom the rdp
601 * belongs.
602 */
603static void
604rcu_process_gp_end(struct rcu_state *rsp, struct rcu_data *rdp)
605{
606 unsigned long flags;
607 struct rcu_node *rnp;
608
609 local_irq_save(flags);
610 rnp = rdp->mynode;
611 if (rdp->completed == ACCESS_ONCE(rnp->completed) || /* outside lock. */
612 !spin_trylock(&rnp->lock)) { /* irqs already off, retry later. */
613 local_irq_restore(flags);
614 return;
615 }
616 __rcu_process_gp_end(rsp, rnp, rdp);
617 spin_unlock_irqrestore(&rnp->lock, flags);
618}
619
620/*
621 * Do per-CPU grace-period initialization for running CPU. The caller
622 * must hold the lock of the leaf rcu_node structure corresponding to
623 * this CPU.
624 */
625static void
626rcu_start_gp_per_cpu(struct rcu_state *rsp, struct rcu_node *rnp, struct rcu_data *rdp)
627{
628 /* Prior grace period ended, so advance callbacks for current CPU. */
629 __rcu_process_gp_end(rsp, rnp, rdp);
630
631 /*
632 * Because this CPU just now started the new grace period, we know
633 * that all of its callbacks will be covered by this upcoming grace
634 * period, even the ones that were registered arbitrarily recently.
635 * Therefore, advance all outstanding callbacks to RCU_WAIT_TAIL.
636 *
637 * Other CPUs cannot be sure exactly when the grace period started.
638 * Therefore, their recently registered callbacks must pass through
639 * an additional RCU_NEXT_READY stage, so that they will be handled
640 * by the next RCU grace period.
641 */
642 rdp->nxttail[RCU_NEXT_READY_TAIL] = rdp->nxttail[RCU_NEXT_TAIL];
643 rdp->nxttail[RCU_WAIT_TAIL] = rdp->nxttail[RCU_NEXT_TAIL];
644
645 /* Set state so that this CPU will detect the next quiescent state. */
646 __note_new_gpnum(rsp, rnp, rdp);
647}
648
649/*
586 * Start a new RCU grace period if warranted, re-initializing the hierarchy 650 * Start a new RCU grace period if warranted, re-initializing the hierarchy
587 * in preparation for detecting the next grace period. The caller must hold 651 * in preparation for detecting the next grace period. The caller must hold
588 * the root node's ->lock, which is released before return. Hard irqs must 652 * the root node's ->lock, which is released before return. Hard irqs must
@@ -596,7 +660,23 @@ rcu_start_gp(struct rcu_state *rsp, unsigned long flags)
596 struct rcu_node *rnp = rcu_get_root(rsp); 660 struct rcu_node *rnp = rcu_get_root(rsp);
597 661
598 if (!cpu_needs_another_gp(rsp, rdp)) { 662 if (!cpu_needs_another_gp(rsp, rdp)) {
599 spin_unlock_irqrestore(&rnp->lock, flags); 663 if (rnp->completed == rsp->completed) {
664 spin_unlock_irqrestore(&rnp->lock, flags);
665 return;
666 }
667 spin_unlock(&rnp->lock); /* irqs remain disabled. */
668
669 /*
670 * Propagate new ->completed value to rcu_node structures
671 * so that other CPUs don't have to wait until the start
672 * of the next grace period to process their callbacks.
673 */
674 rcu_for_each_node_breadth_first(rsp, rnp) {
675 spin_lock(&rnp->lock); /* irqs already disabled. */
676 rnp->completed = rsp->completed;
677 spin_unlock(&rnp->lock); /* irqs remain disabled. */
678 }
679 local_irq_restore(flags);
600 return; 680 return;
601 } 681 }
602 682
@@ -606,29 +686,15 @@ rcu_start_gp(struct rcu_state *rsp, unsigned long flags)
606 rsp->signaled = RCU_GP_INIT; /* Hold off force_quiescent_state. */ 686 rsp->signaled = RCU_GP_INIT; /* Hold off force_quiescent_state. */
607 rsp->jiffies_force_qs = jiffies + RCU_JIFFIES_TILL_FORCE_QS; 687 rsp->jiffies_force_qs = jiffies + RCU_JIFFIES_TILL_FORCE_QS;
608 record_gp_stall_check_time(rsp); 688 record_gp_stall_check_time(rsp);
609 dyntick_record_completed(rsp, rsp->completed - 1);
610 note_new_gpnum(rsp, rdp);
611
612 /*
613 * Because this CPU just now started the new grace period, we know
614 * that all of its callbacks will be covered by this upcoming grace
615 * period, even the ones that were registered arbitrarily recently.
616 * Therefore, advance all outstanding callbacks to RCU_WAIT_TAIL.
617 *
618 * Other CPUs cannot be sure exactly when the grace period started.
619 * Therefore, their recently registered callbacks must pass through
620 * an additional RCU_NEXT_READY stage, so that they will be handled
621 * by the next RCU grace period.
622 */
623 rdp->nxttail[RCU_NEXT_READY_TAIL] = rdp->nxttail[RCU_NEXT_TAIL];
624 rdp->nxttail[RCU_WAIT_TAIL] = rdp->nxttail[RCU_NEXT_TAIL];
625 689
626 /* Special-case the common single-level case. */ 690 /* Special-case the common single-level case. */
627 if (NUM_RCU_NODES == 1) { 691 if (NUM_RCU_NODES == 1) {
628 rcu_preempt_check_blocked_tasks(rnp); 692 rcu_preempt_check_blocked_tasks(rnp);
629 rnp->qsmask = rnp->qsmaskinit; 693 rnp->qsmask = rnp->qsmaskinit;
630 rnp->gpnum = rsp->gpnum; 694 rnp->gpnum = rsp->gpnum;
695 rnp->completed = rsp->completed;
631 rsp->signaled = RCU_SIGNAL_INIT; /* force_quiescent_state OK. */ 696 rsp->signaled = RCU_SIGNAL_INIT; /* force_quiescent_state OK. */
697 rcu_start_gp_per_cpu(rsp, rnp, rdp);
632 spin_unlock_irqrestore(&rnp->lock, flags); 698 spin_unlock_irqrestore(&rnp->lock, flags);
633 return; 699 return;
634 } 700 }
@@ -657,69 +723,50 @@ rcu_start_gp(struct rcu_state *rsp, unsigned long flags)
657 * irqs disabled. 723 * irqs disabled.
658 */ 724 */
659 rcu_for_each_node_breadth_first(rsp, rnp) { 725 rcu_for_each_node_breadth_first(rsp, rnp) {
660 spin_lock(&rnp->lock); /* irqs already disabled. */ 726 spin_lock(&rnp->lock); /* irqs already disabled. */
661 rcu_preempt_check_blocked_tasks(rnp); 727 rcu_preempt_check_blocked_tasks(rnp);
662 rnp->qsmask = rnp->qsmaskinit; 728 rnp->qsmask = rnp->qsmaskinit;
663 rnp->gpnum = rsp->gpnum; 729 rnp->gpnum = rsp->gpnum;
664 spin_unlock(&rnp->lock); /* irqs already disabled. */ 730 rnp->completed = rsp->completed;
731 if (rnp == rdp->mynode)
732 rcu_start_gp_per_cpu(rsp, rnp, rdp);
733 spin_unlock(&rnp->lock); /* irqs remain disabled. */
665 } 734 }
666 735
736 rnp = rcu_get_root(rsp);
737 spin_lock(&rnp->lock); /* irqs already disabled. */
667 rsp->signaled = RCU_SIGNAL_INIT; /* force_quiescent_state now OK. */ 738 rsp->signaled = RCU_SIGNAL_INIT; /* force_quiescent_state now OK. */
739 spin_unlock(&rnp->lock); /* irqs remain disabled. */
668 spin_unlock_irqrestore(&rsp->onofflock, flags); 740 spin_unlock_irqrestore(&rsp->onofflock, flags);
669} 741}
670 742
671/* 743/*
672 * Advance this CPU's callbacks, but only if the current grace period 744 * Report a full set of quiescent states to the specified rcu_state
673 * has ended. This may be called only from the CPU to whom the rdp 745 * data structure. This involves cleaning up after the prior grace
674 * belongs. 746 * period and letting rcu_start_gp() start up the next grace period
675 */ 747 * if one is needed. Note that the caller must hold rnp->lock, as
676static void 748 * required by rcu_start_gp(), which will release it.
677rcu_process_gp_end(struct rcu_state *rsp, struct rcu_data *rdp)
678{
679 long completed_snap;
680 unsigned long flags;
681
682 local_irq_save(flags);
683 completed_snap = ACCESS_ONCE(rsp->completed); /* outside of lock. */
684
685 /* Did another grace period end? */
686 if (rdp->completed != completed_snap) {
687
688 /* Advance callbacks. No harm if list empty. */
689 rdp->nxttail[RCU_DONE_TAIL] = rdp->nxttail[RCU_WAIT_TAIL];
690 rdp->nxttail[RCU_WAIT_TAIL] = rdp->nxttail[RCU_NEXT_READY_TAIL];
691 rdp->nxttail[RCU_NEXT_READY_TAIL] = rdp->nxttail[RCU_NEXT_TAIL];
692
693 /* Remember that we saw this grace-period completion. */
694 rdp->completed = completed_snap;
695 }
696 local_irq_restore(flags);
697}
698
699/*
700 * Clean up after the prior grace period and let rcu_start_gp() start up
701 * the next grace period if one is needed. Note that the caller must
702 * hold rnp->lock, as required by rcu_start_gp(), which will release it.
703 */ 749 */
704static void cpu_quiet_msk_finish(struct rcu_state *rsp, unsigned long flags) 750static void rcu_report_qs_rsp(struct rcu_state *rsp, unsigned long flags)
705 __releases(rcu_get_root(rsp)->lock) 751 __releases(rcu_get_root(rsp)->lock)
706{ 752{
707 WARN_ON_ONCE(!rcu_gp_in_progress(rsp)); 753 WARN_ON_ONCE(!rcu_gp_in_progress(rsp));
708 rsp->completed = rsp->gpnum; 754 rsp->completed = rsp->gpnum;
709 rcu_process_gp_end(rsp, rsp->rda[smp_processor_id()]); 755 rsp->signaled = RCU_GP_IDLE;
710 rcu_start_gp(rsp, flags); /* releases root node's rnp->lock. */ 756 rcu_start_gp(rsp, flags); /* releases root node's rnp->lock. */
711} 757}
712 758
713/* 759/*
714 * Similar to cpu_quiet(), for which it is a helper function. Allows 760 * Similar to rcu_report_qs_rdp(), for which it is a helper function.
715 * a group of CPUs to be quieted at one go, though all the CPUs in the 761 * Allows quiescent states for a group of CPUs to be reported at one go
716 * group must be represented by the same leaf rcu_node structure. 762 * to the specified rcu_node structure, though all the CPUs in the group
717 * That structure's lock must be held upon entry, and it is released 763 * must be represented by the same rcu_node structure (which need not be
718 * before return. 764 * a leaf rcu_node structure, though it often will be). That structure's
765 * lock must be held upon entry, and it is released before return.
719 */ 766 */
720static void 767static void
721cpu_quiet_msk(unsigned long mask, struct rcu_state *rsp, struct rcu_node *rnp, 768rcu_report_qs_rnp(unsigned long mask, struct rcu_state *rsp,
722 unsigned long flags) 769 struct rcu_node *rnp, unsigned long flags)
723 __releases(rnp->lock) 770 __releases(rnp->lock)
724{ 771{
725 struct rcu_node *rnp_c; 772 struct rcu_node *rnp_c;
@@ -755,21 +802,23 @@ cpu_quiet_msk(unsigned long mask, struct rcu_state *rsp, struct rcu_node *rnp,
755 802
756 /* 803 /*
757 * Get here if we are the last CPU to pass through a quiescent 804 * Get here if we are the last CPU to pass through a quiescent
758 * state for this grace period. Invoke cpu_quiet_msk_finish() 805 * state for this grace period. Invoke rcu_report_qs_rsp()
759 * to clean up and start the next grace period if one is needed. 806 * to clean up and start the next grace period if one is needed.
760 */ 807 */
761 cpu_quiet_msk_finish(rsp, flags); /* releases rnp->lock. */ 808 rcu_report_qs_rsp(rsp, flags); /* releases rnp->lock. */
762} 809}
763 810
764/* 811/*
765 * Record a quiescent state for the specified CPU, which must either be 812 * Record a quiescent state for the specified CPU to that CPU's rcu_data
766 * the current CPU. The lastcomp argument is used to make sure we are 813 * structure. This must be either called from the specified CPU, or
767 * still in the grace period of interest. We don't want to end the current 814 * called when the specified CPU is known to be offline (and when it is
768 * grace period based on quiescent states detected in an earlier grace 815 * also known that no other CPU is concurrently trying to help the offline
769 * period! 816 * CPU). The lastcomp argument is used to make sure we are still in the
817 * grace period of interest. We don't want to end the current grace period
818 * based on quiescent states detected in an earlier grace period!
770 */ 819 */
771static void 820static void
772cpu_quiet(int cpu, struct rcu_state *rsp, struct rcu_data *rdp, long lastcomp) 821rcu_report_qs_rdp(int cpu, struct rcu_state *rsp, struct rcu_data *rdp, long lastcomp)
773{ 822{
774 unsigned long flags; 823 unsigned long flags;
775 unsigned long mask; 824 unsigned long mask;
@@ -777,15 +826,15 @@ cpu_quiet(int cpu, struct rcu_state *rsp, struct rcu_data *rdp, long lastcomp)
777 826
778 rnp = rdp->mynode; 827 rnp = rdp->mynode;
779 spin_lock_irqsave(&rnp->lock, flags); 828 spin_lock_irqsave(&rnp->lock, flags);
780 if (lastcomp != ACCESS_ONCE(rsp->completed)) { 829 if (lastcomp != rnp->completed) {
781 830
782 /* 831 /*
783 * Someone beat us to it for this grace period, so leave. 832 * Someone beat us to it for this grace period, so leave.
784 * The race with GP start is resolved by the fact that we 833 * The race with GP start is resolved by the fact that we
785 * hold the leaf rcu_node lock, so that the per-CPU bits 834 * hold the leaf rcu_node lock, so that the per-CPU bits
786 * cannot yet be initialized -- so we would simply find our 835 * cannot yet be initialized -- so we would simply find our
787 * CPU's bit already cleared in cpu_quiet_msk() if this race 836 * CPU's bit already cleared in rcu_report_qs_rnp() if this
788 * occurred. 837 * race occurred.
789 */ 838 */
790 rdp->passed_quiesc = 0; /* try again later! */ 839 rdp->passed_quiesc = 0; /* try again later! */
791 spin_unlock_irqrestore(&rnp->lock, flags); 840 spin_unlock_irqrestore(&rnp->lock, flags);
@@ -803,7 +852,7 @@ cpu_quiet(int cpu, struct rcu_state *rsp, struct rcu_data *rdp, long lastcomp)
803 */ 852 */
804 rdp->nxttail[RCU_NEXT_READY_TAIL] = rdp->nxttail[RCU_NEXT_TAIL]; 853 rdp->nxttail[RCU_NEXT_READY_TAIL] = rdp->nxttail[RCU_NEXT_TAIL];
805 854
806 cpu_quiet_msk(mask, rsp, rnp, flags); /* releases rnp->lock */ 855 rcu_report_qs_rnp(mask, rsp, rnp, flags); /* rlses rnp->lock */
807 } 856 }
808} 857}
809 858
@@ -834,8 +883,11 @@ rcu_check_quiescent_state(struct rcu_state *rsp, struct rcu_data *rdp)
834 if (!rdp->passed_quiesc) 883 if (!rdp->passed_quiesc)
835 return; 884 return;
836 885
837 /* Tell RCU we are done (but cpu_quiet() will be the judge of that). */ 886 /*
838 cpu_quiet(rdp->cpu, rsp, rdp, rdp->passed_quiesc_completed); 887 * Tell RCU we are done (but rcu_report_qs_rdp() will be the
888 * judge of that).
889 */
890 rcu_report_qs_rdp(rdp->cpu, rsp, rdp, rdp->passed_quiesc_completed);
839} 891}
840 892
841#ifdef CONFIG_HOTPLUG_CPU 893#ifdef CONFIG_HOTPLUG_CPU
@@ -895,8 +947,8 @@ static void rcu_adopt_orphan_cbs(struct rcu_state *rsp)
895static void __rcu_offline_cpu(int cpu, struct rcu_state *rsp) 947static void __rcu_offline_cpu(int cpu, struct rcu_state *rsp)
896{ 948{
897 unsigned long flags; 949 unsigned long flags;
898 long lastcomp;
899 unsigned long mask; 950 unsigned long mask;
951 int need_report = 0;
900 struct rcu_data *rdp = rsp->rda[cpu]; 952 struct rcu_data *rdp = rsp->rda[cpu];
901 struct rcu_node *rnp; 953 struct rcu_node *rnp;
902 954
@@ -910,30 +962,32 @@ static void __rcu_offline_cpu(int cpu, struct rcu_state *rsp)
910 spin_lock(&rnp->lock); /* irqs already disabled. */ 962 spin_lock(&rnp->lock); /* irqs already disabled. */
911 rnp->qsmaskinit &= ~mask; 963 rnp->qsmaskinit &= ~mask;
912 if (rnp->qsmaskinit != 0) { 964 if (rnp->qsmaskinit != 0) {
913 spin_unlock(&rnp->lock); /* irqs remain disabled. */ 965 if (rnp != rdp->mynode)
966 spin_unlock(&rnp->lock); /* irqs remain disabled. */
914 break; 967 break;
915 } 968 }
916 969 if (rnp == rdp->mynode)
917 /* 970 need_report = rcu_preempt_offline_tasks(rsp, rnp, rdp);
918 * If there was a task blocking the current grace period, 971 else
919 * and if all CPUs have checked in, we need to propagate 972 spin_unlock(&rnp->lock); /* irqs remain disabled. */
920 * the quiescent state up the rcu_node hierarchy. But that
921 * is inconvenient at the moment due to deadlock issues if
922 * this should end the current grace period. So set the
923 * offlined CPU's bit in ->qsmask in order to force the
924 * next force_quiescent_state() invocation to clean up this
925 * mess in a deadlock-free manner.
926 */
927 if (rcu_preempt_offline_tasks(rsp, rnp, rdp) && !rnp->qsmask)
928 rnp->qsmask |= mask;
929
930 mask = rnp->grpmask; 973 mask = rnp->grpmask;
931 spin_unlock(&rnp->lock); /* irqs remain disabled. */
932 rnp = rnp->parent; 974 rnp = rnp->parent;
933 } while (rnp != NULL); 975 } while (rnp != NULL);
934 lastcomp = rsp->completed;
935 976
936 spin_unlock_irqrestore(&rsp->onofflock, flags); 977 /*
978 * We still hold the leaf rcu_node structure lock here, and
979 * irqs are still disabled. The reason for this subterfuge is
980 * because invoking rcu_report_unblock_qs_rnp() with ->onofflock
981 * held leads to deadlock.
982 */
983 spin_unlock(&rsp->onofflock); /* irqs remain disabled. */
984 rnp = rdp->mynode;
985 if (need_report & RCU_OFL_TASKS_NORM_GP)
986 rcu_report_unblock_qs_rnp(rnp, flags);
987 else
988 spin_unlock_irqrestore(&rnp->lock, flags);
989 if (need_report & RCU_OFL_TASKS_EXP_GP)
990 rcu_report_exp_rnp(rsp, rnp);
937 991
938 rcu_adopt_orphan_cbs(rsp); 992 rcu_adopt_orphan_cbs(rsp);
939} 993}
@@ -1105,7 +1159,7 @@ static int rcu_process_dyntick(struct rcu_state *rsp, long lastcomp,
1105 rcu_for_each_leaf_node(rsp, rnp) { 1159 rcu_for_each_leaf_node(rsp, rnp) {
1106 mask = 0; 1160 mask = 0;
1107 spin_lock_irqsave(&rnp->lock, flags); 1161 spin_lock_irqsave(&rnp->lock, flags);
1108 if (rsp->completed != lastcomp) { 1162 if (rnp->completed != lastcomp) {
1109 spin_unlock_irqrestore(&rnp->lock, flags); 1163 spin_unlock_irqrestore(&rnp->lock, flags);
1110 return 1; 1164 return 1;
1111 } 1165 }
@@ -1119,10 +1173,10 @@ static int rcu_process_dyntick(struct rcu_state *rsp, long lastcomp,
1119 if ((rnp->qsmask & bit) != 0 && f(rsp->rda[cpu])) 1173 if ((rnp->qsmask & bit) != 0 && f(rsp->rda[cpu]))
1120 mask |= bit; 1174 mask |= bit;
1121 } 1175 }
1122 if (mask != 0 && rsp->completed == lastcomp) { 1176 if (mask != 0 && rnp->completed == lastcomp) {
1123 1177
1124 /* cpu_quiet_msk() releases rnp->lock. */ 1178 /* rcu_report_qs_rnp() releases rnp->lock. */
1125 cpu_quiet_msk(mask, rsp, rnp, flags); 1179 rcu_report_qs_rnp(mask, rsp, rnp, flags);
1126 continue; 1180 continue;
1127 } 1181 }
1128 spin_unlock_irqrestore(&rnp->lock, flags); 1182 spin_unlock_irqrestore(&rnp->lock, flags);
@@ -1140,6 +1194,7 @@ static void force_quiescent_state(struct rcu_state *rsp, int relaxed)
1140 long lastcomp; 1194 long lastcomp;
1141 struct rcu_node *rnp = rcu_get_root(rsp); 1195 struct rcu_node *rnp = rcu_get_root(rsp);
1142 u8 signaled; 1196 u8 signaled;
1197 u8 forcenow;
1143 1198
1144 if (!rcu_gp_in_progress(rsp)) 1199 if (!rcu_gp_in_progress(rsp))
1145 return; /* No grace period in progress, nothing to force. */ 1200 return; /* No grace period in progress, nothing to force. */
@@ -1152,19 +1207,20 @@ static void force_quiescent_state(struct rcu_state *rsp, int relaxed)
1152 goto unlock_ret; /* no emergency and done recently. */ 1207 goto unlock_ret; /* no emergency and done recently. */
1153 rsp->n_force_qs++; 1208 rsp->n_force_qs++;
1154 spin_lock(&rnp->lock); 1209 spin_lock(&rnp->lock);
1155 lastcomp = rsp->completed; 1210 lastcomp = rsp->gpnum - 1;
1156 signaled = rsp->signaled; 1211 signaled = rsp->signaled;
1157 rsp->jiffies_force_qs = jiffies + RCU_JIFFIES_TILL_FORCE_QS; 1212 rsp->jiffies_force_qs = jiffies + RCU_JIFFIES_TILL_FORCE_QS;
1158 if (lastcomp == rsp->gpnum) { 1213 if(!rcu_gp_in_progress(rsp)) {
1159 rsp->n_force_qs_ngp++; 1214 rsp->n_force_qs_ngp++;
1160 spin_unlock(&rnp->lock); 1215 spin_unlock(&rnp->lock);
1161 goto unlock_ret; /* no GP in progress, time updated. */ 1216 goto unlock_ret; /* no GP in progress, time updated. */
1162 } 1217 }
1163 spin_unlock(&rnp->lock); 1218 spin_unlock(&rnp->lock);
1164 switch (signaled) { 1219 switch (signaled) {
1220 case RCU_GP_IDLE:
1165 case RCU_GP_INIT: 1221 case RCU_GP_INIT:
1166 1222
1167 break; /* grace period still initializing, ignore. */ 1223 break; /* grace period idle or initializing, ignore. */
1168 1224
1169 case RCU_SAVE_DYNTICK: 1225 case RCU_SAVE_DYNTICK:
1170 1226
@@ -1175,20 +1231,29 @@ static void force_quiescent_state(struct rcu_state *rsp, int relaxed)
1175 if (rcu_process_dyntick(rsp, lastcomp, 1231 if (rcu_process_dyntick(rsp, lastcomp,
1176 dyntick_save_progress_counter)) 1232 dyntick_save_progress_counter))
1177 goto unlock_ret; 1233 goto unlock_ret;
1234 /* fall into next case. */
1235
1236 case RCU_SAVE_COMPLETED:
1178 1237
1179 /* Update state, record completion counter. */ 1238 /* Update state, record completion counter. */
1239 forcenow = 0;
1180 spin_lock(&rnp->lock); 1240 spin_lock(&rnp->lock);
1181 if (lastcomp == rsp->completed) { 1241 if (lastcomp + 1 == rsp->gpnum &&
1242 lastcomp == rsp->completed &&
1243 rsp->signaled == signaled) {
1182 rsp->signaled = RCU_FORCE_QS; 1244 rsp->signaled = RCU_FORCE_QS;
1183 dyntick_record_completed(rsp, lastcomp); 1245 rsp->completed_fqs = lastcomp;
1246 forcenow = signaled == RCU_SAVE_COMPLETED;
1184 } 1247 }
1185 spin_unlock(&rnp->lock); 1248 spin_unlock(&rnp->lock);
1186 break; 1249 if (!forcenow)
1250 break;
1251 /* fall into next case. */
1187 1252
1188 case RCU_FORCE_QS: 1253 case RCU_FORCE_QS:
1189 1254
1190 /* Check dyntick-idle state, send IPI to laggarts. */ 1255 /* Check dyntick-idle state, send IPI to laggarts. */
1191 if (rcu_process_dyntick(rsp, dyntick_recall_completed(rsp), 1256 if (rcu_process_dyntick(rsp, rsp->completed_fqs,
1192 rcu_implicit_dynticks_qs)) 1257 rcu_implicit_dynticks_qs))
1193 goto unlock_ret; 1258 goto unlock_ret;
1194 1259
@@ -1345,6 +1410,68 @@ void call_rcu_bh(struct rcu_head *head, void (*func)(struct rcu_head *rcu))
1345} 1410}
1346EXPORT_SYMBOL_GPL(call_rcu_bh); 1411EXPORT_SYMBOL_GPL(call_rcu_bh);
1347 1412
1413/**
1414 * synchronize_sched - wait until an rcu-sched grace period has elapsed.
1415 *
1416 * Control will return to the caller some time after a full rcu-sched
1417 * grace period has elapsed, in other words after all currently executing
1418 * rcu-sched read-side critical sections have completed. These read-side
1419 * critical sections are delimited by rcu_read_lock_sched() and
1420 * rcu_read_unlock_sched(), and may be nested. Note that preempt_disable(),
1421 * local_irq_disable(), and so on may be used in place of
1422 * rcu_read_lock_sched().
1423 *
1424 * This means that all preempt_disable code sequences, including NMI and
1425 * hardware-interrupt handlers, in progress on entry will have completed
1426 * before this primitive returns. However, this does not guarantee that
1427 * softirq handlers will have completed, since in some kernels, these
1428 * handlers can run in process context, and can block.
1429 *
1430 * This primitive provides the guarantees made by the (now removed)
1431 * synchronize_kernel() API. In contrast, synchronize_rcu() only
1432 * guarantees that rcu_read_lock() sections will have completed.
1433 * In "classic RCU", these two guarantees happen to be one and
1434 * the same, but can differ in realtime RCU implementations.
1435 */
1436void synchronize_sched(void)
1437{
1438 struct rcu_synchronize rcu;
1439
1440 if (rcu_blocking_is_gp())
1441 return;
1442
1443 init_completion(&rcu.completion);
1444 /* Will wake me after RCU finished. */
1445 call_rcu_sched(&rcu.head, wakeme_after_rcu);
1446 /* Wait for it. */
1447 wait_for_completion(&rcu.completion);
1448}
1449EXPORT_SYMBOL_GPL(synchronize_sched);
1450
1451/**
1452 * synchronize_rcu_bh - wait until an rcu_bh grace period has elapsed.
1453 *
1454 * Control will return to the caller some time after a full rcu_bh grace
1455 * period has elapsed, in other words after all currently executing rcu_bh
1456 * read-side critical sections have completed. RCU read-side critical
1457 * sections are delimited by rcu_read_lock_bh() and rcu_read_unlock_bh(),
1458 * and may be nested.
1459 */
1460void synchronize_rcu_bh(void)
1461{
1462 struct rcu_synchronize rcu;
1463
1464 if (rcu_blocking_is_gp())
1465 return;
1466
1467 init_completion(&rcu.completion);
1468 /* Will wake me after RCU finished. */
1469 call_rcu_bh(&rcu.head, wakeme_after_rcu);
1470 /* Wait for it. */
1471 wait_for_completion(&rcu.completion);
1472}
1473EXPORT_SYMBOL_GPL(synchronize_rcu_bh);
1474
1348/* 1475/*
1349 * Check to see if there is any immediate RCU-related work to be done 1476 * Check to see if there is any immediate RCU-related work to be done
1350 * by the current CPU, for the specified type of RCU, returning 1 if so. 1477 * by the current CPU, for the specified type of RCU, returning 1 if so.
@@ -1354,6 +1481,8 @@ EXPORT_SYMBOL_GPL(call_rcu_bh);
1354 */ 1481 */
1355static int __rcu_pending(struct rcu_state *rsp, struct rcu_data *rdp) 1482static int __rcu_pending(struct rcu_state *rsp, struct rcu_data *rdp)
1356{ 1483{
1484 struct rcu_node *rnp = rdp->mynode;
1485
1357 rdp->n_rcu_pending++; 1486 rdp->n_rcu_pending++;
1358 1487
1359 /* Check for CPU stalls, if enabled. */ 1488 /* Check for CPU stalls, if enabled. */
@@ -1378,13 +1507,13 @@ static int __rcu_pending(struct rcu_state *rsp, struct rcu_data *rdp)
1378 } 1507 }
1379 1508
1380 /* Has another RCU grace period completed? */ 1509 /* Has another RCU grace period completed? */
1381 if (ACCESS_ONCE(rsp->completed) != rdp->completed) { /* outside lock */ 1510 if (ACCESS_ONCE(rnp->completed) != rdp->completed) { /* outside lock */
1382 rdp->n_rp_gp_completed++; 1511 rdp->n_rp_gp_completed++;
1383 return 1; 1512 return 1;
1384 } 1513 }
1385 1514
1386 /* Has a new RCU grace period started? */ 1515 /* Has a new RCU grace period started? */
1387 if (ACCESS_ONCE(rsp->gpnum) != rdp->gpnum) { /* outside lock */ 1516 if (ACCESS_ONCE(rnp->gpnum) != rdp->gpnum) { /* outside lock */
1388 rdp->n_rp_gp_started++; 1517 rdp->n_rp_gp_started++;
1389 return 1; 1518 return 1;
1390 } 1519 }
@@ -1427,6 +1556,21 @@ int rcu_needs_cpu(int cpu)
1427 rcu_preempt_needs_cpu(cpu); 1556 rcu_preempt_needs_cpu(cpu);
1428} 1557}
1429 1558
1559/*
1560 * This function is invoked towards the end of the scheduler's initialization
1561 * process. Before this is called, the idle task might contain
1562 * RCU read-side critical sections (during which time, this idle
1563 * task is booting the system). After this function is called, the
1564 * idle tasks are prohibited from containing RCU read-side critical
1565 * sections.
1566 */
1567void rcu_scheduler_starting(void)
1568{
1569 WARN_ON(num_online_cpus() != 1);
1570 WARN_ON(nr_context_switches() > 0);
1571 rcu_scheduler_active = 1;
1572}
1573
1430static DEFINE_PER_CPU(struct rcu_head, rcu_barrier_head) = {NULL}; 1574static DEFINE_PER_CPU(struct rcu_head, rcu_barrier_head) = {NULL};
1431static atomic_t rcu_barrier_cpu_count; 1575static atomic_t rcu_barrier_cpu_count;
1432static DEFINE_MUTEX(rcu_barrier_mutex); 1576static DEFINE_MUTEX(rcu_barrier_mutex);
@@ -1538,21 +1682,16 @@ static void __cpuinit
1538rcu_init_percpu_data(int cpu, struct rcu_state *rsp, int preemptable) 1682rcu_init_percpu_data(int cpu, struct rcu_state *rsp, int preemptable)
1539{ 1683{
1540 unsigned long flags; 1684 unsigned long flags;
1541 long lastcomp;
1542 unsigned long mask; 1685 unsigned long mask;
1543 struct rcu_data *rdp = rsp->rda[cpu]; 1686 struct rcu_data *rdp = rsp->rda[cpu];
1544 struct rcu_node *rnp = rcu_get_root(rsp); 1687 struct rcu_node *rnp = rcu_get_root(rsp);
1545 1688
1546 /* Set up local state, ensuring consistent view of global state. */ 1689 /* Set up local state, ensuring consistent view of global state. */
1547 spin_lock_irqsave(&rnp->lock, flags); 1690 spin_lock_irqsave(&rnp->lock, flags);
1548 lastcomp = rsp->completed;
1549 rdp->completed = lastcomp;
1550 rdp->gpnum = lastcomp;
1551 rdp->passed_quiesc = 0; /* We could be racing with new GP, */ 1691 rdp->passed_quiesc = 0; /* We could be racing with new GP, */
1552 rdp->qs_pending = 1; /* so set up to respond to current GP. */ 1692 rdp->qs_pending = 1; /* so set up to respond to current GP. */
1553 rdp->beenonline = 1; /* We have now been online. */ 1693 rdp->beenonline = 1; /* We have now been online. */
1554 rdp->preemptable = preemptable; 1694 rdp->preemptable = preemptable;
1555 rdp->passed_quiesc_completed = lastcomp - 1;
1556 rdp->qlen_last_fqs_check = 0; 1695 rdp->qlen_last_fqs_check = 0;
1557 rdp->n_force_qs_snap = rsp->n_force_qs; 1696 rdp->n_force_qs_snap = rsp->n_force_qs;
1558 rdp->blimit = blimit; 1697 rdp->blimit = blimit;
@@ -1574,6 +1713,11 @@ rcu_init_percpu_data(int cpu, struct rcu_state *rsp, int preemptable)
1574 spin_lock(&rnp->lock); /* irqs already disabled. */ 1713 spin_lock(&rnp->lock); /* irqs already disabled. */
1575 rnp->qsmaskinit |= mask; 1714 rnp->qsmaskinit |= mask;
1576 mask = rnp->grpmask; 1715 mask = rnp->grpmask;
1716 if (rnp == rdp->mynode) {
1717 rdp->gpnum = rnp->completed; /* if GP in progress... */
1718 rdp->completed = rnp->completed;
1719 rdp->passed_quiesc_completed = rnp->completed - 1;
1720 }
1577 spin_unlock(&rnp->lock); /* irqs already disabled. */ 1721 spin_unlock(&rnp->lock); /* irqs already disabled. */
1578 rnp = rnp->parent; 1722 rnp = rnp->parent;
1579 } while (rnp != NULL && !(rnp->qsmaskinit & mask)); 1723 } while (rnp != NULL && !(rnp->qsmaskinit & mask));
@@ -1591,8 +1735,8 @@ static void __cpuinit rcu_online_cpu(int cpu)
1591/* 1735/*
1592 * Handle CPU online/offline notification events. 1736 * Handle CPU online/offline notification events.
1593 */ 1737 */
1594int __cpuinit rcu_cpu_notify(struct notifier_block *self, 1738static int __cpuinit rcu_cpu_notify(struct notifier_block *self,
1595 unsigned long action, void *hcpu) 1739 unsigned long action, void *hcpu)
1596{ 1740{
1597 long cpu = (long)hcpu; 1741 long cpu = (long)hcpu;
1598 1742
@@ -1679,8 +1823,8 @@ static void __init rcu_init_one(struct rcu_state *rsp)
1679 cpustride *= rsp->levelspread[i]; 1823 cpustride *= rsp->levelspread[i];
1680 rnp = rsp->level[i]; 1824 rnp = rsp->level[i];
1681 for (j = 0; j < rsp->levelcnt[i]; j++, rnp++) { 1825 for (j = 0; j < rsp->levelcnt[i]; j++, rnp++) {
1682 if (rnp != rcu_get_root(rsp)) 1826 spin_lock_init(&rnp->lock);
1683 spin_lock_init(&rnp->lock); 1827 lockdep_set_class(&rnp->lock, &rcu_node_class[i]);
1684 rnp->gpnum = 0; 1828 rnp->gpnum = 0;
1685 rnp->qsmask = 0; 1829 rnp->qsmask = 0;
1686 rnp->qsmaskinit = 0; 1830 rnp->qsmaskinit = 0;
@@ -1701,9 +1845,10 @@ static void __init rcu_init_one(struct rcu_state *rsp)
1701 rnp->level = i; 1845 rnp->level = i;
1702 INIT_LIST_HEAD(&rnp->blocked_tasks[0]); 1846 INIT_LIST_HEAD(&rnp->blocked_tasks[0]);
1703 INIT_LIST_HEAD(&rnp->blocked_tasks[1]); 1847 INIT_LIST_HEAD(&rnp->blocked_tasks[1]);
1848 INIT_LIST_HEAD(&rnp->blocked_tasks[2]);
1849 INIT_LIST_HEAD(&rnp->blocked_tasks[3]);
1704 } 1850 }
1705 } 1851 }
1706 spin_lock_init(&rcu_get_root(rsp)->lock);
1707} 1852}
1708 1853
1709/* 1854/*
@@ -1729,16 +1874,30 @@ do { \
1729 } \ 1874 } \
1730} while (0) 1875} while (0)
1731 1876
1732void __init __rcu_init(void) 1877void __init rcu_init(void)
1733{ 1878{
1879 int i;
1880
1734 rcu_bootup_announce(); 1881 rcu_bootup_announce();
1735#ifdef CONFIG_RCU_CPU_STALL_DETECTOR 1882#ifdef CONFIG_RCU_CPU_STALL_DETECTOR
1736 printk(KERN_INFO "RCU-based detection of stalled CPUs is enabled.\n"); 1883 printk(KERN_INFO "RCU-based detection of stalled CPUs is enabled.\n");
1737#endif /* #ifdef CONFIG_RCU_CPU_STALL_DETECTOR */ 1884#endif /* #ifdef CONFIG_RCU_CPU_STALL_DETECTOR */
1885#if NUM_RCU_LVL_4 != 0
1886 printk(KERN_INFO "Experimental four-level hierarchy is enabled.\n");
1887#endif /* #if NUM_RCU_LVL_4 != 0 */
1738 RCU_INIT_FLAVOR(&rcu_sched_state, rcu_sched_data); 1888 RCU_INIT_FLAVOR(&rcu_sched_state, rcu_sched_data);
1739 RCU_INIT_FLAVOR(&rcu_bh_state, rcu_bh_data); 1889 RCU_INIT_FLAVOR(&rcu_bh_state, rcu_bh_data);
1740 __rcu_init_preempt(); 1890 __rcu_init_preempt();
1741 open_softirq(RCU_SOFTIRQ, rcu_process_callbacks); 1891 open_softirq(RCU_SOFTIRQ, rcu_process_callbacks);
1892
1893 /*
1894 * We don't need protection against CPU-hotplug here because
1895 * this is called early in boot, before either interrupts
1896 * or the scheduler are operational.
1897 */
1898 cpu_notifier(rcu_cpu_notify, 0);
1899 for_each_online_cpu(i)
1900 rcu_cpu_notify(NULL, CPU_UP_PREPARE, (void *)(long)i);
1742} 1901}
1743 1902
1744#include "rcutree_plugin.h" 1903#include "rcutree_plugin.h"
diff --git a/kernel/rcutree.h b/kernel/rcutree.h
index 1823c6e20609..d2a0046f63b2 100644
--- a/kernel/rcutree.h
+++ b/kernel/rcutree.h
@@ -34,10 +34,11 @@
34 * In practice, this has not been tested, so there is probably some 34 * In practice, this has not been tested, so there is probably some
35 * bug somewhere. 35 * bug somewhere.
36 */ 36 */
37#define MAX_RCU_LVLS 3 37#define MAX_RCU_LVLS 4
38#define RCU_FANOUT (CONFIG_RCU_FANOUT) 38#define RCU_FANOUT (CONFIG_RCU_FANOUT)
39#define RCU_FANOUT_SQ (RCU_FANOUT * RCU_FANOUT) 39#define RCU_FANOUT_SQ (RCU_FANOUT * RCU_FANOUT)
40#define RCU_FANOUT_CUBE (RCU_FANOUT_SQ * RCU_FANOUT) 40#define RCU_FANOUT_CUBE (RCU_FANOUT_SQ * RCU_FANOUT)
41#define RCU_FANOUT_FOURTH (RCU_FANOUT_CUBE * RCU_FANOUT)
41 42
42#if NR_CPUS <= RCU_FANOUT 43#if NR_CPUS <= RCU_FANOUT
43# define NUM_RCU_LVLS 1 44# define NUM_RCU_LVLS 1
@@ -45,23 +46,33 @@
45# define NUM_RCU_LVL_1 (NR_CPUS) 46# define NUM_RCU_LVL_1 (NR_CPUS)
46# define NUM_RCU_LVL_2 0 47# define NUM_RCU_LVL_2 0
47# define NUM_RCU_LVL_3 0 48# define NUM_RCU_LVL_3 0
49# define NUM_RCU_LVL_4 0
48#elif NR_CPUS <= RCU_FANOUT_SQ 50#elif NR_CPUS <= RCU_FANOUT_SQ
49# define NUM_RCU_LVLS 2 51# define NUM_RCU_LVLS 2
50# define NUM_RCU_LVL_0 1 52# define NUM_RCU_LVL_0 1
51# define NUM_RCU_LVL_1 DIV_ROUND_UP(NR_CPUS, RCU_FANOUT) 53# define NUM_RCU_LVL_1 DIV_ROUND_UP(NR_CPUS, RCU_FANOUT)
52# define NUM_RCU_LVL_2 (NR_CPUS) 54# define NUM_RCU_LVL_2 (NR_CPUS)
53# define NUM_RCU_LVL_3 0 55# define NUM_RCU_LVL_3 0
56# define NUM_RCU_LVL_4 0
54#elif NR_CPUS <= RCU_FANOUT_CUBE 57#elif NR_CPUS <= RCU_FANOUT_CUBE
55# define NUM_RCU_LVLS 3 58# define NUM_RCU_LVLS 3
56# define NUM_RCU_LVL_0 1 59# define NUM_RCU_LVL_0 1
57# define NUM_RCU_LVL_1 DIV_ROUND_UP(NR_CPUS, RCU_FANOUT_SQ) 60# define NUM_RCU_LVL_1 DIV_ROUND_UP(NR_CPUS, RCU_FANOUT_SQ)
58# define NUM_RCU_LVL_2 DIV_ROUND_UP(NR_CPUS, RCU_FANOUT) 61# define NUM_RCU_LVL_2 DIV_ROUND_UP(NR_CPUS, RCU_FANOUT)
59# define NUM_RCU_LVL_3 NR_CPUS 62# define NUM_RCU_LVL_3 NR_CPUS
63# define NUM_RCU_LVL_4 0
64#elif NR_CPUS <= RCU_FANOUT_FOURTH
65# define NUM_RCU_LVLS 4
66# define NUM_RCU_LVL_0 1
67# define NUM_RCU_LVL_1 DIV_ROUND_UP(NR_CPUS, RCU_FANOUT_CUBE)
68# define NUM_RCU_LVL_2 DIV_ROUND_UP(NR_CPUS, RCU_FANOUT_SQ)
69# define NUM_RCU_LVL_3 DIV_ROUND_UP(NR_CPUS, RCU_FANOUT)
70# define NUM_RCU_LVL_4 NR_CPUS
60#else 71#else
61# error "CONFIG_RCU_FANOUT insufficient for NR_CPUS" 72# error "CONFIG_RCU_FANOUT insufficient for NR_CPUS"
62#endif /* #if (NR_CPUS) <= RCU_FANOUT */ 73#endif /* #if (NR_CPUS) <= RCU_FANOUT */
63 74
64#define RCU_SUM (NUM_RCU_LVL_0 + NUM_RCU_LVL_1 + NUM_RCU_LVL_2 + NUM_RCU_LVL_3) 75#define RCU_SUM (NUM_RCU_LVL_0 + NUM_RCU_LVL_1 + NUM_RCU_LVL_2 + NUM_RCU_LVL_3 + NUM_RCU_LVL_4)
65#define NUM_RCU_NODES (RCU_SUM - NR_CPUS) 76#define NUM_RCU_NODES (RCU_SUM - NR_CPUS)
66 77
67/* 78/*
@@ -84,14 +95,21 @@ struct rcu_node {
84 long gpnum; /* Current grace period for this node. */ 95 long gpnum; /* Current grace period for this node. */
85 /* This will either be equal to or one */ 96 /* This will either be equal to or one */
86 /* behind the root rcu_node's gpnum. */ 97 /* behind the root rcu_node's gpnum. */
98 long completed; /* Last grace period completed for this node. */
99 /* This will either be equal to or one */
100 /* behind the root rcu_node's gpnum. */
87 unsigned long qsmask; /* CPUs or groups that need to switch in */ 101 unsigned long qsmask; /* CPUs or groups that need to switch in */
88 /* order for current grace period to proceed.*/ 102 /* order for current grace period to proceed.*/
89 /* In leaf rcu_node, each bit corresponds to */ 103 /* In leaf rcu_node, each bit corresponds to */
90 /* an rcu_data structure, otherwise, each */ 104 /* an rcu_data structure, otherwise, each */
91 /* bit corresponds to a child rcu_node */ 105 /* bit corresponds to a child rcu_node */
92 /* structure. */ 106 /* structure. */
107 unsigned long expmask; /* Groups that have ->blocked_tasks[] */
108 /* elements that need to drain to allow the */
109 /* current expedited grace period to */
110 /* complete (only for TREE_PREEMPT_RCU). */
93 unsigned long qsmaskinit; 111 unsigned long qsmaskinit;
94 /* Per-GP initialization for qsmask. */ 112 /* Per-GP initial value for qsmask & expmask. */
95 unsigned long grpmask; /* Mask to apply to parent qsmask. */ 113 unsigned long grpmask; /* Mask to apply to parent qsmask. */
96 /* Only one bit will be set in this mask. */ 114 /* Only one bit will be set in this mask. */
97 int grplo; /* lowest-numbered CPU or group here. */ 115 int grplo; /* lowest-numbered CPU or group here. */
@@ -99,7 +117,7 @@ struct rcu_node {
99 u8 grpnum; /* CPU/group number for next level up. */ 117 u8 grpnum; /* CPU/group number for next level up. */
100 u8 level; /* root is at level 0. */ 118 u8 level; /* root is at level 0. */
101 struct rcu_node *parent; 119 struct rcu_node *parent;
102 struct list_head blocked_tasks[2]; 120 struct list_head blocked_tasks[4];
103 /* Tasks blocked in RCU read-side critsect. */ 121 /* Tasks blocked in RCU read-side critsect. */
104 /* Grace period number (->gpnum) x blocked */ 122 /* Grace period number (->gpnum) x blocked */
105 /* by tasks on the (x & 0x1) element of the */ 123 /* by tasks on the (x & 0x1) element of the */
@@ -114,6 +132,21 @@ struct rcu_node {
114 for ((rnp) = &(rsp)->node[0]; \ 132 for ((rnp) = &(rsp)->node[0]; \
115 (rnp) < &(rsp)->node[NUM_RCU_NODES]; (rnp)++) 133 (rnp) < &(rsp)->node[NUM_RCU_NODES]; (rnp)++)
116 134
135/*
136 * Do a breadth-first scan of the non-leaf rcu_node structures for the
137 * specified rcu_state structure. Note that if there is a singleton
138 * rcu_node tree with but one rcu_node structure, this loop is a no-op.
139 */
140#define rcu_for_each_nonleaf_node_breadth_first(rsp, rnp) \
141 for ((rnp) = &(rsp)->node[0]; \
142 (rnp) < (rsp)->level[NUM_RCU_LVLS - 1]; (rnp)++)
143
144/*
145 * Scan the leaves of the rcu_node hierarchy for the specified rcu_state
146 * structure. Note that if there is a singleton rcu_node tree with but
147 * one rcu_node structure, this loop -will- visit the rcu_node structure.
148 * It is still a leaf node, even if it is also the root node.
149 */
117#define rcu_for_each_leaf_node(rsp, rnp) \ 150#define rcu_for_each_leaf_node(rsp, rnp) \
118 for ((rnp) = (rsp)->level[NUM_RCU_LVLS - 1]; \ 151 for ((rnp) = (rsp)->level[NUM_RCU_LVLS - 1]; \
119 (rnp) < &(rsp)->node[NUM_RCU_NODES]; (rnp)++) 152 (rnp) < &(rsp)->node[NUM_RCU_NODES]; (rnp)++)
@@ -201,13 +234,15 @@ struct rcu_data {
201}; 234};
202 235
203/* Values for signaled field in struct rcu_state. */ 236/* Values for signaled field in struct rcu_state. */
204#define RCU_GP_INIT 0 /* Grace period being initialized. */ 237#define RCU_GP_IDLE 0 /* No grace period in progress. */
205#define RCU_SAVE_DYNTICK 1 /* Need to scan dyntick state. */ 238#define RCU_GP_INIT 1 /* Grace period being initialized. */
206#define RCU_FORCE_QS 2 /* Need to force quiescent state. */ 239#define RCU_SAVE_DYNTICK 2 /* Need to scan dyntick state. */
240#define RCU_SAVE_COMPLETED 3 /* Need to save rsp->completed. */
241#define RCU_FORCE_QS 4 /* Need to force quiescent state. */
207#ifdef CONFIG_NO_HZ 242#ifdef CONFIG_NO_HZ
208#define RCU_SIGNAL_INIT RCU_SAVE_DYNTICK 243#define RCU_SIGNAL_INIT RCU_SAVE_DYNTICK
209#else /* #ifdef CONFIG_NO_HZ */ 244#else /* #ifdef CONFIG_NO_HZ */
210#define RCU_SIGNAL_INIT RCU_FORCE_QS 245#define RCU_SIGNAL_INIT RCU_SAVE_COMPLETED
211#endif /* #else #ifdef CONFIG_NO_HZ */ 246#endif /* #else #ifdef CONFIG_NO_HZ */
212 247
213#define RCU_JIFFIES_TILL_FORCE_QS 3 /* for rsp->jiffies_force_qs */ 248#define RCU_JIFFIES_TILL_FORCE_QS 3 /* for rsp->jiffies_force_qs */
@@ -245,7 +280,7 @@ struct rcu_state {
245 long gpnum; /* Current gp number. */ 280 long gpnum; /* Current gp number. */
246 long completed; /* # of last completed gp. */ 281 long completed; /* # of last completed gp. */
247 282
248 /* End of fields guarded by root rcu_node's lock. */ 283 /* End of fields guarded by root rcu_node's lock. */
249 284
250 spinlock_t onofflock; /* exclude on/offline and */ 285 spinlock_t onofflock; /* exclude on/offline and */
251 /* starting new GP. Also */ 286 /* starting new GP. Also */
@@ -259,6 +294,8 @@ struct rcu_state {
259 long orphan_qlen; /* Number of orphaned cbs. */ 294 long orphan_qlen; /* Number of orphaned cbs. */
260 spinlock_t fqslock; /* Only one task forcing */ 295 spinlock_t fqslock; /* Only one task forcing */
261 /* quiescent states. */ 296 /* quiescent states. */
297 long completed_fqs; /* Value of completed @ snap. */
298 /* Protected by fqslock. */
262 unsigned long jiffies_force_qs; /* Time at which to invoke */ 299 unsigned long jiffies_force_qs; /* Time at which to invoke */
263 /* force_quiescent_state(). */ 300 /* force_quiescent_state(). */
264 unsigned long n_force_qs; /* Number of calls to */ 301 unsigned long n_force_qs; /* Number of calls to */
@@ -273,11 +310,15 @@ struct rcu_state {
273 unsigned long jiffies_stall; /* Time at which to check */ 310 unsigned long jiffies_stall; /* Time at which to check */
274 /* for CPU stalls. */ 311 /* for CPU stalls. */
275#endif /* #ifdef CONFIG_RCU_CPU_STALL_DETECTOR */ 312#endif /* #ifdef CONFIG_RCU_CPU_STALL_DETECTOR */
276#ifdef CONFIG_NO_HZ
277 long dynticks_completed; /* Value of completed @ snap. */
278#endif /* #ifdef CONFIG_NO_HZ */
279}; 313};
280 314
315/* Return values for rcu_preempt_offline_tasks(). */
316
317#define RCU_OFL_TASKS_NORM_GP 0x1 /* Tasks blocking normal */
318 /* GP were moved to root. */
319#define RCU_OFL_TASKS_EXP_GP 0x2 /* Tasks blocking expedited */
320 /* GP were moved to root. */
321
281#ifdef RCU_TREE_NONCORE 322#ifdef RCU_TREE_NONCORE
282 323
283/* 324/*
@@ -297,10 +338,14 @@ DECLARE_PER_CPU(struct rcu_data, rcu_preempt_data);
297#else /* #ifdef RCU_TREE_NONCORE */ 338#else /* #ifdef RCU_TREE_NONCORE */
298 339
299/* Forward declarations for rcutree_plugin.h */ 340/* Forward declarations for rcutree_plugin.h */
300static inline void rcu_bootup_announce(void); 341static void rcu_bootup_announce(void);
301long rcu_batches_completed(void); 342long rcu_batches_completed(void);
302static void rcu_preempt_note_context_switch(int cpu); 343static void rcu_preempt_note_context_switch(int cpu);
303static int rcu_preempted_readers(struct rcu_node *rnp); 344static int rcu_preempted_readers(struct rcu_node *rnp);
345#ifdef CONFIG_HOTPLUG_CPU
346static void rcu_report_unblock_qs_rnp(struct rcu_node *rnp,
347 unsigned long flags);
348#endif /* #ifdef CONFIG_HOTPLUG_CPU */
304#ifdef CONFIG_RCU_CPU_STALL_DETECTOR 349#ifdef CONFIG_RCU_CPU_STALL_DETECTOR
305static void rcu_print_task_stall(struct rcu_node *rnp); 350static void rcu_print_task_stall(struct rcu_node *rnp);
306#endif /* #ifdef CONFIG_RCU_CPU_STALL_DETECTOR */ 351#endif /* #ifdef CONFIG_RCU_CPU_STALL_DETECTOR */
@@ -314,6 +359,9 @@ static void rcu_preempt_offline_cpu(int cpu);
314static void rcu_preempt_check_callbacks(int cpu); 359static void rcu_preempt_check_callbacks(int cpu);
315static void rcu_preempt_process_callbacks(void); 360static void rcu_preempt_process_callbacks(void);
316void call_rcu(struct rcu_head *head, void (*func)(struct rcu_head *rcu)); 361void call_rcu(struct rcu_head *head, void (*func)(struct rcu_head *rcu));
362#if defined(CONFIG_HOTPLUG_CPU) || defined(CONFIG_TREE_PREEMPT_RCU)
363static void rcu_report_exp_rnp(struct rcu_state *rsp, struct rcu_node *rnp);
364#endif /* #if defined(CONFIG_HOTPLUG_CPU) || defined(CONFIG_TREE_PREEMPT_RCU) */
317static int rcu_preempt_pending(int cpu); 365static int rcu_preempt_pending(int cpu);
318static int rcu_preempt_needs_cpu(int cpu); 366static int rcu_preempt_needs_cpu(int cpu);
319static void __cpuinit rcu_preempt_init_percpu_data(int cpu); 367static void __cpuinit rcu_preempt_init_percpu_data(int cpu);
diff --git a/kernel/rcutree_plugin.h b/kernel/rcutree_plugin.h
index ef2a58c2b9d5..37fbccdf41d5 100644
--- a/kernel/rcutree_plugin.h
+++ b/kernel/rcutree_plugin.h
@@ -24,16 +24,19 @@
24 * Paul E. McKenney <paulmck@linux.vnet.ibm.com> 24 * Paul E. McKenney <paulmck@linux.vnet.ibm.com>
25 */ 25 */
26 26
27#include <linux/delay.h>
27 28
28#ifdef CONFIG_TREE_PREEMPT_RCU 29#ifdef CONFIG_TREE_PREEMPT_RCU
29 30
30struct rcu_state rcu_preempt_state = RCU_STATE_INITIALIZER(rcu_preempt_state); 31struct rcu_state rcu_preempt_state = RCU_STATE_INITIALIZER(rcu_preempt_state);
31DEFINE_PER_CPU(struct rcu_data, rcu_preempt_data); 32DEFINE_PER_CPU(struct rcu_data, rcu_preempt_data);
32 33
34static int rcu_preempted_readers_exp(struct rcu_node *rnp);
35
33/* 36/*
34 * Tell them what RCU they are running. 37 * Tell them what RCU they are running.
35 */ 38 */
36static inline void rcu_bootup_announce(void) 39static void __init rcu_bootup_announce(void)
37{ 40{
38 printk(KERN_INFO 41 printk(KERN_INFO
39 "Experimental preemptable hierarchical RCU implementation.\n"); 42 "Experimental preemptable hierarchical RCU implementation.\n");
@@ -67,7 +70,7 @@ EXPORT_SYMBOL_GPL(rcu_batches_completed);
67static void rcu_preempt_qs(int cpu) 70static void rcu_preempt_qs(int cpu)
68{ 71{
69 struct rcu_data *rdp = &per_cpu(rcu_preempt_data, cpu); 72 struct rcu_data *rdp = &per_cpu(rcu_preempt_data, cpu);
70 rdp->passed_quiesc_completed = rdp->completed; 73 rdp->passed_quiesc_completed = rdp->gpnum - 1;
71 barrier(); 74 barrier();
72 rdp->passed_quiesc = 1; 75 rdp->passed_quiesc = 1;
73} 76}
@@ -157,14 +160,58 @@ EXPORT_SYMBOL_GPL(__rcu_read_lock);
157 */ 160 */
158static int rcu_preempted_readers(struct rcu_node *rnp) 161static int rcu_preempted_readers(struct rcu_node *rnp)
159{ 162{
160 return !list_empty(&rnp->blocked_tasks[rnp->gpnum & 0x1]); 163 int phase = rnp->gpnum & 0x1;
164
165 return !list_empty(&rnp->blocked_tasks[phase]) ||
166 !list_empty(&rnp->blocked_tasks[phase + 2]);
167}
168
169/*
170 * Record a quiescent state for all tasks that were previously queued
171 * on the specified rcu_node structure and that were blocking the current
172 * RCU grace period. The caller must hold the specified rnp->lock with
173 * irqs disabled, and this lock is released upon return, but irqs remain
174 * disabled.
175 */
176static void rcu_report_unblock_qs_rnp(struct rcu_node *rnp, unsigned long flags)
177 __releases(rnp->lock)
178{
179 unsigned long mask;
180 struct rcu_node *rnp_p;
181
182 if (rnp->qsmask != 0 || rcu_preempted_readers(rnp)) {
183 spin_unlock_irqrestore(&rnp->lock, flags);
184 return; /* Still need more quiescent states! */
185 }
186
187 rnp_p = rnp->parent;
188 if (rnp_p == NULL) {
189 /*
190 * Either there is only one rcu_node in the tree,
191 * or tasks were kicked up to root rcu_node due to
192 * CPUs going offline.
193 */
194 rcu_report_qs_rsp(&rcu_preempt_state, flags);
195 return;
196 }
197
198 /* Report up the rest of the hierarchy. */
199 mask = rnp->grpmask;
200 spin_unlock(&rnp->lock); /* irqs remain disabled. */
201 spin_lock(&rnp_p->lock); /* irqs already disabled. */
202 rcu_report_qs_rnp(mask, &rcu_preempt_state, rnp_p, flags);
161} 203}
162 204
205/*
206 * Handle special cases during rcu_read_unlock(), such as needing to
207 * notify RCU core processing or task having blocked during the RCU
208 * read-side critical section.
209 */
163static void rcu_read_unlock_special(struct task_struct *t) 210static void rcu_read_unlock_special(struct task_struct *t)
164{ 211{
165 int empty; 212 int empty;
213 int empty_exp;
166 unsigned long flags; 214 unsigned long flags;
167 unsigned long mask;
168 struct rcu_node *rnp; 215 struct rcu_node *rnp;
169 int special; 216 int special;
170 217
@@ -207,36 +254,30 @@ static void rcu_read_unlock_special(struct task_struct *t)
207 spin_unlock(&rnp->lock); /* irqs remain disabled. */ 254 spin_unlock(&rnp->lock); /* irqs remain disabled. */
208 } 255 }
209 empty = !rcu_preempted_readers(rnp); 256 empty = !rcu_preempted_readers(rnp);
257 empty_exp = !rcu_preempted_readers_exp(rnp);
258 smp_mb(); /* ensure expedited fastpath sees end of RCU c-s. */
210 list_del_init(&t->rcu_node_entry); 259 list_del_init(&t->rcu_node_entry);
211 t->rcu_blocked_node = NULL; 260 t->rcu_blocked_node = NULL;
212 261
213 /* 262 /*
214 * If this was the last task on the current list, and if 263 * If this was the last task on the current list, and if
215 * we aren't waiting on any CPUs, report the quiescent state. 264 * we aren't waiting on any CPUs, report the quiescent state.
216 * Note that both cpu_quiet_msk_finish() and cpu_quiet_msk() 265 * Note that rcu_report_unblock_qs_rnp() releases rnp->lock.
217 * drop rnp->lock and restore irq.
218 */ 266 */
219 if (!empty && rnp->qsmask == 0 && 267 if (empty)
220 !rcu_preempted_readers(rnp)) {
221 struct rcu_node *rnp_p;
222
223 if (rnp->parent == NULL) {
224 /* Only one rcu_node in the tree. */
225 cpu_quiet_msk_finish(&rcu_preempt_state, flags);
226 return;
227 }
228 /* Report up the rest of the hierarchy. */
229 mask = rnp->grpmask;
230 spin_unlock_irqrestore(&rnp->lock, flags); 268 spin_unlock_irqrestore(&rnp->lock, flags);
231 rnp_p = rnp->parent; 269 else
232 spin_lock_irqsave(&rnp_p->lock, flags); 270 rcu_report_unblock_qs_rnp(rnp, flags);
233 WARN_ON_ONCE(rnp->qsmask); 271
234 cpu_quiet_msk(mask, &rcu_preempt_state, rnp_p, flags); 272 /*
235 return; 273 * If this was the last task on the expedited lists,
236 } 274 * then we need to report up the rcu_node hierarchy.
237 spin_unlock(&rnp->lock); 275 */
276 if (!empty_exp && !rcu_preempted_readers_exp(rnp))
277 rcu_report_exp_rnp(&rcu_preempt_state, rnp);
278 } else {
279 local_irq_restore(flags);
238 } 280 }
239 local_irq_restore(flags);
240} 281}
241 282
242/* 283/*
@@ -303,6 +344,8 @@ static void rcu_preempt_check_blocked_tasks(struct rcu_node *rnp)
303 * rcu_node. The reason for not just moving them to the immediate 344 * rcu_node. The reason for not just moving them to the immediate
304 * parent is to remove the need for rcu_read_unlock_special() to 345 * parent is to remove the need for rcu_read_unlock_special() to
305 * make more than two attempts to acquire the target rcu_node's lock. 346 * make more than two attempts to acquire the target rcu_node's lock.
347 * Returns true if there were tasks blocking the current RCU grace
348 * period.
306 * 349 *
307 * Returns 1 if there was previously a task blocking the current grace 350 * Returns 1 if there was previously a task blocking the current grace
308 * period on the specified rcu_node structure. 351 * period on the specified rcu_node structure.
@@ -316,7 +359,7 @@ static int rcu_preempt_offline_tasks(struct rcu_state *rsp,
316 int i; 359 int i;
317 struct list_head *lp; 360 struct list_head *lp;
318 struct list_head *lp_root; 361 struct list_head *lp_root;
319 int retval = rcu_preempted_readers(rnp); 362 int retval = 0;
320 struct rcu_node *rnp_root = rcu_get_root(rsp); 363 struct rcu_node *rnp_root = rcu_get_root(rsp);
321 struct task_struct *tp; 364 struct task_struct *tp;
322 365
@@ -326,7 +369,9 @@ static int rcu_preempt_offline_tasks(struct rcu_state *rsp,
326 } 369 }
327 WARN_ON_ONCE(rnp != rdp->mynode && 370 WARN_ON_ONCE(rnp != rdp->mynode &&
328 (!list_empty(&rnp->blocked_tasks[0]) || 371 (!list_empty(&rnp->blocked_tasks[0]) ||
329 !list_empty(&rnp->blocked_tasks[1]))); 372 !list_empty(&rnp->blocked_tasks[1]) ||
373 !list_empty(&rnp->blocked_tasks[2]) ||
374 !list_empty(&rnp->blocked_tasks[3])));
330 375
331 /* 376 /*
332 * Move tasks up to root rcu_node. Rely on the fact that the 377 * Move tasks up to root rcu_node. Rely on the fact that the
@@ -334,7 +379,11 @@ static int rcu_preempt_offline_tasks(struct rcu_state *rsp,
334 * rcu_nodes in terms of gp_num value. This fact allows us to 379 * rcu_nodes in terms of gp_num value. This fact allows us to
335 * move the blocked_tasks[] array directly, element by element. 380 * move the blocked_tasks[] array directly, element by element.
336 */ 381 */
337 for (i = 0; i < 2; i++) { 382 if (rcu_preempted_readers(rnp))
383 retval |= RCU_OFL_TASKS_NORM_GP;
384 if (rcu_preempted_readers_exp(rnp))
385 retval |= RCU_OFL_TASKS_EXP_GP;
386 for (i = 0; i < 4; i++) {
338 lp = &rnp->blocked_tasks[i]; 387 lp = &rnp->blocked_tasks[i];
339 lp_root = &rnp_root->blocked_tasks[i]; 388 lp_root = &rnp_root->blocked_tasks[i];
340 while (!list_empty(lp)) { 389 while (!list_empty(lp)) {
@@ -346,7 +395,6 @@ static int rcu_preempt_offline_tasks(struct rcu_state *rsp,
346 spin_unlock(&rnp_root->lock); /* irqs remain disabled */ 395 spin_unlock(&rnp_root->lock); /* irqs remain disabled */
347 } 396 }
348 } 397 }
349
350 return retval; 398 return retval;
351} 399}
352 400
@@ -398,14 +446,183 @@ void call_rcu(struct rcu_head *head, void (*func)(struct rcu_head *rcu))
398} 446}
399EXPORT_SYMBOL_GPL(call_rcu); 447EXPORT_SYMBOL_GPL(call_rcu);
400 448
449/**
450 * synchronize_rcu - wait until a grace period has elapsed.
451 *
452 * Control will return to the caller some time after a full grace
453 * period has elapsed, in other words after all currently executing RCU
454 * read-side critical sections have completed. RCU read-side critical
455 * sections are delimited by rcu_read_lock() and rcu_read_unlock(),
456 * and may be nested.
457 */
458void synchronize_rcu(void)
459{
460 struct rcu_synchronize rcu;
461
462 if (!rcu_scheduler_active)
463 return;
464
465 init_completion(&rcu.completion);
466 /* Will wake me after RCU finished. */
467 call_rcu(&rcu.head, wakeme_after_rcu);
468 /* Wait for it. */
469 wait_for_completion(&rcu.completion);
470}
471EXPORT_SYMBOL_GPL(synchronize_rcu);
472
473static DECLARE_WAIT_QUEUE_HEAD(sync_rcu_preempt_exp_wq);
474static long sync_rcu_preempt_exp_count;
475static DEFINE_MUTEX(sync_rcu_preempt_exp_mutex);
476
401/* 477/*
402 * Wait for an rcu-preempt grace period. We are supposed to expedite the 478 * Return non-zero if there are any tasks in RCU read-side critical
403 * grace period, but this is the crude slow compatability hack, so just 479 * sections blocking the current preemptible-RCU expedited grace period.
404 * invoke synchronize_rcu(). 480 * If there is no preemptible-RCU expedited grace period currently in
481 * progress, returns zero unconditionally.
482 */
483static int rcu_preempted_readers_exp(struct rcu_node *rnp)
484{
485 return !list_empty(&rnp->blocked_tasks[2]) ||
486 !list_empty(&rnp->blocked_tasks[3]);
487}
488
489/*
490 * return non-zero if there is no RCU expedited grace period in progress
491 * for the specified rcu_node structure, in other words, if all CPUs and
492 * tasks covered by the specified rcu_node structure have done their bit
493 * for the current expedited grace period. Works only for preemptible
494 * RCU -- other RCU implementation use other means.
495 *
496 * Caller must hold sync_rcu_preempt_exp_mutex.
497 */
498static int sync_rcu_preempt_exp_done(struct rcu_node *rnp)
499{
500 return !rcu_preempted_readers_exp(rnp) &&
501 ACCESS_ONCE(rnp->expmask) == 0;
502}
503
504/*
505 * Report the exit from RCU read-side critical section for the last task
506 * that queued itself during or before the current expedited preemptible-RCU
507 * grace period. This event is reported either to the rcu_node structure on
508 * which the task was queued or to one of that rcu_node structure's ancestors,
509 * recursively up the tree. (Calm down, calm down, we do the recursion
510 * iteratively!)
511 *
512 * Caller must hold sync_rcu_preempt_exp_mutex.
513 */
514static void rcu_report_exp_rnp(struct rcu_state *rsp, struct rcu_node *rnp)
515{
516 unsigned long flags;
517 unsigned long mask;
518
519 spin_lock_irqsave(&rnp->lock, flags);
520 for (;;) {
521 if (!sync_rcu_preempt_exp_done(rnp))
522 break;
523 if (rnp->parent == NULL) {
524 wake_up(&sync_rcu_preempt_exp_wq);
525 break;
526 }
527 mask = rnp->grpmask;
528 spin_unlock(&rnp->lock); /* irqs remain disabled */
529 rnp = rnp->parent;
530 spin_lock(&rnp->lock); /* irqs already disabled */
531 rnp->expmask &= ~mask;
532 }
533 spin_unlock_irqrestore(&rnp->lock, flags);
534}
535
536/*
537 * Snapshot the tasks blocking the newly started preemptible-RCU expedited
538 * grace period for the specified rcu_node structure. If there are no such
539 * tasks, report it up the rcu_node hierarchy.
540 *
541 * Caller must hold sync_rcu_preempt_exp_mutex and rsp->onofflock.
542 */
543static void
544sync_rcu_preempt_exp_init(struct rcu_state *rsp, struct rcu_node *rnp)
545{
546 int must_wait;
547
548 spin_lock(&rnp->lock); /* irqs already disabled */
549 list_splice_init(&rnp->blocked_tasks[0], &rnp->blocked_tasks[2]);
550 list_splice_init(&rnp->blocked_tasks[1], &rnp->blocked_tasks[3]);
551 must_wait = rcu_preempted_readers_exp(rnp);
552 spin_unlock(&rnp->lock); /* irqs remain disabled */
553 if (!must_wait)
554 rcu_report_exp_rnp(rsp, rnp);
555}
556
557/*
558 * Wait for an rcu-preempt grace period, but expedite it. The basic idea
559 * is to invoke synchronize_sched_expedited() to push all the tasks to
560 * the ->blocked_tasks[] lists, move all entries from the first set of
561 * ->blocked_tasks[] lists to the second set, and finally wait for this
562 * second set to drain.
405 */ 563 */
406void synchronize_rcu_expedited(void) 564void synchronize_rcu_expedited(void)
407{ 565{
408 synchronize_rcu(); 566 unsigned long flags;
567 struct rcu_node *rnp;
568 struct rcu_state *rsp = &rcu_preempt_state;
569 long snap;
570 int trycount = 0;
571
572 smp_mb(); /* Caller's modifications seen first by other CPUs. */
573 snap = ACCESS_ONCE(sync_rcu_preempt_exp_count) + 1;
574 smp_mb(); /* Above access cannot bleed into critical section. */
575
576 /*
577 * Acquire lock, falling back to synchronize_rcu() if too many
578 * lock-acquisition failures. Of course, if someone does the
579 * expedited grace period for us, just leave.
580 */
581 while (!mutex_trylock(&sync_rcu_preempt_exp_mutex)) {
582 if (trycount++ < 10)
583 udelay(trycount * num_online_cpus());
584 else {
585 synchronize_rcu();
586 return;
587 }
588 if ((ACCESS_ONCE(sync_rcu_preempt_exp_count) - snap) > 0)
589 goto mb_ret; /* Others did our work for us. */
590 }
591 if ((ACCESS_ONCE(sync_rcu_preempt_exp_count) - snap) > 0)
592 goto unlock_mb_ret; /* Others did our work for us. */
593
594 /* force all RCU readers onto blocked_tasks[]. */
595 synchronize_sched_expedited();
596
597 spin_lock_irqsave(&rsp->onofflock, flags);
598
599 /* Initialize ->expmask for all non-leaf rcu_node structures. */
600 rcu_for_each_nonleaf_node_breadth_first(rsp, rnp) {
601 spin_lock(&rnp->lock); /* irqs already disabled. */
602 rnp->expmask = rnp->qsmaskinit;
603 spin_unlock(&rnp->lock); /* irqs remain disabled. */
604 }
605
606 /* Snapshot current state of ->blocked_tasks[] lists. */
607 rcu_for_each_leaf_node(rsp, rnp)
608 sync_rcu_preempt_exp_init(rsp, rnp);
609 if (NUM_RCU_NODES > 1)
610 sync_rcu_preempt_exp_init(rsp, rcu_get_root(rsp));
611
612 spin_unlock_irqrestore(&rsp->onofflock, flags);
613
614 /* Wait for snapshotted ->blocked_tasks[] lists to drain. */
615 rnp = rcu_get_root(rsp);
616 wait_event(sync_rcu_preempt_exp_wq,
617 sync_rcu_preempt_exp_done(rnp));
618
619 /* Clean up and exit. */
620 smp_mb(); /* ensure expedited GP seen before counter increment. */
621 ACCESS_ONCE(sync_rcu_preempt_exp_count)++;
622unlock_mb_ret:
623 mutex_unlock(&sync_rcu_preempt_exp_mutex);
624mb_ret:
625 smp_mb(); /* ensure subsequent action seen after grace period. */
409} 626}
410EXPORT_SYMBOL_GPL(synchronize_rcu_expedited); 627EXPORT_SYMBOL_GPL(synchronize_rcu_expedited);
411 628
@@ -481,7 +698,7 @@ void exit_rcu(void)
481/* 698/*
482 * Tell them what RCU they are running. 699 * Tell them what RCU they are running.
483 */ 700 */
484static inline void rcu_bootup_announce(void) 701static void __init rcu_bootup_announce(void)
485{ 702{
486 printk(KERN_INFO "Hierarchical RCU implementation.\n"); 703 printk(KERN_INFO "Hierarchical RCU implementation.\n");
487} 704}
@@ -512,6 +729,16 @@ static int rcu_preempted_readers(struct rcu_node *rnp)
512 return 0; 729 return 0;
513} 730}
514 731
732#ifdef CONFIG_HOTPLUG_CPU
733
734/* Because preemptible RCU does not exist, no quieting of tasks. */
735static void rcu_report_unblock_qs_rnp(struct rcu_node *rnp, unsigned long flags)
736{
737 spin_unlock_irqrestore(&rnp->lock, flags);
738}
739
740#endif /* #ifdef CONFIG_HOTPLUG_CPU */
741
515#ifdef CONFIG_RCU_CPU_STALL_DETECTOR 742#ifdef CONFIG_RCU_CPU_STALL_DETECTOR
516 743
517/* 744/*
@@ -594,6 +821,20 @@ void synchronize_rcu_expedited(void)
594} 821}
595EXPORT_SYMBOL_GPL(synchronize_rcu_expedited); 822EXPORT_SYMBOL_GPL(synchronize_rcu_expedited);
596 823
824#ifdef CONFIG_HOTPLUG_CPU
825
826/*
827 * Because preemptable RCU does not exist, there is never any need to
828 * report on tasks preempted in RCU read-side critical sections during
829 * expedited RCU grace periods.
830 */
831static void rcu_report_exp_rnp(struct rcu_state *rsp, struct rcu_node *rnp)
832{
833 return;
834}
835
836#endif /* #ifdef CONFIG_HOTPLUG_CPU */
837
597/* 838/*
598 * Because preemptable RCU does not exist, it never has any work to do. 839 * Because preemptable RCU does not exist, it never has any work to do.
599 */ 840 */
diff --git a/kernel/rcutree_trace.c b/kernel/rcutree_trace.c
index 4b31c779e62e..9d2c88423b31 100644
--- a/kernel/rcutree_trace.c
+++ b/kernel/rcutree_trace.c
@@ -155,12 +155,15 @@ static const struct file_operations rcudata_csv_fops = {
155 155
156static void print_one_rcu_state(struct seq_file *m, struct rcu_state *rsp) 156static void print_one_rcu_state(struct seq_file *m, struct rcu_state *rsp)
157{ 157{
158 long gpnum;
158 int level = 0; 159 int level = 0;
160 int phase;
159 struct rcu_node *rnp; 161 struct rcu_node *rnp;
160 162
163 gpnum = rsp->gpnum;
161 seq_printf(m, "c=%ld g=%ld s=%d jfq=%ld j=%x " 164 seq_printf(m, "c=%ld g=%ld s=%d jfq=%ld j=%x "
162 "nfqs=%lu/nfqsng=%lu(%lu) fqlh=%lu oqlen=%ld\n", 165 "nfqs=%lu/nfqsng=%lu(%lu) fqlh=%lu oqlen=%ld\n",
163 rsp->completed, rsp->gpnum, rsp->signaled, 166 rsp->completed, gpnum, rsp->signaled,
164 (long)(rsp->jiffies_force_qs - jiffies), 167 (long)(rsp->jiffies_force_qs - jiffies),
165 (int)(jiffies & 0xffff), 168 (int)(jiffies & 0xffff),
166 rsp->n_force_qs, rsp->n_force_qs_ngp, 169 rsp->n_force_qs, rsp->n_force_qs_ngp,
@@ -171,8 +174,13 @@ static void print_one_rcu_state(struct seq_file *m, struct rcu_state *rsp)
171 seq_puts(m, "\n"); 174 seq_puts(m, "\n");
172 level = rnp->level; 175 level = rnp->level;
173 } 176 }
174 seq_printf(m, "%lx/%lx %d:%d ^%d ", 177 phase = gpnum & 0x1;
178 seq_printf(m, "%lx/%lx %c%c>%c%c %d:%d ^%d ",
175 rnp->qsmask, rnp->qsmaskinit, 179 rnp->qsmask, rnp->qsmaskinit,
180 "T."[list_empty(&rnp->blocked_tasks[phase])],
181 "E."[list_empty(&rnp->blocked_tasks[phase + 2])],
182 "T."[list_empty(&rnp->blocked_tasks[!phase])],
183 "E."[list_empty(&rnp->blocked_tasks[!phase + 2])],
176 rnp->grplo, rnp->grphi, rnp->grpnum); 184 rnp->grplo, rnp->grphi, rnp->grpnum);
177 } 185 }
178 seq_puts(m, "\n"); 186 seq_puts(m, "\n");
diff --git a/kernel/sched.c b/kernel/sched.c
index a455dca884a6..aa31244caa9f 100644
--- a/kernel/sched.c
+++ b/kernel/sched.c
@@ -309,6 +309,8 @@ static DEFINE_PER_CPU_SHARED_ALIGNED(struct rt_rq, init_rt_rq);
309 */ 309 */
310static DEFINE_SPINLOCK(task_group_lock); 310static DEFINE_SPINLOCK(task_group_lock);
311 311
312#ifdef CONFIG_FAIR_GROUP_SCHED
313
312#ifdef CONFIG_SMP 314#ifdef CONFIG_SMP
313static int root_task_group_empty(void) 315static int root_task_group_empty(void)
314{ 316{
@@ -316,7 +318,6 @@ static int root_task_group_empty(void)
316} 318}
317#endif 319#endif
318 320
319#ifdef CONFIG_FAIR_GROUP_SCHED
320#ifdef CONFIG_USER_SCHED 321#ifdef CONFIG_USER_SCHED
321# define INIT_TASK_GROUP_LOAD (2*NICE_0_LOAD) 322# define INIT_TASK_GROUP_LOAD (2*NICE_0_LOAD)
322#else /* !CONFIG_USER_SCHED */ 323#else /* !CONFIG_USER_SCHED */
@@ -534,14 +535,12 @@ struct rq {
534 #define CPU_LOAD_IDX_MAX 5 535 #define CPU_LOAD_IDX_MAX 5
535 unsigned long cpu_load[CPU_LOAD_IDX_MAX]; 536 unsigned long cpu_load[CPU_LOAD_IDX_MAX];
536#ifdef CONFIG_NO_HZ 537#ifdef CONFIG_NO_HZ
537 unsigned long last_tick_seen;
538 unsigned char in_nohz_recently; 538 unsigned char in_nohz_recently;
539#endif 539#endif
540 /* capture load from *all* tasks on this cpu: */ 540 /* capture load from *all* tasks on this cpu: */
541 struct load_weight load; 541 struct load_weight load;
542 unsigned long nr_load_updates; 542 unsigned long nr_load_updates;
543 u64 nr_switches; 543 u64 nr_switches;
544 u64 nr_migrations_in;
545 544
546 struct cfs_rq cfs; 545 struct cfs_rq cfs;
547 struct rt_rq rt; 546 struct rt_rq rt;
@@ -590,6 +589,8 @@ struct rq {
590 589
591 u64 rt_avg; 590 u64 rt_avg;
592 u64 age_stamp; 591 u64 age_stamp;
592 u64 idle_stamp;
593 u64 avg_idle;
593#endif 594#endif
594 595
595 /* calc_load related fields */ 596 /* calc_load related fields */
@@ -771,7 +772,7 @@ sched_feat_write(struct file *filp, const char __user *ubuf,
771 if (!sched_feat_names[i]) 772 if (!sched_feat_names[i])
772 return -EINVAL; 773 return -EINVAL;
773 774
774 filp->f_pos += cnt; 775 *ppos += cnt;
775 776
776 return cnt; 777 return cnt;
777} 778}
@@ -1992,6 +1993,39 @@ static inline void check_class_changed(struct rq *rq, struct task_struct *p,
1992 p->sched_class->prio_changed(rq, p, oldprio, running); 1993 p->sched_class->prio_changed(rq, p, oldprio, running);
1993} 1994}
1994 1995
1996/**
1997 * kthread_bind - bind a just-created kthread to a cpu.
1998 * @p: thread created by kthread_create().
1999 * @cpu: cpu (might not be online, must be possible) for @k to run on.
2000 *
2001 * Description: This function is equivalent to set_cpus_allowed(),
2002 * except that @cpu doesn't need to be online, and the thread must be
2003 * stopped (i.e., just returned from kthread_create()).
2004 *
2005 * Function lives here instead of kthread.c because it messes with
2006 * scheduler internals which require locking.
2007 */
2008void kthread_bind(struct task_struct *p, unsigned int cpu)
2009{
2010 struct rq *rq = cpu_rq(cpu);
2011 unsigned long flags;
2012
2013 /* Must have done schedule() in kthread() before we set_task_cpu */
2014 if (!wait_task_inactive(p, TASK_UNINTERRUPTIBLE)) {
2015 WARN_ON(1);
2016 return;
2017 }
2018
2019 spin_lock_irqsave(&rq->lock, flags);
2020 update_rq_clock(rq);
2021 set_task_cpu(p, cpu);
2022 p->cpus_allowed = cpumask_of_cpu(cpu);
2023 p->rt.nr_cpus_allowed = 1;
2024 p->flags |= PF_THREAD_BOUND;
2025 spin_unlock_irqrestore(&rq->lock, flags);
2026}
2027EXPORT_SYMBOL(kthread_bind);
2028
1995#ifdef CONFIG_SMP 2029#ifdef CONFIG_SMP
1996/* 2030/*
1997 * Is this task likely cache-hot: 2031 * Is this task likely cache-hot:
@@ -2004,7 +2038,7 @@ task_hot(struct task_struct *p, u64 now, struct sched_domain *sd)
2004 /* 2038 /*
2005 * Buddy candidates are cache hot: 2039 * Buddy candidates are cache hot:
2006 */ 2040 */
2007 if (sched_feat(CACHE_HOT_BUDDY) && 2041 if (sched_feat(CACHE_HOT_BUDDY) && this_rq()->nr_running &&
2008 (&p->se == cfs_rq_of(&p->se)->next || 2042 (&p->se == cfs_rq_of(&p->se)->next ||
2009 &p->se == cfs_rq_of(&p->se)->last)) 2043 &p->se == cfs_rq_of(&p->se)->last))
2010 return 1; 2044 return 1;
@@ -2045,7 +2079,6 @@ void set_task_cpu(struct task_struct *p, unsigned int new_cpu)
2045#endif 2079#endif
2046 if (old_cpu != new_cpu) { 2080 if (old_cpu != new_cpu) {
2047 p->se.nr_migrations++; 2081 p->se.nr_migrations++;
2048 new_rq->nr_migrations_in++;
2049#ifdef CONFIG_SCHEDSTATS 2082#ifdef CONFIG_SCHEDSTATS
2050 if (task_hot(p, old_rq->clock, NULL)) 2083 if (task_hot(p, old_rq->clock, NULL))
2051 schedstat_inc(p, se.nr_forced2_migrations); 2084 schedstat_inc(p, se.nr_forced2_migrations);
@@ -2082,6 +2115,7 @@ migrate_task(struct task_struct *p, int dest_cpu, struct migration_req *req)
2082 * it is sufficient to simply update the task's cpu field. 2115 * it is sufficient to simply update the task's cpu field.
2083 */ 2116 */
2084 if (!p->se.on_rq && !task_running(rq, p)) { 2117 if (!p->se.on_rq && !task_running(rq, p)) {
2118 update_rq_clock(rq);
2085 set_task_cpu(p, dest_cpu); 2119 set_task_cpu(p, dest_cpu);
2086 return 0; 2120 return 0;
2087 } 2121 }
@@ -2343,14 +2377,15 @@ static int try_to_wake_up(struct task_struct *p, unsigned int state,
2343 task_rq_unlock(rq, &flags); 2377 task_rq_unlock(rq, &flags);
2344 2378
2345 cpu = p->sched_class->select_task_rq(p, SD_BALANCE_WAKE, wake_flags); 2379 cpu = p->sched_class->select_task_rq(p, SD_BALANCE_WAKE, wake_flags);
2346 if (cpu != orig_cpu) 2380 if (cpu != orig_cpu) {
2381 local_irq_save(flags);
2382 rq = cpu_rq(cpu);
2383 update_rq_clock(rq);
2347 set_task_cpu(p, cpu); 2384 set_task_cpu(p, cpu);
2348 2385 local_irq_restore(flags);
2386 }
2349 rq = task_rq_lock(p, &flags); 2387 rq = task_rq_lock(p, &flags);
2350 2388
2351 if (rq != orig_rq)
2352 update_rq_clock(rq);
2353
2354 WARN_ON(p->state != TASK_WAKING); 2389 WARN_ON(p->state != TASK_WAKING);
2355 cpu = task_cpu(p); 2390 cpu = task_cpu(p);
2356 2391
@@ -2407,6 +2442,17 @@ out_running:
2407#ifdef CONFIG_SMP 2442#ifdef CONFIG_SMP
2408 if (p->sched_class->task_wake_up) 2443 if (p->sched_class->task_wake_up)
2409 p->sched_class->task_wake_up(rq, p); 2444 p->sched_class->task_wake_up(rq, p);
2445
2446 if (unlikely(rq->idle_stamp)) {
2447 u64 delta = rq->clock - rq->idle_stamp;
2448 u64 max = 2*sysctl_sched_migration_cost;
2449
2450 if (delta > max)
2451 rq->avg_idle = max;
2452 else
2453 update_avg(&rq->avg_idle, delta);
2454 rq->idle_stamp = 0;
2455 }
2410#endif 2456#endif
2411out: 2457out:
2412 task_rq_unlock(rq, &flags); 2458 task_rq_unlock(rq, &flags);
@@ -2512,6 +2558,7 @@ static void __sched_fork(struct task_struct *p)
2512void sched_fork(struct task_struct *p, int clone_flags) 2558void sched_fork(struct task_struct *p, int clone_flags)
2513{ 2559{
2514 int cpu = get_cpu(); 2560 int cpu = get_cpu();
2561 unsigned long flags;
2515 2562
2516 __sched_fork(p); 2563 __sched_fork(p);
2517 2564
@@ -2548,7 +2595,10 @@ void sched_fork(struct task_struct *p, int clone_flags)
2548#ifdef CONFIG_SMP 2595#ifdef CONFIG_SMP
2549 cpu = p->sched_class->select_task_rq(p, SD_BALANCE_FORK, 0); 2596 cpu = p->sched_class->select_task_rq(p, SD_BALANCE_FORK, 0);
2550#endif 2597#endif
2598 local_irq_save(flags);
2599 update_rq_clock(cpu_rq(cpu));
2551 set_task_cpu(p, cpu); 2600 set_task_cpu(p, cpu);
2601 local_irq_restore(flags);
2552 2602
2553#if defined(CONFIG_SCHEDSTATS) || defined(CONFIG_TASK_DELAY_ACCT) 2603#if defined(CONFIG_SCHEDSTATS) || defined(CONFIG_TASK_DELAY_ACCT)
2554 if (likely(sched_info_on())) 2604 if (likely(sched_info_on()))
@@ -2815,14 +2865,14 @@ context_switch(struct rq *rq, struct task_struct *prev,
2815 */ 2865 */
2816 arch_start_context_switch(prev); 2866 arch_start_context_switch(prev);
2817 2867
2818 if (unlikely(!mm)) { 2868 if (likely(!mm)) {
2819 next->active_mm = oldmm; 2869 next->active_mm = oldmm;
2820 atomic_inc(&oldmm->mm_count); 2870 atomic_inc(&oldmm->mm_count);
2821 enter_lazy_tlb(oldmm, next); 2871 enter_lazy_tlb(oldmm, next);
2822 } else 2872 } else
2823 switch_mm(oldmm, mm, next); 2873 switch_mm(oldmm, mm, next);
2824 2874
2825 if (unlikely(!prev->mm)) { 2875 if (likely(!prev->mm)) {
2826 prev->active_mm = NULL; 2876 prev->active_mm = NULL;
2827 rq->prev_mm = oldmm; 2877 rq->prev_mm = oldmm;
2828 } 2878 }
@@ -2985,15 +3035,6 @@ static void calc_load_account_active(struct rq *this_rq)
2985} 3035}
2986 3036
2987/* 3037/*
2988 * Externally visible per-cpu scheduler statistics:
2989 * cpu_nr_migrations(cpu) - number of migrations into that cpu
2990 */
2991u64 cpu_nr_migrations(int cpu)
2992{
2993 return cpu_rq(cpu)->nr_migrations_in;
2994}
2995
2996/*
2997 * Update rq->cpu_load[] statistics. This function is usually called every 3038 * Update rq->cpu_load[] statistics. This function is usually called every
2998 * scheduler tick (TICK_NSEC). 3039 * scheduler tick (TICK_NSEC).
2999 */ 3040 */
@@ -4093,7 +4134,7 @@ static int load_balance(int this_cpu, struct rq *this_rq,
4093 unsigned long flags; 4134 unsigned long flags;
4094 struct cpumask *cpus = __get_cpu_var(load_balance_tmpmask); 4135 struct cpumask *cpus = __get_cpu_var(load_balance_tmpmask);
4095 4136
4096 cpumask_setall(cpus); 4137 cpumask_copy(cpus, cpu_online_mask);
4097 4138
4098 /* 4139 /*
4099 * When power savings policy is enabled for the parent domain, idle 4140 * When power savings policy is enabled for the parent domain, idle
@@ -4256,7 +4297,7 @@ load_balance_newidle(int this_cpu, struct rq *this_rq, struct sched_domain *sd)
4256 int all_pinned = 0; 4297 int all_pinned = 0;
4257 struct cpumask *cpus = __get_cpu_var(load_balance_tmpmask); 4298 struct cpumask *cpus = __get_cpu_var(load_balance_tmpmask);
4258 4299
4259 cpumask_setall(cpus); 4300 cpumask_copy(cpus, cpu_online_mask);
4260 4301
4261 /* 4302 /*
4262 * When power savings policy is enabled for the parent domain, idle 4303 * When power savings policy is enabled for the parent domain, idle
@@ -4396,6 +4437,11 @@ static void idle_balance(int this_cpu, struct rq *this_rq)
4396 int pulled_task = 0; 4437 int pulled_task = 0;
4397 unsigned long next_balance = jiffies + HZ; 4438 unsigned long next_balance = jiffies + HZ;
4398 4439
4440 this_rq->idle_stamp = this_rq->clock;
4441
4442 if (this_rq->avg_idle < sysctl_sched_migration_cost)
4443 return;
4444
4399 for_each_domain(this_cpu, sd) { 4445 for_each_domain(this_cpu, sd) {
4400 unsigned long interval; 4446 unsigned long interval;
4401 4447
@@ -4410,8 +4456,10 @@ static void idle_balance(int this_cpu, struct rq *this_rq)
4410 interval = msecs_to_jiffies(sd->balance_interval); 4456 interval = msecs_to_jiffies(sd->balance_interval);
4411 if (time_after(next_balance, sd->last_balance + interval)) 4457 if (time_after(next_balance, sd->last_balance + interval))
4412 next_balance = sd->last_balance + interval; 4458 next_balance = sd->last_balance + interval;
4413 if (pulled_task) 4459 if (pulled_task) {
4460 this_rq->idle_stamp = 0;
4414 break; 4461 break;
4462 }
4415 } 4463 }
4416 if (pulled_task || time_after(jiffies, this_rq->next_balance)) { 4464 if (pulled_task || time_after(jiffies, this_rq->next_balance)) {
4417 /* 4465 /*
@@ -5013,8 +5061,13 @@ static void account_guest_time(struct task_struct *p, cputime_t cputime,
5013 p->gtime = cputime_add(p->gtime, cputime); 5061 p->gtime = cputime_add(p->gtime, cputime);
5014 5062
5015 /* Add guest time to cpustat. */ 5063 /* Add guest time to cpustat. */
5016 cpustat->user = cputime64_add(cpustat->user, tmp); 5064 if (TASK_NICE(p) > 0) {
5017 cpustat->guest = cputime64_add(cpustat->guest, tmp); 5065 cpustat->nice = cputime64_add(cpustat->nice, tmp);
5066 cpustat->guest_nice = cputime64_add(cpustat->guest_nice, tmp);
5067 } else {
5068 cpustat->user = cputime64_add(cpustat->user, tmp);
5069 cpustat->guest = cputime64_add(cpustat->guest, tmp);
5070 }
5018} 5071}
5019 5072
5020/* 5073/*
@@ -5129,60 +5182,86 @@ void account_idle_ticks(unsigned long ticks)
5129 * Use precise platform statistics if available: 5182 * Use precise platform statistics if available:
5130 */ 5183 */
5131#ifdef CONFIG_VIRT_CPU_ACCOUNTING 5184#ifdef CONFIG_VIRT_CPU_ACCOUNTING
5132cputime_t task_utime(struct task_struct *p) 5185void task_times(struct task_struct *p, cputime_t *ut, cputime_t *st)
5133{ 5186{
5134 return p->utime; 5187 *ut = p->utime;
5188 *st = p->stime;
5135} 5189}
5136 5190
5137cputime_t task_stime(struct task_struct *p) 5191void thread_group_times(struct task_struct *p, cputime_t *ut, cputime_t *st)
5138{ 5192{
5139 return p->stime; 5193 struct task_cputime cputime;
5194
5195 thread_group_cputime(p, &cputime);
5196
5197 *ut = cputime.utime;
5198 *st = cputime.stime;
5140} 5199}
5141#else 5200#else
5142cputime_t task_utime(struct task_struct *p) 5201
5202#ifndef nsecs_to_cputime
5203# define nsecs_to_cputime(__nsecs) nsecs_to_jiffies(__nsecs)
5204#endif
5205
5206void task_times(struct task_struct *p, cputime_t *ut, cputime_t *st)
5143{ 5207{
5144 clock_t utime = cputime_to_clock_t(p->utime), 5208 cputime_t rtime, utime = p->utime, total = cputime_add(utime, p->stime);
5145 total = utime + cputime_to_clock_t(p->stime);
5146 u64 temp;
5147 5209
5148 /* 5210 /*
5149 * Use CFS's precise accounting: 5211 * Use CFS's precise accounting:
5150 */ 5212 */
5151 temp = (u64)nsec_to_clock_t(p->se.sum_exec_runtime); 5213 rtime = nsecs_to_cputime(p->se.sum_exec_runtime);
5152 5214
5153 if (total) { 5215 if (total) {
5154 temp *= utime; 5216 u64 temp;
5217
5218 temp = (u64)(rtime * utime);
5155 do_div(temp, total); 5219 do_div(temp, total);
5156 } 5220 utime = (cputime_t)temp;
5157 utime = (clock_t)temp; 5221 } else
5222 utime = rtime;
5223
5224 /*
5225 * Compare with previous values, to keep monotonicity:
5226 */
5227 p->prev_utime = max(p->prev_utime, utime);
5228 p->prev_stime = max(p->prev_stime, cputime_sub(rtime, p->prev_utime));
5158 5229
5159 p->prev_utime = max(p->prev_utime, clock_t_to_cputime(utime)); 5230 *ut = p->prev_utime;
5160 return p->prev_utime; 5231 *st = p->prev_stime;
5161} 5232}
5162 5233
5163cputime_t task_stime(struct task_struct *p) 5234/*
5235 * Must be called with siglock held.
5236 */
5237void thread_group_times(struct task_struct *p, cputime_t *ut, cputime_t *st)
5164{ 5238{
5165 clock_t stime; 5239 struct signal_struct *sig = p->signal;
5240 struct task_cputime cputime;
5241 cputime_t rtime, utime, total;
5166 5242
5167 /* 5243 thread_group_cputime(p, &cputime);
5168 * Use CFS's precise accounting. (we subtract utime from
5169 * the total, to make sure the total observed by userspace
5170 * grows monotonically - apps rely on that):
5171 */
5172 stime = nsec_to_clock_t(p->se.sum_exec_runtime) -
5173 cputime_to_clock_t(task_utime(p));
5174 5244
5175 if (stime >= 0) 5245 total = cputime_add(cputime.utime, cputime.stime);
5176 p->prev_stime = max(p->prev_stime, clock_t_to_cputime(stime)); 5246 rtime = nsecs_to_cputime(cputime.sum_exec_runtime);
5177 5247
5178 return p->prev_stime; 5248 if (total) {
5179} 5249 u64 temp;
5180#endif
5181 5250
5182inline cputime_t task_gtime(struct task_struct *p) 5251 temp = (u64)(rtime * cputime.utime);
5183{ 5252 do_div(temp, total);
5184 return p->gtime; 5253 utime = (cputime_t)temp;
5254 } else
5255 utime = rtime;
5256
5257 sig->prev_utime = max(sig->prev_utime, utime);
5258 sig->prev_stime = max(sig->prev_stime,
5259 cputime_sub(rtime, sig->prev_utime));
5260
5261 *ut = sig->prev_utime;
5262 *st = sig->prev_stime;
5185} 5263}
5264#endif
5186 5265
5187/* 5266/*
5188 * This function gets called by the timer code, with HZ frequency. 5267 * This function gets called by the timer code, with HZ frequency.
@@ -5448,7 +5527,7 @@ need_resched_nonpreemptible:
5448} 5527}
5449EXPORT_SYMBOL(schedule); 5528EXPORT_SYMBOL(schedule);
5450 5529
5451#ifdef CONFIG_SMP 5530#ifdef CONFIG_MUTEX_SPIN_ON_OWNER
5452/* 5531/*
5453 * Look out! "owner" is an entirely speculative pointer 5532 * Look out! "owner" is an entirely speculative pointer
5454 * access and not reliable. 5533 * access and not reliable.
@@ -6142,22 +6221,14 @@ __setscheduler(struct rq *rq, struct task_struct *p, int policy, int prio)
6142 BUG_ON(p->se.on_rq); 6221 BUG_ON(p->se.on_rq);
6143 6222
6144 p->policy = policy; 6223 p->policy = policy;
6145 switch (p->policy) {
6146 case SCHED_NORMAL:
6147 case SCHED_BATCH:
6148 case SCHED_IDLE:
6149 p->sched_class = &fair_sched_class;
6150 break;
6151 case SCHED_FIFO:
6152 case SCHED_RR:
6153 p->sched_class = &rt_sched_class;
6154 break;
6155 }
6156
6157 p->rt_priority = prio; 6224 p->rt_priority = prio;
6158 p->normal_prio = normal_prio(p); 6225 p->normal_prio = normal_prio(p);
6159 /* we are holding p->pi_lock already */ 6226 /* we are holding p->pi_lock already */
6160 p->prio = rt_mutex_getprio(p); 6227 p->prio = rt_mutex_getprio(p);
6228 if (rt_prio(p->prio))
6229 p->sched_class = &rt_sched_class;
6230 else
6231 p->sched_class = &fair_sched_class;
6161 set_load_weight(p); 6232 set_load_weight(p);
6162} 6233}
6163 6234
@@ -6902,7 +6973,7 @@ void show_state_filter(unsigned long state_filter)
6902 /* 6973 /*
6903 * Only show locks if all tasks are dumped: 6974 * Only show locks if all tasks are dumped:
6904 */ 6975 */
6905 if (state_filter == -1) 6976 if (!state_filter)
6906 debug_show_all_locks(); 6977 debug_show_all_locks();
6907} 6978}
6908 6979
@@ -7707,6 +7778,16 @@ early_initcall(migration_init);
7707 7778
7708#ifdef CONFIG_SCHED_DEBUG 7779#ifdef CONFIG_SCHED_DEBUG
7709 7780
7781static __read_mostly int sched_domain_debug_enabled;
7782
7783static int __init sched_domain_debug_setup(char *str)
7784{
7785 sched_domain_debug_enabled = 1;
7786
7787 return 0;
7788}
7789early_param("sched_debug", sched_domain_debug_setup);
7790
7710static int sched_domain_debug_one(struct sched_domain *sd, int cpu, int level, 7791static int sched_domain_debug_one(struct sched_domain *sd, int cpu, int level,
7711 struct cpumask *groupmask) 7792 struct cpumask *groupmask)
7712{ 7793{
@@ -7793,6 +7874,9 @@ static void sched_domain_debug(struct sched_domain *sd, int cpu)
7793 cpumask_var_t groupmask; 7874 cpumask_var_t groupmask;
7794 int level = 0; 7875 int level = 0;
7795 7876
7877 if (!sched_domain_debug_enabled)
7878 return;
7879
7796 if (!sd) { 7880 if (!sd) {
7797 printk(KERN_DEBUG "CPU%d attaching NULL sched-domain.\n", cpu); 7881 printk(KERN_DEBUG "CPU%d attaching NULL sched-domain.\n", cpu);
7798 return; 7882 return;
@@ -7872,6 +7956,8 @@ sd_parent_degenerate(struct sched_domain *sd, struct sched_domain *parent)
7872 7956
7873static void free_rootdomain(struct root_domain *rd) 7957static void free_rootdomain(struct root_domain *rd)
7874{ 7958{
7959 synchronize_sched();
7960
7875 cpupri_cleanup(&rd->cpupri); 7961 cpupri_cleanup(&rd->cpupri);
7876 7962
7877 free_cpumask_var(rd->rto_mask); 7963 free_cpumask_var(rd->rto_mask);
@@ -8012,6 +8098,7 @@ static cpumask_var_t cpu_isolated_map;
8012/* Setup the mask of cpus configured for isolated domains */ 8098/* Setup the mask of cpus configured for isolated domains */
8013static int __init isolated_cpu_setup(char *str) 8099static int __init isolated_cpu_setup(char *str)
8014{ 8100{
8101 alloc_bootmem_cpumask_var(&cpu_isolated_map);
8015 cpulist_parse(str, cpu_isolated_map); 8102 cpulist_parse(str, cpu_isolated_map);
8016 return 1; 8103 return 1;
8017} 8104}
@@ -8848,7 +8935,7 @@ static int build_sched_domains(const struct cpumask *cpu_map)
8848 return __build_sched_domains(cpu_map, NULL); 8935 return __build_sched_domains(cpu_map, NULL);
8849} 8936}
8850 8937
8851static struct cpumask *doms_cur; /* current sched domains */ 8938static cpumask_var_t *doms_cur; /* current sched domains */
8852static int ndoms_cur; /* number of sched domains in 'doms_cur' */ 8939static int ndoms_cur; /* number of sched domains in 'doms_cur' */
8853static struct sched_domain_attr *dattr_cur; 8940static struct sched_domain_attr *dattr_cur;
8854 /* attribues of custom domains in 'doms_cur' */ 8941 /* attribues of custom domains in 'doms_cur' */
@@ -8870,6 +8957,31 @@ int __attribute__((weak)) arch_update_cpu_topology(void)
8870 return 0; 8957 return 0;
8871} 8958}
8872 8959
8960cpumask_var_t *alloc_sched_domains(unsigned int ndoms)
8961{
8962 int i;
8963 cpumask_var_t *doms;
8964
8965 doms = kmalloc(sizeof(*doms) * ndoms, GFP_KERNEL);
8966 if (!doms)
8967 return NULL;
8968 for (i = 0; i < ndoms; i++) {
8969 if (!alloc_cpumask_var(&doms[i], GFP_KERNEL)) {
8970 free_sched_domains(doms, i);
8971 return NULL;
8972 }
8973 }
8974 return doms;
8975}
8976
8977void free_sched_domains(cpumask_var_t doms[], unsigned int ndoms)
8978{
8979 unsigned int i;
8980 for (i = 0; i < ndoms; i++)
8981 free_cpumask_var(doms[i]);
8982 kfree(doms);
8983}
8984
8873/* 8985/*
8874 * Set up scheduler domains and groups. Callers must hold the hotplug lock. 8986 * Set up scheduler domains and groups. Callers must hold the hotplug lock.
8875 * For now this just excludes isolated cpus, but could be used to 8987 * For now this just excludes isolated cpus, but could be used to
@@ -8881,12 +8993,12 @@ static int arch_init_sched_domains(const struct cpumask *cpu_map)
8881 8993
8882 arch_update_cpu_topology(); 8994 arch_update_cpu_topology();
8883 ndoms_cur = 1; 8995 ndoms_cur = 1;
8884 doms_cur = kmalloc(cpumask_size(), GFP_KERNEL); 8996 doms_cur = alloc_sched_domains(ndoms_cur);
8885 if (!doms_cur) 8997 if (!doms_cur)
8886 doms_cur = fallback_doms; 8998 doms_cur = &fallback_doms;
8887 cpumask_andnot(doms_cur, cpu_map, cpu_isolated_map); 8999 cpumask_andnot(doms_cur[0], cpu_map, cpu_isolated_map);
8888 dattr_cur = NULL; 9000 dattr_cur = NULL;
8889 err = build_sched_domains(doms_cur); 9001 err = build_sched_domains(doms_cur[0]);
8890 register_sched_domain_sysctl(); 9002 register_sched_domain_sysctl();
8891 9003
8892 return err; 9004 return err;
@@ -8936,19 +9048,19 @@ static int dattrs_equal(struct sched_domain_attr *cur, int idx_cur,
8936 * doms_new[] to the current sched domain partitioning, doms_cur[]. 9048 * doms_new[] to the current sched domain partitioning, doms_cur[].
8937 * It destroys each deleted domain and builds each new domain. 9049 * It destroys each deleted domain and builds each new domain.
8938 * 9050 *
8939 * 'doms_new' is an array of cpumask's of length 'ndoms_new'. 9051 * 'doms_new' is an array of cpumask_var_t's of length 'ndoms_new'.
8940 * The masks don't intersect (don't overlap.) We should setup one 9052 * The masks don't intersect (don't overlap.) We should setup one
8941 * sched domain for each mask. CPUs not in any of the cpumasks will 9053 * sched domain for each mask. CPUs not in any of the cpumasks will
8942 * not be load balanced. If the same cpumask appears both in the 9054 * not be load balanced. If the same cpumask appears both in the
8943 * current 'doms_cur' domains and in the new 'doms_new', we can leave 9055 * current 'doms_cur' domains and in the new 'doms_new', we can leave
8944 * it as it is. 9056 * it as it is.
8945 * 9057 *
8946 * The passed in 'doms_new' should be kmalloc'd. This routine takes 9058 * The passed in 'doms_new' should be allocated using
8947 * ownership of it and will kfree it when done with it. If the caller 9059 * alloc_sched_domains. This routine takes ownership of it and will
8948 * failed the kmalloc call, then it can pass in doms_new == NULL && 9060 * free_sched_domains it when done with it. If the caller failed the
8949 * ndoms_new == 1, and partition_sched_domains() will fallback to 9061 * alloc call, then it can pass in doms_new == NULL && ndoms_new == 1,
8950 * the single partition 'fallback_doms', it also forces the domains 9062 * and partition_sched_domains() will fallback to the single partition
8951 * to be rebuilt. 9063 * 'fallback_doms', it also forces the domains to be rebuilt.
8952 * 9064 *
8953 * If doms_new == NULL it will be replaced with cpu_online_mask. 9065 * If doms_new == NULL it will be replaced with cpu_online_mask.
8954 * ndoms_new == 0 is a special case for destroying existing domains, 9066 * ndoms_new == 0 is a special case for destroying existing domains,
@@ -8956,8 +9068,7 @@ static int dattrs_equal(struct sched_domain_attr *cur, int idx_cur,
8956 * 9068 *
8957 * Call with hotplug lock held 9069 * Call with hotplug lock held
8958 */ 9070 */
8959/* FIXME: Change to struct cpumask *doms_new[] */ 9071void partition_sched_domains(int ndoms_new, cpumask_var_t doms_new[],
8960void partition_sched_domains(int ndoms_new, struct cpumask *doms_new,
8961 struct sched_domain_attr *dattr_new) 9072 struct sched_domain_attr *dattr_new)
8962{ 9073{
8963 int i, j, n; 9074 int i, j, n;
@@ -8976,40 +9087,40 @@ void partition_sched_domains(int ndoms_new, struct cpumask *doms_new,
8976 /* Destroy deleted domains */ 9087 /* Destroy deleted domains */
8977 for (i = 0; i < ndoms_cur; i++) { 9088 for (i = 0; i < ndoms_cur; i++) {
8978 for (j = 0; j < n && !new_topology; j++) { 9089 for (j = 0; j < n && !new_topology; j++) {
8979 if (cpumask_equal(&doms_cur[i], &doms_new[j]) 9090 if (cpumask_equal(doms_cur[i], doms_new[j])
8980 && dattrs_equal(dattr_cur, i, dattr_new, j)) 9091 && dattrs_equal(dattr_cur, i, dattr_new, j))
8981 goto match1; 9092 goto match1;
8982 } 9093 }
8983 /* no match - a current sched domain not in new doms_new[] */ 9094 /* no match - a current sched domain not in new doms_new[] */
8984 detach_destroy_domains(doms_cur + i); 9095 detach_destroy_domains(doms_cur[i]);
8985match1: 9096match1:
8986 ; 9097 ;
8987 } 9098 }
8988 9099
8989 if (doms_new == NULL) { 9100 if (doms_new == NULL) {
8990 ndoms_cur = 0; 9101 ndoms_cur = 0;
8991 doms_new = fallback_doms; 9102 doms_new = &fallback_doms;
8992 cpumask_andnot(&doms_new[0], cpu_online_mask, cpu_isolated_map); 9103 cpumask_andnot(doms_new[0], cpu_online_mask, cpu_isolated_map);
8993 WARN_ON_ONCE(dattr_new); 9104 WARN_ON_ONCE(dattr_new);
8994 } 9105 }
8995 9106
8996 /* Build new domains */ 9107 /* Build new domains */
8997 for (i = 0; i < ndoms_new; i++) { 9108 for (i = 0; i < ndoms_new; i++) {
8998 for (j = 0; j < ndoms_cur && !new_topology; j++) { 9109 for (j = 0; j < ndoms_cur && !new_topology; j++) {
8999 if (cpumask_equal(&doms_new[i], &doms_cur[j]) 9110 if (cpumask_equal(doms_new[i], doms_cur[j])
9000 && dattrs_equal(dattr_new, i, dattr_cur, j)) 9111 && dattrs_equal(dattr_new, i, dattr_cur, j))
9001 goto match2; 9112 goto match2;
9002 } 9113 }
9003 /* no match - add a new doms_new */ 9114 /* no match - add a new doms_new */
9004 __build_sched_domains(doms_new + i, 9115 __build_sched_domains(doms_new[i],
9005 dattr_new ? dattr_new + i : NULL); 9116 dattr_new ? dattr_new + i : NULL);
9006match2: 9117match2:
9007 ; 9118 ;
9008 } 9119 }
9009 9120
9010 /* Remember the new sched domains */ 9121 /* Remember the new sched domains */
9011 if (doms_cur != fallback_doms) 9122 if (doms_cur != &fallback_doms)
9012 kfree(doms_cur); 9123 free_sched_domains(doms_cur, ndoms_cur);
9013 kfree(dattr_cur); /* kfree(NULL) is safe */ 9124 kfree(dattr_cur); /* kfree(NULL) is safe */
9014 doms_cur = doms_new; 9125 doms_cur = doms_new;
9015 dattr_cur = dattr_new; 9126 dattr_cur = dattr_new;
@@ -9331,10 +9442,6 @@ void __init sched_init(void)
9331#ifdef CONFIG_CPUMASK_OFFSTACK 9442#ifdef CONFIG_CPUMASK_OFFSTACK
9332 alloc_size += num_possible_cpus() * cpumask_size(); 9443 alloc_size += num_possible_cpus() * cpumask_size();
9333#endif 9444#endif
9334 /*
9335 * As sched_init() is called before page_alloc is setup,
9336 * we use alloc_bootmem().
9337 */
9338 if (alloc_size) { 9445 if (alloc_size) {
9339 ptr = (unsigned long)kzalloc(alloc_size, GFP_NOWAIT); 9446 ptr = (unsigned long)kzalloc(alloc_size, GFP_NOWAIT);
9340 9447
@@ -9489,6 +9596,8 @@ void __init sched_init(void)
9489 rq->cpu = i; 9596 rq->cpu = i;
9490 rq->online = 0; 9597 rq->online = 0;
9491 rq->migration_thread = NULL; 9598 rq->migration_thread = NULL;
9599 rq->idle_stamp = 0;
9600 rq->avg_idle = 2*sysctl_sched_migration_cost;
9492 INIT_LIST_HEAD(&rq->migration_queue); 9601 INIT_LIST_HEAD(&rq->migration_queue);
9493 rq_attach_root(rq, &def_root_domain); 9602 rq_attach_root(rq, &def_root_domain);
9494#endif 9603#endif
@@ -9532,13 +9641,15 @@ void __init sched_init(void)
9532 current->sched_class = &fair_sched_class; 9641 current->sched_class = &fair_sched_class;
9533 9642
9534 /* Allocate the nohz_cpu_mask if CONFIG_CPUMASK_OFFSTACK */ 9643 /* Allocate the nohz_cpu_mask if CONFIG_CPUMASK_OFFSTACK */
9535 alloc_cpumask_var(&nohz_cpu_mask, GFP_NOWAIT); 9644 zalloc_cpumask_var(&nohz_cpu_mask, GFP_NOWAIT);
9536#ifdef CONFIG_SMP 9645#ifdef CONFIG_SMP
9537#ifdef CONFIG_NO_HZ 9646#ifdef CONFIG_NO_HZ
9538 alloc_cpumask_var(&nohz.cpu_mask, GFP_NOWAIT); 9647 zalloc_cpumask_var(&nohz.cpu_mask, GFP_NOWAIT);
9539 alloc_cpumask_var(&nohz.ilb_grp_nohz_mask, GFP_NOWAIT); 9648 alloc_cpumask_var(&nohz.ilb_grp_nohz_mask, GFP_NOWAIT);
9540#endif 9649#endif
9541 alloc_cpumask_var(&cpu_isolated_map, GFP_NOWAIT); 9650 /* May be allocated at isolcpus cmdline parse time */
9651 if (cpu_isolated_map == NULL)
9652 zalloc_cpumask_var(&cpu_isolated_map, GFP_NOWAIT);
9542#endif /* SMP */ 9653#endif /* SMP */
9543 9654
9544 perf_event_init(); 9655 perf_event_init();
@@ -10868,6 +10979,7 @@ void synchronize_sched_expedited(void)
10868 spin_unlock_irqrestore(&rq->lock, flags); 10979 spin_unlock_irqrestore(&rq->lock, flags);
10869 } 10980 }
10870 rcu_expedited_state = RCU_EXPEDITED_STATE_IDLE; 10981 rcu_expedited_state = RCU_EXPEDITED_STATE_IDLE;
10982 synchronize_sched_expedited_count++;
10871 mutex_unlock(&rcu_sched_expedited_mutex); 10983 mutex_unlock(&rcu_sched_expedited_mutex);
10872 put_online_cpus(); 10984 put_online_cpus();
10873 if (need_full_sync) 10985 if (need_full_sync)
diff --git a/kernel/sched_debug.c b/kernel/sched_debug.c
index efb84409bc43..6988cf08f705 100644
--- a/kernel/sched_debug.c
+++ b/kernel/sched_debug.c
@@ -285,12 +285,16 @@ static void print_cpu(struct seq_file *m, int cpu)
285 285
286#ifdef CONFIG_SCHEDSTATS 286#ifdef CONFIG_SCHEDSTATS
287#define P(n) SEQ_printf(m, " .%-30s: %d\n", #n, rq->n); 287#define P(n) SEQ_printf(m, " .%-30s: %d\n", #n, rq->n);
288#define P64(n) SEQ_printf(m, " .%-30s: %Ld\n", #n, rq->n);
288 289
289 P(yld_count); 290 P(yld_count);
290 291
291 P(sched_switch); 292 P(sched_switch);
292 P(sched_count); 293 P(sched_count);
293 P(sched_goidle); 294 P(sched_goidle);
295#ifdef CONFIG_SMP
296 P64(avg_idle);
297#endif
294 298
295 P(ttwu_count); 299 P(ttwu_count);
296 P(ttwu_local); 300 P(ttwu_local);
diff --git a/kernel/sched_fair.c b/kernel/sched_fair.c
index c32c3e643daa..f61837ad336d 100644
--- a/kernel/sched_fair.c
+++ b/kernel/sched_fair.c
@@ -822,6 +822,26 @@ check_preempt_tick(struct cfs_rq *cfs_rq, struct sched_entity *curr)
822 * re-elected due to buddy favours. 822 * re-elected due to buddy favours.
823 */ 823 */
824 clear_buddies(cfs_rq, curr); 824 clear_buddies(cfs_rq, curr);
825 return;
826 }
827
828 /*
829 * Ensure that a task that missed wakeup preemption by a
830 * narrow margin doesn't have to wait for a full slice.
831 * This also mitigates buddy induced latencies under load.
832 */
833 if (!sched_feat(WAKEUP_PREEMPT))
834 return;
835
836 if (delta_exec < sysctl_sched_min_granularity)
837 return;
838
839 if (cfs_rq->nr_running > 1) {
840 struct sched_entity *se = __pick_next_entity(cfs_rq);
841 s64 delta = curr->vruntime - se->vruntime;
842
843 if (delta > ideal_runtime)
844 resched_task(rq_of(cfs_rq)->curr);
825 } 845 }
826} 846}
827 847
@@ -861,21 +881,18 @@ wakeup_preempt_entity(struct sched_entity *curr, struct sched_entity *se);
861static struct sched_entity *pick_next_entity(struct cfs_rq *cfs_rq) 881static struct sched_entity *pick_next_entity(struct cfs_rq *cfs_rq)
862{ 882{
863 struct sched_entity *se = __pick_next_entity(cfs_rq); 883 struct sched_entity *se = __pick_next_entity(cfs_rq);
864 struct sched_entity *buddy; 884 struct sched_entity *left = se;
865 885
866 if (cfs_rq->next) { 886 if (cfs_rq->next && wakeup_preempt_entity(cfs_rq->next, left) < 1)
867 buddy = cfs_rq->next; 887 se = cfs_rq->next;
868 cfs_rq->next = NULL;
869 if (wakeup_preempt_entity(buddy, se) < 1)
870 return buddy;
871 }
872 888
873 if (cfs_rq->last) { 889 /*
874 buddy = cfs_rq->last; 890 * Prefer last buddy, try to return the CPU to a preempted task.
875 cfs_rq->last = NULL; 891 */
876 if (wakeup_preempt_entity(buddy, se) < 1) 892 if (cfs_rq->last && wakeup_preempt_entity(cfs_rq->last, left) < 1)
877 return buddy; 893 se = cfs_rq->last;
878 } 894
895 clear_buddies(cfs_rq, se);
879 896
880 return se; 897 return se;
881} 898}
@@ -1328,6 +1345,37 @@ find_idlest_cpu(struct sched_group *group, struct task_struct *p, int this_cpu)
1328} 1345}
1329 1346
1330/* 1347/*
1348 * Try and locate an idle CPU in the sched_domain.
1349 */
1350static int
1351select_idle_sibling(struct task_struct *p, struct sched_domain *sd, int target)
1352{
1353 int cpu = smp_processor_id();
1354 int prev_cpu = task_cpu(p);
1355 int i;
1356
1357 /*
1358 * If this domain spans both cpu and prev_cpu (see the SD_WAKE_AFFINE
1359 * test in select_task_rq_fair) and the prev_cpu is idle then that's
1360 * always a better target than the current cpu.
1361 */
1362 if (target == cpu && !cpu_rq(prev_cpu)->cfs.nr_running)
1363 return prev_cpu;
1364
1365 /*
1366 * Otherwise, iterate the domain and find an elegible idle cpu.
1367 */
1368 for_each_cpu_and(i, sched_domain_span(sd), &p->cpus_allowed) {
1369 if (!cpu_rq(i)->cfs.nr_running) {
1370 target = i;
1371 break;
1372 }
1373 }
1374
1375 return target;
1376}
1377
1378/*
1331 * sched_balance_self: balance the current task (running on cpu) in domains 1379 * sched_balance_self: balance the current task (running on cpu) in domains
1332 * that have the 'flag' flag set. In practice, this is SD_BALANCE_FORK and 1380 * that have the 'flag' flag set. In practice, this is SD_BALANCE_FORK and
1333 * SD_BALANCE_EXEC. 1381 * SD_BALANCE_EXEC.
@@ -1381,11 +1429,35 @@ static int select_task_rq_fair(struct task_struct *p, int sd_flag, int wake_flag
1381 want_sd = 0; 1429 want_sd = 0;
1382 } 1430 }
1383 1431
1384 if (want_affine && (tmp->flags & SD_WAKE_AFFINE) && 1432 /*
1385 cpumask_test_cpu(prev_cpu, sched_domain_span(tmp))) { 1433 * While iterating the domains looking for a spanning
1434 * WAKE_AFFINE domain, adjust the affine target to any idle cpu
1435 * in cache sharing domains along the way.
1436 */
1437 if (want_affine) {
1438 int target = -1;
1386 1439
1387 affine_sd = tmp; 1440 /*
1388 want_affine = 0; 1441 * If both cpu and prev_cpu are part of this domain,
1442 * cpu is a valid SD_WAKE_AFFINE target.
1443 */
1444 if (cpumask_test_cpu(prev_cpu, sched_domain_span(tmp)))
1445 target = cpu;
1446
1447 /*
1448 * If there's an idle sibling in this domain, make that
1449 * the wake_affine target instead of the current cpu.
1450 */
1451 if (tmp->flags & SD_PREFER_SIBLING)
1452 target = select_idle_sibling(p, tmp, target);
1453
1454 if (target >= 0) {
1455 if (tmp->flags & SD_WAKE_AFFINE) {
1456 affine_sd = tmp;
1457 want_affine = 0;
1458 }
1459 cpu = target;
1460 }
1389 } 1461 }
1390 1462
1391 if (!want_sd && !want_affine) 1463 if (!want_sd && !want_affine)
@@ -1577,6 +1649,7 @@ static void check_preempt_wakeup(struct rq *rq, struct task_struct *p, int wake_
1577 struct sched_entity *se = &curr->se, *pse = &p->se; 1649 struct sched_entity *se = &curr->se, *pse = &p->se;
1578 struct cfs_rq *cfs_rq = task_cfs_rq(curr); 1650 struct cfs_rq *cfs_rq = task_cfs_rq(curr);
1579 int sync = wake_flags & WF_SYNC; 1651 int sync = wake_flags & WF_SYNC;
1652 int scale = cfs_rq->nr_running >= sched_nr_latency;
1580 1653
1581 update_curr(cfs_rq); 1654 update_curr(cfs_rq);
1582 1655
@@ -1591,18 +1664,7 @@ static void check_preempt_wakeup(struct rq *rq, struct task_struct *p, int wake_
1591 if (unlikely(se == pse)) 1664 if (unlikely(se == pse))
1592 return; 1665 return;
1593 1666
1594 /* 1667 if (sched_feat(NEXT_BUDDY) && scale && !(wake_flags & WF_FORK))
1595 * Only set the backward buddy when the current task is still on the
1596 * rq. This can happen when a wakeup gets interleaved with schedule on
1597 * the ->pre_schedule() or idle_balance() point, either of which can
1598 * drop the rq lock.
1599 *
1600 * Also, during early boot the idle thread is in the fair class, for
1601 * obvious reasons its a bad idea to schedule back to the idle thread.
1602 */
1603 if (sched_feat(LAST_BUDDY) && likely(se->on_rq && curr != rq->idle))
1604 set_last_buddy(se);
1605 if (sched_feat(NEXT_BUDDY) && !(wake_flags & WF_FORK))
1606 set_next_buddy(pse); 1668 set_next_buddy(pse);
1607 1669
1608 /* 1670 /*
@@ -1648,8 +1710,22 @@ static void check_preempt_wakeup(struct rq *rq, struct task_struct *p, int wake_
1648 1710
1649 BUG_ON(!pse); 1711 BUG_ON(!pse);
1650 1712
1651 if (wakeup_preempt_entity(se, pse) == 1) 1713 if (wakeup_preempt_entity(se, pse) == 1) {
1652 resched_task(curr); 1714 resched_task(curr);
1715 /*
1716 * Only set the backward buddy when the current task is still
1717 * on the rq. This can happen when a wakeup gets interleaved
1718 * with schedule on the ->pre_schedule() or idle_balance()
1719 * point, either of which can * drop the rq lock.
1720 *
1721 * Also, during early boot the idle thread is in the fair class,
1722 * for obvious reasons its a bad idea to schedule back to it.
1723 */
1724 if (unlikely(!se->on_rq || curr == rq->idle))
1725 return;
1726 if (sched_feat(LAST_BUDDY) && scale && entity_is_task(se))
1727 set_last_buddy(se);
1728 }
1653} 1729}
1654 1730
1655static struct task_struct *pick_next_task_fair(struct rq *rq) 1731static struct task_struct *pick_next_task_fair(struct rq *rq)
@@ -1658,7 +1734,7 @@ static struct task_struct *pick_next_task_fair(struct rq *rq)
1658 struct cfs_rq *cfs_rq = &rq->cfs; 1734 struct cfs_rq *cfs_rq = &rq->cfs;
1659 struct sched_entity *se; 1735 struct sched_entity *se;
1660 1736
1661 if (unlikely(!cfs_rq->nr_running)) 1737 if (!cfs_rq->nr_running)
1662 return NULL; 1738 return NULL;
1663 1739
1664 do { 1740 do {
diff --git a/kernel/sched_rt.c b/kernel/sched_rt.c
index a4d790cddb19..5c5fef378415 100644
--- a/kernel/sched_rt.c
+++ b/kernel/sched_rt.c
@@ -1153,29 +1153,12 @@ static struct task_struct *pick_next_highest_task_rt(struct rq *rq, int cpu)
1153 1153
1154static DEFINE_PER_CPU(cpumask_var_t, local_cpu_mask); 1154static DEFINE_PER_CPU(cpumask_var_t, local_cpu_mask);
1155 1155
1156static inline int pick_optimal_cpu(int this_cpu,
1157 const struct cpumask *mask)
1158{
1159 int first;
1160
1161 /* "this_cpu" is cheaper to preempt than a remote processor */
1162 if ((this_cpu != -1) && cpumask_test_cpu(this_cpu, mask))
1163 return this_cpu;
1164
1165 first = cpumask_first(mask);
1166 if (first < nr_cpu_ids)
1167 return first;
1168
1169 return -1;
1170}
1171
1172static int find_lowest_rq(struct task_struct *task) 1156static int find_lowest_rq(struct task_struct *task)
1173{ 1157{
1174 struct sched_domain *sd; 1158 struct sched_domain *sd;
1175 struct cpumask *lowest_mask = __get_cpu_var(local_cpu_mask); 1159 struct cpumask *lowest_mask = __get_cpu_var(local_cpu_mask);
1176 int this_cpu = smp_processor_id(); 1160 int this_cpu = smp_processor_id();
1177 int cpu = task_cpu(task); 1161 int cpu = task_cpu(task);
1178 cpumask_var_t domain_mask;
1179 1162
1180 if (task->rt.nr_cpus_allowed == 1) 1163 if (task->rt.nr_cpus_allowed == 1)
1181 return -1; /* No other targets possible */ 1164 return -1; /* No other targets possible */
@@ -1198,28 +1181,26 @@ static int find_lowest_rq(struct task_struct *task)
1198 * Otherwise, we consult the sched_domains span maps to figure 1181 * Otherwise, we consult the sched_domains span maps to figure
1199 * out which cpu is logically closest to our hot cache data. 1182 * out which cpu is logically closest to our hot cache data.
1200 */ 1183 */
1201 if (this_cpu == cpu) 1184 if (!cpumask_test_cpu(this_cpu, lowest_mask))
1202 this_cpu = -1; /* Skip this_cpu opt if the same */ 1185 this_cpu = -1; /* Skip this_cpu opt if not among lowest */
1203
1204 if (alloc_cpumask_var(&domain_mask, GFP_ATOMIC)) {
1205 for_each_domain(cpu, sd) {
1206 if (sd->flags & SD_WAKE_AFFINE) {
1207 int best_cpu;
1208 1186
1209 cpumask_and(domain_mask, 1187 for_each_domain(cpu, sd) {
1210 sched_domain_span(sd), 1188 if (sd->flags & SD_WAKE_AFFINE) {
1211 lowest_mask); 1189 int best_cpu;
1212 1190
1213 best_cpu = pick_optimal_cpu(this_cpu, 1191 /*
1214 domain_mask); 1192 * "this_cpu" is cheaper to preempt than a
1215 1193 * remote processor.
1216 if (best_cpu != -1) { 1194 */
1217 free_cpumask_var(domain_mask); 1195 if (this_cpu != -1 &&
1218 return best_cpu; 1196 cpumask_test_cpu(this_cpu, sched_domain_span(sd)))
1219 } 1197 return this_cpu;
1220 } 1198
1199 best_cpu = cpumask_first_and(lowest_mask,
1200 sched_domain_span(sd));
1201 if (best_cpu < nr_cpu_ids)
1202 return best_cpu;
1221 } 1203 }
1222 free_cpumask_var(domain_mask);
1223 } 1204 }
1224 1205
1225 /* 1206 /*
@@ -1227,7 +1208,13 @@ static int find_lowest_rq(struct task_struct *task)
1227 * just give the caller *something* to work with from the compatible 1208 * just give the caller *something* to work with from the compatible
1228 * locations. 1209 * locations.
1229 */ 1210 */
1230 return pick_optimal_cpu(this_cpu, lowest_mask); 1211 if (this_cpu != -1)
1212 return this_cpu;
1213
1214 cpu = cpumask_any(lowest_mask);
1215 if (cpu < nr_cpu_ids)
1216 return cpu;
1217 return -1;
1231} 1218}
1232 1219
1233/* Will lock the rq it finds */ 1220/* Will lock the rq it finds */
diff --git a/kernel/signal.c b/kernel/signal.c
index 6705320784fd..6b982f2cf524 100644
--- a/kernel/signal.c
+++ b/kernel/signal.c
@@ -22,12 +22,14 @@
22#include <linux/ptrace.h> 22#include <linux/ptrace.h>
23#include <linux/signal.h> 23#include <linux/signal.h>
24#include <linux/signalfd.h> 24#include <linux/signalfd.h>
25#include <linux/ratelimit.h>
25#include <linux/tracehook.h> 26#include <linux/tracehook.h>
26#include <linux/capability.h> 27#include <linux/capability.h>
27#include <linux/freezer.h> 28#include <linux/freezer.h>
28#include <linux/pid_namespace.h> 29#include <linux/pid_namespace.h>
29#include <linux/nsproxy.h> 30#include <linux/nsproxy.h>
30#include <trace/events/sched.h> 31#define CREATE_TRACE_POINTS
32#include <trace/events/signal.h>
31 33
32#include <asm/param.h> 34#include <asm/param.h>
33#include <asm/uaccess.h> 35#include <asm/uaccess.h>
@@ -41,6 +43,8 @@
41 43
42static struct kmem_cache *sigqueue_cachep; 44static struct kmem_cache *sigqueue_cachep;
43 45
46int print_fatal_signals __read_mostly;
47
44static void __user *sig_handler(struct task_struct *t, int sig) 48static void __user *sig_handler(struct task_struct *t, int sig)
45{ 49{
46 return t->sighand->action[sig - 1].sa.sa_handler; 50 return t->sighand->action[sig - 1].sa.sa_handler;
@@ -159,7 +163,7 @@ int next_signal(struct sigpending *pending, sigset_t *mask)
159{ 163{
160 unsigned long i, *s, *m, x; 164 unsigned long i, *s, *m, x;
161 int sig = 0; 165 int sig = 0;
162 166
163 s = pending->signal.sig; 167 s = pending->signal.sig;
164 m = mask->sig; 168 m = mask->sig;
165 switch (_NSIG_WORDS) { 169 switch (_NSIG_WORDS) {
@@ -184,17 +188,31 @@ int next_signal(struct sigpending *pending, sigset_t *mask)
184 sig = ffz(~x) + 1; 188 sig = ffz(~x) + 1;
185 break; 189 break;
186 } 190 }
187 191
188 return sig; 192 return sig;
189} 193}
190 194
195static inline void print_dropped_signal(int sig)
196{
197 static DEFINE_RATELIMIT_STATE(ratelimit_state, 5 * HZ, 10);
198
199 if (!print_fatal_signals)
200 return;
201
202 if (!__ratelimit(&ratelimit_state))
203 return;
204
205 printk(KERN_INFO "%s/%d: reached RLIMIT_SIGPENDING, dropped signal %d\n",
206 current->comm, current->pid, sig);
207}
208
191/* 209/*
192 * allocate a new signal queue record 210 * allocate a new signal queue record
193 * - this may be called without locks if and only if t == current, otherwise an 211 * - this may be called without locks if and only if t == current, otherwise an
194 * appopriate lock must be held to stop the target task from exiting 212 * appopriate lock must be held to stop the target task from exiting
195 */ 213 */
196static struct sigqueue *__sigqueue_alloc(struct task_struct *t, gfp_t flags, 214static struct sigqueue *
197 int override_rlimit) 215__sigqueue_alloc(int sig, struct task_struct *t, gfp_t flags, int override_rlimit)
198{ 216{
199 struct sigqueue *q = NULL; 217 struct sigqueue *q = NULL;
200 struct user_struct *user; 218 struct user_struct *user;
@@ -207,10 +225,15 @@ static struct sigqueue *__sigqueue_alloc(struct task_struct *t, gfp_t flags,
207 */ 225 */
208 user = get_uid(__task_cred(t)->user); 226 user = get_uid(__task_cred(t)->user);
209 atomic_inc(&user->sigpending); 227 atomic_inc(&user->sigpending);
228
210 if (override_rlimit || 229 if (override_rlimit ||
211 atomic_read(&user->sigpending) <= 230 atomic_read(&user->sigpending) <=
212 t->signal->rlim[RLIMIT_SIGPENDING].rlim_cur) 231 t->signal->rlim[RLIMIT_SIGPENDING].rlim_cur) {
213 q = kmem_cache_alloc(sigqueue_cachep, flags); 232 q = kmem_cache_alloc(sigqueue_cachep, flags);
233 } else {
234 print_dropped_signal(sig);
235 }
236
214 if (unlikely(q == NULL)) { 237 if (unlikely(q == NULL)) {
215 atomic_dec(&user->sigpending); 238 atomic_dec(&user->sigpending);
216 free_uid(user); 239 free_uid(user);
@@ -834,7 +857,7 @@ static int __send_signal(int sig, struct siginfo *info, struct task_struct *t,
834 struct sigqueue *q; 857 struct sigqueue *q;
835 int override_rlimit; 858 int override_rlimit;
836 859
837 trace_sched_signal_send(sig, t); 860 trace_signal_generate(sig, info, t);
838 861
839 assert_spin_locked(&t->sighand->siglock); 862 assert_spin_locked(&t->sighand->siglock);
840 863
@@ -869,7 +892,7 @@ static int __send_signal(int sig, struct siginfo *info, struct task_struct *t,
869 else 892 else
870 override_rlimit = 0; 893 override_rlimit = 0;
871 894
872 q = __sigqueue_alloc(t, GFP_ATOMIC | __GFP_NOTRACK_FALSE_POSITIVE, 895 q = __sigqueue_alloc(sig, t, GFP_ATOMIC | __GFP_NOTRACK_FALSE_POSITIVE,
873 override_rlimit); 896 override_rlimit);
874 if (q) { 897 if (q) {
875 list_add_tail(&q->list, &pending->list); 898 list_add_tail(&q->list, &pending->list);
@@ -896,12 +919,21 @@ static int __send_signal(int sig, struct siginfo *info, struct task_struct *t,
896 break; 919 break;
897 } 920 }
898 } else if (!is_si_special(info)) { 921 } else if (!is_si_special(info)) {
899 if (sig >= SIGRTMIN && info->si_code != SI_USER) 922 if (sig >= SIGRTMIN && info->si_code != SI_USER) {
900 /* 923 /*
901 * Queue overflow, abort. We may abort if the signal was rt 924 * Queue overflow, abort. We may abort if the
902 * and sent by user using something other than kill(). 925 * signal was rt and sent by user using something
903 */ 926 * other than kill().
927 */
928 trace_signal_overflow_fail(sig, group, info);
904 return -EAGAIN; 929 return -EAGAIN;
930 } else {
931 /*
932 * This is a silent loss of information. We still
933 * send the signal, but the *info bits are lost.
934 */
935 trace_signal_lose_info(sig, group, info);
936 }
905 } 937 }
906 938
907out_set: 939out_set:
@@ -925,8 +957,6 @@ static int send_signal(int sig, struct siginfo *info, struct task_struct *t,
925 return __send_signal(sig, info, t, group, from_ancestor_ns); 957 return __send_signal(sig, info, t, group, from_ancestor_ns);
926} 958}
927 959
928int print_fatal_signals;
929
930static void print_fatal_signal(struct pt_regs *regs, int signr) 960static void print_fatal_signal(struct pt_regs *regs, int signr)
931{ 961{
932 printk("%s/%d: potentially unexpected fatal signal %d.\n", 962 printk("%s/%d: potentially unexpected fatal signal %d.\n",
@@ -1293,19 +1323,19 @@ EXPORT_SYMBOL(kill_pid);
1293 * These functions support sending signals using preallocated sigqueue 1323 * These functions support sending signals using preallocated sigqueue
1294 * structures. This is needed "because realtime applications cannot 1324 * structures. This is needed "because realtime applications cannot
1295 * afford to lose notifications of asynchronous events, like timer 1325 * afford to lose notifications of asynchronous events, like timer
1296 * expirations or I/O completions". In the case of Posix Timers 1326 * expirations or I/O completions". In the case of Posix Timers
1297 * we allocate the sigqueue structure from the timer_create. If this 1327 * we allocate the sigqueue structure from the timer_create. If this
1298 * allocation fails we are able to report the failure to the application 1328 * allocation fails we are able to report the failure to the application
1299 * with an EAGAIN error. 1329 * with an EAGAIN error.
1300 */ 1330 */
1301
1302struct sigqueue *sigqueue_alloc(void) 1331struct sigqueue *sigqueue_alloc(void)
1303{ 1332{
1304 struct sigqueue *q; 1333 struct sigqueue *q = __sigqueue_alloc(-1, current, GFP_KERNEL, 0);
1305 1334
1306 if ((q = __sigqueue_alloc(current, GFP_KERNEL, 0))) 1335 if (q)
1307 q->flags |= SIGQUEUE_PREALLOC; 1336 q->flags |= SIGQUEUE_PREALLOC;
1308 return(q); 1337
1338 return q;
1309} 1339}
1310 1340
1311void sigqueue_free(struct sigqueue *q) 1341void sigqueue_free(struct sigqueue *q)
@@ -1839,6 +1869,9 @@ relock:
1839 ka = &sighand->action[signr-1]; 1869 ka = &sighand->action[signr-1];
1840 } 1870 }
1841 1871
1872 /* Trace actually delivered signals. */
1873 trace_signal_deliver(signr, info, ka);
1874
1842 if (ka->sa.sa_handler == SIG_IGN) /* Do nothing. */ 1875 if (ka->sa.sa_handler == SIG_IGN) /* Do nothing. */
1843 continue; 1876 continue;
1844 if (ka->sa.sa_handler != SIG_DFL) { 1877 if (ka->sa.sa_handler != SIG_DFL) {
diff --git a/kernel/slow-work-debugfs.c b/kernel/slow-work-debugfs.c
new file mode 100644
index 000000000000..e45c43645298
--- /dev/null
+++ b/kernel/slow-work-debugfs.c
@@ -0,0 +1,227 @@
1/* Slow work debugging
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/module.h>
13#include <linux/slow-work.h>
14#include <linux/fs.h>
15#include <linux/time.h>
16#include <linux/seq_file.h>
17#include "slow-work.h"
18
19#define ITERATOR_SHIFT (BITS_PER_LONG - 4)
20#define ITERATOR_SELECTOR (0xfUL << ITERATOR_SHIFT)
21#define ITERATOR_COUNTER (~ITERATOR_SELECTOR)
22
23void slow_work_new_thread_desc(struct slow_work *work, struct seq_file *m)
24{
25 seq_puts(m, "Slow-work: New thread");
26}
27
28/*
29 * Render the time mark field on a work item into a 5-char time with units plus
30 * a space
31 */
32static void slow_work_print_mark(struct seq_file *m, struct slow_work *work)
33{
34 struct timespec now, diff;
35
36 now = CURRENT_TIME;
37 diff = timespec_sub(now, work->mark);
38
39 if (diff.tv_sec < 0)
40 seq_puts(m, " -ve ");
41 else if (diff.tv_sec == 0 && diff.tv_nsec < 1000)
42 seq_printf(m, "%3luns ", diff.tv_nsec);
43 else if (diff.tv_sec == 0 && diff.tv_nsec < 1000000)
44 seq_printf(m, "%3luus ", diff.tv_nsec / 1000);
45 else if (diff.tv_sec == 0 && diff.tv_nsec < 1000000000)
46 seq_printf(m, "%3lums ", diff.tv_nsec / 1000000);
47 else if (diff.tv_sec <= 1)
48 seq_puts(m, " 1s ");
49 else if (diff.tv_sec < 60)
50 seq_printf(m, "%4lus ", diff.tv_sec);
51 else if (diff.tv_sec < 60 * 60)
52 seq_printf(m, "%4lum ", diff.tv_sec / 60);
53 else if (diff.tv_sec < 60 * 60 * 24)
54 seq_printf(m, "%4luh ", diff.tv_sec / 3600);
55 else
56 seq_puts(m, "exces ");
57}
58
59/*
60 * Describe a slow work item for debugfs
61 */
62static int slow_work_runqueue_show(struct seq_file *m, void *v)
63{
64 struct slow_work *work;
65 struct list_head *p = v;
66 unsigned long id;
67
68 switch ((unsigned long) v) {
69 case 1:
70 seq_puts(m, "THR PID ITEM ADDR FL MARK DESC\n");
71 return 0;
72 case 2:
73 seq_puts(m, "=== ===== ================ == ===== ==========\n");
74 return 0;
75
76 case 3 ... 3 + SLOW_WORK_THREAD_LIMIT - 1:
77 id = (unsigned long) v - 3;
78
79 read_lock(&slow_work_execs_lock);
80 work = slow_work_execs[id];
81 if (work) {
82 smp_read_barrier_depends();
83
84 seq_printf(m, "%3lu %5d %16p %2lx ",
85 id, slow_work_pids[id], work, work->flags);
86 slow_work_print_mark(m, work);
87
88 if (work->ops->desc)
89 work->ops->desc(work, m);
90 seq_putc(m, '\n');
91 }
92 read_unlock(&slow_work_execs_lock);
93 return 0;
94
95 default:
96 work = list_entry(p, struct slow_work, link);
97 seq_printf(m, "%3s - %16p %2lx ",
98 work->flags & SLOW_WORK_VERY_SLOW ? "vsq" : "sq",
99 work, work->flags);
100 slow_work_print_mark(m, work);
101
102 if (work->ops->desc)
103 work->ops->desc(work, m);
104 seq_putc(m, '\n');
105 return 0;
106 }
107}
108
109/*
110 * map the iterator to a work item
111 */
112static void *slow_work_runqueue_index(struct seq_file *m, loff_t *_pos)
113{
114 struct list_head *p;
115 unsigned long count, id;
116
117 switch (*_pos >> ITERATOR_SHIFT) {
118 case 0x0:
119 if (*_pos == 0)
120 *_pos = 1;
121 if (*_pos < 3)
122 return (void *)(unsigned long) *_pos;
123 if (*_pos < 3 + SLOW_WORK_THREAD_LIMIT)
124 for (id = *_pos - 3;
125 id < SLOW_WORK_THREAD_LIMIT;
126 id++, (*_pos)++)
127 if (slow_work_execs[id])
128 return (void *)(unsigned long) *_pos;
129 *_pos = 0x1UL << ITERATOR_SHIFT;
130
131 case 0x1:
132 count = *_pos & ITERATOR_COUNTER;
133 list_for_each(p, &slow_work_queue) {
134 if (count == 0)
135 return p;
136 count--;
137 }
138 *_pos = 0x2UL << ITERATOR_SHIFT;
139
140 case 0x2:
141 count = *_pos & ITERATOR_COUNTER;
142 list_for_each(p, &vslow_work_queue) {
143 if (count == 0)
144 return p;
145 count--;
146 }
147 *_pos = 0x3UL << ITERATOR_SHIFT;
148
149 default:
150 return NULL;
151 }
152}
153
154/*
155 * set up the iterator to start reading from the first line
156 */
157static void *slow_work_runqueue_start(struct seq_file *m, loff_t *_pos)
158{
159 spin_lock_irq(&slow_work_queue_lock);
160 return slow_work_runqueue_index(m, _pos);
161}
162
163/*
164 * move to the next line
165 */
166static void *slow_work_runqueue_next(struct seq_file *m, void *v, loff_t *_pos)
167{
168 struct list_head *p = v;
169 unsigned long selector = *_pos >> ITERATOR_SHIFT;
170
171 (*_pos)++;
172 switch (selector) {
173 case 0x0:
174 return slow_work_runqueue_index(m, _pos);
175
176 case 0x1:
177 if (*_pos >> ITERATOR_SHIFT == 0x1) {
178 p = p->next;
179 if (p != &slow_work_queue)
180 return p;
181 }
182 *_pos = 0x2UL << ITERATOR_SHIFT;
183 p = &vslow_work_queue;
184
185 case 0x2:
186 if (*_pos >> ITERATOR_SHIFT == 0x2) {
187 p = p->next;
188 if (p != &vslow_work_queue)
189 return p;
190 }
191 *_pos = 0x3UL << ITERATOR_SHIFT;
192
193 default:
194 return NULL;
195 }
196}
197
198/*
199 * clean up after reading
200 */
201static void slow_work_runqueue_stop(struct seq_file *m, void *v)
202{
203 spin_unlock_irq(&slow_work_queue_lock);
204}
205
206static const struct seq_operations slow_work_runqueue_ops = {
207 .start = slow_work_runqueue_start,
208 .stop = slow_work_runqueue_stop,
209 .next = slow_work_runqueue_next,
210 .show = slow_work_runqueue_show,
211};
212
213/*
214 * open "/sys/kernel/debug/slow_work/runqueue" to list queue contents
215 */
216static int slow_work_runqueue_open(struct inode *inode, struct file *file)
217{
218 return seq_open(file, &slow_work_runqueue_ops);
219}
220
221const struct file_operations slow_work_runqueue_fops = {
222 .owner = THIS_MODULE,
223 .open = slow_work_runqueue_open,
224 .read = seq_read,
225 .llseek = seq_lseek,
226 .release = seq_release,
227};
diff --git a/kernel/slow-work.c b/kernel/slow-work.c
index 0d31135efbf4..00889bd3c590 100644
--- a/kernel/slow-work.c
+++ b/kernel/slow-work.c
@@ -16,11 +16,8 @@
16#include <linux/kthread.h> 16#include <linux/kthread.h>
17#include <linux/freezer.h> 17#include <linux/freezer.h>
18#include <linux/wait.h> 18#include <linux/wait.h>
19 19#include <linux/debugfs.h>
20#define SLOW_WORK_CULL_TIMEOUT (5 * HZ) /* cull threads 5s after running out of 20#include "slow-work.h"
21 * things to do */
22#define SLOW_WORK_OOM_TIMEOUT (5 * HZ) /* can't start new threads for 5s after
23 * OOM */
24 21
25static void slow_work_cull_timeout(unsigned long); 22static void slow_work_cull_timeout(unsigned long);
26static void slow_work_oom_timeout(unsigned long); 23static void slow_work_oom_timeout(unsigned long);
@@ -46,7 +43,7 @@ static unsigned vslow_work_proportion = 50; /* % of threads that may process
46 43
47#ifdef CONFIG_SYSCTL 44#ifdef CONFIG_SYSCTL
48static const int slow_work_min_min_threads = 2; 45static const int slow_work_min_min_threads = 2;
49static int slow_work_max_max_threads = 255; 46static int slow_work_max_max_threads = SLOW_WORK_THREAD_LIMIT;
50static const int slow_work_min_vslow = 1; 47static const int slow_work_min_vslow = 1;
51static const int slow_work_max_vslow = 99; 48static const int slow_work_max_vslow = 99;
52 49
@@ -98,6 +95,56 @@ static DEFINE_TIMER(slow_work_oom_timer, slow_work_oom_timeout, 0, 0);
98static struct slow_work slow_work_new_thread; /* new thread starter */ 95static struct slow_work slow_work_new_thread; /* new thread starter */
99 96
100/* 97/*
98 * slow work ID allocation (use slow_work_queue_lock)
99 */
100static DECLARE_BITMAP(slow_work_ids, SLOW_WORK_THREAD_LIMIT);
101
102/*
103 * Unregistration tracking to prevent put_ref() from disappearing during module
104 * unload
105 */
106#ifdef CONFIG_MODULES
107static struct module *slow_work_thread_processing[SLOW_WORK_THREAD_LIMIT];
108static struct module *slow_work_unreg_module;
109static struct slow_work *slow_work_unreg_work_item;
110static DECLARE_WAIT_QUEUE_HEAD(slow_work_unreg_wq);
111static DEFINE_MUTEX(slow_work_unreg_sync_lock);
112
113static void slow_work_set_thread_processing(int id, struct slow_work *work)
114{
115 if (work)
116 slow_work_thread_processing[id] = work->owner;
117}
118static void slow_work_done_thread_processing(int id, struct slow_work *work)
119{
120 struct module *module = slow_work_thread_processing[id];
121
122 slow_work_thread_processing[id] = NULL;
123 smp_mb();
124 if (slow_work_unreg_work_item == work ||
125 slow_work_unreg_module == module)
126 wake_up_all(&slow_work_unreg_wq);
127}
128static void slow_work_clear_thread_processing(int id)
129{
130 slow_work_thread_processing[id] = NULL;
131}
132#else
133static void slow_work_set_thread_processing(int id, struct slow_work *work) {}
134static void slow_work_done_thread_processing(int id, struct slow_work *work) {}
135static void slow_work_clear_thread_processing(int id) {}
136#endif
137
138/*
139 * Data for tracking currently executing items for indication through /proc
140 */
141#ifdef CONFIG_SLOW_WORK_DEBUG
142struct slow_work *slow_work_execs[SLOW_WORK_THREAD_LIMIT];
143pid_t slow_work_pids[SLOW_WORK_THREAD_LIMIT];
144DEFINE_RWLOCK(slow_work_execs_lock);
145#endif
146
147/*
101 * The queues of work items and the lock governing access to them. These are 148 * The queues of work items and the lock governing access to them. These are
102 * shared between all the CPUs. It doesn't make sense to have per-CPU queues 149 * shared between all the CPUs. It doesn't make sense to have per-CPU queues
103 * as the number of threads bears no relation to the number of CPUs. 150 * as the number of threads bears no relation to the number of CPUs.
@@ -105,9 +152,18 @@ static struct slow_work slow_work_new_thread; /* new thread starter */
105 * There are two queues of work items: one for slow work items, and one for 152 * There are two queues of work items: one for slow work items, and one for
106 * very slow work items. 153 * very slow work items.
107 */ 154 */
108static LIST_HEAD(slow_work_queue); 155LIST_HEAD(slow_work_queue);
109static LIST_HEAD(vslow_work_queue); 156LIST_HEAD(vslow_work_queue);
110static DEFINE_SPINLOCK(slow_work_queue_lock); 157DEFINE_SPINLOCK(slow_work_queue_lock);
158
159/*
160 * The following are two wait queues that get pinged when a work item is placed
161 * on an empty queue. These allow work items that are hogging a thread by
162 * sleeping in a way that could be deferred to yield their thread and enqueue
163 * themselves.
164 */
165static DECLARE_WAIT_QUEUE_HEAD(slow_work_queue_waits_for_occupation);
166static DECLARE_WAIT_QUEUE_HEAD(vslow_work_queue_waits_for_occupation);
111 167
112/* 168/*
113 * The thread controls. A variable used to signal to the threads that they 169 * The thread controls. A variable used to signal to the threads that they
@@ -126,6 +182,20 @@ static DECLARE_COMPLETION(slow_work_last_thread_exited);
126static int slow_work_user_count; 182static int slow_work_user_count;
127static DEFINE_MUTEX(slow_work_user_lock); 183static DEFINE_MUTEX(slow_work_user_lock);
128 184
185static inline int slow_work_get_ref(struct slow_work *work)
186{
187 if (work->ops->get_ref)
188 return work->ops->get_ref(work);
189
190 return 0;
191}
192
193static inline void slow_work_put_ref(struct slow_work *work)
194{
195 if (work->ops->put_ref)
196 work->ops->put_ref(work);
197}
198
129/* 199/*
130 * Calculate the maximum number of active threads in the pool that are 200 * Calculate the maximum number of active threads in the pool that are
131 * permitted to process very slow work items. 201 * permitted to process very slow work items.
@@ -149,7 +219,7 @@ static unsigned slow_work_calc_vsmax(void)
149 * Attempt to execute stuff queued on a slow thread. Return true if we managed 219 * Attempt to execute stuff queued on a slow thread. Return true if we managed
150 * it, false if there was nothing to do. 220 * it, false if there was nothing to do.
151 */ 221 */
152static bool slow_work_execute(void) 222static noinline bool slow_work_execute(int id)
153{ 223{
154 struct slow_work *work = NULL; 224 struct slow_work *work = NULL;
155 unsigned vsmax; 225 unsigned vsmax;
@@ -186,6 +256,13 @@ static bool slow_work_execute(void)
186 } else { 256 } else {
187 very_slow = false; /* avoid the compiler warning */ 257 very_slow = false; /* avoid the compiler warning */
188 } 258 }
259
260 slow_work_set_thread_processing(id, work);
261 if (work) {
262 slow_work_mark_time(work);
263 slow_work_begin_exec(id, work);
264 }
265
189 spin_unlock_irq(&slow_work_queue_lock); 266 spin_unlock_irq(&slow_work_queue_lock);
190 267
191 if (!work) 268 if (!work)
@@ -194,12 +271,19 @@ static bool slow_work_execute(void)
194 if (!test_and_clear_bit(SLOW_WORK_PENDING, &work->flags)) 271 if (!test_and_clear_bit(SLOW_WORK_PENDING, &work->flags))
195 BUG(); 272 BUG();
196 273
197 work->ops->execute(work); 274 /* don't execute if the work is in the process of being cancelled */
275 if (!test_bit(SLOW_WORK_CANCELLING, &work->flags))
276 work->ops->execute(work);
198 277
199 if (very_slow) 278 if (very_slow)
200 atomic_dec(&vslow_work_executing_count); 279 atomic_dec(&vslow_work_executing_count);
201 clear_bit_unlock(SLOW_WORK_EXECUTING, &work->flags); 280 clear_bit_unlock(SLOW_WORK_EXECUTING, &work->flags);
202 281
282 /* wake up anyone waiting for this work to be complete */
283 wake_up_bit(&work->flags, SLOW_WORK_EXECUTING);
284
285 slow_work_end_exec(id, work);
286
203 /* if someone tried to enqueue the item whilst we were executing it, 287 /* if someone tried to enqueue the item whilst we were executing it,
204 * then it'll be left unenqueued to avoid multiple threads trying to 288 * then it'll be left unenqueued to avoid multiple threads trying to
205 * execute it simultaneously 289 * execute it simultaneously
@@ -219,7 +303,10 @@ static bool slow_work_execute(void)
219 spin_unlock_irq(&slow_work_queue_lock); 303 spin_unlock_irq(&slow_work_queue_lock);
220 } 304 }
221 305
222 work->ops->put_ref(work); 306 /* sort out the race between module unloading and put_ref() */
307 slow_work_put_ref(work);
308 slow_work_done_thread_processing(id, work);
309
223 return true; 310 return true;
224 311
225auto_requeue: 312auto_requeue:
@@ -227,15 +314,61 @@ auto_requeue:
227 * - we transfer our ref on the item back to the appropriate queue 314 * - we transfer our ref on the item back to the appropriate queue
228 * - don't wake another thread up as we're awake already 315 * - don't wake another thread up as we're awake already
229 */ 316 */
317 slow_work_mark_time(work);
230 if (test_bit(SLOW_WORK_VERY_SLOW, &work->flags)) 318 if (test_bit(SLOW_WORK_VERY_SLOW, &work->flags))
231 list_add_tail(&work->link, &vslow_work_queue); 319 list_add_tail(&work->link, &vslow_work_queue);
232 else 320 else
233 list_add_tail(&work->link, &slow_work_queue); 321 list_add_tail(&work->link, &slow_work_queue);
234 spin_unlock_irq(&slow_work_queue_lock); 322 spin_unlock_irq(&slow_work_queue_lock);
323 slow_work_clear_thread_processing(id);
235 return true; 324 return true;
236} 325}
237 326
238/** 327/**
328 * slow_work_sleep_till_thread_needed - Sleep till thread needed by other work
329 * work: The work item under execution that wants to sleep
330 * _timeout: Scheduler sleep timeout
331 *
332 * Allow a requeueable work item to sleep on a slow-work processor thread until
333 * that thread is needed to do some other work or the sleep is interrupted by
334 * some other event.
335 *
336 * The caller must set up a wake up event before calling this and must have set
337 * the appropriate sleep mode (such as TASK_UNINTERRUPTIBLE) and tested its own
338 * condition before calling this function as no test is made here.
339 *
340 * False is returned if there is nothing on the queue; true is returned if the
341 * work item should be requeued
342 */
343bool slow_work_sleep_till_thread_needed(struct slow_work *work,
344 signed long *_timeout)
345{
346 wait_queue_head_t *wfo_wq;
347 struct list_head *queue;
348
349 DEFINE_WAIT(wait);
350
351 if (test_bit(SLOW_WORK_VERY_SLOW, &work->flags)) {
352 wfo_wq = &vslow_work_queue_waits_for_occupation;
353 queue = &vslow_work_queue;
354 } else {
355 wfo_wq = &slow_work_queue_waits_for_occupation;
356 queue = &slow_work_queue;
357 }
358
359 if (!list_empty(queue))
360 return true;
361
362 add_wait_queue_exclusive(wfo_wq, &wait);
363 if (list_empty(queue))
364 *_timeout = schedule_timeout(*_timeout);
365 finish_wait(wfo_wq, &wait);
366
367 return !list_empty(queue);
368}
369EXPORT_SYMBOL(slow_work_sleep_till_thread_needed);
370
371/**
239 * slow_work_enqueue - Schedule a slow work item for processing 372 * slow_work_enqueue - Schedule a slow work item for processing
240 * @work: The work item to queue 373 * @work: The work item to queue
241 * 374 *
@@ -260,16 +393,22 @@ auto_requeue:
260 * allowed to pick items to execute. This ensures that very slow items won't 393 * allowed to pick items to execute. This ensures that very slow items won't
261 * overly block ones that are just ordinarily slow. 394 * overly block ones that are just ordinarily slow.
262 * 395 *
263 * Returns 0 if successful, -EAGAIN if not. 396 * Returns 0 if successful, -EAGAIN if not (or -ECANCELED if cancelled work is
397 * attempted queued)
264 */ 398 */
265int slow_work_enqueue(struct slow_work *work) 399int slow_work_enqueue(struct slow_work *work)
266{ 400{
401 wait_queue_head_t *wfo_wq;
402 struct list_head *queue;
267 unsigned long flags; 403 unsigned long flags;
404 int ret;
405
406 if (test_bit(SLOW_WORK_CANCELLING, &work->flags))
407 return -ECANCELED;
268 408
269 BUG_ON(slow_work_user_count <= 0); 409 BUG_ON(slow_work_user_count <= 0);
270 BUG_ON(!work); 410 BUG_ON(!work);
271 BUG_ON(!work->ops); 411 BUG_ON(!work->ops);
272 BUG_ON(!work->ops->get_ref);
273 412
274 /* when honouring an enqueue request, we only promise that we will run 413 /* when honouring an enqueue request, we only promise that we will run
275 * the work function in the future; we do not promise to run it once 414 * the work function in the future; we do not promise to run it once
@@ -280,8 +419,19 @@ int slow_work_enqueue(struct slow_work *work)
280 * maintaining our promise 419 * maintaining our promise
281 */ 420 */
282 if (!test_and_set_bit_lock(SLOW_WORK_PENDING, &work->flags)) { 421 if (!test_and_set_bit_lock(SLOW_WORK_PENDING, &work->flags)) {
422 if (test_bit(SLOW_WORK_VERY_SLOW, &work->flags)) {
423 wfo_wq = &vslow_work_queue_waits_for_occupation;
424 queue = &vslow_work_queue;
425 } else {
426 wfo_wq = &slow_work_queue_waits_for_occupation;
427 queue = &slow_work_queue;
428 }
429
283 spin_lock_irqsave(&slow_work_queue_lock, flags); 430 spin_lock_irqsave(&slow_work_queue_lock, flags);
284 431
432 if (unlikely(test_bit(SLOW_WORK_CANCELLING, &work->flags)))
433 goto cancelled;
434
285 /* we promise that we will not attempt to execute the work 435 /* we promise that we will not attempt to execute the work
286 * function in more than one thread simultaneously 436 * function in more than one thread simultaneously
287 * 437 *
@@ -299,25 +449,221 @@ int slow_work_enqueue(struct slow_work *work)
299 if (test_bit(SLOW_WORK_EXECUTING, &work->flags)) { 449 if (test_bit(SLOW_WORK_EXECUTING, &work->flags)) {
300 set_bit(SLOW_WORK_ENQ_DEFERRED, &work->flags); 450 set_bit(SLOW_WORK_ENQ_DEFERRED, &work->flags);
301 } else { 451 } else {
302 if (work->ops->get_ref(work) < 0) 452 ret = slow_work_get_ref(work);
303 goto cant_get_ref; 453 if (ret < 0)
304 if (test_bit(SLOW_WORK_VERY_SLOW, &work->flags)) 454 goto failed;
305 list_add_tail(&work->link, &vslow_work_queue); 455 slow_work_mark_time(work);
306 else 456 list_add_tail(&work->link, queue);
307 list_add_tail(&work->link, &slow_work_queue);
308 wake_up(&slow_work_thread_wq); 457 wake_up(&slow_work_thread_wq);
458
459 /* if someone who could be requeued is sleeping on a
460 * thread, then ask them to yield their thread */
461 if (work->link.prev == queue)
462 wake_up(wfo_wq);
309 } 463 }
310 464
311 spin_unlock_irqrestore(&slow_work_queue_lock, flags); 465 spin_unlock_irqrestore(&slow_work_queue_lock, flags);
312 } 466 }
313 return 0; 467 return 0;
314 468
315cant_get_ref: 469cancelled:
470 ret = -ECANCELED;
471failed:
316 spin_unlock_irqrestore(&slow_work_queue_lock, flags); 472 spin_unlock_irqrestore(&slow_work_queue_lock, flags);
317 return -EAGAIN; 473 return ret;
318} 474}
319EXPORT_SYMBOL(slow_work_enqueue); 475EXPORT_SYMBOL(slow_work_enqueue);
320 476
477static int slow_work_wait(void *word)
478{
479 schedule();
480 return 0;
481}
482
483/**
484 * slow_work_cancel - Cancel a slow work item
485 * @work: The work item to cancel
486 *
487 * This function will cancel a previously enqueued work item. If we cannot
488 * cancel the work item, it is guarenteed to have run when this function
489 * returns.
490 */
491void slow_work_cancel(struct slow_work *work)
492{
493 bool wait = true, put = false;
494
495 set_bit(SLOW_WORK_CANCELLING, &work->flags);
496 smp_mb();
497
498 /* if the work item is a delayed work item with an active timer, we
499 * need to wait for the timer to finish _before_ getting the spinlock,
500 * lest we deadlock against the timer routine
501 *
502 * the timer routine will leave DELAYED set if it notices the
503 * CANCELLING flag in time
504 */
505 if (test_bit(SLOW_WORK_DELAYED, &work->flags)) {
506 struct delayed_slow_work *dwork =
507 container_of(work, struct delayed_slow_work, work);
508 del_timer_sync(&dwork->timer);
509 }
510
511 spin_lock_irq(&slow_work_queue_lock);
512
513 if (test_bit(SLOW_WORK_DELAYED, &work->flags)) {
514 /* the timer routine aborted or never happened, so we are left
515 * holding the timer's reference on the item and should just
516 * drop the pending flag and wait for any ongoing execution to
517 * finish */
518 struct delayed_slow_work *dwork =
519 container_of(work, struct delayed_slow_work, work);
520
521 BUG_ON(timer_pending(&dwork->timer));
522 BUG_ON(!list_empty(&work->link));
523
524 clear_bit(SLOW_WORK_DELAYED, &work->flags);
525 put = true;
526 clear_bit(SLOW_WORK_PENDING, &work->flags);
527
528 } else if (test_bit(SLOW_WORK_PENDING, &work->flags) &&
529 !list_empty(&work->link)) {
530 /* the link in the pending queue holds a reference on the item
531 * that we will need to release */
532 list_del_init(&work->link);
533 wait = false;
534 put = true;
535 clear_bit(SLOW_WORK_PENDING, &work->flags);
536
537 } else if (test_and_clear_bit(SLOW_WORK_ENQ_DEFERRED, &work->flags)) {
538 /* the executor is holding our only reference on the item, so
539 * we merely need to wait for it to finish executing */
540 clear_bit(SLOW_WORK_PENDING, &work->flags);
541 }
542
543 spin_unlock_irq(&slow_work_queue_lock);
544
545 /* the EXECUTING flag is set by the executor whilst the spinlock is set
546 * and before the item is dequeued - so assuming the above doesn't
547 * actually dequeue it, simply waiting for the EXECUTING flag to be
548 * released here should be sufficient */
549 if (wait)
550 wait_on_bit(&work->flags, SLOW_WORK_EXECUTING, slow_work_wait,
551 TASK_UNINTERRUPTIBLE);
552
553 clear_bit(SLOW_WORK_CANCELLING, &work->flags);
554 if (put)
555 slow_work_put_ref(work);
556}
557EXPORT_SYMBOL(slow_work_cancel);
558
559/*
560 * Handle expiry of the delay timer, indicating that a delayed slow work item
561 * should now be queued if not cancelled
562 */
563static void delayed_slow_work_timer(unsigned long data)
564{
565 wait_queue_head_t *wfo_wq;
566 struct list_head *queue;
567 struct slow_work *work = (struct slow_work *) data;
568 unsigned long flags;
569 bool queued = false, put = false, first = false;
570
571 if (test_bit(SLOW_WORK_VERY_SLOW, &work->flags)) {
572 wfo_wq = &vslow_work_queue_waits_for_occupation;
573 queue = &vslow_work_queue;
574 } else {
575 wfo_wq = &slow_work_queue_waits_for_occupation;
576 queue = &slow_work_queue;
577 }
578
579 spin_lock_irqsave(&slow_work_queue_lock, flags);
580 if (likely(!test_bit(SLOW_WORK_CANCELLING, &work->flags))) {
581 clear_bit(SLOW_WORK_DELAYED, &work->flags);
582
583 if (test_bit(SLOW_WORK_EXECUTING, &work->flags)) {
584 /* we discard the reference the timer was holding in
585 * favour of the one the executor holds */
586 set_bit(SLOW_WORK_ENQ_DEFERRED, &work->flags);
587 put = true;
588 } else {
589 slow_work_mark_time(work);
590 list_add_tail(&work->link, queue);
591 queued = true;
592 if (work->link.prev == queue)
593 first = true;
594 }
595 }
596
597 spin_unlock_irqrestore(&slow_work_queue_lock, flags);
598 if (put)
599 slow_work_put_ref(work);
600 if (first)
601 wake_up(wfo_wq);
602 if (queued)
603 wake_up(&slow_work_thread_wq);
604}
605
606/**
607 * delayed_slow_work_enqueue - Schedule a delayed slow work item for processing
608 * @dwork: The delayed work item to queue
609 * @delay: When to start executing the work, in jiffies from now
610 *
611 * This is similar to slow_work_enqueue(), but it adds a delay before the work
612 * is actually queued for processing.
613 *
614 * The item can have delayed processing requested on it whilst it is being
615 * executed. The delay will begin immediately, and if it expires before the
616 * item finishes executing, the item will be placed back on the queue when it
617 * has done executing.
618 */
619int delayed_slow_work_enqueue(struct delayed_slow_work *dwork,
620 unsigned long delay)
621{
622 struct slow_work *work = &dwork->work;
623 unsigned long flags;
624 int ret;
625
626 if (delay == 0)
627 return slow_work_enqueue(&dwork->work);
628
629 BUG_ON(slow_work_user_count <= 0);
630 BUG_ON(!work);
631 BUG_ON(!work->ops);
632
633 if (test_bit(SLOW_WORK_CANCELLING, &work->flags))
634 return -ECANCELED;
635
636 if (!test_and_set_bit_lock(SLOW_WORK_PENDING, &work->flags)) {
637 spin_lock_irqsave(&slow_work_queue_lock, flags);
638
639 if (test_bit(SLOW_WORK_CANCELLING, &work->flags))
640 goto cancelled;
641
642 /* the timer holds a reference whilst it is pending */
643 ret = work->ops->get_ref(work);
644 if (ret < 0)
645 goto cant_get_ref;
646
647 if (test_and_set_bit(SLOW_WORK_DELAYED, &work->flags))
648 BUG();
649 dwork->timer.expires = jiffies + delay;
650 dwork->timer.data = (unsigned long) work;
651 dwork->timer.function = delayed_slow_work_timer;
652 add_timer(&dwork->timer);
653
654 spin_unlock_irqrestore(&slow_work_queue_lock, flags);
655 }
656
657 return 0;
658
659cancelled:
660 ret = -ECANCELED;
661cant_get_ref:
662 spin_unlock_irqrestore(&slow_work_queue_lock, flags);
663 return ret;
664}
665EXPORT_SYMBOL(delayed_slow_work_enqueue);
666
321/* 667/*
322 * Schedule a cull of the thread pool at some time in the near future 668 * Schedule a cull of the thread pool at some time in the near future
323 */ 669 */
@@ -368,13 +714,23 @@ static inline bool slow_work_available(int vsmax)
368 */ 714 */
369static int slow_work_thread(void *_data) 715static int slow_work_thread(void *_data)
370{ 716{
371 int vsmax; 717 int vsmax, id;
372 718
373 DEFINE_WAIT(wait); 719 DEFINE_WAIT(wait);
374 720
375 set_freezable(); 721 set_freezable();
376 set_user_nice(current, -5); 722 set_user_nice(current, -5);
377 723
724 /* allocate ourselves an ID */
725 spin_lock_irq(&slow_work_queue_lock);
726 id = find_first_zero_bit(slow_work_ids, SLOW_WORK_THREAD_LIMIT);
727 BUG_ON(id < 0 || id >= SLOW_WORK_THREAD_LIMIT);
728 __set_bit(id, slow_work_ids);
729 slow_work_set_thread_pid(id, current->pid);
730 spin_unlock_irq(&slow_work_queue_lock);
731
732 sprintf(current->comm, "kslowd%03u", id);
733
378 for (;;) { 734 for (;;) {
379 vsmax = vslow_work_proportion; 735 vsmax = vslow_work_proportion;
380 vsmax *= atomic_read(&slow_work_thread_count); 736 vsmax *= atomic_read(&slow_work_thread_count);
@@ -395,7 +751,7 @@ static int slow_work_thread(void *_data)
395 vsmax *= atomic_read(&slow_work_thread_count); 751 vsmax *= atomic_read(&slow_work_thread_count);
396 vsmax /= 100; 752 vsmax /= 100;
397 753
398 if (slow_work_available(vsmax) && slow_work_execute()) { 754 if (slow_work_available(vsmax) && slow_work_execute(id)) {
399 cond_resched(); 755 cond_resched();
400 if (list_empty(&slow_work_queue) && 756 if (list_empty(&slow_work_queue) &&
401 list_empty(&vslow_work_queue) && 757 list_empty(&vslow_work_queue) &&
@@ -412,6 +768,11 @@ static int slow_work_thread(void *_data)
412 break; 768 break;
413 } 769 }
414 770
771 spin_lock_irq(&slow_work_queue_lock);
772 slow_work_set_thread_pid(id, 0);
773 __clear_bit(id, slow_work_ids);
774 spin_unlock_irq(&slow_work_queue_lock);
775
415 if (atomic_dec_and_test(&slow_work_thread_count)) 776 if (atomic_dec_and_test(&slow_work_thread_count))
416 complete_and_exit(&slow_work_last_thread_exited, 0); 777 complete_and_exit(&slow_work_last_thread_exited, 0);
417 return 0; 778 return 0;
@@ -427,21 +788,6 @@ static void slow_work_cull_timeout(unsigned long data)
427} 788}
428 789
429/* 790/*
430 * Get a reference on slow work thread starter
431 */
432static int slow_work_new_thread_get_ref(struct slow_work *work)
433{
434 return 0;
435}
436
437/*
438 * Drop a reference on slow work thread starter
439 */
440static void slow_work_new_thread_put_ref(struct slow_work *work)
441{
442}
443
444/*
445 * Start a new slow work thread 791 * Start a new slow work thread
446 */ 792 */
447static void slow_work_new_thread_execute(struct slow_work *work) 793static void slow_work_new_thread_execute(struct slow_work *work)
@@ -475,9 +821,11 @@ static void slow_work_new_thread_execute(struct slow_work *work)
475} 821}
476 822
477static const struct slow_work_ops slow_work_new_thread_ops = { 823static const struct slow_work_ops slow_work_new_thread_ops = {
478 .get_ref = slow_work_new_thread_get_ref, 824 .owner = THIS_MODULE,
479 .put_ref = slow_work_new_thread_put_ref,
480 .execute = slow_work_new_thread_execute, 825 .execute = slow_work_new_thread_execute,
826#ifdef CONFIG_SLOW_WORK_DEBUG
827 .desc = slow_work_new_thread_desc,
828#endif
481}; 829};
482 830
483/* 831/*
@@ -546,12 +894,13 @@ static int slow_work_max_threads_sysctl(struct ctl_table *table, int write,
546 894
547/** 895/**
548 * slow_work_register_user - Register a user of the facility 896 * slow_work_register_user - Register a user of the facility
897 * @module: The module about to make use of the facility
549 * 898 *
550 * Register a user of the facility, starting up the initial threads if there 899 * Register a user of the facility, starting up the initial threads if there
551 * aren't any other users at this point. This will return 0 if successful, or 900 * aren't any other users at this point. This will return 0 if successful, or
552 * an error if not. 901 * an error if not.
553 */ 902 */
554int slow_work_register_user(void) 903int slow_work_register_user(struct module *module)
555{ 904{
556 struct task_struct *p; 905 struct task_struct *p;
557 int loop; 906 int loop;
@@ -598,14 +947,81 @@ error:
598} 947}
599EXPORT_SYMBOL(slow_work_register_user); 948EXPORT_SYMBOL(slow_work_register_user);
600 949
950/*
951 * wait for all outstanding items from the calling module to complete
952 * - note that more items may be queued whilst we're waiting
953 */
954static void slow_work_wait_for_items(struct module *module)
955{
956#ifdef CONFIG_MODULES
957 DECLARE_WAITQUEUE(myself, current);
958 struct slow_work *work;
959 int loop;
960
961 mutex_lock(&slow_work_unreg_sync_lock);
962 add_wait_queue(&slow_work_unreg_wq, &myself);
963
964 for (;;) {
965 spin_lock_irq(&slow_work_queue_lock);
966
967 /* first of all, we wait for the last queued item in each list
968 * to be processed */
969 list_for_each_entry_reverse(work, &vslow_work_queue, link) {
970 if (work->owner == module) {
971 set_current_state(TASK_UNINTERRUPTIBLE);
972 slow_work_unreg_work_item = work;
973 goto do_wait;
974 }
975 }
976 list_for_each_entry_reverse(work, &slow_work_queue, link) {
977 if (work->owner == module) {
978 set_current_state(TASK_UNINTERRUPTIBLE);
979 slow_work_unreg_work_item = work;
980 goto do_wait;
981 }
982 }
983
984 /* then we wait for the items being processed to finish */
985 slow_work_unreg_module = module;
986 smp_mb();
987 for (loop = 0; loop < SLOW_WORK_THREAD_LIMIT; loop++) {
988 if (slow_work_thread_processing[loop] == module)
989 goto do_wait;
990 }
991 spin_unlock_irq(&slow_work_queue_lock);
992 break; /* okay, we're done */
993
994 do_wait:
995 spin_unlock_irq(&slow_work_queue_lock);
996 schedule();
997 slow_work_unreg_work_item = NULL;
998 slow_work_unreg_module = NULL;
999 }
1000
1001 remove_wait_queue(&slow_work_unreg_wq, &myself);
1002 mutex_unlock(&slow_work_unreg_sync_lock);
1003#endif /* CONFIG_MODULES */
1004}
1005
601/** 1006/**
602 * slow_work_unregister_user - Unregister a user of the facility 1007 * slow_work_unregister_user - Unregister a user of the facility
1008 * @module: The module whose items should be cleared
603 * 1009 *
604 * Unregister a user of the facility, killing all the threads if this was the 1010 * Unregister a user of the facility, killing all the threads if this was the
605 * last one. 1011 * last one.
1012 *
1013 * This waits for all the work items belonging to the nominated module to go
1014 * away before proceeding.
606 */ 1015 */
607void slow_work_unregister_user(void) 1016void slow_work_unregister_user(struct module *module)
608{ 1017{
1018 /* first of all, wait for all outstanding items from the calling module
1019 * to complete */
1020 if (module)
1021 slow_work_wait_for_items(module);
1022
1023 /* then we can actually go about shutting down the facility if need
1024 * be */
609 mutex_lock(&slow_work_user_lock); 1025 mutex_lock(&slow_work_user_lock);
610 1026
611 BUG_ON(slow_work_user_count <= 0); 1027 BUG_ON(slow_work_user_count <= 0);
@@ -639,6 +1055,16 @@ static int __init init_slow_work(void)
639 if (slow_work_max_max_threads < nr_cpus * 2) 1055 if (slow_work_max_max_threads < nr_cpus * 2)
640 slow_work_max_max_threads = nr_cpus * 2; 1056 slow_work_max_max_threads = nr_cpus * 2;
641#endif 1057#endif
1058#ifdef CONFIG_SLOW_WORK_DEBUG
1059 {
1060 struct dentry *dbdir;
1061
1062 dbdir = debugfs_create_dir("slow_work", NULL);
1063 if (dbdir && !IS_ERR(dbdir))
1064 debugfs_create_file("runqueue", S_IFREG | 0400, dbdir,
1065 NULL, &slow_work_runqueue_fops);
1066 }
1067#endif
642 return 0; 1068 return 0;
643} 1069}
644 1070
diff --git a/kernel/slow-work.h b/kernel/slow-work.h
new file mode 100644
index 000000000000..321f3c59d732
--- /dev/null
+++ b/kernel/slow-work.h
@@ -0,0 +1,72 @@
1/* Slow work private definitions
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#define SLOW_WORK_CULL_TIMEOUT (5 * HZ) /* cull threads 5s after running out of
13 * things to do */
14#define SLOW_WORK_OOM_TIMEOUT (5 * HZ) /* can't start new threads for 5s after
15 * OOM */
16
17#define SLOW_WORK_THREAD_LIMIT 255 /* abs maximum number of slow-work threads */
18
19/*
20 * slow-work.c
21 */
22#ifdef CONFIG_SLOW_WORK_DEBUG
23extern struct slow_work *slow_work_execs[];
24extern pid_t slow_work_pids[];
25extern rwlock_t slow_work_execs_lock;
26#endif
27
28extern struct list_head slow_work_queue;
29extern struct list_head vslow_work_queue;
30extern spinlock_t slow_work_queue_lock;
31
32/*
33 * slow-work-debugfs.c
34 */
35#ifdef CONFIG_SLOW_WORK_DEBUG
36extern const struct file_operations slow_work_runqueue_fops;
37
38extern void slow_work_new_thread_desc(struct slow_work *, struct seq_file *);
39#endif
40
41/*
42 * Helper functions
43 */
44static inline void slow_work_set_thread_pid(int id, pid_t pid)
45{
46#ifdef CONFIG_SLOW_WORK_PROC
47 slow_work_pids[id] = pid;
48#endif
49}
50
51static inline void slow_work_mark_time(struct slow_work *work)
52{
53#ifdef CONFIG_SLOW_WORK_PROC
54 work->mark = CURRENT_TIME;
55#endif
56}
57
58static inline void slow_work_begin_exec(int id, struct slow_work *work)
59{
60#ifdef CONFIG_SLOW_WORK_PROC
61 slow_work_execs[id] = work;
62#endif
63}
64
65static inline void slow_work_end_exec(int id, struct slow_work *work)
66{
67#ifdef CONFIG_SLOW_WORK_PROC
68 write_lock(&slow_work_execs_lock);
69 slow_work_execs[id] = NULL;
70 write_unlock(&slow_work_execs_lock);
71#endif
72}
diff --git a/kernel/smp.c b/kernel/smp.c
index c9d1c7835c2f..a8c76069cf50 100644
--- a/kernel/smp.c
+++ b/kernel/smp.c
@@ -265,9 +265,7 @@ static DEFINE_PER_CPU(struct call_single_data, csd_data);
265 * @info: An arbitrary pointer to pass to the function. 265 * @info: An arbitrary pointer to pass to the function.
266 * @wait: If true, wait until function has completed on other CPUs. 266 * @wait: If true, wait until function has completed on other CPUs.
267 * 267 *
268 * Returns 0 on success, else a negative status code. Note that @wait 268 * Returns 0 on success, else a negative status code.
269 * will be implicitly turned on in case of allocation failures, since
270 * we fall back to on-stack allocation.
271 */ 269 */
272int smp_call_function_single(int cpu, void (*func) (void *info), void *info, 270int smp_call_function_single(int cpu, void (*func) (void *info), void *info,
273 int wait) 271 int wait)
@@ -321,6 +319,51 @@ int smp_call_function_single(int cpu, void (*func) (void *info), void *info,
321} 319}
322EXPORT_SYMBOL(smp_call_function_single); 320EXPORT_SYMBOL(smp_call_function_single);
323 321
322/*
323 * smp_call_function_any - Run a function on any of the given cpus
324 * @mask: The mask of cpus it can run on.
325 * @func: The function to run. This must be fast and non-blocking.
326 * @info: An arbitrary pointer to pass to the function.
327 * @wait: If true, wait until function has completed.
328 *
329 * Returns 0 on success, else a negative status code (if no cpus were online).
330 * Note that @wait will be implicitly turned on in case of allocation failures,
331 * since we fall back to on-stack allocation.
332 *
333 * Selection preference:
334 * 1) current cpu if in @mask
335 * 2) any cpu of current node if in @mask
336 * 3) any other online cpu in @mask
337 */
338int smp_call_function_any(const struct cpumask *mask,
339 void (*func)(void *info), void *info, int wait)
340{
341 unsigned int cpu;
342 const struct cpumask *nodemask;
343 int ret;
344
345 /* Try for same CPU (cheapest) */
346 cpu = get_cpu();
347 if (cpumask_test_cpu(cpu, mask))
348 goto call;
349
350 /* Try for same node. */
351 nodemask = cpumask_of_node(cpu);
352 for (cpu = cpumask_first_and(nodemask, mask); cpu < nr_cpu_ids;
353 cpu = cpumask_next_and(cpu, nodemask, mask)) {
354 if (cpu_online(cpu))
355 goto call;
356 }
357
358 /* Any online will do: smp_call_function_single handles nr_cpu_ids. */
359 cpu = cpumask_any_and(mask, cpu_online_mask);
360call:
361 ret = smp_call_function_single(cpu, func, info, wait);
362 put_cpu();
363 return ret;
364}
365EXPORT_SYMBOL_GPL(smp_call_function_any);
366
324/** 367/**
325 * __smp_call_function_single(): Run a function on another CPU 368 * __smp_call_function_single(): Run a function on another CPU
326 * @cpu: The CPU to run on. 369 * @cpu: The CPU to run on.
@@ -355,9 +398,7 @@ void __smp_call_function_single(int cpu, struct call_single_data *data,
355 * @wait: If true, wait (atomically) until function has completed 398 * @wait: If true, wait (atomically) until function has completed
356 * on other CPUs. 399 * on other CPUs.
357 * 400 *
358 * If @wait is true, then returns once @func has returned. Note that @wait 401 * If @wait is true, then returns once @func has returned.
359 * will be implicitly turned on in case of allocation failures, since
360 * we fall back to on-stack allocation.
361 * 402 *
362 * You must not call this function with disabled interrupts or from a 403 * You must not call this function with disabled interrupts or from a
363 * hardware interrupt handler or from a bottom half handler. Preemption 404 * hardware interrupt handler or from a bottom half handler. Preemption
@@ -443,8 +484,7 @@ EXPORT_SYMBOL(smp_call_function_many);
443 * Returns 0. 484 * Returns 0.
444 * 485 *
445 * If @wait is true, then returns once @func has returned; otherwise 486 * If @wait is true, then returns once @func has returned; otherwise
446 * it returns just before the target cpu calls @func. In case of allocation 487 * it returns just before the target cpu calls @func.
447 * failure, @wait will be implicitly turned on.
448 * 488 *
449 * You must not call this function with disabled interrupts or from a 489 * You must not call this function with disabled interrupts or from a
450 * hardware interrupt handler or from a bottom half handler. 490 * hardware interrupt handler or from a bottom half handler.
diff --git a/kernel/softirq.c b/kernel/softirq.c
index f8749e5216e0..21939d9e830e 100644
--- a/kernel/softirq.c
+++ b/kernel/softirq.c
@@ -302,9 +302,9 @@ void irq_exit(void)
302 if (!in_interrupt() && local_softirq_pending()) 302 if (!in_interrupt() && local_softirq_pending())
303 invoke_softirq(); 303 invoke_softirq();
304 304
305 rcu_irq_exit();
305#ifdef CONFIG_NO_HZ 306#ifdef CONFIG_NO_HZ
306 /* Make sure that timer wheel updates are propagated */ 307 /* Make sure that timer wheel updates are propagated */
307 rcu_irq_exit();
308 if (idle_cpu(smp_processor_id()) && !in_interrupt() && !need_resched()) 308 if (idle_cpu(smp_processor_id()) && !in_interrupt() && !need_resched())
309 tick_nohz_stop_sched_tick(0); 309 tick_nohz_stop_sched_tick(0);
310#endif 310#endif
diff --git a/kernel/spinlock.c b/kernel/spinlock.c
index 5ddab730cb2f..41e042219ff6 100644
--- a/kernel/spinlock.c
+++ b/kernel/spinlock.c
@@ -21,145 +21,28 @@
21#include <linux/debug_locks.h> 21#include <linux/debug_locks.h>
22#include <linux/module.h> 22#include <linux/module.h>
23 23
24#ifndef _spin_trylock
25int __lockfunc _spin_trylock(spinlock_t *lock)
26{
27 return __spin_trylock(lock);
28}
29EXPORT_SYMBOL(_spin_trylock);
30#endif
31
32#ifndef _read_trylock
33int __lockfunc _read_trylock(rwlock_t *lock)
34{
35 return __read_trylock(lock);
36}
37EXPORT_SYMBOL(_read_trylock);
38#endif
39
40#ifndef _write_trylock
41int __lockfunc _write_trylock(rwlock_t *lock)
42{
43 return __write_trylock(lock);
44}
45EXPORT_SYMBOL(_write_trylock);
46#endif
47
48/* 24/*
49 * If lockdep is enabled then we use the non-preemption spin-ops 25 * If lockdep is enabled then we use the non-preemption spin-ops
50 * even on CONFIG_PREEMPT, because lockdep assumes that interrupts are 26 * even on CONFIG_PREEMPT, because lockdep assumes that interrupts are
51 * not re-enabled during lock-acquire (which the preempt-spin-ops do): 27 * not re-enabled during lock-acquire (which the preempt-spin-ops do):
52 */ 28 */
53#if !defined(CONFIG_GENERIC_LOCKBREAK) || defined(CONFIG_DEBUG_LOCK_ALLOC) 29#if !defined(CONFIG_GENERIC_LOCKBREAK) || defined(CONFIG_DEBUG_LOCK_ALLOC)
54
55#ifndef _read_lock
56void __lockfunc _read_lock(rwlock_t *lock)
57{
58 __read_lock(lock);
59}
60EXPORT_SYMBOL(_read_lock);
61#endif
62
63#ifndef _spin_lock_irqsave
64unsigned long __lockfunc _spin_lock_irqsave(spinlock_t *lock)
65{
66 return __spin_lock_irqsave(lock);
67}
68EXPORT_SYMBOL(_spin_lock_irqsave);
69#endif
70
71#ifndef _spin_lock_irq
72void __lockfunc _spin_lock_irq(spinlock_t *lock)
73{
74 __spin_lock_irq(lock);
75}
76EXPORT_SYMBOL(_spin_lock_irq);
77#endif
78
79#ifndef _spin_lock_bh
80void __lockfunc _spin_lock_bh(spinlock_t *lock)
81{
82 __spin_lock_bh(lock);
83}
84EXPORT_SYMBOL(_spin_lock_bh);
85#endif
86
87#ifndef _read_lock_irqsave
88unsigned long __lockfunc _read_lock_irqsave(rwlock_t *lock)
89{
90 return __read_lock_irqsave(lock);
91}
92EXPORT_SYMBOL(_read_lock_irqsave);
93#endif
94
95#ifndef _read_lock_irq
96void __lockfunc _read_lock_irq(rwlock_t *lock)
97{
98 __read_lock_irq(lock);
99}
100EXPORT_SYMBOL(_read_lock_irq);
101#endif
102
103#ifndef _read_lock_bh
104void __lockfunc _read_lock_bh(rwlock_t *lock)
105{
106 __read_lock_bh(lock);
107}
108EXPORT_SYMBOL(_read_lock_bh);
109#endif
110
111#ifndef _write_lock_irqsave
112unsigned long __lockfunc _write_lock_irqsave(rwlock_t *lock)
113{
114 return __write_lock_irqsave(lock);
115}
116EXPORT_SYMBOL(_write_lock_irqsave);
117#endif
118
119#ifndef _write_lock_irq
120void __lockfunc _write_lock_irq(rwlock_t *lock)
121{
122 __write_lock_irq(lock);
123}
124EXPORT_SYMBOL(_write_lock_irq);
125#endif
126
127#ifndef _write_lock_bh
128void __lockfunc _write_lock_bh(rwlock_t *lock)
129{
130 __write_lock_bh(lock);
131}
132EXPORT_SYMBOL(_write_lock_bh);
133#endif
134
135#ifndef _spin_lock
136void __lockfunc _spin_lock(spinlock_t *lock)
137{
138 __spin_lock(lock);
139}
140EXPORT_SYMBOL(_spin_lock);
141#endif
142
143#ifndef _write_lock
144void __lockfunc _write_lock(rwlock_t *lock)
145{
146 __write_lock(lock);
147}
148EXPORT_SYMBOL(_write_lock);
149#endif
150
151#else /* CONFIG_PREEMPT: */
152
153/* 30/*
31 * The __lock_function inlines are taken from
32 * include/linux/spinlock_api_smp.h
33 */
34#else
35/*
36 * We build the __lock_function inlines here. They are too large for
37 * inlining all over the place, but here is only one user per function
38 * which embedds them into the calling _lock_function below.
39 *
154 * This could be a long-held lock. We both prepare to spin for a long 40 * This could be a long-held lock. We both prepare to spin for a long
155 * time (making _this_ CPU preemptable if possible), and we also signal 41 * time (making _this_ CPU preemptable if possible), and we also signal
156 * towards that other CPU that it should break the lock ASAP. 42 * towards that other CPU that it should break the lock ASAP.
157 *
158 * (We do this in a function because inlining it would be excessive.)
159 */ 43 */
160
161#define BUILD_LOCK_OPS(op, locktype) \ 44#define BUILD_LOCK_OPS(op, locktype) \
162void __lockfunc _##op##_lock(locktype##_t *lock) \ 45void __lockfunc __##op##_lock(locktype##_t *lock) \
163{ \ 46{ \
164 for (;;) { \ 47 for (;;) { \
165 preempt_disable(); \ 48 preempt_disable(); \
@@ -175,9 +58,7 @@ void __lockfunc _##op##_lock(locktype##_t *lock) \
175 (lock)->break_lock = 0; \ 58 (lock)->break_lock = 0; \
176} \ 59} \
177 \ 60 \
178EXPORT_SYMBOL(_##op##_lock); \ 61unsigned long __lockfunc __##op##_lock_irqsave(locktype##_t *lock) \
179 \
180unsigned long __lockfunc _##op##_lock_irqsave(locktype##_t *lock) \
181{ \ 62{ \
182 unsigned long flags; \ 63 unsigned long flags; \
183 \ 64 \
@@ -198,16 +79,12 @@ unsigned long __lockfunc _##op##_lock_irqsave(locktype##_t *lock) \
198 return flags; \ 79 return flags; \
199} \ 80} \
200 \ 81 \
201EXPORT_SYMBOL(_##op##_lock_irqsave); \ 82void __lockfunc __##op##_lock_irq(locktype##_t *lock) \
202 \
203void __lockfunc _##op##_lock_irq(locktype##_t *lock) \
204{ \ 83{ \
205 _##op##_lock_irqsave(lock); \ 84 _##op##_lock_irqsave(lock); \
206} \ 85} \
207 \ 86 \
208EXPORT_SYMBOL(_##op##_lock_irq); \ 87void __lockfunc __##op##_lock_bh(locktype##_t *lock) \
209 \
210void __lockfunc _##op##_lock_bh(locktype##_t *lock) \
211{ \ 88{ \
212 unsigned long flags; \ 89 unsigned long flags; \
213 \ 90 \
@@ -220,23 +97,21 @@ void __lockfunc _##op##_lock_bh(locktype##_t *lock) \
220 local_bh_disable(); \ 97 local_bh_disable(); \
221 local_irq_restore(flags); \ 98 local_irq_restore(flags); \
222} \ 99} \
223 \
224EXPORT_SYMBOL(_##op##_lock_bh)
225 100
226/* 101/*
227 * Build preemption-friendly versions of the following 102 * Build preemption-friendly versions of the following
228 * lock-spinning functions: 103 * lock-spinning functions:
229 * 104 *
230 * _[spin|read|write]_lock() 105 * __[spin|read|write]_lock()
231 * _[spin|read|write]_lock_irq() 106 * __[spin|read|write]_lock_irq()
232 * _[spin|read|write]_lock_irqsave() 107 * __[spin|read|write]_lock_irqsave()
233 * _[spin|read|write]_lock_bh() 108 * __[spin|read|write]_lock_bh()
234 */ 109 */
235BUILD_LOCK_OPS(spin, spinlock); 110BUILD_LOCK_OPS(spin, spinlock);
236BUILD_LOCK_OPS(read, rwlock); 111BUILD_LOCK_OPS(read, rwlock);
237BUILD_LOCK_OPS(write, rwlock); 112BUILD_LOCK_OPS(write, rwlock);
238 113
239#endif /* CONFIG_PREEMPT */ 114#endif
240 115
241#ifdef CONFIG_DEBUG_LOCK_ALLOC 116#ifdef CONFIG_DEBUG_LOCK_ALLOC
242 117
@@ -248,7 +123,8 @@ void __lockfunc _spin_lock_nested(spinlock_t *lock, int subclass)
248} 123}
249EXPORT_SYMBOL(_spin_lock_nested); 124EXPORT_SYMBOL(_spin_lock_nested);
250 125
251unsigned long __lockfunc _spin_lock_irqsave_nested(spinlock_t *lock, int subclass) 126unsigned long __lockfunc _spin_lock_irqsave_nested(spinlock_t *lock,
127 int subclass)
252{ 128{
253 unsigned long flags; 129 unsigned long flags;
254 130
@@ -272,7 +148,127 @@ EXPORT_SYMBOL(_spin_lock_nest_lock);
272 148
273#endif 149#endif
274 150
275#ifndef _spin_unlock 151#ifndef CONFIG_INLINE_SPIN_TRYLOCK
152int __lockfunc _spin_trylock(spinlock_t *lock)
153{
154 return __spin_trylock(lock);
155}
156EXPORT_SYMBOL(_spin_trylock);
157#endif
158
159#ifndef CONFIG_INLINE_READ_TRYLOCK
160int __lockfunc _read_trylock(rwlock_t *lock)
161{
162 return __read_trylock(lock);
163}
164EXPORT_SYMBOL(_read_trylock);
165#endif
166
167#ifndef CONFIG_INLINE_WRITE_TRYLOCK
168int __lockfunc _write_trylock(rwlock_t *lock)
169{
170 return __write_trylock(lock);
171}
172EXPORT_SYMBOL(_write_trylock);
173#endif
174
175#ifndef CONFIG_INLINE_READ_LOCK
176void __lockfunc _read_lock(rwlock_t *lock)
177{
178 __read_lock(lock);
179}
180EXPORT_SYMBOL(_read_lock);
181#endif
182
183#ifndef CONFIG_INLINE_SPIN_LOCK_IRQSAVE
184unsigned long __lockfunc _spin_lock_irqsave(spinlock_t *lock)
185{
186 return __spin_lock_irqsave(lock);
187}
188EXPORT_SYMBOL(_spin_lock_irqsave);
189#endif
190
191#ifndef CONFIG_INLINE_SPIN_LOCK_IRQ
192void __lockfunc _spin_lock_irq(spinlock_t *lock)
193{
194 __spin_lock_irq(lock);
195}
196EXPORT_SYMBOL(_spin_lock_irq);
197#endif
198
199#ifndef CONFIG_INLINE_SPIN_LOCK_BH
200void __lockfunc _spin_lock_bh(spinlock_t *lock)
201{
202 __spin_lock_bh(lock);
203}
204EXPORT_SYMBOL(_spin_lock_bh);
205#endif
206
207#ifndef CONFIG_INLINE_READ_LOCK_IRQSAVE
208unsigned long __lockfunc _read_lock_irqsave(rwlock_t *lock)
209{
210 return __read_lock_irqsave(lock);
211}
212EXPORT_SYMBOL(_read_lock_irqsave);
213#endif
214
215#ifndef CONFIG_INLINE_READ_LOCK_IRQ
216void __lockfunc _read_lock_irq(rwlock_t *lock)
217{
218 __read_lock_irq(lock);
219}
220EXPORT_SYMBOL(_read_lock_irq);
221#endif
222
223#ifndef CONFIG_INLINE_READ_LOCK_BH
224void __lockfunc _read_lock_bh(rwlock_t *lock)
225{
226 __read_lock_bh(lock);
227}
228EXPORT_SYMBOL(_read_lock_bh);
229#endif
230
231#ifndef CONFIG_INLINE_WRITE_LOCK_IRQSAVE
232unsigned long __lockfunc _write_lock_irqsave(rwlock_t *lock)
233{
234 return __write_lock_irqsave(lock);
235}
236EXPORT_SYMBOL(_write_lock_irqsave);
237#endif
238
239#ifndef CONFIG_INLINE_WRITE_LOCK_IRQ
240void __lockfunc _write_lock_irq(rwlock_t *lock)
241{
242 __write_lock_irq(lock);
243}
244EXPORT_SYMBOL(_write_lock_irq);
245#endif
246
247#ifndef CONFIG_INLINE_WRITE_LOCK_BH
248void __lockfunc _write_lock_bh(rwlock_t *lock)
249{
250 __write_lock_bh(lock);
251}
252EXPORT_SYMBOL(_write_lock_bh);
253#endif
254
255#ifndef CONFIG_INLINE_SPIN_LOCK
256void __lockfunc _spin_lock(spinlock_t *lock)
257{
258 __spin_lock(lock);
259}
260EXPORT_SYMBOL(_spin_lock);
261#endif
262
263#ifndef CONFIG_INLINE_WRITE_LOCK
264void __lockfunc _write_lock(rwlock_t *lock)
265{
266 __write_lock(lock);
267}
268EXPORT_SYMBOL(_write_lock);
269#endif
270
271#ifndef CONFIG_INLINE_SPIN_UNLOCK
276void __lockfunc _spin_unlock(spinlock_t *lock) 272void __lockfunc _spin_unlock(spinlock_t *lock)
277{ 273{
278 __spin_unlock(lock); 274 __spin_unlock(lock);
@@ -280,7 +276,7 @@ void __lockfunc _spin_unlock(spinlock_t *lock)
280EXPORT_SYMBOL(_spin_unlock); 276EXPORT_SYMBOL(_spin_unlock);
281#endif 277#endif
282 278
283#ifndef _write_unlock 279#ifndef CONFIG_INLINE_WRITE_UNLOCK
284void __lockfunc _write_unlock(rwlock_t *lock) 280void __lockfunc _write_unlock(rwlock_t *lock)
285{ 281{
286 __write_unlock(lock); 282 __write_unlock(lock);
@@ -288,7 +284,7 @@ void __lockfunc _write_unlock(rwlock_t *lock)
288EXPORT_SYMBOL(_write_unlock); 284EXPORT_SYMBOL(_write_unlock);
289#endif 285#endif
290 286
291#ifndef _read_unlock 287#ifndef CONFIG_INLINE_READ_UNLOCK
292void __lockfunc _read_unlock(rwlock_t *lock) 288void __lockfunc _read_unlock(rwlock_t *lock)
293{ 289{
294 __read_unlock(lock); 290 __read_unlock(lock);
@@ -296,7 +292,7 @@ void __lockfunc _read_unlock(rwlock_t *lock)
296EXPORT_SYMBOL(_read_unlock); 292EXPORT_SYMBOL(_read_unlock);
297#endif 293#endif
298 294
299#ifndef _spin_unlock_irqrestore 295#ifndef CONFIG_INLINE_SPIN_UNLOCK_IRQRESTORE
300void __lockfunc _spin_unlock_irqrestore(spinlock_t *lock, unsigned long flags) 296void __lockfunc _spin_unlock_irqrestore(spinlock_t *lock, unsigned long flags)
301{ 297{
302 __spin_unlock_irqrestore(lock, flags); 298 __spin_unlock_irqrestore(lock, flags);
@@ -304,7 +300,7 @@ void __lockfunc _spin_unlock_irqrestore(spinlock_t *lock, unsigned long flags)
304EXPORT_SYMBOL(_spin_unlock_irqrestore); 300EXPORT_SYMBOL(_spin_unlock_irqrestore);
305#endif 301#endif
306 302
307#ifndef _spin_unlock_irq 303#ifndef CONFIG_INLINE_SPIN_UNLOCK_IRQ
308void __lockfunc _spin_unlock_irq(spinlock_t *lock) 304void __lockfunc _spin_unlock_irq(spinlock_t *lock)
309{ 305{
310 __spin_unlock_irq(lock); 306 __spin_unlock_irq(lock);
@@ -312,7 +308,7 @@ void __lockfunc _spin_unlock_irq(spinlock_t *lock)
312EXPORT_SYMBOL(_spin_unlock_irq); 308EXPORT_SYMBOL(_spin_unlock_irq);
313#endif 309#endif
314 310
315#ifndef _spin_unlock_bh 311#ifndef CONFIG_INLINE_SPIN_UNLOCK_BH
316void __lockfunc _spin_unlock_bh(spinlock_t *lock) 312void __lockfunc _spin_unlock_bh(spinlock_t *lock)
317{ 313{
318 __spin_unlock_bh(lock); 314 __spin_unlock_bh(lock);
@@ -320,7 +316,7 @@ void __lockfunc _spin_unlock_bh(spinlock_t *lock)
320EXPORT_SYMBOL(_spin_unlock_bh); 316EXPORT_SYMBOL(_spin_unlock_bh);
321#endif 317#endif
322 318
323#ifndef _read_unlock_irqrestore 319#ifndef CONFIG_INLINE_READ_UNLOCK_IRQRESTORE
324void __lockfunc _read_unlock_irqrestore(rwlock_t *lock, unsigned long flags) 320void __lockfunc _read_unlock_irqrestore(rwlock_t *lock, unsigned long flags)
325{ 321{
326 __read_unlock_irqrestore(lock, flags); 322 __read_unlock_irqrestore(lock, flags);
@@ -328,7 +324,7 @@ void __lockfunc _read_unlock_irqrestore(rwlock_t *lock, unsigned long flags)
328EXPORT_SYMBOL(_read_unlock_irqrestore); 324EXPORT_SYMBOL(_read_unlock_irqrestore);
329#endif 325#endif
330 326
331#ifndef _read_unlock_irq 327#ifndef CONFIG_INLINE_READ_UNLOCK_IRQ
332void __lockfunc _read_unlock_irq(rwlock_t *lock) 328void __lockfunc _read_unlock_irq(rwlock_t *lock)
333{ 329{
334 __read_unlock_irq(lock); 330 __read_unlock_irq(lock);
@@ -336,7 +332,7 @@ void __lockfunc _read_unlock_irq(rwlock_t *lock)
336EXPORT_SYMBOL(_read_unlock_irq); 332EXPORT_SYMBOL(_read_unlock_irq);
337#endif 333#endif
338 334
339#ifndef _read_unlock_bh 335#ifndef CONFIG_INLINE_READ_UNLOCK_BH
340void __lockfunc _read_unlock_bh(rwlock_t *lock) 336void __lockfunc _read_unlock_bh(rwlock_t *lock)
341{ 337{
342 __read_unlock_bh(lock); 338 __read_unlock_bh(lock);
@@ -344,7 +340,7 @@ void __lockfunc _read_unlock_bh(rwlock_t *lock)
344EXPORT_SYMBOL(_read_unlock_bh); 340EXPORT_SYMBOL(_read_unlock_bh);
345#endif 341#endif
346 342
347#ifndef _write_unlock_irqrestore 343#ifndef CONFIG_INLINE_WRITE_UNLOCK_IRQRESTORE
348void __lockfunc _write_unlock_irqrestore(rwlock_t *lock, unsigned long flags) 344void __lockfunc _write_unlock_irqrestore(rwlock_t *lock, unsigned long flags)
349{ 345{
350 __write_unlock_irqrestore(lock, flags); 346 __write_unlock_irqrestore(lock, flags);
@@ -352,7 +348,7 @@ void __lockfunc _write_unlock_irqrestore(rwlock_t *lock, unsigned long flags)
352EXPORT_SYMBOL(_write_unlock_irqrestore); 348EXPORT_SYMBOL(_write_unlock_irqrestore);
353#endif 349#endif
354 350
355#ifndef _write_unlock_irq 351#ifndef CONFIG_INLINE_WRITE_UNLOCK_IRQ
356void __lockfunc _write_unlock_irq(rwlock_t *lock) 352void __lockfunc _write_unlock_irq(rwlock_t *lock)
357{ 353{
358 __write_unlock_irq(lock); 354 __write_unlock_irq(lock);
@@ -360,7 +356,7 @@ void __lockfunc _write_unlock_irq(rwlock_t *lock)
360EXPORT_SYMBOL(_write_unlock_irq); 356EXPORT_SYMBOL(_write_unlock_irq);
361#endif 357#endif
362 358
363#ifndef _write_unlock_bh 359#ifndef CONFIG_INLINE_WRITE_UNLOCK_BH
364void __lockfunc _write_unlock_bh(rwlock_t *lock) 360void __lockfunc _write_unlock_bh(rwlock_t *lock)
365{ 361{
366 __write_unlock_bh(lock); 362 __write_unlock_bh(lock);
@@ -368,7 +364,7 @@ void __lockfunc _write_unlock_bh(rwlock_t *lock)
368EXPORT_SYMBOL(_write_unlock_bh); 364EXPORT_SYMBOL(_write_unlock_bh);
369#endif 365#endif
370 366
371#ifndef _spin_trylock_bh 367#ifndef CONFIG_INLINE_SPIN_TRYLOCK_BH
372int __lockfunc _spin_trylock_bh(spinlock_t *lock) 368int __lockfunc _spin_trylock_bh(spinlock_t *lock)
373{ 369{
374 return __spin_trylock_bh(lock); 370 return __spin_trylock_bh(lock);
diff --git a/kernel/srcu.c b/kernel/srcu.c
index b0aeeaf22ce4..818d7d9aa03c 100644
--- a/kernel/srcu.c
+++ b/kernel/srcu.c
@@ -49,6 +49,7 @@ int init_srcu_struct(struct srcu_struct *sp)
49 sp->per_cpu_ref = alloc_percpu(struct srcu_struct_array); 49 sp->per_cpu_ref = alloc_percpu(struct srcu_struct_array);
50 return (sp->per_cpu_ref ? 0 : -ENOMEM); 50 return (sp->per_cpu_ref ? 0 : -ENOMEM);
51} 51}
52EXPORT_SYMBOL_GPL(init_srcu_struct);
52 53
53/* 54/*
54 * srcu_readers_active_idx -- returns approximate number of readers 55 * srcu_readers_active_idx -- returns approximate number of readers
@@ -97,6 +98,7 @@ void cleanup_srcu_struct(struct srcu_struct *sp)
97 free_percpu(sp->per_cpu_ref); 98 free_percpu(sp->per_cpu_ref);
98 sp->per_cpu_ref = NULL; 99 sp->per_cpu_ref = NULL;
99} 100}
101EXPORT_SYMBOL_GPL(cleanup_srcu_struct);
100 102
101/** 103/**
102 * srcu_read_lock - register a new reader for an SRCU-protected structure. 104 * srcu_read_lock - register a new reader for an SRCU-protected structure.
@@ -118,6 +120,7 @@ int srcu_read_lock(struct srcu_struct *sp)
118 preempt_enable(); 120 preempt_enable();
119 return idx; 121 return idx;
120} 122}
123EXPORT_SYMBOL_GPL(srcu_read_lock);
121 124
122/** 125/**
123 * srcu_read_unlock - unregister a old reader from an SRCU-protected structure. 126 * srcu_read_unlock - unregister a old reader from an SRCU-protected structure.
@@ -136,22 +139,12 @@ void srcu_read_unlock(struct srcu_struct *sp, int idx)
136 per_cpu_ptr(sp->per_cpu_ref, smp_processor_id())->c[idx]--; 139 per_cpu_ptr(sp->per_cpu_ref, smp_processor_id())->c[idx]--;
137 preempt_enable(); 140 preempt_enable();
138} 141}
142EXPORT_SYMBOL_GPL(srcu_read_unlock);
139 143
140/** 144/*
141 * synchronize_srcu - wait for prior SRCU read-side critical-section completion 145 * Helper function for synchronize_srcu() and synchronize_srcu_expedited().
142 * @sp: srcu_struct with which to synchronize.
143 *
144 * Flip the completed counter, and wait for the old count to drain to zero.
145 * As with classic RCU, the updater must use some separate means of
146 * synchronizing concurrent updates. Can block; must be called from
147 * process context.
148 *
149 * Note that it is illegal to call synchornize_srcu() from the corresponding
150 * SRCU read-side critical section; doing so will result in deadlock.
151 * However, it is perfectly legal to call synchronize_srcu() on one
152 * srcu_struct from some other srcu_struct's read-side critical section.
153 */ 146 */
154void synchronize_srcu(struct srcu_struct *sp) 147void __synchronize_srcu(struct srcu_struct *sp, void (*sync_func)(void))
155{ 148{
156 int idx; 149 int idx;
157 150
@@ -173,7 +166,7 @@ void synchronize_srcu(struct srcu_struct *sp)
173 return; 166 return;
174 } 167 }
175 168
176 synchronize_sched(); /* Force memory barrier on all CPUs. */ 169 sync_func(); /* Force memory barrier on all CPUs. */
177 170
178 /* 171 /*
179 * The preceding synchronize_sched() ensures that any CPU that 172 * The preceding synchronize_sched() ensures that any CPU that
@@ -190,7 +183,7 @@ void synchronize_srcu(struct srcu_struct *sp)
190 idx = sp->completed & 0x1; 183 idx = sp->completed & 0x1;
191 sp->completed++; 184 sp->completed++;
192 185
193 synchronize_sched(); /* Force memory barrier on all CPUs. */ 186 sync_func(); /* Force memory barrier on all CPUs. */
194 187
195 /* 188 /*
196 * At this point, because of the preceding synchronize_sched(), 189 * At this point, because of the preceding synchronize_sched(),
@@ -203,7 +196,7 @@ void synchronize_srcu(struct srcu_struct *sp)
203 while (srcu_readers_active_idx(sp, idx)) 196 while (srcu_readers_active_idx(sp, idx))
204 schedule_timeout_interruptible(1); 197 schedule_timeout_interruptible(1);
205 198
206 synchronize_sched(); /* Force memory barrier on all CPUs. */ 199 sync_func(); /* Force memory barrier on all CPUs. */
207 200
208 /* 201 /*
209 * The preceding synchronize_sched() forces all srcu_read_unlock() 202 * The preceding synchronize_sched() forces all srcu_read_unlock()
@@ -237,6 +230,47 @@ void synchronize_srcu(struct srcu_struct *sp)
237} 230}
238 231
239/** 232/**
233 * synchronize_srcu - wait for prior SRCU read-side critical-section completion
234 * @sp: srcu_struct with which to synchronize.
235 *
236 * Flip the completed counter, and wait for the old count to drain to zero.
237 * As with classic RCU, the updater must use some separate means of
238 * synchronizing concurrent updates. Can block; must be called from
239 * process context.
240 *
241 * Note that it is illegal to call synchronize_srcu() from the corresponding
242 * SRCU read-side critical section; doing so will result in deadlock.
243 * However, it is perfectly legal to call synchronize_srcu() on one
244 * srcu_struct from some other srcu_struct's read-side critical section.
245 */
246void synchronize_srcu(struct srcu_struct *sp)
247{
248 __synchronize_srcu(sp, synchronize_sched);
249}
250EXPORT_SYMBOL_GPL(synchronize_srcu);
251
252/**
253 * synchronize_srcu_expedited - like synchronize_srcu, but less patient
254 * @sp: srcu_struct with which to synchronize.
255 *
256 * Flip the completed counter, and wait for the old count to drain to zero.
257 * As with classic RCU, the updater must use some separate means of
258 * synchronizing concurrent updates. Can block; must be called from
259 * process context.
260 *
261 * Note that it is illegal to call synchronize_srcu_expedited()
262 * from the corresponding SRCU read-side critical section; doing so
263 * will result in deadlock. However, it is perfectly legal to call
264 * synchronize_srcu_expedited() on one srcu_struct from some other
265 * srcu_struct's read-side critical section.
266 */
267void synchronize_srcu_expedited(struct srcu_struct *sp)
268{
269 __synchronize_srcu(sp, synchronize_sched_expedited);
270}
271EXPORT_SYMBOL_GPL(synchronize_srcu_expedited);
272
273/**
240 * srcu_batches_completed - return batches completed. 274 * srcu_batches_completed - return batches completed.
241 * @sp: srcu_struct on which to report batch completion. 275 * @sp: srcu_struct on which to report batch completion.
242 * 276 *
@@ -248,10 +282,4 @@ long srcu_batches_completed(struct srcu_struct *sp)
248{ 282{
249 return sp->completed; 283 return sp->completed;
250} 284}
251
252EXPORT_SYMBOL_GPL(init_srcu_struct);
253EXPORT_SYMBOL_GPL(cleanup_srcu_struct);
254EXPORT_SYMBOL_GPL(srcu_read_lock);
255EXPORT_SYMBOL_GPL(srcu_read_unlock);
256EXPORT_SYMBOL_GPL(synchronize_srcu);
257EXPORT_SYMBOL_GPL(srcu_batches_completed); 285EXPORT_SYMBOL_GPL(srcu_batches_completed);
diff --git a/kernel/sys.c b/kernel/sys.c
index ce17760d9c51..9968c5fb55b9 100644
--- a/kernel/sys.c
+++ b/kernel/sys.c
@@ -911,16 +911,15 @@ change_okay:
911 911
912void do_sys_times(struct tms *tms) 912void do_sys_times(struct tms *tms)
913{ 913{
914 struct task_cputime cputime; 914 cputime_t tgutime, tgstime, cutime, cstime;
915 cputime_t cutime, cstime;
916 915
917 thread_group_cputime(current, &cputime);
918 spin_lock_irq(&current->sighand->siglock); 916 spin_lock_irq(&current->sighand->siglock);
917 thread_group_times(current, &tgutime, &tgstime);
919 cutime = current->signal->cutime; 918 cutime = current->signal->cutime;
920 cstime = current->signal->cstime; 919 cstime = current->signal->cstime;
921 spin_unlock_irq(&current->sighand->siglock); 920 spin_unlock_irq(&current->sighand->siglock);
922 tms->tms_utime = cputime_to_clock_t(cputime.utime); 921 tms->tms_utime = cputime_to_clock_t(tgutime);
923 tms->tms_stime = cputime_to_clock_t(cputime.stime); 922 tms->tms_stime = cputime_to_clock_t(tgstime);
924 tms->tms_cutime = cputime_to_clock_t(cutime); 923 tms->tms_cutime = cputime_to_clock_t(cutime);
925 tms->tms_cstime = cputime_to_clock_t(cstime); 924 tms->tms_cstime = cputime_to_clock_t(cstime);
926} 925}
@@ -1338,16 +1337,14 @@ static void k_getrusage(struct task_struct *p, int who, struct rusage *r)
1338{ 1337{
1339 struct task_struct *t; 1338 struct task_struct *t;
1340 unsigned long flags; 1339 unsigned long flags;
1341 cputime_t utime, stime; 1340 cputime_t tgutime, tgstime, utime, stime;
1342 struct task_cputime cputime;
1343 unsigned long maxrss = 0; 1341 unsigned long maxrss = 0;
1344 1342
1345 memset((char *) r, 0, sizeof *r); 1343 memset((char *) r, 0, sizeof *r);
1346 utime = stime = cputime_zero; 1344 utime = stime = cputime_zero;
1347 1345
1348 if (who == RUSAGE_THREAD) { 1346 if (who == RUSAGE_THREAD) {
1349 utime = task_utime(current); 1347 task_times(current, &utime, &stime);
1350 stime = task_stime(current);
1351 accumulate_thread_rusage(p, r); 1348 accumulate_thread_rusage(p, r);
1352 maxrss = p->signal->maxrss; 1349 maxrss = p->signal->maxrss;
1353 goto out; 1350 goto out;
@@ -1373,9 +1370,9 @@ static void k_getrusage(struct task_struct *p, int who, struct rusage *r)
1373 break; 1370 break;
1374 1371
1375 case RUSAGE_SELF: 1372 case RUSAGE_SELF:
1376 thread_group_cputime(p, &cputime); 1373 thread_group_times(p, &tgutime, &tgstime);
1377 utime = cputime_add(utime, cputime.utime); 1374 utime = cputime_add(utime, tgutime);
1378 stime = cputime_add(stime, cputime.stime); 1375 stime = cputime_add(stime, tgstime);
1379 r->ru_nvcsw += p->signal->nvcsw; 1376 r->ru_nvcsw += p->signal->nvcsw;
1380 r->ru_nivcsw += p->signal->nivcsw; 1377 r->ru_nivcsw += p->signal->nivcsw;
1381 r->ru_minflt += p->signal->min_flt; 1378 r->ru_minflt += p->signal->min_flt;
diff --git a/kernel/sysctl.c b/kernel/sysctl.c
index 0d949c517412..4dbf93a52ee9 100644
--- a/kernel/sysctl.c
+++ b/kernel/sysctl.c
@@ -36,6 +36,7 @@
36#include <linux/sysrq.h> 36#include <linux/sysrq.h>
37#include <linux/highuid.h> 37#include <linux/highuid.h>
38#include <linux/writeback.h> 38#include <linux/writeback.h>
39#include <linux/ratelimit.h>
39#include <linux/hugetlb.h> 40#include <linux/hugetlb.h>
40#include <linux/initrd.h> 41#include <linux/initrd.h>
41#include <linux/key.h> 42#include <linux/key.h>
@@ -158,6 +159,8 @@ extern int no_unaligned_warning;
158extern int unaligned_dump_stack; 159extern int unaligned_dump_stack;
159#endif 160#endif
160 161
162extern struct ratelimit_state printk_ratelimit_state;
163
161#ifdef CONFIG_RT_MUTEXES 164#ifdef CONFIG_RT_MUTEXES
162extern int max_lock_depth; 165extern int max_lock_depth;
163#endif 166#endif
diff --git a/kernel/time.c b/kernel/time.c
index 2e2e469a7fec..804798005d19 100644
--- a/kernel/time.c
+++ b/kernel/time.c
@@ -662,6 +662,36 @@ u64 nsec_to_clock_t(u64 x)
662#endif 662#endif
663} 663}
664 664
665/**
666 * nsecs_to_jiffies - Convert nsecs in u64 to jiffies
667 *
668 * @n: nsecs in u64
669 *
670 * Unlike {m,u}secs_to_jiffies, type of input is not unsigned int but u64.
671 * And this doesn't return MAX_JIFFY_OFFSET since this function is designed
672 * for scheduler, not for use in device drivers to calculate timeout value.
673 *
674 * note:
675 * NSEC_PER_SEC = 10^9 = (5^9 * 2^9) = (1953125 * 512)
676 * ULLONG_MAX ns = 18446744073.709551615 secs = about 584 years
677 */
678unsigned long nsecs_to_jiffies(u64 n)
679{
680#if (NSEC_PER_SEC % HZ) == 0
681 /* Common case, HZ = 100, 128, 200, 250, 256, 500, 512, 1000 etc. */
682 return div_u64(n, NSEC_PER_SEC / HZ);
683#elif (HZ % 512) == 0
684 /* overflow after 292 years if HZ = 1024 */
685 return div_u64(n * HZ / 512, NSEC_PER_SEC / 512);
686#else
687 /*
688 * Generic case - optimized for cases where HZ is a multiple of 3.
689 * overflow after 64.99 years, exact for HZ = 60, 72, 90, 120 etc.
690 */
691 return div_u64(n * 9, (9ull * NSEC_PER_SEC + HZ / 2) / HZ);
692#endif
693}
694
665#if (BITS_PER_LONG < 64) 695#if (BITS_PER_LONG < 64)
666u64 get_jiffies_64(void) 696u64 get_jiffies_64(void)
667{ 697{
diff --git a/kernel/trace/Kconfig b/kernel/trace/Kconfig
index b416512ad17f..d006554888dc 100644
--- a/kernel/trace/Kconfig
+++ b/kernel/trace/Kconfig
@@ -339,6 +339,27 @@ config POWER_TRACER
339 power management decisions, specifically the C-state and P-state 339 power management decisions, specifically the C-state and P-state
340 behavior. 340 behavior.
341 341
342config KSYM_TRACER
343 bool "Trace read and write access on kernel memory locations"
344 depends on HAVE_HW_BREAKPOINT
345 select TRACING
346 help
347 This tracer helps find read and write operations on any given kernel
348 symbol i.e. /proc/kallsyms.
349
350config PROFILE_KSYM_TRACER
351 bool "Profile all kernel memory accesses on 'watched' variables"
352 depends on KSYM_TRACER
353 help
354 This tracer profiles kernel accesses on variables watched through the
355 ksym tracer ftrace plugin. Depending upon the hardware, all read
356 and write operations on kernel variables can be monitored for
357 accesses.
358
359 The results will be displayed in:
360 /debugfs/tracing/profile_ksym
361
362 Say N if unsure.
342 363
343config STACK_TRACER 364config STACK_TRACER
344 bool "Trace max stack" 365 bool "Trace max stack"
@@ -428,6 +449,23 @@ config BLK_DEV_IO_TRACE
428 449
429 If unsure, say N. 450 If unsure, say N.
430 451
452config KPROBE_EVENT
453 depends on KPROBES
454 depends on X86
455 bool "Enable kprobes-based dynamic events"
456 select TRACING
457 default y
458 help
459 This allows the user to add tracing events (similar to tracepoints) on the fly
460 via the ftrace interface. See Documentation/trace/kprobetrace.txt
461 for more details.
462
463 Those events can be inserted wherever kprobes can probe, and record
464 various register and memory values.
465
466 This option is also required by perf-probe subcommand of perf tools. If
467 you want to use perf tools, this option is strongly recommended.
468
431config DYNAMIC_FTRACE 469config DYNAMIC_FTRACE
432 bool "enable/disable ftrace tracepoints dynamically" 470 bool "enable/disable ftrace tracepoints dynamically"
433 depends on FUNCTION_TRACER 471 depends on FUNCTION_TRACER
diff --git a/kernel/trace/Makefile b/kernel/trace/Makefile
index 26f03ac07c2b..cd9ecd89ec77 100644
--- a/kernel/trace/Makefile
+++ b/kernel/trace/Makefile
@@ -53,6 +53,8 @@ obj-$(CONFIG_EVENT_TRACING) += trace_export.o
53obj-$(CONFIG_FTRACE_SYSCALLS) += trace_syscalls.o 53obj-$(CONFIG_FTRACE_SYSCALLS) += trace_syscalls.o
54obj-$(CONFIG_EVENT_PROFILE) += trace_event_profile.o 54obj-$(CONFIG_EVENT_PROFILE) += trace_event_profile.o
55obj-$(CONFIG_EVENT_TRACING) += trace_events_filter.o 55obj-$(CONFIG_EVENT_TRACING) += trace_events_filter.o
56obj-$(CONFIG_KPROBE_EVENT) += trace_kprobe.o
57obj-$(CONFIG_KSYM_TRACER) += trace_ksym.o
56obj-$(CONFIG_EVENT_TRACING) += power-traces.o 58obj-$(CONFIG_EVENT_TRACING) += power-traces.o
57 59
58libftrace-y := ftrace.o 60libftrace-y := ftrace.o
diff --git a/kernel/trace/ftrace.c b/kernel/trace/ftrace.c
index 9c451a1930b6..e51a1bcb7bed 100644
--- a/kernel/trace/ftrace.c
+++ b/kernel/trace/ftrace.c
@@ -60,6 +60,13 @@ static int last_ftrace_enabled;
60/* Quick disabling of function tracer. */ 60/* Quick disabling of function tracer. */
61int function_trace_stop; 61int function_trace_stop;
62 62
63/* List for set_ftrace_pid's pids. */
64LIST_HEAD(ftrace_pids);
65struct ftrace_pid {
66 struct list_head list;
67 struct pid *pid;
68};
69
63/* 70/*
64 * ftrace_disabled is set when an anomaly is discovered. 71 * ftrace_disabled is set when an anomaly is discovered.
65 * ftrace_disabled is much stronger than ftrace_enabled. 72 * ftrace_disabled is much stronger than ftrace_enabled.
@@ -78,6 +85,10 @@ ftrace_func_t ftrace_trace_function __read_mostly = ftrace_stub;
78ftrace_func_t __ftrace_trace_function __read_mostly = ftrace_stub; 85ftrace_func_t __ftrace_trace_function __read_mostly = ftrace_stub;
79ftrace_func_t ftrace_pid_function __read_mostly = ftrace_stub; 86ftrace_func_t ftrace_pid_function __read_mostly = ftrace_stub;
80 87
88#ifdef CONFIG_FUNCTION_GRAPH_TRACER
89static int ftrace_set_func(unsigned long *array, int *idx, char *buffer);
90#endif
91
81static void ftrace_list_func(unsigned long ip, unsigned long parent_ip) 92static void ftrace_list_func(unsigned long ip, unsigned long parent_ip)
82{ 93{
83 struct ftrace_ops *op = ftrace_list; 94 struct ftrace_ops *op = ftrace_list;
@@ -155,7 +166,7 @@ static int __register_ftrace_function(struct ftrace_ops *ops)
155 else 166 else
156 func = ftrace_list_func; 167 func = ftrace_list_func;
157 168
158 if (ftrace_pid_trace) { 169 if (!list_empty(&ftrace_pids)) {
159 set_ftrace_pid_function(func); 170 set_ftrace_pid_function(func);
160 func = ftrace_pid_func; 171 func = ftrace_pid_func;
161 } 172 }
@@ -203,7 +214,7 @@ static int __unregister_ftrace_function(struct ftrace_ops *ops)
203 if (ftrace_list->next == &ftrace_list_end) { 214 if (ftrace_list->next == &ftrace_list_end) {
204 ftrace_func_t func = ftrace_list->func; 215 ftrace_func_t func = ftrace_list->func;
205 216
206 if (ftrace_pid_trace) { 217 if (!list_empty(&ftrace_pids)) {
207 set_ftrace_pid_function(func); 218 set_ftrace_pid_function(func);
208 func = ftrace_pid_func; 219 func = ftrace_pid_func;
209 } 220 }
@@ -231,7 +242,7 @@ static void ftrace_update_pid_func(void)
231 func = __ftrace_trace_function; 242 func = __ftrace_trace_function;
232#endif 243#endif
233 244
234 if (ftrace_pid_trace) { 245 if (!list_empty(&ftrace_pids)) {
235 set_ftrace_pid_function(func); 246 set_ftrace_pid_function(func);
236 func = ftrace_pid_func; 247 func = ftrace_pid_func;
237 } else { 248 } else {
@@ -821,8 +832,6 @@ static __init void ftrace_profile_debugfs(struct dentry *d_tracer)
821} 832}
822#endif /* CONFIG_FUNCTION_PROFILER */ 833#endif /* CONFIG_FUNCTION_PROFILER */
823 834
824/* set when tracing only a pid */
825struct pid *ftrace_pid_trace;
826static struct pid * const ftrace_swapper_pid = &init_struct_pid; 835static struct pid * const ftrace_swapper_pid = &init_struct_pid;
827 836
828#ifdef CONFIG_DYNAMIC_FTRACE 837#ifdef CONFIG_DYNAMIC_FTRACE
@@ -1261,12 +1270,34 @@ static int ftrace_update_code(struct module *mod)
1261 ftrace_new_addrs = p->newlist; 1270 ftrace_new_addrs = p->newlist;
1262 p->flags = 0L; 1271 p->flags = 0L;
1263 1272
1264 /* convert record (i.e, patch mcount-call with NOP) */ 1273 /*
1265 if (ftrace_code_disable(mod, p)) { 1274 * Do the initial record convertion from mcount jump
1266 p->flags |= FTRACE_FL_CONVERTED; 1275 * to the NOP instructions.
1267 ftrace_update_cnt++; 1276 */
1268 } else 1277 if (!ftrace_code_disable(mod, p)) {
1269 ftrace_free_rec(p); 1278 ftrace_free_rec(p);
1279 continue;
1280 }
1281
1282 p->flags |= FTRACE_FL_CONVERTED;
1283 ftrace_update_cnt++;
1284
1285 /*
1286 * If the tracing is enabled, go ahead and enable the record.
1287 *
1288 * The reason not to enable the record immediatelly is the
1289 * inherent check of ftrace_make_nop/ftrace_make_call for
1290 * correct previous instructions. Making first the NOP
1291 * conversion puts the module to the correct state, thus
1292 * passing the ftrace_make_call check.
1293 */
1294 if (ftrace_start_up) {
1295 int failed = __ftrace_replace_code(p, 1);
1296 if (failed) {
1297 ftrace_bug(failed, p->ip);
1298 ftrace_free_rec(p);
1299 }
1300 }
1270 } 1301 }
1271 1302
1272 stop = ftrace_now(raw_smp_processor_id()); 1303 stop = ftrace_now(raw_smp_processor_id());
@@ -1656,60 +1687,6 @@ ftrace_regex_lseek(struct file *file, loff_t offset, int origin)
1656 return ret; 1687 return ret;
1657} 1688}
1658 1689
1659enum {
1660 MATCH_FULL,
1661 MATCH_FRONT_ONLY,
1662 MATCH_MIDDLE_ONLY,
1663 MATCH_END_ONLY,
1664};
1665
1666/*
1667 * (static function - no need for kernel doc)
1668 *
1669 * Pass in a buffer containing a glob and this function will
1670 * set search to point to the search part of the buffer and
1671 * return the type of search it is (see enum above).
1672 * This does modify buff.
1673 *
1674 * Returns enum type.
1675 * search returns the pointer to use for comparison.
1676 * not returns 1 if buff started with a '!'
1677 * 0 otherwise.
1678 */
1679static int
1680ftrace_setup_glob(char *buff, int len, char **search, int *not)
1681{
1682 int type = MATCH_FULL;
1683 int i;
1684
1685 if (buff[0] == '!') {
1686 *not = 1;
1687 buff++;
1688 len--;
1689 } else
1690 *not = 0;
1691
1692 *search = buff;
1693
1694 for (i = 0; i < len; i++) {
1695 if (buff[i] == '*') {
1696 if (!i) {
1697 *search = buff + 1;
1698 type = MATCH_END_ONLY;
1699 } else {
1700 if (type == MATCH_END_ONLY)
1701 type = MATCH_MIDDLE_ONLY;
1702 else
1703 type = MATCH_FRONT_ONLY;
1704 buff[i] = 0;
1705 break;
1706 }
1707 }
1708 }
1709
1710 return type;
1711}
1712
1713static int ftrace_match(char *str, char *regex, int len, int type) 1690static int ftrace_match(char *str, char *regex, int len, int type)
1714{ 1691{
1715 int matched = 0; 1692 int matched = 0;
@@ -1758,7 +1735,7 @@ static void ftrace_match_records(char *buff, int len, int enable)
1758 int not; 1735 int not;
1759 1736
1760 flag = enable ? FTRACE_FL_FILTER : FTRACE_FL_NOTRACE; 1737 flag = enable ? FTRACE_FL_FILTER : FTRACE_FL_NOTRACE;
1761 type = ftrace_setup_glob(buff, len, &search, &not); 1738 type = filter_parse_regex(buff, len, &search, &not);
1762 1739
1763 search_len = strlen(search); 1740 search_len = strlen(search);
1764 1741
@@ -1826,7 +1803,7 @@ static void ftrace_match_module_records(char *buff, char *mod, int enable)
1826 } 1803 }
1827 1804
1828 if (strlen(buff)) { 1805 if (strlen(buff)) {
1829 type = ftrace_setup_glob(buff, strlen(buff), &search, &not); 1806 type = filter_parse_regex(buff, strlen(buff), &search, &not);
1830 search_len = strlen(search); 1807 search_len = strlen(search);
1831 } 1808 }
1832 1809
@@ -1991,7 +1968,7 @@ register_ftrace_function_probe(char *glob, struct ftrace_probe_ops *ops,
1991 int count = 0; 1968 int count = 0;
1992 char *search; 1969 char *search;
1993 1970
1994 type = ftrace_setup_glob(glob, strlen(glob), &search, &not); 1971 type = filter_parse_regex(glob, strlen(glob), &search, &not);
1995 len = strlen(search); 1972 len = strlen(search);
1996 1973
1997 /* we do not support '!' for function probes */ 1974 /* we do not support '!' for function probes */
@@ -2068,7 +2045,7 @@ __unregister_ftrace_function_probe(char *glob, struct ftrace_probe_ops *ops,
2068 else if (glob) { 2045 else if (glob) {
2069 int not; 2046 int not;
2070 2047
2071 type = ftrace_setup_glob(glob, strlen(glob), &search, &not); 2048 type = filter_parse_regex(glob, strlen(glob), &search, &not);
2072 len = strlen(search); 2049 len = strlen(search);
2073 2050
2074 /* we do not support '!' for function probes */ 2051 /* we do not support '!' for function probes */
@@ -2222,15 +2199,15 @@ ftrace_regex_write(struct file *file, const char __user *ubuf,
2222 ret = ftrace_process_regex(parser->buffer, 2199 ret = ftrace_process_regex(parser->buffer,
2223 parser->idx, enable); 2200 parser->idx, enable);
2224 if (ret) 2201 if (ret)
2225 goto out; 2202 goto out_unlock;
2226 2203
2227 trace_parser_clear(parser); 2204 trace_parser_clear(parser);
2228 } 2205 }
2229 2206
2230 ret = read; 2207 ret = read;
2231 2208out_unlock:
2232 mutex_unlock(&ftrace_regex_lock); 2209 mutex_unlock(&ftrace_regex_lock);
2233out: 2210
2234 return ret; 2211 return ret;
2235} 2212}
2236 2213
@@ -2312,6 +2289,32 @@ static int __init set_ftrace_filter(char *str)
2312} 2289}
2313__setup("ftrace_filter=", set_ftrace_filter); 2290__setup("ftrace_filter=", set_ftrace_filter);
2314 2291
2292#ifdef CONFIG_FUNCTION_GRAPH_TRACER
2293static char ftrace_graph_buf[FTRACE_FILTER_SIZE] __initdata;
2294static int __init set_graph_function(char *str)
2295{
2296 strlcpy(ftrace_graph_buf, str, FTRACE_FILTER_SIZE);
2297 return 1;
2298}
2299__setup("ftrace_graph_filter=", set_graph_function);
2300
2301static void __init set_ftrace_early_graph(char *buf)
2302{
2303 int ret;
2304 char *func;
2305
2306 while (buf) {
2307 func = strsep(&buf, ",");
2308 /* we allow only one expression at a time */
2309 ret = ftrace_set_func(ftrace_graph_funcs, &ftrace_graph_count,
2310 func);
2311 if (ret)
2312 printk(KERN_DEBUG "ftrace: function %s not "
2313 "traceable\n", func);
2314 }
2315}
2316#endif /* CONFIG_FUNCTION_GRAPH_TRACER */
2317
2315static void __init set_ftrace_early_filter(char *buf, int enable) 2318static void __init set_ftrace_early_filter(char *buf, int enable)
2316{ 2319{
2317 char *func; 2320 char *func;
@@ -2328,6 +2331,10 @@ static void __init set_ftrace_early_filters(void)
2328 set_ftrace_early_filter(ftrace_filter_buf, 1); 2331 set_ftrace_early_filter(ftrace_filter_buf, 1);
2329 if (ftrace_notrace_buf[0]) 2332 if (ftrace_notrace_buf[0])
2330 set_ftrace_early_filter(ftrace_notrace_buf, 0); 2333 set_ftrace_early_filter(ftrace_notrace_buf, 0);
2334#ifdef CONFIG_FUNCTION_GRAPH_TRACER
2335 if (ftrace_graph_buf[0])
2336 set_ftrace_early_graph(ftrace_graph_buf);
2337#endif /* CONFIG_FUNCTION_GRAPH_TRACER */
2331} 2338}
2332 2339
2333static int 2340static int
@@ -2513,7 +2520,7 @@ ftrace_set_func(unsigned long *array, int *idx, char *buffer)
2513 return -ENODEV; 2520 return -ENODEV;
2514 2521
2515 /* decode regex */ 2522 /* decode regex */
2516 type = ftrace_setup_glob(buffer, strlen(buffer), &search, &not); 2523 type = filter_parse_regex(buffer, strlen(buffer), &search, &not);
2517 if (not) 2524 if (not)
2518 return -EINVAL; 2525 return -EINVAL;
2519 2526
@@ -2624,7 +2631,7 @@ static __init int ftrace_init_dyn_debugfs(struct dentry *d_tracer)
2624 return 0; 2631 return 0;
2625} 2632}
2626 2633
2627static int ftrace_convert_nops(struct module *mod, 2634static int ftrace_process_locs(struct module *mod,
2628 unsigned long *start, 2635 unsigned long *start,
2629 unsigned long *end) 2636 unsigned long *end)
2630{ 2637{
@@ -2684,7 +2691,7 @@ static void ftrace_init_module(struct module *mod,
2684{ 2691{
2685 if (ftrace_disabled || start == end) 2692 if (ftrace_disabled || start == end)
2686 return; 2693 return;
2687 ftrace_convert_nops(mod, start, end); 2694 ftrace_process_locs(mod, start, end);
2688} 2695}
2689 2696
2690static int ftrace_module_notify(struct notifier_block *self, 2697static int ftrace_module_notify(struct notifier_block *self,
@@ -2745,7 +2752,7 @@ void __init ftrace_init(void)
2745 2752
2746 last_ftrace_enabled = ftrace_enabled = 1; 2753 last_ftrace_enabled = ftrace_enabled = 1;
2747 2754
2748 ret = ftrace_convert_nops(NULL, 2755 ret = ftrace_process_locs(NULL,
2749 __start_mcount_loc, 2756 __start_mcount_loc,
2750 __stop_mcount_loc); 2757 __stop_mcount_loc);
2751 2758
@@ -2778,23 +2785,6 @@ static inline void ftrace_startup_enable(int command) { }
2778# define ftrace_shutdown_sysctl() do { } while (0) 2785# define ftrace_shutdown_sysctl() do { } while (0)
2779#endif /* CONFIG_DYNAMIC_FTRACE */ 2786#endif /* CONFIG_DYNAMIC_FTRACE */
2780 2787
2781static ssize_t
2782ftrace_pid_read(struct file *file, char __user *ubuf,
2783 size_t cnt, loff_t *ppos)
2784{
2785 char buf[64];
2786 int r;
2787
2788 if (ftrace_pid_trace == ftrace_swapper_pid)
2789 r = sprintf(buf, "swapper tasks\n");
2790 else if (ftrace_pid_trace)
2791 r = sprintf(buf, "%u\n", pid_vnr(ftrace_pid_trace));
2792 else
2793 r = sprintf(buf, "no pid\n");
2794
2795 return simple_read_from_buffer(ubuf, cnt, ppos, buf, r);
2796}
2797
2798static void clear_ftrace_swapper(void) 2788static void clear_ftrace_swapper(void)
2799{ 2789{
2800 struct task_struct *p; 2790 struct task_struct *p;
@@ -2845,14 +2835,12 @@ static void set_ftrace_pid(struct pid *pid)
2845 rcu_read_unlock(); 2835 rcu_read_unlock();
2846} 2836}
2847 2837
2848static void clear_ftrace_pid_task(struct pid **pid) 2838static void clear_ftrace_pid_task(struct pid *pid)
2849{ 2839{
2850 if (*pid == ftrace_swapper_pid) 2840 if (pid == ftrace_swapper_pid)
2851 clear_ftrace_swapper(); 2841 clear_ftrace_swapper();
2852 else 2842 else
2853 clear_ftrace_pid(*pid); 2843 clear_ftrace_pid(pid);
2854
2855 *pid = NULL;
2856} 2844}
2857 2845
2858static void set_ftrace_pid_task(struct pid *pid) 2846static void set_ftrace_pid_task(struct pid *pid)
@@ -2863,74 +2851,184 @@ static void set_ftrace_pid_task(struct pid *pid)
2863 set_ftrace_pid(pid); 2851 set_ftrace_pid(pid);
2864} 2852}
2865 2853
2866static ssize_t 2854static int ftrace_pid_add(int p)
2867ftrace_pid_write(struct file *filp, const char __user *ubuf,
2868 size_t cnt, loff_t *ppos)
2869{ 2855{
2870 struct pid *pid; 2856 struct pid *pid;
2871 char buf[64]; 2857 struct ftrace_pid *fpid;
2872 long val; 2858 int ret = -EINVAL;
2873 int ret;
2874 2859
2875 if (cnt >= sizeof(buf)) 2860 mutex_lock(&ftrace_lock);
2876 return -EINVAL;
2877 2861
2878 if (copy_from_user(&buf, ubuf, cnt)) 2862 if (!p)
2879 return -EFAULT; 2863 pid = ftrace_swapper_pid;
2864 else
2865 pid = find_get_pid(p);
2880 2866
2881 buf[cnt] = 0; 2867 if (!pid)
2868 goto out;
2882 2869
2883 ret = strict_strtol(buf, 10, &val); 2870 ret = 0;
2884 if (ret < 0)
2885 return ret;
2886 2871
2887 mutex_lock(&ftrace_lock); 2872 list_for_each_entry(fpid, &ftrace_pids, list)
2888 if (val < 0) { 2873 if (fpid->pid == pid)
2889 /* disable pid tracing */ 2874 goto out_put;
2890 if (!ftrace_pid_trace)
2891 goto out;
2892 2875
2893 clear_ftrace_pid_task(&ftrace_pid_trace); 2876 ret = -ENOMEM;
2894 2877
2895 } else { 2878 fpid = kmalloc(sizeof(*fpid), GFP_KERNEL);
2896 /* swapper task is special */ 2879 if (!fpid)
2897 if (!val) { 2880 goto out_put;
2898 pid = ftrace_swapper_pid;
2899 if (pid == ftrace_pid_trace)
2900 goto out;
2901 } else {
2902 pid = find_get_pid(val);
2903 2881
2904 if (pid == ftrace_pid_trace) { 2882 list_add(&fpid->list, &ftrace_pids);
2905 put_pid(pid); 2883 fpid->pid = pid;
2906 goto out;
2907 }
2908 }
2909 2884
2910 if (ftrace_pid_trace) 2885 set_ftrace_pid_task(pid);
2911 clear_ftrace_pid_task(&ftrace_pid_trace);
2912 2886
2913 if (!pid) 2887 ftrace_update_pid_func();
2914 goto out; 2888 ftrace_startup_enable(0);
2889
2890 mutex_unlock(&ftrace_lock);
2891 return 0;
2892
2893out_put:
2894 if (pid != ftrace_swapper_pid)
2895 put_pid(pid);
2896
2897out:
2898 mutex_unlock(&ftrace_lock);
2899 return ret;
2900}
2901
2902static void ftrace_pid_reset(void)
2903{
2904 struct ftrace_pid *fpid, *safe;
2905
2906 mutex_lock(&ftrace_lock);
2907 list_for_each_entry_safe(fpid, safe, &ftrace_pids, list) {
2908 struct pid *pid = fpid->pid;
2915 2909
2916 ftrace_pid_trace = pid; 2910 clear_ftrace_pid_task(pid);
2917 2911
2918 set_ftrace_pid_task(ftrace_pid_trace); 2912 list_del(&fpid->list);
2913 kfree(fpid);
2919 } 2914 }
2920 2915
2921 /* update the function call */
2922 ftrace_update_pid_func(); 2916 ftrace_update_pid_func();
2923 ftrace_startup_enable(0); 2917 ftrace_startup_enable(0);
2924 2918
2925 out:
2926 mutex_unlock(&ftrace_lock); 2919 mutex_unlock(&ftrace_lock);
2920}
2927 2921
2928 return cnt; 2922static void *fpid_start(struct seq_file *m, loff_t *pos)
2923{
2924 mutex_lock(&ftrace_lock);
2925
2926 if (list_empty(&ftrace_pids) && (!*pos))
2927 return (void *) 1;
2928
2929 return seq_list_start(&ftrace_pids, *pos);
2930}
2931
2932static void *fpid_next(struct seq_file *m, void *v, loff_t *pos)
2933{
2934 if (v == (void *)1)
2935 return NULL;
2936
2937 return seq_list_next(v, &ftrace_pids, pos);
2938}
2939
2940static void fpid_stop(struct seq_file *m, void *p)
2941{
2942 mutex_unlock(&ftrace_lock);
2943}
2944
2945static int fpid_show(struct seq_file *m, void *v)
2946{
2947 const struct ftrace_pid *fpid = list_entry(v, struct ftrace_pid, list);
2948
2949 if (v == (void *)1) {
2950 seq_printf(m, "no pid\n");
2951 return 0;
2952 }
2953
2954 if (fpid->pid == ftrace_swapper_pid)
2955 seq_printf(m, "swapper tasks\n");
2956 else
2957 seq_printf(m, "%u\n", pid_vnr(fpid->pid));
2958
2959 return 0;
2960}
2961
2962static const struct seq_operations ftrace_pid_sops = {
2963 .start = fpid_start,
2964 .next = fpid_next,
2965 .stop = fpid_stop,
2966 .show = fpid_show,
2967};
2968
2969static int
2970ftrace_pid_open(struct inode *inode, struct file *file)
2971{
2972 int ret = 0;
2973
2974 if ((file->f_mode & FMODE_WRITE) &&
2975 (file->f_flags & O_TRUNC))
2976 ftrace_pid_reset();
2977
2978 if (file->f_mode & FMODE_READ)
2979 ret = seq_open(file, &ftrace_pid_sops);
2980
2981 return ret;
2982}
2983
2984static ssize_t
2985ftrace_pid_write(struct file *filp, const char __user *ubuf,
2986 size_t cnt, loff_t *ppos)
2987{
2988 char buf[64], *tmp;
2989 long val;
2990 int ret;
2991
2992 if (cnt >= sizeof(buf))
2993 return -EINVAL;
2994
2995 if (copy_from_user(&buf, ubuf, cnt))
2996 return -EFAULT;
2997
2998 buf[cnt] = 0;
2999
3000 /*
3001 * Allow "echo > set_ftrace_pid" or "echo -n '' > set_ftrace_pid"
3002 * to clean the filter quietly.
3003 */
3004 tmp = strstrip(buf);
3005 if (strlen(tmp) == 0)
3006 return 1;
3007
3008 ret = strict_strtol(tmp, 10, &val);
3009 if (ret < 0)
3010 return ret;
3011
3012 ret = ftrace_pid_add(val);
3013
3014 return ret ? ret : cnt;
3015}
3016
3017static int
3018ftrace_pid_release(struct inode *inode, struct file *file)
3019{
3020 if (file->f_mode & FMODE_READ)
3021 seq_release(inode, file);
3022
3023 return 0;
2929} 3024}
2930 3025
2931static const struct file_operations ftrace_pid_fops = { 3026static const struct file_operations ftrace_pid_fops = {
2932 .read = ftrace_pid_read, 3027 .open = ftrace_pid_open,
2933 .write = ftrace_pid_write, 3028 .write = ftrace_pid_write,
3029 .read = seq_read,
3030 .llseek = seq_lseek,
3031 .release = ftrace_pid_release,
2934}; 3032};
2935 3033
2936static __init int ftrace_init_debugfs(void) 3034static __init int ftrace_init_debugfs(void)
@@ -3293,4 +3391,3 @@ void ftrace_graph_stop(void)
3293 ftrace_stop(); 3391 ftrace_stop();
3294} 3392}
3295#endif 3393#endif
3296
diff --git a/kernel/trace/ring_buffer.c b/kernel/trace/ring_buffer.c
index 3ffa502fb243..a1ca4956ab5e 100644
--- a/kernel/trace/ring_buffer.c
+++ b/kernel/trace/ring_buffer.c
@@ -397,18 +397,21 @@ int ring_buffer_print_page_header(struct trace_seq *s)
397 int ret; 397 int ret;
398 398
399 ret = trace_seq_printf(s, "\tfield: u64 timestamp;\t" 399 ret = trace_seq_printf(s, "\tfield: u64 timestamp;\t"
400 "offset:0;\tsize:%u;\n", 400 "offset:0;\tsize:%u;\tsigned:%u;\n",
401 (unsigned int)sizeof(field.time_stamp)); 401 (unsigned int)sizeof(field.time_stamp),
402 (unsigned int)is_signed_type(u64));
402 403
403 ret = trace_seq_printf(s, "\tfield: local_t commit;\t" 404 ret = trace_seq_printf(s, "\tfield: local_t commit;\t"
404 "offset:%u;\tsize:%u;\n", 405 "offset:%u;\tsize:%u;\tsigned:%u;\n",
405 (unsigned int)offsetof(typeof(field), commit), 406 (unsigned int)offsetof(typeof(field), commit),
406 (unsigned int)sizeof(field.commit)); 407 (unsigned int)sizeof(field.commit),
408 (unsigned int)is_signed_type(long));
407 409
408 ret = trace_seq_printf(s, "\tfield: char data;\t" 410 ret = trace_seq_printf(s, "\tfield: char data;\t"
409 "offset:%u;\tsize:%u;\n", 411 "offset:%u;\tsize:%u;\tsigned:%u;\n",
410 (unsigned int)offsetof(typeof(field), data), 412 (unsigned int)offsetof(typeof(field), data),
411 (unsigned int)BUF_PAGE_SIZE); 413 (unsigned int)BUF_PAGE_SIZE,
414 (unsigned int)is_signed_type(char));
412 415
413 return ret; 416 return ret;
414} 417}
@@ -1193,6 +1196,7 @@ rb_remove_pages(struct ring_buffer_per_cpu *cpu_buffer, unsigned nr_pages)
1193 atomic_inc(&cpu_buffer->record_disabled); 1196 atomic_inc(&cpu_buffer->record_disabled);
1194 synchronize_sched(); 1197 synchronize_sched();
1195 1198
1199 spin_lock_irq(&cpu_buffer->reader_lock);
1196 rb_head_page_deactivate(cpu_buffer); 1200 rb_head_page_deactivate(cpu_buffer);
1197 1201
1198 for (i = 0; i < nr_pages; i++) { 1202 for (i = 0; i < nr_pages; i++) {
@@ -1207,6 +1211,7 @@ rb_remove_pages(struct ring_buffer_per_cpu *cpu_buffer, unsigned nr_pages)
1207 return; 1211 return;
1208 1212
1209 rb_reset_cpu(cpu_buffer); 1213 rb_reset_cpu(cpu_buffer);
1214 spin_unlock_irq(&cpu_buffer->reader_lock);
1210 1215
1211 rb_check_pages(cpu_buffer); 1216 rb_check_pages(cpu_buffer);
1212 1217
@@ -1785,9 +1790,9 @@ rb_reset_tail(struct ring_buffer_per_cpu *cpu_buffer,
1785static struct ring_buffer_event * 1790static struct ring_buffer_event *
1786rb_move_tail(struct ring_buffer_per_cpu *cpu_buffer, 1791rb_move_tail(struct ring_buffer_per_cpu *cpu_buffer,
1787 unsigned long length, unsigned long tail, 1792 unsigned long length, unsigned long tail,
1788 struct buffer_page *commit_page,
1789 struct buffer_page *tail_page, u64 *ts) 1793 struct buffer_page *tail_page, u64 *ts)
1790{ 1794{
1795 struct buffer_page *commit_page = cpu_buffer->commit_page;
1791 struct ring_buffer *buffer = cpu_buffer->buffer; 1796 struct ring_buffer *buffer = cpu_buffer->buffer;
1792 struct buffer_page *next_page; 1797 struct buffer_page *next_page;
1793 int ret; 1798 int ret;
@@ -1890,13 +1895,10 @@ static struct ring_buffer_event *
1890__rb_reserve_next(struct ring_buffer_per_cpu *cpu_buffer, 1895__rb_reserve_next(struct ring_buffer_per_cpu *cpu_buffer,
1891 unsigned type, unsigned long length, u64 *ts) 1896 unsigned type, unsigned long length, u64 *ts)
1892{ 1897{
1893 struct buffer_page *tail_page, *commit_page; 1898 struct buffer_page *tail_page;
1894 struct ring_buffer_event *event; 1899 struct ring_buffer_event *event;
1895 unsigned long tail, write; 1900 unsigned long tail, write;
1896 1901
1897 commit_page = cpu_buffer->commit_page;
1898 /* we just need to protect against interrupts */
1899 barrier();
1900 tail_page = cpu_buffer->tail_page; 1902 tail_page = cpu_buffer->tail_page;
1901 write = local_add_return(length, &tail_page->write); 1903 write = local_add_return(length, &tail_page->write);
1902 1904
@@ -1907,7 +1909,7 @@ __rb_reserve_next(struct ring_buffer_per_cpu *cpu_buffer,
1907 /* See if we shot pass the end of this buffer page */ 1909 /* See if we shot pass the end of this buffer page */
1908 if (write > BUF_PAGE_SIZE) 1910 if (write > BUF_PAGE_SIZE)
1909 return rb_move_tail(cpu_buffer, length, tail, 1911 return rb_move_tail(cpu_buffer, length, tail,
1910 commit_page, tail_page, ts); 1912 tail_page, ts);
1911 1913
1912 /* We reserved something on the buffer */ 1914 /* We reserved something on the buffer */
1913 1915
diff --git a/kernel/trace/ring_buffer_benchmark.c b/kernel/trace/ring_buffer_benchmark.c
index 573d3cc762c3..b2477caf09c2 100644
--- a/kernel/trace/ring_buffer_benchmark.c
+++ b/kernel/trace/ring_buffer_benchmark.c
@@ -35,6 +35,28 @@ static int disable_reader;
35module_param(disable_reader, uint, 0644); 35module_param(disable_reader, uint, 0644);
36MODULE_PARM_DESC(disable_reader, "only run producer"); 36MODULE_PARM_DESC(disable_reader, "only run producer");
37 37
38static int write_iteration = 50;
39module_param(write_iteration, uint, 0644);
40MODULE_PARM_DESC(write_iteration, "# of writes between timestamp readings");
41
42static int producer_nice = 19;
43static int consumer_nice = 19;
44
45static int producer_fifo = -1;
46static int consumer_fifo = -1;
47
48module_param(producer_nice, uint, 0644);
49MODULE_PARM_DESC(producer_nice, "nice prio for producer");
50
51module_param(consumer_nice, uint, 0644);
52MODULE_PARM_DESC(consumer_nice, "nice prio for consumer");
53
54module_param(producer_fifo, uint, 0644);
55MODULE_PARM_DESC(producer_fifo, "fifo prio for producer");
56
57module_param(consumer_fifo, uint, 0644);
58MODULE_PARM_DESC(consumer_fifo, "fifo prio for consumer");
59
38static int read_events; 60static int read_events;
39 61
40static int kill_test; 62static int kill_test;
@@ -208,15 +230,18 @@ static void ring_buffer_producer(void)
208 do { 230 do {
209 struct ring_buffer_event *event; 231 struct ring_buffer_event *event;
210 int *entry; 232 int *entry;
211 233 int i;
212 event = ring_buffer_lock_reserve(buffer, 10); 234
213 if (!event) { 235 for (i = 0; i < write_iteration; i++) {
214 missed++; 236 event = ring_buffer_lock_reserve(buffer, 10);
215 } else { 237 if (!event) {
216 hit++; 238 missed++;
217 entry = ring_buffer_event_data(event); 239 } else {
218 *entry = smp_processor_id(); 240 hit++;
219 ring_buffer_unlock_commit(buffer, event); 241 entry = ring_buffer_event_data(event);
242 *entry = smp_processor_id();
243 ring_buffer_unlock_commit(buffer, event);
244 }
220 } 245 }
221 do_gettimeofday(&end_tv); 246 do_gettimeofday(&end_tv);
222 247
@@ -263,6 +288,27 @@ static void ring_buffer_producer(void)
263 288
264 if (kill_test) 289 if (kill_test)
265 trace_printk("ERROR!\n"); 290 trace_printk("ERROR!\n");
291
292 if (!disable_reader) {
293 if (consumer_fifo < 0)
294 trace_printk("Running Consumer at nice: %d\n",
295 consumer_nice);
296 else
297 trace_printk("Running Consumer at SCHED_FIFO %d\n",
298 consumer_fifo);
299 }
300 if (producer_fifo < 0)
301 trace_printk("Running Producer at nice: %d\n",
302 producer_nice);
303 else
304 trace_printk("Running Producer at SCHED_FIFO %d\n",
305 producer_fifo);
306
307 /* Let the user know that the test is running at low priority */
308 if (producer_fifo < 0 && consumer_fifo < 0 &&
309 producer_nice == 19 && consumer_nice == 19)
310 trace_printk("WARNING!!! This test is running at lowest priority.\n");
311
266 trace_printk("Time: %lld (usecs)\n", time); 312 trace_printk("Time: %lld (usecs)\n", time);
267 trace_printk("Overruns: %lld\n", overruns); 313 trace_printk("Overruns: %lld\n", overruns);
268 if (disable_reader) 314 if (disable_reader)
@@ -392,6 +438,27 @@ static int __init ring_buffer_benchmark_init(void)
392 if (IS_ERR(producer)) 438 if (IS_ERR(producer))
393 goto out_kill; 439 goto out_kill;
394 440
441 /*
442 * Run them as low-prio background tasks by default:
443 */
444 if (!disable_reader) {
445 if (consumer_fifo >= 0) {
446 struct sched_param param = {
447 .sched_priority = consumer_fifo
448 };
449 sched_setscheduler(consumer, SCHED_FIFO, &param);
450 } else
451 set_user_nice(consumer, consumer_nice);
452 }
453
454 if (producer_fifo >= 0) {
455 struct sched_param param = {
456 .sched_priority = consumer_fifo
457 };
458 sched_setscheduler(producer, SCHED_FIFO, &param);
459 } else
460 set_user_nice(producer, producer_nice);
461
395 return 0; 462 return 0;
396 463
397 out_kill: 464 out_kill:
diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c
index b20d3ec75de9..874f2893cff0 100644
--- a/kernel/trace/trace.c
+++ b/kernel/trace/trace.c
@@ -129,7 +129,7 @@ static int tracing_set_tracer(const char *buf);
129static char bootup_tracer_buf[MAX_TRACER_SIZE] __initdata; 129static char bootup_tracer_buf[MAX_TRACER_SIZE] __initdata;
130static char *default_bootup_tracer; 130static char *default_bootup_tracer;
131 131
132static int __init set_ftrace(char *str) 132static int __init set_cmdline_ftrace(char *str)
133{ 133{
134 strncpy(bootup_tracer_buf, str, MAX_TRACER_SIZE); 134 strncpy(bootup_tracer_buf, str, MAX_TRACER_SIZE);
135 default_bootup_tracer = bootup_tracer_buf; 135 default_bootup_tracer = bootup_tracer_buf;
@@ -137,7 +137,7 @@ static int __init set_ftrace(char *str)
137 ring_buffer_expanded = 1; 137 ring_buffer_expanded = 1;
138 return 1; 138 return 1;
139} 139}
140__setup("ftrace=", set_ftrace); 140__setup("ftrace=", set_cmdline_ftrace);
141 141
142static int __init set_ftrace_dump_on_oops(char *str) 142static int __init set_ftrace_dump_on_oops(char *str)
143{ 143{
@@ -1361,10 +1361,11 @@ int trace_array_vprintk(struct trace_array *tr,
1361 pause_graph_tracing(); 1361 pause_graph_tracing();
1362 raw_local_irq_save(irq_flags); 1362 raw_local_irq_save(irq_flags);
1363 __raw_spin_lock(&trace_buf_lock); 1363 __raw_spin_lock(&trace_buf_lock);
1364 len = vsnprintf(trace_buf, TRACE_BUF_SIZE, fmt, args); 1364 if (args == NULL) {
1365 1365 strncpy(trace_buf, fmt, TRACE_BUF_SIZE);
1366 len = min(len, TRACE_BUF_SIZE-1); 1366 len = strlen(trace_buf);
1367 trace_buf[len] = 0; 1367 } else
1368 len = vsnprintf(trace_buf, TRACE_BUF_SIZE, fmt, args);
1368 1369
1369 size = sizeof(*entry) + len + 1; 1370 size = sizeof(*entry) + len + 1;
1370 buffer = tr->buffer; 1371 buffer = tr->buffer;
@@ -1373,10 +1374,10 @@ int trace_array_vprintk(struct trace_array *tr,
1373 if (!event) 1374 if (!event)
1374 goto out_unlock; 1375 goto out_unlock;
1375 entry = ring_buffer_event_data(event); 1376 entry = ring_buffer_event_data(event);
1376 entry->ip = ip; 1377 entry->ip = ip;
1377 1378
1378 memcpy(&entry->buf, trace_buf, len); 1379 memcpy(&entry->buf, trace_buf, len);
1379 entry->buf[len] = 0; 1380 entry->buf[len] = '\0';
1380 if (!filter_check_discard(call, entry, buffer, event)) 1381 if (!filter_check_discard(call, entry, buffer, event))
1381 ring_buffer_unlock_commit(buffer, event); 1382 ring_buffer_unlock_commit(buffer, event);
1382 1383
@@ -3319,22 +3320,11 @@ tracing_entries_write(struct file *filp, const char __user *ubuf,
3319 return cnt; 3320 return cnt;
3320} 3321}
3321 3322
3322static int mark_printk(const char *fmt, ...)
3323{
3324 int ret;
3325 va_list args;
3326 va_start(args, fmt);
3327 ret = trace_vprintk(0, fmt, args);
3328 va_end(args);
3329 return ret;
3330}
3331
3332static ssize_t 3323static ssize_t
3333tracing_mark_write(struct file *filp, const char __user *ubuf, 3324tracing_mark_write(struct file *filp, const char __user *ubuf,
3334 size_t cnt, loff_t *fpos) 3325 size_t cnt, loff_t *fpos)
3335{ 3326{
3336 char *buf; 3327 char *buf;
3337 char *end;
3338 3328
3339 if (tracing_disabled) 3329 if (tracing_disabled)
3340 return -EINVAL; 3330 return -EINVAL;
@@ -3342,7 +3332,7 @@ tracing_mark_write(struct file *filp, const char __user *ubuf,
3342 if (cnt > TRACE_BUF_SIZE) 3332 if (cnt > TRACE_BUF_SIZE)
3343 cnt = TRACE_BUF_SIZE; 3333 cnt = TRACE_BUF_SIZE;
3344 3334
3345 buf = kmalloc(cnt + 1, GFP_KERNEL); 3335 buf = kmalloc(cnt + 2, GFP_KERNEL);
3346 if (buf == NULL) 3336 if (buf == NULL)
3347 return -ENOMEM; 3337 return -ENOMEM;
3348 3338
@@ -3350,14 +3340,13 @@ tracing_mark_write(struct file *filp, const char __user *ubuf,
3350 kfree(buf); 3340 kfree(buf);
3351 return -EFAULT; 3341 return -EFAULT;
3352 } 3342 }
3343 if (buf[cnt-1] != '\n') {
3344 buf[cnt] = '\n';
3345 buf[cnt+1] = '\0';
3346 } else
3347 buf[cnt] = '\0';
3353 3348
3354 /* Cut from the first nil or newline. */ 3349 cnt = trace_vprintk(0, buf, NULL);
3355 buf[cnt] = '\0';
3356 end = strchr(buf, '\n');
3357 if (end)
3358 *end = '\0';
3359
3360 cnt = mark_printk("%s\n", buf);
3361 kfree(buf); 3350 kfree(buf);
3362 *fpos += cnt; 3351 *fpos += cnt;
3363 3352
@@ -3730,7 +3719,7 @@ tracing_stats_read(struct file *filp, char __user *ubuf,
3730 3719
3731 s = kmalloc(sizeof(*s), GFP_KERNEL); 3720 s = kmalloc(sizeof(*s), GFP_KERNEL);
3732 if (!s) 3721 if (!s)
3733 return ENOMEM; 3722 return -ENOMEM;
3734 3723
3735 trace_seq_init(s); 3724 trace_seq_init(s);
3736 3725
diff --git a/kernel/trace/trace.h b/kernel/trace/trace.h
index 405cb850b75d..1d7f4830a80d 100644
--- a/kernel/trace/trace.h
+++ b/kernel/trace/trace.h
@@ -11,6 +11,7 @@
11#include <linux/ftrace.h> 11#include <linux/ftrace.h>
12#include <trace/boot.h> 12#include <trace/boot.h>
13#include <linux/kmemtrace.h> 13#include <linux/kmemtrace.h>
14#include <linux/hw_breakpoint.h>
14 15
15#include <linux/trace_seq.h> 16#include <linux/trace_seq.h>
16#include <linux/ftrace_event.h> 17#include <linux/ftrace_event.h>
@@ -37,6 +38,7 @@ enum trace_type {
37 TRACE_KMEM_ALLOC, 38 TRACE_KMEM_ALLOC,
38 TRACE_KMEM_FREE, 39 TRACE_KMEM_FREE,
39 TRACE_BLK, 40 TRACE_BLK,
41 TRACE_KSYM,
40 42
41 __TRACE_LAST_TYPE, 43 __TRACE_LAST_TYPE,
42}; 44};
@@ -98,9 +100,32 @@ struct syscall_trace_enter {
98struct syscall_trace_exit { 100struct syscall_trace_exit {
99 struct trace_entry ent; 101 struct trace_entry ent;
100 int nr; 102 int nr;
101 unsigned long ret; 103 long ret;
102}; 104};
103 105
106struct kprobe_trace_entry {
107 struct trace_entry ent;
108 unsigned long ip;
109 int nargs;
110 unsigned long args[];
111};
112
113#define SIZEOF_KPROBE_TRACE_ENTRY(n) \
114 (offsetof(struct kprobe_trace_entry, args) + \
115 (sizeof(unsigned long) * (n)))
116
117struct kretprobe_trace_entry {
118 struct trace_entry ent;
119 unsigned long func;
120 unsigned long ret_ip;
121 int nargs;
122 unsigned long args[];
123};
124
125#define SIZEOF_KRETPROBE_TRACE_ENTRY(n) \
126 (offsetof(struct kretprobe_trace_entry, args) + \
127 (sizeof(unsigned long) * (n)))
128
104/* 129/*
105 * trace_flag_type is an enumeration that holds different 130 * trace_flag_type is an enumeration that holds different
106 * states when a trace occurs. These are: 131 * states when a trace occurs. These are:
@@ -209,6 +234,7 @@ extern void __ftrace_bad_type(void);
209 TRACE_KMEM_ALLOC); \ 234 TRACE_KMEM_ALLOC); \
210 IF_ASSIGN(var, ent, struct kmemtrace_free_entry, \ 235 IF_ASSIGN(var, ent, struct kmemtrace_free_entry, \
211 TRACE_KMEM_FREE); \ 236 TRACE_KMEM_FREE); \
237 IF_ASSIGN(var, ent, struct ksym_trace_entry, TRACE_KSYM);\
212 __ftrace_bad_type(); \ 238 __ftrace_bad_type(); \
213 } while (0) 239 } while (0)
214 240
@@ -364,6 +390,8 @@ int register_tracer(struct tracer *type);
364void unregister_tracer(struct tracer *type); 390void unregister_tracer(struct tracer *type);
365int is_tracing_stopped(void); 391int is_tracing_stopped(void);
366 392
393extern int process_new_ksym_entry(char *ksymname, int op, unsigned long addr);
394
367extern unsigned long nsecs_to_usecs(unsigned long nsecs); 395extern unsigned long nsecs_to_usecs(unsigned long nsecs);
368 396
369#ifdef CONFIG_TRACER_MAX_TRACE 397#ifdef CONFIG_TRACER_MAX_TRACE
@@ -438,6 +466,8 @@ extern int trace_selftest_startup_branch(struct tracer *trace,
438 struct trace_array *tr); 466 struct trace_array *tr);
439extern int trace_selftest_startup_hw_branches(struct tracer *trace, 467extern int trace_selftest_startup_hw_branches(struct tracer *trace,
440 struct trace_array *tr); 468 struct trace_array *tr);
469extern int trace_selftest_startup_ksym(struct tracer *trace,
470 struct trace_array *tr);
441#endif /* CONFIG_FTRACE_STARTUP_TEST */ 471#endif /* CONFIG_FTRACE_STARTUP_TEST */
442 472
443extern void *head_page(struct trace_array_cpu *data); 473extern void *head_page(struct trace_array_cpu *data);
@@ -483,10 +513,6 @@ static inline int ftrace_graph_addr(unsigned long addr)
483 return 0; 513 return 0;
484} 514}
485#else 515#else
486static inline int ftrace_trace_addr(unsigned long addr)
487{
488 return 1;
489}
490static inline int ftrace_graph_addr(unsigned long addr) 516static inline int ftrace_graph_addr(unsigned long addr)
491{ 517{
492 return 1; 518 return 1;
@@ -500,12 +526,12 @@ print_graph_function(struct trace_iterator *iter)
500} 526}
501#endif /* CONFIG_FUNCTION_GRAPH_TRACER */ 527#endif /* CONFIG_FUNCTION_GRAPH_TRACER */
502 528
503extern struct pid *ftrace_pid_trace; 529extern struct list_head ftrace_pids;
504 530
505#ifdef CONFIG_FUNCTION_TRACER 531#ifdef CONFIG_FUNCTION_TRACER
506static inline int ftrace_trace_task(struct task_struct *task) 532static inline int ftrace_trace_task(struct task_struct *task)
507{ 533{
508 if (!ftrace_pid_trace) 534 if (list_empty(&ftrace_pids))
509 return 1; 535 return 1;
510 536
511 return test_tsk_trace_trace(task); 537 return test_tsk_trace_trace(task);
@@ -687,7 +713,6 @@ struct event_filter {
687 int n_preds; 713 int n_preds;
688 struct filter_pred **preds; 714 struct filter_pred **preds;
689 char *filter_string; 715 char *filter_string;
690 bool no_reset;
691}; 716};
692 717
693struct event_subsystem { 718struct event_subsystem {
@@ -699,22 +724,40 @@ struct event_subsystem {
699}; 724};
700 725
701struct filter_pred; 726struct filter_pred;
727struct regex;
702 728
703typedef int (*filter_pred_fn_t) (struct filter_pred *pred, void *event, 729typedef int (*filter_pred_fn_t) (struct filter_pred *pred, void *event,
704 int val1, int val2); 730 int val1, int val2);
705 731
732typedef int (*regex_match_func)(char *str, struct regex *r, int len);
733
734enum regex_type {
735 MATCH_FULL = 0,
736 MATCH_FRONT_ONLY,
737 MATCH_MIDDLE_ONLY,
738 MATCH_END_ONLY,
739};
740
741struct regex {
742 char pattern[MAX_FILTER_STR_VAL];
743 int len;
744 int field_len;
745 regex_match_func match;
746};
747
706struct filter_pred { 748struct filter_pred {
707 filter_pred_fn_t fn; 749 filter_pred_fn_t fn;
708 u64 val; 750 u64 val;
709 char str_val[MAX_FILTER_STR_VAL]; 751 struct regex regex;
710 int str_len; 752 char *field_name;
711 char *field_name; 753 int offset;
712 int offset; 754 int not;
713 int not; 755 int op;
714 int op; 756 int pop_n;
715 int pop_n;
716}; 757};
717 758
759extern enum regex_type
760filter_parse_regex(char *buff, int len, char **search, int *not);
718extern void print_event_filter(struct ftrace_event_call *call, 761extern void print_event_filter(struct ftrace_event_call *call,
719 struct trace_seq *s); 762 struct trace_seq *s);
720extern int apply_event_filter(struct ftrace_event_call *call, 763extern int apply_event_filter(struct ftrace_event_call *call,
@@ -730,7 +773,8 @@ filter_check_discard(struct ftrace_event_call *call, void *rec,
730 struct ring_buffer *buffer, 773 struct ring_buffer *buffer,
731 struct ring_buffer_event *event) 774 struct ring_buffer_event *event)
732{ 775{
733 if (unlikely(call->filter_active) && !filter_match_preds(call, rec)) { 776 if (unlikely(call->filter_active) &&
777 !filter_match_preds(call->filter, rec)) {
734 ring_buffer_discard_commit(buffer, event); 778 ring_buffer_discard_commit(buffer, event);
735 return 1; 779 return 1;
736 } 780 }
diff --git a/kernel/trace/trace_clock.c b/kernel/trace/trace_clock.c
index 20c5f92e28a8..878c03f386ba 100644
--- a/kernel/trace/trace_clock.c
+++ b/kernel/trace/trace_clock.c
@@ -20,6 +20,8 @@
20#include <linux/ktime.h> 20#include <linux/ktime.h>
21#include <linux/trace_clock.h> 21#include <linux/trace_clock.h>
22 22
23#include "trace.h"
24
23/* 25/*
24 * trace_clock_local(): the simplest and least coherent tracing clock. 26 * trace_clock_local(): the simplest and least coherent tracing clock.
25 * 27 *
@@ -28,17 +30,17 @@
28 */ 30 */
29u64 notrace trace_clock_local(void) 31u64 notrace trace_clock_local(void)
30{ 32{
31 unsigned long flags;
32 u64 clock; 33 u64 clock;
34 int resched;
33 35
34 /* 36 /*
35 * sched_clock() is an architecture implemented, fast, scalable, 37 * sched_clock() is an architecture implemented, fast, scalable,
36 * lockless clock. It is not guaranteed to be coherent across 38 * lockless clock. It is not guaranteed to be coherent across
37 * CPUs, nor across CPU idle events. 39 * CPUs, nor across CPU idle events.
38 */ 40 */
39 raw_local_irq_save(flags); 41 resched = ftrace_preempt_disable();
40 clock = sched_clock(); 42 clock = sched_clock();
41 raw_local_irq_restore(flags); 43 ftrace_preempt_enable(resched);
42 44
43 return clock; 45 return clock;
44} 46}
diff --git a/kernel/trace/trace_entries.h b/kernel/trace/trace_entries.h
index ead3d724599d..c16a08f399df 100644
--- a/kernel/trace/trace_entries.h
+++ b/kernel/trace/trace_entries.h
@@ -364,3 +364,19 @@ FTRACE_ENTRY(kmem_free, kmemtrace_free_entry,
364 F_printk("type:%u call_site:%lx ptr:%p", 364 F_printk("type:%u call_site:%lx ptr:%p",
365 __entry->type_id, __entry->call_site, __entry->ptr) 365 __entry->type_id, __entry->call_site, __entry->ptr)
366); 366);
367
368FTRACE_ENTRY(ksym_trace, ksym_trace_entry,
369
370 TRACE_KSYM,
371
372 F_STRUCT(
373 __field( unsigned long, ip )
374 __field( unsigned char, type )
375 __array( char , cmd, TASK_COMM_LEN )
376 __field( unsigned long, addr )
377 ),
378
379 F_printk("ip: %pF type: %d ksym_name: %pS cmd: %s",
380 (void *)__entry->ip, (unsigned int)__entry->type,
381 (void *)__entry->addr, __entry->cmd)
382);
diff --git a/kernel/trace/trace_event_profile.c b/kernel/trace/trace_event_profile.c
index 8d5c171cc998..d9c60f80aa0d 100644
--- a/kernel/trace/trace_event_profile.c
+++ b/kernel/trace/trace_event_profile.c
@@ -8,17 +8,14 @@
8#include <linux/module.h> 8#include <linux/module.h>
9#include "trace.h" 9#include "trace.h"
10 10
11/*
12 * We can't use a size but a type in alloc_percpu()
13 * So let's create a dummy type that matches the desired size
14 */
15typedef struct {char buf[FTRACE_MAX_PROFILE_SIZE];} profile_buf_t;
16 11
17char *trace_profile_buf; 12char *perf_trace_buf;
18EXPORT_SYMBOL_GPL(trace_profile_buf); 13EXPORT_SYMBOL_GPL(perf_trace_buf);
14
15char *perf_trace_buf_nmi;
16EXPORT_SYMBOL_GPL(perf_trace_buf_nmi);
19 17
20char *trace_profile_buf_nmi; 18typedef typeof(char [FTRACE_MAX_PROFILE_SIZE]) perf_trace_t ;
21EXPORT_SYMBOL_GPL(trace_profile_buf_nmi);
22 19
23/* Count the events in use (per event id, not per instance) */ 20/* Count the events in use (per event id, not per instance) */
24static int total_profile_count; 21static int total_profile_count;
@@ -32,20 +29,20 @@ static int ftrace_profile_enable_event(struct ftrace_event_call *event)
32 return 0; 29 return 0;
33 30
34 if (!total_profile_count) { 31 if (!total_profile_count) {
35 buf = (char *)alloc_percpu(profile_buf_t); 32 buf = (char *)alloc_percpu(perf_trace_t);
36 if (!buf) 33 if (!buf)
37 goto fail_buf; 34 goto fail_buf;
38 35
39 rcu_assign_pointer(trace_profile_buf, buf); 36 rcu_assign_pointer(perf_trace_buf, buf);
40 37
41 buf = (char *)alloc_percpu(profile_buf_t); 38 buf = (char *)alloc_percpu(perf_trace_t);
42 if (!buf) 39 if (!buf)
43 goto fail_buf_nmi; 40 goto fail_buf_nmi;
44 41
45 rcu_assign_pointer(trace_profile_buf_nmi, buf); 42 rcu_assign_pointer(perf_trace_buf_nmi, buf);
46 } 43 }
47 44
48 ret = event->profile_enable(); 45 ret = event->profile_enable(event);
49 if (!ret) { 46 if (!ret) {
50 total_profile_count++; 47 total_profile_count++;
51 return 0; 48 return 0;
@@ -53,10 +50,10 @@ static int ftrace_profile_enable_event(struct ftrace_event_call *event)
53 50
54fail_buf_nmi: 51fail_buf_nmi:
55 if (!total_profile_count) { 52 if (!total_profile_count) {
56 free_percpu(trace_profile_buf_nmi); 53 free_percpu(perf_trace_buf_nmi);
57 free_percpu(trace_profile_buf); 54 free_percpu(perf_trace_buf);
58 trace_profile_buf_nmi = NULL; 55 perf_trace_buf_nmi = NULL;
59 trace_profile_buf = NULL; 56 perf_trace_buf = NULL;
60 } 57 }
61fail_buf: 58fail_buf:
62 atomic_dec(&event->profile_count); 59 atomic_dec(&event->profile_count);
@@ -89,14 +86,14 @@ static void ftrace_profile_disable_event(struct ftrace_event_call *event)
89 if (!atomic_add_negative(-1, &event->profile_count)) 86 if (!atomic_add_negative(-1, &event->profile_count))
90 return; 87 return;
91 88
92 event->profile_disable(); 89 event->profile_disable(event);
93 90
94 if (!--total_profile_count) { 91 if (!--total_profile_count) {
95 buf = trace_profile_buf; 92 buf = perf_trace_buf;
96 rcu_assign_pointer(trace_profile_buf, NULL); 93 rcu_assign_pointer(perf_trace_buf, NULL);
97 94
98 nmi_buf = trace_profile_buf_nmi; 95 nmi_buf = perf_trace_buf_nmi;
99 rcu_assign_pointer(trace_profile_buf_nmi, NULL); 96 rcu_assign_pointer(perf_trace_buf_nmi, NULL);
100 97
101 /* 98 /*
102 * Ensure every events in profiling have finished before 99 * Ensure every events in profiling have finished before
diff --git a/kernel/trace/trace_events.c b/kernel/trace/trace_events.c
index d128f65778e6..1d18315dc836 100644
--- a/kernel/trace/trace_events.c
+++ b/kernel/trace/trace_events.c
@@ -93,9 +93,7 @@ int trace_define_common_fields(struct ftrace_event_call *call)
93} 93}
94EXPORT_SYMBOL_GPL(trace_define_common_fields); 94EXPORT_SYMBOL_GPL(trace_define_common_fields);
95 95
96#ifdef CONFIG_MODULES 96void trace_destroy_fields(struct ftrace_event_call *call)
97
98static void trace_destroy_fields(struct ftrace_event_call *call)
99{ 97{
100 struct ftrace_event_field *field, *next; 98 struct ftrace_event_field *field, *next;
101 99
@@ -107,8 +105,6 @@ static void trace_destroy_fields(struct ftrace_event_call *call)
107 } 105 }
108} 106}
109 107
110#endif /* CONFIG_MODULES */
111
112static void ftrace_event_enable_disable(struct ftrace_event_call *call, 108static void ftrace_event_enable_disable(struct ftrace_event_call *call,
113 int enable) 109 int enable)
114{ 110{
@@ -117,14 +113,14 @@ static void ftrace_event_enable_disable(struct ftrace_event_call *call,
117 if (call->enabled) { 113 if (call->enabled) {
118 call->enabled = 0; 114 call->enabled = 0;
119 tracing_stop_cmdline_record(); 115 tracing_stop_cmdline_record();
120 call->unregfunc(call->data); 116 call->unregfunc(call);
121 } 117 }
122 break; 118 break;
123 case 1: 119 case 1:
124 if (!call->enabled) { 120 if (!call->enabled) {
125 call->enabled = 1; 121 call->enabled = 1;
126 tracing_start_cmdline_record(); 122 tracing_start_cmdline_record();
127 call->regfunc(call->data); 123 call->regfunc(call);
128 } 124 }
129 break; 125 break;
130 } 126 }
@@ -507,7 +503,7 @@ extern char *__bad_type_size(void);
507#define FIELD(type, name) \ 503#define FIELD(type, name) \
508 sizeof(type) != sizeof(field.name) ? __bad_type_size() : \ 504 sizeof(type) != sizeof(field.name) ? __bad_type_size() : \
509 #type, "common_" #name, offsetof(typeof(field), name), \ 505 #type, "common_" #name, offsetof(typeof(field), name), \
510 sizeof(field.name) 506 sizeof(field.name), is_signed_type(type)
511 507
512static int trace_write_header(struct trace_seq *s) 508static int trace_write_header(struct trace_seq *s)
513{ 509{
@@ -515,17 +511,17 @@ static int trace_write_header(struct trace_seq *s)
515 511
516 /* struct trace_entry */ 512 /* struct trace_entry */
517 return trace_seq_printf(s, 513 return trace_seq_printf(s,
518 "\tfield:%s %s;\toffset:%zu;\tsize:%zu;\n" 514 "\tfield:%s %s;\toffset:%zu;\tsize:%zu;\tsigned:%u;\n"
519 "\tfield:%s %s;\toffset:%zu;\tsize:%zu;\n" 515 "\tfield:%s %s;\toffset:%zu;\tsize:%zu;\tsigned:%u;\n"
520 "\tfield:%s %s;\toffset:%zu;\tsize:%zu;\n" 516 "\tfield:%s %s;\toffset:%zu;\tsize:%zu;\tsigned:%u;\n"
521 "\tfield:%s %s;\toffset:%zu;\tsize:%zu;\n" 517 "\tfield:%s %s;\toffset:%zu;\tsize:%zu;\tsigned:%u;\n"
522 "\tfield:%s %s;\toffset:%zu;\tsize:%zu;\n" 518 "\tfield:%s %s;\toffset:%zu;\tsize:%zu;\tsigned:%u;\n"
523 "\n", 519 "\n",
524 FIELD(unsigned short, type), 520 FIELD(unsigned short, type),
525 FIELD(unsigned char, flags), 521 FIELD(unsigned char, flags),
526 FIELD(unsigned char, preempt_count), 522 FIELD(unsigned char, preempt_count),
527 FIELD(int, pid), 523 FIELD(int, pid),
528 FIELD(int, lock_depth)); 524 FIELD(int, lock_depth));
529} 525}
530 526
531static ssize_t 527static ssize_t
@@ -878,9 +874,9 @@ event_subsystem_dir(const char *name, struct dentry *d_events)
878 "'%s/filter' entry\n", name); 874 "'%s/filter' entry\n", name);
879 } 875 }
880 876
881 entry = trace_create_file("enable", 0644, system->entry, 877 trace_create_file("enable", 0644, system->entry,
882 (void *)system->name, 878 (void *)system->name,
883 &ftrace_system_enable_fops); 879 &ftrace_system_enable_fops);
884 880
885 return system->entry; 881 return system->entry;
886} 882}
@@ -892,7 +888,6 @@ event_create_dir(struct ftrace_event_call *call, struct dentry *d_events,
892 const struct file_operations *filter, 888 const struct file_operations *filter,
893 const struct file_operations *format) 889 const struct file_operations *format)
894{ 890{
895 struct dentry *entry;
896 int ret; 891 int ret;
897 892
898 /* 893 /*
@@ -910,12 +905,12 @@ event_create_dir(struct ftrace_event_call *call, struct dentry *d_events,
910 } 905 }
911 906
912 if (call->regfunc) 907 if (call->regfunc)
913 entry = trace_create_file("enable", 0644, call->dir, call, 908 trace_create_file("enable", 0644, call->dir, call,
914 enable); 909 enable);
915 910
916 if (call->id && call->profile_enable) 911 if (call->id && call->profile_enable)
917 entry = trace_create_file("id", 0444, call->dir, call, 912 trace_create_file("id", 0444, call->dir, call,
918 id); 913 id);
919 914
920 if (call->define_fields) { 915 if (call->define_fields) {
921 ret = call->define_fields(call); 916 ret = call->define_fields(call);
@@ -924,41 +919,60 @@ event_create_dir(struct ftrace_event_call *call, struct dentry *d_events,
924 " events/%s\n", call->name); 919 " events/%s\n", call->name);
925 return ret; 920 return ret;
926 } 921 }
927 entry = trace_create_file("filter", 0644, call->dir, call, 922 trace_create_file("filter", 0644, call->dir, call,
928 filter); 923 filter);
929 } 924 }
930 925
931 /* A trace may not want to export its format */ 926 /* A trace may not want to export its format */
932 if (!call->show_format) 927 if (!call->show_format)
933 return 0; 928 return 0;
934 929
935 entry = trace_create_file("format", 0444, call->dir, call, 930 trace_create_file("format", 0444, call->dir, call,
936 format); 931 format);
937 932
938 return 0; 933 return 0;
939} 934}
940 935
941#define for_each_event(event, start, end) \ 936static int __trace_add_event_call(struct ftrace_event_call *call)
942 for (event = start; \ 937{
943 (unsigned long)event < (unsigned long)end; \ 938 struct dentry *d_events;
944 event++) 939 int ret;
945 940
946#ifdef CONFIG_MODULES 941 if (!call->name)
942 return -EINVAL;
947 943
948static LIST_HEAD(ftrace_module_file_list); 944 if (call->raw_init) {
945 ret = call->raw_init(call);
946 if (ret < 0) {
947 if (ret != -ENOSYS)
948 pr_warning("Could not initialize trace "
949 "events/%s\n", call->name);
950 return ret;
951 }
952 }
949 953
950/* 954 d_events = event_trace_events_dir();
951 * Modules must own their file_operations to keep up with 955 if (!d_events)
952 * reference counting. 956 return -ENOENT;
953 */ 957
954struct ftrace_module_file_ops { 958 ret = event_create_dir(call, d_events, &ftrace_event_id_fops,
955 struct list_head list; 959 &ftrace_enable_fops, &ftrace_event_filter_fops,
956 struct module *mod; 960 &ftrace_event_format_fops);
957 struct file_operations id; 961 if (!ret)
958 struct file_operations enable; 962 list_add(&call->list, &ftrace_events);
959 struct file_operations format; 963
960 struct file_operations filter; 964 return ret;
961}; 965}
966
967/* Add an additional event_call dynamically */
968int trace_add_event_call(struct ftrace_event_call *call)
969{
970 int ret;
971 mutex_lock(&event_mutex);
972 ret = __trace_add_event_call(call);
973 mutex_unlock(&event_mutex);
974 return ret;
975}
962 976
963static void remove_subsystem_dir(const char *name) 977static void remove_subsystem_dir(const char *name)
964{ 978{
@@ -986,6 +1000,53 @@ static void remove_subsystem_dir(const char *name)
986 } 1000 }
987} 1001}
988 1002
1003/*
1004 * Must be called under locking both of event_mutex and trace_event_mutex.
1005 */
1006static void __trace_remove_event_call(struct ftrace_event_call *call)
1007{
1008 ftrace_event_enable_disable(call, 0);
1009 if (call->event)
1010 __unregister_ftrace_event(call->event);
1011 debugfs_remove_recursive(call->dir);
1012 list_del(&call->list);
1013 trace_destroy_fields(call);
1014 destroy_preds(call);
1015 remove_subsystem_dir(call->system);
1016}
1017
1018/* Remove an event_call */
1019void trace_remove_event_call(struct ftrace_event_call *call)
1020{
1021 mutex_lock(&event_mutex);
1022 down_write(&trace_event_mutex);
1023 __trace_remove_event_call(call);
1024 up_write(&trace_event_mutex);
1025 mutex_unlock(&event_mutex);
1026}
1027
1028#define for_each_event(event, start, end) \
1029 for (event = start; \
1030 (unsigned long)event < (unsigned long)end; \
1031 event++)
1032
1033#ifdef CONFIG_MODULES
1034
1035static LIST_HEAD(ftrace_module_file_list);
1036
1037/*
1038 * Modules must own their file_operations to keep up with
1039 * reference counting.
1040 */
1041struct ftrace_module_file_ops {
1042 struct list_head list;
1043 struct module *mod;
1044 struct file_operations id;
1045 struct file_operations enable;
1046 struct file_operations format;
1047 struct file_operations filter;
1048};
1049
989static struct ftrace_module_file_ops * 1050static struct ftrace_module_file_ops *
990trace_create_file_ops(struct module *mod) 1051trace_create_file_ops(struct module *mod)
991{ 1052{
@@ -1043,7 +1104,7 @@ static void trace_module_add_events(struct module *mod)
1043 if (!call->name) 1104 if (!call->name)
1044 continue; 1105 continue;
1045 if (call->raw_init) { 1106 if (call->raw_init) {
1046 ret = call->raw_init(); 1107 ret = call->raw_init(call);
1047 if (ret < 0) { 1108 if (ret < 0) {
1048 if (ret != -ENOSYS) 1109 if (ret != -ENOSYS)
1049 pr_warning("Could not initialize trace " 1110 pr_warning("Could not initialize trace "
@@ -1061,10 +1122,11 @@ static void trace_module_add_events(struct module *mod)
1061 return; 1122 return;
1062 } 1123 }
1063 call->mod = mod; 1124 call->mod = mod;
1064 list_add(&call->list, &ftrace_events); 1125 ret = event_create_dir(call, d_events,
1065 event_create_dir(call, d_events, 1126 &file_ops->id, &file_ops->enable,
1066 &file_ops->id, &file_ops->enable, 1127 &file_ops->filter, &file_ops->format);
1067 &file_ops->filter, &file_ops->format); 1128 if (!ret)
1129 list_add(&call->list, &ftrace_events);
1068 } 1130 }
1069} 1131}
1070 1132
@@ -1078,14 +1140,7 @@ static void trace_module_remove_events(struct module *mod)
1078 list_for_each_entry_safe(call, p, &ftrace_events, list) { 1140 list_for_each_entry_safe(call, p, &ftrace_events, list) {
1079 if (call->mod == mod) { 1141 if (call->mod == mod) {
1080 found = true; 1142 found = true;
1081 ftrace_event_enable_disable(call, 0); 1143 __trace_remove_event_call(call);
1082 if (call->event)
1083 __unregister_ftrace_event(call->event);
1084 debugfs_remove_recursive(call->dir);
1085 list_del(&call->list);
1086 trace_destroy_fields(call);
1087 destroy_preds(call);
1088 remove_subsystem_dir(call->system);
1089 } 1144 }
1090 } 1145 }
1091 1146
@@ -1203,7 +1258,7 @@ static __init int event_trace_init(void)
1203 if (!call->name) 1258 if (!call->name)
1204 continue; 1259 continue;
1205 if (call->raw_init) { 1260 if (call->raw_init) {
1206 ret = call->raw_init(); 1261 ret = call->raw_init(call);
1207 if (ret < 0) { 1262 if (ret < 0) {
1208 if (ret != -ENOSYS) 1263 if (ret != -ENOSYS)
1209 pr_warning("Could not initialize trace " 1264 pr_warning("Could not initialize trace "
@@ -1211,10 +1266,12 @@ static __init int event_trace_init(void)
1211 continue; 1266 continue;
1212 } 1267 }
1213 } 1268 }
1214 list_add(&call->list, &ftrace_events); 1269 ret = event_create_dir(call, d_events, &ftrace_event_id_fops,
1215 event_create_dir(call, d_events, &ftrace_event_id_fops, 1270 &ftrace_enable_fops,
1216 &ftrace_enable_fops, &ftrace_event_filter_fops, 1271 &ftrace_event_filter_fops,
1217 &ftrace_event_format_fops); 1272 &ftrace_event_format_fops);
1273 if (!ret)
1274 list_add(&call->list, &ftrace_events);
1218 } 1275 }
1219 1276
1220 while (true) { 1277 while (true) {
diff --git a/kernel/trace/trace_events_filter.c b/kernel/trace/trace_events_filter.c
index 98a6cc5c64ed..50504cb228de 100644
--- a/kernel/trace/trace_events_filter.c
+++ b/kernel/trace/trace_events_filter.c
@@ -18,11 +18,10 @@
18 * Copyright (C) 2009 Tom Zanussi <tzanussi@gmail.com> 18 * Copyright (C) 2009 Tom Zanussi <tzanussi@gmail.com>
19 */ 19 */
20 20
21#include <linux/debugfs.h>
22#include <linux/uaccess.h>
23#include <linux/module.h> 21#include <linux/module.h>
24#include <linux/ctype.h> 22#include <linux/ctype.h>
25#include <linux/mutex.h> 23#include <linux/mutex.h>
24#include <linux/perf_event.h>
26 25
27#include "trace.h" 26#include "trace.h"
28#include "trace_output.h" 27#include "trace_output.h"
@@ -31,6 +30,7 @@ enum filter_op_ids
31{ 30{
32 OP_OR, 31 OP_OR,
33 OP_AND, 32 OP_AND,
33 OP_GLOB,
34 OP_NE, 34 OP_NE,
35 OP_EQ, 35 OP_EQ,
36 OP_LT, 36 OP_LT,
@@ -48,16 +48,17 @@ struct filter_op {
48}; 48};
49 49
50static struct filter_op filter_ops[] = { 50static struct filter_op filter_ops[] = {
51 { OP_OR, "||", 1 }, 51 { OP_OR, "||", 1 },
52 { OP_AND, "&&", 2 }, 52 { OP_AND, "&&", 2 },
53 { OP_NE, "!=", 4 }, 53 { OP_GLOB, "~", 4 },
54 { OP_EQ, "==", 4 }, 54 { OP_NE, "!=", 4 },
55 { OP_LT, "<", 5 }, 55 { OP_EQ, "==", 4 },
56 { OP_LE, "<=", 5 }, 56 { OP_LT, "<", 5 },
57 { OP_GT, ">", 5 }, 57 { OP_LE, "<=", 5 },
58 { OP_GE, ">=", 5 }, 58 { OP_GT, ">", 5 },
59 { OP_NONE, "OP_NONE", 0 }, 59 { OP_GE, ">=", 5 },
60 { OP_OPEN_PAREN, "(", 0 }, 60 { OP_NONE, "OP_NONE", 0 },
61 { OP_OPEN_PAREN, "(", 0 },
61}; 62};
62 63
63enum { 64enum {
@@ -197,9 +198,9 @@ static int filter_pred_string(struct filter_pred *pred, void *event,
197 char *addr = (char *)(event + pred->offset); 198 char *addr = (char *)(event + pred->offset);
198 int cmp, match; 199 int cmp, match;
199 200
200 cmp = strncmp(addr, pred->str_val, pred->str_len); 201 cmp = pred->regex.match(addr, &pred->regex, pred->regex.field_len);
201 202
202 match = (!cmp) ^ pred->not; 203 match = cmp ^ pred->not;
203 204
204 return match; 205 return match;
205} 206}
@@ -211,9 +212,9 @@ static int filter_pred_pchar(struct filter_pred *pred, void *event,
211 char **addr = (char **)(event + pred->offset); 212 char **addr = (char **)(event + pred->offset);
212 int cmp, match; 213 int cmp, match;
213 214
214 cmp = strncmp(*addr, pred->str_val, pred->str_len); 215 cmp = pred->regex.match(*addr, &pred->regex, pred->regex.field_len);
215 216
216 match = (!cmp) ^ pred->not; 217 match = cmp ^ pred->not;
217 218
218 return match; 219 return match;
219} 220}
@@ -237,9 +238,9 @@ static int filter_pred_strloc(struct filter_pred *pred, void *event,
237 char *addr = (char *)(event + str_loc); 238 char *addr = (char *)(event + str_loc);
238 int cmp, match; 239 int cmp, match;
239 240
240 cmp = strncmp(addr, pred->str_val, str_len); 241 cmp = pred->regex.match(addr, &pred->regex, str_len);
241 242
242 match = (!cmp) ^ pred->not; 243 match = cmp ^ pred->not;
243 244
244 return match; 245 return match;
245} 246}
@@ -250,10 +251,121 @@ static int filter_pred_none(struct filter_pred *pred, void *event,
250 return 0; 251 return 0;
251} 252}
252 253
254/* Basic regex callbacks */
255static int regex_match_full(char *str, struct regex *r, int len)
256{
257 if (strncmp(str, r->pattern, len) == 0)
258 return 1;
259 return 0;
260}
261
262static int regex_match_front(char *str, struct regex *r, int len)
263{
264 if (strncmp(str, r->pattern, len) == 0)
265 return 1;
266 return 0;
267}
268
269static int regex_match_middle(char *str, struct regex *r, int len)
270{
271 if (strstr(str, r->pattern))
272 return 1;
273 return 0;
274}
275
276static int regex_match_end(char *str, struct regex *r, int len)
277{
278 char *ptr = strstr(str, r->pattern);
279
280 if (ptr && (ptr[r->len] == 0))
281 return 1;
282 return 0;
283}
284
285/**
286 * filter_parse_regex - parse a basic regex
287 * @buff: the raw regex
288 * @len: length of the regex
289 * @search: will point to the beginning of the string to compare
290 * @not: tell whether the match will have to be inverted
291 *
292 * This passes in a buffer containing a regex and this function will
293 * set search to point to the search part of the buffer and
294 * return the type of search it is (see enum above).
295 * This does modify buff.
296 *
297 * Returns enum type.
298 * search returns the pointer to use for comparison.
299 * not returns 1 if buff started with a '!'
300 * 0 otherwise.
301 */
302enum regex_type filter_parse_regex(char *buff, int len, char **search, int *not)
303{
304 int type = MATCH_FULL;
305 int i;
306
307 if (buff[0] == '!') {
308 *not = 1;
309 buff++;
310 len--;
311 } else
312 *not = 0;
313
314 *search = buff;
315
316 for (i = 0; i < len; i++) {
317 if (buff[i] == '*') {
318 if (!i) {
319 *search = buff + 1;
320 type = MATCH_END_ONLY;
321 } else {
322 if (type == MATCH_END_ONLY)
323 type = MATCH_MIDDLE_ONLY;
324 else
325 type = MATCH_FRONT_ONLY;
326 buff[i] = 0;
327 break;
328 }
329 }
330 }
331
332 return type;
333}
334
335static void filter_build_regex(struct filter_pred *pred)
336{
337 struct regex *r = &pred->regex;
338 char *search;
339 enum regex_type type = MATCH_FULL;
340 int not = 0;
341
342 if (pred->op == OP_GLOB) {
343 type = filter_parse_regex(r->pattern, r->len, &search, &not);
344 r->len = strlen(search);
345 memmove(r->pattern, search, r->len+1);
346 }
347
348 switch (type) {
349 case MATCH_FULL:
350 r->match = regex_match_full;
351 break;
352 case MATCH_FRONT_ONLY:
353 r->match = regex_match_front;
354 break;
355 case MATCH_MIDDLE_ONLY:
356 r->match = regex_match_middle;
357 break;
358 case MATCH_END_ONLY:
359 r->match = regex_match_end;
360 break;
361 }
362
363 pred->not ^= not;
364}
365
253/* return 1 if event matches, 0 otherwise (discard) */ 366/* return 1 if event matches, 0 otherwise (discard) */
254int filter_match_preds(struct ftrace_event_call *call, void *rec) 367int filter_match_preds(struct event_filter *filter, void *rec)
255{ 368{
256 struct event_filter *filter = call->filter;
257 int match, top = 0, val1 = 0, val2 = 0; 369 int match, top = 0, val1 = 0, val2 = 0;
258 int stack[MAX_FILTER_PRED]; 370 int stack[MAX_FILTER_PRED];
259 struct filter_pred *pred; 371 struct filter_pred *pred;
@@ -396,7 +508,7 @@ static void filter_clear_pred(struct filter_pred *pred)
396{ 508{
397 kfree(pred->field_name); 509 kfree(pred->field_name);
398 pred->field_name = NULL; 510 pred->field_name = NULL;
399 pred->str_len = 0; 511 pred->regex.len = 0;
400} 512}
401 513
402static int filter_set_pred(struct filter_pred *dest, 514static int filter_set_pred(struct filter_pred *dest,
@@ -426,9 +538,8 @@ static void filter_disable_preds(struct ftrace_event_call *call)
426 filter->preds[i]->fn = filter_pred_none; 538 filter->preds[i]->fn = filter_pred_none;
427} 539}
428 540
429void destroy_preds(struct ftrace_event_call *call) 541static void __free_preds(struct event_filter *filter)
430{ 542{
431 struct event_filter *filter = call->filter;
432 int i; 543 int i;
433 544
434 if (!filter) 545 if (!filter)
@@ -441,21 +552,24 @@ void destroy_preds(struct ftrace_event_call *call)
441 kfree(filter->preds); 552 kfree(filter->preds);
442 kfree(filter->filter_string); 553 kfree(filter->filter_string);
443 kfree(filter); 554 kfree(filter);
555}
556
557void destroy_preds(struct ftrace_event_call *call)
558{
559 __free_preds(call->filter);
444 call->filter = NULL; 560 call->filter = NULL;
561 call->filter_active = 0;
445} 562}
446 563
447static int init_preds(struct ftrace_event_call *call) 564static struct event_filter *__alloc_preds(void)
448{ 565{
449 struct event_filter *filter; 566 struct event_filter *filter;
450 struct filter_pred *pred; 567 struct filter_pred *pred;
451 int i; 568 int i;
452 569
453 if (call->filter) 570 filter = kzalloc(sizeof(*filter), GFP_KERNEL);
454 return 0; 571 if (!filter)
455 572 return ERR_PTR(-ENOMEM);
456 filter = call->filter = kzalloc(sizeof(*filter), GFP_KERNEL);
457 if (!call->filter)
458 return -ENOMEM;
459 573
460 filter->n_preds = 0; 574 filter->n_preds = 0;
461 575
@@ -471,12 +585,24 @@ static int init_preds(struct ftrace_event_call *call)
471 filter->preds[i] = pred; 585 filter->preds[i] = pred;
472 } 586 }
473 587
474 return 0; 588 return filter;
475 589
476oom: 590oom:
477 destroy_preds(call); 591 __free_preds(filter);
592 return ERR_PTR(-ENOMEM);
593}
478 594
479 return -ENOMEM; 595static int init_preds(struct ftrace_event_call *call)
596{
597 if (call->filter)
598 return 0;
599
600 call->filter_active = 0;
601 call->filter = __alloc_preds();
602 if (IS_ERR(call->filter))
603 return PTR_ERR(call->filter);
604
605 return 0;
480} 606}
481 607
482static int init_subsystem_preds(struct event_subsystem *system) 608static int init_subsystem_preds(struct event_subsystem *system)
@@ -499,14 +625,7 @@ static int init_subsystem_preds(struct event_subsystem *system)
499 return 0; 625 return 0;
500} 626}
501 627
502enum { 628static void filter_free_subsystem_preds(struct event_subsystem *system)
503 FILTER_DISABLE_ALL,
504 FILTER_INIT_NO_RESET,
505 FILTER_SKIP_NO_RESET,
506};
507
508static void filter_free_subsystem_preds(struct event_subsystem *system,
509 int flag)
510{ 629{
511 struct ftrace_event_call *call; 630 struct ftrace_event_call *call;
512 631
@@ -517,14 +636,6 @@ static void filter_free_subsystem_preds(struct event_subsystem *system,
517 if (strcmp(call->system, system->name) != 0) 636 if (strcmp(call->system, system->name) != 0)
518 continue; 637 continue;
519 638
520 if (flag == FILTER_INIT_NO_RESET) {
521 call->filter->no_reset = false;
522 continue;
523 }
524
525 if (flag == FILTER_SKIP_NO_RESET && call->filter->no_reset)
526 continue;
527
528 filter_disable_preds(call); 639 filter_disable_preds(call);
529 remove_filter_string(call->filter); 640 remove_filter_string(call->filter);
530 } 641 }
@@ -532,10 +643,10 @@ static void filter_free_subsystem_preds(struct event_subsystem *system,
532 643
533static int filter_add_pred_fn(struct filter_parse_state *ps, 644static int filter_add_pred_fn(struct filter_parse_state *ps,
534 struct ftrace_event_call *call, 645 struct ftrace_event_call *call,
646 struct event_filter *filter,
535 struct filter_pred *pred, 647 struct filter_pred *pred,
536 filter_pred_fn_t fn) 648 filter_pred_fn_t fn)
537{ 649{
538 struct event_filter *filter = call->filter;
539 int idx, err; 650 int idx, err;
540 651
541 if (filter->n_preds == MAX_FILTER_PRED) { 652 if (filter->n_preds == MAX_FILTER_PRED) {
@@ -550,7 +661,6 @@ static int filter_add_pred_fn(struct filter_parse_state *ps,
550 return err; 661 return err;
551 662
552 filter->n_preds++; 663 filter->n_preds++;
553 call->filter_active = 1;
554 664
555 return 0; 665 return 0;
556} 666}
@@ -575,7 +685,10 @@ static bool is_string_field(struct ftrace_event_field *field)
575 685
576static int is_legal_op(struct ftrace_event_field *field, int op) 686static int is_legal_op(struct ftrace_event_field *field, int op)
577{ 687{
578 if (is_string_field(field) && (op != OP_EQ && op != OP_NE)) 688 if (is_string_field(field) &&
689 (op != OP_EQ && op != OP_NE && op != OP_GLOB))
690 return 0;
691 if (!is_string_field(field) && op == OP_GLOB)
579 return 0; 692 return 0;
580 693
581 return 1; 694 return 1;
@@ -626,6 +739,7 @@ static filter_pred_fn_t select_comparison_fn(int op, int field_size,
626 739
627static int filter_add_pred(struct filter_parse_state *ps, 740static int filter_add_pred(struct filter_parse_state *ps,
628 struct ftrace_event_call *call, 741 struct ftrace_event_call *call,
742 struct event_filter *filter,
629 struct filter_pred *pred, 743 struct filter_pred *pred,
630 bool dry_run) 744 bool dry_run)
631{ 745{
@@ -660,21 +774,22 @@ static int filter_add_pred(struct filter_parse_state *ps,
660 } 774 }
661 775
662 if (is_string_field(field)) { 776 if (is_string_field(field)) {
663 pred->str_len = field->size; 777 filter_build_regex(pred);
664 778
665 if (field->filter_type == FILTER_STATIC_STRING) 779 if (field->filter_type == FILTER_STATIC_STRING) {
666 fn = filter_pred_string; 780 fn = filter_pred_string;
667 else if (field->filter_type == FILTER_DYN_STRING) 781 pred->regex.field_len = field->size;
782 } else if (field->filter_type == FILTER_DYN_STRING)
668 fn = filter_pred_strloc; 783 fn = filter_pred_strloc;
669 else { 784 else {
670 fn = filter_pred_pchar; 785 fn = filter_pred_pchar;
671 pred->str_len = strlen(pred->str_val); 786 pred->regex.field_len = strlen(pred->regex.pattern);
672 } 787 }
673 } else { 788 } else {
674 if (field->is_signed) 789 if (field->is_signed)
675 ret = strict_strtoll(pred->str_val, 0, &val); 790 ret = strict_strtoll(pred->regex.pattern, 0, &val);
676 else 791 else
677 ret = strict_strtoull(pred->str_val, 0, &val); 792 ret = strict_strtoull(pred->regex.pattern, 0, &val);
678 if (ret) { 793 if (ret) {
679 parse_error(ps, FILT_ERR_ILLEGAL_INTVAL, 0); 794 parse_error(ps, FILT_ERR_ILLEGAL_INTVAL, 0);
680 return -EINVAL; 795 return -EINVAL;
@@ -694,45 +809,7 @@ static int filter_add_pred(struct filter_parse_state *ps,
694 809
695add_pred_fn: 810add_pred_fn:
696 if (!dry_run) 811 if (!dry_run)
697 return filter_add_pred_fn(ps, call, pred, fn); 812 return filter_add_pred_fn(ps, call, filter, pred, fn);
698 return 0;
699}
700
701static int filter_add_subsystem_pred(struct filter_parse_state *ps,
702 struct event_subsystem *system,
703 struct filter_pred *pred,
704 char *filter_string,
705 bool dry_run)
706{
707 struct ftrace_event_call *call;
708 int err = 0;
709 bool fail = true;
710
711 list_for_each_entry(call, &ftrace_events, list) {
712
713 if (!call->define_fields)
714 continue;
715
716 if (strcmp(call->system, system->name))
717 continue;
718
719 if (call->filter->no_reset)
720 continue;
721
722 err = filter_add_pred(ps, call, pred, dry_run);
723 if (err)
724 call->filter->no_reset = true;
725 else
726 fail = false;
727
728 if (!dry_run)
729 replace_filter_string(call->filter, filter_string);
730 }
731
732 if (fail) {
733 parse_error(ps, FILT_ERR_BAD_SUBSYS_FILTER, 0);
734 return err;
735 }
736 return 0; 813 return 0;
737} 814}
738 815
@@ -1045,8 +1122,8 @@ static struct filter_pred *create_pred(int op, char *operand1, char *operand2)
1045 return NULL; 1122 return NULL;
1046 } 1123 }
1047 1124
1048 strcpy(pred->str_val, operand2); 1125 strcpy(pred->regex.pattern, operand2);
1049 pred->str_len = strlen(operand2); 1126 pred->regex.len = strlen(pred->regex.pattern);
1050 1127
1051 pred->op = op; 1128 pred->op = op;
1052 1129
@@ -1090,8 +1167,8 @@ static int check_preds(struct filter_parse_state *ps)
1090 return 0; 1167 return 0;
1091} 1168}
1092 1169
1093static int replace_preds(struct event_subsystem *system, 1170static int replace_preds(struct ftrace_event_call *call,
1094 struct ftrace_event_call *call, 1171 struct event_filter *filter,
1095 struct filter_parse_state *ps, 1172 struct filter_parse_state *ps,
1096 char *filter_string, 1173 char *filter_string,
1097 bool dry_run) 1174 bool dry_run)
@@ -1138,11 +1215,7 @@ static int replace_preds(struct event_subsystem *system,
1138add_pred: 1215add_pred:
1139 if (!pred) 1216 if (!pred)
1140 return -ENOMEM; 1217 return -ENOMEM;
1141 if (call) 1218 err = filter_add_pred(ps, call, filter, pred, dry_run);
1142 err = filter_add_pred(ps, call, pred, false);
1143 else
1144 err = filter_add_subsystem_pred(ps, system, pred,
1145 filter_string, dry_run);
1146 filter_free_pred(pred); 1219 filter_free_pred(pred);
1147 if (err) 1220 if (err)
1148 return err; 1221 return err;
@@ -1153,10 +1226,50 @@ add_pred:
1153 return 0; 1226 return 0;
1154} 1227}
1155 1228
1156int apply_event_filter(struct ftrace_event_call *call, char *filter_string) 1229static int replace_system_preds(struct event_subsystem *system,
1230 struct filter_parse_state *ps,
1231 char *filter_string)
1157{ 1232{
1233 struct ftrace_event_call *call;
1234 bool fail = true;
1158 int err; 1235 int err;
1159 1236
1237 list_for_each_entry(call, &ftrace_events, list) {
1238 struct event_filter *filter = call->filter;
1239
1240 if (!call->define_fields)
1241 continue;
1242
1243 if (strcmp(call->system, system->name) != 0)
1244 continue;
1245
1246 /* try to see if the filter can be applied */
1247 err = replace_preds(call, filter, ps, filter_string, true);
1248 if (err)
1249 continue;
1250
1251 /* really apply the filter */
1252 filter_disable_preds(call);
1253 err = replace_preds(call, filter, ps, filter_string, false);
1254 if (err)
1255 filter_disable_preds(call);
1256 else {
1257 call->filter_active = 1;
1258 replace_filter_string(filter, filter_string);
1259 }
1260 fail = false;
1261 }
1262
1263 if (fail) {
1264 parse_error(ps, FILT_ERR_BAD_SUBSYS_FILTER, 0);
1265 return -EINVAL;
1266 }
1267 return 0;
1268}
1269
1270int apply_event_filter(struct ftrace_event_call *call, char *filter_string)
1271{
1272 int err;
1160 struct filter_parse_state *ps; 1273 struct filter_parse_state *ps;
1161 1274
1162 mutex_lock(&event_mutex); 1275 mutex_lock(&event_mutex);
@@ -1168,8 +1281,7 @@ int apply_event_filter(struct ftrace_event_call *call, char *filter_string)
1168 if (!strcmp(strstrip(filter_string), "0")) { 1281 if (!strcmp(strstrip(filter_string), "0")) {
1169 filter_disable_preds(call); 1282 filter_disable_preds(call);
1170 remove_filter_string(call->filter); 1283 remove_filter_string(call->filter);
1171 mutex_unlock(&event_mutex); 1284 goto out_unlock;
1172 return 0;
1173 } 1285 }
1174 1286
1175 err = -ENOMEM; 1287 err = -ENOMEM;
@@ -1187,10 +1299,11 @@ int apply_event_filter(struct ftrace_event_call *call, char *filter_string)
1187 goto out; 1299 goto out;
1188 } 1300 }
1189 1301
1190 err = replace_preds(NULL, call, ps, filter_string, false); 1302 err = replace_preds(call, call->filter, ps, filter_string, false);
1191 if (err) 1303 if (err)
1192 append_filter_err(ps, call->filter); 1304 append_filter_err(ps, call->filter);
1193 1305 else
1306 call->filter_active = 1;
1194out: 1307out:
1195 filter_opstack_clear(ps); 1308 filter_opstack_clear(ps);
1196 postfix_clear(ps); 1309 postfix_clear(ps);
@@ -1205,7 +1318,6 @@ int apply_subsystem_event_filter(struct event_subsystem *system,
1205 char *filter_string) 1318 char *filter_string)
1206{ 1319{
1207 int err; 1320 int err;
1208
1209 struct filter_parse_state *ps; 1321 struct filter_parse_state *ps;
1210 1322
1211 mutex_lock(&event_mutex); 1323 mutex_lock(&event_mutex);
@@ -1215,10 +1327,9 @@ int apply_subsystem_event_filter(struct event_subsystem *system,
1215 goto out_unlock; 1327 goto out_unlock;
1216 1328
1217 if (!strcmp(strstrip(filter_string), "0")) { 1329 if (!strcmp(strstrip(filter_string), "0")) {
1218 filter_free_subsystem_preds(system, FILTER_DISABLE_ALL); 1330 filter_free_subsystem_preds(system);
1219 remove_filter_string(system->filter); 1331 remove_filter_string(system->filter);
1220 mutex_unlock(&event_mutex); 1332 goto out_unlock;
1221 return 0;
1222 } 1333 }
1223 1334
1224 err = -ENOMEM; 1335 err = -ENOMEM;
@@ -1235,31 +1346,87 @@ int apply_subsystem_event_filter(struct event_subsystem *system,
1235 goto out; 1346 goto out;
1236 } 1347 }
1237 1348
1238 filter_free_subsystem_preds(system, FILTER_INIT_NO_RESET); 1349 err = replace_system_preds(system, ps, filter_string);
1239 1350 if (err)
1240 /* try to see the filter can be applied to which events */
1241 err = replace_preds(system, NULL, ps, filter_string, true);
1242 if (err) {
1243 append_filter_err(ps, system->filter); 1351 append_filter_err(ps, system->filter);
1244 goto out; 1352
1353out:
1354 filter_opstack_clear(ps);
1355 postfix_clear(ps);
1356 kfree(ps);
1357out_unlock:
1358 mutex_unlock(&event_mutex);
1359
1360 return err;
1361}
1362
1363#ifdef CONFIG_EVENT_PROFILE
1364
1365void ftrace_profile_free_filter(struct perf_event *event)
1366{
1367 struct event_filter *filter = event->filter;
1368
1369 event->filter = NULL;
1370 __free_preds(filter);
1371}
1372
1373int ftrace_profile_set_filter(struct perf_event *event, int event_id,
1374 char *filter_str)
1375{
1376 int err;
1377 struct event_filter *filter;
1378 struct filter_parse_state *ps;
1379 struct ftrace_event_call *call = NULL;
1380
1381 mutex_lock(&event_mutex);
1382
1383 list_for_each_entry(call, &ftrace_events, list) {
1384 if (call->id == event_id)
1385 break;
1245 } 1386 }
1246 1387
1247 filter_free_subsystem_preds(system, FILTER_SKIP_NO_RESET); 1388 err = -EINVAL;
1389 if (!call)
1390 goto out_unlock;
1248 1391
1249 /* really apply the filter to the events */ 1392 err = -EEXIST;
1250 err = replace_preds(system, NULL, ps, filter_string, false); 1393 if (event->filter)
1251 if (err) { 1394 goto out_unlock;
1252 append_filter_err(ps, system->filter); 1395
1253 filter_free_subsystem_preds(system, 2); 1396 filter = __alloc_preds();
1397 if (IS_ERR(filter)) {
1398 err = PTR_ERR(filter);
1399 goto out_unlock;
1254 } 1400 }
1255 1401
1256out: 1402 err = -ENOMEM;
1403 ps = kzalloc(sizeof(*ps), GFP_KERNEL);
1404 if (!ps)
1405 goto free_preds;
1406
1407 parse_init(ps, filter_ops, filter_str);
1408 err = filter_parse(ps);
1409 if (err)
1410 goto free_ps;
1411
1412 err = replace_preds(call, filter, ps, filter_str, false);
1413 if (!err)
1414 event->filter = filter;
1415
1416free_ps:
1257 filter_opstack_clear(ps); 1417 filter_opstack_clear(ps);
1258 postfix_clear(ps); 1418 postfix_clear(ps);
1259 kfree(ps); 1419 kfree(ps);
1420
1421free_preds:
1422 if (err)
1423 __free_preds(filter);
1424
1260out_unlock: 1425out_unlock:
1261 mutex_unlock(&event_mutex); 1426 mutex_unlock(&event_mutex);
1262 1427
1263 return err; 1428 return err;
1264} 1429}
1265 1430
1431#endif /* CONFIG_EVENT_PROFILE */
1432
diff --git a/kernel/trace/trace_export.c b/kernel/trace/trace_export.c
index 9753fcc61bc5..dff8c84ddf17 100644
--- a/kernel/trace/trace_export.c
+++ b/kernel/trace/trace_export.c
@@ -48,11 +48,11 @@
48struct ____ftrace_##name { \ 48struct ____ftrace_##name { \
49 tstruct \ 49 tstruct \
50}; \ 50}; \
51static void __used ____ftrace_check_##name(void) \ 51static void __always_unused ____ftrace_check_##name(void) \
52{ \ 52{ \
53 struct ____ftrace_##name *__entry = NULL; \ 53 struct ____ftrace_##name *__entry = NULL; \
54 \ 54 \
55 /* force cmpile-time check on F_printk() */ \ 55 /* force compile-time check on F_printk() */ \
56 printk(print); \ 56 printk(print); \
57} 57}
58 58
@@ -66,44 +66,47 @@ static void __used ____ftrace_check_##name(void) \
66#undef __field 66#undef __field
67#define __field(type, item) \ 67#define __field(type, item) \
68 ret = trace_seq_printf(s, "\tfield:" #type " " #item ";\t" \ 68 ret = trace_seq_printf(s, "\tfield:" #type " " #item ";\t" \
69 "offset:%zu;\tsize:%zu;\n", \ 69 "offset:%zu;\tsize:%zu;\tsigned:%u;\n", \
70 offsetof(typeof(field), item), \ 70 offsetof(typeof(field), item), \
71 sizeof(field.item)); \ 71 sizeof(field.item), is_signed_type(type)); \
72 if (!ret) \ 72 if (!ret) \
73 return 0; 73 return 0;
74 74
75#undef __field_desc 75#undef __field_desc
76#define __field_desc(type, container, item) \ 76#define __field_desc(type, container, item) \
77 ret = trace_seq_printf(s, "\tfield:" #type " " #item ";\t" \ 77 ret = trace_seq_printf(s, "\tfield:" #type " " #item ";\t" \
78 "offset:%zu;\tsize:%zu;\n", \ 78 "offset:%zu;\tsize:%zu;\tsigned:%u;\n", \
79 offsetof(typeof(field), container.item), \ 79 offsetof(typeof(field), container.item), \
80 sizeof(field.container.item)); \ 80 sizeof(field.container.item), \
81 is_signed_type(type)); \
81 if (!ret) \ 82 if (!ret) \
82 return 0; 83 return 0;
83 84
84#undef __array 85#undef __array
85#define __array(type, item, len) \ 86#define __array(type, item, len) \
86 ret = trace_seq_printf(s, "\tfield:" #type " " #item "[" #len "];\t" \ 87 ret = trace_seq_printf(s, "\tfield:" #type " " #item "[" #len "];\t" \
87 "offset:%zu;\tsize:%zu;\n", \ 88 "offset:%zu;\tsize:%zu;\tsigned:%u;\n", \
88 offsetof(typeof(field), item), \ 89 offsetof(typeof(field), item), \
89 sizeof(field.item)); \ 90 sizeof(field.item), is_signed_type(type)); \
90 if (!ret) \ 91 if (!ret) \
91 return 0; 92 return 0;
92 93
93#undef __array_desc 94#undef __array_desc
94#define __array_desc(type, container, item, len) \ 95#define __array_desc(type, container, item, len) \
95 ret = trace_seq_printf(s, "\tfield:" #type " " #item "[" #len "];\t" \ 96 ret = trace_seq_printf(s, "\tfield:" #type " " #item "[" #len "];\t" \
96 "offset:%zu;\tsize:%zu;\n", \ 97 "offset:%zu;\tsize:%zu;\tsigned:%u;\n", \
97 offsetof(typeof(field), container.item), \ 98 offsetof(typeof(field), container.item), \
98 sizeof(field.container.item)); \ 99 sizeof(field.container.item), \
100 is_signed_type(type)); \
99 if (!ret) \ 101 if (!ret) \
100 return 0; 102 return 0;
101 103
102#undef __dynamic_array 104#undef __dynamic_array
103#define __dynamic_array(type, item) \ 105#define __dynamic_array(type, item) \
104 ret = trace_seq_printf(s, "\tfield:" #type " " #item ";\t" \ 106 ret = trace_seq_printf(s, "\tfield:" #type " " #item ";\t" \
105 "offset:%zu;\tsize:0;\n", \ 107 "offset:%zu;\tsize:0;\tsigned:%u;\n", \
106 offsetof(typeof(field), item)); \ 108 offsetof(typeof(field), item), \
109 is_signed_type(type)); \
107 if (!ret) \ 110 if (!ret) \
108 return 0; 111 return 0;
109 112
@@ -131,7 +134,6 @@ ftrace_format_##name(struct ftrace_event_call *unused, \
131 134
132#include "trace_entries.h" 135#include "trace_entries.h"
133 136
134
135#undef __field 137#undef __field
136#define __field(type, item) \ 138#define __field(type, item) \
137 ret = trace_define_field(event_call, #type, #item, \ 139 ret = trace_define_field(event_call, #type, #item, \
@@ -193,6 +195,11 @@ ftrace_define_fields_##name(struct ftrace_event_call *event_call) \
193 195
194#include "trace_entries.h" 196#include "trace_entries.h"
195 197
198static int ftrace_raw_init_event(struct ftrace_event_call *call)
199{
200 INIT_LIST_HEAD(&call->fields);
201 return 0;
202}
196 203
197#undef __field 204#undef __field
198#define __field(type, item) 205#define __field(type, item)
@@ -211,7 +218,6 @@ ftrace_define_fields_##name(struct ftrace_event_call *event_call) \
211 218
212#undef FTRACE_ENTRY 219#undef FTRACE_ENTRY
213#define FTRACE_ENTRY(call, struct_name, type, tstruct, print) \ 220#define FTRACE_ENTRY(call, struct_name, type, tstruct, print) \
214static int ftrace_raw_init_event_##call(void); \
215 \ 221 \
216struct ftrace_event_call __used \ 222struct ftrace_event_call __used \
217__attribute__((__aligned__(4))) \ 223__attribute__((__aligned__(4))) \
@@ -219,14 +225,9 @@ __attribute__((section("_ftrace_events"))) event_##call = { \
219 .name = #call, \ 225 .name = #call, \
220 .id = type, \ 226 .id = type, \
221 .system = __stringify(TRACE_SYSTEM), \ 227 .system = __stringify(TRACE_SYSTEM), \
222 .raw_init = ftrace_raw_init_event_##call, \ 228 .raw_init = ftrace_raw_init_event, \
223 .show_format = ftrace_format_##call, \ 229 .show_format = ftrace_format_##call, \
224 .define_fields = ftrace_define_fields_##call, \ 230 .define_fields = ftrace_define_fields_##call, \
225}; \ 231}; \
226static int ftrace_raw_init_event_##call(void) \
227{ \
228 INIT_LIST_HEAD(&event_##call.fields); \
229 return 0; \
230} \
231 232
232#include "trace_entries.h" 233#include "trace_entries.h"
diff --git a/kernel/trace/trace_kprobe.c b/kernel/trace/trace_kprobe.c
new file mode 100644
index 000000000000..aff5f80b59b8
--- /dev/null
+++ b/kernel/trace/trace_kprobe.c
@@ -0,0 +1,1523 @@
1/*
2 * Kprobes-based tracing events
3 *
4 * Created by Masami Hiramatsu <mhiramat@redhat.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 version 2 as
8 * published by the Free Software Foundation.
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
20#include <linux/module.h>
21#include <linux/uaccess.h>
22#include <linux/kprobes.h>
23#include <linux/seq_file.h>
24#include <linux/slab.h>
25#include <linux/smp.h>
26#include <linux/debugfs.h>
27#include <linux/types.h>
28#include <linux/string.h>
29#include <linux/ctype.h>
30#include <linux/ptrace.h>
31#include <linux/perf_event.h>
32
33#include "trace.h"
34#include "trace_output.h"
35
36#define MAX_TRACE_ARGS 128
37#define MAX_ARGSTR_LEN 63
38#define MAX_EVENT_NAME_LEN 64
39#define KPROBE_EVENT_SYSTEM "kprobes"
40
41/* Reserved field names */
42#define FIELD_STRING_IP "__probe_ip"
43#define FIELD_STRING_NARGS "__probe_nargs"
44#define FIELD_STRING_RETIP "__probe_ret_ip"
45#define FIELD_STRING_FUNC "__probe_func"
46
47const char *reserved_field_names[] = {
48 "common_type",
49 "common_flags",
50 "common_preempt_count",
51 "common_pid",
52 "common_tgid",
53 "common_lock_depth",
54 FIELD_STRING_IP,
55 FIELD_STRING_NARGS,
56 FIELD_STRING_RETIP,
57 FIELD_STRING_FUNC,
58};
59
60struct fetch_func {
61 unsigned long (*func)(struct pt_regs *, void *);
62 void *data;
63};
64
65static __kprobes unsigned long call_fetch(struct fetch_func *f,
66 struct pt_regs *regs)
67{
68 return f->func(regs, f->data);
69}
70
71/* fetch handlers */
72static __kprobes unsigned long fetch_register(struct pt_regs *regs,
73 void *offset)
74{
75 return regs_get_register(regs, (unsigned int)((unsigned long)offset));
76}
77
78static __kprobes unsigned long fetch_stack(struct pt_regs *regs,
79 void *num)
80{
81 return regs_get_kernel_stack_nth(regs,
82 (unsigned int)((unsigned long)num));
83}
84
85static __kprobes unsigned long fetch_memory(struct pt_regs *regs, void *addr)
86{
87 unsigned long retval;
88
89 if (probe_kernel_address(addr, retval))
90 return 0;
91 return retval;
92}
93
94static __kprobes unsigned long fetch_argument(struct pt_regs *regs, void *num)
95{
96 return regs_get_argument_nth(regs, (unsigned int)((unsigned long)num));
97}
98
99static __kprobes unsigned long fetch_retvalue(struct pt_regs *regs,
100 void *dummy)
101{
102 return regs_return_value(regs);
103}
104
105static __kprobes unsigned long fetch_stack_address(struct pt_regs *regs,
106 void *dummy)
107{
108 return kernel_stack_pointer(regs);
109}
110
111/* Memory fetching by symbol */
112struct symbol_cache {
113 char *symbol;
114 long offset;
115 unsigned long addr;
116};
117
118static unsigned long update_symbol_cache(struct symbol_cache *sc)
119{
120 sc->addr = (unsigned long)kallsyms_lookup_name(sc->symbol);
121 if (sc->addr)
122 sc->addr += sc->offset;
123 return sc->addr;
124}
125
126static void free_symbol_cache(struct symbol_cache *sc)
127{
128 kfree(sc->symbol);
129 kfree(sc);
130}
131
132static struct symbol_cache *alloc_symbol_cache(const char *sym, long offset)
133{
134 struct symbol_cache *sc;
135
136 if (!sym || strlen(sym) == 0)
137 return NULL;
138 sc = kzalloc(sizeof(struct symbol_cache), GFP_KERNEL);
139 if (!sc)
140 return NULL;
141
142 sc->symbol = kstrdup(sym, GFP_KERNEL);
143 if (!sc->symbol) {
144 kfree(sc);
145 return NULL;
146 }
147 sc->offset = offset;
148
149 update_symbol_cache(sc);
150 return sc;
151}
152
153static __kprobes unsigned long fetch_symbol(struct pt_regs *regs, void *data)
154{
155 struct symbol_cache *sc = data;
156
157 if (sc->addr)
158 return fetch_memory(regs, (void *)sc->addr);
159 else
160 return 0;
161}
162
163/* Special indirect memory access interface */
164struct indirect_fetch_data {
165 struct fetch_func orig;
166 long offset;
167};
168
169static __kprobes unsigned long fetch_indirect(struct pt_regs *regs, void *data)
170{
171 struct indirect_fetch_data *ind = data;
172 unsigned long addr;
173
174 addr = call_fetch(&ind->orig, regs);
175 if (addr) {
176 addr += ind->offset;
177 return fetch_memory(regs, (void *)addr);
178 } else
179 return 0;
180}
181
182static __kprobes void free_indirect_fetch_data(struct indirect_fetch_data *data)
183{
184 if (data->orig.func == fetch_indirect)
185 free_indirect_fetch_data(data->orig.data);
186 else if (data->orig.func == fetch_symbol)
187 free_symbol_cache(data->orig.data);
188 kfree(data);
189}
190
191/**
192 * Kprobe event core functions
193 */
194
195struct probe_arg {
196 struct fetch_func fetch;
197 const char *name;
198};
199
200/* Flags for trace_probe */
201#define TP_FLAG_TRACE 1
202#define TP_FLAG_PROFILE 2
203
204struct trace_probe {
205 struct list_head list;
206 struct kretprobe rp; /* Use rp.kp for kprobe use */
207 unsigned long nhit;
208 unsigned int flags; /* For TP_FLAG_* */
209 const char *symbol; /* symbol name */
210 struct ftrace_event_call call;
211 struct trace_event event;
212 unsigned int nr_args;
213 struct probe_arg args[];
214};
215
216#define SIZEOF_TRACE_PROBE(n) \
217 (offsetof(struct trace_probe, args) + \
218 (sizeof(struct probe_arg) * (n)))
219
220static __kprobes int probe_is_return(struct trace_probe *tp)
221{
222 return tp->rp.handler != NULL;
223}
224
225static __kprobes const char *probe_symbol(struct trace_probe *tp)
226{
227 return tp->symbol ? tp->symbol : "unknown";
228}
229
230static int probe_arg_string(char *buf, size_t n, struct fetch_func *ff)
231{
232 int ret = -EINVAL;
233
234 if (ff->func == fetch_argument)
235 ret = snprintf(buf, n, "$arg%lu", (unsigned long)ff->data);
236 else if (ff->func == fetch_register) {
237 const char *name;
238 name = regs_query_register_name((unsigned int)((long)ff->data));
239 ret = snprintf(buf, n, "%%%s", name);
240 } else if (ff->func == fetch_stack)
241 ret = snprintf(buf, n, "$stack%lu", (unsigned long)ff->data);
242 else if (ff->func == fetch_memory)
243 ret = snprintf(buf, n, "@0x%p", ff->data);
244 else if (ff->func == fetch_symbol) {
245 struct symbol_cache *sc = ff->data;
246 if (sc->offset)
247 ret = snprintf(buf, n, "@%s%+ld", sc->symbol,
248 sc->offset);
249 else
250 ret = snprintf(buf, n, "@%s", sc->symbol);
251 } else if (ff->func == fetch_retvalue)
252 ret = snprintf(buf, n, "$retval");
253 else if (ff->func == fetch_stack_address)
254 ret = snprintf(buf, n, "$stack");
255 else if (ff->func == fetch_indirect) {
256 struct indirect_fetch_data *id = ff->data;
257 size_t l = 0;
258 ret = snprintf(buf, n, "%+ld(", id->offset);
259 if (ret >= n)
260 goto end;
261 l += ret;
262 ret = probe_arg_string(buf + l, n - l, &id->orig);
263 if (ret < 0)
264 goto end;
265 l += ret;
266 ret = snprintf(buf + l, n - l, ")");
267 ret += l;
268 }
269end:
270 if (ret >= n)
271 return -ENOSPC;
272 return ret;
273}
274
275static int register_probe_event(struct trace_probe *tp);
276static void unregister_probe_event(struct trace_probe *tp);
277
278static DEFINE_MUTEX(probe_lock);
279static LIST_HEAD(probe_list);
280
281static int kprobe_dispatcher(struct kprobe *kp, struct pt_regs *regs);
282static int kretprobe_dispatcher(struct kretprobe_instance *ri,
283 struct pt_regs *regs);
284
285/*
286 * Allocate new trace_probe and initialize it (including kprobes).
287 */
288static struct trace_probe *alloc_trace_probe(const char *group,
289 const char *event,
290 void *addr,
291 const char *symbol,
292 unsigned long offs,
293 int nargs, int is_return)
294{
295 struct trace_probe *tp;
296
297 tp = kzalloc(SIZEOF_TRACE_PROBE(nargs), GFP_KERNEL);
298 if (!tp)
299 return ERR_PTR(-ENOMEM);
300
301 if (symbol) {
302 tp->symbol = kstrdup(symbol, GFP_KERNEL);
303 if (!tp->symbol)
304 goto error;
305 tp->rp.kp.symbol_name = tp->symbol;
306 tp->rp.kp.offset = offs;
307 } else
308 tp->rp.kp.addr = addr;
309
310 if (is_return)
311 tp->rp.handler = kretprobe_dispatcher;
312 else
313 tp->rp.kp.pre_handler = kprobe_dispatcher;
314
315 if (!event)
316 goto error;
317 tp->call.name = kstrdup(event, GFP_KERNEL);
318 if (!tp->call.name)
319 goto error;
320
321 if (!group)
322 goto error;
323 tp->call.system = kstrdup(group, GFP_KERNEL);
324 if (!tp->call.system)
325 goto error;
326
327 INIT_LIST_HEAD(&tp->list);
328 return tp;
329error:
330 kfree(tp->call.name);
331 kfree(tp->symbol);
332 kfree(tp);
333 return ERR_PTR(-ENOMEM);
334}
335
336static void free_probe_arg(struct probe_arg *arg)
337{
338 if (arg->fetch.func == fetch_symbol)
339 free_symbol_cache(arg->fetch.data);
340 else if (arg->fetch.func == fetch_indirect)
341 free_indirect_fetch_data(arg->fetch.data);
342 kfree(arg->name);
343}
344
345static void free_trace_probe(struct trace_probe *tp)
346{
347 int i;
348
349 for (i = 0; i < tp->nr_args; i++)
350 free_probe_arg(&tp->args[i]);
351
352 kfree(tp->call.system);
353 kfree(tp->call.name);
354 kfree(tp->symbol);
355 kfree(tp);
356}
357
358static struct trace_probe *find_probe_event(const char *event,
359 const char *group)
360{
361 struct trace_probe *tp;
362
363 list_for_each_entry(tp, &probe_list, list)
364 if (strcmp(tp->call.name, event) == 0 &&
365 strcmp(tp->call.system, group) == 0)
366 return tp;
367 return NULL;
368}
369
370/* Unregister a trace_probe and probe_event: call with locking probe_lock */
371static void unregister_trace_probe(struct trace_probe *tp)
372{
373 if (probe_is_return(tp))
374 unregister_kretprobe(&tp->rp);
375 else
376 unregister_kprobe(&tp->rp.kp);
377 list_del(&tp->list);
378 unregister_probe_event(tp);
379}
380
381/* Register a trace_probe and probe_event */
382static int register_trace_probe(struct trace_probe *tp)
383{
384 struct trace_probe *old_tp;
385 int ret;
386
387 mutex_lock(&probe_lock);
388
389 /* register as an event */
390 old_tp = find_probe_event(tp->call.name, tp->call.system);
391 if (old_tp) {
392 /* delete old event */
393 unregister_trace_probe(old_tp);
394 free_trace_probe(old_tp);
395 }
396 ret = register_probe_event(tp);
397 if (ret) {
398 pr_warning("Faild to register probe event(%d)\n", ret);
399 goto end;
400 }
401
402 tp->rp.kp.flags |= KPROBE_FLAG_DISABLED;
403 if (probe_is_return(tp))
404 ret = register_kretprobe(&tp->rp);
405 else
406 ret = register_kprobe(&tp->rp.kp);
407
408 if (ret) {
409 pr_warning("Could not insert probe(%d)\n", ret);
410 if (ret == -EILSEQ) {
411 pr_warning("Probing address(0x%p) is not an "
412 "instruction boundary.\n",
413 tp->rp.kp.addr);
414 ret = -EINVAL;
415 }
416 unregister_probe_event(tp);
417 } else
418 list_add_tail(&tp->list, &probe_list);
419end:
420 mutex_unlock(&probe_lock);
421 return ret;
422}
423
424/* Split symbol and offset. */
425static int split_symbol_offset(char *symbol, unsigned long *offset)
426{
427 char *tmp;
428 int ret;
429
430 if (!offset)
431 return -EINVAL;
432
433 tmp = strchr(symbol, '+');
434 if (tmp) {
435 /* skip sign because strict_strtol doesn't accept '+' */
436 ret = strict_strtoul(tmp + 1, 0, offset);
437 if (ret)
438 return ret;
439 *tmp = '\0';
440 } else
441 *offset = 0;
442 return 0;
443}
444
445#define PARAM_MAX_ARGS 16
446#define PARAM_MAX_STACK (THREAD_SIZE / sizeof(unsigned long))
447
448static int parse_probe_vars(char *arg, struct fetch_func *ff, int is_return)
449{
450 int ret = 0;
451 unsigned long param;
452
453 if (strcmp(arg, "retval") == 0) {
454 if (is_return) {
455 ff->func = fetch_retvalue;
456 ff->data = NULL;
457 } else
458 ret = -EINVAL;
459 } else if (strncmp(arg, "stack", 5) == 0) {
460 if (arg[5] == '\0') {
461 ff->func = fetch_stack_address;
462 ff->data = NULL;
463 } else if (isdigit(arg[5])) {
464 ret = strict_strtoul(arg + 5, 10, &param);
465 if (ret || param > PARAM_MAX_STACK)
466 ret = -EINVAL;
467 else {
468 ff->func = fetch_stack;
469 ff->data = (void *)param;
470 }
471 } else
472 ret = -EINVAL;
473 } else if (strncmp(arg, "arg", 3) == 0 && isdigit(arg[3])) {
474 ret = strict_strtoul(arg + 3, 10, &param);
475 if (ret || param > PARAM_MAX_ARGS)
476 ret = -EINVAL;
477 else {
478 ff->func = fetch_argument;
479 ff->data = (void *)param;
480 }
481 } else
482 ret = -EINVAL;
483 return ret;
484}
485
486/* Recursive argument parser */
487static int __parse_probe_arg(char *arg, struct fetch_func *ff, int is_return)
488{
489 int ret = 0;
490 unsigned long param;
491 long offset;
492 char *tmp;
493
494 switch (arg[0]) {
495 case '$':
496 ret = parse_probe_vars(arg + 1, ff, is_return);
497 break;
498 case '%': /* named register */
499 ret = regs_query_register_offset(arg + 1);
500 if (ret >= 0) {
501 ff->func = fetch_register;
502 ff->data = (void *)(unsigned long)ret;
503 ret = 0;
504 }
505 break;
506 case '@': /* memory or symbol */
507 if (isdigit(arg[1])) {
508 ret = strict_strtoul(arg + 1, 0, &param);
509 if (ret)
510 break;
511 ff->func = fetch_memory;
512 ff->data = (void *)param;
513 } else {
514 ret = split_symbol_offset(arg + 1, &offset);
515 if (ret)
516 break;
517 ff->data = alloc_symbol_cache(arg + 1, offset);
518 if (ff->data)
519 ff->func = fetch_symbol;
520 else
521 ret = -EINVAL;
522 }
523 break;
524 case '+': /* indirect memory */
525 case '-':
526 tmp = strchr(arg, '(');
527 if (!tmp) {
528 ret = -EINVAL;
529 break;
530 }
531 *tmp = '\0';
532 ret = strict_strtol(arg + 1, 0, &offset);
533 if (ret)
534 break;
535 if (arg[0] == '-')
536 offset = -offset;
537 arg = tmp + 1;
538 tmp = strrchr(arg, ')');
539 if (tmp) {
540 struct indirect_fetch_data *id;
541 *tmp = '\0';
542 id = kzalloc(sizeof(struct indirect_fetch_data),
543 GFP_KERNEL);
544 if (!id)
545 return -ENOMEM;
546 id->offset = offset;
547 ret = __parse_probe_arg(arg, &id->orig, is_return);
548 if (ret)
549 kfree(id);
550 else {
551 ff->func = fetch_indirect;
552 ff->data = (void *)id;
553 }
554 } else
555 ret = -EINVAL;
556 break;
557 default:
558 /* TODO: support custom handler */
559 ret = -EINVAL;
560 }
561 return ret;
562}
563
564/* String length checking wrapper */
565static int parse_probe_arg(char *arg, struct fetch_func *ff, int is_return)
566{
567 if (strlen(arg) > MAX_ARGSTR_LEN) {
568 pr_info("Argument is too long.: %s\n", arg);
569 return -ENOSPC;
570 }
571 return __parse_probe_arg(arg, ff, is_return);
572}
573
574/* Return 1 if name is reserved or already used by another argument */
575static int conflict_field_name(const char *name,
576 struct probe_arg *args, int narg)
577{
578 int i;
579 for (i = 0; i < ARRAY_SIZE(reserved_field_names); i++)
580 if (strcmp(reserved_field_names[i], name) == 0)
581 return 1;
582 for (i = 0; i < narg; i++)
583 if (strcmp(args[i].name, name) == 0)
584 return 1;
585 return 0;
586}
587
588static int create_trace_probe(int argc, char **argv)
589{
590 /*
591 * Argument syntax:
592 * - Add kprobe: p[:[GRP/]EVENT] KSYM[+OFFS]|KADDR [FETCHARGS]
593 * - Add kretprobe: r[:[GRP/]EVENT] KSYM[+0] [FETCHARGS]
594 * Fetch args:
595 * $argN : fetch Nth of function argument. (N:0-)
596 * $retval : fetch return value
597 * $stack : fetch stack address
598 * $stackN : fetch Nth of stack (N:0-)
599 * @ADDR : fetch memory at ADDR (ADDR should be in kernel)
600 * @SYM[+|-offs] : fetch memory at SYM +|- offs (SYM is a data symbol)
601 * %REG : fetch register REG
602 * Indirect memory fetch:
603 * +|-offs(ARG) : fetch memory at ARG +|- offs address.
604 * Alias name of args:
605 * NAME=FETCHARG : set NAME as alias of FETCHARG.
606 */
607 struct trace_probe *tp;
608 int i, ret = 0;
609 int is_return = 0;
610 char *symbol = NULL, *event = NULL, *arg = NULL, *group = NULL;
611 unsigned long offset = 0;
612 void *addr = NULL;
613 char buf[MAX_EVENT_NAME_LEN];
614
615 if (argc < 2) {
616 pr_info("Probe point is not specified.\n");
617 return -EINVAL;
618 }
619
620 if (argv[0][0] == 'p')
621 is_return = 0;
622 else if (argv[0][0] == 'r')
623 is_return = 1;
624 else {
625 pr_info("Probe definition must be started with 'p' or 'r'.\n");
626 return -EINVAL;
627 }
628
629 if (argv[0][1] == ':') {
630 event = &argv[0][2];
631 if (strchr(event, '/')) {
632 group = event;
633 event = strchr(group, '/') + 1;
634 event[-1] = '\0';
635 if (strlen(group) == 0) {
636 pr_info("Group name is not specifiled\n");
637 return -EINVAL;
638 }
639 }
640 if (strlen(event) == 0) {
641 pr_info("Event name is not specifiled\n");
642 return -EINVAL;
643 }
644 }
645
646 if (isdigit(argv[1][0])) {
647 if (is_return) {
648 pr_info("Return probe point must be a symbol.\n");
649 return -EINVAL;
650 }
651 /* an address specified */
652 ret = strict_strtoul(&argv[0][2], 0, (unsigned long *)&addr);
653 if (ret) {
654 pr_info("Failed to parse address.\n");
655 return ret;
656 }
657 } else {
658 /* a symbol specified */
659 symbol = argv[1];
660 /* TODO: support .init module functions */
661 ret = split_symbol_offset(symbol, &offset);
662 if (ret) {
663 pr_info("Failed to parse symbol.\n");
664 return ret;
665 }
666 if (offset && is_return) {
667 pr_info("Return probe must be used without offset.\n");
668 return -EINVAL;
669 }
670 }
671 argc -= 2; argv += 2;
672
673 /* setup a probe */
674 if (!group)
675 group = KPROBE_EVENT_SYSTEM;
676 if (!event) {
677 /* Make a new event name */
678 if (symbol)
679 snprintf(buf, MAX_EVENT_NAME_LEN, "%c@%s%+ld",
680 is_return ? 'r' : 'p', symbol, offset);
681 else
682 snprintf(buf, MAX_EVENT_NAME_LEN, "%c@0x%p",
683 is_return ? 'r' : 'p', addr);
684 event = buf;
685 }
686 tp = alloc_trace_probe(group, event, addr, symbol, offset, argc,
687 is_return);
688 if (IS_ERR(tp)) {
689 pr_info("Failed to allocate trace_probe.(%d)\n",
690 (int)PTR_ERR(tp));
691 return PTR_ERR(tp);
692 }
693
694 /* parse arguments */
695 ret = 0;
696 for (i = 0; i < argc && i < MAX_TRACE_ARGS; i++) {
697 /* Parse argument name */
698 arg = strchr(argv[i], '=');
699 if (arg)
700 *arg++ = '\0';
701 else
702 arg = argv[i];
703
704 if (conflict_field_name(argv[i], tp->args, i)) {
705 pr_info("Argument%d name '%s' conflicts with "
706 "another field.\n", i, argv[i]);
707 ret = -EINVAL;
708 goto error;
709 }
710
711 tp->args[i].name = kstrdup(argv[i], GFP_KERNEL);
712 if (!tp->args[i].name) {
713 pr_info("Failed to allocate argument%d name '%s'.\n",
714 i, argv[i]);
715 ret = -ENOMEM;
716 goto error;
717 }
718
719 /* Parse fetch argument */
720 ret = parse_probe_arg(arg, &tp->args[i].fetch, is_return);
721 if (ret) {
722 pr_info("Parse error at argument%d. (%d)\n", i, ret);
723 kfree(tp->args[i].name);
724 goto error;
725 }
726
727 tp->nr_args++;
728 }
729
730 ret = register_trace_probe(tp);
731 if (ret)
732 goto error;
733 return 0;
734
735error:
736 free_trace_probe(tp);
737 return ret;
738}
739
740static void cleanup_all_probes(void)
741{
742 struct trace_probe *tp;
743
744 mutex_lock(&probe_lock);
745 /* TODO: Use batch unregistration */
746 while (!list_empty(&probe_list)) {
747 tp = list_entry(probe_list.next, struct trace_probe, list);
748 unregister_trace_probe(tp);
749 free_trace_probe(tp);
750 }
751 mutex_unlock(&probe_lock);
752}
753
754
755/* Probes listing interfaces */
756static void *probes_seq_start(struct seq_file *m, loff_t *pos)
757{
758 mutex_lock(&probe_lock);
759 return seq_list_start(&probe_list, *pos);
760}
761
762static void *probes_seq_next(struct seq_file *m, void *v, loff_t *pos)
763{
764 return seq_list_next(v, &probe_list, pos);
765}
766
767static void probes_seq_stop(struct seq_file *m, void *v)
768{
769 mutex_unlock(&probe_lock);
770}
771
772static int probes_seq_show(struct seq_file *m, void *v)
773{
774 struct trace_probe *tp = v;
775 int i, ret;
776 char buf[MAX_ARGSTR_LEN + 1];
777
778 seq_printf(m, "%c", probe_is_return(tp) ? 'r' : 'p');
779 seq_printf(m, ":%s/%s", tp->call.system, tp->call.name);
780
781 if (!tp->symbol)
782 seq_printf(m, " 0x%p", tp->rp.kp.addr);
783 else if (tp->rp.kp.offset)
784 seq_printf(m, " %s+%u", probe_symbol(tp), tp->rp.kp.offset);
785 else
786 seq_printf(m, " %s", probe_symbol(tp));
787
788 for (i = 0; i < tp->nr_args; i++) {
789 ret = probe_arg_string(buf, MAX_ARGSTR_LEN, &tp->args[i].fetch);
790 if (ret < 0) {
791 pr_warning("Argument%d decoding error(%d).\n", i, ret);
792 return ret;
793 }
794 seq_printf(m, " %s=%s", tp->args[i].name, buf);
795 }
796 seq_printf(m, "\n");
797 return 0;
798}
799
800static const struct seq_operations probes_seq_op = {
801 .start = probes_seq_start,
802 .next = probes_seq_next,
803 .stop = probes_seq_stop,
804 .show = probes_seq_show
805};
806
807static int probes_open(struct inode *inode, struct file *file)
808{
809 if ((file->f_mode & FMODE_WRITE) &&
810 (file->f_flags & O_TRUNC))
811 cleanup_all_probes();
812
813 return seq_open(file, &probes_seq_op);
814}
815
816static int command_trace_probe(const char *buf)
817{
818 char **argv;
819 int argc = 0, ret = 0;
820
821 argv = argv_split(GFP_KERNEL, buf, &argc);
822 if (!argv)
823 return -ENOMEM;
824
825 if (argc)
826 ret = create_trace_probe(argc, argv);
827
828 argv_free(argv);
829 return ret;
830}
831
832#define WRITE_BUFSIZE 128
833
834static ssize_t probes_write(struct file *file, const char __user *buffer,
835 size_t count, loff_t *ppos)
836{
837 char *kbuf, *tmp;
838 int ret;
839 size_t done;
840 size_t size;
841
842 kbuf = kmalloc(WRITE_BUFSIZE, GFP_KERNEL);
843 if (!kbuf)
844 return -ENOMEM;
845
846 ret = done = 0;
847 while (done < count) {
848 size = count - done;
849 if (size >= WRITE_BUFSIZE)
850 size = WRITE_BUFSIZE - 1;
851 if (copy_from_user(kbuf, buffer + done, size)) {
852 ret = -EFAULT;
853 goto out;
854 }
855 kbuf[size] = '\0';
856 tmp = strchr(kbuf, '\n');
857 if (tmp) {
858 *tmp = '\0';
859 size = tmp - kbuf + 1;
860 } else if (done + size < count) {
861 pr_warning("Line length is too long: "
862 "Should be less than %d.", WRITE_BUFSIZE);
863 ret = -EINVAL;
864 goto out;
865 }
866 done += size;
867 /* Remove comments */
868 tmp = strchr(kbuf, '#');
869 if (tmp)
870 *tmp = '\0';
871
872 ret = command_trace_probe(kbuf);
873 if (ret)
874 goto out;
875 }
876 ret = done;
877out:
878 kfree(kbuf);
879 return ret;
880}
881
882static const struct file_operations kprobe_events_ops = {
883 .owner = THIS_MODULE,
884 .open = probes_open,
885 .read = seq_read,
886 .llseek = seq_lseek,
887 .release = seq_release,
888 .write = probes_write,
889};
890
891/* Probes profiling interfaces */
892static int probes_profile_seq_show(struct seq_file *m, void *v)
893{
894 struct trace_probe *tp = v;
895
896 seq_printf(m, " %-44s %15lu %15lu\n", tp->call.name, tp->nhit,
897 tp->rp.kp.nmissed);
898
899 return 0;
900}
901
902static const struct seq_operations profile_seq_op = {
903 .start = probes_seq_start,
904 .next = probes_seq_next,
905 .stop = probes_seq_stop,
906 .show = probes_profile_seq_show
907};
908
909static int profile_open(struct inode *inode, struct file *file)
910{
911 return seq_open(file, &profile_seq_op);
912}
913
914static const struct file_operations kprobe_profile_ops = {
915 .owner = THIS_MODULE,
916 .open = profile_open,
917 .read = seq_read,
918 .llseek = seq_lseek,
919 .release = seq_release,
920};
921
922/* Kprobe handler */
923static __kprobes int kprobe_trace_func(struct kprobe *kp, struct pt_regs *regs)
924{
925 struct trace_probe *tp = container_of(kp, struct trace_probe, rp.kp);
926 struct kprobe_trace_entry *entry;
927 struct ring_buffer_event *event;
928 struct ring_buffer *buffer;
929 int size, i, pc;
930 unsigned long irq_flags;
931 struct ftrace_event_call *call = &tp->call;
932
933 tp->nhit++;
934
935 local_save_flags(irq_flags);
936 pc = preempt_count();
937
938 size = SIZEOF_KPROBE_TRACE_ENTRY(tp->nr_args);
939
940 event = trace_current_buffer_lock_reserve(&buffer, call->id, size,
941 irq_flags, pc);
942 if (!event)
943 return 0;
944
945 entry = ring_buffer_event_data(event);
946 entry->nargs = tp->nr_args;
947 entry->ip = (unsigned long)kp->addr;
948 for (i = 0; i < tp->nr_args; i++)
949 entry->args[i] = call_fetch(&tp->args[i].fetch, regs);
950
951 if (!filter_current_check_discard(buffer, call, entry, event))
952 trace_nowake_buffer_unlock_commit(buffer, event, irq_flags, pc);
953 return 0;
954}
955
956/* Kretprobe handler */
957static __kprobes int kretprobe_trace_func(struct kretprobe_instance *ri,
958 struct pt_regs *regs)
959{
960 struct trace_probe *tp = container_of(ri->rp, struct trace_probe, rp);
961 struct kretprobe_trace_entry *entry;
962 struct ring_buffer_event *event;
963 struct ring_buffer *buffer;
964 int size, i, pc;
965 unsigned long irq_flags;
966 struct ftrace_event_call *call = &tp->call;
967
968 local_save_flags(irq_flags);
969 pc = preempt_count();
970
971 size = SIZEOF_KRETPROBE_TRACE_ENTRY(tp->nr_args);
972
973 event = trace_current_buffer_lock_reserve(&buffer, call->id, size,
974 irq_flags, pc);
975 if (!event)
976 return 0;
977
978 entry = ring_buffer_event_data(event);
979 entry->nargs = tp->nr_args;
980 entry->func = (unsigned long)tp->rp.kp.addr;
981 entry->ret_ip = (unsigned long)ri->ret_addr;
982 for (i = 0; i < tp->nr_args; i++)
983 entry->args[i] = call_fetch(&tp->args[i].fetch, regs);
984
985 if (!filter_current_check_discard(buffer, call, entry, event))
986 trace_nowake_buffer_unlock_commit(buffer, event, irq_flags, pc);
987
988 return 0;
989}
990
991/* Event entry printers */
992enum print_line_t
993print_kprobe_event(struct trace_iterator *iter, int flags)
994{
995 struct kprobe_trace_entry *field;
996 struct trace_seq *s = &iter->seq;
997 struct trace_event *event;
998 struct trace_probe *tp;
999 int i;
1000
1001 field = (struct kprobe_trace_entry *)iter->ent;
1002 event = ftrace_find_event(field->ent.type);
1003 tp = container_of(event, struct trace_probe, event);
1004
1005 if (!trace_seq_printf(s, "%s: (", tp->call.name))
1006 goto partial;
1007
1008 if (!seq_print_ip_sym(s, field->ip, flags | TRACE_ITER_SYM_OFFSET))
1009 goto partial;
1010
1011 if (!trace_seq_puts(s, ")"))
1012 goto partial;
1013
1014 for (i = 0; i < field->nargs; i++)
1015 if (!trace_seq_printf(s, " %s=%lx",
1016 tp->args[i].name, field->args[i]))
1017 goto partial;
1018
1019 if (!trace_seq_puts(s, "\n"))
1020 goto partial;
1021
1022 return TRACE_TYPE_HANDLED;
1023partial:
1024 return TRACE_TYPE_PARTIAL_LINE;
1025}
1026
1027enum print_line_t
1028print_kretprobe_event(struct trace_iterator *iter, int flags)
1029{
1030 struct kretprobe_trace_entry *field;
1031 struct trace_seq *s = &iter->seq;
1032 struct trace_event *event;
1033 struct trace_probe *tp;
1034 int i;
1035
1036 field = (struct kretprobe_trace_entry *)iter->ent;
1037 event = ftrace_find_event(field->ent.type);
1038 tp = container_of(event, struct trace_probe, event);
1039
1040 if (!trace_seq_printf(s, "%s: (", tp->call.name))
1041 goto partial;
1042
1043 if (!seq_print_ip_sym(s, field->ret_ip, flags | TRACE_ITER_SYM_OFFSET))
1044 goto partial;
1045
1046 if (!trace_seq_puts(s, " <- "))
1047 goto partial;
1048
1049 if (!seq_print_ip_sym(s, field->func, flags & ~TRACE_ITER_SYM_OFFSET))
1050 goto partial;
1051
1052 if (!trace_seq_puts(s, ")"))
1053 goto partial;
1054
1055 for (i = 0; i < field->nargs; i++)
1056 if (!trace_seq_printf(s, " %s=%lx",
1057 tp->args[i].name, field->args[i]))
1058 goto partial;
1059
1060 if (!trace_seq_puts(s, "\n"))
1061 goto partial;
1062
1063 return TRACE_TYPE_HANDLED;
1064partial:
1065 return TRACE_TYPE_PARTIAL_LINE;
1066}
1067
1068static int probe_event_enable(struct ftrace_event_call *call)
1069{
1070 struct trace_probe *tp = (struct trace_probe *)call->data;
1071
1072 tp->flags |= TP_FLAG_TRACE;
1073 if (probe_is_return(tp))
1074 return enable_kretprobe(&tp->rp);
1075 else
1076 return enable_kprobe(&tp->rp.kp);
1077}
1078
1079static void probe_event_disable(struct ftrace_event_call *call)
1080{
1081 struct trace_probe *tp = (struct trace_probe *)call->data;
1082
1083 tp->flags &= ~TP_FLAG_TRACE;
1084 if (!(tp->flags & (TP_FLAG_TRACE | TP_FLAG_PROFILE))) {
1085 if (probe_is_return(tp))
1086 disable_kretprobe(&tp->rp);
1087 else
1088 disable_kprobe(&tp->rp.kp);
1089 }
1090}
1091
1092static int probe_event_raw_init(struct ftrace_event_call *event_call)
1093{
1094 INIT_LIST_HEAD(&event_call->fields);
1095
1096 return 0;
1097}
1098
1099#undef DEFINE_FIELD
1100#define DEFINE_FIELD(type, item, name, is_signed) \
1101 do { \
1102 ret = trace_define_field(event_call, #type, name, \
1103 offsetof(typeof(field), item), \
1104 sizeof(field.item), is_signed, \
1105 FILTER_OTHER); \
1106 if (ret) \
1107 return ret; \
1108 } while (0)
1109
1110static int kprobe_event_define_fields(struct ftrace_event_call *event_call)
1111{
1112 int ret, i;
1113 struct kprobe_trace_entry field;
1114 struct trace_probe *tp = (struct trace_probe *)event_call->data;
1115
1116 ret = trace_define_common_fields(event_call);
1117 if (!ret)
1118 return ret;
1119
1120 DEFINE_FIELD(unsigned long, ip, FIELD_STRING_IP, 0);
1121 DEFINE_FIELD(int, nargs, FIELD_STRING_NARGS, 1);
1122 /* Set argument names as fields */
1123 for (i = 0; i < tp->nr_args; i++)
1124 DEFINE_FIELD(unsigned long, args[i], tp->args[i].name, 0);
1125 return 0;
1126}
1127
1128static int kretprobe_event_define_fields(struct ftrace_event_call *event_call)
1129{
1130 int ret, i;
1131 struct kretprobe_trace_entry field;
1132 struct trace_probe *tp = (struct trace_probe *)event_call->data;
1133
1134 ret = trace_define_common_fields(event_call);
1135 if (!ret)
1136 return ret;
1137
1138 DEFINE_FIELD(unsigned long, func, FIELD_STRING_FUNC, 0);
1139 DEFINE_FIELD(unsigned long, ret_ip, FIELD_STRING_RETIP, 0);
1140 DEFINE_FIELD(int, nargs, FIELD_STRING_NARGS, 1);
1141 /* Set argument names as fields */
1142 for (i = 0; i < tp->nr_args; i++)
1143 DEFINE_FIELD(unsigned long, args[i], tp->args[i].name, 0);
1144 return 0;
1145}
1146
1147static int __probe_event_show_format(struct trace_seq *s,
1148 struct trace_probe *tp, const char *fmt,
1149 const char *arg)
1150{
1151 int i;
1152
1153 /* Show format */
1154 if (!trace_seq_printf(s, "\nprint fmt: \"%s", fmt))
1155 return 0;
1156
1157 for (i = 0; i < tp->nr_args; i++)
1158 if (!trace_seq_printf(s, " %s=%%lx", tp->args[i].name))
1159 return 0;
1160
1161 if (!trace_seq_printf(s, "\", %s", arg))
1162 return 0;
1163
1164 for (i = 0; i < tp->nr_args; i++)
1165 if (!trace_seq_printf(s, ", REC->%s", tp->args[i].name))
1166 return 0;
1167
1168 return trace_seq_puts(s, "\n");
1169}
1170
1171#undef SHOW_FIELD
1172#define SHOW_FIELD(type, item, name) \
1173 do { \
1174 ret = trace_seq_printf(s, "\tfield: " #type " %s;\t" \
1175 "offset:%u;\tsize:%u;\n", name, \
1176 (unsigned int)offsetof(typeof(field), item),\
1177 (unsigned int)sizeof(type)); \
1178 if (!ret) \
1179 return 0; \
1180 } while (0)
1181
1182static int kprobe_event_show_format(struct ftrace_event_call *call,
1183 struct trace_seq *s)
1184{
1185 struct kprobe_trace_entry field __attribute__((unused));
1186 int ret, i;
1187 struct trace_probe *tp = (struct trace_probe *)call->data;
1188
1189 SHOW_FIELD(unsigned long, ip, FIELD_STRING_IP);
1190 SHOW_FIELD(int, nargs, FIELD_STRING_NARGS);
1191
1192 /* Show fields */
1193 for (i = 0; i < tp->nr_args; i++)
1194 SHOW_FIELD(unsigned long, args[i], tp->args[i].name);
1195 trace_seq_puts(s, "\n");
1196
1197 return __probe_event_show_format(s, tp, "(%lx)",
1198 "REC->" FIELD_STRING_IP);
1199}
1200
1201static int kretprobe_event_show_format(struct ftrace_event_call *call,
1202 struct trace_seq *s)
1203{
1204 struct kretprobe_trace_entry field __attribute__((unused));
1205 int ret, i;
1206 struct trace_probe *tp = (struct trace_probe *)call->data;
1207
1208 SHOW_FIELD(unsigned long, func, FIELD_STRING_FUNC);
1209 SHOW_FIELD(unsigned long, ret_ip, FIELD_STRING_RETIP);
1210 SHOW_FIELD(int, nargs, FIELD_STRING_NARGS);
1211
1212 /* Show fields */
1213 for (i = 0; i < tp->nr_args; i++)
1214 SHOW_FIELD(unsigned long, args[i], tp->args[i].name);
1215 trace_seq_puts(s, "\n");
1216
1217 return __probe_event_show_format(s, tp, "(%lx <- %lx)",
1218 "REC->" FIELD_STRING_FUNC
1219 ", REC->" FIELD_STRING_RETIP);
1220}
1221
1222#ifdef CONFIG_EVENT_PROFILE
1223
1224/* Kprobe profile handler */
1225static __kprobes int kprobe_profile_func(struct kprobe *kp,
1226 struct pt_regs *regs)
1227{
1228 struct trace_probe *tp = container_of(kp, struct trace_probe, rp.kp);
1229 struct ftrace_event_call *call = &tp->call;
1230 struct kprobe_trace_entry *entry;
1231 struct trace_entry *ent;
1232 int size, __size, i, pc, __cpu;
1233 unsigned long irq_flags;
1234 char *trace_buf;
1235 char *raw_data;
1236 int rctx;
1237
1238 pc = preempt_count();
1239 __size = SIZEOF_KPROBE_TRACE_ENTRY(tp->nr_args);
1240 size = ALIGN(__size + sizeof(u32), sizeof(u64));
1241 size -= sizeof(u32);
1242 if (WARN_ONCE(size > FTRACE_MAX_PROFILE_SIZE,
1243 "profile buffer not large enough"))
1244 return 0;
1245
1246 /*
1247 * Protect the non nmi buffer
1248 * This also protects the rcu read side
1249 */
1250 local_irq_save(irq_flags);
1251
1252 rctx = perf_swevent_get_recursion_context();
1253 if (rctx < 0)
1254 goto end_recursion;
1255
1256 __cpu = smp_processor_id();
1257
1258 if (in_nmi())
1259 trace_buf = rcu_dereference(perf_trace_buf_nmi);
1260 else
1261 trace_buf = rcu_dereference(perf_trace_buf);
1262
1263 if (!trace_buf)
1264 goto end;
1265
1266 raw_data = per_cpu_ptr(trace_buf, __cpu);
1267
1268 /* Zero dead bytes from alignment to avoid buffer leak to userspace */
1269 *(u64 *)(&raw_data[size - sizeof(u64)]) = 0ULL;
1270 entry = (struct kprobe_trace_entry *)raw_data;
1271 ent = &entry->ent;
1272
1273 tracing_generic_entry_update(ent, irq_flags, pc);
1274 ent->type = call->id;
1275 entry->nargs = tp->nr_args;
1276 entry->ip = (unsigned long)kp->addr;
1277 for (i = 0; i < tp->nr_args; i++)
1278 entry->args[i] = call_fetch(&tp->args[i].fetch, regs);
1279 perf_tp_event(call->id, entry->ip, 1, entry, size);
1280
1281end:
1282 perf_swevent_put_recursion_context(rctx);
1283end_recursion:
1284 local_irq_restore(irq_flags);
1285
1286 return 0;
1287}
1288
1289/* Kretprobe profile handler */
1290static __kprobes int kretprobe_profile_func(struct kretprobe_instance *ri,
1291 struct pt_regs *regs)
1292{
1293 struct trace_probe *tp = container_of(ri->rp, struct trace_probe, rp);
1294 struct ftrace_event_call *call = &tp->call;
1295 struct kretprobe_trace_entry *entry;
1296 struct trace_entry *ent;
1297 int size, __size, i, pc, __cpu;
1298 unsigned long irq_flags;
1299 char *trace_buf;
1300 char *raw_data;
1301 int rctx;
1302
1303 pc = preempt_count();
1304 __size = SIZEOF_KRETPROBE_TRACE_ENTRY(tp->nr_args);
1305 size = ALIGN(__size + sizeof(u32), sizeof(u64));
1306 size -= sizeof(u32);
1307 if (WARN_ONCE(size > FTRACE_MAX_PROFILE_SIZE,
1308 "profile buffer not large enough"))
1309 return 0;
1310
1311 /*
1312 * Protect the non nmi buffer
1313 * This also protects the rcu read side
1314 */
1315 local_irq_save(irq_flags);
1316
1317 rctx = perf_swevent_get_recursion_context();
1318 if (rctx < 0)
1319 goto end_recursion;
1320
1321 __cpu = smp_processor_id();
1322
1323 if (in_nmi())
1324 trace_buf = rcu_dereference(perf_trace_buf_nmi);
1325 else
1326 trace_buf = rcu_dereference(perf_trace_buf);
1327
1328 if (!trace_buf)
1329 goto end;
1330
1331 raw_data = per_cpu_ptr(trace_buf, __cpu);
1332
1333 /* Zero dead bytes from alignment to avoid buffer leak to userspace */
1334 *(u64 *)(&raw_data[size - sizeof(u64)]) = 0ULL;
1335 entry = (struct kretprobe_trace_entry *)raw_data;
1336 ent = &entry->ent;
1337
1338 tracing_generic_entry_update(ent, irq_flags, pc);
1339 ent->type = call->id;
1340 entry->nargs = tp->nr_args;
1341 entry->func = (unsigned long)tp->rp.kp.addr;
1342 entry->ret_ip = (unsigned long)ri->ret_addr;
1343 for (i = 0; i < tp->nr_args; i++)
1344 entry->args[i] = call_fetch(&tp->args[i].fetch, regs);
1345 perf_tp_event(call->id, entry->ret_ip, 1, entry, size);
1346
1347end:
1348 perf_swevent_put_recursion_context(rctx);
1349end_recursion:
1350 local_irq_restore(irq_flags);
1351
1352 return 0;
1353}
1354
1355static int probe_profile_enable(struct ftrace_event_call *call)
1356{
1357 struct trace_probe *tp = (struct trace_probe *)call->data;
1358
1359 tp->flags |= TP_FLAG_PROFILE;
1360
1361 if (probe_is_return(tp))
1362 return enable_kretprobe(&tp->rp);
1363 else
1364 return enable_kprobe(&tp->rp.kp);
1365}
1366
1367static void probe_profile_disable(struct ftrace_event_call *call)
1368{
1369 struct trace_probe *tp = (struct trace_probe *)call->data;
1370
1371 tp->flags &= ~TP_FLAG_PROFILE;
1372
1373 if (!(tp->flags & TP_FLAG_TRACE)) {
1374 if (probe_is_return(tp))
1375 disable_kretprobe(&tp->rp);
1376 else
1377 disable_kprobe(&tp->rp.kp);
1378 }
1379}
1380#endif /* CONFIG_EVENT_PROFILE */
1381
1382
1383static __kprobes
1384int kprobe_dispatcher(struct kprobe *kp, struct pt_regs *regs)
1385{
1386 struct trace_probe *tp = container_of(kp, struct trace_probe, rp.kp);
1387
1388 if (tp->flags & TP_FLAG_TRACE)
1389 kprobe_trace_func(kp, regs);
1390#ifdef CONFIG_EVENT_PROFILE
1391 if (tp->flags & TP_FLAG_PROFILE)
1392 kprobe_profile_func(kp, regs);
1393#endif /* CONFIG_EVENT_PROFILE */
1394 return 0; /* We don't tweek kernel, so just return 0 */
1395}
1396
1397static __kprobes
1398int kretprobe_dispatcher(struct kretprobe_instance *ri, struct pt_regs *regs)
1399{
1400 struct trace_probe *tp = container_of(ri->rp, struct trace_probe, rp);
1401
1402 if (tp->flags & TP_FLAG_TRACE)
1403 kretprobe_trace_func(ri, regs);
1404#ifdef CONFIG_EVENT_PROFILE
1405 if (tp->flags & TP_FLAG_PROFILE)
1406 kretprobe_profile_func(ri, regs);
1407#endif /* CONFIG_EVENT_PROFILE */
1408 return 0; /* We don't tweek kernel, so just return 0 */
1409}
1410
1411static int register_probe_event(struct trace_probe *tp)
1412{
1413 struct ftrace_event_call *call = &tp->call;
1414 int ret;
1415
1416 /* Initialize ftrace_event_call */
1417 if (probe_is_return(tp)) {
1418 tp->event.trace = print_kretprobe_event;
1419 call->raw_init = probe_event_raw_init;
1420 call->show_format = kretprobe_event_show_format;
1421 call->define_fields = kretprobe_event_define_fields;
1422 } else {
1423 tp->event.trace = print_kprobe_event;
1424 call->raw_init = probe_event_raw_init;
1425 call->show_format = kprobe_event_show_format;
1426 call->define_fields = kprobe_event_define_fields;
1427 }
1428 call->event = &tp->event;
1429 call->id = register_ftrace_event(&tp->event);
1430 if (!call->id)
1431 return -ENODEV;
1432 call->enabled = 0;
1433 call->regfunc = probe_event_enable;
1434 call->unregfunc = probe_event_disable;
1435
1436#ifdef CONFIG_EVENT_PROFILE
1437 atomic_set(&call->profile_count, -1);
1438 call->profile_enable = probe_profile_enable;
1439 call->profile_disable = probe_profile_disable;
1440#endif
1441 call->data = tp;
1442 ret = trace_add_event_call(call);
1443 if (ret) {
1444 pr_info("Failed to register kprobe event: %s\n", call->name);
1445 unregister_ftrace_event(&tp->event);
1446 }
1447 return ret;
1448}
1449
1450static void unregister_probe_event(struct trace_probe *tp)
1451{
1452 /* tp->event is unregistered in trace_remove_event_call() */
1453 trace_remove_event_call(&tp->call);
1454}
1455
1456/* Make a debugfs interface for controling probe points */
1457static __init int init_kprobe_trace(void)
1458{
1459 struct dentry *d_tracer;
1460 struct dentry *entry;
1461
1462 d_tracer = tracing_init_dentry();
1463 if (!d_tracer)
1464 return 0;
1465
1466 entry = debugfs_create_file("kprobe_events", 0644, d_tracer,
1467 NULL, &kprobe_events_ops);
1468
1469 /* Event list interface */
1470 if (!entry)
1471 pr_warning("Could not create debugfs "
1472 "'kprobe_events' entry\n");
1473
1474 /* Profile interface */
1475 entry = debugfs_create_file("kprobe_profile", 0444, d_tracer,
1476 NULL, &kprobe_profile_ops);
1477
1478 if (!entry)
1479 pr_warning("Could not create debugfs "
1480 "'kprobe_profile' entry\n");
1481 return 0;
1482}
1483fs_initcall(init_kprobe_trace);
1484
1485
1486#ifdef CONFIG_FTRACE_STARTUP_TEST
1487
1488static int kprobe_trace_selftest_target(int a1, int a2, int a3,
1489 int a4, int a5, int a6)
1490{
1491 return a1 + a2 + a3 + a4 + a5 + a6;
1492}
1493
1494static __init int kprobe_trace_self_tests_init(void)
1495{
1496 int ret;
1497 int (*target)(int, int, int, int, int, int);
1498
1499 target = kprobe_trace_selftest_target;
1500
1501 pr_info("Testing kprobe tracing: ");
1502
1503 ret = command_trace_probe("p:testprobe kprobe_trace_selftest_target "
1504 "$arg1 $arg2 $arg3 $arg4 $stack $stack0");
1505 if (WARN_ON_ONCE(ret))
1506 pr_warning("error enabling function entry\n");
1507
1508 ret = command_trace_probe("r:testprobe2 kprobe_trace_selftest_target "
1509 "$retval");
1510 if (WARN_ON_ONCE(ret))
1511 pr_warning("error enabling function return\n");
1512
1513 ret = target(1, 2, 3, 4, 5, 6);
1514
1515 cleanup_all_probes();
1516
1517 pr_cont("OK\n");
1518 return 0;
1519}
1520
1521late_initcall(kprobe_trace_self_tests_init);
1522
1523#endif
diff --git a/kernel/trace/trace_ksym.c b/kernel/trace/trace_ksym.c
new file mode 100644
index 000000000000..ddfa0fd43bc0
--- /dev/null
+++ b/kernel/trace/trace_ksym.c
@@ -0,0 +1,550 @@
1/*
2 * trace_ksym.c - Kernel Symbol Tracer
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 (C) IBM Corporation, 2009
19 */
20
21#include <linux/kallsyms.h>
22#include <linux/uaccess.h>
23#include <linux/debugfs.h>
24#include <linux/ftrace.h>
25#include <linux/module.h>
26#include <linux/fs.h>
27
28#include "trace_output.h"
29#include "trace_stat.h"
30#include "trace.h"
31
32#include <linux/hw_breakpoint.h>
33#include <asm/hw_breakpoint.h>
34
35/*
36 * For now, let us restrict the no. of symbols traced simultaneously to number
37 * of available hardware breakpoint registers.
38 */
39#define KSYM_TRACER_MAX HBP_NUM
40
41#define KSYM_TRACER_OP_LEN 3 /* rw- */
42
43struct trace_ksym {
44 struct perf_event **ksym_hbp;
45 struct perf_event_attr attr;
46#ifdef CONFIG_PROFILE_KSYM_TRACER
47 unsigned long counter;
48#endif
49 struct hlist_node ksym_hlist;
50};
51
52static struct trace_array *ksym_trace_array;
53
54static unsigned int ksym_filter_entry_count;
55static unsigned int ksym_tracing_enabled;
56
57static HLIST_HEAD(ksym_filter_head);
58
59static DEFINE_MUTEX(ksym_tracer_mutex);
60
61#ifdef CONFIG_PROFILE_KSYM_TRACER
62
63#define MAX_UL_INT 0xffffffff
64
65void ksym_collect_stats(unsigned long hbp_hit_addr)
66{
67 struct hlist_node *node;
68 struct trace_ksym *entry;
69
70 rcu_read_lock();
71 hlist_for_each_entry_rcu(entry, node, &ksym_filter_head, ksym_hlist) {
72 if ((entry->attr.bp_addr == hbp_hit_addr) &&
73 (entry->counter <= MAX_UL_INT)) {
74 entry->counter++;
75 break;
76 }
77 }
78 rcu_read_unlock();
79}
80#endif /* CONFIG_PROFILE_KSYM_TRACER */
81
82void ksym_hbp_handler(struct perf_event *hbp, void *data)
83{
84 struct ring_buffer_event *event;
85 struct ksym_trace_entry *entry;
86 struct pt_regs *regs = data;
87 struct ring_buffer *buffer;
88 int pc;
89
90 if (!ksym_tracing_enabled)
91 return;
92
93 buffer = ksym_trace_array->buffer;
94
95 pc = preempt_count();
96
97 event = trace_buffer_lock_reserve(buffer, TRACE_KSYM,
98 sizeof(*entry), 0, pc);
99 if (!event)
100 return;
101
102 entry = ring_buffer_event_data(event);
103 entry->ip = instruction_pointer(regs);
104 entry->type = hw_breakpoint_type(hbp);
105 entry->addr = hw_breakpoint_addr(hbp);
106 strlcpy(entry->cmd, current->comm, TASK_COMM_LEN);
107
108#ifdef CONFIG_PROFILE_KSYM_TRACER
109 ksym_collect_stats(hw_breakpoint_addr(hbp));
110#endif /* CONFIG_PROFILE_KSYM_TRACER */
111
112 trace_buffer_unlock_commit(buffer, event, 0, pc);
113}
114
115/* Valid access types are represented as
116 *
117 * rw- : Set Read/Write Access Breakpoint
118 * -w- : Set Write Access Breakpoint
119 * --- : Clear Breakpoints
120 * --x : Set Execution Break points (Not available yet)
121 *
122 */
123static int ksym_trace_get_access_type(char *str)
124{
125 int access = 0;
126
127 if (str[0] == 'r')
128 access |= HW_BREAKPOINT_R;
129
130 if (str[1] == 'w')
131 access |= HW_BREAKPOINT_W;
132
133 if (str[2] == 'x')
134 access |= HW_BREAKPOINT_X;
135
136 switch (access) {
137 case HW_BREAKPOINT_R:
138 case HW_BREAKPOINT_W:
139 case HW_BREAKPOINT_W | HW_BREAKPOINT_R:
140 return access;
141 default:
142 return -EINVAL;
143 }
144}
145
146/*
147 * There can be several possible malformed requests and we attempt to capture
148 * all of them. We enumerate some of the rules
149 * 1. We will not allow kernel symbols with ':' since it is used as a delimiter.
150 * i.e. multiple ':' symbols disallowed. Possible uses are of the form
151 * <module>:<ksym_name>:<op>.
152 * 2. No delimiter symbol ':' in the input string
153 * 3. Spurious operator symbols or symbols not in their respective positions
154 * 4. <ksym_name>:--- i.e. clear breakpoint request when ksym_name not in file
155 * 5. Kernel symbol not a part of /proc/kallsyms
156 * 6. Duplicate requests
157 */
158static int parse_ksym_trace_str(char *input_string, char **ksymname,
159 unsigned long *addr)
160{
161 int ret;
162
163 *ksymname = strsep(&input_string, ":");
164 *addr = kallsyms_lookup_name(*ksymname);
165
166 /* Check for malformed request: (2), (1) and (5) */
167 if ((!input_string) ||
168 (strlen(input_string) != KSYM_TRACER_OP_LEN) ||
169 (*addr == 0))
170 return -EINVAL;;
171
172 ret = ksym_trace_get_access_type(input_string);
173
174 return ret;
175}
176
177int process_new_ksym_entry(char *ksymname, int op, unsigned long addr)
178{
179 struct trace_ksym *entry;
180 int ret = -ENOMEM;
181
182 if (ksym_filter_entry_count >= KSYM_TRACER_MAX) {
183 printk(KERN_ERR "ksym_tracer: Maximum limit:(%d) reached. No"
184 " new requests for tracing can be accepted now.\n",
185 KSYM_TRACER_MAX);
186 return -ENOSPC;
187 }
188
189 entry = kzalloc(sizeof(struct trace_ksym), GFP_KERNEL);
190 if (!entry)
191 return -ENOMEM;
192
193 hw_breakpoint_init(&entry->attr);
194
195 entry->attr.bp_type = op;
196 entry->attr.bp_addr = addr;
197 entry->attr.bp_len = HW_BREAKPOINT_LEN_4;
198
199 ret = -EAGAIN;
200 entry->ksym_hbp = register_wide_hw_breakpoint(&entry->attr,
201 ksym_hbp_handler);
202
203 if (IS_ERR(entry->ksym_hbp)) {
204 ret = PTR_ERR(entry->ksym_hbp);
205 printk(KERN_INFO "ksym_tracer request failed. Try again"
206 " later!!\n");
207 goto err;
208 }
209
210 hlist_add_head_rcu(&(entry->ksym_hlist), &ksym_filter_head);
211 ksym_filter_entry_count++;
212
213 return 0;
214
215err:
216 kfree(entry);
217
218 return ret;
219}
220
221static ssize_t ksym_trace_filter_read(struct file *filp, char __user *ubuf,
222 size_t count, loff_t *ppos)
223{
224 struct trace_ksym *entry;
225 struct hlist_node *node;
226 struct trace_seq *s;
227 ssize_t cnt = 0;
228 int ret;
229
230 s = kmalloc(sizeof(*s), GFP_KERNEL);
231 if (!s)
232 return -ENOMEM;
233 trace_seq_init(s);
234
235 mutex_lock(&ksym_tracer_mutex);
236
237 hlist_for_each_entry(entry, node, &ksym_filter_head, ksym_hlist) {
238 ret = trace_seq_printf(s, "%pS:", (void *)entry->attr.bp_addr);
239 if (entry->attr.bp_type == HW_BREAKPOINT_R)
240 ret = trace_seq_puts(s, "r--\n");
241 else if (entry->attr.bp_type == HW_BREAKPOINT_W)
242 ret = trace_seq_puts(s, "-w-\n");
243 else if (entry->attr.bp_type == (HW_BREAKPOINT_W | HW_BREAKPOINT_R))
244 ret = trace_seq_puts(s, "rw-\n");
245 WARN_ON_ONCE(!ret);
246 }
247
248 cnt = simple_read_from_buffer(ubuf, count, ppos, s->buffer, s->len);
249
250 mutex_unlock(&ksym_tracer_mutex);
251
252 kfree(s);
253
254 return cnt;
255}
256
257static void __ksym_trace_reset(void)
258{
259 struct trace_ksym *entry;
260 struct hlist_node *node, *node1;
261
262 mutex_lock(&ksym_tracer_mutex);
263 hlist_for_each_entry_safe(entry, node, node1, &ksym_filter_head,
264 ksym_hlist) {
265 unregister_wide_hw_breakpoint(entry->ksym_hbp);
266 ksym_filter_entry_count--;
267 hlist_del_rcu(&(entry->ksym_hlist));
268 synchronize_rcu();
269 kfree(entry);
270 }
271 mutex_unlock(&ksym_tracer_mutex);
272}
273
274static ssize_t ksym_trace_filter_write(struct file *file,
275 const char __user *buffer,
276 size_t count, loff_t *ppos)
277{
278 struct trace_ksym *entry;
279 struct hlist_node *node;
280 char *input_string, *ksymname = NULL;
281 unsigned long ksym_addr = 0;
282 int ret, op, changed = 0;
283
284 input_string = kzalloc(count + 1, GFP_KERNEL);
285 if (!input_string)
286 return -ENOMEM;
287
288 if (copy_from_user(input_string, buffer, count)) {
289 kfree(input_string);
290 return -EFAULT;
291 }
292 input_string[count] = '\0';
293
294 strstrip(input_string);
295
296 /*
297 * Clear all breakpoints if:
298 * 1: echo > ksym_trace_filter
299 * 2: echo 0 > ksym_trace_filter
300 * 3: echo "*:---" > ksym_trace_filter
301 */
302 if (!input_string[0] || !strcmp(input_string, "0") ||
303 !strcmp(input_string, "*:---")) {
304 __ksym_trace_reset();
305 kfree(input_string);
306 return count;
307 }
308
309 ret = op = parse_ksym_trace_str(input_string, &ksymname, &ksym_addr);
310 if (ret < 0) {
311 kfree(input_string);
312 return ret;
313 }
314
315 mutex_lock(&ksym_tracer_mutex);
316
317 ret = -EINVAL;
318 hlist_for_each_entry(entry, node, &ksym_filter_head, ksym_hlist) {
319 if (entry->attr.bp_addr == ksym_addr) {
320 /* Check for malformed request: (6) */
321 if (entry->attr.bp_type != op)
322 changed = 1;
323 else
324 goto out;
325 break;
326 }
327 }
328 if (changed) {
329 unregister_wide_hw_breakpoint(entry->ksym_hbp);
330 entry->attr.bp_type = op;
331 ret = 0;
332 if (op > 0) {
333 entry->ksym_hbp =
334 register_wide_hw_breakpoint(&entry->attr,
335 ksym_hbp_handler);
336 if (IS_ERR(entry->ksym_hbp))
337 ret = PTR_ERR(entry->ksym_hbp);
338 else
339 goto out;
340 }
341 /* Error or "symbol:---" case: drop it */
342 ksym_filter_entry_count--;
343 hlist_del_rcu(&(entry->ksym_hlist));
344 synchronize_rcu();
345 kfree(entry);
346 goto out;
347 } else {
348 /* Check for malformed request: (4) */
349 if (op == 0)
350 goto out;
351 ret = process_new_ksym_entry(ksymname, op, ksym_addr);
352 }
353out:
354 mutex_unlock(&ksym_tracer_mutex);
355
356 kfree(input_string);
357
358 if (!ret)
359 ret = count;
360 return ret;
361}
362
363static const struct file_operations ksym_tracing_fops = {
364 .open = tracing_open_generic,
365 .read = ksym_trace_filter_read,
366 .write = ksym_trace_filter_write,
367};
368
369static void ksym_trace_reset(struct trace_array *tr)
370{
371 ksym_tracing_enabled = 0;
372 __ksym_trace_reset();
373}
374
375static int ksym_trace_init(struct trace_array *tr)
376{
377 int cpu, ret = 0;
378
379 for_each_online_cpu(cpu)
380 tracing_reset(tr, cpu);
381 ksym_tracing_enabled = 1;
382 ksym_trace_array = tr;
383
384 return ret;
385}
386
387static void ksym_trace_print_header(struct seq_file *m)
388{
389 seq_puts(m,
390 "# TASK-PID CPU# Symbol "
391 "Type Function\n");
392 seq_puts(m,
393 "# | | | "
394 " | |\n");
395}
396
397static enum print_line_t ksym_trace_output(struct trace_iterator *iter)
398{
399 struct trace_entry *entry = iter->ent;
400 struct trace_seq *s = &iter->seq;
401 struct ksym_trace_entry *field;
402 char str[KSYM_SYMBOL_LEN];
403 int ret;
404
405 if (entry->type != TRACE_KSYM)
406 return TRACE_TYPE_UNHANDLED;
407
408 trace_assign_type(field, entry);
409
410 ret = trace_seq_printf(s, "%11s-%-5d [%03d] %pS", field->cmd,
411 entry->pid, iter->cpu, (char *)field->addr);
412 if (!ret)
413 return TRACE_TYPE_PARTIAL_LINE;
414
415 switch (field->type) {
416 case HW_BREAKPOINT_R:
417 ret = trace_seq_printf(s, " R ");
418 break;
419 case HW_BREAKPOINT_W:
420 ret = trace_seq_printf(s, " W ");
421 break;
422 case HW_BREAKPOINT_R | HW_BREAKPOINT_W:
423 ret = trace_seq_printf(s, " RW ");
424 break;
425 default:
426 return TRACE_TYPE_PARTIAL_LINE;
427 }
428
429 if (!ret)
430 return TRACE_TYPE_PARTIAL_LINE;
431
432 sprint_symbol(str, field->ip);
433 ret = trace_seq_printf(s, "%s\n", str);
434 if (!ret)
435 return TRACE_TYPE_PARTIAL_LINE;
436
437 return TRACE_TYPE_HANDLED;
438}
439
440struct tracer ksym_tracer __read_mostly =
441{
442 .name = "ksym_tracer",
443 .init = ksym_trace_init,
444 .reset = ksym_trace_reset,
445#ifdef CONFIG_FTRACE_SELFTEST
446 .selftest = trace_selftest_startup_ksym,
447#endif
448 .print_header = ksym_trace_print_header,
449 .print_line = ksym_trace_output
450};
451
452__init static int init_ksym_trace(void)
453{
454 struct dentry *d_tracer;
455 struct dentry *entry;
456
457 d_tracer = tracing_init_dentry();
458 ksym_filter_entry_count = 0;
459
460 entry = debugfs_create_file("ksym_trace_filter", 0644, d_tracer,
461 NULL, &ksym_tracing_fops);
462 if (!entry)
463 pr_warning("Could not create debugfs "
464 "'ksym_trace_filter' file\n");
465
466 return register_tracer(&ksym_tracer);
467}
468device_initcall(init_ksym_trace);
469
470
471#ifdef CONFIG_PROFILE_KSYM_TRACER
472static int ksym_tracer_stat_headers(struct seq_file *m)
473{
474 seq_puts(m, " Access Type ");
475 seq_puts(m, " Symbol Counter\n");
476 seq_puts(m, " ----------- ");
477 seq_puts(m, " ------ -------\n");
478 return 0;
479}
480
481static int ksym_tracer_stat_show(struct seq_file *m, void *v)
482{
483 struct hlist_node *stat = v;
484 struct trace_ksym *entry;
485 int access_type = 0;
486 char fn_name[KSYM_NAME_LEN];
487
488 entry = hlist_entry(stat, struct trace_ksym, ksym_hlist);
489
490 access_type = entry->attr.bp_type;
491
492 switch (access_type) {
493 case HW_BREAKPOINT_R:
494 seq_puts(m, " R ");
495 break;
496 case HW_BREAKPOINT_W:
497 seq_puts(m, " W ");
498 break;
499 case HW_BREAKPOINT_R | HW_BREAKPOINT_W:
500 seq_puts(m, " RW ");
501 break;
502 default:
503 seq_puts(m, " NA ");
504 }
505
506 if (lookup_symbol_name(entry->attr.bp_addr, fn_name) >= 0)
507 seq_printf(m, " %-36s", fn_name);
508 else
509 seq_printf(m, " %-36s", "<NA>");
510 seq_printf(m, " %15lu\n", entry->counter);
511
512 return 0;
513}
514
515static void *ksym_tracer_stat_start(struct tracer_stat *trace)
516{
517 return ksym_filter_head.first;
518}
519
520static void *
521ksym_tracer_stat_next(void *v, int idx)
522{
523 struct hlist_node *stat = v;
524
525 return stat->next;
526}
527
528static struct tracer_stat ksym_tracer_stats = {
529 .name = "ksym_tracer",
530 .stat_start = ksym_tracer_stat_start,
531 .stat_next = ksym_tracer_stat_next,
532 .stat_headers = ksym_tracer_stat_headers,
533 .stat_show = ksym_tracer_stat_show
534};
535
536__init static int ksym_tracer_stat_init(void)
537{
538 int ret;
539
540 ret = register_stat_tracer(&ksym_tracer_stats);
541 if (ret) {
542 printk(KERN_WARNING "Warning: could not register "
543 "ksym tracer stats\n");
544 return 1;
545 }
546
547 return 0;
548}
549fs_initcall(ksym_tracer_stat_init);
550#endif /* CONFIG_PROFILE_KSYM_TRACER */
diff --git a/kernel/trace/trace_selftest.c b/kernel/trace/trace_selftest.c
index d2cdbabb4ead..dc98309e839a 100644
--- a/kernel/trace/trace_selftest.c
+++ b/kernel/trace/trace_selftest.c
@@ -17,6 +17,7 @@ static inline int trace_valid_entry(struct trace_entry *entry)
17 case TRACE_GRAPH_ENT: 17 case TRACE_GRAPH_ENT:
18 case TRACE_GRAPH_RET: 18 case TRACE_GRAPH_RET:
19 case TRACE_HW_BRANCHES: 19 case TRACE_HW_BRANCHES:
20 case TRACE_KSYM:
20 return 1; 21 return 1;
21 } 22 }
22 return 0; 23 return 0;
@@ -808,3 +809,57 @@ trace_selftest_startup_hw_branches(struct tracer *trace,
808 return ret; 809 return ret;
809} 810}
810#endif /* CONFIG_HW_BRANCH_TRACER */ 811#endif /* CONFIG_HW_BRANCH_TRACER */
812
813#ifdef CONFIG_KSYM_TRACER
814static int ksym_selftest_dummy;
815
816int
817trace_selftest_startup_ksym(struct tracer *trace, struct trace_array *tr)
818{
819 unsigned long count;
820 int ret;
821
822 /* start the tracing */
823 ret = tracer_init(trace, tr);
824 if (ret) {
825 warn_failed_init_tracer(trace, ret);
826 return ret;
827 }
828
829 ksym_selftest_dummy = 0;
830 /* Register the read-write tracing request */
831
832 ret = process_new_ksym_entry("ksym_selftest_dummy",
833 HW_BREAKPOINT_R | HW_BREAKPOINT_W,
834 (unsigned long)(&ksym_selftest_dummy));
835
836 if (ret < 0) {
837 printk(KERN_CONT "ksym_trace read-write startup test failed\n");
838 goto ret_path;
839 }
840 /* Perform a read and a write operation over the dummy variable to
841 * trigger the tracer
842 */
843 if (ksym_selftest_dummy == 0)
844 ksym_selftest_dummy++;
845
846 /* stop the tracing. */
847 tracing_stop();
848 /* check the trace buffer */
849 ret = trace_test_buffer(tr, &count);
850 trace->reset(tr);
851 tracing_start();
852
853 /* read & write operations - one each is performed on the dummy variable
854 * triggering two entries in the trace buffer
855 */
856 if (!ret && count != 2) {
857 printk(KERN_CONT "Ksym tracer startup test failed");
858 ret = -1;
859 }
860
861ret_path:
862 return ret;
863}
864#endif /* CONFIG_KSYM_TRACER */
865
diff --git a/kernel/trace/trace_syscalls.c b/kernel/trace/trace_syscalls.c
index 527e17eae575..57501d90096a 100644
--- a/kernel/trace/trace_syscalls.c
+++ b/kernel/trace/trace_syscalls.c
@@ -14,6 +14,43 @@ static int sys_refcount_exit;
14static DECLARE_BITMAP(enabled_enter_syscalls, NR_syscalls); 14static DECLARE_BITMAP(enabled_enter_syscalls, NR_syscalls);
15static DECLARE_BITMAP(enabled_exit_syscalls, NR_syscalls); 15static DECLARE_BITMAP(enabled_exit_syscalls, NR_syscalls);
16 16
17extern unsigned long __start_syscalls_metadata[];
18extern unsigned long __stop_syscalls_metadata[];
19
20static struct syscall_metadata **syscalls_metadata;
21
22static struct syscall_metadata *find_syscall_meta(unsigned long syscall)
23{
24 struct syscall_metadata *start;
25 struct syscall_metadata *stop;
26 char str[KSYM_SYMBOL_LEN];
27
28
29 start = (struct syscall_metadata *)__start_syscalls_metadata;
30 stop = (struct syscall_metadata *)__stop_syscalls_metadata;
31 kallsyms_lookup(syscall, NULL, NULL, NULL, str);
32
33 for ( ; start < stop; start++) {
34 /*
35 * Only compare after the "sys" prefix. Archs that use
36 * syscall wrappers may have syscalls symbols aliases prefixed
37 * with "SyS" instead of "sys", leading to an unwanted
38 * mismatch.
39 */
40 if (start->name && !strcmp(start->name + 3, str + 3))
41 return start;
42 }
43 return NULL;
44}
45
46static struct syscall_metadata *syscall_nr_to_meta(int nr)
47{
48 if (!syscalls_metadata || nr >= NR_syscalls || nr < 0)
49 return NULL;
50
51 return syscalls_metadata[nr];
52}
53
17enum print_line_t 54enum print_line_t
18print_syscall_enter(struct trace_iterator *iter, int flags) 55print_syscall_enter(struct trace_iterator *iter, int flags)
19{ 56{
@@ -30,7 +67,7 @@ print_syscall_enter(struct trace_iterator *iter, int flags)
30 if (!entry) 67 if (!entry)
31 goto end; 68 goto end;
32 69
33 if (entry->enter_id != ent->type) { 70 if (entry->enter_event->id != ent->type) {
34 WARN_ON_ONCE(1); 71 WARN_ON_ONCE(1);
35 goto end; 72 goto end;
36 } 73 }
@@ -85,7 +122,7 @@ print_syscall_exit(struct trace_iterator *iter, int flags)
85 return TRACE_TYPE_HANDLED; 122 return TRACE_TYPE_HANDLED;
86 } 123 }
87 124
88 if (entry->exit_id != ent->type) { 125 if (entry->exit_event->id != ent->type) {
89 WARN_ON_ONCE(1); 126 WARN_ON_ONCE(1);
90 return TRACE_TYPE_UNHANDLED; 127 return TRACE_TYPE_UNHANDLED;
91 } 128 }
@@ -103,24 +140,19 @@ extern char *__bad_type_size(void);
103#define SYSCALL_FIELD(type, name) \ 140#define SYSCALL_FIELD(type, name) \
104 sizeof(type) != sizeof(trace.name) ? \ 141 sizeof(type) != sizeof(trace.name) ? \
105 __bad_type_size() : \ 142 __bad_type_size() : \
106 #type, #name, offsetof(typeof(trace), name), sizeof(trace.name) 143 #type, #name, offsetof(typeof(trace), name), \
144 sizeof(trace.name), is_signed_type(type)
107 145
108int syscall_enter_format(struct ftrace_event_call *call, struct trace_seq *s) 146int syscall_enter_format(struct ftrace_event_call *call, struct trace_seq *s)
109{ 147{
110 int i; 148 int i;
111 int nr;
112 int ret; 149 int ret;
113 struct syscall_metadata *entry; 150 struct syscall_metadata *entry = call->data;
114 struct syscall_trace_enter trace; 151 struct syscall_trace_enter trace;
115 int offset = offsetof(struct syscall_trace_enter, args); 152 int offset = offsetof(struct syscall_trace_enter, args);
116 153
117 nr = syscall_name_to_nr(call->data); 154 ret = trace_seq_printf(s, "\tfield:%s %s;\toffset:%zu;\tsize:%zu;"
118 entry = syscall_nr_to_meta(nr); 155 "\tsigned:%u;\n",
119
120 if (!entry)
121 return 0;
122
123 ret = trace_seq_printf(s, "\tfield:%s %s;\toffset:%zu;\tsize:%zu;\n",
124 SYSCALL_FIELD(int, nr)); 156 SYSCALL_FIELD(int, nr));
125 if (!ret) 157 if (!ret)
126 return 0; 158 return 0;
@@ -130,8 +162,10 @@ int syscall_enter_format(struct ftrace_event_call *call, struct trace_seq *s)
130 entry->args[i]); 162 entry->args[i]);
131 if (!ret) 163 if (!ret)
132 return 0; 164 return 0;
133 ret = trace_seq_printf(s, "\toffset:%d;\tsize:%zu;\n", offset, 165 ret = trace_seq_printf(s, "\toffset:%d;\tsize:%zu;"
134 sizeof(unsigned long)); 166 "\tsigned:%u;\n", offset,
167 sizeof(unsigned long),
168 is_signed_type(unsigned long));
135 if (!ret) 169 if (!ret)
136 return 0; 170 return 0;
137 offset += sizeof(unsigned long); 171 offset += sizeof(unsigned long);
@@ -163,8 +197,10 @@ int syscall_exit_format(struct ftrace_event_call *call, struct trace_seq *s)
163 struct syscall_trace_exit trace; 197 struct syscall_trace_exit trace;
164 198
165 ret = trace_seq_printf(s, 199 ret = trace_seq_printf(s,
166 "\tfield:%s %s;\toffset:%zu;\tsize:%zu;\n" 200 "\tfield:%s %s;\toffset:%zu;\tsize:%zu;"
167 "\tfield:%s %s;\toffset:%zu;\tsize:%zu;\n", 201 "\tsigned:%u;\n"
202 "\tfield:%s %s;\toffset:%zu;\tsize:%zu;"
203 "\tsigned:%u;\n",
168 SYSCALL_FIELD(int, nr), 204 SYSCALL_FIELD(int, nr),
169 SYSCALL_FIELD(long, ret)); 205 SYSCALL_FIELD(long, ret));
170 if (!ret) 206 if (!ret)
@@ -176,22 +212,19 @@ int syscall_exit_format(struct ftrace_event_call *call, struct trace_seq *s)
176int syscall_enter_define_fields(struct ftrace_event_call *call) 212int syscall_enter_define_fields(struct ftrace_event_call *call)
177{ 213{
178 struct syscall_trace_enter trace; 214 struct syscall_trace_enter trace;
179 struct syscall_metadata *meta; 215 struct syscall_metadata *meta = call->data;
180 int ret; 216 int ret;
181 int nr;
182 int i; 217 int i;
183 int offset = offsetof(typeof(trace), args); 218 int offset = offsetof(typeof(trace), args);
184 219
185 nr = syscall_name_to_nr(call->data);
186 meta = syscall_nr_to_meta(nr);
187
188 if (!meta)
189 return 0;
190
191 ret = trace_define_common_fields(call); 220 ret = trace_define_common_fields(call);
192 if (ret) 221 if (ret)
193 return ret; 222 return ret;
194 223
224 ret = trace_define_field(call, SYSCALL_FIELD(int, nr), FILTER_OTHER);
225 if (ret)
226 return ret;
227
195 for (i = 0; i < meta->nb_args; i++) { 228 for (i = 0; i < meta->nb_args; i++) {
196 ret = trace_define_field(call, meta->types[i], 229 ret = trace_define_field(call, meta->types[i],
197 meta->args[i], offset, 230 meta->args[i], offset,
@@ -212,7 +245,11 @@ int syscall_exit_define_fields(struct ftrace_event_call *call)
212 if (ret) 245 if (ret)
213 return ret; 246 return ret;
214 247
215 ret = trace_define_field(call, SYSCALL_FIELD(long, ret), 0, 248 ret = trace_define_field(call, SYSCALL_FIELD(int, nr), FILTER_OTHER);
249 if (ret)
250 return ret;
251
252 ret = trace_define_field(call, SYSCALL_FIELD(long, ret),
216 FILTER_OTHER); 253 FILTER_OTHER);
217 254
218 return ret; 255 return ret;
@@ -239,8 +276,8 @@ void ftrace_syscall_enter(struct pt_regs *regs, long id)
239 276
240 size = sizeof(*entry) + sizeof(unsigned long) * sys_data->nb_args; 277 size = sizeof(*entry) + sizeof(unsigned long) * sys_data->nb_args;
241 278
242 event = trace_current_buffer_lock_reserve(&buffer, sys_data->enter_id, 279 event = trace_current_buffer_lock_reserve(&buffer,
243 size, 0, 0); 280 sys_data->enter_event->id, size, 0, 0);
244 if (!event) 281 if (!event)
245 return; 282 return;
246 283
@@ -271,8 +308,8 @@ void ftrace_syscall_exit(struct pt_regs *regs, long ret)
271 if (!sys_data) 308 if (!sys_data)
272 return; 309 return;
273 310
274 event = trace_current_buffer_lock_reserve(&buffer, sys_data->exit_id, 311 event = trace_current_buffer_lock_reserve(&buffer,
275 sizeof(*entry), 0, 0); 312 sys_data->exit_event->id, sizeof(*entry), 0, 0);
276 if (!event) 313 if (!event)
277 return; 314 return;
278 315
@@ -285,14 +322,12 @@ void ftrace_syscall_exit(struct pt_regs *regs, long ret)
285 trace_current_buffer_unlock_commit(buffer, event, 0, 0); 322 trace_current_buffer_unlock_commit(buffer, event, 0, 0);
286} 323}
287 324
288int reg_event_syscall_enter(void *ptr) 325int reg_event_syscall_enter(struct ftrace_event_call *call)
289{ 326{
290 int ret = 0; 327 int ret = 0;
291 int num; 328 int num;
292 char *name;
293 329
294 name = (char *)ptr; 330 num = ((struct syscall_metadata *)call->data)->syscall_nr;
295 num = syscall_name_to_nr(name);
296 if (num < 0 || num >= NR_syscalls) 331 if (num < 0 || num >= NR_syscalls)
297 return -ENOSYS; 332 return -ENOSYS;
298 mutex_lock(&syscall_trace_lock); 333 mutex_lock(&syscall_trace_lock);
@@ -309,13 +344,11 @@ int reg_event_syscall_enter(void *ptr)
309 return ret; 344 return ret;
310} 345}
311 346
312void unreg_event_syscall_enter(void *ptr) 347void unreg_event_syscall_enter(struct ftrace_event_call *call)
313{ 348{
314 int num; 349 int num;
315 char *name;
316 350
317 name = (char *)ptr; 351 num = ((struct syscall_metadata *)call->data)->syscall_nr;
318 num = syscall_name_to_nr(name);
319 if (num < 0 || num >= NR_syscalls) 352 if (num < 0 || num >= NR_syscalls)
320 return; 353 return;
321 mutex_lock(&syscall_trace_lock); 354 mutex_lock(&syscall_trace_lock);
@@ -326,14 +359,12 @@ void unreg_event_syscall_enter(void *ptr)
326 mutex_unlock(&syscall_trace_lock); 359 mutex_unlock(&syscall_trace_lock);
327} 360}
328 361
329int reg_event_syscall_exit(void *ptr) 362int reg_event_syscall_exit(struct ftrace_event_call *call)
330{ 363{
331 int ret = 0; 364 int ret = 0;
332 int num; 365 int num;
333 char *name;
334 366
335 name = (char *)ptr; 367 num = ((struct syscall_metadata *)call->data)->syscall_nr;
336 num = syscall_name_to_nr(name);
337 if (num < 0 || num >= NR_syscalls) 368 if (num < 0 || num >= NR_syscalls)
338 return -ENOSYS; 369 return -ENOSYS;
339 mutex_lock(&syscall_trace_lock); 370 mutex_lock(&syscall_trace_lock);
@@ -350,13 +381,11 @@ int reg_event_syscall_exit(void *ptr)
350 return ret; 381 return ret;
351} 382}
352 383
353void unreg_event_syscall_exit(void *ptr) 384void unreg_event_syscall_exit(struct ftrace_event_call *call)
354{ 385{
355 int num; 386 int num;
356 char *name;
357 387
358 name = (char *)ptr; 388 num = ((struct syscall_metadata *)call->data)->syscall_nr;
359 num = syscall_name_to_nr(name);
360 if (num < 0 || num >= NR_syscalls) 389 if (num < 0 || num >= NR_syscalls)
361 return; 390 return;
362 mutex_lock(&syscall_trace_lock); 391 mutex_lock(&syscall_trace_lock);
@@ -367,13 +396,44 @@ void unreg_event_syscall_exit(void *ptr)
367 mutex_unlock(&syscall_trace_lock); 396 mutex_unlock(&syscall_trace_lock);
368} 397}
369 398
370struct trace_event event_syscall_enter = { 399int init_syscall_trace(struct ftrace_event_call *call)
371 .trace = print_syscall_enter, 400{
372}; 401 int id;
402
403 id = register_ftrace_event(call->event);
404 if (!id)
405 return -ENODEV;
406 call->id = id;
407 INIT_LIST_HEAD(&call->fields);
408 return 0;
409}
410
411int __init init_ftrace_syscalls(void)
412{
413 struct syscall_metadata *meta;
414 unsigned long addr;
415 int i;
416
417 syscalls_metadata = kzalloc(sizeof(*syscalls_metadata) *
418 NR_syscalls, GFP_KERNEL);
419 if (!syscalls_metadata) {
420 WARN_ON(1);
421 return -ENOMEM;
422 }
423
424 for (i = 0; i < NR_syscalls; i++) {
425 addr = arch_syscall_addr(i);
426 meta = find_syscall_meta(addr);
427 if (!meta)
428 continue;
429
430 meta->syscall_nr = i;
431 syscalls_metadata[i] = meta;
432 }
373 433
374struct trace_event event_syscall_exit = { 434 return 0;
375 .trace = print_syscall_exit, 435}
376}; 436core_initcall(init_ftrace_syscalls);
377 437
378#ifdef CONFIG_EVENT_PROFILE 438#ifdef CONFIG_EVENT_PROFILE
379 439
@@ -387,8 +447,10 @@ static void prof_syscall_enter(struct pt_regs *regs, long id)
387 struct syscall_metadata *sys_data; 447 struct syscall_metadata *sys_data;
388 struct syscall_trace_enter *rec; 448 struct syscall_trace_enter *rec;
389 unsigned long flags; 449 unsigned long flags;
450 char *trace_buf;
390 char *raw_data; 451 char *raw_data;
391 int syscall_nr; 452 int syscall_nr;
453 int rctx;
392 int size; 454 int size;
393 int cpu; 455 int cpu;
394 456
@@ -412,41 +474,42 @@ static void prof_syscall_enter(struct pt_regs *regs, long id)
412 /* Protect the per cpu buffer, begin the rcu read side */ 474 /* Protect the per cpu buffer, begin the rcu read side */
413 local_irq_save(flags); 475 local_irq_save(flags);
414 476
477 rctx = perf_swevent_get_recursion_context();
478 if (rctx < 0)
479 goto end_recursion;
480
415 cpu = smp_processor_id(); 481 cpu = smp_processor_id();
416 482
417 if (in_nmi()) 483 trace_buf = rcu_dereference(perf_trace_buf);
418 raw_data = rcu_dereference(trace_profile_buf_nmi);
419 else
420 raw_data = rcu_dereference(trace_profile_buf);
421 484
422 if (!raw_data) 485 if (!trace_buf)
423 goto end; 486 goto end;
424 487
425 raw_data = per_cpu_ptr(raw_data, cpu); 488 raw_data = per_cpu_ptr(trace_buf, cpu);
426 489
427 /* zero the dead bytes from align to not leak stack to user */ 490 /* zero the dead bytes from align to not leak stack to user */
428 *(u64 *)(&raw_data[size - sizeof(u64)]) = 0ULL; 491 *(u64 *)(&raw_data[size - sizeof(u64)]) = 0ULL;
429 492
430 rec = (struct syscall_trace_enter *) raw_data; 493 rec = (struct syscall_trace_enter *) raw_data;
431 tracing_generic_entry_update(&rec->ent, 0, 0); 494 tracing_generic_entry_update(&rec->ent, 0, 0);
432 rec->ent.type = sys_data->enter_id; 495 rec->ent.type = sys_data->enter_event->id;
433 rec->nr = syscall_nr; 496 rec->nr = syscall_nr;
434 syscall_get_arguments(current, regs, 0, sys_data->nb_args, 497 syscall_get_arguments(current, regs, 0, sys_data->nb_args,
435 (unsigned long *)&rec->args); 498 (unsigned long *)&rec->args);
436 perf_tp_event(sys_data->enter_id, 0, 1, rec, size); 499 perf_tp_event(sys_data->enter_event->id, 0, 1, rec, size);
437 500
438end: 501end:
502 perf_swevent_put_recursion_context(rctx);
503end_recursion:
439 local_irq_restore(flags); 504 local_irq_restore(flags);
440} 505}
441 506
442int reg_prof_syscall_enter(char *name) 507int prof_sysenter_enable(struct ftrace_event_call *call)
443{ 508{
444 int ret = 0; 509 int ret = 0;
445 int num; 510 int num;
446 511
447 num = syscall_name_to_nr(name); 512 num = ((struct syscall_metadata *)call->data)->syscall_nr;
448 if (num < 0 || num >= NR_syscalls)
449 return -ENOSYS;
450 513
451 mutex_lock(&syscall_trace_lock); 514 mutex_lock(&syscall_trace_lock);
452 if (!sys_prof_refcount_enter) 515 if (!sys_prof_refcount_enter)
@@ -462,13 +525,11 @@ int reg_prof_syscall_enter(char *name)
462 return ret; 525 return ret;
463} 526}
464 527
465void unreg_prof_syscall_enter(char *name) 528void prof_sysenter_disable(struct ftrace_event_call *call)
466{ 529{
467 int num; 530 int num;
468 531
469 num = syscall_name_to_nr(name); 532 num = ((struct syscall_metadata *)call->data)->syscall_nr;
470 if (num < 0 || num >= NR_syscalls)
471 return;
472 533
473 mutex_lock(&syscall_trace_lock); 534 mutex_lock(&syscall_trace_lock);
474 sys_prof_refcount_enter--; 535 sys_prof_refcount_enter--;
@@ -484,7 +545,9 @@ static void prof_syscall_exit(struct pt_regs *regs, long ret)
484 struct syscall_trace_exit *rec; 545 struct syscall_trace_exit *rec;
485 unsigned long flags; 546 unsigned long flags;
486 int syscall_nr; 547 int syscall_nr;
548 char *trace_buf;
487 char *raw_data; 549 char *raw_data;
550 int rctx;
488 int size; 551 int size;
489 int cpu; 552 int cpu;
490 553
@@ -510,17 +573,19 @@ static void prof_syscall_exit(struct pt_regs *regs, long ret)
510 573
511 /* Protect the per cpu buffer, begin the rcu read side */ 574 /* Protect the per cpu buffer, begin the rcu read side */
512 local_irq_save(flags); 575 local_irq_save(flags);
576
577 rctx = perf_swevent_get_recursion_context();
578 if (rctx < 0)
579 goto end_recursion;
580
513 cpu = smp_processor_id(); 581 cpu = smp_processor_id();
514 582
515 if (in_nmi()) 583 trace_buf = rcu_dereference(perf_trace_buf);
516 raw_data = rcu_dereference(trace_profile_buf_nmi);
517 else
518 raw_data = rcu_dereference(trace_profile_buf);
519 584
520 if (!raw_data) 585 if (!trace_buf)
521 goto end; 586 goto end;
522 587
523 raw_data = per_cpu_ptr(raw_data, cpu); 588 raw_data = per_cpu_ptr(trace_buf, cpu);
524 589
525 /* zero the dead bytes from align to not leak stack to user */ 590 /* zero the dead bytes from align to not leak stack to user */
526 *(u64 *)(&raw_data[size - sizeof(u64)]) = 0ULL; 591 *(u64 *)(&raw_data[size - sizeof(u64)]) = 0ULL;
@@ -528,24 +593,24 @@ static void prof_syscall_exit(struct pt_regs *regs, long ret)
528 rec = (struct syscall_trace_exit *)raw_data; 593 rec = (struct syscall_trace_exit *)raw_data;
529 594
530 tracing_generic_entry_update(&rec->ent, 0, 0); 595 tracing_generic_entry_update(&rec->ent, 0, 0);
531 rec->ent.type = sys_data->exit_id; 596 rec->ent.type = sys_data->exit_event->id;
532 rec->nr = syscall_nr; 597 rec->nr = syscall_nr;
533 rec->ret = syscall_get_return_value(current, regs); 598 rec->ret = syscall_get_return_value(current, regs);
534 599
535 perf_tp_event(sys_data->exit_id, 0, 1, rec, size); 600 perf_tp_event(sys_data->exit_event->id, 0, 1, rec, size);
536 601
537end: 602end:
603 perf_swevent_put_recursion_context(rctx);
604end_recursion:
538 local_irq_restore(flags); 605 local_irq_restore(flags);
539} 606}
540 607
541int reg_prof_syscall_exit(char *name) 608int prof_sysexit_enable(struct ftrace_event_call *call)
542{ 609{
543 int ret = 0; 610 int ret = 0;
544 int num; 611 int num;
545 612
546 num = syscall_name_to_nr(name); 613 num = ((struct syscall_metadata *)call->data)->syscall_nr;
547 if (num < 0 || num >= NR_syscalls)
548 return -ENOSYS;
549 614
550 mutex_lock(&syscall_trace_lock); 615 mutex_lock(&syscall_trace_lock);
551 if (!sys_prof_refcount_exit) 616 if (!sys_prof_refcount_exit)
@@ -561,13 +626,11 @@ int reg_prof_syscall_exit(char *name)
561 return ret; 626 return ret;
562} 627}
563 628
564void unreg_prof_syscall_exit(char *name) 629void prof_sysexit_disable(struct ftrace_event_call *call)
565{ 630{
566 int num; 631 int num;
567 632
568 num = syscall_name_to_nr(name); 633 num = ((struct syscall_metadata *)call->data)->syscall_nr;
569 if (num < 0 || num >= NR_syscalls)
570 return;
571 634
572 mutex_lock(&syscall_trace_lock); 635 mutex_lock(&syscall_trace_lock);
573 sys_prof_refcount_exit--; 636 sys_prof_refcount_exit--;
diff --git a/kernel/user.c b/kernel/user.c
index 2c000e7132ac..46d0165ca70c 100644
--- a/kernel/user.c
+++ b/kernel/user.c
@@ -330,9 +330,9 @@ done:
330 */ 330 */
331static void free_user(struct user_struct *up, unsigned long flags) 331static void free_user(struct user_struct *up, unsigned long flags)
332{ 332{
333 spin_unlock_irqrestore(&uidhash_lock, flags);
334 INIT_DELAYED_WORK(&up->work, cleanup_user_struct); 333 INIT_DELAYED_WORK(&up->work, cleanup_user_struct);
335 schedule_delayed_work(&up->work, msecs_to_jiffies(1000)); 334 schedule_delayed_work(&up->work, msecs_to_jiffies(1000));
335 spin_unlock_irqrestore(&uidhash_lock, flags);
336} 336}
337 337
338#else /* CONFIG_USER_SCHED && CONFIG_SYSFS */ 338#else /* CONFIG_USER_SCHED && CONFIG_SYSFS */
diff --git a/kernel/workqueue.c b/kernel/workqueue.c
index 12328147132c..67e526b6ae81 100644
--- a/kernel/workqueue.c
+++ b/kernel/workqueue.c
@@ -692,31 +692,29 @@ int schedule_on_each_cpu(work_func_t func)
692 if (!works) 692 if (!works)
693 return -ENOMEM; 693 return -ENOMEM;
694 694
695 get_online_cpus();
696
695 /* 697 /*
696 * when running in keventd don't schedule a work item on itself. 698 * When running in keventd don't schedule a work item on
697 * Can just call directly because the work queue is already bound. 699 * itself. Can just call directly because the work queue is
698 * This also is faster. 700 * already bound. This also is faster.
699 * Make this a generic parameter for other workqueues?
700 */ 701 */
701 if (current_is_keventd()) { 702 if (current_is_keventd())
702 orig = raw_smp_processor_id(); 703 orig = raw_smp_processor_id();
703 INIT_WORK(per_cpu_ptr(works, orig), func);
704 func(per_cpu_ptr(works, orig));
705 }
706 704
707 get_online_cpus();
708 for_each_online_cpu(cpu) { 705 for_each_online_cpu(cpu) {
709 struct work_struct *work = per_cpu_ptr(works, cpu); 706 struct work_struct *work = per_cpu_ptr(works, cpu);
710 707
711 if (cpu == orig)
712 continue;
713 INIT_WORK(work, func); 708 INIT_WORK(work, func);
714 schedule_work_on(cpu, work);
715 }
716 for_each_online_cpu(cpu) {
717 if (cpu != orig) 709 if (cpu != orig)
718 flush_work(per_cpu_ptr(works, cpu)); 710 schedule_work_on(cpu, work);
719 } 711 }
712 if (orig >= 0)
713 func(per_cpu_ptr(works, orig));
714
715 for_each_online_cpu(cpu)
716 flush_work(per_cpu_ptr(works, cpu));
717
720 put_online_cpus(); 718 put_online_cpus();
721 free_percpu(works); 719 free_percpu(works);
722 return 0; 720 return 0;
diff --git a/lib/Kconfig.debug b/lib/Kconfig.debug
index 234ceb10861f..a79c4d0407ab 100644
--- a/lib/Kconfig.debug
+++ b/lib/Kconfig.debug
@@ -750,7 +750,7 @@ config RCU_TORTURE_TEST_RUNNABLE
750config RCU_CPU_STALL_DETECTOR 750config RCU_CPU_STALL_DETECTOR
751 bool "Check for stalled CPUs delaying RCU grace periods" 751 bool "Check for stalled CPUs delaying RCU grace periods"
752 depends on TREE_RCU || TREE_PREEMPT_RCU 752 depends on TREE_RCU || TREE_PREEMPT_RCU
753 default n 753 default y
754 help 754 help
755 This option causes RCU to printk information on which 755 This option causes RCU to printk information on which
756 CPUs are delaying the current grace period, but only when 756 CPUs are delaying the current grace period, but only when
diff --git a/lib/dma-debug.c b/lib/dma-debug.c
index 58a9f9fc609a..ce6b7eabf674 100644
--- a/lib/dma-debug.c
+++ b/lib/dma-debug.c
@@ -819,9 +819,11 @@ static void check_unmap(struct dma_debug_entry *ref)
819 err_printk(ref->dev, entry, "DMA-API: device driver frees " 819 err_printk(ref->dev, entry, "DMA-API: device driver frees "
820 "DMA memory with different CPU address " 820 "DMA memory with different CPU address "
821 "[device address=0x%016llx] [size=%llu bytes] " 821 "[device address=0x%016llx] [size=%llu bytes] "
822 "[cpu alloc address=%p] [cpu free address=%p]", 822 "[cpu alloc address=0x%016llx] "
823 "[cpu free address=0x%016llx]",
823 ref->dev_addr, ref->size, 824 ref->dev_addr, ref->size,
824 (void *)entry->paddr, (void *)ref->paddr); 825 (unsigned long long)entry->paddr,
826 (unsigned long long)ref->paddr);
825 } 827 }
826 828
827 if (ref->sg_call_ents && ref->type == dma_debug_sg && 829 if (ref->sg_call_ents && ref->type == dma_debug_sg &&
diff --git a/lib/kernel_lock.c b/lib/kernel_lock.c
index 39f1029e3525..4ebfa5a164d7 100644
--- a/lib/kernel_lock.c
+++ b/lib/kernel_lock.c
@@ -5,10 +5,13 @@
5 * relegated to obsolescence, but used by various less 5 * relegated to obsolescence, but used by various less
6 * important (or lazy) subsystems. 6 * important (or lazy) subsystems.
7 */ 7 */
8#include <linux/smp_lock.h>
9#include <linux/module.h> 8#include <linux/module.h>
10#include <linux/kallsyms.h> 9#include <linux/kallsyms.h>
11#include <linux/semaphore.h> 10#include <linux/semaphore.h>
11#include <linux/smp_lock.h>
12
13#define CREATE_TRACE_POINTS
14#include <trace/events/bkl.h>
12 15
13/* 16/*
14 * The 'big kernel lock' 17 * The 'big kernel lock'
@@ -113,21 +116,26 @@ static inline void __unlock_kernel(void)
113 * This cannot happen asynchronously, so we only need to 116 * This cannot happen asynchronously, so we only need to
114 * worry about other CPU's. 117 * worry about other CPU's.
115 */ 118 */
116void __lockfunc lock_kernel(void) 119void __lockfunc _lock_kernel(const char *func, const char *file, int line)
117{ 120{
118 int depth = current->lock_depth+1; 121 int depth = current->lock_depth + 1;
122
123 trace_lock_kernel(func, file, line);
124
119 if (likely(!depth)) 125 if (likely(!depth))
120 __lock_kernel(); 126 __lock_kernel();
121 current->lock_depth = depth; 127 current->lock_depth = depth;
122} 128}
123 129
124void __lockfunc unlock_kernel(void) 130void __lockfunc _unlock_kernel(const char *func, const char *file, int line)
125{ 131{
126 BUG_ON(current->lock_depth < 0); 132 BUG_ON(current->lock_depth < 0);
127 if (likely(--current->lock_depth < 0)) 133 if (likely(--current->lock_depth < 0))
128 __unlock_kernel(); 134 __unlock_kernel();
135
136 trace_unlock_kernel(func, file, line);
129} 137}
130 138
131EXPORT_SYMBOL(lock_kernel); 139EXPORT_SYMBOL(_lock_kernel);
132EXPORT_SYMBOL(unlock_kernel); 140EXPORT_SYMBOL(_unlock_kernel);
133 141
diff --git a/lib/radix-tree.c b/lib/radix-tree.c
index 23abbd93cae1..92cdd9936e3d 100644
--- a/lib/radix-tree.c
+++ b/lib/radix-tree.c
@@ -200,6 +200,9 @@ radix_tree_node_free(struct radix_tree_node *node)
200 * ensure that the addition of a single element in the tree cannot fail. On 200 * ensure that the addition of a single element in the tree cannot fail. On
201 * success, return zero, with preemption disabled. On error, return -ENOMEM 201 * success, return zero, with preemption disabled. On error, return -ENOMEM
202 * with preemption not disabled. 202 * with preemption not disabled.
203 *
204 * To make use of this facility, the radix tree must be initialised without
205 * __GFP_WAIT being passed to INIT_RADIX_TREE().
203 */ 206 */
204int radix_tree_preload(gfp_t gfp_mask) 207int radix_tree_preload(gfp_t gfp_mask)
205{ 208{
@@ -543,7 +546,6 @@ out:
543} 546}
544EXPORT_SYMBOL(radix_tree_tag_clear); 547EXPORT_SYMBOL(radix_tree_tag_clear);
545 548
546#ifndef __KERNEL__ /* Only the test harness uses this at present */
547/** 549/**
548 * radix_tree_tag_get - get a tag on a radix tree node 550 * radix_tree_tag_get - get a tag on a radix tree node
549 * @root: radix tree root 551 * @root: radix tree root
@@ -606,7 +608,6 @@ int radix_tree_tag_get(struct radix_tree_root *root,
606 } 608 }
607} 609}
608EXPORT_SYMBOL(radix_tree_tag_get); 610EXPORT_SYMBOL(radix_tree_tag_get);
609#endif
610 611
611/** 612/**
612 * radix_tree_next_hole - find the next hole (not-present entry) 613 * radix_tree_next_hole - find the next hole (not-present entry)
diff --git a/lib/ratelimit.c b/lib/ratelimit.c
index 26187edcc7ea..09f5ce1810dc 100644
--- a/lib/ratelimit.c
+++ b/lib/ratelimit.c
@@ -7,15 +7,12 @@
7 * parameter. Now every user can use their own standalone ratelimit_state. 7 * parameter. Now every user can use their own standalone ratelimit_state.
8 * 8 *
9 * This file is released under the GPLv2. 9 * This file is released under the GPLv2.
10 *
11 */ 10 */
12 11
13#include <linux/kernel.h> 12#include <linux/ratelimit.h>
14#include <linux/jiffies.h> 13#include <linux/jiffies.h>
15#include <linux/module.h> 14#include <linux/module.h>
16 15
17static DEFINE_SPINLOCK(ratelimit_lock);
18
19/* 16/*
20 * __ratelimit - rate limiting 17 * __ratelimit - rate limiting
21 * @rs: ratelimit_state data 18 * @rs: ratelimit_state data
@@ -23,35 +20,43 @@ static DEFINE_SPINLOCK(ratelimit_lock);
23 * This enforces a rate limit: not more than @rs->ratelimit_burst callbacks 20 * This enforces a rate limit: not more than @rs->ratelimit_burst callbacks
24 * in every @rs->ratelimit_jiffies 21 * in every @rs->ratelimit_jiffies
25 */ 22 */
26int __ratelimit(struct ratelimit_state *rs) 23int ___ratelimit(struct ratelimit_state *rs, const char *func)
27{ 24{
28 unsigned long flags; 25 unsigned long flags;
26 int ret;
29 27
30 if (!rs->interval) 28 if (!rs->interval)
31 return 1; 29 return 1;
32 30
33 spin_lock_irqsave(&ratelimit_lock, flags); 31 /*
32 * If we contend on this state's lock then almost
33 * by definition we are too busy to print a message,
34 * in addition to the one that will be printed by
35 * the entity that is holding the lock already:
36 */
37 if (!spin_trylock_irqsave(&rs->lock, flags))
38 return 1;
39
34 if (!rs->begin) 40 if (!rs->begin)
35 rs->begin = jiffies; 41 rs->begin = jiffies;
36 42
37 if (time_is_before_jiffies(rs->begin + rs->interval)) { 43 if (time_is_before_jiffies(rs->begin + rs->interval)) {
38 if (rs->missed) 44 if (rs->missed)
39 printk(KERN_WARNING "%s: %d callbacks suppressed\n", 45 printk(KERN_WARNING "%s: %d callbacks suppressed\n",
40 __func__, rs->missed); 46 func, rs->missed);
41 rs->begin = 0; 47 rs->begin = 0;
42 rs->printed = 0; 48 rs->printed = 0;
43 rs->missed = 0; 49 rs->missed = 0;
44 } 50 }
45 if (rs->burst && rs->burst > rs->printed) 51 if (rs->burst && rs->burst > rs->printed) {
46 goto print; 52 rs->printed++;
47 53 ret = 1;
48 rs->missed++; 54 } else {
49 spin_unlock_irqrestore(&ratelimit_lock, flags); 55 rs->missed++;
50 return 0; 56 ret = 0;
57 }
58 spin_unlock_irqrestore(&rs->lock, flags);
51 59
52print: 60 return ret;
53 rs->printed++;
54 spin_unlock_irqrestore(&ratelimit_lock, flags);
55 return 1;
56} 61}
57EXPORT_SYMBOL(__ratelimit); 62EXPORT_SYMBOL(___ratelimit);
diff --git a/lib/string.c b/lib/string.c
index b19b87af65a3..e96421ab9a9a 100644
--- a/lib/string.c
+++ b/lib/string.c
@@ -246,13 +246,17 @@ EXPORT_SYMBOL(strlcat);
246#undef strcmp 246#undef strcmp
247int strcmp(const char *cs, const char *ct) 247int strcmp(const char *cs, const char *ct)
248{ 248{
249 signed char __res; 249 unsigned char c1, c2;
250 250
251 while (1) { 251 while (1) {
252 if ((__res = *cs - *ct++) != 0 || !*cs++) 252 c1 = *cs++;
253 c2 = *ct++;
254 if (c1 != c2)
255 return c1 < c2 ? -1 : 1;
256 if (!c1)
253 break; 257 break;
254 } 258 }
255 return __res; 259 return 0;
256} 260}
257EXPORT_SYMBOL(strcmp); 261EXPORT_SYMBOL(strcmp);
258#endif 262#endif
@@ -266,14 +270,18 @@ EXPORT_SYMBOL(strcmp);
266 */ 270 */
267int strncmp(const char *cs, const char *ct, size_t count) 271int strncmp(const char *cs, const char *ct, size_t count)
268{ 272{
269 signed char __res = 0; 273 unsigned char c1, c2;
270 274
271 while (count) { 275 while (count) {
272 if ((__res = *cs - *ct++) != 0 || !*cs++) 276 c1 = *cs++;
277 c2 = *ct++;
278 if (c1 != c2)
279 return c1 < c2 ? -1 : 1;
280 if (!c1)
273 break; 281 break;
274 count--; 282 count--;
275 } 283 }
276 return __res; 284 return 0;
277} 285}
278EXPORT_SYMBOL(strncmp); 286EXPORT_SYMBOL(strncmp);
279#endif 287#endif
diff --git a/lib/swiotlb.c b/lib/swiotlb.c
index ac25cd28e807..795472d8ae24 100644
--- a/lib/swiotlb.c
+++ b/lib/swiotlb.c
@@ -97,6 +97,8 @@ static phys_addr_t *io_tlb_orig_addr;
97 */ 97 */
98static DEFINE_SPINLOCK(io_tlb_lock); 98static DEFINE_SPINLOCK(io_tlb_lock);
99 99
100static int late_alloc;
101
100static int __init 102static int __init
101setup_io_tlb_npages(char *str) 103setup_io_tlb_npages(char *str)
102{ 104{
@@ -109,6 +111,7 @@ setup_io_tlb_npages(char *str)
109 ++str; 111 ++str;
110 if (!strcmp(str, "force")) 112 if (!strcmp(str, "force"))
111 swiotlb_force = 1; 113 swiotlb_force = 1;
114
112 return 1; 115 return 1;
113} 116}
114__setup("swiotlb=", setup_io_tlb_npages); 117__setup("swiotlb=", setup_io_tlb_npages);
@@ -121,8 +124,9 @@ static dma_addr_t swiotlb_virt_to_bus(struct device *hwdev,
121 return phys_to_dma(hwdev, virt_to_phys(address)); 124 return phys_to_dma(hwdev, virt_to_phys(address));
122} 125}
123 126
124static void swiotlb_print_info(unsigned long bytes) 127void swiotlb_print_info(void)
125{ 128{
129 unsigned long bytes = io_tlb_nslabs << IO_TLB_SHIFT;
126 phys_addr_t pstart, pend; 130 phys_addr_t pstart, pend;
127 131
128 pstart = virt_to_phys(io_tlb_start); 132 pstart = virt_to_phys(io_tlb_start);
@@ -140,7 +144,7 @@ static void swiotlb_print_info(unsigned long bytes)
140 * structures for the software IO TLB used to implement the DMA API. 144 * structures for the software IO TLB used to implement the DMA API.
141 */ 145 */
142void __init 146void __init
143swiotlb_init_with_default_size(size_t default_size) 147swiotlb_init_with_default_size(size_t default_size, int verbose)
144{ 148{
145 unsigned long i, bytes; 149 unsigned long i, bytes;
146 150
@@ -176,14 +180,14 @@ swiotlb_init_with_default_size(size_t default_size)
176 io_tlb_overflow_buffer = alloc_bootmem_low(io_tlb_overflow); 180 io_tlb_overflow_buffer = alloc_bootmem_low(io_tlb_overflow);
177 if (!io_tlb_overflow_buffer) 181 if (!io_tlb_overflow_buffer)
178 panic("Cannot allocate SWIOTLB overflow buffer!\n"); 182 panic("Cannot allocate SWIOTLB overflow buffer!\n");
179 183 if (verbose)
180 swiotlb_print_info(bytes); 184 swiotlb_print_info();
181} 185}
182 186
183void __init 187void __init
184swiotlb_init(void) 188swiotlb_init(int verbose)
185{ 189{
186 swiotlb_init_with_default_size(64 * (1<<20)); /* default to 64MB */ 190 swiotlb_init_with_default_size(64 * (1<<20), verbose); /* default to 64MB */
187} 191}
188 192
189/* 193/*
@@ -260,7 +264,9 @@ swiotlb_late_init_with_default_size(size_t default_size)
260 if (!io_tlb_overflow_buffer) 264 if (!io_tlb_overflow_buffer)
261 goto cleanup4; 265 goto cleanup4;
262 266
263 swiotlb_print_info(bytes); 267 swiotlb_print_info();
268
269 late_alloc = 1;
264 270
265 return 0; 271 return 0;
266 272
@@ -281,6 +287,32 @@ cleanup1:
281 return -ENOMEM; 287 return -ENOMEM;
282} 288}
283 289
290void __init swiotlb_free(void)
291{
292 if (!io_tlb_overflow_buffer)
293 return;
294
295 if (late_alloc) {
296 free_pages((unsigned long)io_tlb_overflow_buffer,
297 get_order(io_tlb_overflow));
298 free_pages((unsigned long)io_tlb_orig_addr,
299 get_order(io_tlb_nslabs * sizeof(phys_addr_t)));
300 free_pages((unsigned long)io_tlb_list, get_order(io_tlb_nslabs *
301 sizeof(int)));
302 free_pages((unsigned long)io_tlb_start,
303 get_order(io_tlb_nslabs << IO_TLB_SHIFT));
304 } else {
305 free_bootmem_late(__pa(io_tlb_overflow_buffer),
306 io_tlb_overflow);
307 free_bootmem_late(__pa(io_tlb_orig_addr),
308 io_tlb_nslabs * sizeof(phys_addr_t));
309 free_bootmem_late(__pa(io_tlb_list),
310 io_tlb_nslabs * sizeof(int));
311 free_bootmem_late(__pa(io_tlb_start),
312 io_tlb_nslabs << IO_TLB_SHIFT);
313 }
314}
315
284static int is_swiotlb_buffer(phys_addr_t paddr) 316static int is_swiotlb_buffer(phys_addr_t paddr)
285{ 317{
286 return paddr >= virt_to_phys(io_tlb_start) && 318 return paddr >= virt_to_phys(io_tlb_start) &&
diff --git a/mm/Kconfig b/mm/Kconfig
index fd3386242cf0..44cf6f0a3a6d 100644
--- a/mm/Kconfig
+++ b/mm/Kconfig
@@ -128,12 +128,9 @@ config SPARSEMEM_VMEMMAP
128config MEMORY_HOTPLUG 128config MEMORY_HOTPLUG
129 bool "Allow for memory hot-add" 129 bool "Allow for memory hot-add"
130 depends on SPARSEMEM || X86_64_ACPI_NUMA 130 depends on SPARSEMEM || X86_64_ACPI_NUMA
131 depends on HOTPLUG && !(HIBERNATION && !S390) && ARCH_ENABLE_MEMORY_HOTPLUG 131 depends on HOTPLUG && ARCH_ENABLE_MEMORY_HOTPLUG
132 depends on (IA64 || X86 || PPC_BOOK3S_64 || SUPERH || S390) 132 depends on (IA64 || X86 || PPC_BOOK3S_64 || SUPERH || S390)
133 133
134comment "Memory hotplug is currently incompatible with Software Suspend"
135 depends on SPARSEMEM && HOTPLUG && HIBERNATION && !S390
136
137config MEMORY_HOTPLUG_SPARSE 134config MEMORY_HOTPLUG_SPARSE
138 def_bool y 135 def_bool y
139 depends on SPARSEMEM && MEMORY_HOTPLUG 136 depends on SPARSEMEM && MEMORY_HOTPLUG
diff --git a/mm/backing-dev.c b/mm/backing-dev.c
index 1065b715ef64..67a33a5a1a93 100644
--- a/mm/backing-dev.c
+++ b/mm/backing-dev.c
@@ -604,10 +604,14 @@ static void bdi_wb_shutdown(struct backing_dev_info *bdi)
604 604
605 /* 605 /*
606 * Finally, kill the kernel threads. We don't need to be RCU 606 * Finally, kill the kernel threads. We don't need to be RCU
607 * safe anymore, since the bdi is gone from visibility. 607 * safe anymore, since the bdi is gone from visibility. Force
608 * unfreeze of the thread before calling kthread_stop(), otherwise
609 * it would never exet if it is currently stuck in the refrigerator.
608 */ 610 */
609 list_for_each_entry(wb, &bdi->wb_list, list) 611 list_for_each_entry(wb, &bdi->wb_list, list) {
612 wb->task->flags &= ~PF_FROZEN;
610 kthread_stop(wb->task); 613 kthread_stop(wb->task);
614 }
611} 615}
612 616
613/* 617/*
@@ -628,6 +632,8 @@ static void bdi_prune_sb(struct backing_dev_info *bdi)
628void bdi_unregister(struct backing_dev_info *bdi) 632void bdi_unregister(struct backing_dev_info *bdi)
629{ 633{
630 if (bdi->dev) { 634 if (bdi->dev) {
635 bdi_prune_sb(bdi);
636
631 if (!bdi_cap_flush_forker(bdi)) 637 if (!bdi_cap_flush_forker(bdi))
632 bdi_wb_shutdown(bdi); 638 bdi_wb_shutdown(bdi);
633 bdi_debug_unregister(bdi); 639 bdi_debug_unregister(bdi);
@@ -697,7 +703,6 @@ void bdi_destroy(struct backing_dev_info *bdi)
697 spin_unlock(&inode_lock); 703 spin_unlock(&inode_lock);
698 } 704 }
699 705
700 bdi_prune_sb(bdi);
701 bdi_unregister(bdi); 706 bdi_unregister(bdi);
702 707
703 for (i = 0; i < NR_BDI_STAT_ITEMS; i++) 708 for (i = 0; i < NR_BDI_STAT_ITEMS; i++)
diff --git a/mm/bootmem.c b/mm/bootmem.c
index 555d5d2731c6..d1dc23cc7f10 100644
--- a/mm/bootmem.c
+++ b/mm/bootmem.c
@@ -143,6 +143,30 @@ unsigned long __init init_bootmem(unsigned long start, unsigned long pages)
143 return init_bootmem_core(NODE_DATA(0)->bdata, start, 0, pages); 143 return init_bootmem_core(NODE_DATA(0)->bdata, start, 0, pages);
144} 144}
145 145
146/*
147 * free_bootmem_late - free bootmem pages directly to page allocator
148 * @addr: starting address of the range
149 * @size: size of the range in bytes
150 *
151 * This is only useful when the bootmem allocator has already been torn
152 * down, but we are still initializing the system. Pages are given directly
153 * to the page allocator, no bootmem metadata is updated because it is gone.
154 */
155void __init free_bootmem_late(unsigned long addr, unsigned long size)
156{
157 unsigned long cursor, end;
158
159 kmemleak_free_part(__va(addr), size);
160
161 cursor = PFN_UP(addr);
162 end = PFN_DOWN(addr + size);
163
164 for (; cursor < end; cursor++) {
165 __free_pages_bootmem(pfn_to_page(cursor), 0);
166 totalram_pages++;
167 }
168}
169
146static unsigned long __init free_all_bootmem_core(bootmem_data_t *bdata) 170static unsigned long __init free_all_bootmem_core(bootmem_data_t *bdata)
147{ 171{
148 int aligned; 172 int aligned;
diff --git a/mm/highmem.c b/mm/highmem.c
index 25878cc49daa..9c1e627f282e 100644
--- a/mm/highmem.c
+++ b/mm/highmem.c
@@ -426,16 +426,21 @@ void __init page_address_init(void)
426 426
427void debug_kmap_atomic(enum km_type type) 427void debug_kmap_atomic(enum km_type type)
428{ 428{
429 static unsigned warn_count = 10; 429 static int warn_count = 10;
430 430
431 if (unlikely(warn_count == 0)) 431 if (unlikely(warn_count < 0))
432 return; 432 return;
433 433
434 if (unlikely(in_interrupt())) { 434 if (unlikely(in_interrupt())) {
435 if (in_irq()) { 435 if (in_nmi()) {
436 if (type != KM_NMI && type != KM_NMI_PTE) {
437 WARN_ON(1);
438 warn_count--;
439 }
440 } else if (in_irq()) {
436 if (type != KM_IRQ0 && type != KM_IRQ1 && 441 if (type != KM_IRQ0 && type != KM_IRQ1 &&
437 type != KM_BIO_SRC_IRQ && type != KM_BIO_DST_IRQ && 442 type != KM_BIO_SRC_IRQ && type != KM_BIO_DST_IRQ &&
438 type != KM_BOUNCE_READ) { 443 type != KM_BOUNCE_READ && type != KM_IRQ_PTE) {
439 WARN_ON(1); 444 WARN_ON(1);
440 warn_count--; 445 warn_count--;
441 } 446 }
@@ -452,7 +457,9 @@ void debug_kmap_atomic(enum km_type type)
452 } 457 }
453 458
454 if (type == KM_IRQ0 || type == KM_IRQ1 || type == KM_BOUNCE_READ || 459 if (type == KM_IRQ0 || type == KM_IRQ1 || type == KM_BOUNCE_READ ||
455 type == KM_BIO_SRC_IRQ || type == KM_BIO_DST_IRQ) { 460 type == KM_BIO_SRC_IRQ || type == KM_BIO_DST_IRQ ||
461 type == KM_IRQ_PTE || type == KM_NMI ||
462 type == KM_NMI_PTE ) {
456 if (!irqs_disabled()) { 463 if (!irqs_disabled()) {
457 WARN_ON(1); 464 WARN_ON(1);
458 warn_count--; 465 warn_count--;
diff --git a/mm/ksm.c b/mm/ksm.c
index bef1af4f77e3..5575f8628fef 100644
--- a/mm/ksm.c
+++ b/mm/ksm.c
@@ -1012,6 +1012,7 @@ static struct rmap_item *unstable_tree_search_insert(struct page *page,
1012 struct rmap_item *tree_rmap_item; 1012 struct rmap_item *tree_rmap_item;
1013 int ret; 1013 int ret;
1014 1014
1015 cond_resched();
1015 tree_rmap_item = rb_entry(*new, struct rmap_item, node); 1016 tree_rmap_item = rb_entry(*new, struct rmap_item, node);
1016 page2[0] = get_mergeable_page(tree_rmap_item); 1017 page2[0] = get_mergeable_page(tree_rmap_item);
1017 if (!page2[0]) 1018 if (!page2[0])
diff --git a/mm/memory_hotplug.c b/mm/memory_hotplug.c
index 821dee596377..2047465cd27c 100644
--- a/mm/memory_hotplug.c
+++ b/mm/memory_hotplug.c
@@ -26,6 +26,7 @@
26#include <linux/migrate.h> 26#include <linux/migrate.h>
27#include <linux/page-isolation.h> 27#include <linux/page-isolation.h>
28#include <linux/pfn.h> 28#include <linux/pfn.h>
29#include <linux/suspend.h>
29 30
30#include <asm/tlbflush.h> 31#include <asm/tlbflush.h>
31 32
@@ -447,7 +448,8 @@ int online_pages(unsigned long pfn, unsigned long nr_pages)
447} 448}
448#endif /* CONFIG_MEMORY_HOTPLUG_SPARSE */ 449#endif /* CONFIG_MEMORY_HOTPLUG_SPARSE */
449 450
450static pg_data_t *hotadd_new_pgdat(int nid, u64 start) 451/* we are OK calling __meminit stuff here - we have CONFIG_MEMORY_HOTPLUG */
452static pg_data_t __ref *hotadd_new_pgdat(int nid, u64 start)
451{ 453{
452 struct pglist_data *pgdat; 454 struct pglist_data *pgdat;
453 unsigned long zones_size[MAX_NR_ZONES] = {0}; 455 unsigned long zones_size[MAX_NR_ZONES] = {0};
@@ -484,14 +486,18 @@ int __ref add_memory(int nid, u64 start, u64 size)
484 struct resource *res; 486 struct resource *res;
485 int ret; 487 int ret;
486 488
489 lock_system_sleep();
490
487 res = register_memory_resource(start, size); 491 res = register_memory_resource(start, size);
492 ret = -EEXIST;
488 if (!res) 493 if (!res)
489 return -EEXIST; 494 goto out;
490 495
491 if (!node_online(nid)) { 496 if (!node_online(nid)) {
492 pgdat = hotadd_new_pgdat(nid, start); 497 pgdat = hotadd_new_pgdat(nid, start);
498 ret = -ENOMEM;
493 if (!pgdat) 499 if (!pgdat)
494 return -ENOMEM; 500 goto out;
495 new_pgdat = 1; 501 new_pgdat = 1;
496 } 502 }
497 503
@@ -514,7 +520,8 @@ int __ref add_memory(int nid, u64 start, u64 size)
514 BUG_ON(ret); 520 BUG_ON(ret);
515 } 521 }
516 522
517 return ret; 523 goto out;
524
518error: 525error:
519 /* rollback pgdat allocation and others */ 526 /* rollback pgdat allocation and others */
520 if (new_pgdat) 527 if (new_pgdat)
@@ -522,6 +529,8 @@ error:
522 if (res) 529 if (res)
523 release_memory_resource(res); 530 release_memory_resource(res);
524 531
532out:
533 unlock_system_sleep();
525 return ret; 534 return ret;
526} 535}
527EXPORT_SYMBOL_GPL(add_memory); 536EXPORT_SYMBOL_GPL(add_memory);
@@ -758,6 +767,8 @@ int offline_pages(unsigned long start_pfn,
758 if (!test_pages_in_a_zone(start_pfn, end_pfn)) 767 if (!test_pages_in_a_zone(start_pfn, end_pfn))
759 return -EINVAL; 768 return -EINVAL;
760 769
770 lock_system_sleep();
771
761 zone = page_zone(pfn_to_page(start_pfn)); 772 zone = page_zone(pfn_to_page(start_pfn));
762 node = zone_to_nid(zone); 773 node = zone_to_nid(zone);
763 nr_pages = end_pfn - start_pfn; 774 nr_pages = end_pfn - start_pfn;
@@ -765,7 +776,7 @@ int offline_pages(unsigned long start_pfn,
765 /* set above range as isolated */ 776 /* set above range as isolated */
766 ret = start_isolate_page_range(start_pfn, end_pfn); 777 ret = start_isolate_page_range(start_pfn, end_pfn);
767 if (ret) 778 if (ret)
768 return ret; 779 goto out;
769 780
770 arg.start_pfn = start_pfn; 781 arg.start_pfn = start_pfn;
771 arg.nr_pages = nr_pages; 782 arg.nr_pages = nr_pages;
@@ -843,6 +854,7 @@ repeat:
843 writeback_set_ratelimit(); 854 writeback_set_ratelimit();
844 855
845 memory_notify(MEM_OFFLINE, &arg); 856 memory_notify(MEM_OFFLINE, &arg);
857 unlock_system_sleep();
846 return 0; 858 return 0;
847 859
848failed_removal: 860failed_removal:
@@ -852,6 +864,8 @@ failed_removal:
852 /* pushback to free area */ 864 /* pushback to free area */
853 undo_isolate_page_range(start_pfn, end_pfn); 865 undo_isolate_page_range(start_pfn, end_pfn);
854 866
867out:
868 unlock_system_sleep();
855 return ret; 869 return ret;
856} 870}
857 871
diff --git a/mm/migrate.c b/mm/migrate.c
index 1a4bf4813780..7dbcb22316d2 100644
--- a/mm/migrate.c
+++ b/mm/migrate.c
@@ -602,7 +602,7 @@ static int unmap_and_move(new_page_t get_new_page, unsigned long private,
602 struct page *newpage = get_new_page(page, private, &result); 602 struct page *newpage = get_new_page(page, private, &result);
603 int rcu_locked = 0; 603 int rcu_locked = 0;
604 int charge = 0; 604 int charge = 0;
605 struct mem_cgroup *mem; 605 struct mem_cgroup *mem = NULL;
606 606
607 if (!newpage) 607 if (!newpage)
608 return -ENOMEM; 608 return -ENOMEM;
diff --git a/mm/mmap.c b/mm/mmap.c
index 73f5e4b64010..292ddc3cef9c 100644
--- a/mm/mmap.c
+++ b/mm/mmap.c
@@ -20,7 +20,6 @@
20#include <linux/fs.h> 20#include <linux/fs.h>
21#include <linux/personality.h> 21#include <linux/personality.h>
22#include <linux/security.h> 22#include <linux/security.h>
23#include <linux/ima.h>
24#include <linux/hugetlb.h> 23#include <linux/hugetlb.h>
25#include <linux/profile.h> 24#include <linux/profile.h>
26#include <linux/module.h> 25#include <linux/module.h>
@@ -1061,9 +1060,6 @@ unsigned long do_mmap_pgoff(struct file *file, unsigned long addr,
1061 error = security_file_mmap(file, reqprot, prot, flags, addr, 0); 1060 error = security_file_mmap(file, reqprot, prot, flags, addr, 0);
1062 if (error) 1061 if (error)
1063 return error; 1062 return error;
1064 error = ima_file_mmap(file, prot);
1065 if (error)
1066 return error;
1067 1063
1068 return mmap_region(file, addr, len, flags, vm_flags, pgoff); 1064 return mmap_region(file, addr, len, flags, vm_flags, pgoff);
1069} 1065}
diff --git a/mm/page_alloc.c b/mm/page_alloc.c
index cdcedf661616..2bc2ac63f41e 100644
--- a/mm/page_alloc.c
+++ b/mm/page_alloc.c
@@ -1769,7 +1769,7 @@ gfp_to_alloc_flags(gfp_t gfp_mask)
1769 * See also cpuset_zone_allowed() comment in kernel/cpuset.c. 1769 * See also cpuset_zone_allowed() comment in kernel/cpuset.c.
1770 */ 1770 */
1771 alloc_flags &= ~ALLOC_CPUSET; 1771 alloc_flags &= ~ALLOC_CPUSET;
1772 } else if (unlikely(rt_task(p))) 1772 } else if (unlikely(rt_task(p)) && !in_interrupt())
1773 alloc_flags |= ALLOC_HARDER; 1773 alloc_flags |= ALLOC_HARDER;
1774 1774
1775 if (likely(!(gfp_mask & __GFP_NOMEMALLOC))) { 1775 if (likely(!(gfp_mask & __GFP_NOMEMALLOC))) {
@@ -1817,9 +1817,9 @@ __alloc_pages_slowpath(gfp_t gfp_mask, unsigned int order,
1817 if (NUMA_BUILD && (gfp_mask & GFP_THISNODE) == GFP_THISNODE) 1817 if (NUMA_BUILD && (gfp_mask & GFP_THISNODE) == GFP_THISNODE)
1818 goto nopage; 1818 goto nopage;
1819 1819
1820restart:
1820 wake_all_kswapd(order, zonelist, high_zoneidx); 1821 wake_all_kswapd(order, zonelist, high_zoneidx);
1821 1822
1822restart:
1823 /* 1823 /*
1824 * OK, we're below the kswapd watermark and have kicked background 1824 * OK, we're below the kswapd watermark and have kicked background
1825 * reclaim. Now things get more complex, so set up alloc_flags according 1825 * reclaim. Now things get more complex, so set up alloc_flags according
diff --git a/mm/percpu.c b/mm/percpu.c
index d90797160c2a..5adfc268b408 100644
--- a/mm/percpu.c
+++ b/mm/percpu.c
@@ -355,62 +355,86 @@ static struct pcpu_chunk *pcpu_chunk_addr_search(void *addr)
355} 355}
356 356
357/** 357/**
358 * pcpu_extend_area_map - extend area map for allocation 358 * pcpu_need_to_extend - determine whether chunk area map needs to be extended
359 * @chunk: target chunk 359 * @chunk: chunk of interest
360 * 360 *
361 * Extend area map of @chunk so that it can accomodate an allocation. 361 * Determine whether area map of @chunk needs to be extended to
362 * A single allocation can split an area into three areas, so this 362 * accomodate a new allocation.
363 * function makes sure that @chunk->map has at least two extra slots.
364 * 363 *
365 * CONTEXT: 364 * CONTEXT:
366 * pcpu_alloc_mutex, pcpu_lock. pcpu_lock is released and reacquired 365 * pcpu_lock.
367 * if area map is extended.
368 * 366 *
369 * RETURNS: 367 * RETURNS:
370 * 0 if noop, 1 if successfully extended, -errno on failure. 368 * New target map allocation length if extension is necessary, 0
369 * otherwise.
371 */ 370 */
372static int pcpu_extend_area_map(struct pcpu_chunk *chunk, unsigned long *flags) 371static int pcpu_need_to_extend(struct pcpu_chunk *chunk)
373{ 372{
374 int new_alloc; 373 int new_alloc;
375 int *new;
376 size_t size;
377 374
378 /* has enough? */
379 if (chunk->map_alloc >= chunk->map_used + 2) 375 if (chunk->map_alloc >= chunk->map_used + 2)
380 return 0; 376 return 0;
381 377
382 spin_unlock_irqrestore(&pcpu_lock, *flags);
383
384 new_alloc = PCPU_DFL_MAP_ALLOC; 378 new_alloc = PCPU_DFL_MAP_ALLOC;
385 while (new_alloc < chunk->map_used + 2) 379 while (new_alloc < chunk->map_used + 2)
386 new_alloc *= 2; 380 new_alloc *= 2;
387 381
388 new = pcpu_mem_alloc(new_alloc * sizeof(new[0])); 382 return new_alloc;
389 if (!new) { 383}
390 spin_lock_irqsave(&pcpu_lock, *flags); 384
385/**
386 * pcpu_extend_area_map - extend area map of a chunk
387 * @chunk: chunk of interest
388 * @new_alloc: new target allocation length of the area map
389 *
390 * Extend area map of @chunk to have @new_alloc entries.
391 *
392 * CONTEXT:
393 * Does GFP_KERNEL allocation. Grabs and releases pcpu_lock.
394 *
395 * RETURNS:
396 * 0 on success, -errno on failure.
397 */
398static int pcpu_extend_area_map(struct pcpu_chunk *chunk, int new_alloc)
399{
400 int *old = NULL, *new = NULL;
401 size_t old_size = 0, new_size = new_alloc * sizeof(new[0]);
402 unsigned long flags;
403
404 new = pcpu_mem_alloc(new_size);
405 if (!new)
391 return -ENOMEM; 406 return -ENOMEM;
392 }
393 407
394 /* 408 /* acquire pcpu_lock and switch to new area map */
395 * Acquire pcpu_lock and switch to new area map. Only free 409 spin_lock_irqsave(&pcpu_lock, flags);
396 * could have happened inbetween, so map_used couldn't have 410
397 * grown. 411 if (new_alloc <= chunk->map_alloc)
398 */ 412 goto out_unlock;
399 spin_lock_irqsave(&pcpu_lock, *flags);
400 BUG_ON(new_alloc < chunk->map_used + 2);
401 413
402 size = chunk->map_alloc * sizeof(chunk->map[0]); 414 old_size = chunk->map_alloc * sizeof(chunk->map[0]);
403 memcpy(new, chunk->map, size); 415 memcpy(new, chunk->map, old_size);
404 416
405 /* 417 /*
406 * map_alloc < PCPU_DFL_MAP_ALLOC indicates that the chunk is 418 * map_alloc < PCPU_DFL_MAP_ALLOC indicates that the chunk is
407 * one of the first chunks and still using static map. 419 * one of the first chunks and still using static map.
408 */ 420 */
409 if (chunk->map_alloc >= PCPU_DFL_MAP_ALLOC) 421 if (chunk->map_alloc >= PCPU_DFL_MAP_ALLOC)
410 pcpu_mem_free(chunk->map, size); 422 old = chunk->map;
411 423
412 chunk->map_alloc = new_alloc; 424 chunk->map_alloc = new_alloc;
413 chunk->map = new; 425 chunk->map = new;
426 new = NULL;
427
428out_unlock:
429 spin_unlock_irqrestore(&pcpu_lock, flags);
430
431 /*
432 * pcpu_mem_free() might end up calling vfree() which uses
433 * IRQ-unsafe lock and thus can't be called under pcpu_lock.
434 */
435 pcpu_mem_free(old, old_size);
436 pcpu_mem_free(new, new_size);
437
414 return 0; 438 return 0;
415} 439}
416 440
@@ -1049,7 +1073,7 @@ static void *pcpu_alloc(size_t size, size_t align, bool reserved)
1049 static int warn_limit = 10; 1073 static int warn_limit = 10;
1050 struct pcpu_chunk *chunk; 1074 struct pcpu_chunk *chunk;
1051 const char *err; 1075 const char *err;
1052 int slot, off; 1076 int slot, off, new_alloc;
1053 unsigned long flags; 1077 unsigned long flags;
1054 1078
1055 if (unlikely(!size || size > PCPU_MIN_UNIT_SIZE || align > PAGE_SIZE)) { 1079 if (unlikely(!size || size > PCPU_MIN_UNIT_SIZE || align > PAGE_SIZE)) {
@@ -1064,14 +1088,25 @@ static void *pcpu_alloc(size_t size, size_t align, bool reserved)
1064 /* serve reserved allocations from the reserved chunk if available */ 1088 /* serve reserved allocations from the reserved chunk if available */
1065 if (reserved && pcpu_reserved_chunk) { 1089 if (reserved && pcpu_reserved_chunk) {
1066 chunk = pcpu_reserved_chunk; 1090 chunk = pcpu_reserved_chunk;
1067 if (size > chunk->contig_hint || 1091
1068 pcpu_extend_area_map(chunk, &flags) < 0) { 1092 if (size > chunk->contig_hint) {
1069 err = "failed to extend area map of reserved chunk"; 1093 err = "alloc from reserved chunk failed";
1070 goto fail_unlock; 1094 goto fail_unlock;
1071 } 1095 }
1096
1097 while ((new_alloc = pcpu_need_to_extend(chunk))) {
1098 spin_unlock_irqrestore(&pcpu_lock, flags);
1099 if (pcpu_extend_area_map(chunk, new_alloc) < 0) {
1100 err = "failed to extend area map of reserved chunk";
1101 goto fail_unlock_mutex;
1102 }
1103 spin_lock_irqsave(&pcpu_lock, flags);
1104 }
1105
1072 off = pcpu_alloc_area(chunk, size, align); 1106 off = pcpu_alloc_area(chunk, size, align);
1073 if (off >= 0) 1107 if (off >= 0)
1074 goto area_found; 1108 goto area_found;
1109
1075 err = "alloc from reserved chunk failed"; 1110 err = "alloc from reserved chunk failed";
1076 goto fail_unlock; 1111 goto fail_unlock;
1077 } 1112 }
@@ -1083,14 +1118,20 @@ restart:
1083 if (size > chunk->contig_hint) 1118 if (size > chunk->contig_hint)
1084 continue; 1119 continue;
1085 1120
1086 switch (pcpu_extend_area_map(chunk, &flags)) { 1121 new_alloc = pcpu_need_to_extend(chunk);
1087 case 0: 1122 if (new_alloc) {
1088 break; 1123 spin_unlock_irqrestore(&pcpu_lock, flags);
1089 case 1: 1124 if (pcpu_extend_area_map(chunk,
1090 goto restart; /* pcpu_lock dropped, restart */ 1125 new_alloc) < 0) {
1091 default: 1126 err = "failed to extend area map";
1092 err = "failed to extend area map"; 1127 goto fail_unlock_mutex;
1093 goto fail_unlock; 1128 }
1129 spin_lock_irqsave(&pcpu_lock, flags);
1130 /*
1131 * pcpu_lock has been dropped, need to
1132 * restart cpu_slot list walking.
1133 */
1134 goto restart;
1094 } 1135 }
1095 1136
1096 off = pcpu_alloc_area(chunk, size, align); 1137 off = pcpu_alloc_area(chunk, size, align);
diff --git a/net/8021q/vlan.c b/net/8021q/vlan.c
index 8836575f9d79..a29c5ab5815c 100644
--- a/net/8021q/vlan.c
+++ b/net/8021q/vlan.c
@@ -281,8 +281,11 @@ out_uninit_applicant:
281 if (ngrp) 281 if (ngrp)
282 vlan_gvrp_uninit_applicant(real_dev); 282 vlan_gvrp_uninit_applicant(real_dev);
283out_free_group: 283out_free_group:
284 if (ngrp) 284 if (ngrp) {
285 vlan_group_free(ngrp); 285 hlist_del_rcu(&ngrp->hlist);
286 /* Free the group, after all cpu's are done. */
287 call_rcu(&ngrp->rcu, vlan_rcu_free);
288 }
286 return err; 289 return err;
287} 290}
288 291
diff --git a/net/bluetooth/hci_conn.c b/net/bluetooth/hci_conn.c
index a9750984f772..b7c4224f4e7d 100644
--- a/net/bluetooth/hci_conn.c
+++ b/net/bluetooth/hci_conn.c
@@ -211,6 +211,7 @@ struct hci_conn *hci_conn_add(struct hci_dev *hdev, int type, bdaddr_t *dst)
211 conn->type = type; 211 conn->type = type;
212 conn->mode = HCI_CM_ACTIVE; 212 conn->mode = HCI_CM_ACTIVE;
213 conn->state = BT_OPEN; 213 conn->state = BT_OPEN;
214 conn->auth_type = HCI_AT_GENERAL_BONDING;
214 215
215 conn->power_save = 1; 216 conn->power_save = 1;
216 conn->disc_timeout = HCI_DISCONN_TIMEOUT; 217 conn->disc_timeout = HCI_DISCONN_TIMEOUT;
diff --git a/net/bluetooth/l2cap.c b/net/bluetooth/l2cap.c
index 77e9fb130adb..947f8bbb4bb3 100644
--- a/net/bluetooth/l2cap.c
+++ b/net/bluetooth/l2cap.c
@@ -2205,7 +2205,7 @@ static int l2cap_build_conf_req(struct sock *sk, void *data)
2205{ 2205{
2206 struct l2cap_pinfo *pi = l2cap_pi(sk); 2206 struct l2cap_pinfo *pi = l2cap_pi(sk);
2207 struct l2cap_conf_req *req = data; 2207 struct l2cap_conf_req *req = data;
2208 struct l2cap_conf_rfc rfc = { .mode = L2CAP_MODE_ERTM }; 2208 struct l2cap_conf_rfc rfc = { .mode = L2CAP_MODE_BASIC };
2209 void *ptr = req->data; 2209 void *ptr = req->data;
2210 2210
2211 BT_DBG("sk %p", sk); 2211 BT_DBG("sk %p", sk);
@@ -2394,6 +2394,10 @@ done:
2394 rfc.monitor_timeout = L2CAP_DEFAULT_MONITOR_TO; 2394 rfc.monitor_timeout = L2CAP_DEFAULT_MONITOR_TO;
2395 2395
2396 pi->conf_state |= L2CAP_CONF_MODE_DONE; 2396 pi->conf_state |= L2CAP_CONF_MODE_DONE;
2397
2398 l2cap_add_conf_opt(&ptr, L2CAP_CONF_RFC,
2399 sizeof(rfc), (unsigned long) &rfc);
2400
2397 break; 2401 break;
2398 2402
2399 case L2CAP_MODE_STREAMING: 2403 case L2CAP_MODE_STREAMING:
@@ -2401,6 +2405,10 @@ done:
2401 pi->max_pdu_size = rfc.max_pdu_size; 2405 pi->max_pdu_size = rfc.max_pdu_size;
2402 2406
2403 pi->conf_state |= L2CAP_CONF_MODE_DONE; 2407 pi->conf_state |= L2CAP_CONF_MODE_DONE;
2408
2409 l2cap_add_conf_opt(&ptr, L2CAP_CONF_RFC,
2410 sizeof(rfc), (unsigned long) &rfc);
2411
2404 break; 2412 break;
2405 2413
2406 default: 2414 default:
@@ -2410,9 +2418,6 @@ done:
2410 rfc.mode = pi->mode; 2418 rfc.mode = pi->mode;
2411 } 2419 }
2412 2420
2413 l2cap_add_conf_opt(&ptr, L2CAP_CONF_RFC,
2414 sizeof(rfc), (unsigned long) &rfc);
2415
2416 if (result == L2CAP_CONF_SUCCESS) 2421 if (result == L2CAP_CONF_SUCCESS)
2417 pi->conf_state |= L2CAP_CONF_OUTPUT_DONE; 2422 pi->conf_state |= L2CAP_CONF_OUTPUT_DONE;
2418 } 2423 }
diff --git a/net/bridge/br_if.c b/net/bridge/br_if.c
index b1b3b0fbf41c..4a9f52732655 100644
--- a/net/bridge/br_if.c
+++ b/net/bridge/br_if.c
@@ -377,12 +377,16 @@ int br_add_if(struct net_bridge *br, struct net_device *dev)
377 struct net_bridge_port *p; 377 struct net_bridge_port *p;
378 int err = 0; 378 int err = 0;
379 379
380 if (dev->flags & IFF_LOOPBACK || dev->type != ARPHRD_ETHER) 380 /* Don't allow bridging non-ethernet like devices */
381 if ((dev->flags & IFF_LOOPBACK) ||
382 dev->type != ARPHRD_ETHER || dev->addr_len != ETH_ALEN)
381 return -EINVAL; 383 return -EINVAL;
382 384
385 /* No bridging of bridges */
383 if (dev->netdev_ops->ndo_start_xmit == br_dev_xmit) 386 if (dev->netdev_ops->ndo_start_xmit == br_dev_xmit)
384 return -ELOOP; 387 return -ELOOP;
385 388
389 /* Device is already being bridged */
386 if (dev->br_port != NULL) 390 if (dev->br_port != NULL)
387 return -EBUSY; 391 return -EBUSY;
388 392
diff --git a/net/can/bcm.c b/net/can/bcm.c
index 597da4f8f888..e8d58f33fe09 100644
--- a/net/can/bcm.c
+++ b/net/can/bcm.c
@@ -132,23 +132,27 @@ static inline struct bcm_sock *bcm_sk(const struct sock *sk)
132/* 132/*
133 * procfs functions 133 * procfs functions
134 */ 134 */
135static char *bcm_proc_getifname(int ifindex) 135static char *bcm_proc_getifname(char *result, int ifindex)
136{ 136{
137 struct net_device *dev; 137 struct net_device *dev;
138 138
139 if (!ifindex) 139 if (!ifindex)
140 return "any"; 140 return "any";
141 141
142 /* no usage counting */ 142 read_lock(&dev_base_lock);
143 dev = __dev_get_by_index(&init_net, ifindex); 143 dev = __dev_get_by_index(&init_net, ifindex);
144 if (dev) 144 if (dev)
145 return dev->name; 145 strcpy(result, dev->name);
146 else
147 strcpy(result, "???");
148 read_unlock(&dev_base_lock);
146 149
147 return "???"; 150 return result;
148} 151}
149 152
150static int bcm_proc_show(struct seq_file *m, void *v) 153static int bcm_proc_show(struct seq_file *m, void *v)
151{ 154{
155 char ifname[IFNAMSIZ];
152 struct sock *sk = (struct sock *)m->private; 156 struct sock *sk = (struct sock *)m->private;
153 struct bcm_sock *bo = bcm_sk(sk); 157 struct bcm_sock *bo = bcm_sk(sk);
154 struct bcm_op *op; 158 struct bcm_op *op;
@@ -157,7 +161,7 @@ static int bcm_proc_show(struct seq_file *m, void *v)
157 seq_printf(m, " / sk %p", sk); 161 seq_printf(m, " / sk %p", sk);
158 seq_printf(m, " / bo %p", bo); 162 seq_printf(m, " / bo %p", bo);
159 seq_printf(m, " / dropped %lu", bo->dropped_usr_msgs); 163 seq_printf(m, " / dropped %lu", bo->dropped_usr_msgs);
160 seq_printf(m, " / bound %s", bcm_proc_getifname(bo->ifindex)); 164 seq_printf(m, " / bound %s", bcm_proc_getifname(ifname, bo->ifindex));
161 seq_printf(m, " <<<\n"); 165 seq_printf(m, " <<<\n");
162 166
163 list_for_each_entry(op, &bo->rx_ops, list) { 167 list_for_each_entry(op, &bo->rx_ops, list) {
@@ -169,7 +173,7 @@ static int bcm_proc_show(struct seq_file *m, void *v)
169 continue; 173 continue;
170 174
171 seq_printf(m, "rx_op: %03X %-5s ", 175 seq_printf(m, "rx_op: %03X %-5s ",
172 op->can_id, bcm_proc_getifname(op->ifindex)); 176 op->can_id, bcm_proc_getifname(ifname, op->ifindex));
173 seq_printf(m, "[%d]%c ", op->nframes, 177 seq_printf(m, "[%d]%c ", op->nframes,
174 (op->flags & RX_CHECK_DLC)?'d':' '); 178 (op->flags & RX_CHECK_DLC)?'d':' ');
175 if (op->kt_ival1.tv64) 179 if (op->kt_ival1.tv64)
@@ -194,7 +198,8 @@ static int bcm_proc_show(struct seq_file *m, void *v)
194 list_for_each_entry(op, &bo->tx_ops, list) { 198 list_for_each_entry(op, &bo->tx_ops, list) {
195 199
196 seq_printf(m, "tx_op: %03X %s [%d] ", 200 seq_printf(m, "tx_op: %03X %s [%d] ",
197 op->can_id, bcm_proc_getifname(op->ifindex), 201 op->can_id,
202 bcm_proc_getifname(ifname, op->ifindex),
198 op->nframes); 203 op->nframes);
199 204
200 if (op->kt_ival1.tv64) 205 if (op->kt_ival1.tv64)
diff --git a/net/core/datagram.c b/net/core/datagram.c
index 1c6cf3a1a4f6..4ade3011bb3c 100644
--- a/net/core/datagram.c
+++ b/net/core/datagram.c
@@ -224,6 +224,15 @@ void skb_free_datagram(struct sock *sk, struct sk_buff *skb)
224 consume_skb(skb); 224 consume_skb(skb);
225 sk_mem_reclaim_partial(sk); 225 sk_mem_reclaim_partial(sk);
226} 226}
227EXPORT_SYMBOL(skb_free_datagram);
228
229void skb_free_datagram_locked(struct sock *sk, struct sk_buff *skb)
230{
231 lock_sock(sk);
232 skb_free_datagram(sk, skb);
233 release_sock(sk);
234}
235EXPORT_SYMBOL(skb_free_datagram_locked);
227 236
228/** 237/**
229 * skb_kill_datagram - Free a datagram skbuff forcibly 238 * skb_kill_datagram - Free a datagram skbuff forcibly
@@ -752,5 +761,4 @@ unsigned int datagram_poll(struct file *file, struct socket *sock,
752EXPORT_SYMBOL(datagram_poll); 761EXPORT_SYMBOL(datagram_poll);
753EXPORT_SYMBOL(skb_copy_and_csum_datagram_iovec); 762EXPORT_SYMBOL(skb_copy_and_csum_datagram_iovec);
754EXPORT_SYMBOL(skb_copy_datagram_iovec); 763EXPORT_SYMBOL(skb_copy_datagram_iovec);
755EXPORT_SYMBOL(skb_free_datagram);
756EXPORT_SYMBOL(skb_recv_datagram); 764EXPORT_SYMBOL(skb_recv_datagram);
diff --git a/net/core/dev.c b/net/core/dev.c
index b8f74cfb1bfd..fe10551d3671 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -942,14 +942,15 @@ rollback:
942 ret = notifier_to_errno(ret); 942 ret = notifier_to_errno(ret);
943 943
944 if (ret) { 944 if (ret) {
945 if (err) { 945 /* err >= 0 after dev_alloc_name() or stores the first errno */
946 printk(KERN_ERR 946 if (err >= 0) {
947 "%s: name change rollback failed: %d.\n",
948 dev->name, ret);
949 } else {
950 err = ret; 947 err = ret;
951 memcpy(dev->name, oldname, IFNAMSIZ); 948 memcpy(dev->name, oldname, IFNAMSIZ);
952 goto rollback; 949 goto rollback;
950 } else {
951 printk(KERN_ERR
952 "%s: name change rollback failed: %d.\n",
953 dev->name, ret);
953 } 954 }
954 } 955 }
955 956
diff --git a/net/core/pktgen.c b/net/core/pktgen.c
index 6eb8d47cbf3a..6e79e96cb4f2 100644
--- a/net/core/pktgen.c
+++ b/net/core/pktgen.c
@@ -363,6 +363,7 @@ struct pktgen_dev {
363 * device name (not when the inject is 363 * device name (not when the inject is
364 * started as it used to do.) 364 * started as it used to do.)
365 */ 365 */
366 char odevname[32];
366 struct flow_state *flows; 367 struct flow_state *flows;
367 unsigned cflows; /* Concurrent flows (config) */ 368 unsigned cflows; /* Concurrent flows (config) */
368 unsigned lflow; /* Flow length (config) */ 369 unsigned lflow; /* Flow length (config) */
@@ -426,7 +427,7 @@ static const char version[] =
426static int pktgen_remove_device(struct pktgen_thread *t, struct pktgen_dev *i); 427static int pktgen_remove_device(struct pktgen_thread *t, struct pktgen_dev *i);
427static int pktgen_add_device(struct pktgen_thread *t, const char *ifname); 428static int pktgen_add_device(struct pktgen_thread *t, const char *ifname);
428static struct pktgen_dev *pktgen_find_dev(struct pktgen_thread *t, 429static struct pktgen_dev *pktgen_find_dev(struct pktgen_thread *t,
429 const char *ifname); 430 const char *ifname, bool exact);
430static int pktgen_device_event(struct notifier_block *, unsigned long, void *); 431static int pktgen_device_event(struct notifier_block *, unsigned long, void *);
431static void pktgen_run_all_threads(void); 432static void pktgen_run_all_threads(void);
432static void pktgen_reset_all_threads(void); 433static void pktgen_reset_all_threads(void);
@@ -528,7 +529,7 @@ static int pktgen_if_show(struct seq_file *seq, void *v)
528 seq_printf(seq, 529 seq_printf(seq,
529 " frags: %d delay: %llu clone_skb: %d ifname: %s\n", 530 " frags: %d delay: %llu clone_skb: %d ifname: %s\n",
530 pkt_dev->nfrags, (unsigned long long) pkt_dev->delay, 531 pkt_dev->nfrags, (unsigned long long) pkt_dev->delay,
531 pkt_dev->clone_skb, pkt_dev->odev->name); 532 pkt_dev->clone_skb, pkt_dev->odevname);
532 533
533 seq_printf(seq, " flows: %u flowlen: %u\n", pkt_dev->cflows, 534 seq_printf(seq, " flows: %u flowlen: %u\n", pkt_dev->cflows,
534 pkt_dev->lflow); 535 pkt_dev->lflow);
@@ -1688,13 +1689,13 @@ static int pktgen_thread_show(struct seq_file *seq, void *v)
1688 if_lock(t); 1689 if_lock(t);
1689 list_for_each_entry(pkt_dev, &t->if_list, list) 1690 list_for_each_entry(pkt_dev, &t->if_list, list)
1690 if (pkt_dev->running) 1691 if (pkt_dev->running)
1691 seq_printf(seq, "%s ", pkt_dev->odev->name); 1692 seq_printf(seq, "%s ", pkt_dev->odevname);
1692 1693
1693 seq_printf(seq, "\nStopped: "); 1694 seq_printf(seq, "\nStopped: ");
1694 1695
1695 list_for_each_entry(pkt_dev, &t->if_list, list) 1696 list_for_each_entry(pkt_dev, &t->if_list, list)
1696 if (!pkt_dev->running) 1697 if (!pkt_dev->running)
1697 seq_printf(seq, "%s ", pkt_dev->odev->name); 1698 seq_printf(seq, "%s ", pkt_dev->odevname);
1698 1699
1699 if (t->result[0]) 1700 if (t->result[0])
1700 seq_printf(seq, "\nResult: %s\n", t->result); 1701 seq_printf(seq, "\nResult: %s\n", t->result);
@@ -1817,9 +1818,10 @@ static struct pktgen_dev *__pktgen_NN_threads(const char *ifname, int remove)
1817{ 1818{
1818 struct pktgen_thread *t; 1819 struct pktgen_thread *t;
1819 struct pktgen_dev *pkt_dev = NULL; 1820 struct pktgen_dev *pkt_dev = NULL;
1821 bool exact = (remove == FIND);
1820 1822
1821 list_for_each_entry(t, &pktgen_threads, th_list) { 1823 list_for_each_entry(t, &pktgen_threads, th_list) {
1822 pkt_dev = pktgen_find_dev(t, ifname); 1824 pkt_dev = pktgen_find_dev(t, ifname, exact);
1823 if (pkt_dev) { 1825 if (pkt_dev) {
1824 if (remove) { 1826 if (remove) {
1825 if_lock(t); 1827 if_lock(t);
@@ -1994,7 +1996,7 @@ static void pktgen_setup_inject(struct pktgen_dev *pkt_dev)
1994 "queue_map_min (zero-based) (%d) exceeds valid range " 1996 "queue_map_min (zero-based) (%d) exceeds valid range "
1995 "[0 - %d] for (%d) queues on %s, resetting\n", 1997 "[0 - %d] for (%d) queues on %s, resetting\n",
1996 pkt_dev->queue_map_min, (ntxq ?: 1) - 1, ntxq, 1998 pkt_dev->queue_map_min, (ntxq ?: 1) - 1, ntxq,
1997 pkt_dev->odev->name); 1999 pkt_dev->odevname);
1998 pkt_dev->queue_map_min = ntxq - 1; 2000 pkt_dev->queue_map_min = ntxq - 1;
1999 } 2001 }
2000 if (pkt_dev->queue_map_max >= ntxq) { 2002 if (pkt_dev->queue_map_max >= ntxq) {
@@ -2002,7 +2004,7 @@ static void pktgen_setup_inject(struct pktgen_dev *pkt_dev)
2002 "queue_map_max (zero-based) (%d) exceeds valid range " 2004 "queue_map_max (zero-based) (%d) exceeds valid range "
2003 "[0 - %d] for (%d) queues on %s, resetting\n", 2005 "[0 - %d] for (%d) queues on %s, resetting\n",
2004 pkt_dev->queue_map_max, (ntxq ?: 1) - 1, ntxq, 2006 pkt_dev->queue_map_max, (ntxq ?: 1) - 1, ntxq,
2005 pkt_dev->odev->name); 2007 pkt_dev->odevname);
2006 pkt_dev->queue_map_max = ntxq - 1; 2008 pkt_dev->queue_map_max = ntxq - 1;
2007 } 2009 }
2008 2010
@@ -3262,7 +3264,7 @@ static int pktgen_stop_device(struct pktgen_dev *pkt_dev)
3262 3264
3263 if (!pkt_dev->running) { 3265 if (!pkt_dev->running) {
3264 printk(KERN_WARNING "pktgen: interface: %s is already " 3266 printk(KERN_WARNING "pktgen: interface: %s is already "
3265 "stopped\n", pkt_dev->odev->name); 3267 "stopped\n", pkt_dev->odevname);
3266 return -EINVAL; 3268 return -EINVAL;
3267 } 3269 }
3268 3270
@@ -3464,7 +3466,7 @@ static void pktgen_xmit(struct pktgen_dev *pkt_dev)
3464 default: /* Drivers are not supposed to return other values! */ 3466 default: /* Drivers are not supposed to return other values! */
3465 if (net_ratelimit()) 3467 if (net_ratelimit())
3466 pr_info("pktgen: %s xmit error: %d\n", 3468 pr_info("pktgen: %s xmit error: %d\n",
3467 odev->name, ret); 3469 pkt_dev->odevname, ret);
3468 pkt_dev->errors++; 3470 pkt_dev->errors++;
3469 /* fallthru */ 3471 /* fallthru */
3470 case NETDEV_TX_LOCKED: 3472 case NETDEV_TX_LOCKED:
@@ -3566,13 +3568,18 @@ static int pktgen_thread_worker(void *arg)
3566} 3568}
3567 3569
3568static struct pktgen_dev *pktgen_find_dev(struct pktgen_thread *t, 3570static struct pktgen_dev *pktgen_find_dev(struct pktgen_thread *t,
3569 const char *ifname) 3571 const char *ifname, bool exact)
3570{ 3572{
3571 struct pktgen_dev *p, *pkt_dev = NULL; 3573 struct pktgen_dev *p, *pkt_dev = NULL;
3572 if_lock(t); 3574 size_t len = strlen(ifname);
3573 3575
3576 if_lock(t);
3574 list_for_each_entry(p, &t->if_list, list) 3577 list_for_each_entry(p, &t->if_list, list)
3575 if (strncmp(p->odev->name, ifname, IFNAMSIZ) == 0) { 3578 if (strncmp(p->odevname, ifname, len) == 0) {
3579 if (p->odevname[len]) {
3580 if (exact || p->odevname[len] != '@')
3581 continue;
3582 }
3576 pkt_dev = p; 3583 pkt_dev = p;
3577 break; 3584 break;
3578 } 3585 }
@@ -3628,6 +3635,7 @@ static int pktgen_add_device(struct pktgen_thread *t, const char *ifname)
3628 if (!pkt_dev) 3635 if (!pkt_dev)
3629 return -ENOMEM; 3636 return -ENOMEM;
3630 3637
3638 strcpy(pkt_dev->odevname, ifname);
3631 pkt_dev->flows = vmalloc(MAX_CFLOWS * sizeof(struct flow_state)); 3639 pkt_dev->flows = vmalloc(MAX_CFLOWS * sizeof(struct flow_state));
3632 if (pkt_dev->flows == NULL) { 3640 if (pkt_dev->flows == NULL) {
3633 kfree(pkt_dev); 3641 kfree(pkt_dev);
diff --git a/net/core/skbuff.c b/net/core/skbuff.c
index 80a96166df39..ec85681a7dd8 100644
--- a/net/core/skbuff.c
+++ b/net/core/skbuff.c
@@ -2701,7 +2701,8 @@ int skb_gro_receive(struct sk_buff **head, struct sk_buff *skb)
2701 2701
2702 NAPI_GRO_CB(skb)->free = 1; 2702 NAPI_GRO_CB(skb)->free = 1;
2703 goto done; 2703 goto done;
2704 } 2704 } else if (skb_gro_len(p) != pinfo->gso_size)
2705 return -E2BIG;
2705 2706
2706 headroom = skb_headroom(p); 2707 headroom = skb_headroom(p);
2707 nskb = netdev_alloc_skb(p->dev, headroom + skb_gro_offset(p)); 2708 nskb = netdev_alloc_skb(p->dev, headroom + skb_gro_offset(p));
diff --git a/net/core/sysctl_net_core.c b/net/core/sysctl_net_core.c
index 7db1de0497c6..887c03c4e3c6 100644
--- a/net/core/sysctl_net_core.c
+++ b/net/core/sysctl_net_core.c
@@ -10,7 +10,9 @@
10#include <linux/module.h> 10#include <linux/module.h>
11#include <linux/socket.h> 11#include <linux/socket.h>
12#include <linux/netdevice.h> 12#include <linux/netdevice.h>
13#include <linux/ratelimit.h>
13#include <linux/init.h> 14#include <linux/init.h>
15
14#include <net/ip.h> 16#include <net/ip.h>
15#include <net/sock.h> 17#include <net/sock.h>
16 18
diff --git a/net/core/utils.c b/net/core/utils.c
index 83221aee7084..838250241d26 100644
--- a/net/core/utils.c
+++ b/net/core/utils.c
@@ -24,6 +24,8 @@
24#include <linux/types.h> 24#include <linux/types.h>
25#include <linux/percpu.h> 25#include <linux/percpu.h>
26#include <linux/init.h> 26#include <linux/init.h>
27#include <linux/ratelimit.h>
28
27#include <net/sock.h> 29#include <net/sock.h>
28 30
29#include <asm/byteorder.h> 31#include <asm/byteorder.h>
diff --git a/net/decnet/sysctl_net_decnet.c b/net/decnet/sysctl_net_decnet.c
index 26b0ab1e9f56..2036568beea9 100644
--- a/net/decnet/sysctl_net_decnet.c
+++ b/net/decnet/sysctl_net_decnet.c
@@ -263,11 +263,10 @@ static int dn_def_dev_strategy(ctl_table *table,
263 return -ENODEV; 263 return -ENODEV;
264 264
265 rv = -ENODEV; 265 rv = -ENODEV;
266 if (dev->dn_ptr != NULL) { 266 if (dev->dn_ptr != NULL)
267 rv = dn_dev_set_default(dev, 1); 267 rv = dn_dev_set_default(dev, 1);
268 if (rv) 268 if (rv)
269 dev_put(dev); 269 dev_put(dev);
270 }
271 } 270 }
272 271
273 return rv; 272 return rv;
diff --git a/net/ipv4/fib_frontend.c b/net/ipv4/fib_frontend.c
index e2f950592566..aa00398be80e 100644
--- a/net/ipv4/fib_frontend.c
+++ b/net/ipv4/fib_frontend.c
@@ -229,14 +229,17 @@ unsigned int inet_dev_addr_type(struct net *net, const struct net_device *dev,
229 */ 229 */
230 230
231int fib_validate_source(__be32 src, __be32 dst, u8 tos, int oif, 231int fib_validate_source(__be32 src, __be32 dst, u8 tos, int oif,
232 struct net_device *dev, __be32 *spec_dst, u32 *itag) 232 struct net_device *dev, __be32 *spec_dst,
233 u32 *itag, u32 mark)
233{ 234{
234 struct in_device *in_dev; 235 struct in_device *in_dev;
235 struct flowi fl = { .nl_u = { .ip4_u = 236 struct flowi fl = { .nl_u = { .ip4_u =
236 { .daddr = src, 237 { .daddr = src,
237 .saddr = dst, 238 .saddr = dst,
238 .tos = tos } }, 239 .tos = tos } },
240 .mark = mark,
239 .iif = oif }; 241 .iif = oif };
242
240 struct fib_result res; 243 struct fib_result res;
241 int no_addr, rpf; 244 int no_addr, rpf;
242 int ret; 245 int ret;
diff --git a/net/ipv4/ip_fragment.c b/net/ipv4/ip_fragment.c
index 575f9bd51ccd..d3fe10be7219 100644
--- a/net/ipv4/ip_fragment.c
+++ b/net/ipv4/ip_fragment.c
@@ -563,7 +563,7 @@ out_oversize:
563 printk(KERN_INFO "Oversized IP packet from %pI4.\n", 563 printk(KERN_INFO "Oversized IP packet from %pI4.\n",
564 &qp->saddr); 564 &qp->saddr);
565out_fail: 565out_fail:
566 IP_INC_STATS_BH(dev_net(dev), IPSTATS_MIB_REASMFAILS); 566 IP_INC_STATS_BH(net, IPSTATS_MIB_REASMFAILS);
567 return err; 567 return err;
568} 568}
569 569
diff --git a/net/ipv4/ip_gre.c b/net/ipv4/ip_gre.c
index 41ada9904d31..143333852624 100644
--- a/net/ipv4/ip_gre.c
+++ b/net/ipv4/ip_gre.c
@@ -1464,7 +1464,7 @@ static void ipgre_tap_setup(struct net_device *dev)
1464 1464
1465 ether_setup(dev); 1465 ether_setup(dev);
1466 1466
1467 dev->netdev_ops = &ipgre_netdev_ops; 1467 dev->netdev_ops = &ipgre_tap_netdev_ops;
1468 dev->destructor = free_netdev; 1468 dev->destructor = free_netdev;
1469 1469
1470 dev->iflink = 0; 1470 dev->iflink = 0;
@@ -1525,25 +1525,29 @@ static int ipgre_changelink(struct net_device *dev, struct nlattr *tb[],
1525 if (t->dev != dev) 1525 if (t->dev != dev)
1526 return -EEXIST; 1526 return -EEXIST;
1527 } else { 1527 } else {
1528 unsigned nflags = 0;
1529
1530 t = nt; 1528 t = nt;
1531 1529
1532 if (ipv4_is_multicast(p.iph.daddr)) 1530 if (dev->type != ARPHRD_ETHER) {
1533 nflags = IFF_BROADCAST; 1531 unsigned nflags = 0;
1534 else if (p.iph.daddr)
1535 nflags = IFF_POINTOPOINT;
1536 1532
1537 if ((dev->flags ^ nflags) & 1533 if (ipv4_is_multicast(p.iph.daddr))
1538 (IFF_POINTOPOINT | IFF_BROADCAST)) 1534 nflags = IFF_BROADCAST;
1539 return -EINVAL; 1535 else if (p.iph.daddr)
1536 nflags = IFF_POINTOPOINT;
1537
1538 if ((dev->flags ^ nflags) &
1539 (IFF_POINTOPOINT | IFF_BROADCAST))
1540 return -EINVAL;
1541 }
1540 1542
1541 ipgre_tunnel_unlink(ign, t); 1543 ipgre_tunnel_unlink(ign, t);
1542 t->parms.iph.saddr = p.iph.saddr; 1544 t->parms.iph.saddr = p.iph.saddr;
1543 t->parms.iph.daddr = p.iph.daddr; 1545 t->parms.iph.daddr = p.iph.daddr;
1544 t->parms.i_key = p.i_key; 1546 t->parms.i_key = p.i_key;
1545 memcpy(dev->dev_addr, &p.iph.saddr, 4); 1547 if (dev->type != ARPHRD_ETHER) {
1546 memcpy(dev->broadcast, &p.iph.daddr, 4); 1548 memcpy(dev->dev_addr, &p.iph.saddr, 4);
1549 memcpy(dev->broadcast, &p.iph.daddr, 4);
1550 }
1547 ipgre_tunnel_link(ign, t); 1551 ipgre_tunnel_link(ign, t);
1548 netdev_state_change(dev); 1552 netdev_state_change(dev);
1549 } 1553 }
diff --git a/net/ipv4/ipip.c b/net/ipv4/ipip.c
index 08ccd344de7a..ae40ed1ba560 100644
--- a/net/ipv4/ipip.c
+++ b/net/ipv4/ipip.c
@@ -438,25 +438,27 @@ static netdev_tx_t ipip_tunnel_xmit(struct sk_buff *skb, struct net_device *dev)
438 goto tx_error; 438 goto tx_error;
439 } 439 }
440 440
441 if (tiph->frag_off) 441 df |= old_iph->frag_off & htons(IP_DF);
442
443 if (df) {
442 mtu = dst_mtu(&rt->u.dst) - sizeof(struct iphdr); 444 mtu = dst_mtu(&rt->u.dst) - sizeof(struct iphdr);
443 else
444 mtu = skb_dst(skb) ? dst_mtu(skb_dst(skb)) : dev->mtu;
445 445
446 if (mtu < 68) { 446 if (mtu < 68) {
447 stats->collisions++; 447 stats->collisions++;
448 ip_rt_put(rt); 448 ip_rt_put(rt);
449 goto tx_error; 449 goto tx_error;
450 } 450 }
451 if (skb_dst(skb))
452 skb_dst(skb)->ops->update_pmtu(skb_dst(skb), mtu);
453 451
454 df |= (old_iph->frag_off&htons(IP_DF)); 452 if (skb_dst(skb))
453 skb_dst(skb)->ops->update_pmtu(skb_dst(skb), mtu);
455 454
456 if ((old_iph->frag_off&htons(IP_DF)) && mtu < ntohs(old_iph->tot_len)) { 455 if ((old_iph->frag_off & htons(IP_DF)) &&
457 icmp_send(skb, ICMP_DEST_UNREACH, ICMP_FRAG_NEEDED, htonl(mtu)); 456 mtu < ntohs(old_iph->tot_len)) {
458 ip_rt_put(rt); 457 icmp_send(skb, ICMP_DEST_UNREACH, ICMP_FRAG_NEEDED,
459 goto tx_error; 458 htonl(mtu));
459 ip_rt_put(rt);
460 goto tx_error;
461 }
460 } 462 }
461 463
462 if (tunnel->err_count > 0) { 464 if (tunnel->err_count > 0) {
diff --git a/net/ipv4/ipmr.c b/net/ipv4/ipmr.c
index 630a56df7b47..99508d66a642 100644
--- a/net/ipv4/ipmr.c
+++ b/net/ipv4/ipmr.c
@@ -483,8 +483,10 @@ static int vif_add(struct net *net, struct vifctl *vifc, int mrtsock)
483 return -EINVAL; 483 return -EINVAL;
484 } 484 }
485 485
486 if ((in_dev = __in_dev_get_rtnl(dev)) == NULL) 486 if ((in_dev = __in_dev_get_rtnl(dev)) == NULL) {
487 dev_put(dev);
487 return -EADDRNOTAVAIL; 488 return -EADDRNOTAVAIL;
489 }
488 IPV4_DEVCONF(in_dev->cnf, MC_FORWARDING)++; 490 IPV4_DEVCONF(in_dev->cnf, MC_FORWARDING)++;
489 ip_rt_multicast_event(in_dev); 491 ip_rt_multicast_event(in_dev);
490 492
diff --git a/net/ipv4/netfilter/nf_nat_core.c b/net/ipv4/netfilter/nf_nat_core.c
index 68afc6ecd343..fe1a64479dd0 100644
--- a/net/ipv4/netfilter/nf_nat_core.c
+++ b/net/ipv4/netfilter/nf_nat_core.c
@@ -750,6 +750,8 @@ static int __init nf_nat_init(void)
750 BUG_ON(nfnetlink_parse_nat_setup_hook != NULL); 750 BUG_ON(nfnetlink_parse_nat_setup_hook != NULL);
751 rcu_assign_pointer(nfnetlink_parse_nat_setup_hook, 751 rcu_assign_pointer(nfnetlink_parse_nat_setup_hook,
752 nfnetlink_parse_nat_setup); 752 nfnetlink_parse_nat_setup);
753 BUG_ON(nf_ct_nat_offset != NULL);
754 rcu_assign_pointer(nf_ct_nat_offset, nf_nat_get_offset);
753 return 0; 755 return 0;
754 756
755 cleanup_extend: 757 cleanup_extend:
@@ -764,6 +766,7 @@ static void __exit nf_nat_cleanup(void)
764 nf_ct_extend_unregister(&nat_extend); 766 nf_ct_extend_unregister(&nat_extend);
765 rcu_assign_pointer(nf_nat_seq_adjust_hook, NULL); 767 rcu_assign_pointer(nf_nat_seq_adjust_hook, NULL);
766 rcu_assign_pointer(nfnetlink_parse_nat_setup_hook, NULL); 768 rcu_assign_pointer(nfnetlink_parse_nat_setup_hook, NULL);
769 rcu_assign_pointer(nf_ct_nat_offset, NULL);
767 synchronize_net(); 770 synchronize_net();
768} 771}
769 772
diff --git a/net/ipv4/netfilter/nf_nat_helper.c b/net/ipv4/netfilter/nf_nat_helper.c
index 09172a65d9b6..f9520fa3aba9 100644
--- a/net/ipv4/netfilter/nf_nat_helper.c
+++ b/net/ipv4/netfilter/nf_nat_helper.c
@@ -73,6 +73,28 @@ adjust_tcp_sequence(u32 seq,
73 DUMP_OFFSET(this_way); 73 DUMP_OFFSET(this_way);
74} 74}
75 75
76/* Get the offset value, for conntrack */
77s16 nf_nat_get_offset(const struct nf_conn *ct,
78 enum ip_conntrack_dir dir,
79 u32 seq)
80{
81 struct nf_conn_nat *nat = nfct_nat(ct);
82 struct nf_nat_seq *this_way;
83 s16 offset;
84
85 if (!nat)
86 return 0;
87
88 this_way = &nat->seq[dir];
89 spin_lock_bh(&nf_nat_seqofs_lock);
90 offset = after(seq, this_way->correction_pos)
91 ? this_way->offset_after : this_way->offset_before;
92 spin_unlock_bh(&nf_nat_seqofs_lock);
93
94 return offset;
95}
96EXPORT_SYMBOL_GPL(nf_nat_get_offset);
97
76/* Frobs data inside this packet, which is linear. */ 98/* Frobs data inside this packet, which is linear. */
77static void mangle_contents(struct sk_buff *skb, 99static void mangle_contents(struct sk_buff *skb,
78 unsigned int dataoff, 100 unsigned int dataoff,
@@ -189,11 +211,6 @@ nf_nat_mangle_tcp_packet(struct sk_buff *skb,
189 adjust_tcp_sequence(ntohl(tcph->seq), 211 adjust_tcp_sequence(ntohl(tcph->seq),
190 (int)rep_len - (int)match_len, 212 (int)rep_len - (int)match_len,
191 ct, ctinfo); 213 ct, ctinfo);
192 /* Tell TCP window tracking about seq change */
193 nf_conntrack_tcp_update(skb, ip_hdrlen(skb),
194 ct, CTINFO2DIR(ctinfo),
195 (int)rep_len - (int)match_len);
196
197 nf_conntrack_event_cache(IPCT_NATSEQADJ, ct); 214 nf_conntrack_event_cache(IPCT_NATSEQADJ, ct);
198 } 215 }
199 return 1; 216 return 1;
@@ -415,12 +432,7 @@ nf_nat_seq_adjust(struct sk_buff *skb,
415 tcph->seq = newseq; 432 tcph->seq = newseq;
416 tcph->ack_seq = newack; 433 tcph->ack_seq = newack;
417 434
418 if (!nf_nat_sack_adjust(skb, tcph, ct, ctinfo)) 435 return nf_nat_sack_adjust(skb, tcph, ct, ctinfo);
419 return 0;
420
421 nf_conntrack_tcp_update(skb, ip_hdrlen(skb), ct, dir, seqoff);
422
423 return 1;
424} 436}
425 437
426/* Setup NAT on this expected conntrack so it follows master. */ 438/* Setup NAT on this expected conntrack so it follows master. */
diff --git a/net/ipv4/route.c b/net/ipv4/route.c
index bb4199252026..5b1050a5d874 100644
--- a/net/ipv4/route.c
+++ b/net/ipv4/route.c
@@ -1854,7 +1854,7 @@ static int ip_route_input_mc(struct sk_buff *skb, __be32 daddr, __be32 saddr,
1854 goto e_inval; 1854 goto e_inval;
1855 spec_dst = inet_select_addr(dev, 0, RT_SCOPE_LINK); 1855 spec_dst = inet_select_addr(dev, 0, RT_SCOPE_LINK);
1856 } else if (fib_validate_source(saddr, 0, tos, 0, 1856 } else if (fib_validate_source(saddr, 0, tos, 0,
1857 dev, &spec_dst, &itag) < 0) 1857 dev, &spec_dst, &itag, 0) < 0)
1858 goto e_inval; 1858 goto e_inval;
1859 1859
1860 rth = dst_alloc(&ipv4_dst_ops); 1860 rth = dst_alloc(&ipv4_dst_ops);
@@ -1967,7 +1967,7 @@ static int __mkroute_input(struct sk_buff *skb,
1967 1967
1968 1968
1969 err = fib_validate_source(saddr, daddr, tos, FIB_RES_OIF(*res), 1969 err = fib_validate_source(saddr, daddr, tos, FIB_RES_OIF(*res),
1970 in_dev->dev, &spec_dst, &itag); 1970 in_dev->dev, &spec_dst, &itag, skb->mark);
1971 if (err < 0) { 1971 if (err < 0) {
1972 ip_handle_martian_source(in_dev->dev, in_dev, skb, daddr, 1972 ip_handle_martian_source(in_dev->dev, in_dev, skb, daddr,
1973 saddr); 1973 saddr);
@@ -2141,7 +2141,7 @@ static int ip_route_input_slow(struct sk_buff *skb, __be32 daddr, __be32 saddr,
2141 int result; 2141 int result;
2142 result = fib_validate_source(saddr, daddr, tos, 2142 result = fib_validate_source(saddr, daddr, tos,
2143 net->loopback_dev->ifindex, 2143 net->loopback_dev->ifindex,
2144 dev, &spec_dst, &itag); 2144 dev, &spec_dst, &itag, skb->mark);
2145 if (result < 0) 2145 if (result < 0)
2146 goto martian_source; 2146 goto martian_source;
2147 if (result) 2147 if (result)
@@ -2170,7 +2170,7 @@ brd_input:
2170 spec_dst = inet_select_addr(dev, 0, RT_SCOPE_LINK); 2170 spec_dst = inet_select_addr(dev, 0, RT_SCOPE_LINK);
2171 else { 2171 else {
2172 err = fib_validate_source(saddr, 0, tos, 0, dev, &spec_dst, 2172 err = fib_validate_source(saddr, 0, tos, 0, dev, &spec_dst,
2173 &itag); 2173 &itag, skb->mark);
2174 if (err < 0) 2174 if (err < 0)
2175 goto martian_source; 2175 goto martian_source;
2176 if (err) 2176 if (err)
diff --git a/net/ipv4/tcp.c b/net/ipv4/tcp.c
index 98440ad82558..f1813bc71088 100644
--- a/net/ipv4/tcp.c
+++ b/net/ipv4/tcp.c
@@ -1183,7 +1183,9 @@ void tcp_cleanup_rbuf(struct sock *sk, int copied)
1183#if TCP_DEBUG 1183#if TCP_DEBUG
1184 struct sk_buff *skb = skb_peek(&sk->sk_receive_queue); 1184 struct sk_buff *skb = skb_peek(&sk->sk_receive_queue);
1185 1185
1186 WARN_ON(skb && !before(tp->copied_seq, TCP_SKB_CB(skb)->end_seq)); 1186 WARN(skb && !before(tp->copied_seq, TCP_SKB_CB(skb)->end_seq),
1187 KERN_INFO "cleanup rbuf bug: copied %X seq %X rcvnxt %X\n",
1188 tp->copied_seq, TCP_SKB_CB(skb)->end_seq, tp->rcv_nxt);
1187#endif 1189#endif
1188 1190
1189 if (inet_csk_ack_scheduled(sk)) { 1191 if (inet_csk_ack_scheduled(sk)) {
@@ -1430,11 +1432,13 @@ int tcp_recvmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg,
1430 /* Now that we have two receive queues this 1432 /* Now that we have two receive queues this
1431 * shouldn't happen. 1433 * shouldn't happen.
1432 */ 1434 */
1433 if (before(*seq, TCP_SKB_CB(skb)->seq)) { 1435 if (WARN(before(*seq, TCP_SKB_CB(skb)->seq),
1434 printk(KERN_INFO "recvmsg bug: copied %X " 1436 KERN_INFO "recvmsg bug: copied %X "
1435 "seq %X\n", *seq, TCP_SKB_CB(skb)->seq); 1437 "seq %X rcvnxt %X fl %X\n", *seq,
1438 TCP_SKB_CB(skb)->seq, tp->rcv_nxt,
1439 flags))
1436 break; 1440 break;
1437 } 1441
1438 offset = *seq - TCP_SKB_CB(skb)->seq; 1442 offset = *seq - TCP_SKB_CB(skb)->seq;
1439 if (tcp_hdr(skb)->syn) 1443 if (tcp_hdr(skb)->syn)
1440 offset--; 1444 offset--;
@@ -1443,8 +1447,9 @@ int tcp_recvmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg,
1443 if (tcp_hdr(skb)->fin) 1447 if (tcp_hdr(skb)->fin)
1444 goto found_fin_ok; 1448 goto found_fin_ok;
1445 WARN(!(flags & MSG_PEEK), KERN_INFO "recvmsg bug 2: " 1449 WARN(!(flags & MSG_PEEK), KERN_INFO "recvmsg bug 2: "
1446 "copied %X seq %X\n", *seq, 1450 "copied %X seq %X rcvnxt %X fl %X\n",
1447 TCP_SKB_CB(skb)->seq); 1451 *seq, TCP_SKB_CB(skb)->seq,
1452 tp->rcv_nxt, flags);
1448 } 1453 }
1449 1454
1450 /* Well, if we have backlog, try to process it now yet. */ 1455 /* Well, if we have backlog, try to process it now yet. */
diff --git a/net/ipv4/udp.c b/net/ipv4/udp.c
index d0d436d6216c..0fa9f70e4b19 100644
--- a/net/ipv4/udp.c
+++ b/net/ipv4/udp.c
@@ -999,9 +999,7 @@ try_again:
999 err = ulen; 999 err = ulen;
1000 1000
1001out_free: 1001out_free:
1002 lock_sock(sk); 1002 skb_free_datagram_locked(sk, skb);
1003 skb_free_datagram(sk, skb);
1004 release_sock(sk);
1005out: 1003out:
1006 return err; 1004 return err;
1007 1005
diff --git a/net/ipv6/udp.c b/net/ipv6/udp.c
index 3a60f12b34ed..cf538ed5ef6a 100644
--- a/net/ipv6/udp.c
+++ b/net/ipv6/udp.c
@@ -288,9 +288,7 @@ try_again:
288 err = ulen; 288 err = ulen;
289 289
290out_free: 290out_free:
291 lock_sock(sk); 291 skb_free_datagram_locked(sk, skb);
292 skb_free_datagram(sk, skb);
293 release_sock(sk);
294out: 292out:
295 return err; 293 return err;
296 294
diff --git a/net/mac80211/agg-rx.c b/net/mac80211/agg-rx.c
index bc064d7933ff..ce8e0e772bab 100644
--- a/net/mac80211/agg-rx.c
+++ b/net/mac80211/agg-rx.c
@@ -85,10 +85,6 @@ void ieee80211_sta_stop_rx_ba_session(struct ieee80211_sub_if_data *sdata, u8 *r
85 struct ieee80211_local *local = sdata->local; 85 struct ieee80211_local *local = sdata->local;
86 struct sta_info *sta; 86 struct sta_info *sta;
87 87
88 /* stop HW Rx aggregation. ampdu_action existence
89 * already verified in session init so we add the BUG_ON */
90 BUG_ON(!local->ops->ampdu_action);
91
92 rcu_read_lock(); 88 rcu_read_lock();
93 89
94 sta = sta_info_get(local, ra); 90 sta = sta_info_get(local, ra);
diff --git a/net/mac80211/agg-tx.c b/net/mac80211/agg-tx.c
index bd765f30dba2..89e238b001de 100644
--- a/net/mac80211/agg-tx.c
+++ b/net/mac80211/agg-tx.c
@@ -123,13 +123,18 @@ void ieee80211_send_bar(struct ieee80211_sub_if_data *sdata, u8 *ra, u16 tid, u1
123 ieee80211_tx_skb(sdata, skb, 0); 123 ieee80211_tx_skb(sdata, skb, 0);
124} 124}
125 125
126static int ___ieee80211_stop_tx_ba_session(struct sta_info *sta, u16 tid, 126int ___ieee80211_stop_tx_ba_session(struct sta_info *sta, u16 tid,
127 enum ieee80211_back_parties initiator) 127 enum ieee80211_back_parties initiator)
128{ 128{
129 struct ieee80211_local *local = sta->local; 129 struct ieee80211_local *local = sta->local;
130 int ret; 130 int ret;
131 u8 *state; 131 u8 *state;
132 132
133#ifdef CONFIG_MAC80211_HT_DEBUG
134 printk(KERN_DEBUG "Tx BA session stop requested for %pM tid %u\n",
135 sta->sta.addr, tid);
136#endif /* CONFIG_MAC80211_HT_DEBUG */
137
133 state = &sta->ampdu_mlme.tid_state_tx[tid]; 138 state = &sta->ampdu_mlme.tid_state_tx[tid];
134 139
135 if (*state == HT_AGG_STATE_OPERATIONAL) 140 if (*state == HT_AGG_STATE_OPERATIONAL)
@@ -143,7 +148,6 @@ static int ___ieee80211_stop_tx_ba_session(struct sta_info *sta, u16 tid,
143 148
144 /* HW shall not deny going back to legacy */ 149 /* HW shall not deny going back to legacy */
145 if (WARN_ON(ret)) { 150 if (WARN_ON(ret)) {
146 *state = HT_AGG_STATE_OPERATIONAL;
147 /* 151 /*
148 * We may have pending packets get stuck in this case... 152 * We may have pending packets get stuck in this case...
149 * Not bothering with a workaround for now. 153 * Not bothering with a workaround for now.
@@ -173,12 +177,14 @@ static void sta_addba_resp_timer_expired(unsigned long data)
173 177
174 /* check if the TID waits for addBA response */ 178 /* check if the TID waits for addBA response */
175 spin_lock_bh(&sta->lock); 179 spin_lock_bh(&sta->lock);
176 if (!(*state & HT_ADDBA_REQUESTED_MSK)) { 180 if ((*state & (HT_ADDBA_REQUESTED_MSK | HT_ADDBA_RECEIVED_MSK)) !=
181 HT_ADDBA_REQUESTED_MSK) {
177 spin_unlock_bh(&sta->lock); 182 spin_unlock_bh(&sta->lock);
178 *state = HT_AGG_STATE_IDLE; 183 *state = HT_AGG_STATE_IDLE;
179#ifdef CONFIG_MAC80211_HT_DEBUG 184#ifdef CONFIG_MAC80211_HT_DEBUG
180 printk(KERN_DEBUG "timer expired on tid %d but we are not " 185 printk(KERN_DEBUG "timer expired on tid %d but we are not "
181 "expecting addBA response there", tid); 186 "(or no longer) expecting addBA response there",
187 tid);
182#endif 188#endif
183 return; 189 return;
184 } 190 }
@@ -523,11 +529,6 @@ int __ieee80211_stop_tx_ba_session(struct sta_info *sta, u16 tid,
523 goto unlock; 529 goto unlock;
524 } 530 }
525 531
526#ifdef CONFIG_MAC80211_HT_DEBUG
527 printk(KERN_DEBUG "Tx BA session stop requested for %pM tid %u\n",
528 sta->sta.addr, tid);
529#endif /* CONFIG_MAC80211_HT_DEBUG */
530
531 ret = ___ieee80211_stop_tx_ba_session(sta, tid, initiator); 532 ret = ___ieee80211_stop_tx_ba_session(sta, tid, initiator);
532 533
533 unlock: 534 unlock:
@@ -543,7 +544,7 @@ int ieee80211_stop_tx_ba_session(struct ieee80211_hw *hw,
543 struct sta_info *sta; 544 struct sta_info *sta;
544 int ret = 0; 545 int ret = 0;
545 546
546 if (WARN_ON(!local->ops->ampdu_action)) 547 if (!local->ops->ampdu_action)
547 return -EINVAL; 548 return -EINVAL;
548 549
549 if (tid >= STA_TID_NUM) 550 if (tid >= STA_TID_NUM)
@@ -668,24 +669,23 @@ void ieee80211_process_addba_resp(struct ieee80211_local *local,
668 669
669 spin_lock_bh(&sta->lock); 670 spin_lock_bh(&sta->lock);
670 671
671 if (!(*state & HT_ADDBA_REQUESTED_MSK)) { 672 if (!(*state & HT_ADDBA_REQUESTED_MSK))
672 spin_unlock_bh(&sta->lock); 673 goto out;
673 return;
674 }
675 674
676 if (mgmt->u.action.u.addba_resp.dialog_token != 675 if (mgmt->u.action.u.addba_resp.dialog_token !=
677 sta->ampdu_mlme.tid_tx[tid]->dialog_token) { 676 sta->ampdu_mlme.tid_tx[tid]->dialog_token) {
678 spin_unlock_bh(&sta->lock);
679#ifdef CONFIG_MAC80211_HT_DEBUG 677#ifdef CONFIG_MAC80211_HT_DEBUG
680 printk(KERN_DEBUG "wrong addBA response token, tid %d\n", tid); 678 printk(KERN_DEBUG "wrong addBA response token, tid %d\n", tid);
681#endif /* CONFIG_MAC80211_HT_DEBUG */ 679#endif /* CONFIG_MAC80211_HT_DEBUG */
682 return; 680 goto out;
683 } 681 }
684 682
685 del_timer_sync(&sta->ampdu_mlme.tid_tx[tid]->addba_resp_timer); 683 del_timer(&sta->ampdu_mlme.tid_tx[tid]->addba_resp_timer);
684
686#ifdef CONFIG_MAC80211_HT_DEBUG 685#ifdef CONFIG_MAC80211_HT_DEBUG
687 printk(KERN_DEBUG "switched off addBA timer for tid %d \n", tid); 686 printk(KERN_DEBUG "switched off addBA timer for tid %d \n", tid);
688#endif /* CONFIG_MAC80211_HT_DEBUG */ 687#endif /* CONFIG_MAC80211_HT_DEBUG */
688
689 if (le16_to_cpu(mgmt->u.action.u.addba_resp.status) 689 if (le16_to_cpu(mgmt->u.action.u.addba_resp.status)
690 == WLAN_STATUS_SUCCESS) { 690 == WLAN_STATUS_SUCCESS) {
691 u8 curstate = *state; 691 u8 curstate = *state;
@@ -699,5 +699,7 @@ void ieee80211_process_addba_resp(struct ieee80211_local *local,
699 } else { 699 } else {
700 ___ieee80211_stop_tx_ba_session(sta, tid, WLAN_BACK_INITIATOR); 700 ___ieee80211_stop_tx_ba_session(sta, tid, WLAN_BACK_INITIATOR);
701 } 701 }
702
703 out:
702 spin_unlock_bh(&sta->lock); 704 spin_unlock_bh(&sta->lock);
703} 705}
diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c
index 5608f6c68413..7b5131bd6fa1 100644
--- a/net/mac80211/cfg.c
+++ b/net/mac80211/cfg.c
@@ -72,6 +72,9 @@ static int ieee80211_change_iface(struct wiphy *wiphy,
72 struct ieee80211_sub_if_data *sdata; 72 struct ieee80211_sub_if_data *sdata;
73 int ret; 73 int ret;
74 74
75 if (netif_running(dev))
76 return -EBUSY;
77
75 if (!nl80211_type_check(type)) 78 if (!nl80211_type_check(type))
76 return -EINVAL; 79 return -EINVAL;
77 80
@@ -81,9 +84,6 @@ static int ieee80211_change_iface(struct wiphy *wiphy,
81 if (ret) 84 if (ret)
82 return ret; 85 return ret;
83 86
84 if (netif_running(sdata->dev))
85 return -EBUSY;
86
87 if (ieee80211_vif_is_mesh(&sdata->vif) && params->mesh_id_len) 87 if (ieee80211_vif_is_mesh(&sdata->vif) && params->mesh_id_len)
88 ieee80211_sdata_set_mesh_id(sdata, 88 ieee80211_sdata_set_mesh_id(sdata,
89 params->mesh_id_len, 89 params->mesh_id_len,
diff --git a/net/mac80211/ht.c b/net/mac80211/ht.c
index 0891bfb06996..cdc58e61d921 100644
--- a/net/mac80211/ht.c
+++ b/net/mac80211/ht.c
@@ -141,7 +141,6 @@ void ieee80211_process_delba(struct ieee80211_sub_if_data *sdata,
141 struct sta_info *sta, 141 struct sta_info *sta,
142 struct ieee80211_mgmt *mgmt, size_t len) 142 struct ieee80211_mgmt *mgmt, size_t len)
143{ 143{
144 struct ieee80211_local *local = sdata->local;
145 u16 tid, params; 144 u16 tid, params;
146 u16 initiator; 145 u16 initiator;
147 146
@@ -153,7 +152,7 @@ void ieee80211_process_delba(struct ieee80211_sub_if_data *sdata,
153 if (net_ratelimit()) 152 if (net_ratelimit())
154 printk(KERN_DEBUG "delba from %pM (%s) tid %d reason code %d\n", 153 printk(KERN_DEBUG "delba from %pM (%s) tid %d reason code %d\n",
155 mgmt->sa, initiator ? "initiator" : "recipient", tid, 154 mgmt->sa, initiator ? "initiator" : "recipient", tid,
156 mgmt->u.action.u.delba.reason_code); 155 le16_to_cpu(mgmt->u.action.u.delba.reason_code));
157#endif /* CONFIG_MAC80211_HT_DEBUG */ 156#endif /* CONFIG_MAC80211_HT_DEBUG */
158 157
159 if (initiator == WLAN_BACK_INITIATOR) 158 if (initiator == WLAN_BACK_INITIATOR)
@@ -161,10 +160,9 @@ void ieee80211_process_delba(struct ieee80211_sub_if_data *sdata,
161 WLAN_BACK_INITIATOR, 0); 160 WLAN_BACK_INITIATOR, 0);
162 else { /* WLAN_BACK_RECIPIENT */ 161 else { /* WLAN_BACK_RECIPIENT */
163 spin_lock_bh(&sta->lock); 162 spin_lock_bh(&sta->lock);
164 sta->ampdu_mlme.tid_state_tx[tid] = 163 if (sta->ampdu_mlme.tid_state_tx[tid] & HT_ADDBA_REQUESTED_MSK)
165 HT_AGG_STATE_OPERATIONAL; 164 ___ieee80211_stop_tx_ba_session(sta, tid,
165 WLAN_BACK_RECIPIENT);
166 spin_unlock_bh(&sta->lock); 166 spin_unlock_bh(&sta->lock);
167 ieee80211_stop_tx_ba_session(&local->hw, sta->sta.addr, tid,
168 WLAN_BACK_RECIPIENT);
169 } 167 }
170} 168}
diff --git a/net/mac80211/ibss.c b/net/mac80211/ibss.c
index ca8ecce31d34..f1362f32c17d 100644
--- a/net/mac80211/ibss.c
+++ b/net/mac80211/ibss.c
@@ -73,6 +73,7 @@ static void __ieee80211_sta_join_ibss(struct ieee80211_sub_if_data *sdata,
73 struct ieee80211_mgmt *mgmt; 73 struct ieee80211_mgmt *mgmt;
74 u8 *pos; 74 u8 *pos;
75 struct ieee80211_supported_band *sband; 75 struct ieee80211_supported_band *sband;
76 struct cfg80211_bss *bss;
76 u32 bss_change; 77 u32 bss_change;
77 u8 supp_rates[IEEE80211_MAX_SUPP_RATES]; 78 u8 supp_rates[IEEE80211_MAX_SUPP_RATES];
78 79
@@ -177,8 +178,9 @@ static void __ieee80211_sta_join_ibss(struct ieee80211_sub_if_data *sdata,
177 mod_timer(&ifibss->timer, 178 mod_timer(&ifibss->timer,
178 round_jiffies(jiffies + IEEE80211_IBSS_MERGE_INTERVAL)); 179 round_jiffies(jiffies + IEEE80211_IBSS_MERGE_INTERVAL));
179 180
180 cfg80211_inform_bss_frame(local->hw.wiphy, local->hw.conf.channel, 181 bss = cfg80211_inform_bss_frame(local->hw.wiphy, local->hw.conf.channel,
181 mgmt, skb->len, 0, GFP_KERNEL); 182 mgmt, skb->len, 0, GFP_KERNEL);
183 cfg80211_put_bss(bss);
182 cfg80211_ibss_joined(sdata->dev, ifibss->bssid, GFP_KERNEL); 184 cfg80211_ibss_joined(sdata->dev, ifibss->bssid, GFP_KERNEL);
183} 185}
184 186
diff --git a/net/mac80211/ieee80211_i.h b/net/mac80211/ieee80211_i.h
index 588005c84a6d..10d316e455de 100644
--- a/net/mac80211/ieee80211_i.h
+++ b/net/mac80211/ieee80211_i.h
@@ -662,6 +662,14 @@ struct ieee80211_local {
662 bool suspended; 662 bool suspended;
663 663
664 /* 664 /*
665 * Resuming is true while suspended, but when we're reprogramming the
666 * hardware -- at that time it's allowed to use ieee80211_queue_work()
667 * again even though some other parts of the stack are still suspended
668 * and we still drop received frames to avoid waking the stack.
669 */
670 bool resuming;
671
672 /*
665 * quiescing is true during the suspend process _only_ to 673 * quiescing is true during the suspend process _only_ to
666 * ease timer cancelling etc. 674 * ease timer cancelling etc.
667 */ 675 */
@@ -1083,6 +1091,8 @@ void ieee80211_process_addba_request(struct ieee80211_local *local,
1083 1091
1084int __ieee80211_stop_tx_ba_session(struct sta_info *sta, u16 tid, 1092int __ieee80211_stop_tx_ba_session(struct sta_info *sta, u16 tid,
1085 enum ieee80211_back_parties initiator); 1093 enum ieee80211_back_parties initiator);
1094int ___ieee80211_stop_tx_ba_session(struct sta_info *sta, u16 tid,
1095 enum ieee80211_back_parties initiator);
1086 1096
1087/* Spectrum management */ 1097/* Spectrum management */
1088void ieee80211_process_measurement_req(struct ieee80211_sub_if_data *sdata, 1098void ieee80211_process_measurement_req(struct ieee80211_sub_if_data *sdata,
diff --git a/net/mac80211/util.c b/net/mac80211/util.c
index aeb65b3d2295..e6c08da8da26 100644
--- a/net/mac80211/util.c
+++ b/net/mac80211/util.c
@@ -520,9 +520,9 @@ EXPORT_SYMBOL_GPL(ieee80211_iterate_active_interfaces_atomic);
520 */ 520 */
521static bool ieee80211_can_queue_work(struct ieee80211_local *local) 521static bool ieee80211_can_queue_work(struct ieee80211_local *local)
522{ 522{
523 if (WARN(local->suspended, "queueing ieee80211 work while " 523 if (WARN(local->suspended && !local->resuming,
524 "going to suspend\n")) 524 "queueing ieee80211 work while going to suspend\n"))
525 return false; 525 return false;
526 526
527 return true; 527 return true;
528} 528}
@@ -1025,13 +1025,9 @@ int ieee80211_reconfig(struct ieee80211_local *local)
1025 struct sta_info *sta; 1025 struct sta_info *sta;
1026 unsigned long flags; 1026 unsigned long flags;
1027 int res; 1027 int res;
1028 bool from_suspend = local->suspended;
1029 1028
1030 /* 1029 if (local->suspended)
1031 * We're going to start the hardware, at that point 1030 local->resuming = true;
1032 * we are no longer suspended and can RX frames.
1033 */
1034 local->suspended = false;
1035 1031
1036 /* restart hardware */ 1032 /* restart hardware */
1037 if (local->open_count) { 1033 if (local->open_count) {
@@ -1129,11 +1125,14 @@ int ieee80211_reconfig(struct ieee80211_local *local)
1129 * If this is for hw restart things are still running. 1125 * If this is for hw restart things are still running.
1130 * We may want to change that later, however. 1126 * We may want to change that later, however.
1131 */ 1127 */
1132 if (!from_suspend) 1128 if (!local->suspended)
1133 return 0; 1129 return 0;
1134 1130
1135#ifdef CONFIG_PM 1131#ifdef CONFIG_PM
1132 /* first set suspended false, then resuming */
1136 local->suspended = false; 1133 local->suspended = false;
1134 mb();
1135 local->resuming = false;
1137 1136
1138 list_for_each_entry(sdata, &local->interfaces, list) { 1137 list_for_each_entry(sdata, &local->interfaces, list) {
1139 switch(sdata->vif.type) { 1138 switch(sdata->vif.type) {
diff --git a/net/netfilter/nf_conntrack_core.c b/net/netfilter/nf_conntrack_core.c
index ca6e68dcd8a8..b9168c1864ca 100644
--- a/net/netfilter/nf_conntrack_core.c
+++ b/net/netfilter/nf_conntrack_core.c
@@ -1351,6 +1351,11 @@ err_stat:
1351 return ret; 1351 return ret;
1352} 1352}
1353 1353
1354s16 (*nf_ct_nat_offset)(const struct nf_conn *ct,
1355 enum ip_conntrack_dir dir,
1356 u32 seq);
1357EXPORT_SYMBOL_GPL(nf_ct_nat_offset);
1358
1354int nf_conntrack_init(struct net *net) 1359int nf_conntrack_init(struct net *net)
1355{ 1360{
1356 int ret; 1361 int ret;
@@ -1368,6 +1373,9 @@ int nf_conntrack_init(struct net *net)
1368 /* For use by REJECT target */ 1373 /* For use by REJECT target */
1369 rcu_assign_pointer(ip_ct_attach, nf_conntrack_attach); 1374 rcu_assign_pointer(ip_ct_attach, nf_conntrack_attach);
1370 rcu_assign_pointer(nf_ct_destroy, destroy_conntrack); 1375 rcu_assign_pointer(nf_ct_destroy, destroy_conntrack);
1376
1377 /* Howto get NAT offsets */
1378 rcu_assign_pointer(nf_ct_nat_offset, NULL);
1371 } 1379 }
1372 return 0; 1380 return 0;
1373 1381
diff --git a/net/netfilter/nf_conntrack_proto_tcp.c b/net/netfilter/nf_conntrack_proto_tcp.c
index 97a82ba75376..ba2b76937283 100644
--- a/net/netfilter/nf_conntrack_proto_tcp.c
+++ b/net/netfilter/nf_conntrack_proto_tcp.c
@@ -492,6 +492,21 @@ static void tcp_sack(const struct sk_buff *skb, unsigned int dataoff,
492 } 492 }
493} 493}
494 494
495#ifdef CONFIG_NF_NAT_NEEDED
496static inline s16 nat_offset(const struct nf_conn *ct,
497 enum ip_conntrack_dir dir,
498 u32 seq)
499{
500 typeof(nf_ct_nat_offset) get_offset = rcu_dereference(nf_ct_nat_offset);
501
502 return get_offset != NULL ? get_offset(ct, dir, seq) : 0;
503}
504#define NAT_OFFSET(pf, ct, dir, seq) \
505 (pf == NFPROTO_IPV4 ? nat_offset(ct, dir, seq) : 0)
506#else
507#define NAT_OFFSET(pf, ct, dir, seq) 0
508#endif
509
495static bool tcp_in_window(const struct nf_conn *ct, 510static bool tcp_in_window(const struct nf_conn *ct,
496 struct ip_ct_tcp *state, 511 struct ip_ct_tcp *state,
497 enum ip_conntrack_dir dir, 512 enum ip_conntrack_dir dir,
@@ -506,6 +521,7 @@ static bool tcp_in_window(const struct nf_conn *ct,
506 struct ip_ct_tcp_state *receiver = &state->seen[!dir]; 521 struct ip_ct_tcp_state *receiver = &state->seen[!dir];
507 const struct nf_conntrack_tuple *tuple = &ct->tuplehash[dir].tuple; 522 const struct nf_conntrack_tuple *tuple = &ct->tuplehash[dir].tuple;
508 __u32 seq, ack, sack, end, win, swin; 523 __u32 seq, ack, sack, end, win, swin;
524 s16 receiver_offset;
509 bool res; 525 bool res;
510 526
511 /* 527 /*
@@ -519,11 +535,16 @@ static bool tcp_in_window(const struct nf_conn *ct,
519 if (receiver->flags & IP_CT_TCP_FLAG_SACK_PERM) 535 if (receiver->flags & IP_CT_TCP_FLAG_SACK_PERM)
520 tcp_sack(skb, dataoff, tcph, &sack); 536 tcp_sack(skb, dataoff, tcph, &sack);
521 537
538 /* Take into account NAT sequence number mangling */
539 receiver_offset = NAT_OFFSET(pf, ct, !dir, ack - 1);
540 ack -= receiver_offset;
541 sack -= receiver_offset;
542
522 pr_debug("tcp_in_window: START\n"); 543 pr_debug("tcp_in_window: START\n");
523 pr_debug("tcp_in_window: "); 544 pr_debug("tcp_in_window: ");
524 nf_ct_dump_tuple(tuple); 545 nf_ct_dump_tuple(tuple);
525 pr_debug("seq=%u ack=%u sack=%u win=%u end=%u\n", 546 pr_debug("seq=%u ack=%u+(%d) sack=%u+(%d) win=%u end=%u\n",
526 seq, ack, sack, win, end); 547 seq, ack, receiver_offset, sack, receiver_offset, win, end);
527 pr_debug("tcp_in_window: sender end=%u maxend=%u maxwin=%u scale=%i " 548 pr_debug("tcp_in_window: sender end=%u maxend=%u maxwin=%u scale=%i "
528 "receiver end=%u maxend=%u maxwin=%u scale=%i\n", 549 "receiver end=%u maxend=%u maxwin=%u scale=%i\n",
529 sender->td_end, sender->td_maxend, sender->td_maxwin, 550 sender->td_end, sender->td_maxend, sender->td_maxwin,
@@ -613,8 +634,8 @@ static bool tcp_in_window(const struct nf_conn *ct,
613 634
614 pr_debug("tcp_in_window: "); 635 pr_debug("tcp_in_window: ");
615 nf_ct_dump_tuple(tuple); 636 nf_ct_dump_tuple(tuple);
616 pr_debug("seq=%u ack=%u sack =%u win=%u end=%u\n", 637 pr_debug("seq=%u ack=%u+(%d) sack=%u+(%d) win=%u end=%u\n",
617 seq, ack, sack, win, end); 638 seq, ack, receiver_offset, sack, receiver_offset, win, end);
618 pr_debug("tcp_in_window: sender end=%u maxend=%u maxwin=%u scale=%i " 639 pr_debug("tcp_in_window: sender end=%u maxend=%u maxwin=%u scale=%i "
619 "receiver end=%u maxend=%u maxwin=%u scale=%i\n", 640 "receiver end=%u maxend=%u maxwin=%u scale=%i\n",
620 sender->td_end, sender->td_maxend, sender->td_maxwin, 641 sender->td_end, sender->td_maxend, sender->td_maxwin,
@@ -700,7 +721,7 @@ static bool tcp_in_window(const struct nf_conn *ct,
700 before(seq, sender->td_maxend + 1) ? 721 before(seq, sender->td_maxend + 1) ?
701 after(end, sender->td_end - receiver->td_maxwin - 1) ? 722 after(end, sender->td_end - receiver->td_maxwin - 1) ?
702 before(sack, receiver->td_end + 1) ? 723 before(sack, receiver->td_end + 1) ?
703 after(ack, receiver->td_end - MAXACKWINDOW(sender)) ? "BUG" 724 after(sack, receiver->td_end - MAXACKWINDOW(sender) - 1) ? "BUG"
704 : "ACK is under the lower bound (possible overly delayed ACK)" 725 : "ACK is under the lower bound (possible overly delayed ACK)"
705 : "ACK is over the upper bound (ACKed data not seen yet)" 726 : "ACK is over the upper bound (ACKed data not seen yet)"
706 : "SEQ is under the lower bound (already ACKed data retransmitted)" 727 : "SEQ is under the lower bound (already ACKed data retransmitted)"
@@ -715,39 +736,6 @@ static bool tcp_in_window(const struct nf_conn *ct,
715 return res; 736 return res;
716} 737}
717 738
718#ifdef CONFIG_NF_NAT_NEEDED
719/* Update sender->td_end after NAT successfully mangled the packet */
720/* Caller must linearize skb at tcp header. */
721void nf_conntrack_tcp_update(const struct sk_buff *skb,
722 unsigned int dataoff,
723 struct nf_conn *ct, int dir,
724 s16 offset)
725{
726 const struct tcphdr *tcph = (const void *)skb->data + dataoff;
727 const struct ip_ct_tcp_state *sender = &ct->proto.tcp.seen[dir];
728 const struct ip_ct_tcp_state *receiver = &ct->proto.tcp.seen[!dir];
729 __u32 end;
730
731 end = segment_seq_plus_len(ntohl(tcph->seq), skb->len, dataoff, tcph);
732
733 spin_lock_bh(&ct->lock);
734 /*
735 * We have to worry for the ack in the reply packet only...
736 */
737 if (ct->proto.tcp.seen[dir].td_end + offset == end)
738 ct->proto.tcp.seen[dir].td_end = end;
739 ct->proto.tcp.last_end = end;
740 spin_unlock_bh(&ct->lock);
741 pr_debug("tcp_update: sender end=%u maxend=%u maxwin=%u scale=%i "
742 "receiver end=%u maxend=%u maxwin=%u scale=%i\n",
743 sender->td_end, sender->td_maxend, sender->td_maxwin,
744 sender->td_scale,
745 receiver->td_end, receiver->td_maxend, receiver->td_maxwin,
746 receiver->td_scale);
747}
748EXPORT_SYMBOL_GPL(nf_conntrack_tcp_update);
749#endif
750
751#define TH_FIN 0x01 739#define TH_FIN 0x01
752#define TH_SYN 0x02 740#define TH_SYN 0x02
753#define TH_RST 0x04 741#define TH_RST 0x04
diff --git a/net/netfilter/nf_log.c b/net/netfilter/nf_log.c
index c93494fef8ef..d65d3481919c 100644
--- a/net/netfilter/nf_log.c
+++ b/net/netfilter/nf_log.c
@@ -128,9 +128,8 @@ EXPORT_SYMBOL(nf_log_packet);
128 128
129#ifdef CONFIG_PROC_FS 129#ifdef CONFIG_PROC_FS
130static void *seq_start(struct seq_file *seq, loff_t *pos) 130static void *seq_start(struct seq_file *seq, loff_t *pos)
131 __acquires(RCU)
132{ 131{
133 rcu_read_lock(); 132 mutex_lock(&nf_log_mutex);
134 133
135 if (*pos >= ARRAY_SIZE(nf_loggers)) 134 if (*pos >= ARRAY_SIZE(nf_loggers))
136 return NULL; 135 return NULL;
@@ -149,9 +148,8 @@ static void *seq_next(struct seq_file *s, void *v, loff_t *pos)
149} 148}
150 149
151static void seq_stop(struct seq_file *s, void *v) 150static void seq_stop(struct seq_file *s, void *v)
152 __releases(RCU)
153{ 151{
154 rcu_read_unlock(); 152 mutex_unlock(&nf_log_mutex);
155} 153}
156 154
157static int seq_show(struct seq_file *s, void *v) 155static int seq_show(struct seq_file *s, void *v)
@@ -161,7 +159,7 @@ static int seq_show(struct seq_file *s, void *v)
161 struct nf_logger *t; 159 struct nf_logger *t;
162 int ret; 160 int ret;
163 161
164 logger = rcu_dereference(nf_loggers[*pos]); 162 logger = nf_loggers[*pos];
165 163
166 if (!logger) 164 if (!logger)
167 ret = seq_printf(s, "%2lld NONE (", *pos); 165 ret = seq_printf(s, "%2lld NONE (", *pos);
@@ -171,22 +169,16 @@ static int seq_show(struct seq_file *s, void *v)
171 if (ret < 0) 169 if (ret < 0)
172 return ret; 170 return ret;
173 171
174 mutex_lock(&nf_log_mutex);
175 list_for_each_entry(t, &nf_loggers_l[*pos], list[*pos]) { 172 list_for_each_entry(t, &nf_loggers_l[*pos], list[*pos]) {
176 ret = seq_printf(s, "%s", t->name); 173 ret = seq_printf(s, "%s", t->name);
177 if (ret < 0) { 174 if (ret < 0)
178 mutex_unlock(&nf_log_mutex);
179 return ret; 175 return ret;
180 }
181 if (&t->list[*pos] != nf_loggers_l[*pos].prev) { 176 if (&t->list[*pos] != nf_loggers_l[*pos].prev) {
182 ret = seq_printf(s, ","); 177 ret = seq_printf(s, ",");
183 if (ret < 0) { 178 if (ret < 0)
184 mutex_unlock(&nf_log_mutex);
185 return ret; 179 return ret;
186 }
187 } 180 }
188 } 181 }
189 mutex_unlock(&nf_log_mutex);
190 182
191 return seq_printf(s, ")\n"); 183 return seq_printf(s, ")\n");
192} 184}
diff --git a/net/netfilter/xt_connlimit.c b/net/netfilter/xt_connlimit.c
index 680980954395..38f03f75a636 100644
--- a/net/netfilter/xt_connlimit.c
+++ b/net/netfilter/xt_connlimit.c
@@ -103,7 +103,7 @@ static int count_them(struct xt_connlimit_data *data,
103 const struct nf_conntrack_tuple *tuple, 103 const struct nf_conntrack_tuple *tuple,
104 const union nf_inet_addr *addr, 104 const union nf_inet_addr *addr,
105 const union nf_inet_addr *mask, 105 const union nf_inet_addr *mask,
106 const struct xt_match *match) 106 u_int8_t family)
107{ 107{
108 const struct nf_conntrack_tuple_hash *found; 108 const struct nf_conntrack_tuple_hash *found;
109 struct xt_connlimit_conn *conn; 109 struct xt_connlimit_conn *conn;
@@ -113,8 +113,7 @@ static int count_them(struct xt_connlimit_data *data,
113 bool addit = true; 113 bool addit = true;
114 int matches = 0; 114 int matches = 0;
115 115
116 116 if (family == NFPROTO_IPV6)
117 if (match->family == NFPROTO_IPV6)
118 hash = &data->iphash[connlimit_iphash6(addr, mask)]; 117 hash = &data->iphash[connlimit_iphash6(addr, mask)];
119 else 118 else
120 hash = &data->iphash[connlimit_iphash(addr->ip & mask->ip)]; 119 hash = &data->iphash[connlimit_iphash(addr->ip & mask->ip)];
@@ -157,8 +156,7 @@ static int count_them(struct xt_connlimit_data *data,
157 continue; 156 continue;
158 } 157 }
159 158
160 if (same_source_net(addr, mask, &conn->tuple.src.u3, 159 if (same_source_net(addr, mask, &conn->tuple.src.u3, family))
161 match->family))
162 /* same source network -> be counted! */ 160 /* same source network -> be counted! */
163 ++matches; 161 ++matches;
164 nf_ct_put(found_ct); 162 nf_ct_put(found_ct);
@@ -207,7 +205,7 @@ connlimit_mt(const struct sk_buff *skb, const struct xt_match_param *par)
207 205
208 spin_lock_bh(&info->data->lock); 206 spin_lock_bh(&info->data->lock);
209 connections = count_them(info->data, tuple_ptr, &addr, 207 connections = count_them(info->data, tuple_ptr, &addr,
210 &info->mask, par->match); 208 &info->mask, par->family);
211 spin_unlock_bh(&info->data->lock); 209 spin_unlock_bh(&info->data->lock);
212 210
213 if (connections < 0) { 211 if (connections < 0) {
diff --git a/net/netfilter/xt_limit.c b/net/netfilter/xt_limit.c
index 2e8089ecd0af..2773be6a71dd 100644
--- a/net/netfilter/xt_limit.c
+++ b/net/netfilter/xt_limit.c
@@ -112,7 +112,7 @@ static bool limit_mt_check(const struct xt_mtchk_param *par)
112 112
113 priv = kmalloc(sizeof(*priv), GFP_KERNEL); 113 priv = kmalloc(sizeof(*priv), GFP_KERNEL);
114 if (priv == NULL) 114 if (priv == NULL)
115 return -ENOMEM; 115 return false;
116 116
117 /* For SMP, we only want to use one set of state. */ 117 /* For SMP, we only want to use one set of state. */
118 r->master = priv; 118 r->master = priv;
diff --git a/net/netfilter/xt_osf.c b/net/netfilter/xt_osf.c
index 63e190504656..4d1a41bbd5d7 100644
--- a/net/netfilter/xt_osf.c
+++ b/net/netfilter/xt_osf.c
@@ -118,7 +118,7 @@ static int xt_osf_remove_callback(struct sock *ctnl, struct sk_buff *skb,
118{ 118{
119 struct xt_osf_user_finger *f; 119 struct xt_osf_user_finger *f;
120 struct xt_osf_finger *sf; 120 struct xt_osf_finger *sf;
121 int err = ENOENT; 121 int err = -ENOENT;
122 122
123 if (!osf_attrs[OSF_ATTR_FINGER]) 123 if (!osf_attrs[OSF_ATTR_FINGER])
124 return -EINVAL; 124 return -EINVAL;
diff --git a/net/rfkill/core.c b/net/rfkill/core.c
index ba2efb960c60..a001f7c1f711 100644
--- a/net/rfkill/core.c
+++ b/net/rfkill/core.c
@@ -1189,6 +1189,7 @@ static long rfkill_fop_ioctl(struct file *file, unsigned int cmd,
1189#endif 1189#endif
1190 1190
1191static const struct file_operations rfkill_fops = { 1191static const struct file_operations rfkill_fops = {
1192 .owner = THIS_MODULE,
1192 .open = rfkill_fop_open, 1193 .open = rfkill_fop_open,
1193 .read = rfkill_fop_read, 1194 .read = rfkill_fop_read,
1194 .write = rfkill_fop_write, 1195 .write = rfkill_fop_write,
diff --git a/net/rose/rose_route.c b/net/rose/rose_route.c
index 9478d9b3d977..f3e21989b88c 100644
--- a/net/rose/rose_route.c
+++ b/net/rose/rose_route.c
@@ -578,18 +578,18 @@ static int rose_clear_routes(void)
578 578
579/* 579/*
580 * Check that the device given is a valid AX.25 interface that is "up". 580 * Check that the device given is a valid AX.25 interface that is "up".
581 * called whith RTNL
581 */ 582 */
582static struct net_device *rose_ax25_dev_get(char *devname) 583static struct net_device *rose_ax25_dev_find(char *devname)
583{ 584{
584 struct net_device *dev; 585 struct net_device *dev;
585 586
586 if ((dev = dev_get_by_name(&init_net, devname)) == NULL) 587 if ((dev = __dev_get_by_name(&init_net, devname)) == NULL)
587 return NULL; 588 return NULL;
588 589
589 if ((dev->flags & IFF_UP) && dev->type == ARPHRD_AX25) 590 if ((dev->flags & IFF_UP) && dev->type == ARPHRD_AX25)
590 return dev; 591 return dev;
591 592
592 dev_put(dev);
593 return NULL; 593 return NULL;
594} 594}
595 595
@@ -720,27 +720,23 @@ int rose_rt_ioctl(unsigned int cmd, void __user *arg)
720 case SIOCADDRT: 720 case SIOCADDRT:
721 if (copy_from_user(&rose_route, arg, sizeof(struct rose_route_struct))) 721 if (copy_from_user(&rose_route, arg, sizeof(struct rose_route_struct)))
722 return -EFAULT; 722 return -EFAULT;
723 if ((dev = rose_ax25_dev_get(rose_route.device)) == NULL) 723 if ((dev = rose_ax25_dev_find(rose_route.device)) == NULL)
724 return -EINVAL; 724 return -EINVAL;
725 if (rose_dev_exists(&rose_route.address)) { /* Can't add routes to ourself */ 725 if (rose_dev_exists(&rose_route.address)) /* Can't add routes to ourself */
726 dev_put(dev);
727 return -EINVAL; 726 return -EINVAL;
728 }
729 if (rose_route.mask > 10) /* Mask can't be more than 10 digits */ 727 if (rose_route.mask > 10) /* Mask can't be more than 10 digits */
730 return -EINVAL; 728 return -EINVAL;
731 if (rose_route.ndigis > AX25_MAX_DIGIS) 729 if (rose_route.ndigis > AX25_MAX_DIGIS)
732 return -EINVAL; 730 return -EINVAL;
733 err = rose_add_node(&rose_route, dev); 731 err = rose_add_node(&rose_route, dev);
734 dev_put(dev);
735 return err; 732 return err;
736 733
737 case SIOCDELRT: 734 case SIOCDELRT:
738 if (copy_from_user(&rose_route, arg, sizeof(struct rose_route_struct))) 735 if (copy_from_user(&rose_route, arg, sizeof(struct rose_route_struct)))
739 return -EFAULT; 736 return -EFAULT;
740 if ((dev = rose_ax25_dev_get(rose_route.device)) == NULL) 737 if ((dev = rose_ax25_dev_find(rose_route.device)) == NULL)
741 return -EINVAL; 738 return -EINVAL;
742 err = rose_del_node(&rose_route, dev); 739 err = rose_del_node(&rose_route, dev);
743 dev_put(dev);
744 return err; 740 return err;
745 741
746 case SIOCRSCLRRT: 742 case SIOCRSCLRRT:
diff --git a/net/sctp/associola.c b/net/sctp/associola.c
index 8450960df24f..7eed77a39d0d 100644
--- a/net/sctp/associola.c
+++ b/net/sctp/associola.c
@@ -1485,15 +1485,13 @@ void sctp_assoc_rwnd_decrease(struct sctp_association *asoc, unsigned len)
1485 * local endpoint and the remote peer. 1485 * local endpoint and the remote peer.
1486 */ 1486 */
1487int sctp_assoc_set_bind_addr_from_ep(struct sctp_association *asoc, 1487int sctp_assoc_set_bind_addr_from_ep(struct sctp_association *asoc,
1488 gfp_t gfp) 1488 sctp_scope_t scope, gfp_t gfp)
1489{ 1489{
1490 sctp_scope_t scope;
1491 int flags; 1490 int flags;
1492 1491
1493 /* Use scoping rules to determine the subset of addresses from 1492 /* Use scoping rules to determine the subset of addresses from
1494 * the endpoint. 1493 * the endpoint.
1495 */ 1494 */
1496 scope = sctp_scope(&asoc->peer.active_path->ipaddr);
1497 flags = (PF_INET6 == asoc->base.sk->sk_family) ? SCTP_ADDR6_ALLOWED : 0; 1495 flags = (PF_INET6 == asoc->base.sk->sk_family) ? SCTP_ADDR6_ALLOWED : 0;
1498 if (asoc->peer.ipv4_address) 1496 if (asoc->peer.ipv4_address)
1499 flags |= SCTP_ADDR4_PEERSUPP; 1497 flags |= SCTP_ADDR4_PEERSUPP;
diff --git a/net/sctp/outqueue.c b/net/sctp/outqueue.c
index c9f20e28521b..23e5e97aa617 100644
--- a/net/sctp/outqueue.c
+++ b/net/sctp/outqueue.c
@@ -423,16 +423,6 @@ void sctp_retransmit_mark(struct sctp_outq *q,
423 if ((reason == SCTP_RTXR_FAST_RTX && 423 if ((reason == SCTP_RTXR_FAST_RTX &&
424 (chunk->fast_retransmit == SCTP_NEED_FRTX)) || 424 (chunk->fast_retransmit == SCTP_NEED_FRTX)) ||
425 (reason != SCTP_RTXR_FAST_RTX && !chunk->tsn_gap_acked)) { 425 (reason != SCTP_RTXR_FAST_RTX && !chunk->tsn_gap_acked)) {
426 /* If this chunk was sent less then 1 rto ago, do not
427 * retransmit this chunk, but give the peer time
428 * to acknowlege it. Do this only when
429 * retransmitting due to T3 timeout.
430 */
431 if (reason == SCTP_RTXR_T3_RTX &&
432 time_before(jiffies, chunk->sent_at +
433 transport->last_rto))
434 continue;
435
436 /* RFC 2960 6.2.1 Processing a Received SACK 426 /* RFC 2960 6.2.1 Processing a Received SACK
437 * 427 *
438 * C) Any time a DATA chunk is marked for 428 * C) Any time a DATA chunk is marked for
diff --git a/net/sctp/sm_sideeffect.c b/net/sctp/sm_sideeffect.c
index 8674d4919556..efa516b47e81 100644
--- a/net/sctp/sm_sideeffect.c
+++ b/net/sctp/sm_sideeffect.c
@@ -480,7 +480,6 @@ static void sctp_do_8_2_transport_strike(struct sctp_association *asoc,
480 * that indicates that we have an outstanding HB. 480 * that indicates that we have an outstanding HB.
481 */ 481 */
482 if (!is_hb || transport->hb_sent) { 482 if (!is_hb || transport->hb_sent) {
483 transport->last_rto = transport->rto;
484 transport->rto = min((transport->rto * 2), transport->asoc->rto_max); 483 transport->rto = min((transport->rto * 2), transport->asoc->rto_max);
485 } 484 }
486} 485}
diff --git a/net/sctp/sm_statefuns.c b/net/sctp/sm_statefuns.c
index c8fae1983dd1..d4df45022ffa 100644
--- a/net/sctp/sm_statefuns.c
+++ b/net/sctp/sm_statefuns.c
@@ -384,6 +384,11 @@ sctp_disposition_t sctp_sf_do_5_1B_init(const struct sctp_endpoint *ep,
384 if (!new_asoc) 384 if (!new_asoc)
385 goto nomem; 385 goto nomem;
386 386
387 if (sctp_assoc_set_bind_addr_from_ep(new_asoc,
388 sctp_scope(sctp_source(chunk)),
389 GFP_ATOMIC) < 0)
390 goto nomem_init;
391
387 /* The call, sctp_process_init(), can fail on memory allocation. */ 392 /* The call, sctp_process_init(), can fail on memory allocation. */
388 if (!sctp_process_init(new_asoc, chunk->chunk_hdr->type, 393 if (!sctp_process_init(new_asoc, chunk->chunk_hdr->type,
389 sctp_source(chunk), 394 sctp_source(chunk),
@@ -401,9 +406,6 @@ sctp_disposition_t sctp_sf_do_5_1B_init(const struct sctp_endpoint *ep,
401 len = ntohs(err_chunk->chunk_hdr->length) - 406 len = ntohs(err_chunk->chunk_hdr->length) -
402 sizeof(sctp_chunkhdr_t); 407 sizeof(sctp_chunkhdr_t);
403 408
404 if (sctp_assoc_set_bind_addr_from_ep(new_asoc, GFP_ATOMIC) < 0)
405 goto nomem_init;
406
407 repl = sctp_make_init_ack(new_asoc, chunk, GFP_ATOMIC, len); 409 repl = sctp_make_init_ack(new_asoc, chunk, GFP_ATOMIC, len);
408 if (!repl) 410 if (!repl)
409 goto nomem_init; 411 goto nomem_init;
@@ -1452,6 +1454,10 @@ static sctp_disposition_t sctp_sf_do_unexpected_init(
1452 if (!new_asoc) 1454 if (!new_asoc)
1453 goto nomem; 1455 goto nomem;
1454 1456
1457 if (sctp_assoc_set_bind_addr_from_ep(new_asoc,
1458 sctp_scope(sctp_source(chunk)), GFP_ATOMIC) < 0)
1459 goto nomem;
1460
1455 /* In the outbound INIT ACK the endpoint MUST copy its current 1461 /* In the outbound INIT ACK the endpoint MUST copy its current
1456 * Verification Tag and Peers Verification tag into a reserved 1462 * Verification Tag and Peers Verification tag into a reserved
1457 * place (local tie-tag and per tie-tag) within the state cookie. 1463 * place (local tie-tag and per tie-tag) within the state cookie.
@@ -1488,9 +1494,6 @@ static sctp_disposition_t sctp_sf_do_unexpected_init(
1488 sizeof(sctp_chunkhdr_t); 1494 sizeof(sctp_chunkhdr_t);
1489 } 1495 }
1490 1496
1491 if (sctp_assoc_set_bind_addr_from_ep(new_asoc, GFP_ATOMIC) < 0)
1492 goto nomem;
1493
1494 repl = sctp_make_init_ack(new_asoc, chunk, GFP_ATOMIC, len); 1497 repl = sctp_make_init_ack(new_asoc, chunk, GFP_ATOMIC, len);
1495 if (!repl) 1498 if (!repl)
1496 goto nomem; 1499 goto nomem;
diff --git a/net/sctp/socket.c b/net/sctp/socket.c
index c8d05758661d..3a95fcb17a9e 100644
--- a/net/sctp/socket.c
+++ b/net/sctp/socket.c
@@ -1080,6 +1080,13 @@ static int __sctp_connect(struct sock* sk,
1080 err = -ENOMEM; 1080 err = -ENOMEM;
1081 goto out_free; 1081 goto out_free;
1082 } 1082 }
1083
1084 err = sctp_assoc_set_bind_addr_from_ep(asoc, scope,
1085 GFP_KERNEL);
1086 if (err < 0) {
1087 goto out_free;
1088 }
1089
1083 } 1090 }
1084 1091
1085 /* Prime the peer's transport structures. */ 1092 /* Prime the peer's transport structures. */
@@ -1095,11 +1102,6 @@ static int __sctp_connect(struct sock* sk,
1095 walk_size += af->sockaddr_len; 1102 walk_size += af->sockaddr_len;
1096 } 1103 }
1097 1104
1098 err = sctp_assoc_set_bind_addr_from_ep(asoc, GFP_KERNEL);
1099 if (err < 0) {
1100 goto out_free;
1101 }
1102
1103 /* In case the user of sctp_connectx() wants an association 1105 /* In case the user of sctp_connectx() wants an association
1104 * id back, assign one now. 1106 * id back, assign one now.
1105 */ 1107 */
@@ -1274,22 +1276,30 @@ SCTP_STATIC int sctp_setsockopt_connectx(struct sock* sk,
1274} 1276}
1275 1277
1276/* 1278/*
1277 * New (hopefully final) interface for the API. The option buffer is used 1279 * New (hopefully final) interface for the API.
1278 * both for the returned association id and the addresses. 1280 * We use the sctp_getaddrs_old structure so that use-space library
1281 * can avoid any unnecessary allocations. The only defferent part
1282 * is that we store the actual length of the address buffer into the
1283 * addrs_num structure member. That way we can re-use the existing
1284 * code.
1279 */ 1285 */
1280SCTP_STATIC int sctp_getsockopt_connectx3(struct sock* sk, int len, 1286SCTP_STATIC int sctp_getsockopt_connectx3(struct sock* sk, int len,
1281 char __user *optval, 1287 char __user *optval,
1282 int __user *optlen) 1288 int __user *optlen)
1283{ 1289{
1290 struct sctp_getaddrs_old param;
1284 sctp_assoc_t assoc_id = 0; 1291 sctp_assoc_t assoc_id = 0;
1285 int err = 0; 1292 int err = 0;
1286 1293
1287 if (len < sizeof(assoc_id)) 1294 if (len < sizeof(param))
1288 return -EINVAL; 1295 return -EINVAL;
1289 1296
1297 if (copy_from_user(&param, optval, sizeof(param)))
1298 return -EFAULT;
1299
1290 err = __sctp_setsockopt_connectx(sk, 1300 err = __sctp_setsockopt_connectx(sk,
1291 (struct sockaddr __user *)(optval + sizeof(assoc_id)), 1301 (struct sockaddr __user *)param.addrs,
1292 len - sizeof(assoc_id), &assoc_id); 1302 param.addr_num, &assoc_id);
1293 1303
1294 if (err == 0 || err == -EINPROGRESS) { 1304 if (err == 0 || err == -EINPROGRESS) {
1295 if (copy_to_user(optval, &assoc_id, sizeof(assoc_id))) 1305 if (copy_to_user(optval, &assoc_id, sizeof(assoc_id)))
@@ -1689,6 +1699,11 @@ SCTP_STATIC int sctp_sendmsg(struct kiocb *iocb, struct sock *sk,
1689 goto out_unlock; 1699 goto out_unlock;
1690 } 1700 }
1691 asoc = new_asoc; 1701 asoc = new_asoc;
1702 err = sctp_assoc_set_bind_addr_from_ep(asoc, scope, GFP_KERNEL);
1703 if (err < 0) {
1704 err = -ENOMEM;
1705 goto out_free;
1706 }
1692 1707
1693 /* If the SCTP_INIT ancillary data is specified, set all 1708 /* If the SCTP_INIT ancillary data is specified, set all
1694 * the association init values accordingly. 1709 * the association init values accordingly.
@@ -1718,11 +1733,6 @@ SCTP_STATIC int sctp_sendmsg(struct kiocb *iocb, struct sock *sk,
1718 err = -ENOMEM; 1733 err = -ENOMEM;
1719 goto out_free; 1734 goto out_free;
1720 } 1735 }
1721 err = sctp_assoc_set_bind_addr_from_ep(asoc, GFP_KERNEL);
1722 if (err < 0) {
1723 err = -ENOMEM;
1724 goto out_free;
1725 }
1726 } 1736 }
1727 1737
1728 /* ASSERT: we have a valid association at this point. */ 1738 /* ASSERT: we have a valid association at this point. */
diff --git a/net/sctp/transport.c b/net/sctp/transport.c
index c256e4839316..37a1184d789f 100644
--- a/net/sctp/transport.c
+++ b/net/sctp/transport.c
@@ -74,7 +74,7 @@ static struct sctp_transport *sctp_transport_init(struct sctp_transport *peer,
74 * given destination transport address, set RTO to the protocol 74 * given destination transport address, set RTO to the protocol
75 * parameter 'RTO.Initial'. 75 * parameter 'RTO.Initial'.
76 */ 76 */
77 peer->last_rto = peer->rto = msecs_to_jiffies(sctp_rto_initial); 77 peer->rto = msecs_to_jiffies(sctp_rto_initial);
78 peer->rtt = 0; 78 peer->rtt = 0;
79 peer->rttvar = 0; 79 peer->rttvar = 0;
80 peer->srtt = 0; 80 peer->srtt = 0;
@@ -308,7 +308,8 @@ void sctp_transport_route(struct sctp_transport *transport,
308 /* Initialize sk->sk_rcv_saddr, if the transport is the 308 /* Initialize sk->sk_rcv_saddr, if the transport is the
309 * association's active path for getsockname(). 309 * association's active path for getsockname().
310 */ 310 */
311 if (asoc && (transport == asoc->peer.active_path)) 311 if (asoc && (!asoc->peer.primary_path ||
312 (transport == asoc->peer.active_path)))
312 opt->pf->af->to_sk_saddr(&transport->saddr, 313 opt->pf->af->to_sk_saddr(&transport->saddr,
313 asoc->base.sk); 314 asoc->base.sk);
314 } else 315 } else
@@ -385,7 +386,6 @@ void sctp_transport_update_rto(struct sctp_transport *tp, __u32 rtt)
385 tp->rto = tp->asoc->rto_max; 386 tp->rto = tp->asoc->rto_max;
386 387
387 tp->rtt = rtt; 388 tp->rtt = rtt;
388 tp->last_rto = tp->rto;
389 389
390 /* Reset rto_pending so that a new RTT measurement is started when a 390 /* Reset rto_pending so that a new RTT measurement is started when a
391 * new data chunk is sent. 391 * new data chunk is sent.
@@ -601,7 +601,7 @@ void sctp_transport_reset(struct sctp_transport *t)
601 */ 601 */
602 t->cwnd = min(4*asoc->pathmtu, max_t(__u32, 2*asoc->pathmtu, 4380)); 602 t->cwnd = min(4*asoc->pathmtu, max_t(__u32, 2*asoc->pathmtu, 4380));
603 t->ssthresh = asoc->peer.i.a_rwnd; 603 t->ssthresh = asoc->peer.i.a_rwnd;
604 t->last_rto = t->rto = asoc->rto_initial; 604 t->rto = asoc->rto_initial;
605 t->rtt = 0; 605 t->rtt = 0;
606 t->srtt = 0; 606 t->srtt = 0;
607 t->rttvar = 0; 607 t->rttvar = 0;
diff --git a/net/sunrpc/addr.c b/net/sunrpc/addr.c
index 22e8fd89477f..c7450c8f0a7c 100644
--- a/net/sunrpc/addr.c
+++ b/net/sunrpc/addr.c
@@ -306,24 +306,25 @@ EXPORT_SYMBOL_GPL(rpc_sockaddr2uaddr);
306 * @sap: buffer into which to plant socket address 306 * @sap: buffer into which to plant socket address
307 * @salen: size of buffer 307 * @salen: size of buffer
308 * 308 *
309 * @uaddr does not have to be '\0'-terminated, but strict_strtoul() and
310 * rpc_pton() require proper string termination to be successful.
311 *
309 * Returns the size of the socket address if successful; otherwise 312 * Returns the size of the socket address if successful; otherwise
310 * zero is returned. 313 * zero is returned.
311 */ 314 */
312size_t rpc_uaddr2sockaddr(const char *uaddr, const size_t uaddr_len, 315size_t rpc_uaddr2sockaddr(const char *uaddr, const size_t uaddr_len,
313 struct sockaddr *sap, const size_t salen) 316 struct sockaddr *sap, const size_t salen)
314{ 317{
315 char *c, buf[RPCBIND_MAXUADDRLEN]; 318 char *c, buf[RPCBIND_MAXUADDRLEN + sizeof('\0')];
316 unsigned long portlo, porthi; 319 unsigned long portlo, porthi;
317 unsigned short port; 320 unsigned short port;
318 321
319 if (uaddr_len > sizeof(buf)) 322 if (uaddr_len > RPCBIND_MAXUADDRLEN)
320 return 0; 323 return 0;
321 324
322 memcpy(buf, uaddr, uaddr_len); 325 memcpy(buf, uaddr, uaddr_len);
323 326
324 buf[uaddr_len] = '\n'; 327 buf[uaddr_len] = '\0';
325 buf[uaddr_len + 1] = '\0';
326
327 c = strrchr(buf, '.'); 328 c = strrchr(buf, '.');
328 if (unlikely(c == NULL)) 329 if (unlikely(c == NULL))
329 return 0; 330 return 0;
@@ -332,9 +333,7 @@ size_t rpc_uaddr2sockaddr(const char *uaddr, const size_t uaddr_len,
332 if (unlikely(portlo > 255)) 333 if (unlikely(portlo > 255))
333 return 0; 334 return 0;
334 335
335 c[0] = '\n'; 336 *c = '\0';
336 c[1] = '\0';
337
338 c = strrchr(buf, '.'); 337 c = strrchr(buf, '.');
339 if (unlikely(c == NULL)) 338 if (unlikely(c == NULL))
340 return 0; 339 return 0;
@@ -345,8 +344,7 @@ size_t rpc_uaddr2sockaddr(const char *uaddr, const size_t uaddr_len,
345 344
346 port = (unsigned short)((porthi << 8) | portlo); 345 port = (unsigned short)((porthi << 8) | portlo);
347 346
348 c[0] = '\0'; 347 *c = '\0';
349
350 if (rpc_pton(buf, strlen(buf), sap, salen) == 0) 348 if (rpc_pton(buf, strlen(buf), sap, salen) == 0)
351 return 0; 349 return 0;
352 350
diff --git a/net/sunrpc/svcsock.c b/net/sunrpc/svcsock.c
index ccc5e83cae5d..1c246a4f491e 100644
--- a/net/sunrpc/svcsock.c
+++ b/net/sunrpc/svcsock.c
@@ -111,7 +111,7 @@ static void svc_release_skb(struct svc_rqst *rqstp)
111 rqstp->rq_xprt_ctxt = NULL; 111 rqstp->rq_xprt_ctxt = NULL;
112 112
113 dprintk("svc: service %p, releasing skb %p\n", rqstp, skb); 113 dprintk("svc: service %p, releasing skb %p\n", rqstp, skb);
114 skb_free_datagram(svsk->sk_sk, skb); 114 skb_free_datagram_locked(svsk->sk_sk, skb);
115 } 115 }
116} 116}
117 117
@@ -578,7 +578,7 @@ static int svc_udp_recvfrom(struct svc_rqst *rqstp)
578 "svc: received unknown control message %d/%d; " 578 "svc: received unknown control message %d/%d; "
579 "dropping RPC reply datagram\n", 579 "dropping RPC reply datagram\n",
580 cmh->cmsg_level, cmh->cmsg_type); 580 cmh->cmsg_level, cmh->cmsg_type);
581 skb_free_datagram(svsk->sk_sk, skb); 581 skb_free_datagram_locked(svsk->sk_sk, skb);
582 return 0; 582 return 0;
583 } 583 }
584 584
@@ -588,18 +588,18 @@ static int svc_udp_recvfrom(struct svc_rqst *rqstp)
588 if (csum_partial_copy_to_xdr(&rqstp->rq_arg, skb)) { 588 if (csum_partial_copy_to_xdr(&rqstp->rq_arg, skb)) {
589 local_bh_enable(); 589 local_bh_enable();
590 /* checksum error */ 590 /* checksum error */
591 skb_free_datagram(svsk->sk_sk, skb); 591 skb_free_datagram_locked(svsk->sk_sk, skb);
592 return 0; 592 return 0;
593 } 593 }
594 local_bh_enable(); 594 local_bh_enable();
595 skb_free_datagram(svsk->sk_sk, skb); 595 skb_free_datagram_locked(svsk->sk_sk, skb);
596 } else { 596 } else {
597 /* we can use it in-place */ 597 /* we can use it in-place */
598 rqstp->rq_arg.head[0].iov_base = skb->data + 598 rqstp->rq_arg.head[0].iov_base = skb->data +
599 sizeof(struct udphdr); 599 sizeof(struct udphdr);
600 rqstp->rq_arg.head[0].iov_len = len; 600 rqstp->rq_arg.head[0].iov_len = len;
601 if (skb_checksum_complete(skb)) { 601 if (skb_checksum_complete(skb)) {
602 skb_free_datagram(svsk->sk_sk, skb); 602 skb_free_datagram_locked(svsk->sk_sk, skb);
603 return 0; 603 return 0;
604 } 604 }
605 rqstp->rq_xprt_ctxt = skb; 605 rqstp->rq_xprt_ctxt = skb;
diff --git a/net/wireless/sme.c b/net/wireless/sme.c
index ece378d531ef..9f0b2800a9d7 100644
--- a/net/wireless/sme.c
+++ b/net/wireless/sme.c
@@ -165,7 +165,7 @@ void cfg80211_conn_work(struct work_struct *work)
165 struct cfg80211_registered_device *rdev = 165 struct cfg80211_registered_device *rdev =
166 container_of(work, struct cfg80211_registered_device, conn_work); 166 container_of(work, struct cfg80211_registered_device, conn_work);
167 struct wireless_dev *wdev; 167 struct wireless_dev *wdev;
168 u8 bssid[ETH_ALEN]; 168 u8 bssid_buf[ETH_ALEN], *bssid = NULL;
169 169
170 rtnl_lock(); 170 rtnl_lock();
171 cfg80211_lock_rdev(rdev); 171 cfg80211_lock_rdev(rdev);
@@ -181,7 +181,10 @@ void cfg80211_conn_work(struct work_struct *work)
181 wdev_unlock(wdev); 181 wdev_unlock(wdev);
182 continue; 182 continue;
183 } 183 }
184 memcpy(bssid, wdev->conn->params.bssid, ETH_ALEN); 184 if (wdev->conn->params.bssid) {
185 memcpy(bssid_buf, wdev->conn->params.bssid, ETH_ALEN);
186 bssid = bssid_buf;
187 }
185 if (cfg80211_conn_do_work(wdev)) 188 if (cfg80211_conn_do_work(wdev))
186 __cfg80211_connect_result( 189 __cfg80211_connect_result(
187 wdev->netdev, bssid, 190 wdev->netdev, bssid,
diff --git a/samples/Kconfig b/samples/Kconfig
index b92bde3c6a89..e4be84ac3d38 100644
--- a/samples/Kconfig
+++ b/samples/Kconfig
@@ -40,5 +40,11 @@ config SAMPLE_KRETPROBES
40 default m 40 default m
41 depends on SAMPLE_KPROBES && KRETPROBES 41 depends on SAMPLE_KPROBES && KRETPROBES
42 42
43config SAMPLE_HW_BREAKPOINT
44 tristate "Build kernel hardware breakpoint examples -- loadable module only"
45 depends on HAVE_HW_BREAKPOINT && m
46 help
47 This builds kernel hardware breakpoint example modules.
48
43endif # SAMPLES 49endif # SAMPLES
44 50
diff --git a/samples/Makefile b/samples/Makefile
index 43343a03b1f4..0f15e6d77fd6 100644
--- a/samples/Makefile
+++ b/samples/Makefile
@@ -1,3 +1,4 @@
1# Makefile for Linux samples code 1# Makefile for Linux samples code
2 2
3obj-$(CONFIG_SAMPLES) += kobject/ kprobes/ tracepoints/ trace_events/ 3obj-$(CONFIG_SAMPLES) += kobject/ kprobes/ tracepoints/ trace_events/ \
4 hw_breakpoint/
diff --git a/samples/hw_breakpoint/Makefile b/samples/hw_breakpoint/Makefile
new file mode 100644
index 000000000000..0f5c31c2fc47
--- /dev/null
+++ b/samples/hw_breakpoint/Makefile
@@ -0,0 +1 @@
obj-$(CONFIG_SAMPLE_HW_BREAKPOINT) += data_breakpoint.o
diff --git a/samples/hw_breakpoint/data_breakpoint.c b/samples/hw_breakpoint/data_breakpoint.c
new file mode 100644
index 000000000000..29525500df00
--- /dev/null
+++ b/samples/hw_breakpoint/data_breakpoint.c
@@ -0,0 +1,87 @@
1/*
2 * data_breakpoint.c - Sample HW Breakpoint file to watch kernel data address
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 * usage: insmod data_breakpoint.ko ksym=<ksym_name>
19 *
20 * This file is a kernel module that places a breakpoint over ksym_name kernel
21 * variable using Hardware Breakpoint register. The corresponding handler which
22 * prints a backtrace is invoked everytime a write operation is performed on
23 * that variable.
24 *
25 * Copyright (C) IBM Corporation, 2009
26 *
27 * Author: K.Prasad <prasad@linux.vnet.ibm.com>
28 */
29#include <linux/module.h> /* Needed by all modules */
30#include <linux/kernel.h> /* Needed for KERN_INFO */
31#include <linux/init.h> /* Needed for the macros */
32#include <linux/kallsyms.h>
33
34#include <linux/perf_event.h>
35#include <linux/hw_breakpoint.h>
36
37struct perf_event **sample_hbp;
38
39static char ksym_name[KSYM_NAME_LEN] = "pid_max";
40module_param_string(ksym, ksym_name, KSYM_NAME_LEN, S_IRUGO);
41MODULE_PARM_DESC(ksym, "Kernel symbol to monitor; this module will report any"
42 " write operations on the kernel symbol");
43
44static void sample_hbp_handler(struct perf_event *temp, void *data)
45{
46 printk(KERN_INFO "%s value is changed\n", ksym_name);
47 dump_stack();
48 printk(KERN_INFO "Dump stack from sample_hbp_handler\n");
49}
50
51static int __init hw_break_module_init(void)
52{
53 int ret;
54 DEFINE_BREAKPOINT_ATTR(attr);
55
56 attr.bp_addr = kallsyms_lookup_name(ksym_name);
57 attr.bp_len = HW_BREAKPOINT_LEN_4;
58 attr.bp_type = HW_BREAKPOINT_W | HW_BREAKPOINT_R;
59
60 sample_hbp = register_wide_hw_breakpoint(&attr, sample_hbp_handler);
61 if (IS_ERR(sample_hbp)) {
62 ret = PTR_ERR(sample_hbp);
63 goto fail;
64 }
65
66 printk(KERN_INFO "HW Breakpoint for %s write installed\n", ksym_name);
67
68 return 0;
69
70fail:
71 printk(KERN_INFO "Breakpoint registration failed\n");
72
73 return ret;
74}
75
76static void __exit hw_break_module_exit(void)
77{
78 unregister_wide_hw_breakpoint(sample_hbp);
79 printk(KERN_INFO "HW Breakpoint for %s write uninstalled\n", ksym_name);
80}
81
82module_init(hw_break_module_init);
83module_exit(hw_break_module_exit);
84
85MODULE_LICENSE("GPL");
86MODULE_AUTHOR("K.Prasad");
87MODULE_DESCRIPTION("ksym breakpoint");
diff --git a/scripts/dtc/data.c b/scripts/dtc/data.c
index dd2e3d39d4c1..fe555e819bf8 100644
--- a/scripts/dtc/data.c
+++ b/scripts/dtc/data.c
@@ -217,7 +217,7 @@ struct data data_insert_at_marker(struct data d, struct marker *m,
217 return d; 217 return d;
218} 218}
219 219
220struct data data_append_markers(struct data d, struct marker *m) 220static struct data data_append_markers(struct data d, struct marker *m)
221{ 221{
222 struct marker **mp = &d.markers; 222 struct marker **mp = &d.markers;
223 223
diff --git a/scripts/dtc/dtc-lexer.l b/scripts/dtc/dtc-lexer.l
index 44dbfd3f0976..a627bbee91d4 100644
--- a/scripts/dtc/dtc-lexer.l
+++ b/scripts/dtc/dtc-lexer.l
@@ -18,7 +18,7 @@
18 * USA 18 * USA
19 */ 19 */
20 20
21%option noyywrap nounput yylineno 21%option noyywrap noinput nounput yylineno
22 22
23%x INCLUDE 23%x INCLUDE
24%x BYTESTRING 24%x BYTESTRING
diff --git a/scripts/dtc/dtc-lexer.lex.c_shipped b/scripts/dtc/dtc-lexer.lex.c_shipped
index ac392cb040f6..e27cc636e326 100644
--- a/scripts/dtc/dtc-lexer.lex.c_shipped
+++ b/scripts/dtc/dtc-lexer.lex.c_shipped
@@ -9,7 +9,7 @@
9#define FLEX_SCANNER 9#define FLEX_SCANNER
10#define YY_FLEX_MAJOR_VERSION 2 10#define YY_FLEX_MAJOR_VERSION 2
11#define YY_FLEX_MINOR_VERSION 5 11#define YY_FLEX_MINOR_VERSION 5
12#define YY_FLEX_SUBMINOR_VERSION 34 12#define YY_FLEX_SUBMINOR_VERSION 35
13#if YY_FLEX_SUBMINOR_VERSION > 0 13#if YY_FLEX_SUBMINOR_VERSION > 0
14#define FLEX_BETA 14#define FLEX_BETA
15#endif 15#endif
@@ -54,7 +54,6 @@ typedef int flex_int32_t;
54typedef unsigned char flex_uint8_t; 54typedef unsigned char flex_uint8_t;
55typedef unsigned short int flex_uint16_t; 55typedef unsigned short int flex_uint16_t;
56typedef unsigned int flex_uint32_t; 56typedef unsigned int flex_uint32_t;
57#endif /* ! C99 */
58 57
59/* Limits of integral types. */ 58/* Limits of integral types. */
60#ifndef INT8_MIN 59#ifndef INT8_MIN
@@ -85,6 +84,8 @@ typedef unsigned int flex_uint32_t;
85#define UINT32_MAX (4294967295U) 84#define UINT32_MAX (4294967295U)
86#endif 85#endif
87 86
87#endif /* ! C99 */
88
88#endif /* ! FLEXINT_H */ 89#endif /* ! FLEXINT_H */
89 90
90#ifdef __cplusplus 91#ifdef __cplusplus
@@ -141,7 +142,15 @@ typedef unsigned int flex_uint32_t;
141 142
142/* Size of default input buffer. */ 143/* Size of default input buffer. */
143#ifndef YY_BUF_SIZE 144#ifndef YY_BUF_SIZE
145#ifdef __ia64__
146/* On IA-64, the buffer size is 16k, not 8k.
147 * Moreover, YY_BUF_SIZE is 2*YY_READ_BUF_SIZE in the general case.
148 * Ditto for the __ia64__ case accordingly.
149 */
150#define YY_BUF_SIZE 32768
151#else
144#define YY_BUF_SIZE 16384 152#define YY_BUF_SIZE 16384
153#endif /* __ia64__ */
145#endif 154#endif
146 155
147/* The state buf must be large enough to hold one state per character in the main buffer. 156/* The state buf must be large enough to hold one state per character in the main buffer.
@@ -192,13 +201,6 @@ extern FILE *yyin, *yyout;
192 201
193#define unput(c) yyunput( c, (yytext_ptr) ) 202#define unput(c) yyunput( c, (yytext_ptr) )
194 203
195/* The following is because we cannot portably get our hands on size_t
196 * (without autoconf's help, which isn't available because we want
197 * flex-generated scanners to compile on their own).
198 * Given that the standard has decreed that size_t exists since 1989,
199 * I guess we can afford to depend on it. Manoj.
200 */
201
202#ifndef YY_TYPEDEF_YY_SIZE_T 204#ifndef YY_TYPEDEF_YY_SIZE_T
203#define YY_TYPEDEF_YY_SIZE_T 205#define YY_TYPEDEF_YY_SIZE_T
204typedef size_t yy_size_t; 206typedef size_t yy_size_t;
@@ -604,6 +606,7 @@ char *yytext;
604 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 606 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
605 * USA 607 * USA
606 */ 608 */
609#define YY_NO_INPUT 1
607 610
608 611
609 612
@@ -634,7 +637,7 @@ static int dts_version; /* = 0 */
634 637
635static void push_input_file(const char *filename); 638static void push_input_file(const char *filename);
636static int pop_input_file(void); 639static int pop_input_file(void);
637#line 638 "dtc-lexer.lex.c" 640#line 641 "dtc-lexer.lex.c"
638 641
639#define INITIAL 0 642#define INITIAL 0
640#define INCLUDE 1 643#define INCLUDE 1
@@ -656,6 +659,35 @@ static int pop_input_file(void);
656 659
657static int yy_init_globals (void ); 660static int yy_init_globals (void );
658 661
662/* Accessor methods to globals.
663 These are made visible to non-reentrant scanners for convenience. */
664
665int yylex_destroy (void );
666
667int yyget_debug (void );
668
669void yyset_debug (int debug_flag );
670
671YY_EXTRA_TYPE yyget_extra (void );
672
673void yyset_extra (YY_EXTRA_TYPE user_defined );
674
675FILE *yyget_in (void );
676
677void yyset_in (FILE * in_str );
678
679FILE *yyget_out (void );
680
681void yyset_out (FILE * out_str );
682
683int yyget_leng (void );
684
685char *yyget_text (void );
686
687int yyget_lineno (void );
688
689void yyset_lineno (int line_number );
690
659/* Macros after this point can all be overridden by user definitions in 691/* Macros after this point can all be overridden by user definitions in
660 * section 1. 692 * section 1.
661 */ 693 */
@@ -688,7 +720,12 @@ static int input (void );
688 720
689/* Amount of stuff to slurp up with each read. */ 721/* Amount of stuff to slurp up with each read. */
690#ifndef YY_READ_BUF_SIZE 722#ifndef YY_READ_BUF_SIZE
723#ifdef __ia64__
724/* On IA-64, the buffer size is 16k, not 8k */
725#define YY_READ_BUF_SIZE 16384
726#else
691#define YY_READ_BUF_SIZE 8192 727#define YY_READ_BUF_SIZE 8192
728#endif /* __ia64__ */
692#endif 729#endif
693 730
694/* Copy whatever the last rule matched to the standard output. */ 731/* Copy whatever the last rule matched to the standard output. */
@@ -696,7 +733,7 @@ static int input (void );
696/* This used to be an fputs(), but since the string might contain NUL's, 733/* This used to be an fputs(), but since the string might contain NUL's,
697 * we now use fwrite(). 734 * we now use fwrite().
698 */ 735 */
699#define ECHO fwrite( yytext, yyleng, 1, yyout ) 736#define ECHO do { if (fwrite( yytext, yyleng, 1, yyout )) {} } while (0)
700#endif 737#endif
701 738
702/* Gets input and stuffs it into "buf". number of characters read, or YY_NULL, 739/* Gets input and stuffs it into "buf". number of characters read, or YY_NULL,
@@ -707,7 +744,7 @@ static int input (void );
707 if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \ 744 if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \
708 { \ 745 { \
709 int c = '*'; \ 746 int c = '*'; \
710 int n; \ 747 size_t n; \
711 for ( n = 0; n < max_size && \ 748 for ( n = 0; n < max_size && \
712 (c = getc( yyin )) != EOF && c != '\n'; ++n ) \ 749 (c = getc( yyin )) != EOF && c != '\n'; ++n ) \
713 buf[n] = (char) c; \ 750 buf[n] = (char) c; \
@@ -791,7 +828,7 @@ YY_DECL
791 828
792#line 64 "dtc-lexer.l" 829#line 64 "dtc-lexer.l"
793 830
794#line 795 "dtc-lexer.lex.c" 831#line 832 "dtc-lexer.lex.c"
795 832
796 if ( !(yy_init) ) 833 if ( !(yy_init) )
797 { 834 {
@@ -1116,7 +1153,7 @@ YY_RULE_SETUP
1116#line 222 "dtc-lexer.l" 1153#line 222 "dtc-lexer.l"
1117ECHO; 1154ECHO;
1118 YY_BREAK 1155 YY_BREAK
1119#line 1120 "dtc-lexer.lex.c" 1156#line 1157 "dtc-lexer.lex.c"
1120 1157
1121 case YY_END_OF_BUFFER: 1158 case YY_END_OF_BUFFER:
1122 { 1159 {
@@ -1840,8 +1877,8 @@ YY_BUFFER_STATE yy_scan_string (yyconst char * yystr )
1840 1877
1841/** Setup the input buffer state to scan the given bytes. The next call to yylex() will 1878/** Setup the input buffer state to scan the given bytes. The next call to yylex() will
1842 * scan from a @e copy of @a bytes. 1879 * scan from a @e copy of @a bytes.
1843 * @param bytes the byte buffer to scan 1880 * @param yybytes the byte buffer to scan
1844 * @param len the number of bytes in the buffer pointed to by @a bytes. 1881 * @param _yybytes_len the number of bytes in the buffer pointed to by @a bytes.
1845 * 1882 *
1846 * @return the newly allocated buffer state object. 1883 * @return the newly allocated buffer state object.
1847 */ 1884 */
diff --git a/scripts/dtc/libfdt/fdt_ro.c b/scripts/dtc/libfdt/fdt_ro.c
index fbbba44fcd0d..22e692919ff9 100644
--- a/scripts/dtc/libfdt/fdt_ro.c
+++ b/scripts/dtc/libfdt/fdt_ro.c
@@ -411,7 +411,7 @@ int fdt_node_offset_by_phandle(const void *fdt, uint32_t phandle)
411 &phandle, sizeof(phandle)); 411 &phandle, sizeof(phandle));
412} 412}
413 413
414int _stringlist_contains(const char *strlist, int listlen, const char *str) 414static int _stringlist_contains(const char *strlist, int listlen, const char *str)
415{ 415{
416 int len = strlen(str); 416 int len = strlen(str);
417 const char *p; 417 const char *p;
diff --git a/scripts/dtc/treesource.c b/scripts/dtc/treesource.c
index ebeb6eb27907..1521ff11bb97 100644
--- a/scripts/dtc/treesource.c
+++ b/scripts/dtc/treesource.c
@@ -52,7 +52,7 @@ static void write_prefix(FILE *f, int level)
52 fputc('\t', f); 52 fputc('\t', f);
53} 53}
54 54
55int isstring(char c) 55static int isstring(char c)
56{ 56{
57 return (isprint(c) 57 return (isprint(c)
58 || (c == '\0') 58 || (c == '\0')
diff --git a/scripts/genksyms/keywords.c_shipped b/scripts/genksyms/keywords.c_shipped
index 971e0113ae7a..287467a2e8c7 100644
--- a/scripts/genksyms/keywords.c_shipped
+++ b/scripts/genksyms/keywords.c_shipped
@@ -1,4 +1,4 @@
1/* ANSI-C code produced by gperf version 3.0.2 */ 1/* ANSI-C code produced by gperf version 3.0.3 */
2/* Command-line: gperf -L ANSI-C -a -C -E -g -H is_reserved_hash -k '1,3,$' -N is_reserved_word -p -t scripts/genksyms/keywords.gperf */ 2/* Command-line: gperf -L ANSI-C -a -C -E -g -H is_reserved_hash -k '1,3,$' -N is_reserved_word -p -t scripts/genksyms/keywords.gperf */
3 3
4#if !((' ' == 32) && ('!' == 33) && ('"' == 34) && ('#' == 35) \ 4#if !((' ' == 32) && ('!' == 33) && ('"' == 34) && ('#' == 35) \
@@ -30,7 +30,9 @@
30 30
31#line 1 "scripts/genksyms/keywords.gperf" 31#line 1 "scripts/genksyms/keywords.gperf"
32 32
33#line 3 "scripts/genksyms/keywords.gperf" 33struct resword;
34static const struct resword *is_reserved_word(register const char *str, register unsigned int len);
35#line 5 "scripts/genksyms/keywords.gperf"
34struct resword { const char *name; int token; }; 36struct resword { const char *name; int token; };
35/* maximum key range = 62, duplicates = 0 */ 37/* maximum key range = 62, duplicates = 0 */
36 38
@@ -78,6 +80,9 @@ is_reserved_hash (register const char *str, register unsigned int len)
78 80
79#ifdef __GNUC__ 81#ifdef __GNUC__
80__inline 82__inline
83#ifdef __GNUC_STDC_INLINE__
84__attribute__ ((__gnu_inline__))
85#endif
81#endif 86#endif
82const struct resword * 87const struct resword *
83is_reserved_word (register const char *str, register unsigned int len) 88is_reserved_word (register const char *str, register unsigned int len)
@@ -94,105 +99,105 @@ is_reserved_word (register const char *str, register unsigned int len)
94 static const struct resword wordlist[] = 99 static const struct resword wordlist[] =
95 { 100 {
96 {""}, {""}, {""}, 101 {""}, {""}, {""},
97#line 26 "scripts/genksyms/keywords.gperf" 102#line 28 "scripts/genksyms/keywords.gperf"
98 {"asm", ASM_KEYW}, 103 {"asm", ASM_KEYW},
99 {""}, 104 {""},
100#line 8 "scripts/genksyms/keywords.gperf" 105#line 10 "scripts/genksyms/keywords.gperf"
101 {"__asm", ASM_KEYW}, 106 {"__asm", ASM_KEYW},
102 {""}, 107 {""},
103#line 9 "scripts/genksyms/keywords.gperf" 108#line 11 "scripts/genksyms/keywords.gperf"
104 {"__asm__", ASM_KEYW}, 109 {"__asm__", ASM_KEYW},
105 {""}, {""}, 110 {""}, {""},
106#line 52 "scripts/genksyms/keywords.gperf" 111#line 54 "scripts/genksyms/keywords.gperf"
107 {"__typeof__", TYPEOF_KEYW}, 112 {"__typeof__", TYPEOF_KEYW},
108 {""}, 113 {""},
109#line 12 "scripts/genksyms/keywords.gperf" 114#line 14 "scripts/genksyms/keywords.gperf"
110 {"__const", CONST_KEYW}, 115 {"__const", CONST_KEYW},
111#line 11 "scripts/genksyms/keywords.gperf"
112 {"__attribute__", ATTRIBUTE_KEYW},
113#line 13 "scripts/genksyms/keywords.gperf" 116#line 13 "scripts/genksyms/keywords.gperf"
117 {"__attribute__", ATTRIBUTE_KEYW},
118#line 15 "scripts/genksyms/keywords.gperf"
114 {"__const__", CONST_KEYW}, 119 {"__const__", CONST_KEYW},
115#line 18 "scripts/genksyms/keywords.gperf" 120#line 20 "scripts/genksyms/keywords.gperf"
116 {"__signed__", SIGNED_KEYW}, 121 {"__signed__", SIGNED_KEYW},
117#line 44 "scripts/genksyms/keywords.gperf" 122#line 46 "scripts/genksyms/keywords.gperf"
118 {"static", STATIC_KEYW}, 123 {"static", STATIC_KEYW},
119#line 20 "scripts/genksyms/keywords.gperf" 124#line 22 "scripts/genksyms/keywords.gperf"
120 {"__volatile__", VOLATILE_KEYW}, 125 {"__volatile__", VOLATILE_KEYW},
121#line 39 "scripts/genksyms/keywords.gperf" 126#line 41 "scripts/genksyms/keywords.gperf"
122 {"int", INT_KEYW}, 127 {"int", INT_KEYW},
123#line 32 "scripts/genksyms/keywords.gperf" 128#line 34 "scripts/genksyms/keywords.gperf"
124 {"char", CHAR_KEYW}, 129 {"char", CHAR_KEYW},
125#line 33 "scripts/genksyms/keywords.gperf" 130#line 35 "scripts/genksyms/keywords.gperf"
126 {"const", CONST_KEYW}, 131 {"const", CONST_KEYW},
127#line 45 "scripts/genksyms/keywords.gperf" 132#line 47 "scripts/genksyms/keywords.gperf"
128 {"struct", STRUCT_KEYW}, 133 {"struct", STRUCT_KEYW},
129#line 24 "scripts/genksyms/keywords.gperf" 134#line 26 "scripts/genksyms/keywords.gperf"
130 {"__restrict__", RESTRICT_KEYW}, 135 {"__restrict__", RESTRICT_KEYW},
131#line 25 "scripts/genksyms/keywords.gperf" 136#line 27 "scripts/genksyms/keywords.gperf"
132 {"restrict", RESTRICT_KEYW}, 137 {"restrict", RESTRICT_KEYW},
133#line 23 "scripts/genksyms/keywords.gperf" 138#line 25 "scripts/genksyms/keywords.gperf"
134 {"_restrict", RESTRICT_KEYW}, 139 {"_restrict", RESTRICT_KEYW},
135#line 16 "scripts/genksyms/keywords.gperf" 140#line 18 "scripts/genksyms/keywords.gperf"
136 {"__inline__", INLINE_KEYW}, 141 {"__inline__", INLINE_KEYW},
137#line 10 "scripts/genksyms/keywords.gperf" 142#line 12 "scripts/genksyms/keywords.gperf"
138 {"__attribute", ATTRIBUTE_KEYW}, 143 {"__attribute", ATTRIBUTE_KEYW},
139 {""}, 144 {""},
140#line 14 "scripts/genksyms/keywords.gperf" 145#line 16 "scripts/genksyms/keywords.gperf"
141 {"__extension__", EXTENSION_KEYW}, 146 {"__extension__", EXTENSION_KEYW},
142#line 35 "scripts/genksyms/keywords.gperf" 147#line 37 "scripts/genksyms/keywords.gperf"
143 {"enum", ENUM_KEYW}, 148 {"enum", ENUM_KEYW},
144#line 19 "scripts/genksyms/keywords.gperf" 149#line 21 "scripts/genksyms/keywords.gperf"
145 {"__volatile", VOLATILE_KEYW}, 150 {"__volatile", VOLATILE_KEYW},
146#line 36 "scripts/genksyms/keywords.gperf" 151#line 38 "scripts/genksyms/keywords.gperf"
147 {"extern", EXTERN_KEYW}, 152 {"extern", EXTERN_KEYW},
148 {""}, 153 {""},
149#line 17 "scripts/genksyms/keywords.gperf" 154#line 19 "scripts/genksyms/keywords.gperf"
150 {"__signed", SIGNED_KEYW}, 155 {"__signed", SIGNED_KEYW},
151#line 7 "scripts/genksyms/keywords.gperf" 156#line 9 "scripts/genksyms/keywords.gperf"
152 {"EXPORT_SYMBOL_GPL_FUTURE", EXPORT_SYMBOL_KEYW}, 157 {"EXPORT_SYMBOL_GPL_FUTURE", EXPORT_SYMBOL_KEYW},
153 {""}, 158 {""},
154#line 51 "scripts/genksyms/keywords.gperf" 159#line 53 "scripts/genksyms/keywords.gperf"
155 {"typeof", TYPEOF_KEYW}, 160 {"typeof", TYPEOF_KEYW},
156#line 46 "scripts/genksyms/keywords.gperf" 161#line 48 "scripts/genksyms/keywords.gperf"
157 {"typedef", TYPEDEF_KEYW}, 162 {"typedef", TYPEDEF_KEYW},
158#line 15 "scripts/genksyms/keywords.gperf" 163#line 17 "scripts/genksyms/keywords.gperf"
159 {"__inline", INLINE_KEYW}, 164 {"__inline", INLINE_KEYW},
160#line 31 "scripts/genksyms/keywords.gperf" 165#line 33 "scripts/genksyms/keywords.gperf"
161 {"auto", AUTO_KEYW}, 166 {"auto", AUTO_KEYW},
162#line 47 "scripts/genksyms/keywords.gperf" 167#line 49 "scripts/genksyms/keywords.gperf"
163 {"union", UNION_KEYW}, 168 {"union", UNION_KEYW},
164 {""}, {""}, 169 {""}, {""},
165#line 48 "scripts/genksyms/keywords.gperf" 170#line 50 "scripts/genksyms/keywords.gperf"
166 {"unsigned", UNSIGNED_KEYW}, 171 {"unsigned", UNSIGNED_KEYW},
167#line 49 "scripts/genksyms/keywords.gperf" 172#line 51 "scripts/genksyms/keywords.gperf"
168 {"void", VOID_KEYW}, 173 {"void", VOID_KEYW},
169#line 42 "scripts/genksyms/keywords.gperf" 174#line 44 "scripts/genksyms/keywords.gperf"
170 {"short", SHORT_KEYW}, 175 {"short", SHORT_KEYW},
171 {""}, {""}, 176 {""}, {""},
172#line 50 "scripts/genksyms/keywords.gperf" 177#line 52 "scripts/genksyms/keywords.gperf"
173 {"volatile", VOLATILE_KEYW}, 178 {"volatile", VOLATILE_KEYW},
174 {""}, 179 {""},
175#line 37 "scripts/genksyms/keywords.gperf" 180#line 39 "scripts/genksyms/keywords.gperf"
176 {"float", FLOAT_KEYW}, 181 {"float", FLOAT_KEYW},
177#line 34 "scripts/genksyms/keywords.gperf" 182#line 36 "scripts/genksyms/keywords.gperf"
178 {"double", DOUBLE_KEYW}, 183 {"double", DOUBLE_KEYW},
179 {""}, 184 {""},
180#line 5 "scripts/genksyms/keywords.gperf" 185#line 7 "scripts/genksyms/keywords.gperf"
181 {"EXPORT_SYMBOL", EXPORT_SYMBOL_KEYW}, 186 {"EXPORT_SYMBOL", EXPORT_SYMBOL_KEYW},
182 {""}, {""}, 187 {""}, {""},
183#line 38 "scripts/genksyms/keywords.gperf" 188#line 40 "scripts/genksyms/keywords.gperf"
184 {"inline", INLINE_KEYW}, 189 {"inline", INLINE_KEYW},
185#line 6 "scripts/genksyms/keywords.gperf" 190#line 8 "scripts/genksyms/keywords.gperf"
186 {"EXPORT_SYMBOL_GPL", EXPORT_SYMBOL_KEYW}, 191 {"EXPORT_SYMBOL_GPL", EXPORT_SYMBOL_KEYW},
187#line 41 "scripts/genksyms/keywords.gperf" 192#line 43 "scripts/genksyms/keywords.gperf"
188 {"register", REGISTER_KEYW}, 193 {"register", REGISTER_KEYW},
189 {""}, 194 {""},
190#line 22 "scripts/genksyms/keywords.gperf" 195#line 24 "scripts/genksyms/keywords.gperf"
191 {"_Bool", BOOL_KEYW}, 196 {"_Bool", BOOL_KEYW},
192#line 43 "scripts/genksyms/keywords.gperf" 197#line 45 "scripts/genksyms/keywords.gperf"
193 {"signed", SIGNED_KEYW}, 198 {"signed", SIGNED_KEYW},
194 {""}, {""}, 199 {""}, {""},
195#line 40 "scripts/genksyms/keywords.gperf" 200#line 42 "scripts/genksyms/keywords.gperf"
196 {"long", LONG_KEYW} 201 {"long", LONG_KEYW}
197 }; 202 };
198 203
diff --git a/scripts/genksyms/keywords.gperf b/scripts/genksyms/keywords.gperf
index 5ef3733225fb..8fe977a4d57b 100644
--- a/scripts/genksyms/keywords.gperf
+++ b/scripts/genksyms/keywords.gperf
@@ -1,4 +1,6 @@
1%{ 1%{
2struct resword;
3static const struct resword *is_reserved_word(register const char *str, register unsigned int len);
2%} 4%}
3struct resword { const char *name; int token; } 5struct resword { const char *name; int token; }
4%% 6%%
diff --git a/scripts/get_maintainer.pl b/scripts/get_maintainer.pl
index 102b76608f35..81a67a458e78 100755
--- a/scripts/get_maintainer.pl
+++ b/scripts/get_maintainer.pl
@@ -5,8 +5,8 @@
5# Print selected MAINTAINERS information for 5# Print selected MAINTAINERS information for
6# the files modified in a patch or for a file 6# the files modified in a patch or for a file
7# 7#
8# usage: perl scripts/get_maintainers.pl [OPTIONS] <patch> 8# usage: perl scripts/get_maintainer.pl [OPTIONS] <patch>
9# perl scripts/get_maintainers.pl [OPTIONS] -f <file> 9# perl scripts/get_maintainer.pl [OPTIONS] -f <file>
10# 10#
11# Licensed under the terms of the GNU GPL License version 2 11# Licensed under the terms of the GNU GPL License version 2
12 12
diff --git a/scripts/kconfig/Makefile b/scripts/kconfig/Makefile
index 6d69c7ccdcc7..80599e3a7994 100644
--- a/scripts/kconfig/Makefile
+++ b/scripts/kconfig/Makefile
@@ -30,7 +30,7 @@ silentoldconfig: $(obj)/conf
30 $< -s $(Kconfig) 30 $< -s $(Kconfig)
31 31
32localmodconfig: $(obj)/streamline_config.pl $(obj)/conf 32localmodconfig: $(obj)/streamline_config.pl $(obj)/conf
33 $(Q)perl $< $(Kconfig) > .tmp.config 33 $(Q)perl $< $(srctree) $(Kconfig) > .tmp.config
34 $(Q)if [ -f .config ]; then \ 34 $(Q)if [ -f .config ]; then \
35 cmp -s .tmp.config .config || \ 35 cmp -s .tmp.config .config || \
36 (mv -f .config .config.old.1; \ 36 (mv -f .config .config.old.1; \
@@ -44,7 +44,7 @@ localmodconfig: $(obj)/streamline_config.pl $(obj)/conf
44 $(Q)rm -f .tmp.config 44 $(Q)rm -f .tmp.config
45 45
46localyesconfig: $(obj)/streamline_config.pl $(obj)/conf 46localyesconfig: $(obj)/streamline_config.pl $(obj)/conf
47 $(Q)perl $< $(Kconfig) > .tmp.config 47 $(Q)perl $< $(srctree) $(Kconfig) > .tmp.config
48 $(Q)sed -i s/=m/=y/ .tmp.config 48 $(Q)sed -i s/=m/=y/ .tmp.config
49 $(Q)if [ -f .config ]; then \ 49 $(Q)if [ -f .config ]; then \
50 cmp -s .tmp.config .config || \ 50 cmp -s .tmp.config .config || \
diff --git a/scripts/kconfig/lex.zconf.c_shipped b/scripts/kconfig/lex.zconf.c_shipped
index dc3e81807d13..fdc7113b08d1 100644
--- a/scripts/kconfig/lex.zconf.c_shipped
+++ b/scripts/kconfig/lex.zconf.c_shipped
@@ -160,7 +160,15 @@ typedef unsigned int flex_uint32_t;
160 160
161/* Size of default input buffer. */ 161/* Size of default input buffer. */
162#ifndef YY_BUF_SIZE 162#ifndef YY_BUF_SIZE
163#ifdef __ia64__
164/* On IA-64, the buffer size is 16k, not 8k.
165 * Moreover, YY_BUF_SIZE is 2*YY_READ_BUF_SIZE in the general case.
166 * Ditto for the __ia64__ case accordingly.
167 */
168#define YY_BUF_SIZE 32768
169#else
163#define YY_BUF_SIZE 16384 170#define YY_BUF_SIZE 16384
171#endif /* __ia64__ */
164#endif 172#endif
165 173
166/* The state buf must be large enough to hold one state per character in the main buffer. 174/* The state buf must be large enough to hold one state per character in the main buffer.
@@ -802,7 +810,7 @@ static int last_ts, first_ts;
802static void zconf_endhelp(void); 810static void zconf_endhelp(void);
803static void zconf_endfile(void); 811static void zconf_endfile(void);
804 812
805void new_string(void) 813static void new_string(void)
806{ 814{
807 text = malloc(START_STRSIZE); 815 text = malloc(START_STRSIZE);
808 text_asize = START_STRSIZE; 816 text_asize = START_STRSIZE;
@@ -810,7 +818,7 @@ void new_string(void)
810 *text = 0; 818 *text = 0;
811} 819}
812 820
813void append_string(const char *str, int size) 821static void append_string(const char *str, int size)
814{ 822{
815 int new_size = text_size + size + 1; 823 int new_size = text_size + size + 1;
816 if (new_size > text_asize) { 824 if (new_size > text_asize) {
@@ -824,7 +832,7 @@ void append_string(const char *str, int size)
824 text[text_size] = 0; 832 text[text_size] = 0;
825} 833}
826 834
827void alloc_string(const char *str, int size) 835static void alloc_string(const char *str, int size)
828{ 836{
829 text = malloc(size + 1); 837 text = malloc(size + 1);
830 memcpy(text, str, size); 838 memcpy(text, str, size);
@@ -914,7 +922,12 @@ static int input (void );
914 922
915/* Amount of stuff to slurp up with each read. */ 923/* Amount of stuff to slurp up with each read. */
916#ifndef YY_READ_BUF_SIZE 924#ifndef YY_READ_BUF_SIZE
925#ifdef __ia64__
926/* On IA-64, the buffer size is 16k, not 8k */
927#define YY_READ_BUF_SIZE 16384
928#else
917#define YY_READ_BUF_SIZE 8192 929#define YY_READ_BUF_SIZE 8192
930#endif /* __ia64__ */
918#endif 931#endif
919 932
920/* Copy whatever the last rule matched to the standard output. */ 933/* Copy whatever the last rule matched to the standard output. */
@@ -922,7 +935,7 @@ static int input (void );
922/* This used to be an fputs(), but since the string might contain NUL's, 935/* This used to be an fputs(), but since the string might contain NUL's,
923 * we now use fwrite(). 936 * we now use fwrite().
924 */ 937 */
925#define ECHO fwrite( zconftext, zconfleng, 1, zconfout ) 938#define ECHO do { if (fwrite( zconftext, zconfleng, 1, zconfout )) {} } while (0)
926#endif 939#endif
927 940
928/* Gets input and stuffs it into "buf". number of characters read, or YY_NULL, 941/* Gets input and stuffs it into "buf". number of characters read, or YY_NULL,
@@ -2060,8 +2073,8 @@ YY_BUFFER_STATE zconf_scan_string (yyconst char * yystr )
2060 2073
2061/** Setup the input buffer state to scan the given bytes. The next call to zconflex() will 2074/** Setup the input buffer state to scan the given bytes. The next call to zconflex() will
2062 * scan from a @e copy of @a bytes. 2075 * scan from a @e copy of @a bytes.
2063 * @param bytes the byte buffer to scan 2076 * @param yybytes the byte buffer to scan
2064 * @param len the number of bytes in the buffer pointed to by @a bytes. 2077 * @param _yybytes_len the number of bytes in the buffer pointed to by @a bytes.
2065 * 2078 *
2066 * @return the newly allocated buffer state object. 2079 * @return the newly allocated buffer state object.
2067 */ 2080 */
diff --git a/scripts/kconfig/streamline_config.pl b/scripts/kconfig/streamline_config.pl
index 95984db8e1e0..0d800820c3cd 100644
--- a/scripts/kconfig/streamline_config.pl
+++ b/scripts/kconfig/streamline_config.pl
@@ -43,7 +43,6 @@
43# make oldconfig 43# make oldconfig
44# 44#
45my $config = ".config"; 45my $config = ".config";
46my $linuxpath = ".";
47 46
48my $uname = `uname -r`; 47my $uname = `uname -r`;
49chomp $uname; 48chomp $uname;
@@ -111,7 +110,11 @@ sub find_config {
111 110
112find_config; 111find_config;
113 112
114my @makefiles = `find $linuxpath -name Makefile`; 113# Get the build source and top level Kconfig file (passed in)
114my $ksource = $ARGV[0];
115my $kconfig = $ARGV[1];
116
117my @makefiles = `find $ksource -name Makefile`;
115my %depends; 118my %depends;
116my %selects; 119my %selects;
117my %prompts; 120my %prompts;
@@ -119,9 +122,6 @@ my %objects;
119my $var; 122my $var;
120my $cont = 0; 123my $cont = 0;
121 124
122# Get the top level Kconfig file (passed in)
123my $kconfig = $ARGV[0];
124
125# prevent recursion 125# prevent recursion
126my %read_kconfigs; 126my %read_kconfigs;
127 127
@@ -132,7 +132,7 @@ sub read_kconfig {
132 my $config; 132 my $config;
133 my @kconfigs; 133 my @kconfigs;
134 134
135 open(KIN, $kconfig) || die "Can't open $kconfig"; 135 open(KIN, "$ksource/$kconfig") || die "Can't open $kconfig";
136 while (<KIN>) { 136 while (<KIN>) {
137 chomp; 137 chomp;
138 138
diff --git a/scripts/kconfig/zconf.gperf b/scripts/kconfig/zconf.gperf
index 25ef5d01c0af..d8bc74249622 100644
--- a/scripts/kconfig/zconf.gperf
+++ b/scripts/kconfig/zconf.gperf
@@ -9,6 +9,8 @@
9 9
10struct kconf_id; 10struct kconf_id;
11 11
12static struct kconf_id *kconf_id_lookup(register const char *str, register unsigned int len);
13
12%% 14%%
13mainmenu, T_MAINMENU, TF_COMMAND 15mainmenu, T_MAINMENU, TF_COMMAND
14menu, T_MENU, TF_COMMAND 16menu, T_MENU, TF_COMMAND
diff --git a/scripts/kconfig/zconf.hash.c_shipped b/scripts/kconfig/zconf.hash.c_shipped
index 5c73d51339d8..c1748faf4634 100644
--- a/scripts/kconfig/zconf.hash.c_shipped
+++ b/scripts/kconfig/zconf.hash.c_shipped
@@ -30,6 +30,8 @@
30#endif 30#endif
31 31
32struct kconf_id; 32struct kconf_id;
33
34static struct kconf_id *kconf_id_lookup(register const char *str, register unsigned int len);
33/* maximum key range = 47, duplicates = 0 */ 35/* maximum key range = 47, duplicates = 0 */
34 36
35#ifdef __GNUC__ 37#ifdef __GNUC__
diff --git a/scripts/kconfig/zconf.l b/scripts/kconfig/zconf.l
index 21ff69c9ad4e..d8f7236cb0a3 100644
--- a/scripts/kconfig/zconf.l
+++ b/scripts/kconfig/zconf.l
@@ -39,7 +39,7 @@ static int last_ts, first_ts;
39static void zconf_endhelp(void); 39static void zconf_endhelp(void);
40static void zconf_endfile(void); 40static void zconf_endfile(void);
41 41
42void new_string(void) 42static void new_string(void)
43{ 43{
44 text = malloc(START_STRSIZE); 44 text = malloc(START_STRSIZE);
45 text_asize = START_STRSIZE; 45 text_asize = START_STRSIZE;
@@ -47,7 +47,7 @@ void new_string(void)
47 *text = 0; 47 *text = 0;
48} 48}
49 49
50void append_string(const char *str, int size) 50static void append_string(const char *str, int size)
51{ 51{
52 int new_size = text_size + size + 1; 52 int new_size = text_size + size + 1;
53 if (new_size > text_asize) { 53 if (new_size > text_asize) {
@@ -61,7 +61,7 @@ void append_string(const char *str, int size)
61 text[text_size] = 0; 61 text[text_size] = 0;
62} 62}
63 63
64void alloc_string(const char *str, int size) 64static void alloc_string(const char *str, int size)
65{ 65{
66 text = malloc(size + 1); 66 text = malloc(size + 1);
67 memcpy(text, str, size); 67 memcpy(text, str, size);
diff --git a/scripts/kconfig/zconf.tab.c_shipped b/scripts/kconfig/zconf.tab.c_shipped
index 95df833b5a9d..6e9dcd59aa87 100644
--- a/scripts/kconfig/zconf.tab.c_shipped
+++ b/scripts/kconfig/zconf.tab.c_shipped
@@ -1,24 +1,23 @@
1/* A Bison parser, made by GNU Bison 2.3. */
2 1
3/* Skeleton implementation for Bison's Yacc-like parsers in C 2/* A Bison parser, made by GNU Bison 2.4.1. */
4 3
5 Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006 4/* Skeleton implementation for Bison's Yacc-like parsers in C
5
6 Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006
6 Free Software Foundation, Inc. 7 Free Software Foundation, Inc.
7 8
8 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
9 it under the terms of the GNU General Public License as published by 10 it under the terms of the GNU General Public License as published by
10 the Free Software Foundation; either version 2, or (at your option) 11 the Free Software Foundation, either version 3 of the License, or
11 any later version. 12 (at your option) any later version.
12 13
13 This program is distributed in the hope that it will be useful, 14 This program is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of 15 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 GNU General Public License for more details. 17 GNU General Public License for more details.
17 18
18 You should have received a copy of the GNU General Public License 19 You should have received a copy of the GNU General Public License
19 along with this program; if not, write to the Free Software 20 along with this program. If not, see <http://www.gnu.org/licenses/>. */
20 Foundation, Inc., 51 Franklin Street, Fifth Floor,
21 Boston, MA 02110-1301, USA. */
22 21
23/* As a special exception, you may create a larger work that contains 22/* As a special exception, you may create a larger work that contains
24 part or all of the Bison parser skeleton and distribute that work 23 part or all of the Bison parser skeleton and distribute that work
@@ -29,7 +28,7 @@
29 special exception, which will cause the skeleton and the resulting 28 special exception, which will cause the skeleton and the resulting
30 Bison output files to be licensed under the GNU General Public 29 Bison output files to be licensed under the GNU General Public
31 License without this special exception. 30 License without this special exception.
32 31
33 This special exception was added by the Free Software Foundation in 32 This special exception was added by the Free Software Foundation in
34 version 2.2 of Bison. */ 33 version 2.2 of Bison. */
35 34
@@ -47,7 +46,7 @@
47#define YYBISON 1 46#define YYBISON 1
48 47
49/* Bison version. */ 48/* Bison version. */
50#define YYBISON_VERSION "2.3" 49#define YYBISON_VERSION "2.4.1"
51 50
52/* Skeleton name. */ 51/* Skeleton name. */
53#define YYSKELETON_NAME "yacc.c" 52#define YYSKELETON_NAME "yacc.c"
@@ -55,94 +54,23 @@
55/* Pure parsers. */ 54/* Pure parsers. */
56#define YYPURE 0 55#define YYPURE 0
57 56
57/* Push parsers. */
58#define YYPUSH 0
59
60/* Pull parsers. */
61#define YYPULL 1
62
58/* Using locations. */ 63/* Using locations. */
59#define YYLSP_NEEDED 0 64#define YYLSP_NEEDED 0
60 65
61/* Substitute the variable and function names. */ 66/* Substitute the variable and function names. */
62#define yyparse zconfparse 67#define yyparse zconfparse
63#define yylex zconflex 68#define yylex zconflex
64#define yyerror zconferror 69#define yyerror zconferror
65#define yylval zconflval 70#define yylval zconflval
66#define yychar zconfchar 71#define yychar zconfchar
67#define yydebug zconfdebug 72#define yydebug zconfdebug
68#define yynerrs zconfnerrs 73#define yynerrs zconfnerrs
69
70
71/* Tokens. */
72#ifndef YYTOKENTYPE
73# define YYTOKENTYPE
74 /* Put the tokens into the symbol table, so that GDB and other debuggers
75 know about them. */
76 enum yytokentype {
77 T_MAINMENU = 258,
78 T_MENU = 259,
79 T_ENDMENU = 260,
80 T_SOURCE = 261,
81 T_CHOICE = 262,
82 T_ENDCHOICE = 263,
83 T_COMMENT = 264,
84 T_CONFIG = 265,
85 T_MENUCONFIG = 266,
86 T_HELP = 267,
87 T_HELPTEXT = 268,
88 T_IF = 269,
89 T_ENDIF = 270,
90 T_DEPENDS = 271,
91 T_OPTIONAL = 272,
92 T_PROMPT = 273,
93 T_TYPE = 274,
94 T_DEFAULT = 275,
95 T_SELECT = 276,
96 T_RANGE = 277,
97 T_OPTION = 278,
98 T_ON = 279,
99 T_WORD = 280,
100 T_WORD_QUOTE = 281,
101 T_UNEQUAL = 282,
102 T_CLOSE_PAREN = 283,
103 T_OPEN_PAREN = 284,
104 T_EOL = 285,
105 T_OR = 286,
106 T_AND = 287,
107 T_EQUAL = 288,
108 T_NOT = 289
109 };
110#endif
111/* Tokens. */
112#define T_MAINMENU 258
113#define T_MENU 259
114#define T_ENDMENU 260
115#define T_SOURCE 261
116#define T_CHOICE 262
117#define T_ENDCHOICE 263
118#define T_COMMENT 264
119#define T_CONFIG 265
120#define T_MENUCONFIG 266
121#define T_HELP 267
122#define T_HELPTEXT 268
123#define T_IF 269
124#define T_ENDIF 270
125#define T_DEPENDS 271
126#define T_OPTIONAL 272
127#define T_PROMPT 273
128#define T_TYPE 274
129#define T_DEFAULT 275
130#define T_SELECT 276
131#define T_RANGE 277
132#define T_OPTION 278
133#define T_ON 279
134#define T_WORD 280
135#define T_WORD_QUOTE 281
136#define T_UNEQUAL 282
137#define T_CLOSE_PAREN 283
138#define T_OPEN_PAREN 284
139#define T_EOL 285
140#define T_OR 286
141#define T_AND 287
142#define T_EQUAL 288
143#define T_NOT 289
144
145
146 74
147 75
148/* Copy the first part of user declarations. */ 76/* Copy the first part of user declarations. */
@@ -163,8 +91,6 @@
163#define LKC_DIRECT_LINK 91#define LKC_DIRECT_LINK
164#include "lkc.h" 92#include "lkc.h"
165 93
166#include "zconf.hash.c"
167
168#define printd(mask, fmt...) if (cdebug & (mask)) printf(fmt) 94#define printd(mask, fmt...) if (cdebug & (mask)) printf(fmt)
169 95
170#define PRINTD 0x0001 96#define PRINTD 0x0001
@@ -188,6 +114,7 @@ static struct menu *current_menu, *current_entry;
188#endif 114#endif
189 115
190 116
117
191/* Enabling traces. */ 118/* Enabling traces. */
192#ifndef YYDEBUG 119#ifndef YYDEBUG
193# define YYDEBUG 0 120# define YYDEBUG 0
@@ -206,31 +133,77 @@ static struct menu *current_menu, *current_entry;
206# define YYTOKEN_TABLE 0 133# define YYTOKEN_TABLE 0
207#endif 134#endif
208 135
136
137/* Tokens. */
138#ifndef YYTOKENTYPE
139# define YYTOKENTYPE
140 /* Put the tokens into the symbol table, so that GDB and other debuggers
141 know about them. */
142 enum yytokentype {
143 T_MAINMENU = 258,
144 T_MENU = 259,
145 T_ENDMENU = 260,
146 T_SOURCE = 261,
147 T_CHOICE = 262,
148 T_ENDCHOICE = 263,
149 T_COMMENT = 264,
150 T_CONFIG = 265,
151 T_MENUCONFIG = 266,
152 T_HELP = 267,
153 T_HELPTEXT = 268,
154 T_IF = 269,
155 T_ENDIF = 270,
156 T_DEPENDS = 271,
157 T_OPTIONAL = 272,
158 T_PROMPT = 273,
159 T_TYPE = 274,
160 T_DEFAULT = 275,
161 T_SELECT = 276,
162 T_RANGE = 277,
163 T_OPTION = 278,
164 T_ON = 279,
165 T_WORD = 280,
166 T_WORD_QUOTE = 281,
167 T_UNEQUAL = 282,
168 T_CLOSE_PAREN = 283,
169 T_OPEN_PAREN = 284,
170 T_EOL = 285,
171 T_OR = 286,
172 T_AND = 287,
173 T_EQUAL = 288,
174 T_NOT = 289
175 };
176#endif
177
178
179
209#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED 180#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
210typedef union YYSTYPE 181typedef union YYSTYPE
211
212{ 182{
183
184
213 char *string; 185 char *string;
214 struct file *file; 186 struct file *file;
215 struct symbol *symbol; 187 struct symbol *symbol;
216 struct expr *expr; 188 struct expr *expr;
217 struct menu *menu; 189 struct menu *menu;
218 struct kconf_id *id; 190 struct kconf_id *id;
219}
220/* Line 187 of yacc.c. */
221 191
222 YYSTYPE; 192
193
194} YYSTYPE;
195# define YYSTYPE_IS_TRIVIAL 1
223# define yystype YYSTYPE /* obsolescent; will be withdrawn */ 196# define yystype YYSTYPE /* obsolescent; will be withdrawn */
224# define YYSTYPE_IS_DECLARED 1 197# define YYSTYPE_IS_DECLARED 1
225# define YYSTYPE_IS_TRIVIAL 1
226#endif 198#endif
227 199
228 200
229
230/* Copy the second part of user declarations. */ 201/* Copy the second part of user declarations. */
231 202
232 203
233/* Line 216 of yacc.c. */ 204/* Include zconf.hash.c here so it can see the token constants. */
205#include "zconf.hash.c"
206
234 207
235 208
236#ifdef short 209#ifdef short
@@ -306,14 +279,14 @@ typedef short int yytype_int16;
306#if (defined __STDC__ || defined __C99__FUNC__ \ 279#if (defined __STDC__ || defined __C99__FUNC__ \
307 || defined __cplusplus || defined _MSC_VER) 280 || defined __cplusplus || defined _MSC_VER)
308static int 281static int
309YYID (int i) 282YYID (int yyi)
310#else 283#else
311static int 284static int
312YYID (i) 285YYID (yyi)
313 int i; 286 int yyi;
314#endif 287#endif
315{ 288{
316 return i; 289 return yyi;
317} 290}
318#endif 291#endif
319 292
@@ -394,9 +367,9 @@ void free (void *); /* INFRINGES ON USER NAME SPACE */
394/* A type that is properly aligned for any stack member. */ 367/* A type that is properly aligned for any stack member. */
395union yyalloc 368union yyalloc
396{ 369{
397 yytype_int16 yyss; 370 yytype_int16 yyss_alloc;
398 YYSTYPE yyvs; 371 YYSTYPE yyvs_alloc;
399 }; 372};
400 373
401/* The size of the maximum gap between one aligned stack and the next. */ 374/* The size of the maximum gap between one aligned stack and the next. */
402# define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1) 375# define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
@@ -430,12 +403,12 @@ union yyalloc
430 elements in the stack, and YYPTR gives the new location of the 403 elements in the stack, and YYPTR gives the new location of the
431 stack. Advance YYPTR to a properly aligned location for the next 404 stack. Advance YYPTR to a properly aligned location for the next
432 stack. */ 405 stack. */
433# define YYSTACK_RELOCATE(Stack) \ 406# define YYSTACK_RELOCATE(Stack_alloc, Stack) \
434 do \ 407 do \
435 { \ 408 { \
436 YYSIZE_T yynewbytes; \ 409 YYSIZE_T yynewbytes; \
437 YYCOPY (&yyptr->Stack, Stack, yysize); \ 410 YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \
438 Stack = &yyptr->Stack; \ 411 Stack = &yyptr->Stack_alloc; \
439 yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \ 412 yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
440 yyptr += yynewbytes / sizeof (*yyptr); \ 413 yyptr += yynewbytes / sizeof (*yyptr); \
441 } \ 414 } \
@@ -558,18 +531,18 @@ static const yytype_int8 yyrhs[] =
558/* YYRLINE[YYN] -- source line where rule number YYN was defined. */ 531/* YYRLINE[YYN] -- source line where rule number YYN was defined. */
559static const yytype_uint16 yyrline[] = 532static const yytype_uint16 yyrline[] =
560{ 533{
561 0, 104, 104, 106, 108, 109, 110, 111, 112, 113, 534 0, 107, 107, 109, 111, 112, 113, 114, 115, 116,
562 114, 118, 122, 122, 122, 122, 122, 122, 122, 126, 535 117, 121, 125, 125, 125, 125, 125, 125, 125, 129,
563 127, 128, 129, 130, 131, 135, 136, 142, 150, 156, 536 130, 131, 132, 133, 134, 138, 139, 145, 153, 159,
564 164, 174, 176, 177, 178, 179, 180, 181, 184, 192, 537 167, 177, 179, 180, 181, 182, 183, 184, 187, 195,
565 198, 208, 214, 220, 223, 225, 236, 237, 242, 251, 538 201, 211, 217, 223, 226, 228, 239, 240, 245, 254,
566 256, 264, 267, 269, 270, 271, 272, 273, 276, 282, 539 259, 267, 270, 272, 273, 274, 275, 276, 279, 285,
567 293, 299, 309, 311, 316, 324, 332, 335, 337, 338, 540 296, 302, 312, 314, 319, 327, 335, 338, 340, 341,
568 339, 344, 351, 356, 364, 367, 369, 370, 371, 374, 541 342, 347, 354, 359, 367, 370, 372, 373, 374, 377,
569 382, 389, 396, 402, 409, 411, 412, 413, 416, 424, 542 385, 392, 399, 405, 412, 414, 415, 416, 419, 427,
570 426, 431, 432, 435, 436, 437, 441, 442, 445, 446, 543 429, 434, 435, 438, 439, 440, 444, 445, 448, 449,
571 449, 450, 451, 452, 453, 454, 455, 458, 459, 462, 544 452, 453, 454, 455, 456, 457, 458, 461, 462, 465,
572 463 545 466
573}; 546};
574#endif 547#endif
575 548
@@ -985,17 +958,20 @@ yy_symbol_print (yyoutput, yytype, yyvaluep)
985#if (defined __STDC__ || defined __C99__FUNC__ \ 958#if (defined __STDC__ || defined __C99__FUNC__ \
986 || defined __cplusplus || defined _MSC_VER) 959 || defined __cplusplus || defined _MSC_VER)
987static void 960static void
988yy_stack_print (yytype_int16 *bottom, yytype_int16 *top) 961yy_stack_print (yytype_int16 *yybottom, yytype_int16 *yytop)
989#else 962#else
990static void 963static void
991yy_stack_print (bottom, top) 964yy_stack_print (yybottom, yytop)
992 yytype_int16 *bottom; 965 yytype_int16 *yybottom;
993 yytype_int16 *top; 966 yytype_int16 *yytop;
994#endif 967#endif
995{ 968{
996 YYFPRINTF (stderr, "Stack now"); 969 YYFPRINTF (stderr, "Stack now");
997 for (; bottom <= top; ++bottom) 970 for (; yybottom <= yytop; yybottom++)
998 YYFPRINTF (stderr, " %d", *bottom); 971 {
972 int yybot = *yybottom;
973 YYFPRINTF (stderr, " %d", yybot);
974 }
999 YYFPRINTF (stderr, "\n"); 975 YYFPRINTF (stderr, "\n");
1000} 976}
1001 977
@@ -1029,11 +1005,11 @@ yy_reduce_print (yyvsp, yyrule)
1029 /* The symbols being reduced. */ 1005 /* The symbols being reduced. */
1030 for (yyi = 0; yyi < yynrhs; yyi++) 1006 for (yyi = 0; yyi < yynrhs; yyi++)
1031 { 1007 {
1032 fprintf (stderr, " $%d = ", yyi + 1); 1008 YYFPRINTF (stderr, " $%d = ", yyi + 1);
1033 yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi], 1009 yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi],
1034 &(yyvsp[(yyi + 1) - (yynrhs)]) 1010 &(yyvsp[(yyi + 1) - (yynrhs)])
1035 ); 1011 );
1036 fprintf (stderr, "\n"); 1012 YYFPRINTF (stderr, "\n");
1037 } 1013 }
1038} 1014}
1039 1015
@@ -1343,10 +1319,8 @@ yydestruct (yymsg, yytype, yyvaluep)
1343 break; 1319 break;
1344 } 1320 }
1345} 1321}
1346
1347 1322
1348/* Prevent warnings from -Wmissing-prototypes. */ 1323/* Prevent warnings from -Wmissing-prototypes. */
1349
1350#ifdef YYPARSE_PARAM 1324#ifdef YYPARSE_PARAM
1351#if defined __STDC__ || defined __cplusplus 1325#if defined __STDC__ || defined __cplusplus
1352int yyparse (void *YYPARSE_PARAM); 1326int yyparse (void *YYPARSE_PARAM);
@@ -1362,11 +1336,10 @@ int yyparse ();
1362#endif /* ! YYPARSE_PARAM */ 1336#endif /* ! YYPARSE_PARAM */
1363 1337
1364 1338
1365 1339/* The lookahead symbol. */
1366/* The look-ahead symbol. */
1367int yychar; 1340int yychar;
1368 1341
1369/* The semantic value of the look-ahead symbol. */ 1342/* The semantic value of the lookahead symbol. */
1370YYSTYPE yylval; 1343YYSTYPE yylval;
1371 1344
1372/* Number of syntax errors so far. */ 1345/* Number of syntax errors so far. */
@@ -1374,9 +1347,9 @@ int yynerrs;
1374 1347
1375 1348
1376 1349
1377/*----------. 1350/*-------------------------.
1378| yyparse. | 1351| yyparse or yypush_parse. |
1379`----------*/ 1352`-------------------------*/
1380 1353
1381#ifdef YYPARSE_PARAM 1354#ifdef YYPARSE_PARAM
1382#if (defined __STDC__ || defined __C99__FUNC__ \ 1355#if (defined __STDC__ || defined __C99__FUNC__ \
@@ -1400,66 +1373,68 @@ yyparse ()
1400#endif 1373#endif
1401#endif 1374#endif
1402{ 1375{
1403
1404 int yystate;
1405 int yyn;
1406 int yyresult;
1407 /* Number of tokens to shift before error messages enabled. */
1408 int yyerrstatus;
1409 /* Look-ahead token as an internal (translated) token number. */
1410 int yytoken = 0;
1411#if YYERROR_VERBOSE
1412 /* Buffer for error messages, and its allocated size. */
1413 char yymsgbuf[128];
1414 char *yymsg = yymsgbuf;
1415 YYSIZE_T yymsg_alloc = sizeof yymsgbuf;
1416#endif
1417
1418 /* Three stacks and their tools:
1419 `yyss': related to states,
1420 `yyvs': related to semantic values,
1421 `yyls': related to locations.
1422 1376
1423 Refer to the stacks thru separate pointers, to allow yyoverflow
1424 to reallocate them elsewhere. */
1425 1377
1426 /* The state stack. */ 1378 int yystate;
1427 yytype_int16 yyssa[YYINITDEPTH]; 1379 /* Number of tokens to shift before error messages enabled. */
1428 yytype_int16 *yyss = yyssa; 1380 int yyerrstatus;
1429 yytype_int16 *yyssp;
1430 1381
1431 /* The semantic value stack. */ 1382 /* The stacks and their tools:
1432 YYSTYPE yyvsa[YYINITDEPTH]; 1383 `yyss': related to states.
1433 YYSTYPE *yyvs = yyvsa; 1384 `yyvs': related to semantic values.
1434 YYSTYPE *yyvsp;
1435 1385
1386 Refer to the stacks thru separate pointers, to allow yyoverflow
1387 to reallocate them elsewhere. */
1436 1388
1389 /* The state stack. */
1390 yytype_int16 yyssa[YYINITDEPTH];
1391 yytype_int16 *yyss;
1392 yytype_int16 *yyssp;
1437 1393
1438#define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N)) 1394 /* The semantic value stack. */
1395 YYSTYPE yyvsa[YYINITDEPTH];
1396 YYSTYPE *yyvs;
1397 YYSTYPE *yyvsp;
1439 1398
1440 YYSIZE_T yystacksize = YYINITDEPTH; 1399 YYSIZE_T yystacksize;
1441 1400
1401 int yyn;
1402 int yyresult;
1403 /* Lookahead token as an internal (translated) token number. */
1404 int yytoken;
1442 /* The variables used to return semantic value and location from the 1405 /* The variables used to return semantic value and location from the
1443 action routines. */ 1406 action routines. */
1444 YYSTYPE yyval; 1407 YYSTYPE yyval;
1445 1408
1409#if YYERROR_VERBOSE
1410 /* Buffer for error messages, and its allocated size. */
1411 char yymsgbuf[128];
1412 char *yymsg = yymsgbuf;
1413 YYSIZE_T yymsg_alloc = sizeof yymsgbuf;
1414#endif
1415
1416#define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N))
1446 1417
1447 /* The number of symbols on the RHS of the reduced rule. 1418 /* The number of symbols on the RHS of the reduced rule.
1448 Keep to zero when no symbol should be popped. */ 1419 Keep to zero when no symbol should be popped. */
1449 int yylen = 0; 1420 int yylen = 0;
1450 1421
1422 yytoken = 0;
1423 yyss = yyssa;
1424 yyvs = yyvsa;
1425 yystacksize = YYINITDEPTH;
1426
1451 YYDPRINTF ((stderr, "Starting parse\n")); 1427 YYDPRINTF ((stderr, "Starting parse\n"));
1452 1428
1453 yystate = 0; 1429 yystate = 0;
1454 yyerrstatus = 0; 1430 yyerrstatus = 0;
1455 yynerrs = 0; 1431 yynerrs = 0;
1456 yychar = YYEMPTY; /* Cause a token to be read. */ 1432 yychar = YYEMPTY; /* Cause a token to be read. */
1457 1433
1458 /* Initialize stack pointers. 1434 /* Initialize stack pointers.
1459 Waste one element of value and location stack 1435 Waste one element of value and location stack
1460 so that they stay on the same level as the state stack. 1436 so that they stay on the same level as the state stack.
1461 The wasted elements are never initialized. */ 1437 The wasted elements are never initialized. */
1462
1463 yyssp = yyss; 1438 yyssp = yyss;
1464 yyvsp = yyvs; 1439 yyvsp = yyvs;
1465 1440
@@ -1489,7 +1464,6 @@ yyparse ()
1489 YYSTYPE *yyvs1 = yyvs; 1464 YYSTYPE *yyvs1 = yyvs;
1490 yytype_int16 *yyss1 = yyss; 1465 yytype_int16 *yyss1 = yyss;
1491 1466
1492
1493 /* Each stack pointer address is followed by the size of the 1467 /* Each stack pointer address is followed by the size of the
1494 data in use in that stack, in bytes. This used to be a 1468 data in use in that stack, in bytes. This used to be a
1495 conditional around just the two extra args, but that might 1469 conditional around just the two extra args, but that might
@@ -1497,7 +1471,6 @@ yyparse ()
1497 yyoverflow (YY_("memory exhausted"), 1471 yyoverflow (YY_("memory exhausted"),
1498 &yyss1, yysize * sizeof (*yyssp), 1472 &yyss1, yysize * sizeof (*yyssp),
1499 &yyvs1, yysize * sizeof (*yyvsp), 1473 &yyvs1, yysize * sizeof (*yyvsp),
1500
1501 &yystacksize); 1474 &yystacksize);
1502 1475
1503 yyss = yyss1; 1476 yyss = yyss1;
@@ -1520,9 +1493,8 @@ yyparse ()
1520 (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize)); 1493 (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
1521 if (! yyptr) 1494 if (! yyptr)
1522 goto yyexhaustedlab; 1495 goto yyexhaustedlab;
1523 YYSTACK_RELOCATE (yyss); 1496 YYSTACK_RELOCATE (yyss_alloc, yyss);
1524 YYSTACK_RELOCATE (yyvs); 1497 YYSTACK_RELOCATE (yyvs_alloc, yyvs);
1525
1526# undef YYSTACK_RELOCATE 1498# undef YYSTACK_RELOCATE
1527 if (yyss1 != yyssa) 1499 if (yyss1 != yyssa)
1528 YYSTACK_FREE (yyss1); 1500 YYSTACK_FREE (yyss1);
@@ -1533,7 +1505,6 @@ yyparse ()
1533 yyssp = yyss + yysize - 1; 1505 yyssp = yyss + yysize - 1;
1534 yyvsp = yyvs + yysize - 1; 1506 yyvsp = yyvs + yysize - 1;
1535 1507
1536
1537 YYDPRINTF ((stderr, "Stack size increased to %lu\n", 1508 YYDPRINTF ((stderr, "Stack size increased to %lu\n",
1538 (unsigned long int) yystacksize)); 1509 (unsigned long int) yystacksize));
1539 1510
@@ -1543,6 +1514,9 @@ yyparse ()
1543 1514
1544 YYDPRINTF ((stderr, "Entering state %d\n", yystate)); 1515 YYDPRINTF ((stderr, "Entering state %d\n", yystate));
1545 1516
1517 if (yystate == YYFINAL)
1518 YYACCEPT;
1519
1546 goto yybackup; 1520 goto yybackup;
1547 1521
1548/*-----------. 1522/*-----------.
@@ -1551,16 +1525,16 @@ yyparse ()
1551yybackup: 1525yybackup:
1552 1526
1553 /* Do appropriate processing given the current state. Read a 1527 /* Do appropriate processing given the current state. Read a
1554 look-ahead token if we need one and don't already have one. */ 1528 lookahead token if we need one and don't already have one. */
1555 1529
1556 /* First try to decide what to do without reference to look-ahead token. */ 1530 /* First try to decide what to do without reference to lookahead token. */
1557 yyn = yypact[yystate]; 1531 yyn = yypact[yystate];
1558 if (yyn == YYPACT_NINF) 1532 if (yyn == YYPACT_NINF)
1559 goto yydefault; 1533 goto yydefault;
1560 1534
1561 /* Not known => get a look-ahead token if don't already have one. */ 1535 /* Not known => get a lookahead token if don't already have one. */
1562 1536
1563 /* YYCHAR is either YYEMPTY or YYEOF or a valid look-ahead symbol. */ 1537 /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */
1564 if (yychar == YYEMPTY) 1538 if (yychar == YYEMPTY)
1565 { 1539 {
1566 YYDPRINTF ((stderr, "Reading a token: ")); 1540 YYDPRINTF ((stderr, "Reading a token: "));
@@ -1592,20 +1566,16 @@ yybackup:
1592 goto yyreduce; 1566 goto yyreduce;
1593 } 1567 }
1594 1568
1595 if (yyn == YYFINAL)
1596 YYACCEPT;
1597
1598 /* Count tokens shifted since error; after three, turn off error 1569 /* Count tokens shifted since error; after three, turn off error
1599 status. */ 1570 status. */
1600 if (yyerrstatus) 1571 if (yyerrstatus)
1601 yyerrstatus--; 1572 yyerrstatus--;
1602 1573
1603 /* Shift the look-ahead token. */ 1574 /* Shift the lookahead token. */
1604 YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc); 1575 YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
1605 1576
1606 /* Discard the shifted token unless it is eof. */ 1577 /* Discard the shifted token. */
1607 if (yychar != YYEOF) 1578 yychar = YYEMPTY;
1608 yychar = YYEMPTY;
1609 1579
1610 yystate = yyn; 1580 yystate = yyn;
1611 *++yyvsp = yylval; 1581 *++yyvsp = yylval;
@@ -2029,7 +1999,6 @@ yyreduce:
2029 break; 1999 break;
2030 2000
2031 2001
2032/* Line 1267 of yacc.c. */
2033 2002
2034 default: break; 2003 default: break;
2035 } 2004 }
@@ -2041,7 +2010,6 @@ yyreduce:
2041 2010
2042 *++yyvsp = yyval; 2011 *++yyvsp = yyval;
2043 2012
2044
2045 /* Now `shift' the result of the reduction. Determine what state 2013 /* Now `shift' the result of the reduction. Determine what state
2046 that goes to, based on the state we popped back to and the rule 2014 that goes to, based on the state we popped back to and the rule
2047 number reduced by. */ 2015 number reduced by. */
@@ -2106,7 +2074,7 @@ yyerrlab:
2106 2074
2107 if (yyerrstatus == 3) 2075 if (yyerrstatus == 3)
2108 { 2076 {
2109 /* If just tried and failed to reuse look-ahead token after an 2077 /* If just tried and failed to reuse lookahead token after an
2110 error, discard it. */ 2078 error, discard it. */
2111 2079
2112 if (yychar <= YYEOF) 2080 if (yychar <= YYEOF)
@@ -2123,7 +2091,7 @@ yyerrlab:
2123 } 2091 }
2124 } 2092 }
2125 2093
2126 /* Else will try to reuse look-ahead token after shifting the error 2094 /* Else will try to reuse lookahead token after shifting the error
2127 token. */ 2095 token. */
2128 goto yyerrlab1; 2096 goto yyerrlab1;
2129 2097
@@ -2180,9 +2148,6 @@ yyerrlab1:
2180 YY_STACK_PRINT (yyss, yyssp); 2148 YY_STACK_PRINT (yyss, yyssp);
2181 } 2149 }
2182 2150
2183 if (yyn == YYFINAL)
2184 YYACCEPT;
2185
2186 *++yyvsp = yylval; 2151 *++yyvsp = yylval;
2187 2152
2188 2153
@@ -2207,7 +2172,7 @@ yyabortlab:
2207 yyresult = 1; 2172 yyresult = 1;
2208 goto yyreturn; 2173 goto yyreturn;
2209 2174
2210#ifndef yyoverflow 2175#if !defined(yyoverflow) || YYERROR_VERBOSE
2211/*-------------------------------------------------. 2176/*-------------------------------------------------.
2212| yyexhaustedlab -- memory exhaustion comes here. | 2177| yyexhaustedlab -- memory exhaustion comes here. |
2213`-------------------------------------------------*/ 2178`-------------------------------------------------*/
@@ -2218,7 +2183,7 @@ yyexhaustedlab:
2218#endif 2183#endif
2219 2184
2220yyreturn: 2185yyreturn:
2221 if (yychar != YYEOF && yychar != YYEMPTY) 2186 if (yychar != YYEMPTY)
2222 yydestruct ("Cleanup: discarding lookahead", 2187 yydestruct ("Cleanup: discarding lookahead",
2223 yytoken, &yylval); 2188 yytoken, &yylval);
2224 /* Do not reclaim the symbols of the rule which action triggered 2189 /* Do not reclaim the symbols of the rule which action triggered
@@ -2284,7 +2249,7 @@ void conf_parse(const char *name)
2284 sym_set_change_count(1); 2249 sym_set_change_count(1);
2285} 2250}
2286 2251
2287const char *zconf_tokenname(int token) 2252static const char *zconf_tokenname(int token)
2288{ 2253{
2289 switch (token) { 2254 switch (token) {
2290 case T_MENU: return "menu"; 2255 case T_MENU: return "menu";
@@ -2348,7 +2313,7 @@ static void zconferror(const char *err)
2348#endif 2313#endif
2349} 2314}
2350 2315
2351void print_quoted_string(FILE *out, const char *str) 2316static void print_quoted_string(FILE *out, const char *str)
2352{ 2317{
2353 const char *p; 2318 const char *p;
2354 int len; 2319 int len;
@@ -2365,7 +2330,7 @@ void print_quoted_string(FILE *out, const char *str)
2365 putc('"', out); 2330 putc('"', out);
2366} 2331}
2367 2332
2368void print_symbol(FILE *out, struct menu *menu) 2333static void print_symbol(FILE *out, struct menu *menu)
2369{ 2334{
2370 struct symbol *sym = menu->sym; 2335 struct symbol *sym = menu->sym;
2371 struct property *prop; 2336 struct property *prop;
diff --git a/scripts/kconfig/zconf.y b/scripts/kconfig/zconf.y
index 9710b82466f2..8c43491f8cc9 100644
--- a/scripts/kconfig/zconf.y
+++ b/scripts/kconfig/zconf.y
@@ -14,8 +14,6 @@
14#define LKC_DIRECT_LINK 14#define LKC_DIRECT_LINK
15#include "lkc.h" 15#include "lkc.h"
16 16
17#include "zconf.hash.c"
18
19#define printd(mask, fmt...) if (cdebug & (mask)) printf(fmt) 17#define printd(mask, fmt...) if (cdebug & (mask)) printf(fmt)
20 18
21#define PRINTD 0x0001 19#define PRINTD 0x0001
@@ -100,6 +98,11 @@ static struct menu *current_menu, *current_entry;
100 menu_end_menu(); 98 menu_end_menu();
101} if_entry menu_entry choice_entry 99} if_entry menu_entry choice_entry
102 100
101%{
102/* Include zconf.hash.c here so it can see the token constants. */
103#include "zconf.hash.c"
104%}
105
103%% 106%%
104input: stmt_list; 107input: stmt_list;
105 108
@@ -501,7 +504,7 @@ void conf_parse(const char *name)
501 sym_set_change_count(1); 504 sym_set_change_count(1);
502} 505}
503 506
504const char *zconf_tokenname(int token) 507static const char *zconf_tokenname(int token)
505{ 508{
506 switch (token) { 509 switch (token) {
507 case T_MENU: return "menu"; 510 case T_MENU: return "menu";
@@ -565,7 +568,7 @@ static void zconferror(const char *err)
565#endif 568#endif
566} 569}
567 570
568void print_quoted_string(FILE *out, const char *str) 571static void print_quoted_string(FILE *out, const char *str)
569{ 572{
570 const char *p; 573 const char *p;
571 int len; 574 int len;
@@ -582,7 +585,7 @@ void print_quoted_string(FILE *out, const char *str)
582 putc('"', out); 585 putc('"', out);
583} 586}
584 587
585void print_symbol(FILE *out, struct menu *menu) 588static void print_symbol(FILE *out, struct menu *menu)
586{ 589{
587 struct symbol *sym = menu->sym; 590 struct symbol *sym = menu->sym;
588 struct property *prop; 591 struct property *prop;
diff --git a/scripts/kernel-doc b/scripts/kernel-doc
index ea9f8a58678f..241310e59cd6 100755
--- a/scripts/kernel-doc
+++ b/scripts/kernel-doc
@@ -1852,10 +1852,17 @@ sub tracepoint_munge($) {
1852 my $tracepointname = 0; 1852 my $tracepointname = 0;
1853 my $tracepointargs = 0; 1853 my $tracepointargs = 0;
1854 1854
1855 if($prototype =~ m/TRACE_EVENT\((.*?),/) { 1855 if ($prototype =~ m/TRACE_EVENT\((.*?),/) {
1856 $tracepointname = $1; 1856 $tracepointname = $1;
1857 } 1857 }
1858 if($prototype =~ m/TP_PROTO\((.*?)\)/) { 1858 if ($prototype =~ m/DEFINE_SINGLE_EVENT\((.*?),/) {
1859 $tracepointname = $1;
1860 }
1861 if ($prototype =~ m/DEFINE_EVENT\((.*?),(.*?),/) {
1862 $tracepointname = $2;
1863 }
1864 $tracepointname =~ s/^\s+//; #strip leading whitespace
1865 if ($prototype =~ m/TP_PROTO\((.*?)\)/) {
1859 $tracepointargs = $1; 1866 $tracepointargs = $1;
1860 } 1867 }
1861 if (($tracepointname eq 0) || ($tracepointargs eq 0)) { 1868 if (($tracepointname eq 0) || ($tracepointargs eq 0)) {
@@ -1920,7 +1927,9 @@ sub process_state3_function($$) {
1920 if ($prototype =~ /SYSCALL_DEFINE/) { 1927 if ($prototype =~ /SYSCALL_DEFINE/) {
1921 syscall_munge(); 1928 syscall_munge();
1922 } 1929 }
1923 if ($prototype =~ /TRACE_EVENT/) { 1930 if ($prototype =~ /TRACE_EVENT/ || $prototype =~ /DEFINE_EVENT/ ||
1931 $prototype =~ /DEFINE_SINGLE_EVENT/)
1932 {
1924 tracepoint_munge($file); 1933 tracepoint_munge($file);
1925 } 1934 }
1926 dump_function($prototype, $file); 1935 dump_function($prototype, $file);
diff --git a/scripts/recordmcount.pl b/scripts/recordmcount.pl
index 090d300d7394..f0d14452632b 100755
--- a/scripts/recordmcount.pl
+++ b/scripts/recordmcount.pl
@@ -6,77 +6,93 @@
6# all the offsets to the calls to mcount. 6# all the offsets to the calls to mcount.
7# 7#
8# 8#
9# What we want to end up with is a section in vmlinux called 9# What we want to end up with this is that each object file will have a
10# __mcount_loc that contains a list of pointers to all the 10# section called __mcount_loc that will hold the list of pointers to mcount
11# call sites in the kernel that call mcount. Later on boot up, the kernel 11# callers. After final linking, the vmlinux will have within .init.data the
12# will read this list, save the locations and turn them into nops. 12# list of all callers to mcount between __start_mcount_loc and __stop_mcount_loc.
13# When tracing or profiling is later enabled, these locations will then 13# Later on boot up, the kernel will read this list, save the locations and turn
14# be converted back to pointers to some function. 14# them into nops. When tracing or profiling is later enabled, these locations
15# will then be converted back to pointers to some function.
15# 16#
16# This is no easy feat. This script is called just after the original 17# This is no easy feat. This script is called just after the original
17# object is compiled and before it is linked. 18# object is compiled and before it is linked.
18# 19#
19# The references to the call sites are offsets from the section of text 20# When parse this object file using 'objdump', the references to the call
20# that the call site is in. Hence, all functions in a section that 21# sites are offsets from the section that the call site is in. Hence, all
21# has a call site to mcount, will have the offset from the beginning of 22# functions in a section that has a call site to mcount, will have the
22# the section and not the beginning of the function. 23# offset from the beginning of the section and not the beginning of the
24# function.
25#
26# But where this section will reside finally in vmlinx is undetermined at
27# this point. So we can't use this kind of offsets to record the final
28# address of this call site.
29#
30# The trick is to change the call offset referring the start of a section to
31# referring a function symbol in this section. During the link step, 'ld' will
32# compute the final address according to the information we record.
23# 33#
24# The trick is to find a way to record the beginning of the section.
25# The way we do this is to look at the first function in the section
26# which will also be the location of that section after final link.
27# e.g. 34# e.g.
28# 35#
29# .section ".sched.text", "ax" 36# .section ".sched.text", "ax"
30# .globl my_func
31# my_func:
32# [...] 37# [...]
33# call mcount (offset: 0x5) 38# func1:
39# [...]
40# call mcount (offset: 0x10)
34# [...] 41# [...]
35# ret 42# ret
36# other_func: 43# .globl fun2
44# func2: (offset: 0x20)
37# [...] 45# [...]
38# call mcount (offset: 0x1b) 46# [...]
47# ret
48# func3:
49# [...]
50# call mcount (offset: 0x30)
39# [...] 51# [...]
40# 52#
41# Both relocation offsets for the mcounts in the above example will be 53# Both relocation offsets for the mcounts in the above example will be
42# offset from .sched.text. If we make another file called tmp.s with: 54# offset from .sched.text. If we choose global symbol func2 as a reference and
55# make another file called tmp.s with the new offsets:
43# 56#
44# .section __mcount_loc 57# .section __mcount_loc
45# .quad my_func + 0x5 58# .quad func2 - 0x10
46# .quad my_func + 0x1b 59# .quad func2 + 0x10
47# 60#
48# We can then compile this tmp.s into tmp.o, and link it to the original 61# We can then compile this tmp.s into tmp.o, and link it back to the original
49# object. 62# object.
50# 63#
51# But this gets hard if my_func is not globl (a static function). 64# In our algorithm, we will choose the first global function we meet in this
52# In such a case we have: 65# section as the reference. But this gets hard if there is no global functions
66# in this section. In such a case we have to select a local one. E.g. func1:
53# 67#
54# .section ".sched.text", "ax" 68# .section ".sched.text", "ax"
55# my_func: 69# func1:
56# [...] 70# [...]
57# call mcount (offset: 0x5) 71# call mcount (offset: 0x10)
58# [...] 72# [...]
59# ret 73# ret
60# other_func: 74# func2:
61# [...] 75# [...]
62# call mcount (offset: 0x1b) 76# call mcount (offset: 0x20)
63# [...] 77# [...]
78# .section "other.section"
64# 79#
65# If we make the tmp.s the same as above, when we link together with 80# If we make the tmp.s the same as above, when we link together with
66# the original object, we will end up with two symbols for my_func: 81# the original object, we will end up with two symbols for func1:
67# one local, one global. After final compile, we will end up with 82# one local, one global. After final compile, we will end up with
68# an undefined reference to my_func. 83# an undefined reference to func1 or a wrong reference to another global
84# func1 in other files.
69# 85#
70# Since local objects can reference local variables, we need to find 86# Since local objects can reference local variables, we need to find
71# a way to make tmp.o reference the local objects of the original object 87# a way to make tmp.o reference the local objects of the original object
72# file after it is linked together. To do this, we convert the my_func 88# file after it is linked together. To do this, we convert func1
73# into a global symbol before linking tmp.o. Then after we link tmp.o 89# into a global symbol before linking tmp.o. Then after we link tmp.o
74# we will only have a single symbol for my_func that is global. 90# we will only have a single symbol for func1 that is global.
75# We can convert my_func back into a local symbol and we are done. 91# We can convert func1 back into a local symbol and we are done.
76# 92#
77# Here are the steps we take: 93# Here are the steps we take:
78# 94#
79# 1) Record all the local symbols by using 'nm' 95# 1) Record all the local and weak symbols by using 'nm'
80# 2) Use objdump to find all the call site offsets and sections for 96# 2) Use objdump to find all the call site offsets and sections for
81# mcount. 97# mcount.
82# 3) Compile the list into its own object. 98# 3) Compile the list into its own object.
@@ -86,10 +102,8 @@
86# 6) Link together this new object with the list object. 102# 6) Link together this new object with the list object.
87# 7) Convert the local functions back to local symbols and rename 103# 7) Convert the local functions back to local symbols and rename
88# the result as the original object. 104# the result as the original object.
89# End.
90# 8) Link the object with the list object. 105# 8) Link the object with the list object.
91# 9) Move the result back to the original object. 106# 9) Move the result back to the original object.
92# End.
93# 107#
94 108
95use strict; 109use strict;
@@ -99,7 +113,7 @@ $P =~ s@.*/@@g;
99 113
100my $V = '0.1'; 114my $V = '0.1';
101 115
102if ($#ARGV < 7) { 116if ($#ARGV != 10) {
103 print "usage: $P arch bits objdump objcopy cc ld nm rm mv is_module inputfile\n"; 117 print "usage: $P arch bits objdump objcopy cc ld nm rm mv is_module inputfile\n";
104 print "version: $V\n"; 118 print "version: $V\n";
105 exit(1); 119 exit(1);
@@ -109,7 +123,7 @@ my ($arch, $bits, $objdump, $objcopy, $cc,
109 $ld, $nm, $rm, $mv, $is_module, $inputfile) = @ARGV; 123 $ld, $nm, $rm, $mv, $is_module, $inputfile) = @ARGV;
110 124
111# This file refers to mcount and shouldn't be ftraced, so lets' ignore it 125# This file refers to mcount and shouldn't be ftraced, so lets' ignore it
112if ($inputfile eq "kernel/trace/ftrace.o") { 126if ($inputfile =~ m,kernel/trace/ftrace\.o$,) {
113 exit(0); 127 exit(0);
114} 128}
115 129
@@ -119,6 +133,7 @@ my %text_sections = (
119 ".sched.text" => 1, 133 ".sched.text" => 1,
120 ".spinlock.text" => 1, 134 ".spinlock.text" => 1,
121 ".irqentry.text" => 1, 135 ".irqentry.text" => 1,
136 ".text.unlikely" => 1,
122); 137);
123 138
124$objdump = "objdump" if ((length $objdump) == 0); 139$objdump = "objdump" if ((length $objdump) == 0);
@@ -137,13 +152,47 @@ my %weak; # List of weak functions
137my %convert; # List of local functions used that needs conversion 152my %convert; # List of local functions used that needs conversion
138 153
139my $type; 154my $type;
140my $nm_regex; # Find the local functions (return function) 155my $local_regex; # Match a local function (return function)
156my $weak_regex; # Match a weak function (return function)
141my $section_regex; # Find the start of a section 157my $section_regex; # Find the start of a section
142my $function_regex; # Find the name of a function 158my $function_regex; # Find the name of a function
143 # (return offset and func name) 159 # (return offset and func name)
144my $mcount_regex; # Find the call site to mcount (return offset) 160my $mcount_regex; # Find the call site to mcount (return offset)
145my $alignment; # The .align value to use for $mcount_section 161my $alignment; # The .align value to use for $mcount_section
146my $section_type; # Section header plus possible alignment command 162my $section_type; # Section header plus possible alignment command
163my $can_use_local = 0; # If we can use local function references
164
165# Shut up recordmcount if user has older objcopy
166my $quiet_recordmcount = ".tmp_quiet_recordmcount";
167my $print_warning = 1;
168$print_warning = 0 if ( -f $quiet_recordmcount);
169
170##
171# check_objcopy - whether objcopy supports --globalize-symbols
172#
173# --globalize-symbols came out in 2.17, we must test the version
174# of objcopy, and if it is less than 2.17, then we can not
175# record local functions.
176sub check_objcopy
177{
178 open (IN, "$objcopy --version |") or die "error running $objcopy";
179 while (<IN>) {
180 if (/objcopy.*\s(\d+)\.(\d+)/) {
181 $can_use_local = 1 if ($1 > 2 || ($1 == 2 && $2 >= 17));
182 last;
183 }
184 }
185 close (IN);
186
187 if (!$can_use_local && $print_warning) {
188 print STDERR "WARNING: could not find objcopy version or version " .
189 "is less than 2.17.\n" .
190 "\tLocal function references are disabled.\n";
191 open (QUIET, ">$quiet_recordmcount");
192 printf QUIET "Disables the warning from recordmcount.pl\n";
193 close QUIET;
194 }
195}
147 196
148if ($arch eq "x86") { 197if ($arch eq "x86") {
149 if ($bits == 64) { 198 if ($bits == 64) {
@@ -157,7 +206,8 @@ if ($arch eq "x86") {
157# We base the defaults off of i386, the other archs may 206# We base the defaults off of i386, the other archs may
158# feel free to change them in the below if statements. 207# feel free to change them in the below if statements.
159# 208#
160$nm_regex = "^[0-9a-fA-F]+\\s+t\\s+(\\S+)"; 209$local_regex = "^[0-9a-fA-F]+\\s+t\\s+(\\S+)";
210$weak_regex = "^[0-9a-fA-F]+\\s+([wW])\\s+(\\S+)";
161$section_regex = "Disassembly of section\\s+(\\S+):"; 211$section_regex = "Disassembly of section\\s+(\\S+):";
162$function_regex = "^([0-9a-fA-F]+)\\s+<(.*?)>:"; 212$function_regex = "^([0-9a-fA-F]+)\\s+<(.*?)>:";
163$mcount_regex = "^\\s*([0-9a-fA-F]+):.*\\smcount\$"; 213$mcount_regex = "^\\s*([0-9a-fA-F]+):.*\\smcount\$";
@@ -206,7 +256,7 @@ if ($arch eq "x86_64") {
206 $cc .= " -m32"; 256 $cc .= " -m32";
207 257
208} elsif ($arch eq "powerpc") { 258} elsif ($arch eq "powerpc") {
209 $nm_regex = "^[0-9a-fA-F]+\\s+t\\s+(\\.?\\S+)"; 259 $local_regex = "^[0-9a-fA-F]+\\s+t\\s+(\\.?\\S+)";
210 $function_regex = "^([0-9a-fA-F]+)\\s+<(\\.?.*?)>:"; 260 $function_regex = "^([0-9a-fA-F]+)\\s+<(\\.?.*?)>:";
211 $mcount_regex = "^\\s*([0-9a-fA-F]+):.*\\s\\.?_mcount\$"; 261 $mcount_regex = "^\\s*([0-9a-fA-F]+):.*\\s\\.?_mcount\$";
212 262
@@ -278,44 +328,17 @@ if ($filename =~ m,^(.*)(\.\S),) {
278my $mcount_s = $dirname . "/.tmp_mc_" . $prefix . ".s"; 328my $mcount_s = $dirname . "/.tmp_mc_" . $prefix . ".s";
279my $mcount_o = $dirname . "/.tmp_mc_" . $prefix . ".o"; 329my $mcount_o = $dirname . "/.tmp_mc_" . $prefix . ".o";
280 330
281# 331check_objcopy();
282# --globalize-symbols came out in 2.17, we must test the version
283# of objcopy, and if it is less than 2.17, then we can not
284# record local functions.
285my $use_locals = 01;
286my $local_warn_once = 0;
287my $found_version = 0;
288
289open (IN, "$objcopy --version |") || die "error running $objcopy";
290while (<IN>) {
291 if (/objcopy.*\s(\d+)\.(\d+)/) {
292 my $major = $1;
293 my $minor = $2;
294
295 $found_version = 1;
296 if ($major < 2 ||
297 ($major == 2 && $minor < 17)) {
298 $use_locals = 0;
299 }
300 last;
301 }
302}
303close (IN);
304
305if (!$found_version) {
306 print STDERR "WARNING: could not find objcopy version.\n" .
307 "\tDisabling local function references.\n";
308}
309 332
310# 333#
311# Step 1: find all the local (static functions) and weak symbols. 334# Step 1: find all the local (static functions) and weak symbols.
312# 't' is local, 'w/W' is weak (we never use a weak function) 335# 't' is local, 'w/W' is weak
313# 336#
314open (IN, "$nm $inputfile|") || die "error running $nm"; 337open (IN, "$nm $inputfile|") || die "error running $nm";
315while (<IN>) { 338while (<IN>) {
316 if (/$nm_regex/) { 339 if (/$local_regex/) {
317 $locals{$1} = 1; 340 $locals{$1} = 1;
318 } elsif (/^[0-9a-fA-F]+\s+([wW])\s+(\S+)/) { 341 } elsif (/$weak_regex/) {
319 $weak{$2} = $1; 342 $weak{$2} = $1;
320 } 343 }
321} 344}
@@ -333,26 +356,20 @@ my $offset = 0; # offset of ref_func to section beginning
333# 356#
334sub update_funcs 357sub update_funcs
335{ 358{
336 return if ($#offsets < 0); 359 return unless ($ref_func and @offsets);
337
338 defined($ref_func) || die "No function to reference";
339 360
340 # A section only had a weak function, to represent it. 361 # Sanity check on weak function. A weak function may be overwritten by
341 # Unfortunately, a weak function may be overwritten by another 362 # another function of the same name, making all these offsets incorrect.
342 # function of the same name, making all these offsets incorrect.
343 # To be safe, we simply print a warning and bail.
344 if (defined $weak{$ref_func}) { 363 if (defined $weak{$ref_func}) {
345 print STDERR 364 die "$inputfile: ERROR: referencing weak function" .
346 "$inputfile: WARNING: referencing weak function" .
347 " $ref_func for mcount\n"; 365 " $ref_func for mcount\n";
348 return;
349 } 366 }
350 367
351 # is this function static? If so, note this fact. 368 # is this function static? If so, note this fact.
352 if (defined $locals{$ref_func}) { 369 if (defined $locals{$ref_func}) {
353 370
354 # only use locals if objcopy supports globalize-symbols 371 # only use locals if objcopy supports globalize-symbols
355 if (!$use_locals) { 372 if (!$can_use_local) {
356 return; 373 return;
357 } 374 }
358 $convert{$ref_func} = 1; 375 $convert{$ref_func} = 1;
@@ -378,9 +395,27 @@ open(IN, "$objdump -hdr $inputfile|") || die "error running $objdump";
378 395
379my $text; 396my $text;
380 397
398
399# read headers first
381my $read_headers = 1; 400my $read_headers = 1;
382 401
383while (<IN>) { 402while (<IN>) {
403
404 if ($read_headers && /$mcount_section/) {
405 #
406 # Somehow the make process can execute this script on an
407 # object twice. If it does, we would duplicate the mcount
408 # section and it will cause the function tracer self test
409 # to fail. Check if the mcount section exists, and if it does,
410 # warn and exit.
411 #
412 print STDERR "ERROR: $mcount_section already in $inputfile\n" .
413 "\tThis may be an indication that your build is corrupted.\n" .
414 "\tDelete $inputfile and try again. If the same object file\n" .
415 "\tstill causes an issue, then disable CONFIG_DYNAMIC_FTRACE.\n";
416 exit(-1);
417 }
418
384 # is it a section? 419 # is it a section?
385 if (/$section_regex/) { 420 if (/$section_regex/) {
386 $read_headers = 0; 421 $read_headers = 0;
@@ -392,7 +427,7 @@ while (<IN>) {
392 $read_function = 0; 427 $read_function = 0;
393 } 428 }
394 # print out any recorded offsets 429 # print out any recorded offsets
395 update_funcs() if (defined($ref_func)); 430 update_funcs();
396 431
397 # reset all markers and arrays 432 # reset all markers and arrays
398 $text_found = 0; 433 $text_found = 0;
@@ -421,21 +456,7 @@ while (<IN>) {
421 $offset = hex $1; 456 $offset = hex $1;
422 } 457 }
423 } 458 }
424 } elsif ($read_headers && /$mcount_section/) {
425 #
426 # Somehow the make process can execute this script on an
427 # object twice. If it does, we would duplicate the mcount
428 # section and it will cause the function tracer self test
429 # to fail. Check if the mcount section exists, and if it does,
430 # warn and exit.
431 #
432 print STDERR "ERROR: $mcount_section already in $inputfile\n" .
433 "\tThis may be an indication that your build is corrupted.\n" .
434 "\tDelete $inputfile and try again. If the same object file\n" .
435 "\tstill causes an issue, then disable CONFIG_DYNAMIC_FTRACE.\n";
436 exit(-1);
437 } 459 }
438
439 # is this a call site to mcount? If so, record it to print later 460 # is this a call site to mcount? If so, record it to print later
440 if ($text_found && /$mcount_regex/) { 461 if ($text_found && /$mcount_regex/) {
441 $offsets[$#offsets + 1] = hex $1; 462 $offsets[$#offsets + 1] = hex $1;
@@ -443,7 +464,7 @@ while (<IN>) {
443} 464}
444 465
445# dump out anymore offsets that may have been found 466# dump out anymore offsets that may have been found
446update_funcs() if (defined($ref_func)); 467update_funcs();
447 468
448# If we did not find any mcount callers, we are done (do nothing). 469# If we did not find any mcount callers, we are done (do nothing).
449if (!$opened) { 470if (!$opened) {
diff --git a/scripts/selinux/Makefile b/scripts/selinux/Makefile
index ca4b1ec01822..e8049da1831f 100644
--- a/scripts/selinux/Makefile
+++ b/scripts/selinux/Makefile
@@ -1,2 +1,2 @@
1subdir-y := mdp 1subdir-y := mdp genheaders
2subdir- += mdp 2subdir- += mdp genheaders
diff --git a/scripts/selinux/genheaders/.gitignore b/scripts/selinux/genheaders/.gitignore
new file mode 100644
index 000000000000..4c0b646ff8d5
--- /dev/null
+++ b/scripts/selinux/genheaders/.gitignore
@@ -0,0 +1 @@
genheaders
diff --git a/scripts/selinux/genheaders/Makefile b/scripts/selinux/genheaders/Makefile
new file mode 100644
index 000000000000..417b165008ee
--- /dev/null
+++ b/scripts/selinux/genheaders/Makefile
@@ -0,0 +1,5 @@
1hostprogs-y := genheaders
2HOST_EXTRACFLAGS += -Isecurity/selinux/include
3
4always := $(hostprogs-y)
5clean-files := $(hostprogs-y)
diff --git a/scripts/selinux/genheaders/genheaders.c b/scripts/selinux/genheaders/genheaders.c
new file mode 100644
index 000000000000..24626968055d
--- /dev/null
+++ b/scripts/selinux/genheaders/genheaders.c
@@ -0,0 +1,118 @@
1#include <stdio.h>
2#include <stdlib.h>
3#include <unistd.h>
4#include <string.h>
5#include <errno.h>
6#include <ctype.h>
7
8struct security_class_mapping {
9 const char *name;
10 const char *perms[sizeof(unsigned) * 8 + 1];
11};
12
13#include "classmap.h"
14#include "initial_sid_to_string.h"
15
16#define max(x, y) (((int)(x) > (int)(y)) ? x : y)
17
18const char *progname;
19
20static void usage(void)
21{
22 printf("usage: %s flask.h av_permissions.h\n", progname);
23 exit(1);
24}
25
26static char *stoupperx(const char *s)
27{
28 char *s2 = strdup(s);
29 char *p;
30
31 if (!s2) {
32 fprintf(stderr, "%s: out of memory\n", progname);
33 exit(3);
34 }
35
36 for (p = s2; *p; p++)
37 *p = toupper(*p);
38 return s2;
39}
40
41int main(int argc, char *argv[])
42{
43 int i, j, k;
44 int isids_len;
45 FILE *fout;
46
47 progname = argv[0];
48
49 if (argc < 3)
50 usage();
51
52 fout = fopen(argv[1], "w");
53 if (!fout) {
54 fprintf(stderr, "Could not open %s for writing: %s\n",
55 argv[1], strerror(errno));
56 exit(2);
57 }
58
59 for (i = 0; secclass_map[i].name; i++) {
60 struct security_class_mapping *map = &secclass_map[i];
61 map->name = stoupperx(map->name);
62 for (j = 0; map->perms[j]; j++)
63 map->perms[j] = stoupperx(map->perms[j]);
64 }
65
66 isids_len = sizeof(initial_sid_to_string) / sizeof (char *);
67 for (i = 1; i < isids_len; i++)
68 initial_sid_to_string[i] = stoupperx(initial_sid_to_string[i]);
69
70 fprintf(fout, "/* This file is automatically generated. Do not edit. */\n");
71 fprintf(fout, "#ifndef _SELINUX_FLASK_H_\n#define _SELINUX_FLASK_H_\n\n");
72
73 for (i = 0; secclass_map[i].name; i++) {
74 struct security_class_mapping *map = &secclass_map[i];
75 fprintf(fout, "#define SECCLASS_%s", map->name);
76 for (j = 0; j < max(1, 40 - strlen(map->name)); j++)
77 fprintf(fout, " ");
78 fprintf(fout, "%2d\n", i+1);
79 }
80
81 fprintf(fout, "\n");
82
83 for (i = 1; i < isids_len; i++) {
84 char *s = initial_sid_to_string[i];
85 fprintf(fout, "#define SECINITSID_%s", s);
86 for (j = 0; j < max(1, 40 - strlen(s)); j++)
87 fprintf(fout, " ");
88 fprintf(fout, "%2d\n", i);
89 }
90 fprintf(fout, "\n#define SECINITSID_NUM %d\n", i-1);
91 fprintf(fout, "\n#endif\n");
92 fclose(fout);
93
94 fout = fopen(argv[2], "w");
95 if (!fout) {
96 fprintf(stderr, "Could not open %s for writing: %s\n",
97 argv[2], strerror(errno));
98 exit(4);
99 }
100
101 fprintf(fout, "/* This file is automatically generated. Do not edit. */\n");
102 fprintf(fout, "#ifndef _SELINUX_AV_PERMISSIONS_H_\n#define _SELINUX_AV_PERMISSIONS_H_\n\n");
103
104 for (i = 0; secclass_map[i].name; i++) {
105 struct security_class_mapping *map = &secclass_map[i];
106 for (j = 0; map->perms[j]; j++) {
107 fprintf(fout, "#define %s__%s", map->name,
108 map->perms[j]);
109 for (k = 0; k < max(1, 40 - strlen(map->name) - strlen(map->perms[j])); k++)
110 fprintf(fout, " ");
111 fprintf(fout, "0x%08xUL\n", (1<<j));
112 }
113 }
114
115 fprintf(fout, "\n#endif\n");
116 fclose(fout);
117 exit(0);
118}
diff --git a/scripts/selinux/mdp/mdp.c b/scripts/selinux/mdp/mdp.c
index b4ced8562587..62b34ce1f50d 100644
--- a/scripts/selinux/mdp/mdp.c
+++ b/scripts/selinux/mdp/mdp.c
@@ -29,86 +29,27 @@
29#include <unistd.h> 29#include <unistd.h>
30#include <string.h> 30#include <string.h>
31 31
32#include "flask.h"
33
34static void usage(char *name) 32static void usage(char *name)
35{ 33{
36 printf("usage: %s [-m] policy_file context_file\n", name); 34 printf("usage: %s [-m] policy_file context_file\n", name);
37 exit(1); 35 exit(1);
38} 36}
39 37
40static void find_common_name(char *cname, char *dest, int len) 38/* Class/perm mapping support */
41{ 39struct security_class_mapping {
42 char *start, *end; 40 const char *name;
43 41 const char *perms[sizeof(unsigned) * 8 + 1];
44 start = strchr(cname, '_')+1;
45 end = strchr(start, '_');
46 if (!start || !end || start-cname > len || end-start > len) {
47 printf("Error with commons defines\n");
48 exit(1);
49 }
50 strncpy(dest, start, end-start);
51 dest[end-start] = '\0';
52}
53
54#define S_(x) x,
55static char *classlist[] = {
56#include "class_to_string.h"
57 NULL
58}; 42};
59#undef S_
60 43
44#include "classmap.h"
61#include "initial_sid_to_string.h" 45#include "initial_sid_to_string.h"
62 46
63#define TB_(x) char *x[] = {
64#define TE_(x) NULL };
65#define S_(x) x,
66#include "common_perm_to_string.h"
67#undef TB_
68#undef TE_
69#undef S_
70
71struct common {
72 char *cname;
73 char **perms;
74};
75struct common common[] = {
76#define TB_(x) { #x, x },
77#define S_(x)
78#define TE_(x)
79#include "common_perm_to_string.h"
80#undef TB_
81#undef TE_
82#undef S_
83};
84
85#define S_(x, y, z) {x, #y},
86struct av_inherit {
87 int class;
88 char *common;
89};
90struct av_inherit av_inherit[] = {
91#include "av_inherit.h"
92};
93#undef S_
94
95#include "av_permissions.h"
96#define S_(x, y, z) {x, y, z},
97struct av_perms {
98 int class;
99 int perm_i;
100 char *perm_s;
101};
102struct av_perms av_perms[] = {
103#include "av_perm_to_string.h"
104};
105#undef S_
106
107int main(int argc, char *argv[]) 47int main(int argc, char *argv[])
108{ 48{
109 int i, j, mls = 0; 49 int i, j, mls = 0;
50 int initial_sid_to_string_len;
110 char **arg, *polout, *ctxout; 51 char **arg, *polout, *ctxout;
111 int classlist_len, initial_sid_to_string_len; 52
112 FILE *fout; 53 FILE *fout;
113 54
114 if (argc < 3) 55 if (argc < 3)
@@ -127,64 +68,25 @@ int main(int argc, char *argv[])
127 usage(argv[0]); 68 usage(argv[0]);
128 } 69 }
129 70
130 classlist_len = sizeof(classlist) / sizeof(char *);
131 /* print out the classes */ 71 /* print out the classes */
132 for (i=1; i < classlist_len; i++) { 72 for (i = 0; secclass_map[i].name; i++)
133 if(classlist[i]) 73 fprintf(fout, "class %s\n", secclass_map[i].name);
134 fprintf(fout, "class %s\n", classlist[i]);
135 else
136 fprintf(fout, "class user%d\n", i);
137 }
138 fprintf(fout, "\n"); 74 fprintf(fout, "\n");
139 75
140 initial_sid_to_string_len = sizeof(initial_sid_to_string) / sizeof (char *); 76 initial_sid_to_string_len = sizeof(initial_sid_to_string) / sizeof (char *);
141 /* print out the sids */ 77 /* print out the sids */
142 for (i=1; i < initial_sid_to_string_len; i++) 78 for (i = 1; i < initial_sid_to_string_len; i++)
143 fprintf(fout, "sid %s\n", initial_sid_to_string[i]); 79 fprintf(fout, "sid %s\n", initial_sid_to_string[i]);
144 fprintf(fout, "\n"); 80 fprintf(fout, "\n");
145 81
146 /* print out the commons */
147 for (i=0; i< sizeof(common)/sizeof(struct common); i++) {
148 char cname[101];
149 find_common_name(common[i].cname, cname, 100);
150 cname[100] = '\0';
151 fprintf(fout, "common %s\n{\n", cname);
152 for (j=0; common[i].perms[j]; j++)
153 fprintf(fout, "\t%s\n", common[i].perms[j]);
154 fprintf(fout, "}\n\n");
155 }
156 fprintf(fout, "\n");
157
158 /* print out the class permissions */ 82 /* print out the class permissions */
159 for (i=1; i < classlist_len; i++) { 83 for (i = 0; secclass_map[i].name; i++) {
160 if (classlist[i]) { 84 struct security_class_mapping *map = &secclass_map[i];
161 int firstperm = -1, numperms = 0; 85 fprintf(fout, "class %s\n", map->name);
162 86 fprintf(fout, "{\n");
163 fprintf(fout, "class %s\n", classlist[i]); 87 for (j = 0; map->perms[j]; j++)
164 /* does it inherit from a common? */ 88 fprintf(fout, "\t%s\n", map->perms[j]);
165 for (j=0; j < sizeof(av_inherit)/sizeof(struct av_inherit); j++) 89 fprintf(fout, "}\n\n");
166 if (av_inherit[j].class == i)
167 fprintf(fout, "inherits %s\n", av_inherit[j].common);
168
169 for (j=0; j < sizeof(av_perms)/sizeof(struct av_perms); j++) {
170 if (av_perms[j].class == i) {
171 if (firstperm == -1)
172 firstperm = j;
173 numperms++;
174 }
175 }
176 if (!numperms) {
177 fprintf(fout, "\n");
178 continue;
179 }
180
181 fprintf(fout, "{\n");
182 /* print out the av_perms */
183 for (j=0; j < numperms; j++) {
184 fprintf(fout, "\t%s\n", av_perms[firstperm+j].perm_s);
185 }
186 fprintf(fout, "}\n\n");
187 }
188 } 90 }
189 fprintf(fout, "\n"); 91 fprintf(fout, "\n");
190 92
@@ -197,31 +99,34 @@ int main(int argc, char *argv[])
197 /* types, roles, and allows */ 99 /* types, roles, and allows */
198 fprintf(fout, "type base_t;\n"); 100 fprintf(fout, "type base_t;\n");
199 fprintf(fout, "role base_r types { base_t };\n"); 101 fprintf(fout, "role base_r types { base_t };\n");
200 for (i=1; i < classlist_len; i++) { 102 for (i = 0; secclass_map[i].name; i++)
201 if (classlist[i]) 103 fprintf(fout, "allow base_t base_t:%s *;\n",
202 fprintf(fout, "allow base_t base_t:%s *;\n", classlist[i]); 104 secclass_map[i].name);
203 else
204 fprintf(fout, "allow base_t base_t:user%d *;\n", i);
205 }
206 fprintf(fout, "user user_u roles { base_r };\n"); 105 fprintf(fout, "user user_u roles { base_r };\n");
207 fprintf(fout, "\n"); 106 fprintf(fout, "\n");
208 107
209 /* default sids */ 108 /* default sids */
210 for (i=1; i < initial_sid_to_string_len; i++) 109 for (i = 1; i < initial_sid_to_string_len; i++)
211 fprintf(fout, "sid %s user_u:base_r:base_t\n", initial_sid_to_string[i]); 110 fprintf(fout, "sid %s user_u:base_r:base_t\n", initial_sid_to_string[i]);
212 fprintf(fout, "\n"); 111 fprintf(fout, "\n");
213 112
214
215 fprintf(fout, "fs_use_xattr ext2 user_u:base_r:base_t;\n"); 113 fprintf(fout, "fs_use_xattr ext2 user_u:base_r:base_t;\n");
216 fprintf(fout, "fs_use_xattr ext3 user_u:base_r:base_t;\n"); 114 fprintf(fout, "fs_use_xattr ext3 user_u:base_r:base_t;\n");
115 fprintf(fout, "fs_use_xattr ext4 user_u:base_r:base_t;\n");
217 fprintf(fout, "fs_use_xattr jfs user_u:base_r:base_t;\n"); 116 fprintf(fout, "fs_use_xattr jfs user_u:base_r:base_t;\n");
218 fprintf(fout, "fs_use_xattr xfs user_u:base_r:base_t;\n"); 117 fprintf(fout, "fs_use_xattr xfs user_u:base_r:base_t;\n");
219 fprintf(fout, "fs_use_xattr reiserfs user_u:base_r:base_t;\n"); 118 fprintf(fout, "fs_use_xattr reiserfs user_u:base_r:base_t;\n");
119 fprintf(fout, "fs_use_xattr jffs2 user_u:base_r:base_t;\n");
120 fprintf(fout, "fs_use_xattr gfs2 user_u:base_r:base_t;\n");
121 fprintf(fout, "fs_use_xattr lustre user_u:base_r:base_t;\n");
220 122
123 fprintf(fout, "fs_use_task eventpollfs user_u:base_r:base_t;\n");
221 fprintf(fout, "fs_use_task pipefs user_u:base_r:base_t;\n"); 124 fprintf(fout, "fs_use_task pipefs user_u:base_r:base_t;\n");
222 fprintf(fout, "fs_use_task sockfs user_u:base_r:base_t;\n"); 125 fprintf(fout, "fs_use_task sockfs user_u:base_r:base_t;\n");
223 126
127 fprintf(fout, "fs_use_trans mqueue user_u:base_r:base_t;\n");
224 fprintf(fout, "fs_use_trans devpts user_u:base_r:base_t;\n"); 128 fprintf(fout, "fs_use_trans devpts user_u:base_r:base_t;\n");
129 fprintf(fout, "fs_use_trans hugetlbfs user_u:base_r:base_t;\n");
225 fprintf(fout, "fs_use_trans tmpfs user_u:base_r:base_t;\n"); 130 fprintf(fout, "fs_use_trans tmpfs user_u:base_r:base_t;\n");
226 fprintf(fout, "fs_use_trans shm user_u:base_r:base_t;\n"); 131 fprintf(fout, "fs_use_trans shm user_u:base_r:base_t;\n");
227 132
diff --git a/security/Kconfig b/security/Kconfig
index fb363cd81cf6..226b9556b25f 100644
--- a/security/Kconfig
+++ b/security/Kconfig
@@ -91,28 +91,6 @@ config SECURITY_PATH
91 implement pathname based access controls. 91 implement pathname based access controls.
92 If you are unsure how to answer this question, answer N. 92 If you are unsure how to answer this question, answer N.
93 93
94config SECURITY_FILE_CAPABILITIES
95 bool "File POSIX Capabilities"
96 default n
97 help
98 This enables filesystem capabilities, allowing you to give
99 binaries a subset of root's powers without using setuid 0.
100
101 If in doubt, answer N.
102
103config SECURITY_ROOTPLUG
104 bool "Root Plug Support"
105 depends on USB=y && SECURITY
106 help
107 This is a sample LSM module that should only be used as such.
108 It prevents any programs running with egid == 0 if a specific
109 USB device is not present in the system.
110
111 See <http://www.linuxjournal.com/article.php?sid=6279> for
112 more information about this module.
113
114 If you are unsure how to answer this question, answer N.
115
116config INTEL_TXT 94config INTEL_TXT
117 bool "Enable Intel(R) Trusted Execution Technology (Intel(R) TXT)" 95 bool "Enable Intel(R) Trusted Execution Technology (Intel(R) TXT)"
118 depends on HAVE_INTEL_TXT 96 depends on HAVE_INTEL_TXT
@@ -165,5 +143,37 @@ source security/tomoyo/Kconfig
165 143
166source security/integrity/ima/Kconfig 144source security/integrity/ima/Kconfig
167 145
146choice
147 prompt "Default security module"
148 default DEFAULT_SECURITY_SELINUX if SECURITY_SELINUX
149 default DEFAULT_SECURITY_SMACK if SECURITY_SMACK
150 default DEFAULT_SECURITY_TOMOYO if SECURITY_TOMOYO
151 default DEFAULT_SECURITY_DAC
152
153 help
154 Select the security module that will be used by default if the
155 kernel parameter security= is not specified.
156
157 config DEFAULT_SECURITY_SELINUX
158 bool "SELinux" if SECURITY_SELINUX=y
159
160 config DEFAULT_SECURITY_SMACK
161 bool "Simplified Mandatory Access Control" if SECURITY_SMACK=y
162
163 config DEFAULT_SECURITY_TOMOYO
164 bool "TOMOYO" if SECURITY_TOMOYO=y
165
166 config DEFAULT_SECURITY_DAC
167 bool "Unix Discretionary Access Controls"
168
169endchoice
170
171config DEFAULT_SECURITY
172 string
173 default "selinux" if DEFAULT_SECURITY_SELINUX
174 default "smack" if DEFAULT_SECURITY_SMACK
175 default "tomoyo" if DEFAULT_SECURITY_TOMOYO
176 default "" if DEFAULT_SECURITY_DAC
177
168endmenu 178endmenu
169 179
diff --git a/security/Makefile b/security/Makefile
index 95ecc06392d7..bb44e350c618 100644
--- a/security/Makefile
+++ b/security/Makefile
@@ -18,7 +18,6 @@ obj-$(CONFIG_SECURITY_SELINUX) += selinux/built-in.o
18obj-$(CONFIG_SECURITY_SMACK) += smack/built-in.o 18obj-$(CONFIG_SECURITY_SMACK) += smack/built-in.o
19obj-$(CONFIG_AUDIT) += lsm_audit.o 19obj-$(CONFIG_AUDIT) += lsm_audit.o
20obj-$(CONFIG_SECURITY_TOMOYO) += tomoyo/built-in.o 20obj-$(CONFIG_SECURITY_TOMOYO) += tomoyo/built-in.o
21obj-$(CONFIG_SECURITY_ROOTPLUG) += root_plug.o
22obj-$(CONFIG_CGROUP_DEVICE) += device_cgroup.o 21obj-$(CONFIG_CGROUP_DEVICE) += device_cgroup.o
23 22
24# Object integrity file lists 23# Object integrity file lists
diff --git a/security/capability.c b/security/capability.c
index fce07a7bc825..5c700e1a4fd3 100644
--- a/security/capability.c
+++ b/security/capability.c
@@ -308,6 +308,22 @@ static int cap_path_truncate(struct path *path, loff_t length,
308{ 308{
309 return 0; 309 return 0;
310} 310}
311
312static int cap_path_chmod(struct dentry *dentry, struct vfsmount *mnt,
313 mode_t mode)
314{
315 return 0;
316}
317
318static int cap_path_chown(struct path *path, uid_t uid, gid_t gid)
319{
320 return 0;
321}
322
323static int cap_path_chroot(struct path *root)
324{
325 return 0;
326}
311#endif 327#endif
312 328
313static int cap_file_permission(struct file *file, int mask) 329static int cap_file_permission(struct file *file, int mask)
@@ -405,7 +421,7 @@ static int cap_kernel_create_files_as(struct cred *new, struct inode *inode)
405 return 0; 421 return 0;
406} 422}
407 423
408static int cap_kernel_module_request(void) 424static int cap_kernel_module_request(char *kmod_name)
409{ 425{
410 return 0; 426 return 0;
411} 427}
@@ -977,6 +993,9 @@ void security_fixup_ops(struct security_operations *ops)
977 set_to_cap_if_null(ops, path_link); 993 set_to_cap_if_null(ops, path_link);
978 set_to_cap_if_null(ops, path_rename); 994 set_to_cap_if_null(ops, path_rename);
979 set_to_cap_if_null(ops, path_truncate); 995 set_to_cap_if_null(ops, path_truncate);
996 set_to_cap_if_null(ops, path_chmod);
997 set_to_cap_if_null(ops, path_chown);
998 set_to_cap_if_null(ops, path_chroot);
980#endif 999#endif
981 set_to_cap_if_null(ops, file_permission); 1000 set_to_cap_if_null(ops, file_permission);
982 set_to_cap_if_null(ops, file_alloc_security); 1001 set_to_cap_if_null(ops, file_alloc_security);
diff --git a/security/commoncap.c b/security/commoncap.c
index fe30751a6cd9..f800fdb3de94 100644
--- a/security/commoncap.c
+++ b/security/commoncap.c
@@ -1,4 +1,4 @@
1/* Common capabilities, needed by capability.o and root_plug.o 1/* Common capabilities, needed by capability.o.
2 * 2 *
3 * This program is free software; you can redistribute it and/or modify 3 * This program is free software; you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License as published by 4 * it under the terms of the GNU General Public License as published by
@@ -173,7 +173,6 @@ int cap_capget(struct task_struct *target, kernel_cap_t *effective,
173 */ 173 */
174static inline int cap_inh_is_capped(void) 174static inline int cap_inh_is_capped(void)
175{ 175{
176#ifdef CONFIG_SECURITY_FILE_CAPABILITIES
177 176
178 /* they are so limited unless the current task has the CAP_SETPCAP 177 /* they are so limited unless the current task has the CAP_SETPCAP
179 * capability 178 * capability
@@ -181,7 +180,6 @@ static inline int cap_inh_is_capped(void)
181 if (cap_capable(current, current_cred(), CAP_SETPCAP, 180 if (cap_capable(current, current_cred(), CAP_SETPCAP,
182 SECURITY_CAP_AUDIT) == 0) 181 SECURITY_CAP_AUDIT) == 0)
183 return 0; 182 return 0;
184#endif
185 return 1; 183 return 1;
186} 184}
187 185
@@ -239,8 +237,6 @@ static inline void bprm_clear_caps(struct linux_binprm *bprm)
239 bprm->cap_effective = false; 237 bprm->cap_effective = false;
240} 238}
241 239
242#ifdef CONFIG_SECURITY_FILE_CAPABILITIES
243
244/** 240/**
245 * cap_inode_need_killpriv - Determine if inode change affects privileges 241 * cap_inode_need_killpriv - Determine if inode change affects privileges
246 * @dentry: The inode/dentry in being changed with change marked ATTR_KILL_PRIV 242 * @dentry: The inode/dentry in being changed with change marked ATTR_KILL_PRIV
@@ -421,49 +417,6 @@ out:
421 return rc; 417 return rc;
422} 418}
423 419
424#else
425int cap_inode_need_killpriv(struct dentry *dentry)
426{
427 return 0;
428}
429
430int cap_inode_killpriv(struct dentry *dentry)
431{
432 return 0;
433}
434
435int get_vfs_caps_from_disk(const struct dentry *dentry, struct cpu_vfs_cap_data *cpu_caps)
436{
437 memset(cpu_caps, 0, sizeof(struct cpu_vfs_cap_data));
438 return -ENODATA;
439}
440
441static inline int get_file_caps(struct linux_binprm *bprm, bool *effective)
442{
443 bprm_clear_caps(bprm);
444 return 0;
445}
446#endif
447
448/*
449 * Determine whether a exec'ing process's new permitted capabilities should be
450 * limited to just what it already has.
451 *
452 * This prevents processes that are being ptraced from gaining access to
453 * CAP_SETPCAP, unless the process they're tracing already has it, and the
454 * binary they're executing has filecaps that elevate it.
455 *
456 * Returns 1 if they should be limited, 0 if they are not.
457 */
458static inline int cap_limit_ptraced_target(void)
459{
460#ifndef CONFIG_SECURITY_FILE_CAPABILITIES
461 if (capable(CAP_SETPCAP))
462 return 0;
463#endif
464 return 1;
465}
466
467/** 420/**
468 * cap_bprm_set_creds - Set up the proposed credentials for execve(). 421 * cap_bprm_set_creds - Set up the proposed credentials for execve().
469 * @bprm: The execution parameters, including the proposed creds 422 * @bprm: The execution parameters, including the proposed creds
@@ -523,9 +476,8 @@ skip:
523 new->euid = new->uid; 476 new->euid = new->uid;
524 new->egid = new->gid; 477 new->egid = new->gid;
525 } 478 }
526 if (cap_limit_ptraced_target()) 479 new->cap_permitted = cap_intersect(new->cap_permitted,
527 new->cap_permitted = cap_intersect(new->cap_permitted, 480 old->cap_permitted);
528 old->cap_permitted);
529 } 481 }
530 482
531 new->suid = new->fsuid = new->euid; 483 new->suid = new->fsuid = new->euid;
@@ -739,7 +691,6 @@ int cap_task_fix_setuid(struct cred *new, const struct cred *old, int flags)
739 return 0; 691 return 0;
740} 692}
741 693
742#ifdef CONFIG_SECURITY_FILE_CAPABILITIES
743/* 694/*
744 * Rationale: code calling task_setscheduler, task_setioprio, and 695 * Rationale: code calling task_setscheduler, task_setioprio, and
745 * task_setnice, assumes that 696 * task_setnice, assumes that
@@ -820,22 +771,6 @@ static long cap_prctl_drop(struct cred *new, unsigned long cap)
820 return 0; 771 return 0;
821} 772}
822 773
823#else
824int cap_task_setscheduler (struct task_struct *p, int policy,
825 struct sched_param *lp)
826{
827 return 0;
828}
829int cap_task_setioprio (struct task_struct *p, int ioprio)
830{
831 return 0;
832}
833int cap_task_setnice (struct task_struct *p, int nice)
834{
835 return 0;
836}
837#endif
838
839/** 774/**
840 * cap_task_prctl - Implement process control functions for this security module 775 * cap_task_prctl - Implement process control functions for this security module
841 * @option: The process control function requested 776 * @option: The process control function requested
@@ -866,7 +801,6 @@ int cap_task_prctl(int option, unsigned long arg2, unsigned long arg3,
866 error = !!cap_raised(new->cap_bset, arg2); 801 error = !!cap_raised(new->cap_bset, arg2);
867 goto no_change; 802 goto no_change;
868 803
869#ifdef CONFIG_SECURITY_FILE_CAPABILITIES
870 case PR_CAPBSET_DROP: 804 case PR_CAPBSET_DROP:
871 error = cap_prctl_drop(new, arg2); 805 error = cap_prctl_drop(new, arg2);
872 if (error < 0) 806 if (error < 0)
@@ -917,8 +851,6 @@ int cap_task_prctl(int option, unsigned long arg2, unsigned long arg3,
917 error = new->securebits; 851 error = new->securebits;
918 goto no_change; 852 goto no_change;
919 853
920#endif /* def CONFIG_SECURITY_FILE_CAPABILITIES */
921
922 case PR_GET_KEEPCAPS: 854 case PR_GET_KEEPCAPS:
923 if (issecure(SECURE_KEEP_CAPS)) 855 if (issecure(SECURE_KEEP_CAPS))
924 error = 1; 856 error = 1;
diff --git a/security/integrity/ima/Kconfig b/security/integrity/ima/Kconfig
index 53d9764e8f09..3d7846de8069 100644
--- a/security/integrity/ima/Kconfig
+++ b/security/integrity/ima/Kconfig
@@ -3,6 +3,7 @@
3config IMA 3config IMA
4 bool "Integrity Measurement Architecture(IMA)" 4 bool "Integrity Measurement Architecture(IMA)"
5 depends on ACPI 5 depends on ACPI
6 depends on SECURITY
6 select SECURITYFS 7 select SECURITYFS
7 select CRYPTO 8 select CRYPTO
8 select CRYPTO_HMAC 9 select CRYPTO_HMAC
diff --git a/security/integrity/ima/ima_iint.c b/security/integrity/ima/ima_iint.c
index b8dd693f8790..a4e2b1dac943 100644
--- a/security/integrity/ima/ima_iint.c
+++ b/security/integrity/ima/ima_iint.c
@@ -58,11 +58,11 @@ struct ima_iint_cache *ima_iint_insert(struct inode *inode)
58 58
59 if (!ima_initialized) 59 if (!ima_initialized)
60 return iint; 60 return iint;
61 iint = kmem_cache_alloc(iint_cache, GFP_KERNEL); 61 iint = kmem_cache_alloc(iint_cache, GFP_NOFS);
62 if (!iint) 62 if (!iint)
63 return iint; 63 return iint;
64 64
65 rc = radix_tree_preload(GFP_KERNEL); 65 rc = radix_tree_preload(GFP_NOFS);
66 if (rc < 0) 66 if (rc < 0)
67 goto out; 67 goto out;
68 68
diff --git a/security/lsm_audit.c b/security/lsm_audit.c
index 3bb90b6f1dd3..51bd0fd9c9f0 100644
--- a/security/lsm_audit.c
+++ b/security/lsm_audit.c
@@ -354,6 +354,10 @@ static void dump_common_audit_data(struct audit_buffer *ab,
354 } 354 }
355 break; 355 break;
356#endif 356#endif
357 case LSM_AUDIT_DATA_KMOD:
358 audit_log_format(ab, " kmod=");
359 audit_log_untrustedstring(ab, a->u.kmod_name);
360 break;
357 } /* switch (a->type) */ 361 } /* switch (a->type) */
358} 362}
359 363
diff --git a/security/min_addr.c b/security/min_addr.c
index c844eed7915d..fc43c9d37084 100644
--- a/security/min_addr.c
+++ b/security/min_addr.c
@@ -33,6 +33,9 @@ int mmap_min_addr_handler(struct ctl_table *table, int write,
33{ 33{
34 int ret; 34 int ret;
35 35
36 if (!capable(CAP_SYS_RAWIO))
37 return -EPERM;
38
36 ret = proc_doulongvec_minmax(table, write, buffer, lenp, ppos); 39 ret = proc_doulongvec_minmax(table, write, buffer, lenp, ppos);
37 40
38 update_mmap_min_addr(); 41 update_mmap_min_addr();
diff --git a/security/root_plug.c b/security/root_plug.c
deleted file mode 100644
index 2f7ffa67c4d2..000000000000
--- a/security/root_plug.c
+++ /dev/null
@@ -1,90 +0,0 @@
1/*
2 * Root Plug sample LSM module
3 *
4 * Originally written for a Linux Journal.
5 *
6 * Copyright (C) 2002 Greg Kroah-Hartman <greg@kroah.com>
7 *
8 * Prevents any programs running with egid == 0 if a specific USB device
9 * is not present in the system. Yes, it can be gotten around, but is a
10 * nice starting point for people to play with, and learn the LSM
11 * interface.
12 *
13 * If you want to turn this into something with a semblance of security,
14 * you need to hook the task_* functions also.
15 *
16 * See http://www.linuxjournal.com/article.php?sid=6279 for more information
17 * about this code.
18 *
19 * This program is free software; you can redistribute it and/or
20 * modify it under the terms of the GNU General Public License as
21 * published by the Free Software Foundation, version 2 of the
22 * License.
23 */
24
25#include <linux/kernel.h>
26#include <linux/init.h>
27#include <linux/security.h>
28#include <linux/usb.h>
29#include <linux/moduleparam.h>
30
31/* default is a generic type of usb to serial converter */
32static int vendor_id = 0x0557;
33static int product_id = 0x2008;
34
35module_param(vendor_id, uint, 0400);
36module_param(product_id, uint, 0400);
37
38/* should we print out debug messages */
39static int debug = 0;
40
41module_param(debug, bool, 0600);
42
43#define MY_NAME "root_plug"
44
45#define root_dbg(fmt, arg...) \
46 do { \
47 if (debug) \
48 printk(KERN_DEBUG "%s: %s: " fmt , \
49 MY_NAME , __func__ , \
50 ## arg); \
51 } while (0)
52
53static int rootplug_bprm_check_security (struct linux_binprm *bprm)
54{
55 struct usb_device *dev;
56
57 root_dbg("file %s, e_uid = %d, e_gid = %d\n",
58 bprm->filename, bprm->cred->euid, bprm->cred->egid);
59
60 if (bprm->cred->egid == 0) {
61 dev = usb_find_device(vendor_id, product_id);
62 if (!dev) {
63 root_dbg("e_gid = 0, and device not found, "
64 "task not allowed to run...\n");
65 return -EPERM;
66 }
67 usb_put_dev(dev);
68 }
69
70 return 0;
71}
72
73static struct security_operations rootplug_security_ops = {
74 .bprm_check_security = rootplug_bprm_check_security,
75};
76
77static int __init rootplug_init (void)
78{
79 /* register ourselves with the security framework */
80 if (register_security (&rootplug_security_ops)) {
81 printk (KERN_INFO
82 "Failure registering Root Plug module with the kernel\n");
83 return -EINVAL;
84 }
85 printk (KERN_INFO "Root Plug module initialized, "
86 "vendor_id = %4.4x, product id = %4.4x\n", vendor_id, product_id);
87 return 0;
88}
89
90security_initcall (rootplug_init);
diff --git a/security/security.c b/security/security.c
index c4c673240c1c..24e060be9fa5 100644
--- a/security/security.c
+++ b/security/security.c
@@ -16,9 +16,11 @@
16#include <linux/init.h> 16#include <linux/init.h>
17#include <linux/kernel.h> 17#include <linux/kernel.h>
18#include <linux/security.h> 18#include <linux/security.h>
19#include <linux/ima.h>
19 20
20/* Boot-time LSM user choice */ 21/* Boot-time LSM user choice */
21static __initdata char chosen_lsm[SECURITY_NAME_MAX + 1]; 22static __initdata char chosen_lsm[SECURITY_NAME_MAX + 1] =
23 CONFIG_DEFAULT_SECURITY;
22 24
23/* things that live in capability.c */ 25/* things that live in capability.c */
24extern struct security_operations default_security_ops; 26extern struct security_operations default_security_ops;
@@ -79,8 +81,10 @@ __setup("security=", choose_lsm);
79 * 81 *
80 * Return true if: 82 * Return true if:
81 * -The passed LSM is the one chosen by user at boot time, 83 * -The passed LSM is the one chosen by user at boot time,
82 * -or user didn't specify a specific LSM and we're the first to ask 84 * -or the passed LSM is configured as the default and the user did not
83 * for registration permission, 85 * choose an alternate LSM at boot time,
86 * -or there is no default LSM set and the user didn't specify a
87 * specific LSM and we're the first to ask for registration permission,
84 * -or the passed LSM is currently loaded. 88 * -or the passed LSM is currently loaded.
85 * Otherwise, return false. 89 * Otherwise, return false.
86 */ 90 */
@@ -235,7 +239,12 @@ int security_bprm_set_creds(struct linux_binprm *bprm)
235 239
236int security_bprm_check(struct linux_binprm *bprm) 240int security_bprm_check(struct linux_binprm *bprm)
237{ 241{
238 return security_ops->bprm_check_security(bprm); 242 int ret;
243
244 ret = security_ops->bprm_check_security(bprm);
245 if (ret)
246 return ret;
247 return ima_bprm_check(bprm);
239} 248}
240 249
241void security_bprm_committing_creds(struct linux_binprm *bprm) 250void security_bprm_committing_creds(struct linux_binprm *bprm)
@@ -352,12 +361,21 @@ EXPORT_SYMBOL(security_sb_parse_opts_str);
352 361
353int security_inode_alloc(struct inode *inode) 362int security_inode_alloc(struct inode *inode)
354{ 363{
364 int ret;
365
355 inode->i_security = NULL; 366 inode->i_security = NULL;
356 return security_ops->inode_alloc_security(inode); 367 ret = security_ops->inode_alloc_security(inode);
368 if (ret)
369 return ret;
370 ret = ima_inode_alloc(inode);
371 if (ret)
372 security_inode_free(inode);
373 return ret;
357} 374}
358 375
359void security_inode_free(struct inode *inode) 376void security_inode_free(struct inode *inode)
360{ 377{
378 ima_inode_free(inode);
361 security_ops->inode_free_security(inode); 379 security_ops->inode_free_security(inode);
362} 380}
363 381
@@ -434,6 +452,26 @@ int security_path_truncate(struct path *path, loff_t length,
434 return 0; 452 return 0;
435 return security_ops->path_truncate(path, length, time_attrs); 453 return security_ops->path_truncate(path, length, time_attrs);
436} 454}
455
456int security_path_chmod(struct dentry *dentry, struct vfsmount *mnt,
457 mode_t mode)
458{
459 if (unlikely(IS_PRIVATE(dentry->d_inode)))
460 return 0;
461 return security_ops->path_chmod(dentry, mnt, mode);
462}
463
464int security_path_chown(struct path *path, uid_t uid, gid_t gid)
465{
466 if (unlikely(IS_PRIVATE(path->dentry->d_inode)))
467 return 0;
468 return security_ops->path_chown(path, uid, gid);
469}
470
471int security_path_chroot(struct path *path)
472{
473 return security_ops->path_chroot(path);
474}
437#endif 475#endif
438 476
439int security_inode_create(struct inode *dir, struct dentry *dentry, int mode) 477int security_inode_create(struct inode *dir, struct dentry *dentry, int mode)
@@ -628,6 +666,8 @@ int security_file_alloc(struct file *file)
628void security_file_free(struct file *file) 666void security_file_free(struct file *file)
629{ 667{
630 security_ops->file_free_security(file); 668 security_ops->file_free_security(file);
669 if (file->f_dentry)
670 ima_file_free(file);
631} 671}
632 672
633int security_file_ioctl(struct file *file, unsigned int cmd, unsigned long arg) 673int security_file_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
@@ -639,7 +679,12 @@ int security_file_mmap(struct file *file, unsigned long reqprot,
639 unsigned long prot, unsigned long flags, 679 unsigned long prot, unsigned long flags,
640 unsigned long addr, unsigned long addr_only) 680 unsigned long addr, unsigned long addr_only)
641{ 681{
642 return security_ops->file_mmap(file, reqprot, prot, flags, addr, addr_only); 682 int ret;
683
684 ret = security_ops->file_mmap(file, reqprot, prot, flags, addr, addr_only);
685 if (ret)
686 return ret;
687 return ima_file_mmap(file, prot);
643} 688}
644 689
645int security_file_mprotect(struct vm_area_struct *vma, unsigned long reqprot, 690int security_file_mprotect(struct vm_area_struct *vma, unsigned long reqprot,
@@ -719,9 +764,9 @@ int security_kernel_create_files_as(struct cred *new, struct inode *inode)
719 return security_ops->kernel_create_files_as(new, inode); 764 return security_ops->kernel_create_files_as(new, inode);
720} 765}
721 766
722int security_kernel_module_request(void) 767int security_kernel_module_request(char *kmod_name)
723{ 768{
724 return security_ops->kernel_module_request(); 769 return security_ops->kernel_module_request(kmod_name);
725} 770}
726 771
727int security_task_setuid(uid_t id0, uid_t id1, uid_t id2, int flags) 772int security_task_setuid(uid_t id0, uid_t id1, uid_t id2, int flags)
diff --git a/security/selinux/.gitignore b/security/selinux/.gitignore
new file mode 100644
index 000000000000..2e5040a3d48b
--- /dev/null
+++ b/security/selinux/.gitignore
@@ -0,0 +1,2 @@
1av_permissions.h
2flask.h
diff --git a/security/selinux/Makefile b/security/selinux/Makefile
index d47fc5e545e0..f013982df417 100644
--- a/security/selinux/Makefile
+++ b/security/selinux/Makefile
@@ -18,5 +18,13 @@ selinux-$(CONFIG_SECURITY_NETWORK_XFRM) += xfrm.o
18 18
19selinux-$(CONFIG_NETLABEL) += netlabel.o 19selinux-$(CONFIG_NETLABEL) += netlabel.o
20 20
21EXTRA_CFLAGS += -Isecurity/selinux/include 21EXTRA_CFLAGS += -Isecurity/selinux -Isecurity/selinux/include
22 22
23$(obj)/avc.o: $(obj)/flask.h
24
25quiet_cmd_flask = GEN $(obj)/flask.h $(obj)/av_permissions.h
26 cmd_flask = scripts/selinux/genheaders/genheaders $(obj)/flask.h $(obj)/av_permissions.h
27
28targets += flask.h
29$(obj)/flask.h: $(src)/include/classmap.h FORCE
30 $(call if_changed,flask)
diff --git a/security/selinux/avc.c b/security/selinux/avc.c
index b4b5da1c0a42..f2dde268165a 100644
--- a/security/selinux/avc.c
+++ b/security/selinux/avc.c
@@ -31,43 +31,7 @@
31#include <net/ipv6.h> 31#include <net/ipv6.h>
32#include "avc.h" 32#include "avc.h"
33#include "avc_ss.h" 33#include "avc_ss.h"
34 34#include "classmap.h"
35static const struct av_perm_to_string av_perm_to_string[] = {
36#define S_(c, v, s) { c, v, s },
37#include "av_perm_to_string.h"
38#undef S_
39};
40
41static const char *class_to_string[] = {
42#define S_(s) s,
43#include "class_to_string.h"
44#undef S_
45};
46
47#define TB_(s) static const char *s[] = {
48#define TE_(s) };
49#define S_(s) s,
50#include "common_perm_to_string.h"
51#undef TB_
52#undef TE_
53#undef S_
54
55static const struct av_inherit av_inherit[] = {
56#define S_(c, i, b) { .tclass = c,\
57 .common_pts = common_##i##_perm_to_string,\
58 .common_base = b },
59#include "av_inherit.h"
60#undef S_
61};
62
63const struct selinux_class_perm selinux_class_perm = {
64 .av_perm_to_string = av_perm_to_string,
65 .av_pts_len = ARRAY_SIZE(av_perm_to_string),
66 .class_to_string = class_to_string,
67 .cts_len = ARRAY_SIZE(class_to_string),
68 .av_inherit = av_inherit,
69 .av_inherit_len = ARRAY_SIZE(av_inherit)
70};
71 35
72#define AVC_CACHE_SLOTS 512 36#define AVC_CACHE_SLOTS 512
73#define AVC_DEF_CACHE_THRESHOLD 512 37#define AVC_DEF_CACHE_THRESHOLD 512
@@ -139,52 +103,28 @@ static inline int avc_hash(u32 ssid, u32 tsid, u16 tclass)
139 */ 103 */
140static void avc_dump_av(struct audit_buffer *ab, u16 tclass, u32 av) 104static void avc_dump_av(struct audit_buffer *ab, u16 tclass, u32 av)
141{ 105{
142 const char **common_pts = NULL; 106 const char **perms;
143 u32 common_base = 0; 107 int i, perm;
144 int i, i2, perm;
145 108
146 if (av == 0) { 109 if (av == 0) {
147 audit_log_format(ab, " null"); 110 audit_log_format(ab, " null");
148 return; 111 return;
149 } 112 }
150 113
151 for (i = 0; i < ARRAY_SIZE(av_inherit); i++) { 114 perms = secclass_map[tclass-1].perms;
152 if (av_inherit[i].tclass == tclass) {
153 common_pts = av_inherit[i].common_pts;
154 common_base = av_inherit[i].common_base;
155 break;
156 }
157 }
158 115
159 audit_log_format(ab, " {"); 116 audit_log_format(ab, " {");
160 i = 0; 117 i = 0;
161 perm = 1; 118 perm = 1;
162 while (perm < common_base) { 119 while (i < (sizeof(av) * 8)) {
163 if (perm & av) { 120 if ((perm & av) && perms[i]) {
164 audit_log_format(ab, " %s", common_pts[i]); 121 audit_log_format(ab, " %s", perms[i]);
165 av &= ~perm; 122 av &= ~perm;
166 } 123 }
167 i++; 124 i++;
168 perm <<= 1; 125 perm <<= 1;
169 } 126 }
170 127
171 while (i < sizeof(av) * 8) {
172 if (perm & av) {
173 for (i2 = 0; i2 < ARRAY_SIZE(av_perm_to_string); i2++) {
174 if ((av_perm_to_string[i2].tclass == tclass) &&
175 (av_perm_to_string[i2].value == perm))
176 break;
177 }
178 if (i2 < ARRAY_SIZE(av_perm_to_string)) {
179 audit_log_format(ab, " %s",
180 av_perm_to_string[i2].name);
181 av &= ~perm;
182 }
183 }
184 i++;
185 perm <<= 1;
186 }
187
188 if (av) 128 if (av)
189 audit_log_format(ab, " 0x%x", av); 129 audit_log_format(ab, " 0x%x", av);
190 130
@@ -219,8 +159,8 @@ static void avc_dump_query(struct audit_buffer *ab, u32 ssid, u32 tsid, u16 tcla
219 kfree(scontext); 159 kfree(scontext);
220 } 160 }
221 161
222 BUG_ON(tclass >= ARRAY_SIZE(class_to_string) || !class_to_string[tclass]); 162 BUG_ON(tclass >= ARRAY_SIZE(secclass_map));
223 audit_log_format(ab, " tclass=%s", class_to_string[tclass]); 163 audit_log_format(ab, " tclass=%s", secclass_map[tclass-1].name);
224} 164}
225 165
226/** 166/**
diff --git a/security/selinux/hooks.c b/security/selinux/hooks.c
index bb230d5d7085..c96d63ec4753 100644
--- a/security/selinux/hooks.c
+++ b/security/selinux/hooks.c
@@ -91,7 +91,6 @@
91 91
92#define NUM_SEL_MNT_OPTS 5 92#define NUM_SEL_MNT_OPTS 5
93 93
94extern unsigned int policydb_loaded_version;
95extern int selinux_nlmsg_lookup(u16 sclass, u16 nlmsg_type, u32 *perm); 94extern int selinux_nlmsg_lookup(u16 sclass, u16 nlmsg_type, u32 *perm);
96extern struct security_operations *security_ops; 95extern struct security_operations *security_ops;
97 96
@@ -3338,9 +3337,18 @@ static int selinux_kernel_create_files_as(struct cred *new, struct inode *inode)
3338 return 0; 3337 return 0;
3339} 3338}
3340 3339
3341static int selinux_kernel_module_request(void) 3340static int selinux_kernel_module_request(char *kmod_name)
3342{ 3341{
3343 return task_has_system(current, SYSTEM__MODULE_REQUEST); 3342 u32 sid;
3343 struct common_audit_data ad;
3344
3345 sid = task_sid(current);
3346
3347 COMMON_AUDIT_DATA_INIT(&ad, KMOD);
3348 ad.u.kmod_name = kmod_name;
3349
3350 return avc_has_perm(sid, SECINITSID_KERNEL, SECCLASS_SYSTEM,
3351 SYSTEM__MODULE_REQUEST, &ad);
3344} 3352}
3345 3353
3346static int selinux_task_setpgid(struct task_struct *p, pid_t pgid) 3354static int selinux_task_setpgid(struct task_struct *p, pid_t pgid)
@@ -4714,10 +4722,7 @@ static int selinux_netlink_send(struct sock *sk, struct sk_buff *skb)
4714 if (err) 4722 if (err)
4715 return err; 4723 return err;
4716 4724
4717 if (policydb_loaded_version >= POLICYDB_VERSION_NLCLASS) 4725 return selinux_nlmsg_perm(sk, skb);
4718 err = selinux_nlmsg_perm(sk, skb);
4719
4720 return err;
4721} 4726}
4722 4727
4723static int selinux_netlink_recv(struct sk_buff *skb, int capability) 4728static int selinux_netlink_recv(struct sk_buff *skb, int capability)
@@ -5830,12 +5835,12 @@ int selinux_disable(void)
5830 selinux_disabled = 1; 5835 selinux_disabled = 1;
5831 selinux_enabled = 0; 5836 selinux_enabled = 0;
5832 5837
5833 /* Try to destroy the avc node cache */
5834 avc_disable();
5835
5836 /* Reset security_ops to the secondary module, dummy or capability. */ 5838 /* Reset security_ops to the secondary module, dummy or capability. */
5837 security_ops = secondary_ops; 5839 security_ops = secondary_ops;
5838 5840
5841 /* Try to destroy the avc node cache */
5842 avc_disable();
5843
5839 /* Unregister netfilter hooks. */ 5844 /* Unregister netfilter hooks. */
5840 selinux_nf_ip_exit(); 5845 selinux_nf_ip_exit();
5841 5846
diff --git a/security/selinux/include/av_inherit.h b/security/selinux/include/av_inherit.h
deleted file mode 100644
index abedcd704dae..000000000000
--- a/security/selinux/include/av_inherit.h
+++ /dev/null
@@ -1,34 +0,0 @@
1/* This file is automatically generated. Do not edit. */
2 S_(SECCLASS_DIR, file, 0x00020000UL)
3 S_(SECCLASS_FILE, file, 0x00020000UL)
4 S_(SECCLASS_LNK_FILE, file, 0x00020000UL)
5 S_(SECCLASS_CHR_FILE, file, 0x00020000UL)
6 S_(SECCLASS_BLK_FILE, file, 0x00020000UL)
7 S_(SECCLASS_SOCK_FILE, file, 0x00020000UL)
8 S_(SECCLASS_FIFO_FILE, file, 0x00020000UL)
9 S_(SECCLASS_SOCKET, socket, 0x00400000UL)
10 S_(SECCLASS_TCP_SOCKET, socket, 0x00400000UL)
11 S_(SECCLASS_UDP_SOCKET, socket, 0x00400000UL)
12 S_(SECCLASS_RAWIP_SOCKET, socket, 0x00400000UL)
13 S_(SECCLASS_NETLINK_SOCKET, socket, 0x00400000UL)
14 S_(SECCLASS_PACKET_SOCKET, socket, 0x00400000UL)
15 S_(SECCLASS_KEY_SOCKET, socket, 0x00400000UL)
16 S_(SECCLASS_UNIX_STREAM_SOCKET, socket, 0x00400000UL)
17 S_(SECCLASS_UNIX_DGRAM_SOCKET, socket, 0x00400000UL)
18 S_(SECCLASS_TUN_SOCKET, socket, 0x00400000UL)
19 S_(SECCLASS_IPC, ipc, 0x00000200UL)
20 S_(SECCLASS_SEM, ipc, 0x00000200UL)
21 S_(SECCLASS_MSGQ, ipc, 0x00000200UL)
22 S_(SECCLASS_SHM, ipc, 0x00000200UL)
23 S_(SECCLASS_NETLINK_ROUTE_SOCKET, socket, 0x00400000UL)
24 S_(SECCLASS_NETLINK_FIREWALL_SOCKET, socket, 0x00400000UL)
25 S_(SECCLASS_NETLINK_TCPDIAG_SOCKET, socket, 0x00400000UL)
26 S_(SECCLASS_NETLINK_NFLOG_SOCKET, socket, 0x00400000UL)
27 S_(SECCLASS_NETLINK_XFRM_SOCKET, socket, 0x00400000UL)
28 S_(SECCLASS_NETLINK_SELINUX_SOCKET, socket, 0x00400000UL)
29 S_(SECCLASS_NETLINK_AUDIT_SOCKET, socket, 0x00400000UL)
30 S_(SECCLASS_NETLINK_IP6FW_SOCKET, socket, 0x00400000UL)
31 S_(SECCLASS_NETLINK_DNRT_SOCKET, socket, 0x00400000UL)
32 S_(SECCLASS_NETLINK_KOBJECT_UEVENT_SOCKET, socket, 0x00400000UL)
33 S_(SECCLASS_APPLETALK_SOCKET, socket, 0x00400000UL)
34 S_(SECCLASS_DCCP_SOCKET, socket, 0x00400000UL)
diff --git a/security/selinux/include/av_perm_to_string.h b/security/selinux/include/av_perm_to_string.h
deleted file mode 100644
index 2b683ad83d21..000000000000
--- a/security/selinux/include/av_perm_to_string.h
+++ /dev/null
@@ -1,183 +0,0 @@
1/* This file is automatically generated. Do not edit. */
2 S_(SECCLASS_FILESYSTEM, FILESYSTEM__MOUNT, "mount")
3 S_(SECCLASS_FILESYSTEM, FILESYSTEM__REMOUNT, "remount")
4 S_(SECCLASS_FILESYSTEM, FILESYSTEM__UNMOUNT, "unmount")
5 S_(SECCLASS_FILESYSTEM, FILESYSTEM__GETATTR, "getattr")
6 S_(SECCLASS_FILESYSTEM, FILESYSTEM__RELABELFROM, "relabelfrom")
7 S_(SECCLASS_FILESYSTEM, FILESYSTEM__RELABELTO, "relabelto")
8 S_(SECCLASS_FILESYSTEM, FILESYSTEM__TRANSITION, "transition")
9 S_(SECCLASS_FILESYSTEM, FILESYSTEM__ASSOCIATE, "associate")
10 S_(SECCLASS_FILESYSTEM, FILESYSTEM__QUOTAMOD, "quotamod")
11 S_(SECCLASS_FILESYSTEM, FILESYSTEM__QUOTAGET, "quotaget")
12 S_(SECCLASS_DIR, DIR__ADD_NAME, "add_name")
13 S_(SECCLASS_DIR, DIR__REMOVE_NAME, "remove_name")
14 S_(SECCLASS_DIR, DIR__REPARENT, "reparent")
15 S_(SECCLASS_DIR, DIR__SEARCH, "search")
16 S_(SECCLASS_DIR, DIR__RMDIR, "rmdir")
17 S_(SECCLASS_DIR, DIR__OPEN, "open")
18 S_(SECCLASS_FILE, FILE__EXECUTE_NO_TRANS, "execute_no_trans")
19 S_(SECCLASS_FILE, FILE__ENTRYPOINT, "entrypoint")
20 S_(SECCLASS_FILE, FILE__EXECMOD, "execmod")
21 S_(SECCLASS_FILE, FILE__OPEN, "open")
22 S_(SECCLASS_CHR_FILE, CHR_FILE__EXECUTE_NO_TRANS, "execute_no_trans")
23 S_(SECCLASS_CHR_FILE, CHR_FILE__ENTRYPOINT, "entrypoint")
24 S_(SECCLASS_CHR_FILE, CHR_FILE__EXECMOD, "execmod")
25 S_(SECCLASS_CHR_FILE, CHR_FILE__OPEN, "open")
26 S_(SECCLASS_BLK_FILE, BLK_FILE__OPEN, "open")
27 S_(SECCLASS_SOCK_FILE, SOCK_FILE__OPEN, "open")
28 S_(SECCLASS_FIFO_FILE, FIFO_FILE__OPEN, "open")
29 S_(SECCLASS_FD, FD__USE, "use")
30 S_(SECCLASS_TCP_SOCKET, TCP_SOCKET__CONNECTTO, "connectto")
31 S_(SECCLASS_TCP_SOCKET, TCP_SOCKET__NEWCONN, "newconn")
32 S_(SECCLASS_TCP_SOCKET, TCP_SOCKET__ACCEPTFROM, "acceptfrom")
33 S_(SECCLASS_TCP_SOCKET, TCP_SOCKET__NODE_BIND, "node_bind")
34 S_(SECCLASS_TCP_SOCKET, TCP_SOCKET__NAME_CONNECT, "name_connect")
35 S_(SECCLASS_UDP_SOCKET, UDP_SOCKET__NODE_BIND, "node_bind")
36 S_(SECCLASS_RAWIP_SOCKET, RAWIP_SOCKET__NODE_BIND, "node_bind")
37 S_(SECCLASS_NODE, NODE__TCP_RECV, "tcp_recv")
38 S_(SECCLASS_NODE, NODE__TCP_SEND, "tcp_send")
39 S_(SECCLASS_NODE, NODE__UDP_RECV, "udp_recv")
40 S_(SECCLASS_NODE, NODE__UDP_SEND, "udp_send")
41 S_(SECCLASS_NODE, NODE__RAWIP_RECV, "rawip_recv")
42 S_(SECCLASS_NODE, NODE__RAWIP_SEND, "rawip_send")
43 S_(SECCLASS_NODE, NODE__ENFORCE_DEST, "enforce_dest")
44 S_(SECCLASS_NODE, NODE__DCCP_RECV, "dccp_recv")
45 S_(SECCLASS_NODE, NODE__DCCP_SEND, "dccp_send")
46 S_(SECCLASS_NODE, NODE__RECVFROM, "recvfrom")
47 S_(SECCLASS_NODE, NODE__SENDTO, "sendto")
48 S_(SECCLASS_NETIF, NETIF__TCP_RECV, "tcp_recv")
49 S_(SECCLASS_NETIF, NETIF__TCP_SEND, "tcp_send")
50 S_(SECCLASS_NETIF, NETIF__UDP_RECV, "udp_recv")
51 S_(SECCLASS_NETIF, NETIF__UDP_SEND, "udp_send")
52 S_(SECCLASS_NETIF, NETIF__RAWIP_RECV, "rawip_recv")
53 S_(SECCLASS_NETIF, NETIF__RAWIP_SEND, "rawip_send")
54 S_(SECCLASS_NETIF, NETIF__DCCP_RECV, "dccp_recv")
55 S_(SECCLASS_NETIF, NETIF__DCCP_SEND, "dccp_send")
56 S_(SECCLASS_NETIF, NETIF__INGRESS, "ingress")
57 S_(SECCLASS_NETIF, NETIF__EGRESS, "egress")
58 S_(SECCLASS_UNIX_STREAM_SOCKET, UNIX_STREAM_SOCKET__CONNECTTO, "connectto")
59 S_(SECCLASS_UNIX_STREAM_SOCKET, UNIX_STREAM_SOCKET__NEWCONN, "newconn")
60 S_(SECCLASS_UNIX_STREAM_SOCKET, UNIX_STREAM_SOCKET__ACCEPTFROM, "acceptfrom")
61 S_(SECCLASS_PROCESS, PROCESS__FORK, "fork")
62 S_(SECCLASS_PROCESS, PROCESS__TRANSITION, "transition")
63 S_(SECCLASS_PROCESS, PROCESS__SIGCHLD, "sigchld")
64 S_(SECCLASS_PROCESS, PROCESS__SIGKILL, "sigkill")
65 S_(SECCLASS_PROCESS, PROCESS__SIGSTOP, "sigstop")
66 S_(SECCLASS_PROCESS, PROCESS__SIGNULL, "signull")
67 S_(SECCLASS_PROCESS, PROCESS__SIGNAL, "signal")
68 S_(SECCLASS_PROCESS, PROCESS__PTRACE, "ptrace")
69 S_(SECCLASS_PROCESS, PROCESS__GETSCHED, "getsched")
70 S_(SECCLASS_PROCESS, PROCESS__SETSCHED, "setsched")
71 S_(SECCLASS_PROCESS, PROCESS__GETSESSION, "getsession")
72 S_(SECCLASS_PROCESS, PROCESS__GETPGID, "getpgid")
73 S_(SECCLASS_PROCESS, PROCESS__SETPGID, "setpgid")
74 S_(SECCLASS_PROCESS, PROCESS__GETCAP, "getcap")
75 S_(SECCLASS_PROCESS, PROCESS__SETCAP, "setcap")
76 S_(SECCLASS_PROCESS, PROCESS__SHARE, "share")
77 S_(SECCLASS_PROCESS, PROCESS__GETATTR, "getattr")
78 S_(SECCLASS_PROCESS, PROCESS__SETEXEC, "setexec")
79 S_(SECCLASS_PROCESS, PROCESS__SETFSCREATE, "setfscreate")
80 S_(SECCLASS_PROCESS, PROCESS__NOATSECURE, "noatsecure")
81 S_(SECCLASS_PROCESS, PROCESS__SIGINH, "siginh")
82 S_(SECCLASS_PROCESS, PROCESS__SETRLIMIT, "setrlimit")
83 S_(SECCLASS_PROCESS, PROCESS__RLIMITINH, "rlimitinh")
84 S_(SECCLASS_PROCESS, PROCESS__DYNTRANSITION, "dyntransition")
85 S_(SECCLASS_PROCESS, PROCESS__SETCURRENT, "setcurrent")
86 S_(SECCLASS_PROCESS, PROCESS__EXECMEM, "execmem")
87 S_(SECCLASS_PROCESS, PROCESS__EXECSTACK, "execstack")
88 S_(SECCLASS_PROCESS, PROCESS__EXECHEAP, "execheap")
89 S_(SECCLASS_PROCESS, PROCESS__SETKEYCREATE, "setkeycreate")
90 S_(SECCLASS_PROCESS, PROCESS__SETSOCKCREATE, "setsockcreate")
91 S_(SECCLASS_MSGQ, MSGQ__ENQUEUE, "enqueue")
92 S_(SECCLASS_MSG, MSG__SEND, "send")
93 S_(SECCLASS_MSG, MSG__RECEIVE, "receive")
94 S_(SECCLASS_SHM, SHM__LOCK, "lock")
95 S_(SECCLASS_SECURITY, SECURITY__COMPUTE_AV, "compute_av")
96 S_(SECCLASS_SECURITY, SECURITY__COMPUTE_CREATE, "compute_create")
97 S_(SECCLASS_SECURITY, SECURITY__COMPUTE_MEMBER, "compute_member")
98 S_(SECCLASS_SECURITY, SECURITY__CHECK_CONTEXT, "check_context")
99 S_(SECCLASS_SECURITY, SECURITY__LOAD_POLICY, "load_policy")
100 S_(SECCLASS_SECURITY, SECURITY__COMPUTE_RELABEL, "compute_relabel")
101 S_(SECCLASS_SECURITY, SECURITY__COMPUTE_USER, "compute_user")
102 S_(SECCLASS_SECURITY, SECURITY__SETENFORCE, "setenforce")
103 S_(SECCLASS_SECURITY, SECURITY__SETBOOL, "setbool")
104 S_(SECCLASS_SECURITY, SECURITY__SETSECPARAM, "setsecparam")
105 S_(SECCLASS_SECURITY, SECURITY__SETCHECKREQPROT, "setcheckreqprot")
106 S_(SECCLASS_SYSTEM, SYSTEM__IPC_INFO, "ipc_info")
107 S_(SECCLASS_SYSTEM, SYSTEM__SYSLOG_READ, "syslog_read")
108 S_(SECCLASS_SYSTEM, SYSTEM__SYSLOG_MOD, "syslog_mod")
109 S_(SECCLASS_SYSTEM, SYSTEM__SYSLOG_CONSOLE, "syslog_console")
110 S_(SECCLASS_SYSTEM, SYSTEM__MODULE_REQUEST, "module_request")
111 S_(SECCLASS_CAPABILITY, CAPABILITY__CHOWN, "chown")
112 S_(SECCLASS_CAPABILITY, CAPABILITY__DAC_OVERRIDE, "dac_override")
113 S_(SECCLASS_CAPABILITY, CAPABILITY__DAC_READ_SEARCH, "dac_read_search")
114 S_(SECCLASS_CAPABILITY, CAPABILITY__FOWNER, "fowner")
115 S_(SECCLASS_CAPABILITY, CAPABILITY__FSETID, "fsetid")
116 S_(SECCLASS_CAPABILITY, CAPABILITY__KILL, "kill")
117 S_(SECCLASS_CAPABILITY, CAPABILITY__SETGID, "setgid")
118 S_(SECCLASS_CAPABILITY, CAPABILITY__SETUID, "setuid")
119 S_(SECCLASS_CAPABILITY, CAPABILITY__SETPCAP, "setpcap")
120 S_(SECCLASS_CAPABILITY, CAPABILITY__LINUX_IMMUTABLE, "linux_immutable")
121 S_(SECCLASS_CAPABILITY, CAPABILITY__NET_BIND_SERVICE, "net_bind_service")
122 S_(SECCLASS_CAPABILITY, CAPABILITY__NET_BROADCAST, "net_broadcast")
123 S_(SECCLASS_CAPABILITY, CAPABILITY__NET_ADMIN, "net_admin")
124 S_(SECCLASS_CAPABILITY, CAPABILITY__NET_RAW, "net_raw")
125 S_(SECCLASS_CAPABILITY, CAPABILITY__IPC_LOCK, "ipc_lock")
126 S_(SECCLASS_CAPABILITY, CAPABILITY__IPC_OWNER, "ipc_owner")
127 S_(SECCLASS_CAPABILITY, CAPABILITY__SYS_MODULE, "sys_module")
128 S_(SECCLASS_CAPABILITY, CAPABILITY__SYS_RAWIO, "sys_rawio")
129 S_(SECCLASS_CAPABILITY, CAPABILITY__SYS_CHROOT, "sys_chroot")
130 S_(SECCLASS_CAPABILITY, CAPABILITY__SYS_PTRACE, "sys_ptrace")
131 S_(SECCLASS_CAPABILITY, CAPABILITY__SYS_PACCT, "sys_pacct")
132 S_(SECCLASS_CAPABILITY, CAPABILITY__SYS_ADMIN, "sys_admin")
133 S_(SECCLASS_CAPABILITY, CAPABILITY__SYS_BOOT, "sys_boot")
134 S_(SECCLASS_CAPABILITY, CAPABILITY__SYS_NICE, "sys_nice")
135 S_(SECCLASS_CAPABILITY, CAPABILITY__SYS_RESOURCE, "sys_resource")
136 S_(SECCLASS_CAPABILITY, CAPABILITY__SYS_TIME, "sys_time")
137 S_(SECCLASS_CAPABILITY, CAPABILITY__SYS_TTY_CONFIG, "sys_tty_config")
138 S_(SECCLASS_CAPABILITY, CAPABILITY__MKNOD, "mknod")
139 S_(SECCLASS_CAPABILITY, CAPABILITY__LEASE, "lease")
140 S_(SECCLASS_CAPABILITY, CAPABILITY__AUDIT_WRITE, "audit_write")
141 S_(SECCLASS_CAPABILITY, CAPABILITY__AUDIT_CONTROL, "audit_control")
142 S_(SECCLASS_CAPABILITY, CAPABILITY__SETFCAP, "setfcap")
143 S_(SECCLASS_CAPABILITY2, CAPABILITY2__MAC_OVERRIDE, "mac_override")
144 S_(SECCLASS_CAPABILITY2, CAPABILITY2__MAC_ADMIN, "mac_admin")
145 S_(SECCLASS_NETLINK_ROUTE_SOCKET, NETLINK_ROUTE_SOCKET__NLMSG_READ, "nlmsg_read")
146 S_(SECCLASS_NETLINK_ROUTE_SOCKET, NETLINK_ROUTE_SOCKET__NLMSG_WRITE, "nlmsg_write")
147 S_(SECCLASS_NETLINK_FIREWALL_SOCKET, NETLINK_FIREWALL_SOCKET__NLMSG_READ, "nlmsg_read")
148 S_(SECCLASS_NETLINK_FIREWALL_SOCKET, NETLINK_FIREWALL_SOCKET__NLMSG_WRITE, "nlmsg_write")
149 S_(SECCLASS_NETLINK_TCPDIAG_SOCKET, NETLINK_TCPDIAG_SOCKET__NLMSG_READ, "nlmsg_read")
150 S_(SECCLASS_NETLINK_TCPDIAG_SOCKET, NETLINK_TCPDIAG_SOCKET__NLMSG_WRITE, "nlmsg_write")
151 S_(SECCLASS_NETLINK_XFRM_SOCKET, NETLINK_XFRM_SOCKET__NLMSG_READ, "nlmsg_read")
152 S_(SECCLASS_NETLINK_XFRM_SOCKET, NETLINK_XFRM_SOCKET__NLMSG_WRITE, "nlmsg_write")
153 S_(SECCLASS_NETLINK_AUDIT_SOCKET, NETLINK_AUDIT_SOCKET__NLMSG_READ, "nlmsg_read")
154 S_(SECCLASS_NETLINK_AUDIT_SOCKET, NETLINK_AUDIT_SOCKET__NLMSG_WRITE, "nlmsg_write")
155 S_(SECCLASS_NETLINK_AUDIT_SOCKET, NETLINK_AUDIT_SOCKET__NLMSG_RELAY, "nlmsg_relay")
156 S_(SECCLASS_NETLINK_AUDIT_SOCKET, NETLINK_AUDIT_SOCKET__NLMSG_READPRIV, "nlmsg_readpriv")
157 S_(SECCLASS_NETLINK_AUDIT_SOCKET, NETLINK_AUDIT_SOCKET__NLMSG_TTY_AUDIT, "nlmsg_tty_audit")
158 S_(SECCLASS_NETLINK_IP6FW_SOCKET, NETLINK_IP6FW_SOCKET__NLMSG_READ, "nlmsg_read")
159 S_(SECCLASS_NETLINK_IP6FW_SOCKET, NETLINK_IP6FW_SOCKET__NLMSG_WRITE, "nlmsg_write")
160 S_(SECCLASS_ASSOCIATION, ASSOCIATION__SENDTO, "sendto")
161 S_(SECCLASS_ASSOCIATION, ASSOCIATION__RECVFROM, "recvfrom")
162 S_(SECCLASS_ASSOCIATION, ASSOCIATION__SETCONTEXT, "setcontext")
163 S_(SECCLASS_ASSOCIATION, ASSOCIATION__POLMATCH, "polmatch")
164 S_(SECCLASS_PACKET, PACKET__SEND, "send")
165 S_(SECCLASS_PACKET, PACKET__RECV, "recv")
166 S_(SECCLASS_PACKET, PACKET__RELABELTO, "relabelto")
167 S_(SECCLASS_PACKET, PACKET__FLOW_IN, "flow_in")
168 S_(SECCLASS_PACKET, PACKET__FLOW_OUT, "flow_out")
169 S_(SECCLASS_PACKET, PACKET__FORWARD_IN, "forward_in")
170 S_(SECCLASS_PACKET, PACKET__FORWARD_OUT, "forward_out")
171 S_(SECCLASS_KEY, KEY__VIEW, "view")
172 S_(SECCLASS_KEY, KEY__READ, "read")
173 S_(SECCLASS_KEY, KEY__WRITE, "write")
174 S_(SECCLASS_KEY, KEY__SEARCH, "search")
175 S_(SECCLASS_KEY, KEY__LINK, "link")
176 S_(SECCLASS_KEY, KEY__SETATTR, "setattr")
177 S_(SECCLASS_KEY, KEY__CREATE, "create")
178 S_(SECCLASS_DCCP_SOCKET, DCCP_SOCKET__NODE_BIND, "node_bind")
179 S_(SECCLASS_DCCP_SOCKET, DCCP_SOCKET__NAME_CONNECT, "name_connect")
180 S_(SECCLASS_MEMPROTECT, MEMPROTECT__MMAP_ZERO, "mmap_zero")
181 S_(SECCLASS_PEER, PEER__RECV, "recv")
182 S_(SECCLASS_KERNEL_SERVICE, KERNEL_SERVICE__USE_AS_OVERRIDE, "use_as_override")
183 S_(SECCLASS_KERNEL_SERVICE, KERNEL_SERVICE__CREATE_FILES_AS, "create_files_as")
diff --git a/security/selinux/include/av_permissions.h b/security/selinux/include/av_permissions.h
deleted file mode 100644
index 0546d616ccac..000000000000
--- a/security/selinux/include/av_permissions.h
+++ /dev/null
@@ -1,870 +0,0 @@
1/* This file is automatically generated. Do not edit. */
2#define COMMON_FILE__IOCTL 0x00000001UL
3#define COMMON_FILE__READ 0x00000002UL
4#define COMMON_FILE__WRITE 0x00000004UL
5#define COMMON_FILE__CREATE 0x00000008UL
6#define COMMON_FILE__GETATTR 0x00000010UL
7#define COMMON_FILE__SETATTR 0x00000020UL
8#define COMMON_FILE__LOCK 0x00000040UL
9#define COMMON_FILE__RELABELFROM 0x00000080UL
10#define COMMON_FILE__RELABELTO 0x00000100UL
11#define COMMON_FILE__APPEND 0x00000200UL
12#define COMMON_FILE__UNLINK 0x00000400UL
13#define COMMON_FILE__LINK 0x00000800UL
14#define COMMON_FILE__RENAME 0x00001000UL
15#define COMMON_FILE__EXECUTE 0x00002000UL
16#define COMMON_FILE__SWAPON 0x00004000UL
17#define COMMON_FILE__QUOTAON 0x00008000UL
18#define COMMON_FILE__MOUNTON 0x00010000UL
19#define COMMON_SOCKET__IOCTL 0x00000001UL
20#define COMMON_SOCKET__READ 0x00000002UL
21#define COMMON_SOCKET__WRITE 0x00000004UL
22#define COMMON_SOCKET__CREATE 0x00000008UL
23#define COMMON_SOCKET__GETATTR 0x00000010UL
24#define COMMON_SOCKET__SETATTR 0x00000020UL
25#define COMMON_SOCKET__LOCK 0x00000040UL
26#define COMMON_SOCKET__RELABELFROM 0x00000080UL
27#define COMMON_SOCKET__RELABELTO 0x00000100UL
28#define COMMON_SOCKET__APPEND 0x00000200UL
29#define COMMON_SOCKET__BIND 0x00000400UL
30#define COMMON_SOCKET__CONNECT 0x00000800UL
31#define COMMON_SOCKET__LISTEN 0x00001000UL
32#define COMMON_SOCKET__ACCEPT 0x00002000UL
33#define COMMON_SOCKET__GETOPT 0x00004000UL
34#define COMMON_SOCKET__SETOPT 0x00008000UL
35#define COMMON_SOCKET__SHUTDOWN 0x00010000UL
36#define COMMON_SOCKET__RECVFROM 0x00020000UL
37#define COMMON_SOCKET__SENDTO 0x00040000UL
38#define COMMON_SOCKET__RECV_MSG 0x00080000UL
39#define COMMON_SOCKET__SEND_MSG 0x00100000UL
40#define COMMON_SOCKET__NAME_BIND 0x00200000UL
41#define COMMON_IPC__CREATE 0x00000001UL
42#define COMMON_IPC__DESTROY 0x00000002UL
43#define COMMON_IPC__GETATTR 0x00000004UL
44#define COMMON_IPC__SETATTR 0x00000008UL
45#define COMMON_IPC__READ 0x00000010UL
46#define COMMON_IPC__WRITE 0x00000020UL
47#define COMMON_IPC__ASSOCIATE 0x00000040UL
48#define COMMON_IPC__UNIX_READ 0x00000080UL
49#define COMMON_IPC__UNIX_WRITE 0x00000100UL
50#define FILESYSTEM__MOUNT 0x00000001UL
51#define FILESYSTEM__REMOUNT 0x00000002UL
52#define FILESYSTEM__UNMOUNT 0x00000004UL
53#define FILESYSTEM__GETATTR 0x00000008UL
54#define FILESYSTEM__RELABELFROM 0x00000010UL
55#define FILESYSTEM__RELABELTO 0x00000020UL
56#define FILESYSTEM__TRANSITION 0x00000040UL
57#define FILESYSTEM__ASSOCIATE 0x00000080UL
58#define FILESYSTEM__QUOTAMOD 0x00000100UL
59#define FILESYSTEM__QUOTAGET 0x00000200UL
60#define DIR__IOCTL 0x00000001UL
61#define DIR__READ 0x00000002UL
62#define DIR__WRITE 0x00000004UL
63#define DIR__CREATE 0x00000008UL
64#define DIR__GETATTR 0x00000010UL
65#define DIR__SETATTR 0x00000020UL
66#define DIR__LOCK 0x00000040UL
67#define DIR__RELABELFROM 0x00000080UL
68#define DIR__RELABELTO 0x00000100UL
69#define DIR__APPEND 0x00000200UL
70#define DIR__UNLINK 0x00000400UL
71#define DIR__LINK 0x00000800UL
72#define DIR__RENAME 0x00001000UL
73#define DIR__EXECUTE 0x00002000UL
74#define DIR__SWAPON 0x00004000UL
75#define DIR__QUOTAON 0x00008000UL
76#define DIR__MOUNTON 0x00010000UL
77#define DIR__ADD_NAME 0x00020000UL
78#define DIR__REMOVE_NAME 0x00040000UL
79#define DIR__REPARENT 0x00080000UL
80#define DIR__SEARCH 0x00100000UL
81#define DIR__RMDIR 0x00200000UL
82#define DIR__OPEN 0x00400000UL
83#define FILE__IOCTL 0x00000001UL
84#define FILE__READ 0x00000002UL
85#define FILE__WRITE 0x00000004UL
86#define FILE__CREATE 0x00000008UL
87#define FILE__GETATTR 0x00000010UL
88#define FILE__SETATTR 0x00000020UL
89#define FILE__LOCK 0x00000040UL
90#define FILE__RELABELFROM 0x00000080UL
91#define FILE__RELABELTO 0x00000100UL
92#define FILE__APPEND 0x00000200UL
93#define FILE__UNLINK 0x00000400UL
94#define FILE__LINK 0x00000800UL
95#define FILE__RENAME 0x00001000UL
96#define FILE__EXECUTE 0x00002000UL
97#define FILE__SWAPON 0x00004000UL
98#define FILE__QUOTAON 0x00008000UL
99#define FILE__MOUNTON 0x00010000UL
100#define FILE__EXECUTE_NO_TRANS 0x00020000UL
101#define FILE__ENTRYPOINT 0x00040000UL
102#define FILE__EXECMOD 0x00080000UL
103#define FILE__OPEN 0x00100000UL
104#define LNK_FILE__IOCTL 0x00000001UL
105#define LNK_FILE__READ 0x00000002UL
106#define LNK_FILE__WRITE 0x00000004UL
107#define LNK_FILE__CREATE 0x00000008UL
108#define LNK_FILE__GETATTR 0x00000010UL
109#define LNK_FILE__SETATTR 0x00000020UL
110#define LNK_FILE__LOCK 0x00000040UL
111#define LNK_FILE__RELABELFROM 0x00000080UL
112#define LNK_FILE__RELABELTO 0x00000100UL
113#define LNK_FILE__APPEND 0x00000200UL
114#define LNK_FILE__UNLINK 0x00000400UL
115#define LNK_FILE__LINK 0x00000800UL
116#define LNK_FILE__RENAME 0x00001000UL
117#define LNK_FILE__EXECUTE 0x00002000UL
118#define LNK_FILE__SWAPON 0x00004000UL
119#define LNK_FILE__QUOTAON 0x00008000UL
120#define LNK_FILE__MOUNTON 0x00010000UL
121#define CHR_FILE__IOCTL 0x00000001UL
122#define CHR_FILE__READ 0x00000002UL
123#define CHR_FILE__WRITE 0x00000004UL
124#define CHR_FILE__CREATE 0x00000008UL
125#define CHR_FILE__GETATTR 0x00000010UL
126#define CHR_FILE__SETATTR 0x00000020UL
127#define CHR_FILE__LOCK 0x00000040UL
128#define CHR_FILE__RELABELFROM 0x00000080UL
129#define CHR_FILE__RELABELTO 0x00000100UL
130#define CHR_FILE__APPEND 0x00000200UL
131#define CHR_FILE__UNLINK 0x00000400UL
132#define CHR_FILE__LINK 0x00000800UL
133#define CHR_FILE__RENAME 0x00001000UL
134#define CHR_FILE__EXECUTE 0x00002000UL
135#define CHR_FILE__SWAPON 0x00004000UL
136#define CHR_FILE__QUOTAON 0x00008000UL
137#define CHR_FILE__MOUNTON 0x00010000UL
138#define CHR_FILE__EXECUTE_NO_TRANS 0x00020000UL
139#define CHR_FILE__ENTRYPOINT 0x00040000UL
140#define CHR_FILE__EXECMOD 0x00080000UL
141#define CHR_FILE__OPEN 0x00100000UL
142#define BLK_FILE__IOCTL 0x00000001UL
143#define BLK_FILE__READ 0x00000002UL
144#define BLK_FILE__WRITE 0x00000004UL
145#define BLK_FILE__CREATE 0x00000008UL
146#define BLK_FILE__GETATTR 0x00000010UL
147#define BLK_FILE__SETATTR 0x00000020UL
148#define BLK_FILE__LOCK 0x00000040UL
149#define BLK_FILE__RELABELFROM 0x00000080UL
150#define BLK_FILE__RELABELTO 0x00000100UL
151#define BLK_FILE__APPEND 0x00000200UL
152#define BLK_FILE__UNLINK 0x00000400UL
153#define BLK_FILE__LINK 0x00000800UL
154#define BLK_FILE__RENAME 0x00001000UL
155#define BLK_FILE__EXECUTE 0x00002000UL
156#define BLK_FILE__SWAPON 0x00004000UL
157#define BLK_FILE__QUOTAON 0x00008000UL
158#define BLK_FILE__MOUNTON 0x00010000UL
159#define BLK_FILE__OPEN 0x00020000UL
160#define SOCK_FILE__IOCTL 0x00000001UL
161#define SOCK_FILE__READ 0x00000002UL
162#define SOCK_FILE__WRITE 0x00000004UL
163#define SOCK_FILE__CREATE 0x00000008UL
164#define SOCK_FILE__GETATTR 0x00000010UL
165#define SOCK_FILE__SETATTR 0x00000020UL
166#define SOCK_FILE__LOCK 0x00000040UL
167#define SOCK_FILE__RELABELFROM 0x00000080UL
168#define SOCK_FILE__RELABELTO 0x00000100UL
169#define SOCK_FILE__APPEND 0x00000200UL
170#define SOCK_FILE__UNLINK 0x00000400UL
171#define SOCK_FILE__LINK 0x00000800UL
172#define SOCK_FILE__RENAME 0x00001000UL
173#define SOCK_FILE__EXECUTE 0x00002000UL
174#define SOCK_FILE__SWAPON 0x00004000UL
175#define SOCK_FILE__QUOTAON 0x00008000UL
176#define SOCK_FILE__MOUNTON 0x00010000UL
177#define SOCK_FILE__OPEN 0x00020000UL
178#define FIFO_FILE__IOCTL 0x00000001UL
179#define FIFO_FILE__READ 0x00000002UL
180#define FIFO_FILE__WRITE 0x00000004UL
181#define FIFO_FILE__CREATE 0x00000008UL
182#define FIFO_FILE__GETATTR 0x00000010UL
183#define FIFO_FILE__SETATTR 0x00000020UL
184#define FIFO_FILE__LOCK 0x00000040UL
185#define FIFO_FILE__RELABELFROM 0x00000080UL
186#define FIFO_FILE__RELABELTO 0x00000100UL
187#define FIFO_FILE__APPEND 0x00000200UL
188#define FIFO_FILE__UNLINK 0x00000400UL
189#define FIFO_FILE__LINK 0x00000800UL
190#define FIFO_FILE__RENAME 0x00001000UL
191#define FIFO_FILE__EXECUTE 0x00002000UL
192#define FIFO_FILE__SWAPON 0x00004000UL
193#define FIFO_FILE__QUOTAON 0x00008000UL
194#define FIFO_FILE__MOUNTON 0x00010000UL
195#define FIFO_FILE__OPEN 0x00020000UL
196#define FD__USE 0x00000001UL
197#define SOCKET__IOCTL 0x00000001UL
198#define SOCKET__READ 0x00000002UL
199#define SOCKET__WRITE 0x00000004UL
200#define SOCKET__CREATE 0x00000008UL
201#define SOCKET__GETATTR 0x00000010UL
202#define SOCKET__SETATTR 0x00000020UL
203#define SOCKET__LOCK 0x00000040UL
204#define SOCKET__RELABELFROM 0x00000080UL
205#define SOCKET__RELABELTO 0x00000100UL
206#define SOCKET__APPEND 0x00000200UL
207#define SOCKET__BIND 0x00000400UL
208#define SOCKET__CONNECT 0x00000800UL
209#define SOCKET__LISTEN 0x00001000UL
210#define SOCKET__ACCEPT 0x00002000UL
211#define SOCKET__GETOPT 0x00004000UL
212#define SOCKET__SETOPT 0x00008000UL
213#define SOCKET__SHUTDOWN 0x00010000UL
214#define SOCKET__RECVFROM 0x00020000UL
215#define SOCKET__SENDTO 0x00040000UL
216#define SOCKET__RECV_MSG 0x00080000UL
217#define SOCKET__SEND_MSG 0x00100000UL
218#define SOCKET__NAME_BIND 0x00200000UL
219#define TCP_SOCKET__IOCTL 0x00000001UL
220#define TCP_SOCKET__READ 0x00000002UL
221#define TCP_SOCKET__WRITE 0x00000004UL
222#define TCP_SOCKET__CREATE 0x00000008UL
223#define TCP_SOCKET__GETATTR 0x00000010UL
224#define TCP_SOCKET__SETATTR 0x00000020UL
225#define TCP_SOCKET__LOCK 0x00000040UL
226#define TCP_SOCKET__RELABELFROM 0x00000080UL
227#define TCP_SOCKET__RELABELTO 0x00000100UL
228#define TCP_SOCKET__APPEND 0x00000200UL
229#define TCP_SOCKET__BIND 0x00000400UL
230#define TCP_SOCKET__CONNECT 0x00000800UL
231#define TCP_SOCKET__LISTEN 0x00001000UL
232#define TCP_SOCKET__ACCEPT 0x00002000UL
233#define TCP_SOCKET__GETOPT 0x00004000UL
234#define TCP_SOCKET__SETOPT 0x00008000UL
235#define TCP_SOCKET__SHUTDOWN 0x00010000UL
236#define TCP_SOCKET__RECVFROM 0x00020000UL
237#define TCP_SOCKET__SENDTO 0x00040000UL
238#define TCP_SOCKET__RECV_MSG 0x00080000UL
239#define TCP_SOCKET__SEND_MSG 0x00100000UL
240#define TCP_SOCKET__NAME_BIND 0x00200000UL
241#define TCP_SOCKET__CONNECTTO 0x00400000UL
242#define TCP_SOCKET__NEWCONN 0x00800000UL
243#define TCP_SOCKET__ACCEPTFROM 0x01000000UL
244#define TCP_SOCKET__NODE_BIND 0x02000000UL
245#define TCP_SOCKET__NAME_CONNECT 0x04000000UL
246#define UDP_SOCKET__IOCTL 0x00000001UL
247#define UDP_SOCKET__READ 0x00000002UL
248#define UDP_SOCKET__WRITE 0x00000004UL
249#define UDP_SOCKET__CREATE 0x00000008UL
250#define UDP_SOCKET__GETATTR 0x00000010UL
251#define UDP_SOCKET__SETATTR 0x00000020UL
252#define UDP_SOCKET__LOCK 0x00000040UL
253#define UDP_SOCKET__RELABELFROM 0x00000080UL
254#define UDP_SOCKET__RELABELTO 0x00000100UL
255#define UDP_SOCKET__APPEND 0x00000200UL
256#define UDP_SOCKET__BIND 0x00000400UL
257#define UDP_SOCKET__CONNECT 0x00000800UL
258#define UDP_SOCKET__LISTEN 0x00001000UL
259#define UDP_SOCKET__ACCEPT 0x00002000UL
260#define UDP_SOCKET__GETOPT 0x00004000UL
261#define UDP_SOCKET__SETOPT 0x00008000UL
262#define UDP_SOCKET__SHUTDOWN 0x00010000UL
263#define UDP_SOCKET__RECVFROM 0x00020000UL
264#define UDP_SOCKET__SENDTO 0x00040000UL
265#define UDP_SOCKET__RECV_MSG 0x00080000UL
266#define UDP_SOCKET__SEND_MSG 0x00100000UL
267#define UDP_SOCKET__NAME_BIND 0x00200000UL
268#define UDP_SOCKET__NODE_BIND 0x00400000UL
269#define RAWIP_SOCKET__IOCTL 0x00000001UL
270#define RAWIP_SOCKET__READ 0x00000002UL
271#define RAWIP_SOCKET__WRITE 0x00000004UL
272#define RAWIP_SOCKET__CREATE 0x00000008UL
273#define RAWIP_SOCKET__GETATTR 0x00000010UL
274#define RAWIP_SOCKET__SETATTR 0x00000020UL
275#define RAWIP_SOCKET__LOCK 0x00000040UL
276#define RAWIP_SOCKET__RELABELFROM 0x00000080UL
277#define RAWIP_SOCKET__RELABELTO 0x00000100UL
278#define RAWIP_SOCKET__APPEND 0x00000200UL
279#define RAWIP_SOCKET__BIND 0x00000400UL
280#define RAWIP_SOCKET__CONNECT 0x00000800UL
281#define RAWIP_SOCKET__LISTEN 0x00001000UL
282#define RAWIP_SOCKET__ACCEPT 0x00002000UL
283#define RAWIP_SOCKET__GETOPT 0x00004000UL
284#define RAWIP_SOCKET__SETOPT 0x00008000UL
285#define RAWIP_SOCKET__SHUTDOWN 0x00010000UL
286#define RAWIP_SOCKET__RECVFROM 0x00020000UL
287#define RAWIP_SOCKET__SENDTO 0x00040000UL
288#define RAWIP_SOCKET__RECV_MSG 0x00080000UL
289#define RAWIP_SOCKET__SEND_MSG 0x00100000UL
290#define RAWIP_SOCKET__NAME_BIND 0x00200000UL
291#define RAWIP_SOCKET__NODE_BIND 0x00400000UL
292#define NODE__TCP_RECV 0x00000001UL
293#define NODE__TCP_SEND 0x00000002UL
294#define NODE__UDP_RECV 0x00000004UL
295#define NODE__UDP_SEND 0x00000008UL
296#define NODE__RAWIP_RECV 0x00000010UL
297#define NODE__RAWIP_SEND 0x00000020UL
298#define NODE__ENFORCE_DEST 0x00000040UL
299#define NODE__DCCP_RECV 0x00000080UL
300#define NODE__DCCP_SEND 0x00000100UL
301#define NODE__RECVFROM 0x00000200UL
302#define NODE__SENDTO 0x00000400UL
303#define NETIF__TCP_RECV 0x00000001UL
304#define NETIF__TCP_SEND 0x00000002UL
305#define NETIF__UDP_RECV 0x00000004UL
306#define NETIF__UDP_SEND 0x00000008UL
307#define NETIF__RAWIP_RECV 0x00000010UL
308#define NETIF__RAWIP_SEND 0x00000020UL
309#define NETIF__DCCP_RECV 0x00000040UL
310#define NETIF__DCCP_SEND 0x00000080UL
311#define NETIF__INGRESS 0x00000100UL
312#define NETIF__EGRESS 0x00000200UL
313#define NETLINK_SOCKET__IOCTL 0x00000001UL
314#define NETLINK_SOCKET__READ 0x00000002UL
315#define NETLINK_SOCKET__WRITE 0x00000004UL
316#define NETLINK_SOCKET__CREATE 0x00000008UL
317#define NETLINK_SOCKET__GETATTR 0x00000010UL
318#define NETLINK_SOCKET__SETATTR 0x00000020UL
319#define NETLINK_SOCKET__LOCK 0x00000040UL
320#define NETLINK_SOCKET__RELABELFROM 0x00000080UL
321#define NETLINK_SOCKET__RELABELTO 0x00000100UL
322#define NETLINK_SOCKET__APPEND 0x00000200UL
323#define NETLINK_SOCKET__BIND 0x00000400UL
324#define NETLINK_SOCKET__CONNECT 0x00000800UL
325#define NETLINK_SOCKET__LISTEN 0x00001000UL
326#define NETLINK_SOCKET__ACCEPT 0x00002000UL
327#define NETLINK_SOCKET__GETOPT 0x00004000UL
328#define NETLINK_SOCKET__SETOPT 0x00008000UL
329#define NETLINK_SOCKET__SHUTDOWN 0x00010000UL
330#define NETLINK_SOCKET__RECVFROM 0x00020000UL
331#define NETLINK_SOCKET__SENDTO 0x00040000UL
332#define NETLINK_SOCKET__RECV_MSG 0x00080000UL
333#define NETLINK_SOCKET__SEND_MSG 0x00100000UL
334#define NETLINK_SOCKET__NAME_BIND 0x00200000UL
335#define PACKET_SOCKET__IOCTL 0x00000001UL
336#define PACKET_SOCKET__READ 0x00000002UL
337#define PACKET_SOCKET__WRITE 0x00000004UL
338#define PACKET_SOCKET__CREATE 0x00000008UL
339#define PACKET_SOCKET__GETATTR 0x00000010UL
340#define PACKET_SOCKET__SETATTR 0x00000020UL
341#define PACKET_SOCKET__LOCK 0x00000040UL
342#define PACKET_SOCKET__RELABELFROM 0x00000080UL
343#define PACKET_SOCKET__RELABELTO 0x00000100UL
344#define PACKET_SOCKET__APPEND 0x00000200UL
345#define PACKET_SOCKET__BIND 0x00000400UL
346#define PACKET_SOCKET__CONNECT 0x00000800UL
347#define PACKET_SOCKET__LISTEN 0x00001000UL
348#define PACKET_SOCKET__ACCEPT 0x00002000UL
349#define PACKET_SOCKET__GETOPT 0x00004000UL
350#define PACKET_SOCKET__SETOPT 0x00008000UL
351#define PACKET_SOCKET__SHUTDOWN 0x00010000UL
352#define PACKET_SOCKET__RECVFROM 0x00020000UL
353#define PACKET_SOCKET__SENDTO 0x00040000UL
354#define PACKET_SOCKET__RECV_MSG 0x00080000UL
355#define PACKET_SOCKET__SEND_MSG 0x00100000UL
356#define PACKET_SOCKET__NAME_BIND 0x00200000UL
357#define KEY_SOCKET__IOCTL 0x00000001UL
358#define KEY_SOCKET__READ 0x00000002UL
359#define KEY_SOCKET__WRITE 0x00000004UL
360#define KEY_SOCKET__CREATE 0x00000008UL
361#define KEY_SOCKET__GETATTR 0x00000010UL
362#define KEY_SOCKET__SETATTR 0x00000020UL
363#define KEY_SOCKET__LOCK 0x00000040UL
364#define KEY_SOCKET__RELABELFROM 0x00000080UL
365#define KEY_SOCKET__RELABELTO 0x00000100UL
366#define KEY_SOCKET__APPEND 0x00000200UL
367#define KEY_SOCKET__BIND 0x00000400UL
368#define KEY_SOCKET__CONNECT 0x00000800UL
369#define KEY_SOCKET__LISTEN 0x00001000UL
370#define KEY_SOCKET__ACCEPT 0x00002000UL
371#define KEY_SOCKET__GETOPT 0x00004000UL
372#define KEY_SOCKET__SETOPT 0x00008000UL
373#define KEY_SOCKET__SHUTDOWN 0x00010000UL
374#define KEY_SOCKET__RECVFROM 0x00020000UL
375#define KEY_SOCKET__SENDTO 0x00040000UL
376#define KEY_SOCKET__RECV_MSG 0x00080000UL
377#define KEY_SOCKET__SEND_MSG 0x00100000UL
378#define KEY_SOCKET__NAME_BIND 0x00200000UL
379#define UNIX_STREAM_SOCKET__IOCTL 0x00000001UL
380#define UNIX_STREAM_SOCKET__READ 0x00000002UL
381#define UNIX_STREAM_SOCKET__WRITE 0x00000004UL
382#define UNIX_STREAM_SOCKET__CREATE 0x00000008UL
383#define UNIX_STREAM_SOCKET__GETATTR 0x00000010UL
384#define UNIX_STREAM_SOCKET__SETATTR 0x00000020UL
385#define UNIX_STREAM_SOCKET__LOCK 0x00000040UL
386#define UNIX_STREAM_SOCKET__RELABELFROM 0x00000080UL
387#define UNIX_STREAM_SOCKET__RELABELTO 0x00000100UL
388#define UNIX_STREAM_SOCKET__APPEND 0x00000200UL
389#define UNIX_STREAM_SOCKET__BIND 0x00000400UL
390#define UNIX_STREAM_SOCKET__CONNECT 0x00000800UL
391#define UNIX_STREAM_SOCKET__LISTEN 0x00001000UL
392#define UNIX_STREAM_SOCKET__ACCEPT 0x00002000UL
393#define UNIX_STREAM_SOCKET__GETOPT 0x00004000UL
394#define UNIX_STREAM_SOCKET__SETOPT 0x00008000UL
395#define UNIX_STREAM_SOCKET__SHUTDOWN 0x00010000UL
396#define UNIX_STREAM_SOCKET__RECVFROM 0x00020000UL
397#define UNIX_STREAM_SOCKET__SENDTO 0x00040000UL
398#define UNIX_STREAM_SOCKET__RECV_MSG 0x00080000UL
399#define UNIX_STREAM_SOCKET__SEND_MSG 0x00100000UL
400#define UNIX_STREAM_SOCKET__NAME_BIND 0x00200000UL
401#define UNIX_STREAM_SOCKET__CONNECTTO 0x00400000UL
402#define UNIX_STREAM_SOCKET__NEWCONN 0x00800000UL
403#define UNIX_STREAM_SOCKET__ACCEPTFROM 0x01000000UL
404#define UNIX_DGRAM_SOCKET__IOCTL 0x00000001UL
405#define UNIX_DGRAM_SOCKET__READ 0x00000002UL
406#define UNIX_DGRAM_SOCKET__WRITE 0x00000004UL
407#define UNIX_DGRAM_SOCKET__CREATE 0x00000008UL
408#define UNIX_DGRAM_SOCKET__GETATTR 0x00000010UL
409#define UNIX_DGRAM_SOCKET__SETATTR 0x00000020UL
410#define UNIX_DGRAM_SOCKET__LOCK 0x00000040UL
411#define UNIX_DGRAM_SOCKET__RELABELFROM 0x00000080UL
412#define UNIX_DGRAM_SOCKET__RELABELTO 0x00000100UL
413#define UNIX_DGRAM_SOCKET__APPEND 0x00000200UL
414#define UNIX_DGRAM_SOCKET__BIND 0x00000400UL
415#define UNIX_DGRAM_SOCKET__CONNECT 0x00000800UL
416#define UNIX_DGRAM_SOCKET__LISTEN 0x00001000UL
417#define UNIX_DGRAM_SOCKET__ACCEPT 0x00002000UL
418#define UNIX_DGRAM_SOCKET__GETOPT 0x00004000UL
419#define UNIX_DGRAM_SOCKET__SETOPT 0x00008000UL
420#define UNIX_DGRAM_SOCKET__SHUTDOWN 0x00010000UL
421#define UNIX_DGRAM_SOCKET__RECVFROM 0x00020000UL
422#define UNIX_DGRAM_SOCKET__SENDTO 0x00040000UL
423#define UNIX_DGRAM_SOCKET__RECV_MSG 0x00080000UL
424#define UNIX_DGRAM_SOCKET__SEND_MSG 0x00100000UL
425#define UNIX_DGRAM_SOCKET__NAME_BIND 0x00200000UL
426#define TUN_SOCKET__IOCTL 0x00000001UL
427#define TUN_SOCKET__READ 0x00000002UL
428#define TUN_SOCKET__WRITE 0x00000004UL
429#define TUN_SOCKET__CREATE 0x00000008UL
430#define TUN_SOCKET__GETATTR 0x00000010UL
431#define TUN_SOCKET__SETATTR 0x00000020UL
432#define TUN_SOCKET__LOCK 0x00000040UL
433#define TUN_SOCKET__RELABELFROM 0x00000080UL
434#define TUN_SOCKET__RELABELTO 0x00000100UL
435#define TUN_SOCKET__APPEND 0x00000200UL
436#define TUN_SOCKET__BIND 0x00000400UL
437#define TUN_SOCKET__CONNECT 0x00000800UL
438#define TUN_SOCKET__LISTEN 0x00001000UL
439#define TUN_SOCKET__ACCEPT 0x00002000UL
440#define TUN_SOCKET__GETOPT 0x00004000UL
441#define TUN_SOCKET__SETOPT 0x00008000UL
442#define TUN_SOCKET__SHUTDOWN 0x00010000UL
443#define TUN_SOCKET__RECVFROM 0x00020000UL
444#define TUN_SOCKET__SENDTO 0x00040000UL
445#define TUN_SOCKET__RECV_MSG 0x00080000UL
446#define TUN_SOCKET__SEND_MSG 0x00100000UL
447#define TUN_SOCKET__NAME_BIND 0x00200000UL
448#define PROCESS__FORK 0x00000001UL
449#define PROCESS__TRANSITION 0x00000002UL
450#define PROCESS__SIGCHLD 0x00000004UL
451#define PROCESS__SIGKILL 0x00000008UL
452#define PROCESS__SIGSTOP 0x00000010UL
453#define PROCESS__SIGNULL 0x00000020UL
454#define PROCESS__SIGNAL 0x00000040UL
455#define PROCESS__PTRACE 0x00000080UL
456#define PROCESS__GETSCHED 0x00000100UL
457#define PROCESS__SETSCHED 0x00000200UL
458#define PROCESS__GETSESSION 0x00000400UL
459#define PROCESS__GETPGID 0x00000800UL
460#define PROCESS__SETPGID 0x00001000UL
461#define PROCESS__GETCAP 0x00002000UL
462#define PROCESS__SETCAP 0x00004000UL
463#define PROCESS__SHARE 0x00008000UL
464#define PROCESS__GETATTR 0x00010000UL
465#define PROCESS__SETEXEC 0x00020000UL
466#define PROCESS__SETFSCREATE 0x00040000UL
467#define PROCESS__NOATSECURE 0x00080000UL
468#define PROCESS__SIGINH 0x00100000UL
469#define PROCESS__SETRLIMIT 0x00200000UL
470#define PROCESS__RLIMITINH 0x00400000UL
471#define PROCESS__DYNTRANSITION 0x00800000UL
472#define PROCESS__SETCURRENT 0x01000000UL
473#define PROCESS__EXECMEM 0x02000000UL
474#define PROCESS__EXECSTACK 0x04000000UL
475#define PROCESS__EXECHEAP 0x08000000UL
476#define PROCESS__SETKEYCREATE 0x10000000UL
477#define PROCESS__SETSOCKCREATE 0x20000000UL
478#define IPC__CREATE 0x00000001UL
479#define IPC__DESTROY 0x00000002UL
480#define IPC__GETATTR 0x00000004UL
481#define IPC__SETATTR 0x00000008UL
482#define IPC__READ 0x00000010UL
483#define IPC__WRITE 0x00000020UL
484#define IPC__ASSOCIATE 0x00000040UL
485#define IPC__UNIX_READ 0x00000080UL
486#define IPC__UNIX_WRITE 0x00000100UL
487#define SEM__CREATE 0x00000001UL
488#define SEM__DESTROY 0x00000002UL
489#define SEM__GETATTR 0x00000004UL
490#define SEM__SETATTR 0x00000008UL
491#define SEM__READ 0x00000010UL
492#define SEM__WRITE 0x00000020UL
493#define SEM__ASSOCIATE 0x00000040UL
494#define SEM__UNIX_READ 0x00000080UL
495#define SEM__UNIX_WRITE 0x00000100UL
496#define MSGQ__CREATE 0x00000001UL
497#define MSGQ__DESTROY 0x00000002UL
498#define MSGQ__GETATTR 0x00000004UL
499#define MSGQ__SETATTR 0x00000008UL
500#define MSGQ__READ 0x00000010UL
501#define MSGQ__WRITE 0x00000020UL
502#define MSGQ__ASSOCIATE 0x00000040UL
503#define MSGQ__UNIX_READ 0x00000080UL
504#define MSGQ__UNIX_WRITE 0x00000100UL
505#define MSGQ__ENQUEUE 0x00000200UL
506#define MSG__SEND 0x00000001UL
507#define MSG__RECEIVE 0x00000002UL
508#define SHM__CREATE 0x00000001UL
509#define SHM__DESTROY 0x00000002UL
510#define SHM__GETATTR 0x00000004UL
511#define SHM__SETATTR 0x00000008UL
512#define SHM__READ 0x00000010UL
513#define SHM__WRITE 0x00000020UL
514#define SHM__ASSOCIATE 0x00000040UL
515#define SHM__UNIX_READ 0x00000080UL
516#define SHM__UNIX_WRITE 0x00000100UL
517#define SHM__LOCK 0x00000200UL
518#define SECURITY__COMPUTE_AV 0x00000001UL
519#define SECURITY__COMPUTE_CREATE 0x00000002UL
520#define SECURITY__COMPUTE_MEMBER 0x00000004UL
521#define SECURITY__CHECK_CONTEXT 0x00000008UL
522#define SECURITY__LOAD_POLICY 0x00000010UL
523#define SECURITY__COMPUTE_RELABEL 0x00000020UL
524#define SECURITY__COMPUTE_USER 0x00000040UL
525#define SECURITY__SETENFORCE 0x00000080UL
526#define SECURITY__SETBOOL 0x00000100UL
527#define SECURITY__SETSECPARAM 0x00000200UL
528#define SECURITY__SETCHECKREQPROT 0x00000400UL
529#define SYSTEM__IPC_INFO 0x00000001UL
530#define SYSTEM__SYSLOG_READ 0x00000002UL
531#define SYSTEM__SYSLOG_MOD 0x00000004UL
532#define SYSTEM__SYSLOG_CONSOLE 0x00000008UL
533#define SYSTEM__MODULE_REQUEST 0x00000010UL
534#define CAPABILITY__CHOWN 0x00000001UL
535#define CAPABILITY__DAC_OVERRIDE 0x00000002UL
536#define CAPABILITY__DAC_READ_SEARCH 0x00000004UL
537#define CAPABILITY__FOWNER 0x00000008UL
538#define CAPABILITY__FSETID 0x00000010UL
539#define CAPABILITY__KILL 0x00000020UL
540#define CAPABILITY__SETGID 0x00000040UL
541#define CAPABILITY__SETUID 0x00000080UL
542#define CAPABILITY__SETPCAP 0x00000100UL
543#define CAPABILITY__LINUX_IMMUTABLE 0x00000200UL
544#define CAPABILITY__NET_BIND_SERVICE 0x00000400UL
545#define CAPABILITY__NET_BROADCAST 0x00000800UL
546#define CAPABILITY__NET_ADMIN 0x00001000UL
547#define CAPABILITY__NET_RAW 0x00002000UL
548#define CAPABILITY__IPC_LOCK 0x00004000UL
549#define CAPABILITY__IPC_OWNER 0x00008000UL
550#define CAPABILITY__SYS_MODULE 0x00010000UL
551#define CAPABILITY__SYS_RAWIO 0x00020000UL
552#define CAPABILITY__SYS_CHROOT 0x00040000UL
553#define CAPABILITY__SYS_PTRACE 0x00080000UL
554#define CAPABILITY__SYS_PACCT 0x00100000UL
555#define CAPABILITY__SYS_ADMIN 0x00200000UL
556#define CAPABILITY__SYS_BOOT 0x00400000UL
557#define CAPABILITY__SYS_NICE 0x00800000UL
558#define CAPABILITY__SYS_RESOURCE 0x01000000UL
559#define CAPABILITY__SYS_TIME 0x02000000UL
560#define CAPABILITY__SYS_TTY_CONFIG 0x04000000UL
561#define CAPABILITY__MKNOD 0x08000000UL
562#define CAPABILITY__LEASE 0x10000000UL
563#define CAPABILITY__AUDIT_WRITE 0x20000000UL
564#define CAPABILITY__AUDIT_CONTROL 0x40000000UL
565#define CAPABILITY__SETFCAP 0x80000000UL
566#define CAPABILITY2__MAC_OVERRIDE 0x00000001UL
567#define CAPABILITY2__MAC_ADMIN 0x00000002UL
568#define NETLINK_ROUTE_SOCKET__IOCTL 0x00000001UL
569#define NETLINK_ROUTE_SOCKET__READ 0x00000002UL
570#define NETLINK_ROUTE_SOCKET__WRITE 0x00000004UL
571#define NETLINK_ROUTE_SOCKET__CREATE 0x00000008UL
572#define NETLINK_ROUTE_SOCKET__GETATTR 0x00000010UL
573#define NETLINK_ROUTE_SOCKET__SETATTR 0x00000020UL
574#define NETLINK_ROUTE_SOCKET__LOCK 0x00000040UL
575#define NETLINK_ROUTE_SOCKET__RELABELFROM 0x00000080UL
576#define NETLINK_ROUTE_SOCKET__RELABELTO 0x00000100UL
577#define NETLINK_ROUTE_SOCKET__APPEND 0x00000200UL
578#define NETLINK_ROUTE_SOCKET__BIND 0x00000400UL
579#define NETLINK_ROUTE_SOCKET__CONNECT 0x00000800UL
580#define NETLINK_ROUTE_SOCKET__LISTEN 0x00001000UL
581#define NETLINK_ROUTE_SOCKET__ACCEPT 0x00002000UL
582#define NETLINK_ROUTE_SOCKET__GETOPT 0x00004000UL
583#define NETLINK_ROUTE_SOCKET__SETOPT 0x00008000UL
584#define NETLINK_ROUTE_SOCKET__SHUTDOWN 0x00010000UL
585#define NETLINK_ROUTE_SOCKET__RECVFROM 0x00020000UL
586#define NETLINK_ROUTE_SOCKET__SENDTO 0x00040000UL
587#define NETLINK_ROUTE_SOCKET__RECV_MSG 0x00080000UL
588#define NETLINK_ROUTE_SOCKET__SEND_MSG 0x00100000UL
589#define NETLINK_ROUTE_SOCKET__NAME_BIND 0x00200000UL
590#define NETLINK_ROUTE_SOCKET__NLMSG_READ 0x00400000UL
591#define NETLINK_ROUTE_SOCKET__NLMSG_WRITE 0x00800000UL
592#define NETLINK_FIREWALL_SOCKET__IOCTL 0x00000001UL
593#define NETLINK_FIREWALL_SOCKET__READ 0x00000002UL
594#define NETLINK_FIREWALL_SOCKET__WRITE 0x00000004UL
595#define NETLINK_FIREWALL_SOCKET__CREATE 0x00000008UL
596#define NETLINK_FIREWALL_SOCKET__GETATTR 0x00000010UL
597#define NETLINK_FIREWALL_SOCKET__SETATTR 0x00000020UL
598#define NETLINK_FIREWALL_SOCKET__LOCK 0x00000040UL
599#define NETLINK_FIREWALL_SOCKET__RELABELFROM 0x00000080UL
600#define NETLINK_FIREWALL_SOCKET__RELABELTO 0x00000100UL
601#define NETLINK_FIREWALL_SOCKET__APPEND 0x00000200UL
602#define NETLINK_FIREWALL_SOCKET__BIND 0x00000400UL
603#define NETLINK_FIREWALL_SOCKET__CONNECT 0x00000800UL
604#define NETLINK_FIREWALL_SOCKET__LISTEN 0x00001000UL
605#define NETLINK_FIREWALL_SOCKET__ACCEPT 0x00002000UL
606#define NETLINK_FIREWALL_SOCKET__GETOPT 0x00004000UL
607#define NETLINK_FIREWALL_SOCKET__SETOPT 0x00008000UL
608#define NETLINK_FIREWALL_SOCKET__SHUTDOWN 0x00010000UL
609#define NETLINK_FIREWALL_SOCKET__RECVFROM 0x00020000UL
610#define NETLINK_FIREWALL_SOCKET__SENDTO 0x00040000UL
611#define NETLINK_FIREWALL_SOCKET__RECV_MSG 0x00080000UL
612#define NETLINK_FIREWALL_SOCKET__SEND_MSG 0x00100000UL
613#define NETLINK_FIREWALL_SOCKET__NAME_BIND 0x00200000UL
614#define NETLINK_FIREWALL_SOCKET__NLMSG_READ 0x00400000UL
615#define NETLINK_FIREWALL_SOCKET__NLMSG_WRITE 0x00800000UL
616#define NETLINK_TCPDIAG_SOCKET__IOCTL 0x00000001UL
617#define NETLINK_TCPDIAG_SOCKET__READ 0x00000002UL
618#define NETLINK_TCPDIAG_SOCKET__WRITE 0x00000004UL
619#define NETLINK_TCPDIAG_SOCKET__CREATE 0x00000008UL
620#define NETLINK_TCPDIAG_SOCKET__GETATTR 0x00000010UL
621#define NETLINK_TCPDIAG_SOCKET__SETATTR 0x00000020UL
622#define NETLINK_TCPDIAG_SOCKET__LOCK 0x00000040UL
623#define NETLINK_TCPDIAG_SOCKET__RELABELFROM 0x00000080UL
624#define NETLINK_TCPDIAG_SOCKET__RELABELTO 0x00000100UL
625#define NETLINK_TCPDIAG_SOCKET__APPEND 0x00000200UL
626#define NETLINK_TCPDIAG_SOCKET__BIND 0x00000400UL
627#define NETLINK_TCPDIAG_SOCKET__CONNECT 0x00000800UL
628#define NETLINK_TCPDIAG_SOCKET__LISTEN 0x00001000UL
629#define NETLINK_TCPDIAG_SOCKET__ACCEPT 0x00002000UL
630#define NETLINK_TCPDIAG_SOCKET__GETOPT 0x00004000UL
631#define NETLINK_TCPDIAG_SOCKET__SETOPT 0x00008000UL
632#define NETLINK_TCPDIAG_SOCKET__SHUTDOWN 0x00010000UL
633#define NETLINK_TCPDIAG_SOCKET__RECVFROM 0x00020000UL
634#define NETLINK_TCPDIAG_SOCKET__SENDTO 0x00040000UL
635#define NETLINK_TCPDIAG_SOCKET__RECV_MSG 0x00080000UL
636#define NETLINK_TCPDIAG_SOCKET__SEND_MSG 0x00100000UL
637#define NETLINK_TCPDIAG_SOCKET__NAME_BIND 0x00200000UL
638#define NETLINK_TCPDIAG_SOCKET__NLMSG_READ 0x00400000UL
639#define NETLINK_TCPDIAG_SOCKET__NLMSG_WRITE 0x00800000UL
640#define NETLINK_NFLOG_SOCKET__IOCTL 0x00000001UL
641#define NETLINK_NFLOG_SOCKET__READ 0x00000002UL
642#define NETLINK_NFLOG_SOCKET__WRITE 0x00000004UL
643#define NETLINK_NFLOG_SOCKET__CREATE 0x00000008UL
644#define NETLINK_NFLOG_SOCKET__GETATTR 0x00000010UL
645#define NETLINK_NFLOG_SOCKET__SETATTR 0x00000020UL
646#define NETLINK_NFLOG_SOCKET__LOCK 0x00000040UL
647#define NETLINK_NFLOG_SOCKET__RELABELFROM 0x00000080UL
648#define NETLINK_NFLOG_SOCKET__RELABELTO 0x00000100UL
649#define NETLINK_NFLOG_SOCKET__APPEND 0x00000200UL
650#define NETLINK_NFLOG_SOCKET__BIND 0x00000400UL
651#define NETLINK_NFLOG_SOCKET__CONNECT 0x00000800UL
652#define NETLINK_NFLOG_SOCKET__LISTEN 0x00001000UL
653#define NETLINK_NFLOG_SOCKET__ACCEPT 0x00002000UL
654#define NETLINK_NFLOG_SOCKET__GETOPT 0x00004000UL
655#define NETLINK_NFLOG_SOCKET__SETOPT 0x00008000UL
656#define NETLINK_NFLOG_SOCKET__SHUTDOWN 0x00010000UL
657#define NETLINK_NFLOG_SOCKET__RECVFROM 0x00020000UL
658#define NETLINK_NFLOG_SOCKET__SENDTO 0x00040000UL
659#define NETLINK_NFLOG_SOCKET__RECV_MSG 0x00080000UL
660#define NETLINK_NFLOG_SOCKET__SEND_MSG 0x00100000UL
661#define NETLINK_NFLOG_SOCKET__NAME_BIND 0x00200000UL
662#define NETLINK_XFRM_SOCKET__IOCTL 0x00000001UL
663#define NETLINK_XFRM_SOCKET__READ 0x00000002UL
664#define NETLINK_XFRM_SOCKET__WRITE 0x00000004UL
665#define NETLINK_XFRM_SOCKET__CREATE 0x00000008UL
666#define NETLINK_XFRM_SOCKET__GETATTR 0x00000010UL
667#define NETLINK_XFRM_SOCKET__SETATTR 0x00000020UL
668#define NETLINK_XFRM_SOCKET__LOCK 0x00000040UL
669#define NETLINK_XFRM_SOCKET__RELABELFROM 0x00000080UL
670#define NETLINK_XFRM_SOCKET__RELABELTO 0x00000100UL
671#define NETLINK_XFRM_SOCKET__APPEND 0x00000200UL
672#define NETLINK_XFRM_SOCKET__BIND 0x00000400UL
673#define NETLINK_XFRM_SOCKET__CONNECT 0x00000800UL
674#define NETLINK_XFRM_SOCKET__LISTEN 0x00001000UL
675#define NETLINK_XFRM_SOCKET__ACCEPT 0x00002000UL
676#define NETLINK_XFRM_SOCKET__GETOPT 0x00004000UL
677#define NETLINK_XFRM_SOCKET__SETOPT 0x00008000UL
678#define NETLINK_XFRM_SOCKET__SHUTDOWN 0x00010000UL
679#define NETLINK_XFRM_SOCKET__RECVFROM 0x00020000UL
680#define NETLINK_XFRM_SOCKET__SENDTO 0x00040000UL
681#define NETLINK_XFRM_SOCKET__RECV_MSG 0x00080000UL
682#define NETLINK_XFRM_SOCKET__SEND_MSG 0x00100000UL
683#define NETLINK_XFRM_SOCKET__NAME_BIND 0x00200000UL
684#define NETLINK_XFRM_SOCKET__NLMSG_READ 0x00400000UL
685#define NETLINK_XFRM_SOCKET__NLMSG_WRITE 0x00800000UL
686#define NETLINK_SELINUX_SOCKET__IOCTL 0x00000001UL
687#define NETLINK_SELINUX_SOCKET__READ 0x00000002UL
688#define NETLINK_SELINUX_SOCKET__WRITE 0x00000004UL
689#define NETLINK_SELINUX_SOCKET__CREATE 0x00000008UL
690#define NETLINK_SELINUX_SOCKET__GETATTR 0x00000010UL
691#define NETLINK_SELINUX_SOCKET__SETATTR 0x00000020UL
692#define NETLINK_SELINUX_SOCKET__LOCK 0x00000040UL
693#define NETLINK_SELINUX_SOCKET__RELABELFROM 0x00000080UL
694#define NETLINK_SELINUX_SOCKET__RELABELTO 0x00000100UL
695#define NETLINK_SELINUX_SOCKET__APPEND 0x00000200UL
696#define NETLINK_SELINUX_SOCKET__BIND 0x00000400UL
697#define NETLINK_SELINUX_SOCKET__CONNECT 0x00000800UL
698#define NETLINK_SELINUX_SOCKET__LISTEN 0x00001000UL
699#define NETLINK_SELINUX_SOCKET__ACCEPT 0x00002000UL
700#define NETLINK_SELINUX_SOCKET__GETOPT 0x00004000UL
701#define NETLINK_SELINUX_SOCKET__SETOPT 0x00008000UL
702#define NETLINK_SELINUX_SOCKET__SHUTDOWN 0x00010000UL
703#define NETLINK_SELINUX_SOCKET__RECVFROM 0x00020000UL
704#define NETLINK_SELINUX_SOCKET__SENDTO 0x00040000UL
705#define NETLINK_SELINUX_SOCKET__RECV_MSG 0x00080000UL
706#define NETLINK_SELINUX_SOCKET__SEND_MSG 0x00100000UL
707#define NETLINK_SELINUX_SOCKET__NAME_BIND 0x00200000UL
708#define NETLINK_AUDIT_SOCKET__IOCTL 0x00000001UL
709#define NETLINK_AUDIT_SOCKET__READ 0x00000002UL
710#define NETLINK_AUDIT_SOCKET__WRITE 0x00000004UL
711#define NETLINK_AUDIT_SOCKET__CREATE 0x00000008UL
712#define NETLINK_AUDIT_SOCKET__GETATTR 0x00000010UL
713#define NETLINK_AUDIT_SOCKET__SETATTR 0x00000020UL
714#define NETLINK_AUDIT_SOCKET__LOCK 0x00000040UL
715#define NETLINK_AUDIT_SOCKET__RELABELFROM 0x00000080UL
716#define NETLINK_AUDIT_SOCKET__RELABELTO 0x00000100UL
717#define NETLINK_AUDIT_SOCKET__APPEND 0x00000200UL
718#define NETLINK_AUDIT_SOCKET__BIND 0x00000400UL
719#define NETLINK_AUDIT_SOCKET__CONNECT 0x00000800UL
720#define NETLINK_AUDIT_SOCKET__LISTEN 0x00001000UL
721#define NETLINK_AUDIT_SOCKET__ACCEPT 0x00002000UL
722#define NETLINK_AUDIT_SOCKET__GETOPT 0x00004000UL
723#define NETLINK_AUDIT_SOCKET__SETOPT 0x00008000UL
724#define NETLINK_AUDIT_SOCKET__SHUTDOWN 0x00010000UL
725#define NETLINK_AUDIT_SOCKET__RECVFROM 0x00020000UL
726#define NETLINK_AUDIT_SOCKET__SENDTO 0x00040000UL
727#define NETLINK_AUDIT_SOCKET__RECV_MSG 0x00080000UL
728#define NETLINK_AUDIT_SOCKET__SEND_MSG 0x00100000UL
729#define NETLINK_AUDIT_SOCKET__NAME_BIND 0x00200000UL
730#define NETLINK_AUDIT_SOCKET__NLMSG_READ 0x00400000UL
731#define NETLINK_AUDIT_SOCKET__NLMSG_WRITE 0x00800000UL
732#define NETLINK_AUDIT_SOCKET__NLMSG_RELAY 0x01000000UL
733#define NETLINK_AUDIT_SOCKET__NLMSG_READPRIV 0x02000000UL
734#define NETLINK_AUDIT_SOCKET__NLMSG_TTY_AUDIT 0x04000000UL
735#define NETLINK_IP6FW_SOCKET__IOCTL 0x00000001UL
736#define NETLINK_IP6FW_SOCKET__READ 0x00000002UL
737#define NETLINK_IP6FW_SOCKET__WRITE 0x00000004UL
738#define NETLINK_IP6FW_SOCKET__CREATE 0x00000008UL
739#define NETLINK_IP6FW_SOCKET__GETATTR 0x00000010UL
740#define NETLINK_IP6FW_SOCKET__SETATTR 0x00000020UL
741#define NETLINK_IP6FW_SOCKET__LOCK 0x00000040UL
742#define NETLINK_IP6FW_SOCKET__RELABELFROM 0x00000080UL
743#define NETLINK_IP6FW_SOCKET__RELABELTO 0x00000100UL
744#define NETLINK_IP6FW_SOCKET__APPEND 0x00000200UL
745#define NETLINK_IP6FW_SOCKET__BIND 0x00000400UL
746#define NETLINK_IP6FW_SOCKET__CONNECT 0x00000800UL
747#define NETLINK_IP6FW_SOCKET__LISTEN 0x00001000UL
748#define NETLINK_IP6FW_SOCKET__ACCEPT 0x00002000UL
749#define NETLINK_IP6FW_SOCKET__GETOPT 0x00004000UL
750#define NETLINK_IP6FW_SOCKET__SETOPT 0x00008000UL
751#define NETLINK_IP6FW_SOCKET__SHUTDOWN 0x00010000UL
752#define NETLINK_IP6FW_SOCKET__RECVFROM 0x00020000UL
753#define NETLINK_IP6FW_SOCKET__SENDTO 0x00040000UL
754#define NETLINK_IP6FW_SOCKET__RECV_MSG 0x00080000UL
755#define NETLINK_IP6FW_SOCKET__SEND_MSG 0x00100000UL
756#define NETLINK_IP6FW_SOCKET__NAME_BIND 0x00200000UL
757#define NETLINK_IP6FW_SOCKET__NLMSG_READ 0x00400000UL
758#define NETLINK_IP6FW_SOCKET__NLMSG_WRITE 0x00800000UL
759#define NETLINK_DNRT_SOCKET__IOCTL 0x00000001UL
760#define NETLINK_DNRT_SOCKET__READ 0x00000002UL
761#define NETLINK_DNRT_SOCKET__WRITE 0x00000004UL
762#define NETLINK_DNRT_SOCKET__CREATE 0x00000008UL
763#define NETLINK_DNRT_SOCKET__GETATTR 0x00000010UL
764#define NETLINK_DNRT_SOCKET__SETATTR 0x00000020UL
765#define NETLINK_DNRT_SOCKET__LOCK 0x00000040UL
766#define NETLINK_DNRT_SOCKET__RELABELFROM 0x00000080UL
767#define NETLINK_DNRT_SOCKET__RELABELTO 0x00000100UL
768#define NETLINK_DNRT_SOCKET__APPEND 0x00000200UL
769#define NETLINK_DNRT_SOCKET__BIND 0x00000400UL
770#define NETLINK_DNRT_SOCKET__CONNECT 0x00000800UL
771#define NETLINK_DNRT_SOCKET__LISTEN 0x00001000UL
772#define NETLINK_DNRT_SOCKET__ACCEPT 0x00002000UL
773#define NETLINK_DNRT_SOCKET__GETOPT 0x00004000UL
774#define NETLINK_DNRT_SOCKET__SETOPT 0x00008000UL
775#define NETLINK_DNRT_SOCKET__SHUTDOWN 0x00010000UL
776#define NETLINK_DNRT_SOCKET__RECVFROM 0x00020000UL
777#define NETLINK_DNRT_SOCKET__SENDTO 0x00040000UL
778#define NETLINK_DNRT_SOCKET__RECV_MSG 0x00080000UL
779#define NETLINK_DNRT_SOCKET__SEND_MSG 0x00100000UL
780#define NETLINK_DNRT_SOCKET__NAME_BIND 0x00200000UL
781#define ASSOCIATION__SENDTO 0x00000001UL
782#define ASSOCIATION__RECVFROM 0x00000002UL
783#define ASSOCIATION__SETCONTEXT 0x00000004UL
784#define ASSOCIATION__POLMATCH 0x00000008UL
785#define NETLINK_KOBJECT_UEVENT_SOCKET__IOCTL 0x00000001UL
786#define NETLINK_KOBJECT_UEVENT_SOCKET__READ 0x00000002UL
787#define NETLINK_KOBJECT_UEVENT_SOCKET__WRITE 0x00000004UL
788#define NETLINK_KOBJECT_UEVENT_SOCKET__CREATE 0x00000008UL
789#define NETLINK_KOBJECT_UEVENT_SOCKET__GETATTR 0x00000010UL
790#define NETLINK_KOBJECT_UEVENT_SOCKET__SETATTR 0x00000020UL
791#define NETLINK_KOBJECT_UEVENT_SOCKET__LOCK 0x00000040UL
792#define NETLINK_KOBJECT_UEVENT_SOCKET__RELABELFROM 0x00000080UL
793#define NETLINK_KOBJECT_UEVENT_SOCKET__RELABELTO 0x00000100UL
794#define NETLINK_KOBJECT_UEVENT_SOCKET__APPEND 0x00000200UL
795#define NETLINK_KOBJECT_UEVENT_SOCKET__BIND 0x00000400UL
796#define NETLINK_KOBJECT_UEVENT_SOCKET__CONNECT 0x00000800UL
797#define NETLINK_KOBJECT_UEVENT_SOCKET__LISTEN 0x00001000UL
798#define NETLINK_KOBJECT_UEVENT_SOCKET__ACCEPT 0x00002000UL
799#define NETLINK_KOBJECT_UEVENT_SOCKET__GETOPT 0x00004000UL
800#define NETLINK_KOBJECT_UEVENT_SOCKET__SETOPT 0x00008000UL
801#define NETLINK_KOBJECT_UEVENT_SOCKET__SHUTDOWN 0x00010000UL
802#define NETLINK_KOBJECT_UEVENT_SOCKET__RECVFROM 0x00020000UL
803#define NETLINK_KOBJECT_UEVENT_SOCKET__SENDTO 0x00040000UL
804#define NETLINK_KOBJECT_UEVENT_SOCKET__RECV_MSG 0x00080000UL
805#define NETLINK_KOBJECT_UEVENT_SOCKET__SEND_MSG 0x00100000UL
806#define NETLINK_KOBJECT_UEVENT_SOCKET__NAME_BIND 0x00200000UL
807#define APPLETALK_SOCKET__IOCTL 0x00000001UL
808#define APPLETALK_SOCKET__READ 0x00000002UL
809#define APPLETALK_SOCKET__WRITE 0x00000004UL
810#define APPLETALK_SOCKET__CREATE 0x00000008UL
811#define APPLETALK_SOCKET__GETATTR 0x00000010UL
812#define APPLETALK_SOCKET__SETATTR 0x00000020UL
813#define APPLETALK_SOCKET__LOCK 0x00000040UL
814#define APPLETALK_SOCKET__RELABELFROM 0x00000080UL
815#define APPLETALK_SOCKET__RELABELTO 0x00000100UL
816#define APPLETALK_SOCKET__APPEND 0x00000200UL
817#define APPLETALK_SOCKET__BIND 0x00000400UL
818#define APPLETALK_SOCKET__CONNECT 0x00000800UL
819#define APPLETALK_SOCKET__LISTEN 0x00001000UL
820#define APPLETALK_SOCKET__ACCEPT 0x00002000UL
821#define APPLETALK_SOCKET__GETOPT 0x00004000UL
822#define APPLETALK_SOCKET__SETOPT 0x00008000UL
823#define APPLETALK_SOCKET__SHUTDOWN 0x00010000UL
824#define APPLETALK_SOCKET__RECVFROM 0x00020000UL
825#define APPLETALK_SOCKET__SENDTO 0x00040000UL
826#define APPLETALK_SOCKET__RECV_MSG 0x00080000UL
827#define APPLETALK_SOCKET__SEND_MSG 0x00100000UL
828#define APPLETALK_SOCKET__NAME_BIND 0x00200000UL
829#define PACKET__SEND 0x00000001UL
830#define PACKET__RECV 0x00000002UL
831#define PACKET__RELABELTO 0x00000004UL
832#define PACKET__FLOW_IN 0x00000008UL
833#define PACKET__FLOW_OUT 0x00000010UL
834#define PACKET__FORWARD_IN 0x00000020UL
835#define PACKET__FORWARD_OUT 0x00000040UL
836#define KEY__VIEW 0x00000001UL
837#define KEY__READ 0x00000002UL
838#define KEY__WRITE 0x00000004UL
839#define KEY__SEARCH 0x00000008UL
840#define KEY__LINK 0x00000010UL
841#define KEY__SETATTR 0x00000020UL
842#define KEY__CREATE 0x00000040UL
843#define DCCP_SOCKET__IOCTL 0x00000001UL
844#define DCCP_SOCKET__READ 0x00000002UL
845#define DCCP_SOCKET__WRITE 0x00000004UL
846#define DCCP_SOCKET__CREATE 0x00000008UL
847#define DCCP_SOCKET__GETATTR 0x00000010UL
848#define DCCP_SOCKET__SETATTR 0x00000020UL
849#define DCCP_SOCKET__LOCK 0x00000040UL
850#define DCCP_SOCKET__RELABELFROM 0x00000080UL
851#define DCCP_SOCKET__RELABELTO 0x00000100UL
852#define DCCP_SOCKET__APPEND 0x00000200UL
853#define DCCP_SOCKET__BIND 0x00000400UL
854#define DCCP_SOCKET__CONNECT 0x00000800UL
855#define DCCP_SOCKET__LISTEN 0x00001000UL
856#define DCCP_SOCKET__ACCEPT 0x00002000UL
857#define DCCP_SOCKET__GETOPT 0x00004000UL
858#define DCCP_SOCKET__SETOPT 0x00008000UL
859#define DCCP_SOCKET__SHUTDOWN 0x00010000UL
860#define DCCP_SOCKET__RECVFROM 0x00020000UL
861#define DCCP_SOCKET__SENDTO 0x00040000UL
862#define DCCP_SOCKET__RECV_MSG 0x00080000UL
863#define DCCP_SOCKET__SEND_MSG 0x00100000UL
864#define DCCP_SOCKET__NAME_BIND 0x00200000UL
865#define DCCP_SOCKET__NODE_BIND 0x00400000UL
866#define DCCP_SOCKET__NAME_CONNECT 0x00800000UL
867#define MEMPROTECT__MMAP_ZERO 0x00000001UL
868#define PEER__RECV 0x00000001UL
869#define KERNEL_SERVICE__USE_AS_OVERRIDE 0x00000001UL
870#define KERNEL_SERVICE__CREATE_FILES_AS 0x00000002UL
diff --git a/security/selinux/include/avc_ss.h b/security/selinux/include/avc_ss.h
index bb1ec801bdfe..4677aa519b04 100644
--- a/security/selinux/include/avc_ss.h
+++ b/security/selinux/include/avc_ss.h
@@ -10,26 +10,13 @@
10 10
11int avc_ss_reset(u32 seqno); 11int avc_ss_reset(u32 seqno);
12 12
13struct av_perm_to_string { 13/* Class/perm mapping support */
14 u16 tclass; 14struct security_class_mapping {
15 u32 value;
16 const char *name; 15 const char *name;
16 const char *perms[sizeof(u32) * 8 + 1];
17}; 17};
18 18
19struct av_inherit { 19extern struct security_class_mapping secclass_map[];
20 const char **common_pts;
21 u32 common_base;
22 u16 tclass;
23};
24
25struct selinux_class_perm {
26 const struct av_perm_to_string *av_perm_to_string;
27 u32 av_pts_len;
28 u32 cts_len;
29 const char **class_to_string;
30 const struct av_inherit *av_inherit;
31 u32 av_inherit_len;
32};
33 20
34#endif /* _SELINUX_AVC_SS_H_ */ 21#endif /* _SELINUX_AVC_SS_H_ */
35 22
diff --git a/security/selinux/include/class_to_string.h b/security/selinux/include/class_to_string.h
deleted file mode 100644
index 7ab9299bfb6b..000000000000
--- a/security/selinux/include/class_to_string.h
+++ /dev/null
@@ -1,80 +0,0 @@
1/* This file is automatically generated. Do not edit. */
2/*
3 * Security object class definitions
4 */
5 S_(NULL)
6 S_("security")
7 S_("process")
8 S_("system")
9 S_("capability")
10 S_("filesystem")
11 S_("file")
12 S_("dir")
13 S_("fd")
14 S_("lnk_file")
15 S_("chr_file")
16 S_("blk_file")
17 S_("sock_file")
18 S_("fifo_file")
19 S_("socket")
20 S_("tcp_socket")
21 S_("udp_socket")
22 S_("rawip_socket")
23 S_("node")
24 S_("netif")
25 S_("netlink_socket")
26 S_("packet_socket")
27 S_("key_socket")
28 S_("unix_stream_socket")
29 S_("unix_dgram_socket")
30 S_("sem")
31 S_("msg")
32 S_("msgq")
33 S_("shm")
34 S_("ipc")
35 S_(NULL)
36 S_(NULL)
37 S_(NULL)
38 S_(NULL)
39 S_(NULL)
40 S_(NULL)
41 S_(NULL)
42 S_(NULL)
43 S_(NULL)
44 S_(NULL)
45 S_(NULL)
46 S_(NULL)
47 S_(NULL)
48 S_("netlink_route_socket")
49 S_("netlink_firewall_socket")
50 S_("netlink_tcpdiag_socket")
51 S_("netlink_nflog_socket")
52 S_("netlink_xfrm_socket")
53 S_("netlink_selinux_socket")
54 S_("netlink_audit_socket")
55 S_("netlink_ip6fw_socket")
56 S_("netlink_dnrt_socket")
57 S_(NULL)
58 S_(NULL)
59 S_("association")
60 S_("netlink_kobject_uevent_socket")
61 S_("appletalk_socket")
62 S_("packet")
63 S_("key")
64 S_(NULL)
65 S_("dccp_socket")
66 S_("memprotect")
67 S_(NULL)
68 S_(NULL)
69 S_(NULL)
70 S_(NULL)
71 S_(NULL)
72 S_(NULL)
73 S_("peer")
74 S_("capability2")
75 S_(NULL)
76 S_(NULL)
77 S_(NULL)
78 S_(NULL)
79 S_("kernel_service")
80 S_("tun_socket")
diff --git a/security/selinux/include/classmap.h b/security/selinux/include/classmap.h
new file mode 100644
index 000000000000..8b32e959bb2e
--- /dev/null
+++ b/security/selinux/include/classmap.h
@@ -0,0 +1,150 @@
1#define COMMON_FILE_SOCK_PERMS "ioctl", "read", "write", "create", \
2 "getattr", "setattr", "lock", "relabelfrom", "relabelto", "append"
3
4#define COMMON_FILE_PERMS COMMON_FILE_SOCK_PERMS, "unlink", "link", \
5 "rename", "execute", "swapon", "quotaon", "mounton"
6
7#define COMMON_SOCK_PERMS COMMON_FILE_SOCK_PERMS, "bind", "connect", \
8 "listen", "accept", "getopt", "setopt", "shutdown", "recvfrom", \
9 "sendto", "recv_msg", "send_msg", "name_bind"
10
11#define COMMON_IPC_PERMS "create", "destroy", "getattr", "setattr", "read", \
12 "write", "associate", "unix_read", "unix_write"
13
14struct security_class_mapping secclass_map[] = {
15 { "security",
16 { "compute_av", "compute_create", "compute_member",
17 "check_context", "load_policy", "compute_relabel",
18 "compute_user", "setenforce", "setbool", "setsecparam",
19 "setcheckreqprot", NULL } },
20 { "process",
21 { "fork", "transition", "sigchld", "sigkill",
22 "sigstop", "signull", "signal", "ptrace", "getsched", "setsched",
23 "getsession", "getpgid", "setpgid", "getcap", "setcap", "share",
24 "getattr", "setexec", "setfscreate", "noatsecure", "siginh",
25 "setrlimit", "rlimitinh", "dyntransition", "setcurrent",
26 "execmem", "execstack", "execheap", "setkeycreate",
27 "setsockcreate", NULL } },
28 { "system",
29 { "ipc_info", "syslog_read", "syslog_mod",
30 "syslog_console", "module_request", NULL } },
31 { "capability",
32 { "chown", "dac_override", "dac_read_search",
33 "fowner", "fsetid", "kill", "setgid", "setuid", "setpcap",
34 "linux_immutable", "net_bind_service", "net_broadcast",
35 "net_admin", "net_raw", "ipc_lock", "ipc_owner", "sys_module",
36 "sys_rawio", "sys_chroot", "sys_ptrace", "sys_pacct", "sys_admin",
37 "sys_boot", "sys_nice", "sys_resource", "sys_time",
38 "sys_tty_config", "mknod", "lease", "audit_write",
39 "audit_control", "setfcap", NULL } },
40 { "filesystem",
41 { "mount", "remount", "unmount", "getattr",
42 "relabelfrom", "relabelto", "transition", "associate", "quotamod",
43 "quotaget", NULL } },
44 { "file",
45 { COMMON_FILE_PERMS,
46 "execute_no_trans", "entrypoint", "execmod", "open", NULL } },
47 { "dir",
48 { COMMON_FILE_PERMS, "add_name", "remove_name",
49 "reparent", "search", "rmdir", "open", NULL } },
50 { "fd", { "use", NULL } },
51 { "lnk_file",
52 { COMMON_FILE_PERMS, NULL } },
53 { "chr_file",
54 { COMMON_FILE_PERMS,
55 "execute_no_trans", "entrypoint", "execmod", "open", NULL } },
56 { "blk_file",
57 { COMMON_FILE_PERMS, "open", NULL } },
58 { "sock_file",
59 { COMMON_FILE_PERMS, "open", NULL } },
60 { "fifo_file",
61 { COMMON_FILE_PERMS, "open", NULL } },
62 { "socket",
63 { COMMON_SOCK_PERMS, NULL } },
64 { "tcp_socket",
65 { COMMON_SOCK_PERMS,
66 "connectto", "newconn", "acceptfrom", "node_bind", "name_connect",
67 NULL } },
68 { "udp_socket",
69 { COMMON_SOCK_PERMS,
70 "node_bind", NULL } },
71 { "rawip_socket",
72 { COMMON_SOCK_PERMS,
73 "node_bind", NULL } },
74 { "node",
75 { "tcp_recv", "tcp_send", "udp_recv", "udp_send",
76 "rawip_recv", "rawip_send", "enforce_dest",
77 "dccp_recv", "dccp_send", "recvfrom", "sendto", NULL } },
78 { "netif",
79 { "tcp_recv", "tcp_send", "udp_recv", "udp_send",
80 "rawip_recv", "rawip_send", "dccp_recv", "dccp_send",
81 "ingress", "egress", NULL } },
82 { "netlink_socket",
83 { COMMON_SOCK_PERMS, NULL } },
84 { "packet_socket",
85 { COMMON_SOCK_PERMS, NULL } },
86 { "key_socket",
87 { COMMON_SOCK_PERMS, NULL } },
88 { "unix_stream_socket",
89 { COMMON_SOCK_PERMS, "connectto", "newconn", "acceptfrom", NULL
90 } },
91 { "unix_dgram_socket",
92 { COMMON_SOCK_PERMS, NULL
93 } },
94 { "sem",
95 { COMMON_IPC_PERMS, NULL } },
96 { "msg", { "send", "receive", NULL } },
97 { "msgq",
98 { COMMON_IPC_PERMS, "enqueue", NULL } },
99 { "shm",
100 { COMMON_IPC_PERMS, "lock", NULL } },
101 { "ipc",
102 { COMMON_IPC_PERMS, NULL } },
103 { "netlink_route_socket",
104 { COMMON_SOCK_PERMS,
105 "nlmsg_read", "nlmsg_write", NULL } },
106 { "netlink_firewall_socket",
107 { COMMON_SOCK_PERMS,
108 "nlmsg_read", "nlmsg_write", NULL } },
109 { "netlink_tcpdiag_socket",
110 { COMMON_SOCK_PERMS,
111 "nlmsg_read", "nlmsg_write", NULL } },
112 { "netlink_nflog_socket",
113 { COMMON_SOCK_PERMS, NULL } },
114 { "netlink_xfrm_socket",
115 { COMMON_SOCK_PERMS,
116 "nlmsg_read", "nlmsg_write", NULL } },
117 { "netlink_selinux_socket",
118 { COMMON_SOCK_PERMS, NULL } },
119 { "netlink_audit_socket",
120 { COMMON_SOCK_PERMS,
121 "nlmsg_read", "nlmsg_write", "nlmsg_relay", "nlmsg_readpriv",
122 "nlmsg_tty_audit", NULL } },
123 { "netlink_ip6fw_socket",
124 { COMMON_SOCK_PERMS,
125 "nlmsg_read", "nlmsg_write", NULL } },
126 { "netlink_dnrt_socket",
127 { COMMON_SOCK_PERMS, NULL } },
128 { "association",
129 { "sendto", "recvfrom", "setcontext", "polmatch", NULL } },
130 { "netlink_kobject_uevent_socket",
131 { COMMON_SOCK_PERMS, NULL } },
132 { "appletalk_socket",
133 { COMMON_SOCK_PERMS, NULL } },
134 { "packet",
135 { "send", "recv", "relabelto", "flow_in", "flow_out",
136 "forward_in", "forward_out", NULL } },
137 { "key",
138 { "view", "read", "write", "search", "link", "setattr", "create",
139 NULL } },
140 { "dccp_socket",
141 { COMMON_SOCK_PERMS,
142 "node_bind", "name_connect", NULL } },
143 { "memprotect", { "mmap_zero", NULL } },
144 { "peer", { "recv", NULL } },
145 { "capability2", { "mac_override", "mac_admin", NULL } },
146 { "kernel_service", { "use_as_override", "create_files_as", NULL } },
147 { "tun_socket",
148 { COMMON_SOCK_PERMS, NULL } },
149 { NULL }
150 };
diff --git a/security/selinux/include/common_perm_to_string.h b/security/selinux/include/common_perm_to_string.h
deleted file mode 100644
index ce5b6e2fe9dd..000000000000
--- a/security/selinux/include/common_perm_to_string.h
+++ /dev/null
@@ -1,58 +0,0 @@
1/* This file is automatically generated. Do not edit. */
2TB_(common_file_perm_to_string)
3 S_("ioctl")
4 S_("read")
5 S_("write")
6 S_("create")
7 S_("getattr")
8 S_("setattr")
9 S_("lock")
10 S_("relabelfrom")
11 S_("relabelto")
12 S_("append")
13 S_("unlink")
14 S_("link")
15 S_("rename")
16 S_("execute")
17 S_("swapon")
18 S_("quotaon")
19 S_("mounton")
20TE_(common_file_perm_to_string)
21
22TB_(common_socket_perm_to_string)
23 S_("ioctl")
24 S_("read")
25 S_("write")
26 S_("create")
27 S_("getattr")
28 S_("setattr")
29 S_("lock")
30 S_("relabelfrom")
31 S_("relabelto")
32 S_("append")
33 S_("bind")
34 S_("connect")
35 S_("listen")
36 S_("accept")
37 S_("getopt")
38 S_("setopt")
39 S_("shutdown")
40 S_("recvfrom")
41 S_("sendto")
42 S_("recv_msg")
43 S_("send_msg")
44 S_("name_bind")
45TE_(common_socket_perm_to_string)
46
47TB_(common_ipc_perm_to_string)
48 S_("create")
49 S_("destroy")
50 S_("getattr")
51 S_("setattr")
52 S_("read")
53 S_("write")
54 S_("associate")
55 S_("unix_read")
56 S_("unix_write")
57TE_(common_ipc_perm_to_string)
58
diff --git a/security/selinux/include/flask.h b/security/selinux/include/flask.h
deleted file mode 100644
index f248500a1e3c..000000000000
--- a/security/selinux/include/flask.h
+++ /dev/null
@@ -1,91 +0,0 @@
1/* This file is automatically generated. Do not edit. */
2#ifndef _SELINUX_FLASK_H_
3#define _SELINUX_FLASK_H_
4
5/*
6 * Security object class definitions
7 */
8#define SECCLASS_SECURITY 1
9#define SECCLASS_PROCESS 2
10#define SECCLASS_SYSTEM 3
11#define SECCLASS_CAPABILITY 4
12#define SECCLASS_FILESYSTEM 5
13#define SECCLASS_FILE 6
14#define SECCLASS_DIR 7
15#define SECCLASS_FD 8
16#define SECCLASS_LNK_FILE 9
17#define SECCLASS_CHR_FILE 10
18#define SECCLASS_BLK_FILE 11
19#define SECCLASS_SOCK_FILE 12
20#define SECCLASS_FIFO_FILE 13
21#define SECCLASS_SOCKET 14
22#define SECCLASS_TCP_SOCKET 15
23#define SECCLASS_UDP_SOCKET 16
24#define SECCLASS_RAWIP_SOCKET 17
25#define SECCLASS_NODE 18
26#define SECCLASS_NETIF 19
27#define SECCLASS_NETLINK_SOCKET 20
28#define SECCLASS_PACKET_SOCKET 21
29#define SECCLASS_KEY_SOCKET 22
30#define SECCLASS_UNIX_STREAM_SOCKET 23
31#define SECCLASS_UNIX_DGRAM_SOCKET 24
32#define SECCLASS_SEM 25
33#define SECCLASS_MSG 26
34#define SECCLASS_MSGQ 27
35#define SECCLASS_SHM 28
36#define SECCLASS_IPC 29
37#define SECCLASS_NETLINK_ROUTE_SOCKET 43
38#define SECCLASS_NETLINK_FIREWALL_SOCKET 44
39#define SECCLASS_NETLINK_TCPDIAG_SOCKET 45
40#define SECCLASS_NETLINK_NFLOG_SOCKET 46
41#define SECCLASS_NETLINK_XFRM_SOCKET 47
42#define SECCLASS_NETLINK_SELINUX_SOCKET 48
43#define SECCLASS_NETLINK_AUDIT_SOCKET 49
44#define SECCLASS_NETLINK_IP6FW_SOCKET 50
45#define SECCLASS_NETLINK_DNRT_SOCKET 51
46#define SECCLASS_ASSOCIATION 54
47#define SECCLASS_NETLINK_KOBJECT_UEVENT_SOCKET 55
48#define SECCLASS_APPLETALK_SOCKET 56
49#define SECCLASS_PACKET 57
50#define SECCLASS_KEY 58
51#define SECCLASS_DCCP_SOCKET 60
52#define SECCLASS_MEMPROTECT 61
53#define SECCLASS_PEER 68
54#define SECCLASS_CAPABILITY2 69
55#define SECCLASS_KERNEL_SERVICE 74
56#define SECCLASS_TUN_SOCKET 75
57
58/*
59 * Security identifier indices for initial entities
60 */
61#define SECINITSID_KERNEL 1
62#define SECINITSID_SECURITY 2
63#define SECINITSID_UNLABELED 3
64#define SECINITSID_FS 4
65#define SECINITSID_FILE 5
66#define SECINITSID_FILE_LABELS 6
67#define SECINITSID_INIT 7
68#define SECINITSID_ANY_SOCKET 8
69#define SECINITSID_PORT 9
70#define SECINITSID_NETIF 10
71#define SECINITSID_NETMSG 11
72#define SECINITSID_NODE 12
73#define SECINITSID_IGMP_PACKET 13
74#define SECINITSID_ICMP_SOCKET 14
75#define SECINITSID_TCP_SOCKET 15
76#define SECINITSID_SYSCTL_MODPROBE 16
77#define SECINITSID_SYSCTL 17
78#define SECINITSID_SYSCTL_FS 18
79#define SECINITSID_SYSCTL_KERNEL 19
80#define SECINITSID_SYSCTL_NET 20
81#define SECINITSID_SYSCTL_NET_UNIX 21
82#define SECINITSID_SYSCTL_VM 22
83#define SECINITSID_SYSCTL_DEV 23
84#define SECINITSID_KMOD 24
85#define SECINITSID_POLICY 25
86#define SECINITSID_SCMP_PACKET 26
87#define SECINITSID_DEVNULL 27
88
89#define SECINITSID_NUM 27
90
91#endif
diff --git a/security/selinux/include/security.h b/security/selinux/include/security.h
index ca835795a8b3..2553266ad793 100644
--- a/security/selinux/include/security.h
+++ b/security/selinux/include/security.h
@@ -97,11 +97,18 @@ struct av_decision {
97#define AVD_FLAGS_PERMISSIVE 0x0001 97#define AVD_FLAGS_PERMISSIVE 0x0001
98 98
99int security_compute_av(u32 ssid, u32 tsid, 99int security_compute_av(u32 ssid, u32 tsid,
100 u16 tclass, u32 requested, 100 u16 tclass, u32 requested,
101 struct av_decision *avd); 101 struct av_decision *avd);
102
103int security_compute_av_user(u32 ssid, u32 tsid,
104 u16 tclass, u32 requested,
105 struct av_decision *avd);
102 106
103int security_transition_sid(u32 ssid, u32 tsid, 107int security_transition_sid(u32 ssid, u32 tsid,
104 u16 tclass, u32 *out_sid); 108 u16 tclass, u32 *out_sid);
109
110int security_transition_sid_user(u32 ssid, u32 tsid,
111 u16 tclass, u32 *out_sid);
105 112
106int security_member_sid(u32 ssid, u32 tsid, 113int security_member_sid(u32 ssid, u32 tsid,
107 u16 tclass, u32 *out_sid); 114 u16 tclass, u32 *out_sid);
diff --git a/security/selinux/selinuxfs.c b/security/selinux/selinuxfs.c
index b4fc506e7a87..fab36fdf2769 100644
--- a/security/selinux/selinuxfs.c
+++ b/security/selinux/selinuxfs.c
@@ -522,7 +522,7 @@ static ssize_t sel_write_access(struct file *file, char *buf, size_t size)
522 if (length < 0) 522 if (length < 0)
523 goto out2; 523 goto out2;
524 524
525 length = security_compute_av(ssid, tsid, tclass, req, &avd); 525 length = security_compute_av_user(ssid, tsid, tclass, req, &avd);
526 if (length < 0) 526 if (length < 0)
527 goto out2; 527 goto out2;
528 528
@@ -571,7 +571,7 @@ static ssize_t sel_write_create(struct file *file, char *buf, size_t size)
571 if (length < 0) 571 if (length < 0)
572 goto out2; 572 goto out2;
573 573
574 length = security_transition_sid(ssid, tsid, tclass, &newsid); 574 length = security_transition_sid_user(ssid, tsid, tclass, &newsid);
575 if (length < 0) 575 if (length < 0)
576 goto out2; 576 goto out2;
577 577
diff --git a/security/selinux/ss/Makefile b/security/selinux/ss/Makefile
index bad78779b9b0..15d4e62917de 100644
--- a/security/selinux/ss/Makefile
+++ b/security/selinux/ss/Makefile
@@ -2,7 +2,7 @@
2# Makefile for building the SELinux security server as part of the kernel tree. 2# Makefile for building the SELinux security server as part of the kernel tree.
3# 3#
4 4
5EXTRA_CFLAGS += -Isecurity/selinux/include 5EXTRA_CFLAGS += -Isecurity/selinux -Isecurity/selinux/include
6obj-y := ss.o 6obj-y := ss.o
7 7
8ss-y := ebitmap.o hashtab.o symtab.o sidtab.o avtab.o policydb.o services.o conditional.o mls.o 8ss-y := ebitmap.o hashtab.o symtab.o sidtab.o avtab.o policydb.o services.o conditional.o mls.o
diff --git a/security/selinux/ss/mls.c b/security/selinux/ss/mls.c
index b5407f16c2a4..3f2b2706b5bb 100644
--- a/security/selinux/ss/mls.c
+++ b/security/selinux/ss/mls.c
@@ -532,7 +532,7 @@ int mls_compute_sid(struct context *scontext,
532 } 532 }
533 /* Fallthrough */ 533 /* Fallthrough */
534 case AVTAB_CHANGE: 534 case AVTAB_CHANGE:
535 if (tclass == SECCLASS_PROCESS) 535 if (tclass == policydb.process_class)
536 /* Use the process MLS attributes. */ 536 /* Use the process MLS attributes. */
537 return mls_context_cpy(newcontext, scontext); 537 return mls_context_cpy(newcontext, scontext);
538 else 538 else
diff --git a/security/selinux/ss/policydb.c b/security/selinux/ss/policydb.c
index 72e4a54973aa..f03667213ea8 100644
--- a/security/selinux/ss/policydb.c
+++ b/security/selinux/ss/policydb.c
@@ -713,7 +713,6 @@ void policydb_destroy(struct policydb *p)
713 ebitmap_destroy(&p->type_attr_map[i]); 713 ebitmap_destroy(&p->type_attr_map[i]);
714 } 714 }
715 kfree(p->type_attr_map); 715 kfree(p->type_attr_map);
716 kfree(p->undefined_perms);
717 ebitmap_destroy(&p->policycaps); 716 ebitmap_destroy(&p->policycaps);
718 ebitmap_destroy(&p->permissive_map); 717 ebitmap_destroy(&p->permissive_map);
719 718
@@ -1640,6 +1639,40 @@ static int policydb_bounds_sanity_check(struct policydb *p)
1640 1639
1641extern int ss_initialized; 1640extern int ss_initialized;
1642 1641
1642u16 string_to_security_class(struct policydb *p, const char *name)
1643{
1644 struct class_datum *cladatum;
1645
1646 cladatum = hashtab_search(p->p_classes.table, name);
1647 if (!cladatum)
1648 return 0;
1649
1650 return cladatum->value;
1651}
1652
1653u32 string_to_av_perm(struct policydb *p, u16 tclass, const char *name)
1654{
1655 struct class_datum *cladatum;
1656 struct perm_datum *perdatum = NULL;
1657 struct common_datum *comdatum;
1658
1659 if (!tclass || tclass > p->p_classes.nprim)
1660 return 0;
1661
1662 cladatum = p->class_val_to_struct[tclass-1];
1663 comdatum = cladatum->comdatum;
1664 if (comdatum)
1665 perdatum = hashtab_search(comdatum->permissions.table,
1666 name);
1667 if (!perdatum)
1668 perdatum = hashtab_search(cladatum->permissions.table,
1669 name);
1670 if (!perdatum)
1671 return 0;
1672
1673 return 1U << (perdatum->value-1);
1674}
1675
1643/* 1676/*
1644 * Read the configuration data from a policy database binary 1677 * Read the configuration data from a policy database binary
1645 * representation file into a policy database structure. 1678 * representation file into a policy database structure.
@@ -1861,6 +1894,16 @@ int policydb_read(struct policydb *p, void *fp)
1861 if (rc) 1894 if (rc)
1862 goto bad; 1895 goto bad;
1863 1896
1897 p->process_class = string_to_security_class(p, "process");
1898 if (!p->process_class)
1899 goto bad;
1900 p->process_trans_perms = string_to_av_perm(p, p->process_class,
1901 "transition");
1902 p->process_trans_perms |= string_to_av_perm(p, p->process_class,
1903 "dyntransition");
1904 if (!p->process_trans_perms)
1905 goto bad;
1906
1864 for (i = 0; i < info->ocon_num; i++) { 1907 for (i = 0; i < info->ocon_num; i++) {
1865 rc = next_entry(buf, fp, sizeof(u32)); 1908 rc = next_entry(buf, fp, sizeof(u32));
1866 if (rc < 0) 1909 if (rc < 0)
@@ -2101,7 +2144,7 @@ int policydb_read(struct policydb *p, void *fp)
2101 goto bad; 2144 goto bad;
2102 rt->target_class = le32_to_cpu(buf[0]); 2145 rt->target_class = le32_to_cpu(buf[0]);
2103 } else 2146 } else
2104 rt->target_class = SECCLASS_PROCESS; 2147 rt->target_class = p->process_class;
2105 if (!policydb_type_isvalid(p, rt->source_type) || 2148 if (!policydb_type_isvalid(p, rt->source_type) ||
2106 !policydb_type_isvalid(p, rt->target_type) || 2149 !policydb_type_isvalid(p, rt->target_type) ||
2107 !policydb_class_isvalid(p, rt->target_class)) { 2150 !policydb_class_isvalid(p, rt->target_class)) {
diff --git a/security/selinux/ss/policydb.h b/security/selinux/ss/policydb.h
index 55152d498b53..cdcc5700946f 100644
--- a/security/selinux/ss/policydb.h
+++ b/security/selinux/ss/policydb.h
@@ -254,7 +254,9 @@ struct policydb {
254 254
255 unsigned int reject_unknown : 1; 255 unsigned int reject_unknown : 1;
256 unsigned int allow_unknown : 1; 256 unsigned int allow_unknown : 1;
257 u32 *undefined_perms; 257
258 u16 process_class;
259 u32 process_trans_perms;
258}; 260};
259 261
260extern void policydb_destroy(struct policydb *p); 262extern void policydb_destroy(struct policydb *p);
@@ -295,5 +297,8 @@ static inline int next_entry(void *buf, struct policy_file *fp, size_t bytes)
295 return 0; 297 return 0;
296} 298}
297 299
300extern u16 string_to_security_class(struct policydb *p, const char *name);
301extern u32 string_to_av_perm(struct policydb *p, u16 tclass, const char *name);
302
298#endif /* _SS_POLICYDB_H_ */ 303#endif /* _SS_POLICYDB_H_ */
299 304
diff --git a/security/selinux/ss/services.c b/security/selinux/ss/services.c
index ff17820d35ec..d6bb20cbad62 100644
--- a/security/selinux/ss/services.c
+++ b/security/selinux/ss/services.c
@@ -65,16 +65,10 @@
65#include "audit.h" 65#include "audit.h"
66 66
67extern void selnl_notify_policyload(u32 seqno); 67extern void selnl_notify_policyload(u32 seqno);
68unsigned int policydb_loaded_version;
69 68
70int selinux_policycap_netpeer; 69int selinux_policycap_netpeer;
71int selinux_policycap_openperm; 70int selinux_policycap_openperm;
72 71
73/*
74 * This is declared in avc.c
75 */
76extern const struct selinux_class_perm selinux_class_perm;
77
78static DEFINE_RWLOCK(policy_rwlock); 72static DEFINE_RWLOCK(policy_rwlock);
79 73
80static struct sidtab sidtab; 74static struct sidtab sidtab;
@@ -98,6 +92,165 @@ static int context_struct_compute_av(struct context *scontext,
98 u16 tclass, 92 u16 tclass,
99 u32 requested, 93 u32 requested,
100 struct av_decision *avd); 94 struct av_decision *avd);
95
96struct selinux_mapping {
97 u16 value; /* policy value */
98 unsigned num_perms;
99 u32 perms[sizeof(u32) * 8];
100};
101
102static struct selinux_mapping *current_mapping;
103static u16 current_mapping_size;
104
105static int selinux_set_mapping(struct policydb *pol,
106 struct security_class_mapping *map,
107 struct selinux_mapping **out_map_p,
108 u16 *out_map_size)
109{
110 struct selinux_mapping *out_map = NULL;
111 size_t size = sizeof(struct selinux_mapping);
112 u16 i, j;
113 unsigned k;
114 bool print_unknown_handle = false;
115
116 /* Find number of classes in the input mapping */
117 if (!map)
118 return -EINVAL;
119 i = 0;
120 while (map[i].name)
121 i++;
122
123 /* Allocate space for the class records, plus one for class zero */
124 out_map = kcalloc(++i, size, GFP_ATOMIC);
125 if (!out_map)
126 return -ENOMEM;
127
128 /* Store the raw class and permission values */
129 j = 0;
130 while (map[j].name) {
131 struct security_class_mapping *p_in = map + (j++);
132 struct selinux_mapping *p_out = out_map + j;
133
134 /* An empty class string skips ahead */
135 if (!strcmp(p_in->name, "")) {
136 p_out->num_perms = 0;
137 continue;
138 }
139
140 p_out->value = string_to_security_class(pol, p_in->name);
141 if (!p_out->value) {
142 printk(KERN_INFO
143 "SELinux: Class %s not defined in policy.\n",
144 p_in->name);
145 if (pol->reject_unknown)
146 goto err;
147 p_out->num_perms = 0;
148 print_unknown_handle = true;
149 continue;
150 }
151
152 k = 0;
153 while (p_in->perms && p_in->perms[k]) {
154 /* An empty permission string skips ahead */
155 if (!*p_in->perms[k]) {
156 k++;
157 continue;
158 }
159 p_out->perms[k] = string_to_av_perm(pol, p_out->value,
160 p_in->perms[k]);
161 if (!p_out->perms[k]) {
162 printk(KERN_INFO
163 "SELinux: Permission %s in class %s not defined in policy.\n",
164 p_in->perms[k], p_in->name);
165 if (pol->reject_unknown)
166 goto err;
167 print_unknown_handle = true;
168 }
169
170 k++;
171 }
172 p_out->num_perms = k;
173 }
174
175 if (print_unknown_handle)
176 printk(KERN_INFO "SELinux: the above unknown classes and permissions will be %s\n",
177 pol->allow_unknown ? "allowed" : "denied");
178
179 *out_map_p = out_map;
180 *out_map_size = i;
181 return 0;
182err:
183 kfree(out_map);
184 return -EINVAL;
185}
186
187/*
188 * Get real, policy values from mapped values
189 */
190
191static u16 unmap_class(u16 tclass)
192{
193 if (tclass < current_mapping_size)
194 return current_mapping[tclass].value;
195
196 return tclass;
197}
198
199static u32 unmap_perm(u16 tclass, u32 tperm)
200{
201 if (tclass < current_mapping_size) {
202 unsigned i;
203 u32 kperm = 0;
204
205 for (i = 0; i < current_mapping[tclass].num_perms; i++)
206 if (tperm & (1<<i)) {
207 kperm |= current_mapping[tclass].perms[i];
208 tperm &= ~(1<<i);
209 }
210 return kperm;
211 }
212
213 return tperm;
214}
215
216static void map_decision(u16 tclass, struct av_decision *avd,
217 int allow_unknown)
218{
219 if (tclass < current_mapping_size) {
220 unsigned i, n = current_mapping[tclass].num_perms;
221 u32 result;
222
223 for (i = 0, result = 0; i < n; i++) {
224 if (avd->allowed & current_mapping[tclass].perms[i])
225 result |= 1<<i;
226 if (allow_unknown && !current_mapping[tclass].perms[i])
227 result |= 1<<i;
228 }
229 avd->allowed = result;
230
231 for (i = 0, result = 0; i < n; i++)
232 if (avd->auditallow & current_mapping[tclass].perms[i])
233 result |= 1<<i;
234 avd->auditallow = result;
235
236 for (i = 0, result = 0; i < n; i++) {
237 if (avd->auditdeny & current_mapping[tclass].perms[i])
238 result |= 1<<i;
239 if (!allow_unknown && !current_mapping[tclass].perms[i])
240 result |= 1<<i;
241 }
242 /*
243 * In case the kernel has a bug and requests a permission
244 * between num_perms and the maximum permission number, we
245 * should audit that denial
246 */
247 for (; i < (sizeof(u32)*8); i++)
248 result |= 1<<i;
249 avd->auditdeny = result;
250 }
251}
252
253
101/* 254/*
102 * Return the boolean value of a constraint expression 255 * Return the boolean value of a constraint expression
103 * when it is applied to the specified source and target 256 * when it is applied to the specified source and target
@@ -467,21 +620,9 @@ static int context_struct_compute_av(struct context *scontext,
467 struct class_datum *tclass_datum; 620 struct class_datum *tclass_datum;
468 struct ebitmap *sattr, *tattr; 621 struct ebitmap *sattr, *tattr;
469 struct ebitmap_node *snode, *tnode; 622 struct ebitmap_node *snode, *tnode;
470 const struct selinux_class_perm *kdefs = &selinux_class_perm;
471 unsigned int i, j; 623 unsigned int i, j;
472 624
473 /* 625 /*
474 * Remap extended Netlink classes for old policy versions.
475 * Do this here rather than socket_type_to_security_class()
476 * in case a newer policy version is loaded, allowing sockets
477 * to remain in the correct class.
478 */
479 if (policydb_loaded_version < POLICYDB_VERSION_NLCLASS)
480 if (tclass >= SECCLASS_NETLINK_ROUTE_SOCKET &&
481 tclass <= SECCLASS_NETLINK_DNRT_SOCKET)
482 tclass = SECCLASS_NETLINK_SOCKET;
483
484 /*
485 * Initialize the access vectors to the default values. 626 * Initialize the access vectors to the default values.
486 */ 627 */
487 avd->allowed = 0; 628 avd->allowed = 0;
@@ -490,33 +631,11 @@ static int context_struct_compute_av(struct context *scontext,
490 avd->seqno = latest_granting; 631 avd->seqno = latest_granting;
491 avd->flags = 0; 632 avd->flags = 0;
492 633
493 /* 634 if (unlikely(!tclass || tclass > policydb.p_classes.nprim)) {
494 * Check for all the invalid cases. 635 if (printk_ratelimit())
495 * - tclass 0 636 printk(KERN_WARNING "SELinux: Invalid class %hu\n", tclass);
496 * - tclass > policy and > kernel 637 return -EINVAL;
497 * - tclass > policy but is a userspace class 638 }
498 * - tclass > policy but we do not allow unknowns
499 */
500 if (unlikely(!tclass))
501 goto inval_class;
502 if (unlikely(tclass > policydb.p_classes.nprim))
503 if (tclass > kdefs->cts_len ||
504 !kdefs->class_to_string[tclass] ||
505 !policydb.allow_unknown)
506 goto inval_class;
507
508 /*
509 * Kernel class and we allow unknown so pad the allow decision
510 * the pad will be all 1 for unknown classes.
511 */
512 if (tclass <= kdefs->cts_len && policydb.allow_unknown)
513 avd->allowed = policydb.undefined_perms[tclass - 1];
514
515 /*
516 * Not in policy. Since decision is completed (all 1 or all 0) return.
517 */
518 if (unlikely(tclass > policydb.p_classes.nprim))
519 return 0;
520 639
521 tclass_datum = policydb.class_val_to_struct[tclass - 1]; 640 tclass_datum = policydb.class_val_to_struct[tclass - 1];
522 641
@@ -568,8 +687,8 @@ static int context_struct_compute_av(struct context *scontext,
568 * role is changing, then check the (current_role, new_role) 687 * role is changing, then check the (current_role, new_role)
569 * pair. 688 * pair.
570 */ 689 */
571 if (tclass == SECCLASS_PROCESS && 690 if (tclass == policydb.process_class &&
572 (avd->allowed & (PROCESS__TRANSITION | PROCESS__DYNTRANSITION)) && 691 (avd->allowed & policydb.process_trans_perms) &&
573 scontext->role != tcontext->role) { 692 scontext->role != tcontext->role) {
574 for (ra = policydb.role_allow; ra; ra = ra->next) { 693 for (ra = policydb.role_allow; ra; ra = ra->next) {
575 if (scontext->role == ra->role && 694 if (scontext->role == ra->role &&
@@ -577,8 +696,7 @@ static int context_struct_compute_av(struct context *scontext,
577 break; 696 break;
578 } 697 }
579 if (!ra) 698 if (!ra)
580 avd->allowed &= ~(PROCESS__TRANSITION | 699 avd->allowed &= ~policydb.process_trans_perms;
581 PROCESS__DYNTRANSITION);
582 } 700 }
583 701
584 /* 702 /*
@@ -590,21 +708,6 @@ static int context_struct_compute_av(struct context *scontext,
590 tclass, requested, avd); 708 tclass, requested, avd);
591 709
592 return 0; 710 return 0;
593
594inval_class:
595 if (!tclass || tclass > kdefs->cts_len ||
596 !kdefs->class_to_string[tclass]) {
597 if (printk_ratelimit())
598 printk(KERN_ERR "SELinux: %s: unrecognized class %d\n",
599 __func__, tclass);
600 return -EINVAL;
601 }
602
603 /*
604 * Known to the kernel, but not to the policy.
605 * Handle as a denial (allowed is 0).
606 */
607 return 0;
608} 711}
609 712
610static int security_validtrans_handle_fail(struct context *ocontext, 713static int security_validtrans_handle_fail(struct context *ocontext,
@@ -636,13 +739,14 @@ out:
636} 739}
637 740
638int security_validate_transition(u32 oldsid, u32 newsid, u32 tasksid, 741int security_validate_transition(u32 oldsid, u32 newsid, u32 tasksid,
639 u16 tclass) 742 u16 orig_tclass)
640{ 743{
641 struct context *ocontext; 744 struct context *ocontext;
642 struct context *ncontext; 745 struct context *ncontext;
643 struct context *tcontext; 746 struct context *tcontext;
644 struct class_datum *tclass_datum; 747 struct class_datum *tclass_datum;
645 struct constraint_node *constraint; 748 struct constraint_node *constraint;
749 u16 tclass;
646 int rc = 0; 750 int rc = 0;
647 751
648 if (!ss_initialized) 752 if (!ss_initialized)
@@ -650,16 +754,7 @@ int security_validate_transition(u32 oldsid, u32 newsid, u32 tasksid,
650 754
651 read_lock(&policy_rwlock); 755 read_lock(&policy_rwlock);
652 756
653 /* 757 tclass = unmap_class(orig_tclass);
654 * Remap extended Netlink classes for old policy versions.
655 * Do this here rather than socket_type_to_security_class()
656 * in case a newer policy version is loaded, allowing sockets
657 * to remain in the correct class.
658 */
659 if (policydb_loaded_version < POLICYDB_VERSION_NLCLASS)
660 if (tclass >= SECCLASS_NETLINK_ROUTE_SOCKET &&
661 tclass <= SECCLASS_NETLINK_DNRT_SOCKET)
662 tclass = SECCLASS_NETLINK_SOCKET;
663 758
664 if (!tclass || tclass > policydb.p_classes.nprim) { 759 if (!tclass || tclass > policydb.p_classes.nprim) {
665 printk(KERN_ERR "SELinux: %s: unrecognized class %d\n", 760 printk(KERN_ERR "SELinux: %s: unrecognized class %d\n",
@@ -792,6 +887,38 @@ out:
792} 887}
793 888
794 889
890static int security_compute_av_core(u32 ssid,
891 u32 tsid,
892 u16 tclass,
893 u32 requested,
894 struct av_decision *avd)
895{
896 struct context *scontext = NULL, *tcontext = NULL;
897 int rc = 0;
898
899 scontext = sidtab_search(&sidtab, ssid);
900 if (!scontext) {
901 printk(KERN_ERR "SELinux: %s: unrecognized SID %d\n",
902 __func__, ssid);
903 return -EINVAL;
904 }
905 tcontext = sidtab_search(&sidtab, tsid);
906 if (!tcontext) {
907 printk(KERN_ERR "SELinux: %s: unrecognized SID %d\n",
908 __func__, tsid);
909 return -EINVAL;
910 }
911
912 rc = context_struct_compute_av(scontext, tcontext, tclass,
913 requested, avd);
914
915 /* permissive domain? */
916 if (ebitmap_get_bit(&policydb.permissive_map, scontext->type))
917 avd->flags |= AVD_FLAGS_PERMISSIVE;
918
919 return rc;
920}
921
795/** 922/**
796 * security_compute_av - Compute access vector decisions. 923 * security_compute_av - Compute access vector decisions.
797 * @ssid: source security identifier 924 * @ssid: source security identifier
@@ -807,12 +934,49 @@ out:
807 */ 934 */
808int security_compute_av(u32 ssid, 935int security_compute_av(u32 ssid,
809 u32 tsid, 936 u32 tsid,
810 u16 tclass, 937 u16 orig_tclass,
811 u32 requested, 938 u32 orig_requested,
812 struct av_decision *avd) 939 struct av_decision *avd)
813{ 940{
814 struct context *scontext = NULL, *tcontext = NULL; 941 u16 tclass;
815 int rc = 0; 942 u32 requested;
943 int rc;
944
945 read_lock(&policy_rwlock);
946
947 if (!ss_initialized)
948 goto allow;
949
950 requested = unmap_perm(orig_tclass, orig_requested);
951 tclass = unmap_class(orig_tclass);
952 if (unlikely(orig_tclass && !tclass)) {
953 if (policydb.allow_unknown)
954 goto allow;
955 rc = -EINVAL;
956 goto out;
957 }
958 rc = security_compute_av_core(ssid, tsid, tclass, requested, avd);
959 map_decision(orig_tclass, avd, policydb.allow_unknown);
960out:
961 read_unlock(&policy_rwlock);
962 return rc;
963allow:
964 avd->allowed = 0xffffffff;
965 avd->auditallow = 0;
966 avd->auditdeny = 0xffffffff;
967 avd->seqno = latest_granting;
968 avd->flags = 0;
969 rc = 0;
970 goto out;
971}
972
973int security_compute_av_user(u32 ssid,
974 u32 tsid,
975 u16 tclass,
976 u32 requested,
977 struct av_decision *avd)
978{
979 int rc;
816 980
817 if (!ss_initialized) { 981 if (!ss_initialized) {
818 avd->allowed = 0xffffffff; 982 avd->allowed = 0xffffffff;
@@ -823,29 +987,7 @@ int security_compute_av(u32 ssid,
823 } 987 }
824 988
825 read_lock(&policy_rwlock); 989 read_lock(&policy_rwlock);
826 990 rc = security_compute_av_core(ssid, tsid, tclass, requested, avd);
827 scontext = sidtab_search(&sidtab, ssid);
828 if (!scontext) {
829 printk(KERN_ERR "SELinux: %s: unrecognized SID %d\n",
830 __func__, ssid);
831 rc = -EINVAL;
832 goto out;
833 }
834 tcontext = sidtab_search(&sidtab, tsid);
835 if (!tcontext) {
836 printk(KERN_ERR "SELinux: %s: unrecognized SID %d\n",
837 __func__, tsid);
838 rc = -EINVAL;
839 goto out;
840 }
841
842 rc = context_struct_compute_av(scontext, tcontext, tclass,
843 requested, avd);
844
845 /* permissive domain? */
846 if (ebitmap_get_bit(&policydb.permissive_map, scontext->type))
847 avd->flags |= AVD_FLAGS_PERMISSIVE;
848out:
849 read_unlock(&policy_rwlock); 991 read_unlock(&policy_rwlock);
850 return rc; 992 return rc;
851} 993}
@@ -1204,20 +1346,22 @@ out:
1204 1346
1205static int security_compute_sid(u32 ssid, 1347static int security_compute_sid(u32 ssid,
1206 u32 tsid, 1348 u32 tsid,
1207 u16 tclass, 1349 u16 orig_tclass,
1208 u32 specified, 1350 u32 specified,
1209 u32 *out_sid) 1351 u32 *out_sid,
1352 bool kern)
1210{ 1353{
1211 struct context *scontext = NULL, *tcontext = NULL, newcontext; 1354 struct context *scontext = NULL, *tcontext = NULL, newcontext;
1212 struct role_trans *roletr = NULL; 1355 struct role_trans *roletr = NULL;
1213 struct avtab_key avkey; 1356 struct avtab_key avkey;
1214 struct avtab_datum *avdatum; 1357 struct avtab_datum *avdatum;
1215 struct avtab_node *node; 1358 struct avtab_node *node;
1359 u16 tclass;
1216 int rc = 0; 1360 int rc = 0;
1217 1361
1218 if (!ss_initialized) { 1362 if (!ss_initialized) {
1219 switch (tclass) { 1363 switch (orig_tclass) {
1220 case SECCLASS_PROCESS: 1364 case SECCLASS_PROCESS: /* kernel value */
1221 *out_sid = ssid; 1365 *out_sid = ssid;
1222 break; 1366 break;
1223 default: 1367 default:
@@ -1231,6 +1375,11 @@ static int security_compute_sid(u32 ssid,
1231 1375
1232 read_lock(&policy_rwlock); 1376 read_lock(&policy_rwlock);
1233 1377
1378 if (kern)
1379 tclass = unmap_class(orig_tclass);
1380 else
1381 tclass = orig_tclass;
1382
1234 scontext = sidtab_search(&sidtab, ssid); 1383 scontext = sidtab_search(&sidtab, ssid);
1235 if (!scontext) { 1384 if (!scontext) {
1236 printk(KERN_ERR "SELinux: %s: unrecognized SID %d\n", 1385 printk(KERN_ERR "SELinux: %s: unrecognized SID %d\n",
@@ -1260,13 +1409,11 @@ static int security_compute_sid(u32 ssid,
1260 } 1409 }
1261 1410
1262 /* Set the role and type to default values. */ 1411 /* Set the role and type to default values. */
1263 switch (tclass) { 1412 if (tclass == policydb.process_class) {
1264 case SECCLASS_PROCESS:
1265 /* Use the current role and type of process. */ 1413 /* Use the current role and type of process. */
1266 newcontext.role = scontext->role; 1414 newcontext.role = scontext->role;
1267 newcontext.type = scontext->type; 1415 newcontext.type = scontext->type;
1268 break; 1416 } else {
1269 default:
1270 /* Use the well-defined object role. */ 1417 /* Use the well-defined object role. */
1271 newcontext.role = OBJECT_R_VAL; 1418 newcontext.role = OBJECT_R_VAL;
1272 /* Use the type of the related object. */ 1419 /* Use the type of the related object. */
@@ -1297,8 +1444,7 @@ static int security_compute_sid(u32 ssid,
1297 } 1444 }
1298 1445
1299 /* Check for class-specific changes. */ 1446 /* Check for class-specific changes. */
1300 switch (tclass) { 1447 if (tclass == policydb.process_class) {
1301 case SECCLASS_PROCESS:
1302 if (specified & AVTAB_TRANSITION) { 1448 if (specified & AVTAB_TRANSITION) {
1303 /* Look for a role transition rule. */ 1449 /* Look for a role transition rule. */
1304 for (roletr = policydb.role_tr; roletr; 1450 for (roletr = policydb.role_tr; roletr;
@@ -1311,9 +1457,6 @@ static int security_compute_sid(u32 ssid,
1311 } 1457 }
1312 } 1458 }
1313 } 1459 }
1314 break;
1315 default:
1316 break;
1317 } 1460 }
1318 1461
1319 /* Set the MLS attributes. 1462 /* Set the MLS attributes.
@@ -1358,7 +1501,17 @@ int security_transition_sid(u32 ssid,
1358 u16 tclass, 1501 u16 tclass,
1359 u32 *out_sid) 1502 u32 *out_sid)
1360{ 1503{
1361 return security_compute_sid(ssid, tsid, tclass, AVTAB_TRANSITION, out_sid); 1504 return security_compute_sid(ssid, tsid, tclass, AVTAB_TRANSITION,
1505 out_sid, true);
1506}
1507
1508int security_transition_sid_user(u32 ssid,
1509 u32 tsid,
1510 u16 tclass,
1511 u32 *out_sid)
1512{
1513 return security_compute_sid(ssid, tsid, tclass, AVTAB_TRANSITION,
1514 out_sid, false);
1362} 1515}
1363 1516
1364/** 1517/**
@@ -1379,7 +1532,8 @@ int security_member_sid(u32 ssid,
1379 u16 tclass, 1532 u16 tclass,
1380 u32 *out_sid) 1533 u32 *out_sid)
1381{ 1534{
1382 return security_compute_sid(ssid, tsid, tclass, AVTAB_MEMBER, out_sid); 1535 return security_compute_sid(ssid, tsid, tclass, AVTAB_MEMBER, out_sid,
1536 false);
1383} 1537}
1384 1538
1385/** 1539/**
@@ -1400,144 +1554,8 @@ int security_change_sid(u32 ssid,
1400 u16 tclass, 1554 u16 tclass,
1401 u32 *out_sid) 1555 u32 *out_sid)
1402{ 1556{
1403 return security_compute_sid(ssid, tsid, tclass, AVTAB_CHANGE, out_sid); 1557 return security_compute_sid(ssid, tsid, tclass, AVTAB_CHANGE, out_sid,
1404} 1558 false);
1405
1406/*
1407 * Verify that each kernel class that is defined in the
1408 * policy is correct
1409 */
1410static int validate_classes(struct policydb *p)
1411{
1412 int i, j;
1413 struct class_datum *cladatum;
1414 struct perm_datum *perdatum;
1415 u32 nprim, tmp, common_pts_len, perm_val, pol_val;
1416 u16 class_val;
1417 const struct selinux_class_perm *kdefs = &selinux_class_perm;
1418 const char *def_class, *def_perm, *pol_class;
1419 struct symtab *perms;
1420 bool print_unknown_handle = 0;
1421
1422 if (p->allow_unknown) {
1423 u32 num_classes = kdefs->cts_len;
1424 p->undefined_perms = kcalloc(num_classes, sizeof(u32), GFP_KERNEL);
1425 if (!p->undefined_perms)
1426 return -ENOMEM;
1427 }
1428
1429 for (i = 1; i < kdefs->cts_len; i++) {
1430 def_class = kdefs->class_to_string[i];
1431 if (!def_class)
1432 continue;
1433 if (i > p->p_classes.nprim) {
1434 printk(KERN_INFO
1435 "SELinux: class %s not defined in policy\n",
1436 def_class);
1437 if (p->reject_unknown)
1438 return -EINVAL;
1439 if (p->allow_unknown)
1440 p->undefined_perms[i-1] = ~0U;
1441 print_unknown_handle = 1;
1442 continue;
1443 }
1444 pol_class = p->p_class_val_to_name[i-1];
1445 if (strcmp(pol_class, def_class)) {
1446 printk(KERN_ERR
1447 "SELinux: class %d is incorrect, found %s but should be %s\n",
1448 i, pol_class, def_class);
1449 return -EINVAL;
1450 }
1451 }
1452 for (i = 0; i < kdefs->av_pts_len; i++) {
1453 class_val = kdefs->av_perm_to_string[i].tclass;
1454 perm_val = kdefs->av_perm_to_string[i].value;
1455 def_perm = kdefs->av_perm_to_string[i].name;
1456 if (class_val > p->p_classes.nprim)
1457 continue;
1458 pol_class = p->p_class_val_to_name[class_val-1];
1459 cladatum = hashtab_search(p->p_classes.table, pol_class);
1460 BUG_ON(!cladatum);
1461 perms = &cladatum->permissions;
1462 nprim = 1 << (perms->nprim - 1);
1463 if (perm_val > nprim) {
1464 printk(KERN_INFO
1465 "SELinux: permission %s in class %s not defined in policy\n",
1466 def_perm, pol_class);
1467 if (p->reject_unknown)
1468 return -EINVAL;
1469 if (p->allow_unknown)
1470 p->undefined_perms[class_val-1] |= perm_val;
1471 print_unknown_handle = 1;
1472 continue;
1473 }
1474 perdatum = hashtab_search(perms->table, def_perm);
1475 if (perdatum == NULL) {
1476 printk(KERN_ERR
1477 "SELinux: permission %s in class %s not found in policy, bad policy\n",
1478 def_perm, pol_class);
1479 return -EINVAL;
1480 }
1481 pol_val = 1 << (perdatum->value - 1);
1482 if (pol_val != perm_val) {
1483 printk(KERN_ERR
1484 "SELinux: permission %s in class %s has incorrect value\n",
1485 def_perm, pol_class);
1486 return -EINVAL;
1487 }
1488 }
1489 for (i = 0; i < kdefs->av_inherit_len; i++) {
1490 class_val = kdefs->av_inherit[i].tclass;
1491 if (class_val > p->p_classes.nprim)
1492 continue;
1493 pol_class = p->p_class_val_to_name[class_val-1];
1494 cladatum = hashtab_search(p->p_classes.table, pol_class);
1495 BUG_ON(!cladatum);
1496 if (!cladatum->comdatum) {
1497 printk(KERN_ERR
1498 "SELinux: class %s should have an inherits clause but does not\n",
1499 pol_class);
1500 return -EINVAL;
1501 }
1502 tmp = kdefs->av_inherit[i].common_base;
1503 common_pts_len = 0;
1504 while (!(tmp & 0x01)) {
1505 common_pts_len++;
1506 tmp >>= 1;
1507 }
1508 perms = &cladatum->comdatum->permissions;
1509 for (j = 0; j < common_pts_len; j++) {
1510 def_perm = kdefs->av_inherit[i].common_pts[j];
1511 if (j >= perms->nprim) {
1512 printk(KERN_INFO
1513 "SELinux: permission %s in class %s not defined in policy\n",
1514 def_perm, pol_class);
1515 if (p->reject_unknown)
1516 return -EINVAL;
1517 if (p->allow_unknown)
1518 p->undefined_perms[class_val-1] |= (1 << j);
1519 print_unknown_handle = 1;
1520 continue;
1521 }
1522 perdatum = hashtab_search(perms->table, def_perm);
1523 if (perdatum == NULL) {
1524 printk(KERN_ERR
1525 "SELinux: permission %s in class %s not found in policy, bad policy\n",
1526 def_perm, pol_class);
1527 return -EINVAL;
1528 }
1529 if (perdatum->value != j + 1) {
1530 printk(KERN_ERR
1531 "SELinux: permission %s in class %s has incorrect value\n",
1532 def_perm, pol_class);
1533 return -EINVAL;
1534 }
1535 }
1536 }
1537 if (print_unknown_handle)
1538 printk(KERN_INFO "SELinux: the above unknown classes and permissions will be %s\n",
1539 (security_get_allow_unknown() ? "allowed" : "denied"));
1540 return 0;
1541} 1559}
1542 1560
1543/* Clone the SID into the new SID table. */ 1561/* Clone the SID into the new SID table. */
@@ -1710,8 +1728,10 @@ int security_load_policy(void *data, size_t len)
1710{ 1728{
1711 struct policydb oldpolicydb, newpolicydb; 1729 struct policydb oldpolicydb, newpolicydb;
1712 struct sidtab oldsidtab, newsidtab; 1730 struct sidtab oldsidtab, newsidtab;
1731 struct selinux_mapping *oldmap, *map = NULL;
1713 struct convert_context_args args; 1732 struct convert_context_args args;
1714 u32 seqno; 1733 u32 seqno;
1734 u16 map_size;
1715 int rc = 0; 1735 int rc = 0;
1716 struct policy_file file = { data, len }, *fp = &file; 1736 struct policy_file file = { data, len }, *fp = &file;
1717 1737
@@ -1721,22 +1741,19 @@ int security_load_policy(void *data, size_t len)
1721 avtab_cache_destroy(); 1741 avtab_cache_destroy();
1722 return -EINVAL; 1742 return -EINVAL;
1723 } 1743 }
1724 if (policydb_load_isids(&policydb, &sidtab)) { 1744 if (selinux_set_mapping(&policydb, secclass_map,
1745 &current_mapping,
1746 &current_mapping_size)) {
1725 policydb_destroy(&policydb); 1747 policydb_destroy(&policydb);
1726 avtab_cache_destroy(); 1748 avtab_cache_destroy();
1727 return -EINVAL; 1749 return -EINVAL;
1728 } 1750 }
1729 /* Verify that the kernel defined classes are correct. */ 1751 if (policydb_load_isids(&policydb, &sidtab)) {
1730 if (validate_classes(&policydb)) {
1731 printk(KERN_ERR
1732 "SELinux: the definition of a class is incorrect\n");
1733 sidtab_destroy(&sidtab);
1734 policydb_destroy(&policydb); 1752 policydb_destroy(&policydb);
1735 avtab_cache_destroy(); 1753 avtab_cache_destroy();
1736 return -EINVAL; 1754 return -EINVAL;
1737 } 1755 }
1738 security_load_policycaps(); 1756 security_load_policycaps();
1739 policydb_loaded_version = policydb.policyvers;
1740 ss_initialized = 1; 1757 ss_initialized = 1;
1741 seqno = ++latest_granting; 1758 seqno = ++latest_granting;
1742 selinux_complete_init(); 1759 selinux_complete_init();
@@ -1759,13 +1776,9 @@ int security_load_policy(void *data, size_t len)
1759 return -ENOMEM; 1776 return -ENOMEM;
1760 } 1777 }
1761 1778
1762 /* Verify that the kernel defined classes are correct. */ 1779 if (selinux_set_mapping(&newpolicydb, secclass_map,
1763 if (validate_classes(&newpolicydb)) { 1780 &map, &map_size))
1764 printk(KERN_ERR
1765 "SELinux: the definition of a class is incorrect\n");
1766 rc = -EINVAL;
1767 goto err; 1781 goto err;
1768 }
1769 1782
1770 rc = security_preserve_bools(&newpolicydb); 1783 rc = security_preserve_bools(&newpolicydb);
1771 if (rc) { 1784 if (rc) {
@@ -1799,13 +1812,16 @@ int security_load_policy(void *data, size_t len)
1799 memcpy(&policydb, &newpolicydb, sizeof policydb); 1812 memcpy(&policydb, &newpolicydb, sizeof policydb);
1800 sidtab_set(&sidtab, &newsidtab); 1813 sidtab_set(&sidtab, &newsidtab);
1801 security_load_policycaps(); 1814 security_load_policycaps();
1815 oldmap = current_mapping;
1816 current_mapping = map;
1817 current_mapping_size = map_size;
1802 seqno = ++latest_granting; 1818 seqno = ++latest_granting;
1803 policydb_loaded_version = policydb.policyvers;
1804 write_unlock_irq(&policy_rwlock); 1819 write_unlock_irq(&policy_rwlock);
1805 1820
1806 /* Free the old policydb and SID table. */ 1821 /* Free the old policydb and SID table. */
1807 policydb_destroy(&oldpolicydb); 1822 policydb_destroy(&oldpolicydb);
1808 sidtab_destroy(&oldsidtab); 1823 sidtab_destroy(&oldsidtab);
1824 kfree(oldmap);
1809 1825
1810 avc_ss_reset(seqno); 1826 avc_ss_reset(seqno);
1811 selnl_notify_policyload(seqno); 1827 selnl_notify_policyload(seqno);
@@ -1815,6 +1831,7 @@ int security_load_policy(void *data, size_t len)
1815 return 0; 1831 return 0;
1816 1832
1817err: 1833err:
1834 kfree(map);
1818 sidtab_destroy(&newsidtab); 1835 sidtab_destroy(&newsidtab);
1819 policydb_destroy(&newpolicydb); 1836 policydb_destroy(&newpolicydb);
1820 return rc; 1837 return rc;
@@ -2091,7 +2108,7 @@ out_unlock:
2091 } 2108 }
2092 for (i = 0, j = 0; i < mynel; i++) { 2109 for (i = 0, j = 0; i < mynel; i++) {
2093 rc = avc_has_perm_noaudit(fromsid, mysids[i], 2110 rc = avc_has_perm_noaudit(fromsid, mysids[i],
2094 SECCLASS_PROCESS, 2111 SECCLASS_PROCESS, /* kernel value */
2095 PROCESS__TRANSITION, AVC_STRICT, 2112 PROCESS__TRANSITION, AVC_STRICT,
2096 NULL); 2113 NULL);
2097 if (!rc) 2114 if (!rc)
@@ -2119,10 +2136,11 @@ out:
2119 */ 2136 */
2120int security_genfs_sid(const char *fstype, 2137int security_genfs_sid(const char *fstype,
2121 char *path, 2138 char *path,
2122 u16 sclass, 2139 u16 orig_sclass,
2123 u32 *sid) 2140 u32 *sid)
2124{ 2141{
2125 int len; 2142 int len;
2143 u16 sclass;
2126 struct genfs *genfs; 2144 struct genfs *genfs;
2127 struct ocontext *c; 2145 struct ocontext *c;
2128 int rc = 0, cmp = 0; 2146 int rc = 0, cmp = 0;
@@ -2132,6 +2150,8 @@ int security_genfs_sid(const char *fstype,
2132 2150
2133 read_lock(&policy_rwlock); 2151 read_lock(&policy_rwlock);
2134 2152
2153 sclass = unmap_class(orig_sclass);
2154
2135 for (genfs = policydb.genfs; genfs; genfs = genfs->next) { 2155 for (genfs = policydb.genfs; genfs; genfs = genfs->next) {
2136 cmp = strcmp(fstype, genfs->fstype); 2156 cmp = strcmp(fstype, genfs->fstype);
2137 if (cmp <= 0) 2157 if (cmp <= 0)
diff --git a/security/tomoyo/common.c b/security/tomoyo/common.c
index 3c8bd8ee0b95..e0d0354008b7 100644
--- a/security/tomoyo/common.c
+++ b/security/tomoyo/common.c
@@ -187,6 +187,8 @@ bool tomoyo_is_correct_path(const char *filename, const s8 start_type,
187 const s8 pattern_type, const s8 end_type, 187 const s8 pattern_type, const s8 end_type,
188 const char *function) 188 const char *function)
189{ 189{
190 const char *const start = filename;
191 bool in_repetition = false;
190 bool contains_pattern = false; 192 bool contains_pattern = false;
191 unsigned char c; 193 unsigned char c;
192 unsigned char d; 194 unsigned char d;
@@ -212,9 +214,13 @@ bool tomoyo_is_correct_path(const char *filename, const s8 start_type,
212 if (c == '/') 214 if (c == '/')
213 goto out; 215 goto out;
214 } 216 }
215 while ((c = *filename++) != '\0') { 217 while (1) {
218 c = *filename++;
219 if (!c)
220 break;
216 if (c == '\\') { 221 if (c == '\\') {
217 switch ((c = *filename++)) { 222 c = *filename++;
223 switch (c) {
218 case '\\': /* "\\" */ 224 case '\\': /* "\\" */
219 continue; 225 continue;
220 case '$': /* "\$" */ 226 case '$': /* "\$" */
@@ -231,6 +237,22 @@ bool tomoyo_is_correct_path(const char *filename, const s8 start_type,
231 break; /* Must not contain pattern */ 237 break; /* Must not contain pattern */
232 contains_pattern = true; 238 contains_pattern = true;
233 continue; 239 continue;
240 case '{': /* "/\{" */
241 if (filename - 3 < start ||
242 *(filename - 3) != '/')
243 break;
244 if (pattern_type == -1)
245 break; /* Must not contain pattern */
246 contains_pattern = true;
247 in_repetition = true;
248 continue;
249 case '}': /* "\}/" */
250 if (*filename != '/')
251 break;
252 if (!in_repetition)
253 break;
254 in_repetition = false;
255 continue;
234 case '0': /* "\ooo" */ 256 case '0': /* "\ooo" */
235 case '1': 257 case '1':
236 case '2': 258 case '2':
@@ -246,6 +268,8 @@ bool tomoyo_is_correct_path(const char *filename, const s8 start_type,
246 continue; /* pattern is not \000 */ 268 continue; /* pattern is not \000 */
247 } 269 }
248 goto out; 270 goto out;
271 } else if (in_repetition && c == '/') {
272 goto out;
249 } else if (tomoyo_is_invalid(c)) { 273 } else if (tomoyo_is_invalid(c)) {
250 goto out; 274 goto out;
251 } 275 }
@@ -254,6 +278,8 @@ bool tomoyo_is_correct_path(const char *filename, const s8 start_type,
254 if (!contains_pattern) 278 if (!contains_pattern)
255 goto out; 279 goto out;
256 } 280 }
281 if (in_repetition)
282 goto out;
257 return true; 283 return true;
258 out: 284 out:
259 printk(KERN_DEBUG "%s: Invalid pathname '%s'\n", function, 285 printk(KERN_DEBUG "%s: Invalid pathname '%s'\n", function,
@@ -360,33 +386,6 @@ struct tomoyo_domain_info *tomoyo_find_domain(const char *domainname)
360} 386}
361 387
362/** 388/**
363 * tomoyo_path_depth - Evaluate the number of '/' in a string.
364 *
365 * @pathname: The string to evaluate.
366 *
367 * Returns path depth of the string.
368 *
369 * I score 2 for each of the '/' in the @pathname
370 * and score 1 if the @pathname ends with '/'.
371 */
372static int tomoyo_path_depth(const char *pathname)
373{
374 int i = 0;
375
376 if (pathname) {
377 const char *ep = pathname + strlen(pathname);
378 if (pathname < ep--) {
379 if (*ep != '/')
380 i++;
381 while (pathname <= ep)
382 if (*ep-- == '/')
383 i += 2;
384 }
385 }
386 return i;
387}
388
389/**
390 * tomoyo_const_part_length - Evaluate the initial length without a pattern in a token. 389 * tomoyo_const_part_length - Evaluate the initial length without a pattern in a token.
391 * 390 *
392 * @filename: The string to evaluate. 391 * @filename: The string to evaluate.
@@ -444,11 +443,10 @@ void tomoyo_fill_path_info(struct tomoyo_path_info *ptr)
444 ptr->is_dir = len && (name[len - 1] == '/'); 443 ptr->is_dir = len && (name[len - 1] == '/');
445 ptr->is_patterned = (ptr->const_len < len); 444 ptr->is_patterned = (ptr->const_len < len);
446 ptr->hash = full_name_hash(name, len); 445 ptr->hash = full_name_hash(name, len);
447 ptr->depth = tomoyo_path_depth(name);
448} 446}
449 447
450/** 448/**
451 * tomoyo_file_matches_to_pattern2 - Pattern matching without '/' character 449 * tomoyo_file_matches_pattern2 - Pattern matching without '/' character
452 * and "\-" pattern. 450 * and "\-" pattern.
453 * 451 *
454 * @filename: The start of string to check. 452 * @filename: The start of string to check.
@@ -458,10 +456,10 @@ void tomoyo_fill_path_info(struct tomoyo_path_info *ptr)
458 * 456 *
459 * Returns true if @filename matches @pattern, false otherwise. 457 * Returns true if @filename matches @pattern, false otherwise.
460 */ 458 */
461static bool tomoyo_file_matches_to_pattern2(const char *filename, 459static bool tomoyo_file_matches_pattern2(const char *filename,
462 const char *filename_end, 460 const char *filename_end,
463 const char *pattern, 461 const char *pattern,
464 const char *pattern_end) 462 const char *pattern_end)
465{ 463{
466 while (filename < filename_end && pattern < pattern_end) { 464 while (filename < filename_end && pattern < pattern_end) {
467 char c; 465 char c;
@@ -519,7 +517,7 @@ static bool tomoyo_file_matches_to_pattern2(const char *filename,
519 case '*': 517 case '*':
520 case '@': 518 case '@':
521 for (i = 0; i <= filename_end - filename; i++) { 519 for (i = 0; i <= filename_end - filename; i++) {
522 if (tomoyo_file_matches_to_pattern2( 520 if (tomoyo_file_matches_pattern2(
523 filename + i, filename_end, 521 filename + i, filename_end,
524 pattern + 1, pattern_end)) 522 pattern + 1, pattern_end))
525 return true; 523 return true;
@@ -550,7 +548,7 @@ static bool tomoyo_file_matches_to_pattern2(const char *filename,
550 j++; 548 j++;
551 } 549 }
552 for (i = 1; i <= j; i++) { 550 for (i = 1; i <= j; i++) {
553 if (tomoyo_file_matches_to_pattern2( 551 if (tomoyo_file_matches_pattern2(
554 filename + i, filename_end, 552 filename + i, filename_end,
555 pattern + 1, pattern_end)) 553 pattern + 1, pattern_end))
556 return true; 554 return true;
@@ -567,7 +565,7 @@ static bool tomoyo_file_matches_to_pattern2(const char *filename,
567} 565}
568 566
569/** 567/**
570 * tomoyo_file_matches_to_pattern - Pattern matching without without '/' character. 568 * tomoyo_file_matches_pattern - Pattern matching without without '/' character.
571 * 569 *
572 * @filename: The start of string to check. 570 * @filename: The start of string to check.
573 * @filename_end: The end of string to check. 571 * @filename_end: The end of string to check.
@@ -576,7 +574,7 @@ static bool tomoyo_file_matches_to_pattern2(const char *filename,
576 * 574 *
577 * Returns true if @filename matches @pattern, false otherwise. 575 * Returns true if @filename matches @pattern, false otherwise.
578 */ 576 */
579static bool tomoyo_file_matches_to_pattern(const char *filename, 577static bool tomoyo_file_matches_pattern(const char *filename,
580 const char *filename_end, 578 const char *filename_end,
581 const char *pattern, 579 const char *pattern,
582 const char *pattern_end) 580 const char *pattern_end)
@@ -589,10 +587,10 @@ static bool tomoyo_file_matches_to_pattern(const char *filename,
589 /* Split at "\-" pattern. */ 587 /* Split at "\-" pattern. */
590 if (*pattern++ != '\\' || *pattern++ != '-') 588 if (*pattern++ != '\\' || *pattern++ != '-')
591 continue; 589 continue;
592 result = tomoyo_file_matches_to_pattern2(filename, 590 result = tomoyo_file_matches_pattern2(filename,
593 filename_end, 591 filename_end,
594 pattern_start, 592 pattern_start,
595 pattern - 2); 593 pattern - 2);
596 if (first) 594 if (first)
597 result = !result; 595 result = !result;
598 if (result) 596 if (result)
@@ -600,13 +598,79 @@ static bool tomoyo_file_matches_to_pattern(const char *filename,
600 first = false; 598 first = false;
601 pattern_start = pattern; 599 pattern_start = pattern;
602 } 600 }
603 result = tomoyo_file_matches_to_pattern2(filename, filename_end, 601 result = tomoyo_file_matches_pattern2(filename, filename_end,
604 pattern_start, pattern_end); 602 pattern_start, pattern_end);
605 return first ? result : !result; 603 return first ? result : !result;
606} 604}
607 605
608/** 606/**
607 * tomoyo_path_matches_pattern2 - Do pathname pattern matching.
608 *
609 * @f: The start of string to check.
610 * @p: The start of pattern to compare.
611 *
612 * Returns true if @f matches @p, false otherwise.
613 */
614static bool tomoyo_path_matches_pattern2(const char *f, const char *p)
615{
616 const char *f_delimiter;
617 const char *p_delimiter;
618
619 while (*f && *p) {
620 f_delimiter = strchr(f, '/');
621 if (!f_delimiter)
622 f_delimiter = f + strlen(f);
623 p_delimiter = strchr(p, '/');
624 if (!p_delimiter)
625 p_delimiter = p + strlen(p);
626 if (*p == '\\' && *(p + 1) == '{')
627 goto recursive;
628 if (!tomoyo_file_matches_pattern(f, f_delimiter, p,
629 p_delimiter))
630 return false;
631 f = f_delimiter;
632 if (*f)
633 f++;
634 p = p_delimiter;
635 if (*p)
636 p++;
637 }
638 /* Ignore trailing "\*" and "\@" in @pattern. */
639 while (*p == '\\' &&
640 (*(p + 1) == '*' || *(p + 1) == '@'))
641 p += 2;
642 return !*f && !*p;
643 recursive:
644 /*
645 * The "\{" pattern is permitted only after '/' character.
646 * This guarantees that below "*(p - 1)" is safe.
647 * Also, the "\}" pattern is permitted only before '/' character
648 * so that "\{" + "\}" pair will not break the "\-" operator.
649 */
650 if (*(p - 1) != '/' || p_delimiter <= p + 3 || *p_delimiter != '/' ||
651 *(p_delimiter - 1) != '}' || *(p_delimiter - 2) != '\\')
652 return false; /* Bad pattern. */
653 do {
654 /* Compare current component with pattern. */
655 if (!tomoyo_file_matches_pattern(f, f_delimiter, p + 2,
656 p_delimiter - 2))
657 break;
658 /* Proceed to next component. */
659 f = f_delimiter;
660 if (!*f)
661 break;
662 f++;
663 /* Continue comparison. */
664 if (tomoyo_path_matches_pattern2(f, p_delimiter + 1))
665 return true;
666 f_delimiter = strchr(f, '/');
667 } while (f_delimiter);
668 return false; /* Not matched. */
669}
670
671/**
609 * tomoyo_path_matches_pattern - Check whether the given filename matches the given pattern. 672 * tomoyo_path_matches_pattern - Check whether the given filename matches the given pattern.
673 *
610 * @filename: The filename to check. 674 * @filename: The filename to check.
611 * @pattern: The pattern to compare. 675 * @pattern: The pattern to compare.
612 * 676 *
@@ -615,24 +679,24 @@ static bool tomoyo_file_matches_to_pattern(const char *filename,
615 * The following patterns are available. 679 * The following patterns are available.
616 * \\ \ itself. 680 * \\ \ itself.
617 * \ooo Octal representation of a byte. 681 * \ooo Octal representation of a byte.
618 * \* More than or equals to 0 character other than '/'. 682 * \* Zero or more repetitions of characters other than '/'.
619 * \@ More than or equals to 0 character other than '/' or '.'. 683 * \@ Zero or more repetitions of characters other than '/' or '.'.
620 * \? 1 byte character other than '/'. 684 * \? 1 byte character other than '/'.
621 * \$ More than or equals to 1 decimal digit. 685 * \$ One or more repetitions of decimal digits.
622 * \+ 1 decimal digit. 686 * \+ 1 decimal digit.
623 * \X More than or equals to 1 hexadecimal digit. 687 * \X One or more repetitions of hexadecimal digits.
624 * \x 1 hexadecimal digit. 688 * \x 1 hexadecimal digit.
625 * \A More than or equals to 1 alphabet character. 689 * \A One or more repetitions of alphabet characters.
626 * \a 1 alphabet character. 690 * \a 1 alphabet character.
691 *
627 * \- Subtraction operator. 692 * \- Subtraction operator.
693 *
694 * /\{dir\}/ '/' + 'One or more repetitions of dir/' (e.g. /dir/ /dir/dir/
695 * /dir/dir/dir/ ).
628 */ 696 */
629bool tomoyo_path_matches_pattern(const struct tomoyo_path_info *filename, 697bool tomoyo_path_matches_pattern(const struct tomoyo_path_info *filename,
630 const struct tomoyo_path_info *pattern) 698 const struct tomoyo_path_info *pattern)
631{ 699{
632 /*
633 if (!filename || !pattern)
634 return false;
635 */
636 const char *f = filename->name; 700 const char *f = filename->name;
637 const char *p = pattern->name; 701 const char *p = pattern->name;
638 const int len = pattern->const_len; 702 const int len = pattern->const_len;
@@ -640,37 +704,15 @@ bool tomoyo_path_matches_pattern(const struct tomoyo_path_info *filename,
640 /* If @pattern doesn't contain pattern, I can use strcmp(). */ 704 /* If @pattern doesn't contain pattern, I can use strcmp(). */
641 if (!pattern->is_patterned) 705 if (!pattern->is_patterned)
642 return !tomoyo_pathcmp(filename, pattern); 706 return !tomoyo_pathcmp(filename, pattern);
643 /* Dont compare if the number of '/' differs. */ 707 /* Don't compare directory and non-directory. */
644 if (filename->depth != pattern->depth) 708 if (filename->is_dir != pattern->is_dir)
645 return false; 709 return false;
646 /* Compare the initial length without patterns. */ 710 /* Compare the initial length without patterns. */
647 if (strncmp(f, p, len)) 711 if (strncmp(f, p, len))
648 return false; 712 return false;
649 f += len; 713 f += len;
650 p += len; 714 p += len;
651 /* Main loop. Compare each directory component. */ 715 return tomoyo_path_matches_pattern2(f, p);
652 while (*f && *p) {
653 const char *f_delimiter = strchr(f, '/');
654 const char *p_delimiter = strchr(p, '/');
655 if (!f_delimiter)
656 f_delimiter = f + strlen(f);
657 if (!p_delimiter)
658 p_delimiter = p + strlen(p);
659 if (!tomoyo_file_matches_to_pattern(f, f_delimiter,
660 p, p_delimiter))
661 return false;
662 f = f_delimiter;
663 if (*f)
664 f++;
665 p = p_delimiter;
666 if (*p)
667 p++;
668 }
669 /* Ignore trailing "\*" and "\@" in @pattern. */
670 while (*p == '\\' &&
671 (*(p + 1) == '*' || *(p + 1) == '@'))
672 p += 2;
673 return !*f && !*p;
674} 716}
675 717
676/** 718/**
diff --git a/security/tomoyo/common.h b/security/tomoyo/common.h
index 31df541911f7..92169d29b2db 100644
--- a/security/tomoyo/common.h
+++ b/security/tomoyo/common.h
@@ -56,9 +56,6 @@ struct tomoyo_page_buffer {
56 * (5) "is_patterned" is a bool which is true if "name" contains wildcard 56 * (5) "is_patterned" is a bool which is true if "name" contains wildcard
57 * characters, false otherwise. This allows TOMOYO to use "hash" and 57 * characters, false otherwise. This allows TOMOYO to use "hash" and
58 * strcmp() for string comparison if "is_patterned" is false. 58 * strcmp() for string comparison if "is_patterned" is false.
59 * (6) "depth" is calculated using the number of "/" characters in "name".
60 * This allows TOMOYO to avoid comparing two pathnames which never match
61 * (e.g. whether "/var/www/html/index.html" matches "/tmp/sh-thd-\$").
62 */ 59 */
63struct tomoyo_path_info { 60struct tomoyo_path_info {
64 const char *name; 61 const char *name;
@@ -66,7 +63,6 @@ struct tomoyo_path_info {
66 u16 const_len; /* = tomoyo_const_part_length(name) */ 63 u16 const_len; /* = tomoyo_const_part_length(name) */
67 bool is_dir; /* = tomoyo_strendswith(name, "/") */ 64 bool is_dir; /* = tomoyo_strendswith(name, "/") */
68 bool is_patterned; /* = tomoyo_path_contains_pattern(name) */ 65 bool is_patterned; /* = tomoyo_path_contains_pattern(name) */
69 u16 depth; /* = tomoyo_path_depth(name) */
70}; 66};
71 67
72/* 68/*
diff --git a/security/tomoyo/realpath.c b/security/tomoyo/realpath.c
index 5f2e33263371..917f564cdab1 100644
--- a/security/tomoyo/realpath.c
+++ b/security/tomoyo/realpath.c
@@ -13,6 +13,8 @@
13#include <linux/mount.h> 13#include <linux/mount.h>
14#include <linux/mnt_namespace.h> 14#include <linux/mnt_namespace.h>
15#include <linux/fs_struct.h> 15#include <linux/fs_struct.h>
16#include <linux/hash.h>
17
16#include "common.h" 18#include "common.h"
17#include "realpath.h" 19#include "realpath.h"
18 20
@@ -263,7 +265,8 @@ static unsigned int tomoyo_quota_for_savename;
263 * table. Frequency of appending strings is very low. So we don't need 265 * table. Frequency of appending strings is very low. So we don't need
264 * large (e.g. 64k) hash size. 256 will be sufficient. 266 * large (e.g. 64k) hash size. 256 will be sufficient.
265 */ 267 */
266#define TOMOYO_MAX_HASH 256 268#define TOMOYO_HASH_BITS 8
269#define TOMOYO_MAX_HASH (1u<<TOMOYO_HASH_BITS)
267 270
268/* 271/*
269 * tomoyo_name_entry is a structure which is used for linking 272 * tomoyo_name_entry is a structure which is used for linking
@@ -315,6 +318,7 @@ const struct tomoyo_path_info *tomoyo_save_name(const char *name)
315 struct tomoyo_free_memory_block_list *fmb; 318 struct tomoyo_free_memory_block_list *fmb;
316 int len; 319 int len;
317 char *cp; 320 char *cp;
321 struct list_head *head;
318 322
319 if (!name) 323 if (!name)
320 return NULL; 324 return NULL;
@@ -325,9 +329,10 @@ const struct tomoyo_path_info *tomoyo_save_name(const char *name)
325 return NULL; 329 return NULL;
326 } 330 }
327 hash = full_name_hash((const unsigned char *) name, len - 1); 331 hash = full_name_hash((const unsigned char *) name, len - 1);
332 head = &tomoyo_name_list[hash_long(hash, TOMOYO_HASH_BITS)];
333
328 mutex_lock(&lock); 334 mutex_lock(&lock);
329 list_for_each_entry(ptr, &tomoyo_name_list[hash % TOMOYO_MAX_HASH], 335 list_for_each_entry(ptr, head, list) {
330 list) {
331 if (hash == ptr->entry.hash && !strcmp(name, ptr->entry.name)) 336 if (hash == ptr->entry.hash && !strcmp(name, ptr->entry.name))
332 goto out; 337 goto out;
333 } 338 }
@@ -365,7 +370,7 @@ const struct tomoyo_path_info *tomoyo_save_name(const char *name)
365 tomoyo_fill_path_info(&ptr->entry); 370 tomoyo_fill_path_info(&ptr->entry);
366 fmb->ptr += len; 371 fmb->ptr += len;
367 fmb->len -= len; 372 fmb->len -= len;
368 list_add_tail(&ptr->list, &tomoyo_name_list[hash % TOMOYO_MAX_HASH]); 373 list_add_tail(&ptr->list, head);
369 if (fmb->len == 0) { 374 if (fmb->len == 0) {
370 list_del(&fmb->list); 375 list_del(&fmb->list);
371 kfree(fmb); 376 kfree(fmb);
diff --git a/sound/arm/aaci.c b/sound/arm/aaci.c
index 1f0f8213e2d5..6c160a038b23 100644
--- a/sound/arm/aaci.c
+++ b/sound/arm/aaci.c
@@ -504,6 +504,10 @@ static int aaci_pcm_hw_params(struct snd_pcm_substream *substream,
504 int err; 504 int err;
505 505
506 aaci_pcm_hw_free(substream); 506 aaci_pcm_hw_free(substream);
507 if (aacirun->pcm_open) {
508 snd_ac97_pcm_close(aacirun->pcm);
509 aacirun->pcm_open = 0;
510 }
507 511
508 err = devdma_hw_alloc(NULL, substream, 512 err = devdma_hw_alloc(NULL, substream,
509 params_buffer_bytes(params)); 513 params_buffer_bytes(params));
@@ -517,7 +521,7 @@ static int aaci_pcm_hw_params(struct snd_pcm_substream *substream,
517 else 521 else
518 err = snd_ac97_pcm_open(aacirun->pcm, params_rate(params), 522 err = snd_ac97_pcm_open(aacirun->pcm, params_rate(params),
519 params_channels(params), 523 params_channels(params),
520 aacirun->pcm->r[1].slots); 524 aacirun->pcm->r[0].slots);
521 525
522 if (err) 526 if (err)
523 goto out; 527 goto out;
diff --git a/sound/core/rawmidi.c b/sound/core/rawmidi.c
index c0adc14c91f0..70d6f25ba526 100644
--- a/sound/core/rawmidi.c
+++ b/sound/core/rawmidi.c
@@ -248,7 +248,8 @@ static int assign_substream(struct snd_rawmidi *rmidi, int subdevice,
248 list_for_each_entry(substream, &s->substreams, list) { 248 list_for_each_entry(substream, &s->substreams, list) {
249 if (substream->opened) { 249 if (substream->opened) {
250 if (stream == SNDRV_RAWMIDI_STREAM_INPUT || 250 if (stream == SNDRV_RAWMIDI_STREAM_INPUT ||
251 !(mode & SNDRV_RAWMIDI_LFLG_APPEND)) 251 !(mode & SNDRV_RAWMIDI_LFLG_APPEND) ||
252 !substream->append)
252 continue; 253 continue;
253 } 254 }
254 if (subdevice < 0 || subdevice == substream->number) { 255 if (subdevice < 0 || subdevice == substream->number) {
@@ -266,17 +267,21 @@ static int open_substream(struct snd_rawmidi *rmidi,
266{ 267{
267 int err; 268 int err;
268 269
269 err = snd_rawmidi_runtime_create(substream); 270 if (substream->use_count == 0) {
270 if (err < 0) 271 err = snd_rawmidi_runtime_create(substream);
271 return err; 272 if (err < 0)
272 err = substream->ops->open(substream); 273 return err;
273 if (err < 0) 274 err = substream->ops->open(substream);
274 return err; 275 if (err < 0) {
275 substream->opened = 1; 276 snd_rawmidi_runtime_free(substream);
276 if (substream->use_count++ == 0) 277 return err;
278 }
279 substream->opened = 1;
277 substream->active_sensing = 0; 280 substream->active_sensing = 0;
278 if (mode & SNDRV_RAWMIDI_LFLG_APPEND) 281 if (mode & SNDRV_RAWMIDI_LFLG_APPEND)
279 substream->append = 1; 282 substream->append = 1;
283 }
284 substream->use_count++;
280 rmidi->streams[substream->stream].substream_opened++; 285 rmidi->streams[substream->stream].substream_opened++;
281 return 0; 286 return 0;
282} 287}
@@ -297,27 +302,27 @@ static int rawmidi_open_priv(struct snd_rawmidi *rmidi, int subdevice, int mode,
297 SNDRV_RAWMIDI_STREAM_INPUT, 302 SNDRV_RAWMIDI_STREAM_INPUT,
298 mode, &sinput); 303 mode, &sinput);
299 if (err < 0) 304 if (err < 0)
300 goto __error; 305 return err;
301 } 306 }
302 if (mode & SNDRV_RAWMIDI_LFLG_OUTPUT) { 307 if (mode & SNDRV_RAWMIDI_LFLG_OUTPUT) {
303 err = assign_substream(rmidi, subdevice, 308 err = assign_substream(rmidi, subdevice,
304 SNDRV_RAWMIDI_STREAM_OUTPUT, 309 SNDRV_RAWMIDI_STREAM_OUTPUT,
305 mode, &soutput); 310 mode, &soutput);
306 if (err < 0) 311 if (err < 0)
307 goto __error; 312 return err;
308 } 313 }
309 314
310 if (sinput) { 315 if (sinput) {
311 err = open_substream(rmidi, sinput, mode); 316 err = open_substream(rmidi, sinput, mode);
312 if (err < 0) 317 if (err < 0)
313 goto __error; 318 return err;
314 } 319 }
315 if (soutput) { 320 if (soutput) {
316 err = open_substream(rmidi, soutput, mode); 321 err = open_substream(rmidi, soutput, mode);
317 if (err < 0) { 322 if (err < 0) {
318 if (sinput) 323 if (sinput)
319 close_substream(rmidi, sinput, 0); 324 close_substream(rmidi, sinput, 0);
320 goto __error; 325 return err;
321 } 326 }
322 } 327 }
323 328
@@ -325,13 +330,6 @@ static int rawmidi_open_priv(struct snd_rawmidi *rmidi, int subdevice, int mode,
325 rfile->input = sinput; 330 rfile->input = sinput;
326 rfile->output = soutput; 331 rfile->output = soutput;
327 return 0; 332 return 0;
328
329 __error:
330 if (sinput && sinput->runtime)
331 snd_rawmidi_runtime_free(sinput);
332 if (soutput && soutput->runtime)
333 snd_rawmidi_runtime_free(soutput);
334 return err;
335} 333}
336 334
337/* called from sound/core/seq/seq_midi.c */ 335/* called from sound/core/seq/seq_midi.c */
diff --git a/sound/oss/dmasound/dmasound_core.c b/sound/oss/dmasound/dmasound_core.c
index 793b7f478433..3f3c3f71db4b 100644
--- a/sound/oss/dmasound/dmasound_core.c
+++ b/sound/oss/dmasound/dmasound_core.c
@@ -219,7 +219,9 @@ static int shared_resources_initialised;
219 * Mid level stuff 219 * Mid level stuff
220 */ 220 */
221 221
222struct sound_settings dmasound = { .lock = SPIN_LOCK_UNLOCKED }; 222struct sound_settings dmasound = {
223 .lock = __SPIN_LOCK_UNLOCKED(dmasound.lock)
224};
223 225
224static inline void sound_silence(void) 226static inline void sound_silence(void)
225{ 227{
diff --git a/sound/oss/hex2hex.c b/sound/oss/hex2hex.c
index 5460faae98c9..041ef5c52bc2 100644
--- a/sound/oss/hex2hex.c
+++ b/sound/oss/hex2hex.c
@@ -12,7 +12,7 @@
12#define MAX_SIZE (256*1024) 12#define MAX_SIZE (256*1024)
13unsigned char buf[MAX_SIZE]; 13unsigned char buf[MAX_SIZE];
14 14
15int loadhex(FILE *inf, unsigned char *buf) 15static int loadhex(FILE *inf, unsigned char *buf)
16{ 16{
17 int l=0, c, i; 17 int l=0, c, i;
18 18
diff --git a/sound/oss/sb_common.c b/sound/oss/sb_common.c
index 77d0e5efda76..ce4db49291f7 100644
--- a/sound/oss/sb_common.c
+++ b/sound/oss/sb_common.c
@@ -157,7 +157,7 @@ static void sb_intr (sb_devc *devc)
157 break; 157 break;
158 158
159 default: 159 default:
160 /* printk(KERN_WARN "Sound Blaster: Unexpected interrupt\n"); */ 160 /* printk(KERN_WARNING "Sound Blaster: Unexpected interrupt\n"); */
161 ; 161 ;
162 } 162 }
163 } 163 }
@@ -177,7 +177,7 @@ static void sb_intr (sb_devc *devc)
177 break; 177 break;
178 178
179 default: 179 default:
180 /* printk(KERN_WARN "Sound Blaster: Unexpected interrupt\n"); */ 180 /* printk(KERN_WARNING "Sound Blaster: Unexpected interrupt\n"); */
181 ; 181 ;
182 } 182 }
183 } 183 }
diff --git a/sound/oss/sb_ess.c b/sound/oss/sb_ess.c
index 180e95c87e3e..51a3d381a59e 100644
--- a/sound/oss/sb_ess.c
+++ b/sound/oss/sb_ess.c
@@ -782,7 +782,7 @@ printk(KERN_INFO "FKS: ess_handle_channel %s irq_mode=%d\n", channel, irq_mode);
782 break; 782 break;
783 783
784 default:; 784 default:;
785 /* printk(KERN_WARN "ESS: Unexpected interrupt\n"); */ 785 /* printk(KERN_WARNING "ESS: Unexpected interrupt\n"); */
786 } 786 }
787} 787}
788 788
diff --git a/sound/pci/hda/hda_intel.c b/sound/pci/hda/hda_intel.c
index e340792f6cb3..6517f589d01d 100644
--- a/sound/pci/hda/hda_intel.c
+++ b/sound/pci/hda/hda_intel.c
@@ -722,9 +722,10 @@ static unsigned int azx_rirb_get_response(struct hda_bus *bus,
722 chip->last_cmd[addr]); 722 chip->last_cmd[addr]);
723 chip->single_cmd = 1; 723 chip->single_cmd = 1;
724 bus->response_reset = 0; 724 bus->response_reset = 0;
725 /* re-initialize CORB/RIRB */ 725 /* release CORB/RIRB */
726 azx_free_cmd_io(chip); 726 azx_free_cmd_io(chip);
727 azx_init_cmd_io(chip); 727 /* disable unsolicited responses */
728 azx_writel(chip, GCTL, azx_readl(chip, GCTL) & ~ICH6_GCTL_UNSOL);
728 return -1; 729 return -1;
729} 730}
730 731
@@ -865,7 +866,9 @@ static int azx_reset(struct azx *chip)
865 } 866 }
866 867
867 /* Accept unsolicited responses */ 868 /* Accept unsolicited responses */
868 azx_writel(chip, GCTL, azx_readl(chip, GCTL) | ICH6_GCTL_UNSOL); 869 if (!chip->single_cmd)
870 azx_writel(chip, GCTL, azx_readl(chip, GCTL) |
871 ICH6_GCTL_UNSOL);
869 872
870 /* detect codecs */ 873 /* detect codecs */
871 if (!chip->codec_mask) { 874 if (!chip->codec_mask) {
@@ -980,7 +983,8 @@ static void azx_init_chip(struct azx *chip)
980 azx_int_enable(chip); 983 azx_int_enable(chip);
981 984
982 /* initialize the codec command I/O */ 985 /* initialize the codec command I/O */
983 azx_init_cmd_io(chip); 986 if (!chip->single_cmd)
987 azx_init_cmd_io(chip);
984 988
985 /* program the position buffer */ 989 /* program the position buffer */
986 azx_writel(chip, DPLBASE, (u32)chip->posbuf.addr); 990 azx_writel(chip, DPLBASE, (u32)chip->posbuf.addr);
diff --git a/sound/pci/hda/patch_conexant.c b/sound/pci/hda/patch_conexant.c
index 3fbbc8c01e70..905859d4f4df 100644
--- a/sound/pci/hda/patch_conexant.c
+++ b/sound/pci/hda/patch_conexant.c
@@ -110,6 +110,7 @@ struct conexant_spec {
110 110
111 unsigned int dell_automute; 111 unsigned int dell_automute;
112 unsigned int port_d_mode; 112 unsigned int port_d_mode;
113 unsigned char ext_mic_bias;
113}; 114};
114 115
115static int conexant_playback_pcm_open(struct hda_pcm_stream *hinfo, 116static int conexant_playback_pcm_open(struct hda_pcm_stream *hinfo,
@@ -1927,6 +1928,11 @@ static hda_nid_t cxt5066_adc_nids[3] = { 0x14, 0x15, 0x16 };
1927static hda_nid_t cxt5066_capsrc_nids[1] = { 0x17 }; 1928static hda_nid_t cxt5066_capsrc_nids[1] = { 0x17 };
1928#define CXT5066_SPDIF_OUT 0x21 1929#define CXT5066_SPDIF_OUT 0x21
1929 1930
1931/* OLPC's microphone port is DC coupled for use with external sensors,
1932 * therefore we use a 50% mic bias in order to center the input signal with
1933 * the DC input range of the codec. */
1934#define CXT5066_OLPC_EXT_MIC_BIAS PIN_VREF50
1935
1930static struct hda_channel_mode cxt5066_modes[1] = { 1936static struct hda_channel_mode cxt5066_modes[1] = {
1931 { 2, NULL }, 1937 { 2, NULL },
1932}; 1938};
@@ -1980,9 +1986,10 @@ static int cxt5066_hp_master_sw_put(struct snd_kcontrol *kcontrol,
1980/* toggle input of built-in and mic jack appropriately */ 1986/* toggle input of built-in and mic jack appropriately */
1981static void cxt5066_automic(struct hda_codec *codec) 1987static void cxt5066_automic(struct hda_codec *codec)
1982{ 1988{
1983 static struct hda_verb ext_mic_present[] = { 1989 struct conexant_spec *spec = codec->spec;
1990 struct hda_verb ext_mic_present[] = {
1984 /* enable external mic, port B */ 1991 /* enable external mic, port B */
1985 {0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80}, 1992 {0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL, spec->ext_mic_bias},
1986 1993
1987 /* switch to external mic input */ 1994 /* switch to external mic input */
1988 {0x17, AC_VERB_SET_CONNECT_SEL, 0}, 1995 {0x17, AC_VERB_SET_CONNECT_SEL, 0},
@@ -2235,7 +2242,7 @@ static struct hda_verb cxt5066_init_verbs_olpc[] = {
2235 {0x19, AC_VERB_SET_CONNECT_SEL, 0x00}, /* DAC1 */ 2242 {0x19, AC_VERB_SET_CONNECT_SEL, 0x00}, /* DAC1 */
2236 2243
2237 /* Port B: external microphone */ 2244 /* Port B: external microphone */
2238 {0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80}, 2245 {0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL, CXT5066_OLPC_EXT_MIC_BIAS},
2239 2246
2240 /* Port C: internal microphone */ 2247 /* Port C: internal microphone */
2241 {0x1b, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80}, 2248 {0x1b, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80},
@@ -2325,6 +2332,7 @@ static struct snd_pci_quirk cxt5066_cfg_tbl[] = {
2325 CXT5066_LAPTOP), 2332 CXT5066_LAPTOP),
2326 SND_PCI_QUIRK(0x1028, 0x02f5, "Dell", 2333 SND_PCI_QUIRK(0x1028, 0x02f5, "Dell",
2327 CXT5066_DELL_LAPTOP), 2334 CXT5066_DELL_LAPTOP),
2335 SND_PCI_QUIRK(0x152d, 0x0833, "OLPC XO-1.5", CXT5066_OLPC_XO_1_5),
2328 {} 2336 {}
2329}; 2337};
2330 2338
@@ -2352,6 +2360,7 @@ static int patch_cxt5066(struct hda_codec *codec)
2352 spec->input_mux = &cxt5066_capture_source; 2360 spec->input_mux = &cxt5066_capture_source;
2353 2361
2354 spec->port_d_mode = PIN_HP; 2362 spec->port_d_mode = PIN_HP;
2363 spec->ext_mic_bias = PIN_VREF80;
2355 2364
2356 spec->num_init_verbs = 1; 2365 spec->num_init_verbs = 1;
2357 spec->init_verbs[0] = cxt5066_init_verbs; 2366 spec->init_verbs[0] = cxt5066_init_verbs;
@@ -2383,6 +2392,7 @@ static int patch_cxt5066(struct hda_codec *codec)
2383 spec->mixers[spec->num_mixers++] = cxt5066_mixer_master_olpc; 2392 spec->mixers[spec->num_mixers++] = cxt5066_mixer_master_olpc;
2384 spec->mixers[spec->num_mixers++] = cxt5066_mixers; 2393 spec->mixers[spec->num_mixers++] = cxt5066_mixers;
2385 spec->port_d_mode = 0; 2394 spec->port_d_mode = 0;
2395 spec->ext_mic_bias = CXT5066_OLPC_EXT_MIC_BIAS;
2386 2396
2387 /* no S/PDIF out */ 2397 /* no S/PDIF out */
2388 spec->multiout.dig_out_nid = 0; 2398 spec->multiout.dig_out_nid = 0;
diff --git a/sound/pci/hda/patch_nvhdmi.c b/sound/pci/hda/patch_nvhdmi.c
index 9fb60276f5c9..6afdab09bab7 100644
--- a/sound/pci/hda/patch_nvhdmi.c
+++ b/sound/pci/hda/patch_nvhdmi.c
@@ -397,6 +397,7 @@ static int patch_nvhdmi_2ch(struct hda_codec *codec)
397static struct hda_codec_preset snd_hda_preset_nvhdmi[] = { 397static struct hda_codec_preset snd_hda_preset_nvhdmi[] = {
398 { .id = 0x10de0002, .name = "MCP78 HDMI", .patch = patch_nvhdmi_8ch }, 398 { .id = 0x10de0002, .name = "MCP78 HDMI", .patch = patch_nvhdmi_8ch },
399 { .id = 0x10de0003, .name = "MCP78 HDMI", .patch = patch_nvhdmi_8ch }, 399 { .id = 0x10de0003, .name = "MCP78 HDMI", .patch = patch_nvhdmi_8ch },
400 { .id = 0x10de0005, .name = "MCP78 HDMI", .patch = patch_nvhdmi_8ch },
400 { .id = 0x10de0006, .name = "MCP78 HDMI", .patch = patch_nvhdmi_8ch }, 401 { .id = 0x10de0006, .name = "MCP78 HDMI", .patch = patch_nvhdmi_8ch },
401 { .id = 0x10de0007, .name = "MCP7A HDMI", .patch = patch_nvhdmi_8ch }, 402 { .id = 0x10de0007, .name = "MCP7A HDMI", .patch = patch_nvhdmi_8ch },
402 { .id = 0x10de0067, .name = "MCP67 HDMI", .patch = patch_nvhdmi_2ch }, 403 { .id = 0x10de0067, .name = "MCP67 HDMI", .patch = patch_nvhdmi_2ch },
@@ -406,6 +407,7 @@ static struct hda_codec_preset snd_hda_preset_nvhdmi[] = {
406 407
407MODULE_ALIAS("snd-hda-codec-id:10de0002"); 408MODULE_ALIAS("snd-hda-codec-id:10de0002");
408MODULE_ALIAS("snd-hda-codec-id:10de0003"); 409MODULE_ALIAS("snd-hda-codec-id:10de0003");
410MODULE_ALIAS("snd-hda-codec-id:10de0005");
409MODULE_ALIAS("snd-hda-codec-id:10de0006"); 411MODULE_ALIAS("snd-hda-codec-id:10de0006");
410MODULE_ALIAS("snd-hda-codec-id:10de0007"); 412MODULE_ALIAS("snd-hda-codec-id:10de0007");
411MODULE_ALIAS("snd-hda-codec-id:10de0067"); 413MODULE_ALIAS("snd-hda-codec-id:10de0067");
diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c
index ff20048504b6..70583719282b 100644
--- a/sound/pci/hda/patch_realtek.c
+++ b/sound/pci/hda/patch_realtek.c
@@ -4684,9 +4684,9 @@ static int alc880_parse_auto_config(struct hda_codec *codec)
4684 spec->multiout.dig_out_nid = dig_nid; 4684 spec->multiout.dig_out_nid = dig_nid;
4685 else { 4685 else {
4686 spec->multiout.slave_dig_outs = spec->slave_dig_outs; 4686 spec->multiout.slave_dig_outs = spec->slave_dig_outs;
4687 spec->slave_dig_outs[i - 1] = dig_nid; 4687 if (i >= ARRAY_SIZE(spec->slave_dig_outs) - 1)
4688 if (i == ARRAY_SIZE(spec->slave_dig_outs) - 1)
4689 break; 4688 break;
4689 spec->slave_dig_outs[i - 1] = dig_nid;
4690 } 4690 }
4691 } 4691 }
4692 if (spec->autocfg.dig_in_pin) 4692 if (spec->autocfg.dig_in_pin)
@@ -6249,7 +6249,7 @@ static struct snd_pci_quirk alc260_cfg_tbl[] = {
6249 SND_PCI_QUIRK(0x1025, 0x008f, "Acer", ALC260_ACER), 6249 SND_PCI_QUIRK(0x1025, 0x008f, "Acer", ALC260_ACER),
6250 SND_PCI_QUIRK(0x1509, 0x4540, "Favorit 100XS", ALC260_FAVORIT100), 6250 SND_PCI_QUIRK(0x1509, 0x4540, "Favorit 100XS", ALC260_FAVORIT100),
6251 SND_PCI_QUIRK(0x103c, 0x2808, "HP d5700", ALC260_HP_3013), 6251 SND_PCI_QUIRK(0x103c, 0x2808, "HP d5700", ALC260_HP_3013),
6252 SND_PCI_QUIRK(0x103c, 0x280a, "HP d5750", ALC260_HP_3013), 6252 SND_PCI_QUIRK(0x103c, 0x280a, "HP d5750", ALC260_AUTO), /* no quirk */
6253 SND_PCI_QUIRK(0x103c, 0x3010, "HP", ALC260_HP_3013), 6253 SND_PCI_QUIRK(0x103c, 0x3010, "HP", ALC260_HP_3013),
6254 SND_PCI_QUIRK(0x103c, 0x3011, "HP", ALC260_HP_3013), 6254 SND_PCI_QUIRK(0x103c, 0x3011, "HP", ALC260_HP_3013),
6255 SND_PCI_QUIRK(0x103c, 0x3012, "HP", ALC260_HP_DC7600), 6255 SND_PCI_QUIRK(0x103c, 0x3012, "HP", ALC260_HP_DC7600),
@@ -8911,10 +8911,11 @@ static struct snd_pci_quirk alc882_ssid_cfg_tbl[] = {
8911 SND_PCI_QUIRK(0x106b, 0x3800, "MacbookPro 4,1", ALC885_MBP3), 8911 SND_PCI_QUIRK(0x106b, 0x3800, "MacbookPro 4,1", ALC885_MBP3),
8912 SND_PCI_QUIRK(0x106b, 0x3e00, "iMac 24 Aluminum", ALC885_IMAC24), 8912 SND_PCI_QUIRK(0x106b, 0x3e00, "iMac 24 Aluminum", ALC885_IMAC24),
8913 SND_PCI_QUIRK(0x106b, 0x3f00, "Macbook 5,1", ALC885_MB5), 8913 SND_PCI_QUIRK(0x106b, 0x3f00, "Macbook 5,1", ALC885_MB5),
8914 /* FIXME: HP jack sense seems not working for MBP 5,1, so apparently 8914 /* FIXME: HP jack sense seems not working for MBP 5,1 or 5,2,
8915 * no perfect solution yet 8915 * so apparently no perfect solution yet
8916 */ 8916 */
8917 SND_PCI_QUIRK(0x106b, 0x4000, "MacbookPro 5,1", ALC885_MB5), 8917 SND_PCI_QUIRK(0x106b, 0x4000, "MacbookPro 5,1", ALC885_MB5),
8918 SND_PCI_QUIRK(0x106b, 0x4600, "MacbookPro 5,2", ALC885_MB5),
8918 {} /* terminator */ 8919 {} /* terminator */
8919}; 8920};
8920 8921
@@ -9813,9 +9814,9 @@ static int alc882_parse_auto_config(struct hda_codec *codec)
9813 spec->multiout.dig_out_nid = dig_nid; 9814 spec->multiout.dig_out_nid = dig_nid;
9814 else { 9815 else {
9815 spec->multiout.slave_dig_outs = spec->slave_dig_outs; 9816 spec->multiout.slave_dig_outs = spec->slave_dig_outs;
9816 spec->slave_dig_outs[i - 1] = dig_nid; 9817 if (i >= ARRAY_SIZE(spec->slave_dig_outs) - 1)
9817 if (i == ARRAY_SIZE(spec->slave_dig_outs) - 1)
9818 break; 9818 break;
9819 spec->slave_dig_outs[i - 1] = dig_nid;
9819 } 9820 }
9820 } 9821 }
9821 if (spec->autocfg.dig_in_pin) 9822 if (spec->autocfg.dig_in_pin)
@@ -11460,6 +11461,8 @@ static struct snd_pci_quirk alc262_cfg_tbl[] = {
11460 SND_PCI_QUIRK(0x104d, 0x820f, "Sony ASSAMD", ALC262_SONY_ASSAMD), 11461 SND_PCI_QUIRK(0x104d, 0x820f, "Sony ASSAMD", ALC262_SONY_ASSAMD),
11461 SND_PCI_QUIRK(0x104d, 0x9016, "Sony VAIO", ALC262_AUTO), /* dig-only */ 11462 SND_PCI_QUIRK(0x104d, 0x9016, "Sony VAIO", ALC262_AUTO), /* dig-only */
11462 SND_PCI_QUIRK(0x104d, 0x9025, "Sony VAIO Z21MN", ALC262_TOSHIBA_S06), 11463 SND_PCI_QUIRK(0x104d, 0x9025, "Sony VAIO Z21MN", ALC262_TOSHIBA_S06),
11464 SND_PCI_QUIRK(0x104d, 0x9035, "Sony VAIO VGN-FW170J", ALC262_AUTO),
11465 SND_PCI_QUIRK(0x104d, 0x9047, "Sony VAIO Type G", ALC262_AUTO),
11463 SND_PCI_QUIRK_MASK(0x104d, 0xff00, 0x9000, "Sony VAIO", 11466 SND_PCI_QUIRK_MASK(0x104d, 0xff00, 0x9000, "Sony VAIO",
11464 ALC262_SONY_ASSAMD), 11467 ALC262_SONY_ASSAMD),
11465 SND_PCI_QUIRK(0x1179, 0x0001, "Toshiba dynabook SS RX1", 11468 SND_PCI_QUIRK(0x1179, 0x0001, "Toshiba dynabook SS RX1",
diff --git a/sound/pci/hda/patch_sigmatel.c b/sound/pci/hda/patch_sigmatel.c
index 66c0876bf734..86de305fc9f2 100644
--- a/sound/pci/hda/patch_sigmatel.c
+++ b/sound/pci/hda/patch_sigmatel.c
@@ -28,6 +28,7 @@
28#include <linux/delay.h> 28#include <linux/delay.h>
29#include <linux/slab.h> 29#include <linux/slab.h>
30#include <linux/pci.h> 30#include <linux/pci.h>
31#include <linux/dmi.h>
31#include <sound/core.h> 32#include <sound/core.h>
32#include <sound/asoundef.h> 33#include <sound/asoundef.h>
33#include <sound/jack.h> 34#include <sound/jack.h>
@@ -1589,6 +1590,8 @@ static struct snd_pci_quirk stac92hd73xx_cfg_tbl[] = {
1589 "Dell Studio 17", STAC_DELL_M6_DMIC), 1590 "Dell Studio 17", STAC_DELL_M6_DMIC),
1590 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x02be, 1591 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x02be,
1591 "Dell Studio 1555", STAC_DELL_M6_DMIC), 1592 "Dell Studio 1555", STAC_DELL_M6_DMIC),
1593 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x02bd,
1594 "Dell Studio 1557", STAC_DELL_M6_DMIC),
1592 {} /* terminator */ 1595 {} /* terminator */
1593}; 1596};
1594 1597
@@ -1693,6 +1696,8 @@ static struct snd_pci_quirk stac92hd71bxx_cfg_tbl[] = {
1693 "DFI LanParty", STAC_92HD71BXX_REF), 1696 "DFI LanParty", STAC_92HD71BXX_REF),
1694 SND_PCI_QUIRK(PCI_VENDOR_ID_HP, 0x30fb, 1697 SND_PCI_QUIRK(PCI_VENDOR_ID_HP, 0x30fb,
1695 "HP dv4-1222nr", STAC_HP_DV4_1222NR), 1698 "HP dv4-1222nr", STAC_HP_DV4_1222NR),
1699 SND_PCI_QUIRK_MASK(PCI_VENDOR_ID_HP, 0xfff0, 0x1720,
1700 "HP", STAC_HP_DV5),
1696 SND_PCI_QUIRK_MASK(PCI_VENDOR_ID_HP, 0xfff0, 0x3080, 1701 SND_PCI_QUIRK_MASK(PCI_VENDOR_ID_HP, 0xfff0, 0x3080,
1697 "HP", STAC_HP_DV5), 1702 "HP", STAC_HP_DV5),
1698 SND_PCI_QUIRK_MASK(PCI_VENDOR_ID_HP, 0xfff0, 0x30f0, 1703 SND_PCI_QUIRK_MASK(PCI_VENDOR_ID_HP, 0xfff0, 0x30f0,
@@ -4665,6 +4670,26 @@ static void stac92xx_unsol_event(struct hda_codec *codec, unsigned int res)
4665 } 4670 }
4666} 4671}
4667 4672
4673static int hp_bseries_system(u32 subsystem_id)
4674{
4675 switch (subsystem_id) {
4676 case 0x103c307e:
4677 case 0x103c307f:
4678 case 0x103c3080:
4679 case 0x103c3081:
4680 case 0x103c1722:
4681 case 0x103c1723:
4682 case 0x103c1724:
4683 case 0x103c1725:
4684 case 0x103c1726:
4685 case 0x103c1727:
4686 case 0x103c1728:
4687 case 0x103c1729:
4688 return 1;
4689 }
4690 return 0;
4691}
4692
4668#ifdef CONFIG_PROC_FS 4693#ifdef CONFIG_PROC_FS
4669static void stac92hd_proc_hook(struct snd_info_buffer *buffer, 4694static void stac92hd_proc_hook(struct snd_info_buffer *buffer,
4670 struct hda_codec *codec, hda_nid_t nid) 4695 struct hda_codec *codec, hda_nid_t nid)
@@ -4754,6 +4779,11 @@ static int stac92xx_hp_check_power_status(struct hda_codec *codec,
4754 else 4779 else
4755 spec->gpio_data |= spec->gpio_led; /* white */ 4780 spec->gpio_data |= spec->gpio_led; /* white */
4756 4781
4782 if (hp_bseries_system(codec->subsystem_id)) {
4783 /* LED state is inverted on these systems */
4784 spec->gpio_data ^= spec->gpio_led;
4785 }
4786
4757 stac_gpio_set(codec, spec->gpio_mask, 4787 stac_gpio_set(codec, spec->gpio_mask,
4758 spec->gpio_dir, 4788 spec->gpio_dir,
4759 spec->gpio_data); 4789 spec->gpio_data);
@@ -5243,6 +5273,7 @@ static int patch_stac92hd71bxx(struct hda_codec *codec)
5243{ 5273{
5244 struct sigmatel_spec *spec; 5274 struct sigmatel_spec *spec;
5245 struct hda_verb *unmute_init = stac92hd71bxx_unmute_core_init; 5275 struct hda_verb *unmute_init = stac92hd71bxx_unmute_core_init;
5276 unsigned int pin_cfg;
5246 int err = 0; 5277 int err = 0;
5247 5278
5248 spec = kzalloc(sizeof(*spec), GFP_KERNEL); 5279 spec = kzalloc(sizeof(*spec), GFP_KERNEL);
@@ -5426,6 +5457,45 @@ again:
5426 break; 5457 break;
5427 } 5458 }
5428 5459
5460 if (hp_bseries_system(codec->subsystem_id)) {
5461 pin_cfg = snd_hda_codec_get_pincfg(codec, 0x0f);
5462 if (get_defcfg_device(pin_cfg) == AC_JACK_LINE_OUT ||
5463 get_defcfg_device(pin_cfg) == AC_JACK_SPEAKER ||
5464 get_defcfg_device(pin_cfg) == AC_JACK_HP_OUT) {
5465 /* It was changed in the BIOS to just satisfy MS DTM.
5466 * Lets turn it back into slaved HP
5467 */
5468 pin_cfg = (pin_cfg & (~AC_DEFCFG_DEVICE))
5469 | (AC_JACK_HP_OUT <<
5470 AC_DEFCFG_DEVICE_SHIFT);
5471 pin_cfg = (pin_cfg & (~(AC_DEFCFG_DEF_ASSOC
5472 | AC_DEFCFG_SEQUENCE)))
5473 | 0x1f;
5474 snd_hda_codec_set_pincfg(codec, 0x0f, pin_cfg);
5475 }
5476 }
5477
5478 if ((codec->subsystem_id >> 16) == PCI_VENDOR_ID_HP) {
5479 const struct dmi_device *dev = NULL;
5480 while ((dev = dmi_find_device(DMI_DEV_TYPE_OEM_STRING,
5481 NULL, dev))) {
5482 if (strcmp(dev->name, "HP_Mute_LED_1")) {
5483 switch (codec->vendor_id) {
5484 case 0x111d7608:
5485 spec->gpio_led = 0x01;
5486 break;
5487 case 0x111d7600:
5488 case 0x111d7601:
5489 case 0x111d7602:
5490 case 0x111d7603:
5491 spec->gpio_led = 0x08;
5492 break;
5493 }
5494 break;
5495 }
5496 }
5497 }
5498
5429#ifdef CONFIG_SND_HDA_POWER_SAVE 5499#ifdef CONFIG_SND_HDA_POWER_SAVE
5430 if (spec->gpio_led) { 5500 if (spec->gpio_led) {
5431 spec->gpio_mask |= spec->gpio_led; 5501 spec->gpio_mask |= spec->gpio_led;
diff --git a/sound/pci/ice1712/ice1712.h b/sound/pci/ice1712/ice1712.h
index 9da2dae64c5b..d063149e7047 100644
--- a/sound/pci/ice1712/ice1712.h
+++ b/sound/pci/ice1712/ice1712.h
@@ -382,8 +382,8 @@ struct snd_ice1712 {
382#ifdef CONFIG_PM 382#ifdef CONFIG_PM
383 int (*pm_suspend)(struct snd_ice1712 *); 383 int (*pm_suspend)(struct snd_ice1712 *);
384 int (*pm_resume)(struct snd_ice1712 *); 384 int (*pm_resume)(struct snd_ice1712 *);
385 int pm_suspend_enabled:1; 385 unsigned int pm_suspend_enabled:1;
386 int pm_saved_is_spdif_master:1; 386 unsigned int pm_saved_is_spdif_master:1;
387 unsigned int pm_saved_spdif_ctrl; 387 unsigned int pm_saved_spdif_ctrl;
388 unsigned char pm_saved_spdif_cfg; 388 unsigned char pm_saved_spdif_cfg;
389 unsigned int pm_saved_route; 389 unsigned int pm_saved_route;
diff --git a/sound/pci/ice1712/prodigy_hifi.c b/sound/pci/ice1712/prodigy_hifi.c
index c75515f5be6f..6a9fee3ee78f 100644
--- a/sound/pci/ice1712/prodigy_hifi.c
+++ b/sound/pci/ice1712/prodigy_hifi.c
@@ -1100,7 +1100,7 @@ static void ak4396_init(struct snd_ice1712 *ice)
1100} 1100}
1101 1101
1102#ifdef CONFIG_PM 1102#ifdef CONFIG_PM
1103static int __devinit prodigy_hd2_resume(struct snd_ice1712 *ice) 1103static int prodigy_hd2_resume(struct snd_ice1712 *ice)
1104{ 1104{
1105 /* initialize ak4396 codec and restore previous mixer volumes */ 1105 /* initialize ak4396 codec and restore previous mixer volumes */
1106 struct prodigy_hifi_spec *spec = ice->spec; 1106 struct prodigy_hifi_spec *spec = ice->spec;
diff --git a/sound/pci/intel8x0.c b/sound/pci/intel8x0.c
index 754867ed4785..aac20fb4aad2 100644
--- a/sound/pci/intel8x0.c
+++ b/sound/pci/intel8x0.c
@@ -1950,6 +1950,12 @@ static struct ac97_quirk ac97_quirks[] __devinitdata = {
1950 }, 1950 },
1951 { 1951 {
1952 .subvendor = 0x104d, 1952 .subvendor = 0x104d,
1953 .subdevice = 0x8144,
1954 .name = "Sony",
1955 .type = AC97_TUNE_INV_EAPD
1956 },
1957 {
1958 .subvendor = 0x104d,
1953 .subdevice = 0x8197, 1959 .subdevice = 0x8197,
1954 .name = "Sony S1XP", 1960 .name = "Sony S1XP",
1955 .type = AC97_TUNE_INV_EAPD 1961 .type = AC97_TUNE_INV_EAPD
diff --git a/sound/pcmcia/pdaudiocf/pdaudiocf.c b/sound/pcmcia/pdaudiocf/pdaudiocf.c
index 64b859925c0b..7717e01fc071 100644
--- a/sound/pcmcia/pdaudiocf/pdaudiocf.c
+++ b/sound/pcmcia/pdaudiocf/pdaudiocf.c
@@ -131,7 +131,7 @@ static int snd_pdacf_probe(struct pcmcia_device *link)
131 return err; 131 return err;
132 } 132 }
133 133
134 snd_card_set_dev(card, &handle_to_dev(link)); 134 snd_card_set_dev(card, &link->dev);
135 135
136 pdacf->index = i; 136 pdacf->index = i;
137 card_list[i] = card; 137 card_list[i] = card;
@@ -142,12 +142,10 @@ static int snd_pdacf_probe(struct pcmcia_device *link)
142 link->io.Attributes1 = IO_DATA_PATH_WIDTH_AUTO; 142 link->io.Attributes1 = IO_DATA_PATH_WIDTH_AUTO;
143 link->io.NumPorts1 = 16; 143 link->io.NumPorts1 = 16;
144 144
145 link->irq.Attributes = IRQ_TYPE_EXCLUSIVE | IRQ_HANDLE_PRESENT | IRQ_FORCED_PULSE; 145 link->irq.Attributes = IRQ_TYPE_EXCLUSIVE | IRQ_FORCED_PULSE;
146 // link->irq.Attributes = IRQ_TYPE_DYNAMIC_SHARING|IRQ_FIRST_SHARED; 146 // link->irq.Attributes = IRQ_TYPE_DYNAMIC_SHARING|IRQ_FIRST_SHARED;
147 147
148 link->irq.IRQInfo1 = 0 /* | IRQ_LEVEL_ID */;
149 link->irq.Handler = pdacf_interrupt; 148 link->irq.Handler = pdacf_interrupt;
150 link->irq.Instance = pdacf;
151 link->conf.Attributes = CONF_ENABLE_IRQ; 149 link->conf.Attributes = CONF_ENABLE_IRQ;
152 link->conf.IntType = INT_MEMORY_AND_IO; 150 link->conf.IntType = INT_MEMORY_AND_IO;
153 link->conf.ConfigIndex = 1; 151 link->conf.ConfigIndex = 1;
diff --git a/sound/pcmcia/vx/vxpocket.c b/sound/pcmcia/vx/vxpocket.c
index 1492744ad67f..7be3b3357045 100644
--- a/sound/pcmcia/vx/vxpocket.c
+++ b/sound/pcmcia/vx/vxpocket.c
@@ -161,11 +161,9 @@ static int snd_vxpocket_new(struct snd_card *card, int ibl,
161 link->io.Attributes1 = IO_DATA_PATH_WIDTH_AUTO; 161 link->io.Attributes1 = IO_DATA_PATH_WIDTH_AUTO;
162 link->io.NumPorts1 = 16; 162 link->io.NumPorts1 = 16;
163 163
164 link->irq.Attributes = IRQ_TYPE_EXCLUSIVE | IRQ_HANDLE_PRESENT; 164 link->irq.Attributes = IRQ_TYPE_EXCLUSIVE;
165 165
166 link->irq.IRQInfo1 = IRQ_LEVEL_ID;
167 link->irq.Handler = &snd_vx_irq_handler; 166 link->irq.Handler = &snd_vx_irq_handler;
168 link->irq.Instance = chip;
169 167
170 link->conf.Attributes = CONF_ENABLE_IRQ; 168 link->conf.Attributes = CONF_ENABLE_IRQ;
171 link->conf.IntType = INT_MEMORY_AND_IO; 169 link->conf.IntType = INT_MEMORY_AND_IO;
@@ -244,7 +242,7 @@ static int vxpocket_config(struct pcmcia_device *link)
244 if (ret) 242 if (ret)
245 goto failed; 243 goto failed;
246 244
247 chip->dev = &handle_to_dev(link); 245 chip->dev = &link->dev;
248 snd_card_set_dev(chip->card, chip->dev); 246 snd_card_set_dev(chip->card, chip->dev);
249 247
250 if (snd_vxpocket_assign_resources(chip, link->io.BasePort1, link->irq.AssignedIRQ) < 0) 248 if (snd_vxpocket_assign_resources(chip, link->io.BasePort1, link->irq.AssignedIRQ) < 0)
diff --git a/sound/sh/aica.c b/sound/sh/aica.c
index 583a3693df75..a0df401ebb9f 100644
--- a/sound/sh/aica.c
+++ b/sound/sh/aica.c
@@ -49,6 +49,7 @@ MODULE_AUTHOR("Adrian McMenamin <adrian@mcmen.demon.co.uk>");
49MODULE_DESCRIPTION("Dreamcast AICA sound (pcm) driver"); 49MODULE_DESCRIPTION("Dreamcast AICA sound (pcm) driver");
50MODULE_LICENSE("GPL"); 50MODULE_LICENSE("GPL");
51MODULE_SUPPORTED_DEVICE("{{Yamaha/SEGA, AICA}}"); 51MODULE_SUPPORTED_DEVICE("{{Yamaha/SEGA, AICA}}");
52MODULE_FIRMWARE("aica_firmware.bin");
52 53
53/* module parameters */ 54/* module parameters */
54#define CARD_NAME "AICA" 55#define CARD_NAME "AICA"
diff --git a/sound/soc/codecs/tlv320aic23.c b/sound/soc/codecs/tlv320aic23.c
index 0b8dcb5cd729..90a0264f7538 100644
--- a/sound/soc/codecs/tlv320aic23.c
+++ b/sound/soc/codecs/tlv320aic23.c
@@ -265,8 +265,8 @@ static const int bosr_usb_divisor_table[] = {
265#define UPPER_GROUP ((1<<8) | (1<<9) | (1<<10) | (1<<11) | (1<<15)) 265#define UPPER_GROUP ((1<<8) | (1<<9) | (1<<10) | (1<<11) | (1<<15))
266static const unsigned short sr_valid_mask[] = { 266static const unsigned short sr_valid_mask[] = {
267 LOWER_GROUP|UPPER_GROUP, /* Normal, bosr - 0*/ 267 LOWER_GROUP|UPPER_GROUP, /* Normal, bosr - 0*/
268 LOWER_GROUP|UPPER_GROUP, /* Normal, bosr - 1*/
269 LOWER_GROUP, /* Usb, bosr - 0*/ 268 LOWER_GROUP, /* Usb, bosr - 0*/
269 LOWER_GROUP|UPPER_GROUP, /* Normal, bosr - 1*/
270 UPPER_GROUP, /* Usb, bosr - 1*/ 270 UPPER_GROUP, /* Usb, bosr - 1*/
271}; 271};
272/* 272/*
@@ -625,11 +625,10 @@ static int tlv320aic23_resume(struct platform_device *pdev)
625{ 625{
626 struct snd_soc_device *socdev = platform_get_drvdata(pdev); 626 struct snd_soc_device *socdev = platform_get_drvdata(pdev);
627 struct snd_soc_codec *codec = socdev->card->codec; 627 struct snd_soc_codec *codec = socdev->card->codec;
628 int i;
629 u16 reg; 628 u16 reg;
630 629
631 /* Sync reg_cache with the hardware */ 630 /* Sync reg_cache with the hardware */
632 for (reg = 0; reg < ARRAY_SIZE(tlv320aic23_reg); i++) { 631 for (reg = 0; reg < TLV320AIC23_RESET; reg++) {
633 u16 val = tlv320aic23_read_reg_cache(codec, reg); 632 u16 val = tlv320aic23_read_reg_cache(codec, reg);
634 tlv320aic23_write(codec, reg, val); 633 tlv320aic23_write(codec, reg, val);
635 } 634 }
diff --git a/sound/soc/omap/omap-pcm.c b/sound/soc/omap/omap-pcm.c
index 5735945788bf..6a829eef2a4f 100644
--- a/sound/soc/omap/omap-pcm.c
+++ b/sound/soc/omap/omap-pcm.c
@@ -195,8 +195,12 @@ static int omap_pcm_prepare(struct snd_pcm_substream *substream)
195 else 195 else
196 omap_enable_dma_irq(prtd->dma_ch, OMAP_DMA_FRAME_IRQ); 196 omap_enable_dma_irq(prtd->dma_ch, OMAP_DMA_FRAME_IRQ);
197 197
198 omap_set_dma_src_burst_mode(prtd->dma_ch, OMAP_DMA_DATA_BURST_16); 198 if (!(cpu_class_is_omap1())) {
199 omap_set_dma_dest_burst_mode(prtd->dma_ch, OMAP_DMA_DATA_BURST_16); 199 omap_set_dma_src_burst_mode(prtd->dma_ch,
200 OMAP_DMA_DATA_BURST_16);
201 omap_set_dma_dest_burst_mode(prtd->dma_ch,
202 OMAP_DMA_DATA_BURST_16);
203 }
200 204
201 return 0; 205 return 0;
202} 206}
diff --git a/sound/soc/omap/omap3evm.c b/sound/soc/omap/omap3evm.c
index 9114c263077b..13aa380de162 100644
--- a/sound/soc/omap/omap3evm.c
+++ b/sound/soc/omap/omap3evm.c
@@ -144,4 +144,4 @@ module_exit(omap3evm_soc_exit);
144 144
145MODULE_AUTHOR("Anuj Aggarwal <anuj.aggarwal@ti.com>"); 145MODULE_AUTHOR("Anuj Aggarwal <anuj.aggarwal@ti.com>");
146MODULE_DESCRIPTION("ALSA SoC OMAP3 EVM"); 146MODULE_DESCRIPTION("ALSA SoC OMAP3 EVM");
147MODULE_LICENSE("GPLv2"); 147MODULE_LICENSE("GPL v2");
diff --git a/sound/soc/omap/omap3pandora.c b/sound/soc/omap/omap3pandora.c
index ad219aaf7cb8..0cd06f5dd356 100644
--- a/sound/soc/omap/omap3pandora.c
+++ b/sound/soc/omap/omap3pandora.c
@@ -134,7 +134,7 @@ static int omap3pandora_hp_event(struct snd_soc_dapm_widget *w,
134 * |P| <--- TWL4030 <--------- Line In and MICs 134 * |P| <--- TWL4030 <--------- Line In and MICs
135 */ 135 */
136static const struct snd_soc_dapm_widget omap3pandora_out_dapm_widgets[] = { 136static const struct snd_soc_dapm_widget omap3pandora_out_dapm_widgets[] = {
137 SND_SOC_DAPM_DAC("PCM DAC", "Playback", SND_SOC_NOPM, 0, 0), 137 SND_SOC_DAPM_DAC("PCM DAC", "HiFi Playback", SND_SOC_NOPM, 0, 0),
138 SND_SOC_DAPM_PGA_E("Headphone Amplifier", SND_SOC_NOPM, 138 SND_SOC_DAPM_PGA_E("Headphone Amplifier", SND_SOC_NOPM,
139 0, 0, NULL, 0, omap3pandora_hp_event, 139 0, 0, NULL, 0, omap3pandora_hp_event,
140 SND_SOC_DAPM_POST_PMU | SND_SOC_DAPM_PRE_PMD), 140 SND_SOC_DAPM_POST_PMU | SND_SOC_DAPM_PRE_PMD),
@@ -181,6 +181,7 @@ static int omap3pandora_out_init(struct snd_soc_codec *codec)
181 snd_soc_dapm_nc_pin(codec, "CARKITR"); 181 snd_soc_dapm_nc_pin(codec, "CARKITR");
182 snd_soc_dapm_nc_pin(codec, "HFL"); 182 snd_soc_dapm_nc_pin(codec, "HFL");
183 snd_soc_dapm_nc_pin(codec, "HFR"); 183 snd_soc_dapm_nc_pin(codec, "HFR");
184 snd_soc_dapm_nc_pin(codec, "VIBRA");
184 185
185 ret = snd_soc_dapm_new_controls(codec, omap3pandora_out_dapm_widgets, 186 ret = snd_soc_dapm_new_controls(codec, omap3pandora_out_dapm_widgets,
186 ARRAY_SIZE(omap3pandora_out_dapm_widgets)); 187 ARRAY_SIZE(omap3pandora_out_dapm_widgets));
diff --git a/sound/soc/s3c24xx/s3c24xx-pcm.c b/sound/soc/s3c24xx/s3c24xx-pcm.c
index 5cbbdc80fde3..1f35c6fcf5fd 100644
--- a/sound/soc/s3c24xx/s3c24xx-pcm.c
+++ b/sound/soc/s3c24xx/s3c24xx-pcm.c
@@ -75,11 +75,19 @@ static void s3c24xx_pcm_enqueue(struct snd_pcm_substream *substream)
75{ 75{
76 struct s3c24xx_runtime_data *prtd = substream->runtime->private_data; 76 struct s3c24xx_runtime_data *prtd = substream->runtime->private_data;
77 dma_addr_t pos = prtd->dma_pos; 77 dma_addr_t pos = prtd->dma_pos;
78 unsigned int limit;
78 int ret; 79 int ret;
79 80
80 pr_debug("Entered %s\n", __func__); 81 pr_debug("Entered %s\n", __func__);
81 82
82 while (prtd->dma_loaded < prtd->dma_limit) { 83 if (s3c_dma_has_circular()) {
84 limit = (prtd->dma_end - prtd->dma_start) / prtd->dma_period;
85 } else
86 limit = prtd->dma_limit;
87
88 pr_debug("%s: loaded %d, limit %d\n", __func__, prtd->dma_loaded, limit);
89
90 while (prtd->dma_loaded < limit) {
83 unsigned long len = prtd->dma_period; 91 unsigned long len = prtd->dma_period;
84 92
85 pr_debug("dma_loaded: %d\n", prtd->dma_loaded); 93 pr_debug("dma_loaded: %d\n", prtd->dma_loaded);
@@ -123,7 +131,7 @@ static void s3c24xx_audio_buffdone(struct s3c2410_dma_chan *channel,
123 snd_pcm_period_elapsed(substream); 131 snd_pcm_period_elapsed(substream);
124 132
125 spin_lock(&prtd->lock); 133 spin_lock(&prtd->lock);
126 if (prtd->state & ST_RUNNING) { 134 if (prtd->state & ST_RUNNING && !s3c_dma_has_circular()) {
127 prtd->dma_loaded--; 135 prtd->dma_loaded--;
128 s3c24xx_pcm_enqueue(substream); 136 s3c24xx_pcm_enqueue(substream);
129 } 137 }
@@ -164,6 +172,11 @@ static int s3c24xx_pcm_hw_params(struct snd_pcm_substream *substream,
164 printk(KERN_ERR "failed to get dma channel\n"); 172 printk(KERN_ERR "failed to get dma channel\n");
165 return ret; 173 return ret;
166 } 174 }
175
176 /* use the circular buffering if we have it available. */
177 if (s3c_dma_has_circular())
178 s3c2410_dma_setflags(prtd->params->channel,
179 S3C2410_DMAF_CIRCULAR);
167 } 180 }
168 181
169 s3c2410_dma_set_buffdone_fn(prtd->params->channel, 182 s3c2410_dma_set_buffdone_fn(prtd->params->channel,
diff --git a/sound/soc/s3c24xx/s3c64xx-i2s.c b/sound/soc/s3c24xx/s3c64xx-i2s.c
index 3c06c401d0fb..105a77eeded0 100644
--- a/sound/soc/s3c24xx/s3c64xx-i2s.c
+++ b/sound/soc/s3c24xx/s3c64xx-i2s.c
@@ -220,6 +220,8 @@ static __devinit int s3c64xx_iis_dev_probe(struct platform_device *pdev)
220 goto err; 220 goto err;
221 } 221 }
222 222
223 clk_enable(i2s->iis_cclk);
224
223 ret = s3c_i2sv2_probe(pdev, dai, i2s, 0); 225 ret = s3c_i2sv2_probe(pdev, dai, i2s, 0);
224 if (ret) 226 if (ret)
225 goto err_clk; 227 goto err_clk;
diff --git a/sound/soc/soc-dapm.c b/sound/soc/soc-dapm.c
index d89f6dc00908..66d4c165f99b 100644
--- a/sound/soc/soc-dapm.c
+++ b/sound/soc/soc-dapm.c
@@ -973,9 +973,19 @@ static int dapm_power_widgets(struct snd_soc_codec *codec, int event)
973 if (!w->power_check) 973 if (!w->power_check)
974 continue; 974 continue;
975 975
976 power = w->power_check(w); 976 /* If we're suspending then pull down all the
977 if (power) 977 * power. */
978 sys_power = 1; 978 switch (event) {
979 case SND_SOC_DAPM_STREAM_SUSPEND:
980 power = 0;
981 break;
982
983 default:
984 power = w->power_check(w);
985 if (power)
986 sys_power = 1;
987 break;
988 }
979 989
980 if (w->power == power) 990 if (w->power == power)
981 continue; 991 continue;
@@ -999,8 +1009,12 @@ static int dapm_power_widgets(struct snd_soc_codec *codec, int event)
999 case SND_SOC_DAPM_STREAM_RESUME: 1009 case SND_SOC_DAPM_STREAM_RESUME:
1000 sys_power = 1; 1010 sys_power = 1;
1001 break; 1011 break;
1012 case SND_SOC_DAPM_STREAM_SUSPEND:
1013 sys_power = 0;
1014 break;
1002 case SND_SOC_DAPM_STREAM_NOP: 1015 case SND_SOC_DAPM_STREAM_NOP:
1003 sys_power = codec->bias_level != SND_SOC_BIAS_STANDBY; 1016 sys_power = codec->bias_level != SND_SOC_BIAS_STANDBY;
1017 break;
1004 default: 1018 default:
1005 break; 1019 break;
1006 } 1020 }
diff --git a/sound/usb/usbaudio.h b/sound/usb/usbaudio.h
index 8e7f78941ba6..e9a3a9dca15c 100644
--- a/sound/usb/usbaudio.h
+++ b/sound/usb/usbaudio.h
@@ -210,7 +210,7 @@ struct snd_usb_midi_endpoint_info {
210/* 210/*
211 */ 211 */
212 212
213#define combine_word(s) ((*s) | ((unsigned int)(s)[1] << 8)) 213#define combine_word(s) ((*(s)) | ((unsigned int)(s)[1] << 8))
214#define combine_triple(s) (combine_word(s) | ((unsigned int)(s)[2] << 16)) 214#define combine_triple(s) (combine_word(s) | ((unsigned int)(s)[2] << 16))
215#define combine_quad(s) (combine_triple(s) | ((unsigned int)(s)[3] << 24)) 215#define combine_quad(s) (combine_triple(s) | ((unsigned int)(s)[3] << 24))
216 216
diff --git a/sound/usb/usbmixer.c b/sound/usb/usbmixer.c
index 9efcfd08d747..c998220b99c6 100644
--- a/sound/usb/usbmixer.c
+++ b/sound/usb/usbmixer.c
@@ -1071,6 +1071,15 @@ static int parse_audio_feature_unit(struct mixer_build *state, int unitid, unsig
1071 channels = (ftr[0] - 7) / csize - 1; 1071 channels = (ftr[0] - 7) / csize - 1;
1072 1072
1073 master_bits = snd_usb_combine_bytes(ftr + 6, csize); 1073 master_bits = snd_usb_combine_bytes(ftr + 6, csize);
1074 /* master configuration quirks */
1075 switch (state->chip->usb_id) {
1076 case USB_ID(0x08bb, 0x2702):
1077 snd_printk(KERN_INFO
1078 "usbmixer: master volume quirk for PCM2702 chip\n");
1079 /* disable non-functional volume control */
1080 master_bits &= ~(1 << (USB_FEATURE_VOLUME - 1));
1081 break;
1082 }
1074 if (channels > 0) 1083 if (channels > 0)
1075 first_ch_bits = snd_usb_combine_bytes(ftr + 6 + csize, csize); 1084 first_ch_bits = snd_usb_combine_bytes(ftr + 6 + csize, csize);
1076 else 1085 else
diff --git a/tools/perf/.gitignore b/tools/perf/.gitignore
index 0854f110bf7f..fe08660ce0bd 100644
--- a/tools/perf/.gitignore
+++ b/tools/perf/.gitignore
@@ -12,6 +12,7 @@ perf*.1
12perf*.xml 12perf*.xml
13perf*.html 13perf*.html
14common-cmds.h 14common-cmds.h
15perf.data
15tags 16tags
16TAGS 17TAGS
17cscope* 18cscope*
diff --git a/tools/perf/Documentation/perf-bench.txt b/tools/perf/Documentation/perf-bench.txt
new file mode 100644
index 000000000000..ae525ac5a2ce
--- /dev/null
+++ b/tools/perf/Documentation/perf-bench.txt
@@ -0,0 +1,120 @@
1perf-bench(1)
2============
3
4NAME
5----
6perf-bench - General framework for benchmark suites
7
8SYNOPSIS
9--------
10[verse]
11'perf bench' [<common options>] <subsystem> <suite> [<options>]
12
13DESCRIPTION
14-----------
15This 'perf bench' command is general framework for benchmark suites.
16
17COMMON OPTIONS
18--------------
19-f::
20--format=::
21Specify format style.
22Current available format styles are,
23
24'default'::
25Default style. This is mainly for human reading.
26---------------------
27% perf bench sched pipe # with no style specify
28(executing 1000000 pipe operations between two tasks)
29 Total time:5.855 sec
30 5.855061 usecs/op
31 170792 ops/sec
32---------------------
33
34'simple'::
35This simple style is friendly for automated
36processing by scripts.
37---------------------
38% perf bench --format=simple sched pipe # specified simple
395.988
40---------------------
41
42SUBSYSTEM
43---------
44
45'sched'::
46 Scheduler and IPC mechanisms.
47
48SUITES FOR 'sched'
49~~~~~~~~~~~~~~~~~~
50*messaging*::
51Suite for evaluating performance of scheduler and IPC mechanisms.
52Based on hackbench by Rusty Russell.
53
54Options of *pipe*
55^^^^^^^^^^^^^^^^^
56-p::
57--pipe::
58Use pipe() instead of socketpair()
59
60-t::
61--thread::
62Be multi thread instead of multi process
63
64-g::
65--group=::
66Specify number of groups
67
68-l::
69--loop=::
70Specify number of loops
71
72Example of *messaging*
73^^^^^^^^^^^^^^^^^^^^^^
74
75---------------------
76% perf bench sched messaging # run with default
77options (20 sender and receiver processes per group)
78(10 groups == 400 processes run)
79
80 Total time:0.308 sec
81
82% perf bench sched messaging -t -g 20 # be multi-thread,with 20 groups
83(20 sender and receiver threads per group)
84(20 groups == 800 threads run)
85
86 Total time:0.582 sec
87---------------------
88
89*pipe*::
90Suite for pipe() system call.
91Based on pipe-test-1m.c by Ingo Molnar.
92
93Options of *pipe*
94^^^^^^^^^^^^^^^^^
95-l::
96--loop=::
97Specify number of loops.
98
99Example of *pipe*
100^^^^^^^^^^^^^^^^^
101
102---------------------
103% perf bench sched pipe
104(executing 1000000 pipe operations between two tasks)
105
106 Total time:8.091 sec
107 8.091833 usecs/op
108 123581 ops/sec
109
110% perf bench sched pipe -l 1000 # loop 1000
111(executing 1000 pipe operations between two tasks)
112
113 Total time:0.016 sec
114 16.948000 usecs/op
115 59004 ops/sec
116---------------------
117
118SEE ALSO
119--------
120linkperf:perf[1]
diff --git a/tools/perf/Documentation/perf-buildid-list.txt b/tools/perf/Documentation/perf-buildid-list.txt
new file mode 100644
index 000000000000..01b642c0bf8f
--- /dev/null
+++ b/tools/perf/Documentation/perf-buildid-list.txt
@@ -0,0 +1,34 @@
1perf-buildid-list(1)
2====================
3
4NAME
5----
6perf-buildid-list - List the buildids in a perf.data file
7
8SYNOPSIS
9--------
10[verse]
11'perf buildid-list <options>'
12
13DESCRIPTION
14-----------
15This command displays the buildids found in a perf.data file, so that other
16tools can be used to fetch packages with matching symbol tables for use by
17perf report.
18
19OPTIONS
20-------
21-i::
22--input=::
23 Input file name. (default: perf.data)
24-f::
25--force::
26 Don't do ownership validation.
27-v::
28--verbose::
29 Be more verbose.
30
31SEE ALSO
32--------
33linkperf:perf-record[1], linkperf:perf-top[1],
34linkperf:perf-report[1]
diff --git a/tools/perf/Documentation/perf-kmem.txt b/tools/perf/Documentation/perf-kmem.txt
new file mode 100644
index 000000000000..44b0ce35c28a
--- /dev/null
+++ b/tools/perf/Documentation/perf-kmem.txt
@@ -0,0 +1,44 @@
1perf-kmem(1)
2==============
3
4NAME
5----
6perf-kmem - Tool to trace/measure kernel memory(slab) properties
7
8SYNOPSIS
9--------
10[verse]
11'perf kmem' {record} [<options>]
12
13DESCRIPTION
14-----------
15There's two variants of perf kmem:
16
17 'perf kmem record <command>' to record the kmem events
18 of an arbitrary workload.
19
20 'perf kmem' to report kernel memory statistics.
21
22OPTIONS
23-------
24-i <file>::
25--input=<file>::
26 Select the input file (default: perf.data)
27
28--stat=<caller|alloc>::
29 Select per callsite or per allocation statistics
30
31-s <key[,key2...]>::
32--sort=<key[,key2...]>::
33 Sort the output (default: frag,hit,bytes)
34
35-l <num>::
36--line=<num>::
37 Print n lines only
38
39--raw-ip::
40 Print raw ip instead of symbol
41
42SEE ALSO
43--------
44linkperf:perf-record[1]
diff --git a/tools/perf/Documentation/perf-probe.txt b/tools/perf/Documentation/perf-probe.txt
new file mode 100644
index 000000000000..9270594e6dfd
--- /dev/null
+++ b/tools/perf/Documentation/perf-probe.txt
@@ -0,0 +1,49 @@
1perf-probe(1)
2=============
3
4NAME
5----
6perf-probe - Define new dynamic tracepoints
7
8SYNOPSIS
9--------
10[verse]
11'perf probe' [options] --add 'PROBE' [--add 'PROBE' ...]
12or
13'perf probe' [options] 'PROBE' ['PROBE' ...]
14
15
16DESCRIPTION
17-----------
18This command defines dynamic tracepoint events, by symbol and registers
19without debuginfo, or by C expressions (C line numbers, C function names,
20and C local variables) with debuginfo.
21
22
23OPTIONS
24-------
25-k::
26--vmlinux=PATH::
27 Specify vmlinux path which has debuginfo (Dwarf binary).
28
29-v::
30--verbose::
31 Be more verbose (show parsed arguments, etc).
32
33-a::
34--add::
35 Define a probe point (see PROBE SYNTAX for detail)
36
37PROBE SYNTAX
38------------
39Probe points are defined by following syntax.
40
41 "FUNC[+OFFS|:RLN|%return][@SRC]|SRC:ALN [ARG ...]"
42
43'FUNC' specifies a probed function name, and it may have one of the following options; '+OFFS' is the offset from function entry address in bytes, 'RLN' is the relative-line number from function entry line, and '%return' means that it probes function return. In addition, 'SRC' specifies a source file which has that function.
44It is also possible to specify a probe point by the source line number by using 'SRC:ALN' syntax, where 'SRC' is the source file path and 'ALN' is the line number.
45'ARG' specifies the arguments of this probe point. You can use the name of local variable, or kprobe-tracer argument format (e.g. $retval, %ax, etc).
46
47SEE ALSO
48--------
49linkperf:perf-trace[1], linkperf:perf-record[1]
diff --git a/tools/perf/Documentation/perf-record.txt b/tools/perf/Documentation/perf-record.txt
index 0ff23de9e453..fc46c0b40f6e 100644
--- a/tools/perf/Documentation/perf-record.txt
+++ b/tools/perf/Documentation/perf-record.txt
@@ -26,11 +26,19 @@ OPTIONS
26 26
27-e:: 27-e::
28--event=:: 28--event=::
29 Select the PMU event. Selection can be a symbolic event name 29 Select the PMU event. Selection can be:
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
32 hexadecimal event descriptor.
33 30
31 - a symbolic event name (use 'perf list' to list all events)
32
33 - a raw PMU event (eventsel+umask) in the form of rNNN where NNN is a
34 hexadecimal event descriptor.
35
36 - a hardware breakpoint event in the form of '\mem:addr[:access]'
37 where addr is the address in memory you want to break in.
38 Access is the memory access type (read, write, execute) it can
39 be passed as follows: '\mem:addr[:[r][w][x]]'.
40 If you want to profile read-write accesses in 0x1000, just set
41 'mem:0x1000:rw'.
34-a:: 42-a::
35 System-wide collection. 43 System-wide collection.
36 44
diff --git a/tools/perf/Documentation/perf-report.txt b/tools/perf/Documentation/perf-report.txt
index 59f0b846cd71..9dccb180b7af 100644
--- a/tools/perf/Documentation/perf-report.txt
+++ b/tools/perf/Documentation/perf-report.txt
@@ -24,11 +24,11 @@ OPTIONS
24--dsos=:: 24--dsos=::
25 Only consider symbols in these dsos. CSV that understands 25 Only consider symbols in these dsos. CSV that understands
26 file://filename entries. 26 file://filename entries.
27-n 27-n::
28--show-nr-samples 28--show-nr-samples::
29 Show the number of samples for each symbol 29 Show the number of samples for each symbol
30-T 30-T::
31--threads 31--threads::
32 Show per-thread event counters 32 Show per-thread event counters
33-C:: 33-C::
34--comms=:: 34--comms=::
diff --git a/tools/perf/Documentation/perf-timechart.txt b/tools/perf/Documentation/perf-timechart.txt
index a7910099d6fd..4b1788355eca 100644
--- a/tools/perf/Documentation/perf-timechart.txt
+++ b/tools/perf/Documentation/perf-timechart.txt
@@ -31,9 +31,12 @@ OPTIONS
31-w:: 31-w::
32--width=:: 32--width=::
33 Select the width of the SVG file (default: 1000) 33 Select the width of the SVG file (default: 1000)
34-p:: 34-P::
35--power-only:: 35--power-only::
36 Only output the CPU power section of the diagram 36 Only output the CPU power section of the diagram
37-p::
38--process::
39 Select the processes to display, by name or PID
37 40
38 41
39SEE ALSO 42SEE ALSO
diff --git a/tools/perf/Documentation/perf-trace-perl.txt b/tools/perf/Documentation/perf-trace-perl.txt
new file mode 100644
index 000000000000..c5f55f439091
--- /dev/null
+++ b/tools/perf/Documentation/perf-trace-perl.txt
@@ -0,0 +1,219 @@
1perf-trace-perl(1)
2==================
3
4NAME
5----
6perf-trace-perl - Process trace data with a Perl script
7
8SYNOPSIS
9--------
10[verse]
11'perf trace' [-s [lang]:script[.ext] ]
12
13DESCRIPTION
14-----------
15
16This perf trace option is used to process perf trace data using perf's
17built-in Perl interpreter. It reads and processes the input file and
18displays the results of the trace analysis implemented in the given
19Perl script, if any.
20
21STARTER SCRIPTS
22---------------
23
24You can avoid reading the rest of this document by running 'perf trace
25-g perl' in the same directory as an existing perf.data trace file.
26That will generate a starter script containing a handler for each of
27the event types in the trace file; it simply prints every available
28field for each event in the trace file.
29
30You can also look at the existing scripts in
31~/libexec/perf-core/scripts/perl for typical examples showing how to
32do basic things like aggregate event data, print results, etc. Also,
33the check-perf-trace.pl script, while not interesting for its results,
34attempts to exercise all of the main scripting features.
35
36EVENT HANDLERS
37--------------
38
39When perf trace is invoked using a trace script, a user-defined
40'handler function' is called for each event in the trace. If there's
41no handler function defined for a given event type, the event is
42ignored (or passed to a 'trace_handled' function, see below) and the
43next event is processed.
44
45Most of the event's field values are passed as arguments to the
46handler function; some of the less common ones aren't - those are
47available as calls back into the perf executable (see below).
48
49As an example, the following perf record command can be used to record
50all sched_wakeup events in the system:
51
52 # perf record -c 1 -f -a -M -R -e sched:sched_wakeup
53
54Traces meant to be processed using a script should be recorded with
55the above options: -c 1 says to sample every event, -a to enable
56system-wide collection, -M to multiplex the output, and -R to collect
57raw samples.
58
59The format file for the sched_wakep event defines the following fields
60(see /sys/kernel/debug/tracing/events/sched/sched_wakeup/format):
61
62----
63 format:
64 field:unsigned short common_type;
65 field:unsigned char common_flags;
66 field:unsigned char common_preempt_count;
67 field:int common_pid;
68 field:int common_lock_depth;
69
70 field:char comm[TASK_COMM_LEN];
71 field:pid_t pid;
72 field:int prio;
73 field:int success;
74 field:int target_cpu;
75----
76
77The handler function for this event would be defined as:
78
79----
80sub sched::sched_wakeup
81{
82 my ($event_name, $context, $common_cpu, $common_secs,
83 $common_nsecs, $common_pid, $common_comm,
84 $comm, $pid, $prio, $success, $target_cpu) = @_;
85}
86----
87
88The handler function takes the form subsystem::event_name.
89
90The $common_* arguments in the handler's argument list are the set of
91arguments passed to all event handlers; some of the fields correspond
92to the common_* fields in the format file, but some are synthesized,
93and some of the common_* fields aren't common enough to to be passed
94to every event as arguments but are available as library functions.
95
96Here's a brief description of each of the invariant event args:
97
98 $event_name the name of the event as text
99 $context an opaque 'cookie' used in calls back into perf
100 $common_cpu the cpu the event occurred on
101 $common_secs the secs portion of the event timestamp
102 $common_nsecs the nsecs portion of the event timestamp
103 $common_pid the pid of the current task
104 $common_comm the name of the current process
105
106All of the remaining fields in the event's format file have
107counterparts as handler function arguments of the same name, as can be
108seen in the example above.
109
110The above provides the basics needed to directly access every field of
111every event in a trace, which covers 90% of what you need to know to
112write a useful trace script. The sections below cover the rest.
113
114SCRIPT LAYOUT
115-------------
116
117Every perf trace Perl script should start by setting up a Perl module
118search path and 'use'ing a few support modules (see module
119descriptions below):
120
121----
122 use lib "$ENV{'PERF_EXEC_PATH'}/scripts/perl/Perf-Trace-Util/lib";
123 use lib "./Perf-Trace-Util/lib";
124 use Perf::Trace::Core;
125 use Perf::Trace::Context;
126 use Perf::Trace::Util;
127----
128
129The rest of the script can contain handler functions and support
130functions in any order.
131
132Aside from the event handler functions discussed above, every script
133can implement a set of optional functions:
134
135*trace_begin*, if defined, is called before any event is processed and
136gives scripts a chance to do setup tasks:
137
138----
139 sub trace_begin
140 {
141 }
142----
143
144*trace_end*, if defined, is called after all events have been
145 processed and gives scripts a chance to do end-of-script tasks, such
146 as display results:
147
148----
149sub trace_end
150{
151}
152----
153
154*trace_unhandled*, if defined, is called after for any event that
155 doesn't have a handler explicitly defined for it. The standard set
156 of common arguments are passed into it:
157
158----
159sub trace_unhandled
160{
161 my ($event_name, $context, $common_cpu, $common_secs,
162 $common_nsecs, $common_pid, $common_comm) = @_;
163}
164----
165
166The remaining sections provide descriptions of each of the available
167built-in perf trace Perl modules and their associated functions.
168
169AVAILABLE MODULES AND FUNCTIONS
170-------------------------------
171
172The following sections describe the functions and variables available
173via the various Perf::Trace::* Perl modules. To use the functions and
174variables from the given module, add the corresponding 'use
175Perf::Trace::XXX' line to your perf trace script.
176
177Perf::Trace::Core Module
178~~~~~~~~~~~~~~~~~~~~~~~~
179
180These functions provide some essential functions to user scripts.
181
182The *flag_str* and *symbol_str* functions provide human-readable
183strings for flag and symbolic fields. These correspond to the strings
184and values parsed from the 'print fmt' fields of the event format
185files:
186
187 flag_str($event_name, $field_name, $field_value) - returns the string represention corresponding to $field_value for the flag field $field_name of event $event_name
188 symbol_str($event_name, $field_name, $field_value) - returns the string represention corresponding to $field_value for the symbolic field $field_name of event $event_name
189
190Perf::Trace::Context Module
191~~~~~~~~~~~~~~~~~~~~~~~~~~~
192
193Some of the 'common' fields in the event format file aren't all that
194common, but need to be made accessible to user scripts nonetheless.
195
196Perf::Trace::Context defines a set of functions that can be used to
197access this data in the context of the current event. Each of these
198functions expects a $context variable, which is the same as the
199$context variable passed into every event handler as the second
200argument.
201
202 common_pc($context) - returns common_preempt count for the current event
203 common_flags($context) - returns common_flags for the current event
204 common_lock_depth($context) - returns common_lock_depth for the current event
205
206Perf::Trace::Util Module
207~~~~~~~~~~~~~~~~~~~~~~~~
208
209Various utility functions for use with perf trace:
210
211 nsecs($secs, $nsecs) - returns total nsecs given secs/nsecs pair
212 nsecs_secs($nsecs) - returns whole secs portion given nsecs
213 nsecs_nsecs($nsecs) - returns nsecs remainder given nsecs
214 nsecs_str($nsecs) - returns printable string in the form secs.nsecs
215 avg($total, $n) - returns average given a sum and a total number of values
216
217SEE ALSO
218--------
219linkperf:perf-trace[1]
diff --git a/tools/perf/Documentation/perf-trace.txt b/tools/perf/Documentation/perf-trace.txt
index 41ed75398ca9..07065efa60e0 100644
--- a/tools/perf/Documentation/perf-trace.txt
+++ b/tools/perf/Documentation/perf-trace.txt
@@ -20,6 +20,15 @@ OPTIONS
20--dump-raw-trace=:: 20--dump-raw-trace=::
21 Display verbose dump of the trace data. 21 Display verbose dump of the trace data.
22 22
23-s::
24--script=::
25 Process trace data with the given script ([lang]:script[.ext]).
26
27-g::
28--gen-script=::
29 Generate perf-trace.[ext] starter script for given language,
30 using current perf.data.
31
23SEE ALSO 32SEE ALSO
24-------- 33--------
25linkperf:perf-record[1] 34linkperf:perf-record[1], linkperf:perf-trace-perl[1]
diff --git a/tools/perf/Makefile b/tools/perf/Makefile
index 7e190d522cd5..23ec66098bdc 100644
--- a/tools/perf/Makefile
+++ b/tools/perf/Makefile
@@ -2,6 +2,7 @@
2all:: 2all::
3 3
4# Define V=1 to have a more verbose compile. 4# Define V=1 to have a more verbose compile.
5# Define V=2 to have an even more verbose compile.
5# 6#
6# Define SNPRINTF_RETURNS_BOGUS if your are on a system which snprintf() 7# Define SNPRINTF_RETURNS_BOGUS if your are on a system which snprintf()
7# or vsnprintf() return -1 instead of number of characters which would 8# or vsnprintf() return -1 instead of number of characters which would
@@ -145,6 +146,10 @@ all::
145# Define NO_EXTERNAL_GREP if you don't want "perf grep" to ever call 146# Define NO_EXTERNAL_GREP if you don't want "perf grep" to ever call
146# your external grep (e.g., if your system lacks grep, if its grep is 147# your external grep (e.g., if your system lacks grep, if its grep is
147# broken, or spawning external process is slower than built-in grep perf has). 148# broken, or spawning external process is slower than built-in grep perf has).
149#
150# Define LDFLAGS=-static to build a static binary.
151#
152# Define EXTRA_CFLAGS=-m64 or EXTRA_CFLAGS=-m32 as appropriate for cross-builds.
148 153
149PERF-VERSION-FILE: .FORCE-PERF-VERSION-FILE 154PERF-VERSION-FILE: .FORCE-PERF-VERSION-FILE
150 @$(SHELL_PATH) util/PERF-VERSION-GEN 155 @$(SHELL_PATH) util/PERF-VERSION-GEN
@@ -157,20 +162,6 @@ uname_R := $(shell sh -c 'uname -r 2>/dev/null || echo not')
157uname_P := $(shell sh -c 'uname -p 2>/dev/null || echo not') 162uname_P := $(shell sh -c 'uname -p 2>/dev/null || echo not')
158uname_V := $(shell sh -c 'uname -v 2>/dev/null || echo not') 163uname_V := $(shell sh -c 'uname -v 2>/dev/null || echo not')
159 164
160#
161# Add -m32 for cross-builds:
162#
163ifdef NO_64BIT
164 MBITS := -m32
165else
166 #
167 # If we're on a 64-bit kernel, use -m64:
168 #
169 ifneq ($(patsubst %64,%,$(uname_M)),$(uname_M))
170 MBITS := -m64
171 endif
172endif
173
174# CFLAGS and LDFLAGS are for the users to override from the command line. 165# CFLAGS and LDFLAGS are for the users to override from the command line.
175 166
176# 167#
@@ -200,8 +191,15 @@ EXTRA_WARNINGS := $(EXTRA_WARNINGS) -Wold-style-definition
200EXTRA_WARNINGS := $(EXTRA_WARNINGS) -Wstrict-prototypes 191EXTRA_WARNINGS := $(EXTRA_WARNINGS) -Wstrict-prototypes
201EXTRA_WARNINGS := $(EXTRA_WARNINGS) -Wdeclaration-after-statement 192EXTRA_WARNINGS := $(EXTRA_WARNINGS) -Wdeclaration-after-statement
202 193
203CFLAGS = $(MBITS) -ggdb3 -Wall -Wextra -std=gnu99 -Werror -O6 -fstack-protector-all -D_FORTIFY_SOURCE=2 $(EXTRA_WARNINGS) 194ifeq ("$(origin DEBUG)", "command line")
204LDFLAGS = -lpthread -lrt -lelf -lm 195 PERF_DEBUG = $(DEBUG)
196endif
197ifndef PERF_DEBUG
198 CFLAGS_OPTIMIZE = -O6
199endif
200
201CFLAGS = -ggdb3 -Wall -Wextra -std=gnu99 -Werror $(CFLAGS_OPTIMIZE) -D_FORTIFY_SOURCE=2 $(EXTRA_WARNINGS) $(EXTRA_CFLAGS)
202EXTLIBS = -lpthread -lrt -lelf -lm
205ALL_CFLAGS = $(CFLAGS) 203ALL_CFLAGS = $(CFLAGS)
206ALL_LDFLAGS = $(LDFLAGS) 204ALL_LDFLAGS = $(LDFLAGS)
207STRIP ?= strip 205STRIP ?= strip
@@ -252,6 +250,9 @@ PTHREAD_LIBS = -lpthread
252# explicitly what architecture to check for. Fix this up for yours.. 250# explicitly what architecture to check for. Fix this up for yours..
253SPARSE_FLAGS = -D__BIG_ENDIAN__ -D__powerpc__ 251SPARSE_FLAGS = -D__BIG_ENDIAN__ -D__powerpc__
254 252
253ifeq ($(shell sh -c "echo 'int foo(void) {char X[2]; return 3;}' | $(CC) -x c -c -Werror -fstack-protector-all - -o /dev/null "$(QUIET_STDERR)" && echo y"), y)
254 CFLAGS := $(CFLAGS) -fstack-protector-all
255endif
255 256
256 257
257### --- END CONFIGURATION SECTION --- 258### --- END CONFIGURATION SECTION ---
@@ -327,8 +328,28 @@ LIB_FILE=libperf.a
327LIB_H += ../../include/linux/perf_event.h 328LIB_H += ../../include/linux/perf_event.h
328LIB_H += ../../include/linux/rbtree.h 329LIB_H += ../../include/linux/rbtree.h
329LIB_H += ../../include/linux/list.h 330LIB_H += ../../include/linux/list.h
331LIB_H += ../../include/linux/stringify.h
332LIB_H += util/include/linux/bitmap.h
333LIB_H += util/include/linux/bitops.h
334LIB_H += util/include/linux/compiler.h
335LIB_H += util/include/linux/ctype.h
336LIB_H += util/include/linux/kernel.h
330LIB_H += util/include/linux/list.h 337LIB_H += util/include/linux/list.h
338LIB_H += util/include/linux/module.h
339LIB_H += util/include/linux/poison.h
340LIB_H += util/include/linux/prefetch.h
341LIB_H += util/include/linux/rbtree.h
342LIB_H += util/include/linux/string.h
343LIB_H += util/include/linux/types.h
344LIB_H += util/include/asm/asm-offsets.h
345LIB_H += util/include/asm/bitops.h
346LIB_H += util/include/asm/byteorder.h
347LIB_H += util/include/asm/swab.h
348LIB_H += util/include/asm/system.h
349LIB_H += util/include/asm/uaccess.h
331LIB_H += perf.h 350LIB_H += perf.h
351LIB_H += util/debugfs.h
352LIB_H += util/event.h
332LIB_H += util/types.h 353LIB_H += util/types.h
333LIB_H += util/levenshtein.h 354LIB_H += util/levenshtein.h
334LIB_H += util/parse-options.h 355LIB_H += util/parse-options.h
@@ -342,15 +363,22 @@ LIB_H += util/strlist.h
342LIB_H += util/run-command.h 363LIB_H += util/run-command.h
343LIB_H += util/sigchain.h 364LIB_H += util/sigchain.h
344LIB_H += util/symbol.h 365LIB_H += util/symbol.h
345LIB_H += util/module.h
346LIB_H += util/color.h 366LIB_H += util/color.h
347LIB_H += util/values.h 367LIB_H += util/values.h
368LIB_H += util/sort.h
369LIB_H += util/hist.h
370LIB_H += util/thread.h
371LIB_H += util/data_map.h
372LIB_H += util/probe-finder.h
373LIB_H += util/probe-event.h
348 374
349LIB_OBJS += util/abspath.o 375LIB_OBJS += util/abspath.o
350LIB_OBJS += util/alias.o 376LIB_OBJS += util/alias.o
351LIB_OBJS += util/config.o 377LIB_OBJS += util/config.o
352LIB_OBJS += util/ctype.o 378LIB_OBJS += util/ctype.o
379LIB_OBJS += util/debugfs.o
353LIB_OBJS += util/environment.o 380LIB_OBJS += util/environment.o
381LIB_OBJS += util/event.o
354LIB_OBJS += util/exec_cmd.o 382LIB_OBJS += util/exec_cmd.o
355LIB_OBJS += util/help.o 383LIB_OBJS += util/help.o
356LIB_OBJS += util/levenshtein.o 384LIB_OBJS += util/levenshtein.o
@@ -358,6 +386,9 @@ LIB_OBJS += util/parse-options.o
358LIB_OBJS += util/parse-events.o 386LIB_OBJS += util/parse-events.o
359LIB_OBJS += util/path.o 387LIB_OBJS += util/path.o
360LIB_OBJS += util/rbtree.o 388LIB_OBJS += util/rbtree.o
389LIB_OBJS += util/bitmap.o
390LIB_OBJS += util/hweight.o
391LIB_OBJS += util/find_next_bit.o
361LIB_OBJS += util/run-command.o 392LIB_OBJS += util/run-command.o
362LIB_OBJS += util/quote.o 393LIB_OBJS += util/quote.o
363LIB_OBJS += util/strbuf.o 394LIB_OBJS += util/strbuf.o
@@ -367,7 +398,6 @@ LIB_OBJS += util/usage.o
367LIB_OBJS += util/wrapper.o 398LIB_OBJS += util/wrapper.o
368LIB_OBJS += util/sigchain.o 399LIB_OBJS += util/sigchain.o
369LIB_OBJS += util/symbol.o 400LIB_OBJS += util/symbol.o
370LIB_OBJS += util/module.o
371LIB_OBJS += util/color.o 401LIB_OBJS += util/color.o
372LIB_OBJS += util/pager.o 402LIB_OBJS += util/pager.o
373LIB_OBJS += util/header.o 403LIB_OBJS += util/header.o
@@ -379,11 +409,25 @@ LIB_OBJS += util/thread.o
379LIB_OBJS += util/trace-event-parse.o 409LIB_OBJS += util/trace-event-parse.o
380LIB_OBJS += util/trace-event-read.o 410LIB_OBJS += util/trace-event-read.o
381LIB_OBJS += util/trace-event-info.o 411LIB_OBJS += util/trace-event-info.o
412LIB_OBJS += util/trace-event-perl.o
382LIB_OBJS += util/svghelper.o 413LIB_OBJS += util/svghelper.o
414LIB_OBJS += util/sort.o
415LIB_OBJS += util/hist.o
416LIB_OBJS += util/data_map.o
417LIB_OBJS += util/probe-event.o
383 418
384BUILTIN_OBJS += builtin-annotate.o 419BUILTIN_OBJS += builtin-annotate.o
420
421BUILTIN_OBJS += builtin-bench.o
422
423# Benchmark modules
424BUILTIN_OBJS += bench/sched-messaging.o
425BUILTIN_OBJS += bench/sched-pipe.o
426BUILTIN_OBJS += bench/mem-memcpy.o
427
385BUILTIN_OBJS += builtin-help.o 428BUILTIN_OBJS += builtin-help.o
386BUILTIN_OBJS += builtin-sched.o 429BUILTIN_OBJS += builtin-sched.o
430BUILTIN_OBJS += builtin-buildid-list.o
387BUILTIN_OBJS += builtin-list.o 431BUILTIN_OBJS += builtin-list.o
388BUILTIN_OBJS += builtin-record.o 432BUILTIN_OBJS += builtin-record.o
389BUILTIN_OBJS += builtin-report.o 433BUILTIN_OBJS += builtin-report.o
@@ -391,9 +435,16 @@ BUILTIN_OBJS += builtin-stat.o
391BUILTIN_OBJS += builtin-timechart.o 435BUILTIN_OBJS += builtin-timechart.o
392BUILTIN_OBJS += builtin-top.o 436BUILTIN_OBJS += builtin-top.o
393BUILTIN_OBJS += builtin-trace.o 437BUILTIN_OBJS += builtin-trace.o
438BUILTIN_OBJS += builtin-probe.o
439BUILTIN_OBJS += builtin-kmem.o
394 440
395PERFLIBS = $(LIB_FILE) 441PERFLIBS = $(LIB_FILE)
396 442
443ifeq ($(V), 2)
444 QUIET_STDERR = ">/dev/null"
445else
446 QUIET_STDERR = ">/dev/null 2>&1"
447endif
397# 448#
398# Platform specific tweaks 449# Platform specific tweaks
399# 450#
@@ -421,36 +472,58 @@ ifeq ($(uname_S),Darwin)
421 PTHREAD_LIBS = 472 PTHREAD_LIBS =
422endif 473endif
423 474
424ifeq ($(shell sh -c "(echo '\#include <libelf.h>'; echo 'int main(void) { Elf * elf = elf_begin(0, ELF_C_READ, 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) 475ifeq ($(shell sh -c "(echo '\#include <libelf.h>'; echo 'int main(void) { Elf * elf = elf_begin(0, ELF_C_READ, 0); return (long)elf; }') | $(CC) -x c - $(ALL_CFLAGS) -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -o /dev/null $(ALL_LDFLAGS) $(EXTLIBS) "$(QUIET_STDERR)" && echo y"), y)
425 ifneq ($(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) 476ifneq ($(shell sh -c "(echo '\#include <gnu/libc-version.h>'; echo 'int main(void) { const char * version = gnu_get_libc_version(); return (long)version; }') | $(CC) -x c - $(ALL_CFLAGS) -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -o /dev/null $(ALL_LDFLAGS) $(EXTLIBS) "$(QUIET_STDERR)" && echo y"), y)
477 msg := $(error No gnu/libc-version.h found, please install glibc-dev[el]/glibc-static);
478endif
479
480 ifneq ($(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) $(EXTLIBS) "$(QUIET_STDERR)" && echo y"), y)
426 BASIC_CFLAGS += -DLIBELF_NO_MMAP 481 BASIC_CFLAGS += -DLIBELF_NO_MMAP
427 endif 482 endif
428else 483else
429 msg := $(error No libelf.h/libelf found, please install libelf-dev/elfutils-libelf-devel and glibc-dev[el]); 484 msg := $(error No libelf.h/libelf found, please install libelf-dev/elfutils-libelf-devel and glibc-dev[el]);
430endif 485endif
431 486
487ifneq ($(shell sh -c "(echo '\#include <libdwarf/dwarf.h>'; echo '\#include <libdwarf/libdwarf.h>'; echo 'int main(void) { Dwarf_Debug dbg; Dwarf_Error err; Dwarf_Ranges *rng; dwarf_init(0, DW_DLC_READ, 0, 0, &dbg, &err); dwarf_get_ranges(dbg, 0, &rng, 0, 0, &err); return (long)dbg; }') | $(CC) -x c - $(ALL_CFLAGS) -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -ldwarf -lelf -o /dev/null $(ALL_LDFLAGS) $(EXTLIBS) "$(QUIET_STDERR)" && echo y"), y)
488 msg := $(warning No libdwarf.h found or old libdwarf.h found, disables dwarf support. Please install libdwarf-dev/libdwarf-devel >= 20081231);
489 BASIC_CFLAGS += -DNO_LIBDWARF
490else
491 EXTLIBS += -lelf -ldwarf
492 LIB_OBJS += util/probe-finder.o
493endif
494
495PERL_EMBED_LDOPTS = `perl -MExtUtils::Embed -e ldopts 2>/dev/null`
496PERL_EMBED_CCOPTS = `perl -MExtUtils::Embed -e ccopts 2>/dev/null`
497
498ifneq ($(shell sh -c "(echo '\#include <EXTERN.h>'; echo '\#include <perl.h>'; echo 'int main(void) { perl_alloc(); return 0; }') | $(CC) -x c - $(PERL_EMBED_CCOPTS) -o /dev/null $(PERL_EMBED_LDOPTS) > /dev/null 2>&1 && echo y"), y)
499 BASIC_CFLAGS += -DNO_LIBPERL
500else
501 ALL_LDFLAGS += $(PERL_EMBED_LDOPTS)
502 LIB_OBJS += scripts/perl/Perf-Trace-Util/Context.o
503endif
504
432ifdef NO_DEMANGLE 505ifdef NO_DEMANGLE
433 BASIC_CFLAGS += -DNO_DEMANGLE 506 BASIC_CFLAGS += -DNO_DEMANGLE
434else 507else
435 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") 508 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) $(EXTLIBS) -lbfd "$(QUIET_STDERR)" && echo y")
436 509
437 ifeq ($(has_bfd),y) 510 ifeq ($(has_bfd),y)
438 EXTLIBS += -lbfd 511 EXTLIBS += -lbfd
439 else 512 else
440 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") 513 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) $(EXTLIBS) -lbfd -liberty "$(QUIET_STDERR)" && echo y")
441 ifeq ($(has_bfd_iberty),y) 514 ifeq ($(has_bfd_iberty),y)
442 EXTLIBS += -lbfd -liberty 515 EXTLIBS += -lbfd -liberty
443 else 516 else
444 has_bfd_iberty_z := $(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 -lz > /dev/null 2>&1 && echo y") 517 has_bfd_iberty_z := $(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) $(EXTLIBS) -lbfd -liberty -lz "$(QUIET_STDERR)" && echo y")
445 ifeq ($(has_bfd_iberty_z),y) 518 ifeq ($(has_bfd_iberty_z),y)
446 EXTLIBS += -lbfd -liberty -lz 519 EXTLIBS += -lbfd -liberty -lz
447 else 520 else
448 has_cplus_demangle := $(shell sh -c "(echo 'extern char *cplus_demangle(const char *, int);'; echo 'int main(void) { cplus_demangle(0, 0); return 0; }') | $(CC) -x c - $(ALL_CFLAGS) -o /dev/null $(ALL_LDFLAGS) -liberty > /dev/null 2>&1 && echo y") 521 has_cplus_demangle := $(shell sh -c "(echo 'extern char *cplus_demangle(const char *, int);'; echo 'int main(void) { cplus_demangle(0, 0); return 0; }') | $(CC) -x c - $(ALL_CFLAGS) -o /dev/null $(ALL_LDFLAGS) $(EXTLIBS) -liberty "$(QUIET_STDERR)" && echo y")
449 ifeq ($(has_cplus_demangle),y) 522 ifeq ($(has_cplus_demangle),y)
450 EXTLIBS += -liberty 523 EXTLIBS += -liberty
451 BASIC_CFLAGS += -DHAVE_CPLUS_DEMANGLE 524 BASIC_CFLAGS += -DHAVE_CPLUS_DEMANGLE
452 else 525 else
453 msg := $(warning No bfd.h/libbfd found, install binutils-dev[el] to gain symbol demangling) 526 msg := $(warning No bfd.h/libbfd found, install binutils-dev[el]/zlib-static to gain symbol demangling)
454 BASIC_CFLAGS += -DNO_DEMANGLE 527 BASIC_CFLAGS += -DNO_DEMANGLE
455 endif 528 endif
456 endif 529 endif
@@ -787,6 +860,25 @@ util/config.o: util/config.c PERF-CFLAGS
787util/rbtree.o: ../../lib/rbtree.c PERF-CFLAGS 860util/rbtree.o: ../../lib/rbtree.c PERF-CFLAGS
788 $(QUIET_CC)$(CC) -o util/rbtree.o -c $(ALL_CFLAGS) -DETC_PERFCONFIG='"$(ETC_PERFCONFIG_SQ)"' $< 861 $(QUIET_CC)$(CC) -o util/rbtree.o -c $(ALL_CFLAGS) -DETC_PERFCONFIG='"$(ETC_PERFCONFIG_SQ)"' $<
789 862
863# some perf warning policies can't fit to lib/bitmap.c, eg: it warns about variable shadowing
864# from <string.h> that comes from kernel headers wrapping.
865KBITMAP_FLAGS=`echo $(ALL_CFLAGS) | sed s/-Wshadow// | sed s/-Wswitch-default// | sed s/-Wextra//`
866
867util/bitmap.o: ../../lib/bitmap.c PERF-CFLAGS
868 $(QUIET_CC)$(CC) -o util/bitmap.o -c $(KBITMAP_FLAGS) -DETC_PERFCONFIG='"$(ETC_PERFCONFIG_SQ)"' $<
869
870util/hweight.o: ../../lib/hweight.c PERF-CFLAGS
871 $(QUIET_CC)$(CC) -o util/hweight.o -c $(ALL_CFLAGS) -DETC_PERFCONFIG='"$(ETC_PERFCONFIG_SQ)"' $<
872
873util/find_next_bit.o: ../../lib/find_next_bit.c PERF-CFLAGS
874 $(QUIET_CC)$(CC) -o util/find_next_bit.o -c $(ALL_CFLAGS) -DETC_PERFCONFIG='"$(ETC_PERFCONFIG_SQ)"' $<
875
876util/trace-event-perl.o: util/trace-event-perl.c PERF-CFLAGS
877 $(QUIET_CC)$(CC) -o util/trace-event-perl.o -c $(ALL_CFLAGS) $(PERL_EMBED_CCOPTS) -Wno-redundant-decls -Wno-strict-prototypes -Wno-unused-parameter -Wno-shadow $<
878
879scripts/perl/Perf-Trace-Util/Context.o: scripts/perl/Perf-Trace-Util/Context.c PERF-CFLAGS
880 $(QUIET_CC)$(CC) -o scripts/perl/Perf-Trace-Util/Context.o -c $(ALL_CFLAGS) $(PERL_EMBED_CCOPTS) -Wno-redundant-decls -Wno-strict-prototypes -Wno-unused-parameter -Wno-nested-externs $<
881
790perf-%$X: %.o $(PERFLIBS) 882perf-%$X: %.o $(PERFLIBS)
791 $(QUIET_LINK)$(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) $(filter %.o,$^) $(LIBS) 883 $(QUIET_LINK)$(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) $(filter %.o,$^) $(LIBS)
792 884
@@ -894,6 +986,13 @@ export perfexec_instdir
894install: all 986install: all
895 $(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(bindir_SQ)' 987 $(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(bindir_SQ)'
896 $(INSTALL) perf$X '$(DESTDIR_SQ)$(bindir_SQ)' 988 $(INSTALL) perf$X '$(DESTDIR_SQ)$(bindir_SQ)'
989 $(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(perfexec_instdir_SQ)/scripts/perl/Perf-Trace-Util/lib/Perf/Trace'
990 $(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(perfexec_instdir_SQ)/scripts/perl/bin'
991 $(INSTALL) scripts/perl/Perf-Trace-Util/lib/Perf/Trace/* -t '$(DESTDIR_SQ)$(perfexec_instdir_SQ)/scripts/perl/Perf-Trace-Util/lib/Perf/Trace'
992 $(INSTALL) scripts/perl/*.pl -t '$(DESTDIR_SQ)$(perfexec_instdir_SQ)/scripts/perl'
993 $(INSTALL) scripts/perl/bin/* -t '$(DESTDIR_SQ)$(perfexec_instdir_SQ)/scripts/perl/bin'
994 $(INSTALL) scripts/perl/Perf-Trace-Util/Makefile.PL -t '$(DESTDIR_SQ)$(perfexec_instdir_SQ)/scripts/perl/Perf-Trace-Util'
995 $(INSTALL) scripts/perl/Perf-Trace-Util/README -t '$(DESTDIR_SQ)$(perfexec_instdir_SQ)/scripts/perl/Perf-Trace-Util'
897ifdef BUILT_INS 996ifdef BUILT_INS
898 $(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(perfexec_instdir_SQ)' 997 $(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(perfexec_instdir_SQ)'
899 $(INSTALL) $(BUILT_INS) '$(DESTDIR_SQ)$(perfexec_instdir_SQ)' 998 $(INSTALL) $(BUILT_INS) '$(DESTDIR_SQ)$(perfexec_instdir_SQ)'
@@ -979,7 +1078,7 @@ distclean: clean
979# $(RM) configure 1078# $(RM) configure
980 1079
981clean: 1080clean:
982 $(RM) *.o */*.o $(LIB_FILE) 1081 $(RM) *.o */*.o */*/*.o */*/*/*.o $(LIB_FILE)
983 $(RM) $(ALL_PROGRAMS) $(BUILT_INS) perf$X 1082 $(RM) $(ALL_PROGRAMS) $(BUILT_INS) perf$X
984 $(RM) $(TEST_PROGRAMS) 1083 $(RM) $(TEST_PROGRAMS)
985 $(RM) *.spec *.pyc *.pyo */*.pyc */*.pyo common-cmds.h TAGS tags cscope* 1084 $(RM) *.spec *.pyc *.pyo */*.pyc */*.pyo common-cmds.h TAGS tags cscope*
diff --git a/tools/perf/bench/bench.h b/tools/perf/bench/bench.h
new file mode 100644
index 000000000000..f7781c6267c0
--- /dev/null
+++ b/tools/perf/bench/bench.h
@@ -0,0 +1,17 @@
1#ifndef BENCH_H
2#define BENCH_H
3
4extern int bench_sched_messaging(int argc, const char **argv, const char *prefix);
5extern int bench_sched_pipe(int argc, const char **argv, const char *prefix);
6extern int bench_mem_memcpy(int argc, const char **argv, const char *prefix __used);
7
8#define BENCH_FORMAT_DEFAULT_STR "default"
9#define BENCH_FORMAT_DEFAULT 0
10#define BENCH_FORMAT_SIMPLE_STR "simple"
11#define BENCH_FORMAT_SIMPLE 1
12
13#define BENCH_FORMAT_UNKNOWN -1
14
15extern int bench_format;
16
17#endif
diff --git a/tools/perf/bench/mem-memcpy.c b/tools/perf/bench/mem-memcpy.c
new file mode 100644
index 000000000000..89773178e894
--- /dev/null
+++ b/tools/perf/bench/mem-memcpy.c
@@ -0,0 +1,193 @@
1/*
2 * mem-memcpy.c
3 *
4 * memcpy: Simple memory copy in various ways
5 *
6 * Written by Hitoshi Mitake <mitake@dcl.info.waseda.ac.jp>
7 */
8#include <ctype.h>
9
10#include "../perf.h"
11#include "../util/util.h"
12#include "../util/parse-options.h"
13#include "../util/string.h"
14#include "../util/header.h"
15#include "bench.h"
16
17#include <stdio.h>
18#include <stdlib.h>
19#include <string.h>
20#include <sys/time.h>
21#include <errno.h>
22
23#define K 1024
24
25static const char *length_str = "1MB";
26static const char *routine = "default";
27static int use_clock = 0;
28static int clock_fd;
29
30static const struct option options[] = {
31 OPT_STRING('l', "length", &length_str, "1MB",
32 "Specify length of memory to copy. "
33 "available unit: B, MB, GB (upper and lower)"),
34 OPT_STRING('r', "routine", &routine, "default",
35 "Specify routine to copy"),
36 OPT_BOOLEAN('c', "clock", &use_clock,
37 "Use CPU clock for measuring"),
38 OPT_END()
39};
40
41struct routine {
42 const char *name;
43 const char *desc;
44 void * (*fn)(void *dst, const void *src, size_t len);
45};
46
47struct routine routines[] = {
48 { "default",
49 "Default memcpy() provided by glibc",
50 memcpy },
51 { NULL,
52 NULL,
53 NULL }
54};
55
56static const char * const bench_mem_memcpy_usage[] = {
57 "perf bench mem memcpy <options>",
58 NULL
59};
60
61static struct perf_event_attr clock_attr = {
62 .type = PERF_TYPE_HARDWARE,
63 .config = PERF_COUNT_HW_CPU_CYCLES
64};
65
66static void init_clock(void)
67{
68 clock_fd = sys_perf_event_open(&clock_attr, getpid(), -1, -1, 0);
69
70 if (clock_fd < 0 && errno == ENOSYS)
71 die("No CONFIG_PERF_EVENTS=y kernel support configured?\n");
72 else
73 BUG_ON(clock_fd < 0);
74}
75
76static u64 get_clock(void)
77{
78 int ret;
79 u64 clk;
80
81 ret = read(clock_fd, &clk, sizeof(u64));
82 BUG_ON(ret != sizeof(u64));
83
84 return clk;
85}
86
87static double timeval2double(struct timeval *ts)
88{
89 return (double)ts->tv_sec +
90 (double)ts->tv_usec / (double)1000000;
91}
92
93int bench_mem_memcpy(int argc, const char **argv,
94 const char *prefix __used)
95{
96 int i;
97 void *dst, *src;
98 size_t length;
99 double bps = 0.0;
100 struct timeval tv_start, tv_end, tv_diff;
101 u64 clock_start, clock_end, clock_diff;
102
103 clock_start = clock_end = clock_diff = 0ULL;
104 argc = parse_options(argc, argv, options,
105 bench_mem_memcpy_usage, 0);
106
107 tv_diff.tv_sec = 0;
108 tv_diff.tv_usec = 0;
109 length = (size_t)perf_atoll((char *)length_str);
110
111 if ((s64)length <= 0) {
112 fprintf(stderr, "Invalid length:%s\n", length_str);
113 return 1;
114 }
115
116 for (i = 0; routines[i].name; i++) {
117 if (!strcmp(routines[i].name, routine))
118 break;
119 }
120 if (!routines[i].name) {
121 printf("Unknown routine:%s\n", routine);
122 printf("Available routines...\n");
123 for (i = 0; routines[i].name; i++) {
124 printf("\t%s ... %s\n",
125 routines[i].name, routines[i].desc);
126 }
127 return 1;
128 }
129
130 dst = zalloc(length);
131 if (!dst)
132 die("memory allocation failed - maybe length is too large?\n");
133
134 src = zalloc(length);
135 if (!src)
136 die("memory allocation failed - maybe length is too large?\n");
137
138 if (bench_format == BENCH_FORMAT_DEFAULT) {
139 printf("# Copying %s Bytes from %p to %p ...\n\n",
140 length_str, src, dst);
141 }
142
143 if (use_clock) {
144 init_clock();
145 clock_start = get_clock();
146 } else {
147 BUG_ON(gettimeofday(&tv_start, NULL));
148 }
149
150 routines[i].fn(dst, src, length);
151
152 if (use_clock) {
153 clock_end = get_clock();
154 clock_diff = clock_end - clock_start;
155 } else {
156 BUG_ON(gettimeofday(&tv_end, NULL));
157 timersub(&tv_end, &tv_start, &tv_diff);
158 bps = (double)((double)length / timeval2double(&tv_diff));
159 }
160
161 switch (bench_format) {
162 case BENCH_FORMAT_DEFAULT:
163 if (use_clock) {
164 printf(" %14lf Clock/Byte\n",
165 (double)clock_diff / (double)length);
166 } else {
167 if (bps < K)
168 printf(" %14lf B/Sec\n", bps);
169 else if (bps < K * K)
170 printf(" %14lfd KB/Sec\n", bps / 1024);
171 else if (bps < K * K * K)
172 printf(" %14lf MB/Sec\n", bps / 1024 / 1024);
173 else {
174 printf(" %14lf GB/Sec\n",
175 bps / 1024 / 1024 / 1024);
176 }
177 }
178 break;
179 case BENCH_FORMAT_SIMPLE:
180 if (use_clock) {
181 printf("%14lf\n",
182 (double)clock_diff / (double)length);
183 } else
184 printf("%lf\n", bps);
185 break;
186 default:
187 /* reaching this means there's some disaster: */
188 die("unknown format: %d\n", bench_format);
189 break;
190 }
191
192 return 0;
193}
diff --git a/tools/perf/bench/sched-messaging.c b/tools/perf/bench/sched-messaging.c
new file mode 100644
index 000000000000..605a2a959aa8
--- /dev/null
+++ b/tools/perf/bench/sched-messaging.c
@@ -0,0 +1,336 @@
1/*
2 *
3 * builtin-bench-messaging.c
4 *
5 * messaging: Benchmark for scheduler and IPC mechanisms
6 *
7 * Based on hackbench by Rusty Russell <rusty@rustcorp.com.au>
8 * Ported to perf by Hitoshi Mitake <mitake@dcl.info.waseda.ac.jp>
9 *
10 */
11
12#include "../perf.h"
13#include "../util/util.h"
14#include "../util/parse-options.h"
15#include "../builtin.h"
16#include "bench.h"
17
18/* Test groups of 20 processes spraying to 20 receivers */
19#include <pthread.h>
20#include <stdio.h>
21#include <stdlib.h>
22#include <string.h>
23#include <errno.h>
24#include <unistd.h>
25#include <sys/types.h>
26#include <sys/socket.h>
27#include <sys/wait.h>
28#include <sys/time.h>
29#include <sys/poll.h>
30#include <limits.h>
31
32#define DATASIZE 100
33
34static int use_pipes = 0;
35static unsigned int loops = 100;
36static unsigned int thread_mode = 0;
37static unsigned int num_groups = 10;
38
39struct sender_context {
40 unsigned int num_fds;
41 int ready_out;
42 int wakefd;
43 int out_fds[0];
44};
45
46struct receiver_context {
47 unsigned int num_packets;
48 int in_fds[2];
49 int ready_out;
50 int wakefd;
51};
52
53static void barf(const char *msg)
54{
55 fprintf(stderr, "%s (error: %s)\n", msg, strerror(errno));
56 exit(1);
57}
58
59static void fdpair(int fds[2])
60{
61 if (use_pipes) {
62 if (pipe(fds) == 0)
63 return;
64 } else {
65 if (socketpair(AF_UNIX, SOCK_STREAM, 0, fds) == 0)
66 return;
67 }
68
69 barf(use_pipes ? "pipe()" : "socketpair()");
70}
71
72/* Block until we're ready to go */
73static void ready(int ready_out, int wakefd)
74{
75 char dummy;
76 struct pollfd pollfd = { .fd = wakefd, .events = POLLIN };
77
78 /* Tell them we're ready. */
79 if (write(ready_out, &dummy, 1) != 1)
80 barf("CLIENT: ready write");
81
82 /* Wait for "GO" signal */
83 if (poll(&pollfd, 1, -1) != 1)
84 barf("poll");
85}
86
87/* Sender sprays loops messages down each file descriptor */
88static void *sender(struct sender_context *ctx)
89{
90 char data[DATASIZE];
91 unsigned int i, j;
92
93 ready(ctx->ready_out, ctx->wakefd);
94
95 /* Now pump to every receiver. */
96 for (i = 0; i < loops; i++) {
97 for (j = 0; j < ctx->num_fds; j++) {
98 int ret, done = 0;
99
100again:
101 ret = write(ctx->out_fds[j], data + done,
102 sizeof(data)-done);
103 if (ret < 0)
104 barf("SENDER: write");
105 done += ret;
106 if (done < DATASIZE)
107 goto again;
108 }
109 }
110
111 return NULL;
112}
113
114
115/* One receiver per fd */
116static void *receiver(struct receiver_context* ctx)
117{
118 unsigned int i;
119
120 if (!thread_mode)
121 close(ctx->in_fds[1]);
122
123 /* Wait for start... */
124 ready(ctx->ready_out, ctx->wakefd);
125
126 /* Receive them all */
127 for (i = 0; i < ctx->num_packets; i++) {
128 char data[DATASIZE];
129 int ret, done = 0;
130
131again:
132 ret = read(ctx->in_fds[0], data + done, DATASIZE - done);
133 if (ret < 0)
134 barf("SERVER: read");
135 done += ret;
136 if (done < DATASIZE)
137 goto again;
138 }
139
140 return NULL;
141}
142
143static pthread_t create_worker(void *ctx, void *(*func)(void *))
144{
145 pthread_attr_t attr;
146 pthread_t childid;
147 int err;
148
149 if (!thread_mode) {
150 /* process mode */
151 /* Fork the receiver. */
152 switch (fork()) {
153 case -1:
154 barf("fork()");
155 break;
156 case 0:
157 (*func) (ctx);
158 exit(0);
159 break;
160 default:
161 break;
162 }
163
164 return (pthread_t)0;
165 }
166
167 if (pthread_attr_init(&attr) != 0)
168 barf("pthread_attr_init:");
169
170#ifndef __ia64__
171 if (pthread_attr_setstacksize(&attr, PTHREAD_STACK_MIN) != 0)
172 barf("pthread_attr_setstacksize");
173#endif
174
175 err = pthread_create(&childid, &attr, func, ctx);
176 if (err != 0) {
177 fprintf(stderr, "pthread_create failed: %s (%d)\n",
178 strerror(err), err);
179 exit(-1);
180 }
181 return childid;
182}
183
184static void reap_worker(pthread_t id)
185{
186 int proc_status;
187 void *thread_status;
188
189 if (!thread_mode) {
190 /* process mode */
191 wait(&proc_status);
192 if (!WIFEXITED(proc_status))
193 exit(1);
194 } else {
195 pthread_join(id, &thread_status);
196 }
197}
198
199/* One group of senders and receivers */
200static unsigned int group(pthread_t *pth,
201 unsigned int num_fds,
202 int ready_out,
203 int wakefd)
204{
205 unsigned int i;
206 struct sender_context *snd_ctx = malloc(sizeof(struct sender_context)
207 + num_fds * sizeof(int));
208
209 if (!snd_ctx)
210 barf("malloc()");
211
212 for (i = 0; i < num_fds; i++) {
213 int fds[2];
214 struct receiver_context *ctx = malloc(sizeof(*ctx));
215
216 if (!ctx)
217 barf("malloc()");
218
219
220 /* Create the pipe between client and server */
221 fdpair(fds);
222
223 ctx->num_packets = num_fds * loops;
224 ctx->in_fds[0] = fds[0];
225 ctx->in_fds[1] = fds[1];
226 ctx->ready_out = ready_out;
227 ctx->wakefd = wakefd;
228
229 pth[i] = create_worker(ctx, (void *)receiver);
230
231 snd_ctx->out_fds[i] = fds[1];
232 if (!thread_mode)
233 close(fds[0]);
234 }
235
236 /* Now we have all the fds, fork the senders */
237 for (i = 0; i < num_fds; i++) {
238 snd_ctx->ready_out = ready_out;
239 snd_ctx->wakefd = wakefd;
240 snd_ctx->num_fds = num_fds;
241
242 pth[num_fds+i] = create_worker(snd_ctx, (void *)sender);
243 }
244
245 /* Close the fds we have left */
246 if (!thread_mode)
247 for (i = 0; i < num_fds; i++)
248 close(snd_ctx->out_fds[i]);
249
250 /* Return number of children to reap */
251 return num_fds * 2;
252}
253
254static const struct option options[] = {
255 OPT_BOOLEAN('p', "pipe", &use_pipes,
256 "Use pipe() instead of socketpair()"),
257 OPT_BOOLEAN('t', "thread", &thread_mode,
258 "Be multi thread instead of multi process"),
259 OPT_INTEGER('g', "group", &num_groups,
260 "Specify number of groups"),
261 OPT_INTEGER('l', "loop", &loops,
262 "Specify number of loops"),
263 OPT_END()
264};
265
266static const char * const bench_sched_message_usage[] = {
267 "perf bench sched messaging <options>",
268 NULL
269};
270
271int bench_sched_messaging(int argc, const char **argv,
272 const char *prefix __used)
273{
274 unsigned int i, total_children;
275 struct timeval start, stop, diff;
276 unsigned int num_fds = 20;
277 int readyfds[2], wakefds[2];
278 char dummy;
279 pthread_t *pth_tab;
280
281 argc = parse_options(argc, argv, options,
282 bench_sched_message_usage, 0);
283
284 pth_tab = malloc(num_fds * 2 * num_groups * sizeof(pthread_t));
285 if (!pth_tab)
286 barf("main:malloc()");
287
288 fdpair(readyfds);
289 fdpair(wakefds);
290
291 total_children = 0;
292 for (i = 0; i < num_groups; i++)
293 total_children += group(pth_tab+total_children, num_fds,
294 readyfds[1], wakefds[0]);
295
296 /* Wait for everyone to be ready */
297 for (i = 0; i < total_children; i++)
298 if (read(readyfds[0], &dummy, 1) != 1)
299 barf("Reading for readyfds");
300
301 gettimeofday(&start, NULL);
302
303 /* Kick them off */
304 if (write(wakefds[1], &dummy, 1) != 1)
305 barf("Writing to start them");
306
307 /* Reap them all */
308 for (i = 0; i < total_children; i++)
309 reap_worker(pth_tab[i]);
310
311 gettimeofday(&stop, NULL);
312
313 timersub(&stop, &start, &diff);
314
315 switch (bench_format) {
316 case BENCH_FORMAT_DEFAULT:
317 printf("# %d sender and receiver %s per group\n",
318 num_fds, thread_mode ? "threads" : "processes");
319 printf("# %d groups == %d %s run\n\n",
320 num_groups, num_groups * 2 * num_fds,
321 thread_mode ? "threads" : "processes");
322 printf(" %14s: %lu.%03lu [sec]\n", "Total time",
323 diff.tv_sec, diff.tv_usec/1000);
324 break;
325 case BENCH_FORMAT_SIMPLE:
326 printf("%lu.%03lu\n", diff.tv_sec, diff.tv_usec/1000);
327 break;
328 default:
329 /* reaching here is something disaster */
330 fprintf(stderr, "Unknown format:%d\n", bench_format);
331 exit(1);
332 break;
333 }
334
335 return 0;
336}
diff --git a/tools/perf/bench/sched-pipe.c b/tools/perf/bench/sched-pipe.c
new file mode 100644
index 000000000000..238185f97977
--- /dev/null
+++ b/tools/perf/bench/sched-pipe.c
@@ -0,0 +1,124 @@
1/*
2 *
3 * builtin-bench-pipe.c
4 *
5 * pipe: Benchmark for pipe()
6 *
7 * Based on pipe-test-1m.c by Ingo Molnar <mingo@redhat.com>
8 * http://people.redhat.com/mingo/cfs-scheduler/tools/pipe-test-1m.c
9 * Ported to perf by Hitoshi Mitake <mitake@dcl.info.waseda.ac.jp>
10 *
11 */
12
13#include "../perf.h"
14#include "../util/util.h"
15#include "../util/parse-options.h"
16#include "../builtin.h"
17#include "bench.h"
18
19#include <unistd.h>
20#include <stdio.h>
21#include <stdlib.h>
22#include <signal.h>
23#include <sys/wait.h>
24#include <linux/unistd.h>
25#include <string.h>
26#include <errno.h>
27#include <assert.h>
28#include <sys/time.h>
29#include <sys/types.h>
30
31#define LOOPS_DEFAULT 1000000
32static int loops = LOOPS_DEFAULT;
33
34static const struct option options[] = {
35 OPT_INTEGER('l', "loop", &loops,
36 "Specify number of loops"),
37 OPT_END()
38};
39
40static const char * const bench_sched_pipe_usage[] = {
41 "perf bench sched pipe <options>",
42 NULL
43};
44
45int bench_sched_pipe(int argc, const char **argv,
46 const char *prefix __used)
47{
48 int pipe_1[2], pipe_2[2];
49 int m = 0, i;
50 struct timeval start, stop, diff;
51 unsigned long long result_usec = 0;
52
53 /*
54 * why does "ret" exist?
55 * discarding returned value of read(), write()
56 * causes error in building environment for perf
57 */
58 int ret, wait_stat;
59 pid_t pid, retpid;
60
61 argc = parse_options(argc, argv, options,
62 bench_sched_pipe_usage, 0);
63
64 assert(!pipe(pipe_1));
65 assert(!pipe(pipe_2));
66
67 pid = fork();
68 assert(pid >= 0);
69
70 gettimeofday(&start, NULL);
71
72 if (!pid) {
73 for (i = 0; i < loops; i++) {
74 ret = read(pipe_1[0], &m, sizeof(int));
75 ret = write(pipe_2[1], &m, sizeof(int));
76 }
77 } else {
78 for (i = 0; i < loops; i++) {
79 ret = write(pipe_1[1], &m, sizeof(int));
80 ret = read(pipe_2[0], &m, sizeof(int));
81 }
82 }
83
84 gettimeofday(&stop, NULL);
85 timersub(&stop, &start, &diff);
86
87 if (pid) {
88 retpid = waitpid(pid, &wait_stat, 0);
89 assert((retpid == pid) && WIFEXITED(wait_stat));
90 return 0;
91 }
92
93 switch (bench_format) {
94 case BENCH_FORMAT_DEFAULT:
95 printf("# Extecuted %d pipe operations between two tasks\n\n",
96 loops);
97
98 result_usec = diff.tv_sec * 1000000;
99 result_usec += diff.tv_usec;
100
101 printf(" %14s: %lu.%03lu [sec]\n\n", "Total time",
102 diff.tv_sec, diff.tv_usec/1000);
103
104 printf(" %14lf usecs/op\n",
105 (double)result_usec / (double)loops);
106 printf(" %14d ops/sec\n",
107 (int)((double)loops /
108 ((double)result_usec / (double)1000000)));
109 break;
110
111 case BENCH_FORMAT_SIMPLE:
112 printf("%lu.%03lu\n",
113 diff.tv_sec, diff.tv_usec / 1000);
114 break;
115
116 default:
117 /* reaching here is something disaster */
118 fprintf(stderr, "Unknown format:%d\n", bench_format);
119 exit(1);
120 break;
121 }
122
123 return 0;
124}
diff --git a/tools/perf/builtin-annotate.c b/tools/perf/builtin-annotate.c
index 1ec741615814..0bf2e8f9af57 100644
--- a/tools/perf/builtin-annotate.c
+++ b/tools/perf/builtin-annotate.c
@@ -19,29 +19,26 @@
19#include "perf.h" 19#include "perf.h"
20#include "util/debug.h" 20#include "util/debug.h"
21 21
22#include "util/event.h"
22#include "util/parse-options.h" 23#include "util/parse-options.h"
23#include "util/parse-events.h" 24#include "util/parse-events.h"
24#include "util/thread.h" 25#include "util/thread.h"
26#include "util/sort.h"
27#include "util/hist.h"
28#include "util/data_map.h"
25 29
26static char const *input_name = "perf.data"; 30static char const *input_name = "perf.data";
27 31
28static char default_sort_order[] = "comm,symbol";
29static char *sort_order = default_sort_order;
30
31static int force; 32static int force;
32static int input;
33static int show_mask = SHOW_KERNEL | SHOW_USER | SHOW_HV;
34 33
35static int full_paths; 34static int full_paths;
36 35
37static int print_line; 36static int print_line;
38 37
39static unsigned long page_size; 38struct sym_hist {
40static unsigned long mmap_window = 32; 39 u64 sum;
41 40 u64 ip[0];
42static struct rb_root threads; 41};
43static struct thread *last_match;
44
45 42
46struct sym_ext { 43struct sym_ext {
47 struct rb_node node; 44 struct rb_node node;
@@ -49,247 +46,38 @@ struct sym_ext {
49 char *path; 46 char *path;
50}; 47};
51 48
52/* 49struct sym_priv {
53 * histogram, sorted on item, collects counts 50 struct sym_hist *hist;
54 */ 51 struct sym_ext *ext;
55
56static struct rb_root hist;
57
58struct hist_entry {
59 struct rb_node rb_node;
60
61 struct thread *thread;
62 struct map *map;
63 struct dso *dso;
64 struct symbol *sym;
65 u64 ip;
66 char level;
67
68 uint32_t count;
69};
70
71/*
72 * configurable sorting bits
73 */
74
75struct sort_entry {
76 struct list_head list;
77
78 const char *header;
79
80 int64_t (*cmp)(struct hist_entry *, struct hist_entry *);
81 int64_t (*collapse)(struct hist_entry *, struct hist_entry *);
82 size_t (*print)(FILE *fp, struct hist_entry *);
83};
84
85/* --sort pid */
86
87static int64_t
88sort__thread_cmp(struct hist_entry *left, struct hist_entry *right)
89{
90 return right->thread->pid - left->thread->pid;
91}
92
93static size_t
94sort__thread_print(FILE *fp, struct hist_entry *self)
95{
96 return fprintf(fp, "%16s:%5d", self->thread->comm ?: "", self->thread->pid);
97}
98
99static struct sort_entry sort_thread = {
100 .header = " Command: Pid",
101 .cmp = sort__thread_cmp,
102 .print = sort__thread_print,
103};
104
105/* --sort comm */
106
107static int64_t
108sort__comm_cmp(struct hist_entry *left, struct hist_entry *right)
109{
110 return right->thread->pid - left->thread->pid;
111}
112
113static int64_t
114sort__comm_collapse(struct hist_entry *left, struct hist_entry *right)
115{
116 char *comm_l = left->thread->comm;
117 char *comm_r = right->thread->comm;
118
119 if (!comm_l || !comm_r) {
120 if (!comm_l && !comm_r)
121 return 0;
122 else if (!comm_l)
123 return -1;
124 else
125 return 1;
126 }
127
128 return strcmp(comm_l, comm_r);
129}
130
131static size_t
132sort__comm_print(FILE *fp, struct hist_entry *self)
133{
134 return fprintf(fp, "%16s", self->thread->comm);
135}
136
137static struct sort_entry sort_comm = {
138 .header = " Command",
139 .cmp = sort__comm_cmp,
140 .collapse = sort__comm_collapse,
141 .print = sort__comm_print,
142};
143
144/* --sort dso */
145
146static int64_t
147sort__dso_cmp(struct hist_entry *left, struct hist_entry *right)
148{
149 struct dso *dso_l = left->dso;
150 struct dso *dso_r = right->dso;
151
152 if (!dso_l || !dso_r) {
153 if (!dso_l && !dso_r)
154 return 0;
155 else if (!dso_l)
156 return -1;
157 else
158 return 1;
159 }
160
161 return strcmp(dso_l->name, dso_r->name);
162}
163
164static size_t
165sort__dso_print(FILE *fp, struct hist_entry *self)
166{
167 if (self->dso)
168 return fprintf(fp, "%-25s", self->dso->name);
169
170 return fprintf(fp, "%016llx ", (u64)self->ip);
171}
172
173static struct sort_entry sort_dso = {
174 .header = "Shared Object ",
175 .cmp = sort__dso_cmp,
176 .print = sort__dso_print,
177};
178
179/* --sort symbol */
180
181static int64_t
182sort__sym_cmp(struct hist_entry *left, struct hist_entry *right)
183{
184 u64 ip_l, ip_r;
185
186 if (left->sym == right->sym)
187 return 0;
188
189 ip_l = left->sym ? left->sym->start : left->ip;
190 ip_r = right->sym ? right->sym->start : right->ip;
191
192 return (int64_t)(ip_r - ip_l);
193}
194
195static size_t
196sort__sym_print(FILE *fp, struct hist_entry *self)
197{
198 size_t ret = 0;
199
200 if (verbose)
201 ret += fprintf(fp, "%#018llx ", (u64)self->ip);
202
203 if (self->sym) {
204 ret += fprintf(fp, "[%c] %s",
205 self->dso == kernel_dso ? 'k' : '.', self->sym->name);
206 } else {
207 ret += fprintf(fp, "%#016llx", (u64)self->ip);
208 }
209
210 return ret;
211}
212
213static struct sort_entry sort_sym = {
214 .header = "Symbol",
215 .cmp = sort__sym_cmp,
216 .print = sort__sym_print,
217};
218
219static int sort__need_collapse = 0;
220
221struct sort_dimension {
222 const char *name;
223 struct sort_entry *entry;
224 int taken;
225}; 52};
226 53
227static struct sort_dimension sort_dimensions[] = { 54static struct symbol_conf symbol_conf = {
228 { .name = "pid", .entry = &sort_thread, }, 55 .priv_size = sizeof(struct sym_priv),
229 { .name = "comm", .entry = &sort_comm, }, 56 .try_vmlinux_path = true,
230 { .name = "dso", .entry = &sort_dso, },
231 { .name = "symbol", .entry = &sort_sym, },
232}; 57};
233 58
234static LIST_HEAD(hist_entry__sort_list); 59static const char *sym_hist_filter;
235 60
236static int sort_dimension__add(char *tok) 61static int symbol_filter(struct map *map __used, struct symbol *sym)
237{ 62{
238 unsigned int i; 63 if (sym_hist_filter == NULL ||
239 64 strcmp(sym->name, sym_hist_filter) == 0) {
240 for (i = 0; i < ARRAY_SIZE(sort_dimensions); i++) { 65 struct sym_priv *priv = symbol__priv(sym);
241 struct sort_dimension *sd = &sort_dimensions[i]; 66 const int size = (sizeof(*priv->hist) +
242 67 (sym->end - sym->start) * sizeof(u64));
243 if (sd->taken)
244 continue;
245
246 if (strncasecmp(tok, sd->name, strlen(tok)))
247 continue;
248
249 if (sd->entry->collapse)
250 sort__need_collapse = 1;
251
252 list_add_tail(&sd->entry->list, &hist_entry__sort_list);
253 sd->taken = 1;
254 68
69 priv->hist = malloc(size);
70 if (priv->hist)
71 memset(priv->hist, 0, size);
255 return 0; 72 return 0;
256 } 73 }
257 74 /*
258 return -ESRCH; 75 * FIXME: We should really filter it out, as we don't want to go thru symbols
259} 76 * we're not interested, and if a DSO ends up with no symbols, delete it too,
260 77 * but right now the kernel loading routines in symbol.c bail out if no symbols
261static int64_t 78 * are found, fix it later.
262hist_entry__cmp(struct hist_entry *left, struct hist_entry *right) 79 */
263{ 80 return 0;
264 struct sort_entry *se;
265 int64_t cmp = 0;
266
267 list_for_each_entry(se, &hist_entry__sort_list, list) {
268 cmp = se->cmp(left, right);
269 if (cmp)
270 break;
271 }
272
273 return cmp;
274}
275
276static int64_t
277hist_entry__collapse(struct hist_entry *left, struct hist_entry *right)
278{
279 struct sort_entry *se;
280 int64_t cmp = 0;
281
282 list_for_each_entry(se, &hist_entry__sort_list, list) {
283 int64_t (*f)(struct hist_entry *, struct hist_entry *);
284
285 f = se->collapse ?: se->cmp;
286
287 cmp = f(left, right);
288 if (cmp)
289 break;
290 }
291
292 return cmp;
293} 81}
294 82
295/* 83/*
@@ -299,380 +87,81 @@ static void hist_hit(struct hist_entry *he, u64 ip)
299{ 87{
300 unsigned int sym_size, offset; 88 unsigned int sym_size, offset;
301 struct symbol *sym = he->sym; 89 struct symbol *sym = he->sym;
90 struct sym_priv *priv;
91 struct sym_hist *h;
302 92
303 he->count++; 93 he->count++;
304 94
305 if (!sym || !sym->hist) 95 if (!sym || !he->map)
96 return;
97
98 priv = symbol__priv(sym);
99 if (!priv->hist)
306 return; 100 return;
307 101
308 sym_size = sym->end - sym->start; 102 sym_size = sym->end - sym->start;
309 offset = ip - sym->start; 103 offset = ip - sym->start;
310 104
105 if (verbose)
106 fprintf(stderr, "%s: ip=%Lx\n", __func__,
107 he->map->unmap_ip(he->map, ip));
108
311 if (offset >= sym_size) 109 if (offset >= sym_size)
312 return; 110 return;
313 111
314 sym->hist_sum++; 112 h = priv->hist;
315 sym->hist[offset]++; 113 h->sum++;
114 h->ip[offset]++;
316 115
317 if (verbose >= 3) 116 if (verbose >= 3)
318 printf("%p %s: count++ [ip: %p, %08Lx] => %Ld\n", 117 printf("%p %s: count++ [ip: %p, %08Lx] => %Ld\n",
319 (void *)(unsigned long)he->sym->start, 118 (void *)(unsigned long)he->sym->start,
320 he->sym->name, 119 he->sym->name,
321 (void *)(unsigned long)ip, ip - he->sym->start, 120 (void *)(unsigned long)ip, ip - he->sym->start,
322 sym->hist[offset]); 121 h->ip[offset]);
323} 122}
324 123
325static int 124static int hist_entry__add(struct addr_location *al, u64 count)
326hist_entry__add(struct thread *thread, struct map *map, struct dso *dso,
327 struct symbol *sym, u64 ip, char level)
328{ 125{
329 struct rb_node **p = &hist.rb_node; 126 bool hit;
330 struct rb_node *parent = NULL; 127 struct hist_entry *he = __hist_entry__add(al, NULL, count, &hit);
331 struct hist_entry *he; 128 if (he == NULL)
332 struct hist_entry entry = {
333 .thread = thread,
334 .map = map,
335 .dso = dso,
336 .sym = sym,
337 .ip = ip,
338 .level = level,
339 .count = 1,
340 };
341 int cmp;
342
343 while (*p != NULL) {
344 parent = *p;
345 he = rb_entry(parent, struct hist_entry, rb_node);
346
347 cmp = hist_entry__cmp(&entry, he);
348
349 if (!cmp) {
350 hist_hit(he, ip);
351
352 return 0;
353 }
354
355 if (cmp < 0)
356 p = &(*p)->rb_left;
357 else
358 p = &(*p)->rb_right;
359 }
360
361 he = malloc(sizeof(*he));
362 if (!he)
363 return -ENOMEM; 129 return -ENOMEM;
364 *he = entry; 130 hist_hit(he, al->addr);
365 rb_link_node(&he->rb_node, parent, p);
366 rb_insert_color(&he->rb_node, &hist);
367
368 return 0; 131 return 0;
369} 132}
370 133
371static void hist_entry__free(struct hist_entry *he) 134static int process_sample_event(event_t *event)
372{
373 free(he);
374}
375
376/*
377 * collapse the histogram
378 */
379
380static struct rb_root collapse_hists;
381
382static void collapse__insert_entry(struct hist_entry *he)
383{
384 struct rb_node **p = &collapse_hists.rb_node;
385 struct rb_node *parent = NULL;
386 struct hist_entry *iter;
387 int64_t cmp;
388
389 while (*p != NULL) {
390 parent = *p;
391 iter = rb_entry(parent, struct hist_entry, rb_node);
392
393 cmp = hist_entry__collapse(iter, he);
394
395 if (!cmp) {
396 iter->count += he->count;
397 hist_entry__free(he);
398 return;
399 }
400
401 if (cmp < 0)
402 p = &(*p)->rb_left;
403 else
404 p = &(*p)->rb_right;
405 }
406
407 rb_link_node(&he->rb_node, parent, p);
408 rb_insert_color(&he->rb_node, &collapse_hists);
409}
410
411static void collapse__resort(void)
412{
413 struct rb_node *next;
414 struct hist_entry *n;
415
416 if (!sort__need_collapse)
417 return;
418
419 next = rb_first(&hist);
420 while (next) {
421 n = rb_entry(next, struct hist_entry, rb_node);
422 next = rb_next(&n->rb_node);
423
424 rb_erase(&n->rb_node, &hist);
425 collapse__insert_entry(n);
426 }
427}
428
429/*
430 * reverse the map, sort on count.
431 */
432
433static struct rb_root output_hists;
434
435static void output__insert_entry(struct hist_entry *he)
436{ 135{
437 struct rb_node **p = &output_hists.rb_node; 136 struct addr_location al;
438 struct rb_node *parent = NULL;
439 struct hist_entry *iter;
440 137
441 while (*p != NULL) { 138 dump_printf("(IP, %d): %d: %p\n", event->header.misc,
442 parent = *p; 139 event->ip.pid, (void *)(long)event->ip.ip);
443 iter = rb_entry(parent, struct hist_entry, rb_node);
444 140
445 if (he->count > iter->count) 141 if (event__preprocess_sample(event, &al, symbol_filter) < 0) {
446 p = &(*p)->rb_left;
447 else
448 p = &(*p)->rb_right;
449 }
450
451 rb_link_node(&he->rb_node, parent, p);
452 rb_insert_color(&he->rb_node, &output_hists);
453}
454
455static void output__resort(void)
456{
457 struct rb_node *next;
458 struct hist_entry *n;
459 struct rb_root *tree = &hist;
460
461 if (sort__need_collapse)
462 tree = &collapse_hists;
463
464 next = rb_first(tree);
465
466 while (next) {
467 n = rb_entry(next, struct hist_entry, rb_node);
468 next = rb_next(&n->rb_node);
469
470 rb_erase(&n->rb_node, tree);
471 output__insert_entry(n);
472 }
473}
474
475static unsigned long total = 0,
476 total_mmap = 0,
477 total_comm = 0,
478 total_fork = 0,
479 total_unknown = 0;
480
481static int
482process_sample_event(event_t *event, unsigned long offset, unsigned long head)
483{
484 char level;
485 int show = 0;
486 struct dso *dso = NULL;
487 struct thread *thread;
488 u64 ip = event->ip.ip;
489 struct map *map = NULL;
490
491 thread = threads__findnew(event->ip.pid, &threads, &last_match);
492
493 dump_printf("%p [%p]: PERF_EVENT (IP, %d): %d: %p\n",
494 (void *)(offset + head),
495 (void *)(long)(event->header.size),
496 event->header.misc,
497 event->ip.pid,
498 (void *)(long)ip);
499
500 dump_printf(" ... thread: %s:%d\n", thread->comm, thread->pid);
501
502 if (thread == NULL) {
503 fprintf(stderr, "problem processing %d event, skipping it.\n", 142 fprintf(stderr, "problem processing %d event, skipping it.\n",
504 event->header.type); 143 event->header.type);
505 return -1; 144 return -1;
506 } 145 }
507 146
508 if (event->header.misc & PERF_RECORD_MISC_KERNEL) { 147 if (hist_entry__add(&al, 1)) {
509 show = SHOW_KERNEL; 148 fprintf(stderr, "problem incrementing symbol count, "
510 level = 'k'; 149 "skipping event\n");
511
512 dso = kernel_dso;
513
514 dump_printf(" ...... dso: %s\n", dso->name);
515
516 } else if (event->header.misc & PERF_RECORD_MISC_USER) {
517
518 show = SHOW_USER;
519 level = '.';
520
521 map = thread__find_map(thread, ip);
522 if (map != NULL) {
523 ip = map->map_ip(map, ip);
524 dso = map->dso;
525 } else {
526 /*
527 * If this is outside of all known maps,
528 * and is a negative address, try to look it
529 * up in the kernel dso, as it might be a
530 * vsyscall (which executes in user-mode):
531 */
532 if ((long long)ip < 0)
533 dso = kernel_dso;
534 }
535 dump_printf(" ...... dso: %s\n", dso ? dso->name : "<not found>");
536
537 } else {
538 show = SHOW_HV;
539 level = 'H';
540 dump_printf(" ...... dso: [hypervisor]\n");
541 }
542
543 if (show & show_mask) {
544 struct symbol *sym = NULL;
545
546 if (dso)
547 sym = dso->find_symbol(dso, ip);
548
549 if (hist_entry__add(thread, map, dso, sym, ip, level)) {
550 fprintf(stderr,
551 "problem incrementing symbol count, skipping event\n");
552 return -1;
553 }
554 }
555 total++;
556
557 return 0;
558}
559
560static int
561process_mmap_event(event_t *event, unsigned long offset, unsigned long head)
562{
563 struct thread *thread;
564 struct map *map = map__new(&event->mmap, NULL, 0);
565
566 thread = threads__findnew(event->mmap.pid, &threads, &last_match);
567
568 dump_printf("%p [%p]: PERF_RECORD_MMAP %d: [%p(%p) @ %p]: %s\n",
569 (void *)(offset + head),
570 (void *)(long)(event->header.size),
571 event->mmap.pid,
572 (void *)(long)event->mmap.start,
573 (void *)(long)event->mmap.len,
574 (void *)(long)event->mmap.pgoff,
575 event->mmap.filename);
576
577 if (thread == NULL || map == NULL) {
578 dump_printf("problem processing PERF_RECORD_MMAP, skipping event.\n");
579 return 0;
580 }
581
582 thread__insert_map(thread, map);
583 total_mmap++;
584
585 return 0;
586}
587
588static int
589process_comm_event(event_t *event, unsigned long offset, unsigned long head)
590{
591 struct thread *thread;
592
593 thread = threads__findnew(event->comm.pid, &threads, &last_match);
594 dump_printf("%p [%p]: PERF_RECORD_COMM: %s:%d\n",
595 (void *)(offset + head),
596 (void *)(long)(event->header.size),
597 event->comm.comm, event->comm.pid);
598
599 if (thread == NULL ||
600 thread__set_comm(thread, event->comm.comm)) {
601 dump_printf("problem processing PERF_RECORD_COMM, skipping event.\n");
602 return -1;
603 }
604 total_comm++;
605
606 return 0;
607}
608
609static int
610process_fork_event(event_t *event, unsigned long offset, unsigned long head)
611{
612 struct thread *thread;
613 struct thread *parent;
614
615 thread = threads__findnew(event->fork.pid, &threads, &last_match);
616 parent = threads__findnew(event->fork.ppid, &threads, &last_match);
617 dump_printf("%p [%p]: PERF_RECORD_FORK: %d:%d\n",
618 (void *)(offset + head),
619 (void *)(long)(event->header.size),
620 event->fork.pid, event->fork.ppid);
621
622 /*
623 * A thread clone will have the same PID for both
624 * parent and child.
625 */
626 if (thread == parent)
627 return 0;
628
629 if (!thread || !parent || thread__fork(thread, parent)) {
630 dump_printf("problem processing PERF_RECORD_FORK, skipping event.\n");
631 return -1;
632 }
633 total_fork++;
634
635 return 0;
636}
637
638static int
639process_event(event_t *event, unsigned long offset, unsigned long head)
640{
641 switch (event->header.type) {
642 case PERF_RECORD_SAMPLE:
643 return process_sample_event(event, offset, head);
644
645 case PERF_RECORD_MMAP:
646 return process_mmap_event(event, offset, head);
647
648 case PERF_RECORD_COMM:
649 return process_comm_event(event, offset, head);
650
651 case PERF_RECORD_FORK:
652 return process_fork_event(event, offset, head);
653 /*
654 * We dont process them right now but they are fine:
655 */
656
657 case PERF_RECORD_THROTTLE:
658 case PERF_RECORD_UNTHROTTLE:
659 return 0;
660
661 default:
662 return -1; 150 return -1;
663 } 151 }
664 152
665 return 0; 153 return 0;
666} 154}
667 155
668static int 156static int parse_line(FILE *file, struct hist_entry *he, u64 len)
669parse_line(FILE *file, struct symbol *sym, u64 start, u64 len)
670{ 157{
158 struct symbol *sym = he->sym;
671 char *line = NULL, *tmp, *tmp2; 159 char *line = NULL, *tmp, *tmp2;
672 static const char *prev_line; 160 static const char *prev_line;
673 static const char *prev_color; 161 static const char *prev_color;
674 unsigned int offset; 162 unsigned int offset;
675 size_t line_len; 163 size_t line_len;
164 u64 start;
676 s64 line_ip; 165 s64 line_ip;
677 int ret; 166 int ret;
678 char *c; 167 char *c;
@@ -709,22 +198,26 @@ parse_line(FILE *file, struct symbol *sym, u64 start, u64 len)
709 line_ip = -1; 198 line_ip = -1;
710 } 199 }
711 200
201 start = he->map->unmap_ip(he->map, sym->start);
202
712 if (line_ip != -1) { 203 if (line_ip != -1) {
713 const char *path = NULL; 204 const char *path = NULL;
714 unsigned int hits = 0; 205 unsigned int hits = 0;
715 double percent = 0.0; 206 double percent = 0.0;
716 const char *color; 207 const char *color;
717 struct sym_ext *sym_ext = sym->priv; 208 struct sym_priv *priv = symbol__priv(sym);
209 struct sym_ext *sym_ext = priv->ext;
210 struct sym_hist *h = priv->hist;
718 211
719 offset = line_ip - start; 212 offset = line_ip - start;
720 if (offset < len) 213 if (offset < len)
721 hits = sym->hist[offset]; 214 hits = h->ip[offset];
722 215
723 if (offset < len && sym_ext) { 216 if (offset < len && sym_ext) {
724 path = sym_ext[offset].path; 217 path = sym_ext[offset].path;
725 percent = sym_ext[offset].percent; 218 percent = sym_ext[offset].percent;
726 } else if (sym->hist_sum) 219 } else if (h->sum)
727 percent = 100.0 * hits / sym->hist_sum; 220 percent = 100.0 * hits / h->sum;
728 221
729 color = get_percent_color(percent); 222 color = get_percent_color(percent);
730 223
@@ -777,9 +270,10 @@ static void insert_source_line(struct sym_ext *sym_ext)
777 rb_insert_color(&sym_ext->node, &root_sym_ext); 270 rb_insert_color(&sym_ext->node, &root_sym_ext);
778} 271}
779 272
780static void free_source_line(struct symbol *sym, int len) 273static void free_source_line(struct hist_entry *he, int len)
781{ 274{
782 struct sym_ext *sym_ext = sym->priv; 275 struct sym_priv *priv = symbol__priv(he->sym);
276 struct sym_ext *sym_ext = priv->ext;
783 int i; 277 int i;
784 278
785 if (!sym_ext) 279 if (!sym_ext)
@@ -789,26 +283,30 @@ static void free_source_line(struct symbol *sym, int len)
789 free(sym_ext[i].path); 283 free(sym_ext[i].path);
790 free(sym_ext); 284 free(sym_ext);
791 285
792 sym->priv = NULL; 286 priv->ext = NULL;
793 root_sym_ext = RB_ROOT; 287 root_sym_ext = RB_ROOT;
794} 288}
795 289
796/* Get the filename:line for the colored entries */ 290/* Get the filename:line for the colored entries */
797static void 291static void
798get_source_line(struct symbol *sym, u64 start, int len, const char *filename) 292get_source_line(struct hist_entry *he, int len, const char *filename)
799{ 293{
294 struct symbol *sym = he->sym;
295 u64 start;
800 int i; 296 int i;
801 char cmd[PATH_MAX * 2]; 297 char cmd[PATH_MAX * 2];
802 struct sym_ext *sym_ext; 298 struct sym_ext *sym_ext;
299 struct sym_priv *priv = symbol__priv(sym);
300 struct sym_hist *h = priv->hist;
803 301
804 if (!sym->hist_sum) 302 if (!h->sum)
805 return; 303 return;
806 304
807 sym->priv = calloc(len, sizeof(struct sym_ext)); 305 sym_ext = priv->ext = calloc(len, sizeof(struct sym_ext));
808 if (!sym->priv) 306 if (!priv->ext)
809 return; 307 return;
810 308
811 sym_ext = sym->priv; 309 start = he->map->unmap_ip(he->map, sym->start);
812 310
813 for (i = 0; i < len; i++) { 311 for (i = 0; i < len; i++) {
814 char *path = NULL; 312 char *path = NULL;
@@ -816,7 +314,7 @@ get_source_line(struct symbol *sym, u64 start, int len, const char *filename)
816 u64 offset; 314 u64 offset;
817 FILE *fp; 315 FILE *fp;
818 316
819 sym_ext[i].percent = 100.0 * sym->hist[i] / sym->hist_sum; 317 sym_ext[i].percent = 100.0 * h->ip[i] / h->sum;
820 if (sym_ext[i].percent <= 0.5) 318 if (sym_ext[i].percent <= 0.5)
821 continue; 319 continue;
822 320
@@ -870,33 +368,34 @@ static void print_summary(const char *filename)
870 } 368 }
871} 369}
872 370
873static void annotate_sym(struct dso *dso, struct symbol *sym) 371static void annotate_sym(struct hist_entry *he)
874{ 372{
875 const char *filename = dso->name, *d_filename; 373 struct map *map = he->map;
876 u64 start, end, len; 374 struct dso *dso = map->dso;
375 struct symbol *sym = he->sym;
376 const char *filename = dso->long_name, *d_filename;
377 u64 len;
877 char command[PATH_MAX*2]; 378 char command[PATH_MAX*2];
878 FILE *file; 379 FILE *file;
879 380
880 if (!filename) 381 if (!filename)
881 return; 382 return;
882 if (sym->module) 383
883 filename = sym->module->path; 384 if (verbose)
884 else if (dso == kernel_dso) 385 fprintf(stderr, "%s: filename=%s, sym=%s, start=%Lx, end=%Lx\n",
885 filename = vmlinux_name; 386 __func__, filename, sym->name,
886 387 map->unmap_ip(map, sym->start),
887 start = sym->obj_start; 388 map->unmap_ip(map, sym->end));
888 if (!start) 389
889 start = sym->start;
890 if (full_paths) 390 if (full_paths)
891 d_filename = filename; 391 d_filename = filename;
892 else 392 else
893 d_filename = basename(filename); 393 d_filename = basename(filename);
894 394
895 end = start + sym->end - sym->start + 1;
896 len = sym->end - sym->start; 395 len = sym->end - sym->start;
897 396
898 if (print_line) { 397 if (print_line) {
899 get_source_line(sym, start, len, filename); 398 get_source_line(he, len, filename);
900 print_summary(filename); 399 print_summary(filename);
901 } 400 }
902 401
@@ -905,10 +404,12 @@ static void annotate_sym(struct dso *dso, struct symbol *sym)
905 printf("------------------------------------------------\n"); 404 printf("------------------------------------------------\n");
906 405
907 if (verbose >= 2) 406 if (verbose >= 2)
908 printf("annotating [%p] %30s : [%p] %30s\n", dso, dso->name, sym, sym->name); 407 printf("annotating [%p] %30s : [%p] %30s\n",
408 dso, dso->long_name, sym, sym->name);
909 409
910 sprintf(command, "objdump --start-address=0x%016Lx --stop-address=0x%016Lx -dS %s|grep -v %s", 410 sprintf(command, "objdump --start-address=0x%016Lx --stop-address=0x%016Lx -dS %s|grep -v %s",
911 (u64)start, (u64)end, filename, filename); 411 map->unmap_ip(map, sym->start), map->unmap_ip(map, sym->end),
412 filename, filename);
912 413
913 if (verbose >= 3) 414 if (verbose >= 3)
914 printf("doing: %s\n", command); 415 printf("doing: %s\n", command);
@@ -918,159 +419,78 @@ static void annotate_sym(struct dso *dso, struct symbol *sym)
918 return; 419 return;
919 420
920 while (!feof(file)) { 421 while (!feof(file)) {
921 if (parse_line(file, sym, start, len) < 0) 422 if (parse_line(file, he, len) < 0)
922 break; 423 break;
923 } 424 }
924 425
925 pclose(file); 426 pclose(file);
926 if (print_line) 427 if (print_line)
927 free_source_line(sym, len); 428 free_source_line(he, len);
928} 429}
929 430
930static void find_annotations(void) 431static void find_annotations(void)
931{ 432{
932 struct rb_node *nd; 433 struct rb_node *nd;
933 struct dso *dso;
934 int count = 0;
935
936 list_for_each_entry(dso, &dsos, node) {
937
938 for (nd = rb_first(&dso->syms); nd; nd = rb_next(nd)) {
939 struct symbol *sym = rb_entry(nd, struct symbol, rb_node);
940
941 if (sym->hist) {
942 annotate_sym(dso, sym);
943 count++;
944 }
945 }
946 }
947
948 if (!count)
949 printf(" Error: symbol '%s' not present amongst the samples.\n", sym_hist_filter);
950}
951
952static int __cmd_annotate(void)
953{
954 int ret, rc = EXIT_FAILURE;
955 unsigned long offset = 0;
956 unsigned long head = 0;
957 struct stat input_stat;
958 event_t *event;
959 uint32_t size;
960 char *buf;
961
962 register_idle_thread(&threads, &last_match);
963
964 input = open(input_name, O_RDONLY);
965 if (input < 0) {
966 perror("failed to open file");
967 exit(-1);
968 }
969
970 ret = fstat(input, &input_stat);
971 if (ret < 0) {
972 perror("failed to stat file");
973 exit(-1);
974 }
975
976 if (!force && input_stat.st_uid && (input_stat.st_uid != geteuid())) {
977 fprintf(stderr, "file: %s not owned by current user or root\n", input_name);
978 exit(-1);
979 }
980
981 if (!input_stat.st_size) {
982 fprintf(stderr, "zero-sized file, nothing to do!\n");
983 exit(0);
984 }
985
986 if (load_kernel() < 0) {
987 perror("failed to load kernel symbols");
988 return EXIT_FAILURE;
989 }
990
991remap:
992 buf = (char *)mmap(NULL, page_size * mmap_window, PROT_READ,
993 MAP_SHARED, input, offset);
994 if (buf == MAP_FAILED) {
995 perror("failed to mmap file");
996 exit(-1);
997 }
998
999more:
1000 event = (event_t *)(buf + head);
1001 434
1002 size = event->header.size; 435 for (nd = rb_first(&output_hists); nd; nd = rb_next(nd)) {
1003 if (!size) 436 struct hist_entry *he = rb_entry(nd, struct hist_entry, rb_node);
1004 size = 8; 437 struct sym_priv *priv;
1005 438
1006 if (head + event->header.size >= page_size * mmap_window) { 439 if (he->sym == NULL)
1007 unsigned long shift = page_size * (head / page_size); 440 continue;
1008 int munmap_ret;
1009
1010 munmap_ret = munmap(buf, page_size * mmap_window);
1011 assert(munmap_ret == 0);
1012
1013 offset += shift;
1014 head -= shift;
1015 goto remap;
1016 }
1017
1018 size = event->header.size;
1019
1020 dump_printf("%p [%p]: event: %d\n",
1021 (void *)(offset + head),
1022 (void *)(long)event->header.size,
1023 event->header.type);
1024
1025 if (!size || process_event(event, offset, head) < 0) {
1026
1027 dump_printf("%p [%p]: skipping unknown header type: %d\n",
1028 (void *)(offset + head),
1029 (void *)(long)(event->header.size),
1030 event->header.type);
1031 441
1032 total_unknown++; 442 priv = symbol__priv(he->sym);
443 if (priv->hist == NULL)
444 continue;
1033 445
446 annotate_sym(he);
1034 /* 447 /*
1035 * assume we lost track of the stream, check alignment, and 448 * Since we have a hist_entry per IP for the same symbol, free
1036 * increment a single u64 in the hope to catch on again 'soon'. 449 * he->sym->hist to signal we already processed this symbol.
1037 */ 450 */
1038 451 free(priv->hist);
1039 if (unlikely(head & 7)) 452 priv->hist = NULL;
1040 head &= ~7ULL;
1041
1042 size = 8;
1043 } 453 }
454}
1044 455
1045 head += size; 456static struct perf_file_handler file_handler = {
457 .process_sample_event = process_sample_event,
458 .process_mmap_event = event__process_mmap,
459 .process_comm_event = event__process_comm,
460 .process_fork_event = event__process_task,
461};
1046 462
1047 if (offset + head < (unsigned long)input_stat.st_size) 463static int __cmd_annotate(void)
1048 goto more; 464{
465 struct perf_header *header;
466 struct thread *idle;
467 int ret;
1049 468
1050 rc = EXIT_SUCCESS; 469 idle = register_idle_thread();
1051 close(input); 470 register_perf_file_handler(&file_handler);
1052 471
1053 dump_printf(" IP events: %10ld\n", total); 472 ret = mmap_dispatch_perf_file(&header, input_name, 0, 0,
1054 dump_printf(" mmap events: %10ld\n", total_mmap); 473 &event__cwdlen, &event__cwd);
1055 dump_printf(" comm events: %10ld\n", total_comm); 474 if (ret)
1056 dump_printf(" fork events: %10ld\n", total_fork); 475 return ret;
1057 dump_printf(" unknown events: %10ld\n", total_unknown);
1058 476
1059 if (dump_trace) 477 if (dump_trace) {
478 event__print_totals();
1060 return 0; 479 return 0;
480 }
1061 481
1062 if (verbose >= 3) 482 if (verbose > 3)
1063 threads__fprintf(stdout, &threads); 483 threads__fprintf(stdout);
1064 484
1065 if (verbose >= 2) 485 if (verbose > 2)
1066 dsos__fprintf(stdout); 486 dsos__fprintf(stdout);
1067 487
1068 collapse__resort(); 488 collapse__resort();
1069 output__resort(); 489 output__resort(event__total[0]);
1070 490
1071 find_annotations(); 491 find_annotations();
1072 492
1073 return rc; 493 return ret;
1074} 494}
1075 495
1076static const char * const annotate_usage[] = { 496static const char * const annotate_usage[] = {
@@ -1088,8 +508,9 @@ static const struct option options[] = {
1088 "be more verbose (show symbol address, etc)"), 508 "be more verbose (show symbol address, etc)"),
1089 OPT_BOOLEAN('D', "dump-raw-trace", &dump_trace, 509 OPT_BOOLEAN('D', "dump-raw-trace", &dump_trace,
1090 "dump raw trace in ASCII"), 510 "dump raw trace in ASCII"),
1091 OPT_STRING('k', "vmlinux", &vmlinux_name, "file", "vmlinux pathname"), 511 OPT_STRING('k', "vmlinux", &symbol_conf.vmlinux_name,
1092 OPT_BOOLEAN('m', "modules", &modules, 512 "file", "vmlinux pathname"),
513 OPT_BOOLEAN('m', "modules", &symbol_conf.use_modules,
1093 "load module symbols - WARNING: use only with -k and LIVE kernel"), 514 "load module symbols - WARNING: use only with -k and LIVE kernel"),
1094 OPT_BOOLEAN('l', "print-line", &print_line, 515 OPT_BOOLEAN('l', "print-line", &print_line,
1095 "print matching source lines (may be slow)"), 516 "print matching source lines (may be slow)"),
@@ -1115,9 +536,8 @@ static void setup_sorting(void)
1115 536
1116int cmd_annotate(int argc, const char **argv, const char *prefix __used) 537int cmd_annotate(int argc, const char **argv, const char *prefix __used)
1117{ 538{
1118 symbol__init(); 539 if (symbol__init(&symbol_conf) < 0)
1119 540 return -1;
1120 page_size = getpagesize();
1121 541
1122 argc = parse_options(argc, argv, options, annotate_usage, 0); 542 argc = parse_options(argc, argv, options, annotate_usage, 0);
1123 543
@@ -1134,10 +554,13 @@ int cmd_annotate(int argc, const char **argv, const char *prefix __used)
1134 sym_hist_filter = argv[0]; 554 sym_hist_filter = argv[0];
1135 } 555 }
1136 556
1137 if (!sym_hist_filter)
1138 usage_with_options(annotate_usage, options);
1139
1140 setup_pager(); 557 setup_pager();
1141 558
559 if (field_sep && *field_sep == '.') {
560 fputs("'.' is the only non valid --field-separator argument\n",
561 stderr);
562 exit(129);
563 }
564
1142 return __cmd_annotate(); 565 return __cmd_annotate();
1143} 566}
diff --git a/tools/perf/builtin-bench.c b/tools/perf/builtin-bench.c
new file mode 100644
index 000000000000..e043eb83092a
--- /dev/null
+++ b/tools/perf/builtin-bench.c
@@ -0,0 +1,196 @@
1/*
2 *
3 * builtin-bench.c
4 *
5 * General benchmarking subsystem provided by perf
6 *
7 * Copyright (C) 2009, Hitoshi Mitake <mitake@dcl.info.waseda.ac.jp>
8 *
9 */
10
11/*
12 *
13 * Available subsystem list:
14 * sched ... scheduler and IPC mechanism
15 * mem ... memory access performance
16 *
17 */
18
19#include "perf.h"
20#include "util/util.h"
21#include "util/parse-options.h"
22#include "builtin.h"
23#include "bench/bench.h"
24
25#include <stdio.h>
26#include <stdlib.h>
27#include <string.h>
28
29struct bench_suite {
30 const char *name;
31 const char *summary;
32 int (*fn)(int, const char **, const char *);
33};
34
35static struct bench_suite sched_suites[] = {
36 { "messaging",
37 "Benchmark for scheduler and IPC mechanisms",
38 bench_sched_messaging },
39 { "pipe",
40 "Flood of communication over pipe() between two processes",
41 bench_sched_pipe },
42 { NULL,
43 NULL,
44 NULL }
45};
46
47static struct bench_suite mem_suites[] = {
48 { "memcpy",
49 "Simple memory copy in various ways",
50 bench_mem_memcpy },
51 { NULL,
52 NULL,
53 NULL }
54};
55
56struct bench_subsys {
57 const char *name;
58 const char *summary;
59 struct bench_suite *suites;
60};
61
62static struct bench_subsys subsystems[] = {
63 { "sched",
64 "scheduler and IPC mechanism",
65 sched_suites },
66 { "mem",
67 "memory access performance",
68 mem_suites },
69 { NULL,
70 NULL,
71 NULL }
72};
73
74static void dump_suites(int subsys_index)
75{
76 int i;
77
78 printf("List of available suites for %s...\n\n",
79 subsystems[subsys_index].name);
80
81 for (i = 0; subsystems[subsys_index].suites[i].name; i++)
82 printf("\t%s: %s\n",
83 subsystems[subsys_index].suites[i].name,
84 subsystems[subsys_index].suites[i].summary);
85
86 printf("\n");
87 return;
88}
89
90static char *bench_format_str;
91int bench_format = BENCH_FORMAT_DEFAULT;
92
93static const struct option bench_options[] = {
94 OPT_STRING('f', "format", &bench_format_str, "default",
95 "Specify format style"),
96 OPT_END()
97};
98
99static const char * const bench_usage[] = {
100 "perf bench [<common options>] <subsystem> <suite> [<options>]",
101 NULL
102};
103
104static void print_usage(void)
105{
106 int i;
107
108 printf("Usage: \n");
109 for (i = 0; bench_usage[i]; i++)
110 printf("\t%s\n", bench_usage[i]);
111 printf("\n");
112
113 printf("List of available subsystems...\n\n");
114
115 for (i = 0; subsystems[i].name; i++)
116 printf("\t%s: %s\n",
117 subsystems[i].name, subsystems[i].summary);
118 printf("\n");
119}
120
121static int bench_str2int(char *str)
122{
123 if (!str)
124 return BENCH_FORMAT_DEFAULT;
125
126 if (!strcmp(str, BENCH_FORMAT_DEFAULT_STR))
127 return BENCH_FORMAT_DEFAULT;
128 else if (!strcmp(str, BENCH_FORMAT_SIMPLE_STR))
129 return BENCH_FORMAT_SIMPLE;
130
131 return BENCH_FORMAT_UNKNOWN;
132}
133
134int cmd_bench(int argc, const char **argv, const char *prefix __used)
135{
136 int i, j, status = 0;
137
138 if (argc < 2) {
139 /* No subsystem specified. */
140 print_usage();
141 goto end;
142 }
143
144 argc = parse_options(argc, argv, bench_options, bench_usage,
145 PARSE_OPT_STOP_AT_NON_OPTION);
146
147 bench_format = bench_str2int(bench_format_str);
148 if (bench_format == BENCH_FORMAT_UNKNOWN) {
149 printf("Unknown format descriptor:%s\n", bench_format_str);
150 goto end;
151 }
152
153 if (argc < 1) {
154 print_usage();
155 goto end;
156 }
157
158 for (i = 0; subsystems[i].name; i++) {
159 if (strcmp(subsystems[i].name, argv[0]))
160 continue;
161
162 if (argc < 2) {
163 /* No suite specified. */
164 dump_suites(i);
165 goto end;
166 }
167
168 for (j = 0; subsystems[i].suites[j].name; j++) {
169 if (strcmp(subsystems[i].suites[j].name, argv[1]))
170 continue;
171
172 if (bench_format == BENCH_FORMAT_DEFAULT)
173 printf("# Running %s/%s benchmark...\n",
174 subsystems[i].name,
175 subsystems[i].suites[j].name);
176 status = subsystems[i].suites[j].fn(argc - 1,
177 argv + 1, prefix);
178 goto end;
179 }
180
181 if (!strcmp(argv[1], "-h") || !strcmp(argv[1], "--help")) {
182 dump_suites(i);
183 goto end;
184 }
185
186 printf("Unknown suite:%s for %s\n", argv[1], argv[0]);
187 status = 1;
188 goto end;
189 }
190
191 printf("Unknown subsystem:%s\n", argv[0]);
192 status = 1;
193
194end:
195 return status;
196}
diff --git a/tools/perf/builtin-buildid-list.c b/tools/perf/builtin-buildid-list.c
new file mode 100644
index 000000000000..7dee9d19ab7a
--- /dev/null
+++ b/tools/perf/builtin-buildid-list.c
@@ -0,0 +1,116 @@
1/*
2 * builtin-buildid-list.c
3 *
4 * Builtin buildid-list command: list buildids in perf.data
5 *
6 * Copyright (C) 2009, Red Hat Inc.
7 * Copyright (C) 2009, Arnaldo Carvalho de Melo <acme@redhat.com>
8 */
9#include "builtin.h"
10#include "perf.h"
11#include "util/cache.h"
12#include "util/data_map.h"
13#include "util/debug.h"
14#include "util/header.h"
15#include "util/parse-options.h"
16#include "util/symbol.h"
17
18static char const *input_name = "perf.data";
19static int force;
20
21static const char *const buildid_list_usage[] = {
22 "perf report [<options>]",
23 NULL
24};
25
26static const struct option options[] = {
27 OPT_STRING('i', "input", &input_name, "file",
28 "input file name"),
29 OPT_BOOLEAN('f', "force", &force, "don't complain, do it"),
30 OPT_BOOLEAN('v', "verbose", &verbose,
31 "be more verbose"),
32 OPT_END()
33};
34
35static int perf_file_section__process_buildids(struct perf_file_section *self,
36 int feat, int fd)
37{
38 if (feat != HEADER_BUILD_ID)
39 return 0;
40
41 if (lseek(fd, self->offset, SEEK_SET) < 0) {
42 pr_warning("Failed to lseek to %Ld offset for buildids!\n",
43 self->offset);
44 return -1;
45 }
46
47 if (perf_header__read_build_ids(fd, self->offset, self->size)) {
48 pr_warning("Failed to read buildids!\n");
49 return -1;
50 }
51
52 return 0;
53}
54
55static int __cmd_buildid_list(void)
56{
57 int err = -1;
58 struct perf_header *header;
59 struct perf_file_header f_header;
60 struct stat input_stat;
61 int input = open(input_name, O_RDONLY);
62
63 if (input < 0) {
64 pr_err("failed to open file: %s", input_name);
65 if (!strcmp(input_name, "perf.data"))
66 pr_err(" (try 'perf record' first)");
67 pr_err("\n");
68 goto out;
69 }
70
71 err = fstat(input, &input_stat);
72 if (err < 0) {
73 perror("failed to stat file");
74 goto out_close;
75 }
76
77 if (!force && input_stat.st_uid && (input_stat.st_uid != geteuid())) {
78 pr_err("file %s not owned by current user or root\n",
79 input_name);
80 goto out_close;
81 }
82
83 if (!input_stat.st_size) {
84 pr_info("zero-sized file, nothing to do!\n");
85 goto out_close;
86 }
87
88 err = -1;
89 header = perf_header__new();
90 if (header == NULL)
91 goto out_close;
92
93 if (perf_file_header__read(&f_header, header, input) < 0) {
94 pr_warning("incompatible file format");
95 goto out_close;
96 }
97
98 err = perf_header__process_sections(header, input,
99 perf_file_section__process_buildids);
100
101 if (err < 0)
102 goto out_close;
103
104 dsos__fprintf_buildid(stdout);
105out_close:
106 close(input);
107out:
108 return err;
109}
110
111int cmd_buildid_list(int argc, const char **argv, const char *prefix __used)
112{
113 argc = parse_options(argc, argv, options, buildid_list_usage, 0);
114 setup_pager();
115 return __cmd_buildid_list();
116}
diff --git a/tools/perf/builtin-help.c b/tools/perf/builtin-help.c
index 4fb8734a796e..9f810b17c25c 100644
--- a/tools/perf/builtin-help.c
+++ b/tools/perf/builtin-help.c
@@ -61,8 +61,7 @@ static const char *get_man_viewer_info(const char *name)
61{ 61{
62 struct man_viewer_info_list *viewer; 62 struct man_viewer_info_list *viewer;
63 63
64 for (viewer = man_viewer_info_list; viewer; viewer = viewer->next) 64 for (viewer = man_viewer_info_list; viewer; viewer = viewer->next) {
65 {
66 if (!strcasecmp(name, viewer->name)) 65 if (!strcasecmp(name, viewer->name))
67 return viewer->info; 66 return viewer->info;
68 } 67 }
@@ -115,7 +114,7 @@ static int check_emacsclient_version(void)
115 return 0; 114 return 0;
116} 115}
117 116
118static void exec_woman_emacs(const char* path, const char *page) 117static void exec_woman_emacs(const char *path, const char *page)
119{ 118{
120 if (!check_emacsclient_version()) { 119 if (!check_emacsclient_version()) {
121 /* This works only with emacsclient version >= 22. */ 120 /* This works only with emacsclient version >= 22. */
@@ -129,7 +128,7 @@ static void exec_woman_emacs(const char* path, const char *page)
129 } 128 }
130} 129}
131 130
132static void exec_man_konqueror(const char* path, const char *page) 131static void exec_man_konqueror(const char *path, const char *page)
133{ 132{
134 const char *display = getenv("DISPLAY"); 133 const char *display = getenv("DISPLAY");
135 if (display && *display) { 134 if (display && *display) {
@@ -157,7 +156,7 @@ static void exec_man_konqueror(const char* path, const char *page)
157 } 156 }
158} 157}
159 158
160static void exec_man_man(const char* path, const char *page) 159static void exec_man_man(const char *path, const char *page)
161{ 160{
162 if (!path) 161 if (!path)
163 path = "man"; 162 path = "man";
@@ -180,7 +179,7 @@ static void add_man_viewer(const char *name)
180 179
181 while (*p) 180 while (*p)
182 p = &((*p)->next); 181 p = &((*p)->next);
183 *p = calloc(1, (sizeof(**p) + len + 1)); 182 *p = zalloc(sizeof(**p) + len + 1);
184 strncpy((*p)->name, name, len); 183 strncpy((*p)->name, name, len);
185} 184}
186 185
@@ -195,7 +194,7 @@ static void do_add_man_viewer_info(const char *name,
195 size_t len, 194 size_t len,
196 const char *value) 195 const char *value)
197{ 196{
198 struct man_viewer_info_list *new = calloc(1, sizeof(*new) + len + 1); 197 struct man_viewer_info_list *new = zalloc(sizeof(*new) + len + 1);
199 198
200 strncpy(new->name, name, len); 199 strncpy(new->name, name, len);
201 new->info = strdup(value); 200 new->info = strdup(value);
@@ -364,9 +363,8 @@ static void show_man_page(const char *perf_cmd)
364 363
365 setup_man_path(); 364 setup_man_path();
366 for (viewer = man_viewer_list; viewer; viewer = viewer->next) 365 for (viewer = man_viewer_list; viewer; viewer = viewer->next)
367 {
368 exec_viewer(viewer->name, page); /* will return when unable */ 366 exec_viewer(viewer->name, page); /* will return when unable */
369 } 367
370 if (fallback) 368 if (fallback)
371 exec_viewer(fallback, page); 369 exec_viewer(fallback, page);
372 exec_viewer("man", page); 370 exec_viewer("man", page);
diff --git a/tools/perf/builtin-kmem.c b/tools/perf/builtin-kmem.c
new file mode 100644
index 000000000000..047fef74bd52
--- /dev/null
+++ b/tools/perf/builtin-kmem.c
@@ -0,0 +1,807 @@
1#include "builtin.h"
2#include "perf.h"
3
4#include "util/util.h"
5#include "util/cache.h"
6#include "util/symbol.h"
7#include "util/thread.h"
8#include "util/header.h"
9
10#include "util/parse-options.h"
11#include "util/trace-event.h"
12
13#include "util/debug.h"
14#include "util/data_map.h"
15
16#include <linux/rbtree.h>
17
18struct alloc_stat;
19typedef int (*sort_fn_t)(struct alloc_stat *, struct alloc_stat *);
20
21static char const *input_name = "perf.data";
22
23static struct perf_header *header;
24static u64 sample_type;
25
26static int alloc_flag;
27static int caller_flag;
28
29static int alloc_lines = -1;
30static int caller_lines = -1;
31
32static bool raw_ip;
33
34static char default_sort_order[] = "frag,hit,bytes";
35
36static int *cpunode_map;
37static int max_cpu_num;
38
39struct alloc_stat {
40 u64 call_site;
41 u64 ptr;
42 u64 bytes_req;
43 u64 bytes_alloc;
44 u32 hit;
45 u32 pingpong;
46
47 short alloc_cpu;
48
49 struct rb_node node;
50};
51
52static struct rb_root root_alloc_stat;
53static struct rb_root root_alloc_sorted;
54static struct rb_root root_caller_stat;
55static struct rb_root root_caller_sorted;
56
57static unsigned long total_requested, total_allocated;
58static unsigned long nr_allocs, nr_cross_allocs;
59
60struct raw_event_sample {
61 u32 size;
62 char data[0];
63};
64
65#define PATH_SYS_NODE "/sys/devices/system/node"
66
67static void init_cpunode_map(void)
68{
69 FILE *fp;
70 int i;
71
72 fp = fopen("/sys/devices/system/cpu/kernel_max", "r");
73 if (!fp) {
74 max_cpu_num = 4096;
75 return;
76 }
77
78 if (fscanf(fp, "%d", &max_cpu_num) < 1)
79 die("Failed to read 'kernel_max' from sysfs");
80 max_cpu_num++;
81
82 cpunode_map = calloc(max_cpu_num, sizeof(int));
83 if (!cpunode_map)
84 die("calloc");
85 for (i = 0; i < max_cpu_num; i++)
86 cpunode_map[i] = -1;
87 fclose(fp);
88}
89
90static void setup_cpunode_map(void)
91{
92 struct dirent *dent1, *dent2;
93 DIR *dir1, *dir2;
94 unsigned int cpu, mem;
95 char buf[PATH_MAX];
96
97 init_cpunode_map();
98
99 dir1 = opendir(PATH_SYS_NODE);
100 if (!dir1)
101 return;
102
103 while (true) {
104 dent1 = readdir(dir1);
105 if (!dent1)
106 break;
107
108 if (sscanf(dent1->d_name, "node%u", &mem) < 1)
109 continue;
110
111 snprintf(buf, PATH_MAX, "%s/%s", PATH_SYS_NODE, dent1->d_name);
112 dir2 = opendir(buf);
113 if (!dir2)
114 continue;
115 while (true) {
116 dent2 = readdir(dir2);
117 if (!dent2)
118 break;
119 if (sscanf(dent2->d_name, "cpu%u", &cpu) < 1)
120 continue;
121 cpunode_map[cpu] = mem;
122 }
123 }
124}
125
126static void insert_alloc_stat(unsigned long call_site, unsigned long ptr,
127 int bytes_req, int bytes_alloc, int cpu)
128{
129 struct rb_node **node = &root_alloc_stat.rb_node;
130 struct rb_node *parent = NULL;
131 struct alloc_stat *data = NULL;
132
133 while (*node) {
134 parent = *node;
135 data = rb_entry(*node, struct alloc_stat, node);
136
137 if (ptr > data->ptr)
138 node = &(*node)->rb_right;
139 else if (ptr < data->ptr)
140 node = &(*node)->rb_left;
141 else
142 break;
143 }
144
145 if (data && data->ptr == ptr) {
146 data->hit++;
147 data->bytes_req += bytes_req;
148 data->bytes_alloc += bytes_req;
149 } else {
150 data = malloc(sizeof(*data));
151 if (!data)
152 die("malloc");
153 data->ptr = ptr;
154 data->pingpong = 0;
155 data->hit = 1;
156 data->bytes_req = bytes_req;
157 data->bytes_alloc = bytes_alloc;
158
159 rb_link_node(&data->node, parent, node);
160 rb_insert_color(&data->node, &root_alloc_stat);
161 }
162 data->call_site = call_site;
163 data->alloc_cpu = cpu;
164}
165
166static void insert_caller_stat(unsigned long call_site,
167 int bytes_req, int bytes_alloc)
168{
169 struct rb_node **node = &root_caller_stat.rb_node;
170 struct rb_node *parent = NULL;
171 struct alloc_stat *data = NULL;
172
173 while (*node) {
174 parent = *node;
175 data = rb_entry(*node, struct alloc_stat, node);
176
177 if (call_site > data->call_site)
178 node = &(*node)->rb_right;
179 else if (call_site < data->call_site)
180 node = &(*node)->rb_left;
181 else
182 break;
183 }
184
185 if (data && data->call_site == call_site) {
186 data->hit++;
187 data->bytes_req += bytes_req;
188 data->bytes_alloc += bytes_req;
189 } else {
190 data = malloc(sizeof(*data));
191 if (!data)
192 die("malloc");
193 data->call_site = call_site;
194 data->pingpong = 0;
195 data->hit = 1;
196 data->bytes_req = bytes_req;
197 data->bytes_alloc = bytes_alloc;
198
199 rb_link_node(&data->node, parent, node);
200 rb_insert_color(&data->node, &root_caller_stat);
201 }
202}
203
204static void process_alloc_event(struct raw_event_sample *raw,
205 struct event *event,
206 int cpu,
207 u64 timestamp __used,
208 struct thread *thread __used,
209 int node)
210{
211 unsigned long call_site;
212 unsigned long ptr;
213 int bytes_req;
214 int bytes_alloc;
215 int node1, node2;
216
217 ptr = raw_field_value(event, "ptr", raw->data);
218 call_site = raw_field_value(event, "call_site", raw->data);
219 bytes_req = raw_field_value(event, "bytes_req", raw->data);
220 bytes_alloc = raw_field_value(event, "bytes_alloc", raw->data);
221
222 insert_alloc_stat(call_site, ptr, bytes_req, bytes_alloc, cpu);
223 insert_caller_stat(call_site, bytes_req, bytes_alloc);
224
225 total_requested += bytes_req;
226 total_allocated += bytes_alloc;
227
228 if (node) {
229 node1 = cpunode_map[cpu];
230 node2 = raw_field_value(event, "node", raw->data);
231 if (node1 != node2)
232 nr_cross_allocs++;
233 }
234 nr_allocs++;
235}
236
237static int ptr_cmp(struct alloc_stat *, struct alloc_stat *);
238static int callsite_cmp(struct alloc_stat *, struct alloc_stat *);
239
240static struct alloc_stat *search_alloc_stat(unsigned long ptr,
241 unsigned long call_site,
242 struct rb_root *root,
243 sort_fn_t sort_fn)
244{
245 struct rb_node *node = root->rb_node;
246 struct alloc_stat key = { .ptr = ptr, .call_site = call_site };
247
248 while (node) {
249 struct alloc_stat *data;
250 int cmp;
251
252 data = rb_entry(node, struct alloc_stat, node);
253
254 cmp = sort_fn(&key, data);
255 if (cmp < 0)
256 node = node->rb_left;
257 else if (cmp > 0)
258 node = node->rb_right;
259 else
260 return data;
261 }
262 return NULL;
263}
264
265static void process_free_event(struct raw_event_sample *raw,
266 struct event *event,
267 int cpu,
268 u64 timestamp __used,
269 struct thread *thread __used)
270{
271 unsigned long ptr;
272 struct alloc_stat *s_alloc, *s_caller;
273
274 ptr = raw_field_value(event, "ptr", raw->data);
275
276 s_alloc = search_alloc_stat(ptr, 0, &root_alloc_stat, ptr_cmp);
277 if (!s_alloc)
278 return;
279
280 if (cpu != s_alloc->alloc_cpu) {
281 s_alloc->pingpong++;
282
283 s_caller = search_alloc_stat(0, s_alloc->call_site,
284 &root_caller_stat, callsite_cmp);
285 assert(s_caller);
286 s_caller->pingpong++;
287 }
288 s_alloc->alloc_cpu = -1;
289}
290
291static void
292process_raw_event(event_t *raw_event __used, void *more_data,
293 int cpu, u64 timestamp, struct thread *thread)
294{
295 struct raw_event_sample *raw = more_data;
296 struct event *event;
297 int type;
298
299 type = trace_parse_common_type(raw->data);
300 event = trace_find_event(type);
301
302 if (!strcmp(event->name, "kmalloc") ||
303 !strcmp(event->name, "kmem_cache_alloc")) {
304 process_alloc_event(raw, event, cpu, timestamp, thread, 0);
305 return;
306 }
307
308 if (!strcmp(event->name, "kmalloc_node") ||
309 !strcmp(event->name, "kmem_cache_alloc_node")) {
310 process_alloc_event(raw, event, cpu, timestamp, thread, 1);
311 return;
312 }
313
314 if (!strcmp(event->name, "kfree") ||
315 !strcmp(event->name, "kmem_cache_free")) {
316 process_free_event(raw, event, cpu, timestamp, thread);
317 return;
318 }
319}
320
321static int process_sample_event(event_t *event)
322{
323 u64 ip = event->ip.ip;
324 u64 timestamp = -1;
325 u32 cpu = -1;
326 u64 period = 1;
327 void *more_data = event->ip.__more_data;
328 struct thread *thread = threads__findnew(event->ip.pid);
329
330 if (sample_type & PERF_SAMPLE_TIME) {
331 timestamp = *(u64 *)more_data;
332 more_data += sizeof(u64);
333 }
334
335 if (sample_type & PERF_SAMPLE_CPU) {
336 cpu = *(u32 *)more_data;
337 more_data += sizeof(u32);
338 more_data += sizeof(u32); /* reserved */
339 }
340
341 if (sample_type & PERF_SAMPLE_PERIOD) {
342 period = *(u64 *)more_data;
343 more_data += sizeof(u64);
344 }
345
346 dump_printf("(IP, %d): %d/%d: %p period: %Ld\n",
347 event->header.misc,
348 event->ip.pid, event->ip.tid,
349 (void *)(long)ip,
350 (long long)period);
351
352 if (thread == NULL) {
353 pr_debug("problem processing %d event, skipping it.\n",
354 event->header.type);
355 return -1;
356 }
357
358 dump_printf(" ... thread: %s:%d\n", thread->comm, thread->pid);
359
360 process_raw_event(event, more_data, cpu, timestamp, thread);
361
362 return 0;
363}
364
365static int sample_type_check(u64 type)
366{
367 sample_type = type;
368
369 if (!(sample_type & PERF_SAMPLE_RAW)) {
370 fprintf(stderr,
371 "No trace sample to read. Did you call perf record "
372 "without -R?");
373 return -1;
374 }
375
376 return 0;
377}
378
379static struct perf_file_handler file_handler = {
380 .process_sample_event = process_sample_event,
381 .process_comm_event = event__process_comm,
382 .sample_type_check = sample_type_check,
383};
384
385static int read_events(void)
386{
387 register_idle_thread();
388 register_perf_file_handler(&file_handler);
389
390 return mmap_dispatch_perf_file(&header, input_name, 0, 0,
391 &event__cwdlen, &event__cwd);
392}
393
394static double fragmentation(unsigned long n_req, unsigned long n_alloc)
395{
396 if (n_alloc == 0)
397 return 0.0;
398 else
399 return 100.0 - (100.0 * n_req / n_alloc);
400}
401
402static void __print_result(struct rb_root *root, int n_lines, int is_caller)
403{
404 struct rb_node *next;
405
406 printf("%.102s\n", graph_dotted_line);
407 printf(" %-34s |", is_caller ? "Callsite": "Alloc Ptr");
408 printf(" Total_alloc/Per | Total_req/Per | Hit | Ping-pong | Frag\n");
409 printf("%.102s\n", graph_dotted_line);
410
411 next = rb_first(root);
412
413 while (next && n_lines--) {
414 struct alloc_stat *data = rb_entry(next, struct alloc_stat,
415 node);
416 struct symbol *sym = NULL;
417 char buf[BUFSIZ];
418 u64 addr;
419
420 if (is_caller) {
421 addr = data->call_site;
422 if (!raw_ip)
423 sym = thread__find_function(kthread, addr, NULL);
424 } else
425 addr = data->ptr;
426
427 if (sym != NULL)
428 snprintf(buf, sizeof(buf), "%s+%Lx", sym->name,
429 addr - sym->start);
430 else
431 snprintf(buf, sizeof(buf), "%#Lx", addr);
432 printf(" %-34s |", buf);
433
434 printf(" %9llu/%-5lu | %9llu/%-5lu | %6lu | %8lu | %6.3f%%\n",
435 (unsigned long long)data->bytes_alloc,
436 (unsigned long)data->bytes_alloc / data->hit,
437 (unsigned long long)data->bytes_req,
438 (unsigned long)data->bytes_req / data->hit,
439 (unsigned long)data->hit,
440 (unsigned long)data->pingpong,
441 fragmentation(data->bytes_req, data->bytes_alloc));
442
443 next = rb_next(next);
444 }
445
446 if (n_lines == -1)
447 printf(" ... | ... | ... | ... | ... | ... \n");
448
449 printf("%.102s\n", graph_dotted_line);
450}
451
452static void print_summary(void)
453{
454 printf("\nSUMMARY\n=======\n");
455 printf("Total bytes requested: %lu\n", total_requested);
456 printf("Total bytes allocated: %lu\n", total_allocated);
457 printf("Total bytes wasted on internal fragmentation: %lu\n",
458 total_allocated - total_requested);
459 printf("Internal fragmentation: %f%%\n",
460 fragmentation(total_requested, total_allocated));
461 printf("Cross CPU allocations: %lu/%lu\n", nr_cross_allocs, nr_allocs);
462}
463
464static void print_result(void)
465{
466 if (caller_flag)
467 __print_result(&root_caller_sorted, caller_lines, 1);
468 if (alloc_flag)
469 __print_result(&root_alloc_sorted, alloc_lines, 0);
470 print_summary();
471}
472
473struct sort_dimension {
474 const char name[20];
475 sort_fn_t cmp;
476 struct list_head list;
477};
478
479static LIST_HEAD(caller_sort);
480static LIST_HEAD(alloc_sort);
481
482static void sort_insert(struct rb_root *root, struct alloc_stat *data,
483 struct list_head *sort_list)
484{
485 struct rb_node **new = &(root->rb_node);
486 struct rb_node *parent = NULL;
487 struct sort_dimension *sort;
488
489 while (*new) {
490 struct alloc_stat *this;
491 int cmp = 0;
492
493 this = rb_entry(*new, struct alloc_stat, node);
494 parent = *new;
495
496 list_for_each_entry(sort, sort_list, list) {
497 cmp = sort->cmp(data, this);
498 if (cmp)
499 break;
500 }
501
502 if (cmp > 0)
503 new = &((*new)->rb_left);
504 else
505 new = &((*new)->rb_right);
506 }
507
508 rb_link_node(&data->node, parent, new);
509 rb_insert_color(&data->node, root);
510}
511
512static void __sort_result(struct rb_root *root, struct rb_root *root_sorted,
513 struct list_head *sort_list)
514{
515 struct rb_node *node;
516 struct alloc_stat *data;
517
518 for (;;) {
519 node = rb_first(root);
520 if (!node)
521 break;
522
523 rb_erase(node, root);
524 data = rb_entry(node, struct alloc_stat, node);
525 sort_insert(root_sorted, data, sort_list);
526 }
527}
528
529static void sort_result(void)
530{
531 __sort_result(&root_alloc_stat, &root_alloc_sorted, &alloc_sort);
532 __sort_result(&root_caller_stat, &root_caller_sorted, &caller_sort);
533}
534
535static int __cmd_kmem(void)
536{
537 setup_pager();
538 read_events();
539 sort_result();
540 print_result();
541
542 return 0;
543}
544
545static const char * const kmem_usage[] = {
546 "perf kmem [<options>] {record}",
547 NULL
548};
549
550static int ptr_cmp(struct alloc_stat *l, struct alloc_stat *r)
551{
552 if (l->ptr < r->ptr)
553 return -1;
554 else if (l->ptr > r->ptr)
555 return 1;
556 return 0;
557}
558
559static struct sort_dimension ptr_sort_dimension = {
560 .name = "ptr",
561 .cmp = ptr_cmp,
562};
563
564static int callsite_cmp(struct alloc_stat *l, struct alloc_stat *r)
565{
566 if (l->call_site < r->call_site)
567 return -1;
568 else if (l->call_site > r->call_site)
569 return 1;
570 return 0;
571}
572
573static struct sort_dimension callsite_sort_dimension = {
574 .name = "callsite",
575 .cmp = callsite_cmp,
576};
577
578static int hit_cmp(struct alloc_stat *l, struct alloc_stat *r)
579{
580 if (l->hit < r->hit)
581 return -1;
582 else if (l->hit > r->hit)
583 return 1;
584 return 0;
585}
586
587static struct sort_dimension hit_sort_dimension = {
588 .name = "hit",
589 .cmp = hit_cmp,
590};
591
592static int bytes_cmp(struct alloc_stat *l, struct alloc_stat *r)
593{
594 if (l->bytes_alloc < r->bytes_alloc)
595 return -1;
596 else if (l->bytes_alloc > r->bytes_alloc)
597 return 1;
598 return 0;
599}
600
601static struct sort_dimension bytes_sort_dimension = {
602 .name = "bytes",
603 .cmp = bytes_cmp,
604};
605
606static int frag_cmp(struct alloc_stat *l, struct alloc_stat *r)
607{
608 double x, y;
609
610 x = fragmentation(l->bytes_req, l->bytes_alloc);
611 y = fragmentation(r->bytes_req, r->bytes_alloc);
612
613 if (x < y)
614 return -1;
615 else if (x > y)
616 return 1;
617 return 0;
618}
619
620static struct sort_dimension frag_sort_dimension = {
621 .name = "frag",
622 .cmp = frag_cmp,
623};
624
625static int pingpong_cmp(struct alloc_stat *l, struct alloc_stat *r)
626{
627 if (l->pingpong < r->pingpong)
628 return -1;
629 else if (l->pingpong > r->pingpong)
630 return 1;
631 return 0;
632}
633
634static struct sort_dimension pingpong_sort_dimension = {
635 .name = "pingpong",
636 .cmp = pingpong_cmp,
637};
638
639static struct sort_dimension *avail_sorts[] = {
640 &ptr_sort_dimension,
641 &callsite_sort_dimension,
642 &hit_sort_dimension,
643 &bytes_sort_dimension,
644 &frag_sort_dimension,
645 &pingpong_sort_dimension,
646};
647
648#define NUM_AVAIL_SORTS \
649 (int)(sizeof(avail_sorts) / sizeof(struct sort_dimension *))
650
651static int sort_dimension__add(const char *tok, struct list_head *list)
652{
653 struct sort_dimension *sort;
654 int i;
655
656 for (i = 0; i < NUM_AVAIL_SORTS; i++) {
657 if (!strcmp(avail_sorts[i]->name, tok)) {
658 sort = malloc(sizeof(*sort));
659 if (!sort)
660 die("malloc");
661 memcpy(sort, avail_sorts[i], sizeof(*sort));
662 list_add_tail(&sort->list, list);
663 return 0;
664 }
665 }
666
667 return -1;
668}
669
670static int setup_sorting(struct list_head *sort_list, const char *arg)
671{
672 char *tok;
673 char *str = strdup(arg);
674
675 if (!str)
676 die("strdup");
677
678 while (true) {
679 tok = strsep(&str, ",");
680 if (!tok)
681 break;
682 if (sort_dimension__add(tok, sort_list) < 0) {
683 error("Unknown --sort key: '%s'", tok);
684 return -1;
685 }
686 }
687
688 free(str);
689 return 0;
690}
691
692static int parse_sort_opt(const struct option *opt __used,
693 const char *arg, int unset __used)
694{
695 if (!arg)
696 return -1;
697
698 if (caller_flag > alloc_flag)
699 return setup_sorting(&caller_sort, arg);
700 else
701 return setup_sorting(&alloc_sort, arg);
702
703 return 0;
704}
705
706static int parse_stat_opt(const struct option *opt __used,
707 const char *arg, int unset __used)
708{
709 if (!arg)
710 return -1;
711
712 if (strcmp(arg, "alloc") == 0)
713 alloc_flag = (caller_flag + 1);
714 else if (strcmp(arg, "caller") == 0)
715 caller_flag = (alloc_flag + 1);
716 else
717 return -1;
718 return 0;
719}
720
721static int parse_line_opt(const struct option *opt __used,
722 const char *arg, int unset __used)
723{
724 int lines;
725
726 if (!arg)
727 return -1;
728
729 lines = strtoul(arg, NULL, 10);
730
731 if (caller_flag > alloc_flag)
732 caller_lines = lines;
733 else
734 alloc_lines = lines;
735
736 return 0;
737}
738
739static const struct option kmem_options[] = {
740 OPT_STRING('i', "input", &input_name, "file",
741 "input file name"),
742 OPT_CALLBACK(0, "stat", NULL, "<alloc>|<caller>",
743 "stat selector, Pass 'alloc' or 'caller'.",
744 parse_stat_opt),
745 OPT_CALLBACK('s', "sort", NULL, "key[,key2...]",
746 "sort by keys: ptr, call_site, bytes, hit, pingpong, frag",
747 parse_sort_opt),
748 OPT_CALLBACK('l', "line", NULL, "num",
749 "show n lins",
750 parse_line_opt),
751 OPT_BOOLEAN(0, "raw-ip", &raw_ip, "show raw ip instead of symbol"),
752 OPT_END()
753};
754
755static const char *record_args[] = {
756 "record",
757 "-a",
758 "-R",
759 "-M",
760 "-f",
761 "-c", "1",
762 "-e", "kmem:kmalloc",
763 "-e", "kmem:kmalloc_node",
764 "-e", "kmem:kfree",
765 "-e", "kmem:kmem_cache_alloc",
766 "-e", "kmem:kmem_cache_alloc_node",
767 "-e", "kmem:kmem_cache_free",
768};
769
770static int __cmd_record(int argc, const char **argv)
771{
772 unsigned int rec_argc, i, j;
773 const char **rec_argv;
774
775 rec_argc = ARRAY_SIZE(record_args) + argc - 1;
776 rec_argv = calloc(rec_argc + 1, sizeof(char *));
777
778 for (i = 0; i < ARRAY_SIZE(record_args); i++)
779 rec_argv[i] = strdup(record_args[i]);
780
781 for (j = 1; j < (unsigned int)argc; j++, i++)
782 rec_argv[i] = argv[j];
783
784 return cmd_record(i, rec_argv, NULL);
785}
786
787int cmd_kmem(int argc, const char **argv, const char *prefix __used)
788{
789 symbol__init(0);
790
791 argc = parse_options(argc, argv, kmem_options, kmem_usage, 0);
792
793 if (argc && !strncmp(argv[0], "rec", 3))
794 return __cmd_record(argc, argv);
795 else if (argc)
796 usage_with_options(kmem_usage, kmem_options);
797
798 if (list_empty(&caller_sort))
799 setup_sorting(&caller_sort, default_sort_order);
800 if (list_empty(&alloc_sort))
801 setup_sorting(&alloc_sort, default_sort_order);
802
803 setup_cpunode_map();
804
805 return __cmd_kmem();
806}
807
diff --git a/tools/perf/builtin-probe.c b/tools/perf/builtin-probe.c
new file mode 100644
index 000000000000..a58e11b7ea80
--- /dev/null
+++ b/tools/perf/builtin-probe.c
@@ -0,0 +1,242 @@
1/*
2 * builtin-probe.c
3 *
4 * Builtin probe command: Set up probe events by C expression
5 *
6 * Written by Masami Hiramatsu <mhiramat@redhat.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 as published by
10 * the Free Software Foundation; either version 2 of the License, or
11 * (at your option) any later version.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
21 *
22 */
23#define _GNU_SOURCE
24#include <sys/utsname.h>
25#include <sys/types.h>
26#include <sys/stat.h>
27#include <fcntl.h>
28#include <errno.h>
29#include <stdio.h>
30#include <unistd.h>
31#include <stdlib.h>
32#include <string.h>
33
34#undef _GNU_SOURCE
35#include "perf.h"
36#include "builtin.h"
37#include "util/util.h"
38#include "util/event.h"
39#include "util/debug.h"
40#include "util/parse-options.h"
41#include "util/parse-events.h" /* For debugfs_path */
42#include "util/probe-finder.h"
43#include "util/probe-event.h"
44
45/* Default vmlinux search paths */
46#define NR_SEARCH_PATH 3
47const char *default_search_path[NR_SEARCH_PATH] = {
48"/lib/modules/%s/build/vmlinux", /* Custom build kernel */
49"/usr/lib/debug/lib/modules/%s/vmlinux", /* Red Hat debuginfo */
50"/boot/vmlinux-debug-%s", /* Ubuntu */
51};
52
53#define MAX_PATH_LEN 256
54#define MAX_PROBES 128
55
56/* Session management structure */
57static struct {
58 char *vmlinux;
59 char *release;
60 int need_dwarf;
61 int nr_probe;
62 struct probe_point probes[MAX_PROBES];
63} session;
64
65static bool listing;
66
67/* Parse an event definition. Note that any error must die. */
68static void parse_probe_event(const char *str)
69{
70 struct probe_point *pp = &session.probes[session.nr_probe];
71
72 pr_debug("probe-definition(%d): %s\n", session.nr_probe, str);
73 if (++session.nr_probe == MAX_PROBES)
74 die("Too many probes (> %d) are specified.", MAX_PROBES);
75
76 /* Parse perf-probe event into probe_point */
77 session.need_dwarf = parse_perf_probe_event(str, pp);
78
79 pr_debug("%d arguments\n", pp->nr_args);
80}
81
82static int opt_add_probe_event(const struct option *opt __used,
83 const char *str, int unset __used)
84{
85 if (str)
86 parse_probe_event(str);
87 return 0;
88}
89
90#ifndef NO_LIBDWARF
91static int open_default_vmlinux(void)
92{
93 struct utsname uts;
94 char fname[MAX_PATH_LEN];
95 int fd, ret, i;
96
97 ret = uname(&uts);
98 if (ret) {
99 pr_debug("uname() failed.\n");
100 return -errno;
101 }
102 session.release = uts.release;
103 for (i = 0; i < NR_SEARCH_PATH; i++) {
104 ret = snprintf(fname, MAX_PATH_LEN,
105 default_search_path[i], session.release);
106 if (ret >= MAX_PATH_LEN || ret < 0) {
107 pr_debug("Filename(%d,%s) is too long.\n", i,
108 uts.release);
109 errno = E2BIG;
110 return -E2BIG;
111 }
112 pr_debug("try to open %s\n", fname);
113 fd = open(fname, O_RDONLY);
114 if (fd >= 0)
115 break;
116 }
117 return fd;
118}
119#endif
120
121static const char * const probe_usage[] = {
122 "perf probe [<options>] 'PROBEDEF' ['PROBEDEF' ...]",
123 "perf probe [<options>] --add 'PROBEDEF' [--add 'PROBEDEF' ...]",
124 "perf probe --list",
125 NULL
126};
127
128static const struct option options[] = {
129 OPT_BOOLEAN('v', "verbose", &verbose,
130 "be more verbose (show parsed arguments, etc)"),
131#ifndef NO_LIBDWARF
132 OPT_STRING('k', "vmlinux", &session.vmlinux, "file",
133 "vmlinux/module pathname"),
134#endif
135 OPT_BOOLEAN('l', "list", &listing, "list up current probes"),
136 OPT_CALLBACK('a', "add", NULL,
137#ifdef NO_LIBDWARF
138 "FUNC[+OFFS|%return] [ARG ...]",
139#else
140 "FUNC[+OFFS|%return|:RLN][@SRC]|SRC:ALN [ARG ...]",
141#endif
142 "probe point definition, where\n"
143 "\t\tGRP:\tGroup name (optional)\n"
144 "\t\tNAME:\tEvent name\n"
145 "\t\tFUNC:\tFunction name\n"
146 "\t\tOFFS:\tOffset from function entry (in byte)\n"
147 "\t\t%return:\tPut the probe at function return\n"
148#ifdef NO_LIBDWARF
149 "\t\tARG:\tProbe argument (only \n"
150#else
151 "\t\tSRC:\tSource code path\n"
152 "\t\tRLN:\tRelative line number from function entry.\n"
153 "\t\tALN:\tAbsolute line number in file.\n"
154 "\t\tARG:\tProbe argument (local variable name or\n"
155#endif
156 "\t\t\tkprobe-tracer argument format.)\n",
157 opt_add_probe_event),
158 OPT_END()
159};
160
161int cmd_probe(int argc, const char **argv, const char *prefix __used)
162{
163 int i, j, ret;
164#ifndef NO_LIBDWARF
165 int fd;
166#endif
167 struct probe_point *pp;
168
169 argc = parse_options(argc, argv, options, probe_usage,
170 PARSE_OPT_STOP_AT_NON_OPTION);
171 for (i = 0; i < argc; i++)
172 parse_probe_event(argv[i]);
173
174 if ((session.nr_probe == 0 && !listing) ||
175 (session.nr_probe != 0 && listing))
176 usage_with_options(probe_usage, options);
177
178 if (listing) {
179 show_perf_probe_events();
180 return 0;
181 }
182
183 if (session.need_dwarf)
184#ifdef NO_LIBDWARF
185 die("Debuginfo-analysis is not supported");
186#else /* !NO_LIBDWARF */
187 pr_debug("Some probes require debuginfo.\n");
188
189 if (session.vmlinux)
190 fd = open(session.vmlinux, O_RDONLY);
191 else
192 fd = open_default_vmlinux();
193 if (fd < 0) {
194 if (session.need_dwarf)
195 die("Could not open vmlinux/module file.");
196
197 pr_warning("Could not open vmlinux/module file."
198 " Try to use symbols.\n");
199 goto end_dwarf;
200 }
201
202 /* Searching probe points */
203 for (j = 0; j < session.nr_probe; j++) {
204 pp = &session.probes[j];
205 if (pp->found)
206 continue;
207
208 lseek(fd, SEEK_SET, 0);
209 ret = find_probepoint(fd, pp);
210 if (ret < 0) {
211 if (session.need_dwarf)
212 die("Could not analyze debuginfo.");
213
214 pr_warning("An error occurred in debuginfo analysis. Try to use symbols.\n");
215 break;
216 }
217 if (ret == 0) /* No error but failed to find probe point. */
218 die("No probe point found.");
219 }
220 close(fd);
221
222end_dwarf:
223#endif /* !NO_LIBDWARF */
224
225 /* Synthesize probes without dwarf */
226 for (j = 0; j < session.nr_probe; j++) {
227 pp = &session.probes[j];
228 if (pp->found) /* This probe is already found. */
229 continue;
230
231 ret = synthesize_trace_kprobe_event(pp);
232 if (ret == -E2BIG)
233 die("probe point definition becomes too long.");
234 else if (ret < 0)
235 die("Failed to synthesize a probe point.");
236 }
237
238 /* Settng up probe points */
239 add_trace_kprobe_events(session.probes, session.nr_probe);
240 return 0;
241}
242
diff --git a/tools/perf/builtin-record.c b/tools/perf/builtin-record.c
index 3eeef339c787..0e519c667e3a 100644
--- a/tools/perf/builtin-record.c
+++ b/tools/perf/builtin-record.c
@@ -17,55 +17,52 @@
17#include "util/header.h" 17#include "util/header.h"
18#include "util/event.h" 18#include "util/event.h"
19#include "util/debug.h" 19#include "util/debug.h"
20#include "util/trace-event.h" 20#include "util/symbol.h"
21 21
22#include <unistd.h> 22#include <unistd.h>
23#include <sched.h> 23#include <sched.h>
24 24
25#define ALIGN(x, a) __ALIGN_MASK(x, (typeof(x))(a)-1)
26#define __ALIGN_MASK(x, mask) (((x)+(mask))&~(mask))
27
28static int fd[MAX_NR_CPUS][MAX_COUNTERS]; 25static int fd[MAX_NR_CPUS][MAX_COUNTERS];
29 26
30static long default_interval = 100000; 27static long default_interval = 0;
31 28
32static int nr_cpus = 0; 29static int nr_cpus = 0;
33static unsigned int page_size; 30static unsigned int page_size;
34static unsigned int mmap_pages = 128; 31static unsigned int mmap_pages = 128;
35static int freq = 0; 32static int freq = 1000;
36static int output; 33static int output;
37static const char *output_name = "perf.data"; 34static const char *output_name = "perf.data";
38static int group = 0; 35static int group = 0;
39static unsigned int realtime_prio = 0; 36static unsigned int realtime_prio = 0;
40static int raw_samples = 0; 37static int raw_samples = 0;
41static int system_wide = 0; 38static int system_wide = 0;
42static int profile_cpu = -1; 39static int profile_cpu = -1;
43static pid_t target_pid = -1; 40static pid_t target_pid = -1;
44static pid_t child_pid = -1; 41static pid_t child_pid = -1;
45static int inherit = 1; 42static int inherit = 1;
46static int force = 0; 43static int force = 0;
47static int append_file = 0; 44static int append_file = 0;
48static int call_graph = 0; 45static int call_graph = 0;
49static int inherit_stat = 0; 46static int inherit_stat = 0;
50static int no_samples = 0; 47static int no_samples = 0;
51static int sample_address = 0; 48static int sample_address = 0;
52static int multiplex = 0; 49static int multiplex = 0;
53static int multiplex_fd = -1; 50static int multiplex_fd = -1;
54 51
55static long samples; 52static long samples = 0;
56static struct timeval last_read; 53static struct timeval last_read;
57static struct timeval this_read; 54static struct timeval this_read;
58 55
59static u64 bytes_written; 56static u64 bytes_written = 0;
60 57
61static struct pollfd event_array[MAX_NR_CPUS * MAX_COUNTERS]; 58static struct pollfd event_array[MAX_NR_CPUS * MAX_COUNTERS];
62 59
63static int nr_poll; 60static int nr_poll = 0;
64static int nr_cpu; 61static int nr_cpu = 0;
65 62
66static int file_new = 1; 63static int file_new = 1;
67 64
68struct perf_header *header; 65struct perf_header *header = NULL;
69 66
70struct mmap_data { 67struct mmap_data {
71 int counter; 68 int counter;
@@ -113,6 +110,24 @@ static void write_output(void *buf, size_t size)
113 } 110 }
114} 111}
115 112
113static void write_event(event_t *buf, size_t size)
114{
115 /*
116 * Add it to the list of DSOs, so that when we finish this
117 * record session we can pick the available build-ids.
118 */
119 if (buf->header.type == PERF_RECORD_MMAP)
120 dsos__findnew(buf->mmap.filename);
121
122 write_output(buf, size);
123}
124
125static int process_synthesized_event(event_t *event)
126{
127 write_event(event, event->header.size);
128 return 0;
129}
130
116static void mmap_read(struct mmap_data *md) 131static void mmap_read(struct mmap_data *md)
117{ 132{
118 unsigned int head = mmap_read_head(md); 133 unsigned int head = mmap_read_head(md);
@@ -161,14 +176,14 @@ static void mmap_read(struct mmap_data *md)
161 size = md->mask + 1 - (old & md->mask); 176 size = md->mask + 1 - (old & md->mask);
162 old += size; 177 old += size;
163 178
164 write_output(buf, size); 179 write_event(buf, size);
165 } 180 }
166 181
167 buf = &data[old & md->mask]; 182 buf = &data[old & md->mask];
168 size = head - old; 183 size = head - old;
169 old += size; 184 old += size;
170 185
171 write_output(buf, size); 186 write_event(buf, size);
172 187
173 md->prev = old; 188 md->prev = old;
174 mmap_write_tail(md, old); 189 mmap_write_tail(md, old);
@@ -195,168 +210,6 @@ static void sig_atexit(void)
195 kill(getpid(), signr); 210 kill(getpid(), signr);
196} 211}
197 212
198static pid_t pid_synthesize_comm_event(pid_t pid, int full)
199{
200 struct comm_event comm_ev;
201 char filename[PATH_MAX];
202 char bf[BUFSIZ];
203 FILE *fp;
204 size_t size = 0;
205 DIR *tasks;
206 struct dirent dirent, *next;
207 pid_t tgid = 0;
208
209 snprintf(filename, sizeof(filename), "/proc/%d/status", pid);
210
211 fp = fopen(filename, "r");
212 if (fp == NULL) {
213 /*
214 * We raced with a task exiting - just return:
215 */
216 if (verbose)
217 fprintf(stderr, "couldn't open %s\n", filename);
218 return 0;
219 }
220
221 memset(&comm_ev, 0, sizeof(comm_ev));
222 while (!comm_ev.comm[0] || !comm_ev.pid) {
223 if (fgets(bf, sizeof(bf), fp) == NULL)
224 goto out_failure;
225
226 if (memcmp(bf, "Name:", 5) == 0) {
227 char *name = bf + 5;
228 while (*name && isspace(*name))
229 ++name;
230 size = strlen(name) - 1;
231 memcpy(comm_ev.comm, name, size++);
232 } else if (memcmp(bf, "Tgid:", 5) == 0) {
233 char *tgids = bf + 5;
234 while (*tgids && isspace(*tgids))
235 ++tgids;
236 tgid = comm_ev.pid = atoi(tgids);
237 }
238 }
239
240 comm_ev.header.type = PERF_RECORD_COMM;
241 size = ALIGN(size, sizeof(u64));
242 comm_ev.header.size = sizeof(comm_ev) - (sizeof(comm_ev.comm) - size);
243
244 if (!full) {
245 comm_ev.tid = pid;
246
247 write_output(&comm_ev, comm_ev.header.size);
248 goto out_fclose;
249 }
250
251 snprintf(filename, sizeof(filename), "/proc/%d/task", pid);
252
253 tasks = opendir(filename);
254 while (!readdir_r(tasks, &dirent, &next) && next) {
255 char *end;
256 pid = strtol(dirent.d_name, &end, 10);
257 if (*end)
258 continue;
259
260 comm_ev.tid = pid;
261
262 write_output(&comm_ev, comm_ev.header.size);
263 }
264 closedir(tasks);
265
266out_fclose:
267 fclose(fp);
268 return tgid;
269
270out_failure:
271 fprintf(stderr, "couldn't get COMM and pgid, malformed %s\n",
272 filename);
273 exit(EXIT_FAILURE);
274}
275
276static void pid_synthesize_mmap_samples(pid_t pid, pid_t tgid)
277{
278 char filename[PATH_MAX];
279 FILE *fp;
280
281 snprintf(filename, sizeof(filename), "/proc/%d/maps", pid);
282
283 fp = fopen(filename, "r");
284 if (fp == NULL) {
285 /*
286 * We raced with a task exiting - just return:
287 */
288 if (verbose)
289 fprintf(stderr, "couldn't open %s\n", filename);
290 return;
291 }
292 while (1) {
293 char bf[BUFSIZ], *pbf = bf;
294 struct mmap_event mmap_ev = {
295 .header = { .type = PERF_RECORD_MMAP },
296 };
297 int n;
298 size_t size;
299 if (fgets(bf, sizeof(bf), fp) == NULL)
300 break;
301
302 /* 00400000-0040c000 r-xp 00000000 fd:01 41038 /bin/cat */
303 n = hex2u64(pbf, &mmap_ev.start);
304 if (n < 0)
305 continue;
306 pbf += n + 1;
307 n = hex2u64(pbf, &mmap_ev.len);
308 if (n < 0)
309 continue;
310 pbf += n + 3;
311 if (*pbf == 'x') { /* vm_exec */
312 char *execname = strchr(bf, '/');
313
314 /* Catch VDSO */
315 if (execname == NULL)
316 execname = strstr(bf, "[vdso]");
317
318 if (execname == NULL)
319 continue;
320
321 size = strlen(execname);
322 execname[size - 1] = '\0'; /* Remove \n */
323 memcpy(mmap_ev.filename, execname, size);
324 size = ALIGN(size, sizeof(u64));
325 mmap_ev.len -= mmap_ev.start;
326 mmap_ev.header.size = (sizeof(mmap_ev) -
327 (sizeof(mmap_ev.filename) - size));
328 mmap_ev.pid = tgid;
329 mmap_ev.tid = pid;
330
331 write_output(&mmap_ev, mmap_ev.header.size);
332 }
333 }
334
335 fclose(fp);
336}
337
338static void synthesize_all(void)
339{
340 DIR *proc;
341 struct dirent dirent, *next;
342
343 proc = opendir("/proc");
344
345 while (!readdir_r(proc, &dirent, &next) && next) {
346 char *end;
347 pid_t pid, tgid;
348
349 pid = strtol(dirent.d_name, &end, 10);
350 if (*end) /* only interested in proper numerical dirents */
351 continue;
352
353 tgid = pid_synthesize_comm_event(pid, 1);
354 pid_synthesize_mmap_samples(pid, tgid);
355 }
356
357 closedir(proc);
358}
359
360static int group_fd; 213static int group_fd;
361 214
362static struct perf_header_attr *get_header_attr(struct perf_event_attr *a, int nr) 215static struct perf_header_attr *get_header_attr(struct perf_event_attr *a, int nr)
@@ -367,7 +220,11 @@ static struct perf_header_attr *get_header_attr(struct perf_event_attr *a, int n
367 h_attr = header->attr[nr]; 220 h_attr = header->attr[nr];
368 } else { 221 } else {
369 h_attr = perf_header_attr__new(a); 222 h_attr = perf_header_attr__new(a);
370 perf_header__add_attr(header, h_attr); 223 if (h_attr != NULL)
224 if (perf_header__add_attr(header, h_attr) < 0) {
225 perf_header_attr__delete(h_attr);
226 h_attr = NULL;
227 }
371 } 228 }
372 229
373 return h_attr; 230 return h_attr;
@@ -375,9 +232,11 @@ static struct perf_header_attr *get_header_attr(struct perf_event_attr *a, int n
375 232
376static void create_counter(int counter, int cpu, pid_t pid) 233static void create_counter(int counter, int cpu, pid_t pid)
377{ 234{
235 char *filter = filters[counter];
378 struct perf_event_attr *attr = attrs + counter; 236 struct perf_event_attr *attr = attrs + counter;
379 struct perf_header_attr *h_attr; 237 struct perf_header_attr *h_attr;
380 int track = !counter; /* only the first counter needs these */ 238 int track = !counter; /* only the first counter needs these */
239 int ret;
381 struct { 240 struct {
382 u64 count; 241 u64 count;
383 u64 time_enabled; 242 u64 time_enabled;
@@ -426,7 +285,7 @@ try_again:
426 if (fd[nr_cpu][counter] < 0) { 285 if (fd[nr_cpu][counter] < 0) {
427 int err = errno; 286 int err = errno;
428 287
429 if (err == EPERM) 288 if (err == EPERM || err == EACCES)
430 die("Permission error - are you root?\n"); 289 die("Permission error - are you root?\n");
431 else if (err == ENODEV && profile_cpu != -1) 290 else if (err == ENODEV && profile_cpu != -1)
432 die("No such device - did you specify an out-of-range profile CPU?\n"); 291 die("No such device - did you specify an out-of-range profile CPU?\n");
@@ -448,11 +307,19 @@ try_again:
448 printf("\n"); 307 printf("\n");
449 error("perfcounter syscall returned with %d (%s)\n", 308 error("perfcounter syscall returned with %d (%s)\n",
450 fd[nr_cpu][counter], strerror(err)); 309 fd[nr_cpu][counter], strerror(err));
310
311#if defined(__i386__) || defined(__x86_64__)
312 if (attr->type == PERF_TYPE_HARDWARE && err == EOPNOTSUPP)
313 die("No hardware sampling interrupt available. No APIC? If so then you can boot the kernel with the \"lapic\" boot parameter to force-enable it.\n");
314#endif
315
451 die("No CONFIG_PERF_EVENTS=y kernel support configured?\n"); 316 die("No CONFIG_PERF_EVENTS=y kernel support configured?\n");
452 exit(-1); 317 exit(-1);
453 } 318 }
454 319
455 h_attr = get_header_attr(attr, counter); 320 h_attr = get_header_attr(attr, counter);
321 if (h_attr == NULL)
322 die("nomem\n");
456 323
457 if (!file_new) { 324 if (!file_new) {
458 if (memcmp(&h_attr->attr, attr, sizeof(*attr))) { 325 if (memcmp(&h_attr->attr, attr, sizeof(*attr))) {
@@ -466,7 +333,10 @@ try_again:
466 exit(-1); 333 exit(-1);
467 } 334 }
468 335
469 perf_header_attr__add_id(h_attr, read_data.id); 336 if (perf_header_attr__add_id(h_attr, read_data.id) < 0) {
337 pr_warning("Not enough memory to add id\n");
338 exit(-1);
339 }
470 340
471 assert(fd[nr_cpu][counter] >= 0); 341 assert(fd[nr_cpu][counter] >= 0);
472 fcntl(fd[nr_cpu][counter], F_SETFL, O_NONBLOCK); 342 fcntl(fd[nr_cpu][counter], F_SETFL, O_NONBLOCK);
@@ -480,7 +350,6 @@ try_again:
480 multiplex_fd = fd[nr_cpu][counter]; 350 multiplex_fd = fd[nr_cpu][counter];
481 351
482 if (multiplex && fd[nr_cpu][counter] != multiplex_fd) { 352 if (multiplex && fd[nr_cpu][counter] != multiplex_fd) {
483 int ret;
484 353
485 ret = ioctl(fd[nr_cpu][counter], PERF_EVENT_IOC_SET_OUTPUT, multiplex_fd); 354 ret = ioctl(fd[nr_cpu][counter], PERF_EVENT_IOC_SET_OUTPUT, multiplex_fd);
486 assert(ret != -1); 355 assert(ret != -1);
@@ -500,6 +369,16 @@ try_again:
500 } 369 }
501 } 370 }
502 371
372 if (filter != NULL) {
373 ret = ioctl(fd[nr_cpu][counter],
374 PERF_EVENT_IOC_SET_FILTER, filter);
375 if (ret) {
376 error("failed to set filter with %d (%s)\n", errno,
377 strerror(errno));
378 exit(-1);
379 }
380 }
381
503 ioctl(fd[nr_cpu][counter], PERF_EVENT_IOC_ENABLE); 382 ioctl(fd[nr_cpu][counter], PERF_EVENT_IOC_ENABLE);
504} 383}
505 384
@@ -518,7 +397,7 @@ static void atexit_header(void)
518{ 397{
519 header->data_size += bytes_written; 398 header->data_size += bytes_written;
520 399
521 perf_header__write(header, output); 400 perf_header__write(header, output, true);
522} 401}
523 402
524static int __cmd_record(int argc, const char **argv) 403static int __cmd_record(int argc, const char **argv)
@@ -527,7 +406,7 @@ static int __cmd_record(int argc, const char **argv)
527 struct stat st; 406 struct stat st;
528 pid_t pid = 0; 407 pid_t pid = 0;
529 int flags; 408 int flags;
530 int ret; 409 int err;
531 unsigned long waking = 0; 410 unsigned long waking = 0;
532 411
533 page_size = sysconf(_SC_PAGE_SIZE); 412 page_size = sysconf(_SC_PAGE_SIZE);
@@ -561,22 +440,29 @@ static int __cmd_record(int argc, const char **argv)
561 exit(-1); 440 exit(-1);
562 } 441 }
563 442
564 if (!file_new) 443 header = perf_header__new();
565 header = perf_header__read(output); 444 if (header == NULL) {
566 else 445 pr_err("Not enough memory for reading perf file header\n");
567 header = perf_header__new(); 446 return -1;
447 }
568 448
449 if (!file_new) {
450 err = perf_header__read(header, output);
451 if (err < 0)
452 return err;
453 }
569 454
570 if (raw_samples) { 455 if (raw_samples) {
571 read_tracing_data(attrs, nr_counters); 456 perf_header__set_feat(header, HEADER_TRACE_INFO);
572 } else { 457 } else {
573 for (i = 0; i < nr_counters; i++) { 458 for (i = 0; i < nr_counters; i++) {
574 if (attrs[i].sample_type & PERF_SAMPLE_RAW) { 459 if (attrs[i].sample_type & PERF_SAMPLE_RAW) {
575 read_tracing_data(attrs, nr_counters); 460 perf_header__set_feat(header, HEADER_TRACE_INFO);
576 break; 461 break;
577 } 462 }
578 } 463 }
579 } 464 }
465
580 atexit(atexit_header); 466 atexit(atexit_header);
581 467
582 if (!system_wide) { 468 if (!system_wide) {
@@ -594,25 +480,36 @@ static int __cmd_record(int argc, const char **argv)
594 } 480 }
595 } 481 }
596 482
597 if (file_new) 483 if (file_new) {
598 perf_header__write(header, output); 484 err = perf_header__write(header, output, false);
485 if (err < 0)
486 return err;
487 }
599 488
600 if (!system_wide) { 489 if (!system_wide)
601 pid_t tgid = pid_synthesize_comm_event(pid, 0); 490 event__synthesize_thread(pid, process_synthesized_event);
602 pid_synthesize_mmap_samples(pid, tgid); 491 else
603 } else 492 event__synthesize_threads(process_synthesized_event);
604 synthesize_all();
605 493
606 if (target_pid == -1 && argc) { 494 if (target_pid == -1 && argc) {
607 pid = fork(); 495 pid = fork();
608 if (pid < 0) 496 if (pid < 0)
609 perror("failed to fork"); 497 die("failed to fork");
610 498
611 if (!pid) { 499 if (!pid) {
612 if (execvp(argv[0], (char **)argv)) { 500 if (execvp(argv[0], (char **)argv)) {
613 perror(argv[0]); 501 perror(argv[0]);
614 exit(-1); 502 exit(-1);
615 } 503 }
504 } else {
505 /*
506 * Wait a bit for the execv'ed child to appear
507 * and be updated in /proc
508 * FIXME: Do you know a less heuristical solution?
509 */
510 usleep(1000);
511 event__synthesize_thread(pid,
512 process_synthesized_event);
616 } 513 }
617 514
618 child_pid = pid; 515 child_pid = pid;
@@ -623,7 +520,7 @@ static int __cmd_record(int argc, const char **argv)
623 520
624 param.sched_priority = realtime_prio; 521 param.sched_priority = realtime_prio;
625 if (sched_setscheduler(0, SCHED_FIFO, &param)) { 522 if (sched_setscheduler(0, SCHED_FIFO, &param)) {
626 printf("Could not set realtime priority.\n"); 523 pr_err("Could not set realtime priority.\n");
627 exit(-1); 524 exit(-1);
628 } 525 }
629 } 526 }
@@ -641,7 +538,7 @@ static int __cmd_record(int argc, const char **argv)
641 if (hits == samples) { 538 if (hits == samples) {
642 if (done) 539 if (done)
643 break; 540 break;
644 ret = poll(event_array, nr_poll, -1); 541 err = poll(event_array, nr_poll, -1);
645 waking++; 542 waking++;
646 } 543 }
647 544
@@ -677,6 +574,8 @@ static const struct option options[] = {
677 OPT_CALLBACK('e', "event", NULL, "event", 574 OPT_CALLBACK('e', "event", NULL, "event",
678 "event selector. use 'perf list' to list available events", 575 "event selector. use 'perf list' to list available events",
679 parse_events), 576 parse_events),
577 OPT_CALLBACK(0, "filter", NULL, "filter",
578 "event filter", parse_filter),
680 OPT_INTEGER('p', "pid", &target_pid, 579 OPT_INTEGER('p', "pid", &target_pid,
681 "record events on existing pid"), 580 "record events on existing pid"),
682 OPT_INTEGER('r', "realtime", &realtime_prio, 581 OPT_INTEGER('r', "realtime", &realtime_prio,
@@ -720,6 +619,8 @@ int cmd_record(int argc, const char **argv, const char *prefix __used)
720{ 619{
721 int counter; 620 int counter;
722 621
622 symbol__init(0);
623
723 argc = parse_options(argc, argv, options, record_usage, 624 argc = parse_options(argc, argv, options, record_usage,
724 PARSE_OPT_STOP_AT_NON_OPTION); 625 PARSE_OPT_STOP_AT_NON_OPTION);
725 if (!argc && target_pid == -1 && !system_wide) 626 if (!argc && target_pid == -1 && !system_wide)
@@ -731,6 +632,18 @@ int cmd_record(int argc, const char **argv, const char *prefix __used)
731 attrs[0].config = PERF_COUNT_HW_CPU_CYCLES; 632 attrs[0].config = PERF_COUNT_HW_CPU_CYCLES;
732 } 633 }
733 634
635 /*
636 * User specified count overrides default frequency.
637 */
638 if (default_interval)
639 freq = 0;
640 else if (freq) {
641 default_interval = freq;
642 } else {
643 fprintf(stderr, "frequency and count are zero, aborting\n");
644 exit(EXIT_FAILURE);
645 }
646
734 for (counter = 0; counter < nr_counters; counter++) { 647 for (counter = 0; counter < nr_counters; counter++) {
735 if (attrs[counter].sample_period) 648 if (attrs[counter].sample_period)
736 continue; 649 continue;
diff --git a/tools/perf/builtin-report.c b/tools/perf/builtin-report.c
index 19669c20088e..383c4ab4f9af 100644
--- a/tools/perf/builtin-report.c
+++ b/tools/perf/builtin-report.c
@@ -26,20 +26,18 @@
26#include "util/parse-options.h" 26#include "util/parse-options.h"
27#include "util/parse-events.h" 27#include "util/parse-events.h"
28 28
29#include "util/data_map.h"
29#include "util/thread.h" 30#include "util/thread.h"
31#include "util/sort.h"
32#include "util/hist.h"
30 33
31static char const *input_name = "perf.data"; 34static char const *input_name = "perf.data";
32 35
33static char default_sort_order[] = "comm,dso,symbol";
34static char *sort_order = default_sort_order;
35static char *dso_list_str, *comm_list_str, *sym_list_str, 36static char *dso_list_str, *comm_list_str, *sym_list_str,
36 *col_width_list_str; 37 *col_width_list_str;
37static struct strlist *dso_list, *comm_list, *sym_list; 38static struct strlist *dso_list, *comm_list, *sym_list;
38static char *field_sep;
39 39
40static int force; 40static int force;
41static int input;
42static int show_mask = SHOW_KERNEL | SHOW_USER | SHOW_HV;
43 41
44static int full_paths; 42static int full_paths;
45static int show_nr_samples; 43static int show_nr_samples;
@@ -50,374 +48,38 @@ static struct perf_read_values show_threads_values;
50static char default_pretty_printing_style[] = "normal"; 48static char default_pretty_printing_style[] = "normal";
51static char *pretty_printing_style = default_pretty_printing_style; 49static char *pretty_printing_style = default_pretty_printing_style;
52 50
53static unsigned long page_size;
54static unsigned long mmap_window = 32;
55
56static char default_parent_pattern[] = "^sys_|^do_page_fault";
57static char *parent_pattern = default_parent_pattern;
58static regex_t parent_regex;
59
60static int exclude_other = 1; 51static int exclude_other = 1;
61 52
62static char callchain_default_opt[] = "fractal,0.5"; 53static char callchain_default_opt[] = "fractal,0.5";
63 54
64static int callchain;
65
66static char __cwd[PATH_MAX];
67static char *cwd = __cwd;
68static int cwdlen;
69
70static struct rb_root threads;
71static struct thread *last_match;
72
73static struct perf_header *header; 55static struct perf_header *header;
74 56
75static
76struct callchain_param callchain_param = {
77 .mode = CHAIN_GRAPH_REL,
78 .min_percent = 0.5
79};
80
81static u64 sample_type; 57static u64 sample_type;
82 58
83static int repsep_fprintf(FILE *fp, const char *fmt, ...) 59struct symbol_conf symbol_conf;
84{
85 int n;
86 va_list ap;
87
88 va_start(ap, fmt);
89 if (!field_sep)
90 n = vfprintf(fp, fmt, ap);
91 else {
92 char *bf = NULL;
93 n = vasprintf(&bf, fmt, ap);
94 if (n > 0) {
95 char *sep = bf;
96
97 while (1) {
98 sep = strchr(sep, *field_sep);
99 if (sep == NULL)
100 break;
101 *sep = '.';
102 }
103 }
104 fputs(bf, fp);
105 free(bf);
106 }
107 va_end(ap);
108 return n;
109}
110
111static unsigned int dsos__col_width,
112 comms__col_width,
113 threads__col_width;
114 60
115/*
116 * histogram, sorted on item, collects counts
117 */
118
119static struct rb_root hist;
120
121struct hist_entry {
122 struct rb_node rb_node;
123
124 struct thread *thread;
125 struct map *map;
126 struct dso *dso;
127 struct symbol *sym;
128 struct symbol *parent;
129 u64 ip;
130 char level;
131 struct callchain_node callchain;
132 struct rb_root sorted_chain;
133
134 u64 count;
135};
136
137/*
138 * configurable sorting bits
139 */
140
141struct sort_entry {
142 struct list_head list;
143
144 const char *header;
145
146 int64_t (*cmp)(struct hist_entry *, struct hist_entry *);
147 int64_t (*collapse)(struct hist_entry *, struct hist_entry *);
148 size_t (*print)(FILE *fp, struct hist_entry *, unsigned int width);
149 unsigned int *width;
150 bool elide;
151};
152
153static int64_t cmp_null(void *l, void *r)
154{
155 if (!l && !r)
156 return 0;
157 else if (!l)
158 return -1;
159 else
160 return 1;
161}
162
163/* --sort pid */
164
165static int64_t
166sort__thread_cmp(struct hist_entry *left, struct hist_entry *right)
167{
168 return right->thread->pid - left->thread->pid;
169}
170 61
171static size_t 62static size_t
172sort__thread_print(FILE *fp, struct hist_entry *self, unsigned int width) 63callchain__fprintf_left_margin(FILE *fp, int left_margin)
173{ 64{
174 return repsep_fprintf(fp, "%*s:%5d", width - 6, 65 int i;
175 self->thread->comm ?: "", self->thread->pid); 66 int ret;
176}
177
178static struct sort_entry sort_thread = {
179 .header = "Command: Pid",
180 .cmp = sort__thread_cmp,
181 .print = sort__thread_print,
182 .width = &threads__col_width,
183};
184
185/* --sort comm */
186
187static int64_t
188sort__comm_cmp(struct hist_entry *left, struct hist_entry *right)
189{
190 return right->thread->pid - left->thread->pid;
191}
192
193static int64_t
194sort__comm_collapse(struct hist_entry *left, struct hist_entry *right)
195{
196 char *comm_l = left->thread->comm;
197 char *comm_r = right->thread->comm;
198
199 if (!comm_l || !comm_r)
200 return cmp_null(comm_l, comm_r);
201
202 return strcmp(comm_l, comm_r);
203}
204
205static size_t
206sort__comm_print(FILE *fp, struct hist_entry *self, unsigned int width)
207{
208 return repsep_fprintf(fp, "%*s", width, self->thread->comm);
209}
210
211static struct sort_entry sort_comm = {
212 .header = "Command",
213 .cmp = sort__comm_cmp,
214 .collapse = sort__comm_collapse,
215 .print = sort__comm_print,
216 .width = &comms__col_width,
217};
218
219/* --sort dso */
220
221static int64_t
222sort__dso_cmp(struct hist_entry *left, struct hist_entry *right)
223{
224 struct dso *dso_l = left->dso;
225 struct dso *dso_r = right->dso;
226
227 if (!dso_l || !dso_r)
228 return cmp_null(dso_l, dso_r);
229
230 return strcmp(dso_l->name, dso_r->name);
231}
232
233static size_t
234sort__dso_print(FILE *fp, struct hist_entry *self, unsigned int width)
235{
236 if (self->dso)
237 return repsep_fprintf(fp, "%-*s", width, self->dso->name);
238
239 return repsep_fprintf(fp, "%*llx", width, (u64)self->ip);
240}
241
242static struct sort_entry sort_dso = {
243 .header = "Shared Object",
244 .cmp = sort__dso_cmp,
245 .print = sort__dso_print,
246 .width = &dsos__col_width,
247};
248
249/* --sort symbol */
250
251static int64_t
252sort__sym_cmp(struct hist_entry *left, struct hist_entry *right)
253{
254 u64 ip_l, ip_r;
255
256 if (left->sym == right->sym)
257 return 0;
258
259 ip_l = left->sym ? left->sym->start : left->ip;
260 ip_r = right->sym ? right->sym->start : right->ip;
261
262 return (int64_t)(ip_r - ip_l);
263}
264
265static size_t
266sort__sym_print(FILE *fp, struct hist_entry *self, unsigned int width __used)
267{
268 size_t ret = 0;
269 67
270 if (verbose) 68 ret = fprintf(fp, " ");
271 ret += repsep_fprintf(fp, "%#018llx %c ", (u64)self->ip,
272 dso__symtab_origin(self->dso));
273 69
274 ret += repsep_fprintf(fp, "[%c] ", self->level); 70 for (i = 0; i < left_margin; i++)
275 if (self->sym) { 71 ret += fprintf(fp, " ");
276 ret += repsep_fprintf(fp, "%s", self->sym->name);
277
278 if (self->sym->module)
279 ret += repsep_fprintf(fp, "\t[%s]",
280 self->sym->module->name);
281 } else {
282 ret += repsep_fprintf(fp, "%#016llx", (u64)self->ip);
283 }
284 72
285 return ret; 73 return ret;
286} 74}
287 75
288static struct sort_entry sort_sym = { 76static size_t ipchain__fprintf_graph_line(FILE *fp, int depth, int depth_mask,
289 .header = "Symbol", 77 int left_margin)
290 .cmp = sort__sym_cmp,
291 .print = sort__sym_print,
292};
293
294/* --sort parent */
295
296static int64_t
297sort__parent_cmp(struct hist_entry *left, struct hist_entry *right)
298{
299 struct symbol *sym_l = left->parent;
300 struct symbol *sym_r = right->parent;
301
302 if (!sym_l || !sym_r)
303 return cmp_null(sym_l, sym_r);
304
305 return strcmp(sym_l->name, sym_r->name);
306}
307
308static size_t
309sort__parent_print(FILE *fp, struct hist_entry *self, unsigned int width)
310{
311 return repsep_fprintf(fp, "%-*s", width,
312 self->parent ? self->parent->name : "[other]");
313}
314
315static unsigned int parent_symbol__col_width;
316
317static struct sort_entry sort_parent = {
318 .header = "Parent symbol",
319 .cmp = sort__parent_cmp,
320 .print = sort__parent_print,
321 .width = &parent_symbol__col_width,
322};
323
324static int sort__need_collapse = 0;
325static int sort__has_parent = 0;
326
327struct sort_dimension {
328 const char *name;
329 struct sort_entry *entry;
330 int taken;
331};
332
333static struct sort_dimension sort_dimensions[] = {
334 { .name = "pid", .entry = &sort_thread, },
335 { .name = "comm", .entry = &sort_comm, },
336 { .name = "dso", .entry = &sort_dso, },
337 { .name = "symbol", .entry = &sort_sym, },
338 { .name = "parent", .entry = &sort_parent, },
339};
340
341static LIST_HEAD(hist_entry__sort_list);
342
343static int sort_dimension__add(const char *tok)
344{
345 unsigned int i;
346
347 for (i = 0; i < ARRAY_SIZE(sort_dimensions); i++) {
348 struct sort_dimension *sd = &sort_dimensions[i];
349
350 if (sd->taken)
351 continue;
352
353 if (strncasecmp(tok, sd->name, strlen(tok)))
354 continue;
355
356 if (sd->entry->collapse)
357 sort__need_collapse = 1;
358
359 if (sd->entry == &sort_parent) {
360 int ret = regcomp(&parent_regex, parent_pattern, REG_EXTENDED);
361 if (ret) {
362 char err[BUFSIZ];
363
364 regerror(ret, &parent_regex, err, sizeof(err));
365 fprintf(stderr, "Invalid regex: %s\n%s",
366 parent_pattern, err);
367 exit(-1);
368 }
369 sort__has_parent = 1;
370 }
371
372 list_add_tail(&sd->entry->list, &hist_entry__sort_list);
373 sd->taken = 1;
374
375 return 0;
376 }
377
378 return -ESRCH;
379}
380
381static int64_t
382hist_entry__cmp(struct hist_entry *left, struct hist_entry *right)
383{
384 struct sort_entry *se;
385 int64_t cmp = 0;
386
387 list_for_each_entry(se, &hist_entry__sort_list, list) {
388 cmp = se->cmp(left, right);
389 if (cmp)
390 break;
391 }
392
393 return cmp;
394}
395
396static int64_t
397hist_entry__collapse(struct hist_entry *left, struct hist_entry *right)
398{
399 struct sort_entry *se;
400 int64_t cmp = 0;
401
402 list_for_each_entry(se, &hist_entry__sort_list, list) {
403 int64_t (*f)(struct hist_entry *, struct hist_entry *);
404
405 f = se->collapse ?: se->cmp;
406
407 cmp = f(left, right);
408 if (cmp)
409 break;
410 }
411
412 return cmp;
413}
414
415static size_t ipchain__fprintf_graph_line(FILE *fp, int depth, int depth_mask)
416{ 78{
417 int i; 79 int i;
418 size_t ret = 0; 80 size_t ret = 0;
419 81
420 ret += fprintf(fp, "%s", " "); 82 ret += callchain__fprintf_left_margin(fp, left_margin);
421 83
422 for (i = 0; i < depth; i++) 84 for (i = 0; i < depth; i++)
423 if (depth_mask & (1 << i)) 85 if (depth_mask & (1 << i))
@@ -432,12 +94,12 @@ static size_t ipchain__fprintf_graph_line(FILE *fp, int depth, int depth_mask)
432static size_t 94static size_t
433ipchain__fprintf_graph(FILE *fp, struct callchain_list *chain, int depth, 95ipchain__fprintf_graph(FILE *fp, struct callchain_list *chain, int depth,
434 int depth_mask, int count, u64 total_samples, 96 int depth_mask, int count, u64 total_samples,
435 int hits) 97 int hits, int left_margin)
436{ 98{
437 int i; 99 int i;
438 size_t ret = 0; 100 size_t ret = 0;
439 101
440 ret += fprintf(fp, "%s", " "); 102 ret += callchain__fprintf_left_margin(fp, left_margin);
441 for (i = 0; i < depth; i++) { 103 for (i = 0; i < depth; i++) {
442 if (depth_mask & (1 << i)) 104 if (depth_mask & (1 << i))
443 ret += fprintf(fp, "|"); 105 ret += fprintf(fp, "|");
@@ -475,8 +137,9 @@ static void init_rem_hits(void)
475} 137}
476 138
477static size_t 139static size_t
478callchain__fprintf_graph(FILE *fp, struct callchain_node *self, 140__callchain__fprintf_graph(FILE *fp, struct callchain_node *self,
479 u64 total_samples, int depth, int depth_mask) 141 u64 total_samples, int depth, int depth_mask,
142 int left_margin)
480{ 143{
481 struct rb_node *node, *next; 144 struct rb_node *node, *next;
482 struct callchain_node *child; 145 struct callchain_node *child;
@@ -517,7 +180,8 @@ callchain__fprintf_graph(FILE *fp, struct callchain_node *self,
517 * But we keep the older depth mask for the line seperator 180 * But we keep the older depth mask for the line seperator
518 * to keep the level link until we reach the last child 181 * to keep the level link until we reach the last child
519 */ 182 */
520 ret += ipchain__fprintf_graph_line(fp, depth, depth_mask); 183 ret += ipchain__fprintf_graph_line(fp, depth, depth_mask,
184 left_margin);
521 i = 0; 185 i = 0;
522 list_for_each_entry(chain, &child->val, list) { 186 list_for_each_entry(chain, &child->val, list) {
523 if (chain->ip >= PERF_CONTEXT_MAX) 187 if (chain->ip >= PERF_CONTEXT_MAX)
@@ -525,11 +189,13 @@ callchain__fprintf_graph(FILE *fp, struct callchain_node *self,
525 ret += ipchain__fprintf_graph(fp, chain, depth, 189 ret += ipchain__fprintf_graph(fp, chain, depth,
526 new_depth_mask, i++, 190 new_depth_mask, i++,
527 new_total, 191 new_total,
528 cumul); 192 cumul,
193 left_margin);
529 } 194 }
530 ret += callchain__fprintf_graph(fp, child, new_total, 195 ret += __callchain__fprintf_graph(fp, child, new_total,
531 depth + 1, 196 depth + 1,
532 new_depth_mask | (1 << depth)); 197 new_depth_mask | (1 << depth),
198 left_margin);
533 node = next; 199 node = next;
534 } 200 }
535 201
@@ -543,9 +209,48 @@ callchain__fprintf_graph(FILE *fp, struct callchain_node *self,
543 209
544 ret += ipchain__fprintf_graph(fp, &rem_hits, depth, 210 ret += ipchain__fprintf_graph(fp, &rem_hits, depth,
545 new_depth_mask, 0, new_total, 211 new_depth_mask, 0, new_total,
546 remaining); 212 remaining, left_margin);
213 }
214
215 return ret;
216}
217
218
219static size_t
220callchain__fprintf_graph(FILE *fp, struct callchain_node *self,
221 u64 total_samples, int left_margin)
222{
223 struct callchain_list *chain;
224 bool printed = false;
225 int i = 0;
226 int ret = 0;
227
228 list_for_each_entry(chain, &self->val, list) {
229 if (chain->ip >= PERF_CONTEXT_MAX)
230 continue;
231
232 if (!i++ && sort__first_dimension == SORT_SYM)
233 continue;
234
235 if (!printed) {
236 ret += callchain__fprintf_left_margin(fp, left_margin);
237 ret += fprintf(fp, "|\n");
238 ret += callchain__fprintf_left_margin(fp, left_margin);
239 ret += fprintf(fp, "---");
240
241 left_margin += 3;
242 printed = true;
243 } else
244 ret += callchain__fprintf_left_margin(fp, left_margin);
245
246 if (chain->sym)
247 ret += fprintf(fp, " %s\n", chain->sym->name);
248 else
249 ret += fprintf(fp, " %p\n", (void *)(long)chain->ip);
547 } 250 }
548 251
252 ret += __callchain__fprintf_graph(fp, self, total_samples, 1, 1, left_margin);
253
549 return ret; 254 return ret;
550} 255}
551 256
@@ -577,7 +282,7 @@ callchain__fprintf_flat(FILE *fp, struct callchain_node *self,
577 282
578static size_t 283static size_t
579hist_entry_callchain__fprintf(FILE *fp, struct hist_entry *self, 284hist_entry_callchain__fprintf(FILE *fp, struct hist_entry *self,
580 u64 total_samples) 285 u64 total_samples, int left_margin)
581{ 286{
582 struct rb_node *rb_node; 287 struct rb_node *rb_node;
583 struct callchain_node *chain; 288 struct callchain_node *chain;
@@ -597,8 +302,8 @@ hist_entry_callchain__fprintf(FILE *fp, struct hist_entry *self,
597 break; 302 break;
598 case CHAIN_GRAPH_ABS: /* Falldown */ 303 case CHAIN_GRAPH_ABS: /* Falldown */
599 case CHAIN_GRAPH_REL: 304 case CHAIN_GRAPH_REL:
600 ret += callchain__fprintf_graph(fp, chain, 305 ret += callchain__fprintf_graph(fp, chain, total_samples,
601 total_samples, 1, 1); 306 left_margin);
602 case CHAIN_NONE: 307 case CHAIN_NONE:
603 default: 308 default:
604 break; 309 break;
@@ -610,7 +315,6 @@ hist_entry_callchain__fprintf(FILE *fp, struct hist_entry *self,
610 return ret; 315 return ret;
611} 316}
612 317
613
614static size_t 318static size_t
615hist_entry__fprintf(FILE *fp, struct hist_entry *self, u64 total_samples) 319hist_entry__fprintf(FILE *fp, struct hist_entry *self, u64 total_samples)
616{ 320{
@@ -644,8 +348,19 @@ hist_entry__fprintf(FILE *fp, struct hist_entry *self, u64 total_samples)
644 348
645 ret += fprintf(fp, "\n"); 349 ret += fprintf(fp, "\n");
646 350
647 if (callchain) 351 if (callchain) {
648 hist_entry_callchain__fprintf(fp, self, total_samples); 352 int left_margin = 0;
353
354 if (sort__first_dimension == SORT_COMM) {
355 se = list_first_entry(&hist_entry__sort_list, typeof(*se),
356 list);
357 left_margin = se->width ? *se->width : 0;
358 left_margin -= thread__comm_len(self->thread);
359 }
360
361 hist_entry_callchain__fprintf(fp, self, total_samples,
362 left_margin);
363 }
649 364
650 return ret; 365 return ret;
651} 366}
@@ -693,63 +408,6 @@ static int thread__set_comm_adjust(struct thread *self, const char *comm)
693 return 0; 408 return 0;
694} 409}
695 410
696
697static struct symbol *
698resolve_symbol(struct thread *thread, struct map **mapp,
699 struct dso **dsop, u64 *ipp)
700{
701 struct dso *dso = dsop ? *dsop : NULL;
702 struct map *map = mapp ? *mapp : NULL;
703 u64 ip = *ipp;
704
705 if (!thread)
706 return NULL;
707
708 if (dso)
709 goto got_dso;
710
711 if (map)
712 goto got_map;
713
714 map = thread__find_map(thread, ip);
715 if (map != NULL) {
716 /*
717 * We have to do this here as we may have a dso
718 * with no symbol hit that has a name longer than
719 * the ones with symbols sampled.
720 */
721 if (!sort_dso.elide && !map->dso->slen_calculated)
722 dso__calc_col_width(map->dso);
723
724 if (mapp)
725 *mapp = map;
726got_map:
727 ip = map->map_ip(map, ip);
728
729 dso = map->dso;
730 } else {
731 /*
732 * If this is outside of all known maps,
733 * and is a negative address, try to look it
734 * up in the kernel dso, as it might be a
735 * vsyscall (which executes in user-mode):
736 */
737 if ((long long)ip < 0)
738 dso = kernel_dso;
739 }
740 dump_printf(" ...... dso: %s\n", dso ? dso->name : "<not found>");
741 dump_printf(" ...... map: %Lx -> %Lx\n", *ipp, ip);
742 *ipp = ip;
743
744 if (dsop)
745 *dsop = dso;
746
747 if (!dso)
748 return NULL;
749got_dso:
750 return dso->find_symbol(dso, ip);
751}
752
753static int call__match(struct symbol *sym) 411static int call__match(struct symbol *sym)
754{ 412{
755 if (sym->name && !regexec(&parent_regex, sym->name, 0, NULL, 0)) 413 if (sym->name && !regexec(&parent_regex, sym->name, 0, NULL, 0))
@@ -758,11 +416,11 @@ static int call__match(struct symbol *sym)
758 return 0; 416 return 0;
759} 417}
760 418
761static struct symbol ** 419static struct symbol **resolve_callchain(struct thread *thread,
762resolve_callchain(struct thread *thread, struct map *map __used, 420 struct ip_callchain *chain,
763 struct ip_callchain *chain, struct hist_entry *entry) 421 struct symbol **parent)
764{ 422{
765 u64 context = PERF_CONTEXT_MAX; 423 u8 cpumode = PERF_RECORD_MISC_USER;
766 struct symbol **syms = NULL; 424 struct symbol **syms = NULL;
767 unsigned int i; 425 unsigned int i;
768 426
@@ -776,34 +434,31 @@ resolve_callchain(struct thread *thread, struct map *map __used,
776 434
777 for (i = 0; i < chain->nr; i++) { 435 for (i = 0; i < chain->nr; i++) {
778 u64 ip = chain->ips[i]; 436 u64 ip = chain->ips[i];
779 struct dso *dso = NULL; 437 struct addr_location al;
780 struct symbol *sym;
781 438
782 if (ip >= PERF_CONTEXT_MAX) { 439 if (ip >= PERF_CONTEXT_MAX) {
783 context = ip; 440 switch (ip) {
441 case PERF_CONTEXT_HV:
442 cpumode = PERF_RECORD_MISC_HYPERVISOR; break;
443 case PERF_CONTEXT_KERNEL:
444 cpumode = PERF_RECORD_MISC_KERNEL; break;
445 case PERF_CONTEXT_USER:
446 cpumode = PERF_RECORD_MISC_USER; break;
447 default:
448 break;
449 }
784 continue; 450 continue;
785 } 451 }
786 452
787 switch (context) { 453 thread__find_addr_location(thread, cpumode, MAP__FUNCTION,
788 case PERF_CONTEXT_HV: 454 ip, &al, NULL);
789 dso = hypervisor_dso; 455 if (al.sym != NULL) {
790 break; 456 if (sort__has_parent && !*parent &&
791 case PERF_CONTEXT_KERNEL: 457 call__match(al.sym))
792 dso = kernel_dso; 458 *parent = al.sym;
793 break;
794 default:
795 break;
796 }
797
798 sym = resolve_symbol(thread, NULL, &dso, &ip);
799
800 if (sym) {
801 if (sort__has_parent && call__match(sym) &&
802 !entry->parent)
803 entry->parent = sym;
804 if (!callchain) 459 if (!callchain)
805 break; 460 break;
806 syms[i] = sym; 461 syms[i] = al.sym;
807 } 462 }
808 } 463 }
809 464
@@ -814,178 +469,33 @@ resolve_callchain(struct thread *thread, struct map *map __used,
814 * collect histogram counts 469 * collect histogram counts
815 */ 470 */
816 471
817static int 472static int hist_entry__add(struct addr_location *al,
818hist_entry__add(struct thread *thread, struct map *map, struct dso *dso, 473 struct ip_callchain *chain, u64 count)
819 struct symbol *sym, u64 ip, struct ip_callchain *chain,
820 char level, u64 count)
821{ 474{
822 struct rb_node **p = &hist.rb_node; 475 struct symbol **syms = NULL, *parent = NULL;
823 struct rb_node *parent = NULL; 476 bool hit;
824 struct hist_entry *he; 477 struct hist_entry *he;
825 struct symbol **syms = NULL;
826 struct hist_entry entry = {
827 .thread = thread,
828 .map = map,
829 .dso = dso,
830 .sym = sym,
831 .ip = ip,
832 .level = level,
833 .count = count,
834 .parent = NULL,
835 .sorted_chain = RB_ROOT
836 };
837 int cmp;
838 478
839 if ((sort__has_parent || callchain) && chain) 479 if ((sort__has_parent || callchain) && chain)
840 syms = resolve_callchain(thread, map, chain, &entry); 480 syms = resolve_callchain(al->thread, chain, &parent);
841 481
842 while (*p != NULL) { 482 he = __hist_entry__add(al, parent, count, &hit);
843 parent = *p; 483 if (he == NULL)
844 he = rb_entry(parent, struct hist_entry, rb_node); 484 return -ENOMEM;
845 485
846 cmp = hist_entry__cmp(&entry, he); 486 if (hit)
487 he->count += count;
847 488
848 if (!cmp) {
849 he->count += count;
850 if (callchain) {
851 append_chain(&he->callchain, chain, syms);
852 free(syms);
853 }
854 return 0;
855 }
856
857 if (cmp < 0)
858 p = &(*p)->rb_left;
859 else
860 p = &(*p)->rb_right;
861 }
862
863 he = malloc(sizeof(*he));
864 if (!he)
865 return -ENOMEM;
866 *he = entry;
867 if (callchain) { 489 if (callchain) {
868 callchain_init(&he->callchain); 490 if (!hit)
491 callchain_init(&he->callchain);
869 append_chain(&he->callchain, chain, syms); 492 append_chain(&he->callchain, chain, syms);
870 free(syms); 493 free(syms);
871 } 494 }
872 rb_link_node(&he->rb_node, parent, p);
873 rb_insert_color(&he->rb_node, &hist);
874 495
875 return 0; 496 return 0;
876} 497}
877 498
878static void hist_entry__free(struct hist_entry *he)
879{
880 free(he);
881}
882
883/*
884 * collapse the histogram
885 */
886
887static struct rb_root collapse_hists;
888
889static void collapse__insert_entry(struct hist_entry *he)
890{
891 struct rb_node **p = &collapse_hists.rb_node;
892 struct rb_node *parent = NULL;
893 struct hist_entry *iter;
894 int64_t cmp;
895
896 while (*p != NULL) {
897 parent = *p;
898 iter = rb_entry(parent, struct hist_entry, rb_node);
899
900 cmp = hist_entry__collapse(iter, he);
901
902 if (!cmp) {
903 iter->count += he->count;
904 hist_entry__free(he);
905 return;
906 }
907
908 if (cmp < 0)
909 p = &(*p)->rb_left;
910 else
911 p = &(*p)->rb_right;
912 }
913
914 rb_link_node(&he->rb_node, parent, p);
915 rb_insert_color(&he->rb_node, &collapse_hists);
916}
917
918static void collapse__resort(void)
919{
920 struct rb_node *next;
921 struct hist_entry *n;
922
923 if (!sort__need_collapse)
924 return;
925
926 next = rb_first(&hist);
927 while (next) {
928 n = rb_entry(next, struct hist_entry, rb_node);
929 next = rb_next(&n->rb_node);
930
931 rb_erase(&n->rb_node, &hist);
932 collapse__insert_entry(n);
933 }
934}
935
936/*
937 * reverse the map, sort on count.
938 */
939
940static struct rb_root output_hists;
941
942static void output__insert_entry(struct hist_entry *he, u64 min_callchain_hits)
943{
944 struct rb_node **p = &output_hists.rb_node;
945 struct rb_node *parent = NULL;
946 struct hist_entry *iter;
947
948 if (callchain)
949 callchain_param.sort(&he->sorted_chain, &he->callchain,
950 min_callchain_hits, &callchain_param);
951
952 while (*p != NULL) {
953 parent = *p;
954 iter = rb_entry(parent, struct hist_entry, rb_node);
955
956 if (he->count > iter->count)
957 p = &(*p)->rb_left;
958 else
959 p = &(*p)->rb_right;
960 }
961
962 rb_link_node(&he->rb_node, parent, p);
963 rb_insert_color(&he->rb_node, &output_hists);
964}
965
966static void output__resort(u64 total_samples)
967{
968 struct rb_node *next;
969 struct hist_entry *n;
970 struct rb_root *tree = &hist;
971 u64 min_callchain_hits;
972
973 min_callchain_hits = total_samples * (callchain_param.min_percent / 100);
974
975 if (sort__need_collapse)
976 tree = &collapse_hists;
977
978 next = rb_first(tree);
979
980 while (next) {
981 n = rb_entry(next, struct hist_entry, rb_node);
982 next = rb_next(&n->rb_node);
983
984 rb_erase(&n->rb_node, tree);
985 output__insert_entry(n, min_callchain_hits);
986 }
987}
988
989static size_t output__fprintf(FILE *fp, u64 total_samples) 499static size_t output__fprintf(FILE *fp, u64 total_samples)
990{ 500{
991 struct hist_entry *pos; 501 struct hist_entry *pos;
@@ -1080,13 +590,6 @@ print_entries:
1080 return ret; 590 return ret;
1081} 591}
1082 592
1083static unsigned long total = 0,
1084 total_mmap = 0,
1085 total_comm = 0,
1086 total_fork = 0,
1087 total_unknown = 0,
1088 total_lost = 0;
1089
1090static int validate_chain(struct ip_callchain *chain, event_t *event) 593static int validate_chain(struct ip_callchain *chain, event_t *event)
1091{ 594{
1092 unsigned int chain_size; 595 unsigned int chain_size;
@@ -1100,30 +603,22 @@ static int validate_chain(struct ip_callchain *chain, event_t *event)
1100 return 0; 603 return 0;
1101} 604}
1102 605
1103static int 606static int process_sample_event(event_t *event)
1104process_sample_event(event_t *event, unsigned long offset, unsigned long head)
1105{ 607{
1106 char level;
1107 int show = 0;
1108 struct dso *dso = NULL;
1109 struct thread *thread;
1110 u64 ip = event->ip.ip; 608 u64 ip = event->ip.ip;
1111 u64 period = 1; 609 u64 period = 1;
1112 struct map *map = NULL;
1113 void *more_data = event->ip.__more_data; 610 void *more_data = event->ip.__more_data;
1114 struct ip_callchain *chain = NULL; 611 struct ip_callchain *chain = NULL;
1115 int cpumode; 612 int cpumode;
1116 613 struct addr_location al;
1117 thread = threads__findnew(event->ip.pid, &threads, &last_match); 614 struct thread *thread = threads__findnew(event->ip.pid);
1118 615
1119 if (sample_type & PERF_SAMPLE_PERIOD) { 616 if (sample_type & PERF_SAMPLE_PERIOD) {
1120 period = *(u64 *)more_data; 617 period = *(u64 *)more_data;
1121 more_data += sizeof(u64); 618 more_data += sizeof(u64);
1122 } 619 }
1123 620
1124 dump_printf("%p [%p]: PERF_RECORD_SAMPLE (IP, %d): %d/%d: %p period: %Ld\n", 621 dump_printf("(IP, %d): %d/%d: %p period: %Ld\n",
1125 (void *)(offset + head),
1126 (void *)(long)(event->header.size),
1127 event->header.misc, 622 event->header.misc,
1128 event->ip.pid, event->ip.tid, 623 event->ip.pid, event->ip.tid,
1129 (void *)(long)ip, 624 (void *)(long)ip,
@@ -1137,7 +632,8 @@ process_sample_event(event_t *event, unsigned long offset, unsigned long head)
1137 dump_printf("... chain: nr:%Lu\n", chain->nr); 632 dump_printf("... chain: nr:%Lu\n", chain->nr);
1138 633
1139 if (validate_chain(chain, event) < 0) { 634 if (validate_chain(chain, event) < 0) {
1140 eprintf("call-chain problem with event, skipping it.\n"); 635 pr_debug("call-chain problem with event, "
636 "skipping it.\n");
1141 return 0; 637 return 0;
1142 } 638 }
1143 639
@@ -1147,163 +643,64 @@ process_sample_event(event_t *event, unsigned long offset, unsigned long head)
1147 } 643 }
1148 } 644 }
1149 645
1150 dump_printf(" ... thread: %s:%d\n", thread->comm, thread->pid);
1151
1152 if (thread == NULL) { 646 if (thread == NULL) {
1153 eprintf("problem processing %d event, skipping it.\n", 647 pr_debug("problem processing %d event, skipping it.\n",
1154 event->header.type); 648 event->header.type);
1155 return -1; 649 return -1;
1156 } 650 }
1157 651
652 dump_printf(" ... thread: %s:%d\n", thread->comm, thread->pid);
653
1158 if (comm_list && !strlist__has_entry(comm_list, thread->comm)) 654 if (comm_list && !strlist__has_entry(comm_list, thread->comm))
1159 return 0; 655 return 0;
1160 656
1161 cpumode = event->header.misc & PERF_RECORD_MISC_CPUMODE_MASK; 657 cpumode = event->header.misc & PERF_RECORD_MISC_CPUMODE_MASK;
1162 658
1163 if (cpumode == PERF_RECORD_MISC_KERNEL) { 659 thread__find_addr_location(thread, cpumode,
1164 show = SHOW_KERNEL; 660 MAP__FUNCTION, ip, &al, NULL);
1165 level = 'k'; 661 /*
1166 662 * We have to do this here as we may have a dso with no symbol hit that
1167 dso = kernel_dso; 663 * has a name longer than the ones with symbols sampled.
1168 664 */
1169 dump_printf(" ...... dso: %s\n", dso->name); 665 if (al.map && !sort_dso.elide && !al.map->dso->slen_calculated)
1170 666 dso__calc_col_width(al.map->dso);
1171 } else if (cpumode == PERF_RECORD_MISC_USER) { 667
1172 668 if (dso_list &&
1173 show = SHOW_USER; 669 (!al.map || !al.map->dso ||
1174 level = '.'; 670 !(strlist__has_entry(dso_list, al.map->dso->short_name) ||
1175 671 (al.map->dso->short_name != al.map->dso->long_name &&
1176 } else { 672 strlist__has_entry(dso_list, al.map->dso->long_name)))))
1177 show = SHOW_HV; 673 return 0;
1178 level = 'H';
1179
1180 dso = hypervisor_dso;
1181
1182 dump_printf(" ...... dso: [hypervisor]\n");
1183 }
1184
1185 if (show & show_mask) {
1186 struct symbol *sym = resolve_symbol(thread, &map, &dso, &ip);
1187
1188 if (dso_list && (!dso || !dso->name ||
1189 !strlist__has_entry(dso_list, dso->name)))
1190 return 0;
1191
1192 if (sym_list && (!sym || !strlist__has_entry(sym_list, sym->name)))
1193 return 0;
1194
1195 if (hist_entry__add(thread, map, dso, sym, ip, chain, level, period)) {
1196 eprintf("problem incrementing symbol count, skipping event\n");
1197 return -1;
1198 }
1199 }
1200 total += period;
1201
1202 return 0;
1203}
1204 674
1205static int 675 if (sym_list && al.sym && !strlist__has_entry(sym_list, al.sym->name))
1206process_mmap_event(event_t *event, unsigned long offset, unsigned long head)
1207{
1208 struct thread *thread;
1209 struct map *map = map__new(&event->mmap, cwd, cwdlen);
1210
1211 thread = threads__findnew(event->mmap.pid, &threads, &last_match);
1212
1213 dump_printf("%p [%p]: PERF_RECORD_MMAP %d/%d: [%p(%p) @ %p]: %s\n",
1214 (void *)(offset + head),
1215 (void *)(long)(event->header.size),
1216 event->mmap.pid,
1217 event->mmap.tid,
1218 (void *)(long)event->mmap.start,
1219 (void *)(long)event->mmap.len,
1220 (void *)(long)event->mmap.pgoff,
1221 event->mmap.filename);
1222
1223 if (thread == NULL || map == NULL) {
1224 dump_printf("problem processing PERF_RECORD_MMAP, skipping event.\n");
1225 return 0; 676 return 0;
677
678 if (hist_entry__add(&al, chain, period)) {
679 pr_debug("problem incrementing symbol count, skipping event\n");
680 return -1;
1226 } 681 }
1227 682
1228 thread__insert_map(thread, map); 683 event__stats.total += period;
1229 total_mmap++;
1230 684
1231 return 0; 685 return 0;
1232} 686}
1233 687
1234static int 688static int process_comm_event(event_t *event)
1235process_comm_event(event_t *event, unsigned long offset, unsigned long head)
1236{ 689{
1237 struct thread *thread; 690 struct thread *thread = threads__findnew(event->comm.pid);
1238
1239 thread = threads__findnew(event->comm.pid, &threads, &last_match);
1240 691
1241 dump_printf("%p [%p]: PERF_RECORD_COMM: %s:%d\n", 692 dump_printf(": %s:%d\n", event->comm.comm, event->comm.pid);
1242 (void *)(offset + head),
1243 (void *)(long)(event->header.size),
1244 event->comm.comm, event->comm.pid);
1245 693
1246 if (thread == NULL || 694 if (thread == NULL ||
1247 thread__set_comm_adjust(thread, event->comm.comm)) { 695 thread__set_comm_adjust(thread, event->comm.comm)) {
1248 dump_printf("problem processing PERF_RECORD_COMM, skipping event.\n"); 696 dump_printf("problem processing PERF_RECORD_COMM, skipping event.\n");
1249 return -1; 697 return -1;
1250 } 698 }
1251 total_comm++;
1252
1253 return 0;
1254}
1255
1256static int
1257process_task_event(event_t *event, unsigned long offset, unsigned long head)
1258{
1259 struct thread *thread;
1260 struct thread *parent;
1261
1262 thread = threads__findnew(event->fork.pid, &threads, &last_match);
1263 parent = threads__findnew(event->fork.ppid, &threads, &last_match);
1264
1265 dump_printf("%p [%p]: PERF_RECORD_%s: (%d:%d):(%d:%d)\n",
1266 (void *)(offset + head),
1267 (void *)(long)(event->header.size),
1268 event->header.type == PERF_RECORD_FORK ? "FORK" : "EXIT",
1269 event->fork.pid, event->fork.tid,
1270 event->fork.ppid, event->fork.ptid);
1271
1272 /*
1273 * A thread clone will have the same PID for both
1274 * parent and child.
1275 */
1276 if (thread == parent)
1277 return 0;
1278
1279 if (event->header.type == PERF_RECORD_EXIT)
1280 return 0;
1281
1282 if (!thread || !parent || thread__fork(thread, parent)) {
1283 dump_printf("problem processing PERF_RECORD_FORK, skipping event.\n");
1284 return -1;
1285 }
1286 total_fork++;
1287 699
1288 return 0; 700 return 0;
1289} 701}
1290 702
1291static int 703static int process_read_event(event_t *event)
1292process_lost_event(event_t *event, unsigned long offset, unsigned long head)
1293{
1294 dump_printf("%p [%p]: PERF_RECORD_LOST: id:%Ld: lost:%Ld\n",
1295 (void *)(offset + head),
1296 (void *)(long)(event->header.size),
1297 event->lost.id,
1298 event->lost.lost);
1299
1300 total_lost += event->lost.lost;
1301
1302 return 0;
1303}
1304
1305static int
1306process_read_event(event_t *event, unsigned long offset, unsigned long head)
1307{ 704{
1308 struct perf_event_attr *attr; 705 struct perf_event_attr *attr;
1309 706
@@ -1319,238 +716,91 @@ process_read_event(event_t *event, unsigned long offset, unsigned long head)
1319 event->read.value); 716 event->read.value);
1320 } 717 }
1321 718
1322 dump_printf("%p [%p]: PERF_RECORD_READ: %d %d %s %Lu\n", 719 dump_printf(": %d %d %s %Lu\n", event->read.pid, event->read.tid,
1323 (void *)(offset + head), 720 attr ? __event_name(attr->type, attr->config) : "FAIL",
1324 (void *)(long)(event->header.size), 721 event->read.value);
1325 event->read.pid,
1326 event->read.tid,
1327 attr ? __event_name(attr->type, attr->config)
1328 : "FAIL",
1329 event->read.value);
1330
1331 return 0;
1332}
1333
1334static int
1335process_event(event_t *event, unsigned long offset, unsigned long head)
1336{
1337 trace_event(event);
1338
1339 switch (event->header.type) {
1340 case PERF_RECORD_SAMPLE:
1341 return process_sample_event(event, offset, head);
1342
1343 case PERF_RECORD_MMAP:
1344 return process_mmap_event(event, offset, head);
1345
1346 case PERF_RECORD_COMM:
1347 return process_comm_event(event, offset, head);
1348
1349 case PERF_RECORD_FORK:
1350 case PERF_RECORD_EXIT:
1351 return process_task_event(event, offset, head);
1352
1353 case PERF_RECORD_LOST:
1354 return process_lost_event(event, offset, head);
1355
1356 case PERF_RECORD_READ:
1357 return process_read_event(event, offset, head);
1358
1359 /*
1360 * We dont process them right now but they are fine:
1361 */
1362
1363 case PERF_RECORD_THROTTLE:
1364 case PERF_RECORD_UNTHROTTLE:
1365 return 0;
1366
1367 default:
1368 return -1;
1369 }
1370 722
1371 return 0; 723 return 0;
1372} 724}
1373 725
1374static int __cmd_report(void) 726static int sample_type_check(u64 type)
1375{ 727{
1376 int ret, rc = EXIT_FAILURE; 728 sample_type = type;
1377 unsigned long offset = 0;
1378 unsigned long head, shift;
1379 struct stat input_stat;
1380 struct thread *idle;
1381 event_t *event;
1382 uint32_t size;
1383 char *buf;
1384
1385 idle = register_idle_thread(&threads, &last_match);
1386 thread__comm_adjust(idle);
1387
1388 if (show_threads)
1389 perf_read_values_init(&show_threads_values);
1390
1391 input = open(input_name, O_RDONLY);
1392 if (input < 0) {
1393 fprintf(stderr, " failed to open file: %s", input_name);
1394 if (!strcmp(input_name, "perf.data"))
1395 fprintf(stderr, " (try 'perf record' first)");
1396 fprintf(stderr, "\n");
1397 exit(-1);
1398 }
1399
1400 ret = fstat(input, &input_stat);
1401 if (ret < 0) {
1402 perror("failed to stat file");
1403 exit(-1);
1404 }
1405
1406 if (!force && input_stat.st_uid && (input_stat.st_uid != geteuid())) {
1407 fprintf(stderr, "file: %s not owned by current user or root\n", input_name);
1408 exit(-1);
1409 }
1410
1411 if (!input_stat.st_size) {
1412 fprintf(stderr, "zero-sized file, nothing to do!\n");
1413 exit(0);
1414 }
1415
1416 header = perf_header__read(input);
1417 head = header->data_offset;
1418
1419 sample_type = perf_header__sample_type(header);
1420 729
1421 if (!(sample_type & PERF_SAMPLE_CALLCHAIN)) { 730 if (!(sample_type & PERF_SAMPLE_CALLCHAIN)) {
1422 if (sort__has_parent) { 731 if (sort__has_parent) {
1423 fprintf(stderr, "selected --sort parent, but no" 732 fprintf(stderr, "selected --sort parent, but no"
1424 " callchain data. Did you call" 733 " callchain data. Did you call"
1425 " perf record without -g?\n"); 734 " perf record without -g?\n");
1426 exit(-1); 735 return -1;
1427 } 736 }
1428 if (callchain) { 737 if (callchain) {
1429 fprintf(stderr, "selected -g but no callchain data." 738 fprintf(stderr, "selected -g but no callchain data."
1430 " Did you call perf record without" 739 " Did you call perf record without"
1431 " -g?\n"); 740 " -g?\n");
1432 exit(-1); 741 return -1;
1433 } 742 }
1434 } else if (callchain_param.mode != CHAIN_NONE && !callchain) { 743 } else if (callchain_param.mode != CHAIN_NONE && !callchain) {
1435 callchain = 1; 744 callchain = 1;
1436 if (register_callchain_param(&callchain_param) < 0) { 745 if (register_callchain_param(&callchain_param) < 0) {
1437 fprintf(stderr, "Can't register callchain" 746 fprintf(stderr, "Can't register callchain"
1438 " params\n"); 747 " params\n");
1439 exit(-1); 748 return -1;
1440 } 749 }
1441 } 750 }
1442 751
1443 if (load_kernel() < 0) { 752 return 0;
1444 perror("failed to load kernel symbols"); 753}
1445 return EXIT_FAILURE;
1446 }
1447
1448 if (!full_paths) {
1449 if (getcwd(__cwd, sizeof(__cwd)) == NULL) {
1450 perror("failed to get the current directory");
1451 return EXIT_FAILURE;
1452 }
1453 cwdlen = strlen(cwd);
1454 } else {
1455 cwd = NULL;
1456 cwdlen = 0;
1457 }
1458
1459 shift = page_size * (head / page_size);
1460 offset += shift;
1461 head -= shift;
1462
1463remap:
1464 buf = (char *)mmap(NULL, page_size * mmap_window, PROT_READ,
1465 MAP_SHARED, input, offset);
1466 if (buf == MAP_FAILED) {
1467 perror("failed to mmap file");
1468 exit(-1);
1469 }
1470
1471more:
1472 event = (event_t *)(buf + head);
1473
1474 size = event->header.size;
1475 if (!size)
1476 size = 8;
1477
1478 if (head + event->header.size >= page_size * mmap_window) {
1479 int munmap_ret;
1480
1481 shift = page_size * (head / page_size);
1482
1483 munmap_ret = munmap(buf, page_size * mmap_window);
1484 assert(munmap_ret == 0);
1485
1486 offset += shift;
1487 head -= shift;
1488 goto remap;
1489 }
1490
1491 size = event->header.size;
1492
1493 dump_printf("\n%p [%p]: event: %d\n",
1494 (void *)(offset + head),
1495 (void *)(long)event->header.size,
1496 event->header.type);
1497
1498 if (!size || process_event(event, offset, head) < 0) {
1499
1500 dump_printf("%p [%p]: skipping unknown header type: %d\n",
1501 (void *)(offset + head),
1502 (void *)(long)(event->header.size),
1503 event->header.type);
1504
1505 total_unknown++;
1506
1507 /*
1508 * assume we lost track of the stream, check alignment, and
1509 * increment a single u64 in the hope to catch on again 'soon'.
1510 */
1511 754
1512 if (unlikely(head & 7)) 755static struct perf_file_handler file_handler = {
1513 head &= ~7ULL; 756 .process_sample_event = process_sample_event,
757 .process_mmap_event = event__process_mmap,
758 .process_comm_event = process_comm_event,
759 .process_exit_event = event__process_task,
760 .process_fork_event = event__process_task,
761 .process_lost_event = event__process_lost,
762 .process_read_event = process_read_event,
763 .sample_type_check = sample_type_check,
764};
1514 765
1515 size = 8;
1516 }
1517 766
1518 head += size; 767static int __cmd_report(void)
768{
769 struct thread *idle;
770 int ret;
1519 771
1520 if (offset + head >= header->data_offset + header->data_size) 772 idle = register_idle_thread();
1521 goto done; 773 thread__comm_adjust(idle);
1522 774
1523 if (offset + head < (unsigned long)input_stat.st_size) 775 if (show_threads)
1524 goto more; 776 perf_read_values_init(&show_threads_values);
1525 777
1526done: 778 register_perf_file_handler(&file_handler);
1527 rc = EXIT_SUCCESS;
1528 close(input);
1529 779
1530 dump_printf(" IP events: %10ld\n", total); 780 ret = mmap_dispatch_perf_file(&header, input_name, force,
1531 dump_printf(" mmap events: %10ld\n", total_mmap); 781 full_paths, &event__cwdlen, &event__cwd);
1532 dump_printf(" comm events: %10ld\n", total_comm); 782 if (ret)
1533 dump_printf(" fork events: %10ld\n", total_fork); 783 return ret;
1534 dump_printf(" lost events: %10ld\n", total_lost);
1535 dump_printf(" unknown events: %10ld\n", total_unknown);
1536 784
1537 if (dump_trace) 785 if (dump_trace) {
786 event__print_totals();
1538 return 0; 787 return 0;
788 }
1539 789
1540 if (verbose >= 3) 790 if (verbose > 3)
1541 threads__fprintf(stdout, &threads); 791 threads__fprintf(stdout);
1542 792
1543 if (verbose >= 2) 793 if (verbose > 2)
1544 dsos__fprintf(stdout); 794 dsos__fprintf(stdout);
1545 795
1546 collapse__resort(); 796 collapse__resort();
1547 output__resort(total); 797 output__resort(event__stats.total);
1548 output__fprintf(stdout, total); 798 output__fprintf(stdout, event__stats.total);
1549 799
1550 if (show_threads) 800 if (show_threads)
1551 perf_read_values_destroy(&show_threads_values); 801 perf_read_values_destroy(&show_threads_values);
1552 802
1553 return rc; 803 return ret;
1554} 804}
1555 805
1556static int 806static int
@@ -1606,7 +856,8 @@ setup:
1606 return 0; 856 return 0;
1607} 857}
1608 858
1609static const char * const report_usage[] = { 859//static const char * const report_usage[] = {
860const char * const report_usage[] = {
1610 "perf report [<options>] <command>", 861 "perf report [<options>] <command>",
1611 NULL 862 NULL
1612}; 863};
@@ -1618,9 +869,10 @@ static const struct option options[] = {
1618 "be more verbose (show symbol address, etc)"), 869 "be more verbose (show symbol address, etc)"),
1619 OPT_BOOLEAN('D', "dump-raw-trace", &dump_trace, 870 OPT_BOOLEAN('D', "dump-raw-trace", &dump_trace,
1620 "dump raw trace in ASCII"), 871 "dump raw trace in ASCII"),
1621 OPT_STRING('k', "vmlinux", &vmlinux_name, "file", "vmlinux pathname"), 872 OPT_STRING('k', "vmlinux", &symbol_conf.vmlinux_name,
873 "file", "vmlinux pathname"),
1622 OPT_BOOLEAN('f', "force", &force, "don't complain, do it"), 874 OPT_BOOLEAN('f', "force", &force, "don't complain, do it"),
1623 OPT_BOOLEAN('m', "modules", &modules, 875 OPT_BOOLEAN('m', "modules", &symbol_conf.use_modules,
1624 "load module symbols - WARNING: use only with -k and LIVE kernel"), 876 "load module symbols - WARNING: use only with -k and LIVE kernel"),
1625 OPT_BOOLEAN('n', "show-nr-samples", &show_nr_samples, 877 OPT_BOOLEAN('n', "show-nr-samples", &show_nr_samples,
1626 "Show a column with the number of samples"), 878 "Show a column with the number of samples"),
@@ -1690,9 +942,8 @@ static void setup_list(struct strlist **list, const char *list_str,
1690 942
1691int cmd_report(int argc, const char **argv, const char *prefix __used) 943int cmd_report(int argc, const char **argv, const char *prefix __used)
1692{ 944{
1693 symbol__init(); 945 if (symbol__init(&symbol_conf) < 0)
1694 946 return -1;
1695 page_size = getpagesize();
1696 947
1697 argc = parse_options(argc, argv, options, report_usage, 0); 948 argc = parse_options(argc, argv, options, report_usage, 0);
1698 949
diff --git a/tools/perf/builtin-sched.c b/tools/perf/builtin-sched.c
index ce2d5be4f30e..26b782f26ee1 100644
--- a/tools/perf/builtin-sched.c
+++ b/tools/perf/builtin-sched.c
@@ -11,6 +11,7 @@
11#include "util/trace-event.h" 11#include "util/trace-event.h"
12 12
13#include "util/debug.h" 13#include "util/debug.h"
14#include "util/data_map.h"
14 15
15#include <sys/types.h> 16#include <sys/types.h>
16#include <sys/prctl.h> 17#include <sys/prctl.h>
@@ -20,14 +21,6 @@
20#include <math.h> 21#include <math.h>
21 22
22static char const *input_name = "perf.data"; 23static char const *input_name = "perf.data";
23static int input;
24static unsigned long page_size;
25static unsigned long mmap_window = 32;
26
27static unsigned long total_comm = 0;
28
29static struct rb_root threads;
30static struct thread *last_match;
31 24
32static struct perf_header *header; 25static struct perf_header *header;
33static u64 sample_type; 26static u64 sample_type;
@@ -35,11 +28,11 @@ static u64 sample_type;
35static char default_sort_order[] = "avg, max, switch, runtime"; 28static char default_sort_order[] = "avg, max, switch, runtime";
36static char *sort_order = default_sort_order; 29static char *sort_order = default_sort_order;
37 30
31static int profile_cpu = -1;
32
38#define PR_SET_NAME 15 /* Set process name */ 33#define PR_SET_NAME 15 /* Set process name */
39#define MAX_CPUS 4096 34#define MAX_CPUS 4096
40 35
41#define BUG_ON(x) assert(!(x))
42
43static u64 run_measurement_overhead; 36static u64 run_measurement_overhead;
44static u64 sleep_measurement_overhead; 37static u64 sleep_measurement_overhead;
45 38
@@ -74,6 +67,7 @@ enum sched_event_type {
74 SCHED_EVENT_RUN, 67 SCHED_EVENT_RUN,
75 SCHED_EVENT_SLEEP, 68 SCHED_EVENT_SLEEP,
76 SCHED_EVENT_WAKEUP, 69 SCHED_EVENT_WAKEUP,
70 SCHED_EVENT_MIGRATION,
77}; 71};
78 72
79struct sched_atom { 73struct sched_atom {
@@ -226,7 +220,7 @@ static void calibrate_sleep_measurement_overhead(void)
226static struct sched_atom * 220static struct sched_atom *
227get_new_event(struct task_desc *task, u64 timestamp) 221get_new_event(struct task_desc *task, u64 timestamp)
228{ 222{
229 struct sched_atom *event = calloc(1, sizeof(*event)); 223 struct sched_atom *event = zalloc(sizeof(*event));
230 unsigned long idx = task->nr_events; 224 unsigned long idx = task->nr_events;
231 size_t size; 225 size_t size;
232 226
@@ -294,7 +288,7 @@ add_sched_event_wakeup(struct task_desc *task, u64 timestamp,
294 return; 288 return;
295 } 289 }
296 290
297 wakee_event->wait_sem = calloc(1, sizeof(*wakee_event->wait_sem)); 291 wakee_event->wait_sem = zalloc(sizeof(*wakee_event->wait_sem));
298 sem_init(wakee_event->wait_sem, 0, 0); 292 sem_init(wakee_event->wait_sem, 0, 0);
299 wakee_event->specific_wait = 1; 293 wakee_event->specific_wait = 1;
300 event->wait_sem = wakee_event->wait_sem; 294 event->wait_sem = wakee_event->wait_sem;
@@ -324,7 +318,7 @@ static struct task_desc *register_pid(unsigned long pid, const char *comm)
324 if (task) 318 if (task)
325 return task; 319 return task;
326 320
327 task = calloc(1, sizeof(*task)); 321 task = zalloc(sizeof(*task));
328 task->pid = pid; 322 task->pid = pid;
329 task->nr = nr_tasks; 323 task->nr = nr_tasks;
330 strcpy(task->comm, comm); 324 strcpy(task->comm, comm);
@@ -398,6 +392,8 @@ process_sched_event(struct task_desc *this_task __used, struct sched_atom *atom)
398 ret = sem_post(atom->wait_sem); 392 ret = sem_post(atom->wait_sem);
399 BUG_ON(ret); 393 BUG_ON(ret);
400 break; 394 break;
395 case SCHED_EVENT_MIGRATION:
396 break;
401 default: 397 default:
402 BUG_ON(1); 398 BUG_ON(1);
403 } 399 }
@@ -632,29 +628,6 @@ static void test_calibrations(void)
632 printf("the sleep test took %Ld nsecs\n", T1-T0); 628 printf("the sleep test took %Ld nsecs\n", T1-T0);
633} 629}
634 630
635static int
636process_comm_event(event_t *event, unsigned long offset, unsigned long head)
637{
638 struct thread *thread;
639
640 thread = threads__findnew(event->comm.pid, &threads, &last_match);
641
642 dump_printf("%p [%p]: perf_event_comm: %s:%d\n",
643 (void *)(offset + head),
644 (void *)(long)(event->header.size),
645 event->comm.comm, event->comm.pid);
646
647 if (thread == NULL ||
648 thread__set_comm(thread, event->comm.comm)) {
649 dump_printf("problem processing perf_event_comm, skipping event.\n");
650 return -1;
651 }
652 total_comm++;
653
654 return 0;
655}
656
657
658struct raw_event_sample { 631struct raw_event_sample {
659 u32 size; 632 u32 size;
660 char data[0]; 633 char data[0];
@@ -745,6 +718,22 @@ struct trace_fork_event {
745 u32 child_pid; 718 u32 child_pid;
746}; 719};
747 720
721struct trace_migrate_task_event {
722 u32 size;
723
724 u16 common_type;
725 u8 common_flags;
726 u8 common_preempt_count;
727 u32 common_pid;
728 u32 common_tgid;
729
730 char comm[16];
731 u32 pid;
732
733 u32 prio;
734 u32 cpu;
735};
736
748struct trace_sched_handler { 737struct trace_sched_handler {
749 void (*switch_event)(struct trace_switch_event *, 738 void (*switch_event)(struct trace_switch_event *,
750 struct event *, 739 struct event *,
@@ -769,6 +758,12 @@ struct trace_sched_handler {
769 int cpu, 758 int cpu,
770 u64 timestamp, 759 u64 timestamp,
771 struct thread *thread); 760 struct thread *thread);
761
762 void (*migrate_task_event)(struct trace_migrate_task_event *,
763 struct event *,
764 int cpu,
765 u64 timestamp,
766 struct thread *thread);
772}; 767};
773 768
774 769
@@ -941,9 +936,7 @@ __thread_latency_insert(struct rb_root *root, struct work_atoms *data,
941 936
942static void thread_atoms_insert(struct thread *thread) 937static void thread_atoms_insert(struct thread *thread)
943{ 938{
944 struct work_atoms *atoms; 939 struct work_atoms *atoms = zalloc(sizeof(*atoms));
945
946 atoms = calloc(sizeof(*atoms), 1);
947 if (!atoms) 940 if (!atoms)
948 die("No memory"); 941 die("No memory");
949 942
@@ -975,9 +968,7 @@ add_sched_out_event(struct work_atoms *atoms,
975 char run_state, 968 char run_state,
976 u64 timestamp) 969 u64 timestamp)
977{ 970{
978 struct work_atom *atom; 971 struct work_atom *atom = zalloc(sizeof(*atom));
979
980 atom = calloc(sizeof(*atom), 1);
981 if (!atom) 972 if (!atom)
982 die("Non memory"); 973 die("Non memory");
983 974
@@ -1058,8 +1049,8 @@ latency_switch_event(struct trace_switch_event *switch_event,
1058 die("hm, delta: %Ld < 0 ?\n", delta); 1049 die("hm, delta: %Ld < 0 ?\n", delta);
1059 1050
1060 1051
1061 sched_out = threads__findnew(switch_event->prev_pid, &threads, &last_match); 1052 sched_out = threads__findnew(switch_event->prev_pid);
1062 sched_in = threads__findnew(switch_event->next_pid, &threads, &last_match); 1053 sched_in = threads__findnew(switch_event->next_pid);
1063 1054
1064 out_events = thread_atoms_search(&atom_root, sched_out, &cmp_pid); 1055 out_events = thread_atoms_search(&atom_root, sched_out, &cmp_pid);
1065 if (!out_events) { 1056 if (!out_events) {
@@ -1092,13 +1083,10 @@ latency_runtime_event(struct trace_runtime_event *runtime_event,
1092 u64 timestamp, 1083 u64 timestamp,
1093 struct thread *this_thread __used) 1084 struct thread *this_thread __used)
1094{ 1085{
1095 struct work_atoms *atoms; 1086 struct thread *thread = threads__findnew(runtime_event->pid);
1096 struct thread *thread; 1087 struct work_atoms *atoms = thread_atoms_search(&atom_root, thread, &cmp_pid);
1097 1088
1098 BUG_ON(cpu >= MAX_CPUS || cpu < 0); 1089 BUG_ON(cpu >= MAX_CPUS || cpu < 0);
1099
1100 thread = threads__findnew(runtime_event->pid, &threads, &last_match);
1101 atoms = thread_atoms_search(&atom_root, thread, &cmp_pid);
1102 if (!atoms) { 1090 if (!atoms) {
1103 thread_atoms_insert(thread); 1091 thread_atoms_insert(thread);
1104 atoms = thread_atoms_search(&atom_root, thread, &cmp_pid); 1092 atoms = thread_atoms_search(&atom_root, thread, &cmp_pid);
@@ -1125,7 +1113,7 @@ latency_wakeup_event(struct trace_wakeup_event *wakeup_event,
1125 if (!wakeup_event->success) 1113 if (!wakeup_event->success)
1126 return; 1114 return;
1127 1115
1128 wakee = threads__findnew(wakeup_event->pid, &threads, &last_match); 1116 wakee = threads__findnew(wakeup_event->pid);
1129 atoms = thread_atoms_search(&atom_root, wakee, &cmp_pid); 1117 atoms = thread_atoms_search(&atom_root, wakee, &cmp_pid);
1130 if (!atoms) { 1118 if (!atoms) {
1131 thread_atoms_insert(wakee); 1119 thread_atoms_insert(wakee);
@@ -1139,7 +1127,12 @@ latency_wakeup_event(struct trace_wakeup_event *wakeup_event,
1139 1127
1140 atom = list_entry(atoms->work_list.prev, struct work_atom, list); 1128 atom = list_entry(atoms->work_list.prev, struct work_atom, list);
1141 1129
1142 if (atom->state != THREAD_SLEEPING) 1130 /*
1131 * You WILL be missing events if you've recorded only
1132 * one CPU, or are only looking at only one, so don't
1133 * make useless noise.
1134 */
1135 if (profile_cpu == -1 && atom->state != THREAD_SLEEPING)
1143 nr_state_machine_bugs++; 1136 nr_state_machine_bugs++;
1144 1137
1145 nr_timestamps++; 1138 nr_timestamps++;
@@ -1152,11 +1145,51 @@ latency_wakeup_event(struct trace_wakeup_event *wakeup_event,
1152 atom->wake_up_time = timestamp; 1145 atom->wake_up_time = timestamp;
1153} 1146}
1154 1147
1148static void
1149latency_migrate_task_event(struct trace_migrate_task_event *migrate_task_event,
1150 struct event *__event __used,
1151 int cpu __used,
1152 u64 timestamp,
1153 struct thread *thread __used)
1154{
1155 struct work_atoms *atoms;
1156 struct work_atom *atom;
1157 struct thread *migrant;
1158
1159 /*
1160 * Only need to worry about migration when profiling one CPU.
1161 */
1162 if (profile_cpu == -1)
1163 return;
1164
1165 migrant = threads__findnew(migrate_task_event->pid);
1166 atoms = thread_atoms_search(&atom_root, migrant, &cmp_pid);
1167 if (!atoms) {
1168 thread_atoms_insert(migrant);
1169 register_pid(migrant->pid, migrant->comm);
1170 atoms = thread_atoms_search(&atom_root, migrant, &cmp_pid);
1171 if (!atoms)
1172 die("migration-event: Internal tree error");
1173 add_sched_out_event(atoms, 'R', timestamp);
1174 }
1175
1176 BUG_ON(list_empty(&atoms->work_list));
1177
1178 atom = list_entry(atoms->work_list.prev, struct work_atom, list);
1179 atom->sched_in_time = atom->sched_out_time = atom->wake_up_time = timestamp;
1180
1181 nr_timestamps++;
1182
1183 if (atom->sched_out_time > timestamp)
1184 nr_unordered_timestamps++;
1185}
1186
1155static struct trace_sched_handler lat_ops = { 1187static struct trace_sched_handler lat_ops = {
1156 .wakeup_event = latency_wakeup_event, 1188 .wakeup_event = latency_wakeup_event,
1157 .switch_event = latency_switch_event, 1189 .switch_event = latency_switch_event,
1158 .runtime_event = latency_runtime_event, 1190 .runtime_event = latency_runtime_event,
1159 .fork_event = latency_fork_event, 1191 .fork_event = latency_fork_event,
1192 .migrate_task_event = latency_migrate_task_event,
1160}; 1193};
1161 1194
1162static void output_lat_thread(struct work_atoms *work_list) 1195static void output_lat_thread(struct work_atoms *work_list)
@@ -1385,8 +1418,8 @@ map_switch_event(struct trace_switch_event *switch_event,
1385 die("hm, delta: %Ld < 0 ?\n", delta); 1418 die("hm, delta: %Ld < 0 ?\n", delta);
1386 1419
1387 1420
1388 sched_out = threads__findnew(switch_event->prev_pid, &threads, &last_match); 1421 sched_out = threads__findnew(switch_event->prev_pid);
1389 sched_in = threads__findnew(switch_event->next_pid, &threads, &last_match); 1422 sched_in = threads__findnew(switch_event->next_pid);
1390 1423
1391 curr_thread[this_cpu] = sched_in; 1424 curr_thread[this_cpu] = sched_in;
1392 1425
@@ -1517,6 +1550,26 @@ process_sched_exit_event(struct event *event,
1517} 1550}
1518 1551
1519static void 1552static void
1553process_sched_migrate_task_event(struct raw_event_sample *raw,
1554 struct event *event,
1555 int cpu __used,
1556 u64 timestamp __used,
1557 struct thread *thread __used)
1558{
1559 struct trace_migrate_task_event migrate_task_event;
1560
1561 FILL_COMMON_FIELDS(migrate_task_event, event, raw->data);
1562
1563 FILL_ARRAY(migrate_task_event, comm, event, raw->data);
1564 FILL_FIELD(migrate_task_event, pid, event, raw->data);
1565 FILL_FIELD(migrate_task_event, prio, event, raw->data);
1566 FILL_FIELD(migrate_task_event, cpu, event, raw->data);
1567
1568 if (trace_handler->migrate_task_event)
1569 trace_handler->migrate_task_event(&migrate_task_event, event, cpu, timestamp, thread);
1570}
1571
1572static void
1520process_raw_event(event_t *raw_event __used, void *more_data, 1573process_raw_event(event_t *raw_event __used, void *more_data,
1521 int cpu, u64 timestamp, struct thread *thread) 1574 int cpu, u64 timestamp, struct thread *thread)
1522{ 1575{
@@ -1539,23 +1592,23 @@ process_raw_event(event_t *raw_event __used, void *more_data,
1539 process_sched_fork_event(raw, event, cpu, timestamp, thread); 1592 process_sched_fork_event(raw, event, cpu, timestamp, thread);
1540 if (!strcmp(event->name, "sched_process_exit")) 1593 if (!strcmp(event->name, "sched_process_exit"))
1541 process_sched_exit_event(event, cpu, timestamp, thread); 1594 process_sched_exit_event(event, cpu, timestamp, thread);
1595 if (!strcmp(event->name, "sched_migrate_task"))
1596 process_sched_migrate_task_event(raw, event, cpu, timestamp, thread);
1542} 1597}
1543 1598
1544static int 1599static int process_sample_event(event_t *event)
1545process_sample_event(event_t *event, unsigned long offset, unsigned long head)
1546{ 1600{
1547 char level;
1548 int show = 0;
1549 struct dso *dso = NULL;
1550 struct thread *thread; 1601 struct thread *thread;
1551 u64 ip = event->ip.ip; 1602 u64 ip = event->ip.ip;
1552 u64 timestamp = -1; 1603 u64 timestamp = -1;
1553 u32 cpu = -1; 1604 u32 cpu = -1;
1554 u64 period = 1; 1605 u64 period = 1;
1555 void *more_data = event->ip.__more_data; 1606 void *more_data = event->ip.__more_data;
1556 int cpumode;
1557 1607
1558 thread = threads__findnew(event->ip.pid, &threads, &last_match); 1608 if (!(sample_type & PERF_SAMPLE_RAW))
1609 return 0;
1610
1611 thread = threads__findnew(event->ip.pid);
1559 1612
1560 if (sample_type & PERF_SAMPLE_TIME) { 1613 if (sample_type & PERF_SAMPLE_TIME) {
1561 timestamp = *(u64 *)more_data; 1614 timestamp = *(u64 *)more_data;
@@ -1573,177 +1626,64 @@ process_sample_event(event_t *event, unsigned long offset, unsigned long head)
1573 more_data += sizeof(u64); 1626 more_data += sizeof(u64);
1574 } 1627 }
1575 1628
1576 dump_printf("%p [%p]: PERF_RECORD_SAMPLE (IP, %d): %d/%d: %p period: %Ld\n", 1629 dump_printf("(IP, %d): %d/%d: %p period: %Ld\n",
1577 (void *)(offset + head),
1578 (void *)(long)(event->header.size),
1579 event->header.misc, 1630 event->header.misc,
1580 event->ip.pid, event->ip.tid, 1631 event->ip.pid, event->ip.tid,
1581 (void *)(long)ip, 1632 (void *)(long)ip,
1582 (long long)period); 1633 (long long)period);
1583 1634
1584 dump_printf(" ... thread: %s:%d\n", thread->comm, thread->pid);
1585
1586 if (thread == NULL) { 1635 if (thread == NULL) {
1587 eprintf("problem processing %d event, skipping it.\n", 1636 pr_debug("problem processing %d event, skipping it.\n",
1588 event->header.type); 1637 event->header.type);
1589 return -1; 1638 return -1;
1590 } 1639 }
1591 1640
1592 cpumode = event->header.misc & PERF_RECORD_MISC_CPUMODE_MASK; 1641 dump_printf(" ... thread: %s:%d\n", thread->comm, thread->pid);
1593
1594 if (cpumode == PERF_RECORD_MISC_KERNEL) {
1595 show = SHOW_KERNEL;
1596 level = 'k';
1597
1598 dso = kernel_dso;
1599
1600 dump_printf(" ...... dso: %s\n", dso->name);
1601
1602 } else if (cpumode == PERF_RECORD_MISC_USER) {
1603
1604 show = SHOW_USER;
1605 level = '.';
1606
1607 } else {
1608 show = SHOW_HV;
1609 level = 'H';
1610
1611 dso = hypervisor_dso;
1612 1642
1613 dump_printf(" ...... dso: [hypervisor]\n"); 1643 if (profile_cpu != -1 && profile_cpu != (int) cpu)
1614 } 1644 return 0;
1615 1645
1616 if (sample_type & PERF_SAMPLE_RAW) 1646 process_raw_event(event, more_data, cpu, timestamp, thread);
1617 process_raw_event(event, more_data, cpu, timestamp, thread);
1618 1647
1619 return 0; 1648 return 0;
1620} 1649}
1621 1650
1622static int 1651static int process_lost_event(event_t *event __used)
1623process_event(event_t *event, unsigned long offset, unsigned long head)
1624{ 1652{
1625 trace_event(event); 1653 nr_lost_chunks++;
1626 1654 nr_lost_events += event->lost.lost;
1627 nr_events++;
1628 switch (event->header.type) {
1629 case PERF_RECORD_MMAP:
1630 return 0;
1631 case PERF_RECORD_LOST:
1632 nr_lost_chunks++;
1633 nr_lost_events += event->lost.lost;
1634 return 0;
1635
1636 case PERF_RECORD_COMM:
1637 return process_comm_event(event, offset, head);
1638 1655
1639 case PERF_RECORD_EXIT ... PERF_RECORD_READ: 1656 return 0;
1640 return 0; 1657}
1641 1658
1642 case PERF_RECORD_SAMPLE: 1659static int sample_type_check(u64 type)
1643 return process_sample_event(event, offset, head); 1660{
1661 sample_type = type;
1644 1662
1645 case PERF_RECORD_MAX: 1663 if (!(sample_type & PERF_SAMPLE_RAW)) {
1646 default: 1664 fprintf(stderr,
1665 "No trace sample to read. Did you call perf record "
1666 "without -R?");
1647 return -1; 1667 return -1;
1648 } 1668 }
1649 1669
1650 return 0; 1670 return 0;
1651} 1671}
1652 1672
1673static struct perf_file_handler file_handler = {
1674 .process_sample_event = process_sample_event,
1675 .process_comm_event = event__process_comm,
1676 .process_lost_event = process_lost_event,
1677 .sample_type_check = sample_type_check,
1678};
1679
1653static int read_events(void) 1680static int read_events(void)
1654{ 1681{
1655 int ret, rc = EXIT_FAILURE; 1682 register_idle_thread();
1656 unsigned long offset = 0; 1683 register_perf_file_handler(&file_handler);
1657 unsigned long head = 0;
1658 struct stat perf_stat;
1659 event_t *event;
1660 uint32_t size;
1661 char *buf;
1662
1663 trace_report();
1664 register_idle_thread(&threads, &last_match);
1665
1666 input = open(input_name, O_RDONLY);
1667 if (input < 0) {
1668 perror("failed to open file");
1669 exit(-1);
1670 }
1671
1672 ret = fstat(input, &perf_stat);
1673 if (ret < 0) {
1674 perror("failed to stat file");
1675 exit(-1);
1676 }
1677
1678 if (!perf_stat.st_size) {
1679 fprintf(stderr, "zero-sized file, nothing to do!\n");
1680 exit(0);
1681 }
1682 header = perf_header__read(input);
1683 head = header->data_offset;
1684 sample_type = perf_header__sample_type(header);
1685
1686 if (!(sample_type & PERF_SAMPLE_RAW))
1687 die("No trace sample to read. Did you call perf record "
1688 "without -R?");
1689
1690 if (load_kernel() < 0) {
1691 perror("failed to load kernel symbols");
1692 return EXIT_FAILURE;
1693 }
1694
1695remap:
1696 buf = (char *)mmap(NULL, page_size * mmap_window, PROT_READ,
1697 MAP_SHARED, input, offset);
1698 if (buf == MAP_FAILED) {
1699 perror("failed to mmap file");
1700 exit(-1);
1701 }
1702
1703more:
1704 event = (event_t *)(buf + head);
1705
1706 size = event->header.size;
1707 if (!size)
1708 size = 8;
1709
1710 if (head + event->header.size >= page_size * mmap_window) {
1711 unsigned long shift = page_size * (head / page_size);
1712 int res;
1713
1714 res = munmap(buf, page_size * mmap_window);
1715 assert(res == 0);
1716
1717 offset += shift;
1718 head -= shift;
1719 goto remap;
1720 }
1721
1722 size = event->header.size;
1723
1724
1725 if (!size || process_event(event, offset, head) < 0) {
1726
1727 /*
1728 * assume we lost track of the stream, check alignment, and
1729 * increment a single u64 in the hope to catch on again 'soon'.
1730 */
1731
1732 if (unlikely(head & 7))
1733 head &= ~7ULL;
1734
1735 size = 8;
1736 }
1737
1738 head += size;
1739
1740 if (offset + head < (unsigned long)perf_stat.st_size)
1741 goto more;
1742
1743 rc = EXIT_SUCCESS;
1744 close(input);
1745 1684
1746 return rc; 1685 return mmap_dispatch_perf_file(&header, input_name, 0, 0,
1686 &event__cwdlen, &event__cwd);
1747} 1687}
1748 1688
1749static void print_bad_events(void) 1689static void print_bad_events(void)
@@ -1883,6 +1823,8 @@ static const struct option latency_options[] = {
1883 "sort by key(s): runtime, switch, avg, max"), 1823 "sort by key(s): runtime, switch, avg, max"),
1884 OPT_BOOLEAN('v', "verbose", &verbose, 1824 OPT_BOOLEAN('v', "verbose", &verbose,
1885 "be more verbose (show symbol address, etc)"), 1825 "be more verbose (show symbol address, etc)"),
1826 OPT_INTEGER('C', "CPU", &profile_cpu,
1827 "CPU to profile on"),
1886 OPT_BOOLEAN('D', "dump-raw-trace", &dump_trace, 1828 OPT_BOOLEAN('D', "dump-raw-trace", &dump_trace,
1887 "dump raw trace in ASCII"), 1829 "dump raw trace in ASCII"),
1888 OPT_END() 1830 OPT_END()
@@ -1960,8 +1902,7 @@ static int __cmd_record(int argc, const char **argv)
1960 1902
1961int cmd_sched(int argc, const char **argv, const char *prefix __used) 1903int cmd_sched(int argc, const char **argv, const char *prefix __used)
1962{ 1904{
1963 symbol__init(); 1905 symbol__init(0);
1964 page_size = getpagesize();
1965 1906
1966 argc = parse_options(argc, argv, sched_options, sched_usage, 1907 argc = parse_options(argc, argv, sched_options, sched_usage,
1967 PARSE_OPT_STOP_AT_NON_OPTION); 1908 PARSE_OPT_STOP_AT_NON_OPTION);
diff --git a/tools/perf/builtin-stat.c b/tools/perf/builtin-stat.c
index 3db31e7bf173..c70d72003557 100644
--- a/tools/perf/builtin-stat.c
+++ b/tools/perf/builtin-stat.c
@@ -50,15 +50,17 @@
50 50
51static struct perf_event_attr default_attrs[] = { 51static struct perf_event_attr default_attrs[] = {
52 52
53 { .type = PERF_TYPE_SOFTWARE, .config = PERF_COUNT_SW_TASK_CLOCK }, 53 { .type = PERF_TYPE_SOFTWARE, .config = PERF_COUNT_SW_TASK_CLOCK },
54 { .type = PERF_TYPE_SOFTWARE, .config = PERF_COUNT_SW_CONTEXT_SWITCHES}, 54 { .type = PERF_TYPE_SOFTWARE, .config = PERF_COUNT_SW_CONTEXT_SWITCHES },
55 { .type = PERF_TYPE_SOFTWARE, .config = PERF_COUNT_SW_CPU_MIGRATIONS }, 55 { .type = PERF_TYPE_SOFTWARE, .config = PERF_COUNT_SW_CPU_MIGRATIONS },
56 { .type = PERF_TYPE_SOFTWARE, .config = PERF_COUNT_SW_PAGE_FAULTS }, 56 { .type = PERF_TYPE_SOFTWARE, .config = PERF_COUNT_SW_PAGE_FAULTS },
57 57
58 { .type = PERF_TYPE_HARDWARE, .config = PERF_COUNT_HW_CPU_CYCLES }, 58 { .type = PERF_TYPE_HARDWARE, .config = PERF_COUNT_HW_CPU_CYCLES },
59 { .type = PERF_TYPE_HARDWARE, .config = PERF_COUNT_HW_INSTRUCTIONS }, 59 { .type = PERF_TYPE_HARDWARE, .config = PERF_COUNT_HW_INSTRUCTIONS },
60 { .type = PERF_TYPE_HARDWARE, .config = PERF_COUNT_HW_CACHE_REFERENCES}, 60 { .type = PERF_TYPE_HARDWARE, .config = PERF_COUNT_HW_BRANCH_INSTRUCTIONS },
61 { .type = PERF_TYPE_HARDWARE, .config = PERF_COUNT_HW_CACHE_MISSES }, 61 { .type = PERF_TYPE_HARDWARE, .config = PERF_COUNT_HW_BRANCH_MISSES },
62 { .type = PERF_TYPE_HARDWARE, .config = PERF_COUNT_HW_CACHE_REFERENCES },
63 { .type = PERF_TYPE_HARDWARE, .config = PERF_COUNT_HW_CACHE_MISSES },
62 64
63}; 65};
64 66
@@ -125,6 +127,7 @@ struct stats event_res_stats[MAX_COUNTERS][3];
125struct stats runtime_nsecs_stats; 127struct stats runtime_nsecs_stats;
126struct stats walltime_nsecs_stats; 128struct stats walltime_nsecs_stats;
127struct stats runtime_cycles_stats; 129struct stats runtime_cycles_stats;
130struct stats runtime_branches_stats;
128 131
129#define MATCH_EVENT(t, c, counter) \ 132#define MATCH_EVENT(t, c, counter) \
130 (attrs[counter].type == PERF_TYPE_##t && \ 133 (attrs[counter].type == PERF_TYPE_##t && \
@@ -235,6 +238,8 @@ static void read_counter(int counter)
235 update_stats(&runtime_nsecs_stats, count[0]); 238 update_stats(&runtime_nsecs_stats, count[0]);
236 if (MATCH_EVENT(HARDWARE, HW_CPU_CYCLES, counter)) 239 if (MATCH_EVENT(HARDWARE, HW_CPU_CYCLES, counter))
237 update_stats(&runtime_cycles_stats, count[0]); 240 update_stats(&runtime_cycles_stats, count[0]);
241 if (MATCH_EVENT(HARDWARE, HW_BRANCH_INSTRUCTIONS, counter))
242 update_stats(&runtime_branches_stats, count[0]);
238} 243}
239 244
240static int run_perf_stat(int argc __used, const char **argv) 245static int run_perf_stat(int argc __used, const char **argv)
@@ -352,7 +357,16 @@ static void abs_printout(int counter, double avg)
352 ratio = avg / total; 357 ratio = avg / total;
353 358
354 fprintf(stderr, " # %10.3f IPC ", ratio); 359 fprintf(stderr, " # %10.3f IPC ", ratio);
355 } else { 360 } else if (MATCH_EVENT(HARDWARE, HW_BRANCH_MISSES, counter) &&
361 runtime_branches_stats.n != 0) {
362 total = avg_stats(&runtime_branches_stats);
363
364 if (total)
365 ratio = avg * 100 / total;
366
367 fprintf(stderr, " # %10.3f %% ", ratio);
368
369 } else if (runtime_nsecs_stats.n != 0) {
356 total = avg_stats(&runtime_nsecs_stats); 370 total = avg_stats(&runtime_nsecs_stats);
357 371
358 if (total) 372 if (total)
diff --git a/tools/perf/builtin-timechart.c b/tools/perf/builtin-timechart.c
index e8a510d935e5..cb58b6605fcc 100644
--- a/tools/perf/builtin-timechart.c
+++ b/tools/perf/builtin-timechart.c
@@ -29,14 +29,14 @@
29#include "util/header.h" 29#include "util/header.h"
30#include "util/parse-options.h" 30#include "util/parse-options.h"
31#include "util/parse-events.h" 31#include "util/parse-events.h"
32#include "util/event.h"
33#include "util/data_map.h"
32#include "util/svghelper.h" 34#include "util/svghelper.h"
33 35
34static char const *input_name = "perf.data"; 36static char const *input_name = "perf.data";
35static char const *output_name = "output.svg"; 37static char const *output_name = "output.svg";
36 38
37 39
38static unsigned long page_size;
39static unsigned long mmap_window = 32;
40static u64 sample_type; 40static u64 sample_type;
41 41
42static unsigned int numcpus; 42static unsigned int numcpus;
@@ -49,8 +49,6 @@ static u64 first_time, last_time;
49static int power_only; 49static int power_only;
50 50
51 51
52static struct perf_header *header;
53
54struct per_pid; 52struct per_pid;
55struct per_pidcomm; 53struct per_pidcomm;
56 54
@@ -153,6 +151,17 @@ static struct wake_event *wake_events;
153 151
154struct sample_wrapper *all_samples; 152struct sample_wrapper *all_samples;
155 153
154
155struct process_filter;
156struct process_filter {
157 char *name;
158 int pid;
159 struct process_filter *next;
160};
161
162static struct process_filter *process_filter;
163
164
156static struct per_pid *find_create_pid(int pid) 165static struct per_pid *find_create_pid(int pid)
157{ 166{
158 struct per_pid *cursor = all_data; 167 struct per_pid *cursor = all_data;
@@ -763,11 +772,11 @@ static void draw_wakeups(void)
763 c = p->all; 772 c = p->all;
764 while (c) { 773 while (c) {
765 if (c->Y && c->start_time <= we->time && c->end_time >= we->time) { 774 if (c->Y && c->start_time <= we->time && c->end_time >= we->time) {
766 if (p->pid == we->waker) { 775 if (p->pid == we->waker && !from) {
767 from = c->Y; 776 from = c->Y;
768 task_from = strdup(c->comm); 777 task_from = strdup(c->comm);
769 } 778 }
770 if (p->pid == we->wakee) { 779 if (p->pid == we->wakee && !to) {
771 to = c->Y; 780 to = c->Y;
772 task_to = strdup(c->comm); 781 task_to = strdup(c->comm);
773 } 782 }
@@ -882,12 +891,89 @@ static void draw_process_bars(void)
882 } 891 }
883} 892}
884 893
894static void add_process_filter(const char *string)
895{
896 struct process_filter *filt;
897 int pid;
898
899 pid = strtoull(string, NULL, 10);
900 filt = malloc(sizeof(struct process_filter));
901 if (!filt)
902 return;
903
904 filt->name = strdup(string);
905 filt->pid = pid;
906 filt->next = process_filter;
907
908 process_filter = filt;
909}
910
911static int passes_filter(struct per_pid *p, struct per_pidcomm *c)
912{
913 struct process_filter *filt;
914 if (!process_filter)
915 return 1;
916
917 filt = process_filter;
918 while (filt) {
919 if (filt->pid && p->pid == filt->pid)
920 return 1;
921 if (strcmp(filt->name, c->comm) == 0)
922 return 1;
923 filt = filt->next;
924 }
925 return 0;
926}
927
928static int determine_display_tasks_filtered(void)
929{
930 struct per_pid *p;
931 struct per_pidcomm *c;
932 int count = 0;
933
934 p = all_data;
935 while (p) {
936 p->display = 0;
937 if (p->start_time == 1)
938 p->start_time = first_time;
939
940 /* no exit marker, task kept running to the end */
941 if (p->end_time == 0)
942 p->end_time = last_time;
943
944 c = p->all;
945
946 while (c) {
947 c->display = 0;
948
949 if (c->start_time == 1)
950 c->start_time = first_time;
951
952 if (passes_filter(p, c)) {
953 c->display = 1;
954 p->display = 1;
955 count++;
956 }
957
958 if (c->end_time == 0)
959 c->end_time = last_time;
960
961 c = c->next;
962 }
963 p = p->next;
964 }
965 return count;
966}
967
885static int determine_display_tasks(u64 threshold) 968static int determine_display_tasks(u64 threshold)
886{ 969{
887 struct per_pid *p; 970 struct per_pid *p;
888 struct per_pidcomm *c; 971 struct per_pidcomm *c;
889 int count = 0; 972 int count = 0;
890 973
974 if (process_filter)
975 return determine_display_tasks_filtered();
976
891 p = all_data; 977 p = all_data;
892 while (p) { 978 while (p) {
893 p->display = 0; 979 p->display = 0;
@@ -957,36 +1043,6 @@ static void write_svg_file(const char *filename)
957 svg_close(); 1043 svg_close();
958} 1044}
959 1045
960static int
961process_event(event_t *event)
962{
963
964 switch (event->header.type) {
965
966 case PERF_RECORD_COMM:
967 return process_comm_event(event);
968 case PERF_RECORD_FORK:
969 return process_fork_event(event);
970 case PERF_RECORD_EXIT:
971 return process_exit_event(event);
972 case PERF_RECORD_SAMPLE:
973 return queue_sample_event(event);
974
975 /*
976 * We dont process them right now but they are fine:
977 */
978 case PERF_RECORD_MMAP:
979 case PERF_RECORD_THROTTLE:
980 case PERF_RECORD_UNTHROTTLE:
981 return 0;
982
983 default:
984 return -1;
985 }
986
987 return 0;
988}
989
990static void process_samples(void) 1046static void process_samples(void)
991{ 1047{
992 struct sample_wrapper *cursor; 1048 struct sample_wrapper *cursor;
@@ -1002,107 +1058,38 @@ static void process_samples(void)
1002 } 1058 }
1003} 1059}
1004 1060
1005 1061static int sample_type_check(u64 type)
1006static int __cmd_timechart(void)
1007{ 1062{
1008 int ret, rc = EXIT_FAILURE; 1063 sample_type = type;
1009 unsigned long offset = 0;
1010 unsigned long head, shift;
1011 struct stat statbuf;
1012 event_t *event;
1013 uint32_t size;
1014 char *buf;
1015 int input;
1016
1017 input = open(input_name, O_RDONLY);
1018 if (input < 0) {
1019 fprintf(stderr, " failed to open file: %s", input_name);
1020 if (!strcmp(input_name, "perf.data"))
1021 fprintf(stderr, " (try 'perf record' first)");
1022 fprintf(stderr, "\n");
1023 exit(-1);
1024 }
1025
1026 ret = fstat(input, &statbuf);
1027 if (ret < 0) {
1028 perror("failed to stat file");
1029 exit(-1);
1030 }
1031
1032 if (!statbuf.st_size) {
1033 fprintf(stderr, "zero-sized file, nothing to do!\n");
1034 exit(0);
1035 }
1036
1037 header = perf_header__read(input);
1038 head = header->data_offset;
1039
1040 sample_type = perf_header__sample_type(header);
1041 1064
1042 shift = page_size * (head / page_size); 1065 if (!(sample_type & PERF_SAMPLE_RAW)) {
1043 offset += shift; 1066 fprintf(stderr, "No trace samples found in the file.\n"
1044 head -= shift; 1067 "Have you used 'perf timechart record' to record it?\n");
1045 1068 return -1;
1046remap:
1047 buf = (char *)mmap(NULL, page_size * mmap_window, PROT_READ,
1048 MAP_SHARED, input, offset);
1049 if (buf == MAP_FAILED) {
1050 perror("failed to mmap file");
1051 exit(-1);
1052 }
1053
1054more:
1055 event = (event_t *)(buf + head);
1056
1057 size = event->header.size;
1058 if (!size)
1059 size = 8;
1060
1061 if (head + event->header.size >= page_size * mmap_window) {
1062 int ret2;
1063
1064 shift = page_size * (head / page_size);
1065
1066 ret2 = munmap(buf, page_size * mmap_window);
1067 assert(ret2 == 0);
1068
1069 offset += shift;
1070 head -= shift;
1071 goto remap;
1072 }
1073
1074 size = event->header.size;
1075
1076 if (!size || process_event(event) < 0) {
1077
1078 printf("%p [%p]: skipping unknown header type: %d\n",
1079 (void *)(offset + head),
1080 (void *)(long)(event->header.size),
1081 event->header.type);
1082
1083 /*
1084 * assume we lost track of the stream, check alignment, and
1085 * increment a single u64 in the hope to catch on again 'soon'.
1086 */
1087
1088 if (unlikely(head & 7))
1089 head &= ~7ULL;
1090
1091 size = 8;
1092 } 1069 }
1093 1070
1094 head += size; 1071 return 0;
1072}
1095 1073
1096 if (offset + head >= header->data_offset + header->data_size) 1074static struct perf_file_handler file_handler = {
1097 goto done; 1075 .process_comm_event = process_comm_event,
1076 .process_fork_event = process_fork_event,
1077 .process_exit_event = process_exit_event,
1078 .process_sample_event = queue_sample_event,
1079 .sample_type_check = sample_type_check,
1080};
1098 1081
1099 if (offset + head < (unsigned long)statbuf.st_size) 1082static int __cmd_timechart(void)
1100 goto more; 1083{
1084 struct perf_header *header;
1085 int ret;
1101 1086
1102done: 1087 register_perf_file_handler(&file_handler);
1103 rc = EXIT_SUCCESS;
1104 close(input);
1105 1088
1089 ret = mmap_dispatch_perf_file(&header, input_name, 0, 0,
1090 &event__cwdlen, &event__cwd);
1091 if (ret)
1092 return EXIT_FAILURE;
1106 1093
1107 process_samples(); 1094 process_samples();
1108 1095
@@ -1112,9 +1099,10 @@ done:
1112 1099
1113 write_svg_file(output_name); 1100 write_svg_file(output_name);
1114 1101
1115 printf("Written %2.1f seconds of trace to %s.\n", (last_time - first_time) / 1000000000.0, output_name); 1102 pr_info("Written %2.1f seconds of trace to %s.\n",
1103 (last_time - first_time) / 1000000000.0, output_name);
1116 1104
1117 return rc; 1105 return EXIT_SUCCESS;
1118} 1106}
1119 1107
1120static const char * const timechart_usage[] = { 1108static const char * const timechart_usage[] = {
@@ -1153,6 +1141,14 @@ static int __cmd_record(int argc, const char **argv)
1153 return cmd_record(i, rec_argv, NULL); 1141 return cmd_record(i, rec_argv, NULL);
1154} 1142}
1155 1143
1144static int
1145parse_process(const struct option *opt __used, const char *arg, int __used unset)
1146{
1147 if (arg)
1148 add_process_filter(arg);
1149 return 0;
1150}
1151
1156static const struct option options[] = { 1152static const struct option options[] = {
1157 OPT_STRING('i', "input", &input_name, "file", 1153 OPT_STRING('i', "input", &input_name, "file",
1158 "input file name"), 1154 "input file name"),
@@ -1160,17 +1156,18 @@ static const struct option options[] = {
1160 "output file name"), 1156 "output file name"),
1161 OPT_INTEGER('w', "width", &svg_page_width, 1157 OPT_INTEGER('w', "width", &svg_page_width,
1162 "page width"), 1158 "page width"),
1163 OPT_BOOLEAN('p', "power-only", &power_only, 1159 OPT_BOOLEAN('P', "power-only", &power_only,
1164 "output power data only"), 1160 "output power data only"),
1161 OPT_CALLBACK('p', "process", NULL, "process",
1162 "process selector. Pass a pid or process name.",
1163 parse_process),
1165 OPT_END() 1164 OPT_END()
1166}; 1165};
1167 1166
1168 1167
1169int cmd_timechart(int argc, const char **argv, const char *prefix __used) 1168int cmd_timechart(int argc, const char **argv, const char *prefix __used)
1170{ 1169{
1171 symbol__init(); 1170 symbol__init(0);
1172
1173 page_size = getpagesize();
1174 1171
1175 argc = parse_options(argc, argv, options, timechart_usage, 1172 argc = parse_options(argc, argv, options, timechart_usage,
1176 PARSE_OPT_STOP_AT_NON_OPTION); 1173 PARSE_OPT_STOP_AT_NON_OPTION);
diff --git a/tools/perf/builtin-top.c b/tools/perf/builtin-top.c
index a1b1d10912dc..e0a374d0e43a 100644
--- a/tools/perf/builtin-top.c
+++ b/tools/perf/builtin-top.c
@@ -22,6 +22,7 @@
22 22
23#include "util/symbol.h" 23#include "util/symbol.h"
24#include "util/color.h" 24#include "util/color.h"
25#include "util/thread.h"
25#include "util/util.h" 26#include "util/util.h"
26#include <linux/rbtree.h> 27#include <linux/rbtree.h>
27#include "util/parse-options.h" 28#include "util/parse-options.h"
@@ -54,26 +55,31 @@
54 55
55static int fd[MAX_NR_CPUS][MAX_COUNTERS]; 56static int fd[MAX_NR_CPUS][MAX_COUNTERS];
56 57
57static int system_wide = 0; 58static int system_wide = 0;
58 59
59static int default_interval = 100000; 60static int default_interval = 0;
60 61
61static int count_filter = 5; 62static int count_filter = 5;
62static int print_entries = 15; 63static int print_entries;
63 64
64static int target_pid = -1; 65static int target_pid = -1;
65static int inherit = 0; 66static int inherit = 0;
66static int profile_cpu = -1; 67static int profile_cpu = -1;
67static int nr_cpus = 0; 68static int nr_cpus = 0;
68static unsigned int realtime_prio = 0; 69static unsigned int realtime_prio = 0;
69static int group = 0; 70static int group = 0;
70static unsigned int page_size; 71static unsigned int page_size;
71static unsigned int mmap_pages = 16; 72static unsigned int mmap_pages = 16;
72static int freq = 0; 73static int freq = 1000; /* 1 KHz */
73 74
74static int delay_secs = 2; 75static int delay_secs = 2;
75static int zero; 76static int zero = 0;
76static int dump_symtab; 77static int dump_symtab = 0;
78
79static bool hide_kernel_symbols = false;
80static bool hide_user_symbols = false;
81static struct winsize winsize;
82struct symbol_conf symbol_conf;
77 83
78/* 84/*
79 * Source 85 * Source
@@ -86,83 +92,126 @@ struct source_line {
86 struct source_line *next; 92 struct source_line *next;
87}; 93};
88 94
89static char *sym_filter = NULL; 95static char *sym_filter = NULL;
90struct sym_entry *sym_filter_entry = NULL; 96struct sym_entry *sym_filter_entry = NULL;
91static int sym_pcnt_filter = 5; 97static int sym_pcnt_filter = 5;
92static int sym_counter = 0; 98static int sym_counter = 0;
93static int display_weighted = -1; 99static int display_weighted = -1;
94 100
95/* 101/*
96 * Symbols 102 * Symbols
97 */ 103 */
98 104
99static u64 min_ip; 105struct sym_entry_source {
100static u64 max_ip = -1ll; 106 struct source_line *source;
107 struct source_line *lines;
108 struct source_line **lines_tail;
109 pthread_mutex_t lock;
110};
101 111
102struct sym_entry { 112struct sym_entry {
103 struct rb_node rb_node; 113 struct rb_node rb_node;
104 struct list_head node; 114 struct list_head node;
105 unsigned long count[MAX_COUNTERS];
106 unsigned long snap_count; 115 unsigned long snap_count;
107 double weight; 116 double weight;
108 int skip; 117 int skip;
109 struct source_line *source; 118 u16 name_len;
110 struct source_line *lines; 119 u8 origin;
111 struct source_line **lines_tail; 120 struct map *map;
112 pthread_mutex_t source_lock; 121 struct sym_entry_source *src;
122 unsigned long count[0];
113}; 123};
114 124
115/* 125/*
116 * Source functions 126 * Source functions
117 */ 127 */
118 128
129static inline struct symbol *sym_entry__symbol(struct sym_entry *self)
130{
131 return ((void *)self) + symbol_conf.priv_size;
132}
133
134static void get_term_dimensions(struct winsize *ws)
135{
136 char *s = getenv("LINES");
137
138 if (s != NULL) {
139 ws->ws_row = atoi(s);
140 s = getenv("COLUMNS");
141 if (s != NULL) {
142 ws->ws_col = atoi(s);
143 if (ws->ws_row && ws->ws_col)
144 return;
145 }
146 }
147#ifdef TIOCGWINSZ
148 if (ioctl(1, TIOCGWINSZ, ws) == 0 &&
149 ws->ws_row && ws->ws_col)
150 return;
151#endif
152 ws->ws_row = 25;
153 ws->ws_col = 80;
154}
155
156static void update_print_entries(struct winsize *ws)
157{
158 print_entries = ws->ws_row;
159
160 if (print_entries > 9)
161 print_entries -= 9;
162}
163
164static void sig_winch_handler(int sig __used)
165{
166 get_term_dimensions(&winsize);
167 update_print_entries(&winsize);
168}
169
119static void parse_source(struct sym_entry *syme) 170static void parse_source(struct sym_entry *syme)
120{ 171{
121 struct symbol *sym; 172 struct symbol *sym;
122 struct module *module; 173 struct sym_entry_source *source;
123 struct section *section = NULL; 174 struct map *map;
124 FILE *file; 175 FILE *file;
125 char command[PATH_MAX*2]; 176 char command[PATH_MAX*2];
126 const char *path = vmlinux_name; 177 const char *path;
127 u64 start, end, len; 178 u64 len;
128 179
129 if (!syme) 180 if (!syme)
130 return; 181 return;
131 182
132 if (syme->lines) { 183 if (syme->src == NULL) {
133 pthread_mutex_lock(&syme->source_lock); 184 syme->src = zalloc(sizeof(*source));
134 goto out_assign; 185 if (syme->src == NULL)
186 return;
187 pthread_mutex_init(&syme->src->lock, NULL);
135 } 188 }
136 189
137 sym = (struct symbol *)(syme + 1); 190 source = syme->src;
138 module = sym->module;
139
140 if (module)
141 path = module->path;
142 if (!path)
143 return;
144
145 start = sym->obj_start;
146 if (!start)
147 start = sym->start;
148 191
149 if (module) { 192 if (source->lines) {
150 section = module->sections->find_section(module->sections, ".text"); 193 pthread_mutex_lock(&source->lock);
151 if (section) 194 goto out_assign;
152 start -= section->vma;
153 } 195 }
154 196
155 end = start + sym->end - sym->start + 1; 197 sym = sym_entry__symbol(syme);
198 map = syme->map;
199 path = map->dso->long_name;
200
156 len = sym->end - sym->start; 201 len = sym->end - sym->start;
157 202
158 sprintf(command, "objdump --start-address=0x%016Lx --stop-address=0x%016Lx -dS %s", start, end, path); 203 sprintf(command,
204 "objdump --start-address=0x%016Lx "
205 "--stop-address=0x%016Lx -dS %s",
206 map->unmap_ip(map, sym->start),
207 map->unmap_ip(map, sym->end), path);
159 208
160 file = popen(command, "r"); 209 file = popen(command, "r");
161 if (!file) 210 if (!file)
162 return; 211 return;
163 212
164 pthread_mutex_lock(&syme->source_lock); 213 pthread_mutex_lock(&source->lock);
165 syme->lines_tail = &syme->lines; 214 source->lines_tail = &source->lines;
166 while (!feof(file)) { 215 while (!feof(file)) {
167 struct source_line *src; 216 struct source_line *src;
168 size_t dummy = 0; 217 size_t dummy = 0;
@@ -182,24 +231,22 @@ static void parse_source(struct sym_entry *syme)
182 *c = 0; 231 *c = 0;
183 232
184 src->next = NULL; 233 src->next = NULL;
185 *syme->lines_tail = src; 234 *source->lines_tail = src;
186 syme->lines_tail = &src->next; 235 source->lines_tail = &src->next;
187 236
188 if (strlen(src->line)>8 && src->line[8] == ':') { 237 if (strlen(src->line)>8 && src->line[8] == ':') {
189 src->eip = strtoull(src->line, NULL, 16); 238 src->eip = strtoull(src->line, NULL, 16);
190 if (section) 239 src->eip = map->unmap_ip(map, src->eip);
191 src->eip += section->vma;
192 } 240 }
193 if (strlen(src->line)>8 && src->line[16] == ':') { 241 if (strlen(src->line)>8 && src->line[16] == ':') {
194 src->eip = strtoull(src->line, NULL, 16); 242 src->eip = strtoull(src->line, NULL, 16);
195 if (section) 243 src->eip = map->unmap_ip(map, src->eip);
196 src->eip += section->vma;
197 } 244 }
198 } 245 }
199 pclose(file); 246 pclose(file);
200out_assign: 247out_assign:
201 sym_filter_entry = syme; 248 sym_filter_entry = syme;
202 pthread_mutex_unlock(&syme->source_lock); 249 pthread_mutex_unlock(&source->lock);
203} 250}
204 251
205static void __zero_source_counters(struct sym_entry *syme) 252static void __zero_source_counters(struct sym_entry *syme)
@@ -207,7 +254,7 @@ static void __zero_source_counters(struct sym_entry *syme)
207 int i; 254 int i;
208 struct source_line *line; 255 struct source_line *line;
209 256
210 line = syme->lines; 257 line = syme->src->lines;
211 while (line) { 258 while (line) {
212 for (i = 0; i < nr_counters; i++) 259 for (i = 0; i < nr_counters; i++)
213 line->count[i] = 0; 260 line->count[i] = 0;
@@ -222,13 +269,13 @@ static void record_precise_ip(struct sym_entry *syme, int counter, u64 ip)
222 if (syme != sym_filter_entry) 269 if (syme != sym_filter_entry)
223 return; 270 return;
224 271
225 if (pthread_mutex_trylock(&syme->source_lock)) 272 if (pthread_mutex_trylock(&syme->src->lock))
226 return; 273 return;
227 274
228 if (!syme->source) 275 if (syme->src == NULL || syme->src->source == NULL)
229 goto out_unlock; 276 goto out_unlock;
230 277
231 for (line = syme->lines; line; line = line->next) { 278 for (line = syme->src->lines; line; line = line->next) {
232 if (line->eip == ip) { 279 if (line->eip == ip) {
233 line->count[counter]++; 280 line->count[counter]++;
234 break; 281 break;
@@ -237,32 +284,25 @@ static void record_precise_ip(struct sym_entry *syme, int counter, u64 ip)
237 break; 284 break;
238 } 285 }
239out_unlock: 286out_unlock:
240 pthread_mutex_unlock(&syme->source_lock); 287 pthread_mutex_unlock(&syme->src->lock);
241} 288}
242 289
243static void lookup_sym_source(struct sym_entry *syme) 290static void lookup_sym_source(struct sym_entry *syme)
244{ 291{
245 struct symbol *symbol = (struct symbol *)(syme + 1); 292 struct symbol *symbol = sym_entry__symbol(syme);
246 struct source_line *line; 293 struct source_line *line;
247 char pattern[PATH_MAX]; 294 char pattern[PATH_MAX];
248 char *idx;
249 295
250 sprintf(pattern, "<%s>:", symbol->name); 296 sprintf(pattern, "<%s>:", symbol->name);
251 297
252 if (symbol->module) { 298 pthread_mutex_lock(&syme->src->lock);
253 idx = strstr(pattern, "\t"); 299 for (line = syme->src->lines; line; line = line->next) {
254 if (idx)
255 *idx = 0;
256 }
257
258 pthread_mutex_lock(&syme->source_lock);
259 for (line = syme->lines; line; line = line->next) {
260 if (strstr(line->line, pattern)) { 300 if (strstr(line->line, pattern)) {
261 syme->source = line; 301 syme->src->source = line;
262 break; 302 break;
263 } 303 }
264 } 304 }
265 pthread_mutex_unlock(&syme->source_lock); 305 pthread_mutex_unlock(&syme->src->lock);
266} 306}
267 307
268static void show_lines(struct source_line *queue, int count, int total) 308static void show_lines(struct source_line *queue, int count, int total)
@@ -292,24 +332,24 @@ static void show_details(struct sym_entry *syme)
292 if (!syme) 332 if (!syme)
293 return; 333 return;
294 334
295 if (!syme->source) 335 if (!syme->src->source)
296 lookup_sym_source(syme); 336 lookup_sym_source(syme);
297 337
298 if (!syme->source) 338 if (!syme->src->source)
299 return; 339 return;
300 340
301 symbol = (struct symbol *)(syme + 1); 341 symbol = sym_entry__symbol(syme);
302 printf("Showing %s for %s\n", event_name(sym_counter), symbol->name); 342 printf("Showing %s for %s\n", event_name(sym_counter), symbol->name);
303 printf(" Events Pcnt (>=%d%%)\n", sym_pcnt_filter); 343 printf(" Events Pcnt (>=%d%%)\n", sym_pcnt_filter);
304 344
305 pthread_mutex_lock(&syme->source_lock); 345 pthread_mutex_lock(&syme->src->lock);
306 line = syme->source; 346 line = syme->src->source;
307 while (line) { 347 while (line) {
308 total += line->count[sym_counter]; 348 total += line->count[sym_counter];
309 line = line->next; 349 line = line->next;
310 } 350 }
311 351
312 line = syme->source; 352 line = syme->src->source;
313 while (line) { 353 while (line) {
314 float pcnt = 0.0; 354 float pcnt = 0.0;
315 355
@@ -334,13 +374,13 @@ static void show_details(struct sym_entry *syme)
334 line->count[sym_counter] = zero ? 0 : line->count[sym_counter] * 7 / 8; 374 line->count[sym_counter] = zero ? 0 : line->count[sym_counter] * 7 / 8;
335 line = line->next; 375 line = line->next;
336 } 376 }
337 pthread_mutex_unlock(&syme->source_lock); 377 pthread_mutex_unlock(&syme->src->lock);
338 if (more) 378 if (more)
339 printf("%d lines not displayed, maybe increase display entries [e]\n", more); 379 printf("%d lines not displayed, maybe increase display entries [e]\n", more);
340} 380}
341 381
342/* 382/*
343 * Symbols will be added here in record_ip and will get out 383 * Symbols will be added here in event__process_sample and will get out
344 * after decayed. 384 * after decayed.
345 */ 385 */
346static LIST_HEAD(active_symbols); 386static LIST_HEAD(active_symbols);
@@ -411,6 +451,8 @@ static void print_sym_table(void)
411 struct sym_entry *syme, *n; 451 struct sym_entry *syme, *n;
412 struct rb_root tmp = RB_ROOT; 452 struct rb_root tmp = RB_ROOT;
413 struct rb_node *nd; 453 struct rb_node *nd;
454 int sym_width = 0, dso_width = 0, max_dso_width;
455 const int win_width = winsize.ws_col - 1;
414 456
415 samples = userspace_samples = 0; 457 samples = userspace_samples = 0;
416 458
@@ -422,6 +464,14 @@ static void print_sym_table(void)
422 list_for_each_entry_safe_from(syme, n, &active_symbols, node) { 464 list_for_each_entry_safe_from(syme, n, &active_symbols, node) {
423 syme->snap_count = syme->count[snap]; 465 syme->snap_count = syme->count[snap];
424 if (syme->snap_count != 0) { 466 if (syme->snap_count != 0) {
467
468 if ((hide_user_symbols &&
469 syme->origin == PERF_RECORD_MISC_USER) ||
470 (hide_kernel_symbols &&
471 syme->origin == PERF_RECORD_MISC_KERNEL)) {
472 list_remove_active_sym(syme);
473 continue;
474 }
425 syme->weight = sym_weight(syme); 475 syme->weight = sym_weight(syme);
426 rb_insert_active_sym(&tmp, syme); 476 rb_insert_active_sym(&tmp, syme);
427 sum_ksamples += syme->snap_count; 477 sum_ksamples += syme->snap_count;
@@ -434,8 +484,7 @@ static void print_sym_table(void)
434 484
435 puts(CONSOLE_CLEAR); 485 puts(CONSOLE_CLEAR);
436 486
437 printf( 487 printf("%-*.*s\n", win_width, win_width, graph_dotted_line);
438"------------------------------------------------------------------------------\n");
439 printf( " PerfTop:%8.0f irqs/sec kernel:%4.1f%% [", 488 printf( " PerfTop:%8.0f irqs/sec kernel:%4.1f%% [",
440 samples_per_sec, 489 samples_per_sec,
441 100.0 - (100.0*((samples_per_sec-ksamples_per_sec)/samples_per_sec))); 490 100.0 - (100.0*((samples_per_sec-ksamples_per_sec)/samples_per_sec)));
@@ -473,33 +522,57 @@ static void print_sym_table(void)
473 printf(", %d CPUs)\n", nr_cpus); 522 printf(", %d CPUs)\n", nr_cpus);
474 } 523 }
475 524
476 printf("------------------------------------------------------------------------------\n\n"); 525 printf("%-*.*s\n", win_width, win_width, graph_dotted_line);
477 526
478 if (sym_filter_entry) { 527 if (sym_filter_entry) {
479 show_details(sym_filter_entry); 528 show_details(sym_filter_entry);
480 return; 529 return;
481 } 530 }
482 531
532 /*
533 * Find the longest symbol name that will be displayed
534 */
535 for (nd = rb_first(&tmp); nd; nd = rb_next(nd)) {
536 syme = rb_entry(nd, struct sym_entry, rb_node);
537 if (++printed > print_entries ||
538 (int)syme->snap_count < count_filter)
539 continue;
540
541 if (syme->map->dso->long_name_len > dso_width)
542 dso_width = syme->map->dso->long_name_len;
543
544 if (syme->name_len > sym_width)
545 sym_width = syme->name_len;
546 }
547
548 printed = 0;
549
550 max_dso_width = winsize.ws_col - sym_width - 29;
551 if (dso_width > max_dso_width)
552 dso_width = max_dso_width;
553 putchar('\n');
483 if (nr_counters == 1) 554 if (nr_counters == 1)
484 printf(" samples pcnt"); 555 printf(" samples pcnt");
485 else 556 else
486 printf(" weight samples pcnt"); 557 printf(" weight samples pcnt");
487 558
488 if (verbose) 559 if (verbose)
489 printf(" RIP "); 560 printf(" RIP ");
490 printf(" kernel function\n"); 561 printf(" %-*.*s DSO\n", sym_width, sym_width, "function");
491 printf(" %s _______ _____", 562 printf(" %s _______ _____",
492 nr_counters == 1 ? " " : "______"); 563 nr_counters == 1 ? " " : "______");
493 if (verbose) 564 if (verbose)
494 printf(" ________________"); 565 printf(" ________________");
495 printf(" _______________\n\n"); 566 printf(" %-*.*s", sym_width, sym_width, graph_line);
567 printf(" %-*.*s", dso_width, dso_width, graph_line);
568 puts("\n");
496 569
497 for (nd = rb_first(&tmp); nd; nd = rb_next(nd)) { 570 for (nd = rb_first(&tmp); nd; nd = rb_next(nd)) {
498 struct symbol *sym; 571 struct symbol *sym;
499 double pcnt; 572 double pcnt;
500 573
501 syme = rb_entry(nd, struct sym_entry, rb_node); 574 syme = rb_entry(nd, struct sym_entry, rb_node);
502 sym = (struct symbol *)(syme + 1); 575 sym = sym_entry__symbol(syme);
503 576
504 if (++printed > print_entries || (int)syme->snap_count < count_filter) 577 if (++printed > print_entries || (int)syme->snap_count < count_filter)
505 continue; 578 continue;
@@ -508,17 +581,18 @@ static void print_sym_table(void)
508 sum_ksamples)); 581 sum_ksamples));
509 582
510 if (nr_counters == 1 || !display_weighted) 583 if (nr_counters == 1 || !display_weighted)
511 printf("%20.2f - ", syme->weight); 584 printf("%20.2f ", syme->weight);
512 else 585 else
513 printf("%9.1f %10ld - ", syme->weight, syme->snap_count); 586 printf("%9.1f %10ld ", syme->weight, syme->snap_count);
514 587
515 percent_color_fprintf(stdout, "%4.1f%%", pcnt); 588 percent_color_fprintf(stdout, "%4.1f%%", pcnt);
516 if (verbose) 589 if (verbose)
517 printf(" - %016llx", sym->start); 590 printf(" %016llx", sym->start);
518 printf(" : %s", sym->name); 591 printf(" %-*.*s", sym_width, sym_width, sym->name);
519 if (sym->module) 592 printf(" %-*.*s\n", dso_width, dso_width,
520 printf("\t[%s]", sym->module->name); 593 dso_width >= syme->map->dso->long_name_len ?
521 printf("\n"); 594 syme->map->dso->long_name :
595 syme->map->dso->short_name);
522 } 596 }
523} 597}
524 598
@@ -565,10 +639,10 @@ static void prompt_symbol(struct sym_entry **target, const char *msg)
565 639
566 /* zero counters of active symbol */ 640 /* zero counters of active symbol */
567 if (syme) { 641 if (syme) {
568 pthread_mutex_lock(&syme->source_lock); 642 pthread_mutex_lock(&syme->src->lock);
569 __zero_source_counters(syme); 643 __zero_source_counters(syme);
570 *target = NULL; 644 *target = NULL;
571 pthread_mutex_unlock(&syme->source_lock); 645 pthread_mutex_unlock(&syme->src->lock);
572 } 646 }
573 647
574 fprintf(stdout, "\n%s: ", msg); 648 fprintf(stdout, "\n%s: ", msg);
@@ -584,7 +658,7 @@ static void prompt_symbol(struct sym_entry **target, const char *msg)
584 pthread_mutex_unlock(&active_symbols_lock); 658 pthread_mutex_unlock(&active_symbols_lock);
585 659
586 list_for_each_entry_safe_from(syme, n, &active_symbols, node) { 660 list_for_each_entry_safe_from(syme, n, &active_symbols, node) {
587 struct symbol *sym = (struct symbol *)(syme + 1); 661 struct symbol *sym = sym_entry__symbol(syme);
588 662
589 if (!strcmp(buf, sym->name)) { 663 if (!strcmp(buf, sym->name)) {
590 found = syme; 664 found = syme;
@@ -608,7 +682,7 @@ static void print_mapped_keys(void)
608 char *name = NULL; 682 char *name = NULL;
609 683
610 if (sym_filter_entry) { 684 if (sym_filter_entry) {
611 struct symbol *sym = (struct symbol *)(sym_filter_entry+1); 685 struct symbol *sym = sym_entry__symbol(sym_filter_entry);
612 name = sym->name; 686 name = sym->name;
613 } 687 }
614 688
@@ -621,7 +695,7 @@ static void print_mapped_keys(void)
621 695
622 fprintf(stdout, "\t[f] profile display filter (count). \t(%d)\n", count_filter); 696 fprintf(stdout, "\t[f] profile display filter (count). \t(%d)\n", count_filter);
623 697
624 if (vmlinux_name) { 698 if (symbol_conf.vmlinux_name) {
625 fprintf(stdout, "\t[F] annotate display filter (percent). \t(%d%%)\n", sym_pcnt_filter); 699 fprintf(stdout, "\t[F] annotate display filter (percent). \t(%d%%)\n", sym_pcnt_filter);
626 fprintf(stdout, "\t[s] annotate symbol. \t(%s)\n", name?: "NULL"); 700 fprintf(stdout, "\t[s] annotate symbol. \t(%s)\n", name?: "NULL");
627 fprintf(stdout, "\t[S] stop annotation.\n"); 701 fprintf(stdout, "\t[S] stop annotation.\n");
@@ -630,6 +704,12 @@ static void print_mapped_keys(void)
630 if (nr_counters > 1) 704 if (nr_counters > 1)
631 fprintf(stdout, "\t[w] toggle display weighted/count[E]r. \t(%d)\n", display_weighted ? 1 : 0); 705 fprintf(stdout, "\t[w] toggle display weighted/count[E]r. \t(%d)\n", display_weighted ? 1 : 0);
632 706
707 fprintf(stdout,
708 "\t[K] hide kernel_symbols symbols. \t(%s)\n",
709 hide_kernel_symbols ? "yes" : "no");
710 fprintf(stdout,
711 "\t[U] hide user symbols. \t(%s)\n",
712 hide_user_symbols ? "yes" : "no");
633 fprintf(stdout, "\t[z] toggle sample zeroing. \t(%d)\n", zero ? 1 : 0); 713 fprintf(stdout, "\t[z] toggle sample zeroing. \t(%d)\n", zero ? 1 : 0);
634 fprintf(stdout, "\t[qQ] quit.\n"); 714 fprintf(stdout, "\t[qQ] quit.\n");
635} 715}
@@ -643,6 +723,8 @@ static int key_mapped(int c)
643 case 'z': 723 case 'z':
644 case 'q': 724 case 'q':
645 case 'Q': 725 case 'Q':
726 case 'K':
727 case 'U':
646 return 1; 728 return 1;
647 case 'E': 729 case 'E':
648 case 'w': 730 case 'w':
@@ -650,7 +732,7 @@ static int key_mapped(int c)
650 case 'F': 732 case 'F':
651 case 's': 733 case 's':
652 case 'S': 734 case 'S':
653 return vmlinux_name ? 1 : 0; 735 return symbol_conf.vmlinux_name ? 1 : 0;
654 default: 736 default:
655 break; 737 break;
656 } 738 }
@@ -691,6 +773,11 @@ static void handle_keypress(int c)
691 break; 773 break;
692 case 'e': 774 case 'e':
693 prompt_integer(&print_entries, "Enter display entries (lines)"); 775 prompt_integer(&print_entries, "Enter display entries (lines)");
776 if (print_entries == 0) {
777 sig_winch_handler(SIGWINCH);
778 signal(SIGWINCH, sig_winch_handler);
779 } else
780 signal(SIGWINCH, SIG_DFL);
694 break; 781 break;
695 case 'E': 782 case 'E':
696 if (nr_counters > 1) { 783 if (nr_counters > 1) {
@@ -715,9 +802,14 @@ static void handle_keypress(int c)
715 case 'F': 802 case 'F':
716 prompt_percent(&sym_pcnt_filter, "Enter details display event filter (percent)"); 803 prompt_percent(&sym_pcnt_filter, "Enter details display event filter (percent)");
717 break; 804 break;
805 case 'K':
806 hide_kernel_symbols = !hide_kernel_symbols;
807 break;
718 case 'q': 808 case 'q':
719 case 'Q': 809 case 'Q':
720 printf("exiting.\n"); 810 printf("exiting.\n");
811 if (dump_symtab)
812 dsos__fprintf(stderr);
721 exit(0); 813 exit(0);
722 case 's': 814 case 's':
723 prompt_symbol(&sym_filter_entry, "Enter details symbol"); 815 prompt_symbol(&sym_filter_entry, "Enter details symbol");
@@ -728,12 +820,15 @@ static void handle_keypress(int c)
728 else { 820 else {
729 struct sym_entry *syme = sym_filter_entry; 821 struct sym_entry *syme = sym_filter_entry;
730 822
731 pthread_mutex_lock(&syme->source_lock); 823 pthread_mutex_lock(&syme->src->lock);
732 sym_filter_entry = NULL; 824 sym_filter_entry = NULL;
733 __zero_source_counters(syme); 825 __zero_source_counters(syme);
734 pthread_mutex_unlock(&syme->source_lock); 826 pthread_mutex_unlock(&syme->src->lock);
735 } 827 }
736 break; 828 break;
829 case 'U':
830 hide_user_symbols = !hide_user_symbols;
831 break;
737 case 'w': 832 case 'w':
738 display_weighted = ~display_weighted; 833 display_weighted = ~display_weighted;
739 break; 834 break;
@@ -790,7 +885,7 @@ static const char *skip_symbols[] = {
790 NULL 885 NULL
791}; 886};
792 887
793static int symbol_filter(struct dso *self, struct symbol *sym) 888static int symbol_filter(struct map *map, struct symbol *sym)
794{ 889{
795 struct sym_entry *syme; 890 struct sym_entry *syme;
796 const char *name = sym->name; 891 const char *name = sym->name;
@@ -812,8 +907,9 @@ static int symbol_filter(struct dso *self, struct symbol *sym)
812 strstr(name, "_text_end")) 907 strstr(name, "_text_end"))
813 return 1; 908 return 1;
814 909
815 syme = dso__sym_priv(self, sym); 910 syme = symbol__priv(sym);
816 pthread_mutex_init(&syme->source_lock, NULL); 911 syme->map = map;
912 syme->src = NULL;
817 if (!sym_filter_entry && sym_filter && !strcmp(name, sym_filter)) 913 if (!sym_filter_entry && sym_filter && !strcmp(name, sym_filter))
818 sym_filter_entry = syme; 914 sym_filter_entry = syme;
819 915
@@ -824,75 +920,65 @@ static int symbol_filter(struct dso *self, struct symbol *sym)
824 } 920 }
825 } 921 }
826 922
827 return 0; 923 if (!syme->skip)
828} 924 syme->name_len = strlen(sym->name);
829
830static int parse_symbols(void)
831{
832 struct rb_node *node;
833 struct symbol *sym;
834 int use_modules = vmlinux_name ? 1 : 0;
835
836 kernel_dso = dso__new("[kernel]", sizeof(struct sym_entry));
837 if (kernel_dso == NULL)
838 return -1;
839
840 if (dso__load_kernel(kernel_dso, vmlinux_name, symbol_filter, verbose, use_modules) <= 0)
841 goto out_delete_dso;
842
843 node = rb_first(&kernel_dso->syms);
844 sym = rb_entry(node, struct symbol, rb_node);
845 min_ip = sym->start;
846
847 node = rb_last(&kernel_dso->syms);
848 sym = rb_entry(node, struct symbol, rb_node);
849 max_ip = sym->end;
850
851 if (dump_symtab)
852 dso__fprintf(kernel_dso, stderr);
853 925
854 return 0; 926 return 0;
855
856out_delete_dso:
857 dso__delete(kernel_dso);
858 kernel_dso = NULL;
859 return -1;
860} 927}
861 928
862/* 929static void event__process_sample(const event_t *self, int counter)
863 * Binary search in the histogram table and record the hit:
864 */
865static void record_ip(u64 ip, int counter)
866{ 930{
867 struct symbol *sym = dso__find_symbol(kernel_dso, ip); 931 u64 ip = self->ip.ip;
868 932 struct sym_entry *syme;
869 if (sym != NULL) { 933 struct addr_location al;
870 struct sym_entry *syme = dso__sym_priv(kernel_dso, sym); 934 u8 origin = self->header.misc & PERF_RECORD_MISC_CPUMODE_MASK;
871 935
872 if (!syme->skip) { 936 switch (origin) {
873 syme->count[counter]++; 937 case PERF_RECORD_MISC_USER:
874 record_precise_ip(syme, counter, ip); 938 if (hide_user_symbols)
875 pthread_mutex_lock(&active_symbols_lock);
876 if (list_empty(&syme->node) || !syme->node.next)
877 __list_insert_active_sym(syme);
878 pthread_mutex_unlock(&active_symbols_lock);
879 return; 939 return;
880 } 940 break;
941 case PERF_RECORD_MISC_KERNEL:
942 if (hide_kernel_symbols)
943 return;
944 break;
945 default:
946 return;
881 } 947 }
882 948
883 samples--; 949 if (event__preprocess_sample(self, &al, symbol_filter) < 0 ||
950 al.sym == NULL)
951 return;
952
953 syme = symbol__priv(al.sym);
954 if (!syme->skip) {
955 syme->count[counter]++;
956 syme->origin = origin;
957 record_precise_ip(syme, counter, ip);
958 pthread_mutex_lock(&active_symbols_lock);
959 if (list_empty(&syme->node) || !syme->node.next)
960 __list_insert_active_sym(syme);
961 pthread_mutex_unlock(&active_symbols_lock);
962 if (origin == PERF_RECORD_MISC_USER)
963 ++userspace_samples;
964 ++samples;
965 }
884} 966}
885 967
886static void process_event(u64 ip, int counter, int user) 968static int event__process(event_t *event)
887{ 969{
888 samples++; 970 switch (event->header.type) {
889 971 case PERF_RECORD_COMM:
890 if (user) { 972 event__process_comm(event);
891 userspace_samples++; 973 break;
892 return; 974 case PERF_RECORD_MMAP:
975 event__process_mmap(event);
976 break;
977 default:
978 break;
893 } 979 }
894 980
895 record_ip(ip, counter); 981 return 0;
896} 982}
897 983
898struct mmap_data { 984struct mmap_data {
@@ -913,8 +999,6 @@ static unsigned int mmap_read_head(struct mmap_data *md)
913 return head; 999 return head;
914} 1000}
915 1001
916struct timeval last_read, this_read;
917
918static void mmap_read_counter(struct mmap_data *md) 1002static void mmap_read_counter(struct mmap_data *md)
919{ 1003{
920 unsigned int head = mmap_read_head(md); 1004 unsigned int head = mmap_read_head(md);
@@ -922,8 +1006,6 @@ static void mmap_read_counter(struct mmap_data *md)
922 unsigned char *data = md->base + page_size; 1006 unsigned char *data = md->base + page_size;
923 int diff; 1007 int diff;
924 1008
925 gettimeofday(&this_read, NULL);
926
927 /* 1009 /*
928 * If we're further behind than half the buffer, there's a chance 1010 * If we're further behind than half the buffer, there's a chance
929 * the writer will bite our tail and mess up the samples under us. 1011 * the writer will bite our tail and mess up the samples under us.
@@ -934,14 +1016,7 @@ static void mmap_read_counter(struct mmap_data *md)
934 */ 1016 */
935 diff = head - old; 1017 diff = head - old;
936 if (diff > md->mask / 2 || diff < 0) { 1018 if (diff > md->mask / 2 || diff < 0) {
937 struct timeval iv; 1019 fprintf(stderr, "WARNING: failed to keep up with mmap data.\n");
938 unsigned long msecs;
939
940 timersub(&this_read, &last_read, &iv);
941 msecs = iv.tv_sec*1000 + iv.tv_usec/1000;
942
943 fprintf(stderr, "WARNING: failed to keep up with mmap data."
944 " Last read %lu msecs ago.\n", msecs);
945 1020
946 /* 1021 /*
947 * head points to a known good entry, start there. 1022 * head points to a known good entry, start there.
@@ -949,8 +1024,6 @@ static void mmap_read_counter(struct mmap_data *md)
949 old = head; 1024 old = head;
950 } 1025 }
951 1026
952 last_read = this_read;
953
954 for (; old != head;) { 1027 for (; old != head;) {
955 event_t *event = (event_t *)&data[old & md->mask]; 1028 event_t *event = (event_t *)&data[old & md->mask];
956 1029
@@ -978,13 +1051,11 @@ static void mmap_read_counter(struct mmap_data *md)
978 event = &event_copy; 1051 event = &event_copy;
979 } 1052 }
980 1053
1054 if (event->header.type == PERF_RECORD_SAMPLE)
1055 event__process_sample(event, md->counter);
1056 else
1057 event__process(event);
981 old += size; 1058 old += size;
982
983 if (event->header.type == PERF_RECORD_SAMPLE) {
984 int user =
985 (event->header.misc & PERF_RECORD_MISC_CPUMODE_MASK) == PERF_RECORD_MISC_USER;
986 process_event(event->ip.ip, md->counter, user);
987 }
988 } 1059 }
989 1060
990 md->prev = old; 1061 md->prev = old;
@@ -1018,8 +1089,15 @@ static void start_counter(int i, int counter)
1018 attr = attrs + counter; 1089 attr = attrs + counter;
1019 1090
1020 attr->sample_type = PERF_SAMPLE_IP | PERF_SAMPLE_TID; 1091 attr->sample_type = PERF_SAMPLE_IP | PERF_SAMPLE_TID;
1021 attr->freq = freq; 1092
1093 if (freq) {
1094 attr->sample_type |= PERF_SAMPLE_PERIOD;
1095 attr->freq = 1;
1096 attr->sample_freq = freq;
1097 }
1098
1022 attr->inherit = (cpu < 0) && inherit; 1099 attr->inherit = (cpu < 0) && inherit;
1100 attr->mmap = 1;
1023 1101
1024try_again: 1102try_again:
1025 fd[i][counter] = sys_perf_event_open(attr, target_pid, cpu, group_fd, 0); 1103 fd[i][counter] = sys_perf_event_open(attr, target_pid, cpu, group_fd, 0);
@@ -1027,7 +1105,7 @@ try_again:
1027 if (fd[i][counter] < 0) { 1105 if (fd[i][counter] < 0) {
1028 int err = errno; 1106 int err = errno;
1029 1107
1030 if (err == EPERM) 1108 if (err == EPERM || err == EACCES)
1031 die("No permission - are you root?\n"); 1109 die("No permission - are you root?\n");
1032 /* 1110 /*
1033 * If it's cycles then fall back to hrtimer 1111 * If it's cycles then fall back to hrtimer
@@ -1078,6 +1156,11 @@ static int __cmd_top(void)
1078 int i, counter; 1156 int i, counter;
1079 int ret; 1157 int ret;
1080 1158
1159 if (target_pid != -1)
1160 event__synthesize_thread(target_pid, event__process);
1161 else
1162 event__synthesize_threads(event__process);
1163
1081 for (i = 0; i < nr_cpus; i++) { 1164 for (i = 0; i < nr_cpus; i++) {
1082 group_fd = -1; 1165 group_fd = -1;
1083 for (counter = 0; counter < nr_counters; counter++) 1166 for (counter = 0; counter < nr_counters; counter++)
@@ -1133,7 +1216,10 @@ static const struct option options[] = {
1133 "system-wide collection from all CPUs"), 1216 "system-wide collection from all CPUs"),
1134 OPT_INTEGER('C', "CPU", &profile_cpu, 1217 OPT_INTEGER('C', "CPU", &profile_cpu,
1135 "CPU to profile on"), 1218 "CPU to profile on"),
1136 OPT_STRING('k', "vmlinux", &vmlinux_name, "file", "vmlinux pathname"), 1219 OPT_STRING('k', "vmlinux", &symbol_conf.vmlinux_name,
1220 "file", "vmlinux pathname"),
1221 OPT_BOOLEAN('K', "hide_kernel_symbols", &hide_kernel_symbols,
1222 "hide kernel symbols"),
1137 OPT_INTEGER('m', "mmap-pages", &mmap_pages, 1223 OPT_INTEGER('m', "mmap-pages", &mmap_pages,
1138 "number of mmap data pages"), 1224 "number of mmap data pages"),
1139 OPT_INTEGER('r', "realtime", &realtime_prio, 1225 OPT_INTEGER('r', "realtime", &realtime_prio,
@@ -1156,6 +1242,8 @@ static const struct option options[] = {
1156 "profile at this frequency"), 1242 "profile at this frequency"),
1157 OPT_INTEGER('E', "entries", &print_entries, 1243 OPT_INTEGER('E', "entries", &print_entries,
1158 "display this many functions"), 1244 "display this many functions"),
1245 OPT_BOOLEAN('U', "hide_user_symbols", &hide_user_symbols,
1246 "hide user symbols"),
1159 OPT_BOOLEAN('v', "verbose", &verbose, 1247 OPT_BOOLEAN('v', "verbose", &verbose,
1160 "be more verbose (show counter open errors, etc)"), 1248 "be more verbose (show counter open errors, etc)"),
1161 OPT_END() 1249 OPT_END()
@@ -1165,19 +1253,12 @@ int cmd_top(int argc, const char **argv, const char *prefix __used)
1165{ 1253{
1166 int counter; 1254 int counter;
1167 1255
1168 symbol__init();
1169
1170 page_size = sysconf(_SC_PAGE_SIZE); 1256 page_size = sysconf(_SC_PAGE_SIZE);
1171 1257
1172 argc = parse_options(argc, argv, options, top_usage, 0); 1258 argc = parse_options(argc, argv, options, top_usage, 0);
1173 if (argc) 1259 if (argc)
1174 usage_with_options(top_usage, options); 1260 usage_with_options(top_usage, options);
1175 1261
1176 if (freq) {
1177 default_interval = freq;
1178 freq = 1;
1179 }
1180
1181 /* CPU and PID are mutually exclusive */ 1262 /* CPU and PID are mutually exclusive */
1182 if (target_pid != -1 && profile_cpu != -1) { 1263 if (target_pid != -1 && profile_cpu != -1) {
1183 printf("WARNING: PID switch overriding CPU\n"); 1264 printf("WARNING: PID switch overriding CPU\n");
@@ -1188,13 +1269,31 @@ int cmd_top(int argc, const char **argv, const char *prefix __used)
1188 if (!nr_counters) 1269 if (!nr_counters)
1189 nr_counters = 1; 1270 nr_counters = 1;
1190 1271
1272 symbol_conf.priv_size = (sizeof(struct sym_entry) +
1273 (nr_counters + 1) * sizeof(unsigned long));
1274 if (symbol_conf.vmlinux_name == NULL)
1275 symbol_conf.try_vmlinux_path = true;
1276 if (symbol__init(&symbol_conf) < 0)
1277 return -1;
1278
1191 if (delay_secs < 1) 1279 if (delay_secs < 1)
1192 delay_secs = 1; 1280 delay_secs = 1;
1193 1281
1194 parse_symbols();
1195 parse_source(sym_filter_entry); 1282 parse_source(sym_filter_entry);
1196 1283
1197 /* 1284 /*
1285 * User specified count overrides default frequency.
1286 */
1287 if (default_interval)
1288 freq = 0;
1289 else if (freq) {
1290 default_interval = freq;
1291 } else {
1292 fprintf(stderr, "frequency and count are zero, aborting\n");
1293 exit(EXIT_FAILURE);
1294 }
1295
1296 /*
1198 * Fill in the ones not specifically initialized via -c: 1297 * Fill in the ones not specifically initialized via -c:
1199 */ 1298 */
1200 for (counter = 0; counter < nr_counters; counter++) { 1299 for (counter = 0; counter < nr_counters; counter++) {
@@ -1211,5 +1310,11 @@ int cmd_top(int argc, const char **argv, const char *prefix __used)
1211 if (target_pid != -1 || profile_cpu != -1) 1310 if (target_pid != -1 || profile_cpu != -1)
1212 nr_cpus = 1; 1311 nr_cpus = 1;
1213 1312
1313 get_term_dimensions(&winsize);
1314 if (print_entries == 0) {
1315 update_print_entries(&winsize);
1316 signal(SIGWINCH, sig_winch_handler);
1317 }
1318
1214 return __cmd_top(); 1319 return __cmd_top();
1215} 1320}
diff --git a/tools/perf/builtin-trace.c b/tools/perf/builtin-trace.c
index 0c5e4f72f2ba..abb914aa7be6 100644
--- a/tools/perf/builtin-trace.c
+++ b/tools/perf/builtin-trace.c
@@ -5,66 +5,73 @@
5#include "util/symbol.h" 5#include "util/symbol.h"
6#include "util/thread.h" 6#include "util/thread.h"
7#include "util/header.h" 7#include "util/header.h"
8#include "util/exec_cmd.h"
9#include "util/trace-event.h"
8 10
9#include "util/parse-options.h" 11static char const *script_name;
12static char const *generate_script_lang;
10 13
11#include "perf.h" 14static int default_start_script(const char *script __attribute((unused)))
12#include "util/debug.h" 15{
16 return 0;
17}
13 18
14#include "util/trace-event.h" 19static int default_stop_script(void)
20{
21 return 0;
22}
15 23
16static char const *input_name = "perf.data"; 24static int default_generate_script(const char *outfile __attribute ((unused)))
17static int input; 25{
18static unsigned long page_size; 26 return 0;
19static unsigned long mmap_window = 32; 27}
20 28
21static unsigned long total = 0; 29static struct scripting_ops default_scripting_ops = {
22static unsigned long total_comm = 0; 30 .start_script = default_start_script,
31 .stop_script = default_stop_script,
32 .process_event = print_event,
33 .generate_script = default_generate_script,
34};
35
36static struct scripting_ops *scripting_ops;
23 37
24static struct rb_root threads; 38static void setup_scripting(void)
25static struct thread *last_match; 39{
40 /* make sure PERF_EXEC_PATH is set for scripts */
41 perf_set_argv_exec_path(perf_exec_path());
26 42
27static struct perf_header *header; 43 setup_perl_scripting();
28static u64 sample_type;
29 44
45 scripting_ops = &default_scripting_ops;
46}
30 47
31static int 48static int cleanup_scripting(void)
32process_comm_event(event_t *event, unsigned long offset, unsigned long head)
33{ 49{
34 struct thread *thread; 50 return scripting_ops->stop_script();
51}
35 52
36 thread = threads__findnew(event->comm.pid, &threads, &last_match); 53#include "util/parse-options.h"
37 54
38 dump_printf("%p [%p]: PERF_RECORD_COMM: %s:%d\n", 55#include "perf.h"
39 (void *)(offset + head), 56#include "util/debug.h"
40 (void *)(long)(event->header.size),
41 event->comm.comm, event->comm.pid);
42 57
43 if (thread == NULL || 58#include "util/trace-event.h"
44 thread__set_comm(thread, event->comm.comm)) { 59#include "util/data_map.h"
45 dump_printf("problem processing PERF_RECORD_COMM, skipping event.\n"); 60#include "util/exec_cmd.h"
46 return -1;
47 }
48 total_comm++;
49 61
50 return 0; 62static char const *input_name = "perf.data";
51}
52 63
53static int 64static struct perf_header *header;
54process_sample_event(event_t *event, unsigned long offset, unsigned long head) 65static u64 sample_type;
66
67static int process_sample_event(event_t *event)
55{ 68{
56 char level;
57 int show = 0;
58 struct dso *dso = NULL;
59 struct thread *thread;
60 u64 ip = event->ip.ip; 69 u64 ip = event->ip.ip;
61 u64 timestamp = -1; 70 u64 timestamp = -1;
62 u32 cpu = -1; 71 u32 cpu = -1;
63 u64 period = 1; 72 u64 period = 1;
64 void *more_data = event->ip.__more_data; 73 void *more_data = event->ip.__more_data;
65 int cpumode; 74 struct thread *thread = threads__findnew(event->ip.pid);
66
67 thread = threads__findnew(event->ip.pid, &threads, &last_match);
68 75
69 if (sample_type & PERF_SAMPLE_TIME) { 76 if (sample_type & PERF_SAMPLE_TIME) {
70 timestamp = *(u64 *)more_data; 77 timestamp = *(u64 *)more_data;
@@ -82,45 +89,19 @@ process_sample_event(event_t *event, unsigned long offset, unsigned long head)
82 more_data += sizeof(u64); 89 more_data += sizeof(u64);
83 } 90 }
84 91
85 dump_printf("%p [%p]: PERF_RECORD_SAMPLE (IP, %d): %d/%d: %p period: %Ld\n", 92 dump_printf("(IP, %d): %d/%d: %p period: %Ld\n",
86 (void *)(offset + head),
87 (void *)(long)(event->header.size),
88 event->header.misc, 93 event->header.misc,
89 event->ip.pid, event->ip.tid, 94 event->ip.pid, event->ip.tid,
90 (void *)(long)ip, 95 (void *)(long)ip,
91 (long long)period); 96 (long long)period);
92 97
93 dump_printf(" ... thread: %s:%d\n", thread->comm, thread->pid);
94
95 if (thread == NULL) { 98 if (thread == NULL) {
96 eprintf("problem processing %d event, skipping it.\n", 99 pr_debug("problem processing %d event, skipping it.\n",
97 event->header.type); 100 event->header.type);
98 return -1; 101 return -1;
99 } 102 }
100 103
101 cpumode = event->header.misc & PERF_RECORD_MISC_CPUMODE_MASK; 104 dump_printf(" ... thread: %s:%d\n", thread->comm, thread->pid);
102
103 if (cpumode == PERF_RECORD_MISC_KERNEL) {
104 show = SHOW_KERNEL;
105 level = 'k';
106
107 dso = kernel_dso;
108
109 dump_printf(" ...... dso: %s\n", dso->name);
110
111 } else if (cpumode == PERF_RECORD_MISC_USER) {
112
113 show = SHOW_USER;
114 level = '.';
115
116 } else {
117 show = SHOW_HV;
118 level = 'H';
119
120 dso = hypervisor_dso;
121
122 dump_printf(" ...... dso: [hypervisor]\n");
123 }
124 105
125 if (sample_type & PERF_SAMPLE_RAW) { 106 if (sample_type & PERF_SAMPLE_RAW) {
126 struct { 107 struct {
@@ -133,128 +114,189 @@ process_sample_event(event_t *event, unsigned long offset, unsigned long head)
133 * field, although it should be the same than this perf 114 * field, although it should be the same than this perf
134 * event pid 115 * event pid
135 */ 116 */
136 print_event(cpu, raw->data, raw->size, timestamp, thread->comm); 117 scripting_ops->process_event(cpu, raw->data, raw->size,
118 timestamp, thread->comm);
137 } 119 }
138 total += period; 120 event__stats.total += period;
139 121
140 return 0; 122 return 0;
141} 123}
142 124
143static int 125static int sample_type_check(u64 type)
144process_event(event_t *event, unsigned long offset, unsigned long head)
145{ 126{
146 trace_event(event); 127 sample_type = type;
147
148 switch (event->header.type) {
149 case PERF_RECORD_MMAP ... PERF_RECORD_LOST:
150 return 0;
151
152 case PERF_RECORD_COMM:
153 return process_comm_event(event, offset, head);
154
155 case PERF_RECORD_EXIT ... PERF_RECORD_READ:
156 return 0;
157
158 case PERF_RECORD_SAMPLE:
159 return process_sample_event(event, offset, head);
160 128
161 case PERF_RECORD_MAX: 129 if (!(sample_type & PERF_SAMPLE_RAW)) {
162 default: 130 fprintf(stderr,
131 "No trace sample to read. Did you call perf record "
132 "without -R?");
163 return -1; 133 return -1;
164 } 134 }
165 135
166 return 0; 136 return 0;
167} 137}
168 138
139static struct perf_file_handler file_handler = {
140 .process_sample_event = process_sample_event,
141 .process_comm_event = event__process_comm,
142 .sample_type_check = sample_type_check,
143};
144
169static int __cmd_trace(void) 145static int __cmd_trace(void)
170{ 146{
171 int ret, rc = EXIT_FAILURE; 147 register_idle_thread();
172 unsigned long offset = 0; 148 register_perf_file_handler(&file_handler);
173 unsigned long head = 0;
174 struct stat perf_stat;
175 event_t *event;
176 uint32_t size;
177 char *buf;
178
179 trace_report();
180 register_idle_thread(&threads, &last_match);
181
182 input = open(input_name, O_RDONLY);
183 if (input < 0) {
184 perror("failed to open file");
185 exit(-1);
186 }
187 149
188 ret = fstat(input, &perf_stat); 150 return mmap_dispatch_perf_file(&header, input_name,
189 if (ret < 0) { 151 0, 0, &event__cwdlen, &event__cwd);
190 perror("failed to stat file"); 152}
191 exit(-1);
192 }
193 153
194 if (!perf_stat.st_size) { 154struct script_spec {
195 fprintf(stderr, "zero-sized file, nothing to do!\n"); 155 struct list_head node;
196 exit(0); 156 struct scripting_ops *ops;
197 } 157 char spec[0];
198 header = perf_header__read(input); 158};
199 head = header->data_offset;
200 sample_type = perf_header__sample_type(header);
201 159
202 if (!(sample_type & PERF_SAMPLE_RAW)) 160LIST_HEAD(script_specs);
203 die("No trace sample to read. Did you call perf record "
204 "without -R?");
205 161
206 if (load_kernel() < 0) { 162static struct script_spec *script_spec__new(const char *spec,
207 perror("failed to load kernel symbols"); 163 struct scripting_ops *ops)
208 return EXIT_FAILURE; 164{
209 } 165 struct script_spec *s = malloc(sizeof(*s) + strlen(spec) + 1);
210 166
211remap: 167 if (s != NULL) {
212 buf = (char *)mmap(NULL, page_size * mmap_window, PROT_READ, 168 strcpy(s->spec, spec);
213 MAP_SHARED, input, offset); 169 s->ops = ops;
214 if (buf == MAP_FAILED) {
215 perror("failed to mmap file");
216 exit(-1);
217 } 170 }
218 171
219more: 172 return s;
220 event = (event_t *)(buf + head); 173}
221 174
222 if (head + event->header.size >= page_size * mmap_window) { 175static void script_spec__delete(struct script_spec *s)
223 unsigned long shift = page_size * (head / page_size); 176{
224 int res; 177 free(s->spec);
178 free(s);
179}
225 180
226 res = munmap(buf, page_size * mmap_window); 181static void script_spec__add(struct script_spec *s)
227 assert(res == 0); 182{
183 list_add_tail(&s->node, &script_specs);
184}
228 185
229 offset += shift; 186static struct script_spec *script_spec__find(const char *spec)
230 head -= shift; 187{
231 goto remap; 188 struct script_spec *s;
232 }
233 189
234 size = event->header.size; 190 list_for_each_entry(s, &script_specs, node)
191 if (strcasecmp(s->spec, spec) == 0)
192 return s;
193 return NULL;
194}
235 195
236 if (!size || process_event(event, offset, head) < 0) { 196static struct script_spec *script_spec__findnew(const char *spec,
197 struct scripting_ops *ops)
198{
199 struct script_spec *s = script_spec__find(spec);
237 200
238 /* 201 if (s)
239 * assume we lost track of the stream, check alignment, and 202 return s;
240 * increment a single u64 in the hope to catch on again 'soon'.
241 */
242 203
243 if (unlikely(head & 7)) 204 s = script_spec__new(spec, ops);
244 head &= ~7ULL; 205 if (!s)
206 goto out_delete_spec;
245 207
246 size = 8; 208 script_spec__add(s);
247 } 209
210 return s;
248 211
249 head += size; 212out_delete_spec:
213 script_spec__delete(s);
214
215 return NULL;
216}
250 217
251 if (offset + head < (unsigned long)perf_stat.st_size) 218int script_spec_register(const char *spec, struct scripting_ops *ops)
252 goto more; 219{
220 struct script_spec *s;
221
222 s = script_spec__find(spec);
223 if (s)
224 return -1;
253 225
254 rc = EXIT_SUCCESS; 226 s = script_spec__findnew(spec, ops);
255 close(input); 227 if (!s)
228 return -1;
229
230 return 0;
231}
232
233static struct scripting_ops *script_spec__lookup(const char *spec)
234{
235 struct script_spec *s = script_spec__find(spec);
236 if (!s)
237 return NULL;
256 238
257 return rc; 239 return s->ops;
240}
241
242static void list_available_languages(void)
243{
244 struct script_spec *s;
245
246 fprintf(stderr, "\n");
247 fprintf(stderr, "Scripting language extensions (used in "
248 "perf trace -s [spec:]script.[spec]):\n\n");
249
250 list_for_each_entry(s, &script_specs, node)
251 fprintf(stderr, " %-42s [%s]\n", s->spec, s->ops->name);
252
253 fprintf(stderr, "\n");
254}
255
256static int parse_scriptname(const struct option *opt __used,
257 const char *str, int unset __used)
258{
259 char spec[PATH_MAX];
260 const char *script, *ext;
261 int len;
262
263 if (strcmp(str, "list") == 0) {
264 list_available_languages();
265 return 0;
266 }
267
268 script = strchr(str, ':');
269 if (script) {
270 len = script - str;
271 if (len >= PATH_MAX) {
272 fprintf(stderr, "invalid language specifier");
273 return -1;
274 }
275 strncpy(spec, str, len);
276 spec[len] = '\0';
277 scripting_ops = script_spec__lookup(spec);
278 if (!scripting_ops) {
279 fprintf(stderr, "invalid language specifier");
280 return -1;
281 }
282 script++;
283 } else {
284 script = str;
285 ext = strchr(script, '.');
286 if (!ext) {
287 fprintf(stderr, "invalid script extension");
288 return -1;
289 }
290 scripting_ops = script_spec__lookup(++ext);
291 if (!scripting_ops) {
292 fprintf(stderr, "invalid script extension");
293 return -1;
294 }
295 }
296
297 script_name = strdup(script);
298
299 return 0;
258} 300}
259 301
260static const char * const annotate_usage[] = { 302static const char * const annotate_usage[] = {
@@ -267,13 +309,24 @@ static const struct option options[] = {
267 "dump raw trace in ASCII"), 309 "dump raw trace in ASCII"),
268 OPT_BOOLEAN('v', "verbose", &verbose, 310 OPT_BOOLEAN('v', "verbose", &verbose,
269 "be more verbose (show symbol address, etc)"), 311 "be more verbose (show symbol address, etc)"),
312 OPT_BOOLEAN('l', "latency", &latency_format,
313 "show latency attributes (irqs/preemption disabled, etc)"),
314 OPT_CALLBACK('s', "script", NULL, "name",
315 "script file name (lang:script name, script name, or *)",
316 parse_scriptname),
317 OPT_STRING('g', "gen-script", &generate_script_lang, "lang",
318 "generate perf-trace.xx script in specified language"),
319
270 OPT_END() 320 OPT_END()
271}; 321};
272 322
273int cmd_trace(int argc, const char **argv, const char *prefix __used) 323int cmd_trace(int argc, const char **argv, const char *prefix __used)
274{ 324{
275 symbol__init(); 325 int err;
276 page_size = getpagesize(); 326
327 symbol__init(0);
328
329 setup_scripting();
277 330
278 argc = parse_options(argc, argv, options, annotate_usage, 0); 331 argc = parse_options(argc, argv, options, annotate_usage, 0);
279 if (argc) { 332 if (argc) {
@@ -287,5 +340,50 @@ int cmd_trace(int argc, const char **argv, const char *prefix __used)
287 340
288 setup_pager(); 341 setup_pager();
289 342
290 return __cmd_trace(); 343 if (generate_script_lang) {
344 struct stat perf_stat;
345
346 int input = open(input_name, O_RDONLY);
347 if (input < 0) {
348 perror("failed to open file");
349 exit(-1);
350 }
351
352 err = fstat(input, &perf_stat);
353 if (err < 0) {
354 perror("failed to stat file");
355 exit(-1);
356 }
357
358 if (!perf_stat.st_size) {
359 fprintf(stderr, "zero-sized file, nothing to do!\n");
360 exit(0);
361 }
362
363 scripting_ops = script_spec__lookup(generate_script_lang);
364 if (!scripting_ops) {
365 fprintf(stderr, "invalid language specifier");
366 return -1;
367 }
368
369 header = perf_header__new();
370 if (header == NULL)
371 return -1;
372
373 perf_header__read(header, input);
374 err = scripting_ops->generate_script("perf-trace");
375 goto out;
376 }
377
378 if (script_name) {
379 err = scripting_ops->start_script(script_name);
380 if (err)
381 goto out;
382 }
383
384 err = __cmd_trace();
385
386 cleanup_scripting();
387out:
388 return err;
291} 389}
diff --git a/tools/perf/builtin.h b/tools/perf/builtin.h
index e11d8d231c3b..a3d8bf65f26c 100644
--- a/tools/perf/builtin.h
+++ b/tools/perf/builtin.h
@@ -15,6 +15,8 @@ extern int read_line_with_nul(char *buf, int size, FILE *file);
15extern int check_pager_config(const char *cmd); 15extern int check_pager_config(const char *cmd);
16 16
17extern int cmd_annotate(int argc, const char **argv, const char *prefix); 17extern int cmd_annotate(int argc, const char **argv, const char *prefix);
18extern int cmd_bench(int argc, const char **argv, const char *prefix);
19extern int cmd_buildid_list(int argc, const char **argv, const char *prefix);
18extern int cmd_help(int argc, const char **argv, const char *prefix); 20extern int cmd_help(int argc, const char **argv, const char *prefix);
19extern int cmd_sched(int argc, const char **argv, const char *prefix); 21extern int cmd_sched(int argc, const char **argv, const char *prefix);
20extern int cmd_list(int argc, const char **argv, const char *prefix); 22extern int cmd_list(int argc, const char **argv, const char *prefix);
@@ -25,5 +27,7 @@ extern int cmd_timechart(int argc, const char **argv, const char *prefix);
25extern int cmd_top(int argc, const char **argv, const char *prefix); 27extern int cmd_top(int argc, const char **argv, const char *prefix);
26extern int cmd_trace(int argc, const char **argv, const char *prefix); 28extern int cmd_trace(int argc, const char **argv, const char *prefix);
27extern int cmd_version(int argc, const char **argv, const char *prefix); 29extern int cmd_version(int argc, const char **argv, const char *prefix);
30extern int cmd_probe(int argc, const char **argv, const char *prefix);
31extern int cmd_kmem(int argc, const char **argv, const char *prefix);
28 32
29#endif 33#endif
diff --git a/tools/perf/command-list.txt b/tools/perf/command-list.txt
index 00326e230d87..02b09ea17a3e 100644
--- a/tools/perf/command-list.txt
+++ b/tools/perf/command-list.txt
@@ -3,6 +3,8 @@
3# command name category [deprecated] [common] 3# command name category [deprecated] [common]
4# 4#
5perf-annotate mainporcelain common 5perf-annotate mainporcelain common
6perf-bench mainporcelain common
7perf-buildid-list mainporcelain common
6perf-list mainporcelain common 8perf-list mainporcelain common
7perf-sched mainporcelain common 9perf-sched mainporcelain common
8perf-record mainporcelain common 10perf-record mainporcelain common
@@ -11,3 +13,5 @@ perf-stat mainporcelain common
11perf-timechart mainporcelain common 13perf-timechart mainporcelain common
12perf-top mainporcelain common 14perf-top mainporcelain common
13perf-trace mainporcelain common 15perf-trace mainporcelain common
16perf-probe mainporcelain common
17perf-kmem mainporcelain common
diff --git a/tools/perf/design.txt b/tools/perf/design.txt
index fdd42a824c98..f000c30877ac 100644
--- a/tools/perf/design.txt
+++ b/tools/perf/design.txt
@@ -137,6 +137,8 @@ enum sw_event_ids {
137 PERF_COUNT_SW_CPU_MIGRATIONS = 4, 137 PERF_COUNT_SW_CPU_MIGRATIONS = 4,
138 PERF_COUNT_SW_PAGE_FAULTS_MIN = 5, 138 PERF_COUNT_SW_PAGE_FAULTS_MIN = 5,
139 PERF_COUNT_SW_PAGE_FAULTS_MAJ = 6, 139 PERF_COUNT_SW_PAGE_FAULTS_MAJ = 6,
140 PERF_COUNT_SW_ALIGNMENT_FAULTS = 7,
141 PERF_COUNT_SW_EMULATION_FAULTS = 8,
140}; 142};
141 143
142Counters of the type PERF_TYPE_TRACEPOINT are available when the ftrace event 144Counters of the type PERF_TYPE_TRACEPOINT are available when the ftrace event
diff --git a/tools/perf/perf.c b/tools/perf/perf.c
index 19fc7feb9d59..cf64049bc9bd 100644
--- a/tools/perf/perf.c
+++ b/tools/perf/perf.c
@@ -14,6 +14,7 @@
14#include "util/run-command.h" 14#include "util/run-command.h"
15#include "util/parse-events.h" 15#include "util/parse-events.h"
16#include "util/string.h" 16#include "util/string.h"
17#include "util/debugfs.h"
17 18
18const char perf_usage_string[] = 19const char perf_usage_string[] =
19 "perf [--version] [--help] COMMAND [ARGS]"; 20 "perf [--version] [--help] COMMAND [ARGS]";
@@ -89,8 +90,8 @@ static int handle_options(const char*** argv, int* argc, int* envchanged)
89 /* 90 /*
90 * Check remaining flags. 91 * Check remaining flags.
91 */ 92 */
92 if (!prefixcmp(cmd, "--exec-path")) { 93 if (!prefixcmp(cmd, CMD_EXEC_PATH)) {
93 cmd += 11; 94 cmd += strlen(CMD_EXEC_PATH);
94 if (*cmd == '=') 95 if (*cmd == '=')
95 perf_set_argv_exec_path(cmd + 1); 96 perf_set_argv_exec_path(cmd + 1);
96 else { 97 else {
@@ -117,8 +118,8 @@ static int handle_options(const char*** argv, int* argc, int* envchanged)
117 (*argv)++; 118 (*argv)++;
118 (*argc)--; 119 (*argc)--;
119 handled++; 120 handled++;
120 } else if (!prefixcmp(cmd, "--perf-dir=")) { 121 } else if (!prefixcmp(cmd, CMD_PERF_DIR)) {
121 setenv(PERF_DIR_ENVIRONMENT, cmd + 10, 1); 122 setenv(PERF_DIR_ENVIRONMENT, cmd + strlen(CMD_PERF_DIR), 1);
122 if (envchanged) 123 if (envchanged)
123 *envchanged = 1; 124 *envchanged = 1;
124 } else if (!strcmp(cmd, "--work-tree")) { 125 } else if (!strcmp(cmd, "--work-tree")) {
@@ -131,8 +132,8 @@ static int handle_options(const char*** argv, int* argc, int* envchanged)
131 *envchanged = 1; 132 *envchanged = 1;
132 (*argv)++; 133 (*argv)++;
133 (*argc)--; 134 (*argc)--;
134 } else if (!prefixcmp(cmd, "--work-tree=")) { 135 } else if (!prefixcmp(cmd, CMD_WORK_TREE)) {
135 setenv(PERF_WORK_TREE_ENVIRONMENT, cmd + 12, 1); 136 setenv(PERF_WORK_TREE_ENVIRONMENT, cmd + strlen(CMD_WORK_TREE), 1);
136 if (envchanged) 137 if (envchanged)
137 *envchanged = 1; 138 *envchanged = 1;
138 } else if (!strcmp(cmd, "--debugfs-dir")) { 139 } else if (!strcmp(cmd, "--debugfs-dir")) {
@@ -146,8 +147,8 @@ static int handle_options(const char*** argv, int* argc, int* envchanged)
146 *envchanged = 1; 147 *envchanged = 1;
147 (*argv)++; 148 (*argv)++;
148 (*argc)--; 149 (*argc)--;
149 } else if (!prefixcmp(cmd, "--debugfs-dir=")) { 150 } else if (!prefixcmp(cmd, CMD_DEBUGFS_DIR)) {
150 strncpy(debugfs_mntpt, cmd + 14, MAXPATHLEN); 151 strncpy(debugfs_mntpt, cmd + strlen(CMD_DEBUGFS_DIR), MAXPATHLEN);
151 debugfs_mntpt[MAXPATHLEN - 1] = '\0'; 152 debugfs_mntpt[MAXPATHLEN - 1] = '\0';
152 if (envchanged) 153 if (envchanged)
153 *envchanged = 1; 154 *envchanged = 1;
@@ -284,17 +285,21 @@ static void handle_internal_command(int argc, const char **argv)
284{ 285{
285 const char *cmd = argv[0]; 286 const char *cmd = argv[0];
286 static struct cmd_struct commands[] = { 287 static struct cmd_struct commands[] = {
287 { "help", cmd_help, 0 }, 288 { "buildid-list", cmd_buildid_list, 0 },
288 { "list", cmd_list, 0 }, 289 { "help", cmd_help, 0 },
289 { "record", cmd_record, 0 }, 290 { "list", cmd_list, 0 },
290 { "report", cmd_report, 0 }, 291 { "record", cmd_record, 0 },
291 { "stat", cmd_stat, 0 }, 292 { "report", cmd_report, 0 },
292 { "timechart", cmd_timechart, 0 }, 293 { "bench", cmd_bench, 0 },
293 { "top", cmd_top, 0 }, 294 { "stat", cmd_stat, 0 },
294 { "annotate", cmd_annotate, 0 }, 295 { "timechart", cmd_timechart, 0 },
295 { "version", cmd_version, 0 }, 296 { "top", cmd_top, 0 },
296 { "trace", cmd_trace, 0 }, 297 { "annotate", cmd_annotate, 0 },
297 { "sched", cmd_sched, 0 }, 298 { "version", cmd_version, 0 },
299 { "trace", cmd_trace, 0 },
300 { "sched", cmd_sched, 0 },
301 { "probe", cmd_probe, 0 },
302 { "kmem", cmd_kmem, 0 },
298 }; 303 };
299 unsigned int i; 304 unsigned int i;
300 static const char ext[] = STRIP_EXTENSION; 305 static const char ext[] = STRIP_EXTENSION;
@@ -382,45 +387,12 @@ static int run_argv(int *argcp, const char ***argv)
382/* mini /proc/mounts parser: searching for "^blah /mount/point debugfs" */ 387/* mini /proc/mounts parser: searching for "^blah /mount/point debugfs" */
383static void get_debugfs_mntpt(void) 388static void get_debugfs_mntpt(void)
384{ 389{
385 FILE *file; 390 const char *path = debugfs_find_mountpoint();
386 char fs_type[100];
387 char debugfs[MAXPATHLEN];
388 391
389 /* 392 if (path)
390 * try the standard location 393 strncpy(debugfs_mntpt, path, sizeof(debugfs_mntpt));
391 */ 394 else
392 if (valid_debugfs_mount("/sys/kernel/debug/") == 0) { 395 debugfs_mntpt[0] = '\0';
393 strcpy(debugfs_mntpt, "/sys/kernel/debug/");
394 return;
395 }
396
397 /*
398 * try the sane location
399 */
400 if (valid_debugfs_mount("/debug/") == 0) {
401 strcpy(debugfs_mntpt, "/debug/");
402 return;
403 }
404
405 /*
406 * give up and parse /proc/mounts
407 */
408 file = fopen("/proc/mounts", "r");
409 if (file == NULL)
410 return;
411
412 while (fscanf(file, "%*s %"
413 STR(MAXPATHLEN)
414 "s %99s %*s %*d %*d\n",
415 debugfs, fs_type) == 2) {
416 if (strcmp(fs_type, "debugfs") == 0)
417 break;
418 }
419 fclose(file);
420 if (strcmp(fs_type, "debugfs") == 0) {
421 strncpy(debugfs_mntpt, debugfs, MAXPATHLEN);
422 debugfs_mntpt[MAXPATHLEN - 1] = '\0';
423 }
424} 396}
425 397
426int main(int argc, const char **argv) 398int main(int argc, const char **argv)
diff --git a/tools/perf/perf.h b/tools/perf/perf.h
index 8cc4623afd6f..454d5d55f32d 100644
--- a/tools/perf/perf.h
+++ b/tools/perf/perf.h
@@ -47,6 +47,18 @@
47#define cpu_relax() asm volatile("":::"memory") 47#define cpu_relax() asm volatile("":::"memory")
48#endif 48#endif
49 49
50#ifdef __alpha__
51#include "../../arch/alpha/include/asm/unistd.h"
52#define rmb() asm volatile("mb" ::: "memory")
53#define cpu_relax() asm volatile("" ::: "memory")
54#endif
55
56#ifdef __ia64__
57#include "../../arch/ia64/include/asm/unistd.h"
58#define rmb() asm volatile ("mf" ::: "memory")
59#define cpu_relax() asm volatile ("hint @pause" ::: "memory")
60#endif
61
50#include <time.h> 62#include <time.h>
51#include <unistd.h> 63#include <unistd.h>
52#include <sys/types.h> 64#include <sys/types.h>
diff --git a/tools/perf/scripts/perl/Perf-Trace-Util/Context.c b/tools/perf/scripts/perl/Perf-Trace-Util/Context.c
new file mode 100644
index 000000000000..af78d9a52a7d
--- /dev/null
+++ b/tools/perf/scripts/perl/Perf-Trace-Util/Context.c
@@ -0,0 +1,134 @@
1/*
2 * This file was generated automatically by ExtUtils::ParseXS version 2.18_02 from the
3 * contents of Context.xs. Do not edit this file, edit Context.xs instead.
4 *
5 * ANY CHANGES MADE HERE WILL BE LOST!
6 *
7 */
8
9#line 1 "Context.xs"
10/*
11 * Context.xs. XS interfaces for perf trace.
12 *
13 * Copyright (C) 2009 Tom Zanussi <tzanussi@gmail.com>
14 *
15 * This program is free software; you can redistribute it and/or modify
16 * 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
18 * (at your option) any later version.
19 *
20 * This program is distributed in the hope that it will be useful,
21 * but WITHOUT ANY WARRANTY; without even the implied warranty of
22 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23 * GNU General Public License for more details.
24 *
25 * You should have received a copy of the GNU General Public License
26 * along with this program; if not, write to the Free Software
27 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
28 *
29 */
30
31#include "EXTERN.h"
32#include "perl.h"
33#include "XSUB.h"
34#include "../../../util/trace-event-perl.h"
35
36#ifndef PERL_UNUSED_VAR
37# define PERL_UNUSED_VAR(var) if (0) var = var
38#endif
39
40#line 41 "Context.c"
41
42XS(XS_Perf__Trace__Context_common_pc); /* prototype to pass -Wmissing-prototypes */
43XS(XS_Perf__Trace__Context_common_pc)
44{
45#ifdef dVAR
46 dVAR; dXSARGS;
47#else
48 dXSARGS;
49#endif
50 if (items != 1)
51 Perl_croak(aTHX_ "Usage: %s(%s)", "Perf::Trace::Context::common_pc", "context");
52 PERL_UNUSED_VAR(cv); /* -W */
53 {
54 struct scripting_context * context = INT2PTR(struct scripting_context *,SvIV(ST(0)));
55 int RETVAL;
56 dXSTARG;
57
58 RETVAL = common_pc(context);
59 XSprePUSH; PUSHi((IV)RETVAL);
60 }
61 XSRETURN(1);
62}
63
64
65XS(XS_Perf__Trace__Context_common_flags); /* prototype to pass -Wmissing-prototypes */
66XS(XS_Perf__Trace__Context_common_flags)
67{
68#ifdef dVAR
69 dVAR; dXSARGS;
70#else
71 dXSARGS;
72#endif
73 if (items != 1)
74 Perl_croak(aTHX_ "Usage: %s(%s)", "Perf::Trace::Context::common_flags", "context");
75 PERL_UNUSED_VAR(cv); /* -W */
76 {
77 struct scripting_context * context = INT2PTR(struct scripting_context *,SvIV(ST(0)));
78 int RETVAL;
79 dXSTARG;
80
81 RETVAL = common_flags(context);
82 XSprePUSH; PUSHi((IV)RETVAL);
83 }
84 XSRETURN(1);
85}
86
87
88XS(XS_Perf__Trace__Context_common_lock_depth); /* prototype to pass -Wmissing-prototypes */
89XS(XS_Perf__Trace__Context_common_lock_depth)
90{
91#ifdef dVAR
92 dVAR; dXSARGS;
93#else
94 dXSARGS;
95#endif
96 if (items != 1)
97 Perl_croak(aTHX_ "Usage: %s(%s)", "Perf::Trace::Context::common_lock_depth", "context");
98 PERL_UNUSED_VAR(cv); /* -W */
99 {
100 struct scripting_context * context = INT2PTR(struct scripting_context *,SvIV(ST(0)));
101 int RETVAL;
102 dXSTARG;
103
104 RETVAL = common_lock_depth(context);
105 XSprePUSH; PUSHi((IV)RETVAL);
106 }
107 XSRETURN(1);
108}
109
110#ifdef __cplusplus
111extern "C"
112#endif
113XS(boot_Perf__Trace__Context); /* prototype to pass -Wmissing-prototypes */
114XS(boot_Perf__Trace__Context)
115{
116#ifdef dVAR
117 dVAR; dXSARGS;
118#else
119 dXSARGS;
120#endif
121 const char* file = __FILE__;
122
123 PERL_UNUSED_VAR(cv); /* -W */
124 PERL_UNUSED_VAR(items); /* -W */
125 XS_VERSION_BOOTCHECK ;
126
127 newXSproto("Perf::Trace::Context::common_pc", XS_Perf__Trace__Context_common_pc, file, "$");
128 newXSproto("Perf::Trace::Context::common_flags", XS_Perf__Trace__Context_common_flags, file, "$");
129 newXSproto("Perf::Trace::Context::common_lock_depth", XS_Perf__Trace__Context_common_lock_depth, file, "$");
130 if (PL_unitcheckav)
131 call_list(PL_scopestack_ix, PL_unitcheckav);
132 XSRETURN_YES;
133}
134
diff --git a/tools/perf/scripts/perl/Perf-Trace-Util/Context.xs b/tools/perf/scripts/perl/Perf-Trace-Util/Context.xs
new file mode 100644
index 000000000000..fb78006c165e
--- /dev/null
+++ b/tools/perf/scripts/perl/Perf-Trace-Util/Context.xs
@@ -0,0 +1,41 @@
1/*
2 * Context.xs. XS interfaces for perf trace.
3 *
4 * Copyright (C) 2009 Tom Zanussi <tzanussi@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 * (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 */
21
22#include "EXTERN.h"
23#include "perl.h"
24#include "XSUB.h"
25#include "../../../util/trace-event-perl.h"
26
27MODULE = Perf::Trace::Context PACKAGE = Perf::Trace::Context
28PROTOTYPES: ENABLE
29
30int
31common_pc(context)
32 struct scripting_context * context
33
34int
35common_flags(context)
36 struct scripting_context * context
37
38int
39common_lock_depth(context)
40 struct scripting_context * context
41
diff --git a/tools/perf/scripts/perl/Perf-Trace-Util/Makefile.PL b/tools/perf/scripts/perl/Perf-Trace-Util/Makefile.PL
new file mode 100644
index 000000000000..decdeb0f6789
--- /dev/null
+++ b/tools/perf/scripts/perl/Perf-Trace-Util/Makefile.PL
@@ -0,0 +1,17 @@
1use 5.010000;
2use ExtUtils::MakeMaker;
3# See lib/ExtUtils/MakeMaker.pm for details of how to influence
4# the contents of the Makefile that is written.
5WriteMakefile(
6 NAME => 'Perf::Trace::Context',
7 VERSION_FROM => 'lib/Perf/Trace/Context.pm', # finds $VERSION
8 PREREQ_PM => {}, # e.g., Module::Name => 1.1
9 ($] >= 5.005 ? ## Add these new keywords supported since 5.005
10 (ABSTRACT_FROM => 'lib/Perf/Trace/Context.pm', # retrieve abstract from module
11 AUTHOR => 'Tom Zanussi <tzanussi@gmail.com>') : ()),
12 LIBS => [''], # e.g., '-lm'
13 DEFINE => '-I ../..', # e.g., '-DHAVE_SOMETHING'
14 INC => '-I.', # e.g., '-I. -I/usr/include/other'
15 # Un-comment this if you add C files to link with later:
16 OBJECT => 'Context.o', # link all the C files too
17);
diff --git a/tools/perf/scripts/perl/Perf-Trace-Util/README b/tools/perf/scripts/perl/Perf-Trace-Util/README
new file mode 100644
index 000000000000..9a9707630791
--- /dev/null
+++ b/tools/perf/scripts/perl/Perf-Trace-Util/README
@@ -0,0 +1,59 @@
1Perf-Trace-Util version 0.01
2============================
3
4This module contains utility functions for use with perf trace.
5
6Core.pm and Util.pm are pure Perl modules; Core.pm contains routines
7that the core perf support for Perl calls on and should always be
8'used', while Util.pm contains useful but optional utility functions
9that scripts may want to use. Context.pm contains the Perl->C
10interface that allows scripts to access data in the embedding perf
11executable; scripts wishing to do that should 'use Context.pm'.
12
13The Perl->C perf interface is completely driven by Context.xs. If you
14want to add new Perl functions that end up accessing C data in the
15perf executable, you add desciptions of the new functions here.
16scripting_context is a pointer to the perf data in the perf executable
17that you want to access - it's passed as the second parameter,
18$context, to all handler functions.
19
20After you do that:
21
22 perl Makefile.PL # to create a Makefile for the next step
23 make # to create Context.c
24
25 edit Context.c to add const to the char* file = __FILE__ line in
26 XS(boot_Perf__Trace__Context) to silence a warning/error.
27
28 You can delete the Makefile, object files and anything else that was
29 generated e.g. blib and shared library, etc, except for of course
30 Context.c
31
32 You should then be able to run the normal perf make as usual.
33
34INSTALLATION
35
36Building perf with perf trace Perl scripting should install this
37module in the right place.
38
39You should make sure libperl and ExtUtils/Embed.pm are installed first
40e.g. apt-get install libperl-dev or yum install perl-ExtUtils-Embed.
41
42DEPENDENCIES
43
44This module requires these other modules and libraries:
45
46 None
47
48COPYRIGHT AND LICENCE
49
50Copyright (C) 2009 by Tom Zanussi <tzanussi@gmail.com>
51
52This library is free software; you can redistribute it and/or modify
53it under the same terms as Perl itself, either Perl version 5.10.0 or,
54at your option, any later version of Perl 5 you may have available.
55
56Alternatively, this software may be distributed under the terms of the
57GNU General Public License ("GPL") version 2 as published by the Free
58Software Foundation.
59
diff --git a/tools/perf/scripts/perl/Perf-Trace-Util/lib/Perf/Trace/Context.pm b/tools/perf/scripts/perl/Perf-Trace-Util/lib/Perf/Trace/Context.pm
new file mode 100644
index 000000000000..6c7f3659cb17
--- /dev/null
+++ b/tools/perf/scripts/perl/Perf-Trace-Util/lib/Perf/Trace/Context.pm
@@ -0,0 +1,55 @@
1package Perf::Trace::Context;
2
3use 5.010000;
4use strict;
5use warnings;
6
7require Exporter;
8
9our @ISA = qw(Exporter);
10
11our %EXPORT_TAGS = ( 'all' => [ qw(
12) ] );
13
14our @EXPORT_OK = ( @{ $EXPORT_TAGS{'all'} } );
15
16our @EXPORT = qw(
17 common_pc common_flags common_lock_depth
18);
19
20our $VERSION = '0.01';
21
22require XSLoader;
23XSLoader::load('Perf::Trace::Context', $VERSION);
24
251;
26__END__
27=head1 NAME
28
29Perf::Trace::Context - Perl extension for accessing functions in perf.
30
31=head1 SYNOPSIS
32
33 use Perf::Trace::Context;
34
35=head1 SEE ALSO
36
37Perf (trace) documentation
38
39=head1 AUTHOR
40
41Tom Zanussi, E<lt>tzanussi@gmail.com<gt>
42
43=head1 COPYRIGHT AND LICENSE
44
45Copyright (C) 2009 by Tom Zanussi
46
47This library is free software; you can redistribute it and/or modify
48it under the same terms as Perl itself, either Perl version 5.10.0 or,
49at your option, any later version of Perl 5 you may have available.
50
51Alternatively, this software may be distributed under the terms of the
52GNU General Public License ("GPL") version 2 as published by the Free
53Software Foundation.
54
55=cut
diff --git a/tools/perf/scripts/perl/Perf-Trace-Util/lib/Perf/Trace/Core.pm b/tools/perf/scripts/perl/Perf-Trace-Util/lib/Perf/Trace/Core.pm
new file mode 100644
index 000000000000..9df376a9f629
--- /dev/null
+++ b/tools/perf/scripts/perl/Perf-Trace-Util/lib/Perf/Trace/Core.pm
@@ -0,0 +1,192 @@
1package Perf::Trace::Core;
2
3use 5.010000;
4use strict;
5use warnings;
6
7require Exporter;
8
9our @ISA = qw(Exporter);
10
11our %EXPORT_TAGS = ( 'all' => [ qw(
12) ] );
13
14our @EXPORT_OK = ( @{ $EXPORT_TAGS{'all'} } );
15
16our @EXPORT = qw(
17define_flag_field define_flag_value flag_str dump_flag_fields
18define_symbolic_field define_symbolic_value symbol_str dump_symbolic_fields
19trace_flag_str
20);
21
22our $VERSION = '0.01';
23
24my %trace_flags = (0x00 => "NONE",
25 0x01 => "IRQS_OFF",
26 0x02 => "IRQS_NOSUPPORT",
27 0x04 => "NEED_RESCHED",
28 0x08 => "HARDIRQ",
29 0x10 => "SOFTIRQ");
30
31sub trace_flag_str
32{
33 my ($value) = @_;
34
35 my $string;
36
37 my $print_delim = 0;
38
39 foreach my $idx (sort {$a <=> $b} keys %trace_flags) {
40 if (!$value && !$idx) {
41 $string .= "NONE";
42 last;
43 }
44
45 if ($idx && ($value & $idx) == $idx) {
46 if ($print_delim) {
47 $string .= " | ";
48 }
49 $string .= "$trace_flags{$idx}";
50 $print_delim = 1;
51 $value &= ~$idx;
52 }
53 }
54
55 return $string;
56}
57
58my %flag_fields;
59my %symbolic_fields;
60
61sub flag_str
62{
63 my ($event_name, $field_name, $value) = @_;
64
65 my $string;
66
67 if ($flag_fields{$event_name}{$field_name}) {
68 my $print_delim = 0;
69 foreach my $idx (sort {$a <=> $b} keys %{$flag_fields{$event_name}{$field_name}{"values"}}) {
70 if (!$value && !$idx) {
71 $string .= "$flag_fields{$event_name}{$field_name}{'values'}{$idx}";
72 last;
73 }
74 if ($idx && ($value & $idx) == $idx) {
75 if ($print_delim && $flag_fields{$event_name}{$field_name}{'delim'}) {
76 $string .= " $flag_fields{$event_name}{$field_name}{'delim'} ";
77 }
78 $string .= "$flag_fields{$event_name}{$field_name}{'values'}{$idx}";
79 $print_delim = 1;
80 $value &= ~$idx;
81 }
82 }
83 }
84
85 return $string;
86}
87
88sub define_flag_field
89{
90 my ($event_name, $field_name, $delim) = @_;
91
92 $flag_fields{$event_name}{$field_name}{"delim"} = $delim;
93}
94
95sub define_flag_value
96{
97 my ($event_name, $field_name, $value, $field_str) = @_;
98
99 $flag_fields{$event_name}{$field_name}{"values"}{$value} = $field_str;
100}
101
102sub dump_flag_fields
103{
104 for my $event (keys %flag_fields) {
105 print "event $event:\n";
106 for my $field (keys %{$flag_fields{$event}}) {
107 print " field: $field:\n";
108 print " delim: $flag_fields{$event}{$field}{'delim'}\n";
109 foreach my $idx (sort {$a <=> $b} keys %{$flag_fields{$event}{$field}{"values"}}) {
110 print " value $idx: $flag_fields{$event}{$field}{'values'}{$idx}\n";
111 }
112 }
113 }
114}
115
116sub symbol_str
117{
118 my ($event_name, $field_name, $value) = @_;
119
120 if ($symbolic_fields{$event_name}{$field_name}) {
121 foreach my $idx (sort {$a <=> $b} keys %{$symbolic_fields{$event_name}{$field_name}{"values"}}) {
122 if (!$value && !$idx) {
123 return "$symbolic_fields{$event_name}{$field_name}{'values'}{$idx}";
124 last;
125 }
126 if ($value == $idx) {
127 return "$symbolic_fields{$event_name}{$field_name}{'values'}{$idx}";
128 }
129 }
130 }
131
132 return undef;
133}
134
135sub define_symbolic_field
136{
137 my ($event_name, $field_name) = @_;
138
139 # nothing to do, really
140}
141
142sub define_symbolic_value
143{
144 my ($event_name, $field_name, $value, $field_str) = @_;
145
146 $symbolic_fields{$event_name}{$field_name}{"values"}{$value} = $field_str;
147}
148
149sub dump_symbolic_fields
150{
151 for my $event (keys %symbolic_fields) {
152 print "event $event:\n";
153 for my $field (keys %{$symbolic_fields{$event}}) {
154 print " field: $field:\n";
155 foreach my $idx (sort {$a <=> $b} keys %{$symbolic_fields{$event}{$field}{"values"}}) {
156 print " value $idx: $symbolic_fields{$event}{$field}{'values'}{$idx}\n";
157 }
158 }
159 }
160}
161
1621;
163__END__
164=head1 NAME
165
166Perf::Trace::Core - Perl extension for perf trace
167
168=head1 SYNOPSIS
169
170 use Perf::Trace::Core
171
172=head1 SEE ALSO
173
174Perf (trace) documentation
175
176=head1 AUTHOR
177
178Tom Zanussi, E<lt>tzanussi@gmail.com<gt>
179
180=head1 COPYRIGHT AND LICENSE
181
182Copyright (C) 2009 by Tom Zanussi
183
184This library is free software; you can redistribute it and/or modify
185it under the same terms as Perl itself, either Perl version 5.10.0 or,
186at your option, any later version of Perl 5 you may have available.
187
188Alternatively, this software may be distributed under the terms of the
189GNU General Public License ("GPL") version 2 as published by the Free
190Software Foundation.
191
192=cut
diff --git a/tools/perf/scripts/perl/Perf-Trace-Util/lib/Perf/Trace/Util.pm b/tools/perf/scripts/perl/Perf-Trace-Util/lib/Perf/Trace/Util.pm
new file mode 100644
index 000000000000..052f132ced24
--- /dev/null
+++ b/tools/perf/scripts/perl/Perf-Trace-Util/lib/Perf/Trace/Util.pm
@@ -0,0 +1,88 @@
1package Perf::Trace::Util;
2
3use 5.010000;
4use strict;
5use warnings;
6
7require Exporter;
8
9our @ISA = qw(Exporter);
10
11our %EXPORT_TAGS = ( 'all' => [ qw(
12) ] );
13
14our @EXPORT_OK = ( @{ $EXPORT_TAGS{'all'} } );
15
16our @EXPORT = qw(
17avg nsecs nsecs_secs nsecs_nsecs nsecs_usecs print_nsecs
18);
19
20our $VERSION = '0.01';
21
22sub avg
23{
24 my ($total, $n) = @_;
25
26 return $total / $n;
27}
28
29my $NSECS_PER_SEC = 1000000000;
30
31sub nsecs
32{
33 my ($secs, $nsecs) = @_;
34
35 return $secs * $NSECS_PER_SEC + $nsecs;
36}
37
38sub nsecs_secs {
39 my ($nsecs) = @_;
40
41 return $nsecs / $NSECS_PER_SEC;
42}
43
44sub nsecs_nsecs {
45 my ($nsecs) = @_;
46
47 return $nsecs - nsecs_secs($nsecs);
48}
49
50sub nsecs_str {
51 my ($nsecs) = @_;
52
53 my $str = sprintf("%5u.%09u", nsecs_secs($nsecs), nsecs_nsecs($nsecs));
54
55 return $str;
56}
57
581;
59__END__
60=head1 NAME
61
62Perf::Trace::Util - Perl extension for perf trace
63
64=head1 SYNOPSIS
65
66 use Perf::Trace::Util;
67
68=head1 SEE ALSO
69
70Perf (trace) documentation
71
72=head1 AUTHOR
73
74Tom Zanussi, E<lt>tzanussi@gmail.com<gt>
75
76=head1 COPYRIGHT AND LICENSE
77
78Copyright (C) 2009 by Tom Zanussi
79
80This library is free software; you can redistribute it and/or modify
81it under the same terms as Perl itself, either Perl version 5.10.0 or,
82at your option, any later version of Perl 5 you may have available.
83
84Alternatively, this software may be distributed under the terms of the
85GNU General Public License ("GPL") version 2 as published by the Free
86Software Foundation.
87
88=cut
diff --git a/tools/perf/scripts/perl/Perf-Trace-Util/typemap b/tools/perf/scripts/perl/Perf-Trace-Util/typemap
new file mode 100644
index 000000000000..840836804aa7
--- /dev/null
+++ b/tools/perf/scripts/perl/Perf-Trace-Util/typemap
@@ -0,0 +1 @@
struct scripting_context * T_PTR
diff --git a/tools/perf/scripts/perl/bin/check-perf-trace-record b/tools/perf/scripts/perl/bin/check-perf-trace-record
new file mode 100644
index 000000000000..c7ec5de2f535
--- /dev/null
+++ b/tools/perf/scripts/perl/bin/check-perf-trace-record
@@ -0,0 +1,7 @@
1#!/bin/bash
2perf record -c 1 -f -a -M -R -e kmem:kmalloc -e irq:softirq_entry
3
4
5
6
7
diff --git a/tools/perf/scripts/perl/bin/check-perf-trace-report b/tools/perf/scripts/perl/bin/check-perf-trace-report
new file mode 100644
index 000000000000..89948b015020
--- /dev/null
+++ b/tools/perf/scripts/perl/bin/check-perf-trace-report
@@ -0,0 +1,5 @@
1#!/bin/bash
2perf trace -s ~/libexec/perf-core/scripts/perl/check-perf-trace.pl
3
4
5
diff --git a/tools/perf/scripts/perl/bin/rw-by-file-record b/tools/perf/scripts/perl/bin/rw-by-file-record
new file mode 100644
index 000000000000..b25056ebf963
--- /dev/null
+++ b/tools/perf/scripts/perl/bin/rw-by-file-record
@@ -0,0 +1,2 @@
1#!/bin/bash
2perf record -c 1 -f -a -M -R -e syscalls:sys_enter_read -e syscalls:sys_enter_write
diff --git a/tools/perf/scripts/perl/bin/rw-by-file-report b/tools/perf/scripts/perl/bin/rw-by-file-report
new file mode 100644
index 000000000000..f5dcf9cb5bd2
--- /dev/null
+++ b/tools/perf/scripts/perl/bin/rw-by-file-report
@@ -0,0 +1,5 @@
1#!/bin/bash
2perf trace -s ~/libexec/perf-core/scripts/perl/rw-by-file.pl
3
4
5
diff --git a/tools/perf/scripts/perl/bin/rw-by-pid-record b/tools/perf/scripts/perl/bin/rw-by-pid-record
new file mode 100644
index 000000000000..8903979c5b6c
--- /dev/null
+++ b/tools/perf/scripts/perl/bin/rw-by-pid-record
@@ -0,0 +1,2 @@
1#!/bin/bash
2perf record -c 1 -f -a -M -R -e syscalls:sys_enter_read -e syscalls:sys_exit_read -e syscalls:sys_enter_write -e syscalls:sys_exit_write
diff --git a/tools/perf/scripts/perl/bin/rw-by-pid-report b/tools/perf/scripts/perl/bin/rw-by-pid-report
new file mode 100644
index 000000000000..cea16f78a3a2
--- /dev/null
+++ b/tools/perf/scripts/perl/bin/rw-by-pid-report
@@ -0,0 +1,5 @@
1#!/bin/bash
2perf trace -s ~/libexec/perf-core/scripts/perl/rw-by-pid.pl
3
4
5
diff --git a/tools/perf/scripts/perl/bin/wakeup-latency-record b/tools/perf/scripts/perl/bin/wakeup-latency-record
new file mode 100644
index 000000000000..6abedda911a4
--- /dev/null
+++ b/tools/perf/scripts/perl/bin/wakeup-latency-record
@@ -0,0 +1,6 @@
1#!/bin/bash
2perf record -c 1 -f -a -M -R -e sched:sched_switch -e sched:sched_wakeup
3
4
5
6
diff --git a/tools/perf/scripts/perl/bin/wakeup-latency-report b/tools/perf/scripts/perl/bin/wakeup-latency-report
new file mode 100644
index 000000000000..85769dc456eb
--- /dev/null
+++ b/tools/perf/scripts/perl/bin/wakeup-latency-report
@@ -0,0 +1,5 @@
1#!/bin/bash
2perf trace -s ~/libexec/perf-core/scripts/perl/wakeup-latency.pl
3
4
5
diff --git a/tools/perf/scripts/perl/bin/workqueue-stats-record b/tools/perf/scripts/perl/bin/workqueue-stats-record
new file mode 100644
index 000000000000..fce6637b19ba
--- /dev/null
+++ b/tools/perf/scripts/perl/bin/workqueue-stats-record
@@ -0,0 +1,2 @@
1#!/bin/bash
2perf record -c 1 -f -a -M -R -e workqueue:workqueue_creation -e workqueue:workqueue_destruction -e workqueue:workqueue_execution -e workqueue:workqueue_insertion
diff --git a/tools/perf/scripts/perl/bin/workqueue-stats-report b/tools/perf/scripts/perl/bin/workqueue-stats-report
new file mode 100644
index 000000000000..aa68435be926
--- /dev/null
+++ b/tools/perf/scripts/perl/bin/workqueue-stats-report
@@ -0,0 +1,6 @@
1#!/bin/bash
2perf trace -s ~/libexec/perf-core/scripts/perl/workqueue-stats.pl
3
4
5
6
diff --git a/tools/perf/scripts/perl/check-perf-trace.pl b/tools/perf/scripts/perl/check-perf-trace.pl
new file mode 100644
index 000000000000..4e7dc0a407a5
--- /dev/null
+++ b/tools/perf/scripts/perl/check-perf-trace.pl
@@ -0,0 +1,106 @@
1# perf trace event handlers, generated by perf trace -g perl
2# (c) 2009, Tom Zanussi <tzanussi@gmail.com>
3# Licensed under the terms of the GNU GPL License version 2
4
5# This script tests basic functionality such as flag and symbol
6# strings, common_xxx() calls back into perf, begin, end, unhandled
7# events, etc. Basically, if this script runs successfully and
8# displays expected results, perl scripting support should be ok.
9
10use lib "$ENV{'PERF_EXEC_PATH'}/scripts/perl/Perf-Trace-Util/lib";
11use lib "./Perf-Trace-Util/lib";
12use Perf::Trace::Core;
13use Perf::Trace::Context;
14use Perf::Trace::Util;
15
16sub trace_begin
17{
18 print "trace_begin\n";
19}
20
21sub trace_end
22{
23 print "trace_end\n";
24
25 print_unhandled();
26}
27
28sub irq::softirq_entry
29{
30 my ($event_name, $context, $common_cpu, $common_secs, $common_nsecs,
31 $common_pid, $common_comm,
32 $vec) = @_;
33
34 print_header($event_name, $common_cpu, $common_secs, $common_nsecs,
35 $common_pid, $common_comm);
36
37 print_uncommon($context);
38
39 printf("vec=%s\n",
40 symbol_str("irq::softirq_entry", "vec", $vec));
41}
42
43sub kmem::kmalloc
44{
45 my ($event_name, $context, $common_cpu, $common_secs, $common_nsecs,
46 $common_pid, $common_comm,
47 $call_site, $ptr, $bytes_req, $bytes_alloc,
48 $gfp_flags) = @_;
49
50 print_header($event_name, $common_cpu, $common_secs, $common_nsecs,
51 $common_pid, $common_comm);
52
53 print_uncommon($context);
54
55 printf("call_site=%p, ptr=%p, bytes_req=%u, bytes_alloc=%u, ".
56 "gfp_flags=%s\n",
57 $call_site, $ptr, $bytes_req, $bytes_alloc,
58
59 flag_str("kmem::kmalloc", "gfp_flags", $gfp_flags));
60}
61
62# print trace fields not included in handler args
63sub print_uncommon
64{
65 my ($context) = @_;
66
67 printf("common_preempt_count=%d, common_flags=%s, common_lock_depth=%d, ",
68 common_pc($context), trace_flag_str(common_flags($context)),
69 common_lock_depth($context));
70
71}
72
73my %unhandled;
74
75sub print_unhandled
76{
77 if ((scalar keys %unhandled) == 0) {
78 return;
79 }
80
81 print "\nunhandled events:\n\n";
82
83 printf("%-40s %10s\n", "event", "count");
84 printf("%-40s %10s\n", "----------------------------------------",
85 "-----------");
86
87 foreach my $event_name (keys %unhandled) {
88 printf("%-40s %10d\n", $event_name, $unhandled{$event_name});
89 }
90}
91
92sub trace_unhandled
93{
94 my ($event_name, $context, $common_cpu, $common_secs, $common_nsecs,
95 $common_pid, $common_comm) = @_;
96
97 $unhandled{$event_name}++;
98}
99
100sub print_header
101{
102 my ($event_name, $cpu, $secs, $nsecs, $pid, $comm) = @_;
103
104 printf("%-20s %5u %05u.%09u %8u %-20s ",
105 $event_name, $cpu, $secs, $nsecs, $pid, $comm);
106}
diff --git a/tools/perf/scripts/perl/rw-by-file.pl b/tools/perf/scripts/perl/rw-by-file.pl
new file mode 100644
index 000000000000..61f91561d848
--- /dev/null
+++ b/tools/perf/scripts/perl/rw-by-file.pl
@@ -0,0 +1,105 @@
1#!/usr/bin/perl -w
2# (c) 2009, Tom Zanussi <tzanussi@gmail.com>
3# Licensed under the terms of the GNU GPL License version 2
4
5# Display r/w activity for files read/written to for a given program
6
7# The common_* event handler fields are the most useful fields common to
8# all events. They don't necessarily correspond to the 'common_*' fields
9# in the status files. Those fields not available as handler params can
10# be retrieved via script functions of the form get_common_*().
11
12use 5.010000;
13use strict;
14use warnings;
15
16use lib "$ENV{'PERF_EXEC_PATH'}/scripts/perl/Perf-Trace-Util/lib";
17use lib "./Perf-Trace-Util/lib";
18use Perf::Trace::Core;
19use Perf::Trace::Util;
20
21# change this to the comm of the program you're interested in
22my $for_comm = "perf";
23
24my %reads;
25my %writes;
26
27sub syscalls::sys_enter_read
28{
29 my ($event_name, $context, $common_cpu, $common_secs, $common_nsecs,
30 $common_pid, $common_comm, $nr, $fd, $buf, $count) = @_;
31
32 if ($common_comm eq $for_comm) {
33 $reads{$fd}{bytes_requested} += $count;
34 $reads{$fd}{total_reads}++;
35 }
36}
37
38sub syscalls::sys_enter_write
39{
40 my ($event_name, $context, $common_cpu, $common_secs, $common_nsecs,
41 $common_pid, $common_comm, $nr, $fd, $buf, $count) = @_;
42
43 if ($common_comm eq $for_comm) {
44 $writes{$fd}{bytes_written} += $count;
45 $writes{$fd}{total_writes}++;
46 }
47}
48
49sub trace_end
50{
51 printf("file read counts for $for_comm:\n\n");
52
53 printf("%6s %10s %10s\n", "fd", "# reads", "bytes_requested");
54 printf("%6s %10s %10s\n", "------", "----------", "-----------");
55
56 foreach my $fd (sort {$reads{$b}{bytes_requested} <=>
57 $reads{$a}{bytes_requested}} keys %reads) {
58 my $total_reads = $reads{$fd}{total_reads};
59 my $bytes_requested = $reads{$fd}{bytes_requested};
60 printf("%6u %10u %10u\n", $fd, $total_reads, $bytes_requested);
61 }
62
63 printf("\nfile write counts for $for_comm:\n\n");
64
65 printf("%6s %10s %10s\n", "fd", "# writes", "bytes_written");
66 printf("%6s %10s %10s\n", "------", "----------", "-----------");
67
68 foreach my $fd (sort {$writes{$b}{bytes_written} <=>
69 $writes{$a}{bytes_written}} keys %writes) {
70 my $total_writes = $writes{$fd}{total_writes};
71 my $bytes_written = $writes{$fd}{bytes_written};
72 printf("%6u %10u %10u\n", $fd, $total_writes, $bytes_written);
73 }
74
75 print_unhandled();
76}
77
78my %unhandled;
79
80sub print_unhandled
81{
82 if ((scalar keys %unhandled) == 0) {
83 return;
84 }
85
86 print "\nunhandled events:\n\n";
87
88 printf("%-40s %10s\n", "event", "count");
89 printf("%-40s %10s\n", "----------------------------------------",
90 "-----------");
91
92 foreach my $event_name (keys %unhandled) {
93 printf("%-40s %10d\n", $event_name, $unhandled{$event_name});
94 }
95}
96
97sub trace_unhandled
98{
99 my ($event_name, $context, $common_cpu, $common_secs, $common_nsecs,
100 $common_pid, $common_comm) = @_;
101
102 $unhandled{$event_name}++;
103}
104
105
diff --git a/tools/perf/scripts/perl/rw-by-pid.pl b/tools/perf/scripts/perl/rw-by-pid.pl
new file mode 100644
index 000000000000..da601fae1a00
--- /dev/null
+++ b/tools/perf/scripts/perl/rw-by-pid.pl
@@ -0,0 +1,170 @@
1#!/usr/bin/perl -w
2# (c) 2009, Tom Zanussi <tzanussi@gmail.com>
3# Licensed under the terms of the GNU GPL License version 2
4
5# Display r/w activity for all processes
6
7# The common_* event handler fields are the most useful fields common to
8# all events. They don't necessarily correspond to the 'common_*' fields
9# in the status files. Those fields not available as handler params can
10# be retrieved via script functions of the form get_common_*().
11
12use 5.010000;
13use strict;
14use warnings;
15
16use lib "$ENV{'PERF_EXEC_PATH'}/scripts/perl/Perf-Trace-Util/lib";
17use lib "./Perf-Trace-Util/lib";
18use Perf::Trace::Core;
19use Perf::Trace::Util;
20
21my %reads;
22my %writes;
23
24sub syscalls::sys_exit_read
25{
26 my ($event_name, $context, $common_cpu, $common_secs, $common_nsecs,
27 $common_pid, $common_comm,
28 $nr, $ret) = @_;
29
30 if ($ret > 0) {
31 $reads{$common_pid}{bytes_read} += $ret;
32 } else {
33 if (!defined ($reads{$common_pid}{bytes_read})) {
34 $reads{$common_pid}{bytes_read} = 0;
35 }
36 $reads{$common_pid}{errors}{$ret}++;
37 }
38}
39
40sub syscalls::sys_enter_read
41{
42 my ($event_name, $context, $common_cpu, $common_secs, $common_nsecs,
43 $common_pid, $common_comm,
44 $nr, $fd, $buf, $count) = @_;
45
46 $reads{$common_pid}{bytes_requested} += $count;
47 $reads{$common_pid}{total_reads}++;
48 $reads{$common_pid}{comm} = $common_comm;
49}
50
51sub syscalls::sys_exit_write
52{
53 my ($event_name, $context, $common_cpu, $common_secs, $common_nsecs,
54 $common_pid, $common_comm,
55 $nr, $ret) = @_;
56
57 if ($ret <= 0) {
58 $writes{$common_pid}{errors}{$ret}++;
59 }
60}
61
62sub syscalls::sys_enter_write
63{
64 my ($event_name, $context, $common_cpu, $common_secs, $common_nsecs,
65 $common_pid, $common_comm,
66 $nr, $fd, $buf, $count) = @_;
67
68 $writes{$common_pid}{bytes_written} += $count;
69 $writes{$common_pid}{total_writes}++;
70 $writes{$common_pid}{comm} = $common_comm;
71}
72
73sub trace_end
74{
75 printf("read counts by pid:\n\n");
76
77 printf("%6s %20s %10s %10s %10s\n", "pid", "comm",
78 "# reads", "bytes_requested", "bytes_read");
79 printf("%6s %-20s %10s %10s %10s\n", "------", "--------------------",
80 "-----------", "----------", "----------");
81
82 foreach my $pid (sort {$reads{$b}{bytes_read} <=>
83 $reads{$a}{bytes_read}} keys %reads) {
84 my $comm = $reads{$pid}{comm};
85 my $total_reads = $reads{$pid}{total_reads};
86 my $bytes_requested = $reads{$pid}{bytes_requested};
87 my $bytes_read = $reads{$pid}{bytes_read};
88
89 printf("%6s %-20s %10s %10s %10s\n", $pid, $comm,
90 $total_reads, $bytes_requested, $bytes_read);
91 }
92
93 printf("\nfailed reads by pid:\n\n");
94
95 printf("%6s %20s %6s %10s\n", "pid", "comm", "error #", "# errors");
96 printf("%6s %20s %6s %10s\n", "------", "--------------------",
97 "------", "----------");
98
99 foreach my $pid (keys %reads) {
100 my $comm = $reads{$pid}{comm};
101 foreach my $err (sort {$reads{$b}{comm} cmp $reads{$a}{comm}}
102 keys %{$reads{$pid}{errors}}) {
103 my $errors = $reads{$pid}{errors}{$err};
104
105 printf("%6d %-20s %6d %10s\n", $pid, $comm, $err, $errors);
106 }
107 }
108
109 printf("\nwrite counts by pid:\n\n");
110
111 printf("%6s %20s %10s %10s\n", "pid", "comm",
112 "# writes", "bytes_written");
113 printf("%6s %-20s %10s %10s\n", "------", "--------------------",
114 "-----------", "----------");
115
116 foreach my $pid (sort {$writes{$b}{bytes_written} <=>
117 $writes{$a}{bytes_written}} keys %writes) {
118 my $comm = $writes{$pid}{comm};
119 my $total_writes = $writes{$pid}{total_writes};
120 my $bytes_written = $writes{$pid}{bytes_written};
121
122 printf("%6s %-20s %10s %10s\n", $pid, $comm,
123 $total_writes, $bytes_written);
124 }
125
126 printf("\nfailed writes by pid:\n\n");
127
128 printf("%6s %20s %6s %10s\n", "pid", "comm", "error #", "# errors");
129 printf("%6s %20s %6s %10s\n", "------", "--------------------",
130 "------", "----------");
131
132 foreach my $pid (keys %writes) {
133 my $comm = $writes{$pid}{comm};
134 foreach my $err (sort {$writes{$b}{comm} cmp $writes{$a}{comm}}
135 keys %{$writes{$pid}{errors}}) {
136 my $errors = $writes{$pid}{errors}{$err};
137
138 printf("%6d %-20s %6d %10s\n", $pid, $comm, $err, $errors);
139 }
140 }
141
142 print_unhandled();
143}
144
145my %unhandled;
146
147sub print_unhandled
148{
149 if ((scalar keys %unhandled) == 0) {
150 return;
151 }
152
153 print "\nunhandled events:\n\n";
154
155 printf("%-40s %10s\n", "event", "count");
156 printf("%-40s %10s\n", "----------------------------------------",
157 "-----------");
158
159 foreach my $event_name (keys %unhandled) {
160 printf("%-40s %10d\n", $event_name, $unhandled{$event_name});
161 }
162}
163
164sub trace_unhandled
165{
166 my ($event_name, $context, $common_cpu, $common_secs, $common_nsecs,
167 $common_pid, $common_comm) = @_;
168
169 $unhandled{$event_name}++;
170}
diff --git a/tools/perf/scripts/perl/wakeup-latency.pl b/tools/perf/scripts/perl/wakeup-latency.pl
new file mode 100644
index 000000000000..ed58ef284e23
--- /dev/null
+++ b/tools/perf/scripts/perl/wakeup-latency.pl
@@ -0,0 +1,103 @@
1#!/usr/bin/perl -w
2# (c) 2009, Tom Zanussi <tzanussi@gmail.com>
3# Licensed under the terms of the GNU GPL License version 2
4
5# Display avg/min/max wakeup latency
6
7# The common_* event handler fields are the most useful fields common to
8# all events. They don't necessarily correspond to the 'common_*' fields
9# in the status files. Those fields not available as handler params can
10# be retrieved via script functions of the form get_common_*().
11
12use 5.010000;
13use strict;
14use warnings;
15
16use lib "$ENV{'PERF_EXEC_PATH'}/scripts/perl/Perf-Trace-Util/lib";
17use lib "./Perf-Trace-Util/lib";
18use Perf::Trace::Core;
19use Perf::Trace::Util;
20
21my %last_wakeup;
22
23my $max_wakeup_latency;
24my $min_wakeup_latency;
25my $total_wakeup_latency;
26my $total_wakeups;
27
28sub sched::sched_switch
29{
30 my ($event_name, $context, $common_cpu, $common_secs, $common_nsecs,
31 $common_pid, $common_comm,
32 $prev_comm, $prev_pid, $prev_prio, $prev_state, $next_comm, $next_pid,
33 $next_prio) = @_;
34
35 my $wakeup_ts = $last_wakeup{$common_cpu}{ts};
36 if ($wakeup_ts) {
37 my $switch_ts = nsecs($common_secs, $common_nsecs);
38 my $wakeup_latency = $switch_ts - $wakeup_ts;
39 if ($wakeup_latency > $max_wakeup_latency) {
40 $max_wakeup_latency = $wakeup_latency;
41 }
42 if ($wakeup_latency < $min_wakeup_latency) {
43 $min_wakeup_latency = $wakeup_latency;
44 }
45 $total_wakeup_latency += $wakeup_latency;
46 $total_wakeups++;
47 }
48 $last_wakeup{$common_cpu}{ts} = 0;
49}
50
51sub sched::sched_wakeup
52{
53 my ($event_name, $context, $common_cpu, $common_secs, $common_nsecs,
54 $common_pid, $common_comm,
55 $comm, $pid, $prio, $success, $target_cpu) = @_;
56
57 $last_wakeup{$target_cpu}{ts} = nsecs($common_secs, $common_nsecs);
58}
59
60sub trace_begin
61{
62 $min_wakeup_latency = 1000000000;
63 $max_wakeup_latency = 0;
64}
65
66sub trace_end
67{
68 printf("wakeup_latency stats:\n\n");
69 print "total_wakeups: $total_wakeups\n";
70 printf("avg_wakeup_latency (ns): %u\n",
71 avg($total_wakeup_latency, $total_wakeups));
72 printf("min_wakeup_latency (ns): %u\n", $min_wakeup_latency);
73 printf("max_wakeup_latency (ns): %u\n", $max_wakeup_latency);
74
75 print_unhandled();
76}
77
78my %unhandled;
79
80sub print_unhandled
81{
82 if ((scalar keys %unhandled) == 0) {
83 return;
84 }
85
86 print "\nunhandled events:\n\n";
87
88 printf("%-40s %10s\n", "event", "count");
89 printf("%-40s %10s\n", "----------------------------------------",
90 "-----------");
91
92 foreach my $event_name (keys %unhandled) {
93 printf("%-40s %10d\n", $event_name, $unhandled{$event_name});
94 }
95}
96
97sub trace_unhandled
98{
99 my ($event_name, $context, $common_cpu, $common_secs, $common_nsecs,
100 $common_pid, $common_comm) = @_;
101
102 $unhandled{$event_name}++;
103}
diff --git a/tools/perf/scripts/perl/workqueue-stats.pl b/tools/perf/scripts/perl/workqueue-stats.pl
new file mode 100644
index 000000000000..511302c8a494
--- /dev/null
+++ b/tools/perf/scripts/perl/workqueue-stats.pl
@@ -0,0 +1,129 @@
1#!/usr/bin/perl -w
2# (c) 2009, Tom Zanussi <tzanussi@gmail.com>
3# Licensed under the terms of the GNU GPL License version 2
4
5# Displays workqueue stats
6#
7# Usage:
8#
9# perf record -c 1 -f -a -R -e workqueue:workqueue_creation -e
10# workqueue:workqueue_destruction -e workqueue:workqueue_execution
11# -e workqueue:workqueue_insertion
12#
13# perf trace -p -s tools/perf/scripts/perl/workqueue-stats.pl
14
15use 5.010000;
16use strict;
17use warnings;
18
19use lib "$ENV{'PERF_EXEC_PATH'}/scripts/perl/Perf-Trace-Util/lib";
20use lib "./Perf-Trace-Util/lib";
21use Perf::Trace::Core;
22use Perf::Trace::Util;
23
24my @cpus;
25
26sub workqueue::workqueue_destruction
27{
28 my ($event_name, $context, $common_cpu, $common_secs, $common_nsecs,
29 $common_pid, $common_comm,
30 $thread_comm, $thread_pid) = @_;
31
32 $cpus[$common_cpu]{$thread_pid}{destroyed}++;
33 $cpus[$common_cpu]{$thread_pid}{comm} = $thread_comm;
34}
35
36sub workqueue::workqueue_creation
37{
38 my ($event_name, $context, $common_cpu, $common_secs, $common_nsecs,
39 $common_pid, $common_comm,
40 $thread_comm, $thread_pid, $cpu) = @_;
41
42 $cpus[$common_cpu]{$thread_pid}{created}++;
43 $cpus[$common_cpu]{$thread_pid}{comm} = $thread_comm;
44}
45
46sub workqueue::workqueue_execution
47{
48 my ($event_name, $context, $common_cpu, $common_secs, $common_nsecs,
49 $common_pid, $common_comm,
50 $thread_comm, $thread_pid, $func) = @_;
51
52 $cpus[$common_cpu]{$thread_pid}{executed}++;
53 $cpus[$common_cpu]{$thread_pid}{comm} = $thread_comm;
54}
55
56sub workqueue::workqueue_insertion
57{
58 my ($event_name, $context, $common_cpu, $common_secs, $common_nsecs,
59 $common_pid, $common_comm,
60 $thread_comm, $thread_pid, $func) = @_;
61
62 $cpus[$common_cpu]{$thread_pid}{inserted}++;
63 $cpus[$common_cpu]{$thread_pid}{comm} = $thread_comm;
64}
65
66sub trace_end
67{
68 print "workqueue work stats:\n\n";
69 my $cpu = 0;
70 printf("%3s %6s %6s\t%-20s\n", "cpu", "ins", "exec", "name");
71 printf("%3s %6s %6s\t%-20s\n", "---", "---", "----", "----");
72 foreach my $pidhash (@cpus) {
73 while ((my $pid, my $wqhash) = each %$pidhash) {
74 my $ins = $$wqhash{'inserted'};
75 my $exe = $$wqhash{'executed'};
76 my $comm = $$wqhash{'comm'};
77 if ($ins || $exe) {
78 printf("%3u %6u %6u\t%-20s\n", $cpu, $ins, $exe, $comm);
79 }
80 }
81 $cpu++;
82 }
83
84 $cpu = 0;
85 print "\nworkqueue lifecycle stats:\n\n";
86 printf("%3s %6s %6s\t%-20s\n", "cpu", "created", "destroyed", "name");
87 printf("%3s %6s %6s\t%-20s\n", "---", "-------", "---------", "----");
88 foreach my $pidhash (@cpus) {
89 while ((my $pid, my $wqhash) = each %$pidhash) {
90 my $created = $$wqhash{'created'};
91 my $destroyed = $$wqhash{'destroyed'};
92 my $comm = $$wqhash{'comm'};
93 if ($created || $destroyed) {
94 printf("%3u %6u %6u\t%-20s\n", $cpu, $created, $destroyed,
95 $comm);
96 }
97 }
98 $cpu++;
99 }
100
101 print_unhandled();
102}
103
104my %unhandled;
105
106sub print_unhandled
107{
108 if ((scalar keys %unhandled) == 0) {
109 return;
110 }
111
112 print "\nunhandled events:\n\n";
113
114 printf("%-40s %10s\n", "event", "count");
115 printf("%-40s %10s\n", "----------------------------------------",
116 "-----------");
117
118 foreach my $event_name (keys %unhandled) {
119 printf("%-40s %10d\n", $event_name, $unhandled{$event_name});
120 }
121}
122
123sub trace_unhandled
124{
125 my ($event_name, $context, $common_cpu, $common_secs, $common_nsecs,
126 $common_pid, $common_comm) = @_;
127
128 $unhandled{$event_name}++;
129}
diff --git a/tools/perf/util/cache.h b/tools/perf/util/cache.h
index 6f8ea9d210b6..918eb376abe3 100644
--- a/tools/perf/util/cache.h
+++ b/tools/perf/util/cache.h
@@ -1,10 +1,15 @@
1#ifndef CACHE_H 1#ifndef __PERF_CACHE_H
2#define CACHE_H 2#define __PERF_CACHE_H
3 3
4#include "util.h" 4#include "util.h"
5#include "strbuf.h" 5#include "strbuf.h"
6#include "../perf.h" 6#include "../perf.h"
7 7
8#define CMD_EXEC_PATH "--exec-path"
9#define CMD_PERF_DIR "--perf-dir="
10#define CMD_WORK_TREE "--work-tree="
11#define CMD_DEBUGFS_DIR "--debugfs-dir="
12
8#define PERF_DIR_ENVIRONMENT "PERF_DIR" 13#define PERF_DIR_ENVIRONMENT "PERF_DIR"
9#define PERF_WORK_TREE_ENVIRONMENT "PERF_WORK_TREE" 14#define PERF_WORK_TREE_ENVIRONMENT "PERF_WORK_TREE"
10#define DEFAULT_PERF_DIR_ENVIRONMENT ".perf" 15#define DEFAULT_PERF_DIR_ENVIRONMENT ".perf"
@@ -117,4 +122,4 @@ extern char *perf_pathdup(const char *fmt, ...)
117 122
118extern size_t strlcpy(char *dest, const char *src, size_t size); 123extern size_t strlcpy(char *dest, const char *src, size_t size);
119 124
120#endif /* CACHE_H */ 125#endif /* __PERF_CACHE_H */
diff --git a/tools/perf/util/callchain.c b/tools/perf/util/callchain.c
index 3b8380f1b478..b3b71258272a 100644
--- a/tools/perf/util/callchain.c
+++ b/tools/perf/util/callchain.c
@@ -206,7 +206,7 @@ fill_node(struct callchain_node *node, struct ip_callchain *chain,
206 } 206 }
207 node->val_nr = chain->nr - start; 207 node->val_nr = chain->nr - start;
208 if (!node->val_nr) 208 if (!node->val_nr)
209 printf("Warning: empty node in callchain tree\n"); 209 pr_warning("Warning: empty node in callchain tree\n");
210} 210}
211 211
212static void 212static void
diff --git a/tools/perf/util/callchain.h b/tools/perf/util/callchain.h
index 43cf3ea9e088..ad4626de4c2b 100644
--- a/tools/perf/util/callchain.h
+++ b/tools/perf/util/callchain.h
@@ -58,4 +58,4 @@ static inline u64 cumul_hits(struct callchain_node *node)
58int register_callchain_param(struct callchain_param *param); 58int register_callchain_param(struct callchain_param *param);
59void append_chain(struct callchain_node *root, struct ip_callchain *chain, 59void append_chain(struct callchain_node *root, struct ip_callchain *chain,
60 struct symbol **syms); 60 struct symbol **syms);
61#endif 61#endif /* __PERF_CALLCHAIN_H */
diff --git a/tools/perf/util/color.h b/tools/perf/util/color.h
index 58d597564b99..24e8809210bb 100644
--- a/tools/perf/util/color.h
+++ b/tools/perf/util/color.h
@@ -1,5 +1,5 @@
1#ifndef COLOR_H 1#ifndef __PERF_COLOR_H
2#define COLOR_H 2#define __PERF_COLOR_H
3 3
4/* "\033[1;38;5;2xx;48;5;2xxm\0" is 23 bytes */ 4/* "\033[1;38;5;2xx;48;5;2xxm\0" is 23 bytes */
5#define COLOR_MAXLEN 24 5#define COLOR_MAXLEN 24
@@ -39,4 +39,4 @@ int color_fwrite_lines(FILE *fp, const char *color, size_t count, const char *bu
39int percent_color_fprintf(FILE *fp, const char *fmt, double percent); 39int percent_color_fprintf(FILE *fp, const char *fmt, double percent);
40const char *get_percent_color(double percent); 40const char *get_percent_color(double percent);
41 41
42#endif /* COLOR_H */ 42#endif /* __PERF_COLOR_H */
diff --git a/tools/perf/util/ctype.c b/tools/perf/util/ctype.c
index 0b791bd346bc..35073621e5de 100644
--- a/tools/perf/util/ctype.c
+++ b/tools/perf/util/ctype.c
@@ -29,3 +29,11 @@ unsigned char sane_ctype[256] = {
29 A, A, A, A, A, A, A, A, A, A, A, R, R, P, P, 0, /* 112..127 */ 29 A, A, A, A, A, A, A, A, A, A, A, R, R, P, P, 0, /* 112..127 */
30 /* Nothing in the 128.. range */ 30 /* Nothing in the 128.. range */
31}; 31};
32
33const char *graph_line =
34 "_____________________________________________________________________"
35 "_____________________________________________________________________";
36const char *graph_dotted_line =
37 "---------------------------------------------------------------------"
38 "---------------------------------------------------------------------"
39 "---------------------------------------------------------------------";
diff --git a/tools/perf/util/data_map.c b/tools/perf/util/data_map.c
new file mode 100644
index 000000000000..ca0bedf637c2
--- /dev/null
+++ b/tools/perf/util/data_map.c
@@ -0,0 +1,291 @@
1#include "data_map.h"
2#include "symbol.h"
3#include "util.h"
4#include "debug.h"
5
6
7static struct perf_file_handler *curr_handler;
8static unsigned long mmap_window = 32;
9static char __cwd[PATH_MAX];
10
11static int process_event_stub(event_t *event __used)
12{
13 dump_printf(": unhandled!\n");
14 return 0;
15}
16
17void register_perf_file_handler(struct perf_file_handler *handler)
18{
19 if (!handler->process_sample_event)
20 handler->process_sample_event = process_event_stub;
21 if (!handler->process_mmap_event)
22 handler->process_mmap_event = process_event_stub;
23 if (!handler->process_comm_event)
24 handler->process_comm_event = process_event_stub;
25 if (!handler->process_fork_event)
26 handler->process_fork_event = process_event_stub;
27 if (!handler->process_exit_event)
28 handler->process_exit_event = process_event_stub;
29 if (!handler->process_lost_event)
30 handler->process_lost_event = process_event_stub;
31 if (!handler->process_read_event)
32 handler->process_read_event = process_event_stub;
33 if (!handler->process_throttle_event)
34 handler->process_throttle_event = process_event_stub;
35 if (!handler->process_unthrottle_event)
36 handler->process_unthrottle_event = process_event_stub;
37
38 curr_handler = handler;
39}
40
41static const char *event__name[] = {
42 [0] = "TOTAL",
43 [PERF_RECORD_MMAP] = "MMAP",
44 [PERF_RECORD_LOST] = "LOST",
45 [PERF_RECORD_COMM] = "COMM",
46 [PERF_RECORD_EXIT] = "EXIT",
47 [PERF_RECORD_THROTTLE] = "THROTTLE",
48 [PERF_RECORD_UNTHROTTLE] = "UNTHROTTLE",
49 [PERF_RECORD_FORK] = "FORK",
50 [PERF_RECORD_READ] = "READ",
51 [PERF_RECORD_SAMPLE] = "SAMPLE",
52};
53
54unsigned long event__total[PERF_RECORD_MAX];
55
56void event__print_totals(void)
57{
58 int i;
59 for (i = 0; i < PERF_RECORD_MAX; ++i)
60 pr_info("%10s events: %10ld\n",
61 event__name[i], event__total[i]);
62}
63
64static int
65process_event(event_t *event, unsigned long offset, unsigned long head)
66{
67 trace_event(event);
68
69 if (event->header.type < PERF_RECORD_MAX) {
70 dump_printf("%p [%p]: PERF_RECORD_%s",
71 (void *)(offset + head),
72 (void *)(long)(event->header.size),
73 event__name[event->header.type]);
74 ++event__total[0];
75 ++event__total[event->header.type];
76 }
77
78 switch (event->header.type) {
79 case PERF_RECORD_SAMPLE:
80 return curr_handler->process_sample_event(event);
81 case PERF_RECORD_MMAP:
82 return curr_handler->process_mmap_event(event);
83 case PERF_RECORD_COMM:
84 return curr_handler->process_comm_event(event);
85 case PERF_RECORD_FORK:
86 return curr_handler->process_fork_event(event);
87 case PERF_RECORD_EXIT:
88 return curr_handler->process_exit_event(event);
89 case PERF_RECORD_LOST:
90 return curr_handler->process_lost_event(event);
91 case PERF_RECORD_READ:
92 return curr_handler->process_read_event(event);
93 case PERF_RECORD_THROTTLE:
94 return curr_handler->process_throttle_event(event);
95 case PERF_RECORD_UNTHROTTLE:
96 return curr_handler->process_unthrottle_event(event);
97 default:
98 curr_handler->total_unknown++;
99 return -1;
100 }
101}
102
103int perf_header__read_build_ids(int input, off_t offset, off_t size)
104{
105 struct build_id_event bev;
106 char filename[PATH_MAX];
107 off_t limit = offset + size;
108 int err = -1;
109
110 while (offset < limit) {
111 struct dso *dso;
112 ssize_t len;
113
114 if (read(input, &bev, sizeof(bev)) != sizeof(bev))
115 goto out;
116
117 len = bev.header.size - sizeof(bev);
118 if (read(input, filename, len) != len)
119 goto out;
120
121 dso = dsos__findnew(filename);
122 if (dso != NULL)
123 dso__set_build_id(dso, &bev.build_id);
124
125 offset += bev.header.size;
126 }
127 err = 0;
128out:
129 return err;
130}
131
132int mmap_dispatch_perf_file(struct perf_header **pheader,
133 const char *input_name,
134 int force,
135 int full_paths,
136 int *cwdlen,
137 char **cwd)
138{
139 int err;
140 struct perf_header *header;
141 unsigned long head, shift;
142 unsigned long offset = 0;
143 struct stat input_stat;
144 size_t page_size;
145 u64 sample_type;
146 event_t *event;
147 uint32_t size;
148 int input;
149 char *buf;
150
151 if (curr_handler == NULL) {
152 pr_debug("Forgot to register perf file handler\n");
153 return -EINVAL;
154 }
155
156 page_size = getpagesize();
157
158 input = open(input_name, O_RDONLY);
159 if (input < 0) {
160 pr_err("Failed to open file: %s", input_name);
161 if (!strcmp(input_name, "perf.data"))
162 pr_err(" (try 'perf record' first)");
163 pr_err("\n");
164 return -errno;
165 }
166
167 if (fstat(input, &input_stat) < 0) {
168 pr_err("failed to stat file");
169 err = -errno;
170 goto out_close;
171 }
172
173 err = -EACCES;
174 if (!force && input_stat.st_uid && (input_stat.st_uid != geteuid())) {
175 pr_err("file: %s not owned by current user or root\n",
176 input_name);
177 goto out_close;
178 }
179
180 if (input_stat.st_size == 0) {
181 pr_info("zero-sized file, nothing to do!\n");
182 goto done;
183 }
184
185 err = -ENOMEM;
186 header = perf_header__new();
187 if (header == NULL)
188 goto out_close;
189
190 err = perf_header__read(header, input);
191 if (err < 0)
192 goto out_delete;
193 *pheader = header;
194 head = header->data_offset;
195
196 sample_type = perf_header__sample_type(header);
197
198 err = -EINVAL;
199 if (curr_handler->sample_type_check &&
200 curr_handler->sample_type_check(sample_type) < 0)
201 goto out_delete;
202
203 if (!full_paths) {
204 if (getcwd(__cwd, sizeof(__cwd)) == NULL) {
205 pr_err("failed to get the current directory\n");
206 err = -errno;
207 goto out_delete;
208 }
209 *cwd = __cwd;
210 *cwdlen = strlen(*cwd);
211 } else {
212 *cwd = NULL;
213 *cwdlen = 0;
214 }
215
216 shift = page_size * (head / page_size);
217 offset += shift;
218 head -= shift;
219
220remap:
221 buf = mmap(NULL, page_size * mmap_window, PROT_READ,
222 MAP_SHARED, input, offset);
223 if (buf == MAP_FAILED) {
224 pr_err("failed to mmap file\n");
225 err = -errno;
226 goto out_delete;
227 }
228
229more:
230 event = (event_t *)(buf + head);
231
232 size = event->header.size;
233 if (!size)
234 size = 8;
235
236 if (head + event->header.size >= page_size * mmap_window) {
237 int munmap_ret;
238
239 shift = page_size * (head / page_size);
240
241 munmap_ret = munmap(buf, page_size * mmap_window);
242 assert(munmap_ret == 0);
243
244 offset += shift;
245 head -= shift;
246 goto remap;
247 }
248
249 size = event->header.size;
250
251 dump_printf("\n%p [%p]: event: %d\n",
252 (void *)(offset + head),
253 (void *)(long)event->header.size,
254 event->header.type);
255
256 if (!size || process_event(event, offset, head) < 0) {
257
258 dump_printf("%p [%p]: skipping unknown header type: %d\n",
259 (void *)(offset + head),
260 (void *)(long)(event->header.size),
261 event->header.type);
262
263 /*
264 * assume we lost track of the stream, check alignment, and
265 * increment a single u64 in the hope to catch on again 'soon'.
266 */
267
268 if (unlikely(head & 7))
269 head &= ~7ULL;
270
271 size = 8;
272 }
273
274 head += size;
275
276 if (offset + head >= header->data_offset + header->data_size)
277 goto done;
278
279 if (offset + head < (unsigned long)input_stat.st_size)
280 goto more;
281
282done:
283 err = 0;
284out_close:
285 close(input);
286
287 return err;
288out_delete:
289 perf_header__delete(header);
290 goto out_close;
291}
diff --git a/tools/perf/util/data_map.h b/tools/perf/util/data_map.h
new file mode 100644
index 000000000000..3180ff7e3633
--- /dev/null
+++ b/tools/perf/util/data_map.h
@@ -0,0 +1,32 @@
1#ifndef __PERF_DATAMAP_H
2#define __PERF_DATAMAP_H
3
4#include "event.h"
5#include "header.h"
6
7typedef int (*event_type_handler_t)(event_t *);
8
9struct perf_file_handler {
10 event_type_handler_t process_sample_event;
11 event_type_handler_t process_mmap_event;
12 event_type_handler_t process_comm_event;
13 event_type_handler_t process_fork_event;
14 event_type_handler_t process_exit_event;
15 event_type_handler_t process_lost_event;
16 event_type_handler_t process_read_event;
17 event_type_handler_t process_throttle_event;
18 event_type_handler_t process_unthrottle_event;
19 int (*sample_type_check)(u64 sample_type);
20 unsigned long total_unknown;
21};
22
23void register_perf_file_handler(struct perf_file_handler *handler);
24int mmap_dispatch_perf_file(struct perf_header **pheader,
25 const char *input_name,
26 int force,
27 int full_paths,
28 int *cwdlen,
29 char **cwd);
30int perf_header__read_build_ids(int input, off_t offset, off_t file_size);
31
32#endif
diff --git a/tools/perf/util/debug.c b/tools/perf/util/debug.c
index e8ca98fe0bd4..28d520d5a1fb 100644
--- a/tools/perf/util/debug.c
+++ b/tools/perf/util/debug.c
@@ -13,12 +13,12 @@
13int verbose = 0; 13int verbose = 0;
14int dump_trace = 0; 14int dump_trace = 0;
15 15
16int eprintf(const char *fmt, ...) 16int eprintf(int level, const char *fmt, ...)
17{ 17{
18 va_list args; 18 va_list args;
19 int ret = 0; 19 int ret = 0;
20 20
21 if (verbose) { 21 if (verbose >= level) {
22 va_start(args, fmt); 22 va_start(args, fmt);
23 ret = vfprintf(stderr, fmt, args); 23 ret = vfprintf(stderr, fmt, args);
24 va_end(args); 24 va_end(args);
diff --git a/tools/perf/util/debug.h b/tools/perf/util/debug.h
index 437eea58ce40..c6c24c522dea 100644
--- a/tools/perf/util/debug.h
+++ b/tools/perf/util/debug.h
@@ -1,8 +1,15 @@
1/* For debugging general purposes */ 1/* For debugging general purposes */
2#ifndef __PERF_DEBUG_H
3#define __PERF_DEBUG_H
4
5#include "event.h"
2 6
3extern int verbose; 7extern int verbose;
4extern int dump_trace; 8extern int dump_trace;
5 9
6int eprintf(const char *fmt, ...) __attribute__((format(printf, 1, 2))); 10int eprintf(int level,
11 const char *fmt, ...) __attribute__((format(printf, 2, 3)));
7int dump_printf(const char *fmt, ...) __attribute__((format(printf, 1, 2))); 12int dump_printf(const char *fmt, ...) __attribute__((format(printf, 1, 2)));
8void trace_event(event_t *event); 13void trace_event(event_t *event);
14
15#endif /* __PERF_DEBUG_H */
diff --git a/tools/perf/util/debugfs.c b/tools/perf/util/debugfs.c
new file mode 100644
index 000000000000..06b73ee02c49
--- /dev/null
+++ b/tools/perf/util/debugfs.c
@@ -0,0 +1,241 @@
1#include "util.h"
2#include "debugfs.h"
3#include "cache.h"
4
5static int debugfs_premounted;
6static char debugfs_mountpoint[MAX_PATH+1];
7
8static const char *debugfs_known_mountpoints[] = {
9 "/sys/kernel/debug/",
10 "/debug/",
11 0,
12};
13
14/* use this to force a umount */
15void debugfs_force_cleanup(void)
16{
17 debugfs_find_mountpoint();
18 debugfs_premounted = 0;
19 debugfs_umount();
20}
21
22/* construct a full path to a debugfs element */
23int debugfs_make_path(const char *element, char *buffer, int size)
24{
25 int len;
26
27 if (strlen(debugfs_mountpoint) == 0) {
28 buffer[0] = '\0';
29 return -1;
30 }
31
32 len = strlen(debugfs_mountpoint) + strlen(element) + 1;
33 if (len >= size)
34 return len+1;
35
36 snprintf(buffer, size-1, "%s/%s", debugfs_mountpoint, element);
37 return 0;
38}
39
40static int debugfs_found;
41
42/* find the path to the mounted debugfs */
43const char *debugfs_find_mountpoint(void)
44{
45 const char **ptr;
46 char type[100];
47 FILE *fp;
48
49 if (debugfs_found)
50 return (const char *) debugfs_mountpoint;
51
52 ptr = debugfs_known_mountpoints;
53 while (*ptr) {
54 if (debugfs_valid_mountpoint(*ptr) == 0) {
55 debugfs_found = 1;
56 strcpy(debugfs_mountpoint, *ptr);
57 return debugfs_mountpoint;
58 }
59 ptr++;
60 }
61
62 /* give up and parse /proc/mounts */
63 fp = fopen("/proc/mounts", "r");
64 if (fp == NULL)
65 die("Can't open /proc/mounts for read");
66
67 while (fscanf(fp, "%*s %"
68 STR(MAX_PATH)
69 "s %99s %*s %*d %*d\n",
70 debugfs_mountpoint, type) == 2) {
71 if (strcmp(type, "debugfs") == 0)
72 break;
73 }
74 fclose(fp);
75
76 if (strcmp(type, "debugfs") != 0)
77 return NULL;
78
79 debugfs_found = 1;
80
81 return debugfs_mountpoint;
82}
83
84/* verify that a mountpoint is actually a debugfs instance */
85
86int debugfs_valid_mountpoint(const char *debugfs)
87{
88 struct statfs st_fs;
89
90 if (statfs(debugfs, &st_fs) < 0)
91 return -ENOENT;
92 else if (st_fs.f_type != (long) DEBUGFS_MAGIC)
93 return -ENOENT;
94
95 return 0;
96}
97
98
99int debugfs_valid_entry(const char *path)
100{
101 struct stat st;
102
103 if (stat(path, &st))
104 return -errno;
105
106 return 0;
107}
108
109/* mount the debugfs somewhere */
110
111int debugfs_mount(const char *mountpoint)
112{
113 char mountcmd[128];
114
115 /* see if it's already mounted */
116 if (debugfs_find_mountpoint()) {
117 debugfs_premounted = 1;
118 return 0;
119 }
120
121 /* if not mounted and no argument */
122 if (mountpoint == NULL) {
123 /* see if environment variable set */
124 mountpoint = getenv(PERF_DEBUGFS_ENVIRONMENT);
125 /* if no environment variable, use default */
126 if (mountpoint == NULL)
127 mountpoint = "/sys/kernel/debug";
128 }
129
130 /* save the mountpoint */
131 strncpy(debugfs_mountpoint, mountpoint, sizeof(debugfs_mountpoint));
132
133 /* mount it */
134 snprintf(mountcmd, sizeof(mountcmd),
135 "/bin/mount -t debugfs debugfs %s", mountpoint);
136 return system(mountcmd);
137}
138
139/* umount the debugfs */
140
141int debugfs_umount(void)
142{
143 char umountcmd[128];
144 int ret;
145
146 /* if it was already mounted, leave it */
147 if (debugfs_premounted)
148 return 0;
149
150 /* make sure it's a valid mount point */
151 ret = debugfs_valid_mountpoint(debugfs_mountpoint);
152 if (ret)
153 return ret;
154
155 snprintf(umountcmd, sizeof(umountcmd),
156 "/bin/umount %s", debugfs_mountpoint);
157 return system(umountcmd);
158}
159
160int debugfs_write(const char *entry, const char *value)
161{
162 char path[MAX_PATH+1];
163 int ret, count;
164 int fd;
165
166 /* construct the path */
167 snprintf(path, sizeof(path), "%s/%s", debugfs_mountpoint, entry);
168
169 /* verify that it exists */
170 ret = debugfs_valid_entry(path);
171 if (ret)
172 return ret;
173
174 /* get how many chars we're going to write */
175 count = strlen(value);
176
177 /* open the debugfs entry */
178 fd = open(path, O_RDWR);
179 if (fd < 0)
180 return -errno;
181
182 while (count > 0) {
183 /* write it */
184 ret = write(fd, value, count);
185 if (ret <= 0) {
186 if (ret == EAGAIN)
187 continue;
188 close(fd);
189 return -errno;
190 }
191 count -= ret;
192 }
193
194 /* close it */
195 close(fd);
196
197 /* return success */
198 return 0;
199}
200
201/*
202 * read a debugfs entry
203 * returns the number of chars read or a negative errno
204 */
205int debugfs_read(const char *entry, char *buffer, size_t size)
206{
207 char path[MAX_PATH+1];
208 int ret;
209 int fd;
210
211 /* construct the path */
212 snprintf(path, sizeof(path), "%s/%s", debugfs_mountpoint, entry);
213
214 /* verify that it exists */
215 ret = debugfs_valid_entry(path);
216 if (ret)
217 return ret;
218
219 /* open the debugfs entry */
220 fd = open(path, O_RDONLY);
221 if (fd < 0)
222 return -errno;
223
224 do {
225 /* read it */
226 ret = read(fd, buffer, size);
227 if (ret == 0) {
228 close(fd);
229 return EOF;
230 }
231 } while (ret < 0 && errno == EAGAIN);
232
233 /* close it */
234 close(fd);
235
236 /* make *sure* there's a null character at the end */
237 buffer[ret] = '\0';
238
239 /* return the number of chars read */
240 return ret;
241}
diff --git a/tools/perf/util/debugfs.h b/tools/perf/util/debugfs.h
new file mode 100644
index 000000000000..3cd14f9ae784
--- /dev/null
+++ b/tools/perf/util/debugfs.h
@@ -0,0 +1,25 @@
1#ifndef __DEBUGFS_H__
2#define __DEBUGFS_H__
3
4#include <sys/mount.h>
5
6#ifndef MAX_PATH
7# define MAX_PATH 256
8#endif
9
10#ifndef STR
11# define _STR(x) #x
12# define STR(x) _STR(x)
13#endif
14
15extern const char *debugfs_find_mountpoint(void);
16extern int debugfs_valid_mountpoint(const char *debugfs);
17extern int debugfs_valid_entry(const char *path);
18extern int debugfs_mount(const char *mountpoint);
19extern int debugfs_umount(void);
20extern int debugfs_write(const char *entry, const char *value);
21extern int debugfs_read(const char *entry, char *buffer, size_t size);
22extern void debugfs_force_cleanup(void);
23extern int debugfs_make_path(const char *element, char *buffer, int size);
24
25#endif /* __DEBUGFS_H__ */
diff --git a/tools/perf/util/event.c b/tools/perf/util/event.c
new file mode 100644
index 000000000000..414b89d1bde9
--- /dev/null
+++ b/tools/perf/util/event.c
@@ -0,0 +1,312 @@
1#include <linux/types.h>
2#include "event.h"
3#include "debug.h"
4#include "string.h"
5#include "thread.h"
6
7static pid_t event__synthesize_comm(pid_t pid, int full,
8 int (*process)(event_t *event))
9{
10 event_t ev;
11 char filename[PATH_MAX];
12 char bf[BUFSIZ];
13 FILE *fp;
14 size_t size = 0;
15 DIR *tasks;
16 struct dirent dirent, *next;
17 pid_t tgid = 0;
18
19 snprintf(filename, sizeof(filename), "/proc/%d/status", pid);
20
21 fp = fopen(filename, "r");
22 if (fp == NULL) {
23out_race:
24 /*
25 * We raced with a task exiting - just return:
26 */
27 pr_debug("couldn't open %s\n", filename);
28 return 0;
29 }
30
31 memset(&ev.comm, 0, sizeof(ev.comm));
32 while (!ev.comm.comm[0] || !ev.comm.pid) {
33 if (fgets(bf, sizeof(bf), fp) == NULL)
34 goto out_failure;
35
36 if (memcmp(bf, "Name:", 5) == 0) {
37 char *name = bf + 5;
38 while (*name && isspace(*name))
39 ++name;
40 size = strlen(name) - 1;
41 memcpy(ev.comm.comm, name, size++);
42 } else if (memcmp(bf, "Tgid:", 5) == 0) {
43 char *tgids = bf + 5;
44 while (*tgids && isspace(*tgids))
45 ++tgids;
46 tgid = ev.comm.pid = atoi(tgids);
47 }
48 }
49
50 ev.comm.header.type = PERF_RECORD_COMM;
51 size = ALIGN(size, sizeof(u64));
52 ev.comm.header.size = sizeof(ev.comm) - (sizeof(ev.comm.comm) - size);
53
54 if (!full) {
55 ev.comm.tid = pid;
56
57 process(&ev);
58 goto out_fclose;
59 }
60
61 snprintf(filename, sizeof(filename), "/proc/%d/task", pid);
62
63 tasks = opendir(filename);
64 if (tasks == NULL)
65 goto out_race;
66
67 while (!readdir_r(tasks, &dirent, &next) && next) {
68 char *end;
69 pid = strtol(dirent.d_name, &end, 10);
70 if (*end)
71 continue;
72
73 ev.comm.tid = pid;
74
75 process(&ev);
76 }
77 closedir(tasks);
78
79out_fclose:
80 fclose(fp);
81 return tgid;
82
83out_failure:
84 pr_warning("couldn't get COMM and pgid, malformed %s\n", filename);
85 return -1;
86}
87
88static int event__synthesize_mmap_events(pid_t pid, pid_t tgid,
89 int (*process)(event_t *event))
90{
91 char filename[PATH_MAX];
92 FILE *fp;
93
94 snprintf(filename, sizeof(filename), "/proc/%d/maps", pid);
95
96 fp = fopen(filename, "r");
97 if (fp == NULL) {
98 /*
99 * We raced with a task exiting - just return:
100 */
101 pr_debug("couldn't open %s\n", filename);
102 return -1;
103 }
104
105 while (1) {
106 char bf[BUFSIZ], *pbf = bf;
107 event_t ev = {
108 .header = { .type = PERF_RECORD_MMAP },
109 };
110 int n;
111 size_t size;
112 if (fgets(bf, sizeof(bf), fp) == NULL)
113 break;
114
115 /* 00400000-0040c000 r-xp 00000000 fd:01 41038 /bin/cat */
116 n = hex2u64(pbf, &ev.mmap.start);
117 if (n < 0)
118 continue;
119 pbf += n + 1;
120 n = hex2u64(pbf, &ev.mmap.len);
121 if (n < 0)
122 continue;
123 pbf += n + 3;
124 if (*pbf == 'x') { /* vm_exec */
125 char *execname = strchr(bf, '/');
126
127 /* Catch VDSO */
128 if (execname == NULL)
129 execname = strstr(bf, "[vdso]");
130
131 if (execname == NULL)
132 continue;
133
134 size = strlen(execname);
135 execname[size - 1] = '\0'; /* Remove \n */
136 memcpy(ev.mmap.filename, execname, size);
137 size = ALIGN(size, sizeof(u64));
138 ev.mmap.len -= ev.mmap.start;
139 ev.mmap.header.size = (sizeof(ev.mmap) -
140 (sizeof(ev.mmap.filename) - size));
141 ev.mmap.pid = tgid;
142 ev.mmap.tid = pid;
143
144 process(&ev);
145 }
146 }
147
148 fclose(fp);
149 return 0;
150}
151
152int event__synthesize_thread(pid_t pid, int (*process)(event_t *event))
153{
154 pid_t tgid = event__synthesize_comm(pid, 1, process);
155 if (tgid == -1)
156 return -1;
157 return event__synthesize_mmap_events(pid, tgid, process);
158}
159
160void event__synthesize_threads(int (*process)(event_t *event))
161{
162 DIR *proc;
163 struct dirent dirent, *next;
164
165 proc = opendir("/proc");
166
167 while (!readdir_r(proc, &dirent, &next) && next) {
168 char *end;
169 pid_t pid = strtol(dirent.d_name, &end, 10);
170
171 if (*end) /* only interested in proper numerical dirents */
172 continue;
173
174 event__synthesize_thread(pid, process);
175 }
176
177 closedir(proc);
178}
179
180char *event__cwd;
181int event__cwdlen;
182
183struct events_stats event__stats;
184
185int event__process_comm(event_t *self)
186{
187 struct thread *thread = threads__findnew(self->comm.pid);
188
189 dump_printf(": %s:%d\n", self->comm.comm, self->comm.pid);
190
191 if (thread == NULL || thread__set_comm(thread, self->comm.comm)) {
192 dump_printf("problem processing PERF_RECORD_COMM, skipping event.\n");
193 return -1;
194 }
195
196 return 0;
197}
198
199int event__process_lost(event_t *self)
200{
201 dump_printf(": id:%Ld: lost:%Ld\n", self->lost.id, self->lost.lost);
202 event__stats.lost += self->lost.lost;
203 return 0;
204}
205
206int event__process_mmap(event_t *self)
207{
208 struct thread *thread = threads__findnew(self->mmap.pid);
209 struct map *map = map__new(&self->mmap, MAP__FUNCTION,
210 event__cwd, event__cwdlen);
211
212 dump_printf(" %d/%d: [%p(%p) @ %p]: %s\n",
213 self->mmap.pid, self->mmap.tid,
214 (void *)(long)self->mmap.start,
215 (void *)(long)self->mmap.len,
216 (void *)(long)self->mmap.pgoff,
217 self->mmap.filename);
218
219 if (thread == NULL || map == NULL)
220 dump_printf("problem processing PERF_RECORD_MMAP, skipping event.\n");
221 else
222 thread__insert_map(thread, map);
223
224 return 0;
225}
226
227int event__process_task(event_t *self)
228{
229 struct thread *thread = threads__findnew(self->fork.pid);
230 struct thread *parent = threads__findnew(self->fork.ppid);
231
232 dump_printf("(%d:%d):(%d:%d)\n", self->fork.pid, self->fork.tid,
233 self->fork.ppid, self->fork.ptid);
234 /*
235 * A thread clone will have the same PID for both parent and child.
236 */
237 if (thread == parent)
238 return 0;
239
240 if (self->header.type == PERF_RECORD_EXIT)
241 return 0;
242
243 if (thread == NULL || parent == NULL ||
244 thread__fork(thread, parent) < 0) {
245 dump_printf("problem processing PERF_RECORD_FORK, skipping event.\n");
246 return -1;
247 }
248
249 return 0;
250}
251
252void thread__find_addr_location(struct thread *self, u8 cpumode,
253 enum map_type type, u64 addr,
254 struct addr_location *al,
255 symbol_filter_t filter)
256{
257 struct thread *thread = al->thread = self;
258
259 al->addr = addr;
260
261 if (cpumode & PERF_RECORD_MISC_KERNEL) {
262 al->level = 'k';
263 thread = kthread;
264 } else if (cpumode & PERF_RECORD_MISC_USER)
265 al->level = '.';
266 else {
267 al->level = 'H';
268 al->map = NULL;
269 al->sym = NULL;
270 return;
271 }
272try_again:
273 al->map = thread__find_map(thread, type, al->addr);
274 if (al->map == NULL) {
275 /*
276 * If this is outside of all known maps, and is a negative
277 * address, try to look it up in the kernel dso, as it might be
278 * a vsyscall or vdso (which executes in user-mode).
279 *
280 * XXX This is nasty, we should have a symbol list in the
281 * "[vdso]" dso, but for now lets use the old trick of looking
282 * in the whole kernel symbol list.
283 */
284 if ((long long)al->addr < 0 && thread != kthread) {
285 thread = kthread;
286 goto try_again;
287 }
288 al->sym = NULL;
289 } else {
290 al->addr = al->map->map_ip(al->map, al->addr);
291 al->sym = map__find_symbol(al->map, al->addr, filter);
292 }
293}
294
295int event__preprocess_sample(const event_t *self, struct addr_location *al,
296 symbol_filter_t filter)
297{
298 u8 cpumode = self->header.misc & PERF_RECORD_MISC_CPUMODE_MASK;
299 struct thread *thread = threads__findnew(self->ip.pid);
300
301 if (thread == NULL)
302 return -1;
303
304 dump_printf(" ... thread: %s:%d\n", thread->comm, thread->pid);
305
306 thread__find_addr_location(thread, cpumode, MAP__FUNCTION,
307 self->ip.ip, al, filter);
308 dump_printf(" ...... dso: %s\n",
309 al->map ? al->map->dso->long_name :
310 al->level == 'H' ? "[hypervisor]" : "<not found>");
311 return 0;
312}
diff --git a/tools/perf/util/event.h b/tools/perf/util/event.h
index 2c9c26d6ded0..a4cc8105cf67 100644
--- a/tools/perf/util/event.h
+++ b/tools/perf/util/event.h
@@ -1,14 +1,10 @@
1#ifndef __PERF_RECORD_H 1#ifndef __PERF_RECORD_H
2#define __PERF_RECORD_H 2#define __PERF_RECORD_H
3
3#include "../perf.h" 4#include "../perf.h"
4#include "util.h" 5#include "util.h"
5#include <linux/list.h> 6#include <linux/list.h>
6 7#include <linux/rbtree.h>
7enum {
8 SHOW_KERNEL = 1,
9 SHOW_USER = 2,
10 SHOW_HV = 4,
11};
12 8
13/* 9/*
14 * PERF_SAMPLE_IP | PERF_SAMPLE_TID | * 10 * PERF_SAMPLE_IP | PERF_SAMPLE_TID | *
@@ -65,6 +61,13 @@ struct sample_event{
65 u64 array[]; 61 u64 array[];
66}; 62};
67 63
64#define BUILD_ID_SIZE 20
65
66struct build_id_event {
67 struct perf_event_header header;
68 u8 build_id[ALIGN(BUILD_ID_SIZE, sizeof(u64))];
69 char filename[];
70};
68 71
69typedef union event_union { 72typedef union event_union {
70 struct perf_event_header header; 73 struct perf_event_header header;
@@ -77,12 +80,30 @@ typedef union event_union {
77 struct sample_event sample; 80 struct sample_event sample;
78} event_t; 81} event_t;
79 82
83struct events_stats {
84 unsigned long total;
85 unsigned long lost;
86};
87
88void event__print_totals(void);
89
90enum map_type {
91 MAP__FUNCTION = 0,
92
93 MAP__NR_TYPES,
94};
95
80struct map { 96struct map {
81 struct list_head node; 97 union {
98 struct rb_node rb_node;
99 struct list_head node;
100 };
82 u64 start; 101 u64 start;
83 u64 end; 102 u64 end;
103 enum map_type type;
84 u64 pgoff; 104 u64 pgoff;
85 u64 (*map_ip)(struct map *, u64); 105 u64 (*map_ip)(struct map *, u64);
106 u64 (*unmap_ip)(struct map *, u64);
86 struct dso *dso; 107 struct dso *dso;
87}; 108};
88 109
@@ -91,14 +112,48 @@ static inline u64 map__map_ip(struct map *map, u64 ip)
91 return ip - map->start + map->pgoff; 112 return ip - map->start + map->pgoff;
92} 113}
93 114
94static inline u64 vdso__map_ip(struct map *map __used, u64 ip) 115static inline u64 map__unmap_ip(struct map *map, u64 ip)
116{
117 return ip + map->start - map->pgoff;
118}
119
120static inline u64 identity__map_ip(struct map *map __used, u64 ip)
95{ 121{
96 return ip; 122 return ip;
97} 123}
98 124
99struct map *map__new(struct mmap_event *event, char *cwd, int cwdlen); 125struct symbol;
126
127typedef int (*symbol_filter_t)(struct map *map, struct symbol *sym);
128
129void map__init(struct map *self, enum map_type type,
130 u64 start, u64 end, u64 pgoff, struct dso *dso);
131struct map *map__new(struct mmap_event *event, enum map_type,
132 char *cwd, int cwdlen);
133void map__delete(struct map *self);
100struct map *map__clone(struct map *self); 134struct map *map__clone(struct map *self);
101int map__overlap(struct map *l, struct map *r); 135int map__overlap(struct map *l, struct map *r);
102size_t map__fprintf(struct map *self, FILE *fp); 136size_t map__fprintf(struct map *self, FILE *fp);
137struct symbol *map__find_symbol(struct map *self, u64 addr,
138 symbol_filter_t filter);
139void map__fixup_start(struct map *self);
140void map__fixup_end(struct map *self);
141
142int event__synthesize_thread(pid_t pid, int (*process)(event_t *event));
143void event__synthesize_threads(int (*process)(event_t *event));
144
145extern char *event__cwd;
146extern int event__cwdlen;
147extern struct events_stats event__stats;
148extern unsigned long event__total[PERF_RECORD_MAX];
149
150int event__process_comm(event_t *self);
151int event__process_lost(event_t *self);
152int event__process_mmap(event_t *self);
153int event__process_task(event_t *self);
154
155struct addr_location;
156int event__preprocess_sample(const event_t *self, struct addr_location *al,
157 symbol_filter_t filter);
103 158
104#endif 159#endif /* __PERF_RECORD_H */
diff --git a/tools/perf/util/exec_cmd.h b/tools/perf/util/exec_cmd.h
index effe25eb1545..31647ac92ed1 100644
--- a/tools/perf/util/exec_cmd.h
+++ b/tools/perf/util/exec_cmd.h
@@ -1,5 +1,5 @@
1#ifndef PERF_EXEC_CMD_H 1#ifndef __PERF_EXEC_CMD_H
2#define PERF_EXEC_CMD_H 2#define __PERF_EXEC_CMD_H
3 3
4extern void perf_set_argv_exec_path(const char *exec_path); 4extern void perf_set_argv_exec_path(const char *exec_path);
5extern const char *perf_extract_argv0_path(const char *path); 5extern const char *perf_extract_argv0_path(const char *path);
@@ -10,4 +10,4 @@ extern int execv_perf_cmd(const char **argv); /* NULL terminated */
10extern int execl_perf_cmd(const char *cmd, ...); 10extern int execl_perf_cmd(const char *cmd, ...);
11extern const char *system_path(const char *path); 11extern const char *system_path(const char *path);
12 12
13#endif /* PERF_EXEC_CMD_H */ 13#endif /* __PERF_EXEC_CMD_H */
diff --git a/tools/perf/util/header.c b/tools/perf/util/header.c
index e306857b2c2b..4805e6dfd23c 100644
--- a/tools/perf/util/header.c
+++ b/tools/perf/util/header.c
@@ -2,9 +2,15 @@
2#include <unistd.h> 2#include <unistd.h>
3#include <stdio.h> 3#include <stdio.h>
4#include <stdlib.h> 4#include <stdlib.h>
5#include <linux/list.h>
5 6
6#include "util.h" 7#include "util.h"
7#include "header.h" 8#include "header.h"
9#include "../perf.h"
10#include "trace-event.h"
11#include "symbol.h"
12#include "data_map.h"
13#include "debug.h"
8 14
9/* 15/*
10 * Create new perf.data header attribute: 16 * Create new perf.data header attribute:
@@ -13,32 +19,43 @@ struct perf_header_attr *perf_header_attr__new(struct perf_event_attr *attr)
13{ 19{
14 struct perf_header_attr *self = malloc(sizeof(*self)); 20 struct perf_header_attr *self = malloc(sizeof(*self));
15 21
16 if (!self) 22 if (self != NULL) {
17 die("nomem"); 23 self->attr = *attr;
18 24 self->ids = 0;
19 self->attr = *attr; 25 self->size = 1;
20 self->ids = 0; 26 self->id = malloc(sizeof(u64));
21 self->size = 1; 27 if (self->id == NULL) {
22 self->id = malloc(sizeof(u64)); 28 free(self);
23 29 self = NULL;
24 if (!self->id) 30 }
25 die("nomem"); 31 }
26 32
27 return self; 33 return self;
28} 34}
29 35
30void perf_header_attr__add_id(struct perf_header_attr *self, u64 id) 36void perf_header_attr__delete(struct perf_header_attr *self)
37{
38 free(self->id);
39 free(self);
40}
41
42int perf_header_attr__add_id(struct perf_header_attr *self, u64 id)
31{ 43{
32 int pos = self->ids; 44 int pos = self->ids;
33 45
34 self->ids++; 46 self->ids++;
35 if (self->ids > self->size) { 47 if (self->ids > self->size) {
36 self->size *= 2; 48 int nsize = self->size * 2;
37 self->id = realloc(self->id, self->size * sizeof(u64)); 49 u64 *nid = realloc(self->id, nsize * sizeof(u64));
38 if (!self->id) 50
39 die("nomem"); 51 if (nid == NULL)
52 return -1;
53
54 self->size = nsize;
55 self->id = nid;
40 } 56 }
41 self->id[pos] = id; 57 self->id[pos] = id;
58 return 0;
42} 59}
43 60
44/* 61/*
@@ -46,42 +63,52 @@ void perf_header_attr__add_id(struct perf_header_attr *self, u64 id)
46 */ 63 */
47struct perf_header *perf_header__new(void) 64struct perf_header *perf_header__new(void)
48{ 65{
49 struct perf_header *self = malloc(sizeof(*self)); 66 struct perf_header *self = zalloc(sizeof(*self));
50 67
51 if (!self) 68 if (self != NULL) {
52 die("nomem"); 69 self->size = 1;
70 self->attr = malloc(sizeof(void *));
53 71
54 self->frozen = 0; 72 if (self->attr == NULL) {
73 free(self);
74 self = NULL;
75 }
76 }
55 77
56 self->attrs = 0; 78 return self;
57 self->size = 1; 79}
58 self->attr = malloc(sizeof(void *));
59 80
60 if (!self->attr) 81void perf_header__delete(struct perf_header *self)
61 die("nomem"); 82{
83 int i;
62 84
63 self->data_offset = 0; 85 for (i = 0; i < self->attrs; ++i)
64 self->data_size = 0; 86 perf_header_attr__delete(self->attr[i]);
65 87
66 return self; 88 free(self->attr);
89 free(self);
67} 90}
68 91
69void perf_header__add_attr(struct perf_header *self, 92int perf_header__add_attr(struct perf_header *self,
70 struct perf_header_attr *attr) 93 struct perf_header_attr *attr)
71{ 94{
72 int pos = self->attrs;
73
74 if (self->frozen) 95 if (self->frozen)
75 die("frozen"); 96 return -1;
76 97
77 self->attrs++; 98 if (self->attrs == self->size) {
78 if (self->attrs > self->size) { 99 int nsize = self->size * 2;
79 self->size *= 2; 100 struct perf_header_attr **nattr;
80 self->attr = realloc(self->attr, self->size * sizeof(void *)); 101
81 if (!self->attr) 102 nattr = realloc(self->attr, nsize * sizeof(void *));
82 die("nomem"); 103 if (nattr == NULL)
104 return -1;
105
106 self->size = nsize;
107 self->attr = nattr;
83 } 108 }
84 self->attr[pos] = attr; 109
110 self->attr[self->attrs++] = attr;
111 return 0;
85} 112}
86 113
87#define MAX_EVENT_NAME 64 114#define MAX_EVENT_NAME 64
@@ -97,7 +124,7 @@ static struct perf_trace_event_type *events;
97void perf_header__push_event(u64 id, const char *name) 124void perf_header__push_event(u64 id, const char *name)
98{ 125{
99 if (strlen(name) > MAX_EVENT_NAME) 126 if (strlen(name) > MAX_EVENT_NAME)
100 printf("Event %s will be truncated\n", name); 127 pr_warning("Event %s will be truncated\n", name);
101 128
102 if (!events) { 129 if (!events) {
103 events = malloc(sizeof(struct perf_trace_event_type)); 130 events = malloc(sizeof(struct perf_trace_event_type));
@@ -128,44 +155,137 @@ static const char *__perf_magic = "PERFFILE";
128 155
129#define PERF_MAGIC (*(u64 *)__perf_magic) 156#define PERF_MAGIC (*(u64 *)__perf_magic)
130 157
131struct perf_file_section {
132 u64 offset;
133 u64 size;
134};
135
136struct perf_file_attr { 158struct perf_file_attr {
137 struct perf_event_attr attr; 159 struct perf_event_attr attr;
138 struct perf_file_section ids; 160 struct perf_file_section ids;
139}; 161};
140 162
141struct perf_file_header { 163void perf_header__set_feat(struct perf_header *self, int feat)
142 u64 magic; 164{
143 u64 size; 165 set_bit(feat, self->adds_features);
144 u64 attr_size; 166}
145 struct perf_file_section attrs;
146 struct perf_file_section data;
147 struct perf_file_section event_types;
148};
149 167
150static void do_write(int fd, void *buf, size_t size) 168bool perf_header__has_feat(const struct perf_header *self, int feat)
169{
170 return test_bit(feat, self->adds_features);
171}
172
173static int do_write(int fd, const void *buf, size_t size)
151{ 174{
152 while (size) { 175 while (size) {
153 int ret = write(fd, buf, size); 176 int ret = write(fd, buf, size);
154 177
155 if (ret < 0) 178 if (ret < 0)
156 die("failed to write"); 179 return -errno;
157 180
158 size -= ret; 181 size -= ret;
159 buf += ret; 182 buf += ret;
160 } 183 }
184
185 return 0;
186}
187
188static int __dsos__write_buildid_table(struct list_head *head, int fd)
189{
190 struct dso *pos;
191
192 list_for_each_entry(pos, head, node) {
193 int err;
194 struct build_id_event b;
195 size_t len;
196
197 if (!pos->has_build_id)
198 continue;
199 len = pos->long_name_len + 1;
200 len = ALIGN(len, 64);
201 memset(&b, 0, sizeof(b));
202 memcpy(&b.build_id, pos->build_id, sizeof(pos->build_id));
203 b.header.size = sizeof(b) + len;
204 err = do_write(fd, &b, sizeof(b));
205 if (err < 0)
206 return err;
207 err = do_write(fd, pos->long_name, len);
208 if (err < 0)
209 return err;
210 }
211
212 return 0;
161} 213}
162 214
163void perf_header__write(struct perf_header *self, int fd) 215static int dsos__write_buildid_table(int fd)
216{
217 int err = __dsos__write_buildid_table(&dsos__kernel, fd);
218 if (err == 0)
219 err = __dsos__write_buildid_table(&dsos__user, fd);
220 return err;
221}
222
223static int perf_header__adds_write(struct perf_header *self, int fd)
224{
225 int nr_sections;
226 struct perf_file_section *feat_sec;
227 int sec_size;
228 u64 sec_start;
229 int idx = 0, err;
230
231 if (dsos__read_build_ids())
232 perf_header__set_feat(self, HEADER_BUILD_ID);
233
234 nr_sections = bitmap_weight(self->adds_features, HEADER_FEAT_BITS);
235 if (!nr_sections)
236 return 0;
237
238 feat_sec = calloc(sizeof(*feat_sec), nr_sections);
239 if (feat_sec == NULL)
240 return -ENOMEM;
241
242 sec_size = sizeof(*feat_sec) * nr_sections;
243
244 sec_start = self->data_offset + self->data_size;
245 lseek(fd, sec_start + sec_size, SEEK_SET);
246
247 if (perf_header__has_feat(self, HEADER_TRACE_INFO)) {
248 struct perf_file_section *trace_sec;
249
250 trace_sec = &feat_sec[idx++];
251
252 /* Write trace info */
253 trace_sec->offset = lseek(fd, 0, SEEK_CUR);
254 read_tracing_data(fd, attrs, nr_counters);
255 trace_sec->size = lseek(fd, 0, SEEK_CUR) - trace_sec->offset;
256 }
257
258
259 if (perf_header__has_feat(self, HEADER_BUILD_ID)) {
260 struct perf_file_section *buildid_sec;
261
262 buildid_sec = &feat_sec[idx++];
263
264 /* Write build-ids */
265 buildid_sec->offset = lseek(fd, 0, SEEK_CUR);
266 err = dsos__write_buildid_table(fd);
267 if (err < 0) {
268 pr_debug("failed to write buildid table\n");
269 goto out_free;
270 }
271 buildid_sec->size = lseek(fd, 0, SEEK_CUR) - buildid_sec->offset;
272 }
273
274 lseek(fd, sec_start, SEEK_SET);
275 err = do_write(fd, feat_sec, sec_size);
276 if (err < 0)
277 pr_debug("failed to write feature section\n");
278out_free:
279 free(feat_sec);
280 return err;
281}
282
283int perf_header__write(struct perf_header *self, int fd, bool at_exit)
164{ 284{
165 struct perf_file_header f_header; 285 struct perf_file_header f_header;
166 struct perf_file_attr f_attr; 286 struct perf_file_attr f_attr;
167 struct perf_header_attr *attr; 287 struct perf_header_attr *attr;
168 int i; 288 int i, err;
169 289
170 lseek(fd, sizeof(f_header), SEEK_SET); 290 lseek(fd, sizeof(f_header), SEEK_SET);
171 291
@@ -174,7 +294,11 @@ void perf_header__write(struct perf_header *self, int fd)
174 attr = self->attr[i]; 294 attr = self->attr[i];
175 295
176 attr->id_offset = lseek(fd, 0, SEEK_CUR); 296 attr->id_offset = lseek(fd, 0, SEEK_CUR);
177 do_write(fd, attr->id, attr->ids * sizeof(u64)); 297 err = do_write(fd, attr->id, attr->ids * sizeof(u64));
298 if (err < 0) {
299 pr_debug("failed to write perf header\n");
300 return err;
301 }
178 } 302 }
179 303
180 304
@@ -190,17 +314,31 @@ void perf_header__write(struct perf_header *self, int fd)
190 .size = attr->ids * sizeof(u64), 314 .size = attr->ids * sizeof(u64),
191 } 315 }
192 }; 316 };
193 do_write(fd, &f_attr, sizeof(f_attr)); 317 err = do_write(fd, &f_attr, sizeof(f_attr));
318 if (err < 0) {
319 pr_debug("failed to write perf header attribute\n");
320 return err;
321 }
194 } 322 }
195 323
196 self->event_offset = lseek(fd, 0, SEEK_CUR); 324 self->event_offset = lseek(fd, 0, SEEK_CUR);
197 self->event_size = event_count * sizeof(struct perf_trace_event_type); 325 self->event_size = event_count * sizeof(struct perf_trace_event_type);
198 if (events) 326 if (events) {
199 do_write(fd, events, self->event_size); 327 err = do_write(fd, events, self->event_size);
200 328 if (err < 0) {
329 pr_debug("failed to write perf header events\n");
330 return err;
331 }
332 }
201 333
202 self->data_offset = lseek(fd, 0, SEEK_CUR); 334 self->data_offset = lseek(fd, 0, SEEK_CUR);
203 335
336 if (at_exit) {
337 err = perf_header__adds_write(self, fd);
338 if (err < 0)
339 return err;
340 }
341
204 f_header = (struct perf_file_header){ 342 f_header = (struct perf_file_header){
205 .magic = PERF_MAGIC, 343 .magic = PERF_MAGIC,
206 .size = sizeof(f_header), 344 .size = sizeof(f_header),
@@ -219,11 +357,18 @@ void perf_header__write(struct perf_header *self, int fd)
219 }, 357 },
220 }; 358 };
221 359
360 memcpy(&f_header.adds_features, &self->adds_features, sizeof(self->adds_features));
361
222 lseek(fd, 0, SEEK_SET); 362 lseek(fd, 0, SEEK_SET);
223 do_write(fd, &f_header, sizeof(f_header)); 363 err = do_write(fd, &f_header, sizeof(f_header));
364 if (err < 0) {
365 pr_debug("failed to write perf header\n");
366 return err;
367 }
224 lseek(fd, self->data_offset + self->data_size, SEEK_SET); 368 lseek(fd, self->data_offset + self->data_size, SEEK_SET);
225 369
226 self->frozen = 1; 370 self->frozen = 1;
371 return 0;
227} 372}
228 373
229static void do_read(int fd, void *buf, size_t size) 374static void do_read(int fd, void *buf, size_t size)
@@ -241,22 +386,109 @@ static void do_read(int fd, void *buf, size_t size)
241 } 386 }
242} 387}
243 388
244struct perf_header *perf_header__read(int fd) 389int perf_header__process_sections(struct perf_header *self, int fd,
390 int (*process)(struct perf_file_section *self,
391 int feat, int fd))
392{
393 struct perf_file_section *feat_sec;
394 int nr_sections;
395 int sec_size;
396 int idx = 0;
397 int err = 0, feat = 1;
398
399 nr_sections = bitmap_weight(self->adds_features, HEADER_FEAT_BITS);
400 if (!nr_sections)
401 return 0;
402
403 feat_sec = calloc(sizeof(*feat_sec), nr_sections);
404 if (!feat_sec)
405 return -1;
406
407 sec_size = sizeof(*feat_sec) * nr_sections;
408
409 lseek(fd, self->data_offset + self->data_size, SEEK_SET);
410
411 do_read(fd, feat_sec, sec_size);
412
413 while (idx < nr_sections && feat < HEADER_LAST_FEATURE) {
414 if (perf_header__has_feat(self, feat)) {
415 struct perf_file_section *sec = &feat_sec[idx++];
416
417 err = process(sec, feat, fd);
418 if (err < 0)
419 break;
420 }
421 ++feat;
422 }
423
424 free(feat_sec);
425 return err;
426};
427
428int perf_file_header__read(struct perf_file_header *self,
429 struct perf_header *ph, int fd)
430{
431 lseek(fd, 0, SEEK_SET);
432 do_read(fd, self, sizeof(*self));
433
434 if (self->magic != PERF_MAGIC ||
435 self->attr_size != sizeof(struct perf_file_attr))
436 return -1;
437
438 if (self->size != sizeof(*self)) {
439 /* Support the previous format */
440 if (self->size == offsetof(typeof(*self), adds_features))
441 bitmap_zero(self->adds_features, HEADER_FEAT_BITS);
442 else
443 return -1;
444 }
445
446 memcpy(&ph->adds_features, &self->adds_features,
447 sizeof(self->adds_features));
448
449 ph->event_offset = self->event_types.offset;
450 ph->event_size = self->event_types.size;
451 ph->data_offset = self->data.offset;
452 ph->data_size = self->data.size;
453 return 0;
454}
455
456static int perf_file_section__process(struct perf_file_section *self,
457 int feat, int fd)
458{
459 if (lseek(fd, self->offset, SEEK_SET) < 0) {
460 pr_debug("Failed to lseek to %Ld offset for feature %d, "
461 "continuing...\n", self->offset, feat);
462 return 0;
463 }
464
465 switch (feat) {
466 case HEADER_TRACE_INFO:
467 trace_report(fd);
468 break;
469
470 case HEADER_BUILD_ID:
471 if (perf_header__read_build_ids(fd, self->offset, self->size))
472 pr_debug("Failed to read buildids, continuing...\n");
473 break;
474 default:
475 pr_debug("unknown feature %d, continuing...\n", feat);
476 }
477
478 return 0;
479}
480
481int perf_header__read(struct perf_header *self, int fd)
245{ 482{
246 struct perf_header *self = perf_header__new();
247 struct perf_file_header f_header; 483 struct perf_file_header f_header;
248 struct perf_file_attr f_attr; 484 struct perf_file_attr f_attr;
249 u64 f_id; 485 u64 f_id;
250
251 int nr_attrs, nr_ids, i, j; 486 int nr_attrs, nr_ids, i, j;
252 487
253 lseek(fd, 0, SEEK_SET); 488 if (perf_file_header__read(&f_header, self, fd) < 0) {
254 do_read(fd, &f_header, sizeof(f_header)); 489 pr_debug("incompatible file format\n");
255 490 return -EINVAL;
256 if (f_header.magic != PERF_MAGIC || 491 }
257 f_header.size != sizeof(f_header) ||
258 f_header.attr_size != sizeof(f_attr))
259 die("incompatible file format");
260 492
261 nr_attrs = f_header.attrs.size / sizeof(f_attr); 493 nr_attrs = f_header.attrs.size / sizeof(f_attr);
262 lseek(fd, f_header.attrs.offset, SEEK_SET); 494 lseek(fd, f_header.attrs.offset, SEEK_SET);
@@ -269,6 +501,8 @@ struct perf_header *perf_header__read(int fd)
269 tmp = lseek(fd, 0, SEEK_CUR); 501 tmp = lseek(fd, 0, SEEK_CUR);
270 502
271 attr = perf_header_attr__new(&f_attr.attr); 503 attr = perf_header_attr__new(&f_attr.attr);
504 if (attr == NULL)
505 return -ENOMEM;
272 506
273 nr_ids = f_attr.ids.size / sizeof(u64); 507 nr_ids = f_attr.ids.size / sizeof(u64);
274 lseek(fd, f_attr.ids.offset, SEEK_SET); 508 lseek(fd, f_attr.ids.offset, SEEK_SET);
@@ -276,31 +510,34 @@ struct perf_header *perf_header__read(int fd)
276 for (j = 0; j < nr_ids; j++) { 510 for (j = 0; j < nr_ids; j++) {
277 do_read(fd, &f_id, sizeof(f_id)); 511 do_read(fd, &f_id, sizeof(f_id));
278 512
279 perf_header_attr__add_id(attr, f_id); 513 if (perf_header_attr__add_id(attr, f_id) < 0) {
514 perf_header_attr__delete(attr);
515 return -ENOMEM;
516 }
280 } 517 }
281 perf_header__add_attr(self, attr); 518 if (perf_header__add_attr(self, attr) < 0) {
519 perf_header_attr__delete(attr);
520 return -ENOMEM;
521 }
522
282 lseek(fd, tmp, SEEK_SET); 523 lseek(fd, tmp, SEEK_SET);
283 } 524 }
284 525
285 if (f_header.event_types.size) { 526 if (f_header.event_types.size) {
286 lseek(fd, f_header.event_types.offset, SEEK_SET); 527 lseek(fd, f_header.event_types.offset, SEEK_SET);
287 events = malloc(f_header.event_types.size); 528 events = malloc(f_header.event_types.size);
288 if (!events) 529 if (events == NULL)
289 die("nomem"); 530 return -ENOMEM;
290 do_read(fd, events, f_header.event_types.size); 531 do_read(fd, events, f_header.event_types.size);
291 event_count = f_header.event_types.size / sizeof(struct perf_trace_event_type); 532 event_count = f_header.event_types.size / sizeof(struct perf_trace_event_type);
292 } 533 }
293 self->event_offset = f_header.event_types.offset;
294 self->event_size = f_header.event_types.size;
295 534
296 self->data_offset = f_header.data.offset; 535 perf_header__process_sections(self, fd, perf_file_section__process);
297 self->data_size = f_header.data.size;
298 536
299 lseek(fd, self->data_offset, SEEK_SET); 537 lseek(fd, self->data_offset, SEEK_SET);
300 538
301 self->frozen = 1; 539 self->frozen = 1;
302 540 return 0;
303 return self;
304} 541}
305 542
306u64 perf_header__sample_type(struct perf_header *header) 543u64 perf_header__sample_type(struct perf_header *header)
diff --git a/tools/perf/util/header.h b/tools/perf/util/header.h
index a0761bc7863c..d1dbe2b79c42 100644
--- a/tools/perf/util/header.h
+++ b/tools/perf/util/header.h
@@ -1,10 +1,13 @@
1#ifndef _PERF_HEADER_H 1#ifndef __PERF_HEADER_H
2#define _PERF_HEADER_H 2#define __PERF_HEADER_H
3 3
4#include "../../../include/linux/perf_event.h" 4#include "../../../include/linux/perf_event.h"
5#include <sys/types.h> 5#include <sys/types.h>
6#include <stdbool.h>
6#include "types.h" 7#include "types.h"
7 8
9#include <linux/bitmap.h>
10
8struct perf_header_attr { 11struct perf_header_attr {
9 struct perf_event_attr attr; 12 struct perf_event_attr attr;
10 int ids, size; 13 int ids, size;
@@ -12,36 +15,71 @@ struct perf_header_attr {
12 off_t id_offset; 15 off_t id_offset;
13}; 16};
14 17
18enum {
19 HEADER_TRACE_INFO = 1,
20 HEADER_BUILD_ID,
21 HEADER_LAST_FEATURE,
22};
23
24#define HEADER_FEAT_BITS 256
25
26struct perf_file_section {
27 u64 offset;
28 u64 size;
29};
30
31struct perf_file_header {
32 u64 magic;
33 u64 size;
34 u64 attr_size;
35 struct perf_file_section attrs;
36 struct perf_file_section data;
37 struct perf_file_section event_types;
38 DECLARE_BITMAP(adds_features, HEADER_FEAT_BITS);
39};
40
41struct perf_header;
42
43int perf_file_header__read(struct perf_file_header *self,
44 struct perf_header *ph, int fd);
45
15struct perf_header { 46struct perf_header {
16 int frozen; 47 int frozen;
17 int attrs, size; 48 int attrs, size;
18 struct perf_header_attr **attr; 49 struct perf_header_attr **attr;
19 s64 attr_offset; 50 s64 attr_offset;
20 u64 data_offset; 51 u64 data_offset;
21 u64 data_size; 52 u64 data_size;
22 u64 event_offset; 53 u64 event_offset;
23 u64 event_size; 54 u64 event_size;
55 DECLARE_BITMAP(adds_features, HEADER_FEAT_BITS);
24}; 56};
25 57
26struct perf_header *perf_header__read(int fd); 58struct perf_header *perf_header__new(void);
27void perf_header__write(struct perf_header *self, int fd); 59void perf_header__delete(struct perf_header *self);
28 60
29void perf_header__add_attr(struct perf_header *self, 61int perf_header__read(struct perf_header *self, int fd);
30 struct perf_header_attr *attr); 62int perf_header__write(struct perf_header *self, int fd, bool at_exit);
63
64int perf_header__add_attr(struct perf_header *self,
65 struct perf_header_attr *attr);
31 66
32void perf_header__push_event(u64 id, const char *name); 67void perf_header__push_event(u64 id, const char *name);
33char *perf_header__find_event(u64 id); 68char *perf_header__find_event(u64 id);
34 69
70struct perf_header_attr *perf_header_attr__new(struct perf_event_attr *attr);
71void perf_header_attr__delete(struct perf_header_attr *self);
35 72
36struct perf_header_attr * 73int perf_header_attr__add_id(struct perf_header_attr *self, u64 id);
37perf_header_attr__new(struct perf_event_attr *attr);
38void perf_header_attr__add_id(struct perf_header_attr *self, u64 id);
39 74
40u64 perf_header__sample_type(struct perf_header *header); 75u64 perf_header__sample_type(struct perf_header *header);
41struct perf_event_attr * 76struct perf_event_attr *
42perf_header__find_attr(u64 id, struct perf_header *header); 77perf_header__find_attr(u64 id, struct perf_header *header);
78void perf_header__set_feat(struct perf_header *self, int feat);
79bool perf_header__has_feat(const struct perf_header *self, int feat);
43 80
81int perf_header__process_sections(struct perf_header *self, int fd,
82 int (*process)(struct perf_file_section *self,
83 int feat, int fd));
44 84
45struct perf_header *perf_header__new(void); 85#endif /* __PERF_HEADER_H */
46
47#endif /* _PERF_HEADER_H */
diff --git a/tools/perf/util/help.h b/tools/perf/util/help.h
index 7128783637b4..7f5c6dedd714 100644
--- a/tools/perf/util/help.h
+++ b/tools/perf/util/help.h
@@ -1,5 +1,5 @@
1#ifndef HELP_H 1#ifndef __PERF_HELP_H
2#define HELP_H 2#define __PERF_HELP_H
3 3
4struct cmdnames { 4struct cmdnames {
5 size_t alloc; 5 size_t alloc;
@@ -26,4 +26,4 @@ int is_in_cmdlist(struct cmdnames *c, const char *s);
26void list_commands(const char *title, struct cmdnames *main_cmds, 26void list_commands(const char *title, struct cmdnames *main_cmds,
27 struct cmdnames *other_cmds); 27 struct cmdnames *other_cmds);
28 28
29#endif /* HELP_H */ 29#endif /* __PERF_HELP_H */
diff --git a/tools/perf/util/hist.c b/tools/perf/util/hist.c
new file mode 100644
index 000000000000..0ebf6ee16caa
--- /dev/null
+++ b/tools/perf/util/hist.c
@@ -0,0 +1,202 @@
1#include "hist.h"
2
3struct rb_root hist;
4struct rb_root collapse_hists;
5struct rb_root output_hists;
6int callchain;
7
8struct callchain_param callchain_param = {
9 .mode = CHAIN_GRAPH_REL,
10 .min_percent = 0.5
11};
12
13/*
14 * histogram, sorted on item, collects counts
15 */
16
17struct hist_entry *__hist_entry__add(struct addr_location *al,
18 struct symbol *sym_parent,
19 u64 count, bool *hit)
20{
21 struct rb_node **p = &hist.rb_node;
22 struct rb_node *parent = NULL;
23 struct hist_entry *he;
24 struct hist_entry entry = {
25 .thread = al->thread,
26 .map = al->map,
27 .sym = al->sym,
28 .ip = al->addr,
29 .level = al->level,
30 .count = count,
31 .parent = sym_parent,
32 };
33 int cmp;
34
35 while (*p != NULL) {
36 parent = *p;
37 he = rb_entry(parent, struct hist_entry, rb_node);
38
39 cmp = hist_entry__cmp(&entry, he);
40
41 if (!cmp) {
42 *hit = true;
43 return he;
44 }
45
46 if (cmp < 0)
47 p = &(*p)->rb_left;
48 else
49 p = &(*p)->rb_right;
50 }
51
52 he = malloc(sizeof(*he));
53 if (!he)
54 return NULL;
55 *he = entry;
56 rb_link_node(&he->rb_node, parent, p);
57 rb_insert_color(&he->rb_node, &hist);
58 *hit = false;
59 return he;
60}
61
62int64_t
63hist_entry__cmp(struct hist_entry *left, struct hist_entry *right)
64{
65 struct sort_entry *se;
66 int64_t cmp = 0;
67
68 list_for_each_entry(se, &hist_entry__sort_list, list) {
69 cmp = se->cmp(left, right);
70 if (cmp)
71 break;
72 }
73
74 return cmp;
75}
76
77int64_t
78hist_entry__collapse(struct hist_entry *left, struct hist_entry *right)
79{
80 struct sort_entry *se;
81 int64_t cmp = 0;
82
83 list_for_each_entry(se, &hist_entry__sort_list, list) {
84 int64_t (*f)(struct hist_entry *, struct hist_entry *);
85
86 f = se->collapse ?: se->cmp;
87
88 cmp = f(left, right);
89 if (cmp)
90 break;
91 }
92
93 return cmp;
94}
95
96void hist_entry__free(struct hist_entry *he)
97{
98 free(he);
99}
100
101/*
102 * collapse the histogram
103 */
104
105void collapse__insert_entry(struct hist_entry *he)
106{
107 struct rb_node **p = &collapse_hists.rb_node;
108 struct rb_node *parent = NULL;
109 struct hist_entry *iter;
110 int64_t cmp;
111
112 while (*p != NULL) {
113 parent = *p;
114 iter = rb_entry(parent, struct hist_entry, rb_node);
115
116 cmp = hist_entry__collapse(iter, he);
117
118 if (!cmp) {
119 iter->count += he->count;
120 hist_entry__free(he);
121 return;
122 }
123
124 if (cmp < 0)
125 p = &(*p)->rb_left;
126 else
127 p = &(*p)->rb_right;
128 }
129
130 rb_link_node(&he->rb_node, parent, p);
131 rb_insert_color(&he->rb_node, &collapse_hists);
132}
133
134void collapse__resort(void)
135{
136 struct rb_node *next;
137 struct hist_entry *n;
138
139 if (!sort__need_collapse)
140 return;
141
142 next = rb_first(&hist);
143 while (next) {
144 n = rb_entry(next, struct hist_entry, rb_node);
145 next = rb_next(&n->rb_node);
146
147 rb_erase(&n->rb_node, &hist);
148 collapse__insert_entry(n);
149 }
150}
151
152/*
153 * reverse the map, sort on count.
154 */
155
156void output__insert_entry(struct hist_entry *he, u64 min_callchain_hits)
157{
158 struct rb_node **p = &output_hists.rb_node;
159 struct rb_node *parent = NULL;
160 struct hist_entry *iter;
161
162 if (callchain)
163 callchain_param.sort(&he->sorted_chain, &he->callchain,
164 min_callchain_hits, &callchain_param);
165
166 while (*p != NULL) {
167 parent = *p;
168 iter = rb_entry(parent, struct hist_entry, rb_node);
169
170 if (he->count > iter->count)
171 p = &(*p)->rb_left;
172 else
173 p = &(*p)->rb_right;
174 }
175
176 rb_link_node(&he->rb_node, parent, p);
177 rb_insert_color(&he->rb_node, &output_hists);
178}
179
180void output__resort(u64 total_samples)
181{
182 struct rb_node *next;
183 struct hist_entry *n;
184 struct rb_root *tree = &hist;
185 u64 min_callchain_hits;
186
187 min_callchain_hits =
188 total_samples * (callchain_param.min_percent / 100);
189
190 if (sort__need_collapse)
191 tree = &collapse_hists;
192
193 next = rb_first(tree);
194
195 while (next) {
196 n = rb_entry(next, struct hist_entry, rb_node);
197 next = rb_next(&n->rb_node);
198
199 rb_erase(&n->rb_node, tree);
200 output__insert_entry(n, min_callchain_hits);
201 }
202}
diff --git a/tools/perf/util/hist.h b/tools/perf/util/hist.h
new file mode 100644
index 000000000000..3020db0c9292
--- /dev/null
+++ b/tools/perf/util/hist.h
@@ -0,0 +1,50 @@
1#ifndef __PERF_HIST_H
2#define __PERF_HIST_H
3#include "../builtin.h"
4
5#include "util.h"
6
7#include "color.h"
8#include <linux/list.h>
9#include "cache.h"
10#include <linux/rbtree.h>
11#include "symbol.h"
12#include "string.h"
13#include "callchain.h"
14#include "strlist.h"
15#include "values.h"
16
17#include "../perf.h"
18#include "debug.h"
19#include "header.h"
20
21#include "parse-options.h"
22#include "parse-events.h"
23
24#include "thread.h"
25#include "sort.h"
26
27extern struct rb_root hist;
28extern struct rb_root collapse_hists;
29extern struct rb_root output_hists;
30extern int callchain;
31extern struct callchain_param callchain_param;
32extern unsigned long total;
33extern unsigned long total_mmap;
34extern unsigned long total_comm;
35extern unsigned long total_fork;
36extern unsigned long total_unknown;
37extern unsigned long total_lost;
38
39struct hist_entry *__hist_entry__add(struct addr_location *al,
40 struct symbol *parent,
41 u64 count, bool *hit);
42extern int64_t hist_entry__cmp(struct hist_entry *, struct hist_entry *);
43extern int64_t hist_entry__collapse(struct hist_entry *, struct hist_entry *);
44extern void hist_entry__free(struct hist_entry *);
45extern void collapse__insert_entry(struct hist_entry *);
46extern void collapse__resort(void);
47extern void output__insert_entry(struct hist_entry *, u64);
48extern void output__resort(u64);
49
50#endif /* __PERF_HIST_H */
diff --git a/tools/perf/util/include/asm/asm-offsets.h b/tools/perf/util/include/asm/asm-offsets.h
new file mode 100644
index 000000000000..ed538942523d
--- /dev/null
+++ b/tools/perf/util/include/asm/asm-offsets.h
@@ -0,0 +1 @@
/* stub */
diff --git a/tools/perf/util/include/asm/bitops.h b/tools/perf/util/include/asm/bitops.h
new file mode 100644
index 000000000000..58e9817ffae0
--- /dev/null
+++ b/tools/perf/util/include/asm/bitops.h
@@ -0,0 +1,18 @@
1#ifndef _PERF_ASM_BITOPS_H_
2#define _PERF_ASM_BITOPS_H_
3
4#include <sys/types.h>
5#include "../../types.h"
6#include <linux/compiler.h>
7
8/* CHECKME: Not sure both always match */
9#define BITS_PER_LONG __WORDSIZE
10
11#include "../../../../include/asm-generic/bitops/__fls.h"
12#include "../../../../include/asm-generic/bitops/fls.h"
13#include "../../../../include/asm-generic/bitops/fls64.h"
14#include "../../../../include/asm-generic/bitops/__ffs.h"
15#include "../../../../include/asm-generic/bitops/ffz.h"
16#include "../../../../include/asm-generic/bitops/hweight.h"
17
18#endif
diff --git a/tools/perf/util/include/asm/bug.h b/tools/perf/util/include/asm/bug.h
new file mode 100644
index 000000000000..7fcc6810adc2
--- /dev/null
+++ b/tools/perf/util/include/asm/bug.h
@@ -0,0 +1,22 @@
1#ifndef _PERF_ASM_GENERIC_BUG_H
2#define _PERF_ASM_GENERIC_BUG_H
3
4#define __WARN_printf(arg...) do { fprintf(stderr, arg); } while (0)
5
6#define WARN(condition, format...) ({ \
7 int __ret_warn_on = !!(condition); \
8 if (unlikely(__ret_warn_on)) \
9 __WARN_printf(format); \
10 unlikely(__ret_warn_on); \
11})
12
13#define WARN_ONCE(condition, format...) ({ \
14 static int __warned; \
15 int __ret_warn_once = !!(condition); \
16 \
17 if (unlikely(__ret_warn_once)) \
18 if (WARN(!__warned, format)) \
19 __warned = 1; \
20 unlikely(__ret_warn_once); \
21})
22#endif
diff --git a/tools/perf/util/include/asm/byteorder.h b/tools/perf/util/include/asm/byteorder.h
new file mode 100644
index 000000000000..b722abe3a626
--- /dev/null
+++ b/tools/perf/util/include/asm/byteorder.h
@@ -0,0 +1,2 @@
1#include <asm/types.h>
2#include "../../../../include/linux/swab.h"
diff --git a/tools/perf/util/include/asm/swab.h b/tools/perf/util/include/asm/swab.h
new file mode 100644
index 000000000000..ed538942523d
--- /dev/null
+++ b/tools/perf/util/include/asm/swab.h
@@ -0,0 +1 @@
/* stub */
diff --git a/tools/perf/util/include/asm/uaccess.h b/tools/perf/util/include/asm/uaccess.h
new file mode 100644
index 000000000000..d0f72b8fcc35
--- /dev/null
+++ b/tools/perf/util/include/asm/uaccess.h
@@ -0,0 +1,14 @@
1#ifndef _PERF_ASM_UACCESS_H_
2#define _PERF_ASM_UACCESS_H_
3
4#define __get_user(src, dest) \
5({ \
6 (src) = *dest; \
7 0; \
8})
9
10#define get_user __get_user
11
12#define access_ok(type, addr, size) 1
13
14#endif
diff --git a/tools/perf/util/include/linux/bitmap.h b/tools/perf/util/include/linux/bitmap.h
new file mode 100644
index 000000000000..94507639a8c4
--- /dev/null
+++ b/tools/perf/util/include/linux/bitmap.h
@@ -0,0 +1,3 @@
1#include "../../../../include/linux/bitmap.h"
2#include "../../../../include/asm-generic/bitops/find.h"
3#include <linux/errno.h>
diff --git a/tools/perf/util/include/linux/bitops.h b/tools/perf/util/include/linux/bitops.h
new file mode 100644
index 000000000000..8d63116e9435
--- /dev/null
+++ b/tools/perf/util/include/linux/bitops.h
@@ -0,0 +1,29 @@
1#ifndef _PERF_LINUX_BITOPS_H_
2#define _PERF_LINUX_BITOPS_H_
3
4#define __KERNEL__
5
6#define CONFIG_GENERIC_FIND_NEXT_BIT
7#define CONFIG_GENERIC_FIND_FIRST_BIT
8#include "../../../../include/linux/bitops.h"
9
10#undef __KERNEL__
11
12static inline void set_bit(int nr, unsigned long *addr)
13{
14 addr[nr / BITS_PER_LONG] |= 1UL << (nr % BITS_PER_LONG);
15}
16
17static __always_inline int test_bit(unsigned int nr, const unsigned long *addr)
18{
19 return ((1UL << (nr % BITS_PER_LONG)) &
20 (((unsigned long *)addr)[nr / BITS_PER_LONG])) != 0;
21}
22
23unsigned long generic_find_next_zero_le_bit(const unsigned long *addr, unsigned
24 long size, unsigned long offset);
25
26unsigned long generic_find_next_le_bit(const unsigned long *addr, unsigned
27 long size, unsigned long offset);
28
29#endif
diff --git a/tools/perf/util/include/linux/compiler.h b/tools/perf/util/include/linux/compiler.h
new file mode 100644
index 000000000000..dfb0713ed47f
--- /dev/null
+++ b/tools/perf/util/include/linux/compiler.h
@@ -0,0 +1,10 @@
1#ifndef _PERF_LINUX_COMPILER_H_
2#define _PERF_LINUX_COMPILER_H_
3
4#ifndef __always_inline
5#define __always_inline inline
6#endif
7#define __user
8#define __attribute_const__
9
10#endif
diff --git a/tools/perf/util/include/linux/ctype.h b/tools/perf/util/include/linux/ctype.h
new file mode 100644
index 000000000000..a53d4ee1e0b7
--- /dev/null
+++ b/tools/perf/util/include/linux/ctype.h
@@ -0,0 +1 @@
#include "../util.h"
diff --git a/tools/perf/util/include/linux/kernel.h b/tools/perf/util/include/linux/kernel.h
index a6b87390cb52..21c0274c02fa 100644
--- a/tools/perf/util/include/linux/kernel.h
+++ b/tools/perf/util/include/linux/kernel.h
@@ -1,6 +1,16 @@
1#ifndef PERF_LINUX_KERNEL_H_ 1#ifndef PERF_LINUX_KERNEL_H_
2#define PERF_LINUX_KERNEL_H_ 2#define PERF_LINUX_KERNEL_H_
3 3
4#include <stdarg.h>
5#include <stdio.h>
6#include <stdlib.h>
7#include <assert.h>
8
9#define DIV_ROUND_UP(n,d) (((n) + (d) - 1) / (d))
10
11#define ALIGN(x,a) __ALIGN_MASK(x,(typeof(x))(a)-1)
12#define __ALIGN_MASK(x,mask) (((x)+(mask))&~(mask))
13
4#ifndef offsetof 14#ifndef offsetof
5#define offsetof(TYPE, MEMBER) ((size_t) &((TYPE *)0)->MEMBER) 15#define offsetof(TYPE, MEMBER) ((size_t) &((TYPE *)0)->MEMBER)
6#endif 16#endif
@@ -26,4 +36,70 @@
26 _max1 > _max2 ? _max1 : _max2; }) 36 _max1 > _max2 ? _max1 : _max2; })
27#endif 37#endif
28 38
39#ifndef min
40#define min(x, y) ({ \
41 typeof(x) _min1 = (x); \
42 typeof(y) _min2 = (y); \
43 (void) (&_min1 == &_min2); \
44 _min1 < _min2 ? _min1 : _min2; })
45#endif
46
47#ifndef BUG_ON
48#define BUG_ON(cond) assert(!(cond))
49#endif
50
51/*
52 * Both need more care to handle endianness
53 * (Don't use bitmap_copy_le() for now)
54 */
55#define cpu_to_le64(x) (x)
56#define cpu_to_le32(x) (x)
57
58static inline int
59vscnprintf(char *buf, size_t size, const char *fmt, va_list args)
60{
61 int i;
62 ssize_t ssize = size;
63
64 i = vsnprintf(buf, size, fmt, args);
65
66 return (i >= ssize) ? (ssize - 1) : i;
67}
68
69static inline int scnprintf(char * buf, size_t size, const char * fmt, ...)
70{
71 va_list args;
72 ssize_t ssize = size;
73 int i;
74
75 va_start(args, fmt);
76 i = vsnprintf(buf, size, fmt, args);
77 va_end(args);
78
79 return (i >= ssize) ? (ssize - 1) : i;
80}
81
82static inline unsigned long
83simple_strtoul(const char *nptr, char **endptr, int base)
84{
85 return strtoul(nptr, endptr, base);
86}
87
88#ifndef pr_fmt
89#define pr_fmt(fmt) fmt
90#endif
91
92#define pr_err(fmt, ...) \
93 do { fprintf(stderr, pr_fmt(fmt), ##__VA_ARGS__); } while (0)
94#define pr_warning(fmt, ...) \
95 do { fprintf(stderr, pr_fmt(fmt), ##__VA_ARGS__); } while (0)
96#define pr_info(fmt, ...) \
97 do { fprintf(stderr, pr_fmt(fmt), ##__VA_ARGS__); } while (0)
98#define pr_debug(fmt, ...) \
99 eprintf(1, pr_fmt(fmt), ##__VA_ARGS__)
100#define pr_debugN(n, fmt, ...) \
101 eprintf(n, pr_fmt(fmt), ##__VA_ARGS__)
102#define pr_debug2(fmt, ...) pr_debugN(2, pr_fmt(fmt), ##__VA_ARGS__)
103#define pr_debug3(fmt, ...) pr_debugN(3, pr_fmt(fmt), ##__VA_ARGS__)
104
29#endif 105#endif
diff --git a/tools/perf/util/include/linux/string.h b/tools/perf/util/include/linux/string.h
new file mode 100644
index 000000000000..3b2f5900276f
--- /dev/null
+++ b/tools/perf/util/include/linux/string.h
@@ -0,0 +1 @@
#include <string.h>
diff --git a/tools/perf/util/include/linux/types.h b/tools/perf/util/include/linux/types.h
new file mode 100644
index 000000000000..196862a81a21
--- /dev/null
+++ b/tools/perf/util/include/linux/types.h
@@ -0,0 +1,9 @@
1#ifndef _PERF_LINUX_TYPES_H_
2#define _PERF_LINUX_TYPES_H_
3
4#include <asm/types.h>
5
6#define DECLARE_BITMAP(name,bits) \
7 unsigned long name[BITS_TO_LONGS(bits)]
8
9#endif
diff --git a/tools/perf/util/levenshtein.h b/tools/perf/util/levenshtein.h
index 0173abeef52c..b0fcb6d8a881 100644
--- a/tools/perf/util/levenshtein.h
+++ b/tools/perf/util/levenshtein.h
@@ -1,8 +1,8 @@
1#ifndef LEVENSHTEIN_H 1#ifndef __PERF_LEVENSHTEIN_H
2#define LEVENSHTEIN_H 2#define __PERF_LEVENSHTEIN_H
3 3
4int levenshtein(const char *string1, const char *string2, 4int levenshtein(const char *string1, const char *string2,
5 int swap_penalty, int substition_penalty, 5 int swap_penalty, int substition_penalty,
6 int insertion_penalty, int deletion_penalty); 6 int insertion_penalty, int deletion_penalty);
7 7
8#endif 8#endif /* __PERF_LEVENSHTEIN_H */
diff --git a/tools/perf/util/map.c b/tools/perf/util/map.c
index 804e02382739..69f94fe9db20 100644
--- a/tools/perf/util/map.c
+++ b/tools/perf/util/map.c
@@ -3,6 +3,7 @@
3#include <stdlib.h> 3#include <stdlib.h>
4#include <string.h> 4#include <string.h>
5#include <stdio.h> 5#include <stdio.h>
6#include "debug.h"
6 7
7static inline int is_anon_memory(const char *filename) 8static inline int is_anon_memory(const char *filename)
8{ 9{
@@ -19,13 +20,28 @@ static int strcommon(const char *pathname, char *cwd, int cwdlen)
19 return n; 20 return n;
20} 21}
21 22
22 struct map *map__new(struct mmap_event *event, char *cwd, int cwdlen) 23void map__init(struct map *self, enum map_type type,
24 u64 start, u64 end, u64 pgoff, struct dso *dso)
25{
26 self->type = type;
27 self->start = start;
28 self->end = end;
29 self->pgoff = pgoff;
30 self->dso = dso;
31 self->map_ip = map__map_ip;
32 self->unmap_ip = map__unmap_ip;
33 RB_CLEAR_NODE(&self->rb_node);
34}
35
36struct map *map__new(struct mmap_event *event, enum map_type type,
37 char *cwd, int cwdlen)
23{ 38{
24 struct map *self = malloc(sizeof(*self)); 39 struct map *self = malloc(sizeof(*self));
25 40
26 if (self != NULL) { 41 if (self != NULL) {
27 const char *filename = event->filename; 42 const char *filename = event->filename;
28 char newfilename[PATH_MAX]; 43 char newfilename[PATH_MAX];
44 struct dso *dso;
29 int anon; 45 int anon;
30 46
31 if (cwd) { 47 if (cwd) {
@@ -45,18 +61,15 @@ static int strcommon(const char *pathname, char *cwd, int cwdlen)
45 filename = newfilename; 61 filename = newfilename;
46 } 62 }
47 63
48 self->start = event->start; 64 dso = dsos__findnew(filename);
49 self->end = event->start + event->len; 65 if (dso == NULL)
50 self->pgoff = event->pgoff;
51
52 self->dso = dsos__findnew(filename);
53 if (self->dso == NULL)
54 goto out_delete; 66 goto out_delete;
55 67
68 map__init(self, type, event->start, event->start + event->len,
69 event->pgoff, dso);
70
56 if (self->dso == vdso || anon) 71 if (self->dso == vdso || anon)
57 self->map_ip = vdso__map_ip; 72 self->map_ip = self->unmap_ip = identity__map_ip;
58 else
59 self->map_ip = map__map_ip;
60 } 73 }
61 return self; 74 return self;
62out_delete: 75out_delete:
@@ -64,6 +77,72 @@ out_delete:
64 return NULL; 77 return NULL;
65} 78}
66 79
80void map__delete(struct map *self)
81{
82 free(self);
83}
84
85void map__fixup_start(struct map *self)
86{
87 struct rb_root *symbols = &self->dso->symbols[self->type];
88 struct rb_node *nd = rb_first(symbols);
89 if (nd != NULL) {
90 struct symbol *sym = rb_entry(nd, struct symbol, rb_node);
91 self->start = sym->start;
92 }
93}
94
95void map__fixup_end(struct map *self)
96{
97 struct rb_root *symbols = &self->dso->symbols[self->type];
98 struct rb_node *nd = rb_last(symbols);
99 if (nd != NULL) {
100 struct symbol *sym = rb_entry(nd, struct symbol, rb_node);
101 self->end = sym->end;
102 }
103}
104
105#define DSO__DELETED "(deleted)"
106
107struct symbol *map__find_symbol(struct map *self, u64 addr,
108 symbol_filter_t filter)
109{
110 if (!dso__loaded(self->dso, self->type)) {
111 int nr = dso__load(self->dso, self, filter);
112
113 if (nr < 0) {
114 if (self->dso->has_build_id) {
115 char sbuild_id[BUILD_ID_SIZE * 2 + 1];
116
117 build_id__sprintf(self->dso->build_id,
118 sizeof(self->dso->build_id),
119 sbuild_id);
120 pr_warning("%s with build id %s not found",
121 self->dso->long_name, sbuild_id);
122 } else
123 pr_warning("Failed to open %s",
124 self->dso->long_name);
125 pr_warning(", continuing without symbols\n");
126 return NULL;
127 } else if (nr == 0) {
128 const char *name = self->dso->long_name;
129 const size_t len = strlen(name);
130 const size_t real_len = len - sizeof(DSO__DELETED);
131
132 if (len > sizeof(DSO__DELETED) &&
133 strcmp(name + real_len + 1, DSO__DELETED) == 0) {
134 pr_warning("%.*s was updated, restart the long running apps that use it!\n",
135 (int)real_len, name);
136 } else {
137 pr_warning("no symbols found in %s, maybe install a debug package?\n", name);
138 }
139 return NULL;
140 }
141 }
142
143 return self->dso->find_symbol(self->dso, self->type, addr);
144}
145
67struct map *map__clone(struct map *self) 146struct map *map__clone(struct map *self)
68{ 147{
69 struct map *map = malloc(sizeof(*self)); 148 struct map *map = malloc(sizeof(*self));
diff --git a/tools/perf/util/module.c b/tools/perf/util/module.c
deleted file mode 100644
index 0d8c85defcd2..000000000000
--- a/tools/perf/util/module.c
+++ /dev/null
@@ -1,545 +0,0 @@
1#include "util.h"
2#include "../perf.h"
3#include "string.h"
4#include "module.h"
5
6#include <libelf.h>
7#include <libgen.h>
8#include <gelf.h>
9#include <elf.h>
10#include <dirent.h>
11#include <sys/utsname.h>
12
13static unsigned int crc32(const char *p, unsigned int len)
14{
15 int i;
16 unsigned int crc = 0;
17
18 while (len--) {
19 crc ^= *p++;
20 for (i = 0; i < 8; i++)
21 crc = (crc >> 1) ^ ((crc & 1) ? 0xedb88320 : 0);
22 }
23 return crc;
24}
25
26/* module section methods */
27
28struct sec_dso *sec_dso__new_dso(const char *name)
29{
30 struct sec_dso *self = malloc(sizeof(*self) + strlen(name) + 1);
31
32 if (self != NULL) {
33 strcpy(self->name, name);
34 self->secs = RB_ROOT;
35 self->find_section = sec_dso__find_section;
36 }
37
38 return self;
39}
40
41static void sec_dso__delete_section(struct section *self)
42{
43 free(((void *)self));
44}
45
46void sec_dso__delete_sections(struct sec_dso *self)
47{
48 struct section *pos;
49 struct rb_node *next = rb_first(&self->secs);
50
51 while (next) {
52 pos = rb_entry(next, struct section, rb_node);
53 next = rb_next(&pos->rb_node);
54 rb_erase(&pos->rb_node, &self->secs);
55 sec_dso__delete_section(pos);
56 }
57}
58
59void sec_dso__delete_self(struct sec_dso *self)
60{
61 sec_dso__delete_sections(self);
62 free(self);
63}
64
65static void sec_dso__insert_section(struct sec_dso *self, struct section *sec)
66{
67 struct rb_node **p = &self->secs.rb_node;
68 struct rb_node *parent = NULL;
69 const u64 hash = sec->hash;
70 struct section *s;
71
72 while (*p != NULL) {
73 parent = *p;
74 s = rb_entry(parent, struct section, rb_node);
75 if (hash < s->hash)
76 p = &(*p)->rb_left;
77 else
78 p = &(*p)->rb_right;
79 }
80 rb_link_node(&sec->rb_node, parent, p);
81 rb_insert_color(&sec->rb_node, &self->secs);
82}
83
84struct section *sec_dso__find_section(struct sec_dso *self, const char *name)
85{
86 struct rb_node *n;
87 u64 hash;
88 int len;
89
90 if (self == NULL)
91 return NULL;
92
93 len = strlen(name);
94 hash = crc32(name, len);
95
96 n = self->secs.rb_node;
97
98 while (n) {
99 struct section *s = rb_entry(n, struct section, rb_node);
100
101 if (hash < s->hash)
102 n = n->rb_left;
103 else if (hash > s->hash)
104 n = n->rb_right;
105 else {
106 if (!strcmp(name, s->name))
107 return s;
108 else
109 n = rb_next(&s->rb_node);
110 }
111 }
112
113 return NULL;
114}
115
116static size_t sec_dso__fprintf_section(struct section *self, FILE *fp)
117{
118 return fprintf(fp, "name:%s vma:%llx path:%s\n",
119 self->name, self->vma, self->path);
120}
121
122size_t sec_dso__fprintf(struct sec_dso *self, FILE *fp)
123{
124 size_t ret = fprintf(fp, "dso: %s\n", self->name);
125
126 struct rb_node *nd;
127 for (nd = rb_first(&self->secs); nd; nd = rb_next(nd)) {
128 struct section *pos = rb_entry(nd, struct section, rb_node);
129 ret += sec_dso__fprintf_section(pos, fp);
130 }
131
132 return ret;
133}
134
135static struct section *section__new(const char *name, const char *path)
136{
137 struct section *self = calloc(1, sizeof(*self));
138
139 if (!self)
140 goto out_failure;
141
142 self->name = calloc(1, strlen(name) + 1);
143 if (!self->name)
144 goto out_failure;
145
146 self->path = calloc(1, strlen(path) + 1);
147 if (!self->path)
148 goto out_failure;
149
150 strcpy(self->name, name);
151 strcpy(self->path, path);
152 self->hash = crc32(self->name, strlen(name));
153
154 return self;
155
156out_failure:
157 if (self) {
158 if (self->name)
159 free(self->name);
160 if (self->path)
161 free(self->path);
162 free(self);
163 }
164
165 return NULL;
166}
167
168/* module methods */
169
170struct mod_dso *mod_dso__new_dso(const char *name)
171{
172 struct mod_dso *self = malloc(sizeof(*self) + strlen(name) + 1);
173
174 if (self != NULL) {
175 strcpy(self->name, name);
176 self->mods = RB_ROOT;
177 self->find_module = mod_dso__find_module;
178 }
179
180 return self;
181}
182
183static void mod_dso__delete_module(struct module *self)
184{
185 free(((void *)self));
186}
187
188void mod_dso__delete_modules(struct mod_dso *self)
189{
190 struct module *pos;
191 struct rb_node *next = rb_first(&self->mods);
192
193 while (next) {
194 pos = rb_entry(next, struct module, rb_node);
195 next = rb_next(&pos->rb_node);
196 rb_erase(&pos->rb_node, &self->mods);
197 mod_dso__delete_module(pos);
198 }
199}
200
201void mod_dso__delete_self(struct mod_dso *self)
202{
203 mod_dso__delete_modules(self);
204 free(self);
205}
206
207static void mod_dso__insert_module(struct mod_dso *self, struct module *mod)
208{
209 struct rb_node **p = &self->mods.rb_node;
210 struct rb_node *parent = NULL;
211 const u64 hash = mod->hash;
212 struct module *m;
213
214 while (*p != NULL) {
215 parent = *p;
216 m = rb_entry(parent, struct module, rb_node);
217 if (hash < m->hash)
218 p = &(*p)->rb_left;
219 else
220 p = &(*p)->rb_right;
221 }
222 rb_link_node(&mod->rb_node, parent, p);
223 rb_insert_color(&mod->rb_node, &self->mods);
224}
225
226struct module *mod_dso__find_module(struct mod_dso *self, const char *name)
227{
228 struct rb_node *n;
229 u64 hash;
230 int len;
231
232 if (self == NULL)
233 return NULL;
234
235 len = strlen(name);
236 hash = crc32(name, len);
237
238 n = self->mods.rb_node;
239
240 while (n) {
241 struct module *m = rb_entry(n, struct module, rb_node);
242
243 if (hash < m->hash)
244 n = n->rb_left;
245 else if (hash > m->hash)
246 n = n->rb_right;
247 else {
248 if (!strcmp(name, m->name))
249 return m;
250 else
251 n = rb_next(&m->rb_node);
252 }
253 }
254
255 return NULL;
256}
257
258static size_t mod_dso__fprintf_module(struct module *self, FILE *fp)
259{
260 return fprintf(fp, "name:%s path:%s\n", self->name, self->path);
261}
262
263size_t mod_dso__fprintf(struct mod_dso *self, FILE *fp)
264{
265 struct rb_node *nd;
266 size_t ret;
267
268 ret = fprintf(fp, "dso: %s\n", self->name);
269
270 for (nd = rb_first(&self->mods); nd; nd = rb_next(nd)) {
271 struct module *pos = rb_entry(nd, struct module, rb_node);
272
273 ret += mod_dso__fprintf_module(pos, fp);
274 }
275
276 return ret;
277}
278
279static struct module *module__new(const char *name, const char *path)
280{
281 struct module *self = calloc(1, sizeof(*self));
282
283 if (!self)
284 goto out_failure;
285
286 self->name = calloc(1, strlen(name) + 1);
287 if (!self->name)
288 goto out_failure;
289
290 self->path = calloc(1, strlen(path) + 1);
291 if (!self->path)
292 goto out_failure;
293
294 strcpy(self->name, name);
295 strcpy(self->path, path);
296 self->hash = crc32(self->name, strlen(name));
297
298 return self;
299
300out_failure:
301 if (self) {
302 if (self->name)
303 free(self->name);
304 if (self->path)
305 free(self->path);
306 free(self);
307 }
308
309 return NULL;
310}
311
312static int mod_dso__load_sections(struct module *mod)
313{
314 int count = 0, path_len;
315 struct dirent *entry;
316 char *line = NULL;
317 char *dir_path;
318 DIR *dir;
319 size_t n;
320
321 path_len = strlen("/sys/module/");
322 path_len += strlen(mod->name);
323 path_len += strlen("/sections/");
324
325 dir_path = calloc(1, path_len + 1);
326 if (dir_path == NULL)
327 goto out_failure;
328
329 strcat(dir_path, "/sys/module/");
330 strcat(dir_path, mod->name);
331 strcat(dir_path, "/sections/");
332
333 dir = opendir(dir_path);
334 if (dir == NULL)
335 goto out_free;
336
337 while ((entry = readdir(dir))) {
338 struct section *section;
339 char *path, *vma;
340 int line_len;
341 FILE *file;
342
343 if (!strcmp(".", entry->d_name) || !strcmp("..", entry->d_name))
344 continue;
345
346 path = calloc(1, path_len + strlen(entry->d_name) + 1);
347 if (path == NULL)
348 break;
349 strcat(path, dir_path);
350 strcat(path, entry->d_name);
351
352 file = fopen(path, "r");
353 if (file == NULL) {
354 free(path);
355 break;
356 }
357
358 line_len = getline(&line, &n, file);
359 if (line_len < 0) {
360 free(path);
361 fclose(file);
362 break;
363 }
364
365 if (!line) {
366 free(path);
367 fclose(file);
368 break;
369 }
370
371 line[--line_len] = '\0'; /* \n */
372
373 vma = strstr(line, "0x");
374 if (!vma) {
375 free(path);
376 fclose(file);
377 break;
378 }
379 vma += 2;
380
381 section = section__new(entry->d_name, path);
382 if (!section) {
383 fprintf(stderr, "load_sections: allocation error\n");
384 free(path);
385 fclose(file);
386 break;
387 }
388
389 hex2u64(vma, &section->vma);
390 sec_dso__insert_section(mod->sections, section);
391
392 free(path);
393 fclose(file);
394 count++;
395 }
396
397 closedir(dir);
398 free(line);
399 free(dir_path);
400
401 return count;
402
403out_free:
404 free(dir_path);
405
406out_failure:
407 return count;
408}
409
410static int mod_dso__load_module_paths(struct mod_dso *self)
411{
412 struct utsname uts;
413 int count = 0, len, err = -1;
414 char *line = NULL;
415 FILE *file;
416 char *dpath, *dir;
417 size_t n;
418
419 if (uname(&uts) < 0)
420 return err;
421
422 len = strlen("/lib/modules/");
423 len += strlen(uts.release);
424 len += strlen("/modules.dep");
425
426 dpath = calloc(1, len + 1);
427 if (dpath == NULL)
428 return err;
429
430 strcat(dpath, "/lib/modules/");
431 strcat(dpath, uts.release);
432 strcat(dpath, "/modules.dep");
433
434 file = fopen(dpath, "r");
435 if (file == NULL)
436 goto out_failure;
437
438 dir = dirname(dpath);
439 if (!dir)
440 goto out_failure;
441 strcat(dir, "/");
442
443 while (!feof(file)) {
444 struct module *module;
445 char *name, *path, *tmp;
446 FILE *modfile;
447 int line_len;
448
449 line_len = getline(&line, &n, file);
450 if (line_len < 0)
451 break;
452
453 if (!line)
454 break;
455
456 line[--line_len] = '\0'; /* \n */
457
458 path = strchr(line, ':');
459 if (!path)
460 break;
461 *path = '\0';
462
463 path = strdup(line);
464 if (!path)
465 break;
466
467 if (!strstr(path, dir)) {
468 if (strncmp(path, "kernel/", 7))
469 break;
470
471 free(path);
472 path = calloc(1, strlen(dir) + strlen(line) + 1);
473 if (!path)
474 break;
475 strcat(path, dir);
476 strcat(path, line);
477 }
478
479 modfile = fopen(path, "r");
480 if (modfile == NULL)
481 break;
482 fclose(modfile);
483
484 name = strdup(path);
485 if (!name)
486 break;
487
488 name = strtok(name, "/");
489 tmp = name;
490
491 while (tmp) {
492 tmp = strtok(NULL, "/");
493 if (tmp)
494 name = tmp;
495 }
496
497 name = strsep(&name, ".");
498 if (!name)
499 break;
500
501 /* Quirk: replace '-' with '_' in all modules */
502 for (len = strlen(name); len; len--) {
503 if (*(name+len) == '-')
504 *(name+len) = '_';
505 }
506
507 module = module__new(name, path);
508 if (!module)
509 break;
510 mod_dso__insert_module(self, module);
511
512 module->sections = sec_dso__new_dso("sections");
513 if (!module->sections)
514 break;
515
516 module->active = mod_dso__load_sections(module);
517
518 if (module->active > 0)
519 count++;
520 }
521
522 if (feof(file))
523 err = count;
524 else
525 fprintf(stderr, "load_module_paths: modules.dep parsing failure!\n");
526
527out_failure:
528 if (dpath)
529 free(dpath);
530 if (file)
531 fclose(file);
532 if (line)
533 free(line);
534
535 return err;
536}
537
538int mod_dso__load_modules(struct mod_dso *dso)
539{
540 int err;
541
542 err = mod_dso__load_module_paths(dso);
543
544 return err;
545}
diff --git a/tools/perf/util/module.h b/tools/perf/util/module.h
deleted file mode 100644
index 8a592ef641ca..000000000000
--- a/tools/perf/util/module.h
+++ /dev/null
@@ -1,53 +0,0 @@
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/parse-events.c b/tools/perf/util/parse-events.c
index 8cfb48cbbea0..9e5dbd66d34d 100644
--- a/tools/perf/util/parse-events.c
+++ b/tools/perf/util/parse-events.c
@@ -1,4 +1,4 @@
1 1#include "../../../include/linux/hw_breakpoint.h"
2#include "util.h" 2#include "util.h"
3#include "../perf.h" 3#include "../perf.h"
4#include "parse-options.h" 4#include "parse-options.h"
@@ -7,10 +7,12 @@
7#include "string.h" 7#include "string.h"
8#include "cache.h" 8#include "cache.h"
9#include "header.h" 9#include "header.h"
10#include "debugfs.h"
10 11
11int nr_counters; 12int nr_counters;
12 13
13struct perf_event_attr attrs[MAX_COUNTERS]; 14struct perf_event_attr attrs[MAX_COUNTERS];
15char *filters[MAX_COUNTERS];
14 16
15struct event_symbol { 17struct event_symbol {
16 u8 type; 18 u8 type;
@@ -46,6 +48,8 @@ static struct event_symbol event_symbols[] = {
46 { CSW(PAGE_FAULTS_MAJ), "major-faults", "" }, 48 { CSW(PAGE_FAULTS_MAJ), "major-faults", "" },
47 { CSW(CONTEXT_SWITCHES), "context-switches", "cs" }, 49 { CSW(CONTEXT_SWITCHES), "context-switches", "cs" },
48 { CSW(CPU_MIGRATIONS), "cpu-migrations", "migrations" }, 50 { CSW(CPU_MIGRATIONS), "cpu-migrations", "migrations" },
51 { CSW(ALIGNMENT_FAULTS), "alignment-faults", "" },
52 { CSW(EMULATION_FAULTS), "emulation-faults", "" },
49}; 53};
50 54
51#define __PERF_EVENT_FIELD(config, name) \ 55#define __PERF_EVENT_FIELD(config, name) \
@@ -74,6 +78,8 @@ static const char *sw_event_names[] = {
74 "CPU-migrations", 78 "CPU-migrations",
75 "minor-faults", 79 "minor-faults",
76 "major-faults", 80 "major-faults",
81 "alignment-faults",
82 "emulation-faults",
77}; 83};
78 84
79#define MAX_ALIASES 8 85#define MAX_ALIASES 8
@@ -148,16 +154,6 @@ static int tp_event_has_id(struct dirent *sys_dir, struct dirent *evt_dir)
148 154
149#define MAX_EVENT_LENGTH 512 155#define MAX_EVENT_LENGTH 512
150 156
151int valid_debugfs_mount(const char *debugfs)
152{
153 struct statfs st_fs;
154
155 if (statfs(debugfs, &st_fs) < 0)
156 return -ENOENT;
157 else if (st_fs.f_type != (long) DEBUGFS_MAGIC)
158 return -ENOENT;
159 return 0;
160}
161 157
162struct tracepoint_path *tracepoint_id_to_path(u64 config) 158struct tracepoint_path *tracepoint_id_to_path(u64 config)
163{ 159{
@@ -170,7 +166,7 @@ struct tracepoint_path *tracepoint_id_to_path(u64 config)
170 char evt_path[MAXPATHLEN]; 166 char evt_path[MAXPATHLEN];
171 char dir_path[MAXPATHLEN]; 167 char dir_path[MAXPATHLEN];
172 168
173 if (valid_debugfs_mount(debugfs_path)) 169 if (debugfs_valid_mountpoint(debugfs_path))
174 return NULL; 170 return NULL;
175 171
176 sys_dir = opendir(debugfs_path); 172 sys_dir = opendir(debugfs_path);
@@ -201,7 +197,7 @@ struct tracepoint_path *tracepoint_id_to_path(u64 config)
201 if (id == config) { 197 if (id == config) {
202 closedir(evt_dir); 198 closedir(evt_dir);
203 closedir(sys_dir); 199 closedir(sys_dir);
204 path = calloc(1, sizeof(path)); 200 path = zalloc(sizeof(path));
205 path->system = malloc(MAX_EVENT_LENGTH); 201 path->system = malloc(MAX_EVENT_LENGTH);
206 if (!path->system) { 202 if (!path->system) {
207 free(path); 203 free(path);
@@ -509,7 +505,7 @@ static enum event_result parse_tracepoint_event(const char **strp,
509 char sys_name[MAX_EVENT_LENGTH]; 505 char sys_name[MAX_EVENT_LENGTH];
510 unsigned int sys_length, evt_length; 506 unsigned int sys_length, evt_length;
511 507
512 if (valid_debugfs_mount(debugfs_path)) 508 if (debugfs_valid_mountpoint(debugfs_path))
513 return 0; 509 return 0;
514 510
515 evt_name = strchr(*strp, ':'); 511 evt_name = strchr(*strp, ':');
@@ -544,6 +540,81 @@ static enum event_result parse_tracepoint_event(const char **strp,
544 attr, strp); 540 attr, strp);
545} 541}
546 542
543static enum event_result
544parse_breakpoint_type(const char *type, const char **strp,
545 struct perf_event_attr *attr)
546{
547 int i;
548
549 for (i = 0; i < 3; i++) {
550 if (!type[i])
551 break;
552
553 switch (type[i]) {
554 case 'r':
555 attr->bp_type |= HW_BREAKPOINT_R;
556 break;
557 case 'w':
558 attr->bp_type |= HW_BREAKPOINT_W;
559 break;
560 case 'x':
561 attr->bp_type |= HW_BREAKPOINT_X;
562 break;
563 default:
564 return EVT_FAILED;
565 }
566 }
567 if (!attr->bp_type) /* Default */
568 attr->bp_type = HW_BREAKPOINT_R | HW_BREAKPOINT_W;
569
570 *strp = type + i;
571
572 return EVT_HANDLED;
573}
574
575static enum event_result
576parse_breakpoint_event(const char **strp, struct perf_event_attr *attr)
577{
578 const char *target;
579 const char *type;
580 char *endaddr;
581 u64 addr;
582 enum event_result err;
583
584 target = strchr(*strp, ':');
585 if (!target)
586 return EVT_FAILED;
587
588 if (strncmp(*strp, "mem", target - *strp) != 0)
589 return EVT_FAILED;
590
591 target++;
592
593 addr = strtoull(target, &endaddr, 0);
594 if (target == endaddr)
595 return EVT_FAILED;
596
597 attr->bp_addr = addr;
598 *strp = endaddr;
599
600 type = strchr(target, ':');
601
602 /* If no type is defined, just rw as default */
603 if (!type) {
604 attr->bp_type = HW_BREAKPOINT_R | HW_BREAKPOINT_W;
605 } else {
606 err = parse_breakpoint_type(++type, strp, attr);
607 if (err == EVT_FAILED)
608 return EVT_FAILED;
609 }
610
611 /* We should find a nice way to override the access type */
612 attr->bp_len = HW_BREAKPOINT_LEN_4;
613 attr->type = PERF_TYPE_BREAKPOINT;
614
615 return EVT_HANDLED;
616}
617
547static int check_events(const char *str, unsigned int i) 618static int check_events(const char *str, unsigned int i)
548{ 619{
549 int n; 620 int n;
@@ -677,6 +748,12 @@ parse_event_symbols(const char **str, struct perf_event_attr *attr)
677 if (ret != EVT_FAILED) 748 if (ret != EVT_FAILED)
678 goto modifier; 749 goto modifier;
679 750
751 ret = parse_breakpoint_event(str, attr);
752 if (ret != EVT_FAILED)
753 goto modifier;
754
755 fprintf(stderr, "invalid or unsupported event: '%s'\n", *str);
756 fprintf(stderr, "Run 'perf list' for a list of valid events\n");
680 return EVT_FAILED; 757 return EVT_FAILED;
681 758
682modifier: 759modifier:
@@ -708,7 +785,6 @@ static void store_event_type(const char *orgname)
708 perf_header__push_event(id, orgname); 785 perf_header__push_event(id, orgname);
709} 786}
710 787
711
712int parse_events(const struct option *opt __used, const char *str, int unset __used) 788int parse_events(const struct option *opt __used, const char *str, int unset __used)
713{ 789{
714 struct perf_event_attr attr; 790 struct perf_event_attr attr;
@@ -745,6 +821,28 @@ int parse_events(const struct option *opt __used, const char *str, int unset __u
745 return 0; 821 return 0;
746} 822}
747 823
824int parse_filter(const struct option *opt __used, const char *str,
825 int unset __used)
826{
827 int i = nr_counters - 1;
828 int len = strlen(str);
829
830 if (i < 0 || attrs[i].type != PERF_TYPE_TRACEPOINT) {
831 fprintf(stderr,
832 "-F option should follow a -e tracepoint option\n");
833 return -1;
834 }
835
836 filters[i] = malloc(len + 1);
837 if (!filters[i]) {
838 fprintf(stderr, "not enough memory to hold filter string\n");
839 return -1;
840 }
841 strcpy(filters[i], str);
842
843 return 0;
844}
845
748static const char * const event_type_descriptors[] = { 846static const char * const event_type_descriptors[] = {
749 "", 847 "",
750 "Hardware event", 848 "Hardware event",
@@ -764,7 +862,7 @@ static void print_tracepoint_events(void)
764 char evt_path[MAXPATHLEN]; 862 char evt_path[MAXPATHLEN];
765 char dir_path[MAXPATHLEN]; 863 char dir_path[MAXPATHLEN];
766 864
767 if (valid_debugfs_mount(debugfs_path)) 865 if (debugfs_valid_mountpoint(debugfs_path))
768 return; 866 return;
769 867
770 sys_dir = opendir(debugfs_path); 868 sys_dir = opendir(debugfs_path);
@@ -782,7 +880,7 @@ static void print_tracepoint_events(void)
782 for_each_event(sys_dirent, evt_dir, evt_dirent, evt_next) { 880 for_each_event(sys_dirent, evt_dir, evt_dirent, evt_next) {
783 snprintf(evt_path, MAXPATHLEN, "%s:%s", 881 snprintf(evt_path, MAXPATHLEN, "%s:%s",
784 sys_dirent.d_name, evt_dirent.d_name); 882 sys_dirent.d_name, evt_dirent.d_name);
785 fprintf(stderr, " %-42s [%s]\n", evt_path, 883 printf(" %-42s [%s]\n", evt_path,
786 event_type_descriptors[PERF_TYPE_TRACEPOINT+1]); 884 event_type_descriptors[PERF_TYPE_TRACEPOINT+1]);
787 } 885 }
788 closedir(evt_dir); 886 closedir(evt_dir);
@@ -799,8 +897,8 @@ void print_events(void)
799 unsigned int i, type, op, prev_type = -1; 897 unsigned int i, type, op, prev_type = -1;
800 char name[40]; 898 char name[40];
801 899
802 fprintf(stderr, "\n"); 900 printf("\n");
803 fprintf(stderr, "List of pre-defined events (to be used in -e):\n"); 901 printf("List of pre-defined events (to be used in -e):\n");
804 902
805 for (i = 0; i < ARRAY_SIZE(event_symbols); i++, syms++) { 903 for (i = 0; i < ARRAY_SIZE(event_symbols); i++, syms++) {
806 type = syms->type + 1; 904 type = syms->type + 1;
@@ -808,19 +906,19 @@ void print_events(void)
808 type = 0; 906 type = 0;
809 907
810 if (type != prev_type) 908 if (type != prev_type)
811 fprintf(stderr, "\n"); 909 printf("\n");
812 910
813 if (strlen(syms->alias)) 911 if (strlen(syms->alias))
814 sprintf(name, "%s OR %s", syms->symbol, syms->alias); 912 sprintf(name, "%s OR %s", syms->symbol, syms->alias);
815 else 913 else
816 strcpy(name, syms->symbol); 914 strcpy(name, syms->symbol);
817 fprintf(stderr, " %-42s [%s]\n", name, 915 printf(" %-42s [%s]\n", name,
818 event_type_descriptors[type]); 916 event_type_descriptors[type]);
819 917
820 prev_type = type; 918 prev_type = type;
821 } 919 }
822 920
823 fprintf(stderr, "\n"); 921 printf("\n");
824 for (type = 0; type < PERF_COUNT_HW_CACHE_MAX; type++) { 922 for (type = 0; type < PERF_COUNT_HW_CACHE_MAX; type++) {
825 for (op = 0; op < PERF_COUNT_HW_CACHE_OP_MAX; op++) { 923 for (op = 0; op < PERF_COUNT_HW_CACHE_OP_MAX; op++) {
826 /* skip invalid cache type */ 924 /* skip invalid cache type */
@@ -828,17 +926,20 @@ void print_events(void)
828 continue; 926 continue;
829 927
830 for (i = 0; i < PERF_COUNT_HW_CACHE_RESULT_MAX; i++) { 928 for (i = 0; i < PERF_COUNT_HW_CACHE_RESULT_MAX; i++) {
831 fprintf(stderr, " %-42s [%s]\n", 929 printf(" %-42s [%s]\n",
832 event_cache_name(type, op, i), 930 event_cache_name(type, op, i),
833 event_type_descriptors[4]); 931 event_type_descriptors[4]);
834 } 932 }
835 } 933 }
836 } 934 }
837 935
838 fprintf(stderr, "\n"); 936 printf("\n");
839 fprintf(stderr, " %-42s [raw hardware event descriptor]\n", 937 printf(" %-42s [raw hardware event descriptor]\n",
840 "rNNN"); 938 "rNNN");
841 fprintf(stderr, "\n"); 939 printf("\n");
940
941 printf(" %-42s [hardware breakpoint]\n", "mem:<addr>[:access]");
942 printf("\n");
842 943
843 print_tracepoint_events(); 944 print_tracepoint_events();
844 945
diff --git a/tools/perf/util/parse-events.h b/tools/perf/util/parse-events.h
index 30c608112845..b8c1f64bc935 100644
--- a/tools/perf/util/parse-events.h
+++ b/tools/perf/util/parse-events.h
@@ -1,5 +1,5 @@
1#ifndef _PARSE_EVENTS_H 1#ifndef __PERF_PARSE_EVENTS_H
2#define _PARSE_EVENTS_H 2#define __PERF_PARSE_EVENTS_H
3/* 3/*
4 * Parse symbolic events/counts passed in as options: 4 * Parse symbolic events/counts passed in as options:
5 */ 5 */
@@ -17,11 +17,13 @@ extern struct tracepoint_path *tracepoint_id_to_path(u64 config);
17extern int nr_counters; 17extern int nr_counters;
18 18
19extern struct perf_event_attr attrs[MAX_COUNTERS]; 19extern struct perf_event_attr attrs[MAX_COUNTERS];
20extern char *filters[MAX_COUNTERS];
20 21
21extern const char *event_name(int ctr); 22extern const char *event_name(int ctr);
22extern const char *__event_name(int type, u64 config); 23extern const char *__event_name(int type, u64 config);
23 24
24extern int parse_events(const struct option *opt, const char *str, int unset); 25extern int parse_events(const struct option *opt, const char *str, int unset);
26extern int parse_filter(const struct option *opt, const char *str, int unset);
25 27
26#define EVENTS_HELP_MAX (128*1024) 28#define EVENTS_HELP_MAX (128*1024)
27 29
@@ -31,4 +33,4 @@ extern char debugfs_path[];
31extern int valid_debugfs_mount(const char *debugfs); 33extern int valid_debugfs_mount(const char *debugfs);
32 34
33 35
34#endif /* _PARSE_EVENTS_H */ 36#endif /* __PERF_PARSE_EVENTS_H */
diff --git a/tools/perf/util/parse-options.h b/tools/perf/util/parse-options.h
index 2ee248ff27e5..948805af43c2 100644
--- a/tools/perf/util/parse-options.h
+++ b/tools/perf/util/parse-options.h
@@ -1,5 +1,5 @@
1#ifndef PARSE_OPTIONS_H 1#ifndef __PERF_PARSE_OPTIONS_H
2#define PARSE_OPTIONS_H 2#define __PERF_PARSE_OPTIONS_H
3 3
4enum parse_opt_type { 4enum parse_opt_type {
5 /* special types */ 5 /* special types */
@@ -174,4 +174,4 @@ extern int parse_opt_verbosity_cb(const struct option *, const char *, int);
174 174
175extern const char *parse_options_fix_filename(const char *prefix, const char *file); 175extern const char *parse_options_fix_filename(const char *prefix, const char *file);
176 176
177#endif 177#endif /* __PERF_PARSE_OPTIONS_H */
diff --git a/tools/perf/util/probe-event.c b/tools/perf/util/probe-event.c
new file mode 100644
index 000000000000..cd7fbda5e2a5
--- /dev/null
+++ b/tools/perf/util/probe-event.c
@@ -0,0 +1,484 @@
1/*
2 * probe-event.c : perf-probe definition to kprobe_events format converter
3 *
4 * Written by Masami Hiramatsu <mhiramat@redhat.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 * (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 */
21
22#define _GNU_SOURCE
23#include <sys/utsname.h>
24#include <sys/types.h>
25#include <sys/stat.h>
26#include <fcntl.h>
27#include <errno.h>
28#include <stdio.h>
29#include <unistd.h>
30#include <stdlib.h>
31#include <string.h>
32#include <stdarg.h>
33#include <limits.h>
34
35#undef _GNU_SOURCE
36#include "event.h"
37#include "string.h"
38#include "strlist.h"
39#include "debug.h"
40#include "parse-events.h" /* For debugfs_path */
41#include "probe-event.h"
42
43#define MAX_CMDLEN 256
44#define MAX_PROBE_ARGS 128
45#define PERFPROBE_GROUP "probe"
46
47#define semantic_error(msg ...) die("Semantic error :" msg)
48
49/* If there is no space to write, returns -E2BIG. */
50static int e_snprintf(char *str, size_t size, const char *format, ...)
51{
52 int ret;
53 va_list ap;
54 va_start(ap, format);
55 ret = vsnprintf(str, size, format, ap);
56 va_end(ap);
57 if (ret >= (int)size)
58 ret = -E2BIG;
59 return ret;
60}
61
62/* Parse probepoint definition. */
63static void parse_perf_probe_probepoint(char *arg, struct probe_point *pp)
64{
65 char *ptr, *tmp;
66 char c, nc = 0;
67 /*
68 * <Syntax>
69 * perf probe SRC:LN
70 * perf probe FUNC[+OFFS|%return][@SRC]
71 */
72
73 ptr = strpbrk(arg, ":+@%");
74 if (ptr) {
75 nc = *ptr;
76 *ptr++ = '\0';
77 }
78
79 /* Check arg is function or file and copy it */
80 if (strchr(arg, '.')) /* File */
81 pp->file = strdup(arg);
82 else /* Function */
83 pp->function = strdup(arg);
84 DIE_IF(pp->file == NULL && pp->function == NULL);
85
86 /* Parse other options */
87 while (ptr) {
88 arg = ptr;
89 c = nc;
90 ptr = strpbrk(arg, ":+@%");
91 if (ptr) {
92 nc = *ptr;
93 *ptr++ = '\0';
94 }
95 switch (c) {
96 case ':': /* Line number */
97 pp->line = strtoul(arg, &tmp, 0);
98 if (*tmp != '\0')
99 semantic_error("There is non-digit charactor"
100 " in line number.");
101 break;
102 case '+': /* Byte offset from a symbol */
103 pp->offset = strtoul(arg, &tmp, 0);
104 if (*tmp != '\0')
105 semantic_error("There is non-digit charactor"
106 " in offset.");
107 break;
108 case '@': /* File name */
109 if (pp->file)
110 semantic_error("SRC@SRC is not allowed.");
111 pp->file = strdup(arg);
112 DIE_IF(pp->file == NULL);
113 if (ptr)
114 semantic_error("@SRC must be the last "
115 "option.");
116 break;
117 case '%': /* Probe places */
118 if (strcmp(arg, "return") == 0) {
119 pp->retprobe = 1;
120 } else /* Others not supported yet */
121 semantic_error("%%%s is not supported.", arg);
122 break;
123 default:
124 DIE_IF("Program has a bug.");
125 break;
126 }
127 }
128
129 /* Exclusion check */
130 if (pp->line && pp->offset)
131 semantic_error("Offset can't be used with line number.");
132
133 if (!pp->line && pp->file && !pp->function)
134 semantic_error("File always requires line number.");
135
136 if (pp->offset && !pp->function)
137 semantic_error("Offset requires an entry function.");
138
139 if (pp->retprobe && !pp->function)
140 semantic_error("Return probe requires an entry function.");
141
142 if ((pp->offset || pp->line) && pp->retprobe)
143 semantic_error("Offset/Line can't be used with return probe.");
144
145 pr_debug("symbol:%s file:%s line:%d offset:%d, return:%d\n",
146 pp->function, pp->file, pp->line, pp->offset, pp->retprobe);
147}
148
149/* Parse perf-probe event definition */
150int parse_perf_probe_event(const char *str, struct probe_point *pp)
151{
152 char **argv;
153 int argc, i, need_dwarf = 0;
154
155 argv = argv_split(str, &argc);
156 if (!argv)
157 die("argv_split failed.");
158 if (argc > MAX_PROBE_ARGS + 1)
159 semantic_error("Too many arguments");
160
161 /* Parse probe point */
162 parse_perf_probe_probepoint(argv[0], pp);
163 if (pp->file || pp->line)
164 need_dwarf = 1;
165
166 /* Copy arguments and ensure return probe has no C argument */
167 pp->nr_args = argc - 1;
168 pp->args = zalloc(sizeof(char *) * pp->nr_args);
169 for (i = 0; i < pp->nr_args; i++) {
170 pp->args[i] = strdup(argv[i + 1]);
171 if (!pp->args[i])
172 die("Failed to copy argument.");
173 if (is_c_varname(pp->args[i])) {
174 if (pp->retprobe)
175 semantic_error("You can't specify local"
176 " variable for kretprobe");
177 need_dwarf = 1;
178 }
179 }
180
181 argv_free(argv);
182 return need_dwarf;
183}
184
185/* Parse kprobe_events event into struct probe_point */
186void parse_trace_kprobe_event(const char *str, char **group, char **event,
187 struct probe_point *pp)
188{
189 char pr;
190 char *p;
191 int ret, i, argc;
192 char **argv;
193
194 pr_debug("Parsing kprobe_events: %s\n", str);
195 argv = argv_split(str, &argc);
196 if (!argv)
197 die("argv_split failed.");
198 if (argc < 2)
199 semantic_error("Too less arguments.");
200
201 /* Scan event and group name. */
202 ret = sscanf(argv[0], "%c:%a[^/ \t]/%a[^ \t]",
203 &pr, (float *)(void *)group, (float *)(void *)event);
204 if (ret != 3)
205 semantic_error("Failed to parse event name: %s", argv[0]);
206 pr_debug("Group:%s Event:%s probe:%c\n", *group, *event, pr);
207
208 if (!pp)
209 goto end;
210
211 pp->retprobe = (pr == 'r');
212
213 /* Scan function name and offset */
214 ret = sscanf(argv[1], "%a[^+]+%d", (float *)(void *)&pp->function, &pp->offset);
215 if (ret == 1)
216 pp->offset = 0;
217
218 /* kprobe_events doesn't have this information */
219 pp->line = 0;
220 pp->file = NULL;
221
222 pp->nr_args = argc - 2;
223 pp->args = zalloc(sizeof(char *) * pp->nr_args);
224 for (i = 0; i < pp->nr_args; i++) {
225 p = strchr(argv[i + 2], '=');
226 if (p) /* We don't need which register is assigned. */
227 *p = '\0';
228 pp->args[i] = strdup(argv[i + 2]);
229 if (!pp->args[i])
230 die("Failed to copy argument.");
231 }
232
233end:
234 argv_free(argv);
235}
236
237int synthesize_perf_probe_event(struct probe_point *pp)
238{
239 char *buf;
240 char offs[64] = "", line[64] = "";
241 int i, len, ret;
242
243 pp->probes[0] = buf = zalloc(MAX_CMDLEN);
244 if (!buf)
245 die("Failed to allocate memory by zalloc.");
246 if (pp->offset) {
247 ret = e_snprintf(offs, 64, "+%d", pp->offset);
248 if (ret <= 0)
249 goto error;
250 }
251 if (pp->line) {
252 ret = e_snprintf(line, 64, ":%d", pp->line);
253 if (ret <= 0)
254 goto error;
255 }
256
257 if (pp->function)
258 ret = e_snprintf(buf, MAX_CMDLEN, "%s%s%s%s", pp->function,
259 offs, pp->retprobe ? "%return" : "", line);
260 else
261 ret = e_snprintf(buf, MAX_CMDLEN, "%s%s%s%s", pp->file, line);
262 if (ret <= 0)
263 goto error;
264 len = ret;
265
266 for (i = 0; i < pp->nr_args; i++) {
267 ret = e_snprintf(&buf[len], MAX_CMDLEN - len, " %s",
268 pp->args[i]);
269 if (ret <= 0)
270 goto error;
271 len += ret;
272 }
273 pp->found = 1;
274
275 return pp->found;
276error:
277 free(pp->probes[0]);
278
279 return ret;
280}
281
282int synthesize_trace_kprobe_event(struct probe_point *pp)
283{
284 char *buf;
285 int i, len, ret;
286
287 pp->probes[0] = buf = zalloc(MAX_CMDLEN);
288 if (!buf)
289 die("Failed to allocate memory by zalloc.");
290 ret = e_snprintf(buf, MAX_CMDLEN, "%s+%d", pp->function, pp->offset);
291 if (ret <= 0)
292 goto error;
293 len = ret;
294
295 for (i = 0; i < pp->nr_args; i++) {
296 ret = e_snprintf(&buf[len], MAX_CMDLEN - len, " %s",
297 pp->args[i]);
298 if (ret <= 0)
299 goto error;
300 len += ret;
301 }
302 pp->found = 1;
303
304 return pp->found;
305error:
306 free(pp->probes[0]);
307
308 return ret;
309}
310
311static int open_kprobe_events(int flags, int mode)
312{
313 char buf[PATH_MAX];
314 int ret;
315
316 ret = e_snprintf(buf, PATH_MAX, "%s/../kprobe_events", debugfs_path);
317 if (ret < 0)
318 die("Failed to make kprobe_events path.");
319
320 ret = open(buf, flags, mode);
321 if (ret < 0) {
322 if (errno == ENOENT)
323 die("kprobe_events file does not exist -"
324 " please rebuild with CONFIG_KPROBE_TRACER.");
325 else
326 die("Could not open kprobe_events file: %s",
327 strerror(errno));
328 }
329 return ret;
330}
331
332/* Get raw string list of current kprobe_events */
333static struct strlist *get_trace_kprobe_event_rawlist(int fd)
334{
335 int ret, idx;
336 FILE *fp;
337 char buf[MAX_CMDLEN];
338 char *p;
339 struct strlist *sl;
340
341 sl = strlist__new(true, NULL);
342
343 fp = fdopen(dup(fd), "r");
344 while (!feof(fp)) {
345 p = fgets(buf, MAX_CMDLEN, fp);
346 if (!p)
347 break;
348
349 idx = strlen(p) - 1;
350 if (p[idx] == '\n')
351 p[idx] = '\0';
352 ret = strlist__add(sl, buf);
353 if (ret < 0)
354 die("strlist__add failed: %s", strerror(-ret));
355 }
356 fclose(fp);
357
358 return sl;
359}
360
361/* Free and zero clear probe_point */
362static void clear_probe_point(struct probe_point *pp)
363{
364 int i;
365
366 if (pp->function)
367 free(pp->function);
368 if (pp->file)
369 free(pp->file);
370 for (i = 0; i < pp->nr_args; i++)
371 free(pp->args[i]);
372 if (pp->args)
373 free(pp->args);
374 for (i = 0; i < pp->found; i++)
375 free(pp->probes[i]);
376 memset(pp, 0, sizeof(pp));
377}
378
379/* List up current perf-probe events */
380void show_perf_probe_events(void)
381{
382 unsigned int i;
383 int fd;
384 char *group, *event;
385 struct probe_point pp;
386 struct strlist *rawlist;
387 struct str_node *ent;
388
389 fd = open_kprobe_events(O_RDONLY, 0);
390 rawlist = get_trace_kprobe_event_rawlist(fd);
391 close(fd);
392
393 for (i = 0; i < strlist__nr_entries(rawlist); i++) {
394 ent = strlist__entry(rawlist, i);
395 parse_trace_kprobe_event(ent->s, &group, &event, &pp);
396 synthesize_perf_probe_event(&pp);
397 printf("[%s:%s]\t%s\n", group, event, pp.probes[0]);
398 free(group);
399 free(event);
400 clear_probe_point(&pp);
401 }
402
403 strlist__delete(rawlist);
404}
405
406/* Get current perf-probe event names */
407static struct strlist *get_perf_event_names(int fd)
408{
409 unsigned int i;
410 char *group, *event;
411 struct strlist *sl, *rawlist;
412 struct str_node *ent;
413
414 rawlist = get_trace_kprobe_event_rawlist(fd);
415
416 sl = strlist__new(false, NULL);
417 for (i = 0; i < strlist__nr_entries(rawlist); i++) {
418 ent = strlist__entry(rawlist, i);
419 parse_trace_kprobe_event(ent->s, &group, &event, NULL);
420 strlist__add(sl, event);
421 free(group);
422 }
423
424 strlist__delete(rawlist);
425
426 return sl;
427}
428
429static int write_trace_kprobe_event(int fd, const char *buf)
430{
431 int ret;
432
433 ret = write(fd, buf, strlen(buf));
434 if (ret <= 0)
435 die("Failed to create event.");
436 else
437 printf("Added new event: %s\n", buf);
438
439 return ret;
440}
441
442static void get_new_event_name(char *buf, size_t len, const char *base,
443 struct strlist *namelist)
444{
445 int i, ret;
446 for (i = 0; i < MAX_EVENT_INDEX; i++) {
447 ret = e_snprintf(buf, len, "%s_%d", base, i);
448 if (ret < 0)
449 die("snprintf() failed: %s", strerror(-ret));
450 if (!strlist__has_entry(namelist, buf))
451 break;
452 }
453 if (i == MAX_EVENT_INDEX)
454 die("Too many events are on the same function.");
455}
456
457void add_trace_kprobe_events(struct probe_point *probes, int nr_probes)
458{
459 int i, j, fd;
460 struct probe_point *pp;
461 char buf[MAX_CMDLEN];
462 char event[64];
463 struct strlist *namelist;
464
465 fd = open_kprobe_events(O_RDWR, O_APPEND);
466 /* Get current event names */
467 namelist = get_perf_event_names(fd);
468
469 for (j = 0; j < nr_probes; j++) {
470 pp = probes + j;
471 for (i = 0; i < pp->found; i++) {
472 /* Get an unused new event name */
473 get_new_event_name(event, 64, pp->function, namelist);
474 snprintf(buf, MAX_CMDLEN, "%c:%s/%s %s\n",
475 pp->retprobe ? 'r' : 'p',
476 PERFPROBE_GROUP, event,
477 pp->probes[i]);
478 write_trace_kprobe_event(fd, buf);
479 /* Add added event name to namelist */
480 strlist__add(namelist, event);
481 }
482 }
483 close(fd);
484}
diff --git a/tools/perf/util/probe-event.h b/tools/perf/util/probe-event.h
new file mode 100644
index 000000000000..0c6fe56fe38a
--- /dev/null
+++ b/tools/perf/util/probe-event.h
@@ -0,0 +1,18 @@
1#ifndef _PROBE_EVENT_H
2#define _PROBE_EVENT_H
3
4#include "probe-finder.h"
5#include "strlist.h"
6
7extern int parse_perf_probe_event(const char *str, struct probe_point *pp);
8extern int synthesize_perf_probe_event(struct probe_point *pp);
9extern void parse_trace_kprobe_event(const char *str, char **group,
10 char **event, struct probe_point *pp);
11extern int synthesize_trace_kprobe_event(struct probe_point *pp);
12extern void add_trace_kprobe_events(struct probe_point *probes, int nr_probes);
13extern void show_perf_probe_events(void);
14
15/* Maximum index number of event-name postfix */
16#define MAX_EVENT_INDEX 1024
17
18#endif /*_PROBE_EVENT_H */
diff --git a/tools/perf/util/probe-finder.c b/tools/perf/util/probe-finder.c
new file mode 100644
index 000000000000..293cdfc1b8ca
--- /dev/null
+++ b/tools/perf/util/probe-finder.c
@@ -0,0 +1,732 @@
1/*
2 * probe-finder.c : C expression to kprobe event converter
3 *
4 * Written by Masami Hiramatsu <mhiramat@redhat.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 * (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 */
21
22#include <sys/utsname.h>
23#include <sys/types.h>
24#include <sys/stat.h>
25#include <fcntl.h>
26#include <errno.h>
27#include <stdio.h>
28#include <unistd.h>
29#include <getopt.h>
30#include <stdlib.h>
31#include <string.h>
32#include <stdarg.h>
33#include <ctype.h>
34
35#include "event.h"
36#include "debug.h"
37#include "util.h"
38#include "probe-finder.h"
39
40
41/* Dwarf_Die Linkage to parent Die */
42struct die_link {
43 struct die_link *parent; /* Parent die */
44 Dwarf_Die die; /* Current die */
45};
46
47static Dwarf_Debug __dw_debug;
48static Dwarf_Error __dw_error;
49
50/*
51 * Generic dwarf analysis helpers
52 */
53
54#define X86_32_MAX_REGS 8
55const char *x86_32_regs_table[X86_32_MAX_REGS] = {
56 "%ax",
57 "%cx",
58 "%dx",
59 "%bx",
60 "$stack", /* Stack address instead of %sp */
61 "%bp",
62 "%si",
63 "%di",
64};
65
66#define X86_64_MAX_REGS 16
67const char *x86_64_regs_table[X86_64_MAX_REGS] = {
68 "%ax",
69 "%dx",
70 "%cx",
71 "%bx",
72 "%si",
73 "%di",
74 "%bp",
75 "%sp",
76 "%r8",
77 "%r9",
78 "%r10",
79 "%r11",
80 "%r12",
81 "%r13",
82 "%r14",
83 "%r15",
84};
85
86/* TODO: switching by dwarf address size */
87#ifdef __x86_64__
88#define ARCH_MAX_REGS X86_64_MAX_REGS
89#define arch_regs_table x86_64_regs_table
90#else
91#define ARCH_MAX_REGS X86_32_MAX_REGS
92#define arch_regs_table x86_32_regs_table
93#endif
94
95/* Return architecture dependent register string (for kprobe-tracer) */
96static const char *get_arch_regstr(unsigned int n)
97{
98 return (n <= ARCH_MAX_REGS) ? arch_regs_table[n] : NULL;
99}
100
101/*
102 * Compare the tail of two strings.
103 * Return 0 if whole of either string is same as another's tail part.
104 */
105static int strtailcmp(const char *s1, const char *s2)
106{
107 int i1 = strlen(s1);
108 int i2 = strlen(s2);
109 while (--i1 > 0 && --i2 > 0) {
110 if (s1[i1] != s2[i2])
111 return s1[i1] - s2[i2];
112 }
113 return 0;
114}
115
116/* Find the fileno of the target file. */
117static Dwarf_Unsigned cu_find_fileno(Dwarf_Die cu_die, const char *fname)
118{
119 Dwarf_Signed cnt, i;
120 Dwarf_Unsigned found = 0;
121 char **srcs;
122 int ret;
123
124 if (!fname)
125 return 0;
126
127 ret = dwarf_srcfiles(cu_die, &srcs, &cnt, &__dw_error);
128 if (ret == DW_DLV_OK) {
129 for (i = 0; i < cnt && !found; i++) {
130 if (strtailcmp(srcs[i], fname) == 0)
131 found = i + 1;
132 dwarf_dealloc(__dw_debug, srcs[i], DW_DLA_STRING);
133 }
134 for (; i < cnt; i++)
135 dwarf_dealloc(__dw_debug, srcs[i], DW_DLA_STRING);
136 dwarf_dealloc(__dw_debug, srcs, DW_DLA_LIST);
137 }
138 if (found)
139 pr_debug("found fno: %d\n", (int)found);
140 return found;
141}
142
143/* Compare diename and tname */
144static int die_compare_name(Dwarf_Die dw_die, const char *tname)
145{
146 char *name;
147 int ret;
148 ret = dwarf_diename(dw_die, &name, &__dw_error);
149 DIE_IF(ret == DW_DLV_ERROR);
150 if (ret == DW_DLV_OK) {
151 ret = strcmp(tname, name);
152 dwarf_dealloc(__dw_debug, name, DW_DLA_STRING);
153 } else
154 ret = -1;
155 return ret;
156}
157
158/* Check the address is in the subprogram(function). */
159static int die_within_subprogram(Dwarf_Die sp_die, Dwarf_Addr addr,
160 Dwarf_Signed *offs)
161{
162 Dwarf_Addr lopc, hipc;
163 int ret;
164
165 /* TODO: check ranges */
166 ret = dwarf_lowpc(sp_die, &lopc, &__dw_error);
167 DIE_IF(ret == DW_DLV_ERROR);
168 if (ret == DW_DLV_NO_ENTRY)
169 return 0;
170 ret = dwarf_highpc(sp_die, &hipc, &__dw_error);
171 DIE_IF(ret != DW_DLV_OK);
172 if (lopc <= addr && addr < hipc) {
173 *offs = addr - lopc;
174 return 1;
175 } else
176 return 0;
177}
178
179/* Check the die is inlined function */
180static Dwarf_Bool die_inlined_subprogram(Dwarf_Die dw_die)
181{
182 /* TODO: check strictly */
183 Dwarf_Bool inl;
184 int ret;
185
186 ret = dwarf_hasattr(dw_die, DW_AT_inline, &inl, &__dw_error);
187 DIE_IF(ret == DW_DLV_ERROR);
188 return inl;
189}
190
191/* Get the offset of abstruct_origin */
192static Dwarf_Off die_get_abstract_origin(Dwarf_Die dw_die)
193{
194 Dwarf_Attribute attr;
195 Dwarf_Off cu_offs;
196 int ret;
197
198 ret = dwarf_attr(dw_die, DW_AT_abstract_origin, &attr, &__dw_error);
199 DIE_IF(ret != DW_DLV_OK);
200 ret = dwarf_formref(attr, &cu_offs, &__dw_error);
201 DIE_IF(ret != DW_DLV_OK);
202 dwarf_dealloc(__dw_debug, attr, DW_DLA_ATTR);
203 return cu_offs;
204}
205
206/* Get entry pc(or low pc, 1st entry of ranges) of the die */
207static Dwarf_Addr die_get_entrypc(Dwarf_Die dw_die)
208{
209 Dwarf_Attribute attr;
210 Dwarf_Addr addr;
211 Dwarf_Off offs;
212 Dwarf_Ranges *ranges;
213 Dwarf_Signed cnt;
214 int ret;
215
216 /* Try to get entry pc */
217 ret = dwarf_attr(dw_die, DW_AT_entry_pc, &attr, &__dw_error);
218 DIE_IF(ret == DW_DLV_ERROR);
219 if (ret == DW_DLV_OK) {
220 ret = dwarf_formaddr(attr, &addr, &__dw_error);
221 DIE_IF(ret != DW_DLV_OK);
222 dwarf_dealloc(__dw_debug, attr, DW_DLA_ATTR);
223 return addr;
224 }
225
226 /* Try to get low pc */
227 ret = dwarf_lowpc(dw_die, &addr, &__dw_error);
228 DIE_IF(ret == DW_DLV_ERROR);
229 if (ret == DW_DLV_OK)
230 return addr;
231
232 /* Try to get ranges */
233 ret = dwarf_attr(dw_die, DW_AT_ranges, &attr, &__dw_error);
234 DIE_IF(ret != DW_DLV_OK);
235 ret = dwarf_formref(attr, &offs, &__dw_error);
236 DIE_IF(ret != DW_DLV_OK);
237 ret = dwarf_get_ranges(__dw_debug, offs, &ranges, &cnt, NULL,
238 &__dw_error);
239 DIE_IF(ret != DW_DLV_OK);
240 addr = ranges[0].dwr_addr1;
241 dwarf_ranges_dealloc(__dw_debug, ranges, cnt);
242 return addr;
243}
244
245/*
246 * Search a Die from Die tree.
247 * Note: cur_link->die should be deallocated in this function.
248 */
249static int __search_die_tree(struct die_link *cur_link,
250 int (*die_cb)(struct die_link *, void *),
251 void *data)
252{
253 Dwarf_Die new_die;
254 struct die_link new_link;
255 int ret;
256
257 if (!die_cb)
258 return 0;
259
260 /* Check current die */
261 while (!(ret = die_cb(cur_link, data))) {
262 /* Check child die */
263 ret = dwarf_child(cur_link->die, &new_die, &__dw_error);
264 DIE_IF(ret == DW_DLV_ERROR);
265 if (ret == DW_DLV_OK) {
266 new_link.parent = cur_link;
267 new_link.die = new_die;
268 ret = __search_die_tree(&new_link, die_cb, data);
269 if (ret)
270 break;
271 }
272
273 /* Move to next sibling */
274 ret = dwarf_siblingof(__dw_debug, cur_link->die, &new_die,
275 &__dw_error);
276 DIE_IF(ret == DW_DLV_ERROR);
277 dwarf_dealloc(__dw_debug, cur_link->die, DW_DLA_DIE);
278 cur_link->die = new_die;
279 if (ret == DW_DLV_NO_ENTRY)
280 return 0;
281 }
282 dwarf_dealloc(__dw_debug, cur_link->die, DW_DLA_DIE);
283 return ret;
284}
285
286/* Search a die in its children's die tree */
287static int search_die_from_children(Dwarf_Die parent_die,
288 int (*die_cb)(struct die_link *, void *),
289 void *data)
290{
291 struct die_link new_link;
292 int ret;
293
294 new_link.parent = NULL;
295 ret = dwarf_child(parent_die, &new_link.die, &__dw_error);
296 DIE_IF(ret == DW_DLV_ERROR);
297 if (ret == DW_DLV_OK)
298 return __search_die_tree(&new_link, die_cb, data);
299 else
300 return 0;
301}
302
303/* Find a locdesc corresponding to the address */
304static int attr_get_locdesc(Dwarf_Attribute attr, Dwarf_Locdesc *desc,
305 Dwarf_Addr addr)
306{
307 Dwarf_Signed lcnt;
308 Dwarf_Locdesc **llbuf;
309 int ret, i;
310
311 ret = dwarf_loclist_n(attr, &llbuf, &lcnt, &__dw_error);
312 DIE_IF(ret != DW_DLV_OK);
313 ret = DW_DLV_NO_ENTRY;
314 for (i = 0; i < lcnt; ++i) {
315 if (llbuf[i]->ld_lopc <= addr &&
316 llbuf[i]->ld_hipc > addr) {
317 memcpy(desc, llbuf[i], sizeof(Dwarf_Locdesc));
318 desc->ld_s =
319 malloc(sizeof(Dwarf_Loc) * llbuf[i]->ld_cents);
320 DIE_IF(desc->ld_s == NULL);
321 memcpy(desc->ld_s, llbuf[i]->ld_s,
322 sizeof(Dwarf_Loc) * llbuf[i]->ld_cents);
323 ret = DW_DLV_OK;
324 break;
325 }
326 dwarf_dealloc(__dw_debug, llbuf[i]->ld_s, DW_DLA_LOC_BLOCK);
327 dwarf_dealloc(__dw_debug, llbuf[i], DW_DLA_LOCDESC);
328 }
329 /* Releasing loop */
330 for (; i < lcnt; ++i) {
331 dwarf_dealloc(__dw_debug, llbuf[i]->ld_s, DW_DLA_LOC_BLOCK);
332 dwarf_dealloc(__dw_debug, llbuf[i], DW_DLA_LOCDESC);
333 }
334 dwarf_dealloc(__dw_debug, llbuf, DW_DLA_LIST);
335 return ret;
336}
337
338/* Get decl_file attribute value (file number) */
339static Dwarf_Unsigned die_get_decl_file(Dwarf_Die sp_die)
340{
341 Dwarf_Attribute attr;
342 Dwarf_Unsigned fno;
343 int ret;
344
345 ret = dwarf_attr(sp_die, DW_AT_decl_file, &attr, &__dw_error);
346 DIE_IF(ret != DW_DLV_OK);
347 dwarf_formudata(attr, &fno, &__dw_error);
348 DIE_IF(ret != DW_DLV_OK);
349 dwarf_dealloc(__dw_debug, attr, DW_DLA_ATTR);
350 return fno;
351}
352
353/* Get decl_line attribute value (line number) */
354static Dwarf_Unsigned die_get_decl_line(Dwarf_Die sp_die)
355{
356 Dwarf_Attribute attr;
357 Dwarf_Unsigned lno;
358 int ret;
359
360 ret = dwarf_attr(sp_die, DW_AT_decl_line, &attr, &__dw_error);
361 DIE_IF(ret != DW_DLV_OK);
362 dwarf_formudata(attr, &lno, &__dw_error);
363 DIE_IF(ret != DW_DLV_OK);
364 dwarf_dealloc(__dw_debug, attr, DW_DLA_ATTR);
365 return lno;
366}
367
368/*
369 * Probe finder related functions
370 */
371
372/* Show a location */
373static void show_location(Dwarf_Loc *loc, struct probe_finder *pf)
374{
375 Dwarf_Small op;
376 Dwarf_Unsigned regn;
377 Dwarf_Signed offs;
378 int deref = 0, ret;
379 const char *regs;
380
381 op = loc->lr_atom;
382
383 /* If this is based on frame buffer, set the offset */
384 if (op == DW_OP_fbreg) {
385 deref = 1;
386 offs = (Dwarf_Signed)loc->lr_number;
387 op = pf->fbloc.ld_s[0].lr_atom;
388 loc = &pf->fbloc.ld_s[0];
389 } else
390 offs = 0;
391
392 if (op >= DW_OP_breg0 && op <= DW_OP_breg31) {
393 regn = op - DW_OP_breg0;
394 offs += (Dwarf_Signed)loc->lr_number;
395 deref = 1;
396 } else if (op >= DW_OP_reg0 && op <= DW_OP_reg31) {
397 regn = op - DW_OP_reg0;
398 } else if (op == DW_OP_bregx) {
399 regn = loc->lr_number;
400 offs += (Dwarf_Signed)loc->lr_number2;
401 deref = 1;
402 } else if (op == DW_OP_regx) {
403 regn = loc->lr_number;
404 } else
405 die("Dwarf_OP %d is not supported.\n", op);
406
407 regs = get_arch_regstr(regn);
408 if (!regs)
409 die("%lld exceeds max register number.\n", regn);
410
411 if (deref)
412 ret = snprintf(pf->buf, pf->len,
413 " %s=%+lld(%s)", pf->var, offs, regs);
414 else
415 ret = snprintf(pf->buf, pf->len, " %s=%s", pf->var, regs);
416 DIE_IF(ret < 0);
417 DIE_IF(ret >= pf->len);
418}
419
420/* Show a variables in kprobe event format */
421static void show_variable(Dwarf_Die vr_die, struct probe_finder *pf)
422{
423 Dwarf_Attribute attr;
424 Dwarf_Locdesc ld;
425 int ret;
426
427 ret = dwarf_attr(vr_die, DW_AT_location, &attr, &__dw_error);
428 if (ret != DW_DLV_OK)
429 goto error;
430 ret = attr_get_locdesc(attr, &ld, (pf->addr - pf->cu_base));
431 if (ret != DW_DLV_OK)
432 goto error;
433 /* TODO? */
434 DIE_IF(ld.ld_cents != 1);
435 show_location(&ld.ld_s[0], pf);
436 free(ld.ld_s);
437 dwarf_dealloc(__dw_debug, attr, DW_DLA_ATTR);
438 return ;
439error:
440 die("Failed to find the location of %s at this address.\n"
441 " Perhaps, it has been optimized out.\n", pf->var);
442}
443
444static int variable_callback(struct die_link *dlink, void *data)
445{
446 struct probe_finder *pf = (struct probe_finder *)data;
447 Dwarf_Half tag;
448 int ret;
449
450 ret = dwarf_tag(dlink->die, &tag, &__dw_error);
451 DIE_IF(ret == DW_DLV_ERROR);
452 if ((tag == DW_TAG_formal_parameter ||
453 tag == DW_TAG_variable) &&
454 (die_compare_name(dlink->die, pf->var) == 0)) {
455 show_variable(dlink->die, pf);
456 return 1;
457 }
458 /* TODO: Support struct members and arrays */
459 return 0;
460}
461
462/* Find a variable in a subprogram die */
463static void find_variable(Dwarf_Die sp_die, struct probe_finder *pf)
464{
465 int ret;
466
467 if (!is_c_varname(pf->var)) {
468 /* Output raw parameters */
469 ret = snprintf(pf->buf, pf->len, " %s", pf->var);
470 DIE_IF(ret < 0);
471 DIE_IF(ret >= pf->len);
472 return ;
473 }
474
475 pr_debug("Searching '%s' variable in context.\n", pf->var);
476 /* Search child die for local variables and parameters. */
477 ret = search_die_from_children(sp_die, variable_callback, pf);
478 if (!ret)
479 die("Failed to find '%s' in this function.\n", pf->var);
480}
481
482/* Get a frame base on the address */
483static void get_current_frame_base(Dwarf_Die sp_die, struct probe_finder *pf)
484{
485 Dwarf_Attribute attr;
486 int ret;
487
488 ret = dwarf_attr(sp_die, DW_AT_frame_base, &attr, &__dw_error);
489 DIE_IF(ret != DW_DLV_OK);
490 ret = attr_get_locdesc(attr, &pf->fbloc, (pf->addr - pf->cu_base));
491 DIE_IF(ret != DW_DLV_OK);
492 dwarf_dealloc(__dw_debug, attr, DW_DLA_ATTR);
493}
494
495static void free_current_frame_base(struct probe_finder *pf)
496{
497 free(pf->fbloc.ld_s);
498 memset(&pf->fbloc, 0, sizeof(Dwarf_Locdesc));
499}
500
501/* Show a probe point to output buffer */
502static void show_probepoint(Dwarf_Die sp_die, Dwarf_Signed offs,
503 struct probe_finder *pf)
504{
505 struct probe_point *pp = pf->pp;
506 char *name;
507 char tmp[MAX_PROBE_BUFFER];
508 int ret, i, len;
509
510 /* Output name of probe point */
511 ret = dwarf_diename(sp_die, &name, &__dw_error);
512 DIE_IF(ret == DW_DLV_ERROR);
513 if (ret == DW_DLV_OK) {
514 ret = snprintf(tmp, MAX_PROBE_BUFFER, "%s+%u", name,
515 (unsigned int)offs);
516 /* Copy the function name if possible */
517 if (!pp->function) {
518 pp->function = strdup(name);
519 pp->offset = offs;
520 }
521 dwarf_dealloc(__dw_debug, name, DW_DLA_STRING);
522 } else {
523 /* This function has no name. */
524 ret = snprintf(tmp, MAX_PROBE_BUFFER, "0x%llx", pf->addr);
525 if (!pp->function) {
526 /* TODO: Use _stext */
527 pp->function = strdup("");
528 pp->offset = (int)pf->addr;
529 }
530 }
531 DIE_IF(ret < 0);
532 DIE_IF(ret >= MAX_PROBE_BUFFER);
533 len = ret;
534 pr_debug("Probe point found: %s\n", tmp);
535
536 /* Find each argument */
537 get_current_frame_base(sp_die, pf);
538 for (i = 0; i < pp->nr_args; i++) {
539 pf->var = pp->args[i];
540 pf->buf = &tmp[len];
541 pf->len = MAX_PROBE_BUFFER - len;
542 find_variable(sp_die, pf);
543 len += strlen(pf->buf);
544 }
545 free_current_frame_base(pf);
546
547 pp->probes[pp->found] = strdup(tmp);
548 pp->found++;
549}
550
551static int probeaddr_callback(struct die_link *dlink, void *data)
552{
553 struct probe_finder *pf = (struct probe_finder *)data;
554 Dwarf_Half tag;
555 Dwarf_Signed offs;
556 int ret;
557
558 ret = dwarf_tag(dlink->die, &tag, &__dw_error);
559 DIE_IF(ret == DW_DLV_ERROR);
560 /* Check the address is in this subprogram */
561 if (tag == DW_TAG_subprogram &&
562 die_within_subprogram(dlink->die, pf->addr, &offs)) {
563 show_probepoint(dlink->die, offs, pf);
564 return 1;
565 }
566 return 0;
567}
568
569/* Find probe point from its line number */
570static void find_by_line(struct probe_finder *pf)
571{
572 Dwarf_Signed cnt, i, clm;
573 Dwarf_Line *lines;
574 Dwarf_Unsigned lineno = 0;
575 Dwarf_Addr addr;
576 Dwarf_Unsigned fno;
577 int ret;
578
579 ret = dwarf_srclines(pf->cu_die, &lines, &cnt, &__dw_error);
580 DIE_IF(ret != DW_DLV_OK);
581
582 for (i = 0; i < cnt; i++) {
583 ret = dwarf_line_srcfileno(lines[i], &fno, &__dw_error);
584 DIE_IF(ret != DW_DLV_OK);
585 if (fno != pf->fno)
586 continue;
587
588 ret = dwarf_lineno(lines[i], &lineno, &__dw_error);
589 DIE_IF(ret != DW_DLV_OK);
590 if (lineno != pf->lno)
591 continue;
592
593 ret = dwarf_lineoff(lines[i], &clm, &__dw_error);
594 DIE_IF(ret != DW_DLV_OK);
595
596 ret = dwarf_lineaddr(lines[i], &addr, &__dw_error);
597 DIE_IF(ret != DW_DLV_OK);
598 pr_debug("Probe line found: line[%d]:%u,%d addr:0x%llx\n",
599 (int)i, (unsigned)lineno, (int)clm, addr);
600 pf->addr = addr;
601 /* Search a real subprogram including this line, */
602 ret = search_die_from_children(pf->cu_die,
603 probeaddr_callback, pf);
604 if (ret == 0)
605 die("Probe point is not found in subprograms.\n");
606 /* Continuing, because target line might be inlined. */
607 }
608 dwarf_srclines_dealloc(__dw_debug, lines, cnt);
609}
610
611/* Search function from function name */
612static int probefunc_callback(struct die_link *dlink, void *data)
613{
614 struct probe_finder *pf = (struct probe_finder *)data;
615 struct probe_point *pp = pf->pp;
616 struct die_link *lk;
617 Dwarf_Signed offs;
618 Dwarf_Half tag;
619 int ret;
620
621 ret = dwarf_tag(dlink->die, &tag, &__dw_error);
622 DIE_IF(ret == DW_DLV_ERROR);
623 if (tag == DW_TAG_subprogram) {
624 if (die_compare_name(dlink->die, pp->function) == 0) {
625 if (pp->line) { /* Function relative line */
626 pf->fno = die_get_decl_file(dlink->die);
627 pf->lno = die_get_decl_line(dlink->die)
628 + pp->line;
629 find_by_line(pf);
630 return 1;
631 }
632 if (die_inlined_subprogram(dlink->die)) {
633 /* Inlined function, save it. */
634 ret = dwarf_die_CU_offset(dlink->die,
635 &pf->inl_offs,
636 &__dw_error);
637 DIE_IF(ret != DW_DLV_OK);
638 pr_debug("inline definition offset %lld\n",
639 pf->inl_offs);
640 return 0; /* Continue to search */
641 }
642 /* Get probe address */
643 pf->addr = die_get_entrypc(dlink->die);
644 pf->addr += pp->offset;
645 /* TODO: Check the address in this function */
646 show_probepoint(dlink->die, pp->offset, pf);
647 return 1; /* Exit; no same symbol in this CU. */
648 }
649 } else if (tag == DW_TAG_inlined_subroutine && pf->inl_offs) {
650 if (die_get_abstract_origin(dlink->die) == pf->inl_offs) {
651 /* Get probe address */
652 pf->addr = die_get_entrypc(dlink->die);
653 pf->addr += pp->offset;
654 pr_debug("found inline addr: 0x%llx\n", pf->addr);
655 /* Inlined function. Get a real subprogram */
656 for (lk = dlink->parent; lk != NULL; lk = lk->parent) {
657 tag = 0;
658 dwarf_tag(lk->die, &tag, &__dw_error);
659 DIE_IF(ret == DW_DLV_ERROR);
660 if (tag == DW_TAG_subprogram &&
661 !die_inlined_subprogram(lk->die))
662 goto found;
663 }
664 die("Failed to find real subprogram.\n");
665found:
666 /* Get offset from subprogram */
667 ret = die_within_subprogram(lk->die, pf->addr, &offs);
668 DIE_IF(!ret);
669 show_probepoint(lk->die, offs, pf);
670 /* Continue to search */
671 }
672 }
673 return 0;
674}
675
676static void find_by_func(struct probe_finder *pf)
677{
678 search_die_from_children(pf->cu_die, probefunc_callback, pf);
679}
680
681/* Find a probe point */
682int find_probepoint(int fd, struct probe_point *pp)
683{
684 Dwarf_Half addr_size = 0;
685 Dwarf_Unsigned next_cuh = 0;
686 int cu_number = 0, ret;
687 struct probe_finder pf = {.pp = pp};
688
689 ret = dwarf_init(fd, DW_DLC_READ, 0, 0, &__dw_debug, &__dw_error);
690 if (ret != DW_DLV_OK) {
691 pr_warning("No dwarf info found in the vmlinux - please rebuild with CONFIG_DEBUG_INFO.\n");
692 return -ENOENT;
693 }
694
695 pp->found = 0;
696 while (++cu_number) {
697 /* Search CU (Compilation Unit) */
698 ret = dwarf_next_cu_header(__dw_debug, NULL, NULL, NULL,
699 &addr_size, &next_cuh, &__dw_error);
700 DIE_IF(ret == DW_DLV_ERROR);
701 if (ret == DW_DLV_NO_ENTRY)
702 break;
703
704 /* Get the DIE(Debugging Information Entry) of this CU */
705 ret = dwarf_siblingof(__dw_debug, 0, &pf.cu_die, &__dw_error);
706 DIE_IF(ret != DW_DLV_OK);
707
708 /* Check if target file is included. */
709 if (pp->file)
710 pf.fno = cu_find_fileno(pf.cu_die, pp->file);
711
712 if (!pp->file || pf.fno) {
713 /* Save CU base address (for frame_base) */
714 ret = dwarf_lowpc(pf.cu_die, &pf.cu_base, &__dw_error);
715 DIE_IF(ret == DW_DLV_ERROR);
716 if (ret == DW_DLV_NO_ENTRY)
717 pf.cu_base = 0;
718 if (pp->function)
719 find_by_func(&pf);
720 else {
721 pf.lno = pp->line;
722 find_by_line(&pf);
723 }
724 }
725 dwarf_dealloc(__dw_debug, pf.cu_die, DW_DLA_DIE);
726 }
727 ret = dwarf_finish(__dw_debug, &__dw_error);
728 DIE_IF(ret != DW_DLV_OK);
729
730 return pp->found;
731}
732
diff --git a/tools/perf/util/probe-finder.h b/tools/perf/util/probe-finder.h
new file mode 100644
index 000000000000..bdebca6697d2
--- /dev/null
+++ b/tools/perf/util/probe-finder.h
@@ -0,0 +1,57 @@
1#ifndef _PROBE_FINDER_H
2#define _PROBE_FINDER_H
3
4#define MAX_PATH_LEN 256
5#define MAX_PROBE_BUFFER 1024
6#define MAX_PROBES 128
7
8static inline int is_c_varname(const char *name)
9{
10 /* TODO */
11 return isalpha(name[0]) || name[0] == '_';
12}
13
14struct probe_point {
15 /* Inputs */
16 char *file; /* File name */
17 int line; /* Line number */
18
19 char *function; /* Function name */
20 int offset; /* Offset bytes */
21
22 int nr_args; /* Number of arguments */
23 char **args; /* Arguments */
24
25 int retprobe; /* Return probe */
26
27 /* Output */
28 int found; /* Number of found probe points */
29 char *probes[MAX_PROBES]; /* Output buffers (will be allocated)*/
30};
31
32#ifndef NO_LIBDWARF
33extern int find_probepoint(int fd, struct probe_point *pp);
34
35#include <libdwarf/dwarf.h>
36#include <libdwarf/libdwarf.h>
37
38struct probe_finder {
39 struct probe_point *pp; /* Target probe point */
40
41 /* For function searching */
42 Dwarf_Addr addr; /* Address */
43 Dwarf_Unsigned fno; /* File number */
44 Dwarf_Unsigned lno; /* Line number */
45 Dwarf_Off inl_offs; /* Inline offset */
46 Dwarf_Die cu_die; /* Current CU */
47
48 /* For variable searching */
49 Dwarf_Addr cu_base; /* Current CU base address */
50 Dwarf_Locdesc fbloc; /* Location of Current Frame Base */
51 const char *var; /* Current variable name */
52 char *buf; /* Current output buffer */
53 int len; /* Length of output buffer */
54};
55#endif /* NO_LIBDWARF */
56
57#endif /*_PROBE_FINDER_H */
diff --git a/tools/perf/util/quote.h b/tools/perf/util/quote.h
index a5454a1d1c13..b6a019733919 100644
--- a/tools/perf/util/quote.h
+++ b/tools/perf/util/quote.h
@@ -1,5 +1,5 @@
1#ifndef QUOTE_H 1#ifndef __PERF_QUOTE_H
2#define QUOTE_H 2#define __PERF_QUOTE_H
3 3
4#include <stddef.h> 4#include <stddef.h>
5#include <stdio.h> 5#include <stdio.h>
@@ -65,4 +65,4 @@ extern void perl_quote_print(FILE *stream, const char *src);
65extern void python_quote_print(FILE *stream, const char *src); 65extern void python_quote_print(FILE *stream, const char *src);
66extern void tcl_quote_print(FILE *stream, const char *src); 66extern void tcl_quote_print(FILE *stream, const char *src);
67 67
68#endif 68#endif /* __PERF_QUOTE_H */
diff --git a/tools/perf/util/run-command.h b/tools/perf/util/run-command.h
index cc1837deba88..d79028727ce2 100644
--- a/tools/perf/util/run-command.h
+++ b/tools/perf/util/run-command.h
@@ -1,5 +1,5 @@
1#ifndef RUN_COMMAND_H 1#ifndef __PERF_RUN_COMMAND_H
2#define RUN_COMMAND_H 2#define __PERF_RUN_COMMAND_H
3 3
4enum { 4enum {
5 ERR_RUN_COMMAND_FORK = 10000, 5 ERR_RUN_COMMAND_FORK = 10000,
@@ -85,4 +85,4 @@ struct async {
85int start_async(struct async *async); 85int start_async(struct async *async);
86int finish_async(struct async *async); 86int finish_async(struct async *async);
87 87
88#endif 88#endif /* __PERF_RUN_COMMAND_H */
diff --git a/tools/perf/util/sigchain.h b/tools/perf/util/sigchain.h
index 618083bce0c6..1a53c11265fd 100644
--- a/tools/perf/util/sigchain.h
+++ b/tools/perf/util/sigchain.h
@@ -1,5 +1,5 @@
1#ifndef SIGCHAIN_H 1#ifndef __PERF_SIGCHAIN_H
2#define SIGCHAIN_H 2#define __PERF_SIGCHAIN_H
3 3
4typedef void (*sigchain_fun)(int); 4typedef void (*sigchain_fun)(int);
5 5
@@ -8,4 +8,4 @@ int sigchain_pop(int sig);
8 8
9void sigchain_push_common(sigchain_fun f); 9void sigchain_push_common(sigchain_fun f);
10 10
11#endif /* SIGCHAIN_H */ 11#endif /* __PERF_SIGCHAIN_H */
diff --git a/tools/perf/util/sort.c b/tools/perf/util/sort.c
new file mode 100644
index 000000000000..b490354d1b23
--- /dev/null
+++ b/tools/perf/util/sort.c
@@ -0,0 +1,290 @@
1#include "sort.h"
2
3regex_t parent_regex;
4char default_parent_pattern[] = "^sys_|^do_page_fault";
5char *parent_pattern = default_parent_pattern;
6char default_sort_order[] = "comm,dso,symbol";
7char *sort_order = default_sort_order;
8int sort__need_collapse = 0;
9int sort__has_parent = 0;
10
11enum sort_type sort__first_dimension;
12
13unsigned int dsos__col_width;
14unsigned int comms__col_width;
15unsigned int threads__col_width;
16static unsigned int parent_symbol__col_width;
17char * field_sep;
18
19LIST_HEAD(hist_entry__sort_list);
20
21struct sort_entry sort_thread = {
22 .header = "Command: Pid",
23 .cmp = sort__thread_cmp,
24 .print = sort__thread_print,
25 .width = &threads__col_width,
26};
27
28struct sort_entry sort_comm = {
29 .header = "Command",
30 .cmp = sort__comm_cmp,
31 .collapse = sort__comm_collapse,
32 .print = sort__comm_print,
33 .width = &comms__col_width,
34};
35
36struct sort_entry sort_dso = {
37 .header = "Shared Object",
38 .cmp = sort__dso_cmp,
39 .print = sort__dso_print,
40 .width = &dsos__col_width,
41};
42
43struct sort_entry sort_sym = {
44 .header = "Symbol",
45 .cmp = sort__sym_cmp,
46 .print = sort__sym_print,
47};
48
49struct sort_entry sort_parent = {
50 .header = "Parent symbol",
51 .cmp = sort__parent_cmp,
52 .print = sort__parent_print,
53 .width = &parent_symbol__col_width,
54};
55
56struct sort_dimension {
57 const char *name;
58 struct sort_entry *entry;
59 int taken;
60};
61
62static struct sort_dimension sort_dimensions[] = {
63 { .name = "pid", .entry = &sort_thread, },
64 { .name = "comm", .entry = &sort_comm, },
65 { .name = "dso", .entry = &sort_dso, },
66 { .name = "symbol", .entry = &sort_sym, },
67 { .name = "parent", .entry = &sort_parent, },
68};
69
70int64_t cmp_null(void *l, void *r)
71{
72 if (!l && !r)
73 return 0;
74 else if (!l)
75 return -1;
76 else
77 return 1;
78}
79
80/* --sort pid */
81
82int64_t
83sort__thread_cmp(struct hist_entry *left, struct hist_entry *right)
84{
85 return right->thread->pid - left->thread->pid;
86}
87
88int repsep_fprintf(FILE *fp, const char *fmt, ...)
89{
90 int n;
91 va_list ap;
92
93 va_start(ap, fmt);
94 if (!field_sep)
95 n = vfprintf(fp, fmt, ap);
96 else {
97 char *bf = NULL;
98 n = vasprintf(&bf, fmt, ap);
99 if (n > 0) {
100 char *sep = bf;
101
102 while (1) {
103 sep = strchr(sep, *field_sep);
104 if (sep == NULL)
105 break;
106 *sep = '.';
107 }
108 }
109 fputs(bf, fp);
110 free(bf);
111 }
112 va_end(ap);
113 return n;
114}
115
116size_t
117sort__thread_print(FILE *fp, struct hist_entry *self, unsigned int width)
118{
119 return repsep_fprintf(fp, "%*s:%5d", width - 6,
120 self->thread->comm ?: "", self->thread->pid);
121}
122
123size_t
124sort__comm_print(FILE *fp, struct hist_entry *self, unsigned int width)
125{
126 return repsep_fprintf(fp, "%*s", width, self->thread->comm);
127}
128
129/* --sort dso */
130
131int64_t
132sort__dso_cmp(struct hist_entry *left, struct hist_entry *right)
133{
134 struct dso *dso_l = left->map ? left->map->dso : NULL;
135 struct dso *dso_r = right->map ? right->map->dso : NULL;
136 const char *dso_name_l, *dso_name_r;
137
138 if (!dso_l || !dso_r)
139 return cmp_null(dso_l, dso_r);
140
141 if (verbose) {
142 dso_name_l = dso_l->long_name;
143 dso_name_r = dso_r->long_name;
144 } else {
145 dso_name_l = dso_l->short_name;
146 dso_name_r = dso_r->short_name;
147 }
148
149 return strcmp(dso_name_l, dso_name_r);
150}
151
152size_t
153sort__dso_print(FILE *fp, struct hist_entry *self, unsigned int width)
154{
155 if (self->map && self->map->dso) {
156 const char *dso_name = !verbose ? self->map->dso->short_name :
157 self->map->dso->long_name;
158 return repsep_fprintf(fp, "%-*s", width, dso_name);
159 }
160
161 return repsep_fprintf(fp, "%*llx", width, (u64)self->ip);
162}
163
164/* --sort symbol */
165
166int64_t
167sort__sym_cmp(struct hist_entry *left, struct hist_entry *right)
168{
169 u64 ip_l, ip_r;
170
171 if (left->sym == right->sym)
172 return 0;
173
174 ip_l = left->sym ? left->sym->start : left->ip;
175 ip_r = right->sym ? right->sym->start : right->ip;
176
177 return (int64_t)(ip_r - ip_l);
178}
179
180
181size_t
182sort__sym_print(FILE *fp, struct hist_entry *self, unsigned int width __used)
183{
184 size_t ret = 0;
185
186 if (verbose) {
187 char o = self->map ? dso__symtab_origin(self->map->dso) : '!';
188 ret += repsep_fprintf(fp, "%#018llx %c ", (u64)self->ip, o);
189 }
190
191 ret += repsep_fprintf(fp, "[%c] ", self->level);
192 if (self->sym)
193 ret += repsep_fprintf(fp, "%s", self->sym->name);
194 else
195 ret += repsep_fprintf(fp, "%#016llx", (u64)self->ip);
196
197 return ret;
198}
199
200/* --sort comm */
201
202int64_t
203sort__comm_cmp(struct hist_entry *left, struct hist_entry *right)
204{
205 return right->thread->pid - left->thread->pid;
206}
207
208int64_t
209sort__comm_collapse(struct hist_entry *left, struct hist_entry *right)
210{
211 char *comm_l = left->thread->comm;
212 char *comm_r = right->thread->comm;
213
214 if (!comm_l || !comm_r)
215 return cmp_null(comm_l, comm_r);
216
217 return strcmp(comm_l, comm_r);
218}
219
220/* --sort parent */
221
222int64_t
223sort__parent_cmp(struct hist_entry *left, struct hist_entry *right)
224{
225 struct symbol *sym_l = left->parent;
226 struct symbol *sym_r = right->parent;
227
228 if (!sym_l || !sym_r)
229 return cmp_null(sym_l, sym_r);
230
231 return strcmp(sym_l->name, sym_r->name);
232}
233
234size_t
235sort__parent_print(FILE *fp, struct hist_entry *self, unsigned int width)
236{
237 return repsep_fprintf(fp, "%-*s", width,
238 self->parent ? self->parent->name : "[other]");
239}
240
241int sort_dimension__add(const char *tok)
242{
243 unsigned int i;
244
245 for (i = 0; i < ARRAY_SIZE(sort_dimensions); i++) {
246 struct sort_dimension *sd = &sort_dimensions[i];
247
248 if (sd->taken)
249 continue;
250
251 if (strncasecmp(tok, sd->name, strlen(tok)))
252 continue;
253
254 if (sd->entry->collapse)
255 sort__need_collapse = 1;
256
257 if (sd->entry == &sort_parent) {
258 int ret = regcomp(&parent_regex, parent_pattern, REG_EXTENDED);
259 if (ret) {
260 char err[BUFSIZ];
261
262 regerror(ret, &parent_regex, err, sizeof(err));
263 fprintf(stderr, "Invalid regex: %s\n%s",
264 parent_pattern, err);
265 exit(-1);
266 }
267 sort__has_parent = 1;
268 }
269
270 if (list_empty(&hist_entry__sort_list)) {
271 if (!strcmp(sd->name, "pid"))
272 sort__first_dimension = SORT_PID;
273 else if (!strcmp(sd->name, "comm"))
274 sort__first_dimension = SORT_COMM;
275 else if (!strcmp(sd->name, "dso"))
276 sort__first_dimension = SORT_DSO;
277 else if (!strcmp(sd->name, "symbol"))
278 sort__first_dimension = SORT_SYM;
279 else if (!strcmp(sd->name, "parent"))
280 sort__first_dimension = SORT_PARENT;
281 }
282
283 list_add_tail(&sd->entry->list, &hist_entry__sort_list);
284 sd->taken = 1;
285
286 return 0;
287 }
288
289 return -ESRCH;
290}
diff --git a/tools/perf/util/sort.h b/tools/perf/util/sort.h
new file mode 100644
index 000000000000..333e664ff45f
--- /dev/null
+++ b/tools/perf/util/sort.h
@@ -0,0 +1,99 @@
1#ifndef __PERF_SORT_H
2#define __PERF_SORT_H
3#include "../builtin.h"
4
5#include "util.h"
6
7#include "color.h"
8#include <linux/list.h>
9#include "cache.h"
10#include <linux/rbtree.h>
11#include "symbol.h"
12#include "string.h"
13#include "callchain.h"
14#include "strlist.h"
15#include "values.h"
16
17#include "../perf.h"
18#include "debug.h"
19#include "header.h"
20
21#include "parse-options.h"
22#include "parse-events.h"
23
24#include "thread.h"
25#include "sort.h"
26
27extern regex_t parent_regex;
28extern char *sort_order;
29extern char default_parent_pattern[];
30extern char *parent_pattern;
31extern char default_sort_order[];
32extern int sort__need_collapse;
33extern int sort__has_parent;
34extern char *field_sep;
35extern struct sort_entry sort_comm;
36extern struct sort_entry sort_dso;
37extern struct sort_entry sort_sym;
38extern struct sort_entry sort_parent;
39extern unsigned int dsos__col_width;
40extern unsigned int comms__col_width;
41extern unsigned int threads__col_width;
42extern enum sort_type sort__first_dimension;
43
44struct hist_entry {
45 struct rb_node rb_node;
46 u64 count;
47 struct thread *thread;
48 struct map *map;
49 struct symbol *sym;
50 u64 ip;
51 char level;
52 struct symbol *parent;
53 struct callchain_node callchain;
54 struct rb_root sorted_chain;
55};
56
57enum sort_type {
58 SORT_PID,
59 SORT_COMM,
60 SORT_DSO,
61 SORT_SYM,
62 SORT_PARENT
63};
64
65/*
66 * configurable sorting bits
67 */
68
69struct sort_entry {
70 struct list_head list;
71
72 const char *header;
73
74 int64_t (*cmp)(struct hist_entry *, struct hist_entry *);
75 int64_t (*collapse)(struct hist_entry *, struct hist_entry *);
76 size_t (*print)(FILE *fp, struct hist_entry *, unsigned int width);
77 unsigned int *width;
78 bool elide;
79};
80
81extern struct sort_entry sort_thread;
82extern struct list_head hist_entry__sort_list;
83
84extern int repsep_fprintf(FILE *fp, const char *fmt, ...);
85extern size_t sort__thread_print(FILE *, struct hist_entry *, unsigned int);
86extern size_t sort__comm_print(FILE *, struct hist_entry *, unsigned int);
87extern size_t sort__dso_print(FILE *, struct hist_entry *, unsigned int);
88extern size_t sort__sym_print(FILE *, struct hist_entry *, unsigned int __used);
89extern int64_t cmp_null(void *, void *);
90extern int64_t sort__thread_cmp(struct hist_entry *, struct hist_entry *);
91extern int64_t sort__comm_cmp(struct hist_entry *, struct hist_entry *);
92extern int64_t sort__comm_collapse(struct hist_entry *, struct hist_entry *);
93extern int64_t sort__dso_cmp(struct hist_entry *, struct hist_entry *);
94extern int64_t sort__sym_cmp(struct hist_entry *, struct hist_entry *);
95extern int64_t sort__parent_cmp(struct hist_entry *, struct hist_entry *);
96extern size_t sort__parent_print(FILE *, struct hist_entry *, unsigned int);
97extern int sort_dimension__add(const char *);
98
99#endif /* __PERF_SORT_H */
diff --git a/tools/perf/util/strbuf.h b/tools/perf/util/strbuf.h
index d2aa86c014c1..a3d121d6c83e 100644
--- a/tools/perf/util/strbuf.h
+++ b/tools/perf/util/strbuf.h
@@ -1,5 +1,5 @@
1#ifndef STRBUF_H 1#ifndef __PERF_STRBUF_H
2#define STRBUF_H 2#define __PERF_STRBUF_H
3 3
4/* 4/*
5 * Strbuf's can be use in many ways: as a byte array, or to store arbitrary 5 * Strbuf's can be use in many ways: as a byte array, or to store arbitrary
@@ -134,4 +134,4 @@ extern int launch_editor(const char *path, struct strbuf *buffer, const char *co
134extern int strbuf_branchname(struct strbuf *sb, const char *name); 134extern int strbuf_branchname(struct strbuf *sb, const char *name);
135extern int strbuf_check_branch_ref(struct strbuf *sb, const char *name); 135extern int strbuf_check_branch_ref(struct strbuf *sb, const char *name);
136 136
137#endif /* STRBUF_H */ 137#endif /* __PERF_STRBUF_H */
diff --git a/tools/perf/util/string.c b/tools/perf/util/string.c
index c93eca9a7be3..f24a8cc933d5 100644
--- a/tools/perf/util/string.c
+++ b/tools/perf/util/string.c
@@ -1,4 +1,5 @@
1#include "string.h" 1#include "string.h"
2#include "util.h"
2 3
3static int hex(char ch) 4static int hex(char ch)
4{ 5{
@@ -32,3 +33,196 @@ int hex2u64(const char *ptr, u64 *long_val)
32 33
33 return p - ptr; 34 return p - ptr;
34} 35}
36
37char *strxfrchar(char *s, char from, char to)
38{
39 char *p = s;
40
41 while ((p = strchr(p, from)) != NULL)
42 *p++ = to;
43
44 return s;
45}
46
47#define K 1024LL
48/*
49 * perf_atoll()
50 * Parse (\d+)(b|B|kb|KB|mb|MB|gb|GB|tb|TB) (e.g. "256MB")
51 * and return its numeric value
52 */
53s64 perf_atoll(const char *str)
54{
55 unsigned int i;
56 s64 length = -1, unit = 1;
57
58 if (!isdigit(str[0]))
59 goto out_err;
60
61 for (i = 1; i < strlen(str); i++) {
62 switch (str[i]) {
63 case 'B':
64 case 'b':
65 break;
66 case 'K':
67 if (str[i + 1] != 'B')
68 goto out_err;
69 else
70 goto kilo;
71 case 'k':
72 if (str[i + 1] != 'b')
73 goto out_err;
74kilo:
75 unit = K;
76 break;
77 case 'M':
78 if (str[i + 1] != 'B')
79 goto out_err;
80 else
81 goto mega;
82 case 'm':
83 if (str[i + 1] != 'b')
84 goto out_err;
85mega:
86 unit = K * K;
87 break;
88 case 'G':
89 if (str[i + 1] != 'B')
90 goto out_err;
91 else
92 goto giga;
93 case 'g':
94 if (str[i + 1] != 'b')
95 goto out_err;
96giga:
97 unit = K * K * K;
98 break;
99 case 'T':
100 if (str[i + 1] != 'B')
101 goto out_err;
102 else
103 goto tera;
104 case 't':
105 if (str[i + 1] != 'b')
106 goto out_err;
107tera:
108 unit = K * K * K * K;
109 break;
110 case '\0': /* only specified figures */
111 unit = 1;
112 break;
113 default:
114 if (!isdigit(str[i]))
115 goto out_err;
116 break;
117 }
118 }
119
120 length = atoll(str) * unit;
121 goto out;
122
123out_err:
124 length = -1;
125out:
126 return length;
127}
128
129/*
130 * Helper function for splitting a string into an argv-like array.
131 * originaly copied from lib/argv_split.c
132 */
133static const char *skip_sep(const char *cp)
134{
135 while (*cp && isspace(*cp))
136 cp++;
137
138 return cp;
139}
140
141static const char *skip_arg(const char *cp)
142{
143 while (*cp && !isspace(*cp))
144 cp++;
145
146 return cp;
147}
148
149static int count_argc(const char *str)
150{
151 int count = 0;
152
153 while (*str) {
154 str = skip_sep(str);
155 if (*str) {
156 count++;
157 str = skip_arg(str);
158 }
159 }
160
161 return count;
162}
163
164/**
165 * argv_free - free an argv
166 * @argv - the argument vector to be freed
167 *
168 * Frees an argv and the strings it points to.
169 */
170void argv_free(char **argv)
171{
172 char **p;
173 for (p = argv; *p; p++)
174 free(*p);
175
176 free(argv);
177}
178
179/**
180 * argv_split - split a string at whitespace, returning an argv
181 * @str: the string to be split
182 * @argcp: returned argument count
183 *
184 * Returns an array of pointers to strings which are split out from
185 * @str. This is performed by strictly splitting on white-space; no
186 * quote processing is performed. Multiple whitespace characters are
187 * considered to be a single argument separator. The returned array
188 * is always NULL-terminated. Returns NULL on memory allocation
189 * failure.
190 */
191char **argv_split(const char *str, int *argcp)
192{
193 int argc = count_argc(str);
194 char **argv = zalloc(sizeof(*argv) * (argc+1));
195 char **argvp;
196
197 if (argv == NULL)
198 goto out;
199
200 if (argcp)
201 *argcp = argc;
202
203 argvp = argv;
204
205 while (*str) {
206 str = skip_sep(str);
207
208 if (*str) {
209 const char *p = str;
210 char *t;
211
212 str = skip_arg(str);
213
214 t = strndup(p, str-p);
215 if (t == NULL)
216 goto fail;
217 *argvp++ = t;
218 }
219 }
220 *argvp = NULL;
221
222out:
223 return argv;
224
225fail:
226 argv_free(argv);
227 return NULL;
228}
diff --git a/tools/perf/util/string.h b/tools/perf/util/string.h
index bf39dfadfd24..bfecec265a1a 100644
--- a/tools/perf/util/string.h
+++ b/tools/perf/util/string.h
@@ -1,11 +1,15 @@
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);
7char *strxfrchar(char *s, char from, char to);
8s64 perf_atoll(const char *str);
9char **argv_split(const char *str, int *argcp);
10void argv_free(char **argv);
7 11
8#define _STR(x) #x 12#define _STR(x) #x
9#define STR(x) _STR(x) 13#define STR(x) _STR(x)
10 14
11#endif 15#endif /* __PERF_STRING_H */
diff --git a/tools/perf/util/strlist.h b/tools/perf/util/strlist.h
index 921818e44a54..cb4659306d7b 100644
--- a/tools/perf/util/strlist.h
+++ b/tools/perf/util/strlist.h
@@ -1,5 +1,5 @@
1#ifndef STRLIST_H_ 1#ifndef __PERF_STRLIST_H
2#define STRLIST_H_ 2#define __PERF_STRLIST_H
3 3
4#include <linux/rbtree.h> 4#include <linux/rbtree.h>
5#include <stdbool.h> 5#include <stdbool.h>
@@ -36,4 +36,4 @@ static inline unsigned int strlist__nr_entries(const struct strlist *self)
36} 36}
37 37
38int strlist__parse_list(struct strlist *self, const char *s); 38int strlist__parse_list(struct strlist *self, const char *s);
39#endif /* STRLIST_H_ */ 39#endif /* __PERF_STRLIST_H */
diff --git a/tools/perf/util/svghelper.h b/tools/perf/util/svghelper.h
index cd93195aedb3..e0781989cc31 100644
--- a/tools/perf/util/svghelper.h
+++ b/tools/perf/util/svghelper.h
@@ -1,5 +1,5 @@
1#ifndef _INCLUDE_GUARD_SVG_HELPER_ 1#ifndef __PERF_SVGHELPER_H
2#define _INCLUDE_GUARD_SVG_HELPER_ 2#define __PERF_SVGHELPER_H
3 3
4#include "types.h" 4#include "types.h"
5 5
@@ -25,4 +25,4 @@ extern void svg_close(void);
25 25
26extern int svg_page_width; 26extern int svg_page_width;
27 27
28#endif 28#endif /* __PERF_SVGHELPER_H */
diff --git a/tools/perf/util/symbol.c b/tools/perf/util/symbol.c
index 226f44a2357d..fffcb937cdcb 100644
--- a/tools/perf/util/symbol.c
+++ b/tools/perf/util/symbol.c
@@ -2,14 +2,20 @@
2#include "../perf.h" 2#include "../perf.h"
3#include "string.h" 3#include "string.h"
4#include "symbol.h" 4#include "symbol.h"
5#include "thread.h"
5 6
6#include "debug.h" 7#include "debug.h"
7 8
9#include <asm/bug.h>
8#include <libelf.h> 10#include <libelf.h>
9#include <gelf.h> 11#include <gelf.h>
10#include <elf.h> 12#include <elf.h>
13#include <limits.h>
14#include <sys/utsname.h>
11 15
12const char *sym_hist_filter; 16#ifndef NT_GNU_BUILD_ID
17#define NT_GNU_BUILD_ID 3
18#endif
13 19
14enum dso_origin { 20enum dso_origin {
15 DSO__ORIG_KERNEL = 0, 21 DSO__ORIG_KERNEL = 0,
@@ -18,94 +24,189 @@ enum dso_origin {
18 DSO__ORIG_UBUNTU, 24 DSO__ORIG_UBUNTU,
19 DSO__ORIG_BUILDID, 25 DSO__ORIG_BUILDID,
20 DSO__ORIG_DSO, 26 DSO__ORIG_DSO,
27 DSO__ORIG_KMODULE,
21 DSO__ORIG_NOT_FOUND, 28 DSO__ORIG_NOT_FOUND,
22}; 29};
23 30
24static struct symbol *symbol__new(u64 start, u64 len, 31static void dsos__add(struct list_head *head, struct dso *dso);
25 const char *name, unsigned int priv_size, 32static struct map *thread__find_map_by_name(struct thread *self, char *name);
26 u64 obj_start, int v) 33static struct map *map__new2(u64 start, struct dso *dso, enum map_type type);
34struct symbol *dso__find_symbol(struct dso *self, enum map_type type, u64 addr);
35static int dso__load_kernel_sym(struct dso *self, struct map *map,
36 struct thread *thread, symbol_filter_t filter);
37unsigned int symbol__priv_size;
38static int vmlinux_path__nr_entries;
39static char **vmlinux_path;
40
41static struct symbol_conf symbol_conf__defaults = {
42 .use_modules = true,
43 .try_vmlinux_path = true,
44};
45
46static struct thread kthread_mem;
47struct thread *kthread = &kthread_mem;
48
49bool dso__loaded(const struct dso *self, enum map_type type)
27{ 50{
28 size_t namelen = strlen(name) + 1; 51 return self->loaded & (1 << type);
29 struct symbol *self = calloc(1, priv_size + sizeof(*self) + namelen); 52}
30 53
31 if (!self) 54static void dso__set_loaded(struct dso *self, enum map_type type)
32 return NULL; 55{
56 self->loaded |= (1 << type);
57}
33 58
34 if (v >= 2) 59static void symbols__fixup_end(struct rb_root *self)
35 printf("new symbol: %016Lx [%08lx]: %s, hist: %p, obj_start: %p\n", 60{
36 (u64)start, (unsigned long)len, name, self->hist, (void *)(unsigned long)obj_start); 61 struct rb_node *nd, *prevnd = rb_first(self);
62 struct symbol *curr, *prev;
63
64 if (prevnd == NULL)
65 return;
37 66
38 self->obj_start= obj_start; 67 curr = rb_entry(prevnd, struct symbol, rb_node);
39 self->hist = NULL;
40 self->hist_sum = 0;
41 68
42 if (sym_hist_filter && !strcmp(name, sym_hist_filter)) 69 for (nd = rb_next(prevnd); nd; nd = rb_next(nd)) {
43 self->hist = calloc(sizeof(u64), len); 70 prev = curr;
71 curr = rb_entry(nd, struct symbol, rb_node);
44 72
45 if (priv_size) { 73 if (prev->end == prev->start)
46 memset(self, 0, priv_size); 74 prev->end = curr->start - 1;
47 self = ((void *)self) + priv_size;
48 } 75 }
76
77 /* Last entry */
78 if (curr->end == curr->start)
79 curr->end = roundup(curr->start, 4096);
80}
81
82static void __thread__fixup_maps_end(struct thread *self, enum map_type type)
83{
84 struct map *prev, *curr;
85 struct rb_node *nd, *prevnd = rb_first(&self->maps[type]);
86
87 if (prevnd == NULL)
88 return;
89
90 curr = rb_entry(prevnd, struct map, rb_node);
91
92 for (nd = rb_next(prevnd); nd; nd = rb_next(nd)) {
93 prev = curr;
94 curr = rb_entry(nd, struct map, rb_node);
95 prev->end = curr->start - 1;
96 }
97
98 /*
99 * We still haven't the actual symbols, so guess the
100 * last map final address.
101 */
102 curr->end = ~0UL;
103}
104
105static void thread__fixup_maps_end(struct thread *self)
106{
107 int i;
108 for (i = 0; i < MAP__NR_TYPES; ++i)
109 __thread__fixup_maps_end(self, i);
110}
111
112static struct symbol *symbol__new(u64 start, u64 len, const char *name)
113{
114 size_t namelen = strlen(name) + 1;
115 struct symbol *self = zalloc(symbol__priv_size +
116 sizeof(*self) + namelen);
117 if (self == NULL)
118 return NULL;
119
120 if (symbol__priv_size)
121 self = ((void *)self) + symbol__priv_size;
122
49 self->start = start; 123 self->start = start;
50 self->end = len ? start + len - 1 : start; 124 self->end = len ? start + len - 1 : start;
125
126 pr_debug3("%s: %s %#Lx-%#Lx\n", __func__, name, start, self->end);
127
51 memcpy(self->name, name, namelen); 128 memcpy(self->name, name, namelen);
52 129
53 return self; 130 return self;
54} 131}
55 132
56static void symbol__delete(struct symbol *self, unsigned int priv_size) 133static void symbol__delete(struct symbol *self)
57{ 134{
58 free(((void *)self) - priv_size); 135 free(((void *)self) - symbol__priv_size);
59} 136}
60 137
61static size_t symbol__fprintf(struct symbol *self, FILE *fp) 138static size_t symbol__fprintf(struct symbol *self, FILE *fp)
62{ 139{
63 if (!self->module) 140 return fprintf(fp, " %llx-%llx %s\n",
64 return fprintf(fp, " %llx-%llx %s\n",
65 self->start, self->end, self->name); 141 self->start, self->end, self->name);
66 else
67 return fprintf(fp, " %llx-%llx %s \t[%s]\n",
68 self->start, self->end, self->name, self->module->name);
69} 142}
70 143
71struct dso *dso__new(const char *name, unsigned int sym_priv_size) 144static void dso__set_long_name(struct dso *self, char *name)
145{
146 if (name == NULL)
147 return;
148 self->long_name = name;
149 self->long_name_len = strlen(name);
150}
151
152static void dso__set_basename(struct dso *self)
153{
154 self->short_name = basename(self->long_name);
155}
156
157struct dso *dso__new(const char *name)
72{ 158{
73 struct dso *self = malloc(sizeof(*self) + strlen(name) + 1); 159 struct dso *self = malloc(sizeof(*self) + strlen(name) + 1);
74 160
75 if (self != NULL) { 161 if (self != NULL) {
162 int i;
76 strcpy(self->name, name); 163 strcpy(self->name, name);
77 self->syms = RB_ROOT; 164 dso__set_long_name(self, self->name);
78 self->sym_priv_size = sym_priv_size; 165 self->short_name = self->name;
166 for (i = 0; i < MAP__NR_TYPES; ++i)
167 self->symbols[i] = RB_ROOT;
79 self->find_symbol = dso__find_symbol; 168 self->find_symbol = dso__find_symbol;
80 self->slen_calculated = 0; 169 self->slen_calculated = 0;
81 self->origin = DSO__ORIG_NOT_FOUND; 170 self->origin = DSO__ORIG_NOT_FOUND;
171 self->loaded = 0;
172 self->has_build_id = 0;
82 } 173 }
83 174
84 return self; 175 return self;
85} 176}
86 177
87static void dso__delete_symbols(struct dso *self) 178static void symbols__delete(struct rb_root *self)
88{ 179{
89 struct symbol *pos; 180 struct symbol *pos;
90 struct rb_node *next = rb_first(&self->syms); 181 struct rb_node *next = rb_first(self);
91 182
92 while (next) { 183 while (next) {
93 pos = rb_entry(next, struct symbol, rb_node); 184 pos = rb_entry(next, struct symbol, rb_node);
94 next = rb_next(&pos->rb_node); 185 next = rb_next(&pos->rb_node);
95 rb_erase(&pos->rb_node, &self->syms); 186 rb_erase(&pos->rb_node, self);
96 symbol__delete(pos, self->sym_priv_size); 187 symbol__delete(pos);
97 } 188 }
98} 189}
99 190
100void dso__delete(struct dso *self) 191void dso__delete(struct dso *self)
101{ 192{
102 dso__delete_symbols(self); 193 int i;
194 for (i = 0; i < MAP__NR_TYPES; ++i)
195 symbols__delete(&self->symbols[i]);
196 if (self->long_name != self->name)
197 free(self->long_name);
103 free(self); 198 free(self);
104} 199}
105 200
106static void dso__insert_symbol(struct dso *self, struct symbol *sym) 201void dso__set_build_id(struct dso *self, void *build_id)
107{ 202{
108 struct rb_node **p = &self->syms.rb_node; 203 memcpy(self->build_id, build_id, sizeof(self->build_id));
204 self->has_build_id = 1;
205}
206
207static void symbols__insert(struct rb_root *self, struct symbol *sym)
208{
209 struct rb_node **p = &self->rb_node;
109 struct rb_node *parent = NULL; 210 struct rb_node *parent = NULL;
110 const u64 ip = sym->start; 211 const u64 ip = sym->start;
111 struct symbol *s; 212 struct symbol *s;
@@ -119,17 +220,17 @@ static void dso__insert_symbol(struct dso *self, struct symbol *sym)
119 p = &(*p)->rb_right; 220 p = &(*p)->rb_right;
120 } 221 }
121 rb_link_node(&sym->rb_node, parent, p); 222 rb_link_node(&sym->rb_node, parent, p);
122 rb_insert_color(&sym->rb_node, &self->syms); 223 rb_insert_color(&sym->rb_node, self);
123} 224}
124 225
125struct symbol *dso__find_symbol(struct dso *self, u64 ip) 226static struct symbol *symbols__find(struct rb_root *self, u64 ip)
126{ 227{
127 struct rb_node *n; 228 struct rb_node *n;
128 229
129 if (self == NULL) 230 if (self == NULL)
130 return NULL; 231 return NULL;
131 232
132 n = self->syms.rb_node; 233 n = self->rb_node;
133 234
134 while (n) { 235 while (n) {
135 struct symbol *s = rb_entry(n, struct symbol, rb_node); 236 struct symbol *s = rb_entry(n, struct symbol, rb_node);
@@ -145,12 +246,42 @@ struct symbol *dso__find_symbol(struct dso *self, u64 ip)
145 return NULL; 246 return NULL;
146} 247}
147 248
148size_t dso__fprintf(struct dso *self, FILE *fp) 249struct symbol *dso__find_symbol(struct dso *self, enum map_type type, u64 addr)
149{ 250{
150 size_t ret = fprintf(fp, "dso: %s\n", self->name); 251 return symbols__find(&self->symbols[type], addr);
252}
253
254int build_id__sprintf(u8 *self, int len, char *bf)
255{
256 char *bid = bf;
257 u8 *raw = self;
258 int i;
259
260 for (i = 0; i < len; ++i) {
261 sprintf(bid, "%02x", *raw);
262 ++raw;
263 bid += 2;
264 }
265
266 return raw - self;
267}
268
269size_t dso__fprintf_buildid(struct dso *self, FILE *fp)
270{
271 char sbuild_id[BUILD_ID_SIZE * 2 + 1];
272
273 build_id__sprintf(self->build_id, sizeof(self->build_id), sbuild_id);
274 return fprintf(fp, "%s", sbuild_id);
275}
151 276
277size_t dso__fprintf(struct dso *self, enum map_type type, FILE *fp)
278{
152 struct rb_node *nd; 279 struct rb_node *nd;
153 for (nd = rb_first(&self->syms); nd; nd = rb_next(nd)) { 280 size_t ret = fprintf(fp, "dso: %s (", self->short_name);
281
282 ret += dso__fprintf_buildid(self, fp);
283 ret += fprintf(fp, ")\n");
284 for (nd = rb_first(&self->symbols[type]); nd; nd = rb_next(nd)) {
154 struct symbol *pos = rb_entry(nd, struct symbol, rb_node); 285 struct symbol *pos = rb_entry(nd, struct symbol, rb_node);
155 ret += symbol__fprintf(pos, fp); 286 ret += symbol__fprintf(pos, fp);
156 } 287 }
@@ -158,13 +289,17 @@ size_t dso__fprintf(struct dso *self, FILE *fp)
158 return ret; 289 return ret;
159} 290}
160 291
161static int dso__load_kallsyms(struct dso *self, symbol_filter_t filter, int v) 292/*
293 * Loads the function entries in /proc/kallsyms into kernel_map->dso,
294 * so that we can in the next step set the symbol ->end address and then
295 * call kernel_maps__split_kallsyms.
296 */
297static int dso__load_all_kallsyms(struct dso *self, struct map *map)
162{ 298{
163 struct rb_node *nd, *prevnd;
164 char *line = NULL; 299 char *line = NULL;
165 size_t n; 300 size_t n;
301 struct rb_root *root = &self->symbols[map->type];
166 FILE *file = fopen("/proc/kallsyms", "r"); 302 FILE *file = fopen("/proc/kallsyms", "r");
167 int count = 0;
168 303
169 if (file == NULL) 304 if (file == NULL)
170 goto out_failure; 305 goto out_failure;
@@ -174,6 +309,7 @@ static int dso__load_kallsyms(struct dso *self, symbol_filter_t filter, int v)
174 struct symbol *sym; 309 struct symbol *sym;
175 int line_len, len; 310 int line_len, len;
176 char symbol_type; 311 char symbol_type;
312 char *symbol_name;
177 313
178 line_len = getline(&line, &n, file); 314 line_len = getline(&line, &n, file);
179 if (line_len < 0) 315 if (line_len < 0)
@@ -196,44 +332,26 @@ static int dso__load_kallsyms(struct dso *self, symbol_filter_t filter, int v)
196 */ 332 */
197 if (symbol_type != 'T' && symbol_type != 'W') 333 if (symbol_type != 'T' && symbol_type != 'W')
198 continue; 334 continue;
335
336 symbol_name = line + len + 2;
199 /* 337 /*
200 * Well fix up the end later, when we have all sorted. 338 * Will fix up the end later, when we have all symbols sorted.
201 */ 339 */
202 sym = symbol__new(start, 0xdead, line + len + 2, 340 sym = symbol__new(start, 0, symbol_name);
203 self->sym_priv_size, 0, v);
204 341
205 if (sym == NULL) 342 if (sym == NULL)
206 goto out_delete_line; 343 goto out_delete_line;
207 344 /*
208 if (filter && filter(self, sym)) 345 * We will pass the symbols to the filter later, in
209 symbol__delete(sym, self->sym_priv_size); 346 * map__split_kallsyms, when we have split the maps per module
210 else { 347 */
211 dso__insert_symbol(self, sym); 348 symbols__insert(root, sym);
212 count++;
213 }
214 }
215
216 /*
217 * Now that we have all sorted out, just set the ->end of all
218 * symbols
219 */
220 prevnd = rb_first(&self->syms);
221
222 if (prevnd == NULL)
223 goto out_delete_line;
224
225 for (nd = rb_next(prevnd); nd; nd = rb_next(nd)) {
226 struct symbol *prev = rb_entry(prevnd, struct symbol, rb_node),
227 *curr = rb_entry(nd, struct symbol, rb_node);
228
229 prev->end = curr->start - 1;
230 prevnd = nd;
231 } 349 }
232 350
233 free(line); 351 free(line);
234 fclose(file); 352 fclose(file);
235 353
236 return count; 354 return 0;
237 355
238out_delete_line: 356out_delete_line:
239 free(line); 357 free(line);
@@ -241,14 +359,114 @@ out_failure:
241 return -1; 359 return -1;
242} 360}
243 361
244static int dso__load_perf_map(struct dso *self, symbol_filter_t filter, int v) 362/*
363 * Split the symbols into maps, making sure there are no overlaps, i.e. the
364 * kernel range is broken in several maps, named [kernel].N, as we don't have
365 * the original ELF section names vmlinux have.
366 */
367static int dso__split_kallsyms(struct dso *self, struct map *map, struct thread *thread,
368 symbol_filter_t filter)
369{
370 struct map *curr_map = map;
371 struct symbol *pos;
372 int count = 0;
373 struct rb_root *root = &self->symbols[map->type];
374 struct rb_node *next = rb_first(root);
375 int kernel_range = 0;
376
377 while (next) {
378 char *module;
379
380 pos = rb_entry(next, struct symbol, rb_node);
381 next = rb_next(&pos->rb_node);
382
383 module = strchr(pos->name, '\t');
384 if (module) {
385 if (!thread->use_modules)
386 goto discard_symbol;
387
388 *module++ = '\0';
389
390 if (strcmp(self->name, module)) {
391 curr_map = thread__find_map_by_name(thread, module);
392 if (curr_map == NULL) {
393 pr_debug("/proc/{kallsyms,modules} "
394 "inconsistency!\n");
395 return -1;
396 }
397 }
398 /*
399 * So that we look just like we get from .ko files,
400 * i.e. not prelinked, relative to map->start.
401 */
402 pos->start = curr_map->map_ip(curr_map, pos->start);
403 pos->end = curr_map->map_ip(curr_map, pos->end);
404 } else if (curr_map != map) {
405 char dso_name[PATH_MAX];
406 struct dso *dso;
407
408 snprintf(dso_name, sizeof(dso_name), "[kernel].%d",
409 kernel_range++);
410
411 dso = dso__new(dso_name);
412 if (dso == NULL)
413 return -1;
414
415 curr_map = map__new2(pos->start, dso, map->type);
416 if (map == NULL) {
417 dso__delete(dso);
418 return -1;
419 }
420
421 curr_map->map_ip = curr_map->unmap_ip = identity__map_ip;
422 __thread__insert_map(thread, curr_map);
423 ++kernel_range;
424 }
425
426 if (filter && filter(curr_map, pos)) {
427discard_symbol: rb_erase(&pos->rb_node, root);
428 symbol__delete(pos);
429 } else {
430 if (curr_map != map) {
431 rb_erase(&pos->rb_node, root);
432 symbols__insert(&curr_map->dso->symbols[curr_map->type], pos);
433 }
434 count++;
435 }
436 }
437
438 return count;
439}
440
441
442static int dso__load_kallsyms(struct dso *self, struct map *map,
443 struct thread *thread, symbol_filter_t filter)
444{
445 if (dso__load_all_kallsyms(self, map) < 0)
446 return -1;
447
448 symbols__fixup_end(&self->symbols[map->type]);
449 self->origin = DSO__ORIG_KERNEL;
450
451 return dso__split_kallsyms(self, map, thread, filter);
452}
453
454size_t kernel_maps__fprintf(FILE *fp)
455{
456 size_t printed = fprintf(fp, "Kernel maps:\n");
457 printed += thread__fprintf_maps(kthread, fp);
458 return printed + fprintf(fp, "END kernel maps\n");
459}
460
461static int dso__load_perf_map(struct dso *self, struct map *map,
462 symbol_filter_t filter)
245{ 463{
246 char *line = NULL; 464 char *line = NULL;
247 size_t n; 465 size_t n;
248 FILE *file; 466 FILE *file;
249 int nr_syms = 0; 467 int nr_syms = 0;
250 468
251 file = fopen(self->name, "r"); 469 file = fopen(self->long_name, "r");
252 if (file == NULL) 470 if (file == NULL)
253 goto out_failure; 471 goto out_failure;
254 472
@@ -278,16 +496,15 @@ static int dso__load_perf_map(struct dso *self, symbol_filter_t filter, int v)
278 if (len + 2 >= line_len) 496 if (len + 2 >= line_len)
279 continue; 497 continue;
280 498
281 sym = symbol__new(start, size, line + len, 499 sym = symbol__new(start, size, line + len);
282 self->sym_priv_size, start, v);
283 500
284 if (sym == NULL) 501 if (sym == NULL)
285 goto out_delete_line; 502 goto out_delete_line;
286 503
287 if (filter && filter(self, sym)) 504 if (filter && filter(map, sym))
288 symbol__delete(sym, self->sym_priv_size); 505 symbol__delete(sym);
289 else { 506 else {
290 dso__insert_symbol(self, sym); 507 symbols__insert(&self->symbols[map->type], sym);
291 nr_syms++; 508 nr_syms++;
292 } 509 }
293 } 510 }
@@ -393,7 +610,8 @@ static Elf_Scn *elf_section_by_name(Elf *elf, GElf_Ehdr *ep,
393 * And always look at the original dso, not at debuginfo packages, that 610 * And always look at the original dso, not at debuginfo packages, that
394 * have the PLT data stripped out (shdr_rel_plt.sh_type == SHT_NOBITS). 611 * have the PLT data stripped out (shdr_rel_plt.sh_type == SHT_NOBITS).
395 */ 612 */
396static int dso__synthesize_plt_symbols(struct dso *self, int v) 613static int dso__synthesize_plt_symbols(struct dso *self, struct map *map,
614 symbol_filter_t filter)
397{ 615{
398 uint32_t nr_rel_entries, idx; 616 uint32_t nr_rel_entries, idx;
399 GElf_Sym sym; 617 GElf_Sym sym;
@@ -409,7 +627,7 @@ static int dso__synthesize_plt_symbols(struct dso *self, int v)
409 Elf *elf; 627 Elf *elf;
410 int nr = 0, symidx, fd, err = 0; 628 int nr = 0, symidx, fd, err = 0;
411 629
412 fd = open(self->name, O_RDONLY); 630 fd = open(self->long_name, O_RDONLY);
413 if (fd < 0) 631 if (fd < 0)
414 goto out; 632 goto out;
415 633
@@ -477,12 +695,16 @@ static int dso__synthesize_plt_symbols(struct dso *self, int v)
477 "%s@plt", elf_sym__name(&sym, symstrs)); 695 "%s@plt", elf_sym__name(&sym, symstrs));
478 696
479 f = symbol__new(plt_offset, shdr_plt.sh_entsize, 697 f = symbol__new(plt_offset, shdr_plt.sh_entsize,
480 sympltname, self->sym_priv_size, 0, v); 698 sympltname);
481 if (!f) 699 if (!f)
482 goto out_elf_end; 700 goto out_elf_end;
483 701
484 dso__insert_symbol(self, f); 702 if (filter && filter(map, f))
485 ++nr; 703 symbol__delete(f);
704 else {
705 symbols__insert(&self->symbols[map->type], f);
706 ++nr;
707 }
486 } 708 }
487 } else if (shdr_rel_plt.sh_type == SHT_REL) { 709 } else if (shdr_rel_plt.sh_type == SHT_REL) {
488 GElf_Rel pos_mem, *pos; 710 GElf_Rel pos_mem, *pos;
@@ -495,12 +717,16 @@ static int dso__synthesize_plt_symbols(struct dso *self, int v)
495 "%s@plt", elf_sym__name(&sym, symstrs)); 717 "%s@plt", elf_sym__name(&sym, symstrs));
496 718
497 f = symbol__new(plt_offset, shdr_plt.sh_entsize, 719 f = symbol__new(plt_offset, shdr_plt.sh_entsize,
498 sympltname, self->sym_priv_size, 0, v); 720 sympltname);
499 if (!f) 721 if (!f)
500 goto out_elf_end; 722 goto out_elf_end;
501 723
502 dso__insert_symbol(self, f); 724 if (filter && filter(map, f))
503 ++nr; 725 symbol__delete(f);
726 else {
727 symbols__insert(&self->symbols[map->type], f);
728 ++nr;
729 }
504 } 730 }
505 } 731 }
506 732
@@ -513,14 +739,18 @@ out_close:
513 if (err == 0) 739 if (err == 0)
514 return nr; 740 return nr;
515out: 741out:
516 fprintf(stderr, "%s: problems reading %s PLT info.\n", 742 pr_warning("%s: problems reading %s PLT info.\n",
517 __func__, self->name); 743 __func__, self->long_name);
518 return 0; 744 return 0;
519} 745}
520 746
521static int dso__load_sym(struct dso *self, int fd, const char *name, 747static int dso__load_sym(struct dso *self, struct map *map,
522 symbol_filter_t filter, int v, struct module *mod) 748 struct thread *thread, const char *name, int fd,
749 symbol_filter_t filter, int kernel, int kmodule)
523{ 750{
751 struct map *curr_map = map;
752 struct dso *curr_dso = self;
753 size_t dso_name_len = strlen(self->short_name);
524 Elf_Data *symstrs, *secstrs; 754 Elf_Data *symstrs, *secstrs;
525 uint32_t nr_syms; 755 uint32_t nr_syms;
526 int err = -1; 756 int err = -1;
@@ -531,19 +761,16 @@ static int dso__load_sym(struct dso *self, int fd, const char *name,
531 GElf_Sym sym; 761 GElf_Sym sym;
532 Elf_Scn *sec, *sec_strndx; 762 Elf_Scn *sec, *sec_strndx;
533 Elf *elf; 763 Elf *elf;
534 int nr = 0, kernel = !strcmp("[kernel]", self->name); 764 int nr = 0;
535 765
536 elf = elf_begin(fd, PERF_ELF_C_READ_MMAP, NULL); 766 elf = elf_begin(fd, PERF_ELF_C_READ_MMAP, NULL);
537 if (elf == NULL) { 767 if (elf == NULL) {
538 if (v) 768 pr_err("%s: cannot read %s ELF file.\n", __func__, name);
539 fprintf(stderr, "%s: cannot read %s ELF file.\n",
540 __func__, name);
541 goto out_close; 769 goto out_close;
542 } 770 }
543 771
544 if (gelf_getehdr(elf, &ehdr) == NULL) { 772 if (gelf_getehdr(elf, &ehdr) == NULL) {
545 if (v) 773 pr_err("%s: cannot get elf header.\n", __func__);
546 fprintf(stderr, "%s: cannot get elf header.\n", __func__);
547 goto out_elf_end; 774 goto out_elf_end;
548 } 775 }
549 776
@@ -587,9 +814,7 @@ static int dso__load_sym(struct dso *self, int fd, const char *name,
587 elf_symtab__for_each_symbol(syms, nr_syms, idx, sym) { 814 elf_symtab__for_each_symbol(syms, nr_syms, idx, sym) {
588 struct symbol *f; 815 struct symbol *f;
589 const char *elf_name; 816 const char *elf_name;
590 char *demangled; 817 char *demangled = NULL;
591 u64 obj_start;
592 struct section *section = NULL;
593 int is_label = elf_sym__is_label(&sym); 818 int is_label = elf_sym__is_label(&sym);
594 const char *section_name; 819 const char *section_name;
595 820
@@ -605,52 +830,85 @@ static int dso__load_sym(struct dso *self, int fd, const char *name,
605 if (is_label && !elf_sec__is_text(&shdr, secstrs)) 830 if (is_label && !elf_sec__is_text(&shdr, secstrs))
606 continue; 831 continue;
607 832
833 elf_name = elf_sym__name(&sym, symstrs);
608 section_name = elf_sec__name(&shdr, secstrs); 834 section_name = elf_sec__name(&shdr, secstrs);
609 obj_start = sym.st_value;
610 835
611 if (self->adjust_symbols) { 836 if (kernel || kmodule) {
612 if (v >= 2) 837 char dso_name[PATH_MAX];
613 printf("adjusting symbol: st_value: %Lx sh_addr: %Lx sh_offset: %Lx\n",
614 (u64)sym.st_value, (u64)shdr.sh_addr, (u64)shdr.sh_offset);
615 838
616 sym.st_value -= shdr.sh_addr - shdr.sh_offset; 839 if (strcmp(section_name,
617 } 840 curr_dso->short_name + dso_name_len) == 0)
841 goto new_symbol;
618 842
619 if (mod) { 843 if (strcmp(section_name, ".text") == 0) {
620 section = mod->sections->find_section(mod->sections, section_name); 844 curr_map = map;
621 if (section) 845 curr_dso = self;
622 sym.st_value += section->vma; 846 goto new_symbol;
623 else {
624 fprintf(stderr, "dso__load_sym() module %s lookup of %s failed\n",
625 mod->name, section_name);
626 goto out_elf_end;
627 } 847 }
848
849 snprintf(dso_name, sizeof(dso_name),
850 "%s%s", self->short_name, section_name);
851
852 curr_map = thread__find_map_by_name(thread, dso_name);
853 if (curr_map == NULL) {
854 u64 start = sym.st_value;
855
856 if (kmodule)
857 start += map->start + shdr.sh_offset;
858
859 curr_dso = dso__new(dso_name);
860 if (curr_dso == NULL)
861 goto out_elf_end;
862 curr_map = map__new2(start, curr_dso,
863 MAP__FUNCTION);
864 if (curr_map == NULL) {
865 dso__delete(curr_dso);
866 goto out_elf_end;
867 }
868 curr_map->map_ip = identity__map_ip;
869 curr_map->unmap_ip = identity__map_ip;
870 curr_dso->origin = DSO__ORIG_KERNEL;
871 __thread__insert_map(kthread, curr_map);
872 dsos__add(&dsos__kernel, curr_dso);
873 } else
874 curr_dso = curr_map->dso;
875
876 goto new_symbol;
877 }
878
879 if (curr_dso->adjust_symbols) {
880 pr_debug2("adjusting symbol: st_value: %Lx sh_addr: "
881 "%Lx sh_offset: %Lx\n", (u64)sym.st_value,
882 (u64)shdr.sh_addr, (u64)shdr.sh_offset);
883 sym.st_value -= shdr.sh_addr - shdr.sh_offset;
628 } 884 }
629 /* 885 /*
630 * We need to figure out if the object was created from C++ sources 886 * We need to figure out if the object was created from C++ sources
631 * DWARF DW_compile_unit has this, but we don't always have access 887 * DWARF DW_compile_unit has this, but we don't always have access
632 * to it... 888 * to it...
633 */ 889 */
634 elf_name = elf_sym__name(&sym, symstrs);
635 demangled = bfd_demangle(NULL, elf_name, DMGL_PARAMS | DMGL_ANSI); 890 demangled = bfd_demangle(NULL, elf_name, DMGL_PARAMS | DMGL_ANSI);
636 if (demangled != NULL) 891 if (demangled != NULL)
637 elf_name = demangled; 892 elf_name = demangled;
638 893new_symbol:
639 f = symbol__new(sym.st_value, sym.st_size, elf_name, 894 f = symbol__new(sym.st_value, sym.st_size, elf_name);
640 self->sym_priv_size, obj_start, v);
641 free(demangled); 895 free(demangled);
642 if (!f) 896 if (!f)
643 goto out_elf_end; 897 goto out_elf_end;
644 898
645 if (filter && filter(self, f)) 899 if (filter && filter(curr_map, f))
646 symbol__delete(f, self->sym_priv_size); 900 symbol__delete(f);
647 else { 901 else {
648 f->module = mod; 902 symbols__insert(&curr_dso->symbols[curr_map->type], f);
649 dso__insert_symbol(self, f);
650 nr++; 903 nr++;
651 } 904 }
652 } 905 }
653 906
907 /*
908 * For misannotated, zeroed, ASM function sizes.
909 */
910 if (nr > 0)
911 symbols__fixup_end(&self->symbols[map->type]);
654 err = nr; 912 err = nr;
655out_elf_end: 913out_elf_end:
656 elf_end(elf); 914 elf_end(elf);
@@ -658,63 +916,153 @@ out_close:
658 return err; 916 return err;
659} 917}
660 918
661#define BUILD_ID_SIZE 128 919static bool dso__build_id_equal(const struct dso *self, u8 *build_id)
920{
921 return memcmp(self->build_id, build_id, sizeof(self->build_id)) == 0;
922}
662 923
663static char *dso__read_build_id(struct dso *self, int v) 924static bool __dsos__read_build_ids(struct list_head *head)
664{ 925{
665 int i; 926 bool have_build_id = false;
927 struct dso *pos;
928
929 list_for_each_entry(pos, head, node)
930 if (filename__read_build_id(pos->long_name, pos->build_id,
931 sizeof(pos->build_id)) > 0) {
932 have_build_id = true;
933 pos->has_build_id = true;
934 }
935
936 return have_build_id;
937}
938
939bool dsos__read_build_ids(void)
940{
941 return __dsos__read_build_ids(&dsos__kernel) ||
942 __dsos__read_build_ids(&dsos__user);
943}
944
945/*
946 * Align offset to 4 bytes as needed for note name and descriptor data.
947 */
948#define NOTE_ALIGN(n) (((n) + 3) & -4U)
949
950int filename__read_build_id(const char *filename, void *bf, size_t size)
951{
952 int fd, err = -1;
666 GElf_Ehdr ehdr; 953 GElf_Ehdr ehdr;
667 GElf_Shdr shdr; 954 GElf_Shdr shdr;
668 Elf_Data *build_id_data; 955 Elf_Data *data;
669 Elf_Scn *sec; 956 Elf_Scn *sec;
670 char *build_id = NULL, *bid; 957 Elf_Kind ek;
671 unsigned char *raw; 958 void *ptr;
672 Elf *elf; 959 Elf *elf;
673 int fd = open(self->name, O_RDONLY);
674 960
961 if (size < BUILD_ID_SIZE)
962 goto out;
963
964 fd = open(filename, O_RDONLY);
675 if (fd < 0) 965 if (fd < 0)
676 goto out; 966 goto out;
677 967
678 elf = elf_begin(fd, PERF_ELF_C_READ_MMAP, NULL); 968 elf = elf_begin(fd, PERF_ELF_C_READ_MMAP, NULL);
679 if (elf == NULL) { 969 if (elf == NULL) {
680 if (v) 970 pr_debug2("%s: cannot read %s ELF file.\n", __func__, filename);
681 fprintf(stderr, "%s: cannot read %s ELF file.\n",
682 __func__, self->name);
683 goto out_close; 971 goto out_close;
684 } 972 }
685 973
974 ek = elf_kind(elf);
975 if (ek != ELF_K_ELF)
976 goto out_elf_end;
977
686 if (gelf_getehdr(elf, &ehdr) == NULL) { 978 if (gelf_getehdr(elf, &ehdr) == NULL) {
687 if (v) 979 pr_err("%s: cannot get elf header.\n", __func__);
688 fprintf(stderr, "%s: cannot get elf header.\n", __func__);
689 goto out_elf_end; 980 goto out_elf_end;
690 } 981 }
691 982
692 sec = elf_section_by_name(elf, &ehdr, &shdr, ".note.gnu.build-id", NULL); 983 sec = elf_section_by_name(elf, &ehdr, &shdr,
693 if (sec == NULL) 984 ".note.gnu.build-id", NULL);
694 goto out_elf_end; 985 if (sec == NULL) {
986 sec = elf_section_by_name(elf, &ehdr, &shdr,
987 ".notes", NULL);
988 if (sec == NULL)
989 goto out_elf_end;
990 }
695 991
696 build_id_data = elf_getdata(sec, NULL); 992 data = elf_getdata(sec, NULL);
697 if (build_id_data == NULL) 993 if (data == NULL)
698 goto out_elf_end;
699 build_id = malloc(BUILD_ID_SIZE);
700 if (build_id == NULL)
701 goto out_elf_end; 994 goto out_elf_end;
702 raw = build_id_data->d_buf + 16;
703 bid = build_id;
704 995
705 for (i = 0; i < 20; ++i) { 996 ptr = data->d_buf;
706 sprintf(bid, "%02x", *raw); 997 while (ptr < (data->d_buf + data->d_size)) {
707 ++raw; 998 GElf_Nhdr *nhdr = ptr;
708 bid += 2; 999 int namesz = NOTE_ALIGN(nhdr->n_namesz),
1000 descsz = NOTE_ALIGN(nhdr->n_descsz);
1001 const char *name;
1002
1003 ptr += sizeof(*nhdr);
1004 name = ptr;
1005 ptr += namesz;
1006 if (nhdr->n_type == NT_GNU_BUILD_ID &&
1007 nhdr->n_namesz == sizeof("GNU")) {
1008 if (memcmp(name, "GNU", sizeof("GNU")) == 0) {
1009 memcpy(bf, ptr, BUILD_ID_SIZE);
1010 err = BUILD_ID_SIZE;
1011 break;
1012 }
1013 }
1014 ptr += descsz;
709 } 1015 }
710 if (v >= 2)
711 printf("%s(%s): %s\n", __func__, self->name, build_id);
712out_elf_end: 1016out_elf_end:
713 elf_end(elf); 1017 elf_end(elf);
714out_close: 1018out_close:
715 close(fd); 1019 close(fd);
716out: 1020out:
717 return build_id; 1021 return err;
1022}
1023
1024int sysfs__read_build_id(const char *filename, void *build_id, size_t size)
1025{
1026 int fd, err = -1;
1027
1028 if (size < BUILD_ID_SIZE)
1029 goto out;
1030
1031 fd = open(filename, O_RDONLY);
1032 if (fd < 0)
1033 goto out;
1034
1035 while (1) {
1036 char bf[BUFSIZ];
1037 GElf_Nhdr nhdr;
1038 int namesz, descsz;
1039
1040 if (read(fd, &nhdr, sizeof(nhdr)) != sizeof(nhdr))
1041 break;
1042
1043 namesz = NOTE_ALIGN(nhdr.n_namesz);
1044 descsz = NOTE_ALIGN(nhdr.n_descsz);
1045 if (nhdr.n_type == NT_GNU_BUILD_ID &&
1046 nhdr.n_namesz == sizeof("GNU")) {
1047 if (read(fd, bf, namesz) != namesz)
1048 break;
1049 if (memcmp(bf, "GNU", sizeof("GNU")) == 0) {
1050 if (read(fd, build_id,
1051 BUILD_ID_SIZE) == BUILD_ID_SIZE) {
1052 err = 0;
1053 break;
1054 }
1055 } else if (read(fd, bf, descsz) != descsz)
1056 break;
1057 } else {
1058 int n = namesz + descsz;
1059 if (read(fd, bf, n) != n)
1060 break;
1061 }
1062 }
1063 close(fd);
1064out:
1065 return err;
718} 1066}
719 1067
720char dso__symtab_origin(const struct dso *self) 1068char dso__symtab_origin(const struct dso *self)
@@ -726,6 +1074,7 @@ char dso__symtab_origin(const struct dso *self)
726 [DSO__ORIG_UBUNTU] = 'u', 1074 [DSO__ORIG_UBUNTU] = 'u',
727 [DSO__ORIG_BUILDID] = 'b', 1075 [DSO__ORIG_BUILDID] = 'b',
728 [DSO__ORIG_DSO] = 'd', 1076 [DSO__ORIG_DSO] = 'd',
1077 [DSO__ORIG_KMODULE] = 'K',
729 }; 1078 };
730 1079
731 if (self == NULL || self->origin == DSO__ORIG_NOT_FOUND) 1080 if (self == NULL || self->origin == DSO__ORIG_NOT_FOUND)
@@ -733,20 +1082,27 @@ char dso__symtab_origin(const struct dso *self)
733 return origin[self->origin]; 1082 return origin[self->origin];
734} 1083}
735 1084
736int dso__load(struct dso *self, symbol_filter_t filter, int v) 1085int dso__load(struct dso *self, struct map *map, symbol_filter_t filter)
737{ 1086{
738 int size = PATH_MAX; 1087 int size = PATH_MAX;
739 char *name = malloc(size), *build_id = NULL; 1088 char *name;
1089 u8 build_id[BUILD_ID_SIZE];
740 int ret = -1; 1090 int ret = -1;
741 int fd; 1091 int fd;
742 1092
1093 dso__set_loaded(self, map->type);
1094
1095 if (self->kernel)
1096 return dso__load_kernel_sym(self, map, kthread, filter);
1097
1098 name = malloc(size);
743 if (!name) 1099 if (!name)
744 return -1; 1100 return -1;
745 1101
746 self->adjust_symbols = 0; 1102 self->adjust_symbols = 0;
747 1103
748 if (strncmp(self->name, "/tmp/perf-", 10) == 0) { 1104 if (strncmp(self->name, "/tmp/perf-", 10) == 0) {
749 ret = dso__load_perf_map(self, filter, v); 1105 ret = dso__load_perf_map(self, map, filter);
750 self->origin = ret > 0 ? DSO__ORIG_JAVA_JIT : 1106 self->origin = ret > 0 ? DSO__ORIG_JAVA_JIT :
751 DSO__ORIG_NOT_FOUND; 1107 DSO__ORIG_NOT_FOUND;
752 return ret; 1108 return ret;
@@ -759,34 +1115,50 @@ more:
759 self->origin++; 1115 self->origin++;
760 switch (self->origin) { 1116 switch (self->origin) {
761 case DSO__ORIG_FEDORA: 1117 case DSO__ORIG_FEDORA:
762 snprintf(name, size, "/usr/lib/debug%s.debug", self->name); 1118 snprintf(name, size, "/usr/lib/debug%s.debug",
1119 self->long_name);
763 break; 1120 break;
764 case DSO__ORIG_UBUNTU: 1121 case DSO__ORIG_UBUNTU:
765 snprintf(name, size, "/usr/lib/debug%s", self->name); 1122 snprintf(name, size, "/usr/lib/debug%s",
1123 self->long_name);
766 break; 1124 break;
767 case DSO__ORIG_BUILDID: 1125 case DSO__ORIG_BUILDID:
768 build_id = dso__read_build_id(self, v); 1126 if (filename__read_build_id(self->long_name, build_id,
769 if (build_id != NULL) { 1127 sizeof(build_id))) {
1128 char build_id_hex[BUILD_ID_SIZE * 2 + 1];
1129
1130 build_id__sprintf(build_id, sizeof(build_id),
1131 build_id_hex);
770 snprintf(name, size, 1132 snprintf(name, size,
771 "/usr/lib/debug/.build-id/%.2s/%s.debug", 1133 "/usr/lib/debug/.build-id/%.2s/%s.debug",
772 build_id, build_id + 2); 1134 build_id_hex, build_id_hex + 2);
773 free(build_id); 1135 if (self->has_build_id)
1136 goto compare_build_id;
774 break; 1137 break;
775 } 1138 }
776 self->origin++; 1139 self->origin++;
777 /* Fall thru */ 1140 /* Fall thru */
778 case DSO__ORIG_DSO: 1141 case DSO__ORIG_DSO:
779 snprintf(name, size, "%s", self->name); 1142 snprintf(name, size, "%s", self->long_name);
780 break; 1143 break;
781 1144
782 default: 1145 default:
783 goto out; 1146 goto out;
784 } 1147 }
785 1148
1149 if (self->has_build_id) {
1150 if (filename__read_build_id(name, build_id,
1151 sizeof(build_id)) < 0)
1152 goto more;
1153compare_build_id:
1154 if (!dso__build_id_equal(self, build_id))
1155 goto more;
1156 }
1157
786 fd = open(name, O_RDONLY); 1158 fd = open(name, O_RDONLY);
787 } while (fd < 0); 1159 } while (fd < 0);
788 1160
789 ret = dso__load_sym(self, fd, name, filter, v, NULL); 1161 ret = dso__load_sym(self, map, NULL, name, fd, filter, 0, 0);
790 close(fd); 1162 close(fd);
791 1163
792 /* 1164 /*
@@ -796,7 +1168,7 @@ more:
796 goto more; 1168 goto more;
797 1169
798 if (ret > 0) { 1170 if (ret > 0) {
799 int nr_plt = dso__synthesize_plt_symbols(self, v); 1171 int nr_plt = dso__synthesize_plt_symbols(self, map, filter);
800 if (nr_plt > 0) 1172 if (nr_plt > 0)
801 ret += nr_plt; 1173 ret += nr_plt;
802 } 1174 }
@@ -807,151 +1179,279 @@ out:
807 return ret; 1179 return ret;
808} 1180}
809 1181
810static int dso__load_module(struct dso *self, struct mod_dso *mods, const char *name, 1182static struct map *thread__find_map_by_name(struct thread *self, char *name)
811 symbol_filter_t filter, int v)
812{ 1183{
813 struct module *mod = mod_dso__find_module(mods, name); 1184 struct rb_node *nd;
814 int err = 0, fd;
815 1185
816 if (mod == NULL || !mod->active) 1186 for (nd = rb_first(&self->maps[MAP__FUNCTION]); nd; nd = rb_next(nd)) {
817 return err; 1187 struct map *map = rb_entry(nd, struct map, rb_node);
818 1188
819 fd = open(mod->path, O_RDONLY); 1189 if (map->dso && strcmp(map->dso->name, name) == 0)
1190 return map;
1191 }
820 1192
821 if (fd < 0) 1193 return NULL;
822 return err; 1194}
823 1195
824 err = dso__load_sym(self, fd, name, filter, v, mod); 1196static int dsos__set_modules_path_dir(char *dirname)
825 close(fd); 1197{
1198 struct dirent *dent;
1199 DIR *dir = opendir(dirname);
826 1200
827 return err; 1201 if (!dir) {
1202 pr_debug("%s: cannot open %s dir\n", __func__, dirname);
1203 return -1;
1204 }
1205
1206 while ((dent = readdir(dir)) != NULL) {
1207 char path[PATH_MAX];
1208
1209 if (dent->d_type == DT_DIR) {
1210 if (!strcmp(dent->d_name, ".") ||
1211 !strcmp(dent->d_name, ".."))
1212 continue;
1213
1214 snprintf(path, sizeof(path), "%s/%s",
1215 dirname, dent->d_name);
1216 if (dsos__set_modules_path_dir(path) < 0)
1217 goto failure;
1218 } else {
1219 char *dot = strrchr(dent->d_name, '.'),
1220 dso_name[PATH_MAX];
1221 struct map *map;
1222 char *long_name;
1223
1224 if (dot == NULL || strcmp(dot, ".ko"))
1225 continue;
1226 snprintf(dso_name, sizeof(dso_name), "[%.*s]",
1227 (int)(dot - dent->d_name), dent->d_name);
1228
1229 strxfrchar(dso_name, '-', '_');
1230 map = thread__find_map_by_name(kthread, dso_name);
1231 if (map == NULL)
1232 continue;
1233
1234 snprintf(path, sizeof(path), "%s/%s",
1235 dirname, dent->d_name);
1236
1237 long_name = strdup(path);
1238 if (long_name == NULL)
1239 goto failure;
1240 dso__set_long_name(map->dso, long_name);
1241 }
1242 }
1243
1244 return 0;
1245failure:
1246 closedir(dir);
1247 return -1;
828} 1248}
829 1249
830int dso__load_modules(struct dso *self, symbol_filter_t filter, int v) 1250static int dsos__set_modules_path(void)
831{ 1251{
832 struct mod_dso *mods = mod_dso__new_dso("modules"); 1252 struct utsname uts;
833 struct module *pos; 1253 char modules_path[PATH_MAX];
834 struct rb_node *next;
835 int err, count = 0;
836 1254
837 err = mod_dso__load_modules(mods); 1255 if (uname(&uts) < 0)
838 1256 return -1;
839 if (err <= 0)
840 return err;
841 1257
842 /* 1258 snprintf(modules_path, sizeof(modules_path), "/lib/modules/%s/kernel",
843 * Iterate over modules, and load active symbols. 1259 uts.release);
844 */
845 next = rb_first(&mods->mods);
846 while (next) {
847 pos = rb_entry(next, struct module, rb_node);
848 err = dso__load_module(self, mods, pos->name, filter, v);
849 1260
850 if (err < 0) 1261 return dsos__set_modules_path_dir(modules_path);
851 break; 1262}
852 1263
853 next = rb_next(&pos->rb_node); 1264/*
854 count += err; 1265 * Constructor variant for modules (where we know from /proc/modules where
855 } 1266 * they are loaded) and for vmlinux, where only after we load all the
1267 * symbols we'll know where it starts and ends.
1268 */
1269static struct map *map__new2(u64 start, struct dso *dso, enum map_type type)
1270{
1271 struct map *self = malloc(sizeof(*self));
856 1272
857 if (err < 0) { 1273 if (self != NULL) {
858 mod_dso__delete_modules(mods); 1274 /*
859 mod_dso__delete_self(mods); 1275 * ->end will be filled after we load all the symbols
860 return err; 1276 */
1277 map__init(self, type, start, 0, 0, dso);
861 } 1278 }
862 1279
863 return count; 1280 return self;
864} 1281}
865 1282
866static inline void dso__fill_symbol_holes(struct dso *self) 1283static int thread__create_module_maps(struct thread *self)
867{ 1284{
868 struct symbol *prev = NULL; 1285 char *line = NULL;
869 struct rb_node *nd; 1286 size_t n;
1287 FILE *file = fopen("/proc/modules", "r");
1288 struct map *map;
870 1289
871 for (nd = rb_last(&self->syms); nd; nd = rb_prev(nd)) { 1290 if (file == NULL)
872 struct symbol *pos = rb_entry(nd, struct symbol, rb_node); 1291 return -1;
873 1292
874 if (prev) { 1293 while (!feof(file)) {
875 u64 hole = 0; 1294 char name[PATH_MAX];
876 int alias = pos->start == prev->start; 1295 u64 start;
1296 struct dso *dso;
1297 char *sep;
1298 int line_len;
877 1299
878 if (!alias) 1300 line_len = getline(&line, &n, file);
879 hole = prev->start - pos->end - 1; 1301 if (line_len < 0)
1302 break;
880 1303
881 if (hole || alias) { 1304 if (!line)
882 if (alias) 1305 goto out_failure;
883 pos->end = prev->end; 1306
884 else if (hole) 1307 line[--line_len] = '\0'; /* \n */
885 pos->end = prev->start - 1; 1308
886 } 1309 sep = strrchr(line, 'x');
1310 if (sep == NULL)
1311 continue;
1312
1313 hex2u64(sep + 1, &start);
1314
1315 sep = strchr(line, ' ');
1316 if (sep == NULL)
1317 continue;
1318
1319 *sep = '\0';
1320
1321 snprintf(name, sizeof(name), "[%s]", line);
1322 dso = dso__new(name);
1323
1324 if (dso == NULL)
1325 goto out_delete_line;
1326
1327 map = map__new2(start, dso, MAP__FUNCTION);
1328 if (map == NULL) {
1329 dso__delete(dso);
1330 goto out_delete_line;
887 } 1331 }
888 prev = pos; 1332
1333 snprintf(name, sizeof(name),
1334 "/sys/module/%s/notes/.note.gnu.build-id", line);
1335 if (sysfs__read_build_id(name, dso->build_id,
1336 sizeof(dso->build_id)) == 0)
1337 dso->has_build_id = true;
1338
1339 dso->origin = DSO__ORIG_KMODULE;
1340 __thread__insert_map(self, map);
1341 dsos__add(&dsos__kernel, dso);
889 } 1342 }
1343
1344 free(line);
1345 fclose(file);
1346
1347 return dsos__set_modules_path();
1348
1349out_delete_line:
1350 free(line);
1351out_failure:
1352 return -1;
890} 1353}
891 1354
892static int dso__load_vmlinux(struct dso *self, const char *vmlinux, 1355static int dso__load_vmlinux(struct dso *self, struct map *map, struct thread *thread,
893 symbol_filter_t filter, int v) 1356 const char *vmlinux, symbol_filter_t filter)
894{ 1357{
895 int err, fd = open(vmlinux, O_RDONLY); 1358 int err = -1, fd;
896 1359
897 if (fd < 0) 1360 if (self->has_build_id) {
898 return -1; 1361 u8 build_id[BUILD_ID_SIZE];
899 1362
900 err = dso__load_sym(self, fd, vmlinux, filter, v, NULL); 1363 if (filename__read_build_id(vmlinux, build_id,
1364 sizeof(build_id)) < 0) {
1365 pr_debug("No build_id in %s, ignoring it\n", vmlinux);
1366 return -1;
1367 }
1368 if (!dso__build_id_equal(self, build_id)) {
1369 char expected_build_id[BUILD_ID_SIZE * 2 + 1],
1370 vmlinux_build_id[BUILD_ID_SIZE * 2 + 1];
1371
1372 build_id__sprintf(self->build_id,
1373 sizeof(self->build_id),
1374 expected_build_id);
1375 build_id__sprintf(build_id, sizeof(build_id),
1376 vmlinux_build_id);
1377 pr_debug("build_id in %s is %s while expected is %s, "
1378 "ignoring it\n", vmlinux, vmlinux_build_id,
1379 expected_build_id);
1380 return -1;
1381 }
1382 }
901 1383
902 if (err > 0) 1384 fd = open(vmlinux, O_RDONLY);
903 dso__fill_symbol_holes(self); 1385 if (fd < 0)
1386 return -1;
904 1387
1388 dso__set_loaded(self, map->type);
1389 err = dso__load_sym(self, map, thread, self->long_name, fd, filter, 1, 0);
905 close(fd); 1390 close(fd);
906 1391
907 return err; 1392 return err;
908} 1393}
909 1394
910int dso__load_kernel(struct dso *self, const char *vmlinux, 1395static int dso__load_kernel_sym(struct dso *self, struct map *map,
911 symbol_filter_t filter, int v, int use_modules) 1396 struct thread *thread, symbol_filter_t filter)
912{ 1397{
913 int err = -1; 1398 int err;
914 1399 bool is_kallsyms;
915 if (vmlinux) { 1400
916 err = dso__load_vmlinux(self, vmlinux, filter, v); 1401 if (vmlinux_path != NULL) {
917 if (err > 0 && use_modules) { 1402 int i;
918 int syms = dso__load_modules(self, filter, v); 1403 pr_debug("Looking at the vmlinux_path (%d entries long)\n",
919 1404 vmlinux_path__nr_entries);
920 if (syms < 0) { 1405 for (i = 0; i < vmlinux_path__nr_entries; ++i) {
921 fprintf(stderr, "dso__load_modules failed!\n"); 1406 err = dso__load_vmlinux(self, map, thread,
922 return syms; 1407 vmlinux_path[i], filter);
1408 if (err > 0) {
1409 pr_debug("Using %s for symbols\n",
1410 vmlinux_path[i]);
1411 dso__set_long_name(self,
1412 strdup(vmlinux_path[i]));
1413 goto out_fixup;
923 } 1414 }
924 err += syms;
925 } 1415 }
926 } 1416 }
927 1417
928 if (err <= 0) 1418 is_kallsyms = self->long_name[0] == '[';
929 err = dso__load_kallsyms(self, filter, v); 1419 if (is_kallsyms)
1420 goto do_kallsyms;
930 1421
931 if (err > 0) 1422 err = dso__load_vmlinux(self, map, thread, self->long_name, filter);
932 self->origin = DSO__ORIG_KERNEL; 1423 if (err <= 0) {
1424 pr_info("The file %s cannot be used, "
1425 "trying to use /proc/kallsyms...", self->long_name);
1426do_kallsyms:
1427 err = dso__load_kallsyms(self, map, thread, filter);
1428 if (err > 0 && !is_kallsyms)
1429 dso__set_long_name(self, strdup("[kernel.kallsyms]"));
1430 }
1431
1432 if (err > 0) {
1433out_fixup:
1434 map__fixup_start(map);
1435 map__fixup_end(map);
1436 }
933 1437
934 return err; 1438 return err;
935} 1439}
936 1440
937LIST_HEAD(dsos); 1441LIST_HEAD(dsos__user);
938struct dso *kernel_dso; 1442LIST_HEAD(dsos__kernel);
939struct dso *vdso; 1443struct dso *vdso;
940struct dso *hypervisor_dso;
941
942const char *vmlinux_name = "vmlinux";
943int modules;
944 1444
945static void dsos__add(struct dso *dso) 1445static void dsos__add(struct list_head *head, struct dso *dso)
946{ 1446{
947 list_add_tail(&dso->node, &dsos); 1447 list_add_tail(&dso->node, head);
948} 1448}
949 1449
950static struct dso *dsos__find(const char *name) 1450static struct dso *dsos__find(struct list_head *head, const char *name)
951{ 1451{
952 struct dso *pos; 1452 struct dso *pos;
953 1453
954 list_for_each_entry(pos, &dsos, node) 1454 list_for_each_entry(pos, head, node)
955 if (strcmp(pos->name, name) == 0) 1455 if (strcmp(pos->name, name) == 0)
956 return pos; 1456 return pos;
957 return NULL; 1457 return NULL;
@@ -959,79 +1459,170 @@ static struct dso *dsos__find(const char *name)
959 1459
960struct dso *dsos__findnew(const char *name) 1460struct dso *dsos__findnew(const char *name)
961{ 1461{
962 struct dso *dso = dsos__find(name); 1462 struct dso *dso = dsos__find(&dsos__user, name);
963 int nr;
964
965 if (dso)
966 return dso;
967
968 dso = dso__new(name, 0);
969 if (!dso)
970 goto out_delete_dso;
971 1463
972 nr = dso__load(dso, NULL, verbose); 1464 if (!dso) {
973 if (nr < 0) { 1465 dso = dso__new(name);
974 eprintf("Failed to open: %s\n", name); 1466 if (dso != NULL) {
975 goto out_delete_dso; 1467 dsos__add(&dsos__user, dso);
1468 dso__set_basename(dso);
1469 }
976 } 1470 }
977 if (!nr)
978 eprintf("No symbols found in: %s, maybe install a debug package?\n", name);
979
980 dsos__add(dso);
981 1471
982 return dso; 1472 return dso;
1473}
983 1474
984out_delete_dso: 1475static void __dsos__fprintf(struct list_head *head, FILE *fp)
985 dso__delete(dso); 1476{
986 return NULL; 1477 struct dso *pos;
1478
1479 list_for_each_entry(pos, head, node) {
1480 int i;
1481 for (i = 0; i < MAP__NR_TYPES; ++i)
1482 dso__fprintf(pos, i, fp);
1483 }
987} 1484}
988 1485
989void dsos__fprintf(FILE *fp) 1486void dsos__fprintf(FILE *fp)
990{ 1487{
1488 __dsos__fprintf(&dsos__kernel, fp);
1489 __dsos__fprintf(&dsos__user, fp);
1490}
1491
1492static size_t __dsos__fprintf_buildid(struct list_head *head, FILE *fp)
1493{
991 struct dso *pos; 1494 struct dso *pos;
1495 size_t ret = 0;
992 1496
993 list_for_each_entry(pos, &dsos, node) 1497 list_for_each_entry(pos, head, node) {
994 dso__fprintf(pos, fp); 1498 ret += dso__fprintf_buildid(pos, fp);
1499 ret += fprintf(fp, " %s\n", pos->long_name);
1500 }
1501 return ret;
995} 1502}
996 1503
997static struct symbol *vdso__find_symbol(struct dso *dso, u64 ip) 1504size_t dsos__fprintf_buildid(FILE *fp)
998{ 1505{
999 return dso__find_symbol(dso, ip); 1506 return (__dsos__fprintf_buildid(&dsos__kernel, fp) +
1507 __dsos__fprintf_buildid(&dsos__user, fp));
1000} 1508}
1001 1509
1002int load_kernel(void) 1510static int thread__create_kernel_map(struct thread *self, const char *vmlinux)
1003{ 1511{
1004 int err; 1512 struct map *kmap;
1513 struct dso *kernel = dso__new(vmlinux ?: "[kernel.kallsyms]");
1005 1514
1006 kernel_dso = dso__new("[kernel]", 0); 1515 if (kernel == NULL)
1007 if (!kernel_dso)
1008 return -1; 1516 return -1;
1009 1517
1010 err = dso__load_kernel(kernel_dso, vmlinux_name, NULL, verbose, modules); 1518 kmap = map__new2(0, kernel, MAP__FUNCTION);
1011 if (err <= 0) { 1519 if (kmap == NULL)
1012 dso__delete(kernel_dso); 1520 goto out_delete_kernel_dso;
1013 kernel_dso = NULL;
1014 } else
1015 dsos__add(kernel_dso);
1016 1521
1017 vdso = dso__new("[vdso]", 0); 1522 kmap->map_ip = kmap->unmap_ip = identity__map_ip;
1018 if (!vdso) 1523 kernel->short_name = "[kernel]";
1019 return -1; 1524 kernel->kernel = 1;
1020 1525
1021 vdso->find_symbol = vdso__find_symbol; 1526 vdso = dso__new("[vdso]");
1527 if (vdso == NULL)
1528 goto out_delete_kernel_map;
1529 dso__set_loaded(vdso, MAP__FUNCTION);
1022 1530
1023 dsos__add(vdso); 1531 if (sysfs__read_build_id("/sys/kernel/notes", kernel->build_id,
1532 sizeof(kernel->build_id)) == 0)
1533 kernel->has_build_id = true;
1024 1534
1025 hypervisor_dso = dso__new("[hypervisor]", 0); 1535 __thread__insert_map(self, kmap);
1026 if (!hypervisor_dso) 1536 dsos__add(&dsos__kernel, kernel);
1027 return -1; 1537 dsos__add(&dsos__user, vdso);
1028 dsos__add(hypervisor_dso);
1029 1538
1030 return err; 1539 return 0;
1540
1541out_delete_kernel_map:
1542 map__delete(kmap);
1543out_delete_kernel_dso:
1544 dso__delete(kernel);
1545 return -1;
1546}
1547
1548static void vmlinux_path__exit(void)
1549{
1550 while (--vmlinux_path__nr_entries >= 0) {
1551 free(vmlinux_path[vmlinux_path__nr_entries]);
1552 vmlinux_path[vmlinux_path__nr_entries] = NULL;
1553 }
1554
1555 free(vmlinux_path);
1556 vmlinux_path = NULL;
1031} 1557}
1032 1558
1559static int vmlinux_path__init(void)
1560{
1561 struct utsname uts;
1562 char bf[PATH_MAX];
1563
1564 if (uname(&uts) < 0)
1565 return -1;
1566
1567 vmlinux_path = malloc(sizeof(char *) * 5);
1568 if (vmlinux_path == NULL)
1569 return -1;
1570
1571 vmlinux_path[vmlinux_path__nr_entries] = strdup("vmlinux");
1572 if (vmlinux_path[vmlinux_path__nr_entries] == NULL)
1573 goto out_fail;
1574 ++vmlinux_path__nr_entries;
1575 vmlinux_path[vmlinux_path__nr_entries] = strdup("/boot/vmlinux");
1576 if (vmlinux_path[vmlinux_path__nr_entries] == NULL)
1577 goto out_fail;
1578 ++vmlinux_path__nr_entries;
1579 snprintf(bf, sizeof(bf), "/boot/vmlinux-%s", uts.release);
1580 vmlinux_path[vmlinux_path__nr_entries] = strdup(bf);
1581 if (vmlinux_path[vmlinux_path__nr_entries] == NULL)
1582 goto out_fail;
1583 ++vmlinux_path__nr_entries;
1584 snprintf(bf, sizeof(bf), "/lib/modules/%s/build/vmlinux", uts.release);
1585 vmlinux_path[vmlinux_path__nr_entries] = strdup(bf);
1586 if (vmlinux_path[vmlinux_path__nr_entries] == NULL)
1587 goto out_fail;
1588 ++vmlinux_path__nr_entries;
1589 snprintf(bf, sizeof(bf), "/usr/lib/debug/lib/modules/%s/vmlinux",
1590 uts.release);
1591 vmlinux_path[vmlinux_path__nr_entries] = strdup(bf);
1592 if (vmlinux_path[vmlinux_path__nr_entries] == NULL)
1593 goto out_fail;
1594 ++vmlinux_path__nr_entries;
1595
1596 return 0;
1597
1598out_fail:
1599 vmlinux_path__exit();
1600 return -1;
1601}
1033 1602
1034void symbol__init(void) 1603int symbol__init(struct symbol_conf *conf)
1035{ 1604{
1605 const struct symbol_conf *pconf = conf ?: &symbol_conf__defaults;
1606
1036 elf_version(EV_CURRENT); 1607 elf_version(EV_CURRENT);
1608 symbol__priv_size = pconf->priv_size;
1609 thread__init(kthread, 0);
1610
1611 if (pconf->try_vmlinux_path && vmlinux_path__init() < 0)
1612 return -1;
1613
1614 if (thread__create_kernel_map(kthread, pconf->vmlinux_name) < 0) {
1615 vmlinux_path__exit();
1616 return -1;
1617 }
1618
1619 kthread->use_modules = pconf->use_modules;
1620 if (pconf->use_modules && thread__create_module_maps(kthread) < 0)
1621 pr_debug("Failed to load list of modules in use, "
1622 "continuing...\n");
1623 /*
1624 * Now that we have all the maps created, just set the ->end of them:
1625 */
1626 thread__fixup_maps_end(kthread);
1627 return 0;
1037} 1628}
diff --git a/tools/perf/util/symbol.h b/tools/perf/util/symbol.h
index 829da9edba64..17003efa0b39 100644
--- a/tools/perf/util/symbol.h
+++ b/tools/perf/util/symbol.h
@@ -1,11 +1,11 @@
1#ifndef _PERF_SYMBOL_ 1#ifndef __PERF_SYMBOL
2#define _PERF_SYMBOL_ 1 2#define __PERF_SYMBOL 1
3 3
4#include <linux/types.h> 4#include <linux/types.h>
5#include <stdbool.h>
5#include "types.h" 6#include "types.h"
6#include <linux/list.h> 7#include <linux/list.h>
7#include <linux/rbtree.h> 8#include <linux/rbtree.h>
8#include "module.h"
9#include "event.h" 9#include "event.h"
10 10
11#ifdef HAVE_CPLUS_DEMANGLE 11#ifdef HAVE_CPLUS_DEMANGLE
@@ -46,57 +46,75 @@ struct symbol {
46 struct rb_node rb_node; 46 struct rb_node rb_node;
47 u64 start; 47 u64 start;
48 u64 end; 48 u64 end;
49 u64 obj_start;
50 u64 hist_sum;
51 u64 *hist;
52 struct module *module;
53 void *priv;
54 char name[0]; 49 char name[0];
55}; 50};
56 51
52struct symbol_conf {
53 unsigned short priv_size;
54 bool try_vmlinux_path,
55 use_modules;
56 const char *vmlinux_name;
57};
58
59extern unsigned int symbol__priv_size;
60
61static inline void *symbol__priv(struct symbol *self)
62{
63 return ((void *)self) - symbol__priv_size;
64}
65
66struct addr_location {
67 struct thread *thread;
68 struct map *map;
69 struct symbol *sym;
70 u64 addr;
71 char level;
72};
73
57struct dso { 74struct dso {
58 struct list_head node; 75 struct list_head node;
59 struct rb_root syms; 76 struct rb_root symbols[MAP__NR_TYPES];
60 struct symbol *(*find_symbol)(struct dso *, u64 ip); 77 struct symbol *(*find_symbol)(struct dso *self,
61 unsigned int sym_priv_size; 78 enum map_type type, u64 addr);
62 unsigned char adjust_symbols; 79 u8 adjust_symbols:1;
63 unsigned char slen_calculated; 80 u8 slen_calculated:1;
81 u8 has_build_id:1;
82 u8 kernel:1;
64 unsigned char origin; 83 unsigned char origin;
84 u8 loaded;
85 u8 build_id[BUILD_ID_SIZE];
86 u16 long_name_len;
87 const char *short_name;
88 char *long_name;
65 char name[0]; 89 char name[0];
66}; 90};
67 91
68extern const char *sym_hist_filter; 92struct dso *dso__new(const char *name);
69
70typedef int (*symbol_filter_t)(struct dso *self, struct symbol *sym);
71
72struct dso *dso__new(const char *name, unsigned int sym_priv_size);
73void dso__delete(struct dso *self); 93void dso__delete(struct dso *self);
74 94
75static inline void *dso__sym_priv(struct dso *self, struct symbol *sym) 95bool dso__loaded(const struct dso *self, enum map_type type);
76{
77 return ((void *)sym) - self->sym_priv_size;
78}
79
80struct symbol *dso__find_symbol(struct dso *self, u64 ip);
81 96
82int dso__load_kernel(struct dso *self, const char *vmlinux,
83 symbol_filter_t filter, int verbose, int modules);
84int dso__load_modules(struct dso *self, symbol_filter_t filter, int verbose);
85int dso__load(struct dso *self, symbol_filter_t filter, int verbose);
86struct dso *dsos__findnew(const char *name); 97struct dso *dsos__findnew(const char *name);
98int dso__load(struct dso *self, struct map *map, symbol_filter_t filter);
87void dsos__fprintf(FILE *fp); 99void dsos__fprintf(FILE *fp);
100size_t dsos__fprintf_buildid(FILE *fp);
88 101
89size_t dso__fprintf(struct dso *self, FILE *fp); 102size_t dso__fprintf_buildid(struct dso *self, FILE *fp);
103size_t dso__fprintf(struct dso *self, enum map_type type, FILE *fp);
90char dso__symtab_origin(const struct dso *self); 104char dso__symtab_origin(const struct dso *self);
105void dso__set_build_id(struct dso *self, void *build_id);
106
107int filename__read_build_id(const char *filename, void *bf, size_t size);
108int sysfs__read_build_id(const char *filename, void *bf, size_t size);
109bool dsos__read_build_ids(void);
110int build_id__sprintf(u8 *self, int len, char *bf);
91 111
92int load_kernel(void); 112size_t kernel_maps__fprintf(FILE *fp);
93 113
94void symbol__init(void); 114int symbol__init(struct symbol_conf *conf);
95 115
96extern struct list_head dsos; 116struct thread;
97extern struct dso *kernel_dso; 117struct thread *kthread;
118extern struct list_head dsos__user, dsos__kernel;
98extern struct dso *vdso; 119extern struct dso *vdso;
99extern struct dso *hypervisor_dso; 120#endif /* __PERF_SYMBOL */
100extern const char *vmlinux_name;
101extern int modules;
102#endif /* _PERF_SYMBOL_ */
diff --git a/tools/perf/util/thread.c b/tools/perf/util/thread.c
index 45efb5db0d19..603f5610861b 100644
--- a/tools/perf/util/thread.c
+++ b/tools/perf/util/thread.c
@@ -6,16 +6,29 @@
6#include "util.h" 6#include "util.h"
7#include "debug.h" 7#include "debug.h"
8 8
9static struct rb_root threads;
10static struct thread *last_match;
11
12void thread__init(struct thread *self, pid_t pid)
13{
14 int i;
15 self->pid = pid;
16 self->comm = NULL;
17 for (i = 0; i < MAP__NR_TYPES; ++i) {
18 self->maps[i] = RB_ROOT;
19 INIT_LIST_HEAD(&self->removed_maps[i]);
20 }
21}
22
9static struct thread *thread__new(pid_t pid) 23static struct thread *thread__new(pid_t pid)
10{ 24{
11 struct thread *self = calloc(1, sizeof(*self)); 25 struct thread *self = zalloc(sizeof(*self));
12 26
13 if (self != NULL) { 27 if (self != NULL) {
14 self->pid = pid; 28 thread__init(self, pid);
15 self->comm = malloc(32); 29 self->comm = malloc(32);
16 if (self->comm) 30 if (self->comm)
17 snprintf(self->comm, 32, ":%d", self->pid); 31 snprintf(self->comm, 32, ":%d", self->pid);
18 INIT_LIST_HEAD(&self->maps);
19 } 32 }
20 33
21 return self; 34 return self;
@@ -29,21 +42,84 @@ int thread__set_comm(struct thread *self, const char *comm)
29 return self->comm ? 0 : -ENOMEM; 42 return self->comm ? 0 : -ENOMEM;
30} 43}
31 44
32static size_t thread__fprintf(struct thread *self, FILE *fp) 45int thread__comm_len(struct thread *self)
46{
47 if (!self->comm_len) {
48 if (!self->comm)
49 return 0;
50 self->comm_len = strlen(self->comm);
51 }
52
53 return self->comm_len;
54}
55
56static const char *map_type__name[MAP__NR_TYPES] = {
57 [MAP__FUNCTION] = "Functions",
58};
59
60static size_t __thread__fprintf_maps(struct thread *self,
61 enum map_type type, FILE *fp)
62{
63 size_t printed = fprintf(fp, "%s:\n", map_type__name[type]);
64 struct rb_node *nd;
65
66 for (nd = rb_first(&self->maps[type]); nd; nd = rb_next(nd)) {
67 struct map *pos = rb_entry(nd, struct map, rb_node);
68 printed += fprintf(fp, "Map:");
69 printed += map__fprintf(pos, fp);
70 if (verbose > 1) {
71 printed += dso__fprintf(pos->dso, type, fp);
72 printed += fprintf(fp, "--\n");
73 }
74 }
75
76 return printed;
77}
78
79size_t thread__fprintf_maps(struct thread *self, FILE *fp)
80{
81 size_t printed = 0, i;
82 for (i = 0; i < MAP__NR_TYPES; ++i)
83 printed += __thread__fprintf_maps(self, i, fp);
84 return printed;
85}
86
87static size_t __thread__fprintf_removed_maps(struct thread *self,
88 enum map_type type, FILE *fp)
33{ 89{
34 struct map *pos; 90 struct map *pos;
35 size_t ret = fprintf(fp, "Thread %d %s\n", self->pid, self->comm); 91 size_t printed = 0;
92
93 list_for_each_entry(pos, &self->removed_maps[type], node) {
94 printed += fprintf(fp, "Map:");
95 printed += map__fprintf(pos, fp);
96 if (verbose > 1) {
97 printed += dso__fprintf(pos->dso, type, fp);
98 printed += fprintf(fp, "--\n");
99 }
100 }
101 return printed;
102}
36 103
37 list_for_each_entry(pos, &self->maps, node) 104static size_t thread__fprintf_removed_maps(struct thread *self, FILE *fp)
38 ret += map__fprintf(pos, fp); 105{
106 size_t printed = 0, i;
107 for (i = 0; i < MAP__NR_TYPES; ++i)
108 printed += __thread__fprintf_removed_maps(self, i, fp);
109 return printed;
110}
39 111
40 return ret; 112static size_t thread__fprintf(struct thread *self, FILE *fp)
113{
114 size_t printed = fprintf(fp, "Thread %d %s\n", self->pid, self->comm);
115 printed += thread__fprintf_removed_maps(self, fp);
116 printed += fprintf(fp, "Removed maps:\n");
117 return printed + thread__fprintf_removed_maps(self, fp);
41} 118}
42 119
43struct thread * 120struct thread *threads__findnew(pid_t pid)
44threads__findnew(pid_t pid, struct rb_root *threads, struct thread **last_match)
45{ 121{
46 struct rb_node **p = &threads->rb_node; 122 struct rb_node **p = &threads.rb_node;
47 struct rb_node *parent = NULL; 123 struct rb_node *parent = NULL;
48 struct thread *th; 124 struct thread *th;
49 125
@@ -52,15 +128,15 @@ threads__findnew(pid_t pid, struct rb_root *threads, struct thread **last_match)
52 * so most of the time we dont have to look up 128 * so most of the time we dont have to look up
53 * the full rbtree: 129 * the full rbtree:
54 */ 130 */
55 if (*last_match && (*last_match)->pid == pid) 131 if (last_match && last_match->pid == pid)
56 return *last_match; 132 return last_match;
57 133
58 while (*p != NULL) { 134 while (*p != NULL) {
59 parent = *p; 135 parent = *p;
60 th = rb_entry(parent, struct thread, rb_node); 136 th = rb_entry(parent, struct thread, rb_node);
61 137
62 if (th->pid == pid) { 138 if (th->pid == pid) {
63 *last_match = th; 139 last_match = th;
64 return th; 140 return th;
65 } 141 }
66 142
@@ -73,17 +149,16 @@ threads__findnew(pid_t pid, struct rb_root *threads, struct thread **last_match)
73 th = thread__new(pid); 149 th = thread__new(pid);
74 if (th != NULL) { 150 if (th != NULL) {
75 rb_link_node(&th->rb_node, parent, p); 151 rb_link_node(&th->rb_node, parent, p);
76 rb_insert_color(&th->rb_node, threads); 152 rb_insert_color(&th->rb_node, &threads);
77 *last_match = th; 153 last_match = th;
78 } 154 }
79 155
80 return th; 156 return th;
81} 157}
82 158
83struct thread * 159struct thread *register_idle_thread(void)
84register_idle_thread(struct rb_root *threads, struct thread **last_match)
85{ 160{
86 struct thread *thread = threads__findnew(0, threads, last_match); 161 struct thread *thread = threads__findnew(0);
87 162
88 if (!thread || thread__set_comm(thread, "swapper")) { 163 if (!thread || thread__set_comm(thread, "swapper")) {
89 fprintf(stderr, "problem inserting idle task.\n"); 164 fprintf(stderr, "problem inserting idle task.\n");
@@ -93,79 +168,116 @@ register_idle_thread(struct rb_root *threads, struct thread **last_match)
93 return thread; 168 return thread;
94} 169}
95 170
96void thread__insert_map(struct thread *self, struct map *map) 171static void thread__remove_overlappings(struct thread *self, struct map *map)
97{ 172{
98 struct map *pos, *tmp; 173 struct rb_root *root = &self->maps[map->type];
174 struct rb_node *next = rb_first(root);
99 175
100 list_for_each_entry_safe(pos, tmp, &self->maps, node) { 176 while (next) {
101 if (map__overlap(pos, map)) { 177 struct map *pos = rb_entry(next, struct map, rb_node);
102 if (verbose >= 2) { 178 next = rb_next(&pos->rb_node);
103 printf("overlapping maps:\n");
104 map__fprintf(map, stdout);
105 map__fprintf(pos, stdout);
106 }
107 179
108 if (map->start <= pos->start && map->end > pos->start) 180 if (!map__overlap(pos, map))
109 pos->start = map->end; 181 continue;
110 182
111 if (map->end >= pos->end && map->start < pos->end) 183 if (verbose >= 2) {
112 pos->end = map->start; 184 fputs("overlapping maps:\n", stderr);
185 map__fprintf(map, stderr);
186 map__fprintf(pos, stderr);
187 }
113 188
114 if (verbose >= 2) { 189 rb_erase(&pos->rb_node, root);
115 printf("after collision:\n"); 190 /*
116 map__fprintf(pos, stdout); 191 * We may have references to this map, for instance in some
117 } 192 * hist_entry instances, so just move them to a separate
193 * list.
194 */
195 list_add_tail(&pos->node, &self->removed_maps[map->type]);
196 }
197}
118 198
119 if (pos->start >= pos->end) { 199void maps__insert(struct rb_root *maps, struct map *map)
120 list_del_init(&pos->node); 200{
121 free(pos); 201 struct rb_node **p = &maps->rb_node;
122 } 202 struct rb_node *parent = NULL;
123 } 203 const u64 ip = map->start;
204 struct map *m;
205
206 while (*p != NULL) {
207 parent = *p;
208 m = rb_entry(parent, struct map, rb_node);
209 if (ip < m->start)
210 p = &(*p)->rb_left;
211 else
212 p = &(*p)->rb_right;
124 } 213 }
125 214
126 list_add_tail(&map->node, &self->maps); 215 rb_link_node(&map->rb_node, parent, p);
216 rb_insert_color(&map->rb_node, maps);
127} 217}
128 218
129int thread__fork(struct thread *self, struct thread *parent) 219struct map *maps__find(struct rb_root *maps, u64 ip)
130{ 220{
131 struct map *map; 221 struct rb_node **p = &maps->rb_node;
222 struct rb_node *parent = NULL;
223 struct map *m;
132 224
133 if (self->comm) 225 while (*p != NULL) {
134 free(self->comm); 226 parent = *p;
135 self->comm = strdup(parent->comm); 227 m = rb_entry(parent, struct map, rb_node);
136 if (!self->comm) 228 if (ip < m->start)
137 return -ENOMEM; 229 p = &(*p)->rb_left;
230 else if (ip > m->end)
231 p = &(*p)->rb_right;
232 else
233 return m;
234 }
235
236 return NULL;
237}
238
239void thread__insert_map(struct thread *self, struct map *map)
240{
241 thread__remove_overlappings(self, map);
242 maps__insert(&self->maps[map->type], map);
243}
138 244
139 list_for_each_entry(map, &parent->maps, node) { 245static int thread__clone_maps(struct thread *self, struct thread *parent,
246 enum map_type type)
247{
248 struct rb_node *nd;
249 for (nd = rb_first(&parent->maps[type]); nd; nd = rb_next(nd)) {
250 struct map *map = rb_entry(nd, struct map, rb_node);
140 struct map *new = map__clone(map); 251 struct map *new = map__clone(map);
141 if (!new) 252 if (new == NULL)
142 return -ENOMEM; 253 return -ENOMEM;
143 thread__insert_map(self, new); 254 thread__insert_map(self, new);
144 } 255 }
145
146 return 0; 256 return 0;
147} 257}
148 258
149struct map *thread__find_map(struct thread *self, u64 ip) 259int thread__fork(struct thread *self, struct thread *parent)
150{ 260{
151 struct map *pos; 261 int i;
152 262
153 if (self == NULL) 263 if (self->comm)
154 return NULL; 264 free(self->comm);
155 265 self->comm = strdup(parent->comm);
156 list_for_each_entry(pos, &self->maps, node) 266 if (!self->comm)
157 if (ip >= pos->start && ip <= pos->end) 267 return -ENOMEM;
158 return pos;
159 268
160 return NULL; 269 for (i = 0; i < MAP__NR_TYPES; ++i)
270 if (thread__clone_maps(self, parent, i) < 0)
271 return -ENOMEM;
272 return 0;
161} 273}
162 274
163size_t threads__fprintf(FILE *fp, struct rb_root *threads) 275size_t threads__fprintf(FILE *fp)
164{ 276{
165 size_t ret = 0; 277 size_t ret = 0;
166 struct rb_node *nd; 278 struct rb_node *nd;
167 279
168 for (nd = rb_first(threads); nd; nd = rb_next(nd)) { 280 for (nd = rb_first(&threads); nd; nd = rb_next(nd)) {
169 struct thread *pos = rb_entry(nd, struct thread, rb_node); 281 struct thread *pos = rb_entry(nd, struct thread, rb_node);
170 282
171 ret += thread__fprintf(pos, fp); 283 ret += thread__fprintf(pos, fp);
@@ -173,3 +285,15 @@ size_t threads__fprintf(FILE *fp, struct rb_root *threads)
173 285
174 return ret; 286 return ret;
175} 287}
288
289struct symbol *thread__find_symbol(struct thread *self,
290 enum map_type type, u64 addr,
291 symbol_filter_t filter)
292{
293 struct map *map = thread__find_map(self, type, addr);
294
295 if (map != NULL)
296 return map__find_symbol(map, map->map_ip(map, addr), filter);
297
298 return NULL;
299}
diff --git a/tools/perf/util/thread.h b/tools/perf/util/thread.h
index 32aea3c1c2ad..686d6e914d9e 100644
--- a/tools/perf/util/thread.h
+++ b/tools/perf/util/thread.h
@@ -1,22 +1,56 @@
1#ifndef __PERF_THREAD_H
2#define __PERF_THREAD_H
3
1#include <linux/rbtree.h> 4#include <linux/rbtree.h>
2#include <linux/list.h>
3#include <unistd.h> 5#include <unistd.h>
4#include "symbol.h" 6#include "symbol.h"
5 7
6struct thread { 8struct thread {
7 struct rb_node rb_node; 9 struct rb_node rb_node;
8 struct list_head maps; 10 struct rb_root maps[MAP__NR_TYPES];
11 struct list_head removed_maps[MAP__NR_TYPES];
9 pid_t pid; 12 pid_t pid;
13 bool use_modules;
10 char shortname[3]; 14 char shortname[3];
11 char *comm; 15 char *comm;
16 int comm_len;
12}; 17};
13 18
19void thread__init(struct thread *self, pid_t pid);
14int thread__set_comm(struct thread *self, const char *comm); 20int thread__set_comm(struct thread *self, const char *comm);
15struct thread * 21int thread__comm_len(struct thread *self);
16threads__findnew(pid_t pid, struct rb_root *threads, struct thread **last_match); 22struct thread *threads__findnew(pid_t pid);
17struct thread * 23struct thread *register_idle_thread(void);
18register_idle_thread(struct rb_root *threads, struct thread **last_match);
19void thread__insert_map(struct thread *self, struct map *map); 24void thread__insert_map(struct thread *self, struct map *map);
20int thread__fork(struct thread *self, struct thread *parent); 25int thread__fork(struct thread *self, struct thread *parent);
21struct map *thread__find_map(struct thread *self, u64 ip); 26size_t thread__fprintf_maps(struct thread *self, FILE *fp);
22size_t threads__fprintf(FILE *fp, struct rb_root *threads); 27size_t threads__fprintf(FILE *fp);
28
29void maps__insert(struct rb_root *maps, struct map *map);
30struct map *maps__find(struct rb_root *maps, u64 addr);
31
32static inline struct map *thread__find_map(struct thread *self,
33 enum map_type type, u64 addr)
34{
35 return self ? maps__find(&self->maps[type], addr) : NULL;
36}
37
38static inline void __thread__insert_map(struct thread *self, struct map *map)
39{
40 maps__insert(&self->maps[map->type], map);
41}
42
43void thread__find_addr_location(struct thread *self, u8 cpumode,
44 enum map_type type, u64 addr,
45 struct addr_location *al,
46 symbol_filter_t filter);
47struct symbol *thread__find_symbol(struct thread *self,
48 enum map_type type, u64 addr,
49 symbol_filter_t filter);
50
51static inline struct symbol *
52thread__find_function(struct thread *self, u64 addr, symbol_filter_t filter)
53{
54 return thread__find_symbol(self, MAP__FUNCTION, addr, filter);
55}
56#endif /* __PERF_THREAD_H */
diff --git a/tools/perf/util/trace-event-info.c b/tools/perf/util/trace-event-info.c
index af4b0573b37f..cace35595530 100644
--- a/tools/perf/util/trace-event-info.c
+++ b/tools/perf/util/trace-event-info.c
@@ -33,11 +33,11 @@
33#include <ctype.h> 33#include <ctype.h>
34#include <errno.h> 34#include <errno.h>
35#include <stdbool.h> 35#include <stdbool.h>
36#include <linux/kernel.h>
36 37
37#include "../perf.h" 38#include "../perf.h"
38#include "trace-event.h" 39#include "trace-event.h"
39 40
40
41#define VERSION "0.5" 41#define VERSION "0.5"
42 42
43#define _STR(x) #x 43#define _STR(x) #x
@@ -483,27 +483,33 @@ static struct tracepoint_path *
483get_tracepoints_path(struct perf_event_attr *pattrs, int nb_events) 483get_tracepoints_path(struct perf_event_attr *pattrs, int nb_events)
484{ 484{
485 struct tracepoint_path path, *ppath = &path; 485 struct tracepoint_path path, *ppath = &path;
486 int i; 486 int i, nr_tracepoints = 0;
487 487
488 for (i = 0; i < nb_events; i++) { 488 for (i = 0; i < nb_events; i++) {
489 if (pattrs[i].type != PERF_TYPE_TRACEPOINT) 489 if (pattrs[i].type != PERF_TYPE_TRACEPOINT)
490 continue; 490 continue;
491 ++nr_tracepoints;
491 ppath->next = tracepoint_id_to_path(pattrs[i].config); 492 ppath->next = tracepoint_id_to_path(pattrs[i].config);
492 if (!ppath->next) 493 if (!ppath->next)
493 die("%s\n", "No memory to alloc tracepoints list"); 494 die("%s\n", "No memory to alloc tracepoints list");
494 ppath = ppath->next; 495 ppath = ppath->next;
495 } 496 }
496 497
497 return path.next; 498 return nr_tracepoints > 0 ? path.next : NULL;
498} 499}
499void read_tracing_data(struct perf_event_attr *pattrs, int nb_events) 500
501int read_tracing_data(int fd, struct perf_event_attr *pattrs, int nb_events)
500{ 502{
501 char buf[BUFSIZ]; 503 char buf[BUFSIZ];
502 struct tracepoint_path *tps; 504 struct tracepoint_path *tps = get_tracepoints_path(pattrs, nb_events);
505
506 /*
507 * What? No tracepoints? No sense writing anything here, bail out.
508 */
509 if (tps == NULL)
510 return -1;
503 511
504 output_fd = open(output_file, O_WRONLY | O_CREAT | O_TRUNC | O_LARGEFILE, 0644); 512 output_fd = fd;
505 if (output_fd < 0)
506 die("creating file '%s'", output_file);
507 513
508 buf[0] = 23; 514 buf[0] = 23;
509 buf[1] = 8; 515 buf[1] = 8;
@@ -530,11 +536,11 @@ void read_tracing_data(struct perf_event_attr *pattrs, int nb_events)
530 page_size = getpagesize(); 536 page_size = getpagesize();
531 write_or_die(&page_size, 4); 537 write_or_die(&page_size, 4);
532 538
533 tps = get_tracepoints_path(pattrs, nb_events);
534
535 read_header_files(); 539 read_header_files();
536 read_ftrace_files(tps); 540 read_ftrace_files(tps);
537 read_event_files(tps); 541 read_event_files(tps);
538 read_proc_kallsyms(); 542 read_proc_kallsyms();
539 read_ftrace_printk(); 543 read_ftrace_printk();
544
545 return 0;
540} 546}
diff --git a/tools/perf/util/trace-event-parse.c b/tools/perf/util/trace-event-parse.c
index 55c9659a56e2..0302405aa2ca 100644
--- a/tools/perf/util/trace-event-parse.c
+++ b/tools/perf/util/trace-event-parse.c
@@ -40,12 +40,19 @@ int header_page_size_size;
40int header_page_data_offset; 40int header_page_data_offset;
41int header_page_data_size; 41int header_page_data_size;
42 42
43int latency_format;
44
43static char *input_buf; 45static char *input_buf;
44static unsigned long long input_buf_ptr; 46static unsigned long long input_buf_ptr;
45static unsigned long long input_buf_siz; 47static unsigned long long input_buf_siz;
46 48
47static int cpus; 49static int cpus;
48static int long_size; 50static int long_size;
51static int is_flag_field;
52static int is_symbolic_field;
53
54static struct format_field *
55find_any_field(struct event *event, const char *name);
49 56
50static void init_input_buf(char *buf, unsigned long long size) 57static void init_input_buf(char *buf, unsigned long long size)
51{ 58{
@@ -284,18 +291,19 @@ void parse_ftrace_printk(char *file, unsigned int size __unused)
284 char *line; 291 char *line;
285 char *next = NULL; 292 char *next = NULL;
286 char *addr_str; 293 char *addr_str;
287 int ret;
288 int i; 294 int i;
289 295
290 line = strtok_r(file, "\n", &next); 296 line = strtok_r(file, "\n", &next);
291 while (line) { 297 while (line) {
298 addr_str = strsep(&line, ":");
299 if (!line) {
300 warning("error parsing print strings");
301 break;
302 }
292 item = malloc_or_die(sizeof(*item)); 303 item = malloc_or_die(sizeof(*item));
293 ret = sscanf(line, "%as : %as",
294 (float *)(void *)&addr_str, /* workaround gcc warning */
295 (float *)(void *)&item->printk);
296 item->addr = strtoull(addr_str, NULL, 16); 304 item->addr = strtoull(addr_str, NULL, 16);
297 free(addr_str); 305 /* fmt still has a space, skip it */
298 306 item->printk = strdup(line+1);
299 item->next = list; 307 item->next = list;
300 list = item; 308 list = item;
301 line = strtok_r(NULL, "\n", &next); 309 line = strtok_r(NULL, "\n", &next);
@@ -522,7 +530,10 @@ static enum event_type __read_token(char **tok)
522 last_ch = ch; 530 last_ch = ch;
523 ch = __read_char(); 531 ch = __read_char();
524 buf[i++] = ch; 532 buf[i++] = ch;
525 } while (ch != quote_ch && last_ch != '\\'); 533 /* the '\' '\' will cancel itself */
534 if (ch == '\\' && last_ch == '\\')
535 last_ch = 0;
536 } while (ch != quote_ch || last_ch == '\\');
526 /* remove the last quote */ 537 /* remove the last quote */
527 i--; 538 i--;
528 goto out; 539 goto out;
@@ -610,7 +621,7 @@ static enum event_type read_token_item(char **tok)
610static int test_type(enum event_type type, enum event_type expect) 621static int test_type(enum event_type type, enum event_type expect)
611{ 622{
612 if (type != expect) { 623 if (type != expect) {
613 die("Error: expected type %d but read %d", 624 warning("Error: expected type %d but read %d",
614 expect, type); 625 expect, type);
615 return -1; 626 return -1;
616 } 627 }
@@ -621,13 +632,13 @@ static int test_type_token(enum event_type type, char *token,
621 enum event_type expect, const char *expect_tok) 632 enum event_type expect, const char *expect_tok)
622{ 633{
623 if (type != expect) { 634 if (type != expect) {
624 die("Error: expected type %d but read %d", 635 warning("Error: expected type %d but read %d",
625 expect, type); 636 expect, type);
626 return -1; 637 return -1;
627 } 638 }
628 639
629 if (strcmp(token, expect_tok) != 0) { 640 if (strcmp(token, expect_tok) != 0) {
630 die("Error: expected '%s' but read '%s'", 641 warning("Error: expected '%s' but read '%s'",
631 expect_tok, token); 642 expect_tok, token);
632 return -1; 643 return -1;
633 } 644 }
@@ -665,7 +676,7 @@ static int __read_expected(enum event_type expect, const char *str, int newline_
665 676
666 free_token(token); 677 free_token(token);
667 678
668 return 0; 679 return ret;
669} 680}
670 681
671static int read_expected(enum event_type expect, const char *str) 682static int read_expected(enum event_type expect, const char *str)
@@ -682,10 +693,10 @@ static char *event_read_name(void)
682{ 693{
683 char *token; 694 char *token;
684 695
685 if (read_expected(EVENT_ITEM, (char *)"name") < 0) 696 if (read_expected(EVENT_ITEM, "name") < 0)
686 return NULL; 697 return NULL;
687 698
688 if (read_expected(EVENT_OP, (char *)":") < 0) 699 if (read_expected(EVENT_OP, ":") < 0)
689 return NULL; 700 return NULL;
690 701
691 if (read_expect_type(EVENT_ITEM, &token) < 0) 702 if (read_expect_type(EVENT_ITEM, &token) < 0)
@@ -703,10 +714,10 @@ static int event_read_id(void)
703 char *token; 714 char *token;
704 int id; 715 int id;
705 716
706 if (read_expected_item(EVENT_ITEM, (char *)"ID") < 0) 717 if (read_expected_item(EVENT_ITEM, "ID") < 0)
707 return -1; 718 return -1;
708 719
709 if (read_expected(EVENT_OP, (char *)":") < 0) 720 if (read_expected(EVENT_OP, ":") < 0)
710 return -1; 721 return -1;
711 722
712 if (read_expect_type(EVENT_ITEM, &token) < 0) 723 if (read_expect_type(EVENT_ITEM, &token) < 0)
@@ -721,6 +732,24 @@ static int event_read_id(void)
721 return -1; 732 return -1;
722} 733}
723 734
735static int field_is_string(struct format_field *field)
736{
737 if ((field->flags & FIELD_IS_ARRAY) &&
738 (!strstr(field->type, "char") || !strstr(field->type, "u8") ||
739 !strstr(field->type, "s8")))
740 return 1;
741
742 return 0;
743}
744
745static int field_is_dynamic(struct format_field *field)
746{
747 if (!strcmp(field->type, "__data_loc"))
748 return 1;
749
750 return 0;
751}
752
724static int event_read_fields(struct event *event, struct format_field **fields) 753static int event_read_fields(struct event *event, struct format_field **fields)
725{ 754{
726 struct format_field *field = NULL; 755 struct format_field *field = NULL;
@@ -738,7 +767,7 @@ static int event_read_fields(struct event *event, struct format_field **fields)
738 767
739 count++; 768 count++;
740 769
741 if (test_type_token(type, token, EVENT_ITEM, (char *)"field")) 770 if (test_type_token(type, token, EVENT_ITEM, "field"))
742 goto fail; 771 goto fail;
743 free_token(token); 772 free_token(token);
744 773
@@ -753,7 +782,7 @@ static int event_read_fields(struct event *event, struct format_field **fields)
753 type = read_token(&token); 782 type = read_token(&token);
754 } 783 }
755 784
756 if (test_type_token(type, token, EVENT_OP, (char *)":") < 0) 785 if (test_type_token(type, token, EVENT_OP, ":") < 0)
757 return -1; 786 return -1;
758 787
759 if (read_expect_type(EVENT_ITEM, &token) < 0) 788 if (read_expect_type(EVENT_ITEM, &token) < 0)
@@ -865,14 +894,20 @@ static int event_read_fields(struct event *event, struct format_field **fields)
865 free(brackets); 894 free(brackets);
866 } 895 }
867 896
868 if (test_type_token(type, token, EVENT_OP, (char *)";")) 897 if (field_is_string(field)) {
898 field->flags |= FIELD_IS_STRING;
899 if (field_is_dynamic(field))
900 field->flags |= FIELD_IS_DYNAMIC;
901 }
902
903 if (test_type_token(type, token, EVENT_OP, ";"))
869 goto fail; 904 goto fail;
870 free_token(token); 905 free_token(token);
871 906
872 if (read_expected(EVENT_ITEM, (char *)"offset") < 0) 907 if (read_expected(EVENT_ITEM, "offset") < 0)
873 goto fail_expect; 908 goto fail_expect;
874 909
875 if (read_expected(EVENT_OP, (char *)":") < 0) 910 if (read_expected(EVENT_OP, ":") < 0)
876 goto fail_expect; 911 goto fail_expect;
877 912
878 if (read_expect_type(EVENT_ITEM, &token)) 913 if (read_expect_type(EVENT_ITEM, &token))
@@ -880,13 +915,13 @@ static int event_read_fields(struct event *event, struct format_field **fields)
880 field->offset = strtoul(token, NULL, 0); 915 field->offset = strtoul(token, NULL, 0);
881 free_token(token); 916 free_token(token);
882 917
883 if (read_expected(EVENT_OP, (char *)";") < 0) 918 if (read_expected(EVENT_OP, ";") < 0)
884 goto fail_expect; 919 goto fail_expect;
885 920
886 if (read_expected(EVENT_ITEM, (char *)"size") < 0) 921 if (read_expected(EVENT_ITEM, "size") < 0)
887 goto fail_expect; 922 goto fail_expect;
888 923
889 if (read_expected(EVENT_OP, (char *)":") < 0) 924 if (read_expected(EVENT_OP, ":") < 0)
890 goto fail_expect; 925 goto fail_expect;
891 926
892 if (read_expect_type(EVENT_ITEM, &token)) 927 if (read_expect_type(EVENT_ITEM, &token))
@@ -894,11 +929,34 @@ static int event_read_fields(struct event *event, struct format_field **fields)
894 field->size = strtoul(token, NULL, 0); 929 field->size = strtoul(token, NULL, 0);
895 free_token(token); 930 free_token(token);
896 931
897 if (read_expected(EVENT_OP, (char *)";") < 0) 932 if (read_expected(EVENT_OP, ";") < 0)
898 goto fail_expect; 933 goto fail_expect;
899 934
900 if (read_expect_type(EVENT_NEWLINE, &token) < 0) 935 type = read_token(&token);
901 goto fail; 936 if (type != EVENT_NEWLINE) {
937 /* newer versions of the kernel have a "signed" type */
938 if (test_type_token(type, token, EVENT_ITEM, "signed"))
939 goto fail;
940
941 free_token(token);
942
943 if (read_expected(EVENT_OP, ":") < 0)
944 goto fail_expect;
945
946 if (read_expect_type(EVENT_ITEM, &token))
947 goto fail;
948
949 if (strtoul(token, NULL, 0))
950 field->flags |= FIELD_IS_SIGNED;
951
952 free_token(token);
953 if (read_expected(EVENT_OP, ";") < 0)
954 goto fail_expect;
955
956 if (read_expect_type(EVENT_NEWLINE, &token))
957 goto fail;
958 }
959
902 free_token(token); 960 free_token(token);
903 961
904 *fields = field; 962 *fields = field;
@@ -921,10 +979,10 @@ static int event_read_format(struct event *event)
921 char *token; 979 char *token;
922 int ret; 980 int ret;
923 981
924 if (read_expected_item(EVENT_ITEM, (char *)"format") < 0) 982 if (read_expected_item(EVENT_ITEM, "format") < 0)
925 return -1; 983 return -1;
926 984
927 if (read_expected(EVENT_OP, (char *)":") < 0) 985 if (read_expected(EVENT_OP, ":") < 0)
928 return -1; 986 return -1;
929 987
930 if (read_expect_type(EVENT_NEWLINE, &token)) 988 if (read_expect_type(EVENT_NEWLINE, &token))
@@ -984,7 +1042,7 @@ process_cond(struct event *event, struct print_arg *top, char **tok)
984 1042
985 *tok = NULL; 1043 *tok = NULL;
986 type = process_arg(event, left, &token); 1044 type = process_arg(event, left, &token);
987 if (test_type_token(type, token, EVENT_OP, (char *)":")) 1045 if (test_type_token(type, token, EVENT_OP, ":"))
988 goto out_free; 1046 goto out_free;
989 1047
990 arg->op.op = token; 1048 arg->op.op = token;
@@ -1004,6 +1062,35 @@ out_free:
1004 return EVENT_ERROR; 1062 return EVENT_ERROR;
1005} 1063}
1006 1064
1065static enum event_type
1066process_array(struct event *event, struct print_arg *top, char **tok)
1067{
1068 struct print_arg *arg;
1069 enum event_type type;
1070 char *token = NULL;
1071
1072 arg = malloc_or_die(sizeof(*arg));
1073 memset(arg, 0, sizeof(*arg));
1074
1075 *tok = NULL;
1076 type = process_arg(event, arg, &token);
1077 if (test_type_token(type, token, EVENT_OP, "]"))
1078 goto out_free;
1079
1080 top->op.right = arg;
1081
1082 free_token(token);
1083 type = read_token_item(&token);
1084 *tok = token;
1085
1086 return type;
1087
1088out_free:
1089 free_token(*tok);
1090 free_arg(arg);
1091 return EVENT_ERROR;
1092}
1093
1007static int get_op_prio(char *op) 1094static int get_op_prio(char *op)
1008{ 1095{
1009 if (!op[1]) { 1096 if (!op[1]) {
@@ -1128,6 +1215,8 @@ process_op(struct event *event, struct print_arg *arg, char **tok)
1128 strcmp(token, "*") == 0 || 1215 strcmp(token, "*") == 0 ||
1129 strcmp(token, "^") == 0 || 1216 strcmp(token, "^") == 0 ||
1130 strcmp(token, "/") == 0 || 1217 strcmp(token, "/") == 0 ||
1218 strcmp(token, "<") == 0 ||
1219 strcmp(token, ">") == 0 ||
1131 strcmp(token, "==") == 0 || 1220 strcmp(token, "==") == 0 ||
1132 strcmp(token, "!=") == 0) { 1221 strcmp(token, "!=") == 0) {
1133 1222
@@ -1144,17 +1233,46 @@ process_op(struct event *event, struct print_arg *arg, char **tok)
1144 1233
1145 right = malloc_or_die(sizeof(*right)); 1234 right = malloc_or_die(sizeof(*right));
1146 1235
1147 type = process_arg(event, right, tok); 1236 type = read_token_item(&token);
1237 *tok = token;
1238
1239 /* could just be a type pointer */
1240 if ((strcmp(arg->op.op, "*") == 0) &&
1241 type == EVENT_DELIM && (strcmp(token, ")") == 0)) {
1242 if (left->type != PRINT_ATOM)
1243 die("bad pointer type");
1244 left->atom.atom = realloc(left->atom.atom,
1245 sizeof(left->atom.atom) + 3);
1246 strcat(left->atom.atom, " *");
1247 *arg = *left;
1248 free(arg);
1249
1250 return type;
1251 }
1252
1253 type = process_arg_token(event, right, tok, type);
1148 1254
1149 arg->op.right = right; 1255 arg->op.right = right;
1150 1256
1257 } else if (strcmp(token, "[") == 0) {
1258
1259 left = malloc_or_die(sizeof(*left));
1260 *left = *arg;
1261
1262 arg->type = PRINT_OP;
1263 arg->op.op = token;
1264 arg->op.left = left;
1265
1266 arg->op.prio = 0;
1267 type = process_array(event, arg, tok);
1268
1151 } else { 1269 } else {
1152 die("unknown op '%s'", token); 1270 warning("unknown op '%s'", token);
1271 event->flags |= EVENT_FL_FAILED;
1153 /* the arg is now the left side */ 1272 /* the arg is now the left side */
1154 return EVENT_NONE; 1273 return EVENT_NONE;
1155 } 1274 }
1156 1275
1157
1158 if (type == EVENT_OP) { 1276 if (type == EVENT_OP) {
1159 int prio; 1277 int prio;
1160 1278
@@ -1178,7 +1296,7 @@ process_entry(struct event *event __unused, struct print_arg *arg,
1178 char *field; 1296 char *field;
1179 char *token; 1297 char *token;
1180 1298
1181 if (read_expected(EVENT_OP, (char *)"->") < 0) 1299 if (read_expected(EVENT_OP, "->") < 0)
1182 return EVENT_ERROR; 1300 return EVENT_ERROR;
1183 1301
1184 if (read_expect_type(EVENT_ITEM, &token) < 0) 1302 if (read_expect_type(EVENT_ITEM, &token) < 0)
@@ -1188,6 +1306,16 @@ process_entry(struct event *event __unused, struct print_arg *arg,
1188 arg->type = PRINT_FIELD; 1306 arg->type = PRINT_FIELD;
1189 arg->field.name = field; 1307 arg->field.name = field;
1190 1308
1309 if (is_flag_field) {
1310 arg->field.field = find_any_field(event, arg->field.name);
1311 arg->field.field->flags |= FIELD_IS_FLAG;
1312 is_flag_field = 0;
1313 } else if (is_symbolic_field) {
1314 arg->field.field = find_any_field(event, arg->field.name);
1315 arg->field.field->flags |= FIELD_IS_SYMBOLIC;
1316 is_symbolic_field = 0;
1317 }
1318
1191 type = read_token(&token); 1319 type = read_token(&token);
1192 *tok = token; 1320 *tok = token;
1193 1321
@@ -1338,14 +1466,14 @@ process_fields(struct event *event, struct print_flag_sym **list, char **tok)
1338 do { 1466 do {
1339 free_token(token); 1467 free_token(token);
1340 type = read_token_item(&token); 1468 type = read_token_item(&token);
1341 if (test_type_token(type, token, EVENT_OP, (char *)"{")) 1469 if (test_type_token(type, token, EVENT_OP, "{"))
1342 break; 1470 break;
1343 1471
1344 arg = malloc_or_die(sizeof(*arg)); 1472 arg = malloc_or_die(sizeof(*arg));
1345 1473
1346 free_token(token); 1474 free_token(token);
1347 type = process_arg(event, arg, &token); 1475 type = process_arg(event, arg, &token);
1348 if (test_type_token(type, token, EVENT_DELIM, (char *)",")) 1476 if (test_type_token(type, token, EVENT_DELIM, ","))
1349 goto out_free; 1477 goto out_free;
1350 1478
1351 field = malloc_or_die(sizeof(*field)); 1479 field = malloc_or_die(sizeof(*field));
@@ -1356,7 +1484,7 @@ process_fields(struct event *event, struct print_flag_sym **list, char **tok)
1356 1484
1357 free_token(token); 1485 free_token(token);
1358 type = process_arg(event, arg, &token); 1486 type = process_arg(event, arg, &token);
1359 if (test_type_token(type, token, EVENT_OP, (char *)"}")) 1487 if (test_type_token(type, token, EVENT_OP, "}"))
1360 goto out_free; 1488 goto out_free;
1361 1489
1362 value = arg_eval(arg); 1490 value = arg_eval(arg);
@@ -1391,13 +1519,13 @@ process_flags(struct event *event, struct print_arg *arg, char **tok)
1391 memset(arg, 0, sizeof(*arg)); 1519 memset(arg, 0, sizeof(*arg));
1392 arg->type = PRINT_FLAGS; 1520 arg->type = PRINT_FLAGS;
1393 1521
1394 if (read_expected_item(EVENT_DELIM, (char *)"(") < 0) 1522 if (read_expected_item(EVENT_DELIM, "(") < 0)
1395 return EVENT_ERROR; 1523 return EVENT_ERROR;
1396 1524
1397 field = malloc_or_die(sizeof(*field)); 1525 field = malloc_or_die(sizeof(*field));
1398 1526
1399 type = process_arg(event, field, &token); 1527 type = process_arg(event, field, &token);
1400 if (test_type_token(type, token, EVENT_DELIM, (char *)",")) 1528 if (test_type_token(type, token, EVENT_DELIM, ","))
1401 goto out_free; 1529 goto out_free;
1402 1530
1403 arg->flags.field = field; 1531 arg->flags.field = field;
@@ -1408,11 +1536,11 @@ process_flags(struct event *event, struct print_arg *arg, char **tok)
1408 type = read_token_item(&token); 1536 type = read_token_item(&token);
1409 } 1537 }
1410 1538
1411 if (test_type_token(type, token, EVENT_DELIM, (char *)",")) 1539 if (test_type_token(type, token, EVENT_DELIM, ","))
1412 goto out_free; 1540 goto out_free;
1413 1541
1414 type = process_fields(event, &arg->flags.flags, &token); 1542 type = process_fields(event, &arg->flags.flags, &token);
1415 if (test_type_token(type, token, EVENT_DELIM, (char *)")")) 1543 if (test_type_token(type, token, EVENT_DELIM, ")"))
1416 goto out_free; 1544 goto out_free;
1417 1545
1418 free_token(token); 1546 free_token(token);
@@ -1434,19 +1562,19 @@ process_symbols(struct event *event, struct print_arg *arg, char **tok)
1434 memset(arg, 0, sizeof(*arg)); 1562 memset(arg, 0, sizeof(*arg));
1435 arg->type = PRINT_SYMBOL; 1563 arg->type = PRINT_SYMBOL;
1436 1564
1437 if (read_expected_item(EVENT_DELIM, (char *)"(") < 0) 1565 if (read_expected_item(EVENT_DELIM, "(") < 0)
1438 return EVENT_ERROR; 1566 return EVENT_ERROR;
1439 1567
1440 field = malloc_or_die(sizeof(*field)); 1568 field = malloc_or_die(sizeof(*field));
1441 1569
1442 type = process_arg(event, field, &token); 1570 type = process_arg(event, field, &token);
1443 if (test_type_token(type, token, EVENT_DELIM, (char *)",")) 1571 if (test_type_token(type, token, EVENT_DELIM, ","))
1444 goto out_free; 1572 goto out_free;
1445 1573
1446 arg->symbol.field = field; 1574 arg->symbol.field = field;
1447 1575
1448 type = process_fields(event, &arg->symbol.symbols, &token); 1576 type = process_fields(event, &arg->symbol.symbols, &token);
1449 if (test_type_token(type, token, EVENT_DELIM, (char *)")")) 1577 if (test_type_token(type, token, EVENT_DELIM, ")"))
1450 goto out_free; 1578 goto out_free;
1451 1579
1452 free_token(token); 1580 free_token(token);
@@ -1463,7 +1591,6 @@ process_paren(struct event *event, struct print_arg *arg, char **tok)
1463{ 1591{
1464 struct print_arg *item_arg; 1592 struct print_arg *item_arg;
1465 enum event_type type; 1593 enum event_type type;
1466 int ptr_cast = 0;
1467 char *token; 1594 char *token;
1468 1595
1469 type = process_arg(event, arg, &token); 1596 type = process_arg(event, arg, &token);
@@ -1471,28 +1598,13 @@ process_paren(struct event *event, struct print_arg *arg, char **tok)
1471 if (type == EVENT_ERROR) 1598 if (type == EVENT_ERROR)
1472 return EVENT_ERROR; 1599 return EVENT_ERROR;
1473 1600
1474 if (type == EVENT_OP) { 1601 if (type == EVENT_OP)
1475 /* handle the ptr casts */ 1602 type = process_op(event, arg, &token);
1476 if (!strcmp(token, "*")) {
1477 /*
1478 * FIXME: should we zapp whitespaces before ')' ?
1479 * (may require a peek_token_item())
1480 */
1481 if (__peek_char() == ')') {
1482 ptr_cast = 1;
1483 free_token(token);
1484 type = read_token_item(&token);
1485 }
1486 }
1487 if (!ptr_cast) {
1488 type = process_op(event, arg, &token);
1489 1603
1490 if (type == EVENT_ERROR) 1604 if (type == EVENT_ERROR)
1491 return EVENT_ERROR; 1605 return EVENT_ERROR;
1492 }
1493 }
1494 1606
1495 if (test_type_token(type, token, EVENT_DELIM, (char *)")")) { 1607 if (test_type_token(type, token, EVENT_DELIM, ")")) {
1496 free_token(token); 1608 free_token(token);
1497 return EVENT_ERROR; 1609 return EVENT_ERROR;
1498 } 1610 }
@@ -1516,13 +1628,6 @@ process_paren(struct event *event, struct print_arg *arg, char **tok)
1516 item_arg = malloc_or_die(sizeof(*item_arg)); 1628 item_arg = malloc_or_die(sizeof(*item_arg));
1517 1629
1518 arg->type = PRINT_TYPE; 1630 arg->type = PRINT_TYPE;
1519 if (ptr_cast) {
1520 char *old = arg->atom.atom;
1521
1522 arg->atom.atom = malloc_or_die(strlen(old + 3));
1523 sprintf(arg->atom.atom, "%s *", old);
1524 free(old);
1525 }
1526 arg->typecast.type = arg->atom.atom; 1631 arg->typecast.type = arg->atom.atom;
1527 arg->typecast.item = item_arg; 1632 arg->typecast.item = item_arg;
1528 type = process_arg_token(event, item_arg, &token, type); 1633 type = process_arg_token(event, item_arg, &token, type);
@@ -1540,7 +1645,7 @@ process_str(struct event *event __unused, struct print_arg *arg, char **tok)
1540 enum event_type type; 1645 enum event_type type;
1541 char *token; 1646 char *token;
1542 1647
1543 if (read_expected(EVENT_DELIM, (char *)"(") < 0) 1648 if (read_expected(EVENT_DELIM, "(") < 0)
1544 return EVENT_ERROR; 1649 return EVENT_ERROR;
1545 1650
1546 if (read_expect_type(EVENT_ITEM, &token) < 0) 1651 if (read_expect_type(EVENT_ITEM, &token) < 0)
@@ -1550,7 +1655,7 @@ process_str(struct event *event __unused, struct print_arg *arg, char **tok)
1550 arg->string.string = token; 1655 arg->string.string = token;
1551 arg->string.offset = -1; 1656 arg->string.offset = -1;
1552 1657
1553 if (read_expected(EVENT_DELIM, (char *)")") < 0) 1658 if (read_expected(EVENT_DELIM, ")") < 0)
1554 return EVENT_ERROR; 1659 return EVENT_ERROR;
1555 1660
1556 type = read_token(&token); 1661 type = read_token(&token);
@@ -1578,9 +1683,11 @@ process_arg_token(struct event *event, struct print_arg *arg,
1578 type = process_entry(event, arg, &token); 1683 type = process_entry(event, arg, &token);
1579 } else if (strcmp(token, "__print_flags") == 0) { 1684 } else if (strcmp(token, "__print_flags") == 0) {
1580 free_token(token); 1685 free_token(token);
1686 is_flag_field = 1;
1581 type = process_flags(event, arg, &token); 1687 type = process_flags(event, arg, &token);
1582 } else if (strcmp(token, "__print_symbolic") == 0) { 1688 } else if (strcmp(token, "__print_symbolic") == 0) {
1583 free_token(token); 1689 free_token(token);
1690 is_symbolic_field = 1;
1584 type = process_symbols(event, arg, &token); 1691 type = process_symbols(event, arg, &token);
1585 } else if (strcmp(token, "__get_str") == 0) { 1692 } else if (strcmp(token, "__get_str") == 0) {
1586 free_token(token); 1693 free_token(token);
@@ -1637,12 +1744,18 @@ process_arg_token(struct event *event, struct print_arg *arg,
1637 1744
1638static int event_read_print_args(struct event *event, struct print_arg **list) 1745static int event_read_print_args(struct event *event, struct print_arg **list)
1639{ 1746{
1640 enum event_type type; 1747 enum event_type type = EVENT_ERROR;
1641 struct print_arg *arg; 1748 struct print_arg *arg;
1642 char *token; 1749 char *token;
1643 int args = 0; 1750 int args = 0;
1644 1751
1645 do { 1752 do {
1753 if (type == EVENT_NEWLINE) {
1754 free_token(token);
1755 type = read_token_item(&token);
1756 continue;
1757 }
1758
1646 arg = malloc_or_die(sizeof(*arg)); 1759 arg = malloc_or_die(sizeof(*arg));
1647 memset(arg, 0, sizeof(*arg)); 1760 memset(arg, 0, sizeof(*arg));
1648 1761
@@ -1683,18 +1796,19 @@ static int event_read_print(struct event *event)
1683 char *token; 1796 char *token;
1684 int ret; 1797 int ret;
1685 1798
1686 if (read_expected_item(EVENT_ITEM, (char *)"print") < 0) 1799 if (read_expected_item(EVENT_ITEM, "print") < 0)
1687 return -1; 1800 return -1;
1688 1801
1689 if (read_expected(EVENT_ITEM, (char *)"fmt") < 0) 1802 if (read_expected(EVENT_ITEM, "fmt") < 0)
1690 return -1; 1803 return -1;
1691 1804
1692 if (read_expected(EVENT_OP, (char *)":") < 0) 1805 if (read_expected(EVENT_OP, ":") < 0)
1693 return -1; 1806 return -1;
1694 1807
1695 if (read_expect_type(EVENT_DQUOTE, &token) < 0) 1808 if (read_expect_type(EVENT_DQUOTE, &token) < 0)
1696 goto fail; 1809 goto fail;
1697 1810
1811 concat:
1698 event->print_fmt.format = token; 1812 event->print_fmt.format = token;
1699 event->print_fmt.args = NULL; 1813 event->print_fmt.args = NULL;
1700 1814
@@ -1704,7 +1818,22 @@ static int event_read_print(struct event *event)
1704 if (type == EVENT_NONE) 1818 if (type == EVENT_NONE)
1705 return 0; 1819 return 0;
1706 1820
1707 if (test_type_token(type, token, EVENT_DELIM, (char *)",")) 1821 /* Handle concatination of print lines */
1822 if (type == EVENT_DQUOTE) {
1823 char *cat;
1824
1825 cat = malloc_or_die(strlen(event->print_fmt.format) +
1826 strlen(token) + 1);
1827 strcpy(cat, event->print_fmt.format);
1828 strcat(cat, token);
1829 free_token(token);
1830 free_token(event->print_fmt.format);
1831 event->print_fmt.format = NULL;
1832 token = cat;
1833 goto concat;
1834 }
1835
1836 if (test_type_token(type, token, EVENT_DELIM, ","))
1708 goto fail; 1837 goto fail;
1709 1838
1710 free_token(token); 1839 free_token(token);
@@ -1713,7 +1842,7 @@ static int event_read_print(struct event *event)
1713 if (ret < 0) 1842 if (ret < 0)
1714 return -1; 1843 return -1;
1715 1844
1716 return 0; 1845 return ret;
1717 1846
1718 fail: 1847 fail:
1719 free_token(token); 1848 free_token(token);
@@ -1759,7 +1888,7 @@ find_any_field(struct event *event, const char *name)
1759 return find_field(event, name); 1888 return find_field(event, name);
1760} 1889}
1761 1890
1762static unsigned long long read_size(void *ptr, int size) 1891unsigned long long read_size(void *ptr, int size)
1763{ 1892{
1764 switch (size) { 1893 switch (size) {
1765 case 1: 1894 case 1:
@@ -1822,37 +1951,67 @@ static int get_common_info(const char *type, int *offset, int *size)
1822 return 0; 1951 return 0;
1823} 1952}
1824 1953
1825int trace_parse_common_type(void *data) 1954static int __parse_common(void *data, int *size, int *offset,
1955 const char *name)
1826{ 1956{
1827 static int type_offset;
1828 static int type_size;
1829 int ret; 1957 int ret;
1830 1958
1831 if (!type_size) { 1959 if (!*size) {
1832 ret = get_common_info("common_type", 1960 ret = get_common_info(name, offset, size);
1833 &type_offset,
1834 &type_size);
1835 if (ret < 0) 1961 if (ret < 0)
1836 return ret; 1962 return ret;
1837 } 1963 }
1838 return read_size(data + type_offset, type_size); 1964 return read_size(data + *offset, *size);
1965}
1966
1967int trace_parse_common_type(void *data)
1968{
1969 static int type_offset;
1970 static int type_size;
1971
1972 return __parse_common(data, &type_size, &type_offset,
1973 "common_type");
1839} 1974}
1840 1975
1841static int parse_common_pid(void *data) 1976int trace_parse_common_pid(void *data)
1842{ 1977{
1843 static int pid_offset; 1978 static int pid_offset;
1844 static int pid_size; 1979 static int pid_size;
1980
1981 return __parse_common(data, &pid_size, &pid_offset,
1982 "common_pid");
1983}
1984
1985int parse_common_pc(void *data)
1986{
1987 static int pc_offset;
1988 static int pc_size;
1989
1990 return __parse_common(data, &pc_size, &pc_offset,
1991 "common_preempt_count");
1992}
1993
1994int parse_common_flags(void *data)
1995{
1996 static int flags_offset;
1997 static int flags_size;
1998
1999 return __parse_common(data, &flags_size, &flags_offset,
2000 "common_flags");
2001}
2002
2003int parse_common_lock_depth(void *data)
2004{
2005 static int ld_offset;
2006 static int ld_size;
1845 int ret; 2007 int ret;
1846 2008
1847 if (!pid_size) { 2009 ret = __parse_common(data, &ld_size, &ld_offset,
1848 ret = get_common_info("common_pid", 2010 "common_lock_depth");
1849 &pid_offset, 2011 if (ret < 0)
1850 &pid_size); 2012 return -1;
1851 if (ret < 0)
1852 return ret;
1853 }
1854 2013
1855 return read_size(data + pid_offset, pid_size); 2014 return ret;
1856} 2015}
1857 2016
1858struct event *trace_find_event(int id) 2017struct event *trace_find_event(int id)
@@ -1866,11 +2025,20 @@ struct event *trace_find_event(int id)
1866 return event; 2025 return event;
1867} 2026}
1868 2027
2028struct event *trace_find_next_event(struct event *event)
2029{
2030 if (!event)
2031 return event_list;
2032
2033 return event->next;
2034}
2035
1869static unsigned long long eval_num_arg(void *data, int size, 2036static unsigned long long eval_num_arg(void *data, int size,
1870 struct event *event, struct print_arg *arg) 2037 struct event *event, struct print_arg *arg)
1871{ 2038{
1872 unsigned long long val = 0; 2039 unsigned long long val = 0;
1873 unsigned long long left, right; 2040 unsigned long long left, right;
2041 struct print_arg *larg;
1874 2042
1875 switch (arg->type) { 2043 switch (arg->type) {
1876 case PRINT_NULL: 2044 case PRINT_NULL:
@@ -1897,6 +2065,26 @@ static unsigned long long eval_num_arg(void *data, int size,
1897 return 0; 2065 return 0;
1898 break; 2066 break;
1899 case PRINT_OP: 2067 case PRINT_OP:
2068 if (strcmp(arg->op.op, "[") == 0) {
2069 /*
2070 * Arrays are special, since we don't want
2071 * to read the arg as is.
2072 */
2073 if (arg->op.left->type != PRINT_FIELD)
2074 goto default_op; /* oops, all bets off */
2075 larg = arg->op.left;
2076 if (!larg->field.field) {
2077 larg->field.field =
2078 find_any_field(event, larg->field.name);
2079 if (!larg->field.field)
2080 die("field %s not found", larg->field.name);
2081 }
2082 right = eval_num_arg(data, size, event, arg->op.right);
2083 val = read_size(data + larg->field.field->offset +
2084 right * long_size, long_size);
2085 break;
2086 }
2087 default_op:
1900 left = eval_num_arg(data, size, event, arg->op.left); 2088 left = eval_num_arg(data, size, event, arg->op.left);
1901 right = eval_num_arg(data, size, event, arg->op.right); 2089 right = eval_num_arg(data, size, event, arg->op.right);
1902 switch (arg->op.op[0]) { 2090 switch (arg->op.op[0]) {
@@ -1947,6 +2135,12 @@ static unsigned long long eval_num_arg(void *data, int size,
1947 die("unknown op '%s'", arg->op.op); 2135 die("unknown op '%s'", arg->op.op);
1948 val = left == right; 2136 val = left == right;
1949 break; 2137 break;
2138 case '-':
2139 val = left - right;
2140 break;
2141 case '+':
2142 val = left + right;
2143 break;
1950 default: 2144 default:
1951 die("unknown op '%s'", arg->op.op); 2145 die("unknown op '%s'", arg->op.op);
1952 } 2146 }
@@ -1978,7 +2172,7 @@ static const struct flag flags[] = {
1978 { "HRTIMER_RESTART", 1 }, 2172 { "HRTIMER_RESTART", 1 },
1979}; 2173};
1980 2174
1981static unsigned long long eval_flag(const char *flag) 2175unsigned long long eval_flag(const char *flag)
1982{ 2176{
1983 int i; 2177 int i;
1984 2178
@@ -2145,8 +2339,9 @@ static struct print_arg *make_bprint_args(char *fmt, void *data, int size, struc
2145 case 'u': 2339 case 'u':
2146 case 'x': 2340 case 'x':
2147 case 'i': 2341 case 'i':
2148 bptr = (void *)(((unsigned long)bptr + (long_size - 1)) & 2342 /* the pointers are always 4 bytes aligned */
2149 ~(long_size - 1)); 2343 bptr = (void *)(((unsigned long)bptr + 3) &
2344 ~3);
2150 switch (ls) { 2345 switch (ls) {
2151 case 0: 2346 case 0:
2152 case 1: 2347 case 1:
@@ -2270,7 +2465,27 @@ static void pretty_print(void *data, int size, struct event *event)
2270 2465
2271 for (; *ptr; ptr++) { 2466 for (; *ptr; ptr++) {
2272 ls = 0; 2467 ls = 0;
2273 if (*ptr == '%') { 2468 if (*ptr == '\\') {
2469 ptr++;
2470 switch (*ptr) {
2471 case 'n':
2472 printf("\n");
2473 break;
2474 case 't':
2475 printf("\t");
2476 break;
2477 case 'r':
2478 printf("\r");
2479 break;
2480 case '\\':
2481 printf("\\");
2482 break;
2483 default:
2484 printf("%c", *ptr);
2485 break;
2486 }
2487
2488 } else if (*ptr == '%') {
2274 saveptr = ptr; 2489 saveptr = ptr;
2275 show_func = 0; 2490 show_func = 0;
2276 cont_process: 2491 cont_process:
@@ -2377,6 +2592,41 @@ static inline int log10_cpu(int nb)
2377 return 1; 2592 return 1;
2378} 2593}
2379 2594
2595static void print_lat_fmt(void *data, int size __unused)
2596{
2597 unsigned int lat_flags;
2598 unsigned int pc;
2599 int lock_depth;
2600 int hardirq;
2601 int softirq;
2602
2603 lat_flags = parse_common_flags(data);
2604 pc = parse_common_pc(data);
2605 lock_depth = parse_common_lock_depth(data);
2606
2607 hardirq = lat_flags & TRACE_FLAG_HARDIRQ;
2608 softirq = lat_flags & TRACE_FLAG_SOFTIRQ;
2609
2610 printf("%c%c%c",
2611 (lat_flags & TRACE_FLAG_IRQS_OFF) ? 'd' :
2612 (lat_flags & TRACE_FLAG_IRQS_NOSUPPORT) ?
2613 'X' : '.',
2614 (lat_flags & TRACE_FLAG_NEED_RESCHED) ?
2615 'N' : '.',
2616 (hardirq && softirq) ? 'H' :
2617 hardirq ? 'h' : softirq ? 's' : '.');
2618
2619 if (pc)
2620 printf("%x", pc);
2621 else
2622 printf(".");
2623
2624 if (lock_depth < 0)
2625 printf(".");
2626 else
2627 printf("%d", lock_depth);
2628}
2629
2380/* taken from Linux, written by Frederic Weisbecker */ 2630/* taken from Linux, written by Frederic Weisbecker */
2381static void print_graph_cpu(int cpu) 2631static void print_graph_cpu(int cpu)
2382{ 2632{
@@ -2452,7 +2702,7 @@ get_return_for_leaf(int cpu, int cur_pid, unsigned long long cur_func,
2452 if (!(event->flags & EVENT_FL_ISFUNCRET)) 2702 if (!(event->flags & EVENT_FL_ISFUNCRET))
2453 return NULL; 2703 return NULL;
2454 2704
2455 pid = parse_common_pid(next->data); 2705 pid = trace_parse_common_pid(next->data);
2456 field = find_field(event, "func"); 2706 field = find_field(event, "func");
2457 if (!field) 2707 if (!field)
2458 die("function return does not have field func"); 2708 die("function return does not have field func");
@@ -2620,6 +2870,11 @@ pretty_print_func_ent(void *data, int size, struct event *event,
2620 2870
2621 printf(" | "); 2871 printf(" | ");
2622 2872
2873 if (latency_format) {
2874 print_lat_fmt(data, size);
2875 printf(" | ");
2876 }
2877
2623 field = find_field(event, "func"); 2878 field = find_field(event, "func");
2624 if (!field) 2879 if (!field)
2625 die("function entry does not have func field"); 2880 die("function entry does not have func field");
@@ -2663,6 +2918,11 @@ pretty_print_func_ret(void *data, int size __unused, struct event *event,
2663 2918
2664 printf(" | "); 2919 printf(" | ");
2665 2920
2921 if (latency_format) {
2922 print_lat_fmt(data, size);
2923 printf(" | ");
2924 }
2925
2666 field = find_field(event, "rettime"); 2926 field = find_field(event, "rettime");
2667 if (!field) 2927 if (!field)
2668 die("can't find rettime in return graph"); 2928 die("can't find rettime in return graph");
@@ -2724,19 +2984,30 @@ void print_event(int cpu, void *data, int size, unsigned long long nsecs,
2724 2984
2725 event = trace_find_event(type); 2985 event = trace_find_event(type);
2726 if (!event) { 2986 if (!event) {
2727 printf("ug! no event found for type %d\n", type); 2987 warning("ug! no event found for type %d", type);
2728 return; 2988 return;
2729 } 2989 }
2730 2990
2731 pid = parse_common_pid(data); 2991 pid = trace_parse_common_pid(data);
2732 2992
2733 if (event->flags & (EVENT_FL_ISFUNCENT | EVENT_FL_ISFUNCRET)) 2993 if (event->flags & (EVENT_FL_ISFUNCENT | EVENT_FL_ISFUNCRET))
2734 return pretty_print_func_graph(data, size, event, cpu, 2994 return pretty_print_func_graph(data, size, event, cpu,
2735 pid, comm, secs, usecs); 2995 pid, comm, secs, usecs);
2736 2996
2737 printf("%16s-%-5d [%03d] %5lu.%09Lu: %s: ", 2997 if (latency_format) {
2738 comm, pid, cpu, 2998 printf("%8.8s-%-5d %3d",
2739 secs, nsecs, event->name); 2999 comm, pid, cpu);
3000 print_lat_fmt(data, size);
3001 } else
3002 printf("%16s-%-5d [%03d]", comm, pid, cpu);
3003
3004 printf(" %5lu.%06lu: %s: ", secs, usecs, event->name);
3005
3006 if (event->flags & EVENT_FL_FAILED) {
3007 printf("EVENT '%s' FAILED TO PARSE\n",
3008 event->name);
3009 return;
3010 }
2740 3011
2741 pretty_print(data, size, event); 3012 pretty_print(data, size, event);
2742 printf("\n"); 3013 printf("\n");
@@ -2807,46 +3078,71 @@ static void print_args(struct print_arg *args)
2807 } 3078 }
2808} 3079}
2809 3080
2810static void parse_header_field(char *type, 3081static void parse_header_field(const char *field,
2811 int *offset, int *size) 3082 int *offset, int *size)
2812{ 3083{
2813 char *token; 3084 char *token;
3085 int type;
2814 3086
2815 if (read_expected(EVENT_ITEM, (char *)"field") < 0) 3087 if (read_expected(EVENT_ITEM, "field") < 0)
2816 return; 3088 return;
2817 if (read_expected(EVENT_OP, (char *)":") < 0) 3089 if (read_expected(EVENT_OP, ":") < 0)
2818 return; 3090 return;
3091
2819 /* type */ 3092 /* type */
2820 if (read_expect_type(EVENT_ITEM, &token) < 0) 3093 if (read_expect_type(EVENT_ITEM, &token) < 0)
2821 return; 3094 goto fail;
2822 free_token(token); 3095 free_token(token);
2823 3096
2824 if (read_expected(EVENT_ITEM, type) < 0) 3097 if (read_expected(EVENT_ITEM, field) < 0)
2825 return; 3098 return;
2826 if (read_expected(EVENT_OP, (char *)";") < 0) 3099 if (read_expected(EVENT_OP, ";") < 0)
2827 return; 3100 return;
2828 if (read_expected(EVENT_ITEM, (char *)"offset") < 0) 3101 if (read_expected(EVENT_ITEM, "offset") < 0)
2829 return; 3102 return;
2830 if (read_expected(EVENT_OP, (char *)":") < 0) 3103 if (read_expected(EVENT_OP, ":") < 0)
2831 return; 3104 return;
2832 if (read_expect_type(EVENT_ITEM, &token) < 0) 3105 if (read_expect_type(EVENT_ITEM, &token) < 0)
2833 return; 3106 goto fail;
2834 *offset = atoi(token); 3107 *offset = atoi(token);
2835 free_token(token); 3108 free_token(token);
2836 if (read_expected(EVENT_OP, (char *)";") < 0) 3109 if (read_expected(EVENT_OP, ";") < 0)
2837 return; 3110 return;
2838 if (read_expected(EVENT_ITEM, (char *)"size") < 0) 3111 if (read_expected(EVENT_ITEM, "size") < 0)
2839 return; 3112 return;
2840 if (read_expected(EVENT_OP, (char *)":") < 0) 3113 if (read_expected(EVENT_OP, ":") < 0)
2841 return; 3114 return;
2842 if (read_expect_type(EVENT_ITEM, &token) < 0) 3115 if (read_expect_type(EVENT_ITEM, &token) < 0)
2843 return; 3116 goto fail;
2844 *size = atoi(token); 3117 *size = atoi(token);
2845 free_token(token); 3118 free_token(token);
2846 if (read_expected(EVENT_OP, (char *)";") < 0) 3119 if (read_expected(EVENT_OP, ";") < 0)
2847 return;
2848 if (read_expect_type(EVENT_NEWLINE, &token) < 0)
2849 return; 3120 return;
3121 type = read_token(&token);
3122 if (type != EVENT_NEWLINE) {
3123 /* newer versions of the kernel have a "signed" type */
3124 if (type != EVENT_ITEM)
3125 goto fail;
3126
3127 if (strcmp(token, "signed") != 0)
3128 goto fail;
3129
3130 free_token(token);
3131
3132 if (read_expected(EVENT_OP, ":") < 0)
3133 return;
3134
3135 if (read_expect_type(EVENT_ITEM, &token))
3136 goto fail;
3137
3138 free_token(token);
3139 if (read_expected(EVENT_OP, ";") < 0)
3140 return;
3141
3142 if (read_expect_type(EVENT_NEWLINE, &token))
3143 goto fail;
3144 }
3145 fail:
2850 free_token(token); 3146 free_token(token);
2851} 3147}
2852 3148
@@ -2854,11 +3150,11 @@ int parse_header_page(char *buf, unsigned long size)
2854{ 3150{
2855 init_input_buf(buf, size); 3151 init_input_buf(buf, size);
2856 3152
2857 parse_header_field((char *)"timestamp", &header_page_ts_offset, 3153 parse_header_field("timestamp", &header_page_ts_offset,
2858 &header_page_ts_size); 3154 &header_page_ts_size);
2859 parse_header_field((char *)"commit", &header_page_size_offset, 3155 parse_header_field("commit", &header_page_size_offset,
2860 &header_page_size_size); 3156 &header_page_size_size);
2861 parse_header_field((char *)"data", &header_page_data_offset, 3157 parse_header_field("data", &header_page_data_offset,
2862 &header_page_data_size); 3158 &header_page_data_size);
2863 3159
2864 return 0; 3160 return 0;
@@ -2909,6 +3205,9 @@ int parse_ftrace_file(char *buf, unsigned long size)
2909 if (ret < 0) 3205 if (ret < 0)
2910 die("failed to read ftrace event print fmt"); 3206 die("failed to read ftrace event print fmt");
2911 3207
3208 /* New ftrace handles args */
3209 if (ret > 0)
3210 return 0;
2912 /* 3211 /*
2913 * The arguments for ftrace files are parsed by the fields. 3212 * The arguments for ftrace files are parsed by the fields.
2914 * Set up the fields as their arguments. 3213 * Set up the fields as their arguments.
@@ -2926,7 +3225,7 @@ int parse_ftrace_file(char *buf, unsigned long size)
2926 return 0; 3225 return 0;
2927} 3226}
2928 3227
2929int parse_event_file(char *buf, unsigned long size, char *system__unused __unused) 3228int parse_event_file(char *buf, unsigned long size, char *sys)
2930{ 3229{
2931 struct event *event; 3230 struct event *event;
2932 int ret; 3231 int ret;
@@ -2946,12 +3245,18 @@ int parse_event_file(char *buf, unsigned long size, char *system__unused __unuse
2946 die("failed to read event id"); 3245 die("failed to read event id");
2947 3246
2948 ret = event_read_format(event); 3247 ret = event_read_format(event);
2949 if (ret < 0) 3248 if (ret < 0) {
2950 die("failed to read event format"); 3249 warning("failed to read event format for %s", event->name);
3250 goto event_failed;
3251 }
2951 3252
2952 ret = event_read_print(event); 3253 ret = event_read_print(event);
2953 if (ret < 0) 3254 if (ret < 0) {
2954 die("failed to read event print fmt"); 3255 warning("failed to read event print fmt for %s", event->name);
3256 goto event_failed;
3257 }
3258
3259 event->system = strdup(sys);
2955 3260
2956#define PRINT_ARGS 0 3261#define PRINT_ARGS 0
2957 if (PRINT_ARGS && event->print_fmt.args) 3262 if (PRINT_ARGS && event->print_fmt.args)
@@ -2959,6 +3264,12 @@ int parse_event_file(char *buf, unsigned long size, char *system__unused __unuse
2959 3264
2960 add_event(event); 3265 add_event(event);
2961 return 0; 3266 return 0;
3267
3268 event_failed:
3269 event->flags |= EVENT_FL_FAILED;
3270 /* still add it even if it failed */
3271 add_event(event);
3272 return -1;
2962} 3273}
2963 3274
2964void parse_set_info(int nr_cpus, int long_sz) 3275void parse_set_info(int nr_cpus, int long_sz)
diff --git a/tools/perf/util/trace-event-perl.c b/tools/perf/util/trace-event-perl.c
new file mode 100644
index 000000000000..51e833fd58c3
--- /dev/null
+++ b/tools/perf/util/trace-event-perl.c
@@ -0,0 +1,598 @@
1/*
2 * trace-event-perl. Feed perf trace events to an embedded Perl interpreter.
3 *
4 * Copyright (C) 2009 Tom Zanussi <tzanussi@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 * (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 */
21
22#include <stdio.h>
23#include <stdlib.h>
24#include <string.h>
25#include <ctype.h>
26#include <errno.h>
27
28#include "../perf.h"
29#include "util.h"
30#include "trace-event.h"
31#include "trace-event-perl.h"
32
33void xs_init(pTHX);
34
35void boot_Perf__Trace__Context(pTHX_ CV *cv);
36void boot_DynaLoader(pTHX_ CV *cv);
37
38void xs_init(pTHX)
39{
40 const char *file = __FILE__;
41 dXSUB_SYS;
42
43 newXS("Perf::Trace::Context::bootstrap", boot_Perf__Trace__Context,
44 file);
45 newXS("DynaLoader::boot_DynaLoader", boot_DynaLoader, file);
46}
47
48INTERP my_perl;
49
50#define FTRACE_MAX_EVENT \
51 ((1 << (sizeof(unsigned short) * 8)) - 1)
52
53struct event *events[FTRACE_MAX_EVENT];
54
55static struct scripting_context *scripting_context;
56
57static char *cur_field_name;
58static int zero_flag_atom;
59
60static void define_symbolic_value(const char *ev_name,
61 const char *field_name,
62 const char *field_value,
63 const char *field_str)
64{
65 unsigned long long value;
66 dSP;
67
68 value = eval_flag(field_value);
69
70 ENTER;
71 SAVETMPS;
72 PUSHMARK(SP);
73
74 XPUSHs(sv_2mortal(newSVpv(ev_name, 0)));
75 XPUSHs(sv_2mortal(newSVpv(field_name, 0)));
76 XPUSHs(sv_2mortal(newSVuv(value)));
77 XPUSHs(sv_2mortal(newSVpv(field_str, 0)));
78
79 PUTBACK;
80 if (get_cv("main::define_symbolic_value", 0))
81 call_pv("main::define_symbolic_value", G_SCALAR);
82 SPAGAIN;
83 PUTBACK;
84 FREETMPS;
85 LEAVE;
86}
87
88static void define_symbolic_values(struct print_flag_sym *field,
89 const char *ev_name,
90 const char *field_name)
91{
92 define_symbolic_value(ev_name, field_name, field->value, field->str);
93 if (field->next)
94 define_symbolic_values(field->next, ev_name, field_name);
95}
96
97static void define_symbolic_field(const char *ev_name,
98 const char *field_name)
99{
100 dSP;
101
102 ENTER;
103 SAVETMPS;
104 PUSHMARK(SP);
105
106 XPUSHs(sv_2mortal(newSVpv(ev_name, 0)));
107 XPUSHs(sv_2mortal(newSVpv(field_name, 0)));
108
109 PUTBACK;
110 if (get_cv("main::define_symbolic_field", 0))
111 call_pv("main::define_symbolic_field", G_SCALAR);
112 SPAGAIN;
113 PUTBACK;
114 FREETMPS;
115 LEAVE;
116}
117
118static void define_flag_value(const char *ev_name,
119 const char *field_name,
120 const char *field_value,
121 const char *field_str)
122{
123 unsigned long long value;
124 dSP;
125
126 value = eval_flag(field_value);
127
128 ENTER;
129 SAVETMPS;
130 PUSHMARK(SP);
131
132 XPUSHs(sv_2mortal(newSVpv(ev_name, 0)));
133 XPUSHs(sv_2mortal(newSVpv(field_name, 0)));
134 XPUSHs(sv_2mortal(newSVuv(value)));
135 XPUSHs(sv_2mortal(newSVpv(field_str, 0)));
136
137 PUTBACK;
138 if (get_cv("main::define_flag_value", 0))
139 call_pv("main::define_flag_value", G_SCALAR);
140 SPAGAIN;
141 PUTBACK;
142 FREETMPS;
143 LEAVE;
144}
145
146static void define_flag_values(struct print_flag_sym *field,
147 const char *ev_name,
148 const char *field_name)
149{
150 define_flag_value(ev_name, field_name, field->value, field->str);
151 if (field->next)
152 define_flag_values(field->next, ev_name, field_name);
153}
154
155static void define_flag_field(const char *ev_name,
156 const char *field_name,
157 const char *delim)
158{
159 dSP;
160
161 ENTER;
162 SAVETMPS;
163 PUSHMARK(SP);
164
165 XPUSHs(sv_2mortal(newSVpv(ev_name, 0)));
166 XPUSHs(sv_2mortal(newSVpv(field_name, 0)));
167 XPUSHs(sv_2mortal(newSVpv(delim, 0)));
168
169 PUTBACK;
170 if (get_cv("main::define_flag_field", 0))
171 call_pv("main::define_flag_field", G_SCALAR);
172 SPAGAIN;
173 PUTBACK;
174 FREETMPS;
175 LEAVE;
176}
177
178static void define_event_symbols(struct event *event,
179 const char *ev_name,
180 struct print_arg *args)
181{
182 switch (args->type) {
183 case PRINT_NULL:
184 break;
185 case PRINT_ATOM:
186 define_flag_value(ev_name, cur_field_name, "0",
187 args->atom.atom);
188 zero_flag_atom = 0;
189 break;
190 case PRINT_FIELD:
191 if (cur_field_name)
192 free(cur_field_name);
193 cur_field_name = strdup(args->field.name);
194 break;
195 case PRINT_FLAGS:
196 define_event_symbols(event, ev_name, args->flags.field);
197 define_flag_field(ev_name, cur_field_name, args->flags.delim);
198 define_flag_values(args->flags.flags, ev_name, cur_field_name);
199 break;
200 case PRINT_SYMBOL:
201 define_event_symbols(event, ev_name, args->symbol.field);
202 define_symbolic_field(ev_name, cur_field_name);
203 define_symbolic_values(args->symbol.symbols, ev_name,
204 cur_field_name);
205 break;
206 case PRINT_STRING:
207 break;
208 case PRINT_TYPE:
209 define_event_symbols(event, ev_name, args->typecast.item);
210 break;
211 case PRINT_OP:
212 if (strcmp(args->op.op, ":") == 0)
213 zero_flag_atom = 1;
214 define_event_symbols(event, ev_name, args->op.left);
215 define_event_symbols(event, ev_name, args->op.right);
216 break;
217 default:
218 /* we should warn... */
219 return;
220 }
221
222 if (args->next)
223 define_event_symbols(event, ev_name, args->next);
224}
225
226static inline struct event *find_cache_event(int type)
227{
228 static char ev_name[256];
229 struct event *event;
230
231 if (events[type])
232 return events[type];
233
234 events[type] = event = trace_find_event(type);
235 if (!event)
236 return NULL;
237
238 sprintf(ev_name, "%s::%s", event->system, event->name);
239
240 define_event_symbols(event, ev_name, event->print_fmt.args);
241
242 return event;
243}
244
245int common_pc(struct scripting_context *context)
246{
247 int pc;
248
249 pc = parse_common_pc(context->event_data);
250
251 return pc;
252}
253
254int common_flags(struct scripting_context *context)
255{
256 int flags;
257
258 flags = parse_common_flags(context->event_data);
259
260 return flags;
261}
262
263int common_lock_depth(struct scripting_context *context)
264{
265 int lock_depth;
266
267 lock_depth = parse_common_lock_depth(context->event_data);
268
269 return lock_depth;
270}
271
272static void perl_process_event(int cpu, void *data,
273 int size __attribute((unused)),
274 unsigned long long nsecs, char *comm)
275{
276 struct format_field *field;
277 static char handler[256];
278 unsigned long long val;
279 unsigned long s, ns;
280 struct event *event;
281 int type;
282 int pid;
283
284 dSP;
285
286 type = trace_parse_common_type(data);
287
288 event = find_cache_event(type);
289 if (!event)
290 die("ug! no event found for type %d", type);
291
292 pid = trace_parse_common_pid(data);
293
294 sprintf(handler, "%s::%s", event->system, event->name);
295
296 s = nsecs / NSECS_PER_SEC;
297 ns = nsecs - s * NSECS_PER_SEC;
298
299 scripting_context->event_data = data;
300
301 ENTER;
302 SAVETMPS;
303 PUSHMARK(SP);
304
305 XPUSHs(sv_2mortal(newSVpv(handler, 0)));
306 XPUSHs(sv_2mortal(newSViv(PTR2IV(scripting_context))));
307 XPUSHs(sv_2mortal(newSVuv(cpu)));
308 XPUSHs(sv_2mortal(newSVuv(s)));
309 XPUSHs(sv_2mortal(newSVuv(ns)));
310 XPUSHs(sv_2mortal(newSViv(pid)));
311 XPUSHs(sv_2mortal(newSVpv(comm, 0)));
312
313 /* common fields other than pid can be accessed via xsub fns */
314
315 for (field = event->format.fields; field; field = field->next) {
316 if (field->flags & FIELD_IS_STRING) {
317 int offset;
318 if (field->flags & FIELD_IS_DYNAMIC) {
319 offset = *(int *)(data + field->offset);
320 offset &= 0xffff;
321 } else
322 offset = field->offset;
323 XPUSHs(sv_2mortal(newSVpv((char *)data + offset, 0)));
324 } else { /* FIELD_IS_NUMERIC */
325 val = read_size(data + field->offset, field->size);
326 if (field->flags & FIELD_IS_SIGNED) {
327 XPUSHs(sv_2mortal(newSViv(val)));
328 } else {
329 XPUSHs(sv_2mortal(newSVuv(val)));
330 }
331 }
332 }
333
334 PUTBACK;
335
336 if (get_cv(handler, 0))
337 call_pv(handler, G_SCALAR);
338 else if (get_cv("main::trace_unhandled", 0)) {
339 XPUSHs(sv_2mortal(newSVpv(handler, 0)));
340 XPUSHs(sv_2mortal(newSViv(PTR2IV(scripting_context))));
341 XPUSHs(sv_2mortal(newSVuv(cpu)));
342 XPUSHs(sv_2mortal(newSVuv(nsecs)));
343 XPUSHs(sv_2mortal(newSViv(pid)));
344 XPUSHs(sv_2mortal(newSVpv(comm, 0)));
345 call_pv("main::trace_unhandled", G_SCALAR);
346 }
347 SPAGAIN;
348 PUTBACK;
349 FREETMPS;
350 LEAVE;
351}
352
353static void run_start_sub(void)
354{
355 dSP; /* access to Perl stack */
356 PUSHMARK(SP);
357
358 if (get_cv("main::trace_begin", 0))
359 call_pv("main::trace_begin", G_DISCARD | G_NOARGS);
360}
361
362/*
363 * Start trace script
364 */
365static int perl_start_script(const char *script)
366{
367 const char *command_line[2] = { "", NULL };
368
369 command_line[1] = script;
370
371 my_perl = perl_alloc();
372 perl_construct(my_perl);
373
374 if (perl_parse(my_perl, xs_init, 2, (char **)command_line,
375 (char **)NULL))
376 return -1;
377
378 perl_run(my_perl);
379 if (SvTRUE(ERRSV))
380 return -1;
381
382 run_start_sub();
383
384 fprintf(stderr, "perf trace started with Perl script %s\n\n", script);
385
386 return 0;
387}
388
389/*
390 * Stop trace script
391 */
392static int perl_stop_script(void)
393{
394 dSP; /* access to Perl stack */
395 PUSHMARK(SP);
396
397 if (get_cv("main::trace_end", 0))
398 call_pv("main::trace_end", G_DISCARD | G_NOARGS);
399
400 perl_destruct(my_perl);
401 perl_free(my_perl);
402
403 fprintf(stderr, "\nperf trace Perl script stopped\n");
404
405 return 0;
406}
407
408static int perl_generate_script(const char *outfile)
409{
410 struct event *event = NULL;
411 struct format_field *f;
412 char fname[PATH_MAX];
413 int not_first, count;
414 FILE *ofp;
415
416 sprintf(fname, "%s.pl", outfile);
417 ofp = fopen(fname, "w");
418 if (ofp == NULL) {
419 fprintf(stderr, "couldn't open %s\n", fname);
420 return -1;
421 }
422
423 fprintf(ofp, "# perf trace event handlers, "
424 "generated by perf trace -g perl\n");
425
426 fprintf(ofp, "# Licensed under the terms of the GNU GPL"
427 " License version 2\n\n");
428
429 fprintf(ofp, "# The common_* event handler fields are the most useful "
430 "fields common to\n");
431
432 fprintf(ofp, "# all events. They don't necessarily correspond to "
433 "the 'common_*' fields\n");
434
435 fprintf(ofp, "# in the format files. Those fields not available as "
436 "handler params can\n");
437
438 fprintf(ofp, "# be retrieved using Perl functions of the form "
439 "common_*($context).\n");
440
441 fprintf(ofp, "# See Context.pm for the list of available "
442 "functions.\n\n");
443
444 fprintf(ofp, "use lib \"$ENV{'PERF_EXEC_PATH'}/scripts/perl/"
445 "Perf-Trace-Util/lib\";\n");
446
447 fprintf(ofp, "use lib \"./Perf-Trace-Util/lib\";\n");
448 fprintf(ofp, "use Perf::Trace::Core;\n");
449 fprintf(ofp, "use Perf::Trace::Context;\n");
450 fprintf(ofp, "use Perf::Trace::Util;\n\n");
451
452 fprintf(ofp, "sub trace_begin\n{\n\t# optional\n}\n\n");
453 fprintf(ofp, "sub trace_end\n{\n\t# optional\n}\n\n");
454
455 while ((event = trace_find_next_event(event))) {
456 fprintf(ofp, "sub %s::%s\n{\n", event->system, event->name);
457 fprintf(ofp, "\tmy (");
458
459 fprintf(ofp, "$event_name, ");
460 fprintf(ofp, "$context, ");
461 fprintf(ofp, "$common_cpu, ");
462 fprintf(ofp, "$common_secs, ");
463 fprintf(ofp, "$common_nsecs,\n");
464 fprintf(ofp, "\t $common_pid, ");
465 fprintf(ofp, "$common_comm,\n\t ");
466
467 not_first = 0;
468 count = 0;
469
470 for (f = event->format.fields; f; f = f->next) {
471 if (not_first++)
472 fprintf(ofp, ", ");
473 if (++count % 5 == 0)
474 fprintf(ofp, "\n\t ");
475
476 fprintf(ofp, "$%s", f->name);
477 }
478 fprintf(ofp, ") = @_;\n\n");
479
480 fprintf(ofp, "\tprint_header($event_name, $common_cpu, "
481 "$common_secs, $common_nsecs,\n\t "
482 "$common_pid, $common_comm);\n\n");
483
484 fprintf(ofp, "\tprintf(\"");
485
486 not_first = 0;
487 count = 0;
488
489 for (f = event->format.fields; f; f = f->next) {
490 if (not_first++)
491 fprintf(ofp, ", ");
492 if (count && count % 4 == 0) {
493 fprintf(ofp, "\".\n\t \"");
494 }
495 count++;
496
497 fprintf(ofp, "%s=", f->name);
498 if (f->flags & FIELD_IS_STRING ||
499 f->flags & FIELD_IS_FLAG ||
500 f->flags & FIELD_IS_SYMBOLIC)
501 fprintf(ofp, "%%s");
502 else if (f->flags & FIELD_IS_SIGNED)
503 fprintf(ofp, "%%d");
504 else
505 fprintf(ofp, "%%u");
506 }
507
508 fprintf(ofp, "\\n\",\n\t ");
509
510 not_first = 0;
511 count = 0;
512
513 for (f = event->format.fields; f; f = f->next) {
514 if (not_first++)
515 fprintf(ofp, ", ");
516
517 if (++count % 5 == 0)
518 fprintf(ofp, "\n\t ");
519
520 if (f->flags & FIELD_IS_FLAG) {
521 if ((count - 1) % 5 != 0) {
522 fprintf(ofp, "\n\t ");
523 count = 4;
524 }
525 fprintf(ofp, "flag_str(\"");
526 fprintf(ofp, "%s::%s\", ", event->system,
527 event->name);
528 fprintf(ofp, "\"%s\", $%s)", f->name,
529 f->name);
530 } else if (f->flags & FIELD_IS_SYMBOLIC) {
531 if ((count - 1) % 5 != 0) {
532 fprintf(ofp, "\n\t ");
533 count = 4;
534 }
535 fprintf(ofp, "symbol_str(\"");
536 fprintf(ofp, "%s::%s\", ", event->system,
537 event->name);
538 fprintf(ofp, "\"%s\", $%s)", f->name,
539 f->name);
540 } else
541 fprintf(ofp, "$%s", f->name);
542 }
543
544 fprintf(ofp, ");\n");
545 fprintf(ofp, "}\n\n");
546 }
547
548 fprintf(ofp, "sub trace_unhandled\n{\n\tmy ($event_name, $context, "
549 "$common_cpu, $common_secs, $common_nsecs,\n\t "
550 "$common_pid, $common_comm) = @_;\n\n");
551
552 fprintf(ofp, "\tprint_header($event_name, $common_cpu, "
553 "$common_secs, $common_nsecs,\n\t $common_pid, "
554 "$common_comm);\n}\n\n");
555
556 fprintf(ofp, "sub print_header\n{\n"
557 "\tmy ($event_name, $cpu, $secs, $nsecs, $pid, $comm) = @_;\n\n"
558 "\tprintf(\"%%-20s %%5u %%05u.%%09u %%8u %%-20s \",\n\t "
559 "$event_name, $cpu, $secs, $nsecs, $pid, $comm);\n}");
560
561 fclose(ofp);
562
563 fprintf(stderr, "generated Perl script: %s\n", fname);
564
565 return 0;
566}
567
568struct scripting_ops perl_scripting_ops = {
569 .name = "Perl",
570 .start_script = perl_start_script,
571 .stop_script = perl_stop_script,
572 .process_event = perl_process_event,
573 .generate_script = perl_generate_script,
574};
575
576#ifdef NO_LIBPERL
577void setup_perl_scripting(void)
578{
579 fprintf(stderr, "Perl scripting not supported."
580 " Install libperl and rebuild perf to enable it. e.g. "
581 "apt-get install libperl-dev (ubuntu), yum install "
582 "perl-ExtUtils-Embed (Fedora), etc.\n");
583}
584#else
585void setup_perl_scripting(void)
586{
587 int err;
588 err = script_spec_register("Perl", &perl_scripting_ops);
589 if (err)
590 die("error registering Perl script extension");
591
592 err = script_spec_register("pl", &perl_scripting_ops);
593 if (err)
594 die("error registering pl script extension");
595
596 scripting_context = malloc(sizeof(struct scripting_context));
597}
598#endif
diff --git a/tools/perf/util/trace-event-perl.h b/tools/perf/util/trace-event-perl.h
new file mode 100644
index 000000000000..8fe0d866fe1a
--- /dev/null
+++ b/tools/perf/util/trace-event-perl.h
@@ -0,0 +1,51 @@
1#ifndef __PERF_TRACE_EVENT_PERL_H
2#define __PERF_TRACE_EVENT_PERL_H
3#ifdef NO_LIBPERL
4typedef int INTERP;
5#define dSP
6#define ENTER
7#define SAVETMPS
8#define PUTBACK
9#define SPAGAIN
10#define FREETMPS
11#define LEAVE
12#define SP
13#define ERRSV
14#define G_SCALAR (0)
15#define G_DISCARD (0)
16#define G_NOARGS (0)
17#define PUSHMARK(a)
18#define SvTRUE(a) (0)
19#define XPUSHs(s)
20#define sv_2mortal(a)
21#define newSVpv(a,b)
22#define newSVuv(a)
23#define newSViv(a)
24#define get_cv(a,b) (0)
25#define call_pv(a,b) (0)
26#define perl_alloc() (0)
27#define perl_construct(a) (0)
28#define perl_parse(a,b,c,d,e) (0)
29#define perl_run(a) (0)
30#define perl_destruct(a) (0)
31#define perl_free(a) (0)
32#define pTHX void
33#define CV void
34#define dXSUB_SYS
35#define pTHX_
36static inline void newXS(const char *a, void *b, const char *c) {}
37#else
38#include <EXTERN.h>
39#include <perl.h>
40typedef PerlInterpreter * INTERP;
41#endif
42
43struct scripting_context {
44 void *event_data;
45};
46
47int common_pc(struct scripting_context *context);
48int common_flags(struct scripting_context *context);
49int common_lock_depth(struct scripting_context *context);
50
51#endif /* __PERF_TRACE_EVENT_PERL_H */
diff --git a/tools/perf/util/trace-event-read.c b/tools/perf/util/trace-event-read.c
index 1b5c847d2c22..342dfdd43f87 100644
--- a/tools/perf/util/trace-event-read.c
+++ b/tools/perf/util/trace-event-read.c
@@ -458,9 +458,8 @@ struct record *trace_read_data(int cpu)
458 return data; 458 return data;
459} 459}
460 460
461void trace_report(void) 461void trace_report(int fd)
462{ 462{
463 const char *input_file = "trace.info";
464 char buf[BUFSIZ]; 463 char buf[BUFSIZ];
465 char test[] = { 23, 8, 68 }; 464 char test[] = { 23, 8, 68 };
466 char *version; 465 char *version;
@@ -468,17 +467,15 @@ void trace_report(void)
468 int show_funcs = 0; 467 int show_funcs = 0;
469 int show_printk = 0; 468 int show_printk = 0;
470 469
471 input_fd = open(input_file, O_RDONLY); 470 input_fd = fd;
472 if (input_fd < 0)
473 die("opening '%s'\n", input_file);
474 471
475 read_or_die(buf, 3); 472 read_or_die(buf, 3);
476 if (memcmp(buf, test, 3) != 0) 473 if (memcmp(buf, test, 3) != 0)
477 die("not an trace data file"); 474 die("no trace data in the file");
478 475
479 read_or_die(buf, 7); 476 read_or_die(buf, 7);
480 if (memcmp(buf, "tracing", 7) != 0) 477 if (memcmp(buf, "tracing", 7) != 0)
481 die("not a trace file (missing tracing)"); 478 die("not a trace file (missing 'tracing' tag)");
482 479
483 version = read_string(); 480 version = read_string();
484 if (show_version) 481 if (show_version)
diff --git a/tools/perf/util/trace-event.h b/tools/perf/util/trace-event.h
index 693f815c9429..81698d5e6503 100644
--- a/tools/perf/util/trace-event.h
+++ b/tools/perf/util/trace-event.h
@@ -1,5 +1,5 @@
1#ifndef _TRACE_EVENTS_H 1#ifndef __PERF_TRACE_EVENTS_H
2#define _TRACE_EVENTS_H 2#define __PERF_TRACE_EVENTS_H
3 3
4#include "parse-events.h" 4#include "parse-events.h"
5 5
@@ -26,6 +26,11 @@ enum {
26enum format_flags { 26enum format_flags {
27 FIELD_IS_ARRAY = 1, 27 FIELD_IS_ARRAY = 1,
28 FIELD_IS_POINTER = 2, 28 FIELD_IS_POINTER = 2,
29 FIELD_IS_SIGNED = 4,
30 FIELD_IS_STRING = 8,
31 FIELD_IS_DYNAMIC = 16,
32 FIELD_IS_FLAG = 32,
33 FIELD_IS_SYMBOLIC = 64,
29}; 34};
30 35
31struct format_field { 36struct format_field {
@@ -132,15 +137,18 @@ struct event {
132 int flags; 137 int flags;
133 struct format format; 138 struct format format;
134 struct print_fmt print_fmt; 139 struct print_fmt print_fmt;
140 char *system;
135}; 141};
136 142
137enum { 143enum {
138 EVENT_FL_ISFTRACE = 1, 144 EVENT_FL_ISFTRACE = 0x01,
139 EVENT_FL_ISPRINT = 2, 145 EVENT_FL_ISPRINT = 0x02,
140 EVENT_FL_ISBPRINT = 4, 146 EVENT_FL_ISBPRINT = 0x04,
141 EVENT_FL_ISFUNC = 8, 147 EVENT_FL_ISFUNC = 0x08,
142 EVENT_FL_ISFUNCENT = 16, 148 EVENT_FL_ISFUNCENT = 0x10,
143 EVENT_FL_ISFUNCRET = 32, 149 EVENT_FL_ISFUNCRET = 0x20,
150
151 EVENT_FL_FAILED = 0x80000000
144}; 152};
145 153
146struct record { 154struct record {
@@ -154,7 +162,7 @@ struct record *trace_read_data(int cpu);
154 162
155void parse_set_info(int nr_cpus, int long_sz); 163void parse_set_info(int nr_cpus, int long_sz);
156 164
157void trace_report(void); 165void trace_report(int fd);
158 166
159void *malloc_or_die(unsigned int size); 167void *malloc_or_die(unsigned int size);
160 168
@@ -166,7 +174,7 @@ void print_funcs(void);
166void print_printk(void); 174void print_printk(void);
167 175
168int parse_ftrace_file(char *buf, unsigned long size); 176int parse_ftrace_file(char *buf, unsigned long size);
169int parse_event_file(char *buf, unsigned long size, char *system); 177int parse_event_file(char *buf, unsigned long size, char *sys);
170void print_event(int cpu, void *data, int size, unsigned long long nsecs, 178void print_event(int cpu, void *data, int size, unsigned long long nsecs,
171 char *comm); 179 char *comm);
172 180
@@ -233,13 +241,45 @@ extern int header_page_size_size;
233extern int header_page_data_offset; 241extern int header_page_data_offset;
234extern int header_page_data_size; 242extern int header_page_data_size;
235 243
244extern int latency_format;
245
236int parse_header_page(char *buf, unsigned long size); 246int parse_header_page(char *buf, unsigned long size);
237int trace_parse_common_type(void *data); 247int trace_parse_common_type(void *data);
248int trace_parse_common_pid(void *data);
249int parse_common_pc(void *data);
250int parse_common_flags(void *data);
251int parse_common_lock_depth(void *data);
238struct event *trace_find_event(int id); 252struct event *trace_find_event(int id);
253struct event *trace_find_next_event(struct event *event);
254unsigned long long read_size(void *ptr, int size);
239unsigned long long 255unsigned long long
240raw_field_value(struct event *event, const char *name, void *data); 256raw_field_value(struct event *event, const char *name, void *data);
241void *raw_field_ptr(struct event *event, const char *name, void *data); 257void *raw_field_ptr(struct event *event, const char *name, void *data);
258unsigned long long eval_flag(const char *flag);
259
260int read_tracing_data(int fd, struct perf_event_attr *pattrs, int nb_events);
261
262/* taken from kernel/trace/trace.h */
263enum trace_flag_type {
264 TRACE_FLAG_IRQS_OFF = 0x01,
265 TRACE_FLAG_IRQS_NOSUPPORT = 0x02,
266 TRACE_FLAG_NEED_RESCHED = 0x04,
267 TRACE_FLAG_HARDIRQ = 0x08,
268 TRACE_FLAG_SOFTIRQ = 0x10,
269};
270
271struct scripting_ops {
272 const char *name;
273 int (*start_script) (const char *);
274 int (*stop_script) (void);
275 void (*process_event) (int cpu, void *data, int size,
276 unsigned long long nsecs, char *comm);
277 int (*generate_script) (const char *outfile);
278};
279
280int script_spec_register(const char *spec, struct scripting_ops *ops);
242 281
243void read_tracing_data(struct perf_event_attr *pattrs, int nb_events); 282extern struct scripting_ops perl_scripting_ops;
283void setup_perl_scripting(void);
244 284
245#endif /* _TRACE_EVENTS_H */ 285#endif /* __PERF_TRACE_EVENTS_H */
diff --git a/tools/perf/util/types.h b/tools/perf/util/types.h
index 5e75f9005940..7d6b8331f898 100644
--- a/tools/perf/util/types.h
+++ b/tools/perf/util/types.h
@@ -1,5 +1,5 @@
1#ifndef _PERF_TYPES_H 1#ifndef __PERF_TYPES_H
2#define _PERF_TYPES_H 2#define __PERF_TYPES_H
3 3
4/* 4/*
5 * We define u64 as unsigned long long for every architecture 5 * We define u64 as unsigned long long for every architecture
@@ -14,4 +14,4 @@ typedef signed short s16;
14typedef unsigned char u8; 14typedef unsigned char u8;
15typedef signed char s8; 15typedef signed char s8;
16 16
17#endif /* _PERF_TYPES_H */ 17#endif /* __PERF_TYPES_H */
diff --git a/tools/perf/util/util.h b/tools/perf/util/util.h
index 9de2329dd44d..c673d8825883 100644
--- a/tools/perf/util/util.h
+++ b/tools/perf/util/util.h
@@ -84,6 +84,9 @@
84#include <iconv.h> 84#include <iconv.h>
85#endif 85#endif
86 86
87extern const char *graph_line;
88extern const char *graph_dotted_line;
89
87/* On most systems <limits.h> would have given us this, but 90/* On most systems <limits.h> would have given us this, but
88 * not on some systems (e.g. GNU/Hurd). 91 * not on some systems (e.g. GNU/Hurd).
89 */ 92 */
@@ -134,6 +137,15 @@ extern void die(const char *err, ...) NORETURN __attribute__((format (printf, 1,
134extern int error(const char *err, ...) __attribute__((format (printf, 1, 2))); 137extern int error(const char *err, ...) __attribute__((format (printf, 1, 2)));
135extern void warning(const char *err, ...) __attribute__((format (printf, 1, 2))); 138extern void warning(const char *err, ...) __attribute__((format (printf, 1, 2)));
136 139
140#include "../../../include/linux/stringify.h"
141
142#define DIE_IF(cnd) \
143 do { if (cnd) \
144 die(" at (" __FILE__ ":" __stringify(__LINE__) "): " \
145 __stringify(cnd) "\n"); \
146 } while (0)
147
148
137extern void set_die_routine(void (*routine)(const char *err, va_list params) NORETURN); 149extern void set_die_routine(void (*routine)(const char *err, va_list params) NORETURN);
138 150
139extern int prefixcmp(const char *str, const char *prefix); 151extern int prefixcmp(const char *str, const char *prefix);
@@ -278,17 +290,15 @@ static inline char *gitstrchrnul(const char *s, int c)
278 * Wrappers: 290 * Wrappers:
279 */ 291 */
280extern char *xstrdup(const char *str); 292extern char *xstrdup(const char *str);
281extern void *xmalloc(size_t size); 293extern void *xmalloc(size_t size) __attribute__((weak));
282extern void *xmemdupz(const void *data, size_t len); 294extern void *xmemdupz(const void *data, size_t len);
283extern char *xstrndup(const char *str, size_t len); 295extern char *xstrndup(const char *str, size_t len);
284extern void *xrealloc(void *ptr, size_t size); 296extern void *xrealloc(void *ptr, size_t size) __attribute__((weak));
285extern void *xcalloc(size_t nmemb, size_t size); 297
286extern void *xmmap(void *start, size_t length, int prot, int flags, int fd, off_t offset); 298static inline void *zalloc(size_t size)
287extern ssize_t xread(int fd, void *buf, size_t len); 299{
288extern ssize_t xwrite(int fd, const void *buf, size_t len); 300 return calloc(1, size);
289extern int xdup(int fd); 301}
290extern FILE *xfdopen(int fd, const char *mode);
291extern int xmkstemp(char *template);
292 302
293static inline size_t xsize_t(off_t len) 303static inline size_t xsize_t(off_t len)
294{ 304{
@@ -306,6 +316,7 @@ static inline int has_extension(const char *filename, const char *ext)
306#undef isascii 316#undef isascii
307#undef isspace 317#undef isspace
308#undef isdigit 318#undef isdigit
319#undef isxdigit
309#undef isalpha 320#undef isalpha
310#undef isprint 321#undef isprint
311#undef isalnum 322#undef isalnum
@@ -323,6 +334,8 @@ extern unsigned char sane_ctype[256];
323#define isascii(x) (((x) & ~0x7f) == 0) 334#define isascii(x) (((x) & ~0x7f) == 0)
324#define isspace(x) sane_istest(x,GIT_SPACE) 335#define isspace(x) sane_istest(x,GIT_SPACE)
325#define isdigit(x) sane_istest(x,GIT_DIGIT) 336#define isdigit(x) sane_istest(x,GIT_DIGIT)
337#define isxdigit(x) \
338 (sane_istest(toupper(x), GIT_ALPHA | GIT_DIGIT) && toupper(x) < 'G')
326#define isalpha(x) sane_istest(x,GIT_ALPHA) 339#define isalpha(x) sane_istest(x,GIT_ALPHA)
327#define isalnum(x) sane_istest(x,GIT_ALPHA | GIT_DIGIT) 340#define isalnum(x) sane_istest(x,GIT_ALPHA | GIT_DIGIT)
328#define isprint(x) sane_istest(x,GIT_PRINT) 341#define isprint(x) sane_istest(x,GIT_PRINT)
diff --git a/tools/perf/util/values.h b/tools/perf/util/values.h
index cadf8cf2a590..2fa967e1a88a 100644
--- a/tools/perf/util/values.h
+++ b/tools/perf/util/values.h
@@ -1,5 +1,5 @@
1#ifndef _PERF_VALUES_H 1#ifndef __PERF_VALUES_H
2#define _PERF_VALUES_H 2#define __PERF_VALUES_H
3 3
4#include "types.h" 4#include "types.h"
5 5
@@ -24,4 +24,4 @@ void perf_read_values_add_value(struct perf_read_values *values,
24void perf_read_values_display(FILE *fp, struct perf_read_values *values, 24void perf_read_values_display(FILE *fp, struct perf_read_values *values,
25 int raw); 25 int raw);
26 26
27#endif /* _PERF_VALUES_H */ 27#endif /* __PERF_VALUES_H */
diff --git a/tools/perf/util/wrapper.c b/tools/perf/util/wrapper.c
index 4574ac28396f..bf44ca85d23b 100644
--- a/tools/perf/util/wrapper.c
+++ b/tools/perf/util/wrapper.c
@@ -79,43 +79,12 @@ void *xrealloc(void *ptr, size_t size)
79 return ret; 79 return ret;
80} 80}
81 81
82void *xcalloc(size_t nmemb, size_t size)
83{
84 void *ret = calloc(nmemb, size);
85 if (!ret && (!nmemb || !size))
86 ret = calloc(1, 1);
87 if (!ret) {
88 release_pack_memory(nmemb * size, -1);
89 ret = calloc(nmemb, size);
90 if (!ret && (!nmemb || !size))
91 ret = calloc(1, 1);
92 if (!ret)
93 die("Out of memory, calloc failed");
94 }
95 return ret;
96}
97
98void *xmmap(void *start, size_t length,
99 int prot, int flags, int fd, off_t offset)
100{
101 void *ret = mmap(start, length, prot, flags, fd, offset);
102 if (ret == MAP_FAILED) {
103 if (!length)
104 return NULL;
105 release_pack_memory(length, fd);
106 ret = mmap(start, length, prot, flags, fd, offset);
107 if (ret == MAP_FAILED)
108 die("Out of memory? mmap failed: %s", strerror(errno));
109 }
110 return ret;
111}
112
113/* 82/*
114 * xread() is the same a read(), but it automatically restarts read() 83 * xread() is the same a read(), but it automatically restarts read()
115 * operations with a recoverable error (EAGAIN and EINTR). xread() 84 * operations with a recoverable error (EAGAIN and EINTR). xread()
116 * DOES NOT GUARANTEE that "len" bytes is read even if the data is available. 85 * DOES NOT GUARANTEE that "len" bytes is read even if the data is available.
117 */ 86 */
118ssize_t xread(int fd, void *buf, size_t len) 87static ssize_t xread(int fd, void *buf, size_t len)
119{ 88{
120 ssize_t nr; 89 ssize_t nr;
121 while (1) { 90 while (1) {
@@ -131,7 +100,7 @@ ssize_t xread(int fd, void *buf, size_t len)
131 * operations with a recoverable error (EAGAIN and EINTR). xwrite() DOES NOT 100 * operations with a recoverable error (EAGAIN and EINTR). xwrite() DOES NOT
132 * GUARANTEE that "len" bytes is written even if the operation is successful. 101 * GUARANTEE that "len" bytes is written even if the operation is successful.
133 */ 102 */
134ssize_t xwrite(int fd, const void *buf, size_t len) 103static ssize_t xwrite(int fd, const void *buf, size_t len)
135{ 104{
136 ssize_t nr; 105 ssize_t nr;
137 while (1) { 106 while (1) {
@@ -179,29 +148,3 @@ ssize_t write_in_full(int fd, const void *buf, size_t count)
179 148
180 return total; 149 return total;
181} 150}
182
183int xdup(int fd)
184{
185 int ret = dup(fd);
186 if (ret < 0)
187 die("dup failed: %s", strerror(errno));
188 return ret;
189}
190
191FILE *xfdopen(int fd, const char *mode)
192{
193 FILE *stream = fdopen(fd, mode);
194 if (stream == NULL)
195 die("Out of memory? fdopen failed: %s", strerror(errno));
196 return stream;
197}
198
199int xmkstemp(char *template)
200{
201 int fd;
202
203 fd = mkstemp(template);
204 if (fd < 0)
205 die("Unable to create temporary file: %s", strerror(errno));
206 return fd;
207}