]> git.karo-electronics.de Git - mv-sheeva.git/commitdiff
Merge remote branch 'linus/master' into drm-intel-fixes
authorChris Wilson <chris@chris-wilson.co.uk>
Sun, 23 Jan 2011 17:22:16 +0000 (17:22 +0000)
committerChris Wilson <chris@chris-wilson.co.uk>
Mon, 24 Jan 2011 18:27:32 +0000 (18:27 +0000)
Merge with Linus to resolve conflicting fixes for the reusing the stale
HEAD value during intel_ring_wait().

Conflicts:
drivers/gpu/drm/i915/intel_ringbuffer.c

1096 files changed:
Documentation/DocBook/device-drivers.tmpl
Documentation/DocBook/dvb/dvbapi.xml
Documentation/DocBook/media.tmpl
Documentation/DocBook/v4l/dev-rds.xml
Documentation/DocBook/v4l/v4l2.xml
Documentation/feature-removal-schedule.txt
Documentation/hwmon/lm93
Documentation/lguest/lguest.c
Documentation/lguest/lguest.txt
Documentation/sound/alsa/soc/codec.txt
Documentation/sound/alsa/soc/machine.txt
Documentation/sound/alsa/soc/platform.txt
Documentation/video4linux/v4l2-controls.txt
MAINTAINERS
Makefile
arch/alpha/Kconfig
arch/arm/configs/ag5evm_defconfig
arch/arm/configs/am200epdkit_defconfig
arch/arm/configs/at572d940hfek_defconfig
arch/arm/configs/badge4_defconfig
arch/arm/configs/bcmring_defconfig
arch/arm/configs/cm_x2xx_defconfig
arch/arm/configs/colibri_pxa270_defconfig
arch/arm/configs/collie_defconfig
arch/arm/configs/corgi_defconfig
arch/arm/configs/da8xx_omapl_defconfig
arch/arm/configs/davinci_all_defconfig
arch/arm/configs/dove_defconfig
arch/arm/configs/ebsa110_defconfig
arch/arm/configs/edb7211_defconfig
arch/arm/configs/em_x270_defconfig
arch/arm/configs/ep93xx_defconfig
arch/arm/configs/eseries_pxa_defconfig
arch/arm/configs/ezx_defconfig
arch/arm/configs/footbridge_defconfig
arch/arm/configs/fortunet_defconfig
arch/arm/configs/h5000_defconfig
arch/arm/configs/imote2_defconfig
arch/arm/configs/ixp2000_defconfig
arch/arm/configs/ixp23xx_defconfig
arch/arm/configs/ixp4xx_defconfig
arch/arm/configs/loki_defconfig
arch/arm/configs/lpd7a400_defconfig
arch/arm/configs/lpd7a404_defconfig
arch/arm/configs/magician_defconfig
arch/arm/configs/mv78xx0_defconfig
arch/arm/configs/mx1_defconfig
arch/arm/configs/mx21_defconfig
arch/arm/configs/mx27_defconfig
arch/arm/configs/mx3_defconfig
arch/arm/configs/mx51_defconfig
arch/arm/configs/nhk8815_defconfig
arch/arm/configs/omap1_defconfig
arch/arm/configs/omap2plus_defconfig
arch/arm/configs/orion5x_defconfig
arch/arm/configs/pcm027_defconfig
arch/arm/configs/pcontrol_g20_defconfig
arch/arm/configs/pleb_defconfig
arch/arm/configs/pnx4008_defconfig
arch/arm/configs/simpad_defconfig
arch/arm/configs/spitz_defconfig
arch/arm/configs/stmp378x_defconfig
arch/arm/configs/stmp37xx_defconfig
arch/arm/configs/tct_hammer_defconfig
arch/arm/configs/trizeps4_defconfig
arch/arm/configs/u300_defconfig
arch/arm/configs/viper_defconfig
arch/arm/configs/xcep_defconfig
arch/arm/mach-msm/board-qsd8x50.c
arch/arm/mach-s5p6442/mach-smdk6442.c
arch/arm/mach-s5p64x0/mach-smdk6440.c
arch/arm/mach-s5p64x0/mach-smdk6450.c
arch/arm/mach-s5pv210/mach-smdkc110.c
arch/arm/mach-s5pv210/mach-smdkv210.c
arch/arm/mach-s5pv310/mach-smdkc210.c
arch/arm/mach-s5pv310/mach-smdkv310.c
arch/avr32/Kconfig
arch/blackfin/Kconfig
arch/blackfin/configs/BF518F-EZBRD_defconfig
arch/blackfin/configs/BF526-EZBRD_defconfig
arch/blackfin/configs/BF527-AD7160-EVAL_defconfig
arch/blackfin/configs/BF527-EZKIT-V2_defconfig
arch/blackfin/configs/BF527-EZKIT_defconfig
arch/blackfin/configs/BF527-TLL6527M_defconfig
arch/blackfin/configs/BF533-EZKIT_defconfig
arch/blackfin/configs/BF533-STAMP_defconfig
arch/blackfin/configs/BF537-STAMP_defconfig
arch/blackfin/configs/BF538-EZKIT_defconfig
arch/blackfin/configs/BF548-EZKIT_defconfig
arch/blackfin/configs/BF561-ACVILON_defconfig
arch/blackfin/configs/BF561-EZKIT-SMP_defconfig
arch/blackfin/configs/BF561-EZKIT_defconfig
arch/blackfin/configs/BlackStamp_defconfig
arch/blackfin/configs/CM-BF527_defconfig
arch/blackfin/configs/CM-BF533_defconfig
arch/blackfin/configs/CM-BF537E_defconfig
arch/blackfin/configs/CM-BF537U_defconfig
arch/blackfin/configs/CM-BF548_defconfig
arch/blackfin/configs/CM-BF561_defconfig
arch/blackfin/configs/DNP5370_defconfig
arch/blackfin/configs/H8606_defconfig
arch/blackfin/configs/IP0X_defconfig
arch/blackfin/configs/PNAV-10_defconfig
arch/blackfin/configs/SRV1_defconfig
arch/blackfin/configs/TCM-BF518_defconfig
arch/blackfin/configs/TCM-BF537_defconfig
arch/cris/Kconfig
arch/cris/arch-v10/kernel/irq.c
arch/cris/arch-v32/kernel/irq.c
arch/cris/configs/artpec_3_defconfig
arch/cris/configs/etrax-100lx_v2_defconfig
arch/cris/configs/etraxfs_defconfig
arch/cris/kernel/irq.c
arch/frv/Kconfig
arch/frv/defconfig
arch/h8300/Kconfig
arch/h8300/defconfig
arch/h8300/kernel/irq.c
arch/ia64/Kconfig
arch/m32r/Kconfig
arch/m32r/configs/m32700ut.smp_defconfig
arch/m32r/configs/m32700ut.up_defconfig
arch/m32r/configs/mappi.nommu_defconfig
arch/m32r/configs/mappi.smp_defconfig
arch/m32r/configs/mappi.up_defconfig
arch/m32r/configs/mappi2.opsp_defconfig
arch/m32r/configs/mappi2.vdec2_defconfig
arch/m32r/configs/mappi3.smp_defconfig
arch/m32r/configs/oaks32r_defconfig
arch/m32r/configs/opsput_defconfig
arch/m32r/configs/usrv_defconfig
arch/m32r/kernel/irq.c
arch/m32r/platforms/m32104ut/setup.c
arch/m32r/platforms/m32700ut/setup.c
arch/m32r/platforms/mappi/setup.c
arch/m32r/platforms/mappi2/setup.c
arch/m32r/platforms/mappi3/setup.c
arch/m32r/platforms/oaks32r/setup.c
arch/m32r/platforms/opsput/setup.c
arch/m32r/platforms/usrv/setup.c
arch/m68k/include/asm/cacheflush_no.h
arch/m68k/include/asm/coldfire.h
arch/m68k/include/asm/entry_no.h
arch/m68k/include/asm/gpio.h
arch/m68k/include/asm/io_no.h
arch/m68k/include/asm/m5206sim.h
arch/m68k/include/asm/m520xsim.h
arch/m68k/include/asm/m523xsim.h
arch/m68k/include/asm/m5249sim.h
arch/m68k/include/asm/m5272sim.h
arch/m68k/include/asm/m527xsim.h
arch/m68k/include/asm/m528xsim.h
arch/m68k/include/asm/m52xxacr.h [new file with mode: 0644]
arch/m68k/include/asm/m5307sim.h
arch/m68k/include/asm/m532xsim.h
arch/m68k/include/asm/m53xxacr.h [new file with mode: 0644]
arch/m68k/include/asm/m5407sim.h
arch/m68k/include/asm/m54xxacr.h [new file with mode: 0644]
arch/m68k/include/asm/m54xxgpt.h [moved from arch/m68k/include/asm/m548xgpt.h with 95% similarity]
arch/m68k/include/asm/m54xxsim.h [moved from arch/m68k/include/asm/m548xsim.h with 73% similarity]
arch/m68k/include/asm/mcfcache.h [deleted file]
arch/m68k/include/asm/mcfsim.h
arch/m68k/include/asm/mcfuart.h
arch/m68k/include/asm/processor.h
arch/m68knommu/Kconfig
arch/m68knommu/Makefile
arch/m68knommu/configs/m5208evb_defconfig
arch/m68knommu/configs/m5249evb_defconfig
arch/m68knommu/configs/m5272c3_defconfig
arch/m68knommu/configs/m5275evb_defconfig
arch/m68knommu/configs/m5307c3_defconfig
arch/m68knommu/configs/m5407c3_defconfig
arch/m68knommu/defconfig
arch/m68knommu/kernel/setup.c
arch/m68knommu/mm/Makefile
arch/m68knommu/mm/fault.c [deleted file]
arch/m68knommu/mm/kmap.c
arch/m68knommu/mm/memory.c [deleted file]
arch/m68knommu/platform/54xx/Makefile [moved from arch/m68knommu/platform/548x/Makefile with 100% similarity]
arch/m68knommu/platform/54xx/config.c [moved from arch/m68knommu/platform/548x/config.c with 74% similarity]
arch/m68knommu/platform/68328/ints.c
arch/m68knommu/platform/coldfire/Makefile
arch/m68knommu/platform/coldfire/cache.c [new file with mode: 0644]
arch/m68knommu/platform/coldfire/entry.S
arch/m68knommu/platform/coldfire/head.S
arch/microblaze/Kconfig
arch/microblaze/configs/mmu_defconfig
arch/microblaze/configs/nommu_defconfig
arch/microblaze/include/asm/pgtable.h
arch/microblaze/include/asm/tlb.h
arch/mips/Kbuild.platforms
arch/mips/Kconfig
arch/mips/Kconfig.debug
arch/mips/ath79/Kconfig [new file with mode: 0644]
arch/mips/ath79/Makefile [new file with mode: 0644]
arch/mips/ath79/Platform [new file with mode: 0644]
arch/mips/ath79/clock.c [new file with mode: 0644]
arch/mips/ath79/common.c [new file with mode: 0644]
arch/mips/ath79/common.h [new file with mode: 0644]
arch/mips/ath79/dev-ar913x-wmac.c [new file with mode: 0644]
arch/mips/ath79/dev-ar913x-wmac.h [new file with mode: 0644]
arch/mips/ath79/dev-common.c [new file with mode: 0644]
arch/mips/ath79/dev-common.h [new file with mode: 0644]
arch/mips/ath79/dev-gpio-buttons.c [new file with mode: 0644]
arch/mips/ath79/dev-gpio-buttons.h [new file with mode: 0644]
arch/mips/ath79/dev-leds-gpio.c [new file with mode: 0644]
arch/mips/ath79/dev-leds-gpio.h [new file with mode: 0644]
arch/mips/ath79/dev-spi.c [new file with mode: 0644]
arch/mips/ath79/dev-spi.h [new file with mode: 0644]
arch/mips/ath79/early_printk.c [new file with mode: 0644]
arch/mips/ath79/gpio.c [new file with mode: 0644]
arch/mips/ath79/irq.c [new file with mode: 0644]
arch/mips/ath79/mach-ap81.c [new file with mode: 0644]
arch/mips/ath79/mach-pb44.c [new file with mode: 0644]
arch/mips/ath79/machtypes.h [new file with mode: 0644]
arch/mips/ath79/prom.c [new file with mode: 0644]
arch/mips/ath79/setup.c [new file with mode: 0644]
arch/mips/configs/ar7_defconfig
arch/mips/configs/bcm47xx_defconfig
arch/mips/configs/bcm63xx_defconfig
arch/mips/configs/bigsur_defconfig
arch/mips/configs/capcella_defconfig
arch/mips/configs/cavium-octeon_defconfig
arch/mips/configs/cobalt_defconfig
arch/mips/configs/db1000_defconfig
arch/mips/configs/db1100_defconfig
arch/mips/configs/db1200_defconfig
arch/mips/configs/db1500_defconfig
arch/mips/configs/db1550_defconfig
arch/mips/configs/decstation_defconfig
arch/mips/configs/e55_defconfig
arch/mips/configs/fuloong2e_defconfig
arch/mips/configs/gpr_defconfig
arch/mips/configs/ip22_defconfig
arch/mips/configs/ip27_defconfig
arch/mips/configs/ip28_defconfig
arch/mips/configs/ip32_defconfig
arch/mips/configs/jazz_defconfig
arch/mips/configs/jmr3927_defconfig
arch/mips/configs/lasat_defconfig
arch/mips/configs/lemote2f_defconfig
arch/mips/configs/malta_defconfig
arch/mips/configs/markeins_defconfig
arch/mips/configs/mipssim_defconfig
arch/mips/configs/mpc30x_defconfig
arch/mips/configs/msp71xx_defconfig
arch/mips/configs/mtx1_defconfig
arch/mips/configs/pb1100_defconfig
arch/mips/configs/pb1200_defconfig
arch/mips/configs/pb1500_defconfig
arch/mips/configs/pb1550_defconfig
arch/mips/configs/pnx8335-stb225_defconfig
arch/mips/configs/pnx8550-jbs_defconfig
arch/mips/configs/pnx8550-stb810_defconfig
arch/mips/configs/powertv_defconfig
arch/mips/configs/rb532_defconfig
arch/mips/configs/rbtx49xx_defconfig
arch/mips/configs/rm200_defconfig
arch/mips/configs/sb1250-swarm_defconfig
arch/mips/configs/tb0219_defconfig
arch/mips/configs/tb0226_defconfig
arch/mips/configs/tb0287_defconfig
arch/mips/configs/workpad_defconfig
arch/mips/configs/wrppmc_defconfig
arch/mips/configs/yosemite_defconfig
arch/mips/include/asm/cache.h
arch/mips/include/asm/cpu-info.h
arch/mips/include/asm/inst.h
arch/mips/include/asm/jump_label.h [new file with mode: 0644]
arch/mips/include/asm/mach-ath79/ar71xx_regs.h [new file with mode: 0644]
arch/mips/include/asm/mach-ath79/ath79.h [new file with mode: 0644]
arch/mips/include/asm/mach-ath79/ath79_spi_platform.h [new file with mode: 0644]
arch/mips/include/asm/mach-ath79/cpu-feature-overrides.h [new file with mode: 0644]
arch/mips/include/asm/mach-ath79/gpio.h [new file with mode: 0644]
arch/mips/include/asm/mach-ath79/irq.h [new file with mode: 0644]
arch/mips/include/asm/mach-ath79/kernel-entry-init.h [new file with mode: 0644]
arch/mips/include/asm/mach-ath79/war.h [new file with mode: 0644]
arch/mips/include/asm/mips_machine.h [new file with mode: 0644]
arch/mips/include/asm/mmu_context.h
arch/mips/include/asm/uasm.h
arch/mips/kernel/Makefile
arch/mips/kernel/cpu-probe.c
arch/mips/kernel/jump_label.c [new file with mode: 0644]
arch/mips/kernel/mips_machine.c [new file with mode: 0644]
arch/mips/kernel/module.c
arch/mips/kernel/proc.c
arch/mips/kernel/setup.c
arch/mips/kernel/traps.c
arch/mips/kernel/vmlinux.lds.S
arch/mips/mm/tlbex.c
arch/mips/mm/uasm.c
arch/mips/sibyte/common/sb_tbprof.c
arch/mips/txx9/generic/pci.c
arch/mn10300/Kconfig
arch/mn10300/configs/asb2303_defconfig
arch/mn10300/configs/asb2364_defconfig
arch/parisc/Kconfig
arch/parisc/configs/a500_defconfig
arch/parisc/configs/c3000_defconfig
arch/parisc/kernel/firmware.c
arch/powerpc/Kconfig
arch/powerpc/boot/Makefile
arch/powerpc/boot/dts/mpc8308rdb.dts
arch/powerpc/boot/dts/p1022ds.dts
arch/powerpc/configs/40x/acadia_defconfig
arch/powerpc/configs/40x/ep405_defconfig
arch/powerpc/configs/40x/hcu4_defconfig
arch/powerpc/configs/40x/kilauea_defconfig
arch/powerpc/configs/40x/makalu_defconfig
arch/powerpc/configs/40x/walnut_defconfig
arch/powerpc/configs/44x/arches_defconfig
arch/powerpc/configs/44x/bamboo_defconfig
arch/powerpc/configs/44x/bluestone_defconfig
arch/powerpc/configs/44x/canyonlands_defconfig
arch/powerpc/configs/44x/ebony_defconfig
arch/powerpc/configs/44x/eiger_defconfig
arch/powerpc/configs/44x/icon_defconfig
arch/powerpc/configs/44x/iss476-smp_defconfig
arch/powerpc/configs/44x/katmai_defconfig
arch/powerpc/configs/44x/rainier_defconfig
arch/powerpc/configs/44x/redwood_defconfig
arch/powerpc/configs/44x/sam440ep_defconfig
arch/powerpc/configs/44x/sequoia_defconfig
arch/powerpc/configs/44x/taishan_defconfig
arch/powerpc/configs/44x/warp_defconfig
arch/powerpc/configs/52xx/cm5200_defconfig
arch/powerpc/configs/52xx/lite5200b_defconfig
arch/powerpc/configs/52xx/motionpro_defconfig
arch/powerpc/configs/52xx/pcm030_defconfig
arch/powerpc/configs/52xx/tqm5200_defconfig
arch/powerpc/configs/83xx/asp8347_defconfig
arch/powerpc/configs/83xx/kmeter1_defconfig
arch/powerpc/configs/83xx/mpc8313_rdb_defconfig
arch/powerpc/configs/83xx/mpc8315_rdb_defconfig
arch/powerpc/configs/83xx/mpc832x_mds_defconfig
arch/powerpc/configs/83xx/mpc832x_rdb_defconfig
arch/powerpc/configs/83xx/mpc834x_itx_defconfig
arch/powerpc/configs/83xx/mpc834x_itxgp_defconfig
arch/powerpc/configs/83xx/mpc834x_mds_defconfig
arch/powerpc/configs/83xx/mpc836x_mds_defconfig
arch/powerpc/configs/83xx/mpc836x_rdk_defconfig
arch/powerpc/configs/83xx/mpc837x_mds_defconfig
arch/powerpc/configs/83xx/mpc837x_rdb_defconfig
arch/powerpc/configs/83xx/sbc834x_defconfig
arch/powerpc/configs/85xx/ksi8560_defconfig
arch/powerpc/configs/85xx/mpc8540_ads_defconfig
arch/powerpc/configs/85xx/mpc8560_ads_defconfig
arch/powerpc/configs/85xx/mpc85xx_cds_defconfig
arch/powerpc/configs/85xx/sbc8548_defconfig
arch/powerpc/configs/85xx/sbc8560_defconfig
arch/powerpc/configs/85xx/socrates_defconfig
arch/powerpc/configs/85xx/stx_gp3_defconfig
arch/powerpc/configs/85xx/tqm8540_defconfig
arch/powerpc/configs/85xx/tqm8541_defconfig
arch/powerpc/configs/85xx/tqm8548_defconfig
arch/powerpc/configs/85xx/tqm8555_defconfig
arch/powerpc/configs/85xx/tqm8560_defconfig
arch/powerpc/configs/85xx/xes_mpc85xx_defconfig
arch/powerpc/configs/86xx/gef_ppc9a_defconfig
arch/powerpc/configs/86xx/gef_sbc310_defconfig
arch/powerpc/configs/86xx/gef_sbc610_defconfig
arch/powerpc/configs/86xx/mpc8610_hpcd_defconfig
arch/powerpc/configs/86xx/mpc8641_hpcn_defconfig
arch/powerpc/configs/86xx/sbc8641d_defconfig
arch/powerpc/configs/adder875_defconfig
arch/powerpc/configs/e55xx_smp_defconfig
arch/powerpc/configs/ep8248e_defconfig
arch/powerpc/configs/ep88xc_defconfig
arch/powerpc/configs/gamecube_defconfig
arch/powerpc/configs/holly_defconfig
arch/powerpc/configs/mgcoge_defconfig
arch/powerpc/configs/mgsuvd_defconfig
arch/powerpc/configs/mpc7448_hpc2_defconfig
arch/powerpc/configs/mpc8272_ads_defconfig
arch/powerpc/configs/mpc83xx_defconfig
arch/powerpc/configs/mpc85xx_defconfig
arch/powerpc/configs/mpc85xx_smp_defconfig
arch/powerpc/configs/mpc866_ads_defconfig
arch/powerpc/configs/mpc86xx_defconfig
arch/powerpc/configs/mpc885_ads_defconfig
arch/powerpc/configs/ppc40x_defconfig
arch/powerpc/configs/ppc44x_defconfig
arch/powerpc/configs/pq2fads_defconfig
arch/powerpc/configs/ps3_defconfig
arch/powerpc/configs/pseries_defconfig
arch/powerpc/configs/storcenter_defconfig
arch/powerpc/configs/tqm8xx_defconfig
arch/powerpc/configs/wii_defconfig
arch/powerpc/include/asm/feature-fixups.h
arch/powerpc/include/asm/immap_qe.h
arch/powerpc/include/asm/irqflags.h
arch/powerpc/include/asm/machdep.h
arch/powerpc/include/asm/reg.h
arch/powerpc/include/asm/reg_booke.h
arch/powerpc/include/asm/spu.h
arch/powerpc/kernel/cpu_setup_fsl_booke.S
arch/powerpc/kernel/cputable.c
arch/powerpc/kernel/crash.c
arch/powerpc/kernel/entry_32.S
arch/powerpc/kernel/machine_kexec.c
arch/powerpc/kernel/perf_event.c
arch/powerpc/kernel/process.c
arch/powerpc/kernel/rtas_flash.c
arch/powerpc/kernel/rtasd.c
arch/powerpc/kernel/time.c
arch/powerpc/kernel/traps.c
arch/powerpc/lib/feature-fixups-test.S
arch/powerpc/platforms/83xx/mpc830x_rdb.c
arch/powerpc/platforms/83xx/mpc831x_rdb.c
arch/powerpc/platforms/83xx/mpc83xx.h
arch/powerpc/platforms/83xx/usb.c
arch/powerpc/platforms/cell/cpufreq_spudemand.c
arch/powerpc/platforms/cell/qpace_setup.c
arch/powerpc/platforms/cell/spu_base.c
arch/powerpc/platforms/cell/spufs/file.c
arch/powerpc/platforms/embedded6xx/gamecube.c
arch/powerpc/platforms/embedded6xx/wii.c
arch/powerpc/platforms/iseries/Kconfig
arch/powerpc/platforms/pseries/Kconfig
arch/powerpc/platforms/pseries/kexec.c
arch/powerpc/platforms/pseries/ras.c
arch/powerpc/sysdev/fsl_rio.c
arch/powerpc/sysdev/mpic.c
arch/score/Kconfig
arch/score/configs/spct6600_defconfig
arch/sh/Kconfig
arch/sparc/Kconfig
arch/tile/Kconfig
arch/tile/Kconfig.debug
arch/tile/configs/tile_defconfig
arch/um/Kconfig.common
arch/um/Kconfig.um
arch/um/defconfig
arch/x86/Kconfig
arch/x86/Kconfig.cpu
arch/x86/Kconfig.debug
arch/x86/include/asm/numa_32.h
arch/x86/include/asm/numa_64.h
arch/x86/include/asm/percpu.h
arch/x86/kernel/irq_32.c
arch/x86/lguest/Kconfig
arch/x86/lguest/boot.c
arch/x86/mm/numa.c
arch/x86/mm/numa_64.c
arch/x86/mm/srat_32.c
arch/x86/xen/enlighten.c
arch/x86/xen/irq.c
arch/x86/xen/p2m.c
arch/xtensa/configs/common_defconfig
arch/xtensa/configs/iss_defconfig
arch/xtensa/configs/s6105_defconfig
block/Kconfig
drivers/Makefile
drivers/acpi/Kconfig
drivers/acpi/acpica/accommon.h
drivers/acpi/acpica/acconfig.h
drivers/acpi/acpica/acdebug.h
drivers/acpi/acpica/acdispat.h
drivers/acpi/acpica/acevents.h
drivers/acpi/acpica/acglobal.h
drivers/acpi/acpica/achware.h
drivers/acpi/acpica/acinterp.h
drivers/acpi/acpica/aclocal.h
drivers/acpi/acpica/acmacros.h
drivers/acpi/acpica/acnamesp.h
drivers/acpi/acpica/acobject.h
drivers/acpi/acpica/acopcode.h
drivers/acpi/acpica/acparser.h
drivers/acpi/acpica/acpredef.h
drivers/acpi/acpica/acresrc.h
drivers/acpi/acpica/acstruct.h
drivers/acpi/acpica/actables.h
drivers/acpi/acpica/acutils.h
drivers/acpi/acpica/amlcode.h
drivers/acpi/acpica/amlresrc.h
drivers/acpi/acpica/dsfield.c
drivers/acpi/acpica/dsinit.c
drivers/acpi/acpica/dsmethod.c
drivers/acpi/acpica/dsmthdat.c
drivers/acpi/acpica/dsobject.c
drivers/acpi/acpica/dsopcode.c
drivers/acpi/acpica/dsutils.c
drivers/acpi/acpica/dswexec.c
drivers/acpi/acpica/dswload.c
drivers/acpi/acpica/dswscope.c
drivers/acpi/acpica/dswstate.c
drivers/acpi/acpica/evevent.c
drivers/acpi/acpica/evgpe.c
drivers/acpi/acpica/evgpeblk.c
drivers/acpi/acpica/evgpeinit.c
drivers/acpi/acpica/evgpeutil.c
drivers/acpi/acpica/evmisc.c
drivers/acpi/acpica/evregion.c
drivers/acpi/acpica/evrgnini.c
drivers/acpi/acpica/evsci.c
drivers/acpi/acpica/evxface.c
drivers/acpi/acpica/evxfevnt.c
drivers/acpi/acpica/evxfgpe.c
drivers/acpi/acpica/evxfregn.c
drivers/acpi/acpica/exconfig.c
drivers/acpi/acpica/exconvrt.c
drivers/acpi/acpica/excreate.c
drivers/acpi/acpica/exdebug.c
drivers/acpi/acpica/exdump.c
drivers/acpi/acpica/exfield.c
drivers/acpi/acpica/exfldio.c
drivers/acpi/acpica/exmisc.c
drivers/acpi/acpica/exmutex.c
drivers/acpi/acpica/exnames.c
drivers/acpi/acpica/exoparg1.c
drivers/acpi/acpica/exoparg2.c
drivers/acpi/acpica/exoparg3.c
drivers/acpi/acpica/exoparg6.c
drivers/acpi/acpica/exprep.c
drivers/acpi/acpica/exregion.c
drivers/acpi/acpica/exresnte.c
drivers/acpi/acpica/exresolv.c
drivers/acpi/acpica/exresop.c
drivers/acpi/acpica/exstore.c
drivers/acpi/acpica/exstoren.c
drivers/acpi/acpica/exstorob.c
drivers/acpi/acpica/exsystem.c
drivers/acpi/acpica/exutils.c
drivers/acpi/acpica/hwacpi.c
drivers/acpi/acpica/hwgpe.c
drivers/acpi/acpica/hwpci.c
drivers/acpi/acpica/hwregs.c
drivers/acpi/acpica/hwsleep.c
drivers/acpi/acpica/hwtimer.c
drivers/acpi/acpica/hwvalid.c
drivers/acpi/acpica/hwxface.c
drivers/acpi/acpica/nsaccess.c
drivers/acpi/acpica/nsalloc.c
drivers/acpi/acpica/nsdump.c
drivers/acpi/acpica/nsdumpdv.c
drivers/acpi/acpica/nseval.c
drivers/acpi/acpica/nsinit.c
drivers/acpi/acpica/nsload.c
drivers/acpi/acpica/nsnames.c
drivers/acpi/acpica/nsobject.c
drivers/acpi/acpica/nsparse.c
drivers/acpi/acpica/nspredef.c
drivers/acpi/acpica/nsrepair.c
drivers/acpi/acpica/nsrepair2.c
drivers/acpi/acpica/nssearch.c
drivers/acpi/acpica/nsutils.c
drivers/acpi/acpica/nswalk.c
drivers/acpi/acpica/nsxfeval.c
drivers/acpi/acpica/nsxfname.c
drivers/acpi/acpica/nsxfobj.c
drivers/acpi/acpica/psargs.c
drivers/acpi/acpica/psloop.c
drivers/acpi/acpica/psopcode.c
drivers/acpi/acpica/psparse.c
drivers/acpi/acpica/psscope.c
drivers/acpi/acpica/pstree.c
drivers/acpi/acpica/psutils.c
drivers/acpi/acpica/pswalk.c
drivers/acpi/acpica/psxface.c
drivers/acpi/acpica/rsaddr.c
drivers/acpi/acpica/rscalc.c
drivers/acpi/acpica/rscreate.c
drivers/acpi/acpica/rsdump.c
drivers/acpi/acpica/rsinfo.c
drivers/acpi/acpica/rsio.c
drivers/acpi/acpica/rsirq.c
drivers/acpi/acpica/rslist.c
drivers/acpi/acpica/rsmemory.c
drivers/acpi/acpica/rsmisc.c
drivers/acpi/acpica/rsutils.c
drivers/acpi/acpica/rsxface.c
drivers/acpi/acpica/tbfadt.c
drivers/acpi/acpica/tbfind.c
drivers/acpi/acpica/tbinstal.c
drivers/acpi/acpica/tbutils.c
drivers/acpi/acpica/tbxface.c
drivers/acpi/acpica/tbxfroot.c
drivers/acpi/acpica/utalloc.c
drivers/acpi/acpica/utcopy.c
drivers/acpi/acpica/utdebug.c
drivers/acpi/acpica/utdelete.c
drivers/acpi/acpica/uteval.c
drivers/acpi/acpica/utglobal.c
drivers/acpi/acpica/utids.c
drivers/acpi/acpica/utinit.c
drivers/acpi/acpica/utlock.c
drivers/acpi/acpica/utmath.c
drivers/acpi/acpica/utmisc.c
drivers/acpi/acpica/utmutex.c
drivers/acpi/acpica/utobject.c
drivers/acpi/acpica/utosi.c
drivers/acpi/acpica/utresrc.c
drivers/acpi/acpica/utstate.c
drivers/acpi/acpica/utxface.c
drivers/acpi/acpica/utxferror.c
drivers/acpi/battery.c
drivers/acpi/nvs.c
drivers/acpi/osl.c
drivers/acpi/sleep.c
drivers/ata/Kconfig
drivers/base/Kconfig
drivers/char/Kconfig
drivers/char/Makefile
drivers/char/tpm/tpm.c
drivers/char/tpm/tpm_tis.c
drivers/cpufreq/Kconfig
drivers/firewire/Kconfig
drivers/firewire/core-card.c
drivers/firewire/net.c
drivers/firmware/Kconfig
drivers/gpu/drm/Kconfig
drivers/gpu/drm/drm_fb_helper.c
drivers/gpu/drm/nouveau/Kconfig
drivers/gpu/vga/Kconfig
drivers/hid/Kconfig
drivers/hid/usbhid/Kconfig
drivers/hwmon/Kconfig
drivers/hwmon/lm93.c
drivers/ide/Kconfig
drivers/infiniband/hw/mthca/Kconfig
drivers/infiniband/ulp/ipoib/Kconfig
drivers/input/Kconfig
drivers/input/keyboard/Kconfig
drivers/input/mouse/Kconfig
drivers/input/serio/Kconfig
drivers/input/touchscreen/Kconfig
drivers/leds/ledtrig-gpio.c
drivers/lguest/page_tables.c
drivers/lguest/x86/core.c
drivers/macintosh/therm_pm72.c
drivers/media/common/saa7146_core.c
drivers/media/common/saa7146_fops.c
drivers/media/common/saa7146_vbi.c
drivers/media/common/saa7146_video.c
drivers/media/common/tuners/Kconfig
drivers/media/common/tuners/tda8290.c
drivers/media/dvb/dvb-usb/dib0700_core.c
drivers/media/dvb/firewire/firedtv-rc.c
drivers/media/dvb/frontends/Kconfig
drivers/media/dvb/frontends/af9013.c
drivers/media/dvb/frontends/ix2505v.c
drivers/media/dvb/frontends/mb86a20s.c
drivers/media/dvb/ttpci/av7110_ca.c
drivers/media/radio/Kconfig
drivers/media/radio/Makefile
drivers/media/radio/radio-aimslab.c
drivers/media/radio/radio-gemtek-pci.c [deleted file]
drivers/media/radio/radio-maxiradio.c
drivers/media/radio/radio-wl1273.c
drivers/media/radio/si470x/radio-si470x-common.c
drivers/media/rc/ene_ir.c
drivers/media/rc/ene_ir.h
drivers/media/rc/imon.c
drivers/media/rc/ir-raw.c
drivers/media/rc/keymaps/rc-dib0700-nec.c
drivers/media/rc/mceusb.c
drivers/media/video/Kconfig
drivers/media/video/Makefile
drivers/media/video/adv7175.c
drivers/media/video/bt8xx/bttv-cards.c
drivers/media/video/bt8xx/bttv.h
drivers/media/video/cafe_ccic.c
drivers/media/video/cpia2/cpia2.h
drivers/media/video/cpia2/cpia2_core.c
drivers/media/video/cpia2/cpia2_v4l.c
drivers/media/video/cx18/cx18-driver.c
drivers/media/video/cx18/cx18-driver.h
drivers/media/video/cx18/cx18-streams.h
drivers/media/video/cx231xx/cx231xx-dvb.c
drivers/media/video/cx25840/cx25840-core.c
drivers/media/video/davinci/vpif.c
drivers/media/video/davinci/vpif.h
drivers/media/video/davinci/vpif_capture.c
drivers/media/video/davinci/vpif_capture.h
drivers/media/video/davinci/vpif_display.c
drivers/media/video/davinci/vpif_display.h
drivers/media/video/em28xx/em28xx-cards.c
drivers/media/video/et61x251/et61x251.h
drivers/media/video/gspca/benq.c
drivers/media/video/gspca/conex.c
drivers/media/video/gspca/cpia1.c
drivers/media/video/gspca/etoms.c
drivers/media/video/gspca/finepix.c
drivers/media/video/gspca/gl860/gl860.c
drivers/media/video/gspca/gspca.c
drivers/media/video/gspca/gspca.h
drivers/media/video/gspca/jeilinj.c
drivers/media/video/gspca/jpeg.h
drivers/media/video/gspca/konica.c
drivers/media/video/gspca/m5602/m5602_core.c
drivers/media/video/gspca/mars.c
drivers/media/video/gspca/mr97310a.c
drivers/media/video/gspca/ov519.c
drivers/media/video/gspca/ov534.c
drivers/media/video/gspca/ov534_9.c
drivers/media/video/gspca/pac207.c
drivers/media/video/gspca/pac7302.c
drivers/media/video/gspca/pac7311.c
drivers/media/video/gspca/sn9c2028.c
drivers/media/video/gspca/sn9c20x.c
drivers/media/video/gspca/sonixb.c
drivers/media/video/gspca/sonixj.c
drivers/media/video/gspca/spca1528.c
drivers/media/video/gspca/spca500.c
drivers/media/video/gspca/spca501.c
drivers/media/video/gspca/spca505.c
drivers/media/video/gspca/spca508.c
drivers/media/video/gspca/spca561.c
drivers/media/video/gspca/sq905.c
drivers/media/video/gspca/sq905c.c
drivers/media/video/gspca/sq930x.c
drivers/media/video/gspca/stk014.c
drivers/media/video/gspca/stv0680.c
drivers/media/video/gspca/stv06xx/stv06xx.c
drivers/media/video/gspca/sunplus.c
drivers/media/video/gspca/t613.c
drivers/media/video/gspca/tv8532.c
drivers/media/video/gspca/vc032x.c
drivers/media/video/gspca/xirlink_cit.c
drivers/media/video/gspca/zc3xx.c
drivers/media/video/hdpvr/Makefile
drivers/media/video/hdpvr/hdpvr-core.c
drivers/media/video/hdpvr/hdpvr-i2c.c
drivers/media/video/hdpvr/hdpvr-video.c
drivers/media/video/hdpvr/hdpvr.h
drivers/media/video/ir-kbd-i2c.c
drivers/media/video/ivtv/ivtv-i2c.c
drivers/media/video/mt9v011.c
drivers/media/video/mt9v011.h [deleted file]
drivers/media/video/ov7670.c
drivers/media/video/pvrusb2/pvrusb2-hdw-internal.h
drivers/media/video/pvrusb2/pvrusb2-i2c-core.c
drivers/media/video/saa7134/saa7134-cards.c
drivers/media/video/saa7134/saa7134-dvb.c
drivers/media/video/sn9c102/sn9c102_devtable.h
drivers/media/video/sr030pc30.c
drivers/media/video/tda9875.c [deleted file]
drivers/media/video/tlg2300/pd-video.c
drivers/media/video/v4l2-common.c
drivers/media/video/v4l2-ctrls.c
drivers/media/video/v4l2-dev.c
drivers/media/video/v4l2-device.c
drivers/media/video/v4l2-ioctl.c
drivers/media/video/w9966.c
drivers/media/video/zoran/zoran_card.c
drivers/net/Kconfig
drivers/net/arm/ks8695net.c
drivers/net/bnx2x/bnx2x.h
drivers/net/bnx2x/bnx2x_hsi.h
drivers/net/bnx2x/bnx2x_link.c
drivers/net/bnx2x/bnx2x_reg.h
drivers/net/gianfar.c
drivers/net/irda/sh_irda.c
drivers/net/ns83820.c
drivers/net/usb/cdc_ncm.c
drivers/net/vmxnet3/vmxnet3_drv.c
drivers/net/vmxnet3/vmxnet3_ethtool.c
drivers/net/vmxnet3/vmxnet3_int.h
drivers/net/wireless/ath/ath5k/base.c
drivers/net/wireless/ath/ath9k/ar9002_calib.c
drivers/net/wireless/ath/ath9k/ar9003_2p2_initvals.h
drivers/net/wireless/ath/ath9k/ar9003_hw.c
drivers/net/wireless/ath/ath9k/htc.h
drivers/net/wireless/ath/ath9k/htc_drv_txrx.c
drivers/net/wireless/iwlwifi/iwl-agn-eeprom.c
drivers/net/wireless/iwmc3200wifi/netdev.c
drivers/net/wireless/rt2x00/rt2x00firmware.c
drivers/pci/pcie/Kconfig
drivers/pcmcia/Kconfig
drivers/rapidio/rio-scan.c
drivers/s390/net/qeth_l2_main.c
drivers/s390/net/qeth_l3_main.c
drivers/spi/Kconfig
drivers/spi/Makefile
drivers/spi/ath79_spi.c [new file with mode: 0644]
drivers/ssb/Kconfig
drivers/staging/lirc/TODO.lirc_zilog
drivers/staging/lirc/lirc_imon.c
drivers/staging/lirc/lirc_it87.c
drivers/staging/lirc/lirc_parallel.c
drivers/staging/lirc/lirc_sasem.c
drivers/staging/lirc/lirc_serial.c
drivers/staging/lirc/lirc_sir.c
drivers/staging/lirc/lirc_zilog.c
drivers/staging/tm6000/tm6000-video.c
drivers/tty/Makefile
drivers/tty/hvc/Makefile [new file with mode: 0644]
drivers/tty/hvc/hvc_beat.c [moved from drivers/char/hvc_beat.c with 100% similarity]
drivers/tty/hvc/hvc_console.c [moved from drivers/char/hvc_console.c with 100% similarity]
drivers/tty/hvc/hvc_console.h [moved from drivers/char/hvc_console.h with 100% similarity]
drivers/tty/hvc/hvc_dcc.c [moved from drivers/char/hvc_dcc.c with 100% similarity]
drivers/tty/hvc/hvc_irq.c [moved from drivers/char/hvc_irq.c with 100% similarity]
drivers/tty/hvc/hvc_iseries.c [moved from drivers/char/hvc_iseries.c with 100% similarity]
drivers/tty/hvc/hvc_iucv.c [moved from drivers/char/hvc_iucv.c with 100% similarity]
drivers/tty/hvc/hvc_rtas.c [moved from drivers/char/hvc_rtas.c with 100% similarity]
drivers/tty/hvc/hvc_tile.c [moved from drivers/char/hvc_tile.c with 100% similarity]
drivers/tty/hvc/hvc_udbg.c [moved from drivers/char/hvc_udbg.c with 100% similarity]
drivers/tty/hvc/hvc_vio.c [moved from drivers/char/hvc_vio.c with 100% similarity]
drivers/tty/hvc/hvc_xen.c [moved from drivers/char/hvc_xen.c with 100% similarity]
drivers/tty/hvc/hvcs.c [moved from drivers/char/hvcs.c with 100% similarity]
drivers/tty/hvc/hvsi.c [moved from drivers/char/hvsi.c with 100% similarity]
drivers/tty/hvc/virtio_console.c [moved from drivers/char/virtio_console.c with 100% similarity]
drivers/tty/serial/21285.c [moved from drivers/serial/21285.c with 100% similarity]
drivers/tty/serial/68328serial.c [moved from drivers/serial/68328serial.c with 100% similarity]
drivers/tty/serial/68328serial.h [moved from drivers/serial/68328serial.h with 100% similarity]
drivers/tty/serial/68360serial.c [moved from drivers/serial/68360serial.c with 100% similarity]
drivers/tty/serial/8250.c [moved from drivers/serial/8250.c with 100% similarity]
drivers/tty/serial/8250.h [moved from drivers/serial/8250.h with 100% similarity]
drivers/tty/serial/8250_accent.c [moved from drivers/serial/8250_accent.c with 100% similarity]
drivers/tty/serial/8250_acorn.c [moved from drivers/serial/8250_acorn.c with 100% similarity]
drivers/tty/serial/8250_boca.c [moved from drivers/serial/8250_boca.c with 100% similarity]
drivers/tty/serial/8250_early.c [moved from drivers/serial/8250_early.c with 100% similarity]
drivers/tty/serial/8250_exar_st16c554.c [moved from drivers/serial/8250_exar_st16c554.c with 100% similarity]
drivers/tty/serial/8250_fourport.c [moved from drivers/serial/8250_fourport.c with 100% similarity]
drivers/tty/serial/8250_gsc.c [moved from drivers/serial/8250_gsc.c with 100% similarity]
drivers/tty/serial/8250_hp300.c [moved from drivers/serial/8250_hp300.c with 100% similarity]
drivers/tty/serial/8250_hub6.c [moved from drivers/serial/8250_hub6.c with 100% similarity]
drivers/tty/serial/8250_mca.c [moved from drivers/serial/8250_mca.c with 100% similarity]
drivers/tty/serial/8250_pci.c [moved from drivers/serial/8250_pci.c with 100% similarity]
drivers/tty/serial/8250_pnp.c [moved from drivers/serial/8250_pnp.c with 100% similarity]
drivers/tty/serial/Kconfig [moved from drivers/serial/Kconfig with 99% similarity]
drivers/tty/serial/Makefile [moved from drivers/serial/Makefile with 100% similarity]
drivers/tty/serial/altera_jtaguart.c [moved from drivers/serial/altera_jtaguart.c with 100% similarity]
drivers/tty/serial/altera_uart.c [moved from drivers/serial/altera_uart.c with 100% similarity]
drivers/tty/serial/amba-pl010.c [moved from drivers/serial/amba-pl010.c with 100% similarity]
drivers/tty/serial/amba-pl011.c [moved from drivers/serial/amba-pl011.c with 100% similarity]
drivers/tty/serial/apbuart.c [moved from drivers/serial/apbuart.c with 100% similarity]
drivers/tty/serial/apbuart.h [moved from drivers/serial/apbuart.h with 100% similarity]
drivers/tty/serial/atmel_serial.c [moved from drivers/serial/atmel_serial.c with 100% similarity]
drivers/tty/serial/bcm63xx_uart.c [moved from drivers/serial/bcm63xx_uart.c with 100% similarity]
drivers/tty/serial/bfin_5xx.c [moved from drivers/serial/bfin_5xx.c with 100% similarity]
drivers/tty/serial/bfin_sport_uart.c [moved from drivers/serial/bfin_sport_uart.c with 100% similarity]
drivers/tty/serial/bfin_sport_uart.h [moved from drivers/serial/bfin_sport_uart.h with 100% similarity]
drivers/tty/serial/clps711x.c [moved from drivers/serial/clps711x.c with 100% similarity]
drivers/tty/serial/cpm_uart/Makefile [moved from drivers/serial/cpm_uart/Makefile with 100% similarity]
drivers/tty/serial/cpm_uart/cpm_uart.h [moved from drivers/serial/cpm_uart/cpm_uart.h with 100% similarity]
drivers/tty/serial/cpm_uart/cpm_uart_core.c [moved from drivers/serial/cpm_uart/cpm_uart_core.c with 100% similarity]
drivers/tty/serial/cpm_uart/cpm_uart_cpm1.c [moved from drivers/serial/cpm_uart/cpm_uart_cpm1.c with 100% similarity]
drivers/tty/serial/cpm_uart/cpm_uart_cpm1.h [moved from drivers/serial/cpm_uart/cpm_uart_cpm1.h with 100% similarity]
drivers/tty/serial/cpm_uart/cpm_uart_cpm2.c [moved from drivers/serial/cpm_uart/cpm_uart_cpm2.c with 100% similarity]
drivers/tty/serial/cpm_uart/cpm_uart_cpm2.h [moved from drivers/serial/cpm_uart/cpm_uart_cpm2.h with 100% similarity]
drivers/tty/serial/crisv10.c [moved from drivers/serial/crisv10.c with 100% similarity]
drivers/tty/serial/crisv10.h [moved from drivers/serial/crisv10.h with 100% similarity]
drivers/tty/serial/dz.c [moved from drivers/serial/dz.c with 100% similarity]
drivers/tty/serial/dz.h [moved from drivers/serial/dz.h with 100% similarity]
drivers/tty/serial/icom.c [moved from drivers/serial/icom.c with 100% similarity]
drivers/tty/serial/icom.h [moved from drivers/serial/icom.h with 100% similarity]
drivers/tty/serial/ifx6x60.c [moved from drivers/serial/ifx6x60.c with 100% similarity]
drivers/tty/serial/ifx6x60.h [moved from drivers/serial/ifx6x60.h with 100% similarity]
drivers/tty/serial/imx.c [moved from drivers/serial/imx.c with 100% similarity]
drivers/tty/serial/ioc3_serial.c [moved from drivers/serial/ioc3_serial.c with 100% similarity]
drivers/tty/serial/ioc4_serial.c [moved from drivers/serial/ioc4_serial.c with 100% similarity]
drivers/tty/serial/ip22zilog.c [moved from drivers/serial/ip22zilog.c with 100% similarity]
drivers/tty/serial/ip22zilog.h [moved from drivers/serial/ip22zilog.h with 100% similarity]
drivers/tty/serial/jsm/Makefile [moved from drivers/serial/jsm/Makefile with 100% similarity]
drivers/tty/serial/jsm/jsm.h [moved from drivers/serial/jsm/jsm.h with 100% similarity]
drivers/tty/serial/jsm/jsm_driver.c [moved from drivers/serial/jsm/jsm_driver.c with 100% similarity]
drivers/tty/serial/jsm/jsm_neo.c [moved from drivers/serial/jsm/jsm_neo.c with 100% similarity]
drivers/tty/serial/jsm/jsm_tty.c [moved from drivers/serial/jsm/jsm_tty.c with 100% similarity]
drivers/tty/serial/kgdboc.c [moved from drivers/serial/kgdboc.c with 100% similarity]
drivers/tty/serial/m32r_sio.c [moved from drivers/serial/m32r_sio.c with 100% similarity]
drivers/tty/serial/m32r_sio.h [moved from drivers/serial/m32r_sio.h with 100% similarity]
drivers/tty/serial/m32r_sio_reg.h [moved from drivers/serial/m32r_sio_reg.h with 100% similarity]
drivers/tty/serial/max3100.c [moved from drivers/serial/max3100.c with 100% similarity]
drivers/tty/serial/max3107-aava.c [moved from drivers/serial/max3107-aava.c with 100% similarity]
drivers/tty/serial/max3107.c [moved from drivers/serial/max3107.c with 100% similarity]
drivers/tty/serial/max3107.h [moved from drivers/serial/max3107.h with 100% similarity]
drivers/tty/serial/mcf.c [moved from drivers/serial/mcf.c with 100% similarity]
drivers/tty/serial/mfd.c [moved from drivers/serial/mfd.c with 100% similarity]
drivers/tty/serial/mpc52xx_uart.c [moved from drivers/serial/mpc52xx_uart.c with 100% similarity]
drivers/tty/serial/mpsc.c [moved from drivers/serial/mpsc.c with 100% similarity]
drivers/tty/serial/mrst_max3110.c [moved from drivers/serial/mrst_max3110.c with 100% similarity]
drivers/tty/serial/mrst_max3110.h [moved from drivers/serial/mrst_max3110.h with 100% similarity]
drivers/tty/serial/msm_serial.c [moved from drivers/serial/msm_serial.c with 100% similarity]
drivers/tty/serial/msm_serial.h [moved from drivers/serial/msm_serial.h with 100% similarity]
drivers/tty/serial/mux.c [moved from drivers/serial/mux.c with 100% similarity]
drivers/tty/serial/netx-serial.c [moved from drivers/serial/netx-serial.c with 100% similarity]
drivers/tty/serial/nwpserial.c [moved from drivers/serial/nwpserial.c with 100% similarity]
drivers/tty/serial/of_serial.c [moved from drivers/serial/of_serial.c with 100% similarity]
drivers/tty/serial/omap-serial.c [moved from drivers/serial/omap-serial.c with 100% similarity]
drivers/tty/serial/pch_uart.c [moved from drivers/serial/pch_uart.c with 100% similarity]
drivers/tty/serial/pmac_zilog.c [moved from drivers/serial/pmac_zilog.c with 100% similarity]
drivers/tty/serial/pmac_zilog.h [moved from drivers/serial/pmac_zilog.h with 100% similarity]
drivers/tty/serial/pnx8xxx_uart.c [moved from drivers/serial/pnx8xxx_uart.c with 100% similarity]
drivers/tty/serial/pxa.c [moved from drivers/serial/pxa.c with 100% similarity]
drivers/tty/serial/s3c2400.c [moved from drivers/serial/s3c2400.c with 100% similarity]
drivers/tty/serial/s3c2410.c [moved from drivers/serial/s3c2410.c with 100% similarity]
drivers/tty/serial/s3c2412.c [moved from drivers/serial/s3c2412.c with 100% similarity]
drivers/tty/serial/s3c2440.c [moved from drivers/serial/s3c2440.c with 100% similarity]
drivers/tty/serial/s3c24a0.c [moved from drivers/serial/s3c24a0.c with 100% similarity]
drivers/tty/serial/s3c6400.c [moved from drivers/serial/s3c6400.c with 100% similarity]
drivers/tty/serial/s5pv210.c [moved from drivers/serial/s5pv210.c with 100% similarity]
drivers/tty/serial/sa1100.c [moved from drivers/serial/sa1100.c with 100% similarity]
drivers/tty/serial/samsung.c [moved from drivers/serial/samsung.c with 100% similarity]
drivers/tty/serial/samsung.h [moved from drivers/serial/samsung.h with 100% similarity]
drivers/tty/serial/sb1250-duart.c [moved from drivers/serial/sb1250-duart.c with 100% similarity]
drivers/tty/serial/sc26xx.c [moved from drivers/serial/sc26xx.c with 100% similarity]
drivers/tty/serial/serial_core.c [moved from drivers/serial/serial_core.c with 100% similarity]
drivers/tty/serial/serial_cs.c [moved from drivers/serial/serial_cs.c with 100% similarity]
drivers/tty/serial/serial_ks8695.c [moved from drivers/serial/serial_ks8695.c with 100% similarity]
drivers/tty/serial/serial_lh7a40x.c [moved from drivers/serial/serial_lh7a40x.c with 100% similarity]
drivers/tty/serial/serial_txx9.c [moved from drivers/serial/serial_txx9.c with 100% similarity]
drivers/tty/serial/sh-sci.c [moved from drivers/serial/sh-sci.c with 100% similarity]
drivers/tty/serial/sh-sci.h [moved from drivers/serial/sh-sci.h with 100% similarity]
drivers/tty/serial/sn_console.c [moved from drivers/serial/sn_console.c with 100% similarity]
drivers/tty/serial/suncore.c [moved from drivers/serial/suncore.c with 100% similarity]
drivers/tty/serial/suncore.h [moved from drivers/serial/suncore.h with 100% similarity]
drivers/tty/serial/sunhv.c [moved from drivers/serial/sunhv.c with 100% similarity]
drivers/tty/serial/sunsab.c [moved from drivers/serial/sunsab.c with 100% similarity]
drivers/tty/serial/sunsab.h [moved from drivers/serial/sunsab.h with 100% similarity]
drivers/tty/serial/sunsu.c [moved from drivers/serial/sunsu.c with 100% similarity]
drivers/tty/serial/sunzilog.c [moved from drivers/serial/sunzilog.c with 100% similarity]
drivers/tty/serial/sunzilog.h [moved from drivers/serial/sunzilog.h with 100% similarity]
drivers/tty/serial/timbuart.c [moved from drivers/serial/timbuart.c with 100% similarity]
drivers/tty/serial/timbuart.h [moved from drivers/serial/timbuart.h with 100% similarity]
drivers/tty/serial/uartlite.c [moved from drivers/serial/uartlite.c with 100% similarity]
drivers/tty/serial/ucc_uart.c [moved from drivers/serial/ucc_uart.c with 100% similarity]
drivers/tty/serial/vr41xx_siu.c [moved from drivers/serial/vr41xx_siu.c with 100% similarity]
drivers/tty/serial/vt8500_serial.c [moved from drivers/serial/vt8500_serial.c with 100% similarity]
drivers/tty/serial/zs.c [moved from drivers/serial/zs.c with 100% similarity]
drivers/tty/serial/zs.h [moved from drivers/serial/zs.h with 100% similarity]
drivers/usb/core/Kconfig
drivers/video/Kconfig
drivers/video/backlight/88pm860x_bl.c
drivers/video/console/Kconfig
drivers/virtio/virtio_pci.c
drivers/xen/xenfs/xenbus.c
fs/Kconfig
fs/autofs4/autofs_i.h
fs/autofs4/expire.c
fs/autofs4/inode.c
fs/autofs4/root.c
fs/autofs4/symlink.c
fs/cifs/cifs_debug.c
fs/cifs/cifs_fs_sb.h
fs/cifs/cifs_unicode.c
fs/cifs/cifsacl.c
fs/cifs/cifsfs.c
fs/cifs/cifsfs.h
fs/cifs/cifsglob.h
fs/cifs/cifspdu.h
fs/cifs/cifsproto.h
fs/cifs/cifssmb.c
fs/cifs/connect.c
fs/cifs/file.c
fs/cifs/inode.c
fs/cifs/misc.c
fs/cifs/netmisc.c
fs/cifs/sess.c
fs/cifs/transport.c
fs/dcache.c
fs/direct-io.c
fs/ext3/super.c
fs/ext4/super.c
fs/gfs2/inode.c
fs/gfs2/inode.h
fs/gfs2/super.c
fs/namei.c
fs/ocfs2/super.c
fs/pipe.c
fs/proc/Kconfig
fs/quota/dquot.c
fs/quota/quota.c
fs/reiserfs/super.c
fs/sysfs/Kconfig
include/acpi/acexcep.h
include/acpi/acnames.h
include/acpi/acoutput.h
include/acpi/acpi.h
include/acpi/acpiosxf.h
include/acpi/acpixf.h
include/acpi/acrestyp.h
include/acpi/actbl.h
include/acpi/actbl1.h
include/acpi/actbl2.h
include/acpi/actypes.h
include/acpi/platform/acenv.h
include/acpi/platform/acgcc.h
include/acpi/platform/aclinux.h
include/asm-generic/vmlinux.lds.h
include/linux/acpi.h
include/linux/acpi_io.h [new file with mode: 0644]
include/linux/gfp.h
include/linux/ieee80211.h
include/linux/irqdesc.h
include/linux/kernel.h
include/linux/kmemcheck.h
include/linux/lockdep.h
include/linux/memcontrol.h
include/linux/mm.h
include/linux/module.h
include/linux/moduleparam.h
include/linux/quota.h
include/linux/quotaops.h
include/linux/virtio_config.h
include/media/mt9v011.h [new file with mode: 0644]
include/media/rc-core.h
include/media/saa7146.h
include/media/v4l2-common.h
include/media/v4l2-ctrls.h
include/media/v4l2-subdev.h
include/net/sctp/user.h
include/sound/ac97_codec.h
init/Kconfig
init/main.c
kernel/irq/Kconfig
kernel/irq/handle.c
kernel/lockdep.c
kernel/params.c
kernel/perf_event.c
kernel/sched.c
kernel/sched_autogroup.c
kernel/sched_autogroup.h
kernel/sched_debug.c
kernel/sched_fair.c
kernel/smp.c
kernel/trace/trace_irqsoff.c
kernel/workqueue.c
lib/Kconfig.debug
lib/xz/Kconfig
mm/compaction.c
mm/huge_memory.c
mm/memblock.c
mm/memcontrol.c
mm/truncate.c
mm/vmscan.c
net/batman-adv/main.h
net/batman-adv/packet.h
net/batman-adv/types.h
net/batman-adv/unicast.c
net/caif/cfcnfg.c
net/can/bcm.c
net/can/raw.c
net/core/dev.c
net/core/rtnetlink.c
net/dsa/dsa.c
net/ipv4/inet_diag.c
net/ipv6/addrconf.c
net/mac80211/Kconfig
net/mac80211/agg-rx.c
net/mac80211/main.c
net/netfilter/nf_conntrack_netlink.c
net/netlink/genetlink.c
net/rfkill/Kconfig
net/sctp/socket.c
net/wireless/Kconfig
net/xfrm/xfrm_user.c
security/keys/Makefile
security/keys/compat.c
security/keys/encrypted.c [moved from security/keys/encrypted_defined.c with 99% similarity]
security/keys/encrypted.h [moved from security/keys/encrypted_defined.h with 100% similarity]
security/keys/gc.c
security/keys/internal.h
security/keys/key.c
security/keys/keyctl.c
security/keys/keyring.c
security/keys/permission.c
security/keys/proc.c
security/keys/process_keys.c
security/keys/request_key.c
security/keys/request_key_auth.c
security/keys/trusted.c [moved from security/keys/trusted_defined.c with 98% similarity]
security/keys/trusted.h [moved from security/keys/trusted_defined.h with 100% similarity]
security/keys/user_defined.c
security/selinux/ss/conditional.c
security/selinux/ss/policydb.c
sound/pci/ac97/ac97_codec.c
sound/pci/ac97/ac97_patch.c
sound/pci/au88x0/au88x0_pcm.c
sound/pci/hda/hda_codec.c
sound/pci/hda/hda_generic.c
sound/pci/hda/hda_intel.c
sound/pci/hda/hda_local.h
sound/pci/hda/hda_proc.c
sound/pci/hda/patch_analog.c
sound/pci/hda/patch_cirrus.c
sound/pci/hda/patch_cmedia.c
sound/pci/hda/patch_conexant.c
sound/pci/hda/patch_hdmi.c
sound/pci/hda/patch_realtek.c
sound/pci/hda/patch_sigmatel.c
sound/pci/hda/patch_via.c
sound/pci/ice1712/delta.c
sound/pci/oxygen/xonar_dg.c
sound/soc/blackfin/Kconfig
sound/soc/blackfin/bf5xx-ac97.c
sound/soc/blackfin/bf5xx-tdm.c
sound/soc/codecs/Kconfig
sound/soc/codecs/wl1273.c
sound/soc/codecs/wl1273.h
sound/soc/codecs/wm8990.c
sound/soc/ep93xx/ep93xx-i2s.c
sound/soc/pxa/z2.c
tools/perf/builtin-record.c
tools/perf/util/parse-events.c
usr/Kconfig

index 35447e0817367083e2a13d1ec3a1cc389e815d50..36f63d4a0a065368e187822b86a8c4af2feddbe3 100644 (file)
@@ -217,8 +217,8 @@ X!Isound/sound_firmware.c
   <chapter id="uart16x50">
      <title>16x50 UART Driver</title>
 !Iinclude/linux/serial_core.h
-!Edrivers/serial/serial_core.c
-!Edrivers/serial/8250.c
+!Edrivers/tty/serial/serial_core.c
+!Edrivers/tty/serial/8250.c
   </chapter>
 
   <chapter id="fbdev">
index e3a97fdd62a6b85bf3f705d39de39719a16221dc..ad8678d489169e7d5dc9d8b06a5d42db98d35ad7 100644 (file)
@@ -28,7 +28,7 @@
        <holder>Convergence GmbH</holder>
 </copyright>
 <copyright>
-       <year>2009-2010</year>
+       <year>2009-2011</year>
        <holder>Mauro Carvalho Chehab</holder>
 </copyright>
 
index f11048d4053f01725d762788ee4b9ebe647ced11..a99088aae1aa80e5a0fe872422009d663af65f60 100644 (file)
@@ -28,7 +28,7 @@
 <title>LINUX MEDIA INFRASTRUCTURE API</title>
 
 <copyright>
-       <year>2009-2010</year>
+       <year>2009-2011</year>
        <holder>LinuxTV Developers</holder>
 </copyright>
 
@@ -86,7 +86,7 @@ Foundation. A copy of the license is included in the chapter entitled
 </author>
 </authorgroup>
 <copyright>
-       <year>2009-2010</year>
+       <year>2009-2011</year>
        <holder>Mauro Carvalho Chehab</holder>
 </copyright>
 
index 360d2737e64946d2ad9a33185ea4a3335962284c..2427f54397e7a28b45d8836befdaee9f8f00d323 100644 (file)
@@ -75,6 +75,7 @@ as follows:</para>
   </section>
 
   <section>
+    <title>RDS datastructures</title>
     <table frame="none" pgwide="1" id="v4l2-rds-data">
       <title>struct
 <structname>v4l2_rds_data</structname></title>
@@ -129,10 +130,11 @@ as follows:</para>
 
     <table frame="none" pgwide="1" id="v4l2-rds-block-codes">
       <title>Block defines</title>
-      <tgroup cols="3">
+      <tgroup cols="4">
        <colspec colname="c1" colwidth="1*" />
        <colspec colname="c2" colwidth="1*" />
-       <colspec colname="c3" colwidth="5*" />
+       <colspec colname="c3" colwidth="1*" />
+       <colspec colname="c4" colwidth="5*" />
        <tbody valign="top">
          <row>
            <entry>V4L2_RDS_BLOCK_MSK</entry>
index 839e93e875ae2450e8e8e1064bb3b31472f9c492..9288af96de347f6afbb82002869ce4ce0a837f76 100644 (file)
@@ -100,6 +100,7 @@ Remote Controller chapter.</contrib>
       <year>2008</year>
       <year>2009</year>
       <year>2010</year>
+      <year>2011</year>
       <holder>Bill Dirks, Michael H. Schimek, Hans Verkuil, Martin
 Rubli, Andy Walls, Muralidharan Karicheri, Mauro Carvalho Chehab</holder>
     </copyright>
@@ -381,7 +382,7 @@ and discussions on the V4L mailing list.</revremark>
 </partinfo>
 
 <title>Video for Linux Two API Specification</title>
- <subtitle>Revision 2.6.33</subtitle>
+ <subtitle>Revision 2.6.38</subtitle>
 
   <chapter id="common">
     &sub-common;
index 8c594c45b6a178c5efa49b671473abfde5e98204..b959659c5df46414413530bd213f1e50aa528ee3 100644 (file)
@@ -357,14 +357,6 @@ Who:       Dave Jones <davej@redhat.com>, Matthew Garrett <mjg@redhat.com>
 
 -----------------------------
 
-What:  __do_IRQ all in one fits nothing interrupt handler
-When:  2.6.32
-Why:   __do_IRQ was kept for easy migration to the type flow handlers.
-       More than two years of migration time is enough.
-Who:   Thomas Gleixner <tglx@linutronix.de>
-
------------------------------
-
 What:  fakephp and associated sysfs files in /sys/bus/pci/slots/
 When:  2011
 Why:   In 2.6.27, the semantics of /sys/bus/pci/slots was redefined to
index 7a10616d0b441c473e82d8c2c31489d7dd5e80c2..f3b2ad2ceb01bb8e9c92aec835d1f4e1cbed78ff 100644 (file)
@@ -6,6 +6,10 @@ Supported chips:
     Prefix 'lm93'
     Addresses scanned: I2C 0x2c-0x2e
     Datasheet: http://www.national.com/ds.cgi/LM/LM93.pdf
+  * National Semiconductor LM94
+    Prefix 'lm94'
+    Addresses scanned: I2C 0x2c-0x2e
+    Datasheet: http://www.national.com/ds.cgi/LM/LM94.pdf
 
 Authors:
        Mark M. Hoffman <mhoffman@lightlink.com>
@@ -56,6 +60,9 @@ previous motherboard management ASICs and uses some of the LM85's features
 for dynamic Vccp monitoring and PROCHOT. It is designed to monitor a dual
 processor Xeon class motherboard with a minimum of external components.
 
+LM94 is also supported in LM93 compatible mode. Extra sensors and features of
+LM94 are not supported.
+
 
 User Interface
 --------------
index dc73bc54cc4e4cacb57fcb72289f88f5d99ef7e0..d9da7e148538286d78d6f11236f3a4db89218f45 100644 (file)
@@ -39,6 +39,9 @@
 #include <limits.h>
 #include <stddef.h>
 #include <signal.h>
+#include <pwd.h>
+#include <grp.h>
+
 #include <linux/virtio_config.h>
 #include <linux/virtio_net.h>
 #include <linux/virtio_blk.h>
@@ -298,20 +301,27 @@ static void *map_zeroed_pages(unsigned int num)
 
        /*
         * We use a private mapping (ie. if we write to the page, it will be
-        * copied).
+        * copied). We allocate an extra two pages PROT_NONE to act as guard
+        * pages against read/write attempts that exceed allocated space.
         */
-       addr = mmap(NULL, getpagesize() * num,
-                   PROT_READ|PROT_WRITE|PROT_EXEC, MAP_PRIVATE, fd, 0);
+       addr = mmap(NULL, getpagesize() * (num+2),
+                   PROT_NONE, MAP_PRIVATE, fd, 0);
+
        if (addr == MAP_FAILED)
                err(1, "Mmapping %u pages of /dev/zero", num);
 
+       if (mprotect(addr + getpagesize(), getpagesize() * num,
+                    PROT_READ|PROT_WRITE) == -1)
+               err(1, "mprotect rw %u pages failed", num);
+
        /*
         * One neat mmap feature is that you can close the fd, and it
         * stays mapped.
         */
        close(fd);
 
-       return addr;
+       /* Return address after PROT_NONE page */
+       return addr + getpagesize();
 }
 
 /* Get some more pages for a device. */
@@ -343,7 +353,7 @@ static void map_at(int fd, void *addr, unsigned long offset, unsigned long len)
         * done to it.  This allows us to share untouched memory between
         * Guests.
         */
-       if (mmap(addr, len, PROT_READ|PROT_WRITE|PROT_EXEC,
+       if (mmap(addr, len, PROT_READ|PROT_WRITE,
                 MAP_FIXED|MAP_PRIVATE, fd, offset) != MAP_FAILED)
                return;
 
@@ -573,10 +583,10 @@ static void *_check_pointer(unsigned long addr, unsigned int size,
                            unsigned int line)
 {
        /*
-        * We have to separately check addr and addr+size, because size could
-        * be huge and addr + size might wrap around.
+        * Check if the requested address and size exceeds the allocated memory,
+        * or addr + size wraps around.
         */
-       if (addr >= guest_limit || addr + size >= guest_limit)
+       if ((addr + size) > guest_limit || (addr + size) < addr)
                errx(1, "%s:%i: Invalid address %#lx", __FILE__, line, addr);
        /*
         * We return a pointer for the caller's convenience, now we know it's
@@ -1872,6 +1882,8 @@ static struct option opts[] = {
        { "block", 1, NULL, 'b' },
        { "rng", 0, NULL, 'r' },
        { "initrd", 1, NULL, 'i' },
+       { "username", 1, NULL, 'u' },
+       { "chroot", 1, NULL, 'c' },
        { NULL },
 };
 static void usage(void)
@@ -1894,6 +1906,12 @@ int main(int argc, char *argv[])
        /* If they specify an initrd file to load. */
        const char *initrd_name = NULL;
 
+       /* Password structure for initgroups/setres[gu]id */
+       struct passwd *user_details = NULL;
+
+       /* Directory to chroot to */
+       char *chroot_path = NULL;
+
        /* Save the args: we "reboot" by execing ourselves again. */
        main_args = argv;
 
@@ -1950,6 +1968,14 @@ int main(int argc, char *argv[])
                case 'i':
                        initrd_name = optarg;
                        break;
+               case 'u':
+                       user_details = getpwnam(optarg);
+                       if (!user_details)
+                               err(1, "getpwnam failed, incorrect username?");
+                       break;
+               case 'c':
+                       chroot_path = optarg;
+                       break;
                default:
                        warnx("Unknown argument %s", argv[optind]);
                        usage();
@@ -2021,6 +2047,37 @@ int main(int argc, char *argv[])
        /* If we exit via err(), this kills all the threads, restores tty. */
        atexit(cleanup_devices);
 
+       /* If requested, chroot to a directory */
+       if (chroot_path) {
+               if (chroot(chroot_path) != 0)
+                       err(1, "chroot(\"%s\") failed", chroot_path);
+
+               if (chdir("/") != 0)
+                       err(1, "chdir(\"/\") failed");
+
+               verbose("chroot done\n");
+       }
+
+       /* If requested, drop privileges */
+       if (user_details) {
+               uid_t u;
+               gid_t g;
+
+               u = user_details->pw_uid;
+               g = user_details->pw_gid;
+
+               if (initgroups(user_details->pw_name, g) != 0)
+                       err(1, "initgroups failed");
+
+               if (setresgid(g, g, g) != 0)
+                       err(1, "setresgid failed");
+
+               if (setresuid(u, u, u) != 0)
+                       err(1, "setresuid failed");
+
+               verbose("Dropping privileges completed\n");
+       }
+
        /* Finally, run the Guest.  This doesn't return. */
        run_guest();
 }
index 6ccaf8e1a00ed84b51610da92e20cedacdf57981..dad99978a6a8d5439d80662716bc52519a310293 100644 (file)
@@ -117,6 +117,11 @@ Running Lguest:
     
   for general information on how to get bridging to work.
 
+- Random number generation. Using the --rng option will provide a
+  /dev/hwrng in the guest that will read from the host's /dev/random.
+  Use this option in conjunction with rng-tools (see ../hw_random.txt)
+  to provide entropy to the guest kernel's /dev/random.
+
 There is a helpful mailing list at http://ozlabs.org/mailman/listinfo/lguest
 
 Good luck!
index 37ba3a72cb76100ce19771357b752e037be515b7..bce23a4a78750c630becfc9f6cf9e109ed6721c7 100644 (file)
@@ -27,42 +27,38 @@ ASoC Codec driver breakdown
 
 1 - Codec DAI and PCM configuration
 -----------------------------------
-Each codec driver must have a struct snd_soc_codec_dai to define its DAI and
+Each codec driver must have a struct snd_soc_dai_driver to define its DAI and
 PCM capabilities and operations. This struct is exported so that it can be
 registered with the core by your machine driver.
 
 e.g.
 
-struct snd_soc_codec_dai wm8731_dai = {
-       .name = "WM8731",
-       /* playback capabilities */
+static struct snd_soc_dai_ops wm8731_dai_ops = {
+       .prepare        = wm8731_pcm_prepare,
+       .hw_params      = wm8731_hw_params,
+       .shutdown       = wm8731_shutdown,
+       .digital_mute   = wm8731_mute,
+       .set_sysclk     = wm8731_set_dai_sysclk,
+       .set_fmt        = wm8731_set_dai_fmt,
+};
+
+struct snd_soc_dai_driver wm8731_dai = {
+       .name = "wm8731-hifi",
        .playback = {
                .stream_name = "Playback",
                .channels_min = 1,
                .channels_max = 2,
                .rates = WM8731_RATES,
                .formats = WM8731_FORMATS,},
-       /* capture capabilities */
        .capture = {
                .stream_name = "Capture",
                .channels_min = 1,
                .channels_max = 2,
                .rates = WM8731_RATES,
                .formats = WM8731_FORMATS,},
-       /* pcm operations - see section 4 below */
-       .ops = {
-               .prepare = wm8731_pcm_prepare,
-               .hw_params = wm8731_hw_params,
-               .shutdown = wm8731_shutdown,
-       },
-       /* DAI operations - see DAI.txt */
-       .dai_ops = {
-               .digital_mute = wm8731_mute,
-               .set_sysclk = wm8731_set_dai_sysclk,
-               .set_fmt = wm8731_set_dai_fmt,
-       }
+       .ops = &wm8731_dai_ops,
+       .symmetric_rates = 1,
 };
-EXPORT_SYMBOL_GPL(wm8731_dai);
 
 
 2 - Codec control IO
@@ -186,13 +182,14 @@ when the mute is applied or freed.
 
 i.e.
 
-static int wm8974_mute(struct snd_soc_codec *codec,
-       struct snd_soc_codec_dai *dai, int mute)
+static int wm8974_mute(struct snd_soc_dai *dai, int mute)
 {
-       u16 mute_reg = wm8974_read_reg_cache(codec, WM8974_DAC) & 0xffbf;
-       if(mute)
-               wm8974_write(codec, WM8974_DAC, mute_reg | 0x40);
+       struct snd_soc_codec *codec = dai->codec;
+       u16 mute_reg = snd_soc_read(codec, WM8974_DAC) & 0xffbf;
+
+       if (mute)
+               snd_soc_write(codec, WM8974_DAC, mute_reg | 0x40);
        else
-               wm8974_write(codec, WM8974_DAC, mute_reg);
+               snd_soc_write(codec, WM8974_DAC, mute_reg);
        return 0;
 }
index 2524c75557df020ad778f92d77e5b9b5a6e01500..3e2ec9cbf3976d0d21c6ee90d7fe075a210a33eb 100644 (file)
@@ -12,6 +12,8 @@ the following struct:-
 struct snd_soc_card {
        char *name;
 
+       ...
+
        int (*probe)(struct platform_device *pdev);
        int (*remove)(struct platform_device *pdev);
 
@@ -22,12 +24,13 @@ struct snd_soc_card {
        int (*resume_pre)(struct platform_device *pdev);
        int (*resume_post)(struct platform_device *pdev);
 
-       /* machine stream operations */
-       struct snd_soc_ops *ops;
+       ...
 
        /* CPU <--> Codec DAI links  */
        struct snd_soc_dai_link *dai_link;
        int num_links;
+
+       ...
 };
 
 probe()/remove()
@@ -42,11 +45,6 @@ of any machine audio tasks that have to be done before or after the codec, DAIs
 and DMA is suspended and resumed. Optional.
 
 
-Machine operations
-------------------
-The machine specific audio operations can be set here. Again this is optional.
-
-
 Machine DAI Configuration
 -------------------------
 The machine DAI configuration glues all the codec and CPU DAIs together. It can
@@ -61,8 +59,10 @@ struct snd_soc_dai_link is used to set up each DAI in your machine. e.g.
 static struct snd_soc_dai_link corgi_dai = {
        .name = "WM8731",
        .stream_name = "WM8731",
-       .cpu_dai = &pxa_i2s_dai,
-       .codec_dai = &wm8731_dai,
+       .cpu_dai_name = "pxa-is2-dai",
+       .codec_dai_name = "wm8731-hifi",
+       .platform_name = "pxa-pcm-audio",
+       .codec_name = "wm8713-codec.0-001a",
        .init = corgi_wm8731_init,
        .ops = &corgi_ops,
 };
@@ -77,26 +77,6 @@ static struct snd_soc_card snd_soc_corgi = {
 };
 
 
-Machine Audio Subsystem
------------------------
-
-The machine soc device glues the platform, machine and codec driver together.
-Private data can also be set here. e.g.
-
-/* corgi audio private data */
-static struct wm8731_setup_data corgi_wm8731_setup = {
-       .i2c_address = 0x1b,
-};
-
-/* corgi audio subsystem */
-static struct snd_soc_device corgi_snd_devdata = {
-       .machine = &snd_soc_corgi,
-       .platform = &pxa2xx_soc_platform,
-       .codec_dev = &soc_codec_dev_wm8731,
-       .codec_data = &corgi_wm8731_setup,
-};
-
-
 Machine Power Map
 -----------------
 
index 06d835987c6a8f9d4454ca39b57ac13bed978c75..d57efad37e0a5b33606599f6735f180706fd228d 100644 (file)
@@ -20,9 +20,10 @@ struct snd_soc_ops {
        int (*trigger)(struct snd_pcm_substream *, int);
 };
 
-The platform driver exports its DMA functionality via struct snd_soc_platform:-
+The platform driver exports its DMA functionality via struct
+snd_soc_platform_driver:-
 
-struct snd_soc_platform {
+struct snd_soc_platform_driver {
        char *name;
 
        int (*probe)(struct platform_device *pdev);
@@ -34,6 +35,13 @@ struct snd_soc_platform {
        int (*pcm_new)(struct snd_card *, struct snd_soc_codec_dai *, struct snd_pcm *);
        void (*pcm_free)(struct snd_pcm *);
 
+       /*
+        * For platform caused delay reporting.
+        * Optional.
+        */
+       snd_pcm_sframes_t (*delay)(struct snd_pcm_substream *,
+               struct snd_soc_dai *);
+
        /* platform stream ops */
        struct snd_pcm_ops *pcm_ops;
 };
index 8773778d23fc612a8dc7e514b657df5805961971..881e7f44491b70a6c803fa68f6185cb4f158b87f 100644 (file)
@@ -285,6 +285,9 @@ implement g_volatile_ctrl like this:
 The 'new value' union is not used in g_volatile_ctrl. In general controls
 that need to implement g_volatile_ctrl are read-only controls.
 
+Note that if one or more controls in a control cluster are marked as volatile,
+then all the controls in the cluster are seen as volatile.
+
 To mark a control as volatile you have to set the is_volatile flag:
 
        ctrl = v4l2_ctrl_new_std(&sd->ctrl_handler, ...);
@@ -462,6 +465,15 @@ pointer to the v4l2_ctrl_ops struct that is used for that cluster.
 Obviously, all controls in the cluster array must be initialized to either
 a valid control or to NULL.
 
+In rare cases you might want to know which controls of a cluster actually
+were set explicitly by the user. For this you can check the 'is_new' flag of
+each control. For example, in the case of a volume/mute cluster the 'is_new'
+flag of the mute control would be set if the user called VIDIOC_S_CTRL for
+mute only. If the user would call VIDIOC_S_EXT_CTRLS for both mute and volume
+controls, then the 'is_new' flag would be 1 for both controls.
+
+The 'is_new' flag is always 1 when called from v4l2_ctrl_handler_setup().
+
 
 VIDIOC_LOG_STATUS Support
 =========================
index 1af022e63668fd0c024292ba82515b39a89d83b0..cf0f3a5c09cc8212ed018f5c0fd46a5a6ccb0067 100644 (file)
@@ -162,7 +162,7 @@ L:  linux-serial@vger.kernel.org
 W:     http://serial.sourceforge.net
 S:     Maintained
 T:     git git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty-2.6.git
-F:     drivers/serial/8250*
+F:     drivers/tty/serial/8250*
 F:     include/linux/serial_8250.h
 
 8390 NETWORK DRIVERS [WD80x3/SMC-ELITE, SMC-ULTRA, NE2000, 3C503, etc.]
@@ -624,11 +624,15 @@ M:        Lennert Buytenhek <kernel@wantstofly.org>
 L:     linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
 S:     Maintained
 
-ARM/ATMEL AT91RM9200 ARM ARCHITECTURE
+ARM/ATMEL AT91RM9200 AND AT91SAM ARM ARCHITECTURES
 M:     Andrew Victor <linux@maxim.org.za>
+M:     Nicolas Ferre <nicolas.ferre@atmel.com>
+M:     Jean-Christophe Plagniol-Villard <plagnioj@jcrosoft.com>
 L:     linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
 W:     http://maxim.org.za/at91_26.html
-S:     Maintained
+W:     http://www.linux4sam.org
+S:     Supported
+F:     arch/arm/mach-at91/
 
 ARM/BCMRING ARM ARCHITECTURE
 M:     Jiandong Zheng <jdzheng@broadcom.com>
@@ -888,8 +892,8 @@ F:  arch/arm/mach-msm/
 F:     drivers/video/msm/
 F:     drivers/mmc/host/msm_sdcc.c
 F:     drivers/mmc/host/msm_sdcc.h
-F:     drivers/serial/msm_serial.h
-F:     drivers/serial/msm_serial.c
+F:     drivers/tty/serial/msm_serial.h
+F:     drivers/tty/serial/msm_serial.c
 T:     git git://codeaurora.org/quic/kernel/davidb/linux-msm.git
 S:     Maintained
 
@@ -1256,7 +1260,7 @@ F:        drivers/mmc/host/atmel-mci-regs.h
 ATMEL AT91 / AT32 SERIAL DRIVER
 M:     Nicolas Ferre <nicolas.ferre@atmel.com>
 S:     Supported
-F:     drivers/serial/atmel_serial.c
+F:     drivers/tty/serial/atmel_serial.c
 
 ATMEL LCDFB DRIVER
 M:     Nicolas Ferre <nicolas.ferre@atmel.com>
@@ -1412,7 +1416,7 @@ M:        Sonic Zhang <sonic.zhang@analog.com>
 L:     uclinux-dist-devel@blackfin.uclinux.org
 W:     http://blackfin.uclinux.org
 S:     Supported
-F:     drivers/serial/bfin_5xx.c
+F:     drivers/tty/serial/bfin_5xx.c
 
 BLACKFIN WATCHDOG DRIVER
 M:     Mike Frysinger <vapier.adi@gmail.com>
@@ -1877,7 +1881,7 @@ L:        linux-cris-kernel@axis.com
 W:     http://developer.axis.com
 S:     Maintained
 F:     arch/cris/
-F:     drivers/serial/crisv10.*
+F:     drivers/tty/serial/crisv10.*
 
 CRYPTO API
 M:     Herbert Xu <herbert@gondor.apana.org.au>
@@ -2216,7 +2220,7 @@ F:        drivers/net/wan/dscc4.c
 DZ DECSTATION DZ11 SERIAL DRIVER
 M:     "Maciej W. Rozycki" <macro@linux-mips.org>
 S:     Maintained
-F:     drivers/serial/dz.*
+F:     drivers/tty/serial/dz.*
 
 EATA-DMA SCSI DRIVER
 M:     Michael Neuffer <mike@i-Connect.Net>
@@ -2643,7 +2647,7 @@ FREESCALE QUICC ENGINE UCC UART DRIVER
 M:     Timur Tabi <timur@freescale.com>
 L:     linuxppc-dev@lists.ozlabs.org
 S:     Supported
-F:     drivers/serial/ucc_uart.c
+F:     drivers/tty/serial/ucc_uart.c
 
 FREESCALE SOC SOUND DRIVERS
 M:     Timur Tabi <timur@freescale.com>
@@ -3146,7 +3150,7 @@ S:        Orphan
 F:     drivers/video/imsttfb.c
 
 INFINIBAND SUBSYSTEM
-M:     Roland Dreier <rolandd@cisco.com>
+M:     Roland Dreier <roland@kernel.org>
 M:     Sean Hefty <sean.hefty@intel.com>
 M:     Hal Rosenstock <hal.rosenstock@gmail.com>
 L:     linux-rdma@vger.kernel.org
@@ -3350,7 +3354,7 @@ IOC3 SERIAL DRIVER
 M:     Pat Gefre <pfg@sgi.com>
 L:     linux-serial@vger.kernel.org
 S:     Maintained
-F:     drivers/serial/ioc3_serial.c
+F:     drivers/tty/serial/ioc3_serial.c
 
 IP MASQUERADING
 M:     Juanjo Ciarlante <jjciarla@raiz.uncu.edu.ar>
@@ -3527,7 +3531,7 @@ JSM Neo PCI based serial card
 M:     Breno Leitao <leitao@linux.vnet.ibm.com>
 L:     linux-serial@vger.kernel.org
 S:     Maintained
-F:     drivers/serial/jsm/
+F:     drivers/tty/serial/jsm/
 
 K10TEMP HARDWARE MONITORING DRIVER
 M:     Clemens Ladisch <clemens@ladisch.de>
@@ -3670,6 +3674,28 @@ F:       include/linux/key-type.h
 F:     include/keys/
 F:     security/keys/
 
+KEYS-TRUSTED
+M:     David Safford <safford@watson.ibm.com>
+M:     Mimi Zohar <zohar@us.ibm.com>
+L:     linux-security-module@vger.kernel.org
+L:     keyrings@linux-nfs.org
+S:     Supported
+F:     Documentation/keys-trusted-encrypted.txt
+F:     include/keys/trusted-type.h
+F:     security/keys/trusted.c
+F:     security/keys/trusted.h
+
+KEYS-ENCRYPTED
+M:     Mimi Zohar <zohar@us.ibm.com>
+M:     David Safford <safford@watson.ibm.com>
+L:     linux-security-module@vger.kernel.org
+L:     keyrings@linux-nfs.org
+S:     Supported
+F:     Documentation/keys-trusted-encrypted.txt
+F:     include/keys/encrypted-type.h
+F:     security/keys/encrypted.c
+F:     security/keys/encrypted.h
+
 KGDB / KDB /debug_core
 M:     Jason Wessel <jason.wessel@windriver.com>
 W:     http://kgdb.wiki.kernel.org/
@@ -3677,7 +3703,7 @@ L:        kgdb-bugreport@lists.sourceforge.net
 S:     Maintained
 F:     Documentation/DocBook/kgdb.tmpl
 F:     drivers/misc/kgdbts.c
-F:     drivers/serial/kgdboc.c
+F:     drivers/tty/serial/kgdboc.c
 F:     include/linux/kdb.h
 F:     include/linux/kgdb.h
 F:     kernel/debug/
@@ -5545,7 +5571,7 @@ M:        Pat Gefre <pfg@sgi.com>
 L:     linux-ia64@vger.kernel.org
 S:     Supported
 F:     Documentation/ia64/serial.txt
-F:     drivers/serial/ioc?_serial.c
+F:     drivers/tty/serial/ioc?_serial.c
 F:     include/linux/ioc?.h
 
 SGI VISUAL WORKSTATION 320 AND 540
@@ -5567,7 +5593,7 @@ L:        linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
 S:     Maintained
 F:     Documentation/arm/Sharp-LH/ADC-LH7-Touchscreen
 F:     arch/arm/mach-lh7a40x/
-F:     drivers/serial/serial_lh7a40x.c
+F:     drivers/tty/serial/serial_lh7a40x.c
 F:     drivers/usb/gadget/lh7a40*
 F:     drivers/usb/host/ohci-lh7a40*
 
@@ -5787,14 +5813,14 @@ L:      sparclinux@vger.kernel.org
 T:     git git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc-2.6.git
 T:     git git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc-next-2.6.git
 S:     Maintained
-F:     drivers/serial/suncore.c
-F:     drivers/serial/suncore.h
-F:     drivers/serial/sunhv.c
-F:     drivers/serial/sunsab.c
-F:     drivers/serial/sunsab.h
-F:     drivers/serial/sunsu.c
-F:     drivers/serial/sunzilog.c
-F:     drivers/serial/sunzilog.h
+F:     drivers/tty/serial/suncore.c
+F:     drivers/tty/serial/suncore.h
+F:     drivers/tty/serial/sunhv.c
+F:     drivers/tty/serial/sunsab.c
+F:     drivers/tty/serial/sunsab.h
+F:     drivers/tty/serial/sunsu.c
+F:     drivers/tty/serial/sunzilog.c
+F:     drivers/tty/serial/sunzilog.h
 
 SPEAR PLATFORM SUPPORT
 M:     Viresh Kumar <viresh.kumar@st.com>
@@ -6124,8 +6150,8 @@ TTY LAYER
 M:     Greg Kroah-Hartman <gregkh@suse.de>
 S:     Maintained
 T:     git git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty-2.6.git
-F:     drivers/char/tty_*
-F:     drivers/serial/serial_core.c
+F:     drivers/tty/*
+F:     drivers/tty/serial/serial_core.c
 F:     include/linux/serial_core.h
 F:     include/linux/serial.h
 F:     include/linux/tty.h
@@ -6870,7 +6896,7 @@ XILINX UARTLITE SERIAL DRIVER
 M:     Peter Korsgaard <jacmet@sunsite.dk>
 L:     linux-serial@vger.kernel.org
 S:     Maintained
-F:     drivers/serial/uartlite.c
+F:     drivers/tty/serial/uartlite.c
 
 YAM DRIVER FOR AX.25
 M:     Jean-Paul Roubelat <jpr@f6fbb.org>
@@ -6916,7 +6942,7 @@ F:        drivers/media/video/zoran/
 ZS DECSTATION Z85C30 SERIAL DRIVER
 M:     "Maciej W. Rozycki" <macro@linux-mips.org>
 S:     Maintained
-F:     drivers/serial/zs.*
+F:     drivers/tty/serial/zs.*
 
 GRE DEMULTIPLEXER DRIVER
 M:     Dmitry Kozlov <xeb@mail.ru>
index 6a457690d10be4106188df33dadd55f9d512230e..1f474953427fdabd12561feeafcd42ae41f16f86 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,7 +1,7 @@
 VERSION = 2
 PATCHLEVEL = 6
-SUBLEVEL = 37
-EXTRAVERSION =
+SUBLEVEL = 38
+EXTRAVERSION = -rc2
 NAME = Flesh-Eating Bats with Fangs
 
 # *DOCUMENTATION*
index fc95ee1bcf6fc239f5dbaad783ec33fbb23e4b6a..47f63d480141575adbb11a0ad2fa82e2d5aee22e 100644 (file)
@@ -8,6 +8,9 @@ config ALPHA
        select HAVE_IRQ_WORK
        select HAVE_PERF_EVENTS
        select HAVE_DMA_ATTRS
+       select HAVE_GENERIC_HARDIRQS
+       select GENERIC_IRQ_PROBE
+       select AUTO_IRQ_AFFINITY if SMP
        help
          The Alpha is a 64-bit general-purpose processor designed and
          marketed by the Digital Equipment Corporation of blessed memory,
@@ -68,22 +71,6 @@ config GENERIC_IOMAP
        bool
        default n
 
-config GENERIC_HARDIRQS_NO__DO_IRQ
-       def_bool y
-
-config GENERIC_HARDIRQS
-       bool
-       default y
-
-config GENERIC_IRQ_PROBE
-       bool
-       default y
-
-config AUTO_IRQ_AFFINITY
-       bool
-       depends on SMP
-       default y
-
 source "init/Kconfig"
 source "kernel/Kconfig.freezer"
 
index 2b9cf56db363d596860e6dd024f719c22db4371a..212ead354a6ba65a142b006e663532236175545c 100644 (file)
@@ -10,7 +10,7 @@ CONFIG_NAMESPACES=y
 # CONFIG_PID_NS is not set
 CONFIG_BLK_DEV_INITRD=y
 CONFIG_INITRAMFS_SOURCE=""
-CONFIG_EMBEDDED=y
+CONFIG_EXPERT=y
 CONFIG_SLAB=y
 # CONFIG_BLK_DEV_BSG is not set
 # CONFIG_IOSCHED_DEADLINE is not set
index 5536c488dd0179e5d58aff28fe1e1dc0d790273d..f0dea52e49c4be569c5c67a00868d564e8c5b61d 100644 (file)
@@ -3,7 +3,7 @@ CONFIG_LOCALVERSION="gum"
 # CONFIG_SWAP is not set
 CONFIG_SYSVIPC=y
 CONFIG_SYSFS_DEPRECATED_V2=y
-CONFIG_EMBEDDED=y
+CONFIG_EXPERT=y
 # CONFIG_SYSCTL_SYSCALL is not set
 # CONFIG_EPOLL is not set
 # CONFIG_SHMEM is not set
index 695e32d4fb58cf73f36852f36d51d4cb82ae68c1..1b1158ae8f821e77e0b5b3ac29f686bd837dac0c 100644 (file)
@@ -17,7 +17,7 @@ CONFIG_SYSFS_DEPRECATED_V2=y
 CONFIG_RELAY=y
 CONFIG_BLK_DEV_INITRD=y
 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
-CONFIG_EMBEDDED=y
+CONFIG_EXPERT=y
 CONFIG_SLAB=y
 CONFIG_PROFILING=y
 CONFIG_OPROFILE=m
index 3a1ad15a779fbd4bfce447b2eddcbd63a54f12f5..5b54abbeb0b3b0cbd7a94c9b01453a002caf83f9 100644 (file)
@@ -1,6 +1,6 @@
 CONFIG_EXPERIMENTAL=y
 CONFIG_LOG_BUF_SHIFT=14
-CONFIG_EMBEDDED=y
+CONFIG_EXPERT=y
 CONFIG_MODULES=y
 CONFIG_MODVERSIONS=y
 CONFIG_ARCH_SA1100=y
index 75984cd1e233b4770ba0c156af48c279f5a9e84b..795374d48f817e51cc701f99e7f5cb31b415f101 100644 (file)
@@ -2,7 +2,7 @@ CONFIG_EXPERIMENTAL=y
 # CONFIG_LOCALVERSION_AUTO is not set
 # CONFIG_SWAP is not set
 CONFIG_SYSVIPC=y
-CONFIG_EMBEDDED=y
+CONFIG_EXPERT=y
 CONFIG_KALLSYMS_EXTRA_PASS=y
 # CONFIG_HOTPLUG is not set
 # CONFIG_ELF_CORE is not set
index dcfbcf3b6c3e032a97d1880627edb4405124d632..a93ff8da5bab4b39a8afd07153cf58cd02d5b45b 100644 (file)
@@ -6,7 +6,7 @@ CONFIG_IKCONFIG_PROC=y
 CONFIG_LOG_BUF_SHIFT=14
 CONFIG_SYSFS_DEPRECATED_V2=y
 CONFIG_BLK_DEV_INITRD=y
-CONFIG_EMBEDDED=y
+CONFIG_EXPERT=y
 # CONFIG_VM_EVENT_COUNTERS is not set
 # CONFIG_SLUB_DEBUG is not set
 # CONFIG_COMPAT_BRK is not set
index f52c64e36d8df802253ee5688b4ebfe35765662b..2ef2c5e8aaeccd6c55c16d84e59f8635cb19eae7 100644 (file)
@@ -8,7 +8,7 @@ CONFIG_IKCONFIG_PROC=y
 CONFIG_LOG_BUF_SHIFT=14
 CONFIG_SYSFS_DEPRECATED_V2=y
 CONFIG_BLK_DEV_INITRD=y
-CONFIG_EMBEDDED=y
+CONFIG_EXPERT=y
 CONFIG_KALLSYMS_EXTRA_PASS=y
 CONFIG_SLAB=y
 CONFIG_MODULES=y
index 310f9a6270be3085190f9bc200e6f7ac764fc789..6c56ad086c7ca8deed6ffa75aeb86925c8e83150 100644 (file)
@@ -4,7 +4,7 @@ CONFIG_SYSVIPC=y
 CONFIG_LOG_BUF_SHIFT=14
 CONFIG_BLK_DEV_INITRD=y
 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
-CONFIG_EMBEDDED=y
+CONFIG_EXPERT=y
 # CONFIG_BASE_FULL is not set
 # CONFIG_EPOLL is not set
 CONFIG_SLOB=y
index 4a1fa81ed37d55f26d58cf5e2ddb9e84d5337b35..e53c47563845e641c49d3081ec3dfa164c617c54 100644 (file)
@@ -4,7 +4,7 @@ CONFIG_BSD_PROCESS_ACCT=y
 CONFIG_LOG_BUF_SHIFT=14
 CONFIG_SYSFS_DEPRECATED_V2=y
 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
-CONFIG_EMBEDDED=y
+CONFIG_EXPERT=y
 CONFIG_PROFILING=y
 CONFIG_OPROFILE=m
 CONFIG_MODULES=y
index cdc40c4b8c48f6ff9a36b05033d31c28f6339b73..88ccde058ba494c242d113dade5522f8a28d7f9b 100644 (file)
@@ -6,7 +6,7 @@ CONFIG_IKCONFIG=y
 CONFIG_IKCONFIG_PROC=y
 CONFIG_LOG_BUF_SHIFT=14
 CONFIG_BLK_DEV_INITRD=y
-CONFIG_EMBEDDED=y
+CONFIG_EXPERT=y
 CONFIG_MODULES=y
 CONFIG_MODULE_UNLOAD=y
 CONFIG_MODULE_FORCE_UNLOAD=y
index 2519cc5a5f8f6888fd8d067ba782d62914cb56f0..889922ad229c31e8419c7f211cb5ef481e4d612a 100644 (file)
@@ -6,7 +6,7 @@ CONFIG_IKCONFIG=y
 CONFIG_IKCONFIG_PROC=y
 CONFIG_LOG_BUF_SHIFT=14
 CONFIG_BLK_DEV_INITRD=y
-CONFIG_EMBEDDED=y
+CONFIG_EXPERT=y
 CONFIG_MODULES=y
 CONFIG_MODULE_UNLOAD=y
 CONFIG_MODULE_FORCE_UNLOAD=y
index 9359e1bf32c1b760574a3123d7627ae7a4d3073f..54bf5eec80163e97108a79645f00d8d639f25ee5 100644 (file)
@@ -1,7 +1,7 @@
 CONFIG_EXPERIMENTAL=y
 CONFIG_SYSVIPC=y
 CONFIG_LOG_BUF_SHIFT=14
-CONFIG_EMBEDDED=y
+CONFIG_EXPERT=y
 CONFIG_SLAB=y
 CONFIG_MODULES=y
 CONFIG_MODULE_UNLOAD=y
index c3194186920c5409c32a8add1dfd8e748f9231fe..14559dbb4c2c04fb4d0e12bcfeeeee2aaeca614a 100644 (file)
@@ -2,7 +2,7 @@ CONFIG_EXPERIMENTAL=y
 CONFIG_SYSVIPC=y
 CONFIG_BSD_PROCESS_ACCT=y
 CONFIG_LOG_BUF_SHIFT=14
-CONFIG_EMBEDDED=y
+CONFIG_EXPERT=y
 CONFIG_MODULES=y
 CONFIG_ARCH_EBSA110=y
 CONFIG_PCCARD=m
index 7b62be1561ea91d17c5f837826e7636217960e5c..d52ded350a1229fbcc119c9b5547cd327b70e13c 100644 (file)
@@ -2,7 +2,7 @@ CONFIG_EXPERIMENTAL=y
 CONFIG_SYSVIPC=y
 CONFIG_LOG_BUF_SHIFT=14
 CONFIG_BLK_DEV_INITRD=y
-CONFIG_EMBEDDED=y
+CONFIG_EXPERT=y
 # CONFIG_HOTPLUG is not set
 CONFIG_ARCH_CLPS711X=y
 CONFIG_ARCH_EDB7211=y
index d7db34f79702b2cbff980228f3879d47e0717c90..60a21e01eb700512221244e00c70f9481b8432a7 100644 (file)
@@ -6,7 +6,7 @@ CONFIG_IKCONFIG_PROC=y
 CONFIG_LOG_BUF_SHIFT=14
 CONFIG_SYSFS_DEPRECATED_V2=y
 CONFIG_BLK_DEV_INITRD=y
-CONFIG_EMBEDDED=y
+CONFIG_EXPERT=y
 # CONFIG_VM_EVENT_COUNTERS is not set
 # CONFIG_SLUB_DEBUG is not set
 # CONFIG_COMPAT_BRK is not set
index 6d6689cdf398f93fc3701bc9a52c8926482caf8c..8e97b2f7ceec571dbcf494b42cf22d526ecbcef8 100644 (file)
@@ -4,7 +4,7 @@ CONFIG_IKCONFIG=y
 CONFIG_IKCONFIG_PROC=y
 CONFIG_LOG_BUF_SHIFT=14
 CONFIG_SYSFS_DEPRECATED_V2=y
-CONFIG_EMBEDDED=y
+CONFIG_EXPERT=y
 CONFIG_SLAB=y
 CONFIG_MODULES=y
 CONFIG_MODULE_UNLOAD=y
index 1691dea582fea8e3249da868d03cbd8c6ba31e58..d68ac67c201c37db932a810ef9f67dfdbb522d58 100644 (file)
@@ -2,7 +2,7 @@ CONFIG_EXPERIMENTAL=y
 CONFIG_SYSVIPC=y
 CONFIG_LOG_BUF_SHIFT=14
 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
-CONFIG_EMBEDDED=y
+CONFIG_EXPERT=y
 # CONFIG_KALLSYMS is not set
 # CONFIG_COMPAT_BRK is not set
 CONFIG_SLAB=y
index c4eeb6d1cbf03d77eaec269eac6d01f3684ca065..227a477346edb44a2a83ba49a0f9b7cd2b165ec0 100644 (file)
@@ -7,7 +7,7 @@ CONFIG_SYSFS_DEPRECATED_V2=y
 CONFIG_BLK_DEV_INITRD=y
 CONFIG_RD_BZIP2=y
 CONFIG_RD_LZMA=y
-CONFIG_EMBEDDED=y
+CONFIG_EXPERT=y
 # CONFIG_COMPAT_BRK is not set
 CONFIG_SLAB=y
 CONFIG_MODULES=y
index 4f925ead2617d013b8d19da7b0adfe0692bb71fc..038518ab39a84ec7ef98a3c07737bb8350bddde5 100644 (file)
@@ -3,7 +3,7 @@ CONFIG_SYSVIPC=y
 CONFIG_BSD_PROCESS_ACCT=y
 CONFIG_LOG_BUF_SHIFT=14
 CONFIG_BLK_DEV_INITRD=y
-CONFIG_EMBEDDED=y
+CONFIG_EXPERT=y
 # CONFIG_HOTPLUG is not set
 CONFIG_MODULES=y
 CONFIG_ARCH_FOOTBRIDGE=y
index e11c7eab8ed051291aecf67d15beb2e09ad2baf7..840fced7529fbde24511879b08dec957943a2538 100644 (file)
@@ -2,7 +2,7 @@ CONFIG_EXPERIMENTAL=y
 CONFIG_SYSVIPC=y
 CONFIG_LOG_BUF_SHIFT=14
 CONFIG_BLK_DEV_INITRD=y
-CONFIG_EMBEDDED=y
+CONFIG_EXPERT=y
 # CONFIG_HOTPLUG is not set
 CONFIG_ARCH_CLPS711X=y
 CONFIG_ARCH_FORTUNET=y
index ac336f10000c429156c6aed858c38cf880df5a4f..37903e3f0efc9a4c876d0559346ecd71986048d1 100644 (file)
@@ -4,7 +4,7 @@ CONFIG_IKCONFIG=y
 CONFIG_IKCONFIG_PROC=y
 CONFIG_LOG_BUF_SHIFT=16
 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
-CONFIG_EMBEDDED=y
+CONFIG_EXPERT=y
 # CONFIG_UID16 is not set
 CONFIG_SLAB=y
 CONFIG_MODULES=y
index ade55c8c408b6ad7b6d3fb4bc63cf1b52c114e01..176ec22af0342f215b59a2778144d69ef0f4c806 100644 (file)
@@ -6,7 +6,7 @@ CONFIG_SYSFS_DEPRECATED_V2=y
 CONFIG_BLK_DEV_INITRD=y
 CONFIG_RD_BZIP2=y
 CONFIG_RD_LZMA=y
-CONFIG_EMBEDDED=y
+CONFIG_EXPERT=y
 # CONFIG_COMPAT_BRK is not set
 CONFIG_SLAB=y
 CONFIG_MODULES=y
index 9083246845498f4eb318b78b6fda01fe6fb28179..8405aded97a358987135ee179377449ddfcb7690 100644 (file)
@@ -3,7 +3,7 @@ CONFIG_SYSVIPC=y
 CONFIG_BSD_PROCESS_ACCT=y
 CONFIG_LOG_BUF_SHIFT=14
 CONFIG_BLK_DEV_INITRD=y
-CONFIG_EMBEDDED=y
+CONFIG_EXPERT=y
 # CONFIG_HOTPLUG is not set
 CONFIG_SLAB=y
 CONFIG_MODULES=y
index 7fc056a8569cacb53e5f396b5e76a1d634c968d5..688717612e919b9beaf1d828f39aed69729a9ef9 100644 (file)
@@ -3,7 +3,7 @@ CONFIG_SYSVIPC=y
 CONFIG_BSD_PROCESS_ACCT=y
 CONFIG_LOG_BUF_SHIFT=14
 CONFIG_BLK_DEV_INITRD=y
-CONFIG_EMBEDDED=y
+CONFIG_EXPERT=y
 CONFIG_SLAB=y
 CONFIG_MODULES=y
 CONFIG_MODULE_UNLOAD=y
index 5c5023934001a9f01bc66a91fdc2b494128283e2..063e2ab2c8f185f6a153358d9b792e79b7c37f57 100644 (file)
@@ -3,7 +3,7 @@ CONFIG_SYSVIPC=y
 CONFIG_BSD_PROCESS_ACCT=y
 CONFIG_LOG_BUF_SHIFT=14
 CONFIG_BLK_DEV_INITRD=y
-CONFIG_EMBEDDED=y
+CONFIG_EXPERT=y
 CONFIG_MODULES=y
 CONFIG_MODVERSIONS=y
 # CONFIG_BLK_DEV_BSG is not set
index e1eaff7f5536c456b3b840419a7d6768b86068e6..1ba752b2dc6ddbb0a74cf8d9b6267c158122851e 100644 (file)
@@ -1,7 +1,7 @@
 CONFIG_EXPERIMENTAL=y
 CONFIG_SYSVIPC=y
 CONFIG_LOG_BUF_SHIFT=14
-CONFIG_EMBEDDED=y
+CONFIG_EXPERT=y
 CONFIG_SLAB=y
 CONFIG_MODULES=y
 CONFIG_MODULE_UNLOAD=y
index 20caaaba4a047b52f297f599bd316eba49f5fd67..5a48f171204ca7f02bba7676441cdbeac0359a1e 100644 (file)
@@ -3,7 +3,7 @@ CONFIG_EXPERIMENTAL=y
 CONFIG_SYSVIPC=y
 CONFIG_IKCONFIG=y
 CONFIG_LOG_BUF_SHIFT=14
-CONFIG_EMBEDDED=y
+CONFIG_EXPERT=y
 # CONFIG_HOTPLUG is not set
 # CONFIG_EPOLL is not set
 # CONFIG_IOSCHED_DEADLINE is not set
index 1efcce97b4a75207db340256b39a1cd2f4efea52..22d0631de009434dcdde73f6dba719a153dc786e 100644 (file)
@@ -3,7 +3,7 @@ CONFIG_EXPERIMENTAL=y
 CONFIG_SYSVIPC=y
 CONFIG_IKCONFIG=y
 CONFIG_LOG_BUF_SHIFT=16
-CONFIG_EMBEDDED=y
+CONFIG_EXPERT=y
 # CONFIG_HOTPLUG is not set
 # CONFIG_EPOLL is not set
 CONFIG_SLAB=y
index af805e8fd03d4ef049539f20d9764e41f379fd84..a88e64d4e9a5862c28160c9d1b7d3cd01edf0550 100644 (file)
@@ -4,7 +4,7 @@ CONFIG_IKCONFIG=y
 CONFIG_IKCONFIG_PROC=y
 CONFIG_LOG_BUF_SHIFT=16
 CONFIG_BLK_DEV_INITRD=y
-CONFIG_EMBEDDED=y
+CONFIG_EXPERT=y
 # CONFIG_UID16 is not set
 CONFIG_SLAB=y
 CONFIG_MODULES=y
index b0d082422d466ccff64c501fe8c7c1d0f4493bd0..7305ebddb5105454edc11e353db1e6a864a87ed1 100644 (file)
@@ -2,7 +2,7 @@ CONFIG_EXPERIMENTAL=y
 CONFIG_SYSVIPC=y
 CONFIG_LOG_BUF_SHIFT=14
 CONFIG_SYSFS_DEPRECATED_V2=y
-CONFIG_EMBEDDED=y
+CONFIG_EXPERT=y
 CONFIG_KALLSYMS_ALL=y
 # CONFIG_SLUB_DEBUG is not set
 CONFIG_PROFILING=y
index 2f38d97154373497f7dccce11fe6c6f932c93ecd..b39b5ced8a104971164e95d8132b7d6a4780a9f8 100644 (file)
@@ -4,7 +4,7 @@ CONFIG_IKCONFIG=y
 CONFIG_IKCONFIG_PROC=y
 CONFIG_LOG_BUF_SHIFT=14
 CONFIG_SYSFS_DEPRECATED_V2=y
-CONFIG_EMBEDDED=y
+CONFIG_EXPERT=y
 CONFIG_SLAB=y
 CONFIG_MODULES=y
 CONFIG_MODULE_UNLOAD=y
index 6454e18e2abe8c316d3320ebaa262bfc1bd6748c..411f88dd440254293204de7a2023c777f4d11ec9 100644 (file)
@@ -4,7 +4,7 @@ CONFIG_SYSVIPC=y
 CONFIG_LOG_BUF_SHIFT=14
 CONFIG_SYSFS_DEPRECATED_V2=y
 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
-CONFIG_EMBEDDED=y
+CONFIG_EXPERT=y
 CONFIG_KALLSYMS_EXTRA_PASS=y
 CONFIG_SLAB=y
 CONFIG_MODULES=y
index 813cfb366c1830bd3fc5e0df3ff1328931cd921d..9ad4c656c9bdf91bdfaf5492bad7ad5d43407a73 100644 (file)
@@ -4,7 +4,7 @@ CONFIG_SYSVIPC=y
 CONFIG_POSIX_MQUEUE=y
 CONFIG_LOG_BUF_SHIFT=14
 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
-CONFIG_EMBEDDED=y
+CONFIG_EXPERT=y
 CONFIG_KALLSYMS_EXTRA_PASS=y
 # CONFIG_COMPAT_BRK is not set
 CONFIG_SLAB=y
index e648ea3429beb816fd5785cbe23184380efd0ba8..7c4b30b34952ddb058df0621bcd73b940e5574db 100644 (file)
@@ -4,7 +4,7 @@ CONFIG_IKCONFIG=y
 CONFIG_IKCONFIG_PROC=y
 CONFIG_LOG_BUF_SHIFT=14
 CONFIG_SYSFS_DEPRECATED_V2=y
-CONFIG_EMBEDDED=y
+CONFIG_EXPERT=y
 CONFIG_SLAB=y
 CONFIG_MODULES=y
 CONFIG_MODULE_UNLOAD=y
index 5c7a87260fab2cc41751905e25cec040096a5370..9cba68cfa51a0bf93b46ed2faebc01ccaea19262 100644 (file)
@@ -3,7 +3,7 @@ CONFIG_EXPERIMENTAL=y
 CONFIG_SYSVIPC=y
 CONFIG_LOG_BUF_SHIFT=18
 CONFIG_RELAY=y
-CONFIG_EMBEDDED=y
+CONFIG_EXPERT=y
 # CONFIG_SLUB_DEBUG is not set
 # CONFIG_COMPAT_BRK is not set
 CONFIG_MODULES=y
index 0e2dc26ebe66396a0ed0cd93c74c290b30f18fb8..37207d1bf44b664c3a679bf14f906e38f4756bb0 100644 (file)
@@ -7,7 +7,7 @@ CONFIG_IKCONFIG_PROC=y
 CONFIG_LOG_BUF_SHIFT=14
 CONFIG_SYSFS_DEPRECATED_V2=y
 CONFIG_BLK_DEV_INITRD=y
-CONFIG_EMBEDDED=y
+CONFIG_EXPERT=y
 CONFIG_KALLSYMS_ALL=y
 CONFIG_SLAB=y
 CONFIG_MODULES=y
index a350cc6bfe6a657f7247e1b2b5ffb6b3737a1734..7b63462b349d7de9965b13bec7c1c85e57c25fcd 100644 (file)
@@ -6,7 +6,7 @@ CONFIG_BSD_PROCESS_ACCT=y
 CONFIG_IKCONFIG=y
 CONFIG_LOG_BUF_SHIFT=14
 CONFIG_BLK_DEV_INITRD=y
-CONFIG_EMBEDDED=y
+CONFIG_EXPERT=y
 # CONFIG_KALLSYMS is not set
 # CONFIG_ELF_CORE is not set
 # CONFIG_BASE_FULL is not set
index ccedde1371c359095c8fa9a326eb8f6276eb7ccc..ae890caa17a7a1f246d33f90a9d05085d05b02eb 100644 (file)
@@ -6,7 +6,7 @@ CONFIG_IKCONFIG=y
 CONFIG_IKCONFIG_PROC=y
 CONFIG_LOG_BUF_SHIFT=16
 CONFIG_BLK_DEV_INITRD=y
-CONFIG_EMBEDDED=y
+CONFIG_EXPERT=y
 # CONFIG_SYSCTL_SYSCALL is not set
 CONFIG_KALLSYMS_EXTRA_PASS=y
 CONFIG_SLAB=y
index 439323b3b0ed9a3fbf77435044233c3b35b60c15..a288d7033950692f3ca05fee0501b3b091eb676b 100644 (file)
@@ -2,7 +2,7 @@ CONFIG_EXPERIMENTAL=y
 CONFIG_SYSVIPC=y
 CONFIG_LOG_BUF_SHIFT=14
 CONFIG_SYSFS_DEPRECATED_V2=y
-CONFIG_EMBEDDED=y
+CONFIG_EXPERT=y
 # CONFIG_SLUB_DEBUG is not set
 CONFIG_PROFILING=y
 CONFIG_OPROFILE=y
index 583a0610bd0014fcffda1e6314403157cd1883a3..2f136c30a9896031168b027231203ae1dc5d0c3c 100644 (file)
@@ -7,7 +7,7 @@ CONFIG_IKCONFIG=y
 CONFIG_IKCONFIG_PROC=y
 CONFIG_LOG_BUF_SHIFT=14
 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
-CONFIG_EMBEDDED=y
+CONFIG_EXPERT=y
 # CONFIG_KALLSYMS is not set
 CONFIG_SLAB=y
 CONFIG_MODULES=y
index b42ee62c4d77b0ca2667cf127d47ae7f0a54db37..c75c9fcede58fb95d9fcd68cb7220edf39880948 100644 (file)
@@ -10,7 +10,7 @@ CONFIG_IKCONFIG_PROC=y
 CONFIG_LOG_BUF_SHIFT=14
 CONFIG_NAMESPACES=y
 CONFIG_BLK_DEV_INITRD=y
-CONFIG_EMBEDDED=y
+CONFIG_EXPERT=y
 # CONFIG_SYSCTL_SYSCALL is not set
 # CONFIG_KALLSYMS is not set
 # CONFIG_VM_EVENT_COUNTERS is not set
index d1efbdc1e6dc659e72674ad8b32428eb694bf811..cb08cc561da56cc53b8b32b3db4c804e3f808f3f 100644 (file)
@@ -3,7 +3,7 @@ CONFIG_EXPERIMENTAL=y
 CONFIG_SYSVIPC=y
 CONFIG_LOG_BUF_SHIFT=14
 CONFIG_BLK_DEV_INITRD=y
-CONFIG_EMBEDDED=y
+CONFIG_EXPERT=y
 # CONFIG_HOTPLUG is not set
 # CONFIG_SHMEM is not set
 CONFIG_MODULES=y
index bd481f04276f7b18b0d5e5771e98f708ccf9c496..35a31ccacc32ac04c847ae13e9ee6a573e03fc31 100644 (file)
@@ -5,7 +5,7 @@ CONFIG_BSD_PROCESS_ACCT=y
 CONFIG_AUDIT=y
 CONFIG_LOG_BUF_SHIFT=14
 CONFIG_BLK_DEV_INITRD=y
-CONFIG_EMBEDDED=y
+CONFIG_EXPERT=y
 CONFIG_SLAB=y
 CONFIG_MODULES=y
 CONFIG_MODULE_UNLOAD=y
index af3b12e3b464bbe94057edcb19aaabc679b80e5b..d3358155bf8ab2fa77a58e211eed5b7990acfaa9 100644 (file)
@@ -2,7 +2,7 @@ CONFIG_EXPERIMENTAL=y
 CONFIG_LOCALVERSION="oe1"
 CONFIG_SYSVIPC=y
 CONFIG_LOG_BUF_SHIFT=14
-CONFIG_EMBEDDED=y
+CONFIG_EXPERT=y
 CONFIG_KALLSYMS_ALL=y
 CONFIG_KALLSYMS_EXTRA_PASS=y
 CONFIG_MODULES=y
index aebd4bb0ad01549971eac51f85f9c17c437214b0..70158273c6dd617cdf60f0ef3ca9b23f8d2cd253 100644 (file)
@@ -4,7 +4,7 @@ CONFIG_BSD_PROCESS_ACCT=y
 CONFIG_LOG_BUF_SHIFT=14
 CONFIG_SYSFS_DEPRECATED_V2=y
 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
-CONFIG_EMBEDDED=y
+CONFIG_EXPERT=y
 CONFIG_PROFILING=y
 CONFIG_OPROFILE=m
 CONFIG_MODULES=y
index 94a2d904bf9408552118b6238466b158058e9154..1079c2b6eb3aacc3a3655a90c1e8454a8908f25d 100644 (file)
@@ -5,7 +5,7 @@ CONFIG_POSIX_MQUEUE=y
 CONFIG_BSD_PROCESS_ACCT=y
 CONFIG_SYSFS_DEPRECATED_V2=y
 CONFIG_BLK_DEV_INITRD=y
-CONFIG_EMBEDDED=y
+CONFIG_EXPERT=y
 CONFIG_SLAB=y
 CONFIG_MODULES=y
 CONFIG_MODULE_UNLOAD=y
index d8ee58cfa872fe29803fbfbbcd2e9844c4a67e47..564a5cc44085ea14e4a17ee27f51b86f5dc9c28f 100644 (file)
@@ -5,7 +5,7 @@ CONFIG_POSIX_MQUEUE=y
 CONFIG_BSD_PROCESS_ACCT=y
 CONFIG_SYSFS_DEPRECATED_V2=y
 CONFIG_BLK_DEV_INITRD=y
-CONFIG_EMBEDDED=y
+CONFIG_EXPERT=y
 CONFIG_SLAB=y
 CONFIG_MODULES=y
 CONFIG_MODULE_UNLOAD=y
index e89ca19489c240a676157a9a1a55458c1e822f02..95c0f0d63db63977e1e4f64220aad77568ac1865 100644 (file)
@@ -5,7 +5,7 @@ CONFIG_SYSVIPC=y
 CONFIG_LOG_BUF_SHIFT=14
 CONFIG_SYSFS_DEPRECATED_V2=y
 CONFIG_BLK_DEV_INITRD=y
-CONFIG_EMBEDDED=y
+CONFIG_EXPERT=y
 # CONFIG_KALLSYMS is not set
 # CONFIG_BUG is not set
 # CONFIG_ELF_CORE is not set
index 37f48342827c89bf866bd0f89cba47871dff2095..3162173fa75af192a614d0c9c114761c5f66cce2 100644 (file)
@@ -7,7 +7,7 @@ CONFIG_IKCONFIG=y
 CONFIG_IKCONFIG_PROC=y
 CONFIG_LOG_BUF_SHIFT=14
 CONFIG_BLK_DEV_INITRD=y
-CONFIG_EMBEDDED=y
+CONFIG_EXPERT=y
 CONFIG_KALLSYMS_EXTRA_PASS=y
 CONFIG_SLAB=y
 CONFIG_MODULES=y
index c1c252cdca60702334e1f6e0abae37836c5b7462..4a5a12681be2038c908318ffc953c3ad7a9bd431 100644 (file)
@@ -3,7 +3,7 @@ CONFIG_EXPERIMENTAL=y
 # CONFIG_SWAP is not set
 CONFIG_SYSVIPC=y
 CONFIG_LOG_BUF_SHIFT=14
-CONFIG_EMBEDDED=y
+CONFIG_EXPERT=y
 # CONFIG_AIO is not set
 # CONFIG_VM_EVENT_COUNTERS is not set
 CONFIG_MODULES=y
index 9d7bf5e0d0f5b19d7505700db58ceb5169ae370d..8b0c717378faa6c9596b9c4b22a4d9dea1b9da65 100644 (file)
@@ -3,7 +3,7 @@ CONFIG_EXPERIMENTAL=y
 CONFIG_SYSVIPC=y
 CONFIG_LOG_BUF_SHIFT=13
 CONFIG_SYSFS_DEPRECATED_V2=y
-CONFIG_EMBEDDED=y
+CONFIG_EXPERT=y
 # CONFIG_ELF_CORE is not set
 # CONFIG_SHMEM is not set
 CONFIG_SLAB=y
index 70d47dbae6db44f299879771a69729a63928aedd..5b5504143647fe23fafb93e0a7df67b9b5b7f8c3 100644 (file)
@@ -8,7 +8,7 @@ CONFIG_IKCONFIG_PROC=y
 CONFIG_LOG_BUF_SHIFT=16
 CONFIG_SYSFS_DEPRECATED_V2=y
 CONFIG_BLK_DEV_INITRD=y
-CONFIG_EMBEDDED=y
+CONFIG_EXPERT=y
 # CONFIG_UID16 is not set
 # CONFIG_SHMEM is not set
 # CONFIG_VM_EVENT_COUNTERS is not set
index 2e8391307f55542fe75dccdb618c444a67df4d8b..6dde8185205f946b11a16cd4ee248e69c3256d69 100644 (file)
@@ -43,7 +43,7 @@ static const unsigned        qsd8x50_surf_smc91x_gpio __initdata = 156;
  * at run-time: they vary from board to board, and the true
  * configuration won't be known until boot.
  */
-static struct resource smc91x_resources[] __initdata = {
+static struct resource smc91x_resources[] = {
        [0] = {
                .flags = IORESOURCE_MEM,
        },
@@ -52,7 +52,7 @@ static struct resource smc91x_resources[] __initdata = {
        },
 };
 
-static struct platform_device smc91x_device __initdata = {
+static struct platform_device smc91x_device = {
        .name           = "smc91x",
        .id             = 0,
        .num_resources  = ARRAY_SIZE(smc91x_resources),
index e69f137b0a39394ade5945730c91da63eaf86bb3..eaf6b9c489ff2f637de8d04b33fea4514b2d42e4 100644 (file)
@@ -68,6 +68,7 @@ static struct s3c2410_uartcfg smdk6442_uartcfgs[] __initdata = {
 
 static struct platform_device *smdk6442_devices[] __initdata = {
        &s3c_device_i2c0,
+       &samsung_asoc_dma,
        &s5p6442_device_iis0,
        &s3c_device_wdt,
 };
index e9802755daebf6143b8054a4ecc559f789875dc1..e5beb84e2393b94a9a7c57ff9ea7c193eccb3a46 100644 (file)
@@ -95,6 +95,7 @@ static struct platform_device *smdk6440_devices[] __initdata = {
        &s3c_device_i2c1,
        &s3c_device_ts,
        &s3c_device_wdt,
+       &samsung_asoc_dma,
        &s5p6440_device_iis,
 };
 
index b78f56292780b3b25c9ad2ac2aa48c84a4d3feca..3a20de0a9264c16b5509eb4d9861592c4c07e405 100644 (file)
@@ -113,6 +113,7 @@ static struct platform_device *smdk6450_devices[] __initdata = {
        &s3c_device_i2c1,
        &s3c_device_ts,
        &s3c_device_wdt,
+       &samsung_asoc_dma,
        &s5p6450_device_iis0,
        /* s5p6450_device_spi0 will be added */
 };
index bb20a14da100c132e6646dbae2f4ecaff3176441..ce11a02eabf3faaac102f6135899e4477ccc2e06 100644 (file)
@@ -81,6 +81,7 @@ static struct s3c_ide_platdata smdkc110_ide_pdata __initdata = {
 };
 
 static struct platform_device *smdkc110_devices[] __initdata = {
+       &samsung_asoc_dma,
        &s5pv210_device_iis0,
        &s5pv210_device_ac97,
        &s5pv210_device_spdif,
index 88e45223c8af6bb338e5fb864fb9cfca90142bf8..bc9fdb52a020c9f09c45bf30fc9baaf9ead5a54a 100644 (file)
@@ -225,6 +225,7 @@ static struct platform_device *smdkv210_devices[] __initdata = {
        &s5pv210_device_ac97,
        &s5pv210_device_iis0,
        &s5pv210_device_spdif,
+       &samsung_asoc_dma,
        &samsung_device_keypad,
        &smdkv210_dm9000,
        &smdkv210_lcd_lte480wv,
index 2d49273c0a26a1efd3bd5eaa6377cb77a6afc276..d9cab02e23ca8b70d468e0f684ba93db4573d38a 100644 (file)
@@ -163,8 +163,9 @@ static struct platform_device *smdkc210_devices[] __initdata = {
        &s5pv310_device_pd[PD_CAM],
        &s5pv310_device_pd[PD_TV],
        &s5pv310_device_pd[PD_GPS],
-       &smdkc210_smsc911x,
        &s5pv310_device_sysmmu,
+       &samsung_asoc_dma,
+       &smdkc210_smsc911x,
 };
 
 static void __init smdkc210_smsc911x_init(void)
index 28680cf9a72c1ea3c67ee422d253a4b39eb4ec71..b1cddbf3c6168224aca6f8d9c16af90019136617 100644 (file)
@@ -163,8 +163,9 @@ static struct platform_device *smdkv310_devices[] __initdata = {
        &s5pv310_device_pd[PD_CAM],
        &s5pv310_device_pd[PD_TV],
        &s5pv310_device_pd[PD_GPS],
-       &smdkv310_smsc911x,
        &s5pv310_device_sysmmu,
+       &samsung_asoc_dma,
+       &smdkv310_smsc911x,
 };
 
 static void __init smdkv310_smsc911x_init(void)
index 313b13073c540f7a5b22363dd71038ea1245da58..cd2062fe0f611e54fdb6e5528b6af24e13d3b509 100644 (file)
@@ -1,8 +1,8 @@
 config AVR32
        def_bool y
-       # With EMBEDDED=n, we get lots of stuff automatically selected
+       # With EXPERT=n, we get lots of stuff automatically selected
        # that we usually don't need on AVR32.
-       select EMBEDDED
+       select EXPERT
        select HAVE_CLK
        select HAVE_OPROFILE
        select HAVE_KPROBES
index 0a221d48152dd6f116cb8938770d5fd0e5639968..c09577ddc3c5b1ee9c93fd07ccf160e9b6ceae33 100644 (file)
@@ -30,6 +30,9 @@ config BLACKFIN
        select HAVE_KERNEL_LZO if RAMKERNEL
        select HAVE_OPROFILE
        select ARCH_WANT_OPTIONAL_GPIOLIB
+       select HAVE_GENERIC_HARDIRQS
+       select GENERIC_IRQ_PROBE
+       select IRQ_PER_CPU if SMP
 
 config GENERIC_CSUM
        def_bool y
@@ -44,15 +47,6 @@ config ZONE_DMA
 config GENERIC_FIND_NEXT_BIT
        def_bool y
 
-config GENERIC_HARDIRQS
-       def_bool y
-
-config GENERIC_IRQ_PROBE
-       def_bool y
-
-config GENERIC_HARDIRQS_NO__DO_IRQ
-       def_bool y
-
 config GENERIC_GPIO
        def_bool y
 
@@ -254,11 +248,6 @@ config HOTPLUG_CPU
        depends on SMP && HOTPLUG
        default y
 
-config IRQ_PER_CPU
-       bool
-       depends on SMP
-       default y
-
 config HAVE_LEGACY_PER_CPU_AREA
        def_bool y
        depends on SMP
index c0b988ee30df44a33127a3cd33bf8204f237bf9d..db8d38a12a9aeb79522ddbbb819514ec0b6c97f0 100644 (file)
@@ -5,7 +5,7 @@ CONFIG_IKCONFIG_PROC=y
 CONFIG_LOG_BUF_SHIFT=14
 CONFIG_BLK_DEV_INITRD=y
 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
-CONFIG_EMBEDDED=y
+CONFIG_EXPERT=y
 # CONFIG_SYSCTL_SYSCALL is not set
 # CONFIG_ELF_CORE is not set
 # CONFIG_FUTEX is not set
index 864af5b68874387e088b612a86a3121351ded238..3e50d7857c2725bc05dcffaa0ffcab3212b9e10d 100644 (file)
@@ -5,7 +5,7 @@ CONFIG_IKCONFIG_PROC=y
 CONFIG_LOG_BUF_SHIFT=14
 CONFIG_BLK_DEV_INITRD=y
 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
-CONFIG_EMBEDDED=y
+CONFIG_EXPERT=y
 # CONFIG_SYSCTL_SYSCALL is not set
 # CONFIG_ELF_CORE is not set
 # CONFIG_FUTEX is not set
index 7b6a3370dbe23d573eb6080d3e815fb21530e747..362f59dd522860ad5085a16e25a4484999c1fbe0 100644 (file)
@@ -5,7 +5,7 @@ CONFIG_IKCONFIG_PROC=y
 CONFIG_LOG_BUF_SHIFT=14
 CONFIG_BLK_DEV_INITRD=y
 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
-CONFIG_EMBEDDED=y
+CONFIG_EXPERT=y
 # CONFIG_ELF_CORE is not set
 # CONFIG_AIO is not set
 CONFIG_SLAB=y
index 4faa6b46a352d665a266f57f83d1fb226fa7e83f..023ff0df2692c2d2146908fe9d1ce391b83141c8 100644 (file)
@@ -5,7 +5,7 @@ CONFIG_IKCONFIG_PROC=y
 CONFIG_LOG_BUF_SHIFT=14
 CONFIG_BLK_DEV_INITRD=y
 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
-CONFIG_EMBEDDED=y
+CONFIG_EXPERT=y
 # CONFIG_SYSCTL_SYSCALL is not set
 # CONFIG_ELF_CORE is not set
 # CONFIG_FUTEX is not set
index 9d893eb68243d28cad56767b8e6733efd35a69fa..4e5a121b3c563b9a9b42479c6164614e9e67bd3f 100644 (file)
@@ -5,7 +5,7 @@ CONFIG_IKCONFIG_PROC=y
 CONFIG_LOG_BUF_SHIFT=14
 CONFIG_BLK_DEV_INITRD=y
 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
-CONFIG_EMBEDDED=y
+CONFIG_EXPERT=y
 # CONFIG_SYSCTL_SYSCALL is not set
 # CONFIG_ELF_CORE is not set
 # CONFIG_FUTEX is not set
index 97a2767c80f8ea8239eb987409133b9e345ba97f..cd0636bb24a0904d0d0ddcc3da12752f3830f8e9 100644 (file)
@@ -6,7 +6,7 @@ CONFIG_IKCONFIG_PROC=y
 CONFIG_LOG_BUF_SHIFT=14
 CONFIG_BLK_DEV_INITRD=y
 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
-CONFIG_EMBEDDED=y
+CONFIG_EXPERT=y
 # CONFIG_SYSCTL_SYSCALL is not set
 # CONFIG_ELF_CORE is not set
 # CONFIG_FUTEX is not set
index f84774360c5bb17316a99365930eaf0df275a0c0..9f8fc84e4ac949be9b8c3b1105626bb5d8b5b3c6 100644 (file)
@@ -5,7 +5,7 @@ CONFIG_IKCONFIG_PROC=y
 CONFIG_LOG_BUF_SHIFT=14
 CONFIG_BLK_DEV_INITRD=y
 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
-CONFIG_EMBEDDED=y
+CONFIG_EXPERT=y
 # CONFIG_SYSCTL_SYSCALL is not set
 # CONFIG_ELF_CORE is not set
 # CONFIG_FUTEX is not set
index 0e7262c04cc2fe5ccf567d92826239d6304b1949..ccc432b722a0746681945133699484ec89b31615 100644 (file)
@@ -5,7 +5,7 @@ CONFIG_IKCONFIG_PROC=y
 CONFIG_LOG_BUF_SHIFT=14
 CONFIG_BLK_DEV_INITRD=y
 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
-CONFIG_EMBEDDED=y
+CONFIG_EXPERT=y
 # CONFIG_SYSCTL_SYSCALL is not set
 # CONFIG_ELF_CORE is not set
 # CONFIG_FUTEX is not set
index 4d14a002e7bd721d146ee0e18a5a94733b317a2b..566695472a8486148ca1d230aa59567a770a6ba6 100644 (file)
@@ -5,7 +5,7 @@ CONFIG_IKCONFIG_PROC=y
 CONFIG_LOG_BUF_SHIFT=14
 CONFIG_BLK_DEV_INITRD=y
 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
-CONFIG_EMBEDDED=y
+CONFIG_EXPERT=y
 # CONFIG_SYSCTL_SYSCALL is not set
 # CONFIG_ELF_CORE is not set
 # CONFIG_FUTEX is not set
index fbee9d776f564b46aaca9ccb2337afca07b18c19..ac22124ccb6cc0515c9ac31317f32f25e04e6e90 100644 (file)
@@ -5,7 +5,7 @@ CONFIG_IKCONFIG_PROC=y
 CONFIG_LOG_BUF_SHIFT=14
 CONFIG_BLK_DEV_INITRD=y
 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
-CONFIG_EMBEDDED=y
+CONFIG_EXPERT=y
 # CONFIG_SYSCTL_SYSCALL is not set
 # CONFIG_ELF_CORE is not set
 # CONFIG_FUTEX is not set
index 05dd11db2f7d6b4809db3198b3d033833fbff992..944404b6ff08ad723cce862bb22815be4bb1b555 100644 (file)
@@ -5,7 +5,7 @@ CONFIG_IKCONFIG_PROC=y
 CONFIG_LOG_BUF_SHIFT=14
 CONFIG_BLK_DEV_INITRD=y
 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
-CONFIG_EMBEDDED=y
+CONFIG_EXPERT=y
 # CONFIG_SYSCTL_SYSCALL is not set
 # CONFIG_ELF_CORE is not set
 # CONFIG_FUTEX is not set
index bcb14d1c56647639bca47adff02bce380c341038..b7c8451f26ac31e8d53813f840db601753dfff1f 100644 (file)
@@ -5,7 +5,7 @@ CONFIG_IKCONFIG_PROC=y
 CONFIG_LOG_BUF_SHIFT=14
 CONFIG_SYSFS_DEPRECATED_V2=y
 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
-CONFIG_EMBEDDED=y
+CONFIG_EXPERT=y
 # CONFIG_SYSCTL_SYSCALL is not set
 # CONFIG_ELF_CORE is not set
 # CONFIG_FUTEX is not set
index 4cf451024fd80eef5bef770e6f7b0c43c24eb79e..7e67ba31e9919655eb833e259ed970bd707b3e81 100644 (file)
@@ -5,7 +5,7 @@ CONFIG_IKCONFIG_PROC=y
 CONFIG_LOG_BUF_SHIFT=14
 CONFIG_BLK_DEV_INITRD=y
 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
-CONFIG_EMBEDDED=y
+CONFIG_EXPERT=y
 # CONFIG_SYSCTL_SYSCALL is not set
 # CONFIG_ELF_CORE is not set
 # CONFIG_FUTEX is not set
index 843aaa54a9e3c241a510d3934575ac180a5a8e84..141e5933e1aaf7f2be33a4617f43e7257288320e 100644 (file)
@@ -5,7 +5,7 @@ CONFIG_IKCONFIG_PROC=y
 CONFIG_LOG_BUF_SHIFT=14
 CONFIG_BLK_DEV_INITRD=y
 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
-CONFIG_EMBEDDED=y
+CONFIG_EXPERT=y
 # CONFIG_SYSCTL_SYSCALL is not set
 # CONFIG_ELF_CORE is not set
 # CONFIG_FUTEX is not set
index dae7adf3b2a2ae731d003e0a049eacbc7cd61af4..97ebe09a7370eb3c58ea3ed1b721d7168563d1a4 100644 (file)
@@ -6,7 +6,7 @@ CONFIG_LOG_BUF_SHIFT=14
 CONFIG_SYSFS_DEPRECATED_V2=y
 CONFIG_BLK_DEV_INITRD=y
 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
-CONFIG_EMBEDDED=y
+CONFIG_EXPERT=y
 # CONFIG_SYSCTL_SYSCALL is not set
 # CONFIG_ELF_CORE is not set
 # CONFIG_FUTEX is not set
index f3414244bfed479a6ef5a000bedaeae42d60a1ab..c2457543e58c69fb6dc17ae093ac0e6e291aecc9 100644 (file)
@@ -8,7 +8,7 @@ CONFIG_BLK_DEV_INITRD=y
 # CONFIG_RD_GZIP is not set
 CONFIG_RD_LZMA=y
 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
-CONFIG_EMBEDDED=y
+CONFIG_EXPERT=y
 # CONFIG_SYSCTL_SYSCALL is not set
 # CONFIG_ELF_CORE is not set
 # CONFIG_FUTEX is not set
index 8c7e08f173d446084a28d1084193f772d5d873ee..baf1c1573e5ee4a9f51bf1af88399e22739e9dd4 100644 (file)
@@ -7,7 +7,7 @@ CONFIG_LOG_BUF_SHIFT=14
 CONFIG_BLK_DEV_INITRD=y
 # CONFIG_RD_GZIP is not set
 CONFIG_RD_LZMA=y
-CONFIG_EMBEDDED=y
+CONFIG_EXPERT=y
 # CONFIG_UID16 is not set
 # CONFIG_SYSCTL_SYSCALL is not set
 # CONFIG_ELF_CORE is not set
index bd3cb766d07803e0ebd6b0af2c2c26d7459c8b48..707cbf8a25903b008b306616405255f5100c8f26 100644 (file)
@@ -8,7 +8,7 @@ CONFIG_BLK_DEV_INITRD=y
 # CONFIG_RD_GZIP is not set
 CONFIG_RD_LZMA=y
 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
-CONFIG_EMBEDDED=y
+CONFIG_EXPERT=y
 # CONFIG_UID16 is not set
 # CONFIG_SYSCTL_SYSCALL is not set
 # CONFIG_ELF_CORE is not set
index 82224f37c04e4d49a5ee4728b58b4ef505681a3f..4596935eadacc3e1f420a68188ea74cd1f17e8f3 100644 (file)
@@ -8,7 +8,7 @@ CONFIG_BLK_DEV_INITRD=y
 # CONFIG_RD_GZIP is not set
 CONFIG_RD_LZMA=y
 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
-CONFIG_EMBEDDED=y
+CONFIG_EXPERT=y
 # CONFIG_UID16 is not set
 # CONFIG_SYSCTL_SYSCALL is not set
 # CONFIG_ELF_CORE is not set
index 433598c6e7736d7b7ede1eaf19dd4c768238c987..df267588efec99e8a9394b658c1f5a8e01435287 100644 (file)
@@ -8,7 +8,7 @@ CONFIG_BLK_DEV_INITRD=y
 # CONFIG_RD_GZIP is not set
 CONFIG_RD_LZMA=y
 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
-CONFIG_EMBEDDED=y
+CONFIG_EXPERT=y
 # CONFIG_UID16 is not set
 # CONFIG_SYSCTL_SYSCALL is not set
 # CONFIG_ELF_CORE is not set
index ded7d845cb399aa3bd1feaff7119c960497a4ba3..6c7b21585a43d33032b43ee9421186245122d5df 100644 (file)
@@ -8,7 +8,7 @@ CONFIG_BLK_DEV_INITRD=y
 # CONFIG_RD_GZIP is not set
 CONFIG_RD_LZMA=y
 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
-CONFIG_EMBEDDED=y
+CONFIG_EXPERT=y
 # CONFIG_UID16 is not set
 # CONFIG_SYSCTL_SYSCALL is not set
 # CONFIG_ELF_CORE is not set
index 0ebc7d9aa426a75d14d0ab96fa950ce5a79e2b77..f50313657f3ebda037d9e92648f9cd65f7e4066a 100644 (file)
@@ -5,7 +5,7 @@ CONFIG_IKCONFIG=y
 CONFIG_IKCONFIG_PROC=y
 CONFIG_LOG_BUF_SHIFT=14
 CONFIG_BLK_DEV_INITRD=y
-CONFIG_EMBEDDED=y
+CONFIG_EXPERT=y
 CONFIG_SLOB=y
 # CONFIG_BLK_DEV_BSG is not set
 # CONFIG_IOSCHED_CFQ is not set
index 700fb701c121affa69c937ae5376df45ff60808e..7450127b6455fef2dc6073aab34b069e482960be 100644 (file)
@@ -2,7 +2,7 @@ CONFIG_EXPERIMENTAL=y
 CONFIG_SYSVIPC=y
 CONFIG_LOG_BUF_SHIFT=14
 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
-CONFIG_EMBEDDED=y
+CONFIG_EXPERT=y
 # CONFIG_SYSCTL_SYSCALL is not set
 # CONFIG_ELF_CORE is not set
 # CONFIG_FUTEX is not set
index b40156d217e376ff5a1584a6f36f0fef9f3f6373..5e797cf72043f757be28f019a62a1ed669688e9f 100644 (file)
@@ -3,7 +3,7 @@ CONFIG_SYSVIPC=y
 CONFIG_LOG_BUF_SHIFT=14
 CONFIG_BLK_DEV_INITRD=y
 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
-CONFIG_EMBEDDED=y
+CONFIG_EXPERT=y
 # CONFIG_SYSCTL_SYSCALL is not set
 # CONFIG_HOTPLUG is not set
 # CONFIG_ELF_CORE is not set
index be866d95ed760a3054de1de9889566e69fd2a442..a566a2fe6b9b7478176629d37a9786dc5b2547ab 100644 (file)
@@ -2,7 +2,7 @@ CONFIG_EXPERIMENTAL=y
 CONFIG_SYSVIPC=y
 CONFIG_LOG_BUF_SHIFT=14
 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
-CONFIG_EMBEDDED=y
+CONFIG_EXPERT=y
 # CONFIG_SYSCTL_SYSCALL is not set
 # CONFIG_ELF_CORE is not set
 # CONFIG_FUTEX is not set
index b64bdf759b82c19fdb5fdcebde86b836d3377d2f..853809510ee9059ae739dd116c95aa0f6d52ecc6 100644 (file)
@@ -3,7 +3,7 @@ CONFIG_SYSVIPC=y
 CONFIG_LOG_BUF_SHIFT=14
 CONFIG_BLK_DEV_INITRD=y
 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
-CONFIG_EMBEDDED=y
+CONFIG_EXPERT=y
 # CONFIG_SYSCTL_SYSCALL is not set
 CONFIG_KALLSYMS_ALL=y
 # CONFIG_ELF_CORE is not set
index 1bccd9a50986e2f359d1151e673df809194b6794..d496ae9a39b0c9f1f2c0339e124fc52f4721b2d5 100644 (file)
@@ -7,7 +7,7 @@ CONFIG_LOG_BUF_SHIFT=14
 CONFIG_BLK_DEV_INITRD=y
 # CONFIG_RD_GZIP is not set
 CONFIG_RD_LZMA=y
-CONFIG_EMBEDDED=y
+CONFIG_EXPERT=y
 # CONFIG_SYSCTL_SYSCALL is not set
 # CONFIG_ELF_CORE is not set
 # CONFIG_FUTEX is not set
index 00ce899e9e5d367b947164dc91e3c2815051a116..65f642167a50351bf95fa68e4481465ebf76efc2 100644 (file)
@@ -8,7 +8,7 @@ CONFIG_BLK_DEV_INITRD=y
 # CONFIG_RD_GZIP is not set
 CONFIG_RD_LZMA=y
 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
-CONFIG_EMBEDDED=y
+CONFIG_EXPERT=y
 # CONFIG_UID16 is not set
 # CONFIG_SYSCTL_SYSCALL is not set
 # CONFIG_ELF_CORE is not set
index 613e62831c554e76e6e0c3bf852b6e4cba3d63bd..0a7a4c11d8b166e362cdd22ed0798d7c3bd2539f 100644 (file)
@@ -54,6 +54,8 @@ config CRIS
        bool
        default y
        select HAVE_IDE
+       select HAVE_GENERIC_HARDIRQS
+       select GENERIC_HARDIRQS_NO_DEPRECATED
 
 config HZ
        int
@@ -67,10 +69,6 @@ menu "General setup"
 
 source "fs/Kconfig.binfmt"
 
-config GENERIC_HARDIRQS
-       bool
-       default y
-
 config ETRAX_CMDLINE
        string "Kernel command line"
        default "root=/dev/mtdblock3"
index a0c0df8be9c8d966f34b026a078b4f150b6c4139..7328a7cf7449b5c17f453472e828e01b101f408e 100644 (file)
@@ -104,43 +104,21 @@ static void (*interrupt[NR_IRQS])(void) = {
        IRQ31_interrupt
 };
 
-static void enable_crisv10_irq(unsigned int irq);
-
-static unsigned int startup_crisv10_irq(unsigned int irq)
-{
-       enable_crisv10_irq(irq);
-       return 0;
-}
-
-#define shutdown_crisv10_irq   disable_crisv10_irq
-
-static void enable_crisv10_irq(unsigned int irq)
-{
-       crisv10_unmask_irq(irq);
-}
-
-static void disable_crisv10_irq(unsigned int irq)
-{
-       crisv10_mask_irq(irq);
-}
-
-static void ack_crisv10_irq(unsigned int irq)
+static void enable_crisv10_irq(struct irq_data *data)
 {
+       crisv10_unmask_irq(data->irq);
 }
 
-static void end_crisv10_irq(unsigned int irq)
+static void disable_crisv10_irq(struct irq_data *data)
 {
+       crisv10_mask_irq(data->irq);
 }
 
 static struct irq_chip crisv10_irq_type = {
-       .name =        "CRISv10",
-       .startup =     startup_crisv10_irq,
-       .shutdown =    shutdown_crisv10_irq,
-       .enable =      enable_crisv10_irq,
-       .disable =     disable_crisv10_irq,
-       .ack =         ack_crisv10_irq,
-       .end =         end_crisv10_irq,
-       .set_affinity = NULL
+       .name           = "CRISv10",
+       .irq_shutdown   = disable_crisv10_irq,
+       .irq_enable     = enable_crisv10_irq,
+       .irq_disable    = disable_crisv10_irq,
 };
 
 void weird_irq(void);
@@ -221,7 +199,8 @@ init_IRQ(void)
 
        /* Initialize IRQ handler descriptors. */
        for(i = 2; i < NR_IRQS; i++) {
-               irq_desc[i].chip = &crisv10_irq_type;
+               set_irq_desc_and_handler(i, &crisv10_irq_type,
+                                        handle_simple_irq);
                set_int_vector(i, interrupt[i]);
        }
 
index 2ed48ae3d313cb71e086c02fb0b45f5362b9e685..0ad9db5126c7a4b6c29254e78a915012090a7bf5 100644 (file)
@@ -291,54 +291,33 @@ void crisv32_unmask_irq(int irq)
 }
 
 
-static unsigned int startup_crisv32_irq(unsigned int irq)
+static void enable_crisv32_irq(struct irq_data *data)
 {
-       crisv32_unmask_irq(irq);
-       return 0;
-}
-
-static void shutdown_crisv32_irq(unsigned int irq)
-{
-       crisv32_mask_irq(irq);
+       crisv32_unmask_irq(data->irq);
 }
 
-static void enable_crisv32_irq(unsigned int irq)
+static void disable_crisv32_irq(struct irq_data *data)
 {
-       crisv32_unmask_irq(irq);
+       crisv32_mask_irq(data->irq);
 }
 
-static void disable_crisv32_irq(unsigned int irq)
-{
-       crisv32_mask_irq(irq);
-}
-
-static void ack_crisv32_irq(unsigned int irq)
-{
-}
-
-static void end_crisv32_irq(unsigned int irq)
-{
-}
-
-int set_affinity_crisv32_irq(unsigned int irq, const struct cpumask *dest)
+static int set_affinity_crisv32_irq(struct irq_data *data,
+                                   const struct cpumask *dest, bool force)
 {
        unsigned long flags;
+
        spin_lock_irqsave(&irq_lock, flags);
-       irq_allocations[irq - FIRST_IRQ].mask = *dest;
+       irq_allocations[data->irq - FIRST_IRQ].mask = *dest;
        spin_unlock_irqrestore(&irq_lock, flags);
-
        return 0;
 }
 
 static struct irq_chip crisv32_irq_type = {
-       .name =        "CRISv32",
-       .startup =     startup_crisv32_irq,
-       .shutdown =    shutdown_crisv32_irq,
-       .enable =      enable_crisv32_irq,
-       .disable =     disable_crisv32_irq,
-       .ack =         ack_crisv32_irq,
-       .end =         end_crisv32_irq,
-       .set_affinity = set_affinity_crisv32_irq
+       .name                   = "CRISv32",
+       .irq_shutdown           = disable_crisv32_irq,
+       .irq_enable             = enable_crisv32_irq,
+       .irq_disable            = disable_crisv32_irq,
+       .irq_set_affinity       = set_affinity_crisv32_irq,
 };
 
 void
@@ -472,7 +451,8 @@ init_IRQ(void)
 
        /* Point all IRQ's to bad handlers. */
        for (i = FIRST_IRQ, j = 0; j < NR_IRQS; i++, j++) {
-               irq_desc[j].chip = &crisv32_irq_type;
+               set_irq_chip_and_handler(j, &crisv32_irq_type,
+                                        handle_simple_irq);
                set_exception_vector(i, interrupt[j]);
        }
 
index 590f72c9455dd33a3bbd9bca6b031115bed3ae47..71854d41c5a0238b16c9c6ff20c9953534ecc7c1 100644 (file)
@@ -2,7 +2,7 @@ CONFIG_EXPERIMENTAL=y
 # CONFIG_SWAP is not set
 CONFIG_LOG_BUF_SHIFT=14
 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
-CONFIG_EMBEDDED=y
+CONFIG_EXPERT=y
 # CONFIG_KALLSYMS is not set
 # CONFIG_HOTPLUG is not set
 # CONFIG_BLK_DEV_BSG is not set
index 1b2853e39801f0719b8e6aaa30733bfec43c38cb..a85aabf92be59a4e7ce15b1d1cc4c680270e6d36 100644 (file)
@@ -2,7 +2,7 @@ CONFIG_EXPERIMENTAL=y
 # CONFIG_SWAP is not set
 CONFIG_LOG_BUF_SHIFT=14
 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
-CONFIG_EMBEDDED=y
+CONFIG_EXPERT=y
 # CONFIG_KALLSYMS is not set
 # CONFIG_HOTPLUG is not set
 # CONFIG_BLK_DEV_BSG is not set
index f73d38cc9c6632f2b85ae31af863b6fee7d6275e..87c7227fecb2d622001d5cbdb7509a8881ae8796 100644 (file)
@@ -2,7 +2,7 @@ CONFIG_EXPERIMENTAL=y
 # CONFIG_SWAP is not set
 CONFIG_LOG_BUF_SHIFT=14
 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
-CONFIG_EMBEDDED=y
+CONFIG_EXPERT=y
 # CONFIG_KALLSYMS is not set
 # CONFIG_HOTPLUG is not set
 # CONFIG_BLK_DEV_BSG is not set
index 469f7f9d62e0805122105648e3e9b8aaef5c66c4..c346952f06dcdb4b8534a8766fab03294549e2fa 100644 (file)
@@ -62,7 +62,7 @@ int show_interrupts(struct seq_file *p, void *v)
                for_each_online_cpu(j)
                        seq_printf(p, "%10u ", kstat_irqs_cpu(i, j));
 #endif
-               seq_printf(p, " %14s", irq_desc[i].chip->name);
+               seq_printf(p, " %14s", irq_desc[i].irq_data.chip->name);
                seq_printf(p, "  %s", action->name);
 
                for (action=action->next; action; action = action->next)
@@ -93,8 +93,8 @@ asmlinkage void do_IRQ(int irq, struct pt_regs * regs)
                printk("do_IRQ: stack overflow: %lX\n", sp);
                show_stack(NULL, (unsigned long *)sp);
        }
-       __do_IRQ(irq);
-        irq_exit();
+       generic_handle_irq(irq);
+       irq_exit();
        set_irq_regs(old_regs);
 }
 
index f6bcb039cd6d623526f8736c2cd69ad2fce93c3e..747499a1b31ef709fb42bed7f0c0acca23a07a74 100644 (file)
@@ -5,6 +5,7 @@ config FRV
        select HAVE_ARCH_TRACEHOOK
        select HAVE_IRQ_WORK
        select HAVE_PERF_EVENTS
+       select HAVE_GENERIC_HARDIRQS
 
 config ZONE_DMA
        bool
@@ -29,14 +30,6 @@ config GENERIC_CALIBRATE_DELAY
        bool
        default n
 
-config GENERIC_HARDIRQS
-       bool
-       default y
-
-config GENERIC_HARDIRQS_NO__DO_IRQ
-       bool
-       default y
-
 config TIME_LOW_RES
        bool
        default y
index b8ebe9e8a4936473ed47df2d22232f3473e0823a..b1b792610fdf49b9b5dd0ef2aeb60c060ba0d7a4 100644 (file)
@@ -3,7 +3,7 @@ CONFIG_SYSVIPC=y
 CONFIG_POSIX_MQUEUE=y
 CONFIG_LOG_BUF_SHIFT=14
 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
-CONFIG_EMBEDDED=y
+CONFIG_EXPERT=y
 # CONFIG_HOTPLUG is not set
 CONFIG_MMU=y
 CONFIG_FRV_OUTOFLINE_ATOMIC_OPS=y
index 65f897d8c1e97b428f572bd4d777f3f0d9ea7aa0..6df692d1475f7ffb2549ab62929374a2daafcb54 100644 (file)
@@ -2,6 +2,8 @@ config H8300
        bool
        default y
        select HAVE_IDE
+       select HAVE_GENERIC_HARDIRQS
+       select GENERIC_HARDIRQS_NO_DEPRECATED
 
 config SYMBOL_PREFIX
        string
@@ -47,10 +49,6 @@ config GENERIC_HWEIGHT
        bool
        default y
 
-config GENERIC_HARDIRQS
-       bool
-       default y
-
 config GENERIC_CALIBRATE_DELAY
        bool
        default y
index 342f77765f02f00ec7a71fb570ebef3874cea6d8..042425a026452c31f455755f074dd3bac833d196 100644 (file)
@@ -1,7 +1,7 @@
 CONFIG_EXPERIMENTAL=y
 # CONFIG_LOCALVERSION_AUTO is not set
 CONFIG_LOG_BUF_SHIFT=14
-CONFIG_EMBEDDED=y
+CONFIG_EXPERT=y
 # CONFIG_UID16 is not set
 # CONFIG_SYSCTL_SYSCALL is not set
 # CONFIG_KALLSYMS is not set
index c25dc2c2b1da7d48ae6c4dae9d7c1a6172a88687..7643d39925d68d0fb7bd37d6ed4f0c2d3a5ea426 100644 (file)
@@ -38,34 +38,30 @@ static inline int is_ext_irq(unsigned int irq)
        return (irq >= EXT_IRQ0 && irq <= (EXT_IRQ0 + EXT_IRQS));
 }
 
-static void h8300_enable_irq(unsigned int irq)
+static void h8300_enable_irq(struct irq_data *data)
 {
-       if (is_ext_irq(irq))
-               IER_REGS |= 1 << (irq - EXT_IRQ0);
+       if (is_ext_irq(data->irq))
+               IER_REGS |= 1 << (data->irq - EXT_IRQ0);
 }
 
-static void h8300_disable_irq(unsigned int irq)
+static void h8300_disable_irq(struct irq_data *data)
 {
-       if (is_ext_irq(irq))
-               IER_REGS &= ~(1 << (irq - EXT_IRQ0));
+       if (is_ext_irq(data->irq))
+               IER_REGS &= ~(1 << (data->irq - EXT_IRQ0));
 }
 
-static void h8300_end_irq(unsigned int irq)
+static unsigned int h8300_startup_irq(struct irq_data *data)
 {
-}
-
-static unsigned int h8300_startup_irq(unsigned int irq)
-{
-       if (is_ext_irq(irq))
-               return h8300_enable_irq_pin(irq);
+       if (is_ext_irq(data->irq))
+               return h8300_enable_irq_pin(data->irq);
        else
                return 0;
 }
 
-static void h8300_shutdown_irq(unsigned int irq)
+static void h8300_shutdown_irq(struct irq_data *data)
 {
-       if (is_ext_irq(irq))
-               h8300_disable_irq_pin(irq);
+       if (is_ext_irq(data->irq))
+               h8300_disable_irq_pin(data->irq);
 }
 
 /*
@@ -73,12 +69,10 @@ static void h8300_shutdown_irq(unsigned int irq)
  */
 struct irq_chip h8300irq_chip = {
        .name           = "H8300-INTC",
-       .startup        = h8300_startup_irq,
-       .shutdown       = h8300_shutdown_irq,
-       .enable         = h8300_enable_irq,
-       .disable        = h8300_disable_irq,
-       .ack            = NULL,
-       .end            = h8300_end_irq,
+       .irq_startup    = h8300_startup_irq,
+       .irq_shutdown   = h8300_shutdown_irq,
+       .irq_enable     = h8300_enable_irq,
+       .irq_disable    = h8300_disable_irq,
 };
 
 #if defined(CONFIG_RAMKERNEL)
@@ -160,18 +154,14 @@ void __init init_IRQ(void)
 
        setup_vector();
 
-       for (c = 0; c < NR_IRQS; c++) {
-               irq_desc[c].status = IRQ_DISABLED;
-               irq_desc[c].action = NULL;
-               irq_desc[c].depth = 1;
-               irq_desc[c].chip = &h8300irq_chip;
-       }
+       for (c = 0; c < NR_IRQS; c++)
+               set_irq_chip_and_handler(c, &h8300irq_chip, handle_simple_irq);
 }
 
 asmlinkage void do_IRQ(int irq)
 {
        irq_enter();
-       __do_IRQ(irq);
+       generic_handle_irq(irq);
        irq_exit();
 }
 
@@ -192,7 +182,7 @@ int show_interrupts(struct seq_file *p, void *v)
                        goto unlock;
                seq_printf(p, "%3d: ",i);
                seq_printf(p, "%10u ", kstat_irqs(i));
-               seq_printf(p, " %14s", irq_desc[i].chip->name);
+               seq_printf(p, " %14s", irq_desc[i].irq_data.chip->name);
                seq_printf(p, "-%-8s", irq_desc[i].name);
                seq_printf(p, "  %s", action->name);
 
index e0f5b6d7f849b0d8b290e62185408c41735be849..fcf3b437a2d9a859365310bf35e0dae769db6005 100644 (file)
@@ -22,6 +22,10 @@ config IA64
        select HAVE_KVM
        select HAVE_ARCH_TRACEHOOK
        select HAVE_DMA_API_DEBUG
+       select HAVE_GENERIC_HARDIRQS
+       select GENERIC_IRQ_PROBE
+       select GENERIC_PENDING_IRQ if SMP
+       select IRQ_PER_CPU
        default y
        help
          The Itanium Processor Family is Intel's 64-bit successor to
@@ -678,28 +682,6 @@ source "arch/ia64/kvm/Kconfig"
 
 source "lib/Kconfig"
 
-#
-# Use the generic interrupt handling code in kernel/irq/:
-#
-config GENERIC_HARDIRQS
-       def_bool y
-
-config GENERIC_HARDIRQS_NO__DO_IRQ
-       def_bool y
-
-config GENERIC_IRQ_PROBE
-       bool
-       default y
-
-config GENERIC_PENDING_IRQ
-       bool
-       depends on GENERIC_HARDIRQS && SMP
-       default y
-
-config IRQ_PER_CPU
-       bool
-       default y
-
 config IOMMU_HELPER
        def_bool (IA64_HP_ZX1 || IA64_HP_ZX1_SWIOTLB || IA64_GENERIC || SWIOTLB)
 
index 5c291d65196be77c43e305d6d4d840dea1392612..ef4c1e442be34a4d9c3289e1b5b9d7b262617047 100644 (file)
@@ -7,6 +7,9 @@ config M32R
        select HAVE_KERNEL_GZIP
        select HAVE_KERNEL_BZIP2
        select HAVE_KERNEL_LZMA
+       select HAVE_GENERIC_HARDIRQS
+       select GENERIC_HARDIRQS_NO_DEPRECATED
+       select GENERIC_IRQ_PROBE
 
 config SBUS
        bool
@@ -19,14 +22,6 @@ config ZONE_DMA
        bool
        default y
 
-config GENERIC_HARDIRQS
-       bool
-       default y
-
-config GENERIC_IRQ_PROBE
-       bool
-       default y
-
 config NO_IOPORT
        def_bool y
 
index 816c3ecaa2aa97866ffe4169d3b65c5f22d8acd7..a3d727ed6a1609689c1129973199d64755546ac9 100644 (file)
@@ -5,7 +5,7 @@ CONFIG_IKCONFIG=y
 CONFIG_IKCONFIG_PROC=y
 CONFIG_LOG_BUF_SHIFT=15
 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
-CONFIG_EMBEDDED=y
+CONFIG_EXPERT=y
 # CONFIG_KALLSYMS is not set
 # CONFIG_FUTEX is not set
 # CONFIG_EPOLL is not set
index 84785686640a44ab462e94ad935a266137a05b4a..b8334163099defd3aa74fa17ed7ee042da5ae74f 100644 (file)
@@ -5,7 +5,7 @@ CONFIG_IKCONFIG=y
 CONFIG_IKCONFIG_PROC=y
 CONFIG_LOG_BUF_SHIFT=14
 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
-CONFIG_EMBEDDED=y
+CONFIG_EXPERT=y
 # CONFIG_KALLSYMS is not set
 # CONFIG_FUTEX is not set
 # CONFIG_EPOLL is not set
index 354a964d084d04fbf9278408239f965801507c43..7c90ce2fc42b77713d7f34e0c9f3b481d8d0a468 100644 (file)
@@ -3,7 +3,7 @@ CONFIG_BSD_PROCESS_ACCT=y
 CONFIG_IKCONFIG=y
 CONFIG_LOG_BUF_SHIFT=14
 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
-CONFIG_EMBEDDED=y
+CONFIG_EXPERT=y
 # CONFIG_KALLSYMS is not set
 # CONFIG_FUTEX is not set
 # CONFIG_EPOLL is not set
index 9022307bd07389e93be3ebec59d11c3ab2c91365..367d07cebcd373786d9f3374d56e852235e8a2a8 100644 (file)
@@ -5,7 +5,7 @@ CONFIG_IKCONFIG_PROC=y
 CONFIG_LOG_BUF_SHIFT=15
 CONFIG_BLK_DEV_INITRD=y
 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
-CONFIG_EMBEDDED=y
+CONFIG_EXPERT=y
 # CONFIG_KALLSYMS is not set
 # CONFIG_FUTEX is not set
 # CONFIG_EPOLL is not set
index 3726068721a536c48ee358d106c179ce57be19dc..cb11384386ce194d72dcdfdae3f4c28d1d26cd6b 100644 (file)
@@ -5,7 +5,7 @@ CONFIG_IKCONFIG_PROC=y
 CONFIG_LOG_BUF_SHIFT=14
 CONFIG_BLK_DEV_INITRD=y
 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
-CONFIG_EMBEDDED=y
+CONFIG_EXPERT=y
 # CONFIG_KALLSYMS is not set
 # CONFIG_FUTEX is not set
 # CONFIG_EPOLL is not set
index 6136fad048e4db90cae6a13172142b85f839dab3..3bff779259b485179e52717d37dda19eb205fa2f 100644 (file)
@@ -4,7 +4,7 @@ CONFIG_BSD_PROCESS_ACCT=y
 CONFIG_IKCONFIG=y
 CONFIG_LOG_BUF_SHIFT=14
 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
-CONFIG_EMBEDDED=y
+CONFIG_EXPERT=y
 # CONFIG_KALLSYMS is not set
 # CONFIG_FUTEX is not set
 # CONFIG_EPOLL is not set
index dce1fc7d67edf18e7d748b56d792baec8b2eb9a2..75246c9c1af82e9082baef90eabddc87e8e54b98 100644 (file)
@@ -4,7 +4,7 @@ CONFIG_BSD_PROCESS_ACCT=y
 CONFIG_IKCONFIG=y
 CONFIG_LOG_BUF_SHIFT=14
 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
-CONFIG_EMBEDDED=y
+CONFIG_EXPERT=y
 # CONFIG_KALLSYMS is not set
 # CONFIG_FUTEX is not set
 # CONFIG_EPOLL is not set
index b204e2ecd0f1c6406e61b9ed4cdba737e1639228..27cefd41ac1fd5ab1c7dd8e8829bf1935fc3bd8e 100644 (file)
@@ -5,7 +5,7 @@ CONFIG_IKCONFIG_PROC=y
 CONFIG_LOG_BUF_SHIFT=15
 CONFIG_BLK_DEV_INITRD=y
 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
-CONFIG_EMBEDDED=y
+CONFIG_EXPERT=y
 # CONFIG_KALLSYMS is not set
 # CONFIG_FUTEX is not set
 # CONFIG_EPOLL is not set
index 5aa4ea9ebb10cd5c17bb41ff46c449bf23713e45..5087a510ca4fcfaefe8df4aa3eb46ed328312275 100644 (file)
@@ -2,7 +2,7 @@ CONFIG_EXPERIMENTAL=y
 CONFIG_BSD_PROCESS_ACCT=y
 CONFIG_LOG_BUF_SHIFT=14
 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
-CONFIG_EMBEDDED=y
+CONFIG_EXPERT=y
 # CONFIG_KALLSYMS is not set
 # CONFIG_FUTEX is not set
 # CONFIG_EPOLL is not set
index 8494c6a276e8920b8055dcbfa5b913ae36942834..50c6f525db209ff01da71aae187ae3b9f6683aee 100644 (file)
@@ -4,7 +4,7 @@ CONFIG_BSD_PROCESS_ACCT=y
 CONFIG_IKCONFIG=y
 CONFIG_LOG_BUF_SHIFT=14
 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
-CONFIG_EMBEDDED=y
+CONFIG_EXPERT=y
 # CONFIG_KALLSYMS is not set
 # CONFIG_FUTEX is not set
 # CONFIG_EPOLL is not set
index 1df293bc2ab91f17419f454a04ad239239d91fbc..a3cfaaedab609d70e7c3facf7c97d4f4787d7a6c 100644 (file)
@@ -5,7 +5,7 @@ CONFIG_BSD_PROCESS_ACCT=y
 CONFIG_LOG_BUF_SHIFT=15
 CONFIG_BLK_DEV_INITRD=y
 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
-CONFIG_EMBEDDED=y
+CONFIG_EXPERT=y
 CONFIG_KALLSYMS_EXTRA_PASS=y
 CONFIG_SLAB=y
 CONFIG_MODULES=y
index 7db26f1f082d097f24ffa51da083694e05f47a5a..f745c1287f3adc5dead96fd9a2379ae49d578121 100644 (file)
@@ -40,8 +40,10 @@ int show_interrupts(struct seq_file *p, void *v)
        }
 
        if (i < NR_IRQS) {
-               raw_spin_lock_irqsave(&irq_desc[i].lock, flags);
-               action = irq_desc[i].action;
+               struct irq_desc *desc = irq_to_desc(i);
+
+               raw_spin_lock_irqsave(&desc->lock, flags);
+               action = desc->action;
                if (!action)
                        goto skip;
                seq_printf(p, "%3d: ",i);
@@ -51,7 +53,7 @@ int show_interrupts(struct seq_file *p, void *v)
                for_each_online_cpu(j)
                        seq_printf(p, "%10u ", kstat_irqs_cpu(i, j));
 #endif
-               seq_printf(p, " %14s", irq_desc[i].chip->name);
+               seq_printf(p, " %14s", desc->irq_data.chip->name);
                seq_printf(p, "  %s", action->name);
 
                for (action=action->next; action; action = action->next)
@@ -59,7 +61,7 @@ int show_interrupts(struct seq_file *p, void *v)
 
                seq_putc(p, '\n');
 skip:
-               raw_spin_unlock_irqrestore(&irq_desc[i].lock, flags);
+               raw_spin_unlock_irqrestore(&desc->lock, flags);
        }
        return 0;
 }
index 402a59d7219b6f368b38b4c9425ed79fa4279539..4a693d02c1e133cc58a94bdb62acd918f8af1383 100644 (file)
@@ -39,39 +39,30 @@ static void enable_m32104ut_irq(unsigned int irq)
        outl(data, port);
 }
 
-static void mask_and_ack_m32104ut(unsigned int irq)
+static void mask_m32104ut_irq(struct irq_data *data)
 {
-       disable_m32104ut_irq(irq);
+       disable_m32104ut_irq(data->irq);
 }
 
-static void end_m32104ut_irq(unsigned int irq)
+static void unmask_m32104ut_irq(struct irq_data *data)
 {
-       enable_m32104ut_irq(irq);
+       enable_m32104ut_irq(data->irq);
 }
 
-static unsigned int startup_m32104ut_irq(unsigned int irq)
+static void shutdown_m32104ut_irq(struct irq_data *data)
 {
-       enable_m32104ut_irq(irq);
-       return (0);
-}
-
-static void shutdown_m32104ut_irq(unsigned int irq)
-{
-       unsigned long port;
+       unsigned int irq = data->irq;
+       unsigned long port = irq2port(irq);
 
-       port = irq2port(irq);
        outl(M32R_ICUCR_ILEVEL7, port);
 }
 
 static struct irq_chip m32104ut_irq_type =
 {
-       .name = "M32104UT-IRQ",
-       .startup = startup_m32104ut_irq,
-       .shutdown = shutdown_m32104ut_irq,
-       .enable = enable_m32104ut_irq,
-       .disable = disable_m32104ut_irq,
-       .ack = mask_and_ack_m32104ut,
-       .end = end_m32104ut_irq
+       .name           = "M32104UT-IRQ",
+       .irq_shutdown   = shutdown_m32104ut_irq,
+       .irq_unmask     = unmask_m32104ut_irq,
+       .irq_mask       = mask_m32104ut_irq,
 };
 
 void __init init_IRQ(void)
@@ -85,36 +76,29 @@ void __init init_IRQ(void)
 
 #if defined(CONFIG_SMC91X)
        /* INT#0: LAN controller on M32104UT-LAN (SMC91C111)*/
-       irq_desc[M32R_IRQ_INT0].status = IRQ_DISABLED;
-       irq_desc[M32R_IRQ_INT0].chip = &m32104ut_irq_type;
-       irq_desc[M32R_IRQ_INT0].action = 0;
-       irq_desc[M32R_IRQ_INT0].depth = 1;
-       icu_data[M32R_IRQ_INT0].icucr = M32R_ICUCR_IEN | M32R_ICUCR_ISMOD11; /* "H" level sense */
+       set_irq_chip_and_handler(M32R_IRQ_INT0, &m32104ut_irq_type,
+                                handle_level_irq);
+       /* "H" level sense */
+       cu_data[M32R_IRQ_INT0].icucr = M32R_ICUCR_IEN | M32R_ICUCR_ISMOD11;
        disable_m32104ut_irq(M32R_IRQ_INT0);
 #endif  /* CONFIG_SMC91X */
 
        /* MFT2 : system timer */
-       irq_desc[M32R_IRQ_MFT2].status = IRQ_DISABLED;
-       irq_desc[M32R_IRQ_MFT2].chip = &m32104ut_irq_type;
-       irq_desc[M32R_IRQ_MFT2].action = 0;
-       irq_desc[M32R_IRQ_MFT2].depth = 1;
+       set_irq_chip_and_handler(M32R_IRQ_MFT2, &m32104ut_irq_type,
+                                handle_level_irq);
        icu_data[M32R_IRQ_MFT2].icucr = M32R_ICUCR_IEN;
        disable_m32104ut_irq(M32R_IRQ_MFT2);
 
 #ifdef CONFIG_SERIAL_M32R_SIO
        /* SIO0_R : uart receive data */
-       irq_desc[M32R_IRQ_SIO0_R].status = IRQ_DISABLED;
-       irq_desc[M32R_IRQ_SIO0_R].chip = &m32104ut_irq_type;
-       irq_desc[M32R_IRQ_SIO0_R].action = 0;
-       irq_desc[M32R_IRQ_SIO0_R].depth = 1;
+       set_irq_chip_and_handler(M32R_IRQ_SIO0_R, &m32104ut_irq_type,
+                                handle_level_irq);
        icu_data[M32R_IRQ_SIO0_R].icucr = M32R_ICUCR_IEN;
        disable_m32104ut_irq(M32R_IRQ_SIO0_R);
 
        /* SIO0_S : uart send data */
-       irq_desc[M32R_IRQ_SIO0_S].status = IRQ_DISABLED;
-       irq_desc[M32R_IRQ_SIO0_S].chip = &m32104ut_irq_type;
-       irq_desc[M32R_IRQ_SIO0_S].action = 0;
-       irq_desc[M32R_IRQ_SIO0_S].depth = 1;
+       set_irq_chip_and_handler(M32R_IRQ_SIO0_S, &m32104ut_irq_type,
+                                handle_level_irq);
        icu_data[M32R_IRQ_SIO0_S].icucr = M32R_ICUCR_IEN;
        disable_m32104ut_irq(M32R_IRQ_SIO0_S);
 #endif /* CONFIG_SERIAL_M32R_SIO */
index 80b1a026795aec2b8c8dae642143b4f5424538da..2074bcc841eba775047c178a798fa399750c66ef 100644 (file)
@@ -45,39 +45,30 @@ static void enable_m32700ut_irq(unsigned int irq)
        outl(data, port);
 }
 
-static void mask_and_ack_m32700ut(unsigned int irq)
+static void mask_m32700ut(struct irq_data *data)
 {
-       disable_m32700ut_irq(irq);
+       disable_m32700ut_irq(data->irq);
 }
 
-static void end_m32700ut_irq(unsigned int irq)
+static void unmask_m32700ut(struct irq_data *data)
 {
-       enable_m32700ut_irq(irq);
+       enable_m32700ut_irq(data->irq);
 }
 
-static unsigned int startup_m32700ut_irq(unsigned int irq)
-{
-       enable_m32700ut_irq(irq);
-       return (0);
-}
-
-static void shutdown_m32700ut_irq(unsigned int irq)
+static void shutdown_m32700ut(struct irq_data *data)
 {
        unsigned long port;
 
-       port = irq2port(irq);
+       port = irq2port(data->irq);
        outl(M32R_ICUCR_ILEVEL7, port);
 }
 
 static struct irq_chip m32700ut_irq_type =
 {
-       .name = "M32700UT-IRQ",
-       .startup = startup_m32700ut_irq,
-       .shutdown = shutdown_m32700ut_irq,
-       .enable = enable_m32700ut_irq,
-       .disable = disable_m32700ut_irq,
-       .ack = mask_and_ack_m32700ut,
-       .end = end_m32700ut_irq
+       .name           = "M32700UT-IRQ",
+       .irq_shutdown   = shutdown_m32700ut,
+       .irq_mask       = mask_m32700ut,
+       .irq_unmask     = unmask_m32700ut
 };
 
 /*
@@ -99,7 +90,6 @@ static void disable_m32700ut_pld_irq(unsigned int irq)
        unsigned int pldirq;
 
        pldirq = irq2pldirq(irq);
-//     disable_m32700ut_irq(M32R_IRQ_INT1);
        port = pldirq2port(pldirq);
        data = pld_icu_data[pldirq].icucr|PLD_ICUCR_ILEVEL7;
        outw(data, port);
@@ -111,50 +101,38 @@ static void enable_m32700ut_pld_irq(unsigned int irq)
        unsigned int pldirq;
 
        pldirq = irq2pldirq(irq);
-//     enable_m32700ut_irq(M32R_IRQ_INT1);
        port = pldirq2port(pldirq);
        data = pld_icu_data[pldirq].icucr|PLD_ICUCR_IEN|PLD_ICUCR_ILEVEL6;
        outw(data, port);
 }
 
-static void mask_and_ack_m32700ut_pld(unsigned int irq)
-{
-       disable_m32700ut_pld_irq(irq);
-//     mask_and_ack_m32700ut(M32R_IRQ_INT1);
-}
-
-static void end_m32700ut_pld_irq(unsigned int irq)
+static void mask_m32700ut_pld(struct irq_data *data)
 {
-       enable_m32700ut_pld_irq(irq);
-       end_m32700ut_irq(M32R_IRQ_INT1);
+       disable_m32700ut_pld_irq(data->irq);
 }
 
-static unsigned int startup_m32700ut_pld_irq(unsigned int irq)
+static void unmask_m32700ut_pld(struct irq_data *data)
 {
-       enable_m32700ut_pld_irq(irq);
-       return (0);
+       enable_m32700ut_pld_irq(data->irq);
+       enable_m32700ut_irq(M32R_IRQ_INT1);
 }
 
-static void shutdown_m32700ut_pld_irq(unsigned int irq)
+static void shutdown_m32700ut_pld_irq(struct irq_data *data)
 {
        unsigned long port;
        unsigned int pldirq;
 
-       pldirq = irq2pldirq(irq);
-//     shutdown_m32700ut_irq(M32R_IRQ_INT1);
+       pldirq = irq2pldirq(data->irq);
        port = pldirq2port(pldirq);
        outw(PLD_ICUCR_ILEVEL7, port);
 }
 
 static struct irq_chip m32700ut_pld_irq_type =
 {
-       .name = "M32700UT-PLD-IRQ",
-       .startup = startup_m32700ut_pld_irq,
-       .shutdown = shutdown_m32700ut_pld_irq,
-       .enable = enable_m32700ut_pld_irq,
-       .disable = disable_m32700ut_pld_irq,
-       .ack = mask_and_ack_m32700ut_pld,
-       .end = end_m32700ut_pld_irq
+       .name           = "M32700UT-PLD-IRQ",
+       .irq_shutdown   = shutdown_m32700ut_pld_irq,
+       .irq_mask       = mask_m32700ut_pld,
+       .irq_unmask     = unmask_m32700ut_pld,
 };
 
 /*
@@ -188,42 +166,33 @@ static void enable_m32700ut_lanpld_irq(unsigned int irq)
        outw(data, port);
 }
 
-static void mask_and_ack_m32700ut_lanpld(unsigned int irq)
+static void mask_m32700ut_lanpld(struct irq_data *data)
 {
-       disable_m32700ut_lanpld_irq(irq);
+       disable_m32700ut_lanpld_irq(data->irq);
 }
 
-static void end_m32700ut_lanpld_irq(unsigned int irq)
+static void unmask_m32700ut_lanpld(struct irq_data *data)
 {
-       enable_m32700ut_lanpld_irq(irq);
-       end_m32700ut_irq(M32R_IRQ_INT0);
-}
-
-static unsigned int startup_m32700ut_lanpld_irq(unsigned int irq)
-{
-       enable_m32700ut_lanpld_irq(irq);
-       return (0);
+       enable_m32700ut_lanpld_irq(data->irq);
+       enable_m32700ut_irq(M32R_IRQ_INT0);
 }
 
-static void shutdown_m32700ut_lanpld_irq(unsigned int irq)
+static void shutdown_m32700ut_lanpld(struct irq_data *data)
 {
        unsigned long port;
        unsigned int pldirq;
 
-       pldirq = irq2lanpldirq(irq);
+       pldirq = irq2lanpldirq(data->irq);
        port = lanpldirq2port(pldirq);
        outw(PLD_ICUCR_ILEVEL7, port);
 }
 
 static struct irq_chip m32700ut_lanpld_irq_type =
 {
-       .name = "M32700UT-PLD-LAN-IRQ",
-       .startup = startup_m32700ut_lanpld_irq,
-       .shutdown = shutdown_m32700ut_lanpld_irq,
-       .enable = enable_m32700ut_lanpld_irq,
-       .disable = disable_m32700ut_lanpld_irq,
-       .ack = mask_and_ack_m32700ut_lanpld,
-       .end = end_m32700ut_lanpld_irq
+       .name           = "M32700UT-PLD-LAN-IRQ",
+       .irq_shutdown   = shutdown_m32700ut_lanpld,
+       .irq_mask       = mask_m32700ut_lanpld,
+       .irq_unmask     = unmask_m32700ut_lanpld,
 };
 
 /*
@@ -257,143 +226,110 @@ static void enable_m32700ut_lcdpld_irq(unsigned int irq)
        outw(data, port);
 }
 
-static void mask_and_ack_m32700ut_lcdpld(unsigned int irq)
+static void mask_m32700ut_lcdpld(struct irq_data *data)
 {
-       disable_m32700ut_lcdpld_irq(irq);
+       disable_m32700ut_lcdpld_irq(data->irq);
 }
 
-static void end_m32700ut_lcdpld_irq(unsigned int irq)
+static void unmask_m32700ut_lcdpld(struct irq_data *data)
 {
-       enable_m32700ut_lcdpld_irq(irq);
-       end_m32700ut_irq(M32R_IRQ_INT2);
-}
-
-static unsigned int startup_m32700ut_lcdpld_irq(unsigned int irq)
-{
-       enable_m32700ut_lcdpld_irq(irq);
-       return (0);
+       enable_m32700ut_lcdpld_irq(data->irq);
+       enable_m32700ut_irq(M32R_IRQ_INT2);
 }
 
-static void shutdown_m32700ut_lcdpld_irq(unsigned int irq)
+static void shutdown_m32700ut_lcdpld(struct irq_data *data)
 {
        unsigned long port;
        unsigned int pldirq;
 
-       pldirq = irq2lcdpldirq(irq);
+       pldirq = irq2lcdpldirq(data->irq);
        port = lcdpldirq2port(pldirq);
        outw(PLD_ICUCR_ILEVEL7, port);
 }
 
 static struct irq_chip m32700ut_lcdpld_irq_type =
 {
-       .name = "M32700UT-PLD-LCD-IRQ",
-       .startup = startup_m32700ut_lcdpld_irq,
-       .shutdown = shutdown_m32700ut_lcdpld_irq,
-       .enable = enable_m32700ut_lcdpld_irq,
-       .disable = disable_m32700ut_lcdpld_irq,
-       .ack = mask_and_ack_m32700ut_lcdpld,
-       .end = end_m32700ut_lcdpld_irq
+       .name           = "M32700UT-PLD-LCD-IRQ",
+       .irq_shutdown   = shutdown_m32700ut_lcdpld,
+       .irq_mask       = mask_m32700ut_lcdpld,
+       .irq_unmask     = unmask_m32700ut_lcdpld,
 };
 
 void __init init_IRQ(void)
 {
 #if defined(CONFIG_SMC91X)
        /* INT#0: LAN controller on M32700UT-LAN (SMC91C111)*/
-       irq_desc[M32700UT_LAN_IRQ_LAN].status = IRQ_DISABLED;
-       irq_desc[M32700UT_LAN_IRQ_LAN].chip = &m32700ut_lanpld_irq_type;
-       irq_desc[M32700UT_LAN_IRQ_LAN].action = 0;
-       irq_desc[M32700UT_LAN_IRQ_LAN].depth = 1;       /* disable nested irq */
+       set_irq_chip_and_handler(M32700UT_LAN_IRQ_LAN,
+                                &m32700ut_lanpld_irq_type, handle_level_irq);
        lanpld_icu_data[irq2lanpldirq(M32700UT_LAN_IRQ_LAN)].icucr = PLD_ICUCR_IEN|PLD_ICUCR_ISMOD02;   /* "H" edge sense */
        disable_m32700ut_lanpld_irq(M32700UT_LAN_IRQ_LAN);
 #endif  /* CONFIG_SMC91X */
 
        /* MFT2 : system timer */
-       irq_desc[M32R_IRQ_MFT2].status = IRQ_DISABLED;
-       irq_desc[M32R_IRQ_MFT2].chip = &m32700ut_irq_type;
-       irq_desc[M32R_IRQ_MFT2].action = 0;
-       irq_desc[M32R_IRQ_MFT2].depth = 1;
+       set_irq_chip_and_handler(M32R_IRQ_MFT2, &m32700ut_irq_type,
+                                handle_level_irq);
        icu_data[M32R_IRQ_MFT2].icucr = M32R_ICUCR_IEN;
        disable_m32700ut_irq(M32R_IRQ_MFT2);
 
        /* SIO0 : receive */
-       irq_desc[M32R_IRQ_SIO0_R].status = IRQ_DISABLED;
-       irq_desc[M32R_IRQ_SIO0_R].chip = &m32700ut_irq_type;
-       irq_desc[M32R_IRQ_SIO0_R].action = 0;
-       irq_desc[M32R_IRQ_SIO0_R].depth = 1;
+       set_irq_chip_and_handler(M32R_IRQ_SIO0_R, &m32700ut_irq_type,
+                                handle_level_irq);
        icu_data[M32R_IRQ_SIO0_R].icucr = 0;
        disable_m32700ut_irq(M32R_IRQ_SIO0_R);
 
        /* SIO0 : send */
-       irq_desc[M32R_IRQ_SIO0_S].status = IRQ_DISABLED;
-       irq_desc[M32R_IRQ_SIO0_S].chip = &m32700ut_irq_type;
-       irq_desc[M32R_IRQ_SIO0_S].action = 0;
-       irq_desc[M32R_IRQ_SIO0_S].depth = 1;
+       set_irq_chip_and_handler(M32R_IRQ_SIO0_S, &m32700ut_irq_type,
+                                handle_level_irq);
        icu_data[M32R_IRQ_SIO0_S].icucr = 0;
        disable_m32700ut_irq(M32R_IRQ_SIO0_S);
 
        /* SIO1 : receive */
-       irq_desc[M32R_IRQ_SIO1_R].status = IRQ_DISABLED;
-       irq_desc[M32R_IRQ_SIO1_R].chip = &m32700ut_irq_type;
-       irq_desc[M32R_IRQ_SIO1_R].action = 0;
-       irq_desc[M32R_IRQ_SIO1_R].depth = 1;
+       set_irq_chip_and_handler(M32R_IRQ_SIO1_R, &m32700ut_irq_type,
+                                handle_level_irq);
        icu_data[M32R_IRQ_SIO1_R].icucr = 0;
        disable_m32700ut_irq(M32R_IRQ_SIO1_R);
 
        /* SIO1 : send */
-       irq_desc[M32R_IRQ_SIO1_S].status = IRQ_DISABLED;
-       irq_desc[M32R_IRQ_SIO1_S].chip = &m32700ut_irq_type;
-       irq_desc[M32R_IRQ_SIO1_S].action = 0;
-       irq_desc[M32R_IRQ_SIO1_S].depth = 1;
+       set_irq_chip_and_handler(M32R_IRQ_SIO1_S, &m32700ut_irq_type,
+                                handle_level_irq);
        icu_data[M32R_IRQ_SIO1_S].icucr = 0;
        disable_m32700ut_irq(M32R_IRQ_SIO1_S);
 
        /* DMA1 : */
-       irq_desc[M32R_IRQ_DMA1].status = IRQ_DISABLED;
-       irq_desc[M32R_IRQ_DMA1].chip = &m32700ut_irq_type;
-       irq_desc[M32R_IRQ_DMA1].action = 0;
-       irq_desc[M32R_IRQ_DMA1].depth = 1;
+       set_irq_chip_and_handler(M32R_IRQ_DMA1, &m32700ut_irq_type,
+                                handle_level_irq);
        icu_data[M32R_IRQ_DMA1].icucr = 0;
        disable_m32700ut_irq(M32R_IRQ_DMA1);
 
 #ifdef CONFIG_SERIAL_M32R_PLDSIO
        /* INT#1: SIO0 Receive on PLD */
-       irq_desc[PLD_IRQ_SIO0_RCV].status = IRQ_DISABLED;
-       irq_desc[PLD_IRQ_SIO0_RCV].chip = &m32700ut_pld_irq_type;
-       irq_desc[PLD_IRQ_SIO0_RCV].action = 0;
-       irq_desc[PLD_IRQ_SIO0_RCV].depth = 1;   /* disable nested irq */
+       set_irq_chip_and_handler(PLD_IRQ_SIO0_RCV, &m32700ut_pld_irq_type,
+                                handle_level_irq);
        pld_icu_data[irq2pldirq(PLD_IRQ_SIO0_RCV)].icucr = PLD_ICUCR_IEN|PLD_ICUCR_ISMOD03;
        disable_m32700ut_pld_irq(PLD_IRQ_SIO0_RCV);
 
        /* INT#1: SIO0 Send on PLD */
-       irq_desc[PLD_IRQ_SIO0_SND].status = IRQ_DISABLED;
-       irq_desc[PLD_IRQ_SIO0_SND].chip = &m32700ut_pld_irq_type;
-       irq_desc[PLD_IRQ_SIO0_SND].action = 0;
-       irq_desc[PLD_IRQ_SIO0_SND].depth = 1;   /* disable nested irq */
+       set_irq_chip_and_handler(PLD_IRQ_SIO0_SND, &m32700ut_pld_irq_type,
+                                handle_level_irq);
        pld_icu_data[irq2pldirq(PLD_IRQ_SIO0_SND)].icucr = PLD_ICUCR_IEN|PLD_ICUCR_ISMOD03;
        disable_m32700ut_pld_irq(PLD_IRQ_SIO0_SND);
 #endif  /* CONFIG_SERIAL_M32R_PLDSIO */
 
        /* INT#1: CFC IREQ on PLD */
-       irq_desc[PLD_IRQ_CFIREQ].status = IRQ_DISABLED;
-       irq_desc[PLD_IRQ_CFIREQ].chip = &m32700ut_pld_irq_type;
-       irq_desc[PLD_IRQ_CFIREQ].action = 0;
-       irq_desc[PLD_IRQ_CFIREQ].depth = 1;     /* disable nested irq */
+       set_irq_chip_and_handler(PLD_IRQ_CFIREQ, &m32700ut_pld_irq_type,
+                                handle_level_irq);
        pld_icu_data[irq2pldirq(PLD_IRQ_CFIREQ)].icucr = PLD_ICUCR_IEN|PLD_ICUCR_ISMOD01;       /* 'L' level sense */
        disable_m32700ut_pld_irq(PLD_IRQ_CFIREQ);
 
        /* INT#1: CFC Insert on PLD */
-       irq_desc[PLD_IRQ_CFC_INSERT].status = IRQ_DISABLED;
-       irq_desc[PLD_IRQ_CFC_INSERT].chip = &m32700ut_pld_irq_type;
-       irq_desc[PLD_IRQ_CFC_INSERT].action = 0;
-       irq_desc[PLD_IRQ_CFC_INSERT].depth = 1; /* disable nested irq */
+       set_irq_chip_and_handler(PLD_IRQ_CFC_INSERT, &m32700ut_pld_irq_type,
+                                handle_level_irq);
        pld_icu_data[irq2pldirq(PLD_IRQ_CFC_INSERT)].icucr = PLD_ICUCR_IEN|PLD_ICUCR_ISMOD00;   /* 'L' edge sense */
        disable_m32700ut_pld_irq(PLD_IRQ_CFC_INSERT);
 
        /* INT#1: CFC Eject on PLD */
-       irq_desc[PLD_IRQ_CFC_EJECT].status = IRQ_DISABLED;
-       irq_desc[PLD_IRQ_CFC_EJECT].chip = &m32700ut_pld_irq_type;
-       irq_desc[PLD_IRQ_CFC_EJECT].action = 0;
-       irq_desc[PLD_IRQ_CFC_EJECT].depth = 1;  /* disable nested irq */
+       set_irq_chip_and_handler(PLD_IRQ_CFC_EJECT, &m32700ut_pld_irq_type,
+                                handle_level_irq);
        pld_icu_data[irq2pldirq(PLD_IRQ_CFC_EJECT)].icucr = PLD_ICUCR_IEN|PLD_ICUCR_ISMOD02;    /* 'H' edge sense */
        disable_m32700ut_pld_irq(PLD_IRQ_CFC_EJECT);
 
@@ -413,13 +349,11 @@ void __init init_IRQ(void)
 
 #if defined(CONFIG_USB)
        outw(USBCR_OTGS, USBCR);        /* USBCR: non-OTG */
+       set_irq_chip_and_handler(M32700UT_LCD_IRQ_USB_INT1,
+                                &m32700ut_lcdpld_irq_type, handle_level_irq);
 
-    irq_desc[M32700UT_LCD_IRQ_USB_INT1].status = IRQ_DISABLED;
-    irq_desc[M32700UT_LCD_IRQ_USB_INT1].chip = &m32700ut_lcdpld_irq_type;
-    irq_desc[M32700UT_LCD_IRQ_USB_INT1].action = 0;
-    irq_desc[M32700UT_LCD_IRQ_USB_INT1].depth = 1;
-    lcdpld_icu_data[irq2lcdpldirq(M32700UT_LCD_IRQ_USB_INT1)].icucr = PLD_ICUCR_IEN|PLD_ICUCR_ISMOD01; /* "L" level sense */
-    disable_m32700ut_lcdpld_irq(M32700UT_LCD_IRQ_USB_INT1);
+       lcdpld_icu_data[irq2lcdpldirq(M32700UT_LCD_IRQ_USB_INT1)].icucr = PLD_ICUCR_IEN|PLD_ICUCR_ISMOD01;      /* "L" level sense */
+       disable_m32700ut_lcdpld_irq(M32700UT_LCD_IRQ_USB_INT1);
 #endif
        /*
         * INT2# is used for BAT, USB, AUDIO
@@ -432,10 +366,8 @@ void __init init_IRQ(void)
        /*
         * INT3# is used for AR
         */
-       irq_desc[M32R_IRQ_INT3].status = IRQ_DISABLED;
-       irq_desc[M32R_IRQ_INT3].chip = &m32700ut_irq_type;
-       irq_desc[M32R_IRQ_INT3].action = 0;
-       irq_desc[M32R_IRQ_INT3].depth = 1;
+       set_irq_chip_and_handler(M32R_IRQ_INT3, &m32700ut_irq_type,
+                                handle_level_irq);
        icu_data[M32R_IRQ_INT3].icucr = M32R_ICUCR_IEN|M32R_ICUCR_ISMOD10;
        disable_m32700ut_irq(M32R_IRQ_INT3);
 #endif /* CONFIG_VIDEO_M32R_AR */
index ea00c84d6b1b2bb665bf0e88cf8ed885b2f96385..cdd8c457402700fac38db075cfb279fb4bdf0f1f 100644 (file)
@@ -38,40 +38,30 @@ static void enable_mappi_irq(unsigned int irq)
        outl(data, port);
 }
 
-static void mask_and_ack_mappi(unsigned int irq)
+static void mask_mappi(struct irq_data *data)
 {
-       disable_mappi_irq(irq);
+       disable_mappi_irq(data->irq);
 }
 
-static void end_mappi_irq(unsigned int irq)
+static void unmask_mappi(struct irq_data *data)
 {
-       if (!(irq_desc[irq].status & (IRQ_DISABLED | IRQ_INPROGRESS)))
-               enable_mappi_irq(irq);
+       enable_mappi_irq(data->irq);
 }
 
-static unsigned int startup_mappi_irq(unsigned int irq)
-{
-       enable_mappi_irq(irq);
-       return (0);
-}
-
-static void shutdown_mappi_irq(unsigned int irq)
+static void shutdown_mappi(struct irq_data *data)
 {
        unsigned long port;
 
-       port = irq2port(irq);
+       port = irq2port(data->irq);
        outl(M32R_ICUCR_ILEVEL7, port);
 }
 
 static struct irq_chip mappi_irq_type =
 {
-       .name = "MAPPI-IRQ",
-       .startup = startup_mappi_irq,
-       .shutdown = shutdown_mappi_irq,
-       .enable = enable_mappi_irq,
-       .disable = disable_mappi_irq,
-       .ack = mask_and_ack_mappi,
-       .end = end_mappi_irq
+       .name           = "MAPPI-IRQ",
+       .irq_shutdown   = shutdown_mappi,
+       .irq_mask       = mask_mappi,
+       .irq_unmask     = unmask_mappi,
 };
 
 void __init init_IRQ(void)
@@ -85,70 +75,54 @@ void __init init_IRQ(void)
 
 #ifdef CONFIG_NE2000
        /* INT0 : LAN controller (RTL8019AS) */
-       irq_desc[M32R_IRQ_INT0].status = IRQ_DISABLED;
-       irq_desc[M32R_IRQ_INT0].chip = &mappi_irq_type;
-       irq_desc[M32R_IRQ_INT0].action = NULL;
-       irq_desc[M32R_IRQ_INT0].depth = 1;
+       set_irq_chip_and_handler(M32R_IRQ_INT0, &mappi_irq_type,
+                                handle_level_irq);
        icu_data[M32R_IRQ_INT0].icucr = M32R_ICUCR_IEN|M32R_ICUCR_ISMOD11;
        disable_mappi_irq(M32R_IRQ_INT0);
 #endif /* CONFIG_M32R_NE2000 */
 
        /* MFT2 : system timer */
-       irq_desc[M32R_IRQ_MFT2].status = IRQ_DISABLED;
-       irq_desc[M32R_IRQ_MFT2].chip = &mappi_irq_type;
-       irq_desc[M32R_IRQ_MFT2].action = NULL;
-       irq_desc[M32R_IRQ_MFT2].depth = 1;
+       set_irq_chip_and_handler(M32R_IRQ_MFT2, &mappi_irq_type,
+                                handle_level_irq);
        icu_data[M32R_IRQ_MFT2].icucr = M32R_ICUCR_IEN;
        disable_mappi_irq(M32R_IRQ_MFT2);
 
 #ifdef CONFIG_SERIAL_M32R_SIO
        /* SIO0_R : uart receive data */
-       irq_desc[M32R_IRQ_SIO0_R].status = IRQ_DISABLED;
-       irq_desc[M32R_IRQ_SIO0_R].chip = &mappi_irq_type;
-       irq_desc[M32R_IRQ_SIO0_R].action = NULL;
-       irq_desc[M32R_IRQ_SIO0_R].depth = 1;
+       set_irq_chip_and_handler(M32R_IRQ_SIO0_R, &mappi_irq_type,
+                                handle_level_irq);
        icu_data[M32R_IRQ_SIO0_R].icucr = 0;
        disable_mappi_irq(M32R_IRQ_SIO0_R);
 
        /* SIO0_S : uart send data */
-       irq_desc[M32R_IRQ_SIO0_S].status = IRQ_DISABLED;
-       irq_desc[M32R_IRQ_SIO0_S].chip = &mappi_irq_type;
-       irq_desc[M32R_IRQ_SIO0_S].action = NULL;
-       irq_desc[M32R_IRQ_SIO0_S].depth = 1;
+       set_irq_chip_and_handler(M32R_IRQ_SIO0_S, &mappi_irq_type,
+                                handle_level_irq);
        icu_data[M32R_IRQ_SIO0_S].icucr = 0;
        disable_mappi_irq(M32R_IRQ_SIO0_S);
 
        /* SIO1_R : uart receive data */
-       irq_desc[M32R_IRQ_SIO1_R].status = IRQ_DISABLED;
-       irq_desc[M32R_IRQ_SIO1_R].chip = &mappi_irq_type;
-       irq_desc[M32R_IRQ_SIO1_R].action = NULL;
-       irq_desc[M32R_IRQ_SIO1_R].depth = 1;
+       set_irq_chip_and_handler(M32R_IRQ_SIO1_R, &mappi_irq_type,
+                                handle_level_irq);
        icu_data[M32R_IRQ_SIO1_R].icucr = 0;
        disable_mappi_irq(M32R_IRQ_SIO1_R);
 
        /* SIO1_S : uart send data */
-       irq_desc[M32R_IRQ_SIO1_S].status = IRQ_DISABLED;
-       irq_desc[M32R_IRQ_SIO1_S].chip = &mappi_irq_type;
-       irq_desc[M32R_IRQ_SIO1_S].action = NULL;
-       irq_desc[M32R_IRQ_SIO1_S].depth = 1;
+       set_irq_chip_and_handler(M32R_IRQ_SIO1_S, &mappi_irq_type,
+                                handle_level_irq);
        icu_data[M32R_IRQ_SIO1_S].icucr = 0;
        disable_mappi_irq(M32R_IRQ_SIO1_S);
 #endif /* CONFIG_SERIAL_M32R_SIO */
 
 #if defined(CONFIG_M32R_PCC)
        /* INT1 : pccard0 interrupt */
-       irq_desc[M32R_IRQ_INT1].status = IRQ_DISABLED;
-       irq_desc[M32R_IRQ_INT1].chip = &mappi_irq_type;
-       irq_desc[M32R_IRQ_INT1].action = NULL;
-       irq_desc[M32R_IRQ_INT1].depth = 1;
+       set_irq_chip_and_handler(M32R_IRQ_INT1, &mappi_irq_type,
+                                handle_level_irq);
        icu_data[M32R_IRQ_INT1].icucr = M32R_ICUCR_IEN | M32R_ICUCR_ISMOD00;
        disable_mappi_irq(M32R_IRQ_INT1);
 
        /* INT2 : pccard1 interrupt */
-       irq_desc[M32R_IRQ_INT2].status = IRQ_DISABLED;
-       irq_desc[M32R_IRQ_INT2].chip = &mappi_irq_type;
-       irq_desc[M32R_IRQ_INT2].action = NULL;
-       irq_desc[M32R_IRQ_INT2].depth = 1;
+       set_irq_chip_and_handler(M32R_IRQ_INT2, &mappi_irq_type,
+                                handle_level_irq);
        icu_data[M32R_IRQ_INT2].icucr = M32R_ICUCR_IEN | M32R_ICUCR_ISMOD00;
        disable_mappi_irq(M32R_IRQ_INT2);
 #endif /* CONFIG_M32RPCC */
index c049376d0270064869450bb56948a4edd57c068e..9117c30ea3652386d8d56770df21839ccdf40fd2 100644 (file)
@@ -46,126 +46,97 @@ static void enable_mappi2_irq(unsigned int irq)
        outl(data, port);
 }
 
-static void mask_and_ack_mappi2(unsigned int irq)
+static void mask_mappi2(struct irq_data *data)
 {
-       disable_mappi2_irq(irq);
+       disable_mappi2_irq(data->irq);
 }
 
-static void end_mappi2_irq(unsigned int irq)
+static void unmask_mappi2(struct irq_data *data)
 {
-       enable_mappi2_irq(irq);
+       enable_mappi2_irq(data->irq);
 }
 
-static unsigned int startup_mappi2_irq(unsigned int irq)
-{
-       enable_mappi2_irq(irq);
-       return (0);
-}
-
-static void shutdown_mappi2_irq(unsigned int irq)
+static void shutdown_mappi2(struct irq_data *data)
 {
        unsigned long port;
 
-       port = irq2port(irq);
+       port = irq2port(data->irq);
        outl(M32R_ICUCR_ILEVEL7, port);
 }
 
 static struct irq_chip mappi2_irq_type =
 {
-       .name = "MAPPI2-IRQ",
-       .startup = startup_mappi2_irq,
-       .shutdown = shutdown_mappi2_irq,
-       .enable = enable_mappi2_irq,
-       .disable = disable_mappi2_irq,
-       .ack = mask_and_ack_mappi2,
-       .end = end_mappi2_irq
+       .name           = "MAPPI2-IRQ",
+       .irq_shutdown   = shutdown_mappi2,
+       .irq_mask       = mask_mappi2,
+       .irq_unmask     = unmask_mappi2,
 };
 
 void __init init_IRQ(void)
 {
 #if defined(CONFIG_SMC91X)
        /* INT0 : LAN controller (SMC91111) */
-       irq_desc[M32R_IRQ_INT0].status = IRQ_DISABLED;
-       irq_desc[M32R_IRQ_INT0].chip = &mappi2_irq_type;
-       irq_desc[M32R_IRQ_INT0].action = 0;
-       irq_desc[M32R_IRQ_INT0].depth = 1;
+       set_irq_chip_and_handler(M32R_IRQ_INT0, &mappi2_irq_type,
+                                handle_level_irq);
        icu_data[M32R_IRQ_INT0].icucr = M32R_ICUCR_IEN|M32R_ICUCR_ISMOD10;
        disable_mappi2_irq(M32R_IRQ_INT0);
 #endif  /* CONFIG_SMC91X */
 
        /* MFT2 : system timer */
-       irq_desc[M32R_IRQ_MFT2].status = IRQ_DISABLED;
-       irq_desc[M32R_IRQ_MFT2].chip = &mappi2_irq_type;
-       irq_desc[M32R_IRQ_MFT2].action = 0;
-       irq_desc[M32R_IRQ_MFT2].depth = 1;
+       set_irq_chip_and_handler(M32R_IRQ_MFT2, &mappi2_irq_type,
+                                handle_level_irq);
        icu_data[M32R_IRQ_MFT2].icucr = M32R_ICUCR_IEN;
        disable_mappi2_irq(M32R_IRQ_MFT2);
 
 #ifdef CONFIG_SERIAL_M32R_SIO
        /* SIO0_R : uart receive data */
-       irq_desc[M32R_IRQ_SIO0_R].status = IRQ_DISABLED;
-       irq_desc[M32R_IRQ_SIO0_R].chip = &mappi2_irq_type;
-       irq_desc[M32R_IRQ_SIO0_R].action = 0;
-       irq_desc[M32R_IRQ_SIO0_R].depth = 1;
+       set_irq_chip_and_handler(M32R_IRQ_SIO0_R, &mappi2_irq_type,
+                                handle_level_irq);
        icu_data[M32R_IRQ_SIO0_R].icucr = 0;
        disable_mappi2_irq(M32R_IRQ_SIO0_R);
 
        /* SIO0_S : uart send data */
-       irq_desc[M32R_IRQ_SIO0_S].status = IRQ_DISABLED;
-       irq_desc[M32R_IRQ_SIO0_S].chip = &mappi2_irq_type;
-       irq_desc[M32R_IRQ_SIO0_S].action = 0;
-       irq_desc[M32R_IRQ_SIO0_S].depth = 1;
+       set_irq_chip_and_handler(M32R_IRQ_SIO0_S, &mappi2_irq_type,
+                                handle_level_irq);
        icu_data[M32R_IRQ_SIO0_S].icucr = 0;
        disable_mappi2_irq(M32R_IRQ_SIO0_S);
        /* SIO1_R : uart receive data */
-       irq_desc[M32R_IRQ_SIO1_R].status = IRQ_DISABLED;
-       irq_desc[M32R_IRQ_SIO1_R].chip = &mappi2_irq_type;
-       irq_desc[M32R_IRQ_SIO1_R].action = 0;
-       irq_desc[M32R_IRQ_SIO1_R].depth = 1;
+       set_irq_chip_and_handler(M32R_IRQ_SIO1_R, &mappi2_irq_type,
+                                handle_level_irq);
        icu_data[M32R_IRQ_SIO1_R].icucr = 0;
        disable_mappi2_irq(M32R_IRQ_SIO1_R);
 
        /* SIO1_S : uart send data */
-       irq_desc[M32R_IRQ_SIO1_S].status = IRQ_DISABLED;
-       irq_desc[M32R_IRQ_SIO1_S].chip = &mappi2_irq_type;
-       irq_desc[M32R_IRQ_SIO1_S].action = 0;
-       irq_desc[M32R_IRQ_SIO1_S].depth = 1;
+       set_irq_chip_and_handler(M32R_IRQ_SIO1_S, &mappi2_irq_type,
+                                handle_level_irq);
        icu_data[M32R_IRQ_SIO1_S].icucr = 0;
        disable_mappi2_irq(M32R_IRQ_SIO1_S);
 #endif  /* CONFIG_M32R_USE_DBG_CONSOLE */
 
 #if defined(CONFIG_USB)
        /* INT1 : USB Host controller interrupt */
-       irq_desc[M32R_IRQ_INT1].status = IRQ_DISABLED;
-       irq_desc[M32R_IRQ_INT1].chip = &mappi2_irq_type;
-       irq_desc[M32R_IRQ_INT1].action = 0;
-       irq_desc[M32R_IRQ_INT1].depth = 1;
+       set_irq_chip_and_handler(M32R_IRQ_INT1, &mappi2_irq_type,
+                                handle_level_irq);
        icu_data[M32R_IRQ_INT1].icucr = M32R_ICUCR_ISMOD01;
        disable_mappi2_irq(M32R_IRQ_INT1);
 #endif /* CONFIG_USB */
 
        /* ICUCR40: CFC IREQ */
-       irq_desc[PLD_IRQ_CFIREQ].status = IRQ_DISABLED;
-       irq_desc[PLD_IRQ_CFIREQ].chip = &mappi2_irq_type;
-       irq_desc[PLD_IRQ_CFIREQ].action = 0;
-       irq_desc[PLD_IRQ_CFIREQ].depth = 1;     /* disable nested irq */
+       set_irq_chip_and_handler(PLD_IRQ_CFIREQ, &mappi2_irq_type,
+                                handle_level_irq);
        icu_data[PLD_IRQ_CFIREQ].icucr = M32R_ICUCR_IEN|M32R_ICUCR_ISMOD01;
        disable_mappi2_irq(PLD_IRQ_CFIREQ);
 
 #if defined(CONFIG_M32R_CFC)
        /* ICUCR41: CFC Insert */
-       irq_desc[PLD_IRQ_CFC_INSERT].status = IRQ_DISABLED;
-       irq_desc[PLD_IRQ_CFC_INSERT].chip = &mappi2_irq_type;
-       irq_desc[PLD_IRQ_CFC_INSERT].action = 0;
-       irq_desc[PLD_IRQ_CFC_INSERT].depth = 1; /* disable nested irq */
+       set_irq_chip_and_handler(PLD_IRQ_CFC_INSERT, &mappi2_irq_type,
+                                handle_level_irq);
        icu_data[PLD_IRQ_CFC_INSERT].icucr = M32R_ICUCR_IEN|M32R_ICUCR_ISMOD00;
        disable_mappi2_irq(PLD_IRQ_CFC_INSERT);
 
        /* ICUCR42: CFC Eject */
-       irq_desc[PLD_IRQ_CFC_EJECT].status = IRQ_DISABLED;
-       irq_desc[PLD_IRQ_CFC_EJECT].chip = &mappi2_irq_type;
-       irq_desc[PLD_IRQ_CFC_EJECT].action = 0;
-       irq_desc[PLD_IRQ_CFC_EJECT].depth = 1;  /* disable nested irq */
+       set_irq_chip_and_handler(PLD_IRQ_CFC_EJECT, &mappi2_irq_type,
+                                handle_level_irq);
        icu_data[PLD_IRQ_CFC_EJECT].icucr = M32R_ICUCR_IEN|M32R_ICUCR_ISMOD10;
        disable_mappi2_irq(PLD_IRQ_CFC_EJECT);
 #endif /* CONFIG_MAPPI2_CFC */
index 882de25c6e8cc7d8f6bc9a55ef9a4c422fefcab2..b44f5ded2bbeff9fcf96a07ad6e47be6f59fdc3c 100644 (file)
@@ -46,128 +46,98 @@ static void enable_mappi3_irq(unsigned int irq)
        outl(data, port);
 }
 
-static void mask_and_ack_mappi3(unsigned int irq)
+static void mask_mappi3(struct irq_data *data)
 {
-       disable_mappi3_irq(irq);
+       disable_mappi3_irq(data->irq);
 }
 
-static void end_mappi3_irq(unsigned int irq)
+static void unmask_mappi3(struct irq_data *data)
 {
-       enable_mappi3_irq(irq);
+       enable_mappi3_irq(data->irq);
 }
 
-static unsigned int startup_mappi3_irq(unsigned int irq)
-{
-       enable_mappi3_irq(irq);
-       return (0);
-}
-
-static void shutdown_mappi3_irq(unsigned int irq)
+static void shutdown_mappi3(struct irq_data *data)
 {
        unsigned long port;
 
-       port = irq2port(irq);
+       port = irq2port(data->irq);
        outl(M32R_ICUCR_ILEVEL7, port);
 }
 
-static struct irq_chip mappi3_irq_type =
-{
-       .name = "MAPPI3-IRQ",
-       .startup = startup_mappi3_irq,
-       .shutdown = shutdown_mappi3_irq,
-       .enable = enable_mappi3_irq,
-       .disable = disable_mappi3_irq,
-       .ack = mask_and_ack_mappi3,
-       .end = end_mappi3_irq
+static struct irq_chip mappi3_irq_type = {
+       .name           = "MAPPI3-IRQ",
+       .irq_shutdown   = shutdown_mappi3,
+       .irq_mask       = mask_mappi3,
+       .irq_unmask     = unmask_mappi3,
 };
 
 void __init init_IRQ(void)
 {
 #if defined(CONFIG_SMC91X)
        /* INT0 : LAN controller (SMC91111) */
-       irq_desc[M32R_IRQ_INT0].status = IRQ_DISABLED;
-       irq_desc[M32R_IRQ_INT0].chip = &mappi3_irq_type;
-       irq_desc[M32R_IRQ_INT0].action = 0;
-       irq_desc[M32R_IRQ_INT0].depth = 1;
+       set_irq_chip_and_handler(M32R_IRQ_INT0, &mappi3_irq_type,
+                                handle_level_irq);
        icu_data[M32R_IRQ_INT0].icucr = M32R_ICUCR_IEN|M32R_ICUCR_ISMOD10;
        disable_mappi3_irq(M32R_IRQ_INT0);
 #endif  /* CONFIG_SMC91X */
 
        /* MFT2 : system timer */
-       irq_desc[M32R_IRQ_MFT2].status = IRQ_DISABLED;
-       irq_desc[M32R_IRQ_MFT2].chip = &mappi3_irq_type;
-       irq_desc[M32R_IRQ_MFT2].action = 0;
-       irq_desc[M32R_IRQ_MFT2].depth = 1;
+       set_irq_chip_and_handler(M32R_IRQ_MFT2, &mappi3_irq_type,
+                                handle_level_irq);
        icu_data[M32R_IRQ_MFT2].icucr = M32R_ICUCR_IEN;
        disable_mappi3_irq(M32R_IRQ_MFT2);
 
 #ifdef CONFIG_SERIAL_M32R_SIO
        /* SIO0_R : uart receive data */
-       irq_desc[M32R_IRQ_SIO0_R].status = IRQ_DISABLED;
-       irq_desc[M32R_IRQ_SIO0_R].chip = &mappi3_irq_type;
-       irq_desc[M32R_IRQ_SIO0_R].action = 0;
-       irq_desc[M32R_IRQ_SIO0_R].depth = 1;
+       set_irq_chip_and_handler(M32R_IRQ_SIO0_R, &mappi3_irq_type,
+                                handle_level_irq);
        icu_data[M32R_IRQ_SIO0_R].icucr = 0;
        disable_mappi3_irq(M32R_IRQ_SIO0_R);
 
        /* SIO0_S : uart send data */
-       irq_desc[M32R_IRQ_SIO0_S].status = IRQ_DISABLED;
-       irq_desc[M32R_IRQ_SIO0_S].chip = &mappi3_irq_type;
-       irq_desc[M32R_IRQ_SIO0_S].action = 0;
-       irq_desc[M32R_IRQ_SIO0_S].depth = 1;
+       set_irq_chip_and_handler(M32R_IRQ_SIO0_S, &mappi3_irq_type,
+                                handle_level_irq);
        icu_data[M32R_IRQ_SIO0_S].icucr = 0;
        disable_mappi3_irq(M32R_IRQ_SIO0_S);
        /* SIO1_R : uart receive data */
-       irq_desc[M32R_IRQ_SIO1_R].status = IRQ_DISABLED;
-       irq_desc[M32R_IRQ_SIO1_R].chip = &mappi3_irq_type;
-       irq_desc[M32R_IRQ_SIO1_R].action = 0;
-       irq_desc[M32R_IRQ_SIO1_R].depth = 1;
+       set_irq_chip_and_handler(M32R_IRQ_SIO1_R, &mappi3_irq_type,
+                                handle_level_irq);
        icu_data[M32R_IRQ_SIO1_R].icucr = 0;
        disable_mappi3_irq(M32R_IRQ_SIO1_R);
 
        /* SIO1_S : uart send data */
-       irq_desc[M32R_IRQ_SIO1_S].status = IRQ_DISABLED;
-       irq_desc[M32R_IRQ_SIO1_S].chip = &mappi3_irq_type;
-       irq_desc[M32R_IRQ_SIO1_S].action = 0;
-       irq_desc[M32R_IRQ_SIO1_S].depth = 1;
+       set_irq_chip_and_handler(M32R_IRQ_SIO1_S, &mappi3_irq_type,
+                                handle_level_irq);
        icu_data[M32R_IRQ_SIO1_S].icucr = 0;
        disable_mappi3_irq(M32R_IRQ_SIO1_S);
 #endif  /* CONFIG_M32R_USE_DBG_CONSOLE */
 
 #if defined(CONFIG_USB)
        /* INT1 : USB Host controller interrupt */
-       irq_desc[M32R_IRQ_INT1].status = IRQ_DISABLED;
-       irq_desc[M32R_IRQ_INT1].chip = &mappi3_irq_type;
-       irq_desc[M32R_IRQ_INT1].action = 0;
-       irq_desc[M32R_IRQ_INT1].depth = 1;
+       set_irq_chip_and_handler(M32R_IRQ_INT1, &mappi3_irq_type,
+                                handle_level_irq);
        icu_data[M32R_IRQ_INT1].icucr = M32R_ICUCR_ISMOD01;
        disable_mappi3_irq(M32R_IRQ_INT1);
 #endif /* CONFIG_USB */
 
        /* CFC IREQ */
-       irq_desc[PLD_IRQ_CFIREQ].status = IRQ_DISABLED;
-       irq_desc[PLD_IRQ_CFIREQ].chip = &mappi3_irq_type;
-       irq_desc[PLD_IRQ_CFIREQ].action = 0;
-       irq_desc[PLD_IRQ_CFIREQ].depth = 1;     /* disable nested irq */
+       set_irq_chip_and_handler(PLD_IRQ_CFIREQ, &mappi3_irq_type,
+                                handle_level_irq);
        icu_data[PLD_IRQ_CFIREQ].icucr = M32R_ICUCR_IEN|M32R_ICUCR_ISMOD01;
        disable_mappi3_irq(PLD_IRQ_CFIREQ);
 
 #if defined(CONFIG_M32R_CFC)
        /* ICUCR41: CFC Insert & eject */
-       irq_desc[PLD_IRQ_CFC_INSERT].status = IRQ_DISABLED;
-       irq_desc[PLD_IRQ_CFC_INSERT].chip = &mappi3_irq_type;
-       irq_desc[PLD_IRQ_CFC_INSERT].action = 0;
-       irq_desc[PLD_IRQ_CFC_INSERT].depth = 1; /* disable nested irq */
+       set_irq_chip_and_handler(PLD_IRQ_CFC_INSERT, &mappi3_irq_type,
+                                handle_level_irq);
        icu_data[PLD_IRQ_CFC_INSERT].icucr = M32R_ICUCR_IEN|M32R_ICUCR_ISMOD00;
        disable_mappi3_irq(PLD_IRQ_CFC_INSERT);
 
 #endif /* CONFIG_M32R_CFC */
 
        /* IDE IREQ */
-       irq_desc[PLD_IRQ_IDEIREQ].status = IRQ_DISABLED;
-       irq_desc[PLD_IRQ_IDEIREQ].chip = &mappi3_irq_type;
-       irq_desc[PLD_IRQ_IDEIREQ].action = 0;
-       irq_desc[PLD_IRQ_IDEIREQ].depth = 1;    /* disable nested irq */
+       set_irq_chip_and_handler(PLD_IRQ_IDEIREQ, &mappi3_irq_type,
+                                handle_level_irq);
        icu_data[PLD_IRQ_IDEIREQ].icucr = M32R_ICUCR_IEN|M32R_ICUCR_ISMOD10;
        disable_mappi3_irq(PLD_IRQ_IDEIREQ);
 
index d11d93bf74f52bd4b14baea3e6fc3da16d83b271..19a02db7b818f50e64b79ccd8b3d5804525845a1 100644 (file)
@@ -37,39 +37,30 @@ static void enable_oaks32r_irq(unsigned int irq)
        outl(data, port);
 }
 
-static void mask_and_ack_mappi(unsigned int irq)
+static void mask_oaks32r(struct irq_data *data)
 {
-       disable_oaks32r_irq(irq);
+       disable_oaks32r_irq(data->irq);
 }
 
-static void end_oaks32r_irq(unsigned int irq)
+static void unmask_oaks32r(struct irq_data *data)
 {
-       enable_oaks32r_irq(irq);
+       enable_oaks32r_irq(data->irq);
 }
 
-static unsigned int startup_oaks32r_irq(unsigned int irq)
-{
-       enable_oaks32r_irq(irq);
-       return (0);
-}
-
-static void shutdown_oaks32r_irq(unsigned int irq)
+static void shutdown_oaks32r(struct irq_data *data)
 {
        unsigned long port;
 
-       port = irq2port(irq);
+       port = irq2port(data->irq);
        outl(M32R_ICUCR_ILEVEL7, port);
 }
 
 static struct irq_chip oaks32r_irq_type =
 {
-       .name = "OAKS32R-IRQ",
-       .startup = startup_oaks32r_irq,
-       .shutdown = shutdown_oaks32r_irq,
-       .enable = enable_oaks32r_irq,
-       .disable = disable_oaks32r_irq,
-       .ack = mask_and_ack_mappi,
-       .end = end_oaks32r_irq
+       .name           = "OAKS32R-IRQ",
+       .irq_shutdown   = shutdown_oaks32r,
+       .irq_mask       = mask_oaks32r,
+       .irq_unmask     = unmask_oaks32r,
 };
 
 void __init init_IRQ(void)
@@ -83,52 +74,40 @@ void __init init_IRQ(void)
 
 #ifdef CONFIG_NE2000
        /* INT3 : LAN controller (RTL8019AS) */
-       irq_desc[M32R_IRQ_INT3].status = IRQ_DISABLED;
-       irq_desc[M32R_IRQ_INT3].chip = &oaks32r_irq_type;
-       irq_desc[M32R_IRQ_INT3].action = 0;
-       irq_desc[M32R_IRQ_INT3].depth = 1;
+       set_irq_chip_and_handler(M32R_IRQ_INT3, &oaks32r_irq_type,
+                                handle_level_irq);
        icu_data[M32R_IRQ_INT3].icucr = M32R_ICUCR_IEN|M32R_ICUCR_ISMOD10;
        disable_oaks32r_irq(M32R_IRQ_INT3);
 #endif /* CONFIG_M32R_NE2000 */
 
        /* MFT2 : system timer */
-       irq_desc[M32R_IRQ_MFT2].status = IRQ_DISABLED;
-       irq_desc[M32R_IRQ_MFT2].chip = &oaks32r_irq_type;
-       irq_desc[M32R_IRQ_MFT2].action = 0;
-       irq_desc[M32R_IRQ_MFT2].depth = 1;
+       set_irq_chip_and_handler(M32R_IRQ_MFT2, &oaks32r_irq_type,
+                                handle_level_irq);
        icu_data[M32R_IRQ_MFT2].icucr = M32R_ICUCR_IEN;
        disable_oaks32r_irq(M32R_IRQ_MFT2);
 
 #ifdef CONFIG_SERIAL_M32R_SIO
        /* SIO0_R : uart receive data */
-       irq_desc[M32R_IRQ_SIO0_R].status = IRQ_DISABLED;
-       irq_desc[M32R_IRQ_SIO0_R].chip = &oaks32r_irq_type;
-       irq_desc[M32R_IRQ_SIO0_R].action = 0;
-       irq_desc[M32R_IRQ_SIO0_R].depth = 1;
+       set_irq_chip_and_handler(M32R_IRQ_SIO0_R, &oaks32r_irq_type,
+                                handle_level_irq);
        icu_data[M32R_IRQ_SIO0_R].icucr = 0;
        disable_oaks32r_irq(M32R_IRQ_SIO0_R);
 
        /* SIO0_S : uart send data */
-       irq_desc[M32R_IRQ_SIO0_S].status = IRQ_DISABLED;
-       irq_desc[M32R_IRQ_SIO0_S].chip = &oaks32r_irq_type;
-       irq_desc[M32R_IRQ_SIO0_S].action = 0;
-       irq_desc[M32R_IRQ_SIO0_S].depth = 1;
+       set_irq_chip_and_handler(M32R_IRQ_SIO0_S, &oaks32r_irq_type,
+                                handle_level_irq);
        icu_data[M32R_IRQ_SIO0_S].icucr = 0;
        disable_oaks32r_irq(M32R_IRQ_SIO0_S);
 
        /* SIO1_R : uart receive data */
-       irq_desc[M32R_IRQ_SIO1_R].status = IRQ_DISABLED;
-       irq_desc[M32R_IRQ_SIO1_R].chip = &oaks32r_irq_type;
-       irq_desc[M32R_IRQ_SIO1_R].action = 0;
-       irq_desc[M32R_IRQ_SIO1_R].depth = 1;
+       set_irq_chip_and_handler(M32R_IRQ_SIO1_R, &oaks32r_irq_type,
+                                handle_level_irq);
        icu_data[M32R_IRQ_SIO1_R].icucr = 0;
        disable_oaks32r_irq(M32R_IRQ_SIO1_R);
 
        /* SIO1_S : uart send data */
-       irq_desc[M32R_IRQ_SIO1_S].status = IRQ_DISABLED;
-       irq_desc[M32R_IRQ_SIO1_S].chip = &oaks32r_irq_type;
-       irq_desc[M32R_IRQ_SIO1_S].action = 0;
-       irq_desc[M32R_IRQ_SIO1_S].depth = 1;
+       set_irq_chip_and_handler(M32R_IRQ_SIO1_S, &oaks32r_irq_type,
+                                handle_level_irq);
        icu_data[M32R_IRQ_SIO1_S].icucr = 0;
        disable_oaks32r_irq(M32R_IRQ_SIO1_S);
 #endif /* CONFIG_SERIAL_M32R_SIO */
index 5f3402a2fbafe3c67cd549ac9c7335ff27aa3e1a..12731547e8bf3b104b87a6dfb17c8440ab3a5cb7 100644 (file)
@@ -46,39 +46,30 @@ static void enable_opsput_irq(unsigned int irq)
        outl(data, port);
 }
 
-static void mask_and_ack_opsput(unsigned int irq)
+static void mask_opsput(struct irq_data *data)
 {
-       disable_opsput_irq(irq);
+       disable_opsput_irq(data->irq);
 }
 
-static void end_opsput_irq(unsigned int irq)
+static void unmask_opsput(struct irq_data *data)
 {
-       enable_opsput_irq(irq);
+       enable_opsput_irq(data->irq);
 }
 
-static unsigned int startup_opsput_irq(unsigned int irq)
-{
-       enable_opsput_irq(irq);
-       return (0);
-}
-
-static void shutdown_opsput_irq(unsigned int irq)
+static void shutdown_opsput(struct irq_data *data)
 {
        unsigned long port;
 
-       port = irq2port(irq);
+       port = irq2port(data->irq);
        outl(M32R_ICUCR_ILEVEL7, port);
 }
 
 static struct irq_chip opsput_irq_type =
 {
-       .name = "OPSPUT-IRQ",
-       .startup = startup_opsput_irq,
-       .shutdown = shutdown_opsput_irq,
-       .enable = enable_opsput_irq,
-       .disable = disable_opsput_irq,
-       .ack = mask_and_ack_opsput,
-       .end = end_opsput_irq
+       .name           = "OPSPUT-IRQ",
+       .irq_shutdown   = shutdown_opsput,
+       .irq_mask       = mask_opsput,
+       .irq_unmask     = unmask_opsput,
 };
 
 /*
@@ -100,7 +91,6 @@ static void disable_opsput_pld_irq(unsigned int irq)
        unsigned int pldirq;
 
        pldirq = irq2pldirq(irq);
-//     disable_opsput_irq(M32R_IRQ_INT1);
        port = pldirq2port(pldirq);
        data = pld_icu_data[pldirq].icucr|PLD_ICUCR_ILEVEL7;
        outw(data, port);
@@ -112,50 +102,38 @@ static void enable_opsput_pld_irq(unsigned int irq)
        unsigned int pldirq;
 
        pldirq = irq2pldirq(irq);
-//     enable_opsput_irq(M32R_IRQ_INT1);
        port = pldirq2port(pldirq);
        data = pld_icu_data[pldirq].icucr|PLD_ICUCR_IEN|PLD_ICUCR_ILEVEL6;
        outw(data, port);
 }
 
-static void mask_and_ack_opsput_pld(unsigned int irq)
-{
-       disable_opsput_pld_irq(irq);
-//     mask_and_ack_opsput(M32R_IRQ_INT1);
-}
-
-static void end_opsput_pld_irq(unsigned int irq)
+static void mask_opsput_pld(struct irq_data *data)
 {
-       enable_opsput_pld_irq(irq);
-       end_opsput_irq(M32R_IRQ_INT1);
+       disable_opsput_pld_irq(data->irq);
 }
 
-static unsigned int startup_opsput_pld_irq(unsigned int irq)
+static void unmask_opsput_pld(struct irq_data *data)
 {
-       enable_opsput_pld_irq(irq);
-       return (0);
+       enable_opsput_pld_irq(data->irq);
+       enable_opsput_irq(M32R_IRQ_INT1);
 }
 
-static void shutdown_opsput_pld_irq(unsigned int irq)
+static void shutdown_opsput_pld(struct irq_data *data)
 {
        unsigned long port;
        unsigned int pldirq;
 
-       pldirq = irq2pldirq(irq);
-//     shutdown_opsput_irq(M32R_IRQ_INT1);
+       pldirq = irq2pldirq(data->irq);
        port = pldirq2port(pldirq);
        outw(PLD_ICUCR_ILEVEL7, port);
 }
 
 static struct irq_chip opsput_pld_irq_type =
 {
-       .name = "OPSPUT-PLD-IRQ",
-       .startup = startup_opsput_pld_irq,
-       .shutdown = shutdown_opsput_pld_irq,
-       .enable = enable_opsput_pld_irq,
-       .disable = disable_opsput_pld_irq,
-       .ack = mask_and_ack_opsput_pld,
-       .end = end_opsput_pld_irq
+       .name           = "OPSPUT-PLD-IRQ",
+       .irq_shutdown   = shutdown_opsput_pld,
+       .irq_mask       = mask_opsput_pld,
+       .irq_unmask     = unmask_opsput_pld,
 };
 
 /*
@@ -189,42 +167,33 @@ static void enable_opsput_lanpld_irq(unsigned int irq)
        outw(data, port);
 }
 
-static void mask_and_ack_opsput_lanpld(unsigned int irq)
-{
-       disable_opsput_lanpld_irq(irq);
-}
-
-static void end_opsput_lanpld_irq(unsigned int irq)
+static void mask_opsput_lanpld(struct irq_data *data)
 {
-       enable_opsput_lanpld_irq(irq);
-       end_opsput_irq(M32R_IRQ_INT0);
+       disable_opsput_lanpld_irq(data->irq);
 }
 
-static unsigned int startup_opsput_lanpld_irq(unsigned int irq)
+static void unmask_opsput_lanpld(struct irq_data *data)
 {
-       enable_opsput_lanpld_irq(irq);
-       return (0);
+       enable_opsput_lanpld_irq(data->irq);
+       enable_opsput_irq(M32R_IRQ_INT0);
 }
 
-static void shutdown_opsput_lanpld_irq(unsigned int irq)
+static void shutdown_opsput_lanpld(struct irq_data *data)
 {
        unsigned long port;
        unsigned int pldirq;
 
-       pldirq = irq2lanpldirq(irq);
+       pldirq = irq2lanpldirq(data->irq);
        port = lanpldirq2port(pldirq);
        outw(PLD_ICUCR_ILEVEL7, port);
 }
 
 static struct irq_chip opsput_lanpld_irq_type =
 {
-       .name = "OPSPUT-PLD-LAN-IRQ",
-       .startup = startup_opsput_lanpld_irq,
-       .shutdown = shutdown_opsput_lanpld_irq,
-       .enable = enable_opsput_lanpld_irq,
-       .disable = disable_opsput_lanpld_irq,
-       .ack = mask_and_ack_opsput_lanpld,
-       .end = end_opsput_lanpld_irq
+       .name           = "OPSPUT-PLD-LAN-IRQ",
+       .irq_shutdown   = shutdown_opsput_lanpld,
+       .irq_mask       = mask_opsput_lanpld,
+       .irq_unmask     = unmask_opsput_lanpld,
 };
 
 /*
@@ -258,143 +227,109 @@ static void enable_opsput_lcdpld_irq(unsigned int irq)
        outw(data, port);
 }
 
-static void mask_and_ack_opsput_lcdpld(unsigned int irq)
-{
-       disable_opsput_lcdpld_irq(irq);
-}
-
-static void end_opsput_lcdpld_irq(unsigned int irq)
+static void mask_opsput_lcdpld(struct irq_data *data)
 {
-       enable_opsput_lcdpld_irq(irq);
-       end_opsput_irq(M32R_IRQ_INT2);
+       disable_opsput_lcdpld_irq(data->irq);
 }
 
-static unsigned int startup_opsput_lcdpld_irq(unsigned int irq)
+static void unmask_opsput_lcdpld(struct irq_data *data)
 {
-       enable_opsput_lcdpld_irq(irq);
-       return (0);
+       enable_opsput_lcdpld_irq(data->irq);
+       enable_opsput_irq(M32R_IRQ_INT2);
 }
 
-static void shutdown_opsput_lcdpld_irq(unsigned int irq)
+static void shutdown_opsput_lcdpld(struct irq_data *data)
 {
        unsigned long port;
        unsigned int pldirq;
 
-       pldirq = irq2lcdpldirq(irq);
+       pldirq = irq2lcdpldirq(data->irq);
        port = lcdpldirq2port(pldirq);
        outw(PLD_ICUCR_ILEVEL7, port);
 }
 
-static struct irq_chip opsput_lcdpld_irq_type =
-{
-       "OPSPUT-PLD-LCD-IRQ",
-       startup_opsput_lcdpld_irq,
-       shutdown_opsput_lcdpld_irq,
-       enable_opsput_lcdpld_irq,
-       disable_opsput_lcdpld_irq,
-       mask_and_ack_opsput_lcdpld,
-       end_opsput_lcdpld_irq
+static struct irq_chip opsput_lcdpld_irq_type = {
+       .name           = "OPSPUT-PLD-LCD-IRQ",
+       .irq_shutdown   = shutdown_opsput_lcdpld,
+       .irq_mask       = mask_opsput_lcdpld,
+       .irq_unmask     = unmask_opsput_lcdpld,
 };
 
 void __init init_IRQ(void)
 {
 #if defined(CONFIG_SMC91X)
        /* INT#0: LAN controller on OPSPUT-LAN (SMC91C111)*/
-       irq_desc[OPSPUT_LAN_IRQ_LAN].status = IRQ_DISABLED;
-       irq_desc[OPSPUT_LAN_IRQ_LAN].chip = &opsput_lanpld_irq_type;
-       irq_desc[OPSPUT_LAN_IRQ_LAN].action = 0;
-       irq_desc[OPSPUT_LAN_IRQ_LAN].depth = 1; /* disable nested irq */
+       set_irq_chip_and_handler(OPSPUT_LAN_IRQ_LAN, &opsput_lanpld_irq_type,
+                                handle_level_irq);
        lanpld_icu_data[irq2lanpldirq(OPSPUT_LAN_IRQ_LAN)].icucr = PLD_ICUCR_IEN|PLD_ICUCR_ISMOD02;     /* "H" edge sense */
        disable_opsput_lanpld_irq(OPSPUT_LAN_IRQ_LAN);
 #endif  /* CONFIG_SMC91X */
 
        /* MFT2 : system timer */
-       irq_desc[M32R_IRQ_MFT2].status = IRQ_DISABLED;
-       irq_desc[M32R_IRQ_MFT2].chip = &opsput_irq_type;
-       irq_desc[M32R_IRQ_MFT2].action = 0;
-       irq_desc[M32R_IRQ_MFT2].depth = 1;
+       set_irq_chip_and_handler(M32R_IRQ_MFT2, &opsput_irq_type,
+                                handle_level_irq);
        icu_data[M32R_IRQ_MFT2].icucr = M32R_ICUCR_IEN;
        disable_opsput_irq(M32R_IRQ_MFT2);
 
        /* SIO0 : receive */
-       irq_desc[M32R_IRQ_SIO0_R].status = IRQ_DISABLED;
-       irq_desc[M32R_IRQ_SIO0_R].chip = &opsput_irq_type;
-       irq_desc[M32R_IRQ_SIO0_R].action = 0;
-       irq_desc[M32R_IRQ_SIO0_R].depth = 1;
+       set_irq_chip_and_handler(M32R_IRQ_SIO0_R, &opsput_irq_type,
+                                handle_level_irq);
        icu_data[M32R_IRQ_SIO0_R].icucr = 0;
        disable_opsput_irq(M32R_IRQ_SIO0_R);
 
        /* SIO0 : send */
-       irq_desc[M32R_IRQ_SIO0_S].status = IRQ_DISABLED;
-       irq_desc[M32R_IRQ_SIO0_S].chip = &opsput_irq_type;
-       irq_desc[M32R_IRQ_SIO0_S].action = 0;
-       irq_desc[M32R_IRQ_SIO0_S].depth = 1;
+       set_irq_chip_and_handler(M32R_IRQ_SIO0_S, &opsput_irq_type,
+                                handle_level_irq);
        icu_data[M32R_IRQ_SIO0_S].icucr = 0;
        disable_opsput_irq(M32R_IRQ_SIO0_S);
 
        /* SIO1 : receive */
-       irq_desc[M32R_IRQ_SIO1_R].status = IRQ_DISABLED;
-       irq_desc[M32R_IRQ_SIO1_R].chip = &opsput_irq_type;
-       irq_desc[M32R_IRQ_SIO1_R].action = 0;
-       irq_desc[M32R_IRQ_SIO1_R].depth = 1;
+       set_irq_chip_and_handler(M32R_IRQ_SIO1_R, &opsput_irq_type,
+                                handle_level_irq);
        icu_data[M32R_IRQ_SIO1_R].icucr = 0;
        disable_opsput_irq(M32R_IRQ_SIO1_R);
 
        /* SIO1 : send */
-       irq_desc[M32R_IRQ_SIO1_S].status = IRQ_DISABLED;
-       irq_desc[M32R_IRQ_SIO1_S].chip = &opsput_irq_type;
-       irq_desc[M32R_IRQ_SIO1_S].action = 0;
-       irq_desc[M32R_IRQ_SIO1_S].depth = 1;
+       set_irq_chip_and_handler(M32R_IRQ_SIO1_S, &opsput_irq_type,
+                                handle_level_irq);
        icu_data[M32R_IRQ_SIO1_S].icucr = 0;
        disable_opsput_irq(M32R_IRQ_SIO1_S);
 
        /* DMA1 : */
-       irq_desc[M32R_IRQ_DMA1].status = IRQ_DISABLED;
-       irq_desc[M32R_IRQ_DMA1].chip = &opsput_irq_type;
-       irq_desc[M32R_IRQ_DMA1].action = 0;
-       irq_desc[M32R_IRQ_DMA1].depth = 1;
+       set_irq_chip_and_handler(M32R_IRQ_DMA1, &opsput_irq_type,
+                                handle_level_irq);
        icu_data[M32R_IRQ_DMA1].icucr = 0;
        disable_opsput_irq(M32R_IRQ_DMA1);
 
 #ifdef CONFIG_SERIAL_M32R_PLDSIO
        /* INT#1: SIO0 Receive on PLD */
-       irq_desc[PLD_IRQ_SIO0_RCV].status = IRQ_DISABLED;
-       irq_desc[PLD_IRQ_SIO0_RCV].chip = &opsput_pld_irq_type;
-       irq_desc[PLD_IRQ_SIO0_RCV].action = 0;
-       irq_desc[PLD_IRQ_SIO0_RCV].depth = 1;   /* disable nested irq */
+       set_irq_chip_and_handler(PLD_IRQ_SIO0_RCV, &opsput_pld_irq_type,
+                                handle_level_irq);
        pld_icu_data[irq2pldirq(PLD_IRQ_SIO0_RCV)].icucr = PLD_ICUCR_IEN|PLD_ICUCR_ISMOD03;
        disable_opsput_pld_irq(PLD_IRQ_SIO0_RCV);
 
        /* INT#1: SIO0 Send on PLD */
-       irq_desc[PLD_IRQ_SIO0_SND].status = IRQ_DISABLED;
-       irq_desc[PLD_IRQ_SIO0_SND].chip = &opsput_pld_irq_type;
-       irq_desc[PLD_IRQ_SIO0_SND].action = 0;
-       irq_desc[PLD_IRQ_SIO0_SND].depth = 1;   /* disable nested irq */
+       set_irq_chip_and_handler(PLD_IRQ_SIO0_SND, &opsput_pld_irq_type,
+                                handle_level_irq);
        pld_icu_data[irq2pldirq(PLD_IRQ_SIO0_SND)].icucr = PLD_ICUCR_IEN|PLD_ICUCR_ISMOD03;
        disable_opsput_pld_irq(PLD_IRQ_SIO0_SND);
 #endif  /* CONFIG_SERIAL_M32R_PLDSIO */
 
        /* INT#1: CFC IREQ on PLD */
-       irq_desc[PLD_IRQ_CFIREQ].status = IRQ_DISABLED;
-       irq_desc[PLD_IRQ_CFIREQ].chip = &opsput_pld_irq_type;
-       irq_desc[PLD_IRQ_CFIREQ].action = 0;
-       irq_desc[PLD_IRQ_CFIREQ].depth = 1;     /* disable nested irq */
+       set_irq_chip_and_handler(PLD_IRQ_CFIREQ, &opsput_pld_irq_type,
+                                handle_level_irq);
        pld_icu_data[irq2pldirq(PLD_IRQ_CFIREQ)].icucr = PLD_ICUCR_IEN|PLD_ICUCR_ISMOD01;       /* 'L' level sense */
        disable_opsput_pld_irq(PLD_IRQ_CFIREQ);
 
        /* INT#1: CFC Insert on PLD */
-       irq_desc[PLD_IRQ_CFC_INSERT].status = IRQ_DISABLED;
-       irq_desc[PLD_IRQ_CFC_INSERT].chip = &opsput_pld_irq_type;
-       irq_desc[PLD_IRQ_CFC_INSERT].action = 0;
-       irq_desc[PLD_IRQ_CFC_INSERT].depth = 1; /* disable nested irq */
+       set_irq_chip_and_handler(PLD_IRQ_CFC_INSERT, &opsput_pld_irq_type,
+                                handle_level_irq);
        pld_icu_data[irq2pldirq(PLD_IRQ_CFC_INSERT)].icucr = PLD_ICUCR_IEN|PLD_ICUCR_ISMOD00;   /* 'L' edge sense */
        disable_opsput_pld_irq(PLD_IRQ_CFC_INSERT);
 
        /* INT#1: CFC Eject on PLD */
-       irq_desc[PLD_IRQ_CFC_EJECT].status = IRQ_DISABLED;
-       irq_desc[PLD_IRQ_CFC_EJECT].chip = &opsput_pld_irq_type;
-       irq_desc[PLD_IRQ_CFC_EJECT].action = 0;
-       irq_desc[PLD_IRQ_CFC_EJECT].depth = 1;  /* disable nested irq */
+       set_irq_chip_and_handler(PLD_IRQ_CFC_EJECT, &opsput_pld_irq_type,
+                                handle_level_irq);
        pld_icu_data[irq2pldirq(PLD_IRQ_CFC_EJECT)].icucr = PLD_ICUCR_IEN|PLD_ICUCR_ISMOD02;    /* 'H' edge sense */
        disable_opsput_pld_irq(PLD_IRQ_CFC_EJECT);
 
@@ -413,14 +348,11 @@ void __init init_IRQ(void)
        enable_opsput_irq(M32R_IRQ_INT1);
 
 #if defined(CONFIG_USB)
-       outw(USBCR_OTGS, USBCR);        /* USBCR: non-OTG */
-
-    irq_desc[OPSPUT_LCD_IRQ_USB_INT1].status = IRQ_DISABLED;
-    irq_desc[OPSPUT_LCD_IRQ_USB_INT1].chip = &opsput_lcdpld_irq_type;
-    irq_desc[OPSPUT_LCD_IRQ_USB_INT1].action = 0;
-    irq_desc[OPSPUT_LCD_IRQ_USB_INT1].depth = 1;
-    lcdpld_icu_data[irq2lcdpldirq(OPSPUT_LCD_IRQ_USB_INT1)].icucr = PLD_ICUCR_IEN|PLD_ICUCR_ISMOD01;   /* "L" level sense */
-    disable_opsput_lcdpld_irq(OPSPUT_LCD_IRQ_USB_INT1);
+       outw(USBCR_OTGS, USBCR);        /* USBCR: non-OTG */
+       set_irq_chip_and_handler(OPSPUT_LCD_IRQ_USB_INT1,
+                                &opsput_lcdpld_irq_type, handle_level_irq);
+       lcdpld_icu_data[irq2lcdpldirq(OPSPUT_LCD_IRQ_USB_INT1)].icucr = PLD_ICUCR_IEN|PLD_ICUCR_ISMOD01;        /* "L" level sense */
+       disable_opsput_lcdpld_irq(OPSPUT_LCD_IRQ_USB_INT1);
 #endif
        /*
         * INT2# is used for BAT, USB, AUDIO
@@ -433,10 +365,8 @@ void __init init_IRQ(void)
        /*
         * INT3# is used for AR
         */
-       irq_desc[M32R_IRQ_INT3].status = IRQ_DISABLED;
-       irq_desc[M32R_IRQ_INT3].chip = &opsput_irq_type;
-       irq_desc[M32R_IRQ_INT3].action = 0;
-       irq_desc[M32R_IRQ_INT3].depth = 1;
+       set_irq_chip_and_handler(M32R_IRQ_INT3, &opsput_irq_type,
+                                handle_level_irq);
        icu_data[M32R_IRQ_INT3].icucr = M32R_ICUCR_IEN|M32R_ICUCR_ISMOD10;
        disable_opsput_irq(M32R_IRQ_INT3);
 #endif /* CONFIG_VIDEO_M32R_AR */
index 1beac7a51ed432ea386610b8b1bbe3132e04d6b7..f3cff26d6e740c983ebbe34b15b222a1adf66e68 100644 (file)
@@ -37,39 +37,30 @@ static void enable_mappi_irq(unsigned int irq)
        outl(data, port);
 }
 
-static void mask_and_ack_mappi(unsigned int irq)
+static void mask_mappi(struct irq_data *data)
 {
-       disable_mappi_irq(irq);
+       disable_mappi_irq(data->irq);
 }
 
-static void end_mappi_irq(unsigned int irq)
+static void unmask_mappi(struct irq_data *data)
 {
-       enable_mappi_irq(irq);
+       enable_mappi_irq(data->irq);
 }
 
-static unsigned int startup_mappi_irq(unsigned int irq)
-{
-       enable_mappi_irq(irq);
-       return 0;
-}
-
-static void shutdown_mappi_irq(unsigned int irq)
+static void shutdown_mappi(struct irq_data *data)
 {
        unsigned long port;
 
-       port = irq2port(irq);
+       port = irq2port(data->irq);
        outl(M32R_ICUCR_ILEVEL7, port);
 }
 
 static struct irq_chip mappi_irq_type =
 {
-       .name = "M32700-IRQ",
-       .startup = startup_mappi_irq,
-       .shutdown = shutdown_mappi_irq,
-       .enable = enable_mappi_irq,
-       .disable = disable_mappi_irq,
-       .ack = mask_and_ack_mappi,
-       .end = end_mappi_irq
+       .name           = "M32700-IRQ",
+       .irq_shutdown   = shutdown_mappi,
+       .irq_mask       = mask_mappi,
+       .irq_unmask     = unmask_mappi,
 };
 
 /*
@@ -107,42 +98,33 @@ static void enable_m32700ut_pld_irq(unsigned int irq)
        outw(data, port);
 }
 
-static void mask_and_ack_m32700ut_pld(unsigned int irq)
+static void mask_m32700ut_pld(struct irq_data *data)
 {
-       disable_m32700ut_pld_irq(irq);
+       disable_m32700ut_pld_irq(data->irq);
 }
 
-static void end_m32700ut_pld_irq(unsigned int irq)
+static void unmask_m32700ut_pld(struct irq_data *data)
 {
-       enable_m32700ut_pld_irq(irq);
-       end_mappi_irq(M32R_IRQ_INT1);
-}
-
-static unsigned int startup_m32700ut_pld_irq(unsigned int irq)
-{
-       enable_m32700ut_pld_irq(irq);
-       return 0;
+       enable_m32700ut_pld_irq(data->irq);
+       enable_mappi_irq(M32R_IRQ_INT1);
 }
 
-static void shutdown_m32700ut_pld_irq(unsigned int irq)
+static void shutdown_m32700ut_pld(struct irq_data *data)
 {
        unsigned long port;
        unsigned int pldirq;
 
-       pldirq = irq2pldirq(irq);
+       pldirq = irq2pldirq(data->irq);
        port = pldirq2port(pldirq);
        outw(PLD_ICUCR_ILEVEL7, port);
 }
 
 static struct irq_chip m32700ut_pld_irq_type =
 {
-       .name = "USRV-PLD-IRQ",
-       .startup = startup_m32700ut_pld_irq,
-       .shutdown = shutdown_m32700ut_pld_irq,
-       .enable = enable_m32700ut_pld_irq,
-       .disable = disable_m32700ut_pld_irq,
-       .ack = mask_and_ack_m32700ut_pld,
-       .end = end_m32700ut_pld_irq
+       .name           = "USRV-PLD-IRQ",
+       .irq_shutdown   = shutdown_m32700ut_pld,
+       .irq_mask       = mask_m32700ut_pld,
+       .irq_unmask     = unmask_m32700ut_pld,
 };
 
 void __init init_IRQ(void)
@@ -156,53 +138,42 @@ void __init init_IRQ(void)
                once++;
 
        /* MFT2 : system timer */
-       irq_desc[M32R_IRQ_MFT2].status = IRQ_DISABLED;
-       irq_desc[M32R_IRQ_MFT2].chip = &mappi_irq_type;
-       irq_desc[M32R_IRQ_MFT2].action = 0;
-       irq_desc[M32R_IRQ_MFT2].depth = 1;
+       set_irq_chip_and_handler(M32R_IRQ_MFT2, &mappi_irq_type,
+                                handle_level_irq);
        icu_data[M32R_IRQ_MFT2].icucr = M32R_ICUCR_IEN;
        disable_mappi_irq(M32R_IRQ_MFT2);
 
 #if defined(CONFIG_SERIAL_M32R_SIO)
        /* SIO0_R : uart receive data */
-       irq_desc[M32R_IRQ_SIO0_R].status = IRQ_DISABLED;
-       irq_desc[M32R_IRQ_SIO0_R].chip = &mappi_irq_type;
-       irq_desc[M32R_IRQ_SIO0_R].action = 0;
-       irq_desc[M32R_IRQ_SIO0_R].depth = 1;
+       set_irq_chip_and_handler(M32R_IRQ_SIO0_R, &mappi_irq_type,
+                                handle_level_irq);
        icu_data[M32R_IRQ_SIO0_R].icucr = 0;
        disable_mappi_irq(M32R_IRQ_SIO0_R);
 
        /* SIO0_S : uart send data */
-       irq_desc[M32R_IRQ_SIO0_S].status = IRQ_DISABLED;
-       irq_desc[M32R_IRQ_SIO0_S].chip = &mappi_irq_type;
-       irq_desc[M32R_IRQ_SIO0_S].action = 0;
-       irq_desc[M32R_IRQ_SIO0_S].depth = 1;
+       set_irq_chip_and_handler(M32R_IRQ_SIO0_S, &mappi_irq_type,
+                                handle_level_irq);
        icu_data[M32R_IRQ_SIO0_S].icucr = 0;
        disable_mappi_irq(M32R_IRQ_SIO0_S);
 
        /* SIO1_R : uart receive data */
-       irq_desc[M32R_IRQ_SIO1_R].status = IRQ_DISABLED;
-       irq_desc[M32R_IRQ_SIO1_R].chip = &mappi_irq_type;
-       irq_desc[M32R_IRQ_SIO1_R].action = 0;
-       irq_desc[M32R_IRQ_SIO1_R].depth = 1;
+       set_irq_chip_and_handler(M32R_IRQ_SIO1_R, &mappi_irq_type,
+                                handle_level_irq);
        icu_data[M32R_IRQ_SIO1_R].icucr = 0;
        disable_mappi_irq(M32R_IRQ_SIO1_R);
 
        /* SIO1_S : uart send data */
-       irq_desc[M32R_IRQ_SIO1_S].status = IRQ_DISABLED;
-       irq_desc[M32R_IRQ_SIO1_S].chip = &mappi_irq_type;
-       irq_desc[M32R_IRQ_SIO1_S].action = 0;
-       irq_desc[M32R_IRQ_SIO1_S].depth = 1;
+       set_irq_chip_and_handler(M32R_IRQ_SIO1_S, &mappi_irq_type,
+                                handle_level_irq);
        icu_data[M32R_IRQ_SIO1_S].icucr = 0;
        disable_mappi_irq(M32R_IRQ_SIO1_S);
 #endif  /* CONFIG_SERIAL_M32R_SIO */
 
        /* INT#67-#71: CFC#0 IREQ on PLD */
        for (i = 0 ; i < CONFIG_M32R_CFC_NUM ; i++ ) {
-               irq_desc[PLD_IRQ_CF0 + i].status = IRQ_DISABLED;
-               irq_desc[PLD_IRQ_CF0 + i].chip = &m32700ut_pld_irq_type;
-               irq_desc[PLD_IRQ_CF0 + i].action = 0;
-               irq_desc[PLD_IRQ_CF0 + i].depth = 1;    /* disable nested irq */
+               set_irq_chip_and_handler(PLD_IRQ_CF0 + i,
+                                        &m32700ut_pld_irq_type,
+                                        handle_level_irq);
                pld_icu_data[irq2pldirq(PLD_IRQ_CF0 + i)].icucr
                        = PLD_ICUCR_ISMOD01;    /* 'L' level sense */
                disable_m32700ut_pld_irq(PLD_IRQ_CF0 + i);
@@ -210,19 +181,15 @@ void __init init_IRQ(void)
 
 #if defined(CONFIG_SERIAL_8250) || defined(CONFIG_SERIAL_8250_MODULE)
        /* INT#76: 16552D#0 IREQ on PLD */
-       irq_desc[PLD_IRQ_UART0].status = IRQ_DISABLED;
-       irq_desc[PLD_IRQ_UART0].chip = &m32700ut_pld_irq_type;
-       irq_desc[PLD_IRQ_UART0].action = 0;
-       irq_desc[PLD_IRQ_UART0].depth = 1;      /* disable nested irq */
+       set_irq_chip_and_handler(PLD_IRQ_UART0, &m32700ut_pld_irq_type,
+                                handle_level_irq);
        pld_icu_data[irq2pldirq(PLD_IRQ_UART0)].icucr
                = PLD_ICUCR_ISMOD03;    /* 'H' level sense */
        disable_m32700ut_pld_irq(PLD_IRQ_UART0);
 
        /* INT#77: 16552D#1 IREQ on PLD */
-       irq_desc[PLD_IRQ_UART1].status = IRQ_DISABLED;
-       irq_desc[PLD_IRQ_UART1].chip = &m32700ut_pld_irq_type;
-       irq_desc[PLD_IRQ_UART1].action = 0;
-       irq_desc[PLD_IRQ_UART1].depth = 1;      /* disable nested irq */
+       set_irq_chip_and_handler(PLD_IRQ_UART1, &m32700ut_pld_irq_type,
+                                handle_level_irq);
        pld_icu_data[irq2pldirq(PLD_IRQ_UART1)].icucr
                = PLD_ICUCR_ISMOD03;    /* 'H' level sense */
        disable_m32700ut_pld_irq(PLD_IRQ_UART1);
@@ -230,10 +197,8 @@ void __init init_IRQ(void)
 
 #if defined(CONFIG_IDC_AK4524) || defined(CONFIG_IDC_AK4524_MODULE)
        /* INT#80: AK4524 IREQ on PLD */
-       irq_desc[PLD_IRQ_SNDINT].status = IRQ_DISABLED;
-       irq_desc[PLD_IRQ_SNDINT].chip = &m32700ut_pld_irq_type;
-       irq_desc[PLD_IRQ_SNDINT].action = 0;
-       irq_desc[PLD_IRQ_SNDINT].depth = 1;     /* disable nested irq */
+       set_irq_chip_and_handler(PLD_IRQ_SNDINT, &m32700ut_pld_irq_type,
+                                handle_level_irq);
        pld_icu_data[irq2pldirq(PLD_IRQ_SNDINT)].icucr
                = PLD_ICUCR_ISMOD01;    /* 'L' level sense */
        disable_m32700ut_pld_irq(PLD_IRQ_SNDINT);
index 7085bd51668b96d101c44b2506cf730812a23eaa..cb88aa96c4f1adaa21b3d609a965107343f9def2 100644 (file)
@@ -2,21 +2,22 @@
 #define _M68KNOMMU_CACHEFLUSH_H
 
 /*
- * (C) Copyright 2000-2004, Greg Ungerer <gerg@snapgear.com>
+ * (C) Copyright 2000-2010, Greg Ungerer <gerg@snapgear.com>
  */
 #include <linux/mm.h>
+#include <asm/mcfsim.h>
 
 #define flush_cache_all()                      __flush_cache_all()
 #define flush_cache_mm(mm)                     do { } while (0)
 #define flush_cache_dup_mm(mm)                 do { } while (0)
-#define flush_cache_range(vma, start, end)     __flush_cache_all()
+#define flush_cache_range(vma, start, end)     do { } while (0)
 #define flush_cache_page(vma, vmaddr)          do { } while (0)
-#define flush_dcache_range(start,len)          __flush_cache_all()
+#define flush_dcache_range(start, len)         __flush_dcache_all()
 #define ARCH_IMPLEMENTS_FLUSH_DCACHE_PAGE 0
 #define flush_dcache_page(page)                        do { } while (0)
 #define flush_dcache_mmap_lock(mapping)                do { } while (0)
 #define flush_dcache_mmap_unlock(mapping)      do { } while (0)
-#define flush_icache_range(start,len)          __flush_cache_all()
+#define flush_icache_range(start, len)         __flush_icache_all()
 #define flush_icache_page(vma,pg)              do { } while (0)
 #define flush_icache_user_range(vma,pg,adr,len)        do { } while (0)
 #define flush_cache_vmap(start, end)           do { } while (0)
 #define copy_from_user_page(vma, page, vaddr, dst, src, len) \
        memcpy(dst, src, len)
 
+void mcf_cache_push(void);
+
 static inline void __flush_cache_all(void)
 {
-#if defined(CONFIG_M5407) || defined(CONFIG_M548x)
-       /*
-        *      Use cpushl to push and invalidate all cache lines.
-        *      Gas doesn't seem to know how to generate the ColdFire
-        *      cpushl instruction... Oh well, bit stuff it for now.
-        */
-       __asm__ __volatile__ (
-               "nop\n\t"
-               "clrl   %%d0\n\t"
-               "1:\n\t"
-               "movel  %%d0,%%a0\n\t"
-               "2:\n\t"
-               ".word  0xf468\n\t"
-               "addl   #0x10,%%a0\n\t"
-               "cmpl   #0x00000800,%%a0\n\t"
-               "blt    2b\n\t"
-               "addql  #1,%%d0\n\t"
-               "cmpil  #4,%%d0\n\t"
-               "bne    1b\n\t"
-               "movel  #0xb6088500,%%d0\n\t"
-               "movec  %%d0,%%CACR\n\t"
-               : : : "d0", "a0" );
-#endif /* CONFIG_M5407 */
-#if defined(CONFIG_M523x) || defined(CONFIG_M527x)
-       __asm__ __volatile__ (
-               "movel  #0x81400100, %%d0\n\t"
-               "movec  %%d0, %%CACR\n\t"
-               "nop\n\t"
-               : : : "d0" );
-#endif /* CONFIG_M523x || CONFIG_M527x */
-#if defined(CONFIG_M528x)
-       __asm__ __volatile__ (
-               "movel  #0x81000200, %%d0\n\t"
-               "movec  %%d0, %%CACR\n\t"
-               "nop\n\t"
-               : : : "d0" );
-#endif /* CONFIG_M528x */
-#if defined(CONFIG_M5206) || defined(CONFIG_M5206e) || defined(CONFIG_M5272)
+#ifdef CACHE_PUSH
+       mcf_cache_push();
+#endif
+#ifdef CACHE_INVALIDATE
        __asm__ __volatile__ (
-               "movel  #0x81000100, %%d0\n\t"
+               "movel  %0, %%d0\n\t"
                "movec  %%d0, %%CACR\n\t"
                "nop\n\t"
-               : : : "d0" );
-#endif /* CONFIG_M5206 || CONFIG_M5206e || CONFIG_M5272 */
-#ifdef CONFIG_M5249
+               : : "i" (CACHE_INVALIDATE) : "d0" );
+#endif
+}
+
+/*
+ * Some ColdFire parts implement separate instruction and data caches,
+ * on those we should just flush the appropriate cache. If we don't need
+ * to do any specific flushing then this will be optimized away.
+ */
+static inline void __flush_icache_all(void)
+{
+#ifdef CACHE_INVALIDATEI
        __asm__ __volatile__ (
-               "movel  #0xa1000200, %%d0\n\t"
+               "movel  %0, %%d0\n\t"
                "movec  %%d0, %%CACR\n\t"
                "nop\n\t"
-               : : : "d0" );
-#endif /* CONFIG_M5249 */
-#ifdef CONFIG_M532x
+               : : "i" (CACHE_INVALIDATEI) : "d0" );
+#endif
+}
+
+static inline void __flush_dcache_all(void)
+{
+#ifdef CACHE_PUSH
+       mcf_cache_push();
+#endif
+#ifdef CACHE_INVALIDATED
        __asm__ __volatile__ (
-               "movel  #0x81000200, %%d0\n\t"
+               "movel  %0, %%d0\n\t"
                "movec  %%d0, %%CACR\n\t"
                "nop\n\t"
-               : : : "d0" );
-#endif /* CONFIG_M532x */
+               : : "i" (CACHE_INVALIDATED) : "d0" );
+#else
+       /* Flush the wrtite buffer */
+       __asm__ __volatile__ ( "nop" );
+#endif
 }
-
 #endif /* _M68KNOMMU_CACHEFLUSH_H */
index 3b0a34d0fe33400c66e68462375ead78b2a1cb5f..213028cbe110b459063cf9abf3af28ce178f4bdc 100644 (file)
@@ -32,7 +32,7 @@
  */
 #define        MCF_MBAR        0x10000000
 #define        MCF_MBAR2       0x80000000
-#if defined(CONFIG_M548x)
+#if defined(CONFIG_M54xx)
 #define        MCF_IPSBAR      MCF_MBAR
 #elif defined(CONFIG_M520x)
 #define        MCF_IPSBAR      0xFC000000
index 26be277394f9fc647931f2145e67173d648c20f2..627d69bacc58c6afc2412c13fa6f01282c3ada4d 100644 (file)
  */
 
 #ifdef CONFIG_COLDFIRE
+#ifdef CONFIG_COLDFIRE_SW_A7
 /*
- * This is made a little more tricky on the ColdFire. There is no
- * separate kernel and user stack pointers. Need to artificially
+ * This is made a little more tricky on older ColdFires. There is no
+ * separate supervisor and user stack pointers. Need to artificially
  * construct a usp in software... When doing this we need to disable
- * interrupts, otherwise bad things could happen.
+ * interrupts, otherwise bad things will happen.
  */
+.globl sw_usp
+.globl sw_ksp
+
 .macro SAVE_ALL
        move    #0x2700,%sr             /* disable intrs */
        btst    #5,%sp@(2)              /* from user? */
@@ -74,9 +78,7 @@
        7:
 .endm
 
-.macro RESTORE_ALL
-       btst    #5,%sp@(PT_SR)          /* going user? */
-       bnes    8f                      /* no, skip */
+.macro RESTORE_USER
        move    #0x2700,%sr             /* disable intrs */
        movel   sw_usp,%a0              /* get usp */
        movel   %sp@(PT_OFF_PC),%a0@-   /* copy exception program counter */
        subql   #8,sw_usp               /* set exception */
        movel   sw_usp,%sp              /* restore usp */
        rte
-       8:
-       moveml  %sp@,%d1-%d5/%a0-%a2
-       lea     %sp@(32),%sp            /* space for 8 regs */
-       movel   %sp@+,%d0
-       addql   #4,%sp                  /* orig d0 */
-       addl    %sp@+,%sp               /* stkadj */
-       rte
 .endm
 
+.macro RDUSP
+       movel   sw_usp,%a2
+.endm
+
+.macro WRUSP
+       movel   %a0,sw_usp
+.endm
+
+#else /* !CONFIG_COLDFIRE_SW_A7 */
 /*
- * Quick exception save, use current stack only.
+ * Modern ColdFire parts have separate supervisor and user stack
+ * pointers. Simple load and restore macros for this case.
  */
-.macro SAVE_LOCAL
+.macro SAVE_ALL
        move    #0x2700,%sr             /* disable intrs */
        clrl    %sp@-                   /* stkadj */
        movel   %d0,%sp@-               /* orig d0 */
        moveml  %d1-%d5/%a0-%a2,%sp@
 .endm
 
-.macro RESTORE_LOCAL
+.macro RESTORE_USER
        moveml  %sp@,%d1-%d5/%a0-%a2
        lea     %sp@(32),%sp            /* space for 8 regs */
        movel   %sp@+,%d0
        rte
 .endm
 
+.macro RDUSP
+       /*move  %usp,%a2*/
+       .word   0x4e6a
+.endm
+
+.macro WRUSP
+       /*move  %a0,%usp*/
+       .word   0x4e60
+.endm
+
+#endif /* !CONFIG_COLDFIRE_SW_A7 */
+
 .macro SAVE_SWITCH_STACK
        lea     %sp@(-24),%sp           /* 6 regs */
        moveml  %a3-%a6/%d6-%d7,%sp@
        lea     %sp@(24),%sp            /* 6 regs */
 .endm
 
-/*
- * Software copy of the user and kernel stack pointers... Ugh...
- * Need these to get around ColdFire not having separate kernel
- * and user stack pointers.
- */
-.globl sw_usp
-.globl sw_ksp
-
 #else /* !CONFIG_COLDFIRE */
 
 /*
        moveml  %sp@+,%a3-%a6/%d6-%d7
 .endm
 
-#endif /* !CONFIG_COLDFIRE */
+#endif /* !COLDFIRE_SW_A7 */
 #endif /* __ASSEMBLY__ */
 #endif /* __M68KNOMMU_ENTRY_H */
index 1b57adbafad54b14ef1b651a5b82fdf295bf8d47..c64c7b74cf86819a42d670ca47b191e53d729006 100644 (file)
@@ -37,7 +37,7 @@
 #if defined(CONFIG_M5206) || defined(CONFIG_M5206e) || \
     defined(CONFIG_M520x) || defined(CONFIG_M523x) || \
     defined(CONFIG_M527x) || defined(CONFIG_M528x) || \
-    defined(CONFIG_M532x) || defined(CONFIG_M548x)
+    defined(CONFIG_M532x) || defined(CONFIG_M54xx)
 
 /* These parts have GPIO organized by 8 bit ports */
 
index 6e2413e518cb2da8815f1af905d7c4720fceff50..cf20f3097af6f3e31c7c6ab76b7363b9dcc99615 100644 (file)
@@ -145,7 +145,6 @@ static inline void io_insl(unsigned int addr, void *buf, int len)
 #define IOMAP_WRITETHROUGH             3
 
 extern void *__ioremap(unsigned long physaddr, unsigned long size, int cacheflag);
-extern void __iounmap(void *addr, unsigned long size);
 
 static inline void *ioremap(unsigned long physaddr, unsigned long size)
 {
index 9c384e294af9b172e4e258226739aab9b82c3552..561b03b5ddf8474b6b231c4b1233d720d5cc31e2 100644 (file)
 #define        m5206sim_h
 /****************************************************************************/
 
+#define        CPU_NAME                "COLDFIRE(m5206)"
+#define        CPU_INSTR_PER_JIFFY     3
+
+#include <asm/m52xxacr.h>
 
 /*
  *     Define the 5206 SIM register set addresses.
 #define        MCFSIM_PADDR            (MCF_MBAR + 0x1c5)      /* Parallel Direction (r/w) */
 #define        MCFSIM_PADAT            (MCF_MBAR + 0x1c9)      /* Parallel Port Value (r/w) */
 
+#if defined(CONFIG_NETtel)
+#define        MCFUART_BASE1           0x180           /* Base address of UART1 */
+#define        MCFUART_BASE2           0x140           /* Base address of UART2 */
+#else
+#define        MCFUART_BASE1           0x140           /* Base address of UART1 */
+#define        MCFUART_BASE2           0x180           /* Base address of UART2 */
+#endif
+
 /*
  *     Define system peripheral IRQ usage.
  */
 #define        MCF_IRQ_PROFILER        31              /* Timer1, Level 7 */
 
 /*
- * Generic GPIO
+ *     Generic GPIO
  */
 #define MCFGPIO_PIN_MAX                8
 #define MCFGPIO_IRQ_VECBASE    -1
index db824a4b136ea5a8bf39f4da57b2cdc068e6d97b..88ed8239fe4ec9517f79d8285a87f3932cf6de06 100644 (file)
 #define m520xsim_h
 /****************************************************************************/
 
+#define        CPU_NAME                "COLDFIRE(m520x)"
+#define        CPU_INSTR_PER_JIFFY     3
+
+#include <asm/m52xxacr.h>
+
 /*
  *  Define the 520x SIM register set addresses.
  */
@@ -54,6 +59,9 @@
 #define MCFSIM_SDCS0        0x000a8110 /* SDRAM Chip Select 0 Configuration */
 #define MCFSIM_SDCS1        0x000a8114 /* SDRAM Chip Select 1 Configuration */
 
+/*
+ * EPORT and GPIO registers.
+ */
 #define MCFEPORT_EPDDR                 0xFC088002
 #define MCFEPORT_EPDR                  0xFC088004
 #define MCFEPORT_EPPDR                 0xFC088005
 #define MCFGPIO_PCLRR_UART             0xFC0A402A
 #define MCFGPIO_PCLRR_FECH             0xFC0A402B
 #define MCFGPIO_PCLRR_FECL             0xFC0A402C
+
 /*
  * Generic GPIO support
  */
 #define MCFGPIO_PIN_MAX                        80
 #define MCFGPIO_IRQ_MAX                        8
 #define MCFGPIO_IRQ_VECBASE            MCFINT_VECBASE
-/****************************************************************************/
 
 #define MCF_GPIO_PAR_UART                   (0xA4036)
 #define MCF_GPIO_PAR_FECI2C                 (0xA4033)
 #define MCF_GPIO_PAR_FECI2C_PAR_SDA_URXD2   (0x02)
 #define MCF_GPIO_PAR_FECI2C_PAR_SCL_UTXD2   (0x04)
 
+/*
+ *  UART module.
+ */
+#define MCFUART_BASE1          0x60000         /* Base address of UART1 */
+#define MCFUART_BASE2          0x64000         /* Base address of UART2 */
+#define MCFUART_BASE3          0x68000         /* Base address of UART2 */
+
 /*
  *  Reset Controll Unit.
  */
index e8d06b24a48ea4e65478d9ef043a9cfcf1eb83d6..4ad7a00257a820a1bff3df7946873e62cc56fed7 100644 (file)
 #define        m523xsim_h
 /****************************************************************************/
 
+#define        CPU_NAME                "COLDFIRE(m523x)"
+#define        CPU_INSTR_PER_JIFFY     3
+
+#include <asm/m52xxacr.h>
 
 /*
  *     Define the 523x SIM register set addresses.
 #define        MCF_RCR_SWRESET         0x80            /* Software reset bit */
 #define        MCF_RCR_FRCSTOUT        0x40            /* Force external reset */
 
+/*
+ *  UART module.
+ */
+#define MCFUART_BASE1          0x200           /* Base address of UART1 */
+#define MCFUART_BASE2          0x240           /* Base address of UART2 */
+#define MCFUART_BASE3          0x280           /* Base address of UART3 */
+
 #define MCFGPIO_PODR_ADDR      (MCF_IPSBAR + 0x100000)
 #define MCFGPIO_PODR_DATAH     (MCF_IPSBAR + 0x100001)
 #define MCFGPIO_PODR_DATAL     (MCF_IPSBAR + 0x100002)
index 79b7b402f3c984a48eda4aedb65f20995e672a50..4908b118f2fd507d4eb648233816e235ae3234f5 100644 (file)
 #define        m5249sim_h
 /****************************************************************************/
 
+#define        CPU_NAME                "COLDFIRE(m5249)"
+#define        CPU_INSTR_PER_JIFFY     3
+
+#include <asm/m52xxacr.h>
+
 /*
  *     Define the 5249 SIM register set addresses.
  */
 #define MCFSIM_DACR1           0x110           /* DRAM 1 Addr and Ctrl (r/w) */
 #define MCFSIM_DMR1            0x114           /* DRAM 1 Mask reg (r/w) */
 
+/*
+ *     UART module.
+ */
+#define MCFUART_BASE1          0x1c0           /* Base address of UART1 */
+#define MCFUART_BASE2          0x200           /* Base address of UART2 */
 
 /*
  *     Some symbol defines for the above...
index df3332c2317de8ae95eff60752596b5e0b962793..b7cc50abc8315e3f677c4a54e0d576b8d1709514 100644 (file)
 #define        m5272sim_h
 /****************************************************************************/
 
+#define        CPU_NAME                "COLDFIRE(m5272)"
+#define        CPU_INSTR_PER_JIFFY     3
+
+#include <asm/m52xxacr.h>
+
 /*
  *     Define the 5272 SIM register set addresses.
  */
@@ -62,6 +67,9 @@
 #define        MCFSIM_DCMR1            0x5c            /* DRAM 1 Mask reg (r/w) */
 #define        MCFSIM_DCCR1            0x63            /* DRAM 1 Control reg (r/w) */
 
+#define        MCFUART_BASE1           0x100           /* Base address of UART1 */
+#define        MCFUART_BASE2           0x140           /* Base address of UART2 */
+
 #define        MCFSIM_PACNT            (MCF_MBAR + 0x80) /* Port A Control (r/w) */
 #define        MCFSIM_PADDR            (MCF_MBAR + 0x84) /* Port A Direction (r/w) */
 #define        MCFSIM_PADAT            (MCF_MBAR + 0x86) /* Port A Data (r/w) */
index 1feb46f108ce79bdbf5561f29a084ae87ed53107..e8042e8bc003fc726f0d6bc106e233e6da309dbe 100644 (file)
 #define        m527xsim_h
 /****************************************************************************/
 
+#define        CPU_NAME                "COLDFIRE(m527x)"
+#define        CPU_INSTR_PER_JIFFY     3
+
+#include <asm/m52xxacr.h>
 
 /*
  *     Define the 5270/5271 SIM register set addresses.
 #define        MCFSIM_DMR1             0x5c            /* SDRAM address mask 1 */
 #endif
 
+/*
+ *     UART module.
+ */
+#define MCFUART_BASE1          0x200           /* Base address of UART1 */
+#define MCFUART_BASE2          0x240           /* Base address of UART2 */
+#define MCFUART_BASE3          0x280           /* Base address of UART3 */
 
 #ifdef CONFIG_M5271
 #define MCFGPIO_PODR_ADDR      (MCF_IPSBAR + 0x100000)
index 891cbedad97269ad99fa0cf4e885a42b0610491a..a6d2f4d9aaa059acb55b889f3d1967ad6ed18ef9 100644 (file)
 #define        m528xsim_h
 /****************************************************************************/
 
+#define        CPU_NAME                "COLDFIRE(m528x)"
+#define        CPU_INSTR_PER_JIFFY     3
+
+#include <asm/m52xxacr.h>
 
 /*
  *     Define the 5280/5282 SIM register set addresses.
 #define        MCFSIM_DACR1            0x50            /* SDRAM base address 1 */
 #define        MCFSIM_DMR1             0x54            /* SDRAM address mask 1 */
 
+/*
+ *     UART module.
+ */
+#define MCFUART_BASE1          0x200           /* Base address of UART1 */
+#define MCFUART_BASE2          0x240           /* Base address of UART2 */
+#define MCFUART_BASE3          0x280           /* Base address of UART3 */
+
 /*
  *     GPIO registers
  */
diff --git a/arch/m68k/include/asm/m52xxacr.h b/arch/m68k/include/asm/m52xxacr.h
new file mode 100644 (file)
index 0000000..abc391a
--- /dev/null
@@ -0,0 +1,94 @@
+/****************************************************************************/
+
+/*
+ * m52xxacr.h -- ColdFire version 2 core cache support
+ *
+ * (C) Copyright 2010, Greg Ungerer <gerg@snapgear.com>
+ */
+
+/****************************************************************************/
+#ifndef m52xxacr_h
+#define m52xxacr_h
+/****************************************************************************/
+
+/*
+ * All varients of the ColdFire using version 2 cores have a similar
+ * cache setup. Although not absolutely identical the cache register
+ * definitions are compatible for all of them. Mostly they support a
+ * configurable cache memory that can be instruction only, data only,
+ * or split instruction and data. The exception is the very old version 2
+ * core based parts, like the 5206(e), 5249 and 5272, which are instruction
+ * cache only. Cache size varies from 2k up to 16k.
+ */
+
+/*
+ * Define the Cache Control register flags.
+ */
+#define CACR_CENB      0x80000000      /* Enable cache */
+#define CACR_CDPI      0x10000000      /* Disable invalidation by CPUSHL */
+#define CACR_CFRZ      0x08000000      /* Cache freeze mode */
+#define CACR_CINV      0x01000000      /* Invalidate cache */
+#define CACR_DISI      0x00800000      /* Disable instruction cache */
+#define CACR_DISD      0x00400000      /* Disable data cache */
+#define CACR_INVI      0x00200000      /* Invalidate instruction cache */
+#define CACR_INVD      0x00100000      /* Invalidate data cache */
+#define CACR_CEIB      0x00000400      /* Non-cachable instruction burst */
+#define CACR_DCM       0x00000200      /* Default cache mode */
+#define CACR_DBWE      0x00000100      /* Buffered write enable */
+#define CACR_DWP       0x00000020      /* Write protection */
+#define CACR_EUSP      0x00000010      /* Enable separate user a7 */
+
+/*
+ * Define the Access Control register flags.
+ */
+#define ACR_BASE_POS   24              /* Address Base (upper 8 bits) */
+#define ACR_MASK_POS   16              /* Address Mask (next 8 bits) */
+#define ACR_ENABLE     0x00008000      /* Enable this ACR */
+#define ACR_USER       0x00000000      /* Allow only user accesses */
+#define ACR_SUPER      0x00002000      /* Allow supervisor access only */
+#define ACR_ANY                0x00004000      /* Allow any access type */
+#define ACR_CENB       0x00000000      /* Caching of region enabled */
+#define ACR_CDIS       0x00000040      /* Caching of region disabled */
+#define ACR_BWE                0x00000020      /* Write buffer enabled */
+#define ACR_WPROTECT   0x00000004      /* Write protect region */
+
+/*
+ * Set the cache controller settings we will use. On the cores that support
+ * a split cache configuration we allow all the combinations at Kconfig
+ * time. For those cores that only have an instruction cache we just set
+ * that as on.
+ */
+#if defined(CONFIG_CACHE_I)
+#define CACHE_TYPE     (CACR_DISD + CACR_EUSP)
+#define CACHE_INVTYPEI 0
+#elif defined(CONFIG_CACHE_D)
+#define CACHE_TYPE     (CACR_DISI + CACR_EUSP)
+#define CACHE_INVTYPED 0
+#elif defined(CONFIG_CACHE_BOTH)
+#define CACHE_TYPE     CACR_EUSP
+#define CACHE_INVTYPEI CACR_INVI
+#define CACHE_INVTYPED CACR_INVD
+#else
+/* This is the instruction cache only devices (no split cache, no eusp) */
+#define CACHE_TYPE     0
+#define CACHE_INVTYPEI 0
+#endif
+
+#define CACHE_INIT     (CACR_CINV + CACHE_TYPE)
+#define CACHE_MODE     (CACR_CENB + CACHE_TYPE + CACR_DCM)
+
+#define CACHE_INVALIDATE  (CACHE_MODE + CACR_CINV)
+#if defined(CACHE_INVTYPEI)
+#define CACHE_INVALIDATEI (CACHE_MODE + CACR_CINV + CACHE_INVTYPEI)
+#endif
+#if defined(CACHE_INVTYPED)
+#define CACHE_INVALIDATED (CACHE_MODE + CACR_CINV + CACHE_INVTYPED)
+#endif
+
+#define ACR0_MODE      ((CONFIG_RAMBASE & 0xff000000) + \
+                        (0x000f0000) + \
+                        (ACR_ENABLE + ACR_ANY + ACR_CENB + ACR_BWE))
+#define ACR1_MODE      0
+
+/****************************************************************************/
+#endif  /* m52xxsim_h */
index c6830e5b54ce0bdb0dae58f95b03505bc609321e..0bf57397e7a9916b33bc2d193e8198a203b4a45c 100644 (file)
 #define        m5307sim_h
 /****************************************************************************/
 
+#define        CPU_NAME                "COLDFIRE(m5307)"
+#define        CPU_INSTR_PER_JIFFY     3
+
+#include <asm/m53xxacr.h>
+
 /*
  *     Define the 5307 SIM register set addresses.
  */
 #define        MCFSIM_PADDR            (MCF_MBAR + 0x244)
 #define        MCFSIM_PADAT            (MCF_MBAR + 0x248)
 
+/*
+ *  UART module.
+ */
+#if defined(CONFIG_NETtel) || defined(CONFIG_SECUREEDGEMP3)
+#define MCFUART_BASE1          0x200           /* Base address of UART1 */
+#define MCFUART_BASE2          0x1c0           /* Base address of UART2 */
+#else
+#define MCFUART_BASE1          0x1c0           /* Base address of UART1 */
+#define MCFUART_BASE2          0x200           /* Base address of UART2 */
+#endif
+
 /*
  * Generic GPIO support
  */
 #define        MCF_IRQ_TIMER           30              /* Timer0, Level 6 */
 #define        MCF_IRQ_PROFILER        31              /* Timer1, Level 7 */
 
-/*
- *     Define the Cache register flags.
- */
-#define        CACR_EC                 (1<<31)
-#define        CACR_ESB                (1<<29)
-#define        CACR_DPI                (1<<28)
-#define        CACR_HLCK               (1<<27)
-#define        CACR_CINVA              (1<<24)
-#define        CACR_DNFB               (1<<10)
-#define        CACR_DCM_WTHRU          (0<<8)
-#define        CACR_DCM_WBACK          (1<<8)
-#define        CACR_DCM_OFF_PRE        (2<<8)
-#define        CACR_DCM_OFF_IMP        (3<<8)
-#define        CACR_DW                 (1<<5)
-
-#define        ACR_BASE_POS            24
-#define        ACR_MASK_POS            16
-#define        ACR_ENABLE              (1<<15)
-#define        ACR_USER                (0<<13)
-#define        ACR_SUPER               (1<<13)
-#define        ACR_ANY                 (2<<13)
-#define        ACR_CM_WTHRU            (0<<5)
-#define        ACR_CM_WBACK            (1<<5)
-#define        ACR_CM_OFF_PRE          (2<<5)
-#define        ACR_CM_OFF_IMP          (3<<5)
-#define        ACR_WPROTECT            (1<<2)
-
 /****************************************************************************/
 #endif /* m5307sim_h */
index c4bf1c81e3cfa5255901fa2c9c2b817d2173e968..e6470f8ca3248604108235abebe509c31dde2961 100644 (file)
@@ -9,6 +9,11 @@
 #define        m532xsim_h
 /****************************************************************************/
 
+#define        CPU_NAME                "COLDFIRE(m532x)"
+#define        CPU_INSTR_PER_JIFFY     3
+
+#include <asm/m53xxacr.h>
+
 #define MCF_REG32(x) (*(volatile unsigned long  *)(x))
 #define MCF_REG16(x) (*(volatile unsigned short *)(x))
 #define MCF_REG08(x) (*(volatile unsigned char  *)(x))
 #define        MCF_IRQ_PROFILER        (64 + 33)       /* Timer1 */
 
 /*
- *     Define the Cache register flags.
+ *  UART module.
  */
-#define        CACR_EC                 (1<<31)
-#define        CACR_ESB                (1<<29)
-#define        CACR_DPI                (1<<28)
-#define        CACR_HLCK               (1<<27)
-#define        CACR_CINVA              (1<<24)
-#define        CACR_DNFB               (1<<10)
-#define        CACR_DCM_WTHRU          (0<<8)
-#define        CACR_DCM_WBACK          (1<<8)
-#define        CACR_DCM_OFF_PRE        (2<<8)
-#define        CACR_DCM_OFF_IMP        (3<<8)
-#define        CACR_DW                 (1<<5)
-
-#define        ACR_BASE_POS            24
-#define        ACR_MASK_POS            16
-#define        ACR_ENABLE              (1<<15)
-#define        ACR_USER                (0<<13)
-#define        ACR_SUPER               (1<<13)
-#define        ACR_ANY                 (2<<13)
-#define        ACR_CM_WTHRU            (0<<5)
-#define        ACR_CM_WBACK            (1<<5)
-#define        ACR_CM_OFF_PRE          (2<<5)
-#define        ACR_CM_OFF_IMP          (3<<5)
-#define        ACR_WPROTECT            (1<<2)
+#define MCFUART_BASE1          0xFC060000      /* Base address of UART1 */
+#define MCFUART_BASE2          0xFC064000      /* Base address of UART2 */
+#define MCFUART_BASE3          0xFC068000      /* Base address of UART3 */
 
 /*********************************************************************
  *
diff --git a/arch/m68k/include/asm/m53xxacr.h b/arch/m68k/include/asm/m53xxacr.h
new file mode 100644 (file)
index 0000000..cd952b0
--- /dev/null
@@ -0,0 +1,101 @@
+/****************************************************************************/
+
+/*
+ * m53xxacr.h -- ColdFire version 3 core cache support
+ *
+ * (C) Copyright 2010, Greg Ungerer <gerg@snapgear.com>
+ */
+
+/****************************************************************************/
+#ifndef m53xxacr_h
+#define m53xxacr_h
+/****************************************************************************/
+
+/*
+ * All varients of the ColdFire using version 3 cores have a similar
+ * cache setup. They have a unified instruction and data cache, with
+ * configurable write-through or copy-back operation.
+ */
+
+/*
+ * Define the Cache Control register flags.
+ */
+#define CACR_EC                0x80000000      /* Enable cache */
+#define CACR_ESB       0x20000000      /* Enable store buffer */
+#define CACR_DPI       0x10000000      /* Disable invalidation by CPUSHL */
+#define CACR_HLCK      0x08000000      /* Half cache lock mode */
+#define CACR_CINVA     0x01000000      /* Invalidate cache */
+#define CACR_DNFB      0x00000400      /* Inhibited fill buffer */
+#define CACR_DCM_WT    0x00000000      /* Cacheable write-through */
+#define CACR_DCM_CB    0x00000100      /* Cacheable copy-back */
+#define CACR_DCM_PRE   0x00000200      /* Cache inhibited, precise */
+#define CACR_DCM_IMPRE 0x00000300      /* Cache inhibited, imprecise */
+#define CACR_WPROTECT  0x00000020      /* Write protect*/
+#define CACR_EUSP      0x00000010      /* Eanble separate user a7 */
+
+/*
+ * Define the Access Control register flags.
+ */
+#define ACR_BASE_POS   24              /* Address Base (upper 8 bits) */
+#define ACR_MASK_POS   16              /* Address Mask (next 8 bits) */
+#define ACR_ENABLE     0x00008000      /* Enable this ACR */
+#define ACR_USER       0x00000000      /* Allow only user accesses */
+#define ACR_SUPER      0x00002000      /* Allow supervisor access only */
+#define ACR_ANY                0x00004000      /* Allow any access type */
+#define ACR_CM_WT      0x00000000      /* Cacheable, write-through */
+#define ACR_CM_CB      0x00000020      /* Cacheable, copy-back */
+#define ACR_CM_PRE     0x00000040      /* Cache inhibited, precise */
+#define ACR_CM_IMPRE   0x00000060      /* Cache inhibited, imprecise */
+#define ACR_WPROTECT   0x00000004      /* Write protect region */
+
+/*
+ * Define the cache type and arrangement (needed for pushes).
+ */
+#if defined(CONFIG_M5307)
+#define        CACHE_SIZE      0x2000          /* 8k of unified cache */
+#define        ICACHE_SIZE     CACHE_SIZE
+#define        DCACHE_SIZE     CACHE_SIZE
+#elif defined(CONFIG_M532x)
+#define        CACHE_SIZE      0x4000          /* 32k of unified cache */
+#define        ICACHE_SIZE     CACHE_SIZE
+#define        DCACHE_SIZE     CACHE_SIZE
+#endif
+
+#define        CACHE_LINE_SIZE 16              /* 16 byte line size */
+#define        CACHE_WAYS      4               /* 4 ways - set associative */
+
+/*
+ * Set the cache controller settings we will use. This default in the
+ * CACR is cache inhibited, we use the ACR register to set cacheing
+ * enabled on the regions we want (eg RAM).
+ */
+#if defined(CONFIG_CACHE_COPYBACK)
+#define CACHE_TYPE     ACR_CM_CB
+#define CACHE_PUSH
+#else
+#define CACHE_TYPE     ACR_CM_WT
+#endif
+
+#ifdef CONFIG_COLDFIRE_SW_A7
+#define CACHE_MODE     (CACR_EC + CACR_ESB + CACR_DCM_PRE)
+#else
+#define CACHE_MODE     (CACR_EC + CACR_ESB + CACR_DCM_PRE + CACR_EUSP)
+#endif
+
+/*
+ * Unified cache means we will never need to flush for coherency of
+ * instruction fetch. We will need to flush to maintain memory/DMA
+ * coherency though in all cases. And for copyback caches we will need
+ * to push cached data as well.
+ */
+#define CACHE_INIT       CACR_CINVA
+#define CACHE_INVALIDATE  CACR_CINVA
+#define CACHE_INVALIDATED CACR_CINVA
+
+#define ACR0_MODE      ((CONFIG_RAMBASE & 0xff000000) + \
+                        (0x000f0000) + \
+                        (ACR_ENABLE + ACR_ANY + CACHE_TYPE))
+#define ACR1_MODE      0
+
+/****************************************************************************/
+#endif  /* m53xxsim_h */
index c399abbf953ce57f1d771dabad967de88e7022f4..75f5c28a551d996c0dd128cef99fcb56fe2095c0 100644 (file)
 #define        m5407sim_h
 /****************************************************************************/
 
+#define        CPU_NAME                "COLDFIRE(m5407)"
+#define        CPU_INSTR_PER_JIFFY     3
+
+#include <asm/m54xxacr.h>
+
 /*
  *     Define the 5407 SIM register set addresses.
  */
@@ -73,6 +78,9 @@
 #define MCFSIM_DACR1           0x110           /* DRAM 1 Addr and Ctrl (r/w) */
 #define MCFSIM_DMR1            0x114           /* DRAM 1 Mask reg (r/w) */
 
+#define MCFUART_BASE1          0x1c0           /* Base address of UART1 */
+#define MCFUART_BASE2          0x200           /* Base address of UART2 */
+
 #define        MCFSIM_PADDR            (MCF_MBAR + 0x244)
 #define        MCFSIM_PADAT            (MCF_MBAR + 0x248)
 
 #define        MCF_IRQ_TIMER           30              /* Timer0, Level 6 */
 #define        MCF_IRQ_PROFILER        31              /* Timer1, Level 7 */
 
-/*
- *     Define the Cache register flags.
- */
-#define        CACR_DEC                0x80000000      /* Enable data cache */
-#define        CACR_DWP                0x40000000      /* Data write protection */
-#define        CACR_DESB               0x20000000      /* Enable data store buffer */
-#define        CACR_DDPI               0x10000000      /* Disable CPUSHL */
-#define        CACR_DHCLK              0x08000000      /* Half data cache lock mode */
-#define        CACR_DDCM_WT            0x00000000      /* Write through cache*/
-#define        CACR_DDCM_CP            0x02000000      /* Copyback cache */
-#define        CACR_DDCM_P             0x04000000      /* No cache, precise */
-#define        CACR_DDCM_IMP           0x06000000      /* No cache, imprecise */
-#define        CACR_DCINVA             0x01000000      /* Invalidate data cache */
-#define        CACR_BEC                0x00080000      /* Enable branch cache */
-#define        CACR_BCINVA             0x00040000      /* Invalidate branch cache */
-#define        CACR_IEC                0x00008000      /* Enable instruction cache */
-#define        CACR_DNFB               0x00002000      /* Inhibited fill buffer */
-#define        CACR_IDPI               0x00001000      /* Disable CPUSHL */
-#define        CACR_IHLCK              0x00000800      /* Intruction cache half lock */
-#define        CACR_IDCM               0x00000400      /* Intruction cache inhibit */
-#define        CACR_ICINVA             0x00000100      /* Invalidate instr cache */
-
-#define        ACR_BASE_POS            24              /* Address Base */
-#define        ACR_MASK_POS            16              /* Address Mask */
-#define        ACR_ENABLE              0x00008000      /* Enable address */
-#define        ACR_USER                0x00000000      /* User mode access only */
-#define        ACR_SUPER               0x00002000      /* Supervisor mode only */
-#define        ACR_ANY                 0x00004000      /* Match any access mode */
-#define        ACR_CM_WT               0x00000000      /* Write through mode */
-#define        ACR_CM_CP               0x00000020      /* Copyback mode */
-#define        ACR_CM_OFF_PRE          0x00000040      /* No cache, precise */
-#define        ACR_CM_OFF_IMP          0x00000060      /* No cache, imprecise */
-#define        ACR_WPROTECT            0x00000004      /* Write protect */
-
 /****************************************************************************/
 #endif /* m5407sim_h */
diff --git a/arch/m68k/include/asm/m54xxacr.h b/arch/m68k/include/asm/m54xxacr.h
new file mode 100644 (file)
index 0000000..16a1835
--- /dev/null
@@ -0,0 +1,97 @@
+/*
+ * Bit definitions for the MCF54xx ACR and CACR registers.
+ */
+
+#ifndef        m54xxacr_h
+#define m54xxacr_h
+
+/*
+ *     Define the Cache register flags.
+ */
+#define CACR_DEC       0x80000000      /* Enable data cache */
+#define CACR_DWP       0x40000000      /* Data write protection */
+#define CACR_DESB      0x20000000      /* Enable data store buffer */
+#define CACR_DDPI      0x10000000      /* Disable invalidation by CPUSHL */
+#define CACR_DHCLK     0x08000000      /* Half data cache lock mode */
+#define CACR_DDCM_WT   0x00000000      /* Write through cache*/
+#define CACR_DDCM_CP   0x02000000      /* Copyback cache */
+#define CACR_DDCM_P    0x04000000      /* No cache, precise */
+#define CACR_DDCM_IMP  0x06000000      /* No cache, imprecise */
+#define CACR_DCINVA    0x01000000      /* Invalidate data cache */
+#define CACR_BEC       0x00080000      /* Enable branch cache */
+#define CACR_BCINVA    0x00040000      /* Invalidate branch cache */
+#define CACR_IEC       0x00008000      /* Enable instruction cache */
+#define CACR_DNFB      0x00002000      /* Inhibited fill buffer */
+#define CACR_IDPI      0x00001000      /* Disable CPUSHL */
+#define CACR_IHLCK     0x00000800      /* Intruction cache half lock */
+#define CACR_IDCM      0x00000400      /* Intruction cache inhibit */
+#define CACR_ICINVA    0x00000100      /* Invalidate instr cache */
+#define CACR_EUSP      0x00000020      /* Enable separate user a7 */
+
+#define ACR_BASE_POS   24              /* Address Base */
+#define ACR_MASK_POS   16              /* Address Mask */
+#define ACR_ENABLE     0x00008000      /* Enable address */
+#define ACR_USER       0x00000000      /* User mode access only */
+#define ACR_SUPER      0x00002000      /* Supervisor mode only */
+#define ACR_ANY                0x00004000      /* Match any access mode */
+#define ACR_CM_WT      0x00000000      /* Write through mode */
+#define ACR_CM_CP      0x00000020      /* Copyback mode */
+#define ACR_CM_OFF_PRE 0x00000040      /* No cache, precise */
+#define ACR_CM_OFF_IMP 0x00000060      /* No cache, imprecise */
+#define ACR_CM         0x00000060      /* Cache mode mask */
+#define ACR_WPROTECT   0x00000004      /* Write protect */
+
+#if defined(CONFIG_M5407)
+
+#define ICACHE_SIZE 0x4000     /* instruction - 16k */
+#define DCACHE_SIZE 0x2000     /* data - 8k */
+
+#elif defined(CONFIG_M54xx)
+
+#define ICACHE_SIZE 0x8000     /* instruction - 32k */
+#define DCACHE_SIZE 0x8000     /* data - 32k */
+
+#endif
+
+#define CACHE_LINE_SIZE 0x0010 /* 16 bytes */
+#define CACHE_WAYS 4           /* 4 ways */
+
+/*
+ *     Version 4 cores have a true harvard style separate instruction
+ *     and data cache. Enable data and instruction caches, also enable write
+ *     buffers and branch accelerator.
+ */
+/* attention : enabling CACR_DESB requires a "nop" to flush the store buffer */
+/* use '+' instead of '|' for assembler's sake */
+
+       /* Enable data cache */
+       /* Enable data store buffer */
+       /* outside ACRs : No cache, precise */
+       /* Enable instruction+branch caches */
+#if defined(CONFIG_M5407)
+#define CACHE_MODE (CACR_DEC+CACR_DESB+CACR_DDCM_P+CACR_BEC+CACR_IEC)
+#else
+#define CACHE_MODE (CACR_DEC+CACR_DESB+CACR_DDCM_P+CACR_BEC+CACR_IEC+CACR_EUSP)
+#endif
+#if defined(CONFIG_CACHE_COPYBACK)
+#define DATA_CACHE_MODE (ACR_ENABLE+ACR_ANY+ACR_CM_CP)
+#else
+#define DATA_CACHE_MODE (ACR_ENABLE+ACR_ANY+ACR_CM_WT)
+#endif
+#define INSN_CACHE_MODE (ACR_ENABLE+ACR_ANY)
+
+#define CACHE_INIT     (CACR_DCINVA+CACR_BCINVA+CACR_ICINVA)
+#define CACHE_INVALIDATE  (CACHE_MODE+CACR_DCINVA+CACR_BCINVA+CACR_ICINVA)
+#define CACHE_INVALIDATEI (CACHE_MODE+CACR_BCINVA+CACR_ICINVA)
+#define CACHE_INVALIDATED (CACHE_MODE+CACR_DCINVA)
+#define ACR0_MODE      (0x000f0000+DATA_CACHE_MODE)
+#define ACR1_MODE      0
+#define ACR2_MODE      (0x000f0000+INSN_CACHE_MODE)
+#define ACR3_MODE      0
+
+#if ((DATA_CACHE_MODE & ACR_CM) == ACR_CM_CP)
+/* Copyback cache mode must push dirty cache lines first */
+#define        CACHE_PUSH
+#endif
+
+#endif /* m54xxacr_h */
similarity index 95%
rename from arch/m68k/include/asm/m548xgpt.h
rename to arch/m68k/include/asm/m54xxgpt.h
index 33b2eef90f0a99f913873922e166233b48c5c6e6..df75dd87ae7ac7de805a0d2b56a9a945b5285892 100644 (file)
@@ -1,13 +1,13 @@
 /*
- * File:       m548xgpt.h
- * Purpose:    Register and bit definitions for the MCF548X
+ * File:       m54xxgpt.h
+ * Purpose:    Register and bit definitions for the MCF54XX
  *
  * Notes:
  *
  */
 
-#ifndef m548xgpt_h
-#define m548xgpt_h
+#ifndef m54xxgpt_h
+#define m54xxgpt_h
 
 /*********************************************************************
 *
@@ -87,4 +87,4 @@
 
 /********************************************************************/
 
-#endif /* m548xgpt_h */
+#endif /* m54xxgpt_h */
similarity index 73%
rename from arch/m68k/include/asm/m548xsim.h
rename to arch/m68k/include/asm/m54xxsim.h
index 149135ef30d23ea3b8318f13ee6c7f8075b4206d..462ae5328441ab163df7497bd4061c9573608735 100644 (file)
@@ -1,11 +1,16 @@
 /*
- *     m548xsim.h -- ColdFire 547x/548x System Integration Unit support.
+ *     m54xxsim.h -- ColdFire 547x/548x System Integration Unit support.
  */
 
-#ifndef        m548xsim_h
-#define m548xsim_h
+#ifndef        m54xxsim_h
+#define m54xxsim_h
 
-#define MCFINT_VECBASE      64
+#define        CPU_NAME                "COLDFIRE(m54xx)"
+#define        CPU_INSTR_PER_JIFFY     2
+
+#include <asm/m54xxacr.h>
+
+#define MCFINT_VECBASE         64
 
 /*
  *      Interrupt Controller Registers
 #define MCFINTC_IACKL          0x19            /* */
 #define MCFINTC_ICR0           0x40            /* Base ICR register */
 
+/*
+ *     UART module.
+ */
+#define MCFUART_BASE1          0x8600          /* Base address of UART1 */
+#define MCFUART_BASE2          0x8700          /* Base address of UART2 */
+#define MCFUART_BASE3          0x8800          /* Base address of UART3 */
+#define MCFUART_BASE4          0x8900          /* Base address of UART4 */
+
 /*
  *     Define system peripheral IRQ usage.
  */
@@ -52,4 +65,4 @@
 #define MCF_PAR_PSC_RTS_RTS    (0x30)
 #define MCF_PAR_PSC_CANRX      (0x40)
 
-#endif /* m548xsim_h */
+#endif /* m54xxsim_h */
diff --git a/arch/m68k/include/asm/mcfcache.h b/arch/m68k/include/asm/mcfcache.h
deleted file mode 100644 (file)
index f49dfc0..0000000
+++ /dev/null
@@ -1,150 +0,0 @@
-/****************************************************************************/
-
-/*
- *     mcfcache.h -- ColdFire CPU cache support code
- *
- *     (C) Copyright 2004, Greg Ungerer <gerg@snapgear.com>
- */
-
-/****************************************************************************/
-#ifndef        __M68KNOMMU_MCFCACHE_H
-#define        __M68KNOMMU_MCFCACHE_H
-/****************************************************************************/
-
-
-/*
- *     The different ColdFire families have different cache arrangments.
- *     Everything from a small instruction only cache, to configurable
- *     data and/or instruction cache, to unified instruction/data, to 
- *     harvard style separate instruction and data caches.
- */
-
-#if defined(CONFIG_M5206) || defined(CONFIG_M5206e) || defined(CONFIG_M5272)
-/*
- *     Simple version 2 core cache. These have instruction cache only,
- *     we just need to invalidate it and enable it.
- */
-.macro CACHE_ENABLE
-       movel   #0x01000000,%d0         /* invalidate cache cmd */
-       movec   %d0,%CACR               /* do invalidate cache */
-       movel   #0x80000100,%d0         /* setup cache mask */
-       movec   %d0,%CACR               /* enable cache */
-.endm
-#endif /* CONFIG_M5206 || CONFIG_M5206e || CONFIG_M5272 */
-
-#if defined(CONFIG_M523x) || defined(CONFIG_M527x)
-/*
- *     New version 2 cores have a configurable split cache arrangement.
- *     For now I am just enabling instruction cache - but ultimately I
- *     think a split instruction/data cache would be better.
- */
-.macro CACHE_ENABLE
-       movel   #0x01400000,%d0
-       movec   %d0,%CACR               /* invalidate cache */
-       nop
-       movel   #0x0000c000,%d0         /* set SDRAM cached only */
-       movec   %d0,%ACR0
-       movel   #0x00000000,%d0         /* no other regions cached */
-       movec   %d0,%ACR1
-       movel   #0x80400100,%d0         /* configure cache */
-       movec   %d0,%CACR               /* enable cache */
-       nop
-.endm
-#endif /* CONFIG_M523x || CONFIG_M527x */
-
-#if defined(CONFIG_M528x)
-.macro CACHE_ENABLE
-       nop
-       movel   #0x01000000, %d0
-       movec   %d0, %CACR              /* Invalidate cache */
-       nop
-       movel   #0x0000c020, %d0        /* Set SDRAM cached only */
-       movec   %d0, %ACR0
-       movel   #0x00000000, %d0        /* No other regions cached */
-       movec   %d0, %ACR1
-       movel   #0x80000200, %d0        /* Setup cache mask */
-       movec   %d0, %CACR              /* Enable cache */
-       nop
-.endm
-#endif /* CONFIG_M528x */
-
-#if defined(CONFIG_M5249) || defined(CONFIG_M5307)
-/*
- *     The version 3 core cache. Oddly enough the version 2 core 5249
- *     has the same SDRAM and cache setup as the version 3 cores.
- *     This is a single unified instruction/data cache.
- */
-.macro CACHE_ENABLE
-       movel   #0x01000000,%d0         /* invalidate whole cache */
-       movec   %d0,%CACR
-       nop
-#if defined(DEBUGGER_COMPATIBLE_CACHE) || defined(CONFIG_SECUREEDGEMP3)
-       movel   #0x0000c000,%d0         /* set SDRAM cached (write-thru) */
-#else
-       movel   #0x0000c020,%d0         /* set SDRAM cached (copyback) */
-#endif
-       movec   %d0,%ACR0
-       movel   #0x00000000,%d0         /* no other regions cached */
-       movec   %d0,%ACR1
-       movel   #0xa0000200,%d0         /* enable cache */
-       movec   %d0,%CACR
-       nop
-.endm
-#endif /* CONFIG_M5249 || CONFIG_M5307 */
-
-#if defined(CONFIG_M532x)
-.macro CACHE_ENABLE
-       movel   #0x01000000,%d0         /* invalidate cache cmd */
-       movec   %d0,%CACR               /* do invalidate cache */
-       nop
-       movel   #0x4001C000,%d0         /* set SDRAM cached (write-thru) */
-       movec   %d0,%ACR0
-       movel   #0x00000000,%d0         /* no other regions cached */
-       movec   %d0,%ACR1
-       movel   #0x80000200,%d0         /* setup cache mask */
-       movec   %d0,%CACR               /* enable cache */
-       nop
-.endm
-#endif /* CONFIG_M532x */
-
-#if defined(CONFIG_M5407) || defined(CONFIG_M548x)
-/*
- *     Version 4 cores have a true harvard style separate instruction
- *     and data cache. Invalidate and enable cache, also enable write
- *     buffers and branch accelerator.
- */
-.macro CACHE_ENABLE
-       movel   #0x01040100,%d0         /* invalidate whole cache */
-       movec   %d0,%CACR
-       nop
-       movel   #0x000fc000,%d0         /* set SDRAM cached only */
-       movec   %d0, %ACR0
-       movel   #0x00000000,%d0         /* no other regions cached */
-       movec   %d0, %ACR1
-       movel   #0x000fc000,%d0         /* set SDRAM cached only */
-       movec   %d0, %ACR2
-       movel   #0x00000000,%d0         /* no other regions cached */
-       movec   %d0, %ACR3
-       movel   #0xb6088400,%d0         /* enable caches */
-       movec   %d0,%CACR
-       nop
-.endm
-#endif /* CONFIG_M5407 */
-
-#if defined(CONFIG_M520x)
-.macro CACHE_ENABLE
-       move.l  #0x01000000,%d0         /* invalidate whole cache */
-       movec   %d0,%CACR
-       nop
-       move.l  #0x0000c000,%d0         /* set SDRAM cached (write-thru) */
-       movec   %d0,%ACR0
-       move.l  #0x00000000,%d0         /* no other regions cached */
-       movec   %d0,%ACR1
-       move.l  #0x80400000,%d0         /* enable 8K instruction cache */
-       movec   %d0,%CACR
-       nop
-.endm
-#endif /* CONFIG_M520x */
-
-/****************************************************************************/
-#endif /* __M68KNOMMU_MCFCACHE_H */
index 6901fd68165bd333b79b3dc1dc113b7a15275f72..ebd0304054ad7800d3ddf4355d8140d890dbe2bf 100644 (file)
@@ -41,8 +41,8 @@
 #elif defined(CONFIG_M5407)
 #include <asm/m5407sim.h>
 #include <asm/mcfintc.h>
-#elif defined(CONFIG_M548x)
-#include <asm/m548xsim.h>
+#elif defined(CONFIG_M54xx)
+#include <asm/m54xxsim.h>
 #endif
 
 /****************************************************************************/
index db72e2b889ca0aca736f226f392819bdb60d650e..2abedff0a694fb2c6579a43fe508dde548f42549 100644 (file)
 #define        mcfuart_h
 /****************************************************************************/
 
-/*
- *     Define the base address of the UARTS within the MBAR address
- *     space.
- */
-#if defined(CONFIG_M5272)
-#define        MCFUART_BASE1           0x100           /* Base address of UART1 */
-#define        MCFUART_BASE2           0x140           /* Base address of UART2 */
-#elif defined(CONFIG_M5206) || defined(CONFIG_M5206e)
-#if defined(CONFIG_NETtel)
-#define        MCFUART_BASE1           0x180           /* Base address of UART1 */
-#define        MCFUART_BASE2           0x140           /* Base address of UART2 */
-#else
-#define        MCFUART_BASE1           0x140           /* Base address of UART1 */
-#define        MCFUART_BASE2           0x180           /* Base address of UART2 */
-#endif
-#elif defined(CONFIG_M523x) || defined(CONFIG_M527x) || defined(CONFIG_M528x)
-#define MCFUART_BASE1          0x200           /* Base address of UART1 */
-#define MCFUART_BASE2          0x240           /* Base address of UART2 */
-#define MCFUART_BASE3          0x280           /* Base address of UART3 */
-#elif defined(CONFIG_M5249) || defined(CONFIG_M5307) || defined(CONFIG_M5407)
-#if defined(CONFIG_NETtel) || defined(CONFIG_SECUREEDGEMP3)
-#define MCFUART_BASE1          0x200           /* Base address of UART1 */
-#define MCFUART_BASE2          0x1c0           /* Base address of UART2 */
-#else
-#define MCFUART_BASE1          0x1c0           /* Base address of UART1 */
-#define MCFUART_BASE2          0x200           /* Base address of UART2 */
-#endif
-#elif defined(CONFIG_M520x)
-#define MCFUART_BASE1          0x60000         /* Base address of UART1 */
-#define MCFUART_BASE2          0x64000         /* Base address of UART2 */
-#define MCFUART_BASE3          0x68000         /* Base address of UART2 */
-#elif defined(CONFIG_M532x)
-#define MCFUART_BASE1          0xfc060000      /* Base address of UART1 */
-#define MCFUART_BASE2          0xfc064000      /* Base address of UART2 */
-#define MCFUART_BASE3          0xfc068000      /* Base address of UART3 */
-#elif defined(CONFIG_M548x)
-#define MCFUART_BASE1          0x8600          /* on M548x */
-#define MCFUART_BASE2          0x8700          /* on M548x */
-#define MCFUART_BASE3          0x8800          /* on M548x */
-#define MCFUART_BASE4          0x8900          /* on M548x */
-#endif
-
-
 #include <linux/serial_core.h>
 #include <linux/platform_device.h>
 
@@ -217,7 +174,7 @@ struct mcf_platform_uart {
 #define        MCFUART_URF_RXS         0xc0            /* Receiver status */
 #endif
 
-#if defined(CONFIG_M548x)
+#if defined(CONFIG_M54xx)
 #define MCFUART_TXFIFOSIZE     512
 #elif defined(CONFIG_M5272)
 #define MCFUART_TXFIFOSIZE     25
index 7a6a7590cc02cd584d28fd9e2a98d9d1b8b30797..278c69bad57a8369a542851df92571cdcf988447 100644 (file)
 
 static inline unsigned long rdusp(void)
 {
-#ifdef CONFIG_COLDFIRE
+#ifdef CONFIG_COLDFIRE_SW_A7
        extern unsigned int sw_usp;
        return sw_usp;
 #else
-       unsigned long usp;
-       __asm__ __volatile__("move %/usp,%0" : "=a" (usp));
+       register unsigned long usp __asm__("a0");
+       /* move %usp,%a0 */
+       __asm__ __volatile__(".word 0x4e68" : "=a" (usp));
        return usp;
 #endif
 }
 
 static inline void wrusp(unsigned long usp)
 {
-#ifdef CONFIG_COLDFIRE
+#ifdef CONFIG_COLDFIRE_SW_A7
        extern unsigned int sw_usp;
        sw_usp = usp;
 #else
-       __asm__ __volatile__("move %0,%/usp" : : "a" (usp));
+       register unsigned long a0 __asm__("a0") = usp;
+       /* move %a0,%usp */
+       __asm__ __volatile__(".word 0x4e60" : : "a" (a0) );
 #endif
 }
 
index fa9f746cf4ae6c1fda0621bad167f9baba17c970..8b9dacaa0f6eaab4ff0b06718d42572a855dbdad 100644 (file)
@@ -2,6 +2,7 @@ config M68K
        bool
        default y
        select HAVE_IDE
+       select HAVE_GENERIC_HARDIRQS
 
 config MMU
        bool
@@ -48,14 +49,6 @@ config GENERIC_HWEIGHT
        bool
        default y
 
-config GENERIC_HARDIRQS
-       bool
-       default y
-
-config GENERIC_HARDIRQS_NO__DO_IRQ
-       bool
-       default y
-
 config GENERIC_CALIBRATE_DELAY
        bool
        default y
@@ -75,6 +68,16 @@ config GENERIC_CLOCKEVENTS
 config NO_IOPORT
        def_bool y
 
+config COLDFIRE_SW_A7
+       bool
+       default n
+
+config HAVE_CACHE_SPLIT
+       bool
+
+config HAVE_CACHE_CB
+       bool
+
 source "init/Kconfig"
 
 source "kernel/Kconfig.freezer"
@@ -107,69 +110,90 @@ config M68360
 
 config M5206
        bool "MCF5206"
+       select COLDFIRE_SW_A7
        help
          Motorola ColdFire 5206 processor support.
 
 config M5206e
        bool "MCF5206e"
+       select COLDFIRE_SW_A7
        help
          Motorola ColdFire 5206e processor support.
 
 config M520x
        bool "MCF520x"
        select GENERIC_CLOCKEVENTS
+       select HAVE_CACHE_SPLIT
        help
           Freescale Coldfire 5207/5208 processor support.
 
 config M523x
        bool "MCF523x"
        select GENERIC_CLOCKEVENTS
+       select HAVE_CACHE_SPLIT
        help
          Freescale Coldfire 5230/1/2/4/5 processor support
 
 config M5249
        bool "MCF5249"
+       select COLDFIRE_SW_A7
        help
          Motorola ColdFire 5249 processor support.
 
 config M5271
        bool "MCF5271"
+       select HAVE_CACHE_SPLIT
        help
          Freescale (Motorola) ColdFire 5270/5271 processor support.
 
 config M5272
        bool "MCF5272"
+       select COLDFIRE_SW_A7
        help
          Motorola ColdFire 5272 processor support.
 
 config M5275
        bool "MCF5275"
+       select HAVE_CACHE_SPLIT
        help
          Freescale (Motorola) ColdFire 5274/5275 processor support.
 
 config M528x
        bool "MCF528x"
        select GENERIC_CLOCKEVENTS
+       select HAVE_CACHE_SPLIT
        help
          Motorola ColdFire 5280/5282 processor support.
 
 config M5307
        bool "MCF5307"
+       select COLDFIRE_SW_A7
+       select HAVE_CACHE_CB
        help
          Motorola ColdFire 5307 processor support.
 
 config M532x
        bool "MCF532x"
+       select HAVE_CACHE_CB
        help
          Freescale (Motorola) ColdFire 532x processor support.
 
 config M5407
        bool "MCF5407"
+       select COLDFIRE_SW_A7
+       select HAVE_CACHE_CB
        help
          Motorola ColdFire 5407 processor support.
 
+config M547x
+       bool "MCF547x"
+       select HAVE_CACHE_CB
+       help
+         Freescale ColdFire 5470/5471/5472/5473/5474/5475 processor support.
+
 config M548x
        bool "MCF548x"
+       select HAVE_CACHE_CB
        help
          Freescale ColdFire 5480/5481/5482/5483/5484/5485 processor support.
 
@@ -181,9 +205,14 @@ config M527x
        select GENERIC_CLOCKEVENTS
        default y
 
+config M54xx
+       bool
+       depends on (M548x || M547x)
+       default y
+
 config COLDFIRE
        bool
-       depends on (M5206 || M5206e || M520x || M523x || M5249 || M527x || M5272 || M528x || M5307 || M532x || M5407 || M548x)
+       depends on (M5206 || M5206e || M520x || M523x || M5249 || M527x || M5272 || M528x || M5307 || M532x || M5407 || M54xx)
        select GENERIC_GPIO
        select ARCH_REQUIRE_GPIOLIB
        default y
@@ -230,6 +259,46 @@ config OLDMASK
          Build support for the older revision ColdFire 5307 silicon.
          Specifically this is the 1H55J mask revision.
 
+if HAVE_CACHE_SPLIT
+choice
+       prompt "Split Cache Configuration"
+       default CACHE_I
+
+config CACHE_I
+       bool "Instruction"
+       help
+         Use all of the ColdFire CPU cache memory as an instruction cache.
+
+config CACHE_D
+       bool "Data"
+       help
+         Use all of the ColdFire CPU cache memory as a data cache.
+
+config CACHE_BOTH
+       bool "Both"
+       help
+         Split the ColdFire CPU cache, and use half as an instruction cache
+         and half as a data cache.
+endchoice
+endif
+
+if HAVE_CACHE_CB
+choice
+       prompt "Data cache mode"
+       default CACHE_WRITETHRU
+
+config CACHE_WRITETHRU
+       bool "Write-through"
+       help
+         The ColdFire CPU cache is set into Write-through mode.
+
+config CACHE_COPYBACK
+       bool "Copy-back"
+       help
+         The ColdFire CPU cache is set into Copy-back mode.
+endchoice
+endif
+
 comment "Platform"
 
 config PILOT3
@@ -245,16 +314,16 @@ config XCOPILOT_BUGS
          Support the bugs of Xcopilot.
 
 config UC5272
-        bool 'Arcturus Networks uC5272 dimm board support'
-        depends on M5272
-        help
-          Support for the Arcturus Networks uC5272 dimm board.
+       bool 'Arcturus Networks uC5272 dimm board support'
+       depends on M5272
+       help
+         Support for the Arcturus Networks uC5272 dimm board.
 
 config UC5282
-       bool "Arcturus Networks uC5282 board support"
-          depends on M528x
-       help
-          Support for the Arcturus Networks uC5282 dimm board.
+       bool "Arcturus Networks uC5282 board support"
+       depends on M528x
+       help
+         Support for the Arcturus Networks uC5282 dimm board.
 
 config UCSIMM
        bool "uCsimm module support"
@@ -279,7 +348,7 @@ config DIRECT_IO_ACCESS
        depends on (UCSIMM || UCDIMM || DRAGEN2)
        help
          Disable the CPU internal registers protection in user mode,
-          to allow a user application to read/write them.
+         to allow a user application to read/write them.
 
 config INIT_LCD
        bool "Initialize LCD"
@@ -517,7 +586,7 @@ config EMAC_INC
        depends on (SOM5282EM)
 
 config SNEHA
-        bool
+       bool
        default y
        depends on CPU16B
 
index 026ef16fa68e6c0054ff479af392822db7de9075..589613fed31d9535ee432541e9b73490c5436c79 100644 (file)
@@ -25,7 +25,7 @@ platform-$(CONFIG_M528x)      := 528x
 platform-$(CONFIG_M5307)       := 5307
 platform-$(CONFIG_M532x)       := 532x
 platform-$(CONFIG_M5407)       := 5407
-platform-$(CONFIG_M548x)       := 548x
+platform-$(CONFIG_M54xx)       := 54xx
 PLATFORM := $(platform-y)
 
 board-$(CONFIG_PILOT)          := pilot
@@ -74,7 +74,7 @@ cpuclass-$(CONFIG_M528x)      := coldfire
 cpuclass-$(CONFIG_M5307)       := coldfire
 cpuclass-$(CONFIG_M532x)       := coldfire
 cpuclass-$(CONFIG_M5407)       := coldfire
-cpuclass-$(CONFIG_M548x)       := coldfire
+cpuclass-$(CONFIG_M54xx)       := coldfire
 cpuclass-$(CONFIG_M68328)      := 68328
 cpuclass-$(CONFIG_M68EZ328)    := 68328
 cpuclass-$(CONFIG_M68VZ328)    := 68328
@@ -91,18 +91,18 @@ export PLATFORM BOARD MODEL CPUCLASS
 # Some CFLAG additions based on specific CPU type.
 #
 cflags-$(CONFIG_M5206)         := $(call cc-option,-mcpu=5206,-m5200)
-cflags-$(CONFIG_M5206e)                := $(call cc-option,-m5206e,-m5200)
+cflags-$(CONFIG_M5206e)                := $(call cc-option,-mcpu=5206e,-m5200)
 cflags-$(CONFIG_M520x)         := $(call cc-option,-mcpu=5208,-m5200)
 cflags-$(CONFIG_M523x)         := $(call cc-option,-mcpu=523x,-m5307)
 cflags-$(CONFIG_M5249)         := $(call cc-option,-mcpu=5249,-m5200)
 cflags-$(CONFIG_M5271)         := $(call cc-option,-mcpu=5271,-m5307)
 cflags-$(CONFIG_M5272)         := $(call cc-option,-mcpu=5272,-m5307)
 cflags-$(CONFIG_M5275)         := $(call cc-option,-mcpu=5275,-m5307)
-cflags-$(CONFIG_M528x)         := $(call cc-option,-m528x,-m5307)
-cflags-$(CONFIG_M5307)         := $(call cc-option,-m5307,-m5200)
+cflags-$(CONFIG_M528x)         := $(call cc-option,-mcpu=528x,-m5307)
+cflags-$(CONFIG_M5307)         := $(call cc-option,-mcpu=5307,-m5200)
 cflags-$(CONFIG_M532x)         := $(call cc-option,-mcpu=532x,-m5307)
-cflags-$(CONFIG_M5407)         := $(call cc-option,-m5407,-m5200)
-cflags-$(CONFIG_M548x)         := $(call cc-option,-m5407,-m5200)
+cflags-$(CONFIG_M5407)         := $(call cc-option,-mcpu=5407,-m5200)
+cflags-$(CONFIG_M54xx)         := $(call cc-option,-mcpu=5475,-m5200)
 cflags-$(CONFIG_M68328)                := -m68000
 cflags-$(CONFIG_M68EZ328)      := -m68000
 cflags-$(CONFIG_M68VZ328)      := -m68000
index 6ac2981a2cdf79caca86291c23917ce29336c220..2f5655c577affcd1d486b5b7cbd1e5f096b5780e 100644 (file)
@@ -1,7 +1,7 @@
 CONFIG_EXPERIMENTAL=y
 CONFIG_LOG_BUF_SHIFT=14
 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
-CONFIG_EMBEDDED=y
+CONFIG_EXPERT=y
 # CONFIG_KALLSYMS is not set
 # CONFIG_HOTPLUG is not set
 # CONFIG_FUTEX is not set
index 14934ff8d5c3e452f30c69bbd807ae15f77f30f0..16df72bfbd45d0d493e1ea124282315b8ee53dd4 100644 (file)
@@ -1,7 +1,7 @@
 CONFIG_EXPERIMENTAL=y
 CONFIG_LOG_BUF_SHIFT=14
 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
-CONFIG_EMBEDDED=y
+CONFIG_EXPERT=y
 # CONFIG_KALLSYMS is not set
 # CONFIG_HOTPLUG is not set
 # CONFIG_FUTEX is not set
index 5985a3b593d86d9da5bfd958b4bebd52a9056a0a..4e6ea50c7f33f75c84f916efe1d8835d189304b2 100644 (file)
@@ -1,7 +1,7 @@
 CONFIG_EXPERIMENTAL=y
 CONFIG_LOG_BUF_SHIFT=14
 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
-CONFIG_EMBEDDED=y
+CONFIG_EXPERT=y
 # CONFIG_KALLSYMS is not set
 # CONFIG_HOTPLUG is not set
 # CONFIG_FUTEX is not set
index 5a7857efb45dc1b9ccdbe0711337bdcb787c52db..f3dd74115a348de03e8caf7d70e7861f1e250e29 100644 (file)
@@ -1,7 +1,7 @@
 CONFIG_EXPERIMENTAL=y
 CONFIG_LOG_BUF_SHIFT=14
 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
-CONFIG_EMBEDDED=y
+CONFIG_EXPERT=y
 # CONFIG_KALLSYMS is not set
 # CONFIG_HOTPLUG is not set
 # CONFIG_FUTEX is not set
index e8102018c8d4beb90fd9cba2159741467d1a4da8..bce0a20c37371dc806237ce6ea5c2d803fc0f89b 100644 (file)
@@ -1,7 +1,7 @@
 CONFIG_EXPERIMENTAL=y
 CONFIG_LOG_BUF_SHIFT=14
 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
-CONFIG_EMBEDDED=y
+CONFIG_EXPERT=y
 # CONFIG_KALLSYMS is not set
 # CONFIG_HOTPLUG is not set
 # CONFIG_FUTEX is not set
index 5c124a7ba2a717a836ba54beab71ffb492cfd5e0..618cc32691f244b8cd1da01251312e027fb2d31f 100644 (file)
@@ -1,7 +1,7 @@
 CONFIG_EXPERIMENTAL=y
 CONFIG_LOG_BUF_SHIFT=14
 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
-CONFIG_EMBEDDED=y
+CONFIG_EXPERT=y
 # CONFIG_KALLSYMS is not set
 # CONFIG_HOTPLUG is not set
 # CONFIG_FUTEX is not set
index 6ac2981a2cdf79caca86291c23917ce29336c220..2f5655c577affcd1d486b5b7cbd1e5f096b5780e 100644 (file)
@@ -1,7 +1,7 @@
 CONFIG_EXPERIMENTAL=y
 CONFIG_LOG_BUF_SHIFT=14
 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
-CONFIG_EMBEDDED=y
+CONFIG_EXPERT=y
 # CONFIG_KALLSYMS is not set
 # CONFIG_HOTPLUG is not set
 # CONFIG_FUTEX is not set
index c684adf5dc40dfb8f4d4ce4d519d35e7023a4ff8..16b2de7f51013b10d17033bc4520b741d71fac4f 100644 (file)
@@ -55,55 +55,29 @@ void (*mach_halt)(void);
 void (*mach_power_off)(void);
 
 #ifdef CONFIG_M68328
-       #define CPU "MC68328"
+#define CPU_NAME       "MC68328"
 #endif
 #ifdef CONFIG_M68EZ328
-       #define CPU "MC68EZ328"
+#define CPU_NAME       "MC68EZ328"
 #endif
 #ifdef CONFIG_M68VZ328
-       #define CPU "MC68VZ328"
+#define CPU_NAME       "MC68VZ328"
 #endif
 #ifdef CONFIG_M68360
-       #define CPU "MC68360"
+#define CPU_NAME       "MC68360"
 #endif
-#if defined(CONFIG_M5206)
-       #define CPU "COLDFIRE(m5206)"
+#ifndef CPU_NAME
+#define        CPU_NAME        "UNKNOWN"
 #endif
-#if defined(CONFIG_M5206e)
-       #define CPU "COLDFIRE(m5206e)"
-#endif
-#if defined(CONFIG_M520x)
-       #define CPU "COLDFIRE(m520x)"
-#endif
-#if defined(CONFIG_M523x)
-       #define CPU "COLDFIRE(m523x)"
-#endif
-#if defined(CONFIG_M5249)
-       #define CPU "COLDFIRE(m5249)"
-#endif
-#if defined(CONFIG_M5271)
-       #define CPU "COLDFIRE(m5270/5271)"
-#endif
-#if defined(CONFIG_M5272)
-       #define CPU "COLDFIRE(m5272)"
-#endif
-#if defined(CONFIG_M5275)
-       #define CPU "COLDFIRE(m5274/5275)"
-#endif
-#if defined(CONFIG_M528x)
-       #define CPU "COLDFIRE(m5280/5282)"
-#endif
-#if defined(CONFIG_M5307)
-       #define CPU "COLDFIRE(m5307)"
-#endif
-#if defined(CONFIG_M532x)
-       #define CPU "COLDFIRE(m532x)"
-#endif
-#if defined(CONFIG_M5407)
-       #define CPU "COLDFIRE(m5407)"
-#endif
-#ifndef CPU
-       #define CPU "UNKNOWN"
+
+/*
+ * Different cores have different instruction execution timings.
+ * The old/traditional 68000 cores are basically all the same, at 16.
+ * The ColdFire cores vary a little, their values are defined in their
+ * headers. We default to the standard 68000 value here.
+ */
+#ifndef CPU_INSTR_PER_JIFFY
+#define        CPU_INSTR_PER_JIFFY     16
 #endif
 
 extern int _stext, _etext, _sdata, _edata, _sbss, _ebss, _end;
@@ -208,7 +182,7 @@ void __init setup_arch(char **cmdline_p)
        command_line[sizeof(command_line) - 1] = 0;
 #endif /* CONFIG_UBOOT */
 
-       printk(KERN_INFO "\x0F\r\n\nuClinux/" CPU "\n");
+       printk(KERN_INFO "\x0F\r\n\nuClinux/" CPU_NAME "\n");
 
 #ifdef CONFIG_UCDIMM
        printk(KERN_INFO "uCdimm by Lineo, Inc. <www.lineo.com>\n");
@@ -257,11 +231,6 @@ void __init setup_arch(char **cmdline_p)
        memcpy(boot_command_line, command_line, COMMAND_LINE_SIZE);
        boot_command_line[COMMAND_LINE_SIZE-1] = 0;
 
-#ifdef DEBUG
-       if (strlen(*cmdline_p))
-               printk(KERN_DEBUG "Command line: '%s'\n", *cmdline_p);
-#endif
-
 #if defined(CONFIG_FRAMEBUFFER_CONSOLE) && defined(CONFIG_DUMMY_CONSOLE)
        conswitchp = &dummy_con;
 #endif
@@ -303,15 +272,10 @@ static int show_cpuinfo(struct seq_file *m, void *v)
        char *cpu, *mmu, *fpu;
        u_long clockfreq;
 
-       cpu = CPU;
+       cpu = CPU_NAME;
        mmu = "none";
        fpu = "none";
-
-#ifdef CONFIG_COLDFIRE
-       clockfreq = (loops_per_jiffy * HZ) * 3;
-#else
-       clockfreq = (loops_per_jiffy * HZ) * 16;
-#endif
+       clockfreq = (loops_per_jiffy * HZ) * CPU_INSTR_PER_JIFFY;
 
        seq_printf(m, "CPU:\t\t%s\n"
                      "MMU:\t\t%s\n"
index fc91f254f51b35555375a64ccf9b1db0917a86cc..b54ab6b4b52325b0851f25385457ac40d5f86baf 100644 (file)
@@ -2,4 +2,4 @@
 # Makefile for the linux m68knommu specific parts of the memory manager.
 #
 
-obj-y += init.o fault.o memory.o kmap.o
+obj-y += init.o kmap.o
diff --git a/arch/m68knommu/mm/fault.c b/arch/m68knommu/mm/fault.c
deleted file mode 100644 (file)
index bc05cf7..0000000
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- *  linux/arch/m68knommu/mm/fault.c
- *
- *  Copyright (C) 1998  D. Jeff Dionne <jeff@lineo.ca>,
- *  Copyright (C) 2000  Lineo, Inc.  (www.lineo.com)
- *
- *  Based on:
- *
- *  linux/arch/m68k/mm/fault.c
- *
- *  Copyright (C) 1995  Hamish Macdonald
- */
-
-#include <linux/mman.h>
-#include <linux/mm.h>
-#include <linux/kernel.h>
-#include <linux/ptrace.h>
-
-#include <asm/system.h>
-#include <asm/pgtable.h>
-
-extern void die_if_kernel(char *, struct pt_regs *, long);
-
-/*
- * This routine handles page faults.  It determines the problem, and
- * then passes it off to one of the appropriate routines.
- *
- * error_code:
- *     bit 0 == 0 means no page found, 1 means protection fault
- *     bit 1 == 0 means read, 1 means write
- *
- * If this routine detects a bad access, it returns 1, otherwise it
- * returns 0.
- */
-asmlinkage int do_page_fault(struct pt_regs *regs, unsigned long address,
-                             unsigned long error_code)
-{
-#ifdef DEBUG
-       printk(KERN_DEBUG "regs->sr=%#x, regs->pc=%#lx, address=%#lx, %ld\n",
-               regs->sr, regs->pc, address, error_code);
-#endif
-
-       /*
-        * Oops. The kernel tried to access some bad page. We'll have to
-        * terminate things with extreme prejudice.
-        */
-       if ((unsigned long) address < PAGE_SIZE)
-               printk(KERN_ALERT "Unable to handle kernel NULL pointer dereference");
-       else
-               printk(KERN_ALERT "Unable to handle kernel access");
-       printk(KERN_ALERT " at virtual address %08lx\n", address);
-       die_if_kernel("Oops", regs, error_code);
-       do_exit(SIGKILL);
-
-       return 1;
-}
-
index 902c1dfda9e530eefd41aad1ff7367f211ac529b..ece8d5ad4e6cefc24bf095092dd2034f61436fd9 100644 (file)
@@ -35,15 +35,6 @@ void iounmap(void *addr)
 {
 }
 
-/*
- * __iounmap unmaps nearly everything, so be careful
- * it doesn't free currently pointer/page tables anymore but it
- * wans't used anyway and might be added later.
- */
-void __iounmap(void *addr, unsigned long size)
-{
-}
-
 /*
  * Set new cache mode for some kernel address space.
  * The caller must push data for that range itself, if such data may already
diff --git a/arch/m68knommu/mm/memory.c b/arch/m68knommu/mm/memory.c
deleted file mode 100644 (file)
index 8f7949e..0000000
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- *  linux/arch/m68knommu/mm/memory.c
- *
- *  Copyright (C) 1998  Kenneth Albanowski <kjahds@kjahds.com>,
- *  Copyright (C) 1999-2002, Greg Ungerer (gerg@snapgear.com)
- *
- *  Based on:
- *
- *  linux/arch/m68k/mm/memory.c
- *
- *  Copyright (C) 1995  Hamish Macdonald
- */
-
-#include <linux/mm.h>
-#include <linux/kernel.h>
-#include <linux/string.h>
-#include <linux/types.h>
-
-#include <asm/segment.h>
-#include <asm/page.h>
-#include <asm/pgtable.h>
-#include <asm/system.h>
-
-/*
- * Map some physical address range into the kernel address space.
- */
-
-unsigned long kernel_map(unsigned long paddr, unsigned long size,
-                        int nocacheflag, unsigned long *memavailp )
-{
-       return paddr;
-}
-
similarity index 74%
rename from arch/m68knommu/platform/548x/config.c
rename to arch/m68knommu/platform/54xx/config.c
index 9888846bd1cf74883f47d6e74470396916aa83ac..78130984db956045c4e3371d138f8c7e70070344 100644 (file)
@@ -1,7 +1,7 @@
 /***************************************************************************/
 
 /*
- *     linux/arch/m68knommu/platform/548x/config.c
+ *     linux/arch/m68knommu/platform/54xx/config.c
  *
  *     Copyright (C) 2010, Philippe De Muyter <phdm@macqel.be>
  */
 #include <linux/io.h>
 #include <asm/machdep.h>
 #include <asm/coldfire.h>
-#include <asm/m548xsim.h>
+#include <asm/m54xxsim.h>
 #include <asm/mcfuart.h>
-#include <asm/m548xgpt.h>
+#include <asm/m54xxgpt.h>
 
 /***************************************************************************/
 
-static struct mcf_platform_uart m548x_uart_platform[] = {
+static struct mcf_platform_uart m54xx_uart_platform[] = {
        {
                .mapbase        = MCF_MBAR + MCFUART_BASE1,
                .irq            = 64 + 35,
@@ -40,20 +40,20 @@ static struct mcf_platform_uart m548x_uart_platform[] = {
        },
 };
 
-static struct platform_device m548x_uart = {
+static struct platform_device m54xx_uart = {
        .name                   = "mcfuart",
        .id                     = 0,
-       .dev.platform_data      = m548x_uart_platform,
+       .dev.platform_data      = m54xx_uart_platform,
 };
 
-static struct platform_device *m548x_devices[] __initdata = {
-       &m548x_uart,
+static struct platform_device *m54xx_devices[] __initdata = {
+       &m54xx_uart,
 };
 
 
 /***************************************************************************/
 
-static void __init m548x_uart_init_line(int line, int irq)
+static void __init m54xx_uart_init_line(int line, int irq)
 {
        int rts_cts;
 
@@ -72,18 +72,18 @@ static void __init m548x_uart_init_line(int line, int irq)
                                                MCF_MBAR + MCF_PAR_PSC(line));
 }
 
-static void __init m548x_uarts_init(void)
+static void __init m54xx_uarts_init(void)
 {
-       const int nrlines = ARRAY_SIZE(m548x_uart_platform);
+       const int nrlines = ARRAY_SIZE(m54xx_uart_platform);
        int line;
 
        for (line = 0; (line < nrlines); line++)
-               m548x_uart_init_line(line, m548x_uart_platform[line].irq);
+               m54xx_uart_init_line(line, m54xx_uart_platform[line].irq);
 }
 
 /***************************************************************************/
 
-static void mcf548x_reset(void)
+static void mcf54xx_reset(void)
 {
        /* disable interrupts and enable the watchdog */
        asm("movew #0x2700, %sr\n");
@@ -97,8 +97,8 @@ static void mcf548x_reset(void)
 
 void __init config_BSP(char *commandp, int size)
 {
-       mach_reset = mcf548x_reset;
-       m548x_uarts_init();
+       mach_reset = mcf54xx_reset;
+       m54xx_uarts_init();
 }
 
 /***************************************************************************/
@@ -106,7 +106,7 @@ void __init config_BSP(char *commandp, int size)
 static int __init init_BSP(void)
 {
 
-       platform_add_devices(m548x_devices, ARRAY_SIZE(m548x_devices));
+       platform_add_devices(m54xx_devices, ARRAY_SIZE(m54xx_devices));
        return 0;
 }
 
index 865852806a1719311936ab2dcf973cf99790f92f..2a3af193ccd36dccaebf60b95e50e4749740f480 100644 (file)
@@ -179,8 +179,8 @@ void __init init_IRQ(void)
        IMR = ~0;
 
        for (i = 0; (i < NR_IRQS); i++) {
-               set_irq_chip(irq, &intc_irq_chip);
-               set_irq_handler(irq, handle_level_irq);
+               set_irq_chip(i, &intc_irq_chip);
+               set_irq_handler(i, handle_level_irq);
        }
 }
 
index 45f501fa452526f8221d8a2cb47c82b60ed4b5c7..a8967baabd72098235dd2a21979e9e16f64197b7 100644 (file)
@@ -14,7 +14,7 @@
 
 asflags-$(CONFIG_FULLDEBUG) := -DDEBUGGER_COMPATIBLE_CACHE=1
 
-obj-$(CONFIG_COLDFIRE) += clk.o dma.o entry.o vectors.o
+obj-$(CONFIG_COLDFIRE) += cache.o clk.o dma.o entry.o vectors.o
 obj-$(CONFIG_M5206)    += timers.o intc.o
 obj-$(CONFIG_M5206e)   += timers.o intc.o
 obj-$(CONFIG_M520x)    += pit.o intc-simr.o
@@ -26,7 +26,7 @@ obj-$(CONFIG_M528x)   += pit.o intc-2.o
 obj-$(CONFIG_M5307)    += timers.o intc.o
 obj-$(CONFIG_M532x)    += timers.o intc-simr.o
 obj-$(CONFIG_M5407)    += timers.o intc.o
-obj-$(CONFIG_M548x)    += sltimers.o intc-2.o
+obj-$(CONFIG_M54xx)    += sltimers.o intc-2.o
 
 obj-y                  += pinmux.o gpio.o
 extra-y := head.o
diff --git a/arch/m68knommu/platform/coldfire/cache.c b/arch/m68knommu/platform/coldfire/cache.c
new file mode 100644 (file)
index 0000000..235d3c4
--- /dev/null
@@ -0,0 +1,48 @@
+/***************************************************************************/
+
+/*
+ *     cache.c -- general ColdFire Cache maintainence code
+ *
+ *     Copyright (C) 2010, Greg Ungerer (gerg@snapgear.com)
+ */
+
+/***************************************************************************/
+
+#include <linux/kernel.h>
+#include <asm/coldfire.h>
+#include <asm/mcfsim.h>
+
+/***************************************************************************/
+#ifdef CACHE_PUSH
+/***************************************************************************/
+
+/*
+ *     Use cpushl to push all dirty cache lines back to memory.
+ *     Older versions of GAS don't seem to know how to generate the
+ *     ColdFire cpushl instruction... Oh well, bit stuff it for now.
+ */
+
+void mcf_cache_push(void)
+{
+       __asm__ __volatile__ (
+               "clrl   %%d0\n\t"
+               "1:\n\t"
+               "movel  %%d0,%%a0\n\t"
+               "2:\n\t"
+               ".word  0xf468\n\t"
+               "addl   %0,%%a0\n\t"
+               "cmpl   %1,%%a0\n\t"
+               "blt    2b\n\t"
+               "addql  #1,%%d0\n\t"
+               "cmpil  %2,%%d0\n\t"
+               "bne    1b\n\t"
+               : /* No output */
+               : "i" (CACHE_LINE_SIZE),
+                 "i" (DCACHE_SIZE / CACHE_WAYS),
+                 "i" (CACHE_WAYS)
+               : "d0", "a0" );
+}
+
+/***************************************************************************/
+#endif /* CACHE_PUSH */
+/***************************************************************************/
index e1debc8285efa648a65640e303d18d0f8434c4b9..4ddfc3da70d88103392970334435c570ef450209 100644 (file)
 #include <asm/asm-offsets.h>
 #include <asm/entry.h>
 
+#ifdef CONFIG_COLDFIRE_SW_A7
+/*
+ *     Define software copies of the supervisor and user stack pointers.
+ */
 .bss
-
 sw_ksp:
 .long  0
-
 sw_usp:
 .long  0
+#endif /* CONFIG_COLDFIRE_SW_A7 */
 
 .text
 
@@ -51,7 +54,6 @@ sw_usp:
 .globl ret_from_exception
 .globl ret_from_signal
 .globl sys_call_table
-.globl ret_from_interrupt
 .globl inthandler
 .globl fasthandler
 
@@ -140,20 +142,7 @@ Luser_return:
        jne     Lwork_to_do             /* still work to do */
 
 Lreturn:
-       move    #0x2700,%sr             /* disable intrs */
-       movel   sw_usp,%a0              /* get usp */
-       movel   %sp@(PT_OFF_PC),%a0@-   /* copy exception program counter */
-       movel   %sp@(PT_OFF_FORMATVEC),%a0@- /* copy exception format/vector/sr */
-       moveml  %sp@,%d1-%d5/%a0-%a2
-       lea     %sp@(32),%sp            /* space for 8 regs */
-       movel   %sp@+,%d0
-       addql   #4,%sp                  /* orig d0 */
-       addl    %sp@+,%sp               /* stk adj */
-       addql   #8,%sp                  /* remove exception */
-       movel   %sp,sw_ksp              /* save ksp */
-       subql   #8,sw_usp               /* set exception */
-       movel   sw_usp,%sp              /* restore usp */
-       rte
+       RESTORE_USER
 
 Lwork_to_do:
        movel   %a0@(TI_FLAGS),%d1      /* get thread_info->flags */
@@ -191,31 +180,7 @@ ENTRY(inthandler)
        jbsr    do_IRQ                  /* call high level irq handler */
        lea     %sp@(8),%sp             /* pop args off stack */
 
-       bra     ret_from_interrupt      /* this was fallthrough */
-
-/*
- * This is the fast interrupt handler (for certain hardware interrupt
- * sources). Unlike the normal interrupt handler it just uses the
- * current stack (doesn't care if it is user or kernel). It also
- * doesn't bother doing the bottom half handlers.
- */
-ENTRY(fasthandler)
-       SAVE_LOCAL
-
-       movew   %sp@(PT_OFF_FORMATVEC),%d0
-       andl    #0x03fc,%d0             /* mask out vector only */
-
-       movel   %sp,%sp@-               /* push regs arg */
-       lsrl    #2,%d0                  /* calculate real vector # */
-       movel   %d0,%sp@-               /* push vector number */
-       jbsr    do_IRQ                  /* call high level irq handler */
-       lea     %sp@(8),%sp             /* pop args off stack */
-
-       RESTORE_LOCAL
-
-ENTRY(ret_from_interrupt)
-       /* the fasthandler is confusing me, haven't seen any user */
-       jmp     ret_from_exception
+       bra     ret_from_exception
 
 /*
  * Beware - when entering resume, prev (the current task) is
@@ -226,9 +191,8 @@ ENTRY(ret_from_interrupt)
  */
 ENTRY(resume)
        movel   %a0, %d1                        /* get prev thread in d1 */
-
-       movel   sw_usp,%d0                      /* save usp */
-       movel   %d0,%a0@(TASK_THREAD+THREAD_USP)
+       RDUSP
+       movel   %a2,%a0@(TASK_THREAD+THREAD_USP)
 
        SAVE_SWITCH_STACK
        movel   %sp,%a0@(TASK_THREAD+THREAD_KSP) /* save kernel stack pointer */
@@ -236,5 +200,5 @@ ENTRY(resume)
        RESTORE_SWITCH_STACK
 
        movel   %a1@(TASK_THREAD+THREAD_USP),%a0 /* restore thread user stack */
-       movel   %a0, sw_usp
+       WRUSP
        rts
index 0b2d7c7adf793324c0c0f193b6e3022bd2e6882c..d5977909ae5f559f9f5cbd2b2d0e9ff93e2af248 100644 (file)
@@ -3,7 +3,7 @@
 /*
  *     head.S -- common startup code for ColdFire CPUs.
  *
- *     (C) Copyright 1999-2006, Greg Ungerer <gerg@snapgear.com>.
+ *     (C) Copyright 1999-2010, Greg Ungerer <gerg@snapgear.com>.
  */
 
 /*****************************************************************************/
@@ -13,7 +13,6 @@
 #include <linux/init.h>
 #include <asm/asm-offsets.h>
 #include <asm/coldfire.h>
-#include <asm/mcfcache.h>
 #include <asm/mcfsim.h>
 #include <asm/thread_info.h>
 
@@ -173,10 +172,27 @@ _start:
 
        /*
         *      Now that we know what the memory is, lets enable cache
-        *      and get things moving. This is Coldfire CPU specific.
+        *      and get things moving. This is Coldfire CPU specific. Not
+        *      all version cores have identical cache register setup. But
+        *      it is very similar. Define the exact settings in the headers
+        *      then the code here is the same for all.
         */
-       CACHE_ENABLE                            /* enable CPU cache */
-
+       movel   #CACHE_INIT,%d0                 /* invalidate whole cache */
+       movec   %d0,%CACR
+       nop
+       movel   #ACR0_MODE,%d0                  /* set RAM region for caching */
+       movec   %d0,%ACR0
+       movel   #ACR1_MODE,%d0                  /* anything else to cache? */
+       movec   %d0,%ACR1
+#ifdef ACR2_MODE
+       movel   #ACR2_MODE,%d0
+       movec   %d0,%ACR2
+       movel   #ACR3_MODE,%d0
+       movec   %d0,%ACR3
+#endif
+       movel   #CACHE_MODE,%d0                 /* enable cache */
+       movec   %d0,%CACR
+       nop
 
 #ifdef CONFIG_ROMFS_FS
        /*
index 5f5018a71a3db9c7bf6b57bcfbdcbb3bf1883d7a..31680032053e56cd368b74eb1cfb331b15d8826b 100644 (file)
@@ -15,6 +15,8 @@ config MICROBLAZE
        select TRACING_SUPPORT
        select OF
        select OF_EARLY_FLATTREE
+       select HAVE_GENERIC_HARDIRQS
+       select GENERIC_IRQ_PROBE
 
 config SWAP
        def_bool n
@@ -37,12 +39,6 @@ config GENERIC_FIND_NEXT_BIT
 config GENERIC_HWEIGHT
        def_bool y
 
-config GENERIC_HARDIRQS
-       def_bool y
-
-config GENERIC_IRQ_PROBE
-       def_bool y
-
 config GENERIC_CALIBRATE_DELAY
        def_bool y
 
@@ -52,9 +48,6 @@ config GENERIC_TIME_VSYSCALL
 config GENERIC_CLOCKEVENTS
        def_bool y
 
-config GENERIC_HARDIRQS_NO__DO_IRQ
-       def_bool y
-
 config GENERIC_GPIO
        def_bool y
 
index ab8fbe7ad90b559e87fe966b26b95092fde355fd..b3f5eecff2a7ddd16a42aaf2d8c5579019c86c3c 100644 (file)
@@ -7,7 +7,7 @@ CONFIG_BLK_DEV_INITRD=y
 CONFIG_INITRAMFS_SOURCE="rootfs.cpio"
 CONFIG_INITRAMFS_COMPRESSION_GZIP=y
 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
-CONFIG_EMBEDDED=y
+CONFIG_EXPERT=y
 CONFIG_KALLSYMS_ALL=y
 CONFIG_KALLSYMS_EXTRA_PASS=y
 # CONFIG_HOTPLUG is not set
index ebc143c5368e275afd94f9e1bcbbd9b944e262e0..0249e4b7e1d34003ebfd138755aef15f42632079 100644 (file)
@@ -6,7 +6,7 @@ CONFIG_BSD_PROCESS_ACCT_V3=y
 CONFIG_IKCONFIG=y
 CONFIG_IKCONFIG_PROC=y
 CONFIG_SYSFS_DEPRECATED_V2=y
-CONFIG_EMBEDDED=y
+CONFIG_EXPERT=y
 CONFIG_KALLSYMS_ALL=y
 CONFIG_KALLSYMS_EXTRA_PASS=y
 # CONFIG_HOTPLUG is not set
index cae268c22ba283513f967461a0e3132be739a6b9..b23f68075879b90e1e2b462e012eefd2777a6cbd 100644 (file)
@@ -444,8 +444,9 @@ static inline void set_pte_at(struct mm_struct *mm, unsigned long addr,
        *ptep = pte;
 }
 
-static inline int ptep_test_and_clear_young(struct mm_struct *mm,
-               unsigned long addr, pte_t *ptep)
+#define __HAVE_ARCH_PTEP_TEST_AND_CLEAR_YOUNG
+static inline int ptep_test_and_clear_young(struct vm_area_struct *vma,
+               unsigned long address, pte_t *ptep)
 {
        return (pte_update(ptep, _PAGE_ACCESSED, 0) & _PAGE_ACCESSED) != 0;
 }
@@ -457,6 +458,7 @@ static inline int ptep_test_and_clear_dirty(struct mm_struct *mm,
                (_PAGE_DIRTY | _PAGE_HWWRITE), 0) & _PAGE_DIRTY) != 0;
 }
 
+#define __HAVE_ARCH_PTEP_GET_AND_CLEAR
 static inline pte_t ptep_get_and_clear(struct mm_struct *mm,
                unsigned long addr, pte_t *ptep)
 {
index e8abd4a0349c381f45d1daeb7972db0235fd3e12..8aa97817cc8c6aabecc6e313a5db7d72d1aa9e99 100644 (file)
@@ -13,6 +13,7 @@
 
 #define tlb_flush(tlb) flush_tlb_mm((tlb)->mm)
 
+#include <linux/pagemap.h>
 #include <asm-generic/tlb.h>
 
 #ifdef CONFIG_MMU
index 78439b8a83c48418ce93e2eb4a0a0e065bca4efe..7ff9b54920419b99cbae1f74bac4c62fc3d1b73c 100644 (file)
@@ -2,6 +2,7 @@
 
 platforms += alchemy
 platforms += ar7
+platforms += ath79
 platforms += bcm47xx
 platforms += bcm63xx
 platforms += cavium-octeon
index f489ec30e071aa1932c43d4149a1130b23ae0349..f5ecc0566bc292f72b0020ac043bbfa7fd5a3300 100644 (file)
@@ -21,6 +21,7 @@ config MIPS
        select HAVE_DMA_API_DEBUG
        select HAVE_GENERIC_HARDIRQS
        select GENERIC_IRQ_PROBE
+       select HAVE_ARCH_JUMP_LABEL
 
 menu "Machine selection"
 
@@ -65,6 +66,22 @@ config AR7
          Support for the Texas Instruments AR7 System-on-a-Chip
          family: TNETD7100, 7200 and 7300.
 
+config ATH79
+       bool "Atheros AR71XX/AR724X/AR913X based boards"
+       select ARCH_REQUIRE_GPIOLIB
+       select BOOT_RAW
+       select CEVT_R4K
+       select CSRC_R4K
+       select DMA_NONCOHERENT
+       select IRQ_CPU
+       select MIPS_MACHINE
+       select SYS_HAS_CPU_MIPS32_R2
+       select SYS_HAS_EARLY_PRINTK
+       select SYS_SUPPORTS_32BIT_KERNEL
+       select SYS_SUPPORTS_BIG_ENDIAN
+       help
+         Support for the Atheros AR71XX/AR724X/AR913X SoCs.
+
 config BCM47XX
        bool "Broadcom BCM47XX based boards"
        select CEVT_R4K
@@ -717,6 +734,7 @@ config CAVIUM_OCTEON_REFERENCE_BOARD
 endchoice
 
 source "arch/mips/alchemy/Kconfig"
+source "arch/mips/ath79/Kconfig"
 source "arch/mips/bcm63xx/Kconfig"
 source "arch/mips/jazz/Kconfig"
 source "arch/mips/jz4740/Kconfig"
@@ -775,9 +793,6 @@ config SCHED_OMIT_FRAME_POINTER
        bool
        default y
 
-config GENERIC_HARDIRQS_NO__DO_IRQ
-       def_bool y
-
 #
 # Select some configuration options automatically based on user selections.
 #
@@ -883,6 +898,9 @@ config MIPS_DISABLE_OBSOLETE_IDE
 config SYNC_R4K
        bool
 
+config MIPS_MACHINE
+       def_bool n
+
 config NO_IOPORT
        def_bool n
 
@@ -2400,4 +2418,20 @@ source "security/Kconfig"
 
 source "crypto/Kconfig"
 
+menuconfig VIRTUALIZATION
+       bool "Virtualization"
+       default n
+       ---help---
+         Say Y here to get to see options for using your Linux host to run other
+         operating systems inside virtual machines (guests).
+         This option alone does not add any kernel code.
+
+         If you say N, all options in this submenu will be skipped and disabled.
+
+if VIRTUALIZATION
+
+source drivers/virtio/Kconfig
+
+endif # VIRTUALIZATION
+
 source "lib/Kconfig"
index f437cd1fafb8cfc84b7dd97382a7995d09278c67..5358f90b4dd2ccee0c6767a01ebbc4f238f77976 100644 (file)
@@ -7,7 +7,7 @@ config TRACE_IRQFLAGS_SUPPORT
 source "lib/Kconfig.debug"
 
 config EARLY_PRINTK
-       bool "Early printk" if EMBEDDED
+       bool "Early printk" if EXPERT
        depends on SYS_HAS_EARLY_PRINTK
        default y
        help
diff --git a/arch/mips/ath79/Kconfig b/arch/mips/ath79/Kconfig
new file mode 100644 (file)
index 0000000..b058282
--- /dev/null
@@ -0,0 +1,50 @@
+if ATH79
+
+menu "Atheros AR71XX/AR724X/AR913X machine selection"
+
+config ATH79_MACH_AP81
+       bool "Atheros AP81 reference board"
+       select SOC_AR913X
+       select ATH79_DEV_AR913X_WMAC
+       select ATH79_DEV_GPIO_BUTTONS
+       select ATH79_DEV_LEDS_GPIO
+       select ATH79_DEV_SPI
+       help
+         Say 'Y' here if you want your kernel to support the
+         Atheros AP81 reference board.
+
+config ATH79_MACH_PB44
+       bool "Atheros PB44 reference board"
+       select SOC_AR71XX
+       select ATH79_DEV_GPIO_BUTTONS
+       select ATH79_DEV_LEDS_GPIO
+       select ATH79_DEV_SPI
+       help
+         Say 'Y' here if you want your kernel to support the
+         Atheros PB44 reference board.
+
+endmenu
+
+config SOC_AR71XX
+       def_bool n
+
+config SOC_AR724X
+       def_bool n
+
+config SOC_AR913X
+       def_bool n
+
+config ATH79_DEV_AR913X_WMAC
+       depends on SOC_AR913X
+       def_bool n
+
+config ATH79_DEV_GPIO_BUTTONS
+       def_bool n
+
+config ATH79_DEV_LEDS_GPIO
+       def_bool n
+
+config ATH79_DEV_SPI
+       def_bool n
+
+endif
diff --git a/arch/mips/ath79/Makefile b/arch/mips/ath79/Makefile
new file mode 100644 (file)
index 0000000..c33d465
--- /dev/null
@@ -0,0 +1,28 @@
+#
+# Makefile for the Atheros AR71XX/AR724X/AR913X specific parts of the kernel
+#
+# Copyright (C) 2008-2011 Gabor Juhos <juhosg@openwrt.org>
+# Copyright (C) 2008 Imre Kaloz <kaloz@openwrt.org>
+#
+# This program is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License version 2 as published
+# by the Free Software Foundation.
+
+obj-y  := prom.o setup.o irq.o common.o clock.o gpio.o
+
+obj-$(CONFIG_EARLY_PRINTK)             += early_printk.o
+
+#
+# Devices
+#
+obj-y                                  += dev-common.o
+obj-$(CONFIG_ATH79_DEV_AR913X_WMAC)    += dev-ar913x-wmac.o
+obj-$(CONFIG_ATH79_DEV_GPIO_BUTTONS)   += dev-gpio-buttons.o
+obj-$(CONFIG_ATH79_DEV_LEDS_GPIO)      += dev-leds-gpio.o
+obj-$(CONFIG_ATH79_DEV_SPI)            += dev-spi.o
+
+#
+# Machines
+#
+obj-$(CONFIG_ATH79_MACH_AP81)          += mach-ap81.o
+obj-$(CONFIG_ATH79_MACH_PB44)          += mach-pb44.o
diff --git a/arch/mips/ath79/Platform b/arch/mips/ath79/Platform
new file mode 100644 (file)
index 0000000..2bd6636
--- /dev/null
@@ -0,0 +1,7 @@
+#
+# Atheros AR71xx/AR724x/AR913x
+#
+
+platform-$(CONFIG_ATH79)       += ath79/
+cflags-$(CONFIG_ATH79)         += -I$(srctree)/arch/mips/include/asm/mach-ath79
+load-$(CONFIG_ATH79)           = 0xffffffff80060000
diff --git a/arch/mips/ath79/clock.c b/arch/mips/ath79/clock.c
new file mode 100644 (file)
index 0000000..680bde9
--- /dev/null
@@ -0,0 +1,183 @@
+/*
+ *  Atheros AR71XX/AR724X/AR913X common routines
+ *
+ *  Copyright (C) 2011 Gabor Juhos <juhosg@openwrt.org>
+ *
+ *  This program is free software; you can redistribute it and/or modify it
+ *  under the terms of the GNU General Public License version 2 as published
+ *  by the Free Software Foundation.
+ */
+
+#include <linux/kernel.h>
+#include <linux/module.h>
+#include <linux/init.h>
+#include <linux/err.h>
+#include <linux/clk.h>
+
+#include <asm/mach-ath79/ath79.h>
+#include <asm/mach-ath79/ar71xx_regs.h>
+#include "common.h"
+
+#define AR71XX_BASE_FREQ       40000000
+#define AR724X_BASE_FREQ       5000000
+#define AR913X_BASE_FREQ       5000000
+
+struct clk {
+       unsigned long rate;
+};
+
+static struct clk ath79_ref_clk;
+static struct clk ath79_cpu_clk;
+static struct clk ath79_ddr_clk;
+static struct clk ath79_ahb_clk;
+static struct clk ath79_wdt_clk;
+static struct clk ath79_uart_clk;
+
+static void __init ar71xx_clocks_init(void)
+{
+       u32 pll;
+       u32 freq;
+       u32 div;
+
+       ath79_ref_clk.rate = AR71XX_BASE_FREQ;
+
+       pll = ath79_pll_rr(AR71XX_PLL_REG_CPU_CONFIG);
+
+       div = ((pll >> AR71XX_PLL_DIV_SHIFT) & AR71XX_PLL_DIV_MASK) + 1;
+       freq = div * ath79_ref_clk.rate;
+
+       div = ((pll >> AR71XX_CPU_DIV_SHIFT) & AR71XX_CPU_DIV_MASK) + 1;
+       ath79_cpu_clk.rate = freq / div;
+
+       div = ((pll >> AR71XX_DDR_DIV_SHIFT) & AR71XX_DDR_DIV_MASK) + 1;
+       ath79_ddr_clk.rate = freq / div;
+
+       div = (((pll >> AR71XX_AHB_DIV_SHIFT) & AR71XX_AHB_DIV_MASK) + 1) * 2;
+       ath79_ahb_clk.rate = ath79_cpu_clk.rate / div;
+
+       ath79_wdt_clk.rate = ath79_ahb_clk.rate;
+       ath79_uart_clk.rate = ath79_ahb_clk.rate;
+}
+
+static void __init ar724x_clocks_init(void)
+{
+       u32 pll;
+       u32 freq;
+       u32 div;
+
+       ath79_ref_clk.rate = AR724X_BASE_FREQ;
+       pll = ath79_pll_rr(AR724X_PLL_REG_CPU_CONFIG);
+
+       div = ((pll >> AR724X_PLL_DIV_SHIFT) & AR724X_PLL_DIV_MASK);
+       freq = div * ath79_ref_clk.rate;
+
+       div = ((pll >> AR724X_PLL_REF_DIV_SHIFT) & AR724X_PLL_REF_DIV_MASK);
+       freq *= div;
+
+       ath79_cpu_clk.rate = freq;
+
+       div = ((pll >> AR724X_DDR_DIV_SHIFT) & AR724X_DDR_DIV_MASK) + 1;
+       ath79_ddr_clk.rate = freq / div;
+
+       div = (((pll >> AR724X_AHB_DIV_SHIFT) & AR724X_AHB_DIV_MASK) + 1) * 2;
+       ath79_ahb_clk.rate = ath79_cpu_clk.rate / div;
+
+       ath79_wdt_clk.rate = ath79_ahb_clk.rate;
+       ath79_uart_clk.rate = ath79_ahb_clk.rate;
+}
+
+static void __init ar913x_clocks_init(void)
+{
+       u32 pll;
+       u32 freq;
+       u32 div;
+
+       ath79_ref_clk.rate = AR913X_BASE_FREQ;
+       pll = ath79_pll_rr(AR913X_PLL_REG_CPU_CONFIG);
+
+       div = ((pll >> AR913X_PLL_DIV_SHIFT) & AR913X_PLL_DIV_MASK);
+       freq = div * ath79_ref_clk.rate;
+
+       ath79_cpu_clk.rate = freq;
+
+       div = ((pll >> AR913X_DDR_DIV_SHIFT) & AR913X_DDR_DIV_MASK) + 1;
+       ath79_ddr_clk.rate = freq / div;
+
+       div = (((pll >> AR913X_AHB_DIV_SHIFT) & AR913X_AHB_DIV_MASK) + 1) * 2;
+       ath79_ahb_clk.rate = ath79_cpu_clk.rate / div;
+
+       ath79_wdt_clk.rate = ath79_ahb_clk.rate;
+       ath79_uart_clk.rate = ath79_ahb_clk.rate;
+}
+
+void __init ath79_clocks_init(void)
+{
+       if (soc_is_ar71xx())
+               ar71xx_clocks_init();
+       else if (soc_is_ar724x())
+               ar724x_clocks_init();
+       else if (soc_is_ar913x())
+               ar913x_clocks_init();
+       else
+               BUG();
+
+       pr_info("Clocks: CPU:%lu.%03luMHz, DDR:%lu.%03luMHz, AHB:%lu.%03luMHz, "
+               "Ref:%lu.%03luMHz",
+               ath79_cpu_clk.rate / 1000000,
+               (ath79_cpu_clk.rate / 1000) % 1000,
+               ath79_ddr_clk.rate / 1000000,
+               (ath79_ddr_clk.rate / 1000) % 1000,
+               ath79_ahb_clk.rate / 1000000,
+               (ath79_ahb_clk.rate / 1000) % 1000,
+               ath79_ref_clk.rate / 1000000,
+               (ath79_ref_clk.rate / 1000) % 1000);
+}
+
+/*
+ * Linux clock API
+ */
+struct clk *clk_get(struct device *dev, const char *id)
+{
+       if (!strcmp(id, "ref"))
+               return &ath79_ref_clk;
+
+       if (!strcmp(id, "cpu"))
+               return &ath79_cpu_clk;
+
+       if (!strcmp(id, "ddr"))
+               return &ath79_ddr_clk;
+
+       if (!strcmp(id, "ahb"))
+               return &ath79_ahb_clk;
+
+       if (!strcmp(id, "wdt"))
+               return &ath79_wdt_clk;
+
+       if (!strcmp(id, "uart"))
+               return &ath79_uart_clk;
+
+       return ERR_PTR(-ENOENT);
+}
+EXPORT_SYMBOL(clk_get);
+
+int clk_enable(struct clk *clk)
+{
+       return 0;
+}
+EXPORT_SYMBOL(clk_enable);
+
+void clk_disable(struct clk *clk)
+{
+}
+EXPORT_SYMBOL(clk_disable);
+
+unsigned long clk_get_rate(struct clk *clk)
+{
+       return clk->rate;
+}
+EXPORT_SYMBOL(clk_get_rate);
+
+void clk_put(struct clk *clk)
+{
+}
+EXPORT_SYMBOL(clk_put);
diff --git a/arch/mips/ath79/common.c b/arch/mips/ath79/common.c
new file mode 100644 (file)
index 0000000..58f60e7
--- /dev/null
@@ -0,0 +1,97 @@
+/*
+ *  Atheros AR71XX/AR724X/AR913X common routines
+ *
+ *  Copyright (C) 2008-2010 Gabor Juhos <juhosg@openwrt.org>
+ *  Copyright (C) 2008 Imre Kaloz <kaloz@openwrt.org>
+ *
+ *  This program is free software; you can redistribute it and/or modify it
+ *  under the terms of the GNU General Public License version 2 as published
+ *  by the Free Software Foundation.
+ */
+
+#include <linux/kernel.h>
+#include <linux/module.h>
+#include <linux/types.h>
+#include <linux/spinlock.h>
+
+#include <asm/mach-ath79/ath79.h>
+#include <asm/mach-ath79/ar71xx_regs.h>
+#include "common.h"
+
+static DEFINE_SPINLOCK(ath79_device_reset_lock);
+
+u32 ath79_cpu_freq;
+EXPORT_SYMBOL_GPL(ath79_cpu_freq);
+
+u32 ath79_ahb_freq;
+EXPORT_SYMBOL_GPL(ath79_ahb_freq);
+
+u32 ath79_ddr_freq;
+EXPORT_SYMBOL_GPL(ath79_ddr_freq);
+
+enum ath79_soc_type ath79_soc;
+
+void __iomem *ath79_pll_base;
+void __iomem *ath79_reset_base;
+EXPORT_SYMBOL_GPL(ath79_reset_base);
+void __iomem *ath79_ddr_base;
+
+void ath79_ddr_wb_flush(u32 reg)
+{
+       void __iomem *flush_reg = ath79_ddr_base + reg;
+
+       /* Flush the DDR write buffer. */
+       __raw_writel(0x1, flush_reg);
+       while (__raw_readl(flush_reg) & 0x1)
+               ;
+
+       /* It must be run twice. */
+       __raw_writel(0x1, flush_reg);
+       while (__raw_readl(flush_reg) & 0x1)
+               ;
+}
+EXPORT_SYMBOL_GPL(ath79_ddr_wb_flush);
+
+void ath79_device_reset_set(u32 mask)
+{
+       unsigned long flags;
+       u32 reg;
+       u32 t;
+
+       if (soc_is_ar71xx())
+               reg = AR71XX_RESET_REG_RESET_MODULE;
+       else if (soc_is_ar724x())
+               reg = AR724X_RESET_REG_RESET_MODULE;
+       else if (soc_is_ar913x())
+               reg = AR913X_RESET_REG_RESET_MODULE;
+       else
+               BUG();
+
+       spin_lock_irqsave(&ath79_device_reset_lock, flags);
+       t = ath79_reset_rr(reg);
+       ath79_reset_wr(reg, t | mask);
+       spin_unlock_irqrestore(&ath79_device_reset_lock, flags);
+}
+EXPORT_SYMBOL_GPL(ath79_device_reset_set);
+
+void ath79_device_reset_clear(u32 mask)
+{
+       unsigned long flags;
+       u32 reg;
+       u32 t;
+
+       if (soc_is_ar71xx())
+               reg = AR71XX_RESET_REG_RESET_MODULE;
+       else if (soc_is_ar724x())
+               reg = AR724X_RESET_REG_RESET_MODULE;
+       else if (soc_is_ar913x())
+               reg = AR913X_RESET_REG_RESET_MODULE;
+       else
+               BUG();
+
+       spin_lock_irqsave(&ath79_device_reset_lock, flags);
+       t = ath79_reset_rr(reg);
+       ath79_reset_wr(reg, t & ~mask);
+       spin_unlock_irqrestore(&ath79_device_reset_lock, flags);
+}
+EXPORT_SYMBOL_GPL(ath79_device_reset_clear);
diff --git a/arch/mips/ath79/common.h b/arch/mips/ath79/common.h
new file mode 100644 (file)
index 0000000..561906c
--- /dev/null
@@ -0,0 +1,31 @@
+/*
+ *  Atheros AR71XX/AR724X/AR913X common definitions
+ *
+ *  Copyright (C) 2008-2011 Gabor Juhos <juhosg@openwrt.org>
+ *  Copyright (C) 2008 Imre Kaloz <kaloz@openwrt.org>
+ *
+ *  Parts of this file are based on Atheros' 2.6.15 BSP
+ *
+ *  This program is free software; you can redistribute it and/or modify it
+ *  under the terms of the GNU General Public License version 2 as published
+ *  by the Free Software Foundation.
+ */
+
+#ifndef __ATH79_COMMON_H
+#define __ATH79_COMMON_H
+
+#include <linux/types.h>
+#include <linux/init.h>
+
+#define ATH79_MEM_SIZE_MIN     (2 * 1024 * 1024)
+#define ATH79_MEM_SIZE_MAX     (128 * 1024 * 1024)
+
+void ath79_clocks_init(void);
+void ath79_ddr_wb_flush(unsigned int reg);
+
+void ath79_gpio_function_enable(u32 mask);
+void ath79_gpio_function_disable(u32 mask);
+void ath79_gpio_function_setup(u32 set, u32 clear);
+void ath79_gpio_init(void);
+
+#endif /* __ATH79_COMMON_H */
diff --git a/arch/mips/ath79/dev-ar913x-wmac.c b/arch/mips/ath79/dev-ar913x-wmac.c
new file mode 100644 (file)
index 0000000..48f425a
--- /dev/null
@@ -0,0 +1,60 @@
+/*
+ *  Atheros AR913X SoC built-in WMAC device support
+ *
+ *  Copyright (C) 2008-2010 Gabor Juhos <juhosg@openwrt.org>
+ *  Copyright (C) 2008 Imre Kaloz <kaloz@openwrt.org>
+ *
+ *  This program is free software; you can redistribute it and/or modify it
+ *  under the terms of the GNU General Public License version 2 as published
+ *  by the Free Software Foundation.
+ */
+
+#include <linux/init.h>
+#include <linux/delay.h>
+#include <linux/irq.h>
+#include <linux/platform_device.h>
+#include <linux/ath9k_platform.h>
+
+#include <asm/mach-ath79/ath79.h>
+#include <asm/mach-ath79/ar71xx_regs.h>
+#include "dev-ar913x-wmac.h"
+
+static struct ath9k_platform_data ar913x_wmac_data;
+
+static struct resource ar913x_wmac_resources[] = {
+       {
+               .start  = AR913X_WMAC_BASE,
+               .end    = AR913X_WMAC_BASE + AR913X_WMAC_SIZE - 1,
+               .flags  = IORESOURCE_MEM,
+       }, {
+               .start  = ATH79_CPU_IRQ_IP2,
+               .end    = ATH79_CPU_IRQ_IP2,
+               .flags  = IORESOURCE_IRQ,
+       },
+};
+
+static struct platform_device ar913x_wmac_device = {
+       .name           = "ath9k",
+       .id             = -1,
+       .resource       = ar913x_wmac_resources,
+       .num_resources  = ARRAY_SIZE(ar913x_wmac_resources),
+       .dev = {
+               .platform_data = &ar913x_wmac_data,
+       },
+};
+
+void __init ath79_register_ar913x_wmac(u8 *cal_data)
+{
+       if (cal_data)
+               memcpy(ar913x_wmac_data.eeprom_data, cal_data,
+                      sizeof(ar913x_wmac_data.eeprom_data));
+
+       /* reset the WMAC */
+       ath79_device_reset_set(AR913X_RESET_AMBA2WMAC);
+       mdelay(10);
+
+       ath79_device_reset_clear(AR913X_RESET_AMBA2WMAC);
+       mdelay(10);
+
+       platform_device_register(&ar913x_wmac_device);
+}
diff --git a/arch/mips/ath79/dev-ar913x-wmac.h b/arch/mips/ath79/dev-ar913x-wmac.h
new file mode 100644 (file)
index 0000000..579d562
--- /dev/null
@@ -0,0 +1,17 @@
+/*
+ *  Atheros AR913X SoC built-in WMAC device support
+ *
+ *  Copyright (C) 2008-2010 Gabor Juhos <juhosg@openwrt.org>
+ *  Copyright (C) 2008 Imre Kaloz <kaloz@openwrt.org>
+ *
+ *  This program is free software; you can redistribute it and/or modify it
+ *  under the terms of the GNU General Public License version 2 as published
+ *  by the Free Software Foundation.
+ */
+
+#ifndef _ATH79_DEV_AR913X_WMAC_H
+#define _ATH79_DEV_AR913X_WMAC_H
+
+void ath79_register_ar913x_wmac(u8 *cal_data);
+
+#endif /* _ATH79_DEV_AR913X_WMAC_H */
diff --git a/arch/mips/ath79/dev-common.c b/arch/mips/ath79/dev-common.c
new file mode 100644 (file)
index 0000000..3b82e32
--- /dev/null
@@ -0,0 +1,77 @@
+/*
+ *  Atheros AR71XX/AR724X/AR913X common devices
+ *
+ *  Copyright (C) 2008-2011 Gabor Juhos <juhosg@openwrt.org>
+ *  Copyright (C) 2008 Imre Kaloz <kaloz@openwrt.org>
+ *
+ *  Parts of this file are based on Atheros' 2.6.15 BSP
+ *
+ *  This program is free software; you can redistribute it and/or modify it
+ *  under the terms of the GNU General Public License version 2 as published
+ *  by the Free Software Foundation.
+ */
+
+#include <linux/kernel.h>
+#include <linux/init.h>
+#include <linux/platform_device.h>
+#include <linux/serial_8250.h>
+#include <linux/clk.h>
+#include <linux/err.h>
+
+#include <asm/mach-ath79/ath79.h>
+#include <asm/mach-ath79/ar71xx_regs.h>
+#include "common.h"
+#include "dev-common.h"
+
+static struct resource ath79_uart_resources[] = {
+       {
+               .start  = AR71XX_UART_BASE,
+               .end    = AR71XX_UART_BASE + AR71XX_UART_SIZE - 1,
+               .flags  = IORESOURCE_MEM,
+       },
+};
+
+#define AR71XX_UART_FLAGS (UPF_BOOT_AUTOCONF | UPF_SKIP_TEST | UPF_IOREMAP)
+static struct plat_serial8250_port ath79_uart_data[] = {
+       {
+               .mapbase        = AR71XX_UART_BASE,
+               .irq            = ATH79_MISC_IRQ_UART,
+               .flags          = AR71XX_UART_FLAGS,
+               .iotype         = UPIO_MEM32,
+               .regshift       = 2,
+       }, {
+               /* terminating entry */
+       }
+};
+
+static struct platform_device ath79_uart_device = {
+       .name           = "serial8250",
+       .id             = PLAT8250_DEV_PLATFORM,
+       .resource       = ath79_uart_resources,
+       .num_resources  = ARRAY_SIZE(ath79_uart_resources),
+       .dev = {
+               .platform_data  = ath79_uart_data
+       },
+};
+
+void __init ath79_register_uart(void)
+{
+       struct clk *clk;
+
+       clk = clk_get(NULL, "uart");
+       if (IS_ERR(clk))
+               panic("unable to get UART clock, err=%ld", PTR_ERR(clk));
+
+       ath79_uart_data[0].uartclk = clk_get_rate(clk);
+       platform_device_register(&ath79_uart_device);
+}
+
+static struct platform_device ath79_wdt_device = {
+       .name           = "ath79-wdt",
+       .id             = -1,
+};
+
+void __init ath79_register_wdt(void)
+{
+       platform_device_register(&ath79_wdt_device);
+}
diff --git a/arch/mips/ath79/dev-common.h b/arch/mips/ath79/dev-common.h
new file mode 100644 (file)
index 0000000..0f514e1
--- /dev/null
@@ -0,0 +1,18 @@
+/*
+ *  Atheros AR71XX/AR724X/AR913X common devices
+ *
+ *  Copyright (C) 2008-2010 Gabor Juhos <juhosg@openwrt.org>
+ *  Copyright (C) 2008 Imre Kaloz <kaloz@openwrt.org>
+ *
+ *  This program is free software; you can redistribute it and/or modify it
+ *  under the terms of the GNU General Public License version 2 as published
+ *  by the Free Software Foundation.
+ */
+
+#ifndef _ATH79_DEV_COMMON_H
+#define _ATH79_DEV_COMMON_H
+
+void ath79_register_uart(void);
+void ath79_register_wdt(void);
+
+#endif /* _ATH79_DEV_COMMON_H */
diff --git a/arch/mips/ath79/dev-gpio-buttons.c b/arch/mips/ath79/dev-gpio-buttons.c
new file mode 100644 (file)
index 0000000..4b0168a
--- /dev/null
@@ -0,0 +1,58 @@
+/*
+ *  Atheros AR71XX/AR724X/AR913X GPIO button support
+ *
+ *  Copyright (C) 2008-2010 Gabor Juhos <juhosg@openwrt.org>
+ *  Copyright (C) 2008 Imre Kaloz <kaloz@openwrt.org>
+ *
+ *  This program is free software; you can redistribute it and/or modify it
+ *  under the terms of the GNU General Public License version 2 as published
+ *  by the Free Software Foundation.
+ */
+
+#include "linux/init.h"
+#include "linux/slab.h"
+#include <linux/platform_device.h>
+
+#include "dev-gpio-buttons.h"
+
+void __init ath79_register_gpio_keys_polled(int id,
+                                           unsigned poll_interval,
+                                           unsigned nbuttons,
+                                           struct gpio_keys_button *buttons)
+{
+       struct platform_device *pdev;
+       struct gpio_keys_platform_data pdata;
+       struct gpio_keys_button *p;
+       int err;
+
+       p = kmalloc(nbuttons * sizeof(*p), GFP_KERNEL);
+       if (!p)
+               return;
+
+       memcpy(p, buttons, nbuttons * sizeof(*p));
+
+       pdev = platform_device_alloc("gpio-keys-polled", id);
+       if (!pdev)
+               goto err_free_buttons;
+
+       memset(&pdata, 0, sizeof(pdata));
+       pdata.poll_interval = poll_interval;
+       pdata.nbuttons = nbuttons;
+       pdata.buttons = p;
+
+       err = platform_device_add_data(pdev, &pdata, sizeof(pdata));
+       if (err)
+               goto err_put_pdev;
+
+       err = platform_device_add(pdev);
+       if (err)
+               goto err_put_pdev;
+
+       return;
+
+err_put_pdev:
+       platform_device_put(pdev);
+
+err_free_buttons:
+       kfree(p);
+}
diff --git a/arch/mips/ath79/dev-gpio-buttons.h b/arch/mips/ath79/dev-gpio-buttons.h
new file mode 100644 (file)
index 0000000..481847a
--- /dev/null
@@ -0,0 +1,23 @@
+/*
+ *  Atheros AR71XX/AR724X/AR913X GPIO button support
+ *
+ *  Copyright (C) 2008-2010 Gabor Juhos <juhosg@openwrt.org>
+ *  Copyright (C) 2008 Imre Kaloz <kaloz@openwrt.org>
+ *
+ *  This program is free software; you can redistribute it and/or modify it
+ *  under the terms of the GNU General Public License version 2 as published
+ *  by the Free Software Foundation.
+ */
+
+#ifndef _ATH79_DEV_GPIO_BUTTONS_H
+#define _ATH79_DEV_GPIO_BUTTONS_H
+
+#include <linux/input.h>
+#include <linux/gpio_keys.h>
+
+void ath79_register_gpio_keys_polled(int id,
+                                    unsigned poll_interval,
+                                    unsigned nbuttons,
+                                    struct gpio_keys_button *buttons);
+
+#endif /* _ATH79_DEV_GPIO_BUTTONS_H */
diff --git a/arch/mips/ath79/dev-leds-gpio.c b/arch/mips/ath79/dev-leds-gpio.c
new file mode 100644 (file)
index 0000000..cdade68
--- /dev/null
@@ -0,0 +1,56 @@
+/*
+ *  Atheros AR71XX/AR724X/AR913X common GPIO LEDs support
+ *
+ *  Copyright (C) 2008-2010 Gabor Juhos <juhosg@openwrt.org>
+ *  Copyright (C) 2008 Imre Kaloz <kaloz@openwrt.org>
+ *
+ *  This program is free software; you can redistribute it and/or modify it
+ *  under the terms of the GNU General Public License version 2 as published
+ *  by the Free Software Foundation.
+ */
+
+#include <linux/init.h>
+#include <linux/slab.h>
+#include <linux/platform_device.h>
+
+#include "dev-leds-gpio.h"
+
+void __init ath79_register_leds_gpio(int id,
+                                    unsigned num_leds,
+                                    struct gpio_led *leds)
+{
+       struct platform_device *pdev;
+       struct gpio_led_platform_data pdata;
+       struct gpio_led *p;
+       int err;
+
+       p = kmalloc(num_leds * sizeof(*p), GFP_KERNEL);
+       if (!p)
+               return;
+
+       memcpy(p, leds, num_leds * sizeof(*p));
+
+       pdev = platform_device_alloc("leds-gpio", id);
+       if (!pdev)
+               goto err_free_leds;
+
+       memset(&pdata, 0, sizeof(pdata));
+       pdata.num_leds = num_leds;
+       pdata.leds = p;
+
+       err = platform_device_add_data(pdev, &pdata, sizeof(pdata));
+       if (err)
+               goto err_put_pdev;
+
+       err = platform_device_add(pdev);
+       if (err)
+               goto err_put_pdev;
+
+       return;
+
+err_put_pdev:
+       platform_device_put(pdev);
+
+err_free_leds:
+       kfree(p);
+}
diff --git a/arch/mips/ath79/dev-leds-gpio.h b/arch/mips/ath79/dev-leds-gpio.h
new file mode 100644 (file)
index 0000000..6e5d885
--- /dev/null
@@ -0,0 +1,21 @@
+/*
+ *  Atheros AR71XX/AR724X/AR913X common GPIO LEDs support
+ *
+ *  Copyright (C) 2008-2010 Gabor Juhos <juhosg@openwrt.org>
+ *  Copyright (C) 2008 Imre Kaloz <kaloz@openwrt.org>
+ *
+ *  This program is free software; you can redistribute it and/or modify it
+ *  under the terms of the GNU General Public License version 2 as published
+ *  by the Free Software Foundation.
+ */
+
+#ifndef _ATH79_DEV_LEDS_GPIO_H
+#define _ATH79_DEV_LEDS_GPIO_H
+
+#include <linux/leds.h>
+
+void ath79_register_leds_gpio(int id,
+                             unsigned num_leds,
+                             struct gpio_led *leds);
+
+#endif /* _ATH79_DEV_LEDS_GPIO_H */
diff --git a/arch/mips/ath79/dev-spi.c b/arch/mips/ath79/dev-spi.c
new file mode 100644 (file)
index 0000000..aa30163
--- /dev/null
@@ -0,0 +1,38 @@
+/*
+ *  Atheros AR71XX/AR724X/AR913X SPI controller device
+ *
+ *  Copyright (C) 2008-2010 Gabor Juhos <juhosg@openwrt.org>
+ *  Copyright (C) 2008 Imre Kaloz <kaloz@openwrt.org>
+ *
+ *  This program is free software; you can redistribute it and/or modify it
+ *  under the terms of the GNU General Public License version 2 as published
+ *  by the Free Software Foundation.
+ */
+
+#include <linux/platform_device.h>
+#include <asm/mach-ath79/ar71xx_regs.h>
+#include "dev-spi.h"
+
+static struct resource ath79_spi_resources[] = {
+       {
+               .start  = AR71XX_SPI_BASE,
+               .end    = AR71XX_SPI_BASE + AR71XX_SPI_SIZE - 1,
+               .flags  = IORESOURCE_MEM,
+       },
+};
+
+static struct platform_device ath79_spi_device = {
+       .name           = "ath79-spi",
+       .id             = -1,
+       .resource       = ath79_spi_resources,
+       .num_resources  = ARRAY_SIZE(ath79_spi_resources),
+};
+
+void __init ath79_register_spi(struct ath79_spi_platform_data *pdata,
+                              struct spi_board_info const *info,
+                              unsigned n)
+{
+       spi_register_board_info(info, n);
+       ath79_spi_device.dev.platform_data = pdata;
+       platform_device_register(&ath79_spi_device);
+}
diff --git a/arch/mips/ath79/dev-spi.h b/arch/mips/ath79/dev-spi.h
new file mode 100644 (file)
index 0000000..d732565
--- /dev/null
@@ -0,0 +1,22 @@
+/*
+ *  Atheros AR71XX/AR724X/AR913X SPI controller device
+ *
+ *  Copyright (C) 2008-2010 Gabor Juhos <juhosg@openwrt.org>
+ *  Copyright (C) 2008 Imre Kaloz <kaloz@openwrt.org>
+ *
+ *  This program is free software; you can redistribute it and/or modify it
+ *  under the terms of the GNU General Public License version 2 as published
+ *  by the Free Software Foundation.
+ */
+
+#ifndef _ATH79_DEV_SPI_H
+#define _ATH79_DEV_SPI_H
+
+#include <linux/spi/spi.h>
+#include <asm/mach-ath79/ath79_spi_platform.h>
+
+void ath79_register_spi(struct ath79_spi_platform_data *pdata,
+                        struct spi_board_info const *info,
+                        unsigned n);
+
+#endif /* _ATH79_DEV_SPI_H */
diff --git a/arch/mips/ath79/early_printk.c b/arch/mips/ath79/early_printk.c
new file mode 100644 (file)
index 0000000..7499b0e
--- /dev/null
@@ -0,0 +1,36 @@
+/*
+ *  Atheros AR71XX/AR724X/AR913X SoC early printk support
+ *
+ *  Copyright (C) 2008-2010 Gabor Juhos <juhosg@openwrt.org>
+ *  Copyright (C) 2008 Imre Kaloz <kaloz@openwrt.org>
+ *
+ *  This program is free software; you can redistribute it and/or modify it
+ *  under the terms of the GNU General Public License version 2 as published
+ *  by the Free Software Foundation.
+ */
+
+#include <linux/io.h>
+#include <linux/serial_reg.h>
+#include <asm/addrspace.h>
+
+#include <asm/mach-ath79/ar71xx_regs.h>
+
+static inline void prom_wait_thre(void __iomem *base)
+{
+       u32 lsr;
+
+       do {
+               lsr = __raw_readl(base + UART_LSR * 4);
+               if (lsr & UART_LSR_THRE)
+                       break;
+       } while (1);
+}
+
+void prom_putchar(unsigned char ch)
+{
+       void __iomem *base = (void __iomem *)(KSEG1ADDR(AR71XX_UART_BASE));
+
+       prom_wait_thre(base);
+       __raw_writel(ch, base + UART_TX * 4);
+       prom_wait_thre(base);
+}
diff --git a/arch/mips/ath79/gpio.c b/arch/mips/ath79/gpio.c
new file mode 100644 (file)
index 0000000..a0c426b
--- /dev/null
@@ -0,0 +1,197 @@
+/*
+ *  Atheros AR71XX/AR724X/AR913X GPIO API support
+ *
+ *  Copyright (C) 2008-2010 Gabor Juhos <juhosg@openwrt.org>
+ *  Copyright (C) 2008 Imre Kaloz <kaloz@openwrt.org>
+ *
+ *  This program is free software; you can redistribute it and/or modify it
+ *  under the terms of the GNU General Public License version 2 as published
+ *  by the Free Software Foundation.
+ */
+
+#include <linux/kernel.h>
+#include <linux/init.h>
+#include <linux/module.h>
+#include <linux/types.h>
+#include <linux/spinlock.h>
+#include <linux/io.h>
+#include <linux/ioport.h>
+#include <linux/gpio.h>
+
+#include <asm/mach-ath79/ar71xx_regs.h>
+#include <asm/mach-ath79/ath79.h>
+#include "common.h"
+
+static void __iomem *ath79_gpio_base;
+static unsigned long ath79_gpio_count;
+static DEFINE_SPINLOCK(ath79_gpio_lock);
+
+static void __ath79_gpio_set_value(unsigned gpio, int value)
+{
+       void __iomem *base = ath79_gpio_base;
+
+       if (value)
+               __raw_writel(1 << gpio, base + AR71XX_GPIO_REG_SET);
+       else
+               __raw_writel(1 << gpio, base + AR71XX_GPIO_REG_CLEAR);
+}
+
+static int __ath79_gpio_get_value(unsigned gpio)
+{
+       return (__raw_readl(ath79_gpio_base + AR71XX_GPIO_REG_IN) >> gpio) & 1;
+}
+
+static int ath79_gpio_get_value(struct gpio_chip *chip, unsigned offset)
+{
+       return __ath79_gpio_get_value(offset);
+}
+
+static void ath79_gpio_set_value(struct gpio_chip *chip,
+                                 unsigned offset, int value)
+{
+       __ath79_gpio_set_value(offset, value);
+}
+
+static int ath79_gpio_direction_input(struct gpio_chip *chip,
+                                      unsigned offset)
+{
+       void __iomem *base = ath79_gpio_base;
+       unsigned long flags;
+
+       spin_lock_irqsave(&ath79_gpio_lock, flags);
+
+       __raw_writel(__raw_readl(base + AR71XX_GPIO_REG_OE) & ~(1 << offset),
+                    base + AR71XX_GPIO_REG_OE);
+
+       spin_unlock_irqrestore(&ath79_gpio_lock, flags);
+
+       return 0;
+}
+
+static int ath79_gpio_direction_output(struct gpio_chip *chip,
+                                       unsigned offset, int value)
+{
+       void __iomem *base = ath79_gpio_base;
+       unsigned long flags;
+
+       spin_lock_irqsave(&ath79_gpio_lock, flags);
+
+       if (value)
+               __raw_writel(1 << offset, base + AR71XX_GPIO_REG_SET);
+       else
+               __raw_writel(1 << offset, base + AR71XX_GPIO_REG_CLEAR);
+
+       __raw_writel(__raw_readl(base + AR71XX_GPIO_REG_OE) | (1 << offset),
+                    base + AR71XX_GPIO_REG_OE);
+
+       spin_unlock_irqrestore(&ath79_gpio_lock, flags);
+
+       return 0;
+}
+
+static struct gpio_chip ath79_gpio_chip = {
+       .label                  = "ath79",
+       .get                    = ath79_gpio_get_value,
+       .set                    = ath79_gpio_set_value,
+       .direction_input        = ath79_gpio_direction_input,
+       .direction_output       = ath79_gpio_direction_output,
+       .base                   = 0,
+};
+
+void ath79_gpio_function_enable(u32 mask)
+{
+       void __iomem *base = ath79_gpio_base;
+       unsigned long flags;
+
+       spin_lock_irqsave(&ath79_gpio_lock, flags);
+
+       __raw_writel(__raw_readl(base + AR71XX_GPIO_REG_FUNC) | mask,
+                    base + AR71XX_GPIO_REG_FUNC);
+       /* flush write */
+       __raw_readl(base + AR71XX_GPIO_REG_FUNC);
+
+       spin_unlock_irqrestore(&ath79_gpio_lock, flags);
+}
+
+void ath79_gpio_function_disable(u32 mask)
+{
+       void __iomem *base = ath79_gpio_base;
+       unsigned long flags;
+
+       spin_lock_irqsave(&ath79_gpio_lock, flags);
+
+       __raw_writel(__raw_readl(base + AR71XX_GPIO_REG_FUNC) & ~mask,
+                    base + AR71XX_GPIO_REG_FUNC);
+       /* flush write */
+       __raw_readl(base + AR71XX_GPIO_REG_FUNC);
+
+       spin_unlock_irqrestore(&ath79_gpio_lock, flags);
+}
+
+void ath79_gpio_function_setup(u32 set, u32 clear)
+{
+       void __iomem *base = ath79_gpio_base;
+       unsigned long flags;
+
+       spin_lock_irqsave(&ath79_gpio_lock, flags);
+
+       __raw_writel((__raw_readl(base + AR71XX_GPIO_REG_FUNC) & ~clear) | set,
+                    base + AR71XX_GPIO_REG_FUNC);
+       /* flush write */
+       __raw_readl(base + AR71XX_GPIO_REG_FUNC);
+
+       spin_unlock_irqrestore(&ath79_gpio_lock, flags);
+}
+
+void __init ath79_gpio_init(void)
+{
+       int err;
+
+       if (soc_is_ar71xx())
+               ath79_gpio_count = AR71XX_GPIO_COUNT;
+       else if (soc_is_ar724x())
+               ath79_gpio_count = AR724X_GPIO_COUNT;
+       else if (soc_is_ar913x())
+               ath79_gpio_count = AR913X_GPIO_COUNT;
+       else
+               BUG();
+
+       ath79_gpio_base = ioremap_nocache(AR71XX_GPIO_BASE, AR71XX_GPIO_SIZE);
+       ath79_gpio_chip.ngpio = ath79_gpio_count;
+
+       err = gpiochip_add(&ath79_gpio_chip);
+       if (err)
+               panic("cannot add AR71xx GPIO chip, error=%d", err);
+}
+
+int gpio_get_value(unsigned gpio)
+{
+       if (gpio < ath79_gpio_count)
+               return __ath79_gpio_get_value(gpio);
+
+       return __gpio_get_value(gpio);
+}
+EXPORT_SYMBOL(gpio_get_value);
+
+void gpio_set_value(unsigned gpio, int value)
+{
+       if (gpio < ath79_gpio_count)
+               __ath79_gpio_set_value(gpio, value);
+       else
+               __gpio_set_value(gpio, value);
+}
+EXPORT_SYMBOL(gpio_set_value);
+
+int gpio_to_irq(unsigned gpio)
+{
+       /* FIXME */
+       return -EINVAL;
+}
+EXPORT_SYMBOL(gpio_to_irq);
+
+int irq_to_gpio(unsigned irq)
+{
+       /* FIXME */
+       return -EINVAL;
+}
+EXPORT_SYMBOL(irq_to_gpio);
diff --git a/arch/mips/ath79/irq.c b/arch/mips/ath79/irq.c
new file mode 100644 (file)
index 0000000..1bf7f71
--- /dev/null
@@ -0,0 +1,187 @@
+/*
+ *  Atheros AR71xx/AR724x/AR913x specific interrupt handling
+ *
+ *  Copyright (C) 2008-2010 Gabor Juhos <juhosg@openwrt.org>
+ *  Copyright (C) 2008 Imre Kaloz <kaloz@openwrt.org>
+ *
+ *  Parts of this file are based on Atheros' 2.6.15 BSP
+ *
+ *  This program is free software; you can redistribute it and/or modify it
+ *  under the terms of the GNU General Public License version 2 as published
+ *  by the Free Software Foundation.
+ */
+
+#include <linux/kernel.h>
+#include <linux/init.h>
+#include <linux/interrupt.h>
+#include <linux/irq.h>
+
+#include <asm/irq_cpu.h>
+#include <asm/mipsregs.h>
+
+#include <asm/mach-ath79/ath79.h>
+#include <asm/mach-ath79/ar71xx_regs.h>
+#include "common.h"
+
+static unsigned int ath79_ip2_flush_reg;
+static unsigned int ath79_ip3_flush_reg;
+
+static void ath79_misc_irq_handler(unsigned int irq, struct irq_desc *desc)
+{
+       void __iomem *base = ath79_reset_base;
+       u32 pending;
+
+       pending = __raw_readl(base + AR71XX_RESET_REG_MISC_INT_STATUS) &
+                 __raw_readl(base + AR71XX_RESET_REG_MISC_INT_ENABLE);
+
+       if (pending & MISC_INT_UART)
+               generic_handle_irq(ATH79_MISC_IRQ_UART);
+
+       else if (pending & MISC_INT_DMA)
+               generic_handle_irq(ATH79_MISC_IRQ_DMA);
+
+       else if (pending & MISC_INT_PERFC)
+               generic_handle_irq(ATH79_MISC_IRQ_PERFC);
+
+       else if (pending & MISC_INT_TIMER)
+               generic_handle_irq(ATH79_MISC_IRQ_TIMER);
+
+       else if (pending & MISC_INT_OHCI)
+               generic_handle_irq(ATH79_MISC_IRQ_OHCI);
+
+       else if (pending & MISC_INT_ERROR)
+               generic_handle_irq(ATH79_MISC_IRQ_ERROR);
+
+       else if (pending & MISC_INT_GPIO)
+               generic_handle_irq(ATH79_MISC_IRQ_GPIO);
+
+       else if (pending & MISC_INT_WDOG)
+               generic_handle_irq(ATH79_MISC_IRQ_WDOG);
+
+       else
+               spurious_interrupt();
+}
+
+static void ar71xx_misc_irq_unmask(unsigned int irq)
+{
+       void __iomem *base = ath79_reset_base;
+       u32 t;
+
+       irq -= ATH79_MISC_IRQ_BASE;
+
+       t = __raw_readl(base + AR71XX_RESET_REG_MISC_INT_ENABLE);
+       __raw_writel(t | (1 << irq), base + AR71XX_RESET_REG_MISC_INT_ENABLE);
+
+       /* flush write */
+       __raw_readl(base + AR71XX_RESET_REG_MISC_INT_ENABLE);
+}
+
+static void ar71xx_misc_irq_mask(unsigned int irq)
+{
+       void __iomem *base = ath79_reset_base;
+       u32 t;
+
+       irq -= ATH79_MISC_IRQ_BASE;
+
+       t = __raw_readl(base + AR71XX_RESET_REG_MISC_INT_ENABLE);
+       __raw_writel(t & ~(1 << irq), base + AR71XX_RESET_REG_MISC_INT_ENABLE);
+
+       /* flush write */
+       __raw_readl(base + AR71XX_RESET_REG_MISC_INT_ENABLE);
+}
+
+static void ar724x_misc_irq_ack(unsigned int irq)
+{
+       void __iomem *base = ath79_reset_base;
+       u32 t;
+
+       irq -= ATH79_MISC_IRQ_BASE;
+
+       t = __raw_readl(base + AR71XX_RESET_REG_MISC_INT_STATUS);
+       __raw_writel(t & ~(1 << irq), base + AR71XX_RESET_REG_MISC_INT_STATUS);
+
+       /* flush write */
+       __raw_readl(base + AR71XX_RESET_REG_MISC_INT_STATUS);
+}
+
+static struct irq_chip ath79_misc_irq_chip = {
+       .name           = "MISC",
+       .unmask         = ar71xx_misc_irq_unmask,
+       .mask           = ar71xx_misc_irq_mask,
+};
+
+static void __init ath79_misc_irq_init(void)
+{
+       void __iomem *base = ath79_reset_base;
+       int i;
+
+       __raw_writel(0, base + AR71XX_RESET_REG_MISC_INT_ENABLE);
+       __raw_writel(0, base + AR71XX_RESET_REG_MISC_INT_STATUS);
+
+       if (soc_is_ar71xx() || soc_is_ar913x())
+               ath79_misc_irq_chip.mask_ack = ar71xx_misc_irq_mask;
+       else if (soc_is_ar724x())
+               ath79_misc_irq_chip.ack = ar724x_misc_irq_ack;
+       else
+               BUG();
+
+       for (i = ATH79_MISC_IRQ_BASE;
+            i < ATH79_MISC_IRQ_BASE + ATH79_MISC_IRQ_COUNT; i++) {
+               irq_desc[i].status = IRQ_DISABLED;
+               set_irq_chip_and_handler(i, &ath79_misc_irq_chip,
+                                        handle_level_irq);
+       }
+
+       set_irq_chained_handler(ATH79_CPU_IRQ_MISC, ath79_misc_irq_handler);
+}
+
+asmlinkage void plat_irq_dispatch(void)
+{
+       unsigned long pending;
+
+       pending = read_c0_status() & read_c0_cause() & ST0_IM;
+
+       if (pending & STATUSF_IP7)
+               do_IRQ(ATH79_CPU_IRQ_TIMER);
+
+       else if (pending & STATUSF_IP2) {
+               ath79_ddr_wb_flush(ath79_ip2_flush_reg);
+               do_IRQ(ATH79_CPU_IRQ_IP2);
+       }
+
+       else if (pending & STATUSF_IP4)
+               do_IRQ(ATH79_CPU_IRQ_GE0);
+
+       else if (pending & STATUSF_IP5)
+               do_IRQ(ATH79_CPU_IRQ_GE1);
+
+       else if (pending & STATUSF_IP3) {
+               ath79_ddr_wb_flush(ath79_ip3_flush_reg);
+               do_IRQ(ATH79_CPU_IRQ_USB);
+       }
+
+       else if (pending & STATUSF_IP6)
+               do_IRQ(ATH79_CPU_IRQ_MISC);
+
+       else
+               spurious_interrupt();
+}
+
+void __init arch_init_irq(void)
+{
+       if (soc_is_ar71xx()) {
+               ath79_ip2_flush_reg = AR71XX_DDR_REG_FLUSH_PCI;
+               ath79_ip3_flush_reg = AR71XX_DDR_REG_FLUSH_USB;
+       } else if (soc_is_ar724x()) {
+               ath79_ip2_flush_reg = AR724X_DDR_REG_FLUSH_PCIE;
+               ath79_ip3_flush_reg = AR724X_DDR_REG_FLUSH_USB;
+       } else if (soc_is_ar913x()) {
+               ath79_ip2_flush_reg = AR913X_DDR_REG_FLUSH_WMAC;
+               ath79_ip3_flush_reg = AR913X_DDR_REG_FLUSH_USB;
+       } else
+               BUG();
+
+       cp0_perfcount_irq = ATH79_MISC_IRQ_PERFC;
+       mips_cpu_irq_init();
+       ath79_misc_irq_init();
+}
diff --git a/arch/mips/ath79/mach-ap81.c b/arch/mips/ath79/mach-ap81.c
new file mode 100644 (file)
index 0000000..eee4c12
--- /dev/null
@@ -0,0 +1,98 @@
+/*
+ *  Atheros AP81 board support
+ *
+ *  Copyright (C) 2009-2010 Gabor Juhos <juhosg@openwrt.org>
+ *  Copyright (C) 2009 Imre Kaloz <kaloz@openwrt.org>
+ *
+ *  This program is free software; you can redistribute it and/or modify it
+ *  under the terms of the GNU General Public License version 2 as published
+ *  by the Free Software Foundation.
+ */
+
+#include "machtypes.h"
+#include "dev-ar913x-wmac.h"
+#include "dev-gpio-buttons.h"
+#include "dev-leds-gpio.h"
+#include "dev-spi.h"
+
+#define AP81_GPIO_LED_STATUS   1
+#define AP81_GPIO_LED_AOSS     3
+#define AP81_GPIO_LED_WLAN     6
+#define AP81_GPIO_LED_POWER    14
+
+#define AP81_GPIO_BTN_SW4      12
+#define AP81_GPIO_BTN_SW1      21
+
+#define AP81_KEYS_POLL_INTERVAL                20      /* msecs */
+#define AP81_KEYS_DEBOUNCE_INTERVAL    (3 * AP81_KEYS_POLL_INTERVAL)
+
+#define AP81_CAL_DATA_ADDR     0x1fff1000
+
+static struct gpio_led ap81_leds_gpio[] __initdata = {
+       {
+               .name           = "ap81:green:status",
+               .gpio           = AP81_GPIO_LED_STATUS,
+               .active_low     = 1,
+       }, {
+               .name           = "ap81:amber:aoss",
+               .gpio           = AP81_GPIO_LED_AOSS,
+               .active_low     = 1,
+       }, {
+               .name           = "ap81:green:wlan",
+               .gpio           = AP81_GPIO_LED_WLAN,
+               .active_low     = 1,
+       }, {
+               .name           = "ap81:green:power",
+               .gpio           = AP81_GPIO_LED_POWER,
+               .active_low     = 1,
+       }
+};
+
+static struct gpio_keys_button ap81_gpio_keys[] __initdata = {
+       {
+               .desc           = "sw1",
+               .type           = EV_KEY,
+               .code           = BTN_0,
+               .debounce_interval = AP81_KEYS_DEBOUNCE_INTERVAL,
+               .gpio           = AP81_GPIO_BTN_SW1,
+               .active_low     = 1,
+       } , {
+               .desc           = "sw4",
+               .type           = EV_KEY,
+               .code           = BTN_1,
+               .debounce_interval = AP81_KEYS_DEBOUNCE_INTERVAL,
+               .gpio           = AP81_GPIO_BTN_SW4,
+               .active_low     = 1,
+       }
+};
+
+static struct spi_board_info ap81_spi_info[] = {
+       {
+               .bus_num        = 0,
+               .chip_select    = 0,
+               .max_speed_hz   = 25000000,
+               .modalias       = "m25p64",
+       }
+};
+
+static struct ath79_spi_platform_data ap81_spi_data = {
+       .bus_num        = 0,
+       .num_chipselect = 1,
+};
+
+static void __init ap81_setup(void)
+{
+       u8 *cal_data = (u8 *) KSEG1ADDR(AP81_CAL_DATA_ADDR);
+
+       ath79_register_leds_gpio(-1, ARRAY_SIZE(ap81_leds_gpio),
+                                ap81_leds_gpio);
+       ath79_register_gpio_keys_polled(-1, AP81_KEYS_POLL_INTERVAL,
+                                       ARRAY_SIZE(ap81_gpio_keys),
+                                       ap81_gpio_keys);
+       ath79_register_spi(&ap81_spi_data, ap81_spi_info,
+                          ARRAY_SIZE(ap81_spi_info));
+       ath79_register_ar913x_wmac(cal_data);
+}
+
+MIPS_MACHINE(ATH79_MACH_AP81, "AP81", "Atheros AP81 reference board",
+            ap81_setup);
diff --git a/arch/mips/ath79/mach-pb44.c b/arch/mips/ath79/mach-pb44.c
new file mode 100644 (file)
index 0000000..ec7b7a1
--- /dev/null
@@ -0,0 +1,118 @@
+/*
+ *  Atheros PB44 reference board support
+ *
+ *  Copyright (C) 2009-2010 Gabor Juhos <juhosg@openwrt.org>
+ *
+ *  This program is free software; you can redistribute it and/or modify it
+ *  under the terms of the GNU General Public License version 2 as published
+ *  by the Free Software Foundation.
+ */
+
+#include <linux/init.h>
+#include <linux/platform_device.h>
+#include <linux/i2c.h>
+#include <linux/i2c-gpio.h>
+#include <linux/i2c/pcf857x.h>
+
+#include "machtypes.h"
+#include "dev-gpio-buttons.h"
+#include "dev-leds-gpio.h"
+#include "dev-spi.h"
+
+#define PB44_GPIO_I2C_SCL      0
+#define PB44_GPIO_I2C_SDA      1
+
+#define PB44_GPIO_EXP_BASE     16
+#define PB44_GPIO_SW_RESET     (PB44_GPIO_EXP_BASE + 6)
+#define PB44_GPIO_SW_JUMP      (PB44_GPIO_EXP_BASE + 8)
+#define PB44_GPIO_LED_JUMP1    (PB44_GPIO_EXP_BASE + 9)
+#define PB44_GPIO_LED_JUMP2    (PB44_GPIO_EXP_BASE + 10)
+
+#define PB44_KEYS_POLL_INTERVAL                20      /* msecs */
+#define PB44_KEYS_DEBOUNCE_INTERVAL    (3 * PB44_KEYS_POLL_INTERVAL)
+
+static struct i2c_gpio_platform_data pb44_i2c_gpio_data = {
+       .sda_pin        = PB44_GPIO_I2C_SDA,
+       .scl_pin        = PB44_GPIO_I2C_SCL,
+};
+
+static struct platform_device pb44_i2c_gpio_device = {
+       .name           = "i2c-gpio",
+       .id             = 0,
+       .dev = {
+               .platform_data  = &pb44_i2c_gpio_data,
+       }
+};
+
+static struct pcf857x_platform_data pb44_pcf857x_data = {
+       .gpio_base      = PB44_GPIO_EXP_BASE,
+};
+
+static struct i2c_board_info pb44_i2c_board_info[] __initdata = {
+       {
+               I2C_BOARD_INFO("pcf8575", 0x20),
+               .platform_data  = &pb44_pcf857x_data,
+       },
+};
+
+static struct gpio_led pb44_leds_gpio[] __initdata = {
+       {
+               .name           = "pb44:amber:jump1",
+               .gpio           = PB44_GPIO_LED_JUMP1,
+               .active_low     = 1,
+       }, {
+               .name           = "pb44:green:jump2",
+               .gpio           = PB44_GPIO_LED_JUMP2,
+               .active_low     = 1,
+       },
+};
+
+static struct gpio_keys_button pb44_gpio_keys[] __initdata = {
+       {
+               .desc           = "soft_reset",
+               .type           = EV_KEY,
+               .code           = KEY_RESTART,
+               .debounce_interval = PB44_KEYS_DEBOUNCE_INTERVAL,
+               .gpio           = PB44_GPIO_SW_RESET,
+               .active_low     = 1,
+       } , {
+               .desc           = "jumpstart",
+               .type           = EV_KEY,
+               .code           = KEY_WPS_BUTTON,
+               .debounce_interval = PB44_KEYS_DEBOUNCE_INTERVAL,
+               .gpio           = PB44_GPIO_SW_JUMP,
+               .active_low     = 1,
+       }
+};
+
+static struct spi_board_info pb44_spi_info[] = {
+       {
+               .bus_num        = 0,
+               .chip_select    = 0,
+               .max_speed_hz   = 25000000,
+               .modalias       = "m25p64",
+       },
+};
+
+static struct ath79_spi_platform_data pb44_spi_data = {
+       .bus_num                = 0,
+       .num_chipselect         = 1,
+};
+
+static void __init pb44_init(void)
+{
+       i2c_register_board_info(0, pb44_i2c_board_info,
+                               ARRAY_SIZE(pb44_i2c_board_info));
+       platform_device_register(&pb44_i2c_gpio_device);
+
+       ath79_register_leds_gpio(-1, ARRAY_SIZE(pb44_leds_gpio),
+                                pb44_leds_gpio);
+       ath79_register_gpio_keys_polled(-1, PB44_KEYS_POLL_INTERVAL,
+                                       ARRAY_SIZE(pb44_gpio_keys),
+                                       pb44_gpio_keys);
+       ath79_register_spi(&pb44_spi_data, pb44_spi_info,
+                          ARRAY_SIZE(pb44_spi_info));
+}
+
+MIPS_MACHINE(ATH79_MACH_PB44, "PB44", "Atheros PB44 reference board",
+            pb44_init);
diff --git a/arch/mips/ath79/machtypes.h b/arch/mips/ath79/machtypes.h
new file mode 100644 (file)
index 0000000..3940fe4
--- /dev/null
@@ -0,0 +1,23 @@
+/*
+ *  Atheros AR71XX/AR724X/AR913X machine type definitions
+ *
+ *  Copyright (C) 2008-2010 Gabor Juhos <juhosg@openwrt.org>
+ *  Copyright (C) 2008 Imre Kaloz <kaloz@openwrt.org>
+ *
+ *  This program is free software; you can redistribute it and/or modify it
+ *  under the terms of the GNU General Public License version 2 as published
+ *  by the Free Software Foundation.
+ */
+
+#ifndef _ATH79_MACHTYPE_H
+#define _ATH79_MACHTYPE_H
+
+#include <asm/mips_machine.h>
+
+enum ath79_mach_type {
+       ATH79_MACH_GENERIC = 0,
+       ATH79_MACH_AP81,                /* Atheros AP81 reference board */
+       ATH79_MACH_PB44,                /* Atheros PB44 reference board */
+};
+
+#endif /* _ATH79_MACHTYPE_H */
diff --git a/arch/mips/ath79/prom.c b/arch/mips/ath79/prom.c
new file mode 100644 (file)
index 0000000..e9cbd7c
--- /dev/null
@@ -0,0 +1,57 @@
+/*
+ *  Atheros AR71XX/AR724X/AR913X specific prom routines
+ *
+ *  Copyright (C) 2008-2010 Gabor Juhos <juhosg@openwrt.org>
+ *  Copyright (C) 2008 Imre Kaloz <kaloz@openwrt.org>
+ *
+ *  This program is free software; you can redistribute it and/or modify it
+ *  under the terms of the GNU General Public License version 2 as published
+ *  by the Free Software Foundation.
+ */
+
+#include <linux/kernel.h>
+#include <linux/init.h>
+#include <linux/io.h>
+#include <linux/string.h>
+
+#include <asm/bootinfo.h>
+#include <asm/addrspace.h>
+
+#include "common.h"
+
+static inline int is_valid_ram_addr(void *addr)
+{
+       if (((u32) addr > KSEG0) &&
+           ((u32) addr < (KSEG0 + ATH79_MEM_SIZE_MAX)))
+               return 1;
+
+       if (((u32) addr > KSEG1) &&
+           ((u32) addr < (KSEG1 + ATH79_MEM_SIZE_MAX)))
+               return 1;
+
+       return 0;
+}
+
+static __init void ath79_prom_init_cmdline(int argc, char **argv)
+{
+       int i;
+
+       if (!is_valid_ram_addr(argv))
+               return;
+
+       for (i = 0; i < argc; i++)
+               if (is_valid_ram_addr(argv[i])) {
+                       strlcat(arcs_cmdline, " ", sizeof(arcs_cmdline));
+                       strlcat(arcs_cmdline, argv[i], sizeof(arcs_cmdline));
+               }
+}
+
+void __init prom_init(void)
+{
+       ath79_prom_init_cmdline(fw_arg0, (char **)fw_arg1);
+}
+
+void __init prom_free_prom_memory(void)
+{
+       /* We do not have to prom memory to free */
+}
diff --git a/arch/mips/ath79/setup.c b/arch/mips/ath79/setup.c
new file mode 100644 (file)
index 0000000..159b42f
--- /dev/null
@@ -0,0 +1,206 @@
+/*
+ *  Atheros AR71XX/AR724X/AR913X specific setup
+ *
+ *  Copyright (C) 2008-2011 Gabor Juhos <juhosg@openwrt.org>
+ *  Copyright (C) 2008 Imre Kaloz <kaloz@openwrt.org>
+ *
+ *  Parts of this file are based on Atheros' 2.6.15 BSP
+ *
+ *  This program is free software; you can redistribute it and/or modify it
+ *  under the terms of the GNU General Public License version 2 as published
+ *  by the Free Software Foundation.
+ */
+
+#include <linux/kernel.h>
+#include <linux/init.h>
+#include <linux/bootmem.h>
+#include <linux/err.h>
+#include <linux/clk.h>
+
+#include <asm/bootinfo.h>
+#include <asm/time.h>          /* for mips_hpt_frequency */
+#include <asm/reboot.h>                /* for _machine_{restart,halt} */
+#include <asm/mips_machine.h>
+
+#include <asm/mach-ath79/ath79.h>
+#include <asm/mach-ath79/ar71xx_regs.h>
+#include "common.h"
+#include "dev-common.h"
+#include "machtypes.h"
+
+#define ATH79_SYS_TYPE_LEN     64
+
+#define AR71XX_BASE_FREQ       40000000
+#define AR724X_BASE_FREQ       5000000
+#define AR913X_BASE_FREQ       5000000
+
+static char ath79_sys_type[ATH79_SYS_TYPE_LEN];
+
+static void ath79_restart(char *command)
+{
+       ath79_device_reset_set(AR71XX_RESET_FULL_CHIP);
+       for (;;)
+               if (cpu_wait)
+                       cpu_wait();
+}
+
+static void ath79_halt(void)
+{
+       while (1)
+               cpu_wait();
+}
+
+static void __init ath79_detect_mem_size(void)
+{
+       unsigned long size;
+
+       for (size = ATH79_MEM_SIZE_MIN; size < ATH79_MEM_SIZE_MAX;
+            size <<= 1) {
+               if (!memcmp(ath79_detect_mem_size,
+                           ath79_detect_mem_size + size, 1024))
+                       break;
+       }
+
+       add_memory_region(0, size, BOOT_MEM_RAM);
+}
+
+static void __init ath79_detect_sys_type(void)
+{
+       char *chip = "????";
+       u32 id;
+       u32 major;
+       u32 minor;
+       u32 rev = 0;
+
+       id = ath79_reset_rr(AR71XX_RESET_REG_REV_ID);
+       major = id & REV_ID_MAJOR_MASK;
+
+       switch (major) {
+       case REV_ID_MAJOR_AR71XX:
+               minor = id & AR71XX_REV_ID_MINOR_MASK;
+               rev = id >> AR71XX_REV_ID_REVISION_SHIFT;
+               rev &= AR71XX_REV_ID_REVISION_MASK;
+               switch (minor) {
+               case AR71XX_REV_ID_MINOR_AR7130:
+                       ath79_soc = ATH79_SOC_AR7130;
+                       chip = "7130";
+                       break;
+
+               case AR71XX_REV_ID_MINOR_AR7141:
+                       ath79_soc = ATH79_SOC_AR7141;
+                       chip = "7141";
+                       break;
+
+               case AR71XX_REV_ID_MINOR_AR7161:
+                       ath79_soc = ATH79_SOC_AR7161;
+                       chip = "7161";
+                       break;
+               }
+               break;
+
+       case REV_ID_MAJOR_AR7240:
+               ath79_soc = ATH79_SOC_AR7240;
+               chip = "7240";
+               rev = (id & AR724X_REV_ID_REVISION_MASK);
+               break;
+
+       case REV_ID_MAJOR_AR7241:
+               ath79_soc = ATH79_SOC_AR7241;
+               chip = "7241";
+               rev = (id & AR724X_REV_ID_REVISION_MASK);
+               break;
+
+       case REV_ID_MAJOR_AR7242:
+               ath79_soc = ATH79_SOC_AR7242;
+               chip = "7242";
+               rev = (id & AR724X_REV_ID_REVISION_MASK);
+               break;
+
+       case REV_ID_MAJOR_AR913X:
+               minor = id & AR913X_REV_ID_MINOR_MASK;
+               rev = id >> AR913X_REV_ID_REVISION_SHIFT;
+               rev &= AR913X_REV_ID_REVISION_MASK;
+               switch (minor) {
+               case AR913X_REV_ID_MINOR_AR9130:
+                       ath79_soc = ATH79_SOC_AR9130;
+                       chip = "9130";
+                       break;
+
+               case AR913X_REV_ID_MINOR_AR9132:
+                       ath79_soc = ATH79_SOC_AR9132;
+                       chip = "9132";
+                       break;
+               }
+               break;
+
+       default:
+               panic("ath79: unknown SoC, id:0x%08x\n", id);
+       }
+
+       sprintf(ath79_sys_type, "Atheros AR%s rev %u", chip, rev);
+       pr_info("SoC: %s\n", ath79_sys_type);
+}
+
+const char *get_system_type(void)
+{
+       return ath79_sys_type;
+}
+
+unsigned int __cpuinit get_c0_compare_int(void)
+{
+       return CP0_LEGACY_COMPARE_IRQ;
+}
+
+void __init plat_mem_setup(void)
+{
+       set_io_port_base(KSEG1);
+
+       ath79_reset_base = ioremap_nocache(AR71XX_RESET_BASE,
+                                          AR71XX_RESET_SIZE);
+       ath79_pll_base = ioremap_nocache(AR71XX_PLL_BASE,
+                                        AR71XX_PLL_SIZE);
+       ath79_ddr_base = ioremap_nocache(AR71XX_DDR_CTRL_BASE,
+                                        AR71XX_DDR_CTRL_SIZE);
+
+       ath79_detect_sys_type();
+       ath79_detect_mem_size();
+       ath79_clocks_init();
+
+       _machine_restart = ath79_restart;
+       _machine_halt = ath79_halt;
+       pm_power_off = ath79_halt;
+}
+
+void __init plat_time_init(void)
+{
+       struct clk *clk;
+
+       clk = clk_get(NULL, "cpu");
+       if (IS_ERR(clk))
+               panic("unable to get CPU clock, err=%ld", PTR_ERR(clk));
+
+       mips_hpt_frequency = clk_get_rate(clk) / 2;
+}
+
+static int __init ath79_setup(void)
+{
+       ath79_gpio_init();
+       ath79_register_uart();
+       ath79_register_wdt();
+
+       mips_machine_setup();
+
+       return 0;
+}
+
+arch_initcall(ath79_setup);
+
+static void __init ath79_generic_init(void)
+{
+       /* Nothing to do */
+}
+
+MIPS_MACHINE(ATH79_MACH_GENERIC,
+            "Generic",
+            "Generic AR71XX/AR724X/AR913X based board",
+            ath79_generic_init);
index c78c7e7e41dfc2e8df3afd146c18f5891fd54242..6cd5a519ce5c26338b67a3f2c88238fd53aff5c6 100644 (file)
@@ -14,7 +14,7 @@ CONFIG_SYSFS_DEPRECATED_V2=y
 CONFIG_RELAY=y
 CONFIG_BLK_DEV_INITRD=y
 CONFIG_RD_LZMA=y
-CONFIG_EMBEDDED=y
+CONFIG_EXPERT=y
 # CONFIG_KALLSYMS is not set
 # CONFIG_ELF_CORE is not set
 # CONFIG_PCSPKR_PLATFORM is not set
index 927d58b2cd037d2ade5b060e90185bca10027994..22fdf2f0cc236922976f26a2281b9940589576c8 100644 (file)
@@ -21,7 +21,7 @@ CONFIG_CGROUP_CPUACCT=y
 CONFIG_RELAY=y
 CONFIG_BLK_DEV_INITRD=y
 CONFIG_RD_LZMA=y
-CONFIG_EMBEDDED=y
+CONFIG_EXPERT=y
 CONFIG_SLAB=y
 CONFIG_MODULES=y
 CONFIG_MODULE_UNLOAD=y
index b806a4e32896c97dd1d9237fa5cfa588dd450f06..919005139f5a310442baf561dc6749a2326ec044 100644 (file)
@@ -10,7 +10,7 @@ CONFIG_EXPERIMENTAL=y
 # CONFIG_SWAP is not set
 CONFIG_TINY_RCU=y
 CONFIG_SYSFS_DEPRECATED_V2=y
-CONFIG_EMBEDDED=y
+CONFIG_EXPERT=y
 # CONFIG_PCSPKR_PLATFORM is not set
 # CONFIG_FUTEX is not set
 # CONFIG_EPOLL is not set
index 9749bc8758dbf95593a2201877785223728b063a..1cdff6b6327d2753b41f76e348ee0bde97cc84dc 100644 (file)
@@ -26,7 +26,7 @@ CONFIG_PID_NS=y
 CONFIG_NET_NS=y
 CONFIG_BLK_DEV_INITRD=y
 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
-CONFIG_EMBEDDED=y
+CONFIG_EXPERT=y
 # CONFIG_SYSCTL_SYSCALL is not set
 # CONFIG_PCSPKR_PLATFORM is not set
 CONFIG_SLAB=y
index 502a8e9c084b4b8b5b8726cd53af32a06bbe638d..5135dc0b950aadbd325a0826c5918f8cca5bd6c4 100644 (file)
@@ -4,7 +4,7 @@ CONFIG_EXPERIMENTAL=y
 CONFIG_SYSVIPC=y
 CONFIG_LOG_BUF_SHIFT=14
 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
-CONFIG_EMBEDDED=y
+CONFIG_EXPERT=y
 CONFIG_SLAB=y
 CONFIG_MODULES=y
 CONFIG_MODULE_UNLOAD=y
index 3567b6f07b37c6221a53a07f65ce1c53c26ea3d4..75165dfa60c10990216691c95c2f25530b0a1fdf 100644 (file)
@@ -15,7 +15,7 @@ CONFIG_SYSFS_DEPRECATED_V2=y
 CONFIG_RELAY=y
 CONFIG_BLK_DEV_INITRD=y
 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
-CONFIG_EMBEDDED=y
+CONFIG_EXPERT=y
 # CONFIG_PCSPKR_PLATFORM is not set
 CONFIG_SLAB=y
 CONFIG_MODULES=y
index 6c4f7e9d33838dc5af7780e7343eb4336f88d343..5419adb219a84080eab0d4df2e6c20bf9eaa6b3e 100644 (file)
@@ -4,7 +4,7 @@ CONFIG_SYSVIPC=y
 CONFIG_LOG_BUF_SHIFT=14
 CONFIG_RELAY=y
 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
-CONFIG_EMBEDDED=y
+CONFIG_EXPERT=y
 CONFIG_MODULES=y
 CONFIG_MODULE_UNLOAD=y
 # CONFIG_BLK_DEV_BSG is not set
index dda158b2c8dc497ed77b30a3698fdeeeb7f1df1a..4044c9e0fb737d9962ad17178b8c05e14ffeaa9a 100644 (file)
@@ -11,7 +11,7 @@ CONFIG_POSIX_MQUEUE=y
 CONFIG_TINY_RCU=y
 CONFIG_LOG_BUF_SHIFT=14
 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
-CONFIG_EMBEDDED=y
+CONFIG_EXPERT=y
 # CONFIG_KALLSYMS is not set
 # CONFIG_PCSPKR_PLATFORM is not set
 # CONFIG_VM_EVENT_COUNTERS is not set
index 7e4fc76df53821d11892415e04ff47f6b41f9a18..c6b49938ee84d15e0fe4e12a447cca04d93e9713 100644 (file)
@@ -11,7 +11,7 @@ CONFIG_SYSVIPC=y
 CONFIG_POSIX_MQUEUE=y
 CONFIG_TINY_RCU=y
 CONFIG_LOG_BUF_SHIFT=14
-CONFIG_EMBEDDED=y
+CONFIG_EXPERT=y
 # CONFIG_SYSCTL_SYSCALL is not set
 # CONFIG_KALLSYMS is not set
 # CONFIG_PCSPKR_PLATFORM is not set
index 6fe205fa7b61105f6d90f898774f449e7185ccae..1f69249b839a1286f1455e78246641823628a6bf 100644 (file)
@@ -12,7 +12,7 @@ CONFIG_SYSVIPC=y
 CONFIG_POSIX_MQUEUE=y
 CONFIG_TINY_RCU=y
 CONFIG_LOG_BUF_SHIFT=14
-CONFIG_EMBEDDED=y
+CONFIG_EXPERT=y
 # CONFIG_SYSCTL_SYSCALL is not set
 # CONFIG_KALLSYMS is not set
 # CONFIG_PCSPKR_PLATFORM is not set
index a741c55448d078bdf693338e58462e141105f5b3..b6e21c7cb6bdd533fb4a1d90e42de2751d4f7e43 100644 (file)
@@ -10,7 +10,7 @@ CONFIG_LOCALVERSION="-db1500"
 CONFIG_KERNEL_LZMA=y
 CONFIG_SYSVIPC=y
 CONFIG_LOG_BUF_SHIFT=14
-CONFIG_EMBEDDED=y
+CONFIG_EXPERT=y
 # CONFIG_KALLSYMS is not set
 # CONFIG_PCSPKR_PLATFORM is not set
 # CONFIG_VM_EVENT_COUNTERS is not set
index cd32dd8c800810e14b129446f6e91627ac871b1d..798a553c9e80fb7154df4e42dcb06e1d9c7d7382 100644 (file)
@@ -11,7 +11,7 @@ CONFIG_SYSVIPC=y
 CONFIG_POSIX_MQUEUE=y
 CONFIG_TINY_RCU=y
 CONFIG_LOG_BUF_SHIFT=14
-CONFIG_EMBEDDED=y
+CONFIG_EXPERT=y
 # CONFIG_SYSCTL_SYSCALL is not set
 # CONFIG_KALLSYMS is not set
 # CONFIG_PCSPKR_PLATFORM is not set
index b15bfd1e69c820e5836f252f10e7d4047d3fd117..87d0340837aa8a03ce50bc80c2c508a3f1d2840f 100644 (file)
@@ -4,7 +4,7 @@ CONFIG_EXPERIMENTAL=y
 CONFIG_SYSVIPC=y
 CONFIG_LOG_BUF_SHIFT=14
 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
-CONFIG_EMBEDDED=y
+CONFIG_EXPERT=y
 # CONFIG_SYSCTL_SYSCALL is not set
 # CONFIG_HOTPLUG is not set
 CONFIG_SLAB=y
index 0b60c06a943d28d4413f642cfa36770cb63f8a6a..0126e66d60cbbf92a0a59a68abbf06ada87fe599 100644 (file)
@@ -4,7 +4,7 @@ CONFIG_EXPERIMENTAL=y
 CONFIG_SYSVIPC=y
 CONFIG_LOG_BUF_SHIFT=14
 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
-CONFIG_EMBEDDED=y
+CONFIG_EXPERT=y
 # CONFIG_HOTPLUG is not set
 CONFIG_SLAB=y
 CONFIG_MODULES=y
index 63944a14b816acef585942ae6aa485959492a128..e5b73de08fc5057f82378cc8ff57221f94151db1 100644 (file)
@@ -17,7 +17,7 @@ CONFIG_NAMESPACES=y
 CONFIG_USER_NS=y
 CONFIG_PID_NS=y
 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
-CONFIG_EMBEDDED=y
+CONFIG_EXPERT=y
 # CONFIG_PCSPKR_PLATFORM is not set
 # CONFIG_COMPAT_BRK is not set
 CONFIG_SLAB=y
index 53edc134f27495f61ff0e3b3ba82abc5e34a4929..48a40aefaf58fa615985e2f41eb07b7c2dbf04d6 100644 (file)
@@ -11,7 +11,7 @@ CONFIG_BSD_PROCESS_ACCT_V3=y
 CONFIG_RELAY=y
 CONFIG_BLK_DEV_INITRD=y
 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
-CONFIG_EMBEDDED=y
+CONFIG_EXPERT=y
 CONFIG_SLAB=y
 CONFIG_PROFILING=y
 CONFIG_MODULES=y
index 36de199f4c27790bf137cd98ed1efad9b3b687bb..d1606569b0019d735e571f6652c52816ce34c6f7 100644 (file)
@@ -17,7 +17,7 @@ CONFIG_IPC_NS=y
 CONFIG_USER_NS=y
 CONFIG_PID_NS=y
 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
-CONFIG_EMBEDDED=y
+CONFIG_EXPERT=y
 # CONFIG_HOTPLUG is not set
 # CONFIG_PCSPKR_PLATFORM is not set
 # CONFIG_COMPAT_BRK is not set
index 4b16c48b0c3647ddab040a9a43e2ddc3da6518d8..0e36abcd39ccfbdfa315965e250c453ebd2d692d 100644 (file)
@@ -15,7 +15,7 @@ CONFIG_CGROUPS=y
 CONFIG_CPUSETS=y
 CONFIG_RELAY=y
 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
-CONFIG_EMBEDDED=y
+CONFIG_EXPERT=y
 # CONFIG_PCSPKR_PLATFORM is not set
 CONFIG_SLAB=y
 CONFIG_MODULES=y
index 98f2c7736e871c19b5d9fbca65079a59e1aa7f5f..4dbf6269b3f90774a70a5ecb5496fae00e2fbeaf 100644 (file)
@@ -8,7 +8,7 @@ CONFIG_IKCONFIG_PROC=y
 CONFIG_LOG_BUF_SHIFT=14
 CONFIG_RELAY=y
 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
-CONFIG_EMBEDDED=y
+CONFIG_EXPERT=y
 # CONFIG_HOTPLUG is not set
 CONFIG_SLAB=y
 CONFIG_MODULES=y
index 5bea99b26fa80c938c604238ce5281e28621316b..7bbd52194fc3f847fd44e949ae660b132cd9bc58 100644 (file)
@@ -10,7 +10,7 @@ CONFIG_IKCONFIG_PROC=y
 CONFIG_LOG_BUF_SHIFT=14
 CONFIG_SYSFS_DEPRECATED_V2=y
 CONFIG_RELAY=y
-CONFIG_EMBEDDED=y
+CONFIG_EXPERT=y
 CONFIG_SLAB=y
 CONFIG_PROFILING=y
 CONFIG_OPROFILE=m
index 6ae46bcdb20b6c399c97412d063c8db6efd458db..92a60aecad5ceaac2450ca3692fa15419a26b0f0 100644 (file)
@@ -10,7 +10,7 @@ CONFIG_IKCONFIG_PROC=y
 CONFIG_LOG_BUF_SHIFT=14
 CONFIG_RELAY=y
 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
-CONFIG_EMBEDDED=y
+CONFIG_EXPERT=y
 # CONFIG_SYSCTL_SYSCALL is not set
 CONFIG_SLAB=y
 CONFIG_MODULES=y
index bf24e9309b9c9147a0f9a343d27efd110c6ff873..db5705e18b366564f660a4c74e201e70b34e29e3 100644 (file)
@@ -4,7 +4,7 @@ CONFIG_TOSHIBA_JMR3927=y
 CONFIG_SYSVIPC=y
 CONFIG_LOG_BUF_SHIFT=14
 CONFIG_SYSFS_DEPRECATED_V2=y
-CONFIG_EMBEDDED=y
+CONFIG_EXPERT=y
 # CONFIG_HOTPLUG is not set
 # CONFIG_PCSPKR_PLATFORM is not set
 CONFIG_SLAB=y
index 6447261c61d0aa523d80ee802d60d0ff8f868589..d9f3db29ab95aa637471ec8468a02b7335eae489 100644 (file)
@@ -8,7 +8,7 @@ CONFIG_HZ_1000=y
 CONFIG_EXPERIMENTAL=y
 CONFIG_SYSVIPC=y
 CONFIG_LOG_BUF_SHIFT=14
-CONFIG_EMBEDDED=y
+CONFIG_EXPERT=y
 # CONFIG_SYSCTL_SYSCALL is not set
 # CONFIG_KALLSYMS is not set
 # CONFIG_HOTPLUG is not set
index f7033f3a5822b9914fbe9009f4338b4b7eed11b0..167c1d07b8091d03a86eef28960af143a48dccae 100644 (file)
@@ -21,7 +21,7 @@ CONFIG_BLK_DEV_INITRD=y
 CONFIG_RD_BZIP2=y
 CONFIG_RD_LZMA=y
 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
-CONFIG_EMBEDDED=y
+CONFIG_EXPERT=y
 CONFIG_PROFILING=y
 CONFIG_OPROFILE=m
 CONFIG_MODULES=y
index b455d0f36486a2accaa96d5ccc997d7d99b0b200..7270f3183bdaacf27af3e347236dfb5961a1293c 100644 (file)
@@ -15,7 +15,7 @@ CONFIG_UTS_NS=y
 CONFIG_IPC_NS=y
 CONFIG_PID_NS=y
 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
-CONFIG_EMBEDDED=y
+CONFIG_EXPERT=y
 # CONFIG_SYSCTL_SYSCALL is not set
 # CONFIG_COMPAT_BRK is not set
 CONFIG_SLAB=y
@@ -369,7 +369,10 @@ CONFIG_VT_HW_CONSOLE_BINDING=y
 CONFIG_SERIAL_8250=y
 CONFIG_SERIAL_8250_CONSOLE=y
 # CONFIG_HWMON is not set
+CONFIG_FB=y
+CONFIG_FB_CIRRUS=y
 # CONFIG_VGA_CONSOLE is not set
+CONFIG_FRAMEBUFFER_CONSOLE=y
 CONFIG_HID=m
 CONFIG_LEDS_CLASS=m
 CONFIG_LEDS_TRIGGER_TIMER=m
index 86bf001babe99a1049f8af64cb55effadf1f792f..9c9a123016c056eb535193be96fff1d8eee76e56 100644 (file)
@@ -9,7 +9,7 @@ CONFIG_IKCONFIG=y
 CONFIG_IKCONFIG_PROC=y
 CONFIG_LOG_BUF_SHIFT=14
 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
-CONFIG_EMBEDDED=y
+CONFIG_EXPERT=y
 CONFIG_SLAB=y
 CONFIG_MODULES=y
 CONFIG_MODULE_UNLOAD=y
index 4925f507dc21be7472fe15ba281014c0409b8454..b5ad7387bbb0675acb4ec51e0ad8cc4e4ac9f3c2 100644 (file)
@@ -7,7 +7,7 @@ CONFIG_EXPERIMENTAL=y
 CONFIG_SYSVIPC=y
 CONFIG_LOG_BUF_SHIFT=14
 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
-CONFIG_EMBEDDED=y
+CONFIG_EXPERT=y
 CONFIG_SLAB=y
 CONFIG_MODULES=y
 CONFIG_MODULE_UNLOAD=y
index efb779f8f6fe0da4f35ddaec00eed93f56814861..c16de9812920fab2630018924249c79e8f55dcf0 100644 (file)
@@ -5,7 +5,7 @@ CONFIG_SYSVIPC=y
 CONFIG_LOG_BUF_SHIFT=14
 CONFIG_RELAY=y
 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
-CONFIG_EMBEDDED=y
+CONFIG_EXPERT=y
 CONFIG_SLAB=y
 CONFIG_MODULES=y
 CONFIG_MODULE_UNLOAD=y
index ab051458452bfffd961a5c225f4b732ea9d92118..d1142e9cd9a17169c93bda81a30180b56cd6e37f 100644 (file)
@@ -8,7 +8,7 @@ CONFIG_LOCALVERSION="-pmc"
 CONFIG_SYSVIPC=y
 CONFIG_LOG_BUF_SHIFT=14
 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
-CONFIG_EMBEDDED=y
+CONFIG_EXPERT=y
 # CONFIG_SHMEM is not set
 CONFIG_SLAB=y
 CONFIG_MODULES=y
index 814699754e0d988e042a50fdba29531dc1b5aff4..a97a42c6b2c84407df63a22a4b1581b1ddb18f56 100644 (file)
@@ -11,7 +11,7 @@ CONFIG_AUDIT=y
 CONFIG_RELAY=y
 CONFIG_BLK_DEV_INITRD=y
 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
-CONFIG_EMBEDDED=y
+CONFIG_EXPERT=y
 CONFIG_SLAB=y
 CONFIG_PROFILING=y
 CONFIG_OPROFILE=m
index 1597aa1842faa4f7764090469da13eee05cbc9b1..75eb1b1f316c3e4ef54fcfe2f3af0221681edc7e 100644 (file)
@@ -11,7 +11,7 @@ CONFIG_SYSVIPC=y
 CONFIG_POSIX_MQUEUE=y
 CONFIG_TINY_RCU=y
 CONFIG_LOG_BUF_SHIFT=14
-CONFIG_EMBEDDED=y
+CONFIG_EXPERT=y
 # CONFIG_SYSCTL_SYSCALL is not set
 # CONFIG_KALLSYMS is not set
 # CONFIG_PCSPKR_PLATFORM is not set
index 96f0d43cf08b7561f4d186b65fff4e0a0217b36b..dcbe2704e5edfa0cc09c98123384e7679883dd92 100644 (file)
@@ -12,7 +12,7 @@ CONFIG_SYSVIPC=y
 CONFIG_POSIX_MQUEUE=y
 CONFIG_TINY_RCU=y
 CONFIG_LOG_BUF_SHIFT=14
-CONFIG_EMBEDDED=y
+CONFIG_EXPERT=y
 # CONFIG_SYSCTL_SYSCALL is not set
 # CONFIG_KALLSYMS is not set
 # CONFIG_PCSPKR_PLATFORM is not set
index b4bfd4823458d4d8ec2e495e347afd11c7ac96a6..fa00487146f862bc20bcfdbc5cf3db9eacdd85c2 100644 (file)
@@ -11,7 +11,7 @@ CONFIG_SYSVIPC=y
 CONFIG_POSIX_MQUEUE=y
 CONFIG_TINY_RCU=y
 CONFIG_LOG_BUF_SHIFT=14
-CONFIG_EMBEDDED=y
+CONFIG_EXPERT=y
 # CONFIG_SYSCTL_SYSCALL is not set
 # CONFIG_KALLSYMS is not set
 # CONFIG_PCSPKR_PLATFORM is not set
index 5a660024d22a60a2ff0be3c6f3e0bf1ecf5c1cf5..e83d6497e8b4edfb8d73983dc88c357e91055f16 100644 (file)
@@ -11,7 +11,7 @@ CONFIG_SYSVIPC=y
 CONFIG_POSIX_MQUEUE=y
 CONFIG_TINY_RCU=y
 CONFIG_LOG_BUF_SHIFT=14
-CONFIG_EMBEDDED=y
+CONFIG_EXPERT=y
 # CONFIG_SYSCTL_SYSCALL is not set
 # CONFIG_KALLSYMS is not set
 # CONFIG_PCSPKR_PLATFORM is not set
index 39926a1a96b67b976617dd565493a197b1ed966f..f2925769dfa3b581923b8d7575b132e78b7c9297 100644 (file)
@@ -11,7 +11,7 @@ CONFIG_EXPERIMENTAL=y
 CONFIG_SYSVIPC=y
 CONFIG_LOG_BUF_SHIFT=14
 CONFIG_SYSFS_DEPRECATED_V2=y
-CONFIG_EMBEDDED=y
+CONFIG_EXPERT=y
 CONFIG_SLAB=y
 CONFIG_MODULES=y
 CONFIG_MODULE_UNLOAD=y
index 3376bc8616cc16f32ecc46071371ce6cd1c011f6..1d1f2067f3e661674488d72ffef87b8cfbbb292b 100644 (file)
@@ -6,7 +6,7 @@ CONFIG_IKCONFIG_PROC=y
 CONFIG_LOG_BUF_SHIFT=14
 CONFIG_BLK_DEV_INITRD=y
 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
-CONFIG_EMBEDDED=y
+CONFIG_EXPERT=y
 # CONFIG_SYSCTL_SYSCALL is not set
 CONFIG_SLAB=y
 CONFIG_MODULES=y
index 6514f1bf0afb760dc7626ef490164f137e2933f7..15c66a571f99bdc4a9d2f89253e2a4068fac4464 100644 (file)
@@ -6,7 +6,7 @@ CONFIG_IKCONFIG_PROC=y
 CONFIG_LOG_BUF_SHIFT=14
 CONFIG_BLK_DEV_INITRD=y
 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
-CONFIG_EMBEDDED=y
+CONFIG_EXPERT=y
 # CONFIG_SYSCTL_SYSCALL is not set
 # CONFIG_HOTPLUG is not set
 CONFIG_SLAB=y
index f1f58e91dd80664edf5bca4f688b68fe67d751f8..3b0b6e8c85334d610099d554f5a7a72b941ffee9 100644 (file)
@@ -14,7 +14,7 @@ CONFIG_RELAY=y
 CONFIG_BLK_DEV_INITRD=y
 # CONFIG_RD_GZIP is not set
 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
-CONFIG_EMBEDDED=y
+CONFIG_EXPERT=y
 # CONFIG_SYSCTL_SYSCALL is not set
 CONFIG_KALLSYMS_ALL=y
 # CONFIG_PCSPKR_PLATFORM is not set
index d6457bc38c71c5abc943762ee48ca9f78d096fc7..55902d9cd0f2c4eaf1d2a839954e054ab5b30ec6 100644 (file)
@@ -13,7 +13,7 @@ CONFIG_IKCONFIG_PROC=y
 CONFIG_LOG_BUF_SHIFT=14
 CONFIG_SYSFS_DEPRECATED_V2=y
 CONFIG_BLK_DEV_INITRD=y
-CONFIG_EMBEDDED=y
+CONFIG_EXPERT=y
 # CONFIG_KALLSYMS is not set
 # CONFIG_ELF_CORE is not set
 # CONFIG_VM_EVENT_COUNTERS is not set
index 29acfab31516ef8e35cfaf26f38bdc66213b5174..9cba856277ff91f9fa62eadd07ce783eebf6f691 100644 (file)
@@ -12,7 +12,7 @@ CONFIG_IKCONFIG_PROC=y
 CONFIG_LOG_BUF_SHIFT=14
 CONFIG_SYSFS_DEPRECATED_V2=y
 CONFIG_BLK_DEV_INITRD=y
-CONFIG_EMBEDDED=y
+CONFIG_EXPERT=y
 # CONFIG_HOTPLUG is not set
 # CONFIG_PCSPKR_PLATFORM is not set
 # CONFIG_EPOLL is not set
index 2b3e47653f6053c1ba69c3c0596574b477b9404c..2c0230e76d20562d8035d56c6f8749d062eef110 100644 (file)
@@ -12,7 +12,7 @@ CONFIG_IKCONFIG_PROC=y
 CONFIG_LOG_BUF_SHIFT=14
 CONFIG_RELAY=y
 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
-CONFIG_EMBEDDED=y
+CONFIG_EXPERT=y
 CONFIG_SLAB=y
 CONFIG_MODULES=y
 CONFIG_MODULE_UNLOAD=y
index 64840d717750f45af397b6d469bd972f7903a7b7..5b0463ef93893a1338b8af8643643cb7418f21f5 100644 (file)
@@ -15,7 +15,7 @@ CONFIG_RELAY=y
 CONFIG_NAMESPACES=y
 CONFIG_BLK_DEV_INITRD=y
 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
-CONFIG_EMBEDDED=y
+CONFIG_EXPERT=y
 # CONFIG_COMPAT_BRK is not set
 CONFIG_SLAB=y
 CONFIG_MODULES=y
index d9be37fc9cb74a156d56d08fbe8a4533b374ee37..30036b4cbeb11bed00b175103ca4b5830f89a984 100644 (file)
@@ -5,7 +5,7 @@ CONFIG_SYSVIPC=y
 CONFIG_LOG_BUF_SHIFT=14
 CONFIG_SYSFS_DEPRECATED_V2=y
 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
-CONFIG_EMBEDDED=y
+CONFIG_EXPERT=y
 # CONFIG_PCSPKR_PLATFORM is not set
 CONFIG_SLAB=y
 CONFIG_MODULES=y
index 3d25dd08907b395e7289d650986f4c24fbcbb1b7..81bfa1d4d8e3955dfb314446bde8f6c446656332 100644 (file)
@@ -5,7 +5,7 @@ CONFIG_SYSVIPC=y
 CONFIG_LOG_BUF_SHIFT=14
 CONFIG_SYSFS_DEPRECATED_V2=y
 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
-CONFIG_EMBEDDED=y
+CONFIG_EXPERT=y
 # CONFIG_PCSPKR_PLATFORM is not set
 CONFIG_SLAB=y
 CONFIG_MODULES=y
index be697c9b23c6a077aa613fee75987fa7b17a6f9f..c415c4f0e5c24bd700016db767638cfbb817d242 100644 (file)
@@ -4,7 +4,7 @@ CONFIG_SYSVIPC=y
 CONFIG_LOG_BUF_SHIFT=14
 CONFIG_SYSFS_DEPRECATED_V2=y
 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
-CONFIG_EMBEDDED=y
+CONFIG_EXPERT=y
 # CONFIG_SYSCTL_SYSCALL is not set
 # CONFIG_PCSPKR_PLATFORM is not set
 CONFIG_SLAB=y
index 7ec9287254d8b07a19f807aba09b44a6a2080aba..ee4b2be43c44ecb0ad11a13b7486444bd6e71821 100644 (file)
@@ -4,7 +4,7 @@ CONFIG_EXPERIMENTAL=y
 CONFIG_SYSVIPC=y
 CONFIG_LOG_BUF_SHIFT=14
 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
-CONFIG_EMBEDDED=y
+CONFIG_EXPERT=y
 CONFIG_SLAB=y
 CONFIG_MODULES=y
 CONFIG_MODULE_UNLOAD=y
index a231b73b1a40d6f73a4b0e32e715a01712bb6672..44a451be359eaefc6940245a30101161e3e5a9f6 100644 (file)
@@ -7,7 +7,7 @@ CONFIG_BSD_PROCESS_ACCT=y
 CONFIG_LOG_BUF_SHIFT=14
 CONFIG_BLK_DEV_INITRD=y
 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
-CONFIG_EMBEDDED=y
+CONFIG_EXPERT=y
 CONFIG_KALLSYMS_EXTRA_PASS=y
 # CONFIG_EPOLL is not set
 CONFIG_SLAB=y
index ab3a3dcec04d8888d720bc4c669fbd3bb1a0b714..f72d305a3f0803e4cb2788b3998ebb4f845c0efa 100644 (file)
@@ -8,7 +8,7 @@ CONFIG_IKCONFIG=y
 CONFIG_IKCONFIG_PROC=y
 CONFIG_LOG_BUF_SHIFT=14
 CONFIG_RELAY=y
-CONFIG_EMBEDDED=y
+CONFIG_EXPERT=y
 CONFIG_SLAB=y
 CONFIG_MODULES=y
 CONFIG_MODULE_UNLOAD=y
index 37f175c42bb5530c9c7c76655cb54e94722597fe..650ac9ba734c9bb254baec52f6d076b9ce53583f 100644 (file)
@@ -17,4 +17,6 @@
 #define SMP_CACHE_SHIFT                L1_CACHE_SHIFT
 #define SMP_CACHE_BYTES                L1_CACHE_BYTES
 
+#define __read_mostly __attribute__((__section__(".data.read_mostly")))
+
 #endif /* _ASM_CACHE_H */
index b39def3f6e03bdd950544b05cd4f765fbeb2b2e2..c454550eb0c07195874926969578c1367a6bd19b 100644 (file)
@@ -78,6 +78,7 @@ struct cpuinfo_mips {
        unsigned int            watch_reg_use_cnt; /* Usable by ptrace */
 #define NUM_WATCH_REGS 4
        u16                     watch_reg_masks[NUM_WATCH_REGS];
+       unsigned int            kscratch_mask; /* Usable KScratch mask. */
 } __attribute__((aligned(SMP_CACHE_BYTES)));
 
 extern struct cpuinfo_mips cpu_data[];
index 444ff71aa0e8d2759b85fb56c6955806234ef4e0..7ebfc392e58d1d5cb7c8f2a686e25a9041f853b8 100644 (file)
@@ -72,6 +72,7 @@ enum spec2_op {
 enum spec3_op {
        ext_op, dextm_op, dextu_op, dext_op,
        ins_op, dinsm_op, dinsu_op, dins_op,
+       lx_op = 0x0a,
        bshfl_op = 0x20,
        dbshfl_op = 0x24,
        rdhwr_op = 0x3b
@@ -178,6 +179,19 @@ enum mad_func {
        nmadd_fp_op     = 0x0c, nmsub_fp_op     = 0x0e
 };
 
+/*
+ * func field for special3 lx opcodes (Cavium Octeon).
+ */
+enum lx_func {
+       lwx_op  = 0x00,
+       lhx_op  = 0x04,
+       lbux_op = 0x06,
+       ldx_op  = 0x08,
+       lwux_op = 0x10,
+       lhux_op = 0x14,
+       lbx_op  = 0x16,
+};
+
 /*
  * Damn ...  bitfields depend from byteorder :-(
  */
diff --git a/arch/mips/include/asm/jump_label.h b/arch/mips/include/asm/jump_label.h
new file mode 100644 (file)
index 0000000..7622ccf
--- /dev/null
@@ -0,0 +1,48 @@
+/*
+ * This file is subject to the terms and conditions of the GNU General Public
+ * License.  See the file "COPYING" in the main directory of this archive
+ * for more details.
+ *
+ * Copyright (c) 2010 Cavium Networks, Inc.
+ */
+#ifndef _ASM_MIPS_JUMP_LABEL_H
+#define _ASM_MIPS_JUMP_LABEL_H
+
+#include <linux/types.h>
+
+#ifdef __KERNEL__
+
+#define JUMP_LABEL_NOP_SIZE 4
+
+#ifdef CONFIG_64BIT
+#define WORD_INSN ".dword"
+#else
+#define WORD_INSN ".word"
+#endif
+
+#define JUMP_LABEL(key, label)                                         \
+       do {                                                            \
+               asm goto("1:\tnop\n\t"                                  \
+                       "nop\n\t"                                       \
+                       ".pushsection __jump_table,  \"a\"\n\t"         \
+                       WORD_INSN " 1b, %l[" #label "], %0\n\t"         \
+                       ".popsection\n\t"                               \
+                       : :  "i" (key) :  : label);                     \
+       } while (0)
+
+
+#endif /* __KERNEL__ */
+
+#ifdef CONFIG_64BIT
+typedef u64 jump_label_t;
+#else
+typedef u32 jump_label_t;
+#endif
+
+struct jump_entry {
+       jump_label_t code;
+       jump_label_t target;
+       jump_label_t key;
+};
+
+#endif /* _ASM_MIPS_JUMP_LABEL_H */
diff --git a/arch/mips/include/asm/mach-ath79/ar71xx_regs.h b/arch/mips/include/asm/mach-ath79/ar71xx_regs.h
new file mode 100644 (file)
index 0000000..cda1c80
--- /dev/null
@@ -0,0 +1,233 @@
+/*
+ *  Atheros AR71XX/AR724X/AR913X SoC register definitions
+ *
+ *  Copyright (C) 2008-2010 Gabor Juhos <juhosg@openwrt.org>
+ *  Copyright (C) 2008 Imre Kaloz <kaloz@openwrt.org>
+ *
+ *  Parts of this file are based on Atheros' 2.6.15 BSP
+ *
+ *  This program is free software; you can redistribute it and/or modify it
+ *  under the terms of the GNU General Public License version 2 as published
+ *  by the Free Software Foundation.
+ */
+
+#ifndef __ASM_MACH_AR71XX_REGS_H
+#define __ASM_MACH_AR71XX_REGS_H
+
+#include <linux/types.h>
+#include <linux/init.h>
+#include <linux/io.h>
+#include <linux/bitops.h>
+
+#define AR71XX_APB_BASE                0x18000000
+#define AR71XX_SPI_BASE                0x1f000000
+#define AR71XX_SPI_SIZE                0x01000000
+
+#define AR71XX_DDR_CTRL_BASE   (AR71XX_APB_BASE + 0x00000000)
+#define AR71XX_DDR_CTRL_SIZE   0x100
+#define AR71XX_UART_BASE       (AR71XX_APB_BASE + 0x00020000)
+#define AR71XX_UART_SIZE       0x100
+#define AR71XX_GPIO_BASE        (AR71XX_APB_BASE + 0x00040000)
+#define AR71XX_GPIO_SIZE        0x100
+#define AR71XX_PLL_BASE                (AR71XX_APB_BASE + 0x00050000)
+#define AR71XX_PLL_SIZE                0x100
+#define AR71XX_RESET_BASE      (AR71XX_APB_BASE + 0x00060000)
+#define AR71XX_RESET_SIZE      0x100
+
+#define AR913X_WMAC_BASE       (AR71XX_APB_BASE + 0x000C0000)
+#define AR913X_WMAC_SIZE       0x30000
+
+/*
+ * DDR_CTRL block
+ */
+#define AR71XX_DDR_REG_PCI_WIN0                0x7c
+#define AR71XX_DDR_REG_PCI_WIN1                0x80
+#define AR71XX_DDR_REG_PCI_WIN2                0x84
+#define AR71XX_DDR_REG_PCI_WIN3                0x88
+#define AR71XX_DDR_REG_PCI_WIN4                0x8c
+#define AR71XX_DDR_REG_PCI_WIN5                0x90
+#define AR71XX_DDR_REG_PCI_WIN6                0x94
+#define AR71XX_DDR_REG_PCI_WIN7                0x98
+#define AR71XX_DDR_REG_FLUSH_GE0       0x9c
+#define AR71XX_DDR_REG_FLUSH_GE1       0xa0
+#define AR71XX_DDR_REG_FLUSH_USB       0xa4
+#define AR71XX_DDR_REG_FLUSH_PCI       0xa8
+
+#define AR724X_DDR_REG_FLUSH_GE0       0x7c
+#define AR724X_DDR_REG_FLUSH_GE1       0x80
+#define AR724X_DDR_REG_FLUSH_USB       0x84
+#define AR724X_DDR_REG_FLUSH_PCIE      0x88
+
+#define AR913X_DDR_REG_FLUSH_GE0       0x7c
+#define AR913X_DDR_REG_FLUSH_GE1       0x80
+#define AR913X_DDR_REG_FLUSH_USB       0x84
+#define AR913X_DDR_REG_FLUSH_WMAC      0x88
+
+/*
+ * PLL block
+ */
+#define AR71XX_PLL_REG_CPU_CONFIG      0x00
+#define AR71XX_PLL_REG_SEC_CONFIG      0x04
+#define AR71XX_PLL_REG_ETH0_INT_CLOCK  0x10
+#define AR71XX_PLL_REG_ETH1_INT_CLOCK  0x14
+
+#define AR71XX_PLL_DIV_SHIFT           3
+#define AR71XX_PLL_DIV_MASK            0x1f
+#define AR71XX_CPU_DIV_SHIFT           16
+#define AR71XX_CPU_DIV_MASK            0x3
+#define AR71XX_DDR_DIV_SHIFT           18
+#define AR71XX_DDR_DIV_MASK            0x3
+#define AR71XX_AHB_DIV_SHIFT           20
+#define AR71XX_AHB_DIV_MASK            0x7
+
+#define AR724X_PLL_REG_CPU_CONFIG      0x00
+#define AR724X_PLL_REG_PCIE_CONFIG     0x18
+
+#define AR724X_PLL_DIV_SHIFT           0
+#define AR724X_PLL_DIV_MASK            0x3ff
+#define AR724X_PLL_REF_DIV_SHIFT       10
+#define AR724X_PLL_REF_DIV_MASK                0xf
+#define AR724X_AHB_DIV_SHIFT           19
+#define AR724X_AHB_DIV_MASK            0x1
+#define AR724X_DDR_DIV_SHIFT           22
+#define AR724X_DDR_DIV_MASK            0x3
+
+#define AR913X_PLL_REG_CPU_CONFIG      0x00
+#define AR913X_PLL_REG_ETH_CONFIG      0x04
+#define AR913X_PLL_REG_ETH0_INT_CLOCK  0x14
+#define AR913X_PLL_REG_ETH1_INT_CLOCK  0x18
+
+#define AR913X_PLL_DIV_SHIFT           0
+#define AR913X_PLL_DIV_MASK            0x3ff
+#define AR913X_DDR_DIV_SHIFT           22
+#define AR913X_DDR_DIV_MASK            0x3
+#define AR913X_AHB_DIV_SHIFT           19
+#define AR913X_AHB_DIV_MASK            0x1
+
+/*
+ * RESET block
+ */
+#define AR71XX_RESET_REG_TIMER                 0x00
+#define AR71XX_RESET_REG_TIMER_RELOAD          0x04
+#define AR71XX_RESET_REG_WDOG_CTRL             0x08
+#define AR71XX_RESET_REG_WDOG                  0x0c
+#define AR71XX_RESET_REG_MISC_INT_STATUS       0x10
+#define AR71XX_RESET_REG_MISC_INT_ENABLE       0x14
+#define AR71XX_RESET_REG_PCI_INT_STATUS                0x18
+#define AR71XX_RESET_REG_PCI_INT_ENABLE                0x1c
+#define AR71XX_RESET_REG_GLOBAL_INT_STATUS     0x20
+#define AR71XX_RESET_REG_RESET_MODULE          0x24
+#define AR71XX_RESET_REG_PERFC_CTRL            0x2c
+#define AR71XX_RESET_REG_PERFC0                        0x30
+#define AR71XX_RESET_REG_PERFC1                        0x34
+#define AR71XX_RESET_REG_REV_ID                        0x90
+
+#define AR913X_RESET_REG_GLOBAL_INT_STATUS     0x18
+#define AR913X_RESET_REG_RESET_MODULE          0x1c
+#define AR913X_RESET_REG_PERF_CTRL             0x20
+#define AR913X_RESET_REG_PERFC0                        0x24
+#define AR913X_RESET_REG_PERFC1                        0x28
+
+#define AR724X_RESET_REG_RESET_MODULE          0x1c
+
+#define MISC_INT_DMA                   BIT(7)
+#define MISC_INT_OHCI                  BIT(6)
+#define MISC_INT_PERFC                 BIT(5)
+#define MISC_INT_WDOG                  BIT(4)
+#define MISC_INT_UART                  BIT(3)
+#define MISC_INT_GPIO                  BIT(2)
+#define MISC_INT_ERROR                 BIT(1)
+#define MISC_INT_TIMER                 BIT(0)
+
+#define AR71XX_RESET_EXTERNAL          BIT(28)
+#define AR71XX_RESET_FULL_CHIP         BIT(24)
+#define AR71XX_RESET_CPU_NMI           BIT(21)
+#define AR71XX_RESET_CPU_COLD          BIT(20)
+#define AR71XX_RESET_DMA               BIT(19)
+#define AR71XX_RESET_SLIC              BIT(18)
+#define AR71XX_RESET_STEREO            BIT(17)
+#define AR71XX_RESET_DDR               BIT(16)
+#define AR71XX_RESET_GE1_MAC           BIT(13)
+#define AR71XX_RESET_GE1_PHY           BIT(12)
+#define AR71XX_RESET_USBSUS_OVERRIDE   BIT(10)
+#define AR71XX_RESET_GE0_MAC           BIT(9)
+#define AR71XX_RESET_GE0_PHY           BIT(8)
+#define AR71XX_RESET_USB_OHCI_DLL      BIT(6)
+#define AR71XX_RESET_USB_HOST          BIT(5)
+#define AR71XX_RESET_USB_PHY           BIT(4)
+#define AR71XX_RESET_PCI_BUS           BIT(1)
+#define AR71XX_RESET_PCI_CORE          BIT(0)
+
+#define AR724X_RESET_GE1_MDIO          BIT(23)
+#define AR724X_RESET_GE0_MDIO          BIT(22)
+#define AR724X_RESET_PCIE_PHY_SERIAL   BIT(10)
+#define AR724X_RESET_PCIE_PHY          BIT(7)
+#define AR724X_RESET_PCIE              BIT(6)
+#define AR724X_RESET_OHCI_DLL          BIT(3)
+
+#define AR913X_RESET_AMBA2WMAC         BIT(22)
+
+#define REV_ID_MAJOR_MASK              0xfff0
+#define REV_ID_MAJOR_AR71XX            0x00a0
+#define REV_ID_MAJOR_AR913X            0x00b0
+#define REV_ID_MAJOR_AR7240            0x00c0
+#define REV_ID_MAJOR_AR7241            0x0100
+#define REV_ID_MAJOR_AR7242            0x1100
+
+#define AR71XX_REV_ID_MINOR_MASK       0x3
+#define AR71XX_REV_ID_MINOR_AR7130     0x0
+#define AR71XX_REV_ID_MINOR_AR7141     0x1
+#define AR71XX_REV_ID_MINOR_AR7161     0x2
+#define AR71XX_REV_ID_REVISION_MASK    0x3
+#define AR71XX_REV_ID_REVISION_SHIFT   2
+
+#define AR913X_REV_ID_MINOR_MASK       0x3
+#define AR913X_REV_ID_MINOR_AR9130     0x0
+#define AR913X_REV_ID_MINOR_AR9132     0x1
+#define AR913X_REV_ID_REVISION_MASK    0x3
+#define AR913X_REV_ID_REVISION_SHIFT   2
+
+#define AR724X_REV_ID_REVISION_MASK    0x3
+
+/*
+ * SPI block
+ */
+#define AR71XX_SPI_REG_FS      0x00    /* Function Select */
+#define AR71XX_SPI_REG_CTRL    0x04    /* SPI Control */
+#define AR71XX_SPI_REG_IOC     0x08    /* SPI I/O Control */
+#define AR71XX_SPI_REG_RDS     0x0c    /* Read Data Shift */
+
+#define AR71XX_SPI_FS_GPIO     BIT(0)  /* Enable GPIO mode */
+
+#define AR71XX_SPI_CTRL_RD     BIT(6)  /* Remap Disable */
+#define AR71XX_SPI_CTRL_DIV_MASK 0x3f
+
+#define AR71XX_SPI_IOC_DO      BIT(0)  /* Data Out pin */
+#define AR71XX_SPI_IOC_CLK     BIT(8)  /* CLK pin */
+#define AR71XX_SPI_IOC_CS(n)   BIT(16 + (n))
+#define AR71XX_SPI_IOC_CS0     AR71XX_SPI_IOC_CS(0)
+#define AR71XX_SPI_IOC_CS1     AR71XX_SPI_IOC_CS(1)
+#define AR71XX_SPI_IOC_CS2     AR71XX_SPI_IOC_CS(2)
+#define AR71XX_SPI_IOC_CS_ALL  (AR71XX_SPI_IOC_CS0 | AR71XX_SPI_IOC_CS1 | \
+                                AR71XX_SPI_IOC_CS2)
+
+/*
+ * GPIO block
+ */
+#define AR71XX_GPIO_REG_OE             0x00
+#define AR71XX_GPIO_REG_IN             0x04
+#define AR71XX_GPIO_REG_OUT            0x08
+#define AR71XX_GPIO_REG_SET            0x0c
+#define AR71XX_GPIO_REG_CLEAR          0x10
+#define AR71XX_GPIO_REG_INT_MODE       0x14
+#define AR71XX_GPIO_REG_INT_TYPE       0x18
+#define AR71XX_GPIO_REG_INT_POLARITY   0x1c
+#define AR71XX_GPIO_REG_INT_PENDING    0x20
+#define AR71XX_GPIO_REG_INT_ENABLE     0x24
+#define AR71XX_GPIO_REG_FUNC           0x28
+
+#define AR71XX_GPIO_COUNT              16
+#define AR724X_GPIO_COUNT              18
+#define AR913X_GPIO_COUNT              22
+
+#endif /* __ASM_MACH_AR71XX_REGS_H */
diff --git a/arch/mips/include/asm/mach-ath79/ath79.h b/arch/mips/include/asm/mach-ath79/ath79.h
new file mode 100644 (file)
index 0000000..6a9f168
--- /dev/null
@@ -0,0 +1,96 @@
+/*
+ *  Atheros AR71XX/AR724X/AR913X common definitions
+ *
+ *  Copyright (C) 2008-2011 Gabor Juhos <juhosg@openwrt.org>
+ *  Copyright (C) 2008 Imre Kaloz <kaloz@openwrt.org>
+ *
+ *  Parts of this file are based on Atheros' 2.6.15 BSP
+ *
+ *  This program is free software; you can redistribute it and/or modify it
+ *  under the terms of the GNU General Public License version 2 as published
+ *  by the Free Software Foundation.
+ */
+
+#ifndef __ASM_MACH_ATH79_H
+#define __ASM_MACH_ATH79_H
+
+#include <linux/types.h>
+#include <linux/io.h>
+
+enum ath79_soc_type {
+       ATH79_SOC_UNKNOWN,
+       ATH79_SOC_AR7130,
+       ATH79_SOC_AR7141,
+       ATH79_SOC_AR7161,
+       ATH79_SOC_AR7240,
+       ATH79_SOC_AR7241,
+       ATH79_SOC_AR7242,
+       ATH79_SOC_AR9130,
+       ATH79_SOC_AR9132
+};
+
+extern enum ath79_soc_type ath79_soc;
+
+static inline int soc_is_ar71xx(void)
+{
+       return (ath79_soc == ATH79_SOC_AR7130 ||
+               ath79_soc == ATH79_SOC_AR7141 ||
+               ath79_soc == ATH79_SOC_AR7161);
+}
+
+static inline int soc_is_ar724x(void)
+{
+       return (ath79_soc == ATH79_SOC_AR7240 ||
+               ath79_soc == ATH79_SOC_AR7241 ||
+               ath79_soc == ATH79_SOC_AR7242);
+}
+
+static inline int soc_is_ar7240(void)
+{
+       return (ath79_soc == ATH79_SOC_AR7240);
+}
+
+static inline int soc_is_ar7241(void)
+{
+       return (ath79_soc == ATH79_SOC_AR7241);
+}
+
+static inline int soc_is_ar7242(void)
+{
+       return (ath79_soc == ATH79_SOC_AR7242);
+}
+
+static inline int soc_is_ar913x(void)
+{
+       return (ath79_soc == ATH79_SOC_AR9130 ||
+               ath79_soc == ATH79_SOC_AR9132);
+}
+
+extern void __iomem *ath79_ddr_base;
+extern void __iomem *ath79_pll_base;
+extern void __iomem *ath79_reset_base;
+
+static inline void ath79_pll_wr(unsigned reg, u32 val)
+{
+       __raw_writel(val, ath79_pll_base + reg);
+}
+
+static inline u32 ath79_pll_rr(unsigned reg)
+{
+       return __raw_readl(ath79_pll_base + reg);
+}
+
+static inline void ath79_reset_wr(unsigned reg, u32 val)
+{
+       __raw_writel(val, ath79_reset_base + reg);
+}
+
+static inline u32 ath79_reset_rr(unsigned reg)
+{
+       return __raw_readl(ath79_reset_base + reg);
+}
+
+void ath79_device_reset_set(u32 mask);
+void ath79_device_reset_clear(u32 mask);
+
+#endif /* __ASM_MACH_ATH79_H */
diff --git a/arch/mips/include/asm/mach-ath79/ath79_spi_platform.h b/arch/mips/include/asm/mach-ath79/ath79_spi_platform.h
new file mode 100644 (file)
index 0000000..aa2283e
--- /dev/null
@@ -0,0 +1,23 @@
+/*
+ *  Platform data definition for Atheros AR71XX/AR724X/AR913X SPI controller
+ *
+ *  Copyright (C) 2008-2010 Gabor Juhos <juhosg@openwrt.org>
+ *
+ *  This program is free software; you can redistribute it and/or modify it
+ *  under the terms of the GNU General Public License version 2 as published
+ *  by the Free Software Foundation.
+ */
+
+#ifndef _ATH79_SPI_PLATFORM_H
+#define _ATH79_SPI_PLATFORM_H
+
+struct ath79_spi_platform_data {
+       unsigned        bus_num;
+       unsigned        num_chipselect;
+};
+
+struct ath79_spi_controller_data {
+       unsigned        gpio;
+};
+
+#endif /* _ATH79_SPI_PLATFORM_H */
diff --git a/arch/mips/include/asm/mach-ath79/cpu-feature-overrides.h b/arch/mips/include/asm/mach-ath79/cpu-feature-overrides.h
new file mode 100644 (file)
index 0000000..4476fa0
--- /dev/null
@@ -0,0 +1,56 @@
+/*
+ *  Atheros AR71XX/AR724X/AR913X specific CPU feature overrides
+ *
+ *  Copyright (C) 2008-2010 Gabor Juhos <juhosg@openwrt.org>
+ *  Copyright (C) 2008 Imre Kaloz <kaloz@openwrt.org>
+ *
+ *  This file was derived from: include/asm-mips/cpu-features.h
+ *     Copyright (C) 2003, 2004 Ralf Baechle
+ *     Copyright (C) 2004 Maciej W. Rozycki
+ *
+ *  This program is free software; you can redistribute it and/or modify it
+ *  under the terms of the GNU General Public License version 2 as published
+ *  by the Free Software Foundation.
+ *
+ */
+#ifndef __ASM_MACH_ATH79_CPU_FEATURE_OVERRIDES_H
+#define __ASM_MACH_ATH79_CPU_FEATURE_OVERRIDES_H
+
+#define cpu_has_tlb            1
+#define cpu_has_4kex           1
+#define cpu_has_3k_cache       0
+#define cpu_has_4k_cache       1
+#define cpu_has_tx39_cache     0
+#define cpu_has_sb1_cache      0
+#define cpu_has_fpu            0
+#define cpu_has_32fpr          0
+#define cpu_has_counter                1
+#define cpu_has_watch          1
+#define cpu_has_divec          1
+
+#define cpu_has_prefetch       1
+#define cpu_has_ejtag          1
+#define cpu_has_llsc           1
+
+#define cpu_has_mips16         1
+#define cpu_has_mdmx           0
+#define cpu_has_mips3d         0
+#define cpu_has_smartmips      0
+
+#define cpu_has_mips32r1       1
+#define cpu_has_mips32r2       1
+#define cpu_has_mips64r1       0
+#define cpu_has_mips64r2       0
+
+#define cpu_has_dsp            0
+#define cpu_has_mipsmt         0
+
+#define cpu_has_64bits         0
+#define cpu_has_64bit_zero_reg 0
+#define cpu_has_64bit_gp_regs  0
+#define cpu_has_64bit_addresses        0
+
+#define cpu_dcache_line_size() 32
+#define cpu_icache_line_size() 32
+
+#endif /* __ASM_MACH_ATH79_CPU_FEATURE_OVERRIDES_H */
diff --git a/arch/mips/include/asm/mach-ath79/gpio.h b/arch/mips/include/asm/mach-ath79/gpio.h
new file mode 100644 (file)
index 0000000..60dcb62
--- /dev/null
@@ -0,0 +1,26 @@
+/*
+ *  Atheros AR71XX/AR724X/AR913X GPIO API definitions
+ *
+ *  Copyright (C) 2008-2010 Gabor Juhos <juhosg@openwrt.org>
+ *  Copyright (C) 2008 Imre Kaloz <kaloz@openwrt.org>
+ *
+ *  This program is free software; you can redistribute it and/or modify it
+ *  under the terms of the GNU General Public License version 2 as published
+ *  by the Free Software Foundation.
+ *
+ */
+
+#ifndef __ASM_MACH_ATH79_GPIO_H
+#define __ASM_MACH_ATH79_GPIO_H
+
+#define ARCH_NR_GPIOS  64
+#include <asm-generic/gpio.h>
+
+int gpio_to_irq(unsigned gpio);
+int irq_to_gpio(unsigned irq);
+int gpio_get_value(unsigned gpio);
+void gpio_set_value(unsigned gpio, int value);
+
+#define gpio_cansleep  __gpio_cansleep
+
+#endif /* __ASM_MACH_ATH79_GPIO_H */
diff --git a/arch/mips/include/asm/mach-ath79/irq.h b/arch/mips/include/asm/mach-ath79/irq.h
new file mode 100644 (file)
index 0000000..189bc6e
--- /dev/null
@@ -0,0 +1,36 @@
+/*
+ *  Copyright (C) 2008-2010 Gabor Juhos <juhosg@openwrt.org>
+ *  Copyright (C) 2008 Imre Kaloz <kaloz@openwrt.org>
+ *
+ *  This program is free software; you can redistribute it and/or modify it
+ *  under the terms of the GNU General Public License version 2 as published
+ *  by the Free Software Foundation.
+ */
+#ifndef __ASM_MACH_ATH79_IRQ_H
+#define __ASM_MACH_ATH79_IRQ_H
+
+#define MIPS_CPU_IRQ_BASE      0
+#define NR_IRQS                        16
+
+#define ATH79_MISC_IRQ_BASE    8
+#define ATH79_MISC_IRQ_COUNT   8
+
+#define ATH79_CPU_IRQ_IP2      (MIPS_CPU_IRQ_BASE + 2)
+#define ATH79_CPU_IRQ_USB      (MIPS_CPU_IRQ_BASE + 3)
+#define ATH79_CPU_IRQ_GE0      (MIPS_CPU_IRQ_BASE + 4)
+#define ATH79_CPU_IRQ_GE1      (MIPS_CPU_IRQ_BASE + 5)
+#define ATH79_CPU_IRQ_MISC     (MIPS_CPU_IRQ_BASE + 6)
+#define ATH79_CPU_IRQ_TIMER    (MIPS_CPU_IRQ_BASE + 7)
+
+#define ATH79_MISC_IRQ_TIMER   (ATH79_MISC_IRQ_BASE + 0)
+#define ATH79_MISC_IRQ_ERROR   (ATH79_MISC_IRQ_BASE + 1)
+#define ATH79_MISC_IRQ_GPIO    (ATH79_MISC_IRQ_BASE + 2)
+#define ATH79_MISC_IRQ_UART    (ATH79_MISC_IRQ_BASE + 3)
+#define ATH79_MISC_IRQ_WDOG    (ATH79_MISC_IRQ_BASE + 4)
+#define ATH79_MISC_IRQ_PERFC   (ATH79_MISC_IRQ_BASE + 5)
+#define ATH79_MISC_IRQ_OHCI    (ATH79_MISC_IRQ_BASE + 6)
+#define ATH79_MISC_IRQ_DMA     (ATH79_MISC_IRQ_BASE + 7)
+
+#include_next <irq.h>
+
+#endif /* __ASM_MACH_ATH79_IRQ_H */
diff --git a/arch/mips/include/asm/mach-ath79/kernel-entry-init.h b/arch/mips/include/asm/mach-ath79/kernel-entry-init.h
new file mode 100644 (file)
index 0000000..d8d046b
--- /dev/null
@@ -0,0 +1,32 @@
+/*
+ *  Atheros AR71XX/AR724X/AR913X specific kernel entry setup
+ *
+ *  Copyright (C) 2009 Gabor Juhos <juhosg@openwrt.org>
+ *
+ *  This program is free software; you can redistribute it and/or modify it
+ *  under the terms of the GNU General Public License version 2 as published
+ *  by the Free Software Foundation.
+ *
+ */
+#ifndef __ASM_MACH_ATH79_KERNEL_ENTRY_H
+#define __ASM_MACH_ATH79_KERNEL_ENTRY_H
+
+       /*
+        * Some bootloaders set the 'Kseg0 coherency algorithm' to
+        * 'Cacheable, noncoherent, write-through, no write allocate'
+        * and this cause performance issues. Let's go and change it to
+        * 'Cacheable, noncoherent, write-back, write allocate'
+        */
+       .macro  kernel_entry_setup
+       mfc0    t0, CP0_CONFIG
+       li      t1, ~CONF_CM_CMASK
+       and     t0, t1
+       ori     t0, CONF_CM_CACHABLE_NONCOHERENT
+       mtc0    t0, CP0_CONFIG
+       nop
+       .endm
+
+       .macro  smp_slave_setup
+       .endm
+
+#endif /* __ASM_MACH_ATH79_KERNEL_ENTRY_H */
diff --git a/arch/mips/include/asm/mach-ath79/war.h b/arch/mips/include/asm/mach-ath79/war.h
new file mode 100644 (file)
index 0000000..323d9f1
--- /dev/null
@@ -0,0 +1,25 @@
+/*
+ * This file is subject to the terms and conditions of the GNU General Public
+ * License.  See the file "COPYING" in the main directory of this archive
+ * for more details.
+ *
+ * Copyright (C) 2002, 2004, 2007 by Ralf Baechle <ralf@linux-mips.org>
+ */
+#ifndef __ASM_MACH_ATH79_WAR_H
+#define __ASM_MACH_ATH79_WAR_H
+
+#define R4600_V1_INDEX_ICACHEOP_WAR    0
+#define R4600_V1_HIT_CACHEOP_WAR       0
+#define R4600_V2_HIT_CACHEOP_WAR       0
+#define R5432_CP0_INTERRUPT_WAR                0
+#define BCM1250_M3_WAR                 0
+#define SIBYTE_1956_WAR                        0
+#define MIPS4K_ICACHE_REFILL_WAR       0
+#define MIPS_CACHE_SYNC_WAR            0
+#define TX49XX_ICACHE_INDEX_INV_WAR    0
+#define RM9000_CDEX_SMP_WAR            0
+#define ICACHE_REFILLS_WORKAROUND_WAR  0
+#define R10000_LLSC_WAR                        0
+#define MIPS34K_MISSED_ITLB_WAR                0
+
+#endif /* __ASM_MACH_ATH79_WAR_H */
diff --git a/arch/mips/include/asm/mips_machine.h b/arch/mips/include/asm/mips_machine.h
new file mode 100644 (file)
index 0000000..363bb35
--- /dev/null
@@ -0,0 +1,54 @@
+/*
+ *  Copyright (C) 2008-2010 Gabor Juhos <juhosg@openwrt.org>
+ *
+ *  This program is free software; you can redistribute it and/or modify it
+ *  under the terms of the GNU General Public License version 2 as published
+ *  by the Free Software Foundation.
+ *
+ */
+
+#ifndef __ASM_MIPS_MACHINE_H
+#define __ASM_MIPS_MACHINE_H
+
+#include <linux/init.h>
+#include <linux/stddef.h>
+
+#include <asm/bootinfo.h>
+
+struct mips_machine {
+       unsigned long           mach_type;
+       const char              *mach_id;
+       const char              *mach_name;
+       void                    (*mach_setup)(void);
+};
+
+#define MIPS_MACHINE(_type, _id, _name, _setup)                        \
+static const char machine_name_##_type[] __initconst           \
+                       __aligned(1) = _name;                   \
+static const char machine_id_##_type[] __initconst             \
+                       __aligned(1) = _id;                     \
+static struct mips_machine machine_##_type                     \
+               __used __section(.mips.machines.init) =         \
+{                                                              \
+       .mach_type      = _type,                                \
+       .mach_id        = machine_id_##_type,                   \
+       .mach_name      = machine_name_##_type,                 \
+       .mach_setup     = _setup,                               \
+};
+
+extern long __mips_machines_start;
+extern long __mips_machines_end;
+
+#ifdef CONFIG_MIPS_MACHINE
+int  mips_machtype_setup(char *id) __init;
+void mips_machine_setup(void) __init;
+void mips_set_machine_name(const char *name) __init;
+char *mips_get_machine_name(void);
+#else
+static inline int mips_machtype_setup(char *id) { return 1; }
+static inline void mips_machine_setup(void) { }
+static inline void mips_set_machine_name(const char *name) { }
+static inline char *mips_get_machine_name(void) { return NULL; }
+#endif /* CONFIG_MIPS_MACHINE */
+
+#endif /* __ASM_MIPS_MACHINE_H */
index d9592733a7ba4759dbebc01f82efaef4a783e1e5..73c0d45798dec6cf00fc99021fc4bc00664ccaad 100644 (file)
 #define TLBMISS_HANDLER_SETUP_PGD(pgd)                         \
        tlbmiss_handler_setup_pgd((unsigned long)(pgd))
 
-static inline void tlbmiss_handler_setup_pgd(unsigned long pgd)
-{
-       /* Check for swapper_pg_dir and convert to physical address. */
-       if ((pgd & CKSEG3) == CKSEG0)
-               pgd = CPHYSADDR(pgd);
-       write_c0_context(pgd << 11);
-}
+extern void tlbmiss_handler_setup_pgd(unsigned long pgd);
 
 #define TLBMISS_HANDLER_SETUP()                                                \
        do {                                                            \
index 892062d6d748f5a234a3da2d1ee98211f11c2d4d..dcbd4bb417ec094d931c8188b72daae1799779eb 100644 (file)
@@ -115,7 +115,12 @@ Ip_0(_tlbwr);
 Ip_u3u1u2(_xor);
 Ip_u2u1u3(_xori);
 Ip_u2u1msbu3(_dins);
+Ip_u2u1msbu3(_dinsm);
 Ip_u1(_syscall);
+Ip_u1u2s3(_bbit0);
+Ip_u1u2s3(_bbit1);
+Ip_u3u1u2(_lwx);
+Ip_u3u1u2(_ldx);
 
 /* Handle labels. */
 struct uasm_label {
@@ -153,6 +158,7 @@ static inline void __uasminit uasm_l##lb(struct uasm_label **lab, u32 *addr) \
 # define UASM_i_SUBU(buf, rs, rt, rd) uasm_i_dsubu(buf, rs, rt, rd)
 # define UASM_i_LL(buf, rs, rt, off) uasm_i_lld(buf, rs, rt, off)
 # define UASM_i_SC(buf, rs, rt, off) uasm_i_scd(buf, rs, rt, off)
+# define UASM_i_LWX(buf, rs, rt, rd) uasm_i_ldx(buf, rs, rt, rd)
 #else
 # define UASM_i_LW(buf, rs, rt, off) uasm_i_lw(buf, rs, rt, off)
 # define UASM_i_SW(buf, rs, rt, off) uasm_i_sw(buf, rs, rt, off)
@@ -167,6 +173,7 @@ static inline void __uasminit uasm_l##lb(struct uasm_label **lab, u32 *addr) \
 # define UASM_i_SUBU(buf, rs, rt, rd) uasm_i_subu(buf, rs, rt, rd)
 # define UASM_i_LL(buf, rs, rt, off) uasm_i_ll(buf, rs, rt, off)
 # define UASM_i_SC(buf, rs, rt, off) uasm_i_sc(buf, rs, rt, off)
+# define UASM_i_LWX(buf, rs, rt, rd) uasm_i_lwx(buf, rs, rt, rd)
 #endif
 
 #define uasm_i_b(buf, off) uasm_i_beq(buf, 0, 0, off)
index 22b2e0e386170cd1fba74d7fa6bc06bd90d74226..cedee2bcbd182c8eab8ad59aadfc0d02e1fdb79d 100644 (file)
@@ -95,6 +95,7 @@ obj-$(CONFIG_GPIO_TXX9)               += gpio_txx9.o
 obj-$(CONFIG_KEXEC)            += machine_kexec.o relocate_kernel.o
 obj-$(CONFIG_EARLY_PRINTK)     += early_printk.o
 obj-$(CONFIG_SPINLOCK_TEST)    += spinlock_test.o
+obj-$(CONFIG_MIPS_MACHINE)     += mips_machine.o
 
 obj-$(CONFIG_OF)               += prom.o
 
@@ -106,4 +107,6 @@ obj-$(CONFIG_MIPS_CPUFREQ)  += cpufreq/
 
 obj-$(CONFIG_HW_PERF_EVENTS)   += perf_event.o
 
+obj-$(CONFIG_JUMP_LABEL)       += jump_label.o
+
 CPPFLAGS_vmlinux.lds           := $(KBUILD_CFLAGS)
index 68dae7b6b5db62a0a48a17e6fe339a2d56bd8bd8..f65d4c8c65a6a19ec4be040091861444a8ea78a3 100644 (file)
@@ -739,6 +739,8 @@ static inline unsigned int decode_config4(struct cpuinfo_mips *c)
            && cpu_has_tlb)
                c->tlbsize += (config4 & MIPS_CONF4_MMUSIZEEXT) * 0x40;
 
+       c->kscratch_mask = (config4 >> 16) & 0xff;
+
        return config4 & MIPS_CONF_M;
 }
 
diff --git a/arch/mips/kernel/jump_label.c b/arch/mips/kernel/jump_label.c
new file mode 100644 (file)
index 0000000..6001610
--- /dev/null
@@ -0,0 +1,54 @@
+/*
+ * This file is subject to the terms and conditions of the GNU General Public
+ * License.  See the file "COPYING" in the main directory of this archive
+ * for more details.
+ *
+ * Copyright (c) 2010 Cavium Networks, Inc.
+ */
+
+#include <linux/jump_label.h>
+#include <linux/kernel.h>
+#include <linux/memory.h>
+#include <linux/mutex.h>
+#include <linux/types.h>
+#include <linux/cpu.h>
+
+#include <asm/cacheflush.h>
+#include <asm/inst.h>
+
+#ifdef HAVE_JUMP_LABEL
+
+#define J_RANGE_MASK ((1ul << 28) - 1)
+
+void arch_jump_label_transform(struct jump_entry *e,
+                              enum jump_label_type type)
+{
+       union mips_instruction insn;
+       union mips_instruction *insn_p =
+               (union mips_instruction *)(unsigned long)e->code;
+
+       /* Jump only works within a 256MB aligned region. */
+       BUG_ON((e->target & ~J_RANGE_MASK) != (e->code & ~J_RANGE_MASK));
+
+       /* Target must have 4 byte alignment. */
+       BUG_ON((e->target & 3) != 0);
+
+       if (type == JUMP_LABEL_ENABLE) {
+               insn.j_format.opcode = j_op;
+               insn.j_format.target = (e->target & J_RANGE_MASK) >> 2;
+       } else {
+               insn.word = 0; /* nop */
+       }
+
+       get_online_cpus();
+       mutex_lock(&text_mutex);
+       *insn_p = insn;
+
+       flush_icache_range((unsigned long)insn_p,
+                          (unsigned long)insn_p + sizeof(*insn_p));
+
+       mutex_unlock(&text_mutex);
+       put_online_cpus();
+}
+
+#endif /* HAVE_JUMP_LABEL */
diff --git a/arch/mips/kernel/mips_machine.c b/arch/mips/kernel/mips_machine.c
new file mode 100644 (file)
index 0000000..411a058
--- /dev/null
@@ -0,0 +1,86 @@
+/*
+ *  Copyright (C) 2008-2010 Gabor Juhos <juhosg@openwrt.org>
+ *
+ *  This program is free software; you can redistribute it and/or modify it
+ *  under the terms of the GNU General Public License version 2 as published
+ *  by the Free Software Foundation.
+ *
+ */
+#include <linux/mm.h>
+#include <linux/string.h>
+#include <linux/slab.h>
+
+#include <asm/mips_machine.h>
+
+static struct mips_machine *mips_machine __initdata;
+static char *mips_machine_name = "Unknown";
+
+#define for_each_machine(mach) \
+       for ((mach) = (struct mips_machine *)&__mips_machines_start; \
+            (mach) && \
+            (unsigned long)(mach) < (unsigned long)&__mips_machines_end; \
+            (mach)++)
+
+__init void mips_set_machine_name(const char *name)
+{
+       char *p;
+
+       if (name == NULL)
+               return;
+
+       p = kstrdup(name, GFP_KERNEL);
+       if (!p)
+               pr_err("MIPS: no memory for machine_name\n");
+
+       mips_machine_name = p;
+}
+
+char *mips_get_machine_name(void)
+{
+       return mips_machine_name;
+}
+
+__init int mips_machtype_setup(char *id)
+{
+       struct mips_machine *mach;
+
+       for_each_machine(mach) {
+               if (mach->mach_id == NULL)
+                       continue;
+
+               if (strcmp(mach->mach_id, id) == 0) {
+                       mips_machtype = mach->mach_type;
+                       return 0;
+               }
+       }
+
+       pr_err("MIPS: no machine found for id '%s', supported machines:\n", id);
+       pr_err("%-24s %s\n", "id", "name");
+       for_each_machine(mach)
+               pr_err("%-24s %s\n", mach->mach_id, mach->mach_name);
+
+       return 1;
+}
+
+__setup("machtype=", mips_machtype_setup);
+
+__init void mips_machine_setup(void)
+{
+       struct mips_machine *mach;
+
+       for_each_machine(mach) {
+               if (mips_machtype == mach->mach_type) {
+                       mips_machine = mach;
+                       break;
+               }
+       }
+
+       if (!mips_machine)
+               return;
+
+       mips_set_machine_name(mips_machine->mach_name);
+       pr_info("MIPS: machine is %s\n", mips_machine_name);
+
+       if (mips_machine->mach_setup)
+               mips_machine->mach_setup();
+}
index d87a72e9fac714bd2d1f73b564426f7a77e2dcc5..dd940b70196387c5b9f39a026100e0054444a175 100644 (file)
@@ -30,6 +30,8 @@
 #include <linux/kernel.h>
 #include <linux/module.h>
 #include <linux/spinlock.h>
+#include <linux/jump_label.h>
+
 #include <asm/pgtable.h>       /* MODULE_START */
 
 struct mips_hi16 {
@@ -382,6 +384,9 @@ int module_finalize(const Elf_Ehdr *hdr,
        const Elf_Shdr *s;
        char *secstrings = (void *)hdr + sechdrs[hdr->e_shstrndx].sh_offset;
 
+       /* Make jump label nops. */
+       jump_label_apply_nops(me);
+
        INIT_LIST_HEAD(&me->arch.dbe_list);
        for (s = sechdrs; s < sechdrs + hdr->e_shnum; s++) {
                if (strcmp("__dbe_table", secstrings + s->sh_name) != 0)
index 26109c4d51704ae5ca9a1d83cacc4fe30b3c399d..e309665b6c81962a82cb247b76f7b0312b0ba172 100644 (file)
@@ -12,6 +12,7 @@
 #include <asm/cpu-features.h>
 #include <asm/mipsregs.h>
 #include <asm/processor.h>
+#include <asm/mips_machine.h>
 
 unsigned int vced_count, vcei_count;
 
@@ -31,8 +32,12 @@ static int show_cpuinfo(struct seq_file *m, void *v)
        /*
         * For the first processor also print the system type
         */
-       if (n == 0)
+       if (n == 0) {
                seq_printf(m, "system type\t\t: %s\n", get_system_type());
+               if (mips_get_machine_name())
+                       seq_printf(m, "machine\t\t\t: %s\n",
+                                  mips_get_machine_name());
+       }
 
        seq_printf(m, "processor\t\t: %ld\n", n);
        sprintf(fmt, "cpu model\t\t: %%s V%%d.%%d%s\n",
@@ -69,6 +74,8 @@ static int show_cpuinfo(struct seq_file *m, void *v)
                );
        seq_printf(m, "shadow register sets\t: %d\n",
                       cpu_data[n].srsets);
+       seq_printf(m, "kscratch registers\t: %d\n",
+                  hweight8(cpu_data[n].kscratch_mask));
        seq_printf(m, "core\t\t\t: %d\n", cpu_data[n].core);
 
        sprintf(fmt, "VCE%%c exceptions\t\t: %s\n",
index acd3f2c49c069fa04af112d8c30dc008cf869351..8ad1d5679f1440ebe2393e1d25f1a3ab38c7a017 100644 (file)
@@ -70,7 +70,7 @@ static char __initdata builtin_cmdline[COMMAND_LINE_SIZE] = CONFIG_CMDLINE;
  * mips_io_port_base is the begin of the address space to which x86 style
  * I/O ports are mapped.
  */
-const unsigned long mips_io_port_base __read_mostly = -1;
+const unsigned long mips_io_port_base = -1;
 EXPORT_SYMBOL(mips_io_port_base);
 
 static struct resource code_resource = { .name = "Kernel code", };
index e97104302541fd4111ae9ceca477e04cf2b5add7..71350f7f2d8857507cc8da104c3dcee9a6a0a072 100644 (file)
@@ -1592,7 +1592,6 @@ void __cpuinit per_cpu_trap_init(void)
 #endif /* CONFIG_MIPS_MT_SMTC */
 
        cpu_data[cpu].asid_cache = ASID_FIRST_VERSION;
-       TLBMISS_HANDLER_SETUP();
 
        atomic_inc(&init_mm.mm_count);
        current->active_mm = &init_mm;
@@ -1614,6 +1613,7 @@ void __cpuinit per_cpu_trap_init(void)
                write_c0_wired(0);
        }
 #endif /* CONFIG_MIPS_MT_SMTC */
+       TLBMISS_HANDLER_SETUP();
 }
 
 /* Install CPU exception handler */
index f25df73db923a792b9debd05ba6184fca0030f41..570607b376b57d16696089773343f8a9f9e5f6e9 100644 (file)
@@ -98,6 +98,13 @@ SECTIONS
        INIT_TEXT_SECTION(PAGE_SIZE)
        INIT_DATA_SECTION(16)
 
+       . = ALIGN(4);
+       .mips.machines.init : AT(ADDR(.mips.machines.init) - LOAD_OFFSET) {
+               __mips_machines_start = .;
+               *(.mips.machines.init)
+               __mips_machines_end = .;
+       }
+
        /* .exit.text is discarded at runtime, not link time, to deal with
         * references from .rodata
         */
index 93816f3bca67f79b1f5b6aeb028487c6d06e67ec..083d3412d0bccc7744ec151cd493de614d0375b8 100644 (file)
 #include <linux/smp.h>
 #include <linux/string.h>
 #include <linux/init.h>
+#include <linux/cache.h>
 
-#include <asm/mmu_context.h>
+#include <asm/cacheflush.h>
+#include <asm/pgtable.h>
 #include <asm/war.h>
 #include <asm/uasm.h>
 
@@ -63,6 +65,52 @@ static inline int __maybe_unused r10000_llsc_war(void)
        return R10000_LLSC_WAR;
 }
 
+static int use_bbit_insns(void)
+{
+       switch (current_cpu_type()) {
+       case CPU_CAVIUM_OCTEON:
+       case CPU_CAVIUM_OCTEON_PLUS:
+       case CPU_CAVIUM_OCTEON2:
+               return 1;
+       default:
+               return 0;
+       }
+}
+
+static int use_lwx_insns(void)
+{
+       switch (current_cpu_type()) {
+       case CPU_CAVIUM_OCTEON2:
+               return 1;
+       default:
+               return 0;
+       }
+}
+#if defined(CONFIG_CAVIUM_OCTEON_CVMSEG_SIZE) && \
+    CONFIG_CAVIUM_OCTEON_CVMSEG_SIZE > 0
+static bool scratchpad_available(void)
+{
+       return true;
+}
+static int scratchpad_offset(int i)
+{
+       /*
+        * CVMSEG starts at address -32768 and extends for
+        * CAVIUM_OCTEON_CVMSEG_SIZE 128 byte cache lines.
+        */
+       i += 1; /* Kernel use starts at the top and works down. */
+       return CONFIG_CAVIUM_OCTEON_CVMSEG_SIZE * 128 - (8 * i) - 32768;
+}
+#else
+static bool scratchpad_available(void)
+{
+       return false;
+}
+static int scratchpad_offset(int i)
+{
+       BUG();
+}
+#endif
 /*
  * Found by experiment: At least some revisions of the 4kc throw under
  * some circumstances a machine check exception, triggered by invalid
@@ -173,11 +221,41 @@ static struct uasm_reloc relocs[128] __cpuinitdata;
 static int check_for_high_segbits __cpuinitdata;
 #endif
 
+static int check_for_high_segbits __cpuinitdata;
+
+static unsigned int kscratch_used_mask __cpuinitdata;
+
+static int __cpuinit allocate_kscratch(void)
+{
+       int r;
+       unsigned int a = cpu_data[0].kscratch_mask & ~kscratch_used_mask;
+
+       r = ffs(a);
+
+       if (r == 0)
+               return -1;
+
+       r--; /* make it zero based */
+
+       kscratch_used_mask |= (1 << r);
+
+       return r;
+}
+
+static int scratch_reg __cpuinitdata;
+static int pgd_reg __cpuinitdata;
+enum vmalloc64_mode {not_refill, refill_scratch, refill_noscratch};
+
 #ifndef CONFIG_MIPS_PGD_C0_CONTEXT
+
 /*
  * CONFIG_MIPS_PGD_C0_CONTEXT implies 64 bit and lack of pgd_current,
  * we cannot do r3000 under these circumstances.
+ *
+ * Declare pgd_current here instead of including mmu_context.h to avoid type
+ * conflicts for tlbmiss_handler_setup_pgd
  */
+extern unsigned long pgd_current[];
 
 /*
  * The R3000 TLB handler is simple.
@@ -440,21 +518,43 @@ static __cpuinit __maybe_unused void build_convert_pte_to_entrylo(u32 **p,
 static __cpuinit void build_restore_pagemask(u32 **p,
                                             struct uasm_reloc **r,
                                             unsigned int tmp,
-                                            enum label_id lid)
+                                            enum label_id lid,
+                                            int restore_scratch)
 {
-       /* Reset default page size */
-       if (PM_DEFAULT_MASK >> 16) {
-               uasm_i_lui(p, tmp, PM_DEFAULT_MASK >> 16);
-               uasm_i_ori(p, tmp, tmp, PM_DEFAULT_MASK & 0xffff);
-               uasm_il_b(p, r, lid);
-               uasm_i_mtc0(p, tmp, C0_PAGEMASK);
-       } else if (PM_DEFAULT_MASK) {
-               uasm_i_ori(p, tmp, 0, PM_DEFAULT_MASK);
-               uasm_il_b(p, r, lid);
-               uasm_i_mtc0(p, tmp, C0_PAGEMASK);
+       if (restore_scratch) {
+               /* Reset default page size */
+               if (PM_DEFAULT_MASK >> 16) {
+                       uasm_i_lui(p, tmp, PM_DEFAULT_MASK >> 16);
+                       uasm_i_ori(p, tmp, tmp, PM_DEFAULT_MASK & 0xffff);
+                       uasm_i_mtc0(p, tmp, C0_PAGEMASK);
+                       uasm_il_b(p, r, lid);
+               } else if (PM_DEFAULT_MASK) {
+                       uasm_i_ori(p, tmp, 0, PM_DEFAULT_MASK);
+                       uasm_i_mtc0(p, tmp, C0_PAGEMASK);
+                       uasm_il_b(p, r, lid);
+               } else {
+                       uasm_i_mtc0(p, 0, C0_PAGEMASK);
+                       uasm_il_b(p, r, lid);
+               }
+               if (scratch_reg > 0)
+                       UASM_i_MFC0(p, 1, 31, scratch_reg);
+               else
+                       UASM_i_LW(p, 1, scratchpad_offset(0), 0);
        } else {
-               uasm_il_b(p, r, lid);
-               uasm_i_mtc0(p, 0, C0_PAGEMASK);
+               /* Reset default page size */
+               if (PM_DEFAULT_MASK >> 16) {
+                       uasm_i_lui(p, tmp, PM_DEFAULT_MASK >> 16);
+                       uasm_i_ori(p, tmp, tmp, PM_DEFAULT_MASK & 0xffff);
+                       uasm_il_b(p, r, lid);
+                       uasm_i_mtc0(p, tmp, C0_PAGEMASK);
+               } else if (PM_DEFAULT_MASK) {
+                       uasm_i_ori(p, tmp, 0, PM_DEFAULT_MASK);
+                       uasm_il_b(p, r, lid);
+                       uasm_i_mtc0(p, tmp, C0_PAGEMASK);
+               } else {
+                       uasm_il_b(p, r, lid);
+                       uasm_i_mtc0(p, 0, C0_PAGEMASK);
+               }
        }
 }
 
@@ -462,7 +562,8 @@ static __cpuinit void build_huge_tlb_write_entry(u32 **p,
                                                 struct uasm_label **l,
                                                 struct uasm_reloc **r,
                                                 unsigned int tmp,
-                                                enum tlb_write_entry wmode)
+                                                enum tlb_write_entry wmode,
+                                                int restore_scratch)
 {
        /* Set huge page tlb entry size */
        uasm_i_lui(p, tmp, PM_HUGE_MASK >> 16);
@@ -471,7 +572,7 @@ static __cpuinit void build_huge_tlb_write_entry(u32 **p,
 
        build_tlb_write_entry(p, l, r, wmode);
 
-       build_restore_pagemask(p, r, tmp, label_leave);
+       build_restore_pagemask(p, r, tmp, label_leave, restore_scratch);
 }
 
 /*
@@ -482,8 +583,12 @@ build_is_huge_pte(u32 **p, struct uasm_reloc **r, unsigned int tmp,
                unsigned int pmd, int lid)
 {
        UASM_i_LW(p, tmp, 0, pmd);
-       uasm_i_andi(p, tmp, tmp, _PAGE_HUGE);
-       uasm_il_bnez(p, r, tmp, lid);
+       if (use_bbit_insns()) {
+               uasm_il_bbit1(p, r, tmp, ilog2(_PAGE_HUGE), lid);
+       } else {
+               uasm_i_andi(p, tmp, tmp, _PAGE_HUGE);
+               uasm_il_bnez(p, r, tmp, lid);
+       }
 }
 
 static __cpuinit void build_huge_update_entries(u32 **p,
@@ -532,7 +637,7 @@ static __cpuinit void build_huge_handler_tail(u32 **p,
        UASM_i_SW(p, pte, 0, ptr);
 #endif
        build_huge_update_entries(p, pte, ptr);
-       build_huge_tlb_write_entry(p, l, r, pte, tlb_indexed);
+       build_huge_tlb_write_entry(p, l, r, pte, tlb_indexed, 0);
 }
 #endif /* CONFIG_HUGETLB_PAGE */
 
@@ -573,13 +678,22 @@ build_get_pmde64(u32 **p, struct uasm_label **l, struct uasm_reloc **r,
        /* No uasm_i_nop needed here, since the next insn doesn't touch TMP. */
 
 #ifdef CONFIG_MIPS_PGD_C0_CONTEXT
-       /*
-        * &pgd << 11 stored in CONTEXT [23..63].
-        */
-       UASM_i_MFC0(p, ptr, C0_CONTEXT);
-       uasm_i_dins(p, ptr, 0, 0, 23); /* Clear lower 23 bits of context. */
-       uasm_i_ori(p, ptr, ptr, 0x540); /* 1 0  1 0 1  << 6  xkphys cached */
-       uasm_i_drotr(p, ptr, ptr, 11);
+       if (pgd_reg != -1) {
+               /* pgd is in pgd_reg */
+               UASM_i_MFC0(p, ptr, 31, pgd_reg);
+       } else {
+               /*
+                * &pgd << 11 stored in CONTEXT [23..63].
+                */
+               UASM_i_MFC0(p, ptr, C0_CONTEXT);
+
+               /* Clear lower 23 bits of context. */
+               uasm_i_dins(p, ptr, 0, 0, 23);
+
+               /* 1 0  1 0 1  << 6  xkphys cached */
+               uasm_i_ori(p, ptr, ptr, 0x540);
+               uasm_i_drotr(p, ptr, ptr, 11);
+       }
 #elif defined(CONFIG_SMP)
 # ifdef  CONFIG_MIPS_MT_SMTC
        /*
@@ -620,7 +734,6 @@ build_get_pmde64(u32 **p, struct uasm_label **l, struct uasm_reloc **r,
 #endif
 }
 
-enum vmalloc64_mode {not_refill, refill};
 /*
  * BVADDR is the faulting address, PTR is scratch.
  * PTR will hold the pgd for vmalloc.
@@ -638,7 +751,7 @@ build_get_pgd_vmalloc64(u32 **p, struct uasm_label **l, struct uasm_reloc **r,
 
        uasm_l_vmalloc(l, *p);
 
-       if (mode == refill && check_for_high_segbits) {
+       if (mode != not_refill && check_for_high_segbits) {
                if (single_insn_swpd) {
                        uasm_il_bltz(p, r, bvaddr, label_vmalloc_done);
                        uasm_i_lui(p, ptr, uasm_rel_hi(swpd));
@@ -661,7 +774,7 @@ build_get_pgd_vmalloc64(u32 **p, struct uasm_label **l, struct uasm_reloc **r,
                                uasm_i_daddiu(p, ptr, ptr, uasm_rel_lo(swpd));
                }
        }
-       if (mode == refill && check_for_high_segbits) {
+       if (mode != not_refill && check_for_high_segbits) {
                uasm_l_large_segbits_fault(l, *p);
                /*
                 * We get here if we are an xsseg address, or if we are
@@ -677,7 +790,15 @@ build_get_pgd_vmalloc64(u32 **p, struct uasm_label **l, struct uasm_reloc **r,
                 */
                UASM_i_LA(p, ptr, (unsigned long)tlb_do_page_fault_0);
                uasm_i_jr(p, ptr);
-               uasm_i_nop(p);
+
+               if (mode == refill_scratch) {
+                       if (scratch_reg > 0)
+                               UASM_i_MFC0(p, 1, 31, scratch_reg);
+                       else
+                               UASM_i_LW(p, 1, scratchpad_offset(0), 0);
+               } else {
+                       uasm_i_nop(p);
+               }
        }
 }
 
@@ -834,6 +955,185 @@ static void __cpuinit build_update_entries(u32 **p, unsigned int tmp,
 #endif
 }
 
+struct mips_huge_tlb_info {
+       int huge_pte;
+       int restore_scratch;
+};
+
+static struct mips_huge_tlb_info __cpuinit
+build_fast_tlb_refill_handler (u32 **p, struct uasm_label **l,
+                              struct uasm_reloc **r, unsigned int tmp,
+                              unsigned int ptr, int c0_scratch)
+{
+       struct mips_huge_tlb_info rv;
+       unsigned int even, odd;
+       int vmalloc_branch_delay_filled = 0;
+       const int scratch = 1; /* Our extra working register */
+
+       rv.huge_pte = scratch;
+       rv.restore_scratch = 0;
+
+       if (check_for_high_segbits) {
+               UASM_i_MFC0(p, tmp, C0_BADVADDR);
+
+               if (pgd_reg != -1)
+                       UASM_i_MFC0(p, ptr, 31, pgd_reg);
+               else
+                       UASM_i_MFC0(p, ptr, C0_CONTEXT);
+
+               if (c0_scratch >= 0)
+                       UASM_i_MTC0(p, scratch, 31, c0_scratch);
+               else
+                       UASM_i_SW(p, scratch, scratchpad_offset(0), 0);
+
+               uasm_i_dsrl_safe(p, scratch, tmp,
+                                PGDIR_SHIFT + PGD_ORDER + PAGE_SHIFT - 3);
+               uasm_il_bnez(p, r, scratch, label_vmalloc);
+
+               if (pgd_reg == -1) {
+                       vmalloc_branch_delay_filled = 1;
+                       /* Clear lower 23 bits of context. */
+                       uasm_i_dins(p, ptr, 0, 0, 23);
+               }
+       } else {
+               if (pgd_reg != -1)
+                       UASM_i_MFC0(p, ptr, 31, pgd_reg);
+               else
+                       UASM_i_MFC0(p, ptr, C0_CONTEXT);
+
+               UASM_i_MFC0(p, tmp, C0_BADVADDR);
+
+               if (c0_scratch >= 0)
+                       UASM_i_MTC0(p, scratch, 31, c0_scratch);
+               else
+                       UASM_i_SW(p, scratch, scratchpad_offset(0), 0);
+
+               if (pgd_reg == -1)
+                       /* Clear lower 23 bits of context. */
+                       uasm_i_dins(p, ptr, 0, 0, 23);
+
+               uasm_il_bltz(p, r, tmp, label_vmalloc);
+       }
+
+       if (pgd_reg == -1) {
+               vmalloc_branch_delay_filled = 1;
+               /* 1 0  1 0 1  << 6  xkphys cached */
+               uasm_i_ori(p, ptr, ptr, 0x540);
+               uasm_i_drotr(p, ptr, ptr, 11);
+       }
+
+#ifdef __PAGETABLE_PMD_FOLDED
+#define LOC_PTEP scratch
+#else
+#define LOC_PTEP ptr
+#endif
+
+       if (!vmalloc_branch_delay_filled)
+               /* get pgd offset in bytes */
+               uasm_i_dsrl_safe(p, scratch, tmp, PGDIR_SHIFT - 3);
+
+       uasm_l_vmalloc_done(l, *p);
+
+       /*
+        *                         tmp          ptr
+        * fall-through case =   badvaddr  *pgd_current
+        * vmalloc case      =   badvaddr  swapper_pg_dir
+        */
+
+       if (vmalloc_branch_delay_filled)
+               /* get pgd offset in bytes */
+               uasm_i_dsrl_safe(p, scratch, tmp, PGDIR_SHIFT - 3);
+
+#ifdef __PAGETABLE_PMD_FOLDED
+       GET_CONTEXT(p, tmp); /* get context reg */
+#endif
+       uasm_i_andi(p, scratch, scratch, (PTRS_PER_PGD - 1) << 3);
+
+       if (use_lwx_insns()) {
+               UASM_i_LWX(p, LOC_PTEP, scratch, ptr);
+       } else {
+               uasm_i_daddu(p, ptr, ptr, scratch); /* add in pgd offset */
+               uasm_i_ld(p, LOC_PTEP, 0, ptr); /* get pmd pointer */
+       }
+
+#ifndef __PAGETABLE_PMD_FOLDED
+       /* get pmd offset in bytes */
+       uasm_i_dsrl_safe(p, scratch, tmp, PMD_SHIFT - 3);
+       uasm_i_andi(p, scratch, scratch, (PTRS_PER_PMD - 1) << 3);
+       GET_CONTEXT(p, tmp); /* get context reg */
+
+       if (use_lwx_insns()) {
+               UASM_i_LWX(p, scratch, scratch, ptr);
+       } else {
+               uasm_i_daddu(p, ptr, ptr, scratch); /* add in pmd offset */
+               UASM_i_LW(p, scratch, 0, ptr);
+       }
+#endif
+       /* Adjust the context during the load latency. */
+       build_adjust_context(p, tmp);
+
+#ifdef CONFIG_HUGETLB_PAGE
+       uasm_il_bbit1(p, r, scratch, ilog2(_PAGE_HUGE), label_tlb_huge_update);
+       /*
+        * The in the LWX case we don't want to do the load in the
+        * delay slot.  It cannot issue in the same cycle and may be
+        * speculative and unneeded.
+        */
+       if (use_lwx_insns())
+               uasm_i_nop(p);
+#endif /* CONFIG_HUGETLB_PAGE */
+
+
+       /* build_update_entries */
+       if (use_lwx_insns()) {
+               even = ptr;
+               odd = tmp;
+               UASM_i_LWX(p, even, scratch, tmp);
+               UASM_i_ADDIU(p, tmp, tmp, sizeof(pte_t));
+               UASM_i_LWX(p, odd, scratch, tmp);
+       } else {
+               UASM_i_ADDU(p, ptr, scratch, tmp); /* add in offset */
+               even = tmp;
+               odd = ptr;
+               UASM_i_LW(p, even, 0, ptr); /* get even pte */
+               UASM_i_LW(p, odd, sizeof(pte_t), ptr); /* get odd pte */
+       }
+       if (kernel_uses_smartmips_rixi) {
+               uasm_i_dsrl_safe(p, even, even, ilog2(_PAGE_NO_EXEC));
+               uasm_i_dsrl_safe(p, odd, odd, ilog2(_PAGE_NO_EXEC));
+               uasm_i_drotr(p, even, even,
+                            ilog2(_PAGE_GLOBAL) - ilog2(_PAGE_NO_EXEC));
+               UASM_i_MTC0(p, even, C0_ENTRYLO0); /* load it */
+               uasm_i_drotr(p, odd, odd,
+                            ilog2(_PAGE_GLOBAL) - ilog2(_PAGE_NO_EXEC));
+       } else {
+               uasm_i_dsrl_safe(p, even, even, ilog2(_PAGE_GLOBAL));
+               UASM_i_MTC0(p, even, C0_ENTRYLO0); /* load it */
+               uasm_i_dsrl_safe(p, odd, odd, ilog2(_PAGE_GLOBAL));
+       }
+       UASM_i_MTC0(p, odd, C0_ENTRYLO1); /* load it */
+
+       if (c0_scratch >= 0) {
+               UASM_i_MFC0(p, scratch, 31, c0_scratch);
+               build_tlb_write_entry(p, l, r, tlb_random);
+               uasm_l_leave(l, *p);
+               rv.restore_scratch = 1;
+       } else if (PAGE_SHIFT == 14 || PAGE_SHIFT == 13)  {
+               build_tlb_write_entry(p, l, r, tlb_random);
+               uasm_l_leave(l, *p);
+               UASM_i_LW(p, scratch, scratchpad_offset(0), 0);
+       } else {
+               UASM_i_LW(p, scratch, scratchpad_offset(0), 0);
+               build_tlb_write_entry(p, l, r, tlb_random);
+               uasm_l_leave(l, *p);
+               rv.restore_scratch = 1;
+       }
+
+       uasm_i_eret(p); /* return from trap */
+
+       return rv;
+}
+
 /*
  * For a 64-bit kernel, we are using the 64-bit XTLB refill exception
  * because EXL == 0.  If we wrap, we can also use the 32 instruction
@@ -849,54 +1149,67 @@ static void __cpuinit build_r4000_tlb_refill_handler(void)
        struct uasm_reloc *r = relocs;
        u32 *f;
        unsigned int final_len;
+       struct mips_huge_tlb_info htlb_info;
+       enum vmalloc64_mode vmalloc_mode;
 
        memset(tlb_handler, 0, sizeof(tlb_handler));
        memset(labels, 0, sizeof(labels));
        memset(relocs, 0, sizeof(relocs));
        memset(final_handler, 0, sizeof(final_handler));
 
-       /*
-        * create the plain linear handler
-        */
-       if (bcm1250_m3_war()) {
-               unsigned int segbits = 44;
+       if (scratch_reg == 0)
+               scratch_reg = allocate_kscratch();
 
-               uasm_i_dmfc0(&p, K0, C0_BADVADDR);
-               uasm_i_dmfc0(&p, K1, C0_ENTRYHI);
-               uasm_i_xor(&p, K0, K0, K1);
-               uasm_i_dsrl_safe(&p, K1, K0, 62);
-               uasm_i_dsrl_safe(&p, K0, K0, 12 + 1);
-               uasm_i_dsll_safe(&p, K0, K0, 64 + 12 + 1 - segbits);
-               uasm_i_or(&p, K0, K0, K1);
-               uasm_il_bnez(&p, &r, K0, label_leave);
-               /* No need for uasm_i_nop */
-       }
+       if ((scratch_reg > 0 || scratchpad_available()) && use_bbit_insns()) {
+               htlb_info = build_fast_tlb_refill_handler(&p, &l, &r, K0, K1,
+                                                         scratch_reg);
+               vmalloc_mode = refill_scratch;
+       } else {
+               htlb_info.huge_pte = K0;
+               htlb_info.restore_scratch = 0;
+               vmalloc_mode = refill_noscratch;
+               /*
+                * create the plain linear handler
+                */
+               if (bcm1250_m3_war()) {
+                       unsigned int segbits = 44;
+
+                       uasm_i_dmfc0(&p, K0, C0_BADVADDR);
+                       uasm_i_dmfc0(&p, K1, C0_ENTRYHI);
+                       uasm_i_xor(&p, K0, K0, K1);
+                       uasm_i_dsrl_safe(&p, K1, K0, 62);
+                       uasm_i_dsrl_safe(&p, K0, K0, 12 + 1);
+                       uasm_i_dsll_safe(&p, K0, K0, 64 + 12 + 1 - segbits);
+                       uasm_i_or(&p, K0, K0, K1);
+                       uasm_il_bnez(&p, &r, K0, label_leave);
+                       /* No need for uasm_i_nop */
+               }
 
 #ifdef CONFIG_64BIT
-       build_get_pmde64(&p, &l, &r, K0, K1); /* get pmd in K1 */
+               build_get_pmde64(&p, &l, &r, K0, K1); /* get pmd in K1 */
 #else
-       build_get_pgde32(&p, K0, K1); /* get pgd in K1 */
+               build_get_pgde32(&p, K0, K1); /* get pgd in K1 */
 #endif
 
 #ifdef CONFIG_HUGETLB_PAGE
-       build_is_huge_pte(&p, &r, K0, K1, label_tlb_huge_update);
+               build_is_huge_pte(&p, &r, K0, K1, label_tlb_huge_update);
 #endif
 
-       build_get_ptep(&p, K0, K1);
-       build_update_entries(&p, K0, K1);
-       build_tlb_write_entry(&p, &l, &r, tlb_random);
-       uasm_l_leave(&l, p);
-       uasm_i_eret(&p); /* return from trap */
-
+               build_get_ptep(&p, K0, K1);
+               build_update_entries(&p, K0, K1);
+               build_tlb_write_entry(&p, &l, &r, tlb_random);
+               uasm_l_leave(&l, p);
+               uasm_i_eret(&p); /* return from trap */
+       }
 #ifdef CONFIG_HUGETLB_PAGE
        uasm_l_tlb_huge_update(&l, p);
-       UASM_i_LW(&p, K0, 0, K1);
-       build_huge_update_entries(&p, K0, K1);
-       build_huge_tlb_write_entry(&p, &l, &r, K0, tlb_random);
+       build_huge_update_entries(&p, htlb_info.huge_pte, K1);
+       build_huge_tlb_write_entry(&p, &l, &r, K0, tlb_random,
+                                  htlb_info.restore_scratch);
 #endif
 
 #ifdef CONFIG_64BIT
-       build_get_pgd_vmalloc64(&p, &l, &r, K0, K1, refill);
+       build_get_pgd_vmalloc64(&p, &l, &r, K0, K1, vmalloc_mode);
 #endif
 
        /*
@@ -1014,6 +1327,55 @@ static void __cpuinit build_r4000_tlb_refill_handler(void)
 u32 handle_tlbl[FASTPATH_SIZE] __cacheline_aligned;
 u32 handle_tlbs[FASTPATH_SIZE] __cacheline_aligned;
 u32 handle_tlbm[FASTPATH_SIZE] __cacheline_aligned;
+#ifdef CONFIG_MIPS_PGD_C0_CONTEXT
+u32 tlbmiss_handler_setup_pgd[16] __cacheline_aligned;
+
+static void __cpuinit build_r4000_setup_pgd(void)
+{
+       const int a0 = 4;
+       const int a1 = 5;
+       u32 *p = tlbmiss_handler_setup_pgd;
+       struct uasm_label *l = labels;
+       struct uasm_reloc *r = relocs;
+
+       memset(tlbmiss_handler_setup_pgd, 0, sizeof(tlbmiss_handler_setup_pgd));
+       memset(labels, 0, sizeof(labels));
+       memset(relocs, 0, sizeof(relocs));
+
+       pgd_reg = allocate_kscratch();
+
+       if (pgd_reg == -1) {
+               /* PGD << 11 in c0_Context */
+               /*
+                * If it is a ckseg0 address, convert to a physical
+                * address.  Shifting right by 29 and adding 4 will
+                * result in zero for these addresses.
+                *
+                */
+               UASM_i_SRA(&p, a1, a0, 29);
+               UASM_i_ADDIU(&p, a1, a1, 4);
+               uasm_il_bnez(&p, &r, a1, label_tlbl_goaround1);
+               uasm_i_nop(&p);
+               uasm_i_dinsm(&p, a0, 0, 29, 64 - 29);
+               uasm_l_tlbl_goaround1(&l, p);
+               UASM_i_SLL(&p, a0, a0, 11);
+               uasm_i_jr(&p, 31);
+               UASM_i_MTC0(&p, a0, C0_CONTEXT);
+       } else {
+               /* PGD in c0_KScratch */
+               uasm_i_jr(&p, 31);
+               UASM_i_MTC0(&p, a0, 31, pgd_reg);
+       }
+       if (p - tlbmiss_handler_setup_pgd > ARRAY_SIZE(tlbmiss_handler_setup_pgd))
+               panic("tlbmiss_handler_setup_pgd space exceeded");
+       uasm_resolve_relocs(relocs, labels);
+       pr_debug("Wrote tlbmiss_handler_setup_pgd (%u instructions).\n",
+                (unsigned int)(p - tlbmiss_handler_setup_pgd));
+
+       dump_handler(tlbmiss_handler_setup_pgd,
+                    ARRAY_SIZE(tlbmiss_handler_setup_pgd));
+}
+#endif
 
 static void __cpuinit
 iPTE_LW(u32 **p, unsigned int pte, unsigned int ptr)
@@ -1100,14 +1462,20 @@ build_pte_present(u32 **p, struct uasm_reloc **r,
                  unsigned int pte, unsigned int ptr, enum label_id lid)
 {
        if (kernel_uses_smartmips_rixi) {
-               uasm_i_andi(p, pte, pte, _PAGE_PRESENT);
-               uasm_il_beqz(p, r, pte, lid);
+               if (use_bbit_insns()) {
+                       uasm_il_bbit0(p, r, pte, ilog2(_PAGE_PRESENT), lid);
+                       uasm_i_nop(p);
+               } else {
+                       uasm_i_andi(p, pte, pte, _PAGE_PRESENT);
+                       uasm_il_beqz(p, r, pte, lid);
+                       iPTE_LW(p, pte, ptr);
+               }
        } else {
                uasm_i_andi(p, pte, pte, _PAGE_PRESENT | _PAGE_READ);
                uasm_i_xori(p, pte, pte, _PAGE_PRESENT | _PAGE_READ);
                uasm_il_bnez(p, r, pte, lid);
+               iPTE_LW(p, pte, ptr);
        }
-       iPTE_LW(p, pte, ptr);
 }
 
 /* Make PTE valid, store result in PTR. */
@@ -1128,10 +1496,17 @@ static void __cpuinit
 build_pte_writable(u32 **p, struct uasm_reloc **r,
                   unsigned int pte, unsigned int ptr, enum label_id lid)
 {
-       uasm_i_andi(p, pte, pte, _PAGE_PRESENT | _PAGE_WRITE);
-       uasm_i_xori(p, pte, pte, _PAGE_PRESENT | _PAGE_WRITE);
-       uasm_il_bnez(p, r, pte, lid);
-       iPTE_LW(p, pte, ptr);
+       if (use_bbit_insns()) {
+               uasm_il_bbit0(p, r, pte, ilog2(_PAGE_PRESENT), lid);
+               uasm_i_nop(p);
+               uasm_il_bbit0(p, r, pte, ilog2(_PAGE_WRITE), lid);
+               uasm_i_nop(p);
+       } else {
+               uasm_i_andi(p, pte, pte, _PAGE_PRESENT | _PAGE_WRITE);
+               uasm_i_xori(p, pte, pte, _PAGE_PRESENT | _PAGE_WRITE);
+               uasm_il_bnez(p, r, pte, lid);
+               iPTE_LW(p, pte, ptr);
+       }
 }
 
 /* Make PTE writable, update software status bits as well, then store
@@ -1155,12 +1530,19 @@ static void __cpuinit
 build_pte_modifiable(u32 **p, struct uasm_reloc **r,
                     unsigned int pte, unsigned int ptr, enum label_id lid)
 {
-       uasm_i_andi(p, pte, pte, _PAGE_WRITE);
-       uasm_il_beqz(p, r, pte, lid);
-       iPTE_LW(p, pte, ptr);
+       if (use_bbit_insns()) {
+               uasm_il_bbit0(p, r, pte, ilog2(_PAGE_WRITE), lid);
+               uasm_i_nop(p);
+       } else {
+               uasm_i_andi(p, pte, pte, _PAGE_WRITE);
+               uasm_il_beqz(p, r, pte, lid);
+               iPTE_LW(p, pte, ptr);
+       }
 }
 
 #ifndef CONFIG_MIPS_PGD_C0_CONTEXT
+
+
 /*
  * R3000 style TLB load/store/modify handlers.
  */
@@ -1402,14 +1784,23 @@ static void __cpuinit build_r4000_tlb_load_handler(void)
                 * If the page is not _PAGE_VALID, RI or XI could not
                 * have triggered it.  Skip the expensive test..
                 */
-               uasm_i_andi(&p, K0, K0, _PAGE_VALID);
-               uasm_il_beqz(&p, &r, K0, label_tlbl_goaround1);
+               if (use_bbit_insns()) {
+                       uasm_il_bbit0(&p, &r, K0, ilog2(_PAGE_VALID),
+                                     label_tlbl_goaround1);
+               } else {
+                       uasm_i_andi(&p, K0, K0, _PAGE_VALID);
+                       uasm_il_beqz(&p, &r, K0, label_tlbl_goaround1);
+               }
                uasm_i_nop(&p);
 
                uasm_i_tlbr(&p);
                /* Examine  entrylo 0 or 1 based on ptr. */
-               uasm_i_andi(&p, K0, K1, sizeof(pte_t));
-               uasm_i_beqz(&p, K0, 8);
+               if (use_bbit_insns()) {
+                       uasm_i_bbit0(&p, K1, ilog2(sizeof(pte_t)), 8);
+               } else {
+                       uasm_i_andi(&p, K0, K1, sizeof(pte_t));
+                       uasm_i_beqz(&p, K0, 8);
+               }
 
                UASM_i_MFC0(&p, K0, C0_ENTRYLO0); /* load it in the delay slot*/
                UASM_i_MFC0(&p, K0, C0_ENTRYLO1); /* load it if ptr is odd */
@@ -1417,12 +1808,18 @@ static void __cpuinit build_r4000_tlb_load_handler(void)
                 * If the entryLo (now in K0) is valid (bit 1), RI or
                 * XI must have triggered it.
                 */
-               uasm_i_andi(&p, K0, K0, 2);
-               uasm_il_bnez(&p, &r, K0, label_nopage_tlbl);
-
-               uasm_l_tlbl_goaround1(&l, p);
-               /* Reload the PTE value */
-               iPTE_LW(&p, K0, K1);
+               if (use_bbit_insns()) {
+                       uasm_il_bbit1(&p, &r, K0, 1, label_nopage_tlbl);
+                       /* Reload the PTE value */
+                       iPTE_LW(&p, K0, K1);
+                       uasm_l_tlbl_goaround1(&l, p);
+               } else {
+                       uasm_i_andi(&p, K0, K0, 2);
+                       uasm_il_bnez(&p, &r, K0, label_nopage_tlbl);
+                       uasm_l_tlbl_goaround1(&l, p);
+                       /* Reload the PTE value */
+                       iPTE_LW(&p, K0, K1);
+               }
        }
        build_make_valid(&p, &r, K0, K1);
        build_r4000_tlbchange_handler_tail(&p, &l, &r, K0, K1);
@@ -1442,23 +1839,35 @@ static void __cpuinit build_r4000_tlb_load_handler(void)
                 * If the page is not _PAGE_VALID, RI or XI could not
                 * have triggered it.  Skip the expensive test..
                 */
-               uasm_i_andi(&p, K0, K0, _PAGE_VALID);
-               uasm_il_beqz(&p, &r, K0, label_tlbl_goaround2);
+               if (use_bbit_insns()) {
+                       uasm_il_bbit0(&p, &r, K0, ilog2(_PAGE_VALID),
+                                     label_tlbl_goaround2);
+               } else {
+                       uasm_i_andi(&p, K0, K0, _PAGE_VALID);
+                       uasm_il_beqz(&p, &r, K0, label_tlbl_goaround2);
+               }
                uasm_i_nop(&p);
 
                uasm_i_tlbr(&p);
                /* Examine  entrylo 0 or 1 based on ptr. */
-               uasm_i_andi(&p, K0, K1, sizeof(pte_t));
-               uasm_i_beqz(&p, K0, 8);
-
+               if (use_bbit_insns()) {
+                       uasm_i_bbit0(&p, K1, ilog2(sizeof(pte_t)), 8);
+               } else {
+                       uasm_i_andi(&p, K0, K1, sizeof(pte_t));
+                       uasm_i_beqz(&p, K0, 8);
+               }
                UASM_i_MFC0(&p, K0, C0_ENTRYLO0); /* load it in the delay slot*/
                UASM_i_MFC0(&p, K0, C0_ENTRYLO1); /* load it if ptr is odd */
                /*
                 * If the entryLo (now in K0) is valid (bit 1), RI or
                 * XI must have triggered it.
                 */
-               uasm_i_andi(&p, K0, K0, 2);
-               uasm_il_beqz(&p, &r, K0, label_tlbl_goaround2);
+               if (use_bbit_insns()) {
+                       uasm_il_bbit0(&p, &r, K0, 1, label_tlbl_goaround2);
+               } else {
+                       uasm_i_andi(&p, K0, K0, 2);
+                       uasm_il_beqz(&p, &r, K0, label_tlbl_goaround2);
+               }
                /* Reload the PTE value */
                iPTE_LW(&p, K0, K1);
 
@@ -1466,7 +1875,7 @@ static void __cpuinit build_r4000_tlb_load_handler(void)
                 * We clobbered C0_PAGEMASK, restore it.  On the other branch
                 * it is restored in build_huge_tlb_write_entry.
                 */
-               build_restore_pagemask(&p, &r, K0, label_nopage_tlbl);
+               build_restore_pagemask(&p, &r, K0, label_nopage_tlbl, 0);
 
                uasm_l_tlbl_goaround2(&l, p);
        }
@@ -1623,13 +2032,16 @@ void __cpuinit build_tlb_refill_handler(void)
                break;
 
        default:
-               build_r4000_tlb_refill_handler();
                if (!run_once) {
+#ifdef CONFIG_MIPS_PGD_C0_CONTEXT
+                       build_r4000_setup_pgd();
+#endif
                        build_r4000_tlb_load_handler();
                        build_r4000_tlb_store_handler();
                        build_r4000_tlb_modify_handler();
                        run_once++;
                }
+               build_r4000_tlb_refill_handler();
        }
 }
 
@@ -1641,4 +2053,8 @@ void __cpuinit flush_tlb_handlers(void)
                           (unsigned long)handle_tlbs + sizeof(handle_tlbs));
        local_flush_icache_range((unsigned long)handle_tlbm,
                           (unsigned long)handle_tlbm + sizeof(handle_tlbm));
+#ifdef CONFIG_MIPS_PGD_C0_CONTEXT
+       local_flush_icache_range((unsigned long)tlbmiss_handler_setup_pgd,
+                          (unsigned long)tlbmiss_handler_setup_pgd + sizeof(handle_tlbm));
+#endif
 }
index 23afdebc8e5cf2db134af1d6e9d0df3f0f2dea38..5fa185151fc8c29b121415db015b4bb878a5b7c1 100644 (file)
@@ -68,7 +68,8 @@ enum opcode {
        insn_pref, insn_rfe, insn_sc, insn_scd, insn_sd, insn_sll,
        insn_sra, insn_srl, insn_rotr, insn_subu, insn_sw, insn_tlbp,
        insn_tlbr, insn_tlbwi, insn_tlbwr, insn_xor, insn_xori,
-       insn_dins, insn_syscall, insn_bbit0, insn_bbit1
+       insn_dins, insn_dinsm, insn_syscall, insn_bbit0, insn_bbit1,
+       insn_lwx, insn_ldx
 };
 
 struct insn {
@@ -142,9 +143,12 @@ static struct insn insn_table[] __uasminitdata = {
        { insn_xor,  M(spec_op, 0, 0, 0, 0, xor_op),  RS | RT | RD },
        { insn_xori,  M(xori_op, 0, 0, 0, 0, 0),  RS | RT | UIMM },
        { insn_dins, M(spec3_op, 0, 0, 0, 0, dins_op), RS | RT | RD | RE },
+       { insn_dinsm, M(spec3_op, 0, 0, 0, 0, dinsm_op), RS | RT | RD | RE },
        { insn_syscall, M(spec_op, 0, 0, 0, 0, syscall_op), SCIMM},
        { insn_bbit0, M(lwc2_op, 0, 0, 0, 0, 0), RS | RT | BIMM },
        { insn_bbit1, M(swc2_op, 0, 0, 0, 0, 0), RS | RT | BIMM },
+       { insn_lwx, M(spec3_op, 0, 0, 0, lwx_op, lx_op), RS | RT | RD },
+       { insn_ldx, M(spec3_op, 0, 0, 0, ldx_op, lx_op), RS | RT | RD },
        { insn_invalid, 0, 0 }
 };
 
@@ -152,91 +156,83 @@ static struct insn insn_table[] __uasminitdata = {
 
 static inline __uasminit u32 build_rs(u32 arg)
 {
-       if (arg & ~RS_MASK)
-               printk(KERN_WARNING "Micro-assembler field overflow\n");
+       WARN(arg & ~RS_MASK, KERN_WARNING "Micro-assembler field overflow\n");
 
        return (arg & RS_MASK) << RS_SH;
 }
 
 static inline __uasminit u32 build_rt(u32 arg)
 {
-       if (arg & ~RT_MASK)
-               printk(KERN_WARNING "Micro-assembler field overflow\n");
+       WARN(arg & ~RT_MASK, KERN_WARNING "Micro-assembler field overflow\n");
 
        return (arg & RT_MASK) << RT_SH;
 }
 
 static inline __uasminit u32 build_rd(u32 arg)
 {
-       if (arg & ~RD_MASK)
-               printk(KERN_WARNING "Micro-assembler field overflow\n");
+       WARN(arg & ~RD_MASK, KERN_WARNING "Micro-assembler field overflow\n");
 
        return (arg & RD_MASK) << RD_SH;
 }
 
 static inline __uasminit u32 build_re(u32 arg)
 {
-       if (arg & ~RE_MASK)
-               printk(KERN_WARNING "Micro-assembler field overflow\n");
+       WARN(arg & ~RE_MASK, KERN_WARNING "Micro-assembler field overflow\n");
 
        return (arg & RE_MASK) << RE_SH;
 }
 
 static inline __uasminit u32 build_simm(s32 arg)
 {
-       if (arg > 0x7fff || arg < -0x8000)
-               printk(KERN_WARNING "Micro-assembler field overflow\n");
+       WARN(arg > 0x7fff || arg < -0x8000,
+            KERN_WARNING "Micro-assembler field overflow\n");
 
        return arg & 0xffff;
 }
 
 static inline __uasminit u32 build_uimm(u32 arg)
 {
-       if (arg & ~IMM_MASK)
-               printk(KERN_WARNING "Micro-assembler field overflow\n");
+       WARN(arg & ~IMM_MASK, KERN_WARNING "Micro-assembler field overflow\n");
 
        return arg & IMM_MASK;
 }
 
 static inline __uasminit u32 build_bimm(s32 arg)
 {
-       if (arg > 0x1ffff || arg < -0x20000)
-               printk(KERN_WARNING "Micro-assembler field overflow\n");
+       WARN(arg > 0x1ffff || arg < -0x20000,
+            KERN_WARNING "Micro-assembler field overflow\n");
 
-       if (arg & 0x3)
-               printk(KERN_WARNING "Invalid micro-assembler branch target\n");
+       WARN(arg & 0x3, KERN_WARNING "Invalid micro-assembler branch target\n");
 
        return ((arg < 0) ? (1 << 15) : 0) | ((arg >> 2) & 0x7fff);
 }
 
 static inline __uasminit u32 build_jimm(u32 arg)
 {
-       if (arg & ~((JIMM_MASK) << 2))
-               printk(KERN_WARNING "Micro-assembler field overflow\n");
+       WARN(arg & ~(JIMM_MASK << 2),
+            KERN_WARNING "Micro-assembler field overflow\n");
 
        return (arg >> 2) & JIMM_MASK;
 }
 
 static inline __uasminit u32 build_scimm(u32 arg)
 {
-       if (arg & ~SCIMM_MASK)
-               printk(KERN_WARNING "Micro-assembler field overflow\n");
+       WARN(arg & ~SCIMM_MASK,
+            KERN_WARNING "Micro-assembler field overflow\n");
 
        return (arg & SCIMM_MASK) << SCIMM_SH;
 }
 
 static inline __uasminit u32 build_func(u32 arg)
 {
-       if (arg & ~FUNC_MASK)
-               printk(KERN_WARNING "Micro-assembler field overflow\n");
+       WARN(arg & ~FUNC_MASK, KERN_WARNING "Micro-assembler field overflow\n");
 
        return arg & FUNC_MASK;
 }
 
 static inline __uasminit u32 build_set(u32 arg)
 {
-       if (arg & ~SET_MASK)
-               printk(KERN_WARNING "Micro-assembler field overflow\n");
+       WARN(arg & ~SET_MASK, KERN_WARNING "Micro-assembler field overflow\n");
 
        return arg & SET_MASK;
 }
@@ -340,6 +336,13 @@ Ip_u2u1msbu3(op)                                   \
 }                                                      \
 UASM_EXPORT_SYMBOL(uasm_i##op);
 
+#define I_u2u1msb32u3(op)                              \
+Ip_u2u1msbu3(op)                                       \
+{                                                      \
+       build_insn(buf, insn##op, b, a, c+d-33, c);     \
+}                                                      \
+UASM_EXPORT_SYMBOL(uasm_i##op);
+
 #define I_u1u2(op)                                     \
 Ip_u1u2(op)                                            \
 {                                                      \
@@ -422,9 +425,12 @@ I_0(_tlbwr)
 I_u3u1u2(_xor)
 I_u2u1u3(_xori)
 I_u2u1msbu3(_dins);
+I_u2u1msb32u3(_dinsm);
 I_u1(_syscall);
 I_u1u2s3(_bbit0);
 I_u1u2s3(_bbit1);
+I_u3u1u2(_lwx)
+I_u3u1u2(_ldx)
 
 #ifdef CONFIG_CPU_CAVIUM_OCTEON
 #include <asm/octeon/octeon.h>
index 87ccdb4b5ac911a0448293bd8ee168c521fc6848..48853ab5bcf02331919b469b8d00ced02d8f06ed 100644 (file)
@@ -410,14 +410,13 @@ static int sbprof_tb_open(struct inode *inode, struct file *filp)
                return -EBUSY;
 
        memset(&sbp, 0, sizeof(struct sbprof_tb));
-       sbp.sbprof_tbbuf = vmalloc(MAX_TBSAMPLE_BYTES);
+       sbp.sbprof_tbbuf = vzalloc(MAX_TBSAMPLE_BYTES);
        if (!sbp.sbprof_tbbuf) {
                sbp.open = SB_CLOSED;
                wmb();
                return -ENOMEM;
        }
 
-       memset(sbp.sbprof_tbbuf, 0, MAX_TBSAMPLE_BYTES);
        init_waitqueue_head(&sbp.tb_sync);
        init_waitqueue_head(&sbp.tb_read);
        mutex_init(&sbp.lock);
index 96e69a00ffc84019b740b51eb9f75f795d031dba..85a87de17eb46f1197f92771a76b7812282aa4ff 100644 (file)
@@ -213,11 +213,8 @@ txx9_alloc_pci_controller(struct pci_controller *pcic,
 
        pcic->mem_offset = 0;   /* busaddr == physaddr */
 
-       printk(KERN_INFO "PCI: IO 0x%08llx-0x%08llx MEM 0x%08llx-0x%08llx\n",
-              (unsigned long long)pcic->mem_resource[1].start,
-              (unsigned long long)pcic->mem_resource[1].end,
-              (unsigned long long)pcic->mem_resource[0].start,
-              (unsigned long long)pcic->mem_resource[0].end);
+       printk(KERN_INFO "PCI: IO %pR MEM %pR\n",
+              &pcic->mem_resource[1], &pcic->mem_resource[0]);
 
        /* register_pci_controller() will request MEM resource */
        release_resource(&pcic->mem_resource[0]);
index 8ed41cf2b08d217a4c40ee3cf174d8cb6c7898bd..243bfa23fd5863c0d8198d61352b2c0a8db9812a 100644 (file)
@@ -1,6 +1,7 @@
 config MN10300
        def_bool y
        select HAVE_OPROFILE
+       select GENERIC_HARDIRQS
 
 config AM33_2
        def_bool n
@@ -34,9 +35,6 @@ config RWSEM_GENERIC_SPINLOCK
 config RWSEM_XCHGADD_ALGORITHM
        bool
 
-config GENERIC_HARDIRQS_NO__DO_IRQ
-       def_bool y
-
 config GENERIC_CALIBRATE_DELAY
        def_bool y
 
@@ -79,10 +77,6 @@ config QUICKLIST
 config ARCH_HAS_ILOG2_U32
        def_bool y
 
-# Use the generic interrupt handling code in kernel/irq/
-config GENERIC_HARDIRQS
-       def_bool y
-
 config HOTPLUG_CPU
        def_bool n
 
index 3f749b69ca71b732081ff166a35c1ec8cca43fc3..1fd41ec1dfb54396846832e9f42b904f65b97d68 100644 (file)
@@ -4,7 +4,7 @@ CONFIG_BSD_PROCESS_ACCT=y
 CONFIG_TINY_RCU=y
 CONFIG_LOG_BUF_SHIFT=14
 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
-CONFIG_EMBEDDED=y
+CONFIG_EXPERT=y
 # CONFIG_KALLSYMS is not set
 # CONFIG_HOTPLUG is not set
 # CONFIG_VM_EVENT_COUNTERS is not set
index 83ce2f27b12a972423d8ce3f8ce4bc164d60251c..31d76261a3d5b4851066ac3059391c4760a92b9e 100644 (file)
@@ -15,7 +15,7 @@ CONFIG_CGROUP_CPUACCT=y
 CONFIG_RESOURCE_COUNTERS=y
 CONFIG_RELAY=y
 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
-CONFIG_EMBEDDED=y
+CONFIG_EXPERT=y
 # CONFIG_KALLSYMS is not set
 # CONFIG_VM_EVENT_COUNTERS is not set
 CONFIG_SLAB=y
index 0888675c98dd6f344ba4740bfb5622790698c3d1..fed2946f73352489e15a5c0448bf6bdc717a00cc 100644 (file)
@@ -12,7 +12,10 @@ config PARISC
        select HAVE_IRQ_WORK
        select HAVE_PERF_EVENTS
        select GENERIC_ATOMIC64 if !64BIT
-       select GENERIC_HARDIRQS_NO__DO_IRQ
+       select HAVE_GENERIC_HARDIRQS
+       select GENERIC_IRQ_PROBE
+       select IRQ_PER_CPU
+
        help
          The PA-RISC microprocessor is designed by Hewlett-Packard and used
          in many of their workstations & servers (HP9000 700 and 800 series,
@@ -66,22 +69,9 @@ config TIME_LOW_RES
        depends on SMP
        default y
 
-config GENERIC_HARDIRQS
-       def_bool y
-
-config GENERIC_IRQ_PROBE
-       def_bool y
-
 config HAVE_LATENCYTOP_SUPPORT
         def_bool y
 
-config IRQ_PER_CPU
-       bool
-       default y
-
-config GENERIC_HARDIRQS_NO__DO_IRQ
-       def_bool y
-
 # unless you want to implement ACPI on PA-RISC ... ;-)
 config PM
        bool
index f9305f30603abf8b56be9b8960aa263e5f2c7401..b647b182dacc17d6cf95fa79cee892fd8e0427bf 100644 (file)
@@ -8,7 +8,7 @@ CONFIG_LOG_BUF_SHIFT=16
 CONFIG_SYSFS_DEPRECATED_V2=y
 CONFIG_BLK_DEV_INITRD=y
 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
-CONFIG_EMBEDDED=y
+CONFIG_EXPERT=y
 CONFIG_KALLSYMS_ALL=y
 CONFIG_SLAB=y
 CONFIG_PROFILING=y
index 628d3e02253581b3b61e67e8e1e15e501f83a420..311ca367b62237b87bb78023f7687ef1f7d98c85 100644 (file)
@@ -6,7 +6,7 @@ CONFIG_IKCONFIG_PROC=y
 CONFIG_LOG_BUF_SHIFT=16
 CONFIG_SYSFS_DEPRECATED_V2=y
 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
-CONFIG_EMBEDDED=y
+CONFIG_EXPERT=y
 CONFIG_KALLSYMS_ALL=y
 CONFIG_SLAB=y
 CONFIG_PROFILING=y
index df971fa0c32f1fcbf411437a8e61ce07be5e57af..4896ed0905853ddf809d1db3f2d7bf9d581eb53f 100644 (file)
@@ -1126,15 +1126,13 @@ int pdc_iodc_print(const unsigned char *str, unsigned count)
        unsigned int i;
        unsigned long flags;
 
-       for (i = 0; i < count && i < 79;) {
+       for (i = 0; i < count;) {
                switch(str[i]) {
                case '\n':
                        iodc_dbuf[i+0] = '\r';
                        iodc_dbuf[i+1] = '\n';
                        i += 2;
                        goto print;
-               case '\b':      /* BS */
-                       i--; /* overwrite last */
                default:
                        iodc_dbuf[i] = str[i];
                        i++;
@@ -1142,15 +1140,6 @@ int pdc_iodc_print(const unsigned char *str, unsigned count)
                }
        }
 
-       /* if we're at the end of line, and not already inserting a newline,
-        * insert one anyway. iodc console doesn't claim to support >79 char
-        * lines. don't account for this in the return value.
-        */
-       if (i == 79 && iodc_dbuf[i-1] != '\n') {
-               iodc_dbuf[i+0] = '\r';
-               iodc_dbuf[i+1] = '\n';
-       }
-
 print:
         spin_lock_irqsave(&pdc_lock, flags);
         real32_call(PAGE0->mem_cons.iodc_io,
index 959f38ccb9a77fecae6656b41ed1e218df9bb0a5..7d69e9bf5e64b28d1129c731f39489e5758b5450 100644 (file)
@@ -36,24 +36,12 @@ config GENERIC_TIME_VSYSCALL
 config GENERIC_CLOCKEVENTS
        def_bool y
 
-config GENERIC_HARDIRQS
-       bool
-       default y
-
-config GENERIC_HARDIRQS_NO__DO_IRQ
-       bool
-       default y
-
 config HAVE_SETUP_PER_CPU_AREA
        def_bool PPC64
 
 config NEED_PER_CPU_EMBED_FIRST_CHUNK
        def_bool PPC64
 
-config IRQ_PER_CPU
-       bool
-       default y
-
 config NR_IRQS
        int "Number of virtual interrupt numbers"
        range 32 32768
@@ -143,6 +131,9 @@ config PPC
        select HAVE_PERF_EVENTS
        select HAVE_REGS_AND_STACK_ACCESS_API
        select HAVE_HW_BREAKPOINT if PERF_EVENTS && PPC_BOOK3S_64
+       select HAVE_GENERIC_HARDIRQS
+       select HAVE_SPARSE_IRQ
+       select IRQ_PER_CPU
 
 config EARLY_PRINTK
        bool
@@ -392,19 +383,6 @@ config IRQ_ALL_CPUS
          CPU.  Generally saying Y is safe, although some problems have been
          reported with SMP Power Macintoshes with this option enabled.
 
-config SPARSE_IRQ
-       bool "Support sparse irq numbering"
-       default n
-       help
-         This enables support for sparse irqs. This is useful for distro
-         kernels that want to define a high CONFIG_NR_CPUS value but still
-         want to have low kernel memory footprint on smaller machines.
-
-         ( Sparse IRQs can also be beneficial on NUMA boxes, as they spread
-           out the irq_desc[] array in a more NUMA-friendly way. )
-
-         If you don't know what to do here, say N.
-
 config NUMA
        bool "NUMA support"
        depends on PPC64
index 96deec63bcf3db53b62251cba32183f3daffbf7e..89178164af5ed19c19e6e359d86bdc5a7eadd0f2 100644 (file)
@@ -368,7 +368,7 @@ INSTALL := install
 extra-installed                := $(patsubst $(obj)/%, $(DESTDIR)$(WRAPPER_OBJDIR)/%, $(extra-y))
 hostprogs-installed    := $(patsubst %, $(DESTDIR)$(WRAPPER_BINDIR)/%, $(hostprogs-y))
 wrapper-installed      := $(DESTDIR)$(WRAPPER_BINDIR)/wrapper
-dts-installed          := $(patsubst $(obj)/dts/%, $(DESTDIR)$(WRAPPER_DTSDIR)/%, $(wildcard $(obj)/dts/*.dts))
+dts-installed          := $(patsubst $(dtstree)/%, $(DESTDIR)$(WRAPPER_DTSDIR)/%, $(wildcard $(dtstree)/*.dts))
 
 all-installed          := $(extra-installed) $(hostprogs-installed) $(wrapper-installed) $(dts-installed)
 
index d3db02f98dddf99d555aeb073d82136fbca457f8..a0bd1881081eba71d7c7326684823b7e1a41b139 100644 (file)
                #address-cells = <1>;
                #size-cells = <1>;
                device_type = "soc";
-               compatible = "fsl,mpc8315-immr", "simple-bus";
+               compatible = "fsl,mpc8308-immr", "simple-bus";
                ranges = <0 0xe0000000 0x00100000>;
                reg = <0xe0000000 0x00000200>;
                bus-frequency = <0>;
index 2bbecbb4cbf9a3388749128d751503ce41595aa7..69422eb24d971db75359f589db8e286d34df7686 100644 (file)
                        ranges = <0x0 0xc100 0x200>;
                        cell-index = <1>;
                        dma00: dma-channel@0 {
-                               compatible = "fsl,eloplus-dma-channel";
+                               compatible = "fsl,ssi-dma-channel";
                                reg = <0x0 0x80>;
                                cell-index = <0>;
                                interrupts = <76 2>;
                        };
                        dma01: dma-channel@80 {
-                               compatible = "fsl,eloplus-dma-channel";
+                               compatible = "fsl,ssi-dma-channel";
                                reg = <0x80 0x80>;
                                cell-index = <1>;
                                interrupts = <77 2>;
index 97fedceaa30bd97732d107cff0d03fc95279f11d..4182c772340bed92697e563f989aaab7f813a5d9 100644 (file)
@@ -5,7 +5,7 @@ CONFIG_POSIX_MQUEUE=y
 CONFIG_LOG_BUF_SHIFT=14
 CONFIG_BLK_DEV_INITRD=y
 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
-CONFIG_EMBEDDED=y
+CONFIG_EXPERT=y
 CONFIG_KALLSYMS_ALL=y
 CONFIG_KALLSYMS_EXTRA_PASS=y
 CONFIG_MODULES=y
index 33b3c24f4edd8c9f6e1a05c69c9db4ab5a856e26..2dbb293163f5b3299d8f778ab62cd0a8009546ed 100644 (file)
@@ -5,7 +5,7 @@ CONFIG_POSIX_MQUEUE=y
 CONFIG_LOG_BUF_SHIFT=14
 CONFIG_BLK_DEV_INITRD=y
 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
-CONFIG_EMBEDDED=y
+CONFIG_EXPERT=y
 CONFIG_KALLSYMS_ALL=y
 CONFIG_KALLSYMS_EXTRA_PASS=y
 CONFIG_MODULES=y
index 4613079a0ab1e3fdd7b83a0dbfb2058abdd5cdcb..ebeb4accad65508395d9fb3aea334919e43eb3fa 100644 (file)
@@ -5,7 +5,7 @@ CONFIG_POSIX_MQUEUE=y
 CONFIG_LOG_BUF_SHIFT=14
 CONFIG_BLK_DEV_INITRD=y
 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
-CONFIG_EMBEDDED=y
+CONFIG_EXPERT=y
 CONFIG_KALLSYMS_ALL=y
 CONFIG_KALLSYMS_EXTRA_PASS=y
 CONFIG_MODULES=y
index 34b8c1a1e7524ee1122ee1165b2b02241b1bf00c..532ea9d93a15c8c9629134e6b56f0269e6f00350 100644 (file)
@@ -5,7 +5,7 @@ CONFIG_POSIX_MQUEUE=y
 CONFIG_LOG_BUF_SHIFT=14
 CONFIG_BLK_DEV_INITRD=y
 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
-CONFIG_EMBEDDED=y
+CONFIG_EXPERT=y
 CONFIG_KALLSYMS_ALL=y
 CONFIG_KALLSYMS_EXTRA_PASS=y
 CONFIG_MODULES=y
index 651be09136fa90e9e9047ebc48a6128b6780b374..3c142ac1b344d3d9986208d3c59dce1ee971eb81 100644 (file)
@@ -5,7 +5,7 @@ CONFIG_POSIX_MQUEUE=y
 CONFIG_LOG_BUF_SHIFT=14
 CONFIG_BLK_DEV_INITRD=y
 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
-CONFIG_EMBEDDED=y
+CONFIG_EXPERT=y
 CONFIG_KALLSYMS_ALL=y
 CONFIG_KALLSYMS_EXTRA_PASS=y
 CONFIG_MODULES=y
index ded455e18339ac7348dca008f220faa78c636e3f..ff57d4828ffc3c0dfbf923f9f5e2753a3d0a44a8 100644 (file)
@@ -5,7 +5,7 @@ CONFIG_POSIX_MQUEUE=y
 CONFIG_LOG_BUF_SHIFT=14
 CONFIG_BLK_DEV_INITRD=y
 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
-CONFIG_EMBEDDED=y
+CONFIG_EXPERT=y
 CONFIG_KALLSYMS_ALL=y
 CONFIG_KALLSYMS_EXTRA_PASS=y
 CONFIG_MODULES=y
index 63746a041d6b97aa6eec9fec3312b9e83ec4b547..3ed16d5c909db4d207d793b13dfbf0718959c9a2 100644 (file)
@@ -5,7 +5,7 @@ CONFIG_POSIX_MQUEUE=y
 CONFIG_LOG_BUF_SHIFT=14
 CONFIG_BLK_DEV_INITRD=y
 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
-CONFIG_EMBEDDED=y
+CONFIG_EXPERT=y
 CONFIG_MODULES=y
 CONFIG_MODULE_UNLOAD=y
 # CONFIG_BLK_DEV_BSG is not set
index f5f2a4e3e21b18736fcb730a911cb211d03dcd15..b1b7d2c5c059fcdd40e352ad260abf1f655cb79b 100644 (file)
@@ -5,7 +5,7 @@ CONFIG_POSIX_MQUEUE=y
 CONFIG_LOG_BUF_SHIFT=14
 CONFIG_BLK_DEV_INITRD=y
 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
-CONFIG_EMBEDDED=y
+CONFIG_EXPERT=y
 CONFIG_MODULES=y
 CONFIG_MODULE_UNLOAD=y
 # CONFIG_BLK_DEV_BSG is not set
index ac65b48b8ccd2dc52e91fec7efab37e0b62b100f..30a0a8e08fdd9c2436343eca79c43c2c82c1a372 100644 (file)
@@ -4,7 +4,7 @@ CONFIG_SYSVIPC=y
 CONFIG_POSIX_MQUEUE=y
 CONFIG_LOG_BUF_SHIFT=14
 CONFIG_BLK_DEV_INITRD=y
-CONFIG_EMBEDDED=y
+CONFIG_EXPERT=y
 # CONFIG_VM_EVENT_COUNTERS is not set
 # CONFIG_PCI_QUIRKS is not set
 # CONFIG_COMPAT_BRK is not set
index 17e4dd98eed7dc03fc5ac19eed4e2b73ab587ea8..a46942aac695184448df89b0324a75676867f5cf 100644 (file)
@@ -5,7 +5,7 @@ CONFIG_POSIX_MQUEUE=y
 CONFIG_LOG_BUF_SHIFT=14
 CONFIG_BLK_DEV_INITRD=y
 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
-CONFIG_EMBEDDED=y
+CONFIG_EXPERT=y
 CONFIG_MODULES=y
 CONFIG_MODULE_UNLOAD=y
 # CONFIG_BLK_DEV_BSG is not set
index fedd03fdf5d555bd3008735f51b8da98f9f859a4..07d77e51f1ba0637529033cce1f7f258e643a7dd 100644 (file)
@@ -5,7 +5,7 @@ CONFIG_POSIX_MQUEUE=y
 CONFIG_LOG_BUF_SHIFT=14
 CONFIG_BLK_DEV_INITRD=y
 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
-CONFIG_EMBEDDED=y
+CONFIG_EXPERT=y
 CONFIG_KALLSYMS_ALL=y
 CONFIG_KALLSYMS_EXTRA_PASS=y
 CONFIG_MODULES=y
index ebff7011282ec333c9e11c54d6e7ecf04344cd54..2ce7e9aff09e916d07fc6978ce914270d6e60f7b 100644 (file)
@@ -5,7 +5,7 @@ CONFIG_POSIX_MQUEUE=y
 CONFIG_LOG_BUF_SHIFT=14
 CONFIG_BLK_DEV_INITRD=y
 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
-CONFIG_EMBEDDED=y
+CONFIG_EXPERT=y
 CONFIG_MODULES=y
 CONFIG_MODULE_UNLOAD=y
 # CONFIG_BLK_DEV_BSG is not set
index 865e93fb41fdc6e2a34473d66b6d105200beca86..18730ff9de7c887325481e40de065dfe741371de 100644 (file)
@@ -6,7 +6,7 @@ CONFIG_LOG_BUF_SHIFT=14
 CONFIG_SYSFS_DEPRECATED_V2=y
 CONFIG_BLK_DEV_INITRD=y
 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
-CONFIG_EMBEDDED=y
+CONFIG_EXPERT=y
 CONFIG_MODULES=y
 CONFIG_MODULE_UNLOAD=y
 # CONFIG_BLK_DEV_BSG is not set
index 8ece4c7744158515173830b1d13ff427d5e3961f..92f863ac8443dd53e77456961cf3a153e335a4b2 100644 (file)
@@ -7,7 +7,7 @@ CONFIG_LOG_BUF_SHIFT=14
 CONFIG_SYSFS_DEPRECATED_V2=y
 CONFIG_BLK_DEV_INITRD=y
 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
-CONFIG_EMBEDDED=y
+CONFIG_EXPERT=y
 CONFIG_KALLSYMS_ALL=y
 CONFIG_KALLSYMS_EXTRA_PASS=y
 CONFIG_PROFILING=y
index 4ca9b4873c51051e2897a5f2658df31d41261a99..34c09144a6990895e1ff7e9f4a1e9d647f6919c5 100644 (file)
@@ -5,7 +5,7 @@ CONFIG_POSIX_MQUEUE=y
 CONFIG_LOG_BUF_SHIFT=14
 CONFIG_BLK_DEV_INITRD=y
 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
-CONFIG_EMBEDDED=y
+CONFIG_EXPERT=y
 CONFIG_MODULES=y
 CONFIG_MODULE_UNLOAD=y
 # CONFIG_BLK_DEV_BSG is not set
index e3b65d24207e1a857d308076881f7b2a4684f5cb..21c33faf61a2deff1ec60aacc87f069e5f5a686f 100644 (file)
@@ -5,7 +5,7 @@ CONFIG_POSIX_MQUEUE=y
 CONFIG_LOG_BUF_SHIFT=14
 CONFIG_BLK_DEV_INITRD=y
 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
-CONFIG_EMBEDDED=y
+CONFIG_EXPERT=y
 CONFIG_MODULES=y
 CONFIG_MODULE_UNLOAD=y
 # CONFIG_BLK_DEV_BSG is not set
index 64cd0f3421a976a04abb94b1fb6745bef3f844b5..01cc2b1a7f9a2563c6c9409d508c70a973384ff7 100644 (file)
@@ -5,7 +5,7 @@ CONFIG_POSIX_MQUEUE=y
 CONFIG_LOG_BUF_SHIFT=14
 CONFIG_BLK_DEV_INITRD=y
 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
-CONFIG_EMBEDDED=y
+CONFIG_EXPERT=y
 CONFIG_MODULES=y
 CONFIG_MODULE_UNLOAD=y
 # CONFIG_BLK_DEV_BSG is not set
index 01d03367917efd72743b624a0f5daebde6aecb1b..dfcffede16adcf56d2f4900757b582c2cceed446 100644 (file)
@@ -6,7 +6,7 @@ CONFIG_IKCONFIG=y
 CONFIG_LOG_BUF_SHIFT=14
 CONFIG_BLK_DEV_INITRD=y
 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
-CONFIG_EMBEDDED=y
+CONFIG_EXPERT=y
 CONFIG_MODULES=y
 CONFIG_MODULE_UNLOAD=y
 # CONFIG_BLK_DEV_BSG is not set
index 89b2f962613700d81d874ffb5a6a09937e542157..47e399f2892ff4ebbec659430cd355585d949691 100644 (file)
@@ -5,7 +5,7 @@ CONFIG_POSIX_MQUEUE=y
 CONFIG_LOG_BUF_SHIFT=14
 CONFIG_BLK_DEV_INITRD=y
 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
-CONFIG_EMBEDDED=y
+CONFIG_EXPERT=y
 CONFIG_MODULES=y
 CONFIG_MODULE_UNLOAD=y
 # CONFIG_BLK_DEV_BSG is not set
index e3386cf6f5b70002c2ade5d898ea644c231d68a8..a6a002ed5681065a88e01819bea3d32d4c1f9081 100644 (file)
@@ -5,7 +5,7 @@ CONFIG_POSIX_MQUEUE=y
 CONFIG_LOG_BUF_SHIFT=14
 CONFIG_BLK_DEV_INITRD=y
 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
-CONFIG_EMBEDDED=y
+CONFIG_EXPERT=y
 CONFIG_MODULES=y
 CONFIG_MODULE_UNLOAD=y
 # CONFIG_BLK_DEV_BSG is not set
index 9c13b9dffafa9fc916a0881b8d93e60ecf888315..6cf9d6614805bb9e53744e1c88653333a212fab1 100644 (file)
@@ -8,7 +8,7 @@ CONFIG_IKCONFIG_PROC=y
 CONFIG_LOG_BUF_SHIFT=14
 CONFIG_BLK_DEV_INITRD=y
 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
-CONFIG_EMBEDDED=y
+CONFIG_EXPERT=y
 CONFIG_MODULES=y
 CONFIG_MODULE_UNLOAD=y
 # CONFIG_BLK_DEV_BSG is not set
index f234c4d0b15ca7f35609142c63c2e274cabadd74..69b57daf402e056d0739e4ec50303f8349b78c0d 100644 (file)
@@ -3,7 +3,7 @@ CONFIG_SYSVIPC=y
 CONFIG_LOG_BUF_SHIFT=14
 CONFIG_BLK_DEV_INITRD=y
 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
-CONFIG_EMBEDDED=y
+CONFIG_EXPERT=y
 # CONFIG_SYSCTL_SYSCALL is not set
 # CONFIG_KALLSYMS is not set
 # CONFIG_EPOLL is not set
index a4a795c807402ba799db74e74e95d8ed70847a9d..f3638ae0a627ceb6c481dae4bbc588616864548c 100644 (file)
@@ -3,7 +3,7 @@ CONFIG_SYSVIPC=y
 CONFIG_LOG_BUF_SHIFT=14
 CONFIG_BLK_DEV_INITRD=y
 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
-CONFIG_EMBEDDED=y
+CONFIG_EXPERT=y
 # CONFIG_SYSCTL_SYSCALL is not set
 # CONFIG_KALLSYMS is not set
 # CONFIG_EPOLL is not set
index 20d53a1aa7e48a24b805606fa3034954e692f3e6..6828eda02bdcfe58ff1183e655f6b1cd281b762c 100644 (file)
@@ -3,7 +3,7 @@ CONFIG_SYSVIPC=y
 CONFIG_LOG_BUF_SHIFT=14
 CONFIG_BLK_DEV_INITRD=y
 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
-CONFIG_EMBEDDED=y
+CONFIG_EXPERT=y
 # CONFIG_SYSCTL_SYSCALL is not set
 # CONFIG_KALLSYMS is not set
 # CONFIG_EPOLL is not set
index 6bd58338bf1a750b90331541bdc82a998f721016..7f7e4a8786029897df66ca0e49c64b2c6aa5065d 100644 (file)
@@ -8,7 +8,7 @@ CONFIG_IKCONFIG=y
 CONFIG_IKCONFIG_PROC=y
 CONFIG_LOG_BUF_SHIFT=14
 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
-CONFIG_EMBEDDED=y
+CONFIG_EXPERT=y
 # CONFIG_SYSCTL_SYSCALL is not set
 # CONFIG_VM_EVENT_COUNTERS is not set
 CONFIG_SLAB=y
index 3a1f70292d9d4b213b3ad1b95de44ec85d9d3b83..959cd2cfc2756488fcbe4080a29b396653d5e8d5 100644 (file)
@@ -3,7 +3,7 @@ CONFIG_SYSVIPC=y
 CONFIG_LOG_BUF_SHIFT=14
 CONFIG_BLK_DEV_INITRD=y
 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
-CONFIG_EMBEDDED=y
+CONFIG_EXPERT=y
 # CONFIG_SYSCTL_SYSCALL is not set
 # CONFIG_KALLSYMS is not set
 # CONFIG_EPOLL is not set
index eed42d8919e81391744b040411996697418c4b37..d2762d9dcb8e969ba84bc8d2ecae30b14c5e8bdb 100644 (file)
@@ -4,7 +4,7 @@ CONFIG_SYSVIPC=y
 CONFIG_LOG_BUF_SHIFT=14
 CONFIG_BLK_DEV_INITRD=y
 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
-CONFIG_EMBEDDED=y
+CONFIG_EXPERT=y
 # CONFIG_KALLSYMS is not set
 CONFIG_MODULES=y
 CONFIG_MODULE_UNLOAD=y
index e43ecb27dfd7a3c7a9b5bf0f4ba9e19ca2a2d580..7a7b731c57351a8564a94d88e54d06f46fc11d7b 100644 (file)
@@ -3,7 +3,7 @@ CONFIG_EXPERIMENTAL=y
 CONFIG_SYSVIPC=y
 CONFIG_POSIX_MQUEUE=y
 CONFIG_LOG_BUF_SHIFT=14
-CONFIG_EMBEDDED=y
+CONFIG_EXPERT=y
 # CONFIG_HOTPLUG is not set
 CONFIG_SLAB=y
 CONFIG_MODULES=y
index c2e6ab51d335ce20746d4945df728ccdfd9bac83..c683bce4c26e9dce1392a4dd1977d0dc92c065b0 100644 (file)
@@ -3,7 +3,7 @@ CONFIG_SYSVIPC=y
 CONFIG_LOG_BUF_SHIFT=14
 CONFIG_BLK_DEV_INITRD=y
 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
-CONFIG_EMBEDDED=y
+CONFIG_EXPERT=y
 # CONFIG_KALLSYMS is not set
 CONFIG_MODULES=y
 CONFIG_MODULE_UNLOAD=y
index 1d3b200659136f320b4731c40c0e317b3c2fbb24..a721cd3d793f2292fc54075c7382467b93013bcb 100644 (file)
@@ -3,7 +3,7 @@ CONFIG_SYSVIPC=y
 CONFIG_LOG_BUF_SHIFT=14
 CONFIG_BLK_DEV_INITRD=y
 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
-CONFIG_EMBEDDED=y
+CONFIG_EXPERT=y
 # CONFIG_KALLSYMS is not set
 CONFIG_MODULES=y
 CONFIG_MODULE_UNLOAD=y
index 91fe73bd5ad27bea44efafd98da9e430f61b161e..a5699a1f7d0a735764a714c22a47ec219f6b01f1 100644 (file)
@@ -3,7 +3,7 @@ CONFIG_SYSVIPC=y
 CONFIG_LOG_BUF_SHIFT=14
 CONFIG_BLK_DEV_INITRD=y
 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
-CONFIG_EMBEDDED=y
+CONFIG_EXPERT=y
 # CONFIG_KALLSYMS is not set
 CONFIG_MODULES=y
 CONFIG_MODULE_UNLOAD=y
index 6d300f2056042149ae4caeede2886115d10c3e66..b4da1a7e6449d2f51b052cbfce69ff60a3977766 100644 (file)
@@ -3,7 +3,7 @@ CONFIG_SYSVIPC=y
 CONFIG_LOG_BUF_SHIFT=14
 CONFIG_BLK_DEV_INITRD=y
 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
-CONFIG_EMBEDDED=y
+CONFIG_EXPERT=y
 # CONFIG_KALLSYMS is not set
 CONFIG_MODULES=y
 CONFIG_MODULE_UNLOAD=y
index b236a67e01fe1d161b07112284566ad93dd7d798..291f8221d5a6e07ec0368ef55945b4f64cab8ffc 100644 (file)
@@ -3,7 +3,7 @@ CONFIG_SYSVIPC=y
 CONFIG_LOG_BUF_SHIFT=14
 CONFIG_BLK_DEV_INITRD=y
 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
-CONFIG_EMBEDDED=y
+CONFIG_EXPERT=y
 # CONFIG_KALLSYMS is not set
 CONFIG_MODULES=y
 CONFIG_MODULE_UNLOAD=y
index 001dead3cde97b9f5504c8a2f5ba9122a36ff1f6..f8b228aaa03a2726f811b2f60e14e8456a04288e 100644 (file)
@@ -3,7 +3,7 @@ CONFIG_SYSVIPC=y
 CONFIG_LOG_BUF_SHIFT=14
 CONFIG_BLK_DEV_INITRD=y
 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
-CONFIG_EMBEDDED=y
+CONFIG_EXPERT=y
 # CONFIG_KALLSYMS is not set
 CONFIG_MODULES=y
 CONFIG_MODULE_UNLOAD=y
index 9dccefca00c362d4efb257dfb1cc2a48eec839be..99660c06219182bc67d6392574a0f76b26b9bf2d 100644 (file)
@@ -3,7 +3,7 @@ CONFIG_SYSVIPC=y
 CONFIG_LOG_BUF_SHIFT=14
 CONFIG_BLK_DEV_INITRD=y
 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
-CONFIG_EMBEDDED=y
+CONFIG_EXPERT=y
 # CONFIG_KALLSYMS is not set
 CONFIG_MODULES=y
 CONFIG_MODULE_UNLOAD=y
index d4b165d7d294e1442f105d6593e5ac31d9958268..10b5c4cd0e72bb393148a8d6e63aa800dc7a823d 100644 (file)
@@ -3,7 +3,7 @@ CONFIG_SYSVIPC=y
 CONFIG_LOG_BUF_SHIFT=14
 CONFIG_BLK_DEV_INITRD=y
 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
-CONFIG_EMBEDDED=y
+CONFIG_EXPERT=y
 # CONFIG_KALLSYMS is not set
 CONFIG_MODULES=y
 CONFIG_MODULE_UNLOAD=y
index 89ba67274bda88e6903a7b87051052de9ee3eaee..45925d701d2a10556692fa67cc7b9e6f80394ec4 100644 (file)
@@ -3,7 +3,7 @@ CONFIG_SYSVIPC=y
 CONFIG_LOG_BUF_SHIFT=14
 CONFIG_BLK_DEV_INITRD=y
 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
-CONFIG_EMBEDDED=y
+CONFIG_EXPERT=y
 # CONFIG_KALLSYMS is not set
 CONFIG_MODULES=y
 CONFIG_MODULE_UNLOAD=y
index 2ea6b405046a33668dbed34e2dcbdbbfeb73e057..f367985be6f77094a1e21538350d29def0ee3488 100644 (file)
@@ -3,7 +3,7 @@ CONFIG_SYSVIPC=y
 CONFIG_LOG_BUF_SHIFT=14
 CONFIG_BLK_DEV_INITRD=y
 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
-CONFIG_EMBEDDED=y
+CONFIG_EXPERT=y
 CONFIG_SLAB=y
 CONFIG_MODULES=y
 CONFIG_MODULE_UNLOAD=y
index bffe3c775030bde06859cf53036acd7d0ed74a16..414eda381591dd0245c9df60845be0d7596c8125 100644 (file)
@@ -3,7 +3,7 @@ CONFIG_SYSVIPC=y
 CONFIG_LOG_BUF_SHIFT=14
 CONFIG_BLK_DEV_INITRD=y
 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
-CONFIG_EMBEDDED=y
+CONFIG_EXPERT=y
 CONFIG_SLAB=y
 CONFIG_MODULES=y
 CONFIG_MODULE_UNLOAD=y
index fa5c9eefc9ad9f8179719d12953efc3c03d841e5..6d6463fe06fc25dc7ac17d3fac7d5d19e9ef28fa 100644 (file)
@@ -3,7 +3,7 @@ CONFIG_SYSVIPC=y
 CONFIG_LOG_BUF_SHIFT=14
 CONFIG_BLK_DEV_INITRD=y
 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
-CONFIG_EMBEDDED=y
+CONFIG_EXPERT=y
 # CONFIG_KALLSYMS is not set
 CONFIG_SLAB=y
 CONFIG_MODULES=y
index 385b1af37d75a839a2730af4f14942ad7de1ec74..8f7c1061891ad6b0819659ea204573faa8fbcbb4 100644 (file)
@@ -4,7 +4,7 @@ CONFIG_SYSVIPC=y
 CONFIG_LOG_BUF_SHIFT=14
 CONFIG_BLK_DEV_INITRD=y
 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
-CONFIG_EMBEDDED=y
+CONFIG_EXPERT=y
 # CONFIG_BLK_DEV_BSG is not set
 CONFIG_KSI8560=y
 CONFIG_CPM2=y
index 222b704c1f4b86fbca398ee4a20e0402bd541a79..55e0725500dc77e050502150bc0bd45e5fc01e42 100644 (file)
@@ -4,7 +4,7 @@ CONFIG_SYSVIPC=y
 CONFIG_LOG_BUF_SHIFT=14
 CONFIG_BLK_DEV_INITRD=y
 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
-CONFIG_EMBEDDED=y
+CONFIG_EXPERT=y
 # CONFIG_BLK_DEV_BSG is not set
 CONFIG_MPC8540_ADS=y
 CONFIG_NO_HZ=y
index 619702de9477b9ab73d755e2fbffa1fc570591f7..d724095530a6a7062c143194fbab45b2f94b563c 100644 (file)
@@ -4,7 +4,7 @@ CONFIG_SYSVIPC=y
 CONFIG_LOG_BUF_SHIFT=14
 CONFIG_BLK_DEV_INITRD=y
 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
-CONFIG_EMBEDDED=y
+CONFIG_EXPERT=y
 # CONFIG_BLK_DEV_BSG is not set
 CONFIG_MPC8560_ADS=y
 CONFIG_BINFMT_MISC=y
index 6bf56e83f957b17c2fc1846efa56b6c512bd235b..4b44beaa21ae22f019a7b8f0cb00f017b83f398d 100644 (file)
@@ -4,7 +4,7 @@ CONFIG_SYSVIPC=y
 CONFIG_LOG_BUF_SHIFT=14
 CONFIG_BLK_DEV_INITRD=y
 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
-CONFIG_EMBEDDED=y
+CONFIG_EXPERT=y
 # CONFIG_BLK_DEV_BSG is not set
 CONFIG_MPC85xx_CDS=y
 CONFIG_NO_HZ=y
index a9a17d055766362fee26ef597094c897bc589d80..5b2b651dfb9853d3a77ef215294acb7a4f714717 100644 (file)
@@ -4,7 +4,7 @@ CONFIG_SYSVIPC=y
 CONFIG_LOG_BUF_SHIFT=14
 CONFIG_BLK_DEV_INITRD=y
 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
-CONFIG_EMBEDDED=y
+CONFIG_EXPERT=y
 CONFIG_SLAB=y
 # CONFIG_BLK_DEV_BSG is not set
 CONFIG_SBC8548=y
index 820e32d8c42b4baa6489aec55987f977c6bf4cdf..f7fdb0318e4c108ad783534abd438c29bfb49053 100644 (file)
@@ -4,7 +4,7 @@ CONFIG_SYSVIPC=y
 CONFIG_LOG_BUF_SHIFT=14
 CONFIG_BLK_DEV_INITRD=y
 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
-CONFIG_EMBEDDED=y
+CONFIG_EXPERT=y
 CONFIG_SLAB=y
 # CONFIG_BLK_DEV_BSG is not set
 CONFIG_SBC8560=y
index b6db3f47af995d6393c4cb04ce2fd0750099f96c..77506b5d5a41db7408b311099f10c54c51478547 100644 (file)
@@ -4,7 +4,7 @@ CONFIG_SYSVIPC=y
 CONFIG_LOG_BUF_SHIFT=16
 CONFIG_BLK_DEV_INITRD=y
 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
-CONFIG_EMBEDDED=y
+CONFIG_EXPERT=y
 # CONFIG_KALLSYMS is not set
 # CONFIG_HOTPLUG is not set
 # CONFIG_EPOLL is not set
index 333a41bd2a6859415d93c582512814acb803f9aa..5d4db154bf597f5598701f79b725264eee9ad2c9 100644 (file)
@@ -4,7 +4,7 @@ CONFIG_SYSVIPC=y
 CONFIG_LOG_BUF_SHIFT=14
 CONFIG_BLK_DEV_INITRD=y
 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
-CONFIG_EMBEDDED=y
+CONFIG_EXPERT=y
 CONFIG_MODULES=y
 CONFIG_MODVERSIONS=y
 # CONFIG_BLK_DEV_BSG is not set
index 33db352f847e19d4fc95e990bed2b77dafadde14..ddcb9f37fa1ff771dcb1f51c52dc54f89706721e 100644 (file)
@@ -4,7 +4,7 @@ CONFIG_SYSVIPC=y
 CONFIG_LOG_BUF_SHIFT=14
 CONFIG_BLK_DEV_INITRD=y
 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
-CONFIG_EMBEDDED=y
+CONFIG_EXPERT=y
 # CONFIG_KALLSYMS is not set
 # CONFIG_HOTPLUG is not set
 # CONFIG_EPOLL is not set
index f0c20dfbd4d3eeb6aec2e1ae43b1e4e05aab5be8..981abd6d4b57b31d13b31d5a0ecbaecdb18681a5 100644 (file)
@@ -4,7 +4,7 @@ CONFIG_SYSVIPC=y
 CONFIG_LOG_BUF_SHIFT=14
 CONFIG_BLK_DEV_INITRD=y
 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
-CONFIG_EMBEDDED=y
+CONFIG_EXPERT=y
 # CONFIG_KALLSYMS is not set
 # CONFIG_HOTPLUG is not set
 # CONFIG_EPOLL is not set
index a883450dcdfa501a0317589ec4b1e5dc1cb6ff81..37b3d7227cddfc635d92d53e2204141e14ef3b37 100644 (file)
@@ -4,7 +4,7 @@ CONFIG_SYSVIPC=y
 CONFIG_LOG_BUF_SHIFT=14
 CONFIG_BLK_DEV_INITRD=y
 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
-CONFIG_EMBEDDED=y
+CONFIG_EXPERT=y
 CONFIG_MODULES=y
 CONFIG_MODULE_UNLOAD=y
 # CONFIG_BLK_DEV_BSG is not set
index ff95f90dc1714ca13cc3f59413b0ae0a5940cb93..3593b320c97c62962c17bb2400bec13a7084eb6d 100644 (file)
@@ -4,7 +4,7 @@ CONFIG_SYSVIPC=y
 CONFIG_LOG_BUF_SHIFT=14
 CONFIG_BLK_DEV_INITRD=y
 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
-CONFIG_EMBEDDED=y
+CONFIG_EXPERT=y
 # CONFIG_KALLSYMS is not set
 # CONFIG_HOTPLUG is not set
 # CONFIG_EPOLL is not set
index 8d6c90ea4783b6ebb4cd5f660e38c68b7c13a87e..de413acc34d6d09d54071812cada37aa4fb3f488 100644 (file)
@@ -4,7 +4,7 @@ CONFIG_SYSVIPC=y
 CONFIG_LOG_BUF_SHIFT=14
 CONFIG_BLK_DEV_INITRD=y
 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
-CONFIG_EMBEDDED=y
+CONFIG_EXPERT=y
 # CONFIG_KALLSYMS is not set
 # CONFIG_HOTPLUG is not set
 # CONFIG_EPOLL is not set
index f53efe4a0e0cf40bb3c628f165782ea58ff0bbe3..5ea3124518fddd030460299c5a4e9319aead3652 100644 (file)
@@ -11,7 +11,7 @@ CONFIG_IKCONFIG_PROC=y
 CONFIG_LOG_BUF_SHIFT=14
 CONFIG_BLK_DEV_INITRD=y
 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
-CONFIG_EMBEDDED=y
+CONFIG_EXPERT=y
 CONFIG_KALLSYMS_ALL=y
 CONFIG_KALLSYMS_EXTRA_PASS=y
 CONFIG_MODULES=y
index 432ebc28d25c2e7a94ea8cfaf263955e35bc8632..4b2441244eab820cc7ce36cf347b7cb07b40e41f 100644 (file)
@@ -11,7 +11,7 @@ CONFIG_LOG_BUF_SHIFT=14
 CONFIG_RELAY=y
 CONFIG_BLK_DEV_INITRD=y
 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
-CONFIG_EMBEDDED=y
+CONFIG_EXPERT=y
 CONFIG_SLAB=y
 CONFIG_MODULES=y
 CONFIG_MODULE_UNLOAD=y
index ce5e919d9b556b989af235b3e78d32e8cd4005eb..a360ba44b928cdf67dd3b79d1f1ac2803cc5df24 100644 (file)
@@ -11,7 +11,7 @@ CONFIG_LOG_BUF_SHIFT=14
 CONFIG_RELAY=y
 CONFIG_BLK_DEV_INITRD=y
 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
-CONFIG_EMBEDDED=y
+CONFIG_EXPERT=y
 CONFIG_SLAB=y
 CONFIG_MODULES=y
 CONFIG_MODULE_UNLOAD=y
index 589e71e6dc1c54a38b374950a223a03f1413c2b6..be2829dd129f3281cab1be41b3496f672131a687 100644 (file)
@@ -11,7 +11,7 @@ CONFIG_LOG_BUF_SHIFT=14
 CONFIG_RELAY=y
 CONFIG_BLK_DEV_INITRD=y
 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
-CONFIG_EMBEDDED=y
+CONFIG_EXPERT=y
 CONFIG_SLAB=y
 CONFIG_MODULES=y
 CONFIG_MODULE_UNLOAD=y
index 321fb47096d976a166c1cae4d01d13bd8e507cb1..036bfb2d18cd100237b9cf2bc6c209ca0eba29c9 100644 (file)
@@ -6,7 +6,7 @@ CONFIG_IKCONFIG_PROC=y
 CONFIG_LOG_BUF_SHIFT=14
 CONFIG_BLK_DEV_INITRD=y
 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
-CONFIG_EMBEDDED=y
+CONFIG_EXPERT=y
 CONFIG_KALLSYMS_EXTRA_PASS=y
 # CONFIG_ELF_CORE is not set
 CONFIG_MODULES=y
index b5e46399374eaf9d8238f9f62248b24035bb70fe..0c9c7ed7ec75ffba58f13b8dc1f278ae80a046ec 100644 (file)
@@ -10,7 +10,7 @@ CONFIG_IKCONFIG_PROC=y
 CONFIG_LOG_BUF_SHIFT=14
 CONFIG_BLK_DEV_INITRD=y
 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
-CONFIG_EMBEDDED=y
+CONFIG_EXPERT=y
 CONFIG_KALLSYMS_ALL=y
 CONFIG_KALLSYMS_EXTRA_PASS=y
 CONFIG_MODULES=y
index 71145c3a64db6150b4cc39cacaa55eff34c444aa..0a92ca045641ff3f5553c3773b4d695dfa4f54d2 100644 (file)
@@ -11,7 +11,7 @@ CONFIG_LOG_BUF_SHIFT=14
 CONFIG_RELAY=y
 CONFIG_BLK_DEV_INITRD=y
 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
-CONFIG_EMBEDDED=y
+CONFIG_EXPERT=y
 CONFIG_SLAB=y
 CONFIG_MODULES=y
 CONFIG_MODULE_UNLOAD=y
index ca84c7fc24d54fc1febd78811d47d384ec7cebe8..69128740c14dcd2c693e2d5d71d713016d15da10 100644 (file)
@@ -4,7 +4,7 @@ CONFIG_EXPERIMENTAL=y
 CONFIG_SYSVIPC=y
 CONFIG_LOG_BUF_SHIFT=14
 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
-CONFIG_EMBEDDED=y
+CONFIG_EXPERT=y
 # CONFIG_SYSCTL_SYSCALL is not set
 # CONFIG_ELF_CORE is not set
 # CONFIG_BASE_FULL is not set
index 94d120ef99cfcf8fdcd34568814e55df7659d385..06f95492afc77d316bf13e631a4a063f372df939 100644 (file)
@@ -12,7 +12,7 @@ CONFIG_LOG_BUF_SHIFT=14
 CONFIG_SYSFS_DEPRECATED_V2=y
 CONFIG_BLK_DEV_INITRD=y
 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
-CONFIG_EMBEDDED=y
+CONFIG_EXPERT=y
 CONFIG_KALLSYMS_ALL=y
 CONFIG_KALLSYMS_EXTRA_PASS=y
 CONFIG_MODULES=y
index 2677b08199e76b3abc6dc5a64fd3f47d66110406..fceffb3cffbee43992d54fd454c1fd50691e3600 100644 (file)
@@ -2,7 +2,7 @@ CONFIG_SYSVIPC=y
 CONFIG_IKCONFIG=y
 CONFIG_IKCONFIG_PROC=y
 CONFIG_LOG_BUF_SHIFT=14
-CONFIG_EMBEDDED=y
+CONFIG_EXPERT=y
 CONFIG_KALLSYMS_ALL=y
 CONFIG_SLAB=y
 # CONFIG_IOSCHED_CFQ is not set
index f9a3112e544210d68d1642fdc10da3f18f64ec82..219fd470ed22d402deae87a12ea3ca6333d29384 100644 (file)
@@ -4,7 +4,7 @@ CONFIG_EXPERIMENTAL=y
 CONFIG_SYSVIPC=y
 CONFIG_LOG_BUF_SHIFT=14
 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
-CONFIG_EMBEDDED=y
+CONFIG_EXPERT=y
 # CONFIG_SYSCTL_SYSCALL is not set
 # CONFIG_ELF_CORE is not set
 # CONFIG_BASE_FULL is not set
index fcf0a398cd669b71282d74bcc344334f703dde31..e74d3a48370570c4dcc15351ab335ee9b7220e45 100644 (file)
@@ -6,7 +6,7 @@ CONFIG_IKCONFIG_PROC=y
 CONFIG_LOG_BUF_SHIFT=14
 CONFIG_BLK_DEV_INITRD=y
 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
-CONFIG_EMBEDDED=y
+CONFIG_EXPERT=y
 # CONFIG_ELF_CORE is not set
 CONFIG_PERF_COUNTERS=y
 # CONFIG_VM_EVENT_COUNTERS is not set
index b9b63a609525fef6f35b57228bdd591292ad0c6d..94ebfee188db272b67f7601c1af976323cb4ef54 100644 (file)
@@ -3,7 +3,7 @@ CONFIG_SYSVIPC=y
 CONFIG_LOG_BUF_SHIFT=14
 CONFIG_BLK_DEV_INITRD=y
 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
-CONFIG_EMBEDDED=y
+CONFIG_EXPERT=y
 CONFIG_MODULES=y
 # CONFIG_BLK_DEV_BSG is not set
 # CONFIG_PPC_CHRP is not set
index c4ed255af18b78f114e68fd8bec07255f7f40379..39518e91822f4fb2ac32bdbd753823330df1e898 100644 (file)
@@ -3,7 +3,7 @@ CONFIG_IKCONFIG=y
 CONFIG_IKCONFIG_PROC=y
 CONFIG_LOG_BUF_SHIFT=14
 CONFIG_BLK_DEV_INITRD=y
-CONFIG_EMBEDDED=y
+CONFIG_EXPERT=y
 CONFIG_KALLSYMS_ALL=y
 CONFIG_SLAB=y
 # CONFIG_IOSCHED_CFQ is not set
index f276c7cf555bb04a8aecced932f5db28b8d088af..2a490626015c550c9730f216fff4d09264bc40ba 100644 (file)
@@ -4,7 +4,7 @@ CONFIG_EXPERIMENTAL=y
 CONFIG_SYSVIPC=y
 CONFIG_BLK_DEV_INITRD=y
 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
-CONFIG_EMBEDDED=y
+CONFIG_EXPERT=y
 # CONFIG_SYSCTL_SYSCALL is not set
 # CONFIG_HOTPLUG is not set
 # CONFIG_BUG is not set
index 3b9470883de552fc5023822ccd7e66e7843e45db..75f0bbf0f6e86f14b9aa9fc47160599dbbbd39c5 100644 (file)
@@ -4,7 +4,7 @@ CONFIG_SYSVIPC=y
 CONFIG_LOG_BUF_SHIFT=14
 CONFIG_BLK_DEV_INITRD=y
 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
-CONFIG_EMBEDDED=y
+CONFIG_EXPERT=y
 # CONFIG_BLK_DEV_BSG is not set
 # CONFIG_PPC_CHRP is not set
 # CONFIG_PPC_PMAC is not set
index c7d68ff1a7366cf16108ccfec0ba7e12dbe8042a..6a22400f73c199385fd5e980e8137388be061bb7 100644 (file)
@@ -2,7 +2,7 @@ CONFIG_SYSVIPC=y
 CONFIG_IKCONFIG=y
 CONFIG_IKCONFIG_PROC=y
 CONFIG_LOG_BUF_SHIFT=14
-CONFIG_EMBEDDED=y
+CONFIG_EXPERT=y
 CONFIG_KALLSYMS_ALL=y
 # CONFIG_PPC_CHRP is not set
 # CONFIG_PPC_PMAC is not set
index 5b1b10fd9740f7021aa261b2fdf874a3f8245384..5aac9a8bc53b2294dfbcb64df800d6aea078fdec 100644 (file)
@@ -3,7 +3,7 @@ CONFIG_SYSVIPC=y
 CONFIG_LOG_BUF_SHIFT=14
 CONFIG_BLK_DEV_INITRD=y
 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
-CONFIG_EMBEDDED=y
+CONFIG_EXPERT=y
 CONFIG_SLAB=y
 CONFIG_MODULES=y
 CONFIG_MODULE_UNLOAD=y
index 3aeb5949cfef6da423f675b4a2bb9249fd0e6bb4..99a19d1e9bf8418a671e81d71295eaae8d15ac81 100644 (file)
@@ -10,7 +10,7 @@ CONFIG_IKCONFIG_PROC=y
 CONFIG_LOG_BUF_SHIFT=14
 CONFIG_BLK_DEV_INITRD=y
 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
-CONFIG_EMBEDDED=y
+CONFIG_EXPERT=y
 CONFIG_KALLSYMS_ALL=y
 CONFIG_KALLSYMS_EXTRA_PASS=y
 CONFIG_MODULES=y
index d62c8016f4bcaf7cd603856a917dac4382a64901..c636f23f8c92194bcb0e79846ba8912f7598ad03 100644 (file)
@@ -12,7 +12,7 @@ CONFIG_IKCONFIG_PROC=y
 CONFIG_LOG_BUF_SHIFT=14
 CONFIG_BLK_DEV_INITRD=y
 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
-CONFIG_EMBEDDED=y
+CONFIG_EXPERT=y
 CONFIG_KALLSYMS_ALL=y
 CONFIG_KALLSYMS_EXTRA_PASS=y
 CONFIG_MODULES=y
index 668215cae8906586fc80523cd74ef0c8d468f7d7..5c258823e694814a0c7c3e07b0391b919aa29fd9 100644 (file)
@@ -4,7 +4,7 @@ CONFIG_EXPERIMENTAL=y
 CONFIG_SYSVIPC=y
 CONFIG_LOG_BUF_SHIFT=14
 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
-CONFIG_EMBEDDED=y
+CONFIG_EXPERT=y
 # CONFIG_SYSCTL_SYSCALL is not set
 # CONFIG_HOTPLUG is not set
 # CONFIG_BUG is not set
index 63b90d477889fd042922f4fc2ca0ad7cd46f8fa6..55b54318fef68f6785c447cb1f2c0db4b714d14d 100644 (file)
@@ -10,7 +10,7 @@ CONFIG_IKCONFIG_PROC=y
 CONFIG_LOG_BUF_SHIFT=14
 CONFIG_BLK_DEV_INITRD=y
 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
-CONFIG_EMBEDDED=y
+CONFIG_EXPERT=y
 CONFIG_KALLSYMS_ALL=y
 CONFIG_KALLSYMS_EXTRA_PASS=y
 CONFIG_MODULES=y
index f9b83481b00e8780f0161f9da80554b154ed0458..9e146cdf63ded05591f572fa3b98d1b8400fafa0 100644 (file)
@@ -4,7 +4,7 @@ CONFIG_EXPERIMENTAL=y
 CONFIG_SYSVIPC=y
 CONFIG_LOG_BUF_SHIFT=14
 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
-CONFIG_EMBEDDED=y
+CONFIG_EXPERT=y
 # CONFIG_SYSCTL_SYSCALL is not set
 # CONFIG_ELF_CORE is not set
 # CONFIG_BASE_FULL is not set
index 93d7425ce6cd2e819f7f148227f3d15adb602b35..bfd634b5ada798b88e4bbacf4fe4af9ad75c4444 100644 (file)
@@ -5,7 +5,7 @@ CONFIG_POSIX_MQUEUE=y
 CONFIG_LOG_BUF_SHIFT=14
 CONFIG_BLK_DEV_INITRD=y
 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
-CONFIG_EMBEDDED=y
+CONFIG_EXPERT=y
 CONFIG_KALLSYMS_ALL=y
 CONFIG_KALLSYMS_EXTRA_PASS=y
 CONFIG_MODULES=y
index 2fa05f7be4cb9977f273eee5979a24c366353eae..47133202a6253fb806728d88367432efbe12e954 100644 (file)
@@ -5,7 +5,7 @@ CONFIG_POSIX_MQUEUE=y
 CONFIG_LOG_BUF_SHIFT=14
 CONFIG_BLK_DEV_INITRD=y
 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
-CONFIG_EMBEDDED=y
+CONFIG_EXPERT=y
 CONFIG_KALLSYMS_ALL=y
 CONFIG_KALLSYMS_EXTRA_PASS=y
 CONFIG_MODULES=y
index a4353bef31c53aaac7b2e3c993cb1eebf126a291..baad8db21b61329c11755cb5b8815e8e99042471 100644 (file)
@@ -3,7 +3,7 @@ CONFIG_IKCONFIG=y
 CONFIG_IKCONFIG_PROC=y
 CONFIG_LOG_BUF_SHIFT=14
 CONFIG_BLK_DEV_INITRD=y
-CONFIG_EMBEDDED=y
+CONFIG_EXPERT=y
 CONFIG_KALLSYMS_ALL=y
 # CONFIG_PPC_CHRP is not set
 # CONFIG_PPC_PMAC is not set
index 49cffe003657728a9d9ec153abe4e19700b7b302..caba919f65d84530bd611e649028757a1eb9fc61 100644 (file)
@@ -8,7 +8,7 @@ CONFIG_SYSVIPC=y
 CONFIG_POSIX_MQUEUE=y
 CONFIG_NAMESPACES=y
 CONFIG_BLK_DEV_INITRD=y
-CONFIG_EMBEDDED=y
+CONFIG_EXPERT=y
 CONFIG_KALLSYMS_EXTRA_PASS=y
 # CONFIG_PERF_EVENTS is not set
 # CONFIG_COMPAT_BRK is not set
index f87f0e15cfa725057a504446116de73781fe53d6..9c3f22c6cde14e2df4f650d130f221f9c41f4369 100644 (file)
@@ -2,7 +2,7 @@ CONFIG_PPC64=y
 CONFIG_ALTIVEC=y
 CONFIG_VSX=y
 CONFIG_SMP=y
-CONFIG_NR_CPUS=128
+CONFIG_NR_CPUS=1024
 CONFIG_EXPERIMENTAL=y
 CONFIG_SYSVIPC=y
 CONFIG_POSIX_MQUEUE=y
@@ -45,6 +45,8 @@ CONFIG_KEXEC=y
 CONFIG_IRQ_ALL_CPUS=y
 CONFIG_MEMORY_HOTPLUG=y
 CONFIG_MEMORY_HOTREMOVE=y
+CONFIG_PPC_64K_PAGES=y
+CONFIG_PPC_SUBPAGE_PROT=y
 CONFIG_SCHED_SMT=y
 CONFIG_HOTPLUG_PCI=m
 CONFIG_HOTPLUG_PCI_RPA=m
@@ -184,6 +186,7 @@ CONFIG_ACENIC_OMIT_TIGON_I=y
 CONFIG_E1000=y
 CONFIG_E1000E=y
 CONFIG_TIGON3=y
+CONFIG_BNX2=m
 CONFIG_CHELSIO_T1=m
 CONFIG_CHELSIO_T3=m
 CONFIG_EHEA=y
@@ -311,9 +314,7 @@ CONFIG_DEBUG_KERNEL=y
 # CONFIG_RCU_CPU_STALL_DETECTOR is not set
 CONFIG_LATENCYTOP=y
 CONFIG_SYSCTL_SYSCALL_CHECK=y
-CONFIG_IRQSOFF_TRACER=y
 CONFIG_SCHED_TRACER=y
-CONFIG_STACK_TRACER=y
 CONFIG_BLK_DEV_IO_TRACE=y
 CONFIG_DEBUG_STACKOVERFLOW=y
 CONFIG_DEBUG_STACK_USAGE=y
index 4f0c10a62b9d7bcd2551ad3665d2979fdc09ff4c..ebb2a66c99d3b9b79d8ee05f2230215259e2a659 100644 (file)
@@ -1,7 +1,7 @@
 CONFIG_EXPERIMENTAL=y
 CONFIG_SYSVIPC=y
 CONFIG_LOG_BUF_SHIFT=14
-CONFIG_EMBEDDED=y
+CONFIG_EXPERT=y
 # CONFIG_KALLSYMS is not set
 CONFIG_MODULES=y
 CONFIG_MODULE_UNLOAD=y
index d0a5b6763880108cb851e1fc0af3f708d8a521a0..8616fde0896f41ba81eb32b1c5261aed3892cfa6 100644 (file)
@@ -5,7 +5,7 @@ CONFIG_SYSVIPC=y
 CONFIG_LOG_BUF_SHIFT=14
 CONFIG_SYSFS_DEPRECATED_V2=y
 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
-CONFIG_EMBEDDED=y
+CONFIG_EXPERT=y
 # CONFIG_SYSCTL_SYSCALL is not set
 # CONFIG_ELF_CORE is not set
 # CONFIG_BASE_FULL is not set
index bb8ba75b7c68dd8c4a16934416624623b49b2483..175295fbf4f35b87c0649c37d1da95a9a82799d8 100644 (file)
@@ -7,7 +7,7 @@ CONFIG_IKCONFIG_PROC=y
 CONFIG_LOG_BUF_SHIFT=14
 CONFIG_BLK_DEV_INITRD=y
 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
-CONFIG_EMBEDDED=y
+CONFIG_EXPERT=y
 # CONFIG_ELF_CORE is not set
 CONFIG_PERF_COUNTERS=y
 # CONFIG_VM_EVENT_COUNTERS is not set
index 96a7d067fbb260ce03f0d03a8163a3d755d4c08a..921a8470e18a591b70c88ad6796a08ee0c6a588c 100644 (file)
@@ -37,18 +37,21 @@ label##2:                                           \
        .align 2;                                       \
 label##3:
 
-#define MAKE_FTR_SECTION_ENTRY(msk, val, label, sect)  \
-label##4:                                              \
-       .popsection;                                    \
-       .pushsection sect,"a";                          \
-       .align 3;                                       \
-label##5:                                              \
-       FTR_ENTRY_LONG msk;                             \
-       FTR_ENTRY_LONG val;                             \
-       FTR_ENTRY_OFFSET label##1b-label##5b;           \
-       FTR_ENTRY_OFFSET label##2b-label##5b;           \
-       FTR_ENTRY_OFFSET label##3b-label##5b;           \
-       FTR_ENTRY_OFFSET label##4b-label##5b;           \
+#define MAKE_FTR_SECTION_ENTRY(msk, val, label, sect)          \
+label##4:                                                      \
+       .popsection;                                            \
+       .pushsection sect,"a";                                  \
+       .align 3;                                               \
+label##5:                                                      \
+       FTR_ENTRY_LONG msk;                                     \
+       FTR_ENTRY_LONG val;                                     \
+       FTR_ENTRY_OFFSET label##1b-label##5b;                   \
+       FTR_ENTRY_OFFSET label##2b-label##5b;                   \
+       FTR_ENTRY_OFFSET label##3b-label##5b;                   \
+       FTR_ENTRY_OFFSET label##4b-label##5b;                   \
+       .ifgt (label##4b-label##3b)-(label##2b-label##1b);      \
+       .error "Feature section else case larger than body";    \
+       .endif;                                                 \
        .popsection;
 
 
index 4e10f508570ac38bb63b6f6fc6c9cc39861c9da7..0edb6842b13ddc461c55c961170a4f0a9eaac4b0 100644 (file)
@@ -467,13 +467,22 @@ struct qe_immap {
 extern struct qe_immap __iomem *qe_immr;
 extern phys_addr_t get_qe_base(void);
 
-static inline unsigned long immrbar_virt_to_phys(void *address)
+/*
+ * Returns the offset within the QE address space of the given pointer.
+ *
+ * Note that the QE does not support 36-bit physical addresses, so if
+ * get_qe_base() returns a number above 4GB, the caller will probably fail.
+ */
+static inline phys_addr_t immrbar_virt_to_phys(void *address)
 {
-       if ( ((u32)address >= (u32)qe_immr) &&
-                       ((u32)address < ((u32)qe_immr + QE_IMMAP_SIZE)) )
-               return (unsigned long)(address - (u32)qe_immr +
-                               (u32)get_qe_base());
-       return (unsigned long)virt_to_phys(address);
+       void *q = (void *)qe_immr;
+
+       /* Is it a MURAM address? */
+       if ((address >= q) && (address < (q + QE_IMMAP_SIZE)))
+               return get_qe_base() + (address - q);
+
+       /* It's an address returned by kmalloc */
+       return virt_to_phys(address);
 }
 
 #endif /* __KERNEL__ */
index b85d8ddbb6668b77aed280e750e971c9619f5df0..b0b06d85788db98d474320736cf2df638f7fa9c5 100644 (file)
 
 #else
 #ifdef CONFIG_TRACE_IRQFLAGS
+#ifdef CONFIG_IRQSOFF_TRACER
+/*
+ * Since the ftrace irqsoff latency trace checks CALLER_ADDR1,
+ * which is the stack frame here, we need to force a stack frame
+ * in case we came from user space.
+ */
+#define TRACE_WITH_FRAME_BUFFER(func)          \
+       mflr    r0;                             \
+       stdu    r1, -32(r1);                    \
+       std     r0, 16(r1);                     \
+       stdu    r1, -32(r1);                    \
+       bl func;                                \
+       ld      r1, 0(r1);                      \
+       ld      r1, 0(r1);
+#else
+#define TRACE_WITH_FRAME_BUFFER(func)          \
+       bl func;
+#endif
+
 /*
  * Most of the CPU's IRQ-state tracing is done from assembly code; we
  * have to call a C function so call a wrapper that saves all the
  * C-clobbered registers.
  */
-#define TRACE_ENABLE_INTS      bl .trace_hardirqs_on
-#define TRACE_DISABLE_INTS     bl .trace_hardirqs_off
-#define TRACE_AND_RESTORE_IRQ_PARTIAL(en,skip) \
-       cmpdi   en,0;                           \
-       bne     95f;                            \
-       stb     en,PACASOFTIRQEN(r13);          \
-       bl      .trace_hardirqs_off;            \
-       b       skip;                           \
-95:    bl      .trace_hardirqs_on;             \
+#define TRACE_ENABLE_INTS      TRACE_WITH_FRAME_BUFFER(.trace_hardirqs_on)
+#define TRACE_DISABLE_INTS     TRACE_WITH_FRAME_BUFFER(.trace_hardirqs_off)
+
+#define TRACE_AND_RESTORE_IRQ_PARTIAL(en,skip)         \
+       cmpdi   en,0;                                   \
+       bne     95f;                                    \
+       stb     en,PACASOFTIRQEN(r13);                  \
+       TRACE_WITH_FRAME_BUFFER(.trace_hardirqs_off)    \
+       b       skip;                                   \
+95:    TRACE_WITH_FRAME_BUFFER(.trace_hardirqs_on)     \
        li      en,1;
 #define TRACE_AND_RESTORE_IRQ(en)              \
        TRACE_AND_RESTORE_IRQ_PARTIAL(en,96f);  \
-       stb     en,PACASOFTIRQEN(r13);          \
+       stb     en,PACASOFTIRQEN(r13);          \
 96:
 #else
 #define TRACE_ENABLE_INTS
index 8433d36619a1969a421b1cf82c543a867887905f..991d5998d6be6711a68e15ab8347b110ade13dd3 100644 (file)
@@ -116,9 +116,6 @@ struct machdep_calls {
         * If for some reason there is no irq, but the interrupt
         * shouldn't be counted as spurious, return NO_IRQ_IGNORE. */
        unsigned int    (*get_irq)(void);
-#ifdef CONFIG_KEXEC
-       void            (*kexec_cpu_down)(int crash_shutdown, int secondary);
-#endif
 
        /* PCI stuff */
        /* Called after scanning the bus, before allocating resources */
@@ -235,11 +232,7 @@ struct machdep_calls {
        void (*machine_shutdown)(void);
 
 #ifdef CONFIG_KEXEC
-       /* Called to do the minimal shutdown needed to run a kexec'd kernel
-        * to run successfully.
-        * XXX Should we move this one out of kexec scope?
-        */
-       void (*machine_crash_shutdown)(struct pt_regs *regs);
+       void (*kexec_cpu_down)(int crash_shutdown, int secondary);
 
        /* Called to do what every setup is needed on image and the
         * reboot code buffer. Returns 0 on success.
@@ -247,15 +240,6 @@ struct machdep_calls {
         * claims to support kexec.
         */
        int (*machine_kexec_prepare)(struct kimage *image);
-
-       /* Called to handle any machine specific cleanup on image */
-       void (*machine_kexec_cleanup)(struct kimage *image);
-
-       /* Called to perform the _real_ kexec.
-        * Do NOT allocate memory or fail here. We are past the point of
-        * no return.
-        */
-       void (*machine_kexec)(struct kimage *image);
 #endif /* CONFIG_KEXEC */
 
 #ifdef CONFIG_SUSPEND
index ff0005eec7dd0d3d3c54946bcbf51cdfdf8bb569..125fc1ad665d0fabe47288357fde12f78ad1eb87 100644 (file)
 #define HID0_NOPTI     (1<<0)          /* No-op dcbt and dcbst instr. */
 
 #define SPRN_HID1      0x3F1           /* Hardware Implementation Register 1 */
+#ifdef CONFIG_6xx
 #define HID1_EMCP      (1<<31)         /* 7450 Machine Check Pin Enable */
 #define HID1_DFS       (1<<22)         /* 7447A Dynamic Frequency Scaling */
 #define HID1_PC0       (1<<16)         /* 7450 PLL_CFG[0] */
 #define HID1_SYNCBE    (1<<11)         /* 7450 ABE for sync, eieio */
 #define HID1_ABE       (1<<10)         /* 7450 Address Broadcast Enable */
 #define HID1_PS                (1<<16)         /* 750FX PLL selection */
+#endif
 #define SPRN_HID2      0x3F8           /* Hardware Implementation Register 2 */
 #define SPRN_HID2_GEKKO        0x398           /* Gekko HID2 Register */
 #define SPRN_IABR      0x3F2   /* Instruction Address Breakpoint Register */
index 667a498eaee1b6080c6907d39de1c2f9c6c58747..e68c69bf741a26b5c8e09d39fa847a1096516dd6 100644 (file)
                                        store or cache line push */
 #endif
 
+/* Bit definitions for the HID1 */
+#ifdef CONFIG_E500
+/* e500v1/v2 */
+#define HID1_PLL_CFG_MASK 0xfc000000   /* PLL_CFG input pins */
+#define HID1_RFXE      0x00020000      /* Read fault exception enable */
+#define HID1_R1DPE     0x00008000      /* R1 data bus parity enable */
+#define HID1_R2DPE     0x00004000      /* R2 data bus parity enable */
+#define HID1_ASTME     0x00002000      /* Address bus streaming mode enable */
+#define HID1_ABE       0x00001000      /* Address broadcast enable */
+#define HID1_MPXTT     0x00000400      /* MPX re-map transfer type */
+#define HID1_ATS       0x00000080      /* Atomic status */
+#define HID1_MID_MASK  0x0000000f      /* MID input pins */
+#endif
+
 /* Bit definitions for the DBSR. */
 /*
  * DBSR bits which have conflicting definitions on true Book E versus IBM 40x.
index 0ab8d869e3d61d83c8984c4492019e6d022e2e46..0c8b35d75232363f0fe66c7a9c6df2c6c53dcb0b 100644 (file)
@@ -203,14 +203,6 @@ void spu_irq_setaffinity(struct spu *spu, int cpu);
 void spu_setup_kernel_slbs(struct spu *spu, struct spu_lscsa *lscsa,
                void *code, int code_size);
 
-#ifdef CONFIG_KEXEC
-void crash_register_spus(struct list_head *list);
-#else
-static inline void crash_register_spus(struct list_head *list)
-{
-}
-#endif
-
 extern void spu_invalidate_slbs(struct spu *spu);
 extern void spu_associate_mm(struct spu *spu, struct mm_struct *mm);
 int spu_64k_pages_available(void);
index 894e64fa481e94ca51b8c02419310a017ac2adf0..5c518ad3445c4a6e642d61a1ac24f35ee5846781 100644 (file)
@@ -64,6 +64,12 @@ _GLOBAL(__setup_cpu_e500v2)
        bl      __e500_icache_setup
        bl      __e500_dcache_setup
        bl      __setup_e500_ivors
+#ifdef CONFIG_RAPIDIO
+       /* Ensure that RFXE is set */
+       mfspr   r3,SPRN_HID1
+       oris    r3,r3,HID1_RFXE@h
+       mtspr   SPRN_HID1,r3
+#endif
        mtlr    r4
        blr
 _GLOBAL(__setup_cpu_e500mc)
index be5ab18b03b5e46394efbc55077b2a0d61f49a31..8d74a24c5502966373e996e54ec5eddea628dd2b 100644 (file)
@@ -116,7 +116,6 @@ static struct cpu_spec __initdata cpu_specs[] = {
                .pmc_type               = PPC_PMC_IBM,
                .oprofile_cpu_type      = "ppc64/power3",
                .oprofile_type          = PPC_OPROFILE_RS64,
-               .machine_check          = machine_check_generic,
                .platform               = "power3",
        },
        {       /* Power3+ */
@@ -132,7 +131,6 @@ static struct cpu_spec __initdata cpu_specs[] = {
                .pmc_type               = PPC_PMC_IBM,
                .oprofile_cpu_type      = "ppc64/power3",
                .oprofile_type          = PPC_OPROFILE_RS64,
-               .machine_check          = machine_check_generic,
                .platform               = "power3",
        },
        {       /* Northstar */
@@ -148,7 +146,6 @@ static struct cpu_spec __initdata cpu_specs[] = {
                .pmc_type               = PPC_PMC_IBM,
                .oprofile_cpu_type      = "ppc64/rs64",
                .oprofile_type          = PPC_OPROFILE_RS64,
-               .machine_check          = machine_check_generic,
                .platform               = "rs64",
        },
        {       /* Pulsar */
@@ -164,7 +161,6 @@ static struct cpu_spec __initdata cpu_specs[] = {
                .pmc_type               = PPC_PMC_IBM,
                .oprofile_cpu_type      = "ppc64/rs64",
                .oprofile_type          = PPC_OPROFILE_RS64,
-               .machine_check          = machine_check_generic,
                .platform               = "rs64",
        },
        {       /* I-star */
@@ -180,7 +176,6 @@ static struct cpu_spec __initdata cpu_specs[] = {
                .pmc_type               = PPC_PMC_IBM,
                .oprofile_cpu_type      = "ppc64/rs64",
                .oprofile_type          = PPC_OPROFILE_RS64,
-               .machine_check          = machine_check_generic,
                .platform               = "rs64",
        },
        {       /* S-star */
@@ -196,7 +191,6 @@ static struct cpu_spec __initdata cpu_specs[] = {
                .pmc_type               = PPC_PMC_IBM,
                .oprofile_cpu_type      = "ppc64/rs64",
                .oprofile_type          = PPC_OPROFILE_RS64,
-               .machine_check          = machine_check_generic,
                .platform               = "rs64",
        },
        {       /* Power4 */
@@ -212,7 +206,6 @@ static struct cpu_spec __initdata cpu_specs[] = {
                .pmc_type               = PPC_PMC_IBM,
                .oprofile_cpu_type      = "ppc64/power4",
                .oprofile_type          = PPC_OPROFILE_POWER4,
-               .machine_check          = machine_check_generic,
                .platform               = "power4",
        },
        {       /* Power4+ */
@@ -228,7 +221,6 @@ static struct cpu_spec __initdata cpu_specs[] = {
                .pmc_type               = PPC_PMC_IBM,
                .oprofile_cpu_type      = "ppc64/power4",
                .oprofile_type          = PPC_OPROFILE_POWER4,
-               .machine_check          = machine_check_generic,
                .platform               = "power4",
        },
        {       /* PPC970 */
@@ -247,7 +239,6 @@ static struct cpu_spec __initdata cpu_specs[] = {
                .cpu_restore            = __restore_cpu_ppc970,
                .oprofile_cpu_type      = "ppc64/970",
                .oprofile_type          = PPC_OPROFILE_POWER4,
-               .machine_check          = machine_check_generic,
                .platform               = "ppc970",
        },
        {       /* PPC970FX */
@@ -266,7 +257,6 @@ static struct cpu_spec __initdata cpu_specs[] = {
                .cpu_restore            = __restore_cpu_ppc970,
                .oprofile_cpu_type      = "ppc64/970",
                .oprofile_type          = PPC_OPROFILE_POWER4,
-               .machine_check          = machine_check_generic,
                .platform               = "ppc970",
        },
        {       /* PPC970MP DD1.0 - no DEEPNAP, use regular 970 init */
@@ -285,7 +275,6 @@ static struct cpu_spec __initdata cpu_specs[] = {
                .cpu_restore            = __restore_cpu_ppc970,
                .oprofile_cpu_type      = "ppc64/970MP",
                .oprofile_type          = PPC_OPROFILE_POWER4,
-               .machine_check          = machine_check_generic,
                .platform               = "ppc970",
        },
        {       /* PPC970MP */
@@ -304,7 +293,6 @@ static struct cpu_spec __initdata cpu_specs[] = {
                .cpu_restore            = __restore_cpu_ppc970,
                .oprofile_cpu_type      = "ppc64/970MP",
                .oprofile_type          = PPC_OPROFILE_POWER4,
-               .machine_check          = machine_check_generic,
                .platform               = "ppc970",
        },
        {       /* PPC970GX */
@@ -322,7 +310,6 @@ static struct cpu_spec __initdata cpu_specs[] = {
                .cpu_setup              = __setup_cpu_ppc970,
                .oprofile_cpu_type      = "ppc64/970",
                .oprofile_type          = PPC_OPROFILE_POWER4,
-               .machine_check          = machine_check_generic,
                .platform               = "ppc970",
        },
        {       /* Power5 GR */
@@ -343,7 +330,6 @@ static struct cpu_spec __initdata cpu_specs[] = {
                 */
                .oprofile_mmcra_sihv    = MMCRA_SIHV,
                .oprofile_mmcra_sipr    = MMCRA_SIPR,
-               .machine_check          = machine_check_generic,
                .platform               = "power5",
        },
        {       /* Power5++ */
@@ -360,7 +346,6 @@ static struct cpu_spec __initdata cpu_specs[] = {
                .oprofile_type          = PPC_OPROFILE_POWER4,
                .oprofile_mmcra_sihv    = MMCRA_SIHV,
                .oprofile_mmcra_sipr    = MMCRA_SIPR,
-               .machine_check          = machine_check_generic,
                .platform               = "power5+",
        },
        {       /* Power5 GS */
@@ -378,7 +363,6 @@ static struct cpu_spec __initdata cpu_specs[] = {
                .oprofile_type          = PPC_OPROFILE_POWER4,
                .oprofile_mmcra_sihv    = MMCRA_SIHV,
                .oprofile_mmcra_sipr    = MMCRA_SIPR,
-               .machine_check          = machine_check_generic,
                .platform               = "power5+",
        },
        {       /* POWER6 in P5+ mode; 2.04-compliant processor */
@@ -390,7 +374,6 @@ static struct cpu_spec __initdata cpu_specs[] = {
                .mmu_features           = MMU_FTR_HPTE_TABLE,
                .icache_bsize           = 128,
                .dcache_bsize           = 128,
-               .machine_check          = machine_check_generic,
                .oprofile_cpu_type      = "ppc64/ibm-compat-v1",
                .oprofile_type          = PPC_OPROFILE_POWER4,
                .platform               = "power5+",
@@ -413,7 +396,6 @@ static struct cpu_spec __initdata cpu_specs[] = {
                .oprofile_mmcra_sipr    = POWER6_MMCRA_SIPR,
                .oprofile_mmcra_clear   = POWER6_MMCRA_THRM |
                        POWER6_MMCRA_OTHER,
-               .machine_check          = machine_check_generic,
                .platform               = "power6x",
        },
        {       /* 2.05-compliant processor, i.e. Power6 "architected" mode */
@@ -425,7 +407,6 @@ static struct cpu_spec __initdata cpu_specs[] = {
                .mmu_features           = MMU_FTR_HPTE_TABLE,
                .icache_bsize           = 128,
                .dcache_bsize           = 128,
-               .machine_check          = machine_check_generic,
                .oprofile_cpu_type      = "ppc64/ibm-compat-v1",
                .oprofile_type          = PPC_OPROFILE_POWER4,
                .platform               = "power6",
@@ -440,7 +421,6 @@ static struct cpu_spec __initdata cpu_specs[] = {
                        MMU_FTR_TLBIE_206,
                .icache_bsize           = 128,
                .dcache_bsize           = 128,
-               .machine_check          = machine_check_generic,
                .oprofile_type          = PPC_OPROFILE_POWER4,
                .oprofile_cpu_type      = "ppc64/ibm-compat-v1",
                .platform               = "power7",
@@ -492,7 +472,6 @@ static struct cpu_spec __initdata cpu_specs[] = {
                .pmc_type               = PPC_PMC_IBM,
                .oprofile_cpu_type      = "ppc64/cell-be",
                .oprofile_type          = PPC_OPROFILE_CELL,
-               .machine_check          = machine_check_generic,
                .platform               = "ppc-cell-be",
        },
        {       /* PA Semi PA6T */
@@ -510,7 +489,6 @@ static struct cpu_spec __initdata cpu_specs[] = {
                .cpu_restore            = __restore_cpu_pa6t,
                .oprofile_cpu_type      = "ppc64/pa6t",
                .oprofile_type          = PPC_OPROFILE_PA6T,
-               .machine_check          = machine_check_generic,
                .platform               = "pa6t",
        },
        {       /* default match */
@@ -524,7 +502,6 @@ static struct cpu_spec __initdata cpu_specs[] = {
                .dcache_bsize           = 128,
                .num_pmcs               = 6,
                .pmc_type               = PPC_PMC_IBM,
-               .machine_check          = machine_check_generic,
                .platform               = "power4",
        }
 #endif /* CONFIG_PPC_BOOK3S_64 */
index 832c8c4db2541225ad007f5592b60ec8fe14776d..3d569e2aff18ecc3c3998ca2a6a7bf230755d66a 100644 (file)
@@ -48,7 +48,7 @@ int crashing_cpu = -1;
 static cpumask_t cpus_in_crash = CPU_MASK_NONE;
 cpumask_t cpus_in_sr = CPU_MASK_NONE;
 
-#define CRASH_HANDLER_MAX 2
+#define CRASH_HANDLER_MAX 3
 /* NULL terminated list of shutdown handles */
 static crash_shutdown_t crash_shutdown_handles[CRASH_HANDLER_MAX+1];
 static DEFINE_SPINLOCK(crash_handlers_lock);
@@ -125,7 +125,7 @@ static void crash_kexec_prepare_cpus(int cpu)
        smp_wmb();
 
        /*
-        * FIXME: Until we will have the way to stop other CPUSs reliabally,
+        * FIXME: Until we will have the way to stop other CPUs reliably,
         * the crash CPU will send an IPI and wait for other CPUs to
         * respond.
         * Delay of at least 10 seconds.
@@ -254,72 +254,6 @@ void crash_kexec_secondary(struct pt_regs *regs)
        cpus_in_sr = CPU_MASK_NONE;
 }
 #endif
-#ifdef CONFIG_SPU_BASE
-
-#include <asm/spu.h>
-#include <asm/spu_priv1.h>
-
-struct crash_spu_info {
-       struct spu *spu;
-       u32 saved_spu_runcntl_RW;
-       u32 saved_spu_status_R;
-       u32 saved_spu_npc_RW;
-       u64 saved_mfc_sr1_RW;
-       u64 saved_mfc_dar;
-       u64 saved_mfc_dsisr;
-};
-
-#define CRASH_NUM_SPUS 16      /* Enough for current hardware */
-static struct crash_spu_info crash_spu_info[CRASH_NUM_SPUS];
-
-static void crash_kexec_stop_spus(void)
-{
-       struct spu *spu;
-       int i;
-       u64 tmp;
-
-       for (i = 0; i < CRASH_NUM_SPUS; i++) {
-               if (!crash_spu_info[i].spu)
-                       continue;
-
-               spu = crash_spu_info[i].spu;
-
-               crash_spu_info[i].saved_spu_runcntl_RW =
-                       in_be32(&spu->problem->spu_runcntl_RW);
-               crash_spu_info[i].saved_spu_status_R =
-                       in_be32(&spu->problem->spu_status_R);
-               crash_spu_info[i].saved_spu_npc_RW =
-                       in_be32(&spu->problem->spu_npc_RW);
-
-               crash_spu_info[i].saved_mfc_dar    = spu_mfc_dar_get(spu);
-               crash_spu_info[i].saved_mfc_dsisr  = spu_mfc_dsisr_get(spu);
-               tmp = spu_mfc_sr1_get(spu);
-               crash_spu_info[i].saved_mfc_sr1_RW = tmp;
-
-               tmp &= ~MFC_STATE1_MASTER_RUN_CONTROL_MASK;
-               spu_mfc_sr1_set(spu, tmp);
-
-               __delay(200);
-       }
-}
-
-void crash_register_spus(struct list_head *list)
-{
-       struct spu *spu;
-
-       list_for_each_entry(spu, list, full_list) {
-               if (WARN_ON(spu->number >= CRASH_NUM_SPUS))
-                       continue;
-
-               crash_spu_info[spu->number].spu = spu;
-       }
-}
-
-#else
-static inline void crash_kexec_stop_spus(void)
-{
-}
-#endif /* CONFIG_SPU_BASE */
 
 /*
  * Register a function to be called on shutdown.  Only use this if you
@@ -439,8 +373,6 @@ void default_machine_crash_shutdown(struct pt_regs *regs)
        crash_shutdown_cpu = -1;
        __debugger_fault_handler = old_handler;
 
-       crash_kexec_stop_spus();
-
        if (ppc_md.kexec_cpu_down)
                ppc_md.kexec_cpu_down(1, 0);
 }
index c22dc1ec1c944037d3ca347785a5be3899b978c0..56212bc0ab087c4b40bb21df3496c89849a01f06 100644 (file)
@@ -880,7 +880,18 @@ END_MMU_FTR_SECTION_IFSET(MMU_FTR_TYPE_47x)
         */
        andi.   r10,r9,MSR_EE
        beq     1f
+       /*
+        * Since the ftrace irqsoff latency trace checks CALLER_ADDR1,
+        * which is the stack frame here, we need to force a stack frame
+        * in case we came from user space.
+        */
+       stwu    r1,-32(r1)
+       mflr    r0
+       stw     r0,4(r1)
+       stwu    r1,-32(r1)
        bl      trace_hardirqs_on
+       lwz     r1,0(r1)
+       lwz     r1,0(r1)
        lwz     r9,_MSR(r1)
 1:
 #endif /* CONFIG_TRACE_IRQFLAGS */
index df7e20c191cda3190c1396bc60921bd8c8df003f..49a170af81456ce722fa58cd70e5980370f5f70b 100644 (file)
@@ -15,6 +15,7 @@
 #include <linux/memblock.h>
 #include <linux/of.h>
 #include <linux/irq.h>
+#include <linux/ftrace.h>
 
 #include <asm/machdep.h>
 #include <asm/prom.h>
@@ -44,10 +45,7 @@ void machine_kexec_mask_interrupts(void) {
 
 void machine_crash_shutdown(struct pt_regs *regs)
 {
-       if (ppc_md.machine_crash_shutdown)
-               ppc_md.machine_crash_shutdown(regs);
-       else
-               default_machine_crash_shutdown(regs);
+       default_machine_crash_shutdown(regs);
 }
 
 /*
@@ -65,8 +63,6 @@ int machine_kexec_prepare(struct kimage *image)
 
 void machine_kexec_cleanup(struct kimage *image)
 {
-       if (ppc_md.machine_kexec_cleanup)
-               ppc_md.machine_kexec_cleanup(image);
 }
 
 void arch_crash_save_vmcoreinfo(void)
@@ -87,10 +83,13 @@ void arch_crash_save_vmcoreinfo(void)
  */
 void machine_kexec(struct kimage *image)
 {
-       if (ppc_md.machine_kexec)
-               ppc_md.machine_kexec(image);
-       else
-               default_machine_kexec(image);
+       int save_ftrace_enabled;
+
+       save_ftrace_enabled = __ftrace_enabled_save();
+
+       default_machine_kexec(image);
+
+       __ftrace_enabled_restore(save_ftrace_enabled);
 
        /* Fall back to normal restart if we're still alive. */
        machine_restart(NULL);
index 5674807057899cd09dc366d128b1769afc6cd3e9..ab6f6beadb5721ccf584b0fa4a9ba53155100674 100644 (file)
@@ -1212,6 +1212,7 @@ static void record_and_restart(struct perf_event *event, unsigned long val,
                        if (left <= 0)
                                left = period;
                        record = 1;
+                       event->hw.last_period = event->hw.sample_period;
                }
                if (left < 0x80000000LL)
                        val = 0x80000000LL - left;
index 84906d3fc8607befb6e2abca027480f12120d17d..7a1d5cb76932312f7e15609fe5f84c077696eda3 100644 (file)
@@ -631,7 +631,7 @@ void show_regs(struct pt_regs * regs)
 #ifdef CONFIG_PPC_ADV_DEBUG_REGS
                printk("DEAR: "REG", ESR: "REG"\n", regs->dar, regs->dsisr);
 #else
-               printk("DAR: "REG", DSISR: "REG"\n", regs->dar, regs->dsisr);
+               printk("DAR: "REG", DSISR: %08lx\n", regs->dar, regs->dsisr);
 #endif
        printk("TASK = %p[%d] '%s' THREAD: %p",
               current, task_pid_nr(current), current->comm, task_thread_info(current));
index 2b442e6c21e62b47409a35959e30d95b330e9f0f..bf5f5ce3a7bdd775b5b66ffc399426a2444aea71 100644 (file)
@@ -256,31 +256,16 @@ static ssize_t rtas_flash_read(struct file *file, char __user *buf,
        struct proc_dir_entry *dp = PDE(file->f_path.dentry->d_inode);
        struct rtas_update_flash_t *uf;
        char msg[RTAS_MSG_MAXLEN];
-       int msglen;
 
-       uf = (struct rtas_update_flash_t *) dp->data;
+       uf = dp->data;
 
        if (!strcmp(dp->name, FIRMWARE_FLASH_NAME)) {
                get_flash_status_msg(uf->status, msg);
        } else {           /* FIRMWARE_UPDATE_NAME */
                sprintf(msg, "%d\n", uf->status);
        }
-       msglen = strlen(msg);
-       if (msglen > count)
-               msglen = count;
-
-       if (ppos && *ppos != 0)
-               return 0;       /* be cheap */
-
-       if (!access_ok(VERIFY_WRITE, buf, msglen))
-               return -EINVAL;
 
-       if (copy_to_user(buf, msg, msglen))
-               return -EFAULT;
-
-       if (ppos)
-               *ppos = msglen;
-       return msglen;
+       return simple_read_from_buffer(buf, count, ppos, msg, strlen(msg));
 }
 
 /* constructor for flash_block_cache */
@@ -394,26 +379,13 @@ static ssize_t manage_flash_read(struct file *file, char __user *buf,
        char msg[RTAS_MSG_MAXLEN];
        int msglen;
 
-       args_buf = (struct rtas_manage_flash_t *) dp->data;
+       args_buf = dp->data;
        if (args_buf == NULL)
                return 0;
 
        msglen = sprintf(msg, "%d\n", args_buf->status);
-       if (msglen > count)
-               msglen = count;
 
-       if (ppos && *ppos != 0)
-               return 0;       /* be cheap */
-
-       if (!access_ok(VERIFY_WRITE, buf, msglen))
-               return -EINVAL;
-
-       if (copy_to_user(buf, msg, msglen))
-               return -EFAULT;
-
-       if (ppos)
-               *ppos = msglen;
-       return msglen;
+       return simple_read_from_buffer(buf, count, ppos, msg, msglen);
 }
 
 static ssize_t manage_flash_write(struct file *file, const char __user *buf,
@@ -495,24 +467,11 @@ static ssize_t validate_flash_read(struct file *file, char __user *buf,
        char msg[RTAS_MSG_MAXLEN];
        int msglen;
 
-       args_buf = (struct rtas_validate_flash_t *) dp->data;
+       args_buf = dp->data;
 
-       if (ppos && *ppos != 0)
-               return 0;       /* be cheap */
-       
        msglen = get_validate_flash_msg(args_buf, msg);
-       if (msglen > count)
-               msglen = count;
-
-       if (!access_ok(VERIFY_WRITE, buf, msglen))
-               return -EINVAL;
-
-       if (copy_to_user(buf, msg, msglen))
-               return -EFAULT;
 
-       if (ppos)
-               *ppos = msglen;
-       return msglen;
+       return simple_read_from_buffer(buf, count, ppos, msg, msglen);
 }
 
 static ssize_t validate_flash_write(struct file *file, const char __user *buf,
index 0438f819fe6b1adf10a16c42f6b32b8b2c75d059..049dbecb5dbc7908eb991642bb629e695590341f 100644 (file)
@@ -160,7 +160,7 @@ static int log_rtas_len(char * buf)
        /* rtas fixed header */
        len = 8;
        err = (struct rtas_error_log *)buf;
-       if (err->extended_log_length) {
+       if (err->extended && err->extended_log_length) {
 
                /* extended header */
                len += err->extended_log_length;
index 09e4dea4a85a5969d564f72a1d618a22caf20a12..09d31dbf43f990bdc29cbc7dc154349b3fda361d 100644 (file)
@@ -265,11 +265,26 @@ void accumulate_stolen_time(void)
 {
        u64 sst, ust;
 
-       sst = scan_dispatch_log(get_paca()->starttime_user);
-       ust = scan_dispatch_log(get_paca()->starttime);
-       get_paca()->system_time -= sst;
-       get_paca()->user_time -= ust;
-       get_paca()->stolen_time += ust + sst;
+       u8 save_soft_enabled = local_paca->soft_enabled;
+       u8 save_hard_enabled = local_paca->hard_enabled;
+
+       /* We are called early in the exception entry, before
+        * soft/hard_enabled are sync'ed to the expected state
+        * for the exception. We are hard disabled but the PACA
+        * needs to reflect that so various debug stuff doesn't
+        * complain
+        */
+       local_paca->soft_enabled = 0;
+       local_paca->hard_enabled = 0;
+
+       sst = scan_dispatch_log(local_paca->starttime_user);
+       ust = scan_dispatch_log(local_paca->starttime);
+       local_paca->system_time -= sst;
+       local_paca->user_time -= ust;
+       local_paca->stolen_time += ust + sst;
+
+       local_paca->soft_enabled = save_soft_enabled;
+       local_paca->hard_enabled = save_hard_enabled;
 }
 
 static inline u64 calculate_stolen_time(u64 stop_tb)
index 1b2cdc8eec901fce78e21d279ca054684bec158c..bd74fac169be0e665e108b87110ee1cefb5d4718 100644 (file)
@@ -626,12 +626,6 @@ void machine_check_exception(struct pt_regs *regs)
        if (recover > 0)
                return;
 
-       if (user_mode(regs)) {
-               regs->msr |= MSR_RI;
-               _exception(SIGBUS, regs, BUS_ADRERR, regs->nip);
-               return;
-       }
-
 #if defined(CONFIG_8xx) && defined(CONFIG_PCI)
        /* the qspan pci read routines can cause machine checks -- Cort
         *
@@ -643,16 +637,12 @@ void machine_check_exception(struct pt_regs *regs)
        return;
 #endif
 
-       if (debugger_fault_handler(regs)) {
-               regs->msr |= MSR_RI;
+       if (debugger_fault_handler(regs))
                return;
-       }
 
        if (check_io_access(regs))
                return;
 
-       if (debugger_fault_handler(regs))
-               return;
        die("Machine check", regs, SIGBUS);
 
        /* Must die if the interrupt is not recoverable */
index cb737484c5aa2aa74f38df054143b208c4d74312..f4613118132e51235f38cd831ec3cfaf8417d680 100644 (file)
@@ -172,6 +172,25 @@ globl(ftr_fixup_test6_expected)
 3:     or      3,3,3
 
 
+#if 0
+/* Test that if we have a larger else case the assembler spots it and
+ * reports an error. #if 0'ed so as not to break the build normally.
+ */
+ftr_fixup_test7:
+       or      1,1,1
+BEGIN_FTR_SECTION
+       or      2,2,2
+       or      2,2,2
+       or      2,2,2
+FTR_SECTION_ELSE
+       or      3,3,3
+       or      3,3,3
+       or      3,3,3
+       or      3,3,3
+ALT_FTR_SECTION_END(0, 1)
+       or      1,1,1
+#endif
+
 #define        MAKE_MACRO_TEST(TYPE)                                           \
 globl(ftr_fixup_test_ ##TYPE##_macros)                                 \
        or      1,1,1;                                                  \
index 661d354e4ff27d15ee97aa18f663110177ab8ca4..d0c4e15b77949a09ab29ef6d507ef86031bdcb2e 100644 (file)
@@ -57,12 +57,12 @@ static void __init mpc830x_rdb_init_IRQ(void)
        ipic_set_default_priority();
 }
 
-struct const char *board[] __initdata = {
+static const char *board[] __initdata = {
        "MPC8308RDB",
        "fsl,mpc8308rdb",
        "denx,mpc8308_p1m",
        NULL
-}
+};
 
 /*
  * Called very early, MMU is off, device-tree isn't unflattened
index b54cd736a895215250fea8c2c99159a9aa0965b7..f859ead49a8d26c89b2c2aa33a0dbeb57bc0fb1e 100644 (file)
@@ -60,11 +60,11 @@ static void __init mpc831x_rdb_init_IRQ(void)
        ipic_set_default_priority();
 }
 
-struct const char *board[] __initdata = {
+static const char *board[] __initdata = {
        "MPC8313ERDB",
        "fsl,mpc8315erdb",
        NULL
-}
+};
 
 /*
  * Called very early, MMU is off, device-tree isn't unflattened
index 0fea8811d45beb304bbf5d4163f6fd467940c521..82a434510d83d458bf242f95663df565a1cf925f 100644 (file)
@@ -35,6 +35,8 @@
 
 /* system i/o configuration register high */
 #define MPC83XX_SICRH_OFFS         0x118
+#define MPC8308_SICRH_USB_MASK     0x000c0000
+#define MPC8308_SICRH_USB_ULPI     0x00040000
 #define MPC834X_SICRH_USB_UTMI     0x00020000
 #define MPC831X_SICRH_USB_MASK     0x000000e0
 #define MPC831X_SICRH_USB_ULPI     0x000000a0
index 3ba4bb7d41bb0d8f3905d5f9123d992b47872371..2c64164722d05886cfde3e2a2da2cd9a8d8cd6d0 100644 (file)
@@ -127,7 +127,8 @@ int mpc831x_usb_cfg(void)
 
        /* Configure clock */
        immr_node = of_get_parent(np);
-       if (immr_node && of_device_is_compatible(immr_node, "fsl,mpc8315-immr"))
+       if (immr_node && (of_device_is_compatible(immr_node, "fsl,mpc8315-immr") ||
+                       of_device_is_compatible(immr_node, "fsl,mpc8308-immr")))
                clrsetbits_be32(immap + MPC83XX_SCCR_OFFS,
                                MPC8315_SCCR_USB_MASK,
                                MPC8315_SCCR_USB_DRCM_01);
@@ -138,7 +139,11 @@ int mpc831x_usb_cfg(void)
 
        /* Configure pin mux for ULPI.  There is no pin mux for UTMI */
        if (prop && !strcmp(prop, "ulpi")) {
-               if (of_device_is_compatible(immr_node, "fsl,mpc8315-immr")) {
+               if (of_device_is_compatible(immr_node, "fsl,mpc8308-immr")) {
+                       clrsetbits_be32(immap + MPC83XX_SICRH_OFFS,
+                                       MPC8308_SICRH_USB_MASK,
+                                       MPC8308_SICRH_USB_ULPI);
+               } else if (of_device_is_compatible(immr_node, "fsl,mpc8315-immr")) {
                        clrsetbits_be32(immap + MPC83XX_SICRL_OFFS,
                                        MPC8315_SICRL_USB_MASK,
                                        MPC8315_SICRL_USB_ULPI);
@@ -173,6 +178,9 @@ int mpc831x_usb_cfg(void)
                     !strcmp(prop, "utmi"))) {
                u32 refsel;
 
+               if (of_device_is_compatible(immr_node, "fsl,mpc8308-immr"))
+                       goto out;
+
                if (of_device_is_compatible(immr_node, "fsl,mpc8315-immr"))
                        refsel = CONTROL_REFSEL_24MHZ;
                else
@@ -186,9 +194,11 @@ int mpc831x_usb_cfg(void)
                temp = CONTROL_PHY_CLK_SEL_ULPI;
 #ifdef CONFIG_USB_OTG
                /* Set OTG_PORT */
-               dr_mode = of_get_property(np, "dr_mode", NULL);
-               if (dr_mode && !strcmp(dr_mode, "otg"))
-                       temp |= CONTROL_OTG_PORT;
+               if (!of_device_is_compatible(immr_node, "fsl,mpc8308-immr")) {
+                       dr_mode = of_get_property(np, "dr_mode", NULL);
+                       if (dr_mode && !strcmp(dr_mode, "otg"))
+                               temp |= CONTROL_OTG_PORT;
+               }
 #endif /* CONFIG_USB_OTG */
                out_be32(usb_regs + FSL_USB2_CONTROL_OFFS, temp);
        } else {
@@ -196,6 +206,7 @@ int mpc831x_usb_cfg(void)
                ret = -EINVAL;
        }
 
+out:
        iounmap(usb_regs);
        of_node_put(np);
        return ret;
index 968c1c0b4d5bc9499ce80ed5bbd8bf6824341efc..d809836bcf5f36042841a256fd12436638d653bf 100644 (file)
@@ -39,8 +39,6 @@ struct spu_gov_info_struct {
 };
 static DEFINE_PER_CPU(struct spu_gov_info_struct, spu_gov_info);
 
-static struct workqueue_struct *kspugov_wq;
-
 static int calc_freq(struct spu_gov_info_struct *info)
 {
        int cpu;
@@ -71,14 +69,14 @@ static void spu_gov_work(struct work_struct *work)
        __cpufreq_driver_target(info->policy, target_freq, CPUFREQ_RELATION_H);
 
        delay = usecs_to_jiffies(info->poll_int);
-       queue_delayed_work_on(info->policy->cpu, kspugov_wq, &info->work, delay);
+       schedule_delayed_work_on(info->policy->cpu, &info->work, delay);
 }
 
 static void spu_gov_init_work(struct spu_gov_info_struct *info)
 {
        int delay = usecs_to_jiffies(info->poll_int);
        INIT_DELAYED_WORK_DEFERRABLE(&info->work, spu_gov_work);
-       queue_delayed_work_on(info->policy->cpu, kspugov_wq, &info->work, delay);
+       schedule_delayed_work_on(info->policy->cpu, &info->work, delay);
 }
 
 static void spu_gov_cancel_work(struct spu_gov_info_struct *info)
@@ -152,27 +150,15 @@ static int __init spu_gov_init(void)
 {
        int ret;
 
-       kspugov_wq = create_workqueue("kspugov");
-       if (!kspugov_wq) {
-               printk(KERN_ERR "creation of kspugov failed\n");
-               ret = -EFAULT;
-               goto out;
-       }
-
        ret = cpufreq_register_governor(&spu_governor);
-       if (ret) {
+       if (ret)
                printk(KERN_ERR "registration of governor failed\n");
-               destroy_workqueue(kspugov_wq);
-               goto out;
-       }
-out:
        return ret;
 }
 
 static void __exit spu_gov_exit(void)
 {
        cpufreq_unregister_governor(&spu_governor);
-       destroy_workqueue(kspugov_wq);
 }
 
 
index 1b5749042756cc9e238431b5cb05bc69b5a5dde2..d31c594cfdf3ee68d84b7f7fa4603cc8bd7c7ab4 100644 (file)
@@ -145,9 +145,4 @@ define_machine(qpace) {
        .calibrate_decr         = generic_calibrate_decr,
        .progress               = qpace_progress,
        .init_IRQ               = iic_init_IRQ,
-#ifdef CONFIG_KEXEC
-       .machine_kexec          = default_machine_kexec,
-       .machine_kexec_prepare  = default_machine_kexec_prepare,
-       .machine_crash_shutdown = default_machine_crash_shutdown,
-#endif
 };
index 8547e86bfb42ff2650c50dea4bdb3533e647a1b6..acfaccea5f4fa4d08f36bab9efe60d24a366f554 100644 (file)
@@ -37,6 +37,7 @@
 #include <asm/spu_csa.h>
 #include <asm/xmon.h>
 #include <asm/prom.h>
+#include <asm/kexec.h>
 
 const struct spu_management_ops *spu_management_ops;
 EXPORT_SYMBOL_GPL(spu_management_ops);
@@ -727,6 +728,75 @@ static ssize_t spu_stat_show(struct sys_device *sysdev,
 
 static SYSDEV_ATTR(stat, 0644, spu_stat_show, NULL);
 
+#ifdef CONFIG_KEXEC
+
+struct crash_spu_info {
+       struct spu *spu;
+       u32 saved_spu_runcntl_RW;
+       u32 saved_spu_status_R;
+       u32 saved_spu_npc_RW;
+       u64 saved_mfc_sr1_RW;
+       u64 saved_mfc_dar;
+       u64 saved_mfc_dsisr;
+};
+
+#define CRASH_NUM_SPUS 16      /* Enough for current hardware */
+static struct crash_spu_info crash_spu_info[CRASH_NUM_SPUS];
+
+static void crash_kexec_stop_spus(void)
+{
+       struct spu *spu;
+       int i;
+       u64 tmp;
+
+       for (i = 0; i < CRASH_NUM_SPUS; i++) {
+               if (!crash_spu_info[i].spu)
+                       continue;
+
+               spu = crash_spu_info[i].spu;
+
+               crash_spu_info[i].saved_spu_runcntl_RW =
+                       in_be32(&spu->problem->spu_runcntl_RW);
+               crash_spu_info[i].saved_spu_status_R =
+                       in_be32(&spu->problem->spu_status_R);
+               crash_spu_info[i].saved_spu_npc_RW =
+                       in_be32(&spu->problem->spu_npc_RW);
+
+               crash_spu_info[i].saved_mfc_dar    = spu_mfc_dar_get(spu);
+               crash_spu_info[i].saved_mfc_dsisr  = spu_mfc_dsisr_get(spu);
+               tmp = spu_mfc_sr1_get(spu);
+               crash_spu_info[i].saved_mfc_sr1_RW = tmp;
+
+               tmp &= ~MFC_STATE1_MASTER_RUN_CONTROL_MASK;
+               spu_mfc_sr1_set(spu, tmp);
+
+               __delay(200);
+       }
+}
+
+static void crash_register_spus(struct list_head *list)
+{
+       struct spu *spu;
+       int ret;
+
+       list_for_each_entry(spu, list, full_list) {
+               if (WARN_ON(spu->number >= CRASH_NUM_SPUS))
+                       continue;
+
+               crash_spu_info[spu->number].spu = spu;
+       }
+
+       ret = crash_shutdown_register(&crash_kexec_stop_spus);
+       if (ret)
+               printk(KERN_ERR "Could not register SPU crash handler");
+}
+
+#else
+static inline void crash_register_spus(struct list_head *list)
+{
+}
+#endif
+
 static int __init init_spu_base(void)
 {
        int i, ret = 0;
index 02f7b113a31baf119c1528b04fdd319c156f770d..3c7c3f82d8424d67e24587cd40d2ef60f0647772 100644 (file)
@@ -219,24 +219,17 @@ spufs_mem_write(struct file *file, const char __user *buffer,
        loff_t pos = *ppos;
        int ret;
 
-       if (pos < 0)
-               return -EINVAL;
        if (pos > LS_SIZE)
                return -EFBIG;
-       if (size > LS_SIZE - pos)
-               size = LS_SIZE - pos;
 
        ret = spu_acquire(ctx);
        if (ret)
                return ret;
 
        local_store = ctx->ops->get_ls(ctx);
-       ret = copy_from_user(local_store + pos, buffer, size);
+       size = simple_write_to_buffer(local_store, LS_SIZE, ppos, buffer, size);
        spu_release(ctx);
 
-       if (ret)
-               return -EFAULT;
-       *ppos = pos + size;
        return size;
 }
 
@@ -574,18 +567,15 @@ spufs_regs_write(struct file *file, const char __user *buffer,
        if (*pos >= sizeof(lscsa->gprs))
                return -EFBIG;
 
-       size = min_t(ssize_t, sizeof(lscsa->gprs) - *pos, size);
-       *pos += size;
-
        ret = spu_acquire_saved(ctx);
        if (ret)
                return ret;
 
-       ret = copy_from_user((char *)lscsa->gprs + *pos - size,
-                            buffer, size) ? -EFAULT : size;
+       size = simple_write_to_buffer(lscsa->gprs, sizeof(lscsa->gprs), pos,
+                                       buffer, size);
 
        spu_release_saved(ctx);
-       return ret;
+       return size;
 }
 
 static const struct file_operations spufs_regs_fops = {
@@ -630,18 +620,15 @@ spufs_fpcr_write(struct file *file, const char __user * buffer,
        if (*pos >= sizeof(lscsa->fpcr))
                return -EFBIG;
 
-       size = min_t(ssize_t, sizeof(lscsa->fpcr) - *pos, size);
-
        ret = spu_acquire_saved(ctx);
        if (ret)
                return ret;
 
-       *pos += size;
-       ret = copy_from_user((char *)&lscsa->fpcr + *pos - size,
-                            buffer, size) ? -EFAULT : size;
+       size = simple_write_to_buffer(&lscsa->fpcr, sizeof(lscsa->fpcr), pos,
+                                       buffer, size);
 
        spu_release_saved(ctx);
-       return ret;
+       return size;
 }
 
 static const struct file_operations spufs_fpcr_fops = {
index 1106fd99627ff650ace3caa479722ff426013297..a138e14bad2e7292565bf807be59e784e1e77f89 100644 (file)
@@ -75,14 +75,6 @@ static void gamecube_shutdown(void)
        flipper_quiesce();
 }
 
-#ifdef CONFIG_KEXEC
-static int gamecube_kexec_prepare(struct kimage *image)
-{
-       return 0;
-}
-#endif /* CONFIG_KEXEC */
-
-
 define_machine(gamecube) {
        .name                   = "gamecube",
        .probe                  = gamecube_probe,
@@ -95,9 +87,6 @@ define_machine(gamecube) {
        .calibrate_decr         = generic_calibrate_decr,
        .progress               = udbg_progress,
        .machine_shutdown       = gamecube_shutdown,
-#ifdef CONFIG_KEXEC
-       .machine_kexec_prepare  = gamecube_kexec_prepare,
-#endif
 };
 
 
index 649473a729b8843b251a2bbffaf26927b63ac15e..1b5dc1a2e1452abed0462c31879331514c94bdee 100644 (file)
@@ -18,7 +18,6 @@
 #include <linux/init.h>
 #include <linux/irq.h>
 #include <linux/seq_file.h>
-#include <linux/kexec.h>
 #include <linux/of_platform.h>
 #include <linux/memblock.h>
 #include <mm/mmu_decl.h>
@@ -226,13 +225,6 @@ static void wii_shutdown(void)
        flipper_quiesce();
 }
 
-#ifdef CONFIG_KEXEC
-static int wii_machine_kexec_prepare(struct kimage *image)
-{
-       return 0;
-}
-#endif /* CONFIG_KEXEC */
-
 define_machine(wii) {
        .name                   = "wii",
        .probe                  = wii_probe,
@@ -246,9 +238,6 @@ define_machine(wii) {
        .calibrate_decr         = generic_calibrate_decr,
        .progress               = udbg_progress,
        .machine_shutdown       = wii_shutdown,
-#ifdef CONFIG_KEXEC
-       .machine_kexec_prepare  = wii_machine_kexec_prepare,
-#endif
 };
 
 static struct of_device_id wii_of_bus[] = {
index 47a20cfb44864ede430b8277f05824439c267593..e5bc9f75d474c9d44718f29c14061b2e17384221 100644 (file)
@@ -2,7 +2,7 @@ config PPC_ISERIES
        bool "IBM Legacy iSeries"
        depends on PPC64 && PPC_BOOK3S
        select PPC_INDIRECT_IO
-       select PPC_PCI_CHOICE if EMBEDDED
+       select PPC_PCI_CHOICE if EXPERT
 
 menu "iSeries device drivers"
        depends on PPC_ISERIES
index 5d1b743dbe7e86ea662ec598d8d3f14498b3bc37..5b3da4b4ea79c4d235969c4e3b7f6ec54e2b28a6 100644 (file)
@@ -10,7 +10,7 @@ config PPC_PSERIES
        select RTAS_ERROR_LOGGING
        select PPC_UDBG_16550
        select PPC_NATIVE
-       select PPC_PCI_CHOICE if EMBEDDED
+       select PPC_PCI_CHOICE if EXPERT
        default y
 
 config PPC_SPLPAR
@@ -24,9 +24,9 @@ config PPC_SPLPAR
          two or more partitions.
 
 config EEH
-       bool "PCI Extended Error Handling (EEH)" if EMBEDDED
+       bool "PCI Extended Error Handling (EEH)" if EXPERT
        depends on PPC_PSERIES && PCI
-       default y if !EMBEDDED
+       default y if !EXPERT
 
 config PSERIES_MSI
        bool
index 53cbd53d8740537d86b7fe5ab13e19dfcdcecd75..77d38a5e2ff98b1a953088ca282b4986c1d046ec 100644 (file)
@@ -61,13 +61,3 @@ void __init setup_kexec_cpu_down_xics(void)
 {
        ppc_md.kexec_cpu_down = pseries_kexec_cpu_down_xics;
 }
-
-static int __init pseries_kexec_setup(void)
-{
-       ppc_md.machine_kexec = default_machine_kexec;
-       ppc_md.machine_kexec_prepare = default_machine_kexec_prepare;
-       ppc_md.machine_crash_shutdown = default_machine_crash_shutdown;
-
-       return 0;
-}
-machine_device_initcall(pseries, pseries_kexec_setup);
index a4fc6da87c2ec06355ccd8f04d6eab554bc022c4..c55d7ad9c6483f480b611a09444249f8db0b876b 100644 (file)
@@ -54,7 +54,8 @@
 static unsigned char ras_log_buf[RTAS_ERROR_LOG_MAX];
 static DEFINE_SPINLOCK(ras_log_buf_lock);
 
-static char mce_data_buf[RTAS_ERROR_LOG_MAX];
+static char global_mce_data_buf[RTAS_ERROR_LOG_MAX];
+static DEFINE_PER_CPU(__u64, mce_data_buf);
 
 static int ras_get_sensor_state_token;
 static int ras_check_exception_token;
@@ -196,12 +197,24 @@ static irqreturn_t ras_error_interrupt(int irq, void *dev_id)
        return IRQ_HANDLED;
 }
 
-/* Get the error information for errors coming through the
+/*
+ * Some versions of FWNMI place the buffer inside the 4kB page starting at
+ * 0x7000. Other versions place it inside the rtas buffer. We check both.
+ */
+#define VALID_FWNMI_BUFFER(A) \
+       ((((A) >= 0x7000) && ((A) < 0x7ff0)) || \
+       (((A) >= rtas.base) && ((A) < (rtas.base + rtas.size - 16))))
+
+/*
+ * Get the error information for errors coming through the
  * FWNMI vectors.  The pt_regs' r3 will be updated to reflect
  * the actual r3 if possible, and a ptr to the error log entry
  * will be returned if found.
  *
- * The mce_data_buf does not have any locks or protection around it,
+ * If the RTAS error is not of the extended type, then we put it in a per
+ * cpu 64bit buffer. If it is the extended type we use global_mce_data_buf.
+ *
+ * The global_mce_data_buf does not have any locks or protection around it,
  * if a second machine check comes in, or a system reset is done
  * before we have logged the error, then we will get corruption in the
  * error log.  This is preferable over holding off on calling
@@ -210,20 +223,31 @@ static irqreturn_t ras_error_interrupt(int irq, void *dev_id)
  */
 static struct rtas_error_log *fwnmi_get_errinfo(struct pt_regs *regs)
 {
-       unsigned long errdata = regs->gpr[3];
-       struct rtas_error_log *errhdr = NULL;
        unsigned long *savep;
+       struct rtas_error_log *h, *errhdr = NULL;
+
+       if (!VALID_FWNMI_BUFFER(regs->gpr[3])) {
+               printk(KERN_ERR "FWNMI: corrupt r3\n");
+               return NULL;
+       }
 
-       if ((errdata >= 0x7000 && errdata < 0x7fff0) ||
-           (errdata >= rtas.base && errdata < rtas.base + rtas.size - 16)) {
-               savep = __va(errdata);
-               regs->gpr[3] = savep[0];        /* restore original r3 */
-               memset(mce_data_buf, 0, RTAS_ERROR_LOG_MAX);
-               memcpy(mce_data_buf, (char *)(savep + 1), RTAS_ERROR_LOG_MAX);
-               errhdr = (struct rtas_error_log *)mce_data_buf;
+       savep = __va(regs->gpr[3]);
+       regs->gpr[3] = savep[0];        /* restore original r3 */
+
+       /* If it isn't an extended log we can use the per cpu 64bit buffer */
+       h = (struct rtas_error_log *)&savep[1];
+       if (!h->extended) {
+               memcpy(&__get_cpu_var(mce_data_buf), h, sizeof(__u64));
+               errhdr = (struct rtas_error_log *)&__get_cpu_var(mce_data_buf);
        } else {
-               printk("FWNMI: corrupt r3\n");
+               int len;
+
+               len = max_t(int, 8+h->extended_log_length, RTAS_ERROR_LOG_MAX);
+               memset(global_mce_data_buf, 0, RTAS_ERROR_LOG_MAX);
+               memcpy(global_mce_data_buf, h, len);
+               errhdr = (struct rtas_error_log *)global_mce_data_buf;
        }
+
        return errhdr;
 }
 
@@ -235,7 +259,7 @@ static void fwnmi_release_errinfo(void)
 {
        int ret = rtas_call(rtas_token("ibm,nmi-interlock"), 0, 1, NULL);
        if (ret != 0)
-               printk("FWNMI: nmi-interlock failed: %d\n", ret);
+               printk(KERN_ERR "FWNMI: nmi-interlock failed: %d\n", ret);
 }
 
 int pSeries_system_reset_exception(struct pt_regs *regs)
@@ -259,31 +283,43 @@ int pSeries_system_reset_exception(struct pt_regs *regs)
  * Return 1 if corrected (or delivered a signal).
  * Return 0 if there is nothing we can do.
  */
-static int recover_mce(struct pt_regs *regs, struct rtas_error_log * err)
+static int recover_mce(struct pt_regs *regs, struct rtas_error_log *err)
 {
-       int nonfatal = 0;
+       int recovered = 0;
 
-       if (err->disposition == RTAS_DISP_FULLY_RECOVERED) {
+       if (!(regs->msr & MSR_RI)) {
+               /* If MSR_RI isn't set, we cannot recover */
+               recovered = 0;
+
+       } else if (err->disposition == RTAS_DISP_FULLY_RECOVERED) {
                /* Platform corrected itself */
-               nonfatal = 1;
-       } else if ((regs->msr & MSR_RI) &&
-                  user_mode(regs) &&
-                  err->severity == RTAS_SEVERITY_ERROR_SYNC &&
-                  err->disposition == RTAS_DISP_NOT_RECOVERED &&
-                  err->target == RTAS_TARGET_MEMORY &&
-                  err->type == RTAS_TYPE_ECC_UNCORR &&
-                  !(current->pid == 0 || is_global_init(current))) {
-               /* Kill off a user process with an ECC error */
-               printk(KERN_ERR "MCE: uncorrectable ecc error for pid %d\n",
-                      current->pid);
-               /* XXX something better for ECC error? */
-               _exception(SIGBUS, regs, BUS_ADRERR, regs->nip);
-               nonfatal = 1;
+               recovered = 1;
+
+       } else if (err->disposition == RTAS_DISP_LIMITED_RECOVERY) {
+               /* Platform corrected itself but could be degraded */
+               printk(KERN_ERR "MCE: limited recovery, system may "
+                      "be degraded\n");
+               recovered = 1;
+
+       } else if (user_mode(regs) && !is_global_init(current) &&
+                  err->severity == RTAS_SEVERITY_ERROR_SYNC) {
+
+               /*
+                * If we received a synchronous error when in userspace
+                * kill the task. Firmware may report details of the fail
+                * asynchronously, so we can't rely on the target and type
+                * fields being valid here.
+                */
+               printk(KERN_ERR "MCE: uncorrectable error, killing task "
+                      "%s:%d\n", current->comm, current->pid);
+
+               _exception(SIGBUS, regs, BUS_MCEERR_AR, regs->nip);
+               recovered = 1;
        }
 
-       log_error((char *)err, ERR_TYPE_RTAS_LOG, !nonfatal);
+       log_error((char *)err, ERR_TYPE_RTAS_LOG, 0);
 
-       return nonfatal;
+       return recovered;
 }
 
 /*
index 9f99bef2adec8e1e39c8c37f6cca76fa18b06c94..8c6cab0132783634b76183d521b19ebe8d31a941 100644 (file)
@@ -1555,8 +1555,6 @@ int fsl_rio_setup(struct platform_device *dev)
        saved_mcheck_exception = ppc_md.machine_check_exception;
        ppc_md.machine_check_exception = fsl_rio_mcheck_exception;
 #endif
-       /* Ensure that RFXE is set */
-       mtspr(SPRN_HID1, (mfspr(SPRN_HID1) | 0x20000));
 
        return 0;
 err:
index 7c1342618a307560b187767d65ae6a6e24c4ddd0..b0c8469e5ddd76204b522464139bf0294ffd8151 100644 (file)
@@ -674,7 +674,8 @@ void mpic_unmask_irq(unsigned int irq)
        /* make sure mask gets to controller before we return to user */
        do {
                if (!loops--) {
-                       printk(KERN_ERR "mpic_enable_irq timeout\n");
+                       printk(KERN_ERR "%s: timeout on hwirq %u\n",
+                              __func__, src);
                        break;
                }
        } while(mpic_irq_read(src, MPIC_INFO(IRQ_VECTOR_PRI)) & MPIC_VECPRI_MASK);
@@ -695,7 +696,8 @@ void mpic_mask_irq(unsigned int irq)
        /* make sure mask gets to controller before we return to user */
        do {
                if (!loops--) {
-                       printk(KERN_ERR "mpic_enable_irq timeout\n");
+                       printk(KERN_ERR "%s: timeout on hwirq %u\n",
+                              __func__, src);
                        break;
                }
        } while(!(mpic_irq_read(src, MPIC_INFO(IRQ_VECTOR_PRI)) & MPIC_VECPRI_MASK));
index 4293fdcb53981a531d1324b528690d1d277c2a1d..27b2295f41f378e341acd86e23582fb19d80de2e 100644 (file)
@@ -1,5 +1,9 @@
 menu "Machine selection"
 
+config SCORE
+       def_bool y
+       select HAVE_GENERIC_HARDIRQS
+
 choice
        prompt "System type"
        default MACH_SPCT6600
@@ -53,9 +57,6 @@ config GENERIC_CLOCKEVENTS
 config SCHED_NO_NO_OMIT_FRAME_POINTER
        def_bool y
 
-config GENERIC_HARDIRQS_NO__DO_IRQ
-       def_bool y
-
 config GENERIC_SYSCALL_TABLE
        def_bool y
 
@@ -68,9 +69,6 @@ menu "Kernel type"
 config 32BIT
        def_bool y
 
-config GENERIC_HARDIRQS
-       def_bool y
-
 config ARCH_FLATMEM_ENABLE
        def_bool y
 
index 9883c50e463652163a5b91702882dbd343a99b6e..df1edbf507a2df28b5c78f08a5d0c8159e39e7ba 100644 (file)
@@ -9,7 +9,7 @@ CONFIG_LOG_BUF_SHIFT=12
 CONFIG_SYSFS_DEPRECATED_V2=y
 CONFIG_BLK_DEV_INITRD=y
 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
-CONFIG_EMBEDDED=y
+CONFIG_EXPERT=y
 # CONFIG_KALLSYMS is not set
 # CONFIG_HOTPLUG is not set
 CONFIG_SLAB=y
index fff252209f635473c2ac00e17de45513b41c927f..ae555569823b7686252ea1da69ecd465bc2d1808 100644 (file)
@@ -1,6 +1,6 @@
 config SUPERH
        def_bool y
-       select EMBEDDED
+       select EXPERT
        select CLKDEV_LOOKUP
        select HAVE_IDE if HAS_IOPORT
        select HAVE_MEMBLOCK
index 45d9c87d083ad89343b7c7862c5b62a911f86c2f..95695e97703e8727f5b82367781a03b2c861d532 100644 (file)
@@ -50,6 +50,7 @@ config SPARC64
        select RTC_DRV_STARFIRE
        select HAVE_PERF_EVENTS
        select PERF_USE_VMALLOC
+       select HAVE_GENERIC_HARDIRQS
 
 config ARCH_DEFCONFIG
        string
@@ -107,10 +108,6 @@ config NEED_PER_CPU_EMBED_FIRST_CHUNK
 config NEED_PER_CPU_PAGE_FIRST_CHUNK
        def_bool y if SPARC64
 
-config GENERIC_HARDIRQS_NO__DO_IRQ
-       bool
-       def_bool y if SPARC64
-
 config MMU
        bool
        default y
@@ -276,10 +273,6 @@ config HOTPLUG_CPU
          can be controlled through /sys/devices/system/cpu/cpu#.
          Say N if you want to disable CPU hotplug.
 
-config GENERIC_HARDIRQS
-       bool
-       default y if SPARC64
-
 source "kernel/time/Kconfig"
 
 if SPARC64
index e11b5fcb70ebe07d0bf7fd677a9c61943728d169..08948e4e1503fd64524437a9ef3fdf3dde0b5724 100644 (file)
@@ -1,24 +1,33 @@
 # For a description of the syntax of this configuration file,
 # see Documentation/kbuild/config-language.txt.
 
-config MMU
-       def_bool y
-
-config GENERIC_CSUM
-       def_bool y
-
-config GENERIC_HARDIRQS
+config TILE
        def_bool y
+       select HAVE_KVM if !TILEGX
+       select GENERIC_FIND_FIRST_BIT
+       select GENERIC_FIND_NEXT_BIT
+       select USE_GENERIC_SMP_HELPERS
+       select CC_OPTIMIZE_FOR_SIZE
+       select HAVE_GENERIC_HARDIRQS
+       select GENERIC_IRQ_PROBE
+       select GENERIC_PENDING_IRQ if SMP
 
-config GENERIC_HARDIRQS_NO__DO_IRQ
-       def_bool y
+# FIXME: investigate whether we need/want these options.
+#      select HAVE_IOREMAP_PROT
+#       select HAVE_OPTPROBES
+#       select HAVE_REGS_AND_STACK_ACCESS_API
+#       select HAVE_HW_BREAKPOINT
+#       select PERF_EVENTS
+#       select HAVE_USER_RETURN_NOTIFIER
+#       config NO_BOOTMEM
+#       config ARCH_SUPPORTS_DEBUG_PAGEALLOC
+#       config HUGETLB_PAGE_SIZE_VARIABLE
 
-config GENERIC_IRQ_PROBE
+config MMU
        def_bool y
 
-config GENERIC_PENDING_IRQ
+config GENERIC_CSUM
        def_bool y
-       depends on GENERIC_HARDIRQS && SMP
 
 config SEMAPHORE_SLEEPERS
        def_bool y
@@ -97,26 +106,6 @@ config HVC_TILE
        select HVC_DRIVER
        def_bool y
 
-config TILE
-       def_bool y
-       select HAVE_KVM if !TILEGX
-       select GENERIC_FIND_FIRST_BIT
-       select GENERIC_FIND_NEXT_BIT
-       select USE_GENERIC_SMP_HELPERS
-       select CC_OPTIMIZE_FOR_SIZE
-
-# FIXME: investigate whether we need/want these options.
-#      select HAVE_IOREMAP_PROT
-#       select HAVE_OPTPROBES
-#       select HAVE_REGS_AND_STACK_ACCESS_API
-#       select HAVE_HW_BREAKPOINT
-#       select PERF_EVENTS
-#       select HAVE_USER_RETURN_NOTIFIER
-#       config NO_BOOTMEM
-#       config ARCH_SUPPORTS_DEBUG_PAGEALLOC
-#       config HUGETLB_PAGE_SIZE_VARIABLE
-
-
 # Please note: TILE-Gx support is not yet finalized; this is
 # the preliminary support.  TILE-Gx drivers are only provided
 # with the alpha or beta test versions for Tilera customers.
@@ -220,7 +209,7 @@ config FORCE_MAX_ZONEORDER
 
 choice
        depends on !TILEGX
-       prompt "Memory split" if EMBEDDED
+       prompt "Memory split" if EXPERT
        default VMSPLIT_3G
        ---help---
          Select the desired split between kernel and user memory.
index a81f0fbf7e602ff12ede15e42e8f7ba869ffded1..9bc161a02c71ba65ef8e1394cb1617738533bd9e 100644 (file)
@@ -3,7 +3,7 @@ menu "Kernel hacking"
 source "lib/Kconfig.debug"
 
 config EARLY_PRINTK
-       bool "Early printk" if EMBEDDED && DEBUG_KERNEL
+       bool "Early printk" if EXPERT && DEBUG_KERNEL
        default y
        help
          Write kernel log output directly via the hypervisor console.
index 919c54afd98112c80760c4ec54799a4beb18a48f..0fe54445fda51ed21f14c73b47aef7e0000b4099 100644 (file)
@@ -3,7 +3,7 @@ CONFIG_EXPERIMENTAL=y
 CONFIG_SYSVIPC=y
 CONFIG_BLK_DEV_INITRD=y
 CONFIG_INITRAMFS_SOURCE="usr/contents.txt"
-CONFIG_EMBEDDED=y
+CONFIG_EXPERT=y
 # CONFIG_COMPAT_BRK is not set
 CONFIG_PROFILING=y
 CONFIG_MODULES=y
index 049d048b070d7ed5d2d7db2ddd9464a91f02626a..e351e14b433909e6b83e36bba70d86bf04918c3b 100644 (file)
@@ -3,14 +3,10 @@ config DEFCONFIG_LIST
        option defconfig_list
        default "arch/$ARCH/defconfig"
 
-# UML uses the generic IRQ subsystem
-config GENERIC_HARDIRQS
-       bool
-       default y
-
 config UML
        bool
        default y
+       select HAVE_GENERIC_HARDIRQS
 
 config MMU
        bool
index f8d1d0d47fe6b1a05c67f48e85051f4c50f6c13c..90a438acbfafcf00aa8281f03ca44228250189e4 100644 (file)
@@ -120,9 +120,6 @@ config SMP
 
          If you don't know what to do, say N.
 
-config GENERIC_HARDIRQS_NO__DO_IRQ
-       def_bool y
-
 config NR_CPUS
        int "Maximum number of CPUs (2-32)"
        range 2 32
index 564f3de65b4ae129675fc82c56feebb635fc9279..9f7634f08cf3da9c76419ec9e9296a04e0cfcd7d 100644 (file)
@@ -133,7 +133,7 @@ CONFIG_SYSFS_DEPRECATED=y
 # CONFIG_BLK_DEV_INITRD is not set
 CONFIG_CC_OPTIMIZE_FOR_SIZE=y
 CONFIG_SYSCTL=y
-# CONFIG_EMBEDDED is not set
+# CONFIG_EXPERT is not set
 CONFIG_UID16=y
 CONFIG_SYSCTL_SYSCALL=y
 CONFIG_KALLSYMS=y
index 3ed5ad92b029a09bb6c30823ae3472c14107e831..d5ed94d30aadf056130464e5184461654c99ad8a 100644 (file)
@@ -627,11 +627,11 @@ config APB_TIMER
          as it is off-chip. APB timers are always running regardless of CPU
          C states, they are used as per CPU clockevent device when possible.
 
-# Mark as embedded because too many people got it wrong.
+# Mark as expert because too many people got it wrong.
 # The code disables itself when not needed.
 config DMI
        default y
-       bool "Enable DMI scanning" if EMBEDDED
+       bool "Enable DMI scanning" if EXPERT
        ---help---
          Enabled scanning of DMI to identify machine quirks. Say Y
          here unless you have verified that your setup is not
@@ -639,7 +639,7 @@ config DMI
          BIOS code.
 
 config GART_IOMMU
-       bool "GART IOMMU support" if EMBEDDED
+       bool "GART IOMMU support" if EXPERT
        default y
        select SWIOTLB
        depends on X86_64 && PCI && AMD_NB
@@ -889,7 +889,7 @@ config X86_THERMAL_VECTOR
        depends on X86_MCE_INTEL
 
 config VM86
-       bool "Enable VM86 support" if EMBEDDED
+       bool "Enable VM86 support" if EXPERT
        default y
        depends on X86_32
        ---help---
@@ -1073,7 +1073,7 @@ endchoice
 
 choice
        depends on EXPERIMENTAL
-       prompt "Memory split" if EMBEDDED
+       prompt "Memory split" if EXPERT
        default VMSPLIT_3G
        depends on X86_32
        ---help---
@@ -1135,7 +1135,7 @@ config ARCH_DMA_ADDR_T_64BIT
        def_bool X86_64 || HIGHMEM64G
 
 config DIRECT_GBPAGES
-       bool "Enable 1GB pages for kernel pagetables" if EMBEDDED
+       bool "Enable 1GB pages for kernel pagetables" if EXPERT
        default y
        depends on X86_64
        ---help---
@@ -1369,7 +1369,7 @@ config MATH_EMULATION
 
 config MTRR
        def_bool y
-       prompt "MTRR (Memory Type Range Register) support" if EMBEDDED
+       prompt "MTRR (Memory Type Range Register) support" if EXPERT
        ---help---
          On Intel P6 family processors (Pentium Pro, Pentium II and later)
          the Memory Type Range Registers (MTRRs) may be used to control
@@ -1435,7 +1435,7 @@ config MTRR_SANITIZER_SPARE_REG_NR_DEFAULT
 
 config X86_PAT
        def_bool y
-       prompt "x86 PAT support" if EMBEDDED
+       prompt "x86 PAT support" if EXPERT
        depends on MTRR
        ---help---
          Use PAT attributes to setup page level cache control.
@@ -1539,7 +1539,7 @@ config KEXEC_JUMP
          code in physical address mode via KEXEC
 
 config PHYSICAL_START
-       hex "Physical address where the kernel is loaded" if (EMBEDDED || CRASH_DUMP)
+       hex "Physical address where the kernel is loaded" if (EXPERT || CRASH_DUMP)
        default "0x1000000"
        ---help---
          This gives the physical address where the kernel is loaded.
@@ -1934,7 +1934,7 @@ config PCI_MMCONFIG
        depends on X86_64 && PCI && ACPI
 
 config PCI_CNB20LE_QUIRK
-       bool "Read CNB20LE Host Bridge Windows" if EMBEDDED
+       bool "Read CNB20LE Host Bridge Windows" if EXPERT
        default n
        depends on PCI && EXPERIMENTAL
        help
index 15588a0ef4663054dc33d623e373f8edce90432a..283c5a6a03a6536d5b171830d0474ecc9849aff0 100644 (file)
@@ -424,7 +424,7 @@ config X86_DEBUGCTLMSR
        depends on !(MK6 || MWINCHIPC6 || MWINCHIP3D || MCYRIXIII || M586MMX || M586TSC || M586 || M486 || M386) && !UML
 
 menuconfig PROCESSOR_SELECT
-       bool "Supported processor vendors" if EMBEDDED
+       bool "Supported processor vendors" if EXPERT
        ---help---
          This lets you choose what x86 vendor support code your kernel
          will include.
index 45143bbcfe5e487d53e33bddaa7193ab68a5275e..615e18810f4856e500b7964ffbfe82c78a843b20 100644 (file)
@@ -31,7 +31,7 @@ config X86_VERBOSE_BOOTUP
          see errors. Disable this if you want silent bootup.
 
 config EARLY_PRINTK
-       bool "Early printk" if EMBEDDED
+       bool "Early printk" if EXPERT
        default y
        ---help---
          Write kernel log output directly into the VGA buffer or to a serial
@@ -138,7 +138,7 @@ config DEBUG_NX_TEST
 
 config DOUBLEFAULT
        default y
-       bool "Enable doublefault exception handler" if EMBEDDED
+       bool "Enable doublefault exception handler" if EXPERT
        depends on X86_32
        ---help---
          This option allows trapping of rare doublefault exceptions that
index a37229011b56bc5c013610e85cb3a597d2b7a8ff..b0ef2b449a9d6cb360c65104c6a207f4bdad505a 100644 (file)
@@ -1,6 +1,8 @@
 #ifndef _ASM_X86_NUMA_32_H
 #define _ASM_X86_NUMA_32_H
 
+extern int numa_off;
+
 extern int pxm_to_nid(int pxm);
 extern void numa_remove_cpu(int cpu);
 
index 5ae87285a502418f32cebb3f0fc08264ca1060ba..0493be39607cfac8dd2dad1715aa3d06832a1fa5 100644 (file)
@@ -40,6 +40,7 @@ extern void __cpuinit numa_remove_cpu(int cpu);
 #ifdef CONFIG_NUMA_EMU
 #define FAKE_NODE_MIN_SIZE     ((u64)32 << 20)
 #define FAKE_NODE_MIN_HASH_MASK        (~(FAKE_NODE_MIN_SIZE - 1UL))
+void numa_emu_cmdline(char *);
 #endif /* CONFIG_NUMA_EMU */
 #else
 static inline void init_cpu_to_node(void)              { }
index 8ee45167e8176d4a73814732428fad90f76c2966..3788f4649db45427e80fd5a170942a984fe61514 100644 (file)
@@ -414,8 +414,6 @@ do {                                                                        \
 #define this_cpu_xchg_1(pcp, nval)     percpu_xchg_op(pcp, nval)
 #define this_cpu_xchg_2(pcp, nval)     percpu_xchg_op(pcp, nval)
 #define this_cpu_xchg_4(pcp, nval)     percpu_xchg_op(pcp, nval)
-#define this_cpu_xchg_8(pcp, nval)     percpu_xchg_op(pcp, nval)
-#define this_cpu_cmpxchg_8(pcp, oval, nval)    percpu_cmpxchg_op(pcp, oval, nval)
 
 #define irqsafe_cpu_add_1(pcp, val)    percpu_add_op((pcp), val)
 #define irqsafe_cpu_add_2(pcp, val)    percpu_add_op((pcp), val)
@@ -432,8 +430,6 @@ do {                                                                        \
 #define irqsafe_cpu_xchg_1(pcp, nval)  percpu_xchg_op(pcp, nval)
 #define irqsafe_cpu_xchg_2(pcp, nval)  percpu_xchg_op(pcp, nval)
 #define irqsafe_cpu_xchg_4(pcp, nval)  percpu_xchg_op(pcp, nval)
-#define irqsafe_cpu_xchg_8(pcp, nval)  percpu_xchg_op(pcp, nval)
-#define irqsafe_cpu_cmpxchg_8(pcp, oval, nval) percpu_cmpxchg_op(pcp, oval, nval)
 
 #ifndef CONFIG_M386
 #define __this_cpu_add_return_1(pcp, val) percpu_add_return_op(pcp, val)
@@ -475,11 +471,15 @@ do {                                                                      \
 #define this_cpu_or_8(pcp, val)                percpu_to_op("or", (pcp), val)
 #define this_cpu_xor_8(pcp, val)       percpu_to_op("xor", (pcp), val)
 #define this_cpu_add_return_8(pcp, val)        percpu_add_return_op(pcp, val)
+#define this_cpu_xchg_8(pcp, nval)     percpu_xchg_op(pcp, nval)
+#define this_cpu_cmpxchg_8(pcp, oval, nval)    percpu_cmpxchg_op(pcp, oval, nval)
 
 #define irqsafe_cpu_add_8(pcp, val)    percpu_add_op((pcp), val)
 #define irqsafe_cpu_and_8(pcp, val)    percpu_to_op("and", (pcp), val)
 #define irqsafe_cpu_or_8(pcp, val)     percpu_to_op("or", (pcp), val)
 #define irqsafe_cpu_xor_8(pcp, val)    percpu_to_op("xor", (pcp), val)
+#define irqsafe_cpu_xchg_8(pcp, nval)  percpu_xchg_op(pcp, nval)
+#define irqsafe_cpu_cmpxchg_8(pcp, oval, nval) percpu_cmpxchg_op(pcp, oval, nval)
 #endif
 
 /* This is not atomic against other CPUs -- CPU preemption needs to be off */
index 48ff6dcffa02774d4921331011dbcf6fe9070bc3..9974d21048fd3c0aee10b5ade01d9d9e421cfc67 100644 (file)
@@ -129,8 +129,7 @@ void __cpuinit irq_ctx_init(int cpu)
        irqctx = page_address(alloc_pages_node(cpu_to_node(cpu),
                                               THREAD_FLAGS,
                                               THREAD_ORDER));
-       irqctx->tinfo.task              = NULL;
-       irqctx->tinfo.exec_domain       = NULL;
+       memset(&irqctx->tinfo, 0, sizeof(struct thread_info));
        irqctx->tinfo.cpu               = cpu;
        irqctx->tinfo.preempt_count     = HARDIRQ_OFFSET;
        irqctx->tinfo.addr_limit        = MAKE_MM_SEG(0);
@@ -140,10 +139,8 @@ void __cpuinit irq_ctx_init(int cpu)
        irqctx = page_address(alloc_pages_node(cpu_to_node(cpu),
                                               THREAD_FLAGS,
                                               THREAD_ORDER));
-       irqctx->tinfo.task              = NULL;
-       irqctx->tinfo.exec_domain       = NULL;
+       memset(&irqctx->tinfo, 0, sizeof(struct thread_info));
        irqctx->tinfo.cpu               = cpu;
-       irqctx->tinfo.preempt_count     = 0;
        irqctx->tinfo.addr_limit        = MAKE_MM_SEG(0);
 
        per_cpu(softirq_ctx, cpu) = irqctx;
index 38718041efc34fbf6d8f120fe90e26b6d37abbaa..6e121a2a49e1b672fc8c191ae8c7ee40733076d0 100644 (file)
@@ -2,6 +2,7 @@ config LGUEST_GUEST
        bool "Lguest guest support"
        select PARAVIRT
        depends on X86_32
+       select VIRTUALIZATION
        select VIRTIO
        select VIRTIO_RING
        select VIRTIO_CONSOLE
index 4996cf5f73a07db446c2fe3e1c9fe7070662b741..eba687f0cc0cee1d630c6630e539d78f7b478836 100644 (file)
@@ -824,7 +824,7 @@ static void __init lguest_init_IRQ(void)
 
        for (i = FIRST_EXTERNAL_VECTOR; i < NR_VECTORS; i++) {
                /* Some systems map "vectors" to interrupts weirdly.  Not us! */
-               __get_cpu_var(vector_irq)[i] = i - FIRST_EXTERNAL_VECTOR;
+               __this_cpu_write(vector_irq[i], i - FIRST_EXTERNAL_VECTOR);
                if (i != SYSCALL_VECTOR)
                        set_intr_gate(i, interrupt[i - FIRST_EXTERNAL_VECTOR]);
        }
index 787c52ca49c3cf54dcb7cdc5712275d586460252..ebf6d7887a38fa54481b6b7645e42bb7c59499a7 100644 (file)
@@ -2,6 +2,28 @@
 #include <linux/topology.h>
 #include <linux/module.h>
 #include <linux/bootmem.h>
+#include <asm/numa.h>
+#include <asm/acpi.h>
+
+int __initdata numa_off;
+
+static __init int numa_setup(char *opt)
+{
+       if (!opt)
+               return -EINVAL;
+       if (!strncmp(opt, "off", 3))
+               numa_off = 1;
+#ifdef CONFIG_NUMA_EMU
+       if (!strncmp(opt, "fake=", 5))
+               numa_emu_cmdline(opt + 5);
+#endif
+#ifdef CONFIG_ACPI_NUMA
+       if (!strncmp(opt, "noacpi", 6))
+               acpi_numa = -1;
+#endif
+       return 0;
+}
+early_param("numa", numa_setup);
 
 /*
  * Which logical CPUs are on which nodes
index 1e72102e80c93348b9aaed53874b02546b03e624..95ea1551eebca344bee38ebc160ba8f3057c1734 100644 (file)
@@ -30,7 +30,6 @@ s16 apicid_to_node[MAX_LOCAL_APIC] __cpuinitdata = {
        [0 ... MAX_LOCAL_APIC-1] = NUMA_NO_NODE
 };
 
-int numa_off __initdata;
 static unsigned long __initdata nodemap_addr;
 static unsigned long __initdata nodemap_size;
 
@@ -263,6 +262,11 @@ static struct bootnode nodes[MAX_NUMNODES] __initdata;
 static struct bootnode physnodes[MAX_NUMNODES] __cpuinitdata;
 static char *cmdline __initdata;
 
+void __init numa_emu_cmdline(char *str)
+{
+       cmdline = str;
+}
+
 static int __init setup_physnodes(unsigned long start, unsigned long end,
                                        int acpi, int amd)
 {
@@ -670,24 +674,6 @@ unsigned long __init numa_free_all_bootmem(void)
        return pages;
 }
 
-static __init int numa_setup(char *opt)
-{
-       if (!opt)
-               return -EINVAL;
-       if (!strncmp(opt, "off", 3))
-               numa_off = 1;
-#ifdef CONFIG_NUMA_EMU
-       if (!strncmp(opt, "fake=", 5))
-               cmdline = opt + 5;
-#endif
-#ifdef CONFIG_ACPI_NUMA
-       if (!strncmp(opt, "noacpi", 6))
-               acpi_numa = -1;
-#endif
-       return 0;
-}
-early_param("numa", numa_setup);
-
 #ifdef CONFIG_NUMA
 
 static __init int find_near_online_node(int node)
index f16434568a51da26ea8524ae11fa84f0c7405717..ae96e7b8051d0c46e786e0ef80581ae331c3f01a 100644 (file)
@@ -59,7 +59,6 @@ static struct node_memory_chunk_s __initdata node_memory_chunk[MAXCHUNKS];
 static int __initdata num_memory_chunks; /* total number of memory chunks */
 static u8 __initdata apicid_to_pxm[MAX_APICID];
 
-int numa_off __initdata;
 int acpi_numa __initdata;
 
 static __init void bad_srat(void)
index 7e8d3bc80af6969b5ae5e1a35ab15463000fd7eb..50542efe45fbbc9313e8d66670d99ce573d682a6 100644 (file)
@@ -1194,7 +1194,7 @@ asmlinkage void __init xen_start_kernel(void)
        per_cpu(xen_vcpu, 0) = &HYPERVISOR_shared_info->vcpu_info[0];
 
        local_irq_disable();
-       early_boot_irqs_off();
+       early_boot_irqs_disabled = true;
 
        memblock_init();
 
index 9d30105a0c4a8e79bfb4020e57645720a6d1ef5b..6a6fe8939645f948e248cbaf21933675899b5c62 100644 (file)
@@ -126,7 +126,7 @@ static const struct pv_irq_ops xen_irq_ops __initdata = {
 #endif
 };
 
-void __init xen_init_irq_ops()
+void __init xen_init_irq_ops(void)
 {
        pv_irq_ops = xen_irq_ops;
        x86_init.irqs.intr_init = xen_init_IRQ;
index 8f2251d2a3f805b1f0128782e74260d7a3082545..ddc81a06edb94dc2ce306eb93cb136f59b6edfef 100644 (file)
@@ -237,7 +237,25 @@ void __init xen_build_dynamic_phys_to_machine(void)
                        p2m_top[topidx] = mid;
                }
 
-               p2m_top[topidx][mididx] = &mfn_list[pfn];
+               /*
+                * As long as the mfn_list has enough entries to completely
+                * fill a p2m page, pointing into the array is ok. But if
+                * not the entries beyond the last pfn will be undefined.
+                * And guessing that the 'what-ever-there-is' does not take it
+                * too kindly when changing it to invalid markers, a new page
+                * is allocated, initialized and filled with the valid part.
+                */
+               if (unlikely(pfn + P2M_PER_PAGE > max_pfn)) {
+                       unsigned long p2midx;
+                       unsigned long *p2m = extend_brk(PAGE_SIZE, PAGE_SIZE);
+                       p2m_init(p2m);
+
+                       for (p2midx = 0; pfn + p2midx < max_pfn; p2midx++) {
+                               p2m[p2midx] = mfn_list[pfn + p2midx];
+                       }
+                       p2m_top[topidx][mididx] = p2m;
+               } else
+                       p2m_top[topidx][mididx] = &mfn_list[pfn];
        }
 
        m2p_override_init();
index 1d230ee081b40c66668507e06aa0f527d5893e33..b90038e40dd377b60c1f7c82a23eac923d9860ec 100644 (file)
@@ -32,7 +32,7 @@ CONFIG_LOG_BUF_SHIFT=14
 # CONFIG_HOTPLUG is not set
 CONFIG_KOBJECT_UEVENT=y
 # CONFIG_IKCONFIG is not set
-# CONFIG_EMBEDDED is not set
+# CONFIG_EXPERT is not set
 CONFIG_KALLSYMS=y
 # CONFIG_KALLSYMS_ALL is not set
 # CONFIG_KALLSYMS_EXTRA_PASS is not set
index 7368164843b9d6596fd8fe9909d0fbf810e9afb0..0234cd198c547d7d604f82131f3c712c3eab4f40 100644 (file)
@@ -55,7 +55,7 @@ CONFIG_LOG_BUF_SHIFT=14
 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
 CONFIG_SYSCTL=y
 CONFIG_ANON_INODES=y
-CONFIG_EMBEDDED=y
+CONFIG_EXPERT=y
 CONFIG_SYSCTL_SYSCALL=y
 CONFIG_KALLSYMS=y
 # CONFIG_KALLSYMS_ALL is not set
index bb84fbc9921f903028bc475a73c3ade4df128581..095cd8084164506314f50d7b54dfdd54e33c9f34 100644 (file)
@@ -55,7 +55,7 @@ CONFIG_BLK_DEV_INITRD=y
 CONFIG_INITRAMFS_SOURCE=""
 CONFIG_CC_OPTIMIZE_FOR_SIZE=y
 CONFIG_SYSCTL=y
-CONFIG_EMBEDDED=y
+CONFIG_EXPERT=y
 CONFIG_SYSCTL_SYSCALL=y
 CONFIG_KALLSYMS=y
 # CONFIG_KALLSYMS_ALL is not set
index 6c9213ef15a1d69e83b381f88ce76d0d915eac02..60be1e0455daddb636998a03eb6d47e60d1eae81 100644 (file)
@@ -2,7 +2,7 @@
 # Block layer core configuration
 #
 menuconfig BLOCK
-       bool "Enable the block layer" if EMBEDDED
+       bool "Enable the block layer" if EXPERT
        default y
        help
         Provide block layer support for the kernel.
index 7eb35f479461eb13e6f9578de8bb1184742f004b..b423bb16c3a8d1b7ea1d82e3c6d9f1238590e24c 100644 (file)
@@ -24,7 +24,7 @@ obj-$(CONFIG_XEN)             += xen/
 # regulators early, since some subsystems rely on them to initialize
 obj-$(CONFIG_REGULATOR)                += regulator/
 
-# char/ comes before serial/ etc so that the VT console is the boot-time
+# tty/ comes before char/ so that the VT console is the boot-time
 # default.
 obj-y                          += tty/
 obj-y                          += char/
@@ -38,7 +38,6 @@ obj-$(CONFIG_CONNECTOR)               += connector/
 obj-$(CONFIG_FB_I810)           += video/i810/
 obj-$(CONFIG_FB_INTEL)          += video/intelfb/
 
-obj-y                          += serial/
 obj-$(CONFIG_PARPORT)          += parport/
 obj-y                          += base/ block/ misc/ mfd/ nfc/
 obj-$(CONFIG_NUBUS)            += nubus/
index 10c7ad59c0e1bac4df5abb550feafe323b6da2e1..2aa042a5da6d06c05e29de99419e0322c77414a6 100644 (file)
@@ -318,7 +318,7 @@ config ACPI_PCI_SLOT
          the module will be called pci_slot.
 
 config X86_PM_TIMER
-       bool "Power Management Timer Support" if EMBEDDED
+       bool "Power Management Timer Support" if EXPERT
        depends on X86
        default y
        help
index 3e50c74ed4a1e5b3c5880d15f7b4025f3e5041af..e0ba17f0a7c89acc590ab487e5c51c1360697579 100644 (file)
@@ -5,7 +5,7 @@
  *****************************************************************************/
 
 /*
- * Copyright (C) 2000 - 2010, Intel Corp.
+ * Copyright (C) 2000 - 2011, Intel Corp.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
index b17d8de9f6ffd5c98b7f02f610c8bc0ce1248ace..ab87396c2c07452c2f6b8485591103a6280d9b10 100644 (file)
@@ -5,7 +5,7 @@
  *****************************************************************************/
 
 /*
- * Copyright (C) 2000 - 2010, Intel Corp.
+ * Copyright (C) 2000 - 2011, Intel Corp.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
index 72e9d5eb083cf09c3b9d0c55850f9c362b175fa0..eb0b1f8dee6dca011b447504b7654ca5243b3f63 100644 (file)
@@ -5,7 +5,7 @@
  *****************************************************************************/
 
 /*
- * Copyright (C) 2000 - 2010, Intel Corp.
+ * Copyright (C) 2000 - 2011, Intel Corp.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
index 894a0ff2a94681e9653cf95659cf19823444e2d2..666271b65418b4d0be228a3009e8c4913043b54e 100644 (file)
@@ -5,7 +5,7 @@
  *****************************************************************************/
 
 /*
- * Copyright (C) 2000 - 2010, Intel Corp.
+ * Copyright (C) 2000 - 2011, Intel Corp.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
index 70e0b28801aa0bffc0ceafb7d1defa576eda9111..41d247daf461bd63a8b6abe6e1974106d57b334b 100644 (file)
@@ -5,7 +5,7 @@
  *****************************************************************************/
 
 /*
- * Copyright (C) 2000 - 2010, Intel Corp.
+ * Copyright (C) 2000 - 2011, Intel Corp.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
index 0e4dba0d0325329da4c4ebb508c4978c1094190f..82a1bd283db84208080aeb657ebe22ec869e78c7 100644 (file)
@@ -5,7 +5,7 @@
  *****************************************************************************/
 
 /*
- * Copyright (C) 2000 - 2010, Intel Corp.
+ * Copyright (C) 2000 - 2011, Intel Corp.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
index 258d628793eae2476cab0a7f9f8ec2ab5d53f651..e7213beaafc7914322f72520d40bcfd437b4ea5b 100644 (file)
@@ -5,7 +5,7 @@
  *****************************************************************************/
 
 /*
- * Copyright (C) 2000 - 2010, Intel Corp.
+ * Copyright (C) 2000 - 2011, Intel Corp.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
index 049e203bd62196e46d81cab6ab66c776479f5f70..3731e1c34b83b5d75ab25f08d0eefb706d7f85bc 100644 (file)
@@ -5,7 +5,7 @@
  *****************************************************************************/
 
 /*
- * Copyright (C) 2000 - 2010, Intel Corp.
+ * Copyright (C) 2000 - 2011, Intel Corp.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
index 74000f5b7daba14c0f1f3e364d02bf3694b7a020..54784bb42ceca0386be233e0f2653867d5c7bf90 100644 (file)
@@ -5,7 +5,7 @@
  *****************************************************************************/
 
 /*
- * Copyright (C) 2000 - 2010, Intel Corp.
+ * Copyright (C) 2000 - 2011, Intel Corp.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
index 8d5c9e0a495f8ab231101e051f824f52e7d5480a..b7491ee1fba642447242705c5a7ba48c677cce94 100644 (file)
@@ -5,7 +5,7 @@
  *****************************************************************************/
 
 /*
- * Copyright (C) 2000 - 2010, Intel Corp.
+ * Copyright (C) 2000 - 2011, Intel Corp.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
index d44d3bc5b847363959fcf64e8d1751916d001c83..79a598c67fe3ad30ae599aacaefa2f776b6d0303 100644 (file)
@@ -5,7 +5,7 @@
  *****************************************************************************/
 
 /*
- * Copyright (C) 2000 - 2010, Intel Corp.
+ * Copyright (C) 2000 - 2011, Intel Corp.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
index 962a3ccff6fda012e10bfa9d6eed9adc7b2e4439..1055769f2f01ae97f4f69780fd93b1015512d870 100644 (file)
@@ -6,7 +6,7 @@
  *****************************************************************************/
 
 /*
- * Copyright (C) 2000 - 2010, Intel Corp.
+ * Copyright (C) 2000 - 2011, Intel Corp.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -97,8 +97,6 @@
 #define AOPOBJ_OBJECT_INITIALIZED   0x08       /* Region is initialized, _REG was run */
 #define AOPOBJ_SETUP_COMPLETE       0x10       /* Region setup is complete */
 #define AOPOBJ_INVALID              0x20       /* Host OS won't allow a Region address */
-#define AOPOBJ_MODULE_LEVEL         0x40       /* Method is actually module-level code */
-#define AOPOBJ_MODIFIED_NAMESPACE   0x80       /* Method modified the namespace */
 
 /******************************************************************************
  *
@@ -175,7 +173,7 @@ struct acpi_object_region {
 };
 
 struct acpi_object_method {
-       ACPI_OBJECT_COMMON_HEADER u8 method_flags;
+       ACPI_OBJECT_COMMON_HEADER u8 info_flags;
        u8 param_count;
        u8 sync_level;
        union acpi_operand_object *mutex;
@@ -183,13 +181,21 @@ struct acpi_object_method {
        union {
                ACPI_INTERNAL_METHOD implementation;
                union acpi_operand_object *handler;
-       } extra;
+       } dispatch;
 
        u32 aml_length;
        u8 thread_count;
        acpi_owner_id owner_id;
 };
 
+/* Flags for info_flags field above */
+
+#define ACPI_METHOD_MODULE_LEVEL        0x01   /* Method is actually module-level code */
+#define ACPI_METHOD_INTERNAL_ONLY       0x02   /* Method is implemented internally (_OSI) */
+#define ACPI_METHOD_SERIALIZED          0x04   /* Method is serialized */
+#define ACPI_METHOD_SERIALIZED_PENDING  0x08   /* Method is to be marked serialized */
+#define ACPI_METHOD_MODIFIED_NAMESPACE  0x10   /* Method modified the namespace */
+
 /******************************************************************************
  *
  * Objects that can be notified.  All share a common notify_info area.
index 8c15ff43f42b34ae639e51234ae2a2df8be187d1..bb2ccfad7376548569f99ed46653c4ee710f958e 100644 (file)
@@ -5,7 +5,7 @@
  *****************************************************************************/
 
 /*
- * Copyright (C) 2000 - 2010, Intel Corp.
+ * Copyright (C) 2000 - 2011, Intel Corp.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
index d0bb0fd3e57a8d6015784598e4c262e1dc33c3d5..5ea1e06afa20637b652f87cbe9ee60b91fb62023 100644 (file)
@@ -5,7 +5,7 @@
  *****************************************************************************/
 
 /*
- * Copyright (C) 2000 - 2010, Intel Corp.
+ * Copyright (C) 2000 - 2011, Intel Corp.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
index 10998d369ad08d027a6f61e8315597e223dbb561..94e73c97cf85a83eaf6be8ceae3c347abb68f40e 100644 (file)
@@ -6,7 +6,7 @@
  *****************************************************************************/
 
 /*
- * Copyright (C) 2000 - 2010, Intel Corp.
+ * Copyright (C) 2000 - 2011, Intel Corp.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
index 528bcbaf4ce76180dc434d9ea2e3714794d79686..f08b55b7f3a08f5dff5209ad52268e78b59cacc6 100644 (file)
@@ -5,7 +5,7 @@
  *****************************************************************************/
 
 /*
- * Copyright (C) 2000 - 2010, Intel Corp.
+ * Copyright (C) 2000 - 2011, Intel Corp.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
index 6e5dd97949fee3de2aa09bd6011a856d7d44e4d8..1623b245dde23b226ae70d1c8233e89425b507d2 100644 (file)
@@ -5,7 +5,7 @@
  *****************************************************************************/
 
 /*
- * Copyright (C) 2000 - 2010, Intel Corp.
+ * Copyright (C) 2000 - 2011, Intel Corp.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
index 62a576e3436137f3ae9abfae82b4ed97615af4a9..967f08124eba46ae53684bfd0347ca5da14f740f 100644 (file)
@@ -5,7 +5,7 @@
  *****************************************************************************/
 
 /*
- * Copyright (C) 2000 - 2010, Intel Corp.
+ * Copyright (C) 2000 - 2011, Intel Corp.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
index 72e4183c193777add40ddff637eaa87806330296..99c140d8e348b38c364c94352af16c86de7b164d 100644 (file)
@@ -5,7 +5,7 @@
  *****************************************************************************/
 
 /*
- * Copyright (C) 2000 - 2010, Intel Corp.
+ * Copyright (C) 2000 - 2011, Intel Corp.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
index 1f484ba228fc0c63e47402175dd7a9225e062c4a..f4f0998d3967ef86511de9b06adf37b6dcaa990f 100644 (file)
@@ -7,7 +7,7 @@
  *****************************************************************************/
 
 /*
- * Copyright (C) 2000 - 2010, Intel Corp.
+ * Copyright (C) 2000 - 2011, Intel Corp.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -480,16 +480,10 @@ typedef enum {
        AML_FIELD_ATTRIB_SMB_BLOCK_CALL = 0x0D
 } AML_ACCESS_ATTRIBUTE;
 
-/* Bit fields in method_flags byte */
+/* Bit fields in the AML method_flags byte */
 
 #define AML_METHOD_ARG_COUNT        0x07
 #define AML_METHOD_SERIALIZED       0x08
 #define AML_METHOD_SYNC_LEVEL       0xF0
 
-/* METHOD_FLAGS_ARG_COUNT is not used internally, define additional flags */
-
-#define AML_METHOD_INTERNAL_ONLY    0x01
-#define AML_METHOD_RESERVED1        0x02
-#define AML_METHOD_RESERVED2        0x04
-
 #endif                         /* __AMLCODE_H__ */
index 0e5798fcbb19d794d6766aa5c097907ddbfc4f75..59122cde247c2042e1121e6f33926eba1ec61cc1 100644 (file)
@@ -6,7 +6,7 @@
  *****************************************************************************/
 
 /*
- * Copyright (C) 2000 - 2010, Intel Corp.
+ * Copyright (C) 2000 - 2011, Intel Corp.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
index 347bee1726f1add50d50486634c7b46a957307d7..34be60c0e4484b880f6bf2da883e7ba1e7311ecd 100644 (file)
@@ -5,7 +5,7 @@
  *****************************************************************************/
 
 /*
- * Copyright (C) 2000 - 2010, Intel Corp.
+ * Copyright (C) 2000 - 2011, Intel Corp.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
index cc4a38c5755824f758a51e466c033c2b3440dd8a..a7718bf2b9a18a24e0bdee7554736caa07976c2b 100644 (file)
@@ -5,7 +5,7 @@
  *****************************************************************************/
 
 /*
- * Copyright (C) 2000 - 2010, Intel Corp.
+ * Copyright (C) 2000 - 2011, Intel Corp.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
index d94dd8974b55c5fb03845a52f64ec430c70a6ec1..5d797751e205b363a48e43b6484e2a9cc37fc317 100644 (file)
@@ -5,7 +5,7 @@
  *****************************************************************************/
 
 /*
- * Copyright (C) 2000 - 2010, Intel Corp.
+ * Copyright (C) 2000 - 2011, Intel Corp.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -43,7 +43,6 @@
 
 #include <acpi/acpi.h>
 #include "accommon.h"
-#include "amlcode.h"
 #include "acdispat.h"
 #include "acinterp.h"
 #include "acnamesp.h"
@@ -201,7 +200,7 @@ acpi_ds_begin_method_execution(struct acpi_namespace_node *method_node,
        /*
         * If this method is serialized, we need to acquire the method mutex.
         */
-       if (obj_desc->method.method_flags & AML_METHOD_SERIALIZED) {
+       if (obj_desc->method.info_flags & ACPI_METHOD_SERIALIZED) {
                /*
                 * Create a mutex for the method if it is defined to be Serialized
                 * and a mutex has not already been created. We defer the mutex creation
@@ -413,8 +412,9 @@ acpi_ds_call_control_method(struct acpi_thread_state *thread,
 
        /* Invoke an internal method if necessary */
 
-       if (obj_desc->method.method_flags & AML_METHOD_INTERNAL_ONLY) {
-               status = obj_desc->method.extra.implementation(next_walk_state);
+       if (obj_desc->method.info_flags & ACPI_METHOD_INTERNAL_ONLY) {
+               status =
+                   obj_desc->method.dispatch.implementation(next_walk_state);
                if (status == AE_OK) {
                        status = AE_CTRL_TERMINATE;
                }
@@ -579,11 +579,14 @@ acpi_ds_terminate_control_method(union acpi_operand_object *method_desc,
 
                /*
                 * Delete any namespace objects created anywhere within the
-                * namespace by the execution of this method. Unless this method
-                * is a module-level executable code method, in which case we
-                * want make the objects permanent.
+                * namespace by the execution of this method. Unless:
+                * 1) This method is a module-level executable code method, in which
+                *    case we want make the objects permanent.
+                * 2) There are other threads executing the method, in which case we
+                *    will wait until the last thread has completed.
                 */
-               if (!(method_desc->method.flags & AOPOBJ_MODULE_LEVEL)) {
+               if (!(method_desc->method.info_flags & ACPI_METHOD_MODULE_LEVEL)
+                   && (method_desc->method.thread_count == 1)) {
 
                        /* Delete any direct children of (created by) this method */
 
@@ -593,12 +596,17 @@ acpi_ds_terminate_control_method(union acpi_operand_object *method_desc,
                        /*
                         * Delete any objects that were created by this method
                         * elsewhere in the namespace (if any were created).
+                        * Use of the ACPI_METHOD_MODIFIED_NAMESPACE optimizes the
+                        * deletion such that we don't have to perform an entire
+                        * namespace walk for every control method execution.
                         */
                        if (method_desc->method.
-                           flags & AOPOBJ_MODIFIED_NAMESPACE) {
+                           info_flags & ACPI_METHOD_MODIFIED_NAMESPACE) {
                                acpi_ns_delete_namespace_by_owner(method_desc->
                                                                  method.
                                                                  owner_id);
+                               method_desc->method.info_flags &=
+                                   ~ACPI_METHOD_MODIFIED_NAMESPACE;
                        }
                }
        }
@@ -629,19 +637,43 @@ acpi_ds_terminate_control_method(union acpi_operand_object *method_desc,
                 * Serialized if it appears that the method is incorrectly written and
                 * does not support multiple thread execution. The best example of this
                 * is if such a method creates namespace objects and blocks. A second
-                * thread will fail with an AE_ALREADY_EXISTS exception
+                * thread will fail with an AE_ALREADY_EXISTS exception.
                 *
                 * This code is here because we must wait until the last thread exits
-                * before creating the synchronization semaphore.
+                * before marking the method as serialized.
                 */
-               if ((method_desc->method.method_flags & AML_METHOD_SERIALIZED)
-                   && (!method_desc->method.mutex)) {
-                       (void)acpi_ds_create_method_mutex(method_desc);
+               if (method_desc->method.
+                   info_flags & ACPI_METHOD_SERIALIZED_PENDING) {
+                       if (walk_state) {
+                               ACPI_INFO((AE_INFO,
+                                          "Marking method %4.4s as Serialized because of AE_ALREADY_EXISTS error",
+                                          walk_state->method_node->name.
+                                          ascii));
+                       }
+
+                       /*
+                        * Method tried to create an object twice and was marked as
+                        * "pending serialized". The probable cause is that the method
+                        * cannot handle reentrancy.
+                        *
+                        * The method was created as not_serialized, but it tried to create
+                        * a named object and then blocked, causing the second thread
+                        * entrance to begin and then fail. Workaround this problem by
+                        * marking the method permanently as Serialized when the last
+                        * thread exits here.
+                        */
+                       method_desc->method.info_flags &=
+                           ~ACPI_METHOD_SERIALIZED_PENDING;
+                       method_desc->method.info_flags |=
+                           ACPI_METHOD_SERIALIZED;
+                       method_desc->method.sync_level = 0;
                }
 
                /* No more threads, we can free the owner_id */
 
-               if (!(method_desc->method.flags & AOPOBJ_MODULE_LEVEL)) {
+               if (!
+                   (method_desc->method.
+                    info_flags & ACPI_METHOD_MODULE_LEVEL)) {
                        acpi_ut_release_owner_id(&method_desc->method.owner_id);
                }
        }
index 8095306fcd8c6d3ee246a44f9a41306e37e7fa9f..905ce29a92e1784c82430c64e527d536e1c7f579 100644 (file)
@@ -5,7 +5,7 @@
  ******************************************************************************/
 
 /*
- * Copyright (C) 2000 - 2010, Intel Corp.
+ * Copyright (C) 2000 - 2011, Intel Corp.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
index 8e85f54a8e0ef396ed6d045f84a6f86587e34af0..f42e17e5c252cc98331da46b45270090b093195c 100644 (file)
@@ -5,7 +5,7 @@
  *****************************************************************************/
 
 /*
- * Copyright (C) 2000 - 2010, Intel Corp.
+ * Copyright (C) 2000 - 2011, Intel Corp.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
index 7c0e742271712a95ec20ff24a8e3d794442aa91a..bbecf293aeebfcd8729a2d9b43404e187af7c17b 100644 (file)
@@ -6,7 +6,7 @@
  *****************************************************************************/
 
 /*
- * Copyright (C) 2000 - 2010, Intel Corp.
+ * Copyright (C) 2000 - 2011, Intel Corp.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
index 15135c25aa9bc38e2e83f0ad70e0310c0d519381..2c477ce172fad15d44218da1cc66e3377822590e 100644 (file)
@@ -5,7 +5,7 @@
  ******************************************************************************/
 
 /*
- * Copyright (C) 2000 - 2010, Intel Corp.
+ * Copyright (C) 2000 - 2011, Intel Corp.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
index 6b0b5d08d97acf12d35016c96ce0eaaaa0126627..fe40e4c6554f2554310e055cfd96a289c1bf0d89 100644 (file)
@@ -6,7 +6,7 @@
  *****************************************************************************/
 
 /*
- * Copyright (C) 2000 - 2010, Intel Corp.
+ * Copyright (C) 2000 - 2011, Intel Corp.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
index 140a9d0029599f9103751efce5821368c73cb3b8..52566ff5e9034bfbb91e06c9132bea52ec91ef8c 100644 (file)
@@ -5,7 +5,7 @@
  *****************************************************************************/
 
 /*
- * Copyright (C) 2000 - 2010, Intel Corp.
+ * Copyright (C) 2000 - 2011, Intel Corp.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
index d1e701709dac36b71afd0a1c68b2c936da27acfb..76a661fc1e0933cfa84aba0a6d90a449ac1e5da1 100644 (file)
@@ -5,7 +5,7 @@
  *****************************************************************************/
 
 /*
- * Copyright (C) 2000 - 2010, Intel Corp.
+ * Copyright (C) 2000 - 2011, Intel Corp.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
index 83155dd8671e739c7eeadaab9911b0404cc201df..a6c374ef9914e8bb57ad092498ba55feef512145 100644 (file)
@@ -5,7 +5,7 @@
  *****************************************************************************/
 
 /*
- * Copyright (C) 2000 - 2010, Intel Corp.
+ * Copyright (C) 2000 - 2011, Intel Corp.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
index e5e313c663a57190a03edfdb2e43db6d1302e6f0..d458b041e6510aec0c91cd4b20c0080147975524 100644 (file)
@@ -5,7 +5,7 @@
  *****************************************************************************/
 
 /*
- * Copyright (C) 2000 - 2010, Intel Corp.
+ * Copyright (C) 2000 - 2011, Intel Corp.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
index 7c339d34ab422dffe32028cb284513910390ddf3..14988a86066fb70eaf9985cc49fbe1ff5b99ab4c 100644 (file)
@@ -5,7 +5,7 @@
  *****************************************************************************/
 
 /*
- * Copyright (C) 2000 - 2010, Intel Corp.
+ * Copyright (C) 2000 - 2011, Intel Corp.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -471,6 +471,7 @@ static void ACPI_SYSTEM_XFACE acpi_ev_asynch_execute_gpe_method(void *context)
 
        status = acpi_ut_acquire_mutex(ACPI_MTX_EVENTS);
        if (ACPI_FAILURE(status)) {
+               ACPI_FREE(local_gpe_event_info);
                return_VOID;
        }
 
@@ -478,6 +479,7 @@ static void ACPI_SYSTEM_XFACE acpi_ev_asynch_execute_gpe_method(void *context)
 
        if (!acpi_ev_valid_gpe_event(gpe_event_info)) {
                status = acpi_ut_release_mutex(ACPI_MTX_EVENTS);
+               ACPI_FREE(local_gpe_event_info);
                return_VOID;
        }
 
index 9acb86958c099c0bd84703f6179528a63b90fcfd..ca2c41a5331177707e46bf7b0d4f9407e8a24478 100644 (file)
@@ -5,7 +5,7 @@
  *****************************************************************************/
 
 /*
- * Copyright (C) 2000 - 2010, Intel Corp.
+ * Copyright (C) 2000 - 2011, Intel Corp.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
index c59dc23405939b04492b897286202258933756a3..ce9aa9f9a9724e818d5d6e6fe568e35a3bf9d39c 100644 (file)
@@ -5,7 +5,7 @@
  *****************************************************************************/
 
 /*
- * Copyright (C) 2000 - 2010, Intel Corp.
+ * Copyright (C) 2000 - 2011, Intel Corp.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
index 10e477494dcf5fdedf4bd7ad787cdfc77587d1b4..80a81d0c4a80d36049aceac84b78ead5dffe0481 100644 (file)
@@ -5,7 +5,7 @@
  *****************************************************************************/
 
 /*
- * Copyright (C) 2000 - 2010, Intel Corp.
+ * Copyright (C) 2000 - 2011, Intel Corp.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
index 38bba66fcce554a62ed63b3f5afd76d7d18186ba..7dc80946f7bd3c0f10a09fb35b38d44f3f23d651 100644 (file)
@@ -5,7 +5,7 @@
  *****************************************************************************/
 
 /*
- * Copyright (C) 2000 - 2010, Intel Corp.
+ * Copyright (C) 2000 - 2011, Intel Corp.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
index 98fd210e87b28a31acb9e2cacf1014fa2d03796f..785a5ee64585eaad3c6a7f7101e475452d42467d 100644 (file)
@@ -5,7 +5,7 @@
  *****************************************************************************/
 
 /*
- * Copyright (C) 2000 - 2010, Intel Corp.
+ * Copyright (C) 2000 - 2011, Intel Corp.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
index 0b47a6dc92902f5333d3fc668597992a2bee24a1..9659cee6093e3f835caf4a082680d95f12bca97d 100644 (file)
@@ -5,7 +5,7 @@
  *****************************************************************************/
 
 /*
- * Copyright (C) 2000 - 2010, Intel Corp.
+ * Copyright (C) 2000 - 2011, Intel Corp.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -590,9 +590,9 @@ acpi_ev_initialize_region(union acpi_operand_object *region_obj,
                                 * See acpi_ns_exec_module_code
                                 */
                                if (obj_desc->method.
-                                   flags & AOPOBJ_MODULE_LEVEL) {
+                                   info_flags & ACPI_METHOD_MODULE_LEVEL) {
                                        handler_obj =
-                                           obj_desc->method.extra.handler;
+                                           obj_desc->method.dispatch.handler;
                                }
                                break;
 
index 8dfbaa96e422ad3f4760133b504c40d90704ebd0..2ebd40e1a3ef947ff7672afde21c6f211d33ae00 100644 (file)
@@ -6,7 +6,7 @@
  ******************************************************************************/
 
 /*
- * Copyright (C) 2000 - 2010, Intel Corp.
+ * Copyright (C) 2000 - 2011, Intel Corp.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
index 1226689bdb1b7bd2890ccf02c91a20ed2343463b..e1141402dbed1868e4e473e21fe0bf09b8521daf 100644 (file)
@@ -5,7 +5,7 @@
  *****************************************************************************/
 
 /*
- * Copyright (C) 2000 - 2010, Intel Corp.
+ * Copyright (C) 2000 - 2011, Intel Corp.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
index 90488c1e0f3dc475d949dc578c6275e925726dc9..c57b5c707a777647199012484e3bff977aff180b 100644 (file)
@@ -5,7 +5,7 @@
  *****************************************************************************/
 
 /*
- * Copyright (C) 2000 - 2010, Intel Corp.
+ * Copyright (C) 2000 - 2011, Intel Corp.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
index 416845bc9c1fc3691ea67af29662d1a1ae9c5d5e..e9562a7cb2f91e4ba9a53a51342e3711c6c3a2b1 100644 (file)
@@ -5,7 +5,7 @@
  *****************************************************************************/
 
 /*
- * Copyright (C) 2000 - 2010, Intel Corp.
+ * Copyright (C) 2000 - 2011, Intel Corp.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
index ce9314f79451ecf5a42e02486475a9bfeca54987..eb7386763712367d1814cecf1151f4acbd6e983b 100644 (file)
@@ -6,7 +6,7 @@
  *****************************************************************************/
 
 /*
- * Copyright (C) 2000 - 2010, Intel Corp.
+ * Copyright (C) 2000 - 2011, Intel Corp.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
index 18832205b631b4514941490f86adb308914dc10e..745a42b401f5030bc88b11b1b89aa2b21a455b14 100644 (file)
@@ -5,7 +5,7 @@
  *****************************************************************************/
 
 /*
- * Copyright (C) 2000 - 2010, Intel Corp.
+ * Copyright (C) 2000 - 2011, Intel Corp.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
index b73bc50c5b76f1d5309be80c310383bc425d5e0f..74162a11817dc9b6bff8e30ba2d039a7c1ec47a9 100644 (file)
@@ -5,7 +5,7 @@
  *****************************************************************************/
 
 /*
- * Copyright (C) 2000 - 2010, Intel Corp.
+ * Copyright (C) 2000 - 2011, Intel Corp.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
index 3c61b48c73f5512341a875fe023fe6df4698850d..e7b372d176671e02383788e31f8a3490aa1debc9 100644 (file)
@@ -5,7 +5,7 @@
  *****************************************************************************/
 
 /*
- * Copyright (C) 2000 - 2010, Intel Corp.
+ * Copyright (C) 2000 - 2011, Intel Corp.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -482,13 +482,11 @@ acpi_ex_create_method(u8 * aml_start,
        obj_desc->method.aml_length = aml_length;
 
        /*
-        * Disassemble the method flags. Split off the Arg Count
-        * for efficiency
+        * Disassemble the method flags. Split off the arg_count, Serialized
+        * flag, and sync_level for efficiency.
         */
        method_flags = (u8) operand[1]->integer.value;
 
-       obj_desc->method.method_flags =
-           (u8) (method_flags & ~AML_METHOD_ARG_COUNT);
        obj_desc->method.param_count =
            (u8) (method_flags & AML_METHOD_ARG_COUNT);
 
@@ -497,6 +495,8 @@ acpi_ex_create_method(u8 * aml_start,
         * created for this method when it is parsed.
         */
        if (method_flags & AML_METHOD_SERIALIZED) {
+               obj_desc->method.info_flags = ACPI_METHOD_SERIALIZED;
+
                /*
                 * ACPI 1.0: sync_level = 0
                 * ACPI 2.0: sync_level = sync_level in method declaration
index be8c98b480d7ad9f542dd1b0af83e7ae1f8956c3..c7a2f1edd28276389d0a61bc5674ea6ee7e89b5d 100644 (file)
@@ -5,7 +5,7 @@
  *****************************************************************************/
 
 /*
- * Copyright (C) 2000 - 2010, Intel Corp.
+ * Copyright (C) 2000 - 2011, Intel Corp.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
index f067bbb0d961f49c2ae75ea1c0d7e1b1b530d002..61b8c0e8b74d1b5bc115addeb1d04da535401b03 100644 (file)
@@ -5,7 +5,7 @@
  *****************************************************************************/
 
 /*
- * Copyright (C) 2000 - 2010, Intel Corp.
+ * Copyright (C) 2000 - 2011, Intel Corp.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -122,7 +122,7 @@ static struct acpi_exdump_info acpi_ex_dump_event[2] = {
 
 static struct acpi_exdump_info acpi_ex_dump_method[9] = {
        {ACPI_EXD_INIT, ACPI_EXD_TABLE_SIZE(acpi_ex_dump_method), NULL},
-       {ACPI_EXD_UINT8, ACPI_EXD_OFFSET(method.method_flags), "Method Flags"},
+       {ACPI_EXD_UINT8, ACPI_EXD_OFFSET(method.info_flags), "Info Flags"},
        {ACPI_EXD_UINT8, ACPI_EXD_OFFSET(method.param_count),
         "Parameter Count"},
        {ACPI_EXD_UINT8, ACPI_EXD_OFFSET(method.sync_level), "Sync Level"},
index f17d2ff0031bc8933822698a60392b50f621bf11..0bde2230c028ed0f0cc28689e98eacccd7a9bd8b 100644 (file)
@@ -5,7 +5,7 @@
  *****************************************************************************/
 
 /*
- * Copyright (C) 2000 - 2010, Intel Corp.
+ * Copyright (C) 2000 - 2011, Intel Corp.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
index 38293fd3e088bd008fd5f9855ff72b15766bdb35..6c79c29f082df60156a83560de03a04f3bacbc60 100644 (file)
@@ -5,7 +5,7 @@
  *****************************************************************************/
 
 /*
- * Copyright (C) 2000 - 2010, Intel Corp.
+ * Copyright (C) 2000 - 2011, Intel Corp.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
index 95db4be0877baeb2acd0a664ecdf46cc38ffeb68..703d88ed0b3df53dbcfede8511ee95e83d7658d4 100644 (file)
@@ -6,7 +6,7 @@
  *****************************************************************************/
 
 /*
- * Copyright (C) 2000 - 2010, Intel Corp.
+ * Copyright (C) 2000 - 2011, Intel Corp.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
index 6af14e43f8394be3f6657994eb42eda9e92fd067..be1c56ead6535e68b5b73bb22a3a9451506f840d 100644 (file)
@@ -6,7 +6,7 @@
  *****************************************************************************/
 
 /*
- * Copyright (C) 2000 - 2010, Intel Corp.
+ * Copyright (C) 2000 - 2011, Intel Corp.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
index d11e539ef76377c57a9b923bcb5338f3cce97180..49ec049c157e6b4e86e0d9b1de72f60fe9452b40 100644 (file)
@@ -6,7 +6,7 @@
  *****************************************************************************/
 
 /*
- * Copyright (C) 2000 - 2010, Intel Corp.
+ * Copyright (C) 2000 - 2011, Intel Corp.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
index 84e4d185aa255f16857f5942333cfd564dd8d3f7..236ead14b7f7a2c84f4b381bad84b468f2119456 100644 (file)
@@ -6,7 +6,7 @@
  *****************************************************************************/
 
 /*
- * Copyright (C) 2000 - 2010, Intel Corp.
+ * Copyright (C) 2000 - 2011, Intel Corp.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
index 10e104cf0fb9b6710af8132ef9cdc017bd235a0f..2571b4a310f4bd31119f506a6441877886c1390b 100644 (file)
@@ -5,7 +5,7 @@
  *****************************************************************************/
 
 /*
- * Copyright (C) 2000 - 2010, Intel Corp.
+ * Copyright (C) 2000 - 2011, Intel Corp.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
index 7a08d23befcd477fbff77dfc47cde724ac4f606a..1b48d9d28c9ae055b92e53a06302ae66a079b08f 100644 (file)
@@ -6,7 +6,7 @@
  *****************************************************************************/
 
 /*
- * Copyright (C) 2000 - 2010, Intel Corp.
+ * Copyright (C) 2000 - 2011, Intel Corp.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
index 4b50730cf9a0526c4ac6f4047376a7976a0081fc..f4a2787e8e92b1c178dbbf85b97e2c7218f2054f 100644 (file)
@@ -6,7 +6,7 @@
  *****************************************************************************/
 
 /*
- * Copyright (C) 2000 - 2010, Intel Corp.
+ * Copyright (C) 2000 - 2011, Intel Corp.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
index 7aae29f73d3f2dfbc5438ff874e05a7ff7855f5d..cc95e2000406c3a7a6ff6a9bf63b27752ce008fa 100644 (file)
@@ -6,7 +6,7 @@
  *****************************************************************************/
 
 /*
- * Copyright (C) 2000 - 2010, Intel Corp.
+ * Copyright (C) 2000 - 2011, Intel Corp.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
index de17e10da0ed9c5593e3e1d1af8bfd0d9dd81ee4..f0d5e14f1f2c0040ff84c18a9a0dbaa6e73bcbed 100644 (file)
@@ -6,7 +6,7 @@
  *****************************************************************************/
 
 /*
- * Copyright (C) 2000 - 2010, Intel Corp.
+ * Copyright (C) 2000 - 2011, Intel Corp.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
index 1fa4289a687e6f7202ae27c164342ca0bc198048..55997e46948bfed2843f4a603f3871223b8abb4a 100644 (file)
@@ -6,7 +6,7 @@
  *****************************************************************************/
 
 /*
- * Copyright (C) 2000 - 2010, Intel Corp.
+ * Copyright (C) 2000 - 2011, Intel Corp.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
index 7ca35ea8acea8affed084ca06e11212b9e1ff22c..db502cd7d9349c2e1b6617319023d3d9f1ed3a5a 100644 (file)
@@ -6,7 +6,7 @@
  *****************************************************************************/
 
 /*
- * Copyright (C) 2000 - 2010, Intel Corp.
+ * Copyright (C) 2000 - 2011, Intel Corp.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
index 8c97cfd6a0fdc7bd099113766f9d5ddddf1c7389..e3bb00ccdff5982338d5e422e3c4aa643523de1c 100644 (file)
@@ -6,7 +6,7 @@
  *****************************************************************************/
 
 /*
- * Copyright (C) 2000 - 2010, Intel Corp.
+ * Copyright (C) 2000 - 2011, Intel Corp.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
index 1624436ba4c5edbdd9d171272df4585f08407ee0..c0c8842dd344b088649c3bc041d2df787f645ba5 100644 (file)
@@ -5,7 +5,7 @@
  *****************************************************************************/
 
 /*
- * Copyright (C) 2000 - 2010, Intel Corp.
+ * Copyright (C) 2000 - 2011, Intel Corp.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
index d4af684620ca9e8307785518d49b793fb059c560..a979017d56b8e5cf23e7672574ed66f83c7b4a79 100644 (file)
@@ -7,7 +7,7 @@
  *****************************************************************************/
 
 /*
- * Copyright (C) 2000 - 2010, Intel Corp.
+ * Copyright (C) 2000 - 2011, Intel Corp.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
index e972b667b09b8c7b4874f80032ecd90e6526b128..dc665cc554de762c455f801f57d1e03673c85e9d 100644 (file)
@@ -6,7 +6,7 @@
  *****************************************************************************/
 
 /*
- * Copyright (C) 2000 - 2010, Intel Corp.
+ * Copyright (C) 2000 - 2011, Intel Corp.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
index 675aaa91a770f2a78d3e0f9e9ae134ccf95ae446..df66e7b686bec836ae4fb2e13e64ac0f21756473 100644 (file)
@@ -6,7 +6,7 @@
  *****************************************************************************/
 
 /*
- * Copyright (C) 2000 - 2010, Intel Corp.
+ * Copyright (C) 2000 - 2011, Intel Corp.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
index 4093522eed45692012b5da617c57187ef20c4458..8ad93146dd3282a984918a1a9b6a4b57b4e5ed41 100644 (file)
@@ -6,7 +6,7 @@
  *****************************************************************************/
 
 /*
- * Copyright (C) 2000 - 2010, Intel Corp.
+ * Copyright (C) 2000 - 2011, Intel Corp.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
index b44274a0b62c66fc0326d8f7b29b60ecee2ec384..fc380d3d45ab0f01ca413b7c6795532d65e45ca3 100644 (file)
@@ -6,7 +6,7 @@
  *****************************************************************************/
 
 /*
- * Copyright (C) 2000 - 2010, Intel Corp.
+ * Copyright (C) 2000 - 2011, Intel Corp.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
index 85c3cbd4304dedc9e63c4bd5854da2993edd3584..f610d88a66be86b823f6ceed6abd7e2876c3a81e 100644 (file)
@@ -6,7 +6,7 @@
  *****************************************************************************/
 
 /*
- * Copyright (C) 2000 - 2010, Intel Corp.
+ * Copyright (C) 2000 - 2011, Intel Corp.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
index ad21c7d8bf4fcb4b20cf379c3df7c8c67efc7f48..050fd227951b6835d3be95bfa828fbae7951a3d5 100644 (file)
@@ -5,7 +5,7 @@
  ******************************************************************************/
 
 /*
- * Copyright (C) 2000 - 2010, Intel Corp.
+ * Copyright (C) 2000 - 2011, Intel Corp.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
index 5d1273b660ae4f21d7fc9b2e2e56ecf392504ea7..55accb7018bb24776f32541fddfe7cf7498383f8 100644 (file)
@@ -7,7 +7,7 @@
  ******************************************************************************/
 
 /*
- * Copyright (C) 2000 - 2010, Intel Corp.
+ * Copyright (C) 2000 - 2011, Intel Corp.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
index 3796811276ac51e73104ff1baed329225dfd6ee8..2ac28bbe8827822f975755b3b7dd7cabab0882a3 100644 (file)
@@ -6,7 +6,7 @@
  *****************************************************************************/
 
 /*
- * Copyright (C) 2000 - 2010, Intel Corp.
+ * Copyright (C) 2000 - 2011, Intel Corp.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
index 1ef8e0bb250bd0dccbedd533e4229fedcb739086..9c8eb71a12fb41f8a09e9ac4e48a1b95daa68452 100644 (file)
@@ -6,7 +6,7 @@
  *****************************************************************************/
 
 /*
- * Copyright (C) 2000 - 2010, Intel Corp.
+ * Copyright (C) 2000 - 2011, Intel Corp.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
index e1d9c777b213a3f70b90e8a20f9dd5868a425c29..5f1605874655a2f425aa0c0abd79befcb9684a3c 100644 (file)
@@ -6,7 +6,7 @@
  *****************************************************************************/
 
 /*
- * Copyright (C) 2000 - 2010, Intel Corp.
+ * Copyright (C) 2000 - 2011, Intel Corp.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
index 50cc3be77724ce53eb3f611401f08bbe3b3a59b3..6f98d210e71c4f23ae4b3ccd01b84cc2574b2221 100644 (file)
@@ -6,7 +6,7 @@
  *****************************************************************************/
 
 /*
- * Copyright (C) 2000 - 2010, Intel Corp.
+ * Copyright (C) 2000 - 2011, Intel Corp.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
index 0cd925be5fc1383aa3ec0ca06b60895cff52443c..d93172fd15a8cfb38f7102cb799527a0f5a4b2ff 100644 (file)
@@ -5,7 +5,7 @@
  ******************************************************************************/
 
 /*
- * Copyright (C) 2000 - 2010, Intel Corp.
+ * Copyright (C) 2000 - 2011, Intel Corp.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -163,9 +163,9 @@ acpi_status acpi_ns_root_initialize(void)
 #else
                                /* Mark this as a very SPECIAL method */
 
-                               obj_desc->method.method_flags =
-                                   AML_METHOD_INTERNAL_ONLY;
-                               obj_desc->method.extra.implementation =
+                               obj_desc->method.info_flags =
+                                   ACPI_METHOD_INTERNAL_ONLY;
+                               obj_desc->method.dispatch.implementation =
                                    acpi_ut_osi_implementation;
 #endif
                                break;
index 1e5ff803d9ad14ba678ba06fc4c28984995112eb..1d0ef15d158ff72779f32c814238130f13954425 100644 (file)
@@ -5,7 +5,7 @@
  ******************************************************************************/
 
 /*
- * Copyright (C) 2000 - 2010, Intel Corp.
+ * Copyright (C) 2000 - 2011, Intel Corp.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -234,8 +234,8 @@ void acpi_ns_install_node(struct acpi_walk_state *walk_state, struct acpi_namesp
                         * modified the namespace. This is used for cleanup when the
                         * method exits.
                         */
-                       walk_state->method_desc->method.flags |=
-                           AOPOBJ_MODIFIED_NAMESPACE;
+                       walk_state->method_desc->method.info_flags |=
+                           ACPI_METHOD_MODIFIED_NAMESPACE;
                }
        }
 
@@ -341,6 +341,7 @@ void acpi_ns_delete_namespace_subtree(struct acpi_namespace_node *parent_node)
 {
        struct acpi_namespace_node *child_node = NULL;
        u32 level = 1;
+       acpi_status status;
 
        ACPI_FUNCTION_TRACE(ns_delete_namespace_subtree);
 
@@ -348,6 +349,13 @@ void acpi_ns_delete_namespace_subtree(struct acpi_namespace_node *parent_node)
                return_VOID;
        }
 
+       /* Lock namespace for possible update */
+
+       status = acpi_ut_acquire_mutex(ACPI_MTX_NAMESPACE);
+       if (ACPI_FAILURE(status)) {
+               return_VOID;
+       }
+
        /*
         * Traverse the tree of objects until we bubble back up
         * to where we started.
@@ -397,6 +405,7 @@ void acpi_ns_delete_namespace_subtree(struct acpi_namespace_node *parent_node)
                }
        }
 
+       (void)acpi_ut_release_mutex(ACPI_MTX_NAMESPACE);
        return_VOID;
 }
 
index a54dc39e304b2e2a0c34835aca4464b17032d251..b683cc2ff9d3cc15d0acd687f11a8d70bbcf17b3 100644 (file)
@@ -5,7 +5,7 @@
  *****************************************************************************/
 
 /*
- * Copyright (C) 2000 - 2010, Intel Corp.
+ * Copyright (C) 2000 - 2011, Intel Corp.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -624,9 +624,22 @@ acpi_ns_dump_objects(acpi_object_type type,
                     acpi_owner_id owner_id, acpi_handle start_handle)
 {
        struct acpi_walk_info info;
+       acpi_status status;
 
        ACPI_FUNCTION_ENTRY();
 
+       /*
+        * Just lock the entire namespace for the duration of the dump.
+        * We don't want any changes to the namespace during this time,
+        * especially the temporary nodes since we are going to display
+        * them also.
+        */
+       status = acpi_ut_acquire_mutex(ACPI_MTX_NAMESPACE);
+       if (ACPI_FAILURE(status)) {
+               acpi_os_printf("Could not acquire namespace mutex\n");
+               return;
+       }
+
        info.debug_level = ACPI_LV_TABLES;
        info.owner_id = owner_id;
        info.display_type = display_type;
@@ -636,6 +649,8 @@ acpi_ns_dump_objects(acpi_object_type type,
                                     ACPI_NS_WALK_TEMP_NODES,
                                     acpi_ns_dump_one_object, NULL,
                                     (void *)&info, NULL);
+
+       (void)acpi_ut_release_mutex(ACPI_MTX_NAMESPACE);
 }
 #endif                         /* ACPI_FUTURE_USAGE */
 
index d2a97921e249e87472966c2981fb9af12ef698dd..2ed294b7a4db9c401d094071c6c104d0c7b974a4 100644 (file)
@@ -5,7 +5,7 @@
  *****************************************************************************/
 
 /*
- * Copyright (C) 2000 - 2010, Intel Corp.
+ * Copyright (C) 2000 - 2011, Intel Corp.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
index f52829cc294b2fd8abc5d45114ccceea4ab233be..c1bd02b1a058746f820988639baecb4ed73fc2b8 100644 (file)
@@ -5,7 +5,7 @@
  ******************************************************************************/
 
 /*
- * Copyright (C) 2000 - 2010, Intel Corp.
+ * Copyright (C) 2000 - 2011, Intel Corp.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -389,7 +389,7 @@ acpi_ns_exec_module_code(union acpi_operand_object *method_obj,
         * acpi_gbl_root_node->Object is NULL at PASS1.
         */
        if ((type == ACPI_TYPE_DEVICE) && parent_node->object) {
-               method_obj->method.extra.handler =
+               method_obj->method.dispatch.handler =
                    parent_node->object->device.handler;
        }
 
index 0cac7ec0d2ece0764806fae7a11994da0520ab23..fd7c6380e2941b9cf61500ace2d3a6021b80affe 100644 (file)
@@ -5,7 +5,7 @@
  *****************************************************************************/
 
 /*
- * Copyright (C) 2000 - 2010, Intel Corp.
+ * Copyright (C) 2000 - 2011, Intel Corp.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
index df18be94fefe9e6753c6050b1964ee851298f7b1..5f7dc691c1838e0ea65d8d78ba5417e1a056c5ad 100644 (file)
@@ -5,7 +5,7 @@
  *****************************************************************************/
 
 /*
- * Copyright (C) 2000 - 2010, Intel Corp.
+ * Copyright (C) 2000 - 2011, Intel Corp.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
index d3104af57e13b17f4a40f9bc769cc3da8ca5f101..d5fa520c3de5cb026ec5a4b4c09ff7a410da5552 100644 (file)
@@ -5,7 +5,7 @@
  ******************************************************************************/
 
 /*
- * Copyright (C) 2000 - 2010, Intel Corp.
+ * Copyright (C) 2000 - 2011, Intel Corp.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
index 41a9213dd5af638fb7dd179d86e9b56f4a1ce9fe..3bb8bf105ea2abb151f4e862db5d00339a9972a0 100644 (file)
@@ -6,7 +6,7 @@
  ******************************************************************************/
 
 /*
- * Copyright (C) 2000 - 2010, Intel Corp.
+ * Copyright (C) 2000 - 2011, Intel Corp.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
index 5808c89e9fac1638d26a240a42482baf72c8f7e8..b3234fa795b8591f62db87c30051c144ec250ee2 100644 (file)
@@ -5,7 +5,7 @@
  *****************************************************************************/
 
 /*
- * Copyright (C) 2000 - 2010, Intel Corp.
+ * Copyright (C) 2000 - 2011, Intel Corp.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
index 7096bcda0c723b2317affede650241fcbada6e9c..9fb03fa8ffde39b253a88cfe52359972491c70b4 100644 (file)
@@ -6,7 +6,7 @@
  *****************************************************************************/
 
 /*
- * Copyright (C) 2000 - 2010, Intel Corp.
+ * Copyright (C) 2000 - 2011, Intel Corp.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
index d1c136692667b8d22ffb791be03b6a8d7274f184..1d76ac85b5e79fdd9c1c41573a92ddf78686aeab 100644 (file)
@@ -5,7 +5,7 @@
  *****************************************************************************/
 
 /*
- * Copyright (C) 2000 - 2010, Intel Corp.
+ * Copyright (C) 2000 - 2011, Intel Corp.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
index 4ef9f43ea9262273ed06686eae439b9675f5d10d..973883babee1fa3a98718c43b3903de75a9ec83e 100644 (file)
@@ -6,7 +6,7 @@
  *****************************************************************************/
 
 /*
- * Copyright (C) 2000 - 2010, Intel Corp.
+ * Copyright (C) 2000 - 2011, Intel Corp.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
index 41102a84272ffd0021f54e9541f14505dbe7b085..28b0d7a62b9976c5cf04e1043f5293f81f8189f0 100644 (file)
@@ -5,7 +5,7 @@
  ******************************************************************************/
 
 /*
- * Copyright (C) 2000 - 2010, Intel Corp.
+ * Copyright (C) 2000 - 2011, Intel Corp.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
index a7d6ad9c111b6b71fe52f4d5870e0b620efaf356..cb1b104a69a20211804e8c5124f07c8d6c9ea9b9 100644 (file)
@@ -6,7 +6,7 @@
  *****************************************************************************/
 
 /*
- * Copyright (C) 2000 - 2010, Intel Corp.
+ * Copyright (C) 2000 - 2011, Intel Corp.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
index 2cd5be8fe10f40c547cea2ccb9190f509114ddd8..345f0c3c6ad2a336a1e8982a318ec2ca7742ce7a 100644 (file)
@@ -5,7 +5,7 @@
  *****************************************************************************/
 
 /*
- * Copyright (C) 2000 - 2010, Intel Corp.
+ * Copyright (C) 2000 - 2011, Intel Corp.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
index ebef8a7fd7071f3c05c0e486e65552d5f007bf70..c53f0040e49016b041b364c8366ca8568d953a08 100644 (file)
@@ -6,7 +6,7 @@
  ******************************************************************************/
 
 /*
- * Copyright (C) 2000 - 2010, Intel Corp.
+ * Copyright (C) 2000 - 2011, Intel Corp.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
index b01e45a415e3e44a0f40d69c87a95555ac37554a..3fd4526f3dba0f4de2d35f76c9c3c435ea64d1e4 100644 (file)
@@ -6,7 +6,7 @@
  *****************************************************************************/
 
 /*
- * Copyright (C) 2000 - 2010, Intel Corp.
+ * Copyright (C) 2000 - 2011, Intel Corp.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -603,10 +603,9 @@ acpi_status acpi_install_method(u8 *buffer)
        method_obj->method.param_count = (u8)
            (method_flags & AML_METHOD_ARG_COUNT);
 
-       method_obj->method.method_flags = (u8)
-           (method_flags & ~AML_METHOD_ARG_COUNT);
-
        if (method_flags & AML_METHOD_SERIALIZED) {
+               method_obj->method.info_flags = ACPI_METHOD_SERIALIZED;
+
                method_obj->method.sync_level = (u8)
                    ((method_flags & AML_METHOD_SYNC_LEVEL) >> 4);
        }
index a1f04e9b8030edc75ed951d5b2865ee3cab537cf..db7660f8b869a14789a8ae0e8d103fc6635c992f 100644 (file)
@@ -6,7 +6,7 @@
  ******************************************************************************/
 
 /*
- * Copyright (C) 2000 - 2010, Intel Corp.
+ * Copyright (C) 2000 - 2011, Intel Corp.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
index 7df1a4c952748bbac402c9d0392ccd4aa2bc10d1..e1fad0ee0136760806f8e3dcf1e1cb76b1509e7a 100644 (file)
@@ -5,7 +5,7 @@
  *****************************************************************************/
 
 /*
- * Copyright (C) 2000 - 2010, Intel Corp.
+ * Copyright (C) 2000 - 2011, Intel Corp.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
index 2f2e7760938cae09ca2f7092229855042454ce1c..01dd70d1de514eb8e8a03dfbc94995e35a6f90e3 100644 (file)
@@ -5,7 +5,7 @@
  *****************************************************************************/
 
 /*
- * Copyright (C) 2000 - 2010, Intel Corp.
+ * Copyright (C) 2000 - 2011, Intel Corp.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -655,7 +655,7 @@ acpi_ps_link_module_code(union acpi_parse_object *parent_op,
                method_obj->method.aml_start = aml_start;
                method_obj->method.aml_length = aml_length;
                method_obj->method.owner_id = owner_id;
-               method_obj->method.flags |= AOPOBJ_MODULE_LEVEL;
+               method_obj->method.info_flags |= ACPI_METHOD_MODULE_LEVEL;
 
                /*
                 * Save the parent node in next_object. This is cheating, but we
index 2b0c3be2b1b886dc07a36ddd4e05a730a57d5b1c..bed08de7528c20e1762a8c989e89fece2a368bdf 100644 (file)
@@ -5,7 +5,7 @@
  *****************************************************************************/
 
 /*
- * Copyright (C) 2000 - 2010, Intel Corp.
+ * Copyright (C) 2000 - 2011, Intel Corp.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
index 8d81542194d457424d97afc5ed3fd1755a970cf9..9bb0cbd37b5e678d462702d909d7a165396f2342 100644 (file)
@@ -5,7 +5,7 @@
  *****************************************************************************/
 
 /*
- * Copyright (C) 2000 - 2010, Intel Corp.
+ * Copyright (C) 2000 - 2011, Intel Corp.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -55,7 +55,6 @@
 #include "acparser.h"
 #include "acdispat.h"
 #include "amlcode.h"
-#include "acnamesp.h"
 #include "acinterp.h"
 
 #define _COMPONENT          ACPI_PARSER
@@ -539,24 +538,16 @@ acpi_status acpi_ps_parse_aml(struct acpi_walk_state *walk_state)
                        /* Check for possible multi-thread reentrancy problem */
 
                        if ((status == AE_ALREADY_EXISTS) &&
-                           (!walk_state->method_desc->method.mutex)) {
-                               ACPI_INFO((AE_INFO,
-                                          "Marking method %4.4s as Serialized because of AE_ALREADY_EXISTS error",
-                                          walk_state->method_node->name.
-                                          ascii));
-
+                           (!(walk_state->method_desc->method.
+                              info_flags & ACPI_METHOD_SERIALIZED))) {
                                /*
-                                * Method tried to create an object twice. The probable cause is
-                                * that the method cannot handle reentrancy.
-                                *
-                                * The method is marked not_serialized, but it tried to create
-                                * a named object, causing the second thread entrance to fail.
-                                * Workaround this problem by marking the method permanently
-                                * as Serialized.
+                                * Method is not serialized and tried to create an object
+                                * twice. The probable cause is that the method cannot
+                                * handle reentrancy. Mark as "pending serialized" now, and
+                                * then mark "serialized" when the last thread exits.
                                 */
-                               walk_state->method_desc->method.method_flags |=
-                                   AML_METHOD_SERIALIZED;
-                               walk_state->method_desc->method.sync_level = 0;
+                               walk_state->method_desc->method.info_flags |=
+                                   ACPI_METHOD_SERIALIZED_PENDING;
                        }
                }
 
index 40e2b279ea1281d0fa1e206238d2b1379ec5d403..a5faa1323a0290f77676419a07ccc05eed2313e5 100644 (file)
@@ -5,7 +5,7 @@
  *****************************************************************************/
 
 /*
- * Copyright (C) 2000 - 2010, Intel Corp.
+ * Copyright (C) 2000 - 2011, Intel Corp.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
index d4b970c3630badddb8ea5992cd374b8ffc2379b0..f1464c03aa427865f4601cd01d58712ce7024b39 100644 (file)
@@ -5,7 +5,7 @@
  *****************************************************************************/
 
 /*
- * Copyright (C) 2000 - 2010, Intel Corp.
+ * Copyright (C) 2000 - 2011, Intel Corp.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
index fe29eee5adb1560686e72db794b1986805c1793b..7eda78503422b7d651b046c2b05a76ac895d1fb0 100644 (file)
@@ -5,7 +5,7 @@
  *****************************************************************************/
 
 /*
- * Copyright (C) 2000 - 2010, Intel Corp.
+ * Copyright (C) 2000 - 2011, Intel Corp.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
index 8abb9629443df0f6cf8f769284b5684f6c89ddcd..3312d6368bf15bba6e193b14e2d3c47cf01dd804 100644 (file)
@@ -5,7 +5,7 @@
  *****************************************************************************/
 
 /*
- * Copyright (C) 2000 - 2010, Intel Corp.
+ * Copyright (C) 2000 - 2011, Intel Corp.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
index c42f067cff9dfc811f611c07dd7af4c04ad197b9..8086805d44946ba73f0f2819271d2077d3755721 100644 (file)
@@ -5,7 +5,7 @@
  *****************************************************************************/
 
 /*
- * Copyright (C) 2000 - 2010, Intel Corp.
+ * Copyright (C) 2000 - 2011, Intel Corp.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -47,7 +47,6 @@
 #include "acdispat.h"
 #include "acinterp.h"
 #include "actables.h"
-#include "amlcode.h"
 
 #define _COMPONENT          ACPI_PARSER
 ACPI_MODULE_NAME("psxface")
@@ -285,15 +284,15 @@ acpi_status acpi_ps_execute_method(struct acpi_evaluate_info *info)
                goto cleanup;
        }
 
-       if (info->obj_desc->method.flags & AOPOBJ_MODULE_LEVEL) {
+       if (info->obj_desc->method.info_flags & ACPI_METHOD_MODULE_LEVEL) {
                walk_state->parse_flags |= ACPI_PARSE_MODULE_LEVEL;
        }
 
        /* Invoke an internal method if necessary */
 
-       if (info->obj_desc->method.method_flags & AML_METHOD_INTERNAL_ONLY) {
+       if (info->obj_desc->method.info_flags & ACPI_METHOD_INTERNAL_ONLY) {
                status =
-                   info->obj_desc->method.extra.implementation(walk_state);
+                   info->obj_desc->method.dispatch.implementation(walk_state);
                info->return_object = walk_state->return_desc;
 
                /* Cleanup states */
index 226c806ae98681be6a1a47a63fd742eab9f6f42e..9e66f90784269243cb5e30f815b50f299c16ccf9 100644 (file)
@@ -5,7 +5,7 @@
  ******************************************************************************/
 
 /*
- * Copyright (C) 2000 - 2010, Intel Corp.
+ * Copyright (C) 2000 - 2011, Intel Corp.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
index d6ebf7ec622d6e8d46d9ddb5536fa7047494d90a..3a8a89ec2ca4195d14a90b620918f6f4aa9cd881 100644 (file)
@@ -5,7 +5,7 @@
  ******************************************************************************/
 
 /*
- * Copyright (C) 2000 - 2010, Intel Corp.
+ * Copyright (C) 2000 - 2011, Intel Corp.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
index c80a2eea3a0189ba49a19ed0ea2380fbb5bc924a..4ce6e1147e807993cccc251af32632d0eabca6e8 100644 (file)
@@ -5,7 +5,7 @@
  ******************************************************************************/
 
 /*
- * Copyright (C) 2000 - 2010, Intel Corp.
+ * Copyright (C) 2000 - 2011, Intel Corp.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
index f859b0386fe462d372b45a74a4159f02106e7489..33db7520c74be0c2937b837b31512dcec49fde58 100644 (file)
@@ -5,7 +5,7 @@
  ******************************************************************************/
 
 /*
- * Copyright (C) 2000 - 2010, Intel Corp.
+ * Copyright (C) 2000 - 2011, Intel Corp.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
index 1fd868b964fd2e7891ec8e358d5b37003cc68884..f9ea60872aa4ddad8cf1cd77c20a61a0ec7c0b41 100644 (file)
@@ -5,7 +5,7 @@
  ******************************************************************************/
 
 /*
- * Copyright (C) 2000 - 2010, Intel Corp.
+ * Copyright (C) 2000 - 2011, Intel Corp.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
index 33bff17c0bbce1900fd693267df986e6f3d653b2..0c7efef008bed3c2bcd652fae16bf9d0ae80ca29 100644 (file)
@@ -5,7 +5,7 @@
  ******************************************************************************/
 
 /*
- * Copyright (C) 2000 - 2010, Intel Corp.
+ * Copyright (C) 2000 - 2011, Intel Corp.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
index 545da40d7fa76cc56dea27e3963050026aaa12f5..50b8ad21116736185832c802d63529bbfa9532cd 100644 (file)
@@ -5,7 +5,7 @@
  ******************************************************************************/
 
 /*
- * Copyright (C) 2000 - 2010, Intel Corp.
+ * Copyright (C) 2000 - 2011, Intel Corp.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
index 7335f22aac2003efa96ddff143e05bb6cb4b1528..1bfcef736c5079695dd871d4490ae34bb612600b 100644 (file)
@@ -5,7 +5,7 @@
  ******************************************************************************/
 
 /*
- * Copyright (C) 2000 - 2010, Intel Corp.
+ * Copyright (C) 2000 - 2011, Intel Corp.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
index 887b8ba8c432e9e7d4771bd0343856952e415b55..7cc6d8625f1e66d488b3e8c0da0c885e2483db42 100644 (file)
@@ -5,7 +5,7 @@
  ******************************************************************************/
 
 /*
- * Copyright (C) 2000 - 2010, Intel Corp.
+ * Copyright (C) 2000 - 2011, Intel Corp.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
index f8cd9e87d987aad52385ae15636eee43fced894d..410264b22a296011108454e353b21dbaaf646b2c 100644 (file)
@@ -5,7 +5,7 @@
  ******************************************************************************/
 
 /*
- * Copyright (C) 2000 - 2010, Intel Corp.
+ * Copyright (C) 2000 - 2011, Intel Corp.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
index 491191e6cf692bffe1811a22674a0eb0720c3771..231811e569399c5b75d2b7ba55be22bf82edbdbb 100644 (file)
@@ -5,7 +5,7 @@
  ******************************************************************************/
 
 /*
- * Copyright (C) 2000 - 2010, Intel Corp.
+ * Copyright (C) 2000 - 2011, Intel Corp.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
index 9f6a6e7e1c8e59a946624804ecd2354fd5a9c289..2ff657a28f26d3f8132c4e362b635bd198a3a1e9 100644 (file)
@@ -5,7 +5,7 @@
  ******************************************************************************/
 
 /*
- * Copyright (C) 2000 - 2010, Intel Corp.
+ * Copyright (C) 2000 - 2011, Intel Corp.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
index d2ff4325c4270a6c34e063bccfdf020175ae72b6..428d44e2d162402d8f9d5bb3c9c6542e40e193b2 100644 (file)
@@ -5,7 +5,7 @@
  *****************************************************************************/
 
 /*
- * Copyright (C) 2000 - 2010, Intel Corp.
+ * Copyright (C) 2000 - 2011, Intel Corp.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
index 989d5c8678641c2bed8543a4200cac96c6bd4455..a55cb2bb5abbfdee7b448ced5baf23bb37c68a4a 100644 (file)
@@ -5,7 +5,7 @@
  *****************************************************************************/
 
 /*
- * Copyright (C) 2000 - 2010, Intel Corp.
+ * Copyright (C) 2000 - 2011, Intel Corp.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
index 83d7af8d0905a927a4316df20ce50aefe8af7c92..48db0944ce4a00e1256b4f888b4497e2ee584d2e 100644 (file)
@@ -5,7 +5,7 @@
  *****************************************************************************/
 
 /*
- * Copyright (C) 2000 - 2010, Intel Corp.
+ * Copyright (C) 2000 - 2011, Intel Corp.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
index 34f9c2bc5e1f917faf5666bb6a630953535cc9ca..0f2d395feabadb20e8ce47d88f53ff8d786e2427 100644 (file)
@@ -5,7 +5,7 @@
  *****************************************************************************/
 
 /*
- * Copyright (C) 2000 - 2010, Intel Corp.
+ * Copyright (C) 2000 - 2011, Intel Corp.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
index 4a8b9e6ea57a1fa73a670a7b1d06cdc4214a168a..4b7085dfc683bdef506be4fa62d0f29ae8af0465 100644 (file)
@@ -6,7 +6,7 @@
  *****************************************************************************/
 
 /*
- * Copyright (C) 2000 - 2010, Intel Corp.
+ * Copyright (C) 2000 - 2011, Intel Corp.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
index fd2c07d1d3ac3bbba9a7c71128661887f5caf77a..7eb6c6cc1edf76000d8842edc6a1a36bf261a43b 100644 (file)
@@ -5,7 +5,7 @@
  *****************************************************************************/
 
 /*
- * Copyright (C) 2000 - 2010, Intel Corp.
+ * Copyright (C) 2000 - 2011, Intel Corp.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
index 8f0896281567525a3b67ab484a73c20383759a0a..0a697351cf6974474852370b843880ee3872ab7d 100644 (file)
@@ -5,7 +5,7 @@
  *****************************************************************************/
 
 /*
- * Copyright (C) 2000 - 2010, Intel Corp.
+ * Copyright (C) 2000 - 2011, Intel Corp.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
index 6fef83f04bcd01c8cad30b4481ab2ebc6e04ca08..aded299a2fa842210a7ee9c616ff321573f8c5c4 100644 (file)
@@ -5,7 +5,7 @@
  *****************************************************************************/
 
 /*
- * Copyright (C) 2000 - 2010, Intel Corp.
+ * Copyright (C) 2000 - 2011, Intel Corp.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
index f21c486929a54a96fcf8bbcf5a6d34049b00bbf5..a9bcd816dc298f7fbc1be186080915ade6410766 100644 (file)
@@ -5,7 +5,7 @@
  *****************************************************************************/
 
 /*
- * Copyright (C) 2000 - 2010, Intel Corp.
+ * Copyright (C) 2000 - 2011, Intel Corp.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
index ed794cd033eaf34417c5cf54d0ab27251ce38ef1..31f5a7832ef135e94659179fbec6a927098b5fa3 100644 (file)
@@ -5,7 +5,7 @@
  ******************************************************************************/
 
 /*
- * Copyright (C) 2000 - 2010, Intel Corp.
+ * Copyright (C) 2000 - 2011, Intel Corp.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
index 22f59ef604e06b840f95c0d16ffa048614091071..18f73c9d10bce26a71a469569a868c72bc75fabd 100644 (file)
@@ -5,7 +5,7 @@
  *****************************************************************************/
 
 /*
- * Copyright (C) 2000 - 2010, Intel Corp.
+ * Copyright (C) 2000 - 2011, Intel Corp.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
index 508537f884acb05c80245e6ac3beb6d9fc127e38..97dd9bbf055ace4b895b0a84bfb2b2b695a55679 100644 (file)
@@ -5,7 +5,7 @@
  *****************************************************************************/
 
 /*
- * Copyright (C) 2000 - 2010, Intel Corp.
+ * Copyright (C) 2000 - 2011, Intel Corp.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
index d2906328535df5903b887ae3c744473e27061e64..b679ea693545db6fd16703268c9cbd6354cecfcd 100644 (file)
@@ -5,7 +5,7 @@
  *****************************************************************************/
 
 /*
- * Copyright (C) 2000 - 2010, Intel Corp.
+ * Copyright (C) 2000 - 2011, Intel Corp.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
index c1b1c803ea9b62f8072a4af3d6ea8c8342aa1a91..191b6828cce99d300a20fd01d559b21628a0189c 100644 (file)
@@ -5,7 +5,7 @@
  *****************************************************************************/
 
 /*
- * Copyright (C) 2000 - 2010, Intel Corp.
+ * Copyright (C) 2000 - 2011, Intel Corp.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
index b081cd46a15f83f5f3eaf114b2b10c52accdf496..f6bb75c6faf5ea4a653569e9653e3094a07b7056 100644 (file)
@@ -5,7 +5,7 @@
  *****************************************************************************/
 
 /*
- * Copyright (C) 2000 - 2010, Intel Corp.
+ * Copyright (C) 2000 - 2011, Intel Corp.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
index 49cf7b7fd816ca8b453b7f6c2e6b736d98b611a3..ce481da9bb451858da374fdee0e5f271196ab335 100644 (file)
@@ -5,7 +5,7 @@
  ******************************************************************************/
 
 /*
- * Copyright (C) 2000 - 2010, Intel Corp.
+ * Copyright (C) 2000 - 2011, Intel Corp.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
index c7d0e05ef5a4ebccdf6586249136b0b4ac5c6ca9..c33a852d4f42a5d9b9113840bcd918680a3836b8 100644 (file)
@@ -5,7 +5,7 @@
  ******************************************************************************/
 
 /*
- * Copyright (C) 2000 - 2010, Intel Corp.
+ * Copyright (C) 2000 - 2011, Intel Corp.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
index 199528ff7f1d2edde7b17d832940117b33449a16..a946c689f03b164b5ab7131fe6506a6958553801 100644 (file)
@@ -5,7 +5,7 @@
  ******************************************************************************/
 
 /*
- * Copyright (C) 2000 - 2010, Intel Corp.
+ * Copyright (C) 2000 - 2011, Intel Corp.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
index fd1fa2749ea50df81666681d6fa5c71f87c0560d..188340a017b4036422e900ccac69d44f44754780 100644 (file)
@@ -5,7 +5,7 @@
  *****************************************************************************/
 
 /*
- * Copyright (C) 2000 - 2010, Intel Corp.
+ * Copyright (C) 2000 - 2011, Intel Corp.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
index 18c59a85fdca95470ed9a6700ffd7027623d0477..1fb10cb8f11dfdaa660c0bf4ee9095a79986bd55 100644 (file)
@@ -5,7 +5,7 @@
  *****************************************************************************/
 
 /*
- * Copyright (C) 2000 - 2010, Intel Corp.
+ * Copyright (C) 2000 - 2011, Intel Corp.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
index 7965919000b1755d078ccb876c143ca2e54c24f0..84e0518442476ff1b49ad5f5a9ba30c52dcc505d 100644 (file)
@@ -5,7 +5,7 @@
  ******************************************************************************/
 
 /*
- * Copyright (C) 2000 - 2010, Intel Corp.
+ * Copyright (C) 2000 - 2011, Intel Corp.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
index d35d109b8da22461b479fb3e849a4750dc25f9f1..30c21e1a9360c79adad9516dbd12787f9e892bd8 100644 (file)
@@ -5,7 +5,7 @@
  ******************************************************************************/
 
 /*
- * Copyright (C) 2000 - 2010, Intel Corp.
+ * Copyright (C) 2000 - 2011, Intel Corp.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
index 1f484c9a6888934bd82949a86e93339c033a13a1..98ad125e14ffc15fe2914eb249202d459bb342c4 100644 (file)
@@ -5,7 +5,7 @@
  *****************************************************************************/
 
 /*
- * Copyright (C) 2000 - 2010, Intel Corp.
+ * Copyright (C) 2000 - 2011, Intel Corp.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
index 6f12e314fbae86bf9e01f24d3f845dbf287cb851..916ae097c43c9ef99b4d44c41939d0c0d4d6301c 100644 (file)
@@ -5,7 +5,7 @@
  ******************************************************************************/
 
 /*
- * Copyright (C) 2000 - 2010, Intel Corp.
+ * Copyright (C) 2000 - 2011, Intel Corp.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
index 68bc227e7c4cc45b80e74e7f354826e6788ec6ad..ac1a599f5147640cc58135391260f0f202a411b1 100644 (file)
@@ -998,7 +998,6 @@ static int acpi_battery_resume(struct acpi_device *device)
        if (!device)
                return -EINVAL;
        battery = acpi_driver_data(device);
-       acpi_battery_refresh(battery);
        battery->update_time = 0;
        acpi_battery_update(battery);
        return 0;
index 54b6ab8040a6ed05039ce59d576969371e7fa3f8..fa5a1df42b79a40a817d27f036789d7bcd3a3c38 100644 (file)
@@ -12,6 +12,7 @@
 #include <linux/mm.h>
 #include <linux/slab.h>
 #include <linux/acpi.h>
+#include <linux/acpi_io.h>
 #include <acpi/acpiosxf.h>
 
 /*
@@ -80,7 +81,7 @@ void suspend_nvs_free(void)
                        free_page((unsigned long)entry->data);
                        entry->data = NULL;
                        if (entry->kaddr) {
-                               acpi_os_unmap_memory(entry->kaddr, entry->size);
+                               iounmap(entry->kaddr);
                                entry->kaddr = NULL;
                        }
                }
@@ -114,8 +115,8 @@ int suspend_nvs_save(void)
 
        list_for_each_entry(entry, &nvs_list, node)
                if (entry->data) {
-                       entry->kaddr = acpi_os_map_memory(entry->phys_start,
-                                                         entry->size);
+                       entry->kaddr = acpi_os_ioremap(entry->phys_start,
+                                                   entry->size);
                        if (!entry->kaddr) {
                                suspend_nvs_free();
                                return -ENOMEM;
index e2dd6de5d50c8dbd01246416a59f26dcda51c954..b0931818cf98f133bf000f49e7200c8bbd9611fb 100644 (file)
@@ -38,6 +38,7 @@
 #include <linux/workqueue.h>
 #include <linux/nmi.h>
 #include <linux/acpi.h>
+#include <linux/acpi_io.h>
 #include <linux/efi.h>
 #include <linux/ioport.h>
 #include <linux/list.h>
@@ -302,9 +303,10 @@ void __iomem *__init_refok
 acpi_os_map_memory(acpi_physical_address phys, acpi_size size)
 {
        struct acpi_ioremap *map, *tmp_map;
-       unsigned long flags, pg_sz;
+       unsigned long flags;
        void __iomem *virt;
-       phys_addr_t pg_off;
+       acpi_physical_address pg_off;
+       acpi_size pg_sz;
 
        if (phys > ULONG_MAX) {
                printk(KERN_ERR PREFIX "Cannot map memory that high\n");
@@ -320,7 +322,7 @@ acpi_os_map_memory(acpi_physical_address phys, acpi_size size)
 
        pg_off = round_down(phys, PAGE_SIZE);
        pg_sz = round_up(phys + size, PAGE_SIZE) - pg_off;
-       virt = ioremap_cache(pg_off, pg_sz);
+       virt = acpi_os_ioremap(pg_off, pg_sz);
        if (!virt) {
                kfree(map);
                return NULL;
@@ -642,7 +644,7 @@ acpi_os_read_memory(acpi_physical_address phys_addr, u32 * value, u32 width)
        virt_addr = acpi_map_vaddr_lookup(phys_addr, size);
        rcu_read_unlock();
        if (!virt_addr) {
-               virt_addr = ioremap_cache(phys_addr, size);
+               virt_addr = acpi_os_ioremap(phys_addr, size);
                unmap = 1;
        }
        if (!value)
@@ -678,7 +680,7 @@ acpi_os_write_memory(acpi_physical_address phys_addr, u32 value, u32 width)
        virt_addr = acpi_map_vaddr_lookup(phys_addr, size);
        rcu_read_unlock();
        if (!virt_addr) {
-               virt_addr = ioremap_cache(phys_addr, size);
+               virt_addr = acpi_os_ioremap(phys_addr, size);
                unmap = 1;
        }
 
index fdd3aeeb6defd06e1103a368e9bfd79bf837b364..d6a8cd14de2e824ddb15563aa625fa1d5236ea5a 100644 (file)
@@ -166,6 +166,7 @@ static void acpi_pm_finish(void)
        u32 acpi_state = acpi_target_sleep_state;
 
        acpi_ec_unblock_transactions();
+       suspend_nvs_free();
 
        if (acpi_state == ACPI_STATE_S0)
                return;
@@ -186,7 +187,6 @@ static void acpi_pm_finish(void)
  */
 static void acpi_pm_end(void)
 {
-       suspend_nvs_free();
        /*
         * This is necessary in case acpi_pm_finish() is not called during a
         * failing transition to a sleep state.
index c6b298d4c136c54a40fa7b4e4c13361000535642..c2328aed08361c0e8a8caf97666935f17c953a0c 100644 (file)
@@ -783,7 +783,7 @@ config PATA_PCMCIA
 
 config PATA_PLATFORM
        tristate "Generic platform device PATA support"
-       depends on EMBEDDED || PPC || HAVE_PATA_PLATFORM
+       depends on EXPERT || PPC || HAVE_PATA_PLATFORM
        help
          This option enables support for generic directly connected ATA
          devices commonly found on embedded systems.
index fd96345bc35c2435cce7deabba774afe780c17c1..d57e8d0fb8235085b60180230d04dc8cd61f3033 100644 (file)
@@ -70,7 +70,7 @@ config PREVENT_FIRMWARE_BUILD
          If unsure say Y here.
 
 config FW_LOADER
-       tristate "Userspace firmware loading support" if EMBEDDED
+       tristate "Userspace firmware loading support" if EXPERT
        default y
        ---help---
          This option is provided for the case where no in-kernel-tree modules
index 0f175a866ef026a847d3ed287723423d4f268048..b7980a83ce2dddae54cf9ca4f866baf9228a0f35 100644 (file)
@@ -5,7 +5,7 @@
 menu "Character devices"
 
 config VT
-       bool "Virtual terminal" if EMBEDDED
+       bool "Virtual terminal" if EXPERT
        depends on !S390
        select INPUT
        default y
@@ -39,13 +39,13 @@ config VT
 config CONSOLE_TRANSLATIONS
        depends on VT
        default y
-       bool "Enable character translations in console" if EMBEDDED
+       bool "Enable character translations in console" if EXPERT
        ---help---
          This enables support for font mapping and Unicode translation
          on virtual consoles.
 
 config VT_CONSOLE
-       bool "Support for console on virtual terminal" if EMBEDDED
+       bool "Support for console on virtual terminal" if EXPERT
        depends on VT
        default y
        ---help---
@@ -426,10 +426,10 @@ config SGI_MBCS
          If you have an SGI Altix with an attached SABrick
          say Y or M here, otherwise say N.
 
-source "drivers/serial/Kconfig"
+source "drivers/tty/serial/Kconfig"
 
 config UNIX98_PTYS
-       bool "Unix98 PTY support" if EMBEDDED
+       bool "Unix98 PTY support" if EXPERT
        default y
        ---help---
          A pseudo terminal (PTY) is a software device consisting of two
@@ -495,7 +495,7 @@ config LEGACY_PTY_COUNT
 
 config TTY_PRINTK
        bool "TTY driver to output user messages via printk"
-       depends on EMBEDDED
+       depends on EXPERT
        default n
        ---help---
          If you say Y here, the support for writing user messages (i.e.
index 1e9dffb337788806ec7e17cefc3a9348ea7938c3..5bc765d4c3cae96a604c45162e8c4bd18f039900 100644 (file)
@@ -30,25 +30,12 @@ obj-$(CONFIG_SYNCLINK_GT)   += synclink_gt.o
 obj-$(CONFIG_AMIGA_BUILTIN_SERIAL) += amiserial.o
 obj-$(CONFIG_SX)               += sx.o generic_serial.o
 obj-$(CONFIG_RIO)              += rio/ generic_serial.o
-obj-$(CONFIG_HVC_CONSOLE)      += hvc_vio.o hvsi.o
-obj-$(CONFIG_HVC_ISERIES)      += hvc_iseries.o
-obj-$(CONFIG_HVC_RTAS)         += hvc_rtas.o
-obj-$(CONFIG_HVC_TILE)         += hvc_tile.o
-obj-$(CONFIG_HVC_DCC)          += hvc_dcc.o
-obj-$(CONFIG_HVC_BEAT)         += hvc_beat.o
-obj-$(CONFIG_HVC_DRIVER)       += hvc_console.o
-obj-$(CONFIG_HVC_IRQ)          += hvc_irq.o
-obj-$(CONFIG_HVC_XEN)          += hvc_xen.o
-obj-$(CONFIG_HVC_IUCV)         += hvc_iucv.o
-obj-$(CONFIG_HVC_UDBG)         += hvc_udbg.o
-obj-$(CONFIG_VIRTIO_CONSOLE)   += virtio_console.o
 obj-$(CONFIG_RAW_DRIVER)       += raw.o
 obj-$(CONFIG_SGI_SNSC)         += snsc.o snsc_event.o
 obj-$(CONFIG_MSPEC)            += mspec.o
 obj-$(CONFIG_MMTIMER)          += mmtimer.o
 obj-$(CONFIG_UV_MMTIMER)       += uv_mmtimer.o
 obj-$(CONFIG_VIOTAPE)          += viotape.o
-obj-$(CONFIG_HVCS)             += hvcs.o
 obj-$(CONFIG_IBM_BSR)          += bsr.o
 obj-$(CONFIG_SGI_MBCS)         += mbcs.o
 obj-$(CONFIG_BRIQ_PANEL)       += briq_panel.o
index 1f46f1cd9225c3c0d2a894bc80d3d1e74fe012e7..36e0fa161c2bf0b46206a6e0af00698935ad158b 100644 (file)
@@ -364,12 +364,14 @@ unsigned long tpm_calc_ordinal_duration(struct tpm_chip *chip,
                    tpm_protected_ordinal_duration[ordinal &
                                                   TPM_PROTECTED_ORDINAL_MASK];
 
-       if (duration_idx != TPM_UNDEFINED)
+       if (duration_idx != TPM_UNDEFINED) {
                duration = chip->vendor.duration[duration_idx];
-       if (duration <= 0)
+               /* if duration is 0, it's because chip->vendor.duration wasn't */
+               /* filled yet, so we set the lowest timeout just to give enough */
+               /* time for tpm_get_timeouts() to succeed */
+               return (duration <= 0 ? HZ : duration);
+       } else
                return 2 * 60 * HZ;
-       else
-               return duration;
 }
 EXPORT_SYMBOL_GPL(tpm_calc_ordinal_duration);
 
index c17a305ecb2806256c2f7c4f1e9e0e4c3f878734..dd21df55689d96a39d5fea3f66d2161dfec44467 100644 (file)
@@ -493,9 +493,6 @@ static int tpm_tis_init(struct device *dev, resource_size_t start,
                 "1.2 TPM (device-id 0x%X, rev-id %d)\n",
                 vendor >> 16, ioread8(chip->vendor.iobase + TPM_RID(0)));
 
-       if (is_itpm(to_pnp_dev(dev)))
-               itpm = 1;
-
        if (itpm)
                dev_info(dev, "Intel iTPM workaround enabled\n");
 
@@ -637,6 +634,9 @@ static int __devinit tpm_tis_pnp_init(struct pnp_dev *pnp_dev,
        else
                interrupts = 0;
 
+       if (is_itpm(pnp_dev))
+               itpm = 1;
+
        return tpm_tis_init(&pnp_dev->dev, start, len, irq);
 }
 
index a8c8d9c19d740d4686e312be1ebbf1f4b15967e3..ca8ee8093d6c604266c13b94a0949f4ca6c0abba 100644 (file)
@@ -71,7 +71,7 @@ config CPU_FREQ_DEFAULT_GOV_PERFORMANCE
 
 config CPU_FREQ_DEFAULT_GOV_POWERSAVE
        bool "powersave"
-       depends on EMBEDDED
+       depends on EXPERT
        select CPU_FREQ_GOV_POWERSAVE
        help
          Use the CPUFreq governor 'powersave' as default. This sets
index 68f942cb30f26808e58b9004107e56dce21df2f9..0c56989cd9073b4d0770a5ad4d15d11a907605c1 100644 (file)
@@ -49,15 +49,13 @@ config FIREWIRE_SBP2
          configuration section.
 
 config FIREWIRE_NET
-       tristate "IP networking over 1394 (EXPERIMENTAL)"
-       depends on FIREWIRE && INET && EXPERIMENTAL
+       tristate "IP networking over 1394"
+       depends on FIREWIRE && INET
        help
          This enables IPv4 over IEEE 1394, providing IP connectivity with
          other implementations of RFC 2734 as found on several operating
          systems.  Multicast support is currently limited.
 
-         NOTE, this driver is not stable yet!
-
          To compile this driver as a module, say M here:  The module will be
          called firewire-net.
 
index be0492398ef9573be4eb752b78e485e5b22d0e71..24ff35511e2b1b6a890e7fc9f9499e75c74459d1 100644 (file)
@@ -75,6 +75,8 @@ static size_t config_rom_length = 1 + 4 + 1 + 1;
 #define BIB_IRMC               ((1) << 31)
 #define NODE_CAPABILITIES      0x0c0083c0 /* per IEEE 1394 clause 8.3.2.6.5.2 */
 
+#define CANON_OUI              0x000085
+
 static void generate_config_rom(struct fw_card *card, __be32 *config_rom)
 {
        struct fw_descriptor *desc;
@@ -284,6 +286,7 @@ static void bm_work(struct work_struct *work)
        bool root_device_is_running;
        bool root_device_is_cmc;
        bool irm_is_1394_1995_only;
+       bool keep_this_irm;
 
        spin_lock_irq(&card->lock);
 
@@ -305,6 +308,10 @@ static void bm_work(struct work_struct *work)
        irm_is_1394_1995_only = irm_device && irm_device->config_rom &&
                        (irm_device->config_rom[2] & 0x000000f0) == 0;
 
+       /* Canon MV5i works unreliably if it is not root node. */
+       keep_this_irm = irm_device && irm_device->config_rom &&
+                       irm_device->config_rom[3] >> 8 == CANON_OUI;
+
        root_id  = root_node->node_id;
        irm_id   = card->irm_node->node_id;
        local_id = card->local_node->node_id;
@@ -333,7 +340,7 @@ static void bm_work(struct work_struct *work)
                        goto pick_me;
                }
 
-               if (irm_is_1394_1995_only) {
+               if (irm_is_1394_1995_only && !keep_this_irm) {
                        new_root_id = local_id;
                        fw_notify("%s, making local node (%02x) root.\n",
                                  "IRM is not 1394a compliant", new_root_id);
@@ -382,7 +389,7 @@ static void bm_work(struct work_struct *work)
 
                spin_lock_irq(&card->lock);
 
-               if (rcode != RCODE_COMPLETE) {
+               if (rcode != RCODE_COMPLETE && !keep_this_irm) {
                        /*
                         * The lock request failed, maybe the IRM
                         * isn't really IRM capable after all. Let's
index c2e194c5866717633d426636cc5cd5e43efa821e..7ed08fd1214eccc7bfd9f231e41a68de67ea6250 100644 (file)
@@ -191,6 +191,7 @@ struct fwnet_peer {
        struct fwnet_device *dev;
        u64 guid;
        u64 fifo;
+       __be32 ip;
 
        /* guarded by dev->lock */
        struct list_head pd_list; /* received partial datagrams */
@@ -570,6 +571,8 @@ static int fwnet_finish_incoming_packet(struct net_device *net,
                                peer->speed = sspd;
                        if (peer->max_payload > max_payload)
                                peer->max_payload = max_payload;
+
+                       peer->ip = arp1394->sip;
                }
                spin_unlock_irqrestore(&dev->lock, flags);
 
@@ -1470,6 +1473,7 @@ static int fwnet_add_peer(struct fwnet_device *dev,
        peer->dev = dev;
        peer->guid = (u64)device->config_rom[3] << 32 | device->config_rom[4];
        peer->fifo = FWNET_NO_FIFO_ADDR;
+       peer->ip = 0;
        INIT_LIST_HEAD(&peer->pd_list);
        peer->pdg_size = 0;
        peer->datagram_label = 0;
@@ -1589,10 +1593,13 @@ static int fwnet_remove(struct device *_dev)
 
        mutex_lock(&fwnet_device_mutex);
 
+       net = dev->netdev;
+       if (net && peer->ip)
+               arp_invalidate(net, peer->ip);
+
        fwnet_remove_peer(peer, dev);
 
        if (list_empty(&dev->peer_list)) {
-               net = dev->netdev;
                unregister_netdev(net);
 
                if (dev->local_fifo != FWNET_NO_FIFO_ADDR)
index e8b6a13515bdd4906a438e0b25c3319b832f0dbe..e710424b59ea7f793ef1c10c18215dc2716bb7a0 100644 (file)
@@ -27,7 +27,7 @@ config EDD_OFF
          using the kernel parameter 'edd={on|skipmbr|off}'.
 
 config FIRMWARE_MEMMAP
-    bool "Add firmware-provided memory map to sysfs" if EMBEDDED
+    bool "Add firmware-provided memory map to sysfs" if EXPERT
     default X86
     help
       Add the firmware-provided (unmodified) memory map to /sys/firmware/memmap.
index 3a061094345b3927536b0620ffc7dda1467976dc..0902d44600394fd1d6888bd6e5065bda884d2e03 100644 (file)
@@ -23,7 +23,7 @@ config DRM_KMS_HELPER
        tristate
        depends on DRM
        select FB
-       select FRAMEBUFFER_CONSOLE if !EMBEDDED
+       select FRAMEBUFFER_CONSOLE if !EXPERT
        help
          FB and CRTC helpers for KMS drivers.
 
index 5c4f9b9ecdc0759d590b691dd75587a0efd25970..6977a1ce9d98171b9f5e43cc0127e13d87ea3b5b 100644 (file)
@@ -1533,11 +1533,11 @@ bool drm_fb_helper_hotplug_event(struct drm_fb_helper *fb_helper)
 }
 EXPORT_SYMBOL(drm_fb_helper_hotplug_event);
 
-/* The Kconfig DRM_KMS_HELPER selects FRAMEBUFFER_CONSOLE (if !EMBEDDED)
+/* The Kconfig DRM_KMS_HELPER selects FRAMEBUFFER_CONSOLE (if !EXPERT)
  * but the module doesn't depend on any fb console symbols.  At least
  * attempt to load fbcon to avoid leaving the system without a usable console.
  */
-#if defined(CONFIG_FRAMEBUFFER_CONSOLE_MODULE) && !defined(CONFIG_EMBEDDED)
+#if defined(CONFIG_FRAMEBUFFER_CONSOLE_MODULE) && !defined(CONFIG_EXPERT)
 static int __init drm_fb_helper_modinit(void)
 {
        const char *name = "fbcon";
index 21d6c29c2d21cfde556d99b7fd7152cb7f2d2001..de70959b9ed51371a42eefccba299b76ab738274 100644 (file)
@@ -8,7 +8,7 @@ config DRM_NOUVEAU
        select FB_CFB_COPYAREA
        select FB_CFB_IMAGEBLIT
        select FB
-       select FRAMEBUFFER_CONSOLE if !EMBEDDED
+       select FRAMEBUFFER_CONSOLE if !EXPERT
        select FB_BACKLIGHT if DRM_NOUVEAU_BACKLIGHT
        select ACPI_VIDEO if ACPI && X86 && BACKLIGHT_CLASS_DEVICE && VIDEO_OUTPUT_CONTROL && INPUT
        help
index 8d0e31a22027a911cf7ad2daceb1f5a5b0ca8758..96c83a9a76bb8f54c4d7615f217f9f82127c66fd 100644 (file)
@@ -1,5 +1,5 @@
 config VGA_ARB
-       bool "VGA Arbitration" if EMBEDDED
+       bool "VGA Arbitration" if EXPERT
        default y
        depends on PCI
        help
index 24cca2f69dfcfb54df9d4a9a02196f83a5b1242b..2560f01c1a632561f32ad67c7af6d4bea22705b3 100644 (file)
@@ -62,9 +62,9 @@ config HID_3M_PCT
        Support for 3M PCT touch screens.
 
 config HID_A4TECH
-       tristate "A4 tech mice" if EMBEDDED
+       tristate "A4 tech mice" if EXPERT
        depends on USB_HID
-       default !EMBEDDED
+       default !EXPERT
        ---help---
        Support for A4 tech X5 and WOP-35 / Trust 450L mice.
 
@@ -77,9 +77,9 @@ config HID_ACRUX_FF
        game controllers.
 
 config HID_APPLE
-       tristate "Apple {i,Power,Mac}Books" if EMBEDDED
+       tristate "Apple {i,Power,Mac}Books" if EXPERT
        depends on (USB_HID || BT_HIDP)
-       default !EMBEDDED
+       default !EXPERT
        ---help---
        Support for some Apple devices which less or more break
        HID specification.
@@ -88,9 +88,9 @@ config HID_APPLE
        MacBooks, MacBook Pros and Apple Aluminum.
 
 config HID_BELKIN
-       tristate "Belkin Flip KVM and Wireless keyboard" if EMBEDDED
+       tristate "Belkin Flip KVM and Wireless keyboard" if EXPERT
        depends on USB_HID
-       default !EMBEDDED
+       default !EXPERT
        ---help---
        Support for Belkin Flip KVM and Wireless keyboard.
 
@@ -101,16 +101,16 @@ config HID_CANDO
        Support for Cando dual touch panel.
 
 config HID_CHERRY
-       tristate "Cherry Cymotion keyboard" if EMBEDDED
+       tristate "Cherry Cymotion keyboard" if EXPERT
        depends on USB_HID
-       default !EMBEDDED
+       default !EXPERT
        ---help---
        Support for Cherry Cymotion keyboard.
 
 config HID_CHICONY
-       tristate "Chicony Tactical pad" if EMBEDDED
+       tristate "Chicony Tactical pad" if EXPERT
        depends on USB_HID
-       default !EMBEDDED
+       default !EXPERT
        ---help---
        Support for Chicony Tactical pad.
 
@@ -130,9 +130,9 @@ config HID_PRODIKEYS
          and some additional multimedia keys.
 
 config HID_CYPRESS
-       tristate "Cypress mouse and barcode readers" if EMBEDDED
+       tristate "Cypress mouse and barcode readers" if EXPERT
        depends on USB_HID
-       default !EMBEDDED
+       default !EXPERT
        ---help---
        Support for cypress mouse and barcode readers.
 
@@ -174,16 +174,16 @@ config HID_ELECOM
        Support for the ELECOM BM084 (bluetooth mouse).
 
 config HID_EZKEY
-       tristate "Ezkey BTC 8193 keyboard" if EMBEDDED
+       tristate "Ezkey BTC 8193 keyboard" if EXPERT
        depends on USB_HID
-       default !EMBEDDED
+       default !EXPERT
        ---help---
        Support for Ezkey BTC 8193 keyboard.
 
 config HID_KYE
-       tristate "Kye/Genius Ergo Mouse" if EMBEDDED
+       tristate "Kye/Genius Ergo Mouse" if EXPERT
        depends on USB_HID
-       default !EMBEDDED
+       default !EXPERT
        ---help---
        Support for Kye/Genius Ergo Mouse.
 
@@ -212,16 +212,16 @@ config HID_TWINHAN
        Support for Twinhan IR remote control.
 
 config HID_KENSINGTON
-       tristate "Kensington Slimblade Trackball" if EMBEDDED
+       tristate "Kensington Slimblade Trackball" if EXPERT
        depends on USB_HID
-       default !EMBEDDED
+       default !EXPERT
        ---help---
        Support for Kensington Slimblade Trackball.
 
 config HID_LOGITECH
-       tristate "Logitech devices" if EMBEDDED
+       tristate "Logitech devices" if EXPERT
        depends on USB_HID
-       default !EMBEDDED
+       default !EXPERT
        ---help---
        Support for Logitech devices that are not fully compliant with HID standard.
 
@@ -276,9 +276,9 @@ config HID_MAGICMOUSE
        Apple Wireless "Magic" Mouse.
 
 config HID_MICROSOFT
-       tristate "Microsoft non-fully HID-compliant devices" if EMBEDDED
+       tristate "Microsoft non-fully HID-compliant devices" if EXPERT
        depends on USB_HID
-       default !EMBEDDED
+       default !EXPERT
        ---help---
        Support for Microsoft devices that are not fully compliant with HID standard.
 
@@ -289,9 +289,9 @@ config HID_MOSART
        Support for MosArt dual-touch panels.
 
 config HID_MONTEREY
-       tristate "Monterey Genius KB29E keyboard" if EMBEDDED
+       tristate "Monterey Genius KB29E keyboard" if EXPERT
        depends on USB_HID
-       default !EMBEDDED
+       default !EXPERT
        ---help---
        Support for Monterey Genius KB29E.
 
@@ -365,8 +365,8 @@ config HID_PICOLCD
          - IR
 
 config HID_PICOLCD_FB
-       bool "Framebuffer support" if EMBEDDED
-       default !EMBEDDED
+       bool "Framebuffer support" if EXPERT
+       default !EXPERT
        depends on HID_PICOLCD
        depends on HID_PICOLCD=FB || FB=y
        select FB_DEFERRED_IO
@@ -379,8 +379,8 @@ config HID_PICOLCD_FB
          frambuffer device.
 
 config HID_PICOLCD_BACKLIGHT
-       bool "Backlight control" if EMBEDDED
-       default !EMBEDDED
+       bool "Backlight control" if EXPERT
+       default !EXPERT
        depends on HID_PICOLCD
        depends on HID_PICOLCD=BACKLIGHT_CLASS_DEVICE || BACKLIGHT_CLASS_DEVICE=y
        ---help---
@@ -388,16 +388,16 @@ config HID_PICOLCD_BACKLIGHT
          class.
 
 config HID_PICOLCD_LCD
-       bool "Contrast control" if EMBEDDED
-       default !EMBEDDED
+       bool "Contrast control" if EXPERT
+       default !EXPERT
        depends on HID_PICOLCD
        depends on HID_PICOLCD=LCD_CLASS_DEVICE || LCD_CLASS_DEVICE=y
        ---help---
          Provide access to PicoLCD's LCD contrast via lcd class.
 
 config HID_PICOLCD_LEDS
-       bool "GPO via leds class" if EMBEDDED
-       default !EMBEDDED
+       bool "GPO via leds class" if EXPERT
+       default !EXPERT
        depends on HID_PICOLCD
        depends on HID_PICOLCD=LEDS_CLASS || LEDS_CLASS=y
        ---help---
index 4edb3bef94a649b95d90e19e2b1920339b8d9cf3..0f20fd17cf066ad6b32a868dd8069c0be83077cf 100644 (file)
@@ -45,7 +45,7 @@ config USB_HIDDEV
          If unsure, say Y.
 
 menu "USB HID Boot Protocol drivers"
-       depends on USB!=n && USB_HID!=y && EMBEDDED
+       depends on USB!=n && USB_HID!=y && EXPERT
 
 config USB_KBD
        tristate "USB HIDBP Keyboard (simple Boot) support"
index 35f00dae3676b39cd42d37cf2aec64113eeae497..773e484f16466482ed6a499005b27485c6854400 100644 (file)
@@ -618,8 +618,8 @@ config SENSORS_LM93
        depends on I2C
        select HWMON_VID
        help
-         If you say yes here you get support for National Semiconductor LM93
-         sensor chips.
+         If you say yes here you get support for National Semiconductor LM93,
+         LM94, and compatible sensor chips.
 
          This driver can also be built as a module.  If so, the module
          will be called lm93.
index c9ed14eba5a69eb3af13e750d4f563190234a76b..3b43df418613faf329abe451022126109aae15ae 100644 (file)
 #define LM93_MFR_ID            0x73
 #define LM93_MFR_ID_PROTOTYPE  0x72
 
+/* LM94 REGISTER VALUES */
+#define LM94_MFR_ID_2          0x7a
+#define LM94_MFR_ID            0x79
+#define LM94_MFR_ID_PROTOTYPE  0x78
+
 /* SMBus capabilities */
 #define LM93_SMBUS_FUNC_FULL (I2C_FUNC_SMBUS_BYTE_DATA | \
                I2C_FUNC_SMBUS_WORD_DATA | I2C_FUNC_SMBUS_BLOCK_DATA)
@@ -2504,6 +2509,7 @@ static int lm93_detect(struct i2c_client *client, struct i2c_board_info *info)
 {
        struct i2c_adapter *adapter = client->adapter;
        int mfr, ver;
+       const char *name;
 
        if (!i2c_check_functionality(adapter, LM93_SMBUS_FUNC_MIN))
                return -ENODEV;
@@ -2517,13 +2523,23 @@ static int lm93_detect(struct i2c_client *client, struct i2c_board_info *info)
        }
 
        ver = lm93_read_byte(client, LM93_REG_VER);
-       if (ver != LM93_MFR_ID && ver != LM93_MFR_ID_PROTOTYPE) {
+       switch (ver) {
+       case LM93_MFR_ID:
+       case LM93_MFR_ID_PROTOTYPE:
+               name = "lm93";
+               break;
+       case LM94_MFR_ID_2:
+       case LM94_MFR_ID:
+       case LM94_MFR_ID_PROTOTYPE:
+               name = "lm94";
+               break;
+       default:
                dev_dbg(&adapter->dev,
                        "detect failed, bad version id 0x%02x!\n", ver);
                return -ENODEV;
        }
 
-       strlcpy(info->type, "lm93", I2C_NAME_SIZE);
+       strlcpy(info->type, name, I2C_NAME_SIZE);
        dev_dbg(&adapter->dev,"loading %s at %d,0x%02x\n",
                client->name, i2c_adapter_id(client->adapter),
                client->addr);
@@ -2602,6 +2618,7 @@ static int lm93_remove(struct i2c_client *client)
 
 static const struct i2c_device_id lm93_id[] = {
        { "lm93", 0 },
+       { "lm94", 0 },
        { }
 };
 MODULE_DEVICE_TABLE(i2c, lm93_id);
index 98ccfeb3f5aafcf2306666221eccc026aa632140..9827c5e686cb380d4a0c79f5c1e7a2a1d3c4c9a4 100644 (file)
@@ -134,7 +134,7 @@ config BLK_DEV_IDECD
          module will be called ide-cd.
 
 config BLK_DEV_IDECD_VERBOSE_ERRORS
-       bool "Verbose error logging for IDE/ATAPI CDROM driver" if EMBEDDED
+       bool "Verbose error logging for IDE/ATAPI CDROM driver" if EXPERT
        depends on BLK_DEV_IDECD
        default y
        help
index 03efc074967e2b5344f18acc25f23d2ecf14b2c0..da314c3fec23f905c37313439aa64573a0f5b0e3 100644 (file)
@@ -7,7 +7,7 @@ config INFINIBAND_MTHCA
          ("Tavor") and the MT25208 PCI Express HCA ("Arbel").
 
 config INFINIBAND_MTHCA_DEBUG
-       bool "Verbose debugging output" if EMBEDDED
+       bool "Verbose debugging output" if EXPERT
        depends on INFINIBAND_MTHCA
        default y
        ---help---
index 55855eeabae72c34b45ccc0890ac940dc27e8dc3..cda8eac55fff167abdff061e24e8da5040ab8009 100644 (file)
@@ -24,7 +24,7 @@ config INFINIBAND_IPOIB_CM
          unless you limit mtu for these destinations to 2044.
 
 config INFINIBAND_IPOIB_DEBUG
-       bool "IP-over-InfiniBand debugging" if EMBEDDED
+       bool "IP-over-InfiniBand debugging" if EXPERT
        depends on INFINIBAND_IPOIB
        default y
        ---help---
index 07c2cd43109c1ea0332cfaefa0bdb30ceb801db3..1903c0f5b9257d2384cec4a8763cf116c2bb904e 100644 (file)
@@ -6,7 +6,7 @@ menu "Input device support"
        depends on !S390
 
 config INPUT
-       tristate "Generic input layer (needed for keyboard, mouse, ...)" if EMBEDDED
+       tristate "Generic input layer (needed for keyboard, mouse, ...)" if EXPERT
        default y
        help
          Say Y here if you have any input device (mouse, keyboard, tablet,
@@ -67,7 +67,7 @@ config INPUT_SPARSEKMAP
 comment "Userland interfaces"
 
 config INPUT_MOUSEDEV
-       tristate "Mouse interface" if EMBEDDED
+       tristate "Mouse interface" if EXPERT
        default y
        help
          Say Y here if you want your mouse to be accessible as char devices
@@ -150,7 +150,7 @@ config INPUT_EVBUG
          module will be called evbug.
 
 config INPUT_APMPOWER
-       tristate "Input Power Event -> APM Bridge" if EMBEDDED
+       tristate "Input Power Event -> APM Bridge" if EXPERT
        depends on INPUT && APM_EMULATION
        help
          Say Y here if you want suspend key events to trigger a user
index 7b3c0b8fa432842b091b20611d79a59364903020..417507348babea8fd204418dc6096b19836b95d2 100644 (file)
@@ -2,7 +2,7 @@
 # Input core configuration
 #
 menuconfig INPUT_KEYBOARD
-       bool "Keyboards" if EMBEDDED || !X86
+       bool "Keyboards" if EXPERT || !X86
        default y
        help
          Say Y here, and a list of supported keyboards will be displayed.
@@ -57,7 +57,7 @@ config KEYBOARD_ATARI
          module will be called atakbd.
 
 config KEYBOARD_ATKBD
-       tristate "AT keyboard" if EMBEDDED || !X86
+       tristate "AT keyboard" if EXPERT || !X86
        default y
        select SERIO
        select SERIO_LIBPS2
index bf5fd7f6a3134ee1fdf8b3119b10be9a5b1137f8..9c1e6ee8353187fe3d84a5fe0fb7b0f25260f601 100644 (file)
@@ -39,7 +39,7 @@ config MOUSE_PS2
          module will be called psmouse.
 
 config MOUSE_PS2_ALPS
-       bool "ALPS PS/2 mouse protocol extension" if EMBEDDED
+       bool "ALPS PS/2 mouse protocol extension" if EXPERT
        default y
        depends on MOUSE_PS2
        help
@@ -49,7 +49,7 @@ config MOUSE_PS2_ALPS
          If unsure, say Y.
 
 config MOUSE_PS2_LOGIPS2PP
-       bool "Logitech PS/2++ mouse protocol extension" if EMBEDDED
+       bool "Logitech PS/2++ mouse protocol extension" if EXPERT
        default y
        depends on MOUSE_PS2
        help
@@ -59,7 +59,7 @@ config MOUSE_PS2_LOGIPS2PP
          If unsure, say Y.
 
 config MOUSE_PS2_SYNAPTICS
-       bool "Synaptics PS/2 mouse protocol extension" if EMBEDDED
+       bool "Synaptics PS/2 mouse protocol extension" if EXPERT
        default y
        depends on MOUSE_PS2
        help
@@ -69,7 +69,7 @@ config MOUSE_PS2_SYNAPTICS
          If unsure, say Y.
 
 config MOUSE_PS2_LIFEBOOK
-       bool "Fujitsu Lifebook PS/2 mouse protocol extension" if EMBEDDED
+       bool "Fujitsu Lifebook PS/2 mouse protocol extension" if EXPERT
        default y
        depends on MOUSE_PS2 && X86 && DMI
        help
@@ -79,7 +79,7 @@ config MOUSE_PS2_LIFEBOOK
          If unsure, say Y.
 
 config MOUSE_PS2_TRACKPOINT
-       bool "IBM Trackpoint PS/2 mouse protocol extension" if EMBEDDED
+       bool "IBM Trackpoint PS/2 mouse protocol extension" if EXPERT
        default y
        depends on MOUSE_PS2
        help
index 307eef77a172f2b3db4839096c491786955ae3cb..55f2c2293ec6a7aee2c1a7573af2c0d43c1f9c28 100644 (file)
@@ -2,7 +2,7 @@
 # Input core configuration
 #
 config SERIO
-       tristate "Serial I/O support" if EMBEDDED || !X86
+       tristate "Serial I/O support" if EXPERT || !X86
        default y
        help
          Say Yes here if you have any input device that uses serial I/O to
@@ -19,7 +19,7 @@ config SERIO
 if SERIO
 
 config SERIO_I8042
-       tristate "i8042 PC Keyboard controller" if EMBEDDED || !X86
+       tristate "i8042 PC Keyboard controller" if EXPERT || !X86
        default y
        depends on !PARISC && (!ARM || ARCH_SHARK || FOOTBRIDGE_HOST) && \
                   (!SUPERH || SH_CAYMAN) && !M68K && !BLACKFIN
@@ -168,7 +168,7 @@ config SERIO_MACEPS2
          module will be called maceps2.
 
 config SERIO_LIBPS2
-       tristate "PS/2 driver library" if EMBEDDED
+       tristate "PS/2 driver library" if EXPERT
        depends on SERIO_I8042 || SERIO_I8042=n
        help
          Say Y here if you are using a driver for device connected
index 0c9f4b158ff0db22b0f2bcbfb697da1307ad18db..61834ae282e13c72be5ea2fad3dca266debc91b3 100644 (file)
@@ -540,62 +540,62 @@ config TOUCHSCREEN_MC13783
 
 config TOUCHSCREEN_USB_EGALAX
        default y
-       bool "eGalax, eTurboTouch CT-410/510/700 device support" if EMBEDDED
+       bool "eGalax, eTurboTouch CT-410/510/700 device support" if EXPERT
        depends on TOUCHSCREEN_USB_COMPOSITE
 
 config TOUCHSCREEN_USB_PANJIT
        default y
-       bool "PanJit device support" if EMBEDDED
+       bool "PanJit device support" if EXPERT
        depends on TOUCHSCREEN_USB_COMPOSITE
 
 config TOUCHSCREEN_USB_3M
        default y
-       bool "3M/Microtouch EX II series device support" if EMBEDDED
+       bool "3M/Microtouch EX II series device support" if EXPERT
        depends on TOUCHSCREEN_USB_COMPOSITE
 
 config TOUCHSCREEN_USB_ITM
        default y
-       bool "ITM device support" if EMBEDDED
+       bool "ITM device support" if EXPERT
        depends on TOUCHSCREEN_USB_COMPOSITE
 
 config TOUCHSCREEN_USB_ETURBO
        default y
-       bool "eTurboTouch (non-eGalax compatible) device support" if EMBEDDED
+       bool "eTurboTouch (non-eGalax compatible) device support" if EXPERT
        depends on TOUCHSCREEN_USB_COMPOSITE
 
 config TOUCHSCREEN_USB_GUNZE
        default y
-       bool "Gunze AHL61 device support" if EMBEDDED
+       bool "Gunze AHL61 device support" if EXPERT
        depends on TOUCHSCREEN_USB_COMPOSITE
 
 config TOUCHSCREEN_USB_DMC_TSC10
        default y
-       bool "DMC TSC-10/25 device support" if EMBEDDED
+       bool "DMC TSC-10/25 device support" if EXPERT
        depends on TOUCHSCREEN_USB_COMPOSITE
 
 config TOUCHSCREEN_USB_IRTOUCH
        default y
-       bool "IRTOUCHSYSTEMS/UNITOP device support" if EMBEDDED
+       bool "IRTOUCHSYSTEMS/UNITOP device support" if EXPERT
        depends on TOUCHSCREEN_USB_COMPOSITE
 
 config TOUCHSCREEN_USB_IDEALTEK
        default y
-       bool "IdealTEK URTC1000 device support" if EMBEDDED
+       bool "IdealTEK URTC1000 device support" if EXPERT
        depends on TOUCHSCREEN_USB_COMPOSITE
 
 config TOUCHSCREEN_USB_GENERAL_TOUCH
        default y
-       bool "GeneralTouch Touchscreen device support" if EMBEDDED
+       bool "GeneralTouch Touchscreen device support" if EXPERT
        depends on TOUCHSCREEN_USB_COMPOSITE
 
 config TOUCHSCREEN_USB_GOTOP
        default y
-       bool "GoTop Super_Q2/GogoPen/PenPower tablet device support" if EMBEDDED
+       bool "GoTop Super_Q2/GogoPen/PenPower tablet device support" if EXPERT
        depends on TOUCHSCREEN_USB_COMPOSITE
 
 config TOUCHSCREEN_USB_JASTEC
        default y
-       bool "JASTEC/DigiTech DTR-02U USB touch controller device support" if EMBEDDED
+       bool "JASTEC/DigiTech DTR-02U USB touch controller device support" if EXPERT
        depends on TOUCHSCREEN_USB_COMPOSITE
 
 config TOUCHSCREEN_USB_E2I
@@ -605,17 +605,17 @@ config TOUCHSCREEN_USB_E2I
 
 config TOUCHSCREEN_USB_ZYTRONIC
        default y
-       bool "Zytronic controller" if EMBEDDED
+       bool "Zytronic controller" if EXPERT
        depends on TOUCHSCREEN_USB_COMPOSITE
 
 config TOUCHSCREEN_USB_ETT_TC45USB
        default y
-       bool "ET&T USB series TC4UM/TC5UH touchscreen controller support" if EMBEDDED
+       bool "ET&T USB series TC4UM/TC5UH touchscreen controller support" if EXPERT
        depends on TOUCHSCREEN_USB_COMPOSITE
 
 config TOUCHSCREEN_USB_NEXIO
        default y
-       bool "NEXIO/iNexio device support" if EMBEDDED
+       bool "NEXIO/iNexio device support" if EXPERT
        depends on TOUCHSCREEN_USB_COMPOSITE
 
 config TOUCHSCREEN_TOUCHIT213
index 991d93be0f447313945b6925a0a196c19a9586e2..ecc4bf3f37a937d74ab71f6c6cf91c9fc3763eb9 100644 (file)
@@ -99,7 +99,7 @@ static ssize_t gpio_trig_inverted_show(struct device *dev,
        struct led_classdev *led = dev_get_drvdata(dev);
        struct gpio_trig_data *gpio_data = led->trigger_data;
 
-       return sprintf(buf, "%s\n", gpio_data->inverted ? "yes" : "no");
+       return sprintf(buf, "%u\n", gpio_data->inverted);
 }
 
 static ssize_t gpio_trig_inverted_store(struct device *dev,
@@ -107,16 +107,17 @@ static ssize_t gpio_trig_inverted_store(struct device *dev,
 {
        struct led_classdev *led = dev_get_drvdata(dev);
        struct gpio_trig_data *gpio_data = led->trigger_data;
-       unsigned inverted;
+       unsigned long inverted;
        int ret;
 
-       ret = sscanf(buf, "%u", &inverted);
-       if (ret < 1) {
-               dev_err(dev, "invalid value\n");
+       ret = strict_strtoul(buf, 10, &inverted);
+       if (ret < 0)
+               return ret;
+
+       if (inverted > 1)
                return -EINVAL;
-       }
 
-       gpio_data->inverted = !!inverted;
+       gpio_data->inverted = inverted;
 
        /* After inverting, we need to update the LED. */
        schedule_work(&gpio_data->work);
index 04b22128a47421cac65a6dd73480ee56c87ded1d..d21578ee95dec6f4b07a05b9ff70aa07e64ecada 100644 (file)
@@ -1137,7 +1137,7 @@ void free_guest_pagetable(struct lguest *lg)
  */
 void map_switcher_in_guest(struct lg_cpu *cpu, struct lguest_pages *pages)
 {
-       pte_t *switcher_pte_page = __get_cpu_var(switcher_pte_pages);
+       pte_t *switcher_pte_page = __this_cpu_read(switcher_pte_pages);
        pte_t regs_pte;
 
 #ifdef CONFIG_X86_PAE
index b4eb675a807e6c71f021de8c84133bd6c26bc50b..9f1659c3d1f3fc895beaa4f30925e66eb55e662b 100644 (file)
@@ -90,8 +90,8 @@ static void copy_in_guest_info(struct lg_cpu *cpu, struct lguest_pages *pages)
         * meanwhile).  If that's not the case, we pretend everything in the
         * Guest has changed.
         */
-       if (__get_cpu_var(lg_last_cpu) != cpu || cpu->last_pages != pages) {
-               __get_cpu_var(lg_last_cpu) = cpu;
+       if (__this_cpu_read(lg_last_cpu) != cpu || cpu->last_pages != pages) {
+               __this_cpu_write(lg_last_cpu, cpu);
                cpu->last_pages = pages;
                cpu->changed = CHANGED_ALL;
        }
index 2e041fd0a00c41024aa6bfc8b42ee3a3d2b0ba4e..f3a29f264db9d6ca9624e8b18b21a8a67607728a 100644 (file)
@@ -443,7 +443,7 @@ static int fan_read_reg(int reg, unsigned char *buf, int nb)
        tries = 0;
        for (;;) {
                nr = i2c_master_recv(fcu, buf, nb);
-               if (nr > 0 || (nr < 0 && nr != ENODEV) || tries >= 100)
+               if (nr > 0 || (nr < 0 && nr != -ENODEV) || tries >= 100)
                        break;
                msleep(10);
                ++tries;
@@ -464,7 +464,7 @@ static int fan_write_reg(int reg, const unsigned char *ptr, int nb)
        tries = 0;
        for (;;) {
                nw = i2c_master_send(fcu, buf, nb);
-               if (nw > 0 || (nw < 0 && nw != EIO) || tries >= 100)
+               if (nw > 0 || (nw < 0 && nw != -EIO) || tries >= 100)
                        break;
                msleep(10);
                ++tries;
index 982f000a57ffc896eeeda4c8295db20fdb6ff8c6..9f47e383c57a5778bc39161c06d2c6631d317b46 100644 (file)
@@ -452,7 +452,7 @@ static int saa7146_init_one(struct pci_dev *pci, const struct pci_device_id *ent
        INFO(("found saa7146 @ mem %p (revision %d, irq %d) (0x%04x,0x%04x).\n", dev->mem, dev->revision, pci->irq, pci->subsystem_vendor, pci->subsystem_device));
        dev->ext = ext;
 
-       mutex_init(&dev->lock);
+       mutex_init(&dev->v4l2_lock);
        spin_lock_init(&dev->int_slock);
        spin_lock_init(&dev->slock);
 
index e3fedc60fe7775bb0586492061ef63a50c0e0d27..1bd3dd762c6b9a9c955bbbb3f1035a709fd8bb83 100644 (file)
@@ -15,18 +15,15 @@ int saa7146_res_get(struct saa7146_fh *fh, unsigned int bit)
        }
 
        /* is it free? */
-       mutex_lock(&dev->lock);
        if (vv->resources & bit) {
                DEB_D(("locked! vv->resources:0x%02x, we want:0x%02x\n",vv->resources,bit));
                /* no, someone else uses it */
-               mutex_unlock(&dev->lock);
                return 0;
        }
        /* it's free, grab it */
        fh->resources  |= bit;
        vv->resources |= bit;
        DEB_D(("res: get 0x%02x, cur:0x%02x\n",bit,vv->resources));
-       mutex_unlock(&dev->lock);
        return 1;
 }
 
@@ -37,11 +34,9 @@ void saa7146_res_free(struct saa7146_fh *fh, unsigned int bits)
 
        BUG_ON((fh->resources & bits) != bits);
 
-       mutex_lock(&dev->lock);
        fh->resources  &= ~bits;
        vv->resources &= ~bits;
        DEB_D(("res: put 0x%02x, cur:0x%02x\n",bits,vv->resources));
-       mutex_unlock(&dev->lock);
 }
 
 
@@ -396,7 +391,7 @@ static const struct v4l2_file_operations video_fops =
        .write          = fops_write,
        .poll           = fops_poll,
        .mmap           = fops_mmap,
-       .ioctl          = video_ioctl2,
+       .unlocked_ioctl = video_ioctl2,
 };
 
 static void vv_callback(struct saa7146_dev *dev, unsigned long status)
@@ -505,6 +500,7 @@ int saa7146_register_device(struct video_device **vid, struct saa7146_dev* dev,
        vfd->fops = &video_fops;
        vfd->ioctl_ops = &dev->ext_vv_data->ops;
        vfd->release = video_device_release;
+       vfd->lock = &dev->v4l2_lock;
        vfd->tvnorms = 0;
        for (i = 0; i < dev->ext_vv_data->num_stds; i++)
                vfd->tvnorms |= dev->ext_vv_data->stds[i].id;
index 2d4533ab22b7918e457f0a0bdfeccb03eb1f3bbd..afe85801d6ca8480309db96d77c9215b200dbd63 100644 (file)
@@ -412,7 +412,7 @@ static int vbi_open(struct saa7146_dev *dev, struct file *file)
                            V4L2_BUF_TYPE_VBI_CAPTURE,
                            V4L2_FIELD_SEQ_TB, // FIXME: does this really work?
                            sizeof(struct saa7146_buf),
-                           file, NULL);
+                           file, &dev->v4l2_lock);
 
        init_timer(&fh->vbi_read_timeout);
        fh->vbi_read_timeout.function = vbi_read_timeout;
index 0ac5c619aecfcc60f56e152b1477522de44107bf..9aafa4e969a8c741c95f01bd01efa6d4bcf12019 100644 (file)
@@ -553,8 +553,6 @@ static int vidioc_s_fbuf(struct file *file, void *fh, struct v4l2_framebuffer *f
                }
        }
 
-       mutex_lock(&dev->lock);
-
        /* ok, accept it */
        vv->ov_fb = *fb;
        vv->ov_fmt = fmt;
@@ -563,8 +561,6 @@ static int vidioc_s_fbuf(struct file *file, void *fh, struct v4l2_framebuffer *f
                vv->ov_fb.fmt.bytesperline = vv->ov_fb.fmt.width * fmt->depth / 8;
                DEB_D(("setting bytesperline to %d\n", vv->ov_fb.fmt.bytesperline));
        }
-
-       mutex_unlock(&dev->lock);
        return 0;
 }
 
@@ -649,8 +645,6 @@ static int vidioc_s_ctrl(struct file *file, void *fh, struct v4l2_control *c)
                return -EINVAL;
        }
 
-       mutex_lock(&dev->lock);
-
        switch (ctrl->type) {
        case V4L2_CTRL_TYPE_BOOLEAN:
        case V4L2_CTRL_TYPE_MENU:
@@ -693,7 +687,6 @@ static int vidioc_s_ctrl(struct file *file, void *fh, struct v4l2_control *c)
                /* fixme: we can support changing VFLIP and HFLIP here... */
                if (IS_CAPTURE_ACTIVE(fh) != 0) {
                        DEB_D(("V4L2_CID_HFLIP while active capture.\n"));
-                       mutex_unlock(&dev->lock);
                        return -EBUSY;
                }
                vv->hflip = c->value;
@@ -701,16 +694,13 @@ static int vidioc_s_ctrl(struct file *file, void *fh, struct v4l2_control *c)
        case V4L2_CID_VFLIP:
                if (IS_CAPTURE_ACTIVE(fh) != 0) {
                        DEB_D(("V4L2_CID_VFLIP while active capture.\n"));
-                       mutex_unlock(&dev->lock);
                        return -EBUSY;
                }
                vv->vflip = c->value;
                break;
        default:
-               mutex_unlock(&dev->lock);
                return -EINVAL;
        }
-       mutex_unlock(&dev->lock);
 
        if (IS_OVERLAY_ACTIVE(fh) != 0) {
                saa7146_stop_preview(fh);
@@ -902,22 +892,18 @@ static int vidioc_s_fmt_vid_overlay(struct file *file, void *__fh, struct v4l2_f
        err = vidioc_try_fmt_vid_overlay(file, fh, f);
        if (0 != err)
                return err;
-       mutex_lock(&dev->lock);
        fh->ov.win    = f->fmt.win;
        fh->ov.nclips = f->fmt.win.clipcount;
        if (fh->ov.nclips > 16)
                fh->ov.nclips = 16;
        if (copy_from_user(fh->ov.clips, f->fmt.win.clips,
                                sizeof(struct v4l2_clip) * fh->ov.nclips)) {
-               mutex_unlock(&dev->lock);
                return -EFAULT;
        }
 
        /* fh->ov.fh is used to indicate that we have valid overlay informations, too */
        fh->ov.fh = fh;
 
-       mutex_unlock(&dev->lock);
-
        /* check if our current overlay is active */
        if (IS_OVERLAY_ACTIVE(fh) != 0) {
                saa7146_stop_preview(fh);
@@ -976,8 +962,6 @@ static int vidioc_s_std(struct file *file, void *fh, v4l2_std_id *id)
                }
        }
 
-       mutex_lock(&dev->lock);
-
        for (i = 0; i < dev->ext_vv_data->num_stds; i++)
                if (*id & dev->ext_vv_data->stds[i].id)
                        break;
@@ -988,8 +972,6 @@ static int vidioc_s_std(struct file *file, void *fh, v4l2_std_id *id)
                found = 1;
        }
 
-       mutex_unlock(&dev->lock);
-
        if (vv->ov_suspend != NULL) {
                saa7146_start_preview(vv->ov_suspend);
                vv->ov_suspend = NULL;
@@ -1354,7 +1336,7 @@ static int video_open(struct saa7146_dev *dev, struct file *file)
                            V4L2_BUF_TYPE_VIDEO_CAPTURE,
                            V4L2_FIELD_INTERLACED,
                            sizeof(struct saa7146_buf),
-                           file, NULL);
+                           file, &dev->v4l2_lock);
 
        return 0;
 }
index 78b089526e028745a30f32bccc90cd384ba632b3..6fc79f15dcbc67d00b86db6f115d66b4e74c731d 100644 (file)
@@ -34,7 +34,7 @@ config MEDIA_TUNER
 config MEDIA_TUNER_CUSTOMISE
        bool "Customize analog and hybrid tuner modules to build"
        depends on MEDIA_TUNER
-       default y if EMBEDDED
+       default y if EXPERT
        help
          This allows the user to deselect tuner drivers unnecessary
          for their hardware from the build. Use this option with care
index c9062ceddc719d25cb05fbe253c1f8d3dc46b8ae..bc6a67768af1ed7a7ecb35b6af176895bf69e533 100644 (file)
@@ -95,8 +95,7 @@ static int tda8295_i2c_bridge(struct dvb_frontend *fe, int close)
                msleep(20);
        } else {
                msg = disable;
-               tuner_i2c_xfer_send(&priv->i2c_props, msg, 1);
-               tuner_i2c_xfer_recv(&priv->i2c_props, &msg[1], 1);
+               tuner_i2c_xfer_send_recv(&priv->i2c_props, msg, 1, &msg[1], 1);
 
                buf[2] = msg[1];
                buf[2] &= ~0x04;
@@ -233,19 +232,22 @@ static void tda8290_set_params(struct dvb_frontend *fe,
                tuner_i2c_xfer_send(&priv->i2c_props, pll_bw_nom, 2);
        }
 
+
        tda8290_i2c_bridge(fe, 1);
 
        if (fe->ops.tuner_ops.set_analog_params)
                fe->ops.tuner_ops.set_analog_params(fe, params);
 
        for (i = 0; i < 3; i++) {
-               tuner_i2c_xfer_send(&priv->i2c_props, &addr_pll_stat, 1);
-               tuner_i2c_xfer_recv(&priv->i2c_props, &pll_stat, 1);
+               tuner_i2c_xfer_send_recv(&priv->i2c_props,
+                                        &addr_pll_stat, 1, &pll_stat, 1);
                if (pll_stat & 0x80) {
-                       tuner_i2c_xfer_send(&priv->i2c_props, &addr_adc_sat, 1);
-                       tuner_i2c_xfer_recv(&priv->i2c_props, &adc_sat, 1);
-                       tuner_i2c_xfer_send(&priv->i2c_props, &addr_agc_stat, 1);
-                       tuner_i2c_xfer_recv(&priv->i2c_props, &agc_stat, 1);
+                       tuner_i2c_xfer_send_recv(&priv->i2c_props,
+                                                &addr_adc_sat, 1,
+                                                &adc_sat, 1);
+                       tuner_i2c_xfer_send_recv(&priv->i2c_props,
+                                                &addr_agc_stat, 1,
+                                                &agc_stat, 1);
                        tuner_dbg("tda8290 is locked, AGC: %d\n", agc_stat);
                        break;
                } else {
@@ -259,20 +261,22 @@ static void tda8290_set_params(struct dvb_frontend *fe,
                           agc_stat, adc_sat, pll_stat & 0x80);
                tuner_i2c_xfer_send(&priv->i2c_props, gainset_2, 2);
                msleep(100);
-               tuner_i2c_xfer_send(&priv->i2c_props, &addr_agc_stat, 1);
-               tuner_i2c_xfer_recv(&priv->i2c_props, &agc_stat, 1);
-               tuner_i2c_xfer_send(&priv->i2c_props, &addr_pll_stat, 1);
-               tuner_i2c_xfer_recv(&priv->i2c_props, &pll_stat, 1);
+               tuner_i2c_xfer_send_recv(&priv->i2c_props,
+                                        &addr_agc_stat, 1, &agc_stat, 1);
+               tuner_i2c_xfer_send_recv(&priv->i2c_props,
+                                        &addr_pll_stat, 1, &pll_stat, 1);
                if ((agc_stat > 115) || !(pll_stat & 0x80)) {
                        tuner_dbg("adjust gain, step 2. Agc: %d, lock: %d\n",
                                   agc_stat, pll_stat & 0x80);
                        if (priv->cfg.agcf)
                                priv->cfg.agcf(fe);
                        msleep(100);
-                       tuner_i2c_xfer_send(&priv->i2c_props, &addr_agc_stat, 1);
-                       tuner_i2c_xfer_recv(&priv->i2c_props, &agc_stat, 1);
-                       tuner_i2c_xfer_send(&priv->i2c_props, &addr_pll_stat, 1);
-                       tuner_i2c_xfer_recv(&priv->i2c_props, &pll_stat, 1);
+                       tuner_i2c_xfer_send_recv(&priv->i2c_props,
+                                                &addr_agc_stat, 1,
+                                                &agc_stat, 1);
+                       tuner_i2c_xfer_send_recv(&priv->i2c_props,
+                                                &addr_pll_stat, 1,
+                                                &pll_stat, 1);
                        if((agc_stat > 115) || !(pll_stat & 0x80)) {
                                tuner_dbg("adjust gain, step 3. Agc: %d\n", agc_stat);
                                tuner_i2c_xfer_send(&priv->i2c_props, adc_head_12, 2);
@@ -284,10 +288,12 @@ static void tda8290_set_params(struct dvb_frontend *fe,
 
        /* l/ l' deadlock? */
        if(priv->tda8290_easy_mode & 0x60) {
-               tuner_i2c_xfer_send(&priv->i2c_props, &addr_adc_sat, 1);
-               tuner_i2c_xfer_recv(&priv->i2c_props, &adc_sat, 1);
-               tuner_i2c_xfer_send(&priv->i2c_props, &addr_pll_stat, 1);
-               tuner_i2c_xfer_recv(&priv->i2c_props, &pll_stat, 1);
+               tuner_i2c_xfer_send_recv(&priv->i2c_props,
+                                        &addr_adc_sat, 1,
+                                        &adc_sat, 1);
+               tuner_i2c_xfer_send_recv(&priv->i2c_props,
+                                        &addr_pll_stat, 1,
+                                        &pll_stat, 1);
                if ((adc_sat > 20) || !(pll_stat & 0x80)) {
                        tuner_dbg("trying to resolve SECAM L deadlock\n");
                        tuner_i2c_xfer_send(&priv->i2c_props, agc_rst_on, 2);
@@ -307,8 +313,7 @@ static void tda8295_power(struct dvb_frontend *fe, int enable)
        struct tda8290_priv *priv = fe->analog_demod_priv;
        unsigned char buf[] = { 0x30, 0x00 }; /* clb_stdbt */
 
-       tuner_i2c_xfer_send(&priv->i2c_props, &buf[0], 1);
-       tuner_i2c_xfer_recv(&priv->i2c_props, &buf[1], 1);
+       tuner_i2c_xfer_send_recv(&priv->i2c_props, &buf[0], 1, &buf[1], 1);
 
        if (enable)
                buf[1] = 0x01;
@@ -323,8 +328,7 @@ static void tda8295_set_easy_mode(struct dvb_frontend *fe, int enable)
        struct tda8290_priv *priv = fe->analog_demod_priv;
        unsigned char buf[] = { 0x01, 0x00 };
 
-       tuner_i2c_xfer_send(&priv->i2c_props, &buf[0], 1);
-       tuner_i2c_xfer_recv(&priv->i2c_props, &buf[1], 1);
+       tuner_i2c_xfer_send_recv(&priv->i2c_props, &buf[0], 1, &buf[1], 1);
 
        if (enable)
                buf[1] = 0x01; /* rising edge sets regs 0x02 - 0x23 */
@@ -353,8 +357,7 @@ static void tda8295_agc1_out(struct dvb_frontend *fe, int enable)
        struct tda8290_priv *priv = fe->analog_demod_priv;
        unsigned char buf[] = { 0x02, 0x00 }; /* DIV_FUNC */
 
-       tuner_i2c_xfer_send(&priv->i2c_props, &buf[0], 1);
-       tuner_i2c_xfer_recv(&priv->i2c_props, &buf[1], 1);
+       tuner_i2c_xfer_send_recv(&priv->i2c_props, &buf[0], 1, &buf[1], 1);
 
        if (enable)
                buf[1] &= ~0x40;
@@ -370,10 +373,10 @@ static void tda8295_agc2_out(struct dvb_frontend *fe, int enable)
        unsigned char set_gpio_cf[]    = { 0x44, 0x00 };
        unsigned char set_gpio_val[]   = { 0x46, 0x00 };
 
-       tuner_i2c_xfer_send(&priv->i2c_props, &set_gpio_cf[0], 1);
-       tuner_i2c_xfer_recv(&priv->i2c_props, &set_gpio_cf[1], 1);
-       tuner_i2c_xfer_send(&priv->i2c_props, &set_gpio_val[0], 1);
-       tuner_i2c_xfer_recv(&priv->i2c_props, &set_gpio_val[1], 1);
+       tuner_i2c_xfer_send_recv(&priv->i2c_props,
+                                &set_gpio_cf[0], 1, &set_gpio_cf[1], 1);
+       tuner_i2c_xfer_send_recv(&priv->i2c_props,
+                                &set_gpio_val[0], 1, &set_gpio_val[1], 1);
 
        set_gpio_cf[1] &= 0xf0; /* clear GPIO_0 bits 3-0 */
 
@@ -392,8 +395,7 @@ static int tda8295_has_signal(struct dvb_frontend *fe)
        unsigned char hvpll_stat = 0x26;
        unsigned char ret;
 
-       tuner_i2c_xfer_send(&priv->i2c_props, &hvpll_stat, 1);
-       tuner_i2c_xfer_recv(&priv->i2c_props, &ret, 1);
+       tuner_i2c_xfer_send_recv(&priv->i2c_props, &hvpll_stat, 1, &ret, 1);
        return (ret & 0x01) ? 65535 : 0;
 }
 
@@ -413,8 +415,8 @@ static void tda8295_set_params(struct dvb_frontend *fe,
        tda8295_power(fe, 1);
        tda8295_agc1_out(fe, 1);
 
-       tuner_i2c_xfer_send(&priv->i2c_props, &blanking_mode[0], 1);
-       tuner_i2c_xfer_recv(&priv->i2c_props, &blanking_mode[1], 1);
+       tuner_i2c_xfer_send_recv(&priv->i2c_props,
+                                &blanking_mode[0], 1, &blanking_mode[1], 1);
 
        tda8295_set_video_std(fe);
 
@@ -447,8 +449,8 @@ static int tda8290_has_signal(struct dvb_frontend *fe)
        unsigned char i2c_get_afc[1] = { 0x1B };
        unsigned char afc = 0;
 
-       tuner_i2c_xfer_send(&priv->i2c_props, i2c_get_afc, ARRAY_SIZE(i2c_get_afc));
-       tuner_i2c_xfer_recv(&priv->i2c_props, &afc, 1);
+       tuner_i2c_xfer_send_recv(&priv->i2c_props,
+                                i2c_get_afc, ARRAY_SIZE(i2c_get_afc), &afc, 1);
        return (afc & 0x80)? 65535:0;
 }
 
@@ -654,20 +656,26 @@ static int tda829x_find_tuner(struct dvb_frontend *fe)
 static int tda8290_probe(struct tuner_i2c_props *i2c_props)
 {
 #define TDA8290_ID 0x89
-       unsigned char tda8290_id[] = { 0x1f, 0x00 };
+       u8 reg = 0x1f, id;
+       struct i2c_msg msg_read[] = {
+               { .addr = 0x4b, .flags = 0, .len = 1, .buf = &reg },
+               { .addr = 0x4b, .flags = I2C_M_RD, .len = 1, .buf = &id },
+       };
 
        /* detect tda8290 */
-       tuner_i2c_xfer_send(i2c_props, &tda8290_id[0], 1);
-       tuner_i2c_xfer_recv(i2c_props, &tda8290_id[1], 1);
+       if (i2c_transfer(i2c_props->adap, msg_read, 2) != 2) {
+               printk(KERN_WARNING "%s: tda8290 couldn't read register 0x%02x\n",
+                              __func__, reg);
+               return -ENODEV;
+       }
 
-       if (tda8290_id[1] == TDA8290_ID) {
+       if (id == TDA8290_ID) {
                if (debug)
                        printk(KERN_DEBUG "%s: tda8290 detected @ %d-%04x\n",
                               __func__, i2c_adapter_id(i2c_props->adap),
                               i2c_props->addr);
                return 0;
        }
-
        return -ENODEV;
 }
 
@@ -675,16 +683,23 @@ static int tda8295_probe(struct tuner_i2c_props *i2c_props)
 {
 #define TDA8295_ID 0x8a
 #define TDA8295C2_ID 0x8b
-       unsigned char tda8295_id[] = { 0x2f, 0x00 };
+       u8 reg = 0x2f, id;
+       struct i2c_msg msg_read[] = {
+               { .addr = 0x4b, .flags = 0, .len = 1, .buf = &reg },
+               { .addr = 0x4b, .flags = I2C_M_RD, .len = 1, .buf = &id },
+       };
 
-       /* detect tda8295 */
-       tuner_i2c_xfer_send(i2c_props, &tda8295_id[0], 1);
-       tuner_i2c_xfer_recv(i2c_props, &tda8295_id[1], 1);
+       /* detect tda8290 */
+       if (i2c_transfer(i2c_props->adap, msg_read, 2) != 2) {
+               printk(KERN_WARNING "%s: tda8290 couldn't read register 0x%02x\n",
+                              __func__, reg);
+               return -ENODEV;
+       }
 
-       if ((tda8295_id[1] & 0xfe) == TDA8295_ID) {
+       if ((id & 0xfe) == TDA8295_ID) {
                if (debug)
                        printk(KERN_DEBUG "%s: %s detected @ %d-%04x\n",
-                              __func__, (tda8295_id[1] == TDA8295_ID) ?
+                              __func__, (id == TDA8295_ID) ?
                               "tda8295c1" : "tda8295c2",
                               i2c_adapter_id(i2c_props->adap),
                               i2c_props->addr);
@@ -740,9 +755,11 @@ struct dvb_frontend *tda829x_attach(struct dvb_frontend *fe,
                       sizeof(struct analog_demod_ops));
        }
 
-       if ((!(cfg) || (TDA829X_PROBE_TUNER == cfg->probe_tuner)) &&
-           (tda829x_find_tuner(fe) < 0))
-               goto fail;
+       if (!(cfg) || (TDA829X_PROBE_TUNER == cfg->probe_tuner)) {
+               tda8295_power(fe, 1);
+               if (tda829x_find_tuner(fe) < 0)
+                       goto fail;
+       }
 
        switch (priv->ver) {
        case TDA8290:
@@ -786,6 +803,8 @@ struct dvb_frontend *tda829x_attach(struct dvb_frontend *fe,
        return fe;
 
 fail:
+       memset(&fe->ops.analog_ops, 0, sizeof(struct analog_demod_ops));
+
        tda829x_release(fe);
        return NULL;
 }
@@ -809,8 +828,8 @@ int tda829x_probe(struct i2c_adapter *i2c_adap, u8 i2c_addr)
        int i;
 
        /* rule out tda9887, which would return the same byte repeatedly */
-       tuner_i2c_xfer_send(&i2c_props, soft_reset, 1);
-       tuner_i2c_xfer_recv(&i2c_props, buf, PROBE_BUFFER_SIZE);
+       tuner_i2c_xfer_send_recv(&i2c_props,
+                                soft_reset, 1, buf, PROBE_BUFFER_SIZE);
        for (i = 1; i < PROBE_BUFFER_SIZE; i++) {
                if (buf[i] != buf[0])
                        break;
@@ -827,13 +846,12 @@ int tda829x_probe(struct i2c_adapter *i2c_adap, u8 i2c_addr)
        /* fall back to old probing method */
        tuner_i2c_xfer_send(&i2c_props, easy_mode_b, 2);
        tuner_i2c_xfer_send(&i2c_props, soft_reset, 2);
-       tuner_i2c_xfer_send(&i2c_props, &addr_dto_lsb, 1);
-       tuner_i2c_xfer_recv(&i2c_props, &data, 1);
+       tuner_i2c_xfer_send_recv(&i2c_props, &addr_dto_lsb, 1, &data, 1);
        if (data == 0) {
                tuner_i2c_xfer_send(&i2c_props, easy_mode_g, 2);
                tuner_i2c_xfer_send(&i2c_props, soft_reset, 2);
-               tuner_i2c_xfer_send(&i2c_props, &addr_dto_lsb, 1);
-               tuner_i2c_xfer_recv(&i2c_props, &data, 1);
+               tuner_i2c_xfer_send_recv(&i2c_props,
+                                        &addr_dto_lsb, 1, &data, 1);
                if (data == 0x7b) {
                        return 0;
                }
index 8ca48f76dfa98dabba32e4af6175ff9e23066fcd..98ffb40728e34eeaed9f90e981950cae3610630e 100644 (file)
@@ -514,8 +514,8 @@ struct dib0700_rc_response {
        union {
                u16 system16;
                struct {
-                       u8 system;
                        u8 not_system;
+                       u8 system;
                };
        };
        u8 data;
@@ -575,7 +575,7 @@ static void dib0700_rc_urb_completion(struct urb *purb)
                if ((poll_reply->system ^ poll_reply->not_system) != 0xff) {
                        deb_data("NEC extended protocol\n");
                        /* NEC extended code - 24 bits */
-                       keycode = poll_reply->system16 << 8 | poll_reply->data;
+                       keycode = be16_to_cpu(poll_reply->system16) << 8 | poll_reply->data;
                } else {
                        deb_data("NEC normal protocol\n");
                        /* normal NEC code - 16 bits */
@@ -587,7 +587,7 @@ static void dib0700_rc_urb_completion(struct urb *purb)
                deb_data("RC5 protocol\n");
                /* RC5 Protocol */
                toggle = poll_reply->report_id;
-               keycode = poll_reply->system16 << 8 | poll_reply->data;
+               keycode = poll_reply->system << 8 | poll_reply->data;
 
                break;
        }
index fcf3828472b847b537887c8a6f996fe4d2093f79..f82d4a93feb3f205080a5bdc85d0dcf1b58f48ac 100644 (file)
@@ -172,7 +172,8 @@ void fdtv_unregister_rc(struct firedtv *fdtv)
 
 void fdtv_handle_rc(struct firedtv *fdtv, unsigned int code)
 {
-       u16 *keycode = fdtv->remote_ctrl_dev->keycode;
+       struct input_dev *idev = fdtv->remote_ctrl_dev;
+       u16 *keycode = idev->keycode;
 
        if (code >= 0x0300 && code <= 0x031f)
                code = keycode[code - 0x0300];
@@ -188,6 +189,8 @@ void fdtv_handle_rc(struct firedtv *fdtv, unsigned int code)
                return;
        }
 
-       input_report_key(fdtv->remote_ctrl_dev, code, 1);
-       input_report_key(fdtv->remote_ctrl_dev, code, 0);
+       input_report_key(idev, code, 1);
+       input_sync(idev);
+       input_report_key(idev, code, 0);
+       input_sync(idev);
 }
index ef3e43a0319997ad88506f0498a3956ed9ea99fe..b8519ba511e5326373dd6b873aa687bff3f0e94b 100644 (file)
@@ -1,7 +1,7 @@
 config DVB_FE_CUSTOMISE
        bool "Customise the frontend modules to build"
        depends on DVB_CORE
-       default y if EMBEDDED
+       default y if EXPERT
        help
          This allows the user to select/deselect frontend drivers for their
          hardware from the build.
index ce222055526d4d6debba76d1e07b416f2e65d0ad..ba25fa0b0fc2a5bfb098a94c258f9d913c1806c5 100644 (file)
@@ -334,11 +334,11 @@ static int af9013_set_freq_ctrl(struct af9013_state *state, fe_bandwidth_t bw)
                                if_sample_freq = 3300000; /* 3.3 MHz */
                                break;
                        case BANDWIDTH_7_MHZ:
-                               if_sample_freq = 3800000; /* 3.8 MHz */
+                               if_sample_freq = 3500000; /* 3.5 MHz */
                                break;
                        case BANDWIDTH_8_MHZ:
                        default:
-                               if_sample_freq = 4300000; /* 4.3 MHz */
+                               if_sample_freq = 4000000; /* 4.0 MHz */
                                break;
                        }
                } else if (state->config.tuner == AF9013_TUNER_TDA18218) {
index 6360c681ded9672db8ef5e21fd6128b01eeba336..6c2e929bd79f6d01c86b987d7a3f62a63c64c760 100644 (file)
@@ -311,7 +311,7 @@ struct dvb_frontend *ix2505v_attach(struct dvb_frontend *fe,
        return fe;
 
 error:
-       ix2505v_release(fe);
+       kfree(state);
        return NULL;
 }
 EXPORT_SYMBOL(ix2505v_attach);
index d3ad3e75a35a49eb52977a84f14853364a6e51cc..cc4acd2f920d6e1efd0842dbe49545f8b02ca360 100644 (file)
@@ -43,6 +43,8 @@ struct mb86a20s_state {
        const struct mb86a20s_config *config;
 
        struct dvb_frontend frontend;
+
+       bool need_init;
 };
 
 struct regdata {
@@ -318,7 +320,7 @@ static int mb86a20s_i2c_writereg(struct mb86a20s_state *state,
 
        rc = i2c_transfer(state->i2c, &msg, 1);
        if (rc != 1) {
-               printk("%s: writereg rcor(rc == %i, reg == 0x%02x,"
+               printk("%s: writereg error (rc == %i, reg == 0x%02x,"
                         " data == 0x%02x)\n", __func__, rc, reg, data);
                return rc;
        }
@@ -353,7 +355,7 @@ static int mb86a20s_i2c_readreg(struct mb86a20s_state *state,
        rc = i2c_transfer(state->i2c, msg, 2);
 
        if (rc != 2) {
-               rc("%s: reg=0x%x (rcor=%d)\n", __func__, reg, rc);
+               rc("%s: reg=0x%x (error=%d)\n", __func__, reg, rc);
                return rc;
        }
 
@@ -382,23 +384,31 @@ static int mb86a20s_initfe(struct dvb_frontend *fe)
        /* Initialize the frontend */
        rc = mb86a20s_writeregdata(state, mb86a20s_init);
        if (rc < 0)
-               return rc;
+               goto err;
 
        if (!state->config->is_serial) {
                regD5 &= ~1;
 
                rc = mb86a20s_writereg(state, 0x50, 0xd5);
                if (rc < 0)
-                       return rc;
+                       goto err;
                rc = mb86a20s_writereg(state, 0x51, regD5);
                if (rc < 0)
-                       return rc;
+                       goto err;
        }
 
        if (fe->ops.i2c_gate_ctrl)
                fe->ops.i2c_gate_ctrl(fe, 1);
 
-       return 0;
+err:
+       if (rc < 0) {
+               state->need_init = true;
+               printk(KERN_INFO "mb86a20s: Init failed. Will try again later\n");
+       } else {
+               state->need_init = false;
+               dprintk("Initialization succeded.\n");
+       }
+       return rc;
 }
 
 static int mb86a20s_read_signal_strength(struct dvb_frontend *fe, u16 *strength)
@@ -485,8 +495,22 @@ static int mb86a20s_set_frontend(struct dvb_frontend *fe,
 
        if (fe->ops.i2c_gate_ctrl)
                fe->ops.i2c_gate_ctrl(fe, 1);
+       dprintk("Calling tuner set parameters\n");
        fe->ops.tuner_ops.set_params(fe, p);
 
+       /*
+        * Make it more reliable: if, for some reason, the initial
+        * device initialization doesn't happen, initialize it when
+        * a SBTVD parameters are adjusted.
+        *
+        * Unfortunately, due to a hard to track bug at tda829x/tda18271,
+        * the agc callback logic is not called during DVB attach time,
+        * causing mb86a20s to not be initialized with Kworld SBTVD.
+        * So, this hack is needed, in order to make Kworld SBTVD to work.
+        */
+       if (state->need_init)
+               mb86a20s_initfe(fe);
+
        if (fe->ops.i2c_gate_ctrl)
                fe->ops.i2c_gate_ctrl(fe, 0);
        rc = mb86a20s_writeregdata(state, mb86a20s_reset_reception);
index 122c72806916560ce6c3ce3c676e626c0ff7574d..9fc1dd0ba4c35fc1d6030fb17dc90fbe75d5d849 100644 (file)
@@ -277,7 +277,7 @@ static int dvb_ca_ioctl(struct file *file, unsigned int cmd, void *parg)
        {
                ca_slot_info_t *info=(ca_slot_info_t *)parg;
 
-               if (info->num > 1)
+               if (info->num < 0 || info->num > 1)
                        return -EINVAL;
                av7110->ci_slot[info->num].num = info->num;
                av7110->ci_slot[info->num].type = FW_CI_LL_SUPPORT(av7110->arm_app) ?
index 3c5a4739ed70224b9ba11a3544a0a9ef2e935072..ecdffa6aac664e477b7608b563ee578d43b40936 100644 (file)
@@ -151,20 +151,6 @@ config RADIO_GEMTEK_PROBE
          following ports will be probed: 0x20c, 0x30c, 0x24c, 0x34c, 0x248 and
          0x28c.
 
-config RADIO_GEMTEK_PCI
-       tristate "GemTek PCI Radio Card support"
-       depends on VIDEO_V4L2 && PCI
-       ---help---
-         Choose Y here if you have this PCI FM radio card.
-
-         In order to control your radio card, you will need to use programs
-         that are compatible with the Video for Linux API.  Information on
-         this API and pointers to "v4l" programs may be found at
-         <file:Documentation/video4linux/API.html>.
-
-         To compile this driver as a module, choose M here: the
-         module will be called radio-gemtek-pci.
-
 config RADIO_MAXIRADIO
        tristate "Guillemot MAXI Radio FM 2000 radio"
        depends on VIDEO_V4L2 && PCI
index d2970748a69fdc29c6da8e0cc325b03d4e4f3227..717656d2f749d48657e72b082f428f8c20d8956a 100644 (file)
@@ -13,7 +13,6 @@ obj-$(CONFIG_RADIO_MAXIRADIO) += radio-maxiradio.o
 obj-$(CONFIG_RADIO_RTRACK) += radio-aimslab.o
 obj-$(CONFIG_RADIO_ZOLTRIX) += radio-zoltrix.o
 obj-$(CONFIG_RADIO_GEMTEK) += radio-gemtek.o
-obj-$(CONFIG_RADIO_GEMTEK_PCI) += radio-gemtek-pci.o
 obj-$(CONFIG_RADIO_TRUST) += radio-trust.o
 obj-$(CONFIG_I2C_SI4713) += si4713-i2c.o
 obj-$(CONFIG_RADIO_SI4713) += radio-si4713.o
index 6cc5d130fbc84b3251a995499da96c504b8d59cf..4ce10dbeadd861c587ad274ccdd09e784b9a729e 100644 (file)
@@ -31,6 +31,7 @@
 #include <linux/module.h>      /* Modules                      */
 #include <linux/init.h>                /* Initdata                     */
 #include <linux/ioport.h>      /* request_region               */
+#include <linux/delay.h>       /* msleep                       */
 #include <linux/videodev2.h>   /* kernel radio structs         */
 #include <linux/version.h>     /* for KERNEL_VERSION MACRO     */
 #include <linux/io.h>          /* outb, outb_p                 */
diff --git a/drivers/media/radio/radio-gemtek-pci.c b/drivers/media/radio/radio-gemtek-pci.c
deleted file mode 100644 (file)
index 28fa85b..0000000
+++ /dev/null
@@ -1,478 +0,0 @@
-/*
- ***************************************************************************
- *
- *     radio-gemtek-pci.c - Gemtek PCI Radio driver
- *     (C) 2001 Vladimir Shebordaev <vshebordaev@mail.ru>
- *
- ***************************************************************************
- *
- *     This program is free software; you can redistribute it and/or
- *     modify it under the terms of the GNU General Public License as
- *     published by the Free Software Foundation; either version 2 of
- *     the License, or (at your option) any later version.
- *
- *     This program is distributed in the hope that it will be useful,
- *     but WITHOUT ANY WARRANTY; without even the implied warranty of
- *     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *     GNU General Public License for more details.
- *
- *     You should have received a copy of the GNU General Public
- *     License along with this program; if not, write to the Free
- *     Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139,
- *     USA.
- *
- ***************************************************************************
- *
- *     Gemtek Corp still silently refuses to release any specifications
- *     of their multimedia devices, so the protocol still has to be
- *     reverse engineered.
- *
- *     The v4l code was inspired by Jonas Munsin's  Gemtek serial line
- *     radio device driver.
- *
- *     Please, let me know if this piece of code was useful :)
- *
- *     TODO: multiple device support and portability were not tested
- *
- *     Converted to V4L2 API by Mauro Carvalho Chehab <mchehab@infradead.org>
- *
- ***************************************************************************
- */
-
-#include <linux/types.h>
-#include <linux/list.h>
-#include <linux/module.h>
-#include <linux/init.h>
-#include <linux/pci.h>
-#include <linux/videodev2.h>
-#include <linux/errno.h>
-#include <linux/version.h>      /* for KERNEL_VERSION MACRO     */
-#include <linux/io.h>
-#include <linux/slab.h>
-#include <media/v4l2-device.h>
-#include <media/v4l2-ioctl.h>
-
-MODULE_AUTHOR("Vladimir Shebordaev <vshebordaev@mail.ru>");
-MODULE_DESCRIPTION("The video4linux driver for the Gemtek PCI Radio Card");
-MODULE_LICENSE("GPL");
-
-static int nr_radio = -1;
-static int mx = 1;
-
-module_param(mx, bool, 0);
-MODULE_PARM_DESC(mx, "single digit: 1 - turn off the turner upon module exit (default), 0 - do not");
-module_param(nr_radio, int, 0);
-MODULE_PARM_DESC(nr_radio, "video4linux device number to use");
-
-#define RADIO_VERSION KERNEL_VERSION(0, 0, 2)
-
-#ifndef PCI_VENDOR_ID_GEMTEK
-#define PCI_VENDOR_ID_GEMTEK 0x5046
-#endif
-
-#ifndef PCI_DEVICE_ID_GEMTEK_PR103
-#define PCI_DEVICE_ID_GEMTEK_PR103 0x1001
-#endif
-
-#ifndef GEMTEK_PCI_RANGE_LOW
-#define GEMTEK_PCI_RANGE_LOW (87*16000)
-#endif
-
-#ifndef GEMTEK_PCI_RANGE_HIGH
-#define GEMTEK_PCI_RANGE_HIGH (108*16000)
-#endif
-
-struct gemtek_pci {
-       struct v4l2_device v4l2_dev;
-       struct video_device vdev;
-       struct mutex lock;
-       struct pci_dev *pdev;
-
-       u32 iobase;
-       u32 length;
-
-       u32 current_frequency;
-       u8  mute;
-};
-
-static inline struct gemtek_pci *to_gemtek_pci(struct v4l2_device *v4l2_dev)
-{
-       return container_of(v4l2_dev, struct gemtek_pci, v4l2_dev);
-}
-
-static inline u8 gemtek_pci_out(u16 value, u32 port)
-{
-       outw(value, port);
-
-       return (u8)value;
-}
-
-#define _b0(v) (*((u8 *)&v))
-
-static void __gemtek_pci_cmd(u16 value, u32 port, u8 *last_byte, int keep)
-{
-       u8 byte = *last_byte;
-
-       if (!value) {
-               if (!keep)
-                       value = (u16)port;
-               byte &= 0xfd;
-       } else
-               byte |= 2;
-
-       _b0(value) = byte;
-       outw(value, port);
-       byte |= 1;
-       _b0(value) = byte;
-       outw(value, port);
-       byte &= 0xfe;
-       _b0(value) = byte;
-       outw(value, port);
-
-       *last_byte = byte;
-}
-
-static inline void gemtek_pci_nil(u32 port, u8 *last_byte)
-{
-       __gemtek_pci_cmd(0x00, port, last_byte, false);
-}
-
-static inline void gemtek_pci_cmd(u16 cmd, u32 port, u8 *last_byte)
-{
-       __gemtek_pci_cmd(cmd, port, last_byte, true);
-}
-
-static void gemtek_pci_setfrequency(struct gemtek_pci *card, unsigned long frequency)
-{
-       int i;
-       u32 value = frequency / 200 + 856;
-       u16 mask = 0x8000;
-       u8 last_byte;
-       u32 port = card->iobase;
-
-       mutex_lock(&card->lock);
-       card->current_frequency = frequency;
-       last_byte = gemtek_pci_out(0x06, port);
-
-       i = 0;
-       do {
-               gemtek_pci_nil(port, &last_byte);
-               i++;
-       } while (i < 9);
-
-       i = 0;
-       do {
-               gemtek_pci_cmd(value & mask, port, &last_byte);
-               mask >>= 1;
-               i++;
-       } while (i < 16);
-
-       outw(0x10, port);
-       mutex_unlock(&card->lock);
-}
-
-
-static void gemtek_pci_mute(struct gemtek_pci *card)
-{
-       mutex_lock(&card->lock);
-       outb(0x1f, card->iobase);
-       card->mute = true;
-       mutex_unlock(&card->lock);
-}
-
-static void gemtek_pci_unmute(struct gemtek_pci *card)
-{
-       if (card->mute) {
-               gemtek_pci_setfrequency(card, card->current_frequency);
-               card->mute = false;
-       }
-}
-
-static int gemtek_pci_getsignal(struct gemtek_pci *card)
-{
-       int sig;
-
-       mutex_lock(&card->lock);
-       sig = (inb(card->iobase) & 0x08) ? 0 : 1;
-       mutex_unlock(&card->lock);
-       return sig;
-}
-
-static int vidioc_querycap(struct file *file, void *priv,
-                                       struct v4l2_capability *v)
-{
-       struct gemtek_pci *card = video_drvdata(file);
-
-       strlcpy(v->driver, "radio-gemtek-pci", sizeof(v->driver));
-       strlcpy(v->card, "GemTek PCI Radio", sizeof(v->card));
-       snprintf(v->bus_info, sizeof(v->bus_info), "PCI:%s", pci_name(card->pdev));
-       v->version = RADIO_VERSION;
-       v->capabilities = V4L2_CAP_TUNER | V4L2_CAP_RADIO;
-       return 0;
-}
-
-static int vidioc_g_tuner(struct file *file, void *priv,
-                                       struct v4l2_tuner *v)
-{
-       struct gemtek_pci *card = video_drvdata(file);
-
-       if (v->index > 0)
-               return -EINVAL;
-
-       strlcpy(v->name, "FM", sizeof(v->name));
-       v->type = V4L2_TUNER_RADIO;
-       v->rangelow = GEMTEK_PCI_RANGE_LOW;
-       v->rangehigh = GEMTEK_PCI_RANGE_HIGH;
-       v->rxsubchans = V4L2_TUNER_SUB_MONO;
-       v->capability = V4L2_TUNER_CAP_LOW;
-       v->audmode = V4L2_TUNER_MODE_MONO;
-       v->signal = 0xffff * gemtek_pci_getsignal(card);
-       return 0;
-}
-
-static int vidioc_s_tuner(struct file *file, void *priv,
-                                       struct v4l2_tuner *v)
-{
-       return v->index ? -EINVAL : 0;
-}
-
-static int vidioc_s_frequency(struct file *file, void *priv,
-                                       struct v4l2_frequency *f)
-{
-       struct gemtek_pci *card = video_drvdata(file);
-
-       if (f->tuner != 0 || f->type != V4L2_TUNER_RADIO)
-               return -EINVAL;
-       if (f->frequency < GEMTEK_PCI_RANGE_LOW ||
-           f->frequency > GEMTEK_PCI_RANGE_HIGH)
-               return -EINVAL;
-       gemtek_pci_setfrequency(card, f->frequency);
-       card->mute = false;
-       return 0;
-}
-
-static int vidioc_g_frequency(struct file *file, void *priv,
-                                       struct v4l2_frequency *f)
-{
-       struct gemtek_pci *card = video_drvdata(file);
-
-       if (f->tuner != 0)
-               return -EINVAL;
-       f->type = V4L2_TUNER_RADIO;
-       f->frequency = card->current_frequency;
-       return 0;
-}
-
-static int vidioc_queryctrl(struct file *file, void *priv,
-                                       struct v4l2_queryctrl *qc)
-{
-       switch (qc->id) {
-       case V4L2_CID_AUDIO_MUTE:
-               return v4l2_ctrl_query_fill(qc, 0, 1, 1, 1);
-       case V4L2_CID_AUDIO_VOLUME:
-               return v4l2_ctrl_query_fill(qc, 0, 65535, 65535, 65535);
-       }
-       return -EINVAL;
-}
-
-static int vidioc_g_ctrl(struct file *file, void *priv,
-                                       struct v4l2_control *ctrl)
-{
-       struct gemtek_pci *card = video_drvdata(file);
-
-       switch (ctrl->id) {
-       case V4L2_CID_AUDIO_MUTE:
-               ctrl->value = card->mute;
-               return 0;
-       case V4L2_CID_AUDIO_VOLUME:
-               if (card->mute)
-                       ctrl->value = 0;
-               else
-                       ctrl->value = 65535;
-               return 0;
-       }
-       return -EINVAL;
-}
-
-static int vidioc_s_ctrl(struct file *file, void *priv,
-                                       struct v4l2_control *ctrl)
-{
-       struct gemtek_pci *card = video_drvdata(file);
-
-       switch (ctrl->id) {
-       case V4L2_CID_AUDIO_MUTE:
-               if (ctrl->value)
-                       gemtek_pci_mute(card);
-               else
-                       gemtek_pci_unmute(card);
-               return 0;
-       case V4L2_CID_AUDIO_VOLUME:
-               if (ctrl->value)
-                       gemtek_pci_unmute(card);
-               else
-                       gemtek_pci_mute(card);
-               return 0;
-       }
-       return -EINVAL;
-}
-
-static int vidioc_g_input(struct file *filp, void *priv, unsigned int *i)
-{
-       *i = 0;
-       return 0;
-}
-
-static int vidioc_s_input(struct file *filp, void *priv, unsigned int i)
-{
-       return i ? -EINVAL : 0;
-}
-
-static int vidioc_g_audio(struct file *file, void *priv,
-                                       struct v4l2_audio *a)
-{
-       a->index = 0;
-       strlcpy(a->name, "Radio", sizeof(a->name));
-       a->capability = V4L2_AUDCAP_STEREO;
-       return 0;
-}
-
-static int vidioc_s_audio(struct file *file, void *priv,
-                                       struct v4l2_audio *a)
-{
-       return a->index ? -EINVAL : 0;
-}
-
-enum {
-       GEMTEK_PR103
-};
-
-static char *card_names[] __devinitdata = {
-       "GEMTEK_PR103"
-};
-
-static struct pci_device_id gemtek_pci_id[] =
-{
-       { PCI_VENDOR_ID_GEMTEK, PCI_DEVICE_ID_GEMTEK_PR103,
-         PCI_ANY_ID, PCI_ANY_ID, 0, 0, GEMTEK_PR103 },
-       { 0 }
-};
-
-MODULE_DEVICE_TABLE(pci, gemtek_pci_id);
-
-static const struct v4l2_file_operations gemtek_pci_fops = {
-       .owner          = THIS_MODULE,
-       .unlocked_ioctl = video_ioctl2,
-};
-
-static const struct v4l2_ioctl_ops gemtek_pci_ioctl_ops = {
-       .vidioc_querycap    = vidioc_querycap,
-       .vidioc_g_tuner     = vidioc_g_tuner,
-       .vidioc_s_tuner     = vidioc_s_tuner,
-       .vidioc_g_audio     = vidioc_g_audio,
-       .vidioc_s_audio     = vidioc_s_audio,
-       .vidioc_g_input     = vidioc_g_input,
-       .vidioc_s_input     = vidioc_s_input,
-       .vidioc_g_frequency = vidioc_g_frequency,
-       .vidioc_s_frequency = vidioc_s_frequency,
-       .vidioc_queryctrl   = vidioc_queryctrl,
-       .vidioc_g_ctrl      = vidioc_g_ctrl,
-       .vidioc_s_ctrl      = vidioc_s_ctrl,
-};
-
-static int __devinit gemtek_pci_probe(struct pci_dev *pdev, const struct pci_device_id *pci_id)
-{
-       struct gemtek_pci *card;
-       struct v4l2_device *v4l2_dev;
-       int res;
-
-       card = kzalloc(sizeof(struct gemtek_pci), GFP_KERNEL);
-       if (card == NULL) {
-               dev_err(&pdev->dev, "out of memory\n");
-               return -ENOMEM;
-       }
-
-       v4l2_dev = &card->v4l2_dev;
-       mutex_init(&card->lock);
-       card->pdev = pdev;
-
-       strlcpy(v4l2_dev->name, "gemtek_pci", sizeof(v4l2_dev->name));
-
-       res = v4l2_device_register(&pdev->dev, v4l2_dev);
-       if (res < 0) {
-               v4l2_err(v4l2_dev, "Could not register v4l2_device\n");
-               kfree(card);
-               return res;
-       }
-
-       if (pci_enable_device(pdev))
-               goto err_pci;
-
-       card->iobase = pci_resource_start(pdev, 0);
-       card->length = pci_resource_len(pdev, 0);
-
-       if (request_region(card->iobase, card->length, card_names[pci_id->driver_data]) == NULL) {
-               v4l2_err(v4l2_dev, "i/o port already in use\n");
-               goto err_pci;
-       }
-
-       strlcpy(card->vdev.name, v4l2_dev->name, sizeof(card->vdev.name));
-       card->vdev.v4l2_dev = v4l2_dev;
-       card->vdev.fops = &gemtek_pci_fops;
-       card->vdev.ioctl_ops = &gemtek_pci_ioctl_ops;
-       card->vdev.release = video_device_release_empty;
-       video_set_drvdata(&card->vdev, card);
-
-       gemtek_pci_mute(card);
-
-       if (video_register_device(&card->vdev, VFL_TYPE_RADIO, nr_radio) < 0)
-               goto err_video;
-
-       v4l2_info(v4l2_dev, "Gemtek PCI Radio (rev. %d) found at 0x%04x-0x%04x.\n",
-               pdev->revision, card->iobase, card->iobase + card->length - 1);
-
-       return 0;
-
-err_video:
-       release_region(card->iobase, card->length);
-
-err_pci:
-       v4l2_device_unregister(v4l2_dev);
-       kfree(card);
-       return -ENODEV;
-}
-
-static void __devexit gemtek_pci_remove(struct pci_dev *pdev)
-{
-       struct v4l2_device *v4l2_dev = dev_get_drvdata(&pdev->dev);
-       struct gemtek_pci *card = to_gemtek_pci(v4l2_dev);
-
-       video_unregister_device(&card->vdev);
-       v4l2_device_unregister(v4l2_dev);
-
-       release_region(card->iobase, card->length);
-
-       if (mx)
-               gemtek_pci_mute(card);
-
-       kfree(card);
-}
-
-static struct pci_driver gemtek_pci_driver = {
-       .name           = "gemtek_pci",
-       .id_table       = gemtek_pci_id,
-       .probe          = gemtek_pci_probe,
-       .remove         = __devexit_p(gemtek_pci_remove),
-};
-
-static int __init gemtek_pci_init(void)
-{
-       return pci_register_driver(&gemtek_pci_driver);
-}
-
-static void __exit gemtek_pci_exit(void)
-{
-       pci_unregister_driver(&gemtek_pci_driver);
-}
-
-module_init(gemtek_pci_init);
-module_exit(gemtek_pci_exit);
index 6459a220b0dd46ddb22326e0595f8964ae4915d2..5c2a9058c09fd6966d4c47c8c44b8fd681e8d9a6 100644 (file)
@@ -77,8 +77,8 @@ MODULE_PARM_DESC(debug, "activates debug info");
 /* TEA5757 pin mappings */
 static const int clk = 1, data = 2, wren = 4, mo_st = 8, power = 16;
 
-#define FREQ_LO                (50 * 16000)
-#define FREQ_HI                (150 * 16000)
+#define FREQ_LO                (87 * 16000)
+#define FREQ_HI                (108 * 16000)
 
 #define FREQ_IF         171200 /* 10.7*16000   */
 #define FREQ_STEP       200    /* 12.5*16      */
index dd6bd364efa089d509ae78c0a28b20e0f63f62ad..7ecc8e657663edba0c23a6b2cbb1628f1e7dd606 100644 (file)
@@ -1407,7 +1407,7 @@ static const struct v4l2_file_operations wl1273_fops = {
        .read           = wl1273_fm_fops_read,
        .write          = wl1273_fm_fops_write,
        .poll           = wl1273_fm_fops_poll,
-       .ioctl          = video_ioctl2,
+       .unlocked_ioctl = video_ioctl2,
        .open           = wl1273_fm_fops_open,
        .release        = wl1273_fm_fops_release,
 };
index ac76dfe5b3fa09347c389950e6cf95e496f17441..60c176fe328ec4a38fb163e401428a148558a81e 100644 (file)
@@ -357,7 +357,8 @@ int si470x_start(struct si470x_device *radio)
                goto done;
 
        /* sysconfig 1 */
-       radio->registers[SYSCONFIG1] = SYSCONFIG1_DE;
+       radio->registers[SYSCONFIG1] =
+               (de << 11) & SYSCONFIG1_DE;             /* DE*/
        retval = si470x_set_register(radio, SYSCONFIG1);
        if (retval < 0)
                goto done;
@@ -687,12 +688,8 @@ static int si470x_vidioc_g_tuner(struct file *file, void *priv,
        /* driver constants */
        strcpy(tuner->name, "FM");
        tuner->type = V4L2_TUNER_RADIO;
-#if defined(CONFIG_USB_SI470X) || defined(CONFIG_USB_SI470X_MODULE)
        tuner->capability = V4L2_TUNER_CAP_LOW | V4L2_TUNER_CAP_STEREO |
                            V4L2_TUNER_CAP_RDS | V4L2_TUNER_CAP_RDS_BLOCK_IO;
-#else
-       tuner->capability = V4L2_TUNER_CAP_LOW | V4L2_TUNER_CAP_STEREO;
-#endif
 
        /* range limits */
        switch ((radio->registers[SYSCONFIG2] & SYSCONFIG2_BAND) >> 6) {
@@ -718,12 +715,10 @@ static int si470x_vidioc_g_tuner(struct file *file, void *priv,
                tuner->rxsubchans = V4L2_TUNER_SUB_MONO;
        else
                tuner->rxsubchans = V4L2_TUNER_SUB_MONO | V4L2_TUNER_SUB_STEREO;
-#if defined(CONFIG_USB_SI470X) || defined(CONFIG_USB_SI470X_MODULE)
        /* If there is a reliable method of detecting an RDS channel,
           then this code should check for that before setting this
           RDS subchannel. */
        tuner->rxsubchans |= V4L2_TUNER_SUB_RDS;
-#endif
 
        /* mono/stereo selector */
        if ((radio->registers[POWERCFG] & POWERCFG_MONO) == 0)
index 80b3c319f69814e95b8b76740a76acb662281dc3..1ac49139158df8086148d77ec9695a00b08a628d 100644 (file)
@@ -446,27 +446,27 @@ static void ene_rx_setup(struct ene_device *dev)
 
 select_timeout:
        if (dev->rx_fan_input_inuse) {
-               dev->rdev->rx_resolution = MS_TO_NS(ENE_FW_SAMPLE_PERIOD_FAN);
+               dev->rdev->rx_resolution = US_TO_NS(ENE_FW_SAMPLE_PERIOD_FAN);
 
                /* Fan input doesn't support timeouts, it just ends the
                        input with a maximum sample */
                dev->rdev->min_timeout = dev->rdev->max_timeout =
-                       MS_TO_NS(ENE_FW_SMPL_BUF_FAN_MSK *
+                       US_TO_NS(ENE_FW_SMPL_BUF_FAN_MSK *
                                ENE_FW_SAMPLE_PERIOD_FAN);
        } else {
-               dev->rdev->rx_resolution = MS_TO_NS(sample_period);
+               dev->rdev->rx_resolution = US_TO_NS(sample_period);
 
                /* Theoreticly timeout is unlimited, but we cap it
                 * because it was seen that on one device, it
                 * would stop sending spaces after around 250 msec.
                 * Besides, this is close to 2^32 anyway and timeout is u32.
                 */
-               dev->rdev->min_timeout = MS_TO_NS(127 * sample_period);
-               dev->rdev->max_timeout = MS_TO_NS(200000);
+               dev->rdev->min_timeout = US_TO_NS(127 * sample_period);
+               dev->rdev->max_timeout = US_TO_NS(200000);
        }
 
        if (dev->hw_learning_and_tx_capable)
-               dev->rdev->tx_resolution = MS_TO_NS(sample_period);
+               dev->rdev->tx_resolution = US_TO_NS(sample_period);
 
        if (dev->rdev->timeout > dev->rdev->max_timeout)
                dev->rdev->timeout = dev->rdev->max_timeout;
@@ -801,7 +801,7 @@ static irqreturn_t ene_isr(int irq, void *data)
 
                dbg("RX: %d (%s)", hw_sample, pulse ? "pulse" : "space");
 
-               ev.duration = MS_TO_NS(hw_sample);
+               ev.duration = US_TO_NS(hw_sample);
                ev.pulse = pulse;
                ir_raw_event_store_with_filter(dev->rdev, &ev);
        }
@@ -821,7 +821,7 @@ static void ene_setup_default_settings(struct ene_device *dev)
        dev->learning_mode_enabled = learning_mode_force;
 
        /* Set reasonable default timeout */
-       dev->rdev->timeout = MS_TO_NS(150000);
+       dev->rdev->timeout = US_TO_NS(150000);
 }
 
 /* Upload all hardware settings at once. Used at load and resume time */
@@ -1004,6 +1004,10 @@ static int ene_probe(struct pnp_dev *pnp_dev, const struct pnp_device_id *id)
        /* validate resources */
        error = -ENODEV;
 
+       /* init these to -1, as 0 is valid for both */
+       dev->hw_io = -1;
+       dev->irq = -1;
+
        if (!pnp_port_valid(pnp_dev, 0) ||
            pnp_port_len(pnp_dev, 0) < ENE_IO_SIZE)
                goto error;
@@ -1072,6 +1076,8 @@ static int ene_probe(struct pnp_dev *pnp_dev, const struct pnp_device_id *id)
                rdev->input_name = "ENE eHome Infrared Remote Transceiver";
        }
 
+       dev->rdev = rdev;
+
        ene_rx_setup_hw_buffer(dev);
        ene_setup_default_settings(dev);
        ene_setup_hw_settings(dev);
@@ -1083,7 +1089,6 @@ static int ene_probe(struct pnp_dev *pnp_dev, const struct pnp_device_id *id)
        if (error < 0)
                goto error;
 
-       dev->rdev = rdev;
        ene_notice("driver has been succesfully loaded");
        return 0;
 error:
index c179baf34cb420f84268c1e8f10e1c879e1270f0..337a41d4450ba2aee45171cfc7e92117baf7e24e 100644 (file)
 #define dbg_verbose(format, ...)       __dbg(2, format, ## __VA_ARGS__)
 #define dbg_regs(format, ...)          __dbg(3, format, ## __VA_ARGS__)
 
-#define MS_TO_NS(msec) ((msec) * 1000)
-
 struct ene_device {
        struct pnp_dev *pnp_dev;
        struct rc_dev *rdev;
index 6811512b4e8304615102f53832e8fc13980fbb65..e7dc6b46fdfac2df6f6ead2661d4fed6ea4c4358 100644 (file)
@@ -988,7 +988,6 @@ static int imon_ir_change_protocol(struct rc_dev *rc, u64 rc_type)
        int retval;
        struct imon_context *ictx = rc->priv;
        struct device *dev = ictx->dev;
-       bool pad_mouse;
        unsigned char ir_proto_packet[] = {
                0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x86 };
 
@@ -1000,29 +999,20 @@ static int imon_ir_change_protocol(struct rc_dev *rc, u64 rc_type)
        case RC_TYPE_RC6:
                dev_dbg(dev, "Configuring IR receiver for MCE protocol\n");
                ir_proto_packet[0] = 0x01;
-               pad_mouse = false;
                break;
        case RC_TYPE_UNKNOWN:
        case RC_TYPE_OTHER:
                dev_dbg(dev, "Configuring IR receiver for iMON protocol\n");
-               if (pad_stabilize && !nomouse)
-                       pad_mouse = true;
-               else {
+               if (!pad_stabilize)
                        dev_dbg(dev, "PAD stabilize functionality disabled\n");
-                       pad_mouse = false;
-               }
                /* ir_proto_packet[0] = 0x00; // already the default */
                rc_type = RC_TYPE_OTHER;
                break;
        default:
                dev_warn(dev, "Unsupported IR protocol specified, overriding "
                         "to iMON IR protocol\n");
-               if (pad_stabilize && !nomouse)
-                       pad_mouse = true;
-               else {
+               if (!pad_stabilize)
                        dev_dbg(dev, "PAD stabilize functionality disabled\n");
-                       pad_mouse = false;
-               }
                /* ir_proto_packet[0] = 0x00; // already the default */
                rc_type = RC_TYPE_OTHER;
                break;
@@ -1035,7 +1025,7 @@ static int imon_ir_change_protocol(struct rc_dev *rc, u64 rc_type)
                goto out;
 
        ictx->rc_type = rc_type;
-       ictx->pad_mouse = pad_mouse;
+       ictx->pad_mouse = false;
 
 out:
        return retval;
@@ -1517,7 +1507,7 @@ static void imon_incoming_packet(struct imon_context *ictx,
                        spin_unlock_irqrestore(&ictx->kc_lock, flags);
                        return;
                } else {
-                       ictx->pad_mouse = 0;
+                       ictx->pad_mouse = false;
                        dev_dbg(dev, "mouse mode disabled, passing key value\n");
                }
        }
@@ -1756,7 +1746,6 @@ static void imon_get_ffdc_type(struct imon_context *ictx)
        printk(KERN_CONT " (id 0x%02x)\n", ffdc_cfg_byte);
 
        ictx->display_type = detected_display_type;
-       ictx->rdev->allowed_protos = allowed_protos;
        ictx->rc_type = allowed_protos;
 }
 
@@ -1839,10 +1828,6 @@ static struct rc_dev *imon_init_rdev(struct imon_context *ictx)
        rdev->allowed_protos = RC_TYPE_OTHER | RC_TYPE_RC6; /* iMON PAD or MCE */
        rdev->change_protocol = imon_ir_change_protocol;
        rdev->driver_name = MOD_NAME;
-       if (ictx->rc_type == RC_TYPE_RC6)
-               rdev->map_name = RC_MAP_IMON_MCE;
-       else
-               rdev->map_name = RC_MAP_IMON_PAD;
 
        /* Enable front-panel buttons and/or knobs */
        memcpy(ictx->usb_tx_buf, &fp_packet, sizeof(fp_packet));
@@ -1851,11 +1836,18 @@ static struct rc_dev *imon_init_rdev(struct imon_context *ictx)
        if (ret)
                dev_info(ictx->dev, "panel buttons/knobs setup failed\n");
 
-       if (ictx->product == 0xffdc)
+       if (ictx->product == 0xffdc) {
                imon_get_ffdc_type(ictx);
+               rdev->allowed_protos = ictx->rc_type;
+       }
 
        imon_set_display_type(ictx);
 
+       if (ictx->rc_type == RC_TYPE_RC6)
+               rdev->map_name = RC_MAP_IMON_MCE;
+       else
+               rdev->map_name = RC_MAP_IMON_PAD;
+
        ret = rc_register_device(rdev);
        if (ret < 0) {
                dev_err(ictx->dev, "remote input dev register failed\n");
@@ -2108,18 +2100,6 @@ static struct imon_context *imon_init_intf0(struct usb_interface *intf)
                goto find_endpoint_failed;
        }
 
-       ictx->idev = imon_init_idev(ictx);
-       if (!ictx->idev) {
-               dev_err(dev, "%s: input device setup failed\n", __func__);
-               goto idev_setup_failed;
-       }
-
-       ictx->rdev = imon_init_rdev(ictx);
-       if (!ictx->rdev) {
-               dev_err(dev, "%s: rc device setup failed\n", __func__);
-               goto rdev_setup_failed;
-       }
-
        usb_fill_int_urb(ictx->rx_urb_intf0, ictx->usbdev_intf0,
                usb_rcvintpipe(ictx->usbdev_intf0,
                        ictx->rx_endpoint_intf0->bEndpointAddress),
@@ -2133,13 +2113,25 @@ static struct imon_context *imon_init_intf0(struct usb_interface *intf)
                goto urb_submit_failed;
        }
 
+       ictx->idev = imon_init_idev(ictx);
+       if (!ictx->idev) {
+               dev_err(dev, "%s: input device setup failed\n", __func__);
+               goto idev_setup_failed;
+       }
+
+       ictx->rdev = imon_init_rdev(ictx);
+       if (!ictx->rdev) {
+               dev_err(dev, "%s: rc device setup failed\n", __func__);
+               goto rdev_setup_failed;
+       }
+
        return ictx;
 
-urb_submit_failed:
-       rc_unregister_device(ictx->rdev);
 rdev_setup_failed:
        input_unregister_device(ictx->idev);
 idev_setup_failed:
+       usb_kill_urb(ictx->rx_urb_intf0);
+urb_submit_failed:
 find_endpoint_failed:
        mutex_unlock(&ictx->lock);
        usb_free_urb(tx_urb);
index 185baddcbf14545b829a0aba4e84f2917bcc935e..73230ff93b8ac0d117801a9b98ab8fbb69e6e11a 100644 (file)
@@ -233,7 +233,7 @@ EXPORT_SYMBOL_GPL(ir_raw_event_handle);
 
 /* used internally by the sysfs interface */
 u64
-ir_raw_get_allowed_protocols()
+ir_raw_get_allowed_protocols(void)
 {
        u64 protocols;
        mutex_lock(&ir_raw_handler_lock);
index c59851b203da160a629298bb40bd27aa0c21680a..7a5f5300caf9a0fcab05acbd8febe0acf44035a8 100644 (file)
 
 static struct rc_map_table dib0700_nec_table[] = {
        /* Key codes for the Pixelview SBTVD remote */
-       { 0x8613, KEY_MUTE },
-       { 0x8612, KEY_POWER },
-       { 0x8601, KEY_1 },
-       { 0x8602, KEY_2 },
-       { 0x8603, KEY_3 },
-       { 0x8604, KEY_4 },
-       { 0x8605, KEY_5 },
-       { 0x8606, KEY_6 },
-       { 0x8607, KEY_7 },
-       { 0x8608, KEY_8 },
-       { 0x8609, KEY_9 },
-       { 0x8600, KEY_0 },
-       { 0x860d, KEY_CHANNELUP },
-       { 0x8619, KEY_CHANNELDOWN },
-       { 0x8610, KEY_VOLUMEUP },
-       { 0x860c, KEY_VOLUMEDOWN },
+       { 0x866b13, KEY_MUTE },
+       { 0x866b12, KEY_POWER },
+       { 0x866b01, KEY_1 },
+       { 0x866b02, KEY_2 },
+       { 0x866b03, KEY_3 },
+       { 0x866b04, KEY_4 },
+       { 0x866b05, KEY_5 },
+       { 0x866b06, KEY_6 },
+       { 0x866b07, KEY_7 },
+       { 0x866b08, KEY_8 },
+       { 0x866b09, KEY_9 },
+       { 0x866b00, KEY_0 },
+       { 0x866b0d, KEY_CHANNELUP },
+       { 0x866b19, KEY_CHANNELDOWN },
+       { 0x866b10, KEY_VOLUMEUP },
+       { 0x866b0c, KEY_VOLUMEDOWN },
 
-       { 0x860a, KEY_CAMERA },
-       { 0x860b, KEY_ZOOM },
-       { 0x861b, KEY_BACKSPACE },
-       { 0x8615, KEY_ENTER },
+       { 0x866b0a, KEY_CAMERA },
+       { 0x866b0b, KEY_ZOOM },
+       { 0x866b1b, KEY_BACKSPACE },
+       { 0x866b15, KEY_ENTER },
 
-       { 0x861d, KEY_UP },
-       { 0x861e, KEY_DOWN },
-       { 0x860e, KEY_LEFT },
-       { 0x860f, KEY_RIGHT },
+       { 0x866b1d, KEY_UP },
+       { 0x866b1e, KEY_DOWN },
+       { 0x866b0e, KEY_LEFT },
+       { 0x866b0f, KEY_RIGHT },
 
-       { 0x8618, KEY_RECORD },
-       { 0x861a, KEY_STOP },
+       { 0x866b18, KEY_RECORD },
+       { 0x866b1a, KEY_STOP },
 
        /* Key codes for the EvolutePC TVWay+ remote */
        { 0x7a00, KEY_MENU },
index 0fef6efad537adb14000ac426d942f1d7871ecf2..079353e5d558daa640f72d4e315bc8ec4ea45e5b 100644 (file)
@@ -48,7 +48,6 @@
 #define USB_BUFLEN             32 /* USB reception buffer length */
 #define USB_CTRL_MSG_SZ                2  /* Size of usb ctrl msg on gen1 hw */
 #define MCE_G1_INIT_MSGS       40 /* Init messages on gen1 hw to throw out */
-#define MS_TO_NS(msec)         ((msec) * 1000)
 
 /* MCE constants */
 #define MCE_CMDBUF_SIZE                384  /* MCE Command buffer length */
@@ -858,7 +857,7 @@ static void mceusb_process_ir_data(struct mceusb_dev *ir, int buf_len)
                        ir->rem--;
                        rawir.pulse = ((ir->buf_in[i] & MCE_PULSE_BIT) != 0);
                        rawir.duration = (ir->buf_in[i] & MCE_PULSE_MASK)
-                                        * MS_TO_NS(MCE_TIME_UNIT);
+                                        * MS_TO_US(MCE_TIME_UNIT);
 
                        dev_dbg(ir->dev, "Storing %s with duration %d\n",
                                rawir.pulse ? "pulse" : "space",
index eb875af05e7943d3f8428c983d7ffa45e91d49b4..aa021600e9df352c33fdc0131bd5b2c8113774de 100644 (file)
@@ -78,7 +78,7 @@ config VIDEO_FIXED_MINOR_RANGES
 
 config VIDEO_HELPER_CHIPS_AUTO
        bool "Autoselect pertinent encoders/decoders and other helper chips"
-       default y if !EMBEDDED
+       default y if !EXPERT
        ---help---
          Most video cards may require additional modules to encode or
          decode audio/video standards. This option will autoselect
@@ -141,15 +141,6 @@ config VIDEO_TDA9840
          To compile this driver as a module, choose M here: the
          module will be called tda9840.
 
-config VIDEO_TDA9875
-       tristate "Philips TDA9875 audio processor"
-       depends on VIDEO_V4L2 && I2C
-       ---help---
-         Support for tda9875 audio decoder chip found on some bt8xx boards.
-
-         To compile this driver as a module, choose M here: the
-         module will be called tda9875.
-
 config VIDEO_TEA6415C
        tristate "Philips TEA6415C audio processor"
        depends on I2C
index 81e38cb0b8469ad69f37b679c39329173538b57d..a509d317e258d9580d146e5ea1473f9fbab36f39 100644 (file)
@@ -27,7 +27,6 @@ obj-$(CONFIG_VIDEO_V4L2_COMMON) += v4l2-common.o
 obj-$(CONFIG_VIDEO_TUNER) += tuner.o
 obj-$(CONFIG_VIDEO_TVAUDIO) += tvaudio.o
 obj-$(CONFIG_VIDEO_TDA7432) += tda7432.o
-obj-$(CONFIG_VIDEO_TDA9875) += tda9875.o
 obj-$(CONFIG_VIDEO_SAA6588) += saa6588.o
 obj-$(CONFIG_VIDEO_TDA9840) += tda9840.o
 obj-$(CONFIG_VIDEO_TEA6415C) += tea6415c.o
index f318b51448b3b0a3607210668bd7d9a16844b0b6..d2327dbb473f6aae0b3be765a7dd71886adca38c 100644 (file)
@@ -303,11 +303,22 @@ static int adv7175_g_chip_ident(struct v4l2_subdev *sd, struct v4l2_dbg_chip_ide
        return v4l2_chip_ident_i2c_client(client, chip, V4L2_IDENT_ADV7175, 0);
 }
 
+static int adv7175_s_power(struct v4l2_subdev *sd, int on)
+{
+       if (on)
+               adv7175_write(sd, 0x01, 0x00);
+       else
+               adv7175_write(sd, 0x01, 0x78);
+
+       return 0;
+}
+
 /* ----------------------------------------------------------------------- */
 
 static const struct v4l2_subdev_core_ops adv7175_core_ops = {
        .g_chip_ident = adv7175_g_chip_ident,
        .init = adv7175_init,
+       .s_power = adv7175_s_power,
 };
 
 static const struct v4l2_subdev_video_ops adv7175_video_ops = {
index 49efcf660ba66cad6dc1e796beb23ea6282b7ca0..7f58756d72c8f8f69ff1bf125ab62769d744acad 100644 (file)
@@ -1373,7 +1373,6 @@ struct tvcard bttv_tvcards[] = {
                .gpiomute       = 0x1800,
                .audio_mode_gpio= fv2000s_audio,
                .no_msp34xx     = 1,
-               .no_tda9875     = 1,
                .needs_tvaudio  = 1,
                .pll            = PLL_28,
                .tuner_type     = TUNER_PHILIPS_PAL,
@@ -1511,7 +1510,6 @@ struct tvcard bttv_tvcards[] = {
                .gpiomute       = 0x09,
                .needs_tvaudio  = 1,
                .no_msp34xx     = 1,
-               .no_tda9875     = 1,
                .pll            = PLL_28,
                .tuner_type     = TUNER_PHILIPS_PAL,
                .tuner_addr     = ADDR_UNSET,
@@ -1550,7 +1548,6 @@ struct tvcard bttv_tvcards[] = {
                .gpiomask2      = 0x07ff,
                .muxsel         = MUXSEL(3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3),
                .no_msp34xx     = 1,
-               .no_tda9875     = 1,
                .tuner_type     = TUNER_ABSENT,
                .tuner_addr     = ADDR_UNSET,
                .muxsel_hook    = rv605_muxsel,
@@ -1686,7 +1683,6 @@ struct tvcard bttv_tvcards[] = {
                .tuner_type     = TUNER_ABSENT,
                .tuner_addr     = ADDR_UNSET,
                .no_msp34xx     = 1,
-               .no_tda9875     = 1,
                .no_tda7432     = 1,
        },
        [BTTV_BOARD_OSPREY1x0_848] = {
@@ -1699,7 +1695,6 @@ struct tvcard bttv_tvcards[] = {
                .tuner_type     = TUNER_ABSENT,
                .tuner_addr     = ADDR_UNSET,
                .no_msp34xx     = 1,
-               .no_tda9875     = 1,
                .no_tda7432     = 1,
        },
 
@@ -1714,7 +1709,6 @@ struct tvcard bttv_tvcards[] = {
                .tuner_type     = TUNER_ABSENT,
                .tuner_addr     = ADDR_UNSET,
                .no_msp34xx     = 1,
-               .no_tda9875     = 1,
                .no_tda7432     = 1,
        },
        [BTTV_BOARD_OSPREY1x1] = {
@@ -1727,7 +1721,6 @@ struct tvcard bttv_tvcards[] = {
                .tuner_type     = TUNER_ABSENT,
                .tuner_addr     = ADDR_UNSET,
                .no_msp34xx     = 1,
-               .no_tda9875     = 1,
                .no_tda7432     = 1,
        },
        [BTTV_BOARD_OSPREY1x1_SVID] = {
@@ -1740,7 +1733,6 @@ struct tvcard bttv_tvcards[] = {
                .tuner_type     = TUNER_ABSENT,
                .tuner_addr     = ADDR_UNSET,
                .no_msp34xx     = 1,
-               .no_tda9875     = 1,
                .no_tda7432     = 1,
        },
        [BTTV_BOARD_OSPREY2xx] = {
@@ -1753,7 +1745,6 @@ struct tvcard bttv_tvcards[] = {
                .tuner_type     = TUNER_ABSENT,
                .tuner_addr     = ADDR_UNSET,
                .no_msp34xx     = 1,
-               .no_tda9875     = 1,
                .no_tda7432     = 1,
        },
 
@@ -1768,7 +1759,6 @@ struct tvcard bttv_tvcards[] = {
                .tuner_type     = TUNER_ABSENT,
                .tuner_addr     = ADDR_UNSET,
                .no_msp34xx     = 1,
-               .no_tda9875     = 1,
                .no_tda7432     = 1,
        },
        [BTTV_BOARD_OSPREY2x0] = {
@@ -1781,7 +1771,6 @@ struct tvcard bttv_tvcards[] = {
                .tuner_type     = TUNER_ABSENT,
                .tuner_addr     = ADDR_UNSET,
                .no_msp34xx     = 1,
-               .no_tda9875     = 1,
                .no_tda7432     = 1,
        },
        [BTTV_BOARD_OSPREY500] = {
@@ -1794,7 +1783,6 @@ struct tvcard bttv_tvcards[] = {
                .tuner_type     = TUNER_ABSENT,
                .tuner_addr     = ADDR_UNSET,
                .no_msp34xx     = 1,
-               .no_tda9875     = 1,
                .no_tda7432     = 1,
        },
        [BTTV_BOARD_OSPREY540] = {
@@ -1805,7 +1793,6 @@ struct tvcard bttv_tvcards[] = {
                .tuner_type     = TUNER_ABSENT,
                .tuner_addr     = ADDR_UNSET,
                .no_msp34xx     = 1,
-               .no_tda9875     = 1,
                .no_tda7432     = 1,
        },
 
@@ -1820,7 +1807,6 @@ struct tvcard bttv_tvcards[] = {
                .tuner_type     = TUNER_ABSENT,
                .tuner_addr     = ADDR_UNSET,
                .no_msp34xx     = 1,
-               .no_tda9875     = 1,
                .no_tda7432     = 1,      /* must avoid, conflicts with the bt860 */
        },
        [BTTV_BOARD_IDS_EAGLE] = {
@@ -1835,7 +1821,6 @@ struct tvcard bttv_tvcards[] = {
                .muxsel         = MUXSEL(2, 2, 2, 2),
                .muxsel_hook    = eagle_muxsel,
                .no_msp34xx     = 1,
-               .no_tda9875     = 1,
                .pll            = PLL_28,
        },
        [BTTV_BOARD_PINNACLESAT] = {
@@ -1846,7 +1831,6 @@ struct tvcard bttv_tvcards[] = {
                .tuner_type     = TUNER_ABSENT,
                .tuner_addr     = ADDR_UNSET,
                .no_msp34xx     = 1,
-               .no_tda9875     = 1,
                .no_tda7432     = 1,
                .muxsel         = MUXSEL(3, 1),
                .pll            = PLL_28,
@@ -1897,7 +1881,6 @@ struct tvcard bttv_tvcards[] = {
                .svhs           = 2,
                .gpiomask       = 0,
                .no_msp34xx     = 1,
-               .no_tda9875     = 1,
                .no_tda7432     = 1,
                .muxsel         = MUXSEL(2, 0, 1),
                .pll            = PLL_28,
@@ -1970,7 +1953,6 @@ struct tvcard bttv_tvcards[] = {
                /* Tuner, CVid, SVid, CVid over SVid connector */
                .muxsel         = MUXSEL(2, 3, 1, 1),
                .gpiomask       = 0,
-               .no_tda9875     = 1,
                .no_tda7432     = 1,
                .tuner_type     = TUNER_PHILIPS_PAL_I,
                .tuner_addr     = ADDR_UNSET,
@@ -2017,7 +1999,6 @@ struct tvcard bttv_tvcards[] = {
                .muxsel         = MUXSEL(2,2,2,2, 3,3,3,3, 1,1,1,1, 0,0,0,0),
                .muxsel_hook    = xguard_muxsel,
                .no_msp34xx     = 1,
-               .no_tda9875     = 1,
                .no_tda7432     = 1,
                .pll            = PLL_28,
        },
@@ -2029,7 +2010,6 @@ struct tvcard bttv_tvcards[] = {
                .svhs           = NO_SVHS,
                .muxsel         = MUXSEL(2, 3, 1, 0),
                .no_msp34xx     = 1,
-               .no_tda9875     = 1,
                .no_tda7432     = 1,
                .pll            = PLL_28,
                .tuner_type     = TUNER_ABSENT,
@@ -2134,7 +2114,6 @@ struct tvcard bttv_tvcards[] = {
                .svhs           = NO_SVHS,   /* card has no svhs */
                .needs_tvaudio  = 0,
                .no_msp34xx     = 1,
-               .no_tda9875     = 1,
                .no_tda7432     = 1,
                .gpiomask       = 0x00,
                .muxsel         = MUXSEL(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0),
@@ -2156,7 +2135,6 @@ struct tvcard bttv_tvcards[] = {
        [BTTV_BOARD_TWINHAN_DST] = {
                .name           = "Twinhan DST + clones",
                .no_msp34xx     = 1,
-               .no_tda9875     = 1,
                .no_tda7432     = 1,
                .tuner_type     = TUNER_ABSENT,
                .tuner_addr     = ADDR_UNSET,
@@ -2171,7 +2149,6 @@ struct tvcard bttv_tvcards[] = {
                /* Vid In, SVid In, Vid over SVid in connector */
                .muxsel         = MUXSEL(3, 1, 1, 3),
                .no_msp34xx     = 1,
-               .no_tda9875     = 1,
                .no_tda7432     = 1,
                .tuner_type     = TUNER_ABSENT,
                .tuner_addr     = ADDR_UNSET,
@@ -2226,7 +2203,6 @@ struct tvcard bttv_tvcards[] = {
                .svhs           = NO_SVHS,
                .muxsel         = MUXSEL(2, 3, 1, 0),
                .no_msp34xx     = 1,
-               .no_tda9875     = 1,
                .no_tda7432     = 1,
                .needs_tvaudio  = 0,
                .tuner_type     = TUNER_ABSENT,
@@ -2278,7 +2254,6 @@ struct tvcard bttv_tvcards[] = {
                .gpiomask       = 0,
                .gpiomask2      = 0x3C<<16,/*Set the GPIO[18]->GPIO[21] as output pin.==> drive the video inputs through analog multiplexers*/
                .no_msp34xx     = 1,
-               .no_tda9875     = 1,
                .no_tda7432     = 1,
                /*878A input is always MUX0, see above.*/
                .muxsel         = MUXSEL(2, 2, 2, 2),
@@ -2302,7 +2277,6 @@ struct tvcard bttv_tvcards[] = {
                .tuner_type     = TUNER_TEMIC_PAL,
                .tuner_addr     = ADDR_UNSET,
                .no_msp34xx     = 1,
-               .no_tda9875     = 1,
        },
        [BTTV_BOARD_AVDVBT_771] = {
                /* Wolfram Joost <wojo@frokaschwei.de> */
@@ -2313,7 +2287,6 @@ struct tvcard bttv_tvcards[] = {
                .tuner_addr     = ADDR_UNSET,
                .muxsel         = MUXSEL(3, 3),
                .no_msp34xx     = 1,
-               .no_tda9875     = 1,
                .no_tda7432     = 1,
                .pll            = PLL_28,
                .has_dvb        = 1,
@@ -2329,7 +2302,6 @@ struct tvcard bttv_tvcards[] = {
                .svhs           = 1,
                .muxsel         = MUXSEL(3, 1, 2, 0), /* Comp0, S-Video, ?, ? */
                .no_msp34xx     = 1,
-               .no_tda9875     = 1,
                .no_tda7432     = 1,
                .pll            = PLL_28,
                .tuner_type     = TUNER_ABSENT,
@@ -2393,7 +2365,6 @@ struct tvcard bttv_tvcards[] = {
                /* Chris Pascoe <c.pascoe@itee.uq.edu.au> */
                .name           = "DViCO FusionHDTV DVB-T Lite",
                .no_msp34xx     = 1,
-               .no_tda9875     = 1,
                .no_tda7432     = 1,
                .pll            = PLL_28,
                .no_video       = 1,
@@ -2440,7 +2411,6 @@ struct tvcard bttv_tvcards[] = {
                .muxsel         = MUXSEL(2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2),
                .pll            = PLL_28,
                .no_msp34xx     = 1,
-               .no_tda9875     = 1,
                .no_tda7432     = 1,
                .tuner_type     = TUNER_ABSENT,
                .tuner_addr     = ADDR_UNSET,
@@ -2478,7 +2448,6 @@ struct tvcard bttv_tvcards[] = {
                .pll            = PLL_28,
                .no_msp34xx     = 1,
                .no_tda7432     = 1,
-               .no_tda9875     = 1,
                .muxsel_hook    = kodicom4400r_muxsel,
        },
        [BTTV_BOARD_KODICOM_4400R_SL] = {
@@ -2500,7 +2469,6 @@ struct tvcard bttv_tvcards[] = {
                .pll            = PLL_28,
                .no_msp34xx     = 1,
                .no_tda7432     = 1,
-               .no_tda9875     = 1,
                .muxsel_hook    = kodicom4400r_muxsel,
        },
                /* ---- card 0x86---------------------------------- */
@@ -2530,7 +2498,6 @@ struct tvcard bttv_tvcards[] = {
                .gpiomux        = { 0x00400005, 0, 0x00000001, 0 },
                .gpiomute       = 0x00c00007,
                .no_msp34xx     = 1,
-               .no_tda9875     = 1,
                .no_tda7432     = 1,
                .has_dvb        = 1,
        },
@@ -2630,7 +2597,6 @@ struct tvcard bttv_tvcards[] = {
                .tuner_type     = TUNER_ABSENT,
                .tuner_addr     = ADDR_UNSET,
                .no_msp34xx     = 1,
-               .no_tda9875     = 1,
                .no_tda7432     = 1,
        },
                /* ---- card 0x8d ---------------------------------- */
@@ -2658,7 +2624,6 @@ struct tvcard bttv_tvcards[] = {
                .muxsel         = MUXSEL(2, 3, 1, 1),
                .gpiomux        = { 100000, 100002, 100002, 100000 },
                .no_msp34xx     = 1,
-               .no_tda9875     = 1,
                .no_tda7432     = 1,
                .pll            = PLL_28,
                .tuner_type     = TUNER_TNF_5335MF,
@@ -2674,7 +2639,6 @@ struct tvcard bttv_tvcards[] = {
                .gpiomask       = 0x0f, /* old: 7 */
                .muxsel         = MUXSEL(0, 1, 3, 2), /* Composite 0-3 */
                .no_msp34xx     = 1,
-               .no_tda9875     = 1,
                .no_tda7432     = 1,
                .tuner_type     = TUNER_ABSENT,
                .tuner_addr     = ADDR_UNSET,
@@ -2732,7 +2696,6 @@ struct tvcard bttv_tvcards[] = {
                .gpiomux        = { 0x00400005, 0, 0x00000001, 0 },
                .gpiomute       = 0x00c00007,
                .no_msp34xx     = 1,
-               .no_tda9875     = 1,
                .no_tda7432     = 1,
        },
        /* ---- card 0x95---------------------------------- */
@@ -2874,7 +2837,6 @@ struct tvcard bttv_tvcards[] = {
                .pll            = PLL_28,
                .no_msp34xx     = 1,
                .no_tda7432     = 1,
-               .no_tda9875     = 1,
                .muxsel_hook    = gv800s_muxsel,
        },
                [BTTV_BOARD_GEOVISION_GV800S_SL] = {
@@ -2899,7 +2861,6 @@ struct tvcard bttv_tvcards[] = {
                .pll            = PLL_28,
                .no_msp34xx     = 1,
                .no_tda7432     = 1,
-               .no_tda9875     = 1,
                .muxsel_hook    = gv800s_muxsel,
        },
        [BTTV_BOARD_PV183] = {
index fd62bf15d77975822af34af8d9a6d5e4088ebdfa..c6333595c6b90a3749fabfa8e3f90de1751fa2c3 100644 (file)
@@ -234,7 +234,6 @@ struct tvcard {
 
        /* i2c audio flags */
        unsigned int no_msp34xx:1;
-       unsigned int no_tda9875:1;
        unsigned int no_tda7432:1;
        unsigned int needs_tvaudio:1;
        unsigned int msp34xx_alt:1;
index 49f1b8f1418e94ae36e6b80219581056246da045..55ffd60ffa7ff05b99099108937d61e8eafdeb00 100644 (file)
@@ -2001,6 +2001,11 @@ static int cafe_pci_probe(struct pci_dev *pdev,
                .min_width = 320,
                .min_height = 240,
        };
+       struct i2c_board_info ov7670_info = {
+               .type = "ov7670",
+               .addr = 0x42,
+               .platform_data = &sensor_cfg,
+       };
 
        /*
         * Start putting together one of our big camera structures.
@@ -2062,9 +2067,9 @@ static int cafe_pci_probe(struct pci_dev *pdev,
        if (dmi_check_system(olpc_xo1_dmi))
                sensor_cfg.clock_speed = 45;
 
-       cam->sensor_addr = 0x42;
-       cam->sensor = v4l2_i2c_new_subdev_cfg(&cam->v4l2_dev, &cam->i2c_adapter,
-                       "ov7670", 0, &sensor_cfg, cam->sensor_addr, NULL);
+       cam->sensor_addr = ov7670_info.addr;
+       cam->sensor = v4l2_i2c_new_subdev_board(&cam->v4l2_dev, &cam->i2c_adapter,
+                       &ov7670_info, NULL);
        if (cam->sensor == NULL) {
                ret = -ENODEV;
                goto out_smbus;
index 916c13d5cf7d12c9a725f895227bd2b197017de6..6d6d1843791ce0a7ef880211b33f92c85bee4922 100644 (file)
@@ -378,7 +378,7 @@ struct cpia2_fh {
 
 struct camera_data {
        /* locks */
-       struct mutex busy_lock; /* guard against SMP multithreading */
+       struct mutex v4l2_lock; /* serialize file operations */
        struct v4l2_prio_state prio;
 
        /* camera status */
index 9606bc01b803c118db6ffeee85f21a3f58f046d7..aaffca8e13fde4a0aa2f3a30848b25590fcbc021 100644 (file)
@@ -2247,7 +2247,7 @@ struct camera_data *cpia2_init_camera_struct(void)
 
 
        cam->present = 1;
-       mutex_init(&cam->busy_lock);
+       mutex_init(&cam->v4l2_lock);
        init_waitqueue_head(&cam->wq_stream);
 
        return cam;
@@ -2365,9 +2365,9 @@ long cpia2_read(struct camera_data *cam,
                char __user *buf, unsigned long count, int noblock)
 {
        struct framebuf *frame;
-       if (!count) {
+
+       if (!count)
                return 0;
-       }
 
        if (!buf) {
                ERR("%s: buffer NULL\n",__func__);
@@ -2379,17 +2379,12 @@ long cpia2_read(struct camera_data *cam,
                return -EINVAL;
        }
 
-       /* make this _really_ smp and multithread-safe */
-       if (mutex_lock_interruptible(&cam->busy_lock))
-               return -ERESTARTSYS;
-
        if (!cam->present) {
                LOG("%s: camera removed\n",__func__);
-               mutex_unlock(&cam->busy_lock);
                return 0;       /* EOF */
        }
 
-       if(!cam->streaming) {
+       if (!cam->streaming) {
                /* Start streaming */
                cpia2_usb_stream_start(cam,
                                       cam->params.camera_state.stream_mode);
@@ -2398,42 +2393,31 @@ long cpia2_read(struct camera_data *cam,
        /* Copy cam->curbuff in case it changes while we're processing */
        frame = cam->curbuff;
        if (noblock && frame->status != FRAME_READY) {
-               mutex_unlock(&cam->busy_lock);
                return -EAGAIN;
        }
 
-       if(frame->status != FRAME_READY) {
-               mutex_unlock(&cam->busy_lock);
+       if (frame->status != FRAME_READY) {
+               mutex_unlock(&cam->v4l2_lock);
                wait_event_interruptible(cam->wq_stream,
                               !cam->present ||
                               (frame = cam->curbuff)->status == FRAME_READY);
+               mutex_lock(&cam->v4l2_lock);
                if (signal_pending(current))
                        return -ERESTARTSYS;
-               /* make this _really_ smp and multithread-safe */
-               if (mutex_lock_interruptible(&cam->busy_lock)) {
-                       return -ERESTARTSYS;
-               }
-               if(!cam->present) {
-                       mutex_unlock(&cam->busy_lock);
+               if (!cam->present)
                        return 0;
-               }
        }
 
        /* copy data to user space */
-       if (frame->length > count) {
-               mutex_unlock(&cam->busy_lock);
+       if (frame->length > count)
                return -EFAULT;
-       }
-       if (copy_to_user(buf, frame->data, frame->length)) {
-               mutex_unlock(&cam->busy_lock);
+       if (copy_to_user(buf, frame->data, frame->length))
                return -EFAULT;
-       }
 
        count = frame->length;
 
        frame->status = FRAME_EMPTY;
 
-       mutex_unlock(&cam->busy_lock);
        return count;
 }
 
@@ -2447,17 +2431,13 @@ unsigned int cpia2_poll(struct camera_data *cam, struct file *filp,
 {
        unsigned int status=0;
 
-       if(!cam) {
+       if (!cam) {
                ERR("%s: Internal error, camera_data not found!\n",__func__);
                return POLLERR;
        }
 
-       mutex_lock(&cam->busy_lock);
-
-       if(!cam->present) {
-               mutex_unlock(&cam->busy_lock);
+       if (!cam->present)
                return POLLHUP;
-       }
 
        if(!cam->streaming) {
                /* Start streaming */
@@ -2465,16 +2445,13 @@ unsigned int cpia2_poll(struct camera_data *cam, struct file *filp,
                                       cam->params.camera_state.stream_mode);
        }
 
-       mutex_unlock(&cam->busy_lock);
        poll_wait(filp, &cam->wq_stream, wait);
-       mutex_lock(&cam->busy_lock);
 
        if(!cam->present)
                status = POLLHUP;
        else if(cam->curbuff->status == FRAME_READY)
                status = POLLIN | POLLRDNORM;
 
-       mutex_unlock(&cam->busy_lock);
        return status;
 }
 
@@ -2496,29 +2473,19 @@ int cpia2_remap_buffer(struct camera_data *cam, struct vm_area_struct *vma)
 
        DBG("mmap offset:%ld size:%ld\n", start_offset, size);
 
-       /* make this _really_ smp-safe */
-       if (mutex_lock_interruptible(&cam->busy_lock))
-               return -ERESTARTSYS;
-
-       if (!cam->present) {
-               mutex_unlock(&cam->busy_lock);
+       if (!cam->present)
                return -ENODEV;
-       }
 
        if (size > cam->frame_size*cam->num_frames  ||
            (start_offset % cam->frame_size) != 0 ||
-           (start_offset+size > cam->frame_size*cam->num_frames)) {
-               mutex_unlock(&cam->busy_lock);
+           (start_offset+size > cam->frame_size*cam->num_frames))
                return -EINVAL;
-       }
 
        pos = ((unsigned long) (cam->frame_buffer)) + start_offset;
        while (size > 0) {
                page = kvirt_to_pa(pos);
-               if (remap_pfn_range(vma, start, page >> PAGE_SHIFT, PAGE_SIZE, PAGE_SHARED)) {
-                       mutex_unlock(&cam->busy_lock);
+               if (remap_pfn_range(vma, start, page >> PAGE_SHIFT, PAGE_SIZE, PAGE_SHARED))
                        return -EAGAIN;
-               }
                start += PAGE_SIZE;
                pos += PAGE_SIZE;
                if (size > PAGE_SIZE)
@@ -2528,7 +2495,5 @@ int cpia2_remap_buffer(struct camera_data *cam, struct vm_area_struct *vma)
        }
 
        cam->mmapped = true;
-       mutex_unlock(&cam->busy_lock);
        return 0;
 }
-
index 7edf80b0d01aabee0a080721f1ca2c36c90d66ec..9bad398429366934a83fc3d2c1c8cddabb6fbf50 100644 (file)
@@ -238,59 +238,40 @@ static struct v4l2_queryctrl controls[] = {
 static int cpia2_open(struct file *file)
 {
        struct camera_data *cam = video_drvdata(file);
-       int retval = 0;
+       struct cpia2_fh *fh;
 
        if (!cam) {
                ERR("Internal error, camera_data not found!\n");
                return -ENODEV;
        }
 
-       if(mutex_lock_interruptible(&cam->busy_lock))
-               return -ERESTARTSYS;
-
-       if(!cam->present) {
-               retval = -ENODEV;
-               goto err_return;
-       }
+       if (!cam->present)
+               return -ENODEV;
 
-       if (cam->open_count > 0) {
-               goto skip_init;
-       }
+       if (cam->open_count == 0) {
+               if (cpia2_allocate_buffers(cam))
+                       return -ENOMEM;
 
-       if (cpia2_allocate_buffers(cam)) {
-               retval = -ENOMEM;
-               goto err_return;
-       }
+               /* reset the camera */
+               if (cpia2_reset_camera(cam) < 0)
+                       return -EIO;
 
-       /* reset the camera */
-       if (cpia2_reset_camera(cam) < 0) {
-               retval = -EIO;
-               goto err_return;
+               cam->APP_len = 0;
+               cam->COM_len = 0;
        }
 
-       cam->APP_len = 0;
-       cam->COM_len = 0;
-
-skip_init:
-       {
-               struct cpia2_fh *fh = kmalloc(sizeof(*fh),GFP_KERNEL);
-               if(!fh) {
-                       retval = -ENOMEM;
-                       goto err_return;
-               }
-               file->private_data = fh;
-               fh->prio = V4L2_PRIORITY_UNSET;
-               v4l2_prio_open(&cam->prio, &fh->prio);
-               fh->mmapped = 0;
-       }
+       fh = kmalloc(sizeof(*fh), GFP_KERNEL);
+       if (!fh)
+               return -ENOMEM;
+       file->private_data = fh;
+       fh->prio = V4L2_PRIORITY_UNSET;
+       v4l2_prio_open(&cam->prio, &fh->prio);
+       fh->mmapped = 0;
 
        ++cam->open_count;
 
        cpia2_dbg_dump_registers(cam);
-
-err_return:
-       mutex_unlock(&cam->busy_lock);
-       return retval;
+       return 0;
 }
 
 /******************************************************************************
@@ -304,15 +285,11 @@ static int cpia2_close(struct file *file)
        struct camera_data *cam = video_get_drvdata(dev);
        struct cpia2_fh *fh = file->private_data;
 
-       mutex_lock(&cam->busy_lock);
-
        if (cam->present &&
-           (cam->open_count == 1
-            || fh->prio == V4L2_PRIORITY_RECORD
-           )) {
+           (cam->open_count == 1 || fh->prio == V4L2_PRIORITY_RECORD)) {
                cpia2_usb_stream_stop(cam);
 
-               if(cam->open_count == 1) {
+               if (cam->open_count == 1) {
                        /* save camera state for later open */
                        cpia2_save_camera_state(cam);
 
@@ -321,26 +298,21 @@ static int cpia2_close(struct file *file)
                }
        }
 
-       {
-               if(fh->mmapped)
-                       cam->mmapped = 0;
-               v4l2_prio_close(&cam->prio, fh->prio);
-               file->private_data = NULL;
-               kfree(fh);
-       }
+       if (fh->mmapped)
+               cam->mmapped = 0;
+       v4l2_prio_close(&cam->prio, fh->prio);
+       file->private_data = NULL;
+       kfree(fh);
 
        if (--cam->open_count == 0) {
                cpia2_free_buffers(cam);
                if (!cam->present) {
                        video_unregister_device(dev);
-                       mutex_unlock(&cam->busy_lock);
                        kfree(cam);
                        return 0;
                }
        }
 
-       mutex_unlock(&cam->busy_lock);
-
        return 0;
 }
 
@@ -405,11 +377,11 @@ static int sync(struct camera_data *cam, int frame_nr)
                        return 0;
                }
 
-               mutex_unlock(&cam->busy_lock);
+               mutex_unlock(&cam->v4l2_lock);
                wait_event_interruptible(cam->wq_stream,
                                         !cam->streaming ||
                                         frame->status == FRAME_READY);
-               mutex_lock(&cam->busy_lock);
+               mutex_lock(&cam->v4l2_lock);
                if (signal_pending(current))
                        return -ERESTARTSYS;
                if(!cam->present)
@@ -1293,11 +1265,11 @@ static int ioctl_dqbuf(void *arg,struct camera_data *cam, struct file *file)
        if(frame < 0) {
                /* Wait for a frame to become available */
                struct framebuf *cb=cam->curbuff;
-               mutex_unlock(&cam->busy_lock);
+               mutex_unlock(&cam->v4l2_lock);
                wait_event_interruptible(cam->wq_stream,
                                         !cam->present ||
                                         (cb=cam->curbuff)->status == FRAME_READY);
-               mutex_lock(&cam->busy_lock);
+               mutex_lock(&cam->v4l2_lock);
                if (signal_pending(current))
                        return -ERESTARTSYS;
                if(!cam->present)
@@ -1337,14 +1309,8 @@ static long cpia2_do_ioctl(struct file *file, unsigned int cmd, void *arg)
        if (!cam)
                return -ENOTTY;
 
-       /* make this _really_ smp-safe */
-       if (mutex_lock_interruptible(&cam->busy_lock))
-               return -ERESTARTSYS;
-
-       if (!cam->present) {
-               mutex_unlock(&cam->busy_lock);
+       if (!cam->present)
                return -ENODEV;
-       }
 
        /* Priority check */
        switch (cmd) {
@@ -1352,10 +1318,8 @@ static long cpia2_do_ioctl(struct file *file, unsigned int cmd, void *arg)
        {
                struct cpia2_fh *fh = file->private_data;
                retval = v4l2_prio_check(&cam->prio, fh->prio);
-               if(retval) {
-                       mutex_unlock(&cam->busy_lock);
+               if (retval)
                        return retval;
-               }
                break;
        }
        default:
@@ -1529,7 +1493,6 @@ static long cpia2_do_ioctl(struct file *file, unsigned int cmd, void *arg)
                break;
        }
 
-       mutex_unlock(&cam->busy_lock);
        return retval;
 }
 
@@ -1596,7 +1559,7 @@ static const struct v4l2_file_operations cpia2_fops = {
        .release        = cpia2_close,
        .read           = cpia2_v4l_read,
        .poll           = cpia2_v4l_poll,
-       .ioctl          = cpia2_ioctl,
+       .unlocked_ioctl = cpia2_ioctl,
        .mmap           = cpia2_mmap,
 };
 
@@ -1620,6 +1583,7 @@ int cpia2_register_camera(struct camera_data *cam)
 
        memcpy(cam->vdev, &cpia2_template, sizeof(cpia2_template));
        video_set_drvdata(cam->vdev, cam);
+       cam->vdev->lock = &cam->v4l2_lock;
 
        reset_camera_struct_v4l(cam);
 
index 133ec2bac18053018b547a45afd99fccd3a010b8..944af8adbe0c8095fb59ee11d50b567d25cc024c 100644 (file)
@@ -664,7 +664,7 @@ static int __devinit cx18_create_in_workq(struct cx18 *cx)
 {
        snprintf(cx->in_workq_name, sizeof(cx->in_workq_name), "%s-in",
                 cx->v4l2_dev.name);
-       cx->in_work_queue = create_singlethread_workqueue(cx->in_workq_name);
+       cx->in_work_queue = alloc_ordered_workqueue(cx->in_workq_name, 0);
        if (cx->in_work_queue == NULL) {
                CX18_ERR("Unable to create incoming mailbox handler thread\n");
                return -ENOMEM;
@@ -672,18 +672,6 @@ static int __devinit cx18_create_in_workq(struct cx18 *cx)
        return 0;
 }
 
-static int __devinit cx18_create_out_workq(struct cx18 *cx)
-{
-       snprintf(cx->out_workq_name, sizeof(cx->out_workq_name), "%s-out",
-                cx->v4l2_dev.name);
-       cx->out_work_queue = create_workqueue(cx->out_workq_name);
-       if (cx->out_work_queue == NULL) {
-               CX18_ERR("Unable to create outgoing mailbox handler threads\n");
-               return -ENOMEM;
-       }
-       return 0;
-}
-
 static void __devinit cx18_init_in_work_orders(struct cx18 *cx)
 {
        int i;
@@ -710,15 +698,9 @@ static int __devinit cx18_init_struct1(struct cx18 *cx)
        mutex_init(&cx->epu2apu_mb_lock);
        mutex_init(&cx->epu2cpu_mb_lock);
 
-       ret = cx18_create_out_workq(cx);
-       if (ret)
-               return ret;
-
        ret = cx18_create_in_workq(cx);
-       if (ret) {
-               destroy_workqueue(cx->out_work_queue);
+       if (ret)
                return ret;
-       }
 
        cx18_init_in_work_orders(cx);
 
@@ -1107,7 +1089,6 @@ free_mem:
        release_mem_region(cx->base_addr, CX18_MEM_SIZE);
 free_workqueues:
        destroy_workqueue(cx->in_work_queue);
-       destroy_workqueue(cx->out_work_queue);
 err:
        if (retval == 0)
                retval = -ENODEV;
@@ -1259,7 +1240,6 @@ static void cx18_remove(struct pci_dev *pci_dev)
        cx18_halt_firmware(cx);
 
        destroy_workqueue(cx->in_work_queue);
-       destroy_workqueue(cx->out_work_queue);
 
        cx18_streams_cleanup(cx, 1);
 
index f6f3e50d4bdf7f1fd04a87f57822278f70ad4c6a..306caac6d3fc05a15dfcfc7998e51e1bf10c168f 100644 (file)
@@ -617,9 +617,6 @@ struct cx18 {
        struct cx18_in_work_order in_work_order[CX18_MAX_IN_WORK_ORDERS];
        char epu_debug_str[256]; /* CX18_EPU_DEBUG is rare: use shared space */
 
-       struct workqueue_struct *out_work_queue;
-       char out_workq_name[12]; /* "cx18-NN-out" */
-
        /* i2c */
        struct i2c_adapter i2c_adap[2];
        struct i2c_algo_bit_data i2c_algo[2];
index 51765eb12d39b0e31f05f0ae66f9c13c417501dc..713b0e61536dd6a8f9edd330d708c0388f13d447 100644 (file)
@@ -42,8 +42,7 @@ static inline bool cx18_stream_enabled(struct cx18_stream *s)
 /* Related to submission of mdls to firmware */
 static inline void cx18_stream_load_fw_queue(struct cx18_stream *s)
 {
-       struct cx18 *cx = s->cx;
-       queue_work(cx->out_work_queue, &s->out_work_order);
+       schedule_work(&s->out_work_order);
 }
 
 static inline void cx18_stream_put_mdl_fw(struct cx18_stream *s,
index fe59a1c3f064369606fe7b99d9d3100c9c266ece..363aa600422103834cf7af9e5c9be88a2f26ece5 100644 (file)
@@ -28,7 +28,6 @@
 #include <media/videobuf-vmalloc.h>
 
 #include "xc5000.h"
-#include "dvb_dummy_fe.h"
 #include "s5h1432.h"
 #include "tda18271.h"
 #include "s5h1411.h"
@@ -619,7 +618,7 @@ static int dvb_init(struct cx231xx *dev)
 
                if (dev->dvb->frontend == NULL) {
                        printk(DRIVER_NAME
-                              ": Failed to attach dummy front end\n");
+                              ": Failed to attach s5h1411 front end\n");
                        result = -EINVAL;
                        goto out_free;
                }
@@ -665,7 +664,7 @@ static int dvb_init(struct cx231xx *dev)
 
                if (dev->dvb->frontend == NULL) {
                        printk(DRIVER_NAME
-                              ": Failed to attach dummy front end\n");
+                              ": Failed to attach s5h1411 front end\n");
                        result = -EINVAL;
                        goto out_free;
                }
index f16461844c5c0063e281da22b8cd3e27fe6d28f4..6fc09dd41b9dd56581ae6d5b9b597beea94ce0d6 100644 (file)
@@ -1682,20 +1682,6 @@ static int cx25840_log_status(struct v4l2_subdev *sd)
        return 0;
 }
 
-static int cx25840_s_config(struct v4l2_subdev *sd, int irq, void *platform_data)
-{
-       struct cx25840_state *state = to_state(sd);
-       struct i2c_client *client = v4l2_get_subdevdata(sd);
-
-       if (platform_data) {
-               struct cx25840_platform_data *pdata = platform_data;
-
-               state->pvr150_workaround = pdata->pvr150_workaround;
-               set_input(client, state->vid_input, state->aud_input);
-       }
-       return 0;
-}
-
 static int cx23885_irq_handler(struct v4l2_subdev *sd, u32 status,
                               bool *handled)
 {
@@ -1787,7 +1773,6 @@ static const struct v4l2_ctrl_ops cx25840_ctrl_ops = {
 
 static const struct v4l2_subdev_core_ops cx25840_core_ops = {
        .log_status = cx25840_log_status,
-       .s_config = cx25840_s_config,
        .g_chip_ident = cx25840_g_chip_ident,
        .g_ctrl = v4l2_subdev_g_ctrl,
        .s_ctrl = v4l2_subdev_s_ctrl,
@@ -1974,7 +1959,6 @@ static int cx25840_probe(struct i2c_client *client,
        state->vid_input = CX25840_COMPOSITE7;
        state->aud_input = CX25840_AUDIO8;
        state->audclk_freq = 48000;
-       state->pvr150_workaround = 0;
        state->audmode = V4L2_TUNER_MODE_LANG1;
        state->vbi_line_offset = 8;
        state->id = id;
@@ -2034,6 +2018,12 @@ static int cx25840_probe(struct i2c_client *client,
        v4l2_ctrl_cluster(2, &state->volume);
        v4l2_ctrl_handler_setup(&state->hdl);
 
+       if (client->dev.platform_data) {
+               struct cx25840_platform_data *pdata = client->dev.platform_data;
+
+               state->pvr150_workaround = pdata->pvr150_workaround;
+       }
+
        cx25840_ir_probe(sd);
        return 0;
 }
index 1f532e31cd49b28b3c8f998ce73ed0cce3da2120..9f3bfc1eb2402648a25dc0c1e90ce21cc374e50b 100644 (file)
@@ -41,6 +41,183 @@ spinlock_t vpif_lock;
 
 void __iomem *vpif_base;
 
+/**
+ * ch_params: video standard configuration parameters for vpif
+ * The table must include all presets from supported subdevices.
+ */
+const struct vpif_channel_config_params ch_params[] = {
+       /* HDTV formats */
+       {
+               .name = "480p59_94",
+               .width = 720,
+               .height = 480,
+               .frm_fmt = 1,
+               .ycmux_mode = 0,
+               .eav2sav = 138-8,
+               .sav2eav = 720,
+               .l1 = 1,
+               .l3 = 43,
+               .l5 = 523,
+               .vsize = 525,
+               .capture_format = 0,
+               .vbi_supported = 0,
+               .hd_sd = 1,
+               .dv_preset = V4L2_DV_480P59_94,
+       },
+       {
+               .name = "576p50",
+               .width = 720,
+               .height = 576,
+               .frm_fmt = 1,
+               .ycmux_mode = 0,
+               .eav2sav = 144-8,
+               .sav2eav = 720,
+               .l1 = 1,
+               .l3 = 45,
+               .l5 = 621,
+               .vsize = 625,
+               .capture_format = 0,
+               .vbi_supported = 0,
+               .hd_sd = 1,
+               .dv_preset = V4L2_DV_576P50,
+       },
+       {
+               .name = "720p50",
+               .width = 1280,
+               .height = 720,
+               .frm_fmt = 1,
+               .ycmux_mode = 0,
+               .eav2sav = 700-8,
+               .sav2eav = 1280,
+               .l1 = 1,
+               .l3 = 26,
+               .l5 = 746,
+               .vsize = 750,
+               .capture_format = 0,
+               .vbi_supported = 0,
+               .hd_sd = 1,
+               .dv_preset = V4L2_DV_720P50,
+       },
+       {
+               .name = "720p60",
+               .width = 1280,
+               .height = 720,
+               .frm_fmt = 1,
+               .ycmux_mode = 0,
+               .eav2sav = 370 - 8,
+               .sav2eav = 1280,
+               .l1 = 1,
+               .l3 = 26,
+               .l5 = 746,
+               .vsize = 750,
+               .capture_format = 0,
+               .vbi_supported = 0,
+               .hd_sd = 1,
+               .dv_preset = V4L2_DV_720P60,
+       },
+       {
+               .name = "1080I50",
+               .width = 1920,
+               .height = 1080,
+               .frm_fmt = 0,
+               .ycmux_mode = 0,
+               .eav2sav = 720 - 8,
+               .sav2eav = 1920,
+               .l1 = 1,
+               .l3 = 21,
+               .l5 = 561,
+               .l7 = 563,
+               .l9 = 584,
+               .l11 = 1124,
+               .vsize = 1125,
+               .capture_format = 0,
+               .vbi_supported = 0,
+               .hd_sd = 1,
+               .dv_preset = V4L2_DV_1080I50,
+       },
+       {
+               .name = "1080I60",
+               .width = 1920,
+               .height = 1080,
+               .frm_fmt = 0,
+               .ycmux_mode = 0,
+               .eav2sav = 280 - 8,
+               .sav2eav = 1920,
+               .l1 = 1,
+               .l3 = 21,
+               .l5 = 561,
+               .l7 = 563,
+               .l9 = 584,
+               .l11 = 1124,
+               .vsize = 1125,
+               .capture_format = 0,
+               .vbi_supported = 0,
+               .hd_sd = 1,
+               .dv_preset = V4L2_DV_1080I60,
+       },
+       {
+               .name = "1080p60",
+               .width = 1920,
+               .height = 1080,
+               .frm_fmt = 1,
+               .ycmux_mode = 0,
+               .eav2sav = 280 - 8,
+               .sav2eav = 1920,
+               .l1 = 1,
+               .l3 = 42,
+               .l5 = 1122,
+               .vsize = 1125,
+               .capture_format = 0,
+               .vbi_supported = 0,
+               .hd_sd = 1,
+               .dv_preset = V4L2_DV_1080P60,
+       },
+
+       /* SDTV formats */
+       {
+               .name = "NTSC_M",
+               .width = 720,
+               .height = 480,
+               .frm_fmt = 0,
+               .ycmux_mode = 1,
+               .eav2sav = 268,
+               .sav2eav = 1440,
+               .l1 = 1,
+               .l3 = 23,
+               .l5 = 263,
+               .l7 = 266,
+               .l9 = 286,
+               .l11 = 525,
+               .vsize = 525,
+               .capture_format = 0,
+               .vbi_supported = 1,
+               .hd_sd = 0,
+               .stdid = V4L2_STD_525_60,
+       },
+       {
+               .name = "PAL_BDGHIK",
+               .width = 720,
+               .height = 576,
+               .frm_fmt = 0,
+               .ycmux_mode = 1,
+               .eav2sav = 280,
+               .sav2eav = 1440,
+               .l1 = 1,
+               .l3 = 23,
+               .l5 = 311,
+               .l7 = 313,
+               .l9 = 336,
+               .l11 = 624,
+               .vsize = 625,
+               .capture_format = 0,
+               .vbi_supported = 1,
+               .hd_sd = 0,
+               .stdid = V4L2_STD_625_50,
+       },
+};
+
+const unsigned int vpif_ch_params_count = ARRAY_SIZE(ch_params);
+
 static inline void vpif_wr_bit(u32 reg, u32 bit, u32 val)
 {
        if (val)
index ebd5c4338ebb3f2fd10492dccc5d0a429325c1ec..10550bd93b062851cd8154e9f5f541a0dc849178 100644 (file)
@@ -577,12 +577,10 @@ struct vpif_channel_config_params {
        char name[VPIF_MAX_NAME];       /* Name of the mode */
        u16 width;                      /* Indicates width of the image */
        u16 height;                     /* Indicates height of the image */
-       u8 fps;
-       u8 frm_fmt;                     /* Indicates whether this is interlaced
-                                        * or progressive format */
-       u8 ycmux_mode;                  /* Indicates whether this mode requires
-                                        * single or two channels */
-       u16 eav2sav;                    /* length of sav 2 eav */
+       u8 frm_fmt;                     /* Interlaced (0) or progressive (1) */
+       u8 ycmux_mode;                  /* This mode requires one (0) or two (1)
+                                          channels */
+       u16 eav2sav;                    /* length of eav 2 sav */
        u16 sav2eav;                    /* length of sav 2 eav */
        u16 l1, l3, l5, l7, l9, l11;    /* Other parameter configurations */
        u16 vsize;                      /* Vertical size of the image */
@@ -590,10 +588,14 @@ struct vpif_channel_config_params {
                                         * is in BT or in CCD/CMOS */
        u8  vbi_supported;              /* Indicates whether this mode
                                         * supports capturing vbi or not */
-       u8 hd_sd;
-       v4l2_std_id stdid;
+       u8 hd_sd;                       /* HDTV (1) or SDTV (0) format */
+       v4l2_std_id stdid;              /* SDTV format */
+       u32 dv_preset;                  /* HDTV format */
 };
 
+extern const unsigned int vpif_ch_params_count;
+extern const struct vpif_channel_config_params ch_params[];
+
 struct vpif_video_params;
 struct vpif_params;
 struct vpif_vbi_params;
index 193abab6b355e90b619a3a57d4ab434a551640b5..d93ad74a34c5fbe46631bb579836b03b6e4bb42a 100644 (file)
@@ -37,6 +37,7 @@
 #include <linux/slab.h>
 #include <media/v4l2-device.h>
 #include <media/v4l2-ioctl.h>
+#include <media/v4l2-chip-ident.h>
 
 #include "vpif_capture.h"
 #include "vpif.h"
@@ -80,20 +81,6 @@ static struct vpif_config_params config_params = {
 static struct vpif_device vpif_obj = { {NULL} };
 static struct device *vpif_dev;
 
-/**
- * ch_params: video standard configuration parameters for vpif
- */
-static const struct vpif_channel_config_params ch_params[] = {
-       {
-               "NTSC_M", 720, 480, 30, 0, 1, 268, 1440, 1, 23, 263, 266,
-               286, 525, 525, 0, 1, 0, V4L2_STD_525_60,
-       },
-       {
-               "PAL_BDGHIK", 720, 576, 25, 0, 1, 280, 1440, 1, 23, 311, 313,
-               336, 624, 625, 0, 1, 0, V4L2_STD_625_50,
-       },
-};
-
 /**
  * vpif_uservirt_to_phys : translate user/virtual address to phy address
  * @virtp: user/virtual address
@@ -342,7 +329,7 @@ static void vpif_schedule_next_buffer(struct common_obj *common)
  * @dev_id: dev_id ptr
  *
  * It changes status of the captured buffer, takes next buffer from the queue
- * and sets its address in VPIF  registers
+ * and sets its address in VPIF registers
  */
 static irqreturn_t vpif_channel_isr(int irq, void *dev_id)
 {
@@ -435,24 +422,31 @@ static int vpif_update_std_info(struct channel_obj *ch)
        struct common_obj *common = &ch->common[VPIF_VIDEO_INDEX];
        struct vpif_params *vpifparams = &ch->vpifparams;
        const struct vpif_channel_config_params *config;
-       struct vpif_channel_config_params *std_info;
+       struct vpif_channel_config_params *std_info = &vpifparams->std_info;
        struct video_obj *vid_ch = &ch->video;
        int index;
 
        vpif_dbg(2, debug, "vpif_update_std_info\n");
 
-       std_info = &vpifparams->std_info;
-
-       for (index = 0; index < ARRAY_SIZE(ch_params); index++) {
+       for (index = 0; index < vpif_ch_params_count; index++) {
                config = &ch_params[index];
-               if (config->stdid & vid_ch->stdid) {
-                       memcpy(std_info, config, sizeof(*config));
-                       break;
+               if (config->hd_sd == 0) {
+                       vpif_dbg(2, debug, "SD format\n");
+                       if (config->stdid & vid_ch->stdid) {
+                               memcpy(std_info, config, sizeof(*config));
+                               break;
+                       }
+               } else {
+                       vpif_dbg(2, debug, "HD format\n");
+                       if (config->dv_preset == vid_ch->dv_preset) {
+                               memcpy(std_info, config, sizeof(*config));
+                               break;
+                       }
                }
        }
 
        /* standard not found */
-       if (index == ARRAY_SIZE(ch_params))
+       if (index == vpif_ch_params_count)
                return -EINVAL;
 
        common->fmt.fmt.pix.width = std_info->width;
@@ -462,6 +456,7 @@ static int vpif_update_std_info(struct channel_obj *ch)
        common->fmt.fmt.pix.bytesperline = std_info->width;
        vpifparams->video_params.hpitch = std_info->width;
        vpifparams->video_params.storage_mode = std_info->frm_fmt;
+
        return 0;
 }
 
@@ -757,7 +752,7 @@ static int vpif_open(struct file *filep)
        struct video_obj *vid_ch;
        struct channel_obj *ch;
        struct vpif_fh *fh;
-       int i, ret = 0;
+       int i;
 
        vpif_dbg(2, debug, "vpif_open\n");
 
@@ -766,9 +761,6 @@ static int vpif_open(struct file *filep)
        vid_ch = &ch->video;
        common = &ch->common[VPIF_VIDEO_INDEX];
 
-       if (mutex_lock_interruptible(&common->lock))
-               return -ERESTARTSYS;
-
        if (NULL == ch->curr_subdev_info) {
                /**
                 * search through the sub device to see a registered
@@ -785,8 +777,7 @@ static int vpif_open(struct file *filep)
                }
                if (i == config->subdev_count) {
                        vpif_err("No sub device registered\n");
-                       ret = -ENOENT;
-                       goto exit;
+                       return -ENOENT;
                }
        }
 
@@ -794,8 +785,7 @@ static int vpif_open(struct file *filep)
        fh = kzalloc(sizeof(struct vpif_fh), GFP_KERNEL);
        if (NULL == fh) {
                vpif_err("unable to allocate memory for file handle object\n");
-               ret = -ENOMEM;
-               goto exit;
+               return -ENOMEM;
        }
 
        /* store pointer to fh in private_data member of filep */
@@ -815,9 +805,7 @@ static int vpif_open(struct file *filep)
        /* Initialize priority of this instance to default priority */
        fh->prio = V4L2_PRIORITY_UNSET;
        v4l2_prio_open(&ch->prio, &fh->prio);
-exit:
-       mutex_unlock(&common->lock);
-       return ret;
+       return 0;
 }
 
 /**
@@ -837,9 +825,6 @@ static int vpif_release(struct file *filep)
 
        common = &ch->common[VPIF_VIDEO_INDEX];
 
-       if (mutex_lock_interruptible(&common->lock))
-               return -ERESTARTSYS;
-
        /* if this instance is doing IO */
        if (fh->io_allowed[VPIF_VIDEO_INDEX]) {
                /* Reset io_usrs member of channel object */
@@ -863,9 +848,6 @@ static int vpif_release(struct file *filep)
        /* Decrement channel usrs counter */
        ch->usrs--;
 
-       /* unlock mutex on channel object */
-       mutex_unlock(&common->lock);
-
        /* Close the priority */
        v4l2_prio_close(&ch->prio, fh->prio);
 
@@ -890,7 +872,6 @@ static int vpif_reqbufs(struct file *file, void *priv,
        struct channel_obj *ch = fh->channel;
        struct common_obj *common;
        u8 index = 0;
-       int ret = 0;
 
        vpif_dbg(2, debug, "vpif_reqbufs\n");
 
@@ -913,13 +894,8 @@ static int vpif_reqbufs(struct file *file, void *priv,
 
        common = &ch->common[index];
 
-       if (mutex_lock_interruptible(&common->lock))
-               return -ERESTARTSYS;
-
-       if (0 != common->io_usrs) {
-               ret = -EBUSY;
-               goto reqbuf_exit;
-       }
+       if (0 != common->io_usrs)
+               return -EBUSY;
 
        /* Initialize videobuf queue as per the buffer type */
        videobuf_queue_dma_contig_init(&common->buffer_queue,
@@ -928,7 +904,7 @@ static int vpif_reqbufs(struct file *file, void *priv,
                                            reqbuf->type,
                                            common->fmt.fmt.pix.field,
                                            sizeof(struct videobuf_buffer), fh,
-                                           NULL);
+                                           &common->lock);
 
        /* Set io allowed member of file handle to TRUE */
        fh->io_allowed[index] = 1;
@@ -939,11 +915,7 @@ static int vpif_reqbufs(struct file *file, void *priv,
        INIT_LIST_HEAD(&common->dma_queue);
 
        /* Allocate buffers */
-       ret = videobuf_reqbufs(&common->buffer_queue, reqbuf);
-
-reqbuf_exit:
-       mutex_unlock(&common->lock);
-       return ret;
+       return videobuf_reqbufs(&common->buffer_queue, reqbuf);
 }
 
 /**
@@ -1157,11 +1129,6 @@ static int vpif_streamon(struct file *file, void *priv,
                return ret;
        }
 
-       if (mutex_lock_interruptible(&common->lock)) {
-               ret = -ERESTARTSYS;
-               goto streamoff_exit;
-       }
-
        /* If buffer queue is empty, return error */
        if (list_empty(&common->dma_queue)) {
                vpif_dbg(1, debug, "buffer queue is empty\n");
@@ -1240,13 +1207,10 @@ static int vpif_streamon(struct file *file, void *priv,
                enable_channel1(1);
        }
        channel_first_int[VPIF_VIDEO_INDEX][ch->channel_id] = 1;
-       mutex_unlock(&common->lock);
        return ret;
 
 exit:
-       mutex_unlock(&common->lock);
-streamoff_exit:
-       ret = videobuf_streamoff(&common->buffer_queue);
+       videobuf_streamoff(&common->buffer_queue);
        return ret;
 }
 
@@ -1284,9 +1248,6 @@ static int vpif_streamoff(struct file *file, void *priv,
                return -EINVAL;
        }
 
-       if (mutex_lock_interruptible(&common->lock))
-               return -ERESTARTSYS;
-
        /* disable channel */
        if (VPIF_CHANNEL0_VIDEO == ch->channel_id) {
                enable_channel0(0);
@@ -1304,8 +1265,6 @@ static int vpif_streamoff(struct file *file, void *priv,
        if (ret && (ret != -ENOIOCTLCMD))
                vpif_dbg(1, debug, "stream off failed in subdev\n");
 
-       mutex_unlock(&common->lock);
-
        return videobuf_streamoff(&common->buffer_queue);
 }
 
@@ -1381,21 +1340,16 @@ static int vpif_querystd(struct file *file, void *priv, v4l2_std_id *std_id)
 {
        struct vpif_fh *fh = priv;
        struct channel_obj *ch = fh->channel;
-       struct common_obj *common = &ch->common[VPIF_VIDEO_INDEX];
        int ret = 0;
 
        vpif_dbg(2, debug, "vpif_querystd\n");
 
-       if (mutex_lock_interruptible(&common->lock))
-               return -ERESTARTSYS;
-
        /* Call querystd function of decoder device */
        ret = v4l2_subdev_call(vpif_obj.sd[ch->curr_sd_index], video,
                                querystd, std_id);
        if (ret < 0)
                vpif_dbg(1, debug, "Failed to set standard for sub devices\n");
 
-       mutex_unlock(&common->lock);
        return ret;
 }
 
@@ -1451,16 +1405,14 @@ static int vpif_s_std(struct file *file, void *priv, v4l2_std_id *std_id)
        fh->initialized = 1;
 
        /* Call encoder subdevice function to set the standard */
-       if (mutex_lock_interruptible(&common->lock))
-               return -ERESTARTSYS;
-
        ch->video.stdid = *std_id;
+       ch->video.dv_preset = V4L2_DV_INVALID;
+       memset(&ch->video.bt_timings, 0, sizeof(ch->video.bt_timings));
 
        /* Get the information about the standard */
        if (vpif_update_std_info(ch)) {
-               ret = -EINVAL;
                vpif_err("Error getting the standard info\n");
-               goto s_std_exit;
+               return -EINVAL;
        }
 
        /* Configure the default format information */
@@ -1471,9 +1423,6 @@ static int vpif_s_std(struct file *file, void *priv, v4l2_std_id *std_id)
                                s_std, *std_id);
        if (ret < 0)
                vpif_dbg(1, debug, "Failed to set standard for sub devices\n");
-
-s_std_exit:
-       mutex_unlock(&common->lock);
        return ret;
 }
 
@@ -1567,9 +1516,6 @@ static int vpif_s_input(struct file *file, void *priv, unsigned int index)
                return -EINVAL;
        }
 
-       if (mutex_lock_interruptible(&common->lock))
-               return -ERESTARTSYS;
-
        /* first setup input path from sub device to vpif */
        if (config->setup_input_path) {
                ret = config->setup_input_path(ch->channel_id,
@@ -1578,7 +1524,7 @@ static int vpif_s_input(struct file *file, void *priv, unsigned int index)
                        vpif_dbg(1, debug, "couldn't setup input path for the"
                                " sub device %s, for input index %d\n",
                                subdev_info->name, index);
-                       goto exit;
+                       return ret;
                }
        }
 
@@ -1589,7 +1535,7 @@ static int vpif_s_input(struct file *file, void *priv, unsigned int index)
                                        input, output, 0);
                if (ret < 0) {
                        vpif_dbg(1, debug, "Failed to set input\n");
-                       goto exit;
+                       return ret;
                }
        }
        vid_ch->input_idx = index;
@@ -1600,9 +1546,6 @@ static int vpif_s_input(struct file *file, void *priv, unsigned int index)
 
        /* update tvnorms from the sub device input info */
        ch->video_dev->tvnorms = chan_cfg->inputs[index].input.std;
-
-exit:
-       mutex_unlock(&common->lock);
        return ret;
 }
 
@@ -1671,11 +1614,7 @@ static int vpif_g_fmt_vid_cap(struct file *file, void *priv,
                return -EINVAL;
 
        /* Fill in the information about format */
-       if (mutex_lock_interruptible(&common->lock))
-               return -ERESTARTSYS;
-
        *fmt = common->fmt;
-       mutex_unlock(&common->lock);
        return 0;
 }
 
@@ -1694,7 +1633,7 @@ static int vpif_s_fmt_vid_cap(struct file *file, void *priv,
        struct v4l2_pix_format *pixfmt;
        int ret = 0;
 
-       vpif_dbg(2, debug, "VIDIOC_S_FMT\n");
+       vpif_dbg(2, debug, "%s\n", __func__);
 
        /* If streaming is started, return error */
        if (common->started) {
@@ -1723,12 +1662,7 @@ static int vpif_s_fmt_vid_cap(struct file *file, void *priv,
        if (ret)
                return ret;
        /* store the format in the channel object */
-       if (mutex_lock_interruptible(&common->lock))
-               return -ERESTARTSYS;
-
        common->fmt = *fmt;
-       mutex_unlock(&common->lock);
-
        return 0;
 }
 
@@ -1807,6 +1741,306 @@ static int vpif_cropcap(struct file *file, void *priv,
        return 0;
 }
 
+/**
+ * vpif_enum_dv_presets() - ENUM_DV_PRESETS handler
+ * @file: file ptr
+ * @priv: file handle
+ * @preset: input preset
+ */
+static int vpif_enum_dv_presets(struct file *file, void *priv,
+               struct v4l2_dv_enum_preset *preset)
+{
+       struct vpif_fh *fh = priv;
+       struct channel_obj *ch = fh->channel;
+
+       return v4l2_subdev_call(vpif_obj.sd[ch->curr_sd_index],
+                       video, enum_dv_presets, preset);
+}
+
+/**
+ * vpif_query_dv_presets() - QUERY_DV_PRESET handler
+ * @file: file ptr
+ * @priv: file handle
+ * @preset: input preset
+ */
+static int vpif_query_dv_preset(struct file *file, void *priv,
+               struct v4l2_dv_preset *preset)
+{
+       struct vpif_fh *fh = priv;
+       struct channel_obj *ch = fh->channel;
+
+       return v4l2_subdev_call(vpif_obj.sd[ch->curr_sd_index],
+                      video, query_dv_preset, preset);
+}
+/**
+ * vpif_s_dv_presets() - S_DV_PRESETS handler
+ * @file: file ptr
+ * @priv: file handle
+ * @preset: input preset
+ */
+static int vpif_s_dv_preset(struct file *file, void *priv,
+               struct v4l2_dv_preset *preset)
+{
+       struct vpif_fh *fh = priv;
+       struct channel_obj *ch = fh->channel;
+       struct common_obj *common = &ch->common[VPIF_VIDEO_INDEX];
+       int ret = 0;
+
+       if (common->started) {
+               vpif_dbg(1, debug, "streaming in progress\n");
+               return -EBUSY;
+       }
+
+       if ((VPIF_CHANNEL0_VIDEO == ch->channel_id) ||
+           (VPIF_CHANNEL1_VIDEO == ch->channel_id)) {
+               if (!fh->initialized) {
+                       vpif_dbg(1, debug, "Channel Busy\n");
+                       return -EBUSY;
+               }
+       }
+
+       ret = v4l2_prio_check(&ch->prio, fh->prio);
+       if (ret)
+               return ret;
+
+       fh->initialized = 1;
+
+       /* Call encoder subdevice function to set the standard */
+       if (mutex_lock_interruptible(&common->lock))
+               return -ERESTARTSYS;
+
+       ch->video.dv_preset = preset->preset;
+       ch->video.stdid = V4L2_STD_UNKNOWN;
+       memset(&ch->video.bt_timings, 0, sizeof(ch->video.bt_timings));
+
+       /* Get the information about the standard */
+       if (vpif_update_std_info(ch)) {
+               vpif_dbg(1, debug, "Error getting the standard info\n");
+               ret = -EINVAL;
+       } else {
+               /* Configure the default format information */
+               vpif_config_format(ch);
+
+               ret = v4l2_subdev_call(vpif_obj.sd[ch->curr_sd_index],
+                               video, s_dv_preset, preset);
+       }
+
+       mutex_unlock(&common->lock);
+
+       return ret;
+}
+/**
+ * vpif_g_dv_presets() - G_DV_PRESETS handler
+ * @file: file ptr
+ * @priv: file handle
+ * @preset: input preset
+ */
+static int vpif_g_dv_preset(struct file *file, void *priv,
+               struct v4l2_dv_preset *preset)
+{
+       struct vpif_fh *fh = priv;
+       struct channel_obj *ch = fh->channel;
+
+       preset->preset = ch->video.dv_preset;
+
+       return 0;
+}
+
+/**
+ * vpif_s_dv_timings() - S_DV_TIMINGS handler
+ * @file: file ptr
+ * @priv: file handle
+ * @timings: digital video timings
+ */
+static int vpif_s_dv_timings(struct file *file, void *priv,
+               struct v4l2_dv_timings *timings)
+{
+       struct vpif_fh *fh = priv;
+       struct channel_obj *ch = fh->channel;
+       struct vpif_params *vpifparams = &ch->vpifparams;
+       struct vpif_channel_config_params *std_info = &vpifparams->std_info;
+       struct video_obj *vid_ch = &ch->video;
+       struct v4l2_bt_timings *bt = &vid_ch->bt_timings;
+       int ret;
+
+       if (timings->type != V4L2_DV_BT_656_1120) {
+               vpif_dbg(2, debug, "Timing type not defined\n");
+               return -EINVAL;
+       }
+
+       /* Configure subdevice timings, if any */
+       ret = v4l2_subdev_call(vpif_obj.sd[ch->curr_sd_index],
+                       video, s_dv_timings, timings);
+       if (ret == -ENOIOCTLCMD) {
+               vpif_dbg(2, debug, "Custom DV timings not supported by "
+                               "subdevice\n");
+               return -EINVAL;
+       }
+       if (ret < 0) {
+               vpif_dbg(2, debug, "Error setting custom DV timings\n");
+               return ret;
+       }
+
+       if (!(timings->bt.width && timings->bt.height &&
+                               (timings->bt.hbackporch ||
+                                timings->bt.hfrontporch ||
+                                timings->bt.hsync) &&
+                               timings->bt.vfrontporch &&
+                               (timings->bt.vbackporch ||
+                                timings->bt.vsync))) {
+               vpif_dbg(2, debug, "Timings for width, height, "
+                               "horizontal back porch, horizontal sync, "
+                               "horizontal front porch, vertical back porch, "
+                               "vertical sync and vertical back porch "
+                               "must be defined\n");
+               return -EINVAL;
+       }
+
+       *bt = timings->bt;
+
+       /* Configure video port timings */
+
+       std_info->eav2sav = bt->hbackporch + bt->hfrontporch +
+               bt->hsync - 8;
+       std_info->sav2eav = bt->width;
+
+       std_info->l1 = 1;
+       std_info->l3 = bt->vsync + bt->vbackporch + 1;
+
+       if (bt->interlaced) {
+               if (bt->il_vbackporch || bt->il_vfrontporch || bt->il_vsync) {
+                       std_info->vsize = bt->height * 2 +
+                               bt->vfrontporch + bt->vsync + bt->vbackporch +
+                               bt->il_vfrontporch + bt->il_vsync +
+                               bt->il_vbackporch;
+                       std_info->l5 = std_info->vsize/2 -
+                               (bt->vfrontporch - 1);
+                       std_info->l7 = std_info->vsize/2 + 1;
+                       std_info->l9 = std_info->l7 + bt->il_vsync +
+                               bt->il_vbackporch + 1;
+                       std_info->l11 = std_info->vsize -
+                               (bt->il_vfrontporch - 1);
+               } else {
+                       vpif_dbg(2, debug, "Required timing values for "
+                                       "interlaced BT format missing\n");
+                       return -EINVAL;
+               }
+       } else {
+               std_info->vsize = bt->height + bt->vfrontporch +
+                       bt->vsync + bt->vbackporch;
+               std_info->l5 = std_info->vsize - (bt->vfrontporch - 1);
+       }
+       strncpy(std_info->name, "Custom timings BT656/1120", VPIF_MAX_NAME);
+       std_info->width = bt->width;
+       std_info->height = bt->height;
+       std_info->frm_fmt = bt->interlaced ? 0 : 1;
+       std_info->ycmux_mode = 0;
+       std_info->capture_format = 0;
+       std_info->vbi_supported = 0;
+       std_info->hd_sd = 1;
+       std_info->stdid = 0;
+       std_info->dv_preset = V4L2_DV_INVALID;
+
+       vid_ch->stdid = 0;
+       vid_ch->dv_preset = V4L2_DV_INVALID;
+       return 0;
+}
+
+/**
+ * vpif_g_dv_timings() - G_DV_TIMINGS handler
+ * @file: file ptr
+ * @priv: file handle
+ * @timings: digital video timings
+ */
+static int vpif_g_dv_timings(struct file *file, void *priv,
+               struct v4l2_dv_timings *timings)
+{
+       struct vpif_fh *fh = priv;
+       struct channel_obj *ch = fh->channel;
+       struct video_obj *vid_ch = &ch->video;
+       struct v4l2_bt_timings *bt = &vid_ch->bt_timings;
+
+       timings->bt = *bt;
+
+       return 0;
+}
+
+/*
+ * vpif_g_chip_ident() - Identify the chip
+ * @file: file ptr
+ * @priv: file handle
+ * @chip: chip identity
+ *
+ * Returns zero or -EINVAL if read operations fails.
+ */
+static int vpif_g_chip_ident(struct file *file, void *priv,
+               struct v4l2_dbg_chip_ident *chip)
+{
+       chip->ident = V4L2_IDENT_NONE;
+       chip->revision = 0;
+       if (chip->match.type != V4L2_CHIP_MATCH_I2C_DRIVER &&
+                       chip->match.type != V4L2_CHIP_MATCH_I2C_ADDR) {
+               vpif_dbg(2, debug, "match_type is invalid.\n");
+               return -EINVAL;
+       }
+
+       return v4l2_device_call_until_err(&vpif_obj.v4l2_dev, 0, core,
+                       g_chip_ident, chip);
+}
+
+#ifdef CONFIG_VIDEO_ADV_DEBUG
+/*
+ * vpif_dbg_g_register() - Read register
+ * @file: file ptr
+ * @priv: file handle
+ * @reg: register to be read
+ *
+ * Debugging only
+ * Returns zero or -EINVAL if read operations fails.
+ */
+static int vpif_dbg_g_register(struct file *file, void *priv,
+               struct v4l2_dbg_register *reg){
+       struct vpif_fh *fh = priv;
+       struct channel_obj *ch = fh->channel;
+
+       return v4l2_subdev_call(vpif_obj.sd[ch->curr_sd_index], core,
+                       g_register, reg);
+}
+
+/*
+ * vpif_dbg_s_register() - Write to register
+ * @file: file ptr
+ * @priv: file handle
+ * @reg: register to be modified
+ *
+ * Debugging only
+ * Returns zero or -EINVAL if write operations fails.
+ */
+static int vpif_dbg_s_register(struct file *file, void *priv,
+               struct v4l2_dbg_register *reg){
+       struct vpif_fh *fh = priv;
+       struct channel_obj *ch = fh->channel;
+
+       return v4l2_subdev_call(vpif_obj.sd[ch->curr_sd_index], core,
+                       s_register, reg);
+}
+#endif
+
+/*
+ * vpif_log_status() - Status information
+ * @file: file ptr
+ * @priv: file handle
+ *
+ * Returns zero.
+ */
+static int vpif_log_status(struct file *filep, void *priv)
+{
+       /* status for sub devices */
+       v4l2_device_call_all(&vpif_obj.v4l2_dev, 0, core, log_status);
+
+       return 0;
+}
+
 /* vpif capture ioctl operations */
 static const struct v4l2_ioctl_ops vpif_ioctl_ops = {
        .vidioc_querycap                = vpif_querycap,
@@ -1829,6 +2063,18 @@ static const struct v4l2_ioctl_ops vpif_ioctl_ops = {
        .vidioc_streamon                = vpif_streamon,
        .vidioc_streamoff               = vpif_streamoff,
        .vidioc_cropcap                 = vpif_cropcap,
+       .vidioc_enum_dv_presets         = vpif_enum_dv_presets,
+       .vidioc_s_dv_preset             = vpif_s_dv_preset,
+       .vidioc_g_dv_preset             = vpif_g_dv_preset,
+       .vidioc_query_dv_preset         = vpif_query_dv_preset,
+       .vidioc_s_dv_timings            = vpif_s_dv_timings,
+       .vidioc_g_dv_timings            = vpif_g_dv_timings,
+       .vidioc_g_chip_ident            = vpif_g_chip_ident,
+#ifdef CONFIG_VIDEO_ADV_DEBUG
+       .vidioc_g_register              = vpif_dbg_g_register,
+       .vidioc_s_register              = vpif_dbg_s_register,
+#endif
+       .vidioc_log_status              = vpif_log_status,
 };
 
 /* vpif file operations */
@@ -1836,7 +2082,7 @@ static struct v4l2_file_operations vpif_fops = {
        .owner = THIS_MODULE,
        .open = vpif_open,
        .release = vpif_release,
-       .ioctl = video_ioctl2,
+       .unlocked_ioctl = video_ioctl2,
        .mmap = vpif_mmap,
        .poll = vpif_poll
 };
@@ -1979,6 +2225,7 @@ static __init int vpif_probe(struct platform_device *pdev)
                common = &(ch->common[VPIF_VIDEO_INDEX]);
                spin_lock_init(&common->irqlock);
                mutex_init(&common->lock);
+               ch->video_dev->lock = &common->lock;
                /* Initialize prio member of channel object */
                v4l2_prio_init(&ch->prio);
                err = video_register_device(ch->video_dev,
@@ -2026,9 +2273,9 @@ static __init int vpif_probe(struct platform_device *pdev)
                if (vpif_obj.sd[i])
                        vpif_obj.sd[i]->grp_id = 1 << i;
        }
-       v4l2_info(&vpif_obj.v4l2_dev, "DM646x VPIF Capture driver"
-                 " initialized\n");
 
+       v4l2_info(&vpif_obj.v4l2_dev,
+                       "DM646x VPIF capture driver initialized\n");
        return 0;
 
 probe_subdev_out:
index 4e12ec8cac6f5ad863861ce95c37430deb628294..7a4196dfdce19c649acb61b07e5f3600b719fc33 100644 (file)
@@ -59,6 +59,8 @@ struct video_obj {
        enum v4l2_field buf_field;
        /* Currently selected or default standard */
        v4l2_std_id stdid;
+       u32 dv_preset;
+       struct v4l2_bt_timings bt_timings;
        /* This is to track the last input that is passed to application */
        u32 input_idx;
 };
index 412c65d54fe1a3e9397aae9455edf49fc295862c..cdf659abdc2ab73ba172d85fc6a6aa75db4390c1 100644 (file)
@@ -38,6 +38,7 @@
 #include <media/adv7343.h>
 #include <media/v4l2-device.h>
 #include <media/v4l2-ioctl.h>
+#include <media/v4l2-chip-ident.h>
 
 #include <mach/dm646x.h>
 
@@ -84,17 +85,6 @@ static struct vpif_config_params config_params = {
 static struct vpif_device vpif_obj = { {NULL} };
 static struct device *vpif_dev;
 
-static const struct vpif_channel_config_params ch_params[] = {
-       {
-               "NTSC", 720, 480, 30, 0, 1, 268, 1440, 1, 23, 263, 266,
-               286, 525, 525, 0, 1, 0, V4L2_STD_525_60,
-       },
-       {
-               "PAL", 720, 576, 25, 0, 1, 280, 1440, 1, 23, 311, 313,
-               336, 624, 625, 0, 1, 0, V4L2_STD_625_50,
-       },
-};
-
 /*
  * vpif_uservirt_to_phys: This function is used to convert user
  * space virtual address to physical address.
@@ -373,30 +363,54 @@ static irqreturn_t vpif_channel_isr(int irq, void *dev_id)
        return IRQ_HANDLED;
 }
 
-static int vpif_get_std_info(struct channel_obj *ch)
+static int vpif_update_std_info(struct channel_obj *ch)
 {
-       struct common_obj *common = &ch->common[VPIF_VIDEO_INDEX];
        struct video_obj *vid_ch = &ch->video;
        struct vpif_params *vpifparams = &ch->vpifparams;
        struct vpif_channel_config_params *std_info = &vpifparams->std_info;
        const struct vpif_channel_config_params *config;
 
-       int index;
-
-       std_info->stdid = vid_ch->stdid;
-       if (!std_info->stdid)
-               return -1;
+       int i;
 
-       for (index = 0; index < ARRAY_SIZE(ch_params); index++) {
-               config = &ch_params[index];
-               if (config->stdid & std_info->stdid) {
-                       memcpy(std_info, config, sizeof(*config));
-                       break;
+       for (i = 0; i < vpif_ch_params_count; i++) {
+               config = &ch_params[i];
+               if (config->hd_sd == 0) {
+                       vpif_dbg(2, debug, "SD format\n");
+                       if (config->stdid & vid_ch->stdid) {
+                               memcpy(std_info, config, sizeof(*config));
+                               break;
+                       }
+               } else {
+                       vpif_dbg(2, debug, "HD format\n");
+                       if (config->dv_preset == vid_ch->dv_preset) {
+                               memcpy(std_info, config, sizeof(*config));
+                               break;
+                       }
                }
        }
 
-       if (index == ARRAY_SIZE(ch_params))
-               return -1;
+       if (i == vpif_ch_params_count) {
+               vpif_dbg(1, debug, "Format not found\n");
+               return -EINVAL;
+       }
+
+       return 0;
+}
+
+static int vpif_update_resolution(struct channel_obj *ch)
+{
+       struct common_obj *common = &ch->common[VPIF_VIDEO_INDEX];
+       struct video_obj *vid_ch = &ch->video;
+       struct vpif_params *vpifparams = &ch->vpifparams;
+       struct vpif_channel_config_params *std_info = &vpifparams->std_info;
+
+       if (!vid_ch->stdid && !vid_ch->dv_preset && !vid_ch->bt_timings.height)
+               return -EINVAL;
+
+       if (vid_ch->stdid || vid_ch->dv_preset) {
+               if (vpif_update_std_info(ch))
+                       return -EINVAL;
+       }
 
        common->fmt.fmt.pix.width = std_info->width;
        common->fmt.fmt.pix.height = std_info->height;
@@ -404,8 +418,8 @@ static int vpif_get_std_info(struct channel_obj *ch)
                        common->fmt.fmt.pix.width, common->fmt.fmt.pix.height);
 
        /* Set height and width paramateres */
-       ch->common[VPIF_VIDEO_INDEX].height = std_info->height;
-       ch->common[VPIF_VIDEO_INDEX].width = std_info->width;
+       common->height = std_info->height;
+       common->width = std_info->width;
 
        return 0;
 }
@@ -516,10 +530,8 @@ static int vpif_check_format(struct channel_obj *ch,
        else
                sizeimage = config_params.channel_bufsize[ch->channel_id];
 
-       if (vpif_get_std_info(ch)) {
-               vpif_err("Error getting the standard info\n");
+       if (vpif_update_resolution(ch))
                return -EINVAL;
-       }
 
        hpitch = pixfmt->bytesperline;
        vpitch = sizeimage / (hpitch * 2);
@@ -568,7 +580,10 @@ static void vpif_config_addr(struct channel_obj *ch, int muxmode)
 static int vpif_mmap(struct file *filep, struct vm_area_struct *vma)
 {
        struct vpif_fh *fh = filep->private_data;
-       struct common_obj *common = &fh->channel->common[VPIF_VIDEO_INDEX];
+       struct channel_obj *ch = fh->channel;
+       struct common_obj *common = &(ch->common[VPIF_VIDEO_INDEX]);
+
+       vpif_dbg(2, debug, "vpif_mmap\n");
 
        return videobuf_mmap_mapper(&common->buffer_queue, vma);
 }
@@ -637,9 +652,6 @@ static int vpif_release(struct file *filep)
        struct channel_obj *ch = fh->channel;
        struct common_obj *common = &ch->common[VPIF_VIDEO_INDEX];
 
-       if (mutex_lock_interruptible(&common->lock))
-               return -ERESTARTSYS;
-
        /* if this instance is doing IO */
        if (fh->io_allowed[VPIF_VIDEO_INDEX]) {
                /* Reset io_usrs member of channel object */
@@ -662,8 +674,6 @@ static int vpif_release(struct file *filep)
                    config_params.numbuffers[ch->channel_id];
        }
 
-       mutex_unlock(&common->lock);
-
        /* Decrement channel usrs counter */
        atomic_dec(&ch->usrs);
        /* If this file handle has initialize encoder device, reset it */
@@ -680,7 +690,12 @@ static int vpif_release(struct file *filep)
 }
 
 /* functions implementing ioctls */
-
+/**
+ * vpif_querycap() - QUERYCAP handler
+ * @file: file ptr
+ * @priv: file handle
+ * @cap: ptr to v4l2_capability structure
+ */
 static int vpif_querycap(struct file *file, void  *priv,
                                struct v4l2_capability *cap)
 {
@@ -722,17 +737,9 @@ static int vpif_g_fmt_vid_out(struct file *file, void *priv,
        if (common->fmt.type != fmt->type)
                return -EINVAL;
 
-       /* Fill in the information about format */
-       if (mutex_lock_interruptible(&common->lock))
-               return -ERESTARTSYS;
-
-       if (vpif_get_std_info(ch)) {
-               vpif_err("Error getting the standard info\n");
+       if (vpif_update_resolution(ch))
                return -EINVAL;
-       }
-
        *fmt = common->fmt;
-       mutex_unlock(&common->lock);
        return 0;
 }
 
@@ -773,12 +780,7 @@ static int vpif_s_fmt_vid_out(struct file *file, void *priv,
        /* store the pix format in the channel object */
        common->fmt.fmt.pix = *pixfmt;
        /* store the format in the channel object */
-       if (mutex_lock_interruptible(&common->lock))
-               return -ERESTARTSYS;
-
        common->fmt = *fmt;
-       mutex_unlock(&common->lock);
-
        return 0;
 }
 
@@ -808,7 +810,6 @@ static int vpif_reqbufs(struct file *file, void *priv,
        struct common_obj *common;
        enum v4l2_field field;
        u8 index = 0;
-       int ret = 0;
 
        /* This file handle has not initialized the channel,
           It is not allowed to do settings */
@@ -826,18 +827,12 @@ static int vpif_reqbufs(struct file *file, void *priv,
        index = VPIF_VIDEO_INDEX;
 
        common = &ch->common[index];
-       if (mutex_lock_interruptible(&common->lock))
-               return -ERESTARTSYS;
 
-       if (common->fmt.type != reqbuf->type) {
-               ret = -EINVAL;
-               goto reqbuf_exit;
-       }
+       if (common->fmt.type != reqbuf->type)
+               return -EINVAL;
 
-       if (0 != common->io_usrs) {
-               ret = -EBUSY;
-               goto reqbuf_exit;
-       }
+       if (0 != common->io_usrs)
+               return -EBUSY;
 
        if (reqbuf->type == V4L2_BUF_TYPE_VIDEO_OUTPUT) {
                if (common->fmt.fmt.pix.field == V4L2_FIELD_ANY)
@@ -854,7 +849,7 @@ static int vpif_reqbufs(struct file *file, void *priv,
                                            &common->irqlock,
                                            reqbuf->type, field,
                                            sizeof(struct videobuf_buffer), fh,
-                                           NULL);
+                                           &common->lock);
 
        /* Set io allowed member of file handle to TRUE */
        fh->io_allowed[index] = 1;
@@ -865,11 +860,7 @@ static int vpif_reqbufs(struct file *file, void *priv,
        INIT_LIST_HEAD(&common->dma_queue);
 
        /* Allocate buffers */
-       ret = videobuf_reqbufs(&common->buffer_queue, reqbuf);
-
-reqbuf_exit:
-       mutex_unlock(&common->lock);
-       return ret;
+       return videobuf_reqbufs(&common->buffer_queue, reqbuf);
 }
 
 static int vpif_querybuf(struct file *file, void *priv,
@@ -990,22 +981,19 @@ static int vpif_s_std(struct file *file, void *priv, v4l2_std_id *std_id)
        }
 
        /* Call encoder subdevice function to set the standard */
-       if (mutex_lock_interruptible(&common->lock))
-               return -ERESTARTSYS;
-
        ch->video.stdid = *std_id;
+       ch->video.dv_preset = V4L2_DV_INVALID;
+       memset(&ch->video.bt_timings, 0, sizeof(ch->video.bt_timings));
+
        /* Get the information about the standard */
-       if (vpif_get_std_info(ch)) {
-               vpif_err("Error getting the standard info\n");
+       if (vpif_update_resolution(ch))
                return -EINVAL;
-       }
 
        if ((ch->vpifparams.std_info.width *
                ch->vpifparams.std_info.height * 2) >
                config_params.channel_bufsize[ch->channel_id]) {
                vpif_err("invalid std for this size\n");
-               ret = -EINVAL;
-               goto s_std_exit;
+               return -EINVAL;
        }
 
        common->fmt.fmt.pix.bytesperline = common->fmt.fmt.pix.width;
@@ -1016,16 +1004,13 @@ static int vpif_s_std(struct file *file, void *priv, v4l2_std_id *std_id)
                                                s_std_output, *std_id);
        if (ret < 0) {
                vpif_err("Failed to set output standard\n");
-               goto s_std_exit;
+               return ret;
        }
 
        ret = v4l2_device_call_until_err(&vpif_obj.v4l2_dev, 1, core,
                                                        s_std, *std_id);
        if (ret < 0)
                vpif_err("Failed to set standard for sub devices\n");
-
-s_std_exit:
-       mutex_unlock(&common->lock);
        return ret;
 }
 
@@ -1090,21 +1075,17 @@ static int vpif_streamon(struct file *file, void *priv,
        if (ret < 0)
                return ret;
 
-       /* Call videobuf_streamon to start streaming  in videobuf */
+       /* Call videobuf_streamon to start streaming in videobuf */
        ret = videobuf_streamon(&common->buffer_queue);
        if (ret < 0) {
                vpif_err("videobuf_streamon\n");
                return ret;
        }
 
-       if (mutex_lock_interruptible(&common->lock))
-               return -ERESTARTSYS;
-
        /* If buffer queue is empty, return error */
        if (list_empty(&common->dma_queue)) {
                vpif_err("buffer queue is empty\n");
-               ret = -EIO;
-               goto streamon_exit;
+               return -EIO;
        }
 
        /* Get the next frame from the buffer queue */
@@ -1130,8 +1111,7 @@ static int vpif_streamon(struct file *file, void *priv,
                        || (!ch->vpifparams.std_info.frm_fmt
                        && (common->fmt.fmt.pix.field == V4L2_FIELD_NONE))) {
                        vpif_err("conflict in field format and std format\n");
-                       ret = -EINVAL;
-                       goto streamon_exit;
+                       return -EINVAL;
                }
 
                /* clock settings */
@@ -1140,13 +1120,13 @@ static int vpif_streamon(struct file *file, void *priv,
                                                ch->vpifparams.std_info.hd_sd);
                if (ret < 0) {
                        vpif_err("can't set clock\n");
-                       goto streamon_exit;
+                       return ret;
                }
 
                /* set the parameters and addresses */
                ret = vpif_set_video_params(vpif, ch->channel_id + 2);
                if (ret < 0)
-                       goto streamon_exit;
+                       return ret;
 
                common->started = ret;
                vpif_config_addr(ch, ret);
@@ -1171,9 +1151,6 @@ static int vpif_streamon(struct file *file, void *priv,
                }
                channel_first_int[VPIF_VIDEO_INDEX][ch->channel_id] = 1;
        }
-
-streamon_exit:
-       mutex_unlock(&common->lock);
        return ret;
 }
 
@@ -1199,9 +1176,6 @@ static int vpif_streamoff(struct file *file, void *priv,
                return -EINVAL;
        }
 
-       if (mutex_lock_interruptible(&common->lock))
-               return -ERESTARTSYS;
-
        if (buftype == V4L2_BUF_TYPE_VIDEO_OUTPUT) {
                /* disable channel */
                if (VPIF_CHANNEL2_VIDEO == ch->channel_id) {
@@ -1216,8 +1190,6 @@ static int vpif_streamoff(struct file *file, void *priv,
        }
 
        common->started = 0;
-       mutex_unlock(&common->lock);
-
        return videobuf_streamoff(&common->buffer_queue);
 }
 
@@ -1264,13 +1236,9 @@ static int vpif_s_output(struct file *file, void *priv, unsigned int i)
        struct common_obj *common = &ch->common[VPIF_VIDEO_INDEX];
        int ret = 0;
 
-       if (mutex_lock_interruptible(&common->lock))
-               return -ERESTARTSYS;
-
        if (common->started) {
                vpif_err("Streaming in progress\n");
-               ret = -EBUSY;
-               goto s_output_exit;
+               return -EBUSY;
        }
 
        ret = v4l2_device_call_until_err(&vpif_obj.v4l2_dev, 1, video,
@@ -1280,9 +1248,6 @@ static int vpif_s_output(struct file *file, void *priv, unsigned int i)
                vpif_err("Failed to set output standard\n");
 
        vid_ch->output_id = i;
-
-s_output_exit:
-       mutex_unlock(&common->lock);
        return ret;
 }
 
@@ -1315,6 +1280,287 @@ static int vpif_s_priority(struct file *file, void *priv, enum v4l2_priority p)
        return v4l2_prio_change(&ch->prio, &fh->prio, p);
 }
 
+/**
+ * vpif_enum_dv_presets() - ENUM_DV_PRESETS handler
+ * @file: file ptr
+ * @priv: file handle
+ * @preset: input preset
+ */
+static int vpif_enum_dv_presets(struct file *file, void *priv,
+               struct v4l2_dv_enum_preset *preset)
+{
+       struct vpif_fh *fh = priv;
+       struct channel_obj *ch = fh->channel;
+       struct video_obj *vid_ch = &ch->video;
+
+       return v4l2_subdev_call(vpif_obj.sd[vid_ch->output_id],
+                       video, enum_dv_presets, preset);
+}
+
+/**
+ * vpif_s_dv_presets() - S_DV_PRESETS handler
+ * @file: file ptr
+ * @priv: file handle
+ * @preset: input preset
+ */
+static int vpif_s_dv_preset(struct file *file, void *priv,
+               struct v4l2_dv_preset *preset)
+{
+       struct vpif_fh *fh = priv;
+       struct channel_obj *ch = fh->channel;
+       struct common_obj *common = &ch->common[VPIF_VIDEO_INDEX];
+       struct video_obj *vid_ch = &ch->video;
+       int ret = 0;
+
+       if (common->started) {
+               vpif_dbg(1, debug, "streaming in progress\n");
+               return -EBUSY;
+       }
+
+       ret = v4l2_prio_check(&ch->prio, fh->prio);
+       if (ret != 0)
+               return ret;
+
+       fh->initialized = 1;
+
+       /* Call encoder subdevice function to set the standard */
+       if (mutex_lock_interruptible(&common->lock))
+               return -ERESTARTSYS;
+
+       ch->video.dv_preset = preset->preset;
+       ch->video.stdid = V4L2_STD_UNKNOWN;
+       memset(&ch->video.bt_timings, 0, sizeof(ch->video.bt_timings));
+
+       /* Get the information about the standard */
+       if (vpif_update_resolution(ch)) {
+               ret = -EINVAL;
+       } else {
+               /* Configure the default format information */
+               vpif_config_format(ch);
+
+               ret = v4l2_subdev_call(vpif_obj.sd[vid_ch->output_id],
+                               video, s_dv_preset, preset);
+       }
+
+       mutex_unlock(&common->lock);
+
+       return ret;
+}
+/**
+ * vpif_g_dv_presets() - G_DV_PRESETS handler
+ * @file: file ptr
+ * @priv: file handle
+ * @preset: input preset
+ */
+static int vpif_g_dv_preset(struct file *file, void *priv,
+               struct v4l2_dv_preset *preset)
+{
+       struct vpif_fh *fh = priv;
+       struct channel_obj *ch = fh->channel;
+
+       preset->preset = ch->video.dv_preset;
+
+       return 0;
+}
+/**
+ * vpif_s_dv_timings() - S_DV_TIMINGS handler
+ * @file: file ptr
+ * @priv: file handle
+ * @timings: digital video timings
+ */
+static int vpif_s_dv_timings(struct file *file, void *priv,
+               struct v4l2_dv_timings *timings)
+{
+       struct vpif_fh *fh = priv;
+       struct channel_obj *ch = fh->channel;
+       struct vpif_params *vpifparams = &ch->vpifparams;
+       struct vpif_channel_config_params *std_info = &vpifparams->std_info;
+       struct video_obj *vid_ch = &ch->video;
+       struct v4l2_bt_timings *bt = &vid_ch->bt_timings;
+       int ret;
+
+       if (timings->type != V4L2_DV_BT_656_1120) {
+               vpif_dbg(2, debug, "Timing type not defined\n");
+               return -EINVAL;
+       }
+
+       /* Configure subdevice timings, if any */
+       ret = v4l2_subdev_call(vpif_obj.sd[vid_ch->output_id],
+                       video, s_dv_timings, timings);
+       if (ret == -ENOIOCTLCMD) {
+               vpif_dbg(2, debug, "Custom DV timings not supported by "
+                               "subdevice\n");
+               return -EINVAL;
+       }
+       if (ret < 0) {
+               vpif_dbg(2, debug, "Error setting custom DV timings\n");
+               return ret;
+       }
+
+       if (!(timings->bt.width && timings->bt.height &&
+                               (timings->bt.hbackporch ||
+                                timings->bt.hfrontporch ||
+                                timings->bt.hsync) &&
+                               timings->bt.vfrontporch &&
+                               (timings->bt.vbackporch ||
+                                timings->bt.vsync))) {
+               vpif_dbg(2, debug, "Timings for width, height, "
+                               "horizontal back porch, horizontal sync, "
+                               "horizontal front porch, vertical back porch, "
+                               "vertical sync and vertical back porch "
+                               "must be defined\n");
+               return -EINVAL;
+       }
+
+       *bt = timings->bt;
+
+       /* Configure video port timings */
+
+       std_info->eav2sav = bt->hbackporch + bt->hfrontporch +
+               bt->hsync - 8;
+       std_info->sav2eav = bt->width;
+
+       std_info->l1 = 1;
+       std_info->l3 = bt->vsync + bt->vbackporch + 1;
+
+       if (bt->interlaced) {
+               if (bt->il_vbackporch || bt->il_vfrontporch || bt->il_vsync) {
+                       std_info->vsize = bt->height * 2 +
+                               bt->vfrontporch + bt->vsync + bt->vbackporch +
+                               bt->il_vfrontporch + bt->il_vsync +
+                               bt->il_vbackporch;
+                       std_info->l5 = std_info->vsize/2 -
+                               (bt->vfrontporch - 1);
+                       std_info->l7 = std_info->vsize/2 + 1;
+                       std_info->l9 = std_info->l7 + bt->il_vsync +
+                               bt->il_vbackporch + 1;
+                       std_info->l11 = std_info->vsize -
+                               (bt->il_vfrontporch - 1);
+               } else {
+                       vpif_dbg(2, debug, "Required timing values for "
+                                       "interlaced BT format missing\n");
+                       return -EINVAL;
+               }
+       } else {
+               std_info->vsize = bt->height + bt->vfrontporch +
+                       bt->vsync + bt->vbackporch;
+               std_info->l5 = std_info->vsize - (bt->vfrontporch - 1);
+       }
+       strncpy(std_info->name, "Custom timings BT656/1120",
+                       VPIF_MAX_NAME);
+       std_info->width = bt->width;
+       std_info->height = bt->height;
+       std_info->frm_fmt = bt->interlaced ? 0 : 1;
+       std_info->ycmux_mode = 0;
+       std_info->capture_format = 0;
+       std_info->vbi_supported = 0;
+       std_info->hd_sd = 1;
+       std_info->stdid = 0;
+       std_info->dv_preset = V4L2_DV_INVALID;
+
+       vid_ch->stdid = 0;
+       vid_ch->dv_preset = V4L2_DV_INVALID;
+
+       return 0;
+}
+
+/**
+ * vpif_g_dv_timings() - G_DV_TIMINGS handler
+ * @file: file ptr
+ * @priv: file handle
+ * @timings: digital video timings
+ */
+static int vpif_g_dv_timings(struct file *file, void *priv,
+               struct v4l2_dv_timings *timings)
+{
+       struct vpif_fh *fh = priv;
+       struct channel_obj *ch = fh->channel;
+       struct video_obj *vid_ch = &ch->video;
+       struct v4l2_bt_timings *bt = &vid_ch->bt_timings;
+
+       timings->bt = *bt;
+
+       return 0;
+}
+
+/*
+ * vpif_g_chip_ident() - Identify the chip
+ * @file: file ptr
+ * @priv: file handle
+ * @chip: chip identity
+ *
+ * Returns zero or -EINVAL if read operations fails.
+ */
+static int vpif_g_chip_ident(struct file *file, void *priv,
+               struct v4l2_dbg_chip_ident *chip)
+{
+       chip->ident = V4L2_IDENT_NONE;
+       chip->revision = 0;
+       if (chip->match.type != V4L2_CHIP_MATCH_I2C_DRIVER &&
+                       chip->match.type != V4L2_CHIP_MATCH_I2C_ADDR) {
+               vpif_dbg(2, debug, "match_type is invalid.\n");
+               return -EINVAL;
+       }
+
+       return v4l2_device_call_until_err(&vpif_obj.v4l2_dev, 0, core,
+                       g_chip_ident, chip);
+}
+
+#ifdef CONFIG_VIDEO_ADV_DEBUG
+/*
+ * vpif_dbg_g_register() - Read register
+ * @file: file ptr
+ * @priv: file handle
+ * @reg: register to be read
+ *
+ * Debugging only
+ * Returns zero or -EINVAL if read operations fails.
+ */
+static int vpif_dbg_g_register(struct file *file, void *priv,
+               struct v4l2_dbg_register *reg){
+       struct vpif_fh *fh = priv;
+       struct channel_obj *ch = fh->channel;
+       struct video_obj *vid_ch = &ch->video;
+
+       return v4l2_subdev_call(vpif_obj.sd[vid_ch->output_id], core,
+                       g_register, reg);
+}
+
+/*
+ * vpif_dbg_s_register() - Write to register
+ * @file: file ptr
+ * @priv: file handle
+ * @reg: register to be modified
+ *
+ * Debugging only
+ * Returns zero or -EINVAL if write operations fails.
+ */
+static int vpif_dbg_s_register(struct file *file, void *priv,
+               struct v4l2_dbg_register *reg){
+       struct vpif_fh *fh = priv;
+       struct channel_obj *ch = fh->channel;
+       struct video_obj *vid_ch = &ch->video;
+
+       return v4l2_subdev_call(vpif_obj.sd[vid_ch->output_id], core,
+                       s_register, reg);
+}
+#endif
+
+/*
+ * vpif_log_status() - Status information
+ * @file: file ptr
+ * @priv: file handle
+ *
+ * Returns zero.
+ */
+static int vpif_log_status(struct file *filep, void *priv)
+{
+       /* status for sub devices */
+       v4l2_device_call_all(&vpif_obj.v4l2_dev, 0, core, log_status);
+
+       return 0;
+}
+
 /* vpif display ioctl operations */
 static const struct v4l2_ioctl_ops vpif_ioctl_ops = {
        .vidioc_querycap                = vpif_querycap,
@@ -1336,13 +1582,24 @@ static const struct v4l2_ioctl_ops vpif_ioctl_ops = {
        .vidioc_s_output                = vpif_s_output,
        .vidioc_g_output                = vpif_g_output,
        .vidioc_cropcap                 = vpif_cropcap,
+       .vidioc_enum_dv_presets         = vpif_enum_dv_presets,
+       .vidioc_s_dv_preset             = vpif_s_dv_preset,
+       .vidioc_g_dv_preset             = vpif_g_dv_preset,
+       .vidioc_s_dv_timings            = vpif_s_dv_timings,
+       .vidioc_g_dv_timings            = vpif_g_dv_timings,
+       .vidioc_g_chip_ident            = vpif_g_chip_ident,
+#ifdef CONFIG_VIDEO_ADV_DEBUG
+       .vidioc_g_register              = vpif_dbg_g_register,
+       .vidioc_s_register              = vpif_dbg_s_register,
+#endif
+       .vidioc_log_status              = vpif_log_status,
 };
 
 static const struct v4l2_file_operations vpif_fops = {
        .owner          = THIS_MODULE,
        .open           = vpif_open,
        .release        = vpif_release,
-       .ioctl          = video_ioctl2,
+       .unlocked_ioctl = video_ioctl2,
        .mmap           = vpif_mmap,
        .poll           = vpif_poll
 };
@@ -1526,6 +1783,7 @@ static __init int vpif_probe(struct platform_device *pdev)
                v4l2_prio_init(&ch->prio);
                ch->common[VPIF_VIDEO_INDEX].fmt.type =
                                                V4L2_BUF_TYPE_VIDEO_OUTPUT;
+               ch->video_dev->lock = &common->lock;
 
                /* register video device */
                vpif_dbg(1, debug, "channel=%x,channel->video_dev=%x\n",
@@ -1565,6 +1823,8 @@ static __init int vpif_probe(struct platform_device *pdev)
                        vpif_obj.sd[i]->grp_id = 1 << i;
        }
 
+       v4l2_info(&vpif_obj.v4l2_dev,
+                       "DM646x VPIF display driver initialized\n");
        return 0;
 
 probe_subdev_out:
index a2a7cd166bbf6e2afa12120ac55f25725f7ba388..b53aaa8830753bc18937d672d1fe2c5c046348a2 100644 (file)
@@ -67,6 +67,8 @@ struct video_obj {
                                         * most recent displayed frame only */
        v4l2_std_id stdid;              /* Currently selected or default
                                         * standard */
+       u32 dv_preset;
+       struct v4l2_bt_timings bt_timings;
        u32 output_id;                  /* Current output id */
 };
 
index 099d5df8c572dfc77e2ee1a85403a3b1a7b52bde..87f77a34eeabd092a678208dcac815caf0c230cc 100644 (file)
@@ -33,6 +33,7 @@
 #include <media/saa7115.h>
 #include <media/tvp5150.h>
 #include <media/tvaudio.h>
+#include <media/mt9v011.h>
 #include <media/i2c-addr.h>
 #include <media/tveeprom.h>
 #include <media/v4l2-common.h>
@@ -1917,11 +1918,6 @@ static unsigned short tvp5150_addrs[] = {
        I2C_CLIENT_END
 };
 
-static unsigned short mt9v011_addrs[] = {
-       0xba >> 1,
-       I2C_CLIENT_END
-};
-
 static unsigned short msp3400_addrs[] = {
        0x80 >> 1,
        0x88 >> 1,
@@ -2437,6 +2433,7 @@ void em28xx_register_i2c_ir(struct em28xx *dev)
                dev->init_data.ir_codes = RC_MAP_RC5_HAUPPAUGE_NEW;
                dev->init_data.get_key = em28xx_get_key_em_haup;
                dev->init_data.name = "i2c IR (EM2840 Hauppauge)";
+               break;
        case EM2820_BOARD_LEADTEK_WINFAST_USBII_DELUXE:
                dev->init_data.ir_codes = RC_MAP_WINFAST_USBII_DELUXE;
                dev->init_data.get_key = em28xx_get_key_winfast_usbii_deluxe;
@@ -2623,11 +2620,17 @@ void em28xx_card_setup(struct em28xx *dev)
                        "tvp5150", 0, tvp5150_addrs);
 
        if (dev->em28xx_sensor == EM28XX_MT9V011) {
+               struct mt9v011_platform_data pdata;
+               struct i2c_board_info mt9v011_info = {
+                       .type = "mt9v011",
+                       .addr = 0xba >> 1,
+                       .platform_data = &pdata,
+               };
                struct v4l2_subdev *sd;
 
-               sd = v4l2_i2c_new_subdev(&dev->v4l2_dev,
-                        &dev->i2c_adap, "mt9v011", 0, mt9v011_addrs);
-               v4l2_subdev_call(sd, core, s_config, 0, &dev->sensor_xtal);
+               pdata.xtal = dev->sensor_xtal;
+               sd = v4l2_i2c_new_subdev_board(&dev->v4l2_dev, &dev->i2c_adap,
+                               &mt9v011_info, NULL);
        }
 
 
index cc77d144df3cc4bc68f77c9fc7a07a150db7b2ac..bf66189cb26de1fba4f58884e458b89adb08d2b7 100644 (file)
 /*****************************************************************************/
 
 static const struct usb_device_id et61x251_id_table[] = {
-       { USB_DEVICE(0x102c, 0x6151), },
        { USB_DEVICE(0x102c, 0x6251), },
-       { USB_DEVICE(0x102c, 0x6253), },
-       { USB_DEVICE(0x102c, 0x6254), },
-       { USB_DEVICE(0x102c, 0x6255), },
-       { USB_DEVICE(0x102c, 0x6256), },
-       { USB_DEVICE(0x102c, 0x6257), },
-       { USB_DEVICE(0x102c, 0x6258), },
-       { USB_DEVICE(0x102c, 0x6259), },
-       { USB_DEVICE(0x102c, 0x625a), },
-       { USB_DEVICE(0x102c, 0x625b), },
-       { USB_DEVICE(0x102c, 0x625c), },
-       { USB_DEVICE(0x102c, 0x625d), },
-       { USB_DEVICE(0x102c, 0x625e), },
-       { USB_DEVICE(0x102c, 0x625f), },
-       { USB_DEVICE(0x102c, 0x6260), },
-       { USB_DEVICE(0x102c, 0x6261), },
-       { USB_DEVICE(0x102c, 0x6262), },
-       { USB_DEVICE(0x102c, 0x6263), },
-       { USB_DEVICE(0x102c, 0x6264), },
-       { USB_DEVICE(0x102c, 0x6265), },
-       { USB_DEVICE(0x102c, 0x6266), },
-       { USB_DEVICE(0x102c, 0x6267), },
-       { USB_DEVICE(0x102c, 0x6268), },
-       { USB_DEVICE(0x102c, 0x6269), },
        { }
 };
 
index 62904393350104217490d8edbd002f6933fc0160..a09c4709d6139b9616e79804b39f0d1aa982ac1e 100644 (file)
@@ -276,7 +276,7 @@ static const struct sd_desc sd_desc = {
 };
 
 /* -- module initialisation -- */
-static const __devinitdata struct usb_device_id device_table[] = {
+static const struct usb_device_id device_table[] = {
        {USB_DEVICE(0x04a5, 0x3035)},
        {}
 };
index 1eacb6c7926daa3737f1283d0bebd94bee8a83a8..8b398493f96bc65e63dd018bfd684109e16c9b6e 100644 (file)
@@ -1040,14 +1040,14 @@ static const struct sd_desc sd_desc = {
 };
 
 /* -- module initialisation -- */
-static const struct usb_device_id device_table[] __devinitconst = {
+static const struct usb_device_id device_table[] = {
        {USB_DEVICE(0x0572, 0x0041)},
        {}
 };
 MODULE_DEVICE_TABLE(usb, device_table);
 
 /* -- device connect -- */
-static int __devinit sd_probe(struct usb_interface *intf,
+static int sd_probe(struct usb_interface *intf,
                        const struct usb_device_id *id)
 {
        return gspca_dev_probe(intf, id, &sd_desc, sizeof(struct sd),
index c1ae05f4661f240d2fc65b504f3881d41eeeac63..4bf2cab98d64cd2a4c38a8f77de2ffb57f1decf5 100644 (file)
@@ -2088,7 +2088,7 @@ static const struct sd_desc sd_desc = {
 };
 
 /* -- module initialisation -- */
-static const __devinitdata struct usb_device_id device_table[] = {
+static const struct usb_device_id device_table[] = {
        {USB_DEVICE(0x0553, 0x0002)},
        {USB_DEVICE(0x0813, 0x0001)},
        {}
index a594b36d6199cb5cc45e4f0b229a67be5daeb78d..4b2c483fce6f9d48fce457ad764d3f4e0fdc5466 100644 (file)
@@ -864,7 +864,7 @@ static const struct sd_desc sd_desc = {
 };
 
 /* -- module initialisation -- */
-static const struct usb_device_id device_table[] __devinitconst = {
+static const struct usb_device_id device_table[] = {
        {USB_DEVICE(0x102c, 0x6151), .driver_info = SENSOR_PAS106},
 #if !defined CONFIG_USB_ET61X251 && !defined CONFIG_USB_ET61X251_MODULE
        {USB_DEVICE(0x102c, 0x6251), .driver_info = SENSOR_TAS5130CXX},
@@ -875,7 +875,7 @@ static const struct usb_device_id device_table[] __devinitconst = {
 MODULE_DEVICE_TABLE(usb, device_table);
 
 /* -- device connect -- */
-static int __devinit sd_probe(struct usb_interface *intf,
+static int sd_probe(struct usb_interface *intf,
                    const struct usb_device_id *id)
 {
        return gspca_dev_probe(intf, id, &sd_desc, sizeof(struct sd),
index d78226455d1f40f0e6a586c95bb64d3fe4be181f..987b4b69d7ab2a71a06d7dc0c39b235646ef47a2 100644 (file)
@@ -229,7 +229,7 @@ static void sd_stop0(struct gspca_dev *gspca_dev)
 }
 
 /* Table of supported USB devices */
-static const __devinitdata struct usb_device_id device_table[] = {
+static const struct usb_device_id device_table[] = {
        {USB_DEVICE(0x04cb, 0x0104)},
        {USB_DEVICE(0x04cb, 0x0109)},
        {USB_DEVICE(0x04cb, 0x010b)},
index b05bec7321b5d94df6a93efff96db96f053405da..99083038cec3b7ec55b8ba861c5c8a1c1ed175bd 100644 (file)
@@ -488,7 +488,7 @@ static void sd_callback(struct gspca_dev *gspca_dev)
 
 /*=================== USB driver structure initialisation ==================*/
 
-static const __devinitdata struct usb_device_id device_table[] = {
+static const struct usb_device_id device_table[] = {
        {USB_DEVICE(0x05e3, 0x0503)},
        {USB_DEVICE(0x05e3, 0xf191)},
        {}
index 442970073e8a553482492706d687243ec638876e..f21f2a258ae0ee5722ebebcd1e9925202bead369 100644 (file)
@@ -55,7 +55,7 @@ MODULE_AUTHOR("Jean-François Moine <http://moinejf.free.fr>");
 MODULE_DESCRIPTION("GSPCA USB Camera Driver");
 MODULE_LICENSE("GPL");
 
-#define DRIVER_VERSION_NUMBER  KERNEL_VERSION(2, 11, 0)
+#define DRIVER_VERSION_NUMBER  KERNEL_VERSION(2, 12, 0)
 
 #ifdef GSPCA_DEBUG
 int gspca_debug = D_ERR | D_PROBE;
@@ -508,8 +508,8 @@ static int gspca_is_compressed(__u32 format)
        return 0;
 }
 
-static int frame_alloc(struct gspca_dev *gspca_dev,
-                       unsigned int count)
+static int frame_alloc(struct gspca_dev *gspca_dev, struct file *file,
+                       enum v4l2_memory memory, unsigned int count)
 {
        struct gspca_frame *frame;
        unsigned int frsz;
@@ -519,7 +519,6 @@ static int frame_alloc(struct gspca_dev *gspca_dev,
        frsz = gspca_dev->cam.cam_mode[i].sizeimage;
        PDEBUG(D_STREAM, "frame alloc frsz: %d", frsz);
        frsz = PAGE_ALIGN(frsz);
-       gspca_dev->frsz = frsz;
        if (count >= GSPCA_MAX_FRAMES)
                count = GSPCA_MAX_FRAMES - 1;
        gspca_dev->frbuf = vmalloc_32(frsz * count);
@@ -527,6 +526,9 @@ static int frame_alloc(struct gspca_dev *gspca_dev,
                err("frame alloc failed");
                return -ENOMEM;
        }
+       gspca_dev->capt_file = file;
+       gspca_dev->memory = memory;
+       gspca_dev->frsz = frsz;
        gspca_dev->nframes = count;
        for (i = 0; i < count; i++) {
                frame = &gspca_dev->frame[i];
@@ -535,7 +537,7 @@ static int frame_alloc(struct gspca_dev *gspca_dev,
                frame->v4l2_buf.flags = 0;
                frame->v4l2_buf.field = V4L2_FIELD_NONE;
                frame->v4l2_buf.length = frsz;
-               frame->v4l2_buf.memory = gspca_dev->memory;
+               frame->v4l2_buf.memory = memory;
                frame->v4l2_buf.sequence = 0;
                frame->data = gspca_dev->frbuf + i * frsz;
                frame->v4l2_buf.m.offset = i * frsz;
@@ -558,6 +560,9 @@ static void frame_free(struct gspca_dev *gspca_dev)
                        gspca_dev->frame[i].data = NULL;
        }
        gspca_dev->nframes = 0;
+       gspca_dev->frsz = 0;
+       gspca_dev->capt_file = NULL;
+       gspca_dev->memory = GSPCA_MEMORY_NO;
 }
 
 static void destroy_urbs(struct gspca_dev *gspca_dev)
@@ -1210,29 +1215,15 @@ static void gspca_release(struct video_device *vfd)
 static int dev_open(struct file *file)
 {
        struct gspca_dev *gspca_dev;
-       int ret;
 
        PDEBUG(D_STREAM, "[%s] open", current->comm);
        gspca_dev = (struct gspca_dev *) video_devdata(file);
-       if (mutex_lock_interruptible(&gspca_dev->queue_lock))
-               return -ERESTARTSYS;
-       if (!gspca_dev->present) {
-               ret = -ENODEV;
-               goto out;
-       }
-
-       if (gspca_dev->users > 4) {     /* (arbitrary value) */
-               ret = -EBUSY;
-               goto out;
-       }
+       if (!gspca_dev->present)
+               return -ENODEV;
 
        /* protect the subdriver against rmmod */
-       if (!try_module_get(gspca_dev->module)) {
-               ret = -ENODEV;
-               goto out;
-       }
-
-       gspca_dev->users++;
+       if (!try_module_get(gspca_dev->module))
+               return -ENODEV;
 
        file->private_data = gspca_dev;
 #ifdef GSPCA_DEBUG
@@ -1244,14 +1235,7 @@ static int dev_open(struct file *file)
                gspca_dev->vdev.debug &= ~(V4L2_DEBUG_IOCTL
                                        | V4L2_DEBUG_IOCTL_ARG);
 #endif
-       ret = 0;
-out:
-       mutex_unlock(&gspca_dev->queue_lock);
-       if (ret != 0)
-               PDEBUG(D_ERR|D_STREAM, "open failed err %d", ret);
-       else
-               PDEBUG(D_STREAM, "open done");
-       return ret;
+       return 0;
 }
 
 static int dev_close(struct file *file)
@@ -1261,7 +1245,6 @@ static int dev_close(struct file *file)
        PDEBUG(D_STREAM, "[%s] close", current->comm);
        if (mutex_lock_interruptible(&gspca_dev->queue_lock))
                return -ERESTARTSYS;
-       gspca_dev->users--;
 
        /* if the file did the capture, free the streaming resources */
        if (gspca_dev->capt_file == file) {
@@ -1272,8 +1255,6 @@ static int dev_close(struct file *file)
                        mutex_unlock(&gspca_dev->usb_lock);
                }
                frame_free(gspca_dev);
-               gspca_dev->capt_file = NULL;
-               gspca_dev->memory = GSPCA_MEMORY_NO;
        }
        file->private_data = NULL;
        module_put(gspca_dev->module);
@@ -1516,6 +1497,7 @@ static int vidioc_reqbufs(struct file *file, void *priv,
                return -ERESTARTSYS;
 
        if (gspca_dev->memory != GSPCA_MEMORY_NO
+           && gspca_dev->memory != GSPCA_MEMORY_READ
            && gspca_dev->memory != rb->memory) {
                ret = -EBUSY;
                goto out;
@@ -1544,19 +1526,18 @@ static int vidioc_reqbufs(struct file *file, void *priv,
                gspca_stream_off(gspca_dev);
                mutex_unlock(&gspca_dev->usb_lock);
        }
+       /* Don't restart the stream when switching from read to mmap mode */
+       if (gspca_dev->memory == GSPCA_MEMORY_READ)
+               streaming = 0;
 
        /* free the previous allocated buffers, if any */
-       if (gspca_dev->nframes != 0) {
+       if (gspca_dev->nframes != 0)
                frame_free(gspca_dev);
-               gspca_dev->capt_file = NULL;
-       }
        if (rb->count == 0)                     /* unrequest */
                goto out;
-       gspca_dev->memory = rb->memory;
-       ret = frame_alloc(gspca_dev, rb->count);
+       ret = frame_alloc(gspca_dev, file, rb->memory, rb->count);
        if (ret == 0) {
                rb->count = gspca_dev->nframes;
-               gspca_dev->capt_file = file;
                if (streaming)
                        ret = gspca_init_transfer(gspca_dev);
        }
@@ -1630,11 +1611,15 @@ static int vidioc_streamoff(struct file *file, void *priv,
 
        if (buf_type != V4L2_BUF_TYPE_VIDEO_CAPTURE)
                return -EINVAL;
-       if (!gspca_dev->streaming)
-               return 0;
+
        if (mutex_lock_interruptible(&gspca_dev->queue_lock))
                return -ERESTARTSYS;
 
+       if (!gspca_dev->streaming) {
+               ret = 0;
+               goto out;
+       }
+
        /* check the capture file */
        if (gspca_dev->capt_file != file) {
                ret = -EBUSY;
@@ -1649,6 +1634,8 @@ static int vidioc_streamoff(struct file *file, void *priv,
        gspca_dev->usb_err = 0;
        gspca_stream_off(gspca_dev);
        mutex_unlock(&gspca_dev->usb_lock);
+       /* In case another thread is waiting in dqbuf */
+       wake_up_interruptible(&gspca_dev->wq);
 
        /* empty the transfer queues */
        atomic_set(&gspca_dev->fr_q, 0);
@@ -1827,33 +1814,77 @@ out:
        return ret;
 }
 
+static int frame_ready_nolock(struct gspca_dev *gspca_dev, struct file *file,
+                               enum v4l2_memory memory)
+{
+       if (!gspca_dev->present)
+               return -ENODEV;
+       if (gspca_dev->capt_file != file || gspca_dev->memory != memory ||
+                       !gspca_dev->streaming)
+               return -EINVAL;
+
+       /* check if a frame is ready */
+       return gspca_dev->fr_o != atomic_read(&gspca_dev->fr_i);
+}
+
+static int frame_ready(struct gspca_dev *gspca_dev, struct file *file,
+                       enum v4l2_memory memory)
+{
+       int ret;
+
+       if (mutex_lock_interruptible(&gspca_dev->queue_lock))
+               return -ERESTARTSYS;
+       ret = frame_ready_nolock(gspca_dev, file, memory);
+       mutex_unlock(&gspca_dev->queue_lock);
+       return ret;
+}
+
 /*
- * wait for a video frame
+ * dequeue a video buffer
  *
- * If a frame is ready, its index is returned.
+ * If nonblock_ing is false, block until a buffer is available.
  */
-static int frame_wait(struct gspca_dev *gspca_dev,
-                       int nonblock_ing)
+static int vidioc_dqbuf(struct file *file, void *priv,
+                       struct v4l2_buffer *v4l2_buf)
 {
-       int i, ret;
+       struct gspca_dev *gspca_dev = priv;
+       struct gspca_frame *frame;
+       int i, j, ret;
 
-       /* check if a frame is ready */
-       i = gspca_dev->fr_o;
-       if (i == atomic_read(&gspca_dev->fr_i)) {
-               if (nonblock_ing)
+       PDEBUG(D_FRAM, "dqbuf");
+
+       if (mutex_lock_interruptible(&gspca_dev->queue_lock))
+               return -ERESTARTSYS;
+
+       for (;;) {
+               ret = frame_ready_nolock(gspca_dev, file, v4l2_buf->memory);
+               if (ret < 0)
+                       goto out;
+               if (ret > 0)
+                       break;
+
+               mutex_unlock(&gspca_dev->queue_lock);
+
+               if (file->f_flags & O_NONBLOCK)
                        return -EAGAIN;
 
                /* wait till a frame is ready */
                ret = wait_event_interruptible_timeout(gspca_dev->wq,
-                       i != atomic_read(&gspca_dev->fr_i) ||
-                       !gspca_dev->streaming || !gspca_dev->present,
+                       frame_ready(gspca_dev, file, v4l2_buf->memory),
                        msecs_to_jiffies(3000));
                if (ret < 0)
                        return ret;
-               if (ret == 0 || !gspca_dev->streaming || !gspca_dev->present)
+               if (ret == 0)
                        return -EIO;
+
+               if (mutex_lock_interruptible(&gspca_dev->queue_lock))
+                       return -ERESTARTSYS;
        }
 
+       i = gspca_dev->fr_o;
+       j = gspca_dev->fr_queue[i];
+       frame = &gspca_dev->frame[j];
+
        gspca_dev->fr_o = (i + 1) % GSPCA_MAX_FRAMES;
 
        if (gspca_dev->sd_desc->dq_callback) {
@@ -1863,46 +1894,12 @@ static int frame_wait(struct gspca_dev *gspca_dev,
                        gspca_dev->sd_desc->dq_callback(gspca_dev);
                mutex_unlock(&gspca_dev->usb_lock);
        }
-       return gspca_dev->fr_queue[i];
-}
-
-/*
- * dequeue a video buffer
- *
- * If nonblock_ing is false, block until a buffer is available.
- */
-static int vidioc_dqbuf(struct file *file, void *priv,
-                       struct v4l2_buffer *v4l2_buf)
-{
-       struct gspca_dev *gspca_dev = priv;
-       struct gspca_frame *frame;
-       int i, ret;
-
-       PDEBUG(D_FRAM, "dqbuf");
-       if (v4l2_buf->memory != gspca_dev->memory)
-               return -EINVAL;
-
-       if (!gspca_dev->present)
-               return -ENODEV;
-
-       /* if not streaming, be sure the application will not loop forever */
-       if (!(file->f_flags & O_NONBLOCK)
-           && !gspca_dev->streaming && gspca_dev->users == 1)
-               return -EINVAL;
 
-       /* only the capturing file may dequeue */
-       if (gspca_dev->capt_file != file)
-               return -EINVAL;
-
-       /* only one dequeue / read at a time */
-       if (mutex_lock_interruptible(&gspca_dev->read_lock))
-               return -ERESTARTSYS;
+       frame->v4l2_buf.flags &= ~V4L2_BUF_FLAG_DONE;
+       memcpy(v4l2_buf, &frame->v4l2_buf, sizeof *v4l2_buf);
+       PDEBUG(D_FRAM, "dqbuf %d", j);
+       ret = 0;
 
-       ret = frame_wait(gspca_dev, file->f_flags & O_NONBLOCK);
-       if (ret < 0)
-               goto out;
-       i = ret;                                /* frame index */
-       frame = &gspca_dev->frame[i];
        if (gspca_dev->memory == V4L2_MEMORY_USERPTR) {
                if (copy_to_user((__u8 __user *) frame->v4l2_buf.m.userptr,
                                 frame->data,
@@ -1910,15 +1907,10 @@ static int vidioc_dqbuf(struct file *file, void *priv,
                        PDEBUG(D_ERR|D_STREAM,
                                "dqbuf cp to user failed");
                        ret = -EFAULT;
-                       goto out;
                }
        }
-       frame->v4l2_buf.flags &= ~V4L2_BUF_FLAG_DONE;
-       memcpy(v4l2_buf, &frame->v4l2_buf, sizeof *v4l2_buf);
-       PDEBUG(D_FRAM, "dqbuf %d", i);
-       ret = 0;
 out:
-       mutex_unlock(&gspca_dev->read_lock);
+       mutex_unlock(&gspca_dev->queue_lock);
        return ret;
 }
 
@@ -2033,9 +2025,7 @@ static unsigned int dev_poll(struct file *file, poll_table *wait)
        poll_wait(file, &gspca_dev->wq, wait);
 
        /* if reqbufs is not done, the user would use read() */
-       if (gspca_dev->nframes == 0) {
-               if (gspca_dev->memory != GSPCA_MEMORY_NO)
-                       return POLLERR;         /* not the 1st time */
+       if (gspca_dev->memory == GSPCA_MEMORY_NO) {
                ret = read_alloc(gspca_dev, file);
                if (ret != 0)
                        return POLLERR;
@@ -2067,18 +2057,10 @@ static ssize_t dev_read(struct file *file, char __user *data,
        PDEBUG(D_FRAM, "read (%zd)", count);
        if (!gspca_dev->present)
                return -ENODEV;
-       switch (gspca_dev->memory) {
-       case GSPCA_MEMORY_NO:                   /* first time */
+       if (gspca_dev->memory == GSPCA_MEMORY_NO) { /* first time ? */
                ret = read_alloc(gspca_dev, file);
                if (ret != 0)
                        return ret;
-               break;
-       case GSPCA_MEMORY_READ:
-               if (gspca_dev->capt_file == file)
-                       break;
-               /* fall thru */
-       default:
-               return -EINVAL;
        }
 
        /* get a frame */
@@ -2266,7 +2248,6 @@ int gspca_dev_probe2(struct usb_interface *intf,
                goto out;
 
        mutex_init(&gspca_dev->usb_lock);
-       mutex_init(&gspca_dev->read_lock);
        mutex_init(&gspca_dev->queue_lock);
        init_waitqueue_head(&gspca_dev->wq);
 
@@ -2341,12 +2322,11 @@ void gspca_disconnect(struct usb_interface *intf)
        PDEBUG(D_PROBE, "%s disconnect",
                video_device_node_name(&gspca_dev->vdev));
        mutex_lock(&gspca_dev->usb_lock);
+
        gspca_dev->present = 0;
+       wake_up_interruptible(&gspca_dev->wq);
 
-       if (gspca_dev->streaming) {
-               destroy_urbs(gspca_dev);
-               wake_up_interruptible(&gspca_dev->wq);
-       }
+       destroy_urbs(gspca_dev);
 
 #if defined(CONFIG_INPUT) || defined(CONFIG_INPUT_MODULE)
        gspca_input_destroy_urb(gspca_dev);
index 97b77a26a2ebf46736ffe57c116e49bf55b8e3aa..41755226d389f61cd29d0e58a98f5e3f11825182 100644 (file)
@@ -205,14 +205,12 @@ struct gspca_dev {
 
        wait_queue_head_t wq;           /* wait queue */
        struct mutex usb_lock;          /* usb exchange protection */
-       struct mutex read_lock;         /* read protection */
        struct mutex queue_lock;        /* ISOC queue protection */
        int usb_err;                    /* USB error - protected by usb_lock */
        u16 pkt_size;                   /* ISOC packet size */
 #ifdef CONFIG_PM
        char frozen;                    /* suspend - resume */
 #endif
-       char users;                     /* number of opens */
        char present;                   /* device connected */
        char nbufread;                  /* number of buffers for read() */
        char memory;                    /* memory type (V4L2_MEMORY_xxx) */
index a35e87bb0388bb0264dfad8335008452356e5982..06b777f5379ef7c7f92198cbe53306e6387be183 100644 (file)
@@ -314,7 +314,7 @@ static int sd_start(struct gspca_dev *gspca_dev)
 }
 
 /* Table of supported USB devices */
-static const __devinitdata struct usb_device_id device_table[] = {
+static const struct usb_device_id device_table[] = {
        {USB_DEVICE(0x0979, 0x0280)},
        {}
 };
index de63c36806c09bbb2788faba8c1c6833c81863b8..ab54910418b4ccfa7e07a179f4dbe82ecef00d17 100644 (file)
@@ -141,9 +141,9 @@ static void jpeg_define(u8 *jpeg_hdr,
        memcpy(jpeg_hdr, jpeg_head, sizeof jpeg_head);
 #ifndef CONEX_CAM
        jpeg_hdr[JPEG_HEIGHT_OFFSET + 0] = height >> 8;
-       jpeg_hdr[JPEG_HEIGHT_OFFSET + 1] = height & 0xff;
+       jpeg_hdr[JPEG_HEIGHT_OFFSET + 1] = height;
        jpeg_hdr[JPEG_HEIGHT_OFFSET + 2] = width >> 8;
-       jpeg_hdr[JPEG_HEIGHT_OFFSET + 3] = width & 0xff;
+       jpeg_hdr[JPEG_HEIGHT_OFFSET + 3] = width;
        jpeg_hdr[JPEG_HEIGHT_OFFSET + 6] = samplesY;
 #endif
 }
index d2ce65dcbfdc16e48761f643415fee5f613e0147..5964691c0e95e66f8b6c56905181ba0281822b6f 100644 (file)
@@ -607,7 +607,7 @@ static const struct sd_desc sd_desc = {
 };
 
 /* -- module initialisation -- */
-static const __devinitdata struct usb_device_id device_table[] = {
+static const struct usb_device_id device_table[] = {
        {USB_DEVICE(0x04c8, 0x0720)}, /* Intel YC 76 */
        {}
 };
index c872b93a3351c02f7186402820437fc46a4ac98d..a7722b1aef9b5963d1dba5cd511a6860393e7dbf 100644 (file)
@@ -28,7 +28,7 @@ int force_sensor;
 static int dump_bridge;
 int dump_sensor;
 
-static const __devinitdata struct usb_device_id m5602_table[] = {
+static const struct usb_device_id m5602_table[] = {
        {USB_DEVICE(0x0402, 0x5602)},
        {}
 };
index a81536e78698bbb41eda812e8689735198cdbc73..cb4d0bf0d784787c68a8ee3ff3954e5b06a79f41 100644 (file)
@@ -490,7 +490,7 @@ static const struct sd_desc sd_desc = {
 };
 
 /* -- module initialisation -- */
-static const __devinitdata struct usb_device_id device_table[] = {
+static const struct usb_device_id device_table[] = {
        {USB_DEVICE(0x093a, 0x050f)},
        {}
 };
index 7607a288b51cd326b89db0f2f5826f101ba84c23..3884c9d300c5ed766f34eed7060cb59161494c77 100644 (file)
@@ -1229,7 +1229,7 @@ static const struct sd_desc sd_desc = {
 };
 
 /* -- module initialisation -- */
-static const __devinitdata struct usb_device_id device_table[] = {
+static const struct usb_device_id device_table[] = {
        {USB_DEVICE(0x08ca, 0x0110)},   /* Trust Spyc@m 100 */
        {USB_DEVICE(0x08ca, 0x0111)},   /* Aiptek Pencam VGA+ */
        {USB_DEVICE(0x093a, 0x010f)},   /* All other known MR97310A VGA cams */
index e1c3b9328aceb9c0ae1de6df55ad608e102f47ee..8ab2c452c25effdba21d956e494bbe6b7ea3ff39 100644 (file)
@@ -488,7 +488,6 @@ static const struct v4l2_pix_format ovfx2_ov3610_mode[] = {
 #define R511_SNAP_PXDIV                        0x1c
 #define R511_SNAP_LNDIV                        0x1d
 #define R511_SNAP_UV_EN                        0x1e
-#define R511_SNAP_UV_EN                        0x1e
 #define R511_SNAP_OPTS                 0x1f
 
 #define R511_DRAM_FLOW_CTL             0x20
@@ -1847,8 +1846,7 @@ static const struct ov_i2c_regvals norm_7670[] = {
        { 0x6c, 0x0a },
        { 0x6d, 0x55 },
        { 0x6e, 0x11 },
-       { 0x6f, 0x9f },
-                                       /* "9e for advance AWB" */
+       { 0x6f, 0x9f },                 /* "9e for advance AWB" */
        { 0x6a, 0x40 },
        { OV7670_R01_BLUE, 0x40 },
        { OV7670_R02_RED, 0x60 },
@@ -3054,7 +3052,7 @@ static void ov519_configure(struct sd *sd)
 {
        static const struct ov_regvals init_519[] = {
                { 0x5a, 0x6d }, /* EnableSystem */
-               { 0x53, 0x9b },
+               { 0x53, 0x9b }, /* don't enable the microcontroller */
                { OV519_R54_EN_CLK1, 0xff }, /* set bit2 to enable jpeg */
                { 0x5d, 0x03 },
                { 0x49, 0x01 },
@@ -4747,7 +4745,7 @@ static const struct sd_desc sd_desc = {
 };
 
 /* -- module initialisation -- */
-static const __devinitdata struct usb_device_id device_table[] = {
+static const struct usb_device_id device_table[] = {
        {USB_DEVICE(0x041e, 0x4003), .driver_info = BRIDGE_W9968CF },
        {USB_DEVICE(0x041e, 0x4052), .driver_info = BRIDGE_OV519 },
        {USB_DEVICE(0x041e, 0x405f), .driver_info = BRIDGE_OV519 },
index 0edf93973b1c7eb2eb27e322e9799d95db90121e..04da228027360331195ebb9f38c8d77e74fc9ef5 100644 (file)
@@ -479,15 +479,20 @@ static void ov534_reg_write(struct gspca_dev *gspca_dev, u16 reg, u8 val)
        struct usb_device *udev = gspca_dev->dev;
        int ret;
 
-       PDEBUG(D_USBO, "reg=0x%04x, val=0%02x", reg, val);
+       if (gspca_dev->usb_err < 0)
+               return;
+
+       PDEBUG(D_USBO, "SET 01 0000 %04x %02x", reg, val);
        gspca_dev->usb_buf[0] = val;
        ret = usb_control_msg(udev,
                              usb_sndctrlpipe(udev, 0),
                              0x01,
                              USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_DEVICE,
                              0x00, reg, gspca_dev->usb_buf, 1, CTRL_TIMEOUT);
-       if (ret < 0)
+       if (ret < 0) {
                err("write failed %d", ret);
+               gspca_dev->usb_err = ret;
+       }
 }
 
 static u8 ov534_reg_read(struct gspca_dev *gspca_dev, u16 reg)
@@ -495,14 +500,18 @@ static u8 ov534_reg_read(struct gspca_dev *gspca_dev, u16 reg)
        struct usb_device *udev = gspca_dev->dev;
        int ret;
 
+       if (gspca_dev->usb_err < 0)
+               return 0;
        ret = usb_control_msg(udev,
                              usb_rcvctrlpipe(udev, 0),
                              0x01,
                              USB_DIR_IN | USB_TYPE_VENDOR | USB_RECIP_DEVICE,
                              0x00, reg, gspca_dev->usb_buf, 1, CTRL_TIMEOUT);
-       PDEBUG(D_USBI, "reg=0x%04x, data=0x%02x", reg, gspca_dev->usb_buf[0]);
-       if (ret < 0)
+       PDEBUG(D_USBI, "GET 01 0000 %04x %02x", reg, gspca_dev->usb_buf[0]);
+       if (ret < 0) {
                err("read failed %d", ret);
+               gspca_dev->usb_err = ret;
+       }
        return gspca_dev->usb_buf[0];
 }
 
@@ -558,13 +567,15 @@ static int sccb_check_status(struct gspca_dev *gspca_dev)
 
 static void sccb_reg_write(struct gspca_dev *gspca_dev, u8 reg, u8 val)
 {
-       PDEBUG(D_USBO, "reg: 0x%02x, val: 0x%02x", reg, val);
+       PDEBUG(D_USBO, "sccb write: %02x %02x", reg, val);
        ov534_reg_write(gspca_dev, OV534_REG_SUBADDR, reg);
        ov534_reg_write(gspca_dev, OV534_REG_WRITE, val);
        ov534_reg_write(gspca_dev, OV534_REG_OPERATION, OV534_OP_WRITE_3);
 
-       if (!sccb_check_status(gspca_dev))
+       if (!sccb_check_status(gspca_dev)) {
                err("sccb_reg_write failed");
+               gspca_dev->usb_err = -EIO;
+       }
 }
 
 static u8 sccb_reg_read(struct gspca_dev *gspca_dev, u16 reg)
@@ -885,7 +896,7 @@ static int sd_init(struct gspca_dev *gspca_dev)
        ov534_set_led(gspca_dev, 0);
        set_frame_rate(gspca_dev);
 
-       return 0;
+       return gspca_dev->usb_err;
 }
 
 static int sd_start(struct gspca_dev *gspca_dev)
@@ -920,7 +931,7 @@ static int sd_start(struct gspca_dev *gspca_dev)
 
        ov534_set_led(gspca_dev, 1);
        ov534_reg_write(gspca_dev, 0xe0, 0x00);
-       return 0;
+       return gspca_dev->usb_err;
 }
 
 static void sd_stopN(struct gspca_dev *gspca_dev)
@@ -1289,7 +1300,7 @@ static const struct sd_desc sd_desc = {
 };
 
 /* -- module initialisation -- */
-static const __devinitdata struct usb_device_id device_table[] = {
+static const struct usb_device_id device_table[] = {
        {USB_DEVICE(0x1415, 0x2000)},
        {}
 };
index c5244b4b47778648275daf975f7cc2b3cbdbdabf..aaf5428c57f57ac4fc3e37223074ec456973ebee 100644 (file)
@@ -1429,7 +1429,7 @@ static const struct sd_desc sd_desc = {
 };
 
 /* -- module initialisation -- */
-static const __devinitdata struct usb_device_id device_table[] = {
+static const struct usb_device_id device_table[] = {
        {USB_DEVICE(0x06f8, 0x3003)},
        {}
 };
index 96f9986305b4f783d5919705470119de07b6cc09..81739a2f205e8e020ac789c984d60a143603e3ce 100644 (file)
@@ -530,7 +530,7 @@ static const struct sd_desc sd_desc = {
 };
 
 /* -- module initialisation -- */
-static const __devinitdata struct usb_device_id device_table[] = {
+static const struct usb_device_id device_table[] = {
        {USB_DEVICE(0x041e, 0x4028)},
        {USB_DEVICE(0x093a, 0x2460)},
        {USB_DEVICE(0x093a, 0x2461)},
index 2700975abce5e277103830ef419485054d05976a..5615d7bd830455e8e1e269c94311601e6b4b8c16 100644 (file)
@@ -1184,7 +1184,7 @@ static const struct sd_desc sd_desc = {
 };
 
 /* -- module initialisation -- */
-static const struct usb_device_id device_table[] __devinitconst = {
+static const struct usb_device_id device_table[] = {
        {USB_DEVICE(0x06f8, 0x3009)},
        {USB_DEVICE(0x093a, 0x2620)},
        {USB_DEVICE(0x093a, 0x2621)},
@@ -1201,7 +1201,7 @@ static const struct usb_device_id device_table[] __devinitconst = {
 MODULE_DEVICE_TABLE(usb, device_table);
 
 /* -- device connect -- */
-static int __devinit sd_probe(struct usb_interface *intf,
+static int sd_probe(struct usb_interface *intf,
                        const struct usb_device_id *id)
 {
        return gspca_dev_probe(intf, id, &sd_desc, sizeof(struct sd),
index 6820f5d58b19d1933478a98bb0ff0b4f629d8ed9..f8801b50e64f2f20b5c5030bb76faaeafef073c8 100644 (file)
@@ -837,7 +837,7 @@ static const struct sd_desc sd_desc = {
 };
 
 /* -- module initialisation -- */
-static const struct usb_device_id device_table[] __devinitconst = {
+static const struct usb_device_id device_table[] = {
        {USB_DEVICE(0x093a, 0x2600)},
        {USB_DEVICE(0x093a, 0x2601)},
        {USB_DEVICE(0x093a, 0x2603)},
@@ -849,7 +849,7 @@ static const struct usb_device_id device_table[] __devinitconst = {
 MODULE_DEVICE_TABLE(usb, device_table);
 
 /* -- device connect -- */
-static int __devinit sd_probe(struct usb_interface *intf,
+static int sd_probe(struct usb_interface *intf,
                        const struct usb_device_id *id)
 {
        return gspca_dev_probe(intf, id, &sd_desc, sizeof(struct sd),
index 40a06680502d15ee48254eede1721932449aab27..4271f86dfe015eab27bc91bec6d4149b25e175bd 100644 (file)
@@ -703,7 +703,7 @@ static const struct sd_desc sd_desc = {
 };
 
 /* -- module initialisation -- */
-static const __devinitdata struct usb_device_id device_table[] = {
+static const struct usb_device_id device_table[] = {
        {USB_DEVICE(0x0458, 0x7005)}, /* Genius Smart 300, version 2 */
        /* The Genius Smart is untested. I can't find an owner ! */
        /* {USB_DEVICE(0x0c45, 0x8000)}, DC31VC, Don't know this camera */
index cb08d00d0a31a03db86e2fd6822485d7f424ed96..fcf29897b71308f9148ddf40bdb515497e09f5c6 100644 (file)
@@ -2470,7 +2470,7 @@ static const struct sd_desc sd_desc = {
                        | (SENSOR_ ## sensor << 8) \
                        | (i2c_addr)
 
-static const __devinitdata struct usb_device_id device_table[] = {
+static const struct usb_device_id device_table[] = {
        {USB_DEVICE(0x0c45, 0x6240), SN9C20X(MT9M001, 0x5d, 0)},
        {USB_DEVICE(0x0c45, 0x6242), SN9C20X(MT9M111, 0x5d, 0)},
        {USB_DEVICE(0x0c45, 0x6248), SN9C20X(OV9655, 0x30, 0)},
index 73504a3f87b75ffdbc21e958b00ef0001a7e71a0..c6cd68d66b533a9b08e87f114e5cba69d48bfe24 100644 (file)
 /* Some documentation on known sonixb registers:
 
 Reg    Use
+sn9c101 / sn9c102:
 0x10   high nibble red gain low nibble blue gain
 0x11   low nibble green gain
+sn9c103:
+0x05   red gain 0-127
+0x06   blue gain 0-127
+0x07   green gain 0-127
+all:
+0x08-0x0f i2c / 3wire registers
 0x12   hstart
 0x13   vstart
 0x15   hsize (hsize = register-value * 16)
@@ -88,12 +95,9 @@ struct sd {
 typedef const __u8 sensor_init_t[8];
 
 struct sensor_data {
-       const __u8 *bridge_init[2];
-       int bridge_init_size[2];
+       const __u8 *bridge_init;
        sensor_init_t *sensor_init;
        int sensor_init_size;
-       sensor_init_t *sensor_bridge_init[2];
-       int sensor_bridge_init_size[2];
        int flags;
        unsigned ctrl_dis;
        __u8 sensor_addr;
@@ -114,7 +118,6 @@ struct sensor_data {
 #define NO_FREQ (1 << FREQ_IDX)
 #define NO_BRIGHTNESS (1 << BRIGHTNESS_IDX)
 
-#define COMP2 0x8f
 #define COMP 0xc7              /* 0x87 //0x07 */
 #define COMP1 0xc9             /* 0x89 //0x09 */
 
@@ -123,15 +126,11 @@ struct sensor_data {
 
 #define SYS_CLK 0x04
 
-#define SENS(bridge_1, bridge_3, sensor, sensor_1, \
-       sensor_3, _flags, _ctrl_dis, _sensor_addr) \
+#define SENS(bridge, sensor, _flags, _ctrl_dis, _sensor_addr) \
 { \
-       .bridge_init = { bridge_1, bridge_3 }, \
-       .bridge_init_size = { sizeof(bridge_1), sizeof(bridge_3) }, \
+       .bridge_init = bridge, \
        .sensor_init = sensor, \
        .sensor_init_size = sizeof(sensor), \
-       .sensor_bridge_init = { sensor_1, sensor_3,}, \
-       .sensor_bridge_init_size = { sizeof(sensor_1), sizeof(sensor_3)}, \
        .flags = _flags, .ctrl_dis = _ctrl_dis, .sensor_addr = _sensor_addr \
 }
 
@@ -311,7 +310,6 @@ static const __u8 initHv7131d[] = {
        0x00, 0x00,
        0x00, 0x00, 0x00, 0x02, 0x02, 0x00,
        0x28, 0x1e, 0x60, 0x8e, 0x42,
-       0x1d, 0x10, 0x02, 0x03, 0x0f, 0x0c
 };
 static const __u8 hv7131d_sensor_init[][8] = {
        {0xa0, 0x11, 0x01, 0x04, 0x00, 0x00, 0x00, 0x17},
@@ -326,7 +324,6 @@ static const __u8 initHv7131r[] = {
        0x00, 0x00,
        0x00, 0x00, 0x00, 0x02, 0x01, 0x00,
        0x28, 0x1e, 0x60, 0x8a, 0x20,
-       0x1d, 0x10, 0x02, 0x03, 0x0f, 0x0c
 };
 static const __u8 hv7131r_sensor_init[][8] = {
        {0xc0, 0x11, 0x31, 0x38, 0x2a, 0x2e, 0x00, 0x10},
@@ -339,7 +336,7 @@ static const __u8 initOv6650[] = {
        0x44, 0x44, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80,
        0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
        0x00, 0x01, 0x01, 0x0a, 0x16, 0x12, 0x68, 0x8b,
-       0x10, 0x1d, 0x10, 0x02, 0x02, 0x09, 0x07
+       0x10,
 };
 static const __u8 ov6650_sensor_init[][8] = {
        /* Bright, contrast, etc are set through SCBB interface.
@@ -378,24 +375,13 @@ static const __u8 initOv7630[] = {
        0x21, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* r09 .. r10 */
        0x00, 0x01, 0x01, 0x0a,                         /* r11 .. r14 */
        0x28, 0x1e,                     /* H & V sizes     r15 .. r16 */
-       0x68, COMP2, MCK_INIT1,                         /* r17 .. r19 */
-       0x1d, 0x10, 0x02, 0x03, 0x0f, 0x0c              /* r1a .. r1f */
-};
-static const __u8 initOv7630_3[] = {
-       0x44, 0x44, 0x00, 0x1a, 0x20, 0x20, 0x20, 0x80, /* r01 .. r08 */
-       0x21, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* r09 .. r10 */
-       0x00, 0x02, 0x01, 0x0a,                         /* r11 .. r14 */
-       0x28, 0x1e,                     /* H & V sizes     r15 .. r16 */
        0x68, 0x8f, MCK_INIT1,                          /* r17 .. r19 */
-       0x1d, 0x10, 0x02, 0x03, 0x0f, 0x0c, 0x00,       /* r1a .. r20 */
-       0x10, 0x20, 0x30, 0x40, 0x50, 0x60, 0x70, 0x80, /* r21 .. r28 */
-       0x90, 0xa0, 0xb0, 0xc0, 0xd0, 0xe0, 0xf0, 0xff  /* r29 .. r30 */
 };
 static const __u8 ov7630_sensor_init[][8] = {
        {0xa0, 0x21, 0x12, 0x80, 0x00, 0x00, 0x00, 0x10},
        {0xb0, 0x21, 0x01, 0x77, 0x3a, 0x00, 0x00, 0x10},
 /*     {0xd0, 0x21, 0x12, 0x7c, 0x01, 0x80, 0x34, 0x10},          jfm */
-       {0xd0, 0x21, 0x12, 0x1c, 0x00, 0x80, 0x34, 0x10},       /* jfm */
+       {0xd0, 0x21, 0x12, 0x5c, 0x00, 0x80, 0x34, 0x10},       /* jfm */
        {0xa0, 0x21, 0x1b, 0x04, 0x00, 0x80, 0x34, 0x10},
        {0xa0, 0x21, 0x20, 0x44, 0x00, 0x80, 0x34, 0x10},
        {0xa0, 0x21, 0x23, 0xee, 0x00, 0x80, 0x34, 0x10},
@@ -413,16 +399,11 @@ static const __u8 ov7630_sensor_init[][8] = {
        {0xd0, 0x21, 0x17, 0x1c, 0xbd, 0x06, 0xf6, 0x10},
 };
 
-static const __u8 ov7630_sensor_init_3[][8] = {
-       {0xa0, 0x21, 0x13, 0x80, 0x00,  0x00, 0x00, 0x10},
-};
-
 static const __u8 initPas106[] = {
        0x04, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x81, 0x40, 0x00, 0x00, 0x00,
        0x00, 0x00,
        0x00, 0x00, 0x00, 0x04, 0x01, 0x00,
        0x16, 0x12, 0x24, COMP1, MCK_INIT1,
-       0x18, 0x10, 0x02, 0x02, 0x09, 0x07
 };
 /* compression 0x86 mckinit1 0x2b */
 
@@ -496,7 +477,6 @@ static const __u8 initPas202[] = {
        0x00, 0x00,
        0x00, 0x00, 0x00, 0x06, 0x03, 0x0a,
        0x28, 0x1e, 0x20, 0x89, 0x20,
-       0x00, 0x00, 0x02, 0x03, 0x0f, 0x0c
 };
 
 /* "Known" PAS202BCB registers:
@@ -537,7 +517,6 @@ static const __u8 initTas5110c[] = {
        0x00, 0x00,
        0x00, 0x00, 0x00, 0x45, 0x09, 0x0a,
        0x16, 0x12, 0x60, 0x86, 0x2b,
-       0x14, 0x0a, 0x02, 0x02, 0x09, 0x07
 };
 /* Same as above, except a different hstart */
 static const __u8 initTas5110d[] = {
@@ -545,12 +524,19 @@ static const __u8 initTas5110d[] = {
        0x00, 0x00,
        0x00, 0x00, 0x00, 0x41, 0x09, 0x0a,
        0x16, 0x12, 0x60, 0x86, 0x2b,
-       0x14, 0x0a, 0x02, 0x02, 0x09, 0x07
 };
-static const __u8 tas5110_sensor_init[][8] = {
+/* tas5110c is 3 wire, tas5110d is 2 wire (regular i2c) */
+static const __u8 tas5110c_sensor_init[][8] = {
        {0x30, 0x11, 0x00, 0x00, 0x0c, 0x00, 0x00, 0x10},
        {0x30, 0x11, 0x02, 0x20, 0xa9, 0x00, 0x00, 0x10},
-       {0xa0, 0x61, 0x9a, 0xca, 0x00, 0x00, 0x00, 0x17},
+};
+/* Known TAS5110D registers
+ * reg02: gain, bit order reversed!! 0 == max gain, 255 == min gain
+ * reg03: bit3: vflip, bit4: ~hflip, bit7: ~gainboost (~ == inverted)
+ *        Note: writing reg03 seems to only work when written together with 02
+ */
+static const __u8 tas5110d_sensor_init[][8] = {
+       {0xa0, 0x61, 0x9a, 0xca, 0x00, 0x00, 0x00, 0x17}, /* reset */
 };
 
 static const __u8 initTas5130[] = {
@@ -558,7 +544,6 @@ static const __u8 initTas5130[] = {
        0x00, 0x00,
        0x00, 0x00, 0x00, 0x68, 0x0c, 0x0a,
        0x28, 0x1e, 0x60, COMP, MCK_INIT,
-       0x18, 0x10, 0x04, 0x03, 0x11, 0x0c
 };
 static const __u8 tas5130_sensor_init[][8] = {
 /*     {0x30, 0x11, 0x00, 0x40, 0x47, 0x00, 0x00, 0x10},
@@ -569,21 +554,18 @@ static const __u8 tas5130_sensor_init[][8] = {
 };
 
 static struct sensor_data sensor_data[] = {
-SENS(initHv7131d, NULL, hv7131d_sensor_init, NULL, NULL, F_GAIN, NO_BRIGHTNESS|NO_FREQ, 0),
-SENS(initHv7131r, NULL, hv7131r_sensor_init, NULL, NULL, 0, NO_BRIGHTNESS|NO_EXPO|NO_FREQ, 0),
-SENS(initOv6650, NULL, ov6650_sensor_init, NULL, NULL, F_GAIN|F_SIF, 0, 0x60),
-SENS(initOv7630, initOv7630_3, ov7630_sensor_init, NULL, ov7630_sensor_init_3,
-       F_GAIN, 0, 0x21),
-SENS(initPas106, NULL, pas106_sensor_init, NULL, NULL, F_GAIN|F_SIF, NO_FREQ,
-       0),
-SENS(initPas202, initPas202, pas202_sensor_init, NULL, NULL, F_GAIN,
-       NO_FREQ, 0),
-SENS(initTas5110c, NULL, tas5110_sensor_init, NULL, NULL,
-       F_GAIN|F_SIF|F_COARSE_EXPO, NO_BRIGHTNESS|NO_FREQ, 0),
-SENS(initTas5110d, NULL, tas5110_sensor_init, NULL, NULL,
-       F_GAIN|F_SIF|F_COARSE_EXPO, NO_BRIGHTNESS|NO_FREQ, 0),
-SENS(initTas5130, NULL, tas5130_sensor_init, NULL, NULL, 0, NO_EXPO|NO_FREQ,
-       0),
+SENS(initHv7131d, hv7131d_sensor_init, F_GAIN, NO_BRIGHTNESS|NO_FREQ, 0),
+SENS(initHv7131r, hv7131r_sensor_init, 0, NO_BRIGHTNESS|NO_EXPO|NO_FREQ, 0),
+SENS(initOv6650, ov6650_sensor_init, F_GAIN|F_SIF, 0, 0x60),
+SENS(initOv7630, ov7630_sensor_init, F_GAIN, 0, 0x21),
+SENS(initPas106, pas106_sensor_init, F_GAIN|F_SIF, NO_FREQ, 0),
+SENS(initPas202, pas202_sensor_init, F_GAIN, NO_FREQ, 0),
+SENS(initTas5110c, tas5110c_sensor_init, F_GAIN|F_SIF|F_COARSE_EXPO,
+       NO_BRIGHTNESS|NO_FREQ, 0),
+SENS(initTas5110d, tas5110d_sensor_init, F_GAIN|F_SIF|F_COARSE_EXPO,
+       NO_BRIGHTNESS|NO_FREQ, 0),
+SENS(initTas5130, tas5130_sensor_init, F_GAIN,
+       NO_BRIGHTNESS|NO_EXPO|NO_FREQ, 0),
 };
 
 /* get one byte in gspca_dev->usb_buf */
@@ -655,7 +637,6 @@ static void i2c_w_vector(struct gspca_dev *gspca_dev,
 static void setbrightness(struct gspca_dev *gspca_dev)
 {
        struct sd *sd = (struct sd *) gspca_dev;
-       __u8 value;
 
        switch (sd->sensor) {
        case  SENSOR_OV6650:
@@ -697,17 +678,6 @@ static void setbrightness(struct gspca_dev *gspca_dev)
                        goto err;
                break;
            }
-       case SENSOR_TAS5130CXX: {
-               __u8 i2c[] =
-                       {0x30, 0x11, 0x02, 0x20, 0x70, 0x00, 0x00, 0x10};
-
-               value = 0xff - sd->brightness;
-               i2c[4] = value;
-               PDEBUG(D_CONF, "brightness %d : %d", value, i2c[4]);
-               if (i2c_w(gspca_dev, i2c) < 0)
-                       goto err;
-               break;
-           }
        }
        return;
 err:
@@ -733,7 +703,7 @@ static void setsensorgain(struct gspca_dev *gspca_dev)
                break;
            }
        case SENSOR_TAS5110C:
-       case SENSOR_TAS5110D: {
+       case SENSOR_TAS5130CXX: {
                __u8 i2c[] =
                        {0x30, 0x11, 0x02, 0x20, 0x70, 0x00, 0x00, 0x10};
 
@@ -742,6 +712,23 @@ static void setsensorgain(struct gspca_dev *gspca_dev)
                        goto err;
                break;
            }
+       case SENSOR_TAS5110D: {
+               __u8 i2c[] = {
+                       0xb0, 0x61, 0x02, 0x00, 0x10, 0x00, 0x00, 0x17 };
+               gain = 255 - gain;
+               /* The bits in the register are the wrong way around!! */
+               i2c[3] |= (gain & 0x80) >> 7;
+               i2c[3] |= (gain & 0x40) >> 5;
+               i2c[3] |= (gain & 0x20) >> 3;
+               i2c[3] |= (gain & 0x10) >> 1;
+               i2c[3] |= (gain & 0x08) << 1;
+               i2c[3] |= (gain & 0x04) << 3;
+               i2c[3] |= (gain & 0x02) << 5;
+               i2c[3] |= (gain & 0x01) << 7;
+               if (i2c_w(gspca_dev, i2c) < 0)
+                       goto err;
+               break;
+           }
 
        case SENSOR_OV6650:
                gain >>= 1;
@@ -796,7 +783,7 @@ static void setgain(struct gspca_dev *gspca_dev)
 {
        struct sd *sd = (struct sd *) gspca_dev;
        __u8 gain;
-       __u8 buf[2] = { 0, 0 };
+       __u8 buf[3] = { 0, 0, 0 };
 
        if (sensor_data[sd->sensor].flags & F_GAIN) {
                /* Use the sensor gain to do the actual gain */
@@ -804,13 +791,18 @@ static void setgain(struct gspca_dev *gspca_dev)
                return;
        }
 
-       gain = sd->gain >> 4;
-
-       /* red and blue gain */
-       buf[0] = gain << 4 | gain;
-       /* green gain */
-       buf[1] = gain;
-       reg_w(gspca_dev, 0x10, buf, 2);
+       if (sd->bridge == BRIDGE_103) {
+               gain = sd->gain >> 1;
+               buf[0] = gain; /* Red */
+               buf[1] = gain; /* Green */
+               buf[2] = gain; /* Blue */
+               reg_w(gspca_dev, 0x05, buf, 3);
+       } else {
+               gain = sd->gain >> 4;
+               buf[0] = gain << 4 | gain; /* Red and blue */
+               buf[1] = gain; /* Green */
+               reg_w(gspca_dev, 0x10, buf, 2);
+       }
 }
 
 static void setexposure(struct gspca_dev *gspca_dev)
@@ -1049,7 +1041,7 @@ static void do_autogain(struct gspca_dev *gspca_dev)
                desired_avg_lum = 5000;
        } else {
                deadzone = 1500;
-               desired_avg_lum = 18000;
+               desired_avg_lum = 13000;
        }
 
        if (sensor_data[sd->sensor].flags & F_COARSE_EXPO)
@@ -1127,53 +1119,91 @@ static int sd_start(struct gspca_dev *gspca_dev)
 {
        struct sd *sd = (struct sd *) gspca_dev;
        struct cam *cam = &gspca_dev->cam;
-       int mode, l;
-       const __u8 *sn9c10x;
-       __u8 reg12_19[8];
+       int i, mode;
+       __u8 regs[0x31];
 
        mode = cam->cam_mode[gspca_dev->curr_mode].priv & 0x07;
-       sn9c10x = sensor_data[sd->sensor].bridge_init[sd->bridge];
-       l = sensor_data[sd->sensor].bridge_init_size[sd->bridge];
-       memcpy(reg12_19, &sn9c10x[0x12 - 1], 8);
-       reg12_19[6] = sn9c10x[0x18 - 1] | (mode << 4);
-       /* Special cases where reg 17 and or 19 value depends on mode */
+       /* Copy registers 0x01 - 0x19 from the template */
+       memcpy(&regs[0x01], sensor_data[sd->sensor].bridge_init, 0x19);
+       /* Set the mode */
+       regs[0x18] |= mode << 4;
+
+       /* Set bridge gain to 1.0 */
+       if (sd->bridge == BRIDGE_103) {
+               regs[0x05] = 0x20; /* Red */
+               regs[0x06] = 0x20; /* Green */
+               regs[0x07] = 0x20; /* Blue */
+       } else {
+               regs[0x10] = 0x00; /* Red and blue */
+               regs[0x11] = 0x00; /* Green */
+       }
+
+       /* Setup pixel numbers and auto exposure window */
+       if (sensor_data[sd->sensor].flags & F_SIF) {
+               regs[0x1a] = 0x14; /* HO_SIZE 640, makes no sense */
+               regs[0x1b] = 0x0a; /* VO_SIZE 320, makes no sense */
+               regs[0x1c] = 0x02; /* AE H-start 64 */
+               regs[0x1d] = 0x02; /* AE V-start 64 */
+               regs[0x1e] = 0x09; /* AE H-end 288 */
+               regs[0x1f] = 0x07; /* AE V-end 224 */
+       } else {
+               regs[0x1a] = 0x1d; /* HO_SIZE 960, makes no sense */
+               regs[0x1b] = 0x10; /* VO_SIZE 512, makes no sense */
+               regs[0x1c] = 0x05; /* AE H-start 160 */
+               regs[0x1d] = 0x03; /* AE V-start 96 */
+               regs[0x1e] = 0x0f; /* AE H-end 480 */
+               regs[0x1f] = 0x0c; /* AE V-end 384 */
+       }
+
+       /* Setup the gamma table (only used with the sn9c103 bridge) */
+       for (i = 0; i < 16; i++)
+               regs[0x20 + i] = i * 16;
+       regs[0x20 + i] = 255;
+
+       /* Special cases where some regs depend on mode or bridge */
        switch (sd->sensor) {
        case SENSOR_TAS5130CXX:
-               /* probably not mode specific at all most likely the upper
+               /* FIXME / TESTME
+                  probably not mode specific at all most likely the upper
                   nibble of 0x19 is exposure (clock divider) just as with
                   the tas5110, we need someone to test this. */
-               reg12_19[7] = mode ? 0x23 : 0x43;
+               regs[0x19] = mode ? 0x23 : 0x43;
                break;
+       case SENSOR_OV7630:
+               /* FIXME / TESTME for some reason with the 101/102 bridge the
+                  clock is set to 12 Mhz (reg1 == 0x04), rather then 24.
+                  Also the hstart needs to go from 1 to 2 when using a 103,
+                  which is likely related. This does not seem right. */
+               if (sd->bridge == BRIDGE_103) {
+                       regs[0x01] = 0x44; /* Select 24 Mhz clock */
+                       regs[0x12] = 0x02; /* Set hstart to 2 */
+               }
        }
        /* Disable compression when the raw bayer format has been selected */
        if (cam->cam_mode[gspca_dev->curr_mode].priv & MODE_RAW)
-               reg12_19[6] &= ~0x80;
+               regs[0x18] &= ~0x80;
 
        /* Vga mode emulation on SIF sensor? */
        if (cam->cam_mode[gspca_dev->curr_mode].priv & MODE_REDUCED_SIF) {
-               reg12_19[0] += 16; /* 0x12: hstart adjust */
-               reg12_19[1] += 24; /* 0x13: vstart adjust */
-               reg12_19[3] = 320 / 16; /* 0x15: hsize */
-               reg12_19[4] = 240 / 16; /* 0x16: vsize */
+               regs[0x12] += 16;       /* hstart adjust */
+               regs[0x13] += 24;       /* vstart adjust */
+               regs[0x15]  = 320 / 16; /* hsize */
+               regs[0x16]  = 240 / 16; /* vsize */
        }
 
        /* reg 0x01 bit 2 video transfert on */
-       reg_w(gspca_dev, 0x01, &sn9c10x[0x01 - 1], 1);
+       reg_w(gspca_dev, 0x01, &regs[0x01], 1);
        /* reg 0x17 SensorClk enable inv Clk 0x60 */
-       reg_w(gspca_dev, 0x17, &sn9c10x[0x17 - 1], 1);
+       reg_w(gspca_dev, 0x17, &regs[0x17], 1);
        /* Set the registers from the template */
-       reg_w(gspca_dev, 0x01, sn9c10x, l);
+       reg_w(gspca_dev, 0x01, &regs[0x01],
+             (sd->bridge == BRIDGE_103) ? 0x30 : 0x1f);
 
        /* Init the sensor */
        i2c_w_vector(gspca_dev, sensor_data[sd->sensor].sensor_init,
                        sensor_data[sd->sensor].sensor_init_size);
-       if (sensor_data[sd->sensor].sensor_bridge_init[sd->bridge])
-               i2c_w_vector(gspca_dev,
-                       sensor_data[sd->sensor].sensor_bridge_init[sd->bridge],
-                       sensor_data[sd->sensor].sensor_bridge_init_size[
-                               sd->bridge]);
 
-       /* Mode specific sensor setup */
+       /* Mode / bridge specific sensor setup */
        switch (sd->sensor) {
        case SENSOR_PAS202: {
                const __u8 i2cpclockdiv[] =
@@ -1181,27 +1211,37 @@ static int sd_start(struct gspca_dev *gspca_dev)
                /* clockdiv from 4 to 3 (7.5 -> 10 fps) when in low res mode */
                if (mode)
                        i2c_w(gspca_dev, i2cpclockdiv);
+               break;
            }
+       case SENSOR_OV7630:
+               /* FIXME / TESTME We should be able to handle this identical
+                  for the 101/102 and the 103 case */
+               if (sd->bridge == BRIDGE_103) {
+                       const __u8 i2c[] = { 0xa0, 0x21, 0x13,
+                                            0x80, 0x00, 0x00, 0x00, 0x10 };
+                       i2c_w(gspca_dev, i2c);
+               }
+               break;
        }
        /* H_size V_size 0x28, 0x1e -> 640x480. 0x16, 0x12 -> 352x288 */
-       reg_w(gspca_dev, 0x15, &reg12_19[3], 2);
+       reg_w(gspca_dev, 0x15, &regs[0x15], 2);
        /* compression register */
-       reg_w(gspca_dev, 0x18, &reg12_19[6], 1);
+       reg_w(gspca_dev, 0x18, &regs[0x18], 1);
        /* H_start */
-       reg_w(gspca_dev, 0x12, &reg12_19[0], 1);
+       reg_w(gspca_dev, 0x12, &regs[0x12], 1);
        /* V_START */
-       reg_w(gspca_dev, 0x13, &reg12_19[1], 1);
+       reg_w(gspca_dev, 0x13, &regs[0x13], 1);
        /* reset 0x17 SensorClk enable inv Clk 0x60 */
                                /*fixme: ov7630 [17]=68 8f (+20 if 102)*/
-       reg_w(gspca_dev, 0x17, &reg12_19[5], 1);
+       reg_w(gspca_dev, 0x17, &regs[0x17], 1);
        /*MCKSIZE ->3 */        /*fixme: not ov7630*/
-       reg_w(gspca_dev, 0x19, &reg12_19[7], 1);
+       reg_w(gspca_dev, 0x19, &regs[0x19], 1);
        /* AE_STRX AE_STRY AE_ENDX AE_ENDY */
-       reg_w(gspca_dev, 0x1c, &sn9c10x[0x1c - 1], 4);
+       reg_w(gspca_dev, 0x1c, &regs[0x1c], 4);
        /* Enable video transfert */
-       reg_w(gspca_dev, 0x01, &sn9c10x[0], 1);
+       reg_w(gspca_dev, 0x01, &regs[0x01], 1);
        /* Compression */
-       reg_w(gspca_dev, 0x18, &reg12_19[6], 2);
+       reg_w(gspca_dev, 0x18, &regs[0x18], 2);
        msleep(20);
 
        sd->reg11 = -1;
@@ -1525,15 +1565,15 @@ static const struct sd_desc sd_desc = {
        .driver_info = (SENSOR_ ## sensor << 8) | BRIDGE_ ## bridge
 
 
-static const struct usb_device_id device_table[] __devinitconst = {
+static const struct usb_device_id device_table[] = {
        {USB_DEVICE(0x0c45, 0x6001), SB(TAS5110C, 102)}, /* TAS5110C1B */
        {USB_DEVICE(0x0c45, 0x6005), SB(TAS5110C, 101)}, /* TAS5110C1B */
        {USB_DEVICE(0x0c45, 0x6007), SB(TAS5110D, 101)}, /* TAS5110D */
        {USB_DEVICE(0x0c45, 0x6009), SB(PAS106, 101)},
        {USB_DEVICE(0x0c45, 0x600d), SB(PAS106, 101)},
        {USB_DEVICE(0x0c45, 0x6011), SB(OV6650, 101)},
-#if !defined CONFIG_USB_SN9C102 && !defined CONFIG_USB_SN9C102_MODULE
        {USB_DEVICE(0x0c45, 0x6019), SB(OV7630, 101)},
+#if !defined CONFIG_USB_SN9C102 && !defined CONFIG_USB_SN9C102_MODULE
        {USB_DEVICE(0x0c45, 0x6024), SB(TAS5130CXX, 102)},
        {USB_DEVICE(0x0c45, 0x6025), SB(TAS5130CXX, 102)},
 #endif
@@ -1544,18 +1584,22 @@ static const struct usb_device_id device_table[] __devinitconst = {
        {USB_DEVICE(0x0c45, 0x602c), SB(OV7630, 102)},
        {USB_DEVICE(0x0c45, 0x602d), SB(HV7131R, 102)},
        {USB_DEVICE(0x0c45, 0x602e), SB(OV7630, 102)},
-       /* {USB_DEVICE(0x0c45, 0x602b), SB(MI03XX, 102)}, */ /* MI0343 MI0360 MI0330 */
+       /* {USB_DEVICE(0x0c45, 0x6030), SB(MI03XX, 102)}, */ /* MI0343 MI0360 MI0330 */
+       /* {USB_DEVICE(0x0c45, 0x6082), SB(MI03XX, 103)}, */ /* MI0343 MI0360 */
+       {USB_DEVICE(0x0c45, 0x6083), SB(HV7131D, 103)},
+       {USB_DEVICE(0x0c45, 0x608c), SB(HV7131R, 103)},
+       /* {USB_DEVICE(0x0c45, 0x608e), SB(CISVF10, 103)}, */
        {USB_DEVICE(0x0c45, 0x608f), SB(OV7630, 103)},
-#if !defined CONFIG_USB_SN9C102 && !defined CONFIG_USB_SN9C102_MODULE
+       {USB_DEVICE(0x0c45, 0x60a8), SB(PAS106, 103)},
+       {USB_DEVICE(0x0c45, 0x60aa), SB(TAS5130CXX, 103)},
        {USB_DEVICE(0x0c45, 0x60af), SB(PAS202, 103)},
-#endif
        {USB_DEVICE(0x0c45, 0x60b0), SB(OV7630, 103)},
        {}
 };
 MODULE_DEVICE_TABLE(usb, device_table);
 
 /* -- device connect -- */
-static int __devinit sd_probe(struct usb_interface *intf,
+static int sd_probe(struct usb_interface *intf,
                        const struct usb_device_id *id)
 {
        return gspca_dev_probe(intf, id, &sd_desc, sizeof(struct sd),
index 2d0bb17a30a29db28d831b10ab9be49f062399b1..d6f39ce1b7e1612dc53fb602a707f13c6d492359 100644 (file)
 #include "gspca.h"
 #include "jpeg.h"
 
-#define V4L2_CID_INFRARED (V4L2_CID_PRIVATE_BASE + 0)
-
 MODULE_AUTHOR("Jean-François Moine <http://moinejf.free.fr>");
 MODULE_DESCRIPTION("GSPCA/SONIX JPEG USB Camera Driver");
 MODULE_LICENSE("GPL");
 
+static int starcam;
+
 /* controls */
 enum e_ctrl {
        BRIGHTNESS,
@@ -43,7 +43,7 @@ enum e_ctrl {
        HFLIP,
        VFLIP,
        SHARPNESS,
-       INFRARED,
+       ILLUM,
        FREQ,
        NCTRLS          /* number of controls */
 };
@@ -100,7 +100,8 @@ enum sensors {
 };
 
 /* device flags */
-#define PDN_INV        1               /* inverse pin S_PWR_DN / sn_xxx tables */
+#define F_PDN_INV      0x01    /* inverse pin S_PWR_DN / sn_xxx tables */
+#define F_ILLUM                0x02    /* presence of illuminator */
 
 /* sn9c1xx definitions */
 /* register 0x01 */
@@ -124,7 +125,7 @@ static void setgamma(struct gspca_dev *gspca_dev);
 static void setautogain(struct gspca_dev *gspca_dev);
 static void sethvflip(struct gspca_dev *gspca_dev);
 static void setsharpness(struct gspca_dev *gspca_dev);
-static void setinfrared(struct gspca_dev *gspca_dev);
+static void setillum(struct gspca_dev *gspca_dev);
 static void setfreq(struct gspca_dev *gspca_dev);
 
 static const struct ctrl sd_ctrls[NCTRLS] = {
@@ -251,18 +252,17 @@ static const struct ctrl sd_ctrls[NCTRLS] = {
            },
            .set_control = setsharpness
        },
-/* mt9v111 only */
-[INFRARED] = {
+[ILLUM] = {
            {
-               .id      = V4L2_CID_INFRARED,
+               .id      = V4L2_CID_ILLUMINATORS_1,
                .type    = V4L2_CTRL_TYPE_BOOLEAN,
-               .name    = "Infrared",
+               .name    = "Illuminator / infrared",
                .minimum = 0,
                .maximum = 1,
                .step    = 1,
                .default_value = 0,
            },
-           .set_control = setinfrared
+           .set_control = setillum
        },
 /* ov7630/ov7648/ov7660 only */
 [FREQ] = {
@@ -282,32 +282,26 @@ static const struct ctrl sd_ctrls[NCTRLS] = {
 /* table of the disabled controls */
 static const __u32 ctrl_dis[] = {
 [SENSOR_ADCM1700] =    (1 << AUTOGAIN) |
-                       (1 << INFRARED) |
                        (1 << HFLIP) |
                        (1 << VFLIP) |
                        (1 << FREQ),
 
-[SENSOR_GC0307] =      (1 << INFRARED) |
-                       (1 << HFLIP) |
+[SENSOR_GC0307] =      (1 << HFLIP) |
                        (1 << VFLIP) |
                        (1 << FREQ),
 
-[SENSOR_HV7131R] =     (1 << INFRARED) |
-                       (1 << HFLIP) |
+[SENSOR_HV7131R] =     (1 << HFLIP) |
                        (1 << FREQ),
 
-[SENSOR_MI0360] =      (1 << INFRARED) |
-                       (1 << HFLIP) |
+[SENSOR_MI0360] =      (1 << HFLIP) |
                        (1 << VFLIP) |
                        (1 << FREQ),
 
-[SENSOR_MI0360B] =     (1 << INFRARED) |
-                       (1 << HFLIP) |
+[SENSOR_MI0360B] =     (1 << HFLIP) |
                        (1 << VFLIP) |
                        (1 << FREQ),
 
-[SENSOR_MO4000] =      (1 << INFRARED) |
-                       (1 << HFLIP) |
+[SENSOR_MO4000] =      (1 << HFLIP) |
                        (1 << VFLIP) |
                        (1 << FREQ),
 
@@ -315,40 +309,32 @@ static const __u32 ctrl_dis[] = {
                        (1 << VFLIP) |
                        (1 << FREQ),
 
-[SENSOR_OM6802] =      (1 << INFRARED) |
-                       (1 << HFLIP) |
+[SENSOR_OM6802] =      (1 << HFLIP) |
                        (1 << VFLIP) |
                        (1 << FREQ),
 
-[SENSOR_OV7630] =      (1 << INFRARED) |
-                       (1 << HFLIP),
+[SENSOR_OV7630] =      (1 << HFLIP),
 
-[SENSOR_OV7648] =      (1 << INFRARED) |
-                       (1 << HFLIP),
+[SENSOR_OV7648] =      (1 << HFLIP),
 
 [SENSOR_OV7660] =      (1 << AUTOGAIN) |
-                       (1 << INFRARED) |
                        (1 << HFLIP) |
                        (1 << VFLIP),
 
 [SENSOR_PO1030] =      (1 << AUTOGAIN) |
-                       (1 << INFRARED) |
                        (1 << HFLIP) |
                        (1 << VFLIP) |
                        (1 << FREQ),
 
 [SENSOR_PO2030N] =     (1 << AUTOGAIN) |
-                       (1 << INFRARED) |
                        (1 << FREQ),
 
 [SENSOR_SOI768] =      (1 << AUTOGAIN) |
-                       (1 << INFRARED) |
                        (1 << HFLIP) |
                        (1 << VFLIP) |
                        (1 << FREQ),
 
 [SENSOR_SP80708] =     (1 << AUTOGAIN) |
-                       (1 << INFRARED) |
                        (1 << HFLIP) |
                        (1 << VFLIP) |
                        (1 << FREQ),
@@ -1822,44 +1808,46 @@ static int sd_init(struct gspca_dev *gspca_dev)
        PDEBUG(D_PROBE, "Sonix chip id: %02x", regF1);
        switch (sd->bridge) {
        case BRIDGE_SN9C102P:
+       case BRIDGE_SN9C105:
                if (regF1 != 0x11)
                        return -ENODEV;
+               break;
+       default:
+/*     case BRIDGE_SN9C110: */
+/*     case BRIDGE_SN9C120: */
+               if (regF1 != 0x12)
+                       return -ENODEV;
+       }
+
+       switch (sd->sensor) {
+       case SENSOR_MI0360:
+               mi0360_probe(gspca_dev);
+               break;
+       case SENSOR_OV7630:
+               ov7630_probe(gspca_dev);
+               break;
+       case SENSOR_OV7648:
+               ov7648_probe(gspca_dev);
+               break;
+       case SENSOR_PO2030N:
+               po2030n_probe(gspca_dev);
+               break;
+       }
+
+       switch (sd->bridge) {
+       case BRIDGE_SN9C102P:
                reg_w1(gspca_dev, 0x02, regGpio[1]);
                break;
        case BRIDGE_SN9C105:
-               if (regF1 != 0x11)
-                       return -ENODEV;
-               if (sd->sensor == SENSOR_MI0360)
-                       mi0360_probe(gspca_dev);
                reg_w(gspca_dev, 0x01, regGpio, 2);
                break;
+       case BRIDGE_SN9C110:
+               reg_w1(gspca_dev, 0x02, 0x62);
+               break;
        case BRIDGE_SN9C120:
-               if (regF1 != 0x12)
-                       return -ENODEV;
-               switch (sd->sensor) {
-               case SENSOR_MI0360:
-                       mi0360_probe(gspca_dev);
-                       break;
-               case SENSOR_OV7630:
-                       ov7630_probe(gspca_dev);
-                       break;
-               case SENSOR_OV7648:
-                       ov7648_probe(gspca_dev);
-                       break;
-               case SENSOR_PO2030N:
-                       po2030n_probe(gspca_dev);
-                       break;
-               }
                regGpio[1] = 0x70;              /* no audio */
                reg_w(gspca_dev, 0x01, regGpio, 2);
                break;
-       default:
-/*     case BRIDGE_SN9C110: */
-/*     case BRIDGE_SN9C325: */
-               if (regF1 != 0x12)
-                       return -ENODEV;
-               reg_w1(gspca_dev, 0x02, 0x62);
-               break;
        }
 
        if (sd->sensor == SENSOR_OM6802)
@@ -1874,6 +1862,8 @@ static int sd_init(struct gspca_dev *gspca_dev)
        sd->i2c_addr = sn9c1xx[9];
 
        gspca_dev->ctrl_dis = ctrl_dis[sd->sensor];
+       if (!(sd->flags & F_ILLUM))
+               gspca_dev->ctrl_dis |= (1 << ILLUM);
 
        return gspca_dev->usb_err;
 }
@@ -2197,16 +2187,28 @@ static void setsharpness(struct gspca_dev *gspca_dev)
        reg_w1(gspca_dev, 0x99, sd->ctrls[SHARPNESS].val);
 }
 
-static void setinfrared(struct gspca_dev *gspca_dev)
+static void setillum(struct gspca_dev *gspca_dev)
 {
        struct sd *sd = (struct sd *) gspca_dev;
 
-       if (gspca_dev->ctrl_dis & (1 << INFRARED))
+       if (gspca_dev->ctrl_dis & (1 << ILLUM))
                return;
-/*fixme: different sequence for StarCam Clip and StarCam 370i */
-/* Clip */
-       i2c_w1(gspca_dev, 0x02,                         /* gpio */
-               sd->ctrls[INFRARED].val ? 0x66 : 0x64);
+       switch (sd->sensor) {
+       case SENSOR_ADCM1700:
+               reg_w1(gspca_dev, 0x02,                         /* gpio */
+                       sd->ctrls[ILLUM].val ? 0x64 : 0x60);
+               break;
+       case SENSOR_MT9V111:
+               if (starcam)
+                       reg_w1(gspca_dev, 0x02,
+                               sd->ctrls[ILLUM].val ?
+                                               0x55 : 0x54);   /* 370i */
+               else
+                       reg_w1(gspca_dev, 0x02,
+                               sd->ctrls[ILLUM].val ?
+                                               0x66 : 0x64);   /* Clip */
+               break;
+       }
 }
 
 static void setfreq(struct gspca_dev *gspca_dev)
@@ -2344,7 +2346,7 @@ static int sd_start(struct gspca_dev *gspca_dev)
        /* sensor clock already enabled in sd_init */
        /* reg_w1(gspca_dev, 0xf1, 0x00); */
        reg01 = sn9c1xx[1];
-       if (sd->flags & PDN_INV)
+       if (sd->flags & F_PDN_INV)
                reg01 ^= S_PDN_INV;             /* power down inverted */
        reg_w1(gspca_dev, 0x01, reg01);
 
@@ -2907,13 +2909,11 @@ static const struct sd_desc sd_desc = {
        .driver_info = (BRIDGE_ ## bridge << 16) \
                        | (SENSOR_ ## sensor << 8) \
                        | (flags)
-static const __devinitdata struct usb_device_id device_table[] = {
-#if !defined CONFIG_USB_SN9C102 && !defined CONFIG_USB_SN9C102_MODULE
+static const struct usb_device_id device_table[] = {
        {USB_DEVICE(0x0458, 0x7025), BS(SN9C120, MI0360)},
        {USB_DEVICE(0x0458, 0x702e), BS(SN9C120, OV7660)},
-#endif
-       {USB_DEVICE(0x045e, 0x00f5), BSF(SN9C105, OV7660, PDN_INV)},
-       {USB_DEVICE(0x045e, 0x00f7), BSF(SN9C105, OV7660, PDN_INV)},
+       {USB_DEVICE(0x045e, 0x00f5), BSF(SN9C105, OV7660, F_PDN_INV)},
+       {USB_DEVICE(0x045e, 0x00f7), BSF(SN9C105, OV7660, F_PDN_INV)},
        {USB_DEVICE(0x0471, 0x0327), BS(SN9C105, MI0360)},
        {USB_DEVICE(0x0471, 0x0328), BS(SN9C105, MI0360)},
        {USB_DEVICE(0x0471, 0x0330), BS(SN9C105, MI0360)},
@@ -2925,7 +2925,7 @@ static const __devinitdata struct usb_device_id device_table[] = {
 /*     {USB_DEVICE(0x0c45, 0x607b), BS(SN9C102P, OV7660)}, */
        {USB_DEVICE(0x0c45, 0x607c), BS(SN9C102P, HV7131R)},
 /*     {USB_DEVICE(0x0c45, 0x607e), BS(SN9C102P, OV7630)}, */
-       {USB_DEVICE(0x0c45, 0x60c0), BS(SN9C105, MI0360)},
+       {USB_DEVICE(0x0c45, 0x60c0), BSF(SN9C105, MI0360, F_ILLUM)},
                                                /* or MT9V111 */
 /*     {USB_DEVICE(0x0c45, 0x60c2), BS(SN9C105, P1030xC)}, */
 /*     {USB_DEVICE(0x0c45, 0x60c8), BS(SN9C105, OM6802)}, */
@@ -2936,10 +2936,8 @@ static const __devinitdata struct usb_device_id device_table[] = {
 /*     {USB_DEVICE(0x0c45, 0x60fa), BS(SN9C105, OV7648)}, */
 /*     {USB_DEVICE(0x0c45, 0x60f2), BS(SN9C105, OV7660)}, */
        {USB_DEVICE(0x0c45, 0x60fb), BS(SN9C105, OV7660)},
-#if !defined CONFIG_USB_SN9C102 && !defined CONFIG_USB_SN9C102_MODULE
        {USB_DEVICE(0x0c45, 0x60fc), BS(SN9C105, HV7131R)},
        {USB_DEVICE(0x0c45, 0x60fe), BS(SN9C105, OV7630)},
-#endif
        {USB_DEVICE(0x0c45, 0x6100), BS(SN9C120, MI0360)},      /*sn9c128*/
        {USB_DEVICE(0x0c45, 0x6102), BS(SN9C120, PO2030N)},     /* /GC0305*/
 /*     {USB_DEVICE(0x0c45, 0x6108), BS(SN9C120, OM6802)}, */
@@ -2962,16 +2960,15 @@ static const __devinitdata struct usb_device_id device_table[] = {
 /*     {USB_DEVICE(0x0c45, 0x6132), BS(SN9C120, OV7670)}, */
        {USB_DEVICE(0x0c45, 0x6138), BS(SN9C120, MO4000)},
        {USB_DEVICE(0x0c45, 0x613a), BS(SN9C120, OV7648)},
-#if !defined CONFIG_USB_SN9C102 && !defined CONFIG_USB_SN9C102_MODULE
        {USB_DEVICE(0x0c45, 0x613b), BS(SN9C120, OV7660)},
-#endif
        {USB_DEVICE(0x0c45, 0x613c), BS(SN9C120, HV7131R)},
        {USB_DEVICE(0x0c45, 0x613e), BS(SN9C120, OV7630)},
        {USB_DEVICE(0x0c45, 0x6142), BS(SN9C120, PO2030N)},     /*sn9c120b*/
                                                /* or GC0305 / GC0307 */
        {USB_DEVICE(0x0c45, 0x6143), BS(SN9C120, SP80708)},     /*sn9c120b*/
        {USB_DEVICE(0x0c45, 0x6148), BS(SN9C120, OM6802)},      /*sn9c120b*/
-       {USB_DEVICE(0x0c45, 0x614a), BS(SN9C120, ADCM1700)},    /*sn9c120b*/
+       {USB_DEVICE(0x0c45, 0x614a), BSF(SN9C120, ADCM1700, F_ILLUM)},
+/*     {USB_DEVICE(0x0c45, 0x614c), BS(SN9C120, GC0306)}, */   /*sn9c120b*/
        {}
 };
 MODULE_DEVICE_TABLE(usb, device_table);
@@ -3007,3 +3004,7 @@ static void __exit sd_mod_exit(void)
 
 module_init(sd_mod_init);
 module_exit(sd_mod_exit);
+
+module_param(starcam, int, 0644);
+MODULE_PARM_DESC(starcam,
+       "StarCam model. 0: Clip, 1: 370i");
index e643386644107a9dabcf1c63a393826e0d6fb5dd..76c006b2bc83035edbadd8da3d907b2943069ed1 100644 (file)
@@ -555,7 +555,7 @@ static const struct sd_desc sd_desc = {
 };
 
 /* -- module initialisation -- */
-static const __devinitdata struct usb_device_id device_table[] = {
+static const struct usb_device_id device_table[] = {
        {USB_DEVICE(0x04fc, 0x1528)},
        {}
 };
index 8e202b9039f18895358cb12d1762fa284f481bec..45552c3ff8d9ce701c36e3c75070260673911cfe 100644 (file)
@@ -1051,7 +1051,7 @@ static const struct sd_desc sd_desc = {
 };
 
 /* -- module initialisation -- */
-static const __devinitdata struct usb_device_id device_table[] = {
+static const struct usb_device_id device_table[] = {
        {USB_DEVICE(0x040a, 0x0300), .driver_info = KodakEZ200},
        {USB_DEVICE(0x041e, 0x400a), .driver_info = CreativePCCam300},
        {USB_DEVICE(0x046d, 0x0890), .driver_info = LogitechTraveler},
index 642839a11e8d061aeb5c7c7ab5d590dd6e961814..f7ef282cc600ccb75a39fa025b06774e6dcd5f26 100644 (file)
@@ -2155,7 +2155,7 @@ static const struct sd_desc sd_desc = {
 };
 
 /* -- module initialisation -- */
-static const __devinitdata struct usb_device_id device_table[] = {
+static const struct usb_device_id device_table[] = {
        {USB_DEVICE(0x040a, 0x0002), .driver_info = KodakDVC325},
        {USB_DEVICE(0x0497, 0xc001), .driver_info = SmileIntlCamera},
        {USB_DEVICE(0x0506, 0x00df), .driver_info = ThreeComHomeConnectLite},
index bc9dd9034ab499c9dbafeeb0a117f2d341722097..e5bf865147d7a5ec4ffb0f43e2acff3bb1909816 100644 (file)
@@ -786,7 +786,7 @@ static const struct sd_desc sd_desc = {
 };
 
 /* -- module initialisation -- */
-static const __devinitdata struct usb_device_id device_table[] = {
+static const struct usb_device_id device_table[] = {
        {USB_DEVICE(0x041e, 0x401d), .driver_info = Nxultra},
        {USB_DEVICE(0x0733, 0x0430), .driver_info = IntelPCCameraPro},
 /*fixme: may be UsbGrabberPV321 BRIDGE_SPCA506 SENSOR_SAA7113 */
index 7307638ac91d65e221f3f6f6981d874e7e39b141..348319371523849da40357078c7f812a22689c9b 100644 (file)
@@ -1509,7 +1509,7 @@ static const struct sd_desc sd_desc = {
 };
 
 /* -- module initialisation -- */
-static const __devinitdata struct usb_device_id device_table[] = {
+static const struct usb_device_id device_table[] = {
        {USB_DEVICE(0x0130, 0x0130), .driver_info = HamaUSBSightcam},
        {USB_DEVICE(0x041e, 0x4018), .driver_info = CreativeVista},
        {USB_DEVICE(0x0733, 0x0110), .driver_info = ViewQuestVQ110},
index 3a162c6d54664e807ea368df14cf8015ed0c9b7b..e836e778dfb6ae08f3890b2f6d69759926fddf83 100644 (file)
@@ -1061,7 +1061,7 @@ static const struct sd_desc *sd_desc[2] = {
 };
 
 /* -- module initialisation -- */
-static const __devinitdata struct usb_device_id device_table[] = {
+static const struct usb_device_id device_table[] = {
        {USB_DEVICE(0x041e, 0x401a), .driver_info = Rev072A},
        {USB_DEVICE(0x041e, 0x403b), .driver_info = Rev012A},
        {USB_DEVICE(0x0458, 0x7004), .driver_info = Rev072A},
index 4040677457755e1a7908dca3af2701f07ef946f0..2e9c06175192cac3a2d5940ede21cbe57c15f2b5 100644 (file)
@@ -396,7 +396,7 @@ static int sd_start(struct gspca_dev *gspca_dev)
 }
 
 /* Table of supported USB devices */
-static const __devinitdata struct usb_device_id device_table[] = {
+static const struct usb_device_id device_table[] = {
        {USB_DEVICE(0x2770, 0x9120)},
        {}
 };
index 8ba1995438568c2eaef60174081b6bd4e4dd59ff..457563b7a71bd98e246225eb2d4eb8026c1ebfde 100644 (file)
@@ -298,7 +298,7 @@ static int sd_start(struct gspca_dev *gspca_dev)
 }
 
 /* Table of supported USB devices */
-static const __devinitdata struct usb_device_id device_table[] = {
+static const struct usb_device_id device_table[] = {
        {USB_DEVICE(0x2770, 0x905c)},
        {USB_DEVICE(0x2770, 0x9050)},
        {USB_DEVICE(0x2770, 0x9051)},
index a4a98811b9e3f982415e298e5cd7b35040e153b1..8215d5dcd4560fa8383215971709b1e92dc36b31 100644 (file)
@@ -1163,7 +1163,7 @@ static const struct sd_desc sd_desc = {
 #define ST(sensor, type) \
        .driver_info = (SENSOR_ ## sensor << 8) \
                        | (type)
-static const __devinitdata struct usb_device_id device_table[] = {
+static const struct usb_device_id device_table[] = {
        {USB_DEVICE(0x041e, 0x4038), ST(MI0360, 0)},
        {USB_DEVICE(0x041e, 0x403c), ST(LZ24BP, 0)},
        {USB_DEVICE(0x041e, 0x403d), ST(LZ24BP, 0)},
index 11a192b95ed47394eb667f9941e8d3e08f51ab70..87be52b5e1e3666528226966d5d7456d369faddb 100644 (file)
@@ -495,7 +495,7 @@ static const struct sd_desc sd_desc = {
 };
 
 /* -- module initialisation -- */
-static const __devinitdata struct usb_device_id device_table[] = {
+static const struct usb_device_id device_table[] = {
        {USB_DEVICE(0x05e1, 0x0893)},
        {}
 };
index b199ad4666bd4517cb8a56baa0ab499a0a8927d4..e2ef41cf72d74bdaca8425d34048a3a159895cb6 100644 (file)
@@ -327,7 +327,7 @@ static const struct sd_desc sd_desc = {
 };
 
 /* -- module initialisation -- */
-static const __devinitdata struct usb_device_id device_table[] = {
+static const struct usb_device_id device_table[] = {
        {USB_DEVICE(0x0553, 0x0202)},
        {USB_DEVICE(0x041e, 0x4007)},
        {}
index 28ea4175b80e55f4850ef1eb571ea347a39d685c..7e06614292936b15576fbf3f669d62369fd1b025 100644 (file)
@@ -564,7 +564,7 @@ static int stv06xx_config(struct gspca_dev *gspca_dev,
 
 
 /* -- module initialisation -- */
-static const __devinitdata struct usb_device_id device_table[] = {
+static const struct usb_device_id device_table[] = {
        /* QuickCam Express */
        {USB_DEVICE(0x046d, 0x0840), .driver_info = BRIDGE_STV600 },
        /* LEGO cam / QuickCam Web */
index a9cbcd6011d9c19e7e2ce97942a54a77287feefa..543542af272048ef0e5d6bfa07887f4eb6b44774 100644 (file)
@@ -1162,7 +1162,7 @@ static const struct sd_desc sd_desc = {
 #define BS(bridge, subtype) \
        .driver_info = (BRIDGE_ ## bridge << 8) \
                        | (subtype)
-static const __devinitdata struct usb_device_id device_table[] = {
+static const struct usb_device_id device_table[] = {
        {USB_DEVICE(0x041e, 0x400b), BS(SPCA504C, 0)},
        {USB_DEVICE(0x041e, 0x4012), BS(SPCA504C, 0)},
        {USB_DEVICE(0x041e, 0x4013), BS(SPCA504C, 0)},
index 8f0c33116e0d1e65eaa7d3d91f76251ea2e56678..a3eccd81576625119350e6177cb834d72c7ba652 100644 (file)
@@ -1416,7 +1416,7 @@ static const struct sd_desc sd_desc = {
 };
 
 /* -- module initialisation -- */
-static const __devinitdata struct usb_device_id device_table[] = {
+static const struct usb_device_id device_table[] = {
        {USB_DEVICE(0x17a1, 0x0128)},
        {}
 };
index 38c22f0a4263f02a986d586d54a68391c2f84457..933ef2ca658c377ad5ae0312512f6882bac1490d 100644 (file)
@@ -388,7 +388,7 @@ static const struct sd_desc sd_desc = {
 };
 
 /* -- module initialisation -- */
-static const __devinitdata struct usb_device_id device_table[] = {
+static const struct usb_device_id device_table[] = {
        {USB_DEVICE(0x046d, 0x0920)},
        {USB_DEVICE(0x046d, 0x0921)},
        {USB_DEVICE(0x0545, 0x808b)},
index 9b2ae1b6cc75c736f9607b63c601af29ec576dea..6caed734a06ab0559892a869f330f0d0840f8865 100644 (file)
@@ -4192,7 +4192,7 @@ static const struct sd_desc sd_desc = {
 #define BF(bridge, flags) \
        .driver_info = (BRIDGE_ ## bridge << 8) \
                | (flags)
-static const __devinitdata struct usb_device_id device_table[] = {
+static const struct usb_device_id device_table[] = {
        {USB_DEVICE(0x041e, 0x405b), BF(VC0323, FL_VFLIP)},
        {USB_DEVICE(0x046d, 0x0892), BF(VC0321, 0)},
        {USB_DEVICE(0x046d, 0x0896), BF(VC0321, 0)},
index 5b5039a02031f87ebd1b6e35193e79fa9ae603bc..c089a0f6f1d034924553357e6645584bb82504ea 100644 (file)
@@ -3270,7 +3270,7 @@ static const struct sd_desc sd_desc_isoc_nego = {
 };
 
 /* -- module initialisation -- */
-static const __devinitdata struct usb_device_id device_table[] = {
+static const struct usb_device_id device_table[] = {
        { USB_DEVICE_VER(0x0545, 0x8080, 0x0001, 0x0001), .driver_info = CIT_MODEL0 },
        { USB_DEVICE_VER(0x0545, 0x8080, 0x0002, 0x0002), .driver_info = CIT_MODEL1 },
        { USB_DEVICE_VER(0x0545, 0x8080, 0x030a, 0x030a), .driver_info = CIT_MODEL2 },
index 14b85d48316393242e8b3c2f91f8d3dc96faf0a6..865216e9362c55c956af81b737855e58ec1fc318 100644 (file)
@@ -6909,7 +6909,7 @@ static const struct sd_desc sd_desc = {
 #endif
 };
 
-static const __devinitdata struct usb_device_id device_table[] = {
+static const struct usb_device_id device_table[] = {
        {USB_DEVICE(0x041e, 0x041e)},
        {USB_DEVICE(0x041e, 0x4017)},
        {USB_DEVICE(0x041e, 0x401c), .driver_info = SENSOR_PAS106},
index e0230fcb2e360f234543c5a89612cc81d5831265..3baa9f613ca36aa82efaff5742cbb463c698c13a 100644 (file)
@@ -1,6 +1,4 @@
-hdpvr-objs     := hdpvr-control.o hdpvr-core.o hdpvr-video.o
-
-hdpvr-$(CONFIG_I2C) += hdpvr-i2c.o
+hdpvr-objs     := hdpvr-control.o hdpvr-core.o hdpvr-video.o hdpvr-i2c.o
 
 obj-$(CONFIG_VIDEO_HDPVR) += hdpvr.o
 
index f7d1ee55185a527c4b0302acdbd30c5b5f523c1c..a6572e5ae369f76e065826fc5bc471902f0daaa1 100644 (file)
@@ -378,19 +378,17 @@ static int hdpvr_probe(struct usb_interface *interface,
                goto error;
        }
 
-#ifdef CONFIG_I2C
-       /* until i2c is working properly */
-       retval = 0; /* hdpvr_register_i2c_adapter(dev); */
+#if defined(CONFIG_I2C) || defined(CONFIG_I2C_MODULE)
+       retval = hdpvr_register_i2c_adapter(dev);
        if (retval < 0) {
                v4l2_err(&dev->v4l2_dev, "registering i2c adapter failed\n");
                goto error;
        }
 
-       /* until i2c is working properly */
-       retval = 0; /* hdpvr_register_i2c_ir(dev); */
+       retval = hdpvr_register_i2c_ir(dev);
        if (retval < 0)
                v4l2_err(&dev->v4l2_dev, "registering i2c IR devices failed\n");
-#endif /* CONFIG_I2C */
+#endif
 
        /* let the user know what node this device is now attached to */
        v4l2_info(&dev->v4l2_dev, "device now attached to %s\n",
index 24966aa02a70ec5d49a9e233ef185f96a06c3b1d..89b71faeaac2dce9f2216fadc8dd7b5987e702b2 100644 (file)
@@ -13,6 +13,8 @@
  *
  */
 
+#if defined(CONFIG_I2C) || defined(CONFIG_I2C_MODULE)
+
 #include <linux/i2c.h>
 #include <linux/slab.h>
 
 #define Z8F0811_IR_TX_I2C_ADDR 0x70
 #define Z8F0811_IR_RX_I2C_ADDR 0x71
 
-static const u8 ir_i2c_addrs[] = {
-       Z8F0811_IR_TX_I2C_ADDR,
-       Z8F0811_IR_RX_I2C_ADDR,
-};
 
-static const char * const ir_devicenames[] = {
-       "ir_tx_z8f0811_hdpvr",
-       "ir_rx_z8f0811_hdpvr",
+static struct i2c_board_info hdpvr_i2c_board_info = {
+       I2C_BOARD_INFO("ir_tx_z8f0811_hdpvr", Z8F0811_IR_TX_I2C_ADDR),
+       I2C_BOARD_INFO("ir_rx_z8f0811_hdpvr", Z8F0811_IR_RX_I2C_ADDR),
 };
 
-static int hdpvr_new_i2c_ir(struct hdpvr_device *dev, struct i2c_adapter *adap,
-                           const char *type, u8 addr)
+int hdpvr_register_i2c_ir(struct hdpvr_device *dev)
 {
-       struct i2c_board_info info;
+       struct i2c_client *c;
        struct IR_i2c_init_data *init_data = &dev->ir_i2c_init_data;
-       unsigned short addr_list[2] = { addr, I2C_CLIENT_END };
-
-       memset(&info, 0, sizeof(struct i2c_board_info));
-       strlcpy(info.type, type, I2C_NAME_SIZE);
 
        /* Our default information for ir-kbd-i2c.c to use */
-       switch (addr) {
-       case Z8F0811_IR_RX_I2C_ADDR:
-               init_data->ir_codes = RC_MAP_HAUPPAUGE_NEW;
-               init_data->internal_get_key_func = IR_KBD_GET_KEY_HAUP_XVR;
-               init_data->type = RC_TYPE_RC5;
-               init_data->name = "HD PVR";
-               info.platform_data = init_data;
-               break;
-       }
+       init_data->ir_codes = RC_MAP_HAUPPAUGE_NEW;
+       init_data->internal_get_key_func = IR_KBD_GET_KEY_HAUP_XVR;
+       init_data->type = RC_TYPE_RC5;
+       init_data->name = "HD PVR";
+       hdpvr_i2c_board_info.platform_data = init_data;
 
-       return i2c_new_probed_device(adap, &info, addr_list, NULL) == NULL ?
-              -1 : 0;
-}
+       c = i2c_new_device(&dev->i2c_adapter, &hdpvr_i2c_board_info);
 
-int hdpvr_register_i2c_ir(struct hdpvr_device *dev)
-{
-       int i;
-       int ret = 0;
-
-       for (i = 0; i < ARRAY_SIZE(ir_i2c_addrs); i++)
-               ret += hdpvr_new_i2c_ir(dev, dev->i2c_adapter,
-                                       ir_devicenames[i], ir_i2c_addrs[i]);
-
-       return ret;
+       return (c == NULL) ? -ENODEV : 0;
 }
 
-static int hdpvr_i2c_read(struct hdpvr_device *dev, unsigned char addr,
-                         char *data, int len)
+static int hdpvr_i2c_read(struct hdpvr_device *dev, int bus,
+                         unsigned char addr, char *data, int len)
 {
        int ret;
-       char *buf = kmalloc(len, GFP_KERNEL);
-       if (!buf)
-               return -ENOMEM;
+
+       if (len > sizeof(dev->i2c_buf))
+               return -EINVAL;
 
        ret = usb_control_msg(dev->udev,
                              usb_rcvctrlpipe(dev->udev, 0),
                              REQTYPE_I2C_READ, CTRL_READ_REQUEST,
-                             0x100|addr, 0, buf, len, 1000);
+                             (bus << 8) | addr, 0, &dev->i2c_buf, len, 1000);
 
        if (ret == len) {
-               memcpy(data, buf, len);
+               memcpy(data, &dev->i2c_buf, len);
                ret = 0;
        } else if (ret >= 0)
                ret = -EIO;
 
-       kfree(buf);
-
        return ret;
 }
 
-static int hdpvr_i2c_write(struct hdpvr_device *dev, unsigned char addr,
-                          char *data, int len)
+static int hdpvr_i2c_write(struct hdpvr_device *dev, int bus,
+                          unsigned char addr, char *data, int len)
 {
        int ret;
-       char *buf = kmalloc(len, GFP_KERNEL);
-       if (!buf)
-               return -ENOMEM;
 
-       memcpy(buf, data, len);
+       if (len > sizeof(dev->i2c_buf))
+               return -EINVAL;
+
+       memcpy(&dev->i2c_buf, data, len);
        ret = usb_control_msg(dev->udev,
                              usb_sndctrlpipe(dev->udev, 0),
                              REQTYPE_I2C_WRITE, CTRL_WRITE_REQUEST,
-                             0x100|addr, 0, buf, len, 1000);
+                             (bus << 8) | addr, 0, &dev->i2c_buf, len, 1000);
 
        if (ret < 0)
-               goto error;
+               return ret;
 
        ret = usb_control_msg(dev->udev,
                              usb_rcvctrlpipe(dev->udev, 0),
                              REQTYPE_I2C_WRITE_STATT, CTRL_READ_REQUEST,
-                             0, 0, buf, 2, 1000);
+                             0, 0, &dev->i2c_buf, 2, 1000);
 
-       if (ret == 2)
+       if ((ret == 2) && (dev->i2c_buf[1] == (len - 1)))
                ret = 0;
        else if (ret >= 0)
                ret = -EIO;
 
-error:
-       kfree(buf);
        return ret;
 }
 
@@ -146,10 +120,10 @@ static int hdpvr_transfer(struct i2c_adapter *i2c_adapter, struct i2c_msg *msgs,
                addr = msgs[i].addr << 1;
 
                if (msgs[i].flags & I2C_M_RD)
-                       retval = hdpvr_i2c_read(dev, addr, msgs[i].buf,
+                       retval = hdpvr_i2c_read(dev, 1, addr, msgs[i].buf,
                                                msgs[i].len);
                else
-                       retval = hdpvr_i2c_write(dev, addr, msgs[i].buf,
+                       retval = hdpvr_i2c_write(dev, 1, addr, msgs[i].buf,
                                                 msgs[i].len);
        }
 
@@ -168,30 +142,47 @@ static struct i2c_algorithm hdpvr_algo = {
        .functionality = hdpvr_functionality,
 };
 
+static struct i2c_adapter hdpvr_i2c_adapter_template = {
+       .name   = "Hauppage HD PVR I2C",
+       .owner  = THIS_MODULE,
+       .algo   = &hdpvr_algo,
+};
+
+static int hdpvr_activate_ir(struct hdpvr_device *dev)
+{
+       char buffer[8];
+
+       mutex_lock(&dev->i2c_mutex);
+
+       hdpvr_i2c_read(dev, 0, 0x54, buffer, 1);
+
+       buffer[0] = 0;
+       buffer[1] = 0x8;
+       hdpvr_i2c_write(dev, 1, 0x54, buffer, 2);
+
+       buffer[1] = 0x18;
+       hdpvr_i2c_write(dev, 1, 0x54, buffer, 2);
+
+       mutex_unlock(&dev->i2c_mutex);
+
+       return 0;
+}
+
 int hdpvr_register_i2c_adapter(struct hdpvr_device *dev)
 {
-       struct i2c_adapter *i2c_adap;
        int retval = -ENOMEM;
 
-       i2c_adap = kzalloc(sizeof(struct i2c_adapter), GFP_KERNEL);
-       if (i2c_adap == NULL)
-               goto error;
-
-       strlcpy(i2c_adap->name, "Hauppauge HD PVR I2C",
-               sizeof(i2c_adap->name));
-       i2c_adap->algo  = &hdpvr_algo;
-       i2c_adap->owner = THIS_MODULE;
-       i2c_adap->dev.parent = &dev->udev->dev;
+       hdpvr_activate_ir(dev);
 
-       i2c_set_adapdata(i2c_adap, dev);
+       memcpy(&dev->i2c_adapter, &hdpvr_i2c_adapter_template,
+              sizeof(struct i2c_adapter));
+       dev->i2c_adapter.dev.parent = &dev->udev->dev;
 
-       retval = i2c_add_adapter(i2c_adap);
+       i2c_set_adapdata(&dev->i2c_adapter, dev);
 
-       if (!retval)
-               dev->i2c_adapter = i2c_adap;
-       else
-               kfree(i2c_adap);
+       retval = i2c_add_adapter(&dev->i2c_adapter);
 
-error:
        return retval;
 }
+
+#endif
index d38fe1043e47dc46951ef07eb051599e98744042..514aea76eaa5b68b30acf66b0ce4fd4446421fb5 100644 (file)
@@ -1220,12 +1220,9 @@ static void hdpvr_device_release(struct video_device *vdev)
        v4l2_device_unregister(&dev->v4l2_dev);
 
        /* deregister I2C adapter */
-#ifdef CONFIG_I2C
+#if defined(CONFIG_I2C) || (CONFIG_I2C_MODULE)
        mutex_lock(&dev->i2c_mutex);
-       if (dev->i2c_adapter)
-               i2c_del_adapter(dev->i2c_adapter);
-       kfree(dev->i2c_adapter);
-       dev->i2c_adapter = NULL;
+       i2c_del_adapter(&dev->i2c_adapter);
        mutex_unlock(&dev->i2c_mutex);
 #endif /* CONFIG_I2C */
 
index 37f1e4c7675d4cbc070ce700bb07ff3d55f594de..ee74e3be9a6ac60bea9291292082e850c0c4fcf5 100644 (file)
@@ -25,6 +25,7 @@
        KERNEL_VERSION(HDPVR_MAJOR_VERSION, HDPVR_MINOR_VERSION, HDPVR_RELEASE)
 
 #define HDPVR_MAX 8
+#define HDPVR_I2C_MAX_SIZE 128
 
 /* Define these values to match your devices */
 #define HD_PVR_VENDOR_ID       0x2040
@@ -106,9 +107,11 @@ struct hdpvr_device {
        struct work_struct      worker;
 
        /* I2C adapter */
-       struct i2c_adapter      *i2c_adapter;
+       struct i2c_adapter      i2c_adapter;
        /* I2C lock */
        struct mutex            i2c_mutex;
+       /* I2C message buffer space */
+       char                    i2c_buf[HDPVR_I2C_MAX_SIZE];
 
        /* For passing data to ir-kbd-i2c */
        struct IR_i2c_init_data ir_i2c_init_data;
index c87b6bc455556dd7b4fbe607dc18dbdd909f5840..d2b20ad383a3e9e31a35032895143ab2ec59a4ee 100644 (file)
@@ -244,15 +244,17 @@ static void ir_key_poll(struct IR_i2c *ir)
        static u32 ir_key, ir_raw;
        int rc;
 
-       dprintk(2,"ir_poll_key\n");
+       dprintk(3, "%s\n", __func__);
        rc = ir->get_key(ir, &ir_key, &ir_raw);
        if (rc < 0) {
                dprintk(2,"error\n");
                return;
        }
 
-       if (rc)
+       if (rc) {
+               dprintk(1, "%s: keycode = 0x%04x\n", __func__, ir_key);
                rc_keydown(ir->rc, ir_key, 0);
+       }
 }
 
 static void ir_work(struct work_struct *work)
@@ -321,6 +323,12 @@ static int ir_probe(struct i2c_client *client, const struct i2c_device_id *id)
                rc_type     = RC_TYPE_OTHER;
                ir_codes    = RC_MAP_AVERMEDIA_CARDBUS;
                break;
+       case 0x71:
+               name        = "Hauppauge/Zilog Z8";
+               ir->get_key = get_key_haup_xvr;
+               rc_type     = RC_TYPE_RC5;
+               ir_codes    = hauppauge ? RC_MAP_HAUPPAUGE_NEW : RC_MAP_RC5_TV;
+               break;
        }
 
        /* Let the caller override settings */
index e103b8fc74525753ef0fe08d236bea3c818823eb..9fb86a081c0fe43f9f0f891ba7b3c47eb009b377 100644 (file)
@@ -300,10 +300,15 @@ int ivtv_i2c_register(struct ivtv *itv, unsigned idx)
                                adap, type, 0, I2C_ADDRS(hw_addrs[idx]));
        } else if (hw == IVTV_HW_CX25840) {
                struct cx25840_platform_data pdata;
+               struct i2c_board_info cx25840_info = {
+                       .type = "cx25840",
+                       .addr = hw_addrs[idx],
+                       .platform_data = &pdata,
+               };
 
                pdata.pvr150_workaround = itv->pvr150_workaround;
-               sd = v4l2_i2c_new_subdev_cfg(&itv->v4l2_dev,
-                               adap, type, 0, &pdata, hw_addrs[idx], NULL);
+               sd = v4l2_i2c_new_subdev_board(&itv->v4l2_dev, adap,
+                               &cx25840_info, NULL);
        } else {
                sd = v4l2_i2c_new_subdev(&itv->v4l2_dev,
                                adap, type, hw_addrs[idx], NULL);
index 209ff97261a95814bf585e04bf957c160512f9c8..4904d25f689fdf61c60fc0d8db2d40f80fd473f8 100644 (file)
 #include <asm/div64.h>
 #include <media/v4l2-device.h>
 #include <media/v4l2-chip-ident.h>
-#include "mt9v011.h"
+#include <media/mt9v011.h>
 
 MODULE_DESCRIPTION("Micron mt9v011 sensor driver");
 MODULE_AUTHOR("Mauro Carvalho Chehab <mchehab@redhat.com>");
 MODULE_LICENSE("GPL");
 
-
 static int debug;
 module_param(debug, int, 0);
 MODULE_PARM_DESC(debug, "Debug level (0-2)");
 
+#define R00_MT9V011_CHIP_VERSION       0x00
+#define R01_MT9V011_ROWSTART           0x01
+#define R02_MT9V011_COLSTART           0x02
+#define R03_MT9V011_HEIGHT             0x03
+#define R04_MT9V011_WIDTH              0x04
+#define R05_MT9V011_HBLANK             0x05
+#define R06_MT9V011_VBLANK             0x06
+#define R07_MT9V011_OUT_CTRL           0x07
+#define R09_MT9V011_SHUTTER_WIDTH      0x09
+#define R0A_MT9V011_CLK_SPEED          0x0a
+#define R0B_MT9V011_RESTART            0x0b
+#define R0C_MT9V011_SHUTTER_DELAY      0x0c
+#define R0D_MT9V011_RESET              0x0d
+#define R1E_MT9V011_DIGITAL_ZOOM       0x1e
+#define R20_MT9V011_READ_MODE          0x20
+#define R2B_MT9V011_GREEN_1_GAIN       0x2b
+#define R2C_MT9V011_BLUE_GAIN          0x2c
+#define R2D_MT9V011_RED_GAIN           0x2d
+#define R2E_MT9V011_GREEN_2_GAIN       0x2e
+#define R35_MT9V011_GLOBAL_GAIN                0x35
+#define RF1_MT9V011_CHIP_ENABLE                0xf1
+
+#define MT9V011_VERSION                        0x8232
+#define MT9V011_REV_B_VERSION          0x8243
+
 /* supported controls */
 static struct v4l2_queryctrl mt9v011_qctrl[] = {
        {
@@ -469,23 +493,6 @@ static int mt9v011_s_mbus_fmt(struct v4l2_subdev *sd, struct v4l2_mbus_framefmt
        return 0;
 }
 
-static int mt9v011_s_config(struct v4l2_subdev *sd, int dumb, void *data)
-{
-       struct mt9v011 *core = to_mt9v011(sd);
-       unsigned *xtal = data;
-
-       v4l2_dbg(1, debug, sd, "s_config called\n");
-
-       if (xtal) {
-               core->xtal = *xtal;
-               v4l2_dbg(1, debug, sd, "xtal set to %d.%03d MHz\n",
-                        *xtal / 1000000, (*xtal / 1000) % 1000);
-       }
-
-       return 0;
-}
-
-
 #ifdef CONFIG_VIDEO_ADV_DEBUG
 static int mt9v011_g_register(struct v4l2_subdev *sd,
                              struct v4l2_dbg_register *reg)
@@ -536,7 +543,6 @@ static const struct v4l2_subdev_core_ops mt9v011_core_ops = {
        .g_ctrl = mt9v011_g_ctrl,
        .s_ctrl = mt9v011_s_ctrl,
        .reset = mt9v011_reset,
-       .s_config = mt9v011_s_config,
        .g_chip_ident = mt9v011_g_chip_ident,
 #ifdef CONFIG_VIDEO_ADV_DEBUG
        .g_register = mt9v011_g_register,
@@ -596,6 +602,14 @@ static int mt9v011_probe(struct i2c_client *c,
        core->height = 480;
        core->xtal = 27000000;  /* Hz */
 
+       if (c->dev.platform_data) {
+               struct mt9v011_platform_data *pdata = c->dev.platform_data;
+
+               core->xtal = pdata->xtal;
+               v4l2_dbg(1, debug, sd, "xtal set to %d.%03d MHz\n",
+                       core->xtal / 1000000, (core->xtal / 1000) % 1000);
+       }
+
        v4l_info(c, "chip found @ 0x%02x (%s - chip version 0x%04x)\n",
                 c->addr << 1, c->adapter->name, version);
 
diff --git a/drivers/media/video/mt9v011.h b/drivers/media/video/mt9v011.h
deleted file mode 100644 (file)
index 3350fd6..0000000
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- * mt9v011 -Micron 1/4-Inch VGA Digital Image Sensor
- *
- * Copyright (c) 2009 Mauro Carvalho Chehab (mchehab@redhat.com)
- * This code is placed under the terms of the GNU General Public License v2
- */
-
-#ifndef MT9V011_H_
-#define MT9V011_H_
-
-#define R00_MT9V011_CHIP_VERSION       0x00
-#define R01_MT9V011_ROWSTART           0x01
-#define R02_MT9V011_COLSTART           0x02
-#define R03_MT9V011_HEIGHT             0x03
-#define R04_MT9V011_WIDTH              0x04
-#define R05_MT9V011_HBLANK             0x05
-#define R06_MT9V011_VBLANK             0x06
-#define R07_MT9V011_OUT_CTRL           0x07
-#define R09_MT9V011_SHUTTER_WIDTH      0x09
-#define R0A_MT9V011_CLK_SPEED          0x0a
-#define R0B_MT9V011_RESTART            0x0b
-#define R0C_MT9V011_SHUTTER_DELAY      0x0c
-#define R0D_MT9V011_RESET              0x0d
-#define R1E_MT9V011_DIGITAL_ZOOM       0x1e
-#define R20_MT9V011_READ_MODE          0x20
-#define R2B_MT9V011_GREEN_1_GAIN       0x2b
-#define R2C_MT9V011_BLUE_GAIN          0x2c
-#define R2D_MT9V011_RED_GAIN           0x2d
-#define R2E_MT9V011_GREEN_2_GAIN       0x2e
-#define R35_MT9V011_GLOBAL_GAIN                0x35
-#define RF1_MT9V011_CHIP_ENABLE                0xf1
-
-#define MT9V011_VERSION                        0x8232
-#define MT9V011_REV_B_VERSION          0x8243
-
-#endif
index c881a64b41fd9328a29abe9436a82682e613a7ac..d4e7c11553c3b427ee12e99631f2a65a224c9bfc 100644 (file)
@@ -1449,47 +1449,6 @@ static int ov7670_g_chip_ident(struct v4l2_subdev *sd,
        return v4l2_chip_ident_i2c_client(client, chip, V4L2_IDENT_OV7670, 0);
 }
 
-static int ov7670_s_config(struct v4l2_subdev *sd, int dumb, void *data)
-{
-       struct i2c_client *client = v4l2_get_subdevdata(sd);
-       struct ov7670_config *config = data;
-       struct ov7670_info *info = to_state(sd);
-       int ret;
-
-       info->clock_speed = 30; /* default: a guess */
-
-       /*
-        * Must apply configuration before initializing device, because it
-        * selects I/O method.
-        */
-       if (config) {
-               info->min_width = config->min_width;
-               info->min_height = config->min_height;
-               info->use_smbus = config->use_smbus;
-
-               if (config->clock_speed)
-                       info->clock_speed = config->clock_speed;
-       }
-
-       /* Make sure it's an ov7670 */
-       ret = ov7670_detect(sd);
-       if (ret) {
-               v4l_dbg(1, debug, client,
-                       "chip found @ 0x%x (%s) is not an ov7670 chip.\n",
-                       client->addr << 1, client->adapter->name);
-               kfree(info);
-               return ret;
-       }
-       v4l_info(client, "chip found @ 0x%02x (%s)\n",
-                       client->addr << 1, client->adapter->name);
-
-       info->fmt = &ov7670_formats[0];
-       info->sat = 128;        /* Review this */
-       info->clkrc = info->clock_speed / 30;
-
-       return 0;
-}
-
 #ifdef CONFIG_VIDEO_ADV_DEBUG
 static int ov7670_g_register(struct v4l2_subdev *sd, struct v4l2_dbg_register *reg)
 {
@@ -1528,7 +1487,6 @@ static const struct v4l2_subdev_core_ops ov7670_core_ops = {
        .s_ctrl = ov7670_s_ctrl,
        .queryctrl = ov7670_queryctrl,
        .reset = ov7670_reset,
-       .s_config = ov7670_s_config,
        .init = ov7670_init,
 #ifdef CONFIG_VIDEO_ADV_DEBUG
        .g_register = ov7670_g_register,
@@ -1558,6 +1516,7 @@ static int ov7670_probe(struct i2c_client *client,
 {
        struct v4l2_subdev *sd;
        struct ov7670_info *info;
+       int ret;
 
        info = kzalloc(sizeof(struct ov7670_info), GFP_KERNEL);
        if (info == NULL)
@@ -1565,6 +1524,37 @@ static int ov7670_probe(struct i2c_client *client,
        sd = &info->sd;
        v4l2_i2c_subdev_init(sd, client, &ov7670_ops);
 
+       info->clock_speed = 30; /* default: a guess */
+       if (client->dev.platform_data) {
+               struct ov7670_config *config = client->dev.platform_data;
+
+               /*
+                * Must apply configuration before initializing device, because it
+                * selects I/O method.
+                */
+               info->min_width = config->min_width;
+               info->min_height = config->min_height;
+               info->use_smbus = config->use_smbus;
+
+               if (config->clock_speed)
+                       info->clock_speed = config->clock_speed;
+       }
+
+       /* Make sure it's an ov7670 */
+       ret = ov7670_detect(sd);
+       if (ret) {
+               v4l_dbg(1, debug, client,
+                       "chip found @ 0x%x (%s) is not an ov7670 chip.\n",
+                       client->addr << 1, client->adapter->name);
+               kfree(info);
+               return ret;
+       }
+       v4l_info(client, "chip found @ 0x%02x (%s)\n",
+                       client->addr << 1, client->adapter->name);
+
+       info->fmt = &ov7670_formats[0];
+       info->sat = 128;        /* Review this */
+       info->clkrc = info->clock_speed / 30;
        return 0;
 }
 
index ac94a8bf883ed9ba82dc629db5d99c333beb50c1..305e6aaa844aca618c5aa4c81ee56137df723144 100644 (file)
@@ -40,6 +40,7 @@
 #include "pvrusb2-io.h"
 #include <media/v4l2-device.h>
 #include <media/cx2341x.h>
+#include <media/ir-kbd-i2c.h>
 #include "pvrusb2-devattr.h"
 
 /* Legal values for PVR2_CID_HSM */
@@ -202,6 +203,7 @@ struct pvr2_hdw {
 
        /* IR related */
        unsigned int ir_scheme_active; /* IR scheme as seen from the outside */
+       struct IR_i2c_init_data ir_init_data; /* params passed to IR modules */
 
        /* Frequency table */
        unsigned int freqTable[FREQTABLE_SIZE];
index 7cbe18c4ca9568f75f0c8f7d837e9e8981ac06e1..ccc884948f34b385563ccbf548c5f80b33cd4f08 100644 (file)
@@ -19,6 +19,7 @@
  */
 
 #include <linux/i2c.h>
+#include <media/ir-kbd-i2c.h>
 #include "pvrusb2-i2c-core.h"
 #include "pvrusb2-hdw-internal.h"
 #include "pvrusb2-debug.h"
@@ -48,13 +49,6 @@ module_param_named(disable_autoload_ir_video, pvr2_disable_ir_video,
 MODULE_PARM_DESC(disable_autoload_ir_video,
                 "1=do not try to autoload ir_video IR receiver");
 
-/* Mapping of IR schemes to known I2C addresses - if any */
-static const unsigned char ir_video_addresses[] = {
-       [PVR2_IR_SCHEME_ZILOG] = 0x71,
-       [PVR2_IR_SCHEME_29XXX] = 0x18,
-       [PVR2_IR_SCHEME_24XXX] = 0x18,
-};
-
 static int pvr2_i2c_write(struct pvr2_hdw *hdw, /* Context */
                          u8 i2c_addr,      /* I2C address we're talking to */
                          u8 *data,         /* Data to write */
@@ -574,26 +568,56 @@ static void do_i2c_scan(struct pvr2_hdw *hdw)
 static void pvr2_i2c_register_ir(struct pvr2_hdw *hdw)
 {
        struct i2c_board_info info;
-       unsigned char addr = 0;
+       struct IR_i2c_init_data *init_data = &hdw->ir_init_data;
        if (pvr2_disable_ir_video) {
                pvr2_trace(PVR2_TRACE_INFO,
                           "Automatic binding of ir_video has been disabled.");
                return;
        }
-       if (hdw->ir_scheme_active < ARRAY_SIZE(ir_video_addresses)) {
-               addr = ir_video_addresses[hdw->ir_scheme_active];
-       }
-       if (!addr) {
+       memset(&info, 0, sizeof(struct i2c_board_info));
+       switch (hdw->ir_scheme_active) {
+       case PVR2_IR_SCHEME_24XXX: /* FX2-controlled IR */
+       case PVR2_IR_SCHEME_29XXX: /* Original 29xxx device */
+               init_data->ir_codes              = RC_MAP_HAUPPAUGE_NEW;
+               init_data->internal_get_key_func = IR_KBD_GET_KEY_HAUP;
+               init_data->type                  = RC_TYPE_RC5;
+               init_data->name                  = hdw->hdw_desc->description;
+               init_data->polling_interval      = 100; /* ms From ir-kbd-i2c */
+               /* IR Receiver */
+               info.addr          = 0x18;
+               info.platform_data = init_data;
+               strlcpy(info.type, "ir_video", I2C_NAME_SIZE);
+               pvr2_trace(PVR2_TRACE_INFO, "Binding %s to i2c address 0x%02x.",
+                          info.type, info.addr);
+               i2c_new_device(&hdw->i2c_adap, &info);
+               break;
+       case PVR2_IR_SCHEME_ZILOG:     /* HVR-1950 style */
+       case PVR2_IR_SCHEME_24XXX_MCE: /* 24xxx MCE device */
+               init_data->ir_codes              = RC_MAP_HAUPPAUGE_NEW;
+               init_data->internal_get_key_func = IR_KBD_GET_KEY_HAUP_XVR;
+               init_data->type                  = RC_TYPE_RC5;
+               init_data->name                  = hdw->hdw_desc->description;
+               init_data->polling_interval      = 260; /* ms From lirc_zilog */
+               /* IR Receiver */
+               info.addr          = 0x71;
+               info.platform_data = init_data;
+               strlcpy(info.type, "ir_rx_z8f0811_haup", I2C_NAME_SIZE);
+               pvr2_trace(PVR2_TRACE_INFO, "Binding %s to i2c address 0x%02x.",
+                          info.type, info.addr);
+               i2c_new_device(&hdw->i2c_adap, &info);
+               /* IR Trasmitter */
+               info.addr          = 0x70;
+               info.platform_data = init_data;
+               strlcpy(info.type, "ir_tx_z8f0811_haup", I2C_NAME_SIZE);
+               pvr2_trace(PVR2_TRACE_INFO, "Binding %s to i2c address 0x%02x.",
+                          info.type, info.addr);
+               i2c_new_device(&hdw->i2c_adap, &info);
+               break;
+       default:
                /* The device either doesn't support I2C-based IR or we
                   don't know (yet) how to operate IR on the device. */
-               return;
+               break;
        }
-       pvr2_trace(PVR2_TRACE_INFO,
-                  "Binding ir_video to i2c address 0x%02x.", addr);
-       memset(&info, 0, sizeof(struct i2c_board_info));
-       strlcpy(info.type, "ir_video", I2C_NAME_SIZE);
-       info.addr = addr;
-       i2c_new_device(&hdw->i2c_adap, &info);
 }
 
 void pvr2_i2c_core_init(struct pvr2_hdw *hdw)
index e7aa588c6c5ad78d3f21e014cc32daba94970f74..deb8fcf4aa49550fb251407a092774a4284f9d32 100644 (file)
@@ -5179,18 +5179,8 @@ struct saa7134_board saa7134_boards[] = {
        [SAA7134_BOARD_KWORLD_PCI_SBTVD_FULLSEG] = {
                .name           = "Kworld PCI SBTVD/ISDB-T Full-Seg Hybrid",
                .audio_clock    = 0x00187de7,
-#if 0
-       /*
-        * FIXME: Analog mode doesn't work, if digital is enabled. The proper
-        * fix is to use tda8290 driver, but Kworld seems to use an
-        * unsupported version of tda8295.
-        */
-               .tuner_type     = TUNER_NXP_TDA18271,   /* TUNER_PHILIPS_TDA8290 */
-               .tuner_addr     = 0x60,
-#else
-               .tuner_type     = UNSET,
+               .tuner_type     = TUNER_PHILIPS_TDA8290,
                .tuner_addr     = ADDR_UNSET,
-#endif
                .radio_type     = UNSET,
                .radio_addr     = ADDR_UNSET,
                .gpiomask       = 0x8e054000,
@@ -6932,10 +6922,17 @@ static inline int saa7134_kworld_sbtvd_toggle_agc(struct saa7134_dev *dev,
        /* toggle AGC switch through GPIO 27 */
        switch (mode) {
        case TDA18271_ANALOG:
-               saa7134_set_gpio(dev, 27, 0);
+               saa_writel(SAA7134_GPIO_GPMODE0 >> 2, 0x4000);
+               saa_writel(SAA7134_GPIO_GPSTATUS0 >> 2, 0x4000);
+               msleep(20);
                break;
        case TDA18271_DIGITAL:
-               saa7134_set_gpio(dev, 27, 1);
+               saa_writel(SAA7134_GPIO_GPMODE0 >> 2, 0x14000);
+               saa_writel(SAA7134_GPIO_GPSTATUS0 >> 2, 0x14000);
+               msleep(20);
+               saa_writel(SAA7134_GPIO_GPMODE0 >> 2, 0x54000);
+               saa_writel(SAA7134_GPIO_GPSTATUS0 >> 2, 0x54000);
+               msleep(30);
                break;
        default:
                return -EINVAL;
@@ -6993,6 +6990,7 @@ static int saa7134_tda8290_callback(struct saa7134_dev *dev,
 int saa7134_tuner_callback(void *priv, int component, int command, int arg)
 {
        struct saa7134_dev *dev = priv;
+
        if (dev != NULL) {
                switch (dev->tuner_type) {
                case TUNER_PHILIPS_TDA8290:
@@ -7659,36 +7657,11 @@ int saa7134_board_init2(struct saa7134_dev *dev)
                break;
        }
        case SAA7134_BOARD_KWORLD_PCI_SBTVD_FULLSEG:
-       {
-               struct i2c_msg msg = { .addr = 0x4b, .flags = 0 };
-               int i;
-               static u8 buffer[][2] = {
-                       {0x30, 0x31},
-                       {0xff, 0x00},
-                       {0x41, 0x03},
-                       {0x41, 0x1a},
-                       {0xff, 0x02},
-                       {0x34, 0x00},
-                       {0x45, 0x97},
-                       {0x45, 0xc1},
-               };
                saa_writel(SAA7134_GPIO_GPMODE0 >> 2, 0x4000);
                saa_writel(SAA7134_GPIO_GPSTATUS0 >> 2, 0x4000);
 
-               /*
-                * FIXME: identify what device is at addr 0x4b and what means
-                * this initialization
-                */
-               for (i = 0; i < ARRAY_SIZE(buffer); i++) {
-                       msg.buf = &buffer[i][0];
-                       msg.len = ARRAY_SIZE(buffer[0]);
-                       if (i2c_transfer(&dev->i2c_adap, &msg, 1) != 1)
-                               printk(KERN_WARNING
-                                      "%s: Unable to enable tuner(%i).\n",
-                                      dev->name, i);
-               }
+               saa7134_set_gpio(dev, 27, 0);
                break;
-       }
        } /* switch() */
 
        /* initialize tuner */
index 3315a48a848b682f437c1e500286b655fe7ef15b..f65cad287b83e198eacd21ff4b30f279f2783bb3 100644 (file)
@@ -237,12 +237,39 @@ static struct tda18271_std_map mb86a20s_tda18271_std_map = {
 static struct tda18271_config kworld_tda18271_config = {
        .std_map = &mb86a20s_tda18271_std_map,
        .gate    = TDA18271_GATE_DIGITAL,
+       .config  = 3,   /* Use tuner callback for AGC */
+
 };
 
 static const struct mb86a20s_config kworld_mb86a20s_config = {
        .demod_address = 0x10,
 };
 
+static int kworld_sbtvd_gate_ctrl(struct dvb_frontend* fe, int enable)
+{
+       struct saa7134_dev *dev = fe->dvb->priv;
+
+       unsigned char initmsg[] = {0x45, 0x97};
+       unsigned char msg_enable[] = {0x45, 0xc1};
+       unsigned char msg_disable[] = {0x45, 0x81};
+       struct i2c_msg msg = {.addr = 0x4b, .flags = 0, .buf = initmsg, .len = 2};
+
+       if (i2c_transfer(&dev->i2c_adap, &msg, 1) != 1) {
+               wprintk("could not access the I2C gate\n");
+               return -EIO;
+       }
+       if (enable)
+               msg.buf = msg_enable;
+       else
+               msg.buf = msg_disable;
+       if (i2c_transfer(&dev->i2c_adap, &msg, 1) != 1) {
+               wprintk("could not access the I2C gate\n");
+               return -EIO;
+       }
+       msleep(20);
+       return 0;
+}
+
 /* ==================================================================
  * tda1004x based DVB-T cards, helper functions
  */
@@ -623,37 +650,6 @@ static struct tda827x_config tda827x_cfg_2_sw42 = {
 
 /* ------------------------------------------------------------------ */
 
-static int __kworld_sbtvd_i2c_gate_ctrl(struct saa7134_dev *dev, int enable)
-{
-       unsigned char initmsg[] = {0x45, 0x97};
-       unsigned char msg_enable[] = {0x45, 0xc1};
-       unsigned char msg_disable[] = {0x45, 0x81};
-       struct i2c_msg msg = {.addr = 0x4b, .flags = 0, .buf = initmsg, .len = 2};
-
-       if (i2c_transfer(&dev->i2c_adap, &msg, 1) != 1) {
-               wprintk("could not access the I2C gate\n");
-               return -EIO;
-       }
-       if (enable)
-               msg.buf = msg_enable;
-       else
-               msg.buf = msg_disable;
-       if (i2c_transfer(&dev->i2c_adap, &msg, 1) != 1) {
-               wprintk("could not access the I2C gate\n");
-               return -EIO;
-       }
-       msleep(20);
-       return 0;
-}
-static int kworld_sbtvd_i2c_gate_ctrl(struct dvb_frontend *fe, int enable)
-{
-       struct saa7134_dev *dev = fe->dvb->priv;
-
-       return __kworld_sbtvd_i2c_gate_ctrl(dev, enable);
-}
-
-/* ------------------------------------------------------------------ */
-
 static struct tda1004x_config tda827x_lifeview_config = {
        .demod_address = 0x08,
        .invert        = 1,
@@ -1660,27 +1656,23 @@ static int dvb_init(struct saa7134_dev *dev)
                }
                break;
        case SAA7134_BOARD_KWORLD_PCI_SBTVD_FULLSEG:
-               __kworld_sbtvd_i2c_gate_ctrl(dev, 0);
-               saa_writel(SAA7134_GPIO_GPMODE0 >> 2, 0x14000);
-               saa_writel(SAA7134_GPIO_GPSTATUS0 >> 2, 0x14000);
-               msleep(20);
-               saa_writel(SAA7134_GPIO_GPMODE0 >> 2, 0x54000);
-               saa_writel(SAA7134_GPIO_GPSTATUS0 >> 2, 0x54000);
-               msleep(20);
+               /* Switch to digital mode */
+               saa7134_tuner_callback(dev, 0,
+                                      TDA18271_CALLBACK_CMD_AGC_ENABLE, 1);
                fe0->dvb.frontend = dvb_attach(mb86a20s_attach,
                                               &kworld_mb86a20s_config,
                                               &dev->i2c_adap);
-               __kworld_sbtvd_i2c_gate_ctrl(dev, 1);
                if (fe0->dvb.frontend != NULL) {
+                       dvb_attach(tda829x_attach, fe0->dvb.frontend,
+                                  &dev->i2c_adap, 0x4b,
+                                  &tda829x_no_probe);
                        dvb_attach(tda18271_attach, fe0->dvb.frontend,
                                   0x60, &dev->i2c_adap,
                                   &kworld_tda18271_config);
-                       /*
-                        * Only after success, it can initialize the gate, otherwise
-                        * an OOPS will hit, due to kfree(fe0->dvb.frontend)
-                        */
-                       fe0->dvb.frontend->ops.i2c_gate_ctrl = kworld_sbtvd_i2c_gate_ctrl;
+                       fe0->dvb.frontend->ops.i2c_gate_ctrl = kworld_sbtvd_gate_ctrl;
                }
+
+               /* mb86a20s need to use the I2C gateway */
                break;
        default:
                wprintk("Huh? unknown DVB card?\n");
index 41064c7b5ef8d896e2deb133fb89b10e72d09df3..b3d2cc729657df34e57bc300033bafc1baf2bdd6 100644 (file)
@@ -47,8 +47,8 @@ static const struct usb_device_id sn9c102_id_table[] = {
        { SN9C102_USB_DEVICE(0x0c45, 0x6009, BRIDGE_SN9C102), },
        { SN9C102_USB_DEVICE(0x0c45, 0x600d, BRIDGE_SN9C102), },
 /*     { SN9C102_USB_DEVICE(0x0c45, 0x6011, BRIDGE_SN9C102), }, OV6650 */
-#endif
        { SN9C102_USB_DEVICE(0x0c45, 0x6019, BRIDGE_SN9C102), },
+#endif
        { SN9C102_USB_DEVICE(0x0c45, 0x6024, BRIDGE_SN9C102), },
        { SN9C102_USB_DEVICE(0x0c45, 0x6025, BRIDGE_SN9C102), },
 #if !defined CONFIG_USB_GSPCA_SONIXB && !defined CONFIG_USB_GSPCA_SONIXB_MODULE
@@ -56,78 +56,68 @@ static const struct usb_device_id sn9c102_id_table[] = {
        { SN9C102_USB_DEVICE(0x0c45, 0x6029, BRIDGE_SN9C102), },
        { SN9C102_USB_DEVICE(0x0c45, 0x602a, BRIDGE_SN9C102), },
 #endif
-       { SN9C102_USB_DEVICE(0x0c45, 0x602b, BRIDGE_SN9C102), },
+       { SN9C102_USB_DEVICE(0x0c45, 0x602b, BRIDGE_SN9C102), }, /* not in sonixb */
 #if !defined CONFIG_USB_GSPCA_SONIXB && !defined CONFIG_USB_GSPCA_SONIXB_MODULE
        { SN9C102_USB_DEVICE(0x0c45, 0x602c, BRIDGE_SN9C102), },
 /*     { SN9C102_USB_DEVICE(0x0c45, 0x602d, BRIDGE_SN9C102), }, HV7131R */
        { SN9C102_USB_DEVICE(0x0c45, 0x602e, BRIDGE_SN9C102), },
 #endif
-       { SN9C102_USB_DEVICE(0x0c45, 0x6030, BRIDGE_SN9C102), },
+       { SN9C102_USB_DEVICE(0x0c45, 0x6030, BRIDGE_SN9C102), }, /* not in sonixb */
        /* SN9C103 */
-       { SN9C102_USB_DEVICE(0x0c45, 0x6080, BRIDGE_SN9C103), },
-       { SN9C102_USB_DEVICE(0x0c45, 0x6082, BRIDGE_SN9C103), },
+/*     { SN9C102_USB_DEVICE(0x0c45, 0x6080, BRIDGE_SN9C103), }, non existent ? */
+       { SN9C102_USB_DEVICE(0x0c45, 0x6082, BRIDGE_SN9C103), }, /* not in sonixb */
+#if !defined CONFIG_USB_GSPCA_SONIXB && !defined CONFIG_USB_GSPCA_SONIXB_MODULE
 /*     { SN9C102_USB_DEVICE(0x0c45, 0x6083, BRIDGE_SN9C103), }, HY7131D/E */
-       { SN9C102_USB_DEVICE(0x0c45, 0x6088, BRIDGE_SN9C103), },
-       { SN9C102_USB_DEVICE(0x0c45, 0x608a, BRIDGE_SN9C103), },
-       { SN9C102_USB_DEVICE(0x0c45, 0x608b, BRIDGE_SN9C103), },
+/*     { SN9C102_USB_DEVICE(0x0c45, 0x6088, BRIDGE_SN9C103), }, non existent ? */
+/*     { SN9C102_USB_DEVICE(0x0c45, 0x608a, BRIDGE_SN9C103), }, non existent ? */
+/*     { SN9C102_USB_DEVICE(0x0c45, 0x608b, BRIDGE_SN9C103), }, non existent ? */
        { SN9C102_USB_DEVICE(0x0c45, 0x608c, BRIDGE_SN9C103), },
 /*     { SN9C102_USB_DEVICE(0x0c45, 0x608e, BRIDGE_SN9C103), }, CISVF10 */
-#if !defined CONFIG_USB_GSPCA_SONIXB && !defined CONFIG_USB_GSPCA_SONIXB_MODULE
        { SN9C102_USB_DEVICE(0x0c45, 0x608f, BRIDGE_SN9C103), },
-#endif
-       { SN9C102_USB_DEVICE(0x0c45, 0x60a0, BRIDGE_SN9C103), },
-       { SN9C102_USB_DEVICE(0x0c45, 0x60a2, BRIDGE_SN9C103), },
-       { SN9C102_USB_DEVICE(0x0c45, 0x60a3, BRIDGE_SN9C103), },
+/*     { SN9C102_USB_DEVICE(0x0c45, 0x60a0, BRIDGE_SN9C103), }, non existent ? */
+/*     { SN9C102_USB_DEVICE(0x0c45, 0x60a2, BRIDGE_SN9C103), }, non existent ? */
+/*     { SN9C102_USB_DEVICE(0x0c45, 0x60a3, BRIDGE_SN9C103), }, non existent ? */
 /*     { SN9C102_USB_DEVICE(0x0c45, 0x60a8, BRIDGE_SN9C103), }, PAS106 */
 /*     { SN9C102_USB_DEVICE(0x0c45, 0x60aa, BRIDGE_SN9C103), }, TAS5130 */
-/*     { SN9C102_USB_DEVICE(0x0c45, 0x60ab, BRIDGE_SN9C103), }, TAS5130 */
-       { SN9C102_USB_DEVICE(0x0c45, 0x60ac, BRIDGE_SN9C103), },
-       { SN9C102_USB_DEVICE(0x0c45, 0x60ae, BRIDGE_SN9C103), },
+/*     { SN9C102_USB_DEVICE(0x0c45, 0x60ab, BRIDGE_SN9C103), }, TAS5110, non existent */
+/*     { SN9C102_USB_DEVICE(0x0c45, 0x60ac, BRIDGE_SN9C103), }, non existent ? */
+/*     { SN9C102_USB_DEVICE(0x0c45, 0x60ae, BRIDGE_SN9C103), }, non existent ? */
        { SN9C102_USB_DEVICE(0x0c45, 0x60af, BRIDGE_SN9C103), },
-#if !defined CONFIG_USB_GSPCA_SONIXB && !defined CONFIG_USB_GSPCA_SONIXB_MODULE
        { SN9C102_USB_DEVICE(0x0c45, 0x60b0, BRIDGE_SN9C103), },
+/*     { SN9C102_USB_DEVICE(0x0c45, 0x60b2, BRIDGE_SN9C103), }, non existent ? */
+/*     { SN9C102_USB_DEVICE(0x0c45, 0x60b3, BRIDGE_SN9C103), }, non existent ? */
+/*     { SN9C102_USB_DEVICE(0x0c45, 0x60b8, BRIDGE_SN9C103), }, non existent ? */
+/*     { SN9C102_USB_DEVICE(0x0c45, 0x60ba, BRIDGE_SN9C103), }, non existent ? */
+/*     { SN9C102_USB_DEVICE(0x0c45, 0x60bb, BRIDGE_SN9C103), }, non existent ? */
+/*     { SN9C102_USB_DEVICE(0x0c45, 0x60bc, BRIDGE_SN9C103), }, non existent ? */
+/*     { SN9C102_USB_DEVICE(0x0c45, 0x60be, BRIDGE_SN9C103), }, non existent ? */
 #endif
-       { SN9C102_USB_DEVICE(0x0c45, 0x60b2, BRIDGE_SN9C103), },
-       { SN9C102_USB_DEVICE(0x0c45, 0x60b3, BRIDGE_SN9C103), },
-       { SN9C102_USB_DEVICE(0x0c45, 0x60b8, BRIDGE_SN9C103), },
-       { SN9C102_USB_DEVICE(0x0c45, 0x60ba, BRIDGE_SN9C103), },
-       { SN9C102_USB_DEVICE(0x0c45, 0x60bb, BRIDGE_SN9C103), },
-       { SN9C102_USB_DEVICE(0x0c45, 0x60bc, BRIDGE_SN9C103), },
-       { SN9C102_USB_DEVICE(0x0c45, 0x60be, BRIDGE_SN9C103), },
        /* SN9C105 */
 #if !defined CONFIG_USB_GSPCA_SONIXJ && !defined CONFIG_USB_GSPCA_SONIXJ_MODULE
        { SN9C102_USB_DEVICE(0x045e, 0x00f5, BRIDGE_SN9C105), },
        { SN9C102_USB_DEVICE(0x045e, 0x00f7, BRIDGE_SN9C105), },
        { SN9C102_USB_DEVICE(0x0471, 0x0327, BRIDGE_SN9C105), },
        { SN9C102_USB_DEVICE(0x0471, 0x0328, BRIDGE_SN9C105), },
-#endif
        { SN9C102_USB_DEVICE(0x0c45, 0x60c0, BRIDGE_SN9C105), },
-       { SN9C102_USB_DEVICE(0x0c45, 0x60c2, BRIDGE_SN9C105), },
-       { SN9C102_USB_DEVICE(0x0c45, 0x60c8, BRIDGE_SN9C105), },
-       { SN9C102_USB_DEVICE(0x0c45, 0x60cc, BRIDGE_SN9C105), },
-       { SN9C102_USB_DEVICE(0x0c45, 0x60ea, BRIDGE_SN9C105), },
-       { SN9C102_USB_DEVICE(0x0c45, 0x60ec, BRIDGE_SN9C105), },
-       { SN9C102_USB_DEVICE(0x0c45, 0x60ef, BRIDGE_SN9C105), },
-       { SN9C102_USB_DEVICE(0x0c45, 0x60fa, BRIDGE_SN9C105), },
+/*     { SN9C102_USB_DEVICE(0x0c45, 0x60c2, BRIDGE_SN9C105), }, PO1030 */
+/*     { SN9C102_USB_DEVICE(0x0c45, 0x60c8, BRIDGE_SN9C105), }, OM6801 */
+/*     { SN9C102_USB_DEVICE(0x0c45, 0x60cc, BRIDGE_SN9C105), }, HV7131GP */
+/*     { SN9C102_USB_DEVICE(0x0c45, 0x60ea, BRIDGE_SN9C105), }, non existent ? */
+/*     { SN9C102_USB_DEVICE(0x0c45, 0x60ec, BRIDGE_SN9C105), }, MO4000 */
+/*     { SN9C102_USB_DEVICE(0x0c45, 0x60ef, BRIDGE_SN9C105), }, ICM105C */
+/*     { SN9C102_USB_DEVICE(0x0c45, 0x60fa, BRIDGE_SN9C105), }, OV7648 */
        { SN9C102_USB_DEVICE(0x0c45, 0x60fb, BRIDGE_SN9C105), },
        { SN9C102_USB_DEVICE(0x0c45, 0x60fc, BRIDGE_SN9C105), },
        { SN9C102_USB_DEVICE(0x0c45, 0x60fe, BRIDGE_SN9C105), },
        /* SN9C120 */
        { SN9C102_USB_DEVICE(0x0458, 0x7025, BRIDGE_SN9C120), },
-#if !defined CONFIG_USB_GSPCA_SONIXJ && !defined CONFIG_USB_GSPCA_SONIXJ_MODULE
-       { SN9C102_USB_DEVICE(0x0c45, 0x6102, BRIDGE_SN9C120), },
-#endif
-       { SN9C102_USB_DEVICE(0x0c45, 0x6108, BRIDGE_SN9C120), },
-       { SN9C102_USB_DEVICE(0x0c45, 0x610f, BRIDGE_SN9C120), },
-#if !defined CONFIG_USB_GSPCA_SONIXJ && !defined CONFIG_USB_GSPCA_SONIXJ_MODULE
+/*     { SN9C102_USB_DEVICE(0x0c45, 0x6102, BRIDGE_SN9C120), }, po2030 */
+/*     { SN9C102_USB_DEVICE(0x0c45, 0x6108, BRIDGE_SN9C120), }, om6801 */
+/*     { SN9C102_USB_DEVICE(0x0c45, 0x610f, BRIDGE_SN9C120), }, S5K53BEB */
        { SN9C102_USB_DEVICE(0x0c45, 0x6130, BRIDGE_SN9C120), },
-#endif
 /*     { SN9C102_USB_DEVICE(0x0c45, 0x6138, BRIDGE_SN9C120), }, MO8000 */
-#if !defined CONFIG_USB_GSPCA_SONIXJ && !defined CONFIG_USB_GSPCA_SONIXJ_MODULE
        { SN9C102_USB_DEVICE(0x0c45, 0x613a, BRIDGE_SN9C120), },
-#endif
        { SN9C102_USB_DEVICE(0x0c45, 0x613b, BRIDGE_SN9C120), },
-#if !defined CONFIG_USB_GSPCA_SONIXJ && !defined CONFIG_USB_GSPCA_SONIXJ_MODULE
        { SN9C102_USB_DEVICE(0x0c45, 0x613c, BRIDGE_SN9C120), },
        { SN9C102_USB_DEVICE(0x0c45, 0x613e, BRIDGE_SN9C120), },
 #endif
index 864696b7a006e5e3ca8965dd33e23d0d59c6128f..c901721a1db3e7380d25a71da9b3597a5837cf66 100644 (file)
@@ -714,15 +714,6 @@ static int sr030pc30_base_config(struct v4l2_subdev *sd)
        return ret;
 }
 
-static int sr030pc30_s_config(struct v4l2_subdev *sd,
-                             int irq, void *platform_data)
-{
-       struct sr030pc30_info *info = to_sr030pc30(sd);
-
-       info->pdata = platform_data;
-       return 0;
-}
-
 static int sr030pc30_s_stream(struct v4l2_subdev *sd, int enable)
 {
        return 0;
@@ -763,7 +754,6 @@ static int sr030pc30_s_power(struct v4l2_subdev *sd, int on)
 }
 
 static const struct v4l2_subdev_core_ops sr030pc30_core_ops = {
-       .s_config       = sr030pc30_s_config,
        .s_power        = sr030pc30_s_power,
        .queryctrl      = sr030pc30_queryctrl,
        .s_ctrl         = sr030pc30_s_ctrl,
diff --git a/drivers/media/video/tda9875.c b/drivers/media/video/tda9875.c
deleted file mode 100644 (file)
index 35b6ff5..0000000
+++ /dev/null
@@ -1,411 +0,0 @@
-/*
- * For the TDA9875 chip
- * (The TDA9875 is used on the Diamond DTV2000 french version
- * Other cards probably use these chips as well.)
- * This driver will not complain if used with any
- * other i2c device with the same address.
- *
- * Copyright (c) 2000 Guillaume Delvit based on Gerd Knorr source and
- * Eric Sandeen
- * Copyright (c) 2006 Mauro Carvalho Chehab <mchehab@infradead.org>
- * This code is placed under the terms of the GNU General Public License
- * Based on tda9855.c by Steve VanDeBogart (vandebo@uclink.berkeley.edu)
- * Which was based on tda8425.c by Greg Alexander (c) 1998
- *
- * OPTIONS:
- * debug   - set to 1 if you'd like to see debug messages
- *
- *  Revision: 0.1 - original version
- */
-
-#include <linux/module.h>
-#include <linux/kernel.h>
-#include <linux/string.h>
-#include <linux/timer.h>
-#include <linux/delay.h>
-#include <linux/errno.h>
-#include <linux/slab.h>
-#include <linux/i2c.h>
-#include <linux/videodev2.h>
-#include <media/v4l2-device.h>
-#include <media/i2c-addr.h>
-
-static int debug; /* insmod parameter */
-module_param(debug, int, S_IRUGO | S_IWUSR);
-MODULE_LICENSE("GPL");
-
-
-/* This is a superset of the TDA9875 */
-struct tda9875 {
-       struct v4l2_subdev sd;
-       int rvol, lvol;
-       int bass, treble;
-};
-
-static inline struct tda9875 *to_state(struct v4l2_subdev *sd)
-{
-       return container_of(sd, struct tda9875, sd);
-}
-
-#define dprintk  if (debug) printk
-
-/* The TDA9875 is made by Philips Semiconductor
- * http://www.semiconductors.philips.com
- * TDA9875: I2C-bus controlled DSP audio processor, FM demodulator
- *
- */
-
-               /* subaddresses for TDA9875 */
-#define TDA9875_MUT         0x12  /*General mute  (value --> 0b11001100*/
-#define TDA9875_CFG         0x01  /* Config register (value --> 0b00000000 */
-#define TDA9875_DACOS       0x13  /*DAC i/o select (ADC) 0b0000100*/
-#define TDA9875_LOSR        0x16  /*Line output select regirter 0b0100 0001*/
-
-#define TDA9875_CH1V        0x0c  /*Channel 1 volume (mute)*/
-#define TDA9875_CH2V        0x0d  /*Channel 2 volume (mute)*/
-#define TDA9875_SC1         0x14  /*SCART 1 in (mono)*/
-#define TDA9875_SC2         0x15  /*SCART 2 in (mono)*/
-
-#define TDA9875_ADCIS       0x17  /*ADC input select (mono) 0b0110 000*/
-#define TDA9875_AER         0x19  /*Audio effect (AVL+Pseudo) 0b0000 0110*/
-#define TDA9875_MCS         0x18  /*Main channel select (DAC) 0b0000100*/
-#define TDA9875_MVL         0x1a  /* Main volume gauche */
-#define TDA9875_MVR         0x1b  /* Main volume droite */
-#define TDA9875_MBA         0x1d  /* Main Basse */
-#define TDA9875_MTR         0x1e  /* Main treble */
-#define TDA9875_ACS         0x1f  /* Auxilary channel select (FM) 0b0000000*/
-#define TDA9875_AVL         0x20  /* Auxilary volume gauche */
-#define TDA9875_AVR         0x21  /* Auxilary volume droite */
-#define TDA9875_ABA         0x22  /* Auxilary Basse */
-#define TDA9875_ATR         0x23  /* Auxilary treble */
-
-#define TDA9875_MSR         0x02  /* Monitor select register */
-#define TDA9875_C1MSB       0x03  /* Carrier 1 (FM) frequency register MSB */
-#define TDA9875_C1MIB       0x04  /* Carrier 1 (FM) frequency register (16-8]b */
-#define TDA9875_C1LSB       0x05  /* Carrier 1 (FM) frequency register LSB */
-#define TDA9875_C2MSB       0x06  /* Carrier 2 (nicam) frequency register MSB */
-#define TDA9875_C2MIB       0x07  /* Carrier 2 (nicam) frequency register (16-8]b */
-#define TDA9875_C2LSB       0x08  /* Carrier 2 (nicam) frequency register LSB */
-#define TDA9875_DCR         0x09  /* Demodulateur configuration regirter*/
-#define TDA9875_DEEM        0x0a  /* FM de-emphasis regirter*/
-#define TDA9875_FMAT        0x0b  /* FM Matrix regirter*/
-
-/* values */
-#define TDA9875_MUTE_ON            0xff /* general mute */
-#define TDA9875_MUTE_OFF    0xcc /* general no mute */
-
-
-
-/* Begin code */
-
-static int tda9875_write(struct v4l2_subdev *sd, int subaddr, unsigned char val)
-{
-       struct i2c_client *client = v4l2_get_subdevdata(sd);
-       unsigned char buffer[2];
-
-       v4l2_dbg(1, debug, sd, "Writing %d 0x%x\n", subaddr, val);
-       buffer[0] = subaddr;
-       buffer[1] = val;
-       if (2 != i2c_master_send(client, buffer, 2)) {
-               v4l2_warn(sd, "I/O error, trying (write %d 0x%x)\n",
-                      subaddr, val);
-               return -1;
-       }
-       return 0;
-}
-
-
-static int i2c_read_register(struct i2c_client *client, int addr, int reg)
-{
-       unsigned char write[1];
-       unsigned char read[1];
-       struct i2c_msg msgs[2] = {
-               { addr, 0,        1, write },
-               { addr, I2C_M_RD, 1, read  }
-       };
-
-       write[0] = reg;
-
-       if (2 != i2c_transfer(client->adapter, msgs, 2)) {
-               v4l_warn(client, "I/O error (read2)\n");
-               return -1;
-       }
-       v4l_dbg(1, debug, client, "chip_read2: reg%d=0x%x\n", reg, read[0]);
-       return read[0];
-}
-
-static void tda9875_set(struct v4l2_subdev *sd)
-{
-       struct tda9875 *tda = to_state(sd);
-       unsigned char a;
-
-       v4l2_dbg(1, debug, sd, "tda9875_set(%04x,%04x,%04x,%04x)\n",
-               tda->lvol, tda->rvol, tda->bass, tda->treble);
-
-       a = tda->lvol & 0xff;
-       tda9875_write(sd, TDA9875_MVL, a);
-       a =tda->rvol & 0xff;
-       tda9875_write(sd, TDA9875_MVR, a);
-       a =tda->bass & 0xff;
-       tda9875_write(sd, TDA9875_MBA, a);
-       a =tda->treble  & 0xff;
-       tda9875_write(sd, TDA9875_MTR, a);
-}
-
-static void do_tda9875_init(struct v4l2_subdev *sd)
-{
-       struct tda9875 *t = to_state(sd);
-
-       v4l2_dbg(1, debug, sd, "In tda9875_init\n");
-       tda9875_write(sd, TDA9875_CFG, 0xd0); /*reg de config 0 (reset)*/
-       tda9875_write(sd, TDA9875_MSR, 0x03);    /* Monitor 0b00000XXX*/
-       tda9875_write(sd, TDA9875_C1MSB, 0x00);  /*Car1(FM) MSB XMHz*/
-       tda9875_write(sd, TDA9875_C1MIB, 0x00);  /*Car1(FM) MIB XMHz*/
-       tda9875_write(sd, TDA9875_C1LSB, 0x00);  /*Car1(FM) LSB XMHz*/
-       tda9875_write(sd, TDA9875_C2MSB, 0x00);  /*Car2(NICAM) MSB XMHz*/
-       tda9875_write(sd, TDA9875_C2MIB, 0x00);  /*Car2(NICAM) MIB XMHz*/
-       tda9875_write(sd, TDA9875_C2LSB, 0x00);  /*Car2(NICAM) LSB XMHz*/
-       tda9875_write(sd, TDA9875_DCR, 0x00);    /*Demod config 0x00*/
-       tda9875_write(sd, TDA9875_DEEM, 0x44);   /*DE-Emph 0b0100 0100*/
-       tda9875_write(sd, TDA9875_FMAT, 0x00);   /*FM Matrix reg 0x00*/
-       tda9875_write(sd, TDA9875_SC1, 0x00);    /* SCART 1 (SC1)*/
-       tda9875_write(sd, TDA9875_SC2, 0x01);    /* SCART 2 (sc2)*/
-
-       tda9875_write(sd, TDA9875_CH1V, 0x10);  /* Channel volume 1 mute*/
-       tda9875_write(sd, TDA9875_CH2V, 0x10);  /* Channel volume 2 mute */
-       tda9875_write(sd, TDA9875_DACOS, 0x02); /* sig DAC i/o(in:nicam)*/
-       tda9875_write(sd, TDA9875_ADCIS, 0x6f); /* sig ADC input(in:mono)*/
-       tda9875_write(sd, TDA9875_LOSR, 0x00);  /* line out (in:mono)*/
-       tda9875_write(sd, TDA9875_AER, 0x00);   /*06 Effect (AVL+PSEUDO) */
-       tda9875_write(sd, TDA9875_MCS, 0x44);   /* Main ch select (DAC) */
-       tda9875_write(sd, TDA9875_MVL, 0x03);   /* Vol Main left 10dB */
-       tda9875_write(sd, TDA9875_MVR, 0x03);   /* Vol Main right 10dB*/
-       tda9875_write(sd, TDA9875_MBA, 0x00);   /* Main Bass Main 0dB*/
-       tda9875_write(sd, TDA9875_MTR, 0x00);   /* Main Treble Main 0dB*/
-       tda9875_write(sd, TDA9875_ACS, 0x44);   /* Aux chan select (dac)*/
-       tda9875_write(sd, TDA9875_AVL, 0x00);   /* Vol Aux left 0dB*/
-       tda9875_write(sd, TDA9875_AVR, 0x00);   /* Vol Aux right 0dB*/
-       tda9875_write(sd, TDA9875_ABA, 0x00);   /* Aux Bass Main 0dB*/
-       tda9875_write(sd, TDA9875_ATR, 0x00);   /* Aux Aigus Main 0dB*/
-
-       tda9875_write(sd, TDA9875_MUT, 0xcc);   /* General mute  */
-
-       t->lvol = t->rvol = 0;          /* 0dB */
-       t->bass = 0;                    /* 0dB */
-       t->treble = 0;                  /* 0dB */
-       tda9875_set(sd);
-}
-
-
-static int tda9875_g_ctrl(struct v4l2_subdev *sd, struct v4l2_control *ctrl)
-{
-       struct tda9875 *t = to_state(sd);
-
-       switch (ctrl->id) {
-       case V4L2_CID_AUDIO_VOLUME:
-       {
-               int left = (t->lvol+84)*606;
-               int right = (t->rvol+84)*606;
-
-               ctrl->value=max(left,right);
-               return 0;
-       }
-       case V4L2_CID_AUDIO_BALANCE:
-       {
-               int left = (t->lvol+84)*606;
-               int right = (t->rvol+84)*606;
-               int volume = max(left,right);
-               int balance = (32768*min(left,right))/
-                             (volume ? volume : 1);
-               ctrl->value=(left<right)?
-                       (65535-balance) : balance;
-               return 0;
-       }
-       case V4L2_CID_AUDIO_BASS:
-               ctrl->value = (t->bass+12)*2427;    /* min -12 max +15 */
-               return 0;
-       case V4L2_CID_AUDIO_TREBLE:
-               ctrl->value = (t->treble+12)*2730;/* min -12 max +12 */
-               return 0;
-       }
-       return -EINVAL;
-}
-
-static int tda9875_s_ctrl(struct v4l2_subdev *sd, struct v4l2_control *ctrl)
-{
-       struct tda9875 *t = to_state(sd);
-       int chvol = 0, volume = 0, balance = 0, left, right;
-
-       switch (ctrl->id) {
-       case V4L2_CID_AUDIO_VOLUME:
-               left = (t->lvol+84)*606;
-               right = (t->rvol+84)*606;
-
-               volume = max(left,right);
-               balance = (32768*min(left,right))/
-                             (volume ? volume : 1);
-               balance =(left<right)?
-                       (65535-balance) : balance;
-
-               volume = ctrl->value;
-
-               chvol=1;
-               break;
-       case V4L2_CID_AUDIO_BALANCE:
-               left = (t->lvol+84)*606;
-               right = (t->rvol+84)*606;
-
-               volume=max(left,right);
-
-               balance = ctrl->value;
-
-               chvol=1;
-               break;
-       case V4L2_CID_AUDIO_BASS:
-               t->bass = ((ctrl->value/2400)-12) & 0xff;
-               if (t->bass > 15)
-                       t->bass = 15;
-               if (t->bass < -12)
-                       t->bass = -12 & 0xff;
-               break;
-       case V4L2_CID_AUDIO_TREBLE:
-               t->treble = ((ctrl->value/2700)-12) & 0xff;
-               if (t->treble > 12)
-                       t->treble = 12;
-               if (t->treble < -12)
-                       t->treble = -12 & 0xff;
-               break;
-       default:
-               return -EINVAL;
-       }
-
-       if (chvol) {
-               left = (min(65536 - balance,32768) *
-                       volume) / 32768;
-               right = (min(balance,32768) *
-                               volume) / 32768;
-               t->lvol = ((left/606)-84) & 0xff;
-               if (t->lvol > 24)
-                       t->lvol = 24;
-               if (t->lvol < -84)
-                       t->lvol = -84 & 0xff;
-
-               t->rvol = ((right/606)-84) & 0xff;
-               if (t->rvol > 24)
-                       t->rvol = 24;
-               if (t->rvol < -84)
-                       t->rvol = -84 & 0xff;
-       }
-
-       tda9875_set(sd);
-       return 0;
-}
-
-static int tda9875_queryctrl(struct v4l2_subdev *sd, struct v4l2_queryctrl *qc)
-{
-       switch (qc->id) {
-       case V4L2_CID_AUDIO_VOLUME:
-               return v4l2_ctrl_query_fill(qc, 0, 65535, 65535 / 100, 58880);
-       case V4L2_CID_AUDIO_BASS:
-       case V4L2_CID_AUDIO_TREBLE:
-               return v4l2_ctrl_query_fill(qc, 0, 65535, 65535 / 100, 32768);
-       }
-       return -EINVAL;
-}
-
-/* ----------------------------------------------------------------------- */
-
-static const struct v4l2_subdev_core_ops tda9875_core_ops = {
-       .queryctrl = tda9875_queryctrl,
-       .g_ctrl = tda9875_g_ctrl,
-       .s_ctrl = tda9875_s_ctrl,
-};
-
-static const struct v4l2_subdev_ops tda9875_ops = {
-       .core = &tda9875_core_ops,
-};
-
-/* ----------------------------------------------------------------------- */
-
-
-/* *********************** *
- * i2c interface functions *
- * *********************** */
-
-static int tda9875_checkit(struct i2c_client *client, int addr)
-{
-       int dic, rev;
-
-       dic = i2c_read_register(client, addr, 254);
-       rev = i2c_read_register(client, addr, 255);
-
-       if (dic == 0 || dic == 2) { /* tda9875 and tda9875A */
-               v4l_info(client, "tda9875%s rev. %d detected at 0x%02x\n",
-                       dic == 0 ? "" : "A", rev, addr << 1);
-               return 1;
-       }
-       v4l_info(client, "no such chip at 0x%02x (dic=0x%x rev=0x%x)\n",
-                       addr << 1, dic, rev);
-       return 0;
-}
-
-static int tda9875_probe(struct i2c_client *client,
-                       const struct i2c_device_id *id)
-{
-       struct tda9875 *t;
-       struct v4l2_subdev *sd;
-
-       v4l_info(client, "chip found @ 0x%02x (%s)\n",
-                       client->addr << 1, client->adapter->name);
-
-       if (!tda9875_checkit(client, client->addr))
-               return -ENODEV;
-
-       t = kzalloc(sizeof(*t), GFP_KERNEL);
-       if (!t)
-               return -ENOMEM;
-       sd = &t->sd;
-       v4l2_i2c_subdev_init(sd, client, &tda9875_ops);
-
-       do_tda9875_init(sd);
-       return 0;
-}
-
-static int tda9875_remove(struct i2c_client *client)
-{
-       struct v4l2_subdev *sd = i2c_get_clientdata(client);
-
-       do_tda9875_init(sd);
-       v4l2_device_unregister_subdev(sd);
-       kfree(to_state(sd));
-       return 0;
-}
-
-static const struct i2c_device_id tda9875_id[] = {
-       { "tda9875", 0 },
-       { }
-};
-MODULE_DEVICE_TABLE(i2c, tda9875_id);
-
-static struct i2c_driver tda9875_driver = {
-       .driver = {
-               .owner  = THIS_MODULE,
-               .name   = "tda9875",
-       },
-       .probe          = tda9875_probe,
-       .remove         = tda9875_remove,
-       .id_table       = tda9875_id,
-};
-
-static __init int init_tda9875(void)
-{
-       return i2c_add_driver(&tda9875_driver);
-}
-
-static __exit void exit_tda9875(void)
-{
-       i2c_del_driver(&tda9875_driver);
-}
-
-module_init(init_tda9875);
-module_exit(exit_tda9875);
index a1ffe18640fe95778a6a1feca3e35aaa4d17416c..df33a1d188bbf1224716961cca57e79bd1afd17e 100644 (file)
@@ -512,19 +512,20 @@ int alloc_bulk_urbs_generic(struct urb **urb_array, int num,
                        int buf_size, gfp_t gfp_flags,
                        usb_complete_t complete_fn, void *context)
 {
-       struct urb *urb;
-       void *mem;
-       int i;
+       int i = 0;
 
-       for (i = 0; i < num; i++) {
-               urb = usb_alloc_urb(0, gfp_flags);
+       for (; i < num; i++) {
+               void *mem;
+               struct urb *urb = usb_alloc_urb(0, gfp_flags);
                if (urb == NULL)
                        return i;
 
                mem = usb_alloc_coherent(udev, buf_size, gfp_flags,
                                         &urb->transfer_dma);
-               if (mem == NULL)
+               if (mem == NULL) {
+                       usb_free_urb(urb);
                        return i;
+               }
 
                usb_fill_bulk_urb(urb, udev, usb_rcvbulkpipe(udev, ep_addr),
                                mem, buf_size, complete_fn, context);
index 3f0871b550ad0dd030f0d99027f44ed9ea0ffc93..810eef43c216b86e153ad5b08fe8a432f2609986 100644 (file)
@@ -407,18 +407,6 @@ struct v4l2_subdev *v4l2_i2c_new_subdev_board(struct v4l2_device *v4l2_dev,
        /* Decrease the module use count to match the first try_module_get. */
        module_put(client->driver->driver.owner);
 
-       if (sd) {
-               /* We return errors from v4l2_subdev_call only if we have the
-                  callback as the .s_config is not mandatory */
-               int err = v4l2_subdev_call(sd, core, s_config,
-                               info->irq, info->platform_data);
-
-               if (err && err != -ENOIOCTLCMD) {
-                       v4l2_device_unregister_subdev(sd);
-                       sd = NULL;
-               }
-       }
-
 error:
        /* If we have a client but no subdev, then something went wrong and
           we must unregister the client. */
@@ -428,9 +416,8 @@ error:
 }
 EXPORT_SYMBOL_GPL(v4l2_i2c_new_subdev_board);
 
-struct v4l2_subdev *v4l2_i2c_new_subdev_cfg(struct v4l2_device *v4l2_dev,
+struct v4l2_subdev *v4l2_i2c_new_subdev(struct v4l2_device *v4l2_dev,
                struct i2c_adapter *adapter, const char *client_type,
-               int irq, void *platform_data,
                u8 addr, const unsigned short *probe_addrs)
 {
        struct i2c_board_info info;
@@ -440,12 +427,10 @@ struct v4l2_subdev *v4l2_i2c_new_subdev_cfg(struct v4l2_device *v4l2_dev,
        memset(&info, 0, sizeof(info));
        strlcpy(info.type, client_type, sizeof(info.type));
        info.addr = addr;
-       info.irq = irq;
-       info.platform_data = platform_data;
 
        return v4l2_i2c_new_subdev_board(v4l2_dev, adapter, &info, probe_addrs);
 }
-EXPORT_SYMBOL_GPL(v4l2_i2c_new_subdev_cfg);
+EXPORT_SYMBOL_GPL(v4l2_i2c_new_subdev);
 
 /* Return i2c client address of v4l2_subdev. */
 unsigned short v4l2_i2c_subdev_addr(struct v4l2_subdev *sd)
index 8f81efcfcf56a7d9e481878a1723255170af7446..ef66d2af0c57c8adea19be12ad78e2b1c754883b 100644 (file)
@@ -569,7 +569,7 @@ static int user_to_new(struct v4l2_ext_control *c,
        int ret;
        u32 size;
 
-       ctrl->has_new = 1;
+       ctrl->is_new = 1;
        switch (ctrl->type) {
        case V4L2_CTRL_TYPE_INTEGER64:
                ctrl->val64 = c->value64;
@@ -1280,8 +1280,12 @@ int v4l2_ctrl_handler_setup(struct v4l2_ctrl_handler *hdl)
                if (ctrl->done)
                        continue;
 
-               for (i = 0; i < master->ncontrols; i++)
-                       cur_to_new(master->cluster[i]);
+               for (i = 0; i < master->ncontrols; i++) {
+                       if (master->cluster[i]) {
+                               cur_to_new(master->cluster[i]);
+                               master->cluster[i]->is_new = 1;
+                       }
+               }
 
                /* Skip button controls and read-only controls. */
                if (ctrl->type == V4L2_CTRL_TYPE_BUTTON ||
@@ -1340,12 +1344,15 @@ int v4l2_queryctrl(struct v4l2_ctrl_handler *hdl, struct v4l2_queryctrl *qc)
 
        ctrl = ref->ctrl;
        memset(qc, 0, sizeof(*qc));
-       qc->id = ctrl->id;
+       if (id >= V4L2_CID_PRIVATE_BASE)
+               qc->id = id;
+       else
+               qc->id = ctrl->id;
        strlcpy(qc->name, ctrl->name, sizeof(qc->name));
        qc->minimum = ctrl->minimum;
        qc->maximum = ctrl->maximum;
        qc->default_value = ctrl->default_value;
-       if (qc->type == V4L2_CTRL_TYPE_MENU)
+       if (ctrl->type == V4L2_CTRL_TYPE_MENU)
                qc->step = 1;
        else
                qc->step = ctrl->step;
@@ -1645,7 +1652,7 @@ static int try_or_set_control_cluster(struct v4l2_ctrl *master, bool set)
                if (ctrl == NULL)
                        continue;
 
-               if (ctrl->has_new) {
+               if (ctrl->is_new) {
                        /* Double check this: it may have changed since the
                           last check in try_or_set_ext_ctrls(). */
                        if (set && (ctrl->flags & V4L2_CTRL_FLAG_GRABBED))
@@ -1719,13 +1726,13 @@ static int try_or_set_ext_ctrls(struct v4l2_ctrl_handler *hdl,
 
                v4l2_ctrl_lock(ctrl);
 
-               /* Reset the 'has_new' flags of the cluster */
+               /* Reset the 'is_new' flags of the cluster */
                for (j = 0; j < master->ncontrols; j++)
                        if (master->cluster[j])
-                               master->cluster[j]->has_new = 0;
+                               master->cluster[j]->is_new = 0;
 
                /* Copy the new caller-supplied control values.
-                  user_to_new() sets 'has_new' to 1. */
+                  user_to_new() sets 'is_new' to 1. */
                ret = cluster_walk(i, cs, helpers, user_to_new);
 
                if (!ret)
@@ -1820,15 +1827,18 @@ static int set_ctrl(struct v4l2_ctrl *ctrl, s32 *val)
        int ret;
        int i;
 
+       if (ctrl->flags & V4L2_CTRL_FLAG_READ_ONLY)
+               return -EACCES;
+
        v4l2_ctrl_lock(ctrl);
 
-       /* Reset the 'has_new' flags of the cluster */
+       /* Reset the 'is_new' flags of the cluster */
        for (i = 0; i < master->ncontrols; i++)
                if (master->cluster[i])
-                       master->cluster[i]->has_new = 0;
+                       master->cluster[i]->is_new = 0;
 
        ctrl->val = *val;
-       ctrl->has_new = 1;
+       ctrl->is_new = 1;
        ret = try_or_set_control_cluster(master, false);
        if (!ret)
                ret = try_or_set_control_cluster(master, true);
index 359e23290a7e99ae0301a6d6844a445343cb900e..341764a3a990e4cfb4c815aa7f41658ec92d82dd 100644 (file)
@@ -419,6 +419,10 @@ static int get_index(struct video_device *vdev)
  *     The registration code assigns minor numbers and device node numbers
  *     based on the requested type and registers the new device node with
  *     the kernel.
+ *
+ *     This function assumes that struct video_device was zeroed when it
+ *     was allocated and does not contain any stale date.
+ *
  *     An error is returned if no free minor or device node number could be
  *     found, or if the registration of the device node failed.
  *
@@ -440,7 +444,6 @@ static int __video_register_device(struct video_device *vdev, int type, int nr,
        int minor_offset = 0;
        int minor_cnt = VIDEO_NUM_DEVICES;
        const char *name_base;
-       void *priv = vdev->dev.p;
 
        /* A minor value of -1 marks this video device as never
           having been registered */
@@ -559,10 +562,6 @@ static int __video_register_device(struct video_device *vdev, int type, int nr,
        }
 
        /* Part 4: register the device with sysfs */
-       memset(&vdev->dev, 0, sizeof(vdev->dev));
-       /* The memset above cleared the device's device_private, so
-          put back the copy we made earlier. */
-       vdev->dev.p = priv;
        vdev->dev.class = &video_class;
        vdev->dev.devt = MKDEV(VIDEO_MAJOR, vdev->minor);
        if (vdev->parent)
index 7fe6f92af480bc46288b3eff1d0358a30bd501e4..ce64fe16bc604137d3522af06931ab562983865c 100644 (file)
@@ -100,6 +100,7 @@ void v4l2_device_unregister(struct v4l2_device *v4l2_dev)
                           is a platform bus, then it is never deleted. */
                        if (client)
                                i2c_unregister_device(client);
+                       continue;
                }
 #endif
 #if defined(CONFIG_SPI)
@@ -108,6 +109,7 @@ void v4l2_device_unregister(struct v4l2_device *v4l2_dev)
 
                        if (spi)
                                spi_unregister_device(spi);
+                       continue;
                }
 #endif
        }
@@ -126,11 +128,19 @@ int v4l2_device_register_subdev(struct v4l2_device *v4l2_dev,
        WARN_ON(sd->v4l2_dev != NULL);
        if (!try_module_get(sd->owner))
                return -ENODEV;
+       sd->v4l2_dev = v4l2_dev;
+       if (sd->internal_ops && sd->internal_ops->registered) {
+               err = sd->internal_ops->registered(sd);
+               if (err)
+                       return err;
+       }
        /* This just returns 0 if either of the two args is NULL */
        err = v4l2_ctrl_add_handler(v4l2_dev->ctrl_handler, sd->ctrl_handler);
-       if (err)
+       if (err) {
+               if (sd->internal_ops && sd->internal_ops->unregistered)
+                       sd->internal_ops->unregistered(sd);
                return err;
-       sd->v4l2_dev = v4l2_dev;
+       }
        spin_lock(&v4l2_dev->lock);
        list_add_tail(&sd->list, &v4l2_dev->subdevs);
        spin_unlock(&v4l2_dev->lock);
@@ -146,6 +156,8 @@ void v4l2_device_unregister_subdev(struct v4l2_subdev *sd)
        spin_lock(&sd->v4l2_dev->lock);
        list_del(&sd->list);
        spin_unlock(&sd->v4l2_dev->lock);
+       if (sd->internal_ops && sd->internal_ops->unregistered)
+               sd->internal_ops->unregistered(sd);
        sd->v4l2_dev = NULL;
        module_put(sd->owner);
 }
index 7e47f15f350d570c771a3d4b02262fbabf3dc149..f51327ef675734c1274669e4ff36f37f82d55b8b 100644 (file)
@@ -1659,20 +1659,24 @@ static long __video_do_ioctl(struct file *file,
        {
                struct v4l2_dbg_register *p = arg;
 
-               if (!capable(CAP_SYS_ADMIN))
-                       ret = -EPERM;
-               else if (ops->vidioc_g_register)
-                       ret = ops->vidioc_g_register(file, fh, p);
+               if (ops->vidioc_g_register) {
+                       if (!capable(CAP_SYS_ADMIN))
+                               ret = -EPERM;
+                       else
+                               ret = ops->vidioc_g_register(file, fh, p);
+               }
                break;
        }
        case VIDIOC_DBG_S_REGISTER:
        {
                struct v4l2_dbg_register *p = arg;
 
-               if (!capable(CAP_SYS_ADMIN))
-                       ret = -EPERM;
-               else if (ops->vidioc_s_register)
-                       ret = ops->vidioc_s_register(file, fh, p);
+               if (ops->vidioc_s_register) {
+                       if (!capable(CAP_SYS_ADMIN))
+                               ret = -EPERM;
+                       else
+                               ret = ops->vidioc_s_register(file, fh, p);
+               }
                break;
        }
 #endif
index 019ee206cbee0224fb71c9a86678c05ecf3da7d2..fa35639d0c150bd6851a6c80cd393b464ca92eb9 100644 (file)
@@ -937,6 +937,7 @@ static void w9966_term(struct w9966 *cam)
                parport_unregister_device(cam->pdev);
                w9966_set_state(cam, W9966_STATE_PDEV, 0);
        }
+       memset(cam, 0, sizeof(*cam));
 }
 
 
index 9cdc3bb15b15aa008029e9e03f47b8dd04c0d1f7..9f2bac51964781f51c2e5b9789511d9b3d04668c 100644 (file)
@@ -1041,7 +1041,7 @@ zr36057_init (struct zoran *zr)
        /* allocate memory *before* doing anything to the hardware
         * in case allocation fails */
        zr->stat_com = kzalloc(BUZ_NUM_STAT_COM * 4, GFP_KERNEL);
-       zr->video_dev = kmalloc(sizeof(struct video_device), GFP_KERNEL);
+       zr->video_dev = video_device_alloc();
        if (!zr->stat_com || !zr->video_dev) {
                dprintk(1,
                        KERN_ERR
index 16fe4f9b719b5af1839ea6cbebb7d03e3c6f8c01..03823327db25236c09199968baa6441458f70017 100644 (file)
@@ -2864,7 +2864,7 @@ config MLX4_CORE
        default n
 
 config MLX4_DEBUG
-       bool "Verbose debugging output" if (MLX4_CORE && EMBEDDED)
+       bool "Verbose debugging output" if (MLX4_CORE && EXPERT)
        depends on MLX4_CORE
        default y
        ---help---
index 62d6f88cbab57deb4fb7141745f700ad68efceb4..aa07657744c3a8a5d1fff8437dbc04e0689dd115 100644 (file)
@@ -1644,7 +1644,7 @@ ks8695_cleanup(void)
 module_init(ks8695_init);
 module_exit(ks8695_cleanup);
 
-MODULE_AUTHOR("Simtec Electronics")
+MODULE_AUTHOR("Simtec Electronics");
 MODULE_DESCRIPTION("Micrel KS8695 (Centaur) Ethernet driver");
 MODULE_LICENSE("GPL");
 MODULE_ALIAS("platform:" MODULENAME);
index a6cd335c943656a9ac67d37c15ea5d9eea3cc899..8e4183717d911d0c190e9fe6a8ff15b4a44a9a7e 100644 (file)
@@ -22,8 +22,8 @@
  * (you will need to reboot afterwards) */
 /* #define BNX2X_STOP_ON_ERROR */
 
-#define DRV_MODULE_VERSION      "1.62.00-3"
-#define DRV_MODULE_RELDATE      "2010/12/21"
+#define DRV_MODULE_VERSION      "1.62.00-4"
+#define DRV_MODULE_RELDATE      "2011/01/18"
 #define BNX2X_BC_VER            0x040200
 
 #define BNX2X_MULTI_QUEUE
index 6238d4f63989e5f5c6340b64d028cc37613600e2..548f5631c0dc1e56a2b7df3c5e3596e75639e2e5 100644 (file)
@@ -352,6 +352,10 @@ struct port_hw_cfg {                           /* port 0: 0x12c  port 1: 0x2bc */
 #define PORT_HW_CFG_LANE_SWAP_CFG_31203120         0x0000d8d8
        /* forced only */
 #define PORT_HW_CFG_LANE_SWAP_CFG_32103210         0x0000e4e4
+    /* Indicate whether to swap the external phy polarity */
+#define PORT_HW_CFG_SWAP_PHY_POLARITY_MASK            0x00010000
+#define PORT_HW_CFG_SWAP_PHY_POLARITY_DISABLED     0x00000000
+#define PORT_HW_CFG_SWAP_PHY_POLARITY_ENABLED      0x00010000
 
        u32 external_phy_config;
 #define PORT_HW_CFG_SERDES_EXT_PHY_TYPE_MASK       0xff000000
index 43b0de24f3918cf42e886dfc7cbd022493bf21a4..7160ec51093e5c9d97c4382640690aa866793c58 100644 (file)
@@ -1573,7 +1573,7 @@ static void bnx2x_set_aer_mmd_xgxs(struct link_params *params,
 
        offset = phy->addr + ser_lane;
        if (CHIP_IS_E2(bp))
-               aer_val = 0x2800 + offset - 1;
+               aer_val = 0x3800 + offset - 1;
        else
                aer_val = 0x3800 + offset;
        CL45_WR_OVER_CL22(bp, phy,
@@ -3166,7 +3166,23 @@ u8 bnx2x_set_led(struct link_params *params,
                if (!vars->link_up)
                        break;
        case LED_MODE_ON:
-               if (SINGLE_MEDIA_DIRECT(params)) {
+               if (params->phy[EXT_PHY1].type ==
+                   PORT_HW_CFG_XGXS_EXT_PHY_TYPE_BCM8727 &&
+                   CHIP_IS_E2(bp) && params->num_phys == 2) {
+                       /**
+                       * This is a work-around for E2+8727 Configurations
+                       */
+                       if (mode == LED_MODE_ON ||
+                               speed == SPEED_10000){
+                               REG_WR(bp, NIG_REG_LED_MODE_P0 + port*4, 0);
+                               REG_WR(bp, NIG_REG_LED_10G_P0 + port*4, 1);
+
+                               tmp = EMAC_RD(bp, EMAC_REG_EMAC_LED);
+                               EMAC_WR(bp, EMAC_REG_EMAC_LED,
+                                       (tmp | EMAC_LED_OVERRIDE));
+                               return rc;
+                       }
+               } else if (SINGLE_MEDIA_DIRECT(params)) {
                        /**
                        * This is a work-around for HW issue found when link
                        * is up in CL73
@@ -3854,11 +3870,14 @@ static void bnx2x_8073_resolve_fc(struct bnx2x_phy *phy,
                           pause_result);
        }
 }
-
-static void bnx2x_8073_8727_external_rom_boot(struct bnx2x *bp,
+static u8 bnx2x_8073_8727_external_rom_boot(struct bnx2x *bp,
                                              struct bnx2x_phy *phy,
                                              u8 port)
 {
+       u32 count = 0;
+       u16 fw_ver1, fw_msgout;
+       u8 rc = 0;
+
        /* Boot port from external ROM  */
        /* EDC grst */
        bnx2x_cl45_write(bp, phy,
@@ -3888,14 +3907,45 @@ static void bnx2x_8073_8727_external_rom_boot(struct bnx2x *bp,
                       MDIO_PMA_REG_GEN_CTRL,
                       MDIO_PMA_REG_GEN_CTRL_ROM_RESET_INTERNAL_MP);
 
-       /* wait for 120ms for code download via SPI port */
-       msleep(120);
+       /* Delay 100ms per the PHY specifications */
+       msleep(100);
+
+       /* 8073 sometimes taking longer to download */
+       do {
+               count++;
+               if (count > 300) {
+                       DP(NETIF_MSG_LINK,
+                                "bnx2x_8073_8727_external_rom_boot port %x:"
+                                "Download failed. fw version = 0x%x\n",
+                                port, fw_ver1);
+                       rc = -EINVAL;
+                       break;
+               }
+
+               bnx2x_cl45_read(bp, phy,
+                               MDIO_PMA_DEVAD,
+                               MDIO_PMA_REG_ROM_VER1, &fw_ver1);
+               bnx2x_cl45_read(bp, phy,
+                               MDIO_PMA_DEVAD,
+                               MDIO_PMA_REG_M8051_MSGOUT_REG, &fw_msgout);
+
+               msleep(1);
+       } while (fw_ver1 == 0 || fw_ver1 == 0x4321 ||
+                       ((fw_msgout & 0xff) != 0x03 && (phy->type ==
+                       PORT_HW_CFG_XGXS_EXT_PHY_TYPE_BCM8073)));
 
        /* Clear ser_boot_ctl bit */
        bnx2x_cl45_write(bp, phy,
                       MDIO_PMA_DEVAD,
                       MDIO_PMA_REG_MISC_CTRL1, 0x0000);
        bnx2x_save_bcm_spirom_ver(bp, phy, port);
+
+       DP(NETIF_MSG_LINK,
+                "bnx2x_8073_8727_external_rom_boot port %x:"
+                "Download complete. fw version = 0x%x\n",
+                port, fw_ver1);
+
+       return rc;
 }
 
 static void bnx2x_8073_set_xaui_low_power_mode(struct bnx2x *bp,
@@ -4108,6 +4158,25 @@ static u8 bnx2x_8073_config_init(struct bnx2x_phy *phy,
 
        DP(NETIF_MSG_LINK, "Before rom RX_ALARM(port1): 0x%x\n", tmp1);
 
+       /**
+        * If this is forced speed, set to KR or KX (all other are not
+        * supported)
+        */
+       /* Swap polarity if required - Must be done only in non-1G mode */
+       if (params->lane_config & PORT_HW_CFG_SWAP_PHY_POLARITY_ENABLED) {
+               /* Configure the 8073 to swap _P and _N of the KR lines */
+               DP(NETIF_MSG_LINK, "Swapping polarity for the 8073\n");
+               /* 10G Rx/Tx and 1G Tx signal polarity swap */
+               bnx2x_cl45_read(bp, phy,
+                               MDIO_PMA_DEVAD,
+                               MDIO_PMA_REG_8073_OPT_DIGITAL_CTRL, &val);
+               bnx2x_cl45_write(bp, phy,
+                                MDIO_PMA_DEVAD,
+                                MDIO_PMA_REG_8073_OPT_DIGITAL_CTRL,
+                                (val | (3<<9)));
+       }
+
+
        /* Enable CL37 BAM */
        if (REG_RD(bp, params->shmem_base +
                         offsetof(struct shmem_region, dev_info.
@@ -4314,8 +4383,32 @@ static u8 bnx2x_8073_read_status(struct bnx2x_phy *phy,
        }
 
        if (link_up) {
+               /* Swap polarity if required */
+               if (params->lane_config &
+                   PORT_HW_CFG_SWAP_PHY_POLARITY_ENABLED) {
+                       /* Configure the 8073 to swap P and N of the KR lines */
+                       bnx2x_cl45_read(bp, phy,
+                                       MDIO_XS_DEVAD,
+                                       MDIO_XS_REG_8073_RX_CTRL_PCIE, &val1);
+                       /**
+                       * Set bit 3 to invert Rx in 1G mode and clear this bit
+                       * when it`s in 10G mode.
+                       */
+                       if (vars->line_speed == SPEED_1000) {
+                               DP(NETIF_MSG_LINK, "Swapping 1G polarity for"
+                                             "the 8073\n");
+                               val1 |= (1<<3);
+                       } else
+                               val1 &= ~(1<<3);
+
+                       bnx2x_cl45_write(bp, phy,
+                                        MDIO_XS_DEVAD,
+                                        MDIO_XS_REG_8073_RX_CTRL_PCIE,
+                                        val1);
+               }
                bnx2x_ext_phy_10G_an_resolve(bp, phy, vars);
                bnx2x_8073_resolve_fc(phy, params, vars);
+               vars->duplex = DUPLEX_FULL;
        }
        return link_up;
 }
@@ -5062,6 +5155,7 @@ static u8 bnx2x_8706_8726_read_status(struct bnx2x_phy *phy,
                else
                        vars->line_speed = SPEED_10000;
                bnx2x_ext_phy_resolve_fc(phy, params, vars);
+               vars->duplex = DUPLEX_FULL;
        }
        return link_up;
 }
@@ -5758,8 +5852,11 @@ static u8 bnx2x_8727_read_status(struct bnx2x_phy *phy,
                DP(NETIF_MSG_LINK, "port %x: External link is down\n",
                           params->port);
        }
-       if (link_up)
+       if (link_up) {
                bnx2x_ext_phy_resolve_fc(phy, params, vars);
+               vars->duplex = DUPLEX_FULL;
+               DP(NETIF_MSG_LINK, "duplex = 0x%x\n", vars->duplex);
+       }
 
        if ((DUAL_MEDIA(params)) &&
            (phy->req_line_speed == SPEED_1000)) {
@@ -5875,10 +5972,26 @@ static void bnx2x_848xx_set_led(struct bnx2x *bp,
                         MDIO_PMA_REG_8481_LED2_MASK,
                         0x18);
 
+       /* Select activity source by Tx and Rx, as suggested by PHY AE */
        bnx2x_cl45_write(bp, phy,
                         MDIO_PMA_DEVAD,
                         MDIO_PMA_REG_8481_LED3_MASK,
-                        0x0040);
+                        0x0006);
+
+       /* Select the closest activity blink rate to that in 10/100/1000 */
+       bnx2x_cl45_write(bp, phy,
+                       MDIO_PMA_DEVAD,
+                       MDIO_PMA_REG_8481_LED3_BLINK,
+                       0);
+
+       bnx2x_cl45_read(bp, phy,
+                       MDIO_PMA_DEVAD,
+                       MDIO_PMA_REG_84823_CTL_LED_CTL_1, &val);
+       val |= MDIO_PMA_REG_84823_LED3_STRETCH_EN; /* stretch_en for LED3*/
+
+       bnx2x_cl45_write(bp, phy,
+                        MDIO_PMA_DEVAD,
+                        MDIO_PMA_REG_84823_CTL_LED_CTL_1, val);
 
        /* 'Interrupt Mask' */
        bnx2x_cl45_write(bp, phy,
@@ -6126,6 +6239,7 @@ static u8 bnx2x_848xx_read_status(struct bnx2x_phy *phy,
        /* Check link 10G */
        if (val2 & (1<<11)) {
                vars->line_speed = SPEED_10000;
+               vars->duplex = DUPLEX_FULL;
                link_up = 1;
                bnx2x_ext_phy_10G_an_resolve(bp, phy, vars);
        } else { /* Check Legacy speed link */
@@ -6489,6 +6603,7 @@ static u8 bnx2x_7101_read_status(struct bnx2x_phy *phy,
                                MDIO_AN_DEVAD, MDIO_AN_REG_MASTER_STATUS,
                                &val2);
                vars->line_speed = SPEED_10000;
+               vars->duplex = DUPLEX_FULL;
                DP(NETIF_MSG_LINK, "SFX7101 AN status 0x%x->Master=%x\n",
                           val2, (val2 & (1<<14)));
                bnx2x_ext_phy_10G_an_resolve(bp, phy, vars);
@@ -7663,7 +7778,6 @@ static u8 bnx2x_8073_common_init_phy(struct bnx2x *bp,
 
        /* PART2 - Download firmware to both phys */
        for (port = PORT_MAX - 1; port >= PORT_0; port--) {
-               u16 fw_ver1;
                if (CHIP_IS_E2(bp))
                        port_of_path = 0;
                else
@@ -7671,19 +7785,9 @@ static u8 bnx2x_8073_common_init_phy(struct bnx2x *bp,
 
                DP(NETIF_MSG_LINK, "Loading spirom for phy address 0x%x\n",
                           phy_blk[port]->addr);
-               bnx2x_8073_8727_external_rom_boot(bp, phy_blk[port],
-                                                 port_of_path);
-
-               bnx2x_cl45_read(bp, phy_blk[port],
-                             MDIO_PMA_DEVAD,
-                             MDIO_PMA_REG_ROM_VER1, &fw_ver1);
-               if (fw_ver1 == 0 || fw_ver1 == 0x4321) {
-                       DP(NETIF_MSG_LINK,
-                                "bnx2x_8073_common_init_phy port %x:"
-                                "Download failed. fw version = 0x%x\n",
-                                port, fw_ver1);
+               if (bnx2x_8073_8727_external_rom_boot(bp, phy_blk[port],
+                                                     port_of_path))
                        return -EINVAL;
-               }
 
                /* Only set bit 10 = 1 (Tx power down) */
                bnx2x_cl45_read(bp, phy_blk[port],
@@ -7848,27 +7952,17 @@ static u8 bnx2x_8727_common_init_phy(struct bnx2x *bp,
        }
        /* PART2 - Download firmware to both phys */
        for (port = PORT_MAX - 1; port >= PORT_0; port--) {
-               u16 fw_ver1;
                 if (CHIP_IS_E2(bp))
                        port_of_path = 0;
                else
                        port_of_path = port;
                DP(NETIF_MSG_LINK, "Loading spirom for phy address 0x%x\n",
                           phy_blk[port]->addr);
-               bnx2x_8073_8727_external_rom_boot(bp, phy_blk[port],
-                                                 port_of_path);
-               bnx2x_cl45_read(bp, phy_blk[port],
-                             MDIO_PMA_DEVAD,
-                             MDIO_PMA_REG_ROM_VER1, &fw_ver1);
-               if (fw_ver1 == 0 || fw_ver1 == 0x4321) {
-                       DP(NETIF_MSG_LINK,
-                                "bnx2x_8727_common_init_phy port %x:"
-                                "Download failed. fw version = 0x%x\n",
-                                port, fw_ver1);
+               if (bnx2x_8073_8727_external_rom_boot(bp, phy_blk[port],
+                                                     port_of_path))
                        return -EINVAL;
-               }
-       }
 
+       }
        return 0;
 }
 
@@ -7916,6 +8010,7 @@ u8 bnx2x_common_init_phy(struct bnx2x *bp, u32 shmem_base_path[],
                         u32 shmem2_base_path[], u32 chip_id)
 {
        u8 rc = 0;
+       u32 phy_ver;
        u8 phy_index;
        u32 ext_phy_type, ext_phy_config;
        DP(NETIF_MSG_LINK, "Begin common phy init\n");
@@ -7923,6 +8018,16 @@ u8 bnx2x_common_init_phy(struct bnx2x *bp, u32 shmem_base_path[],
        if (CHIP_REV_IS_EMUL(bp))
                return 0;
 
+       /* Check if common init was already done */
+       phy_ver = REG_RD(bp, shmem_base_path[0] +
+                        offsetof(struct shmem_region,
+                                 port_mb[PORT_0].ext_phy_fw_version));
+       if (phy_ver) {
+               DP(NETIF_MSG_LINK, "Not doing common init; phy ver is 0x%x\n",
+                              phy_ver);
+               return 0;
+       }
+
        /* Read the ext_phy_type for arbitrary port(0) */
        for (phy_index = EXT_PHY1; phy_index < MAX_PHYS;
              phy_index++) {
index c939683e3d613c92761f648cacfe4d284b75f9bd..e01330bb36c754966543adde30179fae57e75b54 100644 (file)
@@ -6194,7 +6194,11 @@ Theotherbitsarereservedandshouldbezero*/
 #define MDIO_CTL_REG_84823_MEDIA_PRIORITY_COPPER       0x0000
 #define MDIO_CTL_REG_84823_MEDIA_PRIORITY_FIBER                0x0100
 #define MDIO_CTL_REG_84823_MEDIA_FIBER_1G                      0x1000
+#define MDIO_CTL_REG_84823_USER_CTRL_REG               0x4005
+#define MDIO_CTL_REG_84823_USER_CTRL_CMS               0x0080
 
+#define MDIO_PMA_REG_84823_CTL_LED_CTL_1               0xa8e3
+#define MDIO_PMA_REG_84823_LED3_STRETCH_EN             0x0080
 
 #define IGU_FUNC_BASE                  0x0400
 
index 119aa2000c24a7e7091c517588ab64b175e50c39..5ed8f9f9419f163c26703412bb03512537a7e966 100644 (file)
@@ -1920,7 +1920,7 @@ int startup_gfar(struct net_device *ndev)
                if (err) {
                        for (j = 0; j < i; j++)
                                free_grp_irqs(&priv->gfargrp[j]);
-                               goto irq_fail;
+                       goto irq_fail;
                }
        }
 
index 9e3f4f54281d984053155cb9a4854f876120b251..4488bd581eca013be6b2cba3d362ce98ba505444 100644 (file)
@@ -635,7 +635,7 @@ static int sh_irda_hard_xmit(struct sk_buff *skb, struct net_device *ndev)
 
        ret = sh_irda_set_baudrate(self, speed);
        if (ret < 0)
-               return ret;
+               goto sh_irda_hard_xmit_end;
 
        self->tx_buff.len = 0;
        if (skb->len) {
@@ -652,11 +652,21 @@ static int sh_irda_hard_xmit(struct sk_buff *skb, struct net_device *ndev)
 
                sh_irda_write(self, IRTFLR, self->tx_buff.len);
                sh_irda_write(self, IRTCTR, ARMOD | TE);
-       }
+       } else
+               goto sh_irda_hard_xmit_end;
 
        dev_kfree_skb(skb);
 
        return 0;
+
+sh_irda_hard_xmit_end:
+       sh_irda_set_baudrate(self, 9600);
+       netif_wake_queue(self->ndev);
+       sh_irda_rcv_ctrl(self, 1);
+       dev_kfree_skb(skb);
+
+       return ret;
+
 }
 
 static int sh_irda_ioctl(struct net_device *ndev, struct ifreq *ifreq, int cmd)
index 84134c766f3a86fca82195683be07de25cbf5fa1..a41b2cf4d9176d4629a84aecb05659347e00ea78 100644 (file)
@@ -1988,12 +1988,11 @@ static int __devinit ns83820_init_one(struct pci_dev *pci_dev,
        }
 
        ndev = alloc_etherdev(sizeof(struct ns83820));
-       dev = PRIV(ndev);
-
        err = -ENOMEM;
-       if (!dev)
+       if (!ndev)
                goto out;
 
+       dev = PRIV(ndev);
        dev->ndev = ndev;
 
        spin_lock_init(&dev->rx_info.lock);
index d776c4a8d3c1bda74b9699156d5b9690eed74863..04e8ce14a1d068d2fbb4cd2b3df38d7d299ae810 100644 (file)
@@ -54,7 +54,7 @@
 #include <linux/usb/usbnet.h>
 #include <linux/usb/cdc.h>
 
-#define        DRIVER_VERSION                          "30-Nov-2010"
+#define        DRIVER_VERSION                          "17-Jan-2011"
 
 /* CDC NCM subclass 3.2.1 */
 #define USB_CDC_NCM_NDP16_LENGTH_MIN           0x10
@@ -868,15 +868,19 @@ static void cdc_ncm_tx_timeout(unsigned long arg)
        if (ctx->tx_timer_pending != 0) {
                ctx->tx_timer_pending--;
                restart = 1;
-       } else
+       } else {
                restart = 0;
+       }
 
        spin_unlock(&ctx->mtx);
 
-       if (restart)
+       if (restart) {
+               spin_lock(&ctx->mtx);
                cdc_ncm_tx_timeout_start(ctx);
-       else if (ctx->netdev != NULL)
+               spin_unlock(&ctx->mtx);
+       } else if (ctx->netdev != NULL) {
                usbnet_start_xmit(NULL, ctx->netdev);
+       }
 }
 
 static struct sk_buff *
@@ -900,7 +904,6 @@ cdc_ncm_tx_fixup(struct usbnet *dev, struct sk_buff *skb, gfp_t flags)
        skb_out = cdc_ncm_fill_tx_frame(ctx, skb);
        if (ctx->tx_curr_skb != NULL)
                need_timer = 1;
-       spin_unlock(&ctx->mtx);
 
        /* Start timer, if there is a remaining skb */
        if (need_timer)
@@ -908,6 +911,8 @@ cdc_ncm_tx_fixup(struct usbnet *dev, struct sk_buff *skb, gfp_t flags)
 
        if (skb_out)
                dev->net->stats.tx_packets += ctx->tx_curr_frame_num;
+
+       spin_unlock(&ctx->mtx);
        return skb_out;
 
 error:
@@ -1020,8 +1025,8 @@ static int cdc_ncm_rx_fixup(struct usbnet *dev, struct sk_buff *skb_in)
                if (((offset + temp) > actlen) ||
                    (temp > CDC_NCM_MAX_DATAGRAM_SIZE) || (temp < ETH_HLEN)) {
                        pr_debug("invalid frame detected (ignored)"
-                               "offset[%u]=%u, length=%u, skb=%p\n",
-                                                       x, offset, temp, skb_in);
+                                       "offset[%u]=%u, length=%u, skb=%p\n",
+                                       x, offset, temp, skb_in);
                        if (!x)
                                goto error;
                        break;
index d143e8b72b5b7bd1ce021f48f666a3b5a21949dc..cc14b4a75048ca623fae4519cb11b946630f01ce 100644 (file)
@@ -48,6 +48,9 @@ static atomic_t devices_found;
 static int enable_mq = 1;
 static int irq_share_mode;
 
+static void
+vmxnet3_write_mac_addr(struct vmxnet3_adapter *adapter, u8 *mac);
+
 /*
  *    Enable/Disable the given intr
  */
@@ -139,9 +142,13 @@ vmxnet3_check_link(struct vmxnet3_adapter *adapter, bool affectTxQueue)
 {
        u32 ret;
        int i;
+       unsigned long flags;
 
+       spin_lock_irqsave(&adapter->cmd_lock, flags);
        VMXNET3_WRITE_BAR1_REG(adapter, VMXNET3_REG_CMD, VMXNET3_CMD_GET_LINK);
        ret = VMXNET3_READ_BAR1_REG(adapter, VMXNET3_REG_CMD);
+       spin_unlock_irqrestore(&adapter->cmd_lock, flags);
+
        adapter->link_speed = ret >> 16;
        if (ret & 1) { /* Link is up. */
                printk(KERN_INFO "%s: NIC Link is Up %d Mbps\n",
@@ -183,8 +190,10 @@ vmxnet3_process_events(struct vmxnet3_adapter *adapter)
 
        /* Check if there is an error on xmit/recv queues */
        if (events & (VMXNET3_ECR_TQERR | VMXNET3_ECR_RQERR)) {
+               spin_lock(&adapter->cmd_lock);
                VMXNET3_WRITE_BAR1_REG(adapter, VMXNET3_REG_CMD,
                                       VMXNET3_CMD_GET_QUEUE_STATUS);
+               spin_unlock(&adapter->cmd_lock);
 
                for (i = 0; i < adapter->num_tx_queues; i++)
                        if (adapter->tqd_start[i].status.stopped)
@@ -804,30 +813,25 @@ vmxnet3_parse_and_copy_hdr(struct sk_buff *skb, struct vmxnet3_tx_queue *tq,
                                   skb_transport_header(skb))->doff * 4;
                ctx->copy_size = ctx->eth_ip_hdr_size + ctx->l4_hdr_size;
        } else {
-               unsigned int pull_size;
-
                if (skb->ip_summed == CHECKSUM_PARTIAL) {
                        ctx->eth_ip_hdr_size = skb_checksum_start_offset(skb);
 
                        if (ctx->ipv4) {
                                struct iphdr *iph = (struct iphdr *)
                                                    skb_network_header(skb);
-                               if (iph->protocol == IPPROTO_TCP) {
-                                       pull_size = ctx->eth_ip_hdr_size +
-                                                   sizeof(struct tcphdr);
-
-                                       if (unlikely(!pskb_may_pull(skb,
-                                                               pull_size))) {
-                                               goto err;
-                                       }
+                               if (iph->protocol == IPPROTO_TCP)
                                        ctx->l4_hdr_size = ((struct tcphdr *)
                                           skb_transport_header(skb))->doff * 4;
-                               } else if (iph->protocol == IPPROTO_UDP) {
+                               else if (iph->protocol == IPPROTO_UDP)
+                                       /*
+                                        * Use tcp header size so that bytes to
+                                        * be copied are more than required by
+                                        * the device.
+                                        */
                                        ctx->l4_hdr_size =
-                                                       sizeof(struct udphdr);
-                               } else {
+                                                       sizeof(struct tcphdr);
+                               else
                                        ctx->l4_hdr_size = 0;
-                               }
                        } else {
                                /* for simplicity, don't copy L4 headers */
                                ctx->l4_hdr_size = 0;
@@ -1859,18 +1863,14 @@ vmxnet3_vlan_rx_register(struct net_device *netdev, struct vlan_group *grp)
        struct vmxnet3_adapter *adapter = netdev_priv(netdev);
        struct Vmxnet3_DriverShared *shared = adapter->shared;
        u32 *vfTable = adapter->shared->devRead.rxFilterConf.vfTable;
+       unsigned long flags;
 
        if (grp) {
                /* add vlan rx stripping. */
                if (adapter->netdev->features & NETIF_F_HW_VLAN_RX) {
                        int i;
-                       struct Vmxnet3_DSDevRead *devRead = &shared->devRead;
                        adapter->vlan_grp = grp;
 
-                       /* update FEATURES to device */
-                       devRead->misc.uptFeatures |= UPT1_F_RXVLAN;
-                       VMXNET3_WRITE_BAR1_REG(adapter, VMXNET3_REG_CMD,
-                                              VMXNET3_CMD_UPDATE_FEATURE);
                        /*
                         *  Clear entire vfTable; then enable untagged pkts.
                         *  Note: setting one entry in vfTable to non-zero turns
@@ -1880,8 +1880,10 @@ vmxnet3_vlan_rx_register(struct net_device *netdev, struct vlan_group *grp)
                                vfTable[i] = 0;
 
                        VMXNET3_SET_VFTABLE_ENTRY(vfTable, 0);
+                       spin_lock_irqsave(&adapter->cmd_lock, flags);
                        VMXNET3_WRITE_BAR1_REG(adapter, VMXNET3_REG_CMD,
                                               VMXNET3_CMD_UPDATE_VLAN_FILTERS);
+                       spin_unlock_irqrestore(&adapter->cmd_lock, flags);
                } else {
                        printk(KERN_ERR "%s: vlan_rx_register when device has "
                               "no NETIF_F_HW_VLAN_RX\n", netdev->name);
@@ -1900,13 +1902,10 @@ vmxnet3_vlan_rx_register(struct net_device *netdev, struct vlan_group *grp)
                                 */
                                vfTable[i] = 0;
                        }
+                       spin_lock_irqsave(&adapter->cmd_lock, flags);
                        VMXNET3_WRITE_BAR1_REG(adapter, VMXNET3_REG_CMD,
                                               VMXNET3_CMD_UPDATE_VLAN_FILTERS);
-
-                       /* update FEATURES to device */
-                       devRead->misc.uptFeatures &= ~UPT1_F_RXVLAN;
-                       VMXNET3_WRITE_BAR1_REG(adapter, VMXNET3_REG_CMD,
-                                              VMXNET3_CMD_UPDATE_FEATURE);
+                       spin_unlock_irqrestore(&adapter->cmd_lock, flags);
                }
        }
 }
@@ -1939,10 +1938,13 @@ vmxnet3_vlan_rx_add_vid(struct net_device *netdev, u16 vid)
 {
        struct vmxnet3_adapter *adapter = netdev_priv(netdev);
        u32 *vfTable = adapter->shared->devRead.rxFilterConf.vfTable;
+       unsigned long flags;
 
        VMXNET3_SET_VFTABLE_ENTRY(vfTable, vid);
+       spin_lock_irqsave(&adapter->cmd_lock, flags);
        VMXNET3_WRITE_BAR1_REG(adapter, VMXNET3_REG_CMD,
                               VMXNET3_CMD_UPDATE_VLAN_FILTERS);
+       spin_unlock_irqrestore(&adapter->cmd_lock, flags);
 }
 
 
@@ -1951,10 +1953,13 @@ vmxnet3_vlan_rx_kill_vid(struct net_device *netdev, u16 vid)
 {
        struct vmxnet3_adapter *adapter = netdev_priv(netdev);
        u32 *vfTable = adapter->shared->devRead.rxFilterConf.vfTable;
+       unsigned long flags;
 
        VMXNET3_CLEAR_VFTABLE_ENTRY(vfTable, vid);
+       spin_lock_irqsave(&adapter->cmd_lock, flags);
        VMXNET3_WRITE_BAR1_REG(adapter, VMXNET3_REG_CMD,
                               VMXNET3_CMD_UPDATE_VLAN_FILTERS);
+       spin_unlock_irqrestore(&adapter->cmd_lock, flags);
 }
 
 
@@ -1985,6 +1990,7 @@ static void
 vmxnet3_set_mc(struct net_device *netdev)
 {
        struct vmxnet3_adapter *adapter = netdev_priv(netdev);
+       unsigned long flags;
        struct Vmxnet3_RxFilterConf *rxConf =
                                        &adapter->shared->devRead.rxFilterConf;
        u8 *new_table = NULL;
@@ -2020,6 +2026,7 @@ vmxnet3_set_mc(struct net_device *netdev)
                rxConf->mfTablePA = 0;
        }
 
+       spin_lock_irqsave(&adapter->cmd_lock, flags);
        if (new_mode != rxConf->rxMode) {
                rxConf->rxMode = cpu_to_le32(new_mode);
                VMXNET3_WRITE_BAR1_REG(adapter, VMXNET3_REG_CMD,
@@ -2028,6 +2035,7 @@ vmxnet3_set_mc(struct net_device *netdev)
 
        VMXNET3_WRITE_BAR1_REG(adapter, VMXNET3_REG_CMD,
                               VMXNET3_CMD_UPDATE_MAC_FILTERS);
+       spin_unlock_irqrestore(&adapter->cmd_lock, flags);
 
        kfree(new_table);
 }
@@ -2080,10 +2088,8 @@ vmxnet3_setup_driver_shared(struct vmxnet3_adapter *adapter)
                devRead->misc.uptFeatures |= UPT1_F_LRO;
                devRead->misc.maxNumRxSG = cpu_to_le16(1 + MAX_SKB_FRAGS);
        }
-       if ((adapter->netdev->features & NETIF_F_HW_VLAN_RX) &&
-           adapter->vlan_grp) {
+       if (adapter->netdev->features & NETIF_F_HW_VLAN_RX)
                devRead->misc.uptFeatures |= UPT1_F_RXVLAN;
-       }
 
        devRead->misc.mtu = cpu_to_le32(adapter->netdev->mtu);
        devRead->misc.queueDescPA = cpu_to_le64(adapter->queue_desc_pa);
@@ -2168,6 +2174,8 @@ vmxnet3_setup_driver_shared(struct vmxnet3_adapter *adapter)
        /* rx filter settings */
        devRead->rxFilterConf.rxMode = 0;
        vmxnet3_restore_vlan(adapter);
+       vmxnet3_write_mac_addr(adapter, adapter->netdev->dev_addr);
+
        /* the rest are already zeroed */
 }
 
@@ -2177,6 +2185,7 @@ vmxnet3_activate_dev(struct vmxnet3_adapter *adapter)
 {
        int err, i;
        u32 ret;
+       unsigned long flags;
 
        dev_dbg(&adapter->netdev->dev, "%s: skb_buf_size %d, rx_buf_per_pkt %d,"
                " ring sizes %u %u %u\n", adapter->netdev->name,
@@ -2206,9 +2215,11 @@ vmxnet3_activate_dev(struct vmxnet3_adapter *adapter)
                               adapter->shared_pa));
        VMXNET3_WRITE_BAR1_REG(adapter, VMXNET3_REG_DSAH, VMXNET3_GET_ADDR_HI(
                               adapter->shared_pa));
+       spin_lock_irqsave(&adapter->cmd_lock, flags);
        VMXNET3_WRITE_BAR1_REG(adapter, VMXNET3_REG_CMD,
                               VMXNET3_CMD_ACTIVATE_DEV);
        ret = VMXNET3_READ_BAR1_REG(adapter, VMXNET3_REG_CMD);
+       spin_unlock_irqrestore(&adapter->cmd_lock, flags);
 
        if (ret != 0) {
                printk(KERN_ERR "Failed to activate dev %s: error %u\n",
@@ -2255,7 +2266,10 @@ rq_err:
 void
 vmxnet3_reset_dev(struct vmxnet3_adapter *adapter)
 {
+       unsigned long flags;
+       spin_lock_irqsave(&adapter->cmd_lock, flags);
        VMXNET3_WRITE_BAR1_REG(adapter, VMXNET3_REG_CMD, VMXNET3_CMD_RESET_DEV);
+       spin_unlock_irqrestore(&adapter->cmd_lock, flags);
 }
 
 
@@ -2263,12 +2277,15 @@ int
 vmxnet3_quiesce_dev(struct vmxnet3_adapter *adapter)
 {
        int i;
+       unsigned long flags;
        if (test_and_set_bit(VMXNET3_STATE_BIT_QUIESCED, &adapter->state))
                return 0;
 
 
+       spin_lock_irqsave(&adapter->cmd_lock, flags);
        VMXNET3_WRITE_BAR1_REG(adapter, VMXNET3_REG_CMD,
                               VMXNET3_CMD_QUIESCE_DEV);
+       spin_unlock_irqrestore(&adapter->cmd_lock, flags);
        vmxnet3_disable_all_intrs(adapter);
 
        for (i = 0; i < adapter->num_rx_queues; i++)
@@ -2426,7 +2443,7 @@ vmxnet3_adjust_rx_ring_size(struct vmxnet3_adapter *adapter)
        sz = adapter->rx_buf_per_pkt * VMXNET3_RING_SIZE_ALIGN;
        ring0_size = adapter->rx_queue[0].rx_ring[0].size;
        ring0_size = (ring0_size + sz - 1) / sz * sz;
-       ring0_size = min_t(u32, rq->rx_ring[0].size, VMXNET3_RX_RING_MAX_SIZE /
+       ring0_size = min_t(u32, ring0_size, VMXNET3_RX_RING_MAX_SIZE /
                           sz * sz);
        ring1_size = adapter->rx_queue[0].rx_ring[1].size;
        comp_size = ring0_size + ring1_size;
@@ -2695,7 +2712,7 @@ vmxnet3_acquire_msix_vectors(struct vmxnet3_adapter *adapter,
                        break;
                } else {
                        /* If fails to enable required number of MSI-x vectors
-                        * try enabling 3 of them. One each for rx, tx and event
+                        * try enabling minimum number of vectors required.
                         */
                        vectors = vector_threshold;
                        printk(KERN_ERR "Failed to enable %d MSI-X for %s, try"
@@ -2718,9 +2735,11 @@ vmxnet3_alloc_intr_resources(struct vmxnet3_adapter *adapter)
        u32 cfg;
 
        /* intr settings */
+       spin_lock(&adapter->cmd_lock);
        VMXNET3_WRITE_BAR1_REG(adapter, VMXNET3_REG_CMD,
                               VMXNET3_CMD_GET_CONF_INTR);
        cfg = VMXNET3_READ_BAR1_REG(adapter, VMXNET3_REG_CMD);
+       spin_unlock(&adapter->cmd_lock);
        adapter->intr.type = cfg & 0x3;
        adapter->intr.mask_mode = (cfg >> 2) & 0x3;
 
@@ -2755,7 +2774,7 @@ vmxnet3_alloc_intr_resources(struct vmxnet3_adapter *adapter)
                 */
                if (err == VMXNET3_LINUX_MIN_MSIX_VECT) {
                        if (adapter->share_intr != VMXNET3_INTR_BUDDYSHARE
-                           || adapter->num_rx_queues != 2) {
+                           || adapter->num_rx_queues != 1) {
                                adapter->share_intr = VMXNET3_INTR_TXSHARE;
                                printk(KERN_ERR "Number of rx queues : 1\n");
                                adapter->num_rx_queues = 1;
@@ -2905,6 +2924,7 @@ vmxnet3_probe_device(struct pci_dev *pdev,
        adapter->netdev = netdev;
        adapter->pdev = pdev;
 
+       spin_lock_init(&adapter->cmd_lock);
        adapter->shared = pci_alloc_consistent(adapter->pdev,
                          sizeof(struct Vmxnet3_DriverShared),
                          &adapter->shared_pa);
@@ -3108,11 +3128,15 @@ vmxnet3_suspend(struct device *device)
        u8 *arpreq;
        struct in_device *in_dev;
        struct in_ifaddr *ifa;
+       unsigned long flags;
        int i = 0;
 
        if (!netif_running(netdev))
                return 0;
 
+       for (i = 0; i < adapter->num_rx_queues; i++)
+               napi_disable(&adapter->rx_queue[i].napi);
+
        vmxnet3_disable_all_intrs(adapter);
        vmxnet3_free_irqs(adapter);
        vmxnet3_free_intr_resources(adapter);
@@ -3188,8 +3212,10 @@ skip_arp:
        adapter->shared->devRead.pmConfDesc.confPA = cpu_to_le64(virt_to_phys(
                                                                 pmConf));
 
+       spin_lock_irqsave(&adapter->cmd_lock, flags);
        VMXNET3_WRITE_BAR1_REG(adapter, VMXNET3_REG_CMD,
                               VMXNET3_CMD_UPDATE_PMCFG);
+       spin_unlock_irqrestore(&adapter->cmd_lock, flags);
 
        pci_save_state(pdev);
        pci_enable_wake(pdev, pci_choose_state(pdev, PMSG_SUSPEND),
@@ -3204,7 +3230,8 @@ skip_arp:
 static int
 vmxnet3_resume(struct device *device)
 {
-       int err;
+       int err, i = 0;
+       unsigned long flags;
        struct pci_dev *pdev = to_pci_dev(device);
        struct net_device *netdev = pci_get_drvdata(pdev);
        struct vmxnet3_adapter *adapter = netdev_priv(netdev);
@@ -3232,10 +3259,14 @@ vmxnet3_resume(struct device *device)
 
        pci_enable_wake(pdev, PCI_D0, 0);
 
+       spin_lock_irqsave(&adapter->cmd_lock, flags);
        VMXNET3_WRITE_BAR1_REG(adapter, VMXNET3_REG_CMD,
                               VMXNET3_CMD_UPDATE_PMCFG);
+       spin_unlock_irqrestore(&adapter->cmd_lock, flags);
        vmxnet3_alloc_intr_resources(adapter);
        vmxnet3_request_irqs(adapter);
+       for (i = 0; i < adapter->num_rx_queues; i++)
+               napi_enable(&adapter->rx_queue[i].napi);
        vmxnet3_enable_all_intrs(adapter);
 
        return 0;
index 8e17fc8a7fe7ee512ff0af5881ab595c7983b690..81254be85b92629288e21f6f94ecbfe5f4ac5a1b 100644 (file)
@@ -45,6 +45,7 @@ static int
 vmxnet3_set_rx_csum(struct net_device *netdev, u32 val)
 {
        struct vmxnet3_adapter *adapter = netdev_priv(netdev);
+       unsigned long flags;
 
        if (adapter->rxcsum != val) {
                adapter->rxcsum = val;
@@ -56,8 +57,10 @@ vmxnet3_set_rx_csum(struct net_device *netdev, u32 val)
                                adapter->shared->devRead.misc.uptFeatures &=
                                ~UPT1_F_RXCSUM;
 
+                       spin_lock_irqsave(&adapter->cmd_lock, flags);
                        VMXNET3_WRITE_BAR1_REG(adapter, VMXNET3_REG_CMD,
                                               VMXNET3_CMD_UPDATE_FEATURE);
+                       spin_unlock_irqrestore(&adapter->cmd_lock, flags);
                }
        }
        return 0;
@@ -68,76 +71,78 @@ vmxnet3_set_rx_csum(struct net_device *netdev, u32 val)
 static const struct vmxnet3_stat_desc
 vmxnet3_tq_dev_stats[] = {
        /* description,         offset */
-       { "TSO pkts tx",        offsetof(struct UPT1_TxStats, TSOPktsTxOK) },
-       { "TSO bytes tx",       offsetof(struct UPT1_TxStats, TSOBytesTxOK) },
-       { "ucast pkts tx",      offsetof(struct UPT1_TxStats, ucastPktsTxOK) },
-       { "ucast bytes tx",     offsetof(struct UPT1_TxStats, ucastBytesTxOK) },
-       { "mcast pkts tx",      offsetof(struct UPT1_TxStats, mcastPktsTxOK) },
-       { "mcast bytes tx",     offsetof(struct UPT1_TxStats, mcastBytesTxOK) },
-       { "bcast pkts tx",      offsetof(struct UPT1_TxStats, bcastPktsTxOK) },
-       { "bcast bytes tx",     offsetof(struct UPT1_TxStats, bcastBytesTxOK) },
-       { "pkts tx err",        offsetof(struct UPT1_TxStats, pktsTxError) },
-       { "pkts tx discard",    offsetof(struct UPT1_TxStats, pktsTxDiscard) },
+       { "Tx Queue#",        0 },
+       { "  TSO pkts tx",      offsetof(struct UPT1_TxStats, TSOPktsTxOK) },
+       { "  TSO bytes tx",     offsetof(struct UPT1_TxStats, TSOBytesTxOK) },
+       { "  ucast pkts tx",    offsetof(struct UPT1_TxStats, ucastPktsTxOK) },
+       { "  ucast bytes tx",   offsetof(struct UPT1_TxStats, ucastBytesTxOK) },
+       { "  mcast pkts tx",    offsetof(struct UPT1_TxStats, mcastPktsTxOK) },
+       { "  mcast bytes tx",   offsetof(struct UPT1_TxStats, mcastBytesTxOK) },
+       { "  bcast pkts tx",    offsetof(struct UPT1_TxStats, bcastPktsTxOK) },
+       { "  bcast bytes tx",   offsetof(struct UPT1_TxStats, bcastBytesTxOK) },
+       { "  pkts tx err",      offsetof(struct UPT1_TxStats, pktsTxError) },
+       { "  pkts tx discard",  offsetof(struct UPT1_TxStats, pktsTxDiscard) },
 };
 
 /* per tq stats maintained by the driver */
 static const struct vmxnet3_stat_desc
 vmxnet3_tq_driver_stats[] = {
        /* description,         offset */
-       {"drv dropped tx total", offsetof(struct vmxnet3_tq_driver_stats,
-                                       drop_total) },
-       { "   too many frags",  offsetof(struct vmxnet3_tq_driver_stats,
-                                       drop_too_many_frags) },
-       { "   giant hdr",       offsetof(struct vmxnet3_tq_driver_stats,
-                                       drop_oversized_hdr) },
-       { "   hdr err",         offsetof(struct vmxnet3_tq_driver_stats,
-                                       drop_hdr_inspect_err) },
-       { "   tso",             offsetof(struct vmxnet3_tq_driver_stats,
-                                       drop_tso) },
-       { "ring full",          offsetof(struct vmxnet3_tq_driver_stats,
-                                       tx_ring_full) },
-       { "pkts linearized",    offsetof(struct vmxnet3_tq_driver_stats,
-                                       linearized) },
-       { "hdr cloned",         offsetof(struct vmxnet3_tq_driver_stats,
-                                       copy_skb_header) },
-       { "giant hdr",          offsetof(struct vmxnet3_tq_driver_stats,
-                                       oversized_hdr) },
+       {"  drv dropped tx total",      offsetof(struct vmxnet3_tq_driver_stats,
+                                                drop_total) },
+       { "     too many frags", offsetof(struct vmxnet3_tq_driver_stats,
+                                         drop_too_many_frags) },
+       { "     giant hdr",     offsetof(struct vmxnet3_tq_driver_stats,
+                                        drop_oversized_hdr) },
+       { "     hdr err",       offsetof(struct vmxnet3_tq_driver_stats,
+                                        drop_hdr_inspect_err) },
+       { "     tso",           offsetof(struct vmxnet3_tq_driver_stats,
+                                        drop_tso) },
+       { "  ring full",        offsetof(struct vmxnet3_tq_driver_stats,
+                                        tx_ring_full) },
+       { "  pkts linearized",  offsetof(struct vmxnet3_tq_driver_stats,
+                                        linearized) },
+       { "  hdr cloned",       offsetof(struct vmxnet3_tq_driver_stats,
+                                        copy_skb_header) },
+       { "  giant hdr",        offsetof(struct vmxnet3_tq_driver_stats,
+                                        oversized_hdr) },
 };
 
 /* per rq stats maintained by the device */
 static const struct vmxnet3_stat_desc
 vmxnet3_rq_dev_stats[] = {
-       { "LRO pkts rx",        offsetof(struct UPT1_RxStats, LROPktsRxOK) },
-       { "LRO byte rx",        offsetof(struct UPT1_RxStats, LROBytesRxOK) },
-       { "ucast pkts rx",      offsetof(struct UPT1_RxStats, ucastPktsRxOK) },
-       { "ucast bytes rx",     offsetof(struct UPT1_RxStats, ucastBytesRxOK) },
-       { "mcast pkts rx",      offsetof(struct UPT1_RxStats, mcastPktsRxOK) },
-       { "mcast bytes rx",     offsetof(struct UPT1_RxStats, mcastBytesRxOK) },
-       { "bcast pkts rx",      offsetof(struct UPT1_RxStats, bcastPktsRxOK) },
-       { "bcast bytes rx",     offsetof(struct UPT1_RxStats, bcastBytesRxOK) },
-       { "pkts rx out of buf", offsetof(struct UPT1_RxStats, pktsRxOutOfBuf) },
-       { "pkts rx err",        offsetof(struct UPT1_RxStats, pktsRxError) },
+       { "Rx Queue#",        0 },
+       { "  LRO pkts rx",      offsetof(struct UPT1_RxStats, LROPktsRxOK) },
+       { "  LRO byte rx",      offsetof(struct UPT1_RxStats, LROBytesRxOK) },
+       { "  ucast pkts rx",    offsetof(struct UPT1_RxStats, ucastPktsRxOK) },
+       { "  ucast bytes rx",   offsetof(struct UPT1_RxStats, ucastBytesRxOK) },
+       { "  mcast pkts rx",    offsetof(struct UPT1_RxStats, mcastPktsRxOK) },
+       { "  mcast bytes rx",   offsetof(struct UPT1_RxStats, mcastBytesRxOK) },
+       { "  bcast pkts rx",    offsetof(struct UPT1_RxStats, bcastPktsRxOK) },
+       { "  bcast bytes rx",   offsetof(struct UPT1_RxStats, bcastBytesRxOK) },
+       { "  pkts rx OOB",      offsetof(struct UPT1_RxStats, pktsRxOutOfBuf) },
+       { "  pkts rx err",      offsetof(struct UPT1_RxStats, pktsRxError) },
 };
 
 /* per rq stats maintained by the driver */
 static const struct vmxnet3_stat_desc
 vmxnet3_rq_driver_stats[] = {
        /* description,         offset */
-       { "drv dropped rx total", offsetof(struct vmxnet3_rq_driver_stats,
-                                          drop_total) },
-       { "   err",            offsetof(struct vmxnet3_rq_driver_stats,
-                                       drop_err) },
-       { "   fcs",            offsetof(struct vmxnet3_rq_driver_stats,
-                                       drop_fcs) },
-       { "rx buf alloc fail", offsetof(struct vmxnet3_rq_driver_stats,
-                                       rx_buf_alloc_failure) },
+       { "  drv dropped rx total", offsetof(struct vmxnet3_rq_driver_stats,
+                                            drop_total) },
+       { "     err",           offsetof(struct vmxnet3_rq_driver_stats,
+                                        drop_err) },
+       { "     fcs",           offsetof(struct vmxnet3_rq_driver_stats,
+                                        drop_fcs) },
+       { "  rx buf alloc fail", offsetof(struct vmxnet3_rq_driver_stats,
+                                         rx_buf_alloc_failure) },
 };
 
 /* gloabl stats maintained by the driver */
 static const struct vmxnet3_stat_desc
 vmxnet3_global_stats[] = {
        /* description,         offset */
-       { "tx timeout count",   offsetof(struct vmxnet3_adapter,
+       { "tx timeout count",   offsetof(struct vmxnet3_adapter,
                                         tx_timeout_count) }
 };
 
@@ -151,12 +156,15 @@ vmxnet3_get_stats(struct net_device *netdev)
        struct UPT1_TxStats *devTxStats;
        struct UPT1_RxStats *devRxStats;
        struct net_device_stats *net_stats = &netdev->stats;
+       unsigned long flags;
        int i;
 
        adapter = netdev_priv(netdev);
 
        /* Collect the dev stats into the shared area */
+       spin_lock_irqsave(&adapter->cmd_lock, flags);
        VMXNET3_WRITE_BAR1_REG(adapter, VMXNET3_REG_CMD, VMXNET3_CMD_GET_STATS);
+       spin_unlock_irqrestore(&adapter->cmd_lock, flags);
 
        memset(net_stats, 0, sizeof(*net_stats));
        for (i = 0; i < adapter->num_tx_queues; i++) {
@@ -193,12 +201,15 @@ vmxnet3_get_stats(struct net_device *netdev)
 static int
 vmxnet3_get_sset_count(struct net_device *netdev, int sset)
 {
+       struct vmxnet3_adapter *adapter = netdev_priv(netdev);
        switch (sset) {
        case ETH_SS_STATS:
-               return ARRAY_SIZE(vmxnet3_tq_dev_stats) +
-                       ARRAY_SIZE(vmxnet3_tq_driver_stats) +
-                       ARRAY_SIZE(vmxnet3_rq_dev_stats) +
-                       ARRAY_SIZE(vmxnet3_rq_driver_stats) +
+               return (ARRAY_SIZE(vmxnet3_tq_dev_stats) +
+                       ARRAY_SIZE(vmxnet3_tq_driver_stats)) *
+                      adapter->num_tx_queues +
+                      (ARRAY_SIZE(vmxnet3_rq_dev_stats) +
+                       ARRAY_SIZE(vmxnet3_rq_driver_stats)) *
+                      adapter->num_rx_queues +
                        ARRAY_SIZE(vmxnet3_global_stats);
        default:
                return -EOPNOTSUPP;
@@ -206,10 +217,16 @@ vmxnet3_get_sset_count(struct net_device *netdev, int sset)
 }
 
 
+/* Should be multiple of 4 */
+#define NUM_TX_REGS    8
+#define NUM_RX_REGS    12
+
 static int
 vmxnet3_get_regs_len(struct net_device *netdev)
 {
-       return 20 * sizeof(u32);
+       struct vmxnet3_adapter *adapter = netdev_priv(netdev);
+       return (adapter->num_tx_queues * NUM_TX_REGS * sizeof(u32) +
+               adapter->num_rx_queues * NUM_RX_REGS * sizeof(u32));
 }
 
 
@@ -240,29 +257,37 @@ vmxnet3_get_drvinfo(struct net_device *netdev, struct ethtool_drvinfo *drvinfo)
 static void
 vmxnet3_get_strings(struct net_device *netdev, u32 stringset, u8 *buf)
 {
+        struct vmxnet3_adapter *adapter = netdev_priv(netdev);
        if (stringset == ETH_SS_STATS) {
-               int i;
-
-               for (i = 0; i < ARRAY_SIZE(vmxnet3_tq_dev_stats); i++) {
-                       memcpy(buf, vmxnet3_tq_dev_stats[i].desc,
-                              ETH_GSTRING_LEN);
-                       buf += ETH_GSTRING_LEN;
-               }
-               for (i = 0; i < ARRAY_SIZE(vmxnet3_tq_driver_stats); i++) {
-                       memcpy(buf, vmxnet3_tq_driver_stats[i].desc,
-                              ETH_GSTRING_LEN);
-                       buf += ETH_GSTRING_LEN;
-               }
-               for (i = 0; i < ARRAY_SIZE(vmxnet3_rq_dev_stats); i++) {
-                       memcpy(buf, vmxnet3_rq_dev_stats[i].desc,
-                              ETH_GSTRING_LEN);
-                       buf += ETH_GSTRING_LEN;
+               int i, j;
+               for (j = 0; j < adapter->num_tx_queues; j++) {
+                       for (i = 0; i < ARRAY_SIZE(vmxnet3_tq_dev_stats); i++) {
+                               memcpy(buf, vmxnet3_tq_dev_stats[i].desc,
+                                      ETH_GSTRING_LEN);
+                               buf += ETH_GSTRING_LEN;
+                       }
+                       for (i = 0; i < ARRAY_SIZE(vmxnet3_tq_driver_stats);
+                            i++) {
+                               memcpy(buf, vmxnet3_tq_driver_stats[i].desc,
+                                      ETH_GSTRING_LEN);
+                               buf += ETH_GSTRING_LEN;
+                       }
                }
-               for (i = 0; i < ARRAY_SIZE(vmxnet3_rq_driver_stats); i++) {
-                       memcpy(buf, vmxnet3_rq_driver_stats[i].desc,
-                              ETH_GSTRING_LEN);
-                       buf += ETH_GSTRING_LEN;
+
+               for (j = 0; j < adapter->num_rx_queues; j++) {
+                       for (i = 0; i < ARRAY_SIZE(vmxnet3_rq_dev_stats); i++) {
+                               memcpy(buf, vmxnet3_rq_dev_stats[i].desc,
+                                      ETH_GSTRING_LEN);
+                               buf += ETH_GSTRING_LEN;
+                       }
+                       for (i = 0; i < ARRAY_SIZE(vmxnet3_rq_driver_stats);
+                            i++) {
+                               memcpy(buf, vmxnet3_rq_driver_stats[i].desc,
+                                      ETH_GSTRING_LEN);
+                               buf += ETH_GSTRING_LEN;
+                       }
                }
+
                for (i = 0; i < ARRAY_SIZE(vmxnet3_global_stats); i++) {
                        memcpy(buf, vmxnet3_global_stats[i].desc,
                                ETH_GSTRING_LEN);
@@ -277,6 +302,7 @@ vmxnet3_set_flags(struct net_device *netdev, u32 data)
        struct vmxnet3_adapter *adapter = netdev_priv(netdev);
        u8 lro_requested = (data & ETH_FLAG_LRO) == 0 ? 0 : 1;
        u8 lro_present = (netdev->features & NETIF_F_LRO) == 0 ? 0 : 1;
+       unsigned long flags;
 
        if (data & ~ETH_FLAG_LRO)
                return -EOPNOTSUPP;
@@ -292,8 +318,10 @@ vmxnet3_set_flags(struct net_device *netdev, u32 data)
                else
                        adapter->shared->devRead.misc.uptFeatures &=
                                                        ~UPT1_F_LRO;
+               spin_lock_irqsave(&adapter->cmd_lock, flags);
                VMXNET3_WRITE_BAR1_REG(adapter, VMXNET3_REG_CMD,
                                       VMXNET3_CMD_UPDATE_FEATURE);
+               spin_unlock_irqrestore(&adapter->cmd_lock, flags);
        }
        return 0;
 }
@@ -303,30 +331,41 @@ vmxnet3_get_ethtool_stats(struct net_device *netdev,
                          struct ethtool_stats *stats, u64  *buf)
 {
        struct vmxnet3_adapter *adapter = netdev_priv(netdev);
+       unsigned long flags;
        u8 *base;
        int i;
        int j = 0;
 
+       spin_lock_irqsave(&adapter->cmd_lock, flags);
        VMXNET3_WRITE_BAR1_REG(adapter, VMXNET3_REG_CMD, VMXNET3_CMD_GET_STATS);
+       spin_unlock_irqrestore(&adapter->cmd_lock, flags);
 
        /* this does assume each counter is 64-bit wide */
-/* TODO change this for multiple queues */
-
-       base = (u8 *)&adapter->tqd_start[j].stats;
-       for (i = 0; i < ARRAY_SIZE(vmxnet3_tq_dev_stats); i++)
-               *buf++ = *(u64 *)(base + vmxnet3_tq_dev_stats[i].offset);
-
-       base = (u8 *)&adapter->tx_queue[j].stats;
-       for (i = 0; i < ARRAY_SIZE(vmxnet3_tq_driver_stats); i++)
-               *buf++ = *(u64 *)(base + vmxnet3_tq_driver_stats[i].offset);
-
-       base = (u8 *)&adapter->rqd_start[j].stats;
-       for (i = 0; i < ARRAY_SIZE(vmxnet3_rq_dev_stats); i++)
-               *buf++ = *(u64 *)(base + vmxnet3_rq_dev_stats[i].offset);
+       for (j = 0; j < adapter->num_tx_queues; j++) {
+               base = (u8 *)&adapter->tqd_start[j].stats;
+               *buf++ = (u64)j;
+               for (i = 1; i < ARRAY_SIZE(vmxnet3_tq_dev_stats); i++)
+                       *buf++ = *(u64 *)(base +
+                                         vmxnet3_tq_dev_stats[i].offset);
+
+               base = (u8 *)&adapter->tx_queue[j].stats;
+               for (i = 0; i < ARRAY_SIZE(vmxnet3_tq_driver_stats); i++)
+                       *buf++ = *(u64 *)(base +
+                                         vmxnet3_tq_driver_stats[i].offset);
+       }
 
-       base = (u8 *)&adapter->rx_queue[j].stats;
-       for (i = 0; i < ARRAY_SIZE(vmxnet3_rq_driver_stats); i++)
-               *buf++ = *(u64 *)(base + vmxnet3_rq_driver_stats[i].offset);
+       for (j = 0; j < adapter->num_tx_queues; j++) {
+               base = (u8 *)&adapter->rqd_start[j].stats;
+               *buf++ = (u64) j;
+               for (i = 1; i < ARRAY_SIZE(vmxnet3_rq_dev_stats); i++)
+                       *buf++ = *(u64 *)(base +
+                                         vmxnet3_rq_dev_stats[i].offset);
+
+               base = (u8 *)&adapter->rx_queue[j].stats;
+               for (i = 0; i < ARRAY_SIZE(vmxnet3_rq_driver_stats); i++)
+                       *buf++ = *(u64 *)(base +
+                                         vmxnet3_rq_driver_stats[i].offset);
+       }
 
        base = (u8 *)adapter;
        for (i = 0; i < ARRAY_SIZE(vmxnet3_global_stats); i++)
@@ -339,7 +378,7 @@ vmxnet3_get_regs(struct net_device *netdev, struct ethtool_regs *regs, void *p)
 {
        struct vmxnet3_adapter *adapter = netdev_priv(netdev);
        u32 *buf = p;
-       int i = 0;
+       int i = 0, j = 0;
 
        memset(p, 0, vmxnet3_get_regs_len(netdev));
 
@@ -348,31 +387,35 @@ vmxnet3_get_regs(struct net_device *netdev, struct ethtool_regs *regs, void *p)
        /* Update vmxnet3_get_regs_len if we want to dump more registers */
 
        /* make each ring use multiple of 16 bytes */
-/* TODO change this for multiple queues */
-       buf[0] = adapter->tx_queue[i].tx_ring.next2fill;
-       buf[1] = adapter->tx_queue[i].tx_ring.next2comp;
-       buf[2] = adapter->tx_queue[i].tx_ring.gen;
-       buf[3] = 0;
-
-       buf[4] = adapter->tx_queue[i].comp_ring.next2proc;
-       buf[5] = adapter->tx_queue[i].comp_ring.gen;
-       buf[6] = adapter->tx_queue[i].stopped;
-       buf[7] = 0;
-
-       buf[8] = adapter->rx_queue[i].rx_ring[0].next2fill;
-       buf[9] = adapter->rx_queue[i].rx_ring[0].next2comp;
-       buf[10] = adapter->rx_queue[i].rx_ring[0].gen;
-       buf[11] = 0;
-
-       buf[12] = adapter->rx_queue[i].rx_ring[1].next2fill;
-       buf[13] = adapter->rx_queue[i].rx_ring[1].next2comp;
-       buf[14] = adapter->rx_queue[i].rx_ring[1].gen;
-       buf[15] = 0;
-
-       buf[16] = adapter->rx_queue[i].comp_ring.next2proc;
-       buf[17] = adapter->rx_queue[i].comp_ring.gen;
-       buf[18] = 0;
-       buf[19] = 0;
+       for (i = 0; i < adapter->num_tx_queues; i++) {
+               buf[j++] = adapter->tx_queue[i].tx_ring.next2fill;
+               buf[j++] = adapter->tx_queue[i].tx_ring.next2comp;
+               buf[j++] = adapter->tx_queue[i].tx_ring.gen;
+               buf[j++] = 0;
+
+               buf[j++] = adapter->tx_queue[i].comp_ring.next2proc;
+               buf[j++] = adapter->tx_queue[i].comp_ring.gen;
+               buf[j++] = adapter->tx_queue[i].stopped;
+               buf[j++] = 0;
+       }
+
+       for (i = 0; i < adapter->num_rx_queues; i++) {
+               buf[j++] = adapter->rx_queue[i].rx_ring[0].next2fill;
+               buf[j++] = adapter->rx_queue[i].rx_ring[0].next2comp;
+               buf[j++] = adapter->rx_queue[i].rx_ring[0].gen;
+               buf[j++] = 0;
+
+               buf[j++] = adapter->rx_queue[i].rx_ring[1].next2fill;
+               buf[j++] = adapter->rx_queue[i].rx_ring[1].next2comp;
+               buf[j++] = adapter->rx_queue[i].rx_ring[1].gen;
+               buf[j++] = 0;
+
+               buf[j++] = adapter->rx_queue[i].comp_ring.next2proc;
+               buf[j++] = adapter->rx_queue[i].comp_ring.gen;
+               buf[j++] = 0;
+               buf[j++] = 0;
+       }
+
 }
 
 
@@ -574,6 +617,7 @@ vmxnet3_set_rss_indir(struct net_device *netdev,
                      const struct ethtool_rxfh_indir *p)
 {
        unsigned int i;
+       unsigned long flags;
        struct vmxnet3_adapter *adapter = netdev_priv(netdev);
        struct UPT1_RSSConf *rssConf = adapter->rss_conf;
 
@@ -592,8 +636,10 @@ vmxnet3_set_rss_indir(struct net_device *netdev,
        for (i = 0; i < rssConf->indTableSize; i++)
                rssConf->indTable[i] = p->ring_index[i];
 
+       spin_lock_irqsave(&adapter->cmd_lock, flags);
        VMXNET3_WRITE_BAR1_REG(adapter, VMXNET3_REG_CMD,
                               VMXNET3_CMD_UPDATE_RSSIDT);
+       spin_unlock_irqrestore(&adapter->cmd_lock, flags);
 
        return 0;
 
index 7fadeed37f032ba4ddd0342e67ed1c392dbe6739..fb5d245ac8781c7b0f385767a4ef1697f7024122 100644 (file)
 /*
  * Version numbers
  */
-#define VMXNET3_DRIVER_VERSION_STRING   "1.0.16.0-k"
+#define VMXNET3_DRIVER_VERSION_STRING   "1.0.25.0-k"
 
 /* a 32-bit int, each byte encode a verion number in VMXNET3_DRIVER_VERSION */
-#define VMXNET3_DRIVER_VERSION_NUM      0x01001000
+#define VMXNET3_DRIVER_VERSION_NUM      0x01001900
 
 #if defined(CONFIG_PCI_MSI)
        /* RSS only makes sense if MSI-X is supported. */
@@ -289,7 +289,7 @@ struct vmxnet3_rx_queue {
 
 #define VMXNET3_LINUX_MAX_MSIX_VECT     (VMXNET3_DEVICE_MAX_TX_QUEUES + \
                                         VMXNET3_DEVICE_MAX_RX_QUEUES + 1)
-#define VMXNET3_LINUX_MIN_MSIX_VECT     3    /* 1 for each : tx, rx and event */
+#define VMXNET3_LINUX_MIN_MSIX_VECT     2 /* 1 for tx-rx pair and 1 for event */
 
 
 struct vmxnet3_intr {
@@ -317,6 +317,7 @@ struct vmxnet3_adapter {
        struct vmxnet3_rx_queue         rx_queue[VMXNET3_DEVICE_MAX_RX_QUEUES];
        struct vlan_group               *vlan_grp;
        struct vmxnet3_intr             intr;
+       spinlock_t                      cmd_lock;
        struct Vmxnet3_DriverShared     *shared;
        struct Vmxnet3_PMConf           *pm_conf;
        struct Vmxnet3_TxQueueDesc      *tqd_start;     /* all tx queue desc */
index 019a74d533a6e88caaa1cf26078ffd5e57d06159..09ae4ef0fd51fbf2dda13c6b138d76f75007577c 100644 (file)
@@ -2294,6 +2294,8 @@ ath5k_tx_complete_poll_work(struct work_struct *work)
        int i;
        bool needreset = false;
 
+       mutex_lock(&sc->lock);
+
        for (i = 0; i < ARRAY_SIZE(sc->txqs); i++) {
                if (sc->txqs[i].setup) {
                        txq = &sc->txqs[i];
@@ -2321,6 +2323,8 @@ ath5k_tx_complete_poll_work(struct work_struct *work)
                ath5k_reset(sc, NULL, true);
        }
 
+       mutex_unlock(&sc->lock);
+
        ieee80211_queue_delayed_work(sc->hw, &sc->tx_complete_work,
                msecs_to_jiffies(ATH5K_TX_COMPLETE_POLL_INT));
 }
index ea2e7d714bdad0888e070dc61faf5acfba26ff15..5e300bd3d26457fe999cc41185c6cce42b07eb22 100644 (file)
@@ -679,10 +679,6 @@ static bool ar9002_hw_calibrate(struct ath_hw *ah,
 
        /* Do NF cal only at longer intervals */
        if (longcal || nfcal_pending) {
-               /* Do periodic PAOffset Cal */
-               ar9002_hw_pa_cal(ah, false);
-               ar9002_hw_olc_temp_compensation(ah);
-
                /*
                 * Get the value from the previous NF cal and update
                 * history buffer.
@@ -697,8 +693,12 @@ static bool ar9002_hw_calibrate(struct ath_hw *ah,
                        ath9k_hw_loadnf(ah, ah->curchan);
                }
 
-               if (longcal)
+               if (longcal) {
                        ath9k_hw_start_nfcal(ah, false);
+                       /* Do periodic PAOffset Cal */
+                       ar9002_hw_pa_cal(ah, false);
+                       ar9002_hw_olc_temp_compensation(ah);
+               }
        }
 
        return iscaldone;
index 81f9cf294decc7cacb29019979454b9e18805fda..9ecca93392e8a563fc9775caa814b3ae64120917 100644 (file)
@@ -1842,7 +1842,7 @@ static const u32 ar9300_2p2_soc_preamble[][2] = {
 
 static const u32 ar9300PciePhy_pll_on_clkreq_disable_L1_2p2[][2] = {
        /* Addr      allmodes  */
-       {0x00004040, 0x08212e5e},
+       {0x00004040, 0x0821265e},
        {0x00004040, 0x0008003b},
        {0x00004044, 0x00000000},
 };
index 6137634e46ca6d87fcea94dbd7eacf3607448b60..06fb2c850535f3dc2f84db86a5988bd110c1c160 100644 (file)
@@ -146,8 +146,8 @@ static void ar9003_hw_init_mode_regs(struct ath_hw *ah)
                /* Sleep Setting */
 
                INIT_INI_ARRAY(&ah->iniPcieSerdesLowPower,
-                               ar9300PciePhy_clkreq_enable_L1_2p2,
-                               ARRAY_SIZE(ar9300PciePhy_clkreq_enable_L1_2p2),
+                               ar9300PciePhy_pll_on_clkreq_disable_L1_2p2,
+                               ARRAY_SIZE(ar9300PciePhy_pll_on_clkreq_disable_L1_2p2),
                                2);
 
                /* Fast clock modal settings */
index 1ce506f231107a22893f9da8aba0faa8dde5e686..780ac5eac501d401470e6fdb99d14c5f085f4cc7 100644 (file)
@@ -78,7 +78,7 @@ struct tx_frame_hdr {
        u8 node_idx;
        u8 vif_idx;
        u8 tidno;
-       u32 flags; /* ATH9K_HTC_TX_* */
+       __be32 flags; /* ATH9K_HTC_TX_* */
        u8 key_type;
        u8 keyix;
        u8 reserved[26];
index 33f36029fa4f9b351f9a3157b563783b5b2dcf50..7a5ffca21958a45657e1cf23370e01bb31e498f8 100644 (file)
@@ -113,6 +113,7 @@ int ath9k_htc_tx_start(struct ath9k_htc_priv *priv, struct sk_buff *skb)
 
        if (ieee80211_is_data(fc)) {
                struct tx_frame_hdr tx_hdr;
+               u32 flags = 0;
                u8 *qc;
 
                memset(&tx_hdr, 0, sizeof(struct tx_frame_hdr));
@@ -136,13 +137,14 @@ int ath9k_htc_tx_start(struct ath9k_htc_priv *priv, struct sk_buff *skb)
                /* Check for RTS protection */
                if (priv->hw->wiphy->rts_threshold != (u32) -1)
                        if (skb->len > priv->hw->wiphy->rts_threshold)
-                               tx_hdr.flags |= ATH9K_HTC_TX_RTSCTS;
+                               flags |= ATH9K_HTC_TX_RTSCTS;
 
                /* CTS-to-self */
-               if (!(tx_hdr.flags & ATH9K_HTC_TX_RTSCTS) &&
+               if (!(flags & ATH9K_HTC_TX_RTSCTS) &&
                    (priv->op_flags & OP_PROTECT_ENABLE))
-                       tx_hdr.flags |= ATH9K_HTC_TX_CTSONLY;
+                       flags |= ATH9K_HTC_TX_CTSONLY;
 
+               tx_hdr.flags = cpu_to_be32(flags);
                tx_hdr.key_type = ath9k_cmn_get_hw_crypto_keytype(skb);
                if (tx_hdr.key_type == ATH9K_KEY_TYPE_CLEAR)
                        tx_hdr.keyix = (u8) ATH9K_TXKEYIX_INVALID;
index 97906dd442e628ea733dec41f6aac79c26b7c8d1..14ceb4df72f63e3fa4f467a074c15ecda5849454 100644 (file)
@@ -168,7 +168,7 @@ int iwl_eeprom_check_sku(struct iwl_priv *priv)
                /* not using .cfg overwrite */
                radio_cfg = iwl_eeprom_query16(priv, EEPROM_RADIO_CONFIG);
                priv->cfg->valid_tx_ant = EEPROM_RF_CFG_TX_ANT_MSK(radio_cfg);
-               priv->cfg->valid_rx_ant = EEPROM_RF_CFG_TX_ANT_MSK(radio_cfg);
+               priv->cfg->valid_rx_ant = EEPROM_RF_CFG_RX_ANT_MSK(radio_cfg);
                if (!priv->cfg->valid_tx_ant || !priv->cfg->valid_rx_ant) {
                        IWL_ERR(priv, "Invalid chain (0X%x, 0X%x)\n",
                                priv->cfg->valid_tx_ant,
index 13a69ebf2a94cbe67834f5dd9dec9c752e6deaf2..5091d77e02ce7a8838237cd6cebe0d0f0eed733d 100644 (file)
@@ -126,6 +126,7 @@ void *iwm_if_alloc(int sizeof_bus, struct device *dev,
        ndev = alloc_netdev_mq(0, "wlan%d", ether_setup, IWM_TX_QUEUES);
        if (!ndev) {
                dev_err(dev, "no memory for network device instance\n");
+               ret = -ENOMEM;
                goto out_priv;
        }
 
@@ -138,6 +139,7 @@ void *iwm_if_alloc(int sizeof_bus, struct device *dev,
                                    GFP_KERNEL);
        if (!iwm->umac_profile) {
                dev_err(dev, "Couldn't alloc memory for profile\n");
+               ret = -ENOMEM;
                goto out_profile;
        }
 
index f0e1eb72befc0abff02c5f7e2f33d8d610c70cdd..be0ff78c1b1666178864c62e8f367a6fae939a9a 100644 (file)
@@ -58,6 +58,7 @@ static int rt2x00lib_request_firmware(struct rt2x00_dev *rt2x00dev)
 
        if (!fw || !fw->size || !fw->data) {
                ERROR(rt2x00dev, "Failed to read Firmware.\n");
+               release_firmware(fw);
                return -ENOENT;
        }
 
index dda70981b7a6f4ef3f4a29fc84f826111b1d0306..dc29348264c668e16c63a7909d59e82008a18109 100644 (file)
@@ -31,7 +31,7 @@ source "drivers/pci/pcie/aer/Kconfig"
 # PCI Express ASPM
 #
 config PCIEASPM
-       bool "PCI Express ASPM control" if EMBEDDED
+       bool "PCI Express ASPM control" if EXPERT
        depends on PCI && PCIEPORTBUS
        default y
        help
index de886f3dfd3926c8cd9f1974926ff1689baf027f..6e318ce411369176b7d43148656438806f2d316c 100644 (file)
@@ -69,7 +69,7 @@ comment "PC-card bridges"
 config YENTA
        tristate "CardBus yenta-compatible bridge support"
        depends on PCI
-       select CARDBUS if !EMBEDDED
+       select CARDBUS if !EXPERT
        select PCCARD_NONSTATIC if PCMCIA != n
        ---help---
          This option enables support for CardBus host bridges.  Virtually
@@ -84,27 +84,27 @@ config YENTA
 
 config YENTA_O2
        default y
-       bool "Special initialization for O2Micro bridges" if EMBEDDED
+       bool "Special initialization for O2Micro bridges" if EXPERT
        depends on YENTA
 
 config YENTA_RICOH
        default y
-       bool "Special initialization for Ricoh bridges" if EMBEDDED
+       bool "Special initialization for Ricoh bridges" if EXPERT
        depends on YENTA
 
 config YENTA_TI
        default y
-       bool "Special initialization for TI and EnE bridges" if EMBEDDED
+       bool "Special initialization for TI and EnE bridges" if EXPERT
        depends on YENTA
 
 config YENTA_ENE_TUNE
        default y
-       bool "Auto-tune EnE bridges for CB cards" if EMBEDDED
+       bool "Auto-tune EnE bridges for CB cards" if EXPERT
        depends on YENTA_TI && CARDBUS
 
 config YENTA_TOSHIBA
        default y
-       bool "Special initialization for Toshiba ToPIC bridges" if EMBEDDED
+       bool "Special initialization for Toshiba ToPIC bridges" if EXPERT
        depends on YENTA
 
 config PD6729
index 467e82bd0929789867031a0ae31e1114d38e8274..a50391b6ba2a95b8afcc6d397a90c068c5f9bc36 100644 (file)
@@ -943,6 +943,8 @@ static int rio_enum_complete(struct rio_mport *port)
  * @port: Master port to send transactions
  * @destid: Current destination ID in network
  * @hopcount: Number of hops into the network
+ * @prev: previous rio_dev
+ * @prev_port: previous port number
  *
  * Recursively discovers a RIO network.  Transactions are sent via the
  * master port passed in @port.
index 7a7a1b664781073aa09d10bfa134a1d9b8eb6b09..2ac8f6aff5a478e3bb34051aeacf3d9128890024 100644 (file)
@@ -831,12 +831,14 @@ tx_drop:
        return NETDEV_TX_OK;
 }
 
-static int qeth_l2_open(struct net_device *dev)
+static int __qeth_l2_open(struct net_device *dev)
 {
        struct qeth_card *card = dev->ml_priv;
        int rc = 0;
 
        QETH_CARD_TEXT(card, 4, "qethopen");
+       if (card->state == CARD_STATE_UP)
+               return rc;
        if (card->state != CARD_STATE_SOFTSETUP)
                return -ENODEV;
 
@@ -857,6 +859,18 @@ static int qeth_l2_open(struct net_device *dev)
        return rc;
 }
 
+static int qeth_l2_open(struct net_device *dev)
+{
+       struct qeth_card *card = dev->ml_priv;
+
+       QETH_CARD_TEXT(card, 5, "qethope_");
+       if (qeth_wait_for_threads(card, QETH_RECOVER_THREAD)) {
+               QETH_CARD_TEXT(card, 3, "openREC");
+               return -ERESTARTSYS;
+       }
+       return __qeth_l2_open(dev);
+}
+
 static int qeth_l2_stop(struct net_device *dev)
 {
        struct qeth_card *card = dev->ml_priv;
@@ -1046,7 +1060,7 @@ contin:
        if (recover_flag == CARD_STATE_RECOVER) {
                if (recovery_mode &&
                    card->info.type != QETH_CARD_TYPE_OSN) {
-                       qeth_l2_open(card->dev);
+                       __qeth_l2_open(card->dev);
                } else {
                        rtnl_lock();
                        dev_open(card->dev);
index e227e465bfc4686047e9f18f111681dfa6672364..d09b0c44fc3d35c89224fd699b2cf0a2624d283b 100644 (file)
@@ -2998,7 +2998,9 @@ static inline void qeth_l3_hdr_csum(struct qeth_card *card,
         */
        if (iph->protocol == IPPROTO_UDP)
                hdr->hdr.l3.ext_flags |= QETH_HDR_EXT_UDP;
-       hdr->hdr.l3.ext_flags |= QETH_HDR_EXT_CSUM_TRANSP_REQ;
+       hdr->hdr.l3.ext_flags |= QETH_HDR_EXT_CSUM_TRANSP_REQ |
+               QETH_HDR_EXT_CSUM_HDR_REQ;
+       iph->check = 0;
        if (card->options.performance_stats)
                card->perf_stats.tx_csum++;
 }
@@ -3240,12 +3242,14 @@ tx_drop:
        return NETDEV_TX_OK;
 }
 
-static int qeth_l3_open(struct net_device *dev)
+static int __qeth_l3_open(struct net_device *dev)
 {
        struct qeth_card *card = dev->ml_priv;
        int rc = 0;
 
        QETH_CARD_TEXT(card, 4, "qethopen");
+       if (card->state == CARD_STATE_UP)
+               return rc;
        if (card->state != CARD_STATE_SOFTSETUP)
                return -ENODEV;
        card->data.state = CH_STATE_UP;
@@ -3260,6 +3264,18 @@ static int qeth_l3_open(struct net_device *dev)
        return rc;
 }
 
+static int qeth_l3_open(struct net_device *dev)
+{
+       struct qeth_card *card = dev->ml_priv;
+
+       QETH_CARD_TEXT(card, 5, "qethope_");
+       if (qeth_wait_for_threads(card, QETH_RECOVER_THREAD)) {
+               QETH_CARD_TEXT(card, 3, "openREC");
+               return -ERESTARTSYS;
+       }
+       return __qeth_l3_open(dev);
+}
+
 static int qeth_l3_stop(struct net_device *dev)
 {
        struct qeth_card *card = dev->ml_priv;
@@ -3564,7 +3580,7 @@ contin:
                netif_carrier_off(card->dev);
        if (recover_flag == CARD_STATE_RECOVER) {
                if (recovery_mode)
-                       qeth_l3_open(card->dev);
+                       __qeth_l3_open(card->dev);
                else {
                        rtnl_lock();
                        dev_open(card->dev);
index 13bfa9d480822243b6254ad6f8e4c8867e595d90..bb233a9cbad2fef09da95aef7225cad4e78c518d 100644 (file)
@@ -53,6 +53,14 @@ if SPI_MASTER
 
 comment "SPI Master Controller Drivers"
 
+config SPI_ATH79
+       tristate "Atheros AR71XX/AR724X/AR913X SPI controller driver"
+       depends on ATH79 && GENERIC_GPIO
+       select SPI_BITBANG
+       help
+         This enables support for the SPI controller present on the
+         Atheros AR71XX/AR724X/AR913X SoCs.
+
 config SPI_ATMEL
        tristate "Atmel SPI Controller"
        depends on (ARCH_AT91 || AVR32)
index 3a42463c92a4935c7b56019910c096c1780e587c..86d1b5f9bbd9a9b93c91db63ce7af659b5f6c74c 100644 (file)
@@ -10,6 +10,7 @@ obj-$(CONFIG_SPI_MASTER)              += spi.o
 
 # SPI master controller drivers (bus)
 obj-$(CONFIG_SPI_ATMEL)                        += atmel_spi.o
+obj-$(CONFIG_SPI_ATH79)                        += ath79_spi.o
 obj-$(CONFIG_SPI_BFIN)                 += spi_bfin5xx.o
 obj-$(CONFIG_SPI_BITBANG)              += spi_bitbang.o
 obj-$(CONFIG_SPI_AU1550)               += au1550_spi.o
diff --git a/drivers/spi/ath79_spi.c b/drivers/spi/ath79_spi.c
new file mode 100644 (file)
index 0000000..fcff810
--- /dev/null
@@ -0,0 +1,292 @@
+/*
+ * SPI controller driver for the Atheros AR71XX/AR724X/AR913X SoCs
+ *
+ * Copyright (C) 2009-2011 Gabor Juhos <juhosg@openwrt.org>
+ *
+ * This driver has been based on the spi-gpio.c:
+ *     Copyright (C) 2006,2008 David Brownell
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ *
+ */
+
+#include <linux/kernel.h>
+#include <linux/init.h>
+#include <linux/delay.h>
+#include <linux/spinlock.h>
+#include <linux/workqueue.h>
+#include <linux/platform_device.h>
+#include <linux/io.h>
+#include <linux/spi/spi.h>
+#include <linux/spi/spi_bitbang.h>
+#include <linux/bitops.h>
+#include <linux/gpio.h>
+
+#include <asm/mach-ath79/ar71xx_regs.h>
+#include <asm/mach-ath79/ath79_spi_platform.h>
+
+#define DRV_NAME       "ath79-spi"
+
+struct ath79_spi {
+       struct spi_bitbang      bitbang;
+       u32                     ioc_base;
+       u32                     reg_ctrl;
+       void __iomem            *base;
+};
+
+static inline u32 ath79_spi_rr(struct ath79_spi *sp, unsigned reg)
+{
+       return ioread32(sp->base + reg);
+}
+
+static inline void ath79_spi_wr(struct ath79_spi *sp, unsigned reg, u32 val)
+{
+       iowrite32(val, sp->base + reg);
+}
+
+static inline struct ath79_spi *ath79_spidev_to_sp(struct spi_device *spi)
+{
+       return spi_master_get_devdata(spi->master);
+}
+
+static void ath79_spi_chipselect(struct spi_device *spi, int is_active)
+{
+       struct ath79_spi *sp = ath79_spidev_to_sp(spi);
+       int cs_high = (spi->mode & SPI_CS_HIGH) ? is_active : !is_active;
+
+       if (is_active) {
+               /* set initial clock polarity */
+               if (spi->mode & SPI_CPOL)
+                       sp->ioc_base |= AR71XX_SPI_IOC_CLK;
+               else
+                       sp->ioc_base &= ~AR71XX_SPI_IOC_CLK;
+
+               ath79_spi_wr(sp, AR71XX_SPI_REG_IOC, sp->ioc_base);
+       }
+
+       if (spi->chip_select) {
+               struct ath79_spi_controller_data *cdata = spi->controller_data;
+
+               /* SPI is normally active-low */
+               gpio_set_value(cdata->gpio, cs_high);
+       } else {
+               if (cs_high)
+                       sp->ioc_base |= AR71XX_SPI_IOC_CS0;
+               else
+                       sp->ioc_base &= ~AR71XX_SPI_IOC_CS0;
+
+               ath79_spi_wr(sp, AR71XX_SPI_REG_IOC, sp->ioc_base);
+       }
+
+}
+
+static int ath79_spi_setup_cs(struct spi_device *spi)
+{
+       struct ath79_spi *sp = ath79_spidev_to_sp(spi);
+       struct ath79_spi_controller_data *cdata;
+
+       cdata = spi->controller_data;
+       if (spi->chip_select && !cdata)
+               return -EINVAL;
+
+       /* enable GPIO mode */
+       ath79_spi_wr(sp, AR71XX_SPI_REG_FS, AR71XX_SPI_FS_GPIO);
+
+       /* save CTRL register */
+       sp->reg_ctrl = ath79_spi_rr(sp, AR71XX_SPI_REG_CTRL);
+       sp->ioc_base = ath79_spi_rr(sp, AR71XX_SPI_REG_IOC);
+
+       /* TODO: setup speed? */
+       ath79_spi_wr(sp, AR71XX_SPI_REG_CTRL, 0x43);
+
+       if (spi->chip_select) {
+               int status = 0;
+
+               status = gpio_request(cdata->gpio, dev_name(&spi->dev));
+               if (status)
+                       return status;
+
+               status = gpio_direction_output(cdata->gpio,
+                                              spi->mode & SPI_CS_HIGH);
+               if (status) {
+                       gpio_free(cdata->gpio);
+                       return status;
+               }
+       } else {
+               if (spi->mode & SPI_CS_HIGH)
+                       sp->ioc_base |= AR71XX_SPI_IOC_CS0;
+               else
+                       sp->ioc_base &= ~AR71XX_SPI_IOC_CS0;
+               ath79_spi_wr(sp, AR71XX_SPI_REG_IOC, sp->ioc_base);
+       }
+
+       return 0;
+}
+
+static void ath79_spi_cleanup_cs(struct spi_device *spi)
+{
+       struct ath79_spi *sp = ath79_spidev_to_sp(spi);
+
+       if (spi->chip_select) {
+               struct ath79_spi_controller_data *cdata = spi->controller_data;
+               gpio_free(cdata->gpio);
+       }
+
+       /* restore CTRL register */
+       ath79_spi_wr(sp, AR71XX_SPI_REG_CTRL, sp->reg_ctrl);
+       /* disable GPIO mode */
+       ath79_spi_wr(sp, AR71XX_SPI_REG_FS, 0);
+}
+
+static int ath79_spi_setup(struct spi_device *spi)
+{
+       int status = 0;
+
+       if (spi->bits_per_word > 32)
+               return -EINVAL;
+
+       if (!spi->controller_state) {
+               status = ath79_spi_setup_cs(spi);
+               if (status)
+                       return status;
+       }
+
+       status = spi_bitbang_setup(spi);
+       if (status && !spi->controller_state)
+               ath79_spi_cleanup_cs(spi);
+
+       return status;
+}
+
+static void ath79_spi_cleanup(struct spi_device *spi)
+{
+       ath79_spi_cleanup_cs(spi);
+       spi_bitbang_cleanup(spi);
+}
+
+static u32 ath79_spi_txrx_mode0(struct spi_device *spi, unsigned nsecs,
+                              u32 word, u8 bits)
+{
+       struct ath79_spi *sp = ath79_spidev_to_sp(spi);
+       u32 ioc = sp->ioc_base;
+
+       /* clock starts at inactive polarity */
+       for (word <<= (32 - bits); likely(bits); bits--) {
+               u32 out;
+
+               if (word & (1 << 31))
+                       out = ioc | AR71XX_SPI_IOC_DO;
+               else
+                       out = ioc & ~AR71XX_SPI_IOC_DO;
+
+               /* setup MSB (to slave) on trailing edge */
+               ath79_spi_wr(sp, AR71XX_SPI_REG_IOC, out);
+               ath79_spi_wr(sp, AR71XX_SPI_REG_IOC, out | AR71XX_SPI_IOC_CLK);
+
+               word <<= 1;
+       }
+
+       return ath79_spi_rr(sp, AR71XX_SPI_REG_RDS);
+}
+
+static __devinit int ath79_spi_probe(struct platform_device *pdev)
+{
+       struct spi_master *master;
+       struct ath79_spi *sp;
+       struct ath79_spi_platform_data *pdata;
+       struct resource *r;
+       int ret;
+
+       master = spi_alloc_master(&pdev->dev, sizeof(*sp));
+       if (master == NULL) {
+               dev_err(&pdev->dev, "failed to allocate spi master\n");
+               return -ENOMEM;
+       }
+
+       sp = spi_master_get_devdata(master);
+       platform_set_drvdata(pdev, sp);
+
+       pdata = pdev->dev.platform_data;
+
+       master->setup = ath79_spi_setup;
+       master->cleanup = ath79_spi_cleanup;
+       if (pdata) {
+               master->bus_num = pdata->bus_num;
+               master->num_chipselect = pdata->num_chipselect;
+       } else {
+               master->bus_num = -1;
+               master->num_chipselect = 1;
+       }
+
+       sp->bitbang.master = spi_master_get(master);
+       sp->bitbang.chipselect = ath79_spi_chipselect;
+       sp->bitbang.txrx_word[SPI_MODE_0] = ath79_spi_txrx_mode0;
+       sp->bitbang.setup_transfer = spi_bitbang_setup_transfer;
+       sp->bitbang.flags = SPI_CS_HIGH;
+
+       r = platform_get_resource(pdev, IORESOURCE_MEM, 0);
+       if (r == NULL) {
+               ret = -ENOENT;
+               goto err_put_master;
+       }
+
+       sp->base = ioremap(r->start, r->end - r->start + 1);
+       if (!sp->base) {
+               ret = -ENXIO;
+               goto err_put_master;
+       }
+
+       ret = spi_bitbang_start(&sp->bitbang);
+       if (ret)
+               goto err_unmap;
+
+       return 0;
+
+err_unmap:
+       iounmap(sp->base);
+err_put_master:
+       platform_set_drvdata(pdev, NULL);
+       spi_master_put(sp->bitbang.master);
+
+       return ret;
+}
+
+static __devexit int ath79_spi_remove(struct platform_device *pdev)
+{
+       struct ath79_spi *sp = platform_get_drvdata(pdev);
+
+       spi_bitbang_stop(&sp->bitbang);
+       iounmap(sp->base);
+       platform_set_drvdata(pdev, NULL);
+       spi_master_put(sp->bitbang.master);
+
+       return 0;
+}
+
+static struct platform_driver ath79_spi_driver = {
+       .probe          = ath79_spi_probe,
+       .remove         = __devexit_p(ath79_spi_remove),
+       .driver         = {
+               .name   = DRV_NAME,
+               .owner  = THIS_MODULE,
+       },
+};
+
+static __init int ath79_spi_init(void)
+{
+       return platform_driver_register(&ath79_spi_driver);
+}
+module_init(ath79_spi_init);
+
+static __exit void ath79_spi_exit(void)
+{
+       platform_driver_unregister(&ath79_spi_driver);
+}
+module_exit(ath79_spi_exit);
+
+MODULE_DESCRIPTION("SPI controller driver for Atheros AR71XX/AR724X/AR913X");
+MODULE_AUTHOR("Gabor Juhos <juhosg@openwrt.org>");
+MODULE_LICENSE("GPL v2");
+MODULE_ALIAS("platform:" DRV_NAME);
index 2d8cc455dbc746a9dfe5d7811b14dc97d2feb381..42cdaa9a4d8af3ca2587c2b6db269e4495c4b55a 100644 (file)
@@ -82,7 +82,7 @@ config SSB_SDIOHOST
 
 config SSB_SILENT
        bool "No SSB kernel messages"
-       depends on SSB && EMBEDDED
+       depends on SSB && EXPERT
        help
          This option turns off all Sonics Silicon Backplane printks.
          Note that you won't be able to identify problems, once
index 6aa312df4018a7500289169ae592491751e797d4..2d0263f07937be78af2c3e8717c4c19a4c36c6b3 100644 (file)
@@ -1,13 +1,37 @@
-The binding between hdpvr and lirc_zilog is currently disabled,
+1. Both ir-kbd-i2c and lirc_zilog provide support for RX events.
+The 'tx_only' lirc_zilog module parameter will allow ir-kbd-i2c
+and lirc_zilog to coexist in the kernel, if the user requires such a set-up.
+However the IR unit will not work well without coordination between the
+two modules.  A shared mutex, for transceiver access locking, needs to be
+supplied by bridge drivers, in struct IR_i2_init_data, to both ir-kbd-i2c
+and lirc_zilog, before they will coexist usefully.  This should be fixed
+before moving out of staging.
+
+2. References and locking need careful examination.  For cx18 and ivtv PCI
+cards, which are not easily "hot unplugged", the imperfect state of reference
+counting and locking is acceptable if not correct.  For USB connected units
+like HD PVR, PVR USB2, HVR-1900, and HVR1950, the likelyhood of an Ooops on
+unplug is probably great.  Proper reference counting and locking needs to be
+implemented before this module is moved out of staging.
+
+3. The binding between hdpvr and lirc_zilog is currently disabled,
 due to an OOPS reported a few years ago when both the hdpvr and cx18
 drivers were loaded in his system. More details can be seen at:
        http://www.mail-archive.com/linux-media@vger.kernel.org/msg09163.html
 More tests need to be done, in order to fix the reported issue.
 
-There's a conflict between ir-kbd-i2c: Both provide support for RX events.
-Such conflict needs to be fixed, before moving it out of staging.
+4. In addition to providing a shared mutex for transceiver access
+locking, bridge drivers, if able, should provide a chip reset() callback
+to lirc_zilog via struct IR_i2c_init_data.  cx18 and ivtv already have routines
+to perform Z8 chip resets via GPIO manipulations.  This will allow lirc_zilog
+to bring the chip back to normal when it hangs, in the same places the
+original lirc_pvr150 driver code does.  This is not strictly needed, so it
+is not required to move lirc_zilog out of staging.
+
+5. Both lirc_zilog and ir-kbd-i2c support the Zilog Z8 for IR, as programmed
+and installed on Hauppauge products.  When working on either module, developers
+must consider at least the following bridge drivers which mention an IR Rx unit
+at address 0x71 (indicative of a Z8):
 
-The way I2C probe works, it will try to register the driver twice, one
-for RX and another for TX. The logic needs to be fixed to avoid such
-issue.
+       ivtv cx18 hdpvr pvrusb2 bt8xx cx88 saa7134
 
index 0da6b9518af9ea4e068051ca24706e97aa917faa..235cab0eb0877483267fac5dbdf6c75364a5f59e 100644 (file)
@@ -447,6 +447,7 @@ static ssize_t vfd_write(struct file *file, const char *buf,
 
 exit:
        mutex_unlock(&context->ctx_lock);
+       kfree(data_buf);
 
        return (!retval) ? n_bytes : retval;
 }
index 929ae579546773c5a6f1cd34fc58f908985df1dc..5938616f3e8fc957f120c7b6888740a3e554a9ef 100644 (file)
@@ -232,6 +232,7 @@ static ssize_t lirc_write(struct file *file, const char *buf,
                i++;
        }
        terminate_send(tx_buf[i - 1]);
+       kfree(tx_buf);
        return n;
 }
 
index dfd2c447e67d38aca01dfc833ee23ab6f1e77486..3a9c09881b2b7064e4d3109e5b4d05463a93d123 100644 (file)
@@ -376,6 +376,7 @@ static ssize_t lirc_write(struct file *filep, const char *buf, size_t n,
        unsigned long flags;
        int counttimer;
        int *wbuf;
+       ssize_t ret;
 
        if (!is_claimed)
                return -EBUSY;
@@ -393,8 +394,10 @@ static ssize_t lirc_write(struct file *filep, const char *buf, size_t n,
        if (timer == 0) {
                /* try again if device is ready */
                timer = init_lirc_timer();
-               if (timer == 0)
-                       return -EIO;
+               if (timer == 0) {
+                       ret = -EIO;
+                       goto out;
+               }
        }
 
        /* adjust values from usecs */
@@ -420,7 +423,8 @@ static ssize_t lirc_write(struct file *filep, const char *buf, size_t n,
                        if (check_pselecd && (in(1) & LP_PSELECD)) {
                                lirc_off();
                                local_irq_restore(flags);
-                               return -EIO;
+                               ret = -EIO;
+                               goto out;
                        }
                } while (counttimer < wbuf[i]);
                i++;
@@ -436,7 +440,8 @@ static ssize_t lirc_write(struct file *filep, const char *buf, size_t n,
                        level = newlevel;
                        if (check_pselecd && (in(1) & LP_PSELECD)) {
                                local_irq_restore(flags);
-                               return -EIO;
+                               ret = -EIO;
+                               goto out;
                        }
                } while (counttimer < wbuf[i]);
                i++;
@@ -445,7 +450,11 @@ static ssize_t lirc_write(struct file *filep, const char *buf, size_t n,
 #else
        /* place code that handles write without external timer here */
 #endif
-       return n;
+       ret = n;
+out:
+       kfree(wbuf);
+
+       return ret;
 }
 
 static unsigned int lirc_poll(struct file *file, poll_table *wait)
index 998485ebdbceb136c764449b3667872b32cc5090..925eabe14854d93cc0267110da2ba646758f0aaf 100644 (file)
@@ -448,6 +448,7 @@ static ssize_t vfd_write(struct file *file, const char *buf,
 exit:
 
        mutex_unlock(&context->ctx_lock);
+       kfree(data_buf);
 
        return (!retval) ? n_bytes : retval;
 }
index 9bcf149c4260ad3a8020caccc98801fff40664de..1c3099b388e0acefd601621dbe05a9c6b78451b7 100644 (file)
@@ -966,7 +966,7 @@ static ssize_t lirc_write(struct file *file, const char *buf,
        if (n % sizeof(int) || count % 2 == 0)
                return -EINVAL;
        wbuf = memdup_user(buf, n);
-       if (PTR_ERR(wbuf))
+       if (IS_ERR(wbuf))
                return PTR_ERR(wbuf);
        spin_lock_irqsave(&hardware[type].lock, flags);
        if (type == LIRC_IRDEO) {
@@ -981,6 +981,7 @@ static ssize_t lirc_write(struct file *file, const char *buf,
        }
        off();
        spin_unlock_irqrestore(&hardware[type].lock, flags);
+       kfree(wbuf);
        return n;
 }
 
index c553ab6262386ad4b68916f928ee25c770f3fbf2..76be7b8c620968218822c3216204e14ffdc2250b 100644 (file)
@@ -330,6 +330,7 @@ static ssize_t lirc_write(struct file *file, const char *buf, size_t n,
        /* enable receiver */
        Ser2UTCR3 = UTCR3_RXE|UTCR3_RIE;
 #endif
+       kfree(tx_buf);
        return count;
 }
 
index ad29bb1275ab260dd37bb28440b2cbc80e3d8fbf..3fe5f4160194341e69ce5ff5ec789cda6326a0af 100644 (file)
@@ -20,6 +20,9 @@
  *
  * parts are cut&pasted from the lirc_i2c.c driver
  *
+ * Numerous changes updating lirc_zilog.c in kernel 2.6.38 and later are
+ * Copyright (C) 2011 Andy Walls <awalls@md.metrocast.net>
+ *
  *  This program is free software; you can redistribute it and/or modify
  *  it under the terms of the GNU General Public License as published by
  *  the Free Software Foundation; either version 2 of the License, or
 #include <media/lirc_dev.h>
 #include <media/lirc.h>
 
-struct IR {
-       struct lirc_driver l;
-
-       /* Device info */
-       struct mutex ir_lock;
-       int open;
-       bool is_hdpvr;
-
+struct IR_rx {
        /* RX device */
-       struct i2c_client c_rx;
-       int have_rx;
+       struct i2c_client *c;
 
        /* RX device buffer & lock */
        struct lirc_buffer buf;
        struct mutex buf_lock;
 
        /* RX polling thread data */
-       struct completion *t_notify;
-       struct completion *t_notify2;
-       int shutdown;
        struct task_struct *task;
 
        /* RX read data */
        unsigned char b[3];
+       bool hdpvr_data_fmt;
+};
 
+struct IR_tx {
        /* TX device */
-       struct i2c_client c_tx;
+       struct i2c_client *c;
+
+       /* TX additional actions needed */
        int need_boot;
-       int have_tx;
+       bool post_tx_ready_poll;
+};
+
+struct IR {
+       struct lirc_driver l;
+
+       struct mutex ir_lock;
+       int open;
+
+       struct i2c_adapter *adapter;
+       struct IR_rx *rx;
+       struct IR_tx *tx;
 };
 
 /* Minor -> data mapping */
+static struct mutex ir_devices_lock;
 static struct IR *ir_devices[MAX_IRCTL_DEVICES];
 
 /* Block size for IR transmitter */
@@ -124,14 +133,11 @@ static struct mutex tx_data_lock;
 #define zilog_notify(s, args...) printk(KERN_NOTICE KBUILD_MODNAME ": " s, \
                                        ## args)
 #define zilog_error(s, args...) printk(KERN_ERR KBUILD_MODNAME ": " s, ## args)
-
-#define ZILOG_HAUPPAUGE_IR_RX_NAME "Zilog/Hauppauge IR RX"
-#define ZILOG_HAUPPAUGE_IR_TX_NAME "Zilog/Hauppauge IR TX"
+#define zilog_info(s, args...) printk(KERN_INFO KBUILD_MODNAME ": " s, ## args)
 
 /* module parameters */
 static int debug;      /* debug output */
-static int disable_rx; /* disable RX device */
-static int disable_tx; /* disable TX device */
+static int tx_only;    /* only handle the IR Tx function */
 static int minor = -1; /* minor number */
 
 #define dprintk(fmt, args...)                                          \
@@ -150,8 +156,12 @@ static int add_to_buf(struct IR *ir)
        int ret;
        int failures = 0;
        unsigned char sendbuf[1] = { 0 };
+       struct IR_rx *rx = ir->rx;
 
-       if (lirc_buffer_full(&ir->buf)) {
+       if (rx == NULL)
+               return -ENXIO;
+
+       if (lirc_buffer_full(&rx->buf)) {
                dprintk("buffer overflow\n");
                return -EOVERFLOW;
        }
@@ -161,17 +171,25 @@ static int add_to_buf(struct IR *ir)
         * data and we have space
         */
        do {
+               if (kthread_should_stop())
+                       return -ENODATA;
+
                /*
                 * Lock i2c bus for the duration.  RX/TX chips interfere so
                 * this is worth it
                 */
                mutex_lock(&ir->ir_lock);
 
+               if (kthread_should_stop()) {
+                       mutex_unlock(&ir->ir_lock);
+                       return -ENODATA;
+               }
+
                /*
                 * Send random "poll command" (?)  Windows driver does this
                 * and it is a good point to detect chip failure.
                 */
-               ret = i2c_master_send(&ir->c_rx, sendbuf, 1);
+               ret = i2c_master_send(rx->c, sendbuf, 1);
                if (ret != 1) {
                        zilog_error("i2c_master_send failed with %d\n", ret);
                        if (failures >= 3) {
@@ -186,45 +204,53 @@ static int add_to_buf(struct IR *ir)
                                    "trying reset\n");
 
                        set_current_state(TASK_UNINTERRUPTIBLE);
+                       if (kthread_should_stop()) {
+                               mutex_unlock(&ir->ir_lock);
+                               return -ENODATA;
+                       }
                        schedule_timeout((100 * HZ + 999) / 1000);
-                       ir->need_boot = 1;
+                       ir->tx->need_boot = 1;
 
                        ++failures;
                        mutex_unlock(&ir->ir_lock);
                        continue;
                }
 
-               ret = i2c_master_recv(&ir->c_rx, keybuf, sizeof(keybuf));
+               if (kthread_should_stop()) {
+                       mutex_unlock(&ir->ir_lock);
+                       return -ENODATA;
+               }
+               ret = i2c_master_recv(rx->c, keybuf, sizeof(keybuf));
                mutex_unlock(&ir->ir_lock);
                if (ret != sizeof(keybuf)) {
                        zilog_error("i2c_master_recv failed with %d -- "
                                    "keeping last read buffer\n", ret);
                } else {
-                       ir->b[0] = keybuf[3];
-                       ir->b[1] = keybuf[4];
-                       ir->b[2] = keybuf[5];
-                       dprintk("key (0x%02x/0x%02x)\n", ir->b[0], ir->b[1]);
+                       rx->b[0] = keybuf[3];
+                       rx->b[1] = keybuf[4];
+                       rx->b[2] = keybuf[5];
+                       dprintk("key (0x%02x/0x%02x)\n", rx->b[0], rx->b[1]);
                }
 
                /* key pressed ? */
-               if (ir->is_hdpvr) {
+               if (rx->hdpvr_data_fmt) {
                        if (got_data && (keybuf[0] == 0x80))
                                return 0;
                        else if (got_data && (keybuf[0] == 0x00))
                                return -ENODATA;
-               } else if ((ir->b[0] & 0x80) == 0)
+               } else if ((rx->b[0] & 0x80) == 0)
                        return got_data ? 0 : -ENODATA;
 
                /* look what we have */
-               code = (((__u16)ir->b[0] & 0x7f) << 6) | (ir->b[1] >> 2);
+               code = (((__u16)rx->b[0] & 0x7f) << 6) | (rx->b[1] >> 2);
 
                codes[0] = (code >> 8) & 0xff;
                codes[1] = code & 0xff;
 
                /* return it */
-               lirc_buffer_write(&ir->buf, codes);
+               lirc_buffer_write(&rx->buf, codes);
                ++got_data;
-       } while (!lirc_buffer_full(&ir->buf));
+       } while (!lirc_buffer_full(&rx->buf));
 
        return 0;
 }
@@ -242,46 +268,35 @@ static int add_to_buf(struct IR *ir)
 static int lirc_thread(void *arg)
 {
        struct IR *ir = arg;
-
-       if (ir->t_notify != NULL)
-               complete(ir->t_notify);
+       struct IR_rx *rx = ir->rx;
 
        dprintk("poll thread started\n");
 
-       do {
-               if (ir->open) {
-                       set_current_state(TASK_INTERRUPTIBLE);
+       while (!kthread_should_stop()) {
+               set_current_state(TASK_INTERRUPTIBLE);
 
-                       /*
-                        * This is ~113*2 + 24 + jitter (2*repeat gap +
-                        * code length).  We use this interval as the chip
-                        * resets every time you poll it (bad!).  This is
-                        * therefore just sufficient to catch all of the
-                        * button presses.  It makes the remote much more
-                        * responsive.  You can see the difference by
-                        * running irw and holding down a button.  With
-                        * 100ms, the old polling interval, you'll notice
-                        * breaks in the repeat sequence corresponding to
-                        * lost keypresses.
-                        */
-                       schedule_timeout((260 * HZ) / 1000);
-                       if (ir->shutdown)
-                               break;
-                       if (!add_to_buf(ir))
-                               wake_up_interruptible(&ir->buf.wait_poll);
-               } else {
-                       /* if device not opened so we can sleep half a second */
-                       set_current_state(TASK_INTERRUPTIBLE);
+               /* if device not opened, we can sleep half a second */
+               if (!ir->open) {
                        schedule_timeout(HZ/2);
+                       continue;
                }
-       } while (!ir->shutdown);
-
-       if (ir->t_notify2 != NULL)
-               wait_for_completion(ir->t_notify2);
 
-       ir->task = NULL;
-       if (ir->t_notify != NULL)
-               complete(ir->t_notify);
+               /*
+                * This is ~113*2 + 24 + jitter (2*repeat gap + code length).
+                * We use this interval as the chip resets every time you poll
+                * it (bad!).  This is therefore just sufficient to catch all
+                * of the button presses.  It makes the remote much more
+                * responsive.  You can see the difference by running irw and
+                * holding down a button.  With 100ms, the old polling
+                * interval, you'll notice breaks in the repeat sequence
+                * corresponding to lost keypresses.
+                */
+               schedule_timeout((260 * HZ) / 1000);
+               if (kthread_should_stop())
+                       break;
+               if (!add_to_buf(ir))
+                       wake_up_interruptible(&rx->buf.wait_poll);
+       }
 
        dprintk("poll thread ended\n");
        return 0;
@@ -299,10 +314,10 @@ static int set_use_inc(void *data)
         * this is completely broken code. lirc_unregister_driver()
         * must be possible even when the device is open
         */
-       if (ir->c_rx.addr)
-               i2c_use_client(&ir->c_rx);
-       if (ir->c_tx.addr)
-               i2c_use_client(&ir->c_tx);
+       if (ir->rx != NULL)
+               i2c_use_client(ir->rx->c);
+       if (ir->tx != NULL)
+               i2c_use_client(ir->tx->c);
 
        return 0;
 }
@@ -311,10 +326,10 @@ static void set_use_dec(void *data)
 {
        struct IR *ir = data;
 
-       if (ir->c_rx.addr)
-               i2c_release_client(&ir->c_rx);
-       if (ir->c_tx.addr)
-               i2c_release_client(&ir->c_tx);
+       if (ir->rx)
+               i2c_release_client(ir->rx->c);
+       if (ir->tx)
+               i2c_release_client(ir->tx->c);
        if (ir->l.owner != NULL)
                module_put(ir->l.owner);
 }
@@ -453,7 +468,7 @@ corrupt:
 }
 
 /* send a block of data to the IR TX device */
-static int send_data_block(struct IR *ir, unsigned char *data_block)
+static int send_data_block(struct IR_tx *tx, unsigned char *data_block)
 {
        int i, j, ret;
        unsigned char buf[5];
@@ -467,7 +482,7 @@ static int send_data_block(struct IR *ir, unsigned char *data_block)
                        buf[1 + j] = data_block[i + j];
                dprintk("%02x %02x %02x %02x %02x",
                        buf[0], buf[1], buf[2], buf[3], buf[4]);
-               ret = i2c_master_send(&ir->c_tx, buf, tosend + 1);
+               ret = i2c_master_send(tx->c, buf, tosend + 1);
                if (ret != tosend + 1) {
                        zilog_error("i2c_master_send failed with %d\n", ret);
                        return ret < 0 ? ret : -EFAULT;
@@ -478,32 +493,32 @@ static int send_data_block(struct IR *ir, unsigned char *data_block)
 }
 
 /* send boot data to the IR TX device */
-static int send_boot_data(struct IR *ir)
+static int send_boot_data(struct IR_tx *tx)
 {
        int ret;
        unsigned char buf[4];
 
        /* send the boot block */
-       ret = send_data_block(ir, tx_data->boot_data);
+       ret = send_data_block(tx, tx_data->boot_data);
        if (ret != 0)
                return ret;
 
        /* kick it off? */
        buf[0] = 0x00;
        buf[1] = 0x20;
-       ret = i2c_master_send(&ir->c_tx, buf, 2);
+       ret = i2c_master_send(tx->c, buf, 2);
        if (ret != 2) {
                zilog_error("i2c_master_send failed with %d\n", ret);
                return ret < 0 ? ret : -EFAULT;
        }
-       ret = i2c_master_send(&ir->c_tx, buf, 1);
+       ret = i2c_master_send(tx->c, buf, 1);
        if (ret != 1) {
                zilog_error("i2c_master_send failed with %d\n", ret);
                return ret < 0 ? ret : -EFAULT;
        }
 
        /* Here comes the firmware version... (hopefully) */
-       ret = i2c_master_recv(&ir->c_tx, buf, 4);
+       ret = i2c_master_recv(tx->c, buf, 4);
        if (ret != 4) {
                zilog_error("i2c_master_recv failed with %d\n", ret);
                return 0;
@@ -543,7 +558,7 @@ static void fw_unload(void)
 }
 
 /* load "firmware" for the IR TX device */
-static int fw_load(struct IR *ir)
+static int fw_load(struct IR_tx *tx)
 {
        int ret;
        unsigned int i;
@@ -558,7 +573,7 @@ static int fw_load(struct IR *ir)
        }
 
        /* Request codeset data file */
-       ret = request_firmware(&fw_entry, "haup-ir-blaster.bin", &ir->c_tx.dev);
+       ret = request_firmware(&fw_entry, "haup-ir-blaster.bin", &tx->c->dev);
        if (ret != 0) {
                zilog_error("firmware haup-ir-blaster.bin not available "
                            "(%d)\n", ret);
@@ -685,20 +700,20 @@ out:
 }
 
 /* initialise the IR TX device */
-static int tx_init(struct IR *ir)
+static int tx_init(struct IR_tx *tx)
 {
        int ret;
 
        /* Load 'firmware' */
-       ret = fw_load(ir);
+       ret = fw_load(tx);
        if (ret != 0)
                return ret;
 
        /* Send boot block */
-       ret = send_boot_data(ir);
+       ret = send_boot_data(tx);
        if (ret != 0)
                return ret;
-       ir->need_boot = 0;
+       tx->need_boot = 0;
 
        /* Looks good */
        return 0;
@@ -714,20 +729,20 @@ static loff_t lseek(struct file *filep, loff_t offset, int orig)
 static ssize_t read(struct file *filep, char *outbuf, size_t n, loff_t *ppos)
 {
        struct IR *ir = filep->private_data;
-       unsigned char buf[ir->buf.chunk_size];
+       struct IR_rx *rx = ir->rx;
        int ret = 0, written = 0;
        DECLARE_WAITQUEUE(wait, current);
 
        dprintk("read called\n");
-       if (ir->c_rx.addr == 0)
+       if (rx == NULL)
                return -ENODEV;
 
-       if (mutex_lock_interruptible(&ir->buf_lock))
+       if (mutex_lock_interruptible(&rx->buf_lock))
                return -ERESTARTSYS;
 
-       if (n % ir->buf.chunk_size) {
+       if (n % rx->buf.chunk_size) {
                dprintk("read result = -EINVAL\n");
-               mutex_unlock(&ir->buf_lock);
+               mutex_unlock(&rx->buf_lock);
                return -EINVAL;
        }
 
@@ -736,7 +751,7 @@ static ssize_t read(struct file *filep, char *outbuf, size_t n, loff_t *ppos)
         * to avoid losing scan code (in case when queue is awaken somewhere
         * between while condition checking and scheduling)
         */
-       add_wait_queue(&ir->buf.wait_poll, &wait);
+       add_wait_queue(&rx->buf.wait_poll, &wait);
        set_current_state(TASK_INTERRUPTIBLE);
 
        /*
@@ -744,7 +759,7 @@ static ssize_t read(struct file *filep, char *outbuf, size_t n, loff_t *ppos)
         * mode and 'copy_to_user' is happy, wait for data.
         */
        while (written < n && ret == 0) {
-               if (lirc_buffer_empty(&ir->buf)) {
+               if (lirc_buffer_empty(&rx->buf)) {
                        /*
                         * According to the read(2) man page, 'written' can be
                         * returned as less than 'n', instead of blocking
@@ -764,16 +779,17 @@ static ssize_t read(struct file *filep, char *outbuf, size_t n, loff_t *ppos)
                        schedule();
                        set_current_state(TASK_INTERRUPTIBLE);
                } else {
-                       lirc_buffer_read(&ir->buf, buf);
+                       unsigned char buf[rx->buf.chunk_size];
+                       lirc_buffer_read(&rx->buf, buf);
                        ret = copy_to_user((void *)outbuf+written, buf,
-                                          ir->buf.chunk_size);
-                       written += ir->buf.chunk_size;
+                                          rx->buf.chunk_size);
+                       written += rx->buf.chunk_size;
                }
        }
 
-       remove_wait_queue(&ir->buf.wait_poll, &wait);
+       remove_wait_queue(&rx->buf.wait_poll, &wait);
        set_current_state(TASK_RUNNING);
-       mutex_unlock(&ir->buf_lock);
+       mutex_unlock(&rx->buf_lock);
 
        dprintk("read result = %s (%d)\n",
                ret ? "-EFAULT" : "OK", ret);
@@ -782,7 +798,7 @@ static ssize_t read(struct file *filep, char *outbuf, size_t n, loff_t *ppos)
 }
 
 /* send a keypress to the IR TX device */
-static int send_code(struct IR *ir, unsigned int code, unsigned int key)
+static int send_code(struct IR_tx *tx, unsigned int code, unsigned int key)
 {
        unsigned char data_block[TX_BLOCK_SIZE];
        unsigned char buf[2];
@@ -799,26 +815,26 @@ static int send_code(struct IR *ir, unsigned int code, unsigned int key)
                return ret;
 
        /* Send the data block */
-       ret = send_data_block(ir, data_block);
+       ret = send_data_block(tx, data_block);
        if (ret != 0)
                return ret;
 
        /* Send data block length? */
        buf[0] = 0x00;
        buf[1] = 0x40;
-       ret = i2c_master_send(&ir->c_tx, buf, 2);
+       ret = i2c_master_send(tx->c, buf, 2);
        if (ret != 2) {
                zilog_error("i2c_master_send failed with %d\n", ret);
                return ret < 0 ? ret : -EFAULT;
        }
-       ret = i2c_master_send(&ir->c_tx, buf, 1);
+       ret = i2c_master_send(tx->c, buf, 1);
        if (ret != 1) {
                zilog_error("i2c_master_send failed with %d\n", ret);
                return ret < 0 ? ret : -EFAULT;
        }
 
        /* Send finished download? */
-       ret = i2c_master_recv(&ir->c_tx, buf, 1);
+       ret = i2c_master_recv(tx->c, buf, 1);
        if (ret != 1) {
                zilog_error("i2c_master_recv failed with %d\n", ret);
                return ret < 0 ? ret : -EFAULT;
@@ -832,7 +848,7 @@ static int send_code(struct IR *ir, unsigned int code, unsigned int key)
        /* Send prepare command? */
        buf[0] = 0x00;
        buf[1] = 0x80;
-       ret = i2c_master_send(&ir->c_tx, buf, 2);
+       ret = i2c_master_send(tx->c, buf, 2);
        if (ret != 2) {
                zilog_error("i2c_master_send failed with %d\n", ret);
                return ret < 0 ? ret : -EFAULT;
@@ -843,7 +859,7 @@ static int send_code(struct IR *ir, unsigned int code, unsigned int key)
         * last i2c_master_recv always fails with a -5, so for now, we're
         * going to skip this whole mess and say we're done on the HD PVR
         */
-       if (ir->is_hdpvr) {
+       if (!tx->post_tx_ready_poll) {
                dprintk("sent code %u, key %u\n", code, key);
                return 0;
        }
@@ -857,7 +873,7 @@ static int send_code(struct IR *ir, unsigned int code, unsigned int key)
        for (i = 0; i < 20; ++i) {
                set_current_state(TASK_UNINTERRUPTIBLE);
                schedule_timeout((50 * HZ + 999) / 1000);
-               ret = i2c_master_send(&ir->c_tx, buf, 1);
+               ret = i2c_master_send(tx->c, buf, 1);
                if (ret == 1)
                        break;
                dprintk("NAK expected: i2c_master_send "
@@ -870,7 +886,7 @@ static int send_code(struct IR *ir, unsigned int code, unsigned int key)
        }
 
        /* Seems to be an 'ok' response */
-       i = i2c_master_recv(&ir->c_tx, buf, 1);
+       i = i2c_master_recv(tx->c, buf, 1);
        if (i != 1) {
                zilog_error("i2c_master_recv failed with %d\n", ret);
                return -EFAULT;
@@ -895,10 +911,11 @@ static ssize_t write(struct file *filep, const char *buf, size_t n,
                          loff_t *ppos)
 {
        struct IR *ir = filep->private_data;
+       struct IR_tx *tx = ir->tx;
        size_t i;
        int failures = 0;
 
-       if (ir->c_tx.addr == 0)
+       if (tx == NULL)
                return -ENODEV;
 
        /* Validate user parameters */
@@ -919,15 +936,15 @@ static ssize_t write(struct file *filep, const char *buf, size_t n,
                }
 
                /* Send boot data first if required */
-               if (ir->need_boot == 1) {
-                       ret = send_boot_data(ir);
+               if (tx->need_boot == 1) {
+                       ret = send_boot_data(tx);
                        if (ret == 0)
-                               ir->need_boot = 0;
+                               tx->need_boot = 0;
                }
 
                /* Send the code */
                if (ret == 0) {
-                       ret = send_code(ir, (unsigned)command >> 16,
+                       ret = send_code(tx, (unsigned)command >> 16,
                                            (unsigned)command & 0xFFFF);
                        if (ret == -EPROTO) {
                                mutex_unlock(&ir->ir_lock);
@@ -952,7 +969,7 @@ static ssize_t write(struct file *filep, const char *buf, size_t n,
                        }
                        set_current_state(TASK_UNINTERRUPTIBLE);
                        schedule_timeout((100 * HZ + 999) / 1000);
-                       ir->need_boot = 1;
+                       tx->need_boot = 1;
                        ++failures;
                } else
                        i += sizeof(int);
@@ -969,22 +986,23 @@ static ssize_t write(struct file *filep, const char *buf, size_t n,
 static unsigned int poll(struct file *filep, poll_table *wait)
 {
        struct IR *ir = filep->private_data;
+       struct IR_rx *rx = ir->rx;
        unsigned int ret;
 
        dprintk("poll called\n");
-       if (ir->c_rx.addr == 0)
+       if (rx == NULL)
                return -ENODEV;
 
-       mutex_lock(&ir->buf_lock);
+       mutex_lock(&rx->buf_lock);
 
-       poll_wait(filep, &ir->buf.wait_poll, wait);
+       poll_wait(filep, &rx->buf.wait_poll, wait);
 
        dprintk("poll result = %s\n",
-               lirc_buffer_empty(&ir->buf) ? "0" : "POLLIN|POLLRDNORM");
+               lirc_buffer_empty(&rx->buf) ? "0" : "POLLIN|POLLRDNORM");
 
-       ret = lirc_buffer_empty(&ir->buf) ? 0 : (POLLIN|POLLRDNORM);
+       ret = lirc_buffer_empty(&rx->buf) ? 0 : (POLLIN|POLLRDNORM);
 
-       mutex_unlock(&ir->buf_lock);
+       mutex_unlock(&rx->buf_lock);
        return ret;
 }
 
@@ -994,10 +1012,9 @@ static long ioctl(struct file *filep, unsigned int cmd, unsigned long arg)
        int result;
        unsigned long mode, features = 0;
 
-       if (ir->c_rx.addr != 0)
+       features |= LIRC_CAN_SEND_PULSE;
+       if (ir->rx != NULL)
                features |= LIRC_CAN_REC_LIRCCODE;
-       if (ir->c_tx.addr != 0)
-               features |= LIRC_CAN_SEND_PULSE;
 
        switch (cmd) {
        case LIRC_GET_LENGTH:
@@ -1024,15 +1041,9 @@ static long ioctl(struct file *filep, unsigned int cmd, unsigned long arg)
                        result = -EINVAL;
                break;
        case LIRC_GET_SEND_MODE:
-               if (!(features&LIRC_CAN_SEND_MASK))
-                       return -ENOSYS;
-
                result = put_user(LIRC_MODE_PULSE, (unsigned long *) arg);
                break;
        case LIRC_SET_SEND_MODE:
-               if (!(features&LIRC_CAN_SEND_MASK))
-                       return -ENOSYS;
-
                result = get_user(mode, (unsigned long *) arg);
                if (!result && mode != LIRC_MODE_PULSE)
                        return -EINVAL;
@@ -1043,6 +1054,15 @@ static long ioctl(struct file *filep, unsigned int cmd, unsigned long arg)
        return result;
 }
 
+/* ir_devices_lock must be held */
+static struct IR *find_ir_device_by_minor(unsigned int minor)
+{
+       if (minor >= MAX_IRCTL_DEVICES)
+               return NULL;
+
+       return ir_devices[minor];
+}
+
 /*
  * Open the IR device.  Get hold of our IR structure and
  * stash it in private_data for the file
@@ -1051,15 +1071,15 @@ static int open(struct inode *node, struct file *filep)
 {
        struct IR *ir;
        int ret;
+       unsigned int minor = MINOR(node->i_rdev);
 
        /* find our IR struct */
-       unsigned minor = MINOR(node->i_rdev);
-       if (minor >= MAX_IRCTL_DEVICES) {
-               dprintk("minor %d: open result = -ENODEV\n",
-                       minor);
+       mutex_lock(&ir_devices_lock);
+       ir = find_ir_device_by_minor(minor);
+       mutex_unlock(&ir_devices_lock);
+
+       if (ir == NULL)
                return -ENODEV;
-       }
-       ir = ir_devices[minor];
 
        /* increment in use count */
        mutex_lock(&ir->ir_lock);
@@ -1106,7 +1126,6 @@ static struct lirc_driver lirc_template = {
 
 static int ir_remove(struct i2c_client *client);
 static int ir_probe(struct i2c_client *client, const struct i2c_device_id *id);
-static int ir_command(struct i2c_client *client, unsigned int cmd, void *arg);
 
 #define ID_FLAG_TX     0x01
 #define ID_FLAG_HDPVR  0x02
@@ -1126,7 +1145,6 @@ static struct i2c_driver driver = {
        },
        .probe          = ir_probe,
        .remove         = ir_remove,
-       .command        = ir_command,
        .id_table       = ir_transceiver_id,
 };
 
@@ -1144,214 +1162,253 @@ static const struct file_operations lirc_fops = {
        .release        = close
 };
 
-static int ir_remove(struct i2c_client *client)
+static void destroy_rx_kthread(struct IR_rx *rx)
 {
-       struct IR *ir = i2c_get_clientdata(client);
+       /* end up polling thread */
+       if (rx != NULL && !IS_ERR_OR_NULL(rx->task)) {
+               kthread_stop(rx->task);
+               rx->task = NULL;
+       }
+}
 
-       mutex_lock(&ir->ir_lock);
+/* ir_devices_lock must be held */
+static int add_ir_device(struct IR *ir)
+{
+       int i;
 
-       if (ir->have_rx || ir->have_tx) {
-               DECLARE_COMPLETION(tn);
-               DECLARE_COMPLETION(tn2);
-
-               /* end up polling thread */
-               if (ir->task && !IS_ERR(ir->task)) {
-                       ir->t_notify = &tn;
-                       ir->t_notify2 = &tn2;
-                       ir->shutdown = 1;
-                       wake_up_process(ir->task);
-                       complete(&tn2);
-                       wait_for_completion(&tn);
-                       ir->t_notify = NULL;
-                       ir->t_notify2 = NULL;
+       for (i = 0; i < MAX_IRCTL_DEVICES; i++)
+               if (ir_devices[i] == NULL) {
+                       ir_devices[i] = ir;
+                       break;
                }
 
-       } else {
-               mutex_unlock(&ir->ir_lock);
-               zilog_error("%s: detached from something we didn't "
-                           "attach to\n", __func__);
-               return -ENODEV;
+       return i == MAX_IRCTL_DEVICES ? -ENOMEM : i;
+}
+
+/* ir_devices_lock must be held */
+static void del_ir_device(struct IR *ir)
+{
+       int i;
+
+       for (i = 0; i < MAX_IRCTL_DEVICES; i++)
+               if (ir_devices[i] == ir) {
+                       ir_devices[i] = NULL;
+                       break;
+               }
+}
+
+static int ir_remove(struct i2c_client *client)
+{
+       struct IR *ir = i2c_get_clientdata(client);
+
+       mutex_lock(&ir_devices_lock);
+
+       if (ir == NULL) {
+               /* We destroyed everything when the first client came through */
+               mutex_unlock(&ir_devices_lock);
+               return 0;
        }
 
-       /* unregister lirc driver */
-       if (ir->l.minor >= 0 && ir->l.minor < MAX_IRCTL_DEVICES) {
-               lirc_unregister_driver(ir->l.minor);
-               ir_devices[ir->l.minor] = NULL;
+       /* Good-bye LIRC */
+       lirc_unregister_driver(ir->l.minor);
+
+       /* Good-bye Rx */
+       destroy_rx_kthread(ir->rx);
+       if (ir->rx != NULL) {
+               if (ir->rx->buf.fifo_initialized)
+                       lirc_buffer_free(&ir->rx->buf);
+               i2c_set_clientdata(ir->rx->c, NULL);
+               kfree(ir->rx);
        }
 
-       /* free memory */
-       lirc_buffer_free(&ir->buf);
-       mutex_unlock(&ir->ir_lock);
+       /* Good-bye Tx */
+       i2c_set_clientdata(ir->tx->c, NULL);
+       kfree(ir->tx);
+
+       /* Good-bye IR */
+       del_ir_device(ir);
        kfree(ir);
 
+       mutex_unlock(&ir_devices_lock);
        return 0;
 }
 
-static int ir_probe(struct i2c_client *client, const struct i2c_device_id *id)
+
+/* ir_devices_lock must be held */
+static struct IR *find_ir_device_by_adapter(struct i2c_adapter *adapter)
 {
+       int i;
        struct IR *ir = NULL;
+
+       for (i = 0; i < MAX_IRCTL_DEVICES; i++)
+               if (ir_devices[i] != NULL &&
+                   ir_devices[i]->adapter == adapter) {
+                       ir = ir_devices[i];
+                       break;
+               }
+
+       return ir;
+}
+
+static int ir_probe(struct i2c_client *client, const struct i2c_device_id *id)
+{
+       struct IR *ir;
        struct i2c_adapter *adap = client->adapter;
-       char buf;
        int ret;
-       int have_rx = 0, have_tx = 0;
+       bool tx_probe = false;
 
-       dprintk("%s: adapter name (%s) nr %d, i2c_device_id name (%s), "
-               "client addr=0x%02x\n",
-               __func__, adap->name, adap->nr, id->name, client->addr);
+       dprintk("%s: %s on i2c-%d (%s), client addr=0x%02x\n",
+               __func__, id->name, adap->nr, adap->name, client->addr);
 
        /*
-        * FIXME - This probe function probes both the Tx and Rx
-        * addresses of the IR microcontroller.
-        *
-        * However, the I2C subsystem is passing along one I2C client at a
-        * time, based on matches to the ir_transceiver_id[] table above.
-        * The expectation is that each i2c_client address will be probed
-        * individually by drivers so the I2C subsystem can mark all client
-        * addresses as claimed or not.
-        *
-        * This probe routine causes only one of the client addresses, TX or RX,
-        * to be claimed.  This will cause a problem if the I2C subsystem is
-        * subsequently triggered to probe unclaimed clients again.
+        * The IR receiver    is at i2c address 0x71.
+        * The IR transmitter is at i2c address 0x70.
         */
-       /*
-        * The external IR receiver is at i2c address 0x71.
-        * The IR transmitter is at 0x70.
-        */
-       client->addr = 0x70;
 
-       if (!disable_tx) {
-               if (i2c_master_recv(client, &buf, 1) == 1)
-                       have_tx = 1;
-               dprintk("probe 0x70 @ %s: %s\n",
-                       adap->name, have_tx ? "success" : "failed");
-       }
+       if (id->driver_data & ID_FLAG_TX)
+               tx_probe = true;
+       else if (tx_only) /* module option */
+               return -ENXIO;
 
-       if (!disable_rx) {
-               client->addr = 0x71;
-               if (i2c_master_recv(client, &buf, 1) == 1)
-                       have_rx = 1;
-               dprintk("probe 0x71 @ %s: %s\n",
-                       adap->name, have_rx ? "success" : "failed");
-       }
+       zilog_info("probing IR %s on %s (i2c-%d)\n",
+                  tx_probe ? "Tx" : "Rx", adap->name, adap->nr);
 
-       if (!(have_rx || have_tx)) {
-               zilog_error("%s: no devices found\n", adap->name);
-               goto out_nodev;
-       }
+       mutex_lock(&ir_devices_lock);
 
-       printk(KERN_INFO "lirc_zilog: chip found with %s\n",
-               have_rx && have_tx ? "RX and TX" :
-                       have_rx ? "RX only" : "TX only");
+       /* Use a single struct IR instance for both the Rx and Tx functions */
+       ir = find_ir_device_by_adapter(adap);
+       if (ir == NULL) {
+               ir = kzalloc(sizeof(struct IR), GFP_KERNEL);
+               if (ir == NULL) {
+                       ret = -ENOMEM;
+                       goto out_no_ir;
+               }
+               /* store for use in ir_probe() again, and open() later on */
+               ret = add_ir_device(ir);
+               if (ret)
+                       goto out_free_ir;
+
+               ir->adapter = adap;
+               mutex_init(&ir->ir_lock);
+
+               /* set lirc_dev stuff */
+               memcpy(&ir->l, &lirc_template, sizeof(struct lirc_driver));
+               ir->l.minor       = minor; /* module option */
+               ir->l.code_length = 13;
+               ir->l.rbuf        = NULL;
+               ir->l.fops        = &lirc_fops;
+               ir->l.data        = ir;
+               ir->l.dev         = &adap->dev;
+               ir->l.sample_rate = 0;
+       }
 
-       ir = kzalloc(sizeof(struct IR), GFP_KERNEL);
+       if (tx_probe) {
+               /* Set up a struct IR_tx instance */
+               ir->tx = kzalloc(sizeof(struct IR_tx), GFP_KERNEL);
+               if (ir->tx == NULL) {
+                       ret = -ENOMEM;
+                       goto out_free_xx;
+               }
 
-       if (!ir)
-               goto out_nomem;
+               ir->tx->c = client;
+               ir->tx->need_boot = 1;
+               ir->tx->post_tx_ready_poll =
+                              (id->driver_data & ID_FLAG_HDPVR) ? false : true;
+       } else {
+               /* Set up a struct IR_rx instance */
+               ir->rx = kzalloc(sizeof(struct IR_rx), GFP_KERNEL);
+               if (ir->rx == NULL) {
+                       ret = -ENOMEM;
+                       goto out_free_xx;
+               }
 
-       ret = lirc_buffer_init(&ir->buf, 2, BUFLEN / 2);
-       if (ret)
-               goto out_nomem;
+               ret = lirc_buffer_init(&ir->rx->buf, 2, BUFLEN / 2);
+               if (ret)
+                       goto out_free_xx;
 
-       mutex_init(&ir->ir_lock);
-       mutex_init(&ir->buf_lock);
-       ir->need_boot = 1;
-       ir->is_hdpvr = (id->driver_data & ID_FLAG_HDPVR) ? true : false;
+               mutex_init(&ir->rx->buf_lock);
+               ir->rx->c = client;
+               ir->rx->hdpvr_data_fmt =
+                              (id->driver_data & ID_FLAG_HDPVR) ? true : false;
 
-       memcpy(&ir->l, &lirc_template, sizeof(struct lirc_driver));
-       ir->l.minor = -1;
+               /* set lirc_dev stuff */
+               ir->l.rbuf = &ir->rx->buf;
+       }
 
-       /* I2C attach to device */
        i2c_set_clientdata(client, ir);
 
-       /* initialise RX device */
-       if (have_rx) {
-               DECLARE_COMPLETION(tn);
-               memcpy(&ir->c_rx, client, sizeof(struct i2c_client));
-
-               ir->c_rx.addr = 0x71;
-               strlcpy(ir->c_rx.name, ZILOG_HAUPPAUGE_IR_RX_NAME,
-                       I2C_NAME_SIZE);
+       /* Proceed only if we have the required Tx and Rx clients ready to go */
+       if (ir->tx == NULL ||
+           (ir->rx == NULL && !tx_only)) {
+               zilog_info("probe of IR %s on %s (i2c-%d) done. Waiting on "
+                          "IR %s.\n", tx_probe ? "Tx" : "Rx", adap->name,
+                          adap->nr, tx_probe ? "Rx" : "Tx");
+               goto out_ok;
+       }
 
+       /* initialise RX device */
+       if (ir->rx != NULL) {
                /* try to fire up polling thread */
-               ir->t_notify = &tn;
-               ir->task = kthread_run(lirc_thread, ir, "lirc_zilog");
-               if (IS_ERR(ir->task)) {
-                       ret = PTR_ERR(ir->task);
-                       zilog_error("lirc_register_driver: cannot run "
-                                   "poll thread %d\n", ret);
-                       goto err;
+               ir->rx->task = kthread_run(lirc_thread, ir,
+                                          "zilog-rx-i2c-%d", adap->nr);
+               if (IS_ERR(ir->rx->task)) {
+                       ret = PTR_ERR(ir->rx->task);
+                       zilog_error("%s: could not start IR Rx polling thread"
+                                   "\n", __func__);
+                       goto out_free_xx;
                }
-               wait_for_completion(&tn);
-               ir->t_notify = NULL;
-               ir->have_rx = 1;
-       }
-
-       /* initialise TX device */
-       if (have_tx) {
-               memcpy(&ir->c_tx, client, sizeof(struct i2c_client));
-               ir->c_tx.addr = 0x70;
-               strlcpy(ir->c_tx.name, ZILOG_HAUPPAUGE_IR_TX_NAME,
-                       I2C_NAME_SIZE);
-               ir->have_tx = 1;
        }
 
-       /* set lirc_dev stuff */
-       ir->l.code_length = 13;
-       ir->l.rbuf        = &ir->buf;
-       ir->l.fops        = &lirc_fops;
-       ir->l.data        = ir;
-       ir->l.minor       = minor;
-       ir->l.dev         = &adap->dev;
-       ir->l.sample_rate = 0;
-
        /* register with lirc */
        ir->l.minor = lirc_register_driver(&ir->l);
        if (ir->l.minor < 0 || ir->l.minor >= MAX_IRCTL_DEVICES) {
-               zilog_error("ir_attach: \"minor\" must be between 0 and %d "
-                           "(%d)!\n", MAX_IRCTL_DEVICES-1, ir->l.minor);
+               zilog_error("%s: \"minor\" must be between 0 and %d (%d)!\n",
+                           __func__, MAX_IRCTL_DEVICES-1, ir->l.minor);
                ret = -EBADRQC;
-               goto err;
+               goto out_free_thread;
        }
 
-       /* store this for getting back in open() later on */
-       ir_devices[ir->l.minor] = ir;
-
        /*
         * if we have the tx device, load the 'firmware'.  We do this
         * after registering with lirc as otherwise hotplug seems to take
         * 10s to create the lirc device.
         */
-       if (have_tx) {
-               /* Special TX init */
-               ret = tx_init(ir);
-               if (ret != 0)
-                       goto err;
-       }
+       ret = tx_init(ir->tx);
+       if (ret != 0)
+               goto out_unregister;
 
+       zilog_info("probe of IR %s on %s (i2c-%d) done. IR unit ready.\n",
+                  tx_probe ? "Tx" : "Rx", adap->name, adap->nr);
+out_ok:
+       mutex_unlock(&ir_devices_lock);
        return 0;
 
-err:
-       /* undo everything, hopefully... */
-       if (ir->c_rx.addr)
-               ir_remove(&ir->c_rx);
-       if (ir->c_tx.addr)
-               ir_remove(&ir->c_tx);
-       return ret;
-
-out_nodev:
-       zilog_error("no device found\n");
-       return -ENODEV;
-
-out_nomem:
-       zilog_error("memory allocation failure\n");
+out_unregister:
+       lirc_unregister_driver(ir->l.minor);
+out_free_thread:
+       destroy_rx_kthread(ir->rx);
+out_free_xx:
+       if (ir->rx != NULL) {
+               if (ir->rx->buf.fifo_initialized)
+                       lirc_buffer_free(&ir->rx->buf);
+               if (ir->rx->c != NULL)
+                       i2c_set_clientdata(ir->rx->c, NULL);
+               kfree(ir->rx);
+       }
+       if (ir->tx != NULL) {
+               if (ir->tx->c != NULL)
+                       i2c_set_clientdata(ir->tx->c, NULL);
+               kfree(ir->tx);
+       }
+out_free_ir:
+       del_ir_device(ir);
        kfree(ir);
-       return -ENOMEM;
-}
-
-static int ir_command(struct i2c_client *client, unsigned int cmd, void *arg)
-{
-       /* nothing */
-       return 0;
+out_no_ir:
+       zilog_error("%s: probing IR %s on %s (i2c-%d) failed with %d\n",
+                   __func__, tx_probe ? "Tx" : "Rx", adap->name, adap->nr,
+                  ret);
+       mutex_unlock(&ir_devices_lock);
+       return ret;
 }
 
 static int __init zilog_init(void)
@@ -1361,6 +1418,7 @@ static int __init zilog_init(void)
        zilog_notify("Zilog/Hauppauge IR driver initializing\n");
 
        mutex_init(&tx_data_lock);
+       mutex_init(&ir_devices_lock);
 
        request_module("firmware_class");
 
@@ -1386,7 +1444,8 @@ module_exit(zilog_exit);
 
 MODULE_DESCRIPTION("Zilog/Hauppauge infrared transmitter driver (i2c stack)");
 MODULE_AUTHOR("Gerd Knorr, Michal Kochanowicz, Christoph Bartelmus, "
-             "Ulrich Mueller, Stefan Jahn, Jerome Brock, Mark Weaver");
+             "Ulrich Mueller, Stefan Jahn, Jerome Brock, Mark Weaver, "
+             "Andy Walls");
 MODULE_LICENSE("GPL");
 /* for compat with old name, which isn't all that accurate anymore */
 MODULE_ALIAS("lirc_pvr150");
@@ -1397,8 +1456,5 @@ MODULE_PARM_DESC(minor, "Preferred minor device number");
 module_param(debug, bool, 0644);
 MODULE_PARM_DESC(debug, "Enable debugging messages");
 
-module_param(disable_rx, bool, 0644);
-MODULE_PARM_DESC(disable_rx, "Disable the IR receiver device");
-
-module_param(disable_tx, bool, 0644);
-MODULE_PARM_DESC(disable_tx, "Disable the IR transmitter device");
+module_param(tx_only, bool, 0644);
+MODULE_PARM_DESC(tx_only, "Only handle the IR transmit function");
index 8fe017c3721fbb7415a8270059492fe83e47dd2f..eb9b9f1bc1387250f4382d23f721851c031c9693 100644 (file)
@@ -1450,29 +1450,55 @@ static struct video_device tm6000_template = {
  * ------------------------------------------------------------------
  */
 
-int tm6000_v4l2_register(struct tm6000_core *dev)
+static struct video_device *vdev_init(struct tm6000_core *dev,
+               const struct video_device
+               *template, const char *type_name)
 {
-       int ret = -1;
        struct video_device *vfd;
 
        vfd = video_device_alloc();
-       if(!vfd) {
+       if (NULL == vfd)
+               return NULL;
+
+       *vfd = *template;
+       vfd->v4l2_dev = &dev->v4l2_dev;
+       vfd->release = video_device_release;
+       vfd->debug = tm6000_debug;
+       vfd->lock = &dev->lock;
+
+       snprintf(vfd->name, sizeof(vfd->name), "%s %s", dev->name, type_name);
+
+       video_set_drvdata(vfd, dev);
+       return vfd;
+}
+
+int tm6000_v4l2_register(struct tm6000_core *dev)
+{
+       int ret = -1;
+
+       dev->vfd = vdev_init(dev, &tm6000_template, "video");
+
+       if (!dev->vfd) {
+               printk(KERN_INFO "%s: can't register video device\n",
+                      dev->name);
                return -ENOMEM;
        }
-       dev->vfd = vfd;
 
        /* init video dma queues */
        INIT_LIST_HEAD(&dev->vidq.active);
        INIT_LIST_HEAD(&dev->vidq.queued);
 
-       memcpy(dev->vfd, &tm6000_template, sizeof(*(dev->vfd)));
-       dev->vfd->debug = tm6000_debug;
-       dev->vfd->lock = &dev->lock;
+       ret = video_register_device(dev->vfd, VFL_TYPE_GRABBER, video_nr);
 
-       vfd->v4l2_dev = &dev->v4l2_dev;
-       video_set_drvdata(vfd, dev);
+       if (ret < 0) {
+               printk(KERN_INFO "%s: can't register video device\n",
+                      dev->name);
+               return ret;
+       }
+
+       printk(KERN_INFO "%s: registered device %s\n",
+              dev->name, video_device_node_name(dev->vfd));
 
-       ret = video_register_device(dev->vfd, VFL_TYPE_GRABBER, video_nr);
        printk(KERN_INFO "Trident TVMaster TM5600/TM6000/TM6010 USB2 board (Load status: %d)\n", ret);
        return ret;
 }
index c43ef48b1a0fee3df1601497367e7350a20d057a..396277216e4ffdddf37e48d595e5a865b6546e46 100644 (file)
@@ -9,3 +9,5 @@ obj-$(CONFIG_N_GSM)             += n_gsm.o
 obj-$(CONFIG_R3964)            += n_r3964.o
 
 obj-y                          += vt/
+obj-$(CONFIG_HVC_DRIVER)       += hvc/
+obj-y                          += serial/
diff --git a/drivers/tty/hvc/Makefile b/drivers/tty/hvc/Makefile
new file mode 100644 (file)
index 0000000..e6bed5f
--- /dev/null
@@ -0,0 +1,13 @@
+obj-$(CONFIG_HVC_CONSOLE)      += hvc_vio.o hvsi.o
+obj-$(CONFIG_HVC_ISERIES)      += hvc_iseries.o
+obj-$(CONFIG_HVC_RTAS)         += hvc_rtas.o
+obj-$(CONFIG_HVC_TILE)         += hvc_tile.o
+obj-$(CONFIG_HVC_DCC)          += hvc_dcc.o
+obj-$(CONFIG_HVC_BEAT)         += hvc_beat.o
+obj-$(CONFIG_HVC_DRIVER)       += hvc_console.o
+obj-$(CONFIG_HVC_IRQ)          += hvc_irq.o
+obj-$(CONFIG_HVC_XEN)          += hvc_xen.o
+obj-$(CONFIG_HVC_IUCV)         += hvc_iucv.o
+obj-$(CONFIG_HVC_UDBG)         += hvc_udbg.o
+obj-$(CONFIG_HVCS)             += hvcs.o
+obj-$(CONFIG_VIRTIO_CONSOLE)   += virtio_console.o
similarity index 100%
rename from drivers/char/hvcs.c
rename to drivers/tty/hvc/hvcs.c
similarity index 100%
rename from drivers/char/hvsi.c
rename to drivers/tty/hvc/hvsi.c
similarity index 99%
rename from drivers/serial/Kconfig
rename to drivers/tty/serial/Kconfig
index c1df7676a73d6f04cf6357e2d01a044556164fca..b1682d7f1d8a2492ad59aea18622cb4294b71813 100644 (file)
@@ -81,7 +81,7 @@ config SERIAL_8250_GSC
        default SERIAL_8250
 
 config SERIAL_8250_PCI
-       tristate "8250/16550 PCI device support" if EMBEDDED
+       tristate "8250/16550 PCI device support" if EXPERT
        depends on SERIAL_8250 && PCI
        default SERIAL_8250
        help
@@ -90,7 +90,7 @@ config SERIAL_8250_PCI
          Saves about 9K.
 
 config SERIAL_8250_PNP
-       tristate "8250/16550 PNP device support" if EMBEDDED
+       tristate "8250/16550 PNP device support" if EXPERT
        depends on SERIAL_8250 && PNP
        default SERIAL_8250
        help
similarity index 100%
rename from drivers/serial/dz.c
rename to drivers/tty/serial/dz.c
similarity index 100%
rename from drivers/serial/dz.h
rename to drivers/tty/serial/dz.h
similarity index 100%
rename from drivers/serial/zs.c
rename to drivers/tty/serial/zs.c
similarity index 100%
rename from drivers/serial/zs.h
rename to drivers/tty/serial/zs.h
index bcc24779ba0e3145f713dd7bf6c0f73368763de3..18d02e32a3d5f6d38adcd3f1f90bafc4a84a6f1c 100644 (file)
@@ -123,9 +123,9 @@ config USB_OTG
 
 config USB_OTG_WHITELIST
        bool "Rely on OTG Targeted Peripherals List"
-       depends on USB_OTG || EMBEDDED
+       depends on USB_OTG || EXPERT
        default y if USB_OTG
-       default n if EMBEDDED
+       default n if EXPERT
        help
          If you say Y here, the "otg_whitelist.h" file will be used as a
          product whitelist, so USB peripherals not listed there will be
@@ -141,7 +141,7 @@ config USB_OTG_WHITELIST
 
 config USB_OTG_BLACKLIST_HUB
        bool "Disable external hubs"
-       depends on USB_OTG || EMBEDDED
+       depends on USB_OTG || EXPERT
        help
          If you say Y here, then Linux will refuse to enumerate
          external hubs.  OTG hosts are allowed to reduce hardware
index d916ac04abab098ee480720cac0a1036642c9ab9..6bafb51bb43738a415ba09547a49bef21809f9a1 100644 (file)
@@ -1227,7 +1227,7 @@ config FB_CARILLO_RANCH
 
 config FB_INTEL
        tristate "Intel 830M/845G/852GM/855GM/865G/915G/945G/945GM/965G/965GM support (EXPERIMENTAL)"
-       depends on EXPERIMENTAL && FB && PCI && X86 && AGP_INTEL && EMBEDDED
+       depends on EXPERIMENTAL && FB && PCI && X86 && AGP_INTEL && EXPERT
        select FB_MODE_HELPERS
        select FB_CFB_FILLRECT
        select FB_CFB_COPYAREA
index c789c46e38af2040f55acd769ec514a32e2ce4f9..b224396b86d56ce0f63ecd765b14e6e59d010fd0 100644 (file)
@@ -21,7 +21,7 @@
 #define MAX_BRIGHTNESS         (0xFF)
 #define MIN_BRIGHTNESS         (0)
 
-#define CURRENT_MASK           (0x1F << 1)
+#define CURRENT_BITMASK                (0x1F << 1)
 
 struct pm860x_backlight_data {
        struct pm860x_chip *chip;
@@ -85,7 +85,7 @@ static int pm860x_backlight_set(struct backlight_device *bl, int brightness)
        if ((data->current_brightness == 0) && brightness) {
                if (data->iset) {
                        ret = pm860x_set_bits(data->i2c, wled_idc(data->port),
-                                             CURRENT_MASK, data->iset);
+                                             CURRENT_BITMASK, data->iset);
                        if (ret < 0)
                                goto out;
                }
index 5a35f22372b9959e52f1a8ab267a17baaf492b92..2209e354f53110bc8b6670ce09c0626cf340941a 100644 (file)
@@ -5,7 +5,7 @@
 menu "Console display driver support"
 
 config VGA_CONSOLE
-       bool "VGA text console" if EMBEDDED || !X86
+       bool "VGA text console" if EXPERT || !X86
        depends on !4xx && !8xx && !SPARC && !M68K && !PARISC && !FRV && !SUPERH && !BLACKFIN && !AVR32 && !MN10300 && (!ARM || ARCH_FOOTBRIDGE || ARCH_INTEGRATOR || ARCH_NETWINDER)
        default y
        help
index ef8d9d558fc734183dd82a172e49f9ee7a07b8ae..4fb5b2bf23486c0bee03f0dd3de196aff7f40549 100644 (file)
@@ -96,11 +96,6 @@ static struct pci_device_id virtio_pci_id_table[] = {
 
 MODULE_DEVICE_TABLE(pci, virtio_pci_id_table);
 
-/* A PCI device has it's own struct device and so does a virtio device so
- * we create a place for the virtio devices to show up in sysfs.  I think it
- * would make more sense for virtio to not insist on having it's own device. */
-static struct device *virtio_pci_root;
-
 /* Convert a generic virtio device to our structure */
 static struct virtio_pci_device *to_vp_device(struct virtio_device *vdev)
 {
@@ -629,7 +624,7 @@ static int __devinit virtio_pci_probe(struct pci_dev *pci_dev,
        if (vp_dev == NULL)
                return -ENOMEM;
 
-       vp_dev->vdev.dev.parent = virtio_pci_root;
+       vp_dev->vdev.dev.parent = &pci_dev->dev;
        vp_dev->vdev.dev.release = virtio_pci_release_dev;
        vp_dev->vdev.config = &virtio_pci_config_ops;
        vp_dev->pci_dev = pci_dev;
@@ -717,17 +712,7 @@ static struct pci_driver virtio_pci_driver = {
 
 static int __init virtio_pci_init(void)
 {
-       int err;
-
-       virtio_pci_root = root_device_register("virtio-pci");
-       if (IS_ERR(virtio_pci_root))
-               return PTR_ERR(virtio_pci_root);
-
-       err = pci_register_driver(&virtio_pci_driver);
-       if (err)
-               root_device_unregister(virtio_pci_root);
-
-       return err;
+       return pci_register_driver(&virtio_pci_driver);
 }
 
 module_init(virtio_pci_init);
@@ -735,7 +720,6 @@ module_init(virtio_pci_init);
 static void __exit virtio_pci_exit(void)
 {
        pci_unregister_driver(&virtio_pci_driver);
-       root_device_unregister(virtio_pci_root);
 }
 
 module_exit(virtio_pci_exit);
index 1c1236087f785a20b1351e375b6ea4b9e1d1444e..bbd000f88af7056ed8c5f52ae891c5375c8bd875 100644 (file)
@@ -122,6 +122,7 @@ static ssize_t xenbus_file_read(struct file *filp,
        int ret;
 
        mutex_lock(&u->reply_mutex);
+again:
        while (list_empty(&u->read_buffers)) {
                mutex_unlock(&u->reply_mutex);
                if (filp->f_flags & O_NONBLOCK)
@@ -144,7 +145,7 @@ static ssize_t xenbus_file_read(struct file *filp,
                i += sz - ret;
                rb->cons += sz - ret;
 
-               if (ret != sz) {
+               if (ret != 0) {
                        if (i == 0)
                                i = -EFAULT;
                        goto out;
@@ -160,6 +161,8 @@ static ssize_t xenbus_file_read(struct file *filp,
                                        struct read_buffer, list);
                }
        }
+       if (i == 0)
+               goto again;
 
 out:
        mutex_unlock(&u->reply_mutex);
@@ -407,6 +410,7 @@ static int xenbus_write_watch(unsigned msg_type, struct xenbus_file_priv *u)
 
                mutex_lock(&u->reply_mutex);
                rc = queue_reply(&u->read_buffers, &reply, sizeof(reply));
+               wake_up(&u->read_waitq);
                mutex_unlock(&u->reply_mutex);
        }
 
@@ -455,7 +459,7 @@ static ssize_t xenbus_file_write(struct file *filp,
 
        ret = copy_from_user(u->u.buffer + u->len, ubuf, len);
 
-       if (ret == len) {
+       if (ret != 0) {
                rc = -EFAULT;
                goto out;
        }
@@ -488,21 +492,6 @@ static ssize_t xenbus_file_write(struct file *filp,
        msg_type = u->u.msg.type;
 
        switch (msg_type) {
-       case XS_TRANSACTION_START:
-       case XS_TRANSACTION_END:
-       case XS_DIRECTORY:
-       case XS_READ:
-       case XS_GET_PERMS:
-       case XS_RELEASE:
-       case XS_GET_DOMAIN_PATH:
-       case XS_WRITE:
-       case XS_MKDIR:
-       case XS_RM:
-       case XS_SET_PERMS:
-               /* Send out a transaction */
-               ret = xenbus_write_transaction(msg_type, u);
-               break;
-
        case XS_WATCH:
        case XS_UNWATCH:
                /* (Un)Ask for some path to be watched for changes */
@@ -510,7 +499,8 @@ static ssize_t xenbus_file_write(struct file *filp,
                break;
 
        default:
-               ret = -EINVAL;
+               /* Send out a transaction */
+               ret = xenbus_write_transaction(msg_type, u);
                break;
        }
        if (ret != 0)
@@ -555,6 +545,7 @@ static int xenbus_file_release(struct inode *inode, struct file *filp)
        struct xenbus_file_priv *u = filp->private_data;
        struct xenbus_transaction_holder *trans, *tmp;
        struct watch_adapter *watch, *tmp_watch;
+       struct read_buffer *rb, *tmp_rb;
 
        /*
         * No need for locking here because there are no other users,
@@ -573,6 +564,10 @@ static int xenbus_file_release(struct inode *inode, struct file *filp)
                free_watch_adapter(watch);
        }
 
+       list_for_each_entry_safe(rb, tmp_rb, &u->read_buffers, list) {
+               list_del(&rb->list);
+               kfree(rb);
+       }
        kfree(u);
 
        return 0;
index 9a7921ae47637c691c69428cc9e67934e52ee240..3db9caa57edcbfcf260436b4cd4fb15e3fc070f4 100644 (file)
@@ -50,7 +50,7 @@ config EXPORTFS
        tristate
 
 config FILE_LOCKING
-       bool "Enable POSIX file locking API" if EMBEDDED
+       bool "Enable POSIX file locking API" if EXPERT
        default y
        help
          This option enables standard file locking support, required
index 1f016bfb42d5ed3851762d133c7d1f11e7fed65b..54f9237927288bd43d629156ddbd7a77532a9d48 100644 (file)
@@ -88,14 +88,6 @@ struct autofs_info {
 
        uid_t uid;
        gid_t gid;
-
-       mode_t  mode;
-       size_t  size;
-
-       void (*free)(struct autofs_info *);
-       union {
-               const char *symlink;
-       } u;
 };
 
 #define AUTOFS_INF_EXPIRING    (1<<0) /* dentry is in the process of expiring */
@@ -175,7 +167,7 @@ static inline int autofs4_ispending(struct dentry *dentry)
        return 0;
 }
 
-struct inode *autofs4_get_inode(struct super_block *, struct autofs_info *);
+struct inode *autofs4_get_inode(struct super_block *, mode_t);
 void autofs4_free_ino(struct autofs_info *);
 
 /* Expiration */
@@ -285,7 +277,8 @@ static inline void managed_dentry_clear_managed(struct dentry *dentry)
 /* Initializing function */
 
 int autofs4_fill_super(struct super_block *, void *, int);
-struct autofs_info *autofs4_init_ino(struct autofs_info *, struct autofs_sb_info *sbi, mode_t mode);
+struct autofs_info *autofs4_new_ino(struct autofs_sb_info *);
+void autofs4_clean_ino(struct autofs_info *);
 
 /* Queue management functions */
 
@@ -345,5 +338,4 @@ static inline void autofs4_del_expiring(struct dentry *dentry)
        return;
 }
 
-void autofs4_dentry_release(struct dentry *);
 extern void autofs4_kill_sb(struct super_block *);
index 3ed79d76c233bf2fb7c2955391e1615672fd85ac..f43100b9662bd020f2fd609a68e7d4e1f2243ad0 100644 (file)
@@ -96,7 +96,7 @@ static struct dentry *get_next_positive_dentry(struct dentry *prev,
        struct dentry *p, *ret;
 
        if (prev == NULL)
-               return dget(prev);
+               return dget(root);
 
        spin_lock(&autofs4_lock);
 relock:
@@ -133,7 +133,7 @@ again:
        spin_lock_nested(&ret->d_lock, DENTRY_D_LOCK_NESTED);
        /* Negative dentry - try next */
        if (!simple_positive(ret)) {
-               spin_unlock(&ret->d_lock);
+               spin_unlock(&p->d_lock);
                p = ret;
                goto again;
        }
index 9e1a9dad23e16663fc69937ebc47dd7f286529f2..180fa2425e49310e9674a227c13297a1718f53fa 100644 (file)
 #include "autofs_i.h"
 #include <linux/module.h>
 
-static void ino_lnkfree(struct autofs_info *ino)
+struct autofs_info *autofs4_new_ino(struct autofs_sb_info *sbi)
 {
-       if (ino->u.symlink) {
-               kfree(ino->u.symlink);
-               ino->u.symlink = NULL;
-       }
-}
-
-struct autofs_info *autofs4_init_ino(struct autofs_info *ino,
-                                    struct autofs_sb_info *sbi, mode_t mode)
-{
-       int reinit = 1;
-
-       if (ino == NULL) {
-               reinit = 0;
-               ino = kmalloc(sizeof(*ino), GFP_KERNEL);
-       }
-
-       if (ino == NULL)
-               return NULL;
-
-       if (!reinit) {
-               ino->flags = 0;
-               ino->dentry = NULL;
-               ino->size = 0;
+       struct autofs_info *ino = kzalloc(sizeof(*ino), GFP_KERNEL);
+       if (ino) {
                INIT_LIST_HEAD(&ino->active);
-               ino->active_count = 0;
                INIT_LIST_HEAD(&ino->expiring);
-               atomic_set(&ino->count, 0);
+               ino->last_used = jiffies;
+               ino->sbi = sbi;
        }
+       return ino;
+}
 
+void autofs4_clean_ino(struct autofs_info *ino)
+{
        ino->uid = 0;
        ino->gid = 0;
-       ino->mode = mode;
        ino->last_used = jiffies;
-
-       ino->sbi = sbi;
-
-       if (reinit && ino->free)
-               (ino->free)(ino);
-
-       memset(&ino->u, 0, sizeof(ino->u));
-
-       ino->free = NULL;
-
-       if (S_ISLNK(mode))
-               ino->free = ino_lnkfree;
-
-       return ino;
 }
 
 void autofs4_free_ino(struct autofs_info *ino)
 {
-       if (ino->dentry) {
-               ino->dentry->d_fsdata = NULL;
-               ino->dentry = NULL;
-       }
-       if (ino->free)
-               (ino->free)(ino);
        kfree(ino);
 }
 
@@ -136,9 +98,16 @@ static int autofs4_show_options(struct seq_file *m, struct vfsmount *mnt)
        return 0;
 }
 
+static void autofs4_evict_inode(struct inode *inode)
+{
+       end_writeback(inode);
+       kfree(inode->i_private);
+}
+
 static const struct super_operations autofs4_sops = {
        .statfs         = simple_statfs,
        .show_options   = autofs4_show_options,
+       .evict_inode    = autofs4_evict_inode,
 };
 
 enum {Opt_err, Opt_fd, Opt_uid, Opt_gid, Opt_pgrp, Opt_minproto, Opt_maxproto,
@@ -228,17 +197,6 @@ static int parse_options(char *options, int *pipefd, uid_t *uid, gid_t *gid,
        return (*pipefd < 0);
 }
 
-static struct autofs_info *autofs4_mkroot(struct autofs_sb_info *sbi)
-{
-       struct autofs_info *ino;
-
-       ino = autofs4_init_ino(NULL, sbi, S_IFDIR | 0755);
-       if (!ino)
-               return NULL;
-
-       return ino;
-}
-
 int autofs4_fill_super(struct super_block *s, void *data, int silent)
 {
        struct inode * root_inode;
@@ -282,10 +240,10 @@ int autofs4_fill_super(struct super_block *s, void *data, int silent)
        /*
         * Get the root inode and dentry, but defer checking for errors.
         */
-       ino = autofs4_mkroot(sbi);
+       ino = autofs4_new_ino(sbi);
        if (!ino)
                goto fail_free;
-       root_inode = autofs4_get_inode(s, ino);
+       root_inode = autofs4_get_inode(s, S_IFDIR | 0755);
        if (!root_inode)
                goto fail_ino;
 
@@ -368,15 +326,14 @@ fail_unlock:
        return -EINVAL;
 }
 
-struct inode *autofs4_get_inode(struct super_block *sb,
-                               struct autofs_info *inf)
+struct inode *autofs4_get_inode(struct super_block *sb, mode_t mode)
 {
        struct inode *inode = new_inode(sb);
 
        if (inode == NULL)
                return NULL;
 
-       inode->i_mode = inf->mode;
+       inode->i_mode = mode;
        if (sb->s_root) {
                inode->i_uid = sb->s_root->d_inode->i_uid;
                inode->i_gid = sb->s_root->d_inode->i_gid;
@@ -384,12 +341,11 @@ struct inode *autofs4_get_inode(struct super_block *sb,
        inode->i_atime = inode->i_mtime = inode->i_ctime = CURRENT_TIME;
        inode->i_ino = get_next_ino();
 
-       if (S_ISDIR(inf->mode)) {
+       if (S_ISDIR(mode)) {
                inode->i_nlink = 2;
                inode->i_op = &autofs4_dir_inode_operations;
                inode->i_fop = &autofs4_dir_operations;
-       } else if (S_ISLNK(inf->mode)) {
-               inode->i_size = inf->size;
+       } else if (S_ISLNK(mode)) {
                inode->i_op = &autofs4_symlink_inode_operations;
        }
 
index 1dba035fc37651db8906ad7e8e8b5cc075b587e2..014e7aba3b08dcb6fe4a9395d2ec513d91ad4205 100644 (file)
@@ -37,6 +37,7 @@ static int autofs4_dir_open(struct inode *inode, struct file *file);
 static struct dentry *autofs4_lookup(struct inode *,struct dentry *, struct nameidata *);
 static struct vfsmount *autofs4_d_automount(struct path *);
 static int autofs4_d_manage(struct dentry *, bool, bool);
+static void autofs4_dentry_release(struct dentry *);
 
 const struct file_operations autofs4_root_operations = {
        .open           = dcache_dir_open,
@@ -138,25 +139,26 @@ out:
        return dcache_dir_open(inode, file);
 }
 
-void autofs4_dentry_release(struct dentry *de)
+static void autofs4_dentry_release(struct dentry *de)
 {
-       struct autofs_info *inf;
+       struct autofs_info *ino = autofs4_dentry_ino(de);
+       struct autofs_sb_info *sbi = autofs4_sbi(de->d_sb);
 
        DPRINTK("releasing %p", de);
 
-       inf = autofs4_dentry_ino(de);
-       if (inf) {
-               struct autofs_sb_info *sbi = autofs4_sbi(de->d_sb);
-               if (sbi) {
-                       spin_lock(&sbi->lookup_lock);
-                       if (!list_empty(&inf->active))
-                               list_del(&inf->active);
-                       if (!list_empty(&inf->expiring))
-                               list_del(&inf->expiring);
-                       spin_unlock(&sbi->lookup_lock);
-               }
-               autofs4_free_ino(inf);
+       if (!ino)
+               return;
+
+       if (sbi) {
+               spin_lock(&sbi->lookup_lock);
+               if (!list_empty(&ino->active))
+                       list_del(&ino->active);
+               if (!list_empty(&ino->expiring))
+                       list_del(&ino->expiring);
+               spin_unlock(&sbi->lookup_lock);
        }
+
+       autofs4_free_ino(ino);
 }
 
 static struct dentry *autofs4_lookup_active(struct dentry *dentry)
@@ -488,7 +490,8 @@ static struct dentry *autofs4_lookup(struct inode *dir, struct dentry *dentry, s
        sbi = autofs4_sbi(dir->i_sb);
 
        DPRINTK("pid = %u, pgrp = %u, catatonic = %d, oz_mode = %d",
-               current->pid, task_pgrp_nr(current), sbi->catatonic, oz_mode);
+               current->pid, task_pgrp_nr(current), sbi->catatonic,
+               autofs4_oz_mode(sbi));
 
        active = autofs4_lookup_active(dentry);
        if (active) {
@@ -507,7 +510,7 @@ static struct dentry *autofs4_lookup(struct inode *dir, struct dentry *dentry, s
                if (autofs_type_indirect(sbi->type) && IS_ROOT(dentry->d_parent))
                        __managed_dentry_set_managed(dentry);
 
-               ino = autofs4_init_ino(NULL, sbi, 0555);
+               ino = autofs4_new_ino(sbi);
                if (!ino)
                        return ERR_PTR(-ENOMEM);
 
@@ -529,6 +532,7 @@ static int autofs4_dir_symlink(struct inode *dir,
        struct autofs_info *ino = autofs4_dentry_ino(dentry);
        struct autofs_info *p_ino;
        struct inode *inode;
+       size_t size = strlen(symname);
        char *cp;
 
        DPRINTK("%s <- %.*s", symname,
@@ -537,39 +541,35 @@ static int autofs4_dir_symlink(struct inode *dir,
        if (!autofs4_oz_mode(sbi))
                return -EACCES;
 
-       ino = autofs4_init_ino(ino, sbi, S_IFLNK | 0555);
-       if (!ino)
-               return -ENOMEM;
+       BUG_ON(!ino);
+
+       autofs4_clean_ino(ino);
 
        autofs4_del_active(dentry);
 
-       ino->size = strlen(symname);
-       cp = kmalloc(ino->size + 1, GFP_KERNEL);
-       if (!cp) {
-               if (!dentry->d_fsdata)
-                       kfree(ino);
+       cp = kmalloc(size + 1, GFP_KERNEL);
+       if (!cp)
                return -ENOMEM;
-       }
 
        strcpy(cp, symname);
 
-       inode = autofs4_get_inode(dir->i_sb, ino);
+       inode = autofs4_get_inode(dir->i_sb, S_IFLNK | 0555);
        if (!inode) {
                kfree(cp);
                if (!dentry->d_fsdata)
                        kfree(ino);
                return -ENOMEM;
        }
+       inode->i_private = cp;
+       inode->i_size = size;
        d_add(dentry, inode);
 
-       dentry->d_fsdata = ino;
-       ino->dentry = dget(dentry);
+       dget(dentry);
        atomic_inc(&ino->count);
        p_ino = autofs4_dentry_ino(dentry->d_parent);
        if (p_ino && dentry->d_parent != dentry)
                atomic_inc(&p_ino->count);
 
-       ino->u.symlink = cp;
        dir->i_mtime = CURRENT_TIME;
 
        return 0;
@@ -732,25 +732,21 @@ static int autofs4_dir_mkdir(struct inode *dir, struct dentry *dentry, int mode)
        DPRINTK("dentry %p, creating %.*s",
                dentry, dentry->d_name.len, dentry->d_name.name);
 
-       ino = autofs4_init_ino(ino, sbi, S_IFDIR | 0555);
-       if (!ino)
-               return -ENOMEM;
+       BUG_ON(!ino);
+
+       autofs4_clean_ino(ino);
 
        autofs4_del_active(dentry);
 
-       inode = autofs4_get_inode(dir->i_sb, ino);
-       if (!inode) {
-               if (!dentry->d_fsdata)
-                       kfree(ino);
+       inode = autofs4_get_inode(dir->i_sb, S_IFDIR | 0555);
+       if (!inode)
                return -ENOMEM;
-       }
        d_add(dentry, inode);
 
        if (sbi->version < 5)
                autofs_set_leaf_automount_flags(dentry);
 
-       dentry->d_fsdata = ino;
-       ino->dentry = dget(dentry);
+       dget(dentry);
        atomic_inc(&ino->count);
        p_ino = autofs4_dentry_ino(dentry->d_parent);
        if (p_ino && dentry->d_parent != dentry)
index b4ea82934d2e3a7a8f2707cbac630b5627faca84..f27c094a1919c2af890df6b1f2ac3a9e6a523b4c 100644 (file)
@@ -14,8 +14,7 @@
 
 static void *autofs4_follow_link(struct dentry *dentry, struct nameidata *nd)
 {
-       struct autofs_info *ino = autofs4_dentry_ino(dentry);
-       nd_set_link(nd, (char *)ino->u.symlink);
+       nd_set_link(nd, dentry->d_inode->i_private);
        return NULL;
 }
 
index ede98300a8cdb53ac362c69a8c3dd6743f748343..65829d32128c253a661ecd61dc50f4893bc9f52d 100644 (file)
@@ -79,11 +79,11 @@ void cifs_dump_mids(struct TCP_Server_Info *server)
        spin_lock(&GlobalMid_Lock);
        list_for_each(tmp, &server->pending_mid_q) {
                mid_entry = list_entry(tmp, struct mid_q_entry, qhead);
-               cERROR(1, "State: %d Cmd: %d Pid: %d Tsk: %p Mid %d",
+               cERROR(1, "State: %d Cmd: %d Pid: %d Cbdata: %p Mid %d",
                        mid_entry->midState,
                        (int)mid_entry->command,
                        mid_entry->pid,
-                       mid_entry->tsk,
+                       mid_entry->callback_data,
                        mid_entry->mid);
 #ifdef CONFIG_CIFS_STATS2
                cERROR(1, "IsLarge: %d buf: %p time rcv: %ld now: %ld",
@@ -218,11 +218,11 @@ static int cifs_debug_data_proc_show(struct seq_file *m, void *v)
                                mid_entry = list_entry(tmp3, struct mid_q_entry,
                                        qhead);
                                seq_printf(m, "\tState: %d com: %d pid:"
-                                               " %d tsk: %p mid %d\n",
+                                               " %d cbdata: %p mid %d\n",
                                                mid_entry->midState,
                                                (int)mid_entry->command,
                                                mid_entry->pid,
-                                               mid_entry->tsk,
+                                               mid_entry->callback_data,
                                                mid_entry->mid);
                        }
                        spin_unlock(&GlobalMid_Lock);
@@ -331,7 +331,7 @@ static int cifs_stats_proc_show(struct seq_file *m, void *v)
                                atomic_read(&totSmBufAllocCount));
 #endif /* CONFIG_CIFS_STATS2 */
 
-       seq_printf(m, "Operations (MIDs): %d\n", midCount.counter);
+       seq_printf(m, "Operations (MIDs): %d\n", atomic_read(&midCount));
        seq_printf(m,
                "\n%d session %d share reconnects\n",
                tcpSesReconnectCount.counter, tconInfoReconnectCount.counter);
index 7852cd6770517a8a5da7877fb788a834a0534c86..ac51cd2d33aed1a444debff691bfa710e3a5100a 100644 (file)
@@ -40,6 +40,7 @@
 #define CIFS_MOUNT_FSCACHE     0x8000 /* local caching enabled */
 #define CIFS_MOUNT_MF_SYMLINKS 0x10000 /* Minshall+French Symlinks enabled */
 #define CIFS_MOUNT_MULTIUSER   0x20000 /* multiuser mount */
+#define CIFS_MOUNT_STRICT_IO   0x40000 /* strict cache mode */
 
 struct cifs_sb_info {
        struct rb_root tlink_tree;
index 430f510a1720a5659a2ea73eef0cf7bcf0a22182..fc0fd4fde306b989c1593ef11ce2611fd49dca54 100644 (file)
@@ -44,10 +44,14 @@ cifs_ucs2_bytes(const __le16 *from, int maxbytes,
        int charlen, outlen = 0;
        int maxwords = maxbytes / 2;
        char tmp[NLS_MAX_CHARSET_SIZE];
+       __u16 ftmp;
 
-       for (i = 0; i < maxwords && from[i]; i++) {
-               charlen = codepage->uni2char(le16_to_cpu(from[i]), tmp,
-                                            NLS_MAX_CHARSET_SIZE);
+       for (i = 0; i < maxwords; i++) {
+               ftmp = get_unaligned_le16(&from[i]);
+               if (ftmp == 0)
+                       break;
+
+               charlen = codepage->uni2char(ftmp, tmp, NLS_MAX_CHARSET_SIZE);
                if (charlen > 0)
                        outlen += charlen;
                else
@@ -58,9 +62,9 @@ cifs_ucs2_bytes(const __le16 *from, int maxbytes,
 }
 
 /*
- * cifs_mapchar - convert a little-endian char to proper char in codepage
+ * cifs_mapchar - convert a host-endian char to proper char in codepage
  * @target - where converted character should be copied
- * @src_char - 2 byte little-endian source character
+ * @src_char - 2 byte host-endian source character
  * @cp - codepage to which character should be converted
  * @mapchar - should character be mapped according to mapchars mount option?
  *
@@ -69,7 +73,7 @@ cifs_ucs2_bytes(const __le16 *from, int maxbytes,
  * enough to hold the result of the conversion (at least NLS_MAX_CHARSET_SIZE).
  */
 static int
-cifs_mapchar(char *target, const __le16 src_char, const struct nls_table *cp,
+cifs_mapchar(char *target, const __u16 src_char, const struct nls_table *cp,
             bool mapchar)
 {
        int len = 1;
@@ -82,7 +86,7 @@ cifs_mapchar(char *target, const __le16 src_char, const struct nls_table *cp,
         *     build_path_from_dentry are modified, as they use slash as
         *     separator.
         */
-       switch (le16_to_cpu(src_char)) {
+       switch (src_char) {
        case UNI_COLON:
                *target = ':';
                break;
@@ -109,8 +113,7 @@ out:
        return len;
 
 cp_convert:
-       len = cp->uni2char(le16_to_cpu(src_char), target,
-                          NLS_MAX_CHARSET_SIZE);
+       len = cp->uni2char(src_char, target, NLS_MAX_CHARSET_SIZE);
        if (len <= 0) {
                *target = '?';
                len = 1;
@@ -149,6 +152,7 @@ cifs_from_ucs2(char *to, const __le16 *from, int tolen, int fromlen,
        int nullsize = nls_nullsize(codepage);
        int fromwords = fromlen / 2;
        char tmp[NLS_MAX_CHARSET_SIZE];
+       __u16 ftmp;
 
        /*
         * because the chars can be of varying widths, we need to take care
@@ -158,19 +162,23 @@ cifs_from_ucs2(char *to, const __le16 *from, int tolen, int fromlen,
         */
        safelen = tolen - (NLS_MAX_CHARSET_SIZE + nullsize);
 
-       for (i = 0; i < fromwords && from[i]; i++) {
+       for (i = 0; i < fromwords; i++) {
+               ftmp = get_unaligned_le16(&from[i]);
+               if (ftmp == 0)
+                       break;
+
                /*
                 * check to see if converting this character might make the
                 * conversion bleed into the null terminator
                 */
                if (outlen >= safelen) {
-                       charlen = cifs_mapchar(tmp, from[i], codepage, mapchar);
+                       charlen = cifs_mapchar(tmp, ftmp, codepage, mapchar);
                        if ((outlen + charlen) > (tolen - nullsize))
                                break;
                }
 
                /* put converted char into 'to' buffer */
-               charlen = cifs_mapchar(&to[outlen], from[i], codepage, mapchar);
+               charlen = cifs_mapchar(&to[outlen], ftmp, codepage, mapchar);
                outlen += charlen;
        }
 
@@ -193,24 +201,21 @@ cifs_strtoUCS(__le16 *to, const char *from, int len,
 {
        int charlen;
        int i;
-       wchar_t *wchar_to = (wchar_t *)to; /* needed to quiet sparse */
+       wchar_t wchar_to; /* needed to quiet sparse */
 
        for (i = 0; len && *from; i++, from += charlen, len -= charlen) {
-
-               /* works for 2.4.0 kernel or later */
-               charlen = codepage->char2uni(from, len, &wchar_to[i]);
+               charlen = codepage->char2uni(from, len, &wchar_to);
                if (charlen < 1) {
-                       cERROR(1, "strtoUCS: char2uni of %d returned %d",
-                               (int)*from, charlen);
+                       cERROR(1, "strtoUCS: char2uni of 0x%x returned %d",
+                               *from, charlen);
                        /* A question mark */
-                       to[i] = cpu_to_le16(0x003f);
+                       wchar_to = 0x003f;
                        charlen = 1;
-               } else
-                       to[i] = cpu_to_le16(wchar_to[i]);
-
+               }
+               put_unaligned_le16(wchar_to, &to[i]);
        }
 
-       to[i] = 0;
+       put_unaligned_le16(0, &to[i]);
        return i;
 }
 
@@ -252,3 +257,79 @@ cifs_strndup_from_ucs(const char *src, const int maxlen, const bool is_unicode,
        return dst;
 }
 
+/*
+ * Convert 16 bit Unicode pathname to wire format from string in current code
+ * page. Conversion may involve remapping up the six characters that are
+ * only legal in POSIX-like OS (if they are present in the string). Path
+ * names are little endian 16 bit Unicode on the wire
+ */
+int
+cifsConvertToUCS(__le16 *target, const char *source, int maxlen,
+                const struct nls_table *cp, int mapChars)
+{
+       int i, j, charlen;
+       int len_remaining = maxlen;
+       char src_char;
+       __u16 temp;
+
+       if (!mapChars)
+               return cifs_strtoUCS(target, source, PATH_MAX, cp);
+
+       for (i = 0, j = 0; i < maxlen; j++) {
+               src_char = source[i];
+               switch (src_char) {
+               case 0:
+                       put_unaligned_le16(0, &target[j]);
+                       goto ctoUCS_out;
+               case ':':
+                       temp = UNI_COLON;
+                       break;
+               case '*':
+                       temp = UNI_ASTERIK;
+                       break;
+               case '?':
+                       temp = UNI_QUESTION;
+                       break;
+               case '<':
+                       temp = UNI_LESSTHAN;
+                       break;
+               case '>':
+                       temp = UNI_GRTRTHAN;
+                       break;
+               case '|':
+                       temp = UNI_PIPE;
+                       break;
+               /*
+                * FIXME: We can not handle remapping backslash (UNI_SLASH)
+                * until all the calls to build_path_from_dentry are modified,
+                * as they use backslash as separator.
+                */
+               default:
+                       charlen = cp->char2uni(source+i, len_remaining,
+                                               &temp);
+                       /*
+                        * if no match, use question mark, which at least in
+                        * some cases serves as wild card
+                        */
+                       if (charlen < 1) {
+                               temp = 0x003f;
+                               charlen = 1;
+                       }
+                       len_remaining -= charlen;
+                       /*
+                        * character may take more than one byte in the source
+                        * string, but will take exactly two bytes in the
+                        * target string
+                        */
+                       i += charlen;
+                       continue;
+               }
+               put_unaligned_le16(temp, &target[j]);
+               i++; /* move to next char in source string */
+               len_remaining--;
+       }
+
+ctoUCS_out:
+       return i;
+}
+
index a437ec391a015fb7c05725543d6c118eadefc466..1e7636b145a88a180c8459f65bf86d51d6c165f6 100644 (file)
@@ -41,9 +41,12 @@ static struct cifs_wksid wksidarr[NUM_WK_SIDS] = {
 ;
 
 
-/* security id for everyone */
+/* security id for everyone/world system group */
 static const struct cifs_sid sid_everyone = {
        1, 1, {0, 0, 0, 0, 0, 1}, {0} };
+/* security id for Authenticated Users system group */
+static const struct cifs_sid sid_authusers = {
+       1, 1, {0, 0, 0, 0, 0, 5}, {11} };
 /* group users */
 static const struct cifs_sid sid_user = {1, 2 , {0, 0, 0, 0, 0, 5}, {} };
 
@@ -365,7 +368,7 @@ static void parse_dacl(struct cifs_acl *pdacl, char *end_of_acl,
        if (num_aces  > 0) {
                umode_t user_mask = S_IRWXU;
                umode_t group_mask = S_IRWXG;
-               umode_t other_mask = S_IRWXO;
+               umode_t other_mask = S_IRWXU | S_IRWXG | S_IRWXO;
 
                ppace = kmalloc(num_aces * sizeof(struct cifs_ace *),
                                GFP_KERNEL);
@@ -390,6 +393,12 @@ static void parse_dacl(struct cifs_acl *pdacl, char *end_of_acl,
                                                     ppace[i]->type,
                                                     &fattr->cf_mode,
                                                     &other_mask);
+                       if (compare_sids(&(ppace[i]->sid), &sid_authusers))
+                               access_flags_to_mode(ppace[i]->access_req,
+                                                    ppace[i]->type,
+                                                    &fattr->cf_mode,
+                                                    &other_mask);
+
 
 /*                     memcpy((void *)(&(cifscred->aces[i])),
                                (void *)ppace[i],
index d9f652a522a6994097d7ec4008abacb0cfc0b65a..a8323f1dc1c48cf29b33a8c0323005adb270b296 100644 (file)
@@ -77,7 +77,11 @@ unsigned int cifs_max_pending = CIFS_MAX_REQ;
 module_param(cifs_max_pending, int, 0);
 MODULE_PARM_DESC(cifs_max_pending, "Simultaneous requests to server. "
                                   "Default: 50 Range: 2 to 256");
-
+unsigned short echo_retries = 5;
+module_param(echo_retries, ushort, 0644);
+MODULE_PARM_DESC(echo_retries, "Number of echo attempts before giving up and "
+                              "reconnecting server. Default: 5. 0 means "
+                              "never reconnect.");
 extern mempool_t *cifs_sm_req_poolp;
 extern mempool_t *cifs_req_poolp;
 extern mempool_t *cifs_mid_poolp;
@@ -729,6 +733,25 @@ const struct file_operations cifs_file_ops = {
        .setlease = cifs_setlease,
 };
 
+const struct file_operations cifs_file_strict_ops = {
+       .read = do_sync_read,
+       .write = do_sync_write,
+       .aio_read = cifs_strict_readv,
+       .aio_write = cifs_file_aio_write,
+       .open = cifs_open,
+       .release = cifs_close,
+       .lock = cifs_lock,
+       .fsync = cifs_strict_fsync,
+       .flush = cifs_flush,
+       .mmap = cifs_file_strict_mmap,
+       .splice_read = generic_file_splice_read,
+       .llseek = cifs_llseek,
+#ifdef CONFIG_CIFS_POSIX
+       .unlocked_ioctl = cifs_ioctl,
+#endif /* CONFIG_CIFS_POSIX */
+       .setlease = cifs_setlease,
+};
+
 const struct file_operations cifs_file_direct_ops = {
        /* no aio, no readv -
           BB reevaluate whether they can be done with directio, no cache */
@@ -747,6 +770,7 @@ const struct file_operations cifs_file_direct_ops = {
        .llseek = cifs_llseek,
        .setlease = cifs_setlease,
 };
+
 const struct file_operations cifs_file_nobrl_ops = {
        .read = do_sync_read,
        .write = do_sync_write,
@@ -765,6 +789,24 @@ const struct file_operations cifs_file_nobrl_ops = {
        .setlease = cifs_setlease,
 };
 
+const struct file_operations cifs_file_strict_nobrl_ops = {
+       .read = do_sync_read,
+       .write = do_sync_write,
+       .aio_read = cifs_strict_readv,
+       .aio_write = cifs_file_aio_write,
+       .open = cifs_open,
+       .release = cifs_close,
+       .fsync = cifs_strict_fsync,
+       .flush = cifs_flush,
+       .mmap = cifs_file_strict_mmap,
+       .splice_read = generic_file_splice_read,
+       .llseek = cifs_llseek,
+#ifdef CONFIG_CIFS_POSIX
+       .unlocked_ioctl = cifs_ioctl,
+#endif /* CONFIG_CIFS_POSIX */
+       .setlease = cifs_setlease,
+};
+
 const struct file_operations cifs_file_direct_nobrl_ops = {
        /* no mmap, no aio, no readv -
           BB reevaluate whether they can be done with directio, no cache */
index 851030f749391729a315a915ba0c934cb6e981cf..f23206d46531f7fe9a5664ac26a7dd04455c4d23 100644 (file)
@@ -61,6 +61,7 @@ extern int cifs_rename(struct inode *, struct dentry *, struct inode *,
                       struct dentry *);
 extern int cifs_revalidate_file(struct file *filp);
 extern int cifs_revalidate_dentry(struct dentry *);
+extern void cifs_invalidate_mapping(struct inode *inode);
 extern int cifs_getattr(struct vfsmount *, struct dentry *, struct kstat *);
 extern int cifs_setattr(struct dentry *, struct iattr *);
 
@@ -72,19 +73,25 @@ extern const struct inode_operations cifs_dfs_referral_inode_operations;
 /* Functions related to files and directories */
 extern const struct file_operations cifs_file_ops;
 extern const struct file_operations cifs_file_direct_ops; /* if directio mnt */
-extern const struct file_operations cifs_file_nobrl_ops;
-extern const struct file_operations cifs_file_direct_nobrl_ops; /* no brlocks */
+extern const struct file_operations cifs_file_strict_ops; /* if strictio mnt */
+extern const struct file_operations cifs_file_nobrl_ops; /* no brlocks */
+extern const struct file_operations cifs_file_direct_nobrl_ops;
+extern const struct file_operations cifs_file_strict_nobrl_ops;
 extern int cifs_open(struct inode *inode, struct file *file);
 extern int cifs_close(struct inode *inode, struct file *file);
 extern int cifs_closedir(struct inode *inode, struct file *file);
 extern ssize_t cifs_user_read(struct file *file, char __user *read_data,
-                        size_t read_size, loff_t *poffset);
+                             size_t read_size, loff_t *poffset);
+extern ssize_t cifs_strict_readv(struct kiocb *iocb, const struct iovec *iov,
+                                unsigned long nr_segs, loff_t pos);
 extern ssize_t cifs_user_write(struct file *file, const char __user *write_data,
                         size_t write_size, loff_t *poffset);
 extern int cifs_lock(struct file *, int, struct file_lock *);
 extern int cifs_fsync(struct file *, int);
+extern int cifs_strict_fsync(struct file *, int);
 extern int cifs_flush(struct file *, fl_owner_t id);
 extern int cifs_file_mmap(struct file * , struct vm_area_struct *);
+extern int cifs_file_strict_mmap(struct file * , struct vm_area_struct *);
 extern const struct file_operations cifs_dir_ops;
 extern int cifs_dir_open(struct inode *inode, struct file *file);
 extern int cifs_readdir(struct file *file, void *direntry, filldir_t filldir);
@@ -118,5 +125,5 @@ extern long cifs_ioctl(struct file *filep, unsigned int cmd, unsigned long arg);
 extern const struct export_operations cifs_export_ops;
 #endif /* EXPERIMENTAL */
 
-#define CIFS_VERSION   "1.68"
+#define CIFS_VERSION   "1.69"
 #endif                         /* _CIFSFS_H */
index 606ca8bb710245484d32b3ec91415d2901812da4..5bfb75346cb03c20780f604866e4f8e9c625cff5 100644 (file)
@@ -161,6 +161,7 @@ struct TCP_Server_Info {
        int srv_count; /* reference counter */
        /* 15 character server name + 0x20 16th byte indicating type = srv */
        char server_RFC1001_name[RFC1001_NAME_LEN_WITH_NULL];
+       enum statusEnum tcpStatus; /* what we think the status is */
        char *hostname; /* hostname portion of UNC string */
        struct socket *ssocket;
        struct sockaddr_storage dstaddr;
@@ -168,25 +169,16 @@ struct TCP_Server_Info {
        wait_queue_head_t response_q;
        wait_queue_head_t request_q; /* if more than maxmpx to srvr must block*/
        struct list_head pending_mid_q;
-       void *Server_NlsInfo;   /* BB - placeholder for future NLS info  */
-       unsigned short server_codepage; /* codepage for the server    */
-       enum protocolEnum protocolType;
-       char versionMajor;
-       char versionMinor;
-       bool svlocal:1;                 /* local server or remote */
        bool noblocksnd;                /* use blocking sendmsg */
        bool noautotune;                /* do not autotune send buf sizes */
        bool tcp_nodelay;
        atomic_t inFlight;  /* number of requests on the wire to server */
-#ifdef CONFIG_CIFS_STATS2
-       atomic_t inSend; /* requests trying to send */
-       atomic_t num_waiters;   /* blocked waiting to get in sendrecv */
-#endif
-       enum statusEnum tcpStatus; /* what we think the status is */
        struct mutex srv_mutex;
        struct task_struct *tsk;
        char server_GUID[16];
        char secMode;
+       bool session_estab; /* mark when very first sess is established */
+       u16 dialect; /* dialect index that server chose */
        enum securityEnum secType;
        unsigned int maxReq;    /* Clients should submit no more */
        /* than maxReq distinct unanswered SMBs to the server when using  */
@@ -199,8 +191,6 @@ struct TCP_Server_Info {
        unsigned int max_vcs;   /* maximum number of smb sessions, at least
                                   those that can be specified uniquely with
                                   vcnumbers */
-       char sessid[4];         /* unique token id for this session */
-       /* (returned on Negotiate */
        int capabilities; /* allow selective disabling of caps by smb sess */
        int timeAdj;  /* Adjust for difference in server time zone in sec */
        __u16 CurrentMid;         /* multiplex id - rotating counter */
@@ -210,17 +200,20 @@ struct TCP_Server_Info {
        __u32 sequence_number; /* for signing, protected by srv_mutex */
        struct session_key session_key;
        unsigned long lstrp; /* when we got last response from this server */
-       u16 dialect; /* dialect index that server chose */
        struct cifs_secmech secmech; /* crypto sec mech functs, descriptors */
        /* extended security flavors that server supports */
+       bool    sec_ntlmssp;            /* supports NTLMSSP */
+       bool    sec_kerberosu2u;        /* supports U2U Kerberos */
        bool    sec_kerberos;           /* supports plain Kerberos */
        bool    sec_mskerberos;         /* supports legacy MS Kerberos */
-       bool    sec_kerberosu2u;        /* supports U2U Kerberos */
-       bool    sec_ntlmssp;            /* supports NTLMSSP */
-       bool session_estab; /* mark when very first sess is established */
+       struct delayed_work     echo; /* echo ping workqueue job */
 #ifdef CONFIG_CIFS_FSCACHE
        struct fscache_cookie   *fscache; /* client index cache cookie */
 #endif
+#ifdef CONFIG_CIFS_STATS2
+       atomic_t inSend; /* requests trying to send */
+       atomic_t num_waiters;   /* blocked waiting to get in sendrecv */
+#endif
 };
 
 /*
@@ -446,11 +439,11 @@ struct cifsInodeInfo {
        /* BB add in lists for dirty pages i.e. write caching info for oplock */
        struct list_head openFileList;
        __u32 cifsAttrs; /* e.g. DOS archive bit, sparse, compressed, system */
-       unsigned long time;     /* jiffies of last update/check of inode */
-       bool clientCanCacheRead:1;      /* read oplock */
-       bool clientCanCacheAll:1;       /* read and writebehind oplock */
-       bool delete_pending:1;          /* DELETE_ON_CLOSE is set */
-       bool invalid_mapping:1;         /* pagecache is invalid */
+       bool clientCanCacheRead;        /* read oplock */
+       bool clientCanCacheAll;         /* read and writebehind oplock */
+       bool delete_pending;            /* DELETE_ON_CLOSE is set */
+       bool invalid_mapping;           /* pagecache is invalid */
+       unsigned long time;             /* jiffies of last update of inode */
        u64  server_eof;                /* current file size on server */
        u64  uniqueid;                  /* server inode number */
        u64  createtime;                /* creation time on server */
@@ -508,6 +501,18 @@ static inline void cifs_stats_bytes_read(struct cifsTconInfo *tcon,
 
 #endif
 
+struct mid_q_entry;
+
+/*
+ * This is the prototype for the mid callback function. When creating one,
+ * take special care to avoid deadlocks. Things to bear in mind:
+ *
+ * - it will be called by cifsd
+ * - the GlobalMid_Lock will be held
+ * - the mid will be removed from the pending_mid_q list
+ */
+typedef void (mid_callback_t)(struct mid_q_entry *mid);
+
 /* one of these for every pending CIFS request to the server */
 struct mid_q_entry {
        struct list_head qhead; /* mids waiting on reply from this server */
@@ -519,7 +524,8 @@ struct mid_q_entry {
        unsigned long when_sent; /* time when smb send finished */
        unsigned long when_received; /* when demux complete (taken off wire) */
 #endif
-       struct task_struct *tsk;        /* task waiting for response */
+       mid_callback_t *callback; /* call completion callback */
+       void *callback_data;      /* general purpose pointer for callback */
        struct smb_hdr *resp_buf;       /* response buffer */
        int midState;   /* wish this were enum but can not pass to wait_event */
        __u8 command;   /* smb command code */
@@ -622,12 +628,9 @@ static inline void free_dfs_info_array(struct dfs_info3_param *param,
 #define   CIFS_IOVEC            4    /* array of response buffers */
 
 /* Type of Request to SendReceive2 */
-#define   CIFS_STD_OP          0    /* normal request timeout */
-#define   CIFS_LONG_OP          1    /* long op (up to 45 sec, oplock time) */
-#define   CIFS_VLONG_OP         2    /* sloow op - can take up to 180 seconds */
-#define   CIFS_BLOCKING_OP      4    /* operation can block */
-#define   CIFS_ASYNC_OP         8    /* do not wait for response */
-#define   CIFS_TIMEOUT_MASK 0x00F    /* only one of 5 above set in req */
+#define   CIFS_BLOCKING_OP      1    /* operation can block */
+#define   CIFS_ASYNC_OP         2    /* do not wait for response */
+#define   CIFS_TIMEOUT_MASK 0x003    /* only one of above set in req */
 #define   CIFS_LOG_ERROR    0x010    /* log NT STATUS if non-zero */
 #define   CIFS_LARGE_BUF_OP 0x020    /* large request buffer */
 #define   CIFS_NO_RESP      0x040    /* no response buffer required */
@@ -790,6 +793,9 @@ GLOBAL_EXTERN unsigned int cifs_min_rcv;    /* min size of big ntwrk buf pool */
 GLOBAL_EXTERN unsigned int cifs_min_small;  /* min size of small buf pool */
 GLOBAL_EXTERN unsigned int cifs_max_pending; /* MAX requests at once to server*/
 
+/* reconnect after this many failed echo attempts */
+GLOBAL_EXTERN unsigned short echo_retries;
+
 void cifs_oplock_break(struct work_struct *work);
 void cifs_oplock_break_get(struct cifsFileInfo *cfile);
 void cifs_oplock_break_put(struct cifsFileInfo *cfile);
index de36b09763a84e7fb6016b93222fc74ee263d540..b5c8cc5d7a7fa4c2d38be38b3b34b30b4a65e818 100644 (file)
@@ -23,6 +23,7 @@
 #define _CIFSPDU_H
 
 #include <net/sock.h>
+#include <asm/unaligned.h>
 #include "smbfsctl.h"
 
 #ifdef CONFIG_CIFS_WEAK_PW_HASH
@@ -50,6 +51,7 @@
 #define SMB_COM_SETATTR               0x09 /* trivial response */
 #define SMB_COM_LOCKING_ANDX          0x24 /* trivial response */
 #define SMB_COM_COPY                  0x29 /* trivial rsp, fail filename ignrd*/
+#define SMB_COM_ECHO                  0x2B /* echo request */
 #define SMB_COM_OPEN_ANDX             0x2D /* Legacy open for old servers */
 #define SMB_COM_READ_ANDX             0x2E
 #define SMB_COM_WRITE_ANDX            0x2F
@@ -425,11 +427,49 @@ struct smb_hdr {
        __u16 Mid;
        __u8 WordCount;
 } __attribute__((packed));
-/* given a pointer to an smb_hdr retrieve the value of byte count */
-#define BCC(smb_var) (*(__u16 *)((char *)(smb_var) + sizeof(struct smb_hdr) + (2 * (smb_var)->WordCount)))
-#define BCC_LE(smb_var) (*(__le16 *)((char *)(smb_var) + sizeof(struct smb_hdr) + (2 * (smb_var)->WordCount)))
+
+/* given a pointer to an smb_hdr retrieve a char pointer to the byte count */
+#define BCC(smb_var) ((unsigned char *)(smb_var) + sizeof(struct smb_hdr) + \
+                        (2 * (smb_var)->WordCount))
+
 /* given a pointer to an smb_hdr retrieve the pointer to the byte area */
-#define pByteArea(smb_var) ((unsigned char *)(smb_var) + sizeof(struct smb_hdr) + (2 * (smb_var)->WordCount) + 2)
+#define pByteArea(smb_var) (BCC(smb_var) + 2)
+
+/* get the converted ByteCount for a SMB packet and return it */
+static inline __u16
+get_bcc(struct smb_hdr *hdr)
+{
+       __u16 *bc_ptr = (__u16 *)BCC(hdr);
+
+       return get_unaligned(bc_ptr);
+}
+
+/* get the unconverted ByteCount for a SMB packet and return it */
+static inline __u16
+get_bcc_le(struct smb_hdr *hdr)
+{
+       __le16 *bc_ptr = (__le16 *)BCC(hdr);
+
+       return get_unaligned_le16(bc_ptr);
+}
+
+/* set the ByteCount for a SMB packet in host-byte order */
+static inline void
+put_bcc(__u16 count, struct smb_hdr *hdr)
+{
+       __u16 *bc_ptr = (__u16 *)BCC(hdr);
+
+       put_unaligned(count, bc_ptr);
+}
+
+/* set the ByteCount for a SMB packet in little-endian */
+static inline void
+put_bcc_le(__u16 count, struct smb_hdr *hdr)
+{
+       __le16 *bc_ptr = (__le16 *)BCC(hdr);
+
+       put_unaligned_le16(count, bc_ptr);
+}
 
 /*
  * Computer Name Length (since Netbios name was length 16 with last byte 0x20)
@@ -760,6 +800,20 @@ typedef struct smb_com_tconx_rsp_ext {
  *
  */
 
+typedef struct smb_com_echo_req {
+       struct  smb_hdr hdr;
+       __le16  EchoCount;
+       __le16  ByteCount;
+       char    Data[1];
+} __attribute__((packed)) ECHO_REQ;
+
+typedef struct smb_com_echo_rsp {
+       struct  smb_hdr hdr;
+       __le16  SequenceNumber;
+       __le16  ByteCount;
+       char    Data[1];
+} __attribute__((packed)) ECHO_RSP;
+
 typedef struct smb_com_logoff_andx_req {
        struct smb_hdr hdr;     /* wct = 2 */
        __u8 AndXCommand;
index e6d1481b16c1403cbe1c7fcae04e11abcc3f91f9..982895fa76152b7962c3e5fbd7e0cd8df4e8b699 100644 (file)
@@ -61,6 +61,12 @@ extern char *cifs_compose_mount_options(const char *sb_mountdata,
                const char *fullpath, const struct dfs_info3_param *ref,
                char **devname);
 /* extern void renew_parental_timestamps(struct dentry *direntry);*/
+extern struct mid_q_entry *AllocMidQEntry(const struct smb_hdr *smb_buffer,
+                                       struct TCP_Server_Info *server);
+extern void DeleteMidQEntry(struct mid_q_entry *midEntry);
+extern int cifs_call_async(struct TCP_Server_Info *server,
+                          struct smb_hdr *in_buf, mid_callback_t *callback,
+                          void *cbdata);
 extern int SendReceive(const unsigned int /* xid */ , struct cifsSesInfo *,
                        struct smb_hdr * /* input */ ,
                        struct smb_hdr * /* out */ ,
@@ -347,12 +353,13 @@ extern int CIFSSMBLock(const int xid, struct cifsTconInfo *tcon,
                        const __u16 netfid, const __u64 len,
                        const __u64 offset, const __u32 numUnlock,
                        const __u32 numLock, const __u8 lockType,
-                       const bool waitFlag);
+                       const bool waitFlag, const __u8 oplock_level);
 extern int CIFSSMBPosixLock(const int xid, struct cifsTconInfo *tcon,
                        const __u16 smb_file_id, const int get_flag,
                        const __u64 len, struct file_lock *,
                        const __u16 lock_type, const bool waitFlag);
 extern int CIFSSMBTDis(const int xid, struct cifsTconInfo *tcon);
+extern int CIFSSMBEcho(struct TCP_Server_Info *server);
 extern int CIFSSMBLogoff(const int xid, struct cifsSesInfo *ses);
 
 extern struct cifsSesInfo *sesInfoAlloc(void);
index 2f6795e524d3f39c34c2a1dbed77e11149f9330c..3106f5e5c63301609b21df1bf1f93251a2b7beda 100644 (file)
@@ -331,37 +331,35 @@ smb_init_no_reconnect(int smb_command, int wct, struct cifsTconInfo *tcon,
 
 static int validate_t2(struct smb_t2_rsp *pSMB)
 {
-       int rc = -EINVAL;
-       int total_size;
-       char *pBCC;
+       unsigned int total_size;
+
+       /* check for plausible wct */
+       if (pSMB->hdr.WordCount < 10)
+               goto vt2_err;
 
-       /* check for plausible wct, bcc and t2 data and parm sizes */
        /* check for parm and data offset going beyond end of smb */
-       if (pSMB->hdr.WordCount >= 10) {
-               if ((le16_to_cpu(pSMB->t2_rsp.ParameterOffset) <= 1024) &&
-                  (le16_to_cpu(pSMB->t2_rsp.DataOffset) <= 1024)) {
-                       /* check that bcc is at least as big as parms + data */
-                       /* check that bcc is less than negotiated smb buffer */
-                       total_size = le16_to_cpu(pSMB->t2_rsp.ParameterCount);
-                       if (total_size < 512) {
-                               total_size +=
-                                       le16_to_cpu(pSMB->t2_rsp.DataCount);
-                               /* BCC le converted in SendReceive */
-                               pBCC = (pSMB->hdr.WordCount * 2) +
-                                       sizeof(struct smb_hdr) +
-                                       (char *)pSMB;
-                               if ((total_size <= (*(u16 *)pBCC)) &&
-                                  (total_size <
-                                       CIFSMaxBufSize+MAX_CIFS_HDR_SIZE)) {
-                                       return 0;
-                               }
-                       }
-               }
-       }
+       if (get_unaligned_le16(&pSMB->t2_rsp.ParameterOffset) > 1024 ||
+           get_unaligned_le16(&pSMB->t2_rsp.DataOffset) > 1024)
+               goto vt2_err;
+
+       /* check that bcc is at least as big as parms + data */
+       /* check that bcc is less than negotiated smb buffer */
+       total_size = get_unaligned_le16(&pSMB->t2_rsp.ParameterCount);
+       if (total_size >= 512)
+               goto vt2_err;
+
+       total_size += get_unaligned_le16(&pSMB->t2_rsp.DataCount);
+       if (total_size > get_bcc(&pSMB->hdr) ||
+           total_size >= CIFSMaxBufSize + MAX_CIFS_HDR_SIZE)
+               goto vt2_err;
+
+       return 0;
+vt2_err:
        cifs_dump_mem("Invalid transact2 SMB: ", (char *)pSMB,
                sizeof(struct smb_t2_rsp) + 16);
-       return rc;
+       return -EINVAL;
 }
+
 int
 CIFSSMBNegotiate(unsigned int xid, struct cifsSesInfo *ses)
 {
@@ -452,7 +450,6 @@ CIFSSMBNegotiate(unsigned int xid, struct cifsSesInfo *ses)
                server->maxBuf = min((__u32)le16_to_cpu(rsp->MaxBufSize),
                                (__u32)CIFSMaxBufSize + MAX_CIFS_HDR_SIZE);
                server->max_vcs = le16_to_cpu(rsp->MaxNumberVcs);
-               GETU32(server->sessid) = le32_to_cpu(rsp->SessionKey);
                /* even though we do not use raw we might as well set this
                accurately, in case we ever find a need for it */
                if ((le16_to_cpu(rsp->RawMode) & RAW_ENABLE) == RAW_ENABLE) {
@@ -566,7 +563,6 @@ CIFSSMBNegotiate(unsigned int xid, struct cifsSesInfo *ses)
                        (__u32) CIFSMaxBufSize + MAX_CIFS_HDR_SIZE);
        server->max_rw = le32_to_cpu(pSMBr->MaxRawSize);
        cFYI(DBG2, "Max buf = %d", ses->server->maxBuf);
-       GETU32(ses->server->sessid) = le32_to_cpu(pSMBr->SessionKey);
        server->capabilities = le32_to_cpu(pSMBr->Capabilities);
        server->timeAdj = (int)(__s16)le16_to_cpu(pSMBr->ServerTimeZone);
        server->timeAdj *= 60;
@@ -706,6 +702,53 @@ CIFSSMBTDis(const int xid, struct cifsTconInfo *tcon)
        return rc;
 }
 
+/*
+ * This is a no-op for now. We're not really interested in the reply, but
+ * rather in the fact that the server sent one and that server->lstrp
+ * gets updated.
+ *
+ * FIXME: maybe we should consider checking that the reply matches request?
+ */
+static void
+cifs_echo_callback(struct mid_q_entry *mid)
+{
+       struct TCP_Server_Info *server = mid->callback_data;
+
+       DeleteMidQEntry(mid);
+       atomic_dec(&server->inFlight);
+       wake_up(&server->request_q);
+}
+
+int
+CIFSSMBEcho(struct TCP_Server_Info *server)
+{
+       ECHO_REQ *smb;
+       int rc = 0;
+
+       cFYI(1, "In echo request");
+
+       rc = small_smb_init(SMB_COM_ECHO, 0, NULL, (void **)&smb);
+       if (rc)
+               return rc;
+
+       /* set up echo request */
+       smb->hdr.Tid = cpu_to_le16(0xffff);
+       smb->hdr.WordCount = 1;
+       put_unaligned_le16(1, &smb->EchoCount);
+       put_bcc_le(1, &smb->hdr);
+       smb->Data[0] = 'a';
+       smb->hdr.smb_buf_length += 3;
+
+       rc = cifs_call_async(server, (struct smb_hdr *)smb,
+                               cifs_echo_callback, server);
+       if (rc)
+               cFYI(1, "Echo request failed: %d", rc);
+
+       cifs_small_buf_release(smb);
+
+       return rc;
+}
+
 int
 CIFSSMBLogoff(const int xid, struct cifsSesInfo *ses)
 {
@@ -1193,7 +1236,7 @@ OldOpenRetry:
        pSMB->ByteCount = cpu_to_le16(count);
        /* long_op set to 1 to allow for oplock break timeouts */
        rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB,
-                       (struct smb_hdr *)pSMBr, &bytes_returned, CIFS_LONG_OP);
+                       (struct smb_hdr *)pSMBr, &bytes_returned, 0);
        cifs_stats_inc(&tcon->num_opens);
        if (rc) {
                cFYI(1, "Error in Open = %d", rc);
@@ -1306,7 +1349,7 @@ openRetry:
        pSMB->ByteCount = cpu_to_le16(count);
        /* long_op set to 1 to allow for oplock break timeouts */
        rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB,
-                       (struct smb_hdr *)pSMBr, &bytes_returned, CIFS_LONG_OP);
+                       (struct smb_hdr *)pSMBr, &bytes_returned, 0);
        cifs_stats_inc(&tcon->num_opens);
        if (rc) {
                cFYI(1, "Error in Open = %d", rc);
@@ -1388,7 +1431,7 @@ CIFSSMBRead(const int xid, struct cifsTconInfo *tcon, const int netfid,
        iov[0].iov_base = (char *)pSMB;
        iov[0].iov_len = pSMB->hdr.smb_buf_length + 4;
        rc = SendReceive2(xid, tcon->ses, iov, 1 /* num iovecs */,
-                        &resp_buf_type, CIFS_STD_OP | CIFS_LOG_ERROR);
+                        &resp_buf_type, CIFS_LOG_ERROR);
        cifs_stats_inc(&tcon->num_reads);
        pSMBr = (READ_RSP *)iov[0].iov_base;
        if (rc) {
@@ -1663,7 +1706,8 @@ int
 CIFSSMBLock(const int xid, struct cifsTconInfo *tcon,
            const __u16 smb_file_id, const __u64 len,
            const __u64 offset, const __u32 numUnlock,
-           const __u32 numLock, const __u8 lockType, const bool waitFlag)
+           const __u32 numLock, const __u8 lockType,
+           const bool waitFlag, const __u8 oplock_level)
 {
        int rc = 0;
        LOCK_REQ *pSMB = NULL;
@@ -1691,6 +1735,7 @@ CIFSSMBLock(const int xid, struct cifsTconInfo *tcon,
        pSMB->NumberOfLocks = cpu_to_le16(numLock);
        pSMB->NumberOfUnlocks = cpu_to_le16(numUnlock);
        pSMB->LockType = lockType;
+       pSMB->OplockLevel = oplock_level;
        pSMB->AndXCommand = 0xFF;       /* none */
        pSMB->Fid = smb_file_id; /* netfid stays le */
 
@@ -3087,7 +3132,7 @@ CIFSSMBGetCIFSACL(const int xid, struct cifsTconInfo *tcon, __u16 fid,
        iov[0].iov_len = pSMB->hdr.smb_buf_length + 4;
 
        rc = SendReceive2(xid, tcon->ses, iov, 1 /* num iovec */, &buf_type,
-                        CIFS_STD_OP);
+                        0);
        cifs_stats_inc(&tcon->num_acl_get);
        if (rc) {
                cFYI(1, "Send error in QuerySecDesc = %d", rc);
@@ -5562,7 +5607,7 @@ QAllEAsRetry:
        }
 
        /* make sure list_len doesn't go past end of SMB */
-       end_of_smb = (char *)pByteArea(&pSMBr->hdr) + BCC(&pSMBr->hdr);
+       end_of_smb = (char *)pByteArea(&pSMBr->hdr) + get_bcc(&pSMBr->hdr);
        if ((char *)ea_response_data + list_len > end_of_smb) {
                cFYI(1, "EA list appears to go beyond SMB");
                rc = -EIO;
index 9f59887badd2255457a384feffee95a98a2fb9e7..18d3c7724d6e0dce8f63336e2f64424fdf913961 100644 (file)
@@ -52,6 +52,9 @@
 #define CIFS_PORT 445
 #define RFC1001_PORT 139
 
+/* SMB echo "timeout" -- FIXME: tunable? */
+#define SMB_ECHO_INTERVAL (60 * HZ)
+
 extern void SMBNTencrypt(unsigned char *passwd, unsigned char *c8,
                         unsigned char *p24);
 
@@ -152,6 +155,7 @@ cifs_reconnect(struct TCP_Server_Info *server)
 
        /* before reconnecting the tcp session, mark the smb session (uid)
                and the tid bad so they are not used until reconnected */
+       cFYI(1, "%s: marking sessions and tcons for reconnect", __func__);
        spin_lock(&cifs_tcp_ses_lock);
        list_for_each(tmp, &server->smb_ses_list) {
                ses = list_entry(tmp, struct cifsSesInfo, smb_ses_list);
@@ -163,7 +167,9 @@ cifs_reconnect(struct TCP_Server_Info *server)
                }
        }
        spin_unlock(&cifs_tcp_ses_lock);
+
        /* do not want to be sending data on a socket we are freeing */
+       cFYI(1, "%s: tearing down socket", __func__);
        mutex_lock(&server->srv_mutex);
        if (server->ssocket) {
                cFYI(1, "State: 0x%x Flags: 0x%lx", server->ssocket->state,
@@ -180,22 +186,20 @@ cifs_reconnect(struct TCP_Server_Info *server)
        kfree(server->session_key.response);
        server->session_key.response = NULL;
        server->session_key.len = 0;
+       server->lstrp = jiffies;
+       mutex_unlock(&server->srv_mutex);
 
+       /* mark submitted MIDs for retry and issue callback */
+       cFYI(1, "%s: issuing mid callbacks", __func__);
        spin_lock(&GlobalMid_Lock);
-       list_for_each(tmp, &server->pending_mid_q) {
-               mid_entry = list_entry(tmp, struct
-                                       mid_q_entry,
-                                       qhead);
-               if (mid_entry->midState == MID_REQUEST_SUBMITTED) {
-                               /* Mark other intransit requests as needing
-                                  retry so we do not immediately mark the
-                                  session bad again (ie after we reconnect
-                                  below) as they timeout too */
+       list_for_each_safe(tmp, tmp2, &server->pending_mid_q) {
+               mid_entry = list_entry(tmp, struct mid_q_entry, qhead);
+               if (mid_entry->midState == MID_REQUEST_SUBMITTED)
                        mid_entry->midState = MID_RETRY_NEEDED;
-               }
+               list_del_init(&mid_entry->qhead);
+               mid_entry->callback(mid_entry);
        }
        spin_unlock(&GlobalMid_Lock);
-       mutex_unlock(&server->srv_mutex);
 
        while ((server->tcpStatus != CifsExiting) &&
               (server->tcpStatus != CifsGood)) {
@@ -212,10 +216,9 @@ cifs_reconnect(struct TCP_Server_Info *server)
                        if (server->tcpStatus != CifsExiting)
                                server->tcpStatus = CifsGood;
                        spin_unlock(&GlobalMid_Lock);
-       /*              atomic_set(&server->inFlight,0);*/
-                       wake_up(&server->response_q);
                }
        }
+
        return rc;
 }
 
@@ -229,9 +232,8 @@ cifs_reconnect(struct TCP_Server_Info *server)
 static int check2ndT2(struct smb_hdr *pSMB, unsigned int maxBufSize)
 {
        struct smb_t2_rsp *pSMBt;
-       int total_data_size;
-       int data_in_this_rsp;
        int remaining;
+       __u16 total_data_size, data_in_this_rsp;
 
        if (pSMB->Command != SMB_COM_TRANSACTION2)
                return 0;
@@ -245,8 +247,8 @@ static int check2ndT2(struct smb_hdr *pSMB, unsigned int maxBufSize)
 
        pSMBt = (struct smb_t2_rsp *)pSMB;
 
-       total_data_size = le16_to_cpu(pSMBt->t2_rsp.TotalDataCount);
-       data_in_this_rsp = le16_to_cpu(pSMBt->t2_rsp.DataCount);
+       total_data_size = get_unaligned_le16(&pSMBt->t2_rsp.TotalDataCount);
+       data_in_this_rsp = get_unaligned_le16(&pSMBt->t2_rsp.DataCount);
 
        remaining = total_data_size - data_in_this_rsp;
 
@@ -272,21 +274,18 @@ static int coalesce_t2(struct smb_hdr *psecond, struct smb_hdr *pTargetSMB)
 {
        struct smb_t2_rsp *pSMB2 = (struct smb_t2_rsp *)psecond;
        struct smb_t2_rsp *pSMBt  = (struct smb_t2_rsp *)pTargetSMB;
-       int total_data_size;
-       int total_in_buf;
-       int remaining;
-       int total_in_buf2;
        char *data_area_of_target;
        char *data_area_of_buf2;
-       __u16 byte_count;
+       int remaining;
+       __u16 byte_count, total_data_size, total_in_buf, total_in_buf2;
 
-       total_data_size = le16_to_cpu(pSMBt->t2_rsp.TotalDataCount);
+       total_data_size = get_unaligned_le16(&pSMBt->t2_rsp.TotalDataCount);
 
-       if (total_data_size != le16_to_cpu(pSMB2->t2_rsp.TotalDataCount)) {
+       if (total_data_size !=
+           get_unaligned_le16(&pSMB2->t2_rsp.TotalDataCount))
                cFYI(1, "total data size of primary and secondary t2 differ");
-       }
 
-       total_in_buf = le16_to_cpu(pSMBt->t2_rsp.DataCount);
+       total_in_buf = get_unaligned_le16(&pSMBt->t2_rsp.DataCount);
 
        remaining = total_data_size - total_in_buf;
 
@@ -296,28 +295,28 @@ static int coalesce_t2(struct smb_hdr *psecond, struct smb_hdr *pTargetSMB)
        if (remaining == 0) /* nothing to do, ignore */
                return 0;
 
-       total_in_buf2 = le16_to_cpu(pSMB2->t2_rsp.DataCount);
+       total_in_buf2 = get_unaligned_le16(&pSMB2->t2_rsp.DataCount);
        if (remaining < total_in_buf2) {
                cFYI(1, "transact2 2nd response contains too much data");
        }
 
        /* find end of first SMB data area */
        data_area_of_target = (char *)&pSMBt->hdr.Protocol +
-                               le16_to_cpu(pSMBt->t2_rsp.DataOffset);
+                               get_unaligned_le16(&pSMBt->t2_rsp.DataOffset);
        /* validate target area */
 
-       data_area_of_buf2 = (char *) &pSMB2->hdr.Protocol +
-                                       le16_to_cpu(pSMB2->t2_rsp.DataOffset);
+       data_area_of_buf2 = (char *)&pSMB2->hdr.Protocol +
+                               get_unaligned_le16(&pSMB2->t2_rsp.DataOffset);
 
        data_area_of_target += total_in_buf;
 
        /* copy second buffer into end of first buffer */
        memcpy(data_area_of_target, data_area_of_buf2, total_in_buf2);
        total_in_buf += total_in_buf2;
-       pSMBt->t2_rsp.DataCount = cpu_to_le16(total_in_buf);
-       byte_count = le16_to_cpu(BCC_LE(pTargetSMB));
+       put_unaligned_le16(total_in_buf, &pSMBt->t2_rsp.DataCount);
+       byte_count = get_bcc_le(pTargetSMB);
        byte_count += total_in_buf2;
-       BCC_LE(pTargetSMB) = cpu_to_le16(byte_count);
+       put_bcc_le(byte_count, pTargetSMB);
 
        byte_count = pTargetSMB->smb_buf_length;
        byte_count += total_in_buf2;
@@ -331,7 +330,26 @@ static int coalesce_t2(struct smb_hdr *psecond, struct smb_hdr *pTargetSMB)
                return 0; /* we are done */
        } else /* more responses to go */
                return 1;
+}
+
+static void
+cifs_echo_request(struct work_struct *work)
+{
+       int rc;
+       struct TCP_Server_Info *server = container_of(work,
+                                       struct TCP_Server_Info, echo.work);
+
+       /* no need to ping if we got a response recently */
+       if (time_before(jiffies, server->lstrp + SMB_ECHO_INTERVAL - HZ))
+               goto requeue_echo;
 
+       rc = CIFSSMBEcho(server);
+       if (rc)
+               cFYI(1, "Unable to send echo request to server: %s",
+                       server->hostname);
+
+requeue_echo:
+       queue_delayed_work(system_nrt_wq, &server->echo, SMB_ECHO_INTERVAL);
 }
 
 static int
@@ -345,8 +363,7 @@ cifs_demultiplex_thread(struct TCP_Server_Info *server)
        struct msghdr smb_msg;
        struct kvec iov;
        struct socket *csocket = server->ssocket;
-       struct list_head *tmp;
-       struct cifsSesInfo *ses;
+       struct list_head *tmp, *tmp2;
        struct task_struct *task_to_wake = NULL;
        struct mid_q_entry *mid_entry;
        char temp;
@@ -399,7 +416,20 @@ cifs_demultiplex_thread(struct TCP_Server_Info *server)
                smb_msg.msg_control = NULL;
                smb_msg.msg_controllen = 0;
                pdu_length = 4; /* enough to get RFC1001 header */
+
 incomplete_rcv:
+               if (echo_retries > 0 &&
+                   time_after(jiffies, server->lstrp +
+                                       (echo_retries * SMB_ECHO_INTERVAL))) {
+                       cERROR(1, "Server %s has not responded in %d seconds. "
+                                 "Reconnecting...", server->hostname,
+                                 (echo_retries * SMB_ECHO_INTERVAL / HZ));
+                       cifs_reconnect(server);
+                       csocket = server->ssocket;
+                       wake_up(&server->response_q);
+                       continue;
+               }
+
                length =
                    kernel_recvmsg(csocket, &smb_msg,
                                &iov, 1, pdu_length, 0 /* BB other flags? */);
@@ -559,10 +589,11 @@ incomplete_rcv:
                        continue;
                }
 
+               mid_entry = NULL;
+               server->lstrp = jiffies;
 
-               task_to_wake = NULL;
                spin_lock(&GlobalMid_Lock);
-               list_for_each(tmp, &server->pending_mid_q) {
+               list_for_each_safe(tmp, tmp2, &server->pending_mid_q) {
                        mid_entry = list_entry(tmp, struct mid_q_entry, qhead);
 
                        if ((mid_entry->mid == smb_buffer->Mid) &&
@@ -603,20 +634,19 @@ incomplete_rcv:
                                mid_entry->resp_buf = smb_buffer;
                                mid_entry->largeBuf = isLargeBuf;
 multi_t2_fnd:
-                               task_to_wake = mid_entry->tsk;
                                mid_entry->midState = MID_RESPONSE_RECEIVED;
+                               list_del_init(&mid_entry->qhead);
+                               mid_entry->callback(mid_entry);
 #ifdef CONFIG_CIFS_STATS2
                                mid_entry->when_received = jiffies;
 #endif
-                               /* so we do not time out requests to  server
-                               which is still responding (since server could
-                               be busy but not dead) */
-                               server->lstrp = jiffies;
                                break;
                        }
+                       mid_entry = NULL;
                }
                spin_unlock(&GlobalMid_Lock);
-               if (task_to_wake) {
+
+               if (mid_entry != NULL) {
                        /* Was previous buf put in mpx struct for multi-rsp? */
                        if (!isMultiRsp) {
                                /* smb buffer will be freed by user thread */
@@ -625,11 +655,10 @@ multi_t2_fnd:
                                else
                                        smallbuf = NULL;
                        }
-                       wake_up_process(task_to_wake);
                } else if (!is_valid_oplock_break(smb_buffer, server) &&
                           !isMultiRsp) {
                        cERROR(1, "No task to wake, unknown frame received! "
-                                  "NumMids %d", midCount.counter);
+                                  "NumMids %d", atomic_read(&midCount));
                        cifs_dump_mem("Received Data is: ", (char *)smb_buffer,
                                      sizeof(struct smb_hdr));
 #ifdef CONFIG_CIFS_DEBUG2
@@ -677,44 +706,16 @@ multi_t2_fnd:
        if (smallbuf) /* no sense logging a debug message if NULL */
                cifs_small_buf_release(smallbuf);
 
-       /*
-        * BB: we shouldn't have to do any of this. It shouldn't be
-        * possible to exit from the thread with active SMB sessions
-        */
-       spin_lock(&cifs_tcp_ses_lock);
-       if (list_empty(&server->pending_mid_q)) {
-               /* loop through server session structures attached to this and
-                   mark them dead */
-               list_for_each(tmp, &server->smb_ses_list) {
-                       ses = list_entry(tmp, struct cifsSesInfo,
-                                        smb_ses_list);
-                       ses->status = CifsExiting;
-                       ses->server = NULL;
-               }
-               spin_unlock(&cifs_tcp_ses_lock);
-       } else {
-               /* although we can not zero the server struct pointer yet,
-               since there are active requests which may depnd on them,
-               mark the corresponding SMB sessions as exiting too */
-               list_for_each(tmp, &server->smb_ses_list) {
-                       ses = list_entry(tmp, struct cifsSesInfo,
-                                        smb_ses_list);
-                       ses->status = CifsExiting;
-               }
-
+       if (!list_empty(&server->pending_mid_q)) {
                spin_lock(&GlobalMid_Lock);
-               list_for_each(tmp, &server->pending_mid_q) {
-               mid_entry = list_entry(tmp, struct mid_q_entry, qhead);
-                       if (mid_entry->midState == MID_REQUEST_SUBMITTED) {
-                               cFYI(1, "Clearing Mid 0x%x - waking up ",
+               list_for_each_safe(tmp, tmp2, &server->pending_mid_q) {
+                       mid_entry = list_entry(tmp, struct mid_q_entry, qhead);
+                       cFYI(1, "Clearing Mid 0x%x - issuing callback",
                                         mid_entry->mid);
-                               task_to_wake = mid_entry->tsk;
-                               if (task_to_wake)
-                                       wake_up_process(task_to_wake);
-                       }
+                       list_del_init(&mid_entry->qhead);
+                       mid_entry->callback(mid_entry);
                }
                spin_unlock(&GlobalMid_Lock);
-               spin_unlock(&cifs_tcp_ses_lock);
                /* 1/8th of sec is more than enough time for them to exit */
                msleep(125);
        }
@@ -732,18 +733,6 @@ multi_t2_fnd:
                coming home not much else we can do but free the memory */
        }
 
-       /* last chance to mark ses pointers invalid
-       if there are any pointing to this (e.g
-       if a crazy root user tried to kill cifsd
-       kernel thread explicitly this might happen) */
-       /* BB: This shouldn't be necessary, see above */
-       spin_lock(&cifs_tcp_ses_lock);
-       list_for_each(tmp, &server->smb_ses_list) {
-               ses = list_entry(tmp, struct cifsSesInfo, smb_ses_list);
-               ses->server = NULL;
-       }
-       spin_unlock(&cifs_tcp_ses_lock);
-
        kfree(server->hostname);
        task_to_wake = xchg(&server->tsk, NULL);
        kfree(server);
@@ -1612,6 +1601,8 @@ cifs_put_tcp_session(struct TCP_Server_Info *server)
        list_del_init(&server->tcp_ses_list);
        spin_unlock(&cifs_tcp_ses_lock);
 
+       cancel_delayed_work_sync(&server->echo);
+
        spin_lock(&GlobalMid_Lock);
        server->tcpStatus = CifsExiting;
        spin_unlock(&GlobalMid_Lock);
@@ -1701,8 +1692,10 @@ cifs_get_tcp_session(struct smb_vol *volume_info)
                volume_info->target_rfc1001_name, RFC1001_NAME_LEN_WITH_NULL);
        tcp_ses->session_estab = false;
        tcp_ses->sequence_number = 0;
+       tcp_ses->lstrp = jiffies;
        INIT_LIST_HEAD(&tcp_ses->tcp_ses_list);
        INIT_LIST_HEAD(&tcp_ses->smb_ses_list);
+       INIT_DELAYED_WORK(&tcp_ses->echo, cifs_echo_request);
 
        /*
         * at this point we are the only ones with the pointer
@@ -1751,6 +1744,9 @@ cifs_get_tcp_session(struct smb_vol *volume_info)
 
        cifs_fscache_get_client_cookie(tcp_ses);
 
+       /* queue echo request delayed work */
+       queue_delayed_work(system_nrt_wq, &tcp_ses->echo, SMB_ECHO_INTERVAL);
+
        return tcp_ses;
 
 out_err_crypto_release:
@@ -2936,8 +2932,8 @@ CIFSTCon(unsigned int xid, struct cifsSesInfo *ses,
        TCONX_RSP *pSMBr;
        unsigned char *bcc_ptr;
        int rc = 0;
-       int length, bytes_left;
-       __u16 count;
+       int length;
+       __u16 bytes_left, count;
 
        if (ses == NULL)
                return -EIO;
@@ -2965,7 +2961,7 @@ CIFSTCon(unsigned int xid, struct cifsSesInfo *ses,
                bcc_ptr++;              /* skip password */
                /* already aligned so no need to do it below */
        } else {
-               pSMB->PasswordLength = cpu_to_le16(CIFS_SESS_KEY_SIZE);
+               pSMB->PasswordLength = cpu_to_le16(CIFS_AUTH_RESP_SIZE);
                /* BB FIXME add code to fail this if NTLMv2 or Kerberos
                   specified as required (when that support is added to
                   the vfs in the future) as only NTLM or the much
@@ -2983,7 +2979,7 @@ CIFSTCon(unsigned int xid, struct cifsSesInfo *ses,
 #endif /* CIFS_WEAK_PW_HASH */
                SMBNTencrypt(tcon->password, ses->server->cryptkey, bcc_ptr);
 
-               bcc_ptr += CIFS_SESS_KEY_SIZE;
+               bcc_ptr += CIFS_AUTH_RESP_SIZE;
                if (ses->capabilities & CAP_UNICODE) {
                        /* must align unicode strings */
                        *bcc_ptr = 0; /* null byte password */
@@ -3021,7 +3017,7 @@ CIFSTCon(unsigned int xid, struct cifsSesInfo *ses,
        pSMB->ByteCount = cpu_to_le16(count);
 
        rc = SendReceive(xid, ses, smb_buffer, smb_buffer_response, &length,
-                        CIFS_STD_OP);
+                        0);
 
        /* above now done in SendReceive */
        if ((rc == 0) && (tcon != NULL)) {
@@ -3031,7 +3027,7 @@ CIFSTCon(unsigned int xid, struct cifsSesInfo *ses,
                tcon->need_reconnect = false;
                tcon->tid = smb_buffer_response->Tid;
                bcc_ptr = pByteArea(smb_buffer_response);
-               bytes_left = BCC(smb_buffer_response);
+               bytes_left = get_bcc(smb_buffer_response);
                length = strnlen(bcc_ptr, bytes_left - 2);
                if (smb_buffer->Flags2 & SMBFLG2_UNICODE)
                        is_unicode = true;
index d843631c028d5939f57992701e95943318fe14ab..d7d65a70678e48b2b2cebf97f80fea1f14a97079 100644 (file)
@@ -287,6 +287,7 @@ void cifsFileInfo_put(struct cifsFileInfo *cifs_file)
        struct inode *inode = cifs_file->dentry->d_inode;
        struct cifsTconInfo *tcon = tlink_tcon(cifs_file->tlink);
        struct cifsInodeInfo *cifsi = CIFS_I(inode);
+       struct cifs_sb_info *cifs_sb = CIFS_SB(inode->i_sb);
        struct cifsLockInfo *li, *tmp;
 
        spin_lock(&cifs_file_list_lock);
@@ -302,6 +303,13 @@ void cifsFileInfo_put(struct cifsFileInfo *cifs_file)
        if (list_empty(&cifsi->openFileList)) {
                cFYI(1, "closing last open instance for inode %p",
                        cifs_file->dentry->d_inode);
+
+               /* in strict cache mode we need invalidate mapping on the last
+                  close  because it may cause a error when we open this file
+                  again and get at least level II oplock */
+               if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_STRICT_IO)
+                       CIFS_I(inode)->invalid_mapping = true;
+
                cifs_set_oplock_level(cifsi, 0);
        }
        spin_unlock(&cifs_file_list_lock);
@@ -726,12 +734,12 @@ int cifs_lock(struct file *file, int cmd, struct file_lock *pfLock)
 
                /* BB we could chain these into one lock request BB */
                rc = CIFSSMBLock(xid, tcon, netfid, length, pfLock->fl_start,
-                                0, 1, lockType, 0 /* wait flag */ );
+                                0, 1, lockType, 0 /* wait flag */, 0);
                if (rc == 0) {
                        rc = CIFSSMBLock(xid, tcon, netfid, length,
                                         pfLock->fl_start, 1 /* numUnlock */ ,
                                         0 /* numLock */ , lockType,
-                                        0 /* wait flag */ );
+                                        0 /* wait flag */, 0);
                        pfLock->fl_type = F_UNLCK;
                        if (rc != 0)
                                cERROR(1, "Error unlocking previously locked "
@@ -748,13 +756,13 @@ int cifs_lock(struct file *file, int cmd, struct file_lock *pfLock)
                                rc = CIFSSMBLock(xid, tcon, netfid, length,
                                        pfLock->fl_start, 0, 1,
                                        lockType | LOCKING_ANDX_SHARED_LOCK,
-                                       0 /* wait flag */);
+                                       0 /* wait flag */, 0);
                                if (rc == 0) {
                                        rc = CIFSSMBLock(xid, tcon, netfid,
                                                length, pfLock->fl_start, 1, 0,
                                                lockType |
                                                LOCKING_ANDX_SHARED_LOCK,
-                                               0 /* wait flag */);
+                                               0 /* wait flag */, 0);
                                        pfLock->fl_type = F_RDLCK;
                                        if (rc != 0)
                                                cERROR(1, "Error unlocking "
@@ -797,8 +805,8 @@ int cifs_lock(struct file *file, int cmd, struct file_lock *pfLock)
 
                if (numLock) {
                        rc = CIFSSMBLock(xid, tcon, netfid, length,
-                                       pfLock->fl_start,
-                                       0, numLock, lockType, wait_flag);
+                                        pfLock->fl_start, 0, numLock, lockType,
+                                        wait_flag, 0);
 
                        if (rc == 0) {
                                /* For Windows locks we must store them. */
@@ -818,9 +826,9 @@ int cifs_lock(struct file *file, int cmd, struct file_lock *pfLock)
                                                (pfLock->fl_start + length) >=
                                                (li->offset + li->length)) {
                                        stored_rc = CIFSSMBLock(xid, tcon,
-                                                       netfid,
-                                                       li->length, li->offset,
-                                                       1, 0, li->type, false);
+                                                       netfid, li->length,
+                                                       li->offset, 1, 0,
+                                                       li->type, false, 0);
                                        if (stored_rc)
                                                rc = stored_rc;
                                        else {
@@ -839,29 +847,6 @@ int cifs_lock(struct file *file, int cmd, struct file_lock *pfLock)
        return rc;
 }
 
-/*
- * Set the timeout on write requests past EOF. For some servers (Windows)
- * these calls can be very long.
- *
- * If we're writing >10M past the EOF we give a 180s timeout. Anything less
- * than that gets a 45s timeout. Writes not past EOF get 15s timeouts.
- * The 10M cutoff is totally arbitrary. A better scheme for this would be
- * welcome if someone wants to suggest one.
- *
- * We may be able to do a better job with this if there were some way to
- * declare that a file should be sparse.
- */
-static int
-cifs_write_timeout(struct cifsInodeInfo *cifsi, loff_t offset)
-{
-       if (offset <= cifsi->server_eof)
-               return CIFS_STD_OP;
-       else if (offset > (cifsi->server_eof + (10 * 1024 * 1024)))
-               return CIFS_VLONG_OP;
-       else
-               return CIFS_LONG_OP;
-}
-
 /* update the file size (if needed) after a write */
 static void
 cifs_update_eof(struct cifsInodeInfo *cifsi, loff_t offset,
@@ -882,7 +867,7 @@ ssize_t cifs_user_write(struct file *file, const char __user *write_data,
        unsigned int total_written;
        struct cifs_sb_info *cifs_sb;
        struct cifsTconInfo *pTcon;
-       int xid, long_op;
+       int xid;
        struct cifsFileInfo *open_file;
        struct cifsInodeInfo *cifsi = CIFS_I(inode);
 
@@ -903,7 +888,6 @@ ssize_t cifs_user_write(struct file *file, const char __user *write_data,
 
        xid = GetXid();
 
-       long_op = cifs_write_timeout(cifsi, *poffset);
        for (total_written = 0; write_size > total_written;
             total_written += bytes_written) {
                rc = -EAGAIN;
@@ -931,7 +915,7 @@ ssize_t cifs_user_write(struct file *file, const char __user *write_data,
                                min_t(const int, cifs_sb->wsize,
                                      write_size - total_written),
                                *poffset, &bytes_written,
-                               NULL, write_data + total_written, long_op);
+                               NULL, write_data + total_written, 0);
                }
                if (rc || (bytes_written == 0)) {
                        if (total_written)
@@ -944,8 +928,6 @@ ssize_t cifs_user_write(struct file *file, const char __user *write_data,
                        cifs_update_eof(cifsi, *poffset, bytes_written);
                        *poffset += bytes_written;
                }
-               long_op = CIFS_STD_OP; /* subsequent writes fast -
-                                   15 seconds is plenty */
        }
 
        cifs_stats_bytes_written(pTcon, total_written);
@@ -974,7 +956,7 @@ static ssize_t cifs_write(struct cifsFileInfo *open_file,
        unsigned int total_written;
        struct cifs_sb_info *cifs_sb;
        struct cifsTconInfo *pTcon;
-       int xid, long_op;
+       int xid;
        struct dentry *dentry = open_file->dentry;
        struct cifsInodeInfo *cifsi = CIFS_I(dentry->d_inode);
 
@@ -987,7 +969,6 @@ static ssize_t cifs_write(struct cifsFileInfo *open_file,
 
        xid = GetXid();
 
-       long_op = cifs_write_timeout(cifsi, *poffset);
        for (total_written = 0; write_size > total_written;
             total_written += bytes_written) {
                rc = -EAGAIN;
@@ -1017,7 +998,7 @@ static ssize_t cifs_write(struct cifsFileInfo *open_file,
                                rc = CIFSSMBWrite2(xid, pTcon,
                                                open_file->netfid, len,
                                                *poffset, &bytes_written,
-                                               iov, 1, long_op);
+                                               iov, 1, 0);
                        } else
                                rc = CIFSSMBWrite(xid, pTcon,
                                         open_file->netfid,
@@ -1025,7 +1006,7 @@ static ssize_t cifs_write(struct cifsFileInfo *open_file,
                                               write_size - total_written),
                                         *poffset, &bytes_written,
                                         write_data + total_written,
-                                        NULL, long_op);
+                                        NULL, 0);
                }
                if (rc || (bytes_written == 0)) {
                        if (total_written)
@@ -1038,8 +1019,6 @@ static ssize_t cifs_write(struct cifsFileInfo *open_file,
                        cifs_update_eof(cifsi, *poffset, bytes_written);
                        *poffset += bytes_written;
                }
-               long_op = CIFS_STD_OP; /* subsequent writes fast -
-                                   15 seconds is plenty */
        }
 
        cifs_stats_bytes_written(pTcon, total_written);
@@ -1239,7 +1218,7 @@ static int cifs_writepages(struct address_space *mapping,
        struct pagevec pvec;
        int rc = 0;
        int scanned = 0;
-       int xid, long_op;
+       int xid;
 
        cifs_sb = CIFS_SB(mapping->host->i_sb);
 
@@ -1377,43 +1356,67 @@ retry:
                                break;
                }
                if (n_iov) {
+retry_write:
                        open_file = find_writable_file(CIFS_I(mapping->host),
                                                        false);
                        if (!open_file) {
                                cERROR(1, "No writable handles for inode");
                                rc = -EBADF;
                        } else {
-                               long_op = cifs_write_timeout(cifsi, offset);
                                rc = CIFSSMBWrite2(xid, tcon, open_file->netfid,
                                                   bytes_to_write, offset,
                                                   &bytes_written, iov, n_iov,
-                                                  long_op);
+                                                  0);
                                cifsFileInfo_put(open_file);
-                               cifs_update_eof(cifsi, offset, bytes_written);
                        }
 
-                       if (rc || bytes_written < bytes_to_write) {
-                               cERROR(1, "Write2 ret %d, wrote %d",
-                                         rc, bytes_written);
-                               mapping_set_error(mapping, rc);
-                       } else {
+                       cFYI(1, "Write2 rc=%d, wrote=%u", rc, bytes_written);
+
+                       /*
+                        * For now, treat a short write as if nothing got
+                        * written. A zero length write however indicates
+                        * ENOSPC or EFBIG. We have no way to know which
+                        * though, so call it ENOSPC for now. EFBIG would
+                        * get translated to AS_EIO anyway.
+                        *
+                        * FIXME: make it take into account the data that did
+                        *        get written
+                        */
+                       if (rc == 0) {
+                               if (bytes_written == 0)
+                                       rc = -ENOSPC;
+                               else if (bytes_written < bytes_to_write)
+                                       rc = -EAGAIN;
+                       }
+
+                       /* retry on data-integrity flush */
+                       if (wbc->sync_mode == WB_SYNC_ALL && rc == -EAGAIN)
+                               goto retry_write;
+
+                       /* fix the stats and EOF */
+                       if (bytes_written > 0) {
                                cifs_stats_bytes_written(tcon, bytes_written);
+                               cifs_update_eof(cifsi, offset, bytes_written);
                        }
 
                        for (i = 0; i < n_iov; i++) {
                                page = pvec.pages[first + i];
-                               /* Should we also set page error on
-                               success rc but too little data written? */
-                               /* BB investigate retry logic on temporary
-                               server crash cases and how recovery works
-                               when page marked as error */
-                               if (rc)
+                               /* on retryable write error, redirty page */
+                               if (rc == -EAGAIN)
+                                       redirty_page_for_writepage(wbc, page);
+                               else if (rc != 0)
                                        SetPageError(page);
                                kunmap(page);
                                unlock_page(page);
                                end_page_writeback(page);
                                page_cache_release(page);
                        }
+
+                       if (rc != -EAGAIN)
+                               mapping_set_error(mapping, rc);
+                       else
+                               rc = 0;
+
                        if ((wbc->nr_to_write -= n_iov) <= 0)
                                done = 1;
                        index = next;
@@ -1525,27 +1528,47 @@ static int cifs_write_end(struct file *file, struct address_space *mapping,
        return rc;
 }
 
-int cifs_fsync(struct file *file, int datasync)
+int cifs_strict_fsync(struct file *file, int datasync)
 {
        int xid;
        int rc = 0;
        struct cifsTconInfo *tcon;
        struct cifsFileInfo *smbfile = file->private_data;
        struct inode *inode = file->f_path.dentry->d_inode;
+       struct cifs_sb_info *cifs_sb = CIFS_SB(inode->i_sb);
 
        xid = GetXid();
 
        cFYI(1, "Sync file - name: %s datasync: 0x%x",
                file->f_path.dentry->d_name.name, datasync);
 
-       rc = filemap_write_and_wait(inode->i_mapping);
-       if (rc == 0) {
-               struct cifs_sb_info *cifs_sb = CIFS_SB(inode->i_sb);
+       if (!CIFS_I(inode)->clientCanCacheRead)
+               cifs_invalidate_mapping(inode);
 
-               tcon = tlink_tcon(smbfile->tlink);
-               if (!(cifs_sb->mnt_cifs_flags & CIFS_MOUNT_NOSSYNC))
-                       rc = CIFSSMBFlush(xid, tcon, smbfile->netfid);
-       }
+       tcon = tlink_tcon(smbfile->tlink);
+       if (!(cifs_sb->mnt_cifs_flags & CIFS_MOUNT_NOSSYNC))
+               rc = CIFSSMBFlush(xid, tcon, smbfile->netfid);
+
+       FreeXid(xid);
+       return rc;
+}
+
+int cifs_fsync(struct file *file, int datasync)
+{
+       int xid;
+       int rc = 0;
+       struct cifsTconInfo *tcon;
+       struct cifsFileInfo *smbfile = file->private_data;
+       struct cifs_sb_info *cifs_sb = CIFS_SB(file->f_path.dentry->d_sb);
+
+       xid = GetXid();
+
+       cFYI(1, "Sync file - name: %s datasync: 0x%x",
+               file->f_path.dentry->d_name.name, datasync);
+
+       tcon = tlink_tcon(smbfile->tlink);
+       if (!(cifs_sb->mnt_cifs_flags & CIFS_MOUNT_NOSSYNC))
+               rc = CIFSSMBFlush(xid, tcon, smbfile->netfid);
 
        FreeXid(xid);
        return rc;
@@ -1596,42 +1619,42 @@ int cifs_flush(struct file *file, fl_owner_t id)
        return rc;
 }
 
-ssize_t cifs_user_read(struct file *file, char __user *read_data,
-       size_t read_size, loff_t *poffset)
+static ssize_t
+cifs_iovec_read(struct file *file, const struct iovec *iov,
+                unsigned long nr_segs, loff_t *poffset)
 {
-       int rc = -EACCES;
-       unsigned int bytes_read = 0;
-       unsigned int total_read = 0;
-       unsigned int current_read_size;
+       int rc;
+       int xid;
+       unsigned int total_read, bytes_read = 0;
+       size_t len, cur_len;
+       int iov_offset = 0;
        struct cifs_sb_info *cifs_sb;
        struct cifsTconInfo *pTcon;
-       int xid;
        struct cifsFileInfo *open_file;
-       char *smb_read_data;
-       char __user *current_offset;
        struct smb_com_read_rsp *pSMBr;
+       char *read_data;
+
+       if (!nr_segs)
+               return 0;
+
+       len = iov_length(iov, nr_segs);
+       if (!len)
+               return 0;
 
        xid = GetXid();
        cifs_sb = CIFS_SB(file->f_path.dentry->d_sb);
 
-       if (file->private_data == NULL) {
-               rc = -EBADF;
-               FreeXid(xid);
-               return rc;
-       }
        open_file = file->private_data;
        pTcon = tlink_tcon(open_file->tlink);
 
        if ((file->f_flags & O_ACCMODE) == O_WRONLY)
                cFYI(1, "attempting read on write only file instance");
 
-       for (total_read = 0, current_offset = read_data;
-            read_size > total_read;
-            total_read += bytes_read, current_offset += bytes_read) {
-               current_read_size = min_t(const int, read_size - total_read,
-                                         cifs_sb->rsize);
+       for (total_read = 0; total_read < len; total_read += bytes_read) {
+               cur_len = min_t(const size_t, len - total_read, cifs_sb->rsize);
                rc = -EAGAIN;
-               smb_read_data = NULL;
+               read_data = NULL;
+
                while (rc == -EAGAIN) {
                        int buf_type = CIFS_NO_BUFFER;
                        if (open_file->invalidHandle) {
@@ -1639,27 +1662,25 @@ ssize_t cifs_user_read(struct file *file, char __user *read_data,
                                if (rc != 0)
                                        break;
                        }
-                       rc = CIFSSMBRead(xid, pTcon,
-                                        open_file->netfid,
-                                        current_read_size, *poffset,
-                                        &bytes_read, &smb_read_data,
-                                        &buf_type);
-                       pSMBr = (struct smb_com_read_rsp *)smb_read_data;
-                       if (smb_read_data) {
-                               if (copy_to_user(current_offset,
-                                               smb_read_data +
-                                               4 /* RFC1001 length field */ +
-                                               le16_to_cpu(pSMBr->DataOffset),
-                                               bytes_read))
+                       rc = CIFSSMBRead(xid, pTcon, open_file->netfid,
+                                        cur_len, *poffset, &bytes_read,
+                                        &read_data, &buf_type);
+                       pSMBr = (struct smb_com_read_rsp *)read_data;
+                       if (read_data) {
+                               char *data_offset = read_data + 4 +
+                                               le16_to_cpu(pSMBr->DataOffset);
+                               if (memcpy_toiovecend(iov, data_offset,
+                                                     iov_offset, bytes_read))
                                        rc = -EFAULT;
-
                                if (buf_type == CIFS_SMALL_BUFFER)
-                                       cifs_small_buf_release(smb_read_data);
+                                       cifs_small_buf_release(read_data);
                                else if (buf_type == CIFS_LARGE_BUFFER)
-                                       cifs_buf_release(smb_read_data);
-                               smb_read_data = NULL;
+                                       cifs_buf_release(read_data);
+                               read_data = NULL;
+                               iov_offset += bytes_read;
                        }
                }
+
                if (rc || (bytes_read == 0)) {
                        if (total_read) {
                                break;
@@ -1672,13 +1693,57 @@ ssize_t cifs_user_read(struct file *file, char __user *read_data,
                        *poffset += bytes_read;
                }
        }
+
        FreeXid(xid);
        return total_read;
 }
 
+ssize_t cifs_user_read(struct file *file, char __user *read_data,
+                      size_t read_size, loff_t *poffset)
+{
+       struct iovec iov;
+       iov.iov_base = read_data;
+       iov.iov_len = read_size;
+
+       return cifs_iovec_read(file, &iov, 1, poffset);
+}
+
+static ssize_t cifs_user_readv(struct kiocb *iocb, const struct iovec *iov,
+                              unsigned long nr_segs, loff_t pos)
+{
+       ssize_t read;
+
+       read = cifs_iovec_read(iocb->ki_filp, iov, nr_segs, &pos);
+       if (read > 0)
+               iocb->ki_pos = pos;
+
+       return read;
+}
+
+ssize_t cifs_strict_readv(struct kiocb *iocb, const struct iovec *iov,
+                         unsigned long nr_segs, loff_t pos)
+{
+       struct inode *inode;
+
+       inode = iocb->ki_filp->f_path.dentry->d_inode;
+
+       if (CIFS_I(inode)->clientCanCacheRead)
+               return generic_file_aio_read(iocb, iov, nr_segs, pos);
+
+       /*
+        * In strict cache mode we need to read from the server all the time
+        * if we don't have level II oplock because the server can delay mtime
+        * change - so we can't make a decision about inode invalidating.
+        * And we can also fail with pagereading if there are mandatory locks
+        * on pages affected by this read but not on the region from pos to
+        * pos+len-1.
+        */
+
+       return cifs_user_readv(iocb, iov, nr_segs, pos);
+}
 
 static ssize_t cifs_read(struct file *file, char *read_data, size_t read_size,
-       loff_t *poffset)
+                        loff_t *poffset)
 {
        int rc = -EACCES;
        unsigned int bytes_read = 0;
@@ -1746,6 +1811,21 @@ static ssize_t cifs_read(struct file *file, char *read_data, size_t read_size,
        return total_read;
 }
 
+int cifs_file_strict_mmap(struct file *file, struct vm_area_struct *vma)
+{
+       int rc, xid;
+       struct inode *inode = file->f_path.dentry->d_inode;
+
+       xid = GetXid();
+
+       if (!CIFS_I(inode)->clientCanCacheRead)
+               cifs_invalidate_mapping(inode);
+
+       rc = generic_file_mmap(file, vma);
+       FreeXid(xid);
+       return rc;
+}
+
 int cifs_file_mmap(struct file *file, struct vm_area_struct *vma)
 {
        int rc, xid;
@@ -2192,7 +2272,8 @@ void cifs_oplock_break(struct work_struct *work)
         */
        if (!cfile->oplock_break_cancelled) {
                rc = CIFSSMBLock(0, tlink_tcon(cfile->tlink), cfile->netfid, 0,
-                                0, 0, 0, LOCKING_ANDX_OPLOCK_RELEASE, false);
+                                0, 0, 0, LOCKING_ANDX_OPLOCK_RELEASE, false,
+                                cinode->clientCanCacheRead ? 1 : 0);
                cFYI(1, "Oplock release rc = %d", rc);
        }
 
index 6c9ee8014ff0426e6aaed09f77a8ebffe9a406b3..8852470b4fbb50b55907cbbd2f4d75357a9f0776 100644 (file)
@@ -44,13 +44,17 @@ static void cifs_set_ops(struct inode *inode)
                                inode->i_fop = &cifs_file_direct_nobrl_ops;
                        else
                                inode->i_fop = &cifs_file_direct_ops;
+               } else if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_STRICT_IO) {
+                       if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_NO_BRL)
+                               inode->i_fop = &cifs_file_strict_nobrl_ops;
+                       else
+                               inode->i_fop = &cifs_file_strict_ops;
                } else if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_NO_BRL)
                        inode->i_fop = &cifs_file_nobrl_ops;
                else { /* not direct, send byte range locks */
                        inode->i_fop = &cifs_file_ops;
                }
 
-
                /* check if server can support readpages */
                if (cifs_sb_master_tcon(cifs_sb)->ses->server->maxBuf <
                                PAGE_CACHE_SIZE + MAX_CIFS_HDR_SIZE)
@@ -1679,7 +1683,7 @@ cifs_inode_needs_reval(struct inode *inode)
 /*
  * Zap the cache. Called when invalid_mapping flag is set.
  */
-static void
+void
 cifs_invalidate_mapping(struct inode *inode)
 {
        int rc;
index 43f10281bc19e80be48303e1bd9c974b4882cb37..a09e077ba92531e7d8614fc2ce0f8878613c36fb 100644 (file)
@@ -571,7 +571,7 @@ is_valid_oplock_break(struct smb_hdr *buf, struct TCP_Server_Info *srv)
                                pCifsInode = CIFS_I(netfile->dentry->d_inode);
 
                                cifs_set_oplock_level(pCifsInode,
-                                                     pSMB->OplockLevel);
+                                       pSMB->OplockLevel ? OPLOCK_READ : 0);
                                /*
                                 * cifs_oplock_break_put() can't be called
                                 * from here.  Get reference after queueing
@@ -637,77 +637,6 @@ dump_smb(struct smb_hdr *smb_buf, int smb_buf_length)
        return;
 }
 
-/* Convert 16 bit Unicode pathname to wire format from string in current code
-   page.  Conversion may involve remapping up the seven characters that are
-   only legal in POSIX-like OS (if they are present in the string). Path
-   names are little endian 16 bit Unicode on the wire */
-int
-cifsConvertToUCS(__le16 *target, const char *source, int maxlen,
-                const struct nls_table *cp, int mapChars)
-{
-       int i, j, charlen;
-       int len_remaining = maxlen;
-       char src_char;
-       __u16 temp;
-
-       if (!mapChars)
-               return cifs_strtoUCS(target, source, PATH_MAX, cp);
-
-       for (i = 0, j = 0; i < maxlen; j++) {
-               src_char = source[i];
-               switch (src_char) {
-                       case 0:
-                               target[j] = 0;
-                               goto ctoUCS_out;
-                       case ':':
-                               target[j] = cpu_to_le16(UNI_COLON);
-                               break;
-                       case '*':
-                               target[j] = cpu_to_le16(UNI_ASTERIK);
-                               break;
-                       case '?':
-                               target[j] = cpu_to_le16(UNI_QUESTION);
-                               break;
-                       case '<':
-                               target[j] = cpu_to_le16(UNI_LESSTHAN);
-                               break;
-                       case '>':
-                               target[j] = cpu_to_le16(UNI_GRTRTHAN);
-                               break;
-                       case '|':
-                               target[j] = cpu_to_le16(UNI_PIPE);
-                               break;
-                       /* BB We can not handle remapping slash until
-                          all the calls to build_path_from_dentry
-                          are modified, as they use slash as separator BB */
-                       /* case '\\':
-                               target[j] = cpu_to_le16(UNI_SLASH);
-                               break;*/
-                       default:
-                               charlen = cp->char2uni(source+i,
-                                       len_remaining, &temp);
-                               /* if no match, use question mark, which
-                               at least in some cases servers as wild card */
-                               if (charlen < 1) {
-                                       target[j] = cpu_to_le16(0x003f);
-                                       charlen = 1;
-                               } else
-                                       target[j] = cpu_to_le16(temp);
-                               len_remaining -= charlen;
-                               /* character may take more than one byte in the
-                                  the source string, but will take exactly two
-                                  bytes in the target string */
-                               i += charlen;
-                               continue;
-               }
-               i++; /* move to next char in source string */
-               len_remaining--;
-       }
-
-ctoUCS_out:
-       return i;
-}
-
 void
 cifs_autodisable_serverino(struct cifs_sb_info *cifs_sb)
 {
index 6783ce6cdc895371d8edcfa9a79b06940223b5d5..8d9189f644777714342473ea795456e5f145f2ad 100644 (file)
@@ -916,14 +916,14 @@ unsigned int
 smbCalcSize(struct smb_hdr *ptr)
 {
        return (sizeof(struct smb_hdr) + (2 * ptr->WordCount) +
-               2 /* size of the bcc field */ + BCC(ptr));
+               2 /* size of the bcc field */ + get_bcc(ptr));
 }
 
 unsigned int
 smbCalcSize_LE(struct smb_hdr *ptr)
 {
        return (sizeof(struct smb_hdr) + (2 * ptr->WordCount) +
-               2 /* size of the bcc field */ + le16_to_cpu(BCC_LE(ptr)));
+               2 /* size of the bcc field */ + get_bcc_le(ptr));
 }
 
 /* The following are taken from fs/ntfs/util.c */
index eb746486e49e8da35ee1b7d940e964f191fe9df9..1adc9625a344be288bc0151eda20a5874569eaa3 100644 (file)
@@ -277,7 +277,7 @@ static void ascii_ssetup_strings(char **pbcc_area, struct cifsSesInfo *ses,
 }
 
 static void
-decode_unicode_ssetup(char **pbcc_area, int bleft, struct cifsSesInfo *ses,
+decode_unicode_ssetup(char **pbcc_area, __u16 bleft, struct cifsSesInfo *ses,
                      const struct nls_table *nls_cp)
 {
        int len;
@@ -323,7 +323,7 @@ decode_unicode_ssetup(char **pbcc_area, int bleft, struct cifsSesInfo *ses,
        return;
 }
 
-static int decode_ascii_ssetup(char **pbcc_area, int bleft,
+static int decode_ascii_ssetup(char **pbcc_area, __u16 bleft,
                               struct cifsSesInfo *ses,
                               const struct nls_table *nls_cp)
 {
@@ -575,12 +575,11 @@ CIFS_SessSetup(unsigned int xid, struct cifsSesInfo *ses,
        char *str_area;
        SESSION_SETUP_ANDX *pSMB;
        __u32 capabilities;
-       int count;
+       __u16 count;
        int resp_buf_type;
        struct kvec iov[3];
        enum securityEnum type;
-       __u16 action;
-       int bytes_remaining;
+       __u16 action, bytes_remaining;
        struct key *spnego_key = NULL;
        __le32 phase = NtLmNegotiate; /* NTLMSSP, if needed, is multistage */
        u16 blob_len;
@@ -876,10 +875,10 @@ ssetup_ntlmssp_authenticate:
        count = iov[1].iov_len + iov[2].iov_len;
        smb_buf->smb_buf_length += count;
 
-       BCC_LE(smb_buf) = cpu_to_le16(count);
+       put_bcc_le(count, smb_buf);
 
        rc = SendReceive2(xid, ses, iov, 3 /* num_iovecs */, &resp_buf_type,
-                         CIFS_STD_OP /* not long */ | CIFS_LOG_ERROR);
+                         CIFS_LOG_ERROR);
        /* SMB request buf freed in SendReceive2 */
 
        pSMB = (SESSION_SETUP_ANDX *)iov[0].iov_base;
@@ -910,7 +909,7 @@ ssetup_ntlmssp_authenticate:
        cFYI(1, "UID = %d ", ses->Suid);
        /* response can have either 3 or 4 word count - Samba sends 3 */
        /* and lanman response is 3 */
-       bytes_remaining = BCC(smb_buf);
+       bytes_remaining = get_bcc(smb_buf);
        bcc_ptr = pByteArea(smb_buf);
 
        if (smb_buf->WordCount == 4) {
index 59ca81b16919ea2a9d978ced67df60315499711c..c1ccca1a933ffca32d96800dd697bbb1d504d761 100644 (file)
 
 extern mempool_t *cifs_mid_poolp;
 
-static struct mid_q_entry *
+static void
+wake_up_task(struct mid_q_entry *mid)
+{
+       wake_up_process(mid->callback_data);
+}
+
+struct mid_q_entry *
 AllocMidQEntry(const struct smb_hdr *smb_buffer, struct TCP_Server_Info *server)
 {
        struct mid_q_entry *temp;
@@ -58,28 +64,28 @@ AllocMidQEntry(const struct smb_hdr *smb_buffer, struct TCP_Server_Info *server)
        /*      do_gettimeofday(&temp->when_sent);*/ /* easier to use jiffies */
                /* when mid allocated can be before when sent */
                temp->when_alloc = jiffies;
-               temp->tsk = current;
+
+               /*
+                * The default is for the mid to be synchronous, so the
+                * default callback just wakes up the current task.
+                */
+               temp->callback = wake_up_task;
+               temp->callback_data = current;
        }
 
-       spin_lock(&GlobalMid_Lock);
-       list_add_tail(&temp->qhead, &server->pending_mid_q);
        atomic_inc(&midCount);
        temp->midState = MID_REQUEST_ALLOCATED;
-       spin_unlock(&GlobalMid_Lock);
        return temp;
 }
 
-static void
+void
 DeleteMidQEntry(struct mid_q_entry *midEntry)
 {
 #ifdef CONFIG_CIFS_STATS2
        unsigned long now;
 #endif
-       spin_lock(&GlobalMid_Lock);
        midEntry->midState = MID_FREE;
-       list_del(&midEntry->qhead);
        atomic_dec(&midCount);
-       spin_unlock(&GlobalMid_Lock);
        if (midEntry->largeBuf)
                cifs_buf_release(midEntry->resp_buf);
        else
@@ -103,6 +109,16 @@ DeleteMidQEntry(struct mid_q_entry *midEntry)
        mempool_free(midEntry, cifs_mid_poolp);
 }
 
+static void
+delete_mid(struct mid_q_entry *mid)
+{
+       spin_lock(&GlobalMid_Lock);
+       list_del(&mid->qhead);
+       spin_unlock(&GlobalMid_Lock);
+
+       DeleteMidQEntry(mid);
+}
+
 static int
 smb_sendv(struct TCP_Server_Info *server, struct kvec *iov, int n_vec)
 {
@@ -244,31 +260,31 @@ smb_send(struct TCP_Server_Info *server, struct smb_hdr *smb_buffer,
        return smb_sendv(server, &iov, 1);
 }
 
-static int wait_for_free_request(struct cifsSesInfo *ses, const int long_op)
+static int wait_for_free_request(struct TCP_Server_Info *server,
+                                const int long_op)
 {
        if (long_op == CIFS_ASYNC_OP) {
                /* oplock breaks must not be held up */
-               atomic_inc(&ses->server->inFlight);
+               atomic_inc(&server->inFlight);
                return 0;
        }
 
        spin_lock(&GlobalMid_Lock);
        while (1) {
-               if (atomic_read(&ses->server->inFlight) >=
-                               cifs_max_pending){
+               if (atomic_read(&server->inFlight) >= cifs_max_pending) {
                        spin_unlock(&GlobalMid_Lock);
 #ifdef CONFIG_CIFS_STATS2
-                       atomic_inc(&ses->server->num_waiters);
+                       atomic_inc(&server->num_waiters);
 #endif
-                       wait_event(ses->server->request_q,
-                                  atomic_read(&ses->server->inFlight)
+                       wait_event(server->request_q,
+                                  atomic_read(&server->inFlight)
                                     < cifs_max_pending);
 #ifdef CONFIG_CIFS_STATS2
-                       atomic_dec(&ses->server->num_waiters);
+                       atomic_dec(&server->num_waiters);
 #endif
                        spin_lock(&GlobalMid_Lock);
                } else {
-                       if (ses->server->tcpStatus == CifsExiting) {
+                       if (server->tcpStatus == CifsExiting) {
                                spin_unlock(&GlobalMid_Lock);
                                return -ENOENT;
                        }
@@ -278,7 +294,7 @@ static int wait_for_free_request(struct cifsSesInfo *ses, const int long_op)
 
                        /* update # of requests on the wire to server */
                        if (long_op != CIFS_BLOCKING_OP)
-                               atomic_inc(&ses->server->inFlight);
+                               atomic_inc(&server->inFlight);
                        spin_unlock(&GlobalMid_Lock);
                        break;
                }
@@ -308,53 +324,81 @@ static int allocate_mid(struct cifsSesInfo *ses, struct smb_hdr *in_buf,
        *ppmidQ = AllocMidQEntry(in_buf, ses->server);
        if (*ppmidQ == NULL)
                return -ENOMEM;
+       spin_lock(&GlobalMid_Lock);
+       list_add_tail(&(*ppmidQ)->qhead, &ses->server->pending_mid_q);
+       spin_unlock(&GlobalMid_Lock);
        return 0;
 }
 
-static int wait_for_response(struct cifsSesInfo *ses,
-                       struct mid_q_entry *midQ,
-                       unsigned long timeout,
-                       unsigned long time_to_wait)
+static int
+wait_for_response(struct TCP_Server_Info *server, struct mid_q_entry *midQ)
 {
-       unsigned long curr_timeout;
+       int error;
 
-       for (;;) {
-               curr_timeout = timeout + jiffies;
-               wait_event_timeout(ses->server->response_q,
-                       midQ->midState != MID_REQUEST_SUBMITTED, timeout);
+       error = wait_event_killable(server->response_q,
+                                   midQ->midState != MID_REQUEST_SUBMITTED);
+       if (error < 0)
+               return -ERESTARTSYS;
 
-               if (time_after(jiffies, curr_timeout) &&
-                       (midQ->midState == MID_REQUEST_SUBMITTED) &&
-                       ((ses->server->tcpStatus == CifsGood) ||
-                        (ses->server->tcpStatus == CifsNew))) {
+       return 0;
+}
 
-                       unsigned long lrt;
 
-                       /* We timed out. Is the server still
-                          sending replies ? */
-                       spin_lock(&GlobalMid_Lock);
-                       lrt = ses->server->lstrp;
-                       spin_unlock(&GlobalMid_Lock);
+/*
+ * Send a SMB request and set the callback function in the mid to handle
+ * the result. Caller is responsible for dealing with timeouts.
+ */
+int
+cifs_call_async(struct TCP_Server_Info *server, struct smb_hdr *in_buf,
+               mid_callback_t *callback, void *cbdata)
+{
+       int rc;
+       struct mid_q_entry *mid;
 
-                       /* Calculate time_to_wait past last receive time.
-                        Although we prefer not to time out if the
-                        server is still responding - we will time
-                        out if the server takes more than 15 (or 45
-                        or 180) seconds to respond to this request
-                        and has not responded to any request from
-                        other threads on the client within 10 seconds */
-                       lrt += time_to_wait;
-                       if (time_after(jiffies, lrt)) {
-                               /* No replies for time_to_wait. */
-                               cERROR(1, "server not responding");
-                               return -1;
-                       }
-               } else {
-                       return 0;
-               }
+       rc = wait_for_free_request(server, CIFS_ASYNC_OP);
+       if (rc)
+               return rc;
+
+       mutex_lock(&server->srv_mutex);
+       mid = AllocMidQEntry(in_buf, server);
+       if (mid == NULL) {
+               mutex_unlock(&server->srv_mutex);
+               return -ENOMEM;
        }
-}
 
+       /* put it on the pending_mid_q */
+       spin_lock(&GlobalMid_Lock);
+       list_add_tail(&mid->qhead, &server->pending_mid_q);
+       spin_unlock(&GlobalMid_Lock);
+
+       rc = cifs_sign_smb(in_buf, server, &mid->sequence_number);
+       if (rc) {
+               mutex_unlock(&server->srv_mutex);
+               goto out_err;
+       }
+
+       mid->callback = callback;
+       mid->callback_data = cbdata;
+       mid->midState = MID_REQUEST_SUBMITTED;
+#ifdef CONFIG_CIFS_STATS2
+       atomic_inc(&server->inSend);
+#endif
+       rc = smb_send(server, in_buf, in_buf->smb_buf_length);
+#ifdef CONFIG_CIFS_STATS2
+       atomic_dec(&server->inSend);
+       mid->when_sent = jiffies;
+#endif
+       mutex_unlock(&server->srv_mutex);
+       if (rc)
+               goto out_err;
+
+       return rc;
+out_err:
+       delete_mid(mid);
+       atomic_dec(&server->inFlight);
+       wake_up(&server->request_q);
+       return rc;
+}
 
 /*
  *
@@ -382,6 +426,81 @@ SendReceiveNoRsp(const unsigned int xid, struct cifsSesInfo *ses,
        return rc;
 }
 
+static int
+sync_mid_result(struct mid_q_entry *mid, struct TCP_Server_Info *server)
+{
+       int rc = 0;
+
+       cFYI(1, "%s: cmd=%d mid=%d state=%d", __func__, mid->command,
+               mid->mid, mid->midState);
+
+       spin_lock(&GlobalMid_Lock);
+       /* ensure that it's no longer on the pending_mid_q */
+       list_del_init(&mid->qhead);
+
+       switch (mid->midState) {
+       case MID_RESPONSE_RECEIVED:
+               spin_unlock(&GlobalMid_Lock);
+               return rc;
+       case MID_REQUEST_SUBMITTED:
+               /* socket is going down, reject all calls */
+               if (server->tcpStatus == CifsExiting) {
+                       cERROR(1, "%s: canceling mid=%d cmd=0x%x state=%d",
+                              __func__, mid->mid, mid->command, mid->midState);
+                       rc = -EHOSTDOWN;
+                       break;
+               }
+       case MID_RETRY_NEEDED:
+               rc = -EAGAIN;
+               break;
+       default:
+               cERROR(1, "%s: invalid mid state mid=%d state=%d", __func__,
+                       mid->mid, mid->midState);
+               rc = -EIO;
+       }
+       spin_unlock(&GlobalMid_Lock);
+
+       DeleteMidQEntry(mid);
+       return rc;
+}
+
+/*
+ * An NT cancel request header looks just like the original request except:
+ *
+ * The Command is SMB_COM_NT_CANCEL
+ * The WordCount is zeroed out
+ * The ByteCount is zeroed out
+ *
+ * This function mangles an existing request buffer into a
+ * SMB_COM_NT_CANCEL request and then sends it.
+ */
+static int
+send_nt_cancel(struct TCP_Server_Info *server, struct smb_hdr *in_buf,
+               struct mid_q_entry *mid)
+{
+       int rc = 0;
+
+       /* -4 for RFC1001 length and +2 for BCC field */
+       in_buf->smb_buf_length = sizeof(struct smb_hdr) - 4  + 2;
+       in_buf->Command = SMB_COM_NT_CANCEL;
+       in_buf->WordCount = 0;
+       put_bcc_le(0, in_buf);
+
+       mutex_lock(&server->srv_mutex);
+       rc = cifs_sign_smb(in_buf, server, &mid->sequence_number);
+       if (rc) {
+               mutex_unlock(&server->srv_mutex);
+               return rc;
+       }
+       rc = smb_send(server, in_buf, in_buf->smb_buf_length);
+       mutex_unlock(&server->srv_mutex);
+
+       cFYI(1, "issued NT_CANCEL for mid %u, rc = %d",
+               in_buf->Mid, rc);
+
+       return rc;
+}
+
 int
 SendReceive2(const unsigned int xid, struct cifsSesInfo *ses,
             struct kvec *iov, int n_vec, int *pRespBufType /* ret */,
@@ -390,7 +509,6 @@ SendReceive2(const unsigned int xid, struct cifsSesInfo *ses,
        int rc = 0;
        int long_op;
        unsigned int receive_len;
-       unsigned long timeout;
        struct mid_q_entry *midQ;
        struct smb_hdr *in_buf = iov[0].iov_base;
 
@@ -413,7 +531,7 @@ SendReceive2(const unsigned int xid, struct cifsSesInfo *ses,
           to the same server. We may make this configurable later or
           use ses->maxReq */
 
-       rc = wait_for_free_request(ses, long_op);
+       rc = wait_for_free_request(ses->server, long_op);
        if (rc) {
                cifs_small_buf_release(in_buf);
                return rc;
@@ -457,65 +575,20 @@ SendReceive2(const unsigned int xid, struct cifsSesInfo *ses,
        if (rc < 0)
                goto out;
 
-       if (long_op == CIFS_STD_OP)
-               timeout = 15 * HZ;
-       else if (long_op == CIFS_VLONG_OP) /* e.g. slow writes past EOF */
-               timeout = 180 * HZ;
-       else if (long_op == CIFS_LONG_OP)
-               timeout = 45 * HZ; /* should be greater than
-                       servers oplock break timeout (about 43 seconds) */
-       else if (long_op == CIFS_ASYNC_OP)
+       if (long_op == CIFS_ASYNC_OP)
                goto out;
-       else if (long_op == CIFS_BLOCKING_OP)
-               timeout = 0x7FFFFFFF; /*  large, but not so large as to wrap */
-       else {
-               cERROR(1, "unknown timeout flag %d", long_op);
-               rc = -EIO;
-               goto out;
-       }
-
-       /* wait for 15 seconds or until woken up due to response arriving or
-          due to last connection to this server being unmounted */
-       if (signal_pending(current)) {
-               /* if signal pending do not hold up user for full smb timeout
-               but we still give response a chance to complete */
-               timeout = 2 * HZ;
-       }
-
-       /* No user interrupts in wait - wreaks havoc with performance */
-       wait_for_response(ses, midQ, timeout, 10 * HZ);
-
-       spin_lock(&GlobalMid_Lock);
 
-       if (midQ->resp_buf == NULL) {
-               cERROR(1, "No response to cmd %d mid %d",
-                       midQ->command, midQ->mid);
-               if (midQ->midState == MID_REQUEST_SUBMITTED) {
-                       if (ses->server->tcpStatus == CifsExiting)
-                               rc = -EHOSTDOWN;
-                       else {
-                               ses->server->tcpStatus = CifsNeedReconnect;
-                               midQ->midState = MID_RETRY_NEEDED;
-                       }
-               }
+       rc = wait_for_response(ses->server, midQ);
+       if (rc != 0)
+               goto out;
 
-               if (rc != -EHOSTDOWN) {
-                       if (midQ->midState == MID_RETRY_NEEDED) {
-                               rc = -EAGAIN;
-                               cFYI(1, "marking request for retry");
-                       } else {
-                               rc = -EIO;
-                       }
-               }
-               spin_unlock(&GlobalMid_Lock);
-               DeleteMidQEntry(midQ);
-               /* Update # of requests on wire to server */
+       rc = sync_mid_result(midQ, ses->server);
+       if (rc != 0) {
                atomic_dec(&ses->server->inFlight);
                wake_up(&ses->server->request_q);
                return rc;
        }
 
-       spin_unlock(&GlobalMid_Lock);
        receive_len = midQ->resp_buf->smb_buf_length;
 
        if (receive_len > CIFSMaxBufSize + MAX_CIFS_HDR_SIZE) {
@@ -559,19 +632,18 @@ SendReceive2(const unsigned int xid, struct cifsSesInfo *ses,
                if (receive_len >= sizeof(struct smb_hdr) - 4
                    /* do not count RFC1001 header */  +
                    (2 * midQ->resp_buf->WordCount) + 2 /* bcc */ )
-                       BCC(midQ->resp_buf) =
-                               le16_to_cpu(BCC_LE(midQ->resp_buf));
+                       put_bcc(get_bcc_le(midQ->resp_buf), midQ->resp_buf);
                if ((flags & CIFS_NO_RESP) == 0)
                        midQ->resp_buf = NULL;  /* mark it so buf will
                                                   not be freed by
-                                                  DeleteMidQEntry */
+                                                  delete_mid */
        } else {
                rc = -EIO;
                cFYI(1, "Bad MID state?");
        }
 
 out:
-       DeleteMidQEntry(midQ);
+       delete_mid(midQ);
        atomic_dec(&ses->server->inFlight);
        wake_up(&ses->server->request_q);
 
@@ -585,7 +657,6 @@ SendReceive(const unsigned int xid, struct cifsSesInfo *ses,
 {
        int rc = 0;
        unsigned int receive_len;
-       unsigned long timeout;
        struct mid_q_entry *midQ;
 
        if (ses == NULL) {
@@ -610,7 +681,7 @@ SendReceive(const unsigned int xid, struct cifsSesInfo *ses,
                return -EIO;
        }
 
-       rc = wait_for_free_request(ses, long_op);
+       rc = wait_for_free_request(ses->server, long_op);
        if (rc)
                return rc;
 
@@ -649,64 +720,20 @@ SendReceive(const unsigned int xid, struct cifsSesInfo *ses,
        if (rc < 0)
                goto out;
 
-       if (long_op == CIFS_STD_OP)
-               timeout = 15 * HZ;
-       /* wait for 15 seconds or until woken up due to response arriving or
-          due to last connection to this server being unmounted */
-       else if (long_op == CIFS_ASYNC_OP)
+       if (long_op == CIFS_ASYNC_OP)
                goto out;
-       else if (long_op == CIFS_VLONG_OP) /* writes past EOF can be slow */
-               timeout = 180 * HZ;
-       else if (long_op == CIFS_LONG_OP)
-               timeout = 45 * HZ; /* should be greater than
-                       servers oplock break timeout (about 43 seconds) */
-       else if (long_op == CIFS_BLOCKING_OP)
-               timeout = 0x7FFFFFFF; /* large but no so large as to wrap */
-       else {
-               cERROR(1, "unknown timeout flag %d", long_op);
-               rc = -EIO;
-               goto out;
-       }
 
-       if (signal_pending(current)) {
-               /* if signal pending do not hold up user for full smb timeout
-               but we still give response a chance to complete */
-               timeout = 2 * HZ;
-       }
-
-       /* No user interrupts in wait - wreaks havoc with performance */
-       wait_for_response(ses, midQ, timeout, 10 * HZ);
-
-       spin_lock(&GlobalMid_Lock);
-       if (midQ->resp_buf == NULL) {
-               cERROR(1, "No response for cmd %d mid %d",
-                         midQ->command, midQ->mid);
-               if (midQ->midState == MID_REQUEST_SUBMITTED) {
-                       if (ses->server->tcpStatus == CifsExiting)
-                               rc = -EHOSTDOWN;
-                       else {
-                               ses->server->tcpStatus = CifsNeedReconnect;
-                               midQ->midState = MID_RETRY_NEEDED;
-                       }
-               }
+       rc = wait_for_response(ses->server, midQ);
+       if (rc != 0)
+               goto out;
 
-               if (rc != -EHOSTDOWN) {
-                       if (midQ->midState == MID_RETRY_NEEDED) {
-                               rc = -EAGAIN;
-                               cFYI(1, "marking request for retry");
-                       } else {
-                               rc = -EIO;
-                       }
-               }
-               spin_unlock(&GlobalMid_Lock);
-               DeleteMidQEntry(midQ);
-               /* Update # of requests on wire to server */
+       rc = sync_mid_result(midQ, ses->server);
+       if (rc != 0) {
                atomic_dec(&ses->server->inFlight);
                wake_up(&ses->server->request_q);
                return rc;
        }
 
-       spin_unlock(&GlobalMid_Lock);
        receive_len = midQ->resp_buf->smb_buf_length;
 
        if (receive_len > CIFSMaxBufSize + MAX_CIFS_HDR_SIZE) {
@@ -748,43 +775,20 @@ SendReceive(const unsigned int xid, struct cifsSesInfo *ses,
                if (receive_len >= sizeof(struct smb_hdr) - 4
                    /* do not count RFC1001 header */  +
                    (2 * out_buf->WordCount) + 2 /* bcc */ )
-                       BCC(out_buf) = le16_to_cpu(BCC_LE(out_buf));
+                       put_bcc(get_bcc_le(midQ->resp_buf), midQ->resp_buf);
        } else {
                rc = -EIO;
                cERROR(1, "Bad MID state?");
        }
 
 out:
-       DeleteMidQEntry(midQ);
+       delete_mid(midQ);
        atomic_dec(&ses->server->inFlight);
        wake_up(&ses->server->request_q);
 
        return rc;
 }
 
-/* Send an NT_CANCEL SMB to cause the POSIX blocking lock to return. */
-
-static int
-send_nt_cancel(struct cifsTconInfo *tcon, struct smb_hdr *in_buf,
-               struct mid_q_entry *midQ)
-{
-       int rc = 0;
-       struct cifsSesInfo *ses = tcon->ses;
-       __u16 mid = in_buf->Mid;
-
-       header_assemble(in_buf, SMB_COM_NT_CANCEL, tcon, 0);
-       in_buf->Mid = mid;
-       mutex_lock(&ses->server->srv_mutex);
-       rc = cifs_sign_smb(in_buf, ses->server, &midQ->sequence_number);
-       if (rc) {
-               mutex_unlock(&ses->server->srv_mutex);
-               return rc;
-       }
-       rc = smb_send(ses->server, in_buf, in_buf->smb_buf_length);
-       mutex_unlock(&ses->server->srv_mutex);
-       return rc;
-}
-
 /* We send a LOCKINGX_CANCEL_LOCK to cause the Windows
    blocking lock to return. */
 
@@ -807,7 +811,7 @@ send_lock_cancel(const unsigned int xid, struct cifsTconInfo *tcon,
        pSMB->hdr.Mid = GetNextMid(ses->server);
 
        return SendReceive(xid, ses, in_buf, out_buf,
-                       &bytes_returned, CIFS_STD_OP);
+                       &bytes_returned, 0);
 }
 
 int
@@ -845,7 +849,7 @@ SendReceiveBlockingLock(const unsigned int xid, struct cifsTconInfo *tcon,
                return -EIO;
        }
 
-       rc = wait_for_free_request(ses, CIFS_BLOCKING_OP);
+       rc = wait_for_free_request(ses->server, CIFS_BLOCKING_OP);
        if (rc)
                return rc;
 
@@ -863,7 +867,7 @@ SendReceiveBlockingLock(const unsigned int xid, struct cifsTconInfo *tcon,
 
        rc = cifs_sign_smb(in_buf, ses->server, &midQ->sequence_number);
        if (rc) {
-               DeleteMidQEntry(midQ);
+               delete_mid(midQ);
                mutex_unlock(&ses->server->srv_mutex);
                return rc;
        }
@@ -880,7 +884,7 @@ SendReceiveBlockingLock(const unsigned int xid, struct cifsTconInfo *tcon,
        mutex_unlock(&ses->server->srv_mutex);
 
        if (rc < 0) {
-               DeleteMidQEntry(midQ);
+               delete_mid(midQ);
                return rc;
        }
 
@@ -899,10 +903,9 @@ SendReceiveBlockingLock(const unsigned int xid, struct cifsTconInfo *tcon,
                if (in_buf->Command == SMB_COM_TRANSACTION2) {
                        /* POSIX lock. We send a NT_CANCEL SMB to cause the
                           blocking lock to return. */
-
-                       rc = send_nt_cancel(tcon, in_buf, midQ);
+                       rc = send_nt_cancel(ses->server, in_buf, midQ);
                        if (rc) {
-                               DeleteMidQEntry(midQ);
+                               delete_mid(midQ);
                                return rc;
                        }
                } else {
@@ -914,47 +917,22 @@ SendReceiveBlockingLock(const unsigned int xid, struct cifsTconInfo *tcon,
                        /* If we get -ENOLCK back the lock may have
                           already been removed. Don't exit in this case. */
                        if (rc && rc != -ENOLCK) {
-                               DeleteMidQEntry(midQ);
+                               delete_mid(midQ);
                                return rc;
                        }
                }
 
-               /* Wait 5 seconds for the response. */
-               if (wait_for_response(ses, midQ, 5 * HZ, 5 * HZ) == 0) {
+               if (wait_for_response(ses->server, midQ) == 0) {
                        /* We got the response - restart system call. */
                        rstart = 1;
                }
        }
 
-       spin_lock(&GlobalMid_Lock);
-       if (midQ->resp_buf) {
-               spin_unlock(&GlobalMid_Lock);
-               receive_len = midQ->resp_buf->smb_buf_length;
-       } else {
-               cERROR(1, "No response for cmd %d mid %d",
-                         midQ->command, midQ->mid);
-               if (midQ->midState == MID_REQUEST_SUBMITTED) {
-                       if (ses->server->tcpStatus == CifsExiting)
-                               rc = -EHOSTDOWN;
-                       else {
-                               ses->server->tcpStatus = CifsNeedReconnect;
-                               midQ->midState = MID_RETRY_NEEDED;
-                       }
-               }
-
-               if (rc != -EHOSTDOWN) {
-                       if (midQ->midState == MID_RETRY_NEEDED) {
-                               rc = -EAGAIN;
-                               cFYI(1, "marking request for retry");
-                       } else {
-                               rc = -EIO;
-                       }
-               }
-               spin_unlock(&GlobalMid_Lock);
-               DeleteMidQEntry(midQ);
+       rc = sync_mid_result(midQ, ses->server);
+       if (rc != 0)
                return rc;
-       }
 
+       receive_len = midQ->resp_buf->smb_buf_length;
        if (receive_len > CIFSMaxBufSize + MAX_CIFS_HDR_SIZE) {
                cERROR(1, "Frame too large received.  Length: %d  Xid: %d",
                        receive_len, xid);
@@ -998,10 +976,10 @@ SendReceiveBlockingLock(const unsigned int xid, struct cifsTconInfo *tcon,
        if (receive_len >= sizeof(struct smb_hdr) - 4
            /* do not count RFC1001 header */  +
            (2 * out_buf->WordCount) + 2 /* bcc */ )
-               BCC(out_buf) = le16_to_cpu(BCC_LE(out_buf));
+               put_bcc(get_bcc_le(out_buf), out_buf);
 
 out:
-       DeleteMidQEntry(midQ);
+       delete_mid(midQ);
        if (rstart && rc == -EACCES)
                return -ERESTARTSYS;
        return rc;
index 9f493ee4dcba79c6c590692a15ea088ff94522b0..2a6bd9a4ae975fdc3eedf9723b551fc9e5f65836 100644 (file)
@@ -176,6 +176,7 @@ static void d_free(struct dentry *dentry)
 
 /**
  * dentry_rcuwalk_barrier - invalidate in-progress rcu-walk lookups
+ * @dentry: the target dentry
  * After this call, in-progress rcu-walk path lookup will fail. This
  * should be called after unhashing, and after changing d_inode (if
  * the dentry has not already been unhashed).
@@ -281,6 +282,7 @@ static void dentry_lru_move_tail(struct dentry *dentry)
 /**
  * d_kill - kill dentry and return parent
  * @dentry: dentry to kill
+ * @parent: parent dentry
  *
  * The dentry must already be unhashed and removed from the LRU.
  *
@@ -1973,7 +1975,7 @@ out:
 /**
  * d_validate - verify dentry provided from insecure source (deprecated)
  * @dentry: The dentry alleged to be valid child of @dparent
- * @parent: The parent dentry (known to be valid)
+ * @dparent: The parent dentry (known to be valid)
  *
  * An insecure source has sent us a dentry, here we verify it and dget() it.
  * This is used by ncpfs in its readdir implementation.
index 85882f6ba5f73c66b614a79ad3594a3dab5dc2b0..b044705eedd4f0836cbcbe5d0f92bf6fb6e39cf7 100644 (file)
@@ -325,12 +325,16 @@ void dio_end_io(struct bio *bio, int error)
 }
 EXPORT_SYMBOL_GPL(dio_end_io);
 
-static int
+static void
 dio_bio_alloc(struct dio *dio, struct block_device *bdev,
                sector_t first_sector, int nr_vecs)
 {
        struct bio *bio;
 
+       /*
+        * bio_alloc() is guaranteed to return a bio when called with
+        * __GFP_WAIT and we request a valid number of vectors.
+        */
        bio = bio_alloc(GFP_KERNEL, nr_vecs);
 
        bio->bi_bdev = bdev;
@@ -342,7 +346,6 @@ dio_bio_alloc(struct dio *dio, struct block_device *bdev,
 
        dio->bio = bio;
        dio->logical_offset_in_bio = dio->cur_page_fs_offset;
-       return 0;
 }
 
 /*
@@ -583,8 +586,9 @@ static int dio_new_bio(struct dio *dio, sector_t start_sector)
                goto out;
        sector = start_sector << (dio->blkbits - 9);
        nr_pages = min(dio->pages_in_io, bio_get_nr_vecs(dio->map_bh.b_bdev));
+       nr_pages = min(nr_pages, BIO_MAX_PAGES);
        BUG_ON(nr_pages <= 0);
-       ret = dio_bio_alloc(dio, dio->map_bh.b_bdev, sector, nr_pages);
+       dio_bio_alloc(dio, dio->map_bh.b_bdev, sector, nr_pages);
        dio->boundary = 0;
 out:
        return ret;
index 7aa767d4f06f4ebcfcc0ee7e23a117e8aa99ee5c..85c8cc8f24732c59c52943b6b8810780c2e94428 100644 (file)
@@ -754,7 +754,7 @@ static int ext3_release_dquot(struct dquot *dquot);
 static int ext3_mark_dquot_dirty(struct dquot *dquot);
 static int ext3_write_info(struct super_block *sb, int type);
 static int ext3_quota_on(struct super_block *sb, int type, int format_id,
-                               char *path);
+                        struct path *path);
 static int ext3_quota_on_mount(struct super_block *sb, int type);
 static ssize_t ext3_quota_read(struct super_block *sb, int type, char *data,
                               size_t len, loff_t off);
@@ -2877,27 +2877,20 @@ static int ext3_quota_on_mount(struct super_block *sb, int type)
  * Standard function to be called on quota_on
  */
 static int ext3_quota_on(struct super_block *sb, int type, int format_id,
-                        char *name)
+                        struct path *path)
 {
        int err;
-       struct path path;
 
        if (!test_opt(sb, QUOTA))
                return -EINVAL;
 
-       err = kern_path(name, LOOKUP_FOLLOW, &path);
-       if (err)
-               return err;
-
        /* Quotafile not on the same filesystem? */
-       if (path.mnt->mnt_sb != sb) {
-               path_put(&path);
+       if (path->mnt->mnt_sb != sb)
                return -EXDEV;
-       }
        /* Journaling quota? */
        if (EXT3_SB(sb)->s_qf_names[type]) {
                /* Quotafile not of fs root? */
-               if (path.dentry->d_parent != sb->s_root)
+               if (path->dentry->d_parent != sb->s_root)
                        ext3_msg(sb, KERN_WARNING,
                                "warning: Quota file not on filesystem root. "
                                "Journaled quota will not work.");
@@ -2907,7 +2900,7 @@ static int ext3_quota_on(struct super_block *sb, int type, int format_id,
         * When we journal data on quota file, we have to flush journal to see
         * all updates to the file when we bypass pagecache...
         */
-       if (ext3_should_journal_data(path.dentry->d_inode)) {
+       if (ext3_should_journal_data(path->dentry->d_inode)) {
                /*
                 * We don't need to lock updates but journal_flush() could
                 * otherwise be livelocked...
@@ -2915,15 +2908,11 @@ static int ext3_quota_on(struct super_block *sb, int type, int format_id,
                journal_lock_updates(EXT3_SB(sb)->s_journal);
                err = journal_flush(EXT3_SB(sb)->s_journal);
                journal_unlock_updates(EXT3_SB(sb)->s_journal);
-               if (err) {
-                       path_put(&path);
+               if (err)
                        return err;
-               }
        }
 
-       err = dquot_quota_on_path(sb, type, format_id, &path);
-       path_put(&path);
-       return err;
+       return dquot_quota_on(sb, type, format_id, path);
 }
 
 /* Read data from quotafile - avoid pagecache and such because we cannot afford
index cb10a06775e48faf6220436624ec952d82340d20..48ce561fafacb8ca92ba2ef978db8736926e1bfc 100644 (file)
@@ -1161,7 +1161,7 @@ static int ext4_release_dquot(struct dquot *dquot);
 static int ext4_mark_dquot_dirty(struct dquot *dquot);
 static int ext4_write_info(struct super_block *sb, int type);
 static int ext4_quota_on(struct super_block *sb, int type, int format_id,
-                               char *path);
+                        struct path *path);
 static int ext4_quota_off(struct super_block *sb, int type);
 static int ext4_quota_on_mount(struct super_block *sb, int type);
 static ssize_t ext4_quota_read(struct super_block *sb, int type, char *data,
@@ -4558,27 +4558,20 @@ static int ext4_quota_on_mount(struct super_block *sb, int type)
  * Standard function to be called on quota_on
  */
 static int ext4_quota_on(struct super_block *sb, int type, int format_id,
-                        char *name)
+                        struct path *path)
 {
        int err;
-       struct path path;
 
        if (!test_opt(sb, QUOTA))
                return -EINVAL;
 
-       err = kern_path(name, LOOKUP_FOLLOW, &path);
-       if (err)
-               return err;
-
        /* Quotafile not on the same filesystem? */
-       if (path.mnt->mnt_sb != sb) {
-               path_put(&path);
+       if (path->mnt->mnt_sb != sb)
                return -EXDEV;
-       }
        /* Journaling quota? */
        if (EXT4_SB(sb)->s_qf_names[type]) {
                /* Quotafile not in fs root? */
-               if (path.dentry->d_parent != sb->s_root)
+               if (path->dentry->d_parent != sb->s_root)
                        ext4_msg(sb, KERN_WARNING,
                                "Quota file not on filesystem root. "
                                "Journaled quota will not work");
@@ -4589,7 +4582,7 @@ static int ext4_quota_on(struct super_block *sb, int type, int format_id,
         * all updates to the file when we bypass pagecache...
         */
        if (EXT4_SB(sb)->s_journal &&
-           ext4_should_journal_data(path.dentry->d_inode)) {
+           ext4_should_journal_data(path->dentry->d_inode)) {
                /*
                 * We don't need to lock updates but journal_flush() could
                 * otherwise be livelocked...
@@ -4597,15 +4590,11 @@ static int ext4_quota_on(struct super_block *sb, int type, int format_id,
                jbd2_journal_lock_updates(EXT4_SB(sb)->s_journal);
                err = jbd2_journal_flush(EXT4_SB(sb)->s_journal);
                jbd2_journal_unlock_updates(EXT4_SB(sb)->s_journal);
-               if (err) {
-                       path_put(&path);
+               if (err)
                        return err;
-               }
        }
 
-       err = dquot_quota_on_path(sb, type, format_id, &path);
-       path_put(&path);
-       return err;
+       return dquot_quota_on(sb, type, format_id, path);
 }
 
 static int ext4_quota_off(struct super_block *sb, int type)
index 2232b3c780bd9678a2e80394b674444ee8401a14..7aa7d4f8984aa3271eac65e268cd4e5e0db05564 100644 (file)
@@ -74,16 +74,14 @@ static struct inode *gfs2_iget(struct super_block *sb, u64 no_addr)
 }
 
 /**
- * GFS2 lookup code fills in vfs inode contents based on info obtained
- * from directory entry inside gfs2_inode_lookup(). This has caused issues
- * with NFS code path since its get_dentry routine doesn't have the relevant
- * directory entry when gfs2_inode_lookup() is invoked. Part of the code
- * segment inside gfs2_inode_lookup code needs to get moved around.
+ * gfs2_set_iop - Sets inode operations
+ * @inode: The inode with correct i_mode filled in
  *
- * Clears I_NEW as well.
- **/
+ * GFS2 lookup code fills in vfs inode contents based on info obtained
+ * from directory entry inside gfs2_inode_lookup().
+ */
 
-void gfs2_set_iop(struct inode *inode)
+static void gfs2_set_iop(struct inode *inode)
 {
        struct gfs2_sbd *sdp = GFS2_SB(inode);
        umode_t mode = inode->i_mode;
@@ -106,8 +104,6 @@ void gfs2_set_iop(struct inode *inode)
                inode->i_op = &gfs2_file_iops;
                init_special_inode(inode, inode->i_mode, inode->i_rdev);
        }
-
-       unlock_new_inode(inode);
 }
 
 /**
@@ -119,10 +115,8 @@ void gfs2_set_iop(struct inode *inode)
  * Returns: A VFS inode, or an error
  */
 
-struct inode *gfs2_inode_lookup(struct super_block *sb,
-                               unsigned int type,
-                               u64 no_addr,
-                               u64 no_formal_ino)
+struct inode *gfs2_inode_lookup(struct super_block *sb, unsigned int type,
+                               u64 no_addr, u64 no_formal_ino)
 {
        struct inode *inode;
        struct gfs2_inode *ip;
@@ -152,51 +146,37 @@ struct inode *gfs2_inode_lookup(struct super_block *sb,
                error = gfs2_glock_nq_init(io_gl, LM_ST_SHARED, GL_EXACT, &ip->i_iopen_gh);
                if (unlikely(error))
                        goto fail_iopen;
-               ip->i_iopen_gh.gh_gl->gl_object = ip;
 
+               ip->i_iopen_gh.gh_gl->gl_object = ip;
                gfs2_glock_put(io_gl);
                io_gl = NULL;
 
-               if ((type == DT_UNKNOWN) && (no_formal_ino == 0))
-                       goto gfs2_nfsbypass;
-
-               inode->i_mode = DT2IF(type);
-
-               /*
-                * We must read the inode in order to work out its type in
-                * this case. Note that this doesn't happen often as we normally
-                * know the type beforehand. This code path only occurs during
-                * unlinked inode recovery (where it is safe to do this glock,
-                * which is not true in the general case).
-                */
                if (type == DT_UNKNOWN) {
-                       struct gfs2_holder gh;
-                       error = gfs2_glock_nq_init(ip->i_gl, LM_ST_EXCLUSIVE, 0, &gh);
-                       if (unlikely(error))
-                               goto fail_glock;
-                       /* Inode is now uptodate */
-                       gfs2_glock_dq_uninit(&gh);
+                       /* Inode glock must be locked already */
+                       error = gfs2_inode_refresh(GFS2_I(inode));
+                       if (error)
+                               goto fail_refresh;
+               } else {
+                       inode->i_mode = DT2IF(type);
                }
 
                gfs2_set_iop(inode);
+               unlock_new_inode(inode);
        }
 
-gfs2_nfsbypass:
        return inode;
-fail_glock:
-       gfs2_glock_dq(&ip->i_iopen_gh);
+
+fail_refresh:
+       ip->i_iopen_gh.gh_gl->gl_object = NULL;
+       gfs2_glock_dq_uninit(&ip->i_iopen_gh);
 fail_iopen:
        if (io_gl)
                gfs2_glock_put(io_gl);
 fail_put:
-       if (inode->i_state & I_NEW)
-               ip->i_gl->gl_object = NULL;
+       ip->i_gl->gl_object = NULL;
        gfs2_glock_put(ip->i_gl);
 fail:
-       if (inode->i_state & I_NEW)
-               iget_failed(inode);
-       else
-               iput(inode);
+       iget_failed(inode);
        return ERR_PTR(error);
 }
 
@@ -221,14 +201,6 @@ struct inode *gfs2_lookup_by_inum(struct gfs2_sbd *sdp, u64 no_addr,
        if (IS_ERR(inode))
                goto fail;
 
-       error = gfs2_inode_refresh(GFS2_I(inode));
-       if (error)
-               goto fail_iput;
-
-       /* Pick up the works we bypass in gfs2_inode_lookup */
-       if (inode->i_state & I_NEW) 
-               gfs2_set_iop(inode);
-
        /* Two extra checks for NFS only */
        if (no_formal_ino) {
                error = -ESTALE;
index 732a183efdb3d183dd43fc05a70ddbdc80df05e6..3e00a66e7cbd04c707ce22686647e5800c7621a4 100644 (file)
@@ -96,7 +96,6 @@ err:
        return -EIO;
 }
 
-extern void gfs2_set_iop(struct inode *inode);
 extern struct inode *gfs2_inode_lookup(struct super_block *sb, unsigned type, 
                                       u64 no_addr, u64 no_formal_ino);
 extern struct inode *gfs2_lookup_by_inum(struct gfs2_sbd *sdp, u64 no_addr,
index 16c2ecac7eb78cec5da5c6ce6dea798fc64ad7b0..ec73ed70bae1afc669b69e1cdbc162d93acec7d8 100644 (file)
@@ -1336,6 +1336,7 @@ static void gfs2_evict_inode(struct inode *inode)
        if (error)
                goto out_truncate;
 
+       ip->i_iopen_gh.gh_flags |= GL_NOCACHE;
        gfs2_glock_dq_wait(&ip->i_iopen_gh);
        gfs2_holder_reinit(LM_ST_EXCLUSIVE, LM_FLAG_TRY_1CB | GL_NOCACHE, &ip->i_iopen_gh);
        error = gfs2_glock_nq(&ip->i_iopen_gh);
index b753192d8c3f15850abaab3cc36d52ff3cd59460..7d77f24d32a98a115e320605369006eeef30ae0d 100644 (file)
@@ -1272,8 +1272,10 @@ done:
        path->mnt = mnt;
        path->dentry = dentry;
        err = follow_managed(path, nd->flags);
-       if (unlikely(err < 0))
+       if (unlikely(err < 0)) {
+               path_put_conditional(path, nd);
                return err;
+       }
        *inode = path->dentry->d_inode;
        return 0;
 
index 06d1f749ca8945264aded7f21c1c2b35285d52df..38f986d2447ea9ba0c7a657b0500c421bf2abbaa 100644 (file)
@@ -993,8 +993,7 @@ static void ocfs2_disable_quotas(struct ocfs2_super *osb)
 }
 
 /* Handle quota on quotactl */
-static int ocfs2_quota_on(struct super_block *sb, int type, int format_id,
-                         char *path)
+static int ocfs2_quota_on(struct super_block *sb, int type, int format_id)
 {
        unsigned int feature[MAXQUOTAS] = { OCFS2_FEATURE_RO_COMPAT_USRQUOTA,
                                             OCFS2_FEATURE_RO_COMPAT_GRPQUOTA};
@@ -1013,7 +1012,7 @@ static int ocfs2_quota_off(struct super_block *sb, int type)
 }
 
 static const struct quotactl_ops ocfs2_quotactl_ops = {
-       .quota_on       = ocfs2_quota_on,
+       .quota_on_meta  = ocfs2_quota_on,
        .quota_off      = ocfs2_quota_off,
        .quota_sync     = dquot_quota_sync,
        .get_info       = dquot_get_dqinfo,
index 89e9e19b1b2eef328ddc36714be0db771e49bcc9..da42f7db50de42640a7fa56df21e21bbb48cf588 100644 (file)
--- a/fs/pipe.c
+++ b/fs/pipe.c
@@ -441,7 +441,7 @@ redo:
                        break;
                }
                if (do_wakeup) {
-                       wake_up_interruptible_sync_poll(&pipe->wait, POLLOUT);
+                       wake_up_interruptible_sync_poll(&pipe->wait, POLLOUT | POLLWRNORM);
                        kill_fasync(&pipe->fasync_writers, SIGIO, POLL_OUT);
                }
                pipe_wait(pipe);
@@ -450,7 +450,7 @@ redo:
 
        /* Signal writers asynchronously that there is more room. */
        if (do_wakeup) {
-               wake_up_interruptible_sync_poll(&pipe->wait, POLLOUT);
+               wake_up_interruptible_sync_poll(&pipe->wait, POLLOUT | POLLWRNORM);
                kill_fasync(&pipe->fasync_writers, SIGIO, POLL_OUT);
        }
        if (ret > 0)
@@ -612,7 +612,7 @@ redo2:
                        break;
                }
                if (do_wakeup) {
-                       wake_up_interruptible_sync_poll(&pipe->wait, POLLIN);
+                       wake_up_interruptible_sync_poll(&pipe->wait, POLLIN | POLLRDNORM);
                        kill_fasync(&pipe->fasync_readers, SIGIO, POLL_IN);
                        do_wakeup = 0;
                }
@@ -623,7 +623,7 @@ redo2:
 out:
        mutex_unlock(&inode->i_mutex);
        if (do_wakeup) {
-               wake_up_interruptible_sync_poll(&pipe->wait, POLLIN);
+               wake_up_interruptible_sync_poll(&pipe->wait, POLLIN | POLLRDNORM);
                kill_fasync(&pipe->fasync_readers, SIGIO, POLL_IN);
        }
        if (ret > 0)
@@ -715,7 +715,7 @@ pipe_release(struct inode *inode, int decr, int decw)
        if (!pipe->readers && !pipe->writers) {
                free_pipe_info(inode);
        } else {
-               wake_up_interruptible_sync_poll(&pipe->wait, POLLIN | POLLOUT);
+               wake_up_interruptible_sync_poll(&pipe->wait, POLLIN | POLLOUT | POLLRDNORM | POLLWRNORM | POLLERR | POLLHUP);
                kill_fasync(&pipe->fasync_readers, SIGIO, POLL_IN);
                kill_fasync(&pipe->fasync_writers, SIGIO, POLL_OUT);
        }
index 6a0068841d96c00ef3b1bbc38182bf1db9b54f17..15af6222f8a4fb465251dd97610460a9bc79639e 100644 (file)
@@ -1,5 +1,5 @@
 config PROC_FS
-       bool "/proc file system support" if EMBEDDED
+       bool "/proc file system support" if EXPERT
        default y
        help
          This is a virtual file system providing information about the status
@@ -40,7 +40,7 @@ config PROC_VMCORE
         Exports the dump image of crashed kernel in ELF format.
 
 config PROC_SYSCTL
-       bool "Sysctl support (/proc/sys)" if EMBEDDED
+       bool "Sysctl support (/proc/sys)" if EXPERT
        depends on PROC_FS
        select SYSCTL
        default y
@@ -61,7 +61,7 @@ config PROC_SYSCTL
 config PROC_PAGE_MONITOR
        default y
        depends on PROC_FS && MMU
-       bool "Enable /proc page monitoring" if EMBEDDED
+       bool "Enable /proc page monitoring" if EXPERT
        help
          Various /proc files exist to monitor process memory utilization:
          /proc/pid/smaps, /proc/pid/clear_refs, /proc/pid/pagemap,
index 84becd3e477257c7ab790bcb973b5e9accdd1e28..a2a622e079f08f55c5dfe2a8b40c8b8c59a04db5 100644 (file)
@@ -2189,8 +2189,8 @@ int dquot_resume(struct super_block *sb, int type)
 }
 EXPORT_SYMBOL(dquot_resume);
 
-int dquot_quota_on_path(struct super_block *sb, int type, int format_id,
-                     struct path *path)
+int dquot_quota_on(struct super_block *sb, int type, int format_id,
+                  struct path *path)
 {
        int error = security_quota_on(path->dentry);
        if (error)
@@ -2204,20 +2204,6 @@ int dquot_quota_on_path(struct super_block *sb, int type, int format_id,
                                             DQUOT_LIMITS_ENABLED);
        return error;
 }
-EXPORT_SYMBOL(dquot_quota_on_path);
-
-int dquot_quota_on(struct super_block *sb, int type, int format_id, char *name)
-{
-       struct path path;
-       int error;
-
-       error = kern_path(name, LOOKUP_FOLLOW, &path);
-       if (!error) {
-               error = dquot_quota_on_path(sb, type, format_id, &path);
-               path_put(&path);
-       }
-       return error;
-}
 EXPORT_SYMBOL(dquot_quota_on);
 
 /*
index b299961e1edbb8ef4dd16d28ccfd5c7cba2bfa28..b34bdb25490c8956b4733c29771bea3109ec2fcf 100644 (file)
@@ -64,18 +64,15 @@ static int quota_sync_all(int type)
 }
 
 static int quota_quotaon(struct super_block *sb, int type, int cmd, qid_t id,
-                        void __user *addr)
+                        struct path *path)
 {
-       char *pathname;
-       int ret = -ENOSYS;
-
-       pathname = getname(addr);
-       if (IS_ERR(pathname))
-               return PTR_ERR(pathname);
-       if (sb->s_qcop->quota_on)
-               ret = sb->s_qcop->quota_on(sb, type, id, pathname);
-       putname(pathname);
-       return ret;
+       if (!sb->s_qcop->quota_on && !sb->s_qcop->quota_on_meta)
+               return -ENOSYS;
+       if (sb->s_qcop->quota_on_meta)
+               return sb->s_qcop->quota_on_meta(sb, type, id);
+       if (IS_ERR(path))
+               return PTR_ERR(path);
+       return sb->s_qcop->quota_on(sb, type, id, path);
 }
 
 static int quota_getfmt(struct super_block *sb, int type, void __user *addr)
@@ -241,7 +238,7 @@ static int quota_getxquota(struct super_block *sb, int type, qid_t id,
 
 /* Copy parameters and call proper function */
 static int do_quotactl(struct super_block *sb, int type, int cmd, qid_t id,
-                      void __user *addr)
+                      void __user *addr, struct path *path)
 {
        int ret;
 
@@ -256,7 +253,7 @@ static int do_quotactl(struct super_block *sb, int type, int cmd, qid_t id,
 
        switch (cmd) {
        case Q_QUOTAON:
-               return quota_quotaon(sb, type, cmd, id, addr);
+               return quota_quotaon(sb, type, cmd, id, path);
        case Q_QUOTAOFF:
                if (!sb->s_qcop->quota_off)
                        return -ENOSYS;
@@ -335,6 +332,7 @@ SYSCALL_DEFINE4(quotactl, unsigned int, cmd, const char __user *, special,
 {
        uint cmds, type;
        struct super_block *sb = NULL;
+       struct path path, *pathp = NULL;
        int ret;
 
        cmds = cmd >> SUBCMDSHIFT;
@@ -351,12 +349,27 @@ SYSCALL_DEFINE4(quotactl, unsigned int, cmd, const char __user *, special,
                return -ENODEV;
        }
 
+       /*
+        * Path for quotaon has to be resolved before grabbing superblock
+        * because that gets s_umount sem which is also possibly needed by path
+        * resolution (think about autofs) and thus deadlocks could arise.
+        */
+       if (cmds == Q_QUOTAON) {
+               ret = user_path_at(AT_FDCWD, addr, LOOKUP_FOLLOW, &path);
+               if (ret)
+                       pathp = ERR_PTR(ret);
+               else
+                       pathp = &path;
+       }
+
        sb = quotactl_block(special);
        if (IS_ERR(sb))
                return PTR_ERR(sb);
 
-       ret = do_quotactl(sb, type, cmds, id, addr);
+       ret = do_quotactl(sb, type, cmds, id, addr, pathp);
 
        drop_super(sb);
+       if (pathp && !IS_ERR(pathp))
+               path_put(pathp);
        return ret;
 }
index 2575682a9eada129675ca642ae24b1dbf46c0eaa..0aab04f46827def240b7d5468de229e91a9770f5 100644 (file)
@@ -632,7 +632,7 @@ static int reiserfs_acquire_dquot(struct dquot *);
 static int reiserfs_release_dquot(struct dquot *);
 static int reiserfs_mark_dquot_dirty(struct dquot *);
 static int reiserfs_write_info(struct super_block *, int);
-static int reiserfs_quota_on(struct super_block *, int, int, char *);
+static int reiserfs_quota_on(struct super_block *, int, int, struct path *);
 
 static const struct dquot_operations reiserfs_quota_operations = {
        .write_dquot = reiserfs_write_dquot,
@@ -2048,25 +2048,21 @@ static int reiserfs_quota_on_mount(struct super_block *sb, int type)
  * Standard function to be called on quota_on
  */
 static int reiserfs_quota_on(struct super_block *sb, int type, int format_id,
-                            char *name)
+                            struct path *path)
 {
        int err;
-       struct path path;
        struct inode *inode;
        struct reiserfs_transaction_handle th;
 
        if (!(REISERFS_SB(sb)->s_mount_opt & (1 << REISERFS_QUOTA)))
                return -EINVAL;
 
-       err = kern_path(name, LOOKUP_FOLLOW, &path);
-       if (err)
-               return err;
        /* Quotafile not on the same filesystem? */
-       if (path.mnt->mnt_sb != sb) {
+       if (path->mnt->mnt_sb != sb) {
                err = -EXDEV;
                goto out;
        }
-       inode = path.dentry->d_inode;
+       inode = path->dentry->d_inode;
        /* We must not pack tails for quota files on reiserfs for quota IO to work */
        if (!(REISERFS_I(inode)->i_flags & i_nopack_mask)) {
                err = reiserfs_unpack(inode, NULL);
@@ -2082,7 +2078,7 @@ static int reiserfs_quota_on(struct super_block *sb, int type, int format_id,
        /* Journaling quota? */
        if (REISERFS_SB(sb)->s_qf_names[type]) {
                /* Quotafile not of fs root? */
-               if (path.dentry->d_parent != sb->s_root)
+               if (path->dentry->d_parent != sb->s_root)
                        reiserfs_warning(sb, "super-6521",
                                 "Quota file not on filesystem root. "
                                 "Journalled quota will not work.");
@@ -2101,9 +2097,8 @@ static int reiserfs_quota_on(struct super_block *sb, int type, int format_id,
                if (err)
                        goto out;
        }
-       err = dquot_quota_on_path(sb, type, format_id, &path);
+       err = dquot_quota_on(sb, type, format_id, path);
 out:
-       path_put(&path);
        return err;
 }
 
index f4b67588b9d69217d980f663b30b875e91249268..8c41feacbac56fade7f81f59444b50b3c00630d7 100644 (file)
@@ -1,5 +1,5 @@
 config SYSFS
-       bool "sysfs file system support" if EMBEDDED
+       bool "sysfs file system support" if EXPERT
        default y
        help
        The sysfs filesystem is a virtual filesystem that the kernel uses to
index 17714beb868ef5d17f57fc25323fea915e894ffc..5b6c391efc8e658adba3eac683f46ea3938495ab 100644 (file)
@@ -5,7 +5,7 @@
  *****************************************************************************/
 
 /*
- * Copyright (C) 2000 - 2010, Intel Corp.
+ * Copyright (C) 2000 - 2011, Intel Corp.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
index 9cf736ea4691b6c0ac206789f30f73f3ab6dd3ac..fc1575fd4596e484c0fc44c7614e6decb5e8c6b6 100644 (file)
@@ -5,7 +5,7 @@
  *****************************************************************************/
 
 /*
- * Copyright (C) 2000 - 2010, Intel Corp.
+ * Copyright (C) 2000 - 2011, Intel Corp.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
index bc4a6deb73b0317ff06785b0b7770327ab437c21..ef1cef77d32ba0687491bdbb5852d32fe40075c8 100644 (file)
@@ -5,7 +5,7 @@
  *****************************************************************************/
 
 /*
- * Copyright (C) 2000 - 2010, Intel Corp.
+ * Copyright (C) 2000 - 2011, Intel Corp.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
index a091cabca4b1266f1c3cbdaac7d44f2a4c81be4c..de39915f6b7fb389e8cf2c8b7be73184e1fa8db5 100644 (file)
@@ -5,7 +5,7 @@
  *****************************************************************************/
 
 /*
- * Copyright (C) 2000 - 2010, Intel Corp.
+ * Copyright (C) 2000 - 2011, Intel Corp.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
index 65b3f5888f42749510f4d51f7d9a0bed43e770bf..a3252a5ead669d360c37c1403c1fa0de9945a50d 100644 (file)
@@ -8,7 +8,7 @@
  *****************************************************************************/
 
 /*
- * Copyright (C) 2000 - 2010, Intel Corp.
+ * Copyright (C) 2000 - 2011, Intel Corp.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
index 241b8a04c83c83b5dfb082eed7b696c05b4e2840..e46ec95a8adac68abf713952066a5be8bc59c293 100644 (file)
@@ -6,7 +6,7 @@
  *****************************************************************************/
 
 /*
- * Copyright (C) 2000 - 2010, Intel Corp.
+ * Copyright (C) 2000 - 2011, Intel Corp.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -47,7 +47,7 @@
 
 /* Current ACPICA subsystem version in YYYYMMDD format */
 
-#define ACPI_CA_VERSION                 0x20101209
+#define ACPI_CA_VERSION                 0x20110112
 
 #include "actypes.h"
 #include "actbl.h"
index e5526354ba5eab0142eb58159fa862e18d11cd13..0a66cc45dd6b79a0fdb17be3368b87cdd1c646f5 100644 (file)
@@ -5,7 +5,7 @@
  *****************************************************************************/
 
 /*
- * Copyright (C) 2000 - 2010, Intel Corp.
+ * Copyright (C) 2000 - 2011, Intel Corp.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
index ad2001683ba7385d50c875eda327c4ac41894c48..7e42bfee0e296a4dee55fc8de24e6caebfd1526d 100644 (file)
@@ -5,7 +5,7 @@
  *****************************************************************************/
 
 /*
- * Copyright (C) 2000 - 2010, Intel Corp.
+ * Copyright (C) 2000 - 2011, Intel Corp.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
index cd77aa75c9623eec7edb38499969f437cc613ef4..7504bc99b29b7359f9ec503a6c0def183c98c2c9 100644 (file)
@@ -5,7 +5,7 @@
  *****************************************************************************/
 
 /*
- * Copyright (C) 2000 - 2010, Intel Corp.
+ * Copyright (C) 2000 - 2011, Intel Corp.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
index d4136b28011fd692c4ffb45c78adcc8170e20a4b..0fc15dfb2e22c2bdeef92428960028d3efcc6540 100644 (file)
@@ -5,7 +5,7 @@
  *****************************************************************************/
 
 /*
- * Copyright (C) 2000 - 2010, Intel Corp.
+ * Copyright (C) 2000 - 2011, Intel Corp.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
index 939a431a6ab61b34bd1809964da9484e5e2a382b..64f838beaabffdeead528c4aaf2c4240fb9e9701 100644 (file)
@@ -5,7 +5,7 @@
  *****************************************************************************/
 
 /*
- * Copyright (C) 2000 - 2010, Intel Corp.
+ * Copyright (C) 2000 - 2011, Intel Corp.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
index a3e334ab11191aeb596b93cfc28a7c4dcef85d4d..5af3ed52ef980d9c09e9ceff7221341108cfa2db 100644 (file)
@@ -5,7 +5,7 @@
  *****************************************************************************/
 
 /*
- * Copyright (C) 2000 - 2010, Intel Corp.
+ * Copyright (C) 2000 - 2011, Intel Corp.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
index 5dcb9537343c7a91d82317dd4e50aa7d385149f5..e228893591a95c09905a0728b49c8088496110a4 100644 (file)
@@ -5,7 +5,7 @@
  *****************************************************************************/
 
 /*
- * Copyright (C) 2000 - 2010, Intel Corp.
+ * Copyright (C) 2000 - 2011, Intel Corp.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
index 572189e37133d697db734ff2d8e10c1707917463..5d2a5e9544d9d4743202852cde379a60fb2f7600 100644 (file)
@@ -5,7 +5,7 @@
  *****************************************************************************/
 
 /*
- * Copyright (C) 2000 - 2010, Intel Corp.
+ * Copyright (C) 2000 - 2011, Intel Corp.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
index 68649336c4adf98618ff4d4fd8d9f1d6b2867062..6ebb81030d2d109ce9f99069b130c29a39ccfa11 100644 (file)
                VMLINUX_SYMBOL(__start___param) = .;                    \
                *(__param)                                              \
                VMLINUX_SYMBOL(__stop___param) = .;                     \
+       }                                                               \
+                                                                       \
+       /* Built-in module versions. */                                 \
+       __modver : AT(ADDR(__modver) - LOAD_OFFSET) {                   \
+               VMLINUX_SYMBOL(__start___modver) = .;                   \
+               *(__modver)                                             \
+               VMLINUX_SYMBOL(__stop___modver) = .;                    \
                . = ALIGN((align));                                     \
                VMLINUX_SYMBOL(__end_rodata) = .;                       \
        }                                                               \
index eb176bb1b15b722f8c1f78b1650f38302e85a60f..a2e910e01293a01fd229cd59dfb1c1bb69f7be1a 100644 (file)
@@ -306,9 +306,6 @@ extern acpi_status acpi_pci_osc_control_set(acpi_handle handle,
                                             u32 *mask, u32 req);
 extern void acpi_early_init(void);
 
-int acpi_os_map_generic_address(struct acpi_generic_address *addr);
-void acpi_os_unmap_generic_address(struct acpi_generic_address *addr);
-
 #else  /* !CONFIG_ACPI */
 
 #define acpi_disabled 1
diff --git a/include/linux/acpi_io.h b/include/linux/acpi_io.h
new file mode 100644 (file)
index 0000000..7180013
--- /dev/null
@@ -0,0 +1,16 @@
+#ifndef _ACPI_IO_H_
+#define _ACPI_IO_H_
+
+#include <linux/io.h>
+#include <acpi/acpi.h>
+
+static inline void __iomem *acpi_os_ioremap(acpi_physical_address phys,
+                                           acpi_size size)
+{
+       return ioremap_cache(phys, size);
+}
+
+int acpi_os_map_generic_address(struct acpi_generic_address *addr);
+void acpi_os_unmap_generic_address(struct acpi_generic_address *addr);
+
+#endif
index a3b148a918740c509494b44cf2fda690d3261f96..0b84c61607e8ce808dbb6b2e611a01a6ade11646 100644 (file)
@@ -249,7 +249,7 @@ static inline enum zone_type gfp_zone(gfp_t flags)
                                         ((1 << ZONES_SHIFT) - 1);
 
        if (__builtin_constant_p(bit))
-               MAYBE_BUILD_BUG_ON((GFP_ZONE_BAD >> bit) & 1);
+               BUILD_BUG_ON((GFP_ZONE_BAD >> bit) & 1);
        else {
 #ifdef CONFIG_DEBUG_VM
                BUG_ON((GFP_ZONE_BAD >> bit) & 1);
index 6042228954a74657422718a5799bd8877bab3558..294169e31364727edd70f699c821c0430d612649 100644 (file)
@@ -959,7 +959,7 @@ struct ieee80211_ht_info {
 /* block-ack parameters */
 #define IEEE80211_ADDBA_PARAM_POLICY_MASK 0x0002
 #define IEEE80211_ADDBA_PARAM_TID_MASK 0x003C
-#define IEEE80211_ADDBA_PARAM_BUF_SIZE_MASK 0xFFA0
+#define IEEE80211_ADDBA_PARAM_BUF_SIZE_MASK 0xFFC0
 #define IEEE80211_DELBA_PARAM_TID_MASK 0xF000
 #define IEEE80211_DELBA_PARAM_INITIATOR_MASK 0x0800
 
index 6a64c6fa81affacd4761f47156f6fb1666ddf112..c1a95b7b58de736f228cfeef9bfe1f118e02bf29 100644 (file)
@@ -100,13 +100,6 @@ static inline struct irq_desc *move_irq_desc(struct irq_desc *desc, int node)
 #define get_irq_desc_data(desc)                ((desc)->irq_data.handler_data)
 #define get_irq_desc_msi(desc)         ((desc)->irq_data.msi_desc)
 
-/*
- * Monolithic do_IRQ implementation.
- */
-#ifndef CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ
-extern unsigned int __do_IRQ(unsigned int irq);
-#endif
-
 /*
  * Architectures call this to let the generic IRQ layer
  * handle an interrupt. If the descriptor is attached to an
@@ -115,14 +108,7 @@ extern unsigned int __do_IRQ(unsigned int irq);
  */
 static inline void generic_handle_irq_desc(unsigned int irq, struct irq_desc *desc)
 {
-#ifdef CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ
        desc->handle_irq(irq, desc);
-#else
-       if (likely(desc->handle_irq))
-               desc->handle_irq(irq, desc);
-       else
-               __do_IRQ(irq);
-#endif
 }
 
 static inline void generic_handle_irq(unsigned int irq)
index 5a9d9059520b9fd36fb4049bef4e673a18a9cdd1..e2f4d6af2125436026e016a1f7cd82201f6264fd 100644 (file)
@@ -243,6 +243,8 @@ extern int test_taint(unsigned flag);
 extern unsigned long get_taint(void);
 extern int root_mountflags;
 
+extern bool early_boot_irqs_disabled;
+
 /* Values used for system_state */
 extern enum system_states {
        SYSTEM_BOOTING,
@@ -573,12 +575,6 @@ struct sysinfo {
        char _f[20-2*sizeof(long)-sizeof(int)]; /* Padding: libc5 uses this.. */
 };
 
-/* Force a compilation error if condition is true */
-#define BUILD_BUG_ON(condition) ((void)BUILD_BUG_ON_ZERO(condition))
-
-/* Force a compilation error if condition is constant and true */
-#define MAYBE_BUILD_BUG_ON(cond) ((void)sizeof(char[1 - 2 * !!(cond)]))
-
 /* Force a compilation error if a constant expression is not a power of 2 */
 #define BUILD_BUG_ON_NOT_POWER_OF_2(n)                 \
        BUILD_BUG_ON((n) == 0 || (((n) & ((n) - 1)) != 0))
@@ -590,6 +586,32 @@ struct sysinfo {
 #define BUILD_BUG_ON_ZERO(e) (sizeof(struct { int:-!!(e); }))
 #define BUILD_BUG_ON_NULL(e) ((void *)sizeof(struct { int:-!!(e); }))
 
+/**
+ * BUILD_BUG_ON - break compile if a condition is true.
+ * @cond: the condition which the compiler should know is false.
+ *
+ * If you have some code which relies on certain constants being equal, or
+ * other compile-time-evaluated condition, you should use BUILD_BUG_ON to
+ * detect if someone changes it.
+ *
+ * The implementation uses gcc's reluctance to create a negative array, but
+ * gcc (as of 4.4) only emits that error for obvious cases (eg. not arguments
+ * to inline functions).  So as a fallback we use the optimizer; if it can't
+ * prove the condition is false, it will cause a link error on the undefined
+ * "__build_bug_on_failed".  This error message can be harder to track down
+ * though, hence the two different methods.
+ */
+#ifndef __OPTIMIZE__
+#define BUILD_BUG_ON(condition) ((void)sizeof(char[1 - 2*!!(condition)]))
+#else
+extern int __build_bug_on_failed;
+#define BUILD_BUG_ON(condition)                                        \
+       do {                                                    \
+               ((void)sizeof(char[1 - 2*!!(condition)]));      \
+               if (condition) __build_bug_on_failed = 1;       \
+       } while(0)
+#endif
+
 /* Trap pasters of __FUNCTION__ at compile-time */
 #define __FUNCTION__ (__func__)
 
index 08d7dc4ddf40b57047d1f1304be6b02dac2f2063..39f8453239f779edcd0e5dedfc2d293b34bf7b60 100644 (file)
@@ -76,7 +76,7 @@ bool kmemcheck_is_obj_initialized(unsigned long addr, size_t size);
                                                                        \
                _n = (long) &((ptr)->name##_end)                        \
                        - (long) &((ptr)->name##_begin);                \
-               MAYBE_BUILD_BUG_ON(_n < 0);                             \
+               BUILD_BUG_ON(_n < 0);                                   \
                                                                        \
                kmemcheck_mark_initialized(&((ptr)->name##_begin), _n); \
        } while (0)
index 71c09b26c7592ff4a1f6351fd226c9442ef66e5d..4aef1dda64065e90bd846cd553b3c26fc93c594e 100644 (file)
@@ -436,16 +436,8 @@ do {                                                               \
 #endif /* CONFIG_LOCKDEP */
 
 #ifdef CONFIG_TRACE_IRQFLAGS
-extern void early_boot_irqs_off(void);
-extern void early_boot_irqs_on(void);
 extern void print_irqtrace_events(struct task_struct *curr);
 #else
-static inline void early_boot_irqs_off(void)
-{
-}
-static inline void early_boot_irqs_on(void)
-{
-}
 static inline void print_irqtrace_events(struct task_struct *curr)
 {
 }
@@ -522,12 +514,15 @@ static inline void print_irqtrace_events(struct task_struct *curr)
 #ifdef CONFIG_DEBUG_LOCK_ALLOC
 # ifdef CONFIG_PROVE_LOCKING
 #  define lock_map_acquire(l)          lock_acquire(l, 0, 0, 0, 2, NULL, _THIS_IP_)
+#  define lock_map_acquire_read(l)     lock_acquire(l, 0, 0, 2, 2, NULL, _THIS_IP_)
 # else
 #  define lock_map_acquire(l)          lock_acquire(l, 0, 0, 0, 1, NULL, _THIS_IP_)
+#  define lock_map_acquire_read(l)     lock_acquire(l, 0, 0, 2, 1, NULL, _THIS_IP_)
 # endif
 # define lock_map_release(l)                   lock_release(l, 1, _THIS_IP_)
 #else
 # define lock_map_acquire(l)                   do { } while (0)
+# define lock_map_acquire_read(l)              do { } while (0)
 # define lock_map_release(l)                   do { } while (0)
 #endif
 
index 6a576f989437115eff8840a234b6057471a96a50..f512e189be5a496b2aa1b555c1fd34e056fc81e6 100644 (file)
@@ -146,6 +146,10 @@ unsigned long mem_cgroup_soft_limit_reclaim(struct zone *zone, int order,
                                                gfp_t gfp_mask);
 u64 mem_cgroup_get_limit(struct mem_cgroup *mem);
 
+#ifdef CONFIG_TRANSPARENT_HUGEPAGE
+void mem_cgroup_split_huge_fixup(struct page *head, struct page *tail);
+#endif
+
 #else /* CONFIG_CGROUP_MEM_RES_CTLR */
 struct mem_cgroup;
 
@@ -335,6 +339,11 @@ u64 mem_cgroup_get_limit(struct mem_cgroup *mem)
        return 0;
 }
 
+static inline void mem_cgroup_split_huge_fixup(struct page *head,
+                                               struct page *tail)
+{
+}
+
 #endif /* CONFIG_CGROUP_MEM_CONT */
 
 #endif /* _LINUX_MEMCONTROL_H */
index 956a35532f47012d38712dbd64f2a12e5ddbd6d7..f6385fc17ad46a6137bb7fdd387f8f81bb91e492 100644 (file)
@@ -470,6 +470,7 @@ static inline void set_compound_order(struct page *page, unsigned long order)
        page[1].lru.prev = (void *)order;
 }
 
+#ifdef CONFIG_MMU
 /*
  * Do pte_mkwrite, but only if the vma says VM_WRITE.  We do this when
  * servicing faults for write access.  In the normal case, do always want
@@ -482,6 +483,7 @@ static inline pte_t maybe_mkwrite(pte_t pte, struct vm_area_struct *vma)
                pte = pte_mkwrite(pte);
        return pte;
 }
+#endif
 
 /*
  * Multiple processes may "see" the same page. E.g. for untouched
index 8b17fd8c790d8601f8aff0a33c7b909984e30545..e7c6385c668394240e237f16a92286d2f32aed5e 100644 (file)
@@ -58,6 +58,12 @@ struct module_attribute {
        void (*free)(struct module *);
 };
 
+struct module_version_attribute {
+       struct module_attribute mattr;
+       const char *module_name;
+       const char *version;
+};
+
 struct module_kobject
 {
        struct kobject kobj;
@@ -161,7 +167,28 @@ extern struct module __this_module;
   Using this automatically adds a checksum of the .c files and the
   local headers in "srcversion".
 */
+
+#if defined(MODULE) || !defined(CONFIG_SYSFS)
 #define MODULE_VERSION(_version) MODULE_INFO(version, _version)
+#else
+#define MODULE_VERSION(_version)                                       \
+       extern ssize_t __modver_version_show(struct module_attribute *, \
+                                            struct module *, char *);  \
+       static struct module_version_attribute __modver_version_attr    \
+       __used                                                          \
+    __attribute__ ((__section__ ("__modver"),aligned(sizeof(void *)))) \
+       = {                                                             \
+               .mattr  = {                                             \
+                       .attr   = {                                     \
+                               .name   = "version",                    \
+                               .mode   = S_IRUGO,                      \
+                       },                                              \
+                       .show   = __modver_version_show,                \
+               },                                                      \
+               .module_name    = KBUILD_MODNAME,                       \
+               .version        = _version,                             \
+       }
+#endif
 
 /* Optional firmware file (or files) needed by the module
  * format is simply firmware file name.  Multiple firmware
index 112adf8bd47dd2c1d13800577f340d6cfa9c0b46..07b41951e3fa9eb7894032a4921cdd65a05c05bd 100644 (file)
 /* Chosen so that structs with an unsigned long line up. */
 #define MAX_PARAM_PREFIX_LEN (64 - sizeof(unsigned long))
 
-#ifdef MODULE
 #define ___module_cat(a,b) __mod_ ## a ## b
 #define __module_cat(a,b) ___module_cat(a,b)
+#ifdef MODULE
 #define __MODULE_INFO(tag, name, info)                                   \
 static const char __module_cat(name,__LINE__)[]                                  \
   __used __attribute__((section(".modinfo"), unused, aligned(1)))        \
   = __stringify(tag) "=" info
 #else  /* !MODULE */
-#define __MODULE_INFO(tag, name, info)
+/* This struct is here for syntactic coherency, it is not used */
+#define __MODULE_INFO(tag, name, info)                                   \
+  struct __module_cat(name,__LINE__) {}
 #endif
 #define __MODULE_PARM_TYPE(name, _type)                                          \
   __MODULE_INFO(parmtype, name##type, #name ":" _type)
index 94c1f03b50eb959302044572fecb1872295ba116..9a85412e0db6a4015388bc4ebb2c5466e6b55db0 100644 (file)
@@ -322,9 +322,12 @@ struct dquot_operations {
        qsize_t *(*get_reserved_space) (struct inode *);
 };
 
+struct path;
+
 /* Operations handling requests from userspace */
 struct quotactl_ops {
-       int (*quota_on)(struct super_block *, int, int, char *);
+       int (*quota_on)(struct super_block *, int, int, struct path *);
+       int (*quota_on_meta)(struct super_block *, int, int);
        int (*quota_off)(struct super_block *, int);
        int (*quota_sync)(struct super_block *, int, int);
        int (*get_info)(struct super_block *, int, struct if_dqinfo *);
index 223b14cd129cfc324b9e9bdcdb4b609666bb639d..eb354f6f26b333d078adb645a0488ae279935d13 100644 (file)
@@ -76,11 +76,9 @@ int dquot_mark_dquot_dirty(struct dquot *dquot);
 
 int dquot_file_open(struct inode *inode, struct file *file);
 
-int dquot_quota_on(struct super_block *sb, int type, int format_id,
-       char *path);
 int dquot_enable(struct inode *inode, int type, int format_id,
        unsigned int flags);
-int dquot_quota_on_path(struct super_block *sb, int type, int format_id,
+int dquot_quota_on(struct super_block *sb, int type, int format_id,
        struct path *path);
 int dquot_quota_on_mount(struct super_block *sb, char *qf_name,
        int format_id, int type);
index 0093dd7c1d6f0eaf810001851902444269e82f44..800617b4ddd56c3dd0a790f97a4c73f2fa38de64 100644 (file)
@@ -109,7 +109,10 @@ static inline bool virtio_has_feature(const struct virtio_device *vdev,
                                      unsigned int fbit)
 {
        /* Did you forget to fix assumptions on max features? */
-       MAYBE_BUILD_BUG_ON(fbit >= 32);
+       if (__builtin_constant_p(fbit))
+               BUILD_BUG_ON(fbit >= 32);
+       else
+               BUG_ON(fbit >= 32);
 
        if (fbit < VIRTIO_TRANSPORT_F_START)
                virtio_check_driver_offered_feature(vdev, fbit);
diff --git a/include/media/mt9v011.h b/include/media/mt9v011.h
new file mode 100644 (file)
index 0000000..ea29fc7
--- /dev/null
@@ -0,0 +1,17 @@
+/* mt9v011 sensor
+ *
+ * Copyright (C) 2011 Hans Verkuil <hverkuil@xs4all.nl>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+
+#ifndef __MT9V011_H__
+#define __MT9V011_H__
+
+struct mt9v011_platform_data {
+       unsigned xtal;  /* Hz */
+};
+
+#endif
index a23c1fc685a1e3426c2ba6b578d7158621fcf917..2963263f31e213d785d6e17cee3c0863c1e9a201 100644 (file)
@@ -183,6 +183,9 @@ static inline void init_ir_raw_event(struct ir_raw_event *ev)
 }
 
 #define IR_MAX_DURATION         0xFFFFFFFF      /* a bit more than 4 seconds */
+#define US_TO_NS(usec)         ((usec) * 1000)
+#define MS_TO_US(msec)         ((msec) * 1000)
+#define MS_TO_NS(msec)         ((msec) * 1000 * 1000)
 
 void ir_raw_event_handle(struct rc_dev *dev);
 int ir_raw_event_store(struct rc_dev *dev, struct ir_raw_event *ev);
index ac7ce00f39cff70a1fdd70e9b32dfb4c4a62c46f..79827143d5acd925510f3ad7a4de2f912c49ff48 100644 (file)
@@ -115,7 +115,7 @@ struct saa7146_dev
 
        /* different device locks */
        spinlock_t                      slock;
-       struct mutex                    lock;
+       struct mutex                    v4l2_lock;
 
        unsigned char                   __iomem *mem;           /* pointer to mapped IO memory */
        u32                             revision;       /* chip revision; needed for bug-workarounds*/
index 2d65b35cdab21e6f18718bf4c674ae1b585fb020..a659319e858257d0bfe2c736f8a97fb2b4fcdcb8 100644 (file)
@@ -138,21 +138,10 @@ struct v4l2_subdev_ops;
 
 /* Load an i2c module and return an initialized v4l2_subdev struct.
    The client_type argument is the name of the chip that's on the adapter. */
-struct v4l2_subdev *v4l2_i2c_new_subdev_cfg(struct v4l2_device *v4l2_dev,
+struct v4l2_subdev *v4l2_i2c_new_subdev(struct v4l2_device *v4l2_dev,
                struct i2c_adapter *adapter, const char *client_type,
-               int irq, void *platform_data,
                u8 addr, const unsigned short *probe_addrs);
 
-/* Load an i2c module and return an initialized v4l2_subdev struct.
-   The client_type argument is the name of the chip that's on the adapter. */
-static inline struct v4l2_subdev *v4l2_i2c_new_subdev(struct v4l2_device *v4l2_dev,
-               struct i2c_adapter *adapter, const char *client_type,
-               u8 addr, const unsigned short *probe_addrs)
-{
-       return v4l2_i2c_new_subdev_cfg(v4l2_dev, adapter, client_type, 0, NULL,
-                                      addr, probe_addrs);
-}
-
 struct i2c_board_info;
 
 struct v4l2_subdev *v4l2_i2c_new_subdev_board(struct v4l2_device *v4l2_dev,
index d69ab4aae032ce6ecf59e7bb490ac2a1269dfd01..97d063837b61fb48b315d04da9096375480772f8 100644 (file)
@@ -23,6 +23,7 @@
 
 #include <linux/list.h>
 #include <linux/device.h>
+#include <linux/videodev2.h>
 
 /* forward references */
 struct v4l2_ctrl_handler;
@@ -53,8 +54,10 @@ struct v4l2_ctrl_ops {
   * @handler:  The handler that owns the control.
   * @cluster:  Point to start of cluster array.
   * @ncontrols:        Number of controls in cluster array.
-  * @has_new:  Internal flag: set when there is a valid new value.
   * @done:     Internal flag: set for each processed control.
+  * @is_new:   Set when the user specified a new value for this control. It
+  *            is also set when called from v4l2_ctrl_handler_setup. Drivers
+  *            should never set this flag.
   * @is_private: If set, then this control is private to its handler and it
   *            will not be added to any other handlers. Drivers can set
   *            this flag.
@@ -97,9 +100,9 @@ struct v4l2_ctrl {
        struct v4l2_ctrl_handler *handler;
        struct v4l2_ctrl **cluster;
        unsigned ncontrols;
-       unsigned int has_new:1;
        unsigned int done:1;
 
+       unsigned int is_new:1;
        unsigned int is_private:1;
        unsigned int is_volatile:1;
 
index b0316a7cf08d21f2ac68f1dc452894441948c155..daf1e57d9b266e9be3daf59e2c0e141351fa78d8 100644 (file)
@@ -106,10 +106,7 @@ struct v4l2_subdev_io_pin_config {
        u8 strength;    /* Pin drive strength */
 };
 
-/* s_config: if set, then it is always called by the v4l2_i2c_new_subdev*
-       functions after the v4l2_subdev was registered. It is used to pass
-       platform data to the subdev which can be used during initialization.
-
+/*
    s_io_pin_config: configure one or more chip I/O pins for chips that
        multiplex different internal signal pads out to IO pins.  This function
        takes a pointer to an array of 'n' pin configuration entries, one for
@@ -141,7 +138,6 @@ struct v4l2_subdev_io_pin_config {
 struct v4l2_subdev_core_ops {
        int (*g_chip_ident)(struct v4l2_subdev *sd, struct v4l2_dbg_chip_ident *chip);
        int (*log_status)(struct v4l2_subdev *sd);
-       int (*s_config)(struct v4l2_subdev *sd, int irq, void *platform_data);
        int (*s_io_pin_config)(struct v4l2_subdev *sd, size_t n,
                                      struct v4l2_subdev_io_pin_config *pincfg);
        int (*init)(struct v4l2_subdev *sd, u32 val);
@@ -415,6 +411,21 @@ struct v4l2_subdev_ops {
        const struct v4l2_subdev_sensor_ops     *sensor;
 };
 
+/*
+ * Internal ops. Never call this from drivers, only the v4l2 framework can call
+ * these ops.
+ *
+ * registered: called when this subdev is registered. When called the v4l2_dev
+ *     field is set to the correct v4l2_device.
+ *
+ * unregistered: called when this subdev is unregistered. When called the
+ *     v4l2_dev field is still set to the correct v4l2_device.
+ */
+struct v4l2_subdev_internal_ops {
+       int (*registered)(struct v4l2_subdev *sd);
+       void (*unregistered)(struct v4l2_subdev *sd);
+};
+
 #define V4L2_SUBDEV_NAME_SIZE 32
 
 /* Set this flag if this subdev is a i2c device. */
@@ -431,6 +442,8 @@ struct v4l2_subdev {
        u32 flags;
        struct v4l2_device *v4l2_dev;
        const struct v4l2_subdev_ops *ops;
+       /* Never call these internal ops from within a driver! */
+       const struct v4l2_subdev_internal_ops *internal_ops;
        /* The control handler of this subdev. May be NULL. */
        struct v4l2_ctrl_handler *ctrl_handler;
        /* name must be unique */
index 2a128c8c2718646a360c889475b4118e4e6bdc70..e73ebdae323d83f21ed7480155597f364c2f6025 100644 (file)
@@ -78,6 +78,7 @@ typedef __s32 sctp_assoc_t;
 #define SCTP_GET_PEER_ADDR_INFO        15
 #define SCTP_DELAYED_ACK_TIME  16
 #define SCTP_DELAYED_ACK SCTP_DELAYED_ACK_TIME
+#define SCTP_DELAYED_SACK SCTP_DELAYED_ACK_TIME
 #define SCTP_CONTEXT   17
 #define SCTP_FRAGMENT_INTERLEAVE       18
 #define SCTP_PARTIAL_DELIVERY_POINT    19 /* Set/Get partial delivery point */
index 49400459b477059d2866069bfd5144986743b438..b602f475cdbb9a4acd94d9870c083d29eeff43ff 100644 (file)
@@ -477,7 +477,7 @@ struct snd_ac97_template {
 
 struct snd_ac97 {
        /* -- lowlevel (hardware) driver specific -- */
-       struct snd_ac97_build_ops * build_ops;
+       const struct snd_ac97_build_ops *build_ops;
        void *private_data;
        void (*private_free) (struct snd_ac97 *ac97);
        /* --- */
index 4e337906016e9fccb399a99fd2b402d3b74a6b8a..be788c0957d4abac813eef18abe7822177542969 100644 (file)
@@ -745,8 +745,8 @@ config DEBUG_BLK_CGROUP
 endif # CGROUPS
 
 menuconfig NAMESPACES
-       bool "Namespaces support" if EMBEDDED
-       default !EMBEDDED
+       bool "Namespaces support" if EXPERT
+       default !EXPERT
        help
          Provides the way to make tasks work with different objects using
          the same id. For example same IPC id may refer to different objects
@@ -899,23 +899,31 @@ config SYSCTL
 config ANON_INODES
        bool
 
-menuconfig EMBEDDED
-       bool "Configure standard kernel features (for small systems)"
+menuconfig EXPERT
+       bool "Configure standard kernel features (expert users)"
        help
          This option allows certain base kernel options and settings
           to be disabled or tweaked. This is for specialized
           environments which can tolerate a "non-standard" kernel.
           Only use this if you really know what you are doing.
 
+config EMBEDDED
+       bool "Embedded system"
+       select EXPERT
+       help
+         This option should be enabled if compiling the kernel for
+         an embedded system so certain expert options are available
+         for configuration.
+
 config UID16
-       bool "Enable 16-bit UID system calls" if EMBEDDED
+       bool "Enable 16-bit UID system calls" if EXPERT
        depends on ARM || BLACKFIN || CRIS || FRV || H8300 || X86_32 || M68K || (S390 && !64BIT) || SUPERH || SPARC32 || (SPARC64 && COMPAT) || UML || (X86_64 && IA32_EMULATION)
        default y
        help
          This enables the legacy 16-bit UID syscall wrappers.
 
 config SYSCTL_SYSCALL
-       bool "Sysctl syscall support" if EMBEDDED
+       bool "Sysctl syscall support" if EXPERT
        depends on PROC_SYSCTL
        default y
        select SYSCTL
@@ -932,7 +940,7 @@ config SYSCTL_SYSCALL
          If unsure say Y here.
 
 config KALLSYMS
-        bool "Load all symbols for debugging/ksymoops" if EMBEDDED
+        bool "Load all symbols for debugging/ksymoops" if EXPERT
         default y
         help
           Say Y here to let the kernel print out symbolic crash information and
@@ -963,7 +971,7 @@ config KALLSYMS_EXTRA_PASS
 
 
 config HOTPLUG
-       bool "Support for hot-pluggable devices" if EMBEDDED
+       bool "Support for hot-pluggable devices" if EXPERT
        default y
        help
          This option is provided for the case where no hotplug or uevent
@@ -973,7 +981,7 @@ config HOTPLUG
 
 config PRINTK
        default y
-       bool "Enable support for printk" if EMBEDDED
+       bool "Enable support for printk" if EXPERT
        help
          This option enables normal printk support. Removing it
          eliminates most of the message strings from the kernel image
@@ -982,7 +990,7 @@ config PRINTK
          strongly discouraged.
 
 config BUG
-       bool "BUG() support" if EMBEDDED
+       bool "BUG() support" if EXPERT
        default y
        help
           Disabling this option eliminates support for BUG and WARN, reducing
@@ -993,12 +1001,12 @@ config BUG
 
 config ELF_CORE
        default y
-       bool "Enable ELF core dumps" if EMBEDDED
+       bool "Enable ELF core dumps" if EXPERT
        help
          Enable support for generating core dumps. Disabling saves about 4k.
 
 config PCSPKR_PLATFORM
-       bool "Enable PC-Speaker support" if EMBEDDED
+       bool "Enable PC-Speaker support" if EXPERT
        depends on ALPHA || X86 || MIPS || PPC_PREP || PPC_CHRP || PPC_PSERIES
        default y
        help
@@ -1007,14 +1015,14 @@ config PCSPKR_PLATFORM
 
 config BASE_FULL
        default y
-       bool "Enable full-sized data structures for core" if EMBEDDED
+       bool "Enable full-sized data structures for core" if EXPERT
        help
          Disabling this option reduces the size of miscellaneous core
          kernel data structures. This saves memory on small machines,
          but may reduce performance.
 
 config FUTEX
-       bool "Enable futex support" if EMBEDDED
+       bool "Enable futex support" if EXPERT
        default y
        select RT_MUTEXES
        help
@@ -1023,7 +1031,7 @@ config FUTEX
          run glibc-based applications correctly.
 
 config EPOLL
-       bool "Enable eventpoll support" if EMBEDDED
+       bool "Enable eventpoll support" if EXPERT
        default y
        select ANON_INODES
        help
@@ -1031,7 +1039,7 @@ config EPOLL
          support for epoll family of system calls.
 
 config SIGNALFD
-       bool "Enable signalfd() system call" if EMBEDDED
+       bool "Enable signalfd() system call" if EXPERT
        select ANON_INODES
        default y
        help
@@ -1041,7 +1049,7 @@ config SIGNALFD
          If unsure, say Y.
 
 config TIMERFD
-       bool "Enable timerfd() system call" if EMBEDDED
+       bool "Enable timerfd() system call" if EXPERT
        select ANON_INODES
        default y
        help
@@ -1051,7 +1059,7 @@ config TIMERFD
          If unsure, say Y.
 
 config EVENTFD
-       bool "Enable eventfd() system call" if EMBEDDED
+       bool "Enable eventfd() system call" if EXPERT
        select ANON_INODES
        default y
        help
@@ -1061,7 +1069,7 @@ config EVENTFD
          If unsure, say Y.
 
 config SHMEM
-       bool "Use full shmem filesystem" if EMBEDDED
+       bool "Use full shmem filesystem" if EXPERT
        default y
        depends on MMU
        help
@@ -1072,7 +1080,7 @@ config SHMEM
          which may be appropriate on small systems without swap.
 
 config AIO
-       bool "Enable AIO support" if EMBEDDED
+       bool "Enable AIO support" if EXPERT
        default y
        help
          This option enables POSIX asynchronous I/O which may by used
@@ -1149,16 +1157,16 @@ endmenu
 
 config VM_EVENT_COUNTERS
        default y
-       bool "Enable VM event counters for /proc/vmstat" if EMBEDDED
+       bool "Enable VM event counters for /proc/vmstat" if EXPERT
        help
          VM event counters are needed for event counts to be shown.
          This option allows the disabling of the VM event counters
-         on EMBEDDED systems.  /proc/vmstat will only show page counts
+         on EXPERT systems.  /proc/vmstat will only show page counts
          if VM event counters are disabled.
 
 config PCI_QUIRKS
        default y
-       bool "Enable PCI quirk workarounds" if EMBEDDED
+       bool "Enable PCI quirk workarounds" if EXPERT
        depends on PCI
        help
          This enables workarounds for various PCI chipset
@@ -1167,7 +1175,7 @@ config PCI_QUIRKS
 
 config SLUB_DEBUG
        default y
-       bool "Enable SLUB debugging support" if EMBEDDED
+       bool "Enable SLUB debugging support" if EXPERT
        depends on SLUB && SYSFS
        help
          SLUB has extensive debug support features. Disabling these can
@@ -1211,7 +1219,7 @@ config SLUB
           a slab allocator.
 
 config SLOB
-       depends on EMBEDDED
+       depends on EXPERT
        bool "SLOB (Simple Allocator)"
        help
           SLOB replaces the stock allocator with a drastically simpler
@@ -1222,7 +1230,7 @@ endchoice
 
 config MMAP_ALLOW_UNINITIALIZED
        bool "Allow mmapped anonymous memory to be uninitialized"
-       depends on EMBEDDED && !MMU
+       depends on EXPERT && !MMU
        default n
        help
          Normally, and according to the Linux spec, anonymous memory obtained
index 00799c1d46288fb491e6eb07ccf17dc8406883cc..33c37c379e96458521a0111a968849139edcf586 100644 (file)
@@ -96,6 +96,15 @@ static inline void mark_rodata_ro(void) { }
 extern void tc_init(void);
 #endif
 
+/*
+ * Debug helper: via this flag we know that we are in 'early bootup code'
+ * where only the boot processor is running with IRQ disabled.  This means
+ * two things - IRQ must not be enabled before the flag is cleared and some
+ * operations which are not allowed with IRQ disabled are allowed while the
+ * flag is set.
+ */
+bool early_boot_irqs_disabled __read_mostly;
+
 enum system_states system_state __read_mostly;
 EXPORT_SYMBOL(system_state);
 
@@ -554,7 +563,7 @@ asmlinkage void __init start_kernel(void)
        cgroup_init_early();
 
        local_irq_disable();
-       early_boot_irqs_off();
+       early_boot_irqs_disabled = true;
 
 /*
  * Interrupts are still disabled. Do necessary setups, then
@@ -621,7 +630,7 @@ asmlinkage void __init start_kernel(void)
        if (!irqs_disabled())
                printk(KERN_CRIT "start_kernel(): bug: interrupts were "
                                 "enabled early\n");
-       early_boot_irqs_on();
+       early_boot_irqs_disabled = false;
        local_irq_enable();
 
        /* Interrupts are enabled now so all GFP allocations are safe. */
index 31d766bf5d2ea02da6c5dc551a415799ae8166df..8e42fec7686d97815c3539d3da260984db63e90f 100644 (file)
@@ -9,9 +9,6 @@ menu "IRQ subsystem"
 config GENERIC_HARDIRQS
        def_bool y
 
-config GENERIC_HARDIRQS_NO__DO_IRQ
-       def_bool y
-
 # Select this to disable the deprecated stuff
 config GENERIC_HARDIRQS_NO_DEPRECATED
        def_bool n
index e2347eb6330682501e99bb3214ccfa9015a8a521..3540a7190122361a3cdaec62c08d7652693bde44 100644 (file)
@@ -118,114 +118,3 @@ irqreturn_t handle_IRQ_event(unsigned int irq, struct irqaction *action)
 
        return retval;
 }
-
-#ifndef CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ
-
-#ifdef CONFIG_ENABLE_WARN_DEPRECATED
-# warning __do_IRQ is deprecated. Please convert to proper flow handlers
-#endif
-
-/**
- * __do_IRQ - original all in one highlevel IRQ handler
- * @irq:       the interrupt number
- *
- * __do_IRQ handles all normal device IRQ's (the special
- * SMP cross-CPU interrupts have their own specific
- * handlers).
- *
- * This is the original x86 implementation which is used for every
- * interrupt type.
- */
-unsigned int __do_IRQ(unsigned int irq)
-{
-       struct irq_desc *desc = irq_to_desc(irq);
-       struct irqaction *action;
-       unsigned int status;
-
-       kstat_incr_irqs_this_cpu(irq, desc);
-
-       if (CHECK_IRQ_PER_CPU(desc->status)) {
-               irqreturn_t action_ret;
-
-               /*
-                * No locking required for CPU-local interrupts:
-                */
-               if (desc->irq_data.chip->ack)
-                       desc->irq_data.chip->ack(irq);
-               if (likely(!(desc->status & IRQ_DISABLED))) {
-                       action_ret = handle_IRQ_event(irq, desc->action);
-                       if (!noirqdebug)
-                               note_interrupt(irq, desc, action_ret);
-               }
-               desc->irq_data.chip->end(irq);
-               return 1;
-       }
-
-       raw_spin_lock(&desc->lock);
-       if (desc->irq_data.chip->ack)
-               desc->irq_data.chip->ack(irq);
-       /*
-        * REPLAY is when Linux resends an IRQ that was dropped earlier
-        * WAITING is used by probe to mark irqs that are being tested
-        */
-       status = desc->status & ~(IRQ_REPLAY | IRQ_WAITING);
-       status |= IRQ_PENDING; /* we _want_ to handle it */
-
-       /*
-        * If the IRQ is disabled for whatever reason, we cannot
-        * use the action we have.
-        */
-       action = NULL;
-       if (likely(!(status & (IRQ_DISABLED | IRQ_INPROGRESS)))) {
-               action = desc->action;
-               status &= ~IRQ_PENDING; /* we commit to handling */
-               status |= IRQ_INPROGRESS; /* we are handling it */
-       }
-       desc->status = status;
-
-       /*
-        * If there is no IRQ handler or it was disabled, exit early.
-        * Since we set PENDING, if another processor is handling
-        * a different instance of this same irq, the other processor
-        * will take care of it.
-        */
-       if (unlikely(!action))
-               goto out;
-
-       /*
-        * Edge triggered interrupts need to remember
-        * pending events.
-        * This applies to any hw interrupts that allow a second
-        * instance of the same irq to arrive while we are in do_IRQ
-        * or in the handler. But the code here only handles the _second_
-        * instance of the irq, not the third or fourth. So it is mostly
-        * useful for irq hardware that does not mask cleanly in an
-        * SMP environment.
-        */
-       for (;;) {
-               irqreturn_t action_ret;
-
-               raw_spin_unlock(&desc->lock);
-
-               action_ret = handle_IRQ_event(irq, action);
-               if (!noirqdebug)
-                       note_interrupt(irq, desc, action_ret);
-
-               raw_spin_lock(&desc->lock);
-               if (likely(!(desc->status & IRQ_PENDING)))
-                       break;
-               desc->status &= ~IRQ_PENDING;
-       }
-       desc->status &= ~IRQ_INPROGRESS;
-
-out:
-       /*
-        * The ->end() handler has to deal with interrupts which got
-        * disabled while the handler was running.
-        */
-       desc->irq_data.chip->end(irq);
-       raw_spin_unlock(&desc->lock);
-
-       return 1;
-}
-#endif
index 42ba65dff7d99e4eeadfe6175d70c2f9665ad431..0d2058da80f51888b503f4e92829bddbe884b264 100644 (file)
@@ -2291,22 +2291,6 @@ mark_held_locks(struct task_struct *curr, enum mark_type mark)
        return 1;
 }
 
-/*
- * Debugging helper: via this flag we know that we are in
- * 'early bootup code', and will warn about any invalid irqs-on event:
- */
-static int early_boot_irqs_enabled;
-
-void early_boot_irqs_off(void)
-{
-       early_boot_irqs_enabled = 0;
-}
-
-void early_boot_irqs_on(void)
-{
-       early_boot_irqs_enabled = 1;
-}
-
 /*
  * Hardirqs will be enabled:
  */
@@ -2319,7 +2303,7 @@ void trace_hardirqs_on_caller(unsigned long ip)
        if (unlikely(!debug_locks || current->lockdep_recursion))
                return;
 
-       if (DEBUG_LOCKS_WARN_ON(unlikely(!early_boot_irqs_enabled)))
+       if (DEBUG_LOCKS_WARN_ON(unlikely(early_boot_irqs_disabled)))
                return;
 
        if (unlikely(curr->hardirqs_enabled)) {
index 08107d1817582000af8df78667db22e6d88e5f59..0da1411222b9a2e11c1de4ed228e4028e8aef2b1 100644 (file)
@@ -719,9 +719,7 @@ void destroy_params(const struct kernel_param *params, unsigned num)
                        params[i].ops->free(params[i].arg);
 }
 
-static void __init kernel_add_sysfs_param(const char *name,
-                                         struct kernel_param *kparam,
-                                         unsigned int name_skip)
+static struct module_kobject * __init locate_module_kobject(const char *name)
 {
        struct module_kobject *mk;
        struct kobject *kobj;
@@ -729,10 +727,7 @@ static void __init kernel_add_sysfs_param(const char *name,
 
        kobj = kset_find_obj(module_kset, name);
        if (kobj) {
-               /* We already have one.  Remove params so we can add more. */
                mk = to_module_kobject(kobj);
-               /* We need to remove it before adding parameters. */
-               sysfs_remove_group(&mk->kobj, &mk->mp->grp);
        } else {
                mk = kzalloc(sizeof(struct module_kobject), GFP_KERNEL);
                BUG_ON(!mk);
@@ -743,15 +738,36 @@ static void __init kernel_add_sysfs_param(const char *name,
                                           "%s", name);
                if (err) {
                        kobject_put(&mk->kobj);
-                       printk(KERN_ERR "Module '%s' failed add to sysfs, "
-                              "error number %d\n", name, err);
-                       printk(KERN_ERR "The system will be unstable now.\n");
-                       return;
+                       printk(KERN_ERR
+                               "Module '%s' failed add to sysfs, error number %d\n",
+                               name, err);
+                       printk(KERN_ERR
+                               "The system will be unstable now.\n");
+                       return NULL;
                }
-               /* So that exit path is even. */
+
+               /* So that we hold reference in both cases. */
                kobject_get(&mk->kobj);
        }
 
+       return mk;
+}
+
+static void __init kernel_add_sysfs_param(const char *name,
+                                         struct kernel_param *kparam,
+                                         unsigned int name_skip)
+{
+       struct module_kobject *mk;
+       int err;
+
+       mk = locate_module_kobject(name);
+       if (!mk)
+               return;
+
+       /* We need to remove old parameters before adding more. */
+       if (mk->mp)
+               sysfs_remove_group(&mk->kobj, &mk->mp->grp);
+
        /* These should not fail at boot. */
        err = add_sysfs_param(mk, kparam, kparam->name + name_skip);
        BUG_ON(err);
@@ -796,6 +812,32 @@ static void __init param_sysfs_builtin(void)
        }
 }
 
+ssize_t __modver_version_show(struct module_attribute *mattr,
+                             struct module *mod, char *buf)
+{
+       struct module_version_attribute *vattr =
+               container_of(mattr, struct module_version_attribute, mattr);
+
+       return sprintf(buf, "%s\n", vattr->version);
+}
+
+extern struct module_version_attribute __start___modver[], __stop___modver[];
+
+static void __init version_sysfs_builtin(void)
+{
+       const struct module_version_attribute *vattr;
+       struct module_kobject *mk;
+       int err;
+
+       for (vattr = __start___modver; vattr < __stop___modver; vattr++) {
+               mk = locate_module_kobject(vattr->module_name);
+               if (mk) {
+                       err = sysfs_create_file(&mk->kobj, &vattr->mattr.attr);
+                       kobject_uevent(&mk->kobj, KOBJ_ADD);
+                       kobject_put(&mk->kobj);
+               }
+       }
+}
 
 /* module-related sysfs stuff */
 
@@ -875,6 +917,7 @@ static int __init param_sysfs_init(void)
        }
        module_sysfs_initialized = 1;
 
+       version_sysfs_builtin();
        param_sysfs_builtin();
 
        return 0;
index 05ebe841270b056a135fef4a2671528cea9f154d..84522c7969870fa3a6024086c6a3559546b0e9db 100644 (file)
@@ -2228,14 +2228,11 @@ find_get_context(struct pmu *pmu, struct task_struct *task, int cpu)
        unsigned long flags;
        int ctxn, err;
 
-       if (!task && cpu != -1) {
+       if (!task) {
                /* Must be root to operate on a CPU event: */
                if (perf_paranoid_cpu() && !capable(CAP_SYS_ADMIN))
                        return ERR_PTR(-EACCES);
 
-               if (cpu < 0 || cpu >= nr_cpumask_bits)
-                       return ERR_PTR(-EINVAL);
-
                /*
                 * We could be clever and allow to attach a event to an
                 * offline CPU and activate it when the CPU comes up, but
@@ -5541,6 +5538,11 @@ perf_event_alloc(struct perf_event_attr *attr, int cpu,
        struct hw_perf_event *hwc;
        long err;
 
+       if ((unsigned)cpu >= nr_cpu_ids) {
+               if (!task || cpu != -1)
+                       return ERR_PTR(-EINVAL);
+       }
+
        event = kzalloc(sizeof(*event), GFP_KERNEL);
        if (!event)
                return ERR_PTR(-ENOMEM);
@@ -5589,7 +5591,7 @@ perf_event_alloc(struct perf_event_attr *attr, int cpu,
 
        if (!overflow_handler && parent_event)
                overflow_handler = parent_event->overflow_handler;
-       
+
        event->overflow_handler = overflow_handler;
 
        if (attr->disabled)
@@ -6494,7 +6496,6 @@ int perf_event_init_context(struct task_struct *child, int ctxn)
 
        raw_spin_lock_irqsave(&parent_ctx->lock, flags);
        parent_ctx->rotate_disable = 0;
-       raw_spin_unlock_irqrestore(&parent_ctx->lock, flags);
 
        child_ctx = child->perf_event_ctxp[ctxn];
 
@@ -6502,12 +6503,11 @@ int perf_event_init_context(struct task_struct *child, int ctxn)
                /*
                 * Mark the child context as a clone of the parent
                 * context, or of whatever the parent is a clone of.
-                * Note that if the parent is a clone, it could get
-                * uncloned at any point, but that doesn't matter
-                * because the list of events and the generation
-                * count can't have changed since we took the mutex.
+                *
+                * Note that if the parent is a clone, the holding of
+                * parent_ctx->lock avoids it from being uncloned.
                 */
-               cloned_ctx = rcu_dereference(parent_ctx->parent_ctx);
+               cloned_ctx = parent_ctx->parent_ctx;
                if (cloned_ctx) {
                        child_ctx->parent_ctx = cloned_ctx;
                        child_ctx->parent_gen = parent_ctx->parent_gen;
@@ -6518,6 +6518,7 @@ int perf_event_init_context(struct task_struct *child, int ctxn)
                get_ctx(child_ctx->parent_ctx);
        }
 
+       raw_spin_unlock_irqrestore(&parent_ctx->lock, flags);
        mutex_unlock(&parent_ctx->mutex);
 
        perf_unpin_context(parent_ctx);
index ea3e5eff3878d75ec4f49b39c8139773626ccd1e..18d38e4ec7ba249ba46079beab5a773700a7eb3b 100644 (file)
@@ -553,9 +553,6 @@ struct rq {
        /* try_to_wake_up() stats */
        unsigned int ttwu_count;
        unsigned int ttwu_local;
-
-       /* BKL stats */
-       unsigned int bkl_count;
 #endif
 };
 
@@ -609,6 +606,9 @@ static inline struct task_group *task_group(struct task_struct *p)
        struct task_group *tg;
        struct cgroup_subsys_state *css;
 
+       if (p->flags & PF_EXITING)
+               return &root_task_group;
+
        css = task_subsys_state_check(p, cpu_cgroup_subsys_id,
                        lockdep_is_held(&task_rq(p)->lock));
        tg = container_of(css, struct task_group, css);
@@ -3887,7 +3887,7 @@ static inline void schedule_debug(struct task_struct *prev)
        schedstat_inc(this_rq(), sched_count);
 #ifdef CONFIG_SCHEDSTATS
        if (unlikely(prev->lock_depth >= 0)) {
-               schedstat_inc(this_rq(), bkl_count);
+               schedstat_inc(this_rq(), rq_sched_info.bkl_count);
                schedstat_inc(prev, sched_info.bkl_count);
        }
 #endif
@@ -4871,7 +4871,8 @@ recheck:
                 * assigned.
                 */
                if (rt_bandwidth_enabled() && rt_policy(policy) &&
-                               task_group(p)->rt_bandwidth.rt_runtime == 0) {
+                               task_group(p)->rt_bandwidth.rt_runtime == 0 &&
+                               !task_group_is_autogroup(task_group(p))) {
                        __task_rq_unlock(rq);
                        raw_spin_unlock_irqrestore(&p->pi_lock, flags);
                        return -EPERM;
@@ -8882,6 +8883,20 @@ cpu_cgroup_attach(struct cgroup_subsys *ss, struct cgroup *cgrp,
        }
 }
 
+static void
+cpu_cgroup_exit(struct cgroup_subsys *ss, struct task_struct *task)
+{
+       /*
+        * cgroup_exit() is called in the copy_process() failure path.
+        * Ignore this case since the task hasn't ran yet, this avoids
+        * trying to poke a half freed task state from generic code.
+        */
+       if (!(task->flags & PF_EXITING))
+               return;
+
+       sched_move_task(task);
+}
+
 #ifdef CONFIG_FAIR_GROUP_SCHED
 static int cpu_shares_write_u64(struct cgroup *cgrp, struct cftype *cftype,
                                u64 shareval)
@@ -8954,6 +8969,7 @@ struct cgroup_subsys cpu_cgroup_subsys = {
        .destroy        = cpu_cgroup_destroy,
        .can_attach     = cpu_cgroup_can_attach,
        .attach         = cpu_cgroup_attach,
+       .exit           = cpu_cgroup_exit,
        .populate       = cpu_cgroup_populate,
        .subsys_id      = cpu_cgroup_subsys_id,
        .early_init     = 1,
index 32a723b8f84cac397c51579a1f3099d35d1a25f0..9fb65628315709b36d4bb6d9bd100644d2a00992 100644 (file)
@@ -27,6 +27,11 @@ static inline void autogroup_destroy(struct kref *kref)
 {
        struct autogroup *ag = container_of(kref, struct autogroup, kref);
 
+#ifdef CONFIG_RT_GROUP_SCHED
+       /* We've redirected RT tasks to the root task group... */
+       ag->tg->rt_se = NULL;
+       ag->tg->rt_rq = NULL;
+#endif
        sched_destroy_group(ag->tg);
 }
 
@@ -55,6 +60,10 @@ static inline struct autogroup *autogroup_task_get(struct task_struct *p)
        return ag;
 }
 
+#ifdef CONFIG_RT_GROUP_SCHED
+static void free_rt_sched_group(struct task_group *tg);
+#endif
+
 static inline struct autogroup *autogroup_create(void)
 {
        struct autogroup *ag = kzalloc(sizeof(*ag), GFP_KERNEL);
@@ -72,6 +81,19 @@ static inline struct autogroup *autogroup_create(void)
        init_rwsem(&ag->lock);
        ag->id = atomic_inc_return(&autogroup_seq_nr);
        ag->tg = tg;
+#ifdef CONFIG_RT_GROUP_SCHED
+       /*
+        * Autogroup RT tasks are redirected to the root task group
+        * so we don't have to move tasks around upon policy change,
+        * or flail around trying to allocate bandwidth on the fly.
+        * A bandwidth exception in __sched_setscheduler() allows
+        * the policy change to proceed.  Thereafter, task_group()
+        * returns &root_task_group, so zero bandwidth is required.
+        */
+       free_rt_sched_group(tg);
+       tg->rt_se = root_task_group.rt_se;
+       tg->rt_rq = root_task_group.rt_rq;
+#endif
        tg->autogroup = ag;
 
        return ag;
@@ -106,6 +128,11 @@ task_wants_autogroup(struct task_struct *p, struct task_group *tg)
        return true;
 }
 
+static inline bool task_group_is_autogroup(struct task_group *tg)
+{
+       return tg != &root_task_group && tg->autogroup;
+}
+
 static inline struct task_group *
 autogroup_task_group(struct task_struct *p, struct task_group *tg)
 {
@@ -231,6 +258,11 @@ void proc_sched_autogroup_show_task(struct task_struct *p, struct seq_file *m)
 #ifdef CONFIG_SCHED_DEBUG
 static inline int autogroup_path(struct task_group *tg, char *buf, int buflen)
 {
+       int enabled = ACCESS_ONCE(sysctl_sched_autogroup_enabled);
+
+       if (!enabled || !tg->autogroup)
+               return 0;
+
        return snprintf(buf, buflen, "%s-%ld", "/autogroup", tg->autogroup->id);
 }
 #endif /* CONFIG_SCHED_DEBUG */
index 5358e241cb20fdb12dd69f8308b9e0308ba08d96..7b859ffe5dadd677cce89f833ee43a242ea3a992 100644 (file)
@@ -15,6 +15,10 @@ autogroup_task_group(struct task_struct *p, struct task_group *tg);
 
 static inline void autogroup_init(struct task_struct *init_task) {  }
 static inline void autogroup_free(struct task_group *tg) { }
+static inline bool task_group_is_autogroup(struct task_group *tg)
+{
+       return 0;
+}
 
 static inline struct task_group *
 autogroup_task_group(struct task_struct *p, struct task_group *tg)
index 1dfae3d014b5934eba4b3be25bfbad746196b4b7..eb6cb8edd075d9372b0547162a2930b06d14cacc 100644 (file)
@@ -16,6 +16,8 @@
 #include <linux/kallsyms.h>
 #include <linux/utsname.h>
 
+static DEFINE_SPINLOCK(sched_debug_lock);
+
 /*
  * This allows printing both to /proc/sched_debug and
  * to the console
@@ -86,6 +88,26 @@ static void print_cfs_group_stats(struct seq_file *m, int cpu, struct task_group
 }
 #endif
 
+#ifdef CONFIG_CGROUP_SCHED
+static char group_path[PATH_MAX];
+
+static char *task_group_path(struct task_group *tg)
+{
+       if (autogroup_path(tg, group_path, PATH_MAX))
+               return group_path;
+
+       /*
+        * May be NULL if the underlying cgroup isn't fully-created yet
+        */
+       if (!tg->css.cgroup) {
+               group_path[0] = '\0';
+               return group_path;
+       }
+       cgroup_path(tg->css.cgroup, group_path, PATH_MAX);
+       return group_path;
+}
+#endif
+
 static void
 print_task(struct seq_file *m, struct rq *rq, struct task_struct *p)
 {
@@ -108,6 +130,9 @@ print_task(struct seq_file *m, struct rq *rq, struct task_struct *p)
        SEQ_printf(m, "%15Ld %15Ld %15Ld.%06ld %15Ld.%06ld %15Ld.%06ld",
                0LL, 0LL, 0LL, 0L, 0LL, 0L, 0LL, 0L);
 #endif
+#ifdef CONFIG_CGROUP_SCHED
+       SEQ_printf(m, " %s", task_group_path(task_group(p)));
+#endif
 
        SEQ_printf(m, "\n");
 }
@@ -144,7 +169,11 @@ void print_cfs_rq(struct seq_file *m, int cpu, struct cfs_rq *cfs_rq)
        struct sched_entity *last;
        unsigned long flags;
 
+#ifdef CONFIG_FAIR_GROUP_SCHED
+       SEQ_printf(m, "\ncfs_rq[%d]:%s\n", cpu, task_group_path(cfs_rq->tg));
+#else
        SEQ_printf(m, "\ncfs_rq[%d]:\n", cpu);
+#endif
        SEQ_printf(m, "  .%-30s: %Ld.%06ld\n", "exec_clock",
                        SPLIT_NS(cfs_rq->exec_clock));
 
@@ -191,7 +220,11 @@ void print_cfs_rq(struct seq_file *m, int cpu, struct cfs_rq *cfs_rq)
 
 void print_rt_rq(struct seq_file *m, int cpu, struct rt_rq *rt_rq)
 {
+#ifdef CONFIG_RT_GROUP_SCHED
+       SEQ_printf(m, "\nrt_rq[%d]:%s\n", cpu, task_group_path(rt_rq->tg));
+#else
        SEQ_printf(m, "\nrt_rq[%d]:\n", cpu);
+#endif
 
 #define P(x) \
        SEQ_printf(m, "  .%-30s: %Ld\n", #x, (long long)(rt_rq->x))
@@ -212,6 +245,7 @@ extern __read_mostly int sched_clock_running;
 static void print_cpu(struct seq_file *m, int cpu)
 {
        struct rq *rq = cpu_rq(cpu);
+       unsigned long flags;
 
 #ifdef CONFIG_X86
        {
@@ -262,14 +296,20 @@ static void print_cpu(struct seq_file *m, int cpu)
        P(ttwu_count);
        P(ttwu_local);
 
-       P(bkl_count);
+       SEQ_printf(m, "  .%-30s: %d\n", "bkl_count",
+                               rq->rq_sched_info.bkl_count);
 
 #undef P
+#undef P64
 #endif
+       spin_lock_irqsave(&sched_debug_lock, flags);
        print_cfs_stats(m, cpu);
        print_rt_stats(m, cpu);
 
+       rcu_read_lock();
        print_rq(m, rq, cpu);
+       rcu_read_unlock();
+       spin_unlock_irqrestore(&sched_debug_lock, flags);
 }
 
 static const char *sched_tunable_scaling_names[] = {
index c62ebae65cf0c5e5d1628b0368692a94cda37568..77e9166d7bbfe304dcc2bdb9c71276d4a3a3b18b 100644 (file)
@@ -1062,6 +1062,9 @@ check_preempt_tick(struct cfs_rq *cfs_rq, struct sched_entity *curr)
                struct sched_entity *se = __pick_next_entity(cfs_rq);
                s64 delta = curr->vruntime - se->vruntime;
 
+               if (delta < 0)
+                       return;
+
                if (delta > ideal_runtime)
                        resched_task(rq_of(cfs_rq)->curr);
        }
@@ -1362,27 +1365,27 @@ static long effective_load(struct task_group *tg, int cpu, long wl, long wg)
                return wl;
 
        for_each_sched_entity(se) {
-               long S, rw, s, a, b;
+               long lw, w;
 
-               S = se->my_q->tg->shares;
-               s = se->load.weight;
-               rw = se->my_q->load.weight;
+               tg = se->my_q->tg;
+               w = se->my_q->load.weight;
 
-               a = S*(rw + wl);
-               b = S*rw + s*wg;
+               /* use this cpu's instantaneous contribution */
+               lw = atomic_read(&tg->load_weight);
+               lw -= se->my_q->load_contribution;
+               lw += w + wg;
 
-               wl = s*(a-b);
+               wl += w;
 
-               if (likely(b))
-                       wl /= b;
+               if (lw > 0 && wl < lw)
+                       wl = (wl * tg->shares) / lw;
+               else
+                       wl = tg->shares;
 
-               /*
-                * Assume the group is already running and will
-                * thus already be accounted for in the weight.
-                *
-                * That is, moving shares between CPUs, does not
-                * alter the group weight.
-                */
+               /* zero point is MIN_SHARES */
+               if (wl < MIN_SHARES)
+                       wl = MIN_SHARES;
+               wl -= se->load.weight;
                wg = 0;
        }
 
index 4ec30e0699878d2f536df9ee6ce94d765f046403..9910744f0856c5a084b4f9721dca09f376415645 100644 (file)
@@ -194,23 +194,52 @@ void generic_smp_call_function_interrupt(void)
         */
        list_for_each_entry_rcu(data, &call_function.queue, csd.list) {
                int refs;
+               void (*func) (void *info);
 
-               if (!cpumask_test_and_clear_cpu(cpu, data->cpumask))
+               /*
+                * Since we walk the list without any locks, we might
+                * see an entry that was completed, removed from the
+                * list and is in the process of being reused.
+                *
+                * We must check that the cpu is in the cpumask before
+                * checking the refs, and both must be set before
+                * executing the callback on this cpu.
+                */
+
+               if (!cpumask_test_cpu(cpu, data->cpumask))
+                       continue;
+
+               smp_rmb();
+
+               if (atomic_read(&data->refs) == 0)
                        continue;
 
+               func = data->csd.func;                  /* for later warn */
                data->csd.func(data->csd.info);
 
+               /*
+                * If the cpu mask is not still set then it enabled interrupts,
+                * we took another smp interrupt, and executed the function
+                * twice on this cpu.  In theory that copy decremented refs.
+                */
+               if (!cpumask_test_and_clear_cpu(cpu, data->cpumask)) {
+                       WARN(1, "%pS enabled interrupts and double executed\n",
+                            func);
+                       continue;
+               }
+
                refs = atomic_dec_return(&data->refs);
                WARN_ON(refs < 0);
-               if (!refs) {
-                       raw_spin_lock(&call_function.lock);
-                       list_del_rcu(&data->csd.list);
-                       raw_spin_unlock(&call_function.lock);
-               }
 
                if (refs)
                        continue;
 
+               WARN_ON(!cpumask_empty(data->cpumask));
+
+               raw_spin_lock(&call_function.lock);
+               list_del_rcu(&data->csd.list);
+               raw_spin_unlock(&call_function.lock);
+
                csd_unlock(&data->csd);
        }
 
@@ -430,7 +459,7 @@ void smp_call_function_many(const struct cpumask *mask,
         * can't happen.
         */
        WARN_ON_ONCE(cpu_online(this_cpu) && irqs_disabled()
-                    && !oops_in_progress);
+                    && !oops_in_progress && !early_boot_irqs_disabled);
 
        /* So, what's a CPU they want? Ignoring this one. */
        cpu = cpumask_first_and(mask, cpu_online_mask);
@@ -454,11 +483,21 @@ void smp_call_function_many(const struct cpumask *mask,
 
        data = &__get_cpu_var(cfd_data);
        csd_lock(&data->csd);
+       BUG_ON(atomic_read(&data->refs) || !cpumask_empty(data->cpumask));
 
        data->csd.func = func;
        data->csd.info = info;
        cpumask_and(data->cpumask, mask, cpu_online_mask);
        cpumask_clear_cpu(this_cpu, data->cpumask);
+
+       /*
+        * To ensure the interrupt handler gets an complete view
+        * we order the cpumask and refs writes and order the read
+        * of them in the interrupt handler.  In addition we may
+        * only clear our own cpu bit from the mask.
+        */
+       smp_wmb();
+
        atomic_set(&data->refs, cpumask_weight(data->cpumask));
 
        raw_spin_lock_irqsave(&call_function.lock, flags);
@@ -533,17 +572,20 @@ void ipi_call_unlock_irq(void)
 #endif /* USE_GENERIC_SMP_HELPERS */
 
 /*
- * Call a function on all processors
+ * Call a function on all processors.  May be used during early boot while
+ * early_boot_irqs_disabled is set.  Use local_irq_save/restore() instead
+ * of local_irq_disable/enable().
  */
 int on_each_cpu(void (*func) (void *info), void *info, int wait)
 {
+       unsigned long flags;
        int ret = 0;
 
        preempt_disable();
        ret = smp_call_function(func, info, wait);
-       local_irq_disable();
+       local_irq_save(flags);
        func(info);
-       local_irq_enable();
+       local_irq_restore(flags);
        preempt_enable();
        return ret;
 }
index 5cf8c602b8804c054bbed65475b4815fd29d5b82..92b6e1e12d982931309e4ecf431a923ffff56c84 100644 (file)
@@ -453,14 +453,6 @@ void time_hardirqs_off(unsigned long a0, unsigned long a1)
  * Stubs:
  */
 
-void early_boot_irqs_off(void)
-{
-}
-
-void early_boot_irqs_on(void)
-{
-}
-
 void trace_softirqs_on(unsigned long ip)
 {
 }
index 8ee6ec82f88a9cc2982bfcd73bc3bd86dcd490a8..11869faa6819767fba57f1e45789da7b56f15e74 100644 (file)
@@ -768,7 +768,11 @@ static inline void worker_clr_flags(struct worker *worker, unsigned int flags)
 
        worker->flags &= ~flags;
 
-       /* if transitioning out of NOT_RUNNING, increment nr_running */
+       /*
+        * If transitioning out of NOT_RUNNING, increment nr_running.  Note
+        * that the nested NOT_RUNNING is not a noop.  NOT_RUNNING is mask
+        * of multiple flags, not a single flag.
+        */
        if ((flags & WORKER_NOT_RUNNING) && (oflags & WORKER_NOT_RUNNING))
                if (!(worker->flags & WORKER_NOT_RUNNING))
                        atomic_inc(get_gcwq_nr_running(gcwq->cpu));
@@ -1840,7 +1844,7 @@ __acquires(&gcwq->lock)
        spin_unlock_irq(&gcwq->lock);
 
        work_clear_pending(work);
-       lock_map_acquire(&cwq->wq->lockdep_map);
+       lock_map_acquire_read(&cwq->wq->lockdep_map);
        lock_map_acquire(&lockdep_map);
        trace_workqueue_execute_start(work);
        f(work);
@@ -2384,8 +2388,18 @@ static bool start_flush_work(struct work_struct *work, struct wq_barrier *barr,
        insert_wq_barrier(cwq, barr, work, worker);
        spin_unlock_irq(&gcwq->lock);
 
-       lock_map_acquire(&cwq->wq->lockdep_map);
+       /*
+        * If @max_active is 1 or rescuer is in use, flushing another work
+        * item on the same workqueue may lead to deadlock.  Make sure the
+        * flusher is not running on the same workqueue by verifying write
+        * access.
+        */
+       if (cwq->wq->saved_max_active == 1 || cwq->wq->flags & WQ_RESCUER)
+               lock_map_acquire(&cwq->wq->lockdep_map);
+       else
+               lock_map_acquire_read(&cwq->wq->lockdep_map);
        lock_map_release(&cwq->wq->lockdep_map);
+
        return true;
 already_gone:
        spin_unlock_irq(&gcwq->lock);
index 2d05adb984018776610f573de126f14bda4c9d2e..3967c2356e3710e9be11ea9c4901c6b206232406 100644 (file)
@@ -657,7 +657,7 @@ config DEBUG_HIGHMEM
          Disable for production systems.
 
 config DEBUG_BUGVERBOSE
-       bool "Verbose BUG() reporting (adds 70K)" if DEBUG_KERNEL && EMBEDDED
+       bool "Verbose BUG() reporting (adds 70K)" if DEBUG_KERNEL && EXPERT
        depends on BUG
        depends on ARM || AVR32 || M32R || M68K || SPARC32 || SPARC64 || \
                   FRV || SUPERH || GENERIC_BUG || BLACKFIN || MN10300
@@ -729,8 +729,8 @@ config DEBUG_WRITECOUNT
          If unsure, say N.
 
 config DEBUG_MEMORY_INIT
-       bool "Debug memory initialisation" if EMBEDDED
-       default !EMBEDDED
+       bool "Debug memory initialisation" if EXPERT
+       default !EXPERT
        help
          Enable this for additional checks during memory initialisation.
          The sanity checks verify aspects of the VM such as the memory model
index e3b6e18fdac5718a09fef2ce874a911b52b09ab2..60a6088d0e5e9495a2f74da59d6fc92ce0247a7f 100644 (file)
@@ -7,37 +7,37 @@ config XZ_DEC
          CRC32 is supported. See Documentation/xz.txt for more information.
 
 config XZ_DEC_X86
-       bool "x86 BCJ filter decoder" if EMBEDDED
+       bool "x86 BCJ filter decoder" if EXPERT
        default y
        depends on XZ_DEC
        select XZ_DEC_BCJ
 
 config XZ_DEC_POWERPC
-       bool "PowerPC BCJ filter decoder" if EMBEDDED
+       bool "PowerPC BCJ filter decoder" if EXPERT
        default y
        depends on XZ_DEC
        select XZ_DEC_BCJ
 
 config XZ_DEC_IA64
-       bool "IA-64 BCJ filter decoder" if EMBEDDED
+       bool "IA-64 BCJ filter decoder" if EXPERT
        default y
        depends on XZ_DEC
        select XZ_DEC_BCJ
 
 config XZ_DEC_ARM
-       bool "ARM BCJ filter decoder" if EMBEDDED
+       bool "ARM BCJ filter decoder" if EXPERT
        default y
        depends on XZ_DEC
        select XZ_DEC_BCJ
 
 config XZ_DEC_ARMTHUMB
-       bool "ARM-Thumb BCJ filter decoder" if EMBEDDED
+       bool "ARM-Thumb BCJ filter decoder" if EXPERT
        default y
        depends on XZ_DEC
        select XZ_DEC_BCJ
 
 config XZ_DEC_SPARC
-       bool "SPARC BCJ filter decoder" if EMBEDDED
+       bool "SPARC BCJ filter decoder" if EXPERT
        default y
        depends on XZ_DEC
        select XZ_DEC_BCJ
index 6d592a021072a89048b6edd0ec79c8f965b83d49..8be430b812def9f32058ffb8c7e259ff1375d98e 100644 (file)
@@ -406,6 +406,10 @@ static int compact_finished(struct zone *zone,
        if (!zone_watermark_ok(zone, cc->order, watermark, 0, 0))
                return COMPACT_CONTINUE;
 
+       /*
+        * order == -1 is expected when compacting via
+        * /proc/sys/vm/compact_memory
+        */
        if (cc->order == -1)
                return COMPACT_CONTINUE;
 
@@ -453,6 +457,13 @@ unsigned long compaction_suitable(struct zone *zone, int order)
        if (!zone_watermark_ok(zone, 0, watermark, 0, 0))
                return COMPACT_SKIPPED;
 
+       /*
+        * order == -1 is expected when compacting via
+        * /proc/sys/vm/compact_memory
+        */
+       if (order == -1)
+               return COMPACT_CONTINUE;
+
        /*
         * fragmentation index determines if allocation failures are due to
         * low memory or external fragmentation
index 004c9c2aac788ebca9c7de0edb95244396b880f1..e187454d82f666a70bab08762ca92cd60b8f848c 100644 (file)
@@ -1203,6 +1203,8 @@ static void __split_huge_page_refcount(struct page *page)
                BUG_ON(!PageDirty(page_tail));
                BUG_ON(!PageSwapBacked(page_tail));
 
+               mem_cgroup_split_huge_fixup(page, page_tail);
+
                lru_add_page_tail(zone, page, page_tail);
        }
 
@@ -1837,9 +1839,9 @@ static void collapse_huge_page(struct mm_struct *mm,
        spin_lock(ptl);
        isolated = __collapse_huge_page_isolate(vma, address, pte);
        spin_unlock(ptl);
-       pte_unmap(pte);
 
        if (unlikely(!isolated)) {
+               pte_unmap(pte);
                spin_lock(&mm->page_table_lock);
                BUG_ON(!pmd_none(*pmd));
                set_pmd_at(mm, address, pmd, _pmd);
@@ -1856,6 +1858,7 @@ static void collapse_huge_page(struct mm_struct *mm,
        anon_vma_unlock(vma->anon_vma);
 
        __collapse_huge_page_copy(pte, new_page, vma, address, ptl);
+       pte_unmap(pte);
        __SetPageUptodate(new_page);
        pgtable = pmd_pgtable(_pmd);
        VM_BUG_ON(page_count(pgtable) != 1);
index 400dc62697d78056eaa12c7a91ca9f9daa1d4c77..bdba245d8afd9a75babf696030255d2d239e11de 100644 (file)
@@ -683,13 +683,13 @@ int __init_memblock memblock_is_memory(phys_addr_t addr)
 
 int __init_memblock memblock_is_region_memory(phys_addr_t base, phys_addr_t size)
 {
-       int idx = memblock_search(&memblock.reserved, base);
+       int idx = memblock_search(&memblock.memory, base);
 
        if (idx == -1)
                return 0;
-       return memblock.reserved.regions[idx].base <= base &&
-               (memblock.reserved.regions[idx].base +
-                memblock.reserved.regions[idx].size) >= (base + size);
+       return memblock.memory.regions[idx].base <= base &&
+               (memblock.memory.regions[idx].base +
+                memblock.memory.regions[idx].size) >= (base + size);
 }
 
 int __init_memblock memblock_is_region_reserved(phys_addr_t base, phys_addr_t size)
index 8ab8410314363871da25fa9f613578f5ebe01783..db76ef726293fa744da16ef8cabbe643980bf07e 100644 (file)
@@ -600,23 +600,22 @@ static void mem_cgroup_swap_statistics(struct mem_cgroup *mem,
 }
 
 static void mem_cgroup_charge_statistics(struct mem_cgroup *mem,
-                                        struct page_cgroup *pc,
-                                        bool charge)
+                                        bool file, int nr_pages)
 {
-       int val = (charge) ? 1 : -1;
-
        preempt_disable();
 
-       if (PageCgroupCache(pc))
-               __this_cpu_add(mem->stat->count[MEM_CGROUP_STAT_CACHE], val);
+       if (file)
+               __this_cpu_add(mem->stat->count[MEM_CGROUP_STAT_CACHE], nr_pages);
        else
-               __this_cpu_add(mem->stat->count[MEM_CGROUP_STAT_RSS], val);
+               __this_cpu_add(mem->stat->count[MEM_CGROUP_STAT_RSS], nr_pages);
 
-       if (charge)
+       /* pagein of a big page is an event. So, ignore page size */
+       if (nr_pages > 0)
                __this_cpu_inc(mem->stat->count[MEM_CGROUP_STAT_PGPGIN_COUNT]);
        else
                __this_cpu_inc(mem->stat->count[MEM_CGROUP_STAT_PGPGOUT_COUNT]);
-       __this_cpu_inc(mem->stat->count[MEM_CGROUP_EVENTS]);
+
+       __this_cpu_add(mem->stat->count[MEM_CGROUP_EVENTS], nr_pages);
 
        preempt_enable();
 }
@@ -815,7 +814,8 @@ void mem_cgroup_del_lru_list(struct page *page, enum lru_list lru)
         * removed from global LRU.
         */
        mz = page_cgroup_zoneinfo(pc);
-       MEM_CGROUP_ZSTAT(mz, lru) -= 1;
+       /* huge page split is done under lru_lock. so, we have no races. */
+       MEM_CGROUP_ZSTAT(mz, lru) -= 1 << compound_order(page);
        if (mem_cgroup_is_root(pc->mem_cgroup))
                return;
        VM_BUG_ON(list_empty(&pc->lru));
@@ -836,13 +836,12 @@ void mem_cgroup_rotate_lru_list(struct page *page, enum lru_list lru)
                return;
 
        pc = lookup_page_cgroup(page);
-       /*
-        * Used bit is set without atomic ops but after smp_wmb().
-        * For making pc->mem_cgroup visible, insert smp_rmb() here.
-        */
-       smp_rmb();
        /* unused or root page is not rotated. */
-       if (!PageCgroupUsed(pc) || mem_cgroup_is_root(pc->mem_cgroup))
+       if (!PageCgroupUsed(pc))
+               return;
+       /* Ensure pc->mem_cgroup is visible after reading PCG_USED. */
+       smp_rmb();
+       if (mem_cgroup_is_root(pc->mem_cgroup))
                return;
        mz = page_cgroup_zoneinfo(pc);
        list_move(&pc->lru, &mz->lists[lru]);
@@ -857,16 +856,13 @@ void mem_cgroup_add_lru_list(struct page *page, enum lru_list lru)
                return;
        pc = lookup_page_cgroup(page);
        VM_BUG_ON(PageCgroupAcctLRU(pc));
-       /*
-        * Used bit is set without atomic ops but after smp_wmb().
-        * For making pc->mem_cgroup visible, insert smp_rmb() here.
-        */
-       smp_rmb();
        if (!PageCgroupUsed(pc))
                return;
-
+       /* Ensure pc->mem_cgroup is visible after reading PCG_USED. */
+       smp_rmb();
        mz = page_cgroup_zoneinfo(pc);
-       MEM_CGROUP_ZSTAT(mz, lru) += 1;
+       /* huge page split is done under lru_lock. so, we have no races. */
+       MEM_CGROUP_ZSTAT(mz, lru) += 1 << compound_order(page);
        SetPageCgroupAcctLRU(pc);
        if (mem_cgroup_is_root(pc->mem_cgroup))
                return;
@@ -1030,14 +1026,10 @@ mem_cgroup_get_reclaim_stat_from_page(struct page *page)
                return NULL;
 
        pc = lookup_page_cgroup(page);
-       /*
-        * Used bit is set without atomic ops but after smp_wmb().
-        * For making pc->mem_cgroup visible, insert smp_rmb() here.
-        */
-       smp_rmb();
        if (!PageCgroupUsed(pc))
                return NULL;
-
+       /* Ensure pc->mem_cgroup is visible after reading PCG_USED. */
+       smp_rmb();
        mz = page_cgroup_zoneinfo(pc);
        if (!mz)
                return NULL;
@@ -1615,7 +1607,7 @@ void mem_cgroup_update_page_stat(struct page *page,
        if (unlikely(!mem || !PageCgroupUsed(pc)))
                goto out;
        /* pc->mem_cgroup is unstable ? */
-       if (unlikely(mem_cgroup_stealed(mem))) {
+       if (unlikely(mem_cgroup_stealed(mem)) || PageTransHuge(page)) {
                /* take a lock against to access pc->mem_cgroup */
                move_lock_page_cgroup(pc, &flags);
                need_unlock = true;
@@ -2084,14 +2076,27 @@ struct mem_cgroup *try_get_mem_cgroup_from_page(struct page *page)
        return mem;
 }
 
-/*
- * commit a charge got by __mem_cgroup_try_charge() and makes page_cgroup to be
- * USED state. If already USED, uncharge and return.
- */
-static void ____mem_cgroup_commit_charge(struct mem_cgroup *mem,
-                                        struct page_cgroup *pc,
-                                        enum charge_type ctype)
+static void __mem_cgroup_commit_charge(struct mem_cgroup *mem,
+                                      struct page_cgroup *pc,
+                                      enum charge_type ctype,
+                                      int page_size)
 {
+       int nr_pages = page_size >> PAGE_SHIFT;
+
+       /* try_charge() can return NULL to *memcg, taking care of it. */
+       if (!mem)
+               return;
+
+       lock_page_cgroup(pc);
+       if (unlikely(PageCgroupUsed(pc))) {
+               unlock_page_cgroup(pc);
+               mem_cgroup_cancel_charge(mem, page_size);
+               return;
+       }
+       /*
+        * we don't need page_cgroup_lock about tail pages, becase they are not
+        * accessed by any other context at this point.
+        */
        pc->mem_cgroup = mem;
        /*
         * We access a page_cgroup asynchronously without lock_page_cgroup().
@@ -2115,35 +2120,7 @@ static void ____mem_cgroup_commit_charge(struct mem_cgroup *mem,
                break;
        }
 
-       mem_cgroup_charge_statistics(mem, pc, true);
-}
-
-static void __mem_cgroup_commit_charge(struct mem_cgroup *mem,
-                                      struct page_cgroup *pc,
-                                      enum charge_type ctype,
-                                      int page_size)
-{
-       int i;
-       int count = page_size >> PAGE_SHIFT;
-
-       /* try_charge() can return NULL to *memcg, taking care of it. */
-       if (!mem)
-               return;
-
-       lock_page_cgroup(pc);
-       if (unlikely(PageCgroupUsed(pc))) {
-               unlock_page_cgroup(pc);
-               mem_cgroup_cancel_charge(mem, page_size);
-               return;
-       }
-
-       /*
-        * we don't need page_cgroup_lock about tail pages, becase they are not
-        * accessed by any other context at this point.
-        */
-       for (i = 0; i < count; i++)
-               ____mem_cgroup_commit_charge(mem, pc + i, ctype);
-
+       mem_cgroup_charge_statistics(mem, PageCgroupCache(pc), nr_pages);
        unlock_page_cgroup(pc);
        /*
         * "charge_statistics" updated event counter. Then, check it.
@@ -2153,6 +2130,46 @@ static void __mem_cgroup_commit_charge(struct mem_cgroup *mem,
        memcg_check_events(mem, pc->page);
 }
 
+#ifdef CONFIG_TRANSPARENT_HUGEPAGE
+
+#define PCGF_NOCOPY_AT_SPLIT ((1 << PCG_LOCK) | (1 << PCG_MOVE_LOCK) |\
+                       (1 << PCG_ACCT_LRU) | (1 << PCG_MIGRATION))
+/*
+ * Because tail pages are not marked as "used", set it. We're under
+ * zone->lru_lock, 'splitting on pmd' and compund_lock.
+ */
+void mem_cgroup_split_huge_fixup(struct page *head, struct page *tail)
+{
+       struct page_cgroup *head_pc = lookup_page_cgroup(head);
+       struct page_cgroup *tail_pc = lookup_page_cgroup(tail);
+       unsigned long flags;
+
+       /*
+        * We have no races with charge/uncharge but will have races with
+        * page state accounting.
+        */
+       move_lock_page_cgroup(head_pc, &flags);
+
+       tail_pc->mem_cgroup = head_pc->mem_cgroup;
+       smp_wmb(); /* see __commit_charge() */
+       if (PageCgroupAcctLRU(head_pc)) {
+               enum lru_list lru;
+               struct mem_cgroup_per_zone *mz;
+
+               /*
+                * LRU flags cannot be copied because we need to add tail
+                *.page to LRU by generic call and our hook will be called.
+                * We hold lru_lock, then, reduce counter directly.
+                */
+               lru = page_lru(head);
+               mz = page_cgroup_zoneinfo(head_pc);
+               MEM_CGROUP_ZSTAT(mz, lru) -= 1;
+       }
+       tail_pc->flags = head_pc->flags & ~PCGF_NOCOPY_AT_SPLIT;
+       move_unlock_page_cgroup(head_pc, &flags);
+}
+#endif
+
 /**
  * __mem_cgroup_move_account - move account of the page
  * @pc:        page_cgroup of the page.
@@ -2171,8 +2188,11 @@ static void __mem_cgroup_commit_charge(struct mem_cgroup *mem,
  */
 
 static void __mem_cgroup_move_account(struct page_cgroup *pc,
-       struct mem_cgroup *from, struct mem_cgroup *to, bool uncharge)
+       struct mem_cgroup *from, struct mem_cgroup *to, bool uncharge,
+       int charge_size)
 {
+       int nr_pages = charge_size >> PAGE_SHIFT;
+
        VM_BUG_ON(from == to);
        VM_BUG_ON(PageLRU(pc->page));
        VM_BUG_ON(!page_is_cgroup_locked(pc));
@@ -2186,14 +2206,14 @@ static void __mem_cgroup_move_account(struct page_cgroup *pc,
                __this_cpu_inc(to->stat->count[MEM_CGROUP_STAT_FILE_MAPPED]);
                preempt_enable();
        }
-       mem_cgroup_charge_statistics(from, pc, false);
+       mem_cgroup_charge_statistics(from, PageCgroupCache(pc), -nr_pages);
        if (uncharge)
                /* This is not "cancel", but cancel_charge does all we need. */
-               mem_cgroup_cancel_charge(from, PAGE_SIZE);
+               mem_cgroup_cancel_charge(from, charge_size);
 
        /* caller should have done css_get */
        pc->mem_cgroup = to;
-       mem_cgroup_charge_statistics(to, pc, true);
+       mem_cgroup_charge_statistics(to, PageCgroupCache(pc), nr_pages);
        /*
         * We charges against "to" which may not have any tasks. Then, "to"
         * can be under rmdir(). But in current implementation, caller of
@@ -2208,15 +2228,19 @@ static void __mem_cgroup_move_account(struct page_cgroup *pc,
  * __mem_cgroup_move_account()
  */
 static int mem_cgroup_move_account(struct page_cgroup *pc,
-               struct mem_cgroup *from, struct mem_cgroup *to, bool uncharge)
+               struct mem_cgroup *from, struct mem_cgroup *to,
+               bool uncharge, int charge_size)
 {
        int ret = -EINVAL;
        unsigned long flags;
 
+       if ((charge_size > PAGE_SIZE) && !PageTransHuge(pc->page))
+               return -EBUSY;
+
        lock_page_cgroup(pc);
        if (PageCgroupUsed(pc) && pc->mem_cgroup == from) {
                move_lock_page_cgroup(pc, &flags);
-               __mem_cgroup_move_account(pc, from, to, uncharge);
+               __mem_cgroup_move_account(pc, from, to, uncharge, charge_size);
                move_unlock_page_cgroup(pc, &flags);
                ret = 0;
        }
@@ -2241,6 +2265,8 @@ static int mem_cgroup_move_parent(struct page_cgroup *pc,
        struct cgroup *cg = child->css.cgroup;
        struct cgroup *pcg = cg->parent;
        struct mem_cgroup *parent;
+       int charge = PAGE_SIZE;
+       unsigned long flags;
        int ret;
 
        /* Is ROOT ? */
@@ -2252,17 +2278,23 @@ static int mem_cgroup_move_parent(struct page_cgroup *pc,
                goto out;
        if (isolate_lru_page(page))
                goto put;
+       /* The page is isolated from LRU and we have no race with splitting */
+       charge = PAGE_SIZE << compound_order(page);
 
        parent = mem_cgroup_from_cont(pcg);
-       ret = __mem_cgroup_try_charge(NULL, gfp_mask, &parent, false,
-                                     PAGE_SIZE);
+       ret = __mem_cgroup_try_charge(NULL, gfp_mask, &parent, false, charge);
        if (ret || !parent)
                goto put_back;
 
-       ret = mem_cgroup_move_account(pc, child, parent, true);
+       if (charge > PAGE_SIZE)
+               flags = compound_lock_irqsave(page);
+
+       ret = mem_cgroup_move_account(pc, child, parent, true, charge);
        if (ret)
-               mem_cgroup_cancel_charge(parent, PAGE_SIZE);
+               mem_cgroup_cancel_charge(parent, charge);
 put_back:
+       if (charge > PAGE_SIZE)
+               compound_unlock_irqrestore(page, flags);
        putback_lru_page(page);
 put:
        put_page(page);
@@ -2546,7 +2578,6 @@ direct_uncharge:
 static struct mem_cgroup *
 __mem_cgroup_uncharge_common(struct page *page, enum charge_type ctype)
 {
-       int i;
        int count;
        struct page_cgroup *pc;
        struct mem_cgroup *mem = NULL;
@@ -2596,8 +2627,7 @@ __mem_cgroup_uncharge_common(struct page *page, enum charge_type ctype)
                break;
        }
 
-       for (i = 0; i < count; i++)
-               mem_cgroup_charge_statistics(mem, pc + i, false);
+       mem_cgroup_charge_statistics(mem, PageCgroupCache(pc), -count);
 
        ClearPageCgroupUsed(pc);
        /*
@@ -4844,7 +4874,7 @@ retry:
                                goto put;
                        pc = lookup_page_cgroup(page);
                        if (!mem_cgroup_move_account(pc,
-                                               mc.from, mc.to, false)) {
+                                       mc.from, mc.to, false, PAGE_SIZE)) {
                                mc.precharge--;
                                /* we uncharge from mc.from later. */
                                mc.moved_charge++;
index 3c2d5ddfa0d49f3cf31449e214d8fbd50e92ad08..49feb46e77b8802803d20009f758ec65d2db0835 100644 (file)
@@ -549,13 +549,12 @@ EXPORT_SYMBOL(truncate_pagecache);
  * @inode: inode
  * @newsize: new file size
  *
- * truncate_setsize updastes i_size update and performs pagecache
- * truncation (if necessary) for a file size updates. It will be
- * typically be called from the filesystem's setattr function when
- * ATTR_SIZE is passed in.
+ * truncate_setsize updates i_size and performs pagecache truncation (if
+ * necessary) to @newsize. It will be typically be called from the filesystem's
+ * setattr function when ATTR_SIZE is passed in.
  *
- * Must be called with inode_mutex held and after all filesystem
- * specific block truncation has been performed.
+ * Must be called with inode_mutex held and before all filesystem specific
+ * block truncation has been performed.
  */
 void truncate_setsize(struct inode *inode, loff_t newsize)
 {
index 47a50962ce817682ce618bc1a85d3216763e5d3c..f5d90dedebbafab2235c6d408a371d40e52d4e54 100644 (file)
@@ -41,7 +41,6 @@
 #include <linux/memcontrol.h>
 #include <linux/delayacct.h>
 #include <linux/sysctl.h>
-#include <linux/compaction.h>
 
 #include <asm/tlbflush.h>
 #include <asm/div64.h>
index d4d9926c2201e5656229612e36226abb6865479f..65106fb61b8fce83c442d27e1eb848ab8e92ef67 100644 (file)
@@ -151,9 +151,9 @@ int debug_log(struct bat_priv *bat_priv, char *fmt, ...);
        }                                                       \
        while (0)
 #else /* !CONFIG_BATMAN_ADV_DEBUG */
-static inline void bat_dbg(char type __attribute__((unused)),
-                          struct bat_priv *bat_priv __attribute__((unused)),
-                          char *fmt __attribute__((unused)), ...)
+static inline void bat_dbg(char type __always_unused,
+                          struct bat_priv *bat_priv __always_unused,
+                          char *fmt __always_unused, ...)
 {
 }
 #endif
index b49fdf70a6d526d3700ed89c75651d02abccd921..2284e8129cb26b8d5554538cd71b7722deea3f13 100644 (file)
@@ -63,7 +63,7 @@ struct batman_packet {
        uint8_t  num_hna;
        uint8_t  gw_flags;  /* flags related to gateway class */
        uint8_t  align;
-} __attribute__((packed));
+} __packed;
 
 #define BAT_PACKET_LEN sizeof(struct batman_packet)
 
@@ -76,7 +76,7 @@ struct icmp_packet {
        uint8_t  orig[6];
        uint16_t seqno;
        uint8_t  uid;
-} __attribute__((packed));
+} __packed;
 
 #define BAT_RR_LEN 16
 
@@ -93,14 +93,14 @@ struct icmp_packet_rr {
        uint8_t  uid;
        uint8_t  rr_cur;
        uint8_t  rr[BAT_RR_LEN][ETH_ALEN];
-} __attribute__((packed));
+} __packed;
 
 struct unicast_packet {
        uint8_t  packet_type;
        uint8_t  version;  /* batman version field */
        uint8_t  dest[6];
        uint8_t  ttl;
-} __attribute__((packed));
+} __packed;
 
 struct unicast_frag_packet {
        uint8_t  packet_type;
@@ -110,7 +110,7 @@ struct unicast_frag_packet {
        uint8_t  flags;
        uint8_t  orig[6];
        uint16_t seqno;
-} __attribute__((packed));
+} __packed;
 
 struct bcast_packet {
        uint8_t  packet_type;
@@ -118,7 +118,7 @@ struct bcast_packet {
        uint8_t  orig[6];
        uint8_t  ttl;
        uint32_t seqno;
-} __attribute__((packed));
+} __packed;
 
 struct vis_packet {
        uint8_t  packet_type;
@@ -131,6 +131,6 @@ struct vis_packet {
                                  * neighbors */
        uint8_t  target_orig[6]; /* who should receive this packet */
        uint8_t  sender_orig[6]; /* who sent or rebroadcasted this packet */
-} __attribute__((packed));
+} __packed;
 
 #endif /* _NET_BATMAN_ADV_PACKET_H_ */
index 97cb23dd3e6921db1dd7fba220544ebe04553e75..bf3f6f5a12c4466c0ca86140650fe3d195d450ec 100644 (file)
@@ -246,13 +246,13 @@ struct vis_info {
        /* this packet might be part of the vis send queue. */
        struct sk_buff *skb_packet;
        /* vis_info may follow here*/
-} __attribute__((packed));
+} __packed;
 
 struct vis_info_entry {
        uint8_t  src[ETH_ALEN];
        uint8_t  dest[ETH_ALEN];
        uint8_t  quality;       /* quality = 0 means HNA */
-} __attribute__((packed));
+} __packed;
 
 struct recvlist_node {
        struct list_head list;
index dc2e28bed844a5dafe22a28e13f83572e57235d4..ee41fef04b21339868b9726e7f62cd79be741f13 100644 (file)
@@ -229,10 +229,12 @@ int frag_send_skb(struct sk_buff *skb, struct bat_priv *bat_priv,
        if (!bat_priv->primary_if)
                goto dropped;
 
-       unicast_packet = (struct unicast_packet *) skb->data;
+       frag_skb = dev_alloc_skb(data_len - (data_len / 2) + ucf_hdr_len);
+       if (!frag_skb)
+               goto dropped;
 
+       unicast_packet = (struct unicast_packet *) skb->data;
        memcpy(&tmp_uc, unicast_packet, uc_hdr_len);
-       frag_skb = dev_alloc_skb(data_len - (data_len / 2) + ucf_hdr_len);
        skb_split(skb, frag_skb, data_len / 2);
 
        if (my_skb_head_push(skb, ucf_hdr_len - uc_hdr_len) < 0 ||
index 21ede141018abf698a58bcf946e0058d6d06c499..c665de778b6026bdbcbea8696ca246f2647c9882 100644 (file)
@@ -191,6 +191,7 @@ int cfcnfg_disconn_adapt_layer(struct cfcnfg *cnfg, struct cflayer *adap_layer)
        struct cflayer *servl = NULL;
        struct cfcnfg_phyinfo *phyinfo = NULL;
        u8 phyid = 0;
+
        caif_assert(adap_layer != NULL);
        channel_id = adap_layer->id;
        if (adap_layer->dn == NULL || channel_id == 0) {
@@ -199,16 +200,16 @@ int cfcnfg_disconn_adapt_layer(struct cfcnfg *cnfg, struct cflayer *adap_layer)
                goto end;
        }
        servl = cfmuxl_remove_uplayer(cnfg->mux, channel_id);
-       if (servl == NULL)
-               goto end;
-       layer_set_up(servl, NULL);
-       ret = cfctrl_linkdown_req(cnfg->ctrl, channel_id, adap_layer);
        if (servl == NULL) {
                pr_err("PROTOCOL ERROR - Error removing service_layer Channel_Id(%d)",
                       channel_id);
                ret = -EINVAL;
                goto end;
        }
+       layer_set_up(servl, NULL);
+       ret = cfctrl_linkdown_req(cnfg->ctrl, channel_id, adap_layer);
+       if (ret)
+               goto end;
        caif_assert(channel_id == servl->id);
        if (adap_layer->dn != NULL) {
                phyid = cfsrvl_getphyid(adap_layer->dn);
index 9d5e8accfab1d73f25e8a00ae45523a400b820ce..092dc88a7c64c63856f91a32d4c5511471476eaa 100644 (file)
@@ -1256,6 +1256,9 @@ static int bcm_sendmsg(struct kiocb *iocb, struct socket *sock,
                struct sockaddr_can *addr =
                        (struct sockaddr_can *)msg->msg_name;
 
+               if (msg->msg_namelen < sizeof(*addr))
+                       return -EINVAL;
+
                if (addr->can_family != AF_CAN)
                        return -EINVAL;
 
index e88f610fdb7bb11e69cc1f5a0bf10846d5c7165c..883e9d74fddf6439b483f822b327371b78bb9670 100644 (file)
@@ -649,6 +649,9 @@ static int raw_sendmsg(struct kiocb *iocb, struct socket *sock,
                struct sockaddr_can *addr =
                        (struct sockaddr_can *)msg->msg_name;
 
+               if (msg->msg_namelen < sizeof(*addr))
+                       return -EINVAL;
+
                if (addr->can_family != AF_CAN)
                        return -EINVAL;
 
index 54277df0f735abf601a44053fa29c9f85cc5c87b..7c6a46f803724633e6539c81186f4ff955f0e297 100644 (file)
@@ -2001,7 +2001,7 @@ static bool can_checksum_protocol(unsigned long features, __be16 protocol)
 
 static int harmonize_features(struct sk_buff *skb, __be16 protocol, int features)
 {
-       if (!can_checksum_protocol(protocol, features)) {
+       if (!can_checksum_protocol(features, protocol)) {
                features &= ~NETIF_F_ALL_CSUM;
                features &= ~NETIF_F_SG;
        } else if (illegal_highdma(skb->dev, skb)) {
@@ -2023,13 +2023,13 @@ int netif_skb_features(struct sk_buff *skb)
                return harmonize_features(skb, protocol, features);
        }
 
-       features &= skb->dev->vlan_features;
+       features &= (skb->dev->vlan_features | NETIF_F_HW_VLAN_TX);
 
        if (protocol != htons(ETH_P_8021Q)) {
                return harmonize_features(skb, protocol, features);
        } else {
                features &= NETIF_F_SG | NETIF_F_HIGHDMA | NETIF_F_FRAGLIST |
-                               NETIF_F_GEN_CSUM;
+                               NETIF_F_GEN_CSUM | NETIF_F_HW_VLAN_TX;
                return harmonize_features(skb, protocol, features);
        }
 }
index a5f7535aab5b80798d20d278689872e08c2b4b3f..750db57f3bb3e628b44a481c11eea954d21ce88d 100644 (file)
@@ -1820,7 +1820,7 @@ static int rtnetlink_rcv_msg(struct sk_buff *skb, struct nlmsghdr *nlh)
        if (kind != 2 && security_netlink_recv(skb, CAP_NET_ADMIN))
                return -EPERM;
 
-       if (kind == 2 && (nlh->nlmsg_flags & NLM_F_DUMP) == NLM_F_DUMP) {
+       if (kind == 2 && nlh->nlmsg_flags&NLM_F_DUMP) {
                struct sock *rtnl;
                rtnl_dumpit_func dumpit;
 
index 0c877a74e1f433699272953712458393045ff13c..3fb14b7c13cf1ed3bc5bb1439e6bfc35f907af96 100644 (file)
@@ -428,7 +428,7 @@ static void __exit dsa_cleanup_module(void)
 }
 module_exit(dsa_cleanup_module);
 
-MODULE_AUTHOR("Lennert Buytenhek <buytenh@wantstofly.org>")
+MODULE_AUTHOR("Lennert Buytenhek <buytenh@wantstofly.org>");
 MODULE_DESCRIPTION("Driver for Distributed Switch Architecture switch chips");
 MODULE_LICENSE("GPL");
 MODULE_ALIAS("platform:dsa");
index 2746c1fa6417b73af42bfe40206405e456a176ac..2ada17129fce6ac9a7285f6033e30d0a9bc4b98a 100644 (file)
@@ -858,7 +858,7 @@ static int inet_diag_rcv_msg(struct sk_buff *skb, struct nlmsghdr *nlh)
            nlmsg_len(nlh) < hdrlen)
                return -EINVAL;
 
-       if ((nlh->nlmsg_flags & NLM_F_DUMP) == NLM_F_DUMP) {
+       if (nlh->nlmsg_flags & NLM_F_DUMP) {
                if (nlmsg_attrlen(nlh, hdrlen)) {
                        struct nlattr *attr;
 
index 5b189c97c2fc16d28961955673c1fa94f3df21ad..24a1cf110d8058f11771e77f9a3430d8e0972371 100644 (file)
@@ -420,9 +420,6 @@ static struct inet6_dev * ipv6_add_dev(struct net_device *dev)
            dev->type == ARPHRD_TUNNEL6 ||
            dev->type == ARPHRD_SIT ||
            dev->type == ARPHRD_NONE) {
-               printk(KERN_INFO
-                      "%s: Disabled Privacy Extensions\n",
-                      dev->name);
                ndev->cnf.use_tempaddr = -1;
        } else {
                in6_dev_hold(ndev);
index 9109262abd24ccb44946d1e34edd086db60cec20..c766056d0488eb2826def69d7ba9e923e171304f 100644 (file)
@@ -20,7 +20,7 @@ config MAC80211_HAS_RC
        def_bool n
 
 config MAC80211_RC_PID
-       bool "PID controller based rate control algorithm" if EMBEDDED
+       bool "PID controller based rate control algorithm" if EXPERT
        select MAC80211_HAS_RC
        ---help---
          This option enables a TX rate control algorithm for
@@ -28,14 +28,14 @@ config MAC80211_RC_PID
          rate.
 
 config MAC80211_RC_MINSTREL
-       bool "Minstrel" if EMBEDDED
+       bool "Minstrel" if EXPERT
        select MAC80211_HAS_RC
        default y
        ---help---
          This option enables the 'minstrel' TX rate control algorithm
 
 config MAC80211_RC_MINSTREL_HT
-       bool "Minstrel 802.11n support" if EMBEDDED
+       bool "Minstrel 802.11n support" if EXPERT
        depends on MAC80211_RC_MINSTREL
        default y
        ---help---
index f138b195d657cf038ad68fde631fb5caebbeccf7..227ca82eef72178253b3f4adf831ce5ae297dd28 100644 (file)
@@ -185,8 +185,6 @@ void ieee80211_process_addba_request(struct ieee80211_local *local,
                                     struct ieee80211_mgmt *mgmt,
                                     size_t len)
 {
-       struct ieee80211_hw *hw = &local->hw;
-       struct ieee80211_conf *conf = &hw->conf;
        struct tid_ampdu_rx *tid_agg_rx;
        u16 capab, tid, timeout, ba_policy, buf_size, start_seq_num, status;
        u8 dialog_token;
@@ -231,13 +229,8 @@ void ieee80211_process_addba_request(struct ieee80211_local *local,
                goto end_no_lock;
        }
        /* determine default buffer size */
-       if (buf_size == 0) {
-               struct ieee80211_supported_band *sband;
-
-               sband = local->hw.wiphy->bands[conf->channel->band];
-               buf_size = IEEE80211_MIN_AMPDU_BUF;
-               buf_size = buf_size << sband->ht_cap.ampdu_factor;
-       }
+       if (buf_size == 0)
+               buf_size = IEEE80211_MAX_AMPDU_BUF;
 
 
        /* examine state machine */
index 485d36bc9a460bdd9a67ab63a1b5ce1f12d53c54..a46ff06d7cb8ce9d8e31fd593555925c9aa07500 100644 (file)
@@ -39,6 +39,8 @@ module_param(ieee80211_disable_40mhz_24ghz, bool, 0644);
 MODULE_PARM_DESC(ieee80211_disable_40mhz_24ghz,
                 "Disable 40MHz support in the 2.4GHz band");
 
+static struct lock_class_key ieee80211_rx_skb_queue_class;
+
 void ieee80211_configure_filter(struct ieee80211_local *local)
 {
        u64 mc;
@@ -569,7 +571,15 @@ struct ieee80211_hw *ieee80211_alloc_hw(size_t priv_data_len,
        spin_lock_init(&local->filter_lock);
        spin_lock_init(&local->queue_stop_reason_lock);
 
-       skb_queue_head_init(&local->rx_skb_queue);
+       /*
+        * The rx_skb_queue is only accessed from tasklets,
+        * but other SKB queues are used from within IRQ
+        * context. Therefore, this one needs a different
+        * locking class so our direct, non-irq-safe use of
+        * the queue's lock doesn't throw lockdep warnings.
+        */
+       skb_queue_head_init_class(&local->rx_skb_queue,
+                                 &ieee80211_rx_skb_queue_class);
 
        INIT_DELAYED_WORK(&local->scan_work, ieee80211_scan_work);
 
index 2b7eef37875ccbdd8c59c5f8d845746e9f9609d7..93297aaceb2b3d48e307bfb74549661bfaeda27f 100644 (file)
@@ -924,7 +924,7 @@ ctnetlink_get_conntrack(struct sock *ctnl, struct sk_buff *skb,
        u16 zone;
        int err;
 
-       if ((nlh->nlmsg_flags & NLM_F_DUMP) == NLM_F_DUMP)
+       if (nlh->nlmsg_flags & NLM_F_DUMP)
                return netlink_dump_start(ctnl, skb, nlh, ctnetlink_dump_table,
                                          ctnetlink_done);
 
@@ -1787,7 +1787,7 @@ ctnetlink_get_expect(struct sock *ctnl, struct sk_buff *skb,
        u16 zone;
        int err;
 
-       if ((nlh->nlmsg_flags & NLM_F_DUMP) == NLM_F_DUMP) {
+       if (nlh->nlmsg_flags & NLM_F_DUMP) {
                return netlink_dump_start(ctnl, skb, nlh,
                                          ctnetlink_exp_dump_table,
                                          ctnetlink_exp_done);
index f83cb370292b3b87a9610488e57ac8bef8f4b731..1781d99145e2d2594fc961e1a2fc9307aad957a5 100644 (file)
@@ -519,7 +519,7 @@ static int genl_rcv_msg(struct sk_buff *skb, struct nlmsghdr *nlh)
            security_netlink_recv(skb, CAP_NET_ADMIN))
                return -EPERM;
 
-       if ((nlh->nlmsg_flags & NLM_F_DUMP) == NLM_F_DUMP) {
+       if (nlh->nlmsg_flags & NLM_F_DUMP) {
                if (ops->dumpit == NULL)
                        return -EOPNOTSUPP;
 
index eaf765876458f3a89e5a26af5d5ac3b09c556161..7fce6dfd2180af0ecaed0d3e82bb7afcc604001a 100644 (file)
@@ -18,7 +18,7 @@ config RFKILL_LEDS
        default y
 
 config RFKILL_INPUT
-       bool "RF switch input support" if EMBEDDED
+       bool "RF switch input support" if EXPERT
        depends on RFKILL
        depends on INPUT = y || RFKILL = INPUT
-       default y if !EMBEDDED
+       default y if !EXPERT
index a09b0dd25f5061505a2cb2bbfbe3d9e9d091f3e8..8e02550ff3e88d9153a0d610dbdadb864ae06da7 100644 (file)
@@ -3428,7 +3428,7 @@ SCTP_STATIC int sctp_setsockopt(struct sock *sk, int level, int optname,
                retval = sctp_setsockopt_peer_addr_params(sk, optval, optlen);
                break;
 
-       case SCTP_DELAYED_ACK:
+       case SCTP_DELAYED_SACK:
                retval = sctp_setsockopt_delayed_ack(sk, optval, optlen);
                break;
        case SCTP_PARTIAL_DELIVERY_POINT:
@@ -5333,7 +5333,7 @@ SCTP_STATIC int sctp_getsockopt(struct sock *sk, int level, int optname,
                retval = sctp_getsockopt_peer_addr_params(sk, len, optval,
                                                          optlen);
                break;
-       case SCTP_DELAYED_ACK:
+       case SCTP_DELAYED_SACK:
                retval = sctp_getsockopt_delayed_ack(sk, len, optval,
                                                          optlen);
                break;
index d0ee29063e5d80190412672552a5b2cfe4886c74..1f1ef70f34f2d2852a6007b0444ac5cd14fb7f4a 100644 (file)
@@ -95,7 +95,7 @@ config CFG80211_DEBUGFS
          If unsure, say N.
 
 config CFG80211_INTERNAL_REGDB
-       bool "use statically compiled regulatory rules database" if EMBEDDED
+       bool "use statically compiled regulatory rules database" if EXPERT
        default n
        depends on CFG80211
        ---help---
index d5e1e0b08890fa2022b7fa309cb0e3600e1908ae..61291965c5f60a0354ee499f664df340845bc9e7 100644 (file)
@@ -2189,7 +2189,7 @@ static int xfrm_user_rcv_msg(struct sk_buff *skb, struct nlmsghdr *nlh)
 
        if ((type == (XFRM_MSG_GETSA - XFRM_MSG_BASE) ||
             type == (XFRM_MSG_GETPOLICY - XFRM_MSG_BASE)) &&
-           (nlh->nlmsg_flags & NLM_F_DUMP) == NLM_F_DUMP) {
+           (nlh->nlmsg_flags & NLM_F_DUMP)) {
                if (link->dump == NULL)
                        return -EINVAL;
 
index 6c941050f5734d79354e657d0aec167d50923276..1bf090a885feed4791cab9b8a6947bde347f868e 100644 (file)
@@ -13,8 +13,8 @@ obj-y := \
        request_key_auth.o \
        user_defined.o
 
-obj-$(CONFIG_TRUSTED_KEYS) += trusted_defined.o
-obj-$(CONFIG_ENCRYPTED_KEYS) += encrypted_defined.o
+obj-$(CONFIG_TRUSTED_KEYS) += trusted.o
+obj-$(CONFIG_ENCRYPTED_KEYS) += encrypted.o
 obj-$(CONFIG_KEYS_COMPAT) += compat.o
 obj-$(CONFIG_PROC_FS) += proc.o
 obj-$(CONFIG_SYSCTL) += sysctl.o
index 792c0a611a6d115a5a272ca748af6c1804c762ef..07a5f35e39705bef3856d9605c4f96c65670b3c9 100644 (file)
@@ -1,4 +1,4 @@
-/* compat.c: 32-bit compatibility syscall for 64-bit systems
+/* 32-bit compatibility syscall for 64-bit systems
  *
  * Copyright (C) 2004-5 Red Hat, Inc. All Rights Reserved.
  * Written by David Howells (dhowells@redhat.com)
 #include <linux/compat.h>
 #include "internal.h"
 
-/*****************************************************************************/
 /*
- * the key control system call, 32-bit compatibility version for 64-bit archs
- * - this should only be called if the 64-bit arch uses weird pointers in
- *   32-bit mode or doesn't guarantee that the top 32-bits of the argument
- *   registers on taking a 32-bit syscall are zero
- * - if you can, you should call sys_keyctl directly
+ * The key control system call, 32-bit compatibility version for 64-bit archs
+ *
+ * This should only be called if the 64-bit arch uses weird pointers in 32-bit
+ * mode or doesn't guarantee that the top 32-bits of the argument registers on
+ * taking a 32-bit syscall are zero.  If you can, you should call sys_keyctl()
+ * directly.
  */
 asmlinkage long compat_sys_keyctl(u32 option,
                                  u32 arg2, u32 arg3, u32 arg4, u32 arg5)
@@ -88,5 +88,4 @@ asmlinkage long compat_sys_keyctl(u32 option,
        default:
                return -EOPNOTSUPP;
        }
-
-} /* end compat_sys_keyctl() */
+}
similarity index 99%
rename from security/keys/encrypted_defined.c
rename to security/keys/encrypted.c
index 32d27c85838842569b5da0968a9ac8bbc6e4dc0e..9e7e4ce3fae820ec55cd64d9932ba1559372cb36 100644 (file)
@@ -30,7 +30,7 @@
 #include <crypto/sha.h>
 #include <crypto/aes.h>
 
-#include "encrypted_defined.h"
+#include "encrypted.h"
 
 static const char KEY_TRUSTED_PREFIX[] = "trusted:";
 static const char KEY_USER_PREFIX[] = "user:";
index a46e825cbf0265311288115453ee25227baa28e4..89df6b5f203c534c64fffd3fc0547f611dedebea 100644 (file)
@@ -32,8 +32,8 @@ static time_t key_gc_next_run = LONG_MAX;
 static time_t key_gc_new_timer;
 
 /*
- * Schedule a garbage collection run
- * - precision isn't particularly important
+ * Schedule a garbage collection run.
+ * - time precision isn't particularly important
  */
 void key_schedule_gc(time_t gc_at)
 {
@@ -61,8 +61,9 @@ static void key_gc_timer_func(unsigned long data)
 }
 
 /*
- * Garbage collect pointers from a keyring
- * - return true if we altered the keyring
+ * Garbage collect pointers from a keyring.
+ *
+ * Return true if we altered the keyring.
  */
 static bool key_gc_keyring(struct key *keyring, time_t limit)
        __releases(key_serial_lock)
@@ -107,9 +108,8 @@ do_gc:
 }
 
 /*
- * Garbage collector for keys
- * - this involves scanning the keyrings for dead, expired and revoked keys
- *   that have overstayed their welcome
+ * Garbage collector for keys.  This involves scanning the keyrings for dead,
+ * expired and revoked keys that have overstayed their welcome
  */
 static void key_garbage_collector(struct work_struct *work)
 {
index 56a133d8f37d192ffb1adbc45cad9610f5cbbc5b..edfa50dbd6f575c2b5018aac543c0117208b040e 100644 (file)
@@ -1,4 +1,4 @@
-/* internal.h: authentication token and access key management internal defs
+/* Authentication token and access key management internal defs
  *
  * Copyright (C) 2003-5, 2007 Red Hat, Inc. All Rights Reserved.
  * Written by David Howells (dhowells@redhat.com)
@@ -35,10 +35,12 @@ extern struct key_type key_type_user;
 
 /*****************************************************************************/
 /*
- * keep track of keys for a user
- * - this needs to be separate to user_struct to avoid a refcount-loop
- *   (user_struct pins some keyrings which pin this struct)
- * - this also keeps track of keys under request from userspace for this UID
+ * Keep track of keys for a user.
+ *
+ * This needs to be separate to user_struct to avoid a refcount-loop
+ * (user_struct pins some keyrings which pin this struct).
+ *
+ * We also keep track of keys under request from userspace for this UID here.
  */
 struct key_user {
        struct rb_node          node;
@@ -62,7 +64,7 @@ extern struct key_user *key_user_lookup(uid_t uid,
 extern void key_user_put(struct key_user *user);
 
 /*
- * key quota limits
+ * Key quota limits.
  * - root has its own separate limits to everyone else
  */
 extern unsigned key_quota_root_maxkeys;
@@ -146,13 +148,13 @@ extern unsigned key_gc_delay;
 extern void keyring_gc(struct key *keyring, time_t limit);
 extern void key_schedule_gc(time_t expiry_at);
 
-/*
- * check to see whether permission is granted to use a key in the desired way
- */
 extern int key_task_permission(const key_ref_t key_ref,
                               const struct cred *cred,
                               key_perm_t perm);
 
+/*
+ * Check to see whether permission is granted to use a key in the desired way.
+ */
 static inline int key_permission(const key_ref_t key_ref, key_perm_t perm)
 {
        return key_task_permission(key_ref, current_cred(), perm);
@@ -168,7 +170,7 @@ static inline int key_permission(const key_ref_t key_ref, key_perm_t perm)
 #define        KEY_ALL         0x3f    /* all the above permissions */
 
 /*
- * request_key authorisation
+ * Authorisation record for request_key().
  */
 struct request_key_auth {
        struct key              *target_key;
@@ -188,7 +190,7 @@ extern struct key *request_key_auth_new(struct key *target,
 extern struct key *key_get_instantiation_authkey(key_serial_t target_id);
 
 /*
- * keyctl functions
+ * keyctl() functions
  */
 extern long keyctl_get_keyring_ID(key_serial_t, int);
 extern long keyctl_join_session_keyring(const char __user *);
@@ -214,7 +216,7 @@ extern long keyctl_get_security(key_serial_t keyid, char __user *buffer,
 extern long keyctl_session_to_parent(void);
 
 /*
- * debugging key validation
+ * Debugging key validation
  */
 #ifdef KEY_DEBUGGING
 extern void __key_check(const struct key *);
index c1eac8084ade445e06a38ff908dc95c207089781..84d4eb568b087873d918dafa905b30576e850a73 100644 (file)
@@ -39,10 +39,10 @@ static DECLARE_RWSEM(key_types_sem);
 static void key_cleanup(struct work_struct *work);
 static DECLARE_WORK(key_cleanup_task, key_cleanup);
 
-/* we serialise key instantiation and link */
+/* We serialise key instantiation and link */
 DEFINE_MUTEX(key_construction_mutex);
 
-/* any key who's type gets unegistered will be re-typed to this */
+/* Any key who's type gets unegistered will be re-typed to this */
 static struct key_type key_type_dead = {
        .name           = "dead",
 };
@@ -56,10 +56,9 @@ void __key_check(const struct key *key)
 }
 #endif
 
-/*****************************************************************************/
 /*
- * get the key quota record for a user, allocating a new record if one doesn't
- * already exist
+ * Get the key quota record for a user, allocating a new record if one doesn't
+ * already exist.
  */
 struct key_user *key_user_lookup(uid_t uid, struct user_namespace *user_ns)
 {
@@ -67,7 +66,7 @@ struct key_user *key_user_lookup(uid_t uid, struct user_namespace *user_ns)
        struct rb_node *parent = NULL;
        struct rb_node **p;
 
- try_again:
+try_again:
        p = &key_user_tree.rb_node;
        spin_lock(&key_user_lock);
 
@@ -124,18 +123,16 @@ struct key_user *key_user_lookup(uid_t uid, struct user_namespace *user_ns)
        goto out;
 
        /* okay - we found a user record for this UID */
- found:
+found:
        atomic_inc(&user->usage);
        spin_unlock(&key_user_lock);
        kfree(candidate);
- out:
+out:
        return user;
+}
 
-} /* end key_user_lookup() */
-
-/*****************************************************************************/
 /*
- * dispose of a user structure
+ * Dispose of a user structure
  */
 void key_user_put(struct key_user *user)
 {
@@ -146,14 +143,11 @@ void key_user_put(struct key_user *user)
 
                kfree(user);
        }
+}
 
-} /* end key_user_put() */
-
-/*****************************************************************************/
 /*
- * assign a key the next unique serial number
- * - these are assigned randomly to avoid security issues through covert
- *   channel problems
+ * Allocate a serial number for a key.  These are assigned randomly to avoid
+ * security issues through covert channel problems.
  */
 static inline void key_alloc_serial(struct key *key)
 {
@@ -211,18 +205,36 @@ serial_exists:
                if (key->serial < xkey->serial)
                        goto attempt_insertion;
        }
+}
 
-} /* end key_alloc_serial() */
-
-/*****************************************************************************/
-/*
- * allocate a key of the specified type
- * - update the user's quota to reflect the existence of the key
- * - called from a key-type operation with key_types_sem read-locked by
- *   key_create_or_update()
- *   - this prevents unregistration of the key type
- * - upon return the key is as yet uninstantiated; the caller needs to either
- *   instantiate the key or discard it before returning
+/**
+ * key_alloc - Allocate a key of the specified type.
+ * @type: The type of key to allocate.
+ * @desc: The key description to allow the key to be searched out.
+ * @uid: The owner of the new key.
+ * @gid: The group ID for the new key's group permissions.
+ * @cred: The credentials specifying UID namespace.
+ * @perm: The permissions mask of the new key.
+ * @flags: Flags specifying quota properties.
+ *
+ * Allocate a key of the specified type with the attributes given.  The key is
+ * returned in an uninstantiated state and the caller needs to instantiate the
+ * key before returning.
+ *
+ * The user's key count quota is updated to reflect the creation of the key and
+ * the user's key data quota has the default for the key type reserved.  The
+ * instantiation function should amend this as necessary.  If insufficient
+ * quota is available, -EDQUOT will be returned.
+ *
+ * The LSM security modules can prevent a key being created, in which case
+ * -EACCES will be returned.
+ *
+ * Returns a pointer to the new key if successful and an error code otherwise.
+ *
+ * Note that the caller needs to ensure the key type isn't uninstantiated.
+ * Internally this can be done by locking key_types_sem.  Externally, this can
+ * be done by either never unregistering the key type, or making sure
+ * key_alloc() calls don't race with module unloading.
  */
 struct key *key_alloc(struct key_type *type, const char *desc,
                      uid_t uid, gid_t gid, const struct cred *cred,
@@ -344,14 +356,19 @@ no_quota:
        key_user_put(user);
        key = ERR_PTR(-EDQUOT);
        goto error;
-
-} /* end key_alloc() */
-
+}
 EXPORT_SYMBOL(key_alloc);
 
-/*****************************************************************************/
-/*
- * reserve an amount of quota for the key's payload
+/**
+ * key_payload_reserve - Adjust data quota reservation for the key's payload
+ * @key: The key to make the reservation for.
+ * @datalen: The amount of data payload the caller now wants.
+ *
+ * Adjust the amount of the owning user's key data quota that a key reserves.
+ * If the amount is increased, then -EDQUOT may be returned if there isn't
+ * enough free quota available.
+ *
+ * If successful, 0 is returned.
  */
 int key_payload_reserve(struct key *key, size_t datalen)
 {
@@ -384,15 +401,14 @@ int key_payload_reserve(struct key *key, size_t datalen)
                key->datalen = datalen;
 
        return ret;
-
-} /* end key_payload_reserve() */
-
+}
 EXPORT_SYMBOL(key_payload_reserve);
 
-/*****************************************************************************/
 /*
- * instantiate a key and link it into the target keyring atomically
- * - called with the target keyring's semaphore writelocked
+ * Instantiate a key and link it into the target keyring atomically.  Must be
+ * called with the target keyring's semaphore writelocked.  The target key's
+ * semaphore need not be locked as instantiation is serialised by
+ * key_construction_mutex.
  */
 static int __key_instantiate_and_link(struct key *key,
                                      const void *data,
@@ -441,12 +457,23 @@ static int __key_instantiate_and_link(struct key *key,
                wake_up_bit(&key->flags, KEY_FLAG_USER_CONSTRUCT);
 
        return ret;
+}
 
-} /* end __key_instantiate_and_link() */
-
-/*****************************************************************************/
-/*
- * instantiate a key and link it into the target keyring atomically
+/**
+ * key_instantiate_and_link - Instantiate a key and link it into the keyring.
+ * @key: The key to instantiate.
+ * @data: The data to use to instantiate the keyring.
+ * @datalen: The length of @data.
+ * @keyring: Keyring to create a link in on success (or NULL).
+ * @authkey: The authorisation token permitting instantiation.
+ *
+ * Instantiate a key that's in the uninstantiated state using the provided data
+ * and, if successful, link it in to the destination keyring if one is
+ * supplied.
+ *
+ * If successful, 0 is returned, the authorisation token is revoked and anyone
+ * waiting for the key is woken up.  If the key was already instantiated,
+ * -EBUSY will be returned.
  */
 int key_instantiate_and_link(struct key *key,
                             const void *data,
@@ -471,14 +498,28 @@ int key_instantiate_and_link(struct key *key,
                __key_link_end(keyring, key->type, prealloc);
 
        return ret;
-
-} /* end key_instantiate_and_link() */
+}
 
 EXPORT_SYMBOL(key_instantiate_and_link);
 
-/*****************************************************************************/
-/*
- * negatively instantiate a key and link it into the target keyring atomically
+/**
+ * key_negate_and_link - Negatively instantiate a key and link it into the keyring.
+ * @key: The key to instantiate.
+ * @timeout: The timeout on the negative key.
+ * @keyring: Keyring to create a link in on success (or NULL).
+ * @authkey: The authorisation token permitting instantiation.
+ *
+ * Negatively instantiate a key that's in the uninstantiated state and, if
+ * successful, set its timeout and link it in to the destination keyring if one
+ * is supplied.  The key and any links to the key will be automatically garbage
+ * collected after the timeout expires.
+ *
+ * Negative keys are used to rate limit repeated request_key() calls by causing
+ * them to return -ENOKEY until the negative key expires.
+ *
+ * If successful, 0 is returned, the authorisation token is revoked and anyone
+ * waiting for the key is woken up.  If the key was already instantiated,
+ * -EBUSY will be returned.
  */
 int key_negate_and_link(struct key *key,
                        unsigned timeout,
@@ -535,22 +576,23 @@ int key_negate_and_link(struct key *key,
                wake_up_bit(&key->flags, KEY_FLAG_USER_CONSTRUCT);
 
        return ret == 0 ? link_ret : ret;
-
-} /* end key_negate_and_link() */
+}
 
 EXPORT_SYMBOL(key_negate_and_link);
 
-/*****************************************************************************/
 /*
- * do cleaning up in process context so that we don't have to disable
- * interrupts all over the place
+ * Garbage collect keys in process context so that we don't have to disable
+ * interrupts all over the place.
+ *
+ * key_put() schedules this rather than trying to do the cleanup itself, which
+ * means key_put() doesn't have to sleep.
  */
 static void key_cleanup(struct work_struct *work)
 {
        struct rb_node *_n;
        struct key *key;
 
- go_again:
+go_again:
        /* look for a dead key in the tree */
        spin_lock(&key_serial_lock);
 
@@ -564,7 +606,7 @@ static void key_cleanup(struct work_struct *work)
        spin_unlock(&key_serial_lock);
        return;
 
- found_dead_key:
+found_dead_key:
        /* we found a dead key - once we've removed it from the tree, we can
         * drop the lock */
        rb_erase(&key->serial_node, &key_serial_tree);
@@ -601,14 +643,15 @@ static void key_cleanup(struct work_struct *work)
 
        /* there may, of course, be more than one key to destroy */
        goto go_again;
+}
 
-} /* end key_cleanup() */
-
-/*****************************************************************************/
-/*
- * dispose of a reference to a key
- * - when all the references are gone, we schedule the cleanup task to come and
- *   pull it out of the tree in definite process context
+/**
+ * key_put - Discard a reference to a key.
+ * @key: The key to discard a reference from.
+ *
+ * Discard a reference to a key, and when all the references are gone, we
+ * schedule the cleanup task to come and pull it out of the tree in process
+ * context at some later time.
  */
 void key_put(struct key *key)
 {
@@ -618,14 +661,11 @@ void key_put(struct key *key)
                if (atomic_dec_and_test(&key->usage))
                        schedule_work(&key_cleanup_task);
        }
-
-} /* end key_put() */
-
+}
 EXPORT_SYMBOL(key_put);
 
-/*****************************************************************************/
 /*
- * find a key by its serial number
+ * Find a key by its serial number.
  */
 struct key *key_lookup(key_serial_t id)
 {
@@ -647,11 +687,11 @@ struct key *key_lookup(key_serial_t id)
                        goto found;
        }
 
- not_found:
+not_found:
        key = ERR_PTR(-ENOKEY);
        goto error;
 
- found:
+found:
        /* pretend it doesn't exist if it is awaiting deletion */
        if (atomic_read(&key->usage) == 0)
                goto not_found;
@@ -661,16 +701,16 @@ struct key *key_lookup(key_serial_t id)
         */
        atomic_inc(&key->usage);
 
- error:
+error:
        spin_unlock(&key_serial_lock);
        return key;
+}
 
-} /* end key_lookup() */
-
-/*****************************************************************************/
 /*
- * find and lock the specified key type against removal
- * - we return with the sem readlocked
+ * Find and lock the specified key type against removal.
+ *
+ * We return with the sem read-locked if successful.  If the type wasn't
+ * available -ENOKEY is returned instead.
  */
 struct key_type *key_type_lookup(const char *type)
 {
@@ -688,26 +728,23 @@ struct key_type *key_type_lookup(const char *type)
        up_read(&key_types_sem);
        ktype = ERR_PTR(-ENOKEY);
 
- found_kernel_type:
+found_kernel_type:
        return ktype;
+}
 
-} /* end key_type_lookup() */
-
-/*****************************************************************************/
 /*
- * unlock a key type
+ * Unlock a key type locked by key_type_lookup().
  */
 void key_type_put(struct key_type *ktype)
 {
        up_read(&key_types_sem);
+}
 
-} /* end key_type_put() */
-
-/*****************************************************************************/
 /*
- * attempt to update an existing key
- * - the key has an incremented refcount
- * - we need to put the key if we get an error
+ * Attempt to update an existing key.
+ *
+ * The key is given to us with an incremented refcount that we need to discard
+ * if we get an error.
  */
 static inline key_ref_t __key_update(key_ref_t key_ref,
                                     const void *payload, size_t plen)
@@ -742,13 +779,32 @@ error:
        key_put(key);
        key_ref = ERR_PTR(ret);
        goto out;
+}
 
-} /* end __key_update() */
-
-/*****************************************************************************/
-/*
- * search the specified keyring for a key of the same description; if one is
- * found, update it, otherwise add a new one
+/**
+ * key_create_or_update - Update or create and instantiate a key.
+ * @keyring_ref: A pointer to the destination keyring with possession flag.
+ * @type: The type of key.
+ * @description: The searchable description for the key.
+ * @payload: The data to use to instantiate or update the key.
+ * @plen: The length of @payload.
+ * @perm: The permissions mask for a new key.
+ * @flags: The quota flags for a new key.
+ *
+ * Search the destination keyring for a key of the same description and if one
+ * is found, update it, otherwise create and instantiate a new one and create a
+ * link to it from that keyring.
+ *
+ * If perm is KEY_PERM_UNDEF then an appropriate key permissions mask will be
+ * concocted.
+ *
+ * Returns a pointer to the new key if successful, -ENODEV if the key type
+ * wasn't available, -ENOTDIR if the keyring wasn't a keyring, -EACCES if the
+ * caller isn't permitted to modify the keyring or the LSM did not permit
+ * creation of the key.
+ *
+ * On success, the possession flag from the keyring ref will be tacked on to
+ * the key ref before it is returned.
  */
 key_ref_t key_create_or_update(key_ref_t keyring_ref,
                               const char *type,
@@ -855,14 +911,21 @@ key_ref_t key_create_or_update(key_ref_t keyring_ref,
 
        key_ref = __key_update(key_ref, payload, plen);
        goto error;
-
-} /* end key_create_or_update() */
-
+}
 EXPORT_SYMBOL(key_create_or_update);
 
-/*****************************************************************************/
-/*
- * update a key
+/**
+ * key_update - Update a key's contents.
+ * @key_ref: The pointer (plus possession flag) to the key.
+ * @payload: The data to be used to update the key.
+ * @plen: The length of @payload.
+ *
+ * Attempt to update the contents of a key with the given payload data.  The
+ * caller must be granted Write permission on the key.  Negative keys can be
+ * instantiated by this method.
+ *
+ * Returns 0 on success, -EACCES if not permitted and -EOPNOTSUPP if the key
+ * type does not support updating.  The key type may return other errors.
  */
 int key_update(key_ref_t key_ref, const void *payload, size_t plen)
 {
@@ -891,14 +954,17 @@ int key_update(key_ref_t key_ref, const void *payload, size_t plen)
 
  error:
        return ret;
-
-} /* end key_update() */
-
+}
 EXPORT_SYMBOL(key_update);
 
-/*****************************************************************************/
-/*
- * revoke a key
+/**
+ * key_revoke - Revoke a key.
+ * @key: The key to be revoked.
+ *
+ * Mark a key as being revoked and ask the type to free up its resources.  The
+ * revocation timeout is set and the key and all its links will be
+ * automatically garbage collected after key_gc_delay amount of time if they
+ * are not manually dealt with first.
  */
 void key_revoke(struct key *key)
 {
@@ -926,14 +992,16 @@ void key_revoke(struct key *key)
        }
 
        up_write(&key->sem);
-
-} /* end key_revoke() */
-
+}
 EXPORT_SYMBOL(key_revoke);
 
-/*****************************************************************************/
-/*
- * register a type of key
+/**
+ * register_key_type - Register a type of key.
+ * @ktype: The new key type.
+ *
+ * Register a new key type.
+ *
+ * Returns 0 on success or -EEXIST if a type of this name already exists.
  */
 int register_key_type(struct key_type *ktype)
 {
@@ -953,17 +1021,19 @@ int register_key_type(struct key_type *ktype)
        list_add(&ktype->link, &key_types_list);
        ret = 0;
 
- out:
+out:
        up_write(&key_types_sem);
        return ret;
-
-} /* end register_key_type() */
-
+}
 EXPORT_SYMBOL(register_key_type);
 
-/*****************************************************************************/
-/*
- * unregister a type of key
+/**
+ * unregister_key_type - Unregister a type of key.
+ * @ktype: The key type.
+ *
+ * Unregister a key type and mark all the extant keys of this type as dead.
+ * Those keys of this type are then destroyed to get rid of their payloads and
+ * they and their links will be garbage collected as soon as possible.
  */
 void unregister_key_type(struct key_type *ktype)
 {
@@ -1010,14 +1080,11 @@ void unregister_key_type(struct key_type *ktype)
        up_write(&key_types_sem);
 
        key_schedule_gc(0);
-
-} /* end unregister_key_type() */
-
+}
 EXPORT_SYMBOL(unregister_key_type);
 
-/*****************************************************************************/
 /*
- * initialise the key management stuff
+ * Initialise the key management state.
  */
 void __init key_init(void)
 {
@@ -1037,5 +1104,4 @@ void __init key_init(void)
 
        rb_insert_color(&root_key_user.node,
                        &key_user_tree);
-
-} /* end key_init() */
+}
index 60924f6a52db2bbff40ddc953a50bb9d708febb5..31a0fd8189f1f85835ca1b7e4e99e093c178c1d5 100644 (file)
@@ -1,4 +1,4 @@
-/* keyctl.c: userspace keyctl operations
+/* Userspace key control operations
  *
  * Copyright (C) 2004-5 Red Hat, Inc. All Rights Reserved.
  * Written by David Howells (dhowells@redhat.com)
@@ -31,28 +31,24 @@ static int key_get_type_from_user(char *type,
        int ret;
 
        ret = strncpy_from_user(type, _type, len);
-
        if (ret < 0)
                return ret;
-
        if (ret == 0 || ret >= len)
                return -EINVAL;
-
        if (type[0] == '.')
                return -EPERM;
-
        type[len - 1] = '\0';
-
        return 0;
 }
 
-/*****************************************************************************/
 /*
- * extract the description of a new key from userspace and either add it as a
- * new key to the specified keyring or update a matching key in that keyring
- * - the keyring must be writable
- * - returns the new key's serial number
- * - implements add_key()
+ * Extract the description of a new key from userspace and either add it as a
+ * new key to the specified keyring or update a matching key in that keyring.
+ *
+ * The keyring must be writable so that we can attach the key to it.
+ *
+ * If successful, the new key's serial number is returned, otherwise an error
+ * code is returned.
  */
 SYSCALL_DEFINE5(add_key, const char __user *, _type,
                const char __user *, _description,
@@ -132,19 +128,20 @@ SYSCALL_DEFINE5(add_key, const char __user *, _type,
        kfree(description);
  error:
        return ret;
+}
 
-} /* end sys_add_key() */
-
-/*****************************************************************************/
 /*
- * search the process keyrings for a matching key
- * - nested keyrings may also be searched if they have Search permission
- * - if a key is found, it will be attached to the destination keyring if
- *   there's one specified
- * - /sbin/request-key will be invoked if _callout_info is non-NULL
- *   - the _callout_info string will be passed to /sbin/request-key
- *   - if the _callout_info string is empty, it will be rendered as "-"
- * - implements request_key()
+ * Search the process keyrings and keyring trees linked from those for a
+ * matching key.  Keyrings must have appropriate Search permission to be
+ * searched.
+ *
+ * If a key is found, it will be attached to the destination keyring if there's
+ * one specified and the serial number of the key will be returned.
+ *
+ * If no key is found, /sbin/request-key will be invoked if _callout_info is
+ * non-NULL in an attempt to create a key.  The _callout_info string will be
+ * passed to /sbin/request-key to aid with completing the request.  If the
+ * _callout_info string is "" then it will be changed to "-".
  */
 SYSCALL_DEFINE4(request_key, const char __user *, _type,
                const char __user *, _description,
@@ -222,14 +219,14 @@ error2:
        kfree(description);
 error:
        return ret;
+}
 
-} /* end sys_request_key() */
-
-/*****************************************************************************/
 /*
- * get the ID of the specified process keyring
- * - the keyring must have search permission to be found
- * - implements keyctl(KEYCTL_GET_KEYRING_ID)
+ * Get the ID of the specified process keyring.
+ *
+ * The requested keyring must have search permission to be found.
+ *
+ * If successful, the ID of the requested keyring will be returned.
  */
 long keyctl_get_keyring_ID(key_serial_t id, int create)
 {
@@ -248,13 +245,17 @@ long keyctl_get_keyring_ID(key_serial_t id, int create)
        key_ref_put(key_ref);
 error:
        return ret;
+}
 
-} /* end keyctl_get_keyring_ID() */
-
-/*****************************************************************************/
 /*
- * join the session keyring
- * - implements keyctl(KEYCTL_JOIN_SESSION_KEYRING)
+ * Join a (named) session keyring.
+ *
+ * Create and join an anonymous session keyring or join a named session
+ * keyring, creating it if necessary.  A named session keyring must have Search
+ * permission for it to be joined.  Session keyrings without this permit will
+ * be skipped over.
+ *
+ * If successful, the ID of the joined session keyring will be returned.
  */
 long keyctl_join_session_keyring(const char __user *_name)
 {
@@ -277,14 +278,17 @@ long keyctl_join_session_keyring(const char __user *_name)
 
 error:
        return ret;
+}
 
-} /* end keyctl_join_session_keyring() */
-
-/*****************************************************************************/
 /*
- * update a key's data payload
- * - the key must be writable
- * - implements keyctl(KEYCTL_UPDATE)
+ * Update a key's data payload from the given data.
+ *
+ * The key must grant the caller Write permission and the key type must support
+ * updating for this to work.  A negative key can be positively instantiated
+ * with this call.
+ *
+ * If successful, 0 will be returned.  If the key type does not support
+ * updating, then -EOPNOTSUPP will be returned.
  */
 long keyctl_update_key(key_serial_t id,
                       const void __user *_payload,
@@ -326,14 +330,17 @@ error2:
        kfree(payload);
 error:
        return ret;
+}
 
-} /* end keyctl_update_key() */
-
-/*****************************************************************************/
 /*
- * revoke a key
- * - the key must be writable
- * - implements keyctl(KEYCTL_REVOKE)
+ * Revoke a key.
+ *
+ * The key must be grant the caller Write or Setattr permission for this to
+ * work.  The key type should give up its quota claim when revoked.  The key
+ * and any links to the key will be automatically garbage collected after a
+ * certain amount of time (/proc/sys/kernel/keys/gc_delay).
+ *
+ * If successful, 0 is returned.
  */
 long keyctl_revoke_key(key_serial_t id)
 {
@@ -358,14 +365,14 @@ long keyctl_revoke_key(key_serial_t id)
        key_ref_put(key_ref);
 error:
        return ret;
+}
 
-} /* end keyctl_revoke_key() */
-
-/*****************************************************************************/
 /*
- * clear the specified process keyring
- * - the keyring must be writable
- * - implements keyctl(KEYCTL_CLEAR)
+ * Clear the specified keyring, creating an empty process keyring if one of the
+ * special keyring IDs is used.
+ *
+ * The keyring must grant the caller Write permission for this to work.  If
+ * successful, 0 will be returned.
  */
 long keyctl_keyring_clear(key_serial_t ringid)
 {
@@ -383,15 +390,18 @@ long keyctl_keyring_clear(key_serial_t ringid)
        key_ref_put(keyring_ref);
 error:
        return ret;
+}
 
-} /* end keyctl_keyring_clear() */
-
-/*****************************************************************************/
 /*
- * link a key into a keyring
- * - the keyring must be writable
- * - the key must be linkable
- * - implements keyctl(KEYCTL_LINK)
+ * Create a link from a keyring to a key if there's no matching key in the
+ * keyring, otherwise replace the link to the matching key with a link to the
+ * new key.
+ *
+ * The key must grant the caller Link permission and the the keyring must grant
+ * the caller Write permission.  Furthermore, if an additional link is created,
+ * the keyring's quota will be extended.
+ *
+ * If successful, 0 will be returned.
  */
 long keyctl_keyring_link(key_serial_t id, key_serial_t ringid)
 {
@@ -417,15 +427,16 @@ error2:
        key_ref_put(keyring_ref);
 error:
        return ret;
+}
 
-} /* end keyctl_keyring_link() */
-
-/*****************************************************************************/
 /*
- * unlink the first attachment of a key from a keyring
- * - the keyring must be writable
- * - we don't need any permissions on the key
- * - implements keyctl(KEYCTL_UNLINK)
+ * Unlink a key from a keyring.
+ *
+ * The keyring must grant the caller Write permission for this to work; the key
+ * itself need not grant the caller anything.  If the last link to a key is
+ * removed then that key will be scheduled for destruction.
+ *
+ * If successful, 0 will be returned.
  */
 long keyctl_keyring_unlink(key_serial_t id, key_serial_t ringid)
 {
@@ -451,19 +462,20 @@ error2:
        key_ref_put(keyring_ref);
 error:
        return ret;
+}
 
-} /* end keyctl_keyring_unlink() */
-
-/*****************************************************************************/
 /*
- * describe a user key
- * - the key must have view permission
- * - if there's a buffer, we place up to buflen bytes of data into it
- * - unless there's an error, we return the amount of description available,
- *   irrespective of how much we may have copied
- * - the description is formatted thus:
+ * Return a description of a key to userspace.
+ *
+ * The key must grant the caller View permission for this to work.
+ *
+ * If there's a buffer, we place up to buflen bytes of data into it formatted
+ * in the following way:
+ *
  *     type;uid;gid;perm;description<NUL>
- * - implements keyctl(KEYCTL_DESCRIBE)
+ *
+ * If successful, we return the amount of description available, irrespective
+ * of how much we may have copied into the buffer.
  */
 long keyctl_describe_key(key_serial_t keyid,
                         char __user *buffer,
@@ -531,18 +543,17 @@ error2:
        key_ref_put(key_ref);
 error:
        return ret;
+}
 
-} /* end keyctl_describe_key() */
-
-/*****************************************************************************/
 /*
- * search the specified keyring for a matching key
- * - the start keyring must be searchable
- * - nested keyrings may also be searched if they are searchable
- * - only keys with search permission may be found
- * - if a key is found, it will be attached to the destination keyring if
- *   there's one specified
- * - implements keyctl(KEYCTL_SEARCH)
+ * Search the specified keyring and any keyrings it links to for a matching
+ * key.  Only keyrings that grant the caller Search permission will be searched
+ * (this includes the starting keyring).  Only keys with Search permission can
+ * be found.
+ *
+ * If successful, the found key will be linked to the destination keyring if
+ * supplied and the key has Link permission, and the found key ID will be
+ * returned.
  */
 long keyctl_keyring_search(key_serial_t ringid,
                           const char __user *_type,
@@ -626,18 +637,17 @@ error2:
        kfree(description);
 error:
        return ret;
+}
 
-} /* end keyctl_keyring_search() */
-
-/*****************************************************************************/
 /*
- * read a user key's payload
- * - the keyring must be readable or the key must be searchable from the
- *   process's keyrings
- * - if there's a buffer, we place up to buflen bytes of data into it
- * - unless there's an error, we return the amount of data in the key,
- *   irrespective of how much we may have copied
- * - implements keyctl(KEYCTL_READ)
+ * Read a key's payload.
+ *
+ * The key must either grant the caller Read permission, or it must grant the
+ * caller Search permission when searched for from the process keyrings.
+ *
+ * If successful, we place up to buflen bytes of data into the buffer, if one
+ * is provided, and return the amount of data that is available in the key,
+ * irrespective of how much we copied into the buffer.
  */
 long keyctl_read_key(key_serial_t keyid, char __user *buffer, size_t buflen)
 {
@@ -688,15 +698,22 @@ error2:
        key_put(key);
 error:
        return ret;
+}
 
-} /* end keyctl_read_key() */
-
-/*****************************************************************************/
 /*
- * change the ownership of a key
- * - the keyring owned by the changer
- * - if the uid or gid is -1, then that parameter is not changed
- * - implements keyctl(KEYCTL_CHOWN)
+ * Change the ownership of a key
+ *
+ * The key must grant the caller Setattr permission for this to work, though
+ * the key need not be fully instantiated yet.  For the UID to be changed, or
+ * for the GID to be changed to a group the caller is not a member of, the
+ * caller must have sysadmin capability.  If either uid or gid is -1 then that
+ * attribute is not changed.
+ *
+ * If the UID is to be changed, the new user must have sufficient quota to
+ * accept the key.  The quota deduction will be removed from the old user to
+ * the new user should the attribute be changed.
+ *
+ * If successful, 0 will be returned.
  */
 long keyctl_chown_key(key_serial_t id, uid_t uid, gid_t gid)
 {
@@ -796,14 +813,14 @@ quota_overrun:
        zapowner = newowner;
        ret = -EDQUOT;
        goto error_put;
+}
 
-} /* end keyctl_chown_key() */
-
-/*****************************************************************************/
 /*
- * change the permission mask on a key
- * - the keyring owned by the changer
- * - implements keyctl(KEYCTL_SETPERM)
+ * Change the permission mask on a key.
+ *
+ * The key must grant the caller Setattr permission for this to work, though
+ * the key need not be fully instantiated yet.  If the caller does not have
+ * sysadmin capability, it may only change the permission on keys that it owns.
  */
 long keyctl_setperm_key(key_serial_t id, key_perm_t perm)
 {
@@ -838,11 +855,11 @@ long keyctl_setperm_key(key_serial_t id, key_perm_t perm)
        key_put(key);
 error:
        return ret;
-
-} /* end keyctl_setperm_key() */
+}
 
 /*
- * get the destination keyring for instantiation
+ * Get the destination keyring for instantiation and check that the caller has
+ * Write permission on it.
  */
 static long get_instantiation_keyring(key_serial_t ringid,
                                      struct request_key_auth *rka,
@@ -879,7 +896,7 @@ static long get_instantiation_keyring(key_serial_t ringid,
 }
 
 /*
- * change the request_key authorisation key on the current process
+ * Change the request_key authorisation key on the current process.
  */
 static int keyctl_change_reqkey_auth(struct key *key)
 {
@@ -895,10 +912,14 @@ static int keyctl_change_reqkey_auth(struct key *key)
        return commit_creds(new);
 }
 
-/*****************************************************************************/
 /*
- * instantiate the key with the specified payload, and, if one is given, link
- * the key into the keyring
+ * Instantiate a key with the specified payload and link the key into the
+ * destination keyring if one is given.
+ *
+ * The caller must have the appropriate instantiation permit set for this to
+ * work (see keyctl_assume_authority).  No other permissions are required.
+ *
+ * If successful, 0 will be returned.
  */
 long keyctl_instantiate_key(key_serial_t id,
                            const void __user *_payload,
@@ -973,13 +994,22 @@ error2:
                vfree(payload);
 error:
        return ret;
+}
 
-} /* end keyctl_instantiate_key() */
-
-/*****************************************************************************/
 /*
- * negatively instantiate the key with the given timeout (in seconds), and, if
- * one is given, link the key into the keyring
+ * Negatively instantiate the key with the given timeout (in seconds) and link
+ * the key into the destination keyring if one is given.
+ *
+ * The caller must have the appropriate instantiation permit set for this to
+ * work (see keyctl_assume_authority).  No other permissions are required.
+ *
+ * The key and any links to the key will be automatically garbage collected
+ * after the timeout expires.
+ *
+ * Negative keys are used to rate limit repeated request_key() calls by causing
+ * them to return -ENOKEY until the negative key expires.
+ *
+ * If successful, 0 will be returned.
  */
 long keyctl_negate_key(key_serial_t id, unsigned timeout, key_serial_t ringid)
 {
@@ -1020,13 +1050,14 @@ long keyctl_negate_key(key_serial_t id, unsigned timeout, key_serial_t ringid)
 
 error:
        return ret;
+}
 
-} /* end keyctl_negate_key() */
-
-/*****************************************************************************/
 /*
- * set the default keyring in which request_key() will cache keys
- * - return the old setting
+ * Read or set the default keyring in which request_key() will cache keys and
+ * return the old setting.
+ *
+ * If a process keyring is specified then this will be created if it doesn't
+ * yet exist.  The old setting will be returned if successful.
  */
 long keyctl_set_reqkey_keyring(int reqkey_defl)
 {
@@ -1079,12 +1110,19 @@ set:
 error:
        abort_creds(new);
        return ret;
+}
 
-} /* end keyctl_set_reqkey_keyring() */
-
-/*****************************************************************************/
 /*
- * set or clear the timeout for a key
+ * Set or clear the timeout on a key.
+ *
+ * Either the key must grant the caller Setattr permission or else the caller
+ * must hold an instantiation authorisation token for the key.
+ *
+ * The timeout is either 0 to clear the timeout, or a number of seconds from
+ * the current time.  The key and any links to the key will be automatically
+ * garbage collected after the timeout expires.
+ *
+ * If successful, 0 is returned.
  */
 long keyctl_set_timeout(key_serial_t id, unsigned timeout)
 {
@@ -1136,12 +1174,24 @@ okay:
        ret = 0;
 error:
        return ret;
+}
 
-} /* end keyctl_set_timeout() */
-
-/*****************************************************************************/
 /*
- * assume the authority to instantiate the specified key
+ * Assume (or clear) the authority to instantiate the specified key.
+ *
+ * This sets the authoritative token currently in force for key instantiation.
+ * This must be done for a key to be instantiated.  It has the effect of making
+ * available all the keys from the caller of the request_key() that created a
+ * key to request_key() calls made by the caller of this function.
+ *
+ * The caller must have the instantiation key in their process keyrings with a
+ * Search permission grant available to the caller.
+ *
+ * If the ID given is 0, then the setting will be cleared and 0 returned.
+ *
+ * If the ID given has a matching an authorisation key, then that key will be
+ * set and its ID will be returned.  The authorisation key can be read to get
+ * the callout information passed to request_key().
  */
 long keyctl_assume_authority(key_serial_t id)
 {
@@ -1178,16 +1228,17 @@ long keyctl_assume_authority(key_serial_t id)
        ret = authkey->serial;
 error:
        return ret;
-
-} /* end keyctl_assume_authority() */
+}
 
 /*
- * get the security label of a key
- * - the key must grant us view permission
- * - if there's a buffer, we place up to buflen bytes of data into it
- * - unless there's an error, we return the amount of information available,
- *   irrespective of how much we may have copied (including the terminal NUL)
- * - implements keyctl(KEYCTL_GET_SECURITY)
+ * Get a key's the LSM security label.
+ *
+ * The key must grant the caller View permission for this to work.
+ *
+ * If there's a buffer, then up to buflen bytes of data will be placed into it.
+ *
+ * If successful, the amount of information available will be returned,
+ * irrespective of how much was copied (including the terminal NUL).
  */
 long keyctl_get_security(key_serial_t keyid,
                         char __user *buffer,
@@ -1242,10 +1293,16 @@ long keyctl_get_security(key_serial_t keyid,
 }
 
 /*
- * attempt to install the calling process's session keyring on the process's
- * parent process
- * - the keyring must exist and must grant us LINK permission
- * - implements keyctl(KEYCTL_SESSION_TO_PARENT)
+ * Attempt to install the calling process's session keyring on the process's
+ * parent process.
+ *
+ * The keyring must exist and must grant the caller LINK permission, and the
+ * parent process must be single-threaded and must have the same effective
+ * ownership as this process and mustn't be SUID/SGID.
+ *
+ * The keyring will be emplaced on the parent when it next resumes userspace.
+ *
+ * If successful, 0 will be returned.
  */
 long keyctl_session_to_parent(void)
 {
@@ -1348,9 +1405,8 @@ error_keyring:
 #endif /* !TIF_NOTIFY_RESUME */
 }
 
-/*****************************************************************************/
 /*
- * the key control system call
+ * The key control system call
  */
 SYSCALL_DEFINE5(keyctl, int, option, unsigned long, arg2, unsigned long, arg3,
                unsigned long, arg4, unsigned long, arg5)
@@ -1439,5 +1495,4 @@ SYSCALL_DEFINE5(keyctl, int, option, unsigned long, arg2, unsigned long, arg3,
        default:
                return -EOPNOTSUPP;
        }
-
-} /* end sys_keyctl() */
+}
index d37f713e73ce7ef7937ef8bfe23a96960202c187..92024ed12e0a22157bca33d69a465b5bede0d7b2 100644 (file)
                rwsem_is_locked((struct rw_semaphore *)&(keyring)->sem)))
 
 /*
- * when plumbing the depths of the key tree, this sets a hard limit set on how
- * deep we're willing to go
+ * When plumbing the depths of the key tree, this sets a hard limit
+ * set on how deep we're willing to go.
  */
 #define KEYRING_SEARCH_MAX_DEPTH 6
 
 /*
- * we keep all named keyrings in a hash to speed looking them up
+ * We keep all named keyrings in a hash to speed looking them up.
  */
 #define KEYRING_NAME_HASH_SIZE (1 << 5)
 
@@ -50,7 +50,9 @@ static inline unsigned keyring_hash(const char *desc)
 }
 
 /*
- * the keyring type definition
+ * The keyring key type definition.  Keyrings are simply keys of this type and
+ * can be treated as ordinary keys in addition to having their own special
+ * operations.
  */
 static int keyring_instantiate(struct key *keyring,
                               const void *data, size_t datalen);
@@ -71,19 +73,17 @@ struct key_type key_type_keyring = {
        .describe       = keyring_describe,
        .read           = keyring_read,
 };
-
 EXPORT_SYMBOL(key_type_keyring);
 
 /*
- * semaphore to serialise link/link calls to prevent two link calls in parallel
- * introducing a cycle
+ * Semaphore to serialise link/link calls to prevent two link calls in parallel
+ * introducing a cycle.
  */
 static DECLARE_RWSEM(keyring_serialise_link_sem);
 
-/*****************************************************************************/
 /*
- * publish the name of a keyring so that it can be found by name (if it has
- * one)
+ * Publish the name of a keyring so that it can be found by name (if it has
+ * one).
  */
 static void keyring_publish_name(struct key *keyring)
 {
@@ -102,13 +102,12 @@ static void keyring_publish_name(struct key *keyring)
 
                write_unlock(&keyring_name_lock);
        }
+}
 
-} /* end keyring_publish_name() */
-
-/*****************************************************************************/
 /*
- * initialise a keyring
- * - we object if we were given any data
+ * Initialise a keyring.
+ *
+ * Returns 0 on success, -EINVAL if given any data.
  */
 static int keyring_instantiate(struct key *keyring,
                               const void *data, size_t datalen)
@@ -123,23 +122,20 @@ static int keyring_instantiate(struct key *keyring,
        }
 
        return ret;
+}
 
-} /* end keyring_instantiate() */
-
-/*****************************************************************************/
 /*
- * match keyrings on their name
+ * Match keyrings on their name
  */
 static int keyring_match(const struct key *keyring, const void *description)
 {
        return keyring->description &&
                strcmp(keyring->description, description) == 0;
+}
 
-} /* end keyring_match() */
-
-/*****************************************************************************/
 /*
- * dispose of the data dangling from the corpse of a keyring
+ * Clean up a keyring when it is destroyed.  Unpublish its name if it had one
+ * and dispose of its data.
  */
 static void keyring_destroy(struct key *keyring)
 {
@@ -164,12 +160,10 @@ static void keyring_destroy(struct key *keyring)
                        key_put(klist->keys[loop]);
                kfree(klist);
        }
+}
 
-} /* end keyring_destroy() */
-
-/*****************************************************************************/
 /*
- * describe the keyring
+ * Describe a keyring for /proc.
  */
 static void keyring_describe(const struct key *keyring, struct seq_file *m)
 {
@@ -187,13 +181,12 @@ static void keyring_describe(const struct key *keyring, struct seq_file *m)
        else
                seq_puts(m, ": empty");
        rcu_read_unlock();
+}
 
-} /* end keyring_describe() */
-
-/*****************************************************************************/
 /*
- * read a list of key IDs from the keyring's contents
- * - the keyring's semaphore is read-locked
+ * Read a list of key IDs from the keyring's contents in binary form
+ *
+ * The keyring's semaphore is read-locked by the caller.
  */
 static long keyring_read(const struct key *keyring,
                         char __user *buffer, size_t buflen)
@@ -241,12 +234,10 @@ static long keyring_read(const struct key *keyring,
 
 error:
        return ret;
+}
 
-} /* end keyring_read() */
-
-/*****************************************************************************/
 /*
- * allocate a keyring and link into the destination keyring
+ * Allocate a keyring and link into the destination keyring.
  */
 struct key *keyring_alloc(const char *description, uid_t uid, gid_t gid,
                          const struct cred *cred, unsigned long flags,
@@ -269,20 +260,42 @@ struct key *keyring_alloc(const char *description, uid_t uid, gid_t gid,
        }
 
        return keyring;
+}
 
-} /* end keyring_alloc() */
-
-/*****************************************************************************/
-/*
- * search the supplied keyring tree for a key that matches the criterion
- * - perform a breadth-then-depth search up to the prescribed limit
- * - we only find keys on which we have search permission
- * - we use the supplied match function to see if the description (or other
- *   feature of interest) matches
- * - we rely on RCU to prevent the keyring lists from disappearing on us
- * - we return -EAGAIN if we didn't find any matching key
- * - we return -ENOKEY if we only found negative matching keys
- * - we propagate the possession attribute from the keyring ref to the key ref
+/**
+ * keyring_search_aux - Search a keyring tree for a key matching some criteria
+ * @keyring_ref: A pointer to the keyring with possession indicator.
+ * @cred: The credentials to use for permissions checks.
+ * @type: The type of key to search for.
+ * @description: Parameter for @match.
+ * @match: Function to rule on whether or not a key is the one required.
+ *
+ * Search the supplied keyring tree for a key that matches the criteria given.
+ * The root keyring and any linked keyrings must grant Search permission to the
+ * caller to be searchable and keys can only be found if they too grant Search
+ * to the caller. The possession flag on the root keyring pointer controls use
+ * of the possessor bits in permissions checking of the entire tree.  In
+ * addition, the LSM gets to forbid keyring searches and key matches.
+ *
+ * The search is performed as a breadth-then-depth search up to the prescribed
+ * limit (KEYRING_SEARCH_MAX_DEPTH).
+ *
+ * Keys are matched to the type provided and are then filtered by the match
+ * function, which is given the description to use in any way it sees fit.  The
+ * match function may use any attributes of a key that it wishes to to
+ * determine the match.  Normally the match function from the key type would be
+ * used.
+ *
+ * RCU is used to prevent the keyring key lists from disappearing without the
+ * need to take lots of locks.
+ *
+ * Returns a pointer to the found key and increments the key usage count if
+ * successful; -EAGAIN if no matching keys were found, or if expired or revoked
+ * keys were found; -ENOKEY if only negative keys were found; -ENOTDIR if the
+ * specified keyring wasn't a keyring.
+ *
+ * In the case of a successful return, the possession attribute from
+ * @keyring_ref is propagated to the returned key reference.
  */
 key_ref_t keyring_search_aux(key_ref_t keyring_ref,
                             const struct cred *cred,
@@ -444,17 +457,16 @@ error_2:
        rcu_read_unlock();
 error:
        return key_ref;
+}
 
-} /* end keyring_search_aux() */
-
-/*****************************************************************************/
-/*
- * search the supplied keyring tree for a key that matches the criterion
- * - perform a breadth-then-depth search up to the prescribed limit
- * - we only find keys on which we have search permission
- * - we readlock the keyrings as we search down the tree
- * - we return -EAGAIN if we didn't find any matching key
- * - we return -ENOKEY if we only found negative matching keys
+/**
+ * keyring_search - Search the supplied keyring tree for a matching key
+ * @keyring: The root of the keyring tree to be searched.
+ * @type: The type of keyring we want to find.
+ * @description: The name of the keyring we want to find.
+ *
+ * As keyring_search_aux() above, but using the current task's credentials and
+ * type's default matching function.
  */
 key_ref_t keyring_search(key_ref_t keyring,
                         struct key_type *type,
@@ -465,16 +477,23 @@ key_ref_t keyring_search(key_ref_t keyring,
 
        return keyring_search_aux(keyring, current->cred,
                                  type, description, type->match);
-
-} /* end keyring_search() */
-
+}
 EXPORT_SYMBOL(keyring_search);
 
-/*****************************************************************************/
 /*
- * search the given keyring only (no recursion)
- * - keyring must be locked by caller
- * - caller must guarantee that the keyring is a keyring
+ * Search the given keyring only (no recursion).
+ *
+ * The caller must guarantee that the keyring is a keyring and that the
+ * permission is granted to search the keyring as no check is made here.
+ *
+ * RCU is used to make it unnecessary to lock the keyring key list here.
+ *
+ * Returns a pointer to the found key with usage count incremented if
+ * successful and returns -ENOKEY if not found.  Revoked keys and keys not
+ * providing the requested permission are skipped over.
+ *
+ * If successful, the possession indicator is propagated from the keyring ref
+ * to the returned key reference.
  */
 key_ref_t __keyring_search_one(key_ref_t keyring_ref,
                               const struct key_type *ktype,
@@ -514,14 +533,18 @@ found:
        atomic_inc(&key->usage);
        rcu_read_unlock();
        return make_key_ref(key, possessed);
+}
 
-} /* end __keyring_search_one() */
-
-/*****************************************************************************/
 /*
- * find a keyring with the specified name
- * - all named keyrings are searched
- * - normally only finds keyrings with search permission for the current process
+ * Find a keyring with the specified name.
+ *
+ * All named keyrings in the current user namespace are searched, provided they
+ * grant Search permission directly to the caller (unless this check is
+ * skipped).  Keyrings whose usage points have reached zero or who have been
+ * revoked are skipped.
+ *
+ * Returns a pointer to the keyring with the keyring's refcount having being
+ * incremented on success.  -ENOKEY is returned if a key could not be found.
  */
 struct key *find_keyring_by_name(const char *name, bool skip_perm_check)
 {
@@ -569,15 +592,14 @@ struct key *find_keyring_by_name(const char *name, bool skip_perm_check)
 out:
        read_unlock(&keyring_name_lock);
        return keyring;
+}
 
-} /* end find_keyring_by_name() */
-
-/*****************************************************************************/
 /*
- * see if a cycle will will be created by inserting acyclic tree B in acyclic
- * tree A at the topmost level (ie: as a direct child of A)
- * - since we are adding B to A at the top level, checking for cycles should
- *   just be a matter of seeing if node A is somewhere in tree B
+ * See if a cycle will will be created by inserting acyclic tree B in acyclic
+ * tree A at the topmost level (ie: as a direct child of A).
+ *
+ * Since we are adding B to A at the top level, checking for cycles should just
+ * be a matter of seeing if node A is somewhere in tree B.
  */
 static int keyring_detect_cycle(struct key *A, struct key *B)
 {
@@ -657,11 +679,10 @@ too_deep:
 cycle_detected:
        ret = -EDEADLK;
        goto error;
-
-} /* end keyring_detect_cycle() */
+}
 
 /*
- * dispose of a keyring list after the RCU grace period, freeing the unlinked
+ * Dispose of a keyring list after the RCU grace period, freeing the unlinked
  * key
  */
 static void keyring_unlink_rcu_disposal(struct rcu_head *rcu)
@@ -675,7 +696,7 @@ static void keyring_unlink_rcu_disposal(struct rcu_head *rcu)
 }
 
 /*
- * preallocate memory so that a key can be linked into to a keyring
+ * Preallocate memory so that a key can be linked into to a keyring.
  */
 int __key_link_begin(struct key *keyring, const struct key_type *type,
                     const char *description,
@@ -792,10 +813,10 @@ error_krsem:
 }
 
 /*
- * check already instantiated keys aren't going to be a problem
- * - the caller must have called __key_link_begin()
- * - don't need to call this for keys that were created since __key_link_begin()
- *   was called
+ * Check already instantiated keys aren't going to be a problem.
+ *
+ * The caller must have called __key_link_begin(). Don't need to call this for
+ * keys that were created since __key_link_begin() was called.
  */
 int __key_link_check_live_key(struct key *keyring, struct key *key)
 {
@@ -807,9 +828,12 @@ int __key_link_check_live_key(struct key *keyring, struct key *key)
 }
 
 /*
- * link a key into to a keyring
- * - must be called with __key_link_begin() having being called
- * - discard already extant link to matching key if there is one
+ * Link a key into to a keyring.
+ *
+ * Must be called with __key_link_begin() having being called.  Discards any
+ * already extant link to matching key if there is one, so that each keyring
+ * holds at most one link to any given key of a particular type+description
+ * combination.
  */
 void __key_link(struct key *keyring, struct key *key,
                struct keyring_list **_prealloc)
@@ -852,8 +876,9 @@ void __key_link(struct key *keyring, struct key *key,
 }
 
 /*
- * finish linking a key into to a keyring
- * - must be called with __key_link_begin() having being called
+ * Finish linking a key into to a keyring.
+ *
+ * Must be called with __key_link_begin() having being called.
  */
 void __key_link_end(struct key *keyring, struct key_type *type,
                    struct keyring_list *prealloc)
@@ -874,8 +899,25 @@ void __key_link_end(struct key *keyring, struct key_type *type,
        up_write(&keyring->sem);
 }
 
-/*
- * link a key to a keyring
+/**
+ * key_link - Link a key to a keyring
+ * @keyring: The keyring to make the link in.
+ * @key: The key to link to.
+ *
+ * Make a link in a keyring to a key, such that the keyring holds a reference
+ * on that key and the key can potentially be found by searching that keyring.
+ *
+ * This function will write-lock the keyring's semaphore and will consume some
+ * of the user's key data quota to hold the link.
+ *
+ * Returns 0 if successful, -ENOTDIR if the keyring isn't a keyring,
+ * -EKEYREVOKED if the keyring has been revoked, -ENFILE if the keyring is
+ * full, -EDQUOT if there is insufficient key data quota remaining to add
+ * another link or -ENOMEM if there's insufficient memory.
+ *
+ * It is assumed that the caller has checked that it is permitted for a link to
+ * be made (the keyring should have Write permission and the key Link
+ * permission).
  */
 int key_link(struct key *keyring, struct key *key)
 {
@@ -895,12 +937,24 @@ int key_link(struct key *keyring, struct key *key)
 
        return ret;
 }
-
 EXPORT_SYMBOL(key_link);
 
-/*****************************************************************************/
-/*
- * unlink the first link to a key from a keyring
+/**
+ * key_unlink - Unlink the first link to a key from a keyring.
+ * @keyring: The keyring to remove the link from.
+ * @key: The key the link is to.
+ *
+ * Remove a link from a keyring to a key.
+ *
+ * This function will write-lock the keyring's semaphore.
+ *
+ * Returns 0 if successful, -ENOTDIR if the keyring isn't a keyring, -ENOENT if
+ * the key isn't linked to by the keyring or -ENOMEM if there's insufficient
+ * memory.
+ *
+ * It is assumed that the caller has checked that it is permitted for a link to
+ * be removed (the keyring should have Write permission; no permissions are
+ * required on the key).
  */
 int key_unlink(struct key *keyring, struct key *key)
 {
@@ -968,15 +1022,12 @@ nomem:
        ret = -ENOMEM;
        up_write(&keyring->sem);
        goto error;
-
-} /* end key_unlink() */
-
+}
 EXPORT_SYMBOL(key_unlink);
 
-/*****************************************************************************/
 /*
- * dispose of a keyring list after the RCU grace period, releasing the keys it
- * links to
+ * Dispose of a keyring list after the RCU grace period, releasing the keys it
+ * links to.
  */
 static void keyring_clear_rcu_disposal(struct rcu_head *rcu)
 {
@@ -989,13 +1040,15 @@ static void keyring_clear_rcu_disposal(struct rcu_head *rcu)
                key_put(klist->keys[loop]);
 
        kfree(klist);
+}
 
-} /* end keyring_clear_rcu_disposal() */
-
-/*****************************************************************************/
-/*
- * clear the specified process keyring
- * - implements keyctl(KEYCTL_CLEAR)
+/**
+ * keyring_clear - Clear a keyring
+ * @keyring: The keyring to clear.
+ *
+ * Clear the contents of the specified keyring.
+ *
+ * Returns 0 if successful or -ENOTDIR if the keyring isn't a keyring.
  */
 int keyring_clear(struct key *keyring)
 {
@@ -1027,15 +1080,13 @@ int keyring_clear(struct key *keyring)
        }
 
        return ret;
-
-} /* end keyring_clear() */
-
+}
 EXPORT_SYMBOL(keyring_clear);
 
-/*****************************************************************************/
 /*
- * dispose of the links from a revoked keyring
- * - called with the key sem write-locked
+ * Dispose of the links from a revoked keyring.
+ *
+ * This is called with the key sem write-locked.
  */
 static void keyring_revoke(struct key *keyring)
 {
@@ -1050,11 +1101,10 @@ static void keyring_revoke(struct key *keyring)
                rcu_assign_pointer(keyring->payload.subscriptions, NULL);
                call_rcu(&klist->rcu, keyring_clear_rcu_disposal);
        }
-
-} /* end keyring_revoke() */
+}
 
 /*
- * Determine whether a key is dead
+ * Determine whether a key is dead.
  */
 static bool key_is_dead(struct key *key, time_t limit)
 {
@@ -1063,7 +1113,12 @@ static bool key_is_dead(struct key *key, time_t limit)
 }
 
 /*
- * Collect garbage from the contents of a keyring
+ * Collect garbage from the contents of a keyring, replacing the old list with
+ * a new one with the pointers all shuffled down.
+ *
+ * Dead keys are classed as oned that are flagged as being dead or are revoked,
+ * expired or negative keys that were revoked or expired before the specified
+ * limit.
  */
 void keyring_gc(struct key *keyring, time_t limit)
 {
index 28645502cd0dc0719f41c96f3e3ed0059d816d51..c35b5229e3cdca80bcd6b44da70b5123871e1874 100644 (file)
@@ -1,4 +1,4 @@
-/* permission.c: key permission determination
+/* Key permission checking
  *
  * Copyright (C) 2005 Red Hat, Inc. All Rights Reserved.
  * Written by David Howells (dhowells@redhat.com)
 #include <linux/security.h>
 #include "internal.h"
 
-/*****************************************************************************/
 /**
  * key_task_permission - Check a key can be used
- * @key_ref: The key to check
- * @cred: The credentials to use
- * @perm: The permissions to check for
+ * @key_ref: The key to check.
+ * @cred: The credentials to use.
+ * @perm: The permissions to check for.
  *
  * Check to see whether permission is granted to use a key in the desired way,
  * but permit the security modules to override.
  *
- * The caller must hold either a ref on cred or must hold the RCU readlock or a
- * spinlock.
+ * The caller must hold either a ref on cred or must hold the RCU readlock.
+ *
+ * Returns 0 if successful, -EACCES if access is denied based on the
+ * permissions bits or the LSM check.
  */
 int key_task_permission(const key_ref_t key_ref, const struct cred *cred,
                        key_perm_t perm)
@@ -79,14 +80,16 @@ use_these_perms:
 
        /* let LSM be the final arbiter */
        return security_key_permission(key_ref, cred, perm);
-
-} /* end key_task_permission() */
-
+}
 EXPORT_SYMBOL(key_task_permission);
 
-/*****************************************************************************/
-/*
- * validate a key
+/**
+ * key_validate - Validate a key.
+ * @key: The key to be validated.
+ *
+ * Check that a key is valid, returning 0 if the key is okay, -EKEYREVOKED if
+ * the key's type has been removed or if the key has been revoked or
+ * -EKEYEXPIRED if the key has expired.
  */
 int key_validate(struct key *key)
 {
@@ -111,7 +114,5 @@ int key_validate(struct key *key)
 
 error:
        return ret;
-
-} /* end key_validate() */
-
+}
 EXPORT_SYMBOL(key_validate);
index 70373966816e9845594919d870fca1f3e441ca65..525cf8a29cdde86c5c58557fd73ceb49e9c73dec 100644 (file)
@@ -1,4 +1,4 @@
-/* proc.c: proc files for key database enumeration
+/* procfs files for key database enumeration
  *
  * Copyright (C) 2004 Red Hat, Inc. All Rights Reserved.
  * Written by David Howells (dhowells@redhat.com)
@@ -60,9 +60,8 @@ static const struct file_operations proc_key_users_fops = {
        .release        = seq_release,
 };
 
-/*****************************************************************************/
 /*
- * declare the /proc files
+ * Declare the /proc files.
  */
 static int __init key_proc_init(void)
 {
@@ -79,14 +78,13 @@ static int __init key_proc_init(void)
                panic("Cannot create /proc/key-users\n");
 
        return 0;
-
-} /* end key_proc_init() */
+}
 
 __initcall(key_proc_init);
 
-/*****************************************************************************/
 /*
- * implement "/proc/keys" to provides a list of the keys on the system
+ * Implement "/proc/keys" to provide a list of the keys on the system that
+ * grant View permission to the caller.
  */
 #ifdef CONFIG_KEYS_DEBUG_PROC_KEYS
 
@@ -293,9 +291,9 @@ static struct rb_node *key_user_first(struct rb_root *r)
        return __key_user_next(n);
 }
 
-/*****************************************************************************/
 /*
- * implement "/proc/key-users" to provides a list of the key users
+ * Implement "/proc/key-users" to provides a list of the key users and their
+ * quotas.
  */
 static int proc_key_users_open(struct inode *inode, struct file *file)
 {
@@ -351,5 +349,4 @@ static int proc_key_users_show(struct seq_file *m, void *v)
                   maxbytes);
 
        return 0;
-
 }
index 504bdd2452bd7ce1b995441662f16e02407f3fb3..930634e4514973ac0f79acc7037138acb576a2c3 100644 (file)
@@ -1,4 +1,4 @@
-/* Management of a process's keyrings
+/* Manage a process's keyrings
  *
  * Copyright (C) 2004-2005, 2008 Red Hat, Inc. All Rights Reserved.
  * Written by David Howells (dhowells@redhat.com)
 #include <asm/uaccess.h>
 #include "internal.h"
 
-/* session keyring create vs join semaphore */
+/* Session keyring create vs join semaphore */
 static DEFINE_MUTEX(key_session_mutex);
 
-/* user keyring creation semaphore */
+/* User keyring creation semaphore */
 static DEFINE_MUTEX(key_user_keyring_mutex);
 
-/* the root user's tracking struct */
+/* The root user's tracking struct */
 struct key_user root_key_user = {
        .usage          = ATOMIC_INIT(3),
        .cons_lock      = __MUTEX_INITIALIZER(root_key_user.cons_lock),
@@ -38,9 +38,8 @@ struct key_user root_key_user = {
        .user_ns        = &init_user_ns,
 };
 
-/*****************************************************************************/
 /*
- * install user and user session keyrings for a particular UID
+ * Install the user and user session keyrings for the current process's UID.
  */
 int install_user_keyrings(void)
 {
@@ -122,7 +121,8 @@ error:
 }
 
 /*
- * install a fresh thread keyring directly to new credentials
+ * Install a fresh thread keyring directly to new credentials.  This keyring is
+ * allowed to overrun the quota.
  */
 int install_thread_keyring_to_cred(struct cred *new)
 {
@@ -138,7 +138,7 @@ int install_thread_keyring_to_cred(struct cred *new)
 }
 
 /*
- * install a fresh thread keyring, discarding the old one
+ * Install a fresh thread keyring, discarding the old one.
  */
 static int install_thread_keyring(void)
 {
@@ -161,9 +161,10 @@ static int install_thread_keyring(void)
 }
 
 /*
- * install a process keyring directly to a credentials struct
- * - returns -EEXIST if there was already a process keyring, 0 if one installed,
- *   and other -ve on any other error
+ * Install a process keyring directly to a credentials struct.
+ *
+ * Returns -EEXIST if there was already a process keyring, 0 if one installed,
+ * and other value on any other error
  */
 int install_process_keyring_to_cred(struct cred *new)
 {
@@ -192,8 +193,11 @@ int install_process_keyring_to_cred(struct cred *new)
 }
 
 /*
- * make sure a process keyring is installed
- * - we
+ * Make sure a process keyring is installed for the current process.  The
+ * existing process keyring is not replaced.
+ *
+ * Returns 0 if there is a process keyring by the end of this function, some
+ * error otherwise.
  */
 static int install_process_keyring(void)
 {
@@ -214,7 +218,7 @@ static int install_process_keyring(void)
 }
 
 /*
- * install a session keyring directly to a credentials struct
+ * Install a session keyring directly to a credentials struct.
  */
 int install_session_keyring_to_cred(struct cred *cred, struct key *keyring)
 {
@@ -254,8 +258,8 @@ int install_session_keyring_to_cred(struct cred *cred, struct key *keyring)
 }
 
 /*
- * install a session keyring, discarding the old one
- * - if a keyring is not supplied, an empty one is invented
+ * Install a session keyring, discarding the old one.  If a keyring is not
+ * supplied, an empty one is invented.
  */
 static int install_session_keyring(struct key *keyring)
 {
@@ -275,9 +279,8 @@ static int install_session_keyring(struct key *keyring)
        return commit_creds(new);
 }
 
-/*****************************************************************************/
 /*
- * the filesystem user ID changed
+ * Handle the fsuid changing.
  */
 void key_fsuid_changed(struct task_struct *tsk)
 {
@@ -288,12 +291,10 @@ void key_fsuid_changed(struct task_struct *tsk)
                tsk->cred->thread_keyring->uid = tsk->cred->fsuid;
                up_write(&tsk->cred->thread_keyring->sem);
        }
+}
 
-} /* end key_fsuid_changed() */
-
-/*****************************************************************************/
 /*
- * the filesystem group ID changed
+ * Handle the fsgid changing.
  */
 void key_fsgid_changed(struct task_struct *tsk)
 {
@@ -304,16 +305,28 @@ void key_fsgid_changed(struct task_struct *tsk)
                tsk->cred->thread_keyring->gid = tsk->cred->fsgid;
                up_write(&tsk->cred->thread_keyring->sem);
        }
+}
 
-} /* end key_fsgid_changed() */
-
-/*****************************************************************************/
 /*
- * search only my process keyrings for the first matching key
- * - we use the supplied match function to see if the description (or other
- *   feature of interest) matches
- * - we return -EAGAIN if we didn't find any matching key
- * - we return -ENOKEY if we found only negative matching keys
+ * Search the process keyrings attached to the supplied cred for the first
+ * matching key.
+ *
+ * The search criteria are the type and the match function.  The description is
+ * given to the match function as a parameter, but doesn't otherwise influence
+ * the search.  Typically the match function will compare the description
+ * parameter to the key's description.
+ *
+ * This can only search keyrings that grant Search permission to the supplied
+ * credentials.  Keyrings linked to searched keyrings will also be searched if
+ * they grant Search permission too.  Keys can only be found if they grant
+ * Search permission to the credentials.
+ *
+ * Returns a pointer to the key with the key usage count incremented if
+ * successful, -EAGAIN if we didn't find any matching key or -ENOKEY if we only
+ * matched negative keys.
+ *
+ * In the case of a successful return, the possession attribute is set on the
+ * returned key reference.
  */
 key_ref_t search_my_process_keyrings(struct key_type *type,
                                     const void *description,
@@ -428,13 +441,13 @@ found:
        return key_ref;
 }
 
-/*****************************************************************************/
 /*
- * search the process keyrings for the first matching key
- * - we use the supplied match function to see if the description (or other
- *   feature of interest) matches
- * - we return -EAGAIN if we didn't find any matching key
- * - we return -ENOKEY if we found only negative matching keys
+ * Search the process keyrings attached to the supplied cred for the first
+ * matching key in the manner of search_my_process_keyrings(), but also search
+ * the keys attached to the assumed authorisation key using its credentials if
+ * one is available.
+ *
+ * Return same as search_my_process_keyrings().
  */
 key_ref_t search_process_keyrings(struct key_type *type,
                                  const void *description,
@@ -489,24 +502,33 @@ key_ref_t search_process_keyrings(struct key_type *type,
 
 found:
        return key_ref;
+}
 
-} /* end search_process_keyrings() */
-
-/*****************************************************************************/
 /*
- * see if the key we're looking at is the target key
+ * See if the key we're looking at is the target key.
  */
 int lookup_user_key_possessed(const struct key *key, const void *target)
 {
        return key == target;
+}
 
-} /* end lookup_user_key_possessed() */
-
-/*****************************************************************************/
 /*
- * lookup a key given a key ID from userspace with a given permissions mask
- * - don't create special keyrings unless so requested
- * - partially constructed keys aren't found unless requested
+ * Look up a key ID given us by userspace with a given permissions mask to get
+ * the key it refers to.
+ *
+ * Flags can be passed to request that special keyrings be created if referred
+ * to directly, to permit partially constructed keys to be found and to skip
+ * validity and permission checks on the found key.
+ *
+ * Returns a pointer to the key with an incremented usage count if successful;
+ * -EINVAL if the key ID is invalid; -ENOKEY if the key ID does not correspond
+ * to a key or the best found key was a negative key; -EKEYREVOKED or
+ * -EKEYEXPIRED if the best found key was revoked or expired; -EACCES if the
+ * found key doesn't grant the requested permit or the LSM denied access to it;
+ * or -ENOMEM if a special keyring couldn't be created.
+ *
+ * In the case of a successful return, the possession attribute is set on the
+ * returned key reference.
  */
 key_ref_t lookup_user_key(key_serial_t id, unsigned long lflags,
                          key_perm_t perm)
@@ -711,15 +733,18 @@ invalid_key:
 reget_creds:
        put_cred(cred);
        goto try_again;
+}
 
-} /* end lookup_user_key() */
-
-/*****************************************************************************/
 /*
- * join the named keyring as the session keyring if possible, or attempt to
- * create a new one of that name if not
- * - if the name is NULL, an empty anonymous keyring is installed instead
- * - named session keyring joining is done with a semaphore held
+ * Join the named keyring as the session keyring if possible else attempt to
+ * create a new one of that name and join that.
+ *
+ * If the name is NULL, an empty anonymous keyring will be installed as the
+ * session keyring.
+ *
+ * Named session keyrings are joined with a semaphore held to prevent the
+ * keyrings from going away whilst the attempt is made to going them and also
+ * to prevent a race in creating compatible session keyrings.
  */
 long join_session_keyring(const char *name)
 {
@@ -791,8 +816,8 @@ error:
 }
 
 /*
- * Replace a process's session keyring when that process resumes userspace on
- * behalf of one of its children
+ * Replace a process's session keyring on behalf of one of its children when
+ * the target  process is about to resume userspace execution.
  */
 void key_replace_session_keyring(void)
 {
index 0ea52d25a6bda8b3568fdb7752539403e93086b6..9a7fb3914b27536a5ed047209659af920db310a3 100644 (file)
@@ -39,8 +39,14 @@ static int key_wait_bit_intr(void *flags)
        return signal_pending(current) ? -ERESTARTSYS : 0;
 }
 
-/*
- * call to complete the construction of a key
+/**
+ * complete_request_key - Complete the construction of a key.
+ * @cons: The key construction record.
+ * @error: The success or failute of the construction.
+ *
+ * Complete the attempt to construct a key.  The key will be negated
+ * if an error is indicated.  The authorisation key will be revoked
+ * unconditionally.
  */
 void complete_request_key(struct key_construction *cons, int error)
 {
@@ -58,23 +64,33 @@ void complete_request_key(struct key_construction *cons, int error)
 }
 EXPORT_SYMBOL(complete_request_key);
 
+/*
+ * Initialise a usermode helper that is going to have a specific session
+ * keyring.
+ *
+ * This is called in context of freshly forked kthread before kernel_execve(),
+ * so we can simply install the desired session_keyring at this point.
+ */
 static int umh_keys_init(struct subprocess_info *info)
 {
        struct cred *cred = (struct cred*)current_cred();
        struct key *keyring = info->data;
-       /*
-        * This is called in context of freshly forked kthread before
-        * kernel_execve(), we can just change our ->session_keyring.
-        */
+
        return install_session_keyring_to_cred(cred, keyring);
 }
 
+/*
+ * Clean up a usermode helper with session keyring.
+ */
 static void umh_keys_cleanup(struct subprocess_info *info)
 {
        struct key *keyring = info->data;
        key_put(keyring);
 }
 
+/*
+ * Call a usermode helper with a specific session keyring.
+ */
 static int call_usermodehelper_keys(char *path, char **argv, char **envp,
                         struct key *session_keyring, enum umh_wait wait)
 {
@@ -91,7 +107,7 @@ static int call_usermodehelper_keys(char *path, char **argv, char **envp,
 }
 
 /*
- * request userspace finish the construction of a key
+ * Request userspace finish the construction of a key
  * - execute "/sbin/request-key <op> <key> <uid> <gid> <keyring> <keyring> <keyring>"
  */
 static int call_sbin_request_key(struct key_construction *cons,
@@ -198,8 +214,9 @@ error_alloc:
 }
 
 /*
- * call out to userspace for key construction
- * - we ignore program failure and go on key status instead
+ * Call out to userspace for key construction.
+ *
+ * Program failure is ignored in favour of key status.
  */
 static int construct_key(struct key *key, const void *callout_info,
                         size_t callout_len, void *aux,
@@ -246,9 +263,10 @@ static int construct_key(struct key *key, const void *callout_info,
 }
 
 /*
- * get the appropriate destination keyring for the request
- * - we return whatever keyring we select with an extra reference upon it which
- *   the caller must release
+ * Get the appropriate destination keyring for the request.
+ *
+ * The keyring selected is returned with an extra reference upon it which the
+ * caller must release.
  */
 static void construct_get_dest_keyring(struct key **_dest_keyring)
 {
@@ -321,9 +339,11 @@ static void construct_get_dest_keyring(struct key **_dest_keyring)
 }
 
 /*
- * allocate a new key in under-construction state and attempt to link it in to
- * the requested place
- * - may return a key that's already under construction instead
+ * Allocate a new key in under-construction state and attempt to link it in to
+ * the requested keyring.
+ *
+ * May return a key that's already under construction instead if there was a
+ * race between two thread calling request_key().
  */
 static int construct_alloc_key(struct key_type *type,
                               const char *description,
@@ -414,7 +434,7 @@ alloc_failed:
 }
 
 /*
- * commence key construction
+ * Commence key construction.
  */
 static struct key *construct_key_and_link(struct key_type *type,
                                          const char *description,
@@ -465,12 +485,32 @@ construction_failed:
        return ERR_PTR(ret);
 }
 
-/*
- * request a key
- * - search the process's keyrings
- * - check the list of keys being created or updated
- * - call out to userspace for a key if supplementary info was provided
- * - cache the key in an appropriate keyring
+/**
+ * request_key_and_link - Request a key and cache it in a keyring.
+ * @type: The type of key we want.
+ * @description: The searchable description of the key.
+ * @callout_info: The data to pass to the instantiation upcall (or NULL).
+ * @callout_len: The length of callout_info.
+ * @aux: Auxiliary data for the upcall.
+ * @dest_keyring: Where to cache the key.
+ * @flags: Flags to key_alloc().
+ *
+ * A key matching the specified criteria is searched for in the process's
+ * keyrings and returned with its usage count incremented if found.  Otherwise,
+ * if callout_info is not NULL, a key will be allocated and some service
+ * (probably in userspace) will be asked to instantiate it.
+ *
+ * If successfully found or created, the key will be linked to the destination
+ * keyring if one is provided.
+ *
+ * Returns a pointer to the key if successful; -EACCES, -ENOKEY, -EKEYREVOKED
+ * or -EKEYEXPIRED if an inaccessible, negative, revoked or expired key was
+ * found; -ENOKEY if no key was found and no @callout_info was given; -EDQUOT
+ * if insufficient key quota was available to create a new key; or -ENOMEM if
+ * insufficient memory was available.
+ *
+ * If the returned key was created, then it may still be under construction,
+ * and wait_for_key_construction() should be used to wait for that to complete.
  */
 struct key *request_key_and_link(struct key_type *type,
                                 const char *description,
@@ -524,8 +564,16 @@ error:
        return key;
 }
 
-/*
- * wait for construction of a key to complete
+/**
+ * wait_for_key_construction - Wait for construction of a key to complete
+ * @key: The key being waited for.
+ * @intr: Whether to wait interruptibly.
+ *
+ * Wait for a key to finish being constructed.
+ *
+ * Returns 0 if successful; -ERESTARTSYS if the wait was interrupted; -ENOKEY
+ * if the key was negated; or -EKEYREVOKED or -EKEYEXPIRED if the key was
+ * revoked or expired.
  */
 int wait_for_key_construction(struct key *key, bool intr)
 {
@@ -542,12 +590,19 @@ int wait_for_key_construction(struct key *key, bool intr)
 }
 EXPORT_SYMBOL(wait_for_key_construction);
 
-/*
- * request a key
- * - search the process's keyrings
- * - check the list of keys being created or updated
- * - call out to userspace for a key if supplementary info was provided
- * - waits uninterruptible for creation to complete
+/**
+ * request_key - Request a key and wait for construction
+ * @type: Type of key.
+ * @description: The searchable description of the key.
+ * @callout_info: The data to pass to the instantiation upcall (or NULL).
+ *
+ * As for request_key_and_link() except that it does not add the returned key
+ * to a keyring if found, new keys are always allocated in the user's quota,
+ * the callout_info must be a NUL-terminated string and no auxiliary data can
+ * be passed.
+ *
+ * Furthermore, it then works as wait_for_key_construction() to wait for the
+ * completion of keys undergoing construction with a non-interruptible wait.
  */
 struct key *request_key(struct key_type *type,
                        const char *description,
@@ -572,12 +627,19 @@ struct key *request_key(struct key_type *type,
 }
 EXPORT_SYMBOL(request_key);
 
-/*
- * request a key with auxiliary data for the upcaller
- * - search the process's keyrings
- * - check the list of keys being created or updated
- * - call out to userspace for a key if supplementary info was provided
- * - waits uninterruptible for creation to complete
+/**
+ * request_key_with_auxdata - Request a key with auxiliary data for the upcaller
+ * @type: The type of key we want.
+ * @description: The searchable description of the key.
+ * @callout_info: The data to pass to the instantiation upcall (or NULL).
+ * @callout_len: The length of callout_info.
+ * @aux: Auxiliary data for the upcall.
+ *
+ * As for request_key_and_link() except that it does not add the returned key
+ * to a keyring if found and new keys are always allocated in the user's quota.
+ *
+ * Furthermore, it then works as wait_for_key_construction() to wait for the
+ * completion of keys undergoing construction with a non-interruptible wait.
  */
 struct key *request_key_with_auxdata(struct key_type *type,
                                     const char *description,
@@ -602,10 +664,18 @@ struct key *request_key_with_auxdata(struct key_type *type,
 EXPORT_SYMBOL(request_key_with_auxdata);
 
 /*
- * request a key (allow async construction)
- * - search the process's keyrings
- * - check the list of keys being created or updated
- * - call out to userspace for a key if supplementary info was provided
+ * request_key_async - Request a key (allow async construction)
+ * @type: Type of key.
+ * @description: The searchable description of the key.
+ * @callout_info: The data to pass to the instantiation upcall (or NULL).
+ * @callout_len: The length of callout_info.
+ *
+ * As for request_key_and_link() except that it does not add the returned key
+ * to a keyring if found, new keys are always allocated in the user's quota and
+ * no auxiliary data can be passed.
+ *
+ * The caller should call wait_for_key_construction() to wait for the
+ * completion of the returned key if it is still undergoing construction.
  */
 struct key *request_key_async(struct key_type *type,
                              const char *description,
@@ -620,9 +690,17 @@ EXPORT_SYMBOL(request_key_async);
 
 /*
  * request a key with auxiliary data for the upcaller (allow async construction)
- * - search the process's keyrings
- * - check the list of keys being created or updated
- * - call out to userspace for a key if supplementary info was provided
+ * @type: Type of key.
+ * @description: The searchable description of the key.
+ * @callout_info: The data to pass to the instantiation upcall (or NULL).
+ * @callout_len: The length of callout_info.
+ * @aux: Auxiliary data for the upcall.
+ *
+ * As for request_key_and_link() except that it does not add the returned key
+ * to a keyring if found and new keys are always allocated in the user's quota.
+ *
+ * The caller should call wait_for_key_construction() to wait for the
+ * completion of the returned key if it is still undergoing construction.
  */
 struct key *request_key_async_with_auxdata(struct key_type *type,
                                           const char *description,
index 86747151ee5b680ea1591bfb00aed4475e104f5f..68164031a74e0bc225844037ceedd45a40fc94cb 100644 (file)
@@ -1,4 +1,4 @@
-/* request_key_auth.c: request key authorisation controlling key def
+/* Request key authorisation token key definition.
  *
  * Copyright (C) 2005 Red Hat, Inc. All Rights Reserved.
  * Written by David Howells (dhowells@redhat.com)
@@ -26,7 +26,7 @@ static void request_key_auth_destroy(struct key *);
 static long request_key_auth_read(const struct key *, char __user *, size_t);
 
 /*
- * the request-key authorisation key type definition
+ * The request-key authorisation key type definition.
  */
 struct key_type key_type_request_key_auth = {
        .name           = ".request_key_auth",
@@ -38,9 +38,8 @@ struct key_type key_type_request_key_auth = {
        .read           = request_key_auth_read,
 };
 
-/*****************************************************************************/
 /*
- * instantiate a request-key authorisation key
+ * Instantiate a request-key authorisation key.
  */
 static int request_key_auth_instantiate(struct key *key,
                                        const void *data,
@@ -48,12 +47,10 @@ static int request_key_auth_instantiate(struct key *key,
 {
        key->payload.data = (struct request_key_auth *) data;
        return 0;
+}
 
-} /* end request_key_auth_instantiate() */
-
-/*****************************************************************************/
 /*
- * reading a request-key authorisation key retrieves the callout information
+ * Describe an authorisation token.
  */
 static void request_key_auth_describe(const struct key *key,
                                      struct seq_file *m)
@@ -63,12 +60,10 @@ static void request_key_auth_describe(const struct key *key,
        seq_puts(m, "key:");
        seq_puts(m, key->description);
        seq_printf(m, " pid:%d ci:%zu", rka->pid, rka->callout_len);
+}
 
-} /* end request_key_auth_describe() */
-
-/*****************************************************************************/
 /*
- * read the callout_info data
+ * Read the callout_info data (retrieves the callout information).
  * - the key's semaphore is read-locked
  */
 static long request_key_auth_read(const struct key *key,
@@ -91,13 +86,12 @@ static long request_key_auth_read(const struct key *key,
        }
 
        return ret;
+}
 
-} /* end request_key_auth_read() */
-
-/*****************************************************************************/
 /*
- * handle revocation of an authorisation token key
- * - called with the key sem write-locked
+ * Handle revocation of an authorisation token key.
+ *
+ * Called with the key sem write-locked.
  */
 static void request_key_auth_revoke(struct key *key)
 {
@@ -109,12 +103,10 @@ static void request_key_auth_revoke(struct key *key)
                put_cred(rka->cred);
                rka->cred = NULL;
        }
+}
 
-} /* end request_key_auth_revoke() */
-
-/*****************************************************************************/
 /*
- * destroy an instantiation authorisation token key
+ * Destroy an instantiation authorisation token key.
  */
 static void request_key_auth_destroy(struct key *key)
 {
@@ -131,13 +123,11 @@ static void request_key_auth_destroy(struct key *key)
        key_put(rka->dest_keyring);
        kfree(rka->callout_info);
        kfree(rka);
+}
 
-} /* end request_key_auth_destroy() */
-
-/*****************************************************************************/
 /*
- * create an authorisation token for /sbin/request-key or whoever to gain
- * access to the caller's security data
+ * Create an authorisation token for /sbin/request-key or whoever to gain
+ * access to the caller's security data.
  */
 struct key *request_key_auth_new(struct key *target, const void *callout_info,
                                 size_t callout_len, struct key *dest_keyring)
@@ -228,12 +218,10 @@ error_alloc:
        kfree(rka);
        kleave("= %d", ret);
        return ERR_PTR(ret);
+}
 
-} /* end request_key_auth_new() */
-
-/*****************************************************************************/
 /*
- * see if an authorisation key is associated with a particular key
+ * See if an authorisation key is associated with a particular key.
  */
 static int key_get_instantiation_authkey_match(const struct key *key,
                                               const void *_id)
@@ -242,16 +230,11 @@ static int key_get_instantiation_authkey_match(const struct key *key,
        key_serial_t id = (key_serial_t)(unsigned long) _id;
 
        return rka->target_key->serial == id;
+}
 
-} /* end key_get_instantiation_authkey_match() */
-
-/*****************************************************************************/
 /*
- * get the authorisation key for instantiation of a specific key if attached to
- * the current process's keyrings
- * - this key is inserted into a keyring and that is set as /sbin/request-key's
- *   session keyring
- * - a target_id of zero specifies any valid token
+ * Search the current process's keyrings for the authorisation key for
+ * instantiation of a key.
  */
 struct key *key_get_instantiation_authkey(key_serial_t target_id)
 {
@@ -278,5 +261,4 @@ struct key *key_get_instantiation_authkey(key_serial_t target_id)
 
 error:
        return authkey;
-
-} /* end key_get_instantiation_authkey() */
+}
similarity index 98%
rename from security/keys/trusted_defined.c
rename to security/keys/trusted.c
index 975e9f29a52c63f98bf7f0416daeaf7bba17d872..83fc92e297cd2257a26c6cbeeaca2b0588deac4f 100644 (file)
@@ -29,7 +29,7 @@
 #include <linux/tpm.h>
 #include <linux/tpm_command.h>
 
-#include "trusted_defined.h"
+#include "trusted.h"
 
 static const char hmac_alg[] = "hmac(sha1)";
 static const char hash_alg[] = "sha1";
@@ -101,11 +101,13 @@ static int TSS_rawhmac(unsigned char *digest, const unsigned char *key,
                if (dlen == 0)
                        break;
                data = va_arg(argp, unsigned char *);
-               if (data == NULL)
-                       return -EINVAL;
+               if (data == NULL) {
+                       ret = -EINVAL;
+                       break;
+               }
                ret = crypto_shash_update(&sdesc->shash, data, dlen);
                if (ret < 0)
-                       goto out;
+                       break;
        }
        va_end(argp);
        if (!ret)
@@ -146,14 +148,17 @@ static int TSS_authhmac(unsigned char *digest, const unsigned char *key,
                if (dlen == 0)
                        break;
                data = va_arg(argp, unsigned char *);
-               ret = crypto_shash_update(&sdesc->shash, data, dlen);
-               if (ret < 0) {
-                       va_end(argp);
-                       goto out;
+               if (!data) {
+                       ret = -EINVAL;
+                       break;
                }
+               ret = crypto_shash_update(&sdesc->shash, data, dlen);
+               if (ret < 0)
+                       break;
        }
        va_end(argp);
-       ret = crypto_shash_final(&sdesc->shash, paramdigest);
+       if (!ret)
+               ret = crypto_shash_final(&sdesc->shash, paramdigest);
        if (!ret)
                ret = TSS_rawhmac(digest, key, keylen, SHA1_DIGEST_SIZE,
                                  paramdigest, TPM_NONCE_SIZE, h1,
@@ -222,13 +227,12 @@ static int TSS_checkhmac1(unsigned char *buffer,
                        break;
                dpos = va_arg(argp, unsigned int);
                ret = crypto_shash_update(&sdesc->shash, buffer + dpos, dlen);
-               if (ret < 0) {
-                       va_end(argp);
-                       goto out;
-               }
+               if (ret < 0)
+                       break;
        }
        va_end(argp);
-       ret = crypto_shash_final(&sdesc->shash, paramdigest);
+       if (!ret)
+               ret = crypto_shash_final(&sdesc->shash, paramdigest);
        if (ret < 0)
                goto out;
 
@@ -316,13 +320,12 @@ static int TSS_checkhmac2(unsigned char *buffer,
                        break;
                dpos = va_arg(argp, unsigned int);
                ret = crypto_shash_update(&sdesc->shash, buffer + dpos, dlen);
-               if (ret < 0) {
-                       va_end(argp);
-                       goto out;
-               }
+               if (ret < 0)
+                       break;
        }
        va_end(argp);
-       ret = crypto_shash_final(&sdesc->shash, paramdigest);
+       if (!ret)
+               ret = crypto_shash_final(&sdesc->shash, paramdigest);
        if (ret < 0)
                goto out;
 
@@ -511,7 +514,7 @@ static int tpm_seal(struct tpm_buf *tb, uint16_t keytype,
        /* get session for sealing key */
        ret = osap(tb, &sess, keyauth, keytype, keyhandle);
        if (ret < 0)
-               return ret;
+               goto out;
        dump_sess(&sess);
 
        /* calculate encrypted authorization value */
@@ -519,11 +522,11 @@ static int tpm_seal(struct tpm_buf *tb, uint16_t keytype,
        memcpy(td->xorwork + SHA1_DIGEST_SIZE, sess.enonce, SHA1_DIGEST_SIZE);
        ret = TSS_sha1(td->xorwork, SHA1_DIGEST_SIZE * 2, td->xorhash);
        if (ret < 0)
-               return ret;
+               goto out;
 
        ret = tpm_get_random(tb, td->nonceodd, TPM_NONCE_SIZE);
        if (ret < 0)
-               return ret;
+               goto out;
        ordinal = htonl(TPM_ORD_SEAL);
        datsize = htonl(datalen);
        pcrsize = htonl(pcrinfosize);
@@ -552,7 +555,7 @@ static int tpm_seal(struct tpm_buf *tb, uint16_t keytype,
                                   &datsize, datalen, data, 0, 0);
        }
        if (ret < 0)
-               return ret;
+               goto out;
 
        /* build and send the TPM request packet */
        INIT_BUF(tb);
@@ -572,7 +575,7 @@ static int tpm_seal(struct tpm_buf *tb, uint16_t keytype,
 
        ret = trusted_tpm_send(TPM_ANY_NUM, tb->data, MAX_BUF_SIZE);
        if (ret < 0)
-               return ret;
+               goto out;
 
        /* calculate the size of the returned Blob */
        sealinfosize = LOAD32(tb->data, TPM_DATA_OFFSET + sizeof(uint32_t));
@@ -591,6 +594,8 @@ static int tpm_seal(struct tpm_buf *tb, uint16_t keytype,
                memcpy(blob, tb->data + TPM_DATA_OFFSET, storedsize);
                *bloblen = storedsize;
        }
+out:
+       kfree(td);
        return ret;
 }
 
@@ -1027,6 +1032,7 @@ static int trusted_update(struct key *key, const void *data, size_t datalen)
        ret = datablob_parse(datablob, new_p, new_o);
        if (ret != Opt_update) {
                ret = -EINVAL;
+               kfree(new_p);
                goto out;
        }
        /* copy old key values, and reseal with new pcrs */
index e9aa079296561507835e0e349a55f07b11bec5bb..02807fb163401bcbc9ff5cfc74bd6576b06ec918 100644 (file)
@@ -35,7 +35,6 @@ struct key_type key_type_user = {
 
 EXPORT_SYMBOL_GPL(key_type_user);
 
-/*****************************************************************************/
 /*
  * instantiate a user defined key
  */
@@ -65,12 +64,10 @@ int user_instantiate(struct key *key, const void *data, size_t datalen)
 
 error:
        return ret;
-
-} /* end user_instantiate() */
+}
 
 EXPORT_SYMBOL_GPL(user_instantiate);
 
-/*****************************************************************************/
 /*
  * dispose of the old data from an updated user defined key
  */
@@ -81,10 +78,8 @@ static void user_update_rcu_disposal(struct rcu_head *rcu)
        upayload = container_of(rcu, struct user_key_payload, rcu);
 
        kfree(upayload);
+}
 
-} /* end user_update_rcu_disposal() */
-
-/*****************************************************************************/
 /*
  * update a user defined key
  * - the key's semaphore is write-locked
@@ -123,24 +118,20 @@ int user_update(struct key *key, const void *data, size_t datalen)
 
 error:
        return ret;
-
-} /* end user_update() */
+}
 
 EXPORT_SYMBOL_GPL(user_update);
 
-/*****************************************************************************/
 /*
  * match users on their name
  */
 int user_match(const struct key *key, const void *description)
 {
        return strcmp(key->description, description) == 0;
-
-} /* end user_match() */
+}
 
 EXPORT_SYMBOL_GPL(user_match);
 
-/*****************************************************************************/
 /*
  * dispose of the links from a revoked keyring
  * - called with the key sem write-locked
@@ -156,12 +147,10 @@ void user_revoke(struct key *key)
                rcu_assign_pointer(key->payload.data, NULL);
                call_rcu(&upayload->rcu, user_update_rcu_disposal);
        }
-
-} /* end user_revoke() */
+}
 
 EXPORT_SYMBOL(user_revoke);
 
-/*****************************************************************************/
 /*
  * dispose of the data dangling from the corpse of a user key
  */
@@ -170,12 +159,10 @@ void user_destroy(struct key *key)
        struct user_key_payload *upayload = key->payload.data;
 
        kfree(upayload);
-
-} /* end user_destroy() */
+}
 
 EXPORT_SYMBOL_GPL(user_destroy);
 
-/*****************************************************************************/
 /*
  * describe the user key
  */
@@ -184,12 +171,10 @@ void user_describe(const struct key *key, struct seq_file *m)
        seq_puts(m, key->description);
 
        seq_printf(m, ": %u", key->datalen);
-
-} /* end user_describe() */
+}
 
 EXPORT_SYMBOL_GPL(user_describe);
 
-/*****************************************************************************/
 /*
  * read the key data
  * - the key's semaphore is read-locked
@@ -213,7 +198,6 @@ long user_read(const struct key *key, char __user *buffer, size_t buflen)
        }
 
        return ret;
-
-} /* end user_read() */
+}
 
 EXPORT_SYMBOL_GPL(user_read);
index c3f845cbcd48b6019dae5c3ca7df2bf4317a3b01..a53373207fb459223e52fadd718e5a2cc2dbb666 100644 (file)
@@ -178,7 +178,7 @@ int cond_init_bool_indexes(struct policydb *p)
        p->bool_val_to_struct = (struct cond_bool_datum **)
                kmalloc(p->p_bools.nprim * sizeof(struct cond_bool_datum *), GFP_KERNEL);
        if (!p->bool_val_to_struct)
-               return -1;
+               return -ENOMEM;
        return 0;
 }
 
index be9de387283722607dc025fd52095c3fdf6f6883..57363562f0f886a455e900fdf59a56417b379127 100644 (file)
@@ -501,8 +501,8 @@ static int policydb_index(struct policydb *p)
        if (rc)
                goto out;
 
-       rc = -ENOMEM;
-       if (cond_init_bool_indexes(p))
+       rc = cond_init_bool_indexes(p);
+       if (rc)
                goto out;
 
        for (i = 0; i < SYM_NUM; i++) {
index 0fc614ce16c1fe196f6c1b7913dd1179afb03f00..cb62d178b3e02d3ce3648ec5846068fa9c4ddfd6 100644 (file)
@@ -1961,7 +1961,7 @@ static int snd_ac97_dev_disconnect(struct snd_device *device)
 }
 
 /* build_ops to do nothing */
-static struct snd_ac97_build_ops null_build_ops;
+static const struct snd_ac97_build_ops null_build_ops;
 
 #ifdef CONFIG_SND_AC97_POWER_SAVE
 static void do_update_power(struct work_struct *work)
index e68c98ef4041508c2f9a2361172ab592be3ec90c..bf47574ca1f0c9240023c5a71579218a851bda73 100644 (file)
@@ -371,7 +371,7 @@ static int patch_yamaha_ymf743_build_spdif(struct snd_ac97 *ac97)
        return 0;
 }
 
-static struct snd_ac97_build_ops patch_yamaha_ymf743_ops = {
+static const struct snd_ac97_build_ops patch_yamaha_ymf743_ops = {
        .build_spdif    = patch_yamaha_ymf743_build_spdif,
        .build_3d       = patch_yamaha_ymf7x3_3d,
 };
@@ -455,7 +455,7 @@ static int patch_yamaha_ymf753_post_spdif(struct snd_ac97 * ac97)
        return 0;
 }
 
-static struct snd_ac97_build_ops patch_yamaha_ymf753_ops = {
+static const struct snd_ac97_build_ops patch_yamaha_ymf753_ops = {
        .build_3d       = patch_yamaha_ymf7x3_3d,
        .build_post_spdif = patch_yamaha_ymf753_post_spdif
 };
@@ -502,7 +502,7 @@ static int patch_wolfson_wm9703_specific(struct snd_ac97 * ac97)
        return 0;
 }
 
-static struct snd_ac97_build_ops patch_wolfson_wm9703_ops = {
+static const struct snd_ac97_build_ops patch_wolfson_wm9703_ops = {
        .build_specific = patch_wolfson_wm9703_specific,
 };
 
@@ -533,7 +533,7 @@ static int patch_wolfson_wm9704_specific(struct snd_ac97 * ac97)
        return 0;
 }
 
-static struct snd_ac97_build_ops patch_wolfson_wm9704_ops = {
+static const struct snd_ac97_build_ops patch_wolfson_wm9704_ops = {
        .build_specific = patch_wolfson_wm9704_specific,
 };
 
@@ -677,7 +677,7 @@ static int patch_wolfson_wm9711_specific(struct snd_ac97 * ac97)
        return 0;
 }
 
-static struct snd_ac97_build_ops patch_wolfson_wm9711_ops = {
+static const struct snd_ac97_build_ops patch_wolfson_wm9711_ops = {
        .build_specific = patch_wolfson_wm9711_specific,
 };
 
@@ -871,7 +871,7 @@ static void patch_wolfson_wm9713_resume (struct snd_ac97 * ac97)
 }
 #endif
 
-static struct snd_ac97_build_ops patch_wolfson_wm9713_ops = {
+static const struct snd_ac97_build_ops patch_wolfson_wm9713_ops = {
        .build_specific = patch_wolfson_wm9713_specific,
        .build_3d = patch_wolfson_wm9713_3d,
 #ifdef CONFIG_PM       
@@ -976,7 +976,7 @@ static int patch_sigmatel_stac97xx_specific(struct snd_ac97 * ac97)
        return 0;
 }
 
-static struct snd_ac97_build_ops patch_sigmatel_stac9700_ops = {
+static const struct snd_ac97_build_ops patch_sigmatel_stac9700_ops = {
        .build_3d       = patch_sigmatel_stac9700_3d,
        .build_specific = patch_sigmatel_stac97xx_specific
 };
@@ -1023,7 +1023,7 @@ static int patch_sigmatel_stac9708_specific(struct snd_ac97 *ac97)
        return patch_sigmatel_stac97xx_specific(ac97);
 }
 
-static struct snd_ac97_build_ops patch_sigmatel_stac9708_ops = {
+static const struct snd_ac97_build_ops patch_sigmatel_stac9708_ops = {
        .build_3d       = patch_sigmatel_stac9708_3d,
        .build_specific = patch_sigmatel_stac9708_specific
 };
@@ -1252,7 +1252,7 @@ static int patch_sigmatel_stac9758_specific(struct snd_ac97 *ac97)
        return 0;
 }
 
-static struct snd_ac97_build_ops patch_sigmatel_stac9758_ops = {
+static const struct snd_ac97_build_ops patch_sigmatel_stac9758_ops = {
        .build_3d       = patch_sigmatel_stac9700_3d,
        .build_specific = patch_sigmatel_stac9758_specific
 };
@@ -1327,7 +1327,7 @@ static int patch_cirrus_build_spdif(struct snd_ac97 * ac97)
        return 0;
 }
 
-static struct snd_ac97_build_ops patch_cirrus_ops = {
+static const struct snd_ac97_build_ops patch_cirrus_ops = {
        .build_spdif = patch_cirrus_build_spdif
 };
 
@@ -1384,7 +1384,7 @@ static int patch_conexant_build_spdif(struct snd_ac97 * ac97)
        return 0;
 }
 
-static struct snd_ac97_build_ops patch_conexant_ops = {
+static const struct snd_ac97_build_ops patch_conexant_ops = {
        .build_spdif = patch_conexant_build_spdif
 };
 
@@ -1560,7 +1560,7 @@ static void patch_ad1881_chained(struct snd_ac97 * ac97, int unchained_idx, int
        }
 }
 
-static struct snd_ac97_build_ops patch_ad1881_build_ops = {
+static const struct snd_ac97_build_ops patch_ad1881_build_ops = {
 #ifdef CONFIG_PM
        .resume = ad18xx_resume
 #endif
@@ -1647,7 +1647,7 @@ static int patch_ad1885_specific(struct snd_ac97 * ac97)
        return 0;
 }
 
-static struct snd_ac97_build_ops patch_ad1885_build_ops = {
+static const struct snd_ac97_build_ops patch_ad1885_build_ops = {
        .build_specific = &patch_ad1885_specific,
 #ifdef CONFIG_PM
        .resume = ad18xx_resume
@@ -1674,7 +1674,7 @@ static int patch_ad1886_specific(struct snd_ac97 * ac97)
        return 0;
 }
 
-static struct snd_ac97_build_ops patch_ad1886_build_ops = {
+static const struct snd_ac97_build_ops patch_ad1886_build_ops = {
        .build_specific = &patch_ad1886_specific,
 #ifdef CONFIG_PM
        .resume = ad18xx_resume
@@ -1881,7 +1881,7 @@ static int patch_ad1981a_specific(struct snd_ac97 * ac97)
                                    ARRAY_SIZE(snd_ac97_ad1981x_jack_sense));
 }
 
-static struct snd_ac97_build_ops patch_ad1981a_build_ops = {
+static const struct snd_ac97_build_ops patch_ad1981a_build_ops = {
        .build_post_spdif = patch_ad198x_post_spdif,
        .build_specific = patch_ad1981a_specific,
 #ifdef CONFIG_PM
@@ -1936,7 +1936,7 @@ static int patch_ad1981b_specific(struct snd_ac97 *ac97)
                                    ARRAY_SIZE(snd_ac97_ad1981x_jack_sense));
 }
 
-static struct snd_ac97_build_ops patch_ad1981b_build_ops = {
+static const struct snd_ac97_build_ops patch_ad1981b_build_ops = {
        .build_post_spdif = patch_ad198x_post_spdif,
        .build_specific = patch_ad1981b_specific,
 #ifdef CONFIG_PM
@@ -2075,7 +2075,7 @@ static int patch_ad1888_specific(struct snd_ac97 *ac97)
        return patch_build_controls(ac97, snd_ac97_ad1888_controls, ARRAY_SIZE(snd_ac97_ad1888_controls));
 }
 
-static struct snd_ac97_build_ops patch_ad1888_build_ops = {
+static const struct snd_ac97_build_ops patch_ad1888_build_ops = {
        .build_post_spdif = patch_ad198x_post_spdif,
        .build_specific = patch_ad1888_specific,
 #ifdef CONFIG_PM
@@ -2124,7 +2124,7 @@ static int patch_ad1980_specific(struct snd_ac97 *ac97)
        return patch_build_controls(ac97, &snd_ac97_ad198x_2cmic, 1);
 }
 
-static struct snd_ac97_build_ops patch_ad1980_build_ops = {
+static const struct snd_ac97_build_ops patch_ad1980_build_ops = {
        .build_post_spdif = patch_ad198x_post_spdif,
        .build_specific = patch_ad1980_specific,
 #ifdef CONFIG_PM
@@ -2239,7 +2239,7 @@ static int patch_ad1985_specific(struct snd_ac97 *ac97)
                                    ARRAY_SIZE(snd_ac97_ad1985_controls));
 }
 
-static struct snd_ac97_build_ops patch_ad1985_build_ops = {
+static const struct snd_ac97_build_ops patch_ad1985_build_ops = {
        .build_post_spdif = patch_ad198x_post_spdif,
        .build_specific = patch_ad1985_specific,
 #ifdef CONFIG_PM
@@ -2531,7 +2531,7 @@ static int patch_ad1986_specific(struct snd_ac97 *ac97)
                                    ARRAY_SIZE(snd_ac97_ad1985_controls));
 }
 
-static struct snd_ac97_build_ops patch_ad1986_build_ops = {
+static const struct snd_ac97_build_ops patch_ad1986_build_ops = {
        .build_post_spdif = patch_ad198x_post_spdif,
        .build_specific = patch_ad1986_specific,
 #ifdef CONFIG_PM
@@ -2636,7 +2636,7 @@ static int patch_alc650_specific(struct snd_ac97 * ac97)
        return 0;
 }
 
-static struct snd_ac97_build_ops patch_alc650_ops = {
+static const struct snd_ac97_build_ops patch_alc650_ops = {
        .build_specific = patch_alc650_specific,
        .update_jacks = alc650_update_jacks
 };
@@ -2788,7 +2788,7 @@ static int patch_alc655_specific(struct snd_ac97 * ac97)
        return 0;
 }
 
-static struct snd_ac97_build_ops patch_alc655_ops = {
+static const struct snd_ac97_build_ops patch_alc655_ops = {
        .build_specific = patch_alc655_specific,
        .update_jacks = alc655_update_jacks
 };
@@ -2900,7 +2900,7 @@ static int patch_alc850_specific(struct snd_ac97 *ac97)
        return 0;
 }
 
-static struct snd_ac97_build_ops patch_alc850_ops = {
+static const struct snd_ac97_build_ops patch_alc850_ops = {
        .build_specific = patch_alc850_specific,
        .update_jacks = alc850_update_jacks
 };
@@ -2962,7 +2962,7 @@ static int patch_cm9738_specific(struct snd_ac97 * ac97)
        return patch_build_controls(ac97, snd_ac97_cm9738_controls, ARRAY_SIZE(snd_ac97_cm9738_controls));
 }
 
-static struct snd_ac97_build_ops patch_cm9738_ops = {
+static const struct snd_ac97_build_ops patch_cm9738_ops = {
        .build_specific = patch_cm9738_specific,
        .update_jacks = cm9738_update_jacks
 };
@@ -3053,7 +3053,7 @@ static int patch_cm9739_post_spdif(struct snd_ac97 * ac97)
        return patch_build_controls(ac97, snd_ac97_cm9739_controls_spdif, ARRAY_SIZE(snd_ac97_cm9739_controls_spdif));
 }
 
-static struct snd_ac97_build_ops patch_cm9739_ops = {
+static const struct snd_ac97_build_ops patch_cm9739_ops = {
        .build_specific = patch_cm9739_specific,
        .build_post_spdif = patch_cm9739_post_spdif,
        .update_jacks = cm9739_update_jacks
@@ -3227,7 +3227,7 @@ static int patch_cm9761_specific(struct snd_ac97 * ac97)
        return patch_build_controls(ac97, snd_ac97_cm9761_controls, ARRAY_SIZE(snd_ac97_cm9761_controls));
 }
 
-static struct snd_ac97_build_ops patch_cm9761_ops = {
+static const struct snd_ac97_build_ops patch_cm9761_ops = {
        .build_specific = patch_cm9761_specific,
        .build_post_spdif = patch_cm9761_post_spdif,
        .update_jacks = cm9761_update_jacks
@@ -3323,7 +3323,7 @@ static int patch_cm9780_specific(struct snd_ac97 *ac97)
        return patch_build_controls(ac97, cm9780_controls, ARRAY_SIZE(cm9780_controls));
 }
 
-static struct snd_ac97_build_ops patch_cm9780_ops = {
+static const struct snd_ac97_build_ops patch_cm9780_ops = {
        .build_specific = patch_cm9780_specific,
        .build_post_spdif = patch_cm9761_post_spdif     /* identical with CM9761 */
 };
@@ -3443,7 +3443,7 @@ static int patch_vt1616_specific(struct snd_ac97 * ac97)
        return 0;
 }
 
-static struct snd_ac97_build_ops patch_vt1616_ops = {
+static const struct snd_ac97_build_ops patch_vt1616_ops = {
        .build_specific = patch_vt1616_specific
 };
 
@@ -3797,7 +3797,7 @@ static int patch_it2646_specific(struct snd_ac97 * ac97)
        return 0;
 }
 
-static struct snd_ac97_build_ops patch_it2646_ops = {
+static const struct snd_ac97_build_ops patch_it2646_ops = {
        .build_specific = patch_it2646_specific,
        .update_jacks = it2646_update_jacks
 };
@@ -3831,7 +3831,7 @@ static int patch_si3036_specific(struct snd_ac97 * ac97)
        return 0;
 }
 
-static struct snd_ac97_build_ops patch_si3036_ops = {
+static const struct snd_ac97_build_ops patch_si3036_ops = {
        .build_specific = patch_si3036_specific,
 };
 
@@ -3898,7 +3898,7 @@ static int patch_ucb1400_specific(struct snd_ac97 * ac97)
        return 0;
 }
 
-static struct snd_ac97_build_ops patch_ucb1400_ops = {
+static const struct snd_ac97_build_ops patch_ucb1400_ops = {
        .build_specific = patch_ucb1400_specific,
 };
 
index b9d2f202cf9b4385db4291d5fb919cf6365525ab..5439d662d1047377ddd7d832dbd1791e0ce887fe 100644 (file)
@@ -42,11 +42,7 @@ static struct snd_pcm_hardware snd_vortex_playback_hw_adb = {
        .rate_min = 5000,
        .rate_max = 48000,
        .channels_min = 1,
-#ifdef CHIP_AU8830
-       .channels_max = 4,
-#else
        .channels_max = 2,
-#endif
        .buffer_bytes_max = 0x10000,
        .period_bytes_min = 0x1,
        .period_bytes_max = 0x1000,
@@ -115,6 +111,17 @@ static struct snd_pcm_hardware snd_vortex_playback_hw_wt = {
        .periods_max = 64,
 };
 #endif
+#ifdef CHIP_AU8830
+static unsigned int au8830_channels[3] = {
+       1, 2, 4,
+};
+
+static struct snd_pcm_hw_constraint_list hw_constraints_au8830_channels = {
+       .count = ARRAY_SIZE(au8830_channels),
+       .list = au8830_channels,
+       .mask = 0,
+};
+#endif
 /* open callback */
 static int snd_vortex_pcm_open(struct snd_pcm_substream *substream)
 {
@@ -156,6 +163,15 @@ static int snd_vortex_pcm_open(struct snd_pcm_substream *substream)
                if (VORTEX_PCM_TYPE(substream->pcm) == VORTEX_PCM_ADB
                    || VORTEX_PCM_TYPE(substream->pcm) == VORTEX_PCM_I2S)
                        runtime->hw = snd_vortex_playback_hw_adb;
+#ifdef CHIP_AU8830
+               if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK &&
+                       VORTEX_PCM_TYPE(substream->pcm) == VORTEX_PCM_ADB) {
+                       runtime->hw.channels_max = 4;
+                       snd_pcm_hw_constraint_list(runtime, 0,
+                               SNDRV_PCM_HW_PARAM_CHANNELS,
+                               &hw_constraints_au8830_channels);
+               }
+#endif
                substream->runtime->private_data = NULL;
        }
 #ifndef CHIP_AU8810
index 05e5ec88c2d93c35c9b96b08ad00d652bb3a1d98..ae5c5d5e4b7ce73aaef33052d2707e0847a6e15b 100644 (file)
@@ -2134,10 +2134,10 @@ int snd_hda_codec_reset(struct hda_codec *codec)
  * This function returns zero if successful or a negative error code.
  */
 int snd_hda_add_vmaster(struct hda_codec *codec, char *name,
-                       unsigned int *tlv, const char **slaves)
+                       unsigned int *tlv, const char * const *slaves)
 {
        struct snd_kcontrol *kctl;
-       const char **s;
+       const char * const *s;
        int err;
 
        for (s = slaves; *s && !snd_hda_find_mixer_ctl(codec, *s); s++)
@@ -3689,7 +3689,7 @@ EXPORT_SYMBOL_HDA(snd_hda_build_pcms);
  * If no entries are matching, the function returns a negative value.
  */
 int snd_hda_check_board_config(struct hda_codec *codec,
-                              int num_configs, const char **models,
+                              int num_configs, const char * const *models,
                               const struct snd_pci_quirk *tbl)
 {
        if (codec->modelname && models) {
@@ -3753,7 +3753,7 @@ EXPORT_SYMBOL_HDA(snd_hda_check_board_config);
  * If no entries are matching, the function returns a negative value.
  */
 int snd_hda_check_board_codec_sid_config(struct hda_codec *codec,
-                              int num_configs, const char **models,
+                              int num_configs, const char * const *models,
                               const struct snd_pci_quirk *tbl)
 {
        const struct snd_pci_quirk *q;
@@ -4690,7 +4690,7 @@ const char *hda_get_input_pin_label(struct hda_codec *codec, hda_nid_t pin,
                                        int check_location)
 {
        unsigned int def_conf;
-       static const char *mic_names[] = {
+       static const char * const mic_names[] = {
                "Internal Mic", "Dock Mic", "Mic", "Front Mic", "Rear Mic",
        };
        int attr;
index fb0582f8d72503905566f3db047e4f8c65fc7f68..a63c54d9d767a4219890c7a40b9741c6ce72da73 100644 (file)
@@ -762,7 +762,8 @@ static int check_existing_control(struct hda_codec *codec, const char *type, con
 /*
  * build output mixer controls
  */
-static int create_output_mixers(struct hda_codec *codec, const char **names)
+static int create_output_mixers(struct hda_codec *codec,
+                               const char * const *names)
 {
        struct hda_gspec *spec = codec->spec;
        int i, err;
@@ -780,8 +781,8 @@ static int create_output_mixers(struct hda_codec *codec, const char **names)
 static int build_output_controls(struct hda_codec *codec)
 {
        struct hda_gspec *spec = codec->spec;
-       static const char *types_speaker[] = { "Speaker", "Headphone" };
-       static const char *types_line[] = { "Front", "Headphone" };
+       static const char * const types_speaker[] = { "Speaker", "Headphone" };
+       static const char * const types_line[] = { "Front", "Headphone" };
 
        switch (spec->pcm_vol_nodes) {
        case 1:
index d3d18be483e1be12aee7afb426d31afcfbc279b8..2e91a991eb15d288eeac21e5584076ecdf480c13 100644 (file)
@@ -2809,6 +2809,8 @@ static DEFINE_PCI_DEVICE_TABLE(azx_ids) = {
 #endif
        /* Vortex86MX */
        { PCI_DEVICE(0x17f3, 0x3010), .driver_data = AZX_DRIVER_GENERIC },
+       /* VMware HDAudio */
+       { PCI_DEVICE(0x15ad, 0x1977), .driver_data = AZX_DRIVER_GENERIC },
        /* AMD/ATI Generic, PCI class code and Vendor ID for HD Audio */
        { PCI_DEVICE(PCI_VENDOR_ID_ATI, PCI_ANY_ID),
          .class = PCI_CLASS_MULTIMEDIA_HD_AUDIO << 8,
index 46bbefe2e4a9465189d2341d42825f1439d17a40..3ab5e7a303db23a4d7f0af841f7bece6bba880c9 100644 (file)
@@ -140,7 +140,7 @@ void snd_hda_set_vmaster_tlv(struct hda_codec *codec, hda_nid_t nid, int dir,
 struct snd_kcontrol *snd_hda_find_mixer_ctl(struct hda_codec *codec,
                                            const char *name);
 int snd_hda_add_vmaster(struct hda_codec *codec, char *name,
-                       unsigned int *tlv, const char **slaves);
+                       unsigned int *tlv, const char * const *slaves);
 int snd_hda_codec_reset(struct hda_codec *codec);
 
 /* amp value bits */
@@ -341,10 +341,10 @@ void snd_print_pcm_bits(int pcm, char *buf, int buflen);
  * Misc
  */
 int snd_hda_check_board_config(struct hda_codec *codec, int num_configs,
-                              const char **modelnames,
+                              const char * const *modelnames,
                               const struct snd_pci_quirk *pci_list);
 int snd_hda_check_board_codec_sid_config(struct hda_codec *codec,
-                               int num_configs, const char **models,
+                               int num_configs, const char * const *models,
                                const struct snd_pci_quirk *tbl);
 int snd_hda_add_new_ctls(struct hda_codec *codec,
                         struct snd_kcontrol_new *knew);
index f025200f2a62466fdec6a86ffbe8ae18e0ad6c15..bfe74c2fb0795b0da254d7c3bf1670a802148b91 100644 (file)
@@ -418,7 +418,7 @@ static void print_digital_conv(struct snd_info_buffer *buffer,
 
 static const char *get_pwr_state(u32 state)
 {
-       static const char *buf[4] = {
+       static const char * const buf[4] = {
                "D0", "D1", "D2", "D3"
        };
        if (state < 4)
index 46780670162b2f7d0f28881bb787deb2953e0843..8dabab798689bfc65456d7859bfa439558103c84 100644 (file)
@@ -46,6 +46,9 @@ struct ad198x_spec {
        unsigned int cur_eapd;
        unsigned int need_dac_fix;
 
+       hda_nid_t *alt_dac_nid;
+       struct hda_pcm_stream *stream_analog_alt_playback;
+
        /* capture */
        unsigned int num_adc_nids;
        hda_nid_t *adc_nids;
@@ -81,8 +84,8 @@ struct ad198x_spec {
 #endif
        /* for virtual master */
        hda_nid_t vmaster_nid;
-       const char **slave_vols;
-       const char **slave_sws;
+       const char * const *slave_vols;
+       const char * const *slave_sws;
 };
 
 /*
@@ -130,7 +133,7 @@ static int ad198x_init(struct hda_codec *codec)
        return 0;
 }
 
-static const char *ad_slave_vols[] = {
+static const char * const ad_slave_vols[] = {
        "Front Playback Volume",
        "Surround Playback Volume",
        "Center Playback Volume",
@@ -143,7 +146,7 @@ static const char *ad_slave_vols[] = {
        NULL
 };
 
-static const char *ad_slave_sws[] = {
+static const char * const ad_slave_sws[] = {
        "Front Playback Switch",
        "Surround Playback Switch",
        "Center Playback Switch",
@@ -156,6 +159,25 @@ static const char *ad_slave_sws[] = {
        NULL
 };
 
+static const char * const ad1988_6stack_fp_slave_vols[] = {
+       "Front Playback Volume",
+       "Surround Playback Volume",
+       "Center Playback Volume",
+       "LFE Playback Volume",
+       "Side Playback Volume",
+       "IEC958 Playback Volume",
+       NULL
+};
+
+static const char * const ad1988_6stack_fp_slave_sws[] = {
+       "Front Playback Switch",
+       "Surround Playback Switch",
+       "Center Playback Switch",
+       "LFE Playback Switch",
+       "Side Playback Switch",
+       "IEC958 Playback Switch",
+       NULL
+};
 static void ad198x_free_kctls(struct hda_codec *codec);
 
 #ifdef CONFIG_SND_HDA_INPUT_BEEP
@@ -309,6 +331,38 @@ static int ad198x_playback_pcm_cleanup(struct hda_pcm_stream *hinfo,
        return snd_hda_multi_out_analog_cleanup(codec, &spec->multiout);
 }
 
+static int ad198x_alt_playback_pcm_prepare(struct hda_pcm_stream *hinfo,
+                               struct hda_codec *codec,
+                               unsigned int stream_tag,
+                               unsigned int format,
+                               struct snd_pcm_substream *substream)
+{
+       struct ad198x_spec *spec = codec->spec;
+       snd_hda_codec_setup_stream(codec, spec->alt_dac_nid[0], stream_tag,
+                                       0, format);
+       return 0;
+}
+
+static int ad198x_alt_playback_pcm_cleanup(struct hda_pcm_stream *hinfo,
+                               struct hda_codec *codec,
+                               struct snd_pcm_substream *substream)
+{
+       struct ad198x_spec *spec = codec->spec;
+       snd_hda_codec_cleanup_stream(codec, spec->alt_dac_nid[0]);
+       return 0;
+}
+
+static struct hda_pcm_stream ad198x_pcm_analog_alt_playback = {
+       .substreams = 1,
+       .channels_min = 2,
+       .channels_max = 2,
+       /* NID is set in ad198x_build_pcms */
+       .ops = {
+               .prepare = ad198x_alt_playback_pcm_prepare,
+               .cleanup = ad198x_alt_playback_pcm_cleanup
+       },
+};
+
 /*
  * Digital out
  */
@@ -446,6 +500,17 @@ static int ad198x_build_pcms(struct hda_codec *codec)
                }
        }
 
+       if (spec->alt_dac_nid && spec->stream_analog_alt_playback) {
+               codec->num_pcms++;
+               info = spec->pcm_rec + 2;
+               info->name = "AD198x Headphone";
+               info->pcm_type = HDA_PCM_TYPE_AUDIO;
+               info->stream[SNDRV_PCM_STREAM_PLAYBACK] =
+                       *spec->stream_analog_alt_playback;
+               info->stream[SNDRV_PCM_STREAM_PLAYBACK].nid =
+                       spec->alt_dac_nid[0];
+       }
+
        return 0;
 }
 
@@ -1069,7 +1134,7 @@ enum {
        AD1986A_MODELS
 };
 
-static const char *ad1986a_models[AD1986A_MODELS] = {
+static const char * const ad1986a_models[AD1986A_MODELS] = {
        [AD1986A_6STACK]        = "6stack",
        [AD1986A_3STACK]        = "3stack",
        [AD1986A_LAPTOP]        = "laptop",
@@ -1813,7 +1878,7 @@ enum {
        AD1981_MODELS
 };
 
-static const char *ad1981_models[AD1981_MODELS] = {
+static const char * const ad1981_models[AD1981_MODELS] = {
        [AD1981_HP]             = "hp",
        [AD1981_THINKPAD]       = "thinkpad",
        [AD1981_BASIC]          = "basic",
@@ -2015,6 +2080,7 @@ static int patch_ad1981(struct hda_codec *codec)
 enum {
        AD1988_6STACK,
        AD1988_6STACK_DIG,
+       AD1988_6STACK_DIG_FP,
        AD1988_3STACK,
        AD1988_3STACK_DIG,
        AD1988_LAPTOP,
@@ -2047,6 +2113,10 @@ static hda_nid_t ad1988_6stack_dac_nids_rev2[4] = {
        0x04, 0x05, 0x0a, 0x06
 };
 
+static hda_nid_t ad1988_alt_dac_nid[1] = {
+       0x03
+};
+
 static hda_nid_t ad1988_3stack_dac_nids_rev2[3] = {
        0x04, 0x0a, 0x06
 };
@@ -2166,6 +2236,35 @@ static struct snd_kcontrol_new ad1988_6stack_mixers2[] = {
        { } /* end */
 };
 
+static struct snd_kcontrol_new ad1988_6stack_fp_mixers[] = {
+       HDA_CODEC_VOLUME("Headphone Playback Volume", 0x03, 0x0, HDA_OUTPUT),
+
+       HDA_BIND_MUTE("Front Playback Switch", 0x29, 2, HDA_INPUT),
+       HDA_BIND_MUTE("Surround Playback Switch", 0x2a, 2, HDA_INPUT),
+       HDA_BIND_MUTE_MONO("Center Playback Switch", 0x27, 1, 2, HDA_INPUT),
+       HDA_BIND_MUTE_MONO("LFE Playback Switch", 0x27, 2, 2, HDA_INPUT),
+       HDA_BIND_MUTE("Side Playback Switch", 0x28, 2, HDA_INPUT),
+       HDA_BIND_MUTE("Headphone Playback Switch", 0x22, 2, HDA_INPUT),
+       HDA_BIND_MUTE("Mono Playback Switch", 0x1e, 2, HDA_INPUT),
+
+       HDA_CODEC_VOLUME("CD Playback Volume", 0x20, 0x6, HDA_INPUT),
+       HDA_CODEC_MUTE("CD Playback Switch", 0x20, 0x6, HDA_INPUT),
+       HDA_CODEC_VOLUME("Front Mic Playback Volume", 0x20, 0x0, HDA_INPUT),
+       HDA_CODEC_MUTE("Front Mic Playback Switch", 0x20, 0x0, HDA_INPUT),
+       HDA_CODEC_VOLUME("Line Playback Volume", 0x20, 0x1, HDA_INPUT),
+       HDA_CODEC_MUTE("Line Playback Switch", 0x20, 0x1, HDA_INPUT),
+       HDA_CODEC_VOLUME("Mic Playback Volume", 0x20, 0x4, HDA_INPUT),
+       HDA_CODEC_MUTE("Mic Playback Switch", 0x20, 0x4, HDA_INPUT),
+
+       HDA_CODEC_VOLUME("Analog Mix Playback Volume", 0x21, 0x0, HDA_OUTPUT),
+       HDA_CODEC_MUTE("Analog Mix Playback Switch", 0x21, 0x0, HDA_OUTPUT),
+
+       HDA_CODEC_VOLUME("Front Mic Boost Volume", 0x39, 0x0, HDA_OUTPUT),
+       HDA_CODEC_VOLUME("Mic Boost Volume", 0x3c, 0x0, HDA_OUTPUT),
+
+       { } /* end */
+};
+
 /* 3-stack mode */
 static struct snd_kcontrol_new ad1988_3stack_mixers1[] = {
        HDA_CODEC_VOLUME("Front Playback Volume", 0x04, 0x0, HDA_OUTPUT),
@@ -2445,6 +2544,68 @@ static struct hda_verb ad1988_6stack_init_verbs[] = {
        { }
 };
 
+static struct hda_verb ad1988_6stack_fp_init_verbs[] = {
+       /* Front, Surround, CLFE, side DAC; unmute as default */
+       {0x04, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
+       {0x06, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
+       {0x05, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
+       {0x0a, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
+       /* Headphone; unmute as default */
+       {0x03, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
+       /* Port-A front headphon path */
+       {0x37, AC_VERB_SET_CONNECT_SEL, 0x00}, /* DAC0:03h */
+       {0x22, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
+       {0x22, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)},
+       {0x11, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
+       {0x11, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP},
+       /* Port-D line-out path */
+       {0x29, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
+       {0x29, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)},
+       {0x12, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
+       {0x12, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
+       /* Port-F surround path */
+       {0x2a, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
+       {0x2a, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)},
+       {0x16, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
+       {0x16, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
+       /* Port-G CLFE path */
+       {0x27, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
+       {0x27, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)},
+       {0x24, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
+       {0x24, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
+       /* Port-H side path */
+       {0x28, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
+       {0x28, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)},
+       {0x25, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
+       {0x25, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
+       /* Mono out path */
+       {0x36, AC_VERB_SET_CONNECT_SEL, 0x1}, /* DAC1:04h */
+       {0x1e, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
+       {0x1e, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)},
+       {0x13, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
+       {0x13, AC_VERB_SET_AMP_GAIN_MUTE, 0xb01f}, /* unmute, 0dB */
+       /* Port-B front mic-in path */
+       {0x14, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE},
+       {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80},
+       {0x39, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_ZERO},
+       /* Port-C line-in path */
+       {0x15, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE},
+       {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN},
+       {0x3a, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_ZERO},
+       {0x33, AC_VERB_SET_CONNECT_SEL, 0x0},
+       /* Port-E mic-in path */
+       {0x17, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE},
+       {0x17, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80},
+       {0x3c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_ZERO},
+       {0x34, AC_VERB_SET_CONNECT_SEL, 0x0},
+       /* Analog CD Input */
+       {0x18, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN},
+       /* Analog Mix output amp */
+       {0x21, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE | 0x1f}, /* 0dB */
+
+       { }
+};
+
 static struct hda_verb ad1988_capture_init_verbs[] = {
        /* mute analog mix */
        {0x20, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
@@ -2792,7 +2953,9 @@ static int ad1988_auto_create_multi_out_ctls(struct ad198x_spec *spec,
                                             const struct auto_pin_cfg *cfg)
 {
        char name[32];
-       static const char *chname[4] = { "Front", "Surround", NULL /*CLFE*/, "Side" };
+       static const char * const chname[4] = {
+               "Front", "Surround", NULL /*CLFE*/, "Side"
+       };
        hda_nid_t nid;
        int i, err;
 
@@ -3074,13 +3237,13 @@ static int ad1988_auto_init(struct hda_codec *codec)
        return 0;
 }
 
-
 /*
  */
 
-static const char *ad1988_models[AD1988_MODEL_LAST] = {
+static const char * const ad1988_models[AD1988_MODEL_LAST] = {
        [AD1988_6STACK]         = "6stack",
        [AD1988_6STACK_DIG]     = "6stack-dig",
+       [AD1988_6STACK_DIG_FP]  = "6stack-dig-fp",
        [AD1988_3STACK]         = "3stack",
        [AD1988_3STACK_DIG]     = "3stack-dig",
        [AD1988_LAPTOP]         = "laptop",
@@ -3140,6 +3303,7 @@ static int patch_ad1988(struct hda_codec *codec)
        switch (board_config) {
        case AD1988_6STACK:
        case AD1988_6STACK_DIG:
+       case AD1988_6STACK_DIG_FP:
                spec->multiout.max_channels = 8;
                spec->multiout.num_dacs = 4;
                if (is_rev2(codec))
@@ -3152,10 +3316,22 @@ static int patch_ad1988(struct hda_codec *codec)
                        spec->mixers[0] = ad1988_6stack_mixers1_rev2;
                else
                        spec->mixers[0] = ad1988_6stack_mixers1;
-               spec->mixers[1] = ad1988_6stack_mixers2;
+               if (board_config == AD1988_6STACK_DIG_FP) {
+                       spec->mixers[1] = ad1988_6stack_fp_mixers;
+                       spec->slave_vols = ad1988_6stack_fp_slave_vols;
+                       spec->slave_sws = ad1988_6stack_fp_slave_sws;
+                       spec->alt_dac_nid = ad1988_alt_dac_nid;
+                       spec->stream_analog_alt_playback =
+                               &ad198x_pcm_analog_alt_playback;
+               } else
+                       spec->mixers[1] = ad1988_6stack_mixers2;
                spec->num_init_verbs = 1;
-               spec->init_verbs[0] = ad1988_6stack_init_verbs;
-               if (board_config == AD1988_6STACK_DIG) {
+               if (board_config == AD1988_6STACK_DIG_FP)
+                       spec->init_verbs[0] = ad1988_6stack_fp_init_verbs;
+               else
+                       spec->init_verbs[0] = ad1988_6stack_init_verbs;
+               if ((board_config == AD1988_6STACK_DIG) ||
+                       (board_config == AD1988_6STACK_DIG_FP)) {
                        spec->multiout.dig_out_nid = AD1988_SPDIF_OUT;
                        spec->dig_in_nid = AD1988_SPDIF_IN;
                }
@@ -3399,7 +3575,7 @@ static struct hda_amp_list ad1884_loopbacks[] = {
 };
 #endif
 
-static const char *ad1884_slave_vols[] = {
+static const char * const ad1884_slave_vols[] = {
        "PCM Playback Volume",
        "Mic Playback Volume",
        "Mono Playback Volume",
@@ -3637,7 +3813,7 @@ enum {
        AD1984_MODELS
 };
 
-static const char *ad1984_models[AD1984_MODELS] = {
+static const char * const ad1984_models[AD1984_MODELS] = {
        [AD1984_BASIC]          = "basic",
        [AD1984_THINKPAD]       = "thinkpad",
        [AD1984_DELL_DESKTOP]   = "dell_desktop",
@@ -4308,7 +4484,7 @@ enum {
        AD1884A_MODELS
 };
 
-static const char *ad1884a_models[AD1884A_MODELS] = {
+static const char * const ad1884a_models[AD1884A_MODELS] = {
        [AD1884A_DESKTOP]       = "desktop",
        [AD1884A_LAPTOP]        = "laptop",
        [AD1884A_MOBILE]        = "mobile",
@@ -4696,7 +4872,7 @@ enum {
        AD1882_MODELS
 };
 
-static const char *ad1882_models[AD1986A_MODELS] = {
+static const char * const ad1882_models[AD1986A_MODELS] = {
        [AD1882_3STACK]         = "3stack",
        [AD1882_6STACK]         = "6stack",
 };
index 18af38ebf7579f5507fca391f66ba9280844ccf4..a07b031090d8fc30353d2c6ef0864ffe97d0750e 100644 (file)
@@ -490,7 +490,7 @@ static int parse_digital_input(struct hda_codec *codec)
  * create mixer controls
  */
 
-static const char *dir_sfx[2] = { "Playback", "Capture" };
+static const char * const dir_sfx[2] = { "Playback", "Capture" };
 
 static int add_mute(struct hda_codec *codec, const char *name, int index,
                    unsigned int pval, int dir, struct snd_kcontrol **kctlp)
@@ -1156,7 +1156,7 @@ static int cs_parse_auto_config(struct hda_codec *codec)
        return 0;
 }
 
-static const char *cs420x_models[CS420X_MODELS] = {
+static const char * const cs420x_models[CS420X_MODELS] = {
        [CS420X_MBP53] = "mbp53",
        [CS420X_MBP55] = "mbp55",
        [CS420X_IMAC27] = "imac27",
index ff60908f4554ad1b15bbbae2973929e25a9458ef..1f8bbcd0f80272d7f00946d32f9f1fe2d599b06b 100644 (file)
@@ -608,7 +608,7 @@ static void cmi9880_free(struct hda_codec *codec)
 /*
  */
 
-static const char *cmi9880_models[CMI_MODELS] = {
+static const char * const cmi9880_models[CMI_MODELS] = {
        [CMI_MINIMAL]   = "minimal",
        [CMI_MIN_FP]    = "min_fp",
        [CMI_FULL]      = "full",
index e96581fcdbdb280f99cc39270daff88526cf8d85..9bb030a469cd4fb72369ecc561d851917827eb7b 100644 (file)
@@ -537,13 +537,13 @@ static struct snd_kcontrol_new cxt_beep_mixer[] = {
 };
 #endif
 
-static const char *slave_vols[] = {
+static const char * const slave_vols[] = {
        "Headphone Playback Volume",
        "Speaker Playback Volume",
        NULL
 };
 
-static const char *slave_sws[] = {
+static const char * const slave_sws[] = {
        "Headphone Playback Switch",
        "Speaker Playback Switch",
        NULL
@@ -1134,7 +1134,7 @@ enum {
        CXT5045_MODELS
 };
 
-static const char *cxt5045_models[CXT5045_MODELS] = {
+static const char * const cxt5045_models[CXT5045_MODELS] = {
        [CXT5045_LAPTOP_HPSENSE]        = "laptop-hpsense",
        [CXT5045_LAPTOP_MICSENSE]       = "laptop-micsense",
        [CXT5045_LAPTOP_HPMICSENSE]     = "laptop-hpmicsense",
@@ -1579,7 +1579,7 @@ enum {
        CXT5047_MODELS
 };
 
-static const char *cxt5047_models[CXT5047_MODELS] = {
+static const char * const cxt5047_models[CXT5047_MODELS] = {
        [CXT5047_LAPTOP]        = "laptop",
        [CXT5047_LAPTOP_HP]     = "laptop-hp",
        [CXT5047_LAPTOP_EAPD]   = "laptop-eapd",
@@ -1995,7 +1995,7 @@ enum {
        CXT5051_MODELS
 };
 
-static const char *cxt5051_models[CXT5051_MODELS] = {
+static const char *const cxt5051_models[CXT5051_MODELS] = {
        [CXT5051_LAPTOP]        = "laptop",
        [CXT5051_HP]            = "hp",
        [CXT5051_HP_DV6736]     = "hp-dv6736",
@@ -3084,7 +3084,7 @@ enum {
        CXT5066_MODELS
 };
 
-static const char *cxt5066_models[CXT5066_MODELS] = {
+static const char * const cxt5066_models[CXT5066_MODELS] = {
        [CXT5066_LAPTOP]        = "laptop",
        [CXT5066_DELL_LAPTOP]   = "dell-laptop",
        [CXT5066_OLPC_XO_1_5]   = "olpc-xo-1_5",
@@ -3746,7 +3746,7 @@ static int cx_auto_build_output_controls(struct hda_codec *codec)
        struct conexant_spec *spec = codec->spec;
        int i, err;
        int num_line = 0, num_hp = 0, num_spk = 0;
-       static const char *texts[3] = { "Front", "Surround", "CLFE" };
+       static const char * const texts[3] = { "Front", "Surround", "CLFE" };
 
        if (spec->dac_info_filled == 1)
                return cx_auto_add_pb_volume(codec, spec->dac_info[0].dac,
index f29b97b5de8f36e53fc459e90cc8cc41870e54f5..2d5b83fa8d24fcf164e69f845fb1bc1c8f06a726 100644 (file)
@@ -817,6 +817,7 @@ static int hdmi_pcm_open(struct hda_pcm_stream *hinfo,
        struct hdmi_spec *spec = codec->spec;
        struct hdmi_eld *eld;
        struct hda_pcm_stream *codec_pars;
+       struct snd_pcm_runtime *runtime = substream->runtime;
        unsigned int idx;
 
        for (idx = 0; idx < spec->num_cvts; idx++)
@@ -844,6 +845,14 @@ static int hdmi_pcm_open(struct hda_pcm_stream *hinfo,
                hinfo->formats = codec_pars->formats;
                hinfo->maxbps = codec_pars->maxbps;
        }
+       /* store the updated parameters */
+       runtime->hw.channels_min = hinfo->channels_min;
+       runtime->hw.channels_max = hinfo->channels_max;
+       runtime->hw.formats = hinfo->formats;
+       runtime->hw.rates = hinfo->rates;
+
+       snd_pcm_hw_constraint_step(substream->runtime, 0,
+                                  SNDRV_PCM_HW_PARAM_CHANNELS, 2);
        return 0;
 }
 
@@ -1238,6 +1247,9 @@ static int simple_playback_pcm_open(struct hda_pcm_stream *hinfo,
                snd_pcm_hw_constraint_list(substream->runtime, 0,
                                SNDRV_PCM_HW_PARAM_CHANNELS,
                                hw_constraints_channels);
+       } else {
+               snd_pcm_hw_constraint_step(substream->runtime, 0,
+                                          SNDRV_PCM_HW_PARAM_CHANNELS, 2);
        }
 
        return snd_hda_multi_out_dig_open(codec, &spec->multiout);
index 51c08edd75636d6e30a580144fa6f2a2999f9eff..be4df4c6fd56bd585ad79b64ddabf6b9344d0f3c 100644 (file)
@@ -303,6 +303,8 @@ struct alc_customize_define {
        unsigned int  fixup:1; /* Means that this sku is set by driver, not read from hw */
 };
 
+struct alc_fixup;
+
 struct alc_spec {
        /* codec parameterization */
        struct snd_kcontrol_new *mixers[5];     /* mixer arrays */
@@ -404,6 +406,11 @@ struct alc_spec {
        /* for PLL fix */
        hda_nid_t pll_nid;
        unsigned int pll_coef_idx, pll_coef_bit;
+
+       /* fix-up list */
+       int fixup_id;
+       const struct alc_fixup *fixup_list;
+       const char *fixup_name;
 };
 
 /*
@@ -1683,88 +1690,133 @@ struct alc_model_fixup {
 };
 
 struct alc_fixup {
-       unsigned int sku;
-       const struct alc_pincfg *pins;
-       const struct hda_verb *verbs;
-       void (*func)(struct hda_codec *codec, const struct alc_fixup *fix,
-                    int pre_init);
+       int type;
+       bool chained;
+       int chain_id;
+       union {
+               unsigned int sku;
+               const struct alc_pincfg *pins;
+               const struct hda_verb *verbs;
+               void (*func)(struct hda_codec *codec,
+                            const struct alc_fixup *fix,
+                            int action);
+       } v;
 };
 
-static void __alc_pick_fixup(struct hda_codec *codec,
-                            const struct alc_fixup *fix,
-                            const char *modelname,
-                            int pre_init)
-{
-       const struct alc_pincfg *cfg;
-       struct alc_spec *spec;
+enum {
+       ALC_FIXUP_INVALID,
+       ALC_FIXUP_SKU,
+       ALC_FIXUP_PINS,
+       ALC_FIXUP_VERBS,
+       ALC_FIXUP_FUNC,
+};
 
-       cfg = fix->pins;
-       if (pre_init && fix->sku) {
-#ifdef CONFIG_SND_DEBUG_VERBOSE
-               snd_printdd(KERN_INFO "hda_codec: %s: Apply sku override for %s\n",
-                           codec->chip_name, modelname);
-#endif
-               spec = codec->spec;
-               spec->cdefine.sku_cfg = fix->sku;
-               spec->cdefine.fixup = 1;
-       }
-       if (pre_init && cfg) {
-#ifdef CONFIG_SND_DEBUG_VERBOSE
-               snd_printdd(KERN_INFO "hda_codec: %s: Apply pincfg for %s\n",
-                           codec->chip_name, modelname);
-#endif
-               for (; cfg->nid; cfg++)
-                       snd_hda_codec_set_pincfg(codec, cfg->nid, cfg->val);
-       }
-       if (!pre_init && fix->verbs) {
-#ifdef CONFIG_SND_DEBUG_VERBOSE
-               snd_printdd(KERN_INFO "hda_codec: %s: Apply fix-verbs for %s\n",
-                           codec->chip_name, modelname);
-#endif
-               add_verb(codec->spec, fix->verbs);
-       }
-       if (fix->func) {
-#ifdef CONFIG_SND_DEBUG_VERBOSE
-               snd_printdd(KERN_INFO "hda_codec: %s: Apply fix-func for %s\n",
-                           codec->chip_name, modelname);
-#endif
-               fix->func(codec, fix, pre_init);
-       }
-}
+enum {
+       ALC_FIXUP_ACT_PRE_PROBE,
+       ALC_FIXUP_ACT_PROBE,
+       ALC_FIXUP_ACT_INIT,
+};
 
-static void alc_pick_fixup(struct hda_codec *codec,
-                                const struct snd_pci_quirk *quirk,
-                                const struct alc_fixup *fix,
-                                int pre_init)
+static void alc_apply_fixup(struct hda_codec *codec, int action)
 {
-       quirk = snd_pci_quirk_lookup(codec->bus->pci, quirk);
-       if (quirk) {
-               fix += quirk->value;
+       struct alc_spec *spec = codec->spec;
+       int id = spec->fixup_id;
 #ifdef CONFIG_SND_DEBUG_VERBOSE
-               __alc_pick_fixup(codec, fix, quirk->name, pre_init);
-#else
-               __alc_pick_fixup(codec, fix, NULL, pre_init);
+       const char *modelname = spec->fixup_name;
 #endif
+       int depth = 0;
+
+       if (!spec->fixup_list)
+               return;
+
+       while (id >= 0) {
+               const struct alc_fixup *fix = spec->fixup_list + id;
+               const struct alc_pincfg *cfg;
+
+               switch (fix->type) {
+               case ALC_FIXUP_SKU:
+                       if (action != ALC_FIXUP_ACT_PRE_PROBE || !fix->v.sku)
+                               break;;
+                       snd_printdd(KERN_INFO "hda_codec: %s: "
+                                   "Apply sku override for %s\n",
+                                   codec->chip_name, modelname);
+                       spec->cdefine.sku_cfg = fix->v.sku;
+                       spec->cdefine.fixup = 1;
+                       break;
+               case ALC_FIXUP_PINS:
+                       cfg = fix->v.pins;
+                       if (action != ALC_FIXUP_ACT_PRE_PROBE || !cfg)
+                               break;
+                       snd_printdd(KERN_INFO "hda_codec: %s: "
+                                   "Apply pincfg for %s\n",
+                                   codec->chip_name, modelname);
+                       for (; cfg->nid; cfg++)
+                               snd_hda_codec_set_pincfg(codec, cfg->nid,
+                                                        cfg->val);
+                       break;
+               case ALC_FIXUP_VERBS:
+                       if (action != ALC_FIXUP_ACT_PROBE || !fix->v.verbs)
+                               break;
+                       snd_printdd(KERN_INFO "hda_codec: %s: "
+                                   "Apply fix-verbs for %s\n",
+                                   codec->chip_name, modelname);
+                       add_verb(codec->spec, fix->v.verbs);
+                       break;
+               case ALC_FIXUP_FUNC:
+                       if (!fix->v.func)
+                               break;
+                       snd_printdd(KERN_INFO "hda_codec: %s: "
+                                   "Apply fix-func for %s\n",
+                                   codec->chip_name, modelname);
+                       fix->v.func(codec, fix, action);
+                       break;
+               default:
+                       snd_printk(KERN_ERR "hda_codec: %s: "
+                                  "Invalid fixup type %d\n",
+                                  codec->chip_name, fix->type);
+                       break;
+               }
+               if (!fix[id].chained)
+                       break;
+               if (++depth > 10)
+                       break;
+               id = fix[id].chain_id;
        }
 }
 
-static void alc_pick_fixup_model(struct hda_codec *codec,
-                                const struct alc_model_fixup *models,
-                                const struct snd_pci_quirk *quirk,
-                                const struct alc_fixup *fix,
-                                int pre_init)
+static void alc_pick_fixup(struct hda_codec *codec,
+                          const struct alc_model_fixup *models,
+                          const struct snd_pci_quirk *quirk,
+                          const struct alc_fixup *fixlist)
 {
+       struct alc_spec *spec = codec->spec;
+       int id = -1;
+       const char *name = NULL;
+
        if (codec->modelname && models) {
                while (models->name) {
                        if (!strcmp(codec->modelname, models->name)) {
-                               fix += models->id;
+                               id = models->id;
+                               name = models->name;
                                break;
                        }
                        models++;
                }
-               __alc_pick_fixup(codec, fix, codec->modelname, pre_init);
-       } else {
-               alc_pick_fixup(codec, quirk, fix, pre_init);
+       }
+       if (id < 0) {
+               quirk = snd_pci_quirk_lookup(codec->bus->pci, quirk);
+               if (quirk) {
+                       id = quirk->value;
+#ifdef CONFIG_SND_DEBUG_VERBOSE
+                       name = quirk->name;
+#endif
+               }
+       }
+
+       spec->fixup_id = id;
+       if (id >= 0) {
+               spec->fixup_list = fixlist;
+               spec->fixup_name = name;
        }
 }
 
@@ -2866,7 +2918,7 @@ static struct snd_kcontrol_new alc880_uniwill_p53_mixer[] = {
 /*
  * slave controls for virtual master
  */
-static const char *alc_slave_vols[] = {
+static const char * const alc_slave_vols[] = {
        "Front Playback Volume",
        "Surround Playback Volume",
        "Center Playback Volume",
@@ -2880,7 +2932,7 @@ static const char *alc_slave_vols[] = {
        NULL,
 };
 
-static const char *alc_slave_sws[] = {
+static const char * const alc_slave_sws[] = {
        "Front Playback Switch",
        "Surround Playback Switch",
        "Center Playback Switch",
@@ -3861,6 +3913,8 @@ static int alc_init(struct hda_codec *codec)
        if (spec->init_hook)
                spec->init_hook(codec);
 
+       alc_apply_fixup(codec, ALC_FIXUP_ACT_INIT);
+
        hda_call_check_power_status(codec, 0x01);
        return 0;
 }
@@ -4559,7 +4613,7 @@ static struct hda_verb alc880_test_init_verbs[] = {
 /*
  */
 
-static const char *alc880_models[ALC880_MODEL_LAST] = {
+static const char * const alc880_models[ALC880_MODEL_LAST] = {
        [ALC880_3ST]            = "3stack",
        [ALC880_TCL_S700]       = "tcl",
        [ALC880_3ST_DIG]        = "3stack-digout",
@@ -5092,7 +5146,7 @@ static const char *alc_get_line_out_pfx(const struct auto_pin_cfg *cfg,
 static int alc880_auto_create_multi_out_ctls(struct alc_spec *spec,
                                             const struct auto_pin_cfg *cfg)
 {
-       static const char *chname[4] = {
+       static const char * const chname[4] = {
                "Front", "Surround", NULL /*CLFE*/, "Side"
        };
        const char *pfx = alc_get_line_out_pfx(cfg, false);
@@ -7090,7 +7144,8 @@ enum {
 
 static const struct alc_fixup alc260_fixups[] = {
        [PINFIX_HP_DC5750] = {
-               .pins = (const struct alc_pincfg[]) {
+               .type = ALC_FIXUP_PINS,
+               .v.pins = (const struct alc_pincfg[]) {
                        { 0x11, 0x90130110 }, /* speaker */
                        { }
                }
@@ -7105,7 +7160,7 @@ static struct snd_pci_quirk alc260_fixup_tbl[] = {
 /*
  * ALC260 configurations
  */
-static const char *alc260_models[ALC260_MODEL_LAST] = {
+static const char * const alc260_models[ALC260_MODEL_LAST] = {
        [ALC260_BASIC]          = "basic",
        [ALC260_HP]             = "hp",
        [ALC260_HP_3013]        = "hp-3013",
@@ -7301,8 +7356,10 @@ static int patch_alc260(struct hda_codec *codec)
                board_config = ALC260_AUTO;
        }
 
-       if (board_config == ALC260_AUTO)
-               alc_pick_fixup(codec, alc260_fixup_tbl, alc260_fixups, 1);
+       if (board_config == ALC260_AUTO) {
+               alc_pick_fixup(codec, NULL, alc260_fixup_tbl, alc260_fixups);
+               alc_apply_fixup(codec, ALC_FIXUP_ACT_PRE_PROBE);
+       }
 
        if (board_config == ALC260_AUTO) {
                /* automatic parse from the BIOS config */
@@ -7350,8 +7407,7 @@ static int patch_alc260(struct hda_codec *codec)
        set_capture_mixer(codec);
        set_beep_amp(spec, 0x07, 0x05, HDA_INPUT);
 
-       if (board_config == ALC260_AUTO)
-               alc_pick_fixup(codec, alc260_fixup_tbl, alc260_fixups, 0);
+       alc_apply_fixup(codec, ALC_FIXUP_ACT_PROBE);
 
        spec->vmaster_nid = 0x08;
 
@@ -9727,7 +9783,7 @@ static hda_nid_t alc1200_slave_dig_outs[] = {
 /*
  * configuration and preset
  */
-static const char *alc882_models[ALC882_MODEL_LAST] = {
+static const char * const alc882_models[ALC882_MODEL_LAST] = {
        [ALC882_3ST_DIG]        = "3stack-dig",
        [ALC882_6ST_DIG]        = "6stack-dig",
        [ALC882_ARIMA]          = "arima",
@@ -10678,7 +10734,8 @@ enum {
 
 static const struct alc_fixup alc882_fixups[] = {
        [PINFIX_ABIT_AW9D_MAX] = {
-               .pins = (const struct alc_pincfg[]) {
+               .type = ALC_FIXUP_PINS,
+               .v.pins = (const struct alc_pincfg[]) {
                        { 0x15, 0x01080104 }, /* side */
                        { 0x16, 0x01011012 }, /* rear */
                        { 0x17, 0x01016011 }, /* clfe */
@@ -10686,13 +10743,15 @@ static const struct alc_fixup alc882_fixups[] = {
                }
        },
        [PINFIX_PB_M5210] = {
-               .verbs = (const struct hda_verb[]) {
+               .type = ALC_FIXUP_VERBS,
+               .v.verbs = (const struct hda_verb[]) {
                        { 0x19, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF50 },
                        {}
                }
        },
        [PINFIX_ACER_ASPIRE_7736] = {
-               .sku = ALC_FIXUP_SKU_IGNORE,
+               .type = ALC_FIXUP_SKU,
+               .v.sku = ALC_FIXUP_SKU_IGNORE,
        },
 };
 
@@ -10873,9 +10932,6 @@ static int alc_auto_add_mic_boost(struct hda_codec *codec)
        return 0;
 }
 
-static int alc861vd_auto_create_multi_out_ctls(struct alc_spec *spec,
-                                            const struct auto_pin_cfg *cfg);
-
 /* almost identical with ALC880 parser... */
 static int alc882_parse_auto_config(struct hda_codec *codec)
 {
@@ -10893,10 +10949,7 @@ static int alc882_parse_auto_config(struct hda_codec *codec)
        err = alc880_auto_fill_dac_nids(spec, &spec->autocfg);
        if (err < 0)
                return err;
-       if (codec->vendor_id == 0x10ec0887)
-               err = alc861vd_auto_create_multi_out_ctls(spec, &spec->autocfg);
-       else
-               err = alc880_auto_create_multi_out_ctls(spec, &spec->autocfg);
+       err = alc880_auto_create_multi_out_ctls(spec, &spec->autocfg);
        if (err < 0)
                return err;
        err = alc880_auto_create_extra_out(spec, spec->autocfg.hp_pins[0],
@@ -10984,8 +11037,10 @@ static int patch_alc882(struct hda_codec *codec)
                board_config = ALC882_AUTO;
        }
 
-       if (board_config == ALC882_AUTO)
-               alc_pick_fixup(codec, alc882_fixup_tbl, alc882_fixups, 1);
+       if (board_config == ALC882_AUTO) {
+               alc_pick_fixup(codec, NULL, alc882_fixup_tbl, alc882_fixups);
+               alc_apply_fixup(codec, ALC_FIXUP_ACT_PRE_PROBE);
+       }
 
        alc_auto_parse_customize_define(codec);
 
@@ -11061,8 +11116,7 @@ static int patch_alc882(struct hda_codec *codec)
        if (has_cdefine_beep(codec))
                set_beep_amp(spec, 0x0b, 0x05, HDA_INPUT);
 
-       if (board_config == ALC882_AUTO)
-               alc_pick_fixup(codec, alc882_fixup_tbl, alc882_fixups, 0);
+       alc_apply_fixup(codec, ALC_FIXUP_ACT_PROBE);
 
        spec->vmaster_nid = 0x0c;
 
@@ -12452,19 +12506,14 @@ enum {
 
 static const struct alc_fixup alc262_fixups[] = {
        [PINFIX_FSC_H270] = {
-               .pins = (const struct alc_pincfg[]) {
+               .type = ALC_FIXUP_PINS,
+               .v.pins = (const struct alc_pincfg[]) {
                        { 0x14, 0x99130110 }, /* speaker */
                        { 0x15, 0x0221142f }, /* front HP */
                        { 0x1b, 0x0121141f }, /* rear HP */
                        { }
                }
        },
-       [PINFIX_PB_M5210] = {
-               .verbs = (const struct hda_verb[]) {
-                       { 0x19, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF50 },
-                       {}
-               }
-       },
 };
 
 static struct snd_pci_quirk alc262_fixup_tbl[] = {
@@ -12554,7 +12603,7 @@ static void alc262_auto_init(struct hda_codec *codec)
 /*
  * configuration and preset
  */
-static const char *alc262_models[ALC262_MODEL_LAST] = {
+static const char * const alc262_models[ALC262_MODEL_LAST] = {
        [ALC262_BASIC]          = "basic",
        [ALC262_HIPPO]          = "hippo",
        [ALC262_HIPPO_1]        = "hippo_1",
@@ -12582,6 +12631,8 @@ static struct snd_pci_quirk alc262_cfg_tbl[] = {
                           ALC262_HP_BPC),
        SND_PCI_QUIRK_MASK(0x103c, 0xff00, 0x1300, "HP xw series",
                           ALC262_HP_BPC),
+       SND_PCI_QUIRK_MASK(0x103c, 0xff00, 0x1500, "HP z series",
+                          ALC262_HP_BPC),
        SND_PCI_QUIRK_MASK(0x103c, 0xff00, 0x1700, "HP xw series",
                           ALC262_HP_BPC),
        SND_PCI_QUIRK(0x103c, 0x2800, "HP D7000", ALC262_HP_BPC_D7000_WL),
@@ -12895,8 +12946,10 @@ static int patch_alc262(struct hda_codec *codec)
                board_config = ALC262_AUTO;
        }
 
-       if (board_config == ALC262_AUTO)
-               alc_pick_fixup(codec, alc262_fixup_tbl, alc262_fixups, 1);
+       if (board_config == ALC262_AUTO) {
+               alc_pick_fixup(codec, NULL, alc262_fixup_tbl, alc262_fixups);
+               alc_apply_fixup(codec, ALC_FIXUP_ACT_PRE_PROBE);
+       }
 
        if (board_config == ALC262_AUTO) {
                /* automatic parse from the BIOS config */
@@ -12966,8 +13019,7 @@ static int patch_alc262(struct hda_codec *codec)
        if (!spec->no_analog && has_cdefine_beep(codec))
                set_beep_amp(spec, 0x0b, 0x05, HDA_INPUT);
 
-       if (board_config == ALC262_AUTO)
-               alc_pick_fixup(codec, alc262_fixup_tbl, alc262_fixups, 0);
+       alc_apply_fixup(codec, ALC_FIXUP_ACT_PROBE);
 
        spec->vmaster_nid = 0x0c;
 
@@ -13741,7 +13793,7 @@ static void alc268_auto_init(struct hda_codec *codec)
 /*
  * configuration and preset
  */
-static const char *alc268_models[ALC268_MODEL_LAST] = {
+static const char * const alc268_models[ALC268_MODEL_LAST] = {
        [ALC267_QUANTA_IL1]     = "quanta-il1",
        [ALC268_3ST]            = "3stack",
        [ALC268_TOSHIBA]        = "toshiba",
@@ -14822,17 +14874,19 @@ static int alc269_resume(struct hda_codec *codec)
 #endif /* SND_HDA_NEEDS_RESUME */
 
 static void alc269_fixup_hweq(struct hda_codec *codec,
-                              const struct alc_fixup *fix, int pre_init)
+                              const struct alc_fixup *fix, int action)
 {
        int coef;
 
+       if (action != ALC_FIXUP_ACT_INIT)
+               return;
        coef = alc_read_coef_idx(codec, 0x1e);
        alc_write_coef_idx(codec, 0x1e, coef | 0x80);
 }
 
 enum {
        ALC269_FIXUP_SONY_VAIO,
-       ALC275_FIX_SONY_VAIO_GPIO2,
+       ALC275_FIXUP_SONY_VAIO_GPIO2,
        ALC269_FIXUP_DELL_M101Z,
        ALC269_FIXUP_SKU_IGNORE,
        ALC269_FIXUP_ASUS_G73JW,
@@ -14842,22 +14896,26 @@ enum {
 
 static const struct alc_fixup alc269_fixups[] = {
        [ALC269_FIXUP_SONY_VAIO] = {
-               .verbs = (const struct hda_verb[]) {
+               .type = ALC_FIXUP_VERBS,
+               .v.verbs = (const struct hda_verb[]) {
                        {0x19, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREFGRD},
                        {}
                }
        },
-       [ALC275_FIX_SONY_VAIO_GPIO2] = {
-               .verbs = (const struct hda_verb[]) {
+       [ALC275_FIXUP_SONY_VAIO_GPIO2] = {
+               .type = ALC_FIXUP_VERBS,
+               .v.verbs = (const struct hda_verb[]) {
                        {0x01, AC_VERB_SET_GPIO_MASK, 0x04},
                        {0x01, AC_VERB_SET_GPIO_DIRECTION, 0x04},
                        {0x01, AC_VERB_SET_GPIO_DATA, 0x00},
-                       {0x19, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREFGRD},
                        { }
-               }
+               },
+               .chained = true,
+               .chain_id = ALC269_FIXUP_SONY_VAIO
        },
        [ALC269_FIXUP_DELL_M101Z] = {
-               .verbs = (const struct hda_verb[]) {
+               .type = ALC_FIXUP_VERBS,
+               .v.verbs = (const struct hda_verb[]) {
                        /* Enables internal speaker */
                        {0x20, AC_VERB_SET_COEF_INDEX, 13},
                        {0x20, AC_VERB_SET_PROC_COEF, 0x4040},
@@ -14865,39 +14923,39 @@ static const struct alc_fixup alc269_fixups[] = {
                }
        },
        [ALC269_FIXUP_SKU_IGNORE] = {
-               .sku = ALC_FIXUP_SKU_IGNORE,
+               .type = ALC_FIXUP_SKU,
+               .v.sku = ALC_FIXUP_SKU_IGNORE,
        },
        [ALC269_FIXUP_ASUS_G73JW] = {
-               .pins = (const struct alc_pincfg[]) {
+               .type = ALC_FIXUP_PINS,
+               .v.pins = (const struct alc_pincfg[]) {
                        { 0x17, 0x99130111 }, /* subwoofer */
                        { }
                }
        },
        [ALC269_FIXUP_LENOVO_EAPD] = {
-               .verbs = (const struct hda_verb[]) {
+               .type = ALC_FIXUP_VERBS,
+               .v.verbs = (const struct hda_verb[]) {
                        {0x14, AC_VERB_SET_EAPD_BTLENABLE, 0},
                        {}
                }
        },
        [ALC275_FIXUP_SONY_HWEQ] = {
-               .func = alc269_fixup_hweq,
-               .verbs = (const struct hda_verb[]) {
-                       {0x01, AC_VERB_SET_GPIO_MASK, 0x04},
-                       {0x01, AC_VERB_SET_GPIO_DIRECTION, 0x04},
-                       {0x01, AC_VERB_SET_GPIO_DATA, 0x00},
-                       {0x19, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREFGRD},
-                       { }
-               }
+               .type = ALC_FIXUP_FUNC,
+               .v.func = alc269_fixup_hweq,
+               .chained = true,
+               .chain_id = ALC275_FIXUP_SONY_VAIO_GPIO2
        }
 };
 
 static struct snd_pci_quirk alc269_fixup_tbl[] = {
-       SND_PCI_QUIRK(0x104d, 0x9073, "Sony VAIO", ALC275_FIX_SONY_VAIO_GPIO2),
+       SND_PCI_QUIRK(0x104d, 0x9073, "Sony VAIO", ALC275_FIXUP_SONY_VAIO_GPIO2),
        SND_PCI_QUIRK(0x104d, 0x907b, "Sony VAIO", ALC275_FIXUP_SONY_HWEQ),
        SND_PCI_QUIRK(0x104d, 0x9084, "Sony VAIO", ALC275_FIXUP_SONY_HWEQ),
        SND_PCI_QUIRK_VENDOR(0x104d, "Sony VAIO", ALC269_FIXUP_SONY_VAIO),
        SND_PCI_QUIRK(0x1028, 0x0470, "Dell M101z", ALC269_FIXUP_DELL_M101Z),
        SND_PCI_QUIRK(0x17aa, 0x21b8, "Thinkpad Edge 14", ALC269_FIXUP_SKU_IGNORE),
+       SND_PCI_QUIRK(0x17aa, 0x21e9, "Thinkpad Edge 14", ALC269_FIXUP_SKU_IGNORE),
        SND_PCI_QUIRK(0x17aa, 0x20f2, "Thinkpad SL410/510", ALC269_FIXUP_SKU_IGNORE),
        SND_PCI_QUIRK(0x1043, 0x1a13, "Asus G73Jw", ALC269_FIXUP_ASUS_G73JW),
        SND_PCI_QUIRK(0x17aa, 0x9e54, "LENOVO NB", ALC269_FIXUP_LENOVO_EAPD),
@@ -14908,7 +14966,7 @@ static struct snd_pci_quirk alc269_fixup_tbl[] = {
 /*
  * configuration and preset
  */
-static const char *alc269_models[ALC269_MODEL_LAST] = {
+static const char * const alc269_models[ALC269_MODEL_LAST] = {
        [ALC269_BASIC]                  = "basic",
        [ALC269_QUANTA_FL1]             = "quanta",
        [ALC269_AMIC]                   = "laptop-amic",
@@ -15184,8 +15242,10 @@ static int patch_alc269(struct hda_codec *codec)
                board_config = ALC269_AUTO;
        }
 
-       if (board_config == ALC269_AUTO)
-               alc_pick_fixup(codec, alc269_fixup_tbl, alc269_fixups, 1);
+       if (board_config == ALC269_AUTO) {
+               alc_pick_fixup(codec, NULL, alc269_fixup_tbl, alc269_fixups);
+               alc_apply_fixup(codec, ALC_FIXUP_ACT_PRE_PROBE);
+       }
 
        if (board_config == ALC269_AUTO) {
                /* automatic parse from the BIOS config */
@@ -15246,8 +15306,7 @@ static int patch_alc269(struct hda_codec *codec)
        if (has_cdefine_beep(codec))
                set_beep_amp(spec, 0x0b, 0x04, HDA_INPUT);
 
-       if (board_config == ALC269_AUTO)
-               alc_pick_fixup(codec, alc269_fixup_tbl, alc269_fixups, 0);
+       alc_apply_fixup(codec, ALC_FIXUP_ACT_PROBE);
 
        spec->vmaster_nid = 0x02;
 
@@ -15950,7 +16009,7 @@ static int alc861_auto_create_multi_out_ctls(struct hda_codec *codec,
                                             const struct auto_pin_cfg *cfg)
 {
        struct alc_spec *spec = codec->spec;
-       static const char *chname[4] = {
+       static const char * const chname[4] = {
                "Front", "Surround", NULL /*CLFE*/, "Side"
        };
        const char *pfx = alc_get_line_out_pfx(cfg, true);
@@ -16156,7 +16215,7 @@ static struct hda_amp_list alc861_loopbacks[] = {
 /*
  * configuration and preset
  */
-static const char *alc861_models[ALC861_MODEL_LAST] = {
+static const char * const alc861_models[ALC861_MODEL_LAST] = {
        [ALC861_3ST]            = "3stack",
        [ALC660_3ST]            = "3stack-660",
        [ALC861_3ST_DIG]        = "3stack-dig",
@@ -16306,7 +16365,8 @@ enum {
 
 static const struct alc_fixup alc861_fixups[] = {
        [PINFIX_FSC_AMILO_PI1505] = {
-               .pins = (const struct alc_pincfg[]) {
+               .type = ALC_FIXUP_PINS,
+               .v.pins = (const struct alc_pincfg[]) {
                        { 0x0b, 0x0221101f }, /* HP */
                        { 0x0f, 0x90170310 }, /* speaker */
                        { }
@@ -16341,8 +16401,10 @@ static int patch_alc861(struct hda_codec *codec)
                board_config = ALC861_AUTO;
        }
 
-       if (board_config == ALC861_AUTO)
-               alc_pick_fixup(codec, alc861_fixup_tbl, alc861_fixups, 1);
+       if (board_config == ALC861_AUTO) {
+               alc_pick_fixup(codec, NULL, alc861_fixup_tbl, alc861_fixups);
+               alc_apply_fixup(codec, ALC_FIXUP_ACT_PRE_PROBE);
+       }
 
        if (board_config == ALC861_AUTO) {
                /* automatic parse from the BIOS config */
@@ -16379,8 +16441,7 @@ static int patch_alc861(struct hda_codec *codec)
 
        spec->vmaster_nid = 0x03;
 
-       if (board_config == ALC861_AUTO)
-               alc_pick_fixup(codec, alc861_fixup_tbl, alc861_fixups, 0);
+       alc_apply_fixup(codec, ALC_FIXUP_ACT_PROBE);
 
        codec->patch_ops = alc_patch_ops;
        if (board_config == ALC861_AUTO) {
@@ -16857,7 +16918,7 @@ static void alc861vd_dallas_setup(struct hda_codec *codec)
 /*
  * configuration and preset
  */
-static const char *alc861vd_models[ALC861VD_MODEL_LAST] = {
+static const char * const alc861vd_models[ALC861VD_MODEL_LAST] = {
        [ALC660VD_3ST]          = "3stack-660",
        [ALC660VD_3ST_DIG]      = "3stack-660-digout",
        [ALC660VD_ASUS_V1S]     = "asus-v1s",
@@ -17072,12 +17133,14 @@ static void alc861vd_auto_init_analog_input(struct hda_codec *codec)
 #define alc861vd_idx_to_mixer_switch(nid)      ((nid) + 0x0c)
 
 /* add playback controls from the parsed DAC table */
-/* Based on ALC880 version. But ALC861VD and ALC887 have separate,
+/* Based on ALC880 version. But ALC861VD has separate,
  * different NIDs for mute/unmute switch and volume control */
 static int alc861vd_auto_create_multi_out_ctls(struct alc_spec *spec,
                                             const struct auto_pin_cfg *cfg)
 {
-       static const char *chname[4] = {"Front", "Surround", "CLFE", "Side"};
+       static const char * const chname[4] = {
+               "Front", "Surround", "CLFE", "Side"
+       };
        const char *pfx = alc_get_line_out_pfx(cfg, true);
        hda_nid_t nid_v, nid_s;
        int i, err;
@@ -17262,7 +17325,8 @@ enum {
 /* reset GPIO1 */
 static const struct alc_fixup alc861vd_fixups[] = {
        [ALC660VD_FIX_ASUS_GPIO1] = {
-               .verbs = (const struct hda_verb[]) {
+               .type = ALC_FIXUP_VERBS,
+               .v.verbs = (const struct hda_verb[]) {
                        {0x01, AC_VERB_SET_GPIO_MASK, 0x03},
                        {0x01, AC_VERB_SET_GPIO_DIRECTION, 0x01},
                        {0x01, AC_VERB_SET_GPIO_DATA, 0x01},
@@ -17297,8 +17361,10 @@ static int patch_alc861vd(struct hda_codec *codec)
                board_config = ALC861VD_AUTO;
        }
 
-       if (board_config == ALC861VD_AUTO)
-               alc_pick_fixup(codec, alc861vd_fixup_tbl, alc861vd_fixups, 1);
+       if (board_config == ALC861VD_AUTO) {
+               alc_pick_fixup(codec, NULL, alc861vd_fixup_tbl, alc861vd_fixups);
+               alc_apply_fixup(codec, ALC_FIXUP_ACT_PRE_PROBE);
+       }
 
        if (board_config == ALC861VD_AUTO) {
                /* automatic parse from the BIOS config */
@@ -17346,8 +17412,7 @@ static int patch_alc861vd(struct hda_codec *codec)
 
        spec->vmaster_nid = 0x02;
 
-       if (board_config == ALC861VD_AUTO)
-               alc_pick_fixup(codec, alc861vd_fixup_tbl, alc861vd_fixups, 0);
+       alc_apply_fixup(codec, ALC_FIXUP_ACT_PROBE);
 
        codec->patch_ops = alc_patch_ops;
 
@@ -18630,7 +18695,7 @@ static struct snd_kcontrol_new alc272_nc10_mixer[] = {
 /*
  * configuration and preset
  */
-static const char *alc662_models[ALC662_MODEL_LAST] = {
+static const char * const alc662_models[ALC662_MODEL_LAST] = {
        [ALC662_3ST_2ch_DIG]    = "3stack-dig",
        [ALC662_3ST_6ch_DIG]    = "3stack-6ch-dig",
        [ALC662_3ST_6ch]        = "3stack-6ch",
@@ -19145,7 +19210,7 @@ static int alc662_auto_create_multi_out_ctls(struct hda_codec *codec,
                                             const struct auto_pin_cfg *cfg)
 {
        struct alc_spec *spec = codec->spec;
-       static const char *chname[4] = {
+       static const char * const chname[4] = {
                "Front", "Surround", NULL /*CLFE*/, "Side"
        };
        const char *pfx = alc_get_line_out_pfx(cfg, true);
@@ -19378,7 +19443,10 @@ static void alc662_auto_init(struct hda_codec *codec)
 }
 
 static void alc272_fixup_mario(struct hda_codec *codec,
-                              const struct alc_fixup *fix, int pre_init) {
+                              const struct alc_fixup *fix, int action)
+{
+       if (action != ALC_FIXUP_ACT_PROBE)
+               return;
        if (snd_hda_override_amp_caps(codec, 0x2, HDA_OUTPUT,
                                      (0x3b << AC_AMPCAP_OFFSET_SHIFT) |
                                      (0x3b << AC_AMPCAP_NUM_STEPS_SHIFT) |
@@ -19392,24 +19460,35 @@ enum {
        ALC662_FIXUP_ASPIRE,
        ALC662_FIXUP_IDEAPAD,
        ALC272_FIXUP_MARIO,
+       ALC662_FIXUP_CZC_P10T,
 };
 
 static const struct alc_fixup alc662_fixups[] = {
        [ALC662_FIXUP_ASPIRE] = {
-               .pins = (const struct alc_pincfg[]) {
+               .type = ALC_FIXUP_PINS,
+               .v.pins = (const struct alc_pincfg[]) {
                        { 0x15, 0x99130112 }, /* subwoofer */
                        { }
                }
        },
        [ALC662_FIXUP_IDEAPAD] = {
-               .pins = (const struct alc_pincfg[]) {
+               .type = ALC_FIXUP_PINS,
+               .v.pins = (const struct alc_pincfg[]) {
                        { 0x17, 0x99130112 }, /* subwoofer */
                        { }
                }
        },
        [ALC272_FIXUP_MARIO] = {
-               .func = alc272_fixup_mario,
-       }
+               .type = ALC_FIXUP_FUNC,
+               .v.func = alc272_fixup_mario,
+       },
+       [ALC662_FIXUP_CZC_P10T] = {
+               .type = ALC_FIXUP_VERBS,
+               .v.verbs = (const struct hda_verb[]) {
+                       {0x14, AC_VERB_SET_EAPD_BTLENABLE, 0},
+                       {}
+               }
+       },
 };
 
 static struct snd_pci_quirk alc662_fixup_tbl[] = {
@@ -19417,6 +19496,7 @@ static struct snd_pci_quirk alc662_fixup_tbl[] = {
        SND_PCI_QUIRK(0x144d, 0xc051, "Samsung R720", ALC662_FIXUP_IDEAPAD),
        SND_PCI_QUIRK(0x17aa, 0x38af, "Lenovo Ideapad Y550P", ALC662_FIXUP_IDEAPAD),
        SND_PCI_QUIRK(0x17aa, 0x3a0d, "Lenovo Ideapad Y550", ALC662_FIXUP_IDEAPAD),
+       SND_PCI_QUIRK(0x1b35, 0x2206, "CZC P10T", ALC662_FIXUP_CZC_P10T),
        {}
 };
 
@@ -19462,7 +19542,9 @@ static int patch_alc662(struct hda_codec *codec)
        }
 
        if (board_config == ALC662_AUTO) {
-               alc_pick_fixup(codec, alc662_fixup_tbl, alc662_fixups, 1);
+               alc_pick_fixup(codec, alc662_fixup_models,
+                              alc662_fixup_tbl, alc662_fixups);
+               alc_apply_fixup(codec, ALC_FIXUP_ACT_PRE_PROBE);
                /* automatic parse from the BIOS config */
                err = alc662_parse_auto_config(codec);
                if (err < 0) {
@@ -19520,12 +19602,11 @@ static int patch_alc662(struct hda_codec *codec)
        }
        spec->vmaster_nid = 0x02;
 
+       alc_apply_fixup(codec, ALC_FIXUP_ACT_PROBE);
+
        codec->patch_ops = alc_patch_ops;
-       if (board_config == ALC662_AUTO) {
+       if (board_config == ALC662_AUTO)
                spec->init_hook = alc662_auto_init;
-               alc_pick_fixup_model(codec, alc662_fixup_models,
-                                    alc662_fixup_tbl, alc662_fixups, 0);
-       }
 
        alc_init_jacks(codec);
 
@@ -19913,7 +19994,7 @@ static void alc680_auto_init(struct hda_codec *codec)
 /*
  * configuration and preset
  */
-static const char *alc680_models[ALC680_MODEL_LAST] = {
+static const char * const alc680_models[ALC680_MODEL_LAST] = {
        [ALC680_BASE]           = "base",
        [ALC680_AUTO]           = "auto",
 };
index 4ab019d0924eb7bdbfdc3e890d08727cf7e6f0a0..9ea48b425d0b8b24b0d90a7f6bed760d7f512422 100644 (file)
@@ -266,7 +266,7 @@ struct sigmatel_spec {
        struct sigmatel_mic_route int_mic;
        struct sigmatel_mic_route dock_mic;
 
-       const char **spdif_labels;
+       const char * const *spdif_labels;
 
        hda_nid_t dig_in_nid;
        hda_nid_t mono_nid;
@@ -524,7 +524,7 @@ static unsigned long stac927x_capsws[] = {
        HDA_COMPOSE_AMP_VAL(0x1d, 3, 0, HDA_OUTPUT),
 };
 
-static const char *stac927x_spdif_labels[5] = {
+static const char * const stac927x_spdif_labels[5] = {
        "Digital Playback", "ADAT", "Analog Mux 1",
        "Analog Mux 2", "Analog Mux 3"
 };
@@ -1062,7 +1062,7 @@ static struct snd_kcontrol_new stac_smux_mixer = {
        .put = stac92xx_smux_enum_put,
 };
 
-static const char *slave_vols[] = {
+static const char * const slave_vols[] = {
        "Front Playback Volume",
        "Surround Playback Volume",
        "Center Playback Volume",
@@ -1073,7 +1073,7 @@ static const char *slave_vols[] = {
        NULL
 };
 
-static const char *slave_sws[] = {
+static const char * const slave_sws[] = {
        "Front Playback Switch",
        "Surround Playback Switch",
        "Center Playback Switch",
@@ -1354,7 +1354,7 @@ static unsigned int *stac9200_brd_tbl[STAC_9200_MODELS] = {
        [STAC_9200_PANASONIC] = ref9200_pin_configs,
 };
 
-static const char *stac9200_models[STAC_9200_MODELS] = {
+static const char * const stac9200_models[STAC_9200_MODELS] = {
        [STAC_AUTO] = "auto",
        [STAC_REF] = "ref",
        [STAC_9200_OQO] = "oqo",
@@ -1500,7 +1500,7 @@ static unsigned int *stac925x_brd_tbl[STAC_925x_MODELS] = {
        [STAC_M6] = stac925xM6_pin_configs,
 };
 
-static const char *stac925x_models[STAC_925x_MODELS] = {
+static const char * const stac925x_models[STAC_925x_MODELS] = {
        [STAC_925x_AUTO] = "auto",
        [STAC_REF] = "ref",
        [STAC_M1] = "m1",
@@ -1574,7 +1574,7 @@ static unsigned int *stac92hd73xx_brd_tbl[STAC_92HD73XX_MODELS] = {
        [STAC_92HD73XX_INTEL]   = intel_dg45id_pin_configs,
 };
 
-static const char *stac92hd73xx_models[STAC_92HD73XX_MODELS] = {
+static const char * const stac92hd73xx_models[STAC_92HD73XX_MODELS] = {
        [STAC_92HD73XX_AUTO] = "auto",
        [STAC_92HD73XX_NO_JD] = "no-jd",
        [STAC_92HD73XX_REF] = "ref",
@@ -1660,7 +1660,7 @@ static unsigned int *stac92hd83xxx_brd_tbl[STAC_92HD83XXX_MODELS] = {
        [STAC_HP_DV7_4000] = hp_dv7_4000_pin_configs,
 };
 
-static const char *stac92hd83xxx_models[STAC_92HD83XXX_MODELS] = {
+static const char * const stac92hd83xxx_models[STAC_92HD83XXX_MODELS] = {
        [STAC_92HD83XXX_AUTO] = "auto",
        [STAC_92HD83XXX_REF] = "ref",
        [STAC_92HD83XXX_PWR_REF] = "mic-ref",
@@ -1722,7 +1722,7 @@ static unsigned int *stac92hd71bxx_brd_tbl[STAC_92HD71BXX_MODELS] = {
        [STAC_HP_DV4_1222NR]    = NULL,
 };
 
-static const char *stac92hd71bxx_models[STAC_92HD71BXX_MODELS] = {
+static const char * const stac92hd71bxx_models[STAC_92HD71BXX_MODELS] = {
        [STAC_92HD71BXX_AUTO] = "auto",
        [STAC_92HD71BXX_REF] = "ref",
        [STAC_DELL_M4_1] = "dell-m4-1",
@@ -1915,7 +1915,7 @@ static unsigned int *stac922x_brd_tbl[STAC_922X_MODELS] = {
        [STAC_922X_DELL_M82] = dell_922x_m82_pin_configs,       
 };
 
-static const char *stac922x_models[STAC_922X_MODELS] = {
+static const char * const stac922x_models[STAC_922X_MODELS] = {
        [STAC_922X_AUTO] = "auto",
        [STAC_D945_REF] = "ref",
        [STAC_D945GTP5] = "5stack",
@@ -2077,7 +2077,7 @@ static unsigned int *stac927x_brd_tbl[STAC_927X_MODELS] = {
        [STAC_927X_VOLKNOB] = NULL,
 };
 
-static const char *stac927x_models[STAC_927X_MODELS] = {
+static const char * const stac927x_models[STAC_927X_MODELS] = {
        [STAC_927X_AUTO]        = "auto",
        [STAC_D965_REF_NO_JD]   = "ref-no-jd",
        [STAC_D965_REF]         = "ref",
@@ -2180,7 +2180,7 @@ static unsigned int *stac9205_brd_tbl[STAC_9205_MODELS] = {
        [STAC_9205_EAPD] = NULL,
 };
 
-static const char *stac9205_models[STAC_9205_MODELS] = {
+static const char * const stac9205_models[STAC_9205_MODELS] = {
        [STAC_9205_AUTO] = "auto",
        [STAC_9205_REF] = "ref",
        [STAC_9205_DELL_M42] = "dell-m42",
@@ -3123,7 +3123,7 @@ static int create_multi_out_ctls(struct hda_codec *codec, int num_outs,
                                 int type)
 {
        struct sigmatel_spec *spec = codec->spec;
-       static const char *chname[4] = {
+       static const char * const chname[4] = {
                "Front", "Surround", NULL /*CLFE*/, "Side"
        };
        hda_nid_t nid;
@@ -3256,7 +3256,7 @@ static int stac92xx_auto_create_hp_ctls(struct hda_codec *codec,
 }
 
 /* labels for mono mux outputs */
-static const char *stac92xx_mono_labels[4] = {
+static const char * const stac92xx_mono_labels[4] = {
        "DAC0", "DAC1", "Mixer", "DAC2"
 };
 
@@ -3380,7 +3380,7 @@ static int stac92xx_auto_create_mux_input_ctls(struct hda_codec *codec)
        return 0;
 };
 
-static const char *stac92xx_spdif_labels[3] = {
+static const char * const stac92xx_spdif_labels[3] = {
        "Digital Playback", "Analog Mux 1", "Analog Mux 2",
 };
 
@@ -3388,7 +3388,7 @@ static int stac92xx_auto_create_spdif_mux_ctls(struct hda_codec *codec)
 {
        struct sigmatel_spec *spec = codec->spec;
        struct hda_input_mux *spdif_mux = &spec->private_smux;
-       const char **labels = spec->spdif_labels;
+       const char * const *labels = spec->spdif_labels;
        int i, num_cons;
        hda_nid_t con_lst[HDA_MAX_NUM_INPUTS];
 
@@ -3409,7 +3409,7 @@ static int stac92xx_auto_create_spdif_mux_ctls(struct hda_codec *codec)
 }
 
 /* labels for dmic mux inputs */
-static const char *stac92xx_dmic_labels[5] = {
+static const char * const stac92xx_dmic_labels[5] = {
        "Analog Inputs", "Digital Mic 1", "Digital Mic 2",
        "Digital Mic 3", "Digital Mic 4"
 };
@@ -5333,7 +5333,7 @@ again:
        return 0;
 }
 
-static int stac92hd83xxx_set_system_btl_amp(struct hda_codec *codec)
+static int hp_bnb2011_with_dock(struct hda_codec *codec)
 {
        if (codec->vendor_id != 0x111d7605 &&
            codec->vendor_id != 0x111d76d1)
@@ -5348,10 +5348,6 @@ static int stac92hd83xxx_set_system_btl_amp(struct hda_codec *codec)
        case 0x103c161d:
        case 0x103c161e:
        case 0x103c161f:
-       case 0x103c1620:
-       case 0x103c1621:
-       case 0x103c1622:
-       case 0x103c1623:
 
        case 0x103c162a:
        case 0x103c162b:
@@ -5360,41 +5356,9 @@ static int stac92hd83xxx_set_system_btl_amp(struct hda_codec *codec)
        case 0x103c1631:
 
        case 0x103c1633:
-
+       case 0x103c1634:
        case 0x103c1635:
 
-       case 0x103c164f:
-
-       case 0x103c1676:
-       case 0x103c1677:
-       case 0x103c1678:
-       case 0x103c1679:
-       case 0x103c167a:
-       case 0x103c167b:
-       case 0x103c167c:
-       case 0x103c167d:
-       case 0x103c167e:
-       case 0x103c167f:
-       case 0x103c1680:
-       case 0x103c1681:
-       case 0x103c1682:
-       case 0x103c1683:
-       case 0x103c1684:
-       case 0x103c1685:
-       case 0x103c1686:
-       case 0x103c1687:
-       case 0x103c1688:
-       case 0x103c1689:
-       case 0x103c168a:
-       case 0x103c168b:
-       case 0x103c168c:
-       case 0x103c168d:
-       case 0x103c168e:
-       case 0x103c168f:
-       case 0x103c1690:
-       case 0x103c1691:
-       case 0x103c1692:
-
        case 0x103c3587:
        case 0x103c3588:
        case 0x103c3589:
@@ -5402,9 +5366,9 @@ static int stac92hd83xxx_set_system_btl_amp(struct hda_codec *codec)
 
        case 0x103c3667:
        case 0x103c3668:
-               /* set BTL amp level to 13.43dB for louder speaker output */
-               return snd_hda_codec_write_cache(codec, codec->afg, 0,
-                                                0x7F4, 0x14);
+       case 0x103c3669:
+
+               return 1;
        }
        return 0;
 }
@@ -5420,6 +5384,11 @@ static int patch_stac92hd83xxx(struct hda_codec *codec)
        if (spec == NULL)
                return -ENOMEM;
 
+       if (hp_bnb2011_with_dock(codec)) {
+               snd_hda_codec_set_pincfg(codec, 0xa, 0x2101201f);
+               snd_hda_codec_set_pincfg(codec, 0xf, 0x2181205e);
+       }
+
        /* reset pin power-down; Windows may leave these bits after reboot */
        snd_hda_codec_write_cache(codec, codec->afg, 0, 0x7EC, 0);
        snd_hda_codec_write_cache(codec, codec->afg, 0, 0x7ED, 0);
@@ -5546,8 +5515,6 @@ again:
                        AC_VERB_SET_CONNECT_SEL, num_dacs);
        }
 
-       stac92hd83xxx_set_system_btl_amp(codec);
-
        codec->proc_widget_hook = stac92hd_proc_hook;
 
        return 0;
@@ -6270,7 +6237,7 @@ static unsigned int stac9872_vaio_pin_configs[9] = {
        0x90a7013e
 };
 
-static const char *stac9872_models[STAC_9872_MODELS] = {
+static const char * const stac9872_models[STAC_9872_MODELS] = {
        [STAC_9872_AUTO] = "auto",
        [STAC_9872_VAIO] = "vaio",
 };
index 7f4852a478a11ab0f56b545416c57c0208a8cc2c..a76c3260d941688398f43170e0584c77d7d14320 100644 (file)
@@ -2281,7 +2281,9 @@ static int vt1708_auto_create_multi_out_ctls(struct via_spec *spec,
                                             const struct auto_pin_cfg *cfg)
 {
        char name[32];
-       static const char *chname[4] = { "Front", "Surround", "C/LFE", "Side" };
+       static const char * const chname[4] = {
+               "Front", "Surround", "C/LFE", "Side"
+       };
        hda_nid_t nid, nid_vol, nid_vols[] = {0x17, 0x19, 0x1a, 0x1b};
        int i, err;
 
@@ -2370,7 +2372,7 @@ static void create_hp_imux(struct via_spec *spec)
 {
        int i;
        struct hda_input_mux *imux = &spec->private_imux[1];
-       static const char *texts[] = { "OFF", "ON", NULL};
+       static const char * const texts[] = { "OFF", "ON", NULL};
 
        /* for hp mode select */
        for (i = 0; texts[i]; i++)
@@ -2890,7 +2892,9 @@ static int vt1709_auto_create_multi_out_ctls(struct via_spec *spec,
                                             const struct auto_pin_cfg *cfg)
 {
        char name[32];
-       static const char *chname[4] = { "Front", "Surround", "C/LFE", "Side" };
+       static const char * const chname[4] = {
+               "Front", "Surround", "C/LFE", "Side"
+       };
        hda_nid_t nid, nid_vol, nid_vols[] = {0x18, 0x1a, 0x1b, 0x29};
        int i, err;
 
@@ -3433,7 +3437,9 @@ static int vt1708B_auto_create_multi_out_ctls(struct via_spec *spec,
                                             const struct auto_pin_cfg *cfg)
 {
        char name[32];
-       static const char *chname[4] = { "Front", "Surround", "C/LFE", "Side" };
+       static const char * const chname[4] = {
+               "Front", "Surround", "C/LFE", "Side"
+       };
        hda_nid_t nid_vols[] = {0x16, 0x18, 0x26, 0x27};
        hda_nid_t nid, nid_vol = 0;
        int i, err;
@@ -3861,7 +3867,9 @@ static int vt1708S_auto_create_multi_out_ctls(struct via_spec *spec,
                                             const struct auto_pin_cfg *cfg)
 {
        char name[32];
-       static const char *chname[4] = { "Front", "Surround", "C/LFE", "Side" };
+       static const char * const chname[4] = {
+               "Front", "Surround", "C/LFE", "Side"
+       };
        hda_nid_t nid_vols[] = {0x10, 0x11, 0x24, 0x25};
        hda_nid_t nid_mutes[] = {0x1C, 0x18, 0x26, 0x27};
        hda_nid_t nid, nid_vol, nid_mute;
@@ -4304,7 +4312,7 @@ static int vt1702_auto_create_hp_ctls(struct via_spec *spec, hda_nid_t pin)
 {
        int err, i;
        struct hda_input_mux *imux;
-       static const char *texts[] = { "ON", "OFF", NULL};
+       static const char * const texts[] = { "ON", "OFF", NULL};
        if (!pin)
                return 0;
        spec->multiout.hp_nid = 0x1D;
@@ -4615,7 +4623,9 @@ static int vt1718S_auto_create_multi_out_ctls(struct via_spec *spec,
                                             const struct auto_pin_cfg *cfg)
 {
        char name[32];
-       static const char *chname[4] = { "Front", "Surround", "C/LFE", "Side" };
+       static const char * const chname[4] = {
+               "Front", "Surround", "C/LFE", "Side"
+       };
        hda_nid_t nid_vols[] = {0x8, 0x9, 0xa, 0xb};
        hda_nid_t nid_mutes[] = {0x24, 0x25, 0x26, 0x27};
        hda_nid_t nid, nid_vol, nid_mute = 0;
@@ -5064,7 +5074,9 @@ static int vt1716S_auto_create_multi_out_ctls(struct via_spec *spec,
                                              const struct auto_pin_cfg *cfg)
 {
        char name[32];
-       static const char *chname[3] = { "Front", "Surround", "C/LFE" };
+       static const char * const chname[3] = {
+               "Front", "Surround", "C/LFE"
+       };
        hda_nid_t nid_vols[] = {0x10, 0x11, 0x25};
        hda_nid_t nid_mutes[] = {0x1C, 0x18, 0x27};
        hda_nid_t nid, nid_vol, nid_mute;
index 7b62de089fee04cda4b7090196945621f3a62b58..20c6b079d0dfc33cfc4620006bbbe944e39e91b6 100644 (file)
@@ -580,6 +580,7 @@ static int __devinit snd_ice1712_delta_init(struct snd_ice1712 *ice)
 {
        int err;
        struct snd_akm4xxx *ak;
+       unsigned char tmp;
 
        if (ice->eeprom.subvendor == ICE1712_SUBDEVICE_DELTA1010 &&
            ice->eeprom.gpiodir == 0x7b)
@@ -622,6 +623,12 @@ static int __devinit snd_ice1712_delta_init(struct snd_ice1712 *ice)
                break;
        }
 
+       /* initialize the SPI clock to high */
+       tmp = snd_ice1712_read(ice, ICE1712_IREG_GPIO_DATA);
+       tmp |= ICE1712_DELTA_AP_CCLK;
+       snd_ice1712_write(ice, ICE1712_IREG_GPIO_DATA, tmp);
+       udelay(5);
+
        /* initialize spdif */
        switch (ice->eeprom.subvendor) {
        case ICE1712_SUBDEVICE_AUDIOPHILE:
index e4de0b8d087a000cb67b735cf9a5c2b603afba70..e1fa602eba795c5db577bc18f4cc00e5680262d0 100644 (file)
@@ -75,7 +75,7 @@ static void cs4245_write(struct oxygen *chip, unsigned int reg, u8 value)
                         OXYGEN_SPI_CEN_LATCH_CLOCK_HI,
                         CS4245_SPI_ADDRESS |
                         CS4245_SPI_WRITE |
-                        (value << 8) | reg);
+                        (reg << 8) | value);
        data->cs4245_regs[reg] = value;
 }
 
index 3abeeddc67d3533a2c187acc5d606390310902b7..ae403597fd319e63327f0733eb1a779e4b208587 100644 (file)
@@ -1,6 +1,7 @@
 config SND_BF5XX_I2S
        tristate "SoC I2S Audio for the ADI BF5xx chip"
        depends on BLACKFIN
+       select SND_BF5XX_SOC_SPORT
        help
          Say Y or M if you want to add support for codecs attached to
          the Blackfin SPORT (synchronous serial ports) interface in I2S
@@ -35,6 +36,7 @@ config SND_BFIN_AD73311_SE
 config SND_BF5XX_TDM
        tristate "SoC I2S(TDM mode) Audio for the ADI BF5xx chip"
        depends on (BLACKFIN && SND_SOC)
+       select SND_BF5XX_SOC_SPORT
        help
          Say Y or M if you want to add support for codecs attached to
          the Blackfin SPORT (synchronous serial ports) interface in TDM
@@ -61,6 +63,10 @@ config SND_BF5XX_SOC_AD193X
 config SND_BF5XX_AC97
        tristate "SoC AC97 Audio for the ADI BF5xx chip"
        depends on BLACKFIN
+       select AC97_BUS
+       select SND_SOC_AC97_BUS
+       select SND_BF5XX_SOC_SPORT
+       select SND_BF5XX_SOC_AC97
        help
          Say Y or M if you want to add support for codecs attached to
          the Blackfin SPORT (synchronous serial ports) interface in slot 16
@@ -122,17 +128,12 @@ config SND_BF5XX_SOC_SPORT
 
 config SND_BF5XX_SOC_I2S
        tristate
-       select SND_BF5XX_SOC_SPORT
 
 config SND_BF5XX_SOC_TDM
        tristate
-       select SND_BF5XX_SOC_SPORT
 
 config SND_BF5XX_SOC_AC97
        tristate
-       select AC97_BUS
-       select SND_SOC_AC97_BUS
-       select SND_BF5XX_SOC_SPORT
 
 config SND_BF5XX_SPORT_NUM
        int "Set a SPORT for Sound chip"
index c5f856ec27ca1bedc8d0256cf5fe97d11ebac730..ffbac26b9bce5882e662e3dfc1a7a26081cbf91d 100644 (file)
@@ -260,9 +260,9 @@ static int bf5xx_ac97_suspend(struct snd_soc_dai *dai)
        pr_debug("%s : sport %d\n", __func__, dai->id);
        if (!dai->active)
                return 0;
-       if (dai->capture.active)
+       if (dai->capture_active)
                sport_rx_stop(sport);
-       if (dai->playback.active)
+       if (dai->playback_active)
                sport_tx_stop(sport);
        return 0;
 }
index 125123929f16c28d1e52ca01ebde662196f66253..5515ac9e05c70bca470a3f2fe913747cb95fe16f 100644 (file)
@@ -210,7 +210,7 @@ static int bf5xx_tdm_set_channel_map(struct snd_soc_dai *dai,
 #ifdef CONFIG_PM
 static int bf5xx_tdm_suspend(struct snd_soc_dai *dai)
 {
-       struct sport_device *sport = dai->private_data;
+       struct sport_device *sport = snd_soc_dai_get_drvdata(dai);
 
        if (!dai->active)
                return 0;
@@ -235,13 +235,13 @@ static int bf5xx_tdm_resume(struct snd_soc_dai *dai)
                ret = -EBUSY;
        }
 
-       ret = sport_config_rx(sport, IRFS, 0x1F, 0, 0);
+       ret = sport_config_rx(sport, 0, 0x1F, 0, 0);
        if (ret) {
                pr_err("SPORT is busy!\n");
                ret = -EBUSY;
        }
 
-       ret = sport_config_tx(sport, ITFS, 0x1F, 0, 0);
+       ret = sport_config_tx(sport, 0, 0x1F, 0, 0);
        if (ret) {
                pr_err("SPORT is busy!\n");
                ret = -EBUSY;
@@ -303,14 +303,14 @@ static int __devinit bfin_tdm_probe(struct platform_device *pdev)
                goto sport_config_err;
        }
 
-       ret = sport_config_rx(sport_handle, IRFS, 0x1F, 0, 0);
+       ret = sport_config_rx(sport_handle, 0, 0x1F, 0, 0);
        if (ret) {
                pr_err("SPORT is busy!\n");
                ret = -EBUSY;
                goto sport_config_err;
        }
 
-       ret = sport_config_tx(sport_handle, ITFS, 0x1F, 0, 0);
+       ret = sport_config_tx(sport_handle, 0, 0x1F, 0, 0);
        if (ret) {
                pr_err("SPORT is busy!\n");
                ret = -EBUSY;
index 883a312bb2931d3afaee63cbd8a2564c6a447393..c48b23c1d4fc02244f3248a65da5b68f257ac9e2 100644 (file)
@@ -44,7 +44,7 @@ config SND_SOC_ALL_CODECS
        select SND_SOC_TWL6040 if TWL4030_CORE
        select SND_SOC_UDA134X
        select SND_SOC_UDA1380 if I2C
-       select SND_SOC_WL1273 if WL1273_CORE
+       select SND_SOC_WL1273 if RADIO_WL1273
        select SND_SOC_WM2000 if I2C
        select SND_SOC_WM8350 if MFD_WM8350
        select SND_SOC_WM8400 if MFD_WM8400
index d3ffa2f0122a9917bfacb4309e6baef8e058b49b..861b28f543d2d46d60ff00903603319550e80573 100644 (file)
@@ -42,7 +42,7 @@ struct wl1273_priv {
 static int snd_wl1273_fm_set_i2s_mode(struct wl1273_core *core,
                                      int rate, int width)
 {
-       struct device *dev = &core->i2c_dev->dev;
+       struct device *dev = &core->client->dev;
        int r = 0;
        u16 mode;
 
@@ -123,13 +123,13 @@ static int snd_wl1273_fm_set_i2s_mode(struct wl1273_core *core,
        dev_dbg(dev, "mode: 0x%04x\n", mode);
 
        if (core->i2s_mode != mode) {
-               r = wl1273_fm_write_cmd(core, WL1273_I2S_MODE_CONFIG_SET, mode);
+               r = core->write(core, WL1273_I2S_MODE_CONFIG_SET, mode);
                if (r)
                        goto out;
 
                core->i2s_mode = mode;
-               r = wl1273_fm_write_cmd(core, WL1273_AUDIO_ENABLE,
-                                       WL1273_AUDIO_ENABLE_I2S);
+               r = core->write(core, WL1273_AUDIO_ENABLE,
+                               WL1273_AUDIO_ENABLE_I2S);
                if (r)
                        goto out;
        }
@@ -142,8 +142,7 @@ out:
 static int snd_wl1273_fm_set_channel_number(struct wl1273_core *core,
                                            int channel_number)
 {
-       struct i2c_client *client = core->i2c_dev;
-       struct device *dev = &client->dev;
+       struct device *dev = &core->client->dev;
        int r = 0;
 
        dev_dbg(dev, "%s\n", __func__);
@@ -154,17 +153,13 @@ static int snd_wl1273_fm_set_channel_number(struct wl1273_core *core,
                goto out;
 
        if (channel_number == 1 && core->mode == WL1273_MODE_RX)
-               r = wl1273_fm_write_cmd(core, WL1273_MOST_MODE_SET,
-                                       WL1273_RX_MONO);
+               r = core->write(core, WL1273_MOST_MODE_SET, WL1273_RX_MONO);
        else if (channel_number == 1 && core->mode == WL1273_MODE_TX)
-               r = wl1273_fm_write_cmd(core, WL1273_MONO_SET,
-                                       WL1273_TX_MONO);
+               r = core->write(core, WL1273_MONO_SET, WL1273_TX_MONO);
        else if (channel_number == 2 && core->mode == WL1273_MODE_RX)
-               r = wl1273_fm_write_cmd(core, WL1273_MOST_MODE_SET,
-                                       WL1273_RX_STEREO);
+               r = core->write(core, WL1273_MOST_MODE_SET, WL1273_RX_STEREO);
        else if (channel_number == 2 && core->mode == WL1273_MODE_TX)
-               r = wl1273_fm_write_cmd(core, WL1273_MONO_SET,
-                                       WL1273_TX_STEREO);
+               r = core->write(core, WL1273_MONO_SET, WL1273_TX_STEREO);
        else
                r = -EINVAL;
 out:
@@ -237,7 +232,7 @@ static int snd_wl1273_fm_audio_put(struct snd_kcontrol *kcontrol,
        if (wl1273->core->audio_mode == val)
                return 0;
 
-       r = wl1273_fm_set_audio(wl1273->core, val);
+       r = wl1273->core->set_audio(wl1273->core, val);
        if (r < 0)
                return r;
 
@@ -272,8 +267,8 @@ static int snd_wl1273_fm_volume_put(struct snd_kcontrol *kcontrol,
 
        dev_dbg(codec->dev, "%s: enter.\n", __func__);
 
-       r = wl1273_fm_set_volume(wl1273->core,
-                                ucontrol->value.integer.value[0]);
+       r = wl1273->core->set_volume(wl1273->core,
+                                    ucontrol->value.integer.value[0]);
        if (r)
                return r;
 
index 14ed027fdcfc956995e11e5fdbbb7a7659fdef67..43ec7e668c51e35b29d86c5bd863cacbea9e1463 100644 (file)
 #ifndef __WL1273_CODEC_H__
 #define __WL1273_CODEC_H__
 
-/* I2S protocol, left channel first, data width 16 bits */
-#define WL1273_PCM_DEF_MODE            0x00
-
-/* Rx */
-#define WL1273_AUDIO_ENABLE_I2S                (1 << 0)
-#define WL1273_AUDIO_ENABLE_ANALOG     (1 << 1)
-
-/* Tx */
-#define WL1273_AUDIO_IO_SET_ANALOG     0
-#define WL1273_AUDIO_IO_SET_I2S                1
-
-#define WL1273_POWER_SET_OFF           0
-#define WL1273_POWER_SET_FM            (1 << 0)
-#define WL1273_POWER_SET_RDS           (1 << 1)
-#define WL1273_POWER_SET_RETENTION     (1 << 4)
-
-#define WL1273_PUPD_SET_OFF            0x00
-#define WL1273_PUPD_SET_ON             0x01
-#define WL1273_PUPD_SET_RETENTION      0x10
-
-/* I2S mode */
-#define WL1273_IS2_WIDTH_32    0x0
-#define WL1273_IS2_WIDTH_40    0x1
-#define WL1273_IS2_WIDTH_22_23 0x2
-#define WL1273_IS2_WIDTH_23_22 0x3
-#define WL1273_IS2_WIDTH_48    0x4
-#define WL1273_IS2_WIDTH_50    0x5
-#define WL1273_IS2_WIDTH_60    0x6
-#define WL1273_IS2_WIDTH_64    0x7
-#define WL1273_IS2_WIDTH_80    0x8
-#define WL1273_IS2_WIDTH_96    0x9
-#define WL1273_IS2_WIDTH_128   0xa
-#define WL1273_IS2_WIDTH       0xf
-
-#define WL1273_IS2_FORMAT_STD  (0x0 << 4)
-#define WL1273_IS2_FORMAT_LEFT (0x1 << 4)
-#define WL1273_IS2_FORMAT_RIGHT        (0x2 << 4)
-#define WL1273_IS2_FORMAT_USER (0x3 << 4)
-
-#define WL1273_IS2_MASTER      (0x0 << 6)
-#define WL1273_IS2_SLAVEW      (0x1 << 6)
-
-#define WL1273_IS2_TRI_AFTER_SENDING   (0x0 << 7)
-#define WL1273_IS2_TRI_ALWAYS_ACTIVE   (0x1 << 7)
-
-#define WL1273_IS2_SDOWS_RR    (0x0 << 8)
-#define WL1273_IS2_SDOWS_RF    (0x1 << 8)
-#define WL1273_IS2_SDOWS_FR    (0x2 << 8)
-#define WL1273_IS2_SDOWS_FF    (0x3 << 8)
-
-#define WL1273_IS2_TRI_OPT     (0x0 << 10)
-#define WL1273_IS2_TRI_ALWAYS  (0x1 << 10)
-
-#define WL1273_IS2_RATE_48K    (0x0 << 12)
-#define WL1273_IS2_RATE_44_1K  (0x1 << 12)
-#define WL1273_IS2_RATE_32K    (0x2 << 12)
-#define WL1273_IS2_RATE_22_05K (0x4 << 12)
-#define WL1273_IS2_RATE_16K    (0x5 << 12)
-#define WL1273_IS2_RATE_12K    (0x8 << 12)
-#define WL1273_IS2_RATE_11_025 (0x9 << 12)
-#define WL1273_IS2_RATE_8K     (0xa << 12)
-#define WL1273_IS2_RATE                (0xf << 12)
-
-#define WL1273_I2S_DEF_MODE    (WL1273_IS2_WIDTH_32 | \
-                                WL1273_IS2_FORMAT_STD | \
-                                WL1273_IS2_MASTER | \
-                                WL1273_IS2_TRI_AFTER_SENDING | \
-                                WL1273_IS2_SDOWS_RR | \
-                                WL1273_IS2_TRI_OPT | \
-                                WL1273_IS2_RATE_48K)
-
 int wl1273_get_format(struct snd_soc_codec *codec, unsigned int *fmt);
 
 #endif /* End of __WL1273_CODEC_H__ */
index 5c87a634fc042aa7d4da4f8831b85e3c76ade603..100aeee5ba96472e0a0ecb70b7f66d9c4a550d5a 100644 (file)
@@ -1183,7 +1183,7 @@ static int wm8990_set_bias_level(struct snd_soc_codec *codec,
                                     WM8990_VMIDTOG);
 
                        /* Delay to allow output caps to discharge */
-                       msleep(msecs_to_jiffies(300));
+                       msleep(300);
 
                        /* Disable VMIDTOG */
                        snd_soc_write(codec, WM8990_ANTIPOP2, WM8990_SOFTST |
@@ -1195,17 +1195,17 @@ static int wm8990_set_bias_level(struct snd_soc_codec *codec,
                        /* Enable outputs */
                        snd_soc_write(codec, WM8990_POWER_MANAGEMENT_1, 0x1b00);
 
-                       msleep(msecs_to_jiffies(50));
+                       msleep(50);
 
                        /* Enable VMID at 2x50k */
                        snd_soc_write(codec, WM8990_POWER_MANAGEMENT_1, 0x1f02);
 
-                       msleep(msecs_to_jiffies(100));
+                       msleep(100);
 
                        /* Enable VREF */
                        snd_soc_write(codec, WM8990_POWER_MANAGEMENT_1, 0x1f03);
 
-                       msleep(msecs_to_jiffies(600));
+                       msleep(600);
 
                        /* Enable BUFIOEN */
                        snd_soc_write(codec, WM8990_ANTIPOP2, WM8990_SOFTST |
@@ -1250,7 +1250,7 @@ static int wm8990_set_bias_level(struct snd_soc_codec *codec,
                /* Disable VMID */
                snd_soc_write(codec, WM8990_POWER_MANAGEMENT_1, 0x1f01);
 
-               msleep(msecs_to_jiffies(300));
+               msleep(300);
 
                /* Enable all output discharge bits */
                snd_soc_write(codec, WM8990_ANTIPOP1, WM8990_DIS_LLINE |
index 9ac93f6b4f855b87e62893d448e347d41a272708..fff579a1c1344974332e055b7ef5b1eec225552c 100644 (file)
@@ -267,14 +267,16 @@ static int ep93xx_i2s_hw_params(struct snd_pcm_substream *substream,
                ep93xx_i2s_write_reg(info, EP93XX_I2S_RXWRDLEN, word_len);
 
        /*
-        * Calculate the sdiv (bit clock) and lrdiv (left/right clock) values.
-        * If the lrclk is pulse length is larger than the word size, then the
-        * bit clock will be gated for the unused bits.
+        * EP93xx I2S module can be setup so SCLK / LRCLK value can be
+        * 32, 64, 128. MCLK / SCLK value can be 2 and 4.
+        * We set LRCLK equal to `rate' and minimum SCLK / LRCLK 
+        * value is 64, because our sample size is 32 bit * 2 channels.
+        * I2S standard permits us to transmit more bits than
+        * the codec uses.
         */
-       div = (clk_get_rate(info->mclk) / params_rate(params)) *
-               params_channels(params);
+       div = clk_get_rate(info->mclk) / params_rate(params);
        for (sdiv = 2; sdiv <= 4; sdiv += 2)
-               for (lrdiv = 32; lrdiv <= 128; lrdiv <<= 1)
+               for (lrdiv = 64; lrdiv <= 128; lrdiv <<= 1)
                        if (sdiv * lrdiv == div) {
                                found = 1;
                                goto out;
@@ -341,9 +343,7 @@ static struct snd_soc_dai_ops ep93xx_i2s_dai_ops = {
        .set_fmt        = ep93xx_i2s_set_dai_fmt,
 };
 
-#define EP93XX_I2S_FORMATS (SNDRV_PCM_FMTBIT_S16_LE | \
-                           SNDRV_PCM_FMTBIT_S24_LE | \
-                           SNDRV_PCM_FMTBIT_S32_LE)
+#define EP93XX_I2S_FORMATS (SNDRV_PCM_FMTBIT_S32_LE)
 
 static struct snd_soc_dai_driver ep93xx_i2s_dai = {
        .symmetric_rates= 1,
index 2d4f896d7fec56bcf792839efc30be78346eba48..3ceaef68e01de7aebab8d7d16a6715d3bcfedfbb 100644 (file)
@@ -104,6 +104,7 @@ static struct snd_soc_jack_gpio hs_jack_gpios[] = {
                .name           = "hsdet-gpio",
                .report         = SND_JACK_HEADSET,
                .debounce_time  = 200,
+               .invert         = 1,
        },
 };
 
@@ -192,7 +193,7 @@ static struct snd_soc_dai_link z2_dai = {
        .cpu_dai_name   = "pxa2xx-i2s",
        .codec_dai_name = "wm8750-hifi",
        .platform_name = "pxa-pcm-audio",
-       .codec_name     = "wm8750-codec.0-001a",
+       .codec_name     = "wm8750-codec.0-001b",
        .init           = z2_wm8750_init,
        .ops            = &z2_ops,
 };
index df6064ad9bf24b61c5dbc074c9bf68058b50158a..fcd29e8af29fe7cbb14e4563c906688f62e10f78 100644 (file)
@@ -936,6 +936,8 @@ int cmd_record(int argc, const char **argv, const char *prefix __used)
        list_for_each_entry(pos, &evsel_list, node) {
                if (perf_evsel__alloc_fd(pos, cpus->nr, threads->nr) < 0)
                        goto out_free_fd;
+               if (perf_header__push_event(pos->attr.config, event_name(pos)))
+                       goto out_free_fd;
        }
        event_array = malloc((sizeof(struct pollfd) * MAX_NR_CPUS *
                              MAX_COUNTERS * threads->nr));
index 5cb6f4bde9055b84c202970cd39b86ce7f144f54..bc2732ee23eb3d1de29d56366ffb93afcea8aed9 100644 (file)
@@ -490,32 +490,6 @@ parse_multiple_tracepoint_event(char *sys_name, const char *evt_exp,
        return EVT_HANDLED_ALL;
 }
 
-static int store_event_type(const char *orgname)
-{
-       char filename[PATH_MAX], *c;
-       FILE *file;
-       int id, n;
-
-       sprintf(filename, "%s/", debugfs_path);
-       strncat(filename, orgname, strlen(orgname));
-       strcat(filename, "/id");
-
-       c = strchr(filename, ':');
-       if (c)
-               *c = '/';
-
-       file = fopen(filename, "r");
-       if (!file)
-               return 0;
-       n = fscanf(file, "%i", &id);
-       fclose(file);
-       if (n < 1) {
-               pr_err("cannot store event ID\n");
-               return -EINVAL;
-       }
-       return perf_header__push_event(id, orgname);
-}
-
 static enum event_result parse_tracepoint_event(const char **strp,
                                    struct perf_event_attr *attr)
 {
@@ -555,13 +529,10 @@ static enum event_result parse_tracepoint_event(const char **strp,
        if (evt_length >= MAX_EVENT_LENGTH)
                return EVT_FAILED;
        if (strpbrk(evt_name, "*?")) {
-               *strp += strlen(sys_name) + evt_length;
+               *strp += strlen(sys_name) + evt_length + 1; /* 1 == the ':' */
                return parse_multiple_tracepoint_event(sys_name, evt_name,
                                                       flags);
        } else {
-               if (store_event_type(evt_name) < 0)
-                       return EVT_FAILED;
-
                return parse_single_tracepoint_event(sys_name, evt_name,
                                                     evt_length, attr, strp);
        }
index 4780deac5974fb9e75a820b6cad1c0b07569954c..65b845bd4e3e792ca09ce01aa31da92ced51a302 100644 (file)
@@ -46,7 +46,7 @@ config INITRAMFS_ROOT_GID
          If you are not sure, leave it set to "0".
 
 config RD_GZIP
-       bool "Support initial ramdisks compressed using gzip" if EMBEDDED
+       bool "Support initial ramdisks compressed using gzip" if EXPERT
        default y
        depends on BLK_DEV_INITRD
        select DECOMPRESS_GZIP
@@ -55,8 +55,8 @@ config RD_GZIP
          If unsure, say Y.
 
 config RD_BZIP2
-       bool "Support initial ramdisks compressed using bzip2" if EMBEDDED
-       default !EMBEDDED
+       bool "Support initial ramdisks compressed using bzip2" if EXPERT
+       default !EXPERT
        depends on BLK_DEV_INITRD
        select DECOMPRESS_BZIP2
        help
@@ -64,8 +64,8 @@ config RD_BZIP2
          If unsure, say N.
 
 config RD_LZMA
-       bool "Support initial ramdisks compressed using LZMA" if EMBEDDED
-       default !EMBEDDED
+       bool "Support initial ramdisks compressed using LZMA" if EXPERT
+       default !EXPERT
        depends on BLK_DEV_INITRD
        select DECOMPRESS_LZMA
        help
@@ -73,8 +73,8 @@ config RD_LZMA
          If unsure, say N.
 
 config RD_XZ
-       bool "Support initial ramdisks compressed using XZ" if EMBEDDED
-       default !EMBEDDED
+       bool "Support initial ramdisks compressed using XZ" if EXPERT
+       default !EXPERT
        depends on BLK_DEV_INITRD
        select DECOMPRESS_XZ
        help
@@ -82,8 +82,8 @@ config RD_XZ
          If unsure, say N.
 
 config RD_LZO
-       bool "Support initial ramdisks compressed using LZO" if EMBEDDED
-       default !EMBEDDED
+       bool "Support initial ramdisks compressed using LZO" if EXPERT
+       default !EXPERT
        depends on BLK_DEV_INITRD
        select DECOMPRESS_LZO
        help